@graview/guest 0.1.46 → 0.1.48

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 (85) hide show
  1. package/README.md +54 -2
  2. package/dist/audit/index.d.ts +53 -0
  3. package/dist/audit/index.d.ts.map +1 -0
  4. package/dist/audit/index.js +419 -0
  5. package/dist/audit/index.js.map +1 -0
  6. package/dist/audit/measure.d.ts +14 -0
  7. package/dist/audit/measure.d.ts.map +1 -0
  8. package/dist/audit/measure.js +162 -0
  9. package/dist/audit/measure.js.map +1 -0
  10. package/dist/audit/rules.d.ts +53 -0
  11. package/dist/audit/rules.d.ts.map +1 -0
  12. package/dist/audit/rules.js +21 -0
  13. package/dist/audit/rules.js.map +1 -0
  14. package/dist/cli.d.ts +4 -1
  15. package/dist/cli.d.ts.map +1 -1
  16. package/dist/cli.js +26 -5
  17. package/dist/cli.js.map +1 -1
  18. package/dist/headless/describe.d.ts +2 -0
  19. package/dist/headless/describe.d.ts.map +1 -1
  20. package/dist/headless/describe.js +11 -3
  21. package/dist/headless/describe.js.map +1 -1
  22. package/dist/headless/index.d.ts +27 -0
  23. package/dist/headless/index.d.ts.map +1 -1
  24. package/dist/headless/index.js +16 -4
  25. package/dist/headless/index.js.map +1 -1
  26. package/dist/headless/judge.d.ts.map +1 -1
  27. package/dist/headless/judge.js +10 -4
  28. package/dist/headless/judge.js.map +1 -1
  29. package/dist/headless/press.d.ts +2 -0
  30. package/dist/headless/press.d.ts.map +1 -1
  31. package/dist/headless/press.js +6 -3
  32. package/dist/headless/press.js.map +1 -1
  33. package/dist/headless/protocol.d.ts +4 -0
  34. package/dist/headless/protocol.d.ts.map +1 -1
  35. package/dist/headless/runtime.generated.d.ts.map +1 -1
  36. package/dist/headless/runtime.generated.js +1 -1
  37. package/dist/headless/runtime.generated.js.map +1 -1
  38. package/dist/headless/runtime.js +3 -0
  39. package/dist/headless/runtime.js.map +1 -1
  40. package/dist/host/arrive-at.d.ts +6 -0
  41. package/dist/host/arrive-at.d.ts.map +1 -1
  42. package/dist/host/arrive-at.js +11 -0
  43. package/dist/host/arrive-at.js.map +1 -1
  44. package/dist/host/links-words.d.ts +8 -0
  45. package/dist/host/links-words.d.ts.map +1 -1
  46. package/dist/host/links-words.js +8 -0
  47. package/dist/host/links-words.js.map +1 -1
  48. package/dist/host/links.d.ts +6 -0
  49. package/dist/host/links.d.ts.map +1 -1
  50. package/dist/host/links.js +126 -25
  51. package/dist/host/links.js.map +1 -1
  52. package/dist/host/manifest.d.ts +20 -0
  53. package/dist/host/manifest.d.ts.map +1 -1
  54. package/dist/host/manifest.js +21 -0
  55. package/dist/host/manifest.js.map +1 -1
  56. package/dist/host/open-draw.d.ts +15 -1
  57. package/dist/host/open-draw.d.ts.map +1 -1
  58. package/dist/host/open-draw.js +72 -3
  59. package/dist/host/open-draw.js.map +1 -1
  60. package/dist/host/open-render.d.ts.map +1 -1
  61. package/dist/host/open-render.js +39 -8
  62. package/dist/host/open-render.js.map +1 -1
  63. package/dist/host/press.d.ts +15 -2
  64. package/dist/host/press.d.ts.map +1 -1
  65. package/dist/host/press.js +50 -17
  66. package/dist/host/press.js.map +1 -1
  67. package/dist/host/pressable.d.ts +12 -0
  68. package/dist/host/pressable.d.ts.map +1 -1
  69. package/dist/host/pressable.js +30 -0
  70. package/dist/host/pressable.js.map +1 -1
  71. package/dist/host/view-runtime.generated.d.ts.map +1 -1
  72. package/dist/host/view-runtime.generated.js +1 -1
  73. package/dist/host/view-runtime.generated.js.map +1 -1
  74. package/dist/host/view.d.ts +20 -1
  75. package/dist/host/view.d.ts.map +1 -1
  76. package/dist/host/view.js +46 -2
  77. package/dist/host/view.js.map +1 -1
  78. package/dist/host/worker-react.d.ts.map +1 -1
  79. package/dist/host/worker-react.js +17 -5
  80. package/dist/host/worker-react.js.map +1 -1
  81. package/dist/worker/view-global.d.ts +2 -0
  82. package/dist/worker/view-global.d.ts.map +1 -1
  83. package/dist/worker/view-global.js +19 -1
  84. package/dist/worker/view-global.js.map +1 -1
  85. package/package.json +7 -3
@@ -4,5 +4,5 @@
4
4
  * it in front of a view's own source, for an isolate the host picked.
5
5
  * Carries Remote DOM (MIT, Shopify Inc.).
6
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 C=Symbol(\"name\"),xe=Symbol(\"prefix\"),ve=Symbol(\"value\"),P=Symbol(\"ns\"),Q=Symbol(\"owner\"),H=Symbol(\"owner_document\"),fe=Symbol(\"attributes\"),$=Symbol(\"prev\"),v=Symbol(\"next\"),_=Symbol(\"child\"),ee=Symbol(\"parent\"),Se=Symbol(\"host\"),se=Symbol(\"data\"),_e=Symbol(\"listeners\"),Xn=Symbol(\"isTrusted\"),ze=Symbol(\"path\"),Fe=Symbol(\"stop_immediate_propagation\"),Be=Symbol(\"dispatching\"),he=Symbol(\"content\"),G=Symbol(\"hooks\"),Gt=Symbol(\"extensions\"),Ie=Symbol(\"hooks_dispatch\"),B=Symbol(\"is_connected\"),Ye=Symbol(\"create_element\"),Yr=0,ne=1,We=2,qe=3,Xe=8,De=9,Wr=10,Oe=11,I=\"http://www.w3.org/1999/xhtml\",ie=\"http://www.w3.org/2000/svg\",qr=\"http://www.w3.org/XML/1998/namespace\",gt=\"http://www.w3.org/2000/xmlns/\";function Ut(t){return t.split(/[\\t\\n\\f\\r ]+/).filter(Boolean)}function z(t){return t.replace(/[A-Z]/g,e=>String.fromCharCode(e.charCodeAt(0)+32))}function Xr(t){return t.replace(/[a-z]/g,e=>String.fromCharCode(e.charCodeAt(0)-32))}function L(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 Kr=/^(?:[A-Za-z][^\\0\\t\\n\\f\\r\\u0020/>]*|[:_\\u0080-\\u{10FFFF}][A-Za-z0-9-.:_\\u0080-\\u{10FFFF}]*)$/u,Zr=/[\\0\\t\\n\\f\\r />=]/u,Fs=/[\\0\\t\\n\\f\\r />]/u;function ge(t){if(t==null)return null;let e=String(t);return e===\"\"?null:e}function Jr(t){Kr.test(t)||Zn(t)}function Kn(t){(t===\"\"||Zr.test(t))&&Zn(t)}function jt(t,e,n){let r=ge(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===\"\"||Fs.test(i))||(n===\"element\"?!Kr.test(l):l===\"\"||Zr.test(l)))&&Zn(o),i!=null&&r==null)throw L(`A namespace is required for the prefix in \"${o}\"`,\"NamespaceError\");if(i===\"xml\"&&r!==qr)throw L(\"The xml prefix requires the XML namespace\",\"NamespaceError\");if((o===\"xmlns\"||i===\"xmlns\")&&r!==gt)throw L(\"The xmlns name requires the XMLNS namespace\",\"NamespaceError\");if(r===gt&&o!==\"xmlns\"&&i!==\"xmlns\")throw L(\"The XMLNS namespace requires the xmlns name or prefix\",\"NamespaceError\");return{namespace:r,qualifiedName:o,prefix:i,localName:l}}function Zn(t){throw L(`Invalid name: \"${t}\"`,\"InvalidCharacterError\")}var Vt=0,zt=1,Qr=2,Jn=3,Bs=typeof performance>\"u\"?Date.now:performance.now.bind(performance),Y=class{static NONE=Vt;static CAPTURING_PHASE=zt;static AT_TARGET=Qr;static BUBBLING_PHASE=Jn;timeStamp=Bs();target=null;currentTarget=null;srcElement=null;bubbles=!1;cancelable=!1;composed=!1;defaultPrevented=!1;cancelBubble=!1;eventPhase=Vt;[ze]=[];[Fe]=!1;[Be]=!1;constructor(e,n){this.type=e,Object.defineProperty(this,Xn,{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[Xn]}composedPath(){return[...this[ze]]}stopPropagation(){this.cancelBubble=!0}stopImmediatePropagation(){this[Fe]=!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 Qn(t,e,n){if(t.cancelBubble)return;let o=e[_e]?.get(t.type)?.[n===zt?\"capture\":\"bubble\"];if(o)for(let s of[...o]){if(!o.has(s)||s.signal?.aborted)continue;t.eventPhase=t.target===e?Qr:n,t.currentTarget=e;let i=s.normalizedListener;try{typeof i==\"object\"?i.handleEvent(t):i.call(e,t)}catch(l){setTimeout(Ys,0,l)}if(t[Fe])break}}function Ys(t){throw t}var yt=[],Ft=new WeakMap;function Bt(t,e){let n=Ft.get(t);n?n.push(e):Ft.set(t,[e]),yt[yt.length-1].push(t)}function W(t){let e=[];yt.push(e);let n;try{n=t()}catch(r){yt.pop();try{eo(e)}catch{}throw r}return yt.pop(),eo(e),n}function eo(t){let e,n=!1;for(let r of t){let o=Ft.get(r);if(o){for(;o.length>0;){let s=o.shift();try{s()}catch(i){n||(e=i,n=!0)}}Ft.delete(r)}}if(n)throw e}var Yt=[],bt=[],er=!1;function Me(t){for(let e of t)Yt.push(e),e[1]&&bt.push(e[1]);if(!er){er=!0;try{let e,n=!1;for(let r=0;r<Yt.length;r++){let[o,s]=Yt[r];s&&bt.splice(bt.indexOf(s),1);try{o()}catch(i){n||(e=i,n=!0)}}if(n)throw e}finally{Yt.length=0,bt.length=0,er=!1}}}function Et(t){let e=t;for(;e;){if(bt.includes(e))return!0;e=e[ee]??e[Se]}return!1}var wt=Symbol(\"listenerRegistrations\"),Ae=class{[_e]=void 0;[wt]=void 0;[H]=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=tr(o),d=this[wt];d||(d=new Map,this[wt]=d);let c=d.get(e);c||(c={},d.set(e,c));let f=c[l];if(f||(f=new Map,c[l]=f),f.has(n))return;let w=this,u={type:e,listener:n,capture:o,once:s,normalizedListener:n,signal:i};(s||i)&&(u.normalizedListener=function(...a){if(u.signal?.aborted){Wt(w,u);return}return u.once&&Wt(w,u),typeof u.listener==\"object\"?u.listener.handleEvent(...a):u.listener.call(this,...a)});let E=this[_e];E||(E=new Map,this[_e]=E);let N=E.get(e);N||(N={},E.set(e,N));let x=N[l];if(x||(x=new Set,N[l]=x),f.set(n,u),x.add(u),i){let h=()=>{Wt(w,u)};u.abortListener=h,i.addEventListener(\"abort\",h,{once:!0})}this[H]?.defaultView[Ie].addEventListener?.(this,e,n,r)}removeEventListener(e,n,r){return Ws.call(this,e,n,r)}dispatchEvent(e){if(e[Be])throw L(\"Failed to execute 'dispatchEvent' on 'EventTarget': The event is already being dispatched.\",\"InvalidStateError\");e[Be]=!0;try{let n=[],r=this;for(;r!=null;)n.push(r),r=r.parentNode;e.target=this,e.srcElement=this,e[ze]=n;for(let s=n.length;s--;)if(Qn(e,n[s],zt),e.cancelBubble)return!e.defaultPrevented;let o=e.bubbles?n:n.slice(0,1);for(let s=0;s<o.length;s++)if(Qn(e,o[s],Jn),e.cancelBubble)return!e.defaultPrevented;return!e.defaultPrevented}finally{e[Be]=!1,e.cancelBubble=!1,e[Fe]=!1,e.eventPhase=Vt,e.currentTarget=null,e[ze]=[]}}};function Ws(t,e,n){if(e==null)return;let r=n===!0||n&&n.capture===!0,o=tr(!!r),s=this[wt]?.get(t)?.[o]?.get(e);s&&Wt(this,s)}function tr(t){return t?\"capture\":\"bubble\"}function Wt(t,e){let n=tr(e.capture),r=t[wt],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[_e],l=i?.get(e.type);if(!l)return;let d=l[n];d?.delete(e)&&(d.size===0&&delete l[n],!l.bubble&&!l.capture&&i?.delete(e.type),t[H]?.defaultView[Ie].removeEventListener?.(t,e.type,e.listener,e.capture))}var ae=class extends Array{item(e){return this[e]??null}};var Tt=0,to=1,or=2,sr=3,xt=4,no=0,ro=1,Kt=2,Zt=3,oo=4,rr=5,so=6,io=7,qt=/^(?:--|-?[A-Za-z_\\u0080-\\u{10FFFF}])[A-Za-z0-9_\\u0080-\\u{10FFFF}-]*$/u;function qs(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 te(t){throw L(`Invalid or unsupported selector: \"${t}\"`,\"SyntaxError\")}function Jt(t,e){let n=typeof e==\"string\"?vt(e):[{combinator:xt,matchers:e}],r=null,o=t[_];return o&&n[0].matchers.length&&ir(o,n,s=>(r=s,!1)),r}function Qt(t,e){let n=typeof e==\"string\"?vt(e):[{combinator:xt,matchers:e}],r=new ae,o=t[_];return o&&n[0].matchers.length&&ir(o,n,s=>{r.push(s)}),r}function vt(t,e=!1,n=!1){let r={combinator:xt,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===\"\"&&te(t);let l=0,d;for(;d=s.exec(i);){d.index!==l&&te(t),d[1]&&(r.matchers.length===0&&!(n&&o.length===1)&&te(t),d[1]===\">\"?r.combinator=to:d[1]===\"+\"?r.combinator=sr:d[1]===\"~\"?r.combinator=or:r.combinator=Tt,r={combinator:xt,matchers:[]},o.push(r));let c=d[8]?z(d[8]):d[2]||d[7];d[7]!=null&&!d[6]&&r.matchers.length>0&&te(t);let w,u=d[4]??d[5]??d[7];if(d[2]){qt.test(c)||te(t);let E=d[5],N=E?.[0];if(d[3]==null&&(N==='\"'||N===\"'\")){let x=d[0].lastIndexOf(E);u=i.slice(d.index+x+1),s.lastIndex=i.length}else E!=null&&!qt.test(E)&&te(t);w=oo}else d[6]?(qt.test(c)||te(t),w=d[6]===\"#\"?Kt:Zt):d[8]?w=d[9]==null?rr:so:d[7]===\"*\"?w=no:d[7]&&qt.test(d[7])?w=ro:te(t);d[9]?([u,s.lastIndex]=qs(i,s.lastIndex),c!==\"has\"&&c!==\"not\"&&te(t),c===\"has\"&&e&&te(t),vt(u,e||c===\"has\",c===\"has\")):w===rr&&te(t),r.matchers.push({type:w,name:c,value:u}),l=s.lastIndex}return(l!==i.length||r.matchers.length===0)&&te(t),o}function Xs(t,e){let n=vt(e);return n[0]?.matchers.length?Nt(t,n):!1}function Ks(t,e){let n=vt(e,!0,!0),r=n[0];if(n.length===1&&r.matchers.length===0)return!1;let o=Tt,s={type:io,name:\":scope\"};if(r.matchers.length===0?(o=r.combinator,r.matchers.push(s)):n.unshift({combinator:Tt,matchers:[s]}),n.some(({matchers:d})=>d.length===0))return!1;let i=o===sr||o===or?t[v]:t[_];if(!i)return!1;let l=!1;return ir(i,n,()=>(l=!0,!1),t),l}function ir(t,e,n,r){let o=[],s=t;for(;s;){if(Z(s)){if(Nt(s,e,r)&&n(s)===!1)return!1;let i=s[_];if(i){let l=s[v];l&&o.push(l),s=i;continue}}s=s[v]??o.pop()??null}return!0}function Nt(t,e,n){let{combinator:r,matchers:o}=e[e.length-1];if(r===xt){if(!Xt(t,o,n))return!1;let l=e.slice(0,-1);return l.length===0||Nt(t,l,n)}let s=r===to||r===Tt?ee:$,i=t[s];if(!i)return!1;if(r===Tt||r===or){for(;i;){if(Z(i)&&Xt(i,o,n)){let l=e.slice(0,-1);if(l.length===0||Nt(i,l,n))return!0}i=i[s]}return!1}else{if(r===sr&&!Z(i)){for(;i&&!Z(i);)i=i[s];if(!i)return!1}if(!Z(i)||!Xt(i,o,n))return!1;let l=e.slice(0,-1);return l.length===0||Nt(i,l,n)}}function nr(t,e){return t.getAttributeNS(null,t.namespaceURI===I?z(e):e)}function Xt(t,e,n){if(!t)return!1;if(Array.isArray(e)){for(let i of e)if(Xt(t,i,n)===!1)return!1;return!0}let{type:r,name:o,value:s}=e;switch(r){case no:return o===\"*\";case ro:return t.namespaceURI===I?t.localName===z(o):t.localName===o;case Kt:return nr(t,\"id\")===o;case Zt:let i=nr(t,\"class\");return i?Ut(i).includes(o):!1;case oo:let l=nr(t,o);return s==null?l!=null:l===s;case io:return t===n;case rr:te(`:${o}`);case so:switch(o){case\"has\":return Ks(t,s||\"\");case\"not\":return!Xs(t,s||\"\");default:te(`:${o}(${s})`)}}return!1}function Zs(t){return t.nodeType===We}function St(t){return se in t}function lr(t){return t.nodeType===qe}function Js(t){return t.nodeType===Xe}function Z(t){return t.nodeType===ne}function ar(t){return t.nodeType===Oe}function uo(t){return\"appendChild\"in t}function en(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 d of At(i)){if(o.has(d)||(o.add(d),e.push(d),l.push(d),!Z(d)))continue;let c=d[fe];if(c)for(let w of c)o.has(w)||(o.add(w),e.push(w));let f=d[he];f&&!o.has(f)&&!r.has(f)&&(r.add(f),n.push(f))}s??=l}return{nodes:e,treeNodes:s}}function Ot(t,e){for(let n of t)n[H]=e}function ao(t,e){let n=t.constructor,r=new n(t.name,t.value,t.namespaceURI);return r[H]=e,r}function lo(t,e){if(lr(t))return e.createTextNode(t.data);if(Js(t))return e.createComment(t.data);if(Zs(t))return ao(t,e);if(Z(t)){let n=e[Ye](t[C],t.namespaceURI,t[xe],t.localName);if(t[fe])for(let r=0;r<t[fe].length;r++){let o=t[fe].item(r);n.attributes.setNamedItem(ao(o,e))}return n}else{if(ar(t))return e.createDocumentFragment();{let n=new t.constructor;return n[H]=e,n}}}function tn(t,e,n=t.ownerDocument){if(t.nodeType===De)throw L(\"Cannot clone a document node\",\"NotSupportedError\");let r=lo(t,n);if(!e||!Z(t)&&!ar(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,d;if(i.cloningContent)if(i.contentSource&&i.contentDestination)l=i.contentSource.childNodes[i.childIndex++],d=i.contentDestination;else{s.pop(),i.appendTo&&i.appendTo.appendChild(i.destination);continue}else if(l=i.source.childNodes[i.childIndex++],d=i.destination,!l){if(i.cloningContent=!0,i.childIndex=0,Z(i.source)&&i.source.namespaceURI===I&&i.source.localName===\"template\"){let f=i.source[he];f&&(o.has(f)&&co(),o.add(f),i.contentSource=f,i.contentDestination=i.destination.content)}continue}if(!l){s.pop(),i.appendTo&&i.appendTo.appendChild(i.destination);continue}o.has(l)&&co(),o.add(l);let c=lo(l,n);Z(l)||ar(l)?s.push({source:l,destination:c,appendTo:d,childIndex:0,cloningContent:!1}):d.appendChild(c)}return r}function co(){throw new Error(\"Cannot clone a cyclic or repeated node graph\")}function nn(t,e){let n=String(e);return n===\"\"?null:Jt(t,[{type:Kt,name:n}])}function rn(t,e){let n=[...new Set(Ut(String(e)))];return Qt(t,n.map(r=>({type:Zt,name:r})))}function on(t,e){let n=String(e),r=z(n),o=[];for(let s of sn(t))Z(s)&&(n===\"*\"||(s.namespaceURI===I?s[C]===r:s[C]===n))&&o.push(s);return o}function sn(t){let e=[],n=[],r=t[_];for(;r;){e.push(r);let o=r[_],s=r[v];o?(s&&n.push(s),r=o):r=s??n.pop()??null}return e}function At(t){let e=sn(t);return e.unshift(t),e}var le=class extends Ae{nodeType=Yr;[C]=\"\";[ee]=null;[Se]=null;[_]=null;[$]=null;[v]=null;[B]=!1;get[G](){return this[H].defaultView[Ie]}get localName(){return this[C]}get nodeName(){return this[C]}get ownerDocument(){return this[H]}get isConnected(){return this[B]}isDefaultNamespace(e){let n=ge(e);return Qs(this)===n}get parentNode(){return this[ee]}set parentNode(e){}get parentElement(){let e=this[ee];return!e||e.nodeType!==1?null:e}set parentElement(e){}get previousSibling(){return this[$]}set previousSibling(e){}get nextSibling(){return this[v]}set nextSibling(e){}get previousElementSibling(){let e=this[$];for(;e&&e.nodeType!==1;)e=e[$];return e}set previousElementSibling(e){}get nextElementSibling(){let e=this[v];for(;e&&e.nodeType!==1;)e=e[v];return e}set nextElementSibling(e){}get firstChild(){return this[_]}set firstChild(e){}get lastChild(){let e=this[_];for(;e;){let n=e[v];if(n==null)break;e=n}return e}set lastChild(e){}get nodeValue(){return St(this)?this.data:null}set nodeValue(e){St(this)&&(this.data=e)}get textContent(){if(St(this))return this.data;let e=\"\";for(let n of sn(this))lr(n)&&(e+=n.data);return e}set textContent(e){if(St(this))this.data=e;else if(uo(this)){let n=e==null?\"\":String(e);n===\"\"?this.replaceChildren():this.replaceChildren(n)}}cloneNode(e){return tn(this,e)}contains(e){let n=e;for(;n!=null;){if(n===this)return!0;n=n.parentNode}return!1}};function Qs(t){let e=t;for(;e;)switch(e.nodeType){case ne:{let n=e;if(n.prefix==null&&n.namespaceURI!=null)return n.namespaceURI;let r=n.attributes.getNamedItemNS(gt,\"xmlns\");if(r!=null&&r.prefix==null)return ge(r.value);e=n.parentElement;break}case De:e=e.documentElement;break;case Wr:case Oe:return null;case We:e=e.ownerElement;break;default:e=e.parentElement}return null}var ce=Symbol(\"insertNode\"),ur=Symbol(\"preflightInsertions\"),an=Symbol(\"replaceNode\"),ke=class extends le{remove(){let e=this.parentNode;e&&e.removeChild(this)}replaceWith(...e){let n=Le(e),r=this.parentNode;if(r)return cr(o=>{ye(r,n);let s=this[v];for(;s&&n.includes(s);)s=s[v];let i=dr(r,n,o);this.parentNode===r?r[an](i,this,o):r[ce](i,s,o)})}before(...e){let n=Le(e),r=this.parentNode;if(r)return cr(o=>{ye(r,n);let s=this[$];for(;s&&n.includes(s);)s=s[$];let i=dr(r,n,o);r[ce](i,s?s[v]:r.firstChild,o)})}after(...e){let n=Le(e),r=this.parentNode;if(r)return cr(o=>{ye(r,n);let s=this[v];for(;s&&n.includes(s);)s=s[v];let i=dr(r,n,o);r[ce](i,s,o)})}};function cr(t){return W(()=>{let e=[];try{t(e)}catch(n){try{Me(e)}catch{}throw n}Me(e)})}function Le(t){return t.map(e=>e instanceof le?e:String(e))}function kt(t,e){return e instanceof le?e:t.ownerDocument.createTextNode(String(e))}function ye(t,e){for(let n of e){if(!(n instanceof le))continue;let r=t;for(;r;){if(r===n)throw L(\"Cannot insert a node into itself or one of its descendants\",\"HierarchyRequestError\");r=r[ee]??r[Se]}}}function dr(t,e,n){let r=[];for(let s of e)r.push(kt(t,s));if(r.length===1)return r[0];let o=t.ownerDocument.createDocumentFragment();o[ur](r);for(let s of r)o[ce](s,null,n);return o}var ln,fr=0,fo=0,po=0,mo=0,Ke=!1,mr=!1,Rt=!1,cn=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=ei(n),o=ln??=new WeakMap,s=o.get(e);s==null&&(s=new Map,o.set(e,s));let i=s.get(this);i==null?fr++:pr(i,-1),s.set(this,r),pr(r,1),this.#e.add(e)}disconnect(){let e=ln;if(e!=null){for(let n of this.#e){let r=e.get(n),o=r?.get(this);o!=null&&(r.delete(this),fr--,pr(o,-1)),r?.size===0&&e.delete(n)}this.#e.clear(),this.#n.length=0,fr===0&&(ln=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 de(t){let e=ln;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 ae,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 ae,target:t.target,type:t.type})}function dn(...t){let e=new ae;return e.push(...t),e}function ei(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 pr(t,e){t.attributes&&(fo+=e),t.characterData&&(po+=e),t.childList&&(mo+=e),Ke=fo>0,mr=po>0,Rt=mo>0}var pe=class extends ke{childNodes=new ae;children=new ae;appendChild(e){return W(()=>this[ce](e,null))}insertBefore(e,n){return W(()=>this[ce](e,n||null))}append(...e){return W(()=>{let n=Le(e.filter(r=>r!=null));n.length>1&&ye(this,n);for(let r of n)this[ce](kt(this,r),null)})}prepend(...e){return W(()=>{let n=Le(e.filter(o=>o!=null));n.length>1&&ye(this,n);let r=this.firstChild;for(let o of n)this[ce](kt(this,o),r)})}replaceChildren(...e){return W(()=>{let n=Le(e.filter(o=>o!=null));ye(this,n);let r;for(;r=this.firstChild;)this.removeChildImmediately(r);for(let o of n)this[ce](kt(this,o),null)})}removeChild(e){return W(()=>(this.removeChildImmediately(e),e))}removeChildImmediately(e){if(e.parentNode!==this)throw L(\"The node is not a child of this node\",\"NotFoundError\");let n=this[B]?At(e):void 0,r=e[$],o=e[v],s=un(this,e);if(n)for(let i of n)i[B]=!1;this.queueRemovalMutationRecord(this,e,r,o),n&&this.enqueueTreeReactions(n,\"disconnectedCallback\"),Me(this.collectRemovalHookEffects(e,s))}replaceChild(e,n){return W(()=>this[an](e,n))}[an](e,n,r){if(ye(this,[e]),n.parentNode!==this)throw L(\"The reference node is not a child of this parent\",\"NotFoundError\");let o=n[$],s=n[v],i=this.prepareInsertion(e),l=this[B]?At(n):void 0,d=new Set(i.map(({node:u})=>u)),c=s;for(;c&&d.has(c);)c=c[v];let f=un(this,n);if(l){for(let E of l)E[B]=!1;let u=new Set(l);for(let E of i)u.has(E.node)&&(E.shouldDisconnect=!1)}this.commitInsertion(i,c);let w=this[B];return this.queueRemovalMutationRecord(this,n,o,s),this.queueInsertionMutationRecords(i),l&&this.enqueueTreeReactions(l,\"disconnectedCallback\"),this.enqueueInsertionReactions(i,w),this.performOrCollectHookEffects([...this.collectRemovalHookEffects(n,f),...this.collectInsertionHookEffects(i)],r),n}querySelectorAll(e){return Qt(this,e)}querySelector(e){return Jt(this,e)}[ce](e,n,r){return this.validateInsertion(e,n),this.insertIntoValidated(e,n,r),e}[ur](e){for(let n of e)this.validateInsertion(n,null),this.prepareInsertion(n)}validateInsertion(e,n){if(ye(this,[e]),n&&n.parentNode!==this)throw L(\"The reference node is not a child of this parent\",\"NotFoundError\")}insertIntoValidated(e,n,r){e===n&&(n=e[v]);let o=this.prepareInsertion(e);this.commitInsertion(o,n);let s=this[B];this.queueInsertionMutationRecords(o),this.enqueueInsertionReactions(o,s),this.performOrCollectHookEffects(this.collectInsertionHookEffects(o),r)}performOrCollectHookEffects(e,n){n?n.push(...e):Me(e)}prepareInsertion(e){let n=[];if(e.nodeType===Oe){let i=e[_];for(;i;)n.push(i),i=i[v]}else n.push(e);let r=this[B],o=this[H],s=[];for(let i of n){let l=i[B],d=l||r,c,f;if(i[H]===o)d&&(c=At(i));else{let w=en(i);f=w.nodes,d&&(c=w.treeNodes)}s.push({node:i,nodes:c,adoption:f,shouldDisconnect:l})}return s}commitInsertion(e,n){for(let s of e){let i=s.node[ee];if(i){let l=s.node[$],d=s.node[v];s.source={parent:i,index:un(i,s.node),previousSibling:l,nextSibling:d}}}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[H];for(let{adoption:s}of e)s&&Ot(s,r);let o=this[B];for(let{nodes:s}of e)if(s)for(let i of s)i[B]=o}attachChild(e,n){if(n){let s=n[$];e[v]=n,e[$]=s,s?s[v]=e:this[_]=e,n[$]=e}else{e[v]=null;let s=this[_];if(s){let i;for(;i=s[v];)s=i;s[v]=e,e[$]=s}else this[_]=e,e[$]=null}let r=Z(e);e[ee]=this;let o;if(n){if(o=this.childNodes.indexOf(n),this.childNodes.splice(o,0,e),r){let s=n;for(;s&&!Z(s);)s=s[v];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[$],nextSibling:e[v]}}queueRemovalMutationRecord(e,n,r,o){Rt&&de({type:\"childList\",target:e,removedNodes:dn(n),previousSibling:r,nextSibling:o})}queueInsertionMutationRecords(e){if(Rt)for(let n of e){let{node:r,source:o}=n;o&&this.queueRemovalMutationRecord(o.parent,r,o.previousSibling,o.nextSibling),de({type:\"childList\",target:this,addedNodes:dn(r),previousSibling:n.previousSibling,nextSibling:n.nextSibling})}}collectRemovalHookEffects(e,n){return this.nodeType!==ne||Et(this)?[]:[[()=>this[G].removeChild?.(this,e,n)]]}collectInsertionHookEffects(e){let n=[];for(let r of e){let{node:o,source:s}=r;s?.parent.nodeType===ne&&!Et(s.parent)&&n.push([()=>s.parent[G].removeChild?.(s.parent,o,s.index)]),this.nodeType===ne&&!Et(this)&&n.push([()=>this[G].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){go(e,n)}};function ho(t,e,n,r){if(e.parentNode!==t)throw Error(\"not a child of this node\");let o=t[B]?n.treeNodes:void 0,s=e[$],i=e[v],l=un(t,e);if(o)for(let c of o)c[B]=!1;Ot(n.nodes,r),Rt&&de({type:\"childList\",target:t,removedNodes:dn(e),previousSibling:s,nextSibling:i}),o&&go(o,\"disconnectedCallback\");let d=[];t.nodeType===ne&&!Et(t)&&d.push([()=>t[G].removeChild?.(t,e,l)]),Me(d)}function un(t,e){let n=e[$],r=e[v];n?n[v]=r:t[_]=r,r&&(r[$]=n);let o=t.childNodes.indexOf(e);return t.childNodes.splice(o,1),Z(e)&&t.children.splice(t.children.indexOf(e),1),e[ee]=null,e[v]=null,e[$]=null,o}function go(t,e){for(let n of t){let r=n[e];typeof r==\"function\"&&Bt(n,()=>r.call(n))}}function Ct(t,e,n,r,o){let{observedAttributes:s}=t.constructor,{attributeChangedCallback:i}=t;i==null||s==null||!s.includes(e)||Bt(t,()=>i.call(t,e,n,r,o))}var fn=class{[_]=null;constructor(e){this[Q]=e}getNamedItem(e){let n=String(e),r=this[Q][P]===I?z(n):n,o=this[_];for(;o;){if(o.name===r)return o;o=o[v]}return null}getNamedItemNS(e,n){let r=ge(e),o=String(n),s=this[_];for(;s;){if(s.localName===o&&s[P]===r)return s;s=s[v]}return null}item(e){let n=this[_],r=0;for(;n;){if(r++===e)return n;n=n[v]}return null}get length(){let e=0,n=this[_];for(;n;)e++,n=n[v];return e}removeNamedItem(e){let n=String(e),r=this[Q][P]===I?z(n):n;return W(()=>this.removeNamedItemImmediately(o=>o.name===r))}removeNamedItemNS(e,n){let r=ge(e),o=String(n);return W(()=>this.removeNamedItemImmediately(s=>s.localName===o&&s[P]===r))}removeNamedItemImmediately(e){let n=this[Q],r=this[_],o=null;for(;r!=null;){if(e(r)){o&&(o[v]=r[v]),this[_]===r&&(this[_]=r[v]);let s=r.value;return r[v]=null,r[Q]=null,Ke&&de({type:\"attributes\",target:n,attributeName:r.name,attributeNamespace:r[P],oldValue:s}),n[G].removeAttribute?.(n,r.name,r[P]),Ct(n,r.localName,s,null,r[P]),r}o=r,r=r[v]}return null}setNamedItem(e){return W(()=>this.setNamedItemImmediately(e))}setNamedItemImmediately(e){let n=this[Q],r=e[Q];if(r!=null&&r!==n)throw L(\"The attribute is already in use by another element.\",\"InUseAttributeError\");let o=null,s=this[_],i=null;for(;s;){if(s.localName===e.localName&&s[P]===e[P]){if(s===e)return s;i?i[v]=e:this[_]=e,e[v]=s[v],s[v]=null,o=s;break}i=s,s=s[v]}o==null&&(i?i[v]=e:this[_]=e),e[Q]=n,e[H]=n[H],o&&(o[Q]=null);let l=o==null||o.value!==e.value,d=o!=null&&o.name!==e.name;return l&&Ke&&de({type:\"attributes\",target:n,attributeName:e.name,attributeNamespace:e[P],oldValue:o?.value??null}),d&&n[G].removeAttribute?.(n,o.name,o[P]),(l||d)&&n[G].setAttribute?.(n,e.name,e.value,e[P]),l&&Ct(n,e.localName,o?.value??null,e.value,e[P]),o}setNamedItemNS(e){return this.setNamedItem(e)}*[Symbol.iterator](){let e=this[_];for(;e;)yield e,e=e[v]}};var He=class extends le{nodeType=We;[P]=null;[v]=null;[Q]=null;constructor(e,n,r){super(),this[C]=e,this[ve]=n,r&&(this[P]=r)}get nodeName(){return this[C]}set nodeName(e){}get name(){return this[C]}set name(e){}get localName(){if(this[P]==null)return this[C];let e=this[C].indexOf(\":\");return e<0?this[C]:this[C].slice(e+1)}get prefix(){if(this[P]==null)return null;let e=this[C].indexOf(\":\");return e<0?null:this[C].slice(0,e)}get value(){return this[ve]}set value(e){let n=String(e),r=this[Q];if(!r){this[ve]=n;return}W(()=>{let o=this[ve];this[ve]=n,Ke&&o!==n&&de({type:\"attributes\",target:r,attributeName:this[C],attributeNamespace:this[P],oldValue:o}),this[G].setAttribute?.(r,this[C],n,this[P]),Ct(r,this.localName,o,n,this[P])})}get nodeValue(){return this.value}set nodeValue(e){this.value=e}get ownerElement(){return this[Q]}get namespaceURI(){return this[P]}get specified(){return!0}};var ti={amp:\"&\",AMP:\"&\",apos:\"'\",gt:\">\",GT:\">\",lt:\"<\",LT:\"<\",quot:'\"',QUOT:'\"'},ni=new Set([\"area\",\"base\",\"br\",\"col\",\"embed\",\"hr\",\"img\",\"input\",\"link\",\"meta\",\"param\",\"source\",\"track\",\"wbr\"]),ri=/(?:<([a-z][a-z0-9-:]*)((?:[\\s]+[^<>'\"=/\\s]+(?:=(['\"])[^]*?\\3|=[^>'\"\\s]*|))*)[\\s]*(\\/?)\\s*>|<\\/([a-z][a-z0-9-:]*)>|<!--(.*?)-->|([^<>]+))/gi,Eo=/\\s([^<>'\"=/\\n\\s]+)(?:=([\"'])([\\s\\S]*?)\\2|=([^>'\"\\n\\s]*)|)/g,oi=\"|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|\",si=/^(?:color|face|size)$/i;function yo(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 ti[n];let s=Number.parseInt(r??o,r?10:16);try{return String.fromCodePoint(s)}catch{return e}})}function wo(t){return t.namespaceURI===I&&ni.has(t.localName)}function bo(t){let e=t.localName;return t[P]===ie&&(e===\"foreignObject\"||e===\"desc\"||e===\"title\")}function ii(t,e){if(oi.includes(`|${t}|`))return!0;if(t!==\"font\")return!1;for(let n of e.matchAll(Eo))if(si.test(n[1]))return!0;return!1}function pn(t,e){let n=e.ownerDocument,r=n.createDocumentFragment(),o=[],s=r;for(let i of t.matchAll(ri)){let l=i[1];if(l){let d=i[2],c=z(l),f=o[o.length-1]?.element??e,w=f[P]===ie?ie:I;if(c===\"svg\")w=ie;else if(w===ie){if(bo(f))w=I;else if(ii(c,d)){for(;o.length>0;){let N=o[o.length-1];if(N.element[P]!==ie||bo(N.element))break;o.pop(),s=N.target}w=I}}let u=w===I?c:l,E=n[Ye](u,w,null,u);for(let N of d.matchAll(Eo))E.setAttribute(N[1],yo(N[3]||N[4]||\"\"));if(s.append(E),wo(E)||w!==I&&i[4])continue;o.push({element:E,target:s}),s=w===I&&c===\"template\"?E.content:E}else if(i[5]){let d=z(i[5]);for(let c=o.length-1;c>=0;c--){let f=o[c],w=z(f.element[C]);if(w===d){s=f.target,o.length=c;break}if(f.element[P]===I&&w===\"template\")break}}else i[6]?s.append(n.createComment(i[6])):s.append(yo(i[7]))}return r}function mn(t){return To([{type:\"content\",child:t[_]}])}function No(t){return To([{type:\"opening\",node:t}])}function To(t){let e=[],n;for(;n=t.pop();)switch(n.type){case\"opening\":{let r=n.node;switch(r.nodeType){case ne:{let o=r;e.push(`<${o[C]}`);let s=o[fe]?.[_];for(;s;){e.push(` ${s[C]}`);let l=s[ve];l!==\"\"&&(l=String(l).replace(/&/g,\"&amp;\").replace(/\"/g,\"&quot;\"),e.push(`=\"${l}\"`)),s=s[v]}if(e.push(\">\"),wo(o))break;let i=o.namespaceURI===I&&o.localName===\"template\"?o[he]:o;t.push({type:\"closing\",name:o[C]}),t.push({type:\"content\",child:i?.[_]??null});break}case qe:{let o=r;e.push(o[se].replace(/&/g,\"&amp;\").replace(/\"/g,\"&quot;\").replace(/</g,\"&lt;\").replace(/>/g,\"&gt;\"));break}case Xe:{let o=r;e.push(`<!--${o[se]}-->`);break}}break}case\"content\":{let r=n.child;r&&(t.push({type:\"content\",child:r[v]}),t.push({type:\"opening\",node:r}));break}case\"closing\":e.push(`</${n.name}>`);break}return e.join(\"\")}var F=class extends pe{nodeType=ne;[P]=I;[xe]=null;get namespaceURI(){return this[P]}get prefix(){return this[xe]}get localName(){let e=this[xe];return e==null?this[C]:this[C].slice(e.length+1)}get nodeName(){return this[P]===I?Xr(this[C]):this[C]}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 He(\"slot\",n))}get attributes(){let e=this[fe];return e||(e=new fn(this),this[fe]=e),e}getAttributeNames(){return[...this.attributes].map(e=>e.name)}getElementsByTagName(e){return on(this,e)}get firstElementChild(){return this.children[0]??null}getElementsByClassName(e){return rn(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);Kn(r);let s=this[P]===I?z(r):r,i=this.attributes.getNamedItemNS(null,s);i?i.value=o:this.attributes.setNamedItem(new He(s,o))}setAttributeNS(e,n,r){let o=ge(e),s=String(n),i=String(r),l=jt(o,s,\"attribute\"),d=this.attributes.getNamedItemNS(l.namespace,l.localName);d?d.value=i:this.attributes.setNamedItemNS(new He(l.qualifiedName,i,l.namespace))}toggleAttribute(e,n){let r=String(e);Kn(r);let o=this[P]===I?z(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 He(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[P]===I?z(n):n;this.attributes.removeNamedItemNS(null,r)}removeAttributeNS(e,n){this.attributes.removeNamedItemNS(e,n)}get outerHTML(){return No(this)}get innerHTML(){return mn(this)}set innerHTML(e){if(e==null||e===\"\")this.replaceChildren();else{let n=pn(String(e),this);this.replaceChildren(n)}}};var Ze=class t extends F{[P]=ie;get ownerSVGElement(){let e=null,n=this.parentNode;for(;n instanceof t;)e=n,n=n.parentNode;return e}};var Re=class extends ke{[se]=\"\";constructor(e){super(),this[se]=e==null?\"\":String(e)}setData(e){let n=mr,r=n?this[se]:null,o=\"\";e!=null&&(o=typeof e==\"string\"?e:String(e)),this[se]=o,n&&r!==o&&de({type:\"characterData\",target:this,oldValue:r}),this[G].setText?.(this,o)}get data(){return this[se]}set data(e){this.setData(e)}};var Je=class extends Re{nodeType=qe;[C]=\"#text\"};var Qe=class extends Re{nodeType=Xe;[C]=\"#comment\"};var et=class extends pe{nodeType=Oe;[C]=\"#document-fragment\";[H]=typeof window<\"u\"?window.document:null;getElementById(e){return nn(this,e)}};var tt=class extends F{get content(){let e=this[he];return e||(e=this.ownerDocument.createDocumentFragment(),e[Se]=this,this[he]=e),e}set content(e){}set innerHTML(e){this.content.replaceChildren(pn(String(e),this))}get innerHTML(){let e=this[he];return e?mn(e):\"\"}};var hn=class extends F{};var gn=class extends F{};var yn=class extends F{};var Pt=class extends pe{nodeType=De;[C]=\"#document\";[B]=!0;constructor(e){super(),this.defaultView=e,this[H]=this,this.documentElement=En(new yn,this,\"html\"),this.body=En(new hn,this,\"body\"),this.head=En(new gn,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 rn(this,e)}createElement(e){let n=String(e);return Jr(n),hr(this,z(n))}createElementNS(e,n){let r=jt(e,n,\"element\");return hr(this,r.qualifiedName,r.namespace,r.prefix,r.localName)}[Ye](e,n,r,o){return hr(this,e,n,r,o)}createTextNode(e){let n=bn(new Je(e),this);return this[G].createText?.(n,n.data),n}createComment(e){return bn(new Qe(e),this)}createDocumentFragment(){return bn(new et,this)}createEvent(){return new Y(\"\")}getElementById(e){return nn(this,e)}getElementsByTagName(e){return on(this,e)}importNode(e,n){if(e.nodeType===De)throw L(\"Cannot import a document node\",\"NotSupportedError\");return tn(e,n,this)}adoptNode(e){if(e[H]===this)return e;let n=en(e);return W(()=>{let r=e.parentNode;return r?ho(r,e,n,this):Ot(n.nodes,this),e})}};function bn(t,e){return Object.defineProperty(t,H,{value:e,writable:!0,enumerable:!1}),t}function hr(t,e,n=I,r=null,o=e){let s;if(n===ie)s=new Ze;else if(n===I&&o===\"template\")s=new tt;else if(n===I){let i=t.defaultView.customElements.get(o);s=i?new i:new F}else s=new F;return En(s,t,e,n,r)}function En(t,e,n,r=I,o=null){return bn(t,e),Object.defineProperties(t,{[C]:{value:n},[P]:{value:r},[xe]:{value:o}}),e[G].createElement?.(t,r),t}var wn=class extends Y{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 Nn=class extends Y{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 Tn=class extends Y{constructor(e,n){super(e,n),this.promise=n.promise,this.reason=n.reason}};var xn=class extends Y{constructor(e,n){super(e,n),this.oldState=n.oldState,this.newState=n.newState}};var vn=class extends Y{constructor(e,n={}){super(e,n),this.relatedTarget=n.relatedTarget??null}};var Sn=class extends Y{constructor(e,n={}){super(e,n),this.clipboardData=n.clipboardData??null}};var On=class extends F{};var ai=/^[a-z][^A-Z\\u0000\\t\\n\\f\\r />]*-[^A-Z\\u0000\\t\\n\\f\\r />]*$/u,li=new Set([\"annotation-xml\",\"color-profile\",\"font-face\",\"font-face-src\",\"font-face-uri\",\"font-face-format\",\"font-face-name\",\"missing-glyph\"]);function xo(t){return ai.test(t)&&!li.has(t)}function vo(t){return L(`Invalid custom element name: \"${t}\"`,\"SyntaxError\")}var An=class{registry=new Map;listenersByName=new Map;define(e,n,r){if(!xo(e))throw vo(e);if(this.registry.has(e))throw L(`A custom element named \"${e}\" has already been defined`,\"NotSupportedError\");if(this.getName(n)!=null)throw L(\"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(!xo(e))return Promise.reject(vo(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 ci=[\"onerror\",\"onunhandledrejection\"],Oo=Symbol.for(\"@remote-dom/polyfill/global-property\");function Ao(t){return Object.getOwnPropertyDescriptors(t)}function ko(t){let e={};for(let[n,r]of Object.entries(Object.getOwnPropertyDescriptors(Ae.prototype)))n!==\"constructor\"&&typeof r.value==\"function\"&&(r.value=gr(r.value.bind(t)),e[n]=r);return e}function Ro(t){let e={};for(let n of ci)e[n]={configurable:!0,enumerable:!0,get:gr(()=>t[n]),set:gr(r=>{t[n]=r})};return e}function di(t){return Object.assign(Ao(t),ko(t),Ro(t))}function gr(t){return Object.defineProperty(t,Oo,{value:!0}),t}function So(t,e){for(let n of Reflect.ownKeys(e)){let r=ui(t,n);(r==null||fi(r))&&Object.defineProperty(t,n,e[n])}}function ui(t,e){let n=t;for(;n;){let r=Object.getOwnPropertyDescriptor(n,e);if(r)return r;n=Object.getPrototypeOf(n)}}function fi(t){return[t.value,t.get,t.set].some(e=>typeof e==\"function\"&&e[Oo]===!0)}var $e=class extends Ae{[G]={};[Gt]=[];[Ie]=mi(this);name=\"\";window=this;parent=this;self=this;top=this;document=new Pt(this);customElements=new An;location=globalThis.location;navigator=globalThis.navigator;Event=Y;ErrorEvent=Nn;PromiseRejectionEvent=Tn;ToggleEvent=xn;FocusEvent=vn;ClipboardEvent=Sn;EventTarget=Ae;CustomEvent=wn;Node=le;ParentNode=pe;ChildNode=ke;DocumentFragment=et;Document=Pt;CharacterData=Re;Comment=Qe;Text=Je;Element=F;HTMLElement=On;SVGElement=Ze;HTMLTemplateElement=tt;MutationObserver=cn;#t=null;#n=null;#e=null;static with(...e){let n=this;return class extends n{constructor(){super();for(let o of e)pi(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=Ao(e),s=Object.assign(ko(e),Ro(e));delete o.self,Object.defineProperties(globalThis,o),So(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),So(n,s))}static setGlobalThis(e){for(let n in e)e[n]===e&&(e[n]=globalThis);Object.defineProperties(globalThis,di(e))}};function pi(t,e){t[Gt].push(e(t)??{})}function mi(t){return{createElement:be.bind(null,t,\"createElement\"),setAttribute:be.bind(null,t,\"setAttribute\"),removeAttribute:be.bind(null,t,\"removeAttribute\"),createText:be.bind(null,t,\"createText\"),setText:be.bind(null,t,\"setText\"),insertChild:be.bind(null,t,\"insertChild\"),removeChild:be.bind(null,t,\"removeChild\"),addEventListener:be.bind(null,t,\"addEventListener\"),removeEventListener:be.bind(null,t,\"removeEventListener\")}}function be(t,e,...n){for(let s of t[Gt])s[e]?.apply(s,n);let r=t[G];r[e]?.apply(r,n)}var kn=new $e;var yr=\"~\";var Ce=new WeakMap;function nt(t){return Ce.get(t)}var Nr=new WeakMap,gi=0;function oe(t){let e=Nr.get(t);return e==null&&(e=String(gi++),Rn(t,e)),e}function Rn(t,e){Nr.set(t,e)}var Er=new WeakMap;function yi(t){return Er.get(t)}var wr=new WeakMap;function bi(t){let e=wr.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 Ei=new WeakMap;function wi(t){return Ei.get(t)}function Tr(t,e,n){let r=Er.get(t);if(r==null&&(r={},Er.set(t,r)),r[e]===n)return;r[e]=n;let o=Ce.get(t);o?.mutate([[3,oe(t),e,n,1]])}function Pe(t,e,n){let r=wr.get(t);if(r==null&&(r={},wr.set(t,r)),r[e]===n)return;n==null?delete r[e]:r[e]=String(n);let o=Ce.get(t);o?.mutate([[3,oe(t),e,n,2]])}function rt(t,e){if(Ce.get(t)!==e&&(Ce.set(t,e),t.childNodes))for(let r=0;r<t.childNodes.length;r++)rt(t.childNodes[r],e)}function Cn(t){if(Ce.get(t)!=null&&(Ce.delete(t),t.childNodes))for(let n=0;n<t.childNodes.length;n++)Cn(t.childNodes[n])}function ot(t){let{nodeType:e}=t;switch(e){case 1:return{id:oe(t),type:e,element:t.localName,properties:br(yi(t)),attributes:br(bi(t)),eventListeners:br(wi(t)),children:Array.from(t.childNodes).map(ot)};case 3:case 8:return{id:oe(t),type:e,data:t.data};default:throw new Error(`Cannot serialize node of type ${t.nodeType} (${typeof t.nodeType})`)}}function br(t){return t?{...t}:void 0}function xr(t,e,...n){let r=Nr.get(t),o=Ce.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 st=kn[G];st.insertChild=(t,e,n)=>{let r=nt(t);r!=null&&(rt(e,r),r.mutate([[0,oe(t),ot(e),n]]))};st.removeChild=(t,e,n)=>{let r=nt(t);r!=null&&(Cn(e),r.mutate([[1,oe(t),n]]))};st.setText=(t,e)=>{let n=nt(t);n?.mutate([[2,oe(t),e]])};st.setAttribute=(t,e,n)=>{t.tagName.includes(\"-\")||Pe(t,e,n)};st.removeAttribute=(t,e)=>{t.tagName.includes(\"-\")||Pe(t,e)};$e.setGlobal(kn);var _o=[\"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\"],Io=[\"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\"],Do=[\"self\",\"postMessage\",\"setTimeout\",\"clearTimeout\",\"setInterval\",\"clearInterval\",\"queueMicrotask\",\"structuredClone\",\"crypto\",\"console\",\"DOMException\"],Mo=[\"TEMPORARY\",\"PERSISTENT\"],Gd=Object.freeze([..._o,...Io,...Do,...Mo]),Ud=Object.freeze([\"constructor\",\"__defineGetter__\",\"__defineSetter__\",\"hasOwnProperty\",\"__lookupGetter__\",\"__lookupSetter__\",\"isPrototypeOf\",\"propertyIsEnumerable\",\"toString\",\"valueOf\",\"__proto__\",\"toLocaleString\"]),Po=t=>typeof t==\"symbol\"?`[${t.description??\"symbol\"}]`:t;function Lo(t=globalThis,e=[],n={}){let r=[],o=[],s=new Set([..._o,...Io,...Do,...e,\"constructor\",Symbol.toStringTag]),i=(m,p)=>{let b=Reflect.getOwnPropertyDescriptor(m,p);return b===void 0||!(\"value\"in b)||b.writable||b.configurable?!1:n.primitivesStay&&typeof p==\"symbol\"&&(typeof b.value!=\"object\"||b.value===null)&&typeof b.value!=\"function\"?!0:Mo.includes(p)&&typeof b.value==\"number\"},l=t,d=l.setTimeout,c=l.setInterval,f=l.crypto,w=(m,p)=>function(b,O,...D){if(typeof b!=\"function\")throw new TypeError(`${p} takes a function: a guest view cannot run code from text`);return m.call(t,b,O,...D)},u=f?Object.freeze({getRandomValues:m=>f.getRandomValues(m)}):void 0,E=l.document?.defaultView;if(E&&E!==l)for(let m of Reflect.ownKeys(E))typeof m==\"symbol\"||s.has(m)||Reflect.deleteProperty(E,m)||o.push(`window.${m}`);let N=[];for(let m=t;m&&m!==Object.prototype;m=Object.getPrototypeOf(m))N.push(m);for(let m of N)for(let p of Reflect.ownKeys(m))s.has(p)||(Reflect.deleteProperty(m,p)?r.push(Po(p)):i(m,p)||o.push(Po(p)));let x=()=>function(){throw new EvalError(\"A guest view cannot make code from text.\")},h=[Function.prototype,Object.getPrototypeOf(async function(){}),Object.getPrototypeOf(function*(){}),Object.getPrototypeOf(async function*(){})];for(let m of h){let p=x();Object.defineProperty(p,\"prototype\",{value:m,writable:!1,enumerable:!1,configurable:!1}),Reflect.defineProperty(m,\"constructor\",{value:p,writable:!1,enumerable:!1,configurable:!1})||o.push(\"Function.prototype.constructor\"),m===Function.prototype&&Reflect.defineProperty(t,\"Function\",{value:p,writable:!0,enumerable:!1,configurable:!0})}let a=(m,p)=>{Reflect.defineProperty(t,m,{value:p,writable:!0,enumerable:!0,configurable:!0})||o.push(m)};a(\"setTimeout\",w(d,\"setTimeout\")),a(\"setInterval\",w(c,\"setInterval\")),u&&a(\"crypto\",u);for(let m of N.slice(1))Object.freeze(m);for(let m of Reflect.ownKeys(t)){let p=Reflect.getOwnPropertyDescriptor(t,m);Reflect.defineProperty(t,m,\"value\"in p?{...p,writable:!1,configurable:!1}:{...p,configurable:!1})}let g;try{g=Reflect.preventExtensions(t)}catch{g=!1}return{removed:r,stuck:o,sealed:g}}var _t=class extends HTMLElement{constructor(){super(),Rn(this,yr)}connect(e){if(nt(this)===e||(rt(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,yr,ot(o),r])}e.mutate(n)}updateRemoteProperty(e,n){Tr(this,e,n)}callRemoteMethod(e,...n){return xr(this,e,...n)}};var T={},Pn={empty:!0},Ni={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\"},at={div:T,section:T,article:T,aside:T,header:T,footer:T,nav:T,hgroup:T,search:T,address:T,figure:T,figcaption:T,blockquote:T,p:T,pre:T,hr:Pn,br:Pn,wbr:Pn,h1:T,h2:T,h3:T,h4:T,h5:T,h6:T,span:T,strong:T,em:T,b:T,i:T,u:T,s:T,small:T,mark:T,abbr:T,cite:T,q:T,code:T,kbd:T,samp:T,var:T,sub:T,sup:T,dfn:T,bdi:T,bdo:T,ruby:T,rt:T,rp:T,time:{attributes:{datetime:\"text\"}},data:{attributes:{value:\"text\"}},del:{attributes:{datetime:\"text\"}},ins:{attributes:{datetime:\"text\"}},a:{attributes:{href:\"link\"}},ul:T,menu:T,dl:T,dt:T,dd:T,ol:{attributes:{start:\"number\",reversed:\"boolean\",type:{oneOf:[\"1\",\"a\",\"A\",\"i\",\"I\"]}}},li:{attributes:{value:\"number\"}},table:T,caption:T,thead:T,tbody:T,tfoot:T,tr:T,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:T,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:T,output:T,meter:{attributes:{value:\"number\",min:\"number\",max:\"number\",low:\"number\",high:\"number\",optimum:\"number\"}},progress:{attributes:{value:\"number\",max:\"number\"}},img:{empty:!0,attributes:{src:\"image\",alt:\"text\",width:\"number\",height:\"number\",decoding:{oneOf:[\"async\",\"sync\",\"auto\"]}}},\"graview-video\":Pn},Ti=[\"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\"],xi={id:\"text\",class:\"text\",style:\"style\",lang:\"text\",role:\"text\",tabindex:{oneOf:[\"-1\",\"0\"]},transform:\"geometry\",...Object.fromEntries(Ti.map(t=>[t,\"css\"]))},it={x:\"geometry\",y:\"geometry\",width:\"geometry\",height:\"geometry\"},_n={viewBox:\"geometry\",preserveAspectRatio:\"geometry\"},Ho={gradientUnits:{oneOf:[\"userSpaceOnUse\",\"objectBoundingBox\"]},gradientTransform:\"geometry\",spreadMethod:{oneOf:[\"pad\",\"reflect\",\"repeat\"]},href:\"fragment\"},In={svg:{attributes:{...it,..._n}},g:T,defs:T,symbol:{attributes:{...it,..._n,refX:\"geometry\",refY:\"geometry\"}},use:{attributes:{...it,href:\"fragment\"}},title:T,desc:T,path:{attributes:{d:\"geometry\",pathLength:\"number\"}},rect:{attributes:{...it,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\",...Ho}},radialGradient:{attributes:{cx:\"geometry\",cy:\"geometry\",r:\"geometry\",fx:\"geometry\",fy:\"geometry\",fr:\"geometry\",...Ho}},stop:{attributes:{offset:\"geometry\"}},clipPath:{attributes:{clipPathUnits:{oneOf:[\"userSpaceOnUse\",\"objectBoundingBox\"]}}},mask:{attributes:{...it,maskUnits:{oneOf:[\"userSpaceOnUse\",\"objectBoundingBox\"]},maskContentUnits:{oneOf:[\"userSpaceOnUse\",\"objectBoundingBox\"]}}},pattern:{attributes:{...it,..._n,patternUnits:{oneOf:[\"userSpaceOnUse\",\"objectBoundingBox\"]},patternContentUnits:{oneOf:[\"userSpaceOnUse\",\"objectBoundingBox\"]},patternTransform:\"geometry\",href:\"fragment\"}},marker:{attributes:{..._n,markerWidth:\"geometry\",markerHeight:\"geometry\",refX:\"geometry\",refY:\"geometry\",orient:\"geometry\",markerUnits:{oneOf:[\"strokeWidth\",\"userSpaceOnUse\"]}}}};var $o=[\"alert\",\"alertdialog\",\"dialog\",\"banner\",\"main\",\"navigation\",\"contentinfo\",\"complementary\",\"search\",\"form\",\"region\",\"application\",\"status\",\"log\",\"marquee\",\"timer\"],It={nav:\"div\",header:\"div\",footer:\"div\",aside:\"div\",search:\"div\",output:\"span\"},Dn={section:[\"aria-label\",\"aria-labelledby\",\"title\"]};function vi(t){return/^aria-[a-z]+$/.test(t)}function Si(t){return/^data-[a-z0-9][a-z0-9_.-]*$/.test(t)}var Go=[\"all\",\"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\"],Uo=[\"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\"],jo=[\"fill\",\"stroke\",\"clip-path\",\"mask\",\"marker\",\"marker-start\",\"marker-mid\",\"marker-end\"],Vo=[\"media\",\"supports\",\"container\",\"keyframes\"],zo={position:[\"static\",\"relative\",\"absolute\",\"sticky\"],all:[],appearance:[\"auto\",\"none\",\"menulist-button\",\"textfield\"],\"-webkit-appearance\":[\"auto\",\"none\",\"menulist-button\",\"textfield\"]},Fo=[\"host\",\"host-context\",\"slotted\",\"part\",\"backdrop\",\"picker\",\"view-transition\",\"view-transition-group\",\"view-transition-image-pair\",\"view-transition-old\",\"view-transition-new\"],Mn=64e3,vr=4e3,Bo=1e5,Dt=512e3,Sr=1e4,Yo=\"http://www.w3.org/1999/xhtml\",Wo=\"http://www.w3.org/2000/svg\",Oi=new Map(Object.keys(In).map(t=>[t.toLowerCase(),t]));function Ln(t){return Oi.get(t.toLowerCase())}function Hn(t,e,n){let r=n.toLowerCase(),o=t===\"html\"?[at[e]?.attributes,Ni]:[In[e]?.attributes,xi],s=t===\"svg\"&&r===\"xlink:href\"?\"href\":r;for(let i of o)if(i){for(let[l,d]of Object.entries(i))if(l.toLowerCase()===s)return{name:l,kind:d}}if(vi(r)||Si(r))return{name:r,kind:\"text\"}}function qo(t){if(typeof t==\"string\")return{type:\"navigate\",to:t};let{place:e,record:n,where:r,section:o}=t??{},s={...r===void 0?{}:{where:r},...o===void 0?{}:{section:String(o)}};return typeof e==\"string\"?{type:\"navigate\",place:e,...s}:typeof n==\"string\"?{type:\"navigate\",to:n,...s}:void 0}var Xo=[\"wheel\",\"drag\",\"pinch\"];var Ko=\"~\",$n=t=>typeof t==\"object\"&&t!==null&&!Array.isArray(t),me=(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=>me(n,e+1)):Object.fromEntries(Object.entries(t).map(([n,r])=>[n,me(r,e+1)]))};function Zo(){let t=new Map,e=new Map,n=new Map([[Ko,{children:[],listeners:new Map}]]),r=0,o=c=>{let f=e.get(c);return f===void 0&&(f=r+=1,e.set(c,f),t.set(f,{listener:c,count:0})),t.get(f).count+=1,f},s=c=>{let f=t.get(c);f&&(f.count-=1,!(f.count>0)&&(t.delete(c),e.delete(f.listener)))},i=c=>{let f=n.get(c);if(f){n.delete(c);for(let w of f.listeners.values())s(w);for(let w of f.children)i(w)}},l=(c,f,w=0)=>{if(!$n(c)||w>64)return me(c);let u=typeof c.id==\"string\"?c.id:void 0,E=f&&u!==void 0&&u!==Ko;E&&i(u);let N={children:[],listeners:new Map};E&&n.set(u,N);let x={};for(let[h,a]of Object.entries(c))h===\"children\"&&Array.isArray(a)?x[h]=a.map(g=>{let m=l(g,E,w+1);return E&&$n(g)&&typeof g.id==\"string\"&&N.children.push(g.id),m}):h===\"eventListeners\"&&$n(a)?x[h]=Object.fromEntries(Object.entries(a).map(([g,m])=>{if(typeof m!=\"function\"||!E)return[g,void 0];let p=o(m);return N.listeners.set(g,p),[g,{listener:p}]})):x[h]=me(a,w+1);return x},d=c=>{if(!Array.isArray(c))return me(c);let[f,w]=c,u=typeof w==\"string\"?n.get(w):void 0;if(f===0){let E=l(c[2],u!==void 0),N=$n(c[2])?c[2].id:void 0;if(u&&typeof N==\"string\"&&n.has(N)){let x=Number(c[3]);u.children.splice(Number.isInteger(x)&&x>=0&&x<=u.children.length?x:u.children.length,0,N)}return[f,me(w),E,me(c[3])]}if(f===1){let E=Number(c[2]);return u&&Number.isInteger(E)&&E>=0&&E<u.children.length&&i(u.children.splice(E,1)[0]),me(c)}if(f===3&&c[4]===3){let E=String(c[2]),N=c[3],x=u&&typeof N==\"function\"?o(N):void 0,h=u?.listeners.get(E);return h!==void 0&&s(h),x===void 0?u?.listeners.delete(E):u.listeners.set(E,x),[f,me(w),E,x===void 0?void 0:{listener:x},3]}return me(c)};return{encode:c=>c.map(d),listener:c=>t.get(c)?.listener,get listening(){return t.size},get nodes(){return n.size-1}}}var Or=\"graview-view-root\",Ai=[\"value\",\"checked\",\"key\",\"pressed\",\"files\",\"refused\",\"x\",\"y\",\"width\",\"height\",\"deltaX\",\"deltaY\",\"deltaMode\",\"ctrlKey\",\"metaKey\",\"phase\",\"pointerId\",\"button\",\"pressure\",\"dx\",\"dy\",\"scale\",\"rotation\"],ki=t=>t.replace(/&/g,\"&amp;\").replace(/</g,\"&lt;\").replace(/>/g,\"&gt;\").replace(/\"/g,\"&quot;\").replace(/'/g,\"&#39;\"),Ri=t=>Object.freeze({html:t,toString:()=>t}),Jo=t=>typeof t==\"object\"&&t!==null&&typeof t.html==\"string\"&&Object.isFrozen(t),Qo=t=>t==null||t===!1?\"\":Array.isArray(t)?t.map(Qo).join(\"\"):Jo(t)?t.html:ki(String(t));function es(t){customElements.get(Or)||customElements.define(Or,_t);let e=Event,n=Zo(),r=new Set,o=new Set,s,i=[],l=new Set;for(let y of[\"closest\",\"matches\",\"dataset\"]){let S=()=>{throw new TypeError(`A view's element has no ${y}: graview.on hands event.element, the element its selector matched; read event.element.getAttribute(\"data-\\u2026\").`)};y in Element.prototype||Object.defineProperty(Element.prototype,y,y===\"dataset\"?{get:S}:{value:S})}let d=document.createElement(Or),c=y=>{let S=A=>{for(let k of Array.from(A.childNodes)){if(k.nodeType!==1)continue;if(oe(k)===y)return k;let R=S(k);if(R)return R}};return S(d)},f=y=>{let S=c(y.target);if(!S)return;let A=new e(y.event,{bubbles:!0}),k={};for(let R of Ai)y[R]!==void 0&&(k[R]=y[R]);for(let R of Object.keys(k))Object.defineProperty(A,R,{value:k[R],enumerable:!0});S.dispatchEvent(A);for(let R of o){if(R.type!==y.event)continue;let M;try{M=new Set(Array.from(d.querySelectorAll(R.selector)))}catch{continue}for(let K=S;K&&K!==d;K=K.parentNode)if(M.has(K)){R.listener(Object.freeze({type:y.event,target:S,element:K,...k}));break}}},w=y=>{if(y.type===\"dom-event\"&&typeof y.target==\"string\")return f(y);if(y.type===\"notice\")return t.warn(y.text);if(y.type!==\"props\")return;s=y.props;let S=t.now();for(let R of r)try{R(y.props)}catch(M){t.threw(M)}let A=t.now()-S,k=y.push;typeof k==\"number\"&&t.microtask(()=>t.microtask(()=>t.send({type:\"pushed\",push:k,ms:A})))},u;d.connect({mutate(y){u||(u=[],t.microtask(()=>{let S=u??[];u=void 0,t.send({type:\"render\",records:n.encode(S)})})),u.push(...y)},call:()=>{}});let E=y=>y.nodeType===1?y.getAttribute(\"data-key\")??y.getAttribute(\"id\"):null,N=(y,S)=>y.nodeType===S.nodeType&&(y.nodeType!==1||y.localName===S.localName&&y.namespaceURI===S.namespaceURI&&E(y)===E(S));function x(y,S){let A=Array.from(S.childNodes),k=0;for(let R of A){let M=y.childNodes[k]??null;if(M&&N(M,R)){h(M,R),k+=1;continue}if(E(R)!==null){let Te=Array.from(y.childNodes).slice(k+1).find(ht=>N(ht,R));if(Te){y.insertBefore(Te,M),h(Te,R),k+=1;continue}}y.insertBefore(R,M),k+=1}for(;y.childNodes.length>k;)y.removeChild(y.lastChild)}function h(y,S){if(y.nodeType!==1){y.data!==S.data&&(y.data=S.data);return}let A=y,k=S,R=a(A);for(let M of A.getAttributeNames())k.hasAttribute(M)||(A.removeAttribute(M),R&&Pe(A,M,void 0));for(let M of k.getAttributeNames()){let K=k.getAttribute(M);A.getAttribute(M)!==K&&A.setAttribute(M,K),R&&Pe(A,M,K)}x(A,k)}let a=y=>y.localName.includes(\"-\");function g(y){for(let S of Array.from(y.childNodes)){if(S.nodeType!==1)continue;let A=S;if(a(A))for(let k of A.getAttributeNames())Pe(A,k,A.getAttribute(k)??void 0);g(A)}}function m(y,S,A){for(let k of Array.from(y.childNodes)){if(k.nodeType!==1)continue;let R=k,M=R.localName,K=S||M.toLowerCase()===\"svg\",Te=K?Ln(M):Object.prototype.hasOwnProperty.call(at,M.toLowerCase())?M.toLowerCase():void 0;if(!Te){A.add(`<${M}>`);continue}for(let ht of R.getAttributeNames())(!Hn(K?\"svg\":\"html\",Te,ht)||!K&&Dn[Te]?.includes(ht.toLowerCase()))&&A.add(`${Te} ${ht}`);m(R,K,A)}}function p(y){let S=document.createElement(\"div\"),A=Array.isArray(y)?y:[y];for(let R of A)if(R!=null)if(typeof R==\"string\"||Jo(R)){let M=document.createElement(\"div\");M.innerHTML=typeof R==\"string\"?R:R.html,S.append(...Array.from(M.childNodes))}else S.append(R);let k=new Set;m(S,!1,k),i=[...k],i.length>0&&t.warn(`The host will not draw: ${i.join(\", \")}`),g(S),x(d,S)}let b=[],O=new Set(Xo),D=\"[]\",V=!1,J=()=>{V||(V=!0,t.microtask(()=>{V=!1;let y=[...new Map([...o].filter(A=>O.has(A.type)).map(A=>[`${A.type} ${A.selector}`,{event:A.type,selector:A.selector}])).entries()].sort(([A],[k])=>A<k?-1:A>k?1:0).map(([,A])=>A),S=JSON.stringify(y);S!==D&&(D=S,t.send({type:\"gestures\",bound:y}))}))};return{view:Object.freeze({get props(){return s},onProps(y){return r.add(y),s&&y(s),()=>void r.delete(y)},render:p,style(y){typeof y!=\"string\"||b.includes(y)||(b.push(y),t.send({type:\"style\",sheets:[...b]}))},on(y,S,A){let k={type:y,selector:S,listener:A};return o.add(k),typeof y==\"string\"&&!l.has(y)&&(l.add(y),t.send({type:\"hears\",events:[y]})),O.has(y)&&J(),()=>{o.delete(k),O.has(y)&&J()}},act:(y,S={})=>t.act(y,S),navigate(y){if(typeof y==\"string\")return t.navigate(y);let S=qo(y);S&&t.send(S)},html(y,...S){return Ri(y.reduce((A,k,R)=>A+k+(R<S.length?Qo(S[R]):\"\"),\"\"))},get refused(){return i},get hardening(){return t.hardening()}}),hear:w,find:y=>{try{let S=d.querySelectorAll(y)[0];return S?oe(S):void 0}catch{return}}}}var ts=t=>t.toLowerCase().replace(/[^a-z0-9]+/g,\"-\").replace(/^-|-$/g,\"\");function Mt(t,e){let n=t.find(s=>s.as===e);if(n)return n;let r=e.trim().toLowerCase(),o=ts(e);return t.find(s=>s.title!==void 0&&s.title.trim().toLowerCase()===r)??(o?t.find(s=>s.as===o||s.title!==void 0&&ts(s.title)===o):void 0)}var lt=t=>` Its places: ${t.map(e=>typeof e==\"string\"?`\"${e}\"`:e.title&&e.title!==e.as?`\"${e.as}\" (${e.title})`:`\"${e.as}\"`).join(\", \")||\"none\"}.`,Ar=t=>`\"${t.length>80?`${t.slice(0,79)}\\u2026`:t}\"`;var ns=[\"https:\",\"mailto:\",\"tel:\"];function rs(t){if(!(typeof t!=\"string\"||t.length>2e3||/[\\s<>\"]/.test(t.trim())||t.trim()!==t))try{let e=new URL(t);return!ns.includes(e.protocol)||e.protocol===\"https:\"&&(e.hostname===\"\"||e.username!==\"\"||e.password!==\"\")?void 0:e.href}catch{return}}function os(t){let e=new Set,n=r=>{if(typeof r!=\"string\"||!/^(https|mailto|tel):/i.test(r))return;let o=rs(r);o&&e.add(o)};for(let r of[...t?.node?[t.node]:[],...t?.nodes??[]])for(let[o,s]of Object.entries(r))o===\"id\"||o===\"kind\"||(Array.isArray(s)?s.forEach(n):n(s));return e}function ss(t){return(t??[]).flatMap(e=>{try{let n=new URL(e);return n.protocol===\"https:\"&&n.hostname!==\"\"&&n.username===\"\"&&n.password===\"\"?[n.origin]:[]}catch{return[]}})}function is(t,e){let n=rs(t);if(n&&(e.handed.has(n)||n.startsWith(\"https:\")&&ss(e.origins).includes(new URL(n).origin)))return n}function as(t,e){let n=t.length>120?`${t.slice(0,119)}\\u2026`:t,r=\"\";try{r=new URL(t).protocol}catch{r=\"\"}if(!ns.includes(r))return`The link \"${n}\" was not drawn: a view links only to an https:, mailto: or tel: address.`;let o=ss(e);return`The link \"${n}\" was not drawn: it is no address this view was handed. A view links out only to an address a record it was shown holds (a url field), as the record holds it${o.length>0?`, or an https: address on ${o.join(\", \")}`:\"\"}; a record or a place of this app is <a data-record> or <a data-place>.`}var q=t=>t>=48&&t<=57,ls=t=>q(t)||t>=65&&t<=70||t>=97&&t<=102,Ir=t=>t>=65&&t<=90||t>=97&&t<=122,Dr=t=>t>=128,Gn=t=>Ir(t)||Dr(t)||t===95,cs=t=>Gn(t)||q(t)||t===45,ds=t=>t===10,Ee=t=>t===10||t===9||t===32,Ci=t=>t>=0&&t<=8||t===11||t>=14&&t<=31||t===127,ue=-1;function Pi(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 _i(t){let e=Pi(t),n=0,r=(h=0)=>n+h<e.length?e[n+h]:ue,o=[],s=(h,a)=>h===92&&a!==10&&a!==ue,i=(h,a,g)=>h===45?Gn(a)||a===45||s(a,g):Gn(h)?!0:s(h,a),l=(h,a,g)=>h===43||h===45?q(a)||a===46&&q(g):q(h===46?a:h),d=()=>{let h=r();if(n+=1,h===ue)return 65533;if(ls(h)){let a=String.fromCodePoint(h);for(;a.length<6&&ls(r());)a+=String.fromCodePoint(r()),n+=1;Ee(r())&&(n+=1);let g=parseInt(a,16);return g===0||g>=55296&&g<=57343||g>1114111?65533:g}return h},c=()=>{let h=\"\";for(;;){let a=r();if(cs(a))h+=String.fromCodePoint(a),n+=1;else if(s(a,r(1)))n+=1,h+=String.fromCodePoint(d());else return h}},f=()=>{let h=\"\";for((r()===43||r()===45)&&(h+=String.fromCodePoint(e[n++]));q(r());)h+=String.fromCodePoint(e[n++]);if(r()===46&&q(r(1)))for(h+=String.fromCodePoint(e[n++],e[n++]);q(r());)h+=String.fromCodePoint(e[n++]);if((r()===69||r()===101)&&(q(r(1))||(r(1)===43||r(1)===45)&&q(r(2))))for(h+=String.fromCodePoint(e[n++]),q(r())||(h+=String.fromCodePoint(e[n++]));q(r());)h+=String.fromCodePoint(e[n++]);return h},w=()=>{let h=f();return i(r(),r(1),r(2))?{type:\"dimension\",repr:h,unit:c()}:r()===37?(n+=1,{type:\"percentage\",repr:h}):{type:\"number\",repr:h}},u=()=>{for(;;){let h=r();if(n+=1,h===41||h===ue)return;s(h,r())&&d()}},E=()=>{let h=\"\";for(;Ee(r());)n+=1;for(;;){let a=r();if(n+=1,a===41)return{type:\"url\",value:h};if(a===ue)return{type:\"url\",value:h};if(Ee(a)){for(;Ee(r());)n+=1;return r()===41||r()===ue?(r()===41&&(n+=1),{type:\"url\",value:h}):(u(),{type:\"bad-url\"})}if(a===34||a===39||a===40||Ci(a))return u(),{type:\"bad-url\"};if(a===92){if(s(a,r()))h+=String.fromCodePoint(d());else return u(),{type:\"bad-url\"};continue}h+=String.fromCodePoint(a)}},N=()=>{let h=c();if(h.toLowerCase()===\"url\"&&r()===40){for(n+=1;Ee(r())&&Ee(r(1));)n+=1;let a=Ee(r())?r(1):r();return a===34||a===39?{type:\"function\",value:h}:E()}return r()===40?(n+=1,{type:\"function\",value:h}):{type:\"ident\",value:h}},x=h=>{let a=\"\";for(;;){let g=r();if(n+=1,g===h||g===ue)return{type:\"string\",value:a};if(ds(g))return n-=1,{type:\"bad-string\"};if(g===92){if(r()===ue)continue;if(ds(r())){n+=1;continue}a+=String.fromCodePoint(d());continue}a+=String.fromCodePoint(g)}};for(;;){for(;r()===47&&r(1)===42;){for(n+=2;r()!==ue&&!(r()===42&&r(1)===47);)n+=1;r()!==ue&&(n+=2)}let h=r();if(h===ue)return o;if(Ee(h)){for(;Ee(r());)n+=1;o.push({type:\"whitespace\"});continue}switch(n+=1,h){case 34:case 39:o.push(x(h));continue;case 35:if(cs(r())||s(r(),r(1))){let a=i(r(),r(1),r(2));o.push({type:\"hash\",value:c(),id:a})}else o.push({type:\"delim\",value:\"#\"});continue;case 40:o.push({type:\"(\"});continue;case 41:o.push({type:\")\"});continue;case 43:case 46:l(h,r(),r(1))?(n-=1,o.push(w())):o.push({type:\"delim\",value:String.fromCodePoint(h)});continue;case 44:o.push({type:\",\"});continue;case 45:l(h,r(),r(1))?(n-=1,o.push(w())):r()===45&&r(1)===62?(n+=2,o.push({type:\"CDC\"})):i(h,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:c()}):o.push({type:\"delim\",value:\"@\"});continue;case 91:o.push({type:\"[\"});continue;case 92:s(h,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:q(h)?(n-=1,o.push(w())):Gn(h)?(n-=1,o.push(N())):o.push({type:\"delim\",value:String.fromCodePoint(h)})}}}var hs={\"{\":\"}\",\"[\":\"]\",\"(\":\")\"},gs=32,Rr=class{constructor(e){this.tokens=e}i=0;peek(){return this.tokens[this.i]}next(){return this.tokens[this.i++]}};function ys(t,e){let n=t.next();return n.type===\"{\"||n.type===\"[\"||n.type===\"(\"?{type:\"block\",open:n.type,value:us(t,hs[n.type],e+1)}:n.type===\"function\"?{type:\"func\",name:n.value,value:us(t,\")\",e+1)}:n}function us(t,e,n){let r=[];for(;;){let o=t.peek();if(!o)return r;if(o.type===e)return t.next(),r;if(n>gs){t.next(),r.push({type:\"bad-string\"});continue}r.push(ys(t,n))}}function ct(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 d;for(;r<t.length;){let c=t[r];if(r+=1,c.type===\";\")break;if(c.type===\"block\"&&c.open===\"{\"){d=c.value;break}l.push(c)}n.push({type:\"at-rule\",name:o.value,prelude:l,...d?{block:d}:{}});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 Mr(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(...ct(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=bs(r.value,t.slice(s+1,i));if(l.value.some(d=>d.type===\"block\"&&d.open===\"{\")){let d=t.findIndex((c,f)=>f>n&&c.type===\"block\"&&c.open===\"{\");e.push(...ct(t.slice(n,d+1),!1)),n=d+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(...ct(t.slice(n,o+1),!1)),n=o+1}return e}function bs(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 Lr(t){let e=new Rr(_i(t)),n=[];for(;e.peek();)n.push(ys(e,0));return n}function Un(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&&q(r)||o===1&&q(r)&&n[0]===45?e+=`\\\\${r.toString(16)} `:o===0&&r===45&&n.length===1?e+=\"\\\\-\":Dr(r)||r===45||r===95||q(r)||Ir(r)?e+=String.fromCodePoint(r):e+=`\\\\${String.fromCodePoint(r)}`}),e}function jn(t){let e=\"\";for(let n of t){let r=n.codePointAt(0);Dr(r)||r===45||r===95||q(r)||Ir(r)?e+=n:r>=1&&r<=31||r===127?e+=`\\\\${r.toString(16)} `:e+=`\\\\${n}`}return e}function Cr(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 Ii(t){let e=jn(t);return/^[eE]([0-9]|[+-][0-9])/.test(t)?`\\\\${t.codePointAt(0).toString(16)} ${jn(t.slice(1))}`:e}var fs=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 Mi(t){switch(t.type){case\"whitespace\":return\" \";case\"ident\":return Un(t.value);case\"at-keyword\":return`@${Un(t.value)}`;case\"hash\":return`#${jn(t.value)}`;case\"string\":return Cr(t.value);case\"url\":return`url(${Cr(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}${Ii(t.unit)}`;case\"func\":return`${Un(t.name)}(${dt(t.value)})`;case\"block\":return`${t.open}${dt(t.value)}${hs[t.open]}`;case\":\":case\";\":case\",\":case\"[\":case\"]\":case\"(\":case\")\":case\"{\":case\"}\":return t.type;default:return\"\"}}function dt(t){let e=\"\",n;for(let r of t)r.type===\"whitespace\"&&n?.type===\"whitespace\"||(n&&Di(fs(n),fs(r))&&(e+=\"/**/\"),e+=Mi(r),n=r);return e}var Li=new Set(Go),Es=new Set(Uo),ps=new Set(jo),Hi=new Set(Vo),$i=new Set(Fo),ms=/^#[A-Za-z_][A-Za-z0-9_.:-]*$/,we=t=>t.replace(/[A-Z]/g,e=>e.toLowerCase()),Gi=t=>we(t);function Pr(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&&ps.has(t)&&ms.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=we(o.name);if(s===\"url\"||s===\"src\"){let l=o.value.filter(c=>c.type!==\"whitespace\"),d=l[0];if(s===\"url\"&&l.length===1&&d?.type===\"string\"&&t&&ps.has(t)&&ms.test(d.value)){r.push({type:\"func\",name:\"url\",value:[{type:\"string\",value:d.value}]});continue}n({reason:\"url\",...t?{name:t}:{}});return}if(!Es.has(s)){n({reason:\"function\",name:s});return}let i=Pr(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=Pr(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 zn(t,e){let n=t.name.startsWith(\"--\"),r=n?t.name:Gi(t.name);if(!n&&!Li.has(r)){e({reason:\"property\",name:r});return}let o=zo[r];if(o){let l=t.value.filter(f=>f.type!==\"whitespace\"),d=l[0],c=l.length===1&&d?.type===\"ident\"?we(d.value):void 0;if(!c||![...o,\"inherit\",\"initial\",\"unset\",\"revert\"].includes(c)){e({reason:\"value\",name:r});return}return`${r}: ${c}${t.important?\" !important\":\"\"}`}let s=Pr(n?void 0:r,t.value,e);if(!s)return;let i=dt(s).trim();return`${n?`--${jn(t.name.slice(2))}`:r}: ${i}${t.important?\" !important\":\"\"}`}function ws(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=we(s.type===\"ident\"?s.value:s.name);if($i.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 kr(t,e,n){let r=[];for(let o of Mr(t))if(o.type===\"declaration\"){let s=zn(o,e);s&&r.push(`${s};`)}else{let s=Vn(o,e,n+1,\"style\");s&&r.push(s)}return r.join(\" \")}function Ui(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=we(s.name);return e===\"supports\"&&i===\"selector\"?ws(s.value,n):Es.has(i)?r(s.value):(n({reason:\"function\",name:i}),!1)}if(s.type===\"block\"){if(e===\"supports\"){let i=Mr(s.value);if(i.length===1&&i[0].type===\"declaration\")return zn(i[0],n)!==void 0}return r(s.value)}return!0});return r(t)?dt(t).trim():void 0}function _r(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(It,we(e.value))?{type:\"block\",open:\"[\",value:[{type:\"ident\",value:\"data-graview-as\"},{type:\"delim\",value:\"=\"},{type:\"string\",value:we(e.value)}]}:e.type===\"func\"?{type:\"func\",name:e.name,value:_r(e.value)}:e.type===\"block\"&&e.open===\"(\"?{type:\"block\",open:\"(\",value:_r(e.value)}:e})}function Vn(t,e,n,r){if(n>gs){e({reason:\"unreadable\",name:\"nesting\"});return}if(t.type===\"qualified\"){if(r===\"keyframes\"){if(!t.prelude.every(f=>f.type===\"whitespace\"||f.type===\",\"||f.type===\"percentage\"||f.type===\"ident\"&&[\"from\",\"to\"].includes(we(f.value)))){e({reason:\"unreadable\",name:\"keyframe\"});return}return`${dt(t.prelude).trim()} { ${kr(t.block,e,n)} }`}if(!ws(t.prelude,e))return;let d=dt(_r(t.prelude)).trim();if(d===\"\"){e({reason:\"unreadable\",name:\"selector\"});return}return`${d} { ${kr(t.block,e,n)} }`}let o=we(t.name),s=o===\"-webkit-keyframes\"?\"keyframes\":o;if(!Hi.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 d=t.prelude.filter(u=>u.type!==\"whitespace\"),c=d[0];if(d.length!==1||!c||c.type!==\"ident\"&&c.type!==\"string\"){e({reason:\"unreadable\",name:\"@keyframes\"});return}let f=ct(t.block,!1).map(u=>Vn(u,e,n+1,\"keyframes\")).filter(u=>u!==void 0);return`@keyframes ${c.type===\"ident\"?Un(c.value):Cr(c.value)} { ${f.join(\" \")} }`}let i=Ui(t.prelude,s,e);if(i===void 0)return;let l=r===\"style\"?kr(t.block,e,n):ct(t.block,!1).map(d=>Vn(d,e,n+1,\"sheet\")).filter(d=>d!==void 0).join(\" \");return`@${s} ${i} { ${l} }`}function ji(t,e=Mn){let n=[];if(t.length>e)return{css:\"\",refused:[{reason:\"size\"}]};let r=s=>void n.push(s);return{css:ct(Lr(t),!0).map(s=>Vn(s,r,0,\"sheet\")).filter(s=>s!==void 0).join(`\n`),refused:n}}function Ns(t,e=Mn){let n=[],r=[],o=0;for(let s of t){if(o+s.length>e){r.push({reason:\"size\"});continue}o+=s.length;let i=ji(s,e);i.css&&n.push(i.css),r.push(...i.refused)}return{css:n.join(`\n`),refused:r}}function Ts(t,e=Mn){let n=[];if(t.length>e)return{css:\"\",refused:[{reason:\"size\"}]};let r=s=>void n.push(s),o=[];for(let s of Mr(Lr(t))){if(s.type!==\"declaration\"){r({reason:\"unreadable\",name:\"a rule in a style attribute\"});continue}let i=zn(s,r);i&&o.push(i)}return{css:o.join(\"; \"),refused:n}}function xs(t,e){let n,r=zn(bs(t,Lr(e)),o=>n??=o);return r===void 0||n?{refused:n??{reason:\"unreadable\",name:t}}:{value:r.slice(r.indexOf(\":\")+1).trim()}}function vs(t,e){if(e===\"svg\"){let r=Ln(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(at,n)?Object.prototype.hasOwnProperty.call(It,n)?{namespace:\"html\",name:It[n],as:n}:{namespace:\"html\",name:n}:{refused:{reason:\"element\",element:t}}}function Hr(t,e){return(t===\"html\"?at[e]:In[e])?.empty===!0}var Vi=/^[+-]?(\\d+\\.?\\d*|\\.\\d+)([eE][+-]?\\d+)?$/,zi=/^[0-9A-Za-z\\s.,+\\-%()]*$/,Fi=/^#[A-Za-z_][A-Za-z0-9_.:-]*$/,Bi=/^data:image\\/(png|gif|jpeg|webp|avif|bmp|svg\\+xml)(;[A-Za-z0-9=._+-]+)*,/i,Yi=/^\\/graview\\/assets\\/[0-9a-f]{64}\\.(png|gif|jpe?g|webp|avif|svg|ico)$/,Ss=/\\/graview\\/assets\\/[0-9a-f]{64}\\.(png|gif|jpe?g|webp|avif|svg|ico)$/,Wi=/^\\/(?!\\/)(?!(?:.*\\/)?\\.\\.?(?:\\/|$))(?!.*%(?:2e|2f|5c))[^\\\\\\s?#\"'<>]*$/i;function qi(t,e){if(Yi.test(t))return t;let n=t;if(/^https?:\\/\\//i.test(t))try{let r=new URL(t);if(e===\"null\"||r.origin!==e||r.username!==\"\"||r.password!==\"\"||r.search!==\"\"||r.hash!==\"\")return;n=t.slice(r.origin.length)}catch{return}if(Wi.test(n))return Ss.exec(n)?.[0]}function Os(t,e={},n){let r=t.length>120?`${t.slice(0,119)}\\u2026`:t,o=As(e.origins),s=Ss.exec(t.split(/[?#]/)[0])?.[0],i=n!==void 0&&n>Dt?` It is a data: image of ${n.toLocaleString(\"en-US\")} characters, more than the ${Dt.toLocaleString(\"en-US\")} a view's own data: image may be. A picture on a record is drawn at any size by the src the host hands the view (pictures in its manifest), used as it was handed.`:s?e.assets?` It is the app's own image only by its path, or under the app's base on this page's origin: write it as its path, ${s}.`:\" This host has not said where the app's own images live (asset, on the view's definition), so a view here cannot draw one by its path.\":/^https:\\/\\//i.test(t)?o.length>0?` Its origin is not one the host lists for images (${o.join(\", \")}).`:\" The host lists no origin a view's images may come from (images.origins, on the view's definition).\":\"\",l=[\"a data: image\",...e.assets?[\"the app's own image by the path add_image answered (/graview/assets/<sha256>.<ext>)\"]:[],\"a picture on a record (pictures in its manifest)\",...o.length>0?[`an https: image from ${o.join(\", \")}`]:[]];return`The image \"${r}\" was not drawn.${i} A view here shows ${l.slice(0,-1).join(\", \")} or ${l[l.length-1]}.`}function As(t){return(t??[]).flatMap(e=>{try{let n=new URL(e);return n.protocol===\"https:\"&&n.hostname!==\"\"&&n.username===\"\"&&n.password===\"\"?[n.origin]:[]}catch{return[]}})}function Xi(t,e){if(!(!e||e.length===0||!/^https:\\/\\//i.test(t)))try{let n=new URL(t);return n.protocol!==\"https:\"||n.username!==\"\"||n.password!==\"\"?void 0:As(e).includes(n.origin)?n.href:void 0}catch{return}}function $r(t,e,n,r,o){let s=Hn(t,e,n);if(!s)return{refused:{reason:\"attribute\",element:e,name:n}};if(t===\"html\"&&Dn[e]?.includes(s.name))return{refused:{reason:\"attribute\",element:e,name:n}};if(r===null)return{name:s.name,value:null};let i=Ki(s.name,s.kind,r,o);return\"refused\"in i?{refused:{...i.refused,element:e,...s.kind===\"image\"&&i.refused.reason===\"url\"?{address:r.slice(0,200),...r.length>Dt?{length:r.length}:{}}:{},...s.kind===\"link\"?{address:r.slice(0,200)}:{}}}:s.name===\"role\"&&i.value.split(/\\s+/).some(l=>$o.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 Ki(t,e,n,r){let o=(s,i)=>({refused:{reason:s,name:t,...i?{css:i}:{}}});if(e===\"geometry\")return n.length>Bo||!zi.test(n)||/url/i.test(n)?o(\"value\"):{value:n};if(e===\"image\"){let s=r.picture?.(n);if(s!==void 0)return{value:s};if(n.length>Dt)return o(\"url\");if(Bi.test(n))return{value:n};if(n.startsWith(`blob:${r.origin}/`)&&/^blob:[^\\s\"'<>]+$/.test(n))return{value:n};let i=r.asset?qi(n,r.origin):void 0;if(i!==void 0){let d=r.asset(i);if(d)return{value:d}}let l=Xi(n,r.imageOrigins);return l?{value:l}:o(\"url\")}if(e===\"link\"){let s=r.link?.(n);return s===void 0?o(\"url\"):{value:s}}if(n.length>vr)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 Vi.test(n.trim())&&Number.isFinite(Number(n))?{value:n.trim()}:o(\"value\");case\"boolean\":return{value:\"\"};case\"fragment\":return Fi.test(n)?{value:n}:o(\"url\");case\"style\":{let s=Ts(n,vr);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=xs(t,n);return\"refused\"in s?o(s.refused.reason===\"url\"?\"url\":\"css\",s.refused):{value:s.value}}}}var Zi=\"http://www.w3.org/1999/xhtml\",Ji=new Set([\"button\",\"submit\",\"reset\",\"checkbox\",\"radio\",\"image\"]);var Fn=(t,...e)=>t.namespaceURI===Zi&&e.includes(t.localName),Qi=t=>(t.getAttribute(\"type\")??\"text\").toLowerCase(),ea=t=>Fn(t,\"textarea\",\"select\")||Fn(t,\"input\")&&!Ji.has(Qi(t));function ks(t){if(Fn(t,\"option\",\"optgroup\",\"datalist\"))return'An option is never pressed by itself: put data-act on its select, with data-save=\"change\", or on a button.';if(Fn(t,\"label\"))return\"A press on a label presses its field too, and would ask for the act twice: put data-act on a button, or on the field.\";if(ea(t)&&!t.hasAttribute(\"data-save\"))return'A click into a field to type or to pick is not a press: give it data-save (\"input\" or \"change\") to save it as it is typed, or put data-act on a button beside it.'}var ta=\"http://www.w3.org/1999/xhtml\",ut=class{constructor(e){this.ownerDocument=e}parentNode=null;childNodes=[];get firstChild(){return this.childNodes[0]??null}get parentElement(){return this.parentNode instanceof Ue?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}},Ge=class extends ut{constructor(n,r){super(n);this.data=r}nodeType=3;get textContent(){return this.data}},Gr=class extends ut{nodeType=8;get textContent(){return\"\"}},Ue=class extends ut{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}},Ur=class extends ut{nodeType=9;constructor(){super(null)}createElementNS(e,n){return new Ue(this,e,n)}createElement(e){return new Ue(this,ta,e)}createTextNode(e){return new Ge(this,e)}createComment(e){return new Gr(this)}};function Rs(){let t=new Ur,e=t.createElement(\"div\");return e.setAttribute(\"data-graview-view-root\",\"\"),t.appendChild(e),{document:t,root:e}}var jr={h1:1,h2:2,h3:3,h4:4,h5:5,h6:6},Cs=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\"]),Ps=new Set([\"style\",\"template\",\"datalist\",\"option\"]),j=t=>t.replace(/\\s+/g,\" \").trim();function na(t){let e=t.duration===void 0?0:Math.round(t.duration);if(e<1)return\"a video\";if(e<60)return`a ${e}-second video`;let n=Math.round(e/60);return n<60?`a ${n}-minute video`:`a ${Math.floor(n/60)}-hour${n%60>0?` ${n%60}-minute`:\"\"} video`}var re=t=>t instanceof Ue,Lt=t=>t.hasAttribute(\"hidden\")||t.getAttribute(\"aria-hidden\")===\"true\";function X(t){return t instanceof Ge?t.data:!re(t)||Lt(t)||Ps.has(t.localName)?\"\":t.localName===\"br\"?\" \":t.localName===\"img\"?t.getAttribute(\"alt\")??\"\":t.childNodes.map(X).join(t.localName===\"td\"||t.localName===\"th\"?\" \":\"\")}function*je(t){for(let e of t.childNodes)re(e)&&(yield e,yield*je(e))}function ra(t){let e=t.getAttribute(\"data-save\"),n=t.getAttribute(\"data-debounce\");if(e===null&&n===null)return[];let r=`drawing <${t.localName}${e!==null?` data-save=\"${e}\"`:` data-debounce=\"${n}\"`}>`,o=[];if(e===null)return[{at:r,says:'data-debounce is read only on a field that saves as it is typed (data-save=\"input\").'}];if(![\"input\",\"textarea\",\"select\"].includes(t.localName))o.push({at:r,says:\"Only a field saves as it is typed: an input, a textarea or a select. A button is pressed (data-act alone).\"});else if(e!==\"input\"&&e!==\"change\")o.push({at:r,says:`data-save is \"input\" (saved as the person types, once they pause, and when they leave it) or \"change\" (saved when they leave it or pick), not \"${e}\".`});else if(t.getAttribute(\"data-act\")===null)o.push({at:r,says:'It saves through no act: a field saved as it is typed names its act itself, data-act=\"\\u2026\", one in the manifest.'});else if(!t.getAttribute(\"name\"))o.push({at:r,says:\"It has no name: the host sends a field as the act's argument its name says.\"});else{let s=!1,i=!1;for(let l=t;l;l=l.parentElement)l.getAttribute(\"data-record\")!==null&&(i=!0),l!==t&&(l.localName===\"fieldset\"||l.getAttribute(\"role\")===\"group\")&&(s=!0);(!s||!i)&&o.push({at:r,says:'It is in no fieldset bound to a record: the host saves a field inside <fieldset data-record=\"\\u2026\">, with the fields beside it, to the record the fieldset names.'})}return n!==null&&e!==\"input\"?o.push({at:r,says:'data-debounce is read only with data-save=\"input\": a \"change\" saves at once.'}):n!==null&&!(n.trim()!==\"\"&&Number.isFinite(Number(n))&&Number(n)>=250&&Number(n)<=1e4)&&o.push({at:r,says:`data-debounce is how long the host waits for the person to pause, in milliseconds from 250 to 10 000, not \"${n}\"; left out, it waits 1 000.`}),o}function oa(t,e,n){let r=t.getAttribute(\"data-drop\");if(r===null)return[];let o=`drawing <${t.localName} data-drop=\"${r}\">`,s=[],i=(e.accepts??[]).filter(c=>c.kind===r),l=t.getAttribute(\"data-drop-field\");i.length===0?s.push({at:o,says:`The view's accepts names no field of \"${r}\", so the host offers no drop target here: say the field files go in, accepts: [{ \"kind\": \"${r}\", \"field\": \"<its image, video or file field>\" }].`}):l!==null&&!i.some(c=>c.field===l)&&s.push({at:o,says:`data-drop-field names \"${l}\", which the view's accepts does not name for \"${r}\" (${i.map(c=>`\"${c.field}\"`).join(\", \")}): the host offers no drop target here.`});let d=t.getAttribute(\"data-drop-connect\");if(d!==null){let c=d.indexOf(\":\"),f=c>0?d.slice(c+1):\"\";c<=0||f===\"\"||n.has(d)?s.push({at:o,says:`data-drop-connect is \"<relation>:<record id>\" \\u2014 \"takenOn:day:saturday\" \\u2014 not \"${d}\"${n.has(d)?\", which names a record and no relation\":\"\"}.`}):n.has(f)||s.push({at:o,says:`data-drop-connect names \"${f}\", which this seat was not shown: the host offers no drop target here.`})}return s}function _s(t,e){let n=[],r=new Set,o=new Set,s=new Map;for(let u of[...e.props.node?[e.props.node]:[],...e.props.nodes??[]])s.set(u.id,u);let i=u=>Mt(e.places,u)!==void 0;for(let u of je(t)){let E=u.getAttribute(\"data-act\");E!==null&&r.add(E);let N=E!==null&&u.getAttribute(\"data-debounce\")===null?ks(u):void 0;N&&n.push({at:`drawing <${u.localName} data-act=\"${E}\">`,says:N});let x=u.getAttribute(\"data-record\");x!==null&&(o.add(x),!s.has(x)&&!i(x)&&n.push({at:`drawing <${u.localName} data-record=\"${x}\">`,says:`It names \"${x}\", which this seat was not shown and is no place of this app: the host will not follow it. A view goes to a record by its id, or to a place by its slug.${lt(e.places)}`}));let h=u.getAttribute(\"data-place\");h!==null&&!i(h)&&n.push({at:`drawing <${u.localName} data-place=\"${h}\">`,says:`It names the place \"${h}\", which this app does not have.${lt(e.places)}`}),n.push(...ra(u)),n.push(...oa(u,e,s))}let l=u=>{if(u.localName===\"graview-video\")return;let E=u.getAttribute(\"data-record\");if(E!==null)return E;let N=u.getAttribute(\"data-key\")??u.getAttribute(\"id\");if(N!==null&&s.has(N))return N;let x=new Set;for(let h of je(u)){let a=h.getAttribute(\"data-record\");a!==null&&h.localName!==\"graview-video\"&&x.add(a)}return x.size===1?[...x][0]:void 0},d=(u,E)=>{let N=s.get(E),x=N?.kind??(E.includes(\":\")?E.slice(0,E.indexOf(\":\")):\"\"),h=[...je(u)],a=h.find(p=>p.localName in jr)??h.find(p=>p.localName===\"a\"&&p.getAttribute(\"data-record\")===E)??h.find(p=>p.localName===\"strong\"||p.localName===\"b\"),g=j(a?X(a):\"\")||N?.label||E,m=f(u,a);return!a&&m[0]?.t===\"text\"&&j(m[0].text)===g&&m.shift(),{id:E,kind:x,title:g,parts:m}},c=u=>{let E=[...je(u)].filter(a=>a.localName===\"tr\"&&!Lt(a)),N=E.find(a=>a.parentElement?.localName===\"thead\"||a.childNodes.every(g=>!re(g)||g.localName===\"th\")),x=N?N.childNodes.filter(re).map(a=>j(X(a))):[];return{t:\"list\",as:\"row\",columns:1,groups:[{items:E.filter(a=>a!==N).map(a=>{let g=a.childNodes.filter(re),m=l(a),p=m?s.get(m):void 0;return{id:m??\"\",kind:p?.kind??\"\",title:j(X(g[0]??a)),parts:g.slice(1).map((b,O)=>({t:\"field\",label:x[O+1]??\"\",text:j(X(b))}))}})}]}};function f(u,E){let N=[],x=\"\",h=()=>{let g=j(x);x=\"\",g&&N.push({t:\"text\",text:g})},a=u.childNodes;for(let g=0;g<a.length;g+=1){let m=a[g];if(m===E)continue;if(m instanceof Ge){x+=m.data;continue}if(!re(m)||Lt(m)||Ps.has(m.localName))continue;if(E&&[...je(m)].includes(E)){h(),N.push(...f(m,E));continue}let p=[];for(let b=g;b<a.length;b+=1){let O=a[b];if(O instanceof Ge&&j(O.data)===\"\")continue;if(!re(O)||Lt(O)||Cs.has(O.localName)||O.localName in jr)break;let D=l(O);if(!D)break;p.push({element:O,id:D}),g=b}if(p.length>0){h();let b=p.every(O=>O.element.localName===\"li\"||O.element.localName===\"tr\");N.push({t:\"list\",as:b?\"row\":\"card\",columns:1,groups:[{items:p.map(O=>d(O.element,O.id))}]});continue}N.push(...w(m,b=>x+=b,h))}return h(),N}function w(u,E,N){let x=u.localName;if(Cs.has(x)&&x!==\"label\")return E(X(u)),[];if(x===\"mark\"){N();let a=j(X(u));return a?[{t:\"badge\",text:a}]:[]}N();let h=jr[x]??(u.getAttribute(\"role\")===\"heading\"?Number(u.getAttribute(\"aria-level\")??2):void 0);if(h!==void 0){let a=j(X(u));return a?[{t:\"heading\",level:h,text:a}]:[]}switch(x){case\"ul\":case\"ol\":case\"menu\":return[{t:\"list\",as:\"row\",columns:1,groups:[{items:u.childNodes.filter(g=>re(g)&&g.localName===\"li\"&&!Lt(g)).map(g=>{let m=l(g);if(m)return d(g,m);let p=f(g),b=p[0],O=b&&(b.t===\"text\"||b.t===\"heading\")?b.text:\"\";return{id:\"\",kind:\"\",title:O,parts:O?p.slice(1):p}})}]}];case\"table\":return[c(u)];case\"dl\":{let a=[],g=\"\";for(let m of u.childNodes.filter(re))if(m.localName===\"dt\")g=j(X(m));else if(m.localName===\"dd\")a.push({t:\"field\",label:g,text:j(X(m))});else if(m.localName===\"div\")for(let p of m.childNodes.filter(re))p.localName===\"dt\"?g=j(X(p)):p.localName===\"dd\"&&a.push({t:\"field\",label:g,text:j(X(p))});return a}case\"figure\":{let a=u.childNodes.find(p=>re(p)&&p.localName===\"figcaption\"),g=j(u.childNodes.filter(p=>p!==a).map(X).join(\" \")),m=a?j(X(a)):\"\";return g?[{t:\"figure\",text:g,...m?{label:m}:{}}]:m?[{t:\"text\",text:m}]:[]}case\"meter\":case\"progress\":{let a=Number(u.getAttribute(\"value\")??0),g=Number(u.getAttribute(\"max\")??1)||1;return[{t:\"progress\",label:u.getAttribute(\"aria-label\")??u.getAttribute(\"title\")??\"\",text:`${Math.round(a/g*100)}%`}]}case\"svg\":{let a=u.childNodes.find(p=>re(p)&&p.localName===\"title\"),g=j(u.getAttribute(\"aria-label\")??(a?X(a):\"\"));if(g)return[{t:\"text\",text:g,tone:\"picture\"}];let m=[...je(u)].filter(p=>p.localName===\"text\").map(p=>j(X(p))).filter(Boolean);return m.length>0?[{t:\"text\",text:m.join(\" \\xB7 \"),tone:\"picture\"}]:[]}case\"img\":{let a=j(u.getAttribute(\"alt\")??\"\");return a?[{t:\"text\",text:a,tone:\"picture\"}]:[]}case\"graview-video\":{let a=u.getAttribute(\"data-field\")??\"\",g=s.get(u.getAttribute(\"data-record\")??\"\"),m=g&&a&&Object.hasOwn(g,a)?g[a]:void 0,p=(Array.isArray(m)?m:[m])[Number(u.getAttribute(\"data-index\")??\"0\")];return!p||typeof p.name!=\"string\"||typeof p.type!=\"string\"||!p.type.startsWith(\"video/\")?(n.push({at:`drawing <graview-video data-field=\"${a}\">`,says:\"It names no video on a record this seat was shown: the host draws no player there. A <graview-video> names a record the view was shown (data-record) and its video field (data-field).\"}),[]):[{t:\"text\",text:`${typeof p.caption==\"string\"&&p.caption.trim()?p.caption.trim():p.name}, ${na(typeof p.duration==\"number\"?{duration:p.duration}:{})}`,tone:\"picture\"}]}case\"button\":{let a=j(X(u));return a?[{t:\"text\",text:a,tone:\"button\"}]:[]}case\"input\":case\"textarea\":case\"select\":{let a=j(u.getAttribute(\"aria-label\")??u.getAttribute(\"placeholder\")??u.getAttribute(\"name\")??\"\"),g=x===\"select\"?j(X(u.childNodes.find(m=>re(m)&&m.localName===\"option\"&&m.selected)??u)):u.value;return[{t:\"field\",label:a,text:g}]}case\"label\":return f(u);default:return f(u)}}return{parts:f(t),problems:n,acts:[...r],records:[...o]}}var sa=0,ia=1,aa=2,la=3,Is=1,ca=2,Ds=3,da=1,ua=3,fa=8,Ms=\"~\",Bn=t=>typeof t==\"object\"&&t!==null&&!Array.isArray(t),Ls=new Set([\"input\",\"select\",\"textarea\",\"option\"]),pa=new Set([\"value\",\"checked\",\"selected\"]);function Hs(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:Ms};s.set(Ms,l);let d=0,c=!1,f=a=>{o.push(a),o.length>200&&o.shift(),e.onRefused?.(a)},w=()=>({dom:n.createComment(\"\"),children:[],refused:!0}),u=(a,g)=>{if(a.namespace===\"html\"&&a.name&&Ls.has(a.name))return a.dom;if(g?.namespace===\"html\"&&g.name===\"textarea\")return g.dom},E=(a,g,m)=>{let p=a.dom;if(m!=null&&typeof m!=\"string\")return f({reason:\"value\",element:a.name,name:g});let b=$r(a.namespace,a.name,g,m??null,e);if(\"refused\"in b){let J=$r(a.namespace,a.name,g,null,e);return\"refused\"in J||p.removeAttribute(J.name),f(b.refused)}for(let J of b.dropped??[])f(J);let O=a.namespace===\"html\"&&pa.has(b.name)&&Ls.has(a.name),D=p,V=O?b.name===\"value\"?D.value:b.name===\"checked\"?D.checked:D.selected:void 0;b.value===null?p.removeAttribute(b.name):p.setAttribute(b.name,b.value),e.onAttribute?.(p,b.name),O&&(b.name===\"value\"&&\"value\"in D?(D.value=b.value??\"\",V!==D.value&&e.onFieldSet?.(p)):b.name===\"checked\"&&\"checked\"in D?(D.checked=b.value!==null,V!==D.checked&&e.onFieldSet?.(p)):b.name===\"selected\"&&\"selected\"in D&&(D.selected=b.value!==null,V!==D.selected&&e.onFieldSet?.(p.parentElement?.closest(\"select\")??p)))},N=a=>{if(!a.refused){d-=1,a.id!==void 0&&s.delete(a.id);for(let g of a.children)N(g)}},x=(a,g)=>{if(!Bn(a)||typeof a.id!=\"string\"||s.has(a.id))return f({reason:\"record\"}),w();if(d>=r)return f({reason:\"budget\"}),c||(c=!0,e.onOverBudget?.()),w();let m=a.id;if(a.type===fa)return w();if(a.type===ua){if(Hr(g.namespace,g.name))return f({reason:\"child\",element:g.name}),w();let V=n.createTextNode(String(a.data??\"\").slice(0,Sr)),J={dom:V,children:[],text:!0,id:m,parent:g};return s.set(m,J),i.set(V,m),d+=1,J}if(a.type!==da)return f({reason:\"record\"}),w();let p=String(a.element);if(Hr(g.namespace,g.name))return f({reason:\"child\",element:p}),w();let b=vs(p,g.namespace);if(\"refused\"in b)return f(b.refused),w();let O=n.createElementNS(b.namespace===\"svg\"?Wo:Yo,b.name);b.as&&O.setAttribute(\"data-graview-as\",b.as),b.namespace===\"html\"&&b.name===\"img\"&&O.setAttribute(\"referrerpolicy\",\"no-referrer\"),b.namespace===\"html\"&&b.name===\"a\"&&(O.setAttribute(\"target\",\"_blank\"),O.setAttribute(\"rel\",\"noopener noreferrer\"),O.setAttribute(\"referrerpolicy\",\"no-referrer\"));let D={dom:O,name:b.name,namespace:b.namespace,children:[],id:m,parent:g};if(s.set(m,D),i.set(O,m),d+=1,Bn(a.attributes))for(let[V,J]of Object.entries(a.attributes))E(D,V,J);if(e.decorate?.(O,b.name,b.namespace),Bn(a.properties))for(let V of Object.keys(a.properties))f({reason:\"attribute\",element:b.name,name:V});if(Bn(a.eventListeners))for(let V of Object.keys(a.eventListeners))a.eventListeners[V]!=null&&f({reason:\"attribute\",element:b.name,name:`on${V}`});if(Array.isArray(a.children))for(let V of a.children){let J=x(V,D);D.children.push(J),O.appendChild(J.dom)}return D},h=a=>{if(!Array.isArray(a))return f({reason:\"record\"});let[g,m]=a,p=typeof m==\"string\"?s.get(m):void 0;if(!p)return f({reason:\"record\"});switch(g){case sa:{if(p.text)return f({reason:\"record\"});let b=Number(a[3]),O=Number.isInteger(b)&&b>=0&&b<=p.children.length?b:p.children.length,D=x(a[2],p);p.dom.insertBefore(D.dom,p.children[O]?.dom??null),p.children.splice(O,0,D),p.namespace===\"html\"&&p.name===\"textarea\"&&e.onFieldSet?.(p.dom);return}case ia:{let b=Number(a[2]),O=p.children[b];if(!O)return f({reason:\"record\"});p.children.splice(b,1),O.dom.parentNode?.removeChild(O.dom),N(O);return}case aa:{if(!p.text)return f({reason:\"record\"});p.dom.data=String(a[2]??\"\").slice(0,Sr);let b=u(p,p.parent);b&&e.onFieldSet?.(b);return}case la:{if(p===l||p.text)return f({reason:\"record\"});let b=String(a[2]),O=a[4]??Is;return O===ca?E(p,b,a[3]):f(O===Is||O===Ds?{reason:\"attribute\",element:p.name,name:O===Ds?`on${b}`:b}:{reason:\"record\"})}default:return f({reason:\"record\"})}};return{apply(a,g){if(!Array.isArray(a))return f({reason:\"record\"}),!0;for(let m=0;m<a.length;m+=1){if(g&&m%32===0&&g())return!1;h(a[m])}return!0},get refused(){return o},get size(){return d},idOf:a=>i.get(a),elementOf(a){let g=s.get(a);return g&&!g.text&&g!==l?g.dom:void 0},dispose(){for(let a of l.children)N(a);for(l.children.length=0;t.firstChild;)t.removeChild(t.firstChild)}}}function $s(t,e,n){let{root:r}=Rs(),o=!1,s=Hs(r,{origin:n.origin??\"null\",...n.imageOrigins?{imageOrigins:n.imageOrigins}:{},...n.asset?{asset:n.asset}:{},...n.link?{link:n.link}:{},maxNodes:n.maxNodes,onOverBudget:()=>o=!0});for(let d of t)s.apply(d);let i=[...s.refused],l=\"\";if(e){let d=Ns(e);l=d.css;for(let c of d.refused)i.push({reason:\"css\",name:\"stylesheet\",css:c})}return{root:r,refused:i,size:s.size,over:o,css:l,elementOf:d=>s.elementOf(d)}}function ma(t,e={}){let n=\"element\"in t&&t.element?`<${t.element}>`:\"\",r=t.name?` ${t.name}`:\"\";switch(t.reason){case\"element\":return{at:`drawing ${n}`,says:`Not drawn: ${n} is not in the open kit.`};case\"attribute\":return{at:`drawing ${n}${r}`,says:`Not drawn: ${n||\"an element\"} does not take${r}.`};case\"value\":return{at:`drawing ${n}${r}`,says:`Not drawn: the value of${r} is not one the open kit takes.`};case\"url\":return\"element\"in t&&t.element===\"a\"&&t.address!==void 0?{at:`drawing ${n}${r}`,says:`Not drawn: ${as(t.address,e.linkOrigins)}`}:{at:`drawing ${n}${r}`,says:t.address!==void 0&&\"element\"in t&&t.element===\"img\"?`Not drawn: ${Os(t.address,e,\"length\"in t?t.length:void 0)}`:\"Not drawn: an address. A view loads nothing; an image is a data: image.\"};case\"child\":return{at:`drawing ${n}`,says:`Not drawn: ${n} 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${r===\" stylesheet\"?\"\":r}`,says:`Not drawn: CSS the open kit leaves out${t.css?` (${t.css.reason}${t.css.name?` ${t.css.name}`:\"\"})`:\"\"}.`}}}function Gs(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 c of t.asked)if(!r.has(c.name))return{ok:!1,reason:\"act\",detail:`It asks for the act \"${c.name}\", which its manifest does not name.`};let o=os(e.props),s=$s(t.renders,t.sheets,{maxNodes:n.maxNodes,...e.origin?{origin:e.origin}:{},...e.imageOrigins?{imageOrigins:e.imageOrigins}:{},...e.assets?{asset:c=>c}:{},link:c=>is(c,{handed:o,...e.linkOrigins?{origins:e.linkOrigins}:{}})});if(s.over)return{ok:!1,reason:\"nodes\",detail:`It drew more than the ${n.maxNodes.toLocaleString(\"en-US\")} things a view may draw.`};let i=[...e.places,...(e.lists??[]).filter(c=>!e.places.some(f=>f.as===c)).map(c=>({as:c}))],l=_s(s.root,{props:e.props,places:i,...e.accepts?{accepts:e.accepts}:{}});for(let c of l.acts)if(!r.has(c))return{ok:!1,reason:\"act\",detail:`It binds a press to the act \"${c}\" (data-act), which its manifest does not name.`};let d=[...s.refused.map(c=>ma(c,{...e.imageOrigins?{origins:e.imageOrigins}:{},assets:e.assets===!0,...e.linkOrigins?{linkOrigins:e.linkOrigins}:{}})),...l.problems];for(let c of t.went)\"record\"in c&&!(e.props.node?.id===c.record||(e.props.nodes??[]).some(f=>f.id===c.record)||Mt(i,c.record))&&d.push({at:\"navigate\",says:`It goes to ${Ar(c.record)}, which this seat was not shown and is no place of this app: the host will not follow it. A view goes to a record by its id, or to a place by its slug.${lt(i)}`}),\"place\"in c&&!Mt(i,c.place)&&d.push({at:\"navigate\",says:`It goes to the place ${Ar(c.place)}, which this app does not have.${lt(i)}`});return{ok:!0,parts:l.parts,problems:d,drawn:s}}var Vr=\"graviewHeadless\",zr=\"graviewHeadlessView\";var Vs=globalThis,ha=Promise.prototype.then,ga=Promise.resolve(),Wn=t=>void ha.call(ga,t),Yn=Vs.performance,$t=Yn&&typeof Yn.now==\"function\"?Yn.now.bind(Yn):Date.now,Ve=JSON.stringify,zs=JSON.parse,ya=Object.defineProperty,Br=t=>(t instanceof Error?`${t.name}: ${t.message}`:String(t)).slice(0,500),ft=t=>{try{return zs(Ve(t??null))}catch{return null}},U={renders:[],asked:[],went:[],ms:0,logs:[],messages:0},Ne,qn=(t,e)=>{Ne??={reason:t,detail:e}},pt=t=>{U.logs.length<50&&U.logs.push(t.slice(0,500))},mt={removed:[],stuck:[],sealed:!1},Ht=es({send(t){U.messages+=1,t.type===\"render\"?U.renders.push(ft(t.records)):t.type===\"style\"?U.sheets=(ft(t.sheets)??[]).map(String):t.type===\"gestures\"?U.gestures=ft(t.bound):t.type===\"navigate\"&&\"place\"in t?U.went.push({place:String(t.place),...t.where!==void 0?{where:ft(t.where)}:{},...t.section!==void 0?{section:String(t.section)}:{}}):t.type===\"navigate\"&&\"to\"in t&&U.went.push({record:String(t.to),...t.where!==void 0?{where:ft(t.where)}:{},...t.section!==void 0?{section:String(t.section)}:{}})},act(t,e){return U.messages+=1,U.asked.push({name:String(t),args:ft(e)}),Promise.resolve({type:\"answer\",id:U.asked.length,ok:!1,reason:\"refused\",message:\"Nothing is applied in a headless run.\"})},navigate(t){U.messages+=1,U.went.push({record:String(t)})},microtask:Wn,now:$t,threw:t=>qn(\"error\",`It threw: ${Br(t)}`),warn:pt,hardening:()=>mt}),Us=!1,Fr=!1;function ba(t){if(Fr||typeof t!=\"function\"||(Fr=!0,Ne))return;let e=$t();try{t.call(void 0,Ht.view)}catch(n){qn(\"error\",`It threw: ${Br(n)}`)}U.ms+=$t()-e}async function Ea(t){if(Us)return Ve({ok:!1,reason:\"refused\",detail:\"A headless script runs one view, once: something called its entry before the host did.\"});Us=!0;let e;try{e=zs(String(t))}catch{return Ve({ok:!1,reason:\"isolate\",detail:\"The run was not handed its input as JSON.\"})}if(!Fr&&!Ne)return Ve({ok:!1,reason:\"isolate\",detail:\"The script held no view.\"});let n=$t();Ne||Ht.hear({type:\"props\",props:e.props,push:1}),U.ms+=$t()-n,U.ms>=e.limits.pushMs&&qn(\"slow\",`It took longer than ${e.limits.pushMs.toLocaleString(\"en-US\")} ms to draw what it was shown.`);for(let o=0;o<64&&!Ne;o+=1)await new Promise(s=>Wn(s));if(e.press&&typeof e.press.selector==\"string\"&&!Ne){let o=Ht.find(e.press.selector);if(U.pressed={selector:e.press.selector.slice(0,200),...o!==void 0?{target:o}:{},asked:U.asked.length,went:U.went.length,renders:U.renders.length},o!==void 0){Ht.hear({type:\"dom-event\",target:o,event:\"click\"});for(let s=0;s<64&&!Ne;s+=1)await new Promise(i=>Wn(i))}}if(Ne)return Ve({ok:!1,...Ne,transcript:U});let r=Gs(U,e);return r.ok?Ve({ok:!0,transcript:U,drawn:{parts:r.parts,problems:r.problems},hardening:{removed:mt.removed.length,sealed:mt.sealed}}):Ve({ok:!1,reason:r.reason,detail:r.detail,transcript:U})}var wa=Object.freeze({log:(...t)=>pt(t.map(String).join(\" \")),info:(...t)=>pt(t.map(String).join(\" \")),debug:(...t)=>pt(t.map(String).join(\" \")),warn:(...t)=>pt(t.map(String).join(\" \")),error:(...t)=>pt(t.map(Br).join(\" \"))}),Na=0,js=()=>Na+=1,Ta=[[\"console\",wa],[\"setTimeout\",js],[\"setInterval\",js],[\"clearTimeout\",()=>{}],[\"clearInterval\",()=>{}],[\"queueMicrotask\",Wn],[\"graview\",Ht.view],[zr,ba],[Vr,t=>Ea(t)]];for(let[t,e]of Ta)ya(Vs,t,{value:e,writable:!0,enumerable:!1,configurable:!0});mt=Lo(globalThis,[\"graview\",zr,Vr],{primitivesStay:!0});mt.stuck.length>0&&qn(\"refused\",`This isolate could not be hardened: ${mt.stuck.join(\", \")} would not go.`);})();\n";
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 C=Symbol(\"name\"),Se=Symbol(\"prefix\"),Oe=Symbol(\"value\"),P=Symbol(\"ns\"),ee=Symbol(\"owner\"),U=Symbol(\"owner_document\"),pe=Symbol(\"attributes\"),G=Symbol(\"prev\"),S=Symbol(\"next\"),I=Symbol(\"child\"),te=Symbol(\"parent\"),Ae=Symbol(\"host\"),ie=Symbol(\"data\"),De=Symbol(\"listeners\"),Qn=Symbol(\"isTrusted\"),Be=Symbol(\"path\"),Ye=Symbol(\"stop_immediate_propagation\"),We=Symbol(\"dispatching\"),be=Symbol(\"content\"),j=Symbol(\"hooks\"),zt=Symbol(\"extensions\"),Me=Symbol(\"hooks_dispatch\"),W=Symbol(\"is_connected\"),qe=Symbol(\"create_element\"),qr=0,re=1,Xe=2,Ke=3,Ze=8,Le=9,Xr=10,ke=11,D=\"http://www.w3.org/1999/xhtml\",ae=\"http://www.w3.org/2000/svg\",Kr=\"http://www.w3.org/XML/1998/namespace\",Et=\"http://www.w3.org/2000/xmlns/\";function Ft(t){return t.split(/[\\t\\n\\f\\r ]+/).filter(Boolean)}function F(t){return t.replace(/[A-Z]/g,e=>String.fromCharCode(e.charCodeAt(0)+32))}function Zr(t){return t.replace(/[a-z]/g,e=>String.fromCharCode(e.charCodeAt(0)-32))}function H(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 Jr=/^(?:[A-Za-z][^\\0\\t\\n\\f\\r\\u0020/>]*|[:_\\u0080-\\u{10FFFF}][A-Za-z0-9-.:_\\u0080-\\u{10FFFF}]*)$/u,Qr=/[\\0\\t\\n\\f\\r />=]/u,Ys=/[\\0\\t\\n\\f\\r />]/u;function Ee(t){if(t==null)return null;let e=String(t);return e===\"\"?null:e}function eo(t){Jr.test(t)||tr(t)}function er(t){(t===\"\"||Qr.test(t))&&tr(t)}function Bt(t,e,n){let r=Ee(t),o=String(e),s=o.indexOf(\":\"),i=s<0?null:o.slice(0,s),a=s<0?o:o.slice(s+1);if((i!=null&&(i===\"\"||Ys.test(i))||(n===\"element\"?!Jr.test(a):a===\"\"||Qr.test(a)))&&tr(o),i!=null&&r==null)throw H(`A namespace is required for the prefix in \"${o}\"`,\"NamespaceError\");if(i===\"xml\"&&r!==Kr)throw H(\"The xml prefix requires the XML namespace\",\"NamespaceError\");if((o===\"xmlns\"||i===\"xmlns\")&&r!==Et)throw H(\"The xmlns name requires the XMLNS namespace\",\"NamespaceError\");if(r===Et&&o!==\"xmlns\"&&i!==\"xmlns\")throw H(\"The XMLNS namespace requires the xmlns name or prefix\",\"NamespaceError\");return{namespace:r,qualifiedName:o,prefix:i,localName:a}}function tr(t){throw H(`Invalid name: \"${t}\"`,\"InvalidCharacterError\")}var Yt=0,Wt=1,to=2,nr=3,Ws=typeof performance>\"u\"?Date.now:performance.now.bind(performance),q=class{static NONE=Yt;static CAPTURING_PHASE=Wt;static AT_TARGET=to;static BUBBLING_PHASE=nr;timeStamp=Ws();target=null;currentTarget=null;srcElement=null;bubbles=!1;cancelable=!1;composed=!1;defaultPrevented=!1;cancelBubble=!1;eventPhase=Yt;[Be]=[];[Ye]=!1;[We]=!1;constructor(e,n){this.type=e,Object.defineProperty(this,Qn,{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[Qn]}composedPath(){return[...this[Be]]}stopPropagation(){this.cancelBubble=!0}stopImmediatePropagation(){this[Ye]=!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 rr(t,e,n){if(t.cancelBubble)return;let o=e[De]?.get(t.type)?.[n===Wt?\"capture\":\"bubble\"];if(o)for(let s of[...o]){if(!o.has(s)||s.signal?.aborted)continue;t.eventPhase=t.target===e?to:n,t.currentTarget=e;let i=s.normalizedListener;try{typeof i==\"object\"?i.handleEvent(t):i.call(e,t)}catch(a){setTimeout(qs,0,a)}if(t[Ye])break}}function qs(t){throw t}var wt=[],qt=new WeakMap;function Xt(t,e){let n=qt.get(t);n?n.push(e):qt.set(t,[e]),wt[wt.length-1].push(t)}function X(t){let e=[];wt.push(e);let n;try{n=t()}catch(r){wt.pop();try{no(e)}catch{}throw r}return wt.pop(),no(e),n}function no(t){let e,n=!1;for(let r of t){let o=qt.get(r);if(o){for(;o.length>0;){let s=o.shift();try{s()}catch(i){n||(e=i,n=!0)}}qt.delete(r)}}if(n)throw e}var Kt=[],Nt=[],or=!1;function He(t){for(let e of t)Kt.push(e),e[1]&&Nt.push(e[1]);if(!or){or=!0;try{let e,n=!1;for(let r=0;r<Kt.length;r++){let[o,s]=Kt[r];s&&Nt.splice(Nt.indexOf(s),1);try{o()}catch(i){n||(e=i,n=!0)}}if(n)throw e}finally{Kt.length=0,Nt.length=0,or=!1}}}function Tt(t){let e=t;for(;e;){if(Nt.includes(e))return!0;e=e[te]??e[Ae]}return!1}var xt=Symbol(\"listenerRegistrations\"),Re=class{[De]=void 0;[xt]=void 0;[U]=void 0;addEventListener(e,n,r){if(n==null)return;let o=r===!0||typeof r==\"object\"&&r.capture===!0,s=typeof r==\"object\"&&r.once===!0,i=typeof r==\"object\"?r.signal:void 0;if(i?.aborted)return;let a=sr(o),l=this[xt];l||(l=new Map,this[xt]=l);let d=l.get(e);d||(d={},l.set(e,d));let p=d[a];if(p||(p=new Map,d[a]=p),p.has(n))return;let b=this,u={type:e,listener:n,capture:o,once:s,normalizedListener:n,signal:i};(s||i)&&(u.normalizedListener=function(...f){if(u.signal?.aborted){Zt(b,u);return}return u.once&&Zt(b,u),typeof u.listener==\"object\"?u.listener.handleEvent(...f):u.listener.call(this,...f)});let E=this[De];E||(E=new Map,this[De]=E);let T=E.get(e);T||(T={},E.set(e,T));let v=T[a];if(v||(v=new Set,T[a]=v),p.set(n,u),v.add(u),i){let h=()=>{Zt(b,u)};u.abortListener=h,i.addEventListener(\"abort\",h,{once:!0})}this[U]?.defaultView[Me].addEventListener?.(this,e,n,r)}removeEventListener(e,n,r){return Xs.call(this,e,n,r)}dispatchEvent(e){if(e[We])throw H(\"Failed to execute 'dispatchEvent' on 'EventTarget': The event is already being dispatched.\",\"InvalidStateError\");e[We]=!0;try{let n=[],r=this;for(;r!=null;)n.push(r),r=r.parentNode;e.target=this,e.srcElement=this,e[Be]=n;for(let s=n.length;s--;)if(rr(e,n[s],Wt),e.cancelBubble)return!e.defaultPrevented;let o=e.bubbles?n:n.slice(0,1);for(let s=0;s<o.length;s++)if(rr(e,o[s],nr),e.cancelBubble)return!e.defaultPrevented;return!e.defaultPrevented}finally{e[We]=!1,e.cancelBubble=!1,e[Ye]=!1,e.eventPhase=Yt,e.currentTarget=null,e[Be]=[]}}};function Xs(t,e,n){if(e==null)return;let r=n===!0||n&&n.capture===!0,o=sr(!!r),s=this[xt]?.get(t)?.[o]?.get(e);s&&Zt(this,s)}function sr(t){return t?\"capture\":\"bubble\"}function Zt(t,e){let n=sr(e.capture),r=t[xt],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[De],a=i?.get(e.type);if(!a)return;let l=a[n];l?.delete(e)&&(l.size===0&&delete a[n],!a.bubble&&!a.capture&&i?.delete(e.type),t[U]?.defaultView[Me].removeEventListener?.(t,e.type,e.listener,e.capture))}var le=class extends Array{item(e){return this[e]??null}};var St=0,ro=1,lr=2,cr=3,Ot=4,oo=0,so=1,en=2,tn=3,io=4,ar=5,ao=6,lo=7,Jt=/^(?:--|-?[A-Za-z_\\u0080-\\u{10FFFF}])[A-Za-z0-9_\\u0080-\\u{10FFFF}-]*$/u;function Ks(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 ne(t){throw H(`Invalid or unsupported selector: \"${t}\"`,\"SyntaxError\")}function nn(t,e){let n=typeof e==\"string\"?At(e):[{combinator:Ot,matchers:e}],r=null,o=t[I];return o&&n[0].matchers.length&&dr(o,n,s=>(r=s,!1)),r}function rn(t,e){let n=typeof e==\"string\"?At(e):[{combinator:Ot,matchers:e}],r=new le,o=t[I];return o&&n[0].matchers.length&&dr(o,n,s=>{r.push(s)}),r}function At(t,e=!1,n=!1){let r={combinator:Ot,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===\"\"&&ne(t);let a=0,l;for(;l=s.exec(i);){l.index!==a&&ne(t),l[1]&&(r.matchers.length===0&&!(n&&o.length===1)&&ne(t),l[1]===\">\"?r.combinator=ro:l[1]===\"+\"?r.combinator=cr:l[1]===\"~\"?r.combinator=lr:r.combinator=St,r={combinator:Ot,matchers:[]},o.push(r));let d=l[8]?F(l[8]):l[2]||l[7];l[7]!=null&&!l[6]&&r.matchers.length>0&&ne(t);let b,u=l[4]??l[5]??l[7];if(l[2]){Jt.test(d)||ne(t);let E=l[5],T=E?.[0];if(l[3]==null&&(T==='\"'||T===\"'\")){let v=l[0].lastIndexOf(E);u=i.slice(l.index+v+1),s.lastIndex=i.length}else E!=null&&!Jt.test(E)&&ne(t);b=io}else l[6]?(Jt.test(d)||ne(t),b=l[6]===\"#\"?en:tn):l[8]?b=l[9]==null?ar:ao:l[7]===\"*\"?b=oo:l[7]&&Jt.test(l[7])?b=so:ne(t);l[9]?([u,s.lastIndex]=Ks(i,s.lastIndex),d!==\"has\"&&d!==\"not\"&&ne(t),d===\"has\"&&e&&ne(t),At(u,e||d===\"has\",d===\"has\")):b===ar&&ne(t),r.matchers.push({type:b,name:d,value:u}),a=s.lastIndex}return(a!==i.length||r.matchers.length===0)&&ne(t),o}function Zs(t,e){let n=At(e);return n[0]?.matchers.length?vt(t,n):!1}function Js(t,e){let n=At(e,!0,!0),r=n[0];if(n.length===1&&r.matchers.length===0)return!1;let o=St,s={type:lo,name:\":scope\"};if(r.matchers.length===0?(o=r.combinator,r.matchers.push(s)):n.unshift({combinator:St,matchers:[s]}),n.some(({matchers:l})=>l.length===0))return!1;let i=o===cr||o===lr?t[S]:t[I];if(!i)return!1;let a=!1;return dr(i,n,()=>(a=!0,!1),t),a}function dr(t,e,n,r){let o=[],s=t;for(;s;){if(Q(s)){if(vt(s,e,r)&&n(s)===!1)return!1;let i=s[I];if(i){let a=s[S];a&&o.push(a),s=i;continue}}s=s[S]??o.pop()??null}return!0}function vt(t,e,n){let{combinator:r,matchers:o}=e[e.length-1];if(r===Ot){if(!Qt(t,o,n))return!1;let a=e.slice(0,-1);return a.length===0||vt(t,a,n)}let s=r===ro||r===St?te:G,i=t[s];if(!i)return!1;if(r===St||r===lr){for(;i;){if(Q(i)&&Qt(i,o,n)){let a=e.slice(0,-1);if(a.length===0||vt(i,a,n))return!0}i=i[s]}return!1}else{if(r===cr&&!Q(i)){for(;i&&!Q(i);)i=i[s];if(!i)return!1}if(!Q(i)||!Qt(i,o,n))return!1;let a=e.slice(0,-1);return a.length===0||vt(i,a,n)}}function ir(t,e){return t.getAttributeNS(null,t.namespaceURI===D?F(e):e)}function Qt(t,e,n){if(!t)return!1;if(Array.isArray(e)){for(let i of e)if(Qt(t,i,n)===!1)return!1;return!0}let{type:r,name:o,value:s}=e;switch(r){case oo:return o===\"*\";case so:return t.namespaceURI===D?t.localName===F(o):t.localName===o;case en:return ir(t,\"id\")===o;case tn:let i=ir(t,\"class\");return i?Ft(i).includes(o):!1;case io:let a=ir(t,o);return s==null?a!=null:a===s;case lo:return t===n;case ar:ne(`:${o}`);case ao:switch(o){case\"has\":return Js(t,s||\"\");case\"not\":return!Zs(t,s||\"\");default:ne(`:${o}(${s})`)}}return!1}function Qs(t){return t.nodeType===Xe}function kt(t){return ie in t}function fr(t){return t.nodeType===Ke}function ei(t){return t.nodeType===Ze}function Q(t){return t.nodeType===re}function ur(t){return t.nodeType===ke}function po(t){return\"appendChild\"in t}function on(t){let e=[],n=[t],r=new Set(n),o=new Set,s;for(;n.length>0;){let i=n.pop();if(r.delete(i),o.has(i))continue;let a=[];for(let l of Ct(i)){if(o.has(l)||(o.add(l),e.push(l),a.push(l),!Q(l)))continue;let d=l[pe];if(d)for(let b of d)o.has(b)||(o.add(b),e.push(b));let p=l[be];p&&!o.has(p)&&!r.has(p)&&(r.add(p),n.push(p))}s??=a}return{nodes:e,treeNodes:s}}function Rt(t,e){for(let n of t)n[U]=e}function co(t,e){let n=t.constructor,r=new n(t.name,t.value,t.namespaceURI);return r[U]=e,r}function uo(t,e){if(fr(t))return e.createTextNode(t.data);if(ei(t))return e.createComment(t.data);if(Qs(t))return co(t,e);if(Q(t)){let n=e[qe](t[C],t.namespaceURI,t[Se],t.localName);if(t[pe])for(let r=0;r<t[pe].length;r++){let o=t[pe].item(r);n.attributes.setNamedItem(co(o,e))}return n}else{if(ur(t))return e.createDocumentFragment();{let n=new t.constructor;return n[U]=e,n}}}function sn(t,e,n=t.ownerDocument){if(t.nodeType===Le)throw H(\"Cannot clone a document node\",\"NotSupportedError\");let r=uo(t,n);if(!e||!Q(t)&&!ur(t))return r;let o=new Set([t]),s=[{source:t,destination:r,childIndex:0,cloningContent:!1}];for(;s.length>0;){let i=s[s.length-1],a,l;if(i.cloningContent)if(i.contentSource&&i.contentDestination)a=i.contentSource.childNodes[i.childIndex++],l=i.contentDestination;else{s.pop(),i.appendTo&&i.appendTo.appendChild(i.destination);continue}else if(a=i.source.childNodes[i.childIndex++],l=i.destination,!a){if(i.cloningContent=!0,i.childIndex=0,Q(i.source)&&i.source.namespaceURI===D&&i.source.localName===\"template\"){let p=i.source[be];p&&(o.has(p)&&fo(),o.add(p),i.contentSource=p,i.contentDestination=i.destination.content)}continue}if(!a){s.pop(),i.appendTo&&i.appendTo.appendChild(i.destination);continue}o.has(a)&&fo(),o.add(a);let d=uo(a,n);Q(a)||ur(a)?s.push({source:a,destination:d,appendTo:l,childIndex:0,cloningContent:!1}):l.appendChild(d)}return r}function fo(){throw new Error(\"Cannot clone a cyclic or repeated node graph\")}function an(t,e){let n=String(e);return n===\"\"?null:nn(t,[{type:en,name:n}])}function ln(t,e){let n=[...new Set(Ft(String(e)))];return rn(t,n.map(r=>({type:tn,name:r})))}function cn(t,e){let n=String(e),r=F(n),o=[];for(let s of dn(t))Q(s)&&(n===\"*\"||(s.namespaceURI===D?s[C]===r:s[C]===n))&&o.push(s);return o}function dn(t){let e=[],n=[],r=t[I];for(;r;){e.push(r);let o=r[I],s=r[S];o?(s&&n.push(s),r=o):r=s??n.pop()??null}return e}function Ct(t){let e=dn(t);return e.unshift(t),e}var ce=class extends Re{nodeType=qr;[C]=\"\";[te]=null;[Ae]=null;[I]=null;[G]=null;[S]=null;[W]=!1;get[j](){return this[U].defaultView[Me]}get localName(){return this[C]}get nodeName(){return this[C]}get ownerDocument(){return this[U]}get isConnected(){return this[W]}isDefaultNamespace(e){let n=Ee(e);return ti(this)===n}get parentNode(){return this[te]}set parentNode(e){}get parentElement(){let e=this[te];return!e||e.nodeType!==1?null:e}set parentElement(e){}get previousSibling(){return this[G]}set previousSibling(e){}get nextSibling(){return this[S]}set nextSibling(e){}get previousElementSibling(){let e=this[G];for(;e&&e.nodeType!==1;)e=e[G];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[I]}set firstChild(e){}get lastChild(){let e=this[I];for(;e;){let n=e[S];if(n==null)break;e=n}return e}set lastChild(e){}get nodeValue(){return kt(this)?this.data:null}set nodeValue(e){kt(this)&&(this.data=e)}get textContent(){if(kt(this))return this.data;let e=\"\";for(let n of dn(this))fr(n)&&(e+=n.data);return e}set textContent(e){if(kt(this))this.data=e;else if(po(this)){let n=e==null?\"\":String(e);n===\"\"?this.replaceChildren():this.replaceChildren(n)}}cloneNode(e){return sn(this,e)}contains(e){let n=e;for(;n!=null;){if(n===this)return!0;n=n.parentNode}return!1}};function ti(t){let e=t;for(;e;)switch(e.nodeType){case re:{let n=e;if(n.prefix==null&&n.namespaceURI!=null)return n.namespaceURI;let r=n.attributes.getNamedItemNS(Et,\"xmlns\");if(r!=null&&r.prefix==null)return Ee(r.value);e=n.parentElement;break}case Le:e=e.documentElement;break;case Xr:case ke:return null;case Xe:e=e.ownerElement;break;default:e=e.parentElement}return null}var de=Symbol(\"insertNode\"),hr=Symbol(\"preflightInsertions\"),un=Symbol(\"replaceNode\"),Ce=class extends ce{remove(){let e=this.parentNode;e&&e.removeChild(this)}replaceWith(...e){let n=$e(e),r=this.parentNode;if(r)return pr(o=>{we(r,n);let s=this[S];for(;s&&n.includes(s);)s=s[S];let i=mr(r,n,o);this.parentNode===r?r[un](i,this,o):r[de](i,s,o)})}before(...e){let n=$e(e),r=this.parentNode;if(r)return pr(o=>{we(r,n);let s=this[G];for(;s&&n.includes(s);)s=s[G];let i=mr(r,n,o);r[de](i,s?s[S]:r.firstChild,o)})}after(...e){let n=$e(e),r=this.parentNode;if(r)return pr(o=>{we(r,n);let s=this[S];for(;s&&n.includes(s);)s=s[S];let i=mr(r,n,o);r[de](i,s,o)})}};function pr(t){return X(()=>{let e=[];try{t(e)}catch(n){try{He(e)}catch{}throw n}He(e)})}function $e(t){return t.map(e=>e instanceof ce?e:String(e))}function Pt(t,e){return e instanceof ce?e:t.ownerDocument.createTextNode(String(e))}function we(t,e){for(let n of e){if(!(n instanceof ce))continue;let r=t;for(;r;){if(r===n)throw H(\"Cannot insert a node into itself or one of its descendants\",\"HierarchyRequestError\");r=r[te]??r[Ae]}}}function mr(t,e,n){let r=[];for(let s of e)r.push(Pt(t,s));if(r.length===1)return r[0];let o=t.ownerDocument.createDocumentFragment();o[hr](r);for(let s of r)o[de](s,null,n);return o}var fn,gr=0,mo=0,ho=0,go=0,Je=!1,br=!1,_t=!1,pn=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=ni(n),o=fn??=new WeakMap,s=o.get(e);s==null&&(s=new Map,o.set(e,s));let i=s.get(this);i==null?gr++:yr(i,-1),s.set(this,r),yr(r,1),this.#e.add(e)}disconnect(){let e=fn;if(e!=null){for(let n of this.#e){let r=e.get(n),o=r?.get(this);o!=null&&(r.delete(this),gr--,yr(o,-1)),r?.size===0&&e.delete(n)}this.#e.clear(),this.#n.length=0,gr===0&&(fn=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 ue(t){let e=fn;if(e==null)return;let n=new Map,r=t.target;for(;r;){let o=e.get(r);if(o)for(let[s,i]of o){if(r!==t.target&&!i.subtree)continue;let a=!1;if(t.type===\"attributes\"){if(!i.attributes||i.attributeFilter&&!i.attributeFilter.has(t.attributeName??\"\"))continue;a=i.attributeOldValue}else if(t.type===\"characterData\"){if(!i.characterData)continue;a=i.characterDataOldValue}else if(!i.childList)continue;n.set(s,n.get(s)===!0||a)}r=r.parentNode}for(let[o,s]of n)o.enqueue({addedNodes:t.addedNodes??new le,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 le,target:t.target,type:t.type})}function mn(...t){let e=new le;return e.push(...t),e}function ni(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 yr(t,e){t.attributes&&(mo+=e),t.characterData&&(ho+=e),t.childList&&(go+=e),Je=mo>0,br=ho>0,_t=go>0}var me=class extends Ce{childNodes=new le;children=new le;appendChild(e){return X(()=>this[de](e,null))}insertBefore(e,n){return X(()=>this[de](e,n||null))}append(...e){return X(()=>{let n=$e(e.filter(r=>r!=null));n.length>1&&we(this,n);for(let r of n)this[de](Pt(this,r),null)})}prepend(...e){return X(()=>{let n=$e(e.filter(o=>o!=null));n.length>1&&we(this,n);let r=this.firstChild;for(let o of n)this[de](Pt(this,o),r)})}replaceChildren(...e){return X(()=>{let n=$e(e.filter(o=>o!=null));we(this,n);let r;for(;r=this.firstChild;)this.removeChildImmediately(r);for(let o of n)this[de](Pt(this,o),null)})}removeChild(e){return X(()=>(this.removeChildImmediately(e),e))}removeChildImmediately(e){if(e.parentNode!==this)throw H(\"The node is not a child of this node\",\"NotFoundError\");let n=this[W]?Ct(e):void 0,r=e[G],o=e[S],s=hn(this,e);if(n)for(let i of n)i[W]=!1;this.queueRemovalMutationRecord(this,e,r,o),n&&this.enqueueTreeReactions(n,\"disconnectedCallback\"),He(this.collectRemovalHookEffects(e,s))}replaceChild(e,n){return X(()=>this[un](e,n))}[un](e,n,r){if(we(this,[e]),n.parentNode!==this)throw H(\"The reference node is not a child of this parent\",\"NotFoundError\");let o=n[G],s=n[S],i=this.prepareInsertion(e),a=this[W]?Ct(n):void 0,l=new Set(i.map(({node:u})=>u)),d=s;for(;d&&l.has(d);)d=d[S];let p=hn(this,n);if(a){for(let E of a)E[W]=!1;let u=new Set(a);for(let E of i)u.has(E.node)&&(E.shouldDisconnect=!1)}this.commitInsertion(i,d);let b=this[W];return this.queueRemovalMutationRecord(this,n,o,s),this.queueInsertionMutationRecords(i),a&&this.enqueueTreeReactions(a,\"disconnectedCallback\"),this.enqueueInsertionReactions(i,b),this.performOrCollectHookEffects([...this.collectRemovalHookEffects(n,p),...this.collectInsertionHookEffects(i)],r),n}querySelectorAll(e){return rn(this,e)}querySelector(e){return nn(this,e)}[de](e,n,r){return this.validateInsertion(e,n),this.insertIntoValidated(e,n,r),e}[hr](e){for(let n of e)this.validateInsertion(n,null),this.prepareInsertion(n)}validateInsertion(e,n){if(we(this,[e]),n&&n.parentNode!==this)throw H(\"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[W];this.queueInsertionMutationRecords(o),this.enqueueInsertionReactions(o,s),this.performOrCollectHookEffects(this.collectInsertionHookEffects(o),r)}performOrCollectHookEffects(e,n){n?n.push(...e):He(e)}prepareInsertion(e){let n=[];if(e.nodeType===ke){let i=e[I];for(;i;)n.push(i),i=i[S]}else n.push(e);let r=this[W],o=this[U],s=[];for(let i of n){let a=i[W],l=a||r,d,p;if(i[U]===o)l&&(d=Ct(i));else{let b=on(i);p=b.nodes,l&&(d=b.treeNodes)}s.push({node:i,nodes:d,adoption:p,shouldDisconnect:a})}return s}commitInsertion(e,n){for(let s of e){let i=s.node[te];if(i){let a=s.node[G],l=s.node[S];s.source={parent:i,index:hn(i,s.node),previousSibling:a,nextSibling:l}}}for(let s of e){let i=this.attachChild(s.node,n);s.insertIndex=i.index,s.previousSibling=i.previousSibling,s.nextSibling=i.nextSibling}let r=this[U];for(let{adoption:s}of e)s&&Rt(s,r);let o=this[W];for(let{nodes:s}of e)if(s)for(let i of s)i[W]=o}attachChild(e,n){if(n){let s=n[G];e[S]=n,e[G]=s,s?s[S]=e:this[I]=e,n[G]=e}else{e[S]=null;let s=this[I];if(s){let i;for(;i=s[S];)s=i;s[S]=e,e[G]=s}else this[I]=e,e[G]=null}let r=Q(e);e[te]=this;let o;if(n){if(o=this.childNodes.indexOf(n),this.childNodes.splice(o,0,e),r){let s=n;for(;s&&!Q(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[G],nextSibling:e[S]}}queueRemovalMutationRecord(e,n,r,o){_t&&ue({type:\"childList\",target:e,removedNodes:mn(n),previousSibling:r,nextSibling:o})}queueInsertionMutationRecords(e){if(_t)for(let n of e){let{node:r,source:o}=n;o&&this.queueRemovalMutationRecord(o.parent,r,o.previousSibling,o.nextSibling),ue({type:\"childList\",target:this,addedNodes:mn(r),previousSibling:n.previousSibling,nextSibling:n.nextSibling})}}collectRemovalHookEffects(e,n){return this.nodeType!==re||Tt(this)?[]:[[()=>this[j].removeChild?.(this,e,n)]]}collectInsertionHookEffects(e){let n=[];for(let r of e){let{node:o,source:s}=r;s?.parent.nodeType===re&&!Tt(s.parent)&&n.push([()=>s.parent[j].removeChild?.(s.parent,o,s.index)]),this.nodeType===re&&!Tt(this)&&n.push([()=>this[j].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){bo(e,n)}};function yo(t,e,n,r){if(e.parentNode!==t)throw Error(\"not a child of this node\");let o=t[W]?n.treeNodes:void 0,s=e[G],i=e[S],a=hn(t,e);if(o)for(let d of o)d[W]=!1;Rt(n.nodes,r),_t&&ue({type:\"childList\",target:t,removedNodes:mn(e),previousSibling:s,nextSibling:i}),o&&bo(o,\"disconnectedCallback\");let l=[];t.nodeType===re&&!Tt(t)&&l.push([()=>t[j].removeChild?.(t,e,a)]),He(l)}function hn(t,e){let n=e[G],r=e[S];n?n[S]=r:t[I]=r,r&&(r[G]=n);let o=t.childNodes.indexOf(e);return t.childNodes.splice(o,1),Q(e)&&t.children.splice(t.children.indexOf(e),1),e[te]=null,e[S]=null,e[G]=null,o}function bo(t,e){for(let n of t){let r=n[e];typeof r==\"function\"&&Xt(n,()=>r.call(n))}}function It(t,e,n,r,o){let{observedAttributes:s}=t.constructor,{attributeChangedCallback:i}=t;i==null||s==null||!s.includes(e)||Xt(t,()=>i.call(t,e,n,r,o))}var gn=class{[I]=null;constructor(e){this[ee]=e}getNamedItem(e){let n=String(e),r=this[ee][P]===D?F(n):n,o=this[I];for(;o;){if(o.name===r)return o;o=o[S]}return null}getNamedItemNS(e,n){let r=Ee(e),o=String(n),s=this[I];for(;s;){if(s.localName===o&&s[P]===r)return s;s=s[S]}return null}item(e){let n=this[I],r=0;for(;n;){if(r++===e)return n;n=n[S]}return null}get length(){let e=0,n=this[I];for(;n;)e++,n=n[S];return e}removeNamedItem(e){let n=String(e),r=this[ee][P]===D?F(n):n;return X(()=>this.removeNamedItemImmediately(o=>o.name===r))}removeNamedItemNS(e,n){let r=Ee(e),o=String(n);return X(()=>this.removeNamedItemImmediately(s=>s.localName===o&&s[P]===r))}removeNamedItemImmediately(e){let n=this[ee],r=this[I],o=null;for(;r!=null;){if(e(r)){o&&(o[S]=r[S]),this[I]===r&&(this[I]=r[S]);let s=r.value;return r[S]=null,r[ee]=null,Je&&ue({type:\"attributes\",target:n,attributeName:r.name,attributeNamespace:r[P],oldValue:s}),n[j].removeAttribute?.(n,r.name,r[P]),It(n,r.localName,s,null,r[P]),r}o=r,r=r[S]}return null}setNamedItem(e){return X(()=>this.setNamedItemImmediately(e))}setNamedItemImmediately(e){let n=this[ee],r=e[ee];if(r!=null&&r!==n)throw H(\"The attribute is already in use by another element.\",\"InUseAttributeError\");let o=null,s=this[I],i=null;for(;s;){if(s.localName===e.localName&&s[P]===e[P]){if(s===e)return s;i?i[S]=e:this[I]=e,e[S]=s[S],s[S]=null,o=s;break}i=s,s=s[S]}o==null&&(i?i[S]=e:this[I]=e),e[ee]=n,e[U]=n[U],o&&(o[ee]=null);let a=o==null||o.value!==e.value,l=o!=null&&o.name!==e.name;return a&&Je&&ue({type:\"attributes\",target:n,attributeName:e.name,attributeNamespace:e[P],oldValue:o?.value??null}),l&&n[j].removeAttribute?.(n,o.name,o[P]),(a||l)&&n[j].setAttribute?.(n,e.name,e.value,e[P]),a&&It(n,e.localName,o?.value??null,e.value,e[P]),o}setNamedItemNS(e){return this.setNamedItem(e)}*[Symbol.iterator](){let e=this[I];for(;e;)yield e,e=e[S]}};var Ue=class extends ce{nodeType=Xe;[P]=null;[S]=null;[ee]=null;constructor(e,n,r){super(),this[C]=e,this[Oe]=n,r&&(this[P]=r)}get nodeName(){return this[C]}set nodeName(e){}get name(){return this[C]}set name(e){}get localName(){if(this[P]==null)return this[C];let e=this[C].indexOf(\":\");return e<0?this[C]:this[C].slice(e+1)}get prefix(){if(this[P]==null)return null;let e=this[C].indexOf(\":\");return e<0?null:this[C].slice(0,e)}get value(){return this[Oe]}set value(e){let n=String(e),r=this[ee];if(!r){this[Oe]=n;return}X(()=>{let o=this[Oe];this[Oe]=n,Je&&o!==n&&ue({type:\"attributes\",target:r,attributeName:this[C],attributeNamespace:this[P],oldValue:o}),this[j].setAttribute?.(r,this[C],n,this[P]),It(r,this.localName,o,n,this[P])})}get nodeValue(){return this.value}set nodeValue(e){this.value=e}get ownerElement(){return this[ee]}get namespaceURI(){return this[P]}get specified(){return!0}};var ri={amp:\"&\",AMP:\"&\",apos:\"'\",gt:\">\",GT:\">\",lt:\"<\",LT:\"<\",quot:'\"',QUOT:'\"'},oi=new Set([\"area\",\"base\",\"br\",\"col\",\"embed\",\"hr\",\"img\",\"input\",\"link\",\"meta\",\"param\",\"source\",\"track\",\"wbr\"]),si=/(?:<([a-z][a-z0-9-:]*)((?:[\\s]+[^<>'\"=/\\s]+(?:=(['\"])[^]*?\\3|=[^>'\"\\s]*|))*)[\\s]*(\\/?)\\s*>|<\\/([a-z][a-z0-9-:]*)>|<!--(.*?)-->|([^<>]+))/gi,No=/\\s([^<>'\"=/\\n\\s]+)(?:=([\"'])([\\s\\S]*?)\\2|=([^>'\"\\n\\s]*)|)/g,ii=\"|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|\",ai=/^(?:color|face|size)$/i;function Eo(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 ri[n];let s=Number.parseInt(r??o,r?10:16);try{return String.fromCodePoint(s)}catch{return e}})}function To(t){return t.namespaceURI===D&&oi.has(t.localName)}function wo(t){let e=t.localName;return t[P]===ae&&(e===\"foreignObject\"||e===\"desc\"||e===\"title\")}function li(t,e){if(ii.includes(`|${t}|`))return!0;if(t!==\"font\")return!1;for(let n of e.matchAll(No))if(ai.test(n[1]))return!0;return!1}function yn(t,e){let n=e.ownerDocument,r=n.createDocumentFragment(),o=[],s=r;for(let i of t.matchAll(si)){let a=i[1];if(a){let l=i[2],d=F(a),p=o[o.length-1]?.element??e,b=p[P]===ae?ae:D;if(d===\"svg\")b=ae;else if(b===ae){if(wo(p))b=D;else if(li(d,l)){for(;o.length>0;){let T=o[o.length-1];if(T.element[P]!==ae||wo(T.element))break;o.pop(),s=T.target}b=D}}let u=b===D?d:a,E=n[qe](u,b,null,u);for(let T of l.matchAll(No))E.setAttribute(T[1],Eo(T[3]||T[4]||\"\"));if(s.append(E),To(E)||b!==D&&i[4])continue;o.push({element:E,target:s}),s=b===D&&d===\"template\"?E.content:E}else if(i[5]){let l=F(i[5]);for(let d=o.length-1;d>=0;d--){let p=o[d],b=F(p.element[C]);if(b===l){s=p.target,o.length=d;break}if(p.element[P]===D&&b===\"template\")break}}else i[6]?s.append(n.createComment(i[6])):s.append(Eo(i[7]))}return r}function bn(t){return vo([{type:\"content\",child:t[I]}])}function xo(t){return vo([{type:\"opening\",node:t}])}function vo(t){let e=[],n;for(;n=t.pop();)switch(n.type){case\"opening\":{let r=n.node;switch(r.nodeType){case re:{let o=r;e.push(`<${o[C]}`);let s=o[pe]?.[I];for(;s;){e.push(` ${s[C]}`);let a=s[Oe];a!==\"\"&&(a=String(a).replace(/&/g,\"&amp;\").replace(/\"/g,\"&quot;\"),e.push(`=\"${a}\"`)),s=s[S]}if(e.push(\">\"),To(o))break;let i=o.namespaceURI===D&&o.localName===\"template\"?o[be]:o;t.push({type:\"closing\",name:o[C]}),t.push({type:\"content\",child:i?.[I]??null});break}case Ke:{let o=r;e.push(o[ie].replace(/&/g,\"&amp;\").replace(/\"/g,\"&quot;\").replace(/</g,\"&lt;\").replace(/>/g,\"&gt;\"));break}case Ze:{let o=r;e.push(`<!--${o[ie]}-->`);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 B=class extends me{nodeType=re;[P]=D;[Se]=null;get namespaceURI(){return this[P]}get prefix(){return this[Se]}get localName(){let e=this[Se];return e==null?this[C]:this[C].slice(e.length+1)}get nodeName(){return this[P]===D?Zr(this[C]):this[C]}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 Ue(\"slot\",n))}get attributes(){let e=this[pe];return e||(e=new gn(this),this[pe]=e),e}getAttributeNames(){return[...this.attributes].map(e=>e.name)}getElementsByTagName(e){return cn(this,e)}get firstElementChild(){return this.children[0]??null}getElementsByClassName(e){return ln(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);er(r);let s=this[P]===D?F(r):r,i=this.attributes.getNamedItemNS(null,s);i?i.value=o:this.attributes.setNamedItem(new Ue(s,o))}setAttributeNS(e,n,r){let o=Ee(e),s=String(n),i=String(r),a=Bt(o,s,\"attribute\"),l=this.attributes.getNamedItemNS(a.namespace,a.localName);l?l.value=i:this.attributes.setNamedItemNS(new Ue(a.qualifiedName,i,a.namespace))}toggleAttribute(e,n){let r=String(e);er(r);let o=this[P]===D?F(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 Ue(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[P]===D?F(n):n;this.attributes.removeNamedItemNS(null,r)}removeAttributeNS(e,n){this.attributes.removeNamedItemNS(e,n)}get outerHTML(){return xo(this)}get innerHTML(){return bn(this)}set innerHTML(e){if(e==null||e===\"\")this.replaceChildren();else{let n=yn(String(e),this);this.replaceChildren(n)}}};var Qe=class t extends B{[P]=ae;get ownerSVGElement(){let e=null,n=this.parentNode;for(;n instanceof t;)e=n,n=n.parentNode;return e}};var Pe=class extends Ce{[ie]=\"\";constructor(e){super(),this[ie]=e==null?\"\":String(e)}setData(e){let n=br,r=n?this[ie]:null,o=\"\";e!=null&&(o=typeof e==\"string\"?e:String(e)),this[ie]=o,n&&r!==o&&ue({type:\"characterData\",target:this,oldValue:r}),this[j].setText?.(this,o)}get data(){return this[ie]}set data(e){this.setData(e)}};var et=class extends Pe{nodeType=Ke;[C]=\"#text\"};var tt=class extends Pe{nodeType=Ze;[C]=\"#comment\"};var nt=class extends me{nodeType=ke;[C]=\"#document-fragment\";[U]=typeof window<\"u\"?window.document:null;getElementById(e){return an(this,e)}};var rt=class extends B{get content(){let e=this[be];return e||(e=this.ownerDocument.createDocumentFragment(),e[Ae]=this,this[be]=e),e}set content(e){}set innerHTML(e){this.content.replaceChildren(yn(String(e),this))}get innerHTML(){let e=this[be];return e?bn(e):\"\"}};var En=class extends B{};var wn=class extends B{};var Nn=class extends B{};var Dt=class extends me{nodeType=Le;[C]=\"#document\";[W]=!0;constructor(e){super(),this.defaultView=e,this[U]=this,this.documentElement=xn(new Nn,this,\"html\"),this.body=xn(new En,this,\"body\"),this.head=xn(new wn,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 ln(this,e)}createElement(e){let n=String(e);return eo(n),Er(this,F(n))}createElementNS(e,n){let r=Bt(e,n,\"element\");return Er(this,r.qualifiedName,r.namespace,r.prefix,r.localName)}[qe](e,n,r,o){return Er(this,e,n,r,o)}createTextNode(e){let n=Tn(new et(e),this);return this[j].createText?.(n,n.data),n}createComment(e){return Tn(new tt(e),this)}createDocumentFragment(){return Tn(new nt,this)}createEvent(){return new q(\"\")}getElementById(e){return an(this,e)}getElementsByTagName(e){return cn(this,e)}importNode(e,n){if(e.nodeType===Le)throw H(\"Cannot import a document node\",\"NotSupportedError\");return sn(e,n,this)}adoptNode(e){if(e[U]===this)return e;let n=on(e);return X(()=>{let r=e.parentNode;return r?yo(r,e,n,this):Rt(n.nodes,this),e})}};function Tn(t,e){return Object.defineProperty(t,U,{value:e,writable:!0,enumerable:!1}),t}function Er(t,e,n=D,r=null,o=e){let s;if(n===ae)s=new Qe;else if(n===D&&o===\"template\")s=new rt;else if(n===D){let i=t.defaultView.customElements.get(o);s=i?new i:new B}else s=new B;return xn(s,t,e,n,r)}function xn(t,e,n,r=D,o=null){return Tn(t,e),Object.defineProperties(t,{[C]:{value:n},[P]:{value:r},[Se]:{value:o}}),e[j].createElement?.(t,r),t}var vn=class extends q{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 Sn=class extends q{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 On=class extends q{constructor(e,n){super(e,n),this.promise=n.promise,this.reason=n.reason}};var An=class extends q{constructor(e,n){super(e,n),this.oldState=n.oldState,this.newState=n.newState}};var kn=class extends q{constructor(e,n={}){super(e,n),this.relatedTarget=n.relatedTarget??null}};var Rn=class extends q{constructor(e,n={}){super(e,n),this.clipboardData=n.clipboardData??null}};var Cn=class extends B{};var ci=/^[a-z][^A-Z\\u0000\\t\\n\\f\\r />]*-[^A-Z\\u0000\\t\\n\\f\\r />]*$/u,di=new Set([\"annotation-xml\",\"color-profile\",\"font-face\",\"font-face-src\",\"font-face-uri\",\"font-face-format\",\"font-face-name\",\"missing-glyph\"]);function So(t){return ci.test(t)&&!di.has(t)}function Oo(t){return H(`Invalid custom element name: \"${t}\"`,\"SyntaxError\")}var Pn=class{registry=new Map;listenersByName=new Map;define(e,n,r){if(!So(e))throw Oo(e);if(this.registry.has(e))throw H(`A custom element named \"${e}\" has already been defined`,\"NotSupportedError\");if(this.getName(n)!=null)throw H(\"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(!So(e))return Promise.reject(Oo(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 ui=[\"onerror\",\"onunhandledrejection\"],ko=Symbol.for(\"@remote-dom/polyfill/global-property\");function Ro(t){return Object.getOwnPropertyDescriptors(t)}function Co(t){let e={};for(let[n,r]of Object.entries(Object.getOwnPropertyDescriptors(Re.prototype)))n!==\"constructor\"&&typeof r.value==\"function\"&&(r.value=wr(r.value.bind(t)),e[n]=r);return e}function Po(t){let e={};for(let n of ui)e[n]={configurable:!0,enumerable:!0,get:wr(()=>t[n]),set:wr(r=>{t[n]=r})};return e}function fi(t){return Object.assign(Ro(t),Co(t),Po(t))}function wr(t){return Object.defineProperty(t,ko,{value:!0}),t}function Ao(t,e){for(let n of Reflect.ownKeys(e)){let r=pi(t,n);(r==null||mi(r))&&Object.defineProperty(t,n,e[n])}}function pi(t,e){let n=t;for(;n;){let r=Object.getOwnPropertyDescriptor(n,e);if(r)return r;n=Object.getPrototypeOf(n)}}function mi(t){return[t.value,t.get,t.set].some(e=>typeof e==\"function\"&&e[ko]===!0)}var Ge=class extends Re{[j]={};[zt]=[];[Me]=gi(this);name=\"\";window=this;parent=this;self=this;top=this;document=new Dt(this);customElements=new Pn;location=globalThis.location;navigator=globalThis.navigator;Event=q;ErrorEvent=Sn;PromiseRejectionEvent=On;ToggleEvent=An;FocusEvent=kn;ClipboardEvent=Rn;EventTarget=Re;CustomEvent=vn;Node=ce;ParentNode=me;ChildNode=Ce;DocumentFragment=nt;Document=Dt;CharacterData=Pe;Comment=tt;Text=et;Element=B;HTMLElement=Cn;SVGElement=Qe;HTMLTemplateElement=rt;MutationObserver=pn;#t=null;#n=null;#e=null;static with(...e){let n=this;return class extends n{constructor(){super();for(let o of e)hi(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=Ro(e),s=Object.assign(Co(e),Po(e));delete o.self,Object.defineProperties(globalThis,o),Ao(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),Ao(n,s))}static setGlobalThis(e){for(let n in e)e[n]===e&&(e[n]=globalThis);Object.defineProperties(globalThis,fi(e))}};function hi(t,e){t[zt].push(e(t)??{})}function gi(t){return{createElement:Ne.bind(null,t,\"createElement\"),setAttribute:Ne.bind(null,t,\"setAttribute\"),removeAttribute:Ne.bind(null,t,\"removeAttribute\"),createText:Ne.bind(null,t,\"createText\"),setText:Ne.bind(null,t,\"setText\"),insertChild:Ne.bind(null,t,\"insertChild\"),removeChild:Ne.bind(null,t,\"removeChild\"),addEventListener:Ne.bind(null,t,\"addEventListener\"),removeEventListener:Ne.bind(null,t,\"removeEventListener\")}}function Ne(t,e,...n){for(let s of t[zt])s[e]?.apply(s,n);let r=t[j];r[e]?.apply(r,n)}var _n=new Ge;var Nr=\"~\";var _e=new WeakMap;function ot(t){return _e.get(t)}var Sr=new WeakMap,bi=0;function oe(t){let e=Sr.get(t);return e==null&&(e=String(bi++),In(t,e)),e}function In(t,e){Sr.set(t,e)}var xr=new WeakMap;function Ei(t){return xr.get(t)}var vr=new WeakMap;function wi(t){let e=vr.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 Ni=new WeakMap;function Ti(t){return Ni.get(t)}function Or(t,e,n){let r=xr.get(t);if(r==null&&(r={},xr.set(t,r)),r[e]===n)return;r[e]=n;let o=_e.get(t);o?.mutate([[3,oe(t),e,n,1]])}function Ie(t,e,n){let r=vr.get(t);if(r==null&&(r={},vr.set(t,r)),r[e]===n)return;n==null?delete r[e]:r[e]=String(n);let o=_e.get(t);o?.mutate([[3,oe(t),e,n,2]])}function st(t,e){if(_e.get(t)!==e&&(_e.set(t,e),t.childNodes))for(let r=0;r<t.childNodes.length;r++)st(t.childNodes[r],e)}function Dn(t){if(_e.get(t)!=null&&(_e.delete(t),t.childNodes))for(let n=0;n<t.childNodes.length;n++)Dn(t.childNodes[n])}function it(t){let{nodeType:e}=t;switch(e){case 1:return{id:oe(t),type:e,element:t.localName,properties:Tr(Ei(t)),attributes:Tr(wi(t)),eventListeners:Tr(Ti(t)),children:Array.from(t.childNodes).map(it)};case 3:case 8:return{id:oe(t),type:e,data:t.data};default:throw new Error(`Cannot serialize node of type ${t.nodeType} (${typeof t.nodeType})`)}}function Tr(t){return t?{...t}:void 0}function Ar(t,e,...n){let r=Sr.get(t),o=_e.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 at=_n[j];at.insertChild=(t,e,n)=>{let r=ot(t);r!=null&&(st(e,r),r.mutate([[0,oe(t),it(e),n]]))};at.removeChild=(t,e,n)=>{let r=ot(t);r!=null&&(Dn(e),r.mutate([[1,oe(t),n]]))};at.setText=(t,e)=>{let n=ot(t);n?.mutate([[2,oe(t),e]])};at.setAttribute=(t,e,n)=>{t.tagName.includes(\"-\")||Ie(t,e,n)};at.removeAttribute=(t,e)=>{t.tagName.includes(\"-\")||Ie(t,e)};Ge.setGlobal(_n);var Do=[\"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\"],Mo=[\"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\"],Lo=[\"self\",\"postMessage\",\"setTimeout\",\"clearTimeout\",\"setInterval\",\"clearInterval\",\"queueMicrotask\",\"structuredClone\",\"crypto\",\"console\",\"DOMException\"],Ho=[\"TEMPORARY\",\"PERSISTENT\"],jd=Object.freeze([...Do,...Mo,...Lo,...Ho]),Vd=Object.freeze([\"constructor\",\"__defineGetter__\",\"__defineSetter__\",\"hasOwnProperty\",\"__lookupGetter__\",\"__lookupSetter__\",\"isPrototypeOf\",\"propertyIsEnumerable\",\"toString\",\"valueOf\",\"__proto__\",\"toLocaleString\"]),Io=t=>typeof t==\"symbol\"?`[${t.description??\"symbol\"}]`:t;function $o(t=globalThis,e=[],n={}){let r=[],o=[],s=new Set([...Do,...Mo,...Lo,...e,\"constructor\",Symbol.toStringTag]),i=(m,g)=>{let N=Reflect.getOwnPropertyDescriptor(m,g);return N===void 0||!(\"value\"in N)||N.writable||N.configurable?!1:n.primitivesStay&&typeof g==\"symbol\"&&(typeof N.value!=\"object\"||N.value===null)&&typeof N.value!=\"function\"?!0:Ho.includes(g)&&typeof N.value==\"number\"},a=t,l=a.setTimeout,d=a.setInterval,p=a.crypto,b=(m,g)=>function(N,w,..._){if(typeof N!=\"function\")throw new TypeError(`${g} takes a function: a guest view cannot run code from text`);return m.call(t,N,w,..._)},u=p?Object.freeze({getRandomValues:m=>p.getRandomValues(m)}):void 0,E=a.document?.defaultView;if(E&&E!==a)for(let m of Reflect.ownKeys(E))typeof m==\"symbol\"||s.has(m)||Reflect.deleteProperty(E,m)||o.push(`window.${m}`);let T=[];for(let m=t;m&&m!==Object.prototype;m=Object.getPrototypeOf(m))T.push(m);for(let m of T)for(let g of Reflect.ownKeys(m))s.has(g)||(Reflect.deleteProperty(m,g)?r.push(Io(g)):i(m,g)||o.push(Io(g)));let v=()=>function(){throw new EvalError(\"A guest view cannot make code from text.\")},h=[Function.prototype,Object.getPrototypeOf(async function(){}),Object.getPrototypeOf(function*(){}),Object.getPrototypeOf(async function*(){})];for(let m of h){let g=v();Object.defineProperty(g,\"prototype\",{value:m,writable:!1,enumerable:!1,configurable:!1}),Reflect.defineProperty(m,\"constructor\",{value:g,writable:!1,enumerable:!1,configurable:!1})||o.push(\"Function.prototype.constructor\"),m===Function.prototype&&Reflect.defineProperty(t,\"Function\",{value:g,writable:!0,enumerable:!1,configurable:!0})}let f=(m,g)=>{Reflect.defineProperty(t,m,{value:g,writable:!0,enumerable:!0,configurable:!0})||o.push(m)};f(\"setTimeout\",b(l,\"setTimeout\")),f(\"setInterval\",b(d,\"setInterval\")),u&&f(\"crypto\",u);for(let m of T.slice(1))Object.freeze(m);for(let m of Reflect.ownKeys(t)){let g=Reflect.getOwnPropertyDescriptor(t,m);Reflect.defineProperty(t,m,\"value\"in g?{...g,writable:!1,configurable:!1}:{...g,configurable:!1})}let c;try{c=Reflect.preventExtensions(t)}catch{c=!1}return{removed:r,stuck:o,sealed:c}}var Mt=class extends HTMLElement{constructor(){super(),In(this,Nr)}connect(e){if(ot(this)===e||(st(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,it(o),r])}e.mutate(n)}updateRemoteProperty(e,n){Or(this,e,n)}callRemoteMethod(e,...n){return Ar(this,e,...n)}};var x={},Mn={empty:!0},xi={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\"},ct={div:x,section:x,article:x,aside:x,header:x,footer:x,nav:x,hgroup:x,search:x,address:x,figure:x,figcaption:x,blockquote:x,p:x,pre:x,hr:Mn,br:Mn,wbr:Mn,h1:x,h2:x,h3:x,h4:x,h5:x,h6:x,span:x,strong:x,em:x,b:x,i:x,u:x,s:x,small:x,mark:x,abbr:x,cite:x,q:x,code:x,kbd:x,samp:x,var:x,sub:x,sup:x,dfn:x,bdi:x,bdo:x,ruby:x,rt:x,rp:x,time:{attributes:{datetime:\"text\"}},data:{attributes:{value:\"text\"}},del:{attributes:{datetime:\"text\"}},ins:{attributes:{datetime:\"text\"}},a:{attributes:{href:\"link\"}},ul:x,menu:x,dl:x,dt:x,dd:x,ol:{attributes:{start:\"number\",reversed:\"boolean\",type:{oneOf:[\"1\",\"a\",\"A\",\"i\",\"I\"]}}},li:{attributes:{value:\"number\"}},table:x,caption:x,thead:x,tbody:x,tfoot:x,tr:x,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:x,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:x,output:x,meter:{attributes:{value:\"number\",min:\"number\",max:\"number\",low:\"number\",high:\"number\",optimum:\"number\"}},progress:{attributes:{value:\"number\",max:\"number\"}},img:{empty:!0,attributes:{src:\"image\",alt:\"text\",width:\"number\",height:\"number\",decoding:{oneOf:[\"async\",\"sync\",\"auto\"]}}},\"graview-video\":Mn},vi=[\"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\"],Si={id:\"text\",class:\"text\",style:\"style\",lang:\"text\",role:\"text\",tabindex:{oneOf:[\"-1\",\"0\"]},transform:\"geometry\",...Object.fromEntries(vi.map(t=>[t,\"css\"]))},lt={x:\"geometry\",y:\"geometry\",width:\"geometry\",height:\"geometry\"},Ln={viewBox:\"geometry\",preserveAspectRatio:\"geometry\"},Uo={gradientUnits:{oneOf:[\"userSpaceOnUse\",\"objectBoundingBox\"]},gradientTransform:\"geometry\",spreadMethod:{oneOf:[\"pad\",\"reflect\",\"repeat\"]},href:\"fragment\"},Hn={svg:{attributes:{...lt,...Ln}},g:x,defs:x,symbol:{attributes:{...lt,...Ln,refX:\"geometry\",refY:\"geometry\"}},use:{attributes:{...lt,href:\"fragment\"}},title:x,desc:x,path:{attributes:{d:\"geometry\",pathLength:\"number\"}},rect:{attributes:{...lt,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\",...Uo}},radialGradient:{attributes:{cx:\"geometry\",cy:\"geometry\",r:\"geometry\",fx:\"geometry\",fy:\"geometry\",fr:\"geometry\",...Uo}},stop:{attributes:{offset:\"geometry\"}},clipPath:{attributes:{clipPathUnits:{oneOf:[\"userSpaceOnUse\",\"objectBoundingBox\"]}}},mask:{attributes:{...lt,maskUnits:{oneOf:[\"userSpaceOnUse\",\"objectBoundingBox\"]},maskContentUnits:{oneOf:[\"userSpaceOnUse\",\"objectBoundingBox\"]}}},pattern:{attributes:{...lt,...Ln,patternUnits:{oneOf:[\"userSpaceOnUse\",\"objectBoundingBox\"]},patternContentUnits:{oneOf:[\"userSpaceOnUse\",\"objectBoundingBox\"]},patternTransform:\"geometry\",href:\"fragment\"}},marker:{attributes:{...Ln,markerWidth:\"geometry\",markerHeight:\"geometry\",refX:\"geometry\",refY:\"geometry\",orient:\"geometry\",markerUnits:{oneOf:[\"strokeWidth\",\"userSpaceOnUse\"]}}}};var Go=[\"alert\",\"alertdialog\",\"dialog\",\"banner\",\"main\",\"navigation\",\"contentinfo\",\"complementary\",\"search\",\"form\",\"region\",\"application\",\"status\",\"log\",\"marquee\",\"timer\"],Lt={nav:\"div\",header:\"div\",footer:\"div\",aside:\"div\",search:\"div\",output:\"span\"},$n={section:[\"aria-label\",\"aria-labelledby\",\"title\"]};function Oi(t){return/^aria-[a-z]+$/.test(t)}function Ai(t){return/^data-[a-z0-9][a-z0-9_.-]*$/.test(t)}var jo=[\"all\",\"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\"],Vo=[\"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\"],zo=[\"fill\",\"stroke\",\"clip-path\",\"mask\",\"marker\",\"marker-start\",\"marker-mid\",\"marker-end\"],Fo=[\"media\",\"supports\",\"container\",\"keyframes\"],Bo={position:[\"static\",\"relative\",\"absolute\",\"sticky\"],all:[],appearance:[\"auto\",\"none\",\"menulist-button\",\"textfield\"],\"-webkit-appearance\":[\"auto\",\"none\",\"menulist-button\",\"textfield\"]},Yo=[\"host\",\"host-context\",\"slotted\",\"part\",\"backdrop\",\"picker\",\"view-transition\",\"view-transition-group\",\"view-transition-image-pair\",\"view-transition-old\",\"view-transition-new\"],Un=64e3,kr=4e3,Wo=1e5,Ht=512e3,Rr=1e4,qo=\"http://www.w3.org/1999/xhtml\",Xo=\"http://www.w3.org/2000/svg\",ki=new Map(Object.keys(Hn).map(t=>[t.toLowerCase(),t]));function Gn(t){return ki.get(t.toLowerCase())}function jn(t,e,n){let r=n.toLowerCase(),o=t===\"html\"?[ct[e]?.attributes,xi]:[Hn[e]?.attributes,Si],s=t===\"svg\"&&r===\"xlink:href\"?\"href\":r;for(let i of o)if(i){for(let[a,l]of Object.entries(i))if(a.toLowerCase()===s)return{name:a,kind:l}}if(Oi(r)||Ai(r))return{name:r,kind:\"text\"}}function Ko(t){if(typeof t==\"string\")return{type:\"navigate\",to:t};let{place:e,record:n,where:r,section:o}=t??{},s={...r===void 0?{}:{where:r},...o===void 0?{}:{section:String(o)}};return typeof e==\"string\"?{type:\"navigate\",place:e,...s}:typeof n==\"string\"?{type:\"navigate\",to:n,...s}:void 0}var Zo=[\"wheel\",\"drag\",\"pinch\"];var Jo=\"~\",Vn=t=>typeof t==\"object\"&&t!==null&&!Array.isArray(t),he=(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=>he(n,e+1)):Object.fromEntries(Object.entries(t).map(([n,r])=>[n,he(r,e+1)]))};function Qo(){let t=new Map,e=new Map,n=new Map([[Jo,{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 b of p.listeners.values())s(b);for(let b of p.children)i(b)}},a=(d,p,b=0)=>{if(!Vn(d)||b>64)return he(d);let u=typeof d.id==\"string\"?d.id:void 0,E=p&&u!==void 0&&u!==Jo;E&&i(u);let T={children:[],listeners:new Map};E&&n.set(u,T);let v={};for(let[h,f]of Object.entries(d))h===\"children\"&&Array.isArray(f)?v[h]=f.map(c=>{let m=a(c,E,b+1);return E&&Vn(c)&&typeof c.id==\"string\"&&T.children.push(c.id),m}):h===\"eventListeners\"&&Vn(f)?v[h]=Object.fromEntries(Object.entries(f).map(([c,m])=>{if(typeof m!=\"function\"||!E)return[c,void 0];let g=o(m);return T.listeners.set(c,g),[c,{listener:g}]})):v[h]=he(f,b+1);return v},l=d=>{if(!Array.isArray(d))return he(d);let[p,b]=d,u=typeof b==\"string\"?n.get(b):void 0;if(p===0){let E=a(d[2],u!==void 0),T=Vn(d[2])?d[2].id:void 0;if(u&&typeof T==\"string\"&&n.has(T)){let v=Number(d[3]);u.children.splice(Number.isInteger(v)&&v>=0&&v<=u.children.length?v:u.children.length,0,T)}return[p,he(b),E,he(d[3])]}if(p===1){let E=Number(d[2]);return u&&Number.isInteger(E)&&E>=0&&E<u.children.length&&i(u.children.splice(E,1)[0]),he(d)}if(p===3&&d[4]===3){let E=String(d[2]),T=d[3],v=u&&typeof T==\"function\"?o(T):void 0,h=u?.listeners.get(E);return h!==void 0&&s(h),v===void 0?u?.listeners.delete(E):u.listeners.set(E,v),[p,he(b),E,v===void 0?void 0:{listener:v},3]}return he(d)};return{encode:d=>d.map(l),listener:d=>t.get(d)?.listener,get listening(){return t.size},get nodes(){return n.size-1}}}var Cr=\"graview-view-root\",Ri=[\"value\",\"checked\",\"key\",\"pressed\",\"files\",\"refused\",\"x\",\"y\",\"width\",\"height\",\"deltaX\",\"deltaY\",\"deltaMode\",\"ctrlKey\",\"metaKey\",\"phase\",\"pointerId\",\"button\",\"pressure\",\"dx\",\"dy\",\"scale\",\"rotation\"],Ci=t=>t.replace(/&/g,\"&amp;\").replace(/</g,\"&lt;\").replace(/>/g,\"&gt;\").replace(/\"/g,\"&quot;\").replace(/'/g,\"&#39;\"),Pi=t=>Object.freeze({html:t,toString:()=>t}),es=t=>typeof t==\"object\"&&t!==null&&typeof t.html==\"string\"&&Object.isFrozen(t),ts=t=>t==null||t===!1?\"\":Array.isArray(t)?t.map(ts).join(\"\"):es(t)?t.html:Ci(String(t));function ns(t){customElements.get(Cr)||customElements.define(Cr,Mt);let e=Event,n=Qo(),r=new Set,o=new Set,s,i=[],a=new Set;for(let y of[\"closest\",\"matches\",\"dataset\"]){let O=()=>{throw new TypeError(`A view's element has no ${y}: graview.on hands event.element, the element its selector matched; read event.element.getAttribute(\"data-\\u2026\").`)};y in Element.prototype||Object.defineProperty(Element.prototype,y,y===\"dataset\"?{get:O}:{value:O})}let l=document.createElement(Cr),d=y=>{let O=A=>{for(let R of Array.from(A.childNodes)){if(R.nodeType!==1)continue;if(oe(R)===y)return R;let k=O(R);if(k)return k}};return O(l)},p=y=>{let O=d(y.target);if(!O)return;let A=new e(y.event,{bubbles:!0}),R={};for(let k of Ri)y[k]!==void 0&&(R[k]=y[k]);for(let k of Object.keys(R))Object.defineProperty(A,k,{value:R[k],enumerable:!0});O.dispatchEvent(A);for(let k of o){if(k.type!==y.event)continue;let L;try{L=new Set(Array.from(l.querySelectorAll(k.selector)))}catch{continue}for(let J=O;J&&J!==l;J=J.parentNode)if(L.has(J)){k.listener(Object.freeze({type:y.event,target:O,element:J,...R}));break}}},b=y=>{if(y.type===\"dom-event\"&&typeof y.target==\"string\")return p(y);if(y.type===\"notice\")return t.warn(y.text);if(y.type!==\"props\")return;s=y.props;let O=t.now();for(let k of r)try{k(y.props)}catch(L){t.threw(L)}let A=t.now()-O,R=y.push;typeof R==\"number\"&&t.microtask(()=>t.microtask(()=>t.send({type:\"pushed\",push:R,ms:A})))},u;l.connect({mutate(y){u||(u=[],t.microtask(()=>{let O=u??[];u=void 0,t.send({type:\"render\",records:n.encode(O)})})),u.push(...y)},call:()=>{}});let E=y=>y.nodeType===1?y.getAttribute(\"data-key\")??y.getAttribute(\"id\"):null,T=(y,O)=>y.nodeType===O.nodeType&&(y.nodeType!==1||y.localName===O.localName&&y.namespaceURI===O.namespaceURI&&E(y)===E(O));function v(y,O){let A=Array.from(O.childNodes),R=0;for(let k of A){let L=y.childNodes[R]??null;if(L&&T(L,k)){h(L,k),R+=1;continue}if(E(k)!==null){let ve=Array.from(y.childNodes).slice(R+1).find(bt=>T(bt,k));if(ve){y.insertBefore(ve,L),h(ve,k),R+=1;continue}}y.insertBefore(k,L),R+=1}for(;y.childNodes.length>R;)y.removeChild(y.lastChild)}function h(y,O){if(y.nodeType!==1){y.data!==O.data&&(y.data=O.data);return}let A=y,R=O,k=f(A);for(let L of A.getAttributeNames())R.hasAttribute(L)||(A.removeAttribute(L),k&&Ie(A,L,void 0));for(let L of R.getAttributeNames()){let J=R.getAttribute(L);A.getAttribute(L)!==J&&A.setAttribute(L,J),k&&Ie(A,L,J)}v(A,R)}let f=y=>y.localName.includes(\"-\");function c(y){for(let O of Array.from(y.childNodes)){if(O.nodeType!==1)continue;let A=O;if(f(A))for(let R of A.getAttributeNames())Ie(A,R,A.getAttribute(R)??void 0);c(A)}}function m(y,O,A){for(let R of Array.from(y.childNodes)){if(R.nodeType!==1)continue;let k=R,L=k.localName,J=O||L.toLowerCase()===\"svg\",ve=J?Gn(L):Object.prototype.hasOwnProperty.call(ct,L.toLowerCase())?L.toLowerCase():void 0;if(!ve){A.add(`<${L}>`);continue}for(let bt of k.getAttributeNames())(!jn(J?\"svg\":\"html\",ve,bt)||!J&&$n[ve]?.includes(bt.toLowerCase()))&&A.add(`${ve} ${bt}`);m(k,J,A)}}function g(y){let O=document.createElement(\"div\"),A=Array.isArray(y)?y:[y];for(let k of A)if(k!=null)if(typeof k==\"string\"||es(k)){let L=document.createElement(\"div\");L.innerHTML=typeof k==\"string\"?k:k.html,O.append(...Array.from(L.childNodes))}else O.append(k);let R=new Set;m(O,!1,R),i=[...R],i.length>0&&t.warn(`The host will not draw: ${i.join(\", \")}`),c(O),v(l,O)}let N=[],w=new Set(Zo),_=\"[]\",M=!1,V=()=>{M||(M=!0,t.microtask(()=>{M=!1;let y=[...new Map([...o].filter(A=>w.has(A.type)).map(A=>[`${A.type} ${A.selector}`,{event:A.type,selector:A.selector}])).entries()].sort(([A],[R])=>A<R?-1:A>R?1:0).map(([,A])=>A),O=JSON.stringify(y);O!==_&&(_=O,t.send({type:\"gestures\",bound:y}))}))};return{view:Object.freeze({get props(){return s},onProps(y){return r.add(y),s&&y(s),()=>void r.delete(y)},render:g,style(y){typeof y!=\"string\"||N.includes(y)||(N.push(y),t.send({type:\"style\",sheets:[...N]}))},on(y,O,A){let R={type:y,selector:O,listener:A};return o.add(R),typeof y==\"string\"&&!a.has(y)&&(a.add(y),t.send({type:\"hears\",events:[y]})),w.has(y)&&V(),()=>{o.delete(R),w.has(y)&&V()}},act:(y,O={})=>t.act(y,O),navigate(y){if(typeof y==\"string\")return t.navigate(y);let O=Ko(y);O&&t.send(O)},html(y,...O){return Pi(y.reduce((A,R,k)=>A+R+(k<O.length?ts(O[k]):\"\"),\"\"))},get refused(){return i},get hardening(){return t.hardening()}}),hear:b,find:y=>{try{let O=l.querySelectorAll(y)[0];return O?oe(O):void 0}catch{return}},listened:y=>{let O=new Set;for(let A of o)if(A.type===y)try{for(let R of Array.from(l.querySelectorAll(A.selector))){let k=oe(R);k&&O.add(k)}}catch{}return[...O]}}}var rs=t=>t.toLowerCase().replace(/[^a-z0-9]+/g,\"-\").replace(/^-|-$/g,\"\");function $t(t,e){let n=t.find(s=>s.as===e);if(n)return n;let r=e.trim().toLowerCase(),o=rs(e);return t.find(s=>s.title!==void 0&&s.title.trim().toLowerCase()===r)??(o?t.find(s=>s.as===o||s.title!==void 0&&rs(s.title)===o):void 0)}var ge=t=>` Its places: ${t.map(e=>typeof e==\"string\"?`\"${e}\"`:e.title&&e.title!==e.as?`\"${e.as}\" (${e.title})`:`\"${e.as}\"`).join(\", \")||\"none\"}.`,dt=\" This run was not handed the views the host keeps, so a titled view's place is not among these: if it names one, the link goes there.\",Ut=t=>`\"${t.length>80?`${t.slice(0,79)}\\u2026`:t}\"`;var os=[\"https:\",\"mailto:\",\"tel:\"];function ss(t){if(!(typeof t!=\"string\"||t.length>2e3||/[\\s<>\"]/.test(t.trim())||t.trim()!==t))try{let e=new URL(t);return!os.includes(e.protocol)||e.protocol===\"https:\"&&(e.hostname===\"\"||e.username!==\"\"||e.password!==\"\")?void 0:e.href}catch{return}}function is(t){let e=new Set,n=r=>{if(typeof r!=\"string\"||!/^(https|mailto|tel):/i.test(r))return;let o=ss(r);o&&e.add(o)};for(let r of[...t?.node?[t.node]:[],...t?.nodes??[]])for(let[o,s]of Object.entries(r))o===\"id\"||o===\"kind\"||(Array.isArray(s)?s.forEach(n):n(s));return e}function as(t){return(t??[]).flatMap(e=>{try{let n=new URL(e);return n.protocol===\"https:\"&&n.hostname!==\"\"&&n.username===\"\"&&n.password===\"\"?[n.origin]:[]}catch{return[]}})}function ls(t,e){let n=ss(t);if(n&&(e.handed.has(n)||n.startsWith(\"https:\")&&as(e.origins).includes(new URL(n).origin)))return n}function cs(t,e){let n=t.length>120?`${t.slice(0,119)}\\u2026`:t,r=\"\";try{r=new URL(t).protocol}catch{r=\"\"}if(!os.includes(r))return`The link \"${n}\" was not drawn: a view links only to an https:, mailto: or tel: address.`;let o=as(e);return`The link \"${n}\" was not drawn: it is no address this view was handed. A view links out only to an address a record it was shown holds (a url field), as the record holds it${o.length>0?`, or an https: address on ${o.join(\", \")}`:\"\"}; a record or a place of this app is <a data-record> or <a data-place>.`}var K=t=>t>=48&&t<=57,ds=t=>K(t)||t>=65&&t<=70||t>=97&&t<=102,Lr=t=>t>=65&&t<=90||t>=97&&t<=122,Hr=t=>t>=128,zn=t=>Lr(t)||Hr(t)||t===95,us=t=>zn(t)||K(t)||t===45,fs=t=>t===10,Te=t=>t===10||t===9||t===32,_i=t=>t>=0&&t<=8||t===11||t>=14&&t<=31||t===127,fe=-1;function Ii(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 Di(t){let e=Ii(t),n=0,r=(h=0)=>n+h<e.length?e[n+h]:fe,o=[],s=(h,f)=>h===92&&f!==10&&f!==fe,i=(h,f,c)=>h===45?zn(f)||f===45||s(f,c):zn(h)?!0:s(h,f),a=(h,f,c)=>h===43||h===45?K(f)||f===46&&K(c):K(h===46?f:h),l=()=>{let h=r();if(n+=1,h===fe)return 65533;if(ds(h)){let f=String.fromCodePoint(h);for(;f.length<6&&ds(r());)f+=String.fromCodePoint(r()),n+=1;Te(r())&&(n+=1);let c=parseInt(f,16);return c===0||c>=55296&&c<=57343||c>1114111?65533:c}return h},d=()=>{let h=\"\";for(;;){let f=r();if(us(f))h+=String.fromCodePoint(f),n+=1;else if(s(f,r(1)))n+=1,h+=String.fromCodePoint(l());else return h}},p=()=>{let h=\"\";for((r()===43||r()===45)&&(h+=String.fromCodePoint(e[n++]));K(r());)h+=String.fromCodePoint(e[n++]);if(r()===46&&K(r(1)))for(h+=String.fromCodePoint(e[n++],e[n++]);K(r());)h+=String.fromCodePoint(e[n++]);if((r()===69||r()===101)&&(K(r(1))||(r(1)===43||r(1)===45)&&K(r(2))))for(h+=String.fromCodePoint(e[n++]),K(r())||(h+=String.fromCodePoint(e[n++]));K(r());)h+=String.fromCodePoint(e[n++]);return h},b=()=>{let h=p();return i(r(),r(1),r(2))?{type:\"dimension\",repr:h,unit:d()}:r()===37?(n+=1,{type:\"percentage\",repr:h}):{type:\"number\",repr:h}},u=()=>{for(;;){let h=r();if(n+=1,h===41||h===fe)return;s(h,r())&&l()}},E=()=>{let h=\"\";for(;Te(r());)n+=1;for(;;){let f=r();if(n+=1,f===41)return{type:\"url\",value:h};if(f===fe)return{type:\"url\",value:h};if(Te(f)){for(;Te(r());)n+=1;return r()===41||r()===fe?(r()===41&&(n+=1),{type:\"url\",value:h}):(u(),{type:\"bad-url\"})}if(f===34||f===39||f===40||_i(f))return u(),{type:\"bad-url\"};if(f===92){if(s(f,r()))h+=String.fromCodePoint(l());else return u(),{type:\"bad-url\"};continue}h+=String.fromCodePoint(f)}},T=()=>{let h=d();if(h.toLowerCase()===\"url\"&&r()===40){for(n+=1;Te(r())&&Te(r(1));)n+=1;let f=Te(r())?r(1):r();return f===34||f===39?{type:\"function\",value:h}:E()}return r()===40?(n+=1,{type:\"function\",value:h}):{type:\"ident\",value:h}},v=h=>{let f=\"\";for(;;){let c=r();if(n+=1,c===h||c===fe)return{type:\"string\",value:f};if(fs(c))return n-=1,{type:\"bad-string\"};if(c===92){if(r()===fe)continue;if(fs(r())){n+=1;continue}f+=String.fromCodePoint(l());continue}f+=String.fromCodePoint(c)}};for(;;){for(;r()===47&&r(1)===42;){for(n+=2;r()!==fe&&!(r()===42&&r(1)===47);)n+=1;r()!==fe&&(n+=2)}let h=r();if(h===fe)return o;if(Te(h)){for(;Te(r());)n+=1;o.push({type:\"whitespace\"});continue}switch(n+=1,h){case 34:case 39:o.push(v(h));continue;case 35:if(us(r())||s(r(),r(1))){let f=i(r(),r(1),r(2));o.push({type:\"hash\",value:d(),id:f})}else o.push({type:\"delim\",value:\"#\"});continue;case 40:o.push({type:\"(\"});continue;case 41:o.push({type:\")\"});continue;case 43:case 46:a(h,r(),r(1))?(n-=1,o.push(b())):o.push({type:\"delim\",value:String.fromCodePoint(h)});continue;case 44:o.push({type:\",\"});continue;case 45:a(h,r(),r(1))?(n-=1,o.push(b())):r()===45&&r(1)===62?(n+=2,o.push({type:\"CDC\"})):i(h,r(),r(1))?(n-=1,o.push(T())):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(h,r())?(n-=1,o.push(T())):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:K(h)?(n-=1,o.push(b())):zn(h)?(n-=1,o.push(T())):o.push({type:\"delim\",value:String.fromCodePoint(h)})}}}var ys={\"{\":\"}\",\"[\":\"]\",\"(\":\")\"},bs=32,_r=class{constructor(e){this.tokens=e}i=0;peek(){return this.tokens[this.i]}next(){return this.tokens[this.i++]}};function Es(t,e){let n=t.next();return n.type===\"{\"||n.type===\"[\"||n.type===\"(\"?{type:\"block\",open:n.type,value:ps(t,ys[n.type],e+1)}:n.type===\"function\"?{type:\"func\",name:n.value,value:ps(t,\")\",e+1)}:n}function ps(t,e,n){let r=[];for(;;){let o=t.peek();if(!o)return r;if(o.type===e)return t.next(),r;if(n>bs){t.next(),r.push({type:\"bad-string\"});continue}r.push(Es(t,n))}}function ut(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 a=[];r+=1;let l;for(;r<t.length;){let d=t[r];if(r+=1,d.type===\";\")break;if(d.type===\"block\"&&d.open===\"{\"){l=d.value;break}a.push(d)}n.push({type:\"at-rule\",name:o.value,prelude:a,...l?{block:l}:{}});continue}let s=[],i;for(;r<t.length;){let a=t[r];if(r+=1,a.type===\"block\"&&a.open===\"{\"){i=a.value;break}s.push(a)}i&&n.push({type:\"qualified\",prelude:s,block:i})}return n}function $r(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 a=t[i];if(a.type===\";\"||a.type===\"block\"&&a.open===\"{\")return i+1}return t.length})();e.push(...ut(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 a=ws(r.value,t.slice(s+1,i));if(a.value.some(l=>l.type===\"block\"&&l.open===\"{\")){let l=t.findIndex((d,p)=>p>n&&d.type===\"block\"&&d.open===\"{\");e.push(...ut(t.slice(n,l+1),!1)),n=l+1;continue}e.push(a),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(...ut(t.slice(n,o+1),!1)),n=o+1}return e}function ws(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 Ur(t){let e=new _r(Di(t)),n=[];for(;e.peek();)n.push(Es(e,0));return n}function Fn(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&&K(r)||o===1&&K(r)&&n[0]===45?e+=`\\\\${r.toString(16)} `:o===0&&r===45&&n.length===1?e+=\"\\\\-\":Hr(r)||r===45||r===95||K(r)||Lr(r)?e+=String.fromCodePoint(r):e+=`\\\\${String.fromCodePoint(r)}`}),e}function Bn(t){let e=\"\";for(let n of t){let r=n.codePointAt(0);Hr(r)||r===45||r===95||K(r)||Lr(r)?e+=n:r>=1&&r<=31||r===127?e+=`\\\\${r.toString(16)} `:e+=`\\\\${n}`}return e}function Ir(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 Mi(t){let e=Bn(t);return/^[eE]([0-9]|[+-][0-9])/.test(t)?`\\\\${t.codePointAt(0).toString(16)} ${Bn(t.slice(1))}`:e}var ms=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 Li(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 Hi(t){switch(t.type){case\"whitespace\":return\" \";case\"ident\":return Fn(t.value);case\"at-keyword\":return`@${Fn(t.value)}`;case\"hash\":return`#${Bn(t.value)}`;case\"string\":return Ir(t.value);case\"url\":return`url(${Ir(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}${Mi(t.unit)}`;case\"func\":return`${Fn(t.name)}(${ft(t.value)})`;case\"block\":return`${t.open}${ft(t.value)}${ys[t.open]}`;case\":\":case\";\":case\",\":case\"[\":case\"]\":case\"(\":case\")\":case\"{\":case\"}\":return t.type;default:return\"\"}}function ft(t){let e=\"\",n;for(let r of t)r.type===\"whitespace\"&&n?.type===\"whitespace\"||(n&&Li(ms(n),ms(r))&&(e+=\"/**/\"),e+=Hi(r),n=r);return e}var $i=new Set(jo),Ns=new Set(Vo),hs=new Set(zo),Ui=new Set(Fo),Gi=new Set(Yo),gs=/^#[A-Za-z_][A-Za-z0-9_.:-]*$/,xe=t=>t.replace(/[A-Z]/g,e=>e.toLowerCase()),ji=t=>xe(t);function Dr(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&&hs.has(t)&&gs.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=xe(o.name);if(s===\"url\"||s===\"src\"){let a=o.value.filter(d=>d.type!==\"whitespace\"),l=a[0];if(s===\"url\"&&a.length===1&&l?.type===\"string\"&&t&&hs.has(t)&&gs.test(l.value)){r.push({type:\"func\",name:\"url\",value:[{type:\"string\",value:l.value}]});continue}n({reason:\"url\",...t?{name:t}:{}});return}if(!Ns.has(s)){n({reason:\"function\",name:s});return}let i=Dr(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=Dr(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 Wn(t,e){let n=t.name.startsWith(\"--\"),r=n?t.name:ji(t.name);if(!n&&!$i.has(r)){e({reason:\"property\",name:r});return}let o=Bo[r];if(o){let a=t.value.filter(p=>p.type!==\"whitespace\"),l=a[0],d=a.length===1&&l?.type===\"ident\"?xe(l.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=Dr(n?void 0:r,t.value,e);if(!s)return;let i=ft(s).trim();return`${n?`--${Bn(t.name.slice(2))}`:r}: ${i}${t.important?\" !important\":\"\"}`}function Ts(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 a=xe(s.type===\"ident\"?s.value:s.name);if(Gi.has(a)||a.startsWith(\"-webkit-\")||a.startsWith(\"-moz-\"))return e({reason:\"selector\",name:a}),!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 Pr(t,e,n){let r=[];for(let o of $r(t))if(o.type===\"declaration\"){let s=Wn(o,e);s&&r.push(`${s};`)}else{let s=Yn(o,e,n+1,\"style\");s&&r.push(s)}return r.join(\" \")}function Vi(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=xe(s.name);return e===\"supports\"&&i===\"selector\"?Ts(s.value,n):Ns.has(i)?r(s.value):(n({reason:\"function\",name:i}),!1)}if(s.type===\"block\"){if(e===\"supports\"){let i=$r(s.value);if(i.length===1&&i[0].type===\"declaration\")return Wn(i[0],n)!==void 0}return r(s.value)}return!0});return r(t)?ft(t).trim():void 0}function Mr(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(Lt,xe(e.value))?{type:\"block\",open:\"[\",value:[{type:\"ident\",value:\"data-graview-as\"},{type:\"delim\",value:\"=\"},{type:\"string\",value:xe(e.value)}]}:e.type===\"func\"?{type:\"func\",name:e.name,value:Mr(e.value)}:e.type===\"block\"&&e.open===\"(\"?{type:\"block\",open:\"(\",value:Mr(e.value)}:e})}function Yn(t,e,n,r){if(n>bs){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(xe(p.value)))){e({reason:\"unreadable\",name:\"keyframe\"});return}return`${ft(t.prelude).trim()} { ${Pr(t.block,e,n)} }`}if(!Ts(t.prelude,e))return;let l=ft(Mr(t.prelude)).trim();if(l===\"\"){e({reason:\"unreadable\",name:\"selector\"});return}return`${l} { ${Pr(t.block,e,n)} }`}let o=xe(t.name),s=o===\"-webkit-keyframes\"?\"keyframes\":o;if(!Ui.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 l=t.prelude.filter(u=>u.type!==\"whitespace\"),d=l[0];if(l.length!==1||!d||d.type!==\"ident\"&&d.type!==\"string\"){e({reason:\"unreadable\",name:\"@keyframes\"});return}let p=ut(t.block,!1).map(u=>Yn(u,e,n+1,\"keyframes\")).filter(u=>u!==void 0);return`@keyframes ${d.type===\"ident\"?Fn(d.value):Ir(d.value)} { ${p.join(\" \")} }`}let i=Vi(t.prelude,s,e);if(i===void 0)return;let a=r===\"style\"?Pr(t.block,e,n):ut(t.block,!1).map(l=>Yn(l,e,n+1,\"sheet\")).filter(l=>l!==void 0).join(\" \");return`@${s} ${i} { ${a} }`}function zi(t,e=Un){let n=[];if(t.length>e)return{css:\"\",refused:[{reason:\"size\"}]};let r=s=>void n.push(s);return{css:ut(Ur(t),!0).map(s=>Yn(s,r,0,\"sheet\")).filter(s=>s!==void 0).join(`\n`),refused:n}}function xs(t,e=Un){let n=[],r=[],o=0;for(let s of t){if(o+s.length>e){r.push({reason:\"size\"});continue}o+=s.length;let i=zi(s,e);i.css&&n.push(i.css),r.push(...i.refused)}return{css:n.join(`\n`),refused:r}}function vs(t,e=Un){let n=[];if(t.length>e)return{css:\"\",refused:[{reason:\"size\"}]};let r=s=>void n.push(s),o=[];for(let s of $r(Ur(t))){if(s.type!==\"declaration\"){r({reason:\"unreadable\",name:\"a rule in a style attribute\"});continue}let i=Wn(s,r);i&&o.push(i)}return{css:o.join(\"; \"),refused:n}}function Ss(t,e){let n,r=Wn(ws(t,Ur(e)),o=>n??=o);return r===void 0||n?{refused:n??{reason:\"unreadable\",name:t}}:{value:r.slice(r.indexOf(\":\")+1).trim()}}function Os(t,e){if(e===\"svg\"){let r=Gn(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(ct,n)?Object.prototype.hasOwnProperty.call(Lt,n)?{namespace:\"html\",name:Lt[n],as:n}:{namespace:\"html\",name:n}:{refused:{reason:\"element\",element:t}}}function qn(t,e){return(t===\"html\"?ct[e]:Hn[e])?.empty===!0}var Fi=/^[+-]?(\\d+\\.?\\d*|\\.\\d+)([eE][+-]?\\d+)?$/,Bi=/^[0-9A-Za-z\\s.,+\\-%()]*$/,Yi=/^#[A-Za-z_][A-Za-z0-9_.:-]*$/,Wi=/^data:image\\/(png|gif|jpeg|webp|avif|bmp|svg\\+xml)(;[A-Za-z0-9=._+-]+)*,/i,qi=/^\\/graview\\/assets\\/[0-9a-f]{64}\\.(png|gif|jpe?g|webp|avif|svg|ico)$/,As=/\\/graview\\/assets\\/[0-9a-f]{64}\\.(png|gif|jpe?g|webp|avif|svg|ico)$/,Xi=/^\\/(?!\\/)(?!(?:.*\\/)?\\.\\.?(?:\\/|$))(?!.*%(?:2e|2f|5c))[^\\\\\\s?#\"'<>]*$/i;function Ki(t,e){if(qi.test(t))return t;let n=t;if(/^https?:\\/\\//i.test(t))try{let r=new URL(t);if(e===\"null\"||r.origin!==e||r.username!==\"\"||r.password!==\"\"||r.search!==\"\"||r.hash!==\"\")return;n=t.slice(r.origin.length)}catch{return}if(Xi.test(n))return As.exec(n)?.[0]}function ks(t,e={},n){let r=t.length>120?`${t.slice(0,119)}\\u2026`:t,o=Rs(e.origins),s=As.exec(t.split(/[?#]/)[0])?.[0],i=n!==void 0&&n>Ht?` It is a data: image of ${n.toLocaleString(\"en-US\")} characters, more than the ${Ht.toLocaleString(\"en-US\")} a view's own data: image may be. A picture on a record is drawn at any size by the src the host hands the view (pictures in its manifest), used as it was handed.`:s?e.assets?` It is the app's own image only by its path, or under the app's base on this page's origin: write it as its path, ${s}.`:\" This host has not said where the app's own images live (asset, on the view's definition), so a view here cannot draw one by its path.\":/^https:\\/\\//i.test(t)?o.length>0?` Its origin is not one the host lists for images (${o.join(\", \")}).`:\" The host lists no origin a view's images may come from (images.origins, on the view's definition).\":\"\",a=[\"a data: image\",...e.assets?[\"the app's own image by the path add_image answered (/graview/assets/<sha256>.<ext>)\"]:[],\"a picture on a record (pictures in its manifest)\",...o.length>0?[`an https: image from ${o.join(\", \")}`]:[]];return`The image \"${r}\" was not drawn.${i} A view here shows ${a.slice(0,-1).join(\", \")} or ${a[a.length-1]}.`}function Rs(t){return(t??[]).flatMap(e=>{try{let n=new URL(e);return n.protocol===\"https:\"&&n.hostname!==\"\"&&n.username===\"\"&&n.password===\"\"?[n.origin]:[]}catch{return[]}})}function Zi(t,e){if(!(!e||e.length===0||!/^https:\\/\\//i.test(t)))try{let n=new URL(t);return n.protocol!==\"https:\"||n.username!==\"\"||n.password!==\"\"?void 0:Rs(e).includes(n.origin)?n.href:void 0}catch{return}}function Gr(t,e,n,r,o){let s=jn(t,e,n);if(!s)return{refused:{reason:\"attribute\",element:e,name:n}};if(t===\"html\"&&$n[e]?.includes(s.name))return{refused:{reason:\"attribute\",element:e,name:n}};if(r===null)return{name:s.name,value:null};let i=Ji(s.name,s.kind,r,o);return\"refused\"in i?{refused:{...i.refused,element:e,...s.kind===\"image\"&&i.refused.reason===\"url\"?{address:r.slice(0,200),...r.length>Ht?{length:r.length}:{}}:{},...s.kind===\"link\"?{address:r.slice(0,200)}:{}}}:s.name===\"role\"&&i.value.split(/\\s+/).some(a=>Go.includes(a.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(a=>({reason:a.reason===\"url\"?\"url\":\"css\",element:e,name:s.name,css:a}))}:{}}}function Ji(t,e,n,r){let o=(s,i)=>({refused:{reason:s,name:t,...i?{css:i}:{}}});if(e===\"geometry\")return n.length>Wo||!Bi.test(n)||/url/i.test(n)?o(\"value\"):{value:n};if(e===\"image\"){let s=r.picture?.(n);if(s!==void 0)return{value:s};if(n.length>Ht)return o(\"url\");if(Wi.test(n))return{value:n};if(n.startsWith(`blob:${r.origin}/`)&&/^blob:[^\\s\"'<>]+$/.test(n))return{value:n};let i=r.asset?Ki(n,r.origin):void 0;if(i!==void 0){let l=r.asset(i);if(l)return{value:l}}let a=Zi(n,r.imageOrigins);return a?{value:a}:o(\"url\")}if(e===\"link\"){let s=r.link?.(n);return s===void 0?o(\"url\"):{value:s}}if(n.length>kr)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 Fi.test(n.trim())&&Number.isFinite(Number(n))?{value:n.trim()}:o(\"value\");case\"boolean\":return{value:\"\"};case\"fragment\":return Yi.test(n)?{value:n}:o(\"url\");case\"style\":{let s=vs(n,kr);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=Ss(t,n);return\"refused\"in s?o(s.refused.reason===\"url\"?\"url\":\"css\",s.refused):{value:s.value}}}}var Qi=\"http://www.w3.org/1999/xhtml\",ea=new Set([\"button\",\"submit\",\"reset\",\"checkbox\",\"radio\",\"image\"]);var Xn=(t,...e)=>t.namespaceURI===Qi&&e.includes(t.localName),ta=t=>(t.getAttribute(\"type\")??\"text\").toLowerCase(),na=t=>Xn(t,\"textarea\",\"select\")||Xn(t,\"input\")&&!ea.has(ta(t));function Cs(t){if(Xn(t,\"option\",\"optgroup\",\"datalist\"))return'An option is never pressed by itself: put data-act on its select, with data-save=\"change\", or on a button.';if(Xn(t,\"label\"))return\"A press on a label presses its field too, and would ask for the act twice: put data-act on a button, or on the field.\";if(na(t)&&!t.hasAttribute(\"data-save\"))return'A click into a field to type or to pick is not a press: give it data-save (\"input\" or \"change\") to save it as it is typed, or put data-act on a button beside it.'}var ra=\"http://www.w3.org/1999/xhtml\",pt=class{constructor(e){this.ownerDocument=e}parentNode=null;childNodes=[];get firstChild(){return this.childNodes[0]??null}get parentElement(){return this.parentNode instanceof Ve?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}},je=class extends pt{constructor(n,r){super(n);this.data=r}nodeType=3;get textContent(){return this.data}},jr=class extends pt{nodeType=8;get textContent(){return\"\"}},Ve=class extends pt{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}},Vr=class extends pt{nodeType=9;constructor(){super(null)}createElementNS(e,n){return new Ve(this,e,n)}createElement(e){return new Ve(this,ra,e)}createTextNode(e){return new je(this,e)}createComment(e){return new jr(this)}};function Ps(){let t=new Vr,e=t.createElement(\"div\");return e.setAttribute(\"data-graview-view-root\",\"\"),t.appendChild(e),{document:t,root:e}}var zr={h1:1,h2:2,h3:3,h4:4,h5:5,h6:6},_s=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\"]),Is=new Set([\"style\",\"template\",\"datalist\",\"option\"]),z=t=>t.replace(/\\s+/g,\" \").trim();function oa(t){let e=t.duration===void 0?0:Math.round(t.duration);if(e<1)return\"a video\";if(e<60)return`a ${e}-second video`;let n=Math.round(e/60);return n<60?`a ${n}-minute video`:`a ${Math.floor(n/60)}-hour${n%60>0?` ${n%60}-minute`:\"\"} video`}var se=t=>t instanceof Ve,Gt=t=>t.hasAttribute(\"hidden\")||t.getAttribute(\"aria-hidden\")===\"true\";function Z(t){return t instanceof je?t.data:!se(t)||Gt(t)||Is.has(t.localName)?\"\":t.localName===\"br\"?\" \":t.localName===\"img\"?t.getAttribute(\"alt\")??\"\":t.childNodes.map(Z).join(t.localName===\"td\"||t.localName===\"th\"?\" \":\"\")}function*ze(t){for(let e of t.childNodes)se(e)&&(yield e,yield*ze(e))}function sa(t){let e=t.getAttribute(\"data-save\"),n=t.getAttribute(\"data-debounce\");if(e===null&&n===null)return[];let r=`drawing <${t.localName}${e!==null?` data-save=\"${e}\"`:` data-debounce=\"${n}\"`}>`,o=[];if(e===null)return[{at:r,says:'data-debounce is read only on a field that saves as it is typed (data-save=\"input\").'}];if(![\"input\",\"textarea\",\"select\"].includes(t.localName))o.push({at:r,says:\"Only a field saves as it is typed: an input, a textarea or a select. A button is pressed (data-act alone).\"});else if(e!==\"input\"&&e!==\"change\")o.push({at:r,says:`data-save is \"input\" (saved as the person types, once they pause, and when they leave it) or \"change\" (saved when they leave it or pick), not \"${e}\".`});else if(t.getAttribute(\"data-act\")===null)o.push({at:r,says:'It saves through no act: a field saved as it is typed names its act itself, data-act=\"\\u2026\", one in the manifest.'});else if(!t.getAttribute(\"name\"))o.push({at:r,says:\"It has no name: the host sends a field as the act's argument its name says.\"});else{let s=!1,i=!1;for(let a=t;a;a=a.parentElement)a.getAttribute(\"data-record\")!==null&&(i=!0),a!==t&&(a.localName===\"fieldset\"||a.getAttribute(\"role\")===\"group\")&&(s=!0);(!s||!i)&&o.push({at:r,says:'It is in no fieldset bound to a record: the host saves a field inside <fieldset data-record=\"\\u2026\">, with the fields beside it, to the record the fieldset names.'})}return n!==null&&e!==\"input\"?o.push({at:r,says:'data-debounce is read only with data-save=\"input\": a \"change\" saves at once.'}):n!==null&&!(n.trim()!==\"\"&&Number.isFinite(Number(n))&&Number(n)>=250&&Number(n)<=1e4)&&o.push({at:r,says:`data-debounce is how long the host waits for the person to pause, in milliseconds from 250 to 10 000, not \"${n}\"; left out, it waits 1 000.`}),o}function ia(t,e,n){let r=t.getAttribute(\"data-drop\");if(r===null)return[];let o=`drawing <${t.localName} data-drop=\"${r}\">`,s=[],i=(e.accepts??[]).filter(d=>d.kind===r),a=t.getAttribute(\"data-drop-field\");i.length===0?s.push({at:o,says:`The view's accepts names no field of \"${r}\", so the host offers no drop target here: say the field files go in, accepts: [{ \"kind\": \"${r}\", \"field\": \"<its image, video or file field>\" }].`}):a!==null&&!i.some(d=>d.field===a)&&s.push({at:o,says:`data-drop-field names \"${a}\", which the view's accepts does not name for \"${r}\" (${i.map(d=>`\"${d.field}\"`).join(\", \")}): the host offers no drop target here.`});let l=t.getAttribute(\"data-drop-connect\");if(l!==null){let d=l.indexOf(\":\"),p=d>0?l.slice(d+1):\"\";d<=0||p===\"\"||n.has(l)?s.push({at:o,says:`data-drop-connect is \"<relation>:<record id>\" \\u2014 \"takenOn:day:saturday\" \\u2014 not \"${l}\"${n.has(l)?\", which names a record and no relation\":\"\"}.`}):n.has(p)||s.push({at:o,says:`data-drop-connect names \"${p}\", which this seat was not shown: the host offers no drop target here.`})}return s}function Ds(t,e){let n=[],r=new Set,o=new Set,s=new Map;for(let u of[...e.props.node?[e.props.node]:[],...e.props.nodes??[]])s.set(u.id,u);let i=u=>$t(e.places,u)!==void 0;for(let u of ze(t)){let E=u.getAttribute(\"data-act\");E!==null&&r.add(E);let T=E!==null&&u.getAttribute(\"data-debounce\")===null?Cs(u):void 0;T&&n.push({at:`drawing <${u.localName} data-act=\"${E}\">`,says:T});let v=u.getAttribute(\"data-record\");v!==null&&(o.add(v),!s.has(v)&&!i(v)&&n.push({at:`drawing <${u.localName} data-record=\"${v}\">`,says:e.placesUnsure?`It names \"${v}\", which this seat was not shown and is none of the places this run was told of. A view goes to a record by its id, or to a place by its slug.${ge(e.places)}${dt}`:`It names \"${v}\", which this seat was not shown and is no place of this app: the host will not follow it. A view goes to a record by its id, or to a place by its slug.${ge(e.places)}`}));let h=u.getAttribute(\"data-place\");h!==null&&!i(h)&&n.push({at:`drawing <${u.localName} data-place=\"${h}\">`,says:e.placesUnsure?`It names the place \"${h}\", which is none of the places this run was told of.${ge(e.places)}${dt}`:`It names the place \"${h}\", which this app does not have.${ge(e.places)}`}),n.push(...sa(u)),n.push(...ia(u,e,s))}let a=u=>{if(u.localName===\"graview-video\")return;let E=u.getAttribute(\"data-record\");if(E!==null)return E;let T=u.getAttribute(\"data-key\")??u.getAttribute(\"id\");if(T!==null&&s.has(T))return T;let v=new Set;for(let h of ze(u)){let f=h.getAttribute(\"data-record\");f!==null&&h.localName!==\"graview-video\"&&v.add(f)}return v.size===1?[...v][0]:void 0},l=(u,E)=>{let T=s.get(E),v=T?.kind??(E.includes(\":\")?E.slice(0,E.indexOf(\":\")):\"\"),h=[...ze(u)],f=h.find(g=>g.localName in zr)??h.find(g=>g.localName===\"a\"&&g.getAttribute(\"data-record\")===E)??h.find(g=>g.localName===\"strong\"||g.localName===\"b\"),c=z(f?Z(f):\"\")||T?.label||E,m=p(u,f);return!f&&m[0]?.t===\"text\"&&z(m[0].text)===c&&m.shift(),{id:E,kind:v,title:c,parts:m}},d=u=>{let E=[...ze(u)].filter(f=>f.localName===\"tr\"&&!Gt(f)),T=E.find(f=>f.parentElement?.localName===\"thead\"||f.childNodes.every(c=>!se(c)||c.localName===\"th\")),v=T?T.childNodes.filter(se).map(f=>z(Z(f))):[];return{t:\"list\",as:\"row\",columns:1,groups:[{items:E.filter(f=>f!==T).map(f=>{let c=f.childNodes.filter(se),m=a(f),g=m?s.get(m):void 0;return{id:m??\"\",kind:g?.kind??\"\",title:z(Z(c[0]??f)),parts:c.slice(1).map((N,w)=>({t:\"field\",label:v[w+1]??\"\",text:z(Z(N))}))}})}]}};function p(u,E){let T=[],v=\"\",h=()=>{let c=z(v);v=\"\",c&&T.push({t:\"text\",text:c})},f=u.childNodes;for(let c=0;c<f.length;c+=1){let m=f[c];if(m===E)continue;if(m instanceof je){v+=m.data;continue}if(!se(m)||Gt(m)||Is.has(m.localName))continue;if(E&&[...ze(m)].includes(E)){h(),T.push(...p(m,E));continue}let g=[];for(let N=c;N<f.length;N+=1){let w=f[N];if(w instanceof je&&z(w.data)===\"\")continue;if(!se(w)||Gt(w)||_s.has(w.localName)||w.localName in zr)break;let _=a(w);if(!_)break;g.push({element:w,id:_}),c=N}if(g.length>0){h();let N=g.every(w=>w.element.localName===\"li\"||w.element.localName===\"tr\");T.push({t:\"list\",as:N?\"row\":\"card\",columns:1,groups:[{items:g.map(w=>l(w.element,w.id))}]});continue}T.push(...b(m,N=>v+=N,h))}return h(),T}function b(u,E,T){let v=u.localName;if(_s.has(v)&&v!==\"label\")return E(Z(u)),[];if(v===\"mark\"){T();let f=z(Z(u));return f?[{t:\"badge\",text:f}]:[]}T();let h=zr[v]??(u.getAttribute(\"role\")===\"heading\"?Number(u.getAttribute(\"aria-level\")??2):void 0);if(h!==void 0){let f=z(Z(u));return f?[{t:\"heading\",level:h,text:f}]:[]}switch(v){case\"ul\":case\"ol\":case\"menu\":return[{t:\"list\",as:\"row\",columns:1,groups:[{items:u.childNodes.filter(c=>se(c)&&c.localName===\"li\"&&!Gt(c)).map(c=>{let m=a(c);if(m)return l(c,m);let g=p(c),N=g[0],w=N&&(N.t===\"text\"||N.t===\"heading\")?N.text:\"\";return{id:\"\",kind:\"\",title:w,parts:w?g.slice(1):g}})}]}];case\"table\":return[d(u)];case\"dl\":{let f=[],c=\"\";for(let m of u.childNodes.filter(se))if(m.localName===\"dt\")c=z(Z(m));else if(m.localName===\"dd\")f.push({t:\"field\",label:c,text:z(Z(m))});else if(m.localName===\"div\")for(let g of m.childNodes.filter(se))g.localName===\"dt\"?c=z(Z(g)):g.localName===\"dd\"&&f.push({t:\"field\",label:c,text:z(Z(g))});return f}case\"figure\":{let f=u.childNodes.find(g=>se(g)&&g.localName===\"figcaption\"),c=z(u.childNodes.filter(g=>g!==f).map(Z).join(\" \")),m=f?z(Z(f)):\"\";return c?[{t:\"figure\",text:c,...m?{label:m}:{}}]:m?[{t:\"text\",text:m}]:[]}case\"meter\":case\"progress\":{let f=Number(u.getAttribute(\"value\")??0),c=Number(u.getAttribute(\"max\")??1)||1;return[{t:\"progress\",label:u.getAttribute(\"aria-label\")??u.getAttribute(\"title\")??\"\",text:`${Math.round(f/c*100)}%`}]}case\"svg\":{let f=u.childNodes.find(g=>se(g)&&g.localName===\"title\"),c=z(u.getAttribute(\"aria-label\")??(f?Z(f):\"\"));if(c)return[{t:\"text\",text:c,tone:\"picture\"}];let m=[...ze(u)].filter(g=>g.localName===\"text\").map(g=>z(Z(g))).filter(Boolean);return m.length>0?[{t:\"text\",text:m.join(\" \\xB7 \"),tone:\"picture\"}]:[]}case\"img\":{let f=z(u.getAttribute(\"alt\")??\"\");return f?[{t:\"text\",text:f,tone:\"picture\"}]:[]}case\"graview-video\":{let f=u.getAttribute(\"data-field\")??\"\",c=s.get(u.getAttribute(\"data-record\")??\"\"),m=c&&f&&Object.hasOwn(c,f)?c[f]:void 0,g=(Array.isArray(m)?m:[m])[Number(u.getAttribute(\"data-index\")??\"0\")];return!g||typeof g.name!=\"string\"||typeof g.type!=\"string\"||!g.type.startsWith(\"video/\")?(n.push({at:`drawing <graview-video data-field=\"${f}\">`,says:\"It names no video on a record this seat was shown: the host draws no player there. A <graview-video> names a record the view was shown (data-record) and its video field (data-field).\"}),[]):[{t:\"text\",text:`${typeof g.caption==\"string\"&&g.caption.trim()?g.caption.trim():g.name}, ${oa(typeof g.duration==\"number\"?{duration:g.duration}:{})}`,tone:\"picture\"}]}case\"button\":{let f=z(Z(u));return f?[{t:\"text\",text:f,tone:\"button\"}]:[]}case\"input\":case\"textarea\":case\"select\":{let f=z(u.getAttribute(\"aria-label\")??u.getAttribute(\"placeholder\")??u.getAttribute(\"name\")??\"\"),c=v===\"select\"?z(Z(u.childNodes.find(m=>se(m)&&m.localName===\"option\"&&m.selected)??u)):u.value;return[{t:\"field\",label:f,text:c}]}case\"label\":return p(u);default:return p(u)}}return{parts:p(t),problems:n,acts:[...r],records:[...o]}}var aa=0,la=1,ca=2,da=3,Ms=1,ua=2,Ls=3,fa=1,pa=3,ma=8,Hs=\"~\",jt=t=>typeof t==\"object\"&&t!==null&&!Array.isArray(t),$s=new Set([\"input\",\"select\",\"textarea\",\"option\"]),ha=new Set([\"value\",\"checked\",\"selected\"]);function Us(t,e){let n=t.ownerDocument??t,r=e.maxNodes??5e3,o=[],s=new Map,i=new WeakMap,a={dom:t,name:\"div\",namespace:\"html\",children:[],id:Hs};s.set(Hs,a);let l=0,d=!1,p=new Map,b=c=>{o.push(c),o.length>200&&o.shift(),e.onRefused?.(c)},u=()=>({dom:n.createComment(\"\"),children:[],refused:!0}),E=(c,m)=>{if(c.namespace===\"html\"&&c.name&&$s.has(c.name))return c.dom;if(m?.namespace===\"html\"&&m.name===\"textarea\")return m.dom},T=(c,m,g)=>{let N=c.dom;if(g!=null&&typeof g!=\"string\")return b({reason:\"value\",element:c.name,name:m});let w=Gr(c.namespace,c.name,m,g??null,e);if(\"refused\"in w){let Y=Gr(c.namespace,c.name,m,null,e);return\"refused\"in Y||N.removeAttribute(Y.name),b(w.refused)}for(let Y of w.dropped??[])b(Y);let _=c.namespace===\"html\"&&ha.has(w.name)&&$s.has(c.name),M=N,V=_?w.name===\"value\"?M.value:w.name===\"checked\"?M.checked:M.selected:void 0;w.value===null?N.removeAttribute(w.name):N.setAttribute(w.name,w.value),e.onAttribute?.(N,w.name),_&&(w.name===\"value\"&&\"value\"in M?(M.value=w.value??\"\",V!==M.value&&e.onFieldSet?.(N)):w.name===\"checked\"&&\"checked\"in M?(M.checked=w.value!==null,V!==M.checked&&e.onFieldSet?.(N)):w.name===\"selected\"&&\"selected\"in M&&(M.selected=w.value!==null,V!==M.selected&&e.onFieldSet?.(N.parentElement?.closest(\"select\")??N)))},v=c=>{if(!c.refused){l-=1,c.id!==void 0&&s.delete(c.id);for(let m of c.children)v(m)}},h=(c,m)=>{if(!jt(c)||typeof c.id!=\"string\"||s.has(c.id))return b({reason:\"record\"}),u();if(l>=r)return b({reason:\"budget\"}),d||(d=!0,e.onOverBudget?.()),u();let g=c.id;if(c.type===ma)return u();if(c.type===pa){if(qn(m.namespace,m.name))return b({reason:\"child\",element:m.name}),u();let V=n.createTextNode(String(c.data??\"\").slice(0,Rr)),Y={dom:V,children:[],text:!0,id:g,parent:m};return s.set(g,Y),i.set(V,g),l+=1,Y}if(c.type!==fa)return b({reason:\"record\"}),u();let N=String(c.element);if(qn(m.namespace,m.name))return b({reason:\"child\",element:N}),u();let w=Os(N,m.namespace);if(\"refused\"in w)return b(w.refused),u();let _=n.createElementNS(w.namespace===\"svg\"?Xo:qo,w.name);w.as&&_.setAttribute(\"data-graview-as\",w.as),w.namespace===\"html\"&&w.name===\"img\"&&_.setAttribute(\"referrerpolicy\",\"no-referrer\"),w.namespace===\"html\"&&w.name===\"a\"&&(_.setAttribute(\"target\",\"_blank\"),_.setAttribute(\"rel\",\"noopener noreferrer\"),_.setAttribute(\"referrerpolicy\",\"no-referrer\"));let M={dom:_,name:w.name,namespace:w.namespace,children:[],id:g,parent:m};if(s.set(g,M),i.set(_,g),l+=1,jt(c.attributes))for(let[V,Y]of Object.entries(c.attributes))T(M,V,Y);if(e.decorate?.(_,w.name,w.namespace),jt(c.properties))for(let V of Object.keys(c.properties))b({reason:\"attribute\",element:w.name,name:V});if(jt(c.eventListeners))for(let V of Object.keys(c.eventListeners))c.eventListeners[V]!=null&&b({reason:\"attribute\",element:w.name,name:`on${V}`});if(Array.isArray(c.children))for(let V of c.children){let Y=h(V,M);M.children.push(Y),_.appendChild(Y.dom)}return M},f=c=>{if(!Array.isArray(c))return b({reason:\"record\"});let[m,g]=c,N=typeof g==\"string\"?s.get(g):void 0;if(!N)return b({reason:\"record\"});switch(m){case aa:{if(N.text)return b({reason:\"record\"});let w=Number(c[3]),_=Number.isInteger(w)&&w>=0&&w<=N.children.length?w:N.children.length,M=c[2],V=jt(M)&&typeof M.id==\"string\"?p.get(M.id):void 0,Y;V&&V.parent?.namespace===N.namespace&&!qn(N.namespace,N.name)?(p.delete(M.id),V.parent=N,Y=V):Y=h(M,N),N.dom.insertBefore(Y.dom,N.children[_]?.dom??null),N.children.splice(_,0,Y),N.namespace===\"html\"&&N.name===\"textarea\"&&e.onFieldSet?.(N.dom);return}case la:{let w=Number(c[2]),_=N.children[w];if(!_)return b({reason:\"record\"});N.children.splice(w,1),_.dom.parentNode?.removeChild(_.dom),_.id!==void 0&&!_.refused?p.set(_.id,_):v(_);return}case ca:{if(!N.text)return b({reason:\"record\"});N.dom.data=String(c[2]??\"\").slice(0,Rr);let w=E(N,N.parent);w&&e.onFieldSet?.(w);return}case da:{if(N===a||N.text)return b({reason:\"record\"});let w=String(c[2]),_=c[4]??Ms;return _===ua?T(N,w,c[3]):b(_===Ms||_===Ls?{reason:\"attribute\",element:N.name,name:_===Ls?`on${w}`:w}:{reason:\"record\"})}default:return b({reason:\"record\"})}};return{apply(c,m){if(!Array.isArray(c))return b({reason:\"record\"}),!0;try{for(let g=0;g<c.length;g+=1){if(m&&g%32===0&&m())return!1;f(c[g])}return!0}finally{for(let g of p.values())v(g);p.clear()}},get refused(){return o},get size(){return l},idOf:c=>i.get(c),elementOf(c){let m=s.get(c);return m&&!m.text&&m!==a?m.dom:void 0},dispose(){for(let c of a.children)v(c);for(a.children.length=0;t.firstChild;)t.removeChild(t.firstChild)}}}function Gs(t,e,n){let{root:r}=Ps(),o=!1,s=Us(r,{origin:n.origin??\"null\",...n.imageOrigins?{imageOrigins:n.imageOrigins}:{},...n.asset?{asset:n.asset}:{},...n.link?{link:n.link}:{},maxNodes:n.maxNodes,onOverBudget:()=>o=!0});for(let l of t)s.apply(l);let i=[...s.refused],a=\"\";if(e){let l=xs(e);a=l.css;for(let d of l.refused)i.push({reason:\"css\",name:\"stylesheet\",css:d})}return{root:r,refused:i,size:s.size,over:o,css:a,elementOf:l=>s.elementOf(l)}}function ga(t,e={}){let n=\"element\"in t&&t.element?`<${t.element}>`:\"\",r=t.name?` ${t.name}`:\"\";switch(t.reason){case\"element\":return{at:`drawing ${n}`,says:`Not drawn: ${n} is not in the open kit.`};case\"attribute\":return{at:`drawing ${n}${r}`,says:`Not drawn: ${n||\"an element\"} does not take${r}.`};case\"value\":return{at:`drawing ${n}${r}`,says:`Not drawn: the value of${r} is not one the open kit takes.`};case\"url\":return\"element\"in t&&t.element===\"a\"&&t.address!==void 0?{at:`drawing ${n}${r}`,says:`Not drawn: ${cs(t.address,e.linkOrigins)}`}:{at:`drawing ${n}${r}`,says:t.address!==void 0&&\"element\"in t&&t.element===\"img\"?`Not drawn: ${ks(t.address,e,\"length\"in t?t.length:void 0)}`:\"Not drawn: an address. A view loads nothing; an image is a data: image.\"};case\"child\":return{at:`drawing ${n}`,says:`Not drawn: ${n} 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${r===\" stylesheet\"?\"\":r}`,says:`Not drawn: CSS the open kit leaves out${t.css?` (${t.css.reason}${t.css.name?` ${t.css.name}`:\"\"})`:\"\"}.`}}}function js(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 p of t.asked)if(!r.has(p.name))return{ok:!1,reason:\"act\",detail:`It asks for the act \"${p.name}\", which its manifest does not name.`};let o=is(e.props),s=Gs(t.renders,t.sheets,{maxNodes:n.maxNodes,...e.origin?{origin:e.origin}:{},...e.imageOrigins?{imageOrigins:e.imageOrigins}:{},...e.assets?{asset:p=>p}:{},link:p=>ls(p,{handed:o,...e.linkOrigins?{origins:e.linkOrigins}:{}})});if(s.over)return{ok:!1,reason:\"nodes\",detail:`It drew more than the ${n.maxNodes.toLocaleString(\"en-US\")} things a view may draw.`};let i=[...e.places,...(e.lists??[]).filter(p=>!e.places.some(b=>b.as===p)).map(p=>({as:p}))],a=e.placesUnsure===!0,l=Ds(s.root,{props:e.props,places:i,...a?{placesUnsure:!0}:{},...e.accepts?{accepts:e.accepts}:{}});for(let p of l.acts)if(!r.has(p))return{ok:!1,reason:\"act\",detail:`It binds a press to the act \"${p}\" (data-act), which its manifest does not name.`};let d=[...s.refused.map(p=>ga(p,{...e.imageOrigins?{origins:e.imageOrigins}:{},assets:e.assets===!0,...e.linkOrigins?{linkOrigins:e.linkOrigins}:{}})),...l.problems];for(let p of t.went)\"record\"in p&&!(e.props.node?.id===p.record||(e.props.nodes??[]).some(b=>b.id===p.record)||$t(i,p.record))&&d.push({at:\"navigate\",says:a?`It goes to ${Ut(p.record)}, which this seat was not shown and is none of the places this run was told of. A view goes to a record by its id, or to a place by its slug.${ge(i)}${dt}`:`It goes to ${Ut(p.record)}, which this seat was not shown and is no place of this app: the host will not follow it. A view goes to a record by its id, or to a place by its slug.${ge(i)}`}),\"place\"in p&&!$t(i,p.place)&&d.push({at:\"navigate\",says:a?`It goes to the place ${Ut(p.place)}, which is none of the places this run was told of.${ge(i)}${dt}`:`It goes to the place ${Ut(p.place)}, which this app does not have.${ge(i)}`});return{ok:!0,parts:l.parts,problems:d,drawn:s}}var Fr=\"graviewHeadless\",Br=\"graviewHeadlessView\";var Fs=globalThis,ya=Promise.prototype.then,ba=Promise.resolve(),Zn=t=>void ya.call(ba,t),Kn=Fs.performance,Vt=Kn&&typeof Kn.now==\"function\"?Kn.now.bind(Kn):Date.now,Fe=JSON.stringify,Bs=JSON.parse,Ea=Object.defineProperty,Wr=t=>(t instanceof Error?`${t.name}: ${t.message}`:String(t)).slice(0,500),mt=t=>{try{return Bs(Fe(t??null))}catch{return null}},$={renders:[],asked:[],went:[],ms:0,logs:[],messages:0},ye,Jn=(t,e)=>{ye??={reason:t,detail:e}},ht=t=>{$.logs.length<50&&$.logs.push(t.slice(0,500))},yt={removed:[],stuck:[],sealed:!1},gt=ns({send(t){$.messages+=1,t.type===\"render\"?$.renders.push(mt(t.records)):t.type===\"style\"?$.sheets=(mt(t.sheets)??[]).map(String):t.type===\"gestures\"?$.gestures=mt(t.bound):t.type===\"navigate\"&&\"place\"in t?$.went.push({place:String(t.place),...t.where!==void 0?{where:mt(t.where)}:{},...t.section!==void 0?{section:String(t.section)}:{}}):t.type===\"navigate\"&&\"to\"in t&&$.went.push({record:String(t.to),...t.where!==void 0?{where:mt(t.where)}:{},...t.section!==void 0?{section:String(t.section)}:{}})},act(t,e){return $.messages+=1,$.asked.push({name:String(t),args:mt(e)}),Promise.resolve({type:\"answer\",id:$.asked.length,ok:!1,reason:\"refused\",message:\"Nothing is applied in a headless run.\"})},navigate(t){$.messages+=1,$.went.push({record:String(t)})},microtask:Zn,now:Vt,threw:t=>Jn(\"error\",`It threw: ${Wr(t)}`),warn:ht,hardening:()=>yt}),Vs=!1,Yr=!1;function wa(t){if(Yr||typeof t!=\"function\"||(Yr=!0,ye))return;let e=Vt();try{t.call(void 0,gt.view)}catch(n){Jn(\"error\",`It threw: ${Wr(n)}`)}$.ms+=Vt()-e}async function Na(t){if(Vs)return Fe({ok:!1,reason:\"refused\",detail:\"A headless script runs one view, once: something called its entry before the host did.\"});Vs=!0;let e;try{e=Bs(String(t))}catch{return Fe({ok:!1,reason:\"isolate\",detail:\"The run was not handed its input as JSON.\"})}if(!Yr&&!ye)return Fe({ok:!1,reason:\"isolate\",detail:\"The script held no view.\"});let n=Vt();ye||gt.hear({type:\"props\",props:e.props,push:1}),$.ms+=Vt()-n,$.ms>=e.limits.pushMs&&Jn(\"slow\",`It took longer than ${e.limits.pushMs.toLocaleString(\"en-US\")} ms to draw what it was shown.`);for(let o=0;o<64&&!ye;o+=1)await new Promise(s=>Zn(s));if(ye||($.clicks=gt.listened(\"click\").slice(0,2e3)),e.press&&typeof e.press.selector==\"string\"&&!ye){let o=gt.find(e.press.selector);if($.pressed={selector:e.press.selector.slice(0,200),...o!==void 0?{target:o}:{},asked:$.asked.length,went:$.went.length,renders:$.renders.length},o!==void 0){gt.hear({type:\"dom-event\",target:o,event:\"click\"});for(let s=0;s<64&&!ye;s+=1)await new Promise(i=>Zn(i))}}if(ye)return Fe({ok:!1,...ye,transcript:$});let r=js($,e);return r.ok?Fe({ok:!0,transcript:$,drawn:{parts:r.parts,problems:r.problems},hardening:{removed:yt.removed.length,sealed:yt.sealed}}):Fe({ok:!1,reason:r.reason,detail:r.detail,transcript:$})}var Ta=Object.freeze({log:(...t)=>ht(t.map(String).join(\" \")),info:(...t)=>ht(t.map(String).join(\" \")),debug:(...t)=>ht(t.map(String).join(\" \")),warn:(...t)=>ht(t.map(String).join(\" \")),error:(...t)=>ht(t.map(Wr).join(\" \"))}),xa=0,zs=()=>xa+=1,va=[[\"console\",Ta],[\"setTimeout\",zs],[\"setInterval\",zs],[\"clearTimeout\",()=>{}],[\"clearInterval\",()=>{}],[\"queueMicrotask\",Zn],[\"graview\",gt.view],[Br,wa],[Fr,t=>Na(t)]];for(let[t,e]of va)Ea(Fs,t,{value:e,writable:!0,enumerable:!1,configurable:!0});yt=$o(globalThis,[\"graview\",Br,Fr],{primitivesStay:!0});yt.stuck.length>0&&Jn(\"refused\",`This isolate could not be hardened: ${yt.stuck.join(\", \")} would not go.`);})();\n";
8
8
  //# sourceMappingURL=runtime.generated.js.map