mancha 0.14.1 → 0.14.2

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/query.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"query.js","sourceRoot":"","sources":["../src/query.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,MAAM,UAAU,uBAAuB,CAAC,QAAmB;IACzD,MAAM,SAAS,GAAG,IAAI,CAAC;IAEvB;;;OAGG;IACH,MAAM,kBAAkB,GAAG,GAAG,EAAE;QAC9B,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAC1C,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAAU,CAAC;QAE3C,sCAAsC;QACtC,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,GAAG,CAAC,YAAY,CAAC,OAAO,EAAE,EAAE,CAAC;YACtD,MAAM,QAAQ,GAAG,GAAG,SAAS,GAAG,GAAG,EAAE,CAAC;YACtC,gBAAgB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;YAC/B,IAAI,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,KAAK,EAAE,CAAC;gBACrC,QAAQ,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;YAChC,CAAC;QACH,CAAC;QAED,qDAAqD;QACrD,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC;QACpF,KAAK,MAAM,GAAG,IAAI,YAAY,EAAE,CAAC;YAC/B,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC/B,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;Y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CAAC,CAAC;IAEH,yEAAyE;IACzE,MAAM,CAAC,gBAAgB,CAAC,UAAU,EAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAC;AACpE,CAAC"}
package/dist/renderer.js CHANGED
@@ -184,22 +184,22 @@ export class IRenderer extends SignalStore {
184
184
  params = { ...params, rootNode: root };
185
185
  // Attach ourselves to the HTML node.
186
186
  setProperty(root, "renderer", this);
187
+ // Attach the HTML node to the renderer instance.
188
+ // NOTE: Using the store object directly to avoid modifying ancestor values.
189
+ this._store.set("$rootNode", root);
187
190
  // Set ourselves as the root renderer if not already set.
188
191
  if (!this.has("$rootRenderer")) {
189
192
  // NOTE: Using the store object directly to avoid modifying ancestor values.
190
193
  this._store.set("$rootRenderer", this);
191
194
  }
192
- // Attach the HTML node to the renderer instance.
193
- // NOTE: Using the store object directly to avoid modifying ancestor values.
194
- this._store.set("$rootNode", root);
195
+ // Setup query parameter bindings if we are the root renderer.
196
+ if (this.get("$rootRenderer") === this) {
197
+ await setupQueryParamBindings(this);
198
+ }
195
199
  // Preprocess all the elements recursively first.
196
200
  await this.preprocessNode(root, params);
197
201
  // Now that the DOM is complete, render all the nodes.
198
202
  await this.renderNode(root, params);
199
- // Setup query parameter bindings.
200
- if (this.get("$rootRenderer") === this) {
201
- setupQueryParamBindings(this);
202
- }
203
203
  }
204
204
  }
205
205
  //# sourceMappingURL=renderer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"renderer.js","sourceRoot":"","sources":["../src/renderer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AAIrD;;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EAAE,MAAM,CAAC,CAAC;YAC1E,kDAAkD;YAClD,MAAM,eAAe,CAAC,sBAAsB,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;YACtE,kDAAkD;YAClD,MAAM,eAAe,CAAC,qBAAqB,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;QACvE,CAAC;QAED,6DAA6D;QAC7D,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,KAAK,CAAC,IAAwC,EAAE,MAAqB;QACzE,MAAM,GAAG,EAAE,GAAG,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;QAEvC,qCAAqC;QACrC,WAAW,CAAC,IAAe,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;QAE/C,iDAAiD;QACjD,4EAA4E;QAC5E,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;QAEnC,yDAAyD;QACzD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,EAAE,CAAC;YAC/B,4EAA4E;YAC5E,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;QACzC,CAAC;QAED,8DAA8D;QAC9D,IAAI,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,KAAK,IAAI,EAAE,CAAC;YACvC,MAAM,uBAAuB,CAAC,IAAI,CAAC,CAAC;QACtC,CAAC;QAED,iDAAiD;QACjD,MAAM,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAExC,sDAAsD;QACtD,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACtC,CAAC;CACF"}
@@ -1 +1 @@
1
- const e={};function t(e){0}class i{constructor(e,t){this.privateDoNotAccessOrElseWrappedAttributePrefix=t}toString(){return this.privateDoNotAccessOrElseWrappedAttributePrefix}}const s=i;function r(e){if(function(e){return e instanceof i}(e))return e.privateDoNotAccessOrElseWrappedAttributePrefix;throw new Error("")}function n(e){return Object.isFrozen(e)&&Object.isFrozen(e.raw)}function a(e){return-1===e.toString().indexOf("`")}a((e=>e``))||a((e=>e`\0`))||a((e=>e`\n`))||a((e=>e`\u0000`)),n``&&n`\0`&&n`\n`&&n`\u0000`;function o(t){const i=t[0].toLowerCase();return new s(e,i)}let l,c="google#safe";function h(){var e;return""!==c&&null!==(e=function(){if("undefined"!=typeof window)return window.trustedTypes}())&&void 0!==e?e:null}class u{constructor(e,i){t(),this.privateDoNotAccessOrElseWrappedHtml=e}toString(){return this.privateDoNotAccessOrElseWrappedHtml.toString()}}function d(t,i){return null!=i?i:new u(t,e)}"undefined"!=typeof window&&window.TrustedHTML;function p(e){var t;const i=e;return d(i,null===(t=function(){var e,t;if(void 0===l)try{l=null!==(t=null===(e=h())||void 0===e?void 0:e.createPolicy(c,{createHTML:e=>e,createScript:e=>e,createScriptURL:e=>e}))&&void 0!==t?t:null}catch(e){l=null}return l}())||void 0===t?void 0:t.createHTML(i))}function f(e){var t;if(null===(t=h())||void 0===t?void 0:t.isHTML(e))return e;if(e instanceof u)return e.privateDoNotAccessOrElseWrappedHtml;throw new Error("")}"undefined"!=typeof window&&window.TrustedScriptURL;"undefined"!=typeof window&&window.TrustedScript;function _(e,t){t.appendChild(e);let i=(new XMLSerializer).serializeToString(t);return i=i.slice(i.indexOf(">")+1,i.lastIndexOf("</")),p(i)}const m=["data:","http:","https:","mailto:","ftp:"],E=/^\s*(?!javascript:)(?:[\w+.-]+:|[^:/?#]*(?:[/?#]|$))/i;function w(e){if(!function(e){const t=!E.test(e);return t}(e))return e}function v(e){return w(e)}function b(e){const t=function(e){let t;try{t=new URL(e)}catch(e){return"https:"}return t.protocol}(e);return void 0!==t&&-1!==m.indexOf(t.toLowerCase())?e:"about:invalid#zClosurez"}function g(e,t){const i=t.createRange();i.selectNode(t.body);return function(e,t){return e.createContextualFragment(f(t))}(i,p(e))}function A(e){const t=e.nodeName;return"string"==typeof t?t:"FORM"}function y(e){return 3===e.nodeType}function R(e){const t=e.nodeType;return 1===t||"number"!=typeof t}var T,O;function N(e){try{return new URL(e,window.document.baseURI)}catch(e){return new URL("about:invalid")}}function I(e){return{valueOf:e}.valueOf()}!function(e){e[e.STYLE_TAG=0]="STYLE_TAG",e[e.STYLE_ATTRIBUTE=1]="STYLE_ATTRIBUTE",e[e.HTML_ATTRIBUTE=2]="HTML_ATTRIBUTE"}(T||(T={}));class P{constructor(e,t,i,s,r){this.allowedElements=e,this.elementPolicies=t,this.allowedGlobalAttributes=i,this.globalAttributePolicies=s,this.globallyAllowedAttributePrefixes=r}isAllowedElement(e){return"FORM"!==e&&(this.allowedElements.has(e)||this.elementPolicies.has(e))}getAttributePolicy(e,t){const i=this.elementPolicies.get(t);if(null==i?void 0:i.has(e))return i.get(e);if(this.allowedGlobalAttributes.has(e))return{policyAction:O.KEEP};const s=this.globalAttributePolicies.get(e);return s||(this.globallyAllowedAttributePrefixes&&[...this.globallyAllowedAttributePrefixes].some((t=>0===e.indexOf(t)))?{policyAction:O.KEEP}:{policyAction:O.DROP})}}!function(e){e[e.DROP=0]="DROP",e[e.KEEP=1]="KEEP",e[e.KEEP_AND_SANITIZE_URL=2]="KEEP_AND_SANITIZE_URL",e[e.KEEP_AND_NORMALIZE=3]="KEEP_AND_NORMALIZE",e[e.KEEP_AND_SANITIZE_STYLE=4]="KEEP_AND_SANITIZE_STYLE",e[e.KEEP_AND_USE_RESOURCE_URL_POLICY=5]="KEEP_AND_USE_RESOURCE_URL_POLICY",e[e.KEEP_AND_USE_RESOURCE_URL_POLICY_FOR_SRCSET=6]="KEEP_AND_USE_RESOURCE_URL_POLICY_FOR_SRCSET"}(O||(O={}));const S=new Set(["ANNOTATION-XML","COLOR-PROFILE","FONT-FACE","FONT-FACE-SRC","FONT-FACE-URI","FONT-FACE-FORMAT","FONT-FACE-NAME","MISSING-GLYPH"]);const x=["ARTICLE","SECTION","NAV","ASIDE","H1","H2","H3","H4","H5","H6","HEADER","FOOTER","ADDRESS","P","HR","PRE","BLOCKQUOTE","OL","UL","LH","LI","DL","DT","DD","FIGURE","FIGCAPTION","MAIN","DIV","EM","STRONG","SMALL","S","CITE","Q","DFN","ABBR","RUBY","RB","RT","RTC","RP","DATA","TIME","CODE","VAR","SAMP","KBD","SUB","SUP","I","B","U","MARK","BDI","BDO","SPAN","BR","WBR","INS","DEL","PICTURE","PARAM","TRACK","MAP","TABLE","CAPTION","COLGROUP","COL","TBODY","THEAD","TFOOT","TR","TD","TH","SELECT","DATALIST","OPTGROUP","OPTION","OUTPUT","PROGRESS","METER","FIELDSET","LEGEND","DETAILS","SUMMARY","MENU","DIALOG","SLOT","CANVAS","FONT","CENTER","ACRONYM","BASEFONT","BIG","DIR","HGROUP","STRIKE","TT"],C=[["A",new Map([["href",{policyAction:O.KEEP_AND_SANITIZE_URL}]])],["AREA",new Map([["href",{policyAction:O.KEEP_AND_SANITIZE_URL}]])],["LINK",new Map([["href",{policyAction:O.KEEP_AND_USE_RESOURCE_URL_POLICY,conditions:new Map([["rel",new Set(["alternate","author","bookmark","canonical","cite","help","icon","license","next","prefetch","dns-prefetch","prerender","preconnect","preload","prev","search","subresource"])]])}]])],["SOURCE",new Map([["src",{policyAction:O.KEEP_AND_USE_RESOURCE_URL_POLICY}],["srcset",{policyAction:O.KEEP_AND_USE_RESOURCE_URL_POLICY_FOR_SRCSET}]])],["IMG",new Map([["src",{policyAction:O.KEEP_AND_USE_RESOURCE_URL_POLICY}],["srcset",{policyAction:O.KEEP_AND_USE_RESOURCE_URL_POLICY_FOR_SRCSET}]])],["VIDEO",new Map([["src",{policyAction:O.KEEP_AND_USE_RESOURCE_URL_POLICY}]])],["AUDIO",new Map([["src",{policyAction:O.KEEP_AND_USE_RESOURCE_URL_POLICY}]])]],L=["title","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-current","aria-disabled","aria-dropeffect","aria-expanded","aria-haspopup","aria-hidden","aria-invalid","aria-label","aria-level","aria-live","aria-multiline","aria-multiselectable","aria-orientation","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","alt","align","autocapitalize","autocomplete","autocorrect","autofocus","autoplay","bgcolor","border","cellpadding","cellspacing","checked","color","cols","colspan","controls","datetime","disabled","download","draggable","enctype","face","formenctype","frameborder","height","hreflang","hidden","ismap","label","lang","loop","max","maxlength","media","minlength","min","multiple","muted","nonce","open","placeholder","preload","rel","required","reversed","role","rows","rowspan","selected","shape","size","sizes","slot","span","spellcheck","start","step","summary","translate","type","valign","value","width","wrap","itemscope","itemtype","itemid","itemprop","itemref"],k=[["dir",{policyAction:O.KEEP_AND_NORMALIZE,conditions:I((()=>new Map([["dir",new Set(["auto","ltr","rtl"])]])))}],["async",{policyAction:O.KEEP_AND_NORMALIZE,conditions:I((()=>new Map([["async",new Set(["async"])]])))}],["cite",{policyAction:O.KEEP_AND_SANITIZE_URL}],["loading",{policyAction:O.KEEP_AND_NORMALIZE,conditions:I((()=>new Map([["loading",new Set(["eager","lazy"])]])))}],["poster",{policyAction:O.KEEP_AND_SANITIZE_URL}],["target",{policyAction:O.KEEP_AND_NORMALIZE,conditions:I((()=>new Map([["target",new Set(["_self","_blank"])]])))}]],D=new P(new Set(x),new Map(C),new Set(L),new Map(k));new P(new Set(I((()=>x.concat(["STYLE"])))),new Map(C),new Set(I((()=>L.concat(["id","name","class"])))),new Map(I((()=>k.concat([["style",{policyAction:O.KEEP_AND_SANITIZE_STYLE}]])))));class U{constructor(e,i,s,r,n){this.sanitizerTable=e,this.styleElementSanitizer=s,this.styleAttributeSanitizer=r,this.resourceUrlPolicy=n,this.changes=[],t()}sanitizeAssertUnchanged(e){return this.sanitize(e)}sanitize(e){const t=document.implementation.createHTMLDocument("");return _(this.sanitizeToFragmentInternal(e,t),t.body)}sanitizeToFragment(e){const t=document.implementation.createHTMLDocument("");return this.sanitizeToFragmentInternal(e,t)}sanitizeToFragmentInternal(e,t){const i=g(e,t),s=document.createTreeWalker(i,5,(e=>this.nodeFilter(e)));let r=s.nextNode();const n=t.createDocumentFragment();let a=n;for(;null!==r;){let e;if(y(r))if(this.styleElementSanitizer&&"STYLE"===a.nodeName){const t=this.styleElementSanitizer(r.data);e=this.createTextNode(t)}else e=this.sanitizeTextNode(r);else{if(!R(r)){throw new Error("")}e=this.sanitizeElementNode(r,t)}if(a.appendChild(e),r=s.firstChild(),r)a=e;else for(;!(r=s.nextSibling())&&(r=s.parentNode());)a=a.parentNode}return n}createTextNode(e){return document.createTextNode(e)}sanitizeTextNode(e){return this.createTextNode(e.data)}sanitizeElementNode(e,t){const i=A(e),s=t.createElement(i),r=e.attributes;for(const{name:e,value:t}of r){const n=this.sanitizerTable.getAttributePolicy(e,i);if(this.satisfiesAllConditions(n.conditions,r))switch(n.policyAction){case O.KEEP:z(s,e,t);break;case O.KEEP_AND_SANITIZE_URL:const r=b(t);r!==t&&this.recordChange(`Url in attribute ${e} was modified during sanitization. Original url:"${t}" was sanitized to: "${r}"`),z(s,e,r);break;case O.KEEP_AND_NORMALIZE:z(s,e,t.toLowerCase());break;case O.KEEP_AND_SANITIZE_STYLE:if(this.styleAttributeSanitizer){z(s,e,this.styleAttributeSanitizer(t))}else z(s,e,t);break;case O.KEEP_AND_USE_RESOURCE_URL_POLICY:if(this.resourceUrlPolicy){const r={type:T.HTML_ATTRIBUTE,attributeName:e,tagName:i},n=N(t),a=this.resourceUrlPolicy(n,r);a&&z(s,e,a.toString())}else z(s,e,t);break;case O.KEEP_AND_USE_RESOURCE_URL_POLICY_FOR_SRCSET:if(this.resourceUrlPolicy){const r={type:T.HTML_ATTRIBUTE,attributeName:e,tagName:i},n=$(t),a={parts:[]};for(const e of n.parts){const t=N(e.url),i=this.resourceUrlPolicy(t,r);i&&a.parts.push({url:i.toString(),descriptor:e.descriptor})}z(s,e,M(a))}else z(s,e,t);break;case O.DROP:this.recordChange(`Attribute: ${e} was dropped`)}else this.recordChange(`Not all conditions satisfied for attribute: ${e}.`)}return s}nodeFilter(e){if(y(e))return 1;if(!R(e))return 2;const t=A(e);return null===t?(this.recordChange(`Node name was null for node: ${e}`),2):this.sanitizerTable.isAllowedElement(t)?1:(this.recordChange(`Element: ${t} was dropped`),2)}recordChange(e){0}satisfiesAllConditions(e,t){var i;if(!e)return!0;for(const[s,r]of e){const e=null===(i=t.getNamedItem(s))||void 0===i?void 0:i.value;if(e&&!r.has(e))return!1}return!0}}function z(e,t,i){e.setAttribute(t,i)}function $(e){const t=[];for(const i of e.split(",")){const[e,s]=i.trim().split(/\s+/,2);t.push({url:e,descriptor:s})}return{parts:t}}function M(e){return e.parts.map((e=>{const{url:t,descriptor:i}=e;return`${t}${i?` ${i}`:""}`})).join(" , ")}class F{constructor(){this.calledBuild=!1,this.sanitizerTable=D}onlyAllowElements(e){const t=new Set,i=new Map;for(let s of e){if(s=s.toUpperCase(),!this.sanitizerTable.isAllowedElement(s))throw new Error(`Element: ${s}, is not allowed by html5_contract.textpb`);const e=this.sanitizerTable.elementPolicies.get(s);void 0!==e?i.set(s,e):t.add(s)}return this.sanitizerTable=new P(t,i,this.sanitizerTable.allowedGlobalAttributes,this.sanitizerTable.globalAttributePolicies),this}allowCustomElement(e,t){const i=new Set(this.sanitizerTable.allowedElements),s=new Map(this.sanitizerTable.elementPolicies);if(e=e.toUpperCase(),r=e,S.has(r.toUpperCase())||!/^[a-z][-_.a-z0-9]*-[-_.a-z0-9]*$/i.test(r))throw new Error(`Element: ${e} is not a custom element`);var r;if(t){const i=new Map;for(const e of t)i.set(e,{policyAction:O.KEEP});s.set(e,i)}else i.add(e);return this.sanitizerTable=new P(i,s,this.sanitizerTable.allowedGlobalAttributes,this.sanitizerTable.globalAttributePolicies),this}onlyAllowAttributes(e){const t=new Set,i=new Map,s=new Map;for(const s of e)this.sanitizerTable.allowedGlobalAttributes.has(s)&&t.add(s),this.sanitizerTable.globalAttributePolicies.has(s)&&i.set(s,this.sanitizerTable.globalAttributePolicies.get(s));for(const[t,i]of this.sanitizerTable.elementPolicies.entries()){const r=new Map;for(const[t,s]of i.entries())e.has(t)&&r.set(t,s);s.set(t,r)}return this.sanitizerTable=new P(this.sanitizerTable.allowedElements,s,t,i),this}allowDataAttributes(e){const t=new Set(this.sanitizerTable.allowedGlobalAttributes);for(const i of e){if(0!==i.indexOf("data-"))throw new Error(`data attribute: ${i} does not begin with the prefix "data-"`);t.add(i)}return this.sanitizerTable=new P(this.sanitizerTable.allowedElements,this.sanitizerTable.elementPolicies,t,this.sanitizerTable.globalAttributePolicies),this}allowStyleAttributes(){const e=new Map(this.sanitizerTable.globalAttributePolicies);return e.set("style",{policyAction:O.KEEP_AND_SANITIZE_STYLE}),this.sanitizerTable=new P(this.sanitizerTable.allowedElements,this.sanitizerTable.elementPolicies,this.sanitizerTable.allowedGlobalAttributes,e),this}allowClassAttributes(){const e=new Set(this.sanitizerTable.allowedGlobalAttributes);return e.add("class"),this.sanitizerTable=new P(this.sanitizerTable.allowedElements,this.sanitizerTable.elementPolicies,e,this.sanitizerTable.globalAttributePolicies),this}allowIdAttributes(){const e=new Set(this.sanitizerTable.allowedGlobalAttributes);return e.add("id"),this.sanitizerTable=new P(this.sanitizerTable.allowedElements,this.sanitizerTable.elementPolicies,e,this.sanitizerTable.globalAttributePolicies),this}allowIdReferenceAttributes(){const e=new Set(this.sanitizerTable.allowedGlobalAttributes);return e.add("aria-activedescendant").add("aria-controls").add("aria-labelledby").add("aria-owns").add("for").add("list"),this.sanitizerTable=new P(this.sanitizerTable.allowedElements,this.sanitizerTable.elementPolicies,e,this.sanitizerTable.globalAttributePolicies),this}withResourceUrlPolicy(e){return this.resourceUrlPolicy=e,this}build(){if(this.calledBuild)throw new Error("this sanitizer has already called build");return this.calledBuild=!0,new U(this.sanitizerTable,e,void 0,void 0,this.resourceUrlPolicy)}}function G(e,t,i,s){if(0===e.length){throw new Error("")}const n=e.map((e=>r(e))),a=i.toLowerCase();if(n.every((e=>0!==a.indexOf(e))))throw new Error(`Attribute "${i}" does not match any of the allowed prefixes.`);t.setAttribute(i,s)}function K(e,t,i){return e.parseFromString(f(t),i)}Error;const H=[o`:`,o`style`,o`class`];function*W(e,t=new Set){const i=new Set,s=Array.from(e.childNodes).filter((e=>!t.has(e)));for(yield e;s.length;){const e=s.shift();i.has(e)||(i.add(e),yield e),e.childNodes&&Array.from(e.childNodes).filter((e=>!t.has(e))).forEach((e=>s.push(e)))}}function Y(e,t){return void 0!==e?.[t]}function B(e,t){return"function"==typeof e?.[t]}function V(e){return e.replace(/-./g,(e=>e[1].toUpperCase()))}function Z(e,t){return Y(e,"attribs")?e.attribs?.[t]??null:e.getAttribute?.(t)??null}function j(e,t,i=""){return Z(e,i+t)||(e.dataset?.[V(t)]??null)}function q(e,t,i){Y(e,"attribs")?e.attribs[t]=i:e.setAttribute?.(t,i)}function X(e,t,i){Y(e,"attribs")?e.attribs[t]=i:G(H,e,t,i)}function Q(e,t,i){switch(t){case"disabled":return void(e.disabled=i);case"selected":return void(e.selected=i);case"checked":return void(e.checked=i);default:e[t]=i}}function J(e,t){Y(e,"attribs")?delete e.attribs[t]:e.removeAttribute?.(t)}function ee(e,t,i=""){J(e,`${i}${t}`),J(e,`data-${t}`)}function te(e,t,i){if(Y(e,"attribs")&&Y(t,"attribs"))t.attribs[i]=e.attribs[i];else if(i.startsWith("data-")){const s=V(i.slice(5));t.dataset[s]=e.dataset?.[s]}else{const s=e?.getAttribute?.(i);X(t,i,s||"")}}function ie(e){if(Y(e,"firstElementChild"))return e.firstElementChild;return Array.from(e.children).find((e=>1===e.nodeType))}function se(e,...t){if(B(e,"replaceWith"))return e.replaceWith(...t);{const i=e,s=i.parentNode,r=Array.from(s.childNodes).indexOf(i);t.forEach((e=>e.parentNode=s)),s.childNodes=[].concat(Array.from(s.childNodes).slice(0,r)).concat(t).concat(Array.from(s.childNodes).slice(r+1))}}function re(e,...t){B(e,"replaceChildren")?e.replaceChildren(...t):(e.childNodes=t,t.forEach((t=>t.parentNode=e)))}function ne(e,t){return B(t,"appendChild")?e.appendChild(t):(e.childNodes.push(t),t.parentNode=e,t)}function ae(e,t){return B(t,"removeChild")?e.removeChild(t):(re(e,...Array.from(e.childNodes).filter((e=>e!==t))),t)}function oe(e,t,i){return i?B(e,"insertBefore")?e.insertBefore(t,i):(se(i,t,i),t):ne(e,t)}function le(e,t=0){return e?e.length<=t?e:e.slice(0,t-1)+"…":""}function ce(e,t=0){return globalThis.DocumentFragment&&e instanceof DocumentFragment?Array.from(e.childNodes).map((e=>ce(e,t))).join(""):le(e.outerHTML||e.nodeValue||String(e),t)}function he(e){return e.includes("/")?e.split("/").slice(0,-1).join("/"):""}class ue{iterable;constructor(e){this.iterable=e}filter(e){return new ue(ue.filterGenerator(e,this.iterable))}map(e){return new ue(ue.mapGenerator(e,this.iterable))}find(e){for(const t of this.iterable)if(e(t))return t}array(){return Array.from(this.iterable)}*generator(){for(const e of this.iterable)yield e}static*filterGenerator(e,t){for(const i of t)e(i)&&(yield i)}static*mapGenerator(e,t){for(const i of t)yield e(i)}static equals(e,t){const i=e[Symbol.iterator](),s=t[Symbol.iterator]();let r=i.next(),n=s.next();for(;!r.done&&!n.done;){if(r.value!==n.value)return!1;r=i.next(),n=s.next()}return r.done===n.done}}var de;!function(e){e.resolveIncludes=async function(e,t){const i=e,s=i.tagName?.toLowerCase();if(!["include","link"].includes(s))return;if("link"===s&&"subresource"!==Z(i,"rel"))return;this.log("include directive found in:\n",ce(e,128)),this.log("include params:",t);const r="link"===i.tagName.toLocaleLowerCase()?"href":"src",n=Z(i,r);if(!n)throw new Error(`"${r}" attribute missing from ${ce(e,128)}.`);const a=[];"include"===s&&a.push("src"),"link"===s&&a.push("rel","href");const o=t=>{const s=ie(t);for(const e of Array.from(i.attributes))s&&!a.includes(e.name)&&te(i,s,e.name);se(e,...t.childNodes)},l={...t,rootDocument:!1,maxdepth:t?.maxdepth-1};if(0===l.maxdepth)throw new Error("Maximum recursion depth reached.");if(n.includes("://")||n.startsWith("//"))this.log("Including remote file from absolute path:",n),await this.preprocessRemote(n,l).then(o);else if(t?.dirpath?.includes("://")||t?.dirpath?.startsWith("//")){const e=n.startsWith("/")?n:`${t.dirpath}/${n}`;this.log("Including remote file from relative path:",e),await this.preprocessRemote(e,l).then(o)}else if("/"===n.charAt(0))this.log("Including local file from absolute path:",n),await this.preprocessLocal(n,l).then(o);else{const e=t?.dirpath&&"."!==t?.dirpath?`${t?.dirpath}/${n}`:n;this.log("Including local file from relative path:",e),await this.preprocessLocal(e,l).then(o)}},e.rebaseRelativePaths=async function(e,t){const i=e,s=i.tagName?.toLowerCase();if(!t?.dirpath)return;const r=Z(i,"src"),n=Z(i,"href"),a=r||n;if(!a||((o=a).includes("://")||o.startsWith("/")||o.startsWith("#")||o.startsWith("data:")))return;var o;const l=`${t.dirpath}/${a}`;this.log("Rebasing relative path as:",l),Y(i,"attribs")?X(i,r?"src":"href",l):"img"===s?i.src=l:"a"===s?function(e,t){const i=v(t);void 0!==i&&(e.href=i)}(i,l):"source"===s||"audio"===s||"video"===s||"track"===s||"input"===s?i.src=l:"area"===s?function(e,t){const i=v(t);void 0!==i&&(e.href=i)}(i,l):this.log("Unable to rebase relative path for element:",s)},e.registerCustomElements=async function(e,t){const i=e,s=i.tagName?.toLowerCase(),r=(Z(i,"is")||Z(i,"alt"))?.toLowerCase();if(["template","div"].includes(s)&&r){if("div"===s&&"template"!==Z(i,"role"))return;this._customElements.has(r)||(this.log(`Registering custom element: ${r}\n`,ce(i,128)),this._customElements.set(r,i),ae(i.parentNode,i))}},e.resolveCustomElements=async function(e,t){const i=e,s=i.tagName?.toLowerCase();let r=s;if("div"===r&&(r=Z(i,"role")?.toLowerCase()||r),r&&this._customElements.has(r)){this.log(`Processing custom element: ${r}\n`,ce(i,128));const t=this._customElements.get(r),n=(t.content||t).cloneNode(!0),a=ie(n);if(a)for(const e of Array.from(i.attributes))"div"===s&&"role"===e.name||te(i,a,e.name);const o=new ue(W(n)).find((e=>"slot"===e.tagName?.toLowerCase()));o&&se(o,...i.childNodes),se(e,...n.childNodes)}},e.resolveTextNodeExpressions=async function(e,t){const i=e.nodeValue||"";if(3!==e.nodeType||!i?.trim())return;this.log("Processing node content value:\n",le(i,128));const s=new RegExp(/{{ ([^}]+) }}/gm),r=Array.from(i.matchAll(s)).map((e=>e[1]));return this.effect((function(){let t=i;for(const i of r){const s=this.eval(i,{$elem:e});t=t.replace(`{{ ${i} }}`,String(s))}e.nodeValue=t}))},e.resolveDataAttribute=async function(e,t){if(this._skipNodes.has(e))return;const i=e,s=j(i,"data",":");if(s){this.log(":data attribute found in:\n",ce(e,128)),ee(i,"data",":");const r=t?.rootNode===e?this:this.subrenderer();e.renderer=r;const n=r.eval(s,{$elem:e});if(await Promise.all(Object.entries(n).map((([e,t])=>r._store.set(e,t)))),r!==this)for(const t of W(e,this._skipNodes))this._skipNodes.add(t);await r.mount(e,t)}},e.resolveClassAttribute=async function(e,t){if(this._skipNodes.has(e))return;const i=e,s=j(i,"class",":");if(s){this.log(":class attribute found in:\n",ce(e,128)),ee(i,"class",":");const t=Z(i,"class")||"";return this.effect((function(){const r=this.eval(s,{$elem:e});X(i,"class",(r?`${t} ${r}`:t).trim())}))}},e.resolveTextAttributes=async function(e,t){if(this._skipNodes.has(e))return;const i=e,s=j(i,"text",":");if(s){this.log(":text attribute found in:\n",ce(e,128)),ee(i,"text",":");const t=t=>this.textContent(e,t);return this.effect((function(){t(this.eval(s,{$elem:e}))}))}},e.resolveHtmlAttribute=async function(e,t){if(this._skipNodes.has(e))return;const i=e,s=j(i,"html",":");return s?(this.log(":html attribute found in:\n",ce(e,128)),ee(i,"html",":"),this.effect((function(){const r=this.eval(s,{$elem:e});return new Promise((async e=>{const s=await this.preprocessString(r,t);await this.renderNode(s),re(i,s),e()}))}))):void 0},e.resolveEventAttributes=async function(e,t){if(this._skipNodes.has(e))return;const i=e;for(const t of Array.from(i.attributes||[]))if(t.name.startsWith(":on:")||t.name.startsWith("data-on-")){const s=t.name.split(":on:",2).at(-1)?.split("data-on-",2).at(-1)||"";if(!s)throw new Error(`Invalid event attribute: ${t.name}`);this.log(t.name,"attribute found in:\n",ce(e,128)),J(i,t.name);const r="submit"===s&&"FORM"===i.tagName.toUpperCase();e.addEventListener?.(s,(i=>(r&&i.preventDefault(),this.eval(t.value,{$elem:e,$event:i}))))}},e.resolveForAttribute=async function(e,t){if(this._skipNodes.has(e))return;const i=e,s=j(i,"for",":")?.trim();if(s){this.log(":for attribute found in:\n",ce(e,128)),ee(i,"for",":");for(const t of W(e,this._skipNodes))this._skipNodes.add(t);const r=Z(i,"style")||"";q(i,"style","display: none;");const n=e.parentNode,a=this.createElement("template",e.ownerDocument);oe(n,a,e),ae(n,e),ne(a,e),this.log(":for template:\n",ce(a,128));const o=s.split(" in ",2);if(2!==o.length)throw new Error(`Invalid :for format: \`${s}\`. Expected "{key} in {expression}".`);const l=[],[c,h]=o;await this.effect((function(){const i=this.eval(h,{$elem:e});if(this.log(":for list items:",i),l.splice(0,l.length).forEach((e=>{ae(n,e),this._skipNodes.delete(e)})),!Array.isArray(i))return console.error(`Expression did not yield a list: \`${h}\` => \`${i}\``),Promise.resolve();const s=[];for(const n of i){const i=this.subrenderer();i._store.set(c,n);const a=e.cloneNode(!0);q(a,"style",r),l.push(a),this._skipNodes.add(a),s.push(i.mount(a,t)),this.log("Rendered list child:\n",ce(a,128))}const o=a.nextSibling;for(const e of l)oe(n,e,o);return Promise.all(s)}))}},e.resolveBindAttribute=async function(e,t){if(this._skipNodes.has(e))return;const i=e,s=j(i,"bind",":");if(s){this.log(":bind attribute found in:\n",ce(e,128));const t=["change","input"],r=Z(i,":bind:on")?.split(",")||i.dataset?.bindOn?.split(",")||t;ee(i,"bind",":"),J(i,":bind:on"),J(i,"data-bind-on");const n="checkbox"===Z(i,"type")?"checked":"value";s.includes(".")||this.has(s)||this.set(s,""),this.effect((function(){const t=this.eval(s,{$elem:e});"checked"===n?i.checked=!!t:i.value=t}));const a=`${s} = $elem.${n}`;for(const t of r)e.addEventListener(t,(()=>this.eval(a,{$elem:e})))}},e.resolveShowAttribute=async function(e,t){if(this._skipNodes.has(e))return;const i=e,s=j(i,"show",":");if(s){this.log(":show attribute found in:\n",ce(e,128)),ee(i,"show",":");const t="none"===i.style?.display?"":i.style?.display??Z(i,"style")?.split(";")?.find((e=>"display"===e.split(":")[0]))?.split(":")?.at(1)?.trim();this.effect((function(){const r=this.eval(s,{$elem:e});i.style?i.style.display=r?t:"none":X(i,"style",`display: ${r?t:"none"};`)}))}},e.resolveCustomAttribute=async function(e,t){if(this._skipNodes.has(e))return;const i=e;for(const t of Array.from(i.attributes||[])){const s=":attr:",r="data-attr-";if(t.name.startsWith(s)||t.name.startsWith(r)){this.log(t.name,"attribute found in:\n",ce(e,128)),J(i,t.name);const n=t.name.split(s,2).at(-1)?.split(r,2).at(-1);this.effect((function(){const s=this.eval(t.value,{$elem:e});q(i,n,s)}))}}},e.resolveCustomProperty=async function(e,t){if(this._skipNodes.has(e))return;const i=e;for(const t of Array.from(i.attributes||[])){const s=":prop:",r="data-prop-";if(t.name.startsWith(s)||t.name.startsWith(r)){this.log(t.name,"property found in:\n",ce(e,128)),J(i,t.name);const n=t.name.split(s,2).at(-1)?.split(r,2).at(-1),a=V(n);this.effect((function(){const s=this.eval(t.value,{$elem:e});Q(i,a,s)}))}}}}(de||(de={}));const pe=["this"],fe=["+","-","!"],_e=["=","+","-","*","/","%","^","==","!=",">","<",">=","<=","||","&&","??","&","===","!==","|","|>"],me={"!":0,":":0,",":0,")":0,"]":0,"}":0,"|>":1,"?":2,"??":3,"||":4,"&&":5,"|":6,"^":7,"&":8,"!=":9,"==":9,"!==":9,"===":9,">=":10,">":10,"<=":10,"<":10,"+":11,"-":11,"%":12,"/":12,"*":12,"(":13,"[":13,".":13,"{":13},Ee=["==","!=","<=",">=","||","&&","??","|>"],we=["===","!=="];var ve;!function(e){e[e.STRING=1]="STRING",e[e.IDENTIFIER=2]="IDENTIFIER",e[e.DOT=3]="DOT",e[e.COMMA=4]="COMMA",e[e.COLON=5]="COLON",e[e.INTEGER=6]="INTEGER",e[e.DECIMAL=7]="DECIMAL",e[e.OPERATOR=8]="OPERATOR",e[e.GROUPER=9]="GROUPER",e[e.KEYWORD=10]="KEYWORD",e[e.ARROW=11]="ARROW"}(ve||(ve={}));const be=(e,t,i=0)=>({kind:e,value:t,precedence:i}),ge=e=>95===e||36===e||65<=(e&=-33)&&e<=90,Ae=e=>48<=e&&e<=57;class ye{_input;_index=-1;_tokenStart=0;_next;constructor(e){this._input=e,this._advance()}nextToken(){for(;9===(e=this._next)||10===e||13===e||32===e;)this._advance(!0);var e;if((e=>34===e||39===e)(this._next))return this._tokenizeString();if(ge(this._next))return this._tokenizeIdentOrKeyword();if(Ae(this._next))return this._tokenizeNumber();if(46===this._next)return this._tokenizeDot();if(44===this._next)return this._tokenizeComma();if(58===this._next)return this._tokenizeColon();if((e=>43===e||45===e||42===e||47===e||33===e||38===e||37===e||60===e||61===e||62===e||63===e||94===e||124===e)(this._next))return this._tokenizeOperator();if((e=>40===e||41===e||91===e||93===e||123===e||125===e)(this._next))return this._tokenizeGrouper();if(this._advance(),void 0!==this._next)throw new Error(`Expected end of input, got ${this._next}`)}_advance(e){this._index++,this._index<this._input.length?(this._next=this._input.charCodeAt(this._index),!0===e&&(this._tokenStart=this._index)):this._next=void 0}_getValue(e=0){const t=this._input.substring(this._tokenStart,this._index+e);return 0===e&&this._clearValue(),t}_clearValue(){this._tokenStart=this._index}_tokenizeString(){const e="unterminated string",t=this._next;for(this._advance(!0);this._next!==t;){if(void 0===this._next)throw new Error(e);if(92===this._next&&(this._advance(),void 0===this._next))throw new Error(e);this._advance()}const i=be(ve.STRING,this._getValue().replace(/\\(.)/g,((e,t)=>{switch(t){case"n":return"\n";case"r":return"\r";case"t":return"\t";case"b":return"\b";case"f":return"\f";default:return t}})));return this._advance(),i}_tokenizeIdentOrKeyword(){do{this._advance()}while(e=this._next,ge(e)||Ae(e));var e;const t=this._getValue(),i=(s=t,-1!==pe.indexOf(s)?ve.KEYWORD:ve.IDENTIFIER);var s;return be(i,t)}_tokenizeNumber(){do{this._advance()}while(Ae(this._next));return 46===this._next?this._tokenizeDot():be(ve.INTEGER,this._getValue())}_tokenizeDot(){return this._advance(),Ae(this._next)?this._tokenizeFraction():(this._clearValue(),be(ve.DOT,".",13))}_tokenizeComma(){return this._advance(!0),be(ve.COMMA,",")}_tokenizeColon(){return this._advance(!0),be(ve.COLON,":")}_tokenizeFraction(){do{this._advance()}while(Ae(this._next));return be(ve.DECIMAL,this._getValue())}_tokenizeOperator(){this._advance();let e=this._getValue(2);if(-1!==we.indexOf(e))this._advance(),this._advance();else{if(e=this._getValue(1),"=>"===e)return this._advance(),be(ve.ARROW,e);-1!==Ee.indexOf(e)&&this._advance()}return e=this._getValue(),be(ve.OPERATOR,e,me[e])}_tokenizeGrouper(){const e=String.fromCharCode(this._next),t=be(ve.GROUPER,e,me[e]);return this._advance(!0),t}}class Re{_kind;_tokenizer;_ast;_token;_value;constructor(e,t){this._tokenizer=new ye(e),this._ast=t}parse(){return this._advance(),this._parseExpression()}_advance(e,t){if(!this._matches(e,t))throw new Error(`Expected kind ${e} (${t}), was ${this._token?.kind} (${this._token?.value})`);const i=this._tokenizer.nextToken();this._token=i,this._kind=i?.kind,this._value=i?.value}_matches(e,t){return!(e&&this._kind!==e||t&&this._value!==t)}_parseExpression(){if(!this._token)return this._ast.empty();const e=this._parseUnary();return void 0===e?void 0:this._parsePrecedence(e,0)}_parsePrecedence(e,t){if(void 0===e)throw new Error("Expected left to be defined.");for(;this._token;)if(this._matches(ve.GROUPER,"(")){const t=this._parseArguments();e=this._ast.invoke(e,void 0,t)}else if(this._matches(ve.GROUPER,"[")){const t=this._parseIndex();e=this._ast.index(e,t)}else if(this._matches(ve.DOT)){this._advance();const t=this._parseUnary();e=this._makeInvokeOrGetter(e,t)}else{if(this._matches(ve.KEYWORD))break;if(!(this._matches(ve.OPERATOR)&&this._token.precedence>=t))break;e="?"===this._value?this._parseTernary(e):this._parseBinary(e,this._token)}return e}_makeInvokeOrGetter(e,t){if(void 0===t)throw new Error("expected identifier");if("ID"===t.type)return this._ast.getter(e,t.value);if("Invoke"===t.type&&"ID"===t.receiver.type){const i=t.receiver;return this._ast.invoke(e,i.value,t.arguments)}throw new Error(`expected identifier: ${t}`)}_parseBinary(e,t){if(-1===_e.indexOf(t.value))throw new Error(`unknown operator: ${t.value}`);this._advance();let i=this._parseUnary();for(;(this._kind===ve.OPERATOR||this._kind===ve.DOT||this._kind===ve.GROUPER)&&this._token.precedence>t.precedence;)i=this._parsePrecedence(i,this._token.precedence);return this._ast.binary(e,t.value,i)}_parseUnary(){if(this._matches(ve.OPERATOR)){const e=this._value;if(this._advance(),"+"===e||"-"===e){if(this._matches(ve.INTEGER))return this._parseInteger(e);if(this._matches(ve.DECIMAL))return this._parseDecimal(e)}if(-1===fe.indexOf(e))throw new Error(`unexpected token: ${e}`);const t=this._parsePrecedence(this._parsePrimary(),13);return this._ast.unary(e,t)}return this._parsePrimary()}_parseTernary(e){this._advance(ve.OPERATOR,"?");const t=this._parseExpression();this._advance(ve.COLON);const i=this._parseExpression();return this._ast.ternary(e,t,i)}_parsePrimary(){switch(this._kind){case ve.KEYWORD:const e=this._value;if("this"===e)return this._advance(),this._ast.id(e);if(-1!==pe.indexOf(e))throw new Error(`unexpected keyword: ${e}`);throw new Error(`unrecognized keyword: ${e}`);case ve.IDENTIFIER:return this._parseInvokeOrIdentifier();case ve.STRING:return this._parseString();case ve.INTEGER:return this._parseInteger();case ve.DECIMAL:return this._parseDecimal();case ve.GROUPER:return"("===this._value?this._parseParenOrFunction():"{"===this._value?this._parseMap():"["===this._value?this._parseList():void 0;case ve.COLON:throw new Error('unexpected token ":"');default:return}}_parseList(){const e=[];do{if(this._advance(),this._matches(ve.GROUPER,"]"))break;e.push(this._parseExpression())}while(this._matches(ve.COMMA));return this._advance(ve.GROUPER,"]"),this._ast.list(e)}_parseMap(){const e={};do{if(this._advance(),this._matches(ve.GROUPER,"}"))break;const t=this._value;(this._matches(ve.STRING)||this._matches(ve.IDENTIFIER))&&this._advance(),this._advance(ve.COLON),e[t]=this._parseExpression()}while(this._matches(ve.COMMA));return this._advance(ve.GROUPER,"}"),this._ast.map(e)}_parseInvokeOrIdentifier(){const e=this._value;if("true"===e)return this._advance(),this._ast.literal(!0);if("false"===e)return this._advance(),this._ast.literal(!1);if("null"===e)return this._advance(),this._ast.literal(null);if("undefined"===e)return this._advance(),this._ast.literal(void 0);const t=this._parseIdentifier(),i=this._parseArguments();return i?this._ast.invoke(t,void 0,i):t}_parseIdentifier(){if(!this._matches(ve.IDENTIFIER))throw new Error(`expected identifier: ${this._value}`);const e=this._value;return this._advance(),this._ast.id(e)}_parseArguments(){if(!this._matches(ve.GROUPER,"("))return;const e=[];do{if(this._advance(),this._matches(ve.GROUPER,")"))break;const t=this._parseExpression();e.push(t)}while(this._matches(ve.COMMA));return this._advance(ve.GROUPER,")"),e}_parseIndex(){this._advance();const e=this._parseExpression();return this._advance(ve.GROUPER,"]"),e}_parseParenOrFunction(){const e=this._parseArguments();if(this._matches(ve.ARROW)){this._advance();const t=this._parseExpression(),i=e?.map((e=>e.value))??[];return this._ast.arrowFunction(i,t)}return this._ast.paren(e[0])}_parseString(){const e=this._ast.literal(this._value);return this._advance(),e}_parseInteger(e=""){const t=this._ast.literal(parseInt(`${e}${this._value}`,10));return this._advance(),t}_parseDecimal(e=""){const t=this._ast.literal(parseFloat(`${e}${this._value}`));return this._advance(),t}}const Te={"+":(e,t)=>e+t,"-":(e,t)=>e-t,"*":(e,t)=>e*t,"/":(e,t)=>e/t,"%":(e,t)=>e%t,"==":(e,t)=>e==t,"!=":(e,t)=>e!=t,"===":(e,t)=>e===t,"!==":(e,t)=>e!==t,">":(e,t)=>e>t,">=":(e,t)=>e>=t,"<":(e,t)=>e<t,"<=":(e,t)=>e<=t,"||":(e,t)=>e||t,"&&":(e,t)=>e&&t,"??":(e,t)=>e??t,"|":(e,t)=>t(e),"|>":(e,t)=>t(e)},Oe={"+":e=>e,"-":e=>-e,"!":e=>!e};class Ne{timeouts=new Map;debounce(e,t){return new Promise(((i,s)=>{const r=this.timeouts.get(t);r&&clearTimeout(r),this.timeouts.set(t,setTimeout((()=>{try{i(t()),this.timeouts.delete(t)}catch(e){s(e)}}),e))}))}}const Ie=new class{empty(){return{type:"Empty",evaluate:e=>e,getIds:e=>e}}literal(e){return{type:"Literal",value:e,evaluate(e){return this.value},getIds:e=>e}}id(e){return{type:"ID",value:e,evaluate(e){return"this"===this.value?e:e?.[this.value]},getIds(e){return e.push(this.value),e}}}unary(e,t){const i=Oe[e];return{type:"Unary",operator:e,child:t,evaluate(e){return i(this.child.evaluate(e))},getIds(e){return this.child.getIds(e)}}}binary(e,t,i){const s=Te[t];return{type:"Binary",operator:t,left:e,right:i,evaluate(e){if("="===this.operator){if("ID"!==this.left.type&&"Getter"!==this.left.type&&"Index"!==this.left.type)throw new Error(`Invalid assignment target: ${this.left}`);const t=this.right.evaluate(e);let i,s;return"Getter"===this.left.type?(i=this.left.receiver.evaluate(e),s=this.left.name):"Index"===this.left.type?(i=this.left.receiver.evaluate(e),s=this.left.argument.evaluate(e)):"ID"===this.left.type&&(i=e,s=this.left.value),void 0===i?void 0:i[s]=t}return s(this.left.evaluate(e),this.right.evaluate(e))},getIds(e){return this.left.getIds(e),this.right.getIds(e),e}}}getter(e,t){return{type:"Getter",receiver:e,name:t,evaluate(e){return this.receiver.evaluate(e)?.[this.name]},getIds(e){return this.receiver.getIds(e),e}}}invoke(e,t,i){if(null!=t&&"string"!=typeof t)throw new Error("method not a string");return{type:"Invoke",receiver:e,method:t,arguments:i,evaluate(e){const i=this.receiver.evaluate(e),s=this.method?i:e?.this??e,r=this.method?i?.[t]:i,n=(this.arguments??[]).map((t=>t?.evaluate(e)));return r?.apply?.(s,n)},getIds(e){return this.receiver.getIds(e),this.arguments?.forEach((t=>t?.getIds(e))),e}}}paren(e){return e}index(e,t){return{type:"Index",receiver:e,argument:t,evaluate(e){return this.receiver.evaluate(e)?.[this.argument.evaluate(e)]},getIds(e){return this.receiver.getIds(e),e}}}ternary(e,t,i){return{type:"Ternary",condition:e,trueExpr:t,falseExpr:i,evaluate(e){return this.condition.evaluate(e)?this.trueExpr.evaluate(e):this.falseExpr.evaluate(e)},getIds(e){return this.condition.getIds(e),this.trueExpr.getIds(e),this.falseExpr.getIds(e),e}}}map(e){return{type:"Map",entries:e,evaluate(t){const i={};if(e&&this.entries)for(const s in e){const e=this.entries[s];e&&(i[s]=e.evaluate(t))}return i},getIds(t){if(e&&this.entries)for(const i in e){const e=this.entries[i];e&&e.getIds(t)}return t}}}list(e){return{type:"List",items:e,evaluate(e){return this.items?.map((t=>t?.evaluate(e)))},getIds(e){return this.items?.forEach((t=>t?.getIds(e))),e}}}arrowFunction(e,t){return{type:"ArrowFunction",params:e,body:t,evaluate(e){const t=this.params,i=this.body;return function(...s){const r=Object.fromEntries(t.map(((e,t)=>[e,s[t]]))),n=new Proxy(e??{},{set:(e,t,i)=>(r.hasOwnProperty(t)&&(r[t]=i),e[t]=i),get:(e,t)=>r.hasOwnProperty(t)?r[t]:e[t]});return i.evaluate(n)}},getIds(e){return this.body.getIds(e).filter((e=>!this.params.includes(e)))}}}};function Pe(e,t){const i=e?._store;return i?.has(t)?i.get(t):i?.has("$parent")?Pe(i.get("$parent"),t):null}function Se(e,t){const i=e?._store;return i?.has(t)?e:i?.has("$parent")?Se(i.get("$parent"),t):null}class xe extends Ne{evalkeys=["$elem","$event"];expressionCache=new Map;observers=new Map;keyHandlers=new Map;_observer=null;_store=new Map;_lock=Promise.resolve();constructor(e){super();for(let[t,i]of Object.entries(e||{}))this.set(t,i)}wrapFunction(e){return(...t)=>e.call(this.$,...t)}wrapObject(e,t){return null==e||((i=e)instanceof xe||i.__is_proxy__)||e.constructor!==Object&&!Array.isArray(e)?e:new Proxy(e,{deleteProperty:(e,i)=>i in e&&(delete e[i],t(),!0),set:(i,s,r,n)=>{"object"==typeof r&&null!=e&&(r=this.wrapObject(r,t));const a=Reflect.set(i,s,r,n);return t(),a},get:(e,t,i)=>"__is_proxy__"===t||Reflect.get(e,t,i)});var i}watch(e,t){const i=Se(this,e);if(!i)throw new Error(`Cannot watch key "${e}" as it does not exist in the store.`);i.observers.has(e)||i.observers.set(e,new Set),i.observers.get(e)?.has(t)||i.observers.get(e)?.add(t)}addKeyHandler(e,t){this.keyHandlers.has(e)||this.keyHandlers.set(e,new Set),this.keyHandlers.get(e).add(t)}async notify(e,t=10){const i=Se(this,e),s=Array.from(i?.observers.get(e)||[]);await this.debounce(t,(()=>Promise.all(s.map((e=>e.call(this.proxify(e)))))))}get(e,t){return t&&this.watch(e,t),Pe(this,e)}async set(e,t){if(t===this._store.get(e))return;const i=()=>this.notify(e);t&&"function"==typeof t&&(t=this.wrapFunction(t)),t&&"object"==typeof t&&(t=this.wrapObject(t,i)),function(e,t,i){const s=Se(e,t);s?s._store.set(t,i):e._store.set(t,i)}(this,e,t);for(const[i,s]of this.keyHandlers.entries())if(i.test(e))for(const i of s)await Promise.resolve(i.call(this.$,e,t));await i()}async del(e){await this.set(e,null),this._store.delete(e),this.observers.delete(e)}has(e){return this._store.has(e)}effect(e){return e.call(this.proxify(e))}proxify(e){const t=Array.from(this._store.entries()).map((([e])=>e)),i=Object.fromEntries(t.map((e=>[e,null])));return new Proxy(i,{get:(t,i,s)=>"string"==typeof i&&Se(this,i)?this.get(i,e):"$"===i?this.proxify(e):Reflect.get(this,i,s),set:(e,t,i,s)=>("string"!=typeof t||t in this?Reflect.set(this,t,i,s):this.set(t,i),!0)})}get $(){return this.proxify()}makeEvalFunction(e){if(e.includes(";"))throw new Error("Complex expressions are not supported.");let t=null;if(e.includes(" = ")){const[i,s]=e.split(" = ");t=i.trim(),e=s.trim()}return(i,s)=>{const r=((e,t)=>new Re(e,t).parse())(e,Ie),n=r?.getIds([])?.map((e=>[e,s[e]??i[e]??globalThis[e]])),a=r?.evaluate(Object.fromEntries(n||[]));if(!t)return a;!function(e,t,i){const s=t.split(".");for(let t=0;t<s.length-1;t++)s[t]in e||(e[s[t]]={}),e=e[s[t]];e[s[s.length-1]]=i}(i,t,a)}}cachedExpressionFunction(e){return e=e.trim(),this.expressionCache.has(e)||this.expressionCache.set(e,this.makeEvalFunction(e)),this.expressionCache.get(e)}eval(e,t={}){const i=this._observer?this:this.$;if(this._store.has(e))return i[e];{const s=this.cachedExpressionFunction(e);try{return s(i,t)}catch(t){return console.error(`Failed to evaluate expression: ${e}`),console.error(t),null}}}}class Ce extends xe{debugging=!1;dirpath="";_skipNodes=new Set;_customElements=new Map;debug(e){return this.debugging=e,this}async fetchRemote(e,t){return fetch(e,{cache:t?.cache??"default"}).then((e=>e.text()))}async fetchLocal(e,t){return this.fetchRemote(e,t)}async preprocessString(e,t){this.log("Preprocessing string content with params:\n",t);const i=this.parseHTML(e,t);return await this.preprocessNode(i,t),i}async preprocessRemote(e,t){const i={};t?.cache&&(i.cache=t.cache);const s=await fetch(e,i).then((e=>e.text()));return this.preprocessString(s,{...t,dirpath:he(e),rootDocument:t?.rootDocument??!e.endsWith(".tpl.html")})}async preprocessLocal(e,t){const i=await this.fetchLocal(e,t);return this.preprocessString(i,{...t,dirpath:he(e),rootDocument:t?.rootDocument??!e.endsWith(".tpl.html")})}subrenderer(){const e=(new this.constructor).debug(this.debugging);return e._store.set("$parent",this),e._store.set("$rootRenderer",this.get("$rootRenderer")??this),e._customElements=this._customElements,e}log(...e){this.debugging&&console.debug(...e)}async preprocessNode(e,t){t={dirpath:this.dirpath,maxdepth:10,...t};const i=new ue(W(e,this._skipNodes)).map((async e=>{this.log("Preprocessing node:\n",ce(e,128)),await de.resolveIncludes.call(this,e,t),await de.rebaseRelativePaths.call(this,e,t),await de.registerCustomElements.call(this,e,t),await de.resolveCustomElements.call(this,e,t)}));return await Promise.all(i.generator()),e}async renderNode(e,t){for(const i of W(e,this._skipNodes))this.log("Rendering node:\n",ce(i,128)),await de.resolveForAttribute.call(this,i,t),await de.resolveDataAttribute.call(this,i,t),await de.resolveTextAttributes.call(this,i,t),await de.resolveHtmlAttribute.call(this,i,t),await de.resolveShowAttribute.call(this,i,t),await de.resolveClassAttribute.call(this,i,t),await de.resolveBindAttribute.call(this,i,t),await de.resolveEventAttributes.call(this,i,t),await de.resolveTextNodeExpressions.call(this,i,t),await de.resolveCustomAttribute.call(this,i,t),await de.resolveCustomProperty.call(this,i,t);return e}async mount(e,t){t={...t,rootNode:e},Q(e,"renderer",this),this.has("$rootRenderer")||this._store.set("$rootRenderer",this),this._store.set("$rootNode",e),await this.preprocessNode(e,t),await this.renderNode(e,t),this.get("$rootRenderer")===this&&function(e){const t="$$",i=()=>{const i=new URL(window.location.href),s=new Set;for(const[r,n]of i.searchParams.entries()){const i=`${t}${r}`;s.add(i),e.get(i)!==n&&e.set(i,n)}const r=Object.keys(e.$).filter((e=>e.startsWith(t)));for(const t of r)s.has(t)||e.del(t)};i(),e.addKeyHandler(new RegExp("^\\$\\$"),((e,t)=>{const i=new URL(window.location.href),s=e.substring(2);let r=!1;if(t){const e=String(t);i.searchParams.get(s)!==e&&(i.searchParams.set(s,e),r=!0)}else i.searchParams.has(s)&&(i.searchParams.delete(s),r=!0);r&&window.history.replaceState({},"",i.toString())})),window.addEventListener("popstate",i)}(this)}}const Le=[":data",":for",":text",":html",":show",":class",":bind",":on:click",":on:input",":on:change",":on:submit",":attr:src",":attr:href",":attr:title",":prop:checked",":prop:selected",":prop:disabled"];class ke extends Ce{impl="safe_browser";dirpath=he(globalThis.location?.href??"http://localhost/");parseHTML(e,t={rootDocument:!1}){for(const t of Le)e=e.replace(new RegExp(`\\s:${t.slice(1)}=`,"g"),` data-${t.slice(1).replace(":","-")}=`);e=(e=(e=e.replace(/<include(.*) src="([^"]+)"(.*)><\/include>/g,'<link $1 rel="subresource" href="$2" $3>')).replace(/<template is="([^"]+)">([\s\S]*)<\/template>/g,'<div role="template" alt="$1">$2</div>')).replace(/<(\w+)-(\w+)(.*)>([\s\S]*)<\/(\w+)-(\w+)>/g,'<div role="$1-$2" $3>$4</div>');const i=Le.map((e=>`data-${e.slice(1).replace(":","-")}`));i.push("data-testid");const s=(new F).allowDataAttributes(i).allowClassAttributes().allowStyleAttributes().build();if(this.log("parseHTML",e),this.log("sanitized",String(s.sanitize(e))),t.rootDocument){return K(new DOMParser,s.sanitize(e),"text/html")}return s.sanitizeToFragment(e)}serializeHTML(e){return(new XMLSerializer).serializeToString(e).replace(/\s?xmlns="[^"]+"/gm,"")}preprocessLocal(e,t){return this.preprocessRemote(e,t)}createElement(e,t){return(t||document).createElement(e)}textContent(e,t){e.textContent=t}}const De=new ke;export{De as Mancha,ke as Renderer};
1
+ const t={};function e(t){0}class i{constructor(t,e){this.privateDoNotAccessOrElseWrappedAttributePrefix=e}toString(){return this.privateDoNotAccessOrElseWrappedAttributePrefix}}const s=i;function r(t){if(function(t){return t instanceof i}(t))return t.privateDoNotAccessOrElseWrappedAttributePrefix;throw new Error("")}function n(t){return Object.isFrozen(t)&&Object.isFrozen(t.raw)}function a(t){return-1===t.toString().indexOf("`")}a((t=>t``))||a((t=>t`\0`))||a((t=>t`\n`))||a((t=>t`\u0000`)),n``&&n`\0`&&n`\n`&&n`\u0000`;function o(e){const i=e[0].toLowerCase();return new s(t,i)}let l,c="google#safe";function h(){var t;return""!==c&&null!==(t=function(){if("undefined"!=typeof window)return window.trustedTypes}())&&void 0!==t?t:null}class u{constructor(t,i){e(),this.privateDoNotAccessOrElseWrappedHtml=t}toString(){return this.privateDoNotAccessOrElseWrappedHtml.toString()}}function d(e,i){return null!=i?i:new u(e,t)}"undefined"!=typeof window&&window.TrustedHTML;function p(t){var e;const i=t;return d(i,null===(e=function(){var t,e;if(void 0===l)try{l=null!==(e=null===(t=h())||void 0===t?void 0:t.createPolicy(c,{createHTML:t=>t,createScript:t=>t,createScriptURL:t=>t}))&&void 0!==e?e:null}catch(t){l=null}return l}())||void 0===e?void 0:e.createHTML(i))}function f(t){var e;if(null===(e=h())||void 0===e?void 0:e.isHTML(t))return t;if(t instanceof u)return t.privateDoNotAccessOrElseWrappedHtml;throw new Error("")}"undefined"!=typeof window&&window.TrustedScriptURL;"undefined"!=typeof window&&window.TrustedScript;function _(t,e){e.appendChild(t);let i=(new XMLSerializer).serializeToString(e);return i=i.slice(i.indexOf(">")+1,i.lastIndexOf("</")),p(i)}const m=["data:","http:","https:","mailto:","ftp:"],E=/^\s*(?!javascript:)(?:[\w+.-]+:|[^:/?#]*(?:[/?#]|$))/i;function w(t){if(!function(t){const e=!E.test(t);return e}(t))return t}function v(t){return w(t)}function b(t){const e=function(t){let e;try{e=new URL(t)}catch(t){return"https:"}return e.protocol}(t);return void 0!==e&&-1!==m.indexOf(e.toLowerCase())?t:"about:invalid#zClosurez"}function g(t,e){const i=e.createRange();i.selectNode(e.body);return function(t,e){return t.createContextualFragment(f(e))}(i,p(t))}function A(t){const e=t.nodeName;return"string"==typeof e?e:"FORM"}function y(t){return 3===t.nodeType}function R(t){const e=t.nodeType;return 1===e||"number"!=typeof e}var T,O;function N(t){try{return new URL(t,window.document.baseURI)}catch(t){return new URL("about:invalid")}}function I(t){return{valueOf:t}.valueOf()}!function(t){t[t.STYLE_TAG=0]="STYLE_TAG",t[t.STYLE_ATTRIBUTE=1]="STYLE_ATTRIBUTE",t[t.HTML_ATTRIBUTE=2]="HTML_ATTRIBUTE"}(T||(T={}));class P{constructor(t,e,i,s,r){this.allowedElements=t,this.elementPolicies=e,this.allowedGlobalAttributes=i,this.globalAttributePolicies=s,this.globallyAllowedAttributePrefixes=r}isAllowedElement(t){return"FORM"!==t&&(this.allowedElements.has(t)||this.elementPolicies.has(t))}getAttributePolicy(t,e){const i=this.elementPolicies.get(e);if(null==i?void 0:i.has(t))return i.get(t);if(this.allowedGlobalAttributes.has(t))return{policyAction:O.KEEP};const s=this.globalAttributePolicies.get(t);return s||(this.globallyAllowedAttributePrefixes&&[...this.globallyAllowedAttributePrefixes].some((e=>0===t.indexOf(e)))?{policyAction:O.KEEP}:{policyAction:O.DROP})}}!function(t){t[t.DROP=0]="DROP",t[t.KEEP=1]="KEEP",t[t.KEEP_AND_SANITIZE_URL=2]="KEEP_AND_SANITIZE_URL",t[t.KEEP_AND_NORMALIZE=3]="KEEP_AND_NORMALIZE",t[t.KEEP_AND_SANITIZE_STYLE=4]="KEEP_AND_SANITIZE_STYLE",t[t.KEEP_AND_USE_RESOURCE_URL_POLICY=5]="KEEP_AND_USE_RESOURCE_URL_POLICY",t[t.KEEP_AND_USE_RESOURCE_URL_POLICY_FOR_SRCSET=6]="KEEP_AND_USE_RESOURCE_URL_POLICY_FOR_SRCSET"}(O||(O={}));const S=new Set(["ANNOTATION-XML","COLOR-PROFILE","FONT-FACE","FONT-FACE-SRC","FONT-FACE-URI","FONT-FACE-FORMAT","FONT-FACE-NAME","MISSING-GLYPH"]);const x=["ARTICLE","SECTION","NAV","ASIDE","H1","H2","H3","H4","H5","H6","HEADER","FOOTER","ADDRESS","P","HR","PRE","BLOCKQUOTE","OL","UL","LH","LI","DL","DT","DD","FIGURE","FIGCAPTION","MAIN","DIV","EM","STRONG","SMALL","S","CITE","Q","DFN","ABBR","RUBY","RB","RT","RTC","RP","DATA","TIME","CODE","VAR","SAMP","KBD","SUB","SUP","I","B","U","MARK","BDI","BDO","SPAN","BR","WBR","INS","DEL","PICTURE","PARAM","TRACK","MAP","TABLE","CAPTION","COLGROUP","COL","TBODY","THEAD","TFOOT","TR","TD","TH","SELECT","DATALIST","OPTGROUP","OPTION","OUTPUT","PROGRESS","METER","FIELDSET","LEGEND","DETAILS","SUMMARY","MENU","DIALOG","SLOT","CANVAS","FONT","CENTER","ACRONYM","BASEFONT","BIG","DIR","HGROUP","STRIKE","TT"],C=[["A",new Map([["href",{policyAction:O.KEEP_AND_SANITIZE_URL}]])],["AREA",new Map([["href",{policyAction:O.KEEP_AND_SANITIZE_URL}]])],["LINK",new Map([["href",{policyAction:O.KEEP_AND_USE_RESOURCE_URL_POLICY,conditions:new Map([["rel",new Set(["alternate","author","bookmark","canonical","cite","help","icon","license","next","prefetch","dns-prefetch","prerender","preconnect","preload","prev","search","subresource"])]])}]])],["SOURCE",new Map([["src",{policyAction:O.KEEP_AND_USE_RESOURCE_URL_POLICY}],["srcset",{policyAction:O.KEEP_AND_USE_RESOURCE_URL_POLICY_FOR_SRCSET}]])],["IMG",new Map([["src",{policyAction:O.KEEP_AND_USE_RESOURCE_URL_POLICY}],["srcset",{policyAction:O.KEEP_AND_USE_RESOURCE_URL_POLICY_FOR_SRCSET}]])],["VIDEO",new Map([["src",{policyAction:O.KEEP_AND_USE_RESOURCE_URL_POLICY}]])],["AUDIO",new Map([["src",{policyAction:O.KEEP_AND_USE_RESOURCE_URL_POLICY}]])]],L=["title","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-current","aria-disabled","aria-dropeffect","aria-expanded","aria-haspopup","aria-hidden","aria-invalid","aria-label","aria-level","aria-live","aria-multiline","aria-multiselectable","aria-orientation","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","alt","align","autocapitalize","autocomplete","autocorrect","autofocus","autoplay","bgcolor","border","cellpadding","cellspacing","checked","color","cols","colspan","controls","datetime","disabled","download","draggable","enctype","face","formenctype","frameborder","height","hreflang","hidden","ismap","label","lang","loop","max","maxlength","media","minlength","min","multiple","muted","nonce","open","placeholder","preload","rel","required","reversed","role","rows","rowspan","selected","shape","size","sizes","slot","span","spellcheck","start","step","summary","translate","type","valign","value","width","wrap","itemscope","itemtype","itemid","itemprop","itemref"],k=[["dir",{policyAction:O.KEEP_AND_NORMALIZE,conditions:I((()=>new Map([["dir",new Set(["auto","ltr","rtl"])]])))}],["async",{policyAction:O.KEEP_AND_NORMALIZE,conditions:I((()=>new Map([["async",new Set(["async"])]])))}],["cite",{policyAction:O.KEEP_AND_SANITIZE_URL}],["loading",{policyAction:O.KEEP_AND_NORMALIZE,conditions:I((()=>new Map([["loading",new Set(["eager","lazy"])]])))}],["poster",{policyAction:O.KEEP_AND_SANITIZE_URL}],["target",{policyAction:O.KEEP_AND_NORMALIZE,conditions:I((()=>new Map([["target",new Set(["_self","_blank"])]])))}]],D=new P(new Set(x),new Map(C),new Set(L),new Map(k));new P(new Set(I((()=>x.concat(["STYLE"])))),new Map(C),new Set(I((()=>L.concat(["id","name","class"])))),new Map(I((()=>k.concat([["style",{policyAction:O.KEEP_AND_SANITIZE_STYLE}]])))));class U{constructor(t,i,s,r,n){this.sanitizerTable=t,this.styleElementSanitizer=s,this.styleAttributeSanitizer=r,this.resourceUrlPolicy=n,this.changes=[],e()}sanitizeAssertUnchanged(t){return this.sanitize(t)}sanitize(t){const e=document.implementation.createHTMLDocument("");return _(this.sanitizeToFragmentInternal(t,e),e.body)}sanitizeToFragment(t){const e=document.implementation.createHTMLDocument("");return this.sanitizeToFragmentInternal(t,e)}sanitizeToFragmentInternal(t,e){const i=g(t,e),s=document.createTreeWalker(i,5,(t=>this.nodeFilter(t)));let r=s.nextNode();const n=e.createDocumentFragment();let a=n;for(;null!==r;){let t;if(y(r))if(this.styleElementSanitizer&&"STYLE"===a.nodeName){const e=this.styleElementSanitizer(r.data);t=this.createTextNode(e)}else t=this.sanitizeTextNode(r);else{if(!R(r)){throw new Error("")}t=this.sanitizeElementNode(r,e)}if(a.appendChild(t),r=s.firstChild(),r)a=t;else for(;!(r=s.nextSibling())&&(r=s.parentNode());)a=a.parentNode}return n}createTextNode(t){return document.createTextNode(t)}sanitizeTextNode(t){return this.createTextNode(t.data)}sanitizeElementNode(t,e){const i=A(t),s=e.createElement(i),r=t.attributes;for(const{name:t,value:e}of r){const n=this.sanitizerTable.getAttributePolicy(t,i);if(this.satisfiesAllConditions(n.conditions,r))switch(n.policyAction){case O.KEEP:z(s,t,e);break;case O.KEEP_AND_SANITIZE_URL:const r=b(e);r!==e&&this.recordChange(`Url in attribute ${t} was modified during sanitization. Original url:"${e}" was sanitized to: "${r}"`),z(s,t,r);break;case O.KEEP_AND_NORMALIZE:z(s,t,e.toLowerCase());break;case O.KEEP_AND_SANITIZE_STYLE:if(this.styleAttributeSanitizer){z(s,t,this.styleAttributeSanitizer(e))}else z(s,t,e);break;case O.KEEP_AND_USE_RESOURCE_URL_POLICY:if(this.resourceUrlPolicy){const r={type:T.HTML_ATTRIBUTE,attributeName:t,tagName:i},n=N(e),a=this.resourceUrlPolicy(n,r);a&&z(s,t,a.toString())}else z(s,t,e);break;case O.KEEP_AND_USE_RESOURCE_URL_POLICY_FOR_SRCSET:if(this.resourceUrlPolicy){const r={type:T.HTML_ATTRIBUTE,attributeName:t,tagName:i},n=$(e),a={parts:[]};for(const t of n.parts){const e=N(t.url),i=this.resourceUrlPolicy(e,r);i&&a.parts.push({url:i.toString(),descriptor:t.descriptor})}z(s,t,M(a))}else z(s,t,e);break;case O.DROP:this.recordChange(`Attribute: ${t} was dropped`)}else this.recordChange(`Not all conditions satisfied for attribute: ${t}.`)}return s}nodeFilter(t){if(y(t))return 1;if(!R(t))return 2;const e=A(t);return null===e?(this.recordChange(`Node name was null for node: ${t}`),2):this.sanitizerTable.isAllowedElement(e)?1:(this.recordChange(`Element: ${e} was dropped`),2)}recordChange(t){0}satisfiesAllConditions(t,e){var i;if(!t)return!0;for(const[s,r]of t){const t=null===(i=e.getNamedItem(s))||void 0===i?void 0:i.value;if(t&&!r.has(t))return!1}return!0}}function z(t,e,i){t.setAttribute(e,i)}function $(t){const e=[];for(const i of t.split(",")){const[t,s]=i.trim().split(/\s+/,2);e.push({url:t,descriptor:s})}return{parts:e}}function M(t){return t.parts.map((t=>{const{url:e,descriptor:i}=t;return`${e}${i?` ${i}`:""}`})).join(" , ")}class F{constructor(){this.calledBuild=!1,this.sanitizerTable=D}onlyAllowElements(t){const e=new Set,i=new Map;for(let s of t){if(s=s.toUpperCase(),!this.sanitizerTable.isAllowedElement(s))throw new Error(`Element: ${s}, is not allowed by html5_contract.textpb`);const t=this.sanitizerTable.elementPolicies.get(s);void 0!==t?i.set(s,t):e.add(s)}return this.sanitizerTable=new P(e,i,this.sanitizerTable.allowedGlobalAttributes,this.sanitizerTable.globalAttributePolicies),this}allowCustomElement(t,e){const i=new Set(this.sanitizerTable.allowedElements),s=new Map(this.sanitizerTable.elementPolicies);if(t=t.toUpperCase(),r=t,S.has(r.toUpperCase())||!/^[a-z][-_.a-z0-9]*-[-_.a-z0-9]*$/i.test(r))throw new Error(`Element: ${t} is not a custom element`);var r;if(e){const i=new Map;for(const t of e)i.set(t,{policyAction:O.KEEP});s.set(t,i)}else i.add(t);return this.sanitizerTable=new P(i,s,this.sanitizerTable.allowedGlobalAttributes,this.sanitizerTable.globalAttributePolicies),this}onlyAllowAttributes(t){const e=new Set,i=new Map,s=new Map;for(const s of t)this.sanitizerTable.allowedGlobalAttributes.has(s)&&e.add(s),this.sanitizerTable.globalAttributePolicies.has(s)&&i.set(s,this.sanitizerTable.globalAttributePolicies.get(s));for(const[e,i]of this.sanitizerTable.elementPolicies.entries()){const r=new Map;for(const[e,s]of i.entries())t.has(e)&&r.set(e,s);s.set(e,r)}return this.sanitizerTable=new P(this.sanitizerTable.allowedElements,s,e,i),this}allowDataAttributes(t){const e=new Set(this.sanitizerTable.allowedGlobalAttributes);for(const i of t){if(0!==i.indexOf("data-"))throw new Error(`data attribute: ${i} does not begin with the prefix "data-"`);e.add(i)}return this.sanitizerTable=new P(this.sanitizerTable.allowedElements,this.sanitizerTable.elementPolicies,e,this.sanitizerTable.globalAttributePolicies),this}allowStyleAttributes(){const t=new Map(this.sanitizerTable.globalAttributePolicies);return t.set("style",{policyAction:O.KEEP_AND_SANITIZE_STYLE}),this.sanitizerTable=new P(this.sanitizerTable.allowedElements,this.sanitizerTable.elementPolicies,this.sanitizerTable.allowedGlobalAttributes,t),this}allowClassAttributes(){const t=new Set(this.sanitizerTable.allowedGlobalAttributes);return t.add("class"),this.sanitizerTable=new P(this.sanitizerTable.allowedElements,this.sanitizerTable.elementPolicies,t,this.sanitizerTable.globalAttributePolicies),this}allowIdAttributes(){const t=new Set(this.sanitizerTable.allowedGlobalAttributes);return t.add("id"),this.sanitizerTable=new P(this.sanitizerTable.allowedElements,this.sanitizerTable.elementPolicies,t,this.sanitizerTable.globalAttributePolicies),this}allowIdReferenceAttributes(){const t=new Set(this.sanitizerTable.allowedGlobalAttributes);return t.add("aria-activedescendant").add("aria-controls").add("aria-labelledby").add("aria-owns").add("for").add("list"),this.sanitizerTable=new P(this.sanitizerTable.allowedElements,this.sanitizerTable.elementPolicies,t,this.sanitizerTable.globalAttributePolicies),this}withResourceUrlPolicy(t){return this.resourceUrlPolicy=t,this}build(){if(this.calledBuild)throw new Error("this sanitizer has already called build");return this.calledBuild=!0,new U(this.sanitizerTable,t,void 0,void 0,this.resourceUrlPolicy)}}function G(t,e,i,s){if(0===t.length){throw new Error("")}const n=t.map((t=>r(t))),a=i.toLowerCase();if(n.every((t=>0!==a.indexOf(t))))throw new Error(`Attribute "${i}" does not match any of the allowed prefixes.`);e.setAttribute(i,s)}function K(t,e,i){return t.parseFromString(f(e),i)}Error;const H=[o`:`,o`style`,o`class`];function*W(t,e=new Set){const i=new Set,s=Array.from(t.childNodes).filter((t=>!e.has(t)));for(yield t;s.length;){const t=s.shift();i.has(t)||(i.add(t),yield t),t.childNodes&&Array.from(t.childNodes).filter((t=>!e.has(t))).forEach((t=>s.push(t)))}}function Y(t,e){return void 0!==t?.[e]}function B(t,e){return"function"==typeof t?.[e]}function V(t){return t.replace(/-./g,(t=>t[1].toUpperCase()))}function Z(t,e){return Y(t,"attribs")?t.attribs?.[e]??null:t.getAttribute?.(e)??null}function j(t,e,i=""){return Z(t,i+e)||(t.dataset?.[V(e)]??null)}function q(t,e,i=""){return function(t,e){return Y(t,"attribs")?e in(t.attribs||{}):t.hasAttribute?.(e)??!1}(t,i+e)||Y(t.dataset,V(e))}function X(t,e,i){Y(t,"attribs")?t.attribs[e]=i:t.setAttribute?.(e,i)}function Q(t,e,i){Y(t,"attribs")?t.attribs[e]=i:G(H,t,e,i)}function J(t,e,i){switch(e){case"disabled":return void(t.disabled=i);case"selected":return void(t.selected=i);case"checked":return void(t.checked=i);default:t[e]=i}}function tt(t,e){Y(t,"attribs")?delete t.attribs[e]:t.removeAttribute?.(e)}function et(t,e,i=""){tt(t,`${i}${e}`),tt(t,`data-${e}`)}function it(t,e,i){if(Y(t,"attribs")&&Y(e,"attribs"))e.attribs[i]=t.attribs[i];else if(i.startsWith("data-")){const s=V(i.slice(5));e.dataset[s]=t.dataset?.[s]}else{const s=t?.getAttribute?.(i);Q(e,i,s||"")}}function st(t){if(Y(t,"firstElementChild"))return t.firstElementChild;return Array.from(t.children).find((t=>1===t.nodeType))}function rt(t,...e){if(B(t,"replaceWith"))return t.replaceWith(...e);{const i=t,s=i.parentNode,r=Array.from(s.childNodes).indexOf(i);e.forEach((t=>t.parentNode=s)),s.childNodes=[].concat(Array.from(s.childNodes).slice(0,r)).concat(e).concat(Array.from(s.childNodes).slice(r+1))}}function nt(t,...e){B(t,"replaceChildren")?t.replaceChildren(...e):(t.childNodes=e,e.forEach((e=>e.parentNode=t)))}function at(t,e){return B(e,"appendChild")?t.appendChild(e):(t.childNodes.push(e),e.parentNode=t,e)}function ot(t,e){return B(e,"removeChild")?t.removeChild(e):(nt(t,...Array.from(t.childNodes).filter((t=>t!==e))),e)}function lt(t,e,i){return i?B(t,"insertBefore")?t.insertBefore(e,i):(rt(i,e,i),e):at(t,e)}function ct(t,e=0){return t?t.length<=e?t:t.slice(0,e-1)+"…":""}function ht(t,e=0){return globalThis.DocumentFragment&&t instanceof DocumentFragment?Array.from(t.childNodes).map((t=>ht(t,e))).join(""):ct(t.outerHTML||t.nodeValue||String(t),e)}function ut(t){return t.includes("/")?t.split("/").slice(0,-1).join("/"):""}class dt{iterable;constructor(t){this.iterable=t}filter(t){return new dt(dt.filterGenerator(t,this.iterable))}map(t){return new dt(dt.mapGenerator(t,this.iterable))}find(t){for(const e of this.iterable)if(t(e))return e}array(){return Array.from(this.iterable)}*generator(){for(const t of this.iterable)yield t}static*filterGenerator(t,e){for(const i of e)t(i)&&(yield i)}static*mapGenerator(t,e){for(const i of e)yield t(i)}static equals(t,e){const i=t[Symbol.iterator](),s=e[Symbol.iterator]();let r=i.next(),n=s.next();for(;!r.done&&!n.done;){if(r.value!==n.value)return!1;r=i.next(),n=s.next()}return r.done===n.done}}var pt;!function(t){t.resolveIncludes=async function(t,e){const i=t,s=i.tagName?.toLowerCase();if(!["include","link"].includes(s))return;if("link"===s&&"subresource"!==Z(i,"rel"))return;this.log("include directive found in:\n",ht(t,128)),this.log("include params:",e);const r="link"===i.tagName.toLocaleLowerCase()?"href":"src",n=Z(i,r);if(!n)throw new Error(`"${r}" attribute missing from ${ht(t,128)}.`);const a=[];"include"===s&&a.push("src"),"link"===s&&a.push("rel","href");const o=e=>{const s=st(e);for(const t of Array.from(i.attributes))s&&!a.includes(t.name)&&it(i,s,t.name);rt(t,...e.childNodes)},l={...e,rootDocument:!1,maxdepth:e?.maxdepth-1};if(0===l.maxdepth)throw new Error("Maximum recursion depth reached.");if(n.includes("://")||n.startsWith("//"))this.log("Including remote file from absolute path:",n),await this.preprocessRemote(n,l).then(o);else if(e?.dirpath?.includes("://")||e?.dirpath?.startsWith("//")){const t=n.startsWith("/")?n:`${e.dirpath}/${n}`;this.log("Including remote file from relative path:",t),await this.preprocessRemote(t,l).then(o)}else if("/"===n.charAt(0))this.log("Including local file from absolute path:",n),await this.preprocessLocal(n,l).then(o);else{const t=e?.dirpath&&"."!==e?.dirpath?`${e?.dirpath}/${n}`:n;this.log("Including local file from relative path:",t),await this.preprocessLocal(t,l).then(o)}},t.rebaseRelativePaths=async function(t,e){const i=t,s=i.tagName?.toLowerCase();if(!e?.dirpath)return;const r=Z(i,"src"),n=Z(i,"href"),a=r||n;if(!a||((o=a).includes("://")||o.startsWith("/")||o.startsWith("#")||o.startsWith("data:")))return;var o;const l=`${e.dirpath}/${a}`;this.log("Rebasing relative path as:",l),Y(i,"attribs")?Q(i,r?"src":"href",l):"img"===s?i.src=l:"a"===s?function(t,e){const i=v(e);void 0!==i&&(t.href=i)}(i,l):"source"===s||"audio"===s||"video"===s||"track"===s||"input"===s?i.src=l:"area"===s?function(t,e){const i=v(e);void 0!==i&&(t.href=i)}(i,l):this.log("Unable to rebase relative path for element:",s)},t.registerCustomElements=async function(t,e){const i=t,s=i.tagName?.toLowerCase(),r=(Z(i,"is")||Z(i,"alt"))?.toLowerCase();if(["template","div"].includes(s)&&r){if("div"===s&&"template"!==Z(i,"role"))return;this._customElements.has(r)||(this.log(`Registering custom element: ${r}\n`,ht(i,128)),this._customElements.set(r,i),ot(i.parentNode,i))}},t.resolveCustomElements=async function(t,e){const i=t,s=i.tagName?.toLowerCase();let r=s;if("div"===r&&(r=Z(i,"role")?.toLowerCase()||r),r&&this._customElements.has(r)){this.log(`Processing custom element: ${r}\n`,ht(i,128));const e=this._customElements.get(r),n=(e.content||e).cloneNode(!0),a=st(n);if(a)for(const t of Array.from(i.attributes))"div"===s&&"role"===t.name||it(i,a,t.name);const o=new dt(W(n)).find((t=>"slot"===t.tagName?.toLowerCase()));o&&rt(o,...i.childNodes),rt(t,...n.childNodes)}},t.resolveTextNodeExpressions=async function(t,e){const i=t.nodeValue||"";if(3!==t.nodeType||!i?.trim())return;this.log("Processing node content value:\n",ct(i,128));const s=new RegExp(/{{ ([^}]+) }}/gm),r=Array.from(i.matchAll(s)).map((t=>t[1]));return this.effect((function(){let e=i;for(const i of r){const s=this.eval(i,{$elem:t});e=e.replace(`{{ ${i} }}`,String(s))}t.nodeValue=e}))},t.resolveDataAttribute=async function(t,e){if(this._skipNodes.has(t))return;const i=t,s=j(i,"data",":");if(s){this.log(":data attribute found in:\n",ht(t,128)),et(i,"data",":");const r=e?.rootNode===t?this:this.subrenderer();t.renderer=r;const n=r.eval(s,{$elem:t});if(await Promise.all(Object.entries(n).map((([t,e])=>r._store.set(t,e)))),r!==this)for(const e of W(t,this._skipNodes))this._skipNodes.add(e);await r.mount(t,e)}},t.resolveClassAttribute=async function(t,e){if(this._skipNodes.has(t))return;const i=t,s=j(i,"class",":");if(s){this.log(":class attribute found in:\n",ht(t,128)),et(i,"class",":");const e=Z(i,"class")||"";return this.effect((function(){const r=this.eval(s,{$elem:t});Q(i,"class",(r?`${e} ${r}`:e).trim())}))}},t.resolveTextAttributes=async function(t,e){if(this._skipNodes.has(t))return;const i=t,s=j(i,"text",":");if(s){this.log(":text attribute found in:\n",ht(t,128)),et(i,"text",":");const e=e=>this.textContent(t,e);return this.effect((function(){e(this.eval(s,{$elem:t}))}))}},t.resolveHtmlAttribute=async function(t,e){if(this._skipNodes.has(t))return;const i=t,s=j(i,"html",":");return s?(this.log(":html attribute found in:\n",ht(t,128)),et(i,"html",":"),this.effect((function(){const r=this.eval(s,{$elem:t});return new Promise((async t=>{const s=await this.preprocessString(r,e);await this.renderNode(s),nt(i,s),t()}))}))):void 0},t.resolveEventAttributes=async function(t,e){if(this._skipNodes.has(t))return;const i=t;for(const e of Array.from(i.attributes||[]))if(e.name.startsWith(":on:")||e.name.startsWith("data-on-")){const s=e.name.split(":on:",2).at(-1)?.split("data-on-",2).at(-1)||"";if(!s)throw new Error(`Invalid event attribute: ${e.name}`);this.log(e.name,"attribute found in:\n",ht(t,128));const r=q(i,"prevent",":");et(i,e.name),et(i,"prevent",":");const n="submit"===s&&"FORM"===i.tagName.toUpperCase();t.addEventListener?.(s,(i=>((r||n)&&i.preventDefault(),this.eval(e.value,{$elem:t,$event:i}))))}},t.resolveForAttribute=async function(t,e){if(this._skipNodes.has(t))return;const i=t,s=j(i,"for",":")?.trim();if(s){this.log(":for attribute found in:\n",ht(t,128)),et(i,"for",":");for(const e of W(t,this._skipNodes))this._skipNodes.add(e);const r=Z(i,"style")||"";X(i,"style","display: none;");const n=t.parentNode,a=this.createElement("template",t.ownerDocument);lt(n,a,t),ot(n,t),at(a,t),this.log(":for template:\n",ht(a,128));const o=s.split(" in ",2);if(2!==o.length)throw new Error(`Invalid :for format: \`${s}\`. Expected "{key} in {expression}".`);const l=[],[c,h]=o;await this.effect((function(){const i=this.eval(h,{$elem:t});if(this.log(":for list items:",i),l.splice(0,l.length).forEach((t=>{ot(n,t),this._skipNodes.delete(t)})),!Array.isArray(i))return console.error(`Expression did not yield a list: \`${h}\` => \`${i}\``),Promise.resolve();const s=[];for(const n of i){const i=this.subrenderer();i._store.set(c,n);const a=t.cloneNode(!0);X(a,"style",r),l.push(a),this._skipNodes.add(a),s.push(i.mount(a,e)),this.log("Rendered list child:\n",ht(a,128))}const o=a.nextSibling;for(const t of l)lt(n,t,o);return Promise.all(s)}))}},t.resolveBindAttribute=async function(t,e){if(this._skipNodes.has(t))return;const i=t,s=j(i,"bind",":");if(s){this.log(":bind attribute found in:\n",ht(t,128));const e=["change","input"],r=Z(i,":bind:on")?.split(",")||i.dataset?.bindOn?.split(",")||e;et(i,"bind",":"),tt(i,":bind:on"),tt(i,"data-bind-on");const n="checkbox"===Z(i,"type")?"checked":"value";s.includes(".")||this.has(s)||this.set(s,""),this.effect((function(){const e=this.eval(s,{$elem:t});"checked"===n?i.checked=!!e:i.value=e}));const a=`${s} = $elem.${n}`;for(const e of r)t.addEventListener(e,(()=>this.eval(a,{$elem:t})))}},t.resolveShowAttribute=async function(t,e){if(this._skipNodes.has(t))return;const i=t,s=j(i,"show",":");if(s){this.log(":show attribute found in:\n",ht(t,128)),et(i,"show",":");const e="none"===i.style?.display?"":i.style?.display??Z(i,"style")?.split(";")?.find((t=>"display"===t.split(":")[0]))?.split(":")?.at(1)?.trim();this.effect((function(){const r=this.eval(s,{$elem:t});i.style?i.style.display=r?e:"none":Q(i,"style",`display: ${r?e:"none"};`)}))}},t.resolveCustomAttribute=async function(t,e){if(this._skipNodes.has(t))return;const i=t;for(const e of Array.from(i.attributes||[])){const s=":attr:",r="data-attr-";if(e.name.startsWith(s)||e.name.startsWith(r)){this.log(e.name,"attribute found in:\n",ht(t,128)),tt(i,e.name);const n=e.name.split(s,2).at(-1)?.split(r,2).at(-1);this.effect((function(){const s=this.eval(e.value,{$elem:t});X(i,n,s)}))}}},t.resolveCustomProperty=async function(t,e){if(this._skipNodes.has(t))return;const i=t;for(const e of Array.from(i.attributes||[])){const s=":prop:",r="data-prop-";if(e.name.startsWith(s)||e.name.startsWith(r)){this.log(e.name,"property found in:\n",ht(t,128)),tt(i,e.name);const n=e.name.split(s,2).at(-1)?.split(r,2).at(-1),a=V(n);this.effect((function(){const s=this.eval(e.value,{$elem:t});J(i,a,s)}))}}}}(pt||(pt={}));const ft=["this"],_t=["+","-","!"],mt=["=","+","-","*","/","%","^","==","!=",">","<",">=","<=","||","&&","??","&","===","!==","|","|>"],Et={"!":0,":":0,",":0,")":0,"]":0,"}":0,"|>":1,"?":2,"??":3,"||":4,"&&":5,"|":6,"^":7,"&":8,"!=":9,"==":9,"!==":9,"===":9,">=":10,">":10,"<=":10,"<":10,"+":11,"-":11,"%":12,"/":12,"*":12,"(":13,"[":13,".":13,"{":13},wt=["==","!=","<=",">=","||","&&","??","|>"],vt=["===","!=="];var bt;!function(t){t[t.STRING=1]="STRING",t[t.IDENTIFIER=2]="IDENTIFIER",t[t.DOT=3]="DOT",t[t.COMMA=4]="COMMA",t[t.COLON=5]="COLON",t[t.INTEGER=6]="INTEGER",t[t.DECIMAL=7]="DECIMAL",t[t.OPERATOR=8]="OPERATOR",t[t.GROUPER=9]="GROUPER",t[t.KEYWORD=10]="KEYWORD",t[t.ARROW=11]="ARROW"}(bt||(bt={}));const gt=(t,e,i=0)=>({kind:t,value:e,precedence:i}),At=t=>95===t||36===t||65<=(t&=-33)&&t<=90,yt=t=>48<=t&&t<=57;class Rt{_input;_index=-1;_tokenStart=0;_next;constructor(t){this._input=t,this._advance()}nextToken(){for(;9===(t=this._next)||10===t||13===t||32===t;)this._advance(!0);var t;if((t=>34===t||39===t)(this._next))return this._tokenizeString();if(At(this._next))return this._tokenizeIdentOrKeyword();if(yt(this._next))return this._tokenizeNumber();if(46===this._next)return this._tokenizeDot();if(44===this._next)return this._tokenizeComma();if(58===this._next)return this._tokenizeColon();if((t=>43===t||45===t||42===t||47===t||33===t||38===t||37===t||60===t||61===t||62===t||63===t||94===t||124===t)(this._next))return this._tokenizeOperator();if((t=>40===t||41===t||91===t||93===t||123===t||125===t)(this._next))return this._tokenizeGrouper();if(this._advance(),void 0!==this._next)throw new Error(`Expected end of input, got ${this._next}`)}_advance(t){this._index++,this._index<this._input.length?(this._next=this._input.charCodeAt(this._index),!0===t&&(this._tokenStart=this._index)):this._next=void 0}_getValue(t=0){const e=this._input.substring(this._tokenStart,this._index+t);return 0===t&&this._clearValue(),e}_clearValue(){this._tokenStart=this._index}_tokenizeString(){const t="unterminated string",e=this._next;for(this._advance(!0);this._next!==e;){if(void 0===this._next)throw new Error(t);if(92===this._next&&(this._advance(),void 0===this._next))throw new Error(t);this._advance()}const i=gt(bt.STRING,this._getValue().replace(/\\(.)/g,((t,e)=>{switch(e){case"n":return"\n";case"r":return"\r";case"t":return"\t";case"b":return"\b";case"f":return"\f";default:return e}})));return this._advance(),i}_tokenizeIdentOrKeyword(){do{this._advance()}while(t=this._next,At(t)||yt(t));var t;const e=this._getValue(),i=(s=e,-1!==ft.indexOf(s)?bt.KEYWORD:bt.IDENTIFIER);var s;return gt(i,e)}_tokenizeNumber(){do{this._advance()}while(yt(this._next));return 46===this._next?this._tokenizeDot():gt(bt.INTEGER,this._getValue())}_tokenizeDot(){return this._advance(),yt(this._next)?this._tokenizeFraction():(this._clearValue(),gt(bt.DOT,".",13))}_tokenizeComma(){return this._advance(!0),gt(bt.COMMA,",")}_tokenizeColon(){return this._advance(!0),gt(bt.COLON,":")}_tokenizeFraction(){do{this._advance()}while(yt(this._next));return gt(bt.DECIMAL,this._getValue())}_tokenizeOperator(){this._advance();let t=this._getValue(2);if(-1!==vt.indexOf(t))this._advance(),this._advance();else{if(t=this._getValue(1),"=>"===t)return this._advance(),gt(bt.ARROW,t);-1!==wt.indexOf(t)&&this._advance()}return t=this._getValue(),gt(bt.OPERATOR,t,Et[t])}_tokenizeGrouper(){const t=String.fromCharCode(this._next),e=gt(bt.GROUPER,t,Et[t]);return this._advance(!0),e}}class Tt{_kind;_tokenizer;_ast;_token;_value;constructor(t,e){this._tokenizer=new Rt(t),this._ast=e}parse(){return this._advance(),this._parseExpression()}_advance(t,e){if(!this._matches(t,e))throw new Error(`Expected kind ${t} (${e}), was ${this._token?.kind} (${this._token?.value})`);const i=this._tokenizer.nextToken();this._token=i,this._kind=i?.kind,this._value=i?.value}_matches(t,e){return!(t&&this._kind!==t||e&&this._value!==e)}_parseExpression(){if(!this._token)return this._ast.empty();const t=this._parseUnary();return void 0===t?void 0:this._parsePrecedence(t,0)}_parsePrecedence(t,e){if(void 0===t)throw new Error("Expected left to be defined.");for(;this._token;)if(this._matches(bt.GROUPER,"(")){const e=this._parseArguments();t=this._ast.invoke(t,void 0,e)}else if(this._matches(bt.GROUPER,"[")){const e=this._parseIndex();t=this._ast.index(t,e)}else if(this._matches(bt.DOT)){this._advance();const e=this._parseUnary();t=this._makeInvokeOrGetter(t,e)}else{if(this._matches(bt.KEYWORD))break;if(!(this._matches(bt.OPERATOR)&&this._token.precedence>=e))break;t="?"===this._value?this._parseTernary(t):this._parseBinary(t,this._token)}return t}_makeInvokeOrGetter(t,e){if(void 0===e)throw new Error("expected identifier");if("ID"===e.type)return this._ast.getter(t,e.value);if("Invoke"===e.type&&"ID"===e.receiver.type){const i=e.receiver;return this._ast.invoke(t,i.value,e.arguments)}throw new Error(`expected identifier: ${e}`)}_parseBinary(t,e){if(-1===mt.indexOf(e.value))throw new Error(`unknown operator: ${e.value}`);this._advance();let i=this._parseUnary();for(;(this._kind===bt.OPERATOR||this._kind===bt.DOT||this._kind===bt.GROUPER)&&this._token.precedence>e.precedence;)i=this._parsePrecedence(i,this._token.precedence);return this._ast.binary(t,e.value,i)}_parseUnary(){if(this._matches(bt.OPERATOR)){const t=this._value;if(this._advance(),"+"===t||"-"===t){if(this._matches(bt.INTEGER))return this._parseInteger(t);if(this._matches(bt.DECIMAL))return this._parseDecimal(t)}if(-1===_t.indexOf(t))throw new Error(`unexpected token: ${t}`);const e=this._parsePrecedence(this._parsePrimary(),13);return this._ast.unary(t,e)}return this._parsePrimary()}_parseTernary(t){this._advance(bt.OPERATOR,"?");const e=this._parseExpression();this._advance(bt.COLON);const i=this._parseExpression();return this._ast.ternary(t,e,i)}_parsePrimary(){switch(this._kind){case bt.KEYWORD:const t=this._value;if("this"===t)return this._advance(),this._ast.id(t);if(-1!==ft.indexOf(t))throw new Error(`unexpected keyword: ${t}`);throw new Error(`unrecognized keyword: ${t}`);case bt.IDENTIFIER:return this._parseInvokeOrIdentifier();case bt.STRING:return this._parseString();case bt.INTEGER:return this._parseInteger();case bt.DECIMAL:return this._parseDecimal();case bt.GROUPER:return"("===this._value?this._parseParenOrFunction():"{"===this._value?this._parseMap():"["===this._value?this._parseList():void 0;case bt.COLON:throw new Error('unexpected token ":"');default:return}}_parseList(){const t=[];do{if(this._advance(),this._matches(bt.GROUPER,"]"))break;t.push(this._parseExpression())}while(this._matches(bt.COMMA));return this._advance(bt.GROUPER,"]"),this._ast.list(t)}_parseMap(){const t={};do{if(this._advance(),this._matches(bt.GROUPER,"}"))break;const e=this._value;(this._matches(bt.STRING)||this._matches(bt.IDENTIFIER))&&this._advance(),this._advance(bt.COLON),t[e]=this._parseExpression()}while(this._matches(bt.COMMA));return this._advance(bt.GROUPER,"}"),this._ast.map(t)}_parseInvokeOrIdentifier(){const t=this._value;if("true"===t)return this._advance(),this._ast.literal(!0);if("false"===t)return this._advance(),this._ast.literal(!1);if("null"===t)return this._advance(),this._ast.literal(null);if("undefined"===t)return this._advance(),this._ast.literal(void 0);const e=this._parseIdentifier(),i=this._parseArguments();return i?this._ast.invoke(e,void 0,i):e}_parseIdentifier(){if(!this._matches(bt.IDENTIFIER))throw new Error(`expected identifier: ${this._value}`);const t=this._value;return this._advance(),this._ast.id(t)}_parseArguments(){if(!this._matches(bt.GROUPER,"("))return;const t=[];do{if(this._advance(),this._matches(bt.GROUPER,")"))break;const e=this._parseExpression();t.push(e)}while(this._matches(bt.COMMA));return this._advance(bt.GROUPER,")"),t}_parseIndex(){this._advance();const t=this._parseExpression();return this._advance(bt.GROUPER,"]"),t}_parseParenOrFunction(){const t=this._parseArguments();if(this._matches(bt.ARROW)){this._advance();const e=this._parseExpression(),i=t?.map((t=>t.value))??[];return this._ast.arrowFunction(i,e)}return this._ast.paren(t[0])}_parseString(){const t=this._ast.literal(this._value);return this._advance(),t}_parseInteger(t=""){const e=this._ast.literal(parseInt(`${t}${this._value}`,10));return this._advance(),e}_parseDecimal(t=""){const e=this._ast.literal(parseFloat(`${t}${this._value}`));return this._advance(),e}}const Ot={"+":(t,e)=>t+e,"-":(t,e)=>t-e,"*":(t,e)=>t*e,"/":(t,e)=>t/e,"%":(t,e)=>t%e,"==":(t,e)=>t==e,"!=":(t,e)=>t!=e,"===":(t,e)=>t===e,"!==":(t,e)=>t!==e,">":(t,e)=>t>e,">=":(t,e)=>t>=e,"<":(t,e)=>t<e,"<=":(t,e)=>t<=e,"||":(t,e)=>t||e,"&&":(t,e)=>t&&e,"??":(t,e)=>t??e,"|":(t,e)=>e(t),"|>":(t,e)=>e(t)},Nt={"+":t=>t,"-":t=>-t,"!":t=>!t};class It{timeouts=new Map;debounce(t,e){return new Promise(((i,s)=>{const r=this.timeouts.get(e);r&&clearTimeout(r),this.timeouts.set(e,setTimeout((()=>{try{i(e()),this.timeouts.delete(e)}catch(t){s(t)}}),t))}))}}const Pt=new class{empty(){return{type:"Empty",evaluate:t=>t,getIds:t=>t}}literal(t){return{type:"Literal",value:t,evaluate(t){return this.value},getIds:t=>t}}id(t){return{type:"ID",value:t,evaluate(t){return"this"===this.value?t:t?.[this.value]},getIds(t){return t.push(this.value),t}}}unary(t,e){const i=Nt[t];return{type:"Unary",operator:t,child:e,evaluate(t){return i(this.child.evaluate(t))},getIds(t){return this.child.getIds(t)}}}binary(t,e,i){const s=Ot[e];return{type:"Binary",operator:e,left:t,right:i,evaluate(t){if("="===this.operator){if("ID"!==this.left.type&&"Getter"!==this.left.type&&"Index"!==this.left.type)throw new Error(`Invalid assignment target: ${this.left}`);const e=this.right.evaluate(t);let i,s;return"Getter"===this.left.type?(i=this.left.receiver.evaluate(t),s=this.left.name):"Index"===this.left.type?(i=this.left.receiver.evaluate(t),s=this.left.argument.evaluate(t)):"ID"===this.left.type&&(i=t,s=this.left.value),void 0===i?void 0:i[s]=e}return s(this.left.evaluate(t),this.right.evaluate(t))},getIds(t){return this.left.getIds(t),this.right.getIds(t),t}}}getter(t,e){return{type:"Getter",receiver:t,name:e,evaluate(t){return this.receiver.evaluate(t)?.[this.name]},getIds(t){return this.receiver.getIds(t),t}}}invoke(t,e,i){if(null!=e&&"string"!=typeof e)throw new Error("method not a string");return{type:"Invoke",receiver:t,method:e,arguments:i,evaluate(t){const i=this.receiver.evaluate(t),s=this.method?i:t?.this??t,r=this.method?i?.[e]:i,n=(this.arguments??[]).map((e=>e?.evaluate(t)));return r?.apply?.(s,n)},getIds(t){return this.receiver.getIds(t),this.arguments?.forEach((e=>e?.getIds(t))),t}}}paren(t){return t}index(t,e){return{type:"Index",receiver:t,argument:e,evaluate(t){return this.receiver.evaluate(t)?.[this.argument.evaluate(t)]},getIds(t){return this.receiver.getIds(t),t}}}ternary(t,e,i){return{type:"Ternary",condition:t,trueExpr:e,falseExpr:i,evaluate(t){return this.condition.evaluate(t)?this.trueExpr.evaluate(t):this.falseExpr.evaluate(t)},getIds(t){return this.condition.getIds(t),this.trueExpr.getIds(t),this.falseExpr.getIds(t),t}}}map(t){return{type:"Map",entries:t,evaluate(e){const i={};if(t&&this.entries)for(const s in t){const t=this.entries[s];t&&(i[s]=t.evaluate(e))}return i},getIds(e){if(t&&this.entries)for(const i in t){const t=this.entries[i];t&&t.getIds(e)}return e}}}list(t){return{type:"List",items:t,evaluate(t){return this.items?.map((e=>e?.evaluate(t)))},getIds(t){return this.items?.forEach((e=>e?.getIds(t))),t}}}arrowFunction(t,e){return{type:"ArrowFunction",params:t,body:e,evaluate(t){const e=this.params,i=this.body;return function(...s){const r=Object.fromEntries(e.map(((t,e)=>[t,s[e]]))),n=new Proxy(t??{},{set:(t,e,i)=>(r.hasOwnProperty(e)&&(r[e]=i),t[e]=i),get:(t,e)=>r.hasOwnProperty(e)?r[e]:t[e]});return i.evaluate(n)}},getIds(t){return this.body.getIds(t).filter((t=>!this.params.includes(t)))}}}};function St(t,e){const i=t?._store;return i?.has(e)?i.get(e):i?.has("$parent")?St(i.get("$parent"),e):null}function xt(t,e){const i=t?._store;return i?.has(e)?t:i?.has("$parent")?xt(i.get("$parent"),e):null}class Ct extends It{evalkeys=["$elem","$event"];expressionCache=new Map;observers=new Map;keyHandlers=new Map;_observer=null;_store=new Map;_lock=Promise.resolve();constructor(t){super();for(let[e,i]of Object.entries(t||{}))this.set(e,i)}wrapFunction(t){return(...e)=>t.call(this.$,...e)}wrapObject(t,e){return null==t||((i=t)instanceof Ct||i.__is_proxy__)||t.constructor!==Object&&!Array.isArray(t)?t:new Proxy(t,{deleteProperty:(t,i)=>i in t&&(delete t[i],e(),!0),set:(i,s,r,n)=>{"object"==typeof r&&null!=t&&(r=this.wrapObject(r,e));const a=Reflect.set(i,s,r,n);return e(),a},get:(t,e,i)=>"__is_proxy__"===e||Reflect.get(t,e,i)});var i}watch(t,e){const i=xt(this,t);if(!i)throw new Error(`Cannot watch key "${t}" as it does not exist in the store.`);i.observers.has(t)||i.observers.set(t,new Set),i.observers.get(t)?.has(e)||i.observers.get(t)?.add(e)}addKeyHandler(t,e){this.keyHandlers.has(t)||this.keyHandlers.set(t,new Set),this.keyHandlers.get(t).add(e)}async notify(t,e=10){const i=xt(this,t),s=Array.from(i?.observers.get(t)||[]);await this.debounce(e,(()=>Promise.all(s.map((t=>t.call(this.proxify(t)))))))}get(t,e){return e&&this.watch(t,e),St(this,t)}async set(t,e){if(e===this._store.get(t))return;const i=()=>this.notify(t);e&&"function"==typeof e&&(e=this.wrapFunction(e)),e&&"object"==typeof e&&(e=this.wrapObject(e,i)),function(t,e,i){const s=xt(t,e);s?s._store.set(e,i):t._store.set(e,i)}(this,t,e);for(const[i,s]of this.keyHandlers.entries())if(i.test(t))for(const i of s)await Promise.resolve(i.call(this.$,t,e));await i()}async del(t){await this.set(t,null),this._store.delete(t),this.observers.delete(t)}keys(){return Array.from(this._store.keys())}has(t){return this._store.has(t)}effect(t){return t.call(this.proxify(t))}proxify(t){const e=Array.from(this._store.entries()).map((([t])=>t)),i=Object.fromEntries(e.map((t=>[t,null])));return new Proxy(i,{get:(e,i,s)=>"string"==typeof i&&xt(this,i)?this.get(i,t):"$"===i?this.proxify(t):Reflect.get(this,i,s),set:(t,e,i,s)=>("string"!=typeof e||e in this?Reflect.set(this,e,i,s):this.set(e,i),!0)})}get $(){return this.proxify()}makeEvalFunction(t){if(t.includes(";"))throw new Error("Complex expressions are not supported.");let e=null;if(t.includes(" = ")){const[i,s]=t.split(" = ");e=i.trim(),t=s.trim()}return(i,s)=>{const r=((t,e)=>new Tt(t,e).parse())(t,Pt),n=r?.getIds([])?.map((t=>[t,s[t]??i[t]??globalThis[t]])),a=r?.evaluate(Object.fromEntries(n||[]));if(!e)return a;!function(t,e,i){const s=e.split(".");for(let e=0;e<s.length-1;e++)s[e]in t||(t[s[e]]={}),t=t[s[e]];t[s[s.length-1]]=i}(i,e,a)}}cachedExpressionFunction(t){return t=t.trim(),this.expressionCache.has(t)||this.expressionCache.set(t,this.makeEvalFunction(t)),this.expressionCache.get(t)}eval(t,e={}){const i=this._observer?this:this.$;if(this._store.has(t))return i[t];{const s=this.cachedExpressionFunction(t);try{return s(i,e)}catch(e){return console.error(`Failed to evaluate expression: ${t}`),console.error(e),null}}}}const Lt="$$";function kt(t){return`${Lt}${t}`}function Dt(t){return t.keys().filter((t=>t.startsWith(Lt)))}function Ut(t,e,i){const s=function(t){return t.substring(Lt.length)}(e);let r=!1;if(i){const e=String(i);t.searchParams.get(s)!==e&&(t.searchParams.set(s,e),r=!0)}else t.searchParams.has(s)&&(t.searchParams.delete(s),r=!0);return r}async function zt(t){const e=new URL(window.location.href);await async function(t,e){for(const[i,s]of e.searchParams.entries()){const e=kt(i);t.get(e)!==s&&await t.set(e,s)}}(t,e),function(t,e){let i=!1;for(const s of Dt(e))Ut(t,s,e.get(s))&&(i=!0);i&&window.history.replaceState({},"",t.toString())}(e,t),t.addKeyHandler(new RegExp("^\\$\\$"),((t,e)=>{const i=new URL(window.location.href);Ut(i,t,e)&&window.history.replaceState({},"",i.toString())})),window.addEventListener("popstate",function(t){return async()=>{const e=new URL(window.location.href),i=new Set;for(const[s,r]of e.searchParams.entries()){const e=kt(s);i.add(e),t.get(e)!==r&&t.set(e,r)}const s=Dt(t);for(const e of s)i.has(e)||t.del(e)}}(t))}class $t extends Ct{debugging=!1;dirpath="";_skipNodes=new Set;_customElements=new Map;debug(t){return this.debugging=t,this}async fetchRemote(t,e){return fetch(t,{cache:e?.cache??"default"}).then((t=>t.text()))}async fetchLocal(t,e){return this.fetchRemote(t,e)}async preprocessString(t,e){this.log("Preprocessing string content with params:\n",e);const i=this.parseHTML(t,e);return await this.preprocessNode(i,e),i}async preprocessRemote(t,e){const i={};e?.cache&&(i.cache=e.cache);const s=await fetch(t,i).then((t=>t.text()));return this.preprocessString(s,{...e,dirpath:ut(t),rootDocument:e?.rootDocument??!t.endsWith(".tpl.html")})}async preprocessLocal(t,e){const i=await this.fetchLocal(t,e);return this.preprocessString(i,{...e,dirpath:ut(t),rootDocument:e?.rootDocument??!t.endsWith(".tpl.html")})}subrenderer(){const t=(new this.constructor).debug(this.debugging);return t._store.set("$parent",this),t._store.set("$rootRenderer",this.get("$rootRenderer")??this),t._customElements=this._customElements,t}log(...t){this.debugging&&console.debug(...t)}async preprocessNode(t,e){e={dirpath:this.dirpath,maxdepth:10,...e};const i=new dt(W(t,this._skipNodes)).map((async t=>{this.log("Preprocessing node:\n",ht(t,128)),await pt.resolveIncludes.call(this,t,e),await pt.rebaseRelativePaths.call(this,t,e),await pt.registerCustomElements.call(this,t,e),await pt.resolveCustomElements.call(this,t,e)}));return await Promise.all(i.generator()),t}async renderNode(t,e){for(const i of W(t,this._skipNodes))this.log("Rendering node:\n",ht(i,128)),await pt.resolveForAttribute.call(this,i,e),await pt.resolveDataAttribute.call(this,i,e),await pt.resolveTextAttributes.call(this,i,e),await pt.resolveHtmlAttribute.call(this,i,e),await pt.resolveShowAttribute.call(this,i,e),await pt.resolveClassAttribute.call(this,i,e),await pt.resolveBindAttribute.call(this,i,e),await pt.resolveEventAttributes.call(this,i,e),await pt.resolveTextNodeExpressions.call(this,i,e),await pt.resolveCustomAttribute.call(this,i,e),await pt.resolveCustomProperty.call(this,i,e);return t}async mount(t,e){e={...e,rootNode:t},J(t,"renderer",this),this._store.set("$rootNode",t),this.has("$rootRenderer")||this._store.set("$rootRenderer",this),this.get("$rootRenderer")===this&&await zt(this),await this.preprocessNode(t,e),await this.renderNode(t,e)}}const Mt=[":data",":for",":text",":html",":show",":class",":bind",":on:click",":on:input",":on:change",":on:submit",":attr:src",":attr:href",":attr:title",":prop:checked",":prop:selected",":prop:disabled"];class Ft extends $t{impl="safe_browser";dirpath=ut(globalThis.location?.href??"http://localhost/");parseHTML(t,e={rootDocument:!1}){for(const e of Mt)t=t.replace(new RegExp(`\\s:${e.slice(1)}=`,"g"),` data-${e.slice(1).replace(":","-")}=`);t=(t=(t=t.replace(/<include(.*) src="([^"]+)"(.*)><\/include>/g,'<link $1 rel="subresource" href="$2" $3>')).replace(/<template is="([^"]+)">([\s\S]*)<\/template>/g,'<div role="template" alt="$1">$2</div>')).replace(/<(\w+)-(\w+)(.*)>([\s\S]*)<\/(\w+)-(\w+)>/g,'<div role="$1-$2" $3>$4</div>');const i=Mt.map((t=>`data-${t.slice(1).replace(":","-")}`));i.push("data-testid");const s=(new F).allowDataAttributes(i).allowClassAttributes().allowStyleAttributes().build();if(this.log("parseHTML",t),this.log("sanitized",String(s.sanitize(t))),e.rootDocument){return K(new DOMParser,s.sanitize(t),"text/html")}return s.sanitizeToFragment(t)}serializeHTML(t){return(new XMLSerializer).serializeToString(t).replace(/\s?xmlns="[^"]+"/gm,"")}preprocessLocal(t,e){return this.preprocessRemote(t,e)}createElement(t,e){return(e||document).createElement(t)}textContent(t,e){t.textContent=e}}const Gt=new Ft;export{Gt as Mancha,Ft as Renderer};
package/dist/store.d.ts CHANGED
@@ -32,6 +32,7 @@ export declare class SignalStore extends IDebouncer {
32
32
  get<T>(key: string, observer?: Observer<T>): unknown | null;
33
33
  set(key: string, value: unknown): Promise<void>;
34
34
  del(key: string): Promise<void>;
35
+ keys(): string[];
35
36
  has(key: string): boolean;
36
37
  effect<T>(observer: Observer<T>): T;
37
38
  private proxify;
package/dist/store.js CHANGED
@@ -172,6 +172,9 @@ export class SignalStore extends IDebouncer {
172
172
  this._store.delete(key);
173
173
  this.observers.delete(key);
174
174
  }
175
+ keys() {
176
+ return Array.from(this._store.keys());
177
+ }
175
178
  has(key) {
176
179
  return this._store.has(key);
177
180
  }
package/dist/store.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"store.js","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,MAAe,UAAU;IACvB,QAAQ,GAAiD,IAAI,GAAG,EAAE,CAAC;IAEnE,QAAQ,CAAI,MAAc,EAAE,QAA8B;QACxD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACrC,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;YAC5C,IAAI,OAAO;gBAAE,YAAY,CAAC,OAAO,CAAC,CAAC;YACnC,IAAI,CAAC,QAAQ,CAAC,GAAG,CACf,QAAQ,EACR,UAAU,CAAC,GAAG,EAAE;gBACd,IAAI,CAAC;oBACH,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;oBACpB,IAAI,CAAC,QAAQ,CAAC,MAAM,CAA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E,IAAI,CAAC,CAAC;YAC3B,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,OAAO,CAAC,KAAK,CAAC,kCAAkC,IAAI,EAAE,CAAC,CAAC;gBACxD,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBACnB,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;IACH,CAAC;CACF"}
@@ -41,7 +41,8 @@ For example, a basic form might look like this
41
41
 
42
42
  In the code above, the `:on:submit` tag simply prints 'submitted' to the console. Note that `Mancha`
43
43
  automatically prevents the form submission from refreshing the page by calling
44
- `event.prevenDefault()`. To provide more complex handlers, you can define callbacks as a function:
44
+ `event.prevenDefault()`. You can also trigger this behavior with other events by adding a `:prevent`
45
+ attribute to the element. To provide more complex handlers, you can define callbacks as a function:
45
46
 
46
47
  ```html
47
48
  <body :data="{ name: null, message: null }">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mancha",
3
- "version": "0.14.1",
3
+ "version": "0.14.2",
4
4
  "description": "Javscript HTML rendering engine",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",