/
Alcatraz
/
Wagomon
Обзор
Документация
Войти
/
Alcatraz
/
Wagomon
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
node_modules/prettier/plugins/html.js
22 строки
150 KB
saitgalineu
fix
27 фев 2026, 12:39
27 фев 2026, 12:39
a5092f1
Код
Авторство
О чём код?
(function(f){function e(){var i=f();return i.default||i}if(typeof exports=="object"&&typeof module=="object")module.exports=e();else if(typeof define=="function"&&define.amd)define(e);else{var t=typeof globalThis<"u"?globalThis:typeof global<"u"?global:typeof self<"u"?self:this||{};t.prettierPlugins=t.prettierPlugins||{},t.prettierPlugins.html=e()}})(function(){"use strict";var At=Object.defineProperty;var Ei=Object.getOwnPropertyDescriptor;var Ai=Object.getOwnPropertyNames;var Di=Object.prototype.hasOwnProperty;var on=t=>{throw TypeError(t)};var vi=(t,e,r)=>e in t?At(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var un=(t,e)=>{for(var r in e)At(t,r,{get:e[r],enumerable:!0})},yi=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Ai(e))!Di.call(t,s)&&s!==r&&At(t,s,{get:()=>e[s],enumerable:!(n=Ei(e,s))||n.enumerable});return t};var wi=t=>yi(At({},"__esModule",{value:!0}),t);var cr=(t,e,r)=>vi(t,typeof e!="symbol"?e+"":e,r),ln=(t,e,r)=>e.has(t)||on("Cannot "+r);var R=(t,e,r)=>(ln(t,e,"read from private field"),r?r.call(t):e.get(t)),Dt=(t,e,r)=>e.has(t)?on("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),cn=(t,e,r,n)=>(ln(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r);var mu={};un(mu,{languages:()=>qs,options:()=>Vs,parsers:()=>rn,printers:()=>hu});var bi=(t,e,r,n)=>{if(!(t&&e==null))return e.replaceAll?e.replaceAll(r,n):r.global?e.replace(r,n):e.split(r).join(n)},w=bi;var we="string",ze="array",Ye="cursor",be="indent",Te="align",je="trim",xe="group",ke="fill",ce="if-break",Be="indent-if-break",Ke="line-suffix",Xe="line-suffix-boundary",j="line",Qe="label",Le="break-parent",vt=new Set([Ye,be,Te,je,xe,ke,ce,Be,Ke,Xe,j,Qe,Le]);var Ti=(t,e,r)=>{if(!(t&&e==null))return Array.isArray(e)||typeof e=="string"?e[r<0?e.length+r:r]:e.at(r)},K=Ti;function xi(t){if(typeof t=="string")return we;if(Array.isArray(t))return ze;if(!t)return;let{type:e}=t;if(vt.has(e))return e}var Fe=xi;var ki=t=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(t);function Bi(t){let e=t===null?"null":typeof t;if(e!=="string"&&e!=="object")return`Unexpected doc '${e}', Expected it to be 'string' or 'object'.`;if(Fe(t))throw new Error("doc is valid.");let r=Object.prototype.toString.call(t);if(r!=="[object Object]")return`Unexpected doc '${r}'.`;let n=ki([...vt].map(s=>`'${s}'`));return`Unexpected doc.type '${t.type}'. Expected it to be ${n}.`}var pr=class extends Error{name="InvalidDocError";constructor(e){super(Bi(e)),this.doc=e}},hr=pr;function mr(t,e){if(typeof t=="string")return e(t);let r=new Map;return n(t);function n(i){if(r.has(i))return r.get(i);let a=s(i);return r.set(i,a),a}function s(i){switch(Fe(i)){case ze:return e(i.map(n));case ke:return e({...i,parts:i.parts.map(n)});case ce:return e({...i,breakContents:n(i.breakContents),flatContents:n(i.flatContents)});case xe:{let{expandedStates:a,contents:o}=i;return a?(a=a.map(n),o=a[0]):o=n(o),e({...i,contents:o,expandedStates:a})}case Te:case be:case Be:case Qe:case Ke:return e({...i,contents:n(i.contents)});case we:case Ye:case je:case Xe:case j:case Le:return e(i);default:throw new hr(i)}}}function B(t,e=pn){return mr(t,r=>typeof r=="string"?H(e,r.split(` `)):r)}var fr=()=>{},re=fr,dr=fr,hn=fr;function k(t){return re(t),{type:be,contents:t}}function mn(t,e){return re(e),{type:Te,contents:e,n:t}}function E(t,e={}){return re(t),dr(e.expandedStates,!0),{type:xe,id:e.id,contents:t,break:!!e.shouldBreak,expandedStates:e.expandedStates}}function fn(t){return mn(Number.NEGATIVE_INFINITY,t)}function dn(t){return mn({type:"root"},t)}function yt(t){return hn(t),{type:ke,parts:t}}function pe(t,e="",r={}){return re(t),e!==""&&re(e),{type:ce,breakContents:t,flatContents:e,groupId:r.groupId}}function gn(t,e){return re(t),{type:Be,contents:t,groupId:e.groupId,negate:e.negate}}var ne={type:Le};var Fi={type:j,hard:!0},Pi={type:j,hard:!0,literal:!0},_={type:j},v={type:j,soft:!0},S=[Fi,ne],pn=[Pi,ne];function H(t,e){re(t),dr(e);let r=[];for(let n=0;n<e.length;n++)n!==0&&r.push(t),r.push(e[n]);return r}var wt="'",Cn='"';function Ni(t,e){let r=e===!0||e===wt?wt:Cn,n=r===wt?Cn:wt,s=0,i=0;for(let a of t)a===r?s++:a===n&&i++;return s>i?n:r}var Sn=Ni;function gr(t){if(typeof t!="string")throw new TypeError("Expected a string");return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var V,Cr=class{constructor(e){Dt(this,V);cn(this,V,new Set(e))}getLeadingWhitespaceCount(e){let r=R(this,V),n=0;for(let s=0;s<e.length&&r.has(e.charAt(s));s++)n++;return n}getTrailingWhitespaceCount(e){let r=R(this,V),n=0;for(let s=e.length-1;s>=0&&r.has(e.charAt(s));s--)n++;return n}getLeadingWhitespace(e){let r=this.getLeadingWhitespaceCount(e);return e.slice(0,r)}getTrailingWhitespace(e){let r=this.getTrailingWhitespaceCount(e);return e.slice(e.length-r)}hasLeadingWhitespace(e){return R(this,V).has(e.charAt(0))}hasTrailingWhitespace(e){return R(this,V).has(K(!1,e,-1))}trimStart(e){let r=this.getLeadingWhitespaceCount(e);return e.slice(r)}trimEnd(e){let r=this.getTrailingWhitespaceCount(e);return e.slice(0,e.length-r)}trim(e){return this.trimEnd(this.trimStart(e))}split(e,r=!1){let n=`[${gr([...R(this,V)].join(""))}]+`,s=new RegExp(r?`(${n})`:n,"u");return e.split(s)}hasWhitespaceCharacter(e){let r=R(this,V);return Array.prototype.some.call(e,n=>r.has(n))}hasNonWhitespaceCharacter(e){let r=R(this,V);return Array.prototype.some.call(e,n=>!r.has(n))}isWhitespaceOnly(e){let r=R(this,V);return Array.prototype.every.call(e,n=>r.has(n))}};V=new WeakMap;var _n=Cr;var Ii=[" ",` `,"\f","\r"," "],Ri=new _n(Ii),O=Ri;var Sr=class extends Error{name="UnexpectedNodeError";constructor(e,r,n="type"){super(`Unexpected ${r} node ${n}: ${JSON.stringify(e[n])}.`),this.node=e}},En=Sr;fun … [Строка слишком длинная. Вы можете скачать файл] `)){if(r.length===0)continue;let n=O.getLeadingWhitespaceCount(r);if(n===0)return 0;r.length!==n&&n<e&&(e=n)}return e===Number.POSITIVE_INFINITY?0:e}function wr(t,e=ca(t)){return e===0?t:t.split(` `).map(r=>r.slice(e)).join(` `)}function br(t){return w(!1,w(!1,t,"'","'"),""",'"')}function P(t){return br(t.value)}var pa=new Set(["template","style","script"]);function et(t,e){return Ce(t,e)&&!pa.has(t.fullName)}function Ce(t,e){return e.parser==="vue"&&t.type==="element"&&t.parent.type==="root"&&t.fullName.toLowerCase()!=="html"}function kt(t,e){return Ce(t,e)&&(et(t,e)||t.attrMap.lang&&t.attrMap.lang!=="html")}function Jn(t){let e=t.fullName;return e.charAt(0)==="#"||e==="slot-scope"||e==="v-slot"||e.startsWith("v-slot:")}function Zn(t,e){let r=t.parent;if(!Ce(r,e))return!1;let n=r.fullName,s=t.fullName;return n==="script"&&s==="setup"||n==="style"&&s==="vars"}function Bt(t,e=t.value){return t.parent.isWhitespaceSensitive?t.parent.isIndentationSensitive?B(e):B(wr(Ar(e)),S):H(_,O.split(e))}function Lt(t,e){return Ce(t,e)&&t.name==="script"}var Tr=/\{\{(.+?)\}\}/su;async function es(t,e){let r=[];for(let[n,s]of t.split(Tr).entries())if(n%2===0)r.push(B(s));else try{r.push(E(["{{",k([_,await T(s,e,{parser:"__ng_interpolation",__isInHtmlInterpolation:!0})]),_,"}}"]))}catch{r.push("{{",B(s),"}}")}return r}function xr({parser:t}){return(e,r,n)=>T(P(n.node),e,{parser:t},X)}var ha=xr({parser:"__ng_action"}),ma=xr({parser:"__ng_binding"}),fa=xr({parser:"__ng_directive"});function da(t,e){if(e.parser!=="angular")return;let{node:r}=t,n=r.fullName;if(n.startsWith("(")&&n.endsWith(")")||n.startsWith("on-"))return ha;if(n.startsWith("[")&&n.endsWith("]")||/^bind(?:on)?-/u.test(n)||/^ng-(?:if|show|hide|class|style)$/u.test(n))return ma;if(n.startsWith("*"))return fa;let s=P(r);if(/^i18n(?:-.+)?$/u.test(n))return()=>he(yt(Bt(r,s.trim())),!s.includes("@@"));if(Tr.test(s))return i=>es(s,i)}var ts=da;function ga(t,e){let{node:r}=t,n=P(r);if(r.fullName==="class"&&!e.parentParser&&!n.includes("{{"))return()=>n.trim().split(/\s+/u).join(" ")}var rs=ga;function ns(t){return t===" "||t===` `||t==="\f"||t==="\r"||t===" "}var Ca=/^[ \t\n\r\u000c]+/,Sa=/^[, \t\n\r\u000c]+/,_a=/^[^ \t\n\r\u000c]+/,Ea=/[,]+$/,ss=/^\d+$/,Aa=/^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/;function Da(t){le … [Строка слишком длинная. Вы можете скачать файл] ${t}`}var Ts=new Map([["if",new Set(["else if","else"])],["else if",new Set(["else if","else"])],["for",new Set(["empty"])],["defer",new Set(["placeholder","error","loading"])],["placeholder",new Set(["placeholder","error","loading"])],["error",new Set(["placeholder","error","loading"])],["loading",new Set(["placeholder","error","loading"])]]);function xs(t){let e=se(t);return t.type==="element"&&!t.endSourceSpan&&me(t.children)?Math.max(e,xs(K(!1,t.children,-1))):e}function ot(t,e,r){let n=t.node;if(ge(n)){let s=xs(n);return[z(n,e),B(O.trimEnd(e.originalText.slice(J(n)+(n.prev&&rt(n.prev)?Pt(n).length:0),s-(n.next&&Q(n.next)?_e(n,e).length:0)))),G(n,e)]}return r()}function Rt(t,e){return $(t)&&$(e)?t.isTrailingSpaceSensitive?t.hasTrailingSpaces?Tt(e)?S:_:"":Tt(e)?S:v:rt(t)&&(ge(e)||e.firstChild||e.isSelfClosing||e.type==="element"&&e.attrs.length>0)||t.type==="element"&&t.isSelfClosing&&Q(e)?"":!e.isLeadingSpaceSensitive||Tt(e)||Q(e)&&t.lastChild&&Ae(t.lastChild)&&t.lastChild.lastChild&&Ae(t.lastChild.lastChild)?S:e.hasLeadingSpaces?_:v}function Re(t,e,r){let{node:n}=t;if(vr(n))return[ne,...t.map(i=>{let a=i.node,o=a.prev?Rt(a.prev,a):"";return[o?[o,Je(a.prev)?S:""]:"",ot(i,e,r)]},"children")];let s=n.children.map(()=>Symbol(""));return t.map((i,a)=>{let o=i.node;if($(o)){if(o.prev&&$(o.prev)){let A=Rt(o.prev,o);if(A)return Je(o.prev)?[S,S,ot(i,e,r)]:[A,ot(i,e,r)]}return ot(i,e,r)}let u=[],p=[],l=[],m=[],f=o.prev?Rt(o.prev,o):"",C=o.next?Rt(o,o.next):"";return f&&(Je(o.prev)?u.push(S,S):f===S?u.push(S):$(o.prev)?p.push(f):p.push(pe("",v,{groupId:s[a-1]}))),C&&(Je(o)?$(o.next)&&m.push(S,S):C===S?$(o.next)&&m.push(S):l.push(C)),[...u,E([...p,E([ot(i,e,r),...l],{id:s[a]})]),...m]},"children")}function ks(t,e,r){let{node:n}=t,s=[];za(t)&&s.push("} "),s.push("@",n.name),n.parameters&&s.push(" (",E(r("parameters")),")"),s.push(" {");let i=Bs(n);return n.children.length>0?(n.firstChild.hasLeadingSpaces=!0,n.lastChild.hasTrailingSpaces=!0,s.push(k([S,Re(t,e,r)])),i&&s.push(S,"}")):i&&s.push("}"),E(s,{shouldBreak:!0})}function Bs(t){var e,r;return!(((e=t.next)==null?void 0:e.type)==="angularControlFlowBlock"&&((r=Ts.get(t.name))!=null&&r.has(t.next.name)))}function za(t){let{previous:e}=t;return(e==null?void 0:e.type)==="angularControlFlowBlock"&&!ge(e)&&!Bs(e)}function Ls(t,e,r){return[k([v,H([";",_],t.map(r,"children"))]),v]}function Fs(t,e,r){let{node:n}=t;return[De(n,e),E([n.switchValue.trim(),", ",n.clause,n.cases.length>0?[",",k([_,H(_,t.map(r,"cases"))])]:"",v]),Se(n,e)]}function Ps(t,e,r){let{node:n}=t;return[n.value," {",E([k([v,t.map(({node:s,isLast:i})=>{let a=[r()];return s.type==="text"&&(s.hasLeadingSpaces&&a.unshift(_),s.hasTrailingSpaces&&!i&&a.push(_)),a},"expression")]),v]),"}"]}function Ns(t,e,r){let{node:n}=t;if(bt(n,e))return[z(n,e),E(st(t,e,r)),B(It(n,e)),...tt(n,e),G(n,e)];let s=n.children.length===1&&(n.firstChild.type==="interpolation"||n.firstChild.type==="angularIcuExpression")&&n.firstChild.isLeadingSpaceSensitive&&!n.firstChild.hasLeadingSpaces&&n.lastChild.isTrailingSpaceSensitive&&!n.lastChild.hasTrailingSpaces,i=Symbol("element-attr-group-id"),a=l=>E([E(st(t,e,r),{id:i}),l,tt(n,e)]),o=l=>s?gn(l,{groupId:i}):(W(n,e)||et(n,e))&&n.parent.type==="root"&&e.parser==="vue"&&!e.vueIndentScriptAndStyle?l:k(l),u=()=>s?pe(v,"",{groupId:i}):n.firstChild.hasLeadingSpaces&&n.firstChild.isLeadingSpaceSensitive?_:n.firstChild.type==="text"&&n.isWhitespaceSensitive&&n.isIndentationSensitive?fn(v):v,p=()=>(n.next?Q(n.next):Ee(n.parent))?n.lastChild.hasTrailingSpaces&&n.lastChild.isTrailingSpaceSensitive?" ":"":s?pe(v,"",{groupId:i}):n.lastChild.hasTrailingSpaces&&n.lastChild.isTrailingSpaceSensitive?_:(n.lastChild.type==="comment"||n.lastChild.type==="text"&&n.isWhitespaceSensitive&&n.isIndentationSensitive)&&new RegExp(`\\n[\\t ]{${e.tabWidth*(t.ancestors.length-1)}}$`,"u").test(n.lastChild.value)?"":v;return n.children.length===0?a(n.hasDanglingSpaces&&n.isDanglingSpaceSensitive?_:""):a([Wn(n)?ne:"",o([u(),Re(t,e,r)]),p()])}function ut(t){return t>=9&&t<=32||t==160}function $t(t){return 48<=t&&t<=57}function lt(t){return t>=97&&t<=122||t>=65&&t<=90}function Is(t){return t>=97&&t<=102||t>=65&&t<=70||$t(t)}function Ot(t){return t===10||t===13}function Lr(t){return 48<=t&&t<=55}function Mt(t){return t===39||t===34||t===96}var Ya=/-+([a-z0-9])/g;function $s(t){return t.replace(Ya,(...e)=>e[1].toUpperCase())}var ie=class t{constructor(e,r,n,s){this.file=e,this.offset=r,this.line=n,this.col=s}toString(){return this.offset!=null?`${this.file.url}@${this.line}:${this.col}`:this.file.url}moveBy(e){let r=this.file.content,n=r.length,s=this.offset,i=this.line,a=this.col;for(;s>0&&e<0;)if(s--,e++,r.charCodeAt(s)==10){i--;let u=r.substring(0,s-1).lastIndexOf(String.fromCharCode(10));a=u>0?s-u:s}else a--;for(;s<n&&e>0;){let o=r.charCodeAt(s);s++,e--,o==10?(i++,a=0):a++}return new t(this.file,s,i,a)}getContext(e,r){let n=this.file.content,s=this.offset;if(s!=null){s>n.length-1&&(s=n.length-1);let i=s,a=0,o=0;for(;a<e&&s>0&&(s--,a++,!(n[s]==` `&&++o==r)););for(a=0,o=0;a<e&&i<n.length-1&&(i++,a++,!(n[i]==` `&&++o==r)););return{before:n.substring(s,this.offset),after:n.substring(this.offset,i+1)}}return null}},ve=class{constructor(e,r){this.content=e,this.url=r}},h=class{constructor(e,r,n=e,s=null){this.start=e,this.end=r,this.fullStart=n,this.details=s}toString(){return this.start.file.content.substring(this.start.offset,this.end.offset)}},qt;(function(t){t[t.WARNING=0]="WARNING",t[t.ERROR=1]="ERROR"})(qt||(qt={}));var Oe=class{constructor(e,r,n=qt.ERROR,s){this.span=e,this.msg=r,this.level=n,this.relatedError=s}contextualMessage(){let e=this.span.start.getContext(100,3);return e?`${this.msg} ("${e.before}[${qt[this.level]} ->]${e.after}")`:this.msg}toString(){let e=this.span.details?`, ${this.span.details}`:"";return`${this.contextualMessage()}: ${this.span.start}${e}`}};var ja=[Xa,Qa,Za,to,ro,io,no,so,ao,eo];function Ka(t,e){for(let r of ja)r(t,e);return t}function Xa(t){t.walk(e=>{if(e.type==="element"&&e.tagDefinition.ignoreFirstLf&&e.children.length>0&&e.children[0].type==="text"&&e.children[0].value[0]===` `){let r=e.children[0];r.value.length===1?e.removeChild(r):r.value=r.value.slice(1)}})}function Qa(t){let e=r=>{var n,s;return r.type==="element"&&((n=r.prev)==null?void 0:n.type)==="ieConditionalStar … [Строка слишком длинная. Вы можете скачать файл] If '${e}' is a directive input, make sure the directive is imported by the current module.`}:{error:!1}}validateAttribute(e){return e.toLowerCase().startsWith("on")?{error:!0,msg:`Binding to event att … [Строка слишком длинная. Вы можете скачать файл] `,Nfr:"\u{1D511}",NoBreak:"\u2060",NonBreakingSpace:"\xA0",nbsp:"\xA0",Nopf:"\u2115",naturals:"\u2115",Not:"\u2AEC",NotCongruent:"\u2262",nequiv:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u222 … [Строка слишком длинная. Вы можете скачать файл] `)}tokenize(){for(;this._cursor.peek()!==0;){let e=this._cursor.clone();try{if(this._attemptCharCode(60))if(this._attemptCharCode(33))this._attemptStr("[CDATA[")?this._consumeCdata(e):this._attemptStr … [Строка слишком длинная. Вы можете скачать файл] `){let n=this._getClosestParentElement();n!=null&&n.children.length==0&&this.getTagDefinition(n.name).ignoreFirstLf&&(r=r.substring(1))}return r}_consumeText(e){let r=[e],n=e.sourceSpan,s=e.parts[0];if(s.length>0&&s[0]===` `){let i=this._getContainer();i!=null&&i.children.length===0&&this.getTagDefinition(i.name).ignoreFirstLf&&(s=s.substring(1),r[0]={type:e.type,sourceSpan:e.sourceSpan,parts:[s]})}for(;this._peek.type===8||this._peek.type===5||this._peek.type===9;)e=this._advance(),r.push(e),e.type===8?s+=e.parts.join("").replace(/&([^;]+);/g,ci):e.type===9?s+=e.parts[0]:s+=e.parts.join("");if(s.length>0){let i=e.sourceSpan;this._addToParent(new Gt(s,new h(n.start,i.end,n.fullStart,n.details),r))}}_closeVoidElement(){let e=this._getContainer();e instanceof Y&&this.getTagDefinition(e.name).isVoid&&this._containerStack.pop()}_consumeStartTag(e){let[r,n]=e.parts,s=[];for(;this._peek.type===14;)s.push(this._consumeAttr(this._advance()));let i=this._getElementFullName(r,n,this._getClosestParentElement()),a=!1;if(this._peek.type===2){this._advance(),a=!0;let C=this.getTagDefinition(i);this.canSelfClose||C.canSelfClose||Me(i)!==null||C.isVoid||this.errors.push(L.create(i,e.sourceSpan,`Only void, custom and foreign elements can be self closed "${e.parts[1]}"`))}else this._peek.type===1&&(this._advance(),a=!1);let o=this._peek.sourceSpan.fullStart,u=new h(e.sourceSpan.start,o,e.sourceSpan.fullStart),p=new h(e.sourceSpan.start,o,e.sourceSpan.fullStart),l=new h(e.sourceSpan.start.moveBy(1),e.sourceSpan.end),m=new Y(i,s,[],u,p,void 0,l),f=this._getContainer();this._pushContainer(m,f instanceof Y&&this.getTagDefinition(f.name).isClosedByChild(m.name)),a?this._popContainer(i,Y,u):e.type===4&&(this._popContainer(i,Y,null),this.errors.push(L.create(i,u,`Opening tag "${i}" not terminated.`)))}_pushContainer(e,r){r&&this._containerStack.pop(),this._addToParent(e),this._containerStack.push(e)}_consumeEndTag(e){let r=this.allowHtmComponentClosingTags&&e.parts.length===0?null:this._getElementFullName(e.parts[0],e.parts[1],this._getClosestParentElement());if(r&&this.getTagDefinition(r).isVoid)this.errors.push(L.create(r,e.sourceSpan,`Void elements do not have end tags "${e.parts[1]}"`));else if(!this._popContainer(r,Y,e.sourceSpan)){let n=`Unexpected closing tag "${r}". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags`;this.errors.push(L.create(r,e.sourceSpan,n))}}_popContainer(e,r,n){let s=!1;for(let i=this._containerStack.length-1;i>=0;i--){let a=this._containerStack[i];if(Me(a.name)?a.name===e:(e==null||a.name.toLowerCase()===e.toLowerCase())&&a instanceof r)return a.endSourceSpan=n,a.sourceSpan.end=n!==null?n.end:a.sourceSpan.end,this._containerStack.splice(i,this._containerStack.length-i),!s;(a instanceof ee||a instanceof Y&&!this.getTagDefinition(a.name).closedByParent)&&(s=!0)}return!1}_consumeAttr(e){let r=qe(e.parts[0],e.parts[1]),n=e.sourceSpan.end,s;this._peek.type===15&&(s=this._advance());let i="",a=[],o,u;if(this._peek.type===16)for(o=this._peek.sourceSpan,u=this._peek.sourceSpan.end;this._peek.type===16||this._peek.type===17||this._peek.type===9;){let m=this._advance();a.push(m),m.type===17?i+=m.parts.join("").replace(/&([^;]+);/g,ci):m.type===9?i+=m.parts[0]:i+=m.parts.join(""),u=n=m.sourceSpan.end}this._peek.type===15&&(u=n=this._advance().sourceSpan.end);let l=o&&u&&new h((s==null?void 0:s.sourceSpan.start)??o.start,u,(s==null?void 0:s.sourceSpan.fullStart)??o.fullStart);return new Kt(r,i,new h(e.sourceSpan.start,n,e.sourceSpan.fullStart),e.sourceSpan,l,a.length>0?a:void 0,void 0)}_consumeBlockOpen(e){let r=[];for(;this._peek.type===28;){let o=this._advance();r.push(new ht(o.parts[0],o.sourceSpan))}this._peek.type===26&&this._advance();let n=this._peek.sourceSpan.fullStart,s=new h(e.sourceSpan.start,n,e.sourceSpan.fullStart),i=new h(e.sourceSpan.start,n,e.sourceSpan.fullStart),a=new ee(e.parts[0],r,[],s,e.sourceSpan,i);this._pushContainer(a,!1)}_consumeBlockClose(e){this._popContainer(null,ee,e.sourceSpan)||this.errors.push(L.create(null,e.sourceSpan,'Unexpected closing block. The block may have been closed earlier. If you meant to write the } character, you should use the "}" HTML entity instead.'))}_consumeIncompleteBlock(e){let r=[];for(;this._peek.type===28;){let o=this._advance();r.push(new ht(o.parts[0],o.sourceSpan))}let n=this._peek.sourceSpan.fullStart,s=new h(e.sourceSpan.start,n,e.sourceSpan.fullStart),i=new h(e.sourceSpan.start,n,e.sourceSpan.fullStart),a=new ee(e.parts[0],r,[],s,e.sourceSpan,i);this._pushContainer(a,!1),this._popContainer(null,ee,null),this.errors.push(L.create(e.parts[0],s,`Incomplete block "${e.parts[0]}". If you meant to write the @ character, you should use the "@" HTML entity instead.`))}_consumeLet(e){let r=e.parts[0],n,s;if(this._peek.type!==31){this.errors.push(L.create(e.parts[0],e.sourceSpan,`Invalid @let declaration "${r}". Declaration must have a value.`));return}else n=this._advance();if(this._peek.type!==32){this.errors.push(L.create(e.parts[0],e.sourceSpan,`Unterminated @let declaration "${r}". Declaration must be terminated with a semicolon.`));return}else s=this._advance();let i=s.sourceSpan.fullStart,a=new h(e.sourceSpan.start,i,e.sourceSpan.fullStart),o=e.sourceSpan.toString().lastIndexOf(r),u=e.sourceSpan.start.moveBy(o),p=new h(u,e.sourceSpan.end),l=new mt(r,n.parts[0],a,p,n.sourceSpan);this._addToParent(l)}_consumeIncompleteLet(e){let r=e.parts[0]??"",n=r?` "${r}"`:"";if(r.length>0){let s=e.sourceSpan.toString().lastIndexOf(r),i=e.sourceSpan.start.moveBy(s),a=new h(i,e.sourceSpan.end),o=new h(e.sourceSpan.start,e.sourceSpan.start.moveBy(0)),u=new mt(r,"",e.sourceSpan,a,o);this._addToParent(u)}this.errors.push(L.create(e.parts[0],e.sourceSpan,`Incomplete @let declaration${n}. @let declarations must be written as \`@let <name> = <value>;\``))}_getContainer(){return this._containerStack.length>0?this._containerStack[this._containerStack.length-1]:null}_getClosestParentElement(){for(let e=this._containerStack.length-1;e>-1;e--)if(this._containerStack[e]instanceof Y)return this._containerStack[e];return null}_addToParent(e){let r=this._getContainer();r===null?this.rootNodes.push(e):r.children.push(e)}_getElementFullName(e,r,n){if(e===""&&(e=this.getTagDefinition(r).implicitNamespacePrefix||"",e===""&&n!=null)){let s=ct(n.name)[1];this.getTagDefinition(s).preventNamespaceInheritance||(e=Me(n.name))}return qe(e,r)}};function li(t,e){return t.length>0&&t[t.length-1]===e}function ci(t,e){return Ve[e]!==void 0?Ve[e]||t:/^#x[a-f0-9]+$/i.test(e)?String.fromCodePoint(parseInt(e.slice(2),16)):/^#\d+$/.test(e)?String.fromCodePoint(parseInt(e.slice(1),10)):t}var ar=class extends ir{constructor(){super(He)}parse(e,r,n,s=!1,i){return super.parse(e,r,n,s,i)}};var Qr=null,Yo=()=>(Qr||(Qr=new ar),Qr);function Jr(t,e={}){let{canSelfClose:r=!1,allowHtmComponentClosingTags:n=!1,isTagNameCaseSensitive:s=!1,getTagContentType:i,tokenizeAngularBlocks:a=!1,tokenizeAngularLetDeclaration:o=!1}=e;return Yo().parse(t,"angular-html-parser",{tokenizeExpansionForms:a,interpolationConfig:void 0,canSelfClose:r,allowHtmComponentClosingTags:n,tokenizeBlocks:a,tokenizeLet:o},s,i)}function jo(t,e){let r=new SyntaxError(t+" ("+e.loc.start.line+":"+e.loc.start.column+")");return Object.assign(r,e)}var pi=jo;var _t=3;function Ko(t){let e=t.slice(0,_t);if(e!=="---"&&e!=="+++")return;let r=t.indexOf(` `,_t);if(r===-1)return;let n=t.slice(_t,r).trim(),s=t.indexOf(` ${e}`,r),i=n;if(i||(i=e==="+++"?"toml":"yaml"),s===-1&&e==="---"&&i==="yaml"&&(s=t.indexOf(` ...`,r)),s===-1)return;let a=s+1+_t,o=t.charAt(a+1);if(!/\s?/u.test(o))return;let u=t.slice(0,a);return{type:"front-matter",language:i,explicitLanguage:n,value:t.slice(r+1,s),startDelimiter:e,endDelim … [Строка слишком длинная. Вы можете скачать файл]