graview 0.1.56 → 0.1.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/preview/chunk.27CW6SCT.js +3 -0
- package/dist/preview/{chunk.UQQAGT3R.js → chunk.2EDC63RI.js} +1 -1
- package/dist/preview/chunk.2VYNNWW5.js +18 -0
- package/dist/preview/chunk.32FMOHZK.js +1 -0
- package/dist/preview/{chunk.VLBY66PB.js → chunk.34TW32TB.js} +2 -2
- package/dist/preview/{chunk.AM2YRNOQ.js → chunk.3FCOFEGW.js} +1 -1
- package/dist/preview/{chunk.LKK7VQBA.js → chunk.3OYGXYQY.js} +1 -1
- package/dist/preview/{chunk.XJFAUOJS.js → chunk.3YZHZGTM.js} +1 -1
- package/dist/preview/{chunk.AIK3Z25Y.js → chunk.43OKZU73.js} +1 -1
- package/dist/preview/{chunk.QSO5BP2H.js → chunk.4444RPWW.js} +1 -1
- package/dist/preview/{chunk.4EY6WPSM.js → chunk.47JQPYXL.js} +2 -2
- package/dist/preview/{chunk.N3Q5CPVA.js → chunk.4AFFPYOK.js} +1 -1
- package/dist/preview/chunk.4GGPPCMM.js +1 -0
- package/dist/preview/{chunk.PRV3KYT6.js → chunk.4HSH2UIK.js} +2 -2
- package/dist/preview/{chunk.7Z4USR3Y.js → chunk.4KC35UNR.js} +1 -1
- package/dist/preview/{chunk.LP3SHWJG.js → chunk.4Y2JTY6Q.js} +1 -1
- package/dist/preview/{chunk.6HLKAUWF.js → chunk.5ICIMQE6.js} +1 -1
- package/dist/preview/{chunk.KY7QD22S.js → chunk.5IEFTFKQ.js} +1 -1
- package/dist/preview/{chunk.JHFHIG4P.js → chunk.64R3K2OE.js} +1 -1
- package/dist/preview/chunk.6K7EN2YI.js +1 -0
- package/dist/preview/{chunk.45VIF2SX.js → chunk.6VC6AGYV.js} +2 -2
- package/dist/preview/{chunk.PMPDLE56.js → chunk.6W7O5YLL.js} +1 -1
- package/dist/preview/chunk.7BBGRTXM.js +5 -0
- package/dist/preview/{chunk.CGM7OER2.js → chunk.7MSFDD7J.js} +1 -1
- package/dist/preview/chunk.7SQAKSJD.js +2 -0
- package/dist/preview/{chunk.VEOS25PQ.js → chunk.7V23SXGJ.js} +1 -1
- package/dist/preview/{chunk.C2VFDBSG.js → chunk.A6C4AGJJ.js} +1 -1
- package/dist/preview/chunk.ACYDJQRC.js +1 -0
- package/dist/preview/{chunk.NBLMANHT.js → chunk.ARWBIBSI.js} +1 -1
- package/dist/preview/{chunk.KBL4Y4UN.js → chunk.B2GVJD6H.js} +1 -1
- package/dist/preview/{chunk.2DETYEJM.js → chunk.B3WZHPM3.js} +1 -1
- package/dist/preview/{chunk.IT763BYH.js → chunk.BB33TI4S.js} +1 -1
- package/dist/preview/{chunk.3X3GLNWQ.js → chunk.BKVBX2YB.js} +1 -1
- package/dist/preview/{chunk.VYW7DSUW.js → chunk.BTVBZ6KE.js} +2 -2
- package/dist/preview/{chunk.JZDKHWRL.js → chunk.CCWPF5PK.js} +1 -1
- package/dist/preview/{chunk.QAIYYIZQ.js → chunk.D5KTGX7F.js} +1 -1
- package/dist/preview/{chunk.YLMOGGEP.js → chunk.DBZHRYBK.js} +1 -1
- package/dist/preview/{chunk.GUP7LC5O.js → chunk.DM767F2Q.js} +2 -2
- package/dist/preview/{chunk.65Q5MKDW.js → chunk.E34OQVSR.js} +1 -1
- package/dist/preview/{chunk.N7EEPFYV.js → chunk.E5MSFXL6.js} +1 -1
- package/dist/preview/{chunk.DTSTUC2W.js → chunk.EB4NVTJL.js} +1 -1
- package/dist/preview/{chunk.5MS2TQFX.js → chunk.ELAMMS2V.js} +1 -1
- package/dist/preview/chunk.ELERUERU.js +1 -0
- package/dist/preview/{chunk.XGCOWCA2.js → chunk.EPPXZZPK.js} +1 -1
- package/dist/preview/chunk.EQTSV7BK.js +2 -0
- package/dist/preview/{chunk.QNNRSPIJ.js → chunk.ETBFD76E.js} +1 -1
- package/dist/preview/{chunk.OBUKZQCZ.js → chunk.F7SF6EP2.js} +1 -1
- package/dist/preview/chunk.GCBZ3WE2.js +1 -0
- package/dist/preview/{chunk.ONGZ3YQF.js → chunk.GDOTG7YA.js} +1 -1
- package/dist/preview/{chunk.SVAQGVS4.js → chunk.GEB2DFBU.js} +1 -1
- package/dist/preview/chunk.GKSUTAIX.js +1 -0
- package/dist/preview/{chunk.VDD3RHLB.js → chunk.GP7F3PEF.js} +1 -1
- package/dist/preview/{chunk.AKW6NR3X.js → chunk.GQBJVCSM.js} +1 -1
- package/dist/preview/chunk.GUEHKCWN.js +1 -0
- package/dist/preview/{chunk.NQ4VGKEC.js → chunk.GZB6A6KF.js} +1 -1
- package/dist/preview/{chunk.2E6EWVWR.js → chunk.H3BFHI3G.js} +1 -1
- package/dist/preview/{chunk.7RJGEU3Y.js → chunk.HEWVPXRE.js} +1 -1
- package/dist/preview/{chunk.J3YBEZKE.js → chunk.HMFJT4KO.js} +1 -1
- package/dist/preview/{chunk.NFU4UM6F.js → chunk.HS3GHAUR.js} +1 -1
- package/dist/preview/{chunk.NPAWTPLQ.js → chunk.HT2BEOEV.js} +1 -1
- package/dist/preview/{chunk.7O6Z3BFR.js → chunk.HXRV3WVJ.js} +1 -1
- package/dist/preview/{chunk.MJMVGW6Z.js → chunk.HZB5F476.js} +1 -1
- package/dist/preview/{chunk.WPJVMVAL.js → chunk.I3WWCPQ2.js} +1 -1
- package/dist/preview/{chunk.IUQOSPQX.js → chunk.IDJPBWL2.js} +1 -1
- package/dist/preview/{chunk.4KMY24YC.js → chunk.ILRCNTGT.js} +1 -1
- package/dist/preview/{chunk.T6HG2XIP.js → chunk.INZQ6WZM.js} +1 -1
- package/dist/preview/{chunk.ILSK2E3R.js → chunk.IULQRCEE.js} +1 -1
- package/dist/preview/{chunk.IF4FCQPG.js → chunk.JB7TTJXQ.js} +1 -1
- package/dist/preview/{chunk.E4HSSGF7.js → chunk.JES77WXG.js} +1 -1
- package/dist/preview/{chunk.SRC37GNP.js → chunk.JGKA5QBX.js} +1 -1
- package/dist/preview/chunk.JOAN54PN.js +1 -0
- package/dist/preview/{chunk.2YNZVNCA.js → chunk.JUNMJYH5.js} +1 -1
- package/dist/preview/{chunk.MORMTKVR.js → chunk.KFQSYCY3.js} +1 -1
- package/dist/preview/{chunk.TXWCTHMI.js → chunk.KJ264E6K.js} +1 -1
- package/dist/preview/{chunk.NUE5VG4G.js → chunk.KJHPDL4N.js} +1 -1
- package/dist/preview/{chunk.SOTB6C5A.js → chunk.KKNDX4JT.js} +1 -1
- package/dist/preview/chunk.KNYLY7MH.js +1 -0
- package/dist/preview/{chunk.YL5ZCRHQ.js → chunk.KWJWAIQJ.js} +1 -1
- package/dist/preview/{chunk.V3NPUAPB.js → chunk.KXPRILAO.js} +1 -1
- package/dist/preview/chunk.L7V24JPO.js +1 -0
- package/dist/preview/chunk.LA4CPZ2N.js +1 -0
- package/dist/preview/{chunk.E33EJU3Q.js → chunk.LCPGZK7G.js} +1 -1
- package/dist/preview/chunk.LDAYDCUO.js +1 -0
- package/dist/preview/{chunk.64IKLRUS.js → chunk.LL2MLSPH.js} +1 -1
- package/dist/preview/{chunk.22MIRLL6.js → chunk.LMN4TSAP.js} +1 -1
- package/dist/preview/{chunk.IRMO4FUC.js → chunk.LO3U3P55.js} +1 -1
- package/dist/preview/{chunk.DH7M57SE.js → chunk.LRUNFSHP.js} +1 -1
- package/dist/preview/{chunk.MLRPCZVS.js → chunk.LY3YOWKV.js} +1 -1
- package/dist/preview/{chunk.DWMAFMYZ.js → chunk.M34CS7DI.js} +1 -1
- package/dist/preview/{chunk.I2C5LPB5.js → chunk.MQ5HBUBL.js} +1 -1
- package/dist/preview/chunk.MV3AJ7JH.js +1 -0
- package/dist/preview/chunk.MYNQWWCL.js +1 -0
- package/dist/preview/{chunk.E4EN4X5F.js → chunk.NFX24NUI.js} +1 -1
- package/dist/preview/{chunk.PJCVFYFU.js → chunk.NKC3JILT.js} +1 -1
- package/dist/preview/{chunk.MFDSWA2W.js → chunk.NOFWGDOT.js} +1 -1
- package/dist/preview/{chunk.QW3QLE53.js → chunk.O4CVKTPJ.js} +1 -1
- package/dist/preview/{chunk.TAIYNHSW.js → chunk.OASYYMG5.js} +1 -1
- package/dist/preview/{chunk.G3ORIU7C.js → chunk.OHQ3JH65.js} +1 -1
- package/dist/preview/{chunk.2OX4YI46.js → chunk.PBCNOFQH.js} +1 -1
- package/dist/preview/{chunk.V6X3U3JF.js → chunk.PHC2MI4C.js} +1 -1
- package/dist/preview/chunk.PM3SYXKB.js +1 -0
- package/dist/preview/{chunk.K2JE3PD7.js → chunk.POBMGM3X.js} +1 -1
- package/dist/preview/{chunk.LLOZKUCA.js → chunk.PZG3B7F4.js} +1 -1
- package/dist/preview/chunk.QB25SMP6.js +1 -0
- package/dist/preview/{chunk.FCUDBMGC.js → chunk.QGV7H7RQ.js} +1 -1
- package/dist/preview/chunk.QPXXY2DL.js +1133 -0
- package/dist/preview/chunk.QUJS63OJ.js +13 -0
- package/dist/preview/{chunk.Q7X2IVLH.js → chunk.R7LFO7KI.js} +1 -1
- package/dist/preview/{chunk.7NP2I2UP.js → chunk.RE7DELSR.js} +1 -1
- package/dist/preview/{chunk.XY5EVI22.js → chunk.RRKYJYZJ.js} +1 -1
- package/dist/preview/{chunk.APXYWI3L.js → chunk.S2H7B6RG.js} +1 -1
- package/dist/preview/chunk.S5MGE2U5.js +1 -0
- package/dist/preview/{chunk.D6KF72MZ.js → chunk.SDVPJYVF.js} +1 -1
- package/dist/preview/{chunk.FBR4HJ2Q.js → chunk.SPXRLO5K.js} +1 -1
- package/dist/preview/chunk.TBW7CU4G.js +1 -0
- package/dist/preview/{chunk.USB6B6L3.js → chunk.TF5I4VHX.js} +1 -1
- package/dist/preview/{chunk.4EUH6TLG.js → chunk.TJ647W6J.js} +2 -2
- package/dist/preview/{chunk.ZFXHZZHW.js → chunk.TJOXNEFU.js} +1 -1
- package/dist/preview/{chunk.WMB2NNBD.js → chunk.TUUVVO5U.js} +1 -1
- package/dist/preview/{chunk.AZUTYY2S.js → chunk.TWKXSLYY.js} +4 -4
- package/dist/preview/chunk.TXGNPW76.js +1 -0
- package/dist/preview/{chunk.VSM72NVF.js → chunk.U6O3MMQR.js} +1 -1
- package/dist/preview/{chunk.EC5IWN74.js → chunk.UAP5M3CD.js} +2 -2
- package/dist/preview/chunk.UDCDK7XJ.js +4 -0
- package/dist/preview/chunk.UKMVJV6Q.js +1 -0
- package/dist/preview/chunk.UUG3BYVN.js +1 -0
- package/dist/preview/{chunk.RDL6652E.js → chunk.VG7OWV2H.js} +1 -1
- package/dist/preview/{chunk.BNEOLRQG.js → chunk.VHSWBFXB.js} +1 -1
- package/dist/preview/{chunk.D4LN33J2.js → chunk.VUPLFUUS.js} +1 -1
- package/dist/preview/chunk.WJFQIE3Y.js +1 -0
- package/dist/preview/{chunk.AQCU6TPV.js → chunk.WNQFHMNR.js} +1 -1
- package/dist/preview/{chunk.CKV2QCH5.js → chunk.WNSC3RWD.js} +1 -1
- package/dist/preview/{chunk.CU2NQ5WF.js → chunk.WQOI6BLM.js} +1 -1
- package/dist/preview/{chunk.RXYE2DAJ.js → chunk.WXIEQZLY.js} +1 -1
- package/dist/preview/{chunk.2HZGUVB2.js → chunk.XN2RVXOI.js} +1 -1
- package/dist/preview/{chunk.USQNSNIA.js → chunk.XU34T2H4.js} +1 -1
- package/dist/preview/{chunk.HFVMGTNL.js → chunk.YD3TKV6P.js} +2 -2
- package/dist/preview/{chunk.K5YLQAFW.js → chunk.YHTE34RN.js} +1 -1
- package/dist/preview/chunk.YIA2EDVF.js +3 -0
- package/dist/preview/{chunk.JQY2UKU6.js → chunk.YP2F5UGY.js} +1 -1
- package/dist/preview/{chunk.D6BMAGPR.js → chunk.YS6GVLIP.js} +1 -1
- package/dist/preview/{chunk.O6LDZWLR.js → chunk.YZZONE4M.js} +1 -1
- package/dist/preview/{chunk.5B4HNQGR.js → chunk.ZN5HTWSI.js} +1 -1
- package/dist/preview/{chunk.AKVBU5K5.js → chunk.ZOHMWSHD.js} +1 -1
- package/dist/preview/index.html +50 -50
- package/dist/preview/page.js +2 -2
- package/package.json +6 -6
- package/dist/preview/chunk.2BLRCT3E.js +0 -1
- package/dist/preview/chunk.3V2WH6F7.js +0 -1
- package/dist/preview/chunk.4YI6656P.js +0 -1
- package/dist/preview/chunk.5MSWUTDB.js +0 -1
- package/dist/preview/chunk.6Q6BW4QT.js +0 -2
- package/dist/preview/chunk.7U2JO7ET.js +0 -3
- package/dist/preview/chunk.7Z2PRPYE.js +0 -1
- package/dist/preview/chunk.AGTFYPXY.js +0 -1
- package/dist/preview/chunk.BT7RLFPO.js +0 -1
- package/dist/preview/chunk.DPPT6WAJ.js +0 -2
- package/dist/preview/chunk.DVG47BK3.js +0 -1
- package/dist/preview/chunk.DZYLH5IM.js +0 -1
- package/dist/preview/chunk.E5XNQTEU.js +0 -1
- package/dist/preview/chunk.F5RN6YXG.js +0 -4
- package/dist/preview/chunk.FOQENWF5.js +0 -1
- package/dist/preview/chunk.GNQW4JOG.js +0 -18
- package/dist/preview/chunk.HVN2DVP3.js +0 -1
- package/dist/preview/chunk.JL4DGITZ.js +0 -1
- package/dist/preview/chunk.K4MO22RM.js +0 -1
- package/dist/preview/chunk.KMEKMCKG.js +0 -3
- package/dist/preview/chunk.LVOVPU64.js +0 -1
- package/dist/preview/chunk.MEJUAV3Y.js +0 -1
- package/dist/preview/chunk.OYGPNO7A.js +0 -1
- package/dist/preview/chunk.QYFZ7AZS.js +0 -1132
- package/dist/preview/chunk.RR2IFETZ.js +0 -1
- package/dist/preview/chunk.T2RME6XF.js +0 -1
- package/dist/preview/chunk.TAJ2R44N.js +0 -1
- package/dist/preview/chunk.TQCRFZ53.js +0 -1
- package/dist/preview/chunk.UE5YS3GN.js +0 -1
- package/dist/preview/chunk.VIQ6EF2O.js +0 -1
- package/dist/preview/chunk.XE72DFBV.js +0 -13
- package/dist/preview/chunk.YEJ4LNUP.js +0 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./chunk.AJZBJBMO.js";var e='"use strict";\n/*! @remote-dom/core and @remote-dom/polyfill \u2014 Copyright 2020-present, Shopify Inc. \u2014 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 \u2014 Elastic License 2.0. */\n"use strict";(()=>{var Ae=globalThis,no=Ae.addEventListener,ro=Ae.removeEventListener,oo=Ae.postMessage,io=globalThis.queueMicrotask,mn=globalThis.performance,so=mn?mn.now.bind(mn):Date.now,_e={listen:t=>no.call(Ae,"message",t),unlisten:t=>ro.call(Ae,"message",t),post:t=>oo.call(Ae,t),microtask:t=>io.call(globalThis,t),now:()=>so()};var v=Symbol("name"),me=Symbol("prefix"),fe=Symbol("value"),S=Symbol("ns"),q=Symbol("owner"),I=Symbol("owner_document"),re=Symbol("attributes"),M=Symbol("prev"),p=Symbol("next"),R=Symbol("child"),Y=Symbol("parent"),pe=Symbol("host"),K=Symbol("data"),Te=Symbol("listeners"),fn=Symbol("isTrusted"),ke=Symbol("path"),Pe=Symbol("stop_immediate_propagation"),Ce=Symbol("dispatching"),se=Symbol("content"),D=Symbol("hooks"),ft=Symbol("extensions"),we=Symbol("hooks_dispatch"),U=Symbol("is_connected"),Ie=Symbol("create_element"),$n=0,X=1,Me=2,De=3,Le=8,xe=9,Kn=10,he=11,A="http://www.w3.org/1999/xhtml",Z="http://www.w3.org/2000/svg",Zn="http://www.w3.org/XML/1998/namespace",$e="http://www.w3.org/2000/xmlns/";function pt(t){return t.split(/[\\t\\n\\f\\r ]+/).filter(Boolean)}function G(t){return t.replace(/[A-Z]/g,e=>String.fromCharCode(e.charCodeAt(0)+32))}function Qn(t){return t.replace(/[a-z]/g,e=>String.fromCharCode(e.charCodeAt(0)-32))}function P(t,e){let n=globalThis.DOMException;if(typeof n=="function")return new n(t,e);let r=new Error(t);return r.name=e,r}var Jn=/^(?:[A-Za-z][^\\0\\t\\n\\f\\r\\u0020/>]*|[:_\\u0080-\\u{10FFFF}][A-Za-z0-9-.:_\\u0080-\\u{10FFFF}]*)$/u,er=/[\\0\\t\\n\\f\\r />=]/u,ao=/[\\0\\t\\n\\f\\r />]/u;function ae(t){if(t==null)return null;let e=String(t);return e===""?null:e}function tr(t){Jn.test(t)||hn(t)}function pn(t){(t===""||er.test(t))&&hn(t)}function ht(t,e,n){let r=ae(t),o=String(e),i=o.indexOf(":"),s=i<0?null:o.slice(0,i),a=i<0?o:o.slice(i+1);if((s!=null&&(s===""||ao.test(s))||(n==="element"?!Jn.test(a):a===""||er.test(a)))&&hn(o),s!=null&&r==null)throw P(`A namespace is required for the prefix in "${o}"`,"NamespaceError");if(s==="xml"&&r!==Zn)throw P("The xml prefix requires the XML namespace","NamespaceError");if((o==="xmlns"||s==="xmlns")&&r!==$e)throw P("The xmlns name requires the XMLNS namespace","NamespaceError");if(r===$e&&o!=="xmlns"&&s!=="xmlns")throw P("The XMLNS namespace requires the xmlns name or prefix","NamespaceError");return{namespace:r,qualifiedName:o,prefix:s,localName:a}}function hn(t){throw P(`Invalid name: "${t}"`,"InvalidCharacterError")}var gt=0,yt=1,nr=2,gn=3,lo=typeof performance>"u"?Date.now:performance.now.bind(performance),B=class{static NONE=gt;static CAPTURING_PHASE=yt;static AT_TARGET=nr;static BUBBLING_PHASE=gn;timeStamp=lo();target=null;currentTarget=null;srcElement=null;bubbles=!1;cancelable=!1;composed=!1;defaultPrevented=!1;cancelBubble=!1;eventPhase=gt;[ke]=[];[Pe]=!1;[Ce]=!1;constructor(e,n){this.type=e,Object.defineProperty(this,fn,{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[fn]}composedPath(){return[...this[ke]]}stopPropagation(){this.cancelBubble=!0}stopImmediatePropagation(){this[Pe]=!0,this.cancelBubble=!0}preventDefault(){this.cancelable&&(this.defaultPrevented=!0)}set returnValue(e){e||this.preventDefault()}get returnValue(){return!this.defaultPrevented}initEvent(e,n,r){this.type=e,this.bubbles=!!n,this.cancelable=!!r}};function yn(t,e,n){if(t.cancelBubble)return;let o=e[Te]?.get(t.type)?.[n===yt?"capture":"bubble"];if(o)for(let i of[...o]){if(!o.has(i)||i.signal?.aborted)continue;t.eventPhase=t.target===e?nr:n,t.currentTarget=e;let s=i.normalizedListener;try{typeof s=="object"?s.handleEvent(t):s.call(e,t)}catch(a){setTimeout(co,0,a)}if(t[Pe])break}}function co(t){throw t}var Ke=[],bt=new WeakMap;function Et(t,e){let n=bt.get(t);n?n.push(e):bt.set(t,[e]),Ke[Ke.length-1].push(t)}function V(t){let e=[];Ke.push(e);let n;try{n=t()}catch(r){Ke.pop();try{rr(e)}catch{}throw r}return Ke.pop(),rr(e),n}function rr(t){let e,n=!1;for(let r of t){let o=bt.get(r);if(o){for(;o.length>0;){let i=o.shift();try{i()}catch(s){n||(e=s,n=!0)}}bt.delete(r)}}if(n)throw e}var Nt=[],Ze=[],bn=!1;function ve(t){for(let e of t)Nt.push(e),e[1]&&Ze.push(e[1]);if(!bn){bn=!0;try{let e,n=!1;for(let r=0;r<Nt.length;r++){let[o,i]=Nt[r];i&&Ze.splice(Ze.indexOf(i),1);try{o()}catch(s){n||(e=s,n=!0)}}if(n)throw e}finally{Nt.length=0,Ze.length=0,bn=!1}}}function Qe(t){let e=t;for(;e;){if(Ze.includes(e))return!0;e=e[Y]??e[pe]}return!1}var Je=Symbol("listenerRegistrations"),ge=class{[Te]=void 0;[Je]=void 0;[I]=void 0;addEventListener(e,n,r){if(n==null)return;let o=r===!0||typeof r=="object"&&r.capture===!0,i=typeof r=="object"&&r.once===!0,s=typeof r=="object"?r.signal:void 0;if(s?.aborted)return;let a=En(o),c=this[Je];c||(c=new Map,this[Je]=c);let u=c.get(e);u||(u={},c.set(e,u));let m=u[a];if(m||(m=new Map,u[a]=m),m.has(n))return;let h=this,g={type:e,listener:n,capture:o,once:i,normalizedListener:n,signal:s};(i||s)&&(g.normalizedListener=function(...C){if(g.signal?.aborted){Tt(h,g);return}return g.once&&Tt(h,g),typeof g.listener=="object"?g.listener.handleEvent(...C):g.listener.call(this,...C)});let y=this[Te];y||(y=new Map,this[Te]=y);let O=y.get(e);O||(O={},y.set(e,O));let E=O[a];if(E||(E=new Set,O[a]=E),m.set(n,g),E.add(g),s){let N=()=>{Tt(h,g)};g.abortListener=N,s.addEventListener("abort",N,{once:!0})}this[I]?.defaultView[we].addEventListener?.(this,e,n,r)}removeEventListener(e,n,r){return uo.call(this,e,n,r)}dispatchEvent(e){if(e[Ce])throw P("Failed to execute \'dispatchEvent\' on \'EventTarget\': The event is already being dispatched.","InvalidStateError");e[Ce]=!0;try{let n=[],r=this;for(;r!=null;)n.push(r),r=r.parentNode;e.target=this,e.srcElement=this,e[ke]=n;for(let i=n.length;i--;)if(yn(e,n[i],yt),e.cancelBubble)return!e.defaultPrevented;let o=e.bubbles?n:n.slice(0,1);for(let i=0;i<o.length;i++)if(yn(e,o[i],gn),e.cancelBubble)return!e.defaultPrevented;return!e.defaultPrevented}finally{e[Ce]=!1,e.cancelBubble=!1,e[Pe]=!1,e.eventPhase=gt,e.currentTarget=null,e[ke]=[]}}};function uo(t,e,n){if(e==null)return;let r=n===!0||n&&n.capture===!0,o=En(!!r),i=this[Je]?.get(t)?.[o]?.get(e);i&&Tt(this,i)}function En(t){return t?"capture":"bubble"}function Tt(t,e){let n=En(e.capture),r=t[Je],o=r?.get(e.type);if(!o)return;let i=o[n];if(!i||i.get(e.listener)!==e)return;i.delete(e.listener),i.size===0&&delete o[n],!o.bubble&&!o.capture&&r?.delete(e.type),e.signal&&e.abortListener&&e.signal.removeEventListener("abort",e.abortListener);let s=t[Te],a=s?.get(e.type);if(!a)return;let c=a[n];c?.delete(e)&&(c.size===0&&delete a[n],!a.bubble&&!a.capture&&s?.delete(e.type),t[I]?.defaultView[we].removeEventListener?.(t,e.type,e.listener,e.capture))}var Q=class extends Array{item(e){return this[e]??null}};var tt=0,or=1,wn=2,xn=3,nt=4,ir=0,sr=1,vt=2,St=3,ar=4,Tn=5,lr=6,cr=7,wt=/^(?:--|-?[A-Za-z_\\u0080-\\u{10FFFF}])[A-Za-z0-9_\\u0080-\\u{10FFFF}-]*$/u;function mo(t,e){let n=1,r=null;for(let o=e;o<t.length;o++){let i=t[o];if(r){i==="\\\\"?o++:i===r&&(r=null);continue}if(i===\'"\'||i==="\'")r=i;else if(i==="(")n++;else if(i===")"&&--n===0)return[t.slice(e,o),o+1]}return[t.slice(e),t.length]}function W(t){throw P(`Invalid or unsupported selector: "${t}"`,"SyntaxError")}function Ot(t,e){let n=typeof e=="string"?rt(e):[{combinator:nt,matchers:e}],r=null,o=t[R];return o&&n[0].matchers.length&&vn(o,n,i=>(r=i,!1)),r}function Rt(t,e){let n=typeof e=="string"?rt(e):[{combinator:nt,matchers:e}],r=new Q,o=t[R];return o&&n[0].matchers.length&&vn(o,n,i=>{r.push(i)}),r}function rt(t,e=!1,n=!1){let r={combinator:nt,matchers:[]},o=[r],i=/[\\t\\n\\f\\r ]*?([>\\t\\n\\f\\r +~]?)[\\t\\n\\f\\r ]*?(?:(?:\\[[\\t\\n\\f\\r ]*([^\\]=\\t\\n\\f\\r ]+)[\\t\\n\\f\\r ]*(?:=[\\t\\n\\f\\r ]*(?:([\'"])(.*?)\\3|([^\\]\\t\\n\\f\\r ]+)))?[\\t\\n\\f\\r ]*(?:\\]|$))|([#.]?)([^\\t\\n\\f\\r #.[>:+~()]+)|:(\\w+)(\\()?)/gi,s=t.replace(/^[\\t\\n\\f\\r ]+|[\\t\\n\\f\\r ]+$/g,"");s===""&&W(t);let a=0,c;for(;c=i.exec(s);){c.index!==a&&W(t),c[1]&&(r.matchers.length===0&&!(n&&o.length===1)&&W(t),c[1]===">"?r.combinator=or:c[1]==="+"?r.combinator=xn:c[1]==="~"?r.combinator=wn:r.combinator=tt,r={combinator:nt,matchers:[]},o.push(r));let u=c[8]?G(c[8]):c[2]||c[7];c[7]!=null&&!c[6]&&r.matchers.length>0&&W(t);let h,g=c[4]??c[5]??c[7];if(c[2]){wt.test(u)||W(t);let y=c[5],O=y?.[0];if(c[3]==null&&(O===\'"\'||O==="\'")){let E=c[0].lastIndexOf(y);g=s.slice(c.index+E+1),i.lastIndex=s.length}else y!=null&&!wt.test(y)&&W(t);h=ar}else c[6]?(wt.test(u)||W(t),h=c[6]==="#"?vt:St):c[8]?h=c[9]==null?Tn:lr:c[7]==="*"?h=ir:c[7]&&wt.test(c[7])?h=sr:W(t);c[9]?([g,i.lastIndex]=mo(s,i.lastIndex),u!=="has"&&u!=="not"&&W(t),u==="has"&&e&&W(t),rt(g,e||u==="has",u==="has")):h===Tn&&W(t),r.matchers.push({type:h,name:u,value:g}),a=i.lastIndex}return(a!==s.length||r.matchers.length===0)&&W(t),o}function fo(t,e){let n=rt(e);return n[0]?.matchers.length?et(t,n):!1}function po(t,e){let n=rt(e,!0,!0),r=n[0];if(n.length===1&&r.matchers.length===0)return!1;let o=tt,i={type:cr,name:":scope"};if(r.matchers.length===0?(o=r.combinator,r.matchers.push(i)):n.unshift({combinator:tt,matchers:[i]}),n.some(({matchers:c})=>c.length===0))return!1;let s=o===xn||o===wn?t[p]:t[R];if(!s)return!1;let a=!1;return vn(s,n,()=>(a=!0,!1),t),a}function vn(t,e,n,r){let o=[],i=t;for(;i;){if(j(i)){if(et(i,e,r)&&n(i)===!1)return!1;let s=i[R];if(s){let a=i[p];a&&o.push(a),i=s;continue}}i=i[p]??o.pop()??null}return!0}function et(t,e,n){let{combinator:r,matchers:o}=e[e.length-1];if(r===nt){if(!xt(t,o,n))return!1;let a=e.slice(0,-1);return a.length===0||et(t,a,n)}let i=r===or||r===tt?Y:M,s=t[i];if(!s)return!1;if(r===tt||r===wn){for(;s;){if(j(s)&&xt(s,o,n)){let a=e.slice(0,-1);if(a.length===0||et(s,a,n))return!0}s=s[i]}return!1}else{if(r===xn&&!j(s)){for(;s&&!j(s);)s=s[i];if(!s)return!1}if(!j(s)||!xt(s,o,n))return!1;let a=e.slice(0,-1);return a.length===0||et(s,a,n)}}function Nn(t,e){return t.getAttributeNS(null,t.namespaceURI===A?G(e):e)}function xt(t,e,n){if(!t)return!1;if(Array.isArray(e)){for(let s of e)if(xt(t,s,n)===!1)return!1;return!0}let{type:r,name:o,value:i}=e;switch(r){case ir:return o==="*";case sr:return t.namespaceURI===A?t.localName===G(o):t.localName===o;case vt:return Nn(t,"id")===o;case St:let s=Nn(t,"class");return s?pt(s).includes(o):!1;case ar:let a=Nn(t,o);return i==null?a!=null:a===i;case cr:return t===n;case Tn:W(`:${o}`);case lr:switch(o){case"has":return po(t,i||"");case"not":return!fo(t,i||"");default:W(`:${o}(${i})`)}}return!1}function ho(t){return t.nodeType===Me}function ot(t){return K in t}function On(t){return t.nodeType===De}function go(t){return t.nodeType===Le}function j(t){return t.nodeType===X}function Sn(t){return t.nodeType===he}function fr(t){return"appendChild"in t}function At(t){let e=[],n=[t],r=new Set(n),o=new Set,i;for(;n.length>0;){let s=n.pop();if(r.delete(s),o.has(s))continue;let a=[];for(let c of st(s)){if(o.has(c)||(o.add(c),e.push(c),a.push(c),!j(c)))continue;let u=c[re];if(u)for(let h of u)o.has(h)||(o.add(h),e.push(h));let m=c[se];m&&!o.has(m)&&!r.has(m)&&(r.add(m),n.push(m))}i??=a}return{nodes:e,treeNodes:i}}function it(t,e){for(let n of t)n[I]=e}function ur(t,e){let n=t.constructor,r=new n(t.name,t.value,t.namespaceURI);return r[I]=e,r}function dr(t,e){if(On(t))return e.createTextNode(t.data);if(go(t))return e.createComment(t.data);if(ho(t))return ur(t,e);if(j(t)){let n=e[Ie](t[v],t.namespaceURI,t[me],t.localName);if(t[re])for(let r=0;r<t[re].length;r++){let o=t[re].item(r);n.attributes.setNamedItem(ur(o,e))}return n}else{if(Sn(t))return e.createDocumentFragment();{let n=new t.constructor;return n[I]=e,n}}}function _t(t,e,n=t.ownerDocument){if(t.nodeType===xe)throw P("Cannot clone a document node","NotSupportedError");let r=dr(t,n);if(!e||!j(t)&&!Sn(t))return r;let o=new Set([t]),i=[{source:t,destination:r,childIndex:0,cloningContent:!1}];for(;i.length>0;){let s=i[i.length-1],a,c;if(s.cloningContent)if(s.contentSource&&s.contentDestination)a=s.contentSource.childNodes[s.childIndex++],c=s.contentDestination;else{i.pop(),s.appendTo&&s.appendTo.appendChild(s.destination);continue}else if(a=s.source.childNodes[s.childIndex++],c=s.destination,!a){if(s.cloningContent=!0,s.childIndex=0,j(s.source)&&s.source.namespaceURI===A&&s.source.localName==="template"){let m=s.source[se];m&&(o.has(m)&&mr(),o.add(m),s.contentSource=m,s.contentDestination=s.destination.content)}continue}if(!a){i.pop(),s.appendTo&&s.appendTo.appendChild(s.destination);continue}o.has(a)&&mr(),o.add(a);let u=dr(a,n);j(a)||Sn(a)?i.push({source:a,destination:u,appendTo:c,childIndex:0,cloningContent:!1}):c.appendChild(u)}return r}function mr(){throw new Error("Cannot clone a cyclic or repeated node graph")}function kt(t,e){let n=String(e);return n===""?null:Ot(t,[{type:vt,name:n}])}function Pt(t,e){let n=[...new Set(pt(String(e)))];return Rt(t,n.map(r=>({type:St,name:r})))}function Ct(t,e){let n=String(e),r=G(n),o=[];for(let i of It(t))j(i)&&(n==="*"||(i.namespaceURI===A?i[v]===r:i[v]===n))&&o.push(i);return o}function It(t){let e=[],n=[],r=t[R];for(;r;){e.push(r);let o=r[R],i=r[p];o?(i&&n.push(i),r=o):r=i??n.pop()??null}return e}function st(t){let e=It(t);return e.unshift(t),e}var J=class extends ge{nodeType=$n;[v]="";[Y]=null;[pe]=null;[R]=null;[M]=null;[p]=null;[U]=!1;get[D](){return this[I].defaultView[we]}get localName(){return this[v]}get nodeName(){return this[v]}get ownerDocument(){return this[I]}get isConnected(){return this[U]}isDefaultNamespace(e){let n=ae(e);return yo(this)===n}get parentNode(){return this[Y]}set parentNode(e){}get parentElement(){let e=this[Y];return!e||e.nodeType!==1?null:e}set parentElement(e){}get previousSibling(){return this[M]}set previousSibling(e){}get nextSibling(){return this[p]}set nextSibling(e){}get previousElementSibling(){let e=this[M];for(;e&&e.nodeType!==1;)e=e[M];return e}set previousElementSibling(e){}get nextElementSibling(){let e=this[p];for(;e&&e.nodeType!==1;)e=e[p];return e}set nextElementSibling(e){}get firstChild(){return this[R]}set firstChild(e){}get lastChild(){let e=this[R];for(;e;){let n=e[p];if(n==null)break;e=n}return e}set lastChild(e){}get nodeValue(){return ot(this)?this.data:null}set nodeValue(e){ot(this)&&(this.data=e)}get textContent(){if(ot(this))return this.data;let e="";for(let n of It(this))On(n)&&(e+=n.data);return e}set textContent(e){if(ot(this))this.data=e;else if(fr(this)){let n=e==null?"":String(e);n===""?this.replaceChildren():this.replaceChildren(n)}}cloneNode(e){return _t(this,e)}contains(e){let n=e;for(;n!=null;){if(n===this)return!0;n=n.parentNode}return!1}};function yo(t){let e=t;for(;e;)switch(e.nodeType){case X:{let n=e;if(n.prefix==null&&n.namespaceURI!=null)return n.namespaceURI;let r=n.attributes.getNamedItemNS($e,"xmlns");if(r!=null&&r.prefix==null)return ae(r.value);e=n.parentElement;break}case xe:e=e.documentElement;break;case Kn:case he:return null;case Me:e=e.ownerElement;break;default:e=e.parentElement}return null}var ee=Symbol("insertNode"),_n=Symbol("preflightInsertions"),Mt=Symbol("replaceNode"),ye=class extends J{remove(){let e=this.parentNode;e&&e.removeChild(this)}replaceWith(...e){let n=Se(e),r=this.parentNode;if(r)return Rn(o=>{le(r,n);let i=this[p];for(;i&&n.includes(i);)i=i[p];let s=An(r,n,o);this.parentNode===r?r[Mt](s,this,o):r[ee](s,i,o)})}before(...e){let n=Se(e),r=this.parentNode;if(r)return Rn(o=>{le(r,n);let i=this[M];for(;i&&n.includes(i);)i=i[M];let s=An(r,n,o);r[ee](s,i?i[p]:r.firstChild,o)})}after(...e){let n=Se(e),r=this.parentNode;if(r)return Rn(o=>{le(r,n);let i=this[p];for(;i&&n.includes(i);)i=i[p];let s=An(r,n,o);r[ee](s,i,o)})}};function Rn(t){return V(()=>{let e=[];try{t(e)}catch(n){try{ve(e)}catch{}throw n}ve(e)})}function Se(t){return t.map(e=>e instanceof J?e:String(e))}function at(t,e){return e instanceof J?e:t.ownerDocument.createTextNode(String(e))}function le(t,e){for(let n of e){if(!(n instanceof J))continue;let r=t;for(;r;){if(r===n)throw P("Cannot insert a node into itself or one of its descendants","HierarchyRequestError");r=r[Y]??r[pe]}}}function An(t,e,n){let r=[];for(let i of e)r.push(at(t,i));if(r.length===1)return r[0];let o=t.ownerDocument.createDocumentFragment();o[_n](r);for(let i of r)o[ee](i,null,n);return o}var Dt,kn=0,pr=0,hr=0,gr=0,Ge=!1,Cn=!1,lt=!1,Lt=class{#t;#n=[];#e=new Set;#r=!1;constructor(e){if(typeof e!="function")throw new TypeError("MutationObserver callback must be a function");this.#t=e}observe(e,n={}){let r=bo(n),o=Dt??=new WeakMap,i=o.get(e);i==null&&(i=new Map,o.set(e,i));let s=i.get(this);s==null?kn++:Pn(s,-1),i.set(this,r),Pn(r,1),this.#e.add(e)}disconnect(){let e=Dt;if(e!=null){for(let n of this.#e){let r=e.get(n),o=r?.get(this);o!=null&&(r.delete(this),kn--,Pn(o,-1)),r?.size===0&&e.delete(n)}this.#e.clear(),this.#n.length=0,kn===0&&(Dt=void 0)}}takeRecords(){return this.#n.splice(0)}enqueue(e){this.#n.push(e),!this.#r&&(this.#r=!0,queueMicrotask(()=>{this.#r=!1;let n=this.takeRecords();n.length>0&&this.#t.call(this,n,this)}))}};function te(t){let e=Dt;if(e==null)return;let n=new Map,r=t.target;for(;r;){let o=e.get(r);if(o)for(let[i,s]of o){if(r!==t.target&&!s.subtree)continue;let a=!1;if(t.type==="attributes"){if(!s.attributes||s.attributeFilter&&!s.attributeFilter.has(t.attributeName??""))continue;a=s.attributeOldValue}else if(t.type==="characterData"){if(!s.characterData)continue;a=s.characterDataOldValue}else if(!s.childList)continue;n.set(i,n.get(i)===!0||a)}r=r.parentNode}for(let[o,i]of n)o.enqueue({addedNodes:t.addedNodes??new Q,attributeName:t.attributeName??null,attributeNamespace:t.attributeNamespace??null,nextSibling:t.nextSibling??null,oldValue:i?t.oldValue??null:null,previousSibling:t.previousSibling??null,removedNodes:t.removedNodes??new Q,target:t.target,type:t.type})}function Gt(...t){let e=new Q;return e.push(...t),e}function bo(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 Pn(t,e){t.attributes&&(pr+=e),t.characterData&&(hr+=e),t.childList&&(gr+=e),Ge=pr>0,Cn=hr>0,lt=gr>0}var oe=class extends ye{childNodes=new Q;children=new Q;appendChild(e){return V(()=>this[ee](e,null))}insertBefore(e,n){return V(()=>this[ee](e,n||null))}append(...e){return V(()=>{let n=Se(e.filter(r=>r!=null));n.length>1&&le(this,n);for(let r of n)this[ee](at(this,r),null)})}prepend(...e){return V(()=>{let n=Se(e.filter(o=>o!=null));n.length>1&&le(this,n);let r=this.firstChild;for(let o of n)this[ee](at(this,o),r)})}replaceChildren(...e){return V(()=>{let n=Se(e.filter(o=>o!=null));le(this,n);let r;for(;r=this.firstChild;)this.removeChildImmediately(r);for(let o of n)this[ee](at(this,o),null)})}removeChild(e){return V(()=>(this.removeChildImmediately(e),e))}removeChildImmediately(e){if(e.parentNode!==this)throw P("The node is not a child of this node","NotFoundError");let n=this[U]?st(e):void 0,r=e[M],o=e[p],i=Ht(this,e);if(n)for(let s of n)s[U]=!1;this.queueRemovalMutationRecord(this,e,r,o),n&&this.enqueueTreeReactions(n,"disconnectedCallback"),ve(this.collectRemovalHookEffects(e,i))}replaceChild(e,n){return V(()=>this[Mt](e,n))}[Mt](e,n,r){if(le(this,[e]),n.parentNode!==this)throw P("The reference node is not a child of this parent","NotFoundError");let o=n[M],i=n[p],s=this.prepareInsertion(e),a=this[U]?st(n):void 0,c=new Set(s.map(({node:g})=>g)),u=i;for(;u&&c.has(u);)u=u[p];let m=Ht(this,n);if(a){for(let y of a)y[U]=!1;let g=new Set(a);for(let y of s)g.has(y.node)&&(y.shouldDisconnect=!1)}this.commitInsertion(s,u);let h=this[U];return this.queueRemovalMutationRecord(this,n,o,i),this.queueInsertionMutationRecords(s),a&&this.enqueueTreeReactions(a,"disconnectedCallback"),this.enqueueInsertionReactions(s,h),this.performOrCollectHookEffects([...this.collectRemovalHookEffects(n,m),...this.collectInsertionHookEffects(s)],r),n}querySelectorAll(e){return Rt(this,e)}querySelector(e){return Ot(this,e)}[ee](e,n,r){return this.validateInsertion(e,n),this.insertIntoValidated(e,n,r),e}[_n](e){for(let n of e)this.validateInsertion(n,null),this.prepareInsertion(n)}validateInsertion(e,n){if(le(this,[e]),n&&n.parentNode!==this)throw P("The reference node is not a child of this parent","NotFoundError")}insertIntoValidated(e,n,r){e===n&&(n=e[p]);let o=this.prepareInsertion(e);this.commitInsertion(o,n);let i=this[U];this.queueInsertionMutationRecords(o),this.enqueueInsertionReactions(o,i),this.performOrCollectHookEffects(this.collectInsertionHookEffects(o),r)}performOrCollectHookEffects(e,n){n?n.push(...e):ve(e)}prepareInsertion(e){let n=[];if(e.nodeType===he){let s=e[R];for(;s;)n.push(s),s=s[p]}else n.push(e);let r=this[U],o=this[I],i=[];for(let s of n){let a=s[U],c=a||r,u,m;if(s[I]===o)c&&(u=st(s));else{let h=At(s);m=h.nodes,c&&(u=h.treeNodes)}i.push({node:s,nodes:u,adoption:m,shouldDisconnect:a})}return i}commitInsertion(e,n){for(let i of e){let s=i.node[Y];if(s){let a=i.node[M],c=i.node[p];i.source={parent:s,index:Ht(s,i.node),previousSibling:a,nextSibling:c}}}for(let i of e){let s=this.attachChild(i.node,n);i.insertIndex=s.index,i.previousSibling=s.previousSibling,i.nextSibling=s.nextSibling}let r=this[I];for(let{adoption:i}of e)i&&it(i,r);let o=this[U];for(let{nodes:i}of e)if(i)for(let s of i)s[U]=o}attachChild(e,n){if(n){let i=n[M];e[p]=n,e[M]=i,i?i[p]=e:this[R]=e,n[M]=e}else{e[p]=null;let i=this[R];if(i){let s;for(;s=i[p];)i=s;i[p]=e,e[M]=i}else this[R]=e,e[M]=null}let r=j(e);e[Y]=this;let o;if(n){if(o=this.childNodes.indexOf(n),this.childNodes.splice(o,0,e),r){let i=n;for(;i&&!j(i);)i=i[p];i?this.children.splice(this.children.indexOf(i),0,e):this.children.push(e)}}else o=this.childNodes.length,this.childNodes.push(e),r&&this.children.push(e);return{index:o,previousSibling:e[M],nextSibling:e[p]}}queueRemovalMutationRecord(e,n,r,o){lt&&te({type:"childList",target:e,removedNodes:Gt(n),previousSibling:r,nextSibling:o})}queueInsertionMutationRecords(e){if(lt)for(let n of e){let{node:r,source:o}=n;o&&this.queueRemovalMutationRecord(o.parent,r,o.previousSibling,o.nextSibling),te({type:"childList",target:this,addedNodes:Gt(r),previousSibling:n.previousSibling,nextSibling:n.nextSibling})}}collectRemovalHookEffects(e,n){return this.nodeType!==X||Qe(this)?[]:[[()=>this[D].removeChild?.(this,e,n)]]}collectInsertionHookEffects(e){let n=[];for(let r of e){let{node:o,source:i}=r;i?.parent.nodeType===X&&!Qe(i.parent)&&n.push([()=>i.parent[D].removeChild?.(i.parent,o,i.index)]),this.nodeType===X&&!Qe(this)&&n.push([()=>this[D].insertChild?.(this,o,r.insertIndex),o])}return n}enqueueInsertionReactions(e,n){for(let r of e){let{nodes:o}=r;o&&(r.shouldDisconnect&&this.enqueueTreeReactions(o,"disconnectedCallback"),n&&this.enqueueTreeReactions(o,"connectedCallback"))}}enqueueTreeReactions(e,n){br(e,n)}};function yr(t,e,n,r){if(e.parentNode!==t)throw Error("not a child of this node");let o=t[U]?n.treeNodes:void 0,i=e[M],s=e[p],a=Ht(t,e);if(o)for(let u of o)u[U]=!1;it(n.nodes,r),lt&&te({type:"childList",target:t,removedNodes:Gt(e),previousSibling:i,nextSibling:s}),o&&br(o,"disconnectedCallback");let c=[];t.nodeType===X&&!Qe(t)&&c.push([()=>t[D].removeChild?.(t,e,a)]),ve(c)}function Ht(t,e){let n=e[M],r=e[p];n?n[p]=r:t[R]=r,r&&(r[M]=n);let o=t.childNodes.indexOf(e);return t.childNodes.splice(o,1),j(e)&&t.children.splice(t.children.indexOf(e),1),e[Y]=null,e[p]=null,e[M]=null,o}function br(t,e){for(let n of t){let r=n[e];typeof r=="function"&&Et(n,()=>r.call(n))}}function ct(t,e,n,r,o){let{observedAttributes:i}=t.constructor,{attributeChangedCallback:s}=t;s==null||i==null||!i.includes(e)||Et(t,()=>s.call(t,e,n,r,o))}var Ut=class{[R]=null;constructor(e){this[q]=e}getNamedItem(e){let n=String(e),r=this[q][S]===A?G(n):n,o=this[R];for(;o;){if(o.name===r)return o;o=o[p]}return null}getNamedItemNS(e,n){let r=ae(e),o=String(n),i=this[R];for(;i;){if(i.localName===o&&i[S]===r)return i;i=i[p]}return null}item(e){let n=this[R],r=0;for(;n;){if(r++===e)return n;n=n[p]}return null}get length(){let e=0,n=this[R];for(;n;)e++,n=n[p];return e}removeNamedItem(e){let n=String(e),r=this[q][S]===A?G(n):n;return V(()=>this.removeNamedItemImmediately(o=>o.name===r))}removeNamedItemNS(e,n){let r=ae(e),o=String(n);return V(()=>this.removeNamedItemImmediately(i=>i.localName===o&&i[S]===r))}removeNamedItemImmediately(e){let n=this[q],r=this[R],o=null;for(;r!=null;){if(e(r)){o&&(o[p]=r[p]),this[R]===r&&(this[R]=r[p]);let i=r.value;return r[p]=null,r[q]=null,Ge&&te({type:"attributes",target:n,attributeName:r.name,attributeNamespace:r[S],oldValue:i}),n[D].removeAttribute?.(n,r.name,r[S]),ct(n,r.localName,i,null,r[S]),r}o=r,r=r[p]}return null}setNamedItem(e){return V(()=>this.setNamedItemImmediately(e))}setNamedItemImmediately(e){let n=this[q],r=e[q];if(r!=null&&r!==n)throw P("The attribute is already in use by another element.","InUseAttributeError");let o=null,i=this[R],s=null;for(;i;){if(i.localName===e.localName&&i[S]===e[S]){if(i===e)return i;s?s[p]=e:this[R]=e,e[p]=i[p],i[p]=null,o=i;break}s=i,i=i[p]}o==null&&(s?s[p]=e:this[R]=e),e[q]=n,e[I]=n[I],o&&(o[q]=null);let a=o==null||o.value!==e.value,c=o!=null&&o.name!==e.name;return a&&Ge&&te({type:"attributes",target:n,attributeName:e.name,attributeNamespace:e[S],oldValue:o?.value??null}),c&&n[D].removeAttribute?.(n,o.name,o[S]),(a||c)&&n[D].setAttribute?.(n,e.name,e.value,e[S]),a&&ct(n,e.localName,o?.value??null,e.value,e[S]),o}setNamedItemNS(e){return this.setNamedItem(e)}*[Symbol.iterator](){let e=this[R];for(;e;)yield e,e=e[p]}};var Oe=class extends J{nodeType=Me;[S]=null;[p]=null;[q]=null;constructor(e,n,r){super(),this[v]=e,this[fe]=n,r&&(this[S]=r)}get nodeName(){return this[v]}set nodeName(e){}get name(){return this[v]}set name(e){}get localName(){if(this[S]==null)return this[v];let e=this[v].indexOf(":");return e<0?this[v]:this[v].slice(e+1)}get prefix(){if(this[S]==null)return null;let e=this[v].indexOf(":");return e<0?null:this[v].slice(0,e)}get value(){return this[fe]}set value(e){let n=String(e),r=this[q];if(!r){this[fe]=n;return}V(()=>{let o=this[fe];this[fe]=n,Ge&&o!==n&&te({type:"attributes",target:r,attributeName:this[v],attributeNamespace:this[S],oldValue:o}),this[D].setAttribute?.(r,this[v],n,this[S]),ct(r,this.localName,o,n,this[S])})}get nodeValue(){return this.value}set nodeValue(e){this.value=e}get ownerElement(){return this[q]}get namespaceURI(){return this[S]}get specified(){return!0}};var Eo={amp:"&",AMP:"&",apos:"\'",gt:">",GT:">",lt:"<",LT:"<",quot:\'"\',QUOT:\'"\'},No=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),To=/(?:<([a-z][a-z0-9-:]*)((?:[\\s]+[^<>\'"=/\\s]+(?:=([\'"])[^]*?\\3|=[^>\'"\\s]*|))*)[\\s]*(\\/?)\\s*>|<\\/([a-z][a-z0-9-:]*)>|<!--(.*?)-->|([^<>]+))/gi,Tr=/\\s([^<>\'"=/\\n\\s]+)(?:=(["\'])([\\s\\S]*?)\\2|=([^>\'"\\n\\s]*)|)/g,wo="|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|",xo=/^(?:color|face|size)$/i;function Er(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 Eo[n];let i=Number.parseInt(r??o,r?10:16);try{return String.fromCodePoint(i)}catch{return e}})}function wr(t){return t.namespaceURI===A&&No.has(t.localName)}function Nr(t){let e=t.localName;return t[S]===Z&&(e==="foreignObject"||e==="desc"||e==="title")}function vo(t,e){if(wo.includes(`|${t}|`))return!0;if(t!=="font")return!1;for(let n of e.matchAll(Tr))if(xo.test(n[1]))return!0;return!1}function Bt(t,e){let n=e.ownerDocument,r=n.createDocumentFragment(),o=[],i=r;for(let s of t.matchAll(To)){let a=s[1];if(a){let c=s[2],u=G(a),m=o[o.length-1]?.element??e,h=m[S]===Z?Z:A;if(u==="svg")h=Z;else if(h===Z){if(Nr(m))h=A;else if(vo(u,c)){for(;o.length>0;){let O=o[o.length-1];if(O.element[S]!==Z||Nr(O.element))break;o.pop(),i=O.target}h=A}}let g=h===A?u:a,y=n[Ie](g,h,null,g);for(let O of c.matchAll(Tr))y.setAttribute(O[1],Er(O[3]||O[4]||""));if(i.append(y),wr(y)||h!==A&&s[4])continue;o.push({element:y,target:i}),i=h===A&&u==="template"?y.content:y}else if(s[5]){let c=G(s[5]);for(let u=o.length-1;u>=0;u--){let m=o[u],h=G(m.element[v]);if(h===c){i=m.target,o.length=u;break}if(m.element[S]===A&&h==="template")break}}else s[6]?i.append(n.createComment(s[6])):i.append(Er(s[7]))}return r}function Vt(t){return vr([{type:"content",child:t[R]}])}function xr(t){return vr([{type:"opening",node:t}])}function vr(t){let e=[],n;for(;n=t.pop();)switch(n.type){case"opening":{let r=n.node;switch(r.nodeType){case X:{let o=r;e.push(`<${o[v]}`);let i=o[re]?.[R];for(;i;){e.push(` ${i[v]}`);let a=i[fe];a!==""&&(a=String(a).replace(/&/g,"&").replace(/"/g,"""),e.push(`="${a}"`)),i=i[p]}if(e.push(">"),wr(o))break;let s=o.namespaceURI===A&&o.localName==="template"?o[se]:o;t.push({type:"closing",name:o[v]}),t.push({type:"content",child:s?.[R]??null});break}case De:{let o=r;e.push(o[K].replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">"));break}case Le:{let o=r;e.push(`<!--${o[K]}-->`);break}}break}case"content":{let r=n.child;r&&(t.push({type:"content",child:r[p]}),t.push({type:"opening",node:r}));break}case"closing":e.push(`</${n.name}>`);break}return e.join("")}var H=class extends oe{nodeType=X;[S]=A;[me]=null;get namespaceURI(){return this[S]}get prefix(){return this[me]}get localName(){let e=this[me];return e==null?this[v]:this[v].slice(e.length+1)}get nodeName(){return this[S]===A?Qn(this[v]):this[v]}get tagName(){return this.nodeName}get id(){return this.getAttributeNS(null,"id")??""}set id(e){this.setAttribute("id",String(e))}get slot(){return this.getAttributeNS(null,"slot")??""}set slot(e){let n=String(e);this.getAttributeNS(null,"slot")!==n&&this.attributes.setNamedItem(new Oe("slot",n))}get attributes(){let e=this[re];return e||(e=new Ut(this),this[re]=e),e}getAttributeNames(){return[...this.attributes].map(e=>e.name)}getElementsByTagName(e){return Ct(this,e)}get firstElementChild(){return this.children[0]??null}getElementsByClassName(e){return Pt(this,e)}get lastElementChild(){return this.children[this.children.length-1]??null}get nextElementSibling(){let e=this.nextSibling;for(;e&&e.nodeType!==1;)e=e.nextSibling;return e}get previousElementSibling(){let e=this.previousSibling;for(;e&&e.nodeType!==1;)e=e.previousSibling;return e}setAttribute(e,n){let r=String(e),o=String(n);pn(r);let i=this[S]===A?G(r):r,s=this.attributes.getNamedItemNS(null,i);s?s.value=o:this.attributes.setNamedItem(new Oe(i,o))}setAttributeNS(e,n,r){let o=ae(e),i=String(n),s=String(r),a=ht(o,i,"attribute"),c=this.attributes.getNamedItemNS(a.namespace,a.localName);c?c.value=s:this.attributes.setNamedItemNS(new Oe(a.qualifiedName,s,a.namespace))}toggleAttribute(e,n){let r=String(e);pn(r);let o=this[S]===A?G(r):r,i=this.attributes.getNamedItemNS(null,o),s=n===void 0?void 0:!!n;return i==null?s===!1?!1:(this.attributes.setNamedItem(new Oe(o,"")),!0):s===!0?!0:(this.attributes.removeNamedItemNS(null,o),!1)}getAttribute(e){let n=this.attributes.getNamedItem(e);return n&&n.value}getAttributeNS(e,n){let r=this.attributes.getNamedItemNS(e,n);return r&&r.value}hasAttribute(e){return this.attributes.getNamedItem(e)!=null}hasAttributeNS(e,n){return this.attributes.getNamedItemNS(e,n)!=null}removeAttribute(e){let n=String(e),r=this[S]===A?G(n):n;this.attributes.removeNamedItemNS(null,r)}removeAttributeNS(e,n){this.attributes.removeNamedItemNS(e,n)}get outerHTML(){return xr(this)}get innerHTML(){return Vt(this)}set innerHTML(e){if(e==null||e==="")this.replaceChildren();else{let n=Bt(String(e),this);this.replaceChildren(n)}}};var He=class t extends H{[S]=Z;get ownerSVGElement(){let e=null,n=this.parentNode;for(;n instanceof t;)e=n,n=n.parentNode;return e}};var be=class extends ye{[K]="";constructor(e){super(),this[K]=e==null?"":String(e)}setData(e){let n=Cn,r=n?this[K]:null,o="";e!=null&&(o=typeof e=="string"?e:String(e)),this[K]=o,n&&r!==o&&te({type:"characterData",target:this,oldValue:r}),this[D].setText?.(this,o)}get data(){return this[K]}set data(e){this.setData(e)}};var Ue=class extends be{nodeType=De;[v]="#text"};var Be=class extends be{nodeType=Le;[v]="#comment"};var Ve=class extends oe{nodeType=he;[v]="#document-fragment";[I]=typeof window<"u"?window.document:null;getElementById(e){return kt(this,e)}};var ze=class extends H{get content(){let e=this[se];return e||(e=this.ownerDocument.createDocumentFragment(),e[pe]=this,this[se]=e),e}set content(e){}set innerHTML(e){this.content.replaceChildren(Bt(String(e),this))}get innerHTML(){let e=this[se];return e?Vt(e):""}};var zt=class extends H{};var jt=class extends H{};var Ft=class extends H{};var ut=class extends oe{nodeType=xe;[v]="#document";[U]=!0;constructor(e){super(),this.defaultView=e,this[I]=this,this.documentElement=Yt(new Ft,this,"html"),this.body=Yt(new zt,this,"body"),this.head=Yt(new jt,this,"head"),this.appendChild(this.documentElement),this.documentElement.appendChild(this.head),this.documentElement.appendChild(this.body)}get textContent(){return null}set textContent(e){}getElementsByClassName(e){return Pt(this,e)}createElement(e){let n=String(e);return tr(n),In(this,G(n))}createElementNS(e,n){let r=ht(e,n,"element");return In(this,r.qualifiedName,r.namespace,r.prefix,r.localName)}[Ie](e,n,r,o){return In(this,e,n,r,o)}createTextNode(e){let n=qt(new Ue(e),this);return this[D].createText?.(n,n.data),n}createComment(e){return qt(new Be(e),this)}createDocumentFragment(){return qt(new Ve,this)}createEvent(){return new B("")}getElementById(e){return kt(this,e)}getElementsByTagName(e){return Ct(this,e)}importNode(e,n){if(e.nodeType===xe)throw P("Cannot import a document node","NotSupportedError");return _t(e,n,this)}adoptNode(e){if(e[I]===this)return e;let n=At(e);return V(()=>{let r=e.parentNode;return r?yr(r,e,n,this):it(n.nodes,this),e})}};function qt(t,e){return Object.defineProperty(t,I,{value:e,writable:!0,enumerable:!1}),t}function In(t,e,n=A,r=null,o=e){let i;if(n===Z)i=new He;else if(n===A&&o==="template")i=new ze;else if(n===A){let s=t.defaultView.customElements.get(o);i=s?new s:new H}else i=new H;return Yt(i,t,e,n,r)}function Yt(t,e,n,r=A,o=null){return qt(t,e),Object.defineProperties(t,{[v]:{value:n},[S]:{value:r},[me]:{value:o}}),e[D].createElement?.(t,r),t}var Wt=class extends B{constructor(e,n){super(e,n),this.detail=n?.detail??null}initCustomEvent(e,n,r,o){super.initEvent(e,n,r),this.detail=o??null}};var Xt=class extends B{constructor(e,n){super(e,n),this.message=n.message,this.filename=n.filename,this.lineno=n.lineno,this.colno=n.colno,this.error=n.error}};var $t=class extends B{constructor(e,n){super(e,n),this.promise=n.promise,this.reason=n.reason}};var Kt=class extends B{constructor(e,n){super(e,n),this.oldState=n.oldState,this.newState=n.newState}};var Zt=class extends B{constructor(e,n={}){super(e,n),this.relatedTarget=n.relatedTarget??null}};var Qt=class extends B{constructor(e,n={}){super(e,n),this.clipboardData=n.clipboardData??null}};var Jt=class extends H{};var So=/^[a-z][^A-Z\\u0000\\t\\n\\f\\r />]*-[^A-Z\\u0000\\t\\n\\f\\r />]*$/u,Oo=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]);function Sr(t){return So.test(t)&&!Oo.has(t)}function Or(t){return P(`Invalid custom element name: "${t}"`,"SyntaxError")}var en=class{registry=new Map;listenersByName=new Map;define(e,n,r){if(!Sr(e))throw Or(e);if(this.registry.has(e))throw P(`A custom element named "${e}" has already been defined`,"NotSupportedError");if(this.getName(n)!=null)throw P("This constructor has already been registered in this custom element registry","NotSupportedError");this.registry.set(e,n);let o=this.listenersByName.get(e);if(o!=null){this.listenersByName.delete(e);for(let i of o)i(n)}}get(e){return this.registry.get(e)}getName(e){for(let[n,r]of this.registry)if(r===e)return n;return null}whenDefined(e){if(!Sr(e))return Promise.reject(Or(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 Ro=["onerror","onunhandledrejection"],Ar=Symbol.for("@remote-dom/polyfill/global-property");function _r(t){return Object.getOwnPropertyDescriptors(t)}function kr(t){let e={};for(let[n,r]of Object.entries(Object.getOwnPropertyDescriptors(ge.prototype)))n!=="constructor"&&typeof r.value=="function"&&(r.value=Mn(r.value.bind(t)),e[n]=r);return e}function Pr(t){let e={};for(let n of Ro)e[n]={configurable:!0,enumerable:!0,get:Mn(()=>t[n]),set:Mn(r=>{t[n]=r})};return e}function Ao(t){return Object.assign(_r(t),kr(t),Pr(t))}function Mn(t){return Object.defineProperty(t,Ar,{value:!0}),t}function Rr(t,e){for(let n of Reflect.ownKeys(e)){let r=_o(t,n);(r==null||ko(r))&&Object.defineProperty(t,n,e[n])}}function _o(t,e){let n=t;for(;n;){let r=Object.getOwnPropertyDescriptor(n,e);if(r)return r;n=Object.getPrototypeOf(n)}}function ko(t){return[t.value,t.get,t.set].some(e=>typeof e=="function"&&e[Ar]===!0)}var Re=class extends ge{[D]={};[ft]=[];[we]=Co(this);name="";window=this;parent=this;self=this;top=this;document=new ut(this);customElements=new en;location=globalThis.location;navigator=globalThis.navigator;Event=B;ErrorEvent=Xt;PromiseRejectionEvent=$t;ToggleEvent=Kt;FocusEvent=Zt;ClipboardEvent=Qt;EventTarget=ge;CustomEvent=Wt;Node=J;ParentNode=oe;ChildNode=ye;DocumentFragment=Ve;Document=ut;CharacterData=be;Comment=Be;Text=Ue;Element=H;HTMLElement=Jt;SVGElement=He;HTMLTemplateElement=ze;MutationObserver=Lt;#t=null;#n=null;#e=null;static with(...e){let n=this;return class extends n{constructor(){super();for(let o of e)Po(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=_r(e),i=Object.assign(kr(e),Pr(e));delete o.self,Object.defineProperties(globalThis,o),Rr(globalThis,i),typeof n>"u"||n===r&&n!==globalThis?Object.defineProperty(globalThis,"self",{value:e,configurable:!0,writable:!0,enumerable:!0}):n!==globalThis&&(Object.defineProperties(n,o),Rr(n,i))}static setGlobalThis(e){for(let n in e)e[n]===e&&(e[n]=globalThis);Object.defineProperties(globalThis,Ao(e))}};function Po(t,e){t[ft].push(e(t)??{})}function Co(t){return{createElement:ce.bind(null,t,"createElement"),setAttribute:ce.bind(null,t,"setAttribute"),removeAttribute:ce.bind(null,t,"removeAttribute"),createText:ce.bind(null,t,"createText"),setText:ce.bind(null,t,"setText"),insertChild:ce.bind(null,t,"insertChild"),removeChild:ce.bind(null,t,"removeChild"),addEventListener:ce.bind(null,t,"addEventListener"),removeEventListener:ce.bind(null,t,"removeEventListener")}}function ce(t,e,...n){for(let i of t[ft])i[e]?.apply(i,n);let r=t[D];r[e]?.apply(r,n)}var tn=new Re;var Dn="~";var Ee=new WeakMap;function je(t){return Ee.get(t)}var Un=new WeakMap,Mo=0;function $(t){let e=Un.get(t);return e==null&&(e=String(Mo++),nn(t,e)),e}function nn(t,e){Un.set(t,e)}var Gn=new WeakMap;function Do(t){return Gn.get(t)}var Hn=new WeakMap;function Lo(t){let e=Hn.get(t);if(e!=null)return e;if(!(!(t instanceof Element)||t.tagName.includes("-"))){e={};for(let{name:n,value:r}of t.attributes)e[n]=r;return e}}var Go=new WeakMap;function Ho(t){return Go.get(t)}function Bn(t,e,n){let r=Gn.get(t);if(r==null&&(r={},Gn.set(t,r)),r[e]===n)return;r[e]=n;let o=Ee.get(t);o?.mutate([[3,$(t),e,n,1]])}function Ne(t,e,n){let r=Hn.get(t);if(r==null&&(r={},Hn.set(t,r)),r[e]===n)return;n==null?delete r[e]:r[e]=String(n);let o=Ee.get(t);o?.mutate([[3,$(t),e,n,2]])}function Fe(t,e){if(Ee.get(t)!==e&&(Ee.set(t,e),t.childNodes))for(let r=0;r<t.childNodes.length;r++)Fe(t.childNodes[r],e)}function rn(t){if(Ee.get(t)!=null&&(Ee.delete(t),t.childNodes))for(let n=0;n<t.childNodes.length;n++)rn(t.childNodes[n])}function qe(t){let{nodeType:e}=t;switch(e){case 1:return{id:$(t),type:e,element:t.localName,properties:Ln(Do(t)),attributes:Ln(Lo(t)),eventListeners:Ln(Ho(t)),children:Array.from(t.childNodes).map(qe)};case 3:case 8:return{id:$(t),type:e,data:t.data};default:throw new Error(`Cannot serialize node of type ${t.nodeType} (${typeof t.nodeType})`)}}function Ln(t){return t?{...t}:void 0}function Vn(t,e,...n){let r=Un.get(t),o=Ee.get(t);if(r==null||o==null)throw new Error(`Cannot call method ${e} on an unconnected node`);return o.call(r,e,...n)}var Ye=tn[D];Ye.insertChild=(t,e,n)=>{let r=je(t);r!=null&&(Fe(e,r),r.mutate([[0,$(t),qe(e),n]]))};Ye.removeChild=(t,e,n)=>{let r=je(t);r!=null&&(rn(e),r.mutate([[1,$(t),n]]))};Ye.setText=(t,e)=>{let n=je(t);n?.mutate([[2,$(t),e]])};Ye.setAttribute=(t,e,n)=>{t.tagName.includes("-")||Ne(t,e,n)};Ye.removeAttribute=(t,e)=>{t.tagName.includes("-")||Ne(t,e)};Re.setGlobal(tn);function on(t){if(typeof t=="string")return{type:"navigate",to:t};let{place:e,record:n,where:r,section:o}=t??{},i={...r===void 0?{}:{where:r},...o===void 0?{}:{section:String(o)}};return typeof e=="string"?{type:"navigate",place:e,...i}:typeof n=="string"?{type:"navigate",to:n,...i}:void 0}var Ir=["wheel","drag","pinch"];function Mr(t){let e=t;return typeof t=="object"&&t!==null&&e.graview==="host-hello"&&typeof e.nonce=="string"}function Lr(t,e={}){let n,r="",o,i=0,s=new Set,a=new Map,c=[],u=E=>{n?n.postMessage({...E,nonce:r}):c.push(E)},m=E=>{let N=E.data;if(!(!N||typeof N!="object")){if(N.type==="props"){o=N.props;for(let C of s)C(N.props)}else N.type==="answer"?(a.get(N.id)?.(N),a.delete(N.id)):N.type==="event"&&typeof N.listener=="number"?e.onEvent?.(N):N.type==="heartbeat"&&typeof N.beat=="number"&&u({type:"heartbeat",beat:N.beat});e.onMessage?.(N)}},h=()=>{},g=E=>{if(n||!t.fromHost(E)||!Mr(E.data)||E.data.protocol!==1)return;let N=E.ports[0];if(N){n=N,r=E.data.nonce,n.onmessage=m,n.start?.(),h();for(let C of c.splice(0))u(C)}};h=t.listen(g),t.ready({graview:"guest-ready",protocol:1});let y,O={get props(){return o},subscribe(E){return s.add(E),()=>s.delete(E)},act(E,N={}){let C=i+=1;return new Promise(L=>{a.set(C,L),u({type:"act",id:C,name:E,args:N})})},navigate(E){let N=on(E);N&&u(N)},size(E){u({type:"size",height:E})},autoSize(E){let N=E??globalThis.document?.documentElement,C=globalThis.ResizeObserver;if(!N||!C||typeof N.getBoundingClientRect!="function")return()=>{};y?.disconnect();let L=new C(()=>O.size(Math.ceil(N.getBoundingClientRect().height)));return L.observe(N),y=L,()=>L.disconnect()},close(){y?.disconnect(),h(),n?.close(),s.clear()}};return{guest:O,send:u}}var Hr=["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"],Ur=["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"],Br=["self","postMessage","setTimeout","clearTimeout","setInterval","clearInterval","queueMicrotask","structuredClone","crypto","console","DOMException"],Vr=["TEMPORARY","PERSISTENT"],gl=Object.freeze([...Hr,...Ur,...Br,...Vr]),yl=Object.freeze(["constructor","__defineGetter__","__defineSetter__","hasOwnProperty","__lookupGetter__","__lookupSetter__","isPrototypeOf","propertyIsEnumerable","toString","valueOf","__proto__","toLocaleString"]),Gr=t=>typeof t=="symbol"?`[${t.description??"symbol"}]`:t;function zr(t=globalThis,e=[],n={}){let r=[],o=[],i=new Set([...Hr,...Ur,...Br,...e,"constructor",Symbol.toStringTag]),s=(x,k)=>{let F=Reflect.getOwnPropertyDescriptor(x,k);return F===void 0||!("value"in F)||F.writable||F.configurable?!1:n.primitivesStay&&typeof k=="symbol"&&(typeof F.value!="object"||F.value===null)&&typeof F.value!="function"?!0:Vr.includes(k)&&typeof F.value=="number"},a=t,c=a.setTimeout,u=a.setInterval,m=a.crypto,h=(x,k)=>function(F,We,...mt){if(typeof F!="function")throw new TypeError(`${k} takes a function: a guest view cannot run code from text`);return x.call(t,F,We,...mt)},g=m?Object.freeze({getRandomValues:x=>m.getRandomValues(x)}):void 0,y=a.document?.defaultView;if(y&&y!==a)for(let x of Reflect.ownKeys(y))typeof x=="symbol"||i.has(x)||Reflect.deleteProperty(y,x)||o.push(`window.${x}`);let O=[];for(let x=t;x&&x!==Object.prototype;x=Object.getPrototypeOf(x))O.push(x);for(let x of O)for(let k of Reflect.ownKeys(x))i.has(k)||(Reflect.deleteProperty(x,k)?r.push(Gr(k)):s(x,k)||o.push(Gr(k)));let E=()=>function(){throw new EvalError("A guest view cannot make code from text.")},N=[Function.prototype,Object.getPrototypeOf(async function(){}),Object.getPrototypeOf(function*(){}),Object.getPrototypeOf(async function*(){})];for(let x of N){let k=E();Object.defineProperty(k,"prototype",{value:x,writable:!1,enumerable:!1,configurable:!1}),Reflect.defineProperty(x,"constructor",{value:k,writable:!1,enumerable:!1,configurable:!1})||o.push("Function.prototype.constructor"),x===Function.prototype&&Reflect.defineProperty(t,"Function",{value:k,writable:!0,enumerable:!1,configurable:!0})}let C=(x,k)=>{Reflect.defineProperty(t,x,{value:k,writable:!0,enumerable:!0,configurable:!0})||o.push(x)};C("setTimeout",h(c,"setTimeout")),C("setInterval",h(u,"setInterval")),g&&C("crypto",g);for(let x of O.slice(1))Object.freeze(x);for(let x of Reflect.ownKeys(t)){let k=Reflect.getOwnPropertyDescriptor(t,x);Reflect.defineProperty(t,x,"value"in k?{...k,writable:!1,configurable:!1}:{...k,configurable:!1})}let L;try{L=Reflect.preventExtensions(t)}catch{L=!1}return{removed:r,stuck:o,sealed:L}}var dt=class extends HTMLElement{constructor(){super(),nn(this,Dn)}connect(e){if(je(this)===e||(Fe(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,Dn,qe(o),r])}e.mutate(n)}updateRemoteProperty(e,n){Bn(this,e,n)}callRemoteMethod(e,...n){return Vn(this,e,...n)}};var d={},sn={empty:!0},Uo={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"},zn={div:d,section:d,article:d,aside:d,header:d,footer:d,nav:d,hgroup:d,search:d,address:d,figure:d,figcaption:d,blockquote:d,p:d,pre:d,hr:sn,br:sn,wbr:sn,h1:d,h2:d,h3:d,h4:d,h5:d,h6:d,span:d,strong:d,em:d,b:d,i:d,u:d,s:d,small:d,mark:d,abbr:d,cite:d,q:d,code:d,kbd:d,samp:d,var:d,sub:d,sup:d,dfn:d,bdi:d,bdo:d,ruby:d,rt:d,rp:d,time:{attributes:{datetime:"text"}},data:{attributes:{value:"text"}},del:{attributes:{datetime:"text"}},ins:{attributes:{datetime:"text"}},a:{attributes:{href:"link"}},ul:d,menu:d,dl:d,dt:d,dd:d,ol:{attributes:{start:"number",reversed:"boolean",type:{oneOf:["1","a","A","i","I"]}}},li:{attributes:{value:"number"}},table:d,caption:d,thead:d,tbody:d,tfoot:d,tr:d,colgroup:{attributes:{span:"number"}},col:{attributes:{span:"number"},empty:!0},th:{attributes:{colspan:"number",rowspan:"number",headers:"text",scope:{oneOf:["row","col","rowgroup","colgroup"]},abbr:"text"}},td:{attributes:{colspan:"number",rowspan:"number",headers:"text"}},details:{attributes:{open:"boolean",name:"text"}},summary:d,button:{attributes:{type:{oneOf:["button"]},disabled:"boolean",name:"text",value:"text"}},input:{empty:!0,attributes:{type:{oneOf:["text","search","number","range","checkbox","radio","date","time","datetime-local","month","week","color","email","tel","url"]},name:"text",value:"text",placeholder:"text",min:"text",max:"text",step:"text",checked:"boolean",disabled:"boolean",readonly:"boolean",required:"boolean",maxlength:"number",minlength:"number",size:"number",pattern:"text",multiple:"boolean",inputmode:"text",enterkeyhint:"text"}},select:{attributes:{name:"text",disabled:"boolean",multiple:"boolean",required:"boolean",size:"number"}},option:{attributes:{value:"text",selected:"boolean",disabled:"boolean",label:"text"}},optgroup:{attributes:{label:"text",disabled:"boolean"}},textarea:{attributes:{name:"text",placeholder:"text",rows:"number",cols:"number",disabled:"boolean",readonly:"boolean",required:"boolean",maxlength:"number",minlength:"number",wrap:{oneOf:["soft","hard","off"]}}},label:{attributes:{for:"text"}},fieldset:{attributes:{disabled:"boolean",name:"text"}},legend:d,output:d,meter:{attributes:{value:"number",min:"number",max:"number",low:"number",high:"number",optimum:"number"}},progress:{attributes:{value:"number",max:"number"}},img:{empty:!0,attributes:{src:"image",alt:"text",width:"number",height:"number",decoding:{oneOf:["async","sync","auto"]}}},"graview-video":sn},Bo=["fill","fill-opacity","fill-rule","stroke","stroke-width","stroke-linecap","stroke-linejoin","stroke-dasharray","stroke-dashoffset","stroke-opacity","stroke-miterlimit","opacity","color","display","visibility","transform-origin","clip-path","clip-rule","marker-start","marker-mid","marker-end","font-family","font-size","font-weight","font-style","text-anchor","dominant-baseline","alignment-baseline","letter-spacing","text-decoration","paint-order","vector-effect","shape-rendering","pointer-events","stop-color","stop-opacity","overflow","mask","filter","flood-color","flood-opacity","lighting-color","color-interpolation-filters"],Vo={id:"text",class:"text",style:"style",lang:"text",role:"text",tabindex:{oneOf:["-1","0"]},transform:"geometry",...Object.fromEntries(Bo.map(t=>[t,"css"]))},ue={x:"geometry",y:"geometry",width:"geometry",height:"geometry"},an={viewBox:"geometry",preserveAspectRatio:"geometry"},jr={oneOf:["userSpaceOnUse","objectBoundingBox"]},Fr={oneOf:["R","G","B","A"]},ne={...ue,in:"text",result:"text"},qr={gradientUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},gradientTransform:"geometry",spreadMethod:{oneOf:["pad","reflect","repeat"]},href:"fragment"},Yr={svg:{attributes:{...ue,...an}},g:d,defs:d,symbol:{attributes:{...ue,...an,refX:"geometry",refY:"geometry"}},use:{attributes:{...ue,href:"fragment"}},title:d,desc:d,path:{attributes:{d:"geometry",pathLength:"number"}},rect:{attributes:{...ue,rx:"geometry",ry:"geometry",pathLength:"number"}},circle:{attributes:{cx:"geometry",cy:"geometry",r:"geometry",pathLength:"number"}},ellipse:{attributes:{cx:"geometry",cy:"geometry",rx:"geometry",ry:"geometry",pathLength:"number"}},line:{attributes:{x1:"geometry",y1:"geometry",x2:"geometry",y2:"geometry",pathLength:"number"}},polyline:{attributes:{points:"geometry",pathLength:"number"}},polygon:{attributes:{points:"geometry",pathLength:"number"}},text:{attributes:{x:"geometry",y:"geometry",dx:"geometry",dy:"geometry",rotate:"geometry",textLength:"geometry",lengthAdjust:{oneOf:["spacing","spacingAndGlyphs"]}}},tspan:{attributes:{x:"geometry",y:"geometry",dx:"geometry",dy:"geometry",rotate:"geometry",textLength:"geometry"}},textPath:{attributes:{href:"fragment",startOffset:"geometry",method:{oneOf:["align","stretch"]},spacing:{oneOf:["auto","exact"]},side:{oneOf:["left","right"]}}},linearGradient:{attributes:{x1:"geometry",y1:"geometry",x2:"geometry",y2:"geometry",...qr}},radialGradient:{attributes:{cx:"geometry",cy:"geometry",r:"geometry",fx:"geometry",fy:"geometry",fr:"geometry",...qr}},stop:{attributes:{offset:"geometry"}},clipPath:{attributes:{clipPathUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]}}},mask:{attributes:{...ue,maskUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},maskContentUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]}}},pattern:{attributes:{...ue,...an,patternUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},patternContentUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},patternTransform:"geometry",href:"fragment"}},marker:{attributes:{...an,markerWidth:"geometry",markerHeight:"geometry",refX:"geometry",refY:"geometry",orient:"geometry",markerUnits:{oneOf:["strokeWidth","userSpaceOnUse"]}}},a:d,filter:{attributes:{...ue,filterUnits:jr,primitiveUnits:jr}},feBlend:{attributes:{...ne,in2:"text",mode:"text"}},feColorMatrix:{attributes:{...ne,type:{oneOf:["matrix","saturate","hueRotate","luminanceToAlpha"]},values:"geometry"}},feComponentTransfer:{attributes:ne},...Object.fromEntries(["feFuncR","feFuncG","feFuncB","feFuncA"].map(t=>[t,{attributes:{type:{oneOf:["identity","table","discrete","linear","gamma"]},tableValues:"geometry",slope:"number",intercept:"number",amplitude:"number",exponent:"number",offset:"number"}}])),feComposite:{attributes:{...ne,in2:"text",operator:{oneOf:["over","in","out","atop","xor","lighter","arithmetic"]},k1:"number",k2:"number",k3:"number",k4:"number"}},feDisplacementMap:{attributes:{...ne,in2:"text",scale:"number",xChannelSelector:Fr,yChannelSelector:Fr}},feDropShadow:{attributes:{...ne,dx:"number",dy:"number",stdDeviation:"geometry"}},feFlood:{attributes:ne},feGaussianBlur:{attributes:{...ne,stdDeviation:"geometry",edgeMode:{oneOf:["duplicate","wrap","none"]}}},feMerge:{attributes:ne},feMergeNode:{attributes:{in:"text"}},feMorphology:{attributes:{...ne,operator:{oneOf:["erode","dilate"]},radius:"geometry"}},feOffset:{attributes:{...ne,dx:"number",dy:"number"}},feTurbulence:{attributes:{...ue,result:"text",type:{oneOf:["fractalNoise","turbulence"]},baseFrequency:"geometry",numOctaves:"number",seed:"number",stitchTiles:{oneOf:["stitch","noStitch"]}}}};var Wr={section:["aria-label","aria-labelledby","title"]};function zo(t){return/^aria-[a-z]+$/.test(t)}function jo(t){return/^data-[a-z0-9][a-z0-9_.-]*$/.test(t)}var Fo=new Map(Object.keys(Yr).map(t=>[t.toLowerCase(),t]));function Xr(t){return Fo.get(t.toLowerCase())}function $r(t,e,n){let r=n.toLowerCase(),o=t==="html"?[zn[e]?.attributes,Uo]:[Yr[e]?.attributes,Vo],i=t==="svg"&&r==="xlink:href"?"href":r;for(let s of o)if(s){for(let[a,c]of Object.entries(s))if(a.toLowerCase()===i)return{name:a,kind:c}}if(zo(r)||jo(r))return{name:r,kind:"text"}}var Kr="~",ln=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),ie=(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=>ie(n,e+1)):Object.fromEntries(Object.entries(t).map(([n,r])=>[n,ie(r,e+1)]))};function Zr(){let t=new Map,e=new Map,n=new Map([[Kr,{children:[],listeners:new Map}]]),r=0,o=u=>{let m=e.get(u);return m===void 0&&(m=r+=1,e.set(u,m),t.set(m,{listener:u,count:0})),t.get(m).count+=1,m},i=u=>{let m=t.get(u);m&&(m.count-=1,!(m.count>0)&&(t.delete(u),e.delete(m.listener)))},s=u=>{let m=n.get(u);if(m){n.delete(u);for(let h of m.listeners.values())i(h);for(let h of m.children)s(h)}},a=(u,m,h=0)=>{if(!ln(u)||h>64)return ie(u);let g=typeof u.id=="string"?u.id:void 0,y=m&&g!==void 0&&g!==Kr;y&&s(g);let O={children:[],listeners:new Map};y&&n.set(g,O);let E={};for(let[N,C]of Object.entries(u))N==="children"&&Array.isArray(C)?E[N]=C.map(L=>{let x=a(L,y,h+1);return y&&ln(L)&&typeof L.id=="string"&&O.children.push(L.id),x}):N==="eventListeners"&&ln(C)?E[N]=Object.fromEntries(Object.entries(C).map(([L,x])=>{if(typeof x!="function"||!y)return[L,void 0];let k=o(x);return O.listeners.set(L,k),[L,{listener:k}]})):E[N]=ie(C,h+1);return E},c=u=>{if(!Array.isArray(u))return ie(u);let[m,h]=u,g=typeof h=="string"?n.get(h):void 0;if(m===0){let y=a(u[2],g!==void 0),O=ln(u[2])?u[2].id:void 0;if(g&&typeof O=="string"&&n.has(O)){let E=Number(u[3]);g.children.splice(Number.isInteger(E)&&E>=0&&E<=g.children.length?E:g.children.length,0,O)}return[m,ie(h),y,ie(u[3])]}if(m===1){let y=Number(u[2]);return g&&Number.isInteger(y)&&y>=0&&y<g.children.length&&s(g.children.splice(y,1)[0]),ie(u)}if(m===3&&u[4]===3){let y=String(u[2]),O=u[3],E=g&&typeof O=="function"?o(O):void 0,N=g?.listeners.get(y);return N!==void 0&&i(N),E===void 0?g?.listeners.delete(y):g.listeners.set(y,E),[m,ie(h),y,E===void 0?void 0:{listener:E},3]}return ie(u)};return{encode:u=>u.map(c),listener:u=>t.get(u)?.listener,get listening(){return t.size},get nodes(){return n.size-1}}}var cn="graview-view-root",qo=["value","checked","key","pressed","files","refused","x","y","width","height","deltaX","deltaY","deltaMode","ctrlKey","metaKey","phase","pointerId","button","pressure","dx","dy","scale","rotation"],Yo=t=>t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/\'/g,"'"),Wo=t=>Object.freeze({html:t,toString:()=>t}),Qr=t=>typeof t=="object"&&t!==null&&typeof t.html=="string"&&Object.isFrozen(t),Jr=t=>t==null||t===!1?"":Array.isArray(t)?t.map(Jr).join(""):Qr(t)?t.html:Yo(String(t));function eo(t){customElements.get(cn)||customElements.define(cn,dt);let e=Event,n=Zr(),r=new Set,o=new Set,i,s=[],a=new Set;for(let l of["closest","matches","dataset"]){let f=()=>{throw new TypeError(`A view\'s element has no ${l}: graview.on hands event.element, the element its selector matched; read event.element.getAttribute("data-\\u2026").`)};l in Element.prototype||Object.defineProperty(Element.prototype,l,l==="dataset"?{get:f}:{value:f})}let c=document.createElement(cn),u=l=>{let f=b=>{for(let w of Array.from(b.childNodes)){if(w.nodeType!==1)continue;if($(w)===l)return w;let T=f(w);if(T)return T}};return f(c)},m=l=>{let f=u(l.target);if(!f)return;let b=new e(l.event,{bubbles:!0}),w={};for(let T of qo)l[T]!==void 0&&(w[T]=l[T]);for(let T of Object.keys(w))Object.defineProperty(b,T,{value:w[T],enumerable:!0});f.dispatchEvent(b);for(let T of o){if(T.type!==l.event)continue;let _;try{_=new Set(Array.from(c.querySelectorAll(T.selector)))}catch{continue}for(let z=f;z&&z!==c;z=z.parentNode)if(_.has(z)){T.listener(Object.freeze({type:l.event,target:f,element:z,...w}));break}}},h=l=>{if(l.type==="dom-event"&&typeof l.target=="string")return m(l);if(l.type==="notice")return t.warn(l.text);if(l.type!=="props")return;i=l.props;let f=t.now();for(let T of r)try{T(l.props)}catch(_){t.threw(_)}let b=t.now()-f,w=l.push;typeof w=="number"&&t.microtask(()=>t.microtask(()=>t.send({type:"pushed",push:w,ms:b})))},g;c.connect({mutate(l){g||(g=[],t.microtask(()=>{let f=g??[];g=void 0,t.send({type:"render",records:n.encode(f)})})),g.push(...l)},call:()=>{}});let y=l=>l.nodeType===1?l.getAttribute("data-key")??l.getAttribute("id"):null,O=(l,f)=>l.nodeType===f.nodeType&&(l.nodeType!==1||l.localName===f.localName&&l.namespaceURI===f.namespaceURI&&y(l)===y(f));function E(l,f){let b=Array.from(f.childNodes),w=0;for(let T of b){let _=l.childNodes[w]??null;if(_&&O(_,T)){N(_,T),w+=1;continue}if(y(T)!==null){let de=Array.from(l.childNodes).slice(w+1).find(Xe=>O(Xe,T));if(de){l.insertBefore(de,_),N(de,T),w+=1;continue}}l.insertBefore(T,_),w+=1}for(;l.childNodes.length>w;)l.removeChild(l.lastChild)}function N(l,f){if(l.nodeType!==1){l.data!==f.data&&(l.data=f.data);return}let b=l,w=f,T=C(b);for(let _ of b.getAttributeNames())w.hasAttribute(_)||(b.removeAttribute(_),T&&Ne(b,_,void 0));for(let _ of w.getAttributeNames()){let z=w.getAttribute(_);b.getAttribute(_)!==z&&b.setAttribute(_,z),T&&Ne(b,_,z)}E(b,w)}let C=l=>l.localName.includes("-");function L(l){for(let f of Array.from(l.childNodes)){if(f.nodeType!==1)continue;let b=f;if(C(b))for(let w of b.getAttributeNames())Ne(b,w,b.getAttribute(w)??void 0);L(b)}}function x(l,f,b){for(let w of Array.from(l.childNodes)){if(w.nodeType!==1)continue;let T=w,_=T.localName,z=f||_.toLowerCase()==="svg",de=z?Xr(_):Object.prototype.hasOwnProperty.call(zn,_.toLowerCase())?_.toLowerCase():void 0;if(!de){b.add(`<${_}>`);continue}for(let Xe of T.getAttributeNames())(!$r(z?"svg":"html",de,Xe)||!z&&Wr[de]?.includes(Xe.toLowerCase()))&&b.add(`${de} ${Xe}`);x(T,z,b)}}function k(l){let f=document.createElement("div"),b=Array.isArray(l)?l:[l];for(let T of b)if(T!=null)if(typeof T=="string"||Qr(T)){let _=document.createElement("div");_.innerHTML=typeof T=="string"?T:T.html,f.append(...Array.from(_.childNodes))}else f.append(T);let w=new Set;x(f,!1,w),s=[...w],s.length>0&&t.warn(`The host will not draw: ${s.join(", ")}`),L(f),E(c,f)}let F=[],We=new Set(Ir),mt="[]",un=!1,Yn=()=>{un||(un=!0,t.microtask(()=>{un=!1;let l=[...new Map([...o].filter(b=>We.has(b.type)).map(b=>[`${b.type} ${b.selector}`,{event:b.type,selector:b.selector}])).entries()].sort(([b],[w])=>b<w?-1:b>w?1:0).map(([,b])=>b),f=JSON.stringify(l);f!==mt&&(mt=f,t.send({type:"gestures",bound:l}))}))},Wn="[]",dn=!1,Xn=()=>{dn||(dn=!0,t.microtask(()=>{dn=!1;let l=[...new Set([...o].filter(b=>b.type==="click"&&typeof b.selector=="string").map(b=>b.selector))].sort().slice(0,200),f=JSON.stringify(l);f!==Wn&&(Wn=f,t.send({type:"clicks",selectors:l}))}))};return{view:Object.freeze({get props(){return i},onProps(l){return r.add(l),i&&l(i),()=>void r.delete(l)},render:k,style(l){typeof l!="string"||F.includes(l)||(F.push(l),t.send({type:"style",sheets:[...F]}))},on(l,f,b){let w={type:l,selector:f,listener:b};return o.add(w),typeof l=="string"&&!a.has(l)&&(a.add(l),t.send({type:"hears",events:[l]})),We.has(l)&&Yn(),l==="click"&&Xn(),()=>{o.delete(w),We.has(l)&&Yn(),l==="click"&&Xn()}},act:(l,f={})=>t.act(l,f),navigate(l){if(typeof l=="string")return t.navigate(l);let f=on(l);f&&t.send(f)},html(l,...f){return Wo(l.reduce((b,w,T)=>b+w+(T<f.length?Jr(f[T]):""),""))},get refused(){return s},get hardening(){return t.hardening()}}),hear:h,find:l=>{try{let f=c.querySelectorAll(l)[0];return f?$(f):void 0}catch{return}},listened:l=>{let f=new Set;for(let b of o)if(b.type===l)try{for(let w of Array.from(c.querySelectorAll(b.selector))){let T=$(w);T&&f.add(T)}}catch{}return[...f]}}}var qn={removed:[],stuck:[],sealed:!1,worker:!1},jn=Lr({listen(t){return _e.listen(t),()=>_e.unlisten(t)},fromHost:()=>!0,ready:t=>_e.post(t)},{onMessage:t=>to.hear(t)}),to=eo({send:t=>jn.send(t),act:(t,e)=>jn.guest.act(t,e),navigate:t=>jn.guest.navigate(t),microtask:_e.microtask,now:_e.now,threw:t=>console.error(t),warn:t=>console.warn(t),hardening:()=>qn}),Xo=to.view;Object.defineProperty(globalThis,"graview",{value:Xo,enumerable:!0,configurable:!0,writable:!1});var Fn="WorkerGlobalScope"in globalThis?zr(globalThis,["graview"]):qn;qn=Fn;if(Fn.stuck.length>0)throw new Error(`The view\'s worker could not be hardened: ${Fn.stuck.join(", ")} would not go.`);})();\n';export{e as VIEW_RUNTIME};
|
|
1
|
+
import"./chunk.AJZBJBMO.js";var e='"use strict";\n/*! @remote-dom/core and @remote-dom/polyfill \u2014 Copyright 2020-present, Shopify Inc. \u2014 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 \u2014 Elastic License 2.0. */\n"use strict";(()=>{var Ae=globalThis,no=Ae.addEventListener,ro=Ae.removeEventListener,oo=Ae.postMessage,io=globalThis.queueMicrotask,mn=globalThis.performance,so=mn?mn.now.bind(mn):Date.now,_e={listen:t=>no.call(Ae,"message",t),unlisten:t=>ro.call(Ae,"message",t),post:t=>oo.call(Ae,t),microtask:t=>io.call(globalThis,t),now:()=>so()};var v=Symbol("name"),me=Symbol("prefix"),fe=Symbol("value"),S=Symbol("ns"),q=Symbol("owner"),I=Symbol("owner_document"),re=Symbol("attributes"),M=Symbol("prev"),p=Symbol("next"),R=Symbol("child"),Y=Symbol("parent"),pe=Symbol("host"),K=Symbol("data"),Te=Symbol("listeners"),fn=Symbol("isTrusted"),ke=Symbol("path"),Pe=Symbol("stop_immediate_propagation"),Ce=Symbol("dispatching"),se=Symbol("content"),D=Symbol("hooks"),ft=Symbol("extensions"),we=Symbol("hooks_dispatch"),U=Symbol("is_connected"),Ie=Symbol("create_element"),$n=0,X=1,Me=2,De=3,Le=8,xe=9,Kn=10,he=11,A="http://www.w3.org/1999/xhtml",Z="http://www.w3.org/2000/svg",Zn="http://www.w3.org/XML/1998/namespace",$e="http://www.w3.org/2000/xmlns/";function pt(t){return t.split(/[\\t\\n\\f\\r ]+/).filter(Boolean)}function G(t){return t.replace(/[A-Z]/g,e=>String.fromCharCode(e.charCodeAt(0)+32))}function Qn(t){return t.replace(/[a-z]/g,e=>String.fromCharCode(e.charCodeAt(0)-32))}function P(t,e){let n=globalThis.DOMException;if(typeof n=="function")return new n(t,e);let r=new Error(t);return r.name=e,r}var Jn=/^(?:[A-Za-z][^\\0\\t\\n\\f\\r\\u0020/>]*|[:_\\u0080-\\u{10FFFF}][A-Za-z0-9-.:_\\u0080-\\u{10FFFF}]*)$/u,er=/[\\0\\t\\n\\f\\r />=]/u,ao=/[\\0\\t\\n\\f\\r />]/u;function ae(t){if(t==null)return null;let e=String(t);return e===""?null:e}function tr(t){Jn.test(t)||hn(t)}function pn(t){(t===""||er.test(t))&&hn(t)}function ht(t,e,n){let r=ae(t),o=String(e),i=o.indexOf(":"),s=i<0?null:o.slice(0,i),a=i<0?o:o.slice(i+1);if((s!=null&&(s===""||ao.test(s))||(n==="element"?!Jn.test(a):a===""||er.test(a)))&&hn(o),s!=null&&r==null)throw P(`A namespace is required for the prefix in "${o}"`,"NamespaceError");if(s==="xml"&&r!==Zn)throw P("The xml prefix requires the XML namespace","NamespaceError");if((o==="xmlns"||s==="xmlns")&&r!==$e)throw P("The xmlns name requires the XMLNS namespace","NamespaceError");if(r===$e&&o!=="xmlns"&&s!=="xmlns")throw P("The XMLNS namespace requires the xmlns name or prefix","NamespaceError");return{namespace:r,qualifiedName:o,prefix:s,localName:a}}function hn(t){throw P(`Invalid name: "${t}"`,"InvalidCharacterError")}var gt=0,yt=1,nr=2,gn=3,lo=typeof performance>"u"?Date.now:performance.now.bind(performance),B=class{static NONE=gt;static CAPTURING_PHASE=yt;static AT_TARGET=nr;static BUBBLING_PHASE=gn;timeStamp=lo();target=null;currentTarget=null;srcElement=null;bubbles=!1;cancelable=!1;composed=!1;defaultPrevented=!1;cancelBubble=!1;eventPhase=gt;[ke]=[];[Pe]=!1;[Ce]=!1;constructor(e,n){this.type=e,Object.defineProperty(this,fn,{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[fn]}composedPath(){return[...this[ke]]}stopPropagation(){this.cancelBubble=!0}stopImmediatePropagation(){this[Pe]=!0,this.cancelBubble=!0}preventDefault(){this.cancelable&&(this.defaultPrevented=!0)}set returnValue(e){e||this.preventDefault()}get returnValue(){return!this.defaultPrevented}initEvent(e,n,r){this.type=e,this.bubbles=!!n,this.cancelable=!!r}};function yn(t,e,n){if(t.cancelBubble)return;let o=e[Te]?.get(t.type)?.[n===yt?"capture":"bubble"];if(o)for(let i of[...o]){if(!o.has(i)||i.signal?.aborted)continue;t.eventPhase=t.target===e?nr:n,t.currentTarget=e;let s=i.normalizedListener;try{typeof s=="object"?s.handleEvent(t):s.call(e,t)}catch(a){setTimeout(co,0,a)}if(t[Pe])break}}function co(t){throw t}var Ke=[],bt=new WeakMap;function Et(t,e){let n=bt.get(t);n?n.push(e):bt.set(t,[e]),Ke[Ke.length-1].push(t)}function V(t){let e=[];Ke.push(e);let n;try{n=t()}catch(r){Ke.pop();try{rr(e)}catch{}throw r}return Ke.pop(),rr(e),n}function rr(t){let e,n=!1;for(let r of t){let o=bt.get(r);if(o){for(;o.length>0;){let i=o.shift();try{i()}catch(s){n||(e=s,n=!0)}}bt.delete(r)}}if(n)throw e}var Nt=[],Ze=[],bn=!1;function ve(t){for(let e of t)Nt.push(e),e[1]&&Ze.push(e[1]);if(!bn){bn=!0;try{let e,n=!1;for(let r=0;r<Nt.length;r++){let[o,i]=Nt[r];i&&Ze.splice(Ze.indexOf(i),1);try{o()}catch(s){n||(e=s,n=!0)}}if(n)throw e}finally{Nt.length=0,Ze.length=0,bn=!1}}}function Qe(t){let e=t;for(;e;){if(Ze.includes(e))return!0;e=e[Y]??e[pe]}return!1}var Je=Symbol("listenerRegistrations"),ge=class{[Te]=void 0;[Je]=void 0;[I]=void 0;addEventListener(e,n,r){if(n==null)return;let o=r===!0||typeof r=="object"&&r.capture===!0,i=typeof r=="object"&&r.once===!0,s=typeof r=="object"?r.signal:void 0;if(s?.aborted)return;let a=En(o),c=this[Je];c||(c=new Map,this[Je]=c);let u=c.get(e);u||(u={},c.set(e,u));let m=u[a];if(m||(m=new Map,u[a]=m),m.has(n))return;let h=this,g={type:e,listener:n,capture:o,once:i,normalizedListener:n,signal:s};(i||s)&&(g.normalizedListener=function(...C){if(g.signal?.aborted){Tt(h,g);return}return g.once&&Tt(h,g),typeof g.listener=="object"?g.listener.handleEvent(...C):g.listener.call(this,...C)});let y=this[Te];y||(y=new Map,this[Te]=y);let O=y.get(e);O||(O={},y.set(e,O));let E=O[a];if(E||(E=new Set,O[a]=E),m.set(n,g),E.add(g),s){let N=()=>{Tt(h,g)};g.abortListener=N,s.addEventListener("abort",N,{once:!0})}this[I]?.defaultView[we].addEventListener?.(this,e,n,r)}removeEventListener(e,n,r){return uo.call(this,e,n,r)}dispatchEvent(e){if(e[Ce])throw P("Failed to execute \'dispatchEvent\' on \'EventTarget\': The event is already being dispatched.","InvalidStateError");e[Ce]=!0;try{let n=[],r=this;for(;r!=null;)n.push(r),r=r.parentNode;e.target=this,e.srcElement=this,e[ke]=n;for(let i=n.length;i--;)if(yn(e,n[i],yt),e.cancelBubble)return!e.defaultPrevented;let o=e.bubbles?n:n.slice(0,1);for(let i=0;i<o.length;i++)if(yn(e,o[i],gn),e.cancelBubble)return!e.defaultPrevented;return!e.defaultPrevented}finally{e[Ce]=!1,e.cancelBubble=!1,e[Pe]=!1,e.eventPhase=gt,e.currentTarget=null,e[ke]=[]}}};function uo(t,e,n){if(e==null)return;let r=n===!0||n&&n.capture===!0,o=En(!!r),i=this[Je]?.get(t)?.[o]?.get(e);i&&Tt(this,i)}function En(t){return t?"capture":"bubble"}function Tt(t,e){let n=En(e.capture),r=t[Je],o=r?.get(e.type);if(!o)return;let i=o[n];if(!i||i.get(e.listener)!==e)return;i.delete(e.listener),i.size===0&&delete o[n],!o.bubble&&!o.capture&&r?.delete(e.type),e.signal&&e.abortListener&&e.signal.removeEventListener("abort",e.abortListener);let s=t[Te],a=s?.get(e.type);if(!a)return;let c=a[n];c?.delete(e)&&(c.size===0&&delete a[n],!a.bubble&&!a.capture&&s?.delete(e.type),t[I]?.defaultView[we].removeEventListener?.(t,e.type,e.listener,e.capture))}var Q=class extends Array{item(e){return this[e]??null}};var tt=0,or=1,wn=2,xn=3,nt=4,ir=0,sr=1,vt=2,St=3,ar=4,Tn=5,lr=6,cr=7,wt=/^(?:--|-?[A-Za-z_\\u0080-\\u{10FFFF}])[A-Za-z0-9_\\u0080-\\u{10FFFF}-]*$/u;function mo(t,e){let n=1,r=null;for(let o=e;o<t.length;o++){let i=t[o];if(r){i==="\\\\"?o++:i===r&&(r=null);continue}if(i===\'"\'||i==="\'")r=i;else if(i==="(")n++;else if(i===")"&&--n===0)return[t.slice(e,o),o+1]}return[t.slice(e),t.length]}function W(t){throw P(`Invalid or unsupported selector: "${t}"`,"SyntaxError")}function Ot(t,e){let n=typeof e=="string"?rt(e):[{combinator:nt,matchers:e}],r=null,o=t[R];return o&&n[0].matchers.length&&vn(o,n,i=>(r=i,!1)),r}function Rt(t,e){let n=typeof e=="string"?rt(e):[{combinator:nt,matchers:e}],r=new Q,o=t[R];return o&&n[0].matchers.length&&vn(o,n,i=>{r.push(i)}),r}function rt(t,e=!1,n=!1){let r={combinator:nt,matchers:[]},o=[r],i=/[\\t\\n\\f\\r ]*?([>\\t\\n\\f\\r +~]?)[\\t\\n\\f\\r ]*?(?:(?:\\[[\\t\\n\\f\\r ]*([^\\]=\\t\\n\\f\\r ]+)[\\t\\n\\f\\r ]*(?:=[\\t\\n\\f\\r ]*(?:([\'"])(.*?)\\3|([^\\]\\t\\n\\f\\r ]+)))?[\\t\\n\\f\\r ]*(?:\\]|$))|([#.]?)([^\\t\\n\\f\\r #.[>:+~()]+)|:(\\w+)(\\()?)/gi,s=t.replace(/^[\\t\\n\\f\\r ]+|[\\t\\n\\f\\r ]+$/g,"");s===""&&W(t);let a=0,c;for(;c=i.exec(s);){c.index!==a&&W(t),c[1]&&(r.matchers.length===0&&!(n&&o.length===1)&&W(t),c[1]===">"?r.combinator=or:c[1]==="+"?r.combinator=xn:c[1]==="~"?r.combinator=wn:r.combinator=tt,r={combinator:nt,matchers:[]},o.push(r));let u=c[8]?G(c[8]):c[2]||c[7];c[7]!=null&&!c[6]&&r.matchers.length>0&&W(t);let h,g=c[4]??c[5]??c[7];if(c[2]){wt.test(u)||W(t);let y=c[5],O=y?.[0];if(c[3]==null&&(O===\'"\'||O==="\'")){let E=c[0].lastIndexOf(y);g=s.slice(c.index+E+1),i.lastIndex=s.length}else y!=null&&!wt.test(y)&&W(t);h=ar}else c[6]?(wt.test(u)||W(t),h=c[6]==="#"?vt:St):c[8]?h=c[9]==null?Tn:lr:c[7]==="*"?h=ir:c[7]&&wt.test(c[7])?h=sr:W(t);c[9]?([g,i.lastIndex]=mo(s,i.lastIndex),u!=="has"&&u!=="not"&&W(t),u==="has"&&e&&W(t),rt(g,e||u==="has",u==="has")):h===Tn&&W(t),r.matchers.push({type:h,name:u,value:g}),a=i.lastIndex}return(a!==s.length||r.matchers.length===0)&&W(t),o}function fo(t,e){let n=rt(e);return n[0]?.matchers.length?et(t,n):!1}function po(t,e){let n=rt(e,!0,!0),r=n[0];if(n.length===1&&r.matchers.length===0)return!1;let o=tt,i={type:cr,name:":scope"};if(r.matchers.length===0?(o=r.combinator,r.matchers.push(i)):n.unshift({combinator:tt,matchers:[i]}),n.some(({matchers:c})=>c.length===0))return!1;let s=o===xn||o===wn?t[p]:t[R];if(!s)return!1;let a=!1;return vn(s,n,()=>(a=!0,!1),t),a}function vn(t,e,n,r){let o=[],i=t;for(;i;){if(F(i)){if(et(i,e,r)&&n(i)===!1)return!1;let s=i[R];if(s){let a=i[p];a&&o.push(a),i=s;continue}}i=i[p]??o.pop()??null}return!0}function et(t,e,n){let{combinator:r,matchers:o}=e[e.length-1];if(r===nt){if(!xt(t,o,n))return!1;let a=e.slice(0,-1);return a.length===0||et(t,a,n)}let i=r===or||r===tt?Y:M,s=t[i];if(!s)return!1;if(r===tt||r===wn){for(;s;){if(F(s)&&xt(s,o,n)){let a=e.slice(0,-1);if(a.length===0||et(s,a,n))return!0}s=s[i]}return!1}else{if(r===xn&&!F(s)){for(;s&&!F(s);)s=s[i];if(!s)return!1}if(!F(s)||!xt(s,o,n))return!1;let a=e.slice(0,-1);return a.length===0||et(s,a,n)}}function Nn(t,e){return t.getAttributeNS(null,t.namespaceURI===A?G(e):e)}function xt(t,e,n){if(!t)return!1;if(Array.isArray(e)){for(let s of e)if(xt(t,s,n)===!1)return!1;return!0}let{type:r,name:o,value:i}=e;switch(r){case ir:return o==="*";case sr:return t.namespaceURI===A?t.localName===G(o):t.localName===o;case vt:return Nn(t,"id")===o;case St:let s=Nn(t,"class");return s?pt(s).includes(o):!1;case ar:let a=Nn(t,o);return i==null?a!=null:a===i;case cr:return t===n;case Tn:W(`:${o}`);case lr:switch(o){case"has":return po(t,i||"");case"not":return!fo(t,i||"");default:W(`:${o}(${i})`)}}return!1}function ho(t){return t.nodeType===Me}function ot(t){return K in t}function On(t){return t.nodeType===De}function go(t){return t.nodeType===Le}function F(t){return t.nodeType===X}function Sn(t){return t.nodeType===he}function fr(t){return"appendChild"in t}function At(t){let e=[],n=[t],r=new Set(n),o=new Set,i;for(;n.length>0;){let s=n.pop();if(r.delete(s),o.has(s))continue;let a=[];for(let c of st(s)){if(o.has(c)||(o.add(c),e.push(c),a.push(c),!F(c)))continue;let u=c[re];if(u)for(let h of u)o.has(h)||(o.add(h),e.push(h));let m=c[se];m&&!o.has(m)&&!r.has(m)&&(r.add(m),n.push(m))}i??=a}return{nodes:e,treeNodes:i}}function it(t,e){for(let n of t)n[I]=e}function ur(t,e){let n=t.constructor,r=new n(t.name,t.value,t.namespaceURI);return r[I]=e,r}function dr(t,e){if(On(t))return e.createTextNode(t.data);if(go(t))return e.createComment(t.data);if(ho(t))return ur(t,e);if(F(t)){let n=e[Ie](t[v],t.namespaceURI,t[me],t.localName);if(t[re])for(let r=0;r<t[re].length;r++){let o=t[re].item(r);n.attributes.setNamedItem(ur(o,e))}return n}else{if(Sn(t))return e.createDocumentFragment();{let n=new t.constructor;return n[I]=e,n}}}function _t(t,e,n=t.ownerDocument){if(t.nodeType===xe)throw P("Cannot clone a document node","NotSupportedError");let r=dr(t,n);if(!e||!F(t)&&!Sn(t))return r;let o=new Set([t]),i=[{source:t,destination:r,childIndex:0,cloningContent:!1}];for(;i.length>0;){let s=i[i.length-1],a,c;if(s.cloningContent)if(s.contentSource&&s.contentDestination)a=s.contentSource.childNodes[s.childIndex++],c=s.contentDestination;else{i.pop(),s.appendTo&&s.appendTo.appendChild(s.destination);continue}else if(a=s.source.childNodes[s.childIndex++],c=s.destination,!a){if(s.cloningContent=!0,s.childIndex=0,F(s.source)&&s.source.namespaceURI===A&&s.source.localName==="template"){let m=s.source[se];m&&(o.has(m)&&mr(),o.add(m),s.contentSource=m,s.contentDestination=s.destination.content)}continue}if(!a){i.pop(),s.appendTo&&s.appendTo.appendChild(s.destination);continue}o.has(a)&&mr(),o.add(a);let u=dr(a,n);F(a)||Sn(a)?i.push({source:a,destination:u,appendTo:c,childIndex:0,cloningContent:!1}):c.appendChild(u)}return r}function mr(){throw new Error("Cannot clone a cyclic or repeated node graph")}function kt(t,e){let n=String(e);return n===""?null:Ot(t,[{type:vt,name:n}])}function Pt(t,e){let n=[...new Set(pt(String(e)))];return Rt(t,n.map(r=>({type:St,name:r})))}function Ct(t,e){let n=String(e),r=G(n),o=[];for(let i of It(t))F(i)&&(n==="*"||(i.namespaceURI===A?i[v]===r:i[v]===n))&&o.push(i);return o}function It(t){let e=[],n=[],r=t[R];for(;r;){e.push(r);let o=r[R],i=r[p];o?(i&&n.push(i),r=o):r=i??n.pop()??null}return e}function st(t){let e=It(t);return e.unshift(t),e}var J=class extends ge{nodeType=$n;[v]="";[Y]=null;[pe]=null;[R]=null;[M]=null;[p]=null;[U]=!1;get[D](){return this[I].defaultView[we]}get localName(){return this[v]}get nodeName(){return this[v]}get ownerDocument(){return this[I]}get isConnected(){return this[U]}isDefaultNamespace(e){let n=ae(e);return yo(this)===n}get parentNode(){return this[Y]}set parentNode(e){}get parentElement(){let e=this[Y];return!e||e.nodeType!==1?null:e}set parentElement(e){}get previousSibling(){return this[M]}set previousSibling(e){}get nextSibling(){return this[p]}set nextSibling(e){}get previousElementSibling(){let e=this[M];for(;e&&e.nodeType!==1;)e=e[M];return e}set previousElementSibling(e){}get nextElementSibling(){let e=this[p];for(;e&&e.nodeType!==1;)e=e[p];return e}set nextElementSibling(e){}get firstChild(){return this[R]}set firstChild(e){}get lastChild(){let e=this[R];for(;e;){let n=e[p];if(n==null)break;e=n}return e}set lastChild(e){}get nodeValue(){return ot(this)?this.data:null}set nodeValue(e){ot(this)&&(this.data=e)}get textContent(){if(ot(this))return this.data;let e="";for(let n of It(this))On(n)&&(e+=n.data);return e}set textContent(e){if(ot(this))this.data=e;else if(fr(this)){let n=e==null?"":String(e);n===""?this.replaceChildren():this.replaceChildren(n)}}cloneNode(e){return _t(this,e)}contains(e){let n=e;for(;n!=null;){if(n===this)return!0;n=n.parentNode}return!1}};function yo(t){let e=t;for(;e;)switch(e.nodeType){case X:{let n=e;if(n.prefix==null&&n.namespaceURI!=null)return n.namespaceURI;let r=n.attributes.getNamedItemNS($e,"xmlns");if(r!=null&&r.prefix==null)return ae(r.value);e=n.parentElement;break}case xe:e=e.documentElement;break;case Kn:case he:return null;case Me:e=e.ownerElement;break;default:e=e.parentElement}return null}var ee=Symbol("insertNode"),_n=Symbol("preflightInsertions"),Mt=Symbol("replaceNode"),ye=class extends J{remove(){let e=this.parentNode;e&&e.removeChild(this)}replaceWith(...e){let n=Se(e),r=this.parentNode;if(r)return Rn(o=>{le(r,n);let i=this[p];for(;i&&n.includes(i);)i=i[p];let s=An(r,n,o);this.parentNode===r?r[Mt](s,this,o):r[ee](s,i,o)})}before(...e){let n=Se(e),r=this.parentNode;if(r)return Rn(o=>{le(r,n);let i=this[M];for(;i&&n.includes(i);)i=i[M];let s=An(r,n,o);r[ee](s,i?i[p]:r.firstChild,o)})}after(...e){let n=Se(e),r=this.parentNode;if(r)return Rn(o=>{le(r,n);let i=this[p];for(;i&&n.includes(i);)i=i[p];let s=An(r,n,o);r[ee](s,i,o)})}};function Rn(t){return V(()=>{let e=[];try{t(e)}catch(n){try{ve(e)}catch{}throw n}ve(e)})}function Se(t){return t.map(e=>e instanceof J?e:String(e))}function at(t,e){return e instanceof J?e:t.ownerDocument.createTextNode(String(e))}function le(t,e){for(let n of e){if(!(n instanceof J))continue;let r=t;for(;r;){if(r===n)throw P("Cannot insert a node into itself or one of its descendants","HierarchyRequestError");r=r[Y]??r[pe]}}}function An(t,e,n){let r=[];for(let i of e)r.push(at(t,i));if(r.length===1)return r[0];let o=t.ownerDocument.createDocumentFragment();o[_n](r);for(let i of r)o[ee](i,null,n);return o}var Dt,kn=0,pr=0,hr=0,gr=0,Ge=!1,Cn=!1,lt=!1,Lt=class{#t;#n=[];#e=new Set;#r=!1;constructor(e){if(typeof e!="function")throw new TypeError("MutationObserver callback must be a function");this.#t=e}observe(e,n={}){let r=bo(n),o=Dt??=new WeakMap,i=o.get(e);i==null&&(i=new Map,o.set(e,i));let s=i.get(this);s==null?kn++:Pn(s,-1),i.set(this,r),Pn(r,1),this.#e.add(e)}disconnect(){let e=Dt;if(e!=null){for(let n of this.#e){let r=e.get(n),o=r?.get(this);o!=null&&(r.delete(this),kn--,Pn(o,-1)),r?.size===0&&e.delete(n)}this.#e.clear(),this.#n.length=0,kn===0&&(Dt=void 0)}}takeRecords(){return this.#n.splice(0)}enqueue(e){this.#n.push(e),!this.#r&&(this.#r=!0,queueMicrotask(()=>{this.#r=!1;let n=this.takeRecords();n.length>0&&this.#t.call(this,n,this)}))}};function te(t){let e=Dt;if(e==null)return;let n=new Map,r=t.target;for(;r;){let o=e.get(r);if(o)for(let[i,s]of o){if(r!==t.target&&!s.subtree)continue;let a=!1;if(t.type==="attributes"){if(!s.attributes||s.attributeFilter&&!s.attributeFilter.has(t.attributeName??""))continue;a=s.attributeOldValue}else if(t.type==="characterData"){if(!s.characterData)continue;a=s.characterDataOldValue}else if(!s.childList)continue;n.set(i,n.get(i)===!0||a)}r=r.parentNode}for(let[o,i]of n)o.enqueue({addedNodes:t.addedNodes??new Q,attributeName:t.attributeName??null,attributeNamespace:t.attributeNamespace??null,nextSibling:t.nextSibling??null,oldValue:i?t.oldValue??null:null,previousSibling:t.previousSibling??null,removedNodes:t.removedNodes??new Q,target:t.target,type:t.type})}function Gt(...t){let e=new Q;return e.push(...t),e}function bo(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 Pn(t,e){t.attributes&&(pr+=e),t.characterData&&(hr+=e),t.childList&&(gr+=e),Ge=pr>0,Cn=hr>0,lt=gr>0}var oe=class extends ye{childNodes=new Q;children=new Q;appendChild(e){return V(()=>this[ee](e,null))}insertBefore(e,n){return V(()=>this[ee](e,n||null))}append(...e){return V(()=>{let n=Se(e.filter(r=>r!=null));n.length>1&&le(this,n);for(let r of n)this[ee](at(this,r),null)})}prepend(...e){return V(()=>{let n=Se(e.filter(o=>o!=null));n.length>1&&le(this,n);let r=this.firstChild;for(let o of n)this[ee](at(this,o),r)})}replaceChildren(...e){return V(()=>{let n=Se(e.filter(o=>o!=null));le(this,n);let r;for(;r=this.firstChild;)this.removeChildImmediately(r);for(let o of n)this[ee](at(this,o),null)})}removeChild(e){return V(()=>(this.removeChildImmediately(e),e))}removeChildImmediately(e){if(e.parentNode!==this)throw P("The node is not a child of this node","NotFoundError");let n=this[U]?st(e):void 0,r=e[M],o=e[p],i=Ht(this,e);if(n)for(let s of n)s[U]=!1;this.queueRemovalMutationRecord(this,e,r,o),n&&this.enqueueTreeReactions(n,"disconnectedCallback"),ve(this.collectRemovalHookEffects(e,i))}replaceChild(e,n){return V(()=>this[Mt](e,n))}[Mt](e,n,r){if(le(this,[e]),n.parentNode!==this)throw P("The reference node is not a child of this parent","NotFoundError");let o=n[M],i=n[p],s=this.prepareInsertion(e),a=this[U]?st(n):void 0,c=new Set(s.map(({node:g})=>g)),u=i;for(;u&&c.has(u);)u=u[p];let m=Ht(this,n);if(a){for(let y of a)y[U]=!1;let g=new Set(a);for(let y of s)g.has(y.node)&&(y.shouldDisconnect=!1)}this.commitInsertion(s,u);let h=this[U];return this.queueRemovalMutationRecord(this,n,o,i),this.queueInsertionMutationRecords(s),a&&this.enqueueTreeReactions(a,"disconnectedCallback"),this.enqueueInsertionReactions(s,h),this.performOrCollectHookEffects([...this.collectRemovalHookEffects(n,m),...this.collectInsertionHookEffects(s)],r),n}querySelectorAll(e){return Rt(this,e)}querySelector(e){return Ot(this,e)}[ee](e,n,r){return this.validateInsertion(e,n),this.insertIntoValidated(e,n,r),e}[_n](e){for(let n of e)this.validateInsertion(n,null),this.prepareInsertion(n)}validateInsertion(e,n){if(le(this,[e]),n&&n.parentNode!==this)throw P("The reference node is not a child of this parent","NotFoundError")}insertIntoValidated(e,n,r){e===n&&(n=e[p]);let o=this.prepareInsertion(e);this.commitInsertion(o,n);let i=this[U];this.queueInsertionMutationRecords(o),this.enqueueInsertionReactions(o,i),this.performOrCollectHookEffects(this.collectInsertionHookEffects(o),r)}performOrCollectHookEffects(e,n){n?n.push(...e):ve(e)}prepareInsertion(e){let n=[];if(e.nodeType===he){let s=e[R];for(;s;)n.push(s),s=s[p]}else n.push(e);let r=this[U],o=this[I],i=[];for(let s of n){let a=s[U],c=a||r,u,m;if(s[I]===o)c&&(u=st(s));else{let h=At(s);m=h.nodes,c&&(u=h.treeNodes)}i.push({node:s,nodes:u,adoption:m,shouldDisconnect:a})}return i}commitInsertion(e,n){for(let i of e){let s=i.node[Y];if(s){let a=i.node[M],c=i.node[p];i.source={parent:s,index:Ht(s,i.node),previousSibling:a,nextSibling:c}}}for(let i of e){let s=this.attachChild(i.node,n);i.insertIndex=s.index,i.previousSibling=s.previousSibling,i.nextSibling=s.nextSibling}let r=this[I];for(let{adoption:i}of e)i&&it(i,r);let o=this[U];for(let{nodes:i}of e)if(i)for(let s of i)s[U]=o}attachChild(e,n){if(n){let i=n[M];e[p]=n,e[M]=i,i?i[p]=e:this[R]=e,n[M]=e}else{e[p]=null;let i=this[R];if(i){let s;for(;s=i[p];)i=s;i[p]=e,e[M]=i}else this[R]=e,e[M]=null}let r=F(e);e[Y]=this;let o;if(n){if(o=this.childNodes.indexOf(n),this.childNodes.splice(o,0,e),r){let i=n;for(;i&&!F(i);)i=i[p];i?this.children.splice(this.children.indexOf(i),0,e):this.children.push(e)}}else o=this.childNodes.length,this.childNodes.push(e),r&&this.children.push(e);return{index:o,previousSibling:e[M],nextSibling:e[p]}}queueRemovalMutationRecord(e,n,r,o){lt&&te({type:"childList",target:e,removedNodes:Gt(n),previousSibling:r,nextSibling:o})}queueInsertionMutationRecords(e){if(lt)for(let n of e){let{node:r,source:o}=n;o&&this.queueRemovalMutationRecord(o.parent,r,o.previousSibling,o.nextSibling),te({type:"childList",target:this,addedNodes:Gt(r),previousSibling:n.previousSibling,nextSibling:n.nextSibling})}}collectRemovalHookEffects(e,n){return this.nodeType!==X||Qe(this)?[]:[[()=>this[D].removeChild?.(this,e,n)]]}collectInsertionHookEffects(e){let n=[];for(let r of e){let{node:o,source:i}=r;i?.parent.nodeType===X&&!Qe(i.parent)&&n.push([()=>i.parent[D].removeChild?.(i.parent,o,i.index)]),this.nodeType===X&&!Qe(this)&&n.push([()=>this[D].insertChild?.(this,o,r.insertIndex),o])}return n}enqueueInsertionReactions(e,n){for(let r of e){let{nodes:o}=r;o&&(r.shouldDisconnect&&this.enqueueTreeReactions(o,"disconnectedCallback"),n&&this.enqueueTreeReactions(o,"connectedCallback"))}}enqueueTreeReactions(e,n){br(e,n)}};function yr(t,e,n,r){if(e.parentNode!==t)throw Error("not a child of this node");let o=t[U]?n.treeNodes:void 0,i=e[M],s=e[p],a=Ht(t,e);if(o)for(let u of o)u[U]=!1;it(n.nodes,r),lt&&te({type:"childList",target:t,removedNodes:Gt(e),previousSibling:i,nextSibling:s}),o&&br(o,"disconnectedCallback");let c=[];t.nodeType===X&&!Qe(t)&&c.push([()=>t[D].removeChild?.(t,e,a)]),ve(c)}function Ht(t,e){let n=e[M],r=e[p];n?n[p]=r:t[R]=r,r&&(r[M]=n);let o=t.childNodes.indexOf(e);return t.childNodes.splice(o,1),F(e)&&t.children.splice(t.children.indexOf(e),1),e[Y]=null,e[p]=null,e[M]=null,o}function br(t,e){for(let n of t){let r=n[e];typeof r=="function"&&Et(n,()=>r.call(n))}}function ct(t,e,n,r,o){let{observedAttributes:i}=t.constructor,{attributeChangedCallback:s}=t;s==null||i==null||!i.includes(e)||Et(t,()=>s.call(t,e,n,r,o))}var Ut=class{[R]=null;constructor(e){this[q]=e}getNamedItem(e){let n=String(e),r=this[q][S]===A?G(n):n,o=this[R];for(;o;){if(o.name===r)return o;o=o[p]}return null}getNamedItemNS(e,n){let r=ae(e),o=String(n),i=this[R];for(;i;){if(i.localName===o&&i[S]===r)return i;i=i[p]}return null}item(e){let n=this[R],r=0;for(;n;){if(r++===e)return n;n=n[p]}return null}get length(){let e=0,n=this[R];for(;n;)e++,n=n[p];return e}removeNamedItem(e){let n=String(e),r=this[q][S]===A?G(n):n;return V(()=>this.removeNamedItemImmediately(o=>o.name===r))}removeNamedItemNS(e,n){let r=ae(e),o=String(n);return V(()=>this.removeNamedItemImmediately(i=>i.localName===o&&i[S]===r))}removeNamedItemImmediately(e){let n=this[q],r=this[R],o=null;for(;r!=null;){if(e(r)){o&&(o[p]=r[p]),this[R]===r&&(this[R]=r[p]);let i=r.value;return r[p]=null,r[q]=null,Ge&&te({type:"attributes",target:n,attributeName:r.name,attributeNamespace:r[S],oldValue:i}),n[D].removeAttribute?.(n,r.name,r[S]),ct(n,r.localName,i,null,r[S]),r}o=r,r=r[p]}return null}setNamedItem(e){return V(()=>this.setNamedItemImmediately(e))}setNamedItemImmediately(e){let n=this[q],r=e[q];if(r!=null&&r!==n)throw P("The attribute is already in use by another element.","InUseAttributeError");let o=null,i=this[R],s=null;for(;i;){if(i.localName===e.localName&&i[S]===e[S]){if(i===e)return i;s?s[p]=e:this[R]=e,e[p]=i[p],i[p]=null,o=i;break}s=i,i=i[p]}o==null&&(s?s[p]=e:this[R]=e),e[q]=n,e[I]=n[I],o&&(o[q]=null);let a=o==null||o.value!==e.value,c=o!=null&&o.name!==e.name;return a&&Ge&&te({type:"attributes",target:n,attributeName:e.name,attributeNamespace:e[S],oldValue:o?.value??null}),c&&n[D].removeAttribute?.(n,o.name,o[S]),(a||c)&&n[D].setAttribute?.(n,e.name,e.value,e[S]),a&&ct(n,e.localName,o?.value??null,e.value,e[S]),o}setNamedItemNS(e){return this.setNamedItem(e)}*[Symbol.iterator](){let e=this[R];for(;e;)yield e,e=e[p]}};var Oe=class extends J{nodeType=Me;[S]=null;[p]=null;[q]=null;constructor(e,n,r){super(),this[v]=e,this[fe]=n,r&&(this[S]=r)}get nodeName(){return this[v]}set nodeName(e){}get name(){return this[v]}set name(e){}get localName(){if(this[S]==null)return this[v];let e=this[v].indexOf(":");return e<0?this[v]:this[v].slice(e+1)}get prefix(){if(this[S]==null)return null;let e=this[v].indexOf(":");return e<0?null:this[v].slice(0,e)}get value(){return this[fe]}set value(e){let n=String(e),r=this[q];if(!r){this[fe]=n;return}V(()=>{let o=this[fe];this[fe]=n,Ge&&o!==n&&te({type:"attributes",target:r,attributeName:this[v],attributeNamespace:this[S],oldValue:o}),this[D].setAttribute?.(r,this[v],n,this[S]),ct(r,this.localName,o,n,this[S])})}get nodeValue(){return this.value}set nodeValue(e){this.value=e}get ownerElement(){return this[q]}get namespaceURI(){return this[S]}get specified(){return!0}};var Eo={amp:"&",AMP:"&",apos:"\'",gt:">",GT:">",lt:"<",LT:"<",quot:\'"\',QUOT:\'"\'},No=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),To=/(?:<([a-z][a-z0-9-:]*)((?:[\\s]+[^<>\'"=/\\s]+(?:=([\'"])[^]*?\\3|=[^>\'"\\s]*|))*)[\\s]*(\\/?)\\s*>|<\\/([a-z][a-z0-9-:]*)>|<!--(.*?)-->|([^<>]+))/gi,Tr=/\\s([^<>\'"=/\\n\\s]+)(?:=(["\'])([\\s\\S]*?)\\2|=([^>\'"\\n\\s]*)|)/g,wo="|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|",xo=/^(?:color|face|size)$/i;function Er(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 Eo[n];let i=Number.parseInt(r??o,r?10:16);try{return String.fromCodePoint(i)}catch{return e}})}function wr(t){return t.namespaceURI===A&&No.has(t.localName)}function Nr(t){let e=t.localName;return t[S]===Z&&(e==="foreignObject"||e==="desc"||e==="title")}function vo(t,e){if(wo.includes(`|${t}|`))return!0;if(t!=="font")return!1;for(let n of e.matchAll(Tr))if(xo.test(n[1]))return!0;return!1}function Bt(t,e){let n=e.ownerDocument,r=n.createDocumentFragment(),o=[],i=r;for(let s of t.matchAll(To)){let a=s[1];if(a){let c=s[2],u=G(a),m=o[o.length-1]?.element??e,h=m[S]===Z?Z:A;if(u==="svg")h=Z;else if(h===Z){if(Nr(m))h=A;else if(vo(u,c)){for(;o.length>0;){let O=o[o.length-1];if(O.element[S]!==Z||Nr(O.element))break;o.pop(),i=O.target}h=A}}let g=h===A?u:a,y=n[Ie](g,h,null,g);for(let O of c.matchAll(Tr))y.setAttribute(O[1],Er(O[3]||O[4]||""));if(i.append(y),wr(y)||h!==A&&s[4])continue;o.push({element:y,target:i}),i=h===A&&u==="template"?y.content:y}else if(s[5]){let c=G(s[5]);for(let u=o.length-1;u>=0;u--){let m=o[u],h=G(m.element[v]);if(h===c){i=m.target,o.length=u;break}if(m.element[S]===A&&h==="template")break}}else s[6]?i.append(n.createComment(s[6])):i.append(Er(s[7]))}return r}function Vt(t){return vr([{type:"content",child:t[R]}])}function xr(t){return vr([{type:"opening",node:t}])}function vr(t){let e=[],n;for(;n=t.pop();)switch(n.type){case"opening":{let r=n.node;switch(r.nodeType){case X:{let o=r;e.push(`<${o[v]}`);let i=o[re]?.[R];for(;i;){e.push(` ${i[v]}`);let a=i[fe];a!==""&&(a=String(a).replace(/&/g,"&").replace(/"/g,"""),e.push(`="${a}"`)),i=i[p]}if(e.push(">"),wr(o))break;let s=o.namespaceURI===A&&o.localName==="template"?o[se]:o;t.push({type:"closing",name:o[v]}),t.push({type:"content",child:s?.[R]??null});break}case De:{let o=r;e.push(o[K].replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">"));break}case Le:{let o=r;e.push(`<!--${o[K]}-->`);break}}break}case"content":{let r=n.child;r&&(t.push({type:"content",child:r[p]}),t.push({type:"opening",node:r}));break}case"closing":e.push(`</${n.name}>`);break}return e.join("")}var H=class extends oe{nodeType=X;[S]=A;[me]=null;get namespaceURI(){return this[S]}get prefix(){return this[me]}get localName(){let e=this[me];return e==null?this[v]:this[v].slice(e.length+1)}get nodeName(){return this[S]===A?Qn(this[v]):this[v]}get tagName(){return this.nodeName}get id(){return this.getAttributeNS(null,"id")??""}set id(e){this.setAttribute("id",String(e))}get slot(){return this.getAttributeNS(null,"slot")??""}set slot(e){let n=String(e);this.getAttributeNS(null,"slot")!==n&&this.attributes.setNamedItem(new Oe("slot",n))}get attributes(){let e=this[re];return e||(e=new Ut(this),this[re]=e),e}getAttributeNames(){return[...this.attributes].map(e=>e.name)}getElementsByTagName(e){return Ct(this,e)}get firstElementChild(){return this.children[0]??null}getElementsByClassName(e){return Pt(this,e)}get lastElementChild(){return this.children[this.children.length-1]??null}get nextElementSibling(){let e=this.nextSibling;for(;e&&e.nodeType!==1;)e=e.nextSibling;return e}get previousElementSibling(){let e=this.previousSibling;for(;e&&e.nodeType!==1;)e=e.previousSibling;return e}setAttribute(e,n){let r=String(e),o=String(n);pn(r);let i=this[S]===A?G(r):r,s=this.attributes.getNamedItemNS(null,i);s?s.value=o:this.attributes.setNamedItem(new Oe(i,o))}setAttributeNS(e,n,r){let o=ae(e),i=String(n),s=String(r),a=ht(o,i,"attribute"),c=this.attributes.getNamedItemNS(a.namespace,a.localName);c?c.value=s:this.attributes.setNamedItemNS(new Oe(a.qualifiedName,s,a.namespace))}toggleAttribute(e,n){let r=String(e);pn(r);let o=this[S]===A?G(r):r,i=this.attributes.getNamedItemNS(null,o),s=n===void 0?void 0:!!n;return i==null?s===!1?!1:(this.attributes.setNamedItem(new Oe(o,"")),!0):s===!0?!0:(this.attributes.removeNamedItemNS(null,o),!1)}getAttribute(e){let n=this.attributes.getNamedItem(e);return n&&n.value}getAttributeNS(e,n){let r=this.attributes.getNamedItemNS(e,n);return r&&r.value}hasAttribute(e){return this.attributes.getNamedItem(e)!=null}hasAttributeNS(e,n){return this.attributes.getNamedItemNS(e,n)!=null}removeAttribute(e){let n=String(e),r=this[S]===A?G(n):n;this.attributes.removeNamedItemNS(null,r)}removeAttributeNS(e,n){this.attributes.removeNamedItemNS(e,n)}get outerHTML(){return xr(this)}get innerHTML(){return Vt(this)}set innerHTML(e){if(e==null||e==="")this.replaceChildren();else{let n=Bt(String(e),this);this.replaceChildren(n)}}};var He=class t extends H{[S]=Z;get ownerSVGElement(){let e=null,n=this.parentNode;for(;n instanceof t;)e=n,n=n.parentNode;return e}};var be=class extends ye{[K]="";constructor(e){super(),this[K]=e==null?"":String(e)}setData(e){let n=Cn,r=n?this[K]:null,o="";e!=null&&(o=typeof e=="string"?e:String(e)),this[K]=o,n&&r!==o&&te({type:"characterData",target:this,oldValue:r}),this[D].setText?.(this,o)}get data(){return this[K]}set data(e){this.setData(e)}};var Ue=class extends be{nodeType=De;[v]="#text"};var Be=class extends be{nodeType=Le;[v]="#comment"};var Ve=class extends oe{nodeType=he;[v]="#document-fragment";[I]=typeof window<"u"?window.document:null;getElementById(e){return kt(this,e)}};var ze=class extends H{get content(){let e=this[se];return e||(e=this.ownerDocument.createDocumentFragment(),e[pe]=this,this[se]=e),e}set content(e){}set innerHTML(e){this.content.replaceChildren(Bt(String(e),this))}get innerHTML(){let e=this[se];return e?Vt(e):""}};var zt=class extends H{};var Ft=class extends H{};var jt=class extends H{};var ut=class extends oe{nodeType=xe;[v]="#document";[U]=!0;constructor(e){super(),this.defaultView=e,this[I]=this,this.documentElement=Yt(new jt,this,"html"),this.body=Yt(new zt,this,"body"),this.head=Yt(new Ft,this,"head"),this.appendChild(this.documentElement),this.documentElement.appendChild(this.head),this.documentElement.appendChild(this.body)}get textContent(){return null}set textContent(e){}getElementsByClassName(e){return Pt(this,e)}createElement(e){let n=String(e);return tr(n),In(this,G(n))}createElementNS(e,n){let r=ht(e,n,"element");return In(this,r.qualifiedName,r.namespace,r.prefix,r.localName)}[Ie](e,n,r,o){return In(this,e,n,r,o)}createTextNode(e){let n=qt(new Ue(e),this);return this[D].createText?.(n,n.data),n}createComment(e){return qt(new Be(e),this)}createDocumentFragment(){return qt(new Ve,this)}createEvent(){return new B("")}getElementById(e){return kt(this,e)}getElementsByTagName(e){return Ct(this,e)}importNode(e,n){if(e.nodeType===xe)throw P("Cannot import a document node","NotSupportedError");return _t(e,n,this)}adoptNode(e){if(e[I]===this)return e;let n=At(e);return V(()=>{let r=e.parentNode;return r?yr(r,e,n,this):it(n.nodes,this),e})}};function qt(t,e){return Object.defineProperty(t,I,{value:e,writable:!0,enumerable:!1}),t}function In(t,e,n=A,r=null,o=e){let i;if(n===Z)i=new He;else if(n===A&&o==="template")i=new ze;else if(n===A){let s=t.defaultView.customElements.get(o);i=s?new s:new H}else i=new H;return Yt(i,t,e,n,r)}function Yt(t,e,n,r=A,o=null){return qt(t,e),Object.defineProperties(t,{[v]:{value:n},[S]:{value:r},[me]:{value:o}}),e[D].createElement?.(t,r),t}var Wt=class extends B{constructor(e,n){super(e,n),this.detail=n?.detail??null}initCustomEvent(e,n,r,o){super.initEvent(e,n,r),this.detail=o??null}};var Xt=class extends B{constructor(e,n){super(e,n),this.message=n.message,this.filename=n.filename,this.lineno=n.lineno,this.colno=n.colno,this.error=n.error}};var $t=class extends B{constructor(e,n){super(e,n),this.promise=n.promise,this.reason=n.reason}};var Kt=class extends B{constructor(e,n){super(e,n),this.oldState=n.oldState,this.newState=n.newState}};var Zt=class extends B{constructor(e,n={}){super(e,n),this.relatedTarget=n.relatedTarget??null}};var Qt=class extends B{constructor(e,n={}){super(e,n),this.clipboardData=n.clipboardData??null}};var Jt=class extends H{};var So=/^[a-z][^A-Z\\u0000\\t\\n\\f\\r />]*-[^A-Z\\u0000\\t\\n\\f\\r />]*$/u,Oo=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]);function Sr(t){return So.test(t)&&!Oo.has(t)}function Or(t){return P(`Invalid custom element name: "${t}"`,"SyntaxError")}var en=class{registry=new Map;listenersByName=new Map;define(e,n,r){if(!Sr(e))throw Or(e);if(this.registry.has(e))throw P(`A custom element named "${e}" has already been defined`,"NotSupportedError");if(this.getName(n)!=null)throw P("This constructor has already been registered in this custom element registry","NotSupportedError");this.registry.set(e,n);let o=this.listenersByName.get(e);if(o!=null){this.listenersByName.delete(e);for(let i of o)i(n)}}get(e){return this.registry.get(e)}getName(e){for(let[n,r]of this.registry)if(r===e)return n;return null}whenDefined(e){if(!Sr(e))return Promise.reject(Or(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 Ro=["onerror","onunhandledrejection"],Ar=Symbol.for("@remote-dom/polyfill/global-property");function _r(t){return Object.getOwnPropertyDescriptors(t)}function kr(t){let e={};for(let[n,r]of Object.entries(Object.getOwnPropertyDescriptors(ge.prototype)))n!=="constructor"&&typeof r.value=="function"&&(r.value=Mn(r.value.bind(t)),e[n]=r);return e}function Pr(t){let e={};for(let n of Ro)e[n]={configurable:!0,enumerable:!0,get:Mn(()=>t[n]),set:Mn(r=>{t[n]=r})};return e}function Ao(t){return Object.assign(_r(t),kr(t),Pr(t))}function Mn(t){return Object.defineProperty(t,Ar,{value:!0}),t}function Rr(t,e){for(let n of Reflect.ownKeys(e)){let r=_o(t,n);(r==null||ko(r))&&Object.defineProperty(t,n,e[n])}}function _o(t,e){let n=t;for(;n;){let r=Object.getOwnPropertyDescriptor(n,e);if(r)return r;n=Object.getPrototypeOf(n)}}function ko(t){return[t.value,t.get,t.set].some(e=>typeof e=="function"&&e[Ar]===!0)}var Re=class extends ge{[D]={};[ft]=[];[we]=Co(this);name="";window=this;parent=this;self=this;top=this;document=new ut(this);customElements=new en;location=globalThis.location;navigator=globalThis.navigator;Event=B;ErrorEvent=Xt;PromiseRejectionEvent=$t;ToggleEvent=Kt;FocusEvent=Zt;ClipboardEvent=Qt;EventTarget=ge;CustomEvent=Wt;Node=J;ParentNode=oe;ChildNode=ye;DocumentFragment=Ve;Document=ut;CharacterData=be;Comment=Be;Text=Ue;Element=H;HTMLElement=Jt;SVGElement=He;HTMLTemplateElement=ze;MutationObserver=Lt;#t=null;#n=null;#e=null;static with(...e){let n=this;return class extends n{constructor(){super();for(let o of e)Po(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=_r(e),i=Object.assign(kr(e),Pr(e));delete o.self,Object.defineProperties(globalThis,o),Rr(globalThis,i),typeof n>"u"||n===r&&n!==globalThis?Object.defineProperty(globalThis,"self",{value:e,configurable:!0,writable:!0,enumerable:!0}):n!==globalThis&&(Object.defineProperties(n,o),Rr(n,i))}static setGlobalThis(e){for(let n in e)e[n]===e&&(e[n]=globalThis);Object.defineProperties(globalThis,Ao(e))}};function Po(t,e){t[ft].push(e(t)??{})}function Co(t){return{createElement:ce.bind(null,t,"createElement"),setAttribute:ce.bind(null,t,"setAttribute"),removeAttribute:ce.bind(null,t,"removeAttribute"),createText:ce.bind(null,t,"createText"),setText:ce.bind(null,t,"setText"),insertChild:ce.bind(null,t,"insertChild"),removeChild:ce.bind(null,t,"removeChild"),addEventListener:ce.bind(null,t,"addEventListener"),removeEventListener:ce.bind(null,t,"removeEventListener")}}function ce(t,e,...n){for(let i of t[ft])i[e]?.apply(i,n);let r=t[D];r[e]?.apply(r,n)}var tn=new Re;var Dn="~";var Ee=new WeakMap;function Fe(t){return Ee.get(t)}var Un=new WeakMap,Mo=0;function $(t){let e=Un.get(t);return e==null&&(e=String(Mo++),nn(t,e)),e}function nn(t,e){Un.set(t,e)}var Gn=new WeakMap;function Do(t){return Gn.get(t)}var Hn=new WeakMap;function Lo(t){let e=Hn.get(t);if(e!=null)return e;if(!(!(t instanceof Element)||t.tagName.includes("-"))){e={};for(let{name:n,value:r}of t.attributes)e[n]=r;return e}}var Go=new WeakMap;function Ho(t){return Go.get(t)}function Bn(t,e,n){let r=Gn.get(t);if(r==null&&(r={},Gn.set(t,r)),r[e]===n)return;r[e]=n;let o=Ee.get(t);o?.mutate([[3,$(t),e,n,1]])}function Ne(t,e,n){let r=Hn.get(t);if(r==null&&(r={},Hn.set(t,r)),r[e]===n)return;n==null?delete r[e]:r[e]=String(n);let o=Ee.get(t);o?.mutate([[3,$(t),e,n,2]])}function je(t,e){if(Ee.get(t)!==e&&(Ee.set(t,e),t.childNodes))for(let r=0;r<t.childNodes.length;r++)je(t.childNodes[r],e)}function rn(t){if(Ee.get(t)!=null&&(Ee.delete(t),t.childNodes))for(let n=0;n<t.childNodes.length;n++)rn(t.childNodes[n])}function qe(t){let{nodeType:e}=t;switch(e){case 1:return{id:$(t),type:e,element:t.localName,properties:Ln(Do(t)),attributes:Ln(Lo(t)),eventListeners:Ln(Ho(t)),children:Array.from(t.childNodes).map(qe)};case 3:case 8:return{id:$(t),type:e,data:t.data};default:throw new Error(`Cannot serialize node of type ${t.nodeType} (${typeof t.nodeType})`)}}function Ln(t){return t?{...t}:void 0}function Vn(t,e,...n){let r=Un.get(t),o=Ee.get(t);if(r==null||o==null)throw new Error(`Cannot call method ${e} on an unconnected node`);return o.call(r,e,...n)}var Ye=tn[D];Ye.insertChild=(t,e,n)=>{let r=Fe(t);r!=null&&(je(e,r),r.mutate([[0,$(t),qe(e),n]]))};Ye.removeChild=(t,e,n)=>{let r=Fe(t);r!=null&&(rn(e),r.mutate([[1,$(t),n]]))};Ye.setText=(t,e)=>{let n=Fe(t);n?.mutate([[2,$(t),e]])};Ye.setAttribute=(t,e,n)=>{t.tagName.includes("-")||Ne(t,e,n)};Ye.removeAttribute=(t,e)=>{t.tagName.includes("-")||Ne(t,e)};Re.setGlobal(tn);function on(t){if(typeof t=="string")return{type:"navigate",to:t};let{place:e,record:n,where:r,section:o}=t??{},i={...r===void 0?{}:{where:r},...o===void 0?{}:{section:String(o)}};return typeof e=="string"?{type:"navigate",place:e,...i}:typeof n=="string"?{type:"navigate",to:n,...i}:void 0}var Ir=["wheel","drag","pinch"];function Mr(t){let e=t;return typeof t=="object"&&t!==null&&e.graview==="host-hello"&&typeof e.nonce=="string"}function Lr(t,e={}){let n,r="",o,i=0,s=new Set,a=new Map,c=[],u=E=>{n?n.postMessage({...E,nonce:r}):c.push(E)},m=E=>{let N=E.data;if(!(!N||typeof N!="object")){if(N.type==="props"){o=N.props;for(let C of s)C(N.props)}else N.type==="answer"?(a.get(N.id)?.(N),a.delete(N.id)):N.type==="event"&&typeof N.listener=="number"?e.onEvent?.(N):N.type==="heartbeat"&&typeof N.beat=="number"&&u({type:"heartbeat",beat:N.beat});e.onMessage?.(N)}},h=()=>{},g=E=>{if(n||!t.fromHost(E)||!Mr(E.data)||E.data.protocol!==1)return;let N=E.ports[0];if(N){n=N,r=E.data.nonce,n.onmessage=m,n.start?.(),h();for(let C of c.splice(0))u(C)}};h=t.listen(g),t.ready({graview:"guest-ready",protocol:1});let y,O={get props(){return o},subscribe(E){return s.add(E),()=>s.delete(E)},act(E,N={}){let C=i+=1;return new Promise(L=>{a.set(C,L),u({type:"act",id:C,name:E,args:N})})},navigate(E){let N=on(E);N&&u(N)},size(E){u({type:"size",height:E})},autoSize(E){let N=E??globalThis.document?.documentElement,C=globalThis.ResizeObserver;if(!N||!C||typeof N.getBoundingClientRect!="function")return()=>{};y?.disconnect();let L=new C(()=>O.size(Math.ceil(N.getBoundingClientRect().height)));return L.observe(N),y=L,()=>L.disconnect()},close(){y?.disconnect(),h(),n?.close(),s.clear()}};return{guest:O,send:u}}var Hr=["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"],Ur=["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"],Br=["self","postMessage","setTimeout","clearTimeout","setInterval","clearInterval","queueMicrotask","structuredClone","crypto","console","DOMException"],Vr=["TEMPORARY","PERSISTENT"],gl=Object.freeze([...Hr,...Ur,...Br,...Vr]),yl=Object.freeze(["constructor","__defineGetter__","__defineSetter__","hasOwnProperty","__lookupGetter__","__lookupSetter__","isPrototypeOf","propertyIsEnumerable","toString","valueOf","__proto__","toLocaleString"]),Gr=t=>typeof t=="symbol"?`[${t.description??"symbol"}]`:t;function zr(t=globalThis,e=[],n={}){let r=[],o=[],i=new Set([...Hr,...Ur,...Br,...e,"constructor",Symbol.toStringTag]),s=(x,k)=>{let j=Reflect.getOwnPropertyDescriptor(x,k);return j===void 0||!("value"in j)||j.writable||j.configurable?!1:n.primitivesStay&&typeof k=="symbol"&&(typeof j.value!="object"||j.value===null)&&typeof j.value!="function"?!0:Vr.includes(k)&&typeof j.value=="number"},a=t,c=a.setTimeout,u=a.setInterval,m=a.crypto,h=(x,k)=>function(j,We,...mt){if(typeof j!="function")throw new TypeError(`${k} takes a function: a guest view cannot run code from text`);return x.call(t,j,We,...mt)},g=m?Object.freeze({getRandomValues:x=>m.getRandomValues(x)}):void 0,y=a.document?.defaultView;if(y&&y!==a)for(let x of Reflect.ownKeys(y))typeof x=="symbol"||i.has(x)||Reflect.deleteProperty(y,x)||o.push(`window.${x}`);let O=[];for(let x=t;x&&x!==Object.prototype;x=Object.getPrototypeOf(x))O.push(x);for(let x of O)for(let k of Reflect.ownKeys(x))i.has(k)||(Reflect.deleteProperty(x,k)?r.push(Gr(k)):s(x,k)||o.push(Gr(k)));let E=()=>function(){throw new EvalError("A guest view cannot make code from text.")},N=[Function.prototype,Object.getPrototypeOf(async function(){}),Object.getPrototypeOf(function*(){}),Object.getPrototypeOf(async function*(){})];for(let x of N){let k=E();Object.defineProperty(k,"prototype",{value:x,writable:!1,enumerable:!1,configurable:!1}),Reflect.defineProperty(x,"constructor",{value:k,writable:!1,enumerable:!1,configurable:!1})||o.push("Function.prototype.constructor"),x===Function.prototype&&Reflect.defineProperty(t,"Function",{value:k,writable:!0,enumerable:!1,configurable:!0})}let C=(x,k)=>{Reflect.defineProperty(t,x,{value:k,writable:!0,enumerable:!0,configurable:!0})||o.push(x)};C("setTimeout",h(c,"setTimeout")),C("setInterval",h(u,"setInterval")),g&&C("crypto",g);for(let x of O.slice(1))Object.freeze(x);for(let x of Reflect.ownKeys(t)){let k=Reflect.getOwnPropertyDescriptor(t,x);Reflect.defineProperty(t,x,"value"in k?{...k,writable:!1,configurable:!1}:{...k,configurable:!1})}let L;try{L=Reflect.preventExtensions(t)}catch{L=!1}return{removed:r,stuck:o,sealed:L}}var dt=class extends HTMLElement{constructor(){super(),nn(this,Dn)}connect(e){if(Fe(this)===e||(je(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,Dn,qe(o),r])}e.mutate(n)}updateRemoteProperty(e,n){Bn(this,e,n)}callRemoteMethod(e,...n){return Vn(this,e,...n)}};var d={},sn={empty:!0},Uo={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"},zn={div:d,section:d,article:d,aside:d,header:d,footer:d,nav:d,hgroup:d,search:d,address:d,figure:d,figcaption:d,blockquote:d,p:d,pre:d,hr:sn,br:sn,wbr:sn,h1:d,h2:d,h3:d,h4:d,h5:d,h6:d,span:d,strong:d,em:d,b:d,i:d,u:d,s:d,small:d,mark:d,abbr:d,cite:d,q:d,code:d,kbd:d,samp:d,var:d,sub:d,sup:d,dfn:d,bdi:d,bdo:d,ruby:d,rt:d,rp:d,time:{attributes:{datetime:"text"}},data:{attributes:{value:"text"}},del:{attributes:{datetime:"text"}},ins:{attributes:{datetime:"text"}},a:{attributes:{href:"link"}},ul:d,menu:d,dl:d,dt:d,dd:d,ol:{attributes:{start:"number",reversed:"boolean",type:{oneOf:["1","a","A","i","I"]}}},li:{attributes:{value:"number"}},table:d,caption:d,thead:d,tbody:d,tfoot:d,tr:d,colgroup:{attributes:{span:"number"}},col:{attributes:{span:"number"},empty:!0},th:{attributes:{colspan:"number",rowspan:"number",headers:"text",scope:{oneOf:["row","col","rowgroup","colgroup"]},abbr:"text"}},td:{attributes:{colspan:"number",rowspan:"number",headers:"text"}},details:{attributes:{open:"boolean",name:"text"}},summary:d,button:{attributes:{type:{oneOf:["button"]},disabled:"boolean",name:"text",value:"text"}},input:{empty:!0,attributes:{type:{oneOf:["text","search","number","range","checkbox","radio","date","time","datetime-local","month","week","color","email","tel","url"]},name:"text",value:"text",placeholder:"text",min:"text",max:"text",step:"text",checked:"boolean",disabled:"boolean",readonly:"boolean",required:"boolean",maxlength:"number",minlength:"number",size:"number",pattern:"text",multiple:"boolean",inputmode:"text",enterkeyhint:"text"}},select:{attributes:{name:"text",disabled:"boolean",multiple:"boolean",required:"boolean",size:"number"}},option:{attributes:{value:"text",selected:"boolean",disabled:"boolean",label:"text"}},optgroup:{attributes:{label:"text",disabled:"boolean"}},textarea:{attributes:{name:"text",placeholder:"text",rows:"number",cols:"number",disabled:"boolean",readonly:"boolean",required:"boolean",maxlength:"number",minlength:"number",wrap:{oneOf:["soft","hard","off"]}}},label:{attributes:{for:"text"}},fieldset:{attributes:{disabled:"boolean",name:"text"}},legend:d,output:d,meter:{attributes:{value:"number",min:"number",max:"number",low:"number",high:"number",optimum:"number"}},progress:{attributes:{value:"number",max:"number"}},img:{empty:!0,attributes:{src:"image",alt:"text",width:"number",height:"number",decoding:{oneOf:["async","sync","auto"]}}},"graview-video":sn},Bo=["fill","fill-opacity","fill-rule","stroke","stroke-width","stroke-linecap","stroke-linejoin","stroke-dasharray","stroke-dashoffset","stroke-opacity","stroke-miterlimit","opacity","color","display","visibility","transform-origin","clip-path","clip-rule","marker-start","marker-mid","marker-end","font-family","font-size","font-weight","font-style","text-anchor","dominant-baseline","alignment-baseline","letter-spacing","text-decoration","paint-order","vector-effect","shape-rendering","pointer-events","stop-color","stop-opacity","overflow","mask","filter","flood-color","flood-opacity","lighting-color","color-interpolation-filters"],Vo={id:"text",class:"text",style:"style",lang:"text",role:"text",tabindex:{oneOf:["-1","0"]},transform:"geometry",...Object.fromEntries(Bo.map(t=>[t,"css"]))},ue={x:"geometry",y:"geometry",width:"geometry",height:"geometry"},an={viewBox:"geometry",preserveAspectRatio:"geometry"},Fr={oneOf:["userSpaceOnUse","objectBoundingBox"]},jr={oneOf:["R","G","B","A"]},ne={...ue,in:"text",result:"text"},qr={gradientUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},gradientTransform:"geometry",spreadMethod:{oneOf:["pad","reflect","repeat"]},href:"fragment"},Yr={svg:{attributes:{...ue,...an}},g:d,defs:d,symbol:{attributes:{...ue,...an,refX:"geometry",refY:"geometry"}},use:{attributes:{...ue,href:"fragment"}},title:d,desc:d,path:{attributes:{d:"geometry",pathLength:"number"}},rect:{attributes:{...ue,rx:"geometry",ry:"geometry",pathLength:"number"}},circle:{attributes:{cx:"geometry",cy:"geometry",r:"geometry",pathLength:"number"}},ellipse:{attributes:{cx:"geometry",cy:"geometry",rx:"geometry",ry:"geometry",pathLength:"number"}},line:{attributes:{x1:"geometry",y1:"geometry",x2:"geometry",y2:"geometry",pathLength:"number"}},polyline:{attributes:{points:"geometry",pathLength:"number"}},polygon:{attributes:{points:"geometry",pathLength:"number"}},text:{attributes:{x:"geometry",y:"geometry",dx:"geometry",dy:"geometry",rotate:"geometry",textLength:"geometry",lengthAdjust:{oneOf:["spacing","spacingAndGlyphs"]}}},tspan:{attributes:{x:"geometry",y:"geometry",dx:"geometry",dy:"geometry",rotate:"geometry",textLength:"geometry"}},textPath:{attributes:{href:"fragment",startOffset:"geometry",method:{oneOf:["align","stretch"]},spacing:{oneOf:["auto","exact"]},side:{oneOf:["left","right"]}}},linearGradient:{attributes:{x1:"geometry",y1:"geometry",x2:"geometry",y2:"geometry",...qr}},radialGradient:{attributes:{cx:"geometry",cy:"geometry",r:"geometry",fx:"geometry",fy:"geometry",fr:"geometry",...qr}},stop:{attributes:{offset:"geometry"}},clipPath:{attributes:{clipPathUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]}}},mask:{attributes:{...ue,maskUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},maskContentUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]}}},pattern:{attributes:{...ue,...an,patternUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},patternContentUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},patternTransform:"geometry",href:"fragment"}},marker:{attributes:{...an,markerWidth:"geometry",markerHeight:"geometry",refX:"geometry",refY:"geometry",orient:"geometry",markerUnits:{oneOf:["strokeWidth","userSpaceOnUse"]}}},a:d,filter:{attributes:{...ue,filterUnits:Fr,primitiveUnits:Fr}},feBlend:{attributes:{...ne,in2:"text",mode:"text"}},feColorMatrix:{attributes:{...ne,type:{oneOf:["matrix","saturate","hueRotate","luminanceToAlpha"]},values:"geometry"}},feComponentTransfer:{attributes:ne},...Object.fromEntries(["feFuncR","feFuncG","feFuncB","feFuncA"].map(t=>[t,{attributes:{type:{oneOf:["identity","table","discrete","linear","gamma"]},tableValues:"geometry",slope:"number",intercept:"number",amplitude:"number",exponent:"number",offset:"number"}}])),feComposite:{attributes:{...ne,in2:"text",operator:{oneOf:["over","in","out","atop","xor","lighter","arithmetic"]},k1:"number",k2:"number",k3:"number",k4:"number"}},feDisplacementMap:{attributes:{...ne,in2:"text",scale:"number",xChannelSelector:jr,yChannelSelector:jr}},feDropShadow:{attributes:{...ne,dx:"number",dy:"number",stdDeviation:"geometry"}},feFlood:{attributes:ne},feGaussianBlur:{attributes:{...ne,stdDeviation:"geometry",edgeMode:{oneOf:["duplicate","wrap","none"]}}},feMerge:{attributes:ne},feMergeNode:{attributes:{in:"text"}},feMorphology:{attributes:{...ne,operator:{oneOf:["erode","dilate"]},radius:"geometry"}},feOffset:{attributes:{...ne,dx:"number",dy:"number"}},feTurbulence:{attributes:{...ue,result:"text",type:{oneOf:["fractalNoise","turbulence"]},baseFrequency:"geometry",numOctaves:"number",seed:"number",stitchTiles:{oneOf:["stitch","noStitch"]}}}};var Wr={section:["aria-label","title"]};function zo(t){return/^aria-[a-z]+$/.test(t)}function Fo(t){return/^data-[a-z0-9][a-z0-9_.-]*$/.test(t)}var jo=new Map(Object.keys(Yr).map(t=>[t.toLowerCase(),t]));function Xr(t){return jo.get(t.toLowerCase())}function $r(t,e,n){let r=n.toLowerCase(),o=t==="html"?[zn[e]?.attributes,Uo]:[Yr[e]?.attributes,Vo],i=t==="svg"&&r==="xlink:href"?"href":r;for(let s of o)if(s){for(let[a,c]of Object.entries(s))if(a.toLowerCase()===i)return{name:a,kind:c}}if(zo(r)||Fo(r))return{name:r,kind:"text"}}var Kr="~",ln=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),ie=(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=>ie(n,e+1)):Object.fromEntries(Object.entries(t).map(([n,r])=>[n,ie(r,e+1)]))};function Zr(){let t=new Map,e=new Map,n=new Map([[Kr,{children:[],listeners:new Map}]]),r=0,o=u=>{let m=e.get(u);return m===void 0&&(m=r+=1,e.set(u,m),t.set(m,{listener:u,count:0})),t.get(m).count+=1,m},i=u=>{let m=t.get(u);m&&(m.count-=1,!(m.count>0)&&(t.delete(u),e.delete(m.listener)))},s=u=>{let m=n.get(u);if(m){n.delete(u);for(let h of m.listeners.values())i(h);for(let h of m.children)s(h)}},a=(u,m,h=0)=>{if(!ln(u)||h>64)return ie(u);let g=typeof u.id=="string"?u.id:void 0,y=m&&g!==void 0&&g!==Kr;y&&s(g);let O={children:[],listeners:new Map};y&&n.set(g,O);let E={};for(let[N,C]of Object.entries(u))N==="children"&&Array.isArray(C)?E[N]=C.map(L=>{let x=a(L,y,h+1);return y&&ln(L)&&typeof L.id=="string"&&O.children.push(L.id),x}):N==="eventListeners"&&ln(C)?E[N]=Object.fromEntries(Object.entries(C).map(([L,x])=>{if(typeof x!="function"||!y)return[L,void 0];let k=o(x);return O.listeners.set(L,k),[L,{listener:k}]})):E[N]=ie(C,h+1);return E},c=u=>{if(!Array.isArray(u))return ie(u);let[m,h]=u,g=typeof h=="string"?n.get(h):void 0;if(m===0){let y=a(u[2],g!==void 0),O=ln(u[2])?u[2].id:void 0;if(g&&typeof O=="string"&&n.has(O)){let E=Number(u[3]);g.children.splice(Number.isInteger(E)&&E>=0&&E<=g.children.length?E:g.children.length,0,O)}return[m,ie(h),y,ie(u[3])]}if(m===1){let y=Number(u[2]);return g&&Number.isInteger(y)&&y>=0&&y<g.children.length&&s(g.children.splice(y,1)[0]),ie(u)}if(m===3&&u[4]===3){let y=String(u[2]),O=u[3],E=g&&typeof O=="function"?o(O):void 0,N=g?.listeners.get(y);return N!==void 0&&i(N),E===void 0?g?.listeners.delete(y):g.listeners.set(y,E),[m,ie(h),y,E===void 0?void 0:{listener:E},3]}return ie(u)};return{encode:u=>u.map(c),listener:u=>t.get(u)?.listener,get listening(){return t.size},get nodes(){return n.size-1}}}var cn="graview-view-root",qo=["value","checked","key","pressed","files","refused","x","y","width","height","deltaX","deltaY","deltaMode","ctrlKey","metaKey","phase","pointerId","button","pressure","dx","dy","scale","rotation"],Yo=t=>t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/\'/g,"'"),Wo=t=>Object.freeze({html:t,toString:()=>t}),Qr=t=>typeof t=="object"&&t!==null&&typeof t.html=="string"&&Object.isFrozen(t),Jr=t=>t==null||t===!1?"":Array.isArray(t)?t.map(Jr).join(""):Qr(t)?t.html:Yo(String(t));function eo(t){customElements.get(cn)||customElements.define(cn,dt);let e=Event,n=Zr(),r=new Set,o=new Set,i,s=[],a=new Set;for(let l of["closest","matches","dataset"]){let f=()=>{throw new TypeError(`A view\'s element has no ${l}: graview.on hands event.element, the element its selector matched; read event.element.getAttribute("data-\\u2026").`)};l in Element.prototype||Object.defineProperty(Element.prototype,l,l==="dataset"?{get:f}:{value:f})}let c=document.createElement(cn),u=l=>{let f=b=>{for(let w of Array.from(b.childNodes)){if(w.nodeType!==1)continue;if($(w)===l)return w;let T=f(w);if(T)return T}};return f(c)},m=l=>{let f=u(l.target);if(!f)return;let b=new e(l.event,{bubbles:!0}),w={};for(let T of qo)l[T]!==void 0&&(w[T]=l[T]);for(let T of Object.keys(w))Object.defineProperty(b,T,{value:w[T],enumerable:!0});f.dispatchEvent(b);for(let T of o){if(T.type!==l.event)continue;let _;try{_=new Set(Array.from(c.querySelectorAll(T.selector)))}catch{continue}for(let z=f;z&&z!==c;z=z.parentNode)if(_.has(z)){T.listener(Object.freeze({type:l.event,target:f,element:z,...w}));break}}},h=l=>{if(l.type==="dom-event"&&typeof l.target=="string")return m(l);if(l.type==="notice")return t.warn(l.text);if(l.type!=="props")return;i=l.props;let f=t.now();for(let T of r)try{T(l.props)}catch(_){t.threw(_)}let b=t.now()-f,w=l.push;typeof w=="number"&&t.microtask(()=>t.microtask(()=>t.send({type:"pushed",push:w,ms:b})))},g;c.connect({mutate(l){g||(g=[],t.microtask(()=>{let f=g??[];g=void 0,t.send({type:"render",records:n.encode(f)})})),g.push(...l)},call:()=>{}});let y=l=>l.nodeType===1?l.getAttribute("data-key")??l.getAttribute("id"):null,O=(l,f)=>l.nodeType===f.nodeType&&(l.nodeType!==1||l.localName===f.localName&&l.namespaceURI===f.namespaceURI&&y(l)===y(f));function E(l,f){let b=Array.from(f.childNodes),w=0;for(let T of b){let _=l.childNodes[w]??null;if(_&&O(_,T)){N(_,T),w+=1;continue}if(y(T)!==null){let de=Array.from(l.childNodes).slice(w+1).find(Xe=>O(Xe,T));if(de){l.insertBefore(de,_),N(de,T),w+=1;continue}}l.insertBefore(T,_),w+=1}for(;l.childNodes.length>w;)l.removeChild(l.lastChild)}function N(l,f){if(l.nodeType!==1){l.data!==f.data&&(l.data=f.data);return}let b=l,w=f,T=C(b);for(let _ of b.getAttributeNames())w.hasAttribute(_)||(b.removeAttribute(_),T&&Ne(b,_,void 0));for(let _ of w.getAttributeNames()){let z=w.getAttribute(_);b.getAttribute(_)!==z&&b.setAttribute(_,z),T&&Ne(b,_,z)}E(b,w)}let C=l=>l.localName.includes("-");function L(l){for(let f of Array.from(l.childNodes)){if(f.nodeType!==1)continue;let b=f;if(C(b))for(let w of b.getAttributeNames())Ne(b,w,b.getAttribute(w)??void 0);L(b)}}function x(l,f,b){for(let w of Array.from(l.childNodes)){if(w.nodeType!==1)continue;let T=w,_=T.localName,z=f||_.toLowerCase()==="svg",de=z?Xr(_):Object.prototype.hasOwnProperty.call(zn,_.toLowerCase())?_.toLowerCase():void 0;if(!de){b.add(`<${_}>`);continue}for(let Xe of T.getAttributeNames())(!$r(z?"svg":"html",de,Xe)||!z&&Wr[de]?.includes(Xe.toLowerCase()))&&b.add(`${de} ${Xe}`);x(T,z,b)}}function k(l){let f=document.createElement("div"),b=Array.isArray(l)?l:[l];for(let T of b)if(T!=null)if(typeof T=="string"||Qr(T)){let _=document.createElement("div");_.innerHTML=typeof T=="string"?T:T.html,f.append(...Array.from(_.childNodes))}else f.append(T);let w=new Set;x(f,!1,w),s=[...w],s.length>0&&t.warn(`The host will not draw: ${s.join(", ")}`),L(f),E(c,f)}let j=[],We=new Set(Ir),mt="[]",un=!1,Yn=()=>{un||(un=!0,t.microtask(()=>{un=!1;let l=[...new Map([...o].filter(b=>We.has(b.type)).map(b=>[`${b.type} ${b.selector}`,{event:b.type,selector:b.selector}])).entries()].sort(([b],[w])=>b<w?-1:b>w?1:0).map(([,b])=>b),f=JSON.stringify(l);f!==mt&&(mt=f,t.send({type:"gestures",bound:l}))}))},Wn="[]",dn=!1,Xn=()=>{dn||(dn=!0,t.microtask(()=>{dn=!1;let l=[...new Set([...o].filter(b=>b.type==="click"&&typeof b.selector=="string").map(b=>b.selector))].sort().slice(0,200),f=JSON.stringify(l);f!==Wn&&(Wn=f,t.send({type:"clicks",selectors:l}))}))};return{view:Object.freeze({get props(){return i},onProps(l){return r.add(l),i&&l(i),()=>void r.delete(l)},render:k,style(l){typeof l!="string"||j.includes(l)||(j.push(l),t.send({type:"style",sheets:[...j]}))},on(l,f,b){let w={type:l,selector:f,listener:b};return o.add(w),typeof l=="string"&&!a.has(l)&&(a.add(l),t.send({type:"hears",events:[l]})),We.has(l)&&Yn(),l==="click"&&Xn(),()=>{o.delete(w),We.has(l)&&Yn(),l==="click"&&Xn()}},act:(l,f={})=>t.act(l,f),navigate(l){if(typeof l=="string")return t.navigate(l);let f=on(l);f&&t.send(f)},html(l,...f){return Wo(l.reduce((b,w,T)=>b+w+(T<f.length?Jr(f[T]):""),""))},get refused(){return s},get hardening(){return t.hardening()}}),hear:h,find:l=>{try{let f=c.querySelectorAll(l)[0];return f?$(f):void 0}catch{return}},listened:l=>{let f=new Set;for(let b of o)if(b.type===l)try{for(let w of Array.from(c.querySelectorAll(b.selector))){let T=$(w);T&&f.add(T)}}catch{}return[...f]}}}var qn={removed:[],stuck:[],sealed:!1,worker:!1},Fn=Lr({listen(t){return _e.listen(t),()=>_e.unlisten(t)},fromHost:()=>!0,ready:t=>_e.post(t)},{onMessage:t=>to.hear(t)}),to=eo({send:t=>Fn.send(t),act:(t,e)=>Fn.guest.act(t,e),navigate:t=>Fn.guest.navigate(t),microtask:_e.microtask,now:_e.now,threw:t=>console.error(t),warn:t=>console.warn(t),hardening:()=>qn}),Xo=to.view;Object.defineProperty(globalThis,"graview",{value:Xo,enumerable:!0,configurable:!0,writable:!1});var jn="WorkerGlobalScope"in globalThis?zr(globalThis,["graview"]):qn;qn=jn;if(jn.stuck.length>0)throw new Error(`The view\'s worker could not be hardened: ${jn.stuck.join(", ")} would not go.`);})();\n';export{e as VIEW_RUNTIME};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{k as a,l as b,m as c,n as d,o as e,p as f,q as g,r as h,s as i}from"./chunk.47JQPYXL.js";import"./chunk.BJUUSIQY.js";import"./chunk.VG7OWV2H.js";import"./chunk.KXPRILAO.js";import"./chunk.XU34T2H4.js";import"./chunk.XOZU4OFA.js";import"./chunk.BB33TI4S.js";import"./chunk.CCWPF5PK.js";import"./chunk.KKNDX4JT.js";import"./chunk.3YZHZGTM.js";import"./chunk.EQTSV7BK.js";import"./chunk.27CW6SCT.js";import"./chunk.YD3TKV6P.js";import"./chunk.4KC35UNR.js";import"./chunk.HT2BEOEV.js";import"./chunk.SDO3U72B.js";import"./chunk.7BBGRTXM.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";export{i as GhostTray,h as InlineAiMenu,g as askAgain,c as askInline,a as askOf,b as drawPanel,d as heldSuggestion,e as suggestOnce,f as takeOffer};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Ie}from"./chunk.HJCQ6I3S.js";import{a as Se,b as Fe,c as Te,d as Ce}from"./chunk.7O6Z3BFR.js";import"./chunk.TKUNRFDE.js";import{c as Me}from"./chunk.I2C5LPB5.js";import"./chunk.XJFAUOJS.js";import"./chunk.DPPT6WAJ.js";import"./chunk.7U2JO7ET.js";import{G as Qe,T as Oe}from"./chunk.NPAWTPLQ.js";import"./chunk.SDO3U72B.js";import"./chunk.YEJ4LNUP.js";import"./chunk.FQLNBIQ5.js";import{b as Re}from"./chunk.AJZBJBMO.js";var I=Re(Qe(),1);var O=.5,fe=1,Pe=.76,Ne=3,Ze=3,Ae=.6;function et(t){let n=De(t);for(;;){let s=n.next();if(s.done)return s.value}}function*De(t){let{ribbons:n,plots:s,cell:i}=t,u=t.tilt??.5,g=t.labels??[],k=[...s.values()],p=new Map;if(k.length===0||i<=0)return p;let R=1/0,j=1/0,E=-1/0,W=-1/0;for(let o of k)R=Math.min(R,o.col),j=Math.min(j,o.row),E=Math.max(E,o.col+o.side),W=Math.max(W,o.row+o.side);R-=3,j-=3,E+=3,W+=3;let M=Math.round((E-R)/O)+1,P=Math.round((W-j)/O)+1,H=o=>R+o*O,_=o=>j+o*O,B=4,te=(o,c)=>{if(g.length===0)return!1;let l=Me(o,c,i,u);for(let f of g)if(l.x>f.x-B&&l.x<f.x+f.width+B&&l.y>f.y-B&&l.y<f.y+f.height+B)return!0;return!1},L=(o,c)=>{for(let l of k)if(o>l.col-Pe&&o<l.col+l.side+Pe&&c>l.row-Pe&&c<l.row+l.side+Pe)return!0;return!1},A=M*P,N=new Uint8Array(A),S=new Uint8Array(A),ne=new Uint8Array(A),oe=new Uint8Array(A),G=new Uint8Array(A),re=new Uint8Array(A),V=new Float32Array(A);for(let o=0;o<P;o++){let c=_(o);for(let l=0;l<M;l++){let f=H(l),m=o*M+l;if(S[m]=L(f,c)?0:1,N[m]=S[m]&&!te(f,c)?1:0,l+1<M){let a=f+O/2;oe[m]=L(a,c)?0:1,ne[m]=oe[m]&&!te(a,c)?1:0}if(o+1<P){let a=c+O/2;re[m]=L(f,a)?0:1,G[m]=re[m]&&!te(f,a)?1:0}let e=1/0;for(let a of k)e=Math.min(e,Math.max(0,a.col-f,f-(a.col+a.side),a.row-c,c-(a.row+a.side)));V[m]=e}}let J=(o,c)=>{let l=[],f=(e,a)=>{let w=[],b=Math.min(1,a/3);for(let r=Math.ceil((e+b)/O-1e-9)*O;r<=e+a-b+1e-9;r+=O)w.push(r);return w},m=(e,a,w,b)=>{let r=Math.round((e-R)/O),d=Math.round((a-j)/O);r>=0&&d>=0&&r<M&&d<P&&c[d*M+r]&&l.push({i:r,j:d,out:w,curb:b})};for(let e of f(o.row,o.side))m(o.col-fe,e,1,{col:o.col,row:e}),m(o.col+o.side+fe,e,0,{col:o.col+o.side,row:e});for(let e of f(o.col,o.side))m(e,o.row-fe,3,{col:e,row:o.row}),m(e,o.row+o.side+fe,2,{col:e,row:o.row+o.side});return l};yield;let se=new Uint8Array(A),ie=new Uint8Array(A),le=[[1,0],[-1,0],[0,1],[0,-1]],ae=[1,0,3,2],D=A*4,X=new Float64Array(D),F=[new Int32Array(D),new Int32Array(D)],U=new je,ge=(o,c,l,f,m)=>{let e=l?N:S,a=l?ne:oe,w=l?G:re,b=J(o,e),r=J(c,e),d=new Map(r.map(h=>[h.j*M+h.i,h]));if(b.length===0||r.length===0)return{reached:-1,best:1/0,starts:b,goal:d,back:f};let y=(h,x)=>{let $=H(h),K=_(x);return(Math.max(0,c.col-$,$-(c.col+c.side))+Math.max(0,c.row-K,K-(c.row+c.side)))*Ae};X.fill(1/0),f.fill(-1),U.clear();let Y=-1,v=1/0;for(let h of b){let x=(h.j*M+h.i)*4+h.out;X[x]=0,U.push(x,y(h.i,h.j))}for(;U.size>0;){let h=U.peekKey();if(h>=v||h>=m)break;let x=U.pop(),$=x>>2,K=x&3,ee=$%M,ue=($-ee)/M,Ee=d.get($);if(Ee){let q=X[x]+(K===ae[Ee.out]?0:Ne);q<v&&(v=q,Y=x);continue}for(let q=0;q<4;q++){let[pe,Be]=le[q],be=ee+pe,xe=ue+Be;if(be<0||xe<0||be>=M||xe>=P)continue;let ke=xe*M+be;if(!e[ke])continue;let Le=pe+Be>0?$:ke;if(!(pe!==0?a:w)[Le])continue;let _e=(pe!==0?se:ie)[Le]?Ae:1,Je=O*_e*(1+Math.max(0,V[ke]-Ze))+(q===K?0:Ne),ve=ke*4+q,$e=X[x]+Je;$e<X[ve]&&(X[ve]=$e,f[ve]=x,U.push(ve,$e+y(be,xe)))}}return{reached:Y,best:v,starts:b,goal:d,back:f}},Q=new Map;for(let o of n){let c=s.get(o.from),l=s.get(o.to);if(!c||!l||c===l)continue;let f=ge(c,l,!1,F[1],1/0);if(f.reached===-1){yield;continue}let m=ge(c,l,!0,F[0],1.3*f.best+2+Ae*fe+1e-9),e=m.reached!==-1&&m.best<=1.3*f.best+2?m:f;if(e.reached===-1)continue;let{reached:a,starts:w,goal:b,back:r}=e,d=[];for(let v=a;v!==-1;v=r[v]){let h=v>>2,x=d[d.length-1],$={i:h%M,j:Math.floor(h/M)};(!x||x.i!==$.i||x.j!==$.j)&&d.push($)}d.reverse();for(let v=1;v<d.length;v++){let h=d[v-1],x=d[v],$=h.i+h.j<x.i+x.j?h:x;(h.i!==x.i?se:ie)[$.j*M+$.i]=1}let y=w.find(v=>v.i===d[0].i&&v.j===d[0].j),Y=b.get(d[d.length-1].j*M+d[d.length-1].i);Q.set(o.key,{cells:d,start:y.curb,end:Y.curb}),yield}let ce=new Map(n.map(o=>[o.key,o.width])),de=new Map(n.map((o,c)=>[o.key,c])),we=i*u/Math.sqrt(1+u*u),Z=(o,c)=>o==="col"?`r${c.row.toFixed(2)}`:`c${c.col.toFixed(2)}`,T=new Map;for(let[o,c]of Q)for(let l=1;l<c.cells.length;l++){let f=c.cells[l-1],m=c.cells[l],e=Z(f.i!==m.i?"col":"row",{col:H(f.i),row:_(f.j)});T.set(e,(T.get(e)??new Set).add(o))}for(let[o,c]of Q){let l=[c.start,...c.cells.map(r=>({col:H(r.i),row:_(r.j)})),c.end],f=r=>r>=2&&r<=c.cells.length,m=[];for(let r=1;r<l.length;r++){let d=Math.abs(l[r].col-l[r-1].col)>1e-9?"col":"row",y=m[m.length-1];y&&y.axis===d?y.to=r:m.push({from:r-1,to:r,axis:d})}if(m.length===0)continue;let e=m.map(r=>{if(!Array.from({length:r.to-r.from},(h,x)=>f(r.from+1+x)).some(Boolean))return 0;let d=T.get(Z(r.axis,l[r.from]))??new Set;if(!d.has(o))return 0;let y=[...d].sort((h,x)=>(de.get(h)??0)-(de.get(x)??0)),v=-(y.reduce((h,x)=>h+(ce.get(x)??2)+2,0)-2)/2;for(let h of y){if(h===o)return(v+(ce.get(h)??2)/2)/we;v+=(ce.get(h)??2)+2}return 0}),a=r=>{let d=m[r],y=l[d.from];return d.axis==="col"?{row:y.row+e[r]}:{col:y.col+e[r]}},w=(r,d,y)=>({col:r.col??d.col??y.col,row:r.row??d.row??y.row}),b=[w(a(0),{},l[0])];for(let r=0;r+1<m.length;r++)b.push(w(a(r),a(r+1),l[m[r].to]));b.push(w(a(m.length-1),{},l[l.length-1])),p.set(o,b.map(r=>Me(r.col,r.row,i,u)))}return p}var je=class{items=[];keys=[];get size(){return this.items.length}clear(){this.items.length=0,this.keys.length=0}peekKey(){return this.keys[0]??1/0}push(n,s){this.items.push(n),this.keys.push(s);let i=this.items.length-1;for(;i>0;){let u=i-1>>1;if(this.keys[u]<=this.keys[i])break;this.swap(i,u),i=u}}pop(){let n=this.items[0],s=this.items.pop(),i=this.keys.pop();if(this.items.length>0){this.items[0]=s,this.keys[0]=i;let u=0;for(;;){let g=2*u+1,k=g+1,p=u;if(g<this.items.length&&this.keys[g]<this.keys[p]&&(p=g),k<this.items.length&&this.keys[k]<this.keys[p]&&(p=k),p===u)break;this.swap(u,p),u=p}}return n}swap(n,s){let i=this.items[n];this.items[n]=this.items[s],this.items[s]=i;let u=this.keys[n];this.keys[n]=this.keys[s],this.keys[s]=u}},tt=16,z=new Map,Ue=0;function me(t){let n=[...t.plots].map(([s,i])=>`${s}:${i.col},${i.row},${i.side}`).join(";");return`${t.ribbons.map(s=>`${s.key}>${s.from}>${s.to}>${s.width}`).join(";")}|${n}`}var nt=t=>t.map(n=>`${Math.round(n.x)},${Math.round(n.y)},${Math.round(n.width)},${Math.round(n.height)}`).join(";"),Ke=(t,n)=>`${n}|${t.cell}|${t.tilt??.5}|${nt(t.labels??[])}`;function qe(t,n,s){for(z.set(Ke(t,n),{ground:n,cell:t.cell,tilt:t.tilt??.5,runs:s});z.size>tt;)z.delete(z.keys().next().value)}function ye(t){let n=Ke(t,me(t)),s=z.get(n);if(s)return z.delete(n),z.set(n,s),s.runs}function ze(t){let n=ye(t);if(n)return n;Ue+=1;let s=et(t);return qe(t,me(t),s),s}function We(t,n,s=8){let i=ye(t);if(i)return n(i),()=>{};let u=me(t),g=De(t),k=!1,p;Ue+=1;let R=()=>{if(p=void 0,k)return;let j=performance.now();for(;;){let E=g.next();if(E.done){qe(t,u,E.value),n(E.value);return}if(performance.now()-j>=s)break}p=setTimeout(R,0)};return p=setTimeout(R,0),()=>{k=!0,p!==void 0&&clearTimeout(p)}}function Ge(t,n,s){let i;for(let g of z.values())g.ground===t&&g.tilt===s&&(i=g);if(!i||n<=0)return;if(i.cell===n)return i.runs;let u=n/i.cell;return new Map([...i.runs].map(([g,k])=>[g,k.map(p=>({x:p.x*u,y:p.y*u}))]))}function Ve(t,n){let s=t.col+t.side,i=s+.25+.22*Math.max(0,n),u=t.row+t.side*Math.max(.1,.3-.06*n),g=t.row+t.side*Math.min(.9,.7+.06*n);return[{col:s,row:u},{col:i,row:u},{col:i,row:g},{col:s,row:g}]}function Xe(t,n){return t.map(s=>Me(s.col,s.row,n.cell,n.tilt))}function Ye(t){return t.map((n,s)=>`${s===0?"M":"L"} ${n.x.toFixed(1)} ${n.y.toFixed(1)}`).join(" ")}function He(t){if(t.length===0)return{x:0,y:0};let n=0;for(let i=1;i<t.length;i++)n+=Math.hypot(t[i].x-t[i-1].x,t[i].y-t[i-1].y);let s=n/2;for(let i=1;i<t.length;i++){let u=t[i-1],g=t[i],k=Math.hypot(g.x-u.x,g.y-u.y);if(k>=s&&k>0)return{x:u.x+(g.x-u.x)*s/k,y:u.y+(g.y-u.y)*s/k};s-=k}return t[t.length-1]}var C=Re(Oe(),1),he=new Map,ot=(t,n)=>t.length===n.length&&t.every((s,i)=>Math.round(s.x)===Math.round(n[i].x)&&Math.round(s.y)===Math.round(n[i].y)&&Math.round(s.width)===Math.round(n[i].width)&&Math.round(s.height)===Math.round(n[i].height));function dt({frame:t,width:n,height:s,pan:i,store:u,graphVersion:g,selection:k,view:p,emphasis:R,hiddenKinds:j,drawn:E}){let[W,M]=(0,I.useState)(null),P=t.city,H=e=>u.graph.getNode(e)?.kind,_=(0,I.useMemo)(()=>Se(u.graph.allEdges(),e=>u.graph.getNode(e)?.kind),[u,g]),B=new Map;for(let e of t.nodes){let a=e.id.startsWith("kind:")?Te(e.id):null;a!==null&&e.plot&&Math.round(e.plane)===2&&B.set(a,e.plot)}let te=[...B].map(([e,a])=>`${e}:${a.col},${a.row},${a.side}`).join(";"),L=P?.cell??0,A=_.filter(e=>B.has(e.from)&&B.has(e.to)&&!j.has(e.from)&&!j.has(e.to)&&E(e.edge)),N=P?.tilt??.5,S=`${te}|${L}|${N}`,[ne,oe]=(0,I.useState)(null),[G,re]=(0,I.useState)(null),V=t.t>=1,J=!!P&&!!p.overview;(0,I.useLayoutEffect)(()=>{let e=G?.parentElement;if(!e||!P||!V)return;let a=e.getBoundingClientRect(),w=P.originX+i.x,b=P.originY+i.y,r=[...e.querySelectorAll('[data-graview-view^="kind:"] .graview-kind-face')].flatMap(d=>{let y=d.getBoundingClientRect();return y.width>0&&y.height>0?[{x:y.left-a.left-w,y:y.top-a.top-b,width:y.width,height:y.height}]:[]});for(he.set(S,r);he.size>16;)he.delete(he.keys().next().value);oe(d=>d?.cards===S&&ot(d.labels,r)?d:{cards:S,labels:r})},[G,V,S]);let se=Math.max(0,...A.map(e=>e.links)),ie=A.map(e=>({key:e.key,from:e.from,to:e.to,width:Ie(e.links,se)})),le=me({ribbons:ie,plots:B}),ae=typeof window>"u",D=ne?.cards===S?ne.labels:he.get(S)??(ae?[]:void 0),F=L>0&&J&&V&&D!==void 0?{ribbons:ie,plots:B,cell:L,tilt:N,labels:D}:null,[U,ge]=(0,I.useState)(0),Q=F!==null&&!ae&&ye(F)===void 0,ce=`${le}|${L}|${N}|${(D??[]).map(e=>`${Math.round(e.x)},${Math.round(e.y)},${Math.round(e.width)},${Math.round(e.height)}`).join(";")}`;(0,I.useEffect)(()=>{if(!(!Q||!F))return We(F,()=>ge(e=>e+1))},[Q,ce]);let de=(0,I.useMemo)(()=>{if(L===0||!J)return[];let e=F?ae?ze(F):ye(F):Ge(le,L,N);if(!e)return[];let a=new Map;return A.flatMap(w=>{let b;if(w.from===w.to){let r=a.get(w.from)??0;a.set(w.from,r+1),b=Xe(Ve(B.get(w.from),r),{cell:L,tilt:N})}else b=e.get(w.key);return!b||b.length<2?[]:[{ribbon:w,points:b,d:Ye(b),middle:He(b),width:Ie(w.links,se)}]})},[L,N,le,D,V,J,U]),we=(0,I.useRef)([]),Z=(0,I.useRef)({x:0,y:0});if(Z.current=P?{x:P.originX+i.x,y:P.originY+i.y}:{x:0,y:0},(0,I.useEffect)(()=>{let e=G?.parentElement;if(!e||typeof window>"u")return;let a=0,w=null,b=()=>{a=0;let y=w;if(!y)return;let Y=y.target;if(y.pointerType==="touch"||y.buttons!==0||Y?.closest("[data-graview-view], button, a, input, select, textarea, [data-graview-overlay], [data-graview-offstage]")){M(null);return}let v=e.getBoundingClientRect(),h=y.clientX-v.left-Z.current.x,x=y.clientY-v.top-Z.current.y,$=null,K=1/0;for(let ee of we.current){let ue=rt(ee.points,h,x);ue<=ee.reach&&ue<K&&(K=ue,$=ee.key)}M($)},r=y=>{w=y,a===0&&(a=requestAnimationFrame(b))},d=()=>M(null);return e.addEventListener("pointermove",r,{passive:!0}),e.addEventListener("pointerleave",d),()=>{a!==0&&cancelAnimationFrame(a),e.removeEventListener("pointermove",r),e.removeEventListener("pointerleave",d)}},[G]),!P||!p.overview)return null;let T=Fe(k,p,H);if(T.records.length>0||T.lens!==null)return null;let o=T.districts.length>0?de.filter(({ribbon:e})=>T.districts.includes(e.from)||T.districts.includes(e.to)):de;if(o.length===0&&A.length===0)return null;let c=R??null,l=o.find(({ribbon:e})=>e.key===W);we.current=o.map(({ribbon:e,points:a,width:w})=>({key:e.key,points:a,reach:w/2+6}));let f={x:P.originX+i.x,y:P.originY+i.y},m=`translate(${f.x.toFixed(1)} ${f.y.toFixed(1)})`;return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("svg",{ref:re,className:"graview-ribbons","aria-hidden":"true","data-graview-world":"","data-graview-ribbons":o.length,width:n,height:s,style:{position:"absolute",left:0,top:0,pointerEvents:"none",overflow:"visible"},children:(0,C.jsx)("g",{transform:m,children:o.map(({ribbon:e,d:a,width:w})=>{let b=W===e.key||c!==null&&c===e.edge||T.districts.length>0,r=c!==null&&c!==e.edge;return(0,C.jsx)("g",{className:"graview-ribbon","data-graview-ribbon":e.edge,"data-graview-from":`kind:${e.from}`,"data-graview-to":`kind:${e.to}`,"data-graview-links":e.links,"data-graview-lit":b&&!r?"":void 0,"data-graview-receded":r?"":void 0,children:(0,C.jsx)("path",{className:"graview-ribbon-band",d:a,style:{strokeWidth:w}})},e.key)})})}),l?(0,C.jsx)("div",{className:"graview-ribbon-said","data-graview-world":"","data-testid":"ribbon-said",role:"status",style:{position:"absolute",left:f.x+l.middle.x,top:f.y+l.middle.y,pointerEvents:"none"},children:Ce(u.schema,l.ribbon)}):null]})}function rt(t,n,s){let i=1/0;for(let u=1;u<t.length;u++){let g=t[u-1],k=t[u],p=k.x-g.x,R=k.y-g.y,j=p*p+R*R,E=j===0?0:Math.max(0,Math.min(1,((n-g.x)*p+(s-g.y)*R)/j));i=Math.min(i,Math.hypot(n-(g.x+E*p),s-(g.y+E*R)))}return i}export{dt as Ribbons,rt as distanceTo};
|
|
1
|
+
import{a as Ie}from"./chunk.HJCQ6I3S.js";import{a as Se,b as Fe,c as Te,d as Ce}from"./chunk.HXRV3WVJ.js";import"./chunk.TKUNRFDE.js";import{c as Me}from"./chunk.MQ5HBUBL.js";import"./chunk.3YZHZGTM.js";import"./chunk.EQTSV7BK.js";import"./chunk.27CW6SCT.js";import{G as Qe,T as Oe}from"./chunk.HT2BEOEV.js";import"./chunk.SDO3U72B.js";import"./chunk.7BBGRTXM.js";import"./chunk.FQLNBIQ5.js";import{b as Re}from"./chunk.AJZBJBMO.js";var I=Re(Qe(),1);var O=.5,fe=1,Pe=.76,Ne=3,Ze=3,Ae=.6;function et(t){let n=De(t);for(;;){let s=n.next();if(s.done)return s.value}}function*De(t){let{ribbons:n,plots:s,cell:i}=t,u=t.tilt??.5,g=t.labels??[],k=[...s.values()],p=new Map;if(k.length===0||i<=0)return p;let R=1/0,j=1/0,E=-1/0,W=-1/0;for(let o of k)R=Math.min(R,o.col),j=Math.min(j,o.row),E=Math.max(E,o.col+o.side),W=Math.max(W,o.row+o.side);R-=3,j-=3,E+=3,W+=3;let M=Math.round((E-R)/O)+1,P=Math.round((W-j)/O)+1,H=o=>R+o*O,_=o=>j+o*O,B=4,te=(o,c)=>{if(g.length===0)return!1;let l=Me(o,c,i,u);for(let f of g)if(l.x>f.x-B&&l.x<f.x+f.width+B&&l.y>f.y-B&&l.y<f.y+f.height+B)return!0;return!1},L=(o,c)=>{for(let l of k)if(o>l.col-Pe&&o<l.col+l.side+Pe&&c>l.row-Pe&&c<l.row+l.side+Pe)return!0;return!1},A=M*P,N=new Uint8Array(A),S=new Uint8Array(A),ne=new Uint8Array(A),oe=new Uint8Array(A),G=new Uint8Array(A),re=new Uint8Array(A),V=new Float32Array(A);for(let o=0;o<P;o++){let c=_(o);for(let l=0;l<M;l++){let f=H(l),m=o*M+l;if(S[m]=L(f,c)?0:1,N[m]=S[m]&&!te(f,c)?1:0,l+1<M){let a=f+O/2;oe[m]=L(a,c)?0:1,ne[m]=oe[m]&&!te(a,c)?1:0}if(o+1<P){let a=c+O/2;re[m]=L(f,a)?0:1,G[m]=re[m]&&!te(f,a)?1:0}let e=1/0;for(let a of k)e=Math.min(e,Math.max(0,a.col-f,f-(a.col+a.side),a.row-c,c-(a.row+a.side)));V[m]=e}}let J=(o,c)=>{let l=[],f=(e,a)=>{let w=[],b=Math.min(1,a/3);for(let r=Math.ceil((e+b)/O-1e-9)*O;r<=e+a-b+1e-9;r+=O)w.push(r);return w},m=(e,a,w,b)=>{let r=Math.round((e-R)/O),d=Math.round((a-j)/O);r>=0&&d>=0&&r<M&&d<P&&c[d*M+r]&&l.push({i:r,j:d,out:w,curb:b})};for(let e of f(o.row,o.side))m(o.col-fe,e,1,{col:o.col,row:e}),m(o.col+o.side+fe,e,0,{col:o.col+o.side,row:e});for(let e of f(o.col,o.side))m(e,o.row-fe,3,{col:e,row:o.row}),m(e,o.row+o.side+fe,2,{col:e,row:o.row+o.side});return l};yield;let se=new Uint8Array(A),ie=new Uint8Array(A),le=[[1,0],[-1,0],[0,1],[0,-1]],ae=[1,0,3,2],D=A*4,X=new Float64Array(D),F=[new Int32Array(D),new Int32Array(D)],U=new je,ge=(o,c,l,f,m)=>{let e=l?N:S,a=l?ne:oe,w=l?G:re,b=J(o,e),r=J(c,e),d=new Map(r.map(h=>[h.j*M+h.i,h]));if(b.length===0||r.length===0)return{reached:-1,best:1/0,starts:b,goal:d,back:f};let y=(h,x)=>{let $=H(h),K=_(x);return(Math.max(0,c.col-$,$-(c.col+c.side))+Math.max(0,c.row-K,K-(c.row+c.side)))*Ae};X.fill(1/0),f.fill(-1),U.clear();let Y=-1,v=1/0;for(let h of b){let x=(h.j*M+h.i)*4+h.out;X[x]=0,U.push(x,y(h.i,h.j))}for(;U.size>0;){let h=U.peekKey();if(h>=v||h>=m)break;let x=U.pop(),$=x>>2,K=x&3,ee=$%M,ue=($-ee)/M,Ee=d.get($);if(Ee){let q=X[x]+(K===ae[Ee.out]?0:Ne);q<v&&(v=q,Y=x);continue}for(let q=0;q<4;q++){let[pe,Be]=le[q],be=ee+pe,xe=ue+Be;if(be<0||xe<0||be>=M||xe>=P)continue;let ke=xe*M+be;if(!e[ke])continue;let Le=pe+Be>0?$:ke;if(!(pe!==0?a:w)[Le])continue;let _e=(pe!==0?se:ie)[Le]?Ae:1,Je=O*_e*(1+Math.max(0,V[ke]-Ze))+(q===K?0:Ne),ve=ke*4+q,$e=X[x]+Je;$e<X[ve]&&(X[ve]=$e,f[ve]=x,U.push(ve,$e+y(be,xe)))}}return{reached:Y,best:v,starts:b,goal:d,back:f}},Q=new Map;for(let o of n){let c=s.get(o.from),l=s.get(o.to);if(!c||!l||c===l)continue;let f=ge(c,l,!1,F[1],1/0);if(f.reached===-1){yield;continue}let m=ge(c,l,!0,F[0],1.3*f.best+2+Ae*fe+1e-9),e=m.reached!==-1&&m.best<=1.3*f.best+2?m:f;if(e.reached===-1)continue;let{reached:a,starts:w,goal:b,back:r}=e,d=[];for(let v=a;v!==-1;v=r[v]){let h=v>>2,x=d[d.length-1],$={i:h%M,j:Math.floor(h/M)};(!x||x.i!==$.i||x.j!==$.j)&&d.push($)}d.reverse();for(let v=1;v<d.length;v++){let h=d[v-1],x=d[v],$=h.i+h.j<x.i+x.j?h:x;(h.i!==x.i?se:ie)[$.j*M+$.i]=1}let y=w.find(v=>v.i===d[0].i&&v.j===d[0].j),Y=b.get(d[d.length-1].j*M+d[d.length-1].i);Q.set(o.key,{cells:d,start:y.curb,end:Y.curb}),yield}let ce=new Map(n.map(o=>[o.key,o.width])),de=new Map(n.map((o,c)=>[o.key,c])),we=i*u/Math.sqrt(1+u*u),Z=(o,c)=>o==="col"?`r${c.row.toFixed(2)}`:`c${c.col.toFixed(2)}`,T=new Map;for(let[o,c]of Q)for(let l=1;l<c.cells.length;l++){let f=c.cells[l-1],m=c.cells[l],e=Z(f.i!==m.i?"col":"row",{col:H(f.i),row:_(f.j)});T.set(e,(T.get(e)??new Set).add(o))}for(let[o,c]of Q){let l=[c.start,...c.cells.map(r=>({col:H(r.i),row:_(r.j)})),c.end],f=r=>r>=2&&r<=c.cells.length,m=[];for(let r=1;r<l.length;r++){let d=Math.abs(l[r].col-l[r-1].col)>1e-9?"col":"row",y=m[m.length-1];y&&y.axis===d?y.to=r:m.push({from:r-1,to:r,axis:d})}if(m.length===0)continue;let e=m.map(r=>{if(!Array.from({length:r.to-r.from},(h,x)=>f(r.from+1+x)).some(Boolean))return 0;let d=T.get(Z(r.axis,l[r.from]))??new Set;if(!d.has(o))return 0;let y=[...d].sort((h,x)=>(de.get(h)??0)-(de.get(x)??0)),v=-(y.reduce((h,x)=>h+(ce.get(x)??2)+2,0)-2)/2;for(let h of y){if(h===o)return(v+(ce.get(h)??2)/2)/we;v+=(ce.get(h)??2)+2}return 0}),a=r=>{let d=m[r],y=l[d.from];return d.axis==="col"?{row:y.row+e[r]}:{col:y.col+e[r]}},w=(r,d,y)=>({col:r.col??d.col??y.col,row:r.row??d.row??y.row}),b=[w(a(0),{},l[0])];for(let r=0;r+1<m.length;r++)b.push(w(a(r),a(r+1),l[m[r].to]));b.push(w(a(m.length-1),{},l[l.length-1])),p.set(o,b.map(r=>Me(r.col,r.row,i,u)))}return p}var je=class{items=[];keys=[];get size(){return this.items.length}clear(){this.items.length=0,this.keys.length=0}peekKey(){return this.keys[0]??1/0}push(n,s){this.items.push(n),this.keys.push(s);let i=this.items.length-1;for(;i>0;){let u=i-1>>1;if(this.keys[u]<=this.keys[i])break;this.swap(i,u),i=u}}pop(){let n=this.items[0],s=this.items.pop(),i=this.keys.pop();if(this.items.length>0){this.items[0]=s,this.keys[0]=i;let u=0;for(;;){let g=2*u+1,k=g+1,p=u;if(g<this.items.length&&this.keys[g]<this.keys[p]&&(p=g),k<this.items.length&&this.keys[k]<this.keys[p]&&(p=k),p===u)break;this.swap(u,p),u=p}}return n}swap(n,s){let i=this.items[n];this.items[n]=this.items[s],this.items[s]=i;let u=this.keys[n];this.keys[n]=this.keys[s],this.keys[s]=u}},tt=16,z=new Map,Ue=0;function me(t){let n=[...t.plots].map(([s,i])=>`${s}:${i.col},${i.row},${i.side}`).join(";");return`${t.ribbons.map(s=>`${s.key}>${s.from}>${s.to}>${s.width}`).join(";")}|${n}`}var nt=t=>t.map(n=>`${Math.round(n.x)},${Math.round(n.y)},${Math.round(n.width)},${Math.round(n.height)}`).join(";"),Ke=(t,n)=>`${n}|${t.cell}|${t.tilt??.5}|${nt(t.labels??[])}`;function qe(t,n,s){for(z.set(Ke(t,n),{ground:n,cell:t.cell,tilt:t.tilt??.5,runs:s});z.size>tt;)z.delete(z.keys().next().value)}function ye(t){let n=Ke(t,me(t)),s=z.get(n);if(s)return z.delete(n),z.set(n,s),s.runs}function ze(t){let n=ye(t);if(n)return n;Ue+=1;let s=et(t);return qe(t,me(t),s),s}function We(t,n,s=8){let i=ye(t);if(i)return n(i),()=>{};let u=me(t),g=De(t),k=!1,p;Ue+=1;let R=()=>{if(p=void 0,k)return;let j=performance.now();for(;;){let E=g.next();if(E.done){qe(t,u,E.value),n(E.value);return}if(performance.now()-j>=s)break}p=setTimeout(R,0)};return p=setTimeout(R,0),()=>{k=!0,p!==void 0&&clearTimeout(p)}}function Ge(t,n,s){let i;for(let g of z.values())g.ground===t&&g.tilt===s&&(i=g);if(!i||n<=0)return;if(i.cell===n)return i.runs;let u=n/i.cell;return new Map([...i.runs].map(([g,k])=>[g,k.map(p=>({x:p.x*u,y:p.y*u}))]))}function Ve(t,n){let s=t.col+t.side,i=s+.25+.22*Math.max(0,n),u=t.row+t.side*Math.max(.1,.3-.06*n),g=t.row+t.side*Math.min(.9,.7+.06*n);return[{col:s,row:u},{col:i,row:u},{col:i,row:g},{col:s,row:g}]}function Xe(t,n){return t.map(s=>Me(s.col,s.row,n.cell,n.tilt))}function Ye(t){return t.map((n,s)=>`${s===0?"M":"L"} ${n.x.toFixed(1)} ${n.y.toFixed(1)}`).join(" ")}function He(t){if(t.length===0)return{x:0,y:0};let n=0;for(let i=1;i<t.length;i++)n+=Math.hypot(t[i].x-t[i-1].x,t[i].y-t[i-1].y);let s=n/2;for(let i=1;i<t.length;i++){let u=t[i-1],g=t[i],k=Math.hypot(g.x-u.x,g.y-u.y);if(k>=s&&k>0)return{x:u.x+(g.x-u.x)*s/k,y:u.y+(g.y-u.y)*s/k};s-=k}return t[t.length-1]}var C=Re(Oe(),1),he=new Map,ot=(t,n)=>t.length===n.length&&t.every((s,i)=>Math.round(s.x)===Math.round(n[i].x)&&Math.round(s.y)===Math.round(n[i].y)&&Math.round(s.width)===Math.round(n[i].width)&&Math.round(s.height)===Math.round(n[i].height));function dt({frame:t,width:n,height:s,pan:i,store:u,graphVersion:g,selection:k,view:p,emphasis:R,hiddenKinds:j,drawn:E}){let[W,M]=(0,I.useState)(null),P=t.city,H=e=>u.graph.getNode(e)?.kind,_=(0,I.useMemo)(()=>Se(u.graph.allEdges(),e=>u.graph.getNode(e)?.kind),[u,g]),B=new Map;for(let e of t.nodes){let a=e.id.startsWith("kind:")?Te(e.id):null;a!==null&&e.plot&&Math.round(e.plane)===2&&B.set(a,e.plot)}let te=[...B].map(([e,a])=>`${e}:${a.col},${a.row},${a.side}`).join(";"),L=P?.cell??0,A=_.filter(e=>B.has(e.from)&&B.has(e.to)&&!j.has(e.from)&&!j.has(e.to)&&E(e.edge)),N=P?.tilt??.5,S=`${te}|${L}|${N}`,[ne,oe]=(0,I.useState)(null),[G,re]=(0,I.useState)(null),V=t.t>=1,J=!!P&&!!p.overview;(0,I.useLayoutEffect)(()=>{let e=G?.parentElement;if(!e||!P||!V)return;let a=e.getBoundingClientRect(),w=P.originX+i.x,b=P.originY+i.y,r=[...e.querySelectorAll('[data-graview-view^="kind:"] .graview-kind-face')].flatMap(d=>{let y=d.getBoundingClientRect();return y.width>0&&y.height>0?[{x:y.left-a.left-w,y:y.top-a.top-b,width:y.width,height:y.height}]:[]});for(he.set(S,r);he.size>16;)he.delete(he.keys().next().value);oe(d=>d?.cards===S&&ot(d.labels,r)?d:{cards:S,labels:r})},[G,V,S]);let se=Math.max(0,...A.map(e=>e.links)),ie=A.map(e=>({key:e.key,from:e.from,to:e.to,width:Ie(e.links,se)})),le=me({ribbons:ie,plots:B}),ae=typeof window>"u",D=ne?.cards===S?ne.labels:he.get(S)??(ae?[]:void 0),F=L>0&&J&&V&&D!==void 0?{ribbons:ie,plots:B,cell:L,tilt:N,labels:D}:null,[U,ge]=(0,I.useState)(0),Q=F!==null&&!ae&&ye(F)===void 0,ce=`${le}|${L}|${N}|${(D??[]).map(e=>`${Math.round(e.x)},${Math.round(e.y)},${Math.round(e.width)},${Math.round(e.height)}`).join(";")}`;(0,I.useEffect)(()=>{if(!(!Q||!F))return We(F,()=>ge(e=>e+1))},[Q,ce]);let de=(0,I.useMemo)(()=>{if(L===0||!J)return[];let e=F?ae?ze(F):ye(F):Ge(le,L,N);if(!e)return[];let a=new Map;return A.flatMap(w=>{let b;if(w.from===w.to){let r=a.get(w.from)??0;a.set(w.from,r+1),b=Xe(Ve(B.get(w.from),r),{cell:L,tilt:N})}else b=e.get(w.key);return!b||b.length<2?[]:[{ribbon:w,points:b,d:Ye(b),middle:He(b),width:Ie(w.links,se)}]})},[L,N,le,D,V,J,U]),we=(0,I.useRef)([]),Z=(0,I.useRef)({x:0,y:0});if(Z.current=P?{x:P.originX+i.x,y:P.originY+i.y}:{x:0,y:0},(0,I.useEffect)(()=>{let e=G?.parentElement;if(!e||typeof window>"u")return;let a=0,w=null,b=()=>{a=0;let y=w;if(!y)return;let Y=y.target;if(y.pointerType==="touch"||y.buttons!==0||Y?.closest("[data-graview-view], button, a, input, select, textarea, [data-graview-overlay], [data-graview-offstage]")){M(null);return}let v=e.getBoundingClientRect(),h=y.clientX-v.left-Z.current.x,x=y.clientY-v.top-Z.current.y,$=null,K=1/0;for(let ee of we.current){let ue=rt(ee.points,h,x);ue<=ee.reach&&ue<K&&(K=ue,$=ee.key)}M($)},r=y=>{w=y,a===0&&(a=requestAnimationFrame(b))},d=()=>M(null);return e.addEventListener("pointermove",r,{passive:!0}),e.addEventListener("pointerleave",d),()=>{a!==0&&cancelAnimationFrame(a),e.removeEventListener("pointermove",r),e.removeEventListener("pointerleave",d)}},[G]),!P||!p.overview)return null;let T=Fe(k,p,H);if(T.records.length>0||T.lens!==null)return null;let o=T.districts.length>0?de.filter(({ribbon:e})=>T.districts.includes(e.from)||T.districts.includes(e.to)):de;if(o.length===0&&A.length===0)return null;let c=R??null,l=o.find(({ribbon:e})=>e.key===W);we.current=o.map(({ribbon:e,points:a,width:w})=>({key:e.key,points:a,reach:w/2+6}));let f={x:P.originX+i.x,y:P.originY+i.y},m=`translate(${f.x.toFixed(1)} ${f.y.toFixed(1)})`;return(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)("svg",{ref:re,className:"graview-ribbons","aria-hidden":"true","data-graview-world":"","data-graview-ribbons":o.length,width:n,height:s,style:{position:"absolute",left:0,top:0,pointerEvents:"none",overflow:"visible"},children:(0,C.jsx)("g",{transform:m,children:o.map(({ribbon:e,d:a,width:w})=>{let b=W===e.key||c!==null&&c===e.edge||T.districts.length>0,r=c!==null&&c!==e.edge;return(0,C.jsx)("g",{className:"graview-ribbon","data-graview-ribbon":e.edge,"data-graview-from":`kind:${e.from}`,"data-graview-to":`kind:${e.to}`,"data-graview-links":e.links,"data-graview-lit":b&&!r?"":void 0,"data-graview-receded":r?"":void 0,children:(0,C.jsx)("path",{className:"graview-ribbon-band",d:a,style:{strokeWidth:w}})},e.key)})})}),l?(0,C.jsx)("div",{className:"graview-ribbon-said","data-graview-world":"","data-testid":"ribbon-said",role:"status",style:{position:"absolute",left:f.x+l.middle.x,top:f.y+l.middle.y,pointerEvents:"none"},children:Ce(u.schema,l.ribbon)}):null]})}function rt(t,n,s){let i=1/0;for(let u=1;u<t.length;u++){let g=t[u-1],k=t[u],p=k.x-g.x,R=k.y-g.y,j=p*p+R*R,E=j===0?0:Math.max(0,Math.min(1,((n-g.x)*p+(s-g.y)*R)/j));i=Math.min(i,Math.hypot(n-(g.x+E*p),s-(g.y+E*R)))}return i}export{dt as Ribbons,rt as distanceTo};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as B,b as ve}from"./chunk.
|
|
1
|
+
import{a as B,b as ve}from"./chunk.LRUNFSHP.js";import{a as ye,c as he,d as be,f as we}from"./chunk.S5MGE2U5.js";import{b as S,c as fe,d as me,j as ce,k as ge}from"./chunk.3YZHZGTM.js";import{b as pe,k as q}from"./chunk.EQTSV7BK.js";import{c as de,f as ue}from"./chunk.27CW6SCT.js";import{G as Re,T as se,ca as le,h as ae,u as ie}from"./chunk.HT2BEOEV.js";import{Ha as te,Sa as re,Ta as oe,da as Z,ga as ee,oa as ne}from"./chunk.7BBGRTXM.js";import{b as W}from"./chunk.AJZBJBMO.js";var l=W(Re(),1);var i=W(se(),1);function qe({affordance:n,onApply:a,onCancel:u,store:w}){let y=le(),s=w??y?.store,[x,_]=(0,l.useState)({}),[p,D]=(0,l.useState)(""),[I,F]=(0,l.useState)(G),[J,V]=(0,l.useState)(void 0),U=(0,l.useId)(),L=(0,l.useRef)(null),A=n.open.filter(e=>!(e.name in x)),o=A[0],v=s.allMutations().find(e=>e.name===n.mutation),P=(0,l.useMemo)(()=>De(v,s,n.args??{}),[v,s,n.args]),d=o?P[o.name]:void 0,E=ge(n.open.filter(e=>e.shape?.type==="date").map(e=>e.name)),Se=(()=>{if(!E||o?.name!==E.end||o.shape?.type!=="date")return;let e=x[E.start];if(typeof e!="string")return;let r=P[E.start];return ce(typeof r=="string"?r:void 0,e,typeof d=="string"?d:void 0,{time:o.shape.time===!0,instant:o.shape.instant===!0})})();(0,l.useEffect)(()=>{D(Se??ke(d,o?.shape)),F(Array.isArray(d)?d:G),V(d)},[o?.name]),(0,l.useEffect)(()=>{L.current?.scrollIntoView?.({block:"nearest",inline:"nearest"})},[o?.name]),(0,l.useLayoutEffect)(()=>{let e=L.current,r=typeof document>"u"?null:document.activeElement,f=r instanceof HTMLElement&&r.getAttribute("data-affordance")===n.id;if(!e||r&&r!==document.body&&!e.contains(r)&&!f)return;let b=e.querySelector('[data-testid="ask-filter"], form input, [role=group] button:not([disabled])');b&&b!==r&&b.focus()},[o?.name]);let Y=ve({flow:"both",letters:!0});if(!o)return null;let h=e=>{let r=d!==void 0&&JSON.stringify(e)===JSON.stringify(d)?void 0:e,f={...x,[o.name]:r};if(n.open.filter(R=>!(R.name in f)).length===0){let R=a(Object.fromEntries(Object.entries(f).filter(([,M])=>M!==void 0)));R&&R.length>0&&_(Object.fromEntries(Object.entries(f).filter(([M])=>!R.includes(M))))}else _(f)},O=o.optional?(0,i.jsx)("button",{type:"button",onClick:()=>h(void 0),style:{fontSize:"0.8125rem"},children:"Skip"}):null,t=o.shape??{type:"unknown"},c=t.type==="number"?t.amount:void 0,g=Ee(o,t),m=q(s.schema,v,o.name),Q=te((v?.input?.shape??{})[o.name]),xe=oe((v?.input?.shape??{})[o.name]),N=re(o.name),Ae=typeof d=="boolean"?d?"yes":"no":d,[T,Oe]=(0,l.useState)(""),X=(0,l.useMemo)(()=>{let e=g.map(r=>s.graph.getNode(r)).filter(r=>r!==void 0);return pe(e,r=>s.schema.tryDefinition(r))},[g,s]),j=e=>{let r=Ce(s,t,e),f=t.type==="choice"||t.type==="several"&&t.of.type==="choice"?m.option(e):r,b=X.get(e);return b?`${f} \xB7 ${b}`:f},$=(0,l.useMemo)(()=>{let e=T.trim().toLowerCase();return e===""?g:g.filter(r=>j(r).toLowerCase().includes(e))},[g,T,s,t,X]),k=t.type==="several",H=t.type==="file"?t:t.type==="several"&&t.of.type==="file"?t.of:void 0,K=k&&g.length===0,C=o.kinds&&o.kinds.length>0&&!o.kinds.includes("*")?o.kinds.map(e=>Z(ne(s.schema.tryDefinition(e),e))).join(" or "):m.label,Ne=n.open.length>1?`${C} \xB7 ${n.open.length-A.length+1} of ${n.open.length}`:C;return(0,i.jsxs)("div",{ref:L,"data-graview-asking":n.id,style:{display:"grid",gridTemplateColumns:"minmax(0, 1fr)",gap:4,padding:"5px 0 2px"},children:[n.open.length>1||g.length>0?(0,i.jsx)("span",{id:U,style:{fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:Ne}):null,g.length>z?(0,i.jsx)("input",{type:"search",value:T,onChange:e=>Oe(e.target.value),placeholder:`Filter ${g.length}\u2026`,"aria-label":`Filter ${C}`,"data-testid":"ask-filter",onKeyDown:e=>{if(e.key!=="ArrowDown"||e.metaKey||e.ctrlKey||e.altKey)return;let r=Y.ref.current?.querySelector(`[${B}][tabindex="0"]`);r&&(e.preventDefault(),r.focus())},style:{font:"inherit",fontSize:"0.8125rem",minWidth:0,padding:"3px 7px"}}):null,xe?(0,i.jsxs)("form",{style:{display:"grid",gap:4},onSubmit:e=>{e.preventDefault(),h(J??(d===void 0?void 0:null))},children:[(0,i.jsx)(be,{value:J,onChange:V,start:N?x[N]??P[N]:void 0,label:`${N?q(s.schema,v,N).label:m.label} repeats`,name:o.name}),(0,i.jsxs)("span",{style:{display:"flex",gap:4},children:[(0,i.jsx)("button",{type:"submit",style:{fontSize:"0.8125rem"},children:A.length>1?"Next":"Apply"}),O]})]}):Q?(0,i.jsxs)("div",{style:{display:"grid",gap:4},children:[(0,i.jsx)(he,{relation:Q,value:d,onChange:h,label:m.label}),O]}):H?(0,i.jsxs)("div",{style:{display:"grid",gap:4},children:[(0,i.jsx)(ye,{as:"control",value:d,onChange:h,several:k,image:H.image===!0,video:H.video===!0,label:m.label}),O]}):g.length>0?(0,i.jsxs)("div",{...Y,role:"group","aria-labelledby":U,style:{display:"flex",flexWrap:"wrap",gap:4},children:[$.slice(0,z).map(e=>{let r=k?I.includes(e):e===Ae;return(0,i.jsx)("button",{type:"button",[B]:"","aria-label":`${C}: ${j(e)}`,...k?{"aria-pressed":r}:r?{"aria-current":!0}:{},style:{padding:"3px 9px",fontSize:"0.8125rem",...r?{borderColor:"var(--graview-accent)",color:"var(--graview-accent)"}:{}},onClick:()=>k?F(f=>f.includes(e)?f.filter(b=>b!==e):[...f,e]):h(t.type==="boolean"?e==="yes":e),children:j(e)},e)}),$.length>z?(0,i.jsxs)("span",{"data-testid":"ask-more",style:{alignSelf:"center",fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:[$.length-z," more \u2014 type to narrow"]}):null,$.length===0?(0,i.jsxs)("span",{"data-testid":"ask-none",style:{alignSelf:"center",fontSize:"0.75rem",color:"var(--graview-ink-faint)"},children:["None of the ",g.length," match that."]}):null,k?(0,i.jsx)("button",{type:"button",disabled:I.length===0,style:{fontSize:"0.8125rem"},onClick:()=>{let e=I;F(G),h(e)},children:A.length>1?"Next":"Apply"}):null,O]}):(0,i.jsxs)("form",{style:{display:"flex",flexWrap:"wrap",gap:4},onSubmit:e=>{if(e.preventDefault(),d!==void 0&&p===ke(d,t)){h(void 0);return}if(K){h(p.split(/[,\n]/).map(r=>r.trim()).filter(Boolean));return}if(p.trim().length!==0){if(c){let r=me(p,c);r!==void 0&&h(r);return}h(t.type==="number"?t.duration?ue(p)??p:Number(p):p)}},children:[t.type==="text"&&t.long?(0,i.jsx)("textarea",{autoFocus:!0,name:o.name,"aria-label":m.label,placeholder:m.label,value:p,rows:4,onChange:e=>D(e.target.value),onKeyDown:e=>{e.key==="Escape"?u():e.key==="Enter"&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),e.currentTarget.form?.requestSubmit())},style:{flex:"1 1 100%",minWidth:0,font:"inherit",fontSize:"0.875rem",lineHeight:1.45,padding:"5px 8px",borderRadius:7,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)",resize:"vertical",fieldSizing:"content",minHeight:"5.5em",maxHeight:"40vh"}}):t.type==="date"?(0,i.jsx)(we,{autoFocus:!0,name:o.name,label:m.label,value:p===""?void 0:p,time:t.time===!0,instant:t.instant===!0,partial:t.partial===!0,onChange:e=>D(e??""),onCancel:u,boxStyle:{fontSize:"0.875rem",padding:"5px 8px",borderRadius:7,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)"}}):(0,i.jsx)("input",{autoFocus:!0,type:t.type==="number"&&!t.duration&&!c?"number":t.type==="text"&&t.holds==="phone"?"tel":"text",...c?{inputMode:"decimal","data-graview-amount":c.format??"unit"}:{},name:o.name,"aria-label":m.label,placeholder:K?`${m.label}, separated by commas`:c?`${m.label}, ${S(c).hint} \u2014 ${S(c).prefix??""}${S(c).placeholder}${S(c).suffix?` ${S(c).suffix}`:""}`:m.label,value:p,...t.type==="number"&&t.min!==void 0?{min:t.min}:{},...t.type==="number"&&t.max!==void 0?{max:t.max}:{},...t.type==="number"&&t.step!==void 0?{step:t.step}:{},onChange:e=>D(e.target.value),onKeyDown:e=>{e.key==="Escape"&&u()},style:{flex:1,minWidth:0,font:"inherit",fontSize:"0.875rem",padding:"5px 8px",borderRadius:7,border:"1px solid var(--graview-edge)",background:"var(--graview-panel)",color:"var(--graview-ink)"}}),(0,i.jsx)("button",{type:"submit",disabled:!K&&p.trim().length===0,style:{fontSize:"0.8125rem"},children:A.length>1?"Next":"Apply"}),O]})]})}var G=[];function De(n,a,u){let w=n?.derived?.act==="edit"&&n.subject?u[n.subject.arg]:void 0,y=typeof w=="string"?a.graph.getNode(w):void 0;return y?Object.fromEntries((n.writes??[]).filter(s=>y[s]!==void 0&&y[s]!==null).map(s=>[s,y[s]])):{}}function ke(n,a){return typeof n=="number"?a?.type==="number"&&a.amount?fe(n,a.amount):String(n):Array.isArray(n)?n.every(u=>typeof u=="string")?n.join(", "):"":typeof n!="string"?"":n}var z=10;function Ee(n,a){return n.candidates&&n.candidates.length>0?n.candidates:a.type==="choice"?a.options:a.type==="several"&&a.of.type==="choice"?a.of.options:a.type==="boolean"?$e:[]}var $e=["yes","no"];function Ce(n,a,u){return a.type==="boolean"||a.type==="choice"||a.type==="several"&&a.of.type==="choice"?u:ze(n,u)}function ze(n,a){let u=ae(a);if(u){let s=de(n.schema,n.graph.getNode(u.from)?.kind??"",u.kind,"out");return s.charAt(0).toUpperCase()+s.slice(1)}let w=ie(a);if(w.length>0)return w.map(s=>n.schema.tryDefinition(s)?.plural??`${s}s`).join(" + ");let y=n.graph.getNode(a);return y?ee(n.schema.tryDefinition(y.kind),y):a}export{qe as a,ze as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"./chunk.I3WWCPQ2.js";import"./chunk.BTVBZ6KE.js";import"./chunk.3OYGXYQY.js";import"./chunk.UAP5M3CD.js";import"./chunk.GCBZ3WE2.js";import"./chunk.GDOTG7YA.js";import"./chunk.EPPXZZPK.js";import"./chunk.KFQSYCY3.js";import"./chunk.WQOI6BLM.js";import"./chunk.LCPGZK7G.js";import"./chunk.NKC3JILT.js";import"./chunk.HEWVPXRE.js";import"./chunk.HJCQ6I3S.js";import"./chunk.HXRV3WVJ.js";import"./chunk.MQ5HBUBL.js";import"./chunk.7SQAKSJD.js";import"./chunk.43OKZU73.js";import"./chunk.WNSC3RWD.js";import"./chunk.ACYDJQRC.js";import"./chunk.S5MGE2U5.js";import"./chunk.34TW32TB.js";import"./chunk.LL2MLSPH.js";import"./chunk.EB4NVTJL.js";import"./chunk.VG7OWV2H.js";import"./chunk.KXPRILAO.js";import"./chunk.BB33TI4S.js";import"./chunk.2EDC63RI.js";import"./chunk.WVUJXDXZ.js";import"./chunk.LDAYDCUO.js";import"./chunk.KKNDX4JT.js";import"./chunk.GKSUTAIX.js";import"./chunk.5ICIMQE6.js";import"./chunk.QGV7H7RQ.js";import"./chunk.YIA2EDVF.js";import"./chunk.GZHZLJBF.js";import"./chunk.ELERUERU.js";import"./chunk.OJGHDWI6.js";import"./chunk.YHTE34RN.js";import"./chunk.3YZHZGTM.js";import"./chunk.EQTSV7BK.js";import"./chunk.27CW6SCT.js";import"./chunk.YD3TKV6P.js";import"./chunk.4KC35UNR.js";import"./chunk.HT2BEOEV.js";import"./chunk.SDO3U72B.js";import"./chunk.7BBGRTXM.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";export{b as declaredLensView,a as formatFor};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{g as F,l as b}from"./chunk.
|
|
1
|
+
import{g as F,l as b}from"./chunk.YIA2EDVF.js";function L(t,o){return o===1&&["every","some","sum","min","max","sort"].includes(t.fn)}function M(t){let o=new Set,e=new Set,r=[],s=[],a=new Set(F),i=(l,f)=>{switch(l.t){case"lit":return;case"ident":f||o.add(l.name);return;case"list":l.items.forEach(c=>i(c,f));return;case"member":i(l.object,f);return;case"unary":i(l.operand,f);return;case"binary":i(l.left,f),i(l.right,f);return;case"where":i(l.set,f),i(l.filter,!0);return;case"call":{e.add(l.fn);let c=(l.fn==="out"||l.fn==="in")&&l.args.length===2?l.args[1]:l.args[0],m=c?.t==="lit"&&typeof c.value=="string"?c.value:void 0;l.fn==="all"&&m&&r.push(m),(l.fn==="out"||l.fn==="in")&&m&&s.push(m),l.args.forEach((v,k)=>i(v,f||L(l,k)));return}}};return i(t,!1),{names:o,functions:e,unknownFunctions:[...e].filter(l=>!a.has(l)),sweeps:r,edges:s}}var p=class extends Error{constructor(e,r,s){super(`${e} (at character ${r+1} of "${s}")`);this.sentence=e;this.at=r;this.source=s}},D=["||","&&","==","!=","<=",">=","<",">","!","|","&","+","-","*","/","%","(",")","[","]",",","."],j={and:"&&",or:"||",not:"!"},T=2e3;function H(t){let o=[],e=0;for(;e<t.length;){let r=t[e];if(r===" "||r===" "||r===`
|
|
2
2
|
`||r==="\r"){e++;continue}if(r>="0"&&r<="9"){let a=e;for(;e<t.length&&/[0-9.]/.test(t[e]);)e++;let i=t.slice(a,e),l=Number(i);if(!Number.isFinite(l)||i.split(".").length>2)throw new p(`"${i}" is not a number`,a,t);o.push({k:"num",v:l,at:a});continue}if(r==="'"||r==='"'){let a=e++,i="";for(;e<t.length&&t[e]!==r;)t[e]==="\\"&&e+1<t.length&&e++,i+=t[e++];if(e>=t.length)throw new p("a quoted word is never closed",a,t);e++,o.push({k:"str",v:i,at:a});continue}if(/[A-Za-z_]/.test(r)){let a=e;for(;e<t.length&&/[A-Za-z0-9_]/.test(t[e]);)e++;let i=t.slice(a,e),l=Object.hasOwn(j,i)?j[i]:void 0;o.push(l?{k:"op",v:l,at:a}:{k:"id",v:i,at:a});continue}let s=D.find(a=>t.startsWith(a,e));if(!s)throw new p(`"${r}" is not part of the rule language`,e,t);o.push({k:"op",v:s,at:e}),e+=s.length}return o.push({k:"end",at:t.length}),o}function w(t){if(t.length>T)throw new p(`an expression may be at most ${T} characters`,0,t.slice(0,40));let o=H(t),e=0,r=()=>o[e],s=n=>{let d=r();return d.k==="op"&&d.v===n},a=n=>{let d=r();return d.k==="id"&&d.v===n},i=(n,d)=>{if(!s(n))throw new p(`expected ${d}`,r().at,t);e++},l=0,f=(n,d)=>{if(++l>64)throw new p("the expression nests too deeply",n,t);try{return d()}finally{l--}},c=(n,d)=>()=>{let g=d();for(;;){let y=r(),S=y.k==="op"?n.find(q=>q===y.v):y.k==="id"&&y.v==="in"&&n.includes("in")?"in":void 0;if(!S)return g;e++,g={t:"binary",op:S,left:g,right:d(),at:y.at}}},m=()=>{let n=r();if(n.k==="num")return e++,{t:"lit",value:n.v,at:n.at};if(n.k==="str")return e++,{t:"lit",value:n.v,at:n.at};if(n.k==="id"){if(e++,n.v==="true"||n.v==="false")return{t:"lit",value:n.v==="true",at:n.at};if(n.v==="null")return{t:"lit",value:null,at:n.at};if(s("(")){e++;let d=[];if(!s(")"))for(;;){if(d.push(h()),s(",")){e++;continue}break}return i(")",`")" to close ${n.v}(\u2026)`),{t:"call",fn:n.v,args:d,at:n.at}}return{t:"ident",name:n.v,at:n.at}}if(n.k==="op"&&n.v==="("){e++;let d=f(n.at,h);return i(")",'a ")"'),d}if(n.k==="op"&&n.v==="["){e++;let d=[];if(!s("]"))for(;;){if(d.push(h()),s(",")){e++;continue}break}return i("]",'a "]" to close the list'),{t:"list",items:d,at:n.at}}throw n.k==="end"?new p("the expression ends too soon",n.at,t):new p(`"${n.k==="op"?n.v:""}" cannot start a value here`,n.at,t)},v=()=>{let n=m();for(;;){if(s(".")){let d=r();e++;let g=r();if(g.k!=="id")throw new p('expected a field name after "."',g.at,t);e++,n={t:"member",object:n,name:g.v,at:d.at};continue}if(a("where")){let d=r().at;e++,n={t:"where",set:n,filter:f(d,h),at:d};continue}return n}},k=()=>{let n=r();return n.k==="op"&&(n.v==="!"||n.v==="-")?(e++,{t:"unary",op:n.v,operand:f(n.at,k),at:n.at}):v()},P=c(["*","/","%"],k),z=c(["+","-"],P),N=c(["&"],z),R=c(["|"],N),_=()=>{let n=R(),d=r(),g=d.k==="op"&&["==","!=","<","<=",">",">="].includes(d.v)?d.v:d.k==="id"&&d.v==="in"?"in":void 0;return g?(e++,{t:"binary",op:g,left:n,right:R(),at:d.at}):n},O=()=>{let n=r();return n.k==="op"&&n.v==="!"?(e++,{t:"unary",op:"!",operand:f(n.at,O),at:n.at}):_()},B=c(["&&"],O),I=c(["||"],B);function h(){return I()}let K=h();if(r().k!=="end")throw new p("there is more after the end of the expression",r().at,t);return K}function E(t){let o,e=-1,r=0;for(let s=0;s<t.length;s++){let a=t[s];if(o){a==="\\"?s++:a===o&&(o=void 0);continue}a==="'"||a==='"'?o=a:a==="("||a==="["?r++:a===")"||a==="]"?r--:a==="|"&&r===0&&(t[s+1]==="|"?s++:e=s)}if(e>0&&t.slice(e+1).trim()===x){let s=E(t.slice(0,e));if(s>=0)return s}return e}var x="capital",$=/\s*(?:'((?:[^'\\]|\\.)*)'|"((?:[^"\\]|\\.)*)")\s*(,|$)/y;function U(t){let o=E(t);if(o>=0){if(t.slice(o+1).trim()!==x)throw new u('only "capital" may follow another formatter, like {n | words | capital}');let e=t.slice(0,o);if(e.trim()===x)throw new u('"capital" is said once');return{...C(e),capital:!0}}return t.trim()===x?{args:[],capital:!0}:C(t)}function C(t){let o=t.indexOf(":"),e=(o>=0?t.slice(0,o):t).trim();if(!b.includes(e))throw new u(`"${e}" is not a formatter; use one of ${[...b,x].join(", ")}`);let r=[];if(o>=0&&e==="excerpt"){let s=t.slice(o+1).trim();if(!/^\d+$/.test(s)||Number(s)<20||Number(s)>1e3)throw new u("excerpt is told at most how many characters, 20 to 1000: {summary | excerpt: 80}");r.push(s)}else if(o>=0){let s=t.slice(o+1),a=0;for(;a<s.length;){$.lastIndex=a;let i=$.exec(s);if(!i)throw new u(`"${e}" is told quoted words, like ${e}: 'offer'`);if(r.push((i[1]??i[2]??"").replace(/\\(.)/g,"$1")),a=$.lastIndex,i[3]==="")break}}if(e==="plural"&&(r.length<1||r.length>2))throw new u("plural is told its noun, like {count | plural: 'offer'}, and its plural where English does not make it: plural: 'person', 'people'");if(e!=="plural"&&e!=="excerpt"&&r.length>0)throw new u(`"${e}" takes nothing after it`);return{format:e,args:r}}var u=class extends Error{constructor(e){super(e);this.sentence=e}};function Y(t){let o=[],e=0;for(;e<t.length;){let r=t.indexOf("{",e);if(r<0){o.push({text:t.slice(e)});break}r>e&&o.push({text:t.slice(e,r)});let s=t.indexOf("}",r);if(s<0)throw new u(`a "{" at character ${r+1} is never closed`);let a=t.slice(r+1,s),i=E(a),l=(i>=0?a.slice(0,i):a).trim(),f=i>=0?U(a.slice(i+1)):void 0,c=E(l);if(c>=0&&b.includes(l.slice(c+1).split(":")[0].trim()))throw new u('only "capital" may follow another formatter, like {n | words | capital}');o.push({expr:w(l),source:l,...f?.format?{format:f.format}:{},...f&&f.args.length>0?{formatArgs:f.args}:{},...f?.capital?{capital:!0}:{}}),e=s+1}return o}function A(t){let o=new Map;for(let[e,r]of Object.entries(t?.computed??{}))o.set(e,typeof r=="string"?{expr:r}:r);return o}function re(t){let o=A(t);if(o.size===0)return;let e=new Map;for(let[r,s]of o)try{e.set(r,w(s.expr))}catch(a){if(!(a instanceof p))throw a}return e}function Z(t,o,e=new Set){let r=A(t).get(o);if(!r||e.has(o))return!1;let s;try{s=w(r.expr)}catch{return!1}let a=M(s);if(a.edges.length>0||a.sweeps.length>0||[...a.functions].some(c=>c==="out"||c==="in"||c==="all"))return!1;let i=t.fields,l=c=>i instanceof Set?i.has(c):Object.hasOwn(i,c),f=new Set([...e,o]);return[...a.names].every(c=>l(c)||Z(t,c,f))}export{M as a,p as b,w as c,u as d,Y as e,A as f,re as g,Z as h};
|