@graview/guest 0.1.41 → 0.1.42
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/README.md +50 -1
- package/client.js +1 -1
- package/dist/client.generated.js +2 -2
- package/dist/headless/index.d.ts.map +1 -1
- package/dist/headless/index.js +18 -2
- package/dist/headless/index.js.map +1 -1
- package/dist/headless/protocol.d.ts +5 -0
- package/dist/headless/protocol.d.ts.map +1 -1
- package/dist/headless/runtime.generated.d.ts.map +1 -1
- package/dist/headless/runtime.generated.js +1 -1
- package/dist/headless/runtime.generated.js.map +1 -1
- package/dist/headless/runtime.js +2 -0
- package/dist/headless/runtime.js.map +1 -1
- package/dist/host/code-of.d.ts +16 -0
- package/dist/host/code-of.d.ts.map +1 -0
- package/dist/host/code-of.js +16 -0
- package/dist/host/code-of.js.map +1 -0
- package/dist/host/gestures.d.ts +20 -0
- package/dist/host/gestures.d.ts.map +1 -0
- package/dist/host/gestures.js +210 -0
- package/dist/host/gestures.js.map +1 -0
- package/dist/host/manifest.d.ts +11 -0
- package/dist/host/manifest.d.ts.map +1 -1
- package/dist/host/manifest.js +2 -0
- package/dist/host/manifest.js.map +1 -1
- package/dist/host/session.d.ts +2 -0
- package/dist/host/session.d.ts.map +1 -1
- package/dist/host/session.js +4 -0
- package/dist/host/session.js.map +1 -1
- package/dist/host/theme.d.ts +3 -2
- package/dist/host/theme.d.ts.map +1 -1
- package/dist/host/theme.js +5 -2
- package/dist/host/theme.js.map +1 -1
- package/dist/host/view-runtime.generated.d.ts.map +1 -1
- package/dist/host/view-runtime.generated.js +1 -1
- package/dist/host/view-runtime.generated.js.map +1 -1
- package/dist/host/view.d.ts +3 -6
- package/dist/host/view.d.ts.map +1 -1
- package/dist/host/view.js +78 -22
- package/dist/host/view.js.map +1 -1
- package/dist/host/views.d.ts +1 -1
- package/dist/host/views.d.ts.map +1 -1
- package/dist/host/worker-react.d.ts +11 -3
- package/dist/host/worker-react.d.ts.map +1 -1
- package/dist/host/worker-react.js +4 -0
- package/dist/host/worker-react.js.map +1 -1
- package/dist/host/worker.d.ts +1 -1
- package/dist/host/worker.d.ts.map +1 -1
- package/dist/protocol.d.ts +57 -1
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +18 -0
- package/dist/protocol.js.map +1 -1
- package/dist/worker/view-global.d.ts +29 -0
- package/dist/worker/view-global.d.ts.map +1 -1
- package/dist/worker/view-global.js +40 -5
- package/dist/worker/view-global.js.map +1 -1
- package/dist/worker/view.d.ts.map +1 -1
- package/dist/worker/view.js +2 -1
- package/dist/worker/view.js.map +1 -1
- package/package.json +3 -3
package/dist/host/theme.js
CHANGED
|
@@ -59,8 +59,11 @@ export function watchTheme(document, moved) {
|
|
|
59
59
|
*/
|
|
60
60
|
export function themeWithBrand(read, brand, logo) {
|
|
61
61
|
const given = brand?.();
|
|
62
|
-
const
|
|
63
|
-
|
|
62
|
+
const look = read();
|
|
63
|
+
// The logo the guest's scheme draws: a dark one in the dark, where the brand has one.
|
|
64
|
+
const mark = given?.logo;
|
|
65
|
+
const url = logo.url(typeof mark === "string" || mark === undefined ? mark : look.scheme === "dark" && mark.dark ? mark.dark : mark.light);
|
|
66
|
+
return { ...look, ...(given?.name ? { name: given.name } : {}), ...(url ? { logo: url } : {}) };
|
|
64
67
|
}
|
|
65
68
|
/**
|
|
66
69
|
* THE BRAND'S LOGO, AS A GUEST CAN SHOW IT WITHOUT LOADING ANYTHING (FR-127).
|
package/dist/host/theme.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../../src/host/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../../src/host/theme.ts"],"names":[],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view-runtime.generated.d.ts","sourceRoot":"","sources":["../../src/host/view-runtime.generated.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"view-runtime.generated.d.ts","sourceRoot":"","sources":["../../src/host/view-runtime.generated.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,YAAY,EAAE,MAAqy9D,CAAC"}
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* A worker view's runtime as one classic script (FR-96): the host puts it in
|
|
4
4
|
* front of a view's own source. Carries Remote DOM (MIT, Shopify Inc.).
|
|
5
5
|
*/
|
|
6
|
-
export const VIEW_RUNTIME = "\"use strict\";\n/*! @remote-dom/core and @remote-dom/polyfill — Copyright 2020-present, Shopify Inc. — MIT License.\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n * @graview/guest's worker runtime — Elastic License 2.0. */\n\"use strict\";(()=>{var Oe=globalThis,Yr=Oe.addEventListener,Wr=Oe.removeEventListener,Xr=Oe.postMessage,$r=globalThis.queueMicrotask,an=globalThis.performance,Kr=an?an.now.bind(an):Date.now,Re={listen:t=>Yr.call(Oe,\"message\",t),unlisten:t=>Wr.call(Oe,\"message\",t),post:t=>Xr.call(Oe,t),microtask:t=>$r.call(globalThis,t),now:()=>Kr()};var w=Symbol(\"name\"),ue=Symbol(\"prefix\"),de=Symbol(\"value\"),x=Symbol(\"ns\"),F=Symbol(\"owner\"),I=Symbol(\"owner_document\"),te=Symbol(\"attributes\"),M=Symbol(\"prev\"),m=Symbol(\"next\"),S=Symbol(\"child\"),q=Symbol(\"parent\"),fe=Symbol(\"host\"),X=Symbol(\"data\"),Ee=Symbol(\"listeners\"),ln=Symbol(\"isTrusted\"),Ae=Symbol(\"path\"),_e=Symbol(\"stop_immediate_propagation\"),Pe=Symbol(\"dispatching\"),ie=Symbol(\"content\"),D=Symbol(\"hooks\"),ut=Symbol(\"extensions\"),Ne=Symbol(\"hooks_dispatch\"),U=Symbol(\"is_connected\"),Ce=Symbol(\"create_element\"),zn=0,W=1,ke=2,Ie=3,Me=8,Te=9,jn=10,me=11,_=\"http://www.w3.org/1999/xhtml\",$=\"http://www.w3.org/2000/svg\",Fn=\"http://www.w3.org/XML/1998/namespace\",We=\"http://www.w3.org/2000/xmlns/\";function dt(t){return t.split(/[\\t\\n\\f\\r ]+/).filter(Boolean)}function H(t){return t.replace(/[A-Z]/g,e=>String.fromCharCode(e.charCodeAt(0)+32))}function qn(t){return t.replace(/[a-z]/g,e=>String.fromCharCode(e.charCodeAt(0)-32))}function C(t,e){let n=globalThis.DOMException;if(typeof n==\"function\")return new n(t,e);let r=new Error(t);return r.name=e,r}var Yn=/^(?:[A-Za-z][^\\0\\t\\n\\f\\r\\u0020/>]*|[:_\\u0080-\\u{10FFFF}][A-Za-z0-9-.:_\\u0080-\\u{10FFFF}]*)$/u,Wn=/[\\0\\t\\n\\f\\r />=]/u,Zr=/[\\0\\t\\n\\f\\r />]/u;function se(t){if(t==null)return null;let e=String(t);return e===\"\"?null:e}function Xn(t){Yn.test(t)||un(t)}function cn(t){(t===\"\"||Wn.test(t))&&un(t)}function ft(t,e,n){let r=se(t),o=String(e),i=o.indexOf(\":\"),s=i<0?null:o.slice(0,i),a=i<0?o:o.slice(i+1);if((s!=null&&(s===\"\"||Zr.test(s))||(n===\"element\"?!Yn.test(a):a===\"\"||Wn.test(a)))&&un(o),s!=null&&r==null)throw C(`A namespace is required for the prefix in \"${o}\"`,\"NamespaceError\");if(s===\"xml\"&&r!==Fn)throw C(\"The xml prefix requires the XML namespace\",\"NamespaceError\");if((o===\"xmlns\"||s===\"xmlns\")&&r!==We)throw C(\"The xmlns name requires the XMLNS namespace\",\"NamespaceError\");if(r===We&&o!==\"xmlns\"&&s!==\"xmlns\")throw C(\"The XMLNS namespace requires the xmlns name or prefix\",\"NamespaceError\");return{namespace:r,qualifiedName:o,prefix:s,localName:a}}function un(t){throw C(`Invalid name: \"${t}\"`,\"InvalidCharacterError\")}var mt=0,pt=1,$n=2,dn=3,Qr=typeof performance>\"u\"?Date.now:performance.now.bind(performance),V=class{static NONE=mt;static CAPTURING_PHASE=pt;static AT_TARGET=$n;static BUBBLING_PHASE=dn;timeStamp=Qr();target=null;currentTarget=null;srcElement=null;bubbles=!1;cancelable=!1;composed=!1;defaultPrevented=!1;cancelBubble=!1;eventPhase=mt;[Ae]=[];[_e]=!1;[Pe]=!1;constructor(e,n){this.type=e,Object.defineProperty(this,ln,{writable:!0,value:!1}),n&&(n.bubbles&&(this.bubbles=n.bubbles),n.cancelable&&(this.cancelable=n.cancelable),n.composed&&(this.composed=n.composed))}get isTrusted(){return this[ln]}composedPath(){return[...this[Ae]]}stopPropagation(){this.cancelBubble=!0}stopImmediatePropagation(){this[_e]=!0,this.cancelBubble=!0}preventDefault(){this.cancelable&&(this.defaultPrevented=!0)}set returnValue(e){e||this.preventDefault()}get returnValue(){return!this.defaultPrevented}initEvent(e,n,r){this.type=e,this.bubbles=!!n,this.cancelable=!!r}};function fn(t,e,n){if(t.cancelBubble)return;let o=e[Ee]?.get(t.type)?.[n===pt?\"capture\":\"bubble\"];if(o)for(let i of[...o]){if(!o.has(i)||i.signal?.aborted)continue;t.eventPhase=t.target===e?$n:n,t.currentTarget=e;let s=i.normalizedListener;try{typeof s==\"object\"?s.handleEvent(t):s.call(e,t)}catch(a){setTimeout(Jr,0,a)}if(t[_e])break}}function Jr(t){throw t}var Xe=[],ht=new WeakMap;function gt(t,e){let n=ht.get(t);n?n.push(e):ht.set(t,[e]),Xe[Xe.length-1].push(t)}function B(t){let e=[];Xe.push(e);let n;try{n=t()}catch(r){Xe.pop();try{Kn(e)}catch{}throw r}return Xe.pop(),Kn(e),n}function Kn(t){let e,n=!1;for(let r of t){let o=ht.get(r);if(o){for(;o.length>0;){let i=o.shift();try{i()}catch(s){n||(e=s,n=!0)}}ht.delete(r)}}if(n)throw e}var yt=[],$e=[],mn=!1;function we(t){for(let e of t)yt.push(e),e[1]&&$e.push(e[1]);if(!mn){mn=!0;try{let e,n=!1;for(let r=0;r<yt.length;r++){let[o,i]=yt[r];i&&$e.splice($e.indexOf(i),1);try{o()}catch(s){n||(e=s,n=!0)}}if(n)throw e}finally{yt.length=0,$e.length=0,mn=!1}}}function Ke(t){let e=t;for(;e;){if($e.includes(e))return!0;e=e[q]??e[fe]}return!1}var Ze=Symbol(\"listenerRegistrations\"),pe=class{[Ee]=void 0;[Ze]=void 0;[I]=void 0;addEventListener(e,n,r){if(n==null)return;let o=r===!0||typeof r==\"object\"&&r.capture===!0,i=typeof r==\"object\"&&r.once===!0,s=typeof r==\"object\"?r.signal:void 0;if(s?.aborted)return;let a=pn(o),c=this[Ze];c||(c=new Map,this[Ze]=c);let u=c.get(e);u||(u={},c.set(e,u));let f=u[a];if(f||(f=new Map,u[a]=f),f.has(n))return;let p=this,h={type:e,listener:n,capture:o,once:i,normalizedListener:n,signal:s};(i||s)&&(h.normalizedListener=function(...k){if(h.signal?.aborted){bt(p,h);return}return h.once&&bt(p,h),typeof h.listener==\"object\"?h.listener.handleEvent(...k):h.listener.call(this,...k)});let g=this[Ee];g||(g=new Map,this[Ee]=g);let v=g.get(e);v||(v={},g.set(e,v));let y=v[a];if(y||(y=new Set,v[a]=y),f.set(n,h),y.add(h),s){let b=()=>{bt(p,h)};h.abortListener=b,s.addEventListener(\"abort\",b,{once:!0})}this[I]?.defaultView[Ne].addEventListener?.(this,e,n,r)}removeEventListener(e,n,r){return eo.call(this,e,n,r)}dispatchEvent(e){if(e[Pe])throw C(\"Failed to execute 'dispatchEvent' on 'EventTarget': The event is already being dispatched.\",\"InvalidStateError\");e[Pe]=!0;try{let n=[],r=this;for(;r!=null;)n.push(r),r=r.parentNode;e.target=this,e.srcElement=this,e[Ae]=n;for(let i=n.length;i--;)if(fn(e,n[i],pt),e.cancelBubble)return!e.defaultPrevented;let o=e.bubbles?n:n.slice(0,1);for(let i=0;i<o.length;i++)if(fn(e,o[i],dn),e.cancelBubble)return!e.defaultPrevented;return!e.defaultPrevented}finally{e[Pe]=!1,e.cancelBubble=!1,e[_e]=!1,e.eventPhase=mt,e.currentTarget=null,e[Ae]=[]}}};function eo(t,e,n){if(e==null)return;let r=n===!0||n&&n.capture===!0,o=pn(!!r),i=this[Ze]?.get(t)?.[o]?.get(e);i&&bt(this,i)}function pn(t){return t?\"capture\":\"bubble\"}function bt(t,e){let n=pn(e.capture),r=t[Ze],o=r?.get(e.type);if(!o)return;let i=o[n];if(!i||i.get(e.listener)!==e)return;i.delete(e.listener),i.size===0&&delete o[n],!o.bubble&&!o.capture&&r?.delete(e.type),e.signal&&e.abortListener&&e.signal.removeEventListener(\"abort\",e.abortListener);let s=t[Ee],a=s?.get(e.type);if(!a)return;let c=a[n];c?.delete(e)&&(c.size===0&&delete a[n],!a.bubble&&!a.capture&&s?.delete(e.type),t[I]?.defaultView[Ne].removeEventListener?.(t,e.type,e.listener,e.capture))}var K=class extends Array{item(e){return this[e]??null}};var Je=0,Zn=1,yn=2,bn=3,et=4,Qn=0,Jn=1,Tt=2,wt=3,er=4,gn=5,tr=6,nr=7,Et=/^(?:--|-?[A-Za-z_\\u0080-\\u{10FFFF}])[A-Za-z0-9_\\u0080-\\u{10FFFF}-]*$/u;function to(t,e){let n=1,r=null;for(let o=e;o<t.length;o++){let i=t[o];if(r){i===\"\\\\\"?o++:i===r&&(r=null);continue}if(i==='\"'||i===\"'\")r=i;else if(i===\"(\")n++;else if(i===\")\"&&--n===0)return[t.slice(e,o),o+1]}return[t.slice(e),t.length]}function Y(t){throw C(`Invalid or unsupported selector: \"${t}\"`,\"SyntaxError\")}function xt(t,e){let n=typeof e==\"string\"?tt(e):[{combinator:et,matchers:e}],r=null,o=t[S];return o&&n[0].matchers.length&&En(o,n,i=>(r=i,!1)),r}function vt(t,e){let n=typeof e==\"string\"?tt(e):[{combinator:et,matchers:e}],r=new K,o=t[S];return o&&n[0].matchers.length&&En(o,n,i=>{r.push(i)}),r}function tt(t,e=!1,n=!1){let r={combinator:et,matchers:[]},o=[r],i=/[\\t\\n\\f\\r ]*?([>\\t\\n\\f\\r +~]?)[\\t\\n\\f\\r ]*?(?:(?:\\[[\\t\\n\\f\\r ]*([^\\]=\\t\\n\\f\\r ]+)[\\t\\n\\f\\r ]*(?:=[\\t\\n\\f\\r ]*(?:(['\"])(.*?)\\3|([^\\]\\t\\n\\f\\r ]+)))?[\\t\\n\\f\\r ]*(?:\\]|$))|([#.]?)([^\\t\\n\\f\\r #.[>:+~()]+)|:(\\w+)(\\()?)/gi,s=t.replace(/^[\\t\\n\\f\\r ]+|[\\t\\n\\f\\r ]+$/g,\"\");s===\"\"&&Y(t);let a=0,c;for(;c=i.exec(s);){c.index!==a&&Y(t),c[1]&&(r.matchers.length===0&&!(n&&o.length===1)&&Y(t),c[1]===\">\"?r.combinator=Zn:c[1]===\"+\"?r.combinator=bn:c[1]===\"~\"?r.combinator=yn:r.combinator=Je,r={combinator:et,matchers:[]},o.push(r));let u=c[8]?H(c[8]):c[2]||c[7];c[7]!=null&&!c[6]&&r.matchers.length>0&&Y(t);let p,h=c[4]??c[5]??c[7];if(c[2]){Et.test(u)||Y(t);let g=c[5],v=g?.[0];if(c[3]==null&&(v==='\"'||v===\"'\")){let y=c[0].lastIndexOf(g);h=s.slice(c.index+y+1),i.lastIndex=s.length}else g!=null&&!Et.test(g)&&Y(t);p=er}else c[6]?(Et.test(u)||Y(t),p=c[6]===\"#\"?Tt:wt):c[8]?p=c[9]==null?gn:tr:c[7]===\"*\"?p=Qn:c[7]&&Et.test(c[7])?p=Jn:Y(t);c[9]?([h,i.lastIndex]=to(s,i.lastIndex),u!==\"has\"&&u!==\"not\"&&Y(t),u===\"has\"&&e&&Y(t),tt(h,e||u===\"has\",u===\"has\")):p===gn&&Y(t),r.matchers.push({type:p,name:u,value:h}),a=i.lastIndex}return(a!==s.length||r.matchers.length===0)&&Y(t),o}function no(t,e){let n=tt(e);return n[0]?.matchers.length?Qe(t,n):!1}function ro(t,e){let n=tt(e,!0,!0),r=n[0];if(n.length===1&&r.matchers.length===0)return!1;let o=Je,i={type:nr,name:\":scope\"};if(r.matchers.length===0?(o=r.combinator,r.matchers.push(i)):n.unshift({combinator:Je,matchers:[i]}),n.some(({matchers:c})=>c.length===0))return!1;let s=o===bn||o===yn?t[m]:t[S];if(!s)return!1;let a=!1;return En(s,n,()=>(a=!0,!1),t),a}function En(t,e,n,r){let o=[],i=t;for(;i;){if(z(i)){if(Qe(i,e,r)&&n(i)===!1)return!1;let s=i[S];if(s){let a=i[m];a&&o.push(a),i=s;continue}}i=i[m]??o.pop()??null}return!0}function Qe(t,e,n){let{combinator:r,matchers:o}=e[e.length-1];if(r===et){if(!Nt(t,o,n))return!1;let a=e.slice(0,-1);return a.length===0||Qe(t,a,n)}let i=r===Zn||r===Je?q:M,s=t[i];if(!s)return!1;if(r===Je||r===yn){for(;s;){if(z(s)&&Nt(s,o,n)){let a=e.slice(0,-1);if(a.length===0||Qe(s,a,n))return!0}s=s[i]}return!1}else{if(r===bn&&!z(s)){for(;s&&!z(s);)s=s[i];if(!s)return!1}if(!z(s)||!Nt(s,o,n))return!1;let a=e.slice(0,-1);return a.length===0||Qe(s,a,n)}}function hn(t,e){return t.getAttributeNS(null,t.namespaceURI===_?H(e):e)}function Nt(t,e,n){if(!t)return!1;if(Array.isArray(e)){for(let s of e)if(Nt(t,s,n)===!1)return!1;return!0}let{type:r,name:o,value:i}=e;switch(r){case Qn:return o===\"*\";case Jn:return t.namespaceURI===_?t.localName===H(o):t.localName===o;case Tt:return hn(t,\"id\")===o;case wt:let s=hn(t,\"class\");return s?dt(s).includes(o):!1;case er:let a=hn(t,o);return i==null?a!=null:a===i;case nr:return t===n;case gn:Y(`:${o}`);case tr:switch(o){case\"has\":return ro(t,i||\"\");case\"not\":return!no(t,i||\"\");default:Y(`:${o}(${i})`)}}return!1}function oo(t){return t.nodeType===ke}function nt(t){return X in t}function Tn(t){return t.nodeType===Ie}function io(t){return t.nodeType===Me}function z(t){return t.nodeType===W}function Nn(t){return t.nodeType===me}function sr(t){return\"appendChild\"in t}function St(t){let e=[],n=[t],r=new Set(n),o=new Set,i;for(;n.length>0;){let s=n.pop();if(r.delete(s),o.has(s))continue;let a=[];for(let c of ot(s)){if(o.has(c)||(o.add(c),e.push(c),a.push(c),!z(c)))continue;let u=c[te];if(u)for(let p of u)o.has(p)||(o.add(p),e.push(p));let f=c[ie];f&&!o.has(f)&&!r.has(f)&&(r.add(f),n.push(f))}i??=a}return{nodes:e,treeNodes:i}}function rt(t,e){for(let n of t)n[I]=e}function rr(t,e){let n=t.constructor,r=new n(t.name,t.value,t.namespaceURI);return r[I]=e,r}function or(t,e){if(Tn(t))return e.createTextNode(t.data);if(io(t))return e.createComment(t.data);if(oo(t))return rr(t,e);if(z(t)){let n=e[Ce](t[w],t.namespaceURI,t[ue],t.localName);if(t[te])for(let r=0;r<t[te].length;r++){let o=t[te].item(r);n.attributes.setNamedItem(rr(o,e))}return n}else{if(Nn(t))return e.createDocumentFragment();{let n=new t.constructor;return n[I]=e,n}}}function Ot(t,e,n=t.ownerDocument){if(t.nodeType===Te)throw C(\"Cannot clone a document node\",\"NotSupportedError\");let r=or(t,n);if(!e||!z(t)&&!Nn(t))return r;let o=new Set([t]),i=[{source:t,destination:r,childIndex:0,cloningContent:!1}];for(;i.length>0;){let s=i[i.length-1],a,c;if(s.cloningContent)if(s.contentSource&&s.contentDestination)a=s.contentSource.childNodes[s.childIndex++],c=s.contentDestination;else{i.pop(),s.appendTo&&s.appendTo.appendChild(s.destination);continue}else if(a=s.source.childNodes[s.childIndex++],c=s.destination,!a){if(s.cloningContent=!0,s.childIndex=0,z(s.source)&&s.source.namespaceURI===_&&s.source.localName===\"template\"){let f=s.source[ie];f&&(o.has(f)&&ir(),o.add(f),s.contentSource=f,s.contentDestination=s.destination.content)}continue}if(!a){i.pop(),s.appendTo&&s.appendTo.appendChild(s.destination);continue}o.has(a)&&ir(),o.add(a);let u=or(a,n);z(a)||Nn(a)?i.push({source:a,destination:u,appendTo:c,childIndex:0,cloningContent:!1}):c.appendChild(u)}return r}function ir(){throw new Error(\"Cannot clone a cyclic or repeated node graph\")}function Rt(t,e){let n=String(e);return n===\"\"?null:xt(t,[{type:Tt,name:n}])}function At(t,e){let n=[...new Set(dt(String(e)))];return vt(t,n.map(r=>({type:wt,name:r})))}function _t(t,e){let n=String(e),r=H(n),o=[];for(let i of Pt(t))z(i)&&(n===\"*\"||(i.namespaceURI===_?i[w]===r:i[w]===n))&&o.push(i);return o}function Pt(t){let e=[],n=[],r=t[S];for(;r;){e.push(r);let o=r[S],i=r[m];o?(i&&n.push(i),r=o):r=i??n.pop()??null}return e}function ot(t){let e=Pt(t);return e.unshift(t),e}var Z=class extends pe{nodeType=zn;[w]=\"\";[q]=null;[fe]=null;[S]=null;[M]=null;[m]=null;[U]=!1;get[D](){return this[I].defaultView[Ne]}get localName(){return this[w]}get nodeName(){return this[w]}get ownerDocument(){return this[I]}get isConnected(){return this[U]}isDefaultNamespace(e){let n=se(e);return so(this)===n}get parentNode(){return this[q]}set parentNode(e){}get parentElement(){let e=this[q];return!e||e.nodeType!==1?null:e}set parentElement(e){}get previousSibling(){return this[M]}set previousSibling(e){}get nextSibling(){return this[m]}set nextSibling(e){}get previousElementSibling(){let e=this[M];for(;e&&e.nodeType!==1;)e=e[M];return e}set previousElementSibling(e){}get nextElementSibling(){let e=this[m];for(;e&&e.nodeType!==1;)e=e[m];return e}set nextElementSibling(e){}get firstChild(){return this[S]}set firstChild(e){}get lastChild(){let e=this[S];for(;e;){let n=e[m];if(n==null)break;e=n}return e}set lastChild(e){}get nodeValue(){return nt(this)?this.data:null}set nodeValue(e){nt(this)&&(this.data=e)}get textContent(){if(nt(this))return this.data;let e=\"\";for(let n of Pt(this))Tn(n)&&(e+=n.data);return e}set textContent(e){if(nt(this))this.data=e;else if(sr(this)){let n=e==null?\"\":String(e);n===\"\"?this.replaceChildren():this.replaceChildren(n)}}cloneNode(e){return Ot(this,e)}contains(e){let n=e;for(;n!=null;){if(n===this)return!0;n=n.parentNode}return!1}};function so(t){let e=t;for(;e;)switch(e.nodeType){case W:{let n=e;if(n.prefix==null&&n.namespaceURI!=null)return n.namespaceURI;let r=n.attributes.getNamedItemNS(We,\"xmlns\");if(r!=null&&r.prefix==null)return se(r.value);e=n.parentElement;break}case Te:e=e.documentElement;break;case jn:case me:return null;case ke:e=e.ownerElement;break;default:e=e.parentElement}return null}var Q=Symbol(\"insertNode\"),vn=Symbol(\"preflightInsertions\"),Ct=Symbol(\"replaceNode\"),he=class extends Z{remove(){let e=this.parentNode;e&&e.removeChild(this)}replaceWith(...e){let n=xe(e),r=this.parentNode;if(r)return wn(o=>{ae(r,n);let i=this[m];for(;i&&n.includes(i);)i=i[m];let s=xn(r,n,o);this.parentNode===r?r[Ct](s,this,o):r[Q](s,i,o)})}before(...e){let n=xe(e),r=this.parentNode;if(r)return wn(o=>{ae(r,n);let i=this[M];for(;i&&n.includes(i);)i=i[M];let s=xn(r,n,o);r[Q](s,i?i[m]:r.firstChild,o)})}after(...e){let n=xe(e),r=this.parentNode;if(r)return wn(o=>{ae(r,n);let i=this[m];for(;i&&n.includes(i);)i=i[m];let s=xn(r,n,o);r[Q](s,i,o)})}};function wn(t){return B(()=>{let e=[];try{t(e)}catch(n){try{we(e)}catch{}throw n}we(e)})}function xe(t){return t.map(e=>e instanceof Z?e:String(e))}function it(t,e){return e instanceof Z?e:t.ownerDocument.createTextNode(String(e))}function ae(t,e){for(let n of e){if(!(n instanceof Z))continue;let r=t;for(;r;){if(r===n)throw C(\"Cannot insert a node into itself or one of its descendants\",\"HierarchyRequestError\");r=r[q]??r[fe]}}}function xn(t,e,n){let r=[];for(let i of e)r.push(it(t,i));if(r.length===1)return r[0];let o=t.ownerDocument.createDocumentFragment();o[vn](r);for(let i of r)o[Q](i,null,n);return o}var kt,Sn=0,ar=0,lr=0,cr=0,De=!1,Rn=!1,st=!1,It=class{#t;#n=[];#e=new Set;#r=!1;constructor(e){if(typeof e!=\"function\")throw new TypeError(\"MutationObserver callback must be a function\");this.#t=e}observe(e,n={}){let r=ao(n),o=kt??=new WeakMap,i=o.get(e);i==null&&(i=new Map,o.set(e,i));let s=i.get(this);s==null?Sn++:On(s,-1),i.set(this,r),On(r,1),this.#e.add(e)}disconnect(){let e=kt;if(e!=null){for(let n of this.#e){let r=e.get(n),o=r?.get(this);o!=null&&(r.delete(this),Sn--,On(o,-1)),r?.size===0&&e.delete(n)}this.#e.clear(),this.#n.length=0,Sn===0&&(kt=void 0)}}takeRecords(){return this.#n.splice(0)}enqueue(e){this.#n.push(e),!this.#r&&(this.#r=!0,queueMicrotask(()=>{this.#r=!1;let n=this.takeRecords();n.length>0&&this.#t.call(this,n,this)}))}};function J(t){let e=kt;if(e==null)return;let n=new Map,r=t.target;for(;r;){let o=e.get(r);if(o)for(let[i,s]of o){if(r!==t.target&&!s.subtree)continue;let a=!1;if(t.type===\"attributes\"){if(!s.attributes||s.attributeFilter&&!s.attributeFilter.has(t.attributeName??\"\"))continue;a=s.attributeOldValue}else if(t.type===\"characterData\"){if(!s.characterData)continue;a=s.characterDataOldValue}else if(!s.childList)continue;n.set(i,n.get(i)===!0||a)}r=r.parentNode}for(let[o,i]of n)o.enqueue({addedNodes:t.addedNodes??new K,attributeName:t.attributeName??null,attributeNamespace:t.attributeNamespace??null,nextSibling:t.nextSibling??null,oldValue:i?t.oldValue??null:null,previousSibling:t.previousSibling??null,removedNodes:t.removedNodes??new K,target:t.target,type:t.type})}function Mt(...t){let e=new K;return e.push(...t),e}function ao(t){if(t.attributes===!1&&(t.attributeOldValue||t.attributeFilter!=null))throw new TypeError(\"attributeOldValue and attributeFilter require attributes to be enabled\");if(t.characterData===!1&&t.characterDataOldValue)throw new TypeError(\"characterDataOldValue requires characterData to be enabled\");let e=t.attributes??(t.attributeOldValue===!0||t.attributeFilter!=null),n=t.characterData??t.characterDataOldValue===!0,r=t.childList===!0;if(!e&&!n&&!r)throw new TypeError(\"MutationObserver options must enable childList, attributes, or characterData\");return{attributes:e,attributeFilter:t.attributeFilter==null?void 0:new Set(t.attributeFilter.map(String)),attributeOldValue:t.attributeOldValue===!0,characterData:n,characterDataOldValue:t.characterDataOldValue===!0,childList:r,subtree:t.subtree===!0}}function On(t,e){t.attributes&&(ar+=e),t.characterData&&(lr+=e),t.childList&&(cr+=e),De=ar>0,Rn=lr>0,st=cr>0}var ne=class extends he{childNodes=new K;children=new K;appendChild(e){return B(()=>this[Q](e,null))}insertBefore(e,n){return B(()=>this[Q](e,n||null))}append(...e){return B(()=>{let n=xe(e.filter(r=>r!=null));n.length>1&&ae(this,n);for(let r of n)this[Q](it(this,r),null)})}prepend(...e){return B(()=>{let n=xe(e.filter(o=>o!=null));n.length>1&&ae(this,n);let r=this.firstChild;for(let o of n)this[Q](it(this,o),r)})}replaceChildren(...e){return B(()=>{let n=xe(e.filter(o=>o!=null));ae(this,n);let r;for(;r=this.firstChild;)this.removeChildImmediately(r);for(let o of n)this[Q](it(this,o),null)})}removeChild(e){return B(()=>(this.removeChildImmediately(e),e))}removeChildImmediately(e){if(e.parentNode!==this)throw C(\"The node is not a child of this node\",\"NotFoundError\");let n=this[U]?ot(e):void 0,r=e[M],o=e[m],i=Dt(this,e);if(n)for(let s of n)s[U]=!1;this.queueRemovalMutationRecord(this,e,r,o),n&&this.enqueueTreeReactions(n,\"disconnectedCallback\"),we(this.collectRemovalHookEffects(e,i))}replaceChild(e,n){return B(()=>this[Ct](e,n))}[Ct](e,n,r){if(ae(this,[e]),n.parentNode!==this)throw C(\"The reference node is not a child of this parent\",\"NotFoundError\");let o=n[M],i=n[m],s=this.prepareInsertion(e),a=this[U]?ot(n):void 0,c=new Set(s.map(({node:h})=>h)),u=i;for(;u&&c.has(u);)u=u[m];let f=Dt(this,n);if(a){for(let g of a)g[U]=!1;let h=new Set(a);for(let g of s)h.has(g.node)&&(g.shouldDisconnect=!1)}this.commitInsertion(s,u);let p=this[U];return this.queueRemovalMutationRecord(this,n,o,i),this.queueInsertionMutationRecords(s),a&&this.enqueueTreeReactions(a,\"disconnectedCallback\"),this.enqueueInsertionReactions(s,p),this.performOrCollectHookEffects([...this.collectRemovalHookEffects(n,f),...this.collectInsertionHookEffects(s)],r),n}querySelectorAll(e){return vt(this,e)}querySelector(e){return xt(this,e)}[Q](e,n,r){return this.validateInsertion(e,n),this.insertIntoValidated(e,n,r),e}[vn](e){for(let n of e)this.validateInsertion(n,null),this.prepareInsertion(n)}validateInsertion(e,n){if(ae(this,[e]),n&&n.parentNode!==this)throw C(\"The reference node is not a child of this parent\",\"NotFoundError\")}insertIntoValidated(e,n,r){e===n&&(n=e[m]);let o=this.prepareInsertion(e);this.commitInsertion(o,n);let i=this[U];this.queueInsertionMutationRecords(o),this.enqueueInsertionReactions(o,i),this.performOrCollectHookEffects(this.collectInsertionHookEffects(o),r)}performOrCollectHookEffects(e,n){n?n.push(...e):we(e)}prepareInsertion(e){let n=[];if(e.nodeType===me){let s=e[S];for(;s;)n.push(s),s=s[m]}else n.push(e);let r=this[U],o=this[I],i=[];for(let s of n){let a=s[U],c=a||r,u,f;if(s[I]===o)c&&(u=ot(s));else{let p=St(s);f=p.nodes,c&&(u=p.treeNodes)}i.push({node:s,nodes:u,adoption:f,shouldDisconnect:a})}return i}commitInsertion(e,n){for(let i of e){let s=i.node[q];if(s){let a=i.node[M],c=i.node[m];i.source={parent:s,index:Dt(s,i.node),previousSibling:a,nextSibling:c}}}for(let i of e){let s=this.attachChild(i.node,n);i.insertIndex=s.index,i.previousSibling=s.previousSibling,i.nextSibling=s.nextSibling}let r=this[I];for(let{adoption:i}of e)i&&rt(i,r);let o=this[U];for(let{nodes:i}of e)if(i)for(let s of i)s[U]=o}attachChild(e,n){if(n){let i=n[M];e[m]=n,e[M]=i,i?i[m]=e:this[S]=e,n[M]=e}else{e[m]=null;let i=this[S];if(i){let s;for(;s=i[m];)i=s;i[m]=e,e[M]=i}else this[S]=e,e[M]=null}let r=z(e);e[q]=this;let o;if(n){if(o=this.childNodes.indexOf(n),this.childNodes.splice(o,0,e),r){let i=n;for(;i&&!z(i);)i=i[m];i?this.children.splice(this.children.indexOf(i),0,e):this.children.push(e)}}else o=this.childNodes.length,this.childNodes.push(e),r&&this.children.push(e);return{index:o,previousSibling:e[M],nextSibling:e[m]}}queueRemovalMutationRecord(e,n,r,o){st&&J({type:\"childList\",target:e,removedNodes:Mt(n),previousSibling:r,nextSibling:o})}queueInsertionMutationRecords(e){if(st)for(let n of e){let{node:r,source:o}=n;o&&this.queueRemovalMutationRecord(o.parent,r,o.previousSibling,o.nextSibling),J({type:\"childList\",target:this,addedNodes:Mt(r),previousSibling:n.previousSibling,nextSibling:n.nextSibling})}}collectRemovalHookEffects(e,n){return this.nodeType!==W||Ke(this)?[]:[[()=>this[D].removeChild?.(this,e,n)]]}collectInsertionHookEffects(e){let n=[];for(let r of e){let{node:o,source:i}=r;i?.parent.nodeType===W&&!Ke(i.parent)&&n.push([()=>i.parent[D].removeChild?.(i.parent,o,i.index)]),this.nodeType===W&&!Ke(this)&&n.push([()=>this[D].insertChild?.(this,o,r.insertIndex),o])}return n}enqueueInsertionReactions(e,n){for(let r of e){let{nodes:o}=r;o&&(r.shouldDisconnect&&this.enqueueTreeReactions(o,\"disconnectedCallback\"),n&&this.enqueueTreeReactions(o,\"connectedCallback\"))}}enqueueTreeReactions(e,n){dr(e,n)}};function ur(t,e,n,r){if(e.parentNode!==t)throw Error(\"not a child of this node\");let o=t[U]?n.treeNodes:void 0,i=e[M],s=e[m],a=Dt(t,e);if(o)for(let u of o)u[U]=!1;rt(n.nodes,r),st&&J({type:\"childList\",target:t,removedNodes:Mt(e),previousSibling:i,nextSibling:s}),o&&dr(o,\"disconnectedCallback\");let c=[];t.nodeType===W&&!Ke(t)&&c.push([()=>t[D].removeChild?.(t,e,a)]),we(c)}function Dt(t,e){let n=e[M],r=e[m];n?n[m]=r:t[S]=r,r&&(r[M]=n);let o=t.childNodes.indexOf(e);return t.childNodes.splice(o,1),z(e)&&t.children.splice(t.children.indexOf(e),1),e[q]=null,e[m]=null,e[M]=null,o}function dr(t,e){for(let n of t){let r=n[e];typeof r==\"function\"&>(n,()=>r.call(n))}}function at(t,e,n,r,o){let{observedAttributes:i}=t.constructor,{attributeChangedCallback:s}=t;s==null||i==null||!i.includes(e)||gt(t,()=>s.call(t,e,n,r,o))}var Lt=class{[S]=null;constructor(e){this[F]=e}getNamedItem(e){let n=String(e),r=this[F][x]===_?H(n):n,o=this[S];for(;o;){if(o.name===r)return o;o=o[m]}return null}getNamedItemNS(e,n){let r=se(e),o=String(n),i=this[S];for(;i;){if(i.localName===o&&i[x]===r)return i;i=i[m]}return null}item(e){let n=this[S],r=0;for(;n;){if(r++===e)return n;n=n[m]}return null}get length(){let e=0,n=this[S];for(;n;)e++,n=n[m];return e}removeNamedItem(e){let n=String(e),r=this[F][x]===_?H(n):n;return B(()=>this.removeNamedItemImmediately(o=>o.name===r))}removeNamedItemNS(e,n){let r=se(e),o=String(n);return B(()=>this.removeNamedItemImmediately(i=>i.localName===o&&i[x]===r))}removeNamedItemImmediately(e){let n=this[F],r=this[S],o=null;for(;r!=null;){if(e(r)){o&&(o[m]=r[m]),this[S]===r&&(this[S]=r[m]);let i=r.value;return r[m]=null,r[F]=null,De&&J({type:\"attributes\",target:n,attributeName:r.name,attributeNamespace:r[x],oldValue:i}),n[D].removeAttribute?.(n,r.name,r[x]),at(n,r.localName,i,null,r[x]),r}o=r,r=r[m]}return null}setNamedItem(e){return B(()=>this.setNamedItemImmediately(e))}setNamedItemImmediately(e){let n=this[F],r=e[F];if(r!=null&&r!==n)throw C(\"The attribute is already in use by another element.\",\"InUseAttributeError\");let o=null,i=this[S],s=null;for(;i;){if(i.localName===e.localName&&i[x]===e[x]){if(i===e)return i;s?s[m]=e:this[S]=e,e[m]=i[m],i[m]=null,o=i;break}s=i,i=i[m]}o==null&&(s?s[m]=e:this[S]=e),e[F]=n,e[I]=n[I],o&&(o[F]=null);let a=o==null||o.value!==e.value,c=o!=null&&o.name!==e.name;return a&&De&&J({type:\"attributes\",target:n,attributeName:e.name,attributeNamespace:e[x],oldValue:o?.value??null}),c&&n[D].removeAttribute?.(n,o.name,o[x]),(a||c)&&n[D].setAttribute?.(n,e.name,e.value,e[x]),a&&at(n,e.localName,o?.value??null,e.value,e[x]),o}setNamedItemNS(e){return this.setNamedItem(e)}*[Symbol.iterator](){let e=this[S];for(;e;)yield e,e=e[m]}};var ve=class extends Z{nodeType=ke;[x]=null;[m]=null;[F]=null;constructor(e,n,r){super(),this[w]=e,this[de]=n,r&&(this[x]=r)}get nodeName(){return this[w]}set nodeName(e){}get name(){return this[w]}set name(e){}get localName(){if(this[x]==null)return this[w];let e=this[w].indexOf(\":\");return e<0?this[w]:this[w].slice(e+1)}get prefix(){if(this[x]==null)return null;let e=this[w].indexOf(\":\");return e<0?null:this[w].slice(0,e)}get value(){return this[de]}set value(e){let n=String(e),r=this[F];if(!r){this[de]=n;return}B(()=>{let o=this[de];this[de]=n,De&&o!==n&&J({type:\"attributes\",target:r,attributeName:this[w],attributeNamespace:this[x],oldValue:o}),this[D].setAttribute?.(r,this[w],n,this[x]),at(r,this.localName,o,n,this[x])})}get nodeValue(){return this.value}set nodeValue(e){this.value=e}get ownerElement(){return this[F]}get namespaceURI(){return this[x]}get specified(){return!0}};var lo={amp:\"&\",AMP:\"&\",apos:\"'\",gt:\">\",GT:\">\",lt:\"<\",LT:\"<\",quot:'\"',QUOT:'\"'},co=new Set([\"area\",\"base\",\"br\",\"col\",\"embed\",\"hr\",\"img\",\"input\",\"link\",\"meta\",\"param\",\"source\",\"track\",\"wbr\"]),uo=/(?:<([a-z][a-z0-9-:]*)((?:[\\s]+[^<>'\"=/\\s]+(?:=(['\"])[^]*?\\3|=[^>'\"\\s]*|))*)[\\s]*(\\/?)\\s*>|<\\/([a-z][a-z0-9-:]*)>|<!--(.*?)-->|([^<>]+))/gi,pr=/\\s([^<>'\"=/\\n\\s]+)(?:=([\"'])([\\s\\S]*?)\\2|=([^>'\"\\n\\s]*)|)/g,fo=\"|b|big|blockquote|body|br|center|code|dd|div|dl|dt|em|embed|h1|h2|h3|h4|h5|h6|head|hr|i|img|li|listing|menu|meta|nobr|ol|p|pre|ruby|s|small|span|strong|strike|sub|sup|table|tt|u|ul|var|\",mo=/^(?:color|face|size)$/i;function fr(t){return t.replace(/&(?:(amp|AMP|apos|gt|GT|lt|LT|quot|QUOT)|#(\\d+)|#[xX]([\\da-fA-F]+));/g,(e,n,r,o)=>{if(n)return lo[n];let i=Number.parseInt(r??o,r?10:16);try{return String.fromCodePoint(i)}catch{return e}})}function hr(t){return t.namespaceURI===_&&co.has(t.localName)}function mr(t){let e=t.localName;return t[x]===$&&(e===\"foreignObject\"||e===\"desc\"||e===\"title\")}function po(t,e){if(fo.includes(`|${t}|`))return!0;if(t!==\"font\")return!1;for(let n of e.matchAll(pr))if(mo.test(n[1]))return!0;return!1}function Ht(t,e){let n=e.ownerDocument,r=n.createDocumentFragment(),o=[],i=r;for(let s of t.matchAll(uo)){let a=s[1];if(a){let c=s[2],u=H(a),f=o[o.length-1]?.element??e,p=f[x]===$?$:_;if(u===\"svg\")p=$;else if(p===$){if(mr(f))p=_;else if(po(u,c)){for(;o.length>0;){let v=o[o.length-1];if(v.element[x]!==$||mr(v.element))break;o.pop(),i=v.target}p=_}}let h=p===_?u:a,g=n[Ce](h,p,null,h);for(let v of c.matchAll(pr))g.setAttribute(v[1],fr(v[3]||v[4]||\"\"));if(i.append(g),hr(g)||p!==_&&s[4])continue;o.push({element:g,target:i}),i=p===_&&u===\"template\"?g.content:g}else if(s[5]){let c=H(s[5]);for(let u=o.length-1;u>=0;u--){let f=o[u],p=H(f.element[w]);if(p===c){i=f.target,o.length=u;break}if(f.element[x]===_&&p===\"template\")break}}else s[6]?i.append(n.createComment(s[6])):i.append(fr(s[7]))}return r}function Gt(t){return yr([{type:\"content\",child:t[S]}])}function gr(t){return yr([{type:\"opening\",node:t}])}function yr(t){let e=[],n;for(;n=t.pop();)switch(n.type){case\"opening\":{let r=n.node;switch(r.nodeType){case W:{let o=r;e.push(`<${o[w]}`);let i=o[te]?.[S];for(;i;){e.push(` ${i[w]}`);let a=i[de];a!==\"\"&&(a=String(a).replace(/&/g,\"&\").replace(/\"/g,\""\"),e.push(`=\"${a}\"`)),i=i[m]}if(e.push(\">\"),hr(o))break;let s=o.namespaceURI===_&&o.localName===\"template\"?o[ie]:o;t.push({type:\"closing\",name:o[w]}),t.push({type:\"content\",child:s?.[S]??null});break}case Ie:{let o=r;e.push(o[X].replace(/&/g,\"&\").replace(/\"/g,\""\").replace(/</g,\"<\").replace(/>/g,\">\"));break}case Me:{let o=r;e.push(`<!--${o[X]}-->`);break}}break}case\"content\":{let r=n.child;r&&(t.push({type:\"content\",child:r[m]}),t.push({type:\"opening\",node:r}));break}case\"closing\":e.push(`</${n.name}>`);break}return e.join(\"\")}var G=class extends ne{nodeType=W;[x]=_;[ue]=null;get namespaceURI(){return this[x]}get prefix(){return this[ue]}get localName(){let e=this[ue];return e==null?this[w]:this[w].slice(e.length+1)}get nodeName(){return this[x]===_?qn(this[w]):this[w]}get tagName(){return this.nodeName}get id(){return this.getAttributeNS(null,\"id\")??\"\"}set id(e){this.setAttribute(\"id\",String(e))}get slot(){return this.getAttributeNS(null,\"slot\")??\"\"}set slot(e){let n=String(e);this.getAttributeNS(null,\"slot\")!==n&&this.attributes.setNamedItem(new ve(\"slot\",n))}get attributes(){let e=this[te];return e||(e=new Lt(this),this[te]=e),e}getAttributeNames(){return[...this.attributes].map(e=>e.name)}getElementsByTagName(e){return _t(this,e)}get firstElementChild(){return this.children[0]??null}getElementsByClassName(e){return At(this,e)}get lastElementChild(){return this.children[this.children.length-1]??null}get nextElementSibling(){let e=this.nextSibling;for(;e&&e.nodeType!==1;)e=e.nextSibling;return e}get previousElementSibling(){let e=this.previousSibling;for(;e&&e.nodeType!==1;)e=e.previousSibling;return e}setAttribute(e,n){let r=String(e),o=String(n);cn(r);let i=this[x]===_?H(r):r,s=this.attributes.getNamedItemNS(null,i);s?s.value=o:this.attributes.setNamedItem(new ve(i,o))}setAttributeNS(e,n,r){let o=se(e),i=String(n),s=String(r),a=ft(o,i,\"attribute\"),c=this.attributes.getNamedItemNS(a.namespace,a.localName);c?c.value=s:this.attributes.setNamedItemNS(new ve(a.qualifiedName,s,a.namespace))}toggleAttribute(e,n){let r=String(e);cn(r);let o=this[x]===_?H(r):r,i=this.attributes.getNamedItemNS(null,o),s=n===void 0?void 0:!!n;return i==null?s===!1?!1:(this.attributes.setNamedItem(new ve(o,\"\")),!0):s===!0?!0:(this.attributes.removeNamedItemNS(null,o),!1)}getAttribute(e){let n=this.attributes.getNamedItem(e);return n&&n.value}getAttributeNS(e,n){let r=this.attributes.getNamedItemNS(e,n);return r&&r.value}hasAttribute(e){return this.attributes.getNamedItem(e)!=null}hasAttributeNS(e,n){return this.attributes.getNamedItemNS(e,n)!=null}removeAttribute(e){let n=String(e),r=this[x]===_?H(n):n;this.attributes.removeNamedItemNS(null,r)}removeAttributeNS(e,n){this.attributes.removeNamedItemNS(e,n)}get outerHTML(){return gr(this)}get innerHTML(){return Gt(this)}set innerHTML(e){if(e==null||e===\"\")this.replaceChildren();else{let n=Ht(String(e),this);this.replaceChildren(n)}}};var Le=class t extends G{[x]=$;get ownerSVGElement(){let e=null,n=this.parentNode;for(;n instanceof t;)e=n,n=n.parentNode;return e}};var ge=class extends he{[X]=\"\";constructor(e){super(),this[X]=e==null?\"\":String(e)}setData(e){let n=Rn,r=n?this[X]:null,o=\"\";e!=null&&(o=typeof e==\"string\"?e:String(e)),this[X]=o,n&&r!==o&&J({type:\"characterData\",target:this,oldValue:r}),this[D].setText?.(this,o)}get data(){return this[X]}set data(e){this.setData(e)}};var He=class extends ge{nodeType=Ie;[w]=\"#text\"};var Ge=class extends ge{nodeType=Me;[w]=\"#comment\"};var Ue=class extends ne{nodeType=me;[w]=\"#document-fragment\";[I]=typeof window<\"u\"?window.document:null;getElementById(e){return Rt(this,e)}};var Ve=class extends G{get content(){let e=this[ie];return e||(e=this.ownerDocument.createDocumentFragment(),e[fe]=this,this[ie]=e),e}set content(e){}set innerHTML(e){this.content.replaceChildren(Ht(String(e),this))}get innerHTML(){let e=this[ie];return e?Gt(e):\"\"}};var Ut=class extends G{};var Vt=class extends G{};var Bt=class extends G{};var lt=class extends ne{nodeType=Te;[w]=\"#document\";[U]=!0;constructor(e){super(),this.defaultView=e,this[I]=this,this.documentElement=jt(new Bt,this,\"html\"),this.body=jt(new Ut,this,\"body\"),this.head=jt(new Vt,this,\"head\"),this.appendChild(this.documentElement),this.documentElement.appendChild(this.head),this.documentElement.appendChild(this.body)}get textContent(){return null}set textContent(e){}getElementsByClassName(e){return At(this,e)}createElement(e){let n=String(e);return Xn(n),An(this,H(n))}createElementNS(e,n){let r=ft(e,n,\"element\");return An(this,r.qualifiedName,r.namespace,r.prefix,r.localName)}[Ce](e,n,r,o){return An(this,e,n,r,o)}createTextNode(e){let n=zt(new He(e),this);return this[D].createText?.(n,n.data),n}createComment(e){return zt(new Ge(e),this)}createDocumentFragment(){return zt(new Ue,this)}createEvent(){return new V(\"\")}getElementById(e){return Rt(this,e)}getElementsByTagName(e){return _t(this,e)}importNode(e,n){if(e.nodeType===Te)throw C(\"Cannot import a document node\",\"NotSupportedError\");return Ot(e,n,this)}adoptNode(e){if(e[I]===this)return e;let n=St(e);return B(()=>{let r=e.parentNode;return r?ur(r,e,n,this):rt(n.nodes,this),e})}};function zt(t,e){return Object.defineProperty(t,I,{value:e,writable:!0,enumerable:!1}),t}function An(t,e,n=_,r=null,o=e){let i;if(n===$)i=new Le;else if(n===_&&o===\"template\")i=new Ve;else if(n===_){let s=t.defaultView.customElements.get(o);i=s?new s:new G}else i=new G;return jt(i,t,e,n,r)}function jt(t,e,n,r=_,o=null){return zt(t,e),Object.defineProperties(t,{[w]:{value:n},[x]:{value:r},[ue]:{value:o}}),e[D].createElement?.(t,r),t}var Ft=class extends V{constructor(e,n){super(e,n),this.detail=n?.detail??null}initCustomEvent(e,n,r,o){super.initEvent(e,n,r),this.detail=o??null}};var qt=class extends V{constructor(e,n){super(e,n),this.message=n.message,this.filename=n.filename,this.lineno=n.lineno,this.colno=n.colno,this.error=n.error}};var Yt=class extends V{constructor(e,n){super(e,n),this.promise=n.promise,this.reason=n.reason}};var Wt=class extends V{constructor(e,n){super(e,n),this.oldState=n.oldState,this.newState=n.newState}};var Xt=class extends V{constructor(e,n={}){super(e,n),this.relatedTarget=n.relatedTarget??null}};var $t=class extends V{constructor(e,n={}){super(e,n),this.clipboardData=n.clipboardData??null}};var Kt=class extends G{};var ho=/^[a-z][^A-Z\\u0000\\t\\n\\f\\r />]*-[^A-Z\\u0000\\t\\n\\f\\r />]*$/u,go=new Set([\"annotation-xml\",\"color-profile\",\"font-face\",\"font-face-src\",\"font-face-uri\",\"font-face-format\",\"font-face-name\",\"missing-glyph\"]);function br(t){return ho.test(t)&&!go.has(t)}function Er(t){return C(`Invalid custom element name: \"${t}\"`,\"SyntaxError\")}var Zt=class{registry=new Map;listenersByName=new Map;define(e,n,r){if(!br(e))throw Er(e);if(this.registry.has(e))throw C(`A custom element named \"${e}\" has already been defined`,\"NotSupportedError\");if(this.getName(n)!=null)throw C(\"This constructor has already been registered in this custom element registry\",\"NotSupportedError\");this.registry.set(e,n);let o=this.listenersByName.get(e);if(o!=null){this.listenersByName.delete(e);for(let i of o)i(n)}}get(e){return this.registry.get(e)}getName(e){for(let[n,r]of this.registry)if(r===e)return n;return null}whenDefined(e){if(!br(e))return Promise.reject(Er(e));let n=this.registry.get(e);if(n!=null)return Promise.resolve(n);let r=this.listenersByName.get(e);return r==null&&(r=[],this.listenersByName.set(e,r)),new Promise(o=>{r.push(o)})}upgrade(e){}initialize(e){}};var yo=[\"onerror\",\"onunhandledrejection\"],Tr=Symbol.for(\"@remote-dom/polyfill/global-property\");function wr(t){return Object.getOwnPropertyDescriptors(t)}function xr(t){let e={};for(let[n,r]of Object.entries(Object.getOwnPropertyDescriptors(pe.prototype)))n!==\"constructor\"&&typeof r.value==\"function\"&&(r.value=_n(r.value.bind(t)),e[n]=r);return e}function vr(t){let e={};for(let n of yo)e[n]={configurable:!0,enumerable:!0,get:_n(()=>t[n]),set:_n(r=>{t[n]=r})};return e}function bo(t){return Object.assign(wr(t),xr(t),vr(t))}function _n(t){return Object.defineProperty(t,Tr,{value:!0}),t}function Nr(t,e){for(let n of Reflect.ownKeys(e)){let r=Eo(t,n);(r==null||No(r))&&Object.defineProperty(t,n,e[n])}}function Eo(t,e){let n=t;for(;n;){let r=Object.getOwnPropertyDescriptor(n,e);if(r)return r;n=Object.getPrototypeOf(n)}}function No(t){return[t.value,t.get,t.set].some(e=>typeof e==\"function\"&&e[Tr]===!0)}var Se=class extends pe{[D]={};[ut]=[];[Ne]=wo(this);name=\"\";window=this;parent=this;self=this;top=this;document=new lt(this);customElements=new Zt;location=globalThis.location;navigator=globalThis.navigator;Event=V;ErrorEvent=qt;PromiseRejectionEvent=Yt;ToggleEvent=Wt;FocusEvent=Xt;ClipboardEvent=$t;EventTarget=pe;CustomEvent=Ft;Node=Z;ParentNode=ne;ChildNode=he;DocumentFragment=Ue;Document=lt;CharacterData=ge;Comment=Ge;Text=He;Element=G;HTMLElement=Kt;SVGElement=Le;HTMLTemplateElement=Ve;MutationObserver=It;#t=null;#n=null;#e=null;static with(...e){let n=this;return class extends n{constructor(){super();for(let o of e)To(this,o)}}}get onerror(){return this.#n}set onerror(e){this.#t&&this.removeEventListener(\"error\",this.#t),e&&typeof e==\"function\"?(this.#n=e,this.#t=n=>{e(n.message??\"Error\",n.filename,n.lineno,n.colno,n.error)},this.addEventListener(\"error\",this.#t)):(this.#t=null,this.#n=null)}get onunhandledrejection(){return this.#e}set onunhandledrejection(e){this.#e&&this.removeEventListener(\"unhandledrejection\",this.#e),e&&typeof e==\"function\"?(this.#e=e,this.addEventListener(\"unhandledrejection\",this.#e)):this.#e=null}static setGlobal(e){let n=globalThis.self,r=globalThis.window,o=wr(e),i=Object.assign(xr(e),vr(e));delete o.self,Object.defineProperties(globalThis,o),Nr(globalThis,i),typeof n>\"u\"||n===r&&n!==globalThis?Object.defineProperty(globalThis,\"self\",{value:e,configurable:!0,writable:!0,enumerable:!0}):n!==globalThis&&(Object.defineProperties(n,o),Nr(n,i))}static setGlobalThis(e){for(let n in e)e[n]===e&&(e[n]=globalThis);Object.defineProperties(globalThis,bo(e))}};function To(t,e){t[ut].push(e(t)??{})}function wo(t){return{createElement:le.bind(null,t,\"createElement\"),setAttribute:le.bind(null,t,\"setAttribute\"),removeAttribute:le.bind(null,t,\"removeAttribute\"),createText:le.bind(null,t,\"createText\"),setText:le.bind(null,t,\"setText\"),insertChild:le.bind(null,t,\"insertChild\"),removeChild:le.bind(null,t,\"removeChild\"),addEventListener:le.bind(null,t,\"addEventListener\"),removeEventListener:le.bind(null,t,\"removeEventListener\")}}function le(t,e,...n){for(let i of t[ut])i[e]?.apply(i,n);let r=t[D];r[e]?.apply(r,n)}var Qt=new Se;var Pn=\"~\";var ye=new WeakMap;function Be(t){return ye.get(t)}var Mn=new WeakMap,vo=0;function ee(t){let e=Mn.get(t);return e==null&&(e=String(vo++),Jt(t,e)),e}function Jt(t,e){Mn.set(t,e)}var kn=new WeakMap;function So(t){return kn.get(t)}var In=new WeakMap;function Oo(t){let e=In.get(t);if(e!=null)return e;if(!(!(t instanceof Element)||t.tagName.includes(\"-\"))){e={};for(let{name:n,value:r}of t.attributes)e[n]=r;return e}}var Ro=new WeakMap;function Ao(t){return Ro.get(t)}function Dn(t,e,n){let r=kn.get(t);if(r==null&&(r={},kn.set(t,r)),r[e]===n)return;r[e]=n;let o=ye.get(t);o?.mutate([[3,ee(t),e,n,1]])}function be(t,e,n){let r=In.get(t);if(r==null&&(r={},In.set(t,r)),r[e]===n)return;n==null?delete r[e]:r[e]=String(n);let o=ye.get(t);o?.mutate([[3,ee(t),e,n,2]])}function ze(t,e){if(ye.get(t)!==e&&(ye.set(t,e),t.childNodes))for(let r=0;r<t.childNodes.length;r++)ze(t.childNodes[r],e)}function en(t){if(ye.get(t)!=null&&(ye.delete(t),t.childNodes))for(let n=0;n<t.childNodes.length;n++)en(t.childNodes[n])}function je(t){let{nodeType:e}=t;switch(e){case 1:return{id:ee(t),type:e,element:t.localName,properties:Cn(So(t)),attributes:Cn(Oo(t)),eventListeners:Cn(Ao(t)),children:Array.from(t.childNodes).map(je)};case 3:case 8:return{id:ee(t),type:e,data:t.data};default:throw new Error(`Cannot serialize node of type ${t.nodeType} (${typeof t.nodeType})`)}}function Cn(t){return t?{...t}:void 0}function Ln(t,e,...n){let r=Mn.get(t),o=ye.get(t);if(r==null||o==null)throw new Error(`Cannot call method ${e} on an unconnected node`);return o.call(r,e,...n)}var Fe=Qt[D];Fe.insertChild=(t,e,n)=>{let r=Be(t);r!=null&&(ze(e,r),r.mutate([[0,ee(t),je(e),n]]))};Fe.removeChild=(t,e,n)=>{let r=Be(t);r!=null&&(en(e),r.mutate([[1,ee(t),n]]))};Fe.setText=(t,e)=>{let n=Be(t);n?.mutate([[2,ee(t),e]])};Fe.setAttribute=(t,e,n)=>{t.tagName.includes(\"-\")||be(t,e,n)};Fe.removeAttribute=(t,e)=>{t.tagName.includes(\"-\")||be(t,e)};Se.setGlobal(Qt);function tn(t){if(typeof t==\"string\")return{type:\"navigate\",to:t};let{place:e,record:n,where:r,section:o}=t??{},i={...r===void 0?{}:{where:r},...o===void 0?{}:{section:String(o)}};return typeof e==\"string\"?{type:\"navigate\",place:e,...i}:typeof n==\"string\"?{type:\"navigate\",to:n,...i}:void 0}function Or(t){let e=t;return typeof t==\"object\"&&t!==null&&e.graview===\"host-hello\"&&typeof e.nonce==\"string\"}function Ar(t,e={}){let n,r=\"\",o,i=0,s=new Set,a=new Map,c=[],u=y=>{n?n.postMessage({...y,nonce:r}):c.push(y)},f=y=>{let b=y.data;if(!(!b||typeof b!=\"object\")){if(b.type===\"props\"){o=b.props;for(let k of s)k(b.props)}else b.type===\"answer\"?(a.get(b.id)?.(b),a.delete(b.id)):b.type===\"event\"&&typeof b.listener==\"number\"?e.onEvent?.(b):b.type===\"heartbeat\"&&typeof b.beat==\"number\"&&u({type:\"heartbeat\",beat:b.beat});e.onMessage?.(b)}},p=()=>{},h=y=>{if(n||!t.fromHost(y)||!Or(y.data)||y.data.protocol!==1)return;let b=y.ports[0];if(b){n=b,r=y.data.nonce,n.onmessage=f,n.start?.(),p();for(let k of c.splice(0))u(k)}};p=t.listen(h),t.ready({graview:\"guest-ready\",protocol:1});let g,v={get props(){return o},subscribe(y){return s.add(y),()=>s.delete(y)},act(y,b={}){let k=i+=1;return new Promise(L=>{a.set(k,L),u({type:\"act\",id:k,name:y,args:b})})},navigate(y){let b=tn(y);b&&u(b)},size(y){u({type:\"size\",height:y})},autoSize(y){let b=y??globalThis.document?.documentElement,k=globalThis.ResizeObserver;if(!b||!k||typeof b.getBoundingClientRect!=\"function\")return()=>{};g?.disconnect();let L=new k(()=>v.size(Math.ceil(b.getBoundingClientRect().height)));return L.observe(b),g=L,()=>L.disconnect()},close(){g?.disconnect(),p(),n?.close(),s.clear()}};return{guest:v,send:u}}var Pr=[\"globalThis\",\"Infinity\",\"NaN\",\"undefined\",\"isFinite\",\"isNaN\",\"parseFloat\",\"parseInt\",\"decodeURI\",\"decodeURIComponent\",\"encodeURI\",\"encodeURIComponent\",\"escape\",\"unescape\",\"Object\",\"Function\",\"Array\",\"Number\",\"Boolean\",\"String\",\"Symbol\",\"BigInt\",\"Date\",\"Promise\",\"RegExp\",\"Math\",\"JSON\",\"Reflect\",\"Proxy\",\"Intl\",\"Error\",\"AggregateError\",\"EvalError\",\"RangeError\",\"ReferenceError\",\"SyntaxError\",\"TypeError\",\"URIError\",\"SuppressedError\",\"Map\",\"Set\",\"WeakMap\",\"WeakSet\",\"WeakRef\",\"FinalizationRegistry\",\"Iterator\",\"AsyncIterator\",\"DisposableStack\",\"AsyncDisposableStack\",\"ArrayBuffer\",\"SharedArrayBuffer\",\"DataView\",\"Atomics\",\"Int8Array\",\"Uint8Array\",\"Uint8ClampedArray\",\"Int16Array\",\"Uint16Array\",\"Int32Array\",\"Uint32Array\",\"Float16Array\",\"Float32Array\",\"Float64Array\",\"BigInt64Array\",\"BigUint64Array\"],Cr=[\"window\",\"parent\",\"top\",\"document\",\"customElements\",\"Event\",\"ErrorEvent\",\"PromiseRejectionEvent\",\"ToggleEvent\",\"FocusEvent\",\"ClipboardEvent\",\"CustomEvent\",\"EventTarget\",\"Node\",\"ParentNode\",\"ChildNode\",\"DocumentFragment\",\"Document\",\"CharacterData\",\"Comment\",\"Text\",\"Element\",\"HTMLElement\",\"SVGElement\",\"HTMLTemplateElement\",\"MutationObserver\"],kr=[\"self\",\"postMessage\",\"setTimeout\",\"clearTimeout\",\"setInterval\",\"clearInterval\",\"queueMicrotask\",\"structuredClone\",\"crypto\",\"console\",\"DOMException\"],Ir=[\"TEMPORARY\",\"PERSISTENT\"],nl=Object.freeze([...Pr,...Cr,...kr,...Ir]),rl=Object.freeze([\"constructor\",\"__defineGetter__\",\"__defineSetter__\",\"hasOwnProperty\",\"__lookupGetter__\",\"__lookupSetter__\",\"isPrototypeOf\",\"propertyIsEnumerable\",\"toString\",\"valueOf\",\"__proto__\",\"toLocaleString\"]),_r=t=>typeof t==\"symbol\"?`[${t.description??\"symbol\"}]`:t;function Mr(t=globalThis,e=[],n={}){let r=[],o=[],i=new Set([...Pr,...Cr,...kr,...e,\"constructor\",Symbol.toStringTag]),s=(N,P)=>{let j=Reflect.getOwnPropertyDescriptor(N,P);return j===void 0||!(\"value\"in j)||j.writable||j.configurable?!1:n.primitivesStay&&typeof P==\"symbol\"&&(typeof j.value!=\"object\"||j.value===null)&&typeof j.value!=\"function\"?!0:Ir.includes(P)&&typeof j.value==\"number\"},a=t,c=a.setTimeout,u=a.setInterval,f=a.crypto,p=(N,P)=>function(j,Bn,...l){if(typeof j!=\"function\")throw new TypeError(`${P} takes a function: a guest view cannot run code from text`);return N.call(t,j,Bn,...l)},h=f?Object.freeze({getRandomValues:N=>f.getRandomValues(N)}):void 0,g=a.document?.defaultView;if(g&&g!==a)for(let N of Reflect.ownKeys(g))typeof N==\"symbol\"||i.has(N)||Reflect.deleteProperty(g,N)||o.push(`window.${N}`);let v=[];for(let N=t;N&&N!==Object.prototype;N=Object.getPrototypeOf(N))v.push(N);for(let N of v)for(let P of Reflect.ownKeys(N))i.has(P)||(Reflect.deleteProperty(N,P)?r.push(_r(P)):s(N,P)||o.push(_r(P)));let y=()=>function(){throw new EvalError(\"A guest view cannot make code from text.\")},b=[Function.prototype,Object.getPrototypeOf(async function(){}),Object.getPrototypeOf(function*(){}),Object.getPrototypeOf(async function*(){})];for(let N of b){let P=y();Object.defineProperty(P,\"prototype\",{value:N,writable:!1,enumerable:!1,configurable:!1}),Reflect.defineProperty(N,\"constructor\",{value:P,writable:!1,enumerable:!1,configurable:!1})||o.push(\"Function.prototype.constructor\"),N===Function.prototype&&Reflect.defineProperty(t,\"Function\",{value:P,writable:!0,enumerable:!1,configurable:!0})}let k=(N,P)=>{Reflect.defineProperty(t,N,{value:P,writable:!0,enumerable:!0,configurable:!0})||o.push(N)};k(\"setTimeout\",p(c,\"setTimeout\")),k(\"setInterval\",p(u,\"setInterval\")),h&&k(\"crypto\",h);for(let N of v.slice(1))Object.freeze(N);for(let N of Reflect.ownKeys(t)){let P=Reflect.getOwnPropertyDescriptor(t,N);Reflect.defineProperty(t,N,\"value\"in P?{...P,writable:!1,configurable:!1}:{...P,configurable:!1})}let L;try{L=Reflect.preventExtensions(t)}catch{L=!1}return{removed:r,stuck:o,sealed:L}}var ct=class extends HTMLElement{constructor(){super(),Jt(this,Pn)}connect(e){if(Be(this)===e||(ze(this,e),this.childNodes.length===0))return;let n=[];for(let r=0;r<this.childNodes.length;r++){let o=this.childNodes[r];n.push([0,Pn,je(o),r])}e.mutate(n)}updateRemoteProperty(e,n){Dn(this,e,n)}callRemoteMethod(e,...n){return Ln(this,e,...n)}};var d={},nn={empty:!0},_o={id:\"text\",class:\"text\",title:\"text\",lang:\"text\",dir:{oneOf:[\"ltr\",\"rtl\",\"auto\"]},hidden:\"text\",tabindex:{oneOf:[\"-1\",\"0\"]},role:\"text\",style:\"style\",translate:{oneOf:[\"yes\",\"no\"]},spellcheck:{oneOf:[\"true\",\"false\"]},draggable:{oneOf:[\"true\",\"false\"]},inert:\"boolean\"},Hn={div:d,section:d,article:d,aside:d,header:d,footer:d,nav:d,hgroup:d,search:d,address:d,figure:d,figcaption:d,blockquote:d,p:d,pre:d,hr:nn,br:nn,wbr:nn,h1:d,h2:d,h3:d,h4:d,h5:d,h6:d,span:d,strong:d,em:d,b:d,i:d,u:d,s:d,small:d,mark:d,abbr:d,cite:d,q:d,code:d,kbd:d,samp:d,var:d,sub:d,sup:d,dfn:d,bdi:d,bdo:d,ruby:d,rt:d,rp:d,time:{attributes:{datetime:\"text\"}},data:{attributes:{value:\"text\"}},del:{attributes:{datetime:\"text\"}},ins:{attributes:{datetime:\"text\"}},a:d,ul:d,menu:d,dl:d,dt:d,dd:d,ol:{attributes:{start:\"number\",reversed:\"boolean\",type:{oneOf:[\"1\",\"a\",\"A\",\"i\",\"I\"]}}},li:{attributes:{value:\"number\"}},table:d,caption:d,thead:d,tbody:d,tfoot:d,tr:d,colgroup:{attributes:{span:\"number\"}},col:{attributes:{span:\"number\"},empty:!0},th:{attributes:{colspan:\"number\",rowspan:\"number\",headers:\"text\",scope:{oneOf:[\"row\",\"col\",\"rowgroup\",\"colgroup\"]},abbr:\"text\"}},td:{attributes:{colspan:\"number\",rowspan:\"number\",headers:\"text\"}},details:{attributes:{open:\"boolean\",name:\"text\"}},summary:d,button:{attributes:{type:{oneOf:[\"button\"]},disabled:\"boolean\",name:\"text\",value:\"text\"}},input:{empty:!0,attributes:{type:{oneOf:[\"text\",\"search\",\"number\",\"range\",\"checkbox\",\"radio\",\"date\",\"time\",\"datetime-local\",\"month\",\"week\",\"color\",\"email\",\"tel\",\"url\"]},name:\"text\",value:\"text\",placeholder:\"text\",min:\"text\",max:\"text\",step:\"text\",checked:\"boolean\",disabled:\"boolean\",readonly:\"boolean\",required:\"boolean\",maxlength:\"number\",minlength:\"number\",size:\"number\",pattern:\"text\",multiple:\"boolean\",inputmode:\"text\",enterkeyhint:\"text\"}},select:{attributes:{name:\"text\",disabled:\"boolean\",multiple:\"boolean\",required:\"boolean\",size:\"number\"}},option:{attributes:{value:\"text\",selected:\"boolean\",disabled:\"boolean\",label:\"text\"}},optgroup:{attributes:{label:\"text\",disabled:\"boolean\"}},textarea:{attributes:{name:\"text\",placeholder:\"text\",rows:\"number\",cols:\"number\",disabled:\"boolean\",readonly:\"boolean\",required:\"boolean\",maxlength:\"number\",minlength:\"number\",wrap:{oneOf:[\"soft\",\"hard\",\"off\"]}}},label:{attributes:{for:\"text\"}},fieldset:{attributes:{disabled:\"boolean\",name:\"text\"}},legend:d,output:d,meter:{attributes:{value:\"number\",min:\"number\",max:\"number\",low:\"number\",high:\"number\",optimum:\"number\"}},progress:{attributes:{value:\"number\",max:\"number\"}},img:{empty:!0,attributes:{src:\"image\",alt:\"text\",width:\"number\",height:\"number\",decoding:{oneOf:[\"async\",\"sync\",\"auto\"]}}},\"graview-video\":nn},Po=[\"fill\",\"fill-opacity\",\"fill-rule\",\"stroke\",\"stroke-width\",\"stroke-linecap\",\"stroke-linejoin\",\"stroke-dasharray\",\"stroke-dashoffset\",\"stroke-opacity\",\"stroke-miterlimit\",\"opacity\",\"color\",\"display\",\"visibility\",\"transform-origin\",\"clip-path\",\"clip-rule\",\"marker-start\",\"marker-mid\",\"marker-end\",\"font-family\",\"font-size\",\"font-weight\",\"font-style\",\"text-anchor\",\"dominant-baseline\",\"alignment-baseline\",\"letter-spacing\",\"text-decoration\",\"paint-order\",\"vector-effect\",\"shape-rendering\",\"pointer-events\",\"stop-color\",\"stop-opacity\",\"overflow\",\"mask\"],Co={id:\"text\",class:\"text\",style:\"style\",lang:\"text\",role:\"text\",tabindex:{oneOf:[\"-1\",\"0\"]},transform:\"geometry\",...Object.fromEntries(Po.map(t=>[t,\"css\"]))},qe={x:\"geometry\",y:\"geometry\",width:\"geometry\",height:\"geometry\"},rn={viewBox:\"geometry\",preserveAspectRatio:\"geometry\"},Dr={gradientUnits:{oneOf:[\"userSpaceOnUse\",\"objectBoundingBox\"]},gradientTransform:\"geometry\",spreadMethod:{oneOf:[\"pad\",\"reflect\",\"repeat\"]},href:\"fragment\"},Lr={svg:{attributes:{...qe,...rn}},g:d,defs:d,symbol:{attributes:{...qe,...rn,refX:\"geometry\",refY:\"geometry\"}},use:{attributes:{...qe,href:\"fragment\"}},title:d,desc:d,path:{attributes:{d:\"geometry\",pathLength:\"number\"}},rect:{attributes:{...qe,rx:\"geometry\",ry:\"geometry\",pathLength:\"number\"}},circle:{attributes:{cx:\"geometry\",cy:\"geometry\",r:\"geometry\",pathLength:\"number\"}},ellipse:{attributes:{cx:\"geometry\",cy:\"geometry\",rx:\"geometry\",ry:\"geometry\",pathLength:\"number\"}},line:{attributes:{x1:\"geometry\",y1:\"geometry\",x2:\"geometry\",y2:\"geometry\",pathLength:\"number\"}},polyline:{attributes:{points:\"geometry\",pathLength:\"number\"}},polygon:{attributes:{points:\"geometry\",pathLength:\"number\"}},text:{attributes:{x:\"geometry\",y:\"geometry\",dx:\"geometry\",dy:\"geometry\",rotate:\"geometry\",textLength:\"geometry\",lengthAdjust:{oneOf:[\"spacing\",\"spacingAndGlyphs\"]}}},tspan:{attributes:{x:\"geometry\",y:\"geometry\",dx:\"geometry\",dy:\"geometry\",rotate:\"geometry\",textLength:\"geometry\"}},textPath:{attributes:{href:\"fragment\",startOffset:\"geometry\",method:{oneOf:[\"align\",\"stretch\"]},spacing:{oneOf:[\"auto\",\"exact\"]},side:{oneOf:[\"left\",\"right\"]}}},linearGradient:{attributes:{x1:\"geometry\",y1:\"geometry\",x2:\"geometry\",y2:\"geometry\",...Dr}},radialGradient:{attributes:{cx:\"geometry\",cy:\"geometry\",r:\"geometry\",fx:\"geometry\",fy:\"geometry\",fr:\"geometry\",...Dr}},stop:{attributes:{offset:\"geometry\"}},clipPath:{attributes:{clipPathUnits:{oneOf:[\"userSpaceOnUse\",\"objectBoundingBox\"]}}},mask:{attributes:{...qe,maskUnits:{oneOf:[\"userSpaceOnUse\",\"objectBoundingBox\"]},maskContentUnits:{oneOf:[\"userSpaceOnUse\",\"objectBoundingBox\"]}}},pattern:{attributes:{...qe,...rn,patternUnits:{oneOf:[\"userSpaceOnUse\",\"objectBoundingBox\"]},patternContentUnits:{oneOf:[\"userSpaceOnUse\",\"objectBoundingBox\"]},patternTransform:\"geometry\",href:\"fragment\"}},marker:{attributes:{...rn,markerWidth:\"geometry\",markerHeight:\"geometry\",refX:\"geometry\",refY:\"geometry\",orient:\"geometry\",markerUnits:{oneOf:[\"strokeWidth\",\"userSpaceOnUse\"]}}}};var Hr={section:[\"aria-label\",\"aria-labelledby\",\"title\"]};function ko(t){return/^aria-[a-z]+$/.test(t)}function Io(t){return/^data-[a-z0-9][a-z0-9_.-]*$/.test(t)}var Mo=new Map(Object.keys(Lr).map(t=>[t.toLowerCase(),t]));function Gr(t){return Mo.get(t.toLowerCase())}function Ur(t,e,n){let r=n.toLowerCase(),o=t===\"html\"?[Hn[e]?.attributes,_o]:[Lr[e]?.attributes,Co],i=t===\"svg\"&&r===\"xlink:href\"?\"href\":r;for(let s of o)if(s){for(let[a,c]of Object.entries(s))if(a.toLowerCase()===i)return{name:a,kind:c}}if(ko(r)||Io(r))return{name:r,kind:\"text\"}}var Vr=\"~\",on=t=>typeof t==\"object\"&&t!==null&&!Array.isArray(t),re=(t,e=0)=>{if(t===null||typeof t==\"string\"||typeof t==\"number\"||typeof t==\"boolean\"||t===void 0)return t;if(!(e>64||typeof t!=\"object\"))return Array.isArray(t)?t.map(n=>re(n,e+1)):Object.fromEntries(Object.entries(t).map(([n,r])=>[n,re(r,e+1)]))};function Br(){let t=new Map,e=new Map,n=new Map([[Vr,{children:[],listeners:new Map}]]),r=0,o=u=>{let f=e.get(u);return f===void 0&&(f=r+=1,e.set(u,f),t.set(f,{listener:u,count:0})),t.get(f).count+=1,f},i=u=>{let f=t.get(u);f&&(f.count-=1,!(f.count>0)&&(t.delete(u),e.delete(f.listener)))},s=u=>{let f=n.get(u);if(f){n.delete(u);for(let p of f.listeners.values())i(p);for(let p of f.children)s(p)}},a=(u,f,p=0)=>{if(!on(u)||p>64)return re(u);let h=typeof u.id==\"string\"?u.id:void 0,g=f&&h!==void 0&&h!==Vr;g&&s(h);let v={children:[],listeners:new Map};g&&n.set(h,v);let y={};for(let[b,k]of Object.entries(u))b===\"children\"&&Array.isArray(k)?y[b]=k.map(L=>{let N=a(L,g,p+1);return g&&on(L)&&typeof L.id==\"string\"&&v.children.push(L.id),N}):b===\"eventListeners\"&&on(k)?y[b]=Object.fromEntries(Object.entries(k).map(([L,N])=>{if(typeof N!=\"function\"||!g)return[L,void 0];let P=o(N);return v.listeners.set(L,P),[L,{listener:P}]})):y[b]=re(k,p+1);return y},c=u=>{if(!Array.isArray(u))return re(u);let[f,p]=u,h=typeof p==\"string\"?n.get(p):void 0;if(f===0){let g=a(u[2],h!==void 0),v=on(u[2])?u[2].id:void 0;if(h&&typeof v==\"string\"&&n.has(v)){let y=Number(u[3]);h.children.splice(Number.isInteger(y)&&y>=0&&y<=h.children.length?y:h.children.length,0,v)}return[f,re(p),g,re(u[3])]}if(f===1){let g=Number(u[2]);return h&&Number.isInteger(g)&&g>=0&&g<h.children.length&&s(h.children.splice(g,1)[0]),re(u)}if(f===3&&u[4]===3){let g=String(u[2]),v=u[3],y=h&&typeof v==\"function\"?o(v):void 0,b=h?.listeners.get(g);return b!==void 0&&i(b),y===void 0?h?.listeners.delete(g):h.listeners.set(g,y),[f,re(p),g,y===void 0?void 0:{listener:y},3]}return re(u)};return{encode:u=>u.map(c),listener:u=>t.get(u)?.listener,get listening(){return t.size},get nodes(){return n.size-1}}}var sn=\"graview-view-root\",Do=t=>t.replace(/&/g,\"&\").replace(/</g,\"<\").replace(/>/g,\">\").replace(/\"/g,\""\").replace(/'/g,\"'\"),Lo=t=>Object.freeze({html:t,toString:()=>t}),zr=t=>typeof t==\"object\"&&t!==null&&typeof t.html==\"string\"&&Object.isFrozen(t),jr=t=>t==null||t===!1?\"\":Array.isArray(t)?t.map(jr).join(\"\"):zr(t)?t.html:Do(String(t));function Fr(t){customElements.get(sn)||customElements.define(sn,ct);let e=Event,n=Br(),r=new Set,o=new Set,i,s=[],a=new Set;for(let l of[\"closest\",\"matches\",\"dataset\"]){let E=()=>{throw new TypeError(`A view's element has no ${l}: graview.on hands event.element, the element its selector matched; read event.element.getAttribute(\"data-\\u2026\").`)};l in Element.prototype||Object.defineProperty(Element.prototype,l,l===\"dataset\"?{get:E}:{value:E})}let c=document.createElement(sn),u=l=>{let E=O=>{for(let T of Array.from(O.childNodes)){if(T.nodeType!==1)continue;if(ee(T)===l)return T;let R=E(T);if(R)return R}};return E(c)},f=l=>{let E=u(l.target);if(!E)return;let O=new e(l.event,{bubbles:!0});for(let T of[\"value\",\"checked\",\"key\",\"pressed\",\"files\",\"refused\"])l[T]!==void 0&&Object.defineProperty(O,T,{value:l[T],enumerable:!0});E.dispatchEvent(O);for(let T of o){if(T.type!==l.event)continue;let R;try{R=new Set(Array.from(c.querySelectorAll(T.selector)))}catch{continue}for(let A=E;A&&A!==c;A=A.parentNode)if(R.has(A)){T.listener(Object.freeze({type:l.event,target:E,element:A,...l.value!==void 0?{value:l.value}:{},...l.checked!==void 0?{checked:l.checked}:{},...l.key!==void 0?{key:l.key}:{},...l.pressed!==void 0?{pressed:l.pressed}:{},...l.files!==void 0?{files:l.files}:{},...l.refused!==void 0?{refused:l.refused}:{}}));break}}},p=l=>{if(l.type===\"dom-event\"&&typeof l.target==\"string\")return f(l);if(l.type===\"notice\")return t.warn(l.text);if(l.type!==\"props\")return;i=l.props;let E=t.now();for(let R of r)try{R(l.props)}catch(A){t.threw(A)}let O=t.now()-E,T=l.push;typeof T==\"number\"&&t.microtask(()=>t.microtask(()=>t.send({type:\"pushed\",push:T,ms:O})))},h;c.connect({mutate(l){h||(h=[],t.microtask(()=>{let E=h??[];h=void 0,t.send({type:\"render\",records:n.encode(E)})})),h.push(...l)},call:()=>{}});let g=l=>l.nodeType===1?l.getAttribute(\"data-key\")??l.getAttribute(\"id\"):null,v=(l,E)=>l.nodeType===E.nodeType&&(l.nodeType!==1||l.localName===E.localName&&l.namespaceURI===E.namespaceURI&&g(l)===g(E));function y(l,E){let O=Array.from(E.childNodes),T=0;for(let R of O){let A=l.childNodes[T]??null;if(A&&v(A,R)){b(A,R),T+=1;continue}if(g(R)!==null){let ce=Array.from(l.childNodes).slice(T+1).find(Ye=>v(Ye,R));if(ce){l.insertBefore(ce,A),b(ce,R),T+=1;continue}}l.insertBefore(R,A),T+=1}for(;l.childNodes.length>T;)l.removeChild(l.lastChild)}function b(l,E){if(l.nodeType!==1){l.data!==E.data&&(l.data=E.data);return}let O=l,T=E,R=k(O);for(let A of O.getAttributeNames())T.hasAttribute(A)||(O.removeAttribute(A),R&&be(O,A,void 0));for(let A of T.getAttributeNames()){let oe=T.getAttribute(A);O.getAttribute(A)!==oe&&O.setAttribute(A,oe),R&&be(O,A,oe)}y(O,T)}let k=l=>l.localName.includes(\"-\");function L(l){for(let E of Array.from(l.childNodes)){if(E.nodeType!==1)continue;let O=E;if(k(O))for(let T of O.getAttributeNames())be(O,T,O.getAttribute(T)??void 0);L(O)}}function N(l,E,O){for(let T of Array.from(l.childNodes)){if(T.nodeType!==1)continue;let R=T,A=R.localName,oe=E||A.toLowerCase()===\"svg\",ce=oe?Gr(A):Object.prototype.hasOwnProperty.call(Hn,A.toLowerCase())?A.toLowerCase():void 0;if(!ce){O.add(`<${A}>`);continue}for(let Ye of R.getAttributeNames())(!Ur(oe?\"svg\":\"html\",ce,Ye)||!oe&&Hr[ce]?.includes(Ye.toLowerCase()))&&O.add(`${ce} ${Ye}`);N(R,oe,O)}}function P(l){let E=document.createElement(\"div\"),O=Array.isArray(l)?l:[l];for(let R of O)if(R!=null)if(typeof R==\"string\"||zr(R)){let A=document.createElement(\"div\");A.innerHTML=typeof R==\"string\"?R:R.html,E.append(...Array.from(A.childNodes))}else E.append(R);let T=new Set;N(E,!1,T),s=[...T],s.length>0&&t.warn(`The host will not draw: ${s.join(\", \")}`),L(E),y(c,E)}let j;return{view:Object.freeze({get props(){return i},onProps(l){return r.add(l),i&&l(i),()=>void r.delete(l)},render:P,style(l){typeof l!=\"string\"||l===j||(j=l,t.send({type:\"style\",css:l}))},on(l,E,O){let T={type:l,selector:E,listener:O};return o.add(T),typeof l==\"string\"&&!a.has(l)&&(a.add(l),t.send({type:\"hears\",events:[l]})),()=>void o.delete(T)},act:(l,E={})=>t.act(l,E),navigate(l){if(typeof l==\"string\")return t.navigate(l);let E=tn(l);E&&t.send(E)},html(l,...E){return Lo(l.reduce((O,T,R)=>O+T+(R<E.length?jr(E[R]):\"\"),\"\"))},get refused(){return s},get hardening(){return t.hardening()}}),hear:p}}var Vn={removed:[],stuck:[],sealed:!1,worker:!1},Gn=Ar({listen(t){return Re.listen(t),()=>Re.unlisten(t)},fromHost:()=>!0,ready:t=>Re.post(t)},{onMessage:t=>qr.hear(t)}),qr=Fr({send:t=>Gn.send(t),act:(t,e)=>Gn.guest.act(t,e),navigate:t=>Gn.guest.navigate(t),microtask:Re.microtask,now:Re.now,threw:t=>console.error(t),warn:t=>console.warn(t),hardening:()=>Vn}),Ho=qr.view;Object.defineProperty(globalThis,\"graview\",{value:Ho,enumerable:!0,configurable:!0,writable:!1});var Un=\"WorkerGlobalScope\"in globalThis?Mr(globalThis,[\"graview\"]):Vn;Vn=Un;if(Un.stuck.length>0)throw new Error(`The view's worker could not be hardened: ${Un.stuck.join(\", \")} would not go.`);})();\n";
|
|
6
|
+
export const VIEW_RUNTIME = "\"use strict\";\n/*! @remote-dom/core and @remote-dom/polyfill — Copyright 2020-present, Shopify Inc. — MIT License.\n * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n * @graview/guest's worker runtime — Elastic License 2.0. */\n\"use strict\";(()=>{var Oe=globalThis,Kr=Oe.addEventListener,Zr=Oe.removeEventListener,Qr=Oe.postMessage,Jr=globalThis.queueMicrotask,un=globalThis.performance,eo=un?un.now.bind(un):Date.now,Re={listen:t=>Kr.call(Oe,\"message\",t),unlisten:t=>Zr.call(Oe,\"message\",t),post:t=>Qr.call(Oe,t),microtask:t=>Jr.call(globalThis,t),now:()=>eo()};var v=Symbol(\"name\"),ue=Symbol(\"prefix\"),de=Symbol(\"value\"),S=Symbol(\"ns\"),q=Symbol(\"owner\"),I=Symbol(\"owner_document\"),ne=Symbol(\"attributes\"),M=Symbol(\"prev\"),f=Symbol(\"next\"),R=Symbol(\"child\"),Y=Symbol(\"parent\"),me=Symbol(\"host\"),$=Symbol(\"data\"),Ee=Symbol(\"listeners\"),dn=Symbol(\"isTrusted\"),Ae=Symbol(\"path\"),_e=Symbol(\"stop_immediate_propagation\"),Pe=Symbol(\"dispatching\"),se=Symbol(\"content\"),D=Symbol(\"hooks\"),mt=Symbol(\"extensions\"),Ne=Symbol(\"hooks_dispatch\"),U=Symbol(\"is_connected\"),Ce=Symbol(\"create_element\"),qn=0,X=1,ke=2,Ie=3,Me=8,Te=9,Yn=10,fe=11,A=\"http://www.w3.org/1999/xhtml\",K=\"http://www.w3.org/2000/svg\",Wn=\"http://www.w3.org/XML/1998/namespace\",Xe=\"http://www.w3.org/2000/xmlns/\";function ft(t){return t.split(/[\\t\\n\\f\\r ]+/).filter(Boolean)}function G(t){return t.replace(/[A-Z]/g,e=>String.fromCharCode(e.charCodeAt(0)+32))}function Xn(t){return t.replace(/[a-z]/g,e=>String.fromCharCode(e.charCodeAt(0)-32))}function C(t,e){let n=globalThis.DOMException;if(typeof n==\"function\")return new n(t,e);let r=new Error(t);return r.name=e,r}var $n=/^(?:[A-Za-z][^\\0\\t\\n\\f\\r\\u0020/>]*|[:_\\u0080-\\u{10FFFF}][A-Za-z0-9-.:_\\u0080-\\u{10FFFF}]*)$/u,Kn=/[\\0\\t\\n\\f\\r />=]/u,to=/[\\0\\t\\n\\f\\r />]/u;function ie(t){if(t==null)return null;let e=String(t);return e===\"\"?null:e}function Zn(t){$n.test(t)||fn(t)}function mn(t){(t===\"\"||Kn.test(t))&&fn(t)}function pt(t,e,n){let r=ie(t),o=String(e),s=o.indexOf(\":\"),i=s<0?null:o.slice(0,s),a=s<0?o:o.slice(s+1);if((i!=null&&(i===\"\"||to.test(i))||(n===\"element\"?!$n.test(a):a===\"\"||Kn.test(a)))&&fn(o),i!=null&&r==null)throw C(`A namespace is required for the prefix in \"${o}\"`,\"NamespaceError\");if(i===\"xml\"&&r!==Wn)throw C(\"The xml prefix requires the XML namespace\",\"NamespaceError\");if((o===\"xmlns\"||i===\"xmlns\")&&r!==Xe)throw C(\"The xmlns name requires the XMLNS namespace\",\"NamespaceError\");if(r===Xe&&o!==\"xmlns\"&&i!==\"xmlns\")throw C(\"The XMLNS namespace requires the xmlns name or prefix\",\"NamespaceError\");return{namespace:r,qualifiedName:o,prefix:i,localName:a}}function fn(t){throw C(`Invalid name: \"${t}\"`,\"InvalidCharacterError\")}var ht=0,gt=1,Qn=2,pn=3,no=typeof performance>\"u\"?Date.now:performance.now.bind(performance),V=class{static NONE=ht;static CAPTURING_PHASE=gt;static AT_TARGET=Qn;static BUBBLING_PHASE=pn;timeStamp=no();target=null;currentTarget=null;srcElement=null;bubbles=!1;cancelable=!1;composed=!1;defaultPrevented=!1;cancelBubble=!1;eventPhase=ht;[Ae]=[];[_e]=!1;[Pe]=!1;constructor(e,n){this.type=e,Object.defineProperty(this,dn,{writable:!0,value:!1}),n&&(n.bubbles&&(this.bubbles=n.bubbles),n.cancelable&&(this.cancelable=n.cancelable),n.composed&&(this.composed=n.composed))}get isTrusted(){return this[dn]}composedPath(){return[...this[Ae]]}stopPropagation(){this.cancelBubble=!0}stopImmediatePropagation(){this[_e]=!0,this.cancelBubble=!0}preventDefault(){this.cancelable&&(this.defaultPrevented=!0)}set returnValue(e){e||this.preventDefault()}get returnValue(){return!this.defaultPrevented}initEvent(e,n,r){this.type=e,this.bubbles=!!n,this.cancelable=!!r}};function hn(t,e,n){if(t.cancelBubble)return;let o=e[Ee]?.get(t.type)?.[n===gt?\"capture\":\"bubble\"];if(o)for(let s of[...o]){if(!o.has(s)||s.signal?.aborted)continue;t.eventPhase=t.target===e?Qn:n,t.currentTarget=e;let i=s.normalizedListener;try{typeof i==\"object\"?i.handleEvent(t):i.call(e,t)}catch(a){setTimeout(ro,0,a)}if(t[_e])break}}function ro(t){throw t}var $e=[],yt=new WeakMap;function bt(t,e){let n=yt.get(t);n?n.push(e):yt.set(t,[e]),$e[$e.length-1].push(t)}function B(t){let e=[];$e.push(e);let n;try{n=t()}catch(r){$e.pop();try{Jn(e)}catch{}throw r}return $e.pop(),Jn(e),n}function Jn(t){let e,n=!1;for(let r of t){let o=yt.get(r);if(o){for(;o.length>0;){let s=o.shift();try{s()}catch(i){n||(e=i,n=!0)}}yt.delete(r)}}if(n)throw e}var Et=[],Ke=[],gn=!1;function we(t){for(let e of t)Et.push(e),e[1]&&Ke.push(e[1]);if(!gn){gn=!0;try{let e,n=!1;for(let r=0;r<Et.length;r++){let[o,s]=Et[r];s&&Ke.splice(Ke.indexOf(s),1);try{o()}catch(i){n||(e=i,n=!0)}}if(n)throw e}finally{Et.length=0,Ke.length=0,gn=!1}}}function Ze(t){let e=t;for(;e;){if(Ke.includes(e))return!0;e=e[Y]??e[me]}return!1}var Qe=Symbol(\"listenerRegistrations\"),pe=class{[Ee]=void 0;[Qe]=void 0;[I]=void 0;addEventListener(e,n,r){if(n==null)return;let o=r===!0||typeof r==\"object\"&&r.capture===!0,s=typeof r==\"object\"&&r.once===!0,i=typeof r==\"object\"?r.signal:void 0;if(i?.aborted)return;let a=yn(o),l=this[Qe];l||(l=new Map,this[Qe]=l);let c=l.get(e);c||(c={},l.set(e,c));let m=c[a];if(m||(m=new Map,c[a]=m),m.has(n))return;let p=this,h={type:e,listener:n,capture:o,once:s,normalizedListener:n,signal:i};(s||i)&&(h.normalizedListener=function(...k){if(h.signal?.aborted){Nt(p,h);return}return h.once&&Nt(p,h),typeof h.listener==\"object\"?h.listener.handleEvent(...k):h.listener.call(this,...k)});let g=this[Ee];g||(g=new Map,this[Ee]=g);let O=g.get(e);O||(O={},g.set(e,O));let b=O[a];if(b||(b=new Set,O[a]=b),m.set(n,h),b.add(h),i){let E=()=>{Nt(p,h)};h.abortListener=E,i.addEventListener(\"abort\",E,{once:!0})}this[I]?.defaultView[Ne].addEventListener?.(this,e,n,r)}removeEventListener(e,n,r){return oo.call(this,e,n,r)}dispatchEvent(e){if(e[Pe])throw C(\"Failed to execute 'dispatchEvent' on 'EventTarget': The event is already being dispatched.\",\"InvalidStateError\");e[Pe]=!0;try{let n=[],r=this;for(;r!=null;)n.push(r),r=r.parentNode;e.target=this,e.srcElement=this,e[Ae]=n;for(let s=n.length;s--;)if(hn(e,n[s],gt),e.cancelBubble)return!e.defaultPrevented;let o=e.bubbles?n:n.slice(0,1);for(let s=0;s<o.length;s++)if(hn(e,o[s],pn),e.cancelBubble)return!e.defaultPrevented;return!e.defaultPrevented}finally{e[Pe]=!1,e.cancelBubble=!1,e[_e]=!1,e.eventPhase=ht,e.currentTarget=null,e[Ae]=[]}}};function oo(t,e,n){if(e==null)return;let r=n===!0||n&&n.capture===!0,o=yn(!!r),s=this[Qe]?.get(t)?.[o]?.get(e);s&&Nt(this,s)}function yn(t){return t?\"capture\":\"bubble\"}function Nt(t,e){let n=yn(e.capture),r=t[Qe],o=r?.get(e.type);if(!o)return;let s=o[n];if(!s||s.get(e.listener)!==e)return;s.delete(e.listener),s.size===0&&delete o[n],!o.bubble&&!o.capture&&r?.delete(e.type),e.signal&&e.abortListener&&e.signal.removeEventListener(\"abort\",e.abortListener);let i=t[Ee],a=i?.get(e.type);if(!a)return;let l=a[n];l?.delete(e)&&(l.size===0&&delete a[n],!a.bubble&&!a.capture&&i?.delete(e.type),t[I]?.defaultView[Ne].removeEventListener?.(t,e.type,e.listener,e.capture))}var Z=class extends Array{item(e){return this[e]??null}};var et=0,er=1,Nn=2,Tn=3,tt=4,tr=0,nr=1,xt=2,vt=3,rr=4,En=5,or=6,sr=7,Tt=/^(?:--|-?[A-Za-z_\\u0080-\\u{10FFFF}])[A-Za-z0-9_\\u0080-\\u{10FFFF}-]*$/u;function so(t,e){let n=1,r=null;for(let o=e;o<t.length;o++){let s=t[o];if(r){s===\"\\\\\"?o++:s===r&&(r=null);continue}if(s==='\"'||s===\"'\")r=s;else if(s===\"(\")n++;else if(s===\")\"&&--n===0)return[t.slice(e,o),o+1]}return[t.slice(e),t.length]}function W(t){throw C(`Invalid or unsupported selector: \"${t}\"`,\"SyntaxError\")}function St(t,e){let n=typeof e==\"string\"?nt(e):[{combinator:tt,matchers:e}],r=null,o=t[R];return o&&n[0].matchers.length&&wn(o,n,s=>(r=s,!1)),r}function Ot(t,e){let n=typeof e==\"string\"?nt(e):[{combinator:tt,matchers:e}],r=new Z,o=t[R];return o&&n[0].matchers.length&&wn(o,n,s=>{r.push(s)}),r}function nt(t,e=!1,n=!1){let r={combinator:tt,matchers:[]},o=[r],s=/[\\t\\n\\f\\r ]*?([>\\t\\n\\f\\r +~]?)[\\t\\n\\f\\r ]*?(?:(?:\\[[\\t\\n\\f\\r ]*([^\\]=\\t\\n\\f\\r ]+)[\\t\\n\\f\\r ]*(?:=[\\t\\n\\f\\r ]*(?:(['\"])(.*?)\\3|([^\\]\\t\\n\\f\\r ]+)))?[\\t\\n\\f\\r ]*(?:\\]|$))|([#.]?)([^\\t\\n\\f\\r #.[>:+~()]+)|:(\\w+)(\\()?)/gi,i=t.replace(/^[\\t\\n\\f\\r ]+|[\\t\\n\\f\\r ]+$/g,\"\");i===\"\"&&W(t);let a=0,l;for(;l=s.exec(i);){l.index!==a&&W(t),l[1]&&(r.matchers.length===0&&!(n&&o.length===1)&&W(t),l[1]===\">\"?r.combinator=er:l[1]===\"+\"?r.combinator=Tn:l[1]===\"~\"?r.combinator=Nn:r.combinator=et,r={combinator:tt,matchers:[]},o.push(r));let c=l[8]?G(l[8]):l[2]||l[7];l[7]!=null&&!l[6]&&r.matchers.length>0&&W(t);let p,h=l[4]??l[5]??l[7];if(l[2]){Tt.test(c)||W(t);let g=l[5],O=g?.[0];if(l[3]==null&&(O==='\"'||O===\"'\")){let b=l[0].lastIndexOf(g);h=i.slice(l.index+b+1),s.lastIndex=i.length}else g!=null&&!Tt.test(g)&&W(t);p=rr}else l[6]?(Tt.test(c)||W(t),p=l[6]===\"#\"?xt:vt):l[8]?p=l[9]==null?En:or:l[7]===\"*\"?p=tr:l[7]&&Tt.test(l[7])?p=nr:W(t);l[9]?([h,s.lastIndex]=so(i,s.lastIndex),c!==\"has\"&&c!==\"not\"&&W(t),c===\"has\"&&e&&W(t),nt(h,e||c===\"has\",c===\"has\")):p===En&&W(t),r.matchers.push({type:p,name:c,value:h}),a=s.lastIndex}return(a!==i.length||r.matchers.length===0)&&W(t),o}function io(t,e){let n=nt(e);return n[0]?.matchers.length?Je(t,n):!1}function ao(t,e){let n=nt(e,!0,!0),r=n[0];if(n.length===1&&r.matchers.length===0)return!1;let o=et,s={type:sr,name:\":scope\"};if(r.matchers.length===0?(o=r.combinator,r.matchers.push(s)):n.unshift({combinator:et,matchers:[s]}),n.some(({matchers:l})=>l.length===0))return!1;let i=o===Tn||o===Nn?t[f]:t[R];if(!i)return!1;let a=!1;return wn(i,n,()=>(a=!0,!1),t),a}function wn(t,e,n,r){let o=[],s=t;for(;s;){if(j(s)){if(Je(s,e,r)&&n(s)===!1)return!1;let i=s[R];if(i){let a=s[f];a&&o.push(a),s=i;continue}}s=s[f]??o.pop()??null}return!0}function Je(t,e,n){let{combinator:r,matchers:o}=e[e.length-1];if(r===tt){if(!wt(t,o,n))return!1;let a=e.slice(0,-1);return a.length===0||Je(t,a,n)}let s=r===er||r===et?Y:M,i=t[s];if(!i)return!1;if(r===et||r===Nn){for(;i;){if(j(i)&&wt(i,o,n)){let a=e.slice(0,-1);if(a.length===0||Je(i,a,n))return!0}i=i[s]}return!1}else{if(r===Tn&&!j(i)){for(;i&&!j(i);)i=i[s];if(!i)return!1}if(!j(i)||!wt(i,o,n))return!1;let a=e.slice(0,-1);return a.length===0||Je(i,a,n)}}function bn(t,e){return t.getAttributeNS(null,t.namespaceURI===A?G(e):e)}function wt(t,e,n){if(!t)return!1;if(Array.isArray(e)){for(let i of e)if(wt(t,i,n)===!1)return!1;return!0}let{type:r,name:o,value:s}=e;switch(r){case tr:return o===\"*\";case nr:return t.namespaceURI===A?t.localName===G(o):t.localName===o;case xt:return bn(t,\"id\")===o;case vt:let i=bn(t,\"class\");return i?ft(i).includes(o):!1;case rr:let a=bn(t,o);return s==null?a!=null:a===s;case sr:return t===n;case En:W(`:${o}`);case or:switch(o){case\"has\":return ao(t,s||\"\");case\"not\":return!io(t,s||\"\");default:W(`:${o}(${s})`)}}return!1}function lo(t){return t.nodeType===ke}function rt(t){return $ in t}function vn(t){return t.nodeType===Ie}function co(t){return t.nodeType===Me}function j(t){return t.nodeType===X}function xn(t){return t.nodeType===fe}function cr(t){return\"appendChild\"in t}function Rt(t){let e=[],n=[t],r=new Set(n),o=new Set,s;for(;n.length>0;){let i=n.pop();if(r.delete(i),o.has(i))continue;let a=[];for(let l of st(i)){if(o.has(l)||(o.add(l),e.push(l),a.push(l),!j(l)))continue;let c=l[ne];if(c)for(let p of c)o.has(p)||(o.add(p),e.push(p));let m=l[se];m&&!o.has(m)&&!r.has(m)&&(r.add(m),n.push(m))}s??=a}return{nodes:e,treeNodes:s}}function ot(t,e){for(let n of t)n[I]=e}function ir(t,e){let n=t.constructor,r=new n(t.name,t.value,t.namespaceURI);return r[I]=e,r}function ar(t,e){if(vn(t))return e.createTextNode(t.data);if(co(t))return e.createComment(t.data);if(lo(t))return ir(t,e);if(j(t)){let n=e[Ce](t[v],t.namespaceURI,t[ue],t.localName);if(t[ne])for(let r=0;r<t[ne].length;r++){let o=t[ne].item(r);n.attributes.setNamedItem(ir(o,e))}return n}else{if(xn(t))return e.createDocumentFragment();{let n=new t.constructor;return n[I]=e,n}}}function At(t,e,n=t.ownerDocument){if(t.nodeType===Te)throw C(\"Cannot clone a document node\",\"NotSupportedError\");let r=ar(t,n);if(!e||!j(t)&&!xn(t))return r;let o=new Set([t]),s=[{source:t,destination:r,childIndex:0,cloningContent:!1}];for(;s.length>0;){let i=s[s.length-1],a,l;if(i.cloningContent)if(i.contentSource&&i.contentDestination)a=i.contentSource.childNodes[i.childIndex++],l=i.contentDestination;else{s.pop(),i.appendTo&&i.appendTo.appendChild(i.destination);continue}else if(a=i.source.childNodes[i.childIndex++],l=i.destination,!a){if(i.cloningContent=!0,i.childIndex=0,j(i.source)&&i.source.namespaceURI===A&&i.source.localName===\"template\"){let m=i.source[se];m&&(o.has(m)&&lr(),o.add(m),i.contentSource=m,i.contentDestination=i.destination.content)}continue}if(!a){s.pop(),i.appendTo&&i.appendTo.appendChild(i.destination);continue}o.has(a)&&lr(),o.add(a);let c=ar(a,n);j(a)||xn(a)?s.push({source:a,destination:c,appendTo:l,childIndex:0,cloningContent:!1}):l.appendChild(c)}return r}function lr(){throw new Error(\"Cannot clone a cyclic or repeated node graph\")}function _t(t,e){let n=String(e);return n===\"\"?null:St(t,[{type:xt,name:n}])}function Pt(t,e){let n=[...new Set(ft(String(e)))];return Ot(t,n.map(r=>({type:vt,name:r})))}function Ct(t,e){let n=String(e),r=G(n),o=[];for(let s of kt(t))j(s)&&(n===\"*\"||(s.namespaceURI===A?s[v]===r:s[v]===n))&&o.push(s);return o}function kt(t){let e=[],n=[],r=t[R];for(;r;){e.push(r);let o=r[R],s=r[f];o?(s&&n.push(s),r=o):r=s??n.pop()??null}return e}function st(t){let e=kt(t);return e.unshift(t),e}var Q=class extends pe{nodeType=qn;[v]=\"\";[Y]=null;[me]=null;[R]=null;[M]=null;[f]=null;[U]=!1;get[D](){return this[I].defaultView[Ne]}get localName(){return this[v]}get nodeName(){return this[v]}get ownerDocument(){return this[I]}get isConnected(){return this[U]}isDefaultNamespace(e){let n=ie(e);return uo(this)===n}get parentNode(){return this[Y]}set parentNode(e){}get parentElement(){let e=this[Y];return!e||e.nodeType!==1?null:e}set parentElement(e){}get previousSibling(){return this[M]}set previousSibling(e){}get nextSibling(){return this[f]}set nextSibling(e){}get previousElementSibling(){let e=this[M];for(;e&&e.nodeType!==1;)e=e[M];return e}set previousElementSibling(e){}get nextElementSibling(){let e=this[f];for(;e&&e.nodeType!==1;)e=e[f];return e}set nextElementSibling(e){}get firstChild(){return this[R]}set firstChild(e){}get lastChild(){let e=this[R];for(;e;){let n=e[f];if(n==null)break;e=n}return e}set lastChild(e){}get nodeValue(){return rt(this)?this.data:null}set nodeValue(e){rt(this)&&(this.data=e)}get textContent(){if(rt(this))return this.data;let e=\"\";for(let n of kt(this))vn(n)&&(e+=n.data);return e}set textContent(e){if(rt(this))this.data=e;else if(cr(this)){let n=e==null?\"\":String(e);n===\"\"?this.replaceChildren():this.replaceChildren(n)}}cloneNode(e){return At(this,e)}contains(e){let n=e;for(;n!=null;){if(n===this)return!0;n=n.parentNode}return!1}};function uo(t){let e=t;for(;e;)switch(e.nodeType){case X:{let n=e;if(n.prefix==null&&n.namespaceURI!=null)return n.namespaceURI;let r=n.attributes.getNamedItemNS(Xe,\"xmlns\");if(r!=null&&r.prefix==null)return ie(r.value);e=n.parentElement;break}case Te:e=e.documentElement;break;case Yn:case fe:return null;case ke:e=e.ownerElement;break;default:e=e.parentElement}return null}var J=Symbol(\"insertNode\"),Rn=Symbol(\"preflightInsertions\"),It=Symbol(\"replaceNode\"),he=class extends Q{remove(){let e=this.parentNode;e&&e.removeChild(this)}replaceWith(...e){let n=xe(e),r=this.parentNode;if(r)return Sn(o=>{ae(r,n);let s=this[f];for(;s&&n.includes(s);)s=s[f];let i=On(r,n,o);this.parentNode===r?r[It](i,this,o):r[J](i,s,o)})}before(...e){let n=xe(e),r=this.parentNode;if(r)return Sn(o=>{ae(r,n);let s=this[M];for(;s&&n.includes(s);)s=s[M];let i=On(r,n,o);r[J](i,s?s[f]:r.firstChild,o)})}after(...e){let n=xe(e),r=this.parentNode;if(r)return Sn(o=>{ae(r,n);let s=this[f];for(;s&&n.includes(s);)s=s[f];let i=On(r,n,o);r[J](i,s,o)})}};function Sn(t){return B(()=>{let e=[];try{t(e)}catch(n){try{we(e)}catch{}throw n}we(e)})}function xe(t){return t.map(e=>e instanceof Q?e:String(e))}function it(t,e){return e instanceof Q?e:t.ownerDocument.createTextNode(String(e))}function ae(t,e){for(let n of e){if(!(n instanceof Q))continue;let r=t;for(;r;){if(r===n)throw C(\"Cannot insert a node into itself or one of its descendants\",\"HierarchyRequestError\");r=r[Y]??r[me]}}}function On(t,e,n){let r=[];for(let s of e)r.push(it(t,s));if(r.length===1)return r[0];let o=t.ownerDocument.createDocumentFragment();o[Rn](r);for(let s of r)o[J](s,null,n);return o}var Mt,An=0,ur=0,dr=0,mr=0,De=!1,Pn=!1,at=!1,Dt=class{#t;#n=[];#e=new Set;#r=!1;constructor(e){if(typeof e!=\"function\")throw new TypeError(\"MutationObserver callback must be a function\");this.#t=e}observe(e,n={}){let r=mo(n),o=Mt??=new WeakMap,s=o.get(e);s==null&&(s=new Map,o.set(e,s));let i=s.get(this);i==null?An++:_n(i,-1),s.set(this,r),_n(r,1),this.#e.add(e)}disconnect(){let e=Mt;if(e!=null){for(let n of this.#e){let r=e.get(n),o=r?.get(this);o!=null&&(r.delete(this),An--,_n(o,-1)),r?.size===0&&e.delete(n)}this.#e.clear(),this.#n.length=0,An===0&&(Mt=void 0)}}takeRecords(){return this.#n.splice(0)}enqueue(e){this.#n.push(e),!this.#r&&(this.#r=!0,queueMicrotask(()=>{this.#r=!1;let n=this.takeRecords();n.length>0&&this.#t.call(this,n,this)}))}};function ee(t){let e=Mt;if(e==null)return;let n=new Map,r=t.target;for(;r;){let o=e.get(r);if(o)for(let[s,i]of o){if(r!==t.target&&!i.subtree)continue;let a=!1;if(t.type===\"attributes\"){if(!i.attributes||i.attributeFilter&&!i.attributeFilter.has(t.attributeName??\"\"))continue;a=i.attributeOldValue}else if(t.type===\"characterData\"){if(!i.characterData)continue;a=i.characterDataOldValue}else if(!i.childList)continue;n.set(s,n.get(s)===!0||a)}r=r.parentNode}for(let[o,s]of n)o.enqueue({addedNodes:t.addedNodes??new Z,attributeName:t.attributeName??null,attributeNamespace:t.attributeNamespace??null,nextSibling:t.nextSibling??null,oldValue:s?t.oldValue??null:null,previousSibling:t.previousSibling??null,removedNodes:t.removedNodes??new Z,target:t.target,type:t.type})}function Lt(...t){let e=new Z;return e.push(...t),e}function mo(t){if(t.attributes===!1&&(t.attributeOldValue||t.attributeFilter!=null))throw new TypeError(\"attributeOldValue and attributeFilter require attributes to be enabled\");if(t.characterData===!1&&t.characterDataOldValue)throw new TypeError(\"characterDataOldValue requires characterData to be enabled\");let e=t.attributes??(t.attributeOldValue===!0||t.attributeFilter!=null),n=t.characterData??t.characterDataOldValue===!0,r=t.childList===!0;if(!e&&!n&&!r)throw new TypeError(\"MutationObserver options must enable childList, attributes, or characterData\");return{attributes:e,attributeFilter:t.attributeFilter==null?void 0:new Set(t.attributeFilter.map(String)),attributeOldValue:t.attributeOldValue===!0,characterData:n,characterDataOldValue:t.characterDataOldValue===!0,childList:r,subtree:t.subtree===!0}}function _n(t,e){t.attributes&&(ur+=e),t.characterData&&(dr+=e),t.childList&&(mr+=e),De=ur>0,Pn=dr>0,at=mr>0}var re=class extends he{childNodes=new Z;children=new Z;appendChild(e){return B(()=>this[J](e,null))}insertBefore(e,n){return B(()=>this[J](e,n||null))}append(...e){return B(()=>{let n=xe(e.filter(r=>r!=null));n.length>1&&ae(this,n);for(let r of n)this[J](it(this,r),null)})}prepend(...e){return B(()=>{let n=xe(e.filter(o=>o!=null));n.length>1&&ae(this,n);let r=this.firstChild;for(let o of n)this[J](it(this,o),r)})}replaceChildren(...e){return B(()=>{let n=xe(e.filter(o=>o!=null));ae(this,n);let r;for(;r=this.firstChild;)this.removeChildImmediately(r);for(let o of n)this[J](it(this,o),null)})}removeChild(e){return B(()=>(this.removeChildImmediately(e),e))}removeChildImmediately(e){if(e.parentNode!==this)throw C(\"The node is not a child of this node\",\"NotFoundError\");let n=this[U]?st(e):void 0,r=e[M],o=e[f],s=Gt(this,e);if(n)for(let i of n)i[U]=!1;this.queueRemovalMutationRecord(this,e,r,o),n&&this.enqueueTreeReactions(n,\"disconnectedCallback\"),we(this.collectRemovalHookEffects(e,s))}replaceChild(e,n){return B(()=>this[It](e,n))}[It](e,n,r){if(ae(this,[e]),n.parentNode!==this)throw C(\"The reference node is not a child of this parent\",\"NotFoundError\");let o=n[M],s=n[f],i=this.prepareInsertion(e),a=this[U]?st(n):void 0,l=new Set(i.map(({node:h})=>h)),c=s;for(;c&&l.has(c);)c=c[f];let m=Gt(this,n);if(a){for(let g of a)g[U]=!1;let h=new Set(a);for(let g of i)h.has(g.node)&&(g.shouldDisconnect=!1)}this.commitInsertion(i,c);let p=this[U];return this.queueRemovalMutationRecord(this,n,o,s),this.queueInsertionMutationRecords(i),a&&this.enqueueTreeReactions(a,\"disconnectedCallback\"),this.enqueueInsertionReactions(i,p),this.performOrCollectHookEffects([...this.collectRemovalHookEffects(n,m),...this.collectInsertionHookEffects(i)],r),n}querySelectorAll(e){return Ot(this,e)}querySelector(e){return St(this,e)}[J](e,n,r){return this.validateInsertion(e,n),this.insertIntoValidated(e,n,r),e}[Rn](e){for(let n of e)this.validateInsertion(n,null),this.prepareInsertion(n)}validateInsertion(e,n){if(ae(this,[e]),n&&n.parentNode!==this)throw C(\"The reference node is not a child of this parent\",\"NotFoundError\")}insertIntoValidated(e,n,r){e===n&&(n=e[f]);let o=this.prepareInsertion(e);this.commitInsertion(o,n);let s=this[U];this.queueInsertionMutationRecords(o),this.enqueueInsertionReactions(o,s),this.performOrCollectHookEffects(this.collectInsertionHookEffects(o),r)}performOrCollectHookEffects(e,n){n?n.push(...e):we(e)}prepareInsertion(e){let n=[];if(e.nodeType===fe){let i=e[R];for(;i;)n.push(i),i=i[f]}else n.push(e);let r=this[U],o=this[I],s=[];for(let i of n){let a=i[U],l=a||r,c,m;if(i[I]===o)l&&(c=st(i));else{let p=Rt(i);m=p.nodes,l&&(c=p.treeNodes)}s.push({node:i,nodes:c,adoption:m,shouldDisconnect:a})}return s}commitInsertion(e,n){for(let s of e){let i=s.node[Y];if(i){let a=s.node[M],l=s.node[f];s.source={parent:i,index:Gt(i,s.node),previousSibling:a,nextSibling:l}}}for(let s of e){let i=this.attachChild(s.node,n);s.insertIndex=i.index,s.previousSibling=i.previousSibling,s.nextSibling=i.nextSibling}let r=this[I];for(let{adoption:s}of e)s&&ot(s,r);let o=this[U];for(let{nodes:s}of e)if(s)for(let i of s)i[U]=o}attachChild(e,n){if(n){let s=n[M];e[f]=n,e[M]=s,s?s[f]=e:this[R]=e,n[M]=e}else{e[f]=null;let s=this[R];if(s){let i;for(;i=s[f];)s=i;s[f]=e,e[M]=s}else this[R]=e,e[M]=null}let r=j(e);e[Y]=this;let o;if(n){if(o=this.childNodes.indexOf(n),this.childNodes.splice(o,0,e),r){let s=n;for(;s&&!j(s);)s=s[f];s?this.children.splice(this.children.indexOf(s),0,e):this.children.push(e)}}else o=this.childNodes.length,this.childNodes.push(e),r&&this.children.push(e);return{index:o,previousSibling:e[M],nextSibling:e[f]}}queueRemovalMutationRecord(e,n,r,o){at&&ee({type:\"childList\",target:e,removedNodes:Lt(n),previousSibling:r,nextSibling:o})}queueInsertionMutationRecords(e){if(at)for(let n of e){let{node:r,source:o}=n;o&&this.queueRemovalMutationRecord(o.parent,r,o.previousSibling,o.nextSibling),ee({type:\"childList\",target:this,addedNodes:Lt(r),previousSibling:n.previousSibling,nextSibling:n.nextSibling})}}collectRemovalHookEffects(e,n){return this.nodeType!==X||Ze(this)?[]:[[()=>this[D].removeChild?.(this,e,n)]]}collectInsertionHookEffects(e){let n=[];for(let r of e){let{node:o,source:s}=r;s?.parent.nodeType===X&&!Ze(s.parent)&&n.push([()=>s.parent[D].removeChild?.(s.parent,o,s.index)]),this.nodeType===X&&!Ze(this)&&n.push([()=>this[D].insertChild?.(this,o,r.insertIndex),o])}return n}enqueueInsertionReactions(e,n){for(let r of e){let{nodes:o}=r;o&&(r.shouldDisconnect&&this.enqueueTreeReactions(o,\"disconnectedCallback\"),n&&this.enqueueTreeReactions(o,\"connectedCallback\"))}}enqueueTreeReactions(e,n){pr(e,n)}};function fr(t,e,n,r){if(e.parentNode!==t)throw Error(\"not a child of this node\");let o=t[U]?n.treeNodes:void 0,s=e[M],i=e[f],a=Gt(t,e);if(o)for(let c of o)c[U]=!1;ot(n.nodes,r),at&&ee({type:\"childList\",target:t,removedNodes:Lt(e),previousSibling:s,nextSibling:i}),o&&pr(o,\"disconnectedCallback\");let l=[];t.nodeType===X&&!Ze(t)&&l.push([()=>t[D].removeChild?.(t,e,a)]),we(l)}function Gt(t,e){let n=e[M],r=e[f];n?n[f]=r:t[R]=r,r&&(r[M]=n);let o=t.childNodes.indexOf(e);return t.childNodes.splice(o,1),j(e)&&t.children.splice(t.children.indexOf(e),1),e[Y]=null,e[f]=null,e[M]=null,o}function pr(t,e){for(let n of t){let r=n[e];typeof r==\"function\"&&bt(n,()=>r.call(n))}}function lt(t,e,n,r,o){let{observedAttributes:s}=t.constructor,{attributeChangedCallback:i}=t;i==null||s==null||!s.includes(e)||bt(t,()=>i.call(t,e,n,r,o))}var Ht=class{[R]=null;constructor(e){this[q]=e}getNamedItem(e){let n=String(e),r=this[q][S]===A?G(n):n,o=this[R];for(;o;){if(o.name===r)return o;o=o[f]}return null}getNamedItemNS(e,n){let r=ie(e),o=String(n),s=this[R];for(;s;){if(s.localName===o&&s[S]===r)return s;s=s[f]}return null}item(e){let n=this[R],r=0;for(;n;){if(r++===e)return n;n=n[f]}return null}get length(){let e=0,n=this[R];for(;n;)e++,n=n[f];return e}removeNamedItem(e){let n=String(e),r=this[q][S]===A?G(n):n;return B(()=>this.removeNamedItemImmediately(o=>o.name===r))}removeNamedItemNS(e,n){let r=ie(e),o=String(n);return B(()=>this.removeNamedItemImmediately(s=>s.localName===o&&s[S]===r))}removeNamedItemImmediately(e){let n=this[q],r=this[R],o=null;for(;r!=null;){if(e(r)){o&&(o[f]=r[f]),this[R]===r&&(this[R]=r[f]);let s=r.value;return r[f]=null,r[q]=null,De&&ee({type:\"attributes\",target:n,attributeName:r.name,attributeNamespace:r[S],oldValue:s}),n[D].removeAttribute?.(n,r.name,r[S]),lt(n,r.localName,s,null,r[S]),r}o=r,r=r[f]}return null}setNamedItem(e){return B(()=>this.setNamedItemImmediately(e))}setNamedItemImmediately(e){let n=this[q],r=e[q];if(r!=null&&r!==n)throw C(\"The attribute is already in use by another element.\",\"InUseAttributeError\");let o=null,s=this[R],i=null;for(;s;){if(s.localName===e.localName&&s[S]===e[S]){if(s===e)return s;i?i[f]=e:this[R]=e,e[f]=s[f],s[f]=null,o=s;break}i=s,s=s[f]}o==null&&(i?i[f]=e:this[R]=e),e[q]=n,e[I]=n[I],o&&(o[q]=null);let a=o==null||o.value!==e.value,l=o!=null&&o.name!==e.name;return a&&De&&ee({type:\"attributes\",target:n,attributeName:e.name,attributeNamespace:e[S],oldValue:o?.value??null}),l&&n[D].removeAttribute?.(n,o.name,o[S]),(a||l)&&n[D].setAttribute?.(n,e.name,e.value,e[S]),a&<(n,e.localName,o?.value??null,e.value,e[S]),o}setNamedItemNS(e){return this.setNamedItem(e)}*[Symbol.iterator](){let e=this[R];for(;e;)yield e,e=e[f]}};var ve=class extends Q{nodeType=ke;[S]=null;[f]=null;[q]=null;constructor(e,n,r){super(),this[v]=e,this[de]=n,r&&(this[S]=r)}get nodeName(){return this[v]}set nodeName(e){}get name(){return this[v]}set name(e){}get localName(){if(this[S]==null)return this[v];let e=this[v].indexOf(\":\");return e<0?this[v]:this[v].slice(e+1)}get prefix(){if(this[S]==null)return null;let e=this[v].indexOf(\":\");return e<0?null:this[v].slice(0,e)}get value(){return this[de]}set value(e){let n=String(e),r=this[q];if(!r){this[de]=n;return}B(()=>{let o=this[de];this[de]=n,De&&o!==n&&ee({type:\"attributes\",target:r,attributeName:this[v],attributeNamespace:this[S],oldValue:o}),this[D].setAttribute?.(r,this[v],n,this[S]),lt(r,this.localName,o,n,this[S])})}get nodeValue(){return this.value}set nodeValue(e){this.value=e}get ownerElement(){return this[q]}get namespaceURI(){return this[S]}get specified(){return!0}};var fo={amp:\"&\",AMP:\"&\",apos:\"'\",gt:\">\",GT:\">\",lt:\"<\",LT:\"<\",quot:'\"',QUOT:'\"'},po=new Set([\"area\",\"base\",\"br\",\"col\",\"embed\",\"hr\",\"img\",\"input\",\"link\",\"meta\",\"param\",\"source\",\"track\",\"wbr\"]),ho=/(?:<([a-z][a-z0-9-:]*)((?:[\\s]+[^<>'\"=/\\s]+(?:=(['\"])[^]*?\\3|=[^>'\"\\s]*|))*)[\\s]*(\\/?)\\s*>|<\\/([a-z][a-z0-9-:]*)>|<!--(.*?)-->|([^<>]+))/gi,yr=/\\s([^<>'\"=/\\n\\s]+)(?:=([\"'])([\\s\\S]*?)\\2|=([^>'\"\\n\\s]*)|)/g,go=\"|b|big|blockquote|body|br|center|code|dd|div|dl|dt|em|embed|h1|h2|h3|h4|h5|h6|head|hr|i|img|li|listing|menu|meta|nobr|ol|p|pre|ruby|s|small|span|strong|strike|sub|sup|table|tt|u|ul|var|\",yo=/^(?:color|face|size)$/i;function hr(t){return t.replace(/&(?:(amp|AMP|apos|gt|GT|lt|LT|quot|QUOT)|#(\\d+)|#[xX]([\\da-fA-F]+));/g,(e,n,r,o)=>{if(n)return fo[n];let s=Number.parseInt(r??o,r?10:16);try{return String.fromCodePoint(s)}catch{return e}})}function br(t){return t.namespaceURI===A&&po.has(t.localName)}function gr(t){let e=t.localName;return t[S]===K&&(e===\"foreignObject\"||e===\"desc\"||e===\"title\")}function bo(t,e){if(go.includes(`|${t}|`))return!0;if(t!==\"font\")return!1;for(let n of e.matchAll(yr))if(yo.test(n[1]))return!0;return!1}function Ut(t,e){let n=e.ownerDocument,r=n.createDocumentFragment(),o=[],s=r;for(let i of t.matchAll(ho)){let a=i[1];if(a){let l=i[2],c=G(a),m=o[o.length-1]?.element??e,p=m[S]===K?K:A;if(c===\"svg\")p=K;else if(p===K){if(gr(m))p=A;else if(bo(c,l)){for(;o.length>0;){let O=o[o.length-1];if(O.element[S]!==K||gr(O.element))break;o.pop(),s=O.target}p=A}}let h=p===A?c:a,g=n[Ce](h,p,null,h);for(let O of l.matchAll(yr))g.setAttribute(O[1],hr(O[3]||O[4]||\"\"));if(s.append(g),br(g)||p!==A&&i[4])continue;o.push({element:g,target:s}),s=p===A&&c===\"template\"?g.content:g}else if(i[5]){let l=G(i[5]);for(let c=o.length-1;c>=0;c--){let m=o[c],p=G(m.element[v]);if(p===l){s=m.target,o.length=c;break}if(m.element[S]===A&&p===\"template\")break}}else i[6]?s.append(n.createComment(i[6])):s.append(hr(i[7]))}return r}function Vt(t){return Nr([{type:\"content\",child:t[R]}])}function Er(t){return Nr([{type:\"opening\",node:t}])}function Nr(t){let e=[],n;for(;n=t.pop();)switch(n.type){case\"opening\":{let r=n.node;switch(r.nodeType){case X:{let o=r;e.push(`<${o[v]}`);let s=o[ne]?.[R];for(;s;){e.push(` ${s[v]}`);let a=s[de];a!==\"\"&&(a=String(a).replace(/&/g,\"&\").replace(/\"/g,\""\"),e.push(`=\"${a}\"`)),s=s[f]}if(e.push(\">\"),br(o))break;let i=o.namespaceURI===A&&o.localName===\"template\"?o[se]:o;t.push({type:\"closing\",name:o[v]}),t.push({type:\"content\",child:i?.[R]??null});break}case Ie:{let o=r;e.push(o[$].replace(/&/g,\"&\").replace(/\"/g,\""\").replace(/</g,\"<\").replace(/>/g,\">\"));break}case Me:{let o=r;e.push(`<!--${o[$]}-->`);break}}break}case\"content\":{let r=n.child;r&&(t.push({type:\"content\",child:r[f]}),t.push({type:\"opening\",node:r}));break}case\"closing\":e.push(`</${n.name}>`);break}return e.join(\"\")}var H=class extends re{nodeType=X;[S]=A;[ue]=null;get namespaceURI(){return this[S]}get prefix(){return this[ue]}get localName(){let e=this[ue];return e==null?this[v]:this[v].slice(e.length+1)}get nodeName(){return this[S]===A?Xn(this[v]):this[v]}get tagName(){return this.nodeName}get id(){return this.getAttributeNS(null,\"id\")??\"\"}set id(e){this.setAttribute(\"id\",String(e))}get slot(){return this.getAttributeNS(null,\"slot\")??\"\"}set slot(e){let n=String(e);this.getAttributeNS(null,\"slot\")!==n&&this.attributes.setNamedItem(new ve(\"slot\",n))}get attributes(){let e=this[ne];return e||(e=new Ht(this),this[ne]=e),e}getAttributeNames(){return[...this.attributes].map(e=>e.name)}getElementsByTagName(e){return Ct(this,e)}get firstElementChild(){return this.children[0]??null}getElementsByClassName(e){return Pt(this,e)}get lastElementChild(){return this.children[this.children.length-1]??null}get nextElementSibling(){let e=this.nextSibling;for(;e&&e.nodeType!==1;)e=e.nextSibling;return e}get previousElementSibling(){let e=this.previousSibling;for(;e&&e.nodeType!==1;)e=e.previousSibling;return e}setAttribute(e,n){let r=String(e),o=String(n);mn(r);let s=this[S]===A?G(r):r,i=this.attributes.getNamedItemNS(null,s);i?i.value=o:this.attributes.setNamedItem(new ve(s,o))}setAttributeNS(e,n,r){let o=ie(e),s=String(n),i=String(r),a=pt(o,s,\"attribute\"),l=this.attributes.getNamedItemNS(a.namespace,a.localName);l?l.value=i:this.attributes.setNamedItemNS(new ve(a.qualifiedName,i,a.namespace))}toggleAttribute(e,n){let r=String(e);mn(r);let o=this[S]===A?G(r):r,s=this.attributes.getNamedItemNS(null,o),i=n===void 0?void 0:!!n;return s==null?i===!1?!1:(this.attributes.setNamedItem(new ve(o,\"\")),!0):i===!0?!0:(this.attributes.removeNamedItemNS(null,o),!1)}getAttribute(e){let n=this.attributes.getNamedItem(e);return n&&n.value}getAttributeNS(e,n){let r=this.attributes.getNamedItemNS(e,n);return r&&r.value}hasAttribute(e){return this.attributes.getNamedItem(e)!=null}hasAttributeNS(e,n){return this.attributes.getNamedItemNS(e,n)!=null}removeAttribute(e){let n=String(e),r=this[S]===A?G(n):n;this.attributes.removeNamedItemNS(null,r)}removeAttributeNS(e,n){this.attributes.removeNamedItemNS(e,n)}get outerHTML(){return Er(this)}get innerHTML(){return Vt(this)}set innerHTML(e){if(e==null||e===\"\")this.replaceChildren();else{let n=Ut(String(e),this);this.replaceChildren(n)}}};var Le=class t extends H{[S]=K;get ownerSVGElement(){let e=null,n=this.parentNode;for(;n instanceof t;)e=n,n=n.parentNode;return e}};var ge=class extends he{[$]=\"\";constructor(e){super(),this[$]=e==null?\"\":String(e)}setData(e){let n=Pn,r=n?this[$]:null,o=\"\";e!=null&&(o=typeof e==\"string\"?e:String(e)),this[$]=o,n&&r!==o&&ee({type:\"characterData\",target:this,oldValue:r}),this[D].setText?.(this,o)}get data(){return this[$]}set data(e){this.setData(e)}};var Ge=class extends ge{nodeType=Ie;[v]=\"#text\"};var He=class extends ge{nodeType=Me;[v]=\"#comment\"};var Ue=class extends re{nodeType=fe;[v]=\"#document-fragment\";[I]=typeof window<\"u\"?window.document:null;getElementById(e){return _t(this,e)}};var Ve=class extends H{get content(){let e=this[se];return e||(e=this.ownerDocument.createDocumentFragment(),e[me]=this,this[se]=e),e}set content(e){}set innerHTML(e){this.content.replaceChildren(Ut(String(e),this))}get innerHTML(){let e=this[se];return e?Vt(e):\"\"}};var Bt=class extends H{};var zt=class extends H{};var jt=class extends H{};var ct=class extends re{nodeType=Te;[v]=\"#document\";[U]=!0;constructor(e){super(),this.defaultView=e,this[I]=this,this.documentElement=qt(new jt,this,\"html\"),this.body=qt(new Bt,this,\"body\"),this.head=qt(new zt,this,\"head\"),this.appendChild(this.documentElement),this.documentElement.appendChild(this.head),this.documentElement.appendChild(this.body)}get textContent(){return null}set textContent(e){}getElementsByClassName(e){return Pt(this,e)}createElement(e){let n=String(e);return Zn(n),Cn(this,G(n))}createElementNS(e,n){let r=pt(e,n,\"element\");return Cn(this,r.qualifiedName,r.namespace,r.prefix,r.localName)}[Ce](e,n,r,o){return Cn(this,e,n,r,o)}createTextNode(e){let n=Ft(new Ge(e),this);return this[D].createText?.(n,n.data),n}createComment(e){return Ft(new He(e),this)}createDocumentFragment(){return Ft(new Ue,this)}createEvent(){return new V(\"\")}getElementById(e){return _t(this,e)}getElementsByTagName(e){return Ct(this,e)}importNode(e,n){if(e.nodeType===Te)throw C(\"Cannot import a document node\",\"NotSupportedError\");return At(e,n,this)}adoptNode(e){if(e[I]===this)return e;let n=Rt(e);return B(()=>{let r=e.parentNode;return r?fr(r,e,n,this):ot(n.nodes,this),e})}};function Ft(t,e){return Object.defineProperty(t,I,{value:e,writable:!0,enumerable:!1}),t}function Cn(t,e,n=A,r=null,o=e){let s;if(n===K)s=new Le;else if(n===A&&o===\"template\")s=new Ve;else if(n===A){let i=t.defaultView.customElements.get(o);s=i?new i:new H}else s=new H;return qt(s,t,e,n,r)}function qt(t,e,n,r=A,o=null){return Ft(t,e),Object.defineProperties(t,{[v]:{value:n},[S]:{value:r},[ue]:{value:o}}),e[D].createElement?.(t,r),t}var Yt=class extends V{constructor(e,n){super(e,n),this.detail=n?.detail??null}initCustomEvent(e,n,r,o){super.initEvent(e,n,r),this.detail=o??null}};var Wt=class extends V{constructor(e,n){super(e,n),this.message=n.message,this.filename=n.filename,this.lineno=n.lineno,this.colno=n.colno,this.error=n.error}};var Xt=class extends V{constructor(e,n){super(e,n),this.promise=n.promise,this.reason=n.reason}};var $t=class extends V{constructor(e,n){super(e,n),this.oldState=n.oldState,this.newState=n.newState}};var Kt=class extends V{constructor(e,n={}){super(e,n),this.relatedTarget=n.relatedTarget??null}};var Zt=class extends V{constructor(e,n={}){super(e,n),this.clipboardData=n.clipboardData??null}};var Qt=class extends H{};var Eo=/^[a-z][^A-Z\\u0000\\t\\n\\f\\r />]*-[^A-Z\\u0000\\t\\n\\f\\r />]*$/u,No=new Set([\"annotation-xml\",\"color-profile\",\"font-face\",\"font-face-src\",\"font-face-uri\",\"font-face-format\",\"font-face-name\",\"missing-glyph\"]);function Tr(t){return Eo.test(t)&&!No.has(t)}function wr(t){return C(`Invalid custom element name: \"${t}\"`,\"SyntaxError\")}var Jt=class{registry=new Map;listenersByName=new Map;define(e,n,r){if(!Tr(e))throw wr(e);if(this.registry.has(e))throw C(`A custom element named \"${e}\" has already been defined`,\"NotSupportedError\");if(this.getName(n)!=null)throw C(\"This constructor has already been registered in this custom element registry\",\"NotSupportedError\");this.registry.set(e,n);let o=this.listenersByName.get(e);if(o!=null){this.listenersByName.delete(e);for(let s of o)s(n)}}get(e){return this.registry.get(e)}getName(e){for(let[n,r]of this.registry)if(r===e)return n;return null}whenDefined(e){if(!Tr(e))return Promise.reject(wr(e));let n=this.registry.get(e);if(n!=null)return Promise.resolve(n);let r=this.listenersByName.get(e);return r==null&&(r=[],this.listenersByName.set(e,r)),new Promise(o=>{r.push(o)})}upgrade(e){}initialize(e){}};var To=[\"onerror\",\"onunhandledrejection\"],vr=Symbol.for(\"@remote-dom/polyfill/global-property\");function Sr(t){return Object.getOwnPropertyDescriptors(t)}function Or(t){let e={};for(let[n,r]of Object.entries(Object.getOwnPropertyDescriptors(pe.prototype)))n!==\"constructor\"&&typeof r.value==\"function\"&&(r.value=kn(r.value.bind(t)),e[n]=r);return e}function Rr(t){let e={};for(let n of To)e[n]={configurable:!0,enumerable:!0,get:kn(()=>t[n]),set:kn(r=>{t[n]=r})};return e}function wo(t){return Object.assign(Sr(t),Or(t),Rr(t))}function kn(t){return Object.defineProperty(t,vr,{value:!0}),t}function xr(t,e){for(let n of Reflect.ownKeys(e)){let r=xo(t,n);(r==null||vo(r))&&Object.defineProperty(t,n,e[n])}}function xo(t,e){let n=t;for(;n;){let r=Object.getOwnPropertyDescriptor(n,e);if(r)return r;n=Object.getPrototypeOf(n)}}function vo(t){return[t.value,t.get,t.set].some(e=>typeof e==\"function\"&&e[vr]===!0)}var Se=class extends pe{[D]={};[mt]=[];[Ne]=Oo(this);name=\"\";window=this;parent=this;self=this;top=this;document=new ct(this);customElements=new Jt;location=globalThis.location;navigator=globalThis.navigator;Event=V;ErrorEvent=Wt;PromiseRejectionEvent=Xt;ToggleEvent=$t;FocusEvent=Kt;ClipboardEvent=Zt;EventTarget=pe;CustomEvent=Yt;Node=Q;ParentNode=re;ChildNode=he;DocumentFragment=Ue;Document=ct;CharacterData=ge;Comment=He;Text=Ge;Element=H;HTMLElement=Qt;SVGElement=Le;HTMLTemplateElement=Ve;MutationObserver=Dt;#t=null;#n=null;#e=null;static with(...e){let n=this;return class extends n{constructor(){super();for(let o of e)So(this,o)}}}get onerror(){return this.#n}set onerror(e){this.#t&&this.removeEventListener(\"error\",this.#t),e&&typeof e==\"function\"?(this.#n=e,this.#t=n=>{e(n.message??\"Error\",n.filename,n.lineno,n.colno,n.error)},this.addEventListener(\"error\",this.#t)):(this.#t=null,this.#n=null)}get onunhandledrejection(){return this.#e}set onunhandledrejection(e){this.#e&&this.removeEventListener(\"unhandledrejection\",this.#e),e&&typeof e==\"function\"?(this.#e=e,this.addEventListener(\"unhandledrejection\",this.#e)):this.#e=null}static setGlobal(e){let n=globalThis.self,r=globalThis.window,o=Sr(e),s=Object.assign(Or(e),Rr(e));delete o.self,Object.defineProperties(globalThis,o),xr(globalThis,s),typeof n>\"u\"||n===r&&n!==globalThis?Object.defineProperty(globalThis,\"self\",{value:e,configurable:!0,writable:!0,enumerable:!0}):n!==globalThis&&(Object.defineProperties(n,o),xr(n,s))}static setGlobalThis(e){for(let n in e)e[n]===e&&(e[n]=globalThis);Object.defineProperties(globalThis,wo(e))}};function So(t,e){t[mt].push(e(t)??{})}function Oo(t){return{createElement:le.bind(null,t,\"createElement\"),setAttribute:le.bind(null,t,\"setAttribute\"),removeAttribute:le.bind(null,t,\"removeAttribute\"),createText:le.bind(null,t,\"createText\"),setText:le.bind(null,t,\"setText\"),insertChild:le.bind(null,t,\"insertChild\"),removeChild:le.bind(null,t,\"removeChild\"),addEventListener:le.bind(null,t,\"addEventListener\"),removeEventListener:le.bind(null,t,\"removeEventListener\")}}function le(t,e,...n){for(let s of t[mt])s[e]?.apply(s,n);let r=t[D];r[e]?.apply(r,n)}var en=new Se;var In=\"~\";var ye=new WeakMap;function Be(t){return ye.get(t)}var Gn=new WeakMap,Ao=0;function te(t){let e=Gn.get(t);return e==null&&(e=String(Ao++),tn(t,e)),e}function tn(t,e){Gn.set(t,e)}var Dn=new WeakMap;function _o(t){return Dn.get(t)}var Ln=new WeakMap;function Po(t){let e=Ln.get(t);if(e!=null)return e;if(!(!(t instanceof Element)||t.tagName.includes(\"-\"))){e={};for(let{name:n,value:r}of t.attributes)e[n]=r;return e}}var Co=new WeakMap;function ko(t){return Co.get(t)}function Hn(t,e,n){let r=Dn.get(t);if(r==null&&(r={},Dn.set(t,r)),r[e]===n)return;r[e]=n;let o=ye.get(t);o?.mutate([[3,te(t),e,n,1]])}function be(t,e,n){let r=Ln.get(t);if(r==null&&(r={},Ln.set(t,r)),r[e]===n)return;n==null?delete r[e]:r[e]=String(n);let o=ye.get(t);o?.mutate([[3,te(t),e,n,2]])}function ze(t,e){if(ye.get(t)!==e&&(ye.set(t,e),t.childNodes))for(let r=0;r<t.childNodes.length;r++)ze(t.childNodes[r],e)}function nn(t){if(ye.get(t)!=null&&(ye.delete(t),t.childNodes))for(let n=0;n<t.childNodes.length;n++)nn(t.childNodes[n])}function je(t){let{nodeType:e}=t;switch(e){case 1:return{id:te(t),type:e,element:t.localName,properties:Mn(_o(t)),attributes:Mn(Po(t)),eventListeners:Mn(ko(t)),children:Array.from(t.childNodes).map(je)};case 3:case 8:return{id:te(t),type:e,data:t.data};default:throw new Error(`Cannot serialize node of type ${t.nodeType} (${typeof t.nodeType})`)}}function Mn(t){return t?{...t}:void 0}function Un(t,e,...n){let r=Gn.get(t),o=ye.get(t);if(r==null||o==null)throw new Error(`Cannot call method ${e} on an unconnected node`);return o.call(r,e,...n)}var Fe=en[D];Fe.insertChild=(t,e,n)=>{let r=Be(t);r!=null&&(ze(e,r),r.mutate([[0,te(t),je(e),n]]))};Fe.removeChild=(t,e,n)=>{let r=Be(t);r!=null&&(nn(e),r.mutate([[1,te(t),n]]))};Fe.setText=(t,e)=>{let n=Be(t);n?.mutate([[2,te(t),e]])};Fe.setAttribute=(t,e,n)=>{t.tagName.includes(\"-\")||be(t,e,n)};Fe.removeAttribute=(t,e)=>{t.tagName.includes(\"-\")||be(t,e)};Se.setGlobal(en);function rn(t){if(typeof t==\"string\")return{type:\"navigate\",to:t};let{place:e,record:n,where:r,section:o}=t??{},s={...r===void 0?{}:{where:r},...o===void 0?{}:{section:String(o)}};return typeof e==\"string\"?{type:\"navigate\",place:e,...s}:typeof n==\"string\"?{type:\"navigate\",to:n,...s}:void 0}var _r=[\"wheel\",\"drag\",\"pinch\"];function Pr(t){let e=t;return typeof t==\"object\"&&t!==null&&e.graview===\"host-hello\"&&typeof e.nonce==\"string\"}function kr(t,e={}){let n,r=\"\",o,s=0,i=new Set,a=new Map,l=[],c=b=>{n?n.postMessage({...b,nonce:r}):l.push(b)},m=b=>{let E=b.data;if(!(!E||typeof E!=\"object\")){if(E.type===\"props\"){o=E.props;for(let k of i)k(E.props)}else E.type===\"answer\"?(a.get(E.id)?.(E),a.delete(E.id)):E.type===\"event\"&&typeof E.listener==\"number\"?e.onEvent?.(E):E.type===\"heartbeat\"&&typeof E.beat==\"number\"&&c({type:\"heartbeat\",beat:E.beat});e.onMessage?.(E)}},p=()=>{},h=b=>{if(n||!t.fromHost(b)||!Pr(b.data)||b.data.protocol!==1)return;let E=b.ports[0];if(E){n=E,r=b.data.nonce,n.onmessage=m,n.start?.(),p();for(let k of l.splice(0))c(k)}};p=t.listen(h),t.ready({graview:\"guest-ready\",protocol:1});let g,O={get props(){return o},subscribe(b){return i.add(b),()=>i.delete(b)},act(b,E={}){let k=s+=1;return new Promise(L=>{a.set(k,L),c({type:\"act\",id:k,name:b,args:E})})},navigate(b){let E=rn(b);E&&c(E)},size(b){c({type:\"size\",height:b})},autoSize(b){let E=b??globalThis.document?.documentElement,k=globalThis.ResizeObserver;if(!E||!k||typeof E.getBoundingClientRect!=\"function\")return()=>{};g?.disconnect();let L=new k(()=>O.size(Math.ceil(E.getBoundingClientRect().height)));return L.observe(E),g=L,()=>L.disconnect()},close(){g?.disconnect(),p(),n?.close(),i.clear()}};return{guest:O,send:c}}var Mr=[\"globalThis\",\"Infinity\",\"NaN\",\"undefined\",\"isFinite\",\"isNaN\",\"parseFloat\",\"parseInt\",\"decodeURI\",\"decodeURIComponent\",\"encodeURI\",\"encodeURIComponent\",\"escape\",\"unescape\",\"Object\",\"Function\",\"Array\",\"Number\",\"Boolean\",\"String\",\"Symbol\",\"BigInt\",\"Date\",\"Promise\",\"RegExp\",\"Math\",\"JSON\",\"Reflect\",\"Proxy\",\"Intl\",\"Error\",\"AggregateError\",\"EvalError\",\"RangeError\",\"ReferenceError\",\"SyntaxError\",\"TypeError\",\"URIError\",\"SuppressedError\",\"Map\",\"Set\",\"WeakMap\",\"WeakSet\",\"WeakRef\",\"FinalizationRegistry\",\"Iterator\",\"AsyncIterator\",\"DisposableStack\",\"AsyncDisposableStack\",\"ArrayBuffer\",\"SharedArrayBuffer\",\"DataView\",\"Atomics\",\"Int8Array\",\"Uint8Array\",\"Uint8ClampedArray\",\"Int16Array\",\"Uint16Array\",\"Int32Array\",\"Uint32Array\",\"Float16Array\",\"Float32Array\",\"Float64Array\",\"BigInt64Array\",\"BigUint64Array\"],Dr=[\"window\",\"parent\",\"top\",\"document\",\"customElements\",\"Event\",\"ErrorEvent\",\"PromiseRejectionEvent\",\"ToggleEvent\",\"FocusEvent\",\"ClipboardEvent\",\"CustomEvent\",\"EventTarget\",\"Node\",\"ParentNode\",\"ChildNode\",\"DocumentFragment\",\"Document\",\"CharacterData\",\"Comment\",\"Text\",\"Element\",\"HTMLElement\",\"SVGElement\",\"HTMLTemplateElement\",\"MutationObserver\"],Lr=[\"self\",\"postMessage\",\"setTimeout\",\"clearTimeout\",\"setInterval\",\"clearInterval\",\"queueMicrotask\",\"structuredClone\",\"crypto\",\"console\",\"DOMException\"],Gr=[\"TEMPORARY\",\"PERSISTENT\"],ll=Object.freeze([...Mr,...Dr,...Lr,...Gr]),cl=Object.freeze([\"constructor\",\"__defineGetter__\",\"__defineSetter__\",\"hasOwnProperty\",\"__lookupGetter__\",\"__lookupSetter__\",\"isPrototypeOf\",\"propertyIsEnumerable\",\"toString\",\"valueOf\",\"__proto__\",\"toLocaleString\"]),Ir=t=>typeof t==\"symbol\"?`[${t.description??\"symbol\"}]`:t;function Hr(t=globalThis,e=[],n={}){let r=[],o=[],s=new Set([...Mr,...Dr,...Lr,...e,\"constructor\",Symbol.toStringTag]),i=(T,P)=>{let F=Reflect.getOwnPropertyDescriptor(T,P);return F===void 0||!(\"value\"in F)||F.writable||F.configurable?!1:n.primitivesStay&&typeof P==\"symbol\"&&(typeof F.value!=\"object\"||F.value===null)&&typeof F.value!=\"function\"?!0:Gr.includes(P)&&typeof F.value==\"number\"},a=t,l=a.setTimeout,c=a.setInterval,m=a.crypto,p=(T,P)=>function(F,Ye,...dt){if(typeof F!=\"function\")throw new TypeError(`${P} takes a function: a guest view cannot run code from text`);return T.call(t,F,Ye,...dt)},h=m?Object.freeze({getRandomValues:T=>m.getRandomValues(T)}):void 0,g=a.document?.defaultView;if(g&&g!==a)for(let T of Reflect.ownKeys(g))typeof T==\"symbol\"||s.has(T)||Reflect.deleteProperty(g,T)||o.push(`window.${T}`);let O=[];for(let T=t;T&&T!==Object.prototype;T=Object.getPrototypeOf(T))O.push(T);for(let T of O)for(let P of Reflect.ownKeys(T))s.has(P)||(Reflect.deleteProperty(T,P)?r.push(Ir(P)):i(T,P)||o.push(Ir(P)));let b=()=>function(){throw new EvalError(\"A guest view cannot make code from text.\")},E=[Function.prototype,Object.getPrototypeOf(async function(){}),Object.getPrototypeOf(function*(){}),Object.getPrototypeOf(async function*(){})];for(let T of E){let P=b();Object.defineProperty(P,\"prototype\",{value:T,writable:!1,enumerable:!1,configurable:!1}),Reflect.defineProperty(T,\"constructor\",{value:P,writable:!1,enumerable:!1,configurable:!1})||o.push(\"Function.prototype.constructor\"),T===Function.prototype&&Reflect.defineProperty(t,\"Function\",{value:P,writable:!0,enumerable:!1,configurable:!0})}let k=(T,P)=>{Reflect.defineProperty(t,T,{value:P,writable:!0,enumerable:!0,configurable:!0})||o.push(T)};k(\"setTimeout\",p(l,\"setTimeout\")),k(\"setInterval\",p(c,\"setInterval\")),h&&k(\"crypto\",h);for(let T of O.slice(1))Object.freeze(T);for(let T of Reflect.ownKeys(t)){let P=Reflect.getOwnPropertyDescriptor(t,T);Reflect.defineProperty(t,T,\"value\"in P?{...P,writable:!1,configurable:!1}:{...P,configurable:!1})}let L;try{L=Reflect.preventExtensions(t)}catch{L=!1}return{removed:r,stuck:o,sealed:L}}var ut=class extends HTMLElement{constructor(){super(),tn(this,In)}connect(e){if(Be(this)===e||(ze(this,e),this.childNodes.length===0))return;let n=[];for(let r=0;r<this.childNodes.length;r++){let o=this.childNodes[r];n.push([0,In,je(o),r])}e.mutate(n)}updateRemoteProperty(e,n){Hn(this,e,n)}callRemoteMethod(e,...n){return Un(this,e,...n)}};var d={},on={empty:!0},Io={id:\"text\",class:\"text\",title:\"text\",lang:\"text\",dir:{oneOf:[\"ltr\",\"rtl\",\"auto\"]},hidden:\"text\",tabindex:{oneOf:[\"-1\",\"0\"]},role:\"text\",style:\"style\",translate:{oneOf:[\"yes\",\"no\"]},spellcheck:{oneOf:[\"true\",\"false\"]},draggable:{oneOf:[\"true\",\"false\"]},inert:\"boolean\"},Vn={div:d,section:d,article:d,aside:d,header:d,footer:d,nav:d,hgroup:d,search:d,address:d,figure:d,figcaption:d,blockquote:d,p:d,pre:d,hr:on,br:on,wbr:on,h1:d,h2:d,h3:d,h4:d,h5:d,h6:d,span:d,strong:d,em:d,b:d,i:d,u:d,s:d,small:d,mark:d,abbr:d,cite:d,q:d,code:d,kbd:d,samp:d,var:d,sub:d,sup:d,dfn:d,bdi:d,bdo:d,ruby:d,rt:d,rp:d,time:{attributes:{datetime:\"text\"}},data:{attributes:{value:\"text\"}},del:{attributes:{datetime:\"text\"}},ins:{attributes:{datetime:\"text\"}},a:d,ul:d,menu:d,dl:d,dt:d,dd:d,ol:{attributes:{start:\"number\",reversed:\"boolean\",type:{oneOf:[\"1\",\"a\",\"A\",\"i\",\"I\"]}}},li:{attributes:{value:\"number\"}},table:d,caption:d,thead:d,tbody:d,tfoot:d,tr:d,colgroup:{attributes:{span:\"number\"}},col:{attributes:{span:\"number\"},empty:!0},th:{attributes:{colspan:\"number\",rowspan:\"number\",headers:\"text\",scope:{oneOf:[\"row\",\"col\",\"rowgroup\",\"colgroup\"]},abbr:\"text\"}},td:{attributes:{colspan:\"number\",rowspan:\"number\",headers:\"text\"}},details:{attributes:{open:\"boolean\",name:\"text\"}},summary:d,button:{attributes:{type:{oneOf:[\"button\"]},disabled:\"boolean\",name:\"text\",value:\"text\"}},input:{empty:!0,attributes:{type:{oneOf:[\"text\",\"search\",\"number\",\"range\",\"checkbox\",\"radio\",\"date\",\"time\",\"datetime-local\",\"month\",\"week\",\"color\",\"email\",\"tel\",\"url\"]},name:\"text\",value:\"text\",placeholder:\"text\",min:\"text\",max:\"text\",step:\"text\",checked:\"boolean\",disabled:\"boolean\",readonly:\"boolean\",required:\"boolean\",maxlength:\"number\",minlength:\"number\",size:\"number\",pattern:\"text\",multiple:\"boolean\",inputmode:\"text\",enterkeyhint:\"text\"}},select:{attributes:{name:\"text\",disabled:\"boolean\",multiple:\"boolean\",required:\"boolean\",size:\"number\"}},option:{attributes:{value:\"text\",selected:\"boolean\",disabled:\"boolean\",label:\"text\"}},optgroup:{attributes:{label:\"text\",disabled:\"boolean\"}},textarea:{attributes:{name:\"text\",placeholder:\"text\",rows:\"number\",cols:\"number\",disabled:\"boolean\",readonly:\"boolean\",required:\"boolean\",maxlength:\"number\",minlength:\"number\",wrap:{oneOf:[\"soft\",\"hard\",\"off\"]}}},label:{attributes:{for:\"text\"}},fieldset:{attributes:{disabled:\"boolean\",name:\"text\"}},legend:d,output:d,meter:{attributes:{value:\"number\",min:\"number\",max:\"number\",low:\"number\",high:\"number\",optimum:\"number\"}},progress:{attributes:{value:\"number\",max:\"number\"}},img:{empty:!0,attributes:{src:\"image\",alt:\"text\",width:\"number\",height:\"number\",decoding:{oneOf:[\"async\",\"sync\",\"auto\"]}}},\"graview-video\":on},Mo=[\"fill\",\"fill-opacity\",\"fill-rule\",\"stroke\",\"stroke-width\",\"stroke-linecap\",\"stroke-linejoin\",\"stroke-dasharray\",\"stroke-dashoffset\",\"stroke-opacity\",\"stroke-miterlimit\",\"opacity\",\"color\",\"display\",\"visibility\",\"transform-origin\",\"clip-path\",\"clip-rule\",\"marker-start\",\"marker-mid\",\"marker-end\",\"font-family\",\"font-size\",\"font-weight\",\"font-style\",\"text-anchor\",\"dominant-baseline\",\"alignment-baseline\",\"letter-spacing\",\"text-decoration\",\"paint-order\",\"vector-effect\",\"shape-rendering\",\"pointer-events\",\"stop-color\",\"stop-opacity\",\"overflow\",\"mask\"],Do={id:\"text\",class:\"text\",style:\"style\",lang:\"text\",role:\"text\",tabindex:{oneOf:[\"-1\",\"0\"]},transform:\"geometry\",...Object.fromEntries(Mo.map(t=>[t,\"css\"]))},qe={x:\"geometry\",y:\"geometry\",width:\"geometry\",height:\"geometry\"},sn={viewBox:\"geometry\",preserveAspectRatio:\"geometry\"},Ur={gradientUnits:{oneOf:[\"userSpaceOnUse\",\"objectBoundingBox\"]},gradientTransform:\"geometry\",spreadMethod:{oneOf:[\"pad\",\"reflect\",\"repeat\"]},href:\"fragment\"},Vr={svg:{attributes:{...qe,...sn}},g:d,defs:d,symbol:{attributes:{...qe,...sn,refX:\"geometry\",refY:\"geometry\"}},use:{attributes:{...qe,href:\"fragment\"}},title:d,desc:d,path:{attributes:{d:\"geometry\",pathLength:\"number\"}},rect:{attributes:{...qe,rx:\"geometry\",ry:\"geometry\",pathLength:\"number\"}},circle:{attributes:{cx:\"geometry\",cy:\"geometry\",r:\"geometry\",pathLength:\"number\"}},ellipse:{attributes:{cx:\"geometry\",cy:\"geometry\",rx:\"geometry\",ry:\"geometry\",pathLength:\"number\"}},line:{attributes:{x1:\"geometry\",y1:\"geometry\",x2:\"geometry\",y2:\"geometry\",pathLength:\"number\"}},polyline:{attributes:{points:\"geometry\",pathLength:\"number\"}},polygon:{attributes:{points:\"geometry\",pathLength:\"number\"}},text:{attributes:{x:\"geometry\",y:\"geometry\",dx:\"geometry\",dy:\"geometry\",rotate:\"geometry\",textLength:\"geometry\",lengthAdjust:{oneOf:[\"spacing\",\"spacingAndGlyphs\"]}}},tspan:{attributes:{x:\"geometry\",y:\"geometry\",dx:\"geometry\",dy:\"geometry\",rotate:\"geometry\",textLength:\"geometry\"}},textPath:{attributes:{href:\"fragment\",startOffset:\"geometry\",method:{oneOf:[\"align\",\"stretch\"]},spacing:{oneOf:[\"auto\",\"exact\"]},side:{oneOf:[\"left\",\"right\"]}}},linearGradient:{attributes:{x1:\"geometry\",y1:\"geometry\",x2:\"geometry\",y2:\"geometry\",...Ur}},radialGradient:{attributes:{cx:\"geometry\",cy:\"geometry\",r:\"geometry\",fx:\"geometry\",fy:\"geometry\",fr:\"geometry\",...Ur}},stop:{attributes:{offset:\"geometry\"}},clipPath:{attributes:{clipPathUnits:{oneOf:[\"userSpaceOnUse\",\"objectBoundingBox\"]}}},mask:{attributes:{...qe,maskUnits:{oneOf:[\"userSpaceOnUse\",\"objectBoundingBox\"]},maskContentUnits:{oneOf:[\"userSpaceOnUse\",\"objectBoundingBox\"]}}},pattern:{attributes:{...qe,...sn,patternUnits:{oneOf:[\"userSpaceOnUse\",\"objectBoundingBox\"]},patternContentUnits:{oneOf:[\"userSpaceOnUse\",\"objectBoundingBox\"]},patternTransform:\"geometry\",href:\"fragment\"}},marker:{attributes:{...sn,markerWidth:\"geometry\",markerHeight:\"geometry\",refX:\"geometry\",refY:\"geometry\",orient:\"geometry\",markerUnits:{oneOf:[\"strokeWidth\",\"userSpaceOnUse\"]}}}};var Br={section:[\"aria-label\",\"aria-labelledby\",\"title\"]};function Lo(t){return/^aria-[a-z]+$/.test(t)}function Go(t){return/^data-[a-z0-9][a-z0-9_.-]*$/.test(t)}var Ho=new Map(Object.keys(Vr).map(t=>[t.toLowerCase(),t]));function zr(t){return Ho.get(t.toLowerCase())}function jr(t,e,n){let r=n.toLowerCase(),o=t===\"html\"?[Vn[e]?.attributes,Io]:[Vr[e]?.attributes,Do],s=t===\"svg\"&&r===\"xlink:href\"?\"href\":r;for(let i of o)if(i){for(let[a,l]of Object.entries(i))if(a.toLowerCase()===s)return{name:a,kind:l}}if(Lo(r)||Go(r))return{name:r,kind:\"text\"}}var Fr=\"~\",an=t=>typeof t==\"object\"&&t!==null&&!Array.isArray(t),oe=(t,e=0)=>{if(t===null||typeof t==\"string\"||typeof t==\"number\"||typeof t==\"boolean\"||t===void 0)return t;if(!(e>64||typeof t!=\"object\"))return Array.isArray(t)?t.map(n=>oe(n,e+1)):Object.fromEntries(Object.entries(t).map(([n,r])=>[n,oe(r,e+1)]))};function qr(){let t=new Map,e=new Map,n=new Map([[Fr,{children:[],listeners:new Map}]]),r=0,o=c=>{let m=e.get(c);return m===void 0&&(m=r+=1,e.set(c,m),t.set(m,{listener:c,count:0})),t.get(m).count+=1,m},s=c=>{let m=t.get(c);m&&(m.count-=1,!(m.count>0)&&(t.delete(c),e.delete(m.listener)))},i=c=>{let m=n.get(c);if(m){n.delete(c);for(let p of m.listeners.values())s(p);for(let p of m.children)i(p)}},a=(c,m,p=0)=>{if(!an(c)||p>64)return oe(c);let h=typeof c.id==\"string\"?c.id:void 0,g=m&&h!==void 0&&h!==Fr;g&&i(h);let O={children:[],listeners:new Map};g&&n.set(h,O);let b={};for(let[E,k]of Object.entries(c))E===\"children\"&&Array.isArray(k)?b[E]=k.map(L=>{let T=a(L,g,p+1);return g&&an(L)&&typeof L.id==\"string\"&&O.children.push(L.id),T}):E===\"eventListeners\"&&an(k)?b[E]=Object.fromEntries(Object.entries(k).map(([L,T])=>{if(typeof T!=\"function\"||!g)return[L,void 0];let P=o(T);return O.listeners.set(L,P),[L,{listener:P}]})):b[E]=oe(k,p+1);return b},l=c=>{if(!Array.isArray(c))return oe(c);let[m,p]=c,h=typeof p==\"string\"?n.get(p):void 0;if(m===0){let g=a(c[2],h!==void 0),O=an(c[2])?c[2].id:void 0;if(h&&typeof O==\"string\"&&n.has(O)){let b=Number(c[3]);h.children.splice(Number.isInteger(b)&&b>=0&&b<=h.children.length?b:h.children.length,0,O)}return[m,oe(p),g,oe(c[3])]}if(m===1){let g=Number(c[2]);return h&&Number.isInteger(g)&&g>=0&&g<h.children.length&&i(h.children.splice(g,1)[0]),oe(c)}if(m===3&&c[4]===3){let g=String(c[2]),O=c[3],b=h&&typeof O==\"function\"?o(O):void 0,E=h?.listeners.get(g);return E!==void 0&&s(E),b===void 0?h?.listeners.delete(g):h.listeners.set(g,b),[m,oe(p),g,b===void 0?void 0:{listener:b},3]}return oe(c)};return{encode:c=>c.map(l),listener:c=>t.get(c)?.listener,get listening(){return t.size},get nodes(){return n.size-1}}}var ln=\"graview-view-root\",Uo=[\"value\",\"checked\",\"key\",\"pressed\",\"files\",\"refused\",\"x\",\"y\",\"width\",\"height\",\"deltaX\",\"deltaY\",\"deltaMode\",\"ctrlKey\",\"metaKey\",\"phase\",\"pointerId\",\"button\",\"pressure\",\"dx\",\"dy\",\"scale\",\"rotation\"],Vo=t=>t.replace(/&/g,\"&\").replace(/</g,\"<\").replace(/>/g,\">\").replace(/\"/g,\""\").replace(/'/g,\"'\"),Bo=t=>Object.freeze({html:t,toString:()=>t}),Yr=t=>typeof t==\"object\"&&t!==null&&typeof t.html==\"string\"&&Object.isFrozen(t),Wr=t=>t==null||t===!1?\"\":Array.isArray(t)?t.map(Wr).join(\"\"):Yr(t)?t.html:Vo(String(t));function Xr(t){customElements.get(ln)||customElements.define(ln,ut);let e=Event,n=qr(),r=new Set,o=new Set,s,i=[],a=new Set;for(let u of[\"closest\",\"matches\",\"dataset\"]){let y=()=>{throw new TypeError(`A view's element has no ${u}: graview.on hands event.element, the element its selector matched; read event.element.getAttribute(\"data-\\u2026\").`)};u in Element.prototype||Object.defineProperty(Element.prototype,u,u===\"dataset\"?{get:y}:{value:y})}let l=document.createElement(ln),c=u=>{let y=N=>{for(let w of Array.from(N.childNodes)){if(w.nodeType!==1)continue;if(te(w)===u)return w;let x=y(w);if(x)return x}};return y(l)},m=u=>{let y=c(u.target);if(!y)return;let N=new e(u.event,{bubbles:!0}),w={};for(let x of Uo)u[x]!==void 0&&(w[x]=u[x]);for(let x of Object.keys(w))Object.defineProperty(N,x,{value:w[x],enumerable:!0});y.dispatchEvent(N);for(let x of o){if(x.type!==u.event)continue;let _;try{_=new Set(Array.from(l.querySelectorAll(x.selector)))}catch{continue}for(let z=y;z&&z!==l;z=z.parentNode)if(_.has(z)){x.listener(Object.freeze({type:u.event,target:y,element:z,...w}));break}}},p=u=>{if(u.type===\"dom-event\"&&typeof u.target==\"string\")return m(u);if(u.type===\"notice\")return t.warn(u.text);if(u.type!==\"props\")return;s=u.props;let y=t.now();for(let x of r)try{x(u.props)}catch(_){t.threw(_)}let N=t.now()-y,w=u.push;typeof w==\"number\"&&t.microtask(()=>t.microtask(()=>t.send({type:\"pushed\",push:w,ms:N})))},h;l.connect({mutate(u){h||(h=[],t.microtask(()=>{let y=h??[];h=void 0,t.send({type:\"render\",records:n.encode(y)})})),h.push(...u)},call:()=>{}});let g=u=>u.nodeType===1?u.getAttribute(\"data-key\")??u.getAttribute(\"id\"):null,O=(u,y)=>u.nodeType===y.nodeType&&(u.nodeType!==1||u.localName===y.localName&&u.namespaceURI===y.namespaceURI&&g(u)===g(y));function b(u,y){let N=Array.from(y.childNodes),w=0;for(let x of N){let _=u.childNodes[w]??null;if(_&&O(_,x)){E(_,x),w+=1;continue}if(g(x)!==null){let ce=Array.from(u.childNodes).slice(w+1).find(We=>O(We,x));if(ce){u.insertBefore(ce,_),E(ce,x),w+=1;continue}}u.insertBefore(x,_),w+=1}for(;u.childNodes.length>w;)u.removeChild(u.lastChild)}function E(u,y){if(u.nodeType!==1){u.data!==y.data&&(u.data=y.data);return}let N=u,w=y,x=k(N);for(let _ of N.getAttributeNames())w.hasAttribute(_)||(N.removeAttribute(_),x&&be(N,_,void 0));for(let _ of w.getAttributeNames()){let z=w.getAttribute(_);N.getAttribute(_)!==z&&N.setAttribute(_,z),x&&be(N,_,z)}b(N,w)}let k=u=>u.localName.includes(\"-\");function L(u){for(let y of Array.from(u.childNodes)){if(y.nodeType!==1)continue;let N=y;if(k(N))for(let w of N.getAttributeNames())be(N,w,N.getAttribute(w)??void 0);L(N)}}function T(u,y,N){for(let w of Array.from(u.childNodes)){if(w.nodeType!==1)continue;let x=w,_=x.localName,z=y||_.toLowerCase()===\"svg\",ce=z?zr(_):Object.prototype.hasOwnProperty.call(Vn,_.toLowerCase())?_.toLowerCase():void 0;if(!ce){N.add(`<${_}>`);continue}for(let We of x.getAttributeNames())(!jr(z?\"svg\":\"html\",ce,We)||!z&&Br[ce]?.includes(We.toLowerCase()))&&N.add(`${ce} ${We}`);T(x,z,N)}}function P(u){let y=document.createElement(\"div\"),N=Array.isArray(u)?u:[u];for(let x of N)if(x!=null)if(typeof x==\"string\"||Yr(x)){let _=document.createElement(\"div\");_.innerHTML=typeof x==\"string\"?x:x.html,y.append(...Array.from(_.childNodes))}else y.append(x);let w=new Set;T(y,!1,w),i=[...w],i.length>0&&t.warn(`The host will not draw: ${i.join(\", \")}`),L(y),b(l,y)}let F,Ye=new Set(_r),dt=\"[]\",cn=!1,Fn=()=>{cn||(cn=!0,t.microtask(()=>{cn=!1;let u=[...new Map([...o].filter(N=>Ye.has(N.type)).map(N=>[`${N.type} ${N.selector}`,{event:N.type,selector:N.selector}])).entries()].sort(([N],[w])=>N<w?-1:N>w?1:0).map(([,N])=>N),y=JSON.stringify(u);y!==dt&&(dt=y,t.send({type:\"gestures\",bound:u}))}))};return{view:Object.freeze({get props(){return s},onProps(u){return r.add(u),s&&u(s),()=>void r.delete(u)},render:P,style(u){typeof u!=\"string\"||u===F||(F=u,t.send({type:\"style\",css:u}))},on(u,y,N){let w={type:u,selector:y,listener:N};return o.add(w),typeof u==\"string\"&&!a.has(u)&&(a.add(u),t.send({type:\"hears\",events:[u]})),Ye.has(u)&&Fn(),()=>{o.delete(w),Ye.has(u)&&Fn()}},act:(u,y={})=>t.act(u,y),navigate(u){if(typeof u==\"string\")return t.navigate(u);let y=rn(u);y&&t.send(y)},html(u,...y){return Bo(u.reduce((N,w,x)=>N+w+(x<y.length?Wr(y[x]):\"\"),\"\"))},get refused(){return i},get hardening(){return t.hardening()}}),hear:p}}var jn={removed:[],stuck:[],sealed:!1,worker:!1},Bn=kr({listen(t){return Re.listen(t),()=>Re.unlisten(t)},fromHost:()=>!0,ready:t=>Re.post(t)},{onMessage:t=>$r.hear(t)}),$r=Xr({send:t=>Bn.send(t),act:(t,e)=>Bn.guest.act(t,e),navigate:t=>Bn.guest.navigate(t),microtask:Re.microtask,now:Re.now,threw:t=>console.error(t),warn:t=>console.warn(t),hardening:()=>jn}),zo=$r.view;Object.defineProperty(globalThis,\"graview\",{value:zo,enumerable:!0,configurable:!0,writable:!1});var zn=\"WorkerGlobalScope\"in globalThis?Hr(globalThis,[\"graview\"]):jn;jn=zn;if(zn.stuck.length>0)throw new Error(`The view's worker could not be hardened: ${zn.stuck.join(\", \")} would not go.`);})();\n";
|
|
7
7
|
//# sourceMappingURL=view-runtime.generated.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view-runtime.generated.js","sourceRoot":"","sources":["../../src/host/view-runtime.generated.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAW,
|
|
1
|
+
{"version":3,"file":"view-runtime.generated.js","sourceRoot":"","sources":["../../src/host/view-runtime.generated.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,YAAY,GAAW,4x9DAA4x9D,CAAC"}
|
package/dist/host/view.d.ts
CHANGED
|
@@ -3,14 +3,11 @@ import type { GuestPlace, GuestTheme } from "../protocol.js";
|
|
|
3
3
|
import { type WorkerViewManifest } from "./manifest.js";
|
|
4
4
|
import type { ViewRefusal } from "./open-draw.js";
|
|
5
5
|
import { type GuestLimits, type GuestStats, type GuestViewInput } from "./session.js";
|
|
6
|
-
import { type GuestWorkerSource } from "./worker-start.js";
|
|
7
6
|
import { type Arrival } from "./links.js";
|
|
8
7
|
import type { GoTo } from "@graview/react/provider";
|
|
9
8
|
import { readTheme, type GuestBrand } from "./theme.js";
|
|
10
|
-
|
|
11
|
-
export type WorkerViewCode
|
|
12
|
-
readonly source: string;
|
|
13
|
-
};
|
|
9
|
+
import { type WorkerViewCode, type WorkerViewLoad } from "./code-of.js";
|
|
10
|
+
export type { WorkerViewCode, WorkerViewLoad } from "./code-of.js";
|
|
14
11
|
export type WorkerViewFailure =
|
|
15
12
|
/** Its manifest names a kind, an edge or an act the app does not declare (FR-91): it was never started. */
|
|
16
13
|
"manifest"
|
|
@@ -64,7 +61,7 @@ export interface MountWorkerViewOptions<S extends AnySchema> {
|
|
|
64
61
|
* in front of it. `{ script }` or `{ url }` is a whole worker script
|
|
65
62
|
* already, its runtime first (`@graview/guest/worker/view`).
|
|
66
63
|
*/
|
|
67
|
-
readonly worker: WorkerViewCode;
|
|
64
|
+
readonly worker: WorkerViewCode | WorkerViewLoad;
|
|
68
65
|
readonly store: Store<S>;
|
|
69
66
|
/** The viewer: what is pushed is what they may see, and what is asked for is applied as them. */
|
|
70
67
|
readonly principal: Principal;
|
package/dist/host/view.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../src/host/view.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAa,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAGvF,OAAO,KAAK,EAAiB,UAAU,EAAc,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACxF,OAAO,EAAkC,KAAK,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACxF,OAAO,KAAK,EAAe,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAuD,KAAK,WAAW,EAAE,KAAK,UAAU,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../src/host/view.ts"],"names":[],"mappings":"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"}
|
package/dist/host/view.js
CHANGED
|
@@ -12,6 +12,7 @@ import { viewScript } from "./view-script.js";
|
|
|
12
12
|
import { createLinks, listsOf } from "./links.js";
|
|
13
13
|
import { arriveAt } from "./arrive-at.js";
|
|
14
14
|
import { createGuestLogo, readTheme, themeWithBrand, watchTheme } from "./theme.js";
|
|
15
|
+
import { codeOf } from "./code-of.js";
|
|
15
16
|
/**
|
|
16
17
|
* Why a worker view is not shown (FR-94). Past any limit the host stops
|
|
17
18
|
* the worker, draws the plain face of what the view was shown in its place
|
|
@@ -26,6 +27,8 @@ const picturesChunk = retryingImport(() => import("./pictures.js"));
|
|
|
26
27
|
const mediaChunk = retryingImport(() => import("./media.js"));
|
|
27
28
|
/* Files dropped on what the view drew (FR-193), fetched with the first `data-drop` a view whose manifest accepts files draws. */
|
|
28
29
|
const dropChunk = retryingImport(() => import("./drop.js"));
|
|
30
|
+
/* A wheel, a drag and a pinch over what the view drew (0.1.42), fetched only for a view whose manifest says gestures and that listens for one. */
|
|
31
|
+
const gesturesChunk = retryingImport(() => import("./gestures.js"));
|
|
29
32
|
/** What each limit is, said to a person. */
|
|
30
33
|
function why(reason, limits, detail) {
|
|
31
34
|
switch (reason) {
|
|
@@ -179,16 +182,18 @@ export function mountWorkerView(element, options) {
|
|
|
179
182
|
queueMicrotask(() => fail("manifest", findings.join(" ")));
|
|
180
183
|
return handle();
|
|
181
184
|
}
|
|
182
|
-
|
|
183
|
-
const
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
185
|
+
/* Its code is longer than it may be, or its own source loads something (FR-96): refused before it runs, with why. */
|
|
186
|
+
const refusedCode = (code) => {
|
|
187
|
+
const bytes = "source" in code ? new TextEncoder().encode(code.source).length : "script" in code ? new TextEncoder().encode(code.script).length : 0;
|
|
188
|
+
if (bytes > limits.maxSourceBytes)
|
|
189
|
+
return ["source"];
|
|
190
|
+
const unloadable = "source" in code ? checkViewSource(code.source) : [];
|
|
191
|
+
return unloadable.length > 0 ? ["source", unloadable.join(" ")] : undefined;
|
|
192
|
+
};
|
|
193
|
+
const given = options.worker;
|
|
194
|
+
const refusedNow = typeof given === "function" ? undefined : refusedCode(given);
|
|
195
|
+
if (refusedNow) {
|
|
196
|
+
queueMicrotask(() => fail(...refusedNow));
|
|
192
197
|
return handle();
|
|
193
198
|
}
|
|
194
199
|
/*
|
|
@@ -244,6 +249,7 @@ export function mountWorkerView(element, options) {
|
|
|
244
249
|
pictures?.dispose();
|
|
245
250
|
media?.dispose();
|
|
246
251
|
drops?.dispose();
|
|
252
|
+
gestures?.dispose();
|
|
247
253
|
};
|
|
248
254
|
let port;
|
|
249
255
|
const send = (message) => port?.postMessage(message);
|
|
@@ -393,6 +399,34 @@ export function mountWorkerView(element, options) {
|
|
|
393
399
|
drops.refresh();
|
|
394
400
|
}, () => options.onProblem?.(`The view "${manifest.title ?? manifest.name}" takes files, and the host's drop could not be loaded.`));
|
|
395
401
|
};
|
|
402
|
+
/*
|
|
403
|
+
* A WHEEL, A DRAG AND A PINCH (0.1.42, gestures.ts): fetched the first
|
|
404
|
+
* time the view says it listens for one, and told again wherever it moves
|
|
405
|
+
* where it listens. Only a view whose manifest says gestures hears one; any
|
|
406
|
+
* other is told why, in its console and to the host. A host whose gestures
|
|
407
|
+
* did not arrive forwards none, and the page scrolls as it would.
|
|
408
|
+
*/
|
|
409
|
+
let gestures;
|
|
410
|
+
let gesturesBound = [];
|
|
411
|
+
let gesturesAsked = false;
|
|
412
|
+
const bindGestures = (bound) => {
|
|
413
|
+
gesturesBound = bound;
|
|
414
|
+
gestures?.bind(bound);
|
|
415
|
+
if (gesturesAsked || bound.length === 0)
|
|
416
|
+
return;
|
|
417
|
+
gesturesAsked = true;
|
|
418
|
+
void gesturesChunk().then(({ createGuestGestures, unheardWords }) => {
|
|
419
|
+
if (failed)
|
|
420
|
+
return;
|
|
421
|
+
if (manifest.gestures !== true) {
|
|
422
|
+
const said = unheardWords(manifest.title ?? manifest.name);
|
|
423
|
+
port?.postMessage({ type: "notice", text: said });
|
|
424
|
+
return options.onProblem?.(said);
|
|
425
|
+
}
|
|
426
|
+
gestures = createGuestGestures(shadow, { root: () => shadow.querySelector("[data-graview-view-root]") ?? undefined, idOf: (one) => drawing?.renderer.idOf(one), send });
|
|
427
|
+
gestures.bind(gesturesBound);
|
|
428
|
+
}, () => { });
|
|
429
|
+
};
|
|
396
430
|
/* A file on a record the view was shown, as the record keeps it: one it may hand back to an act. */
|
|
397
431
|
const fileOnShown = (href) => {
|
|
398
432
|
const graph = options.store.seenBy(options.principal).graph;
|
|
@@ -567,6 +601,8 @@ export function mountWorkerView(element, options) {
|
|
|
567
601
|
if (events.includes("drop"))
|
|
568
602
|
hearsDrop = true;
|
|
569
603
|
},
|
|
604
|
+
/* Where it listens for a gesture (0.1.42): heard only where its manifest says gestures. */
|
|
605
|
+
onGestures: bindGestures,
|
|
570
606
|
onRender: (records) => {
|
|
571
607
|
drew = true;
|
|
572
608
|
draw(["render", records]);
|
|
@@ -603,19 +639,39 @@ export function mountWorkerView(element, options) {
|
|
|
603
639
|
push();
|
|
604
640
|
},
|
|
605
641
|
}));
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
642
|
+
const run = (code) => {
|
|
643
|
+
if ("source" in code) {
|
|
644
|
+
void (manifest.pictures ? Promise.all([viewScript(code.source), picturesReady]).then(([script]) => script) : viewScript(code.source)).then((script) => {
|
|
645
|
+
if (!failed)
|
|
646
|
+
begin({ script });
|
|
647
|
+
}, () => fail("start", "the view's runtime could not be loaded"));
|
|
648
|
+
}
|
|
649
|
+
else if (!manifest.pictures)
|
|
650
|
+
begin(code);
|
|
651
|
+
else
|
|
652
|
+
void picturesReady.then(() => {
|
|
653
|
+
if (!failed)
|
|
654
|
+
begin(code);
|
|
655
|
+
}, () => fail("start", "the view's pictures could not be loaded"));
|
|
656
|
+
};
|
|
657
|
+
/*
|
|
658
|
+
* CODE FETCHED WHEN THE VIEW IS DRAWN (Roadmap f-heavy-apps-fast): a host
|
|
659
|
+
* hands `worker` as a function, asked once per function however often the
|
|
660
|
+
* view is drawn, and again after it rejected. Judged as handed code is
|
|
661
|
+
* once it arrives; one that never does is refused `source` in words.
|
|
662
|
+
*/
|
|
663
|
+
if (typeof given === "function")
|
|
664
|
+
void codeOf(given).then((code) => {
|
|
665
|
+
if (failed)
|
|
666
|
+
return;
|
|
667
|
+
const refused = refusedCode(code);
|
|
668
|
+
if (refused)
|
|
669
|
+
fail(...refused);
|
|
670
|
+
else
|
|
671
|
+
run(code);
|
|
672
|
+
}, (error) => fail("source", `Its code did not arrive${error instanceof Error && error.message ? `: ${error.message}` : ""}.`));
|
|
614
673
|
else
|
|
615
|
-
|
|
616
|
-
if (!failed)
|
|
617
|
-
begin(code);
|
|
618
|
-
}, () => fail("start", "the view's pictures could not be loaded"));
|
|
674
|
+
run(given);
|
|
619
675
|
return handle();
|
|
620
676
|
function handle() {
|
|
621
677
|
return {
|