@graview/guest 0.1.9 → 0.1.12

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 (173) hide show
  1. package/README.md +353 -3
  2. package/client.js +2 -0
  3. package/dist/channel.d.ts +11 -3
  4. package/dist/channel.d.ts.map +1 -1
  5. package/dist/channel.js +5 -1
  6. package/dist/channel.js.map +1 -1
  7. package/dist/cli.d.ts +16 -0
  8. package/dist/cli.d.ts.map +1 -0
  9. package/dist/cli.js +75 -0
  10. package/dist/cli.js.map +1 -0
  11. package/dist/client-script.d.ts +3 -0
  12. package/dist/client-script.d.ts.map +1 -0
  13. package/dist/client-script.js +21 -0
  14. package/dist/client-script.js.map +1 -0
  15. package/dist/client.d.ts +2 -0
  16. package/dist/client.d.ts.map +1 -0
  17. package/dist/client.generated.d.ts +4 -0
  18. package/dist/client.generated.d.ts.map +1 -0
  19. package/dist/client.generated.js +9 -0
  20. package/dist/client.generated.js.map +1 -0
  21. package/dist/client.js +12 -0
  22. package/dist/client.js.map +1 -0
  23. package/dist/headless/describe.d.ts +19 -0
  24. package/dist/headless/describe.d.ts.map +1 -0
  25. package/dist/headless/describe.js +255 -0
  26. package/dist/headless/describe.js.map +1 -0
  27. package/dist/headless/draw.d.ts +17 -0
  28. package/dist/headless/draw.d.ts.map +1 -0
  29. package/dist/headless/draw.js +25 -0
  30. package/dist/headless/draw.js.map +1 -0
  31. package/dist/headless/index.d.ts +99 -0
  32. package/dist/headless/index.d.ts.map +1 -0
  33. package/dist/headless/index.js +143 -0
  34. package/dist/headless/index.js.map +1 -0
  35. package/dist/headless/judge.d.ts +16 -0
  36. package/dist/headless/judge.d.ts.map +1 -0
  37. package/dist/headless/judge.js +52 -0
  38. package/dist/headless/judge.js.map +1 -0
  39. package/dist/headless/node.d.ts +8 -0
  40. package/dist/headless/node.d.ts.map +1 -0
  41. package/dist/headless/node.js +80 -0
  42. package/dist/headless/node.js.map +1 -0
  43. package/dist/headless/protocol.d.ts +75 -0
  44. package/dist/headless/protocol.d.ts.map +1 -0
  45. package/dist/headless/protocol.js +14 -0
  46. package/dist/headless/protocol.js.map +1 -0
  47. package/dist/headless/runtime.d.ts +2 -0
  48. package/dist/headless/runtime.d.ts.map +1 -0
  49. package/dist/headless/runtime.generated.d.ts +2 -0
  50. package/dist/headless/runtime.generated.d.ts.map +1 -0
  51. package/dist/headless/runtime.generated.js +8 -0
  52. package/dist/headless/runtime.generated.js.map +1 -0
  53. package/dist/headless/runtime.js +171 -0
  54. package/dist/headless/runtime.js.map +1 -0
  55. package/dist/headless/tree.d.ts +54 -0
  56. package/dist/headless/tree.d.ts.map +1 -0
  57. package/dist/headless/tree.js +128 -0
  58. package/dist/headless/tree.js.map +1 -0
  59. package/dist/host/css.d.ts +118 -0
  60. package/dist/host/css.d.ts.map +1 -0
  61. package/dist/host/css.js +963 -0
  62. package/dist/host/css.js.map +1 -0
  63. package/dist/host/draw-budget.d.ts +10 -0
  64. package/dist/host/draw-budget.d.ts.map +1 -0
  65. package/dist/host/draw-budget.js +29 -0
  66. package/dist/host/draw-budget.js.map +1 -0
  67. package/dist/host/frame.d.ts +19 -1
  68. package/dist/host/frame.d.ts.map +1 -1
  69. package/dist/host/frame.js +21 -2
  70. package/dist/host/frame.js.map +1 -1
  71. package/dist/host/index.d.ts +4 -3
  72. package/dist/host/index.d.ts.map +1 -1
  73. package/dist/host/index.js +7 -1
  74. package/dist/host/index.js.map +1 -1
  75. package/dist/host/kit.d.ts +6 -2
  76. package/dist/host/kit.d.ts.map +1 -1
  77. package/dist/host/kit.js +12 -5
  78. package/dist/host/kit.js.map +1 -1
  79. package/dist/host/links.d.ts +24 -0
  80. package/dist/host/links.d.ts.map +1 -0
  81. package/dist/host/links.js +35 -0
  82. package/dist/host/links.js.map +1 -0
  83. package/dist/host/manifest.d.ts +50 -0
  84. package/dist/host/manifest.d.ts.map +1 -0
  85. package/dist/host/manifest.js +103 -0
  86. package/dist/host/manifest.js.map +1 -0
  87. package/dist/host/open-draw.d.ts +44 -0
  88. package/dist/host/open-draw.d.ts.map +1 -0
  89. package/dist/host/open-draw.js +108 -0
  90. package/dist/host/open-draw.js.map +1 -0
  91. package/dist/host/open-judge.d.ts +53 -0
  92. package/dist/host/open-judge.d.ts.map +1 -0
  93. package/dist/host/open-judge.js +95 -0
  94. package/dist/host/open-judge.js.map +1 -0
  95. package/dist/host/open-render.d.ts +32 -0
  96. package/dist/host/open-render.d.ts.map +1 -0
  97. package/dist/host/open-render.js +262 -0
  98. package/dist/host/open-render.js.map +1 -0
  99. package/dist/host/press.d.ts +15 -0
  100. package/dist/host/press.d.ts.map +1 -0
  101. package/dist/host/press.js +156 -0
  102. package/dist/host/press.js.map +1 -0
  103. package/dist/host/react.d.ts +15 -2
  104. package/dist/host/react.d.ts.map +1 -1
  105. package/dist/host/react.js +13 -5
  106. package/dist/host/react.js.map +1 -1
  107. package/dist/host/session.d.ts +94 -1
  108. package/dist/host/session.d.ts.map +1 -1
  109. package/dist/host/session.js +103 -14
  110. package/dist/host/session.js.map +1 -1
  111. package/dist/host/theme.d.ts +14 -0
  112. package/dist/host/theme.d.ts.map +1 -0
  113. package/dist/host/theme.js +51 -0
  114. package/dist/host/theme.js.map +1 -0
  115. package/dist/host/view-runtime.generated.d.ts +2 -0
  116. package/dist/host/view-runtime.generated.d.ts.map +1 -0
  117. package/dist/host/view-runtime.generated.js +7 -0
  118. package/dist/host/view-runtime.generated.js.map +1 -0
  119. package/dist/host/view-source.d.ts +10 -0
  120. package/dist/host/view-source.d.ts.map +1 -0
  121. package/dist/host/view-source.js +44 -0
  122. package/dist/host/view-source.js.map +1 -0
  123. package/dist/host/view.d.ts +138 -0
  124. package/dist/host/view.d.ts.map +1 -0
  125. package/dist/host/view.js +381 -0
  126. package/dist/host/view.js.map +1 -0
  127. package/dist/host/views.d.ts +10 -0
  128. package/dist/host/views.d.ts.map +1 -0
  129. package/dist/host/views.js +15 -0
  130. package/dist/host/views.js.map +1 -0
  131. package/dist/host/worker-react.d.ts +57 -0
  132. package/dist/host/worker-react.d.ts.map +1 -0
  133. package/dist/host/worker-react.js +129 -0
  134. package/dist/host/worker-react.js.map +1 -0
  135. package/dist/host/worker-start.d.ts +66 -0
  136. package/dist/host/worker-start.d.ts.map +1 -0
  137. package/dist/host/worker-start.js +188 -0
  138. package/dist/host/worker-start.js.map +1 -0
  139. package/dist/host/worker.d.ts +28 -19
  140. package/dist/host/worker.d.ts.map +1 -1
  141. package/dist/host/worker.js +60 -119
  142. package/dist/host/worker.js.map +1 -1
  143. package/dist/host/writes.d.ts +49 -0
  144. package/dist/host/writes.d.ts.map +1 -0
  145. package/dist/host/writes.js +76 -0
  146. package/dist/host/writes.js.map +1 -0
  147. package/dist/index.d.ts +1 -1
  148. package/dist/index.d.ts.map +1 -1
  149. package/dist/open-kit.d.ts +148 -0
  150. package/dist/open-kit.d.ts.map +1 -0
  151. package/dist/open-kit.js +321 -0
  152. package/dist/open-kit.js.map +1 -0
  153. package/dist/protocol.d.ts +109 -3
  154. package/dist/protocol.d.ts.map +1 -1
  155. package/dist/protocol.js +13 -0
  156. package/dist/protocol.js.map +1 -1
  157. package/dist/worker/harden.d.ts +13 -2
  158. package/dist/worker/harden.d.ts.map +1 -1
  159. package/dist/worker/harden.js +10 -4
  160. package/dist/worker/harden.js.map +1 -1
  161. package/dist/worker/natives.d.ts +1 -0
  162. package/dist/worker/natives.d.ts.map +1 -1
  163. package/dist/worker/natives.js +4 -0
  164. package/dist/worker/natives.js.map +1 -1
  165. package/dist/worker/view-global.d.ts +70 -0
  166. package/dist/worker/view-global.d.ts.map +1 -0
  167. package/dist/worker/view-global.js +264 -0
  168. package/dist/worker/view-global.js.map +1 -0
  169. package/dist/worker/view.d.ts +14 -0
  170. package/dist/worker/view.d.ts.map +1 -0
  171. package/dist/worker/view.js +64 -0
  172. package/dist/worker/view.js.map +1 -0
  173. package/package.json +30 -4
@@ -0,0 +1,8 @@
1
+ /*
2
+ * GENERATED by scripts/guest-view-runtime.mjs from src/headless/runtime.ts — do not edit.
3
+ * A headless run's runtime as one classic script (FR-95): `headlessScript` puts
4
+ * it in front of a view's own source, for an isolate the host picked.
5
+ * Carries Remote DOM (MIT, Shopify Inc.).
6
+ */
7
+ export const HEADLESS_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 A=Symbol(\"name\"),he=Symbol(\"prefix\"),ge=Symbol(\"value\"),C=Symbol(\"ns\"),Y=Symbol(\"owner\"),I=Symbol(\"owner_document\"),se=Symbol(\"attributes\"),D=Symbol(\"prev\"),S=Symbol(\"next\"),k=Symbol(\"child\"),q=Symbol(\"parent\"),ye=Symbol(\"host\"),Z=Symbol(\"data\"),we=Symbol(\"listeners\"),Dn=Symbol(\"isTrusted\"),Me=Symbol(\"path\"),Le=Symbol(\"stop_immediate_propagation\"),He=Symbol(\"dispatching\"),le=Symbol(\"content\"),M=Symbol(\"hooks\"),Rt=Symbol(\"extensions\"),Se=Symbol(\"hooks_dispatch\"),U=Symbol(\"is_connected\"),Ve=Symbol(\"create_element\"),Dr=0,X=1,Ue=2,je=3,ze=8,Oe=9,Mr=10,be=11,_=\"http://www.w3.org/1999/xhtml\",J=\"http://www.w3.org/2000/svg\",Lr=\"http://www.w3.org/XML/1998/namespace\",at=\"http://www.w3.org/2000/xmlns/\";function At(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 Hr(t){return t.replace(/[a-z]/g,e=>String.fromCharCode(e.charCodeAt(0)-32))}function P(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 Vr=/^(?:[A-Za-z][^\\0\\t\\n\\f\\r\\u0020/>]*|[:_\\u0080-\\u{10FFFF}][A-Za-z0-9-.:_\\u0080-\\u{10FFFF}]*)$/u,Ur=/[\\0\\t\\n\\f\\r />=]/u,Ts=/[\\0\\t\\n\\f\\r />]/u;function ce(t){if(t==null)return null;let e=String(t);return e===\"\"?null:e}function jr(t){Vr.test(t)||Ln(t)}function Mn(t){(t===\"\"||Ur.test(t))&&Ln(t)}function Ct(t,e,n){let r=ce(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===\"\"||Ts.test(i))||(n===\"element\"?!Vr.test(l):l===\"\"||Ur.test(l)))&&Ln(o),i!=null&&r==null)throw P(`A namespace is required for the prefix in \"${o}\"`,\"NamespaceError\");if(i===\"xml\"&&r!==Lr)throw P(\"The xml prefix requires the XML namespace\",\"NamespaceError\");if((o===\"xmlns\"||i===\"xmlns\")&&r!==at)throw P(\"The xmlns name requires the XMLNS namespace\",\"NamespaceError\");if(r===at&&o!==\"xmlns\"&&i!==\"xmlns\")throw P(\"The XMLNS namespace requires the xmlns name or prefix\",\"NamespaceError\");return{namespace:r,qualifiedName:o,prefix:i,localName:l}}function Ln(t){throw P(`Invalid name: \"${t}\"`,\"InvalidCharacterError\")}var kt=0,_t=1,zr=2,Hn=3,xs=typeof performance>\"u\"?Date.now:performance.now.bind(performance),j=class{static NONE=kt;static CAPTURING_PHASE=_t;static AT_TARGET=zr;static BUBBLING_PHASE=Hn;timeStamp=xs();target=null;currentTarget=null;srcElement=null;bubbles=!1;cancelable=!1;composed=!1;defaultPrevented=!1;cancelBubble=!1;eventPhase=kt;[Me]=[];[Le]=!1;[He]=!1;constructor(e,n){this.type=e,Object.defineProperty(this,Dn,{writable:!0,value:!1}),n&&(n.bubbles&&(this.bubbles=n.bubbles),n.cancelable&&(this.cancelable=n.cancelable),n.composed&&(this.composed=n.composed))}get isTrusted(){return this[Dn]}composedPath(){return[...this[Me]]}stopPropagation(){this.cancelBubble=!0}stopImmediatePropagation(){this[Le]=!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 Vn(t,e,n){if(t.cancelBubble)return;let o=e[we]?.get(t.type)?.[n===_t?\"capture\":\"bubble\"];if(o)for(let s of[...o]){if(!o.has(s)||s.signal?.aborted)continue;t.eventPhase=t.target===e?zr:n,t.currentTarget=e;let i=s.normalizedListener;try{typeof i==\"object\"?i.handleEvent(t):i.call(e,t)}catch(l){setTimeout(ws,0,l)}if(t[Le])break}}function ws(t){throw t}var lt=[],Pt=new WeakMap;function It(t,e){let n=Pt.get(t);n?n.push(e):Pt.set(t,[e]),lt[lt.length-1].push(t)}function z(t){let e=[];lt.push(e);let n;try{n=t()}catch(r){lt.pop();try{$r(e)}catch{}throw r}return lt.pop(),$r(e),n}function $r(t){let e,n=!1;for(let r of t){let o=Pt.get(r);if(o){for(;o.length>0;){let s=o.shift();try{s()}catch(i){n||(e=i,n=!0)}}Pt.delete(r)}}if(n)throw e}var Dt=[],ct=[],Un=!1;function ve(t){for(let e of t)Dt.push(e),e[1]&&ct.push(e[1]);if(!Un){Un=!0;try{let e,n=!1;for(let r=0;r<Dt.length;r++){let[o,s]=Dt[r];s&&ct.splice(ct.indexOf(s),1);try{o()}catch(i){n||(e=i,n=!0)}}if(n)throw e}finally{Dt.length=0,ct.length=0,Un=!1}}}function ut(t){let e=t;for(;e;){if(ct.includes(e))return!0;e=e[q]??e[ye]}return!1}var dt=Symbol(\"listenerRegistrations\"),Ee=class{[we]=void 0;[dt]=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 l=jn(o),u=this[dt];u||(u=new Map,this[dt]=u);let d=u.get(e);d||(d={},u.set(e,d));let p=d[l];if(p||(p=new Map,d[l]=p),p.has(n))return;let E=this,f={type:e,listener:n,capture:o,once:s,normalizedListener:n,signal:i};(s||i)&&(f.normalizedListener=function(...c){if(f.signal?.aborted){Mt(E,f);return}return f.once&&Mt(E,f),typeof f.listener==\"object\"?f.listener.handleEvent(...c):f.listener.call(this,...c)});let b=this[we];b||(b=new Map,this[we]=b);let N=b.get(e);N||(N={},b.set(e,N));let O=N[l];if(O||(O=new Set,N[l]=O),p.set(n,f),O.add(f),i){let y=()=>{Mt(E,f)};f.abortListener=y,i.addEventListener(\"abort\",y,{once:!0})}this[I]?.defaultView[Se].addEventListener?.(this,e,n,r)}removeEventListener(e,n,r){return Ss.call(this,e,n,r)}dispatchEvent(e){if(e[He])throw P(\"Failed to execute 'dispatchEvent' on 'EventTarget': The event is already being dispatched.\",\"InvalidStateError\");e[He]=!0;try{let n=[],r=this;for(;r!=null;)n.push(r),r=r.parentNode;e.target=this,e.srcElement=this,e[Me]=n;for(let s=n.length;s--;)if(Vn(e,n[s],_t),e.cancelBubble)return!e.defaultPrevented;let o=e.bubbles?n:n.slice(0,1);for(let s=0;s<o.length;s++)if(Vn(e,o[s],Hn),e.cancelBubble)return!e.defaultPrevented;return!e.defaultPrevented}finally{e[He]=!1,e.cancelBubble=!1,e[Le]=!1,e.eventPhase=kt,e.currentTarget=null,e[Me]=[]}}};function Ss(t,e,n){if(e==null)return;let r=n===!0||n&&n.capture===!0,o=jn(!!r),s=this[dt]?.get(t)?.[o]?.get(e);s&&Mt(this,s)}function jn(t){return t?\"capture\":\"bubble\"}function Mt(t,e){let n=jn(e.capture),r=t[dt],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[we],l=i?.get(e.type);if(!l)return;let u=l[n];u?.delete(e)&&(u.size===0&&delete l[n],!l.bubble&&!l.capture&&i?.delete(e.type),t[I]?.defaultView[Se].removeEventListener?.(t,e.type,e.listener,e.capture))}var Q=class extends Array{item(e){return this[e]??null}};var mt=0,Fr=1,Fn=2,Bn=3,pt=4,Br=0,Gr=1,Vt=2,Ut=3,Yr=4,$n=5,qr=6,Wr=7,Lt=/^(?:--|-?[A-Za-z_\\u0080-\\u{10FFFF}])[A-Za-z0-9_\\u0080-\\u{10FFFF}-]*$/u;function Os(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 P(`Invalid or unsupported selector: \"${t}\"`,\"SyntaxError\")}function jt(t,e){let n=typeof e==\"string\"?ht(e):[{combinator:pt,matchers:e}],r=null,o=t[k];return o&&n[0].matchers.length&&Gn(o,n,s=>(r=s,!1)),r}function zt(t,e){let n=typeof e==\"string\"?ht(e):[{combinator:pt,matchers:e}],r=new Q,o=t[k];return o&&n[0].matchers.length&&Gn(o,n,s=>{r.push(s)}),r}function ht(t,e=!1,n=!1){let r={combinator:pt,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,u;for(;u=s.exec(i);){u.index!==l&&W(t),u[1]&&(r.matchers.length===0&&!(n&&o.length===1)&&W(t),u[1]===\">\"?r.combinator=Fr:u[1]===\"+\"?r.combinator=Bn:u[1]===\"~\"?r.combinator=Fn:r.combinator=mt,r={combinator:pt,matchers:[]},o.push(r));let d=u[8]?H(u[8]):u[2]||u[7];u[7]!=null&&!u[6]&&r.matchers.length>0&&W(t);let E,f=u[4]??u[5]??u[7];if(u[2]){Lt.test(d)||W(t);let b=u[5],N=b?.[0];if(u[3]==null&&(N==='\"'||N===\"'\")){let O=u[0].lastIndexOf(b);f=i.slice(u.index+O+1),s.lastIndex=i.length}else b!=null&&!Lt.test(b)&&W(t);E=Yr}else u[6]?(Lt.test(d)||W(t),E=u[6]===\"#\"?Vt:Ut):u[8]?E=u[9]==null?$n:qr:u[7]===\"*\"?E=Br:u[7]&&Lt.test(u[7])?E=Gr:W(t);u[9]?([f,s.lastIndex]=Os(i,s.lastIndex),d!==\"has\"&&d!==\"not\"&&W(t),d===\"has\"&&e&&W(t),ht(f,e||d===\"has\",d===\"has\")):E===$n&&W(t),r.matchers.push({type:E,name:d,value:f}),l=s.lastIndex}return(l!==i.length||r.matchers.length===0)&&W(t),o}function vs(t,e){let n=ht(e);return n[0]?.matchers.length?ft(t,n):!1}function Rs(t,e){let n=ht(e,!0,!0),r=n[0];if(n.length===1&&r.matchers.length===0)return!1;let o=mt,s={type:Wr,name:\":scope\"};if(r.matchers.length===0?(o=r.combinator,r.matchers.push(s)):n.unshift({combinator:mt,matchers:[s]}),n.some(({matchers:u})=>u.length===0))return!1;let i=o===Bn||o===Fn?t[S]:t[k];if(!i)return!1;let l=!1;return Gn(i,n,()=>(l=!0,!1),t),l}function Gn(t,e,n,r){let o=[],s=t;for(;s;){if(G(s)){if(ft(s,e,r)&&n(s)===!1)return!1;let i=s[k];if(i){let l=s[S];l&&o.push(l),s=i;continue}}s=s[S]??o.pop()??null}return!0}function ft(t,e,n){let{combinator:r,matchers:o}=e[e.length-1];if(r===pt){if(!Ht(t,o,n))return!1;let l=e.slice(0,-1);return l.length===0||ft(t,l,n)}let s=r===Fr||r===mt?q:D,i=t[s];if(!i)return!1;if(r===mt||r===Fn){for(;i;){if(G(i)&&Ht(i,o,n)){let l=e.slice(0,-1);if(l.length===0||ft(i,l,n))return!0}i=i[s]}return!1}else{if(r===Bn&&!G(i)){for(;i&&!G(i);)i=i[s];if(!i)return!1}if(!G(i)||!Ht(i,o,n))return!1;let l=e.slice(0,-1);return l.length===0||ft(i,l,n)}}function zn(t,e){return t.getAttributeNS(null,t.namespaceURI===_?H(e):e)}function Ht(t,e,n){if(!t)return!1;if(Array.isArray(e)){for(let i of e)if(Ht(t,i,n)===!1)return!1;return!0}let{type:r,name:o,value:s}=e;switch(r){case Br:return o===\"*\";case Gr:return t.namespaceURI===_?t.localName===H(o):t.localName===o;case Vt:return zn(t,\"id\")===o;case Ut:let i=zn(t,\"class\");return i?At(i).includes(o):!1;case Yr:let l=zn(t,o);return s==null?l!=null:l===s;case Wr:return t===n;case $n:W(`:${o}`);case qr:switch(o){case\"has\":return Rs(t,s||\"\");case\"not\":return!vs(t,s||\"\");default:W(`:${o}(${s})`)}}return!1}function As(t){return t.nodeType===Ue}function gt(t){return Z in t}function qn(t){return t.nodeType===je}function Cs(t){return t.nodeType===ze}function G(t){return t.nodeType===X}function Yn(t){return t.nodeType===be}function Jr(t){return\"appendChild\"in t}function $t(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 u of bt(i)){if(o.has(u)||(o.add(u),e.push(u),l.push(u),!G(u)))continue;let d=u[se];if(d)for(let E of d)o.has(E)||(o.add(E),e.push(E));let p=u[le];p&&!o.has(p)&&!r.has(p)&&(r.add(p),n.push(p))}s??=l}return{nodes:e,treeNodes:s}}function yt(t,e){for(let n of t)n[I]=e}function Xr(t,e){let n=t.constructor,r=new n(t.name,t.value,t.namespaceURI);return r[I]=e,r}function Kr(t,e){if(qn(t))return e.createTextNode(t.data);if(Cs(t))return e.createComment(t.data);if(As(t))return Xr(t,e);if(G(t)){let n=e[Ve](t[A],t.namespaceURI,t[he],t.localName);if(t[se])for(let r=0;r<t[se].length;r++){let o=t[se].item(r);n.attributes.setNamedItem(Xr(o,e))}return n}else{if(Yn(t))return e.createDocumentFragment();{let n=new t.constructor;return n[I]=e,n}}}function Ft(t,e,n=t.ownerDocument){if(t.nodeType===Oe)throw P(\"Cannot clone a document node\",\"NotSupportedError\");let r=Kr(t,n);if(!e||!G(t)&&!Yn(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,u;if(i.cloningContent)if(i.contentSource&&i.contentDestination)l=i.contentSource.childNodes[i.childIndex++],u=i.contentDestination;else{s.pop(),i.appendTo&&i.appendTo.appendChild(i.destination);continue}else if(l=i.source.childNodes[i.childIndex++],u=i.destination,!l){if(i.cloningContent=!0,i.childIndex=0,G(i.source)&&i.source.namespaceURI===_&&i.source.localName===\"template\"){let p=i.source[le];p&&(o.has(p)&&Zr(),o.add(p),i.contentSource=p,i.contentDestination=i.destination.content)}continue}if(!l){s.pop(),i.appendTo&&i.appendTo.appendChild(i.destination);continue}o.has(l)&&Zr(),o.add(l);let d=Kr(l,n);G(l)||Yn(l)?s.push({source:l,destination:d,appendTo:u,childIndex:0,cloningContent:!1}):u.appendChild(d)}return r}function Zr(){throw new Error(\"Cannot clone a cyclic or repeated node graph\")}function Bt(t,e){let n=String(e);return n===\"\"?null:jt(t,[{type:Vt,name:n}])}function Gt(t,e){let n=[...new Set(At(String(e)))];return zt(t,n.map(r=>({type:Ut,name:r})))}function Yt(t,e){let n=String(e),r=H(n),o=[];for(let s of qt(t))G(s)&&(n===\"*\"||(s.namespaceURI===_?s[A]===r:s[A]===n))&&o.push(s);return o}function qt(t){let e=[],n=[],r=t[k];for(;r;){e.push(r);let o=r[k],s=r[S];o?(s&&n.push(s),r=o):r=s??n.pop()??null}return e}function bt(t){let e=qt(t);return e.unshift(t),e}var ee=class extends Ee{nodeType=Dr;[A]=\"\";[q]=null;[ye]=null;[k]=null;[D]=null;[S]=null;[U]=!1;get[M](){return this[I].defaultView[Se]}get localName(){return this[A]}get nodeName(){return this[A]}get ownerDocument(){return this[I]}get isConnected(){return this[U]}isDefaultNamespace(e){let n=ce(e);return ks(this)===n}get parentNode(){return this[q]}set parentNode(e){}get parentElement(){let e=this[q];return!e||e.nodeType!==1?null:e}set parentElement(e){}get previousSibling(){return this[D]}set previousSibling(e){}get nextSibling(){return this[S]}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[S];for(;e&&e.nodeType!==1;)e=e[S];return e}set nextElementSibling(e){}get firstChild(){return this[k]}set firstChild(e){}get lastChild(){let e=this[k];for(;e;){let n=e[S];if(n==null)break;e=n}return e}set lastChild(e){}get nodeValue(){return gt(this)?this.data:null}set nodeValue(e){gt(this)&&(this.data=e)}get textContent(){if(gt(this))return this.data;let e=\"\";for(let n of qt(this))qn(n)&&(e+=n.data);return e}set textContent(e){if(gt(this))this.data=e;else if(Jr(this)){let n=e==null?\"\":String(e);n===\"\"?this.replaceChildren():this.replaceChildren(n)}}cloneNode(e){return Ft(this,e)}contains(e){let n=e;for(;n!=null;){if(n===this)return!0;n=n.parentNode}return!1}};function ks(t){let e=t;for(;e;)switch(e.nodeType){case X:{let n=e;if(n.prefix==null&&n.namespaceURI!=null)return n.namespaceURI;let r=n.attributes.getNamedItemNS(at,\"xmlns\");if(r!=null&&r.prefix==null)return ce(r.value);e=n.parentElement;break}case Oe:e=e.documentElement;break;case Mr:case be:return null;case Ue:e=e.ownerElement;break;default:e=e.parentElement}return null}var te=Symbol(\"insertNode\"),Kn=Symbol(\"preflightInsertions\"),Wt=Symbol(\"replaceNode\"),Ne=class extends ee{remove(){let e=this.parentNode;e&&e.removeChild(this)}replaceWith(...e){let n=Re(e),r=this.parentNode;if(r)return Wn(o=>{ue(r,n);let s=this[S];for(;s&&n.includes(s);)s=s[S];let i=Xn(r,n,o);this.parentNode===r?r[Wt](i,this,o):r[te](i,s,o)})}before(...e){let n=Re(e),r=this.parentNode;if(r)return Wn(o=>{ue(r,n);let s=this[D];for(;s&&n.includes(s);)s=s[D];let i=Xn(r,n,o);r[te](i,s?s[S]:r.firstChild,o)})}after(...e){let n=Re(e),r=this.parentNode;if(r)return Wn(o=>{ue(r,n);let s=this[S];for(;s&&n.includes(s);)s=s[S];let i=Xn(r,n,o);r[te](i,s,o)})}};function Wn(t){return z(()=>{let e=[];try{t(e)}catch(n){try{ve(e)}catch{}throw n}ve(e)})}function Re(t){return t.map(e=>e instanceof ee?e:String(e))}function Et(t,e){return e instanceof ee?e:t.ownerDocument.createTextNode(String(e))}function ue(t,e){for(let n of e){if(!(n instanceof ee))continue;let r=t;for(;r;){if(r===n)throw P(\"Cannot insert a node into itself or one of its descendants\",\"HierarchyRequestError\");r=r[q]??r[ye]}}}function Xn(t,e,n){let r=[];for(let s of e)r.push(Et(t,s));if(r.length===1)return r[0];let o=t.ownerDocument.createDocumentFragment();o[Kn](r);for(let s of r)o[te](s,null,n);return o}var Xt,Zn=0,Qr=0,eo=0,to=0,$e=!1,Qn=!1,Nt=!1,Kt=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=_s(n),o=Xt??=new WeakMap,s=o.get(e);s==null&&(s=new Map,o.set(e,s));let i=s.get(this);i==null?Zn++:Jn(i,-1),s.set(this,r),Jn(r,1),this.#e.add(e)}disconnect(){let e=Xt;if(e!=null){for(let n of this.#e){let r=e.get(n),o=r?.get(this);o!=null&&(r.delete(this),Zn--,Jn(o,-1)),r?.size===0&&e.delete(n)}this.#e.clear(),this.#n.length=0,Zn===0&&(Xt=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 ne(t){let e=Xt;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 Zt(...t){let e=new Q;return e.push(...t),e}function _s(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 Jn(t,e){t.attributes&&(Qr+=e),t.characterData&&(eo+=e),t.childList&&(to+=e),$e=Qr>0,Qn=eo>0,Nt=to>0}var ie=class extends Ne{childNodes=new Q;children=new Q;appendChild(e){return z(()=>this[te](e,null))}insertBefore(e,n){return z(()=>this[te](e,n||null))}append(...e){return z(()=>{let n=Re(e.filter(r=>r!=null));n.length>1&&ue(this,n);for(let r of n)this[te](Et(this,r),null)})}prepend(...e){return z(()=>{let n=Re(e.filter(o=>o!=null));n.length>1&&ue(this,n);let r=this.firstChild;for(let o of n)this[te](Et(this,o),r)})}replaceChildren(...e){return z(()=>{let n=Re(e.filter(o=>o!=null));ue(this,n);let r;for(;r=this.firstChild;)this.removeChildImmediately(r);for(let o of n)this[te](Et(this,o),null)})}removeChild(e){return z(()=>(this.removeChildImmediately(e),e))}removeChildImmediately(e){if(e.parentNode!==this)throw P(\"The node is not a child of this node\",\"NotFoundError\");let n=this[U]?bt(e):void 0,r=e[D],o=e[S],s=Jt(this,e);if(n)for(let i of n)i[U]=!1;this.queueRemovalMutationRecord(this,e,r,o),n&&this.enqueueTreeReactions(n,\"disconnectedCallback\"),ve(this.collectRemovalHookEffects(e,s))}replaceChild(e,n){return z(()=>this[Wt](e,n))}[Wt](e,n,r){if(ue(this,[e]),n.parentNode!==this)throw P(\"The reference node is not a child of this parent\",\"NotFoundError\");let o=n[D],s=n[S],i=this.prepareInsertion(e),l=this[U]?bt(n):void 0,u=new Set(i.map(({node:f})=>f)),d=s;for(;d&&u.has(d);)d=d[S];let p=Jt(this,n);if(l){for(let b of l)b[U]=!1;let f=new Set(l);for(let b of i)f.has(b.node)&&(b.shouldDisconnect=!1)}this.commitInsertion(i,d);let E=this[U];return this.queueRemovalMutationRecord(this,n,o,s),this.queueInsertionMutationRecords(i),l&&this.enqueueTreeReactions(l,\"disconnectedCallback\"),this.enqueueInsertionReactions(i,E),this.performOrCollectHookEffects([...this.collectRemovalHookEffects(n,p),...this.collectInsertionHookEffects(i)],r),n}querySelectorAll(e){return zt(this,e)}querySelector(e){return jt(this,e)}[te](e,n,r){return this.validateInsertion(e,n),this.insertIntoValidated(e,n,r),e}[Kn](e){for(let n of e)this.validateInsertion(n,null),this.prepareInsertion(n)}validateInsertion(e,n){if(ue(this,[e]),n&&n.parentNode!==this)throw P(\"The reference node is not a child of this parent\",\"NotFoundError\")}insertIntoValidated(e,n,r){e===n&&(n=e[S]);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):ve(e)}prepareInsertion(e){let n=[];if(e.nodeType===be){let i=e[k];for(;i;)n.push(i),i=i[S]}else n.push(e);let r=this[U],o=this[I],s=[];for(let i of n){let l=i[U],u=l||r,d,p;if(i[I]===o)u&&(d=bt(i));else{let E=$t(i);p=E.nodes,u&&(d=E.treeNodes)}s.push({node:i,nodes:d,adoption:p,shouldDisconnect:l})}return s}commitInsertion(e,n){for(let s of e){let i=s.node[q];if(i){let l=s.node[D],u=s.node[S];s.source={parent:i,index:Jt(i,s.node),previousSibling:l,nextSibling:u}}}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&&yt(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[S]=n,e[D]=s,s?s[S]=e:this[k]=e,n[D]=e}else{e[S]=null;let s=this[k];if(s){let i;for(;i=s[S];)s=i;s[S]=e,e[D]=s}else this[k]=e,e[D]=null}let r=G(e);e[q]=this;let o;if(n){if(o=this.childNodes.indexOf(n),this.childNodes.splice(o,0,e),r){let s=n;for(;s&&!G(s);)s=s[S];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[S]}}queueRemovalMutationRecord(e,n,r,o){Nt&&ne({type:\"childList\",target:e,removedNodes:Zt(n),previousSibling:r,nextSibling:o})}queueInsertionMutationRecords(e){if(Nt)for(let n of e){let{node:r,source:o}=n;o&&this.queueRemovalMutationRecord(o.parent,r,o.previousSibling,o.nextSibling),ne({type:\"childList\",target:this,addedNodes:Zt(r),previousSibling:n.previousSibling,nextSibling:n.nextSibling})}}collectRemovalHookEffects(e,n){return this.nodeType!==X||ut(this)?[]:[[()=>this[M].removeChild?.(this,e,n)]]}collectInsertionHookEffects(e){let n=[];for(let r of e){let{node:o,source:s}=r;s?.parent.nodeType===X&&!ut(s.parent)&&n.push([()=>s.parent[M].removeChild?.(s.parent,o,s.index)]),this.nodeType===X&&!ut(this)&&n.push([()=>this[M].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){ro(e,n)}};function no(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[S],l=Jt(t,e);if(o)for(let d of o)d[U]=!1;yt(n.nodes,r),Nt&&ne({type:\"childList\",target:t,removedNodes:Zt(e),previousSibling:s,nextSibling:i}),o&&ro(o,\"disconnectedCallback\");let u=[];t.nodeType===X&&!ut(t)&&u.push([()=>t[M].removeChild?.(t,e,l)]),ve(u)}function Jt(t,e){let n=e[D],r=e[S];n?n[S]=r:t[k]=r,r&&(r[D]=n);let o=t.childNodes.indexOf(e);return t.childNodes.splice(o,1),G(e)&&t.children.splice(t.children.indexOf(e),1),e[q]=null,e[S]=null,e[D]=null,o}function ro(t,e){for(let n of t){let r=n[e];typeof r==\"function\"&&It(n,()=>r.call(n))}}function Tt(t,e,n,r,o){let{observedAttributes:s}=t.constructor,{attributeChangedCallback:i}=t;i==null||s==null||!s.includes(e)||It(t,()=>i.call(t,e,n,r,o))}var Qt=class{[k]=null;constructor(e){this[Y]=e}getNamedItem(e){let n=String(e),r=this[Y][C]===_?H(n):n,o=this[k];for(;o;){if(o.name===r)return o;o=o[S]}return null}getNamedItemNS(e,n){let r=ce(e),o=String(n),s=this[k];for(;s;){if(s.localName===o&&s[C]===r)return s;s=s[S]}return null}item(e){let n=this[k],r=0;for(;n;){if(r++===e)return n;n=n[S]}return null}get length(){let e=0,n=this[k];for(;n;)e++,n=n[S];return e}removeNamedItem(e){let n=String(e),r=this[Y][C]===_?H(n):n;return z(()=>this.removeNamedItemImmediately(o=>o.name===r))}removeNamedItemNS(e,n){let r=ce(e),o=String(n);return z(()=>this.removeNamedItemImmediately(s=>s.localName===o&&s[C]===r))}removeNamedItemImmediately(e){let n=this[Y],r=this[k],o=null;for(;r!=null;){if(e(r)){o&&(o[S]=r[S]),this[k]===r&&(this[k]=r[S]);let s=r.value;return r[S]=null,r[Y]=null,$e&&ne({type:\"attributes\",target:n,attributeName:r.name,attributeNamespace:r[C],oldValue:s}),n[M].removeAttribute?.(n,r.name,r[C]),Tt(n,r.localName,s,null,r[C]),r}o=r,r=r[S]}return null}setNamedItem(e){return z(()=>this.setNamedItemImmediately(e))}setNamedItemImmediately(e){let n=this[Y],r=e[Y];if(r!=null&&r!==n)throw P(\"The attribute is already in use by another element.\",\"InUseAttributeError\");let o=null,s=this[k],i=null;for(;s;){if(s.localName===e.localName&&s[C]===e[C]){if(s===e)return s;i?i[S]=e:this[k]=e,e[S]=s[S],s[S]=null,o=s;break}i=s,s=s[S]}o==null&&(i?i[S]=e:this[k]=e),e[Y]=n,e[I]=n[I],o&&(o[Y]=null);let l=o==null||o.value!==e.value,u=o!=null&&o.name!==e.name;return l&&$e&&ne({type:\"attributes\",target:n,attributeName:e.name,attributeNamespace:e[C],oldValue:o?.value??null}),u&&n[M].removeAttribute?.(n,o.name,o[C]),(l||u)&&n[M].setAttribute?.(n,e.name,e.value,e[C]),l&&Tt(n,e.localName,o?.value??null,e.value,e[C]),o}setNamedItemNS(e){return this.setNamedItem(e)}*[Symbol.iterator](){let e=this[k];for(;e;)yield e,e=e[S]}};var Ae=class extends ee{nodeType=Ue;[C]=null;[S]=null;[Y]=null;constructor(e,n,r){super(),this[A]=e,this[ge]=n,r&&(this[C]=r)}get nodeName(){return this[A]}set nodeName(e){}get name(){return this[A]}set name(e){}get localName(){if(this[C]==null)return this[A];let e=this[A].indexOf(\":\");return e<0?this[A]:this[A].slice(e+1)}get prefix(){if(this[C]==null)return null;let e=this[A].indexOf(\":\");return e<0?null:this[A].slice(0,e)}get value(){return this[ge]}set value(e){let n=String(e),r=this[Y];if(!r){this[ge]=n;return}z(()=>{let o=this[ge];this[ge]=n,$e&&o!==n&&ne({type:\"attributes\",target:r,attributeName:this[A],attributeNamespace:this[C],oldValue:o}),this[M].setAttribute?.(r,this[A],n,this[C]),Tt(r,this.localName,o,n,this[C])})}get nodeValue(){return this.value}set nodeValue(e){this.value=e}get ownerElement(){return this[Y]}get namespaceURI(){return this[C]}get specified(){return!0}};var Ps={amp:\"&\",AMP:\"&\",apos:\"'\",gt:\">\",GT:\">\",lt:\"<\",LT:\"<\",quot:'\"',QUOT:'\"'},Is=new Set([\"area\",\"base\",\"br\",\"col\",\"embed\",\"hr\",\"img\",\"input\",\"link\",\"meta\",\"param\",\"source\",\"track\",\"wbr\"]),Ds=/(?:<([a-z][a-z0-9-:]*)((?:[\\s]+[^<>'\"=/\\s]+(?:=(['\"])[^]*?\\3|=[^>'\"\\s]*|))*)[\\s]*(\\/?)\\s*>|<\\/([a-z][a-z0-9-:]*)>|<!--(.*?)-->|([^<>]+))/gi,io=/\\s([^<>'\"=/\\n\\s]+)(?:=([\"'])([\\s\\S]*?)\\2|=([^>'\"\\n\\s]*)|)/g,Ms=\"|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|\",Ls=/^(?:color|face|size)$/i;function oo(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 Ps[n];let s=Number.parseInt(r??o,r?10:16);try{return String.fromCodePoint(s)}catch{return e}})}function ao(t){return t.namespaceURI===_&&Is.has(t.localName)}function so(t){let e=t.localName;return t[C]===J&&(e===\"foreignObject\"||e===\"desc\"||e===\"title\")}function Hs(t,e){if(Ms.includes(`|${t}|`))return!0;if(t!==\"font\")return!1;for(let n of e.matchAll(io))if(Ls.test(n[1]))return!0;return!1}function en(t,e){let n=e.ownerDocument,r=n.createDocumentFragment(),o=[],s=r;for(let i of t.matchAll(Ds)){let l=i[1];if(l){let u=i[2],d=H(l),p=o[o.length-1]?.element??e,E=p[C]===J?J:_;if(d===\"svg\")E=J;else if(E===J){if(so(p))E=_;else if(Hs(d,u)){for(;o.length>0;){let N=o[o.length-1];if(N.element[C]!==J||so(N.element))break;o.pop(),s=N.target}E=_}}let f=E===_?d:l,b=n[Ve](f,E,null,f);for(let N of u.matchAll(io))b.setAttribute(N[1],oo(N[3]||N[4]||\"\"));if(s.append(b),ao(b)||E!==_&&i[4])continue;o.push({element:b,target:s}),s=E===_&&d===\"template\"?b.content:b}else if(i[5]){let u=H(i[5]);for(let d=o.length-1;d>=0;d--){let p=o[d],E=H(p.element[A]);if(E===u){s=p.target,o.length=d;break}if(p.element[C]===_&&E===\"template\")break}}else i[6]?s.append(n.createComment(i[6])):s.append(oo(i[7]))}return r}function tn(t){return co([{type:\"content\",child:t[k]}])}function lo(t){return co([{type:\"opening\",node:t}])}function co(t){let e=[],n;for(;n=t.pop();)switch(n.type){case\"opening\":{let r=n.node;switch(r.nodeType){case X:{let o=r;e.push(`<${o[A]}`);let s=o[se]?.[k];for(;s;){e.push(` ${s[A]}`);let l=s[ge];l!==\"\"&&(l=String(l).replace(/&/g,\"&amp;\").replace(/\"/g,\"&quot;\"),e.push(`=\"${l}\"`)),s=s[S]}if(e.push(\">\"),ao(o))break;let i=o.namespaceURI===_&&o.localName===\"template\"?o[le]:o;t.push({type:\"closing\",name:o[A]}),t.push({type:\"content\",child:i?.[k]??null});break}case je:{let o=r;e.push(o[Z].replace(/&/g,\"&amp;\").replace(/\"/g,\"&quot;\").replace(/</g,\"&lt;\").replace(/>/g,\"&gt;\"));break}case ze:{let o=r;e.push(`<!--${o[Z]}-->`);break}}break}case\"content\":{let r=n.child;r&&(t.push({type:\"content\",child:r[S]}),t.push({type:\"opening\",node:r}));break}case\"closing\":e.push(`</${n.name}>`);break}return e.join(\"\")}var V=class extends ie{nodeType=X;[C]=_;[he]=null;get namespaceURI(){return this[C]}get prefix(){return this[he]}get localName(){let e=this[he];return e==null?this[A]:this[A].slice(e.length+1)}get nodeName(){return this[C]===_?Hr(this[A]):this[A]}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 Ae(\"slot\",n))}get attributes(){let e=this[se];return e||(e=new Qt(this),this[se]=e),e}getAttributeNames(){return[...this.attributes].map(e=>e.name)}getElementsByTagName(e){return Yt(this,e)}get firstElementChild(){return this.children[0]??null}getElementsByClassName(e){return Gt(this,e)}get lastElementChild(){return this.children[this.children.length-1]??null}get nextElementSibling(){let e=this.nextSibling;for(;e&&e.nodeType!==1;)e=e.nextSibling;return e}get previousElementSibling(){let e=this.previousSibling;for(;e&&e.nodeType!==1;)e=e.previousSibling;return e}setAttribute(e,n){let r=String(e),o=String(n);Mn(r);let s=this[C]===_?H(r):r,i=this.attributes.getNamedItemNS(null,s);i?i.value=o:this.attributes.setNamedItem(new Ae(s,o))}setAttributeNS(e,n,r){let o=ce(e),s=String(n),i=String(r),l=Ct(o,s,\"attribute\"),u=this.attributes.getNamedItemNS(l.namespace,l.localName);u?u.value=i:this.attributes.setNamedItemNS(new Ae(l.qualifiedName,i,l.namespace))}toggleAttribute(e,n){let r=String(e);Mn(r);let o=this[C]===_?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 Ae(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[C]===_?H(n):n;this.attributes.removeNamedItemNS(null,r)}removeAttributeNS(e,n){this.attributes.removeNamedItemNS(e,n)}get outerHTML(){return lo(this)}get innerHTML(){return tn(this)}set innerHTML(e){if(e==null||e===\"\")this.replaceChildren();else{let n=en(String(e),this);this.replaceChildren(n)}}};var Fe=class t extends V{[C]=J;get ownerSVGElement(){let e=null,n=this.parentNode;for(;n instanceof t;)e=n,n=n.parentNode;return e}};var Te=class extends Ne{[Z]=\"\";constructor(e){super(),this[Z]=e==null?\"\":String(e)}setData(e){let n=Qn,r=n?this[Z]:null,o=\"\";e!=null&&(o=typeof e==\"string\"?e:String(e)),this[Z]=o,n&&r!==o&&ne({type:\"characterData\",target:this,oldValue:r}),this[M].setText?.(this,o)}get data(){return this[Z]}set data(e){this.setData(e)}};var Be=class extends Te{nodeType=je;[A]=\"#text\"};var Ge=class extends Te{nodeType=ze;[A]=\"#comment\"};var Ye=class extends ie{nodeType=be;[A]=\"#document-fragment\";[I]=typeof window<\"u\"?window.document:null;getElementById(e){return Bt(this,e)}};var qe=class extends V{get content(){let e=this[le];return e||(e=this.ownerDocument.createDocumentFragment(),e[ye]=this,this[le]=e),e}set content(e){}set innerHTML(e){this.content.replaceChildren(en(String(e),this))}get innerHTML(){let e=this[le];return e?tn(e):\"\"}};var nn=class extends V{};var rn=class extends V{};var on=class extends V{};var xt=class extends ie{nodeType=Oe;[A]=\"#document\";[U]=!0;constructor(e){super(),this.defaultView=e,this[I]=this,this.documentElement=an(new on,this,\"html\"),this.body=an(new nn,this,\"body\"),this.head=an(new rn,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 Gt(this,e)}createElement(e){let n=String(e);return jr(n),er(this,H(n))}createElementNS(e,n){let r=Ct(e,n,\"element\");return er(this,r.qualifiedName,r.namespace,r.prefix,r.localName)}[Ve](e,n,r,o){return er(this,e,n,r,o)}createTextNode(e){let n=sn(new Be(e),this);return this[M].createText?.(n,n.data),n}createComment(e){return sn(new Ge(e),this)}createDocumentFragment(){return sn(new Ye,this)}createEvent(){return new j(\"\")}getElementById(e){return Bt(this,e)}getElementsByTagName(e){return Yt(this,e)}importNode(e,n){if(e.nodeType===Oe)throw P(\"Cannot import a document node\",\"NotSupportedError\");return Ft(e,n,this)}adoptNode(e){if(e[I]===this)return e;let n=$t(e);return z(()=>{let r=e.parentNode;return r?no(r,e,n,this):yt(n.nodes,this),e})}};function sn(t,e){return Object.defineProperty(t,I,{value:e,writable:!0,enumerable:!1}),t}function er(t,e,n=_,r=null,o=e){let s;if(n===J)s=new Fe;else if(n===_&&o===\"template\")s=new qe;else if(n===_){let i=t.defaultView.customElements.get(o);s=i?new i:new V}else s=new V;return an(s,t,e,n,r)}function an(t,e,n,r=_,o=null){return sn(t,e),Object.defineProperties(t,{[A]:{value:n},[C]:{value:r},[he]:{value:o}}),e[M].createElement?.(t,r),t}var ln=class extends j{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 cn=class extends j{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 un=class extends j{constructor(e,n){super(e,n),this.promise=n.promise,this.reason=n.reason}};var dn=class extends j{constructor(e,n){super(e,n),this.oldState=n.oldState,this.newState=n.newState}};var fn=class extends j{constructor(e,n={}){super(e,n),this.relatedTarget=n.relatedTarget??null}};var mn=class extends j{constructor(e,n={}){super(e,n),this.clipboardData=n.clipboardData??null}};var pn=class extends V{};var Vs=/^[a-z][^A-Z\\u0000\\t\\n\\f\\r />]*-[^A-Z\\u0000\\t\\n\\f\\r />]*$/u,Us=new Set([\"annotation-xml\",\"color-profile\",\"font-face\",\"font-face-src\",\"font-face-uri\",\"font-face-format\",\"font-face-name\",\"missing-glyph\"]);function uo(t){return Vs.test(t)&&!Us.has(t)}function fo(t){return P(`Invalid custom element name: \"${t}\"`,\"SyntaxError\")}var hn=class{registry=new Map;listenersByName=new Map;define(e,n,r){if(!uo(e))throw fo(e);if(this.registry.has(e))throw P(`A custom element named \"${e}\" has already been defined`,\"NotSupportedError\");if(this.getName(n)!=null)throw P(\"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(!uo(e))return Promise.reject(fo(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 js=[\"onerror\",\"onunhandledrejection\"],po=Symbol.for(\"@remote-dom/polyfill/global-property\");function ho(t){return Object.getOwnPropertyDescriptors(t)}function go(t){let e={};for(let[n,r]of Object.entries(Object.getOwnPropertyDescriptors(Ee.prototype)))n!==\"constructor\"&&typeof r.value==\"function\"&&(r.value=tr(r.value.bind(t)),e[n]=r);return e}function yo(t){let e={};for(let n of js)e[n]={configurable:!0,enumerable:!0,get:tr(()=>t[n]),set:tr(r=>{t[n]=r})};return e}function zs(t){return Object.assign(ho(t),go(t),yo(t))}function tr(t){return Object.defineProperty(t,po,{value:!0}),t}function mo(t,e){for(let n of Reflect.ownKeys(e)){let r=$s(t,n);(r==null||Fs(r))&&Object.defineProperty(t,n,e[n])}}function $s(t,e){let n=t;for(;n;){let r=Object.getOwnPropertyDescriptor(n,e);if(r)return r;n=Object.getPrototypeOf(n)}}function Fs(t){return[t.value,t.get,t.set].some(e=>typeof e==\"function\"&&e[po]===!0)}var Ce=class extends Ee{[M]={};[Rt]=[];[Se]=Gs(this);name=\"\";window=this;parent=this;self=this;top=this;document=new xt(this);customElements=new hn;location=globalThis.location;navigator=globalThis.navigator;Event=j;ErrorEvent=cn;PromiseRejectionEvent=un;ToggleEvent=dn;FocusEvent=fn;ClipboardEvent=mn;EventTarget=Ee;CustomEvent=ln;Node=ee;ParentNode=ie;ChildNode=Ne;DocumentFragment=Ye;Document=xt;CharacterData=Te;Comment=Ge;Text=Be;Element=V;HTMLElement=pn;SVGElement=Fe;HTMLTemplateElement=qe;MutationObserver=Kt;#t=null;#n=null;#e=null;static with(...e){let n=this;return class extends n{constructor(){super();for(let o of e)Bs(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=ho(e),s=Object.assign(go(e),yo(e));delete o.self,Object.defineProperties(globalThis,o),mo(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),mo(n,s))}static setGlobalThis(e){for(let n in e)e[n]===e&&(e[n]=globalThis);Object.defineProperties(globalThis,zs(e))}};function Bs(t,e){t[Rt].push(e(t)??{})}function Gs(t){return{createElement:de.bind(null,t,\"createElement\"),setAttribute:de.bind(null,t,\"setAttribute\"),removeAttribute:de.bind(null,t,\"removeAttribute\"),createText:de.bind(null,t,\"createText\"),setText:de.bind(null,t,\"setText\"),insertChild:de.bind(null,t,\"insertChild\"),removeChild:de.bind(null,t,\"removeChild\"),addEventListener:de.bind(null,t,\"addEventListener\"),removeEventListener:de.bind(null,t,\"removeEventListener\")}}function de(t,e,...n){for(let s of t[Rt])s[e]?.apply(s,n);let r=t[M];r[e]?.apply(r,n)}var gn=new Ce;var nr=\"~\";var xe=new WeakMap;function We(t){return xe.get(t)}var ir=new WeakMap,qs=0;function re(t){let e=ir.get(t);return e==null&&(e=String(qs++),yn(t,e)),e}function yn(t,e){ir.set(t,e)}var or=new WeakMap;function Ws(t){return or.get(t)}var sr=new WeakMap;function Xs(t){let e=sr.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 Ks=new WeakMap;function Zs(t){return Ks.get(t)}function ar(t,e,n){let r=or.get(t);if(r==null&&(r={},or.set(t,r)),r[e]===n)return;r[e]=n;let o=xe.get(t);o?.mutate([[3,re(t),e,n,1]])}function bn(t,e,n){let r=sr.get(t);if(r==null&&(r={},sr.set(t,r)),r[e]===n)return;n==null?delete r[e]:r[e]=String(n);let o=xe.get(t);o?.mutate([[3,re(t),e,n,2]])}function Xe(t,e){if(xe.get(t)!==e&&(xe.set(t,e),t.childNodes))for(let r=0;r<t.childNodes.length;r++)Xe(t.childNodes[r],e)}function En(t){if(xe.get(t)!=null&&(xe.delete(t),t.childNodes))for(let n=0;n<t.childNodes.length;n++)En(t.childNodes[n])}function Ke(t){let{nodeType:e}=t;switch(e){case 1:return{id:re(t),type:e,element:t.localName,properties:rr(Ws(t)),attributes:rr(Xs(t)),eventListeners:rr(Zs(t)),children:Array.from(t.childNodes).map(Ke)};case 3:case 8:return{id:re(t),type:e,data:t.data};default:throw new Error(`Cannot serialize node of type ${t.nodeType} (${typeof t.nodeType})`)}}function rr(t){return t?{...t}:void 0}function lr(t,e,...n){let r=ir.get(t),o=xe.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=gn[M];Ze.insertChild=(t,e,n)=>{let r=We(t);r!=null&&(Xe(e,r),r.mutate([[0,re(t),Ke(e),n]]))};Ze.removeChild=(t,e,n)=>{let r=We(t);r!=null&&(En(e),r.mutate([[1,re(t),n]]))};Ze.setText=(t,e)=>{let n=We(t);n?.mutate([[2,re(t),e]])};Ze.setAttribute=(t,e,n)=>{t.tagName.includes(\"-\")||bn(t,e,n)};Ze.removeAttribute=(t,e)=>{t.tagName.includes(\"-\")||bn(t,e)};Ce.setGlobal(gn);var No=[\"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\"],To=[\"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\"],xo=[\"self\",\"postMessage\",\"setTimeout\",\"clearTimeout\",\"setInterval\",\"clearInterval\",\"queueMicrotask\",\"structuredClone\",\"crypto\",\"console\",\"DOMException\"],wo=[\"TEMPORARY\",\"PERSISTENT\"],tu=Object.freeze([...No,...To,...xo,...wo]),nu=Object.freeze([\"constructor\",\"__defineGetter__\",\"__defineSetter__\",\"hasOwnProperty\",\"__lookupGetter__\",\"__lookupSetter__\",\"isPrototypeOf\",\"propertyIsEnumerable\",\"toString\",\"valueOf\",\"__proto__\",\"toLocaleString\"]),Eo=t=>typeof t==\"symbol\"?`[${t.description??\"symbol\"}]`:t;function So(t=globalThis,e=[],n={}){let r=[],o=[],s=new Set([...No,...To,...xo,...e,\"constructor\",Symbol.toStringTag]),i=(g,a)=>{let m=Reflect.getOwnPropertyDescriptor(g,a);return m===void 0||!(\"value\"in m)||m.writable||m.configurable?!1:n.primitivesStay&&typeof a==\"symbol\"&&(typeof m.value!=\"object\"||m.value===null)&&typeof m.value!=\"function\"?!0:wo.includes(a)&&typeof m.value==\"number\"},l=t,u=l.setTimeout,d=l.setInterval,p=l.crypto,E=(g,a)=>function(m,T,...x){if(typeof m!=\"function\")throw new TypeError(`${a} takes a function: a guest view cannot run code from text`);return g.call(t,m,T,...x)},f=p?Object.freeze({getRandomValues:g=>p.getRandomValues(g)}):void 0,b=l.document?.defaultView;if(b&&b!==l)for(let g of Reflect.ownKeys(b))typeof g==\"symbol\"||s.has(g)||Reflect.deleteProperty(b,g)||o.push(`window.${g}`);let N=[];for(let g=t;g&&g!==Object.prototype;g=Object.getPrototypeOf(g))N.push(g);for(let g of N)for(let a of Reflect.ownKeys(g))s.has(a)||(Reflect.deleteProperty(g,a)?r.push(Eo(a)):i(g,a)||o.push(Eo(a)));let O=()=>function(){throw new EvalError(\"A guest view cannot make code from text.\")},y=[Function.prototype,Object.getPrototypeOf(async function(){}),Object.getPrototypeOf(function*(){}),Object.getPrototypeOf(async function*(){})];for(let g of y){let a=O();Object.defineProperty(a,\"prototype\",{value:g,writable:!1,enumerable:!1,configurable:!1}),Reflect.defineProperty(g,\"constructor\",{value:a,writable:!1,enumerable:!1,configurable:!1})||o.push(\"Function.prototype.constructor\"),g===Function.prototype&&Reflect.defineProperty(t,\"Function\",{value:a,writable:!0,enumerable:!1,configurable:!0})}let c=(g,a)=>{Reflect.defineProperty(t,g,{value:a,writable:!0,enumerable:!0,configurable:!0})||o.push(g)};c(\"setTimeout\",E(u,\"setTimeout\")),c(\"setInterval\",E(d,\"setInterval\")),f&&c(\"crypto\",f);for(let g of N.slice(1))Object.freeze(g);for(let g of Reflect.ownKeys(t)){let a=Reflect.getOwnPropertyDescriptor(t,g);Reflect.defineProperty(t,g,\"value\"in a?{...a,writable:!1,configurable:!1}:{...a,configurable:!1})}let h;try{h=Reflect.preventExtensions(t)}catch{h=!1}return{removed:r,stuck:o,sealed:h}}var wt=class extends HTMLElement{constructor(){super(),yn(this,nr)}connect(e){if(We(this)===e||(Xe(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,nr,Ke(o),r])}e.mutate(n)}updateRemoteProperty(e,n){ar(this,e,n)}callRemoteMethod(e,...n){return lr(this,e,...n)}};var w={},cr={empty:!0},Js={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\"},Qe={div:w,section:w,article:w,aside:w,header:w,footer:w,nav:w,hgroup:w,search:w,address:w,figure:w,figcaption:w,blockquote:w,p:w,pre:w,hr:cr,br:cr,wbr:cr,h1:w,h2:w,h3:w,h4:w,h5:w,h6:w,span:w,strong:w,em:w,b:w,i:w,u:w,s:w,small:w,mark:w,abbr:w,cite:w,q:w,code:w,kbd:w,samp:w,var:w,sub:w,sup:w,dfn:w,bdi:w,bdo:w,ruby:w,rt:w,rp:w,time:{attributes:{datetime:\"text\"}},data:{attributes:{value:\"text\"}},del:{attributes:{datetime:\"text\"}},ins:{attributes:{datetime:\"text\"}},a:w,ul:w,menu:w,dl:w,dt:w,dd:w,ol:{attributes:{start:\"number\",reversed:\"boolean\",type:{oneOf:[\"1\",\"a\",\"A\",\"i\",\"I\"]}}},li:{attributes:{value:\"number\"}},table:w,caption:w,thead:w,tbody:w,tfoot:w,tr:w,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:w,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:w,output:w,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\"]}}}},Qs=[\"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\"],ei={id:\"text\",class:\"text\",style:\"style\",lang:\"text\",role:\"text\",tabindex:{oneOf:[\"-1\",\"0\"]},transform:\"geometry\",...Object.fromEntries(Qs.map(t=>[t,\"css\"]))},Je={x:\"geometry\",y:\"geometry\",width:\"geometry\",height:\"geometry\"},Nn={viewBox:\"geometry\",preserveAspectRatio:\"geometry\"},Oo={gradientUnits:{oneOf:[\"userSpaceOnUse\",\"objectBoundingBox\"]},gradientTransform:\"geometry\",spreadMethod:{oneOf:[\"pad\",\"reflect\",\"repeat\"]},href:\"fragment\"},Tn={svg:{attributes:{...Je,...Nn}},g:w,defs:w,symbol:{attributes:{...Je,...Nn,refX:\"geometry\",refY:\"geometry\"}},use:{attributes:{...Je,href:\"fragment\"}},title:w,desc:w,path:{attributes:{d:\"geometry\",pathLength:\"number\"}},rect:{attributes:{...Je,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\",...Oo}},radialGradient:{attributes:{cx:\"geometry\",cy:\"geometry\",r:\"geometry\",fx:\"geometry\",fy:\"geometry\",fr:\"geometry\",...Oo}},stop:{attributes:{offset:\"geometry\"}},clipPath:{attributes:{clipPathUnits:{oneOf:[\"userSpaceOnUse\",\"objectBoundingBox\"]}}},mask:{attributes:{...Je,maskUnits:{oneOf:[\"userSpaceOnUse\",\"objectBoundingBox\"]},maskContentUnits:{oneOf:[\"userSpaceOnUse\",\"objectBoundingBox\"]}}},pattern:{attributes:{...Je,...Nn,patternUnits:{oneOf:[\"userSpaceOnUse\",\"objectBoundingBox\"]},patternContentUnits:{oneOf:[\"userSpaceOnUse\",\"objectBoundingBox\"]},patternTransform:\"geometry\",href:\"fragment\"}},marker:{attributes:{...Nn,markerWidth:\"geometry\",markerHeight:\"geometry\",refX:\"geometry\",refY:\"geometry\",orient:\"geometry\",markerUnits:{oneOf:[\"strokeWidth\",\"userSpaceOnUse\"]}}}};var vo=[\"alert\",\"alertdialog\",\"dialog\",\"banner\",\"main\",\"navigation\",\"contentinfo\",\"complementary\",\"search\",\"form\",\"region\",\"application\",\"status\",\"log\",\"marquee\",\"timer\"],St={nav:\"div\",header:\"div\",footer:\"div\",aside:\"div\",search:\"div\",output:\"span\"},xn={section:[\"aria-label\",\"aria-labelledby\",\"title\"]};function ti(t){return/^aria-[a-z]+$/.test(t)}function ni(t){return/^data-[a-z0-9][a-z0-9_.-]*$/.test(t)}var Ro=[\"display\",\"position\",\"top\",\"right\",\"bottom\",\"left\",\"inset\",\"inset-block\",\"inset-inline\",\"inset-block-start\",\"inset-block-end\",\"inset-inline-start\",\"inset-inline-end\",\"width\",\"height\",\"min-width\",\"min-height\",\"max-width\",\"max-height\",\"inline-size\",\"block-size\",\"min-inline-size\",\"min-block-size\",\"max-inline-size\",\"max-block-size\",\"margin\",\"margin-top\",\"margin-right\",\"margin-bottom\",\"margin-left\",\"margin-block\",\"margin-inline\",\"margin-block-start\",\"margin-block-end\",\"margin-inline-start\",\"margin-inline-end\",\"padding\",\"padding-top\",\"padding-right\",\"padding-bottom\",\"padding-left\",\"padding-block\",\"padding-inline\",\"padding-block-start\",\"padding-block-end\",\"padding-inline-start\",\"padding-inline-end\",\"box-sizing\",\"overflow\",\"overflow-x\",\"overflow-y\",\"overflow-wrap\",\"float\",\"clear\",\"z-index\",\"aspect-ratio\",\"object-fit\",\"object-position\",\"vertical-align\",\"isolation\",\"contain\",\"container\",\"container-type\",\"container-name\",\"content-visibility\",\"flex\",\"flex-direction\",\"flex-wrap\",\"flex-flow\",\"flex-grow\",\"flex-shrink\",\"flex-basis\",\"order\",\"grid\",\"grid-template\",\"grid-template-columns\",\"grid-template-rows\",\"grid-template-areas\",\"grid-auto-columns\",\"grid-auto-rows\",\"grid-auto-flow\",\"grid-area\",\"grid-column\",\"grid-row\",\"grid-column-start\",\"grid-column-end\",\"grid-row-start\",\"grid-row-end\",\"gap\",\"row-gap\",\"column-gap\",\"align-items\",\"align-content\",\"align-self\",\"justify-items\",\"justify-content\",\"justify-self\",\"place-items\",\"place-content\",\"place-self\",\"columns\",\"column-count\",\"column-width\",\"column-rule\",\"column-rule-color\",\"column-rule-style\",\"column-rule-width\",\"column-span\",\"column-fill\",\"color\",\"background\",\"background-color\",\"background-image\",\"background-position\",\"background-position-x\",\"background-position-y\",\"background-size\",\"background-repeat\",\"background-origin\",\"background-clip\",\"background-attachment\",\"background-blend-mode\",\"border\",\"border-top\",\"border-right\",\"border-bottom\",\"border-left\",\"border-block\",\"border-inline\",\"border-block-start\",\"border-block-end\",\"border-inline-start\",\"border-inline-end\",\"border-width\",\"border-style\",\"border-color\",\"border-top-width\",\"border-right-width\",\"border-bottom-width\",\"border-left-width\",\"border-top-style\",\"border-right-style\",\"border-bottom-style\",\"border-left-style\",\"border-top-color\",\"border-right-color\",\"border-bottom-color\",\"border-left-color\",\"border-radius\",\"border-top-left-radius\",\"border-top-right-radius\",\"border-bottom-right-radius\",\"border-bottom-left-radius\",\"border-start-start-radius\",\"border-start-end-radius\",\"border-end-start-radius\",\"border-end-end-radius\",\"border-collapse\",\"border-spacing\",\"outline\",\"outline-width\",\"outline-style\",\"outline-color\",\"outline-offset\",\"box-shadow\",\"opacity\",\"visibility\",\"mix-blend-mode\",\"filter\",\"backdrop-filter\",\"clip-path\",\"accent-color\",\"caret-color\",\"color-scheme\",\"appearance\",\"-webkit-appearance\",\"font\",\"font-family\",\"font-size\",\"font-weight\",\"font-style\",\"font-stretch\",\"font-variant\",\"font-variant-numeric\",\"font-variant-caps\",\"font-variant-ligatures\",\"font-feature-settings\",\"font-variation-settings\",\"font-kerning\",\"font-optical-sizing\",\"font-size-adjust\",\"font-synthesis\",\"line-height\",\"letter-spacing\",\"word-spacing\",\"text-align\",\"text-align-last\",\"text-indent\",\"text-transform\",\"text-decoration\",\"text-decoration-line\",\"text-decoration-color\",\"text-decoration-style\",\"text-decoration-thickness\",\"text-underline-offset\",\"text-underline-position\",\"text-shadow\",\"text-overflow\",\"text-wrap\",\"text-wrap-mode\",\"text-wrap-style\",\"white-space\",\"white-space-collapse\",\"word-break\",\"line-break\",\"hyphens\",\"tab-size\",\"direction\",\"unicode-bidi\",\"writing-mode\",\"text-orientation\",\"text-rendering\",\"-webkit-font-smoothing\",\"-webkit-line-clamp\",\"-webkit-box-orient\",\"line-clamp\",\"-webkit-text-fill-color\",\"-webkit-background-clip\",\"list-style\",\"list-style-type\",\"list-style-position\",\"content\",\"quotes\",\"counter-reset\",\"counter-increment\",\"counter-set\",\"table-layout\",\"caption-side\",\"empty-cells\",\"transform\",\"transform-origin\",\"transform-box\",\"transform-style\",\"translate\",\"rotate\",\"scale\",\"perspective\",\"perspective-origin\",\"backface-visibility\",\"transition\",\"transition-property\",\"transition-duration\",\"transition-timing-function\",\"transition-delay\",\"transition-behavior\",\"animation\",\"animation-name\",\"animation-duration\",\"animation-timing-function\",\"animation-delay\",\"animation-iteration-count\",\"animation-direction\",\"animation-fill-mode\",\"animation-play-state\",\"animation-composition\",\"will-change\",\"cursor\",\"pointer-events\",\"user-select\",\"-webkit-user-select\",\"touch-action\",\"resize\",\"scroll-behavior\",\"overscroll-behavior\",\"overscroll-behavior-x\",\"overscroll-behavior-y\",\"scroll-snap-type\",\"scroll-snap-align\",\"scroll-snap-stop\",\"scroll-margin\",\"scroll-padding\",\"scrollbar-width\",\"scrollbar-color\",\"scrollbar-gutter\",\"fill\",\"fill-opacity\",\"fill-rule\",\"stroke\",\"stroke-width\",\"stroke-linecap\",\"stroke-linejoin\",\"stroke-dasharray\",\"stroke-dashoffset\",\"stroke-opacity\",\"stroke-miterlimit\",\"stop-color\",\"stop-opacity\",\"clip-rule\",\"marker\",\"marker-start\",\"marker-mid\",\"marker-end\",\"paint-order\",\"vector-effect\",\"shape-rendering\",\"text-anchor\",\"dominant-baseline\",\"alignment-baseline\",\"r\",\"cx\",\"cy\",\"rx\",\"ry\",\"x\",\"y\",\"d\",\"mask\"],Ao=[\"var\",\"env\",\"calc\",\"min\",\"max\",\"clamp\",\"round\",\"mod\",\"rem\",\"abs\",\"sign\",\"sin\",\"cos\",\"tan\",\"asin\",\"acos\",\"atan\",\"atan2\",\"pow\",\"sqrt\",\"hypot\",\"log\",\"exp\",\"rgb\",\"rgba\",\"hsl\",\"hsla\",\"hwb\",\"lab\",\"lch\",\"oklab\",\"oklch\",\"color\",\"color-mix\",\"light-dark\",\"linear-gradient\",\"radial-gradient\",\"conic-gradient\",\"repeating-linear-gradient\",\"repeating-radial-gradient\",\"repeating-conic-gradient\",\"translate\",\"translatex\",\"translatey\",\"translatez\",\"translate3d\",\"rotate\",\"rotatex\",\"rotatey\",\"rotatez\",\"rotate3d\",\"scale\",\"scalex\",\"scaley\",\"scalez\",\"scale3d\",\"skew\",\"skewx\",\"skewy\",\"matrix\",\"matrix3d\",\"perspective\",\"cubic-bezier\",\"steps\",\"linear\",\"repeat\",\"minmax\",\"fit-content\",\"blur\",\"brightness\",\"contrast\",\"drop-shadow\",\"grayscale\",\"hue-rotate\",\"invert\",\"saturate\",\"sepia\",\"opacity\",\"circle\",\"ellipse\",\"inset\",\"polygon\",\"path\",\"xywh\",\"rect\",\"counter\",\"counters\"],Co=[\"fill\",\"stroke\",\"clip-path\",\"mask\",\"marker\",\"marker-start\",\"marker-mid\",\"marker-end\"],ko=[\"media\",\"supports\",\"container\",\"keyframes\"],_o={position:[\"static\",\"relative\",\"absolute\"],appearance:[\"auto\",\"none\",\"menulist-button\",\"textfield\"],\"-webkit-appearance\":[\"auto\",\"none\",\"menulist-button\",\"textfield\"]},Po=[\"host\",\"host-context\",\"slotted\",\"part\",\"backdrop\",\"picker\",\"view-transition\",\"view-transition-group\",\"view-transition-image-pair\",\"view-transition-old\",\"view-transition-new\"],ur=64e3,dr=4e3,Io=1e5,Do=512e3,fr=1e4,Mo=\"http://www.w3.org/1999/xhtml\",Lo=\"http://www.w3.org/2000/svg\",ri=new Map(Object.keys(Tn).map(t=>[t.toLowerCase(),t]));function wn(t){return ri.get(t.toLowerCase())}function Sn(t,e,n){let r=n.toLowerCase(),o=t===\"html\"?[Qe[e]?.attributes,Js]:[Tn[e]?.attributes,ei],s=t===\"svg\"&&r===\"xlink:href\"?\"href\":r;for(let i of o)if(i){for(let[l,u]of Object.entries(i))if(l.toLowerCase()===s)return{name:l,kind:u}}if(ti(r)||ni(r))return{name:r,kind:\"text\"}}var Ho=\"~\",On=t=>typeof t==\"object\"&&t!==null&&!Array.isArray(t),ae=(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=>ae(n,e+1)):Object.fromEntries(Object.entries(t).map(([n,r])=>[n,ae(r,e+1)]))};function Vo(){let t=new Map,e=new Map,n=new Map([[Ho,{children:[],listeners:new Map}]]),r=0,o=d=>{let p=e.get(d);return p===void 0&&(p=r+=1,e.set(d,p),t.set(p,{listener:d,count:0})),t.get(p).count+=1,p},s=d=>{let p=t.get(d);p&&(p.count-=1,!(p.count>0)&&(t.delete(d),e.delete(p.listener)))},i=d=>{let p=n.get(d);if(p){n.delete(d);for(let E of p.listeners.values())s(E);for(let E of p.children)i(E)}},l=(d,p,E=0)=>{if(!On(d)||E>64)return ae(d);let f=typeof d.id==\"string\"?d.id:void 0,b=p&&f!==void 0&&f!==Ho;b&&i(f);let N={children:[],listeners:new Map};b&&n.set(f,N);let O={};for(let[y,c]of Object.entries(d))y===\"children\"&&Array.isArray(c)?O[y]=c.map(h=>{let g=l(h,b,E+1);return b&&On(h)&&typeof h.id==\"string\"&&N.children.push(h.id),g}):y===\"eventListeners\"&&On(c)?O[y]=Object.fromEntries(Object.entries(c).map(([h,g])=>{if(typeof g!=\"function\"||!b)return[h,void 0];let a=o(g);return N.listeners.set(h,a),[h,{listener:a}]})):O[y]=ae(c,E+1);return O},u=d=>{if(!Array.isArray(d))return ae(d);let[p,E]=d,f=typeof E==\"string\"?n.get(E):void 0;if(p===0){let b=l(d[2],f!==void 0),N=On(d[2])?d[2].id:void 0;if(f&&typeof N==\"string\"&&n.has(N)){let O=Number(d[3]);f.children.splice(Number.isInteger(O)&&O>=0&&O<=f.children.length?O:f.children.length,0,N)}return[p,ae(E),b,ae(d[3])]}if(p===1){let b=Number(d[2]);return f&&Number.isInteger(b)&&b>=0&&b<f.children.length&&i(f.children.splice(b,1)[0]),ae(d)}if(p===3&&d[4]===3){let b=String(d[2]),N=d[3],O=f&&typeof N==\"function\"?o(N):void 0,y=f?.listeners.get(b);return y!==void 0&&s(y),O===void 0?f?.listeners.delete(b):f.listeners.set(b,O),[p,ae(E),b,O===void 0?void 0:{listener:O},3]}return ae(d)};return{encode:d=>d.map(u),listener:d=>t.get(d)?.listener,get listening(){return t.size},get nodes(){return n.size-1}}}var mr=\"graview-view-root\",oi=t=>t.replace(/&/g,\"&amp;\").replace(/</g,\"&lt;\").replace(/>/g,\"&gt;\").replace(/\"/g,\"&quot;\").replace(/'/g,\"&#39;\"),si=t=>Object.freeze({html:t,toString:()=>t}),Uo=t=>typeof t==\"object\"&&t!==null&&typeof t.html==\"string\"&&Object.isFrozen(t),jo=t=>t==null||t===!1?\"\":Array.isArray(t)?t.map(jo).join(\"\"):Uo(t)?t.html:oi(String(t));function zo(t){customElements.get(mr)||customElements.define(mr,wt);let e=Event,n=Vo(),r=new Set,o=new Set,s,i=[],l=document.createElement(mr),u=a=>{let m=T=>{for(let x of Array.from(T.childNodes)){if(x.nodeType!==1)continue;if(re(x)===a)return x;let v=m(x);if(v)return v}};return m(l)},d=a=>{let m=u(a.target);if(!m)return;let T=new e(a.event,{bubbles:!0});for(let x of[\"value\",\"checked\",\"key\",\"pressed\"])a[x]!==void 0&&Object.defineProperty(T,x,{value:a[x],enumerable:!0});m.dispatchEvent(T);for(let x of o){if(x.type!==a.event)continue;let v;try{v=new Set(Array.from(l.querySelectorAll(x.selector)))}catch{continue}for(let R=m;R&&R!==l;R=R.parentNode)if(v.has(R)){x.listener(Object.freeze({type:a.event,target:m,element:R,...a.value!==void 0?{value:a.value}:{},...a.checked!==void 0?{checked:a.checked}:{},...a.key!==void 0?{key:a.key}:{},...a.pressed!==void 0?{pressed:a.pressed}:{}}));break}}},p=a=>{if(a.type===\"dom-event\"&&typeof a.target==\"string\")return d(a);if(a.type!==\"props\")return;s=a.props;let m=t.now();for(let v of r)try{v(a.props)}catch(R){t.threw(R)}let T=t.now()-m,x=a.push;typeof x==\"number\"&&t.microtask(()=>t.microtask(()=>t.send({type:\"pushed\",push:x,ms:T})))},E;l.connect({mutate(a){E||(E=[],t.microtask(()=>{let m=E??[];E=void 0,t.send({type:\"render\",records:n.encode(m)})})),E.push(...a)},call:()=>{}});let f=a=>a.nodeType===1?a.getAttribute(\"data-key\")??a.getAttribute(\"id\"):null,b=(a,m)=>a.nodeType===m.nodeType&&(a.nodeType!==1||a.localName===m.localName&&a.namespaceURI===m.namespaceURI&&f(a)===f(m));function N(a,m){let T=Array.from(m.childNodes),x=0;for(let v of T){let R=a.childNodes[x]??null;if(R&&b(R,v)){O(R,v),x+=1;continue}if(f(v)!==null){let pe=Array.from(a.childNodes).slice(x+1).find(it=>b(it,v));if(pe){a.insertBefore(pe,R),O(pe,v),x+=1;continue}}a.insertBefore(v,R),x+=1}for(;a.childNodes.length>x;)a.removeChild(a.lastChild)}function O(a,m){if(a.nodeType!==1){a.data!==m.data&&(a.data=m.data);return}let T=a,x=m;for(let v of T.getAttributeNames())x.hasAttribute(v)||T.removeAttribute(v);for(let v of x.getAttributeNames()){let R=x.getAttribute(v);T.getAttribute(v)!==R&&T.setAttribute(v,R)}N(T,x)}function y(a,m,T){for(let x of Array.from(a.childNodes)){if(x.nodeType!==1)continue;let v=x,R=v.localName,st=m||R.toLowerCase()===\"svg\",pe=st?wn(R):Object.prototype.hasOwnProperty.call(Qe,R.toLowerCase())?R.toLowerCase():void 0;if(!pe){T.add(`<${R}>`);continue}for(let it of v.getAttributeNames())(!Sn(st?\"svg\":\"html\",pe,it)||!st&&xn[pe]?.includes(it.toLowerCase()))&&T.add(`${pe} ${it}`);y(v,st,T)}}function c(a){let m=document.createElement(\"div\"),T=Array.isArray(a)?a:[a];for(let v of T)if(v!=null)if(typeof v==\"string\"||Uo(v)){let R=document.createElement(\"div\");R.innerHTML=typeof v==\"string\"?v:v.html,m.append(...Array.from(R.childNodes))}else m.append(v);let x=new Set;y(m,!1,x),i=[...x],i.length>0&&t.warn(`The host will not draw: ${i.join(\", \")}`),N(l,m)}let h;return{view:Object.freeze({get props(){return s},onProps(a){return r.add(a),s&&a(s),()=>void r.delete(a)},render:c,style(a){typeof a!=\"string\"||a===h||(h=a,t.send({type:\"style\",css:a}))},on(a,m,T){let x={type:a,selector:m,listener:T};return o.add(x),()=>void o.delete(x)},act:(a,m={})=>t.act(a,m),navigate(a){typeof a==\"string\"?t.navigate(a):a&&typeof a.place==\"string\"&&t.send({type:\"navigate\",place:a.place})},html(a,...m){return si(a.reduce((T,x,v)=>T+x+(v<m.length?jo(m[v]):\"\"),\"\"))},get refused(){return i},get hardening(){return t.hardening()}}),hear:p}}var ii=\"http://www.w3.org/1999/xhtml\",et=class{constructor(e){this.ownerDocument=e}parentNode=null;childNodes=[];get firstChild(){return this.childNodes[0]??null}get parentElement(){return this.parentNode instanceof _e?this.parentNode:null}get textContent(){return this.childNodes.map(e=>e.textContent).join(\"\")}insertBefore(e,n){e.parentNode&&e.parentNode.removeChild(e);let r=n?this.childNodes.indexOf(n):-1;return r<0?this.childNodes.push(e):this.childNodes.splice(r,0,e),e.parentNode=this,e}appendChild(e){return this.insertBefore(e,null)}removeChild(e){let n=this.childNodes.indexOf(e);return n>=0&&this.childNodes.splice(n,1),e.parentNode=null,e}},ke=class extends et{constructor(n,r){super(n);this.data=r}nodeType=3;get textContent(){return this.data}},pr=class extends et{nodeType=8;get textContent(){return\"\"}},_e=class extends et{constructor(n,r,o){super(n);this.namespaceURI=r;this.localName=o}nodeType=1;attributes=new Map;value=\"\";checked=!1;selected=!1;setAttribute(n,r){this.attributes.set(n,String(r))}removeAttribute(n){this.attributes.delete(n)}getAttribute(n){return this.attributes.get(n)??null}hasAttribute(n){return this.attributes.has(n)}closest(n){for(let r=this;r;r=r.parentElement)if(r.localName===n)return r;return null}},hr=class extends et{nodeType=9;constructor(){super(null)}createElementNS(e,n){return new _e(this,e,n)}createElement(e){return new _e(this,ii,e)}createTextNode(e){return new ke(this,e)}createComment(e){return new pr(this)}};function $o(){let t=new hr,e=t.createElement(\"div\");return e.setAttribute(\"data-graview-view-root\",\"\"),t.appendChild(e),{document:t,root:e}}var gr={h1:1,h2:2,h3:3,h4:4,h5:5,h6:6},Fo=new Set([\"a\",\"abbr\",\"b\",\"bdi\",\"bdo\",\"br\",\"cite\",\"code\",\"data\",\"del\",\"dfn\",\"em\",\"i\",\"ins\",\"kbd\",\"q\",\"s\",\"samp\",\"small\",\"span\",\"strong\",\"sub\",\"sup\",\"time\",\"u\",\"var\",\"wbr\",\"label\"]),Bo=new Set([\"style\",\"template\",\"datalist\",\"option\"]),L=t=>t.replace(/\\s+/g,\" \").trim(),K=t=>t instanceof _e,Ot=t=>t.hasAttribute(\"hidden\")||t.getAttribute(\"aria-hidden\")===\"true\";function $(t){return t instanceof ke?t.data:!K(t)||Ot(t)||Bo.has(t.localName)?\"\":t.localName===\"br\"?\" \":t.localName===\"img\"?t.getAttribute(\"alt\")??\"\":t.childNodes.map($).join(t.localName===\"td\"||t.localName===\"th\"?\" \":\"\")}function*Pe(t){for(let e of t.childNodes)K(e)&&(yield e,yield*Pe(e))}function Go(t,e){let n=[],r=new Set,o=new Set,s=new Map;for(let f of[...e.props.node?[e.props.node]:[],...e.props.nodes??[]])s.set(f.id,f);let i=new Set(e.places);for(let f of Pe(t)){let b=f.getAttribute(\"data-act\");b!==null&&r.add(b);let N=f.getAttribute(\"data-record\");N!==null&&(o.add(N),s.has(N)||n.push({at:`drawing <${f.localName} data-record=\"${N}\">`,says:`It names \"${N}\", which this seat was not shown: the host will not follow it.`}));let O=f.getAttribute(\"data-place\");O!==null&&!i.has(O)&&n.push({at:`drawing <${f.localName} data-place=\"${O}\">`,says:`It names the place \"${O}\", which this app does not have.`})}let l=f=>{let b=f.getAttribute(\"data-record\");if(b!==null)return b;let N=f.getAttribute(\"data-key\")??f.getAttribute(\"id\");if(N!==null&&s.has(N))return N;let O=new Set;for(let y of Pe(f)){let c=y.getAttribute(\"data-record\");c!==null&&O.add(c)}return O.size===1?[...O][0]:void 0},u=(f,b)=>{let N=s.get(b),O=N?.kind??(b.includes(\":\")?b.slice(0,b.indexOf(\":\")):\"\"),y=[...Pe(f)],c=y.find(a=>a.localName in gr)??y.find(a=>a.localName===\"a\"&&a.getAttribute(\"data-record\")===b)??y.find(a=>a.localName===\"strong\"||a.localName===\"b\"),h=L(c?$(c):\"\")||N?.label||b,g=p(f,c);return!c&&g[0]?.t===\"text\"&&L(g[0].text)===h&&g.shift(),{id:b,kind:O,title:h,parts:g}},d=f=>{let b=[...Pe(f)].filter(c=>c.localName===\"tr\"&&!Ot(c)),N=b.find(c=>c.parentElement?.localName===\"thead\"||c.childNodes.every(h=>!K(h)||h.localName===\"th\")),O=N?N.childNodes.filter(K).map(c=>L($(c))):[];return{t:\"list\",as:\"row\",columns:1,groups:[{items:b.filter(c=>c!==N).map(c=>{let h=c.childNodes.filter(K),g=l(c),a=g?s.get(g):void 0;return{id:g??\"\",kind:a?.kind??\"\",title:L($(h[0]??c)),parts:h.slice(1).map((m,T)=>({t:\"field\",label:O[T+1]??\"\",text:L($(m))}))}})}]}};function p(f,b){let N=[],O=\"\",y=()=>{let h=L(O);O=\"\",h&&N.push({t:\"text\",text:h})},c=f.childNodes;for(let h=0;h<c.length;h+=1){let g=c[h];if(g===b)continue;if(g instanceof ke){O+=g.data;continue}if(!K(g)||Ot(g)||Bo.has(g.localName))continue;if(b&&[...Pe(g)].includes(b)){y(),N.push(...p(g,b));continue}let a=[];for(let m=h;m<c.length;m+=1){let T=c[m];if(T instanceof ke&&L(T.data)===\"\")continue;if(!K(T)||Ot(T)||Fo.has(T.localName)||T.localName in gr)break;let x=l(T);if(!x)break;a.push({element:T,id:x}),h=m}if(a.length>0){y();let m=a.every(T=>T.element.localName===\"li\"||T.element.localName===\"tr\");N.push({t:\"list\",as:m?\"row\":\"card\",columns:1,groups:[{items:a.map(T=>u(T.element,T.id))}]});continue}N.push(...E(g,m=>O+=m,y))}return y(),N}function E(f,b,N){let O=f.localName;if(Fo.has(O)&&O!==\"label\")return b($(f)),[];if(O===\"mark\"){N();let c=L($(f));return c?[{t:\"badge\",text:c}]:[]}N();let y=gr[O]??(f.getAttribute(\"role\")===\"heading\"?Number(f.getAttribute(\"aria-level\")??2):void 0);if(y!==void 0){let c=L($(f));return c?[{t:\"heading\",level:y,text:c}]:[]}switch(O){case\"ul\":case\"ol\":case\"menu\":return[{t:\"list\",as:\"row\",columns:1,groups:[{items:f.childNodes.filter(h=>K(h)&&h.localName===\"li\"&&!Ot(h)).map(h=>{let g=l(h);if(g)return u(h,g);let a=p(h),m=a[0],T=m&&(m.t===\"text\"||m.t===\"heading\")?m.text:\"\";return{id:\"\",kind:\"\",title:T,parts:T?a.slice(1):a}})}]}];case\"table\":return[d(f)];case\"dl\":{let c=[],h=\"\";for(let g of f.childNodes.filter(K))if(g.localName===\"dt\")h=L($(g));else if(g.localName===\"dd\")c.push({t:\"field\",label:h,text:L($(g))});else if(g.localName===\"div\")for(let a of g.childNodes.filter(K))a.localName===\"dt\"?h=L($(a)):a.localName===\"dd\"&&c.push({t:\"field\",label:h,text:L($(a))});return c}case\"figure\":{let c=f.childNodes.find(a=>K(a)&&a.localName===\"figcaption\"),h=L(f.childNodes.filter(a=>a!==c).map($).join(\" \")),g=c?L($(c)):\"\";return h?[{t:\"figure\",text:h,...g?{label:g}:{}}]:g?[{t:\"text\",text:g}]:[]}case\"meter\":case\"progress\":{let c=Number(f.getAttribute(\"value\")??0),h=Number(f.getAttribute(\"max\")??1)||1;return[{t:\"progress\",label:f.getAttribute(\"aria-label\")??f.getAttribute(\"title\")??\"\",text:`${Math.round(c/h*100)}%`}]}case\"svg\":{let c=f.childNodes.find(a=>K(a)&&a.localName===\"title\"),h=L(f.getAttribute(\"aria-label\")??(c?$(c):\"\"));if(h)return[{t:\"text\",text:h,tone:\"picture\"}];let g=[...Pe(f)].filter(a=>a.localName===\"text\").map(a=>L($(a))).filter(Boolean);return g.length>0?[{t:\"text\",text:g.join(\" \\xB7 \"),tone:\"picture\"}]:[]}case\"img\":{let c=L(f.getAttribute(\"alt\")??\"\");return c?[{t:\"text\",text:c,tone:\"picture\"}]:[]}case\"button\":{let c=L($(f));return c?[{t:\"text\",text:c,tone:\"button\"}]:[]}case\"input\":case\"textarea\":case\"select\":{let c=L(f.getAttribute(\"aria-label\")??f.getAttribute(\"placeholder\")??f.getAttribute(\"name\")??\"\"),h=O===\"select\"?L($(f.childNodes.find(g=>K(g)&&g.localName===\"option\"&&g.selected)??f)):f.value;return[{t:\"field\",label:c,text:h}]}case\"label\":return p(f);default:return p(f)}}return{parts:p(t),problems:n,acts:[...r],records:[...o]}}var F=t=>t>=48&&t<=57,Yo=t=>F(t)||t>=65&&t<=70||t>=97&&t<=102,xr=t=>t>=65&&t<=90||t>=97&&t<=122,wr=t=>t>=128,vn=t=>xr(t)||wr(t)||t===95,qo=t=>vn(t)||F(t)||t===45,Wo=t=>t===10,fe=t=>t===10||t===9||t===32,ai=t=>t>=0&&t<=8||t===11||t>=14&&t<=31||t===127,oe=-1;function li(t){let e=[];for(let n=0;n<t.length;n+=1){let r=t.codePointAt(n);r>65535&&(n+=1),r===13?(t.charCodeAt(n+1)===10&&(n+=1),r=10):r===12?r=10:(r===0||r>=55296&&r<=57343)&&(r=65533),e.push(r)}return e}function ci(t){let e=li(t),n=0,r=(y=0)=>n+y<e.length?e[n+y]:oe,o=[],s=(y,c)=>y===92&&c!==10&&c!==oe,i=(y,c,h)=>y===45?vn(c)||c===45||s(c,h):vn(y)?!0:s(y,c),l=(y,c,h)=>y===43||y===45?F(c)||c===46&&F(h):F(y===46?c:y),u=()=>{let y=r();if(n+=1,y===oe)return 65533;if(Yo(y)){let c=String.fromCodePoint(y);for(;c.length<6&&Yo(r());)c+=String.fromCodePoint(r()),n+=1;fe(r())&&(n+=1);let h=parseInt(c,16);return h===0||h>=55296&&h<=57343||h>1114111?65533:h}return y},d=()=>{let y=\"\";for(;;){let c=r();if(qo(c))y+=String.fromCodePoint(c),n+=1;else if(s(c,r(1)))n+=1,y+=String.fromCodePoint(u());else return y}},p=()=>{let y=\"\";for((r()===43||r()===45)&&(y+=String.fromCodePoint(e[n++]));F(r());)y+=String.fromCodePoint(e[n++]);if(r()===46&&F(r(1)))for(y+=String.fromCodePoint(e[n++],e[n++]);F(r());)y+=String.fromCodePoint(e[n++]);if((r()===69||r()===101)&&(F(r(1))||(r(1)===43||r(1)===45)&&F(r(2))))for(y+=String.fromCodePoint(e[n++]),F(r())||(y+=String.fromCodePoint(e[n++]));F(r());)y+=String.fromCodePoint(e[n++]);return y},E=()=>{let y=p();return i(r(),r(1),r(2))?{type:\"dimension\",repr:y,unit:d()}:r()===37?(n+=1,{type:\"percentage\",repr:y}):{type:\"number\",repr:y}},f=()=>{for(;;){let y=r();if(n+=1,y===41||y===oe)return;s(y,r())&&u()}},b=()=>{let y=\"\";for(;fe(r());)n+=1;for(;;){let c=r();if(n+=1,c===41)return{type:\"url\",value:y};if(c===oe)return{type:\"url\",value:y};if(fe(c)){for(;fe(r());)n+=1;return r()===41||r()===oe?(r()===41&&(n+=1),{type:\"url\",value:y}):(f(),{type:\"bad-url\"})}if(c===34||c===39||c===40||ai(c))return f(),{type:\"bad-url\"};if(c===92){if(s(c,r()))y+=String.fromCodePoint(u());else return f(),{type:\"bad-url\"};continue}y+=String.fromCodePoint(c)}},N=()=>{let y=d();if(y.toLowerCase()===\"url\"&&r()===40){for(n+=1;fe(r())&&fe(r(1));)n+=1;let c=fe(r())?r(1):r();return c===34||c===39?{type:\"function\",value:y}:b()}return r()===40?(n+=1,{type:\"function\",value:y}):{type:\"ident\",value:y}},O=y=>{let c=\"\";for(;;){let h=r();if(n+=1,h===y||h===oe)return{type:\"string\",value:c};if(Wo(h))return n-=1,{type:\"bad-string\"};if(h===92){if(r()===oe)continue;if(Wo(r())){n+=1;continue}c+=String.fromCodePoint(u());continue}c+=String.fromCodePoint(h)}};for(;;){for(;r()===47&&r(1)===42;){for(n+=2;r()!==oe&&!(r()===42&&r(1)===47);)n+=1;r()!==oe&&(n+=2)}let y=r();if(y===oe)return o;if(fe(y)){for(;fe(r());)n+=1;o.push({type:\"whitespace\"});continue}switch(n+=1,y){case 34:case 39:o.push(O(y));continue;case 35:if(qo(r())||s(r(),r(1))){let c=i(r(),r(1),r(2));o.push({type:\"hash\",value:d(),id:c})}else o.push({type:\"delim\",value:\"#\"});continue;case 40:o.push({type:\"(\"});continue;case 41:o.push({type:\")\"});continue;case 43:case 46:l(y,r(),r(1))?(n-=1,o.push(E())):o.push({type:\"delim\",value:String.fromCodePoint(y)});continue;case 44:o.push({type:\",\"});continue;case 45:l(y,r(),r(1))?(n-=1,o.push(E())):r()===45&&r(1)===62?(n+=2,o.push({type:\"CDC\"})):i(y,r(),r(1))?(n-=1,o.push(N())):o.push({type:\"delim\",value:\"-\"});continue;case 58:o.push({type:\":\"});continue;case 59:o.push({type:\";\"});continue;case 60:r()===33&&r(1)===45&&r(2)===45?(n+=3,o.push({type:\"CDO\"})):o.push({type:\"delim\",value:\"<\"});continue;case 64:i(r(),r(1),r(2))?o.push({type:\"at-keyword\",value:d()}):o.push({type:\"delim\",value:\"@\"});continue;case 91:o.push({type:\"[\"});continue;case 92:s(y,r())?(n-=1,o.push(N())):o.push({type:\"delim\",value:\"\\\\\"});continue;case 93:o.push({type:\"]\"});continue;case 123:o.push({type:\"{\"});continue;case 125:o.push({type:\"}\"});continue;default:F(y)?(n-=1,o.push(E())):vn(y)?(n-=1,o.push(N())):o.push({type:\"delim\",value:String.fromCodePoint(y)})}}}var Qo={\"{\":\"}\",\"[\":\"]\",\"(\":\")\"},es=32,br=class{constructor(e){this.tokens=e}i=0;peek(){return this.tokens[this.i]}next(){return this.tokens[this.i++]}};function ts(t,e){let n=t.next();return n.type===\"{\"||n.type===\"[\"||n.type===\"(\"?{type:\"block\",open:n.type,value:Xo(t,Qo[n.type],e+1)}:n.type===\"function\"?{type:\"func\",name:n.value,value:Xo(t,\")\",e+1)}:n}function Xo(t,e,n){let r=[];for(;;){let o=t.peek();if(!o)return r;if(o.type===e)return t.next(),r;if(n>es){t.next(),r.push({type:\"bad-string\"});continue}r.push(ts(t,n))}}function tt(t,e){let n=[],r=0;for(;r<t.length;){let o=t[r];if(o.type===\"whitespace\"||e&&(o.type===\"CDO\"||o.type===\"CDC\")){r+=1;continue}if(o.type===\"at-keyword\"){let l=[];r+=1;let u;for(;r<t.length;){let d=t[r];if(r+=1,d.type===\";\")break;if(d.type===\"block\"&&d.open===\"{\"){u=d.value;break}l.push(d)}n.push({type:\"at-rule\",name:o.value,prelude:l,...u?{block:u}:{}});continue}let s=[],i;for(;r<t.length;){let l=t[r];if(r+=1,l.type===\"block\"&&l.open===\"{\"){i=l.value;break}s.push(l)}i&&n.push({type:\"qualified\",prelude:s,block:i})}return n}function Sr(t){let e=[],n=0;for(;n<t.length;){let r=t[n];if(r.type===\"whitespace\"||r.type===\";\"){n+=1;continue}if(r.type===\"at-keyword\"){let s=(()=>{for(let i=n+1;i<t.length;i+=1){let l=t[i];if(l.type===\";\"||l.type===\"block\"&&l.open===\"{\")return i+1}return t.length})();e.push(...tt(t.slice(n,s),!1)),n=s;continue}if(r.type===\"ident\"){let s=n+1;for(;t[s]?.type===\"whitespace\";)s+=1;if(t[s]?.type===\":\"){let i=s+1;for(;i<t.length&&t[i].type!==\";\";)i+=1;let l=ns(r.value,t.slice(s+1,i));if(l.value.some(u=>u.type===\"block\"&&u.open===\"{\")){let u=t.findIndex((d,p)=>p>n&&d.type===\"block\"&&d.open===\"{\");e.push(...tt(t.slice(n,u+1),!1)),n=u+1;continue}e.push(l),n=i+1;continue}}let o=n;for(;o<t.length&&!(t[o].type===\"block\"&&t[o].open===\"{\")&&t[o].type!==\";\";)o+=1;o<t.length&&t[o].type===\"block\"&&e.push(...tt(t.slice(n,o+1),!1)),n=o+1}return e}function ns(t,e){let n=[...e];for(;n[0]?.type===\"whitespace\";)n.shift();for(;n.at(-1)?.type===\"whitespace\";)n.pop();let r=!1,s=n.length-1;if(n[s]?.type===\"ident\"&&n[s].value.toLowerCase()===\"important\"){for(s-=1;n[s]?.type===\"whitespace\";)s-=1;let i=n[s];if(i?.type===\"delim\"&&i.value===\"!\")for(r=!0,n.length=s;n.at(-1)?.type===\"whitespace\";)n.pop()}return{type:\"declaration\",name:t,value:n,important:r}}function Or(t){let e=new br(ci(t)),n=[];for(;e.peek();)n.push(ts(e,0));return n}function Rn(t){let e=\"\",n=[...t].map(r=>r.codePointAt(0));return n.forEach((r,o)=>{r===0?e+=\"\\uFFFD\":r>=1&&r<=31||r===127||o===0&&F(r)||o===1&&F(r)&&n[0]===45?e+=`\\\\${r.toString(16)} `:o===0&&r===45&&n.length===1?e+=\"\\\\-\":wr(r)||r===45||r===95||F(r)||xr(r)?e+=String.fromCodePoint(r):e+=`\\\\${String.fromCodePoint(r)}`}),e}function An(t){let e=\"\";for(let n of t){let r=n.codePointAt(0);wr(r)||r===45||r===95||F(r)||xr(r)?e+=n:r>=1&&r<=31||r===127?e+=`\\\\${r.toString(16)} `:e+=`\\\\${n}`}return e}function Er(t){let e='\"';for(let n of t){let r=n.codePointAt(0);r===0?e+=\"\\uFFFD\":r>=1&&r<=31||r===127||r===60||r===62?e+=`\\\\${r.toString(16)} `:r===34||r===92?e+=`\\\\${n}`:e+=n}return`${e}\"`}function ui(t){let e=An(t);return/^[eE]([0-9]|[+-][0-9])/.test(t)?`\\\\${t.codePointAt(0).toString(16)} ${An(t.slice(1))}`:e}var Ko=t=>{switch(t.type){case\"ident\":case\"url\":case\"bad-url\":case\"number\":case\"percentage\":case\"dimension\":case\"CDC\":case\"hash\":case\"at-keyword\":return t.type;case\"func\":case\"function\":return\"function\";case\"block\":return t.open===\"(\"?\"(\":\"other\";case\"(\":return\"(\";case\"delim\":return`delim${t.value}`;default:return\"other\"}};function di(t,e){let n=[\"ident\",\"function\",\"url\",\"bad-url\",\"delim-\",\"number\",\"percentage\",\"dimension\",\"CDC\"];return t===\"ident\"?[...n,\"(\"].includes(e):t===\"at-keyword\"||t===\"hash\"||t===\"dimension\"||t===\"delim#\"||t===\"delim-\"?n.includes(e):t===\"number\"?[\"ident\",\"function\",\"url\",\"bad-url\",\"number\",\"percentage\",\"dimension\",\"delim%\"].includes(e):t===\"delim@\"?[\"ident\",\"function\",\"url\",\"bad-url\",\"delim-\",\"CDC\"].includes(e):t===\"delim.\"||t===\"delim+\"?[\"number\",\"percentage\",\"dimension\"].includes(e):t===\"delim/\"?e===\"delim*\":!1}function fi(t){switch(t.type){case\"whitespace\":return\" \";case\"ident\":return Rn(t.value);case\"at-keyword\":return`@${Rn(t.value)}`;case\"hash\":return`#${An(t.value)}`;case\"string\":return Er(t.value);case\"url\":return`url(${Er(t.value)})`;case\"delim\":return t.value===\"\\\\\"?`\\\\\n`:t.value;case\"CDO\":return\"<!--\";case\"CDC\":return\"-->\";case\"number\":return t.repr;case\"percentage\":return`${t.repr}%`;case\"dimension\":return`${t.repr}${ui(t.unit)}`;case\"func\":return`${Rn(t.name)}(${nt(t.value)})`;case\"block\":return`${t.open}${nt(t.value)}${Qo[t.open]}`;case\":\":case\";\":case\",\":case\"[\":case\"]\":case\"(\":case\")\":case\"{\":case\"}\":return t.type;default:return\"\"}}function nt(t){let e=\"\",n;for(let r of t)r.type===\"whitespace\"&&n?.type===\"whitespace\"||(n&&di(Ko(n),Ko(r))&&(e+=\"/**/\"),e+=fi(r),n=r);return e}var mi=new Set(Ro),rs=new Set(Ao),Zo=new Set(Co),pi=new Set(ko),hi=new Set(Po),Jo=/^#[A-Za-z_][A-Za-z0-9_.:-]*$/,me=t=>t.replace(/[A-Z]/g,e=>e.toLowerCase()),gi=t=>me(t);function Nr(t,e,n){let r=[];for(let o of e){if(o.type===\"bad-url\"||o.type===\"bad-string\"){n({reason:\"unreadable\",...t?{name:t}:{}});return}if(o.type===\"url\"){if(t&&Zo.has(t)&&Jo.test(o.value)){r.push({type:\"func\",name:\"url\",value:[{type:\"string\",value:o.value}]});continue}n({reason:\"url\",...t?{name:t}:{}});return}if(o.type===\"func\"){let s=me(o.name);if(s===\"url\"||s===\"src\"){let l=o.value.filter(d=>d.type!==\"whitespace\"),u=l[0];if(s===\"url\"&&l.length===1&&u?.type===\"string\"&&t&&Zo.has(t)&&Jo.test(u.value)){r.push({type:\"func\",name:\"url\",value:[{type:\"string\",value:u.value}]});continue}n({reason:\"url\",...t?{name:t}:{}});return}if(!rs.has(s)){n({reason:\"function\",name:s});return}let i=Nr(t,o.value,n);if(!i)return;s===\"var\"?r.push({type:\"whitespace\"},{type:\"func\",name:s,value:i},{type:\"whitespace\"}):r.push({type:\"func\",name:s,value:i});continue}if(o.type===\"block\"){if(o.open===\"{\"||o.open===\"(\"&&r.at(-1)?.type===\"ident\"){n({reason:\"unreadable\",...t?{name:t}:{}});return}let s=Nr(t,o.value,n);if(!s)return;r.push({type:\"block\",open:o.open,value:s});continue}if(o.type===\"at-keyword\"||o.type===\"CDO\"||o.type===\"CDC\"||o.type===\"{\"||o.type===\"}\"||o.type===\";\"||o.type===\"delim\"&&o.value===\"\\\\\"){n({reason:\"unreadable\",...t?{name:t}:{}});return}r.push(o)}return r}function kn(t,e){let n=t.name.startsWith(\"--\"),r=n?t.name:gi(t.name);if(!n&&!mi.has(r)){e({reason:\"property\",name:r});return}let o=_o[r];if(o){let l=t.value.filter(p=>p.type!==\"whitespace\"),u=l[0],d=l.length===1&&u?.type===\"ident\"?me(u.value):void 0;if(!d||![...o,\"inherit\",\"initial\",\"unset\",\"revert\"].includes(d)){e({reason:\"value\",name:r});return}return`${r}: ${d}${t.important?\" !important\":\"\"}`}let s=Nr(n?void 0:r,t.value,e);if(!s)return;let i=nt(s).trim();return`${n?`--${An(t.name.slice(2))}`:r}: ${i}${t.important?\" !important\":\"\"}`}function os(t,e){let n=r=>{for(let o=0;o<r.length;o+=1){let s=r[o];if(o>0&&r[o-1].type===\":\"&&(s.type===\"ident\"||s.type===\"func\")){let l=me(s.type===\"ident\"?s.value:s.name);if(hi.has(l)||l.startsWith(\"-webkit-\")||l.startsWith(\"-moz-\"))return e({reason:\"selector\",name:l}),!1}if(s.type===\"url\"||s.type===\"bad-url\"||s.type===\"bad-string\"||s.type===\"at-keyword\"||s.type===\"CDO\"||s.type===\"CDC\"||s.type===\"block\"&&s.open===\"{\")return e({reason:\"unreadable\",name:\"selector\"}),!1;if(s.type===\"func\"&&!n(s.value)||s.type===\"block\"&&!n(s.value))return!1}return!0};return n(t)}function yr(t,e,n){let r=[];for(let o of Sr(t))if(o.type===\"declaration\"){let s=kn(o,e);s&&r.push(`${s};`)}else{let s=Cn(o,e,n+1,\"style\");s&&r.push(s)}return r.join(\" \")}function yi(t,e,n){let r=o=>o.every(s=>{if(s.type===\"url\"||s.type===\"bad-url\"||s.type===\"bad-string\"||s.type===\"block\"&&s.open===\"{\")return n({reason:s.type===\"url\"?\"url\":\"unreadable\",name:`@${e}`}),!1;if(s.type===\"func\"){let i=me(s.name);return e===\"supports\"&&i===\"selector\"?os(s.value,n):rs.has(i)?r(s.value):(n({reason:\"function\",name:i}),!1)}if(s.type===\"block\"){if(e===\"supports\"){let i=Sr(s.value);if(i.length===1&&i[0].type===\"declaration\")return kn(i[0],n)!==void 0}return r(s.value)}return!0});return r(t)?nt(t).trim():void 0}function Tr(t){return t.map((e,n)=>{let r=t[n-1],o=r?.type===\":\"||r?.type===\"delim\"&&(r.value===\".\"||r.value===\"|\");return e.type===\"ident\"&&!o&&Object.prototype.hasOwnProperty.call(St,me(e.value))?{type:\"block\",open:\"[\",value:[{type:\"ident\",value:\"data-graview-as\"},{type:\"delim\",value:\"=\"},{type:\"string\",value:me(e.value)}]}:e.type===\"func\"?{type:\"func\",name:e.name,value:Tr(e.value)}:e.type===\"block\"&&e.open===\"(\"?{type:\"block\",open:\"(\",value:Tr(e.value)}:e})}function Cn(t,e,n,r){if(n>es){e({reason:\"unreadable\",name:\"nesting\"});return}if(t.type===\"qualified\"){if(r===\"keyframes\"){if(!t.prelude.every(p=>p.type===\"whitespace\"||p.type===\",\"||p.type===\"percentage\"||p.type===\"ident\"&&[\"from\",\"to\"].includes(me(p.value)))){e({reason:\"unreadable\",name:\"keyframe\"});return}return`${nt(t.prelude).trim()} { ${yr(t.block,e,n)} }`}if(!os(t.prelude,e))return;let u=nt(Tr(t.prelude)).trim();if(u===\"\"){e({reason:\"unreadable\",name:\"selector\"});return}return`${u} { ${yr(t.block,e,n)} }`}let o=me(t.name),s=o===\"-webkit-keyframes\"?\"keyframes\":o;if(!pi.has(s)||r===\"keyframes\"){e({reason:\"at-rule\",name:`@${o}`});return}if(!t.block){e({reason:\"unreadable\",name:`@${o}`});return}if(s===\"keyframes\"){if(r!==\"sheet\"){e({reason:\"at-rule\",name:\"@keyframes\"});return}let u=t.prelude.filter(f=>f.type!==\"whitespace\"),d=u[0];if(u.length!==1||!d||d.type!==\"ident\"&&d.type!==\"string\"){e({reason:\"unreadable\",name:\"@keyframes\"});return}let p=tt(t.block,!1).map(f=>Cn(f,e,n+1,\"keyframes\")).filter(f=>f!==void 0);return`@keyframes ${d.type===\"ident\"?Rn(d.value):Er(d.value)} { ${p.join(\" \")} }`}let i=yi(t.prelude,s,e);if(i===void 0)return;let l=r===\"style\"?yr(t.block,e,n):tt(t.block,!1).map(u=>Cn(u,e,n+1,\"sheet\")).filter(u=>u!==void 0).join(\" \");return`@${s} ${i} { ${l} }`}function ss(t,e=ur){let n=[];if(t.length>e)return{css:\"\",refused:[{reason:\"size\"}]};let r=s=>void n.push(s);return{css:tt(Or(t),!0).map(s=>Cn(s,r,0,\"sheet\")).filter(s=>s!==void 0).join(`\n`),refused:n}}function is(t,e=ur){let n=[];if(t.length>e)return{css:\"\",refused:[{reason:\"size\"}]};let r=s=>void n.push(s),o=[];for(let s of Sr(Or(t))){if(s.type!==\"declaration\"){r({reason:\"unreadable\",name:\"a rule in a style attribute\"});continue}let i=kn(s,r);i&&o.push(i)}return{css:o.join(\"; \"),refused:n}}function as(t,e){let n,r=kn(ns(t,Or(e)),o=>n??=o);return r===void 0||n?{refused:n??{reason:\"unreadable\",name:t}}:{value:r.slice(r.indexOf(\":\")+1).trim()}}function ls(t,e){if(e===\"svg\"){let r=wn(t);return r?{namespace:\"svg\",name:r}:{refused:{reason:\"element\",element:t}}}let n=t.toLowerCase();return n===\"svg\"?{namespace:\"svg\",name:\"svg\"}:Object.prototype.hasOwnProperty.call(Qe,n)?Object.prototype.hasOwnProperty.call(St,n)?{namespace:\"html\",name:St[n],as:n}:{namespace:\"html\",name:n}:{refused:{reason:\"element\",element:t}}}function vr(t,e){return(t===\"html\"?Qe[e]:Tn[e])?.empty===!0}var bi=/^[+-]?(\\d+\\.?\\d*|\\.\\d+)([eE][+-]?\\d+)?$/,Ei=/^[0-9A-Za-z\\s.,+\\-%()]*$/,Ni=/^#[A-Za-z_][A-Za-z0-9_.:-]*$/,Ti=/^data:image\\/(png|gif|jpeg|webp|avif|bmp|svg\\+xml)(;[A-Za-z0-9=._+-]+)*,/i;function Rr(t,e,n,r,o){let s=Sn(t,e,n);if(!s)return{refused:{reason:\"attribute\",element:e,name:n}};if(t===\"html\"&&xn[e]?.includes(s.name))return{refused:{reason:\"attribute\",element:e,name:n}};if(r===null)return{name:s.name,value:null};let i=xi(s.name,s.kind,r,o);return\"refused\"in i?{refused:{...i.refused,element:e}}:s.name===\"role\"&&i.value.split(/\\s+/).some(l=>vo.includes(l.toLowerCase()))?{refused:{reason:\"value\",element:e,name:n}}:s.name===\"aria-live\"&&![\"polite\",\"off\"].includes(i.value.toLowerCase())?{refused:{reason:\"value\",element:e,name:n}}:{name:s.name,value:i.value,...i.dropped?{dropped:i.dropped.map(l=>({reason:l.reason===\"url\"?\"url\":\"css\",element:e,name:s.name,css:l}))}:{}}}function xi(t,e,n,r){let o=(s,i)=>({refused:{reason:s,name:t,...i?{css:i}:{}}});if(e===\"geometry\")return n.length>Io||!Ei.test(n)||/url/i.test(n)?o(\"value\"):{value:n};if(e===\"image\")return n.length>Do?o(\"url\"):Ti.test(n)?{value:n}:n.startsWith(`blob:${r.origin}/`)&&/^blob:[^\\s\"'<>]+$/.test(n)?{value:n}:o(\"url\");if(n.length>dr)return o(\"value\");if(typeof e==\"object\"){let s=e.oneOf.find(i=>i.toLowerCase()===n.toLowerCase());return s===void 0?o(\"value\"):{value:s}}switch(e){case\"text\":return{value:n};case\"number\":return bi.test(n.trim())&&Number.isFinite(Number(n))?{value:n.trim()}:o(\"value\");case\"boolean\":return{value:\"\"};case\"fragment\":return Ni.test(n)?{value:n}:o(\"url\");case\"style\":{let s=is(n,dr);return s.refused.length>0&&s.css===\"\"?o(s.refused[0].reason===\"url\"?\"url\":\"css\",s.refused[0]):{value:s.css,...s.refused.length>0?{dropped:s.refused}:{}}}case\"css\":{let s=as(t,n);return\"refused\"in s?o(s.refused.reason===\"url\"?\"url\":\"css\",s.refused):{value:s.value}}}}var wi=0,Si=1,Oi=2,vi=3,cs=1,Ri=2,us=3,Ai=1,Ci=3,ki=8,ds=\"~\",_n=t=>typeof t==\"object\"&&t!==null&&!Array.isArray(t),fs=new Set([\"input\",\"select\",\"textarea\",\"option\"]),_i=new Set([\"value\",\"checked\",\"selected\"]);function ms(t,e){let n=t.ownerDocument??t,r=e.maxNodes??5e3,o=[],s=new Map,i=new WeakMap,l={dom:t,name:\"div\",namespace:\"html\",children:[],id:ds};s.set(ds,l);let u=0,d=!1,p=c=>{o.push(c),o.length>200&&o.shift()},E=()=>({dom:n.createComment(\"\"),children:[],refused:!0}),f=(c,h)=>{if(c.namespace===\"html\"&&c.name&&fs.has(c.name))return c.dom;if(h?.namespace===\"html\"&&h.name===\"textarea\")return h.dom},b=(c,h,g)=>{let a=c.dom;if(g!=null&&typeof g!=\"string\")return p({reason:\"value\",element:c.name,name:h});let m=Rr(c.namespace,c.name,h,g??null,e);if(\"refused\"in m){let R=Rr(c.namespace,c.name,h,null,e);return\"refused\"in R||a.removeAttribute(R.name),p(m.refused)}for(let R of m.dropped??[])p(R);let T=c.namespace===\"html\"&&_i.has(m.name)&&fs.has(c.name),x=a,v=T?m.name===\"value\"?x.value:m.name===\"checked\"?x.checked:x.selected:void 0;m.value===null?a.removeAttribute(m.name):a.setAttribute(m.name,m.value),e.onAttribute?.(a,m.name),T&&(m.name===\"value\"&&\"value\"in x?(x.value=m.value??\"\",v!==x.value&&e.onFieldSet?.(a)):m.name===\"checked\"&&\"checked\"in x?(x.checked=m.value!==null,v!==x.checked&&e.onFieldSet?.(a)):m.name===\"selected\"&&\"selected\"in x&&(x.selected=m.value!==null,v!==x.selected&&e.onFieldSet?.(a.parentElement?.closest(\"select\")??a)))},N=c=>{if(!c.refused){u-=1,c.id!==void 0&&s.delete(c.id);for(let h of c.children)N(h)}},O=(c,h)=>{if(!_n(c)||typeof c.id!=\"string\"||s.has(c.id))return p({reason:\"record\"}),E();if(u>=r)return p({reason:\"budget\"}),d||(d=!0,e.onOverBudget?.()),E();let g=c.id;if(c.type===ki)return E();if(c.type===Ci){if(vr(h.namespace,h.name))return p({reason:\"child\",element:h.name}),E();let v=n.createTextNode(String(c.data??\"\").slice(0,fr)),R={dom:v,children:[],text:!0,id:g,parent:h};return s.set(g,R),i.set(v,g),u+=1,R}if(c.type!==Ai)return p({reason:\"record\"}),E();let a=String(c.element);if(vr(h.namespace,h.name))return p({reason:\"child\",element:a}),E();let m=ls(a,h.namespace);if(\"refused\"in m)return p(m.refused),E();let T=n.createElementNS(m.namespace===\"svg\"?Lo:Mo,m.name);m.as&&T.setAttribute(\"data-graview-as\",m.as);let x={dom:T,name:m.name,namespace:m.namespace,children:[],id:g,parent:h};if(s.set(g,x),i.set(T,g),u+=1,_n(c.attributes))for(let[v,R]of Object.entries(c.attributes))b(x,v,R);if(e.decorate?.(T,m.name,m.namespace),_n(c.properties))for(let v of Object.keys(c.properties))p({reason:\"attribute\",element:m.name,name:v});if(_n(c.eventListeners))for(let v of Object.keys(c.eventListeners))c.eventListeners[v]!=null&&p({reason:\"attribute\",element:m.name,name:`on${v}`});if(Array.isArray(c.children))for(let v of c.children){let R=O(v,x);x.children.push(R),T.appendChild(R.dom)}return x},y=c=>{if(!Array.isArray(c))return p({reason:\"record\"});let[h,g]=c,a=typeof g==\"string\"?s.get(g):void 0;if(!a)return p({reason:\"record\"});switch(h){case wi:{if(a.text)return p({reason:\"record\"});let m=Number(c[3]),T=Number.isInteger(m)&&m>=0&&m<=a.children.length?m:a.children.length,x=O(c[2],a);a.dom.insertBefore(x.dom,a.children[T]?.dom??null),a.children.splice(T,0,x),a.namespace===\"html\"&&a.name===\"textarea\"&&e.onFieldSet?.(a.dom);return}case Si:{let m=Number(c[2]),T=a.children[m];if(!T)return p({reason:\"record\"});a.children.splice(m,1),T.dom.parentNode?.removeChild(T.dom),N(T);return}case Oi:{if(!a.text)return p({reason:\"record\"});a.dom.data=String(c[2]??\"\").slice(0,fr);let m=f(a,a.parent);m&&e.onFieldSet?.(m);return}case vi:{if(a===l||a.text)return p({reason:\"record\"});let m=String(c[2]),T=c[4]??cs;return T===Ri?b(a,m,c[3]):p(T===cs||T===us?{reason:\"attribute\",element:a.name,name:T===us?`on${m}`:m}:{reason:\"record\"})}default:return p({reason:\"record\"})}};return{apply(c,h){if(!Array.isArray(c))return p({reason:\"record\"}),!0;for(let g=0;g<c.length;g+=1){if(h&&g%32===0&&h())return!1;y(c[g])}return!0},get refused(){return o},get size(){return u},idOf:c=>i.get(c),elementOf(c){let h=s.get(c);return h&&!h.text&&h!==l?h.dom:void 0},dispose(){for(let c of l.children)N(c);for(l.children.length=0;t.firstChild;)t.removeChild(t.firstChild)}}}function ps(t,e,n){let{root:r}=$o(),o=!1,s=ms(r,{origin:n.origin??\"null\",maxNodes:n.maxNodes,onOverBudget:()=>o=!0});for(let u of t)s.apply(u);let i=[...s.refused],l=\"\";if(typeof e==\"string\"){let u=ss(e);l=u.css;for(let d of u.refused)i.push({reason:\"css\",name:\"stylesheet\",css:d})}return{root:r,refused:i,size:s.size,over:o,css:l}}function Pi(t){let e=\"element\"in t&&t.element?`<${t.element}>`:\"\",n=t.name?` ${t.name}`:\"\";switch(t.reason){case\"element\":return{at:`drawing ${e}`,says:`Not drawn: ${e} is not in the open kit.`};case\"attribute\":return{at:`drawing ${e}${n}`,says:`Not drawn: ${e||\"an element\"} does not take${n}.`};case\"value\":return{at:`drawing ${e}${n}`,says:`Not drawn: the value of${n} is not one the open kit takes.`};case\"url\":return{at:`drawing ${e}${n}`,says:\"Not drawn: an address. A view loads nothing; an image is a data: image.\"};case\"child\":return{at:`drawing ${e}`,says:`Not drawn: ${e} holds nothing.`};case\"record\":return{at:\"drawing\",says:\"Not drawn: a record the drawing's format does not know.\"};case\"budget\":return{at:\"drawing\",says:\"Not drawn: more nodes than a view may draw.\"};case\"css\":return{at:`stylesheet${n===\" stylesheet\"?\"\":n}`,says:`Not drawn: CSS the open kit leaves out${t.css?` (${t.css.reason}${t.css.name?` ${t.css.name}`:\"\"})`:\"\"}.`}}}function hs(t,e){let{limits:n}=e;if(t.messages>n.messages)return{ok:!1,reason:\"flood\",detail:`It sent ${t.messages} messages, more than the ${n.messages} a view may send in a second.`};let r=new Set(e.acts);for(let l of t.asked)if(!r.has(l.name))return{ok:!1,reason:\"act\",detail:`It asks for the act \"${l.name}\", which its manifest does not name.`};let o=ps(t.renders,t.css,{maxNodes:n.maxNodes});if(o.over)return{ok:!1,reason:\"nodes\",detail:`It drew more than the ${n.maxNodes.toLocaleString(\"en-US\")} things a view may draw.`};let s=Go(o.root,{props:e.props,places:e.places});for(let l of s.acts)if(!r.has(l))return{ok:!1,reason:\"act\",detail:`It binds a press to the act \"${l}\" (data-act), which its manifest does not name.`};let i=[...o.refused.map(Pi),...s.problems];for(let l of t.went)\"record\"in l&&!(e.props.node?.id===l.record||(e.props.nodes??[]).some(u=>u.id===l.record))&&i.push({at:\"navigate\",says:`It goes to \"${l.record}\", which this seat was not shown: the host will not follow it.`}),\"place\"in l&&!e.places.includes(l.place)&&i.push({at:\"navigate\",says:`It goes to the place \"${l.place}\", which this app does not have.`});return{ok:!0,parts:s.parts,problems:i}}var Ar=\"graviewHeadless\",Cr=\"graviewHeadlessView\";var Es=globalThis,Ii=Promise.prototype.then,Di=Promise.resolve(),_r=t=>void Ii.call(Di,t),Pn=Es.performance,vt=Pn&&typeof Pn.now==\"function\"?Pn.now.bind(Pn):Date.now,Ie=JSON.stringify,Ns=JSON.parse,Mi=Object.defineProperty,Pr=t=>(t instanceof Error?`${t.name}: ${t.message}`:String(t)).slice(0,500),gs=t=>{try{return Ns(Ie(t??null))}catch{return null}},B={renders:[],asked:[],went:[],ms:0,logs:[],messages:0},De,In=(t,e)=>{De??={reason:t,detail:e}},rt=t=>{B.logs.length<50&&B.logs.push(t.slice(0,500))},ot={removed:[],stuck:[],sealed:!1},Ir=zo({send(t){B.messages+=1,t.type===\"render\"?B.renders.push(gs(t.records)):t.type===\"style\"?B.css=String(t.css):t.type===\"navigate\"&&\"place\"in t&&B.went.push({place:String(t.place)})},act(t,e){return B.messages+=1,B.asked.push({name:String(t),args:gs(e)}),Promise.resolve({type:\"answer\",id:B.asked.length,ok:!1,reason:\"refused\",message:\"Nothing is applied in a headless run.\"})},navigate(t){B.messages+=1,B.went.push({record:String(t)})},microtask:_r,now:vt,threw:t=>In(\"error\",`It threw: ${Pr(t)}`),warn:rt,hardening:()=>ot}),ys=!1,kr=!1;function Li(t){if(kr||typeof t!=\"function\"||(kr=!0,De))return;let e=vt();try{t.call(void 0,Ir.view)}catch(n){In(\"error\",`It threw: ${Pr(n)}`)}B.ms+=vt()-e}async function Hi(t){if(ys)return Ie({ok:!1,reason:\"refused\",detail:\"A headless script runs one view, once: something called its entry before the host did.\"});ys=!0;let e;try{e=Ns(String(t))}catch{return Ie({ok:!1,reason:\"isolate\",detail:\"The run was not handed its input as JSON.\"})}if(!kr&&!De)return Ie({ok:!1,reason:\"isolate\",detail:\"The script held no view.\"});let n=vt();De||Ir.hear({type:\"props\",props:e.props,push:1}),B.ms+=vt()-n,B.ms>=e.limits.pushMs&&In(\"slow\",`It took longer than ${e.limits.pushMs.toLocaleString(\"en-US\")} ms to draw what it was shown.`);for(let o=0;o<64&&!De;o+=1)await new Promise(s=>_r(s));if(De)return Ie({ok:!1,...De,transcript:B});let r=hs(B,e);return r.ok?Ie({ok:!0,transcript:B,drawn:{parts:r.parts,problems:r.problems},hardening:{removed:ot.removed.length,sealed:ot.sealed}}):Ie({ok:!1,reason:r.reason,detail:r.detail,transcript:B})}var Vi=Object.freeze({log:(...t)=>rt(t.map(String).join(\" \")),info:(...t)=>rt(t.map(String).join(\" \")),debug:(...t)=>rt(t.map(String).join(\" \")),warn:(...t)=>rt(t.map(String).join(\" \")),error:(...t)=>rt(t.map(Pr).join(\" \"))}),Ui=0,bs=()=>Ui+=1,ji=[[\"console\",Vi],[\"setTimeout\",bs],[\"setInterval\",bs],[\"clearTimeout\",()=>{}],[\"clearInterval\",()=>{}],[\"queueMicrotask\",_r],[\"graview\",Ir.view],[Cr,Li],[Ar,t=>Hi(t)]];for(let[t,e]of ji)Mi(Es,t,{value:e,writable:!0,enumerable:!1,configurable:!0});ot=So(globalThis,[\"graview\",Cr,Ar],{primitivesStay:!0});ot.stuck.length>0&&In(\"refused\",`This isolate could not be hardened: ${ot.stuck.join(\", \")} would not go.`);})();\n";
8
+ //# sourceMappingURL=runtime.generated.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.generated.js","sourceRoot":"","sources":["../../src/headless/runtime.generated.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAW,wgpGAAwgpG,CAAC"}
@@ -0,0 +1,171 @@
1
+ /*
2
+ * A HEADLESS RUN'S RUNTIME (FR-95): what runs INSIDE the isolate a host
3
+ * picked, in front of the view.
4
+ *
5
+ * Bundled into one classic script (headless/runtime.generated.ts, by
6
+ * scripts/guest-view-runtime.mjs), which `headlessScript(source)` puts in
7
+ * front of a view's own source. Loaded into an isolate — a worker thread's
8
+ * fresh context, a workerd isolate with no outbound network, a browser
9
+ * worker — the script first makes the isolate the worker's: the same
10
+ * `graview` global a worker's runtime makes (worker/view-global.ts), over a
11
+ * transcript rather than a port; a console that writes to the transcript;
12
+ * timers that never fire; and then everything outside the worker's
13
+ * allowlist taken from the global (worker/harden.ts). Only then is the view
14
+ * read, and its top line run. The script leaves one entry:
15
+ *
16
+ * graviewHeadless(input) the run: JSON text in (HeadlessInput), JSON text out (HeadlessOutcome)
17
+ *
18
+ * which pushes the view what it is shown, once, and holds what it sent to
19
+ * its limits and manifest, drawn by the open kit's own renderer into a tree
20
+ * of plain objects and said as a place is said (judge.ts).
21
+ *
22
+ * Nothing here reaches a network, and the isolate is what keeps the view
23
+ * from one: the hardening is a second wall, not the first. A view can lie
24
+ * to its own check — patch what the runtime reads after it, draw one thing
25
+ * here and another in a page — so the host judges the transcript again in
26
+ * its own context, and the check says what the view drew, never that it is
27
+ * honest. What it may reach is the page's to hold, as it always is.
28
+ */
29
+ import "@remote-dom/core/polyfill";
30
+ import { harden } from "../worker/harden.js";
31
+ import { createViewRuntime } from "../worker/view-global.js";
32
+ import { judgeTranscript } from "./judge.js";
33
+ import { HEADLESS_ENTRY, HEADLESS_VIEW } from "./protocol.js";
34
+ /* Taken before a line of the view runs: what the run builds with stays as it found it. */
35
+ const scope = globalThis;
36
+ const then = Promise.prototype.then;
37
+ const settled = Promise.resolve();
38
+ const microtask = (task) => void then.call(settled, task);
39
+ const performance = scope["performance"];
40
+ const clock = performance && typeof performance.now === "function" ? performance.now.bind(performance) : Date.now;
41
+ const stringify = JSON.stringify;
42
+ const parse = JSON.parse;
43
+ const define = Object.defineProperty;
44
+ const say = (error) => (error instanceof Error ? `${error.name}: ${error.message}` : String(error)).slice(0, 500);
45
+ /** Plain data for the transcript: what the view passed, with nothing of its that runs. */
46
+ const plain = (value) => {
47
+ try {
48
+ return parse(stringify(value ?? null));
49
+ }
50
+ catch {
51
+ return null;
52
+ }
53
+ };
54
+ const transcript = { renders: [], asked: [], went: [], ms: 0, logs: [], messages: 0 };
55
+ let failure;
56
+ const fail = (reason, detail) => {
57
+ failure ??= { reason, detail };
58
+ };
59
+ const log = (text) => {
60
+ if (transcript.logs.length < 50)
61
+ transcript.logs.push(text.slice(0, 500));
62
+ };
63
+ let hardened = { removed: [], stuck: [], sealed: false };
64
+ const runtime = createViewRuntime({
65
+ send(request) {
66
+ transcript.messages += 1;
67
+ if (request.type === "render")
68
+ transcript.renders.push(plain(request.records));
69
+ else if (request.type === "style")
70
+ transcript.css = String(request.css);
71
+ else if (request.type === "navigate" && "place" in request)
72
+ transcript.went.push({ place: String(request.place) });
73
+ },
74
+ act(name, args) {
75
+ transcript.messages += 1;
76
+ transcript.asked.push({ name: String(name), args: plain(args) });
77
+ return Promise.resolve({ type: "answer", id: transcript.asked.length, ok: false, reason: "refused", message: "Nothing is applied in a headless run." });
78
+ },
79
+ navigate(to) {
80
+ transcript.messages += 1;
81
+ transcript.went.push({ record: String(to) });
82
+ },
83
+ microtask,
84
+ now: clock,
85
+ threw: (error) => fail("error", `It threw: ${say(error)}`),
86
+ warn: log,
87
+ hardening: () => hardened,
88
+ });
89
+ let ran = false;
90
+ let viewed = false;
91
+ /** The view, run at once: its top line, timed, with anything it throws caught and said. */
92
+ function view(fn) {
93
+ if (viewed || typeof fn !== "function")
94
+ return;
95
+ viewed = true;
96
+ if (failure)
97
+ return;
98
+ const began = clock();
99
+ try {
100
+ fn.call(undefined, runtime.view);
101
+ }
102
+ catch (error) {
103
+ fail("error", `It threw: ${say(error)}`);
104
+ }
105
+ transcript.ms += clock() - began;
106
+ }
107
+ async function run(text) {
108
+ if (ran)
109
+ return stringify({ ok: false, reason: "refused", detail: "A headless script runs one view, once: something called its entry before the host did." });
110
+ ran = true;
111
+ let input;
112
+ try {
113
+ input = parse(String(text));
114
+ }
115
+ catch {
116
+ return stringify({ ok: false, reason: "isolate", detail: "The run was not handed its input as JSON." });
117
+ }
118
+ if (!viewed && !failure)
119
+ return stringify({ ok: false, reason: "isolate", detail: "The script held no view." });
120
+ /* One push of what it is shown, timed with its top line. */
121
+ const began = clock();
122
+ if (!failure)
123
+ runtime.hear({ type: "props", props: input.props, push: 1 });
124
+ transcript.ms += clock() - began;
125
+ if (transcript.ms >= input.limits.pushMs)
126
+ fail("slow", `It took longer than ${input.limits.pushMs.toLocaleString("en-US")} ms to draw what it was shown.`);
127
+ /* What it drew goes in microtasks: let them run, and anything it chained on them, a bounded number of turns. */
128
+ for (let turn = 0; turn < 64 && !failure; turn += 1)
129
+ await new Promise((resolve) => microtask(resolve));
130
+ if (failure)
131
+ return stringify({ ok: false, ...failure, transcript });
132
+ const judged = judgeTranscript(transcript, input);
133
+ if (!judged.ok)
134
+ return stringify({ ok: false, reason: judged.reason, detail: judged.detail, transcript });
135
+ return stringify({ ok: true, transcript, drawn: { parts: judged.parts, problems: judged.problems }, hardening: { removed: hardened.removed.length, sealed: hardened.sealed } });
136
+ }
137
+ /*
138
+ * THE ISOLATE, MADE THE WORKER'S, before the view's script is read. The
139
+ * console writes to the transcript; timers never fire, since a headless run
140
+ * is one push and what it drew; `graview` is the view's one global, beside
141
+ * the two the script leaves; and then everything outside the worker's
142
+ * allowlist goes and what is left stays as it is. Hardening comes first so
143
+ * that a view whose text closes its own wrapper early runs after it all the
144
+ * same. A name that will not go stops the run, and the view never runs.
145
+ */
146
+ const console = Object.freeze({
147
+ log: (...said) => log(said.map(String).join(" ")),
148
+ info: (...said) => log(said.map(String).join(" ")),
149
+ debug: (...said) => log(said.map(String).join(" ")),
150
+ warn: (...said) => log(said.map(String).join(" ")),
151
+ error: (...said) => log(said.map(say).join(" ")),
152
+ });
153
+ let timer = 0;
154
+ const never = () => (timer += 1);
155
+ const own = [
156
+ ["console", console],
157
+ ["setTimeout", never],
158
+ ["setInterval", never],
159
+ ["clearTimeout", () => { }],
160
+ ["clearInterval", () => { }],
161
+ ["queueMicrotask", microtask],
162
+ ["graview", runtime.view],
163
+ [HEADLESS_VIEW, view],
164
+ [HEADLESS_ENTRY, (text) => run(text)],
165
+ ];
166
+ for (const [name, value] of own)
167
+ define(scope, name, { value, writable: true, enumerable: false, configurable: true });
168
+ hardened = harden(globalThis, ["graview", HEADLESS_VIEW, HEADLESS_ENTRY], { primitivesStay: true });
169
+ if (hardened.stuck.length > 0)
170
+ fail("refused", `This isolate could not be hardened: ${hardened.stuck.join(", ")} would not go.`);
171
+ //# sourceMappingURL=runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../src/headless/runtime.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,54 @@
1
+ export declare const HTML_NAMESPACE = "http://www.w3.org/1999/xhtml";
2
+ export declare abstract class TreeNode {
3
+ readonly ownerDocument: TreeDocument | null;
4
+ abstract readonly nodeType: 1 | 3 | 8 | 9;
5
+ parentNode: TreeElement | TreeDocument | null;
6
+ readonly childNodes: TreeNode[];
7
+ constructor(ownerDocument: TreeDocument | null);
8
+ get firstChild(): TreeNode | null;
9
+ get parentElement(): TreeElement | null;
10
+ get textContent(): string;
11
+ insertBefore<T extends TreeNode>(child: T, before: TreeNode | null): T;
12
+ appendChild<T extends TreeNode>(child: T): T;
13
+ removeChild<T extends TreeNode>(child: T): T;
14
+ }
15
+ export declare class TreeText extends TreeNode {
16
+ data: string;
17
+ readonly nodeType: 3;
18
+ constructor(owner: TreeDocument, data: string);
19
+ get textContent(): string;
20
+ }
21
+ export declare class TreeComment extends TreeNode {
22
+ readonly nodeType: 8;
23
+ get textContent(): string;
24
+ }
25
+ export declare class TreeElement extends TreeNode {
26
+ readonly namespaceURI: string;
27
+ readonly localName: string;
28
+ readonly nodeType: 1;
29
+ readonly attributes: Map<string, string>;
30
+ value: string;
31
+ checked: boolean;
32
+ selected: boolean;
33
+ constructor(owner: TreeDocument, namespaceURI: string, localName: string);
34
+ setAttribute(name: string, value: string): void;
35
+ removeAttribute(name: string): void;
36
+ getAttribute(name: string): string | null;
37
+ hasAttribute(name: string): boolean;
38
+ /** The nearest element by local name, this one or above: all the renderer asks of `closest`. */
39
+ closest(name: string): TreeElement | null;
40
+ }
41
+ export declare class TreeDocument extends TreeNode {
42
+ readonly nodeType: 9;
43
+ constructor();
44
+ createElementNS(namespace: string, name: string): TreeElement;
45
+ createElement(name: string): TreeElement;
46
+ createTextNode(data: string): TreeText;
47
+ createComment(_data: string): TreeComment;
48
+ }
49
+ /** A document of its own, and the element a view's drawing is drawn under. */
50
+ export declare function createTree(): {
51
+ readonly document: TreeDocument;
52
+ readonly root: TreeElement;
53
+ };
54
+ //# sourceMappingURL=tree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tree.d.ts","sourceRoot":"","sources":["../../src/headless/tree.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,cAAc,iCAAiC,CAAC;AAE7D,8BAAsB,QAAQ;IAIhB,QAAQ,CAAC,aAAa,EAAE,YAAY,GAAG,IAAI;IAHvD,QAAQ,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC1C,UAAU,EAAE,WAAW,GAAG,YAAY,GAAG,IAAI,CAAQ;IACrD,QAAQ,CAAC,UAAU,EAAE,QAAQ,EAAE,CAAM;gBAChB,aAAa,EAAE,YAAY,GAAG,IAAI;IAEvD,IAAI,UAAU,IAAI,QAAQ,GAAG,IAAI,CAEhC;IACD,IAAI,aAAa,IAAI,WAAW,GAAG,IAAI,CAEtC;IACD,IAAI,WAAW,IAAI,MAAM,CAExB;IAED,YAAY,CAAC,CAAC,SAAS,QAAQ,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,QAAQ,GAAG,IAAI,GAAG,CAAC;IAQtE,WAAW,CAAC,CAAC,SAAS,QAAQ,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC;IAG5C,WAAW,CAAC,CAAC,SAAS,QAAQ,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC;CAM7C;AAED,qBAAa,QAAS,SAAQ,QAAQ;IAI3B,IAAI,EAAE,MAAM;IAHrB,QAAQ,CAAC,QAAQ,EAAG,CAAC,CAAU;gBAE7B,KAAK,EAAE,YAAY,EACZ,IAAI,EAAE,MAAM;IAIrB,IAAa,WAAW,IAAI,MAAM,CAEjC;CACF;AAED,qBAAa,WAAY,SAAQ,QAAQ;IACvC,QAAQ,CAAC,QAAQ,EAAG,CAAC,CAAU;IAC/B,IAAa,WAAW,IAAI,MAAM,CAEjC;CACF;AAED,qBAAa,WAAY,SAAQ,QAAQ;IASrC,QAAQ,CAAC,YAAY,EAAE,MAAM;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM;IAT5B,QAAQ,CAAC,QAAQ,EAAG,CAAC,CAAU;IAC/B,QAAQ,CAAC,UAAU,sBAA6B;IAEhD,KAAK,SAAM;IACX,OAAO,UAAS;IAChB,QAAQ,UAAS;gBAEf,KAAK,EAAE,YAAY,EACV,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,MAAM;IAI5B,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAG/C,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAGnC,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAGzC,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAGnC,gGAAgG;IAChG,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI;CAI1C;AAED,qBAAa,YAAa,SAAQ,QAAQ;IACxC,QAAQ,CAAC,QAAQ,EAAG,CAAC,CAAU;;IAI/B,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,WAAW;IAG7D,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW;IAGxC,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ;IAGtC,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW;CAG1C;AAED,8EAA8E;AAC9E,wBAAgB,UAAU,IAAI;IAAE,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAA;CAAE,CAM5F"}