graview 0.1.71 → 0.1.72

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (212) hide show
  1. package/dist/preview/chunk.2IOJNFCR.js +1 -0
  2. package/dist/preview/{chunk.5EQRIZ6I.js → chunk.2Q4ZXP7P.js} +1 -1
  3. package/dist/preview/{chunk.MEAUTBVM.js → chunk.2TTKQAWQ.js} +1 -1
  4. package/dist/preview/{chunk.6BBUTKFC.js → chunk.2YSE3SQN.js} +3 -3
  5. package/dist/preview/{chunk.CGRX6SDE.js → chunk.2ZPR6FRI.js} +1 -1
  6. package/dist/preview/chunk.3BE4SHZD.js +1 -0
  7. package/dist/preview/{chunk.TSZ2S3VG.js → chunk.43HWCHBN.js} +1 -1
  8. package/dist/preview/{chunk.TQ3MNB6K.js → chunk.45OLF6BK.js} +1 -1
  9. package/dist/preview/{chunk.ZY3NAJDM.js → chunk.47QWCVZD.js} +1 -1
  10. package/dist/preview/{chunk.WU6D3SPL.js → chunk.4A7BRBEA.js} +1 -1
  11. package/dist/preview/chunk.4EPCI6VY.js +1 -0
  12. package/dist/preview/{chunk.UZKBFI52.js → chunk.4PB5UFUJ.js} +1 -1
  13. package/dist/preview/{chunk.MKJV3BM5.js → chunk.4TDYDIIM.js} +1 -1
  14. package/dist/preview/{chunk.HXRHEPPJ.js → chunk.4VX7GPFS.js} +1 -1
  15. package/dist/preview/{chunk.OUF2QFZL.js → chunk.523X2YEQ.js} +1 -1
  16. package/dist/preview/{chunk.KBJ3UUER.js → chunk.53GQQETN.js} +1 -1
  17. package/dist/preview/{chunk.DHO3QZYK.js → chunk.5MKZTHU2.js} +1 -1
  18. package/dist/preview/{chunk.F5O3HR7X.js → chunk.5ZT4R227.js} +1 -1
  19. package/dist/preview/{chunk.LHCGC3K6.js → chunk.65SI77M7.js} +1 -1
  20. package/dist/preview/chunk.6ESAFTWB.js +1 -0
  21. package/dist/preview/chunk.6GUIFP2A.js +1 -0
  22. package/dist/preview/{chunk.D6ODKMOV.js → chunk.6GZYKHEN.js} +1 -1
  23. package/dist/preview/{chunk.F7KVEWFH.js → chunk.6YKKZI4H.js} +1 -1
  24. package/dist/preview/{chunk.Z2BCOZDZ.js → chunk.73RMM4W7.js} +1 -1
  25. package/dist/preview/{chunk.4O64QV2Y.js → chunk.7DCBIMOI.js} +1 -1
  26. package/dist/preview/chunk.7JE3J7H4.js +1 -0
  27. package/dist/preview/{chunk.RDUGUC7R.js → chunk.7QGDWAHH.js} +1 -1
  28. package/dist/preview/{chunk.7PWLRRUS.js → chunk.7VCYVCYM.js} +2 -2
  29. package/dist/preview/{chunk.GFBE4VNT.js → chunk.A4TBVXHQ.js} +1 -1
  30. package/dist/preview/{chunk.LDWWUKKX.js → chunk.A6LJPXJ3.js} +1 -1
  31. package/dist/preview/chunk.AAPXF6NP.js +1 -0
  32. package/dist/preview/{chunk.UJ7RTNT4.js → chunk.APUICV5Z.js} +1 -1
  33. package/dist/preview/chunk.ASNVH2G4.js +25 -0
  34. package/dist/preview/{chunk.OKHXXIMN.js → chunk.CJHCUHVN.js} +1 -1
  35. package/dist/preview/chunk.CUEPNS3Z.js +1 -0
  36. package/dist/preview/{chunk.H33XWGAY.js → chunk.CUJRWBPX.js} +1 -1
  37. package/dist/preview/{chunk.4YZ2A6SJ.js → chunk.D5PW6YWF.js} +3 -3
  38. package/dist/preview/chunk.DCIYOZYP.js +1 -0
  39. package/dist/preview/{chunk.3CLTABGP.js → chunk.DEBW4FH6.js} +1 -1
  40. package/dist/preview/{chunk.UQZ2P6KD.js → chunk.DYPSFTRP.js} +1 -1
  41. package/dist/preview/{chunk.BWMPC7LK.js → chunk.E6QZUT4L.js} +1 -1
  42. package/dist/preview/{chunk.MEBKTW7H.js → chunk.E7QZZRAQ.js} +1 -1
  43. package/dist/preview/chunk.EHCMBAZO.js +3 -0
  44. package/dist/preview/chunk.EXTD5JWD.js +1 -0
  45. package/dist/preview/{chunk.S2BMI23H.js → chunk.EZF2T3XQ.js} +1 -1
  46. package/dist/preview/chunk.EZSST3IU.js +1 -0
  47. package/dist/preview/{chunk.7THS3DLZ.js → chunk.F2BZ4SC4.js} +1 -1
  48. package/dist/preview/chunk.F2I7ERGM.js +1 -0
  49. package/dist/preview/{chunk.VUDNQOOX.js → chunk.FCV3NX6L.js} +1 -1
  50. package/dist/preview/{chunk.QVBP4UZG.js → chunk.FFTBUXKX.js} +2 -2
  51. package/dist/preview/{chunk.7MDGPTYF.js → chunk.FILBI7XA.js} +1 -1
  52. package/dist/preview/{chunk.D4F6QX5L.js → chunk.FKSI5522.js} +1 -1
  53. package/dist/preview/{chunk.QNWGDG2Z.js → chunk.FQ2QUDZS.js} +1 -1
  54. package/dist/preview/{chunk.O5RPSUXV.js → chunk.G2ZDDO3C.js} +1 -1
  55. package/dist/preview/{chunk.IPKODEOZ.js → chunk.GAVEWSXU.js} +1 -1
  56. package/dist/preview/chunk.GH6QX7JR.js +87 -0
  57. package/dist/preview/chunk.GMHBAS45.js +1 -0
  58. package/dist/preview/{chunk.OYMN3IFX.js → chunk.GXK5PI7I.js} +1 -1
  59. package/dist/preview/{chunk.DDSAFU3B.js → chunk.GYP3EF6Z.js} +1 -1
  60. package/dist/preview/chunk.H2RVMT4Y.js +111 -0
  61. package/dist/preview/chunk.HCHGKI64.js +1 -0
  62. package/dist/preview/chunk.HE7SAJKZ.js +1 -0
  63. package/dist/preview/{chunk.JLNTE5CH.js → chunk.HIIYDKFC.js} +2 -2
  64. package/dist/preview/chunk.HPDUGKEF.js +32 -0
  65. package/dist/preview/{chunk.H4BPTMED.js → chunk.HQRPOGTS.js} +1 -1
  66. package/dist/preview/chunk.HUJLELZ3.js +1 -0
  67. package/dist/preview/chunk.HVRUHRXR.js +1 -0
  68. package/dist/preview/{chunk.QJJWAYHB.js → chunk.I46VNAMS.js} +1 -1
  69. package/dist/preview/{chunk.QK4QZVQG.js → chunk.ID4GOKT6.js} +1 -1
  70. package/dist/preview/{chunk.64K5ELSQ.js → chunk.IZKCTF2R.js} +1 -1
  71. package/dist/preview/{chunk.4HU2ILFY.js → chunk.IZUAZ6EV.js} +1 -1
  72. package/dist/preview/{chunk.5PQV7GFE.js → chunk.J3CUBMUZ.js} +1 -1
  73. package/dist/preview/{chunk.P43LPXXJ.js → chunk.J4D4BIB4.js} +1 -1
  74. package/dist/preview/{chunk.NI4OPHTL.js → chunk.J7GH2CGV.js} +1 -1
  75. package/dist/preview/{chunk.5WCSQFS5.js → chunk.JE4RBRKH.js} +1 -1
  76. package/dist/preview/{chunk.ARGEGV5T.js → chunk.JJSZLCNU.js} +1 -1
  77. package/dist/preview/{chunk.WS5ORRGS.js → chunk.JKX4J3KG.js} +1 -1
  78. package/dist/preview/{chunk.ZONRIOIA.js → chunk.JMXBMLKH.js} +1 -1
  79. package/dist/preview/{chunk.6ZRVVRDQ.js → chunk.JOB3EKS6.js} +1 -1
  80. package/dist/preview/{chunk.PQTXM4VY.js → chunk.JP33TNCH.js} +1 -1
  81. package/dist/preview/{chunk.Z3TK2LJM.js → chunk.K6EN2YR4.js} +1 -1
  82. package/dist/preview/chunk.K6YKXTKC.js +1 -0
  83. package/dist/preview/{chunk.VPFUOTY7.js → chunk.KAIZDIRK.js} +1 -1
  84. package/dist/preview/{chunk.KZUHXOZU.js → chunk.KAQGSLC6.js} +3 -3
  85. package/dist/preview/{chunk.WGH2P2YL.js → chunk.KFYSKZC4.js} +1 -1
  86. package/dist/preview/chunk.KHVW6Q3T.js +1 -0
  87. package/dist/preview/chunk.KMFH26SS.js +1 -0
  88. package/dist/preview/{chunk.67S2UWBT.js → chunk.L3ST2YKI.js} +1 -1
  89. package/dist/preview/{chunk.V5JB5UJS.js → chunk.L6BLZJ6K.js} +1 -1
  90. package/dist/preview/{chunk.MQNW3O67.js → chunk.LG2BQ5LB.js} +1 -1
  91. package/dist/preview/{chunk.T6KOL7TW.js → chunk.LLYHHG67.js} +1 -1
  92. package/dist/preview/{chunk.MWWNKM3I.js → chunk.LPWANRBL.js} +1 -1
  93. package/dist/preview/{chunk.EJC7ACZT.js → chunk.LSS64NAA.js} +1 -1
  94. package/dist/preview/{chunk.NH3VXTGX.js → chunk.MFNWHXGL.js} +1 -1
  95. package/dist/preview/{chunk.DG3YNOH3.js → chunk.MNH3WUAB.js} +1 -1
  96. package/dist/preview/chunk.MQ7AB5N4.js +1 -0
  97. package/dist/preview/{chunk.KJPLX72N.js → chunk.MU5JK5TK.js} +1 -1
  98. package/dist/preview/{chunk.L6P55HFW.js → chunk.N5CACZ5F.js} +1 -1
  99. package/dist/preview/{chunk.W3TJF4EH.js → chunk.NFC2TYA6.js} +1 -1
  100. package/dist/preview/{chunk.VL3YDD7D.js → chunk.NKRDVOLJ.js} +1 -1
  101. package/dist/preview/{chunk.SGYZM6ZU.js → chunk.NNK2E2EP.js} +1 -1
  102. package/dist/preview/{chunk.W332P5T3.js → chunk.NVPKYWMF.js} +1 -1
  103. package/dist/preview/{chunk.EEGVI266.js → chunk.NWJ7ELHN.js} +1 -1
  104. package/dist/preview/{chunk.7KX36ENH.js → chunk.O5P6LXHF.js} +1 -1
  105. package/dist/preview/{chunk.DX7RGK5G.js → chunk.OFK6673S.js} +1 -1
  106. package/dist/preview/{chunk.HPFEYMGP.js → chunk.OG6FEP3K.js} +1 -1
  107. package/dist/preview/{chunk.EA2KYBBR.js → chunk.OHGAZ3D5.js} +1 -1
  108. package/dist/preview/{chunk.SPJ34VHA.js → chunk.ONVYKLRX.js} +1 -1
  109. package/dist/preview/chunk.OQ3FKUP2.js +1 -0
  110. package/dist/preview/chunk.OUJV4CYS.js +1 -0
  111. package/dist/preview/{chunk.CVN2XFMF.js → chunk.OWHH7JDV.js} +1 -1
  112. package/dist/preview/{chunk.G767NLBH.js → chunk.OXDCGGZV.js} +1 -1
  113. package/dist/preview/{chunk.VVIQSFM4.js → chunk.P3Z4ZCL3.js} +1 -1
  114. package/dist/preview/{chunk.FNSVGSZI.js → chunk.PF7XQ5R5.js} +1 -1
  115. package/dist/preview/chunk.PH547SON.js +1 -0
  116. package/dist/preview/{chunk.N3MXLORL.js → chunk.PS765ODQ.js} +1 -1
  117. package/dist/preview/{chunk.NXHEOHRR.js → chunk.PVAYYFT2.js} +1 -1
  118. package/dist/preview/{chunk.Z22C2JJ4.js → chunk.Q6WOIE5I.js} +1 -1
  119. package/dist/preview/{chunk.CEJIH3CN.js → chunk.QE257AXE.js} +1 -1
  120. package/dist/preview/chunk.QKNC5OUC.js +1 -0
  121. package/dist/preview/{chunk.W6L2VAJG.js → chunk.QMGBAKX6.js} +1 -1
  122. package/dist/preview/{chunk.DJGZOPAS.js → chunk.QNFX5VHW.js} +1 -1
  123. package/dist/preview/chunk.QPCDAQTW.js +1 -0
  124. package/dist/preview/{chunk.Y5WQD6KV.js → chunk.QPTQIGLX.js} +1 -1
  125. package/dist/preview/{chunk.IXYG65TM.js → chunk.R5YGW5ZX.js} +1 -1
  126. package/dist/preview/{chunk.7FI75ZVE.js → chunk.RJ6KEVZC.js} +1 -1
  127. package/dist/preview/{chunk.OVSKPBPS.js → chunk.RKVMRP7B.js} +1 -1
  128. package/dist/preview/{chunk.7TACFS7Q.js → chunk.S7U2CHHG.js} +1 -1
  129. package/dist/preview/{chunk.HT35PAHI.js → chunk.SD2UYSV6.js} +2 -2
  130. package/dist/preview/{chunk.LQ5J6YQW.js → chunk.SI5GGFQR.js} +1 -1
  131. package/dist/preview/{chunk.U5KJQFAP.js → chunk.SMF5S4DQ.js} +1 -1
  132. package/dist/preview/{chunk.RO3D2RNP.js → chunk.SNDFIJVX.js} +1 -1
  133. package/dist/preview/{chunk.CEOQY5KS.js → chunk.STHWM422.js} +2 -2
  134. package/dist/preview/{chunk.X7U3JMBR.js → chunk.SV75TRCH.js} +1 -1
  135. package/dist/preview/{chunk.Q6GEPVQ7.js → chunk.SXGPRFA4.js} +1 -1
  136. package/dist/preview/{chunk.6TBQV3NO.js → chunk.T3RFZ66S.js} +1 -1
  137. package/dist/preview/{chunk.VGYG2IBZ.js → chunk.T6ISUVUP.js} +1 -1
  138. package/dist/preview/{chunk.L3MLGFIS.js → chunk.TBLOBXZ2.js} +1 -1
  139. package/dist/preview/{chunk.MT252WP4.js → chunk.TDWJU6GW.js} +1 -1
  140. package/dist/preview/{chunk.EPSYX2SF.js → chunk.THLT6NVO.js} +1 -1
  141. package/dist/preview/{chunk.W5O5F4FT.js → chunk.TQCVEKPH.js} +1 -1
  142. package/dist/preview/{chunk.4ZEHLUXV.js → chunk.TQF5XCUS.js} +1 -1
  143. package/dist/preview/{chunk.VICBF3MQ.js → chunk.TWXYI5AP.js} +1 -1
  144. package/dist/preview/{chunk.LNKY6MT4.js → chunk.UOUQZYVD.js} +1 -1
  145. package/dist/preview/{chunk.FIUPDGUZ.js → chunk.UPL3D3ZO.js} +1 -1
  146. package/dist/preview/{chunk.GFOZVQBQ.js → chunk.UXW43HNW.js} +1 -1
  147. package/dist/preview/{chunk.MM7MLBGB.js → chunk.V4GSVXSV.js} +1 -1
  148. package/dist/preview/chunk.VCEDSOAK.js +1 -0
  149. package/dist/preview/{chunk.3RRK6UTN.js → chunk.VE4AQFLW.js} +1 -1
  150. package/dist/preview/{chunk.QDDDKEBH.js → chunk.VGQDPEB5.js} +1 -1
  151. package/dist/preview/{chunk.XTHSPLZZ.js → chunk.VMYXBFPE.js} +1 -1
  152. package/dist/preview/{chunk.EHLV3LND.js → chunk.VNI6HZEF.js} +2 -2
  153. package/dist/preview/chunk.VQRY2NQ6.js +1 -0
  154. package/dist/preview/{chunk.MFMC35ET.js → chunk.VUE6ILQV.js} +1 -1
  155. package/dist/preview/{chunk.BSWR5SGX.js → chunk.W2VSEEKX.js} +1 -1
  156. package/dist/preview/{chunk.4QMAYVPU.js → chunk.WAPY4RCS.js} +1 -1
  157. package/dist/preview/chunk.WFRSGGU5.js +1 -0
  158. package/dist/preview/{chunk.QKRQPUCE.js → chunk.WIVNFOQR.js} +1 -1
  159. package/dist/preview/chunk.WRIBFLVG.js +1 -0
  160. package/dist/preview/{chunk.RHIP2UYE.js → chunk.WWD2TS47.js} +1 -1
  161. package/dist/preview/{chunk.7XGU6KVF.js → chunk.WWFOQDPR.js} +2 -2
  162. package/dist/preview/{chunk.JNK5WBSU.js → chunk.X5MCAUFX.js} +1 -1
  163. package/dist/preview/{chunk.G5AF5IXL.js → chunk.XBWFQ54R.js} +1 -1
  164. package/dist/preview/{chunk.7LPHWJB4.js → chunk.XMBGT6UT.js} +1 -1
  165. package/dist/preview/{chunk.FOHZPYUV.js → chunk.XP4IVKKR.js} +1 -1
  166. package/dist/preview/chunk.XYBWBMNU.js +1 -0
  167. package/dist/preview/{chunk.OPMGQS5J.js → chunk.YC2IDHQX.js} +1 -1
  168. package/dist/preview/{chunk.JAPTTM6Y.js → chunk.YCYJHPWS.js} +1 -1
  169. package/dist/preview/{chunk.T6UJEXFL.js → chunk.YF5GCOSZ.js} +1 -1
  170. package/dist/preview/{chunk.VDFQFLTU.js → chunk.YGGBGHZU.js} +1 -1
  171. package/dist/preview/{chunk.U6V4KZF5.js → chunk.YRC6PKXP.js} +1 -1
  172. package/dist/preview/{chunk.EJIQDMLU.js → chunk.YRN67Z5K.js} +1 -1
  173. package/dist/preview/{chunk.6L6RUOSF.js → chunk.ZDUKVXBI.js} +1 -1
  174. package/dist/preview/index.html +55 -55
  175. package/dist/preview/page.js +2 -2
  176. package/package.json +6 -6
  177. package/dist/preview/chunk.23DATB5Y.js +0 -1
  178. package/dist/preview/chunk.2INDKSJI.js +0 -1
  179. package/dist/preview/chunk.45HUV56Z.js +0 -1
  180. package/dist/preview/chunk.4LWWXIM4.js +0 -1
  181. package/dist/preview/chunk.4UDST6IF.js +0 -1
  182. package/dist/preview/chunk.6A3KTD66.js +0 -1
  183. package/dist/preview/chunk.6IMRCKB4.js +0 -1
  184. package/dist/preview/chunk.7ZLCA3WK.js +0 -1
  185. package/dist/preview/chunk.CPK6CYKN.js +0 -111
  186. package/dist/preview/chunk.DGYWNM5U.js +0 -1
  187. package/dist/preview/chunk.EOSN5DWW.js +0 -1
  188. package/dist/preview/chunk.EUXAIG73.js +0 -1
  189. package/dist/preview/chunk.EZQK23AB.js +0 -1
  190. package/dist/preview/chunk.F6MY6WJ4.js +0 -1
  191. package/dist/preview/chunk.FW6M6GIU.js +0 -32
  192. package/dist/preview/chunk.GKYJQE5A.js +0 -1
  193. package/dist/preview/chunk.HLKDYI6J.js +0 -1
  194. package/dist/preview/chunk.IZDB777E.js +0 -1
  195. package/dist/preview/chunk.JCKIJSW7.js +0 -25
  196. package/dist/preview/chunk.JREA2XDG.js +0 -1
  197. package/dist/preview/chunk.MJ4T6YXI.js +0 -1
  198. package/dist/preview/chunk.ML4X7VVK.js +0 -1
  199. package/dist/preview/chunk.NNGG7RCO.js +0 -1
  200. package/dist/preview/chunk.OOQG2AEF.js +0 -1
  201. package/dist/preview/chunk.RJ7VSWTA.js +0 -87
  202. package/dist/preview/chunk.RSMCTI2N.js +0 -1
  203. package/dist/preview/chunk.TBEKEHFS.js +0 -1
  204. package/dist/preview/chunk.TO3ZKCA2.js +0 -1
  205. package/dist/preview/chunk.TTM5GQ2U.js +0 -1
  206. package/dist/preview/chunk.TUBY6SV3.js +0 -1
  207. package/dist/preview/chunk.UJPX3BUV.js +0 -1
  208. package/dist/preview/chunk.X2UYEA7H.js +0 -1
  209. package/dist/preview/chunk.XSM4OTF4.js +0 -1
  210. package/dist/preview/chunk.YXVUJ3NB.js +0 -1
  211. package/dist/preview/chunk.ZGLOXN7O.js +0 -1
  212. package/dist/preview/chunk.ZLQIGZXO.js +0 -3
@@ -1,2 +1,2 @@
1
- import{a as Ae}from"./chunk.BJUUSIQY.js";import{a as X}from"./chunk.U5KJQFAP.js";import{Bc as Se,Jd as $e,Tb as be,ha as B,ma as he,pa as W,pc as we,sa as ke,va as _,zc as Q}from"./chunk.6L6RUOSF.js";import{j as H}from"./chunk.FQLNBIQ5.js";var M=e=>e.trim().toLowerCase(),U=e=>e.charAt(0).toUpperCase()+e.slice(1),le=e=>/^(?:[aeio]|u(?![sn]i|se|ser))/i.test(e),ee=e=>`${le(e)?"an":"a"} ${e}`,xe=e=>M(e).replace(/[^a-z0-9]+([a-z0-9])/g,(n,r)=>r.toUpperCase()).replace(/[^A-Za-z0-9]/g,""),se=e=>M(e).replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,""),ae=new Set(["person","people","someone","somebody","user","users","member","members"]);function de(e,n){let r=M(n);return Object.entries(e.kinds).find(([f,d])=>[f,d.noun,d.plural].some(c=>c!==void 0&&M(c)===r))?.[0]}function K(e,n){if(!e(n))return n;for(let r=2;;r++)if(!e(`${n}${r}`))return`${n}${r}`}function Fe(e,n){let r=e.acts??{},f=m=>m in r;if("link"in n){let m=de(e,n.link.on);if(!m)return{refused:`This app has no ${n.link.on} to give it to.`};let k=e.kinds[m],C=M(k.noun??m),v=M(n.link.called)||"linked to",u=de(e,n.link.to)??(ae.has(M(n.link.to))?(Object.entries(e.kinds).find(([,T])=>T.people)??Object.entries(e.kinds).find(([T,P])=>[T,P.noun,P.plural].some(t=>t!==void 0&&ae.has(M(t)))))?.[0]:void 0),A=[],j=[],$,F=u===void 0;if(!u){let T=M(n.link.to)||"person",P=ae.has(T),t=P?"person":T.replace(/s$/,""),a=P?"people":`${t}s`;u=K(b=>b in e.kinds,se(t)),A.push({op:"add-kind",kind:u,noun:t,plural:a,fields:{name:{type:"string",required:!0}},label:"{name}"}),$=K(f,`add-${u}`),j.push(`Add ${ee(U(a))} list.`)}let i=u in e.kinds?e.kinds[u]:A[0],y=M(i.noun??u),S=K(T=>T in(k.edges??{})||T in(k.fields??{}),xe(v)||"linkedTo");A.push({op:"add-relation",kind:m,relation:S,to:[u],cardinality:"one",description:U(v)});let R=K(f,`set-${se(v)}`);return A.push({op:"add-act",act:R,title:`Set \u201C${U(v)}\u201D`,on:m,connects:S,description:`Say who ${ee(C)} is ${v}.`}),j.push(`Give each ${C} ${le(v)?"an":"a"} \u201C${U(v)}\u201D field that points to ${ee(y)}.`),{edits:A,steps:j,on:m,relation:S,to:u,made:F,act:R,arg:"to",...$?{makes:$}:{},called:v}}let d=de(e,n.field.on);if(!d)return{refused:`This app has no ${n.field.on} to give it to.`};let c=e.kinds[d],g=M(c.noun??d),p=M(n.field.called)||"note",l=n.field.type??"string",s=K(m=>m in(c.fields??{})||m in(c.edges??{}),xe(p)||"note"),o=K(f,`set-${se(p)}`);return{edits:[{op:"add-field",kind:d,field:s,spec:{type:l}},{op:"add-act",act:o,title:`Set \u201C${U(p)}\u201D`,on:d,args:{value:{type:l,required:!0}},sets:{[s]:"$value"},description:`Say ${ee(g)}'s ${p}.`}],steps:[`Give each ${g} ${le(p)?"an":"a"} \u201C${U(p)}\u201D field.`],on:d,field:s,act:o,arg:"value",called:p}}var Re=["search-miss","unanswered","refused","tool-invalid"];var qe=new RegExp("[\\u0000-\\u001f\\u007f-\\u009f\\u200b-\\u200f\\u2028-\\u202e\\u2066-\\u2069]","g");var G=e=>e.onBehalfOf?G(e.onBehalfOf):e.id!==void 0?`${e.kind}:${e.id}`:`${e.kind}:?`,ce=e=>e.toLowerCase().replace(/\s+/g," ").replace(/^[\s\p{P}]+|[\s\p{P}]+$/gu,"");var Ce=new Set("a an and are at be by can do does for from has have how i in is it me my of on or our the their there this to was we what when where which who why will with you your".split(" "));function J(e,n,r,f,d){let c=new Map;for(let g of e){let p=n(g);if(p===void 0)continue;let l=c.get(p)??{first:g,people:new Set,times:0,last:g};l.people.add(G(g.by)),l.times+=1,l.last=g,c.set(p,l)}return[...c.entries()].filter(([,g])=>g.people.size>=f).sort(([g,p],[l,s])=>s.people.size-p.people.size||s.times-p.times||g.localeCompare(l)).slice(0,d).map(([g,p])=>({...r(p.last,g),people:p.people.size,times:p.times}))}function je(e,n={}){let r=Math.max(1,n.minPeople??2),f=n.most??12,d=n.reader?G(n.reader):void 0,c=e.filter(s=>!$e(s.by)&&(d===void 0||G(s.by)!==d)),g=Object.fromEntries(Re.map(s=>{let o=c.filter(m=>m.type===s);return[s,{events:o.length,people:new Set(o.map(m=>G(m.by))).size}]})),p=[],l=new Map;for(let s of c){let o=s.type==="search-miss"?s.words:s.type==="unanswered"?s.question:void 0;if(o!==void 0)for(let m of new Set(ce(o).split(/[^\p{L}\p{N}]+/u))){if(m.length<3||Ce.has(m))continue;let k={...s,id:`${s.id}:${m}`};p.push(k),l.set(k,m)}}return{events:c.length,people:new Set(c.map(s=>G(s.by))).size,byType:g,searches:J(c,s=>s.type==="search-miss"&&ce(s.words)||void 0,(s,o)=>({words:o}),r,f),questions:J(c,s=>s.type==="unanswered"&&ce(s.question)||void 0,(s,o)=>({question:o,...s.lacks?{lacks:s.lacks}:{}}),r,f),words:J(p,s=>l.get(s),(s,o)=>({word:o}),r,f),refusals:J(c,s=>s.type==="refused"?`${s.act}|${s.code}`:void 0,s=>({act:s.act,code:s.code}),r,f),tools:J(c,s=>s.type==="tool-invalid"?`${s.tool}|${s.act??""}`:void 0,s=>{let o=s;return{tool:o.tool,...o.act?{act:o.act}:{},...o.then?{then:o.then}:{}}},1,f)}}var ve=e=>e.length>3&&e.endsWith("s")&&!e.endsWith("ss")?e.slice(0,-1):e;function Ee(e){let n=new Set,r=f=>{for(let d of f.toLowerCase().split(/[^\p{L}\p{N}]+/u))d.length>0&&n.add(ve(d))};for(let f of e.kinds){let d=e.tryDefinition(f);r(f),r(_(d,f)),r(W(e,f));for(let c of[...d?.aliases??[],...Object.values(d?.fieldAliases??{}).flat()])r(c);for(let c of Object.keys(d?.fields?.shape??{}))r(c),r(B(c))}return n}function Oe(e,n,r={}){let f=je(e,{most:8,...r}),d=Ee(n),c=f.searches.filter(o=>!o.words.split(/[^\p{L}\p{N}]+/u).some(m=>m.length>0&&d.has(ve(m)))).map(o=>({words:o.words,people:o.people})),g=f.questions.map(o=>({question:o.question,people:o.people,...o.lacks?{lacks:o.lacks}:{}})),p=f.tools.map(o=>({tool:o.tool,...o.act?{act:o.act}:{},...o.then?{then:o.then}:{},times:o.times})),l=o=>`${o} ${o===1?"person":"people"}`;return{said:[...c.length>0?[`Searched for, found nothing, and nothing here is called it: ${c.map(o=>`\u201C${o.words}\u201D (${l(o.people)})`).join(", ")}.`]:[],...g.length>0?[`Asked and not answered: ${g.map(o=>`\u201C${o.question}\u201D (${l(o.people)}${o.lacks?`; ${o.lacks.replace(/[.!]$/,"")}`:""})`).join(", ")}.`]:[],...p.length>0?[`Tool calls refused as invalid: ${p.map(o=>`${o.tool}${o.act?` (${o.act})`:""} ${o.times===1?"once":`${o.times} times`}${o.then?`, then worked as ${o.then}`:""}`).join("; ")}.`]:[]].join(`
1
+ import{a as Ae}from"./chunk.BJUUSIQY.js";import{a as X}from"./chunk.SMF5S4DQ.js";import{Bc as Se,Jd as $e,Tb as be,ha as B,ma as he,pa as W,pc as we,sa as ke,va as _,zc as Q}from"./chunk.ZDUKVXBI.js";import{j as H}from"./chunk.FQLNBIQ5.js";var M=e=>e.trim().toLowerCase(),U=e=>e.charAt(0).toUpperCase()+e.slice(1),le=e=>/^(?:[aeio]|u(?![sn]i|se|ser))/i.test(e),ee=e=>`${le(e)?"an":"a"} ${e}`,xe=e=>M(e).replace(/[^a-z0-9]+([a-z0-9])/g,(n,r)=>r.toUpperCase()).replace(/[^A-Za-z0-9]/g,""),se=e=>M(e).replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,""),ae=new Set(["person","people","someone","somebody","user","users","member","members"]);function de(e,n){let r=M(n);return Object.entries(e.kinds).find(([f,d])=>[f,d.noun,d.plural].some(c=>c!==void 0&&M(c)===r))?.[0]}function K(e,n){if(!e(n))return n;for(let r=2;;r++)if(!e(`${n}${r}`))return`${n}${r}`}function Fe(e,n){let r=e.acts??{},f=m=>m in r;if("link"in n){let m=de(e,n.link.on);if(!m)return{refused:`This app has no ${n.link.on} to give it to.`};let k=e.kinds[m],C=M(k.noun??m),v=M(n.link.called)||"linked to",u=de(e,n.link.to)??(ae.has(M(n.link.to))?(Object.entries(e.kinds).find(([,T])=>T.people)??Object.entries(e.kinds).find(([T,P])=>[T,P.noun,P.plural].some(t=>t!==void 0&&ae.has(M(t)))))?.[0]:void 0),A=[],j=[],$,F=u===void 0;if(!u){let T=M(n.link.to)||"person",P=ae.has(T),t=P?"person":T.replace(/s$/,""),a=P?"people":`${t}s`;u=K(b=>b in e.kinds,se(t)),A.push({op:"add-kind",kind:u,noun:t,plural:a,fields:{name:{type:"string",required:!0}},label:"{name}"}),$=K(f,`add-${u}`),j.push(`Add ${ee(U(a))} list.`)}let i=u in e.kinds?e.kinds[u]:A[0],y=M(i.noun??u),S=K(T=>T in(k.edges??{})||T in(k.fields??{}),xe(v)||"linkedTo");A.push({op:"add-relation",kind:m,relation:S,to:[u],cardinality:"one",description:U(v)});let R=K(f,`set-${se(v)}`);return A.push({op:"add-act",act:R,title:`Set \u201C${U(v)}\u201D`,on:m,connects:S,description:`Say who ${ee(C)} is ${v}.`}),j.push(`Give each ${C} ${le(v)?"an":"a"} \u201C${U(v)}\u201D field that points to ${ee(y)}.`),{edits:A,steps:j,on:m,relation:S,to:u,made:F,act:R,arg:"to",...$?{makes:$}:{},called:v}}let d=de(e,n.field.on);if(!d)return{refused:`This app has no ${n.field.on} to give it to.`};let c=e.kinds[d],g=M(c.noun??d),p=M(n.field.called)||"note",l=n.field.type??"string",s=K(m=>m in(c.fields??{})||m in(c.edges??{}),xe(p)||"note"),o=K(f,`set-${se(p)}`);return{edits:[{op:"add-field",kind:d,field:s,spec:{type:l}},{op:"add-act",act:o,title:`Set \u201C${U(p)}\u201D`,on:d,args:{value:{type:l,required:!0}},sets:{[s]:"$value"},description:`Say ${ee(g)}'s ${p}.`}],steps:[`Give each ${g} ${le(p)?"an":"a"} \u201C${U(p)}\u201D field.`],on:d,field:s,act:o,arg:"value",called:p}}var Re=["search-miss","unanswered","refused","tool-invalid"];var qe=new RegExp("[\\u0000-\\u001f\\u007f-\\u009f\\u200b-\\u200f\\u2028-\\u202e\\u2066-\\u2069]","g");var G=e=>e.onBehalfOf?G(e.onBehalfOf):e.id!==void 0?`${e.kind}:${e.id}`:`${e.kind}:?`,ce=e=>e.toLowerCase().replace(/\s+/g," ").replace(/^[\s\p{P}]+|[\s\p{P}]+$/gu,"");var Ce=new Set("a an and are at be by can do does for from has have how i in is it me my of on or our the their there this to was we what when where which who why will with you your".split(" "));function J(e,n,r,f,d){let c=new Map;for(let g of e){let p=n(g);if(p===void 0)continue;let l=c.get(p)??{first:g,people:new Set,times:0,last:g};l.people.add(G(g.by)),l.times+=1,l.last=g,c.set(p,l)}return[...c.entries()].filter(([,g])=>g.people.size>=f).sort(([g,p],[l,s])=>s.people.size-p.people.size||s.times-p.times||g.localeCompare(l)).slice(0,d).map(([g,p])=>({...r(p.last,g),people:p.people.size,times:p.times}))}function je(e,n={}){let r=Math.max(1,n.minPeople??2),f=n.most??12,d=n.reader?G(n.reader):void 0,c=e.filter(s=>!$e(s.by)&&(d===void 0||G(s.by)!==d)),g=Object.fromEntries(Re.map(s=>{let o=c.filter(m=>m.type===s);return[s,{events:o.length,people:new Set(o.map(m=>G(m.by))).size}]})),p=[],l=new Map;for(let s of c){let o=s.type==="search-miss"?s.words:s.type==="unanswered"?s.question:void 0;if(o!==void 0)for(let m of new Set(ce(o).split(/[^\p{L}\p{N}]+/u))){if(m.length<3||Ce.has(m))continue;let k={...s,id:`${s.id}:${m}`};p.push(k),l.set(k,m)}}return{events:c.length,people:new Set(c.map(s=>G(s.by))).size,byType:g,searches:J(c,s=>s.type==="search-miss"&&ce(s.words)||void 0,(s,o)=>({words:o}),r,f),questions:J(c,s=>s.type==="unanswered"&&ce(s.question)||void 0,(s,o)=>({question:o,...s.lacks?{lacks:s.lacks}:{}}),r,f),words:J(p,s=>l.get(s),(s,o)=>({word:o}),r,f),refusals:J(c,s=>s.type==="refused"?`${s.act}|${s.code}`:void 0,s=>({act:s.act,code:s.code}),r,f),tools:J(c,s=>s.type==="tool-invalid"?`${s.tool}|${s.act??""}`:void 0,s=>{let o=s;return{tool:o.tool,...o.act?{act:o.act}:{},...o.then?{then:o.then}:{}}},1,f)}}var ve=e=>e.length>3&&e.endsWith("s")&&!e.endsWith("ss")?e.slice(0,-1):e;function Ee(e){let n=new Set,r=f=>{for(let d of f.toLowerCase().split(/[^\p{L}\p{N}]+/u))d.length>0&&n.add(ve(d))};for(let f of e.kinds){let d=e.tryDefinition(f);r(f),r(_(d,f)),r(W(e,f));for(let c of[...d?.aliases??[],...Object.values(d?.fieldAliases??{}).flat()])r(c);for(let c of Object.keys(d?.fields?.shape??{}))r(c),r(B(c))}return n}function Oe(e,n,r={}){let f=je(e,{most:8,...r}),d=Ee(n),c=f.searches.filter(o=>!o.words.split(/[^\p{L}\p{N}]+/u).some(m=>m.length>0&&d.has(ve(m)))).map(o=>({words:o.words,people:o.people})),g=f.questions.map(o=>({question:o.question,people:o.people,...o.lacks?{lacks:o.lacks}:{}})),p=f.tools.map(o=>({tool:o.tool,...o.act?{act:o.act}:{},...o.then?{then:o.then}:{},times:o.times})),l=o=>`${o} ${o===1?"person":"people"}`;return{said:[...c.length>0?[`Searched for, found nothing, and nothing here is called it: ${c.map(o=>`\u201C${o.words}\u201D (${l(o.people)})`).join(", ")}.`]:[],...g.length>0?[`Asked and not answered: ${g.map(o=>`\u201C${o.question}\u201D (${l(o.people)}${o.lacks?`; ${o.lacks.replace(/[.!]$/,"")}`:""})`).join(", ")}.`]:[],...p.length>0?[`Tool calls refused as invalid: ${p.map(o=>`${o.tool}${o.act?` (${o.act})`:""} ${o.times===1?"once":`${o.times} times`}${o.then?`, then worked as ${o.then}`:""}`).join("; ")}.`]:[]].join(`
2
2
  `),unknownWords:c,questions:g,toolMistakes:p}}var Te=e=>/^(?:aggregate|kind):([^,]+)$/.exec(e)?.[1];function Ze(e,n){let r=e.about??[];if(e.field!==void 0&&e.on!==void 0&&n(e.on))return{on:"field",id:e.on,field:e.field};let f=r.filter(n);if(f.length>1)return{on:"selection",ids:f};if(e.on!==void 0&&n(e.on))return{on:"record",id:e.on};if(f.length===1)return{on:"record",id:f[0]};let d=[e.on,...r].map(c=>c===void 0?void 0:Te(c)).find(c=>c!==void 0);return e.place!==void 0?{on:"lens",place:e.place,...d?{kind:d}:{}}:d!==void 0?{on:"list",kind:d}:{on:"place",place:"home"}}var ne=e=>e.on==="record"||e.on==="field"?[e.id]:e.on==="selection"?e.ids:e.on==="act"&&e.id!==void 0?[e.id]:[],te=(e,n)=>e.tryDefinition(n)?.fields?.shape??{},Y=(e,n)=>e.tryDefinition(n)?.edges??{},ie=(e,n)=>new Set(e.tryDefinition(n)?.display?.hide??[]),N=(e,n)=>he(e.tryDefinition(n.kind),n),fe=(e,n,r)=>ke(e.tryDefinition(n),r)||B(r),ye=e=>typeof e=="boolean"?e?"yes":"no":String(e);function oe(e,n){let r=e.kindsKeptFrom(n);return new Set(e.schema.kinds.filter(f=>!r.has(f)))}function pe(e,n,r,f){if(!e.permits(n,r).ok)return!1;if(!f)return!0;try{return e.previewAll([n],{author:r}).ops.length>0}catch{return!1}}function Qe(e,n,r){let f=e,{principal:d}=r,c=r.each??8,g=H(f)?.store??f,p=g.seenBy(d),l=g.schema,s=oe(g,d),o=t=>{let a=p.graph.getNode(t);return a&&s.has(a.kind)?a:void 0},m=g.allMutations(),k=new Map(m.map(t=>[t.name,t])),C=[],v=new Set,u=t=>{v.has(t.id)||(v.add(t.id),C.push(t))},A=t=>t.slice(0,c),j=ne(n).filter(t=>o(t)!==void 0);if(ne(n).length>0&&j.length===0)return{target:n,candidates:[]};let $=j.length===1?o(j[0]):void 0,F=$?.kind??(n.on==="list"?n.kind:n.on==="lens"?n.kind??r.places?.find(t=>t.as===n.place)?.kind:void 0)??(n.on==="selection"?o(j[0])?.kind:void 0);if(F!==void 0&&!s.has(F))return{target:n,candidates:[]};let i=(t,a)=>`act:${t}${Object.keys(a).length>0?`:${Object.values(a).map(b=>String(b)).join(",")}`:""}`,y=(t,a,b,O,h)=>{t.destructive||Object.values(a).some(I=>typeof I=="string"&&g.graph.has(I)&&o(I)===void 0)||pe(g,{name:t.name,args:{...a}},d,O.length===0)&&u({type:"act",id:i(t.name,a),label:b,description:h??t.description??b,mutation:t.name,args:a,asks:O})};if(n.on!=="place"||r.acts)if(r.acts)for(let t of r.acts){let a=k.get(t.mutation);!a||t.destructive||n.on==="act"&&t.mutation!==n.act||y(a,t.args,t.label,(t.open??[]).filter(b=>!b.optional).map(b=>b.name),t.why)}else{let t=$?[$]:[];for(let a of m){if(n.on==="act"&&a.name!==n.act)continue;let b=a.input.shape??{},O=h=>Object.entries(b).filter(([I,w])=>I!==h&&w.safeParse?.(void 0).success===!1).map(([I])=>I);if(a.subject)for(let h of t)Q(l,a).includes(h.kind)&&y(a,{[a.subject.arg]:h.id},`${a.title??B(a.name)}: ${N(l,h)}`,O(a.subject.arg));else F!==void 0&&(a.creates??[]).includes(F)&&y(a,{},a.title??B(a.name),O(void 0))}}let S=C.filter(t=>t.type==="act");C.splice(0,C.length,...A(S));let R=(t,a)=>{let b=Se(l,m).get(t.kind),O=te(l,t.kind),h=ie(l,t.kind),I=[];for(let[w,D]of Object.entries(O)){if(a!==void 0?w!==a:h.has(w)||t[w]!==void 0)continue;let z=X(D),q=z?.type==="enum"&&!z.multiple?z.options??[]:z?.type==="boolean"?[!0,!1]:[];if(q.length===0)continue;let L=(b?.get(w)??[]).map(E=>k.get(E)).find(E=>E?.subject!==void 0&&pe(g,{name:E.name,args:{[E.subject.arg]:t.id,[w]:q.find(re=>re!==t[w])??q[0]}},d,!0));if(L?.subject)for(let E of q)t[w]!==E&&I.push({type:"fill",id:`fill:${t.id}:${w}:${ye(E)}`,label:`${fe(l,t.kind,w)}: ${ye(E)}`,description:`Set ${fe(l,t.kind,w).toLowerCase()} of ${N(l,t)} to ${ye(E)}`,record:t.id,field:w,value:E,call:{name:L.name,args:{[L.subject.arg]:t.id,[w]:E}}})}for(let[w,D]of Object.entries(Y(l,t.kind))){if(a!==void 0&&w!==a)continue;let z=D.to==="*"?[...s]:D.to.filter(x=>s.has(x)),q=new Set(p.graph.out(t.id,w).map(x=>x.id)),L=m.find(x=>(x.connects??[]).includes(w)&&x.subject!==void 0&&Q(l,x).includes(t.kind));if(!L?.subject)continue;let E=we(L.input).find(x=>x.name!==L.subject.arg);if(!E)continue;let re=z.flatMap(x=>E.kinds.length===0||E.kinds.includes(x)?p.graph.nodesOfKind(x):[]).filter(x=>x.id!==t.id&&!q.has(x.id)&&o(x.id)!==void 0);for(let x of A(re)){let me={name:L.name,args:{[L.subject.arg]:t.id,[E.name]:x.id}};pe(g,me,d,!0)&&I.push({type:"fill",id:`fill:${t.id}:${w}:${x.id}`,label:`${B(w)}: ${N(l,x)}`,description:`Link ${N(l,t)} to ${N(l,x)}${D.description?` as ${D.description}`:""}`,record:t.id,field:w,value:x.id,call:me})}}return I};if(n.on==="field"&&$)for(let t of R($,n.field))u(t);else if($&&n.on==="record")for(let t of A(R($)))u(t);let T=t=>{let a=W(l,t).toLowerCase(),b=[{type:"panel",id:`panel:${t}:list`,label:`A list of ${a}`,description:`Every ${_(l.tryDefinition(t),t).toLowerCase()} this viewer may see, as a list`,panel:{lens:"blocks",kind:t}}],O=ie(l,t);for(let[h,I]of Object.entries(te(l,t))){if(O.has(h))continue;let w=X(I),D=fe(l,t,h).toLowerCase();if(w?.type==="enum")b.push({type:"panel",id:`panel:${t}:group:${h}`,label:`${V(a)} by ${D}`,description:`A list of ${a} grouped by ${D}`,panel:{lens:"blocks",kind:t,group:h}}),b.push({type:"panel",id:`panel:${t}:columns:${h}`,label:`Columns of ${a} by ${D}`,description:`${V(a)} in a column for each ${D}`,panel:{lens:"columns",kind:t,column:h}});else if(w?.type==="number"||w?.type==="integer"||w?.type==="date"||w?.type==="datetime"){let z=w.type==="date"||w.type==="datetime";b.push({type:"panel",id:`panel:${t}:sort:${h}`,label:`${V(a)} by ${D}`,description:`A list of ${a}, the ${z?"latest":"highest"} ${D} first`,panel:{lens:"blocks",kind:t,sort:{by:h,direction:"desc"}}}),z&&b.push({type:"panel",id:`panel:${t}:calendar:${h}`,label:`A calendar of ${a}`,description:`${V(a)} on a calendar by ${D}`,panel:{lens:"calendar",kind:t,start:h}})}}return b},P=n.on==="place"?[...s]:F!==void 0?[F]:[];for(let t of P)for(let a of A(T(t)))u(a);for(let t of A((r.places??[]).filter(a=>!a.hidden&&(a.kind===void 0?n.on==="place":s.has(a.kind)&&(n.on==="place"||a.kind===F)))))n.on==="lens"&&t.as===n.place||u({type:"place",id:`place:${t.as}`,label:t.title,description:`Go to ${t.title}`,place:t.as});if($){let t=[];for(let[a,b]of Object.entries(Y(l,$.kind)))for(let O of p.graph.out($.id,a))o(O.id)&&t.push({type:"record",id:`record:${O.id}`,label:N(l,O),description:`${V(b.description??B(a))}: ${N(l,O)}`,record:O.id,relation:a});for(let a of l.kinds)for(let[b,O]of Object.entries(Y(l,a)))if(!(O.to!=="*"&&!O.to.includes($.kind)))for(let h of p.graph.in($.id,b))h.kind===a&&o(h.id)&&t.push({type:"record",id:`record:${h.id}`,label:N(l,h),description:`${V(O.inverse??B(b))}: ${N(l,h)}`,record:h.id,relation:b});for(let a of A(t))u(a)}else if(n.on==="list"||n.on==="lens")for(let t of A(F!==void 0?p.graph.nodesOfKind(F):[]))o(t.id)&&u({type:"record",id:`record:${t.id}`,label:N(l,t),description:`Open ${N(l,t)}`,record:t.id});else if(n.on==="selection")for(let t of j){let a=o(t);u({type:"record",id:`record:${t}`,label:N(l,a),description:`Open ${N(l,a)}`,record:t})}return{target:n,candidates:C}}var V=e=>e&&`${e[0].toUpperCase()}${e.slice(1)}`,Pe={columns:["board","kanban","column","lane","pipeline","stage","funnel"],board:["board","map","floor","layout","seat","slot"],calendar:["calendar","schedule","date","due","month","week","agenda","deadline","day"],timeline:["timeline","gantt","schedule","roadmap","span"],coverage:["coverage","matrix","grid","gap"],plan:["plan","floor","map","region","area"],blocks:["list","table","summary","overview","dashboard","card"]},De=new Set(["a","an","the","of","for","my","our","me","us","to","with","and","in","on","by","that","which","i","we","want","need","show","open","go","draw","make","new","view","views","panel","panels","page","lens","please","all","every","some","see","can","could","would","like","one","what","is","are","do","does","here","there","how","it","this","these","those"]),Z=e=>e.length>3&&e.endsWith("ies")?`${e.slice(0,-3)}y`:e.length>3&&e.endsWith("s")&&!e.endsWith("ss")?e.slice(0,-1):e,ue=e=>e.toLowerCase().normalize("NFKD").replace(/[̀-ͯ]/g,"").split(/[^a-z0-9]+/).filter(Boolean);function Xe(e,n,r){let f=e,d=H(f)?.store??f,c=d.schema,g=oe(d,r.principal),p=d.seenBy(r.principal),l=ne(n),s=new Set;for(let i of l){let y=p.graph.getNode(i)?.kind;y!==void 0&&g.has(y)&&s.add(y)}if(l.length>0&&s.size===0)return[];if(n.on==="list"&&s.add(n.kind),n.on==="lens"){let i=n.kind??r.places.find(y=>y.as===n.place)?.kind;i!==void 0&&s.add(i)}let o=new Map;for(let i of c.kinds){if(!g.has(i))continue;let y=c.tryDefinition(i);for(let S of[i,_(y,i),W(c,i)])for(let R of ue(S))o.set(Z(R),i)}let m=ue(r.said??"").filter(i=>!De.has(i)),k=new Set,C=[];for(let i of m){let y=o.get(Z(i));y!==void 0?k.add(y):C.push(Z(i))}let v=k.size>0?k:s;if((r.said??"").trim()!==""&&m.length===0)return[];if(v.size===0&&m.length===0)return[];let u=[];r.places.forEach((i,y)=>{if(i.hidden||n.on==="lens"&&i.as===n.place)return;let S=i.over??(i.kind!==void 0?[i.kind]:[]);if(S.length>0&&!S.some(P=>g.has(P)))return;let R=S.some(P=>v.has(P)),T=!R&&(i.reads??[]).some(P=>v.has(P));v.size>0&&!R&&!T||u.push({place:i,own:R,reads:T,at:y})});let A=i=>new Set(ue(i.title).map(Z)),j=new Set(C.filter(i=>u.some(({place:y})=>A(y).has(i)))),$=[];for(let{place:i,own:y,reads:S,at:R}of u){let T=A(i),P=new Set((Pe[i.lens??""]??[]).map(Z)),t=C.filter(h=>T.has(h)||P.has(h)&&!j.has(h)).length,a=C.length-t;if(C.length>0&&t===0)continue;let b=!S&&a===0?"full":"partial",O=(y?4:S?2:1)+t*2-a+(b==="full"?1:0);$.push({view:{place:i.as,title:i.title,...i.kind!==void 0?{kind:i.kind}:{},fit:b},score:O,at:R})}return $.filter((i,y)=>!$.slice(0,y).some(S=>S.view.place===i.view.place&&S.view.title===i.view.title)).sort((i,y)=>y.score-i.score||i.at-y.at).slice(0,r.most??3).map(i=>i.view)}var ge=new WeakMap;function Ne(e){let n=2166136261;for(let r=0;r<e.length;r++)n^=e.charCodeAt(r),n=Math.imul(n,16777619)>>>0;return n.toString(36)}function Ie(e,n){let r=e,f=H(r)?.store??r,d=f.schema,c=oe(f,n),p=f.allMutations().filter(u=>!u.destructive&&f.permits({name:u.name,args:{}},n).ok!==!1),l=`${[...c].join(",")}|${p.map(u=>u.name).join(",")}`,s=ge.get(d)?.get(l);if(s)return s;let o=[...c].map(u=>{let A=ie(d,u),j={};for(let[y,S]of Object.entries(te(d,u))){if(A.has(y))continue;let R=X(S);R&&(j[y]=R.type==="enum"?`enum:${(R.options??[]).join("|")}`:R.type)}let $={};for(let[y,S]of Object.entries(Y(d,u)))$[y]=S.to==="*"?[...c]:S.to.filter(R=>c.has(R));let F=d.tryDefinition(u),i=Object.entries(F?.fieldAliases??{}).filter(([y,S])=>y in j&&S.length>0);return{kind:u,noun:_(d.tryDefinition(u),u),plural:W(d,u),fields:j,relations:$,...F?.aliases&&F.aliases.length>0?{aliases:F.aliases}:{},...i.length>0?{fieldAliases:Object.fromEntries(i)}:{}}}),m=p.map(u=>({name:u.name,title:u.title??B(u.name),...u.subject?{on:Q(d,u).filter(A=>c.has(A))}:{}})),k={kinds:o,acts:m},C={version:Ne(JSON.stringify(k)),...k},v=ge.get(d)??new Map;return v.set(l,C),ge.set(d,v),C}var Me=e=>e.name??e.id??e.kind;function en(e,n,r){let f=e,{principal:d}=r,c=H(f)?.store??f,g=c.seenBy(d),p=c.schema,l=oe(c,d),s=i=>{let y=g.graph.getNode(i);return y&&l.has(y.kind)?y:void 0},o=i=>({id:i.id,kind:i.kind,label:N(p,i)}),m=ne(n),k=m.length===1?s(m[0]):void 0,C=k?Object.fromEntries(Object.keys(te(p,k.kind)).filter(i=>!ie(p,k.kind).has(i)&&k[i]!==void 0&&i!=="label").map(i=>[i,k[i]])):{},v={on:n.on,...k?{record:{...o(k),fields:C}}:{},...n.on==="field"&&k?{field:n.field}:{},...n.on==="list"&&l.has(n.kind)?{kind:n.kind}:{},...n.on==="lens"?{place:n.place,...n.kind&&l.has(n.kind)?{kind:n.kind}:{}}:{},...n.on==="place"?{place:n.place}:{},...n.on==="act"?{act:n.act}:{}},u=[...new Set([...n.on==="selection"?n.ids:[],...r.selection??[]])].flatMap(i=>{let y=s(i);return y?[o(y)]:[]}),A=[];if(k){for(let i of Object.keys(Y(p,k.kind)))for(let y of g.graph.out(k.id,i))s(y.id)&&A.push({...o(y),relation:i,direction:"out"});for(let i of p.kinds)for(let y of Object.keys(Y(p,i)))for(let S of g.graph.in(k.id,y))S.kind===i&&s(S.id)&&A.push({...o(S),relation:y,direction:"in"})}let j=g.batches().filter(i=>!i.ops.every(be)).slice(-(r.recent??6)).reverse().map(i=>({intent:i.intent,at:i.at,by:Me(i.author)})),$=(r.purpose?.jobs??[]).filter(i=>Ae(i,d.roles)&&l.has(i.kind)).map(i=>({name:i.name,ask:i.ask,kind:i.kind})),F=r.purpose&&(r.purpose.for!==void 0||$.length>0)?{...r.purpose.for!==void 0?{for:r.purpose.for}:{},jobs:$}:void 0;return{...r.place!==void 0?{place:r.place}:{},target:v,selection:u,neighbors:A.slice(0,24),recent:j,schema:Ie(c,d),...F?{purpose:F}:{},...r.friction?{friction:Oe(r.friction,p,{reader:d})}:{}}}export{Fe as a,Ze as b,ne as c,Qe as d,Xe as e,en as f};
@@ -1 +1 @@
1
- import{a as y,b as h}from"./chunk.VL3YDD7D.js";import"./chunk.OPMGQS5J.js";import"./chunk.IXYG65TM.js";import"./chunk.W6L2VAJG.js";import"./chunk.N3MXLORL.js";import{Hd as b}from"./chunk.6L6RUOSF.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";var k=(d,i)=>({id:i.id,said:h(d,i),when:i.when,...i.alsoMine?{alsoMine:!0}:{}});async function A(d,i,t){let a=b(t.principal);if(a.id===void 0)return{ok:!1,error:"This seat acts for nobody the app knows by id, so there is nobody to tell. Nothing was kept."};let r=t.store.seenBy(a),p=async()=>(await t.subscriptions.list(a.id)).filter(n=>n.app===t.app);if(d==="list_subscriptions")return{ok:!0,data:{subscriptions:(await p()).map(n=>k(r,n))}};if(d==="unsubscribe"){let n=String(i.id??"");return(await p()).some(g=>g.id===n)?(await t.subscriptions.remove(n),{ok:!0,data:{removed:n}}):{ok:!1,error:`No subscription "${n}" of yours. list_subscriptions says which there are.`}}let o=String(i.on??""),c=n=>typeof i[n]=="string"&&i[n].trim()!==""?i[n].trim():void 0,e=c("record");if(e!==void 0&&!r.graph.getNode(e)){let n=t.store.resolveRef({name:"record",kinds:["*"]},e,a);if(!n.ok)return{ok:!1,error:`${n.message} Nothing was kept.`};e=n.id}let s=c("kind")??(e!==void 0&&o!=="act"?r.graph.getNode(e)?.kind:void 0),f=c("act"),m=c("condition"),u=o==="act"?{on:o,...f!==void 0?{act:f}:{},...e!==void 0?{record:e}:{}}:o==="created"&&s!==void 0?{on:o,kind:s}:o==="changed"?{on:o,...s!==void 0&&e===void 0?{kind:s}:{},...e!==void 0?{record:e}:{}}:o==="reaches"&&s!==void 0?{on:o,kind:s,condition:m??"",...e!==void 0?{record:e}:{}}:void 0;if(!u)return{ok:!1,error:'Say what to be told of: on is "act", "created", "changed" or "reaches", with a kind (or a record) for all but act. Nothing was kept.'};let l=y({schema:r.schema,allMutations:()=>t.store.allMutations(),graph:r.graph},u);if(l)return{ok:!1,error:`${l} Nothing was kept.`};let S=await t.subscriptions.add({who:a,app:t.app,when:u,...i.alsoMine===!0?{alsoMine:!0}:{}});return{ok:!0,data:{subscription:k(r,S)}}}export{A as runSubscriptionTool};
1
+ import{a as y,b as h}from"./chunk.NKRDVOLJ.js";import"./chunk.YC2IDHQX.js";import"./chunk.R5YGW5ZX.js";import"./chunk.QMGBAKX6.js";import"./chunk.PS765ODQ.js";import{Hd as b}from"./chunk.ZDUKVXBI.js";import"./chunk.FQLNBIQ5.js";import"./chunk.AJZBJBMO.js";var k=(d,i)=>({id:i.id,said:h(d,i),when:i.when,...i.alsoMine?{alsoMine:!0}:{}});async function A(d,i,t){let a=b(t.principal);if(a.id===void 0)return{ok:!1,error:"This seat acts for nobody the app knows by id, so there is nobody to tell. Nothing was kept."};let r=t.store.seenBy(a),p=async()=>(await t.subscriptions.list(a.id)).filter(n=>n.app===t.app);if(d==="list_subscriptions")return{ok:!0,data:{subscriptions:(await p()).map(n=>k(r,n))}};if(d==="unsubscribe"){let n=String(i.id??"");return(await p()).some(g=>g.id===n)?(await t.subscriptions.remove(n),{ok:!0,data:{removed:n}}):{ok:!1,error:`No subscription "${n}" of yours. list_subscriptions says which there are.`}}let o=String(i.on??""),c=n=>typeof i[n]=="string"&&i[n].trim()!==""?i[n].trim():void 0,e=c("record");if(e!==void 0&&!r.graph.getNode(e)){let n=t.store.resolveRef({name:"record",kinds:["*"]},e,a);if(!n.ok)return{ok:!1,error:`${n.message} Nothing was kept.`};e=n.id}let s=c("kind")??(e!==void 0&&o!=="act"?r.graph.getNode(e)?.kind:void 0),f=c("act"),m=c("condition"),u=o==="act"?{on:o,...f!==void 0?{act:f}:{},...e!==void 0?{record:e}:{}}:o==="created"&&s!==void 0?{on:o,kind:s}:o==="changed"?{on:o,...s!==void 0&&e===void 0?{kind:s}:{},...e!==void 0?{record:e}:{}}:o==="reaches"&&s!==void 0?{on:o,kind:s,condition:m??"",...e!==void 0?{record:e}:{}}:void 0;if(!u)return{ok:!1,error:'Say what to be told of: on is "act", "created", "changed" or "reaches", with a kind (or a record) for all but act. Nothing was kept.'};let l=y({schema:r.schema,allMutations:()=>t.store.allMutations(),graph:r.graph},u);if(l)return{ok:!1,error:`${l} Nothing was kept.`};let S=await t.subscriptions.add({who:a,app:t.app,when:u,...i.alsoMine===!0?{alsoMine:!0}:{}});return{ok:!0,data:{subscription:k(r,S)}}}export{A as runSubscriptionTool};
@@ -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 Re=globalThis,mo=Re.addEventListener,po=Re.removeEventListener,ho=Re.postMessage,go=globalThis.queueMicrotask,pn=globalThis.performance,yo=pn?pn.now.bind(pn):Date.now,_e={listen:t=>mo.call(Re,"message",t),unlisten:t=>po.call(Re,"message",t),post:t=>ho.call(Re,t),microtask:t=>go.call(globalThis,t),now:()=>yo()};var O=Symbol("name"),fe=Symbol("prefix"),me=Symbol("value"),v=Symbol("ns"),Y=Symbol("owner"),k=Symbol("owner_document"),re=Symbol("attributes"),D=Symbol("prev"),p=Symbol("next"),R=Symbol("child"),z=Symbol("parent"),pe=Symbol("host"),K=Symbol("data"),Te=Symbol("listeners"),hn=Symbol("isTrusted"),Pe=Symbol("path"),Me=Symbol("stop_immediate_propagation"),Ce=Symbol("dispatching"),ie=Symbol("content"),L=Symbol("hooks"),mt=Symbol("extensions"),we=Symbol("hooks_dispatch"),B=Symbol("is_connected"),Ie=Symbol("create_element"),nr=0,$=1,ke=2,De=3,Le=8,Se=9,rr=10,he=11,_="http://www.w3.org/1999/xhtml",Z="http://www.w3.org/2000/svg",or="http://www.w3.org/XML/1998/namespace",$e="http://www.w3.org/2000/xmlns/";function pt(t){return t.split(/[\\t\\n\\f\\r ]+/).filter(Boolean)}function H(t){return t.replace(/[A-Z]/g,e=>String.fromCharCode(e.charCodeAt(0)+32))}function sr(t){return t.replace(/[a-z]/g,e=>String.fromCharCode(e.charCodeAt(0)-32))}function M(t,e){let n=globalThis.DOMException;if(typeof n=="function")return new n(t,e);let r=new Error(t);return r.name=e,r}var ir=/^(?:[A-Za-z][^\\0\\t\\n\\f\\r\\u0020/>]*|[:_\\u0080-\\u{10FFFF}][A-Za-z0-9-.:_\\u0080-\\u{10FFFF}]*)$/u,ar=/[\\0\\t\\n\\f\\r />=]/u,Eo=/[\\0\\t\\n\\f\\r />]/u;function ae(t){if(t==null)return null;let e=String(t);return e===""?null:e}function lr(t){ir.test(t)||yn(t)}function gn(t){(t===""||ar.test(t))&&yn(t)}function ht(t,e,n){let r=ae(t),o=String(e),s=o.indexOf(":"),i=s<0?null:o.slice(0,s),l=s<0?o:o.slice(s+1);if((i!=null&&(i===""||Eo.test(i))||(n==="element"?!ir.test(l):l===""||ar.test(l)))&&yn(o),i!=null&&r==null)throw M(`A namespace is required for the prefix in "${o}"`,"NamespaceError");if(i==="xml"&&r!==or)throw M("The xml prefix requires the XML namespace","NamespaceError");if((o==="xmlns"||i==="xmlns")&&r!==$e)throw M("The xmlns name requires the XMLNS namespace","NamespaceError");if(r===$e&&o!=="xmlns"&&i!=="xmlns")throw M("The XMLNS namespace requires the xmlns name or prefix","NamespaceError");return{namespace:r,qualifiedName:o,prefix:i,localName:l}}function yn(t){throw M(`Invalid name: "${t}"`,"InvalidCharacterError")}var gt=0,yt=1,cr=2,En=3,bo=typeof performance>"u"?Date.now:performance.now.bind(performance),V=class{static NONE=gt;static CAPTURING_PHASE=yt;static AT_TARGET=cr;static BUBBLING_PHASE=En;timeStamp=bo();target=null;currentTarget=null;srcElement=null;bubbles=!1;cancelable=!1;composed=!1;defaultPrevented=!1;cancelBubble=!1;eventPhase=gt;[Pe]=[];[Me]=!1;[Ce]=!1;constructor(e,n){this.type=e,Object.defineProperty(this,hn,{writable:!0,value:!1}),n&&(n.bubbles&&(this.bubbles=n.bubbles),n.cancelable&&(this.cancelable=n.cancelable),n.composed&&(this.composed=n.composed))}get isTrusted(){return this[hn]}composedPath(){return[...this[Pe]]}stopPropagation(){this.cancelBubble=!0}stopImmediatePropagation(){this[Me]=!0,this.cancelBubble=!0}preventDefault(){this.cancelable&&(this.defaultPrevented=!0)}set returnValue(e){e||this.preventDefault()}get returnValue(){return!this.defaultPrevented}initEvent(e,n,r){this.type=e,this.bubbles=!!n,this.cancelable=!!r}};function bn(t,e,n){if(t.cancelBubble)return;let o=e[Te]?.get(t.type)?.[n===yt?"capture":"bubble"];if(o)for(let s of[...o]){if(!o.has(s)||s.signal?.aborted)continue;t.eventPhase=t.target===e?cr:n,t.currentTarget=e;let i=s.normalizedListener;try{typeof i=="object"?i.handleEvent(t):i.call(e,t)}catch(l){setTimeout(No,0,l)}if(t[Me])break}}function No(t){throw t}var Xe=[],Et=new WeakMap;function bt(t,e){let n=Et.get(t);n?n.push(e):Et.set(t,[e]),Xe[Xe.length-1].push(t)}function F(t){let e=[];Xe.push(e);let n;try{n=t()}catch(r){Xe.pop();try{ur(e)}catch{}throw r}return Xe.pop(),ur(e),n}function ur(t){let e,n=!1;for(let r of t){let o=Et.get(r);if(o){for(;o.length>0;){let s=o.shift();try{s()}catch(i){n||(e=i,n=!0)}}Et.delete(r)}}if(n)throw e}var Nt=[],Ke=[],Nn=!1;function Oe(t){for(let e of t)Nt.push(e),e[1]&&Ke.push(e[1]);if(!Nn){Nn=!0;try{let e,n=!1;for(let r=0;r<Nt.length;r++){let[o,s]=Nt[r];s&&Ke.splice(Ke.indexOf(s),1);try{o()}catch(i){n||(e=i,n=!0)}}if(n)throw e}finally{Nt.length=0,Ke.length=0,Nn=!1}}}function Ze(t){let e=t;for(;e;){if(Ke.includes(e))return!0;e=e[z]??e[pe]}return!1}var Qe=Symbol("listenerRegistrations"),ge=class{[Te]=void 0;[Qe]=void 0;[k]=void 0;addEventListener(e,n,r){if(n==null)return;let o=r===!0||typeof r=="object"&&r.capture===!0,s=typeof r=="object"&&r.once===!0,i=typeof r=="object"?r.signal:void 0;if(i?.aborted)return;let l=Tn(o),c=this[Qe];c||(c=new Map,this[Qe]=c);let u=c.get(e);u||(u={},c.set(e,u));let m=u[l];if(m||(m=new Map,u[l]=m),m.has(n))return;let g=this,y={type:e,listener:n,capture:o,once:s,normalizedListener:n,signal:i};(s||i)&&(y.normalizedListener=function(...C){if(y.signal?.aborted){Tt(g,y);return}return y.once&&Tt(g,y),typeof y.listener=="object"?y.listener.handleEvent(...C):y.listener.call(this,...C)});let E=this[Te];E||(E=new Map,this[Te]=E);let x=E.get(e);x||(x={},E.set(e,x));let N=x[l];if(N||(N=new Set,x[l]=N),m.set(n,y),N.add(y),i){let w=()=>{Tt(g,y)};y.abortListener=w,i.addEventListener("abort",w,{once:!0})}this[k]?.defaultView[we].addEventListener?.(this,e,n,r)}removeEventListener(e,n,r){return To.call(this,e,n,r)}dispatchEvent(e){if(e[Ce])throw M("Failed to execute \'dispatchEvent\' on \'EventTarget\': The event is already being dispatched.","InvalidStateError");e[Ce]=!0;try{let n=[],r=this;for(;r!=null;)n.push(r),r=r.parentNode;e.target=this,e.srcElement=this,e[Pe]=n;for(let s=n.length;s--;)if(bn(e,n[s],yt),e.cancelBubble)return!e.defaultPrevented;let o=e.bubbles?n:n.slice(0,1);for(let s=0;s<o.length;s++)if(bn(e,o[s],En),e.cancelBubble)return!e.defaultPrevented;return!e.defaultPrevented}finally{e[Ce]=!1,e.cancelBubble=!1,e[Me]=!1,e.eventPhase=gt,e.currentTarget=null,e[Pe]=[]}}};function To(t,e,n){if(e==null)return;let r=n===!0||n&&n.capture===!0,o=Tn(!!r),s=this[Qe]?.get(t)?.[o]?.get(e);s&&Tt(this,s)}function Tn(t){return t?"capture":"bubble"}function Tt(t,e){let n=Tn(e.capture),r=t[Qe],o=r?.get(e.type);if(!o)return;let s=o[n];if(!s||s.get(e.listener)!==e)return;s.delete(e.listener),s.size===0&&delete o[n],!o.bubble&&!o.capture&&r?.delete(e.type),e.signal&&e.abortListener&&e.signal.removeEventListener("abort",e.abortListener);let i=t[Te],l=i?.get(e.type);if(!l)return;let c=l[n];c?.delete(e)&&(c.size===0&&delete l[n],!l.bubble&&!l.capture&&i?.delete(e.type),t[k]?.defaultView[we].removeEventListener?.(t,e.type,e.listener,e.capture))}var Q=class extends Array{item(e){return this[e]??null}};var et=0,dr=1,On=2,vn=3,tt=4,fr=0,mr=1,Ot=2,vt=3,pr=4,Sn=5,hr=6,gr=7,wt=/^(?:--|-?[A-Za-z_\\u0080-\\u{10FFFF}])[A-Za-z0-9_\\u0080-\\u{10FFFF}-]*$/u;function wo(t,e){let n=1,r=null;for(let o=e;o<t.length;o++){let s=t[o];if(r){s==="\\\\"?o++:s===r&&(r=null);continue}if(s===\'"\'||s==="\'")r=s;else if(s==="(")n++;else if(s===")"&&--n===0)return[t.slice(e,o),o+1]}return[t.slice(e),t.length]}function W(t){throw M(`Invalid or unsupported selector: "${t}"`,"SyntaxError")}function xt(t,e){let n=typeof e=="string"?nt(e):[{combinator:tt,matchers:e}],r=null,o=t[R];return o&&n[0].matchers.length&&xn(o,n,s=>(r=s,!1)),r}function At(t,e){let n=typeof e=="string"?nt(e):[{combinator:tt,matchers:e}],r=new Q,o=t[R];return o&&n[0].matchers.length&&xn(o,n,s=>{r.push(s)}),r}function nt(t,e=!1,n=!1){let r={combinator:tt,matchers:[]},o=[r],s=/[\\t\\n\\f\\r ]*?([>\\t\\n\\f\\r +~]?)[\\t\\n\\f\\r ]*?(?:(?:\\[[\\t\\n\\f\\r ]*([^\\]=\\t\\n\\f\\r ]+)[\\t\\n\\f\\r ]*(?:=[\\t\\n\\f\\r ]*(?:([\'"])(.*?)\\3|([^\\]\\t\\n\\f\\r ]+)))?[\\t\\n\\f\\r ]*(?:\\]|$))|([#.]?)([^\\t\\n\\f\\r #.[>:+~()]+)|:(\\w+)(\\()?)/gi,i=t.replace(/^[\\t\\n\\f\\r ]+|[\\t\\n\\f\\r ]+$/g,"");i===""&&W(t);let l=0,c;for(;c=s.exec(i);){c.index!==l&&W(t),c[1]&&(r.matchers.length===0&&!(n&&o.length===1)&&W(t),c[1]===">"?r.combinator=dr:c[1]==="+"?r.combinator=vn:c[1]==="~"?r.combinator=On:r.combinator=et,r={combinator:tt,matchers:[]},o.push(r));let u=c[8]?H(c[8]):c[2]||c[7];c[7]!=null&&!c[6]&&r.matchers.length>0&&W(t);let g,y=c[4]??c[5]??c[7];if(c[2]){wt.test(u)||W(t);let E=c[5],x=E?.[0];if(c[3]==null&&(x===\'"\'||x==="\'")){let N=c[0].lastIndexOf(E);y=i.slice(c.index+N+1),s.lastIndex=i.length}else E!=null&&!wt.test(E)&&W(t);g=pr}else c[6]?(wt.test(u)||W(t),g=c[6]==="#"?Ot:vt):c[8]?g=c[9]==null?Sn:hr:c[7]==="*"?g=fr:c[7]&&wt.test(c[7])?g=mr:W(t);c[9]?([y,s.lastIndex]=wo(i,s.lastIndex),u!=="has"&&u!=="not"&&W(t),u==="has"&&e&&W(t),nt(y,e||u==="has",u==="has")):g===Sn&&W(t),r.matchers.push({type:g,name:u,value:y}),l=s.lastIndex}return(l!==i.length||r.matchers.length===0)&&W(t),o}function So(t,e){let n=nt(e);return n[0]?.matchers.length?Je(t,n):!1}function Oo(t,e){let n=nt(e,!0,!0),r=n[0];if(n.length===1&&r.matchers.length===0)return!1;let o=et,s={type:gr,name:":scope"};if(r.matchers.length===0?(o=r.combinator,r.matchers.push(s)):n.unshift({combinator:et,matchers:[s]}),n.some(({matchers:c})=>c.length===0))return!1;let i=o===vn||o===On?t[p]:t[R];if(!i)return!1;let l=!1;return xn(i,n,()=>(l=!0,!1),t),l}function xn(t,e,n,r){let o=[],s=t;for(;s;){if(j(s)){if(Je(s,e,r)&&n(s)===!1)return!1;let i=s[R];if(i){let l=s[p];l&&o.push(l),s=i;continue}}s=s[p]??o.pop()??null}return!0}function Je(t,e,n){let{combinator:r,matchers:o}=e[e.length-1];if(r===tt){if(!St(t,o,n))return!1;let l=e.slice(0,-1);return l.length===0||Je(t,l,n)}let s=r===dr||r===et?z:D,i=t[s];if(!i)return!1;if(r===et||r===On){for(;i;){if(j(i)&&St(i,o,n)){let l=e.slice(0,-1);if(l.length===0||Je(i,l,n))return!0}i=i[s]}return!1}else{if(r===vn&&!j(i)){for(;i&&!j(i);)i=i[s];if(!i)return!1}if(!j(i)||!St(i,o,n))return!1;let l=e.slice(0,-1);return l.length===0||Je(i,l,n)}}function wn(t,e){return t.getAttributeNS(null,t.namespaceURI===_?H(e):e)}function St(t,e,n){if(!t)return!1;if(Array.isArray(e)){for(let i of e)if(St(t,i,n)===!1)return!1;return!0}let{type:r,name:o,value:s}=e;switch(r){case fr:return o==="*";case mr:return t.namespaceURI===_?t.localName===H(o):t.localName===o;case Ot:return wn(t,"id")===o;case vt:let i=wn(t,"class");return i?pt(i).includes(o):!1;case pr:let l=wn(t,o);return s==null?l!=null:l===s;case gr:return t===n;case Sn:W(`:${o}`);case hr:switch(o){case"has":return Oo(t,s||"");case"not":return!So(t,s||"");default:W(`:${o}(${s})`)}}return!1}function vo(t){return t.nodeType===ke}function rt(t){return K in t}function Rn(t){return t.nodeType===De}function xo(t){return t.nodeType===Le}function j(t){return t.nodeType===$}function An(t){return t.nodeType===he}function Nr(t){return"appendChild"in t}function Rt(t){let e=[],n=[t],r=new Set(n),o=new Set,s;for(;n.length>0;){let i=n.pop();if(r.delete(i),o.has(i))continue;let l=[];for(let c of st(i)){if(o.has(c)||(o.add(c),e.push(c),l.push(c),!j(c)))continue;let u=c[re];if(u)for(let g of u)o.has(g)||(o.add(g),e.push(g));let m=c[ie];m&&!o.has(m)&&!r.has(m)&&(r.add(m),n.push(m))}s??=l}return{nodes:e,treeNodes:s}}function ot(t,e){for(let n of t)n[k]=e}function yr(t,e){let n=t.constructor,r=new n(t.name,t.value,t.namespaceURI);return r[k]=e,r}function Er(t,e){if(Rn(t))return e.createTextNode(t.data);if(xo(t))return e.createComment(t.data);if(vo(t))return yr(t,e);if(j(t)){let n=e[Ie](t[O],t.namespaceURI,t[fe],t.localName);if(t[re])for(let r=0;r<t[re].length;r++){let o=t[re].item(r);n.attributes.setNamedItem(yr(o,e))}return n}else{if(An(t))return e.createDocumentFragment();{let n=new t.constructor;return n[k]=e,n}}}function _t(t,e,n=t.ownerDocument){if(t.nodeType===Se)throw M("Cannot clone a document node","NotSupportedError");let r=Er(t,n);if(!e||!j(t)&&!An(t))return r;let o=new Set([t]),s=[{source:t,destination:r,childIndex:0,cloningContent:!1}];for(;s.length>0;){let i=s[s.length-1],l,c;if(i.cloningContent)if(i.contentSource&&i.contentDestination)l=i.contentSource.childNodes[i.childIndex++],c=i.contentDestination;else{s.pop(),i.appendTo&&i.appendTo.appendChild(i.destination);continue}else if(l=i.source.childNodes[i.childIndex++],c=i.destination,!l){if(i.cloningContent=!0,i.childIndex=0,j(i.source)&&i.source.namespaceURI===_&&i.source.localName==="template"){let m=i.source[ie];m&&(o.has(m)&&br(),o.add(m),i.contentSource=m,i.contentDestination=i.destination.content)}continue}if(!l){s.pop(),i.appendTo&&i.appendTo.appendChild(i.destination);continue}o.has(l)&&br(),o.add(l);let u=Er(l,n);j(l)||An(l)?s.push({source:l,destination:u,appendTo:c,childIndex:0,cloningContent:!1}):c.appendChild(u)}return r}function br(){throw new Error("Cannot clone a cyclic or repeated node graph")}function Pt(t,e){let n=String(e);return n===""?null:xt(t,[{type:Ot,name:n}])}function Mt(t,e){let n=[...new Set(pt(String(e)))];return At(t,n.map(r=>({type:vt,name:r})))}function Ct(t,e){let n=String(e),r=H(n),o=[];for(let s of It(t))j(s)&&(n==="*"||(s.namespaceURI===_?s[O]===r:s[O]===n))&&o.push(s);return o}function It(t){let e=[],n=[],r=t[R];for(;r;){e.push(r);let o=r[R],s=r[p];o?(s&&n.push(s),r=o):r=s??n.pop()??null}return e}function st(t){let e=It(t);return e.unshift(t),e}var J=class extends ge{nodeType=nr;[O]="";[z]=null;[pe]=null;[R]=null;[D]=null;[p]=null;[B]=!1;get[L](){return this[k].defaultView[we]}get localName(){return this[O]}get nodeName(){return this[O]}get ownerDocument(){return this[k]}get isConnected(){return this[B]}isDefaultNamespace(e){let n=ae(e);return Ao(this)===n}get parentNode(){return this[z]}set parentNode(e){}get parentElement(){let e=this[z];return!e||e.nodeType!==1?null:e}set parentElement(e){}get previousSibling(){return this[D]}set previousSibling(e){}get nextSibling(){return this[p]}set nextSibling(e){}get previousElementSibling(){let e=this[D];for(;e&&e.nodeType!==1;)e=e[D];return e}set previousElementSibling(e){}get nextElementSibling(){let e=this[p];for(;e&&e.nodeType!==1;)e=e[p];return e}set nextElementSibling(e){}get firstChild(){return this[R]}set firstChild(e){}get lastChild(){let e=this[R];for(;e;){let n=e[p];if(n==null)break;e=n}return e}set lastChild(e){}get nodeValue(){return rt(this)?this.data:null}set nodeValue(e){rt(this)&&(this.data=e)}get textContent(){if(rt(this))return this.data;let e="";for(let n of It(this))Rn(n)&&(e+=n.data);return e}set textContent(e){if(rt(this))this.data=e;else if(Nr(this)){let n=e==null?"":String(e);n===""?this.replaceChildren():this.replaceChildren(n)}}cloneNode(e){return _t(this,e)}contains(e){let n=e;for(;n!=null;){if(n===this)return!0;n=n.parentNode}return!1}};function Ao(t){let e=t;for(;e;)switch(e.nodeType){case $:{let n=e;if(n.prefix==null&&n.namespaceURI!=null)return n.namespaceURI;let r=n.attributes.getNamedItemNS($e,"xmlns");if(r!=null&&r.prefix==null)return ae(r.value);e=n.parentElement;break}case Se:e=e.documentElement;break;case rr:case he:return null;case ke:e=e.ownerElement;break;default:e=e.parentElement}return null}var ee=Symbol("insertNode"),Mn=Symbol("preflightInsertions"),kt=Symbol("replaceNode"),ye=class extends J{remove(){let e=this.parentNode;e&&e.removeChild(this)}replaceWith(...e){let n=ve(e),r=this.parentNode;if(r)return _n(o=>{le(r,n);let s=this[p];for(;s&&n.includes(s);)s=s[p];let i=Pn(r,n,o);this.parentNode===r?r[kt](i,this,o):r[ee](i,s,o)})}before(...e){let n=ve(e),r=this.parentNode;if(r)return _n(o=>{le(r,n);let s=this[D];for(;s&&n.includes(s);)s=s[D];let i=Pn(r,n,o);r[ee](i,s?s[p]:r.firstChild,o)})}after(...e){let n=ve(e),r=this.parentNode;if(r)return _n(o=>{le(r,n);let s=this[p];for(;s&&n.includes(s);)s=s[p];let i=Pn(r,n,o);r[ee](i,s,o)})}};function _n(t){return F(()=>{let e=[];try{t(e)}catch(n){try{Oe(e)}catch{}throw n}Oe(e)})}function ve(t){return t.map(e=>e instanceof J?e:String(e))}function it(t,e){return e instanceof J?e:t.ownerDocument.createTextNode(String(e))}function le(t,e){for(let n of e){if(!(n instanceof J))continue;let r=t;for(;r;){if(r===n)throw M("Cannot insert a node into itself or one of its descendants","HierarchyRequestError");r=r[z]??r[pe]}}}function Pn(t,e,n){let r=[];for(let s of e)r.push(it(t,s));if(r.length===1)return r[0];let o=t.ownerDocument.createDocumentFragment();o[Mn](r);for(let s of r)o[ee](s,null,n);return o}var Dt,Cn=0,Tr=0,wr=0,Sr=0,Ge=!1,kn=!1,at=!1,Lt=class{#t;#n=[];#e=new Set;#r=!1;constructor(e){if(typeof e!="function")throw new TypeError("MutationObserver callback must be a function");this.#t=e}observe(e,n={}){let r=Ro(n),o=Dt??=new WeakMap,s=o.get(e);s==null&&(s=new Map,o.set(e,s));let i=s.get(this);i==null?Cn++:In(i,-1),s.set(this,r),In(r,1),this.#e.add(e)}disconnect(){let e=Dt;if(e!=null){for(let n of this.#e){let r=e.get(n),o=r?.get(this);o!=null&&(r.delete(this),Cn--,In(o,-1)),r?.size===0&&e.delete(n)}this.#e.clear(),this.#n.length=0,Cn===0&&(Dt=void 0)}}takeRecords(){return this.#n.splice(0)}enqueue(e){this.#n.push(e),!this.#r&&(this.#r=!0,queueMicrotask(()=>{this.#r=!1;let n=this.takeRecords();n.length>0&&this.#t.call(this,n,this)}))}};function te(t){let e=Dt;if(e==null)return;let n=new Map,r=t.target;for(;r;){let o=e.get(r);if(o)for(let[s,i]of o){if(r!==t.target&&!i.subtree)continue;let l=!1;if(t.type==="attributes"){if(!i.attributes||i.attributeFilter&&!i.attributeFilter.has(t.attributeName??""))continue;l=i.attributeOldValue}else if(t.type==="characterData"){if(!i.characterData)continue;l=i.characterDataOldValue}else if(!i.childList)continue;n.set(s,n.get(s)===!0||l)}r=r.parentNode}for(let[o,s]of n)o.enqueue({addedNodes:t.addedNodes??new Q,attributeName:t.attributeName??null,attributeNamespace:t.attributeNamespace??null,nextSibling:t.nextSibling??null,oldValue:s?t.oldValue??null:null,previousSibling:t.previousSibling??null,removedNodes:t.removedNodes??new Q,target:t.target,type:t.type})}function Gt(...t){let e=new Q;return e.push(...t),e}function Ro(t){if(t.attributes===!1&&(t.attributeOldValue||t.attributeFilter!=null))throw new TypeError("attributeOldValue and attributeFilter require attributes to be enabled");if(t.characterData===!1&&t.characterDataOldValue)throw new TypeError("characterDataOldValue requires characterData to be enabled");let e=t.attributes??(t.attributeOldValue===!0||t.attributeFilter!=null),n=t.characterData??t.characterDataOldValue===!0,r=t.childList===!0;if(!e&&!n&&!r)throw new TypeError("MutationObserver options must enable childList, attributes, or characterData");return{attributes:e,attributeFilter:t.attributeFilter==null?void 0:new Set(t.attributeFilter.map(String)),attributeOldValue:t.attributeOldValue===!0,characterData:n,characterDataOldValue:t.characterDataOldValue===!0,childList:r,subtree:t.subtree===!0}}function In(t,e){t.attributes&&(Tr+=e),t.characterData&&(wr+=e),t.childList&&(Sr+=e),Ge=Tr>0,kn=wr>0,at=Sr>0}var oe=class extends ye{childNodes=new Q;children=new Q;appendChild(e){return F(()=>this[ee](e,null))}insertBefore(e,n){return F(()=>this[ee](e,n||null))}append(...e){return F(()=>{let n=ve(e.filter(r=>r!=null));n.length>1&&le(this,n);for(let r of n)this[ee](it(this,r),null)})}prepend(...e){return F(()=>{let n=ve(e.filter(o=>o!=null));n.length>1&&le(this,n);let r=this.firstChild;for(let o of n)this[ee](it(this,o),r)})}replaceChildren(...e){return F(()=>{let n=ve(e.filter(o=>o!=null));le(this,n);let r;for(;r=this.firstChild;)this.removeChildImmediately(r);for(let o of n)this[ee](it(this,o),null)})}removeChild(e){return F(()=>(this.removeChildImmediately(e),e))}removeChildImmediately(e){if(e.parentNode!==this)throw M("The node is not a child of this node","NotFoundError");let n=this[B]?st(e):void 0,r=e[D],o=e[p],s=Ht(this,e);if(n)for(let i of n)i[B]=!1;this.queueRemovalMutationRecord(this,e,r,o),n&&this.enqueueTreeReactions(n,"disconnectedCallback"),Oe(this.collectRemovalHookEffects(e,s))}replaceChild(e,n){return F(()=>this[kt](e,n))}[kt](e,n,r){if(le(this,[e]),n.parentNode!==this)throw M("The reference node is not a child of this parent","NotFoundError");let o=n[D],s=n[p],i=this.prepareInsertion(e),l=this[B]?st(n):void 0,c=new Set(i.map(({node:y})=>y)),u=s;for(;u&&c.has(u);)u=u[p];let m=Ht(this,n);if(l){for(let E of l)E[B]=!1;let y=new Set(l);for(let E of i)y.has(E.node)&&(E.shouldDisconnect=!1)}this.commitInsertion(i,u);let g=this[B];return this.queueRemovalMutationRecord(this,n,o,s),this.queueInsertionMutationRecords(i),l&&this.enqueueTreeReactions(l,"disconnectedCallback"),this.enqueueInsertionReactions(i,g),this.performOrCollectHookEffects([...this.collectRemovalHookEffects(n,m),...this.collectInsertionHookEffects(i)],r),n}querySelectorAll(e){return At(this,e)}querySelector(e){return xt(this,e)}[ee](e,n,r){return this.validateInsertion(e,n),this.insertIntoValidated(e,n,r),e}[Mn](e){for(let n of e)this.validateInsertion(n,null),this.prepareInsertion(n)}validateInsertion(e,n){if(le(this,[e]),n&&n.parentNode!==this)throw M("The reference node is not a child of this parent","NotFoundError")}insertIntoValidated(e,n,r){e===n&&(n=e[p]);let o=this.prepareInsertion(e);this.commitInsertion(o,n);let s=this[B];this.queueInsertionMutationRecords(o),this.enqueueInsertionReactions(o,s),this.performOrCollectHookEffects(this.collectInsertionHookEffects(o),r)}performOrCollectHookEffects(e,n){n?n.push(...e):Oe(e)}prepareInsertion(e){let n=[];if(e.nodeType===he){let i=e[R];for(;i;)n.push(i),i=i[p]}else n.push(e);let r=this[B],o=this[k],s=[];for(let i of n){let l=i[B],c=l||r,u,m;if(i[k]===o)c&&(u=st(i));else{let g=Rt(i);m=g.nodes,c&&(u=g.treeNodes)}s.push({node:i,nodes:u,adoption:m,shouldDisconnect:l})}return s}commitInsertion(e,n){for(let s of e){let i=s.node[z];if(i){let l=s.node[D],c=s.node[p];s.source={parent:i,index:Ht(i,s.node),previousSibling:l,nextSibling:c}}}for(let s of e){let i=this.attachChild(s.node,n);s.insertIndex=i.index,s.previousSibling=i.previousSibling,s.nextSibling=i.nextSibling}let r=this[k];for(let{adoption:s}of e)s&&ot(s,r);let o=this[B];for(let{nodes:s}of e)if(s)for(let i of s)i[B]=o}attachChild(e,n){if(n){let s=n[D];e[p]=n,e[D]=s,s?s[p]=e:this[R]=e,n[D]=e}else{e[p]=null;let s=this[R];if(s){let i;for(;i=s[p];)s=i;s[p]=e,e[D]=s}else this[R]=e,e[D]=null}let r=j(e);e[z]=this;let o;if(n){if(o=this.childNodes.indexOf(n),this.childNodes.splice(o,0,e),r){let s=n;for(;s&&!j(s);)s=s[p];s?this.children.splice(this.children.indexOf(s),0,e):this.children.push(e)}}else o=this.childNodes.length,this.childNodes.push(e),r&&this.children.push(e);return{index:o,previousSibling:e[D],nextSibling:e[p]}}queueRemovalMutationRecord(e,n,r,o){at&&te({type:"childList",target:e,removedNodes:Gt(n),previousSibling:r,nextSibling:o})}queueInsertionMutationRecords(e){if(at)for(let n of e){let{node:r,source:o}=n;o&&this.queueRemovalMutationRecord(o.parent,r,o.previousSibling,o.nextSibling),te({type:"childList",target:this,addedNodes:Gt(r),previousSibling:n.previousSibling,nextSibling:n.nextSibling})}}collectRemovalHookEffects(e,n){return this.nodeType!==$||Ze(this)?[]:[[()=>this[L].removeChild?.(this,e,n)]]}collectInsertionHookEffects(e){let n=[];for(let r of e){let{node:o,source:s}=r;s?.parent.nodeType===$&&!Ze(s.parent)&&n.push([()=>s.parent[L].removeChild?.(s.parent,o,s.index)]),this.nodeType===$&&!Ze(this)&&n.push([()=>this[L].insertChild?.(this,o,r.insertIndex),o])}return n}enqueueInsertionReactions(e,n){for(let r of e){let{nodes:o}=r;o&&(r.shouldDisconnect&&this.enqueueTreeReactions(o,"disconnectedCallback"),n&&this.enqueueTreeReactions(o,"connectedCallback"))}}enqueueTreeReactions(e,n){vr(e,n)}};function Or(t,e,n,r){if(e.parentNode!==t)throw Error("not a child of this node");let o=t[B]?n.treeNodes:void 0,s=e[D],i=e[p],l=Ht(t,e);if(o)for(let u of o)u[B]=!1;ot(n.nodes,r),at&&te({type:"childList",target:t,removedNodes:Gt(e),previousSibling:s,nextSibling:i}),o&&vr(o,"disconnectedCallback");let c=[];t.nodeType===$&&!Ze(t)&&c.push([()=>t[L].removeChild?.(t,e,l)]),Oe(c)}function Ht(t,e){let n=e[D],r=e[p];n?n[p]=r:t[R]=r,r&&(r[D]=n);let o=t.childNodes.indexOf(e);return t.childNodes.splice(o,1),j(e)&&t.children.splice(t.children.indexOf(e),1),e[z]=null,e[p]=null,e[D]=null,o}function vr(t,e){for(let n of t){let r=n[e];typeof r=="function"&&bt(n,()=>r.call(n))}}function lt(t,e,n,r,o){let{observedAttributes:s}=t.constructor,{attributeChangedCallback:i}=t;i==null||s==null||!s.includes(e)||bt(t,()=>i.call(t,e,n,r,o))}var Ut=class{[R]=null;constructor(e){this[Y]=e}getNamedItem(e){let n=String(e),r=this[Y][v]===_?H(n):n,o=this[R];for(;o;){if(o.name===r)return o;o=o[p]}return null}getNamedItemNS(e,n){let r=ae(e),o=String(n),s=this[R];for(;s;){if(s.localName===o&&s[v]===r)return s;s=s[p]}return null}item(e){let n=this[R],r=0;for(;n;){if(r++===e)return n;n=n[p]}return null}get length(){let e=0,n=this[R];for(;n;)e++,n=n[p];return e}removeNamedItem(e){let n=String(e),r=this[Y][v]===_?H(n):n;return F(()=>this.removeNamedItemImmediately(o=>o.name===r))}removeNamedItemNS(e,n){let r=ae(e),o=String(n);return F(()=>this.removeNamedItemImmediately(s=>s.localName===o&&s[v]===r))}removeNamedItemImmediately(e){let n=this[Y],r=this[R],o=null;for(;r!=null;){if(e(r)){o&&(o[p]=r[p]),this[R]===r&&(this[R]=r[p]);let s=r.value;return r[p]=null,r[Y]=null,Ge&&te({type:"attributes",target:n,attributeName:r.name,attributeNamespace:r[v],oldValue:s}),n[L].removeAttribute?.(n,r.name,r[v]),lt(n,r.localName,s,null,r[v]),r}o=r,r=r[p]}return null}setNamedItem(e){return F(()=>this.setNamedItemImmediately(e))}setNamedItemImmediately(e){let n=this[Y],r=e[Y];if(r!=null&&r!==n)throw M("The attribute is already in use by another element.","InUseAttributeError");let o=null,s=this[R],i=null;for(;s;){if(s.localName===e.localName&&s[v]===e[v]){if(s===e)return s;i?i[p]=e:this[R]=e,e[p]=s[p],s[p]=null,o=s;break}i=s,s=s[p]}o==null&&(i?i[p]=e:this[R]=e),e[Y]=n,e[k]=n[k],o&&(o[Y]=null);let l=o==null||o.value!==e.value,c=o!=null&&o.name!==e.name;return l&&Ge&&te({type:"attributes",target:n,attributeName:e.name,attributeNamespace:e[v],oldValue:o?.value??null}),c&&n[L].removeAttribute?.(n,o.name,o[v]),(l||c)&&n[L].setAttribute?.(n,e.name,e.value,e[v]),l&&lt(n,e.localName,o?.value??null,e.value,e[v]),o}setNamedItemNS(e){return this.setNamedItem(e)}*[Symbol.iterator](){let e=this[R];for(;e;)yield e,e=e[p]}};var xe=class extends J{nodeType=ke;[v]=null;[p]=null;[Y]=null;constructor(e,n,r){super(),this[O]=e,this[me]=n,r&&(this[v]=r)}get nodeName(){return this[O]}set nodeName(e){}get name(){return this[O]}set name(e){}get localName(){if(this[v]==null)return this[O];let e=this[O].indexOf(":");return e<0?this[O]:this[O].slice(e+1)}get prefix(){if(this[v]==null)return null;let e=this[O].indexOf(":");return e<0?null:this[O].slice(0,e)}get value(){return this[me]}set value(e){let n=String(e),r=this[Y];if(!r){this[me]=n;return}F(()=>{let o=this[me];this[me]=n,Ge&&o!==n&&te({type:"attributes",target:r,attributeName:this[O],attributeNamespace:this[v],oldValue:o}),this[L].setAttribute?.(r,this[O],n,this[v]),lt(r,this.localName,o,n,this[v])})}get nodeValue(){return this.value}set nodeValue(e){this.value=e}get ownerElement(){return this[Y]}get namespaceURI(){return this[v]}get specified(){return!0}};var _o={amp:"&",AMP:"&",apos:"\'",gt:">",GT:">",lt:"<",LT:"<",quot:\'"\',QUOT:\'"\'},Po=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Mo=/(?:<([a-z][a-z0-9-:]*)((?:[\\s]+[^<>\'"=/\\s]+(?:=([\'"])[^]*?\\3|=[^>\'"\\s]*|))*)[\\s]*(\\/?)\\s*>|<\\/([a-z][a-z0-9-:]*)>|<!--(.*?)-->|([^<>]+))/gi,Rr=/\\s([^<>\'"=/\\n\\s]+)(?:=(["\'])([\\s\\S]*?)\\2|=([^>\'"\\n\\s]*)|)/g,Co="|b|big|blockquote|body|br|center|code|dd|div|dl|dt|em|embed|h1|h2|h3|h4|h5|h6|head|hr|i|img|li|listing|menu|meta|nobr|ol|p|pre|ruby|s|small|span|strong|strike|sub|sup|table|tt|u|ul|var|",Io=/^(?:color|face|size)$/i;function xr(t){return t.replace(/&(?:(amp|AMP|apos|gt|GT|lt|LT|quot|QUOT)|#(\\d+)|#[xX]([\\da-fA-F]+));/g,(e,n,r,o)=>{if(n)return _o[n];let s=Number.parseInt(r??o,r?10:16);try{return String.fromCodePoint(s)}catch{return e}})}function _r(t){return t.namespaceURI===_&&Po.has(t.localName)}function Ar(t){let e=t.localName;return t[v]===Z&&(e==="foreignObject"||e==="desc"||e==="title")}function ko(t,e){if(Co.includes(`|${t}|`))return!0;if(t!=="font")return!1;for(let n of e.matchAll(Rr))if(Io.test(n[1]))return!0;return!1}function Bt(t,e){let n=e.ownerDocument,r=n.createDocumentFragment(),o=[],s=r;for(let i of t.matchAll(Mo)){let l=i[1];if(l){let c=i[2],u=H(l),m=o[o.length-1]?.element??e,g=m[v]===Z?Z:_;if(u==="svg")g=Z;else if(g===Z){if(Ar(m))g=_;else if(ko(u,c)){for(;o.length>0;){let x=o[o.length-1];if(x.element[v]!==Z||Ar(x.element))break;o.pop(),s=x.target}g=_}}let y=g===_?u:l,E=n[Ie](y,g,null,y);for(let x of c.matchAll(Rr))E.setAttribute(x[1],xr(x[3]||x[4]||""));if(s.append(E),_r(E)||g!==_&&i[4])continue;o.push({element:E,target:s}),s=g===_&&u==="template"?E.content:E}else if(i[5]){let c=H(i[5]);for(let u=o.length-1;u>=0;u--){let m=o[u],g=H(m.element[O]);if(g===c){s=m.target,o.length=u;break}if(m.element[v]===_&&g==="template")break}}else i[6]?s.append(n.createComment(i[6])):s.append(xr(i[7]))}return r}function Vt(t){return Mr([{type:"content",child:t[R]}])}function Pr(t){return Mr([{type:"opening",node:t}])}function Mr(t){let e=[],n;for(;n=t.pop();)switch(n.type){case"opening":{let r=n.node;switch(r.nodeType){case $:{let o=r;e.push(`<${o[O]}`);let s=o[re]?.[R];for(;s;){e.push(` ${s[O]}`);let l=s[me];l!==""&&(l=String(l).replace(/&/g,"&amp;").replace(/"/g,"&quot;"),e.push(`="${l}"`)),s=s[p]}if(e.push(">"),_r(o))break;let i=o.namespaceURI===_&&o.localName==="template"?o[ie]:o;t.push({type:"closing",name:o[O]}),t.push({type:"content",child:i?.[R]??null});break}case De:{let o=r;e.push(o[K].replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;"));break}case Le:{let o=r;e.push(`<!--${o[K]}-->`);break}}break}case"content":{let r=n.child;r&&(t.push({type:"content",child:r[p]}),t.push({type:"opening",node:r}));break}case"closing":e.push(`</${n.name}>`);break}return e.join("")}var U=class extends oe{nodeType=$;[v]=_;[fe]=null;get namespaceURI(){return this[v]}get prefix(){return this[fe]}get localName(){let e=this[fe];return e==null?this[O]:this[O].slice(e.length+1)}get nodeName(){return this[v]===_?sr(this[O]):this[O]}get tagName(){return this.nodeName}get id(){return this.getAttributeNS(null,"id")??""}set id(e){this.setAttribute("id",String(e))}get slot(){return this.getAttributeNS(null,"slot")??""}set slot(e){let n=String(e);this.getAttributeNS(null,"slot")!==n&&this.attributes.setNamedItem(new xe("slot",n))}get attributes(){let e=this[re];return e||(e=new Ut(this),this[re]=e),e}getAttributeNames(){return[...this.attributes].map(e=>e.name)}getElementsByTagName(e){return Ct(this,e)}get firstElementChild(){return this.children[0]??null}getElementsByClassName(e){return Mt(this,e)}get lastElementChild(){return this.children[this.children.length-1]??null}get nextElementSibling(){let e=this.nextSibling;for(;e&&e.nodeType!==1;)e=e.nextSibling;return e}get previousElementSibling(){let e=this.previousSibling;for(;e&&e.nodeType!==1;)e=e.previousSibling;return e}setAttribute(e,n){let r=String(e),o=String(n);gn(r);let s=this[v]===_?H(r):r,i=this.attributes.getNamedItemNS(null,s);i?i.value=o:this.attributes.setNamedItem(new xe(s,o))}setAttributeNS(e,n,r){let o=ae(e),s=String(n),i=String(r),l=ht(o,s,"attribute"),c=this.attributes.getNamedItemNS(l.namespace,l.localName);c?c.value=i:this.attributes.setNamedItemNS(new xe(l.qualifiedName,i,l.namespace))}toggleAttribute(e,n){let r=String(e);gn(r);let o=this[v]===_?H(r):r,s=this.attributes.getNamedItemNS(null,o),i=n===void 0?void 0:!!n;return s==null?i===!1?!1:(this.attributes.setNamedItem(new xe(o,"")),!0):i===!0?!0:(this.attributes.removeNamedItemNS(null,o),!1)}getAttribute(e){let n=this.attributes.getNamedItem(e);return n&&n.value}getAttributeNS(e,n){let r=this.attributes.getNamedItemNS(e,n);return r&&r.value}hasAttribute(e){return this.attributes.getNamedItem(e)!=null}hasAttributeNS(e,n){return this.attributes.getNamedItemNS(e,n)!=null}removeAttribute(e){let n=String(e),r=this[v]===_?H(n):n;this.attributes.removeNamedItemNS(null,r)}removeAttributeNS(e,n){this.attributes.removeNamedItemNS(e,n)}get outerHTML(){return Pr(this)}get innerHTML(){return Vt(this)}set innerHTML(e){if(e==null||e==="")this.replaceChildren();else{let n=Bt(String(e),this);this.replaceChildren(n)}}};var He=class t extends U{[v]=Z;get ownerSVGElement(){let e=null,n=this.parentNode;for(;n instanceof t;)e=n,n=n.parentNode;return e}};var Ee=class extends ye{[K]="";constructor(e){super(),this[K]=e==null?"":String(e)}setData(e){let n=kn,r=n?this[K]:null,o="";e!=null&&(o=typeof e=="string"?e:String(e)),this[K]=o,n&&r!==o&&te({type:"characterData",target:this,oldValue:r}),this[L].setText?.(this,o)}get data(){return this[K]}set data(e){this.setData(e)}};var Ue=class extends Ee{nodeType=De;[O]="#text"};var Be=class extends Ee{nodeType=Le;[O]="#comment"};var Ve=class extends oe{nodeType=he;[O]="#document-fragment";[k]=typeof window<"u"?window.document:null;getElementById(e){return Pt(this,e)}};var Fe=class extends U{get content(){let e=this[ie];return e||(e=this.ownerDocument.createDocumentFragment(),e[pe]=this,this[ie]=e),e}set content(e){}set innerHTML(e){this.content.replaceChildren(Bt(String(e),this))}get innerHTML(){let e=this[ie];return e?Vt(e):""}};var Ft=class extends U{};var jt=class extends U{};var qt=class extends U{};var ct=class extends oe{nodeType=Se;[O]="#document";[B]=!0;constructor(e){super(),this.defaultView=e,this[k]=this,this.documentElement=zt(new qt,this,"html"),this.body=zt(new Ft,this,"body"),this.head=zt(new jt,this,"head"),this.appendChild(this.documentElement),this.documentElement.appendChild(this.head),this.documentElement.appendChild(this.body)}get textContent(){return null}set textContent(e){}getElementsByClassName(e){return Mt(this,e)}createElement(e){let n=String(e);return lr(n),Dn(this,H(n))}createElementNS(e,n){let r=ht(e,n,"element");return Dn(this,r.qualifiedName,r.namespace,r.prefix,r.localName)}[Ie](e,n,r,o){return Dn(this,e,n,r,o)}createTextNode(e){let n=Yt(new Ue(e),this);return this[L].createText?.(n,n.data),n}createComment(e){return Yt(new Be(e),this)}createDocumentFragment(){return Yt(new Ve,this)}createEvent(){return new V("")}getElementById(e){return Pt(this,e)}getElementsByTagName(e){return Ct(this,e)}importNode(e,n){if(e.nodeType===Se)throw M("Cannot import a document node","NotSupportedError");return _t(e,n,this)}adoptNode(e){if(e[k]===this)return e;let n=Rt(e);return F(()=>{let r=e.parentNode;return r?Or(r,e,n,this):ot(n.nodes,this),e})}};function Yt(t,e){return Object.defineProperty(t,k,{value:e,writable:!0,enumerable:!1}),t}function Dn(t,e,n=_,r=null,o=e){let s;if(n===Z)s=new He;else if(n===_&&o==="template")s=new Fe;else if(n===_){let i=t.defaultView.customElements.get(o);s=i?new i:new U}else s=new U;return zt(s,t,e,n,r)}function zt(t,e,n,r=_,o=null){return Yt(t,e),Object.defineProperties(t,{[O]:{value:n},[v]:{value:r},[fe]:{value:o}}),e[L].createElement?.(t,r),t}var Wt=class extends V{constructor(e,n){super(e,n),this.detail=n?.detail??null}initCustomEvent(e,n,r,o){super.initEvent(e,n,r),this.detail=o??null}};var $t=class extends V{constructor(e,n){super(e,n),this.message=n.message,this.filename=n.filename,this.lineno=n.lineno,this.colno=n.colno,this.error=n.error}};var Xt=class extends V{constructor(e,n){super(e,n),this.promise=n.promise,this.reason=n.reason}};var Kt=class extends V{constructor(e,n){super(e,n),this.oldState=n.oldState,this.newState=n.newState}};var Zt=class extends V{constructor(e,n={}){super(e,n),this.relatedTarget=n.relatedTarget??null}};var Qt=class extends V{constructor(e,n={}){super(e,n),this.clipboardData=n.clipboardData??null}};var Jt=class extends U{};var Do=/^[a-z][^A-Z\\u0000\\t\\n\\f\\r />]*-[^A-Z\\u0000\\t\\n\\f\\r />]*$/u,Lo=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]);function Cr(t){return Do.test(t)&&!Lo.has(t)}function Ir(t){return M(`Invalid custom element name: "${t}"`,"SyntaxError")}var en=class{registry=new Map;listenersByName=new Map;define(e,n,r){if(!Cr(e))throw Ir(e);if(this.registry.has(e))throw M(`A custom element named "${e}" has already been defined`,"NotSupportedError");if(this.getName(n)!=null)throw M("This constructor has already been registered in this custom element registry","NotSupportedError");this.registry.set(e,n);let o=this.listenersByName.get(e);if(o!=null){this.listenersByName.delete(e);for(let s of o)s(n)}}get(e){return this.registry.get(e)}getName(e){for(let[n,r]of this.registry)if(r===e)return n;return null}whenDefined(e){if(!Cr(e))return Promise.reject(Ir(e));let n=this.registry.get(e);if(n!=null)return Promise.resolve(n);let r=this.listenersByName.get(e);return r==null&&(r=[],this.listenersByName.set(e,r)),new Promise(o=>{r.push(o)})}upgrade(e){}initialize(e){}};var Go=["onerror","onunhandledrejection"],Dr=Symbol.for("@remote-dom/polyfill/global-property");function Lr(t){return Object.getOwnPropertyDescriptors(t)}function Gr(t){let e={};for(let[n,r]of Object.entries(Object.getOwnPropertyDescriptors(ge.prototype)))n!=="constructor"&&typeof r.value=="function"&&(r.value=Ln(r.value.bind(t)),e[n]=r);return e}function Hr(t){let e={};for(let n of Go)e[n]={configurable:!0,enumerable:!0,get:Ln(()=>t[n]),set:Ln(r=>{t[n]=r})};return e}function Ho(t){return Object.assign(Lr(t),Gr(t),Hr(t))}function Ln(t){return Object.defineProperty(t,Dr,{value:!0}),t}function kr(t,e){for(let n of Reflect.ownKeys(e)){let r=Uo(t,n);(r==null||Bo(r))&&Object.defineProperty(t,n,e[n])}}function Uo(t,e){let n=t;for(;n;){let r=Object.getOwnPropertyDescriptor(n,e);if(r)return r;n=Object.getPrototypeOf(n)}}function Bo(t){return[t.value,t.get,t.set].some(e=>typeof e=="function"&&e[Dr]===!0)}var Ae=class extends ge{[L]={};[mt]=[];[we]=Fo(this);name="";window=this;parent=this;self=this;top=this;document=new ct(this);customElements=new en;location=globalThis.location;navigator=globalThis.navigator;Event=V;ErrorEvent=$t;PromiseRejectionEvent=Xt;ToggleEvent=Kt;FocusEvent=Zt;ClipboardEvent=Qt;EventTarget=ge;CustomEvent=Wt;Node=J;ParentNode=oe;ChildNode=ye;DocumentFragment=Ve;Document=ct;CharacterData=Ee;Comment=Be;Text=Ue;Element=U;HTMLElement=Jt;SVGElement=He;HTMLTemplateElement=Fe;MutationObserver=Lt;#t=null;#n=null;#e=null;static with(...e){let n=this;return class extends n{constructor(){super();for(let o of e)Vo(this,o)}}}get onerror(){return this.#n}set onerror(e){this.#t&&this.removeEventListener("error",this.#t),e&&typeof e=="function"?(this.#n=e,this.#t=n=>{e(n.message??"Error",n.filename,n.lineno,n.colno,n.error)},this.addEventListener("error",this.#t)):(this.#t=null,this.#n=null)}get onunhandledrejection(){return this.#e}set onunhandledrejection(e){this.#e&&this.removeEventListener("unhandledrejection",this.#e),e&&typeof e=="function"?(this.#e=e,this.addEventListener("unhandledrejection",this.#e)):this.#e=null}static setGlobal(e){let n=globalThis.self,r=globalThis.window,o=Lr(e),s=Object.assign(Gr(e),Hr(e));delete o.self,Object.defineProperties(globalThis,o),kr(globalThis,s),typeof n>"u"||n===r&&n!==globalThis?Object.defineProperty(globalThis,"self",{value:e,configurable:!0,writable:!0,enumerable:!0}):n!==globalThis&&(Object.defineProperties(n,o),kr(n,s))}static setGlobalThis(e){for(let n in e)e[n]===e&&(e[n]=globalThis);Object.defineProperties(globalThis,Ho(e))}};function Vo(t,e){t[mt].push(e(t)??{})}function Fo(t){return{createElement:ce.bind(null,t,"createElement"),setAttribute:ce.bind(null,t,"setAttribute"),removeAttribute:ce.bind(null,t,"removeAttribute"),createText:ce.bind(null,t,"createText"),setText:ce.bind(null,t,"setText"),insertChild:ce.bind(null,t,"insertChild"),removeChild:ce.bind(null,t,"removeChild"),addEventListener:ce.bind(null,t,"addEventListener"),removeEventListener:ce.bind(null,t,"removeEventListener")}}function ce(t,e,...n){for(let s of t[mt])s[e]?.apply(s,n);let r=t[L];r[e]?.apply(r,n)}var tn=new Ae;var Gn="~";var be=new WeakMap;function je(t){return be.get(t)}var Vn=new WeakMap,qo=0;function X(t){let e=Vn.get(t);return e==null&&(e=String(qo++),nn(t,e)),e}function nn(t,e){Vn.set(t,e)}var Un=new WeakMap;function Yo(t){return Un.get(t)}var Bn=new WeakMap;function zo(t){let e=Bn.get(t);if(e!=null)return e;if(!(!(t instanceof Element)||t.tagName.includes("-"))){e={};for(let{name:n,value:r}of t.attributes)e[n]=r;return e}}var Wo=new WeakMap;function $o(t){return Wo.get(t)}function Fn(t,e,n){let r=Un.get(t);if(r==null&&(r={},Un.set(t,r)),r[e]===n)return;r[e]=n;let o=be.get(t);o?.mutate([[3,X(t),e,n,1]])}function Ne(t,e,n){let r=Bn.get(t);if(r==null&&(r={},Bn.set(t,r)),r[e]===n)return;n==null?delete r[e]:r[e]=String(n);let o=be.get(t);o?.mutate([[3,X(t),e,n,2]])}function qe(t,e){if(be.get(t)!==e&&(be.set(t,e),t.childNodes))for(let r=0;r<t.childNodes.length;r++)qe(t.childNodes[r],e)}function rn(t){if(be.get(t)!=null&&(be.delete(t),t.childNodes))for(let n=0;n<t.childNodes.length;n++)rn(t.childNodes[n])}function Ye(t){let{nodeType:e}=t;switch(e){case 1:return{id:X(t),type:e,element:t.localName,properties:Hn(Yo(t)),attributes:Hn(zo(t)),eventListeners:Hn($o(t)),children:Array.from(t.childNodes).map(Ye)};case 3:case 8:return{id:X(t),type:e,data:t.data};default:throw new Error(`Cannot serialize node of type ${t.nodeType} (${typeof t.nodeType})`)}}function Hn(t){return t?{...t}:void 0}function jn(t,e,...n){let r=Vn.get(t),o=be.get(t);if(r==null||o==null)throw new Error(`Cannot call method ${e} on an unconnected node`);return o.call(r,e,...n)}var ze=tn[L];ze.insertChild=(t,e,n)=>{let r=je(t);r!=null&&(qe(e,r),r.mutate([[0,X(t),Ye(e),n]]))};ze.removeChild=(t,e,n)=>{let r=je(t);r!=null&&(rn(e),r.mutate([[1,X(t),n]]))};ze.setText=(t,e)=>{let n=je(t);n?.mutate([[2,X(t),e]])};ze.setAttribute=(t,e,n)=>{t.tagName.includes("-")||Ne(t,e,n)};ze.removeAttribute=(t,e)=>{t.tagName.includes("-")||Ne(t,e)};Ae.setGlobal(tn);function on(t){if(typeof t=="string")return{type:"navigate",to:t};let{place:e,record:n,where:r,section:o}=t??{},s={...r===void 0?{}:{where:r},...o===void 0?{}:{section:String(o)}};return typeof e=="string"?{type:"navigate",place:e,...s}:typeof n=="string"?{type:"navigate",to:n,...s}:void 0}var Br=["wheel","drag","pinch"];function Vr(t){let e=t;return typeof t=="object"&&t!==null&&e.graview==="host-hello"&&typeof e.nonce=="string"}function jr(t,e={}){let n,r="",o,s=0,i=new Set,l=new Map,c=[],u=N=>{n?n.postMessage({...N,nonce:r}):c.push(N)},m=N=>{let w=N.data;if(!(!w||typeof w!="object")){if(w.type==="props"){o=w.props;for(let C of i)C(w.props)}else w.type==="answer"?(l.get(w.id)?.(w),l.delete(w.id)):w.type==="event"&&typeof w.listener=="number"?e.onEvent?.(w):w.type==="heartbeat"&&typeof w.beat=="number"&&u({type:"heartbeat",beat:w.beat});e.onMessage?.(w)}},g=()=>{},y=N=>{if(n||!t.fromHost(N)||!Vr(N.data)||N.data.protocol!==1)return;let w=N.ports[0];if(w){n=w,r=N.data.nonce,n.onmessage=m,n.start?.(),g();for(let C of c.splice(0))u(C)}};g=t.listen(y),t.ready({graview:"guest-ready",protocol:1});let E,x={get props(){return o},subscribe(N){return i.add(N),()=>i.delete(N)},act(N,w={}){let C=s+=1;return new Promise(I=>{l.set(C,I),u({type:"act",id:C,name:N,args:w})})},navigate(N){let w=on(N);w&&u(w)},size(N){u({type:"size",height:N})},autoSize(N){let w=N??globalThis.document?.documentElement,C=globalThis.ResizeObserver;if(!w||!C||typeof w.getBoundingClientRect!="function")return()=>{};E?.disconnect();let I=new C(()=>x.size(Math.ceil(w.getBoundingClientRect().height)));return I.observe(w),E=I,()=>I.disconnect()},close(){E?.disconnect(),g(),n?.close(),i.clear()}};return{guest:x,send:u}}var Yr=["globalThis","Infinity","NaN","undefined","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape","Object","Function","Array","Number","Boolean","String","Symbol","BigInt","Date","Promise","RegExp","Math","JSON","Reflect","Proxy","Intl","Error","AggregateError","EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError","SuppressedError","Map","Set","WeakMap","WeakSet","WeakRef","FinalizationRegistry","Iterator","AsyncIterator","DisposableStack","AsyncDisposableStack","ArrayBuffer","SharedArrayBuffer","DataView","Atomics","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float16Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"],zr=["window","parent","top","document","customElements","Event","ErrorEvent","PromiseRejectionEvent","ToggleEvent","FocusEvent","ClipboardEvent","CustomEvent","EventTarget","Node","ParentNode","ChildNode","DocumentFragment","Document","CharacterData","Comment","Text","Element","HTMLElement","SVGElement","HTMLTemplateElement","MutationObserver"],Wr=["self","postMessage","setTimeout","clearTimeout","setInterval","clearInterval","queueMicrotask","structuredClone","crypto","console","DOMException"],$r=["TEMPORARY","PERSISTENT"],xl=Object.freeze([...Yr,...zr,...Wr,...$r]),Al=Object.freeze(["constructor","__defineGetter__","__defineSetter__","hasOwnProperty","__lookupGetter__","__lookupSetter__","isPrototypeOf","propertyIsEnumerable","toString","valueOf","__proto__","toLocaleString"]),qr=t=>typeof t=="symbol"?`[${t.description??"symbol"}]`:t;function Xr(t=globalThis,e=[],n={}){let r=[],o=[],s=new Set([...Yr,...zr,...Wr,...e,"constructor",Symbol.toStringTag]),i=(S,P)=>{let q=Reflect.getOwnPropertyDescriptor(S,P);return q===void 0||!("value"in q)||q.writable||q.configurable?!1:n.primitivesStay&&typeof P=="symbol"&&(typeof q.value!="object"||q.value===null)&&typeof q.value!="function"?!0:$r.includes(P)&&typeof q.value=="number"},l=t,c=l.setTimeout,u=l.setInterval,m=l.crypto,g=(S,P)=>function(q,dt,...ft){if(typeof q!="function")throw new TypeError(`${P} takes a function: a guest view cannot run code from text`);return S.call(t,q,dt,...ft)},y=m?Object.freeze({getRandomValues:S=>m.getRandomValues(S)}):void 0,E=l.document?.defaultView;if(E&&E!==l)for(let S of Reflect.ownKeys(E))typeof S=="symbol"||s.has(S)||Reflect.deleteProperty(E,S)||o.push(`window.${S}`);let x=[];for(let S=t;S&&S!==Object.prototype;S=Object.getPrototypeOf(S))x.push(S);for(let S of x)for(let P of Reflect.ownKeys(S))s.has(P)||(Reflect.deleteProperty(S,P)?r.push(qr(P)):i(S,P)||o.push(qr(P)));let N=()=>function(){throw new EvalError("A guest view cannot make code from text.")},w=[Function.prototype,Object.getPrototypeOf(async function(){}),Object.getPrototypeOf(function*(){}),Object.getPrototypeOf(async function*(){})];for(let S of w){let P=N();Object.defineProperty(P,"prototype",{value:S,writable:!1,enumerable:!1,configurable:!1}),Reflect.defineProperty(S,"constructor",{value:P,writable:!1,enumerable:!1,configurable:!1})||o.push("Function.prototype.constructor"),S===Function.prototype&&Reflect.defineProperty(t,"Function",{value:P,writable:!0,enumerable:!1,configurable:!0})}let C=(S,P)=>{Reflect.defineProperty(t,S,{value:P,writable:!0,enumerable:!0,configurable:!0})||o.push(S)};C("setTimeout",g(c,"setTimeout")),C("setInterval",g(u,"setInterval")),y&&C("crypto",y);for(let S of x.slice(1))Object.freeze(S);for(let S of Reflect.ownKeys(t)){let P=Reflect.getOwnPropertyDescriptor(t,S);Reflect.defineProperty(t,S,"value"in P?{...P,writable:!1,configurable:!1}:{...P,configurable:!1})}let I;try{I=Reflect.preventExtensions(t)}catch{I=!1}return{removed:r,stuck:o,sealed:I}}var ut=class extends HTMLElement{constructor(){super(),nn(this,Gn)}connect(e){if(je(this)===e||(qe(this,e),this.childNodes.length===0))return;let n=[];for(let r=0;r<this.childNodes.length;r++){let o=this.childNodes[r];n.push([0,Gn,Ye(o),r])}e.mutate(n)}updateRemoteProperty(e,n){Fn(this,e,n)}callRemoteMethod(e,...n){return jn(this,e,...n)}};var f={},qn={empty:!0},Xo={id:"text",class:"text",title:"text",lang:"text",dir:{oneOf:["ltr","rtl","auto"]},hidden:"text",tabindex:{oneOf:["-1","0"]},role:"text",style:"style",translate:{oneOf:["yes","no"]},spellcheck:{oneOf:["true","false"]},draggable:{oneOf:["true","false"]},inert:"boolean"},Yn={div:f,section:f,article:f,aside:f,header:f,footer:f,nav:f,hgroup:f,search:f,address:f,figure:f,figcaption:f,blockquote:f,p:f,pre:f,hr:qn,br:qn,wbr:qn,h1:f,h2:f,h3:f,h4:f,h5:f,h6:f,span:f,strong:f,em:f,b:f,i:f,u:f,s:f,small:f,mark:f,abbr:f,cite:f,q:f,code:f,kbd:f,samp:f,var:f,sub:f,sup:f,dfn:f,bdi:f,bdo:f,ruby:f,rt:f,rp:f,time:{attributes:{datetime:"text"}},data:{attributes:{value:"text"}},del:{attributes:{datetime:"text"}},ins:{attributes:{datetime:"text"}},a:{attributes:{href:"link"}},ul:f,menu:f,dl:f,dt:f,dd:f,ol:{attributes:{start:"number",reversed:"boolean",type:{oneOf:["1","a","A","i","I"]}}},li:{attributes:{value:"number"}},table:f,caption:f,thead:f,tbody:f,tfoot:f,tr:f,colgroup:{attributes:{span:"number"}},col:{attributes:{span:"number"},empty:!0},th:{attributes:{colspan:"number",rowspan:"number",headers:"text",scope:{oneOf:["row","col","rowgroup","colgroup"]},abbr:"text"}},td:{attributes:{colspan:"number",rowspan:"number",headers:"text"}},details:{attributes:{open:"boolean",name:"text"}},summary:f,button:{attributes:{type:{oneOf:["button"]},disabled:"boolean",name:"text",value:"text"}},input:{empty:!0,attributes:{type:{oneOf:["text","search","number","range","checkbox","radio","date","time","datetime-local","month","week","color","email","tel","url"]},name:"text",value:"text",placeholder:"text",min:"text",max:"text",step:"text",checked:"boolean",disabled:"boolean",readonly:"boolean",required:"boolean",maxlength:"number",minlength:"number",size:"number",pattern:"text",multiple:"boolean",inputmode:"text",enterkeyhint:"text"}},select:{attributes:{name:"text",disabled:"boolean",multiple:"boolean",required:"boolean",size:"number"}},option:{attributes:{value:"text",selected:"boolean",disabled:"boolean",label:"text"}},optgroup:{attributes:{label:"text",disabled:"boolean"}},textarea:{attributes:{name:"text",placeholder:"text",rows:"number",cols:"number",disabled:"boolean",readonly:"boolean",required:"boolean",maxlength:"number",minlength:"number",wrap:{oneOf:["soft","hard","off"]}}},label:{attributes:{for:"text"}},fieldset:{attributes:{disabled:"boolean",name:"text"}},legend:f,output:f,meter:{attributes:{value:"number",min:"number",max:"number",low:"number",high:"number",optimum:"number"}},progress:{attributes:{value:"number",max:"number"}},img:{empty:!0,attributes:{src:"image",alt:"text",width:"number",height:"number",decoding:{oneOf:["async","sync","auto"]}}},"graview-video":{empty:!0,attributes:{autoplay:"boolean",cover:"boolean"}}},Ko=["fill","fill-opacity","fill-rule","stroke","stroke-width","stroke-linecap","stroke-linejoin","stroke-dasharray","stroke-dashoffset","stroke-opacity","stroke-miterlimit","opacity","color","display","visibility","transform-origin","clip-path","clip-rule","marker-start","marker-mid","marker-end","font-family","font-size","font-weight","font-style","text-anchor","dominant-baseline","alignment-baseline","letter-spacing","text-decoration","paint-order","vector-effect","shape-rendering","pointer-events","stop-color","stop-opacity","overflow","mask","filter","flood-color","flood-opacity","lighting-color","color-interpolation-filters"],Zo={id:"text",class:"text",style:"style",lang:"text",role:"text",tabindex:{oneOf:["-1","0"]},transform:"geometry",...Object.fromEntries(Ko.map(t=>[t,"css"]))},ue={x:"geometry",y:"geometry",width:"geometry",height:"geometry"},sn={viewBox:"geometry",preserveAspectRatio:"geometry"},Kr={oneOf:["userSpaceOnUse","objectBoundingBox"]},Zr={oneOf:["R","G","B","A"]},ne={...ue,in:"text",result:"text"},Qr={gradientUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},gradientTransform:"geometry",spreadMethod:{oneOf:["pad","reflect","repeat"]},href:"fragment"},Jr={svg:{attributes:{...ue,...sn}},g:f,defs:f,symbol:{attributes:{...ue,...sn,refX:"geometry",refY:"geometry"}},use:{attributes:{...ue,href:"fragment"}},title:f,desc:f,path:{attributes:{d:"geometry",pathLength:"number"}},rect:{attributes:{...ue,rx:"geometry",ry:"geometry",pathLength:"number"}},circle:{attributes:{cx:"geometry",cy:"geometry",r:"geometry",pathLength:"number"}},ellipse:{attributes:{cx:"geometry",cy:"geometry",rx:"geometry",ry:"geometry",pathLength:"number"}},line:{attributes:{x1:"geometry",y1:"geometry",x2:"geometry",y2:"geometry",pathLength:"number"}},polyline:{attributes:{points:"geometry",pathLength:"number"}},polygon:{attributes:{points:"geometry",pathLength:"number"}},text:{attributes:{x:"geometry",y:"geometry",dx:"geometry",dy:"geometry",rotate:"geometry",textLength:"geometry",lengthAdjust:{oneOf:["spacing","spacingAndGlyphs"]}}},tspan:{attributes:{x:"geometry",y:"geometry",dx:"geometry",dy:"geometry",rotate:"geometry",textLength:"geometry"}},textPath:{attributes:{href:"fragment",startOffset:"geometry",method:{oneOf:["align","stretch"]},spacing:{oneOf:["auto","exact"]},side:{oneOf:["left","right"]}}},linearGradient:{attributes:{x1:"geometry",y1:"geometry",x2:"geometry",y2:"geometry",...Qr}},radialGradient:{attributes:{cx:"geometry",cy:"geometry",r:"geometry",fx:"geometry",fy:"geometry",fr:"geometry",...Qr}},stop:{attributes:{offset:"geometry"}},clipPath:{attributes:{clipPathUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]}}},mask:{attributes:{...ue,maskUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},maskContentUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]}}},pattern:{attributes:{...ue,...sn,patternUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},patternContentUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},patternTransform:"geometry",href:"fragment"}},marker:{attributes:{...sn,markerWidth:"geometry",markerHeight:"geometry",refX:"geometry",refY:"geometry",orient:"geometry",markerUnits:{oneOf:["strokeWidth","userSpaceOnUse"]}}},a:f,filter:{attributes:{...ue,filterUnits:Kr,primitiveUnits:Kr}},feBlend:{attributes:{...ne,in2:"text",mode:"text"}},feColorMatrix:{attributes:{...ne,type:{oneOf:["matrix","saturate","hueRotate","luminanceToAlpha"]},values:"geometry"}},feComponentTransfer:{attributes:ne},...Object.fromEntries(["feFuncR","feFuncG","feFuncB","feFuncA"].map(t=>[t,{attributes:{type:{oneOf:["identity","table","discrete","linear","gamma"]},tableValues:"geometry",slope:"number",intercept:"number",amplitude:"number",exponent:"number",offset:"number"}}])),feComposite:{attributes:{...ne,in2:"text",operator:{oneOf:["over","in","out","atop","xor","lighter","arithmetic"]},k1:"number",k2:"number",k3:"number",k4:"number"}},feDisplacementMap:{attributes:{...ne,in2:"text",scale:"number",xChannelSelector:Zr,yChannelSelector:Zr}},feDropShadow:{attributes:{...ne,dx:"number",dy:"number",stdDeviation:"geometry"}},feFlood:{attributes:ne},feGaussianBlur:{attributes:{...ne,stdDeviation:"geometry",edgeMode:{oneOf:["duplicate","wrap","none"]}}},feMerge:{attributes:ne},feMergeNode:{attributes:{in:"text"}},feMorphology:{attributes:{...ne,operator:{oneOf:["erode","dilate"]},radius:"geometry"}},feOffset:{attributes:{...ne,dx:"number",dy:"number"}},feTurbulence:{attributes:{...ue,result:"text",type:{oneOf:["fractalNoise","turbulence"]},baseFrequency:"geometry",numOctaves:"number",seed:"number",stitchTiles:{oneOf:["stitch","noStitch"]}}}};var eo={section:["aria-label","title"]};function Qo(t){return/^aria-[a-z]+$/.test(t)}function Jo(t){return/^data-[a-z0-9][a-z0-9_.-]*$/.test(t)}var es=new Map(Object.keys(Jr).map(t=>[t.toLowerCase(),t]));function to(t){return es.get(t.toLowerCase())}function no(t,e,n){let r=n.toLowerCase(),o=t==="html"?[Yn[e]?.attributes,Xo]:[Jr[e]?.attributes,Zo],s=t==="svg"&&r==="xlink:href"?"href":r;for(let i of o)if(i){for(let[l,c]of Object.entries(i))if(l.toLowerCase()===s)return{name:l,kind:c}}if(Qo(r)||Jo(r))return{name:r,kind:"text"}}var an=/^\\d{4}-\\d{2}-\\d{2}$/;function ts(t,e){if(typeof t!="string"||typeof e!="string"||!an.test(t)||!an.test(e))return;let n=Math.round((Date.parse(`${t}T00:00:00Z`)-Date.parse(`${e}T00:00:00Z`))/864e5);return Number.isFinite(n)?n:void 0}function ro(t,e,n={}){let r=ts(t,e);if(r===void 0)return"";if(r===0)return"today";if(r===1)return"tomorrow";if(r<0&&n.due===!0)return"overdue";if(r===-1)return"yesterday";let o=Math.abs(r),[s,i]=o<14?[o,"day"]:o<60?[Math.round(o/7),"week"]:o<730?[Math.round(o/30.44),"month"]:[Math.round(o/365.25),"year"],l=`${s} ${i}${s===1?"":"s"}`;return r>0?`in ${l}`:`${l} ago`}function oo(t,e){if(typeof t!="string")return;if(an.test(t))return t;let n=Date.parse(t);if(Number.isFinite(n)){if(!/(Z|[+-]\\d\\d:?\\d\\d)$/.test(t))return an.test(t.slice(0,10))?t.slice(0,10):void 0;try{let r=new Intl.DateTimeFormat("en-CA",{timeZone:e||"UTC",year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(n),o=s=>r.find(i=>i.type===s)?.value??"";return`${o("year")}-${o("month")}-${o("day")}`}catch{return new Date(n).toISOString().slice(0,10)}}}var so="~",ln=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),se=(t,e=0)=>{if(t===null||typeof t=="string"||typeof t=="number"||typeof t=="boolean"||t===void 0)return t;if(!(e>64||typeof t!="object"))return Array.isArray(t)?t.map(n=>se(n,e+1)):Object.fromEntries(Object.entries(t).map(([n,r])=>[n,se(r,e+1)]))};function io(){let t=new Map,e=new Map,n=new Map([[so,{children:[],listeners:new Map}]]),r=0,o=u=>{let m=e.get(u);return m===void 0&&(m=r+=1,e.set(u,m),t.set(m,{listener:u,count:0})),t.get(m).count+=1,m},s=u=>{let m=t.get(u);m&&(m.count-=1,!(m.count>0)&&(t.delete(u),e.delete(m.listener)))},i=u=>{let m=n.get(u);if(m){n.delete(u);for(let g of m.listeners.values())s(g);for(let g of m.children)i(g)}},l=(u,m,g=0)=>{if(!ln(u)||g>64)return se(u);let y=typeof u.id=="string"?u.id:void 0,E=m&&y!==void 0&&y!==so;E&&i(y);let x={children:[],listeners:new Map};E&&n.set(y,x);let N={};for(let[w,C]of Object.entries(u))w==="children"&&Array.isArray(C)?N[w]=C.map(I=>{let S=l(I,E,g+1);return E&&ln(I)&&typeof I.id=="string"&&x.children.push(I.id),S}):w==="eventListeners"&&ln(C)?N[w]=Object.fromEntries(Object.entries(C).map(([I,S])=>{if(typeof S!="function"||!E)return[I,void 0];let P=o(S);return x.listeners.set(I,P),[I,{listener:P}]})):N[w]=se(C,g+1);return N},c=u=>{if(!Array.isArray(u))return se(u);let[m,g]=u,y=typeof g=="string"?n.get(g):void 0;if(m===0){let E=l(u[2],y!==void 0),x=ln(u[2])?u[2].id:void 0;if(y&&typeof x=="string"&&n.has(x)){let N=Number(u[3]);y.children.splice(Number.isInteger(N)&&N>=0&&N<=y.children.length?N:y.children.length,0,x)}return[m,se(g),E,se(u[3])]}if(m===1){let E=Number(u[2]);return y&&Number.isInteger(E)&&E>=0&&E<y.children.length&&i(y.children.splice(E,1)[0]),se(u)}if(m===3&&u[4]===3){let E=String(u[2]),x=u[3],N=y&&typeof x=="function"?o(x):void 0,w=y?.listeners.get(E);return w!==void 0&&s(w),N===void 0?y?.listeners.delete(E):y.listeners.set(E,N),[m,se(g),E,N===void 0?void 0:{listener:N},3]}return se(u)};return{encode:u=>u.map(c),listener:u=>t.get(u)?.listener,get listening(){return t.size},get nodes(){return n.size-1}}}var cn="graview-view-root",ns=["value","checked","key","pressed","files","refused","x","y","width","height","deltaX","deltaY","deltaMode","ctrlKey","metaKey","phase","pointerId","button","pressure","dx","dy","scale","rotation"],rs=t=>t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/\'/g,"&#39;"),os=t=>Object.freeze({html:t,toString:()=>t}),ao=t=>typeof t=="object"&&t!==null&&typeof t.html=="string"&&Object.isFrozen(t),lo=t=>t==null||t===!1?"":Array.isArray(t)?t.map(lo).join(""):ao(t)?t.html:rs(String(t));function co(t){customElements.get(cn)||customElements.define(cn,ut);let e=Event,n=io(),r=new Set,o=new Set,s,i=[],l=new Set;for(let a of["closest","matches","dataset"]){let d=()=>{throw new TypeError(`A view\'s element has no ${a}: graview.on hands event.element, the element its selector matched; read event.element.getAttribute("data-\\u2026").`)};a in Element.prototype||Object.defineProperty(Element.prototype,a,a==="dataset"?{get:d}:{value:d})}let c=document.createElement(cn),u=a=>{let d=h=>{for(let T of Array.from(h.childNodes)){if(T.nodeType!==1)continue;if(X(T)===a)return T;let b=d(T);if(b)return b}};return d(c)},m=a=>{let d=u(a.target);if(!d)return;let h=new e(a.event,{bubbles:!0}),T={};for(let b of ns)a[b]!==void 0&&(T[b]=a[b]);for(let b of Object.keys(T))Object.defineProperty(h,b,{value:T[b],enumerable:!0});d.dispatchEvent(h);for(let b of o){if(b.type!==a.event)continue;let A;try{A=new Set(Array.from(c.querySelectorAll(b.selector)))}catch{continue}for(let G=d;G&&G!==c;G=G.parentNode)if(A.has(G)){b.listener(Object.freeze({type:a.event,target:d,element:G,...T}));break}}},g=Error,y=new Map,E=0,x=(a,d,h)=>new Promise((T,b)=>{let A=++E;y.set(A,G=>G.ok?T(G):b(new g(G.sentence??"This value was not kept."))),t.send({type:"mine",id:A,op:a,key:d,...a==="set"?{value:h}:{}})}),N=a=>(a.catch(()=>{}),a),w=Object.freeze({get(a){return N(x("get",a).then(d=>typeof d.value=="string"?d.value:null))},set(a,d){return N(x("set",a,d).then(()=>{}))}}),C=a=>{if(a.type==="mine-answer"){let b=y.get(a.id);return y.delete(a.id),b?.(a)}if(a.type==="dom-event"&&typeof a.target=="string")return m(a);if(a.type==="notice")return t.warn(a.text);if(a.type!=="props")return;s=a.props;let d=t.now();for(let b of r)try{b(a.props)}catch(A){t.threw(A)}let h=t.now()-d,T=a.push;typeof T=="number"&&t.microtask(()=>t.microtask(()=>t.send({type:"pushed",push:T,ms:h})))},I;c.connect({mutate(a){I||(I=[],t.microtask(()=>{let d=I??[];I=void 0,t.send({type:"render",records:n.encode(d)})})),I.push(...a)},call:()=>{}});let S=a=>a.nodeType===1?a.getAttribute("data-key")??a.getAttribute("id"):null,P=(a,d)=>a.nodeType===d.nodeType&&(a.nodeType!==1||a.localName===d.localName&&a.namespaceURI===d.namespaceURI&&S(a)===S(d));function q(a,d){let h=Array.from(d.childNodes),T=0;for(let b of h){let A=a.childNodes[T]??null;if(A&&P(A,b)){dt(A,b),T+=1;continue}if(S(b)!==null){let de=Array.from(a.childNodes).slice(T+1).find(We=>P(We,b));if(de){a.insertBefore(de,A),dt(de,b),T+=1;continue}}a.insertBefore(b,A),T+=1}for(;a.childNodes.length>T;)a.removeChild(a.lastChild)}function dt(a,d){if(a.nodeType!==1){a.data!==d.data&&(a.data=d.data);return}let h=a,T=d,b=ft(h);for(let A of h.getAttributeNames())T.hasAttribute(A)||(h.removeAttribute(A),b&&Ne(h,A,void 0));for(let A of T.getAttributeNames()){let G=T.getAttribute(A);h.getAttribute(A)!==G&&h.setAttribute(A,G),b&&Ne(h,A,G)}q(h,T)}let ft=a=>a.localName.includes("-");function Xn(a){for(let d of Array.from(a.childNodes)){if(d.nodeType!==1)continue;let h=d;if(ft(h))for(let T of h.getAttributeNames())Ne(h,T,h.getAttribute(T)??void 0);Xn(h)}}function Kn(a,d,h){for(let T of Array.from(a.childNodes)){if(T.nodeType!==1)continue;let b=T,A=b.localName,G=d||A.toLowerCase()==="svg",de=G?to(A):Object.prototype.hasOwnProperty.call(Yn,A.toLowerCase())?A.toLowerCase():void 0;if(!de){h.add(`<${A}>`);continue}for(let We of b.getAttributeNames())(!no(G?"svg":"html",de,We)||!G&&eo[de]?.includes(We.toLowerCase()))&&h.add(`${de} ${We}`);Kn(b,G,h)}}function fo(a){let d=document.createElement("div"),h=Array.isArray(a)?a:[a];for(let b of h)if(b!=null)if(typeof b=="string"||ao(b)){let A=document.createElement("div");A.innerHTML=typeof b=="string"?b:b.html,d.append(...Array.from(A.childNodes))}else d.append(b);let T=new Set;Kn(d,!1,T),i=[...T],i.length>0&&t.warn(`The host will not draw: ${i.join(", ")}`),Xn(d),q(c,d)}let un=[],dn=new Set(Br),Zn="[]",fn=!1,Qn=()=>{fn||(fn=!0,t.microtask(()=>{fn=!1;let a=[...new Map([...o].filter(h=>dn.has(h.type)).map(h=>[`${h.type} ${h.selector}`,{event:h.type,selector:h.selector}])).entries()].sort(([h],[T])=>h<T?-1:h>T?1:0).map(([,h])=>h),d=JSON.stringify(a);d!==Zn&&(Zn=d,t.send({type:"gestures",bound:a}))}))},Jn="[[],[]]",mn=!1,er=()=>{mn||(mn=!0,t.microtask(()=>{mn=!1;let a=b=>[...new Set([...o].filter(A=>A.type===b&&typeof A.selector=="string").map(A=>A.selector))].sort().slice(0,200),d=a("click"),h=a("acted"),T=JSON.stringify([d,h]);T!==Jn&&(Jn=T,t.send({type:"clicks",selectors:d,...h.length>0?{acted:h}:{}}))}))},tr=Object.freeze({get props(){return s},onProps(a){return r.add(a),s&&a(s),()=>void r.delete(a)},render:fo,style(a){typeof a!="string"||un.includes(a)||(un.push(a),t.send({type:"style",sheets:[...un]}))},on(a,d,h){let T={type:a,selector:d,listener:h};return o.add(T),typeof a=="string"&&!l.has(a)&&(l.add(a),t.send({type:"hears",events:[a]})),dn.has(a)&&Qn(),(a==="click"||a==="acted")&&er(),()=>{o.delete(T),dn.has(a)&&Qn(),(a==="click"||a==="acted")&&er()}},act:(a,d={})=>t.act(a,d),mine:w,navigate(a){if(typeof a=="string")return t.navigate(a);let d=on(a);d&&t.send(d)},html(a,...d){return os(a.reduce((h,T,b)=>h+T+(b<d.length?lo(d[b]):""),""))},get today(){return s?.today??new Date().toISOString().slice(0,10)},fromToday(a,d){let h=oo(a,s?.timeZone);return h===void 0?"":ro(h,tr.today,d)},get refused(){return i},get hardening(){return t.hardening()}});return{view:tr,hear:C,find:a=>{try{let d=c.querySelectorAll(a)[0];return d?X(d):void 0}catch{return}},listened:a=>{let d=new Set;for(let h of o)if(h.type===a)try{for(let T of Array.from(c.querySelectorAll(h.selector))){let b=X(T);b&&d.add(b)}}catch{}return[...d]}}}var $n={removed:[],stuck:[],sealed:!1,worker:!1},zn=jr({listen(t){return _e.listen(t),()=>_e.unlisten(t)},fromHost:()=>!0,ready:t=>_e.post(t)},{onMessage:t=>uo.hear(t)}),uo=co({send:t=>zn.send(t),act:(t,e)=>zn.guest.act(t,e),navigate:t=>zn.guest.navigate(t),microtask:_e.microtask,now:_e.now,threw:t=>console.error(t),warn:t=>console.warn(t),hardening:()=>$n}),ss=uo.view;Object.defineProperty(globalThis,"graview",{value:ss,enumerable:!0,configurable:!0,writable:!1});var Wn="WorkerGlobalScope"in globalThis?Xr(globalThis,["graview"]):$n;$n=Wn;if(Wn.stuck.length>0)throw new Error(`The view\'s worker could not be hardened: ${Wn.stuck.join(", ")} would not go.`);})();\n';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 Re=globalThis,mo=Re.addEventListener,po=Re.removeEventListener,ho=Re.postMessage,go=globalThis.queueMicrotask,pn=globalThis.performance,yo=pn?pn.now.bind(pn):Date.now,_e={listen:t=>mo.call(Re,"message",t),unlisten:t=>po.call(Re,"message",t),post:t=>ho.call(Re,t),microtask:t=>go.call(globalThis,t),now:()=>yo()};var O=Symbol("name"),fe=Symbol("prefix"),me=Symbol("value"),x=Symbol("ns"),Y=Symbol("owner"),k=Symbol("owner_document"),re=Symbol("attributes"),D=Symbol("prev"),p=Symbol("next"),R=Symbol("child"),z=Symbol("parent"),pe=Symbol("host"),K=Symbol("data"),Te=Symbol("listeners"),hn=Symbol("isTrusted"),Pe=Symbol("path"),Me=Symbol("stop_immediate_propagation"),Ce=Symbol("dispatching"),ie=Symbol("content"),L=Symbol("hooks"),mt=Symbol("extensions"),we=Symbol("hooks_dispatch"),B=Symbol("is_connected"),Ie=Symbol("create_element"),nr=0,$=1,ke=2,De=3,Le=8,Se=9,rr=10,he=11,_="http://www.w3.org/1999/xhtml",Z="http://www.w3.org/2000/svg",or="http://www.w3.org/XML/1998/namespace",$e="http://www.w3.org/2000/xmlns/";function pt(t){return t.split(/[\\t\\n\\f\\r ]+/).filter(Boolean)}function H(t){return t.replace(/[A-Z]/g,e=>String.fromCharCode(e.charCodeAt(0)+32))}function sr(t){return t.replace(/[a-z]/g,e=>String.fromCharCode(e.charCodeAt(0)-32))}function M(t,e){let n=globalThis.DOMException;if(typeof n=="function")return new n(t,e);let r=new Error(t);return r.name=e,r}var ir=/^(?:[A-Za-z][^\\0\\t\\n\\f\\r\\u0020/>]*|[:_\\u0080-\\u{10FFFF}][A-Za-z0-9-.:_\\u0080-\\u{10FFFF}]*)$/u,ar=/[\\0\\t\\n\\f\\r />=]/u,Eo=/[\\0\\t\\n\\f\\r />]/u;function ae(t){if(t==null)return null;let e=String(t);return e===""?null:e}function lr(t){ir.test(t)||yn(t)}function gn(t){(t===""||ar.test(t))&&yn(t)}function ht(t,e,n){let r=ae(t),o=String(e),s=o.indexOf(":"),i=s<0?null:o.slice(0,s),l=s<0?o:o.slice(s+1);if((i!=null&&(i===""||Eo.test(i))||(n==="element"?!ir.test(l):l===""||ar.test(l)))&&yn(o),i!=null&&r==null)throw M(`A namespace is required for the prefix in "${o}"`,"NamespaceError");if(i==="xml"&&r!==or)throw M("The xml prefix requires the XML namespace","NamespaceError");if((o==="xmlns"||i==="xmlns")&&r!==$e)throw M("The xmlns name requires the XMLNS namespace","NamespaceError");if(r===$e&&o!=="xmlns"&&i!=="xmlns")throw M("The XMLNS namespace requires the xmlns name or prefix","NamespaceError");return{namespace:r,qualifiedName:o,prefix:i,localName:l}}function yn(t){throw M(`Invalid name: "${t}"`,"InvalidCharacterError")}var gt=0,yt=1,cr=2,En=3,bo=typeof performance>"u"?Date.now:performance.now.bind(performance),V=class{static NONE=gt;static CAPTURING_PHASE=yt;static AT_TARGET=cr;static BUBBLING_PHASE=En;timeStamp=bo();target=null;currentTarget=null;srcElement=null;bubbles=!1;cancelable=!1;composed=!1;defaultPrevented=!1;cancelBubble=!1;eventPhase=gt;[Pe]=[];[Me]=!1;[Ce]=!1;constructor(e,n){this.type=e,Object.defineProperty(this,hn,{writable:!0,value:!1}),n&&(n.bubbles&&(this.bubbles=n.bubbles),n.cancelable&&(this.cancelable=n.cancelable),n.composed&&(this.composed=n.composed))}get isTrusted(){return this[hn]}composedPath(){return[...this[Pe]]}stopPropagation(){this.cancelBubble=!0}stopImmediatePropagation(){this[Me]=!0,this.cancelBubble=!0}preventDefault(){this.cancelable&&(this.defaultPrevented=!0)}set returnValue(e){e||this.preventDefault()}get returnValue(){return!this.defaultPrevented}initEvent(e,n,r){this.type=e,this.bubbles=!!n,this.cancelable=!!r}};function bn(t,e,n){if(t.cancelBubble)return;let o=e[Te]?.get(t.type)?.[n===yt?"capture":"bubble"];if(o)for(let s of[...o]){if(!o.has(s)||s.signal?.aborted)continue;t.eventPhase=t.target===e?cr:n,t.currentTarget=e;let i=s.normalizedListener;try{typeof i=="object"?i.handleEvent(t):i.call(e,t)}catch(l){setTimeout(No,0,l)}if(t[Me])break}}function No(t){throw t}var Xe=[],Et=new WeakMap;function bt(t,e){let n=Et.get(t);n?n.push(e):Et.set(t,[e]),Xe[Xe.length-1].push(t)}function F(t){let e=[];Xe.push(e);let n;try{n=t()}catch(r){Xe.pop();try{ur(e)}catch{}throw r}return Xe.pop(),ur(e),n}function ur(t){let e,n=!1;for(let r of t){let o=Et.get(r);if(o){for(;o.length>0;){let s=o.shift();try{s()}catch(i){n||(e=i,n=!0)}}Et.delete(r)}}if(n)throw e}var Nt=[],Ke=[],Nn=!1;function Oe(t){for(let e of t)Nt.push(e),e[1]&&Ke.push(e[1]);if(!Nn){Nn=!0;try{let e,n=!1;for(let r=0;r<Nt.length;r++){let[o,s]=Nt[r];s&&Ke.splice(Ke.indexOf(s),1);try{o()}catch(i){n||(e=i,n=!0)}}if(n)throw e}finally{Nt.length=0,Ke.length=0,Nn=!1}}}function Ze(t){let e=t;for(;e;){if(Ke.includes(e))return!0;e=e[z]??e[pe]}return!1}var Qe=Symbol("listenerRegistrations"),ge=class{[Te]=void 0;[Qe]=void 0;[k]=void 0;addEventListener(e,n,r){if(n==null)return;let o=r===!0||typeof r=="object"&&r.capture===!0,s=typeof r=="object"&&r.once===!0,i=typeof r=="object"?r.signal:void 0;if(i?.aborted)return;let l=Tn(o),c=this[Qe];c||(c=new Map,this[Qe]=c);let u=c.get(e);u||(u={},c.set(e,u));let m=u[l];if(m||(m=new Map,u[l]=m),m.has(n))return;let g=this,y={type:e,listener:n,capture:o,once:s,normalizedListener:n,signal:i};(s||i)&&(y.normalizedListener=function(...C){if(y.signal?.aborted){Tt(g,y);return}return y.once&&Tt(g,y),typeof y.listener=="object"?y.listener.handleEvent(...C):y.listener.call(this,...C)});let E=this[Te];E||(E=new Map,this[Te]=E);let v=E.get(e);v||(v={},E.set(e,v));let N=v[l];if(N||(N=new Set,v[l]=N),m.set(n,y),N.add(y),i){let w=()=>{Tt(g,y)};y.abortListener=w,i.addEventListener("abort",w,{once:!0})}this[k]?.defaultView[we].addEventListener?.(this,e,n,r)}removeEventListener(e,n,r){return To.call(this,e,n,r)}dispatchEvent(e){if(e[Ce])throw M("Failed to execute \'dispatchEvent\' on \'EventTarget\': The event is already being dispatched.","InvalidStateError");e[Ce]=!0;try{let n=[],r=this;for(;r!=null;)n.push(r),r=r.parentNode;e.target=this,e.srcElement=this,e[Pe]=n;for(let s=n.length;s--;)if(bn(e,n[s],yt),e.cancelBubble)return!e.defaultPrevented;let o=e.bubbles?n:n.slice(0,1);for(let s=0;s<o.length;s++)if(bn(e,o[s],En),e.cancelBubble)return!e.defaultPrevented;return!e.defaultPrevented}finally{e[Ce]=!1,e.cancelBubble=!1,e[Me]=!1,e.eventPhase=gt,e.currentTarget=null,e[Pe]=[]}}};function To(t,e,n){if(e==null)return;let r=n===!0||n&&n.capture===!0,o=Tn(!!r),s=this[Qe]?.get(t)?.[o]?.get(e);s&&Tt(this,s)}function Tn(t){return t?"capture":"bubble"}function Tt(t,e){let n=Tn(e.capture),r=t[Qe],o=r?.get(e.type);if(!o)return;let s=o[n];if(!s||s.get(e.listener)!==e)return;s.delete(e.listener),s.size===0&&delete o[n],!o.bubble&&!o.capture&&r?.delete(e.type),e.signal&&e.abortListener&&e.signal.removeEventListener("abort",e.abortListener);let i=t[Te],l=i?.get(e.type);if(!l)return;let c=l[n];c?.delete(e)&&(c.size===0&&delete l[n],!l.bubble&&!l.capture&&i?.delete(e.type),t[k]?.defaultView[we].removeEventListener?.(t,e.type,e.listener,e.capture))}var Q=class extends Array{item(e){return this[e]??null}};var et=0,dr=1,On=2,xn=3,tt=4,fr=0,mr=1,Ot=2,xt=3,pr=4,Sn=5,hr=6,gr=7,wt=/^(?:--|-?[A-Za-z_\\u0080-\\u{10FFFF}])[A-Za-z0-9_\\u0080-\\u{10FFFF}-]*$/u;function wo(t,e){let n=1,r=null;for(let o=e;o<t.length;o++){let s=t[o];if(r){s==="\\\\"?o++:s===r&&(r=null);continue}if(s===\'"\'||s==="\'")r=s;else if(s==="(")n++;else if(s===")"&&--n===0)return[t.slice(e,o),o+1]}return[t.slice(e),t.length]}function W(t){throw M(`Invalid or unsupported selector: "${t}"`,"SyntaxError")}function vt(t,e){let n=typeof e=="string"?nt(e):[{combinator:tt,matchers:e}],r=null,o=t[R];return o&&n[0].matchers.length&&vn(o,n,s=>(r=s,!1)),r}function At(t,e){let n=typeof e=="string"?nt(e):[{combinator:tt,matchers:e}],r=new Q,o=t[R];return o&&n[0].matchers.length&&vn(o,n,s=>{r.push(s)}),r}function nt(t,e=!1,n=!1){let r={combinator:tt,matchers:[]},o=[r],s=/[\\t\\n\\f\\r ]*?([>\\t\\n\\f\\r +~]?)[\\t\\n\\f\\r ]*?(?:(?:\\[[\\t\\n\\f\\r ]*([^\\]=\\t\\n\\f\\r ]+)[\\t\\n\\f\\r ]*(?:=[\\t\\n\\f\\r ]*(?:([\'"])(.*?)\\3|([^\\]\\t\\n\\f\\r ]+)))?[\\t\\n\\f\\r ]*(?:\\]|$))|([#.]?)([^\\t\\n\\f\\r #.[>:+~()]+)|:(\\w+)(\\()?)/gi,i=t.replace(/^[\\t\\n\\f\\r ]+|[\\t\\n\\f\\r ]+$/g,"");i===""&&W(t);let l=0,c;for(;c=s.exec(i);){c.index!==l&&W(t),c[1]&&(r.matchers.length===0&&!(n&&o.length===1)&&W(t),c[1]===">"?r.combinator=dr:c[1]==="+"?r.combinator=xn:c[1]==="~"?r.combinator=On:r.combinator=et,r={combinator:tt,matchers:[]},o.push(r));let u=c[8]?H(c[8]):c[2]||c[7];c[7]!=null&&!c[6]&&r.matchers.length>0&&W(t);let g,y=c[4]??c[5]??c[7];if(c[2]){wt.test(u)||W(t);let E=c[5],v=E?.[0];if(c[3]==null&&(v===\'"\'||v==="\'")){let N=c[0].lastIndexOf(E);y=i.slice(c.index+N+1),s.lastIndex=i.length}else E!=null&&!wt.test(E)&&W(t);g=pr}else c[6]?(wt.test(u)||W(t),g=c[6]==="#"?Ot:xt):c[8]?g=c[9]==null?Sn:hr:c[7]==="*"?g=fr:c[7]&&wt.test(c[7])?g=mr:W(t);c[9]?([y,s.lastIndex]=wo(i,s.lastIndex),u!=="has"&&u!=="not"&&W(t),u==="has"&&e&&W(t),nt(y,e||u==="has",u==="has")):g===Sn&&W(t),r.matchers.push({type:g,name:u,value:y}),l=s.lastIndex}return(l!==i.length||r.matchers.length===0)&&W(t),o}function So(t,e){let n=nt(e);return n[0]?.matchers.length?Je(t,n):!1}function Oo(t,e){let n=nt(e,!0,!0),r=n[0];if(n.length===1&&r.matchers.length===0)return!1;let o=et,s={type:gr,name:":scope"};if(r.matchers.length===0?(o=r.combinator,r.matchers.push(s)):n.unshift({combinator:et,matchers:[s]}),n.some(({matchers:c})=>c.length===0))return!1;let i=o===xn||o===On?t[p]:t[R];if(!i)return!1;let l=!1;return vn(i,n,()=>(l=!0,!1),t),l}function vn(t,e,n,r){let o=[],s=t;for(;s;){if(j(s)){if(Je(s,e,r)&&n(s)===!1)return!1;let i=s[R];if(i){let l=s[p];l&&o.push(l),s=i;continue}}s=s[p]??o.pop()??null}return!0}function Je(t,e,n){let{combinator:r,matchers:o}=e[e.length-1];if(r===tt){if(!St(t,o,n))return!1;let l=e.slice(0,-1);return l.length===0||Je(t,l,n)}let s=r===dr||r===et?z:D,i=t[s];if(!i)return!1;if(r===et||r===On){for(;i;){if(j(i)&&St(i,o,n)){let l=e.slice(0,-1);if(l.length===0||Je(i,l,n))return!0}i=i[s]}return!1}else{if(r===xn&&!j(i)){for(;i&&!j(i);)i=i[s];if(!i)return!1}if(!j(i)||!St(i,o,n))return!1;let l=e.slice(0,-1);return l.length===0||Je(i,l,n)}}function wn(t,e){return t.getAttributeNS(null,t.namespaceURI===_?H(e):e)}function St(t,e,n){if(!t)return!1;if(Array.isArray(e)){for(let i of e)if(St(t,i,n)===!1)return!1;return!0}let{type:r,name:o,value:s}=e;switch(r){case fr:return o==="*";case mr:return t.namespaceURI===_?t.localName===H(o):t.localName===o;case Ot:return wn(t,"id")===o;case xt:let i=wn(t,"class");return i?pt(i).includes(o):!1;case pr:let l=wn(t,o);return s==null?l!=null:l===s;case gr:return t===n;case Sn:W(`:${o}`);case hr:switch(o){case"has":return Oo(t,s||"");case"not":return!So(t,s||"");default:W(`:${o}(${s})`)}}return!1}function xo(t){return t.nodeType===ke}function rt(t){return K in t}function Rn(t){return t.nodeType===De}function vo(t){return t.nodeType===Le}function j(t){return t.nodeType===$}function An(t){return t.nodeType===he}function Nr(t){return"appendChild"in t}function Rt(t){let e=[],n=[t],r=new Set(n),o=new Set,s;for(;n.length>0;){let i=n.pop();if(r.delete(i),o.has(i))continue;let l=[];for(let c of st(i)){if(o.has(c)||(o.add(c),e.push(c),l.push(c),!j(c)))continue;let u=c[re];if(u)for(let g of u)o.has(g)||(o.add(g),e.push(g));let m=c[ie];m&&!o.has(m)&&!r.has(m)&&(r.add(m),n.push(m))}s??=l}return{nodes:e,treeNodes:s}}function ot(t,e){for(let n of t)n[k]=e}function yr(t,e){let n=t.constructor,r=new n(t.name,t.value,t.namespaceURI);return r[k]=e,r}function Er(t,e){if(Rn(t))return e.createTextNode(t.data);if(vo(t))return e.createComment(t.data);if(xo(t))return yr(t,e);if(j(t)){let n=e[Ie](t[O],t.namespaceURI,t[fe],t.localName);if(t[re])for(let r=0;r<t[re].length;r++){let o=t[re].item(r);n.attributes.setNamedItem(yr(o,e))}return n}else{if(An(t))return e.createDocumentFragment();{let n=new t.constructor;return n[k]=e,n}}}function _t(t,e,n=t.ownerDocument){if(t.nodeType===Se)throw M("Cannot clone a document node","NotSupportedError");let r=Er(t,n);if(!e||!j(t)&&!An(t))return r;let o=new Set([t]),s=[{source:t,destination:r,childIndex:0,cloningContent:!1}];for(;s.length>0;){let i=s[s.length-1],l,c;if(i.cloningContent)if(i.contentSource&&i.contentDestination)l=i.contentSource.childNodes[i.childIndex++],c=i.contentDestination;else{s.pop(),i.appendTo&&i.appendTo.appendChild(i.destination);continue}else if(l=i.source.childNodes[i.childIndex++],c=i.destination,!l){if(i.cloningContent=!0,i.childIndex=0,j(i.source)&&i.source.namespaceURI===_&&i.source.localName==="template"){let m=i.source[ie];m&&(o.has(m)&&br(),o.add(m),i.contentSource=m,i.contentDestination=i.destination.content)}continue}if(!l){s.pop(),i.appendTo&&i.appendTo.appendChild(i.destination);continue}o.has(l)&&br(),o.add(l);let u=Er(l,n);j(l)||An(l)?s.push({source:l,destination:u,appendTo:c,childIndex:0,cloningContent:!1}):c.appendChild(u)}return r}function br(){throw new Error("Cannot clone a cyclic or repeated node graph")}function Pt(t,e){let n=String(e);return n===""?null:vt(t,[{type:Ot,name:n}])}function Mt(t,e){let n=[...new Set(pt(String(e)))];return At(t,n.map(r=>({type:xt,name:r})))}function Ct(t,e){let n=String(e),r=H(n),o=[];for(let s of It(t))j(s)&&(n==="*"||(s.namespaceURI===_?s[O]===r:s[O]===n))&&o.push(s);return o}function It(t){let e=[],n=[],r=t[R];for(;r;){e.push(r);let o=r[R],s=r[p];o?(s&&n.push(s),r=o):r=s??n.pop()??null}return e}function st(t){let e=It(t);return e.unshift(t),e}var J=class extends ge{nodeType=nr;[O]="";[z]=null;[pe]=null;[R]=null;[D]=null;[p]=null;[B]=!1;get[L](){return this[k].defaultView[we]}get localName(){return this[O]}get nodeName(){return this[O]}get ownerDocument(){return this[k]}get isConnected(){return this[B]}isDefaultNamespace(e){let n=ae(e);return Ao(this)===n}get parentNode(){return this[z]}set parentNode(e){}get parentElement(){let e=this[z];return!e||e.nodeType!==1?null:e}set parentElement(e){}get previousSibling(){return this[D]}set previousSibling(e){}get nextSibling(){return this[p]}set nextSibling(e){}get previousElementSibling(){let e=this[D];for(;e&&e.nodeType!==1;)e=e[D];return e}set previousElementSibling(e){}get nextElementSibling(){let e=this[p];for(;e&&e.nodeType!==1;)e=e[p];return e}set nextElementSibling(e){}get firstChild(){return this[R]}set firstChild(e){}get lastChild(){let e=this[R];for(;e;){let n=e[p];if(n==null)break;e=n}return e}set lastChild(e){}get nodeValue(){return rt(this)?this.data:null}set nodeValue(e){rt(this)&&(this.data=e)}get textContent(){if(rt(this))return this.data;let e="";for(let n of It(this))Rn(n)&&(e+=n.data);return e}set textContent(e){if(rt(this))this.data=e;else if(Nr(this)){let n=e==null?"":String(e);n===""?this.replaceChildren():this.replaceChildren(n)}}cloneNode(e){return _t(this,e)}contains(e){let n=e;for(;n!=null;){if(n===this)return!0;n=n.parentNode}return!1}};function Ao(t){let e=t;for(;e;)switch(e.nodeType){case $:{let n=e;if(n.prefix==null&&n.namespaceURI!=null)return n.namespaceURI;let r=n.attributes.getNamedItemNS($e,"xmlns");if(r!=null&&r.prefix==null)return ae(r.value);e=n.parentElement;break}case Se:e=e.documentElement;break;case rr:case he:return null;case ke:e=e.ownerElement;break;default:e=e.parentElement}return null}var ee=Symbol("insertNode"),Mn=Symbol("preflightInsertions"),kt=Symbol("replaceNode"),ye=class extends J{remove(){let e=this.parentNode;e&&e.removeChild(this)}replaceWith(...e){let n=xe(e),r=this.parentNode;if(r)return _n(o=>{le(r,n);let s=this[p];for(;s&&n.includes(s);)s=s[p];let i=Pn(r,n,o);this.parentNode===r?r[kt](i,this,o):r[ee](i,s,o)})}before(...e){let n=xe(e),r=this.parentNode;if(r)return _n(o=>{le(r,n);let s=this[D];for(;s&&n.includes(s);)s=s[D];let i=Pn(r,n,o);r[ee](i,s?s[p]:r.firstChild,o)})}after(...e){let n=xe(e),r=this.parentNode;if(r)return _n(o=>{le(r,n);let s=this[p];for(;s&&n.includes(s);)s=s[p];let i=Pn(r,n,o);r[ee](i,s,o)})}};function _n(t){return F(()=>{let e=[];try{t(e)}catch(n){try{Oe(e)}catch{}throw n}Oe(e)})}function xe(t){return t.map(e=>e instanceof J?e:String(e))}function it(t,e){return e instanceof J?e:t.ownerDocument.createTextNode(String(e))}function le(t,e){for(let n of e){if(!(n instanceof J))continue;let r=t;for(;r;){if(r===n)throw M("Cannot insert a node into itself or one of its descendants","HierarchyRequestError");r=r[z]??r[pe]}}}function Pn(t,e,n){let r=[];for(let s of e)r.push(it(t,s));if(r.length===1)return r[0];let o=t.ownerDocument.createDocumentFragment();o[Mn](r);for(let s of r)o[ee](s,null,n);return o}var Dt,Cn=0,Tr=0,wr=0,Sr=0,Ge=!1,kn=!1,at=!1,Lt=class{#t;#n=[];#e=new Set;#r=!1;constructor(e){if(typeof e!="function")throw new TypeError("MutationObserver callback must be a function");this.#t=e}observe(e,n={}){let r=Ro(n),o=Dt??=new WeakMap,s=o.get(e);s==null&&(s=new Map,o.set(e,s));let i=s.get(this);i==null?Cn++:In(i,-1),s.set(this,r),In(r,1),this.#e.add(e)}disconnect(){let e=Dt;if(e!=null){for(let n of this.#e){let r=e.get(n),o=r?.get(this);o!=null&&(r.delete(this),Cn--,In(o,-1)),r?.size===0&&e.delete(n)}this.#e.clear(),this.#n.length=0,Cn===0&&(Dt=void 0)}}takeRecords(){return this.#n.splice(0)}enqueue(e){this.#n.push(e),!this.#r&&(this.#r=!0,queueMicrotask(()=>{this.#r=!1;let n=this.takeRecords();n.length>0&&this.#t.call(this,n,this)}))}};function te(t){let e=Dt;if(e==null)return;let n=new Map,r=t.target;for(;r;){let o=e.get(r);if(o)for(let[s,i]of o){if(r!==t.target&&!i.subtree)continue;let l=!1;if(t.type==="attributes"){if(!i.attributes||i.attributeFilter&&!i.attributeFilter.has(t.attributeName??""))continue;l=i.attributeOldValue}else if(t.type==="characterData"){if(!i.characterData)continue;l=i.characterDataOldValue}else if(!i.childList)continue;n.set(s,n.get(s)===!0||l)}r=r.parentNode}for(let[o,s]of n)o.enqueue({addedNodes:t.addedNodes??new Q,attributeName:t.attributeName??null,attributeNamespace:t.attributeNamespace??null,nextSibling:t.nextSibling??null,oldValue:s?t.oldValue??null:null,previousSibling:t.previousSibling??null,removedNodes:t.removedNodes??new Q,target:t.target,type:t.type})}function Gt(...t){let e=new Q;return e.push(...t),e}function Ro(t){if(t.attributes===!1&&(t.attributeOldValue||t.attributeFilter!=null))throw new TypeError("attributeOldValue and attributeFilter require attributes to be enabled");if(t.characterData===!1&&t.characterDataOldValue)throw new TypeError("characterDataOldValue requires characterData to be enabled");let e=t.attributes??(t.attributeOldValue===!0||t.attributeFilter!=null),n=t.characterData??t.characterDataOldValue===!0,r=t.childList===!0;if(!e&&!n&&!r)throw new TypeError("MutationObserver options must enable childList, attributes, or characterData");return{attributes:e,attributeFilter:t.attributeFilter==null?void 0:new Set(t.attributeFilter.map(String)),attributeOldValue:t.attributeOldValue===!0,characterData:n,characterDataOldValue:t.characterDataOldValue===!0,childList:r,subtree:t.subtree===!0}}function In(t,e){t.attributes&&(Tr+=e),t.characterData&&(wr+=e),t.childList&&(Sr+=e),Ge=Tr>0,kn=wr>0,at=Sr>0}var oe=class extends ye{childNodes=new Q;children=new Q;appendChild(e){return F(()=>this[ee](e,null))}insertBefore(e,n){return F(()=>this[ee](e,n||null))}append(...e){return F(()=>{let n=xe(e.filter(r=>r!=null));n.length>1&&le(this,n);for(let r of n)this[ee](it(this,r),null)})}prepend(...e){return F(()=>{let n=xe(e.filter(o=>o!=null));n.length>1&&le(this,n);let r=this.firstChild;for(let o of n)this[ee](it(this,o),r)})}replaceChildren(...e){return F(()=>{let n=xe(e.filter(o=>o!=null));le(this,n);let r;for(;r=this.firstChild;)this.removeChildImmediately(r);for(let o of n)this[ee](it(this,o),null)})}removeChild(e){return F(()=>(this.removeChildImmediately(e),e))}removeChildImmediately(e){if(e.parentNode!==this)throw M("The node is not a child of this node","NotFoundError");let n=this[B]?st(e):void 0,r=e[D],o=e[p],s=Ht(this,e);if(n)for(let i of n)i[B]=!1;this.queueRemovalMutationRecord(this,e,r,o),n&&this.enqueueTreeReactions(n,"disconnectedCallback"),Oe(this.collectRemovalHookEffects(e,s))}replaceChild(e,n){return F(()=>this[kt](e,n))}[kt](e,n,r){if(le(this,[e]),n.parentNode!==this)throw M("The reference node is not a child of this parent","NotFoundError");let o=n[D],s=n[p],i=this.prepareInsertion(e),l=this[B]?st(n):void 0,c=new Set(i.map(({node:y})=>y)),u=s;for(;u&&c.has(u);)u=u[p];let m=Ht(this,n);if(l){for(let E of l)E[B]=!1;let y=new Set(l);for(let E of i)y.has(E.node)&&(E.shouldDisconnect=!1)}this.commitInsertion(i,u);let g=this[B];return this.queueRemovalMutationRecord(this,n,o,s),this.queueInsertionMutationRecords(i),l&&this.enqueueTreeReactions(l,"disconnectedCallback"),this.enqueueInsertionReactions(i,g),this.performOrCollectHookEffects([...this.collectRemovalHookEffects(n,m),...this.collectInsertionHookEffects(i)],r),n}querySelectorAll(e){return At(this,e)}querySelector(e){return vt(this,e)}[ee](e,n,r){return this.validateInsertion(e,n),this.insertIntoValidated(e,n,r),e}[Mn](e){for(let n of e)this.validateInsertion(n,null),this.prepareInsertion(n)}validateInsertion(e,n){if(le(this,[e]),n&&n.parentNode!==this)throw M("The reference node is not a child of this parent","NotFoundError")}insertIntoValidated(e,n,r){e===n&&(n=e[p]);let o=this.prepareInsertion(e);this.commitInsertion(o,n);let s=this[B];this.queueInsertionMutationRecords(o),this.enqueueInsertionReactions(o,s),this.performOrCollectHookEffects(this.collectInsertionHookEffects(o),r)}performOrCollectHookEffects(e,n){n?n.push(...e):Oe(e)}prepareInsertion(e){let n=[];if(e.nodeType===he){let i=e[R];for(;i;)n.push(i),i=i[p]}else n.push(e);let r=this[B],o=this[k],s=[];for(let i of n){let l=i[B],c=l||r,u,m;if(i[k]===o)c&&(u=st(i));else{let g=Rt(i);m=g.nodes,c&&(u=g.treeNodes)}s.push({node:i,nodes:u,adoption:m,shouldDisconnect:l})}return s}commitInsertion(e,n){for(let s of e){let i=s.node[z];if(i){let l=s.node[D],c=s.node[p];s.source={parent:i,index:Ht(i,s.node),previousSibling:l,nextSibling:c}}}for(let s of e){let i=this.attachChild(s.node,n);s.insertIndex=i.index,s.previousSibling=i.previousSibling,s.nextSibling=i.nextSibling}let r=this[k];for(let{adoption:s}of e)s&&ot(s,r);let o=this[B];for(let{nodes:s}of e)if(s)for(let i of s)i[B]=o}attachChild(e,n){if(n){let s=n[D];e[p]=n,e[D]=s,s?s[p]=e:this[R]=e,n[D]=e}else{e[p]=null;let s=this[R];if(s){let i;for(;i=s[p];)s=i;s[p]=e,e[D]=s}else this[R]=e,e[D]=null}let r=j(e);e[z]=this;let o;if(n){if(o=this.childNodes.indexOf(n),this.childNodes.splice(o,0,e),r){let s=n;for(;s&&!j(s);)s=s[p];s?this.children.splice(this.children.indexOf(s),0,e):this.children.push(e)}}else o=this.childNodes.length,this.childNodes.push(e),r&&this.children.push(e);return{index:o,previousSibling:e[D],nextSibling:e[p]}}queueRemovalMutationRecord(e,n,r,o){at&&te({type:"childList",target:e,removedNodes:Gt(n),previousSibling:r,nextSibling:o})}queueInsertionMutationRecords(e){if(at)for(let n of e){let{node:r,source:o}=n;o&&this.queueRemovalMutationRecord(o.parent,r,o.previousSibling,o.nextSibling),te({type:"childList",target:this,addedNodes:Gt(r),previousSibling:n.previousSibling,nextSibling:n.nextSibling})}}collectRemovalHookEffects(e,n){return this.nodeType!==$||Ze(this)?[]:[[()=>this[L].removeChild?.(this,e,n)]]}collectInsertionHookEffects(e){let n=[];for(let r of e){let{node:o,source:s}=r;s?.parent.nodeType===$&&!Ze(s.parent)&&n.push([()=>s.parent[L].removeChild?.(s.parent,o,s.index)]),this.nodeType===$&&!Ze(this)&&n.push([()=>this[L].insertChild?.(this,o,r.insertIndex),o])}return n}enqueueInsertionReactions(e,n){for(let r of e){let{nodes:o}=r;o&&(r.shouldDisconnect&&this.enqueueTreeReactions(o,"disconnectedCallback"),n&&this.enqueueTreeReactions(o,"connectedCallback"))}}enqueueTreeReactions(e,n){xr(e,n)}};function Or(t,e,n,r){if(e.parentNode!==t)throw Error("not a child of this node");let o=t[B]?n.treeNodes:void 0,s=e[D],i=e[p],l=Ht(t,e);if(o)for(let u of o)u[B]=!1;ot(n.nodes,r),at&&te({type:"childList",target:t,removedNodes:Gt(e),previousSibling:s,nextSibling:i}),o&&xr(o,"disconnectedCallback");let c=[];t.nodeType===$&&!Ze(t)&&c.push([()=>t[L].removeChild?.(t,e,l)]),Oe(c)}function Ht(t,e){let n=e[D],r=e[p];n?n[p]=r:t[R]=r,r&&(r[D]=n);let o=t.childNodes.indexOf(e);return t.childNodes.splice(o,1),j(e)&&t.children.splice(t.children.indexOf(e),1),e[z]=null,e[p]=null,e[D]=null,o}function xr(t,e){for(let n of t){let r=n[e];typeof r=="function"&&bt(n,()=>r.call(n))}}function lt(t,e,n,r,o){let{observedAttributes:s}=t.constructor,{attributeChangedCallback:i}=t;i==null||s==null||!s.includes(e)||bt(t,()=>i.call(t,e,n,r,o))}var Ut=class{[R]=null;constructor(e){this[Y]=e}getNamedItem(e){let n=String(e),r=this[Y][x]===_?H(n):n,o=this[R];for(;o;){if(o.name===r)return o;o=o[p]}return null}getNamedItemNS(e,n){let r=ae(e),o=String(n),s=this[R];for(;s;){if(s.localName===o&&s[x]===r)return s;s=s[p]}return null}item(e){let n=this[R],r=0;for(;n;){if(r++===e)return n;n=n[p]}return null}get length(){let e=0,n=this[R];for(;n;)e++,n=n[p];return e}removeNamedItem(e){let n=String(e),r=this[Y][x]===_?H(n):n;return F(()=>this.removeNamedItemImmediately(o=>o.name===r))}removeNamedItemNS(e,n){let r=ae(e),o=String(n);return F(()=>this.removeNamedItemImmediately(s=>s.localName===o&&s[x]===r))}removeNamedItemImmediately(e){let n=this[Y],r=this[R],o=null;for(;r!=null;){if(e(r)){o&&(o[p]=r[p]),this[R]===r&&(this[R]=r[p]);let s=r.value;return r[p]=null,r[Y]=null,Ge&&te({type:"attributes",target:n,attributeName:r.name,attributeNamespace:r[x],oldValue:s}),n[L].removeAttribute?.(n,r.name,r[x]),lt(n,r.localName,s,null,r[x]),r}o=r,r=r[p]}return null}setNamedItem(e){return F(()=>this.setNamedItemImmediately(e))}setNamedItemImmediately(e){let n=this[Y],r=e[Y];if(r!=null&&r!==n)throw M("The attribute is already in use by another element.","InUseAttributeError");let o=null,s=this[R],i=null;for(;s;){if(s.localName===e.localName&&s[x]===e[x]){if(s===e)return s;i?i[p]=e:this[R]=e,e[p]=s[p],s[p]=null,o=s;break}i=s,s=s[p]}o==null&&(i?i[p]=e:this[R]=e),e[Y]=n,e[k]=n[k],o&&(o[Y]=null);let l=o==null||o.value!==e.value,c=o!=null&&o.name!==e.name;return l&&Ge&&te({type:"attributes",target:n,attributeName:e.name,attributeNamespace:e[x],oldValue:o?.value??null}),c&&n[L].removeAttribute?.(n,o.name,o[x]),(l||c)&&n[L].setAttribute?.(n,e.name,e.value,e[x]),l&&lt(n,e.localName,o?.value??null,e.value,e[x]),o}setNamedItemNS(e){return this.setNamedItem(e)}*[Symbol.iterator](){let e=this[R];for(;e;)yield e,e=e[p]}};var ve=class extends J{nodeType=ke;[x]=null;[p]=null;[Y]=null;constructor(e,n,r){super(),this[O]=e,this[me]=n,r&&(this[x]=r)}get nodeName(){return this[O]}set nodeName(e){}get name(){return this[O]}set name(e){}get localName(){if(this[x]==null)return this[O];let e=this[O].indexOf(":");return e<0?this[O]:this[O].slice(e+1)}get prefix(){if(this[x]==null)return null;let e=this[O].indexOf(":");return e<0?null:this[O].slice(0,e)}get value(){return this[me]}set value(e){let n=String(e),r=this[Y];if(!r){this[me]=n;return}F(()=>{let o=this[me];this[me]=n,Ge&&o!==n&&te({type:"attributes",target:r,attributeName:this[O],attributeNamespace:this[x],oldValue:o}),this[L].setAttribute?.(r,this[O],n,this[x]),lt(r,this.localName,o,n,this[x])})}get nodeValue(){return this.value}set nodeValue(e){this.value=e}get ownerElement(){return this[Y]}get namespaceURI(){return this[x]}get specified(){return!0}};var _o={amp:"&",AMP:"&",apos:"\'",gt:">",GT:">",lt:"<",LT:"<",quot:\'"\',QUOT:\'"\'},Po=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Mo=/(?:<([a-z][a-z0-9-:]*)((?:[\\s]+[^<>\'"=/\\s]+(?:=([\'"])[^]*?\\3|=[^>\'"\\s]*|))*)[\\s]*(\\/?)\\s*>|<\\/([a-z][a-z0-9-:]*)>|<!--(.*?)-->|([^<>]+))/gi,Rr=/\\s([^<>\'"=/\\n\\s]+)(?:=(["\'])([\\s\\S]*?)\\2|=([^>\'"\\n\\s]*)|)/g,Co="|b|big|blockquote|body|br|center|code|dd|div|dl|dt|em|embed|h1|h2|h3|h4|h5|h6|head|hr|i|img|li|listing|menu|meta|nobr|ol|p|pre|ruby|s|small|span|strong|strike|sub|sup|table|tt|u|ul|var|",Io=/^(?:color|face|size)$/i;function vr(t){return t.replace(/&(?:(amp|AMP|apos|gt|GT|lt|LT|quot|QUOT)|#(\\d+)|#[xX]([\\da-fA-F]+));/g,(e,n,r,o)=>{if(n)return _o[n];let s=Number.parseInt(r??o,r?10:16);try{return String.fromCodePoint(s)}catch{return e}})}function _r(t){return t.namespaceURI===_&&Po.has(t.localName)}function Ar(t){let e=t.localName;return t[x]===Z&&(e==="foreignObject"||e==="desc"||e==="title")}function ko(t,e){if(Co.includes(`|${t}|`))return!0;if(t!=="font")return!1;for(let n of e.matchAll(Rr))if(Io.test(n[1]))return!0;return!1}function Bt(t,e){let n=e.ownerDocument,r=n.createDocumentFragment(),o=[],s=r;for(let i of t.matchAll(Mo)){let l=i[1];if(l){let c=i[2],u=H(l),m=o[o.length-1]?.element??e,g=m[x]===Z?Z:_;if(u==="svg")g=Z;else if(g===Z){if(Ar(m))g=_;else if(ko(u,c)){for(;o.length>0;){let v=o[o.length-1];if(v.element[x]!==Z||Ar(v.element))break;o.pop(),s=v.target}g=_}}let y=g===_?u:l,E=n[Ie](y,g,null,y);for(let v of c.matchAll(Rr))E.setAttribute(v[1],vr(v[3]||v[4]||""));if(s.append(E),_r(E)||g!==_&&i[4])continue;o.push({element:E,target:s}),s=g===_&&u==="template"?E.content:E}else if(i[5]){let c=H(i[5]);for(let u=o.length-1;u>=0;u--){let m=o[u],g=H(m.element[O]);if(g===c){s=m.target,o.length=u;break}if(m.element[x]===_&&g==="template")break}}else i[6]?s.append(n.createComment(i[6])):s.append(vr(i[7]))}return r}function Vt(t){return Mr([{type:"content",child:t[R]}])}function Pr(t){return Mr([{type:"opening",node:t}])}function Mr(t){let e=[],n;for(;n=t.pop();)switch(n.type){case"opening":{let r=n.node;switch(r.nodeType){case $:{let o=r;e.push(`<${o[O]}`);let s=o[re]?.[R];for(;s;){e.push(` ${s[O]}`);let l=s[me];l!==""&&(l=String(l).replace(/&/g,"&amp;").replace(/"/g,"&quot;"),e.push(`="${l}"`)),s=s[p]}if(e.push(">"),_r(o))break;let i=o.namespaceURI===_&&o.localName==="template"?o[ie]:o;t.push({type:"closing",name:o[O]}),t.push({type:"content",child:i?.[R]??null});break}case De:{let o=r;e.push(o[K].replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;"));break}case Le:{let o=r;e.push(`<!--${o[K]}-->`);break}}break}case"content":{let r=n.child;r&&(t.push({type:"content",child:r[p]}),t.push({type:"opening",node:r}));break}case"closing":e.push(`</${n.name}>`);break}return e.join("")}var U=class extends oe{nodeType=$;[x]=_;[fe]=null;get namespaceURI(){return this[x]}get prefix(){return this[fe]}get localName(){let e=this[fe];return e==null?this[O]:this[O].slice(e.length+1)}get nodeName(){return this[x]===_?sr(this[O]):this[O]}get tagName(){return this.nodeName}get id(){return this.getAttributeNS(null,"id")??""}set id(e){this.setAttribute("id",String(e))}get slot(){return this.getAttributeNS(null,"slot")??""}set slot(e){let n=String(e);this.getAttributeNS(null,"slot")!==n&&this.attributes.setNamedItem(new ve("slot",n))}get attributes(){let e=this[re];return e||(e=new Ut(this),this[re]=e),e}getAttributeNames(){return[...this.attributes].map(e=>e.name)}getElementsByTagName(e){return Ct(this,e)}get firstElementChild(){return this.children[0]??null}getElementsByClassName(e){return Mt(this,e)}get lastElementChild(){return this.children[this.children.length-1]??null}get nextElementSibling(){let e=this.nextSibling;for(;e&&e.nodeType!==1;)e=e.nextSibling;return e}get previousElementSibling(){let e=this.previousSibling;for(;e&&e.nodeType!==1;)e=e.previousSibling;return e}setAttribute(e,n){let r=String(e),o=String(n);gn(r);let s=this[x]===_?H(r):r,i=this.attributes.getNamedItemNS(null,s);i?i.value=o:this.attributes.setNamedItem(new ve(s,o))}setAttributeNS(e,n,r){let o=ae(e),s=String(n),i=String(r),l=ht(o,s,"attribute"),c=this.attributes.getNamedItemNS(l.namespace,l.localName);c?c.value=i:this.attributes.setNamedItemNS(new ve(l.qualifiedName,i,l.namespace))}toggleAttribute(e,n){let r=String(e);gn(r);let o=this[x]===_?H(r):r,s=this.attributes.getNamedItemNS(null,o),i=n===void 0?void 0:!!n;return s==null?i===!1?!1:(this.attributes.setNamedItem(new ve(o,"")),!0):i===!0?!0:(this.attributes.removeNamedItemNS(null,o),!1)}getAttribute(e){let n=this.attributes.getNamedItem(e);return n&&n.value}getAttributeNS(e,n){let r=this.attributes.getNamedItemNS(e,n);return r&&r.value}hasAttribute(e){return this.attributes.getNamedItem(e)!=null}hasAttributeNS(e,n){return this.attributes.getNamedItemNS(e,n)!=null}removeAttribute(e){let n=String(e),r=this[x]===_?H(n):n;this.attributes.removeNamedItemNS(null,r)}removeAttributeNS(e,n){this.attributes.removeNamedItemNS(e,n)}get outerHTML(){return Pr(this)}get innerHTML(){return Vt(this)}set innerHTML(e){if(e==null||e==="")this.replaceChildren();else{let n=Bt(String(e),this);this.replaceChildren(n)}}};var He=class t extends U{[x]=Z;get ownerSVGElement(){let e=null,n=this.parentNode;for(;n instanceof t;)e=n,n=n.parentNode;return e}};var Ee=class extends ye{[K]="";constructor(e){super(),this[K]=e==null?"":String(e)}setData(e){let n=kn,r=n?this[K]:null,o="";e!=null&&(o=typeof e=="string"?e:String(e)),this[K]=o,n&&r!==o&&te({type:"characterData",target:this,oldValue:r}),this[L].setText?.(this,o)}get data(){return this[K]}set data(e){this.setData(e)}};var Ue=class extends Ee{nodeType=De;[O]="#text"};var Be=class extends Ee{nodeType=Le;[O]="#comment"};var Ve=class extends oe{nodeType=he;[O]="#document-fragment";[k]=typeof window<"u"?window.document:null;getElementById(e){return Pt(this,e)}};var Fe=class extends U{get content(){let e=this[ie];return e||(e=this.ownerDocument.createDocumentFragment(),e[pe]=this,this[ie]=e),e}set content(e){}set innerHTML(e){this.content.replaceChildren(Bt(String(e),this))}get innerHTML(){let e=this[ie];return e?Vt(e):""}};var Ft=class extends U{};var jt=class extends U{};var qt=class extends U{};var ct=class extends oe{nodeType=Se;[O]="#document";[B]=!0;constructor(e){super(),this.defaultView=e,this[k]=this,this.documentElement=zt(new qt,this,"html"),this.body=zt(new Ft,this,"body"),this.head=zt(new jt,this,"head"),this.appendChild(this.documentElement),this.documentElement.appendChild(this.head),this.documentElement.appendChild(this.body)}get textContent(){return null}set textContent(e){}getElementsByClassName(e){return Mt(this,e)}createElement(e){let n=String(e);return lr(n),Dn(this,H(n))}createElementNS(e,n){let r=ht(e,n,"element");return Dn(this,r.qualifiedName,r.namespace,r.prefix,r.localName)}[Ie](e,n,r,o){return Dn(this,e,n,r,o)}createTextNode(e){let n=Yt(new Ue(e),this);return this[L].createText?.(n,n.data),n}createComment(e){return Yt(new Be(e),this)}createDocumentFragment(){return Yt(new Ve,this)}createEvent(){return new V("")}getElementById(e){return Pt(this,e)}getElementsByTagName(e){return Ct(this,e)}importNode(e,n){if(e.nodeType===Se)throw M("Cannot import a document node","NotSupportedError");return _t(e,n,this)}adoptNode(e){if(e[k]===this)return e;let n=Rt(e);return F(()=>{let r=e.parentNode;return r?Or(r,e,n,this):ot(n.nodes,this),e})}};function Yt(t,e){return Object.defineProperty(t,k,{value:e,writable:!0,enumerable:!1}),t}function Dn(t,e,n=_,r=null,o=e){let s;if(n===Z)s=new He;else if(n===_&&o==="template")s=new Fe;else if(n===_){let i=t.defaultView.customElements.get(o);s=i?new i:new U}else s=new U;return zt(s,t,e,n,r)}function zt(t,e,n,r=_,o=null){return Yt(t,e),Object.defineProperties(t,{[O]:{value:n},[x]:{value:r},[fe]:{value:o}}),e[L].createElement?.(t,r),t}var Wt=class extends V{constructor(e,n){super(e,n),this.detail=n?.detail??null}initCustomEvent(e,n,r,o){super.initEvent(e,n,r),this.detail=o??null}};var $t=class extends V{constructor(e,n){super(e,n),this.message=n.message,this.filename=n.filename,this.lineno=n.lineno,this.colno=n.colno,this.error=n.error}};var Xt=class extends V{constructor(e,n){super(e,n),this.promise=n.promise,this.reason=n.reason}};var Kt=class extends V{constructor(e,n){super(e,n),this.oldState=n.oldState,this.newState=n.newState}};var Zt=class extends V{constructor(e,n={}){super(e,n),this.relatedTarget=n.relatedTarget??null}};var Qt=class extends V{constructor(e,n={}){super(e,n),this.clipboardData=n.clipboardData??null}};var Jt=class extends U{};var Do=/^[a-z][^A-Z\\u0000\\t\\n\\f\\r />]*-[^A-Z\\u0000\\t\\n\\f\\r />]*$/u,Lo=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]);function Cr(t){return Do.test(t)&&!Lo.has(t)}function Ir(t){return M(`Invalid custom element name: "${t}"`,"SyntaxError")}var en=class{registry=new Map;listenersByName=new Map;define(e,n,r){if(!Cr(e))throw Ir(e);if(this.registry.has(e))throw M(`A custom element named "${e}" has already been defined`,"NotSupportedError");if(this.getName(n)!=null)throw M("This constructor has already been registered in this custom element registry","NotSupportedError");this.registry.set(e,n);let o=this.listenersByName.get(e);if(o!=null){this.listenersByName.delete(e);for(let s of o)s(n)}}get(e){return this.registry.get(e)}getName(e){for(let[n,r]of this.registry)if(r===e)return n;return null}whenDefined(e){if(!Cr(e))return Promise.reject(Ir(e));let n=this.registry.get(e);if(n!=null)return Promise.resolve(n);let r=this.listenersByName.get(e);return r==null&&(r=[],this.listenersByName.set(e,r)),new Promise(o=>{r.push(o)})}upgrade(e){}initialize(e){}};var Go=["onerror","onunhandledrejection"],Dr=Symbol.for("@remote-dom/polyfill/global-property");function Lr(t){return Object.getOwnPropertyDescriptors(t)}function Gr(t){let e={};for(let[n,r]of Object.entries(Object.getOwnPropertyDescriptors(ge.prototype)))n!=="constructor"&&typeof r.value=="function"&&(r.value=Ln(r.value.bind(t)),e[n]=r);return e}function Hr(t){let e={};for(let n of Go)e[n]={configurable:!0,enumerable:!0,get:Ln(()=>t[n]),set:Ln(r=>{t[n]=r})};return e}function Ho(t){return Object.assign(Lr(t),Gr(t),Hr(t))}function Ln(t){return Object.defineProperty(t,Dr,{value:!0}),t}function kr(t,e){for(let n of Reflect.ownKeys(e)){let r=Uo(t,n);(r==null||Bo(r))&&Object.defineProperty(t,n,e[n])}}function Uo(t,e){let n=t;for(;n;){let r=Object.getOwnPropertyDescriptor(n,e);if(r)return r;n=Object.getPrototypeOf(n)}}function Bo(t){return[t.value,t.get,t.set].some(e=>typeof e=="function"&&e[Dr]===!0)}var Ae=class extends ge{[L]={};[mt]=[];[we]=Fo(this);name="";window=this;parent=this;self=this;top=this;document=new ct(this);customElements=new en;location=globalThis.location;navigator=globalThis.navigator;Event=V;ErrorEvent=$t;PromiseRejectionEvent=Xt;ToggleEvent=Kt;FocusEvent=Zt;ClipboardEvent=Qt;EventTarget=ge;CustomEvent=Wt;Node=J;ParentNode=oe;ChildNode=ye;DocumentFragment=Ve;Document=ct;CharacterData=Ee;Comment=Be;Text=Ue;Element=U;HTMLElement=Jt;SVGElement=He;HTMLTemplateElement=Fe;MutationObserver=Lt;#t=null;#n=null;#e=null;static with(...e){let n=this;return class extends n{constructor(){super();for(let o of e)Vo(this,o)}}}get onerror(){return this.#n}set onerror(e){this.#t&&this.removeEventListener("error",this.#t),e&&typeof e=="function"?(this.#n=e,this.#t=n=>{e(n.message??"Error",n.filename,n.lineno,n.colno,n.error)},this.addEventListener("error",this.#t)):(this.#t=null,this.#n=null)}get onunhandledrejection(){return this.#e}set onunhandledrejection(e){this.#e&&this.removeEventListener("unhandledrejection",this.#e),e&&typeof e=="function"?(this.#e=e,this.addEventListener("unhandledrejection",this.#e)):this.#e=null}static setGlobal(e){let n=globalThis.self,r=globalThis.window,o=Lr(e),s=Object.assign(Gr(e),Hr(e));delete o.self,Object.defineProperties(globalThis,o),kr(globalThis,s),typeof n>"u"||n===r&&n!==globalThis?Object.defineProperty(globalThis,"self",{value:e,configurable:!0,writable:!0,enumerable:!0}):n!==globalThis&&(Object.defineProperties(n,o),kr(n,s))}static setGlobalThis(e){for(let n in e)e[n]===e&&(e[n]=globalThis);Object.defineProperties(globalThis,Ho(e))}};function Vo(t,e){t[mt].push(e(t)??{})}function Fo(t){return{createElement:ce.bind(null,t,"createElement"),setAttribute:ce.bind(null,t,"setAttribute"),removeAttribute:ce.bind(null,t,"removeAttribute"),createText:ce.bind(null,t,"createText"),setText:ce.bind(null,t,"setText"),insertChild:ce.bind(null,t,"insertChild"),removeChild:ce.bind(null,t,"removeChild"),addEventListener:ce.bind(null,t,"addEventListener"),removeEventListener:ce.bind(null,t,"removeEventListener")}}function ce(t,e,...n){for(let s of t[mt])s[e]?.apply(s,n);let r=t[L];r[e]?.apply(r,n)}var tn=new Ae;var Gn="~";var be=new WeakMap;function je(t){return be.get(t)}var Vn=new WeakMap,qo=0;function X(t){let e=Vn.get(t);return e==null&&(e=String(qo++),nn(t,e)),e}function nn(t,e){Vn.set(t,e)}var Un=new WeakMap;function Yo(t){return Un.get(t)}var Bn=new WeakMap;function zo(t){let e=Bn.get(t);if(e!=null)return e;if(!(!(t instanceof Element)||t.tagName.includes("-"))){e={};for(let{name:n,value:r}of t.attributes)e[n]=r;return e}}var Wo=new WeakMap;function $o(t){return Wo.get(t)}function Fn(t,e,n){let r=Un.get(t);if(r==null&&(r={},Un.set(t,r)),r[e]===n)return;r[e]=n;let o=be.get(t);o?.mutate([[3,X(t),e,n,1]])}function Ne(t,e,n){let r=Bn.get(t);if(r==null&&(r={},Bn.set(t,r)),r[e]===n)return;n==null?delete r[e]:r[e]=String(n);let o=be.get(t);o?.mutate([[3,X(t),e,n,2]])}function qe(t,e){if(be.get(t)!==e&&(be.set(t,e),t.childNodes))for(let r=0;r<t.childNodes.length;r++)qe(t.childNodes[r],e)}function rn(t){if(be.get(t)!=null&&(be.delete(t),t.childNodes))for(let n=0;n<t.childNodes.length;n++)rn(t.childNodes[n])}function Ye(t){let{nodeType:e}=t;switch(e){case 1:return{id:X(t),type:e,element:t.localName,properties:Hn(Yo(t)),attributes:Hn(zo(t)),eventListeners:Hn($o(t)),children:Array.from(t.childNodes).map(Ye)};case 3:case 8:return{id:X(t),type:e,data:t.data};default:throw new Error(`Cannot serialize node of type ${t.nodeType} (${typeof t.nodeType})`)}}function Hn(t){return t?{...t}:void 0}function jn(t,e,...n){let r=Vn.get(t),o=be.get(t);if(r==null||o==null)throw new Error(`Cannot call method ${e} on an unconnected node`);return o.call(r,e,...n)}var ze=tn[L];ze.insertChild=(t,e,n)=>{let r=je(t);r!=null&&(qe(e,r),r.mutate([[0,X(t),Ye(e),n]]))};ze.removeChild=(t,e,n)=>{let r=je(t);r!=null&&(rn(e),r.mutate([[1,X(t),n]]))};ze.setText=(t,e)=>{let n=je(t);n?.mutate([[2,X(t),e]])};ze.setAttribute=(t,e,n)=>{t.tagName.includes("-")||Ne(t,e,n)};ze.removeAttribute=(t,e)=>{t.tagName.includes("-")||Ne(t,e)};Ae.setGlobal(tn);function on(t){if(typeof t=="string")return{type:"navigate",to:t};let{place:e,record:n,where:r,section:o}=t??{},s={...r===void 0?{}:{where:r},...o===void 0?{}:{section:String(o)}};return typeof e=="string"?{type:"navigate",place:e,...s}:typeof n=="string"?{type:"navigate",to:n,...s}:void 0}var Br=["wheel","drag","pinch"];function Vr(t){let e=t;return typeof t=="object"&&t!==null&&e.graview==="host-hello"&&typeof e.nonce=="string"}function jr(t,e={}){let n,r="",o,s=0,i=new Set,l=new Map,c=[],u=N=>{n?n.postMessage({...N,nonce:r}):c.push(N)},m=N=>{let w=N.data;if(!(!w||typeof w!="object")){if(w.type==="props"){o=w.props;for(let C of i)C(w.props)}else w.type==="answer"?(l.get(w.id)?.(w),l.delete(w.id)):w.type==="event"&&typeof w.listener=="number"?e.onEvent?.(w):w.type==="heartbeat"&&typeof w.beat=="number"&&u({type:"heartbeat",beat:w.beat});e.onMessage?.(w)}},g=()=>{},y=N=>{if(n||!t.fromHost(N)||!Vr(N.data)||N.data.protocol!==1)return;let w=N.ports[0];if(w){n=w,r=N.data.nonce,n.onmessage=m,n.start?.(),g();for(let C of c.splice(0))u(C)}};g=t.listen(y),t.ready({graview:"guest-ready",protocol:1});let E,v={get props(){return o},subscribe(N){return i.add(N),()=>i.delete(N)},act(N,w={}){let C=s+=1;return new Promise(I=>{l.set(C,I),u({type:"act",id:C,name:N,args:w})})},navigate(N){let w=on(N);w&&u(w)},size(N){u({type:"size",height:N})},autoSize(N){let w=N??globalThis.document?.documentElement,C=globalThis.ResizeObserver;if(!w||!C||typeof w.getBoundingClientRect!="function")return()=>{};E?.disconnect();let I=new C(()=>v.size(Math.ceil(w.getBoundingClientRect().height)));return I.observe(w),E=I,()=>I.disconnect()},close(){E?.disconnect(),g(),n?.close(),i.clear()}};return{guest:v,send:u}}var Yr=["globalThis","Infinity","NaN","undefined","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape","Object","Function","Array","Number","Boolean","String","Symbol","BigInt","Date","Promise","RegExp","Math","JSON","Reflect","Proxy","Intl","Error","AggregateError","EvalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError","SuppressedError","Map","Set","WeakMap","WeakSet","WeakRef","FinalizationRegistry","Iterator","AsyncIterator","DisposableStack","AsyncDisposableStack","ArrayBuffer","SharedArrayBuffer","DataView","Atomics","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float16Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"],zr=["window","parent","top","document","customElements","Event","ErrorEvent","PromiseRejectionEvent","ToggleEvent","FocusEvent","ClipboardEvent","CustomEvent","EventTarget","Node","ParentNode","ChildNode","DocumentFragment","Document","CharacterData","Comment","Text","Element","HTMLElement","SVGElement","HTMLTemplateElement","MutationObserver"],Wr=["self","postMessage","setTimeout","clearTimeout","setInterval","clearInterval","queueMicrotask","structuredClone","crypto","console","DOMException"],$r=["TEMPORARY","PERSISTENT"],vl=Object.freeze([...Yr,...zr,...Wr,...$r]),Al=Object.freeze(["constructor","__defineGetter__","__defineSetter__","hasOwnProperty","__lookupGetter__","__lookupSetter__","isPrototypeOf","propertyIsEnumerable","toString","valueOf","__proto__","toLocaleString"]),qr=t=>typeof t=="symbol"?`[${t.description??"symbol"}]`:t;function Xr(t=globalThis,e=[],n={}){let r=[],o=[],s=new Set([...Yr,...zr,...Wr,...e,"constructor",Symbol.toStringTag]),i=(S,P)=>{let q=Reflect.getOwnPropertyDescriptor(S,P);return q===void 0||!("value"in q)||q.writable||q.configurable?!1:n.primitivesStay&&typeof P=="symbol"&&(typeof q.value!="object"||q.value===null)&&typeof q.value!="function"?!0:$r.includes(P)&&typeof q.value=="number"},l=t,c=l.setTimeout,u=l.setInterval,m=l.crypto,g=(S,P)=>function(q,dt,...ft){if(typeof q!="function")throw new TypeError(`${P} takes a function: a guest view cannot run code from text`);return S.call(t,q,dt,...ft)},y=m?Object.freeze({getRandomValues:S=>m.getRandomValues(S)}):void 0,E=l.document?.defaultView;if(E&&E!==l)for(let S of Reflect.ownKeys(E))typeof S=="symbol"||s.has(S)||Reflect.deleteProperty(E,S)||o.push(`window.${S}`);let v=[];for(let S=t;S&&S!==Object.prototype;S=Object.getPrototypeOf(S))v.push(S);for(let S of v)for(let P of Reflect.ownKeys(S))s.has(P)||(Reflect.deleteProperty(S,P)?r.push(qr(P)):i(S,P)||o.push(qr(P)));let N=()=>function(){throw new EvalError("A guest view cannot make code from text.")},w=[Function.prototype,Object.getPrototypeOf(async function(){}),Object.getPrototypeOf(function*(){}),Object.getPrototypeOf(async function*(){})];for(let S of w){let P=N();Object.defineProperty(P,"prototype",{value:S,writable:!1,enumerable:!1,configurable:!1}),Reflect.defineProperty(S,"constructor",{value:P,writable:!1,enumerable:!1,configurable:!1})||o.push("Function.prototype.constructor"),S===Function.prototype&&Reflect.defineProperty(t,"Function",{value:P,writable:!0,enumerable:!1,configurable:!0})}let C=(S,P)=>{Reflect.defineProperty(t,S,{value:P,writable:!0,enumerable:!0,configurable:!0})||o.push(S)};C("setTimeout",g(c,"setTimeout")),C("setInterval",g(u,"setInterval")),y&&C("crypto",y);for(let S of v.slice(1))Object.freeze(S);for(let S of Reflect.ownKeys(t)){let P=Reflect.getOwnPropertyDescriptor(t,S);Reflect.defineProperty(t,S,"value"in P?{...P,writable:!1,configurable:!1}:{...P,configurable:!1})}let I;try{I=Reflect.preventExtensions(t)}catch{I=!1}return{removed:r,stuck:o,sealed:I}}var ut=class extends HTMLElement{constructor(){super(),nn(this,Gn)}connect(e){if(je(this)===e||(qe(this,e),this.childNodes.length===0))return;let n=[];for(let r=0;r<this.childNodes.length;r++){let o=this.childNodes[r];n.push([0,Gn,Ye(o),r])}e.mutate(n)}updateRemoteProperty(e,n){Fn(this,e,n)}callRemoteMethod(e,...n){return jn(this,e,...n)}};var f={},qn={empty:!0},Xo={id:"text",class:"text",title:"text",lang:"text",dir:{oneOf:["ltr","rtl","auto"]},hidden:"text",tabindex:{oneOf:["-1","0"]},role:"text",style:"style",translate:{oneOf:["yes","no"]},spellcheck:{oneOf:["true","false"]},draggable:{oneOf:["true","false"]},inert:"boolean"},Yn={div:f,section:f,article:f,aside:f,header:f,footer:f,nav:f,hgroup:f,search:f,address:f,figure:f,figcaption:f,blockquote:f,p:f,pre:f,hr:qn,br:qn,wbr:qn,h1:f,h2:f,h3:f,h4:f,h5:f,h6:f,span:f,strong:f,em:f,b:f,i:f,u:f,s:f,small:f,mark:f,abbr:f,cite:f,q:f,code:f,kbd:f,samp:f,var:f,sub:f,sup:f,dfn:f,bdi:f,bdo:f,ruby:f,rt:f,rp:f,time:{attributes:{datetime:"text"}},data:{attributes:{value:"text"}},del:{attributes:{datetime:"text"}},ins:{attributes:{datetime:"text"}},a:{attributes:{href:"link"}},ul:f,menu:f,dl:f,dt:f,dd:f,ol:{attributes:{start:"number",reversed:"boolean",type:{oneOf:["1","a","A","i","I"]}}},li:{attributes:{value:"number"}},table:f,caption:f,thead:f,tbody:f,tfoot:f,tr:f,colgroup:{attributes:{span:"number"}},col:{attributes:{span:"number"},empty:!0},th:{attributes:{colspan:"number",rowspan:"number",headers:"text",scope:{oneOf:["row","col","rowgroup","colgroup"]},abbr:"text"}},td:{attributes:{colspan:"number",rowspan:"number",headers:"text"}},details:{attributes:{open:"boolean",name:"text"}},summary:f,button:{attributes:{type:{oneOf:["button"]},disabled:"boolean",name:"text",value:"text"}},input:{empty:!0,attributes:{type:{oneOf:["text","search","number","range","checkbox","radio","date","time","datetime-local","month","week","color","email","tel","url"]},name:"text",value:"text",placeholder:"text",min:"text",max:"text",step:"text",checked:"boolean",disabled:"boolean",readonly:"boolean",required:"boolean",maxlength:"number",minlength:"number",size:"number",pattern:"text",multiple:"boolean",inputmode:"text",enterkeyhint:"text"}},select:{attributes:{name:"text",disabled:"boolean",multiple:"boolean",required:"boolean",size:"number"}},option:{attributes:{value:"text",selected:"boolean",disabled:"boolean",label:"text"}},optgroup:{attributes:{label:"text",disabled:"boolean"}},textarea:{attributes:{name:"text",placeholder:"text",rows:"number",cols:"number",disabled:"boolean",readonly:"boolean",required:"boolean",maxlength:"number",minlength:"number",wrap:{oneOf:["soft","hard","off"]}}},label:{attributes:{for:"text"}},fieldset:{attributes:{disabled:"boolean",name:"text"}},legend:f,output:f,meter:{attributes:{value:"number",min:"number",max:"number",low:"number",high:"number",optimum:"number"}},progress:{attributes:{value:"number",max:"number"}},img:{empty:!0,attributes:{src:"image",alt:"text",width:"number",height:"number",decoding:{oneOf:["async","sync","auto"]}}},"graview-video":{empty:!0,attributes:{autoplay:"boolean",cover:"boolean"}}},Ko=["fill","fill-opacity","fill-rule","stroke","stroke-width","stroke-linecap","stroke-linejoin","stroke-dasharray","stroke-dashoffset","stroke-opacity","stroke-miterlimit","opacity","color","display","visibility","transform-origin","clip-path","clip-rule","marker-start","marker-mid","marker-end","font-family","font-size","font-weight","font-style","text-anchor","dominant-baseline","alignment-baseline","letter-spacing","text-decoration","paint-order","vector-effect","shape-rendering","pointer-events","stop-color","stop-opacity","overflow","mask","filter","flood-color","flood-opacity","lighting-color","color-interpolation-filters"],Zo={id:"text",class:"text",style:"style",lang:"text",role:"text",tabindex:{oneOf:["-1","0"]},transform:"geometry",...Object.fromEntries(Ko.map(t=>[t,"css"]))},ue={x:"geometry",y:"geometry",width:"geometry",height:"geometry"},sn={viewBox:"geometry",preserveAspectRatio:"geometry"},Kr={oneOf:["userSpaceOnUse","objectBoundingBox"]},Zr={oneOf:["R","G","B","A"]},ne={...ue,in:"text",result:"text"},Qr={gradientUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},gradientTransform:"geometry",spreadMethod:{oneOf:["pad","reflect","repeat"]},href:"fragment"},Jr={svg:{attributes:{...ue,...sn}},g:f,defs:f,symbol:{attributes:{...ue,...sn,refX:"geometry",refY:"geometry"}},use:{attributes:{...ue,href:"fragment"}},title:f,desc:f,path:{attributes:{d:"geometry",pathLength:"number"}},rect:{attributes:{...ue,rx:"geometry",ry:"geometry",pathLength:"number"}},circle:{attributes:{cx:"geometry",cy:"geometry",r:"geometry",pathLength:"number"}},ellipse:{attributes:{cx:"geometry",cy:"geometry",rx:"geometry",ry:"geometry",pathLength:"number"}},line:{attributes:{x1:"geometry",y1:"geometry",x2:"geometry",y2:"geometry",pathLength:"number"}},polyline:{attributes:{points:"geometry",pathLength:"number"}},polygon:{attributes:{points:"geometry",pathLength:"number"}},text:{attributes:{x:"geometry",y:"geometry",dx:"geometry",dy:"geometry",rotate:"geometry",textLength:"geometry",lengthAdjust:{oneOf:["spacing","spacingAndGlyphs"]}}},tspan:{attributes:{x:"geometry",y:"geometry",dx:"geometry",dy:"geometry",rotate:"geometry",textLength:"geometry"}},textPath:{attributes:{href:"fragment",startOffset:"geometry",method:{oneOf:["align","stretch"]},spacing:{oneOf:["auto","exact"]},side:{oneOf:["left","right"]}}},linearGradient:{attributes:{x1:"geometry",y1:"geometry",x2:"geometry",y2:"geometry",...Qr}},radialGradient:{attributes:{cx:"geometry",cy:"geometry",r:"geometry",fx:"geometry",fy:"geometry",fr:"geometry",...Qr}},stop:{attributes:{offset:"geometry"}},clipPath:{attributes:{clipPathUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]}}},mask:{attributes:{...ue,maskUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},maskContentUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]}}},pattern:{attributes:{...ue,...sn,patternUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},patternContentUnits:{oneOf:["userSpaceOnUse","objectBoundingBox"]},patternTransform:"geometry",href:"fragment"}},marker:{attributes:{...sn,markerWidth:"geometry",markerHeight:"geometry",refX:"geometry",refY:"geometry",orient:"geometry",markerUnits:{oneOf:["strokeWidth","userSpaceOnUse"]}}},a:f,filter:{attributes:{...ue,filterUnits:Kr,primitiveUnits:Kr}},feBlend:{attributes:{...ne,in2:"text",mode:"text"}},feColorMatrix:{attributes:{...ne,type:{oneOf:["matrix","saturate","hueRotate","luminanceToAlpha"]},values:"geometry"}},feComponentTransfer:{attributes:ne},...Object.fromEntries(["feFuncR","feFuncG","feFuncB","feFuncA"].map(t=>[t,{attributes:{type:{oneOf:["identity","table","discrete","linear","gamma"]},tableValues:"geometry",slope:"number",intercept:"number",amplitude:"number",exponent:"number",offset:"number"}}])),feComposite:{attributes:{...ne,in2:"text",operator:{oneOf:["over","in","out","atop","xor","lighter","arithmetic"]},k1:"number",k2:"number",k3:"number",k4:"number"}},feDisplacementMap:{attributes:{...ne,in2:"text",scale:"number",xChannelSelector:Zr,yChannelSelector:Zr}},feDropShadow:{attributes:{...ne,dx:"number",dy:"number",stdDeviation:"geometry"}},feFlood:{attributes:ne},feGaussianBlur:{attributes:{...ne,stdDeviation:"geometry",edgeMode:{oneOf:["duplicate","wrap","none"]}}},feMerge:{attributes:ne},feMergeNode:{attributes:{in:"text"}},feMorphology:{attributes:{...ne,operator:{oneOf:["erode","dilate"]},radius:"geometry"}},feOffset:{attributes:{...ne,dx:"number",dy:"number"}},feTurbulence:{attributes:{...ue,result:"text",type:{oneOf:["fractalNoise","turbulence"]},baseFrequency:"geometry",numOctaves:"number",seed:"number",stitchTiles:{oneOf:["stitch","noStitch"]}}}};var eo={section:["aria-label","title"]};function Qo(t){return/^aria-[a-z]+$/.test(t)}function Jo(t){return/^data-[a-z0-9][a-z0-9_.-]*$/.test(t)}var es=new Map(Object.keys(Jr).map(t=>[t.toLowerCase(),t]));function to(t){return es.get(t.toLowerCase())}function no(t,e,n){let r=n.toLowerCase(),o=t==="html"?[Yn[e]?.attributes,Xo]:[Jr[e]?.attributes,Zo],s=t==="svg"&&r==="xlink:href"?"href":r;for(let i of o)if(i){for(let[l,c]of Object.entries(i))if(l.toLowerCase()===s)return{name:l,kind:c}}if(Qo(r)||Jo(r))return{name:r,kind:"text"}}var an=/^\\d{4}-\\d{2}-\\d{2}$/;function ts(t,e){if(typeof t!="string"||typeof e!="string"||!an.test(t)||!an.test(e))return;let n=Math.round((Date.parse(`${t}T00:00:00Z`)-Date.parse(`${e}T00:00:00Z`))/864e5);return Number.isFinite(n)?n:void 0}function ro(t,e,n={}){let r=ts(t,e);if(r===void 0)return"";if(r===0)return"today";if(r===1)return"tomorrow";if(r<0&&n.due===!0)return"overdue";if(r===-1)return"yesterday";let o=Math.abs(r),[s,i]=o<14?[o,"day"]:o<60?[Math.round(o/7),"week"]:o<730?[Math.round(o/30.44),"month"]:[Math.round(o/365.25),"year"],l=`${s} ${i}${s===1?"":"s"}`;return r>0?`in ${l}`:`${l} ago`}function oo(t,e){if(typeof t!="string")return;if(an.test(t))return t;let n=Date.parse(t);if(Number.isFinite(n)){if(!/(Z|[+-]\\d\\d:?\\d\\d)$/.test(t))return an.test(t.slice(0,10))?t.slice(0,10):void 0;try{let r=new Intl.DateTimeFormat("en-CA",{timeZone:e||"UTC",year:"numeric",month:"2-digit",day:"2-digit"}).formatToParts(n),o=s=>r.find(i=>i.type===s)?.value??"";return`${o("year")}-${o("month")}-${o("day")}`}catch{return new Date(n).toISOString().slice(0,10)}}}var so="~",ln=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),se=(t,e=0)=>{if(t===null||typeof t=="string"||typeof t=="number"||typeof t=="boolean"||t===void 0)return t;if(!(e>64||typeof t!="object"))return Array.isArray(t)?t.map(n=>se(n,e+1)):Object.fromEntries(Object.entries(t).map(([n,r])=>[n,se(r,e+1)]))};function io(){let t=new Map,e=new Map,n=new Map([[so,{children:[],listeners:new Map}]]),r=0,o=u=>{let m=e.get(u);return m===void 0&&(m=r+=1,e.set(u,m),t.set(m,{listener:u,count:0})),t.get(m).count+=1,m},s=u=>{let m=t.get(u);m&&(m.count-=1,!(m.count>0)&&(t.delete(u),e.delete(m.listener)))},i=u=>{let m=n.get(u);if(m){n.delete(u);for(let g of m.listeners.values())s(g);for(let g of m.children)i(g)}},l=(u,m,g=0)=>{if(!ln(u)||g>64)return se(u);let y=typeof u.id=="string"?u.id:void 0,E=m&&y!==void 0&&y!==so;E&&i(y);let v={children:[],listeners:new Map};E&&n.set(y,v);let N={};for(let[w,C]of Object.entries(u))w==="children"&&Array.isArray(C)?N[w]=C.map(I=>{let S=l(I,E,g+1);return E&&ln(I)&&typeof I.id=="string"&&v.children.push(I.id),S}):w==="eventListeners"&&ln(C)?N[w]=Object.fromEntries(Object.entries(C).map(([I,S])=>{if(typeof S!="function"||!E)return[I,void 0];let P=o(S);return v.listeners.set(I,P),[I,{listener:P}]})):N[w]=se(C,g+1);return N},c=u=>{if(!Array.isArray(u))return se(u);let[m,g]=u,y=typeof g=="string"?n.get(g):void 0;if(m===0){let E=l(u[2],y!==void 0),v=ln(u[2])?u[2].id:void 0;if(y&&typeof v=="string"&&n.has(v)){let N=Number(u[3]);y.children.splice(Number.isInteger(N)&&N>=0&&N<=y.children.length?N:y.children.length,0,v)}return[m,se(g),E,se(u[3])]}if(m===1){let E=Number(u[2]);return y&&Number.isInteger(E)&&E>=0&&E<y.children.length&&i(y.children.splice(E,1)[0]),se(u)}if(m===3&&u[4]===3){let E=String(u[2]),v=u[3],N=y&&typeof v=="function"?o(v):void 0,w=y?.listeners.get(E);return w!==void 0&&s(w),N===void 0?y?.listeners.delete(E):y.listeners.set(E,N),[m,se(g),E,N===void 0?void 0:{listener:N},3]}return se(u)};return{encode:u=>u.map(c),listener:u=>t.get(u)?.listener,get listening(){return t.size},get nodes(){return n.size-1}}}var cn="graview-view-root",ns=["value","checked","key","pressed","files","refused","x","y","width","height","deltaX","deltaY","deltaMode","ctrlKey","metaKey","phase","pointerId","button","pressure","dx","dy","scale","rotation"],rs=t=>t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/\'/g,"&#39;"),os=t=>Object.freeze({html:t,toString:()=>t}),ao=t=>typeof t=="object"&&t!==null&&typeof t.html=="string"&&Object.isFrozen(t),lo=t=>t==null||t===!1?"":Array.isArray(t)?t.map(lo).join(""):ao(t)?t.html:rs(String(t));function co(t){customElements.get(cn)||customElements.define(cn,ut);let e=Event,n=io(),r=new Set,o=new Set,s,i=[],l=new Set;for(let a of["closest","matches","dataset"]){let d=()=>{throw new TypeError(`A view\'s element has no ${a}: graview.on hands event.element, the element its selector matched; read event.element.getAttribute("data-\\u2026").`)};a in Element.prototype||Object.defineProperty(Element.prototype,a,a==="dataset"?{get:d}:{value:d})}let c=document.createElement(cn),u=a=>{let d=h=>{for(let T of Array.from(h.childNodes)){if(T.nodeType!==1)continue;if(X(T)===a)return T;let b=d(T);if(b)return b}};return d(c)},m=a=>{let d=u(a.target);if(!d)return;let h=new e(a.event,{bubbles:!0}),T={};for(let b of ns)a[b]!==void 0&&(T[b]=a[b]);for(let b of Object.keys(T))Object.defineProperty(h,b,{value:T[b],enumerable:!0});d.dispatchEvent(h);for(let b of o){if(b.type!==a.event)continue;let A;try{A=new Set(Array.from(c.querySelectorAll(b.selector)))}catch{continue}for(let G=d;G&&G!==c;G=G.parentNode)if(A.has(G)){b.listener(Object.freeze({type:a.event,target:d,element:G,...T}));break}}},g=Error,y=new Map,E=0,v=(a,d,h)=>new Promise((T,b)=>{let A=++E;y.set(A,G=>G.ok?T(G):b(new g(G.sentence??"This value was not kept."))),t.send({type:"mine",id:A,op:a,key:d,...a==="set"?{value:h}:{}})}),N=a=>(a.catch(()=>{}),a),w=Object.freeze({get(a){return N(v("get",a).then(d=>typeof d.value=="string"?d.value:null))},set(a,d){return N(v("set",a,d).then(()=>{}))}}),C=a=>{if(a.type==="mine-answer"){let b=y.get(a.id);return y.delete(a.id),b?.(a)}if(a.type==="dom-event"&&typeof a.target=="string")return m(a);if(a.type==="notice")return t.warn(a.text);if(a.type!=="props")return;s=a.props;let d=t.now();for(let b of r)try{b(a.props)}catch(A){t.threw(A)}let h=t.now()-d,T=a.push;typeof T=="number"&&t.microtask(()=>t.microtask(()=>t.send({type:"pushed",push:T,ms:h})))},I;c.connect({mutate(a){I||(I=[],t.microtask(()=>{let d=I??[];I=void 0,t.send({type:"render",records:n.encode(d)})})),I.push(...a)},call:()=>{}});let S=a=>a.nodeType===1?a.getAttribute("data-key")??a.getAttribute("id"):null,P=(a,d)=>a.nodeType===d.nodeType&&(a.nodeType!==1||a.localName===d.localName&&a.namespaceURI===d.namespaceURI&&S(a)===S(d));function q(a,d){let h=Array.from(d.childNodes),T=0;for(let b of h){let A=a.childNodes[T]??null;if(A&&P(A,b)){dt(A,b),T+=1;continue}if(S(b)!==null){let de=Array.from(a.childNodes).slice(T+1).find(We=>P(We,b));if(de){a.insertBefore(de,A),dt(de,b),T+=1;continue}}a.insertBefore(b,A),T+=1}for(;a.childNodes.length>T;)a.removeChild(a.lastChild)}function dt(a,d){if(a.nodeType!==1){a.data!==d.data&&(a.data=d.data);return}let h=a,T=d,b=ft(h);for(let A of h.getAttributeNames())T.hasAttribute(A)||(h.removeAttribute(A),b&&Ne(h,A,void 0));for(let A of T.getAttributeNames()){let G=T.getAttribute(A);h.getAttribute(A)!==G&&h.setAttribute(A,G),b&&Ne(h,A,G)}q(h,T)}let ft=a=>a.localName.includes("-");function Xn(a){for(let d of Array.from(a.childNodes)){if(d.nodeType!==1)continue;let h=d;if(ft(h))for(let T of h.getAttributeNames())Ne(h,T,h.getAttribute(T)??void 0);Xn(h)}}function Kn(a,d,h){for(let T of Array.from(a.childNodes)){if(T.nodeType!==1)continue;let b=T,A=b.localName,G=d||A.toLowerCase()==="svg",de=G?to(A):Object.prototype.hasOwnProperty.call(Yn,A.toLowerCase())?A.toLowerCase():void 0;if(!de){h.add(`<${A}>`);continue}for(let We of b.getAttributeNames())(!no(G?"svg":"html",de,We)||!G&&eo[de]?.includes(We.toLowerCase()))&&h.add(`${de} ${We}`);Kn(b,G,h)}}function fo(a){let d=document.createElement("div"),h=Array.isArray(a)?a:[a];for(let b of h)if(b!=null)if(typeof b=="string"||ao(b)){let A=document.createElement("div");A.innerHTML=typeof b=="string"?b:b.html,d.append(...Array.from(A.childNodes))}else d.append(b);let T=new Set;Kn(d,!1,T),i=[...T],i.length>0&&t.warn(`The host will not draw: ${i.join(", ")}`),Xn(d),q(c,d)}let un=[],dn=new Set(Br),Zn="[]",fn=!1,Qn=()=>{fn||(fn=!0,t.microtask(()=>{fn=!1;let a=[...new Map([...o].filter(h=>dn.has(h.type)).map(h=>[`${h.type} ${h.selector}`,{event:h.type,selector:h.selector}])).entries()].sort(([h],[T])=>h<T?-1:h>T?1:0).map(([,h])=>h),d=JSON.stringify(a);d!==Zn&&(Zn=d,t.send({type:"gestures",bound:a}))}))},Jn="[[],[]]",mn=!1,er=()=>{mn||(mn=!0,t.microtask(()=>{mn=!1;let a=b=>[...new Set([...o].filter(A=>A.type===b&&typeof A.selector=="string").map(A=>A.selector))].sort().slice(0,200),d=a("click"),h=a("acted"),T=JSON.stringify([d,h]);T!==Jn&&(Jn=T,t.send({type:"clicks",selectors:d,...h.length>0?{acted:h}:{}}))}))},tr=Object.freeze({get props(){return s},onProps(a){return r.add(a),s&&a(s),()=>void r.delete(a)},render:fo,style(a){typeof a!="string"||un.includes(a)||(un.push(a),t.send({type:"style",sheets:[...un]}))},on(a,d,h){let T={type:a,selector:d,listener:h};return o.add(T),typeof a=="string"&&!l.has(a)&&(l.add(a),t.send({type:"hears",events:[a]})),dn.has(a)&&Qn(),(a==="click"||a==="acted")&&er(),()=>{o.delete(T),dn.has(a)&&Qn(),(a==="click"||a==="acted")&&er()}},act:(a,d={})=>t.act(a,d),mine:w,navigate(a){if(typeof a=="string")return t.navigate(a);let d=on(a);d&&t.send(d)},html(a,...d){return os(a.reduce((h,T,b)=>h+T+(b<d.length?lo(d[b]):""),""))},get today(){return s?.today??new Date().toISOString().slice(0,10)},fromToday(a,d){let h=oo(a,s?.timeZone);return h===void 0?"":ro(h,tr.today,d)},get refused(){return i},get hardening(){return t.hardening()}});return{view:tr,hear:C,find:a=>{try{let d=c.querySelectorAll(a)[0];return d?X(d):void 0}catch{return}},listened:a=>{let d=new Set;for(let h of o)if(h.type===a)try{for(let T of Array.from(c.querySelectorAll(h.selector))){let b=X(T);b&&d.add(b)}}catch{}return[...d]}}}var $n={removed:[],stuck:[],sealed:!1,worker:!1},zn=jr({listen(t){return _e.listen(t),()=>_e.unlisten(t)},fromHost:()=>!0,ready:t=>_e.post(t)},{onMessage:t=>uo.hear(t)}),uo=co({send:t=>zn.send(t),act:(t,e)=>zn.guest.act(t,e),navigate:t=>zn.guest.navigate(t),microtask:_e.microtask,now:_e.now,threw:t=>console.error(t),warn:t=>console.warn(t),hardening:()=>$n}),ss=uo.view;Object.defineProperty(globalThis,"graview",{value:ss,enumerable:!0,configurable:!0,writable:!1});var Wn="WorkerGlobalScope"in globalThis?Xr(globalThis,["graview"]):$n;$n=Wn;if(Wn.stuck.length>0)throw new Error(`The view\'s worker could not be hardened: ${Wn.stuck.join(", ")} would not go.`);})();\n';export{e as VIEW_RUNTIME};