@optionfactory/fml 9.0.0-rc30 → 9.0.0-rc31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/ftl.min.mjs CHANGED
@@ -1,2 +1,2 @@
1
- class t{#t;#e=new Map;constructor(t){this.#t=t}getOrCompute(t,e){if(this.#e.has(t))return this.#e.get(t);const r=e(t);return this.#e.size>=this.#t&&this.#e.delete(this.#e.keys().next().value),this.#e.set(t,r),r}get size(){return this.#e.size}}const e={ter:Symbol("ternary"),elv:Symbol("elvis"),nullc:Symbol("null-coalescence"),or:Symbol("or"),and:Symbol("and"),eq:Symbol("eq"),cmp:Symbol("cmp"),not:Symbol("not"),access:Symbol("access"),member:Symbol("access-member"),subscript:Symbol("access-subscript"),method:Symbol("access-method-call"),call:Symbol("module-function-call"),tstring:Symbol("tstring"),literal:Symbol("literal"),array:Symbol("array-literal"),dict:Symbol("dict-literal"),function:Symbol("module-function"),symbol:Symbol("symbol"),templated:{ten:Symbol("templated-node"),teh:Symbol("templated-html"),tet:Symbol("templated-text"),tel:Symbol("templated-literal")},dom:{t:Symbol("text"),h:Symbol("html"),n:Symbol("node")}},r=new Map([["true",!0],["false",!1],["null",null],["undefined",void 0]]);class n extends SyntaxError{constructor(t,e,r,n){super(t),this.expected=e,this.found=r,this.location=n,this.name="SyntaxError"}format(t){let e="Error: "+this.message;if(this.location){let r=null;const n=t.find(t=>t.source===this.location.source);n&&(r=n.text.split(/\r\n|\n|\r/g));const s=this.location.start,o=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(s):s,i=this.location.source+":"+o.line+":"+o.column;if(r){const t=this.location.end,n="".padEnd(o.line.toString().length," "),l=r[s.line-1],a=(s.line===t.line?t.column:l.length+1)-s.column||1;e+="\n --\x3e "+i+"\n"+n+" |\n"+o.line+" | "+l+"\n"+n+" | "+"".padEnd(s.column-1," ")+"".padEnd(a,"^")}else e+="\n at "+i}return e}static buildMessage(t,e){function r(t){return t.codePointAt(0).toString(16).toUpperCase()}const n=Object.prototype.hasOwnProperty.call(RegExp.prototype,"unicode")?new RegExp("[\\p{C}\\p{Mn}\\p{Mc}]","gu"):null;function s(t,e){return function(t){return n?t.replace(n,t=>"\\u{"+r(t)+"}"):t}(t.replace(e,"\\$&").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,t=>"\\x0"+r(t)).replace(/[\x10-\x1F\x7F-\x9F]/g,t=>"\\x"+r(t)))}function o(t){return s(t,/[\\"]/g)}function i(t){return s(t,/[\\\]^-]/g)}const l={literal:t=>'"'+o(t.text)+'"',class(t){const e=t.parts.map(t=>Array.isArray(t)?i(t[0])+"-"+i(t[1]):i(t));return"["+(t.inverted?"^":"")+e.join("")+"]"+(t.unicode?"u":"")},any:()=>"any character",end:()=>"end of input",other:t=>t.description};function a(t){return l[t.type](t)}return"Expected "+function(t){const e=t.map(a);if(e.sort(),e.length>0){let t=1;for(let r=1;r<e.length;r++)e[r-1]!==e[r]&&(e[t]=e[r],t++);e.length=t}switch(e.length){case 1:return e[0];case 2:return e[0]+" or "+e[1];default:return e.slice(0,-1).join(", ")+", or "+e[e.length-1]}}(t)+" but "+function(t){return t?'"'+o(t)+'"':"end of input"}(e)+" found."}}const s=(t,e)=>{if("self"===e)return t[t.length-1];for(let r=t.length-1;r>=0;r--){const n=t[r];if(null!=n&&("object"==typeof n||"function"==typeof n)&&e in n)return n[e]}};class o{#r;#n;constructor(t,e){this.#r=t,this.#n=e}#s(t){return s(this.#n,t)}#o(t,r){const n=0===r?t.lhs:t.rhs[r-1];return n.type===e.symbol?n.value:n.type===e.member?n.rhs:null}#i;#l(){return this.#i||(this.#i=new Proxy(this.#n,{get:(t,e)=>this.#s(e)})),this.#i}[e.and](t){return this.visit(t.lhs)&&this.visit(t.rhs)}[e.or](t){return this.visit(t.lhs)||this.visit(t.rhs)}[e.nullc](t){return this.visit(t.lhs)??this.visit(t.rhs)}[e.not](t){return!this.visit(t.expr)}[e.eq](t){const e=this.visit(t.lhs)===this.visit(t.rhs);return"=="===t.op?e:!e}[e.cmp](t){const e=this.visit(t.lhs),r=this.visit(t.rhs);switch(t.op){case">":return e>r;case"<":return e<r;case">=":return e>=r;case"<=":return e<=r;default:throw new Error(`unknown cmp op ${t.op}`)}}[e.call](t){const e=t.value,r=null===e.module?this.#r:this.#r?.[e.module];if(!r)throw new Error(`Module "${e.module}" not found`);const n=r[e.value];if(!n)throw new Error(`Function "#${null===e.module?"":`${e.module}:`}${e.value}" not found`);const s=t.args.map(t=>this.visit(t));return n.apply(this.#l(),s)}[e.literal](t){return t.value}[e.tstring](t){let e="";const r=t.parts;for(let t=0,n=r.length;t<n;t++){const n=this.visit(r[t]);null!=n&&(e+=n)}return e}[e.symbol](t){return this.#s(t.value)}[e.dict](t){return Object.fromEntries(t.value.map(t=>[this.visit(t[0]),this.visit(t[1])]))}[e.array](t){return t.value.map(t=>this.visit(t))}[e.ter](t){return this.visit(t.cond)?this.visit(t.ifTrue):this.visit(t.ifFalse)}[e.elv](t){return this.visit(t.cond)||this.visit(t.ifFalse)}[e.access](t){let r,n=this.visit(t.lhs);for(let s=0;s!==t.rhs.length;++s){const o=t.rhs[s];if(o.ns&&null==n)return;let i;switch(o.type){case e.member:i=n[o.rhs];break;case e.subscript:i=n[this.visit(o.rhs)];break;case e.method:{if(!n){const e=this.#o(t,s);throw new Error(null===e?"Method missing":`Method missing "${e}"`)}const e=o.args.map(t=>this.visit(t));i=n.apply(r,e);break}}r=n,n=i}return n}visit(t,...e){return this[t.type](t,...e)}visitRoot(t,r){return r?t.map(t=>{switch(t.type){case e.templated.tel:return{type:e.dom.t,value:t.value};case e.templated.tet:return{type:e.dom.t,value:this.visit(t.value)};case e.templated.teh:return{type:e.dom.h,value:this.visit(t.value)};case e.templated.ten:return{type:e.dom.n,value:this.visit(t.value)};default:throw new Error(`unknown node type ${t.type.toString()}`)}}):this.visit(t)}}class i{static MODE_EXPRESSION=Symbol("MODE_EXPRESSION");static MODE_TEMPLATED=Symbol("MODE_TEMPLATED");static#a=new t(1e3);static parse(t,s){const o=s?.toString()+t;return this.#a.getOrCompute(o,()=>function(t,s){const o={},i=(s=void 0!==s?s:{}).grammarSource,l={TemplatedRoot:ae,ExpressionRoot:ce};let a=ae;const u="{{{{",c="}}}}",h="{{{",d="}}}",p="{{",m="}}",f="\\",g="{",v="?",y=":",b="?:",E="??",x="||",A="&&",w="!",P="?.",T=".",C="[",S="]",O="(",N=",",D=")",R="-",M="'",$='"',_="`",L="}",F="#",j="==",k="!=",I=">=",V=">",q="<=",H="<",B=re("{{{{",!1),z=re("}}}}",!1),W=re("{{{",!1),X=re("}}}",!1),Q=re("{{",!1),U=re("}}",!1),G=ne(["\\","{"],!0,!1,!1),J=re("\\",!1),Y={type:"any"},Z=re("{",!1),K=re("?",!1),tt=re(":",!1),et=re("?:",!1),rt=re("??",!1),nt=re("||",!1),st=re("&&",!1),ot=re("!",!1),it=se("member"),lt=re("?.",!1),at=re(".",!1),ut=se("subscript"),ct=re("[",!1),ht=re("]",!1),dt=se("method-call"),pt=re("(",!1),mt=re(",",!1),ft=re(")",!1),gt=se("module-function-call"),vt=se("number-literal"),yt=re("-",!1),bt=ne([["0","9"]],!1,!1,!1),Et=se("string-literal"),xt=re("'",!1),At=ne(["'"],!0,!1,!1),wt=re('"',!1),Pt=ne(['"'],!0,!1,!1),Tt=re("`",!1),Ct=se("tstring-expression"),St=re("}",!1),Ot=se("tstring-literal"),Nt=ne(["\\","`","{"],!0,!1,!1),Dt=se("array-literal"),Rt=se("dict-literal"),Mt=se("module-function"),$t=re("#",!1),_t=ne([["a","z"],["A","Z"],"$","_"],!1,!1,!1),Lt=ne([["a","z"],["A","Z"],"$","_",["0","9"]],!1,!1,!1),Ft=se("identifier-or-keyword"),jt=re("==",!1),kt=re("!=",!1),It=re(">=",!1),Vt=re(">",!1),qt=re("<=",!1),Ht=re("<",!1),Bt=ne([" ","\t","\n","\r"],!1,!1,!1);function zt(t){return t}function Wt(t,e,r){return{op:e,rhs:r}}function Xt(t,e,r){return{op:e,rhs:r}}function Qt(t){return t}let Ut=0|s.peg$currPos;const Gt=[{line:1,column:1}];let Jt,Yt,Zt=Ut,Kt=s.peg$maxFailExpected||[],te=0|s.peg$silentFails,ee=new Map;if(s.startRule){if(!(s.startRule in l))throw new Error("Can't start parsing from rule \""+s.startRule+'".');a=l[s.startRule]}function re(t,e){return{type:"literal",text:t,ignoreCase:e}}function ne(t,e,r,n){return{type:"class",parts:t,inverted:e,ignoreCase:r,unicode:n}}function se(t){return{type:"other",description:t}}function oe(e){let r,n=Gt[e];if(n)return n;if(e>=Gt.length)r=Gt.length-1;else for(r=e;!Gt[--r];);for(n=Gt[r],n={line:n.line,column:n.column};r<e;)10===t.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return Gt[e]=n,n}function ie(t,e,r){const n=oe(t),s=oe(e);return{source:i,start:{offset:t,line:n.line,column:n.column},end:{offset:e,line:s.line,column:s.column}}}function le(t){Ut<Zt||(Ut>Zt&&(Zt=Ut,Kt=[]),Kt.push(t))}function ae(){let t,e;const r=38*Ut+0,n=ee.get(r);if(n)return Ut=n.nextPos,n.result;for(t=[];e=ue(),e!==o;)t.push(e);return ee.set(r,{nextPos:Ut,result:t}),t}function ue(){let r,n,s,i,l;const a=38*Ut+1,v=ee.get(a);return v?(Ut=v.nextPos,v.result):(r=Ut,n=Ut,s=function(){let e;const r=38*Ut+2,n=ee.get(r);return n?(Ut=n.nextPos,n.result):(t.substr(Ut,4)===u?(e=u,Ut+=4):(e=o,0===te&&le(B)),ee.set(r,{nextPos:Ut,result:e}),e)}(),s!==o?(i=ce(),i!==o?(l=function(){let e;const r=38*Ut+3,n=ee.get(r);return n?(Ut=n.nextPos,n.result):(t.substr(Ut,4)===c?(e=c,Ut+=4):(e=o,0===te&&le(z)),ee.set(r,{nextPos:Ut,result:e}),e)}(),l!==o?n=i:(Ut=n,n=o)):(Ut=n,n=o)):(Ut=n,n=o),n!==o&&(y=n,n={type:e.templated.ten,value:y}),r=n,r===o&&(r=Ut,n=Ut,s=function(){let e;const r=38*Ut+4,n=ee.get(r);return n?(Ut=n.nextPos,n.result):(t.substr(Ut,3)===h?(e=h,Ut+=3):(e=o,0===te&&le(W)),ee.set(r,{nextPos:Ut,result:e}),e)}(),s!==o?(i=ce(),i!==o?(l=function(){let e;const r=38*Ut+5,n=ee.get(r);return n?(Ut=n.nextPos,n.result):(t.substr(Ut,3)===d?(e=d,Ut+=3):(e=o,0===te&&le(X)),ee.set(r,{nextPos:Ut,result:e}),e)}(),l!==o?n=i:(Ut=n,n=o)):(Ut=n,n=o)):(Ut=n,n=o),n!==o&&(n=function(t){return{type:e.templated.teh,value:t}}(n)),r=n,r===o&&(r=Ut,n=Ut,s=function(){let e;const r=38*Ut+6,n=ee.get(r);return n?(Ut=n.nextPos,n.result):(t.substr(Ut,2)===p?(e=p,Ut+=2):(e=o,0===te&&le(Q)),ee.set(r,{nextPos:Ut,result:e}),e)}(),s!==o?(i=ce(),i!==o?(l=function(){let e;const r=38*Ut+7,n=ee.get(r);return n?(Ut=n.nextPos,n.result):(t.substr(Ut,2)===m?(e=m,Ut+=2):(e=o,0===te&&le(U)),ee.set(r,{nextPos:Ut,result:e}),e)}(),l!==o?n=i:(Ut=n,n=o)):(Ut=n,n=o)):(Ut=n,n=o),n!==o&&(n=function(t){return{type:e.templated.tet,value:t}}(n)),r=n,r===o&&(r=Ut,n=function(){let e,r,n,s,i,l,a;const u=38*Ut+8,c=ee.get(u);if(c)return Ut=c.nextPos,c.result;for(e=Ut,r=[];;){for(n=Ut,s=[];i=t.charAt(Ut),""!==i&&(Yt=i.charCodeAt(0),92!==Yt&&123!==Yt)?Ut++:(i=o,0===te&&le(G)),i!==o;)s.push(i);if(s.length<1&&(s=o),n=s!==o?t.substring(n,Ut):s,n===o&&(n=Ut,92===t.charCodeAt(Ut)?(s=f,Ut++):(s=o,0===te&&le(J)),s!==o?(t.length>Ut?(i=t.charAt(Ut),Ut++):(i=o,0===te&&le(Y)),i!==o?n=zt(i):(Ut=n,n=o)):(Ut=n,n=o),n===o&&(n=Ut,s=Ut,123===t.charCodeAt(Ut)?(i=g,Ut++):(i=o,0===te&&le(Z)),i!==o?(l=Ut,te++,123===t.charCodeAt(Ut)?(a=g,Ut++):(a=o,0===te&&le(Z)),te--,a===o?l=void 0:(Ut=l,l=o),l!==o?(i=[i,l],s=i):(Ut=s,s=o)):(Ut=s,s=o),n=s!==o?t.substring(n,Ut):s)),n===o)break;r.push(n)}return r.length<1&&(r=o),r!==o&&(r=r.join("")),e=r,ee.set(u,{nextPos:Ut,result:e}),e}(),n!==o&&(n=function(t){return{type:e.templated.tel,value:t}}(n)),r=n))),ee.set(a,{nextPos:Ut,result:r}),r);var y}function ce(){let t,e;const r=38*Ut+9,n=ee.get(r);return n?(Ut=n.nextPos,n.result):(t=Ut,Se(),e=he(),e!==o?(Se(),t=e):(Ut=t,t=o),ee.set(r,{nextPos:Ut,result:t}),t)}function he(){let r,n,s,i,l,a;const u=38*Ut+10,c=ee.get(u);return c?(Ut=c.nextPos,c.result):(r=Ut,n=de(),n!==o?(Se(),63===t.charCodeAt(Ut)?(s=v,Ut++):(s=o,0===te&&le(K)),s!==o?(Se(),i=he(),i!==o?(Se(),58===t.charCodeAt(Ut)?(l=y,Ut++):(l=o,0===te&&le(tt)),l!==o?(Se(),a=he(),a!==o?r={type:e.ter,cond:n,ifTrue:i,ifFalse:a}:(Ut=r,r=o)):(Ut=r,r=o)):(Ut=r,r=o)):(Ut=r,r=o)):(Ut=r,r=o),r===o&&(r=de()),ee.set(u,{nextPos:Ut,result:r}),r)}function de(){let r,n,s,i;const l=38*Ut+11,a=ee.get(l);return a?(Ut=a.nextPos,a.result):(r=Ut,n=pe(),n!==o?(Se(),t.substr(Ut,2)===b?(s=b,Ut+=2):(s=o,0===te&&le(et)),s!==o?(Se(),i=de(),i!==o?r={type:e.elv,cond:n,ifFalse:i}:(Ut=r,r=o)):(Ut=r,r=o)):(Ut=r,r=o),r===o&&(r=pe()),ee.set(l,{nextPos:Ut,result:r}),r)}function pe(){let r,n,s,i;const l=38*Ut+12,a=ee.get(l);return a?(Ut=a.nextPos,a.result):(r=Ut,n=me(),n!==o?(Se(),t.substr(Ut,2)===E?(s=E,Ut+=2):(s=o,0===te&&le(rt)),s!==o?(Se(),i=pe(),i!==o?r={type:e.nullc,lhs:n,rhs:i}:(Ut=r,r=o)):(Ut=r,r=o)):(Ut=r,r=o),r===o&&(r=me()),ee.set(l,{nextPos:Ut,result:r}),r)}function me(){let r,n,s,i,l,a;const u=38*Ut+13,c=ee.get(u);if(c)return Ut=c.nextPos,c.result;if(r=Ut,n=fe(),n!==o){for(s=[];i=Ut,Se(),t.substr(Ut,2)===x?(l=x,Ut+=2):(l=o,0===te&&le(nt)),l!==o?(Se(),a=fe(),a!==o?i=a:(Ut=i,i=o)):(Ut=i,i=o),i!==o;)s.push(i);r=function(t,r){let n=t;for(const t of r)n={type:e.or,lhs:n,rhs:t};return n}(n,s)}else Ut=r,r=o;return ee.set(u,{nextPos:Ut,result:r}),r}function fe(){let r,n,s,i,l,a;const u=38*Ut+14,c=ee.get(u);if(c)return Ut=c.nextPos,c.result;if(r=Ut,n=ge(),n!==o){for(s=[];i=Ut,Se(),t.substr(Ut,2)===A?(l=A,Ut+=2):(l=o,0===te&&le(st)),l!==o?(Se(),a=ge(),a!==o?i=a:(Ut=i,i=o)):(Ut=i,i=o),i!==o;)s.push(i);r=function(t,r){let n=t;for(const t of r)n={type:e.and,lhs:n,rhs:t};return n}(n,s)}else Ut=r,r=o;return ee.set(u,{nextPos:Ut,result:r}),r}function ge(){let t,r,n,s,i,l;const a=38*Ut+15,u=ee.get(a);if(u)return Ut=u.nextPos,u.result;if(t=Ut,r=ve(),r!==o){for(n=[];s=Ut,Se(),i=Te(),i!==o?(Se(),l=ve(),l!==o?s=Wt(0,i,l):(Ut=s,s=o)):(Ut=s,s=o),s!==o;)n.push(s);t=function(t,r){let n=t;for(const t of r)n={type:e.eq,op:t.op,lhs:n,rhs:t.rhs};return n}(r,n)}else Ut=t,t=o;return ee.set(a,{nextPos:Ut,result:t}),t}function ve(){let t,r,n,s,i,l;const a=38*Ut+16,u=ee.get(a);if(u)return Ut=u.nextPos,u.result;if(t=Ut,r=ye(),r!==o){for(n=[];s=Ut,Se(),i=Ce(),i!==o?(Se(),l=ye(),l!==o?s=Xt(0,i,l):(Ut=s,s=o)):(Ut=s,s=o),s!==o;)n.push(s);t=function(t,r){let n=t;for(const t of r)n={type:e.cmp,op:t.op,lhs:n,rhs:t.rhs};return n}(r,n)}else Ut=t,t=o;return ee.set(a,{nextPos:Ut,result:t}),t}function ye(){let r,n,s;const i=38*Ut+17,l=ee.get(i);return l?(Ut=l.nextPos,l.result):(r=Ut,33===t.charCodeAt(Ut)?(n=w,Ut++):(n=o,0===te&&le(ot)),n!==o?(Se(),s=ye(),s!==o?r={type:e.not,expr:s}:(Ut=r,r=o)):(Ut=r,r=o),r===o&&(r=function(){let t,r,n,s,i;const l=38*Ut+18,a=ee.get(l);if(a)return Ut=a.nextPos,a.result;if(t=Ut,r=Ee(),r!==o){for(Se(),n=[];s=Ut,i=be(),i!==o?(Se(),s=i):(Ut=s,s=o),s!==o;)n.push(s);n.length<1&&(n=o),n!==o?t={type:e.access,lhs:r,rhs:n}:(Ut=t,t=o)}else Ut=t,t=o;return t===o&&(t=Ee()),ee.set(l,{nextPos:Ut,result:t}),t}()),ee.set(i,{nextPos:Ut,result:r}),r)}function be(){let r;const n=38*Ut+19,s=ee.get(n);return s?(Ut=s.nextPos,s.result):(r=function(){let r,n,s;const i=38*Ut+20,l=ee.get(i);return l?(Ut=l.nextPos,l.result):(te++,r=Ut,t.substr(Ut,2)===P?(n=P,Ut+=2):(n=o,0===te&&le(lt)),n===o&&(46===t.charCodeAt(Ut)?(n=T,Ut++):(n=o,0===te&&le(at))),n!==o?(Se(),s=Pe(),s!==o?r={type:e.member,ns:"?."===n,rhs:s}:(Ut=r,r=o)):(Ut=r,r=o),te--,r===o&&(n=o,0===te&&le(it)),ee.set(i,{nextPos:Ut,result:r}),r)}(),r===o&&(r=function(){let r,n,s,i,l;const a=38*Ut+21,u=ee.get(a);return u?(Ut=u.nextPos,u.result):(te++,r=Ut,t.substr(Ut,2)===P?(n=P,Ut+=2):(n=o,0===te&&le(lt)),n===o&&(n=null),91===t.charCodeAt(Ut)?(s=C,Ut++):(s=o,0===te&&le(ct)),s!==o?(Se(),i=he(),i!==o?(Se(),93===t.charCodeAt(Ut)?(l=S,Ut++):(l=o,0===te&&le(ht)),l!==o?r={type:e.subscript,ns:null!==n,rhs:i}:(Ut=r,r=o)):(Ut=r,r=o)):(Ut=r,r=o),te--,r===o&&(n=o,0===te&&le(ut)),ee.set(a,{nextPos:Ut,result:r}),r)}(),r===o&&(r=function(){let r,n,s,i,l,a,u,c;const h=38*Ut+22,d=ee.get(h);if(d)return Ut=d.nextPos,d.result;if(te++,r=Ut,t.substr(Ut,2)===P?(n=P,Ut+=2):(n=o,0===te&&le(lt)),n===o&&(n=null),40===t.charCodeAt(Ut)?(s=O,Ut++):(s=o,0===te&&le(pt)),s!==o){for(Se(),i=Ut,l=he(),l!==o?(a=Se(),i=l):(Ut=i,i=o),i===o&&(i=null),l=[];a=Ut,44===t.charCodeAt(Ut)?(u=N,Ut++):(u=o,0===te&&le(mt)),u!==o?(Se(),c=he(),c!==o?(Se(),a=c):(Ut=a,a=o)):(Ut=a,a=o),a!==o;)l.push(a);41===t.charCodeAt(Ut)?(a=D,Ut++):(a=o,0===te&&le(ft)),a!==o?(m=l,r={type:e.method,ns:null!==n,args:null===(p=i)?[]:[p,...m]}):(Ut=r,r=o)}else Ut=r,r=o;var p,m;return te--,r===o&&(n=o,0===te&&le(dt)),ee.set(h,{nextPos:Ut,result:r}),r}())),ee.set(n,{nextPos:Ut,result:r}),r)}function Ee(){let n,s,i,l;const a=38*Ut+23,u=ee.get(a);return u?(Ut=u.nextPos,u.result):(n=Ut,40===t.charCodeAt(Ut)?(s=O,Ut++):(s=o,0===te&&le(pt)),s!==o?(Se(),i=he(),i!==o?(Se(),41===t.charCodeAt(Ut)?(l=D,Ut++):(l=o,0===te&&le(ft)),l!==o?n=i:(Ut=n,n=o)):(Ut=n,n=o)):(Ut=n,n=o),n===o&&(n=function(){let r,n,s,i,l,a,u,c;const h=38*Ut+24,d=ee.get(h);if(d)return Ut=d.nextPos,d.result;if(te++,r=Ut,n=function(){let r,n,s,i,l;const a=38*Ut+32,u=ee.get(a);return u?(Ut=u.nextPos,u.result):(te++,r=Ut,35===t.charCodeAt(Ut)?(n=F,Ut++):(n=o,0===te&&le($t)),n!==o?(s=Ut,i=Pe(),i!==o?(58===t.charCodeAt(Ut)?(l=y,Ut++):(l=o,0===te&&le(tt)),l!==o?s=i:(Ut=s,s=o)):(Ut=s,s=o),s===o&&(s=null),i=Pe(),i!==o?r={type:e.function,module:s,value:i}:(Ut=r,r=o)):(Ut=r,r=o),te--,r===o&&(n=o,0===te&&le(Mt)),ee.set(a,{nextPos:Ut,result:r}),r)}(),n!==o)if(40===t.charCodeAt(Ut)?(s=O,Ut++):(s=o,0===te&&le(pt)),s!==o){for(Se(),i=Ut,l=he(),l!==o?(a=Se(),i=l):(Ut=i,i=o),i===o&&(i=null),l=[];a=Ut,44===t.charCodeAt(Ut)?(u=N,Ut++):(u=o,0===te&&le(mt)),u!==o?(Se(),c=he(),c!==o?(Se(),a=c):(Ut=a,a=o)):(Ut=a,a=o),a!==o;)l.push(a);41===t.charCodeAt(Ut)?(a=D,Ut++):(a=o,0===te&&le(ft)),a!==o?r=function(t,r,n){const s=null===r?[]:[r,...n];return{type:e.call,value:t,args:s}}(n,i,l):(Ut=r,r=o)}else Ut=r,r=o;else Ut=r,r=o;return te--,r===o&&(n=o,0===te&&le(gt)),ee.set(h,{nextPos:Ut,result:r}),r}(),n===o&&(n=function(){let r;const n=38*Ut+25,s=ee.get(n);return s?(Ut=s.nextPos,s.result):(r=function(){let r,n,s,i,l,a,u,c,h,d;const p=38*Ut+26,m=ee.get(p);if(m)return Ut=m.nextPos,m.result;for(te++,r=Ut,n=Ut,s=Ut,45===t.charCodeAt(Ut)?(i=R,Ut++):(i=o,0===te&&le(yt)),i===o&&(i=null),l=Ut,a=[];u=t.charAt(Ut),Yt=u.charCodeAt(0),Yt>=48&&Yt<=57?Ut++:(u=o,0===te&&le(bt)),u!==o;)a.push(u);if(a.length<1&&(a=o),a!==o){if(u=Ut,46===t.charCodeAt(Ut)?(c=T,Ut++):(c=o,0===te&&le(at)),c!==o){for(h=[];d=t.charAt(Ut),Yt=d.charCodeAt(0),Yt>=48&&Yt<=57?Ut++:(d=o,0===te&&le(bt)),d!==o;)h.push(d);c=[c,h],u=c}else Ut=u,u=o;u===o&&(u=null),a=[a,u],l=a}else Ut=l,l=o;if(l===o)if(l=Ut,46===t.charCodeAt(Ut)?(a=T,Ut++):(a=o,0===te&&le(at)),a!==o){for(u=[];c=t.charAt(Ut),Yt=c.charCodeAt(0),Yt>=48&&Yt<=57?Ut++:(c=o,0===te&&le(bt)),c!==o;)u.push(c);u.length<1&&(u=o),u!==o?(a=[a,u],l=a):(Ut=l,l=o)}else Ut=l,l=o;return l!==o?(i=[i,l],s=i):(Ut=s,s=o),n=s!==o?t.substring(n,Ut):s,n!==o&&(n={type:e.literal,value:parseFloat(n)}),r=n,te--,r===o&&(n=o,0===te&&le(vt)),ee.set(p,{nextPos:Ut,result:r}),r}(),r===o&&(r=xe(),r===o&&(r=function(){let r,n,s,i,l,a,u;const c=38*Ut+30,h=ee.get(c);if(h)return Ut=h.nextPos,h.result;if(te++,r=Ut,91===t.charCodeAt(Ut)?(n=C,Ut++):(n=o,0===te&&le(ct)),n!==o){for(Se(),s=he(),s===o&&(s=null),Se(),i=[];l=Ut,44===t.charCodeAt(Ut)?(a=N,Ut++):(a=o,0===te&&le(mt)),a!==o?(Se(),u=he(),u!==o?(Se(),l=u):(Ut=l,l=o)):(Ut=l,l=o),l!==o;)i.push(l);93===t.charCodeAt(Ut)?(l=S,Ut++):(l=o,0===te&&le(ht)),l!==o?r=function(t,r){const n=null===t?[]:[t,...r];return{type:e.array,value:n}}(s,i):(Ut=r,r=o)}else Ut=r,r=o;return te--,r===o&&(n=o,0===te&&le(Dt)),ee.set(c,{nextPos:Ut,result:r}),r}(),r===o&&(r=function(){let r,n,s,i,l,a,u,c,h,d,p;const m=38*Ut+31,f=ee.get(m);if(f)return Ut=f.nextPos,f.result;if(te++,r=Ut,123===t.charCodeAt(Ut)?(n=g,Ut++):(n=o,0===te&&le(Z)),n!==o){for(Se(),s=Ut,i=xe(),i!==o?(l=Se(),58===t.charCodeAt(Ut)?(a=y,Ut++):(a=o,0===te&&le(tt)),a!==o?(u=Se(),c=he(),c!==o?s=[i,c]:(Ut=s,s=o)):(Ut=s,s=o)):(Ut=s,s=o),s===o&&(s=null),i=Se(),l=[];a=Ut,44===t.charCodeAt(Ut)?(u=N,Ut++):(u=o,0===te&&le(mt)),u!==o?(c=Se(),h=xe(),h!==o?(Se(),58===t.charCodeAt(Ut)?(d=y,Ut++):(d=o,0===te&&le(tt)),d!==o?(Se(),p=he(),p!==o?(Se(),a=[h,p]):(Ut=a,a=o)):(Ut=a,a=o)):(Ut=a,a=o)):(Ut=a,a=o),a!==o;)l.push(a);125===t.charCodeAt(Ut)?(a=L,Ut++):(a=o,0===te&&le(St)),a!==o?(b=l,E=[],null!==(v=s)&&E.push(v),E.push.apply(E,b),r={type:e.dict,value:E}):(Ut=r,r=o)}else Ut=r,r=o;var v,b,E;return te--,r===o&&(n=o,0===te&&le(Rt)),ee.set(m,{nextPos:Ut,result:r}),r}()))),ee.set(n,{nextPos:Ut,result:r}),r)}(),n===o&&(n=function(){let t,n;const s=38*Ut+34,i=ee.get(s);return i?(Ut=i.nextPos,i.result):(te++,t=Ut,n=Pe(),n!==o&&(l=n,n=r.has(l)?{type:e.literal,value:r.get(l)}:{type:e.symbol,value:l}),t=n,te--,t===o&&(n=o,0===te&&le(Ft)),ee.set(s,{nextPos:Ut,result:t}),t);var l}()))),ee.set(a,{nextPos:Ut,result:n}),n)}function xe(){let r,n,s,i,l;const a=38*Ut+27,u=ee.get(a);if(u)return Ut=u.nextPos,u.result;if(te++,r=Ut,39===t.charCodeAt(Ut)?(n=M,Ut++):(n=o,0===te&&le(xt)),n!==o){for(s=Ut,i=[];l=t.charAt(Ut),""!==l&&(Yt=l.charCodeAt(0),39!==Yt)?Ut++:(l=o,0===te&&le(At)),l!==o;)i.push(l);s=t.substring(s,Ut),39===t.charCodeAt(Ut)?(i=M,Ut++):(i=o,0===te&&le(xt)),i!==o?r={type:e.literal,value:s}:(Ut=r,r=o)}else Ut=r,r=o;if(r===o){if(r=Ut,34===t.charCodeAt(Ut)?(n=$,Ut++):(n=o,0===te&&le(wt)),n!==o){for(s=Ut,i=[];l=t.charAt(Ut),""!==l&&(Yt=l.charCodeAt(0),34!==Yt)?Ut++:(l=o,0===te&&le(Pt)),l!==o;)i.push(l);s=t.substring(s,Ut),34===t.charCodeAt(Ut)?(i=$,Ut++):(i=o,0===te&&le(wt)),i!==o?r={type:e.literal,value:s}:(Ut=r,r=o)}else Ut=r,r=o;if(r===o)if(r=Ut,96===t.charCodeAt(Ut)?(n=_,Ut++):(n=o,0===te&&le(Tt)),n!==o){for(s=[];i=Ae(),i===o&&(i=we()),i!==o;)s.push(i);96===t.charCodeAt(Ut)?(i=_,Ut++):(i=o,0===te&&le(Tt)),i!==o?r={type:e.tstring,parts:s}:(Ut=r,r=o)}else Ut=r,r=o}return te--,r===o&&(n=o,0===te&&le(Et)),ee.set(a,{nextPos:Ut,result:r}),r}function Ae(){let e,r,n,s;const i=38*Ut+28,l=ee.get(i);return l?(Ut=l.nextPos,l.result):(te++,e=Ut,123===t.charCodeAt(Ut)?(r=g,Ut++):(r=o,0===te&&le(Z)),r!==o?(Se(),n=he(),n!==o?(Se(),125===t.charCodeAt(Ut)?(s=L,Ut++):(s=o,0===te&&le(St)),s!==o?e=n:(Ut=e,e=o)):(Ut=e,e=o)):(Ut=e,e=o),te--,e===o&&(r=o,0===te&&le(Ct)),ee.set(i,{nextPos:Ut,result:e}),e)}function we(){let r,n,s,i,l;const a=38*Ut+29,u=ee.get(a);if(u)return Ut=u.nextPos,u.result;for(te++,r=Ut,n=[];;){for(s=Ut,i=[];l=t.charAt(Ut),""!==l&&(Yt=l.charCodeAt(0),92!==Yt&&96!==Yt&&123!==Yt)?Ut++:(l=o,0===te&&le(Nt)),l!==o;)i.push(l);if(i.length<1&&(i=o),s=i!==o?t.substring(s,Ut):i,s===o&&(s=Ut,92===t.charCodeAt(Ut)?(i=f,Ut++):(i=o,0===te&&le(J)),i!==o?(t.length>Ut?(l=t.charAt(Ut),Ut++):(l=o,0===te&&le(Y)),l!==o?s=Qt(l):(Ut=s,s=o)):(Ut=s,s=o)),s===o)break;n.push(s)}return n.length<1&&(n=o),n!==o&&(n={type:e.literal,value:n.join("")}),r=n,r===o&&(r=Ut,123===t.charCodeAt(Ut)?(n=g,Ut++):(n=o,0===te&&le(Z)),n!==o&&(n={type:e.literal,value:n}),r=n),te--,r===o&&(n=o,0===te&&le(Ot)),ee.set(a,{nextPos:Ut,result:r}),r}function Pe(){let e,r,n,s,i;const l=38*Ut+33,a=ee.get(l);if(a)return Ut=a.nextPos,a.result;if(e=Ut,r=Ut,n=t.charAt(Ut),Yt=n.charCodeAt(0),Yt>=97&&Yt<=122||Yt>=65&&Yt<=90||36===Yt||95===Yt?Ut++:(n=o,0===te&&le(_t)),n!==o){for(s=[];i=t.charAt(Ut),Yt=i.charCodeAt(0),Yt>=97&&Yt<=122||Yt>=65&&Yt<=90||36===Yt||95===Yt||Yt>=48&&Yt<=57?Ut++:(i=o,0===te&&le(Lt)),i!==o;)s.push(i);n=[n,s],r=n}else Ut=r,r=o;return e=r!==o?t.substring(e,Ut):r,ee.set(l,{nextPos:Ut,result:e}),e}function Te(){let e;const r=38*Ut+35,n=ee.get(r);return n?(Ut=n.nextPos,n.result):(t.substr(Ut,2)===j?(e=j,Ut+=2):(e=o,0===te&&le(jt)),e===o&&(t.substr(Ut,2)===k?(e=k,Ut+=2):(e=o,0===te&&le(kt))),ee.set(r,{nextPos:Ut,result:e}),e)}function Ce(){let e;const r=38*Ut+36,n=ee.get(r);return n?(Ut=n.nextPos,n.result):(t.substr(Ut,2)===I?(e=I,Ut+=2):(e=o,0===te&&le(It)),e===o&&(62===t.charCodeAt(Ut)?(e=V,Ut++):(e=o,0===te&&le(Vt)),e===o&&(t.substr(Ut,2)===q?(e=q,Ut+=2):(e=o,0===te&&le(qt)),e===o&&(60===t.charCodeAt(Ut)?(e=H,Ut++):(e=o,0===te&&le(Ht))))),ee.set(r,{nextPos:Ut,result:e}),e)}function Se(){let e,r;const n=38*Ut+37,s=ee.get(n);if(s)return Ut=s.nextPos,s.result;for(te++,e=[];r=t.charAt(Ut),Yt=r.charCodeAt(0),32===Yt||9===Yt||10===Yt||13===Yt?Ut++:(r=o,0===te&&le(Bt)),r!==o;)e.push(r);return te--,ee.set(n,{nextPos:Ut,result:e}),e}Jt=a();const Oe=Jt!==o&&Ut===t.length;function Ne(){throw Jt!==o&&Ut<t.length&&le({type:"end"}),e=Kt,r=Zt<t.length?function(e=Ut){const r=t.codePointAt(e);return void 0===r?"":String.fromCodePoint(r)}(Zt):null,s=Zt<t.length?ie(Zt,Zt+1):ie(Zt,Zt),new n(n.buildMessage(e,r),e,r,s);var e,r,s}return s.peg$library?{peg$result:Jt,peg$currPos:Ut,peg$FAILED:o,peg$maxFailExpected:Kt,peg$maxFailPos:Zt,peg$success:Oe,peg$throw:Oe?void 0:Ne}:Oe?Jt:void Ne()}(t,{startRule:s===i.MODE_TEMPLATED?"TemplatedRoot":"ExpressionRoot"}))}static evaluate(t,e,r,n){return new o(t,e).visitRoot(r,n===i.MODE_TEMPLATED)}static interpret(t,e,r,n){return i.evaluate(t,e,i.parse(r,n),n)}}class l{#r;#n;constructor(t,e){this.#r=t,this.#n=e}withModule(t,e){const r=t?{[t]:e}:e;return new l({...this.#r,...r},this.#n)}withOverlay(...t){return new l(this.#r,0===t.length?this.#n:[...this.#n,...t])}resolve(t){return s(this.#n,t)}evaluateExpression(t){return i.interpret(this.#r,this.#n,t,i.MODE_EXPRESSION)}evaluateTemplated(t){return i.interpret(this.#r,this.#n,t,i.MODE_TEMPLATED)}}class a{static fromHtml(...t){const e=document.createElement("template");return e.innerHTML=t.map(t=>t.trim()).join(""),document.adoptNode(e.content)}static toHtml(t){var e=document.createElement("template");return e.content.appendChild(t),e.innerHTML}static isBlank(t){return 0===t.childElementCount&&""===t.textContent.trim()}static from(...t){const e=new DocumentFragment;for(const r of t)e.appendChild(r);return e}static fromChildNodes(t){const e=new DocumentFragment;for(;t.firstChild;)e.appendChild(t.firstChild);return e}}class u{static id=0;static uid(t){return`${t}-${++u.id}`}static defaultValue(t,e,r){return t.hasAttribute(e)||t.setAttribute(e,r),t.getAttribute(e)}static forward(t,e,r){e.getAttributeNames().filter(e=>e.startsWith(t)).forEach(n=>{const s=n.substring(t.length);if("class"===s){const n=e.getAttribute(`${t}class`)?.split(/\s+/).filter(t=>t.length)??[];return void r.classList.add(...n)}r.setAttribute(s,e.getAttribute(n))})}static set(t,e,r){null==r?t.removeAttribute(e):t.setAttribute(e,r)}}class c{static from(t){for(const e of t.children)e.matches('[slot=""]')&&e.removeAttribute("slot");const e=Array.from(t.children).filter(t=>t.matches("[slot]")).map(t=>{t.remove();const e=t.getAttribute("slot");return t.removeAttribute("slot"),[e,c.slotFromNode(t)]}),r=Object.create(null);r.default=new DocumentFragment,r.default.append(...t.childNodes);for(const[t,n]of e)t in r||(r[t]=new DocumentFragment),r[t].append(n);return r}static slotFromNode(t){return t instanceof HTMLTemplateElement?document.adoptNode(t.content):t instanceof HTMLScriptElement&&"text/html"===t.type?a.fromHtml(t.innerHTML):t}}class h{static isParsed(t){for(let e=t;e;e=e.parentNode)if(e.nextSibling)return!0;return!1}static waitDomContentLoaded(t){if("loading"===t.readyState)return new Promise(e=>{t.addEventListener("DOMContentLoaded",()=>e(void 0),{once:!0})});if("complete"===t.readyState)return Promise.resolve();const e=t.defaultView;if(null===e)return Promise.resolve();const[r]=e.performance?.getEntriesByType("navigation")??[];return r?.domContentLoadedEventStart>0?Promise.resolve():new Promise(t=>{const r=()=>{e.removeEventListener("DOMContentLoaded",r),e.removeEventListener("load",r),t(void 0)};e.addEventListener("DOMContentLoaded",r),e.addEventListener("load",r)})}static waitParsed(t){return h.isParsed(t)||"loading"!==t.ownerDocument.readyState?Promise.resolve(t):new Promise(e=>{const r=new MutationObserver(()=>{h.isParsed(t)&&(r.disconnect(),e(t))});for(let e=t.parentNode;e;e=e.parentNode)r.observe(e,{childList:!0});h.waitDomContentLoaded(t.ownerDocument).then(()=>{r.disconnect(),e(t)})})}static queryChildren(t,e){for(const r of t.children)if(r.matches(e))return r;return null}static queryChildrenAll(t,e){const r=[];for(const n of t.children)n.matches(e)&&r.push(n);return r}}class d{#u=new Set;removed(t){return this.#u.has(t)}remove(t){t.replaceChildren?.(),Object.keys(t.dataset||{}).filter(t=>t.startsWith("tpl")).forEach(e=>{delete t.dataset[e]}),this.#u.add(t)}popData(t,e){const r=t.dataset[e];return delete t.dataset[e],r}prepend(t,e){t.parentNode.insertBefore(e,t)}append(t,e){t.parentNode.insertBefore(e,t.nextSibling)}replace(t,e){this.prepend(t,e),this.remove(t)}cleanup(){for(const t of this.#u)t.remove();this.#u.clear()}}class p{static ORDERED_COMMANDS=["tplIf","tplWith","tplEach","tplWhen","tplClassAppend","tplAttrAppend","tplRemove","tplVerbatim"];static tplIf(t,e,r,n){n.evaluateExpression(e)||r.remove(t)}static tplWith(t,e,r,n){const s=n.evaluateExpression(e),o=r.popData(t,"tplVar"),i=new g(t,n).withOverlay(o?{[o]:s}:s).render();r.replace(t,i)}static tplEach(t,e,r,n){const s=r.popData(t,"tplVar"),o=r.popData(t,"tplStat"),i=new g(t,n),l=n.evaluateExpression(e),a=null===l||"object"!=typeof l?void 0:Object.getPrototypeOf(l),u=l?.[Symbol.iterator]||a!==Object.prototype&&null!==a?null:Object.entries(l),c=l instanceof Map?[...l]:u,h=null===c?l:c.map(([t,e])=>({key:t,value:e}));if(!h?.[Symbol.iterator])throw new Error(`Expected an iterable got '${l}'`);const d=o?h:null,p="number"==typeof d?.length?d.length:d?.size,m="number"==typeof p?p:null;let f=0;for(const e of h){const n=s?{[s]:e}:e,l={index:f,count:f+1,size:m,first:0===f,last:null===m?null:f===m-1,even:f%2==0,odd:f%2==1},a=o?[{[o]:l},n]:[n];r.prepend(t,i.withOverlay(...a).render()),++f}r.remove(t)}static tplWhen(t,e,r,n){n.evaluateExpression(e)||r.remove(t)}static tplVerbatim(t,e,r,n){const s=t.cloneNode(!0);r.replace(t,s)}static tplRemove(t,e,r,n){switch(e.toLowerCase()){case"tag":{const e=a.fromChildNodes(t);"tplVerbatim"in t.dataset?(r.popData(t,"tplVerbatim"),r.replace(t,e)):(r.append(t,e),r.remove(t));break}case"body":t.replaceChildren();break;case"all":r.remove(t)}}static tplClassAppend(t,e,r,n){const s=n.evaluateExpression(e);if(!s)return;const o=(Array.isArray(s)?s:[s]).flatMap(t=>"string"==typeof t?t.split(" "):t).filter(Boolean);0!==o.length&&t.classList.add(...o)}static tplAttrAppend(t,e,r,n){const s=n.evaluateExpression(e);s&&0!==s.length&&(Array.isArray(s[0])?s:[s]).forEach(([e,r])=>{null!=r&&t.setAttribute(e,r)})}static textNode(t,r,n,s){for(const o of s.evaluateTemplated(r))if(null!=o.value)switch(o.type){case e.dom.t:n.prepend(t,document.createTextNode(o.value));break;case e.dom.h:n.prepend(t,a.fromHtml("string"==typeof o.value?o.value:String(o.value)));break;case e.dom.n:if(!(o.value instanceof Node))throw new TypeError(`Expected a Node, got '${typeof o.value}'`);n.prepend(t,o.value)}n.remove(t)}}const m=new t(1e3);function f(t){return m.getOrCompute(t,t=>t.substring(3).split(/(?=[A-Z])/).join("-").toLowerCase())}class g{static fromHtml(t,e,...r){return new g(a.fromHtml(t),new l(e,r))}static fromSelector(t,e,...r){const n=document.querySelector(t);if(!(n instanceof HTMLTemplateElement))throw new Error("template selector does not match any template tag");return g.fromTemplate(n,e,...r)}static fromTemplate(t,e,...r){const n=document.adoptNode(t.content);return new g(n,new l(e,r))}static fromFragment(t,e,...r){return new g(t,new l(e,r))}#c;#h;constructor(t,e){this.#c=t,this.#h=e}withEvaluator(t){return new g(this.#c,t)}withFragment(t){return new g(t,this.#h)}withModule(t,e){return new g(this.#c,this.#h.withModule(t,e))}withOverlay(...t){return new g(this.#c,this.#h.withOverlay(...t))}evaluateExpression(t,...e){return this.#h.withOverlay(...e).evaluateExpression(t)}evaluateTemplated(t,...e){return this.#h.withOverlay(...e).evaluateTemplated(t)}evaluator(){return this.#h}render(){try{const t=new d,e=document.importNode(this.#c,!0),r=e.nodeType===Node.DOCUMENT_FRAGMENT_NODE?e:a.from(e),n=document.createNodeIterator(r,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,g.#d);let s;for(;null!==(s=n.nextNode());){if(t.cleanup(),s.nodeType===Node.TEXT_NODE){try{p.textNode(s,s.nodeValue,t,this.#h)}catch(t){throw v.wrap("Error evaluating text node",s,t)}continue}const e=s;for(const r of p.ORDERED_COMMANDS){if(!(r in e.dataset))continue;const n=t.popData(e,r);try{p[r](e,n,t,this.#h)}catch(t){throw v.wrap(`Error evaluating data-tpl-${f(r)}="${n}"`,e,t)}if(t.removed(e))break}for(const r of Object.keys(e.dataset||{})){if(!r.startsWith("tpl"))continue;const n=f(r),s=t.popData(e,r);try{const t=this.#h.evaluateExpression(s);if("boolean"==typeof t){e.toggleAttribute(n,t);continue}null!=t&&e.setAttribute(n,t)}catch(t){throw v.wrap(`Error evaluating data-tpl-${n}="${s}"`,e,t)}}}return t.cleanup(),r}catch(t){if(t instanceof v)throw t;throw new v("Error rendering template",this.#c,t)}}renderTo(t){t.replaceChildren(this.render())}appendTo(t){t.appendChild(this.render())}renderToSelector(t){const e=document.querySelector(t);e&&this.renderTo(e)}appendToSelector(t){const e=document.querySelector(t);e&&this.appendTo(e)}static#d(t){if(t.nodeType===Node.TEXT_NODE)return t.nodeValue.includes("{{")&&t.nodeValue.includes("}}")?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT;for(const e of t.attributes)if(e.name.startsWith("data-tpl-"))return NodeFilter.FILTER_ACCEPT;return NodeFilter.FILTER_SKIP}}class v extends Error{static FRAMES=3;#p;#m;truncated=!1;static wrap(t,e,r){return r instanceof v&&r.depth>=v.FRAMES?(r.truncated=!0,r):new v(t,e,r)}constructor(t,e,r){super(`${t} in \`${v.describe(e)}\``,{cause:r}),this.name="RenderError",this.#p=e,this.#m=(r instanceof v?r.depth:0)+1}get depth(){return this.#m}get node(){return this.#p}get html(){return v.stringify(this.#p)}static describe(t){if(t.nodeType===Node.TEXT_NODE)return v.#f(String(t.nodeValue).trim());if(t.nodeType===Node.ELEMENT_NODE){const e=t,r=Array.from(e.attributes,t=>` ${t.name}="${t.value}"`).join("");return v.#f(`<${e.localName}${r}>`)}const e=Array.from(t.childNodes).filter(t=>t.nodeType===Node.ELEMENT_NODE||String(t.nodeValue??"").trim().length>0).map(t=>v.describe(t));return v.#f(e.join(""))}static#f(t){return t.length>120?`${t.slice(0,120)}…`:t}static stringify(t){return a.toHtml(v.#g(t.cloneNode(!0)))}static#g(t){t.nodeType===Node.TEXT_NODE&&(t.nodeValue=t.nodeValue.trim());for(let e=0;e<t.childNodes.length;e++){const r=t.childNodes[e];r.nodeType===Node.TEXT_NODE?(r.nodeValue=r.nodeValue.trim(),0===r.nodeValue.length&&(t.removeChild(r),e--)):r.nodeType===Node.ELEMENT_NODE&&v.#g(r)}return t}}class y{#v=new Map;#y;#b=new Promise(t=>{this.#y=t});constructor(){h.waitDomContentLoaded(document).then(()=>{this.#E()})}ready(){return this.#b}async#E(){await this.settled(),document.dispatchEvent(new CustomEvent("ftl:ready",{bubbles:!1,cancelable:!1})),this.#y()}enqueue(t){if(this.#v.has(t))return;const{promise:e,resolve:r}=Promise.withResolvers(),n=h.waitParsed(t).then(()=>t.upgrade()).finally(()=>{this.#v.delete(t),r()});this.#v.set(t,{upgrade:n,finished:e})}async#x(t,e){for(;;){const r=Array.from(this.#v).filter(([e])=>t(e)).map(([,t])=>e(t));if(0===r.length)return;await Promise.all(r)}}settled(){return this.#x(()=>!0,t=>t.finished)}upgraded(t){return this.#x(t,t=>t.upgrade)}whenUpgraded(t){return this.#v.get(t)?.upgrade}pending(){return Array.from(this.#v.keys())}}class b{#A={};#w=!1;#P={string:{unmarshal:(t,e,r)=>t,marshal:(t,e,r)=>null==t?null:String(t)},number:{unmarshal:(t,e,r)=>null===t?null:Number(t),marshal:(t,e,r)=>null==t?null:String(t)},presence:{unmarshal:(t,e,r)=>null!==t,marshal:(t,e,r)=>t?"":null},bool:{unmarshal:(t,e,r)=>"true"===t,marshal:(t,e,r)=>null==t?null:String(!0===t)},json:{unmarshal:(t,e,r)=>null===t?null:JSON.parse(t),marshal:(t,e,r)=>null==t?null:JSON.stringify(t)},csv:{unmarshal:(t,e,r)=>null===t?[]:t.split(",").map(t=>t.trim()).filter(t=>t),marshal:(t,e,r)=>null==t?null:t.join(",")}};#T={};#r;#C=[];#h=new l(void 0,[]);#S=new y;defineElement(t,e){return this.#w?(this.#O(t,e),this):(this.#A[t]=e,this)}static declarationsOf(t){const e=[];for(let r=t;null!==r&&r!==HTMLElement;r=Object.getPrototypeOf(r))e.unshift(r);const r=t=>e.flatMap(e=>Object.getOwnPropertyDescriptor(e,t)?.value??[]);return{observed:r("observed"),attributes:r("attributes")}}static propertyOf(t){return t.replace(/-([a-z])/g,(t,e)=>e.toUpperCase())}#O(t,e){const{observed:r,attributes:n}=b.declarationsOf(e),{template:s,templates:o,slots:i,mappers:l,config:a}=e,u=r.map(t=>t.split(":")[0]),c=[...new Set(u.reverse())].reverse(),h=[...n,...r].reduce((t,e)=>{const[r,n]=e.split(":"),s=n??"string";if(!(s in this.#P)&&!(s in(l??{})))throw new Error(`unsupported attribute type: ${s}`);return t[r]=l?.[s]??this.#P[s],t},{}),d=Object.entries(Object.assign({},o,s?{default:s}:{})).map(([t,e])=>[t,g.fromHtml(e)]),p=Object.fromEntries(d);e.BITS={registry:this,enqueue:t=>this.#S.enqueue(t),SLOTS:i,CONFIG:a,OBSERVED:c,DECLARED:[...new Set([...c,...n.map(t=>t.split(":")[0])])],ATTR_TO_MAPPER:h,ATTR_TO_PROPERTY:Object.fromEntries(c.map(t=>[t,b.propertyOf(t)])),TEMPLATES:p},customElements.define(t,e)}defineModule(t,e){const r=t?{[t]:e}:e;return this.#r={...this.#r,...r},this.#N(),this}defineModules(t){return this.#r=t,this.#N(),this}defineComponent(t,e){return this.#T[t]=e,this}defineData(...t){return this.#C=t,this.#N(),this}defineOverlay(...t){return this.#C=[...this.#C,...t],this.#N(),this}defineMapper(t,e){return this.#P[t]=e,this}plugin(t){return t.configure(this),this}configure(){for(const[t,e]of Object.entries(this.#A))this.#O(t,e),delete this.#A[t];return this.#w=!0,this}settle(t){return this.#S.upgraded(t)}whenUpgraded(t){return this.#S.whenUpgraded(t)}pending(){return this.#S.pending()}ready(){return this.#S.ready()}#N(){this.#h=new l(this.#r,this.#C)}evaluator(){return this.#h}component(t){return this.#T[t]}}const E=new b;class x{static fromHtml(t){return g.fromHtml(t).withEvaluator(E.evaluator())}static fromSelector(t){return g.fromSelector(t).withEvaluator(E.evaluator())}static fromTemplate(t){return g.fromTemplate(t).withEvaluator(E.evaluator())}static fromFragment(t){return g.fromFragment(t).withEvaluator(E.evaluator())}}class A{static waitFor(t){return E.settle(e=>t.contains(e))}static waitForChildren(t){return E.settle(e=>t!==e&&t.contains(e))}}class w extends HTMLElement{static BITS={registry:E,enqueue:t=>{},SLOTS:!1,CONFIG:void 0,OBSERVED:[],DECLARED:[],ATTR_TO_MAPPER:{},ATTR_TO_PROPERTY:{},TEMPLATES:{}};static get observedAttributes(){return this.BITS.OBSERVED}constructor(){super(),this.internals=this.attachInternals()}internals;#D=!1;#R=!1;#M=new Set;#$=null;#_={};#L(){return this.constructor.BITS}#F(t){const e=this.#L().ATTR_TO_MAPPER[t];if(!e)throw new Error(`${this.constructor.name} declares no attribute '${t}': declare it in static observed or static attributes, or read it with getAttribute`);return e}unmarshal(t,e){return this.#F(t).unmarshal(e,t,this)}marshal(t,e){return this.#F(t).marshal(e,t,this)}get _registry(){return this.#L().registry}component(t){return this.#L().registry.component(t)}template(t){const e=this.#L().TEMPLATES[t??"default"];if(!e)throw new Error(`no template named '${t??"default"}' on ${this.constructor.name}`);const r=e.withEvaluator(this.#L().registry.evaluator()),n=this.#L().CONFIG;return n?r.withOverlay({config:n}):r}connectedCallback(){this.#R||this.#L().enqueue(this)}attributeChangedCallback(t,e,r){e!==r&&(this.#M.has(t)||(this.#D?this[this.#L().ATTR_TO_PROPERTY[t]]=this.unmarshal(t,r):null!==this.#$&&t in this.#$&&(this.#$[t]=this.unmarshal(t,r))))}async upgrade(){if(this.#R)return;this.#R=!0;const t=this.#L().SLOTS?c.from(this):void 0,e=Object.fromEntries(this.#L().DECLARED.map(t=>[t,this.unmarshal(t,this.getAttribute(t))])),r=new Set(this.#L().OBSERVED);this.#_=Object.fromEntries(Object.entries(e).filter(([t])=>!r.has(t))),this.#$=e;try{await this.render({slots:t});const r=this.#L().ATTR_TO_PROPERTY;for(const t of this.#L().OBSERVED)this[r[t]]=e[t];this.#D=!0,this.internals.states.add("rendered")}finally{this.#$=null}}render(t){}declared(t){return t in this.#_?this.#_[t]:null!==this.#$&&t in this.#$?this.#$[t]:this.unmarshal(t,this.getAttribute(t))}get rendered(){return this.#D}reflectTo(t,e){const r=this.marshal(t,e);if(r!==this.getAttribute(t)){this.#M.add(t);try{u.set(this,t,r)}finally{this.#M.delete(t)}}}}const P=/\{(\w+)\}/g,T=/\{(\d+)\}/g,C=t=>"object"==typeof t&&null!==t&&[Object.prototype,null].includes(Object.getPrototypeOf(t)),S=new Set,O=t=>{S.has(t)||(S.add(t),console.warn(`l10n: ${t}`))},N=new t(100),D=(t,e,r)=>{const n=`${t.name}|${e??""}|${void 0===r?"":JSON.stringify(r)}`;return N.getOrCompute(n,()=>new t(e,r))};class R{static t(t,...e){const r=this.l10n??{};let n=Object.hasOwn(r,t)?r[t]:void 0;if(void 0===n)return O(`missing message "${t}"`),t;const s=1===e.length&&C(e[0])?e[0]:null;if(C(n))if("number"!=typeof s?.count)O(`plural message "${t}" needs a numeric {count}`),n=n.other;else{const t=this.locale??navigator?.language??"en";n=n[D(Intl.PluralRules,t).select(s.count)]??n.other}return void 0===n||"object"==typeof n?(O(`plural message "${t}" has no "other" form`),t):s?n.replace(P,(e,r)=>Object.hasOwn(s,r)?String(s[r]):(O(`message "${t}" wants {${r}}`),e)):e.length>0?n.replace(T,(r,n)=>{const s=Number(n);return s>=e.length?(O(`message "${t}" wants {${n}}`),r):String(e[s])}):n}static date(t,e){return D(Intl.DateTimeFormat,this.locale,e).format(t)}static number(t,e){return D(Intl.NumberFormat,this.locale,e).format(t)}static bytes(t){const e=D(Intl.NumberFormat,this.locale,{maximumFractionDigits:2}).format;return t>=1073741824?`${e(t/1024/1024/1024)}GiB`:t>=1048576?`${e(t/1024/1024)}MiB`:t>=1024?`${e(t/1024)}KiB`:`${e(t)}B`}static failure(t){return Array.isArray(t?.problems)&&t.problems.length>0?t.problems.map(t=>{return e=t,("string"==typeof e?.reason&&""!==e.reason.trim()?e.reason:void 0)??R.t.call(this,"failure.no-reason");var e}).join("\n"):void 0!==t?.message?String(t.message):null==t?"":String(t)}static of(t={}){const e=t=>E.evaluator().resolve(t),r=r=>(...n)=>r.apply({l10n:e("l10n"),locale:t.locale??e("locale")},n);return{t:r(R.t),date:r(R.date),number:r(R.number),bytes:r(R.bytes),failure:r(R.failure)}}}export{u as Attributes,t as BoundedCache,l as ExpressionEvaluator,i as Expressions,a as Fragments,c as LightSlots,R as Localization,h as Nodes,w as ParsedElement,b as Registry,v as RenderError,A as Rendering,g as Template,x as Templates,E as registry};
1
+ class t{#t;#e=new Map;constructor(t){this.#t=t}getOrCompute(t,e){if(this.#e.has(t))return this.#e.get(t);const r=e(t);return this.#e.size>=this.#t&&this.#e.delete(this.#e.keys().next().value),this.#e.set(t,r),r}get size(){return this.#e.size}}const e={ter:Symbol("ternary"),elv:Symbol("elvis"),nullc:Symbol("null-coalescence"),or:Symbol("or"),and:Symbol("and"),eq:Symbol("eq"),cmp:Symbol("cmp"),not:Symbol("not"),access:Symbol("access"),member:Symbol("access-member"),subscript:Symbol("access-subscript"),method:Symbol("access-method-call"),call:Symbol("module-function-call"),tstring:Symbol("tstring"),literal:Symbol("literal"),array:Symbol("array-literal"),dict:Symbol("dict-literal"),function:Symbol("module-function"),symbol:Symbol("symbol"),templated:{ten:Symbol("templated-node"),teh:Symbol("templated-html"),tet:Symbol("templated-text"),tel:Symbol("templated-literal")},dom:{t:Symbol("text"),h:Symbol("html"),n:Symbol("node")}},r=new Map([["true",!0],["false",!1],["null",null],["undefined",void 0]]);class n extends SyntaxError{constructor(t,e,r,n){super(t),this.expected=e,this.found=r,this.location=n,this.name="SyntaxError"}format(t){let e="Error: "+this.message;if(this.location){let r=null;const n=t.find(t=>t.source===this.location.source);n&&(r=n.text.split(/\r\n|\n|\r/g));const s=this.location.start,o=this.location.source&&"function"==typeof this.location.source.offset?this.location.source.offset(s):s,i=this.location.source+":"+o.line+":"+o.column;if(r){const t=this.location.end,n="".padEnd(o.line.toString().length," "),l=r[s.line-1],a=(s.line===t.line?t.column:l.length+1)-s.column||1;e+="\n --\x3e "+i+"\n"+n+" |\n"+o.line+" | "+l+"\n"+n+" | "+"".padEnd(s.column-1," ")+"".padEnd(a,"^")}else e+="\n at "+i}return e}static buildMessage(t,e){function r(t){return t.codePointAt(0).toString(16).toUpperCase()}const n=Object.prototype.hasOwnProperty.call(RegExp.prototype,"unicode")?new RegExp("[\\p{C}\\p{Mn}\\p{Mc}]","gu"):null;function s(t,e){return function(t){return n?t.replace(n,t=>"\\u{"+r(t)+"}"):t}(t.replace(e,"\\$&").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,t=>"\\x0"+r(t)).replace(/[\x10-\x1F\x7F-\x9F]/g,t=>"\\x"+r(t)))}function o(t){return s(t,/[\\"]/g)}function i(t){return s(t,/[\\\]^-]/g)}const l={literal:t=>'"'+o(t.text)+'"',class(t){const e=t.parts.map(t=>Array.isArray(t)?i(t[0])+"-"+i(t[1]):i(t));return"["+(t.inverted?"^":"")+e.join("")+"]"+(t.unicode?"u":"")},any:()=>"any character",end:()=>"end of input",other:t=>t.description};function a(t){return l[t.type](t)}return"Expected "+function(t){const e=t.map(a);if(e.sort(),e.length>0){let t=1;for(let r=1;r<e.length;r++)e[r-1]!==e[r]&&(e[t]=e[r],t++);e.length=t}switch(e.length){case 1:return e[0];case 2:return e[0]+" or "+e[1];default:return e.slice(0,-1).join(", ")+", or "+e[e.length-1]}}(t)+" but "+function(t){return t?'"'+o(t)+'"':"end of input"}(e)+" found."}}const s=(t,e)=>{if("self"===e)return t[t.length-1];for(let r=t.length-1;r>=0;r--){const n=t[r];if(null!=n&&("object"==typeof n||"function"==typeof n)&&e in n)return n[e]}},o=Symbol("BOUND");class i{#r;#n;#s;constructor(t,e,r){this.#r=t,this.#n=e,this.#s=r??e.length}#o(t){return s(this.#n,t)}#i(t,r){const n=0===r?t.lhs:t.rhs[r-1];return n.type===e.symbol?n.value:n.type===e.member?n.rhs:null}#l;#a(){if(!this.#l){const t=t=>s(this.#n.slice(0,this.#s),t);this.#l=new Proxy(this.#n,{get:(e,r)=>r===o?t:this.#o(r)})}return this.#l}[e.and](t){return this.visit(t.lhs)&&this.visit(t.rhs)}[e.or](t){return this.visit(t.lhs)||this.visit(t.rhs)}[e.nullc](t){return this.visit(t.lhs)??this.visit(t.rhs)}[e.not](t){return!this.visit(t.expr)}[e.eq](t){const e=this.visit(t.lhs)===this.visit(t.rhs);return"=="===t.op?e:!e}[e.cmp](t){const e=this.visit(t.lhs),r=this.visit(t.rhs);switch(t.op){case">":return e>r;case"<":return e<r;case">=":return e>=r;case"<=":return e<=r;default:throw new Error(`unknown cmp op ${t.op}`)}}[e.call](t){const e=t.value,r=null===e.module?this.#r:this.#r?.[e.module];if(!r)throw new Error(`Module "${e.module}" not found`);const n=r[e.value];if(!n)throw new Error(`Function "#${null===e.module?"":`${e.module}:`}${e.value}" not found`);const s=t.args.map(t=>this.visit(t));return n.apply(this.#a(),s)}[e.literal](t){return t.value}[e.tstring](t){let e="";const r=t.parts;for(let t=0,n=r.length;t<n;t++){const n=this.visit(r[t]);null!=n&&(e+=n)}return e}[e.symbol](t){return this.#o(t.value)}[e.dict](t){return Object.fromEntries(t.value.map(t=>[this.visit(t[0]),this.visit(t[1])]))}[e.array](t){return t.value.map(t=>this.visit(t))}[e.ter](t){return this.visit(t.cond)?this.visit(t.ifTrue):this.visit(t.ifFalse)}[e.elv](t){return this.visit(t.cond)||this.visit(t.ifFalse)}[e.access](t){let r,n=this.visit(t.lhs);for(let s=0;s!==t.rhs.length;++s){const o=t.rhs[s];if(o.ns&&null==n)return;let i;switch(o.type){case e.member:i=n[o.rhs];break;case e.subscript:i=n[this.visit(o.rhs)];break;case e.method:{if(!n){const e=this.#i(t,s);throw new Error(null===e?"Method missing":`Method missing "${e}"`)}const e=o.args.map(t=>this.visit(t));i=n.apply(r,e);break}}r=n,n=i}return n}visit(t,...e){return this[t.type](t,...e)}visitRoot(t,r){return r?t.map(t=>{switch(t.type){case e.templated.tel:return{type:e.dom.t,value:t.value};case e.templated.tet:return{type:e.dom.t,value:this.visit(t.value)};case e.templated.teh:return{type:e.dom.h,value:this.visit(t.value)};case e.templated.ten:return{type:e.dom.n,value:this.visit(t.value)};default:throw new Error(`unknown node type ${t.type.toString()}`)}}):this.visit(t)}}class l{static MODE_EXPRESSION=Symbol("MODE_EXPRESSION");static MODE_TEMPLATED=Symbol("MODE_TEMPLATED");static BOUND=o;static#u=new t(1e3);static parse(t,s){const o=s?.toString()+t;return this.#u.getOrCompute(o,()=>function(t,s){const o={},i=(s=void 0!==s?s:{}).grammarSource,l={TemplatedRoot:ae,ExpressionRoot:ce};let a=ae;const u="{{{{",c="}}}}",h="{{{",d="}}}",p="{{",m="}}",f="\\",g="{",v="?",y=":",b="?:",E="??",x="||",A="&&",w="!",P="?.",T=".",S="[",C="]",O="(",N=",",D=")",R="-",M="'",$='"',_="`",L="}",F="#",j="==",k="!=",I=">=",V=">",q="<=",B="<",H=re("{{{{",!1),z=re("}}}}",!1),W=re("{{{",!1),U=re("}}}",!1),X=re("{{",!1),Q=re("}}",!1),G=ne(["\\","{"],!0,!1,!1),J=re("\\",!1),Y={type:"any"},Z=re("{",!1),K=re("?",!1),tt=re(":",!1),et=re("?:",!1),rt=re("??",!1),nt=re("||",!1),st=re("&&",!1),ot=re("!",!1),it=se("member"),lt=re("?.",!1),at=re(".",!1),ut=se("subscript"),ct=re("[",!1),ht=re("]",!1),dt=se("method-call"),pt=re("(",!1),mt=re(",",!1),ft=re(")",!1),gt=se("module-function-call"),vt=se("number-literal"),yt=re("-",!1),bt=ne([["0","9"]],!1,!1,!1),Et=se("string-literal"),xt=re("'",!1),At=ne(["'"],!0,!1,!1),wt=re('"',!1),Pt=ne(['"'],!0,!1,!1),Tt=re("`",!1),St=se("tstring-expression"),Ct=re("}",!1),Ot=se("tstring-literal"),Nt=ne(["\\","`","{"],!0,!1,!1),Dt=se("array-literal"),Rt=se("dict-literal"),Mt=se("module-function"),$t=re("#",!1),_t=ne([["a","z"],["A","Z"],"$","_"],!1,!1,!1),Lt=ne([["a","z"],["A","Z"],"$","_",["0","9"]],!1,!1,!1),Ft=se("identifier-or-keyword"),jt=re("==",!1),kt=re("!=",!1),It=re(">=",!1),Vt=re(">",!1),qt=re("<=",!1),Bt=re("<",!1),Ht=ne([" ","\t","\n","\r"],!1,!1,!1);function zt(t){return t}function Wt(t,e,r){return{op:e,rhs:r}}function Ut(t,e,r){return{op:e,rhs:r}}function Xt(t){return t}let Qt=0|s.peg$currPos;const Gt=[{line:1,column:1}];let Jt,Yt,Zt=Qt,Kt=s.peg$maxFailExpected||[],te=0|s.peg$silentFails,ee=new Map;if(s.startRule){if(!(s.startRule in l))throw new Error("Can't start parsing from rule \""+s.startRule+'".');a=l[s.startRule]}function re(t,e){return{type:"literal",text:t,ignoreCase:e}}function ne(t,e,r,n){return{type:"class",parts:t,inverted:e,ignoreCase:r,unicode:n}}function se(t){return{type:"other",description:t}}function oe(e){let r,n=Gt[e];if(n)return n;if(e>=Gt.length)r=Gt.length-1;else for(r=e;!Gt[--r];);for(n=Gt[r],n={line:n.line,column:n.column};r<e;)10===t.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return Gt[e]=n,n}function ie(t,e,r){const n=oe(t),s=oe(e);return{source:i,start:{offset:t,line:n.line,column:n.column},end:{offset:e,line:s.line,column:s.column}}}function le(t){Qt<Zt||(Qt>Zt&&(Zt=Qt,Kt=[]),Kt.push(t))}function ae(){let t,e;const r=38*Qt+0,n=ee.get(r);if(n)return Qt=n.nextPos,n.result;for(t=[];e=ue(),e!==o;)t.push(e);return ee.set(r,{nextPos:Qt,result:t}),t}function ue(){let r,n,s,i,l;const a=38*Qt+1,v=ee.get(a);return v?(Qt=v.nextPos,v.result):(r=Qt,n=Qt,s=function(){let e;const r=38*Qt+2,n=ee.get(r);return n?(Qt=n.nextPos,n.result):(t.substr(Qt,4)===u?(e=u,Qt+=4):(e=o,0===te&&le(H)),ee.set(r,{nextPos:Qt,result:e}),e)}(),s!==o?(i=ce(),i!==o?(l=function(){let e;const r=38*Qt+3,n=ee.get(r);return n?(Qt=n.nextPos,n.result):(t.substr(Qt,4)===c?(e=c,Qt+=4):(e=o,0===te&&le(z)),ee.set(r,{nextPos:Qt,result:e}),e)}(),l!==o?n=i:(Qt=n,n=o)):(Qt=n,n=o)):(Qt=n,n=o),n!==o&&(y=n,n={type:e.templated.ten,value:y}),r=n,r===o&&(r=Qt,n=Qt,s=function(){let e;const r=38*Qt+4,n=ee.get(r);return n?(Qt=n.nextPos,n.result):(t.substr(Qt,3)===h?(e=h,Qt+=3):(e=o,0===te&&le(W)),ee.set(r,{nextPos:Qt,result:e}),e)}(),s!==o?(i=ce(),i!==o?(l=function(){let e;const r=38*Qt+5,n=ee.get(r);return n?(Qt=n.nextPos,n.result):(t.substr(Qt,3)===d?(e=d,Qt+=3):(e=o,0===te&&le(U)),ee.set(r,{nextPos:Qt,result:e}),e)}(),l!==o?n=i:(Qt=n,n=o)):(Qt=n,n=o)):(Qt=n,n=o),n!==o&&(n=function(t){return{type:e.templated.teh,value:t}}(n)),r=n,r===o&&(r=Qt,n=Qt,s=function(){let e;const r=38*Qt+6,n=ee.get(r);return n?(Qt=n.nextPos,n.result):(t.substr(Qt,2)===p?(e=p,Qt+=2):(e=o,0===te&&le(X)),ee.set(r,{nextPos:Qt,result:e}),e)}(),s!==o?(i=ce(),i!==o?(l=function(){let e;const r=38*Qt+7,n=ee.get(r);return n?(Qt=n.nextPos,n.result):(t.substr(Qt,2)===m?(e=m,Qt+=2):(e=o,0===te&&le(Q)),ee.set(r,{nextPos:Qt,result:e}),e)}(),l!==o?n=i:(Qt=n,n=o)):(Qt=n,n=o)):(Qt=n,n=o),n!==o&&(n=function(t){return{type:e.templated.tet,value:t}}(n)),r=n,r===o&&(r=Qt,n=function(){let e,r,n,s,i,l,a;const u=38*Qt+8,c=ee.get(u);if(c)return Qt=c.nextPos,c.result;for(e=Qt,r=[];;){for(n=Qt,s=[];i=t.charAt(Qt),""!==i&&(Yt=i.charCodeAt(0),92!==Yt&&123!==Yt)?Qt++:(i=o,0===te&&le(G)),i!==o;)s.push(i);if(s.length<1&&(s=o),n=s!==o?t.substring(n,Qt):s,n===o&&(n=Qt,92===t.charCodeAt(Qt)?(s=f,Qt++):(s=o,0===te&&le(J)),s!==o?(t.length>Qt?(i=t.charAt(Qt),Qt++):(i=o,0===te&&le(Y)),i!==o?n=zt(i):(Qt=n,n=o)):(Qt=n,n=o),n===o&&(n=Qt,s=Qt,123===t.charCodeAt(Qt)?(i=g,Qt++):(i=o,0===te&&le(Z)),i!==o?(l=Qt,te++,123===t.charCodeAt(Qt)?(a=g,Qt++):(a=o,0===te&&le(Z)),te--,a===o?l=void 0:(Qt=l,l=o),l!==o?(i=[i,l],s=i):(Qt=s,s=o)):(Qt=s,s=o),n=s!==o?t.substring(n,Qt):s)),n===o)break;r.push(n)}return r.length<1&&(r=o),r!==o&&(r=r.join("")),e=r,ee.set(u,{nextPos:Qt,result:e}),e}(),n!==o&&(n=function(t){return{type:e.templated.tel,value:t}}(n)),r=n))),ee.set(a,{nextPos:Qt,result:r}),r);var y}function ce(){let t,e;const r=38*Qt+9,n=ee.get(r);return n?(Qt=n.nextPos,n.result):(t=Qt,Ce(),e=he(),e!==o?(Ce(),t=e):(Qt=t,t=o),ee.set(r,{nextPos:Qt,result:t}),t)}function he(){let r,n,s,i,l,a;const u=38*Qt+10,c=ee.get(u);return c?(Qt=c.nextPos,c.result):(r=Qt,n=de(),n!==o?(Ce(),63===t.charCodeAt(Qt)?(s=v,Qt++):(s=o,0===te&&le(K)),s!==o?(Ce(),i=he(),i!==o?(Ce(),58===t.charCodeAt(Qt)?(l=y,Qt++):(l=o,0===te&&le(tt)),l!==o?(Ce(),a=he(),a!==o?r={type:e.ter,cond:n,ifTrue:i,ifFalse:a}:(Qt=r,r=o)):(Qt=r,r=o)):(Qt=r,r=o)):(Qt=r,r=o)):(Qt=r,r=o),r===o&&(r=de()),ee.set(u,{nextPos:Qt,result:r}),r)}function de(){let r,n,s,i;const l=38*Qt+11,a=ee.get(l);return a?(Qt=a.nextPos,a.result):(r=Qt,n=pe(),n!==o?(Ce(),t.substr(Qt,2)===b?(s=b,Qt+=2):(s=o,0===te&&le(et)),s!==o?(Ce(),i=de(),i!==o?r={type:e.elv,cond:n,ifFalse:i}:(Qt=r,r=o)):(Qt=r,r=o)):(Qt=r,r=o),r===o&&(r=pe()),ee.set(l,{nextPos:Qt,result:r}),r)}function pe(){let r,n,s,i;const l=38*Qt+12,a=ee.get(l);return a?(Qt=a.nextPos,a.result):(r=Qt,n=me(),n!==o?(Ce(),t.substr(Qt,2)===E?(s=E,Qt+=2):(s=o,0===te&&le(rt)),s!==o?(Ce(),i=pe(),i!==o?r={type:e.nullc,lhs:n,rhs:i}:(Qt=r,r=o)):(Qt=r,r=o)):(Qt=r,r=o),r===o&&(r=me()),ee.set(l,{nextPos:Qt,result:r}),r)}function me(){let r,n,s,i,l,a;const u=38*Qt+13,c=ee.get(u);if(c)return Qt=c.nextPos,c.result;if(r=Qt,n=fe(),n!==o){for(s=[];i=Qt,Ce(),t.substr(Qt,2)===x?(l=x,Qt+=2):(l=o,0===te&&le(nt)),l!==o?(Ce(),a=fe(),a!==o?i=a:(Qt=i,i=o)):(Qt=i,i=o),i!==o;)s.push(i);r=function(t,r){let n=t;for(const t of r)n={type:e.or,lhs:n,rhs:t};return n}(n,s)}else Qt=r,r=o;return ee.set(u,{nextPos:Qt,result:r}),r}function fe(){let r,n,s,i,l,a;const u=38*Qt+14,c=ee.get(u);if(c)return Qt=c.nextPos,c.result;if(r=Qt,n=ge(),n!==o){for(s=[];i=Qt,Ce(),t.substr(Qt,2)===A?(l=A,Qt+=2):(l=o,0===te&&le(st)),l!==o?(Ce(),a=ge(),a!==o?i=a:(Qt=i,i=o)):(Qt=i,i=o),i!==o;)s.push(i);r=function(t,r){let n=t;for(const t of r)n={type:e.and,lhs:n,rhs:t};return n}(n,s)}else Qt=r,r=o;return ee.set(u,{nextPos:Qt,result:r}),r}function ge(){let t,r,n,s,i,l;const a=38*Qt+15,u=ee.get(a);if(u)return Qt=u.nextPos,u.result;if(t=Qt,r=ve(),r!==o){for(n=[];s=Qt,Ce(),i=Te(),i!==o?(Ce(),l=ve(),l!==o?s=Wt(0,i,l):(Qt=s,s=o)):(Qt=s,s=o),s!==o;)n.push(s);t=function(t,r){let n=t;for(const t of r)n={type:e.eq,op:t.op,lhs:n,rhs:t.rhs};return n}(r,n)}else Qt=t,t=o;return ee.set(a,{nextPos:Qt,result:t}),t}function ve(){let t,r,n,s,i,l;const a=38*Qt+16,u=ee.get(a);if(u)return Qt=u.nextPos,u.result;if(t=Qt,r=ye(),r!==o){for(n=[];s=Qt,Ce(),i=Se(),i!==o?(Ce(),l=ye(),l!==o?s=Ut(0,i,l):(Qt=s,s=o)):(Qt=s,s=o),s!==o;)n.push(s);t=function(t,r){let n=t;for(const t of r)n={type:e.cmp,op:t.op,lhs:n,rhs:t.rhs};return n}(r,n)}else Qt=t,t=o;return ee.set(a,{nextPos:Qt,result:t}),t}function ye(){let r,n,s;const i=38*Qt+17,l=ee.get(i);return l?(Qt=l.nextPos,l.result):(r=Qt,33===t.charCodeAt(Qt)?(n=w,Qt++):(n=o,0===te&&le(ot)),n!==o?(Ce(),s=ye(),s!==o?r={type:e.not,expr:s}:(Qt=r,r=o)):(Qt=r,r=o),r===o&&(r=function(){let t,r,n,s,i;const l=38*Qt+18,a=ee.get(l);if(a)return Qt=a.nextPos,a.result;if(t=Qt,r=Ee(),r!==o){for(Ce(),n=[];s=Qt,i=be(),i!==o?(Ce(),s=i):(Qt=s,s=o),s!==o;)n.push(s);n.length<1&&(n=o),n!==o?t={type:e.access,lhs:r,rhs:n}:(Qt=t,t=o)}else Qt=t,t=o;return t===o&&(t=Ee()),ee.set(l,{nextPos:Qt,result:t}),t}()),ee.set(i,{nextPos:Qt,result:r}),r)}function be(){let r;const n=38*Qt+19,s=ee.get(n);return s?(Qt=s.nextPos,s.result):(r=function(){let r,n,s;const i=38*Qt+20,l=ee.get(i);return l?(Qt=l.nextPos,l.result):(te++,r=Qt,t.substr(Qt,2)===P?(n=P,Qt+=2):(n=o,0===te&&le(lt)),n===o&&(46===t.charCodeAt(Qt)?(n=T,Qt++):(n=o,0===te&&le(at))),n!==o?(Ce(),s=Pe(),s!==o?r={type:e.member,ns:"?."===n,rhs:s}:(Qt=r,r=o)):(Qt=r,r=o),te--,r===o&&(n=o,0===te&&le(it)),ee.set(i,{nextPos:Qt,result:r}),r)}(),r===o&&(r=function(){let r,n,s,i,l;const a=38*Qt+21,u=ee.get(a);return u?(Qt=u.nextPos,u.result):(te++,r=Qt,t.substr(Qt,2)===P?(n=P,Qt+=2):(n=o,0===te&&le(lt)),n===o&&(n=null),91===t.charCodeAt(Qt)?(s=S,Qt++):(s=o,0===te&&le(ct)),s!==o?(Ce(),i=he(),i!==o?(Ce(),93===t.charCodeAt(Qt)?(l=C,Qt++):(l=o,0===te&&le(ht)),l!==o?r={type:e.subscript,ns:null!==n,rhs:i}:(Qt=r,r=o)):(Qt=r,r=o)):(Qt=r,r=o),te--,r===o&&(n=o,0===te&&le(ut)),ee.set(a,{nextPos:Qt,result:r}),r)}(),r===o&&(r=function(){let r,n,s,i,l,a,u,c;const h=38*Qt+22,d=ee.get(h);if(d)return Qt=d.nextPos,d.result;if(te++,r=Qt,t.substr(Qt,2)===P?(n=P,Qt+=2):(n=o,0===te&&le(lt)),n===o&&(n=null),40===t.charCodeAt(Qt)?(s=O,Qt++):(s=o,0===te&&le(pt)),s!==o){for(Ce(),i=Qt,l=he(),l!==o?(a=Ce(),i=l):(Qt=i,i=o),i===o&&(i=null),l=[];a=Qt,44===t.charCodeAt(Qt)?(u=N,Qt++):(u=o,0===te&&le(mt)),u!==o?(Ce(),c=he(),c!==o?(Ce(),a=c):(Qt=a,a=o)):(Qt=a,a=o),a!==o;)l.push(a);41===t.charCodeAt(Qt)?(a=D,Qt++):(a=o,0===te&&le(ft)),a!==o?(m=l,r={type:e.method,ns:null!==n,args:null===(p=i)?[]:[p,...m]}):(Qt=r,r=o)}else Qt=r,r=o;var p,m;return te--,r===o&&(n=o,0===te&&le(dt)),ee.set(h,{nextPos:Qt,result:r}),r}())),ee.set(n,{nextPos:Qt,result:r}),r)}function Ee(){let n,s,i,l;const a=38*Qt+23,u=ee.get(a);return u?(Qt=u.nextPos,u.result):(n=Qt,40===t.charCodeAt(Qt)?(s=O,Qt++):(s=o,0===te&&le(pt)),s!==o?(Ce(),i=he(),i!==o?(Ce(),41===t.charCodeAt(Qt)?(l=D,Qt++):(l=o,0===te&&le(ft)),l!==o?n=i:(Qt=n,n=o)):(Qt=n,n=o)):(Qt=n,n=o),n===o&&(n=function(){let r,n,s,i,l,a,u,c;const h=38*Qt+24,d=ee.get(h);if(d)return Qt=d.nextPos,d.result;if(te++,r=Qt,n=function(){let r,n,s,i,l;const a=38*Qt+32,u=ee.get(a);return u?(Qt=u.nextPos,u.result):(te++,r=Qt,35===t.charCodeAt(Qt)?(n=F,Qt++):(n=o,0===te&&le($t)),n!==o?(s=Qt,i=Pe(),i!==o?(58===t.charCodeAt(Qt)?(l=y,Qt++):(l=o,0===te&&le(tt)),l!==o?s=i:(Qt=s,s=o)):(Qt=s,s=o),s===o&&(s=null),i=Pe(),i!==o?r={type:e.function,module:s,value:i}:(Qt=r,r=o)):(Qt=r,r=o),te--,r===o&&(n=o,0===te&&le(Mt)),ee.set(a,{nextPos:Qt,result:r}),r)}(),n!==o)if(40===t.charCodeAt(Qt)?(s=O,Qt++):(s=o,0===te&&le(pt)),s!==o){for(Ce(),i=Qt,l=he(),l!==o?(a=Ce(),i=l):(Qt=i,i=o),i===o&&(i=null),l=[];a=Qt,44===t.charCodeAt(Qt)?(u=N,Qt++):(u=o,0===te&&le(mt)),u!==o?(Ce(),c=he(),c!==o?(Ce(),a=c):(Qt=a,a=o)):(Qt=a,a=o),a!==o;)l.push(a);41===t.charCodeAt(Qt)?(a=D,Qt++):(a=o,0===te&&le(ft)),a!==o?r=function(t,r,n){const s=null===r?[]:[r,...n];return{type:e.call,value:t,args:s}}(n,i,l):(Qt=r,r=o)}else Qt=r,r=o;else Qt=r,r=o;return te--,r===o&&(n=o,0===te&&le(gt)),ee.set(h,{nextPos:Qt,result:r}),r}(),n===o&&(n=function(){let r;const n=38*Qt+25,s=ee.get(n);return s?(Qt=s.nextPos,s.result):(r=function(){let r,n,s,i,l,a,u,c,h,d;const p=38*Qt+26,m=ee.get(p);if(m)return Qt=m.nextPos,m.result;for(te++,r=Qt,n=Qt,s=Qt,45===t.charCodeAt(Qt)?(i=R,Qt++):(i=o,0===te&&le(yt)),i===o&&(i=null),l=Qt,a=[];u=t.charAt(Qt),Yt=u.charCodeAt(0),Yt>=48&&Yt<=57?Qt++:(u=o,0===te&&le(bt)),u!==o;)a.push(u);if(a.length<1&&(a=o),a!==o){if(u=Qt,46===t.charCodeAt(Qt)?(c=T,Qt++):(c=o,0===te&&le(at)),c!==o){for(h=[];d=t.charAt(Qt),Yt=d.charCodeAt(0),Yt>=48&&Yt<=57?Qt++:(d=o,0===te&&le(bt)),d!==o;)h.push(d);c=[c,h],u=c}else Qt=u,u=o;u===o&&(u=null),a=[a,u],l=a}else Qt=l,l=o;if(l===o)if(l=Qt,46===t.charCodeAt(Qt)?(a=T,Qt++):(a=o,0===te&&le(at)),a!==o){for(u=[];c=t.charAt(Qt),Yt=c.charCodeAt(0),Yt>=48&&Yt<=57?Qt++:(c=o,0===te&&le(bt)),c!==o;)u.push(c);u.length<1&&(u=o),u!==o?(a=[a,u],l=a):(Qt=l,l=o)}else Qt=l,l=o;return l!==o?(i=[i,l],s=i):(Qt=s,s=o),n=s!==o?t.substring(n,Qt):s,n!==o&&(n={type:e.literal,value:parseFloat(n)}),r=n,te--,r===o&&(n=o,0===te&&le(vt)),ee.set(p,{nextPos:Qt,result:r}),r}(),r===o&&(r=xe(),r===o&&(r=function(){let r,n,s,i,l,a,u;const c=38*Qt+30,h=ee.get(c);if(h)return Qt=h.nextPos,h.result;if(te++,r=Qt,91===t.charCodeAt(Qt)?(n=S,Qt++):(n=o,0===te&&le(ct)),n!==o){for(Ce(),s=he(),s===o&&(s=null),Ce(),i=[];l=Qt,44===t.charCodeAt(Qt)?(a=N,Qt++):(a=o,0===te&&le(mt)),a!==o?(Ce(),u=he(),u!==o?(Ce(),l=u):(Qt=l,l=o)):(Qt=l,l=o),l!==o;)i.push(l);93===t.charCodeAt(Qt)?(l=C,Qt++):(l=o,0===te&&le(ht)),l!==o?r=function(t,r){const n=null===t?[]:[t,...r];return{type:e.array,value:n}}(s,i):(Qt=r,r=o)}else Qt=r,r=o;return te--,r===o&&(n=o,0===te&&le(Dt)),ee.set(c,{nextPos:Qt,result:r}),r}(),r===o&&(r=function(){let r,n,s,i,l,a,u,c,h,d,p;const m=38*Qt+31,f=ee.get(m);if(f)return Qt=f.nextPos,f.result;if(te++,r=Qt,123===t.charCodeAt(Qt)?(n=g,Qt++):(n=o,0===te&&le(Z)),n!==o){for(Ce(),s=Qt,i=xe(),i!==o?(l=Ce(),58===t.charCodeAt(Qt)?(a=y,Qt++):(a=o,0===te&&le(tt)),a!==o?(u=Ce(),c=he(),c!==o?s=[i,c]:(Qt=s,s=o)):(Qt=s,s=o)):(Qt=s,s=o),s===o&&(s=null),i=Ce(),l=[];a=Qt,44===t.charCodeAt(Qt)?(u=N,Qt++):(u=o,0===te&&le(mt)),u!==o?(c=Ce(),h=xe(),h!==o?(Ce(),58===t.charCodeAt(Qt)?(d=y,Qt++):(d=o,0===te&&le(tt)),d!==o?(Ce(),p=he(),p!==o?(Ce(),a=[h,p]):(Qt=a,a=o)):(Qt=a,a=o)):(Qt=a,a=o)):(Qt=a,a=o),a!==o;)l.push(a);125===t.charCodeAt(Qt)?(a=L,Qt++):(a=o,0===te&&le(Ct)),a!==o?(b=l,E=[],null!==(v=s)&&E.push(v),E.push.apply(E,b),r={type:e.dict,value:E}):(Qt=r,r=o)}else Qt=r,r=o;var v,b,E;return te--,r===o&&(n=o,0===te&&le(Rt)),ee.set(m,{nextPos:Qt,result:r}),r}()))),ee.set(n,{nextPos:Qt,result:r}),r)}(),n===o&&(n=function(){let t,n;const s=38*Qt+34,i=ee.get(s);return i?(Qt=i.nextPos,i.result):(te++,t=Qt,n=Pe(),n!==o&&(l=n,n=r.has(l)?{type:e.literal,value:r.get(l)}:{type:e.symbol,value:l}),t=n,te--,t===o&&(n=o,0===te&&le(Ft)),ee.set(s,{nextPos:Qt,result:t}),t);var l}()))),ee.set(a,{nextPos:Qt,result:n}),n)}function xe(){let r,n,s,i,l;const a=38*Qt+27,u=ee.get(a);if(u)return Qt=u.nextPos,u.result;if(te++,r=Qt,39===t.charCodeAt(Qt)?(n=M,Qt++):(n=o,0===te&&le(xt)),n!==o){for(s=Qt,i=[];l=t.charAt(Qt),""!==l&&(Yt=l.charCodeAt(0),39!==Yt)?Qt++:(l=o,0===te&&le(At)),l!==o;)i.push(l);s=t.substring(s,Qt),39===t.charCodeAt(Qt)?(i=M,Qt++):(i=o,0===te&&le(xt)),i!==o?r={type:e.literal,value:s}:(Qt=r,r=o)}else Qt=r,r=o;if(r===o){if(r=Qt,34===t.charCodeAt(Qt)?(n=$,Qt++):(n=o,0===te&&le(wt)),n!==o){for(s=Qt,i=[];l=t.charAt(Qt),""!==l&&(Yt=l.charCodeAt(0),34!==Yt)?Qt++:(l=o,0===te&&le(Pt)),l!==o;)i.push(l);s=t.substring(s,Qt),34===t.charCodeAt(Qt)?(i=$,Qt++):(i=o,0===te&&le(wt)),i!==o?r={type:e.literal,value:s}:(Qt=r,r=o)}else Qt=r,r=o;if(r===o)if(r=Qt,96===t.charCodeAt(Qt)?(n=_,Qt++):(n=o,0===te&&le(Tt)),n!==o){for(s=[];i=Ae(),i===o&&(i=we()),i!==o;)s.push(i);96===t.charCodeAt(Qt)?(i=_,Qt++):(i=o,0===te&&le(Tt)),i!==o?r={type:e.tstring,parts:s}:(Qt=r,r=o)}else Qt=r,r=o}return te--,r===o&&(n=o,0===te&&le(Et)),ee.set(a,{nextPos:Qt,result:r}),r}function Ae(){let e,r,n,s;const i=38*Qt+28,l=ee.get(i);return l?(Qt=l.nextPos,l.result):(te++,e=Qt,123===t.charCodeAt(Qt)?(r=g,Qt++):(r=o,0===te&&le(Z)),r!==o?(Ce(),n=he(),n!==o?(Ce(),125===t.charCodeAt(Qt)?(s=L,Qt++):(s=o,0===te&&le(Ct)),s!==o?e=n:(Qt=e,e=o)):(Qt=e,e=o)):(Qt=e,e=o),te--,e===o&&(r=o,0===te&&le(St)),ee.set(i,{nextPos:Qt,result:e}),e)}function we(){let r,n,s,i,l;const a=38*Qt+29,u=ee.get(a);if(u)return Qt=u.nextPos,u.result;for(te++,r=Qt,n=[];;){for(s=Qt,i=[];l=t.charAt(Qt),""!==l&&(Yt=l.charCodeAt(0),92!==Yt&&96!==Yt&&123!==Yt)?Qt++:(l=o,0===te&&le(Nt)),l!==o;)i.push(l);if(i.length<1&&(i=o),s=i!==o?t.substring(s,Qt):i,s===o&&(s=Qt,92===t.charCodeAt(Qt)?(i=f,Qt++):(i=o,0===te&&le(J)),i!==o?(t.length>Qt?(l=t.charAt(Qt),Qt++):(l=o,0===te&&le(Y)),l!==o?s=Xt(l):(Qt=s,s=o)):(Qt=s,s=o)),s===o)break;n.push(s)}return n.length<1&&(n=o),n!==o&&(n={type:e.literal,value:n.join("")}),r=n,r===o&&(r=Qt,123===t.charCodeAt(Qt)?(n=g,Qt++):(n=o,0===te&&le(Z)),n!==o&&(n={type:e.literal,value:n}),r=n),te--,r===o&&(n=o,0===te&&le(Ot)),ee.set(a,{nextPos:Qt,result:r}),r}function Pe(){let e,r,n,s,i;const l=38*Qt+33,a=ee.get(l);if(a)return Qt=a.nextPos,a.result;if(e=Qt,r=Qt,n=t.charAt(Qt),Yt=n.charCodeAt(0),Yt>=97&&Yt<=122||Yt>=65&&Yt<=90||36===Yt||95===Yt?Qt++:(n=o,0===te&&le(_t)),n!==o){for(s=[];i=t.charAt(Qt),Yt=i.charCodeAt(0),Yt>=97&&Yt<=122||Yt>=65&&Yt<=90||36===Yt||95===Yt||Yt>=48&&Yt<=57?Qt++:(i=o,0===te&&le(Lt)),i!==o;)s.push(i);n=[n,s],r=n}else Qt=r,r=o;return e=r!==o?t.substring(e,Qt):r,ee.set(l,{nextPos:Qt,result:e}),e}function Te(){let e;const r=38*Qt+35,n=ee.get(r);return n?(Qt=n.nextPos,n.result):(t.substr(Qt,2)===j?(e=j,Qt+=2):(e=o,0===te&&le(jt)),e===o&&(t.substr(Qt,2)===k?(e=k,Qt+=2):(e=o,0===te&&le(kt))),ee.set(r,{nextPos:Qt,result:e}),e)}function Se(){let e;const r=38*Qt+36,n=ee.get(r);return n?(Qt=n.nextPos,n.result):(t.substr(Qt,2)===I?(e=I,Qt+=2):(e=o,0===te&&le(It)),e===o&&(62===t.charCodeAt(Qt)?(e=V,Qt++):(e=o,0===te&&le(Vt)),e===o&&(t.substr(Qt,2)===q?(e=q,Qt+=2):(e=o,0===te&&le(qt)),e===o&&(60===t.charCodeAt(Qt)?(e=B,Qt++):(e=o,0===te&&le(Bt))))),ee.set(r,{nextPos:Qt,result:e}),e)}function Ce(){let e,r;const n=38*Qt+37,s=ee.get(n);if(s)return Qt=s.nextPos,s.result;for(te++,e=[];r=t.charAt(Qt),Yt=r.charCodeAt(0),32===Yt||9===Yt||10===Yt||13===Yt?Qt++:(r=o,0===te&&le(Ht)),r!==o;)e.push(r);return te--,ee.set(n,{nextPos:Qt,result:e}),e}Jt=a();const Oe=Jt!==o&&Qt===t.length;function Ne(){throw Jt!==o&&Qt<t.length&&le({type:"end"}),e=Kt,r=Zt<t.length?function(e=Qt){const r=t.codePointAt(e);return void 0===r?"":String.fromCodePoint(r)}(Zt):null,s=Zt<t.length?ie(Zt,Zt+1):ie(Zt,Zt),new n(n.buildMessage(e,r),e,r,s);var e,r,s}return s.peg$library?{peg$result:Jt,peg$currPos:Qt,peg$FAILED:o,peg$maxFailExpected:Kt,peg$maxFailPos:Zt,peg$success:Oe,peg$throw:Oe?void 0:Ne}:Oe?Jt:void Ne()}(t,{startRule:s===l.MODE_TEMPLATED?"TemplatedRoot":"ExpressionRoot"}))}static evaluate(t,e,r,n,s){return new i(t,e,s).visitRoot(r,n===l.MODE_TEMPLATED)}static interpret(t,e,r,n,s){return l.evaluate(t,e,l.parse(r,n),n,s)}}class a{#r;#n;#s;constructor(t,e,r){this.#r=t,this.#n=e,this.#s=r??e.length}withModule(t,e){const r=t?{[t]:e}:e;return new a({...this.#r,...r},this.#n,this.#s)}withOverlay(...t){return new a(this.#r,0===t.length?this.#n:[...this.#n,...t],this.#s)}resolve(t){return s(this.#n,t)}evaluateExpression(t){return l.interpret(this.#r,this.#n,t,l.MODE_EXPRESSION,this.#s)}evaluateTemplated(t){return l.interpret(this.#r,this.#n,t,l.MODE_TEMPLATED,this.#s)}}class u{static fromHtml(...t){const e=document.createElement("template");return e.innerHTML=t.map(t=>t.trim()).join(""),document.adoptNode(e.content)}static toHtml(t){var e=document.createElement("template");return e.content.appendChild(t),e.innerHTML}static isBlank(t){return 0===t.childElementCount&&""===t.textContent.trim()}static from(...t){const e=new DocumentFragment;for(const r of t)e.appendChild(r);return e}static fromChildNodes(t){const e=new DocumentFragment;for(;t.firstChild;)e.appendChild(t.firstChild);return e}}class c{static id=0;static uid(t){return`${t}-${++c.id}`}static defaultValue(t,e,r){return t.hasAttribute(e)||t.setAttribute(e,r),t.getAttribute(e)}static forward(t,e,r){e.getAttributeNames().filter(e=>e.startsWith(t)).forEach(n=>{const s=n.substring(t.length);if("class"===s){const n=e.getAttribute(`${t}class`)?.split(/\s+/).filter(t=>t.length)??[];return void r.classList.add(...n)}r.setAttribute(s,e.getAttribute(n))})}static set(t,e,r){null==r?t.removeAttribute(e):t.setAttribute(e,r)}}class h{static from(t){for(const e of t.children)e.matches('[slot=""]')&&e.removeAttribute("slot");const e=Array.from(t.children).filter(t=>t.matches("[slot]")).map(t=>{t.remove();const e=t.getAttribute("slot");return t.removeAttribute("slot"),[e,h.slotFromNode(t)]}),r=Object.create(null);r.default=new DocumentFragment,r.default.append(...t.childNodes);for(const[t,n]of e)t in r||(r[t]=new DocumentFragment),r[t].append(n);return r}static slotFromNode(t){return t instanceof HTMLTemplateElement?document.adoptNode(t.content):t instanceof HTMLScriptElement&&"text/html"===t.type?u.fromHtml(t.innerHTML):t}}class d{static isParsed(t){for(let e=t;e;e=e.parentNode)if(e.nextSibling)return!0;return!1}static waitDomContentLoaded(t){if("loading"===t.readyState)return new Promise(e=>{t.addEventListener("DOMContentLoaded",()=>e(void 0),{once:!0})});if("complete"===t.readyState)return Promise.resolve();const e=t.defaultView;if(null===e)return Promise.resolve();const[r]=e.performance?.getEntriesByType("navigation")??[];return r?.domContentLoadedEventStart>0?Promise.resolve():new Promise(t=>{const r=()=>{e.removeEventListener("DOMContentLoaded",r),e.removeEventListener("load",r),t(void 0)};e.addEventListener("DOMContentLoaded",r),e.addEventListener("load",r)})}static waitParsed(t){return d.isParsed(t)||"loading"!==t.ownerDocument.readyState?Promise.resolve(t):new Promise(e=>{const r=new MutationObserver(()=>{d.isParsed(t)&&(r.disconnect(),e(t))});for(let e=t.parentNode;e;e=e.parentNode)r.observe(e,{childList:!0});d.waitDomContentLoaded(t.ownerDocument).then(()=>{r.disconnect(),e(t)})})}static queryChildren(t,e){for(const r of t.children)if(r.matches(e))return r;return null}static queryChildrenAll(t,e){const r=[];for(const n of t.children)n.matches(e)&&r.push(n);return r}}class p{#c=new Set;removed(t){return this.#c.has(t)}remove(t){t.replaceChildren?.(),Object.keys(t.dataset||{}).filter(t=>t.startsWith("tpl")).forEach(e=>{delete t.dataset[e]}),this.#c.add(t)}popData(t,e){const r=t.dataset[e];return delete t.dataset[e],r}prepend(t,e){t.parentNode.insertBefore(e,t)}append(t,e){t.parentNode.insertBefore(e,t.nextSibling)}replace(t,e){this.prepend(t,e),this.remove(t)}cleanup(){for(const t of this.#c)t.remove();this.#c.clear()}}class m{static ORDERED_COMMANDS=["tplIf","tplWith","tplEach","tplWhen","tplClassAppend","tplAttrAppend","tplRemove","tplVerbatim"];static tplIf(t,e,r,n){n.evaluateExpression(e)||r.remove(t)}static tplWith(t,e,r,n){const s=n.evaluateExpression(e),o=r.popData(t,"tplVar"),i=new v(t,n).withOverlay(o?{[o]:s}:s).render();r.replace(t,i)}static tplEach(t,e,r,n){const s=r.popData(t,"tplVar"),o=r.popData(t,"tplStat"),i=new v(t,n),l=n.evaluateExpression(e),a=null===l||"object"!=typeof l?void 0:Object.getPrototypeOf(l),u=l?.[Symbol.iterator]||a!==Object.prototype&&null!==a?null:Object.entries(l),c=l instanceof Map?[...l]:u,h=null===c?l:c.map(([t,e])=>({key:t,value:e}));if(!h?.[Symbol.iterator])throw new Error(`Expected an iterable got '${l}'`);const d=o?h:null,p="number"==typeof d?.length?d.length:d?.size,m="number"==typeof p?p:null;let f=0;for(const e of h){const n=s?{[s]:e}:e,l={index:f,count:f+1,size:m,first:0===f,last:null===m?null:f===m-1,even:f%2==0,odd:f%2==1},a=o?[{[o]:l},n]:[n];r.prepend(t,i.withOverlay(...a).render()),++f}r.remove(t)}static tplWhen(t,e,r,n){n.evaluateExpression(e)||r.remove(t)}static tplVerbatim(t,e,r,n){const s=t.cloneNode(!0);r.replace(t,s)}static tplRemove(t,e,r,n){switch(e.toLowerCase()){case"tag":{const e=u.fromChildNodes(t);"tplVerbatim"in t.dataset?(r.popData(t,"tplVerbatim"),r.replace(t,e)):(r.append(t,e),r.remove(t));break}case"body":t.replaceChildren();break;case"all":r.remove(t)}}static tplClassAppend(t,e,r,n){const s=n.evaluateExpression(e);if(!s)return;const o=(Array.isArray(s)?s:[s]).flatMap(t=>"string"==typeof t?t.split(" "):t).filter(Boolean);0!==o.length&&t.classList.add(...o)}static tplAttrAppend(t,e,r,n){const s=n.evaluateExpression(e);s&&0!==s.length&&(Array.isArray(s[0])?s:[s]).forEach(([e,r])=>{null!=r&&t.setAttribute(e,r)})}static textNode(t,r,n,s){for(const o of s.evaluateTemplated(r))if(null!=o.value)switch(o.type){case e.dom.t:n.prepend(t,document.createTextNode(o.value));break;case e.dom.h:n.prepend(t,u.fromHtml("string"==typeof o.value?o.value:String(o.value)));break;case e.dom.n:if(!(o.value instanceof Node))throw new TypeError(`Expected a Node, got '${typeof o.value}'`);n.prepend(t,o.value)}n.remove(t)}}const f=new t(1e3);function g(t){return f.getOrCompute(t,t=>t.substring(3).split(/(?=[A-Z])/).join("-").toLowerCase())}class v{static fromHtml(t,e,...r){return new v(u.fromHtml(t),new a(e,r))}static fromSelector(t,e,...r){const n=document.querySelector(t);if(!(n instanceof HTMLTemplateElement))throw new Error("template selector does not match any template tag");return v.fromTemplate(n,e,...r)}static fromTemplate(t,e,...r){const n=document.adoptNode(t.content);return new v(n,new a(e,r))}static fromFragment(t,e,...r){return new v(t,new a(e,r))}#h;#d;constructor(t,e){this.#h=t,this.#d=e}withEvaluator(t){return new v(this.#h,t)}withFragment(t){return new v(t,this.#d)}withModule(t,e){return new v(this.#h,this.#d.withModule(t,e))}withOverlay(...t){return new v(this.#h,this.#d.withOverlay(...t))}evaluateExpression(t,...e){return this.#d.withOverlay(...e).evaluateExpression(t)}evaluateTemplated(t,...e){return this.#d.withOverlay(...e).evaluateTemplated(t)}evaluator(){return this.#d}render(){try{const t=new p,e=document.importNode(this.#h,!0),r=e.nodeType===Node.DOCUMENT_FRAGMENT_NODE?e:u.from(e),n=document.createNodeIterator(r,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,v.#p);let s;for(;null!==(s=n.nextNode());){if(t.cleanup(),s.nodeType===Node.TEXT_NODE){try{m.textNode(s,s.nodeValue,t,this.#d)}catch(t){throw y.wrap("Error evaluating text node",s,t)}continue}const e=s;for(const r of m.ORDERED_COMMANDS){if(!(r in e.dataset))continue;const n=t.popData(e,r);try{m[r](e,n,t,this.#d)}catch(t){throw y.wrap(`Error evaluating data-tpl-${g(r)}="${n}"`,e,t)}if(t.removed(e))break}for(const r of Object.keys(e.dataset||{})){if(!r.startsWith("tpl"))continue;const n=g(r),s=t.popData(e,r);try{const t=this.#d.evaluateExpression(s);if("boolean"==typeof t){e.toggleAttribute(n,t);continue}null!=t&&e.setAttribute(n,t)}catch(t){throw y.wrap(`Error evaluating data-tpl-${n}="${s}"`,e,t)}}}return t.cleanup(),r}catch(t){if(t instanceof y)throw t;throw new y("Error rendering template",this.#h,t)}}renderTo(t){t.replaceChildren(this.render())}appendTo(t){t.appendChild(this.render())}renderToSelector(t){const e=document.querySelector(t);e&&this.renderTo(e)}appendToSelector(t){const e=document.querySelector(t);e&&this.appendTo(e)}static#p(t){if(t.nodeType===Node.TEXT_NODE)return t.nodeValue.includes("{{")&&t.nodeValue.includes("}}")?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT;for(const e of t.attributes)if(e.name.startsWith("data-tpl-"))return NodeFilter.FILTER_ACCEPT;return NodeFilter.FILTER_SKIP}}class y extends Error{static FRAMES=3;#m;#f;truncated=!1;static wrap(t,e,r){return r instanceof y&&r.depth>=y.FRAMES?(r.truncated=!0,r):new y(t,e,r)}constructor(t,e,r){super(`${t} in \`${y.describe(e)}\``,{cause:r}),this.name="RenderError",this.#m=e,this.#f=(r instanceof y?r.depth:0)+1}get depth(){return this.#f}get node(){return this.#m}get html(){return y.stringify(this.#m)}static describe(t){if(t.nodeType===Node.TEXT_NODE)return y.#g(String(t.nodeValue).trim());if(t.nodeType===Node.ELEMENT_NODE){const e=t,r=Array.from(e.attributes,t=>` ${t.name}="${t.value}"`).join("");return y.#g(`<${e.localName}${r}>`)}const e=Array.from(t.childNodes).filter(t=>t.nodeType===Node.ELEMENT_NODE||String(t.nodeValue??"").trim().length>0).map(t=>y.describe(t));return y.#g(e.join(""))}static#g(t){return t.length>120?`${t.slice(0,120)}…`:t}static stringify(t){return u.toHtml(y.#v(t.cloneNode(!0)))}static#v(t){t.nodeType===Node.TEXT_NODE&&(t.nodeValue=t.nodeValue.trim());for(let e=0;e<t.childNodes.length;e++){const r=t.childNodes[e];r.nodeType===Node.TEXT_NODE?(r.nodeValue=r.nodeValue.trim(),0===r.nodeValue.length&&(t.removeChild(r),e--)):r.nodeType===Node.ELEMENT_NODE&&y.#v(r)}return t}}class b{#y=new Map;#b;#E=new Promise(t=>{this.#b=t});#x=Promise.withResolvers();constructor(){Promise.all([d.waitDomContentLoaded(document),this.#x.promise]).then(()=>{this.#A()})}ready(){return this.#E}configured(){this.#x.resolve()}async#A(){await this.settled(),document.dispatchEvent(new CustomEvent("ftl:ready",{bubbles:!1,cancelable:!1})),this.#b()}enqueue(t){if(this.#y.has(t))return;const{promise:e,resolve:r}=Promise.withResolvers(),n=d.waitParsed(t).then(()=>t.upgrade()).finally(()=>{this.#y.delete(t),r()});this.#y.set(t,{upgrade:n,finished:e})}async#w(t,e){for(;;){const r=Array.from(this.#y).filter(([e])=>t(e)).map(([,t])=>e(t));if(0===r.length)return;await Promise.all(r)}}settled(){return this.#w(()=>!0,t=>t.finished)}upgraded(t){return this.#w(t,t=>t.upgrade)}whenUpgraded(t){return this.#y.get(t)?.upgrade}pending(){return Array.from(this.#y.keys())}}class E{#P={};#x=!1;#T={string:{unmarshal:(t,e,r)=>t,marshal:(t,e,r)=>null==t?null:String(t)},number:{unmarshal:(t,e,r)=>null===t?null:Number(t),marshal:(t,e,r)=>null==t?null:String(t)},presence:{unmarshal:(t,e,r)=>null!==t,marshal:(t,e,r)=>t?"":null},bool:{unmarshal:(t,e,r)=>"true"===t,marshal:(t,e,r)=>null==t?null:String(!0===t)},json:{unmarshal:(t,e,r)=>null===t?null:JSON.parse(t),marshal:(t,e,r)=>null==t?null:JSON.stringify(t)},csv:{unmarshal:(t,e,r)=>null===t?[]:t.split(",").map(t=>t.trim()).filter(t=>t),marshal:(t,e,r)=>null==t?null:t.join(",")}};#S={};#r;#C=[];#d=new a(void 0,[]);#O=new b;defineElement(t,e){return this.#x?(this.#N(t,e),this):(this.#P[t]=e,this)}static declarationsOf(t){const e=[];for(let r=t;null!==r&&r!==HTMLElement;r=Object.getPrototypeOf(r))e.unshift(r);const r=t=>e.flatMap(e=>Object.getOwnPropertyDescriptor(e,t)?.value??[]);return{observed:r("observed"),attributes:r("attributes")}}static propertyOf(t){return t.replace(/-([a-z])/g,(t,e)=>e.toUpperCase())}#N(t,e){const{observed:r,attributes:n}=E.declarationsOf(e),{template:s,templates:o,slots:i,mappers:l,config:a}=e,u=r.map(t=>t.split(":")[0]),c=[...new Set(u.reverse())].reverse(),h=[...n,...r].reduce((t,e)=>{const[r,n]=e.split(":"),s=n??"string";if(!(s in this.#T)&&!(s in(l??{})))throw new Error(`unsupported attribute type: ${s}`);return t[r]=l?.[s]??this.#T[s],t},{}),d=Object.entries(Object.assign({},o,s?{default:s}:{})).map(([t,e])=>[t,v.fromHtml(e)]),p=Object.fromEntries(d);e.BITS={registry:this,enqueue:t=>this.#O.enqueue(t),SLOTS:i,CONFIG:a,OBSERVED:c,DECLARED:[...new Set([...c,...n.map(t=>t.split(":")[0])])],ATTR_TO_MAPPER:h,ATTR_TO_PROPERTY:Object.fromEntries(c.map(t=>[t,E.propertyOf(t)])),TEMPLATES:p},customElements.define(t,e)}defineModule(t,e){const r=t?{[t]:e}:e;return this.#r={...this.#r,...r},this.#D(),this}defineModules(t){return this.#r=t,this.#D(),this}defineComponent(t,e){return this.#S[t]=e,this}defineData(...t){return this.#C=t,this.#D(),this}defineOverlay(...t){return this.#C=[...this.#C,...t],this.#D(),this}defineMapper(t,e){return this.#T[t]=e,this}plugin(t){return t.configure(this),this}configure(){for(const[t,e]of Object.entries(this.#P))this.#N(t,e),delete this.#P[t];return this.#x=!0,this.#O.configured(),this}settle(t){return this.#O.upgraded(t)}whenUpgraded(t){return this.#O.whenUpgraded(t)}pending(){return this.#O.pending()}ready(){return this.#O.ready()}#D(){this.#d=new a(this.#r,this.#C)}evaluator(){return this.#d}component(t){return this.#S[t]}}const x=new E;class A{static fromHtml(t){return v.fromHtml(t).withEvaluator(x.evaluator())}static fromSelector(t){return v.fromSelector(t).withEvaluator(x.evaluator())}static fromTemplate(t){return v.fromTemplate(t).withEvaluator(x.evaluator())}static fromFragment(t){return v.fromFragment(t).withEvaluator(x.evaluator())}}class w{static waitFor(t){return x.settle(e=>t.contains(e))}static waitForChildren(t){return x.settle(e=>t!==e&&t.contains(e))}}class P extends HTMLElement{static BITS={registry:x,enqueue:t=>{},SLOTS:!1,CONFIG:void 0,OBSERVED:[],DECLARED:[],ATTR_TO_MAPPER:{},ATTR_TO_PROPERTY:{},TEMPLATES:{}};static get observedAttributes(){return this.BITS.OBSERVED}constructor(){super(),this.internals=this.attachInternals()}internals;#R=!1;#M=!1;#$=new Set;#_=null;#L={};#F(){return this.constructor.BITS}#j(t){const e=this.#F().ATTR_TO_MAPPER[t];if(!e)throw new Error(`${this.constructor.name} declares no attribute '${t}': declare it in static observed or static attributes, or read it with getAttribute`);return e}unmarshal(t,e){return this.#j(t).unmarshal(e,t,this)}marshal(t,e){return this.#j(t).marshal(e,t,this)}get _registry(){return this.#F().registry}component(t){return this.#F().registry.component(t)}template(t){const e=this.#F().TEMPLATES[t??"default"];if(!e)throw new Error(`no template named '${t??"default"}' on ${this.constructor.name}`);const r=e.withEvaluator(this.#F().registry.evaluator()),n=this.#F().CONFIG;return n?r.withOverlay({config:n}):r}connectedCallback(){this.#M||this.#F().enqueue(this)}attributeChangedCallback(t,e,r){e!==r&&(this.#$.has(t)||(this.#R?this[this.#F().ATTR_TO_PROPERTY[t]]=this.unmarshal(t,r):null!==this.#_&&t in this.#_&&(this.#_[t]=this.unmarshal(t,r))))}async upgrade(){if(this.#M)return;this.#M=!0;const t=this.#F().SLOTS?h.from(this):void 0,e=Object.fromEntries(this.#F().DECLARED.map(t=>[t,this.unmarshal(t,this.getAttribute(t))])),r=new Set(this.#F().OBSERVED);this.#L=Object.fromEntries(Object.entries(e).filter(([t])=>!r.has(t))),this.#_=e;try{await this.render({slots:t});const r=this.#F().ATTR_TO_PROPERTY;for(const t of this.#F().OBSERVED)this[r[t]]=e[t];this.#R=!0,this.internals.states.add("rendered")}finally{this.#_=null}}render(t){}declared(t){return t in this.#L?this.#L[t]:null!==this.#_&&t in this.#_?this.#_[t]:this.unmarshal(t,this.getAttribute(t))}get rendered(){return this.#R}reflectTo(t,e){const r=this.marshal(t,e);if(r!==this.getAttribute(t)){this.#$.add(t);try{c.set(this,t,r)}finally{this.#$.delete(t)}}}}const T=(t,e)=>{const r=t[l.BOUND];return"function"==typeof r?r(e):t[e]},S=/\{(\w+)\}/g,C=/\{(\d+)\}/g,O=t=>"object"==typeof t&&null!==t&&[Object.prototype,null].includes(Object.getPrototypeOf(t)),N=new Set,D=t=>{N.has(t)||(N.add(t),console.warn(`l10n: ${t}`))},R=new t(100),M=(t,e,r)=>{const n=`${t.name}|${e??""}|${void 0===r?"":JSON.stringify(r)}`;return R.getOrCompute(n,()=>new t(e,r))};class ${static t(t,...e){const r=T(this,"l10n")??{};let n=Object.hasOwn(r,t)?r[t]:void 0;if(void 0===n)return D(`missing message "${t}"`),t;const s=1===e.length&&O(e[0])?e[0]:null;if(O(n))if("number"!=typeof s?.count)D(`plural message "${t}" needs a numeric {count}`),n=n.other;else{const t=T(this,"locale")??navigator?.language??"en";n=n[M(Intl.PluralRules,t).select(s.count)]??n.other}return void 0===n||"object"==typeof n?(D(`plural message "${t}" has no "other" form`),t):s?n.replace(S,(e,r)=>Object.hasOwn(s,r)?String(s[r]):(D(`message "${t}" wants {${r}}`),e)):e.length>0?n.replace(C,(r,n)=>{const s=Number(n);return s>=e.length?(D(`message "${t}" wants {${n}}`),r):String(e[s])}):n}static date(t,e){return M(Intl.DateTimeFormat,T(this,"locale"),e).format(t)}static number(t,e){return M(Intl.NumberFormat,T(this,"locale"),e).format(t)}static bytes(t){const e=M(Intl.NumberFormat,T(this,"locale"),{maximumFractionDigits:2}).format;return t>=1073741824?`${e(t/1024/1024/1024)}GiB`:t>=1048576?`${e(t/1024/1024)}MiB`:t>=1024?`${e(t/1024)}KiB`:`${e(t)}B`}static failure(t){return Array.isArray(t?.problems)&&t.problems.length>0?t.problems.map(t=>{return e=t,("string"==typeof e?.reason&&""!==e.reason.trim()?e.reason:void 0)??$.t.call(this,"failure.no-reason");var e}).join("\n"):void 0!==t?.message?String(t.message):null==t?"":String(t)}static of(t={}){const e=t=>x.evaluator().resolve(t),r=r=>(...n)=>r.apply({l10n:e("l10n"),locale:t.locale??e("locale")},n);return{t:r($.t),date:r($.date),number:r($.number),bytes:r($.bytes),failure:r($.failure)}}}export{c as Attributes,t as BoundedCache,a as ExpressionEvaluator,l as Expressions,u as Fragments,h as LightSlots,$ as Localization,d as Nodes,P as ParsedElement,E as Registry,y as RenderError,w as Rendering,v as Template,A as Templates,x as registry};
2
2
  //# sourceMappingURL=ftl.min.mjs.map