@graview/guest 0.1.69 → 0.1.70

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.
Files changed (80) hide show
  1. package/README.md +18 -9
  2. package/client.js +1 -1
  3. package/dist/client.generated.js +2 -2
  4. package/dist/headless/draw.d.ts +2 -2
  5. package/dist/headless/draw.d.ts.map +1 -1
  6. package/dist/headless/draw.js +3 -1
  7. package/dist/headless/draw.js.map +1 -1
  8. package/dist/headless/index.d.ts +2 -2
  9. package/dist/headless/index.d.ts.map +1 -1
  10. package/dist/headless/index.js +4 -3
  11. package/dist/headless/index.js.map +1 -1
  12. package/dist/headless/presses.d.ts +1 -1
  13. package/dist/headless/presses.d.ts.map +1 -1
  14. package/dist/headless/presses.js +132 -5
  15. package/dist/headless/presses.js.map +1 -1
  16. package/dist/headless/runtime.generated.d.ts.map +1 -1
  17. package/dist/headless/runtime.generated.js +1 -1
  18. package/dist/headless/runtime.generated.js.map +1 -1
  19. package/dist/headless/runtime.js +15 -1
  20. package/dist/headless/runtime.js.map +1 -1
  21. package/dist/host/cascade.d.ts +8 -0
  22. package/dist/host/cascade.d.ts.map +1 -0
  23. package/dist/host/cascade.js +97 -0
  24. package/dist/host/cascade.js.map +1 -0
  25. package/dist/host/drop.d.ts.map +1 -1
  26. package/dist/host/drop.js +3 -1
  27. package/dist/host/drop.js.map +1 -1
  28. package/dist/host/fonts.d.ts +22 -0
  29. package/dist/host/fonts.d.ts.map +1 -0
  30. package/dist/host/fonts.js +69 -0
  31. package/dist/host/fonts.js.map +1 -0
  32. package/dist/host/manifest.d.ts +44 -3
  33. package/dist/host/manifest.d.ts.map +1 -1
  34. package/dist/host/manifest.js +78 -7
  35. package/dist/host/manifest.js.map +1 -1
  36. package/dist/host/mine.d.ts +65 -0
  37. package/dist/host/mine.d.ts.map +1 -0
  38. package/dist/host/mine.js +246 -0
  39. package/dist/host/mine.js.map +1 -0
  40. package/dist/host/open-draw.d.ts +16 -9
  41. package/dist/host/open-draw.d.ts.map +1 -1
  42. package/dist/host/open-draw.js +33 -15
  43. package/dist/host/open-draw.js.map +1 -1
  44. package/dist/host/place-handle.d.ts.map +1 -1
  45. package/dist/host/place-handle.js +2 -0
  46. package/dist/host/place-handle.js.map +1 -1
  47. package/dist/host/session.d.ts +3 -0
  48. package/dist/host/session.d.ts.map +1 -1
  49. package/dist/host/session.js +14 -0
  50. package/dist/host/session.js.map +1 -1
  51. package/dist/host/theme.d.ts +7 -1
  52. package/dist/host/theme.d.ts.map +1 -1
  53. package/dist/host/theme.js.map +1 -1
  54. package/dist/host/view-runtime.generated.d.ts.map +1 -1
  55. package/dist/host/view-runtime.generated.js +1 -1
  56. package/dist/host/view-runtime.generated.js.map +1 -1
  57. package/dist/host/view.d.ts +9 -1
  58. package/dist/host/view.d.ts.map +1 -1
  59. package/dist/host/view.js +76 -4
  60. package/dist/host/view.js.map +1 -1
  61. package/dist/host/views.d.ts +1 -1
  62. package/dist/host/views.d.ts.map +1 -1
  63. package/dist/host/views.js +1 -1
  64. package/dist/host/views.js.map +1 -1
  65. package/dist/host/worker-react.d.ts +7 -0
  66. package/dist/host/worker-react.d.ts.map +1 -1
  67. package/dist/host/worker-react.js +15 -10
  68. package/dist/host/worker-react.js.map +1 -1
  69. package/dist/protocol.d.ts +58 -0
  70. package/dist/protocol.d.ts.map +1 -1
  71. package/dist/protocol.js +28 -0
  72. package/dist/protocol.js.map +1 -1
  73. package/dist/worker/view-global.d.ts +10 -0
  74. package/dist/worker/view-global.d.ts.map +1 -1
  75. package/dist/worker/view-global.js +30 -0
  76. package/dist/worker/view-global.js.map +1 -1
  77. package/dist/worker/view.d.ts.map +1 -1
  78. package/dist/worker/view.js +1 -0
  79. package/dist/worker/view.js.map +1 -1
  80. package/package.json +4 -4
@@ -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 Re=globalThis,io=Re.addEventListener,ao=Re.removeEventListener,lo=Re.postMessage,co=globalThis.queueMicrotask,fn=globalThis.performance,uo=fn?fn.now.bind(fn):Date.now,_e={listen:t=>io.call(Re,\"message\",t),unlisten:t=>ao.call(Re,\"message\",t),post:t=>lo.call(Re,t),microtask:t=>co.call(globalThis,t),now:()=>uo()};var S=Symbol(\"name\"),fe=Symbol(\"prefix\"),me=Symbol(\"value\"),x=Symbol(\"ns\"),z=Symbol(\"owner\"),I=Symbol(\"owner_document\"),re=Symbol(\"attributes\"),D=Symbol(\"prev\"),p=Symbol(\"next\"),A=Symbol(\"child\"),Y=Symbol(\"parent\"),pe=Symbol(\"host\"),K=Symbol(\"data\"),Te=Symbol(\"listeners\"),mn=Symbol(\"isTrusted\"),Pe=Symbol(\"path\"),Ce=Symbol(\"stop_immediate_propagation\"),Me=Symbol(\"dispatching\"),ie=Symbol(\"content\"),k=Symbol(\"hooks\"),mt=Symbol(\"extensions\"),we=Symbol(\"hooks_dispatch\"),U=Symbol(\"is_connected\"),Ie=Symbol(\"create_element\"),Zn=0,$=1,De=2,ke=3,Le=8,Oe=9,Qn=10,he=11,_=\"http://www.w3.org/1999/xhtml\",Z=\"http://www.w3.org/2000/svg\",Jn=\"http://www.w3.org/XML/1998/namespace\",Xe=\"http://www.w3.org/2000/xmlns/\";function pt(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 er(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 tr=/^(?:[A-Za-z][^\\0\\t\\n\\f\\r\\u0020/>]*|[:_\\u0080-\\u{10FFFF}][A-Za-z0-9-.:_\\u0080-\\u{10FFFF}]*)$/u,nr=/[\\0\\t\\n\\f\\r />=]/u,fo=/[\\0\\t\\n\\f\\r />]/u;function ae(t){if(t==null)return null;let e=String(t);return e===\"\"?null:e}function rr(t){tr.test(t)||hn(t)}function pn(t){(t===\"\"||nr.test(t))&&hn(t)}function ht(t,e,n){let r=ae(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===\"\"||fo.test(i))||(n===\"element\"?!tr.test(a):a===\"\"||nr.test(a)))&&hn(o),i!=null&&r==null)throw C(`A namespace is required for the prefix in \"${o}\"`,\"NamespaceError\");if(i===\"xml\"&&r!==Jn)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 hn(t){throw C(`Invalid name: \"${t}\"`,\"InvalidCharacterError\")}var gt=0,yt=1,or=2,gn=3,mo=typeof performance>\"u\"?Date.now:performance.now.bind(performance),B=class{static NONE=gt;static CAPTURING_PHASE=yt;static AT_TARGET=or;static BUBBLING_PHASE=gn;timeStamp=mo();target=null;currentTarget=null;srcElement=null;bubbles=!1;cancelable=!1;composed=!1;defaultPrevented=!1;cancelBubble=!1;eventPhase=gt;[Pe]=[];[Ce]=!1;[Me]=!1;constructor(e,n){this.type=e,Object.defineProperty(this,mn,{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[mn]}composedPath(){return[...this[Pe]]}stopPropagation(){this.cancelBubble=!0}stopImmediatePropagation(){this[Ce]=!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 yn(t,e,n){if(t.cancelBubble)return;let o=e[Te]?.get(t.type)?.[n===yt?\"capture\":\"bubble\"];if(o)for(let s of[...o]){if(!o.has(s)||s.signal?.aborted)continue;t.eventPhase=t.target===e?or:n,t.currentTarget=e;let i=s.normalizedListener;try{typeof i==\"object\"?i.handleEvent(t):i.call(e,t)}catch(a){setTimeout(po,0,a)}if(t[Ce])break}}function po(t){throw t}var Ke=[],Et=new WeakMap;function bt(t,e){let n=Et.get(t);n?n.push(e):Et.set(t,[e]),Ke[Ke.length-1].push(t)}function V(t){let e=[];Ke.push(e);let n;try{n=t()}catch(r){Ke.pop();try{sr(e)}catch{}throw r}return Ke.pop(),sr(e),n}function sr(t){let e,n=!1;for(let r of t){let o=Et.get(r);if(o){for(;o.length>0;){let s=o.shift();try{s()}catch(i){n||(e=i,n=!0)}}Et.delete(r)}}if(n)throw e}var Nt=[],Ze=[],En=!1;function Se(t){for(let e of t)Nt.push(e),e[1]&&Ze.push(e[1]);if(!En){En=!0;try{let e,n=!1;for(let r=0;r<Nt.length;r++){let[o,s]=Nt[r];s&&Ze.splice(Ze.indexOf(s),1);try{o()}catch(i){n||(e=i,n=!0)}}if(n)throw e}finally{Nt.length=0,Ze.length=0,En=!1}}}function Qe(t){let e=t;for(;e;){if(Ze.includes(e))return!0;e=e[Y]??e[pe]}return!1}var Je=Symbol(\"listenerRegistrations\"),ge=class{[Te]=void 0;[Je]=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=bn(o),c=this[Je];c||(c=new Map,this[Je]=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 g=this,y={type:e,listener:n,capture:o,once:s,normalizedListener:n,signal:i};(s||i)&&(y.normalizedListener=function(...M){if(y.signal?.aborted){Tt(g,y);return}return y.once&&Tt(g,y),typeof y.listener==\"object\"?y.listener.handleEvent(...M):y.listener.call(this,...M)});let E=this[Te];E||(E=new Map,this[Te]=E);let v=E.get(e);v||(v={},E.set(e,v));let b=v[a];if(b||(b=new Set,v[a]=b),f.set(n,y),b.add(y),i){let N=()=>{Tt(g,y)};y.abortListener=N,i.addEventListener(\"abort\",N,{once:!0})}this[I]?.defaultView[we].addEventListener?.(this,e,n,r)}removeEventListener(e,n,r){return ho.call(this,e,n,r)}dispatchEvent(e){if(e[Me])throw C(\"Failed to execute 'dispatchEvent' on 'EventTarget': The event is already being dispatched.\",\"InvalidStateError\");e[Me]=!0;try{let n=[],r=this;for(;r!=null;)n.push(r),r=r.parentNode;e.target=this,e.srcElement=this,e[Pe]=n;for(let s=n.length;s--;)if(yn(e,n[s],yt),e.cancelBubble)return!e.defaultPrevented;let o=e.bubbles?n:n.slice(0,1);for(let s=0;s<o.length;s++)if(yn(e,o[s],gn),e.cancelBubble)return!e.defaultPrevented;return!e.defaultPrevented}finally{e[Me]=!1,e.cancelBubble=!1,e[Ce]=!1,e.eventPhase=gt,e.currentTarget=null,e[Pe]=[]}}};function ho(t,e,n){if(e==null)return;let r=n===!0||n&&n.capture===!0,o=bn(!!r),s=this[Je]?.get(t)?.[o]?.get(e);s&&Tt(this,s)}function bn(t){return t?\"capture\":\"bubble\"}function Tt(t,e){let n=bn(e.capture),r=t[Je],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[Te],a=i?.get(e.type);if(!a)return;let c=a[n];c?.delete(e)&&(c.size===0&&delete a[n],!a.bubble&&!a.capture&&i?.delete(e.type),t[I]?.defaultView[we].removeEventListener?.(t,e.type,e.listener,e.capture))}var Q=class extends Array{item(e){return this[e]??null}};var tt=0,ir=1,wn=2,On=3,nt=4,ar=0,lr=1,St=2,xt=3,cr=4,Tn=5,ur=6,dr=7,wt=/^(?:--|-?[A-Za-z_\\u0080-\\u{10FFFF}])[A-Za-z0-9_\\u0080-\\u{10FFFF}-]*$/u;function go(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 vt(t,e){let n=typeof e==\"string\"?rt(e):[{combinator:nt,matchers:e}],r=null,o=t[A];return o&&n[0].matchers.length&&Sn(o,n,s=>(r=s,!1)),r}function At(t,e){let n=typeof e==\"string\"?rt(e):[{combinator:nt,matchers:e}],r=new Q,o=t[A];return o&&n[0].matchers.length&&Sn(o,n,s=>{r.push(s)}),r}function rt(t,e=!1,n=!1){let r={combinator:nt,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,c;for(;c=s.exec(i);){c.index!==a&&W(t),c[1]&&(r.matchers.length===0&&!(n&&o.length===1)&&W(t),c[1]===\">\"?r.combinator=ir:c[1]===\"+\"?r.combinator=On:c[1]===\"~\"?r.combinator=wn:r.combinator=tt,r={combinator:nt,matchers:[]},o.push(r));let u=c[8]?G(c[8]):c[2]||c[7];c[7]!=null&&!c[6]&&r.matchers.length>0&&W(t);let g,y=c[4]??c[5]??c[7];if(c[2]){wt.test(u)||W(t);let E=c[5],v=E?.[0];if(c[3]==null&&(v==='\"'||v===\"'\")){let b=c[0].lastIndexOf(E);y=i.slice(c.index+b+1),s.lastIndex=i.length}else E!=null&&!wt.test(E)&&W(t);g=cr}else c[6]?(wt.test(u)||W(t),g=c[6]===\"#\"?St:xt):c[8]?g=c[9]==null?Tn:ur:c[7]===\"*\"?g=ar:c[7]&&wt.test(c[7])?g=lr:W(t);c[9]?([y,s.lastIndex]=go(i,s.lastIndex),u!==\"has\"&&u!==\"not\"&&W(t),u===\"has\"&&e&&W(t),rt(y,e||u===\"has\",u===\"has\")):g===Tn&&W(t),r.matchers.push({type:g,name:u,value:y}),a=s.lastIndex}return(a!==i.length||r.matchers.length===0)&&W(t),o}function yo(t,e){let n=rt(e);return n[0]?.matchers.length?et(t,n):!1}function Eo(t,e){let n=rt(e,!0,!0),r=n[0];if(n.length===1&&r.matchers.length===0)return!1;let o=tt,s={type:dr,name:\":scope\"};if(r.matchers.length===0?(o=r.combinator,r.matchers.push(s)):n.unshift({combinator:tt,matchers:[s]}),n.some(({matchers:c})=>c.length===0))return!1;let i=o===On||o===wn?t[p]:t[A];if(!i)return!1;let a=!1;return Sn(i,n,()=>(a=!0,!1),t),a}function Sn(t,e,n,r){let o=[],s=t;for(;s;){if(j(s)){if(et(s,e,r)&&n(s)===!1)return!1;let i=s[A];if(i){let a=s[p];a&&o.push(a),s=i;continue}}s=s[p]??o.pop()??null}return!0}function et(t,e,n){let{combinator:r,matchers:o}=e[e.length-1];if(r===nt){if(!Ot(t,o,n))return!1;let a=e.slice(0,-1);return a.length===0||et(t,a,n)}let s=r===ir||r===tt?Y:D,i=t[s];if(!i)return!1;if(r===tt||r===wn){for(;i;){if(j(i)&&Ot(i,o,n)){let a=e.slice(0,-1);if(a.length===0||et(i,a,n))return!0}i=i[s]}return!1}else{if(r===On&&!j(i)){for(;i&&!j(i);)i=i[s];if(!i)return!1}if(!j(i)||!Ot(i,o,n))return!1;let a=e.slice(0,-1);return a.length===0||et(i,a,n)}}function Nn(t,e){return t.getAttributeNS(null,t.namespaceURI===_?G(e):e)}function Ot(t,e,n){if(!t)return!1;if(Array.isArray(e)){for(let i of e)if(Ot(t,i,n)===!1)return!1;return!0}let{type:r,name:o,value:s}=e;switch(r){case ar:return o===\"*\";case lr:return t.namespaceURI===_?t.localName===G(o):t.localName===o;case St:return Nn(t,\"id\")===o;case xt:let i=Nn(t,\"class\");return i?pt(i).includes(o):!1;case cr:let a=Nn(t,o);return s==null?a!=null:a===s;case dr:return t===n;case Tn:W(`:${o}`);case ur:switch(o){case\"has\":return Eo(t,s||\"\");case\"not\":return!yo(t,s||\"\");default:W(`:${o}(${s})`)}}return!1}function bo(t){return t.nodeType===De}function ot(t){return K in t}function vn(t){return t.nodeType===ke}function No(t){return t.nodeType===Le}function j(t){return t.nodeType===$}function xn(t){return t.nodeType===he}function hr(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 c of it(i)){if(o.has(c)||(o.add(c),e.push(c),a.push(c),!j(c)))continue;let u=c[re];if(u)for(let g of u)o.has(g)||(o.add(g),e.push(g));let f=c[ie];f&&!o.has(f)&&!r.has(f)&&(r.add(f),n.push(f))}s??=a}return{nodes:e,treeNodes:s}}function st(t,e){for(let n of t)n[I]=e}function fr(t,e){let n=t.constructor,r=new n(t.name,t.value,t.namespaceURI);return r[I]=e,r}function mr(t,e){if(vn(t))return e.createTextNode(t.data);if(No(t))return e.createComment(t.data);if(bo(t))return fr(t,e);if(j(t)){let n=e[Ie](t[S],t.namespaceURI,t[fe],t.localName);if(t[re])for(let r=0;r<t[re].length;r++){let o=t[re].item(r);n.attributes.setNamedItem(fr(o,e))}return n}else{if(xn(t))return e.createDocumentFragment();{let n=new t.constructor;return n[I]=e,n}}}function _t(t,e,n=t.ownerDocument){if(t.nodeType===Oe)throw C(\"Cannot clone a document node\",\"NotSupportedError\");let r=mr(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,c;if(i.cloningContent)if(i.contentSource&&i.contentDestination)a=i.contentSource.childNodes[i.childIndex++],c=i.contentDestination;else{s.pop(),i.appendTo&&i.appendTo.appendChild(i.destination);continue}else if(a=i.source.childNodes[i.childIndex++],c=i.destination,!a){if(i.cloningContent=!0,i.childIndex=0,j(i.source)&&i.source.namespaceURI===_&&i.source.localName===\"template\"){let f=i.source[ie];f&&(o.has(f)&&pr(),o.add(f),i.contentSource=f,i.contentDestination=i.destination.content)}continue}if(!a){s.pop(),i.appendTo&&i.appendTo.appendChild(i.destination);continue}o.has(a)&&pr(),o.add(a);let u=mr(a,n);j(a)||xn(a)?s.push({source:a,destination:u,appendTo:c,childIndex:0,cloningContent:!1}):c.appendChild(u)}return r}function pr(){throw new Error(\"Cannot clone a cyclic or repeated node graph\")}function Pt(t,e){let n=String(e);return n===\"\"?null:vt(t,[{type:St,name:n}])}function Ct(t,e){let n=[...new Set(pt(String(e)))];return At(t,n.map(r=>({type:xt,name:r})))}function Mt(t,e){let n=String(e),r=G(n),o=[];for(let s of It(t))j(s)&&(n===\"*\"||(s.namespaceURI===_?s[S]===r:s[S]===n))&&o.push(s);return o}function It(t){let e=[],n=[],r=t[A];for(;r;){e.push(r);let o=r[A],s=r[p];o?(s&&n.push(s),r=o):r=s??n.pop()??null}return e}function it(t){let e=It(t);return e.unshift(t),e}var J=class extends ge{nodeType=Zn;[S]=\"\";[Y]=null;[pe]=null;[A]=null;[D]=null;[p]=null;[U]=!1;get[k](){return this[I].defaultView[we]}get localName(){return this[S]}get nodeName(){return this[S]}get ownerDocument(){return this[I]}get isConnected(){return this[U]}isDefaultNamespace(e){let n=ae(e);return To(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[D]}set previousSibling(e){}get nextSibling(){return this[p]}set nextSibling(e){}get previousElementSibling(){let e=this[D];for(;e&&e.nodeType!==1;)e=e[D];return e}set previousElementSibling(e){}get nextElementSibling(){let e=this[p];for(;e&&e.nodeType!==1;)e=e[p];return e}set nextElementSibling(e){}get firstChild(){return this[A]}set firstChild(e){}get lastChild(){let e=this[A];for(;e;){let n=e[p];if(n==null)break;e=n}return e}set lastChild(e){}get nodeValue(){return ot(this)?this.data:null}set nodeValue(e){ot(this)&&(this.data=e)}get textContent(){if(ot(this))return this.data;let e=\"\";for(let n of It(this))vn(n)&&(e+=n.data);return e}set textContent(e){if(ot(this))this.data=e;else if(hr(this)){let n=e==null?\"\":String(e);n===\"\"?this.replaceChildren():this.replaceChildren(n)}}cloneNode(e){return _t(this,e)}contains(e){let n=e;for(;n!=null;){if(n===this)return!0;n=n.parentNode}return!1}};function To(t){let e=t;for(;e;)switch(e.nodeType){case $:{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 ae(r.value);e=n.parentElement;break}case Oe:e=e.documentElement;break;case Qn:case he:return null;case De:e=e.ownerElement;break;default:e=e.parentElement}return null}var ee=Symbol(\"insertNode\"),_n=Symbol(\"preflightInsertions\"),Dt=Symbol(\"replaceNode\"),ye=class extends J{remove(){let e=this.parentNode;e&&e.removeChild(this)}replaceWith(...e){let n=xe(e),r=this.parentNode;if(r)return An(o=>{le(r,n);let s=this[p];for(;s&&n.includes(s);)s=s[p];let i=Rn(r,n,o);this.parentNode===r?r[Dt](i,this,o):r[ee](i,s,o)})}before(...e){let n=xe(e),r=this.parentNode;if(r)return An(o=>{le(r,n);let s=this[D];for(;s&&n.includes(s);)s=s[D];let i=Rn(r,n,o);r[ee](i,s?s[p]:r.firstChild,o)})}after(...e){let n=xe(e),r=this.parentNode;if(r)return An(o=>{le(r,n);let s=this[p];for(;s&&n.includes(s);)s=s[p];let i=Rn(r,n,o);r[ee](i,s,o)})}};function An(t){return V(()=>{let e=[];try{t(e)}catch(n){try{Se(e)}catch{}throw n}Se(e)})}function xe(t){return t.map(e=>e instanceof J?e:String(e))}function at(t,e){return e instanceof J?e:t.ownerDocument.createTextNode(String(e))}function le(t,e){for(let n of e){if(!(n instanceof J))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[pe]}}}function Rn(t,e,n){let r=[];for(let s of e)r.push(at(t,s));if(r.length===1)return r[0];let o=t.ownerDocument.createDocumentFragment();o[_n](r);for(let s of r)o[ee](s,null,n);return o}var kt,Pn=0,gr=0,yr=0,Er=0,Ge=!1,Mn=!1,lt=!1,Lt=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=wo(n),o=kt??=new WeakMap,s=o.get(e);s==null&&(s=new Map,o.set(e,s));let i=s.get(this);i==null?Pn++:Cn(i,-1),s.set(this,r),Cn(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),Pn--,Cn(o,-1)),r?.size===0&&e.delete(n)}this.#e.clear(),this.#n.length=0,Pn===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 te(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[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 Q,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 Q,target:t.target,type:t.type})}function Gt(...t){let e=new Q;return e.push(...t),e}function wo(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 Cn(t,e){t.attributes&&(gr+=e),t.characterData&&(yr+=e),t.childList&&(Er+=e),Ge=gr>0,Mn=yr>0,lt=Er>0}var oe=class extends ye{childNodes=new Q;children=new Q;appendChild(e){return V(()=>this[ee](e,null))}insertBefore(e,n){return V(()=>this[ee](e,n||null))}append(...e){return V(()=>{let n=xe(e.filter(r=>r!=null));n.length>1&&le(this,n);for(let r of n)this[ee](at(this,r),null)})}prepend(...e){return V(()=>{let n=xe(e.filter(o=>o!=null));n.length>1&&le(this,n);let r=this.firstChild;for(let o of n)this[ee](at(this,o),r)})}replaceChildren(...e){return V(()=>{let n=xe(e.filter(o=>o!=null));le(this,n);let r;for(;r=this.firstChild;)this.removeChildImmediately(r);for(let o of n)this[ee](at(this,o),null)})}removeChild(e){return V(()=>(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]?it(e):void 0,r=e[D],o=e[p],s=Ht(this,e);if(n)for(let i of n)i[U]=!1;this.queueRemovalMutationRecord(this,e,r,o),n&&this.enqueueTreeReactions(n,\"disconnectedCallback\"),Se(this.collectRemovalHookEffects(e,s))}replaceChild(e,n){return V(()=>this[Dt](e,n))}[Dt](e,n,r){if(le(this,[e]),n.parentNode!==this)throw C(\"The reference node is not a child of this parent\",\"NotFoundError\");let o=n[D],s=n[p],i=this.prepareInsertion(e),a=this[U]?it(n):void 0,c=new Set(i.map(({node:y})=>y)),u=s;for(;u&&c.has(u);)u=u[p];let f=Ht(this,n);if(a){for(let E of a)E[U]=!1;let y=new Set(a);for(let E of i)y.has(E.node)&&(E.shouldDisconnect=!1)}this.commitInsertion(i,u);let g=this[U];return this.queueRemovalMutationRecord(this,n,o,s),this.queueInsertionMutationRecords(i),a&&this.enqueueTreeReactions(a,\"disconnectedCallback\"),this.enqueueInsertionReactions(i,g),this.performOrCollectHookEffects([...this.collectRemovalHookEffects(n,f),...this.collectInsertionHookEffects(i)],r),n}querySelectorAll(e){return At(this,e)}querySelector(e){return vt(this,e)}[ee](e,n,r){return this.validateInsertion(e,n),this.insertIntoValidated(e,n,r),e}[_n](e){for(let n of e)this.validateInsertion(n,null),this.prepareInsertion(n)}validateInsertion(e,n){if(le(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[p]);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):Se(e)}prepareInsertion(e){let n=[];if(e.nodeType===he){let i=e[A];for(;i;)n.push(i),i=i[p]}else n.push(e);let r=this[U],o=this[I],s=[];for(let i of n){let a=i[U],c=a||r,u,f;if(i[I]===o)c&&(u=it(i));else{let g=Rt(i);f=g.nodes,c&&(u=g.treeNodes)}s.push({node:i,nodes:u,adoption:f,shouldDisconnect:a})}return s}commitInsertion(e,n){for(let s of e){let i=s.node[Y];if(i){let a=s.node[D],c=s.node[p];s.source={parent:i,index:Ht(i,s.node),previousSibling:a,nextSibling:c}}}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&&st(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[D];e[p]=n,e[D]=s,s?s[p]=e:this[A]=e,n[D]=e}else{e[p]=null;let s=this[A];if(s){let i;for(;i=s[p];)s=i;s[p]=e,e[D]=s}else this[A]=e,e[D]=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[p];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[D],nextSibling:e[p]}}queueRemovalMutationRecord(e,n,r,o){lt&&te({type:\"childList\",target:e,removedNodes:Gt(n),previousSibling:r,nextSibling:o})}queueInsertionMutationRecords(e){if(lt)for(let n of e){let{node:r,source:o}=n;o&&this.queueRemovalMutationRecord(o.parent,r,o.previousSibling,o.nextSibling),te({type:\"childList\",target:this,addedNodes:Gt(r),previousSibling:n.previousSibling,nextSibling:n.nextSibling})}}collectRemovalHookEffects(e,n){return this.nodeType!==$||Qe(this)?[]:[[()=>this[k].removeChild?.(this,e,n)]]}collectInsertionHookEffects(e){let n=[];for(let r of e){let{node:o,source:s}=r;s?.parent.nodeType===$&&!Qe(s.parent)&&n.push([()=>s.parent[k].removeChild?.(s.parent,o,s.index)]),this.nodeType===$&&!Qe(this)&&n.push([()=>this[k].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){Nr(e,n)}};function br(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[D],i=e[p],a=Ht(t,e);if(o)for(let u of o)u[U]=!1;st(n.nodes,r),lt&&te({type:\"childList\",target:t,removedNodes:Gt(e),previousSibling:s,nextSibling:i}),o&&Nr(o,\"disconnectedCallback\");let c=[];t.nodeType===$&&!Qe(t)&&c.push([()=>t[k].removeChild?.(t,e,a)]),Se(c)}function Ht(t,e){let n=e[D],r=e[p];n?n[p]=r:t[A]=r,r&&(r[D]=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[p]=null,e[D]=null,o}function Nr(t,e){for(let n of t){let r=n[e];typeof r==\"function\"&&bt(n,()=>r.call(n))}}function ct(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 Ut=class{[A]=null;constructor(e){this[z]=e}getNamedItem(e){let n=String(e),r=this[z][x]===_?G(n):n,o=this[A];for(;o;){if(o.name===r)return o;o=o[p]}return null}getNamedItemNS(e,n){let r=ae(e),o=String(n),s=this[A];for(;s;){if(s.localName===o&&s[x]===r)return s;s=s[p]}return null}item(e){let n=this[A],r=0;for(;n;){if(r++===e)return n;n=n[p]}return null}get length(){let e=0,n=this[A];for(;n;)e++,n=n[p];return e}removeNamedItem(e){let n=String(e),r=this[z][x]===_?G(n):n;return V(()=>this.removeNamedItemImmediately(o=>o.name===r))}removeNamedItemNS(e,n){let r=ae(e),o=String(n);return V(()=>this.removeNamedItemImmediately(s=>s.localName===o&&s[x]===r))}removeNamedItemImmediately(e){let n=this[z],r=this[A],o=null;for(;r!=null;){if(e(r)){o&&(o[p]=r[p]),this[A]===r&&(this[A]=r[p]);let s=r.value;return r[p]=null,r[z]=null,Ge&&te({type:\"attributes\",target:n,attributeName:r.name,attributeNamespace:r[x],oldValue:s}),n[k].removeAttribute?.(n,r.name,r[x]),ct(n,r.localName,s,null,r[x]),r}o=r,r=r[p]}return null}setNamedItem(e){return V(()=>this.setNamedItemImmediately(e))}setNamedItemImmediately(e){let n=this[z],r=e[z];if(r!=null&&r!==n)throw C(\"The attribute is already in use by another element.\",\"InUseAttributeError\");let o=null,s=this[A],i=null;for(;s;){if(s.localName===e.localName&&s[x]===e[x]){if(s===e)return s;i?i[p]=e:this[A]=e,e[p]=s[p],s[p]=null,o=s;break}i=s,s=s[p]}o==null&&(i?i[p]=e:this[A]=e),e[z]=n,e[I]=n[I],o&&(o[z]=null);let a=o==null||o.value!==e.value,c=o!=null&&o.name!==e.name;return a&&Ge&&te({type:\"attributes\",target:n,attributeName:e.name,attributeNamespace:e[x],oldValue:o?.value??null}),c&&n[k].removeAttribute?.(n,o.name,o[x]),(a||c)&&n[k].setAttribute?.(n,e.name,e.value,e[x]),a&&ct(n,e.localName,o?.value??null,e.value,e[x]),o}setNamedItemNS(e){return this.setNamedItem(e)}*[Symbol.iterator](){let e=this[A];for(;e;)yield e,e=e[p]}};var ve=class extends J{nodeType=De;[x]=null;[p]=null;[z]=null;constructor(e,n,r){super(),this[S]=e,this[me]=n,r&&(this[x]=r)}get nodeName(){return this[S]}set nodeName(e){}get name(){return this[S]}set name(e){}get localName(){if(this[x]==null)return this[S];let e=this[S].indexOf(\":\");return e<0?this[S]:this[S].slice(e+1)}get prefix(){if(this[x]==null)return null;let e=this[S].indexOf(\":\");return e<0?null:this[S].slice(0,e)}get value(){return this[me]}set value(e){let n=String(e),r=this[z];if(!r){this[me]=n;return}V(()=>{let o=this[me];this[me]=n,Ge&&o!==n&&te({type:\"attributes\",target:r,attributeName:this[S],attributeNamespace:this[x],oldValue:o}),this[k].setAttribute?.(r,this[S],n,this[x]),ct(r,this.localName,o,n,this[x])})}get nodeValue(){return this.value}set nodeValue(e){this.value=e}get ownerElement(){return this[z]}get namespaceURI(){return this[x]}get specified(){return!0}};var Oo={amp:\"&\",AMP:\"&\",apos:\"'\",gt:\">\",GT:\">\",lt:\"<\",LT:\"<\",quot:'\"',QUOT:'\"'},So=new Set([\"area\",\"base\",\"br\",\"col\",\"embed\",\"hr\",\"img\",\"input\",\"link\",\"meta\",\"param\",\"source\",\"track\",\"wbr\"]),xo=/(?:<([a-z][a-z0-9-:]*)((?:[\\s]+[^<>'\"=/\\s]+(?:=(['\"])[^]*?\\3|=[^>'\"\\s]*|))*)[\\s]*(\\/?)\\s*>|<\\/([a-z][a-z0-9-:]*)>|<!--(.*?)-->|([^<>]+))/gi,Or=/\\s([^<>'\"=/\\n\\s]+)(?:=([\"'])([\\s\\S]*?)\\2|=([^>'\"\\n\\s]*)|)/g,vo=\"|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|\",Ao=/^(?:color|face|size)$/i;function Tr(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 Oo[n];let s=Number.parseInt(r??o,r?10:16);try{return String.fromCodePoint(s)}catch{return e}})}function Sr(t){return t.namespaceURI===_&&So.has(t.localName)}function wr(t){let e=t.localName;return t[x]===Z&&(e===\"foreignObject\"||e===\"desc\"||e===\"title\")}function Ro(t,e){if(vo.includes(`|${t}|`))return!0;if(t!==\"font\")return!1;for(let n of e.matchAll(Or))if(Ao.test(n[1]))return!0;return!1}function Bt(t,e){let n=e.ownerDocument,r=n.createDocumentFragment(),o=[],s=r;for(let i of t.matchAll(xo)){let a=i[1];if(a){let c=i[2],u=G(a),f=o[o.length-1]?.element??e,g=f[x]===Z?Z:_;if(u===\"svg\")g=Z;else if(g===Z){if(wr(f))g=_;else if(Ro(u,c)){for(;o.length>0;){let v=o[o.length-1];if(v.element[x]!==Z||wr(v.element))break;o.pop(),s=v.target}g=_}}let y=g===_?u:a,E=n[Ie](y,g,null,y);for(let v of c.matchAll(Or))E.setAttribute(v[1],Tr(v[3]||v[4]||\"\"));if(s.append(E),Sr(E)||g!==_&&i[4])continue;o.push({element:E,target:s}),s=g===_&&u===\"template\"?E.content:E}else if(i[5]){let c=G(i[5]);for(let u=o.length-1;u>=0;u--){let f=o[u],g=G(f.element[S]);if(g===c){s=f.target,o.length=u;break}if(f.element[x]===_&&g===\"template\")break}}else i[6]?s.append(n.createComment(i[6])):s.append(Tr(i[7]))}return r}function Vt(t){return vr([{type:\"content\",child:t[A]}])}function xr(t){return vr([{type:\"opening\",node:t}])}function vr(t){let e=[],n;for(;n=t.pop();)switch(n.type){case\"opening\":{let r=n.node;switch(r.nodeType){case $:{let o=r;e.push(`<${o[S]}`);let s=o[re]?.[A];for(;s;){e.push(` ${s[S]}`);let a=s[me];a!==\"\"&&(a=String(a).replace(/&/g,\"&amp;\").replace(/\"/g,\"&quot;\"),e.push(`=\"${a}\"`)),s=s[p]}if(e.push(\">\"),Sr(o))break;let i=o.namespaceURI===_&&o.localName===\"template\"?o[ie]:o;t.push({type:\"closing\",name:o[S]}),t.push({type:\"content\",child:i?.[A]??null});break}case ke:{let o=r;e.push(o[K].replace(/&/g,\"&amp;\").replace(/\"/g,\"&quot;\").replace(/</g,\"&lt;\").replace(/>/g,\"&gt;\"));break}case Le:{let o=r;e.push(`<!--${o[K]}-->`);break}}break}case\"content\":{let r=n.child;r&&(t.push({type:\"content\",child:r[p]}),t.push({type:\"opening\",node:r}));break}case\"closing\":e.push(`</${n.name}>`);break}return e.join(\"\")}var H=class extends oe{nodeType=$;[x]=_;[fe]=null;get namespaceURI(){return this[x]}get prefix(){return this[fe]}get localName(){let e=this[fe];return e==null?this[S]:this[S].slice(e.length+1)}get nodeName(){return this[x]===_?er(this[S]):this[S]}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[re];return e||(e=new Ut(this),this[re]=e),e}getAttributeNames(){return[...this.attributes].map(e=>e.name)}getElementsByTagName(e){return Mt(this,e)}get firstElementChild(){return this.children[0]??null}getElementsByClassName(e){return Ct(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);pn(r);let s=this[x]===_?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=ae(e),s=String(n),i=String(r),a=ht(o,s,\"attribute\"),c=this.attributes.getNamedItemNS(a.namespace,a.localName);c?c.value=i:this.attributes.setNamedItemNS(new ve(a.qualifiedName,i,a.namespace))}toggleAttribute(e,n){let r=String(e);pn(r);let o=this[x]===_?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[x]===_?G(n):n;this.attributes.removeNamedItemNS(null,r)}removeAttributeNS(e,n){this.attributes.removeNamedItemNS(e,n)}get outerHTML(){return xr(this)}get innerHTML(){return Vt(this)}set innerHTML(e){if(e==null||e===\"\")this.replaceChildren();else{let n=Bt(String(e),this);this.replaceChildren(n)}}};var He=class t extends H{[x]=Z;get ownerSVGElement(){let e=null,n=this.parentNode;for(;n instanceof t;)e=n,n=n.parentNode;return e}};var Ee=class extends ye{[K]=\"\";constructor(e){super(),this[K]=e==null?\"\":String(e)}setData(e){let n=Mn,r=n?this[K]:null,o=\"\";e!=null&&(o=typeof e==\"string\"?e:String(e)),this[K]=o,n&&r!==o&&te({type:\"characterData\",target:this,oldValue:r}),this[k].setText?.(this,o)}get data(){return this[K]}set data(e){this.setData(e)}};var Ue=class extends Ee{nodeType=ke;[S]=\"#text\"};var Be=class extends Ee{nodeType=Le;[S]=\"#comment\"};var Ve=class extends oe{nodeType=he;[S]=\"#document-fragment\";[I]=typeof window<\"u\"?window.document:null;getElementById(e){return Pt(this,e)}};var Fe=class extends H{get content(){let e=this[ie];return e||(e=this.ownerDocument.createDocumentFragment(),e[pe]=this,this[ie]=e),e}set content(e){}set innerHTML(e){this.content.replaceChildren(Bt(String(e),this))}get innerHTML(){let e=this[ie];return e?Vt(e):\"\"}};var Ft=class extends H{};var jt=class extends H{};var qt=class extends H{};var ut=class extends oe{nodeType=Oe;[S]=\"#document\";[U]=!0;constructor(e){super(),this.defaultView=e,this[I]=this,this.documentElement=Yt(new qt,this,\"html\"),this.body=Yt(new Ft,this,\"body\"),this.head=Yt(new jt,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 Ct(this,e)}createElement(e){let n=String(e);return rr(n),In(this,G(n))}createElementNS(e,n){let r=ht(e,n,\"element\");return In(this,r.qualifiedName,r.namespace,r.prefix,r.localName)}[Ie](e,n,r,o){return In(this,e,n,r,o)}createTextNode(e){let n=zt(new Ue(e),this);return this[k].createText?.(n,n.data),n}createComment(e){return zt(new Be(e),this)}createDocumentFragment(){return zt(new Ve,this)}createEvent(){return new B(\"\")}getElementById(e){return Pt(this,e)}getElementsByTagName(e){return Mt(this,e)}importNode(e,n){if(e.nodeType===Oe)throw C(\"Cannot import a document node\",\"NotSupportedError\");return _t(e,n,this)}adoptNode(e){if(e[I]===this)return e;let n=Rt(e);return V(()=>{let r=e.parentNode;return r?br(r,e,n,this):st(n.nodes,this),e})}};function zt(t,e){return Object.defineProperty(t,I,{value:e,writable:!0,enumerable:!1}),t}function In(t,e,n=_,r=null,o=e){let s;if(n===Z)s=new He;else if(n===_&&o===\"template\")s=new Fe;else if(n===_){let i=t.defaultView.customElements.get(o);s=i?new i:new H}else s=new H;return Yt(s,t,e,n,r)}function Yt(t,e,n,r=_,o=null){return zt(t,e),Object.defineProperties(t,{[S]:{value:n},[x]:{value:r},[fe]:{value:o}}),e[k].createElement?.(t,r),t}var Wt=class extends B{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 $t=class extends B{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 B{constructor(e,n){super(e,n),this.promise=n.promise,this.reason=n.reason}};var Kt=class extends B{constructor(e,n){super(e,n),this.oldState=n.oldState,this.newState=n.newState}};var Zt=class extends B{constructor(e,n={}){super(e,n),this.relatedTarget=n.relatedTarget??null}};var Qt=class extends B{constructor(e,n={}){super(e,n),this.clipboardData=n.clipboardData??null}};var Jt=class extends H{};var _o=/^[a-z][^A-Z\\u0000\\t\\n\\f\\r />]*-[^A-Z\\u0000\\t\\n\\f\\r />]*$/u,Po=new Set([\"annotation-xml\",\"color-profile\",\"font-face\",\"font-face-src\",\"font-face-uri\",\"font-face-format\",\"font-face-name\",\"missing-glyph\"]);function Ar(t){return _o.test(t)&&!Po.has(t)}function Rr(t){return C(`Invalid custom element name: \"${t}\"`,\"SyntaxError\")}var en=class{registry=new Map;listenersByName=new Map;define(e,n,r){if(!Ar(e))throw Rr(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(!Ar(e))return Promise.reject(Rr(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 Co=[\"onerror\",\"onunhandledrejection\"],Pr=Symbol.for(\"@remote-dom/polyfill/global-property\");function Cr(t){return Object.getOwnPropertyDescriptors(t)}function Mr(t){let e={};for(let[n,r]of Object.entries(Object.getOwnPropertyDescriptors(ge.prototype)))n!==\"constructor\"&&typeof r.value==\"function\"&&(r.value=Dn(r.value.bind(t)),e[n]=r);return e}function Ir(t){let e={};for(let n of Co)e[n]={configurable:!0,enumerable:!0,get:Dn(()=>t[n]),set:Dn(r=>{t[n]=r})};return e}function Mo(t){return Object.assign(Cr(t),Mr(t),Ir(t))}function Dn(t){return Object.defineProperty(t,Pr,{value:!0}),t}function _r(t,e){for(let n of Reflect.ownKeys(e)){let r=Io(t,n);(r==null||Do(r))&&Object.defineProperty(t,n,e[n])}}function Io(t,e){let n=t;for(;n;){let r=Object.getOwnPropertyDescriptor(n,e);if(r)return r;n=Object.getPrototypeOf(n)}}function Do(t){return[t.value,t.get,t.set].some(e=>typeof e==\"function\"&&e[Pr]===!0)}var Ae=class extends ge{[k]={};[mt]=[];[we]=Lo(this);name=\"\";window=this;parent=this;self=this;top=this;document=new ut(this);customElements=new en;location=globalThis.location;navigator=globalThis.navigator;Event=B;ErrorEvent=$t;PromiseRejectionEvent=Xt;ToggleEvent=Kt;FocusEvent=Zt;ClipboardEvent=Qt;EventTarget=ge;CustomEvent=Wt;Node=J;ParentNode=oe;ChildNode=ye;DocumentFragment=Ve;Document=ut;CharacterData=Ee;Comment=Be;Text=Ue;Element=H;HTMLElement=Jt;SVGElement=He;HTMLTemplateElement=Fe;MutationObserver=Lt;#t=null;#n=null;#e=null;static with(...e){let n=this;return class extends n{constructor(){super();for(let o of e)ko(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=Cr(e),s=Object.assign(Mr(e),Ir(e));delete o.self,Object.defineProperties(globalThis,o),_r(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),_r(n,s))}static setGlobalThis(e){for(let n in e)e[n]===e&&(e[n]=globalThis);Object.defineProperties(globalThis,Mo(e))}};function ko(t,e){t[mt].push(e(t)??{})}function Lo(t){return{createElement:ce.bind(null,t,\"createElement\"),setAttribute:ce.bind(null,t,\"setAttribute\"),removeAttribute:ce.bind(null,t,\"removeAttribute\"),createText:ce.bind(null,t,\"createText\"),setText:ce.bind(null,t,\"setText\"),insertChild:ce.bind(null,t,\"insertChild\"),removeChild:ce.bind(null,t,\"removeChild\"),addEventListener:ce.bind(null,t,\"addEventListener\"),removeEventListener:ce.bind(null,t,\"removeEventListener\")}}function ce(t,e,...n){for(let s of t[mt])s[e]?.apply(s,n);let r=t[k];r[e]?.apply(r,n)}var tn=new Ae;var kn=\"~\";var be=new WeakMap;function je(t){return be.get(t)}var Un=new WeakMap,Ho=0;function X(t){let e=Un.get(t);return e==null&&(e=String(Ho++),nn(t,e)),e}function nn(t,e){Un.set(t,e)}var Gn=new WeakMap;function Uo(t){return Gn.get(t)}var Hn=new WeakMap;function Bo(t){let e=Hn.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 Vo=new WeakMap;function Fo(t){return Vo.get(t)}function Bn(t,e,n){let r=Gn.get(t);if(r==null&&(r={},Gn.set(t,r)),r[e]===n)return;r[e]=n;let o=be.get(t);o?.mutate([[3,X(t),e,n,1]])}function Ne(t,e,n){let r=Hn.get(t);if(r==null&&(r={},Hn.set(t,r)),r[e]===n)return;n==null?delete r[e]:r[e]=String(n);let o=be.get(t);o?.mutate([[3,X(t),e,n,2]])}function qe(t,e){if(be.get(t)!==e&&(be.set(t,e),t.childNodes))for(let r=0;r<t.childNodes.length;r++)qe(t.childNodes[r],e)}function rn(t){if(be.get(t)!=null&&(be.delete(t),t.childNodes))for(let n=0;n<t.childNodes.length;n++)rn(t.childNodes[n])}function ze(t){let{nodeType:e}=t;switch(e){case 1:return{id:X(t),type:e,element:t.localName,properties:Ln(Uo(t)),attributes:Ln(Bo(t)),eventListeners:Ln(Fo(t)),children:Array.from(t.childNodes).map(ze)};case 3:case 8:return{id:X(t),type:e,data:t.data};default:throw new Error(`Cannot serialize node of type ${t.nodeType} (${typeof t.nodeType})`)}}function Ln(t){return t?{...t}:void 0}function Vn(t,e,...n){let r=Un.get(t),o=be.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 Ye=tn[k];Ye.insertChild=(t,e,n)=>{let r=je(t);r!=null&&(qe(e,r),r.mutate([[0,X(t),ze(e),n]]))};Ye.removeChild=(t,e,n)=>{let r=je(t);r!=null&&(rn(e),r.mutate([[1,X(t),n]]))};Ye.setText=(t,e)=>{let n=je(t);n?.mutate([[2,X(t),e]])};Ye.setAttribute=(t,e,n)=>{t.tagName.includes(\"-\")||Ne(t,e,n)};Ye.removeAttribute=(t,e)=>{t.tagName.includes(\"-\")||Ne(t,e)};Ae.setGlobal(tn);function on(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 kr=[\"wheel\",\"drag\",\"pinch\"];function Lr(t){let e=t;return typeof t==\"object\"&&t!==null&&e.graview===\"host-hello\"&&typeof e.nonce==\"string\"}function Hr(t,e={}){let n,r=\"\",o,s=0,i=new Set,a=new Map,c=[],u=b=>{n?n.postMessage({...b,nonce:r}):c.push(b)},f=b=>{let N=b.data;if(!(!N||typeof N!=\"object\")){if(N.type===\"props\"){o=N.props;for(let M of i)M(N.props)}else N.type===\"answer\"?(a.get(N.id)?.(N),a.delete(N.id)):N.type===\"event\"&&typeof N.listener==\"number\"?e.onEvent?.(N):N.type===\"heartbeat\"&&typeof N.beat==\"number\"&&u({type:\"heartbeat\",beat:N.beat});e.onMessage?.(N)}},g=()=>{},y=b=>{if(n||!t.fromHost(b)||!Lr(b.data)||b.data.protocol!==1)return;let N=b.ports[0];if(N){n=N,r=b.data.nonce,n.onmessage=f,n.start?.(),g();for(let M of c.splice(0))u(M)}};g=t.listen(y),t.ready({graview:\"guest-ready\",protocol:1});let E,v={get props(){return o},subscribe(b){return i.add(b),()=>i.delete(b)},act(b,N={}){let M=s+=1;return new Promise(L=>{a.set(M,L),u({type:\"act\",id:M,name:b,args:N})})},navigate(b){let N=on(b);N&&u(N)},size(b){u({type:\"size\",height:b})},autoSize(b){let N=b??globalThis.document?.documentElement,M=globalThis.ResizeObserver;if(!N||!M||typeof N.getBoundingClientRect!=\"function\")return()=>{};E?.disconnect();let L=new M(()=>v.size(Math.ceil(N.getBoundingClientRect().height)));return L.observe(N),E=L,()=>L.disconnect()},close(){E?.disconnect(),g(),n?.close(),i.clear()}};return{guest:v,send:u}}var Br=[\"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\"],Vr=[\"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\"],Fr=[\"self\",\"postMessage\",\"setTimeout\",\"clearTimeout\",\"setInterval\",\"clearInterval\",\"queueMicrotask\",\"structuredClone\",\"crypto\",\"console\",\"DOMException\"],jr=[\"TEMPORARY\",\"PERSISTENT\"],Nl=Object.freeze([...Br,...Vr,...Fr,...jr]),Tl=Object.freeze([\"constructor\",\"__defineGetter__\",\"__defineSetter__\",\"hasOwnProperty\",\"__lookupGetter__\",\"__lookupSetter__\",\"isPrototypeOf\",\"propertyIsEnumerable\",\"toString\",\"valueOf\",\"__proto__\",\"toLocaleString\"]),Ur=t=>typeof t==\"symbol\"?`[${t.description??\"symbol\"}]`:t;function qr(t=globalThis,e=[],n={}){let r=[],o=[],s=new Set([...Br,...Vr,...Fr,...e,\"constructor\",Symbol.toStringTag]),i=(O,P)=>{let q=Reflect.getOwnPropertyDescriptor(O,P);return q===void 0||!(\"value\"in q)||q.writable||q.configurable?!1:n.primitivesStay&&typeof P==\"symbol\"&&(typeof q.value!=\"object\"||q.value===null)&&typeof q.value!=\"function\"?!0:jr.includes(P)&&typeof q.value==\"number\"},a=t,c=a.setTimeout,u=a.setInterval,f=a.crypto,g=(O,P)=>function(q,We,...ft){if(typeof q!=\"function\")throw new TypeError(`${P} takes a function: a guest view cannot run code from text`);return O.call(t,q,We,...ft)},y=f?Object.freeze({getRandomValues:O=>f.getRandomValues(O)}):void 0,E=a.document?.defaultView;if(E&&E!==a)for(let O of Reflect.ownKeys(E))typeof O==\"symbol\"||s.has(O)||Reflect.deleteProperty(E,O)||o.push(`window.${O}`);let v=[];for(let O=t;O&&O!==Object.prototype;O=Object.getPrototypeOf(O))v.push(O);for(let O of v)for(let P of Reflect.ownKeys(O))s.has(P)||(Reflect.deleteProperty(O,P)?r.push(Ur(P)):i(O,P)||o.push(Ur(P)));let b=()=>function(){throw new EvalError(\"A guest view cannot make code from text.\")},N=[Function.prototype,Object.getPrototypeOf(async function(){}),Object.getPrototypeOf(function*(){}),Object.getPrototypeOf(async function*(){})];for(let O of N){let P=b();Object.defineProperty(P,\"prototype\",{value:O,writable:!1,enumerable:!1,configurable:!1}),Reflect.defineProperty(O,\"constructor\",{value:P,writable:!1,enumerable:!1,configurable:!1})||o.push(\"Function.prototype.constructor\"),O===Function.prototype&&Reflect.defineProperty(t,\"Function\",{value:P,writable:!0,enumerable:!1,configurable:!0})}let M=(O,P)=>{Reflect.defineProperty(t,O,{value:P,writable:!0,enumerable:!0,configurable:!0})||o.push(O)};M(\"setTimeout\",g(c,\"setTimeout\")),M(\"setInterval\",g(u,\"setInterval\")),y&&M(\"crypto\",y);for(let O of v.slice(1))Object.freeze(O);for(let O of Reflect.ownKeys(t)){let P=Reflect.getOwnPropertyDescriptor(t,O);Reflect.defineProperty(t,O,\"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 dt=class extends HTMLElement{constructor(){super(),nn(this,kn)}connect(e){if(je(this)===e||(qe(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,kn,ze(o),r])}e.mutate(n)}updateRemoteProperty(e,n){Bn(this,e,n)}callRemoteMethod(e,...n){return Vn(this,e,...n)}};var d={},Fn={empty:!0},jo={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\"},jn={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:Fn,br:Fn,wbr:Fn,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:{attributes:{href:\"link\"}},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\":{empty:!0,attributes:{autoplay:\"boolean\",cover:\"boolean\"}}},qo=[\"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\",\"filter\",\"flood-color\",\"flood-opacity\",\"lighting-color\",\"color-interpolation-filters\"],zo={id:\"text\",class:\"text\",style:\"style\",lang:\"text\",role:\"text\",tabindex:{oneOf:[\"-1\",\"0\"]},transform:\"geometry\",...Object.fromEntries(qo.map(t=>[t,\"css\"]))},ue={x:\"geometry\",y:\"geometry\",width:\"geometry\",height:\"geometry\"},sn={viewBox:\"geometry\",preserveAspectRatio:\"geometry\"},zr={oneOf:[\"userSpaceOnUse\",\"objectBoundingBox\"]},Yr={oneOf:[\"R\",\"G\",\"B\",\"A\"]},ne={...ue,in:\"text\",result:\"text\"},Wr={gradientUnits:{oneOf:[\"userSpaceOnUse\",\"objectBoundingBox\"]},gradientTransform:\"geometry\",spreadMethod:{oneOf:[\"pad\",\"reflect\",\"repeat\"]},href:\"fragment\"},$r={svg:{attributes:{...ue,...sn}},g:d,defs:d,symbol:{attributes:{...ue,...sn,refX:\"geometry\",refY:\"geometry\"}},use:{attributes:{...ue,href:\"fragment\"}},title:d,desc:d,path:{attributes:{d:\"geometry\",pathLength:\"number\"}},rect:{attributes:{...ue,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\",...Wr}},radialGradient:{attributes:{cx:\"geometry\",cy:\"geometry\",r:\"geometry\",fx:\"geometry\",fy:\"geometry\",fr:\"geometry\",...Wr}},stop:{attributes:{offset:\"geometry\"}},clipPath:{attributes:{clipPathUnits:{oneOf:[\"userSpaceOnUse\",\"objectBoundingBox\"]}}},mask:{attributes:{...ue,maskUnits:{oneOf:[\"userSpaceOnUse\",\"objectBoundingBox\"]},maskContentUnits:{oneOf:[\"userSpaceOnUse\",\"objectBoundingBox\"]}}},pattern:{attributes:{...ue,...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\"]}}},a:d,filter:{attributes:{...ue,filterUnits:zr,primitiveUnits:zr}},feBlend:{attributes:{...ne,in2:\"text\",mode:\"text\"}},feColorMatrix:{attributes:{...ne,type:{oneOf:[\"matrix\",\"saturate\",\"hueRotate\",\"luminanceToAlpha\"]},values:\"geometry\"}},feComponentTransfer:{attributes:ne},...Object.fromEntries([\"feFuncR\",\"feFuncG\",\"feFuncB\",\"feFuncA\"].map(t=>[t,{attributes:{type:{oneOf:[\"identity\",\"table\",\"discrete\",\"linear\",\"gamma\"]},tableValues:\"geometry\",slope:\"number\",intercept:\"number\",amplitude:\"number\",exponent:\"number\",offset:\"number\"}}])),feComposite:{attributes:{...ne,in2:\"text\",operator:{oneOf:[\"over\",\"in\",\"out\",\"atop\",\"xor\",\"lighter\",\"arithmetic\"]},k1:\"number\",k2:\"number\",k3:\"number\",k4:\"number\"}},feDisplacementMap:{attributes:{...ne,in2:\"text\",scale:\"number\",xChannelSelector:Yr,yChannelSelector:Yr}},feDropShadow:{attributes:{...ne,dx:\"number\",dy:\"number\",stdDeviation:\"geometry\"}},feFlood:{attributes:ne},feGaussianBlur:{attributes:{...ne,stdDeviation:\"geometry\",edgeMode:{oneOf:[\"duplicate\",\"wrap\",\"none\"]}}},feMerge:{attributes:ne},feMergeNode:{attributes:{in:\"text\"}},feMorphology:{attributes:{...ne,operator:{oneOf:[\"erode\",\"dilate\"]},radius:\"geometry\"}},feOffset:{attributes:{...ne,dx:\"number\",dy:\"number\"}},feTurbulence:{attributes:{...ue,result:\"text\",type:{oneOf:[\"fractalNoise\",\"turbulence\"]},baseFrequency:\"geometry\",numOctaves:\"number\",seed:\"number\",stitchTiles:{oneOf:[\"stitch\",\"noStitch\"]}}}};var Xr={section:[\"aria-label\",\"title\"]};function Yo(t){return/^aria-[a-z]+$/.test(t)}function Wo(t){return/^data-[a-z0-9][a-z0-9_.-]*$/.test(t)}var $o=new Map(Object.keys($r).map(t=>[t.toLowerCase(),t]));function Kr(t){return $o.get(t.toLowerCase())}function Zr(t,e,n){let r=n.toLowerCase(),o=t===\"html\"?[jn[e]?.attributes,jo]:[$r[e]?.attributes,zo],s=t===\"svg\"&&r===\"xlink:href\"?\"href\":r;for(let i of o)if(i){for(let[a,c]of Object.entries(i))if(a.toLowerCase()===s)return{name:a,kind:c}}if(Yo(r)||Wo(r))return{name:r,kind:\"text\"}}var an=/^\\d{4}-\\d{2}-\\d{2}$/;function Xo(t,e){if(typeof t!=\"string\"||typeof e!=\"string\"||!an.test(t)||!an.test(e))return;let n=Math.round((Date.parse(`${t}T00:00:00Z`)-Date.parse(`${e}T00:00:00Z`))/864e5);return Number.isFinite(n)?n:void 0}function Qr(t,e,n={}){let r=Xo(t,e);if(r===void 0)return\"\";if(r===0)return\"today\";if(r===1)return\"tomorrow\";if(r<0&&n.due===!0)return\"overdue\";if(r===-1)return\"yesterday\";let o=Math.abs(r),[s,i]=o<14?[o,\"day\"]:o<60?[Math.round(o/7),\"week\"]:o<730?[Math.round(o/30.44),\"month\"]:[Math.round(o/365.25),\"year\"],a=`${s} ${i}${s===1?\"\":\"s\"}`;return r>0?`in ${a}`:`${a} ago`}function Jr(t,e){if(typeof t!=\"string\")return;if(an.test(t))return t;let n=Date.parse(t);if(Number.isFinite(n)){if(!/(Z|[+-]\\d\\d:?\\d\\d)$/.test(t))return an.test(t.slice(0,10))?t.slice(0,10):void 0;try{let r=new Intl.DateTimeFormat(\"en-CA\",{timeZone:e||\"UTC\",year:\"numeric\",month:\"2-digit\",day:\"2-digit\"}).formatToParts(n),o=s=>r.find(i=>i.type===s)?.value??\"\";return`${o(\"year\")}-${o(\"month\")}-${o(\"day\")}`}catch{return new Date(n).toISOString().slice(0,10)}}}var eo=\"~\",ln=t=>typeof t==\"object\"&&t!==null&&!Array.isArray(t),se=(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=>se(n,e+1)):Object.fromEntries(Object.entries(t).map(([n,r])=>[n,se(r,e+1)]))};function to(){let t=new Map,e=new Map,n=new Map([[eo,{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},s=u=>{let f=t.get(u);f&&(f.count-=1,!(f.count>0)&&(t.delete(u),e.delete(f.listener)))},i=u=>{let f=n.get(u);if(f){n.delete(u);for(let g of f.listeners.values())s(g);for(let g of f.children)i(g)}},a=(u,f,g=0)=>{if(!ln(u)||g>64)return se(u);let y=typeof u.id==\"string\"?u.id:void 0,E=f&&y!==void 0&&y!==eo;E&&i(y);let v={children:[],listeners:new Map};E&&n.set(y,v);let b={};for(let[N,M]of Object.entries(u))N===\"children\"&&Array.isArray(M)?b[N]=M.map(L=>{let O=a(L,E,g+1);return E&&ln(L)&&typeof L.id==\"string\"&&v.children.push(L.id),O}):N===\"eventListeners\"&&ln(M)?b[N]=Object.fromEntries(Object.entries(M).map(([L,O])=>{if(typeof O!=\"function\"||!E)return[L,void 0];let P=o(O);return v.listeners.set(L,P),[L,{listener:P}]})):b[N]=se(M,g+1);return b},c=u=>{if(!Array.isArray(u))return se(u);let[f,g]=u,y=typeof g==\"string\"?n.get(g):void 0;if(f===0){let E=a(u[2],y!==void 0),v=ln(u[2])?u[2].id:void 0;if(y&&typeof v==\"string\"&&n.has(v)){let b=Number(u[3]);y.children.splice(Number.isInteger(b)&&b>=0&&b<=y.children.length?b:y.children.length,0,v)}return[f,se(g),E,se(u[3])]}if(f===1){let E=Number(u[2]);return y&&Number.isInteger(E)&&E>=0&&E<y.children.length&&i(y.children.splice(E,1)[0]),se(u)}if(f===3&&u[4]===3){let E=String(u[2]),v=u[3],b=y&&typeof v==\"function\"?o(v):void 0,N=y?.listeners.get(E);return N!==void 0&&s(N),b===void 0?y?.listeners.delete(E):y.listeners.set(E,b),[f,se(g),E,b===void 0?void 0:{listener:b},3]}return se(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 cn=\"graview-view-root\",Ko=[\"value\",\"checked\",\"key\",\"pressed\",\"files\",\"refused\",\"x\",\"y\",\"width\",\"height\",\"deltaX\",\"deltaY\",\"deltaMode\",\"ctrlKey\",\"metaKey\",\"phase\",\"pointerId\",\"button\",\"pressure\",\"dx\",\"dy\",\"scale\",\"rotation\"],Zo=t=>t.replace(/&/g,\"&amp;\").replace(/</g,\"&lt;\").replace(/>/g,\"&gt;\").replace(/\"/g,\"&quot;\").replace(/'/g,\"&#39;\"),Qo=t=>Object.freeze({html:t,toString:()=>t}),no=t=>typeof t==\"object\"&&t!==null&&typeof t.html==\"string\"&&Object.isFrozen(t),ro=t=>t==null||t===!1?\"\":Array.isArray(t)?t.map(ro).join(\"\"):no(t)?t.html:Zo(String(t));function oo(t){customElements.get(cn)||customElements.define(cn,dt);let e=Event,n=to(),r=new Set,o=new Set,s,i=[],a=new Set;for(let l of[\"closest\",\"matches\",\"dataset\"]){let m=()=>{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:m}:{value:m})}let c=document.createElement(cn),u=l=>{let m=h=>{for(let T of Array.from(h.childNodes)){if(T.nodeType!==1)continue;if(X(T)===l)return T;let w=m(T);if(w)return w}};return m(c)},f=l=>{let m=u(l.target);if(!m)return;let h=new e(l.event,{bubbles:!0}),T={};for(let w of Ko)l[w]!==void 0&&(T[w]=l[w]);for(let w of Object.keys(T))Object.defineProperty(h,w,{value:T[w],enumerable:!0});m.dispatchEvent(h);for(let w of o){if(w.type!==l.event)continue;let R;try{R=new Set(Array.from(c.querySelectorAll(w.selector)))}catch{continue}for(let F=m;F&&F!==c;F=F.parentNode)if(R.has(F)){w.listener(Object.freeze({type:l.event,target:m,element:F,...T}));break}}},g=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;s=l.props;let m=t.now();for(let w of r)try{w(l.props)}catch(R){t.threw(R)}let h=t.now()-m,T=l.push;typeof T==\"number\"&&t.microtask(()=>t.microtask(()=>t.send({type:\"pushed\",push:T,ms:h})))},y;c.connect({mutate(l){y||(y=[],t.microtask(()=>{let m=y??[];y=void 0,t.send({type:\"render\",records:n.encode(m)})})),y.push(...l)},call:()=>{}});let E=l=>l.nodeType===1?l.getAttribute(\"data-key\")??l.getAttribute(\"id\"):null,v=(l,m)=>l.nodeType===m.nodeType&&(l.nodeType!==1||l.localName===m.localName&&l.namespaceURI===m.namespaceURI&&E(l)===E(m));function b(l,m){let h=Array.from(m.childNodes),T=0;for(let w of h){let R=l.childNodes[T]??null;if(R&&v(R,w)){N(R,w),T+=1;continue}if(E(w)!==null){let de=Array.from(l.childNodes).slice(T+1).find($e=>v($e,w));if(de){l.insertBefore(de,R),N(de,w),T+=1;continue}}l.insertBefore(w,R),T+=1}for(;l.childNodes.length>T;)l.removeChild(l.lastChild)}function N(l,m){if(l.nodeType!==1){l.data!==m.data&&(l.data=m.data);return}let h=l,T=m,w=M(h);for(let R of h.getAttributeNames())T.hasAttribute(R)||(h.removeAttribute(R),w&&Ne(h,R,void 0));for(let R of T.getAttributeNames()){let F=T.getAttribute(R);h.getAttribute(R)!==F&&h.setAttribute(R,F),w&&Ne(h,R,F)}b(h,T)}let M=l=>l.localName.includes(\"-\");function L(l){for(let m of Array.from(l.childNodes)){if(m.nodeType!==1)continue;let h=m;if(M(h))for(let T of h.getAttributeNames())Ne(h,T,h.getAttribute(T)??void 0);L(h)}}function O(l,m,h){for(let T of Array.from(l.childNodes)){if(T.nodeType!==1)continue;let w=T,R=w.localName,F=m||R.toLowerCase()===\"svg\",de=F?Kr(R):Object.prototype.hasOwnProperty.call(jn,R.toLowerCase())?R.toLowerCase():void 0;if(!de){h.add(`<${R}>`);continue}for(let $e of w.getAttributeNames())(!Zr(F?\"svg\":\"html\",de,$e)||!F&&Xr[de]?.includes($e.toLowerCase()))&&h.add(`${de} ${$e}`);O(w,F,h)}}function P(l){let m=document.createElement(\"div\"),h=Array.isArray(l)?l:[l];for(let w of h)if(w!=null)if(typeof w==\"string\"||no(w)){let R=document.createElement(\"div\");R.innerHTML=typeof w==\"string\"?w:w.html,m.append(...Array.from(R.childNodes))}else m.append(w);let T=new Set;O(m,!1,T),i=[...T],i.length>0&&t.warn(`The host will not draw: ${i.join(\", \")}`),L(m),b(c,m)}let q=[],We=new Set(kr),ft=\"[]\",un=!1,Wn=()=>{un||(un=!0,t.microtask(()=>{un=!1;let l=[...new Map([...o].filter(h=>We.has(h.type)).map(h=>[`${h.type} ${h.selector}`,{event:h.type,selector:h.selector}])).entries()].sort(([h],[T])=>h<T?-1:h>T?1:0).map(([,h])=>h),m=JSON.stringify(l);m!==ft&&(ft=m,t.send({type:\"gestures\",bound:l}))}))},$n=\"[[],[]]\",dn=!1,Xn=()=>{dn||(dn=!0,t.microtask(()=>{dn=!1;let l=w=>[...new Set([...o].filter(R=>R.type===w&&typeof R.selector==\"string\").map(R=>R.selector))].sort().slice(0,200),m=l(\"click\"),h=l(\"acted\"),T=JSON.stringify([m,h]);T!==$n&&($n=T,t.send({type:\"clicks\",selectors:m,...h.length>0?{acted:h}:{}}))}))},Kn=Object.freeze({get props(){return s},onProps(l){return r.add(l),s&&l(s),()=>void r.delete(l)},render:P,style(l){typeof l!=\"string\"||q.includes(l)||(q.push(l),t.send({type:\"style\",sheets:[...q]}))},on(l,m,h){let T={type:l,selector:m,listener:h};return o.add(T),typeof l==\"string\"&&!a.has(l)&&(a.add(l),t.send({type:\"hears\",events:[l]})),We.has(l)&&Wn(),(l===\"click\"||l===\"acted\")&&Xn(),()=>{o.delete(T),We.has(l)&&Wn(),(l===\"click\"||l===\"acted\")&&Xn()}},act:(l,m={})=>t.act(l,m),navigate(l){if(typeof l==\"string\")return t.navigate(l);let m=on(l);m&&t.send(m)},html(l,...m){return Qo(l.reduce((h,T,w)=>h+T+(w<m.length?ro(m[w]):\"\"),\"\"))},get today(){return s?.today??new Date().toISOString().slice(0,10)},fromToday(l,m){let h=Jr(l,s?.timeZone);return h===void 0?\"\":Qr(h,Kn.today,m)},get refused(){return i},get hardening(){return t.hardening()}});return{view:Kn,hear:g,find:l=>{try{let m=c.querySelectorAll(l)[0];return m?X(m):void 0}catch{return}},listened:l=>{let m=new Set;for(let h of o)if(h.type===l)try{for(let T of Array.from(c.querySelectorAll(h.selector))){let w=X(T);w&&m.add(w)}}catch{}return[...m]}}}var Yn={removed:[],stuck:[],sealed:!1,worker:!1},qn=Hr({listen(t){return _e.listen(t),()=>_e.unlisten(t)},fromHost:()=>!0,ready:t=>_e.post(t)},{onMessage:t=>so.hear(t)}),so=oo({send:t=>qn.send(t),act:(t,e)=>qn.guest.act(t,e),navigate:t=>qn.guest.navigate(t),microtask:_e.microtask,now:_e.now,threw:t=>console.error(t),warn:t=>console.warn(t),hardening:()=>Yn}),Jo=so.view;Object.defineProperty(globalThis,\"graview\",{value:Jo,enumerable:!0,configurable:!0,writable:!1});var zn=\"WorkerGlobalScope\"in globalThis?qr(globalThis,[\"graview\"]):Yn;Yn=zn;if(zn.stuck.length>0)throw new Error(`The view's worker could not be hardened: ${zn.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 Re=globalThis,mo=Re.addEventListener,po=Re.removeEventListener,ho=Re.postMessage,go=globalThis.queueMicrotask,pn=globalThis.performance,yo=pn?pn.now.bind(pn):Date.now,_e={listen:t=>mo.call(Re,\"message\",t),unlisten:t=>po.call(Re,\"message\",t),post:t=>ho.call(Re,t),microtask:t=>go.call(globalThis,t),now:()=>yo()};var O=Symbol(\"name\"),fe=Symbol(\"prefix\"),me=Symbol(\"value\"),v=Symbol(\"ns\"),Y=Symbol(\"owner\"),k=Symbol(\"owner_document\"),re=Symbol(\"attributes\"),D=Symbol(\"prev\"),p=Symbol(\"next\"),R=Symbol(\"child\"),z=Symbol(\"parent\"),pe=Symbol(\"host\"),K=Symbol(\"data\"),Te=Symbol(\"listeners\"),hn=Symbol(\"isTrusted\"),Pe=Symbol(\"path\"),Me=Symbol(\"stop_immediate_propagation\"),Ce=Symbol(\"dispatching\"),ie=Symbol(\"content\"),L=Symbol(\"hooks\"),mt=Symbol(\"extensions\"),we=Symbol(\"hooks_dispatch\"),B=Symbol(\"is_connected\"),Ie=Symbol(\"create_element\"),nr=0,$=1,ke=2,De=3,Le=8,Se=9,rr=10,he=11,_=\"http://www.w3.org/1999/xhtml\",Z=\"http://www.w3.org/2000/svg\",or=\"http://www.w3.org/XML/1998/namespace\",$e=\"http://www.w3.org/2000/xmlns/\";function pt(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 sr(t){return t.replace(/[a-z]/g,e=>String.fromCharCode(e.charCodeAt(0)-32))}function M(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 ir=/^(?:[A-Za-z][^\\0\\t\\n\\f\\r\\u0020/>]*|[:_\\u0080-\\u{10FFFF}][A-Za-z0-9-.:_\\u0080-\\u{10FFFF}]*)$/u,ar=/[\\0\\t\\n\\f\\r />=]/u,Eo=/[\\0\\t\\n\\f\\r />]/u;function ae(t){if(t==null)return null;let e=String(t);return e===\"\"?null:e}function lr(t){ir.test(t)||yn(t)}function gn(t){(t===\"\"||ar.test(t))&&yn(t)}function ht(t,e,n){let r=ae(t),o=String(e),s=o.indexOf(\":\"),i=s<0?null:o.slice(0,s),l=s<0?o:o.slice(s+1);if((i!=null&&(i===\"\"||Eo.test(i))||(n===\"element\"?!ir.test(l):l===\"\"||ar.test(l)))&&yn(o),i!=null&&r==null)throw M(`A namespace is required for the prefix in \"${o}\"`,\"NamespaceError\");if(i===\"xml\"&&r!==or)throw M(\"The xml prefix requires the XML namespace\",\"NamespaceError\");if((o===\"xmlns\"||i===\"xmlns\")&&r!==$e)throw M(\"The xmlns name requires the XMLNS namespace\",\"NamespaceError\");if(r===$e&&o!==\"xmlns\"&&i!==\"xmlns\")throw M(\"The XMLNS namespace requires the xmlns name or prefix\",\"NamespaceError\");return{namespace:r,qualifiedName:o,prefix:i,localName:l}}function yn(t){throw M(`Invalid name: \"${t}\"`,\"InvalidCharacterError\")}var gt=0,yt=1,cr=2,En=3,bo=typeof performance>\"u\"?Date.now:performance.now.bind(performance),V=class{static NONE=gt;static CAPTURING_PHASE=yt;static AT_TARGET=cr;static BUBBLING_PHASE=En;timeStamp=bo();target=null;currentTarget=null;srcElement=null;bubbles=!1;cancelable=!1;composed=!1;defaultPrevented=!1;cancelBubble=!1;eventPhase=gt;[Pe]=[];[Me]=!1;[Ce]=!1;constructor(e,n){this.type=e,Object.defineProperty(this,hn,{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[hn]}composedPath(){return[...this[Pe]]}stopPropagation(){this.cancelBubble=!0}stopImmediatePropagation(){this[Me]=!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 bn(t,e,n){if(t.cancelBubble)return;let o=e[Te]?.get(t.type)?.[n===yt?\"capture\":\"bubble\"];if(o)for(let s of[...o]){if(!o.has(s)||s.signal?.aborted)continue;t.eventPhase=t.target===e?cr:n,t.currentTarget=e;let i=s.normalizedListener;try{typeof i==\"object\"?i.handleEvent(t):i.call(e,t)}catch(l){setTimeout(No,0,l)}if(t[Me])break}}function No(t){throw t}var Xe=[],Et=new WeakMap;function bt(t,e){let n=Et.get(t);n?n.push(e):Et.set(t,[e]),Xe[Xe.length-1].push(t)}function F(t){let e=[];Xe.push(e);let n;try{n=t()}catch(r){Xe.pop();try{ur(e)}catch{}throw r}return Xe.pop(),ur(e),n}function ur(t){let e,n=!1;for(let r of t){let o=Et.get(r);if(o){for(;o.length>0;){let s=o.shift();try{s()}catch(i){n||(e=i,n=!0)}}Et.delete(r)}}if(n)throw e}var Nt=[],Ke=[],Nn=!1;function Oe(t){for(let e of t)Nt.push(e),e[1]&&Ke.push(e[1]);if(!Nn){Nn=!0;try{let e,n=!1;for(let r=0;r<Nt.length;r++){let[o,s]=Nt[r];s&&Ke.splice(Ke.indexOf(s),1);try{o()}catch(i){n||(e=i,n=!0)}}if(n)throw e}finally{Nt.length=0,Ke.length=0,Nn=!1}}}function Ze(t){let e=t;for(;e;){if(Ke.includes(e))return!0;e=e[z]??e[pe]}return!1}var Qe=Symbol(\"listenerRegistrations\"),ge=class{[Te]=void 0;[Qe]=void 0;[k]=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 l=Tn(o),c=this[Qe];c||(c=new Map,this[Qe]=c);let u=c.get(e);u||(u={},c.set(e,u));let m=u[l];if(m||(m=new Map,u[l]=m),m.has(n))return;let g=this,y={type:e,listener:n,capture:o,once:s,normalizedListener:n,signal:i};(s||i)&&(y.normalizedListener=function(...C){if(y.signal?.aborted){Tt(g,y);return}return y.once&&Tt(g,y),typeof y.listener==\"object\"?y.listener.handleEvent(...C):y.listener.call(this,...C)});let E=this[Te];E||(E=new Map,this[Te]=E);let x=E.get(e);x||(x={},E.set(e,x));let N=x[l];if(N||(N=new Set,x[l]=N),m.set(n,y),N.add(y),i){let w=()=>{Tt(g,y)};y.abortListener=w,i.addEventListener(\"abort\",w,{once:!0})}this[k]?.defaultView[we].addEventListener?.(this,e,n,r)}removeEventListener(e,n,r){return To.call(this,e,n,r)}dispatchEvent(e){if(e[Ce])throw M(\"Failed to execute 'dispatchEvent' on 'EventTarget': The event is already being dispatched.\",\"InvalidStateError\");e[Ce]=!0;try{let n=[],r=this;for(;r!=null;)n.push(r),r=r.parentNode;e.target=this,e.srcElement=this,e[Pe]=n;for(let s=n.length;s--;)if(bn(e,n[s],yt),e.cancelBubble)return!e.defaultPrevented;let o=e.bubbles?n:n.slice(0,1);for(let s=0;s<o.length;s++)if(bn(e,o[s],En),e.cancelBubble)return!e.defaultPrevented;return!e.defaultPrevented}finally{e[Ce]=!1,e.cancelBubble=!1,e[Me]=!1,e.eventPhase=gt,e.currentTarget=null,e[Pe]=[]}}};function To(t,e,n){if(e==null)return;let r=n===!0||n&&n.capture===!0,o=Tn(!!r),s=this[Qe]?.get(t)?.[o]?.get(e);s&&Tt(this,s)}function Tn(t){return t?\"capture\":\"bubble\"}function Tt(t,e){let n=Tn(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[Te],l=i?.get(e.type);if(!l)return;let c=l[n];c?.delete(e)&&(c.size===0&&delete l[n],!l.bubble&&!l.capture&&i?.delete(e.type),t[k]?.defaultView[we].removeEventListener?.(t,e.type,e.listener,e.capture))}var Q=class extends Array{item(e){return this[e]??null}};var et=0,dr=1,On=2,vn=3,tt=4,fr=0,mr=1,Ot=2,vt=3,pr=4,Sn=5,hr=6,gr=7,wt=/^(?:--|-?[A-Za-z_\\u0080-\\u{10FFFF}])[A-Za-z0-9_\\u0080-\\u{10FFFF}-]*$/u;function wo(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 M(`Invalid or unsupported selector: \"${t}\"`,\"SyntaxError\")}function xt(t,e){let n=typeof e==\"string\"?nt(e):[{combinator:tt,matchers:e}],r=null,o=t[R];return o&&n[0].matchers.length&&xn(o,n,s=>(r=s,!1)),r}function At(t,e){let n=typeof e==\"string\"?nt(e):[{combinator:tt,matchers:e}],r=new Q,o=t[R];return o&&n[0].matchers.length&&xn(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 l=0,c;for(;c=s.exec(i);){c.index!==l&&W(t),c[1]&&(r.matchers.length===0&&!(n&&o.length===1)&&W(t),c[1]===\">\"?r.combinator=dr:c[1]===\"+\"?r.combinator=vn:c[1]===\"~\"?r.combinator=On:r.combinator=et,r={combinator:tt,matchers:[]},o.push(r));let u=c[8]?H(c[8]):c[2]||c[7];c[7]!=null&&!c[6]&&r.matchers.length>0&&W(t);let g,y=c[4]??c[5]??c[7];if(c[2]){wt.test(u)||W(t);let E=c[5],x=E?.[0];if(c[3]==null&&(x==='\"'||x===\"'\")){let N=c[0].lastIndexOf(E);y=i.slice(c.index+N+1),s.lastIndex=i.length}else E!=null&&!wt.test(E)&&W(t);g=pr}else c[6]?(wt.test(u)||W(t),g=c[6]===\"#\"?Ot:vt):c[8]?g=c[9]==null?Sn:hr:c[7]===\"*\"?g=fr:c[7]&&wt.test(c[7])?g=mr:W(t);c[9]?([y,s.lastIndex]=wo(i,s.lastIndex),u!==\"has\"&&u!==\"not\"&&W(t),u===\"has\"&&e&&W(t),nt(y,e||u===\"has\",u===\"has\")):g===Sn&&W(t),r.matchers.push({type:g,name:u,value:y}),l=s.lastIndex}return(l!==i.length||r.matchers.length===0)&&W(t),o}function So(t,e){let n=nt(e);return n[0]?.matchers.length?Je(t,n):!1}function Oo(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:gr,name:\":scope\"};if(r.matchers.length===0?(o=r.combinator,r.matchers.push(s)):n.unshift({combinator:et,matchers:[s]}),n.some(({matchers:c})=>c.length===0))return!1;let i=o===vn||o===On?t[p]:t[R];if(!i)return!1;let l=!1;return xn(i,n,()=>(l=!0,!1),t),l}function xn(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 l=s[p];l&&o.push(l),s=i;continue}}s=s[p]??o.pop()??null}return!0}function Je(t,e,n){let{combinator:r,matchers:o}=e[e.length-1];if(r===tt){if(!St(t,o,n))return!1;let l=e.slice(0,-1);return l.length===0||Je(t,l,n)}let s=r===dr||r===et?z:D,i=t[s];if(!i)return!1;if(r===et||r===On){for(;i;){if(j(i)&&St(i,o,n)){let l=e.slice(0,-1);if(l.length===0||Je(i,l,n))return!0}i=i[s]}return!1}else{if(r===vn&&!j(i)){for(;i&&!j(i);)i=i[s];if(!i)return!1}if(!j(i)||!St(i,o,n))return!1;let l=e.slice(0,-1);return l.length===0||Je(i,l,n)}}function wn(t,e){return t.getAttributeNS(null,t.namespaceURI===_?H(e):e)}function St(t,e,n){if(!t)return!1;if(Array.isArray(e)){for(let i of e)if(St(t,i,n)===!1)return!1;return!0}let{type:r,name:o,value:s}=e;switch(r){case fr:return o===\"*\";case mr:return t.namespaceURI===_?t.localName===H(o):t.localName===o;case Ot:return wn(t,\"id\")===o;case vt:let i=wn(t,\"class\");return i?pt(i).includes(o):!1;case pr:let l=wn(t,o);return s==null?l!=null:l===s;case gr:return t===n;case Sn:W(`:${o}`);case hr:switch(o){case\"has\":return Oo(t,s||\"\");case\"not\":return!So(t,s||\"\");default:W(`:${o}(${s})`)}}return!1}function vo(t){return t.nodeType===ke}function rt(t){return K in t}function Rn(t){return t.nodeType===De}function xo(t){return t.nodeType===Le}function j(t){return t.nodeType===$}function An(t){return t.nodeType===he}function Nr(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 l=[];for(let c of st(i)){if(o.has(c)||(o.add(c),e.push(c),l.push(c),!j(c)))continue;let u=c[re];if(u)for(let g of u)o.has(g)||(o.add(g),e.push(g));let m=c[ie];m&&!o.has(m)&&!r.has(m)&&(r.add(m),n.push(m))}s??=l}return{nodes:e,treeNodes:s}}function ot(t,e){for(let n of t)n[k]=e}function yr(t,e){let n=t.constructor,r=new n(t.name,t.value,t.namespaceURI);return r[k]=e,r}function Er(t,e){if(Rn(t))return e.createTextNode(t.data);if(xo(t))return e.createComment(t.data);if(vo(t))return yr(t,e);if(j(t)){let n=e[Ie](t[O],t.namespaceURI,t[fe],t.localName);if(t[re])for(let r=0;r<t[re].length;r++){let o=t[re].item(r);n.attributes.setNamedItem(yr(o,e))}return n}else{if(An(t))return e.createDocumentFragment();{let n=new t.constructor;return n[k]=e,n}}}function _t(t,e,n=t.ownerDocument){if(t.nodeType===Se)throw M(\"Cannot clone a document node\",\"NotSupportedError\");let r=Er(t,n);if(!e||!j(t)&&!An(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],l,c;if(i.cloningContent)if(i.contentSource&&i.contentDestination)l=i.contentSource.childNodes[i.childIndex++],c=i.contentDestination;else{s.pop(),i.appendTo&&i.appendTo.appendChild(i.destination);continue}else if(l=i.source.childNodes[i.childIndex++],c=i.destination,!l){if(i.cloningContent=!0,i.childIndex=0,j(i.source)&&i.source.namespaceURI===_&&i.source.localName===\"template\"){let m=i.source[ie];m&&(o.has(m)&&br(),o.add(m),i.contentSource=m,i.contentDestination=i.destination.content)}continue}if(!l){s.pop(),i.appendTo&&i.appendTo.appendChild(i.destination);continue}o.has(l)&&br(),o.add(l);let u=Er(l,n);j(l)||An(l)?s.push({source:l,destination:u,appendTo:c,childIndex:0,cloningContent:!1}):c.appendChild(u)}return r}function br(){throw new Error(\"Cannot clone a cyclic or repeated node graph\")}function Pt(t,e){let n=String(e);return n===\"\"?null:xt(t,[{type:Ot,name:n}])}function Mt(t,e){let n=[...new Set(pt(String(e)))];return At(t,n.map(r=>({type:vt,name:r})))}function Ct(t,e){let n=String(e),r=H(n),o=[];for(let s of It(t))j(s)&&(n===\"*\"||(s.namespaceURI===_?s[O]===r:s[O]===n))&&o.push(s);return o}function It(t){let e=[],n=[],r=t[R];for(;r;){e.push(r);let o=r[R],s=r[p];o?(s&&n.push(s),r=o):r=s??n.pop()??null}return e}function st(t){let e=It(t);return e.unshift(t),e}var J=class extends ge{nodeType=nr;[O]=\"\";[z]=null;[pe]=null;[R]=null;[D]=null;[p]=null;[B]=!1;get[L](){return this[k].defaultView[we]}get localName(){return this[O]}get nodeName(){return this[O]}get ownerDocument(){return this[k]}get isConnected(){return this[B]}isDefaultNamespace(e){let n=ae(e);return Ao(this)===n}get parentNode(){return this[z]}set parentNode(e){}get parentElement(){let e=this[z];return!e||e.nodeType!==1?null:e}set parentElement(e){}get previousSibling(){return this[D]}set previousSibling(e){}get nextSibling(){return this[p]}set nextSibling(e){}get previousElementSibling(){let e=this[D];for(;e&&e.nodeType!==1;)e=e[D];return e}set previousElementSibling(e){}get nextElementSibling(){let e=this[p];for(;e&&e.nodeType!==1;)e=e[p];return e}set nextElementSibling(e){}get firstChild(){return this[R]}set firstChild(e){}get lastChild(){let e=this[R];for(;e;){let n=e[p];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 It(this))Rn(n)&&(e+=n.data);return e}set textContent(e){if(rt(this))this.data=e;else if(Nr(this)){let n=e==null?\"\":String(e);n===\"\"?this.replaceChildren():this.replaceChildren(n)}}cloneNode(e){return _t(this,e)}contains(e){let n=e;for(;n!=null;){if(n===this)return!0;n=n.parentNode}return!1}};function Ao(t){let e=t;for(;e;)switch(e.nodeType){case $:{let n=e;if(n.prefix==null&&n.namespaceURI!=null)return n.namespaceURI;let r=n.attributes.getNamedItemNS($e,\"xmlns\");if(r!=null&&r.prefix==null)return ae(r.value);e=n.parentElement;break}case Se:e=e.documentElement;break;case rr:case he:return null;case ke:e=e.ownerElement;break;default:e=e.parentElement}return null}var ee=Symbol(\"insertNode\"),Mn=Symbol(\"preflightInsertions\"),kt=Symbol(\"replaceNode\"),ye=class extends J{remove(){let e=this.parentNode;e&&e.removeChild(this)}replaceWith(...e){let n=ve(e),r=this.parentNode;if(r)return _n(o=>{le(r,n);let s=this[p];for(;s&&n.includes(s);)s=s[p];let i=Pn(r,n,o);this.parentNode===r?r[kt](i,this,o):r[ee](i,s,o)})}before(...e){let n=ve(e),r=this.parentNode;if(r)return _n(o=>{le(r,n);let s=this[D];for(;s&&n.includes(s);)s=s[D];let i=Pn(r,n,o);r[ee](i,s?s[p]:r.firstChild,o)})}after(...e){let n=ve(e),r=this.parentNode;if(r)return _n(o=>{le(r,n);let s=this[p];for(;s&&n.includes(s);)s=s[p];let i=Pn(r,n,o);r[ee](i,s,o)})}};function _n(t){return F(()=>{let e=[];try{t(e)}catch(n){try{Oe(e)}catch{}throw n}Oe(e)})}function ve(t){return t.map(e=>e instanceof J?e:String(e))}function it(t,e){return e instanceof J?e:t.ownerDocument.createTextNode(String(e))}function le(t,e){for(let n of e){if(!(n instanceof J))continue;let r=t;for(;r;){if(r===n)throw M(\"Cannot insert a node into itself or one of its descendants\",\"HierarchyRequestError\");r=r[z]??r[pe]}}}function Pn(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[Mn](r);for(let s of r)o[ee](s,null,n);return o}var Dt,Cn=0,Tr=0,wr=0,Sr=0,Ge=!1,kn=!1,at=!1,Lt=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=Ro(n),o=Dt??=new WeakMap,s=o.get(e);s==null&&(s=new Map,o.set(e,s));let i=s.get(this);i==null?Cn++:In(i,-1),s.set(this,r),In(r,1),this.#e.add(e)}disconnect(){let e=Dt;if(e!=null){for(let n of this.#e){let r=e.get(n),o=r?.get(this);o!=null&&(r.delete(this),Cn--,In(o,-1)),r?.size===0&&e.delete(n)}this.#e.clear(),this.#n.length=0,Cn===0&&(Dt=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 te(t){let e=Dt;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 l=!1;if(t.type===\"attributes\"){if(!i.attributes||i.attributeFilter&&!i.attributeFilter.has(t.attributeName??\"\"))continue;l=i.attributeOldValue}else if(t.type===\"characterData\"){if(!i.characterData)continue;l=i.characterDataOldValue}else if(!i.childList)continue;n.set(s,n.get(s)===!0||l)}r=r.parentNode}for(let[o,s]of n)o.enqueue({addedNodes:t.addedNodes??new Q,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 Q,target:t.target,type:t.type})}function Gt(...t){let e=new Q;return e.push(...t),e}function Ro(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 In(t,e){t.attributes&&(Tr+=e),t.characterData&&(wr+=e),t.childList&&(Sr+=e),Ge=Tr>0,kn=wr>0,at=Sr>0}var oe=class extends ye{childNodes=new Q;children=new Q;appendChild(e){return F(()=>this[ee](e,null))}insertBefore(e,n){return F(()=>this[ee](e,n||null))}append(...e){return F(()=>{let n=ve(e.filter(r=>r!=null));n.length>1&&le(this,n);for(let r of n)this[ee](it(this,r),null)})}prepend(...e){return F(()=>{let n=ve(e.filter(o=>o!=null));n.length>1&&le(this,n);let r=this.firstChild;for(let o of n)this[ee](it(this,o),r)})}replaceChildren(...e){return F(()=>{let n=ve(e.filter(o=>o!=null));le(this,n);let r;for(;r=this.firstChild;)this.removeChildImmediately(r);for(let o of n)this[ee](it(this,o),null)})}removeChild(e){return F(()=>(this.removeChildImmediately(e),e))}removeChildImmediately(e){if(e.parentNode!==this)throw M(\"The node is not a child of this node\",\"NotFoundError\");let n=this[B]?st(e):void 0,r=e[D],o=e[p],s=Ht(this,e);if(n)for(let i of n)i[B]=!1;this.queueRemovalMutationRecord(this,e,r,o),n&&this.enqueueTreeReactions(n,\"disconnectedCallback\"),Oe(this.collectRemovalHookEffects(e,s))}replaceChild(e,n){return F(()=>this[kt](e,n))}[kt](e,n,r){if(le(this,[e]),n.parentNode!==this)throw M(\"The reference node is not a child of this parent\",\"NotFoundError\");let o=n[D],s=n[p],i=this.prepareInsertion(e),l=this[B]?st(n):void 0,c=new Set(i.map(({node:y})=>y)),u=s;for(;u&&c.has(u);)u=u[p];let m=Ht(this,n);if(l){for(let E of l)E[B]=!1;let y=new Set(l);for(let E of i)y.has(E.node)&&(E.shouldDisconnect=!1)}this.commitInsertion(i,u);let g=this[B];return this.queueRemovalMutationRecord(this,n,o,s),this.queueInsertionMutationRecords(i),l&&this.enqueueTreeReactions(l,\"disconnectedCallback\"),this.enqueueInsertionReactions(i,g),this.performOrCollectHookEffects([...this.collectRemovalHookEffects(n,m),...this.collectInsertionHookEffects(i)],r),n}querySelectorAll(e){return At(this,e)}querySelector(e){return xt(this,e)}[ee](e,n,r){return this.validateInsertion(e,n),this.insertIntoValidated(e,n,r),e}[Mn](e){for(let n of e)this.validateInsertion(n,null),this.prepareInsertion(n)}validateInsertion(e,n){if(le(this,[e]),n&&n.parentNode!==this)throw M(\"The reference node is not a child of this parent\",\"NotFoundError\")}insertIntoValidated(e,n,r){e===n&&(n=e[p]);let o=this.prepareInsertion(e);this.commitInsertion(o,n);let s=this[B];this.queueInsertionMutationRecords(o),this.enqueueInsertionReactions(o,s),this.performOrCollectHookEffects(this.collectInsertionHookEffects(o),r)}performOrCollectHookEffects(e,n){n?n.push(...e):Oe(e)}prepareInsertion(e){let n=[];if(e.nodeType===he){let i=e[R];for(;i;)n.push(i),i=i[p]}else n.push(e);let r=this[B],o=this[k],s=[];for(let i of n){let l=i[B],c=l||r,u,m;if(i[k]===o)c&&(u=st(i));else{let g=Rt(i);m=g.nodes,c&&(u=g.treeNodes)}s.push({node:i,nodes:u,adoption:m,shouldDisconnect:l})}return s}commitInsertion(e,n){for(let s of e){let i=s.node[z];if(i){let l=s.node[D],c=s.node[p];s.source={parent:i,index:Ht(i,s.node),previousSibling:l,nextSibling:c}}}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[k];for(let{adoption:s}of e)s&&ot(s,r);let o=this[B];for(let{nodes:s}of e)if(s)for(let i of s)i[B]=o}attachChild(e,n){if(n){let s=n[D];e[p]=n,e[D]=s,s?s[p]=e:this[R]=e,n[D]=e}else{e[p]=null;let s=this[R];if(s){let i;for(;i=s[p];)s=i;s[p]=e,e[D]=s}else this[R]=e,e[D]=null}let r=j(e);e[z]=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[p];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[D],nextSibling:e[p]}}queueRemovalMutationRecord(e,n,r,o){at&&te({type:\"childList\",target:e,removedNodes:Gt(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),te({type:\"childList\",target:this,addedNodes:Gt(r),previousSibling:n.previousSibling,nextSibling:n.nextSibling})}}collectRemovalHookEffects(e,n){return this.nodeType!==$||Ze(this)?[]:[[()=>this[L].removeChild?.(this,e,n)]]}collectInsertionHookEffects(e){let n=[];for(let r of e){let{node:o,source:s}=r;s?.parent.nodeType===$&&!Ze(s.parent)&&n.push([()=>s.parent[L].removeChild?.(s.parent,o,s.index)]),this.nodeType===$&&!Ze(this)&&n.push([()=>this[L].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){vr(e,n)}};function Or(t,e,n,r){if(e.parentNode!==t)throw Error(\"not a child of this node\");let o=t[B]?n.treeNodes:void 0,s=e[D],i=e[p],l=Ht(t,e);if(o)for(let u of o)u[B]=!1;ot(n.nodes,r),at&&te({type:\"childList\",target:t,removedNodes:Gt(e),previousSibling:s,nextSibling:i}),o&&vr(o,\"disconnectedCallback\");let c=[];t.nodeType===$&&!Ze(t)&&c.push([()=>t[L].removeChild?.(t,e,l)]),Oe(c)}function Ht(t,e){let n=e[D],r=e[p];n?n[p]=r:t[R]=r,r&&(r[D]=n);let o=t.childNodes.indexOf(e);return t.childNodes.splice(o,1),j(e)&&t.children.splice(t.children.indexOf(e),1),e[z]=null,e[p]=null,e[D]=null,o}function vr(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 Ut=class{[R]=null;constructor(e){this[Y]=e}getNamedItem(e){let n=String(e),r=this[Y][v]===_?H(n):n,o=this[R];for(;o;){if(o.name===r)return o;o=o[p]}return null}getNamedItemNS(e,n){let r=ae(e),o=String(n),s=this[R];for(;s;){if(s.localName===o&&s[v]===r)return s;s=s[p]}return null}item(e){let n=this[R],r=0;for(;n;){if(r++===e)return n;n=n[p]}return null}get length(){let e=0,n=this[R];for(;n;)e++,n=n[p];return e}removeNamedItem(e){let n=String(e),r=this[Y][v]===_?H(n):n;return F(()=>this.removeNamedItemImmediately(o=>o.name===r))}removeNamedItemNS(e,n){let r=ae(e),o=String(n);return F(()=>this.removeNamedItemImmediately(s=>s.localName===o&&s[v]===r))}removeNamedItemImmediately(e){let n=this[Y],r=this[R],o=null;for(;r!=null;){if(e(r)){o&&(o[p]=r[p]),this[R]===r&&(this[R]=r[p]);let s=r.value;return r[p]=null,r[Y]=null,Ge&&te({type:\"attributes\",target:n,attributeName:r.name,attributeNamespace:r[v],oldValue:s}),n[L].removeAttribute?.(n,r.name,r[v]),lt(n,r.localName,s,null,r[v]),r}o=r,r=r[p]}return null}setNamedItem(e){return F(()=>this.setNamedItemImmediately(e))}setNamedItemImmediately(e){let n=this[Y],r=e[Y];if(r!=null&&r!==n)throw M(\"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[v]===e[v]){if(s===e)return s;i?i[p]=e:this[R]=e,e[p]=s[p],s[p]=null,o=s;break}i=s,s=s[p]}o==null&&(i?i[p]=e:this[R]=e),e[Y]=n,e[k]=n[k],o&&(o[Y]=null);let l=o==null||o.value!==e.value,c=o!=null&&o.name!==e.name;return l&&Ge&&te({type:\"attributes\",target:n,attributeName:e.name,attributeNamespace:e[v],oldValue:o?.value??null}),c&&n[L].removeAttribute?.(n,o.name,o[v]),(l||c)&&n[L].setAttribute?.(n,e.name,e.value,e[v]),l&&lt(n,e.localName,o?.value??null,e.value,e[v]),o}setNamedItemNS(e){return this.setNamedItem(e)}*[Symbol.iterator](){let e=this[R];for(;e;)yield e,e=e[p]}};var xe=class extends J{nodeType=ke;[v]=null;[p]=null;[Y]=null;constructor(e,n,r){super(),this[O]=e,this[me]=n,r&&(this[v]=r)}get nodeName(){return this[O]}set nodeName(e){}get name(){return this[O]}set name(e){}get localName(){if(this[v]==null)return this[O];let e=this[O].indexOf(\":\");return e<0?this[O]:this[O].slice(e+1)}get prefix(){if(this[v]==null)return null;let e=this[O].indexOf(\":\");return e<0?null:this[O].slice(0,e)}get value(){return this[me]}set value(e){let n=String(e),r=this[Y];if(!r){this[me]=n;return}F(()=>{let o=this[me];this[me]=n,Ge&&o!==n&&te({type:\"attributes\",target:r,attributeName:this[O],attributeNamespace:this[v],oldValue:o}),this[L].setAttribute?.(r,this[O],n,this[v]),lt(r,this.localName,o,n,this[v])})}get nodeValue(){return this.value}set nodeValue(e){this.value=e}get ownerElement(){return this[Y]}get namespaceURI(){return this[v]}get specified(){return!0}};var _o={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\"]),Mo=/(?:<([a-z][a-z0-9-:]*)((?:[\\s]+[^<>'\"=/\\s]+(?:=(['\"])[^]*?\\3|=[^>'\"\\s]*|))*)[\\s]*(\\/?)\\s*>|<\\/([a-z][a-z0-9-:]*)>|<!--(.*?)-->|([^<>]+))/gi,Rr=/\\s([^<>'\"=/\\n\\s]+)(?:=([\"'])([\\s\\S]*?)\\2|=([^>'\"\\n\\s]*)|)/g,Co=\"|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|\",Io=/^(?:color|face|size)$/i;function xr(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 _o[n];let s=Number.parseInt(r??o,r?10:16);try{return String.fromCodePoint(s)}catch{return e}})}function _r(t){return t.namespaceURI===_&&Po.has(t.localName)}function Ar(t){let e=t.localName;return t[v]===Z&&(e===\"foreignObject\"||e===\"desc\"||e===\"title\")}function ko(t,e){if(Co.includes(`|${t}|`))return!0;if(t!==\"font\")return!1;for(let n of e.matchAll(Rr))if(Io.test(n[1]))return!0;return!1}function Bt(t,e){let n=e.ownerDocument,r=n.createDocumentFragment(),o=[],s=r;for(let i of t.matchAll(Mo)){let l=i[1];if(l){let c=i[2],u=H(l),m=o[o.length-1]?.element??e,g=m[v]===Z?Z:_;if(u===\"svg\")g=Z;else if(g===Z){if(Ar(m))g=_;else if(ko(u,c)){for(;o.length>0;){let x=o[o.length-1];if(x.element[v]!==Z||Ar(x.element))break;o.pop(),s=x.target}g=_}}let y=g===_?u:l,E=n[Ie](y,g,null,y);for(let x of c.matchAll(Rr))E.setAttribute(x[1],xr(x[3]||x[4]||\"\"));if(s.append(E),_r(E)||g!==_&&i[4])continue;o.push({element:E,target:s}),s=g===_&&u===\"template\"?E.content:E}else if(i[5]){let c=H(i[5]);for(let u=o.length-1;u>=0;u--){let m=o[u],g=H(m.element[O]);if(g===c){s=m.target,o.length=u;break}if(m.element[v]===_&&g===\"template\")break}}else i[6]?s.append(n.createComment(i[6])):s.append(xr(i[7]))}return r}function Vt(t){return Mr([{type:\"content\",child:t[R]}])}function Pr(t){return Mr([{type:\"opening\",node:t}])}function Mr(t){let e=[],n;for(;n=t.pop();)switch(n.type){case\"opening\":{let r=n.node;switch(r.nodeType){case $:{let o=r;e.push(`<${o[O]}`);let s=o[re]?.[R];for(;s;){e.push(` ${s[O]}`);let l=s[me];l!==\"\"&&(l=String(l).replace(/&/g,\"&amp;\").replace(/\"/g,\"&quot;\"),e.push(`=\"${l}\"`)),s=s[p]}if(e.push(\">\"),_r(o))break;let i=o.namespaceURI===_&&o.localName===\"template\"?o[ie]:o;t.push({type:\"closing\",name:o[O]}),t.push({type:\"content\",child:i?.[R]??null});break}case De:{let o=r;e.push(o[K].replace(/&/g,\"&amp;\").replace(/\"/g,\"&quot;\").replace(/</g,\"&lt;\").replace(/>/g,\"&gt;\"));break}case Le:{let o=r;e.push(`<!--${o[K]}-->`);break}}break}case\"content\":{let r=n.child;r&&(t.push({type:\"content\",child:r[p]}),t.push({type:\"opening\",node:r}));break}case\"closing\":e.push(`</${n.name}>`);break}return e.join(\"\")}var U=class extends oe{nodeType=$;[v]=_;[fe]=null;get namespaceURI(){return this[v]}get prefix(){return this[fe]}get localName(){let e=this[fe];return e==null?this[O]:this[O].slice(e.length+1)}get nodeName(){return this[v]===_?sr(this[O]):this[O]}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 xe(\"slot\",n))}get attributes(){let e=this[re];return e||(e=new Ut(this),this[re]=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 Mt(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);gn(r);let s=this[v]===_?H(r):r,i=this.attributes.getNamedItemNS(null,s);i?i.value=o:this.attributes.setNamedItem(new xe(s,o))}setAttributeNS(e,n,r){let o=ae(e),s=String(n),i=String(r),l=ht(o,s,\"attribute\"),c=this.attributes.getNamedItemNS(l.namespace,l.localName);c?c.value=i:this.attributes.setNamedItemNS(new xe(l.qualifiedName,i,l.namespace))}toggleAttribute(e,n){let r=String(e);gn(r);let o=this[v]===_?H(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 xe(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[v]===_?H(n):n;this.attributes.removeNamedItemNS(null,r)}removeAttributeNS(e,n){this.attributes.removeNamedItemNS(e,n)}get outerHTML(){return Pr(this)}get innerHTML(){return Vt(this)}set innerHTML(e){if(e==null||e===\"\")this.replaceChildren();else{let n=Bt(String(e),this);this.replaceChildren(n)}}};var He=class t extends U{[v]=Z;get ownerSVGElement(){let e=null,n=this.parentNode;for(;n instanceof t;)e=n,n=n.parentNode;return e}};var Ee=class extends ye{[K]=\"\";constructor(e){super(),this[K]=e==null?\"\":String(e)}setData(e){let n=kn,r=n?this[K]:null,o=\"\";e!=null&&(o=typeof e==\"string\"?e:String(e)),this[K]=o,n&&r!==o&&te({type:\"characterData\",target:this,oldValue:r}),this[L].setText?.(this,o)}get data(){return this[K]}set data(e){this.setData(e)}};var Ue=class extends Ee{nodeType=De;[O]=\"#text\"};var Be=class extends Ee{nodeType=Le;[O]=\"#comment\"};var Ve=class extends oe{nodeType=he;[O]=\"#document-fragment\";[k]=typeof window<\"u\"?window.document:null;getElementById(e){return Pt(this,e)}};var Fe=class extends U{get content(){let e=this[ie];return e||(e=this.ownerDocument.createDocumentFragment(),e[pe]=this,this[ie]=e),e}set content(e){}set innerHTML(e){this.content.replaceChildren(Bt(String(e),this))}get innerHTML(){let e=this[ie];return e?Vt(e):\"\"}};var Ft=class extends U{};var jt=class extends U{};var qt=class extends U{};var ct=class extends oe{nodeType=Se;[O]=\"#document\";[B]=!0;constructor(e){super(),this.defaultView=e,this[k]=this,this.documentElement=zt(new qt,this,\"html\"),this.body=zt(new Ft,this,\"body\"),this.head=zt(new jt,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 Mt(this,e)}createElement(e){let n=String(e);return lr(n),Dn(this,H(n))}createElementNS(e,n){let r=ht(e,n,\"element\");return Dn(this,r.qualifiedName,r.namespace,r.prefix,r.localName)}[Ie](e,n,r,o){return Dn(this,e,n,r,o)}createTextNode(e){let n=Yt(new Ue(e),this);return this[L].createText?.(n,n.data),n}createComment(e){return Yt(new Be(e),this)}createDocumentFragment(){return Yt(new Ve,this)}createEvent(){return new V(\"\")}getElementById(e){return Pt(this,e)}getElementsByTagName(e){return Ct(this,e)}importNode(e,n){if(e.nodeType===Se)throw M(\"Cannot import a document node\",\"NotSupportedError\");return _t(e,n,this)}adoptNode(e){if(e[k]===this)return e;let n=Rt(e);return F(()=>{let r=e.parentNode;return r?Or(r,e,n,this):ot(n.nodes,this),e})}};function Yt(t,e){return Object.defineProperty(t,k,{value:e,writable:!0,enumerable:!1}),t}function Dn(t,e,n=_,r=null,o=e){let s;if(n===Z)s=new He;else if(n===_&&o===\"template\")s=new Fe;else if(n===_){let i=t.defaultView.customElements.get(o);s=i?new i:new U}else s=new U;return zt(s,t,e,n,r)}function zt(t,e,n,r=_,o=null){return Yt(t,e),Object.defineProperties(t,{[O]:{value:n},[v]:{value:r},[fe]:{value:o}}),e[L].createElement?.(t,r),t}var Wt=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 $t=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 Kt=class extends V{constructor(e,n){super(e,n),this.oldState=n.oldState,this.newState=n.newState}};var Zt=class extends V{constructor(e,n={}){super(e,n),this.relatedTarget=n.relatedTarget??null}};var Qt=class extends V{constructor(e,n={}){super(e,n),this.clipboardData=n.clipboardData??null}};var Jt=class extends U{};var Do=/^[a-z][^A-Z\\u0000\\t\\n\\f\\r />]*-[^A-Z\\u0000\\t\\n\\f\\r />]*$/u,Lo=new Set([\"annotation-xml\",\"color-profile\",\"font-face\",\"font-face-src\",\"font-face-uri\",\"font-face-format\",\"font-face-name\",\"missing-glyph\"]);function Cr(t){return Do.test(t)&&!Lo.has(t)}function Ir(t){return M(`Invalid custom element name: \"${t}\"`,\"SyntaxError\")}var en=class{registry=new Map;listenersByName=new Map;define(e,n,r){if(!Cr(e))throw Ir(e);if(this.registry.has(e))throw M(`A custom element named \"${e}\" has already been defined`,\"NotSupportedError\");if(this.getName(n)!=null)throw M(\"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(!Cr(e))return Promise.reject(Ir(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 Go=[\"onerror\",\"onunhandledrejection\"],Dr=Symbol.for(\"@remote-dom/polyfill/global-property\");function Lr(t){return Object.getOwnPropertyDescriptors(t)}function Gr(t){let e={};for(let[n,r]of Object.entries(Object.getOwnPropertyDescriptors(ge.prototype)))n!==\"constructor\"&&typeof r.value==\"function\"&&(r.value=Ln(r.value.bind(t)),e[n]=r);return e}function Hr(t){let e={};for(let n of Go)e[n]={configurable:!0,enumerable:!0,get:Ln(()=>t[n]),set:Ln(r=>{t[n]=r})};return e}function Ho(t){return Object.assign(Lr(t),Gr(t),Hr(t))}function Ln(t){return Object.defineProperty(t,Dr,{value:!0}),t}function kr(t,e){for(let n of Reflect.ownKeys(e)){let r=Uo(t,n);(r==null||Bo(r))&&Object.defineProperty(t,n,e[n])}}function Uo(t,e){let n=t;for(;n;){let r=Object.getOwnPropertyDescriptor(n,e);if(r)return r;n=Object.getPrototypeOf(n)}}function Bo(t){return[t.value,t.get,t.set].some(e=>typeof e==\"function\"&&e[Dr]===!0)}var Ae=class extends ge{[L]={};[mt]=[];[we]=Fo(this);name=\"\";window=this;parent=this;self=this;top=this;document=new ct(this);customElements=new en;location=globalThis.location;navigator=globalThis.navigator;Event=V;ErrorEvent=$t;PromiseRejectionEvent=Xt;ToggleEvent=Kt;FocusEvent=Zt;ClipboardEvent=Qt;EventTarget=ge;CustomEvent=Wt;Node=J;ParentNode=oe;ChildNode=ye;DocumentFragment=Ve;Document=ct;CharacterData=Ee;Comment=Be;Text=Ue;Element=U;HTMLElement=Jt;SVGElement=He;HTMLTemplateElement=Fe;MutationObserver=Lt;#t=null;#n=null;#e=null;static with(...e){let n=this;return class extends n{constructor(){super();for(let o of e)Vo(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=Lr(e),s=Object.assign(Gr(e),Hr(e));delete o.self,Object.defineProperties(globalThis,o),kr(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),kr(n,s))}static setGlobalThis(e){for(let n in e)e[n]===e&&(e[n]=globalThis);Object.defineProperties(globalThis,Ho(e))}};function Vo(t,e){t[mt].push(e(t)??{})}function Fo(t){return{createElement:ce.bind(null,t,\"createElement\"),setAttribute:ce.bind(null,t,\"setAttribute\"),removeAttribute:ce.bind(null,t,\"removeAttribute\"),createText:ce.bind(null,t,\"createText\"),setText:ce.bind(null,t,\"setText\"),insertChild:ce.bind(null,t,\"insertChild\"),removeChild:ce.bind(null,t,\"removeChild\"),addEventListener:ce.bind(null,t,\"addEventListener\"),removeEventListener:ce.bind(null,t,\"removeEventListener\")}}function ce(t,e,...n){for(let s of t[mt])s[e]?.apply(s,n);let r=t[L];r[e]?.apply(r,n)}var tn=new Ae;var Gn=\"~\";var be=new WeakMap;function je(t){return be.get(t)}var Vn=new WeakMap,qo=0;function X(t){let e=Vn.get(t);return e==null&&(e=String(qo++),nn(t,e)),e}function nn(t,e){Vn.set(t,e)}var Un=new WeakMap;function Yo(t){return Un.get(t)}var Bn=new WeakMap;function zo(t){let e=Bn.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 Wo=new WeakMap;function $o(t){return Wo.get(t)}function Fn(t,e,n){let r=Un.get(t);if(r==null&&(r={},Un.set(t,r)),r[e]===n)return;r[e]=n;let o=be.get(t);o?.mutate([[3,X(t),e,n,1]])}function Ne(t,e,n){let r=Bn.get(t);if(r==null&&(r={},Bn.set(t,r)),r[e]===n)return;n==null?delete r[e]:r[e]=String(n);let o=be.get(t);o?.mutate([[3,X(t),e,n,2]])}function qe(t,e){if(be.get(t)!==e&&(be.set(t,e),t.childNodes))for(let r=0;r<t.childNodes.length;r++)qe(t.childNodes[r],e)}function rn(t){if(be.get(t)!=null&&(be.delete(t),t.childNodes))for(let n=0;n<t.childNodes.length;n++)rn(t.childNodes[n])}function Ye(t){let{nodeType:e}=t;switch(e){case 1:return{id:X(t),type:e,element:t.localName,properties:Hn(Yo(t)),attributes:Hn(zo(t)),eventListeners:Hn($o(t)),children:Array.from(t.childNodes).map(Ye)};case 3:case 8:return{id:X(t),type:e,data:t.data};default:throw new Error(`Cannot serialize node of type ${t.nodeType} (${typeof t.nodeType})`)}}function Hn(t){return t?{...t}:void 0}function jn(t,e,...n){let r=Vn.get(t),o=be.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 ze=tn[L];ze.insertChild=(t,e,n)=>{let r=je(t);r!=null&&(qe(e,r),r.mutate([[0,X(t),Ye(e),n]]))};ze.removeChild=(t,e,n)=>{let r=je(t);r!=null&&(rn(e),r.mutate([[1,X(t),n]]))};ze.setText=(t,e)=>{let n=je(t);n?.mutate([[2,X(t),e]])};ze.setAttribute=(t,e,n)=>{t.tagName.includes(\"-\")||Ne(t,e,n)};ze.removeAttribute=(t,e)=>{t.tagName.includes(\"-\")||Ne(t,e)};Ae.setGlobal(tn);function on(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 Br=[\"wheel\",\"drag\",\"pinch\"];function Vr(t){let e=t;return typeof t==\"object\"&&t!==null&&e.graview===\"host-hello\"&&typeof e.nonce==\"string\"}function jr(t,e={}){let n,r=\"\",o,s=0,i=new Set,l=new Map,c=[],u=N=>{n?n.postMessage({...N,nonce:r}):c.push(N)},m=N=>{let w=N.data;if(!(!w||typeof w!=\"object\")){if(w.type===\"props\"){o=w.props;for(let C of i)C(w.props)}else w.type===\"answer\"?(l.get(w.id)?.(w),l.delete(w.id)):w.type===\"event\"&&typeof w.listener==\"number\"?e.onEvent?.(w):w.type===\"heartbeat\"&&typeof w.beat==\"number\"&&u({type:\"heartbeat\",beat:w.beat});e.onMessage?.(w)}},g=()=>{},y=N=>{if(n||!t.fromHost(N)||!Vr(N.data)||N.data.protocol!==1)return;let w=N.ports[0];if(w){n=w,r=N.data.nonce,n.onmessage=m,n.start?.(),g();for(let C of c.splice(0))u(C)}};g=t.listen(y),t.ready({graview:\"guest-ready\",protocol:1});let E,x={get props(){return o},subscribe(N){return i.add(N),()=>i.delete(N)},act(N,w={}){let C=s+=1;return new Promise(I=>{l.set(C,I),u({type:\"act\",id:C,name:N,args:w})})},navigate(N){let w=on(N);w&&u(w)},size(N){u({type:\"size\",height:N})},autoSize(N){let w=N??globalThis.document?.documentElement,C=globalThis.ResizeObserver;if(!w||!C||typeof w.getBoundingClientRect!=\"function\")return()=>{};E?.disconnect();let I=new C(()=>x.size(Math.ceil(w.getBoundingClientRect().height)));return I.observe(w),E=I,()=>I.disconnect()},close(){E?.disconnect(),g(),n?.close(),i.clear()}};return{guest:x,send:u}}var Yr=[\"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\"],zr=[\"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\"],Wr=[\"self\",\"postMessage\",\"setTimeout\",\"clearTimeout\",\"setInterval\",\"clearInterval\",\"queueMicrotask\",\"structuredClone\",\"crypto\",\"console\",\"DOMException\"],$r=[\"TEMPORARY\",\"PERSISTENT\"],xl=Object.freeze([...Yr,...zr,...Wr,...$r]),Al=Object.freeze([\"constructor\",\"__defineGetter__\",\"__defineSetter__\",\"hasOwnProperty\",\"__lookupGetter__\",\"__lookupSetter__\",\"isPrototypeOf\",\"propertyIsEnumerable\",\"toString\",\"valueOf\",\"__proto__\",\"toLocaleString\"]),qr=t=>typeof t==\"symbol\"?`[${t.description??\"symbol\"}]`:t;function Xr(t=globalThis,e=[],n={}){let r=[],o=[],s=new Set([...Yr,...zr,...Wr,...e,\"constructor\",Symbol.toStringTag]),i=(S,P)=>{let q=Reflect.getOwnPropertyDescriptor(S,P);return q===void 0||!(\"value\"in q)||q.writable||q.configurable?!1:n.primitivesStay&&typeof P==\"symbol\"&&(typeof q.value!=\"object\"||q.value===null)&&typeof q.value!=\"function\"?!0:$r.includes(P)&&typeof q.value==\"number\"},l=t,c=l.setTimeout,u=l.setInterval,m=l.crypto,g=(S,P)=>function(q,dt,...ft){if(typeof q!=\"function\")throw new TypeError(`${P} takes a function: a guest view cannot run code from text`);return S.call(t,q,dt,...ft)},y=m?Object.freeze({getRandomValues:S=>m.getRandomValues(S)}):void 0,E=l.document?.defaultView;if(E&&E!==l)for(let S of Reflect.ownKeys(E))typeof S==\"symbol\"||s.has(S)||Reflect.deleteProperty(E,S)||o.push(`window.${S}`);let x=[];for(let S=t;S&&S!==Object.prototype;S=Object.getPrototypeOf(S))x.push(S);for(let S of x)for(let P of Reflect.ownKeys(S))s.has(P)||(Reflect.deleteProperty(S,P)?r.push(qr(P)):i(S,P)||o.push(qr(P)));let N=()=>function(){throw new EvalError(\"A guest view cannot make code from text.\")},w=[Function.prototype,Object.getPrototypeOf(async function(){}),Object.getPrototypeOf(function*(){}),Object.getPrototypeOf(async function*(){})];for(let S of w){let P=N();Object.defineProperty(P,\"prototype\",{value:S,writable:!1,enumerable:!1,configurable:!1}),Reflect.defineProperty(S,\"constructor\",{value:P,writable:!1,enumerable:!1,configurable:!1})||o.push(\"Function.prototype.constructor\"),S===Function.prototype&&Reflect.defineProperty(t,\"Function\",{value:P,writable:!0,enumerable:!1,configurable:!0})}let C=(S,P)=>{Reflect.defineProperty(t,S,{value:P,writable:!0,enumerable:!0,configurable:!0})||o.push(S)};C(\"setTimeout\",g(c,\"setTimeout\")),C(\"setInterval\",g(u,\"setInterval\")),y&&C(\"crypto\",y);for(let S of x.slice(1))Object.freeze(S);for(let S of Reflect.ownKeys(t)){let P=Reflect.getOwnPropertyDescriptor(t,S);Reflect.defineProperty(t,S,\"value\"in P?{...P,writable:!1,configurable:!1}:{...P,configurable:!1})}let I;try{I=Reflect.preventExtensions(t)}catch{I=!1}return{removed:r,stuck:o,sealed:I}}var ut=class extends HTMLElement{constructor(){super(),nn(this,Gn)}connect(e){if(je(this)===e||(qe(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,Gn,Ye(o),r])}e.mutate(n)}updateRemoteProperty(e,n){Fn(this,e,n)}callRemoteMethod(e,...n){return jn(this,e,...n)}};var f={},qn={empty:!0},Xo={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\"},Yn={div:f,section:f,article:f,aside:f,header:f,footer:f,nav:f,hgroup:f,search:f,address:f,figure:f,figcaption:f,blockquote:f,p:f,pre:f,hr:qn,br:qn,wbr:qn,h1:f,h2:f,h3:f,h4:f,h5:f,h6:f,span:f,strong:f,em:f,b:f,i:f,u:f,s:f,small:f,mark:f,abbr:f,cite:f,q:f,code:f,kbd:f,samp:f,var:f,sub:f,sup:f,dfn:f,bdi:f,bdo:f,ruby:f,rt:f,rp:f,time:{attributes:{datetime:\"text\"}},data:{attributes:{value:\"text\"}},del:{attributes:{datetime:\"text\"}},ins:{attributes:{datetime:\"text\"}},a:{attributes:{href:\"link\"}},ul:f,menu:f,dl:f,dt:f,dd:f,ol:{attributes:{start:\"number\",reversed:\"boolean\",type:{oneOf:[\"1\",\"a\",\"A\",\"i\",\"I\"]}}},li:{attributes:{value:\"number\"}},table:f,caption:f,thead:f,tbody:f,tfoot:f,tr:f,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:f,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:f,output:f,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\":{empty:!0,attributes:{autoplay:\"boolean\",cover:\"boolean\"}}},Ko=[\"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\",\"filter\",\"flood-color\",\"flood-opacity\",\"lighting-color\",\"color-interpolation-filters\"],Zo={id:\"text\",class:\"text\",style:\"style\",lang:\"text\",role:\"text\",tabindex:{oneOf:[\"-1\",\"0\"]},transform:\"geometry\",...Object.fromEntries(Ko.map(t=>[t,\"css\"]))},ue={x:\"geometry\",y:\"geometry\",width:\"geometry\",height:\"geometry\"},sn={viewBox:\"geometry\",preserveAspectRatio:\"geometry\"},Kr={oneOf:[\"userSpaceOnUse\",\"objectBoundingBox\"]},Zr={oneOf:[\"R\",\"G\",\"B\",\"A\"]},ne={...ue,in:\"text\",result:\"text\"},Qr={gradientUnits:{oneOf:[\"userSpaceOnUse\",\"objectBoundingBox\"]},gradientTransform:\"geometry\",spreadMethod:{oneOf:[\"pad\",\"reflect\",\"repeat\"]},href:\"fragment\"},Jr={svg:{attributes:{...ue,...sn}},g:f,defs:f,symbol:{attributes:{...ue,...sn,refX:\"geometry\",refY:\"geometry\"}},use:{attributes:{...ue,href:\"fragment\"}},title:f,desc:f,path:{attributes:{d:\"geometry\",pathLength:\"number\"}},rect:{attributes:{...ue,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\",...Qr}},radialGradient:{attributes:{cx:\"geometry\",cy:\"geometry\",r:\"geometry\",fx:\"geometry\",fy:\"geometry\",fr:\"geometry\",...Qr}},stop:{attributes:{offset:\"geometry\"}},clipPath:{attributes:{clipPathUnits:{oneOf:[\"userSpaceOnUse\",\"objectBoundingBox\"]}}},mask:{attributes:{...ue,maskUnits:{oneOf:[\"userSpaceOnUse\",\"objectBoundingBox\"]},maskContentUnits:{oneOf:[\"userSpaceOnUse\",\"objectBoundingBox\"]}}},pattern:{attributes:{...ue,...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\"]}}},a:f,filter:{attributes:{...ue,filterUnits:Kr,primitiveUnits:Kr}},feBlend:{attributes:{...ne,in2:\"text\",mode:\"text\"}},feColorMatrix:{attributes:{...ne,type:{oneOf:[\"matrix\",\"saturate\",\"hueRotate\",\"luminanceToAlpha\"]},values:\"geometry\"}},feComponentTransfer:{attributes:ne},...Object.fromEntries([\"feFuncR\",\"feFuncG\",\"feFuncB\",\"feFuncA\"].map(t=>[t,{attributes:{type:{oneOf:[\"identity\",\"table\",\"discrete\",\"linear\",\"gamma\"]},tableValues:\"geometry\",slope:\"number\",intercept:\"number\",amplitude:\"number\",exponent:\"number\",offset:\"number\"}}])),feComposite:{attributes:{...ne,in2:\"text\",operator:{oneOf:[\"over\",\"in\",\"out\",\"atop\",\"xor\",\"lighter\",\"arithmetic\"]},k1:\"number\",k2:\"number\",k3:\"number\",k4:\"number\"}},feDisplacementMap:{attributes:{...ne,in2:\"text\",scale:\"number\",xChannelSelector:Zr,yChannelSelector:Zr}},feDropShadow:{attributes:{...ne,dx:\"number\",dy:\"number\",stdDeviation:\"geometry\"}},feFlood:{attributes:ne},feGaussianBlur:{attributes:{...ne,stdDeviation:\"geometry\",edgeMode:{oneOf:[\"duplicate\",\"wrap\",\"none\"]}}},feMerge:{attributes:ne},feMergeNode:{attributes:{in:\"text\"}},feMorphology:{attributes:{...ne,operator:{oneOf:[\"erode\",\"dilate\"]},radius:\"geometry\"}},feOffset:{attributes:{...ne,dx:\"number\",dy:\"number\"}},feTurbulence:{attributes:{...ue,result:\"text\",type:{oneOf:[\"fractalNoise\",\"turbulence\"]},baseFrequency:\"geometry\",numOctaves:\"number\",seed:\"number\",stitchTiles:{oneOf:[\"stitch\",\"noStitch\"]}}}};var eo={section:[\"aria-label\",\"title\"]};function Qo(t){return/^aria-[a-z]+$/.test(t)}function Jo(t){return/^data-[a-z0-9][a-z0-9_.-]*$/.test(t)}var es=new Map(Object.keys(Jr).map(t=>[t.toLowerCase(),t]));function to(t){return es.get(t.toLowerCase())}function no(t,e,n){let r=n.toLowerCase(),o=t===\"html\"?[Yn[e]?.attributes,Xo]:[Jr[e]?.attributes,Zo],s=t===\"svg\"&&r===\"xlink:href\"?\"href\":r;for(let i of o)if(i){for(let[l,c]of Object.entries(i))if(l.toLowerCase()===s)return{name:l,kind:c}}if(Qo(r)||Jo(r))return{name:r,kind:\"text\"}}var an=/^\\d{4}-\\d{2}-\\d{2}$/;function ts(t,e){if(typeof t!=\"string\"||typeof e!=\"string\"||!an.test(t)||!an.test(e))return;let n=Math.round((Date.parse(`${t}T00:00:00Z`)-Date.parse(`${e}T00:00:00Z`))/864e5);return Number.isFinite(n)?n:void 0}function ro(t,e,n={}){let r=ts(t,e);if(r===void 0)return\"\";if(r===0)return\"today\";if(r===1)return\"tomorrow\";if(r<0&&n.due===!0)return\"overdue\";if(r===-1)return\"yesterday\";let o=Math.abs(r),[s,i]=o<14?[o,\"day\"]:o<60?[Math.round(o/7),\"week\"]:o<730?[Math.round(o/30.44),\"month\"]:[Math.round(o/365.25),\"year\"],l=`${s} ${i}${s===1?\"\":\"s\"}`;return r>0?`in ${l}`:`${l} ago`}function oo(t,e){if(typeof t!=\"string\")return;if(an.test(t))return t;let n=Date.parse(t);if(Number.isFinite(n)){if(!/(Z|[+-]\\d\\d:?\\d\\d)$/.test(t))return an.test(t.slice(0,10))?t.slice(0,10):void 0;try{let r=new Intl.DateTimeFormat(\"en-CA\",{timeZone:e||\"UTC\",year:\"numeric\",month:\"2-digit\",day:\"2-digit\"}).formatToParts(n),o=s=>r.find(i=>i.type===s)?.value??\"\";return`${o(\"year\")}-${o(\"month\")}-${o(\"day\")}`}catch{return new Date(n).toISOString().slice(0,10)}}}var so=\"~\",ln=t=>typeof t==\"object\"&&t!==null&&!Array.isArray(t),se=(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=>se(n,e+1)):Object.fromEntries(Object.entries(t).map(([n,r])=>[n,se(r,e+1)]))};function io(){let t=new Map,e=new Map,n=new Map([[so,{children:[],listeners:new Map}]]),r=0,o=u=>{let m=e.get(u);return m===void 0&&(m=r+=1,e.set(u,m),t.set(m,{listener:u,count:0})),t.get(m).count+=1,m},s=u=>{let m=t.get(u);m&&(m.count-=1,!(m.count>0)&&(t.delete(u),e.delete(m.listener)))},i=u=>{let m=n.get(u);if(m){n.delete(u);for(let g of m.listeners.values())s(g);for(let g of m.children)i(g)}},l=(u,m,g=0)=>{if(!ln(u)||g>64)return se(u);let y=typeof u.id==\"string\"?u.id:void 0,E=m&&y!==void 0&&y!==so;E&&i(y);let x={children:[],listeners:new Map};E&&n.set(y,x);let N={};for(let[w,C]of Object.entries(u))w===\"children\"&&Array.isArray(C)?N[w]=C.map(I=>{let S=l(I,E,g+1);return E&&ln(I)&&typeof I.id==\"string\"&&x.children.push(I.id),S}):w===\"eventListeners\"&&ln(C)?N[w]=Object.fromEntries(Object.entries(C).map(([I,S])=>{if(typeof S!=\"function\"||!E)return[I,void 0];let P=o(S);return x.listeners.set(I,P),[I,{listener:P}]})):N[w]=se(C,g+1);return N},c=u=>{if(!Array.isArray(u))return se(u);let[m,g]=u,y=typeof g==\"string\"?n.get(g):void 0;if(m===0){let E=l(u[2],y!==void 0),x=ln(u[2])?u[2].id:void 0;if(y&&typeof x==\"string\"&&n.has(x)){let N=Number(u[3]);y.children.splice(Number.isInteger(N)&&N>=0&&N<=y.children.length?N:y.children.length,0,x)}return[m,se(g),E,se(u[3])]}if(m===1){let E=Number(u[2]);return y&&Number.isInteger(E)&&E>=0&&E<y.children.length&&i(y.children.splice(E,1)[0]),se(u)}if(m===3&&u[4]===3){let E=String(u[2]),x=u[3],N=y&&typeof x==\"function\"?o(x):void 0,w=y?.listeners.get(E);return w!==void 0&&s(w),N===void 0?y?.listeners.delete(E):y.listeners.set(E,N),[m,se(g),E,N===void 0?void 0:{listener:N},3]}return se(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 cn=\"graview-view-root\",ns=[\"value\",\"checked\",\"key\",\"pressed\",\"files\",\"refused\",\"x\",\"y\",\"width\",\"height\",\"deltaX\",\"deltaY\",\"deltaMode\",\"ctrlKey\",\"metaKey\",\"phase\",\"pointerId\",\"button\",\"pressure\",\"dx\",\"dy\",\"scale\",\"rotation\"],rs=t=>t.replace(/&/g,\"&amp;\").replace(/</g,\"&lt;\").replace(/>/g,\"&gt;\").replace(/\"/g,\"&quot;\").replace(/'/g,\"&#39;\"),os=t=>Object.freeze({html:t,toString:()=>t}),ao=t=>typeof t==\"object\"&&t!==null&&typeof t.html==\"string\"&&Object.isFrozen(t),lo=t=>t==null||t===!1?\"\":Array.isArray(t)?t.map(lo).join(\"\"):ao(t)?t.html:rs(String(t));function co(t){customElements.get(cn)||customElements.define(cn,ut);let e=Event,n=io(),r=new Set,o=new Set,s,i=[],l=new Set;for(let a of[\"closest\",\"matches\",\"dataset\"]){let d=()=>{throw new TypeError(`A view's element has no ${a}: graview.on hands event.element, the element its selector matched; read event.element.getAttribute(\"data-\\u2026\").`)};a in Element.prototype||Object.defineProperty(Element.prototype,a,a===\"dataset\"?{get:d}:{value:d})}let c=document.createElement(cn),u=a=>{let d=h=>{for(let T of Array.from(h.childNodes)){if(T.nodeType!==1)continue;if(X(T)===a)return T;let b=d(T);if(b)return b}};return d(c)},m=a=>{let d=u(a.target);if(!d)return;let h=new e(a.event,{bubbles:!0}),T={};for(let b of ns)a[b]!==void 0&&(T[b]=a[b]);for(let b of Object.keys(T))Object.defineProperty(h,b,{value:T[b],enumerable:!0});d.dispatchEvent(h);for(let b of o){if(b.type!==a.event)continue;let A;try{A=new Set(Array.from(c.querySelectorAll(b.selector)))}catch{continue}for(let G=d;G&&G!==c;G=G.parentNode)if(A.has(G)){b.listener(Object.freeze({type:a.event,target:d,element:G,...T}));break}}},g=Error,y=new Map,E=0,x=(a,d,h)=>new Promise((T,b)=>{let A=++E;y.set(A,G=>G.ok?T(G):b(new g(G.sentence??\"This value was not kept.\"))),t.send({type:\"mine\",id:A,op:a,key:d,...a===\"set\"?{value:h}:{}})}),N=a=>(a.catch(()=>{}),a),w=Object.freeze({get(a){return N(x(\"get\",a).then(d=>typeof d.value==\"string\"?d.value:null))},set(a,d){return N(x(\"set\",a,d).then(()=>{}))}}),C=a=>{if(a.type===\"mine-answer\"){let b=y.get(a.id);return y.delete(a.id),b?.(a)}if(a.type===\"dom-event\"&&typeof a.target==\"string\")return m(a);if(a.type===\"notice\")return t.warn(a.text);if(a.type!==\"props\")return;s=a.props;let d=t.now();for(let b of r)try{b(a.props)}catch(A){t.threw(A)}let h=t.now()-d,T=a.push;typeof T==\"number\"&&t.microtask(()=>t.microtask(()=>t.send({type:\"pushed\",push:T,ms:h})))},I;c.connect({mutate(a){I||(I=[],t.microtask(()=>{let d=I??[];I=void 0,t.send({type:\"render\",records:n.encode(d)})})),I.push(...a)},call:()=>{}});let S=a=>a.nodeType===1?a.getAttribute(\"data-key\")??a.getAttribute(\"id\"):null,P=(a,d)=>a.nodeType===d.nodeType&&(a.nodeType!==1||a.localName===d.localName&&a.namespaceURI===d.namespaceURI&&S(a)===S(d));function q(a,d){let h=Array.from(d.childNodes),T=0;for(let b of h){let A=a.childNodes[T]??null;if(A&&P(A,b)){dt(A,b),T+=1;continue}if(S(b)!==null){let de=Array.from(a.childNodes).slice(T+1).find(We=>P(We,b));if(de){a.insertBefore(de,A),dt(de,b),T+=1;continue}}a.insertBefore(b,A),T+=1}for(;a.childNodes.length>T;)a.removeChild(a.lastChild)}function dt(a,d){if(a.nodeType!==1){a.data!==d.data&&(a.data=d.data);return}let h=a,T=d,b=ft(h);for(let A of h.getAttributeNames())T.hasAttribute(A)||(h.removeAttribute(A),b&&Ne(h,A,void 0));for(let A of T.getAttributeNames()){let G=T.getAttribute(A);h.getAttribute(A)!==G&&h.setAttribute(A,G),b&&Ne(h,A,G)}q(h,T)}let ft=a=>a.localName.includes(\"-\");function Xn(a){for(let d of Array.from(a.childNodes)){if(d.nodeType!==1)continue;let h=d;if(ft(h))for(let T of h.getAttributeNames())Ne(h,T,h.getAttribute(T)??void 0);Xn(h)}}function Kn(a,d,h){for(let T of Array.from(a.childNodes)){if(T.nodeType!==1)continue;let b=T,A=b.localName,G=d||A.toLowerCase()===\"svg\",de=G?to(A):Object.prototype.hasOwnProperty.call(Yn,A.toLowerCase())?A.toLowerCase():void 0;if(!de){h.add(`<${A}>`);continue}for(let We of b.getAttributeNames())(!no(G?\"svg\":\"html\",de,We)||!G&&eo[de]?.includes(We.toLowerCase()))&&h.add(`${de} ${We}`);Kn(b,G,h)}}function fo(a){let d=document.createElement(\"div\"),h=Array.isArray(a)?a:[a];for(let b of h)if(b!=null)if(typeof b==\"string\"||ao(b)){let A=document.createElement(\"div\");A.innerHTML=typeof b==\"string\"?b:b.html,d.append(...Array.from(A.childNodes))}else d.append(b);let T=new Set;Kn(d,!1,T),i=[...T],i.length>0&&t.warn(`The host will not draw: ${i.join(\", \")}`),Xn(d),q(c,d)}let un=[],dn=new Set(Br),Zn=\"[]\",fn=!1,Qn=()=>{fn||(fn=!0,t.microtask(()=>{fn=!1;let a=[...new Map([...o].filter(h=>dn.has(h.type)).map(h=>[`${h.type} ${h.selector}`,{event:h.type,selector:h.selector}])).entries()].sort(([h],[T])=>h<T?-1:h>T?1:0).map(([,h])=>h),d=JSON.stringify(a);d!==Zn&&(Zn=d,t.send({type:\"gestures\",bound:a}))}))},Jn=\"[[],[]]\",mn=!1,er=()=>{mn||(mn=!0,t.microtask(()=>{mn=!1;let a=b=>[...new Set([...o].filter(A=>A.type===b&&typeof A.selector==\"string\").map(A=>A.selector))].sort().slice(0,200),d=a(\"click\"),h=a(\"acted\"),T=JSON.stringify([d,h]);T!==Jn&&(Jn=T,t.send({type:\"clicks\",selectors:d,...h.length>0?{acted:h}:{}}))}))},tr=Object.freeze({get props(){return s},onProps(a){return r.add(a),s&&a(s),()=>void r.delete(a)},render:fo,style(a){typeof a!=\"string\"||un.includes(a)||(un.push(a),t.send({type:\"style\",sheets:[...un]}))},on(a,d,h){let T={type:a,selector:d,listener:h};return o.add(T),typeof a==\"string\"&&!l.has(a)&&(l.add(a),t.send({type:\"hears\",events:[a]})),dn.has(a)&&Qn(),(a===\"click\"||a===\"acted\")&&er(),()=>{o.delete(T),dn.has(a)&&Qn(),(a===\"click\"||a===\"acted\")&&er()}},act:(a,d={})=>t.act(a,d),mine:w,navigate(a){if(typeof a==\"string\")return t.navigate(a);let d=on(a);d&&t.send(d)},html(a,...d){return os(a.reduce((h,T,b)=>h+T+(b<d.length?lo(d[b]):\"\"),\"\"))},get today(){return s?.today??new Date().toISOString().slice(0,10)},fromToday(a,d){let h=oo(a,s?.timeZone);return h===void 0?\"\":ro(h,tr.today,d)},get refused(){return i},get hardening(){return t.hardening()}});return{view:tr,hear:C,find:a=>{try{let d=c.querySelectorAll(a)[0];return d?X(d):void 0}catch{return}},listened:a=>{let d=new Set;for(let h of o)if(h.type===a)try{for(let T of Array.from(c.querySelectorAll(h.selector))){let b=X(T);b&&d.add(b)}}catch{}return[...d]}}}var $n={removed:[],stuck:[],sealed:!1,worker:!1},zn=jr({listen(t){return _e.listen(t),()=>_e.unlisten(t)},fromHost:()=>!0,ready:t=>_e.post(t)},{onMessage:t=>uo.hear(t)}),uo=co({send:t=>zn.send(t),act:(t,e)=>zn.guest.act(t,e),navigate:t=>zn.guest.navigate(t),microtask:_e.microtask,now:_e.now,threw:t=>console.error(t),warn:t=>console.warn(t),hardening:()=>$n}),ss=uo.view;Object.defineProperty(globalThis,\"graview\",{value:ss,enumerable:!0,configurable:!0,writable:!1});var Wn=\"WorkerGlobalScope\"in globalThis?Xr(globalThis,[\"graview\"]):$n;$n=Wn;if(Wn.stuck.length>0)throw new Error(`The view's worker could not be hardened: ${Wn.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,08kEAA08kE,CAAC"}
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,y6lEAAy6lE,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { AnySchema, HostFiles, PagesArrangement, Principal, Store } from "@graview/core";
1
+ import { type AnySchema, type HostFiles, type PagesArrangement, type Principal, type Store, type ViewerState } from "@graview/core";
2
2
  import type { GuestPlace, GuestTheme } from "../protocol.js";
3
3
  import { type WorkerViewManifest } from "./manifest.js";
4
4
  import type { ViewRefusal } from "./open-draw.js";
@@ -186,6 +186,14 @@ export interface MountWorkerViewOptions<S extends AnySchema> {
186
186
  * offered: this host takes no files.
187
187
  */
188
188
  readonly files?: () => HostFiles | undefined;
189
+ /**
190
+ * WHERE WHAT THE VIEW KEEPS FOR ITS VIEWER GOES (`graview.mine`): the
191
+ * host's, by the view's name. Without it, for the visit, in this page's
192
+ * memory.
193
+ */
194
+ readonly viewerState?: () => ViewerState | undefined;
195
+ /** Code proposed and not kept (FR-187): what it keeps lasts this drawing, whatever a host keeps and whatever this visit has kept. */
196
+ readonly draft?: boolean;
189
197
  /**
190
198
  * THE VIEW'S CONTENT HEIGHT (Roadmap f-view-content-height): how tall
191
199
  * what it drew is, in CSS pixels, each time that changes — measured by
@@ -1 +1 @@
1
- {"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../src/host/view.ts"],"names":[],"mappings":"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"}
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
@@ -1,9 +1,11 @@
1
1
  import { imageRefusedWords } from "./open-judge.js";
2
2
  import { keepClicked } from "./clicked.js";
3
3
  import { guestPlacesOf } from "./links-words.js";
4
+ import { actingAs, meOf } from "@graview/core";
5
+ import { createMine, keptForTheVisit, visitOf } from "./mine.js";
4
6
  import { storedFilesOf } from "./marks.js";
5
7
  import { retryingImport } from "@graview/core/retry";
6
- import { checkManifest, readsComputed, workerViewProps } from "./manifest.js";
8
+ import { checkManifest, edgesReadWithoutTheirKindsSaid, readsComputed, workerViewProps } from "./manifest.js";
7
9
  import { createGuestHost, createGuestLimiter } from "./session.js";
8
10
  import { startWorker } from "./worker-start.js";
9
11
  import { judgeCodeAct } from "./writes.js";
@@ -27,6 +29,8 @@ const pressChunk = retryingImport(() => import("./press.js"));
27
29
  const picturesChunk = retryingImport(() => import("./pictures.js"));
28
30
  /* A record's video placed by a view, and the full-screen viewer (0.1.37), fetched with the first view that places one. */
29
31
  const mediaChunk = retryingImport(() => import("./media.js"));
32
+ /* The faces the app lends its views, fetched with the first view a brand that lends any dresses. */
33
+ const fontsChunk = retryingImport(() => import("./fonts.js"));
30
34
  /* Files dropped on what the view drew (FR-193), fetched with the first `data-drop` a view whose manifest accepts files draws. */
31
35
  const dropChunk = retryingImport(() => import("./drop.js"));
32
36
  /* 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. */
@@ -178,6 +182,8 @@ export function mountWorkerView(element, options) {
178
182
  let timing = 0;
179
183
  /* What the person typed into a field saved as it is typed and not yet saved (FR-191, press.ts): saved as the view goes. */
180
184
  let flushSaves = () => { };
185
+ /* This drawing has gone: what it asked the host to keep still lands. */
186
+ let letGoOfMine = () => { };
181
187
  /* A jump, what is in sight and a record's file (sections.ts); why a press was refused, beside it (refused-note.ts). */
182
188
  let sections;
183
189
  let sectionsAsked;
@@ -187,6 +193,7 @@ export function mountWorkerView(element, options) {
187
193
  const stop = () => {
188
194
  flushSaves();
189
195
  flushSaves = () => { };
196
+ letGoOfMine();
190
197
  sections?.dispose();
191
198
  tally();
192
199
  session?.dispose();
@@ -247,6 +254,9 @@ export function mountWorkerView(element, options) {
247
254
  queueMicrotask(() => fail("manifest", findings.join(" ")));
248
255
  return handle();
249
256
  }
257
+ /* A relation it reads whose far kind it is never handed (Roadmap f-view-authoring-friction-2026-11): drawn, and said to the host, as `graview view check` says it. */
258
+ for (const said of edgesReadWithoutTheirKindsSaid(options.store, manifest))
259
+ queueMicrotask(() => options.onProblem?.(said));
250
260
  /* Its code is longer than it may be, or its own source loads something (FR-96): refused before it runs, with why. */
251
261
  const refusedCode = (code) => {
252
262
  const bytes = "source" in code ? new TextEncoder().encode(code.source).length : "script" in code ? new TextEncoder().encode(code.script).length : 0;
@@ -276,10 +286,46 @@ export function mountWorkerView(element, options) {
276
286
  * host in the region — never handed to the view — and dressed again on
277
287
  * every push, which is how a brand the host changes reaches it.
278
288
  */
289
+ let lent = "[[],null]";
290
+ let toldOfTheme = "";
291
+ let lending = 0;
292
+ let giveFontsBack;
279
293
  const dress = () => {
280
294
  const views = options.brand?.()?.views;
281
- drawing?.theme(views?.css);
295
+ /* A stylesheet for its views that draws nothing at all is said once: the part of one the open kit leaves out is the checker's to say (brand-views-css). */
296
+ if (drawing && !drawing.theme(views?.css) && toldOfTheme !== views?.css) {
297
+ toldOfTheme = views?.css ?? "";
298
+ const said = "The app's stylesheet for its views draws nothing: the open kit leaves all of it out, so views are drawn without it. graview check says which part (brand-views-css).";
299
+ port?.postMessage({ type: "notice", text: said });
300
+ options.onProblem?.(said);
301
+ }
282
302
  drawing?.motion(views?.motion ?? "none");
303
+ /* The faces the app lends its views (Roadmap f-view-authoring-friction-2026-11), loaded into the page by the host as their brand changes (fonts.ts). */
304
+ const fonts = views?.fonts ?? [];
305
+ /* And as the brand's own stacks change, since a face may not take one of their names. */
306
+ const typography = options.brand?.()?.typography;
307
+ const lendingNow = JSON.stringify([fonts, typography ?? null]);
308
+ if (lendingNow === lent)
309
+ return;
310
+ lent = lendingNow;
311
+ lending += 1;
312
+ const asked = lending;
313
+ if (fonts.length === 0) {
314
+ giveFontsBack?.();
315
+ giveFontsBack = undefined;
316
+ return;
317
+ }
318
+ void fontsChunk().then(({ loadViewFonts }) => {
319
+ if (asked !== lending)
320
+ return;
321
+ /* The new ones first, so a face both brands lend is never let go between them. */
322
+ const before = giveFontsBack;
323
+ giveFontsBack = loadViewFonts(document, fonts, { ...(options.asset ? { asset: options.asset } : {}), ...(options.images ? { origins: options.images.origins } : {}), ...(typography ? { typography } : {}) }, (said) => {
324
+ port?.postMessage({ type: "notice", text: said });
325
+ options.onProblem?.(said);
326
+ });
327
+ before?.();
328
+ });
283
329
  };
284
330
  let pushed = "";
285
331
  const push = () => {
@@ -333,6 +379,9 @@ export function mountWorkerView(element, options) {
333
379
  media?.dispose();
334
380
  drops?.dispose();
335
381
  gestures?.dispose();
382
+ lending += 1;
383
+ giveFontsBack?.();
384
+ giveFontsBack = undefined;
336
385
  };
337
386
  let port;
338
387
  const send = (message) => port?.postMessage(message);
@@ -735,6 +784,27 @@ export function mountWorkerView(element, options) {
735
784
  },
736
785
  // The drawing did not arrive (the network away as it was drawn): the plain face says so, and it is asked for again as the view is drawn again (FR-139).
737
786
  () => fail("start", "the view's drawing could not be loaded"));
787
+ /*
788
+ * WHAT IT KEEPS FOR ITS VIEWER (`graview.mine`), read as the worker starts,
789
+ * so its first draw has it. By its registered name, the host's to say; a
790
+ * problem says no value. Never the graph's.
791
+ */
792
+ const hostState = options.draft ? undefined : options.viewerState?.();
793
+ /* A seat whose id reads as a person's has no `meOf`, and is still nobody else: it never falls to the key of a seat with no id. */
794
+ const viewer = meOf(options.principal) ?? actingAs(options.principal).id ?? options.principal.visitorKey ?? "";
795
+ const mine = createMine({
796
+ view: manifest.name,
797
+ viewer,
798
+ /* A draft's is its own, for as long as it is drawn: nothing the view it would replace keeps is its to read or write. */
799
+ state: hostState ?? (options.draft ? keptForTheVisit() : visitOf(options.store, viewer)),
800
+ onRefused: (sentence) => {
801
+ options.onProblem?.(sentence);
802
+ if (session)
803
+ port?.postMessage({ type: "notice", text: sentence });
804
+ },
805
+ onLate: () => session?.push(),
806
+ });
807
+ letGoOfMine = () => mine.dispose();
738
808
  const begin = (source) => (started = startWorker(window, {
739
809
  source,
740
810
  name: manifest.name,
@@ -773,8 +843,9 @@ export function mountWorkerView(element, options) {
773
843
  }
774
844
  given.postMessage(message);
775
845
  },
846
+ mine,
776
847
  props: () => {
777
- const props = workerViewProps(options.store, options.principal, { manifest, ...(options.input ? { input: options.input() } : {}), theme: theme(), places: guestPlacesOf(vocabulary()), ...(computed ? { computed } : {}) });
848
+ const props = { ...workerViewProps(options.store, options.principal, { manifest, ...(options.input ? { input: options.input() } : {}), theme: theme(), places: guestPlacesOf(vocabulary()), ...(computed ? { computed } : {}) }), mine: mine.values() };
778
849
  const was = shown;
779
850
  shown = new Set([...(props.node ? [props.node.id] : []), ...(props.nodes ?? []).map((node) => node.id)]);
780
851
  /* The record it shows changed (Roadmap f-app-wide-view-theme): under the brand's "fade", what is drawn goes before the new one comes. */
@@ -841,8 +912,9 @@ export function mountWorkerView(element, options) {
841
912
  },
842
913
  }));
843
914
  /* What the worker waits for before it starts: the pictures' host, and what works out computed values, where the view needs them. */
844
- const waits = manifest.pictures !== undefined || readsComputed(options.store, manifest);
915
+ const waits = manifest.pictures !== undefined || readsComputed(options.store, manifest) || hostState !== undefined;
845
916
  const ready = () => Promise.all([
917
+ mine.ready,
846
918
  picturesReady.catch(() => Promise.reject(new Error("the view's pictures could not be loaded"))),
847
919
  computedReady.catch(() => Promise.reject(new Error("the view's computed values could not be worked out"))),
848
920
  ]);