@jxsuite/studio 10.5.0 → 10.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data/locales/en/elements.json +434 -0
- package/data/webdata.json +116 -139
- package/dist/chunks/{2020-7sx2vexa.js → 2020-rqm7qrje.js} +3 -3
- package/dist/chunks/adapter-cyy8vbcx.js +4 -0
- package/dist/chunks/add-new-flow-8cgtejv2.js +4 -0
- package/dist/chunks/{cf-account-picker-ajh60k54.js → cf-account-picker-v3qd2dhw.js} +3 -3
- package/dist/chunks/cf-settings-1fnw874z.js +4 -0
- package/dist/chunks/{color-area-gbcftzh3.js → color-area-frd9y9q6.js} +2 -2
- package/dist/chunks/{color-field-85136598.js → color-field-rebpbe33.js} +3 -3
- package/dist/chunks/{color-slider-w1s3ndd8.js → color-slider-6bzmk3s7.js} +2 -2
- package/dist/chunks/color-t2bnnj8y.js +4 -0
- package/dist/chunks/{combobox-dk98wc5x.js → combobox-c49x7gf1.js} +2 -2
- package/dist/chunks/components-y8yhdd7d.js +4 -0
- package/dist/chunks/content-source-9e7qvmsf.js +4 -0
- package/dist/chunks/convert-to-repeater-pd2w4z21.js +4 -0
- package/dist/chunks/editor-mb9jzdrw.js +4 -0
- package/dist/chunks/entry-commands-at0wnx3f.js +4 -0
- package/dist/chunks/extension-sections-4z9qq0gh.js +4 -0
- package/dist/chunks/file-ops-dtdvjmza.js +4 -0
- package/dist/chunks/files-8pf70854.js +4 -0
- package/dist/chunks/format-host-fd3m2y2a.js +4 -0
- package/dist/chunks/fs-events-hrk29vcv.js +4 -0
- package/dist/chunks/grid-open-bh74v82z.js +4 -0
- package/dist/chunks/{grid-view-0v4hjspb.js → grid-view-a51mgzmq.js} +10 -10
- package/dist/chunks/{icons-j9eksgew.js → icons-qp8fn1k8.js} +2 -2
- package/dist/chunks/{iframe-entry-4zqtn3ry.js → iframe-entry-mpwe5pwk.js} +4 -4
- package/dist/chunks/{iframe-entry-2x9bn5ng.js → iframe-entry-msd43x9h.js} +4 -4
- package/dist/chunks/iframe-entry-rt8jz5t8.js +5 -0
- package/dist/chunks/{iframe-entry-54kwwhmg.js → iframe-entry-v40cr813.js} +2 -2
- package/dist/chunks/iframe-host-q0s0wwy3.js +4 -0
- package/dist/chunks/{image-bake-m8gzaan9.js → image-bake-q9ajdjsj.js} +3 -3
- package/dist/chunks/{image-editor-0afyws7c.js → image-editor-ke9std9b.js} +2 -2
- package/dist/chunks/index-57ang7ma.js +4 -0
- package/dist/chunks/index-eytr7av4.js +17 -0
- package/dist/chunks/{index-2q88g57p.js → index-x495reff.js} +3 -3
- package/dist/chunks/{javascript-5sxtr1g7.js → javascript-qe34bvaz.js} +3 -3
- package/dist/chunks/{jsonMode-m6sf47hq.js → jsonMode-m8rseh31.js} +8 -8
- package/dist/chunks/jx-validate-bbd1mary.js +4 -0
- package/dist/chunks/layers-panel-wcjtdqsa.js +4 -0
- package/dist/chunks/layers-yscpys6q.js +4 -0
- package/dist/chunks/{listbox-k5p41049.js → listbox-tktzq5xj.js} +2 -2
- package/dist/chunks/lit-html-qm5wbhqz.js +4 -0
- package/dist/chunks/media-library-2hfff88g.js +4 -0
- package/dist/chunks/media-open-4pb05cne.js +4 -0
- package/dist/chunks/media-picker-bzktmmwr.js +4 -0
- package/dist/chunks/{menu-26nez152.js → menu-xc3cbgsd.js} +2 -2
- package/dist/chunks/{monaco-binding-1s2b8snq.js → monaco-binding-7t38arh9.js} +3 -3
- package/dist/chunks/monaco-buffer-3vz94c9f.js +4 -0
- package/dist/chunks/monaco-setup-fstdew02.js +4 -0
- package/dist/chunks/notify-gbdcckrh.js +4 -0
- package/dist/chunks/parse-fpdzgk4c.js +4 -0
- package/dist/chunks/platform-9g72gdqr.js +4 -0
- package/dist/chunks/{popover-fhdnt4be.js → popover-cnmsav6b.js} +2 -2
- package/dist/chunks/publish-panel-91x1cb5d.js +4 -0
- package/dist/chunks/publish-quick-e2dmf7eg.js +4 -0
- package/dist/chunks/publish-workspace-1x8mnzrj.js +4 -0
- package/dist/chunks/quick-search-2m4y6p1x.js +4 -0
- package/dist/chunks/references-yg1g9rwx.js +4 -0
- package/dist/chunks/right-panel-7mfyhzrk.js +4 -0
- package/dist/chunks/source-control-rrc4jgp5.js +4 -0
- package/dist/chunks/{split-qh21j2b0.js → split-d15yencd.js} +2 -2
- package/dist/chunks/{studio-r5g7fx7q.js → studio-0jhhznxy.js} +6 -6
- package/dist/chunks/studio-0nb57pjg.js +7 -0
- package/dist/chunks/{studio-bpzwhn88.js → studio-0wa4wv4s.js} +4 -4
- package/dist/chunks/studio-0z8kp4xk.js +5 -0
- package/dist/chunks/{studio-jqvke4ac.js → studio-18gc5t3v.js} +4 -4
- package/dist/chunks/{studio-xh6rf05g.js → studio-1b79rpcb.js} +4 -4
- package/dist/chunks/studio-211q5j7m.js +4 -0
- package/dist/chunks/studio-213pyfxh.js +16 -0
- package/dist/chunks/studio-2b1smjvp.js +5 -0
- package/dist/chunks/{studio-dst8y8vh.js → studio-2v6tc9jp.js} +4 -4
- package/dist/chunks/studio-30j0wz99.js +5 -0
- package/dist/chunks/studio-3kmqhwtt.js +5 -0
- package/dist/chunks/studio-44drsmhw.js +5 -0
- package/dist/chunks/{studio-d5f7sskn.js → studio-495b6f2r.js} +4 -4
- package/dist/chunks/{studio-g65t6svn.js → studio-4gthb2fd.js} +4 -4
- package/dist/chunks/{studio-bmwgj8ez.js → studio-4xadhxj1.js} +4 -4
- package/dist/chunks/{studio-zav9hgb3.js → studio-52mzbxqm.js} +4 -4
- package/dist/chunks/{studio-thgexj3w.js → studio-56mmnsw8.js} +7 -7
- package/dist/chunks/studio-59hz8f4r.js +5 -0
- package/dist/chunks/{studio-bk0anq3b.js → studio-5k9mfafh.js} +3 -3
- package/dist/chunks/{studio-qarg1xf9.js → studio-5qez462c.js} +5 -5
- package/dist/chunks/studio-6tnpg0vx.js +5 -0
- package/dist/chunks/studio-6w8mt734.js +6 -0
- package/dist/chunks/studio-7hm04x5z.js +5 -0
- package/dist/chunks/studio-8atmfjjm.js +7 -0
- package/dist/chunks/{studio-69g6a0jn.js → studio-8n99z71s.js} +4 -4
- package/dist/chunks/{studio-ep1384t9.js → studio-8vmad6x2.js} +4 -4
- package/dist/chunks/{studio-6sxnqqw8.js → studio-93p5k4r4.js} +4 -4
- package/dist/chunks/{studio-hy936516.js → studio-9gb0m81w.js} +4 -4
- package/dist/chunks/{studio-ek4fb4eb.js → studio-a4ymg4vd.js} +4 -4
- package/dist/chunks/studio-anc8067x.js +5 -0
- package/dist/chunks/{studio-ketrgtph.js → studio-dbdt67kr.js} +5 -5
- package/dist/chunks/studio-dbex091t.js +5 -0
- package/dist/chunks/{studio-nngc45ct.js → studio-dj8ctxey.js} +4 -4
- package/dist/chunks/{studio-pgze9p34.js → studio-ed9bz68j.js} +5 -5
- package/dist/chunks/{studio-4ncxzw5m.js → studio-fe2d1fp5.js} +4 -4
- package/dist/chunks/{studio-m8hesdrw.js → studio-fgp4cyy3.js} +4 -4
- package/dist/chunks/{studio-151kgn69.js → studio-ft706q02.js} +4 -4
- package/dist/chunks/{studio-pv1ts08p.js → studio-g79s1dyg.js} +5 -5
- package/dist/chunks/{studio-zkkt13qd.js → studio-gahswxp4.js} +4 -4
- package/dist/chunks/{studio-x5ffyssw.js → studio-gbqc12bk.js} +4 -4
- package/dist/chunks/{studio-4jy967rj.js → studio-gxphbetb.js} +5 -5
- package/dist/chunks/studio-hdf01j7q.js +7 -0
- package/dist/chunks/studio-hf259xzd.js +48 -0
- package/dist/chunks/studio-jbva4wxw.js +5 -0
- package/dist/chunks/{studio-td3h1644.js → studio-jj9gf1qc.js} +4 -4
- package/dist/chunks/studio-jsjg3mjv.js +5 -0
- package/dist/chunks/studio-jtvb8hd7.js +5 -0
- package/dist/chunks/{studio-c72v1kwc.js → studio-kp4vzrct.js} +4 -4
- package/dist/chunks/{studio-s4k1v7dt.js → studio-kpx02gaa.js} +6 -6
- package/dist/chunks/{studio-3yr1zdp9.js → studio-kv1728ex.js} +8 -8
- package/dist/chunks/studio-m25ry0mf.js +5 -0
- package/dist/chunks/studio-mcbwmkyh.js +5 -0
- package/dist/chunks/studio-meajkr51.js +5 -0
- package/dist/chunks/studio-mkjrjpr2.js +6 -0
- package/dist/chunks/{studio-nv5eq0f7.js → studio-mr084886.js} +181 -181
- package/dist/chunks/{studio-43pynnhz.js → studio-mrb10hv3.js} +4 -4
- package/dist/chunks/{studio-7qqb7hb8.js → studio-nhpg405j.js} +4 -4
- package/dist/chunks/{studio-n271vdsg.js → studio-nsec0hxm.js} +41 -41
- package/dist/chunks/{studio-ztzf8mce.js → studio-nv0mh0p5.js} +4 -4
- package/dist/chunks/studio-pafmb06w.js +5 -0
- package/dist/chunks/{studio-4s5bka8t.js → studio-pgftd79b.js} +4 -4
- package/dist/chunks/{studio-wn2cmf9q.js → studio-pk961xgz.js} +4 -4
- package/dist/chunks/studio-pzbr7g05.js +5 -0
- package/dist/chunks/{studio-15mfah02.js → studio-qcc5hsw2.js} +6 -6
- package/dist/chunks/studio-qfq58c8n.js +5 -0
- package/dist/chunks/{studio-j3bq30yz.js → studio-qvb2jr83.js} +4 -4
- package/dist/chunks/studio-r85zw6ay.js +5 -0
- package/dist/chunks/{studio-f69wcajk.js → studio-s0kwce5w.js} +5 -5
- package/dist/chunks/studio-s6ymkf3q.js +14 -0
- package/dist/chunks/{studio-8ncm9zwx.js → studio-s7p5ccxa.js} +4 -4
- package/dist/chunks/{studio-zzgp5yka.js → studio-s9jjap3x.js} +4 -4
- package/dist/chunks/{studio-ber1dgte.js → studio-t5hde1ws.js} +4 -4
- package/dist/chunks/studio-vj9yv897.js +5 -0
- package/dist/chunks/{studio-ajfq4fmr.js → studio-wmak8xjw.js} +4 -4
- package/dist/chunks/{studio-k05g7efh.js → studio-wqsmvtqj.js} +4 -4
- package/dist/chunks/studio-x3z3rhej.js +5 -0
- package/dist/chunks/{studio-7qr8k0v2.js → studio-xb55kpmy.js} +4 -4
- package/dist/chunks/{studio-f3awr5nc.js → studio-xxtdajmv.js} +7 -7
- package/dist/chunks/{studio-1a7zshnv.js → studio-xxttcym1.js} +4 -4
- package/dist/chunks/{studio-czpmzs9r.js → studio-y2zsnzye.js} +7 -7
- package/dist/chunks/{studio-9f5vcb4w.js → studio-y3tjh2xb.js} +3 -3
- package/dist/chunks/studio-y4f1rdsj.js +5 -0
- package/dist/chunks/studio-ybkd5w8k.js +5 -0
- package/dist/chunks/{studio-cv6gnjqd.js → studio-yetr4gg1.js} +4 -4
- package/dist/chunks/{studio-ehj3csbm.js → studio-z295anhs.js} +5 -5
- package/dist/chunks/{studio-pte5w7rf.js → studio-z89e6wpg.js} +8 -8
- package/dist/chunks/{studio-4z0cdh16.js → studio-zbwr6prc.js} +3 -3
- package/dist/chunks/{studio-w3aafbpk.js → studio-zdbsv5q2.js} +3 -3
- package/dist/chunks/{studio-eq5vqn1q.js → studio-zvthj8hg.js} +4 -4
- package/dist/chunks/toast-2kn2vrn4.js +4 -0
- package/dist/chunks/{toast-host-g3r2s0kn.js → toast-host-3rxeyj3d.js} +3 -3
- package/dist/chunks/{tooltip-gtx40bjg.js → tooltip-ghkxkasp.js} +2 -2
- package/dist/chunks/{tree-a19s1c05.js → tree-vw4nc63s.js} +2 -2
- package/dist/chunks/{tsMode-3f116hth.js → tsMode-7gngmamr.js} +7 -7
- package/dist/chunks/workspace-gv0hxgsm.js +4 -0
- package/dist/chunks/workspace-home-j7e0mjy5.js +4 -0
- package/dist/chunks/{ws-client-cb49m87s.js → ws-client-vs11sxc5.js} +3 -3
- package/dist/iframe-entry.js +14 -14
- package/dist/manifest.json +84 -83
- package/dist/studio.js +80 -80
- package/package.json +12 -12
- package/src/browse/preview-style.ts +2 -1
- package/src/canvas/canvas-render.ts +6 -1
- package/src/canvas/iframe-drop.ts +84 -1
- package/src/canvas/iframe-entry.ts +9 -6
- package/src/canvas/iframe-render.ts +13 -0
- package/src/collab/collab-session.ts +2 -2
- package/src/commands/levels.ts +1 -1
- package/src/create/add-new-flow.ts +2 -1
- package/src/editor/convert-targets.ts +2 -23
- package/src/editor/slash-menu.ts +35 -17
- package/src/files/files.ts +18 -0
- package/src/format/format-choices.ts +5 -5
- package/src/format/format-host.ts +35 -3
- package/src/grid/redirects-grid.ts +4 -4
- package/src/locale/element-names.ts +131 -0
- package/src/panels/dnd.ts +3 -1
- package/src/panels/elements-panel.ts +93 -36
- package/src/panels/imports-panel.ts +3 -2
- package/src/panels/navigator-panels.ts +10 -10
- package/src/panels/panel-registry.ts +3 -3
- package/src/panels/site-panel.ts +2 -1
- package/src/panels/style-panel.ts +2 -1
- package/src/panels/styles-panel.ts +2 -2
- package/src/platforms/cloud.ts +5 -2
- package/src/services/ai-command-tools.ts +2 -1
- package/src/services/ai-project-tools.ts +18 -5
- package/src/services/jxn-language.ts +110 -0
- package/src/services/model-uri.ts +3 -0
- package/src/services/monaco-setup.ts +6 -2
- package/src/settings/contributed-section.ts +2 -1
- package/src/settings/extension-commands.ts +2 -1
- package/src/settings/general-settings.ts +2 -2
- package/src/settings/settings-document.ts +5 -5
- package/src/shell.ts +1 -1
- package/src/studio.ts +28 -11
- package/src/style/variables-view.ts +2 -2
- package/src/surfaces/panel-elements.json +466 -206
- package/src/surfaces/panel-elements.ts +61 -25
- package/src/tabs/project-config.ts +13 -13
- package/src/tabs/tab.ts +7 -2
- package/src/types.ts +11 -2
- package/src/view.ts +9 -2
- package/src/workspace/tab-workspace.ts +2 -2
- package/src/workspace/workspace-back.ts +2 -2
- package/dist/chunks/adapter-12dxr3z7.js +0 -4
- package/dist/chunks/add-new-flow-any4pw2q.js +0 -4
- package/dist/chunks/cf-settings-hbj16kh3.js +0 -4
- package/dist/chunks/color-thzpppyc.js +0 -4
- package/dist/chunks/components-a98hzqw9.js +0 -4
- package/dist/chunks/content-source-jq3fjs3w.js +0 -4
- package/dist/chunks/convert-to-repeater-g66r6qp1.js +0 -4
- package/dist/chunks/editor-rth1rzj8.js +0 -4
- package/dist/chunks/entry-commands-02j0s19w.js +0 -4
- package/dist/chunks/extension-sections-rqrs7dr0.js +0 -4
- package/dist/chunks/file-ops-6a49er4c.js +0 -4
- package/dist/chunks/files-b2p9y0yz.js +0 -4
- package/dist/chunks/format-host-7xe57k1s.js +0 -4
- package/dist/chunks/fs-events-0xsy168g.js +0 -4
- package/dist/chunks/grid-open-h3q4fjy5.js +0 -4
- package/dist/chunks/iframe-entry-m24fza30.js +0 -5
- package/dist/chunks/iframe-host-8jcmaktg.js +0 -4
- package/dist/chunks/index-7nj2375a.js +0 -4
- package/dist/chunks/jx-validate-808zgbgy.js +0 -4
- package/dist/chunks/layers-0ffdtqjn.js +0 -4
- package/dist/chunks/layers-panel-rw62wtvf.js +0 -4
- package/dist/chunks/lit-html-9bz9rcfv.js +0 -4
- package/dist/chunks/media-library-2a5hdbek.js +0 -4
- package/dist/chunks/media-open-069kzhj4.js +0 -4
- package/dist/chunks/media-picker-4p4pd28y.js +0 -4
- package/dist/chunks/monaco-buffer-m9fd2dka.js +0 -4
- package/dist/chunks/monaco-setup-e0crh3v6.js +0 -4
- package/dist/chunks/notify-re3js157.js +0 -4
- package/dist/chunks/parse-hee7ne9b.js +0 -4
- package/dist/chunks/platform-rywy3tkg.js +0 -4
- package/dist/chunks/publish-panel-czkpg8m4.js +0 -4
- package/dist/chunks/publish-quick-b9wbhqj6.js +0 -4
- package/dist/chunks/publish-workspace-yy6d23b7.js +0 -4
- package/dist/chunks/quick-search-tp7pjnmv.js +0 -4
- package/dist/chunks/references-wd2yj8s1.js +0 -4
- package/dist/chunks/right-panel-x971k0zc.js +0 -4
- package/dist/chunks/source-control-k4p00hpe.js +0 -4
- package/dist/chunks/studio-1d8m5s38.js +0 -16
- package/dist/chunks/studio-35pmfjtx.js +0 -5
- package/dist/chunks/studio-44xqe0b7.js +0 -4
- package/dist/chunks/studio-48yzqzqr.js +0 -5
- package/dist/chunks/studio-5rq3e4q5.js +0 -5
- package/dist/chunks/studio-6hcfm9q3.js +0 -5
- package/dist/chunks/studio-6mf31e16.js +0 -5
- package/dist/chunks/studio-8w5pa88p.js +0 -7
- package/dist/chunks/studio-9c6cbq2c.js +0 -4
- package/dist/chunks/studio-aaw7wxv8.js +0 -5
- package/dist/chunks/studio-afx9brsc.js +0 -5
- package/dist/chunks/studio-dmgh2rrj.js +0 -5
- package/dist/chunks/studio-erjccagy.js +0 -5
- package/dist/chunks/studio-ex1644g2.js +0 -5
- package/dist/chunks/studio-gw83z798.js +0 -7
- package/dist/chunks/studio-j52ks8q7.js +0 -5
- package/dist/chunks/studio-kefs4sz4.js +0 -5
- package/dist/chunks/studio-m3jrjfhy.js +0 -14
- package/dist/chunks/studio-n4pnf0sw.js +0 -5
- package/dist/chunks/studio-ncwx602y.js +0 -5
- package/dist/chunks/studio-nzp0sqjg.js +0 -5
- package/dist/chunks/studio-ph17an19.js +0 -5
- package/dist/chunks/studio-q509sqt8.js +0 -5
- package/dist/chunks/studio-s49y6m5b.js +0 -5
- package/dist/chunks/studio-t46rt6gx.js +0 -5
- package/dist/chunks/studio-veh91hjv.js +0 -5
- package/dist/chunks/studio-vswmz40d.js +0 -6
- package/dist/chunks/studio-w4mfaaam.js +0 -5
- package/dist/chunks/studio-x5py815g.js +0 -5
- package/dist/chunks/studio-z6s56dzz.js +0 -5
- package/dist/chunks/studio-ze1sm147.js +0 -7
- package/dist/chunks/studio-zn7ysyzb.js +0 -5
- package/dist/chunks/toast-w11qpkyz.js +0 -4
- package/dist/chunks/workspace-home-61n1jz3q.js +0 -4
- package/dist/chunks/workspace-sheek6zw.js +0 -4
package/dist/iframe-entry.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import{e,
|
|
2
|
-
var fr="jx:canvas";function ri(o){let{target:l,source:d,targetOrigin:f,acceptOrigin:p,token:m}=o,g=new Set,h=(y)=>{if(p!=="*"&&y.origin!==p)return;let E=y.data;if(!n(E)||!(fr in E)||E[fr]!==m)return;let A="payload"in E?E.payload:void 0;for(let T of g)T(A)};return d.addEventListener("message",h),{dispose(){g.clear(),d.removeEventListener("message",h)},onMessage(y){return g.add(y),()=>g.delete(y)},post(y){l.postMessage({[fr]:m,payload:y},f)}}}function pr(o){return o.ownerDocument.defaultView?.getComputedStyle(o).display==="contents"}function Pe(o){let l=o.getBoundingClientRect();if(l.width>0||l.height>0||!o.hasChildNodes()||!pr(o))return l;let d=null;for(let f of o.childNodes){let p=null;if(f instanceof Element)p=Pe(f);else if(f.nodeType===Node.TEXT_NODE){let m=o.ownerDocument.createRange();m.selectNodeContents(f),p=m.getBoundingClientRect()}if(!p||p.width===0&&p.height===0)continue;d=d?{bottom:Math.max(d.bottom,p.bottom),left:Math.min(d.left,p.left),right:Math.max(d.right,p.right),top:Math.min(d.top,p.top)}:{bottom:p.bottom,left:p.left,right:p.right,top:p.top}}return d?new DOMRect(d.left,d.top,d.right-d.left,d.bottom-d.top):l}function oi(o){return o.getBoundingClientRect()}function ii(o,l,d=document){return d.elementFromPoint(o,l)}function mr(o){let l=Object.create(null);for(let d of o.split(","))l[d]=1;return(d)=>(d in l)}var hn=Object.assign;var ac=Object.prototype.hasOwnProperty,gn=(o,l)=>ac.call(o,l),dt=Array.isArray,kt=(o)=>ai(o)==="[object Map]";var si=(o)=>typeof o==="function",lc=(o)=>typeof o==="string",ft=(o)=>typeof o==="symbol",pt=(o)=>o!==null&&typeof o==="object";var cc=Object.prototype.toString,ai=(o)=>cc.call(o),li=(o)=>ai(o).slice(8,-1);var xn=(o)=>lc(o)&&o!=="NaN"&&o[0]!=="-"&&""+parseInt(o,10)===o;var yn=(o)=>{let l=Object.create(null);return(d)=>l[d]||(l[d]=o(d))},uc=/-\w/g,Cp=yn((o)=>o.replace(uc,(l)=>l.slice(1).toUpperCase())),dc=/\B([A-Z])/g,Pp=yn((o)=>o.replace(dc,"-$1").toLowerCase()),ci=yn((o)=>o.charAt(0).toUpperCase()+o.slice(1)),Np=yn((o)=>o?`on${ci(o)}`:""),je=(o,l)=>!Object.is(o,l);var fc="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly";var Rp=mr(fc+",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");var Se;class pi{constructor(o=!1){if(this.detached=o,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!o&&Se)if(Se.active)this.parent=Se,this.index=(Se.scopes||(Se.scopes=[])).push(this)-1;else this._active=!1,this._warnOnRun=!1}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let o,l;if(this.scopes){let d=this.scopes.slice();for(o=0,l=d.length;o<l;o++)d[o].pause()}for(o=0,l=this.effects.length;o<l;o++)this.effects[o].pause()}}resume(){if(this._active){if(this._isPaused){this._isPaused=!1;let o,l;if(this.scopes){let f=this.scopes.slice();for(o=0,l=f.length;o<l;o++)f[o].resume()}let d=this.effects.slice();for(o=0,l=d.length;o<l;o++)d[o].resume()}}}run(o){if(this._active){let l=Se;try{return Se=this,o()}finally{Se=l}}}on(){if(++this._on===1)this.prevScope=Se,Se=this}off(){if(this._on>0&&--this._on===0){if(Se===this)Se=this.prevScope;else{let o=Se;while(o){if(o.prevScope===this){o.prevScope=this.prevScope;break}o=o.prevScope}}this.prevScope=void 0}}stop(o){if(this._active){this._active=!1;let l,d;for(l=0,d=this.effects.length;l<d;l++)this.effects[l].stop();this.effects.length=0;for(l=0,d=this.cleanups.length;l<d;l++)this.cleanups[l]();if(this.cleanups.length=0,this.scopes){let f=this.scopes.slice();for(l=0,d=f.length;l<d;l++)f[l].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!o){let f=this.parent.scopes.pop();if(f&&f!==this)this.parent.scopes[this.index]=f,f.index=this.index}this.parent=void 0}}}function rt(o){return new pi(o)}function jt(o,l=!1){if(Se)Se.cleanups.push(o)}var ue;var hr=new WeakSet;class vn{constructor(o){if(this.fn=o,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Se)if(Se.active)Se.effects.push(this);else this.flags&=-2}pause(){this.flags|=64}resume(){if(this.flags&64){if(this.flags&=-65,hr.has(this))hr.delete(this),this.trigger()}}notify(){if(this.flags&2&&!(this.flags&32))return;if(!(this.flags&8))hi(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,ui(this),gi(this);let o=ue,l=Oe;ue=this,Oe=!0;try{return this.fn()}finally{xi(this),ue=o,Oe=l,this.flags&=-3}}stop(){if(this.flags&1){for(let o=this.deps;o;o=o.nextDep)Ar(o);this.deps=this.depsTail=void 0,ui(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){if(this.flags&64)hr.add(this);else if(this.scheduler)this.scheduler();else this.runIfDirty()}runIfDirty(){if(yr(this))this.run()}get dirty(){return yr(this)}}var mi=0,_t,Dt;function hi(o,l=!1){if(o.flags|=8,l){o.next=Dt,Dt=o;return}o.next=_t,_t=o}function wr(){mi++}function Tr(){if(--mi>0)return;if(Dt){let l=Dt;Dt=void 0;while(l){let d=l.next;l.next=void 0,l.flags&=-9,l=d}}let o;while(_t){let l=_t;_t=void 0;while(l){let d=l.next;if(l.next=void 0,l.flags&=-9,l.flags&1)try{l.trigger()}catch(f){if(!o)o=f}l=d}}if(o)throw o}function gi(o){for(let l=o.deps;l;l=l.nextDep)l.version=-1,l.prevActiveLink=l.dep.activeLink,l.dep.activeLink=l}function xi(o){let l,d=o.depsTail,f=d;while(f){let p=f.prevDep;if(f.version===-1){if(f===d)d=p;Ar(f),pc(f)}else l=f;f.dep.activeLink=f.prevActiveLink,f.prevActiveLink=void 0,f=p}o.deps=l,o.depsTail=d}function yr(o){for(let l=o.deps;l;l=l.nextDep)if(l.dep.version!==l.version||l.dep.computed&&(yi(l.dep.computed)||l.dep.version!==l.version))return!0;if(o._dirty)return!0;return!1}function yi(o){if(o.flags&4&&!(o.flags&16))return;if(o.flags&=-17,o.globalVersion===Lt)return;if(o.globalVersion=Lt,!o.isSSR&&o.flags&128&&(!o.deps&&!o._dirty||!yr(o)))return;o.flags|=2;let l=o.dep,d=ue,f=Oe;ue=o,Oe=!0;try{gi(o);let p=o.fn(o._value);if(l.version===0||je(p,o._value))o.flags|=128,o._value=p,l.version++}catch(p){throw l.version++,p}finally{ue=d,Oe=f,xi(o),o.flags&=-3}}function Ar(o,l=!1){let{dep:d,prevSub:f,nextSub:p}=o;if(f)f.nextSub=p,o.prevSub=void 0;if(p)p.prevSub=f,o.nextSub=void 0;if(d.subs===o){if(d.subs=f,!f&&d.computed){d.computed.flags&=-5;for(let m=d.computed.deps;m;m=m.nextDep)Ar(m,!0)}}if(!l&&!--d.sc&&d.map)d.map.delete(d.key)}function pc(o){let{prevDep:l,nextDep:d}=o;if(l)l.nextDep=d,o.prevDep=void 0;if(d)d.prevDep=l,o.nextDep=void 0}function we(o,l){if(o.effect instanceof vn)o=o.effect.fn;let d=new vn(o);if(l)hn(d,l);try{d.run()}catch(p){throw d.stop(),p}let f=d.run.bind(d);return f.effect=d,f}var Oe=!0,bi=[];function ht(){bi.push(Oe),Oe=!1}function gt(){let o=bi.pop();Oe=o===void 0?!0:o}function En(o,l=!1){if(ue instanceof vn)ue.cleanup=o}function ui(o){let{cleanup:l}=o;if(o.cleanup=void 0,l){let d=ue;ue=void 0;try{l()}finally{ue=d}}}var Lt=0;class Si{constructor(o,l){this.sub=o,this.dep=l,this.version=l.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class wn{constructor(o){this.computed=o,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(o){if(!ue||!Oe||ue===this.computed)return;let l=this.activeLink;if(l===void 0||l.sub!==ue){if(l=this.activeLink=new Si(ue,this),!ue.deps)ue.deps=ue.depsTail=l;else l.prevDep=ue.depsTail,ue.depsTail.nextDep=l,ue.depsTail=l;vi(l)}else if(l.version===-1){if(l.version=this.version,l.nextDep){let d=l.nextDep;if(d.prevDep=l.prevDep,l.prevDep)l.prevDep.nextDep=d;if(l.prevDep=ue.depsTail,l.nextDep=void 0,ue.depsTail.nextDep=l,ue.depsTail=l,ue.deps===l)ue.deps=d}}return l}trigger(o){this.version++,Lt++,this.notify(o)}notify(o){wr();try{for(let l=this.subs;l;l=l.prevSub)if(l.sub.notify())l.sub.dep.notify()}finally{Tr()}}}function vi(o){if(o.dep.sc++,o.sub.flags&4){let l=o.dep.computed;if(l&&!o.dep.subs){l.flags|=20;for(let f=l.deps;f;f=f.nextDep)vi(f)}let d=o.dep.subs;if(d!==o){if(o.prevSub=d,d)d.nextSub=o}o.dep.subs=o}}var br=new WeakMap,tt=Symbol(""),Sr=Symbol(""),It=Symbol("");function Te(o,l,d){if(Oe&&ue){let f=br.get(o);if(!f)br.set(o,f=new Map);let p=f.get(d);if(!p)f.set(d,p=new wn),p.map=f,p.key=d;p.track()}}function Ke(o,l,d,f,p,m){let g=br.get(o);if(!g){Lt++;return}let h=(y)=>{if(y)y.trigger()};if(wr(),l==="clear")g.forEach(h);else{let y=dt(o),E=y&&xn(d);if(y&&d==="length"){let A=Number(f);g.forEach((T,C)=>{if(C==="length"||C===It||!ft(C)&&C>=A)h(T)})}else{if(d!==void 0||g.has(void 0))h(g.get(d));if(E)h(g.get(It));switch(l){case"add":if(!y){if(h(g.get(tt)),kt(o))h(g.get(Sr))}else if(E)h(g.get("length"));break;case"delete":if(!y){if(h(g.get(tt)),kt(o))h(g.get(Sr))}break;case"set":if(kt(o))h(g.get(tt));break}}}Tr()}function mt(o){let l=le(o);if(l===o)return l;if(Te(l,"iterate",It),qe(o))return l;if(!Fe(o))return l.map(De);return Ht(o)?l.map((d)=>nt(De(d))):l.map(nt)}function Cr(o){return Te(o=le(o),"iterate",It),o}function _e(o,l){if(Fe(o))return Ht(o)?nt(De(l)):nt(l);return De(l)}var mc={__proto__:null,[Symbol.iterator](){return gr(this,Symbol.iterator,(o)=>_e(this,o))},concat(...o){return mt(this).concat(...o.map((l)=>dt(l)?mt(l):l))},entries(){return gr(this,"entries",(o)=>(o[1]=_e(this,o[1]),o))},every(o,l){return He(this,"every",o,l,void 0,arguments)},filter(o,l){return He(this,"filter",o,l,(d)=>d.map((f)=>_e(this,f)),arguments)},find(o,l){return He(this,"find",o,l,(d)=>_e(this,d),arguments)},findIndex(o,l){return He(this,"findIndex",o,l,void 0,arguments)},findLast(o,l){return He(this,"findLast",o,l,(d)=>_e(this,d),arguments)},findLastIndex(o,l){return He(this,"findLastIndex",o,l,void 0,arguments)},forEach(o,l){return He(this,"forEach",o,l,void 0,arguments)},includes(...o){return xr(this,"includes",o)},indexOf(...o){return xr(this,"indexOf",o)},join(o){return mt(this).join(o)},lastIndexOf(...o){return xr(this,"lastIndexOf",o)},map(o,l){return He(this,"map",o,l,void 0,arguments)},pop(){return Jt(this,"pop")},push(...o){return Jt(this,"push",o)},reduce(o,...l){return fi(this,"reduce",o,l)},reduceRight(o,...l){return fi(this,"reduceRight",o,l)},shift(){return Jt(this,"shift")},some(o,l){return He(this,"some",o,l,void 0,arguments)},splice(...o){return Jt(this,"splice",o)},toReversed(){return mt(this).toReversed()},toSorted(o){return mt(this).toSorted(o)},toSpliced(...o){return mt(this).toSpliced(...o)},unshift(...o){return Jt(this,"unshift",o)},values(){return gr(this,"values",(o)=>_e(this,o))}};function gr(o,l,d){let f=Cr(o),p=f[l],m=p.call(f);if(f!==o&&!qe(o)){if(m[Symbol.toStringTag]==="Array Iterator"){let g=Object.create(Object.getPrototypeOf(m));if(g.next=()=>di(m.next(),d),p!==Ei[l])Object.defineProperties(g,{return:{get(){let h=m.return;return typeof h==="function"?h.bind(m):h}},throw:{get(){let h=m.throw;return typeof h==="function"?h.bind(m):h}}});return g}m._next=m.next,m.next=()=>di(m._next(),d)}return m}function di(o,l){if(!o.done)o.value=l(o.value);return o}var Ei=Array.prototype;function He(o,l,d,f,p,m){let g=Cr(o),h=g!==o&&!qe(o),y=g[l];if(y!==Ei[l]){let T=y.apply(o,m);return h?De(T):T}let E=d;if(g!==o){if(h)E=function(T,C){return d.call(this,_e(o,T),C,o)};else if(d.length>2)E=function(T,C){return d.call(this,T,C,o)}}let A=y.call(g,E,f);return h&&p?p(A):A}function fi(o,l,d,f){let p=Cr(o),m=p!==o&&!qe(o),g=d,h=!1;if(p!==o){if(m)h=f.length===0,g=function(E,A,T){if(h)h=!1,E=_e(o,E);return d.call(this,E,_e(o,A),T,o)};else if(d.length>3)g=function(E,A,T){return d.call(this,E,A,T,o)}}let y=p[l](g,...f);return h?_e(o,y):y}function xr(o,l,d){let f=le(o);Te(f,"iterate",It);let p=f[l](...d);if((p===-1||p===!1)&&Pc(d[0]))return d[0]=le(d[0]),f[l](...d);return p}function Jt(o,l,d=[]){ht(),wr();let f=le(o)[l].apply(o,d);return Tr(),gt(),f}var hc=mr("__proto__,__v_isRef,__isVue"),wi=new Set(Object.getOwnPropertyNames(Symbol).filter((o)=>o!=="arguments"&&o!=="caller").map((o)=>Symbol[o]).filter(ft));function gc(o){if(!ft(o))o=String(o);let l=le(this);return Te(l,"has",o),l.hasOwnProperty(o)}class Pr{constructor(o=!1,l=!1){this._isReadonly=o,this._isShallow=l}get(o,l,d){if(l==="__v_skip")return o.__v_skip;let f=this._isReadonly,p=this._isShallow;if(l==="__v_isReactive")return!f;else if(l==="__v_isReadonly")return f;else if(l==="__v_isShallow")return p;else if(l==="__v_raw"){if(d===(f?p?Ac:Pi:p?Ci:Ai).get(o)||Object.getPrototypeOf(o)===Object.getPrototypeOf(d))return o;return}let m=dt(o);if(!f){let h;if(m&&(h=mc[l]))return h;if(l==="hasOwnProperty")return gc}let g=Reflect.get(o,l,Ue(o)?o:d);if(ft(l)?wi.has(l):hc(l))return g;if(!f)Te(o,"get",l);if(p)return g;if(Ue(g)){let h=m&&xn(l)?g:g.value;return f&&pt(h)?Er(h):h}if(pt(g))return f?Er(g):Tn(g);return g}}class Nr extends Pr{constructor(o=!1){super(!1,o)}set(o,l,d,f){let p=o[l],m=dt(o)&&xn(l);if(!this._isShallow){let y=Fe(p);if(!qe(d)&&!Fe(d))p=le(p),d=le(d);if(!m&&Ue(p)&&!Ue(d))if(y)return!0;else return p.value=d,!0}let g=m?Number(l)<o.length:gn(o,l),h=Reflect.set(o,l,d,Ue(o)?o:f);if(o===le(f)&&h){if(!g)Ke(o,"add",l,d);else if(je(d,p))Ke(o,"set",l,d,p)}return h}deleteProperty(o,l){let d=gn(o,l),f=o[l],p=Reflect.deleteProperty(o,l);if(p&&d)Ke(o,"delete",l,void 0,f);return p}has(o,l){let d=Reflect.has(o,l);if(!ft(l)||!wi.has(l))Te(o,"has",l);return d}ownKeys(o){return Te(o,"iterate",dt(o)?"length":tt),Reflect.ownKeys(o)}}class Ti extends Pr{constructor(o=!1){super(!0,o)}set(o,l){return!0}deleteProperty(o,l){return!0}}var xc=new Nr,yc=new Ti,bc=new Nr(!0);var vr=(o)=>o,bn=(o)=>Reflect.getPrototypeOf(o);function Sc(o,l,d){return function(...f){let p=this.__v_raw,m=le(p),g=kt(m),h=o==="entries"||o===Symbol.iterator&&g,y=o==="keys"&&g,E=p[o](...f),A=d?vr:l?nt:De;return!l&&Te(m,"iterate",y?Sr:tt),hn(Object.create(E),{next(){let{value:T,done:C}=E.next();return C?{value:T,done:C}:{value:h?[A(T[0]),A(T[1])]:A(T),done:C}}})}}function Sn(o){return function(...l){return o==="delete"?!1:o==="clear"?void 0:this}}function vc(o,l){let d={get(p){let m=this.__v_raw,g=le(m),h=le(p);if(!o){if(je(p,h))Te(g,"get",p);Te(g,"get",h)}let{has:y}=bn(g),E=l?vr:o?nt:De;if(y.call(g,p))return E(m.get(p));else if(y.call(g,h))return E(m.get(h));else if(m!==g)m.get(p)},get size(){let p=this.__v_raw;return!o&&Te(le(p),"iterate",tt),p.size},has(p){let m=this.__v_raw,g=le(m),h=le(p);if(!o){if(je(p,h))Te(g,"has",p);Te(g,"has",h)}return p===h?m.has(p):m.has(p)||m.has(h)},forEach(p,m){let g=this,h=g.__v_raw,y=le(h),E=l?vr:o?nt:De;return!o&&Te(y,"iterate",tt),h.forEach((A,T)=>p.call(m,E(A),E(T),g))}};return hn(d,o?{add:Sn("add"),set:Sn("set"),delete:Sn("delete"),clear:Sn("clear")}:{add(p){let m=le(this),g=bn(m),h=le(p),y=!l&&!qe(p)&&!Fe(p)?h:p;if(!(g.has.call(m,y)||je(p,y)&&g.has.call(m,p)||je(h,y)&&g.has.call(m,h)))m.add(y),Ke(m,"add",y,y);return this},set(p,m){if(!l&&!qe(m)&&!Fe(m))m=le(m);let g=le(this),{has:h,get:y}=bn(g),E=h.call(g,p);if(!E)p=le(p),E=h.call(g,p);let A=y.call(g,p);if(g.set(p,m),!E)Ke(g,"add",p,m);else if(je(m,A))Ke(g,"set",p,m,A);return this},delete(p){let m=le(this),{has:g,get:h}=bn(m),y=g.call(m,p);if(!y)p=le(p),y=g.call(m,p);let E=h?h.call(m,p):void 0,A=m.delete(p);if(y)Ke(m,"delete",p,void 0,E);return A},clear(){let p=le(this),m=p.size!==0,g=void 0,h=p.clear();if(m)Ke(p,"clear",void 0,void 0,void 0);return h}}),["keys","values","entries",Symbol.iterator].forEach((p)=>{d[p]=Sc(p,o,l)}),d}function Rr(o,l){let d=vc(o,l);return(f,p,m)=>{if(p==="__v_isReactive")return!o;else if(p==="__v_isReadonly")return o;else if(p==="__v_isShallow")return l;else if(p==="__v_raw")return f;return Reflect.get(gn(d,p)&&p in f?d:f,p,m)}}var Ec={get:Rr(!1,!1)},wc={get:Rr(!1,!0)},Tc={get:Rr(!0,!1)};var Ai=new WeakMap,Ci=new WeakMap,Pi=new WeakMap,Ac=new WeakMap;function Cc(o){switch(o){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Tn(o){if(Fe(o))return o;return $r(o,!1,xc,Ec,Ai)}function Ni(o){return $r(o,!1,bc,wc,Ci)}function Er(o){return $r(o,!0,yc,Tc,Pi)}function $r(o,l,d,f,p){if(!pt(o))return o;if(o.__v_raw&&!(l&&o.__v_isReactive))return o;if(o.__v_skip||!Object.isExtensible(o))return o;let m=p.get(o);if(m)return m;let g=Cc(li(o));if(g===0)return o;let h=new Proxy(o,g===2?f:d);return p.set(o,h),h}function Ht(o){if(Fe(o))return Ht(o.__v_raw);return!!(o&&o.__v_isReactive)}function Fe(o){return!!(o&&o.__v_isReadonly)}function qe(o){return!!(o&&o.__v_isShallow)}function Pc(o){return o?!!o.__v_raw:!1}function le(o){let l=o&&o.__v_raw;return l?le(l):o}var De=(o)=>pt(o)?Tn(o):o,nt=(o)=>pt(o)?Er(o):o;function Ue(o){return o?o.__v_isRef===!0:!1}function ze(o){return Nc(o,!1)}function Nc(o,l){if(Ue(o))return o;return new Ri(o,l)}class Ri{constructor(o,l){this.dep=new wn,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=l?o:le(o),this._value=l?o:De(o),this.__v_isShallow=l}get value(){return this.dep.track(),this._value}set value(o){let l=this._rawValue,d=this.__v_isShallow||qe(o)||Fe(o);if(o=d?o:le(o),je(o,l))this._rawValue=o,this._value=d?o:De(o),this.dep.trigger()}}class $i{constructor(o,l,d){this.fn=o,this.setter=l,this._value=void 0,this.dep=new wn(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Lt-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!l,this.isSSR=d}notify(){if(this.flags|=16,!(this.flags&8)&&ue!==this)return hi(this,!0),!0}get value(){let o=this.dep.track();if(yi(this),o)o.version=this.dep.version;return this._value}set value(o){if(this.setter)this.setter(o)}}function Ft(o,l,d=!1){let f,p;if(si(o))f=o;else f=o.get,p=o.set;return new $i(f,p,d)}function An(o){return o.replaceAll(/[A-Z]/g,(l)=>`-${l.toLowerCase()}`)}var Rc=new Set(["all","print","screen","speech"]);function Oi(o,l){if(o.startsWith("@--"))return l[o.slice(1)]??o.slice(1);if(o.startsWith("@(")){let d=o.slice(2,-1).trim();return Rc.has(d.toLowerCase())?d:o.slice(1)}return null}function Vt(o){return o.startsWith("@position-try")||o.startsWith("@property")||o.startsWith("@font-face")||o.startsWith("@counter-style")}function Bt(o){return o.startsWith("@keyframes")}function Mi(o,l){let d=[];for(let f of Or(o))for(let p of Or(l))d.push($c(f,p));return d.join(", ")}function $c(o,l){let d=ki(l,o);if(d!==null)return d;if(l.startsWith("[")||l.startsWith(":")||l.startsWith("."))return`${o}${l}`;return`${o} ${l}`}function Mr(o){let l=[],d=null,f=0;for(let p=0;p<o.length;p+=1){let m=o[p];if(d){if(m==="\\")p+=1;else if(m===d)d=null;continue}if(m==="\\")p+=1;else if(m==='"'||m==="'")d=m;else if(m==="[")f+=1;else if(m==="]")f=Math.max(0,f-1);else if(m==="&"&&f===0)l.push(p)}return l}function ki(o,l){return Mr(o).length>0?Oc(o,l):null}function Oc(o,l){let d="",f=0;for(let p of Mr(o))d+=o.slice(f,p)+l,f=p+1;return d+o.slice(f)}function Or(o){let l=[],d=0,f=null,p=0;for(let g=0;g<o.length;g+=1){let h=o[g];if(f){if(h==="\\")g+=1;else if(h===f)f=null;continue}if(h==='"'||h==="'")f=h;else if(h==="("||h==="[")d+=1;else if(h===")"||h==="]")d=Math.max(0,d-1);else if(h===","&&d===0)l.push(o.slice(p,g)),p=g+1}l.push(o.slice(p));let m=l.flatMap((g)=>{let h=g.trim();return h===""?[]:[h]});return m.length>0?m:[o]}var Mc=/[\s>+~,()]/,kc=/^[A-Za-z_\u{00A0}-\u{FFFF}][\w\u{00A0}-\u{FFFF}-]*/u;function Jc(o,l){let d="",f=0;for(;;){let p=o.indexOf("[open]",f);if(p===-1)return d+o.slice(f);let m=p;while(m>0&&!Mc.test(o.charAt(m-1)))m-=1;let g=kc.exec(o.slice(m,p))?.[0]?.toLowerCase(),h=g===void 0?l.dialog===!0:g==="dialog";d+=o.slice(f,p)+(h?"[data-jx-dialog-open]":"[open]"),f=p+6}}function kr(o,l={}){if(o.includes("::backdrop"))return null;let d=o.replaceAll(":popover-open","[data-jx-popover-open]").replaceAll(":modal","[data-jx-dialog-open]").replaceAll("[inert]","[data-jx-inert]");return Jc(d,l)}var Ge="data-color-scheme";function Cn(o){let l=/^\(\s*prefers-color-scheme\s*:\s*(light|dark)\s*\)$/.exec(o.trim())?.[1];return l==="light"||l==="dark"?l:null}function Ji(o,l){if(o===":root"||o==="html")return{auto:`${o}:where(:not([${Ge}]))`,forced:`${o}:where([${Ge}="${l}"])`};return{auto:`:where(:root:not([${Ge}])) ${o}`,forced:`:where(:root[${Ge}="${l}"]) ${o}`}}function Kt(o){return o.startsWith(":")||o.startsWith(".")||o.startsWith("&")||o.startsWith("[")}function Jr(o){return o.startsWith("--")?o:An(o)}function Wt(o){let l=2166136261;for(let d=0;d<o.length;d+=1)l^=o.charCodeAt(d),l=Math.imul(l,16777619);return(l>>>0).toString(36)}function _i(o,l,d){let f=d.map(([m,g])=>`${m}: ${g}`).join("; "),p=l===null?f:`${l} { ${f} }`;for(let m=o.length-1;m>=0;m-=1)p=`${o[m]} { ${p} }`;return p}function _c(o,l,d){let f=d.map(({selector:m,declarations:g})=>`${m} { ${g.map(([h,y])=>`${h}: ${y}`).join("; ")} }`).join(" "),p=`@keyframes ${l} { ${f} }`;for(let m=o.length-1;m>=0;m-=1)p=`${o[m]} { ${p} }`;return p}function Dc(o){let l=Object.keys(o).filter((f)=>Bt(f));if(l.length===0)return o;let d={...o};for(let f of l)delete d[f];return d}function Lc(o){let d=Mr(o).at(-1),f=d===void 0?o:o.slice(d+1);return f===""||f.startsWith(":")||f.startsWith(".")||f.startsWith("[")}function Ut(o,l={}){let{scope:d=null,mediaQueries:f={},transposeValue:p=(L)=>L,transposeSelector:m=(L)=>L,resolveValue:g}=l,h=[],y=(L)=>L!==null&&typeof L==="object"&&!Array.isArray(L)&&!r(L),E=(L,_)=>{if(y(_))return[_];if(!Vt(L)||!Array.isArray(_)||_.length===0)return[];return _.every((Y)=>y(Y))?_:[]},A=(L,_,Y,U)=>{if(_===void 0||_===null)return null;if(r(_))return Y?g?.(L,_,U)??null:null;if(n(_))return null;let G=String(_);if(a(G))return Y?g?.(L,G,U)??null:null;return p(G)},T=(L,_,Y=!0,U="self")=>{let G=[];for(let[ne,k]of Object.entries(L)){if(E(ne,k).length>0)continue;if(_&&(ne.startsWith("@")||Kt(ne)))continue;if(ne.startsWith("$"))continue;let B=A(ne,k,Y,U);if(B!==null)G.push([Jr(ne),B])}return G},C=(L,_,Y,U,G)=>{if(Y.length===0)return;let ne=_;if(ne!==null){let q=m(ne);if(q===null)return;ne=q}let k=_i(L,ne,Y),B={text:k,conditions:[...L],selector:ne,declarations:Y,target:U,key:Wt(k)};if(e(G)&&G!=="")B.description=G;h.push(B)},H=(L,_,Y)=>{let U=L.slice(10).trim();if(U==="")return;let G=[];for(let[k,B]of Object.entries(_)){if(!y(B))continue;let q=T(B,!0,!1,"unscoped");if(q.length>0)G.push({declarations:q,selector:k.trim()})}if(G.length===0)return;let ne=_c(Y,U,G);h.push({blocks:G,conditions:[...Y],declarations:[],key:Wt(ne),selector:null,target:"unscoped",text:ne})},M=(L,_,Y,U,G)=>{if(L==="@--")return;if(Vt(L)){C([...U,L],null,T(_,!1,!0,"unscoped"),"unscoped",_.$description);return}if(Bt(L)){H(L,_,U);return}let ne=Oi(L,f),k=ne===null?L:`@media ${ne}`,B=ne===null?null:Cn(ne);if(B!==null&&Y!==null){let{auto:q,forced:X}=Ji(Y,B);K(_,q,[...U,k],G),K(Dc(_),X,U,G);return}K(_,Y,[...U,k],G)};function K(L,_,Y,U){C(Y,_,T(L,!0,!0,U),U,L.$description);for(let[G,ne]of Object.entries(L))for(let k of E(G,ne))if(G.startsWith("@"))M(G,k,_,Y,U);else if(_!==null)K(k,Mi(_,G),Y,Lc(G)?U:"descendant")}return K(o,d,[],"self"),h}var Ve="en-US",Di="UTC",Li=[{api:"Intl.NumberFormat",params:["value","locale","options"],path:"Intl/formatNumber",summary:"Format a number for a locale — grouping, decimals, currency, percent, units."},{api:"Intl.DateTimeFormat",params:["value","locale","options"],path:"Intl/formatDate",summary:"Format a date or timestamp for a locale. Pass `timeZone` in options."},{api:"Intl.RelativeTimeFormat",params:["value","unit","locale","options"],path:"Intl/formatRelativeTime",summary:'Format a relative time — `-3, "day"` becomes "3 days ago".'},{api:"Intl.ListFormat",params:["values","locale","options"],path:"Intl/formatList",summary:'Join a list the way a locale does — "a, b, and c", not a hand-written comma join.'},{api:"Intl.PluralRules",params:["value","locale","options"],path:"Intl/plural",summary:'Which plural category a number falls in ("one", "few", "other") — many languages have '+"more than two, so a ternary on `n === 1` is wrong outside English."},{api:"Intl.Collator",params:["a","b","locale","options"],path:"Intl/compare",summary:'Compare two strings for sorting. `<` and `sort()` order by UTF-16 code unit, which puts "Zebra" before "apple" and sorts every accented word into the wrong place.'},{api:"Intl.DisplayNames",params:["code","type","locale","options"],path:"Intl/displayName",summary:'The name of a language, region, script or currency in a locale — "de" as "German" or '+'"Deutsch", from CLDR rather than a hand-kept table.'},{api:"Intl.Segmenter",params:["value","granularity","locale"],path:"Intl/segment",summary:"Split text into graphemes, words or sentences (UAX #29). `[...str]` splits code points, so it cuts an emoji with a skin-tone modifier in half."}],Ii=Li.map((o)=>o.path),ji=Object.fromEntries(Li.map((o)=>[o.path,o.params.indexOf("locale")]));function Ic(o){return o.replaceAll("~1","/").replaceAll("~0","~")}function _r(o){if(o==="")return[];return o.split("/").map((l)=>Ic(l))}function he(o,l){let d=o;for(let f of _r(l))d=d?.[f];return d}function Dr(o){let l=o.$map;return n(l)?l:void 0}function jc(o){return n(o)&&!Array.isArray(o)&&"operator"in o}function Vi(o){return n(o)&&!Array.isArray(o)&&"$ref"in o}var Wi=new Set(["=","+=","-=","*=","/=","push","pop","shift","unshift","splice"]),Bi=new Set(["!","-"]),Ki=new Set(["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||","??"]),Hc=new Set(["=","+=","-=","*=","/="]),Fc=new Set(["push","pop","shift","unshift","splice"]),Ui=new Set(["reduce","map","filter"]),qi=new Set(["?:","switch"]),zi=new Set(["includes","indexOf","lastIndexOf","join","slice","concat","at","flat","toSorted","toReversed","toSpliced","with","toUpperCase","toLowerCase","trim","trimStart","trimEnd","split","startsWith","endsWith","padStart","padEnd","replaceAll","repeat","charAt","normalize","toLocaleUpperCase","toLocaleLowerCase","toFixed","toPrecision","toLocaleString"]),Vc=new Set([...Wi,...Bi,...Ki,...Ui,...qi,...zi,"call"]),Wc=new Set(["isNaN","isFinite","parseFloat","parseInt","encodeURIComponent","decodeURIComponent","structuredClone","Math/abs","Math/ceil","Math/floor","Math/round","Math/trunc","Math/sign","Math/sqrt","Math/cbrt","Math/pow","Math/exp","Math/log","Math/log2","Math/log10","Math/min","Math/max","Math/hypot","Number/isInteger","Number/isFinite","Number/isNaN","Number/parseFloat","Number/parseInt","JSON/parse","JSON/stringify","Object/keys","Object/values","Object/entries","Object/fromEntries","Array/from","Array/isArray","Array/of","String/fromCharCode","String/fromCodePoint",...Ii]),Bc=new Map([["Intl/compare",(o,l,d,f)=>new Intl.Collator(d??Ve,f).compare(o,l)],["Intl/displayName",(o,l,d,f)=>new Intl.DisplayNames(d??Ve,{...f,type:l??"language"}).of(o)],["Intl/formatDate",(o,l,d)=>new Intl.DateTimeFormat(l??Ve,{timeZone:Di,...d}).format(new Date(o))],["Intl/formatList",(o,l,d)=>new Intl.ListFormat(l??Ve,d).format(o)],["Intl/formatNumber",(o,l,d)=>new Intl.NumberFormat(l??Ve,d).format(o)],["Intl/formatRelativeTime",(o,l,d,f)=>new Intl.RelativeTimeFormat(d??Ve,f).format(o,l)],["Intl/plural",(o,l,d)=>new Intl.PluralRules(l??Ve,d).select(o)],["Intl/segment",(o,l,d)=>[...new Intl.Segmenter(d??Ve,{granularity:l??"grapheme"}).segment(o)].map((f)=>f.segment)]]);function Kc(o,l,d){let f=ji[o];if(f===void 0||f<0||l[f]!=null)return l;let p=he(d.$page,"locale");if(!e(p)||p==="")return l;let m=[...l];return m[f]=p,m}function Uc(o){return o.startsWith("window#/")&&Wc.has(o.slice(8))}function Gi(o){return Wi.has(o)}var Hi=64,qc=64;function pe(o,l){if(!o)return;let d=(o.depth??0)+1;if(d>qc)return;return{depth:d,path:[...o.path??[],...Array.isArray(l)?l:[l]],report:o.report}}function fe(o,l,d,f,p){if(o===null||o===void 0)return o;if(jc(o))return Ae(o,l,d,f,p);if(Vi(o)){let m=Pn(o.$ref,l,d,f);return p?.report(p.path??[],m),m}if(Array.isArray(o))return Yi(o,l,d,f,p);return p?.report(p.path??[],o),o}function Yi(o,l,d,f,p){return o.map((m,g)=>fe(m,l,d,f,pe(p,g)))}function zc(o,l,d,f){let p=(m)=>{if(!o.slice(m.length).includes("/"))return l;return Pn(o.slice(0,o.lastIndexOf("/")),l,d,f)};if(o.startsWith("#/state/"))return p("#/state/");if(o.startsWith("parent#/"))return p("parent#/");if(o.startsWith("$map/")||o.startsWith("$args/"))return o.split("/").length>2?Pn(o.slice(0,o.lastIndexOf("/")),l,d,f):void 0;return}function Pn(o,l,d,f){if(o==="$reduce/acc")return f?.acc;if(o.startsWith("$reduce/"))return f?.acc;if(o.startsWith("$args/")){let p=o.slice(6).split("/"),m=f?.args?.[p[0]];return p.length>1?he(m,p.slice(1).join("/")):m}if(o.startsWith("event#/")){let p=o.slice(7);return he(d,p)}if(o.startsWith("$map/")){let p=o.split("/"),[,m]=p,g,h=Dr(l);if(m==="item")g=f?.item??h?.item??l["$map/item"];else if(m==="index")g=f?.index??h?.index??l["$map/index"];else g=h?.[m]??l[`$map/${m}`];return p.length>2?he(g,p.slice(2).join("/")):g}if(o.startsWith("#/state/"))return he(l,o.slice(8));if(o.startsWith("parent#/"))return he(l,o.slice(8));if(o.startsWith("window#/"))return he(globalThis.window,o.slice(8));if(o.startsWith("document#/"))return he(globalThis.document,o.slice(10));return he(l,o)??null}function Gc(o,l,d,f){if(o.startsWith("$map/")){let p=o.split("/"),[,m]=p,g,h=Dr(l);if(m==="item")g=f?.item??h?.item??l["$map/item"];else if(m==="index")g=f?.index??h?.index??l["$map/index"];else g=h?.[m]??l[`$map/${m}`];if(p.length>2){let y=p.slice(2),E=y.pop(),A=y.length>0?he(g,y.join("/")):g;return{key:E,obj:A}}return{key:m==="item"?"$map/item":"$map/index",obj:Dr(l)??l}}if(o.startsWith("#/state/")){let p=o.slice(8);if(p.indexOf("/")===-1)return{key:p,obj:l};let g=_r(p),h=g.pop(),y=l;for(let E of g)y=y[E];return{key:h,obj:y}}return{key:o,obj:l}}function Ae(o,l,d,f,p){let m=Yc(o,l,d,f,p);return p?.report(p.path??[],m),m}function Fi(o,l,d){switch(o){case"+":return l+d;case"-":return l-d;case"*":return l*d;case"/":return l/d;case"%":return l%d;case"<":return l<d;case"<=":return l<=d;case">":return l>d;default:return l>=d}}function Yc(o,l,d,f,p){let{operator:m,target:g,value:h,initial:y}=o;if(!Vc.has(m))throw Error(`$expression: unknown operator "${m}"`);if(Bi.has(m)&&!("value"in o)){let E=fe(g,l,d,f,pe(p,"target"));if(m==="!")return!E;if(m==="-")return-E}if(m==="call"){let E=Vi(g)?g.$ref:void 0;if(!e(E))throw TypeError("$expression: call target must be a $ref pointer");let A=(f?.callDepth??0)+1;if(A>Hi)throw Error(`$expression: call depth exceeded (${Hi})`);let T=Array.isArray(h)?h.map((H,M)=>fe(H,l,d,f,pe(p,["value",M]))):[];if(E.startsWith("window#/")){if(!Uc(E))throw Error(`$expression: "${E}" is not a blessed pure global`);let H=E.slice(8),M=Bc.get(H);if(M)return M(...Kc(H,T,l));let K=he(globalThis.window,H),L=H.lastIndexOf("/"),_=L===-1?globalThis.window:he(globalThis.window,H.slice(0,L));return K.apply(_,T)}let C=Pn(E,l,d,f);if(t(C))return C.apply(zc(E,l,d,f),T);if(n(C)&&"$expression"in C){let H=C,M={};for(let[K,L]of(H.parameters??[]).entries()){let _=e(L)?L:L?.name??"";if(!_)continue;M[_]=T[K]===void 0&&n(L)&&"default"in L?L.default:T[K]}return Ae(H.$expression,l,d,{args:M,callDepth:A})}throw TypeError(`$expression: call target "${E}" is not callable`)}if(qi.has(m)){if(m==="?:"){let H=fe(g,l,d,f,pe(p,"target"));if(p){let M=fe(h,l,d,f,pe(p,"value")),K=fe(y,l,d,f,pe(p,"initial"));return H?M:K}return H?fe(h,l,d,f):fe(y,l,d,f)}let E=fe(g,l,d,f,pe(p,"target")),A=String(E),T=o.cases??{},C=Object.hasOwn(T,A);if(p){let H;for(let[K,L]of Object.entries(T)){let _=fe(L,l,d,f,pe(p,["cases",K]));if(K===A)H=_}let M=fe(o.default,l,d,f,pe(p,"default"));return C?H:M}return C?fe(T[A],l,d,f):fe(o.default,l,d,f)}if(Ki.has(m)){let E=fe(g,l,d,f,pe(p,"target")),A=fe(h,l,d,f,pe(p,"value"));switch(m){case"===":return E===A;case"!==":return E!==A;case"&&":return E&&A;case"||":return E||A;case"??":return E??A;default:return Fi(m,E,A)}}if(Hc.has(m)){let E=fe(h,l,d,f,pe(p,"value")),{obj:A,key:T}=Gc(g.$ref,l,d,f);A[T]=m==="="?E:Fi(m.slice(0,-1),A[T],E);return}if(Fc.has(m)){let E=fe(g,l,d,f,pe(p,"target"));switch(m){case"push":return E.push(fe(h,l,d,f,pe(p,"value")));case"unshift":return E.unshift(fe(h,l,d,f,pe(p,"value")));case"pop":return E.pop();case"shift":return E.shift();case"splice":{let A=fe(h,l,d,f,pe(p,"value"));return E.splice(...A)}default:break}}if(zi.has(m)){let E=fe(g,l,d,f,pe(p,"target")),A=h===void 0?[]:Array.isArray(h)?Yi(h,l,d,f,pe(p,"value")):[fe(h,l,d,f,pe(p,"value"))],T=he(E,m);if(!t(T))return;return T.apply(E,A)}if(Ui.has(m)){let E=fe(g,l,d,f,pe(p,"target")),A=h;if(m==="reduce"){let T=fe(y,l,d,f,pe(p,"initial"));for(let[C,H]of E.entries())T=Ae(A,l,d,{acc:T,index:C,item:H},C===0?pe(p,"value"):void 0);return T}if(m==="map")return E.map((T,C)=>Ae(A,l,d,{...f,index:C,item:T},C===0?pe(p,"value"):void 0));if(m==="filter")return E.filter((T,C)=>Ae(A,l,d,{...f,index:C,item:T},C===0?pe(p,"value"):void 0))}return}function ot(o,l,d,f){return fe(o,l,d,f)}function Nn(o){let l=o.replaceAll("\\","/");return l.length>1&&l.endsWith("/")?l.slice(0,-1):l}function Xi(o){let l=Nn(o);return l.startsWith("/")?l:`/${l}`}function Zi(o,l){return[...o].toSorted((d,f)=>f[l].length-d[l].length)}function Xc(o,l){return o===l||o.startsWith(`${l}/`)}function Qi(o,l){let d=Nn(l);for(let f of Zi(o,"dir")){let p=Nn(f.dir);if(!Xc(d,p)||d===p)continue;let m=d.slice(p.length+1),{filter:g}=f;if(g&&!g(m))return null;let h=m.split("/").map((y)=>encodeURIComponent(y)).join("/");return`${Xi(f.urlPrefix)}/${h}`}return null}function Zc(o,l){let d=l.split("#")[0].split("?")[0];if(!d.startsWith("/"))return null;let f;try{f=decodeURIComponent(d)}catch{return null}if(/%2e|%2f/i.test(f))return null;for(let p of Zi(o,"urlPrefix")){let m=Xi(p.urlPrefix);if(!f.startsWith(`${m}/`))continue;let h=f.slice(m.length+1).split("/");if(h.some((E)=>E===""||E==="."||E===".."))return null;let{filter:y}=p;if(y&&!y(h.join("/")))return null;return`${Nn(p.dir)}/${h.join("/")}`}return null}var Gp=String.raw`"'\s<>()\\`;var Qc="public";function qt(o){let l=o.search(/[#?]/);return l===-1?{path:o,suffix:""}:{path:o.slice(0,l),suffix:o.slice(l)}}function Lr(o){return o===""||o.startsWith("/")||o.startsWith("#")||o.includes("${")||/^[a-z][\w+.-]*:/i.test(o)}function Ir(o){return o.replaceAll("\\","/").replace(/^\.\//,"").replace(/^\/+/,"").replace(/\/+$/,"")}function jr(o,l){let f=(o===""||o==="."?[]:Ir(o).split("/")).filter((p)=>p!==""&&p!==".");for(let p of l.replaceAll("\\","/").split("/")){if(p===""||p===".")continue;if(p===".."){if(f.length===0)return null;f.pop();continue}f.push(p)}return f.join("/")}function eu(o,l,d){let{path:f}=qt(o);if(!f.startsWith("/"))return[];let p;try{p=decodeURIComponent(f)}catch{return[]}if(/%2e|%2f/i.test(p))return[];let m=p.replace(/^\/+/,"");if(m===""||m.split("/").some((h)=>h==="."||h===".."))return[];let g=[];for(let h of d){if(h==="mounts"){let y=Zc(l,f);if(y!==null&&!y.startsWith("/")&&!/^[A-Za-z]:/.test(y))g.push(Ir(y));continue}g.push(h==="root"?m:`${Qc}/${m}`)}return[...new Set(g)]}function Hr(o,l,d,f){let{path:p}=qt(o);if(p==="")return null;if(Lr(o))return p.startsWith("/")?eu(p,d,f)[0]??null:null;if(p.endsWith("/"))return null;let m;try{m=decodeURIComponent(p)}catch{return null}let g=jr(l,m);if(g===null||g===""||g===Ir(l))return null;return g}function es(o){return o.split("/").map((l)=>encodeURIComponent(l)).join("/")}function ts(o){let l=[],d=0;while(d<o.length){while(d<o.length&&(/\s/.test(o[d])||o[d]===","))d+=1;if(d>=o.length)break;let f=d;while(d<o.length&&!/\s/.test(o[d]))d+=1;let p=o.slice(f,d);if(p.endsWith(",")){l.push({descriptor:"",url:p.replace(/,+$/,"")});continue}while(d<o.length&&/\s/.test(o[d]))d+=1;let m=d;while(d<o.length&&o[d]!==",")d+=1;let g=o.slice(m,d).trim();if(d+=1,p=p.replace(/,+$/,""),p!=="")l.push({descriptor:g,url:p})}return l}function ns(o){return o.map(({url:l,descriptor:d})=>d?`${l} ${d}`:l).join(", ")}function tu(o){if("operator"in o)return{kind:"expression",node:o};if("if"in o)return{kind:"if",node:o};if("$switch"in o)return{kind:"switch",node:o};if("stopPropagation"in o)return{kind:"stopPropagation"};if("preventDefault"in o)return{kind:"preventDefault"};return{kind:"dispatch",node:o}}function nu(o){return(n(o)||t(o))&&"then"in o&&t(o.then)}async function xt(o,l,d,f={}){let p=f.args?{args:f.args}:void 0;for(let m of o){let g=tu(m);switch(g.kind){case"expression":{let h=Ae(g.node,l,d,p);if(nu(h))await h;break}case"if":{let h=g.node,y=ot(h.if,l,d,p)?h.then:h.else;if(Array.isArray(y))await xt(y,l,d,f);break}case"switch":{let h=g.node,y=String(ot(h.$switch,l,d,p)),E=h.cases??{},A=Object.hasOwn(E,y)?E[y]:h.default;if(Array.isArray(A))await xt(A,l,d,f);break}case"dispatch":{let h=g.node,y=t(f.target)?f.target():f.target,E=d?.currentTarget??y;if(!E)break;let A={};if("detail"in h)A.detail=ot(h.detail,l,d,p);if(h.bubbles!==void 0)A.bubbles=h.bubbles;if(h.composed!==void 0)A.composed=h.composed;E.dispatchEvent(new CustomEvent(h.dispatchEvent,A));break}case"stopPropagation":{d?.stopPropagation();break}case"preventDefault":{d?.preventDefault();break}default:break}}}function rs(o,l){for(let d of o.split(";")){let f=d.indexOf("=");if(f===-1)continue;if(d.slice(0,f).trim()===l)return d.slice(f+1)}return null}function os(o,l,d){let f=o.startsWith("__Host-"),p=[`${o}=${encodeURIComponent(JSON.stringify(l))}`];if(d.maxAge!==void 0)p.push(`Max-Age=${d.maxAge}`);let m=f?"/":d.path;if(m)p.push(`Path=${m}`);if(d.domain&&!f)p.push(`Domain=${d.domain}`);let{sameSite:g}=d;if(d.secure===!0||f||o.startsWith("__Secure-")||g?.toLowerCase()==="none")p.push("Secure");if(g)p.push(`SameSite=${g}`);return p.join("; ")}function Fr(o){return t(o)}var Vr=new Map;function ru(o){return o.headers?.get("Content-Type")??""}async function Gr(o,l){if(!e(o))return o;let d=l?.resolver?.(o);if(d)return d;if(Vr.has(o))return Vr.get(o);let f=fetch(o).then(async(p)=>{if(!p.ok)throw Error(`Jx: failed to fetch ${o} (${p.status})`);if(ru(p).includes("text/html"))throw Error(`Jx: ${o} returned HTML, not a document — the host answered a missing file with its `+"app shell (a single-page fallback), so this path is not served.");return await p.json()});return Vr.set(o,f),f}var ou=new Set(["type","properties","items","enum","minimum","maximum","minLength","maxLength","pattern","required","examples"]),Cs={skip:!1};function Ps(o){Cs.skip=o}var Ns={skip:!1};function Rs(o){Ns.skip=o}var Br=null;function $s(o){Br=o||null}function Os(o){return Br?`${o}?token=${encodeURIComponent(Br)}`:o}function Ms(o){let l=rt(!0);return l.run(()=>{we(o)}),()=>l.stop()}function Et(o){let l=rt(!0);try{return{result:l.run(o),stop:()=>l.stop()}}catch(d){throw l.stop(),d}}var ks=!1;function Js(o){ks=o}var iu=/(-?\d*\.?\d+)(?:s|l|d)?v(h|w|min|max|i|b)\b/gi,su=new Map([["b","cqb"],["h","cqh"],["i","cqi"],["max","cqmax"],["min","cqmin"],["w","cqw"]]);function au(o){if(!ks||!o.includes("v"))return o;return o.replaceAll(iu,(l,d,f)=>`${d}${su.get(f.toLowerCase())??`cq${f}`}`)}var _s=!1;function Ds(o){_s=o}var Yr=!1;function Ls(o){Yr=o}var Xr=!1;function Is(o){Xr=o}var $n=!1;function Kr(o){return $n||o.dataset.jxPath!==void 0}function lu(o,l){if(_s&&l==="href"&&(o.tagName==="A"||o.tagName==="AREA"))return"data-jx-href";if(Yr&&l==="popover"&&Kr(o))return"data-jx-popover";if(Xr&&Kr(o)){if(l==="commandfor")return"data-jx-commandfor";if(l==="inert")return"data-jx-inert";if(l==="open"&&o.tagName==="DIALOG")return"data-jx-open"}return l}var St=null;function jn(o){St=o}var cu=new Set(["src","poster","data"]),uu=new Set(["srcset","imagesrcset"]),du=new Set(["LINK"]);function fu(o,l){return cu.has(l)||l==="href"&&du.has(o)}function Zr(o,l,d){if(!St||d==="")return d;let f=l.toLowerCase();if(uu.has(f)){let p=ts(d),m=p.map((h)=>{let y=St?.(h.url,f)??null;if(y===null||y===h.url)return h;return{descriptor:h.descriptor,url:y}});return m.some((h,y)=>h!==p[y])?ns(m):d}if(!fu(o,f))return d;return St(d,f)??d}var pu=/\burl\(\s*(?<q>["']?)(?<u>[^"')]*)\k<q>\s*\)/g;function mu(o){if(!St||!o.includes("url("))return o;return o.replaceAll(pu,(l,d,f)=>{let p=f===""?null:St?.(f,"url()")??null;return p===null?l:`url(${d}${p}${d})`})}function Mn(o){return au(mu(o))}var js=!1;function Hs(o){js=o}var hu=/^\s*\$\{\s*state\.(\w+)\s*\}\s*$/;function gu(o,l,d){if(!js||o!=="textContent")return null;let f=null;if(r(l)){if(!l.$ref.startsWith("#/state/"))return null;let m=l.$ref.slice(8);f=m&&!m.includes("/")?m:null}else if(e(l))f=hu.exec(l)?.[1]??null;if(!f)return null;let p=le(d)[f];if(Ue(p)||t(p))return null;if(n(p))return null;return f}async function Hn(o,l={},d=location.href,f){let p=()=>f?.root??null,m={},g=o.state??{},h=Ht(l);for(let T of Object.keys(l))if(h&&!(T in g))Object.defineProperty(m,T,{configurable:!0,enumerable:!0,get:()=>l[T],set:(C)=>{l[T]=C}});else m[T]=l[T];let y=o.imports??{};for(let[,T]of Object.entries(g))if(R(T)&&!T.$src){let C=y[T.$prototype];if(C){if(!C.endsWith(".class.json")){console.warn(`Jx: import "${T.$prototype}" must map to a .class.json path, got "${C}"`);continue}T.$src=C}}for(let[T,C]of Object.entries(g)){if(e(C)){if(!C.includes("${"))m[T]=C;continue}if(i(C)||x(C)||C===null){m[T]=C;continue}if(Array.isArray(C)){m[T]=C;continue}if(n(C)){if(C.$prototype)continue;if(b(C))continue;if(D(C))continue;if("default"in C){m[T]=C.default;continue}if(xu(C))continue;m[T]=C}}let E=Tn(m);for(let[T,C]of Object.entries(g))if(e(C)&&C.includes("${"))E[T]=Ft(()=>eo(C,E));for(let[T,C]of Object.entries(g))if(b(C)){let H=C.$expression;if(j(C)){let M=C.parameters;E[T]=(...K)=>Ae(H,E,null,{args:is(M,K)})}else if(Gi(H.operator)){let M=(K,L)=>Ae(H,K,L);E[T]=M}else E[T]=Ft(()=>Ae(H,E,null))}for(let[T,C]of Object.entries(g))if(O(C)){let{body:H}=C;if(Array.isArray(C.parameters)&&C.parameters.length>0){let M=C.parameters;E[T]=(...K)=>xt(H,E,null,{args:is(M,K),target:p})}else{let M=(K,L)=>{xt(H,K,L??null,{target:p})};E[T]=M}}else if(v(C))E[T]=await wu(C,E,T,d);for(let[T,C]of Object.entries(g))if(R(C))E[T]=await ju(C,E,T,d,f);if(!(f?.skipServerFunctions??Cs.skip)){for(let[T,C]of Object.entries(g))if(D(C))E[T]=await Uu(C,E,T,d)}let A=f?.media??ra;if(o.$media)E.$media=o.$media;else if(!E.$media&&Object.keys(A).length>0)E.$media=A;return E}function is(o,l){let d={};for(let[f,p]of o.entries()){let m=e(p)?p:p?.name??"";if(!m)continue;d[m]=l[f]===void 0&&p!==null&&!e(p)&&"default"in p?p.default:l[f]}return d}function xu(o){for(let l of Object.keys(o))if(ou.has(l))return!0;return!1}var Fs=["state","$map","item","index","$site","$page"];function Vs(o){let l=Su(o);return[o,l,l?.item,l?.index,o.$site,o.$page]}function Ye(o,l){let d=ss.get(o);if(!d)d=Function(...Fs,`return \`${o}\``),Ws(ss,o,d);return d(...Vs(l))}var ss=new Map,as=new Map,yu=4096;function Ws(o,l,d){if(o.size>=yu)o.clear();o.set(l,d)}var ls=new Set,cs=null;function Bs(o,l){if(!ls.has(o))ls.add(o),console.warn(`jx: template ${JSON.stringify(o)} threw:`,l)}var On=0,kn=new Map,bu=[];function Qr(o){On+=1,o.finally(()=>{if(On-=1,On===0){for(let{error:l,source:d}of kn.values())Bs(d,l);kn.clear();for(let l of bu.splice(0))l()}})}function Xt(o,l,d){we(()=>{try{l(),kn.delete(l)}catch(f){let p=f instanceof Error?f:Error(String(f));if(cs)cs(p,o);else if(On>0)kn.set(l,{error:p,source:o});else Bs(o,p);d?.()}})}function Su(o){return o.$map}function vu(o){if(!o.startsWith("${")||!o.endsWith("}"))return!1;let l=0;for(let d=1;d<o.length;d+=1){let f=o[d];if(f==="{")l+=1;else if(f==="}"){if(l-=1,l===0)return d===o.length-1}}return!1}function eo(o,l){if(!vu(o))return Ye(o,l);let d=as.get(o);if(!d)d=Function(...Fs,`return (${o.slice(2,-1)})`),Ws(as,o,d);return d(...Vs(l))}var Ks=null;function Us(o){Ks=o}var us="npm:";async function Eu(o,l){if(o.startsWith(us)){let d=o.slice(us.length);return yt(Ks?.(d)??d)}if(l)try{return await yt(new URL(o,l).href)}catch{return yt(o)}return yt(o)}function yt(o){return import(o)}var wt=new Map,bt=new Map,qs=new Set;function zs(o,l){if(qs.add(o),t(l)){wt.delete(o),bt.set(o,l);return}bt.delete(o),wt.set(o,l)}function to(o){let l=wt.get(o);if(l)return l;let d=bt.get(o);if(!d)return;if(!t(d))return d;let f=d(),p=(async()=>{try{let m=await f;return wt.set(o,m),bt.delete(o),m}catch(m){throw bt.set(o,d),m}})();return bt.set(o,p),p}async function wu(o,l,d,f){if(o.body&&o.$src)throw Error(`Jx: '${d}' declares both body and $src — these are mutually exclusive`);if(!o.body&&!o.$src){let h=Ur(o),y=Function(...h,"");return Object.defineProperty(y,"name",{configurable:!0,value:o.name??d}),y}let p;if(e(o.body)){let h=Ur(o);p=Function(...h,o.body),Object.defineProperty(p,"name",{configurable:!0,value:o.name??d})}else{let h=o.$src;if(!h)throw Error(`Jx: '${d}' has neither body nor $src`);let y=o.$export??d,E,A=to(h);if(A instanceof Promise)E=await A;else if(A)E=A;else E=await Eu(h,f),wt.set(h,E);let T=E[y]??E.default?.[y];if(!t(T))throw TypeError(`Jx: export "${y}" not found or not a function in "${h}"`);p=T}let m=(o.parameters??o.arguments??[]).length>0,g=!1;if(!m)g=e(o.body)?I(o.body):p.length<=1&&I(p.toString());if(g)return Ft(()=>p(l));return p}function Ur(o){let l=o.parameters?W(o.parameters):o.arguments??[];return l.length>0&&l[0]==="state"?l:["state",...l]}var Zt=new Set(["$schema","$id","$defs","state","$ref","$props","$elements","$title","$description","$switch","$prototype","$src","$export","$media","$map","timing","default","description","body","parameters","arguments","name","tagName","children","style","attributes","items","map","filter","sort","cases","observedAttributes"]);function no(o){return Object.create(o)}function Fn(o){return o.$media??{}}function Vn(o){return o}function Tu(o){let l=Vn(o)._state;return n(l)?l:null}function Au(o){return t(o)}var ds=new Set,Cu="http://www.w3.org/2000/svg",Pu="http://www.w3.org/1998/Math/MathML";function Nu(o,l){if(o==="svg")return Cu;if(o==="math")return Pu;return l??null}function Ne(o,l,d){let f=d?._path??[];if(e(o)||i(o)||x(o)){let T=document.createTextNode(String(o));if(a(o))Xt(o,()=>{T.textContent=Ye(o,l)},()=>{T.textContent=""});return T}let p=l;for(let[T,C]of Object.entries(o))if(T.startsWith("$")&&!Zt.has(T)){if(p===l)p=no(l);p[T]=r(C)?ve(C.$ref,l):C}if("$ref"in o&&!o.tagName){let T=String(o.$ref??"");if(!ds.has(T))ds.add(T),console.warn(`Jx: a $ref child ("${T}") is not a supported component instance; register the `+"component in $elements and use its custom-element tag instead (spec §13).")}let m=io(o.tagName,p),g=m.includes("-")&&customElements.get(m);if(o.$props&&g)return Es(o,p,d,f);if(o.$props){if(m.includes("-"))return Es(o,p,d,f);let{$props:T,...C}=o;return Ne(C,Xu(o,p),d)}if(o.$switch)return Iu(o,p,d);let h=Nu(m,d?._ns),y=m==="foreignObject"?null:h,E=h?document.createElementNS(h,m):document.createElement(m);if(d?.onNodeCreated)d.onNodeCreated(E,f,o,p);if(ro(E,o,p),o.style&&m.includes("-"))oo.set(E,o.style);Wn(E,o.style??{},Fn(p),p),Kn(E,o.attributes??{},p);let A=o.children;if(S(A)){let T=d||y?{...d,_ns:y,_path:[...f,"children"]}:void 0;qr(E,A,p,T)}else if(Array.isArray(A))for(let T=0;T<A.length;T++){let C=A[T],H=d||y?{...d,_ns:y,_path:[...f,"children",T]}:void 0;if(S(C))qr(E,C,p,H);else E.append(Ne(C,p,H))}else if(a(A))Ru(E,A,p,{...d,_ns:y,_path:[...f,"children"]});return E}function Ru(o,l,d,f){let p=f._path??[],m=null,g=()=>{o.replaceChildren(),m?.stop(),m=null};Xt(l,()=>{let h=eo(l,d);if(g(),!Array.isArray(h))return;let y=rt(!0);m=y,ht();try{y.run(()=>{for(let[E,A]of h.entries())o.append(Ne(A,d,{...f,_path:[...p,E]}))})}finally{gt()}},g),jt(()=>m?.stop(),!0)}function ro(o,l,d){for(let[f,p]of Object.entries(l)){if(Zt.has(f))continue;if(f.startsWith("$"))continue;if(f.startsWith("on")&&Gs(o,f,p,d))continue;Ys(o,f,p,d)}}function Gs(o,l,d,f){let p=l.slice(2),m=f;if(r(d)){let g=ve(d.$ref,f);if(Au(g))o.addEventListener(p,(h)=>g(m,h));return!0}if(O(d)){let{body:g}=d;return o.addEventListener(p,(h)=>{xt(g,m,h)}),!0}if(v(d)&&e(d.body)){let g=Ur(d),h=Function(...g,d.body);return o.addEventListener(p,(y)=>h(m,y)),!0}if(b(d)){let g=d.$expression;return o.addEventListener(p,(h)=>Ae(g,m,h)),!0}return!1}function $u(o,l,d){for(let[f,p]of Object.entries(l))if(f.startsWith("on")&&!Zt.has(f))Gs(o,f,p,d)}function Ys(o,l,d,f){let p=Vn(o),m=gu(l,d,f);if(m)o.dataset.jxBoundProp=m;let g=(y)=>e(y)?Zr(o.tagName,l,y):y,h=(y)=>{let E=o;if(l==="className"&&!(E instanceof HTMLElement)){E.setAttribute("class",y==null?"":String(y));return}if(p[l]===y)return;p[l]=y};if(r(d)){let y=d;if(l==="id"){p[l]=ve(y.$ref,f);return}we(()=>{h(g(ve(y.$ref,f)))});return}if(a(d)){let y=d;Xt(y,()=>{h(g(Ye(y,f)))});return}h(g(d))}function fs(o,l){let d=[];return{detach:l,insert(f){let p=[];for(let g of f){let h=o.cssRules.length;try{o.insertRule(g,h)}catch{continue}let y=o.cssRules[h];if(y)p.push(y)}let m={rules:p,texts:f};return d.push(m),m},remove(f){let p=d.indexOf(f);if(p!==-1)d.splice(p,1);if(f.rules.length===0)return;let m=[...o.cssRules],g=f.rules.map((h)=>m.indexOf(h)).filter((h)=>h>=0).toSorted((h,y)=>y-h);for(let h of g)o.deleteRule(h);f.rules.length=0},replaceAll(f){d.length=0,d.push({rules:[],texts:f}),o.replaceSync(f.join(`
|
|
1
|
+
import{e,s,x,t,n,i,r,v,b,V,P,H,I,S,c,a,D,F,Z,W,J,u,w}from"./chunks/iframe-entry-rt8jz5t8.js";var ai,pr,hn,pe=(o,l)=>{for(var[d,f,p]of ai||[])for(var m=[o],g=globalThis,h=g.document,y,E,A,T,C;E=m.pop();)if(!pr[E]&&(A=f[E])){pr[E]=1;for(T=1;T<A.length;T++)m.push(p[A[T]]);if(!l&&E!==o&&(y=h&&h.head)){if(hn===void 0)hn=(T=h.querySelector("meta[property=csp-nonce]"))&&(T.nonce||T.getAttribute("nonce"))||"";if(C=h.createElement("link"),C.rel="modulepreload",C.crossOrigin="",hn)C.nonce=hn;C.href=new g.URL(A[0],d),y.appendChild(C)}}},fc=(o,l,d,f)=>{for(var p={},m=0;m<l.length;m++)p[l[m]]=d[m];(ai||=[]).push([o,p,l]),pr||={},pe(l[f],1)};fc(import.meta.url,["c20hggbg","44cm5cta","vw4nc63s","ghkxkasp","wewc8rq2","2kn2vrn4","3rxeyj3d","t2bnnj8y","qp8fn1k8","xc3cbgsd","y62xq0ty","4aan7g6g","cnmsav6b","rzds841e","d15yencd","ewh24n1f","f5cw3tgp","eytr7av4","frd9y9q6","rebpbe33","6bzmk3s7","c49x7gf1","c4x05vyx","tktzq5xj","rt8jz5t8","v40cr813","msd43x9h","mpwe5pwk"],[["./iframe-entry.js",24],["./chunks/toolbar-44cm5cta.js"],["./chunks/tree-vw4nc63s.js",24],["./chunks/tooltip-ghkxkasp.js",25,24],["./chunks/textfield-wewc8rq2.js"],["./chunks/toast-2kn2vrn4.js",26],["./chunks/toast-host-3rxeyj3d.js",26],["./chunks/color-t2bnnj8y.js",27],["./chunks/icons-qp8fn1k8.js",24],["./chunks/menu-xc3cbgsd.js",25,24],["./chunks/number-field-y62xq0ty.js"],["./chunks/action-group-4aan7g6g.js"],["./chunks/popover-cnmsav6b.js",25],["./chunks/select-rzds841e.js"],["./chunks/split-d15yencd.js",24],["./chunks/swatch-group-ewh24n1f.js"],["./chunks/tabs-f5cw3tgp.js"],["./chunks/index-eytr7av4.js",24],["./chunks/color-area-frd9y9q6.js",27,24],["./chunks/color-field-rebpbe33.js",27,25,24],["./chunks/color-slider-6bzmk3s7.js",27],["./chunks/combobox-c49x7gf1.js",25],["./chunks/dialog-c4x05vyx.js"],["./chunks/listbox-tktzq5xj.js",24],["./chunks/iframe-entry-rt8jz5t8.js"],["./chunks/iframe-entry-v40cr813.js",24],["./chunks/iframe-entry-msd43x9h.js"],["./chunks/iframe-entry-mpwe5pwk.js",24]],0);
|
|
2
|
+
var mr="jx:canvas";function li(o){let{target:l,source:d,targetOrigin:f,acceptOrigin:p,token:m}=o,g=new Set,h=(y)=>{if(p!=="*"&&y.origin!==p)return;let E=y.data;if(!n(E)||!(mr in E)||E[mr]!==m)return;let A="payload"in E?E.payload:void 0;for(let T of g)T(A)};return d.addEventListener("message",h),{dispose(){g.clear(),d.removeEventListener("message",h)},onMessage(y){return g.add(y),()=>g.delete(y)},post(y){l.postMessage({[mr]:m,payload:y},f)}}}function hr(o){return o.ownerDocument.defaultView?.getComputedStyle(o).display==="contents"}function Pe(o){let l=o.getBoundingClientRect();if(l.width>0||l.height>0||!o.hasChildNodes()||!hr(o))return l;let d=null;for(let f of o.childNodes){let p=null;if(f instanceof Element)p=Pe(f);else if(f.nodeType===Node.TEXT_NODE){let m=o.ownerDocument.createRange();m.selectNodeContents(f),p=m.getBoundingClientRect()}if(!p||p.width===0&&p.height===0)continue;d=d?{bottom:Math.max(d.bottom,p.bottom),left:Math.min(d.left,p.left),right:Math.max(d.right,p.right),top:Math.min(d.top,p.top)}:{bottom:p.bottom,left:p.left,right:p.right,top:p.top}}return d?new DOMRect(d.left,d.top,d.right-d.left,d.bottom-d.top):l}function ci(o){return o.getBoundingClientRect()}function gr(o,l,d=document){return d.elementFromPoint(o,l)}function xr(o){let l=Object.create(null);for(let d of o.split(","))l[d]=1;return(d)=>(d in l)}var gn=Object.assign;var pc=Object.prototype.hasOwnProperty,xn=(o,l)=>pc.call(o,l),dt=Array.isArray,Jt=(o)=>di(o)==="[object Map]";var ui=(o)=>typeof o==="function",mc=(o)=>typeof o==="string",ft=(o)=>typeof o==="symbol",pt=(o)=>o!==null&&typeof o==="object";var hc=Object.prototype.toString,di=(o)=>hc.call(o),fi=(o)=>di(o).slice(8,-1);var yn=(o)=>mc(o)&&o!=="NaN"&&o[0]!=="-"&&""+parseInt(o,10)===o;var bn=(o)=>{let l=Object.create(null);return(d)=>l[d]||(l[d]=o(d))},gc=/-\w/g,Jp=bn((o)=>o.replace(gc,(l)=>l.slice(1).toUpperCase())),xc=/\B([A-Z])/g,Dp=bn((o)=>o.replace(xc,"-$1").toLowerCase()),pi=bn((o)=>o.charAt(0).toUpperCase()+o.slice(1)),_p=bn((o)=>o?`on${pi(o)}`:""),He=(o,l)=>!Object.is(o,l);var yc="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly";var Lp=xr(yc+",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");var ve;class xi{constructor(o=!1){if(this.detached=o,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!o&&ve)if(ve.active)this.parent=ve,this.index=(ve.scopes||(ve.scopes=[])).push(this)-1;else this._active=!1,this._warnOnRun=!1}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let o,l;if(this.scopes){let d=this.scopes.slice();for(o=0,l=d.length;o<l;o++)d[o].pause()}for(o=0,l=this.effects.length;o<l;o++)this.effects[o].pause()}}resume(){if(this._active){if(this._isPaused){this._isPaused=!1;let o,l;if(this.scopes){let f=this.scopes.slice();for(o=0,l=f.length;o<l;o++)f[o].resume()}let d=this.effects.slice();for(o=0,l=d.length;o<l;o++)d[o].resume()}}}run(o){if(this._active){let l=ve;try{return ve=this,o()}finally{ve=l}}}on(){if(++this._on===1)this.prevScope=ve,ve=this}off(){if(this._on>0&&--this._on===0){if(ve===this)ve=this.prevScope;else{let o=ve;while(o){if(o.prevScope===this){o.prevScope=this.prevScope;break}o=o.prevScope}}this.prevScope=void 0}}stop(o){if(this._active){this._active=!1;let l,d;for(l=0,d=this.effects.length;l<d;l++)this.effects[l].stop();this.effects.length=0;for(l=0,d=this.cleanups.length;l<d;l++)this.cleanups[l]();if(this.cleanups.length=0,this.scopes){let f=this.scopes.slice();for(l=0,d=f.length;l<d;l++)f[l].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!o){let f=this.parent.scopes.pop();if(f&&f!==this)this.parent.scopes[this.index]=f,f.index=this.index}this.parent=void 0}}}function rt(o){return new xi(o)}function Ht(o,l=!1){if(ve)ve.cleanups.push(o)}var ue;var yr=new WeakSet;class En{constructor(o){if(this.fn=o,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,ve)if(ve.active)ve.effects.push(this);else this.flags&=-2}pause(){this.flags|=64}resume(){if(this.flags&64){if(this.flags&=-65,yr.has(this))yr.delete(this),this.trigger()}}notify(){if(this.flags&2&&!(this.flags&32))return;if(!(this.flags&8))bi(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,mi(this),Si(this);let o=ue,l=Me;ue=this,Me=!0;try{return this.fn()}finally{vi(this),ue=o,Me=l,this.flags&=-3}}stop(){if(this.flags&1){for(let o=this.deps;o;o=o.nextDep)Nr(o);this.deps=this.depsTail=void 0,mi(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){if(this.flags&64)yr.add(this);else if(this.scheduler)this.scheduler();else this.runIfDirty()}runIfDirty(){if(vr(this))this.run()}get dirty(){return vr(this)}}var yi=0,_t,Lt;function bi(o,l=!1){if(o.flags|=8,l){o.next=Lt,Lt=o;return}o.next=_t,_t=o}function Cr(){yi++}function Pr(){if(--yi>0)return;if(Lt){let l=Lt;Lt=void 0;while(l){let d=l.next;l.next=void 0,l.flags&=-9,l=d}}let o;while(_t){let l=_t;_t=void 0;while(l){let d=l.next;if(l.next=void 0,l.flags&=-9,l.flags&1)try{l.trigger()}catch(f){if(!o)o=f}l=d}}if(o)throw o}function Si(o){for(let l=o.deps;l;l=l.nextDep)l.version=-1,l.prevActiveLink=l.dep.activeLink,l.dep.activeLink=l}function vi(o){let l,d=o.depsTail,f=d;while(f){let p=f.prevDep;if(f.version===-1){if(f===d)d=p;Nr(f),bc(f)}else l=f;f.dep.activeLink=f.prevActiveLink,f.prevActiveLink=void 0,f=p}o.deps=l,o.depsTail=d}function vr(o){for(let l=o.deps;l;l=l.nextDep)if(l.dep.version!==l.version||l.dep.computed&&(Ei(l.dep.computed)||l.dep.version!==l.version))return!0;if(o._dirty)return!0;return!1}function Ei(o){if(o.flags&4&&!(o.flags&16))return;if(o.flags&=-17,o.globalVersion===It)return;if(o.globalVersion=It,!o.isSSR&&o.flags&128&&(!o.deps&&!o._dirty||!vr(o)))return;o.flags|=2;let l=o.dep,d=ue,f=Me;ue=o,Me=!0;try{Si(o);let p=o.fn(o._value);if(l.version===0||He(p,o._value))o.flags|=128,o._value=p,l.version++}catch(p){throw l.version++,p}finally{ue=d,Me=f,vi(o),o.flags&=-3}}function Nr(o,l=!1){let{dep:d,prevSub:f,nextSub:p}=o;if(f)f.nextSub=p,o.prevSub=void 0;if(p)p.prevSub=f,o.nextSub=void 0;if(d.subs===o){if(d.subs=f,!f&&d.computed){d.computed.flags&=-5;for(let m=d.computed.deps;m;m=m.nextDep)Nr(m,!0)}}if(!l&&!--d.sc&&d.map)d.map.delete(d.key)}function bc(o){let{prevDep:l,nextDep:d}=o;if(l)l.nextDep=d,o.prevDep=void 0;if(d)d.prevDep=l,o.nextDep=void 0}function we(o,l){if(o.effect instanceof En)o=o.effect.fn;let d=new En(o);if(l)gn(d,l);try{d.run()}catch(p){throw d.stop(),p}let f=d.run.bind(d);return f.effect=d,f}var Me=!0,wi=[];function ht(){wi.push(Me),Me=!1}function gt(){let o=wi.pop();Me=o===void 0?!0:o}function wn(o,l=!1){if(ue instanceof En)ue.cleanup=o}function mi(o){let{cleanup:l}=o;if(o.cleanup=void 0,l){let d=ue;ue=void 0;try{l()}finally{ue=d}}}var It=0;class Ti{constructor(o,l){this.sub=o,this.dep=l,this.version=l.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Tn{constructor(o){this.computed=o,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(o){if(!ue||!Me||ue===this.computed)return;let l=this.activeLink;if(l===void 0||l.sub!==ue){if(l=this.activeLink=new Ti(ue,this),!ue.deps)ue.deps=ue.depsTail=l;else l.prevDep=ue.depsTail,ue.depsTail.nextDep=l,ue.depsTail=l;Ai(l)}else if(l.version===-1){if(l.version=this.version,l.nextDep){let d=l.nextDep;if(d.prevDep=l.prevDep,l.prevDep)l.prevDep.nextDep=d;if(l.prevDep=ue.depsTail,l.nextDep=void 0,ue.depsTail.nextDep=l,ue.depsTail=l,ue.deps===l)ue.deps=d}}return l}trigger(o){this.version++,It++,this.notify(o)}notify(o){Cr();try{for(let l=this.subs;l;l=l.prevSub)if(l.sub.notify())l.sub.dep.notify()}finally{Pr()}}}function Ai(o){if(o.dep.sc++,o.sub.flags&4){let l=o.dep.computed;if(l&&!o.dep.subs){l.flags|=20;for(let f=l.deps;f;f=f.nextDep)Ai(f)}let d=o.dep.subs;if(d!==o){if(o.prevSub=d,d)d.nextSub=o}o.dep.subs=o}}var Er=new WeakMap,tt=Symbol(""),wr=Symbol(""),jt=Symbol("");function Te(o,l,d){if(Me&&ue){let f=Er.get(o);if(!f)Er.set(o,f=new Map);let p=f.get(d);if(!p)f.set(d,p=new Tn),p.map=f,p.key=d;p.track()}}function Ue(o,l,d,f,p,m){let g=Er.get(o);if(!g){It++;return}let h=(y)=>{if(y)y.trigger()};if(Cr(),l==="clear")g.forEach(h);else{let y=dt(o),E=y&&yn(d);if(y&&d==="length"){let A=Number(f);g.forEach((T,C)=>{if(C==="length"||C===jt||!ft(C)&&C>=A)h(T)})}else{if(d!==void 0||g.has(void 0))h(g.get(d));if(E)h(g.get(jt));switch(l){case"add":if(!y){if(h(g.get(tt)),Jt(o))h(g.get(wr))}else if(E)h(g.get("length"));break;case"delete":if(!y){if(h(g.get(tt)),Jt(o))h(g.get(wr))}break;case"set":if(Jt(o))h(g.get(tt));break}}}Pr()}function mt(o){let l=le(o);if(l===o)return l;if(Te(l,"iterate",jt),ze(o))return l;if(!Ve(o))return l.map(Le);return Ft(o)?l.map((d)=>nt(Le(d))):l.map(nt)}function Rr(o){return Te(o=le(o),"iterate",jt),o}function _e(o,l){if(Ve(o))return Ft(o)?nt(Le(l)):nt(l);return Le(l)}var Sc={__proto__:null,[Symbol.iterator](){return br(this,Symbol.iterator,(o)=>_e(this,o))},concat(...o){return mt(this).concat(...o.map((l)=>dt(l)?mt(l):l))},entries(){return br(this,"entries",(o)=>(o[1]=_e(this,o[1]),o))},every(o,l){return Fe(this,"every",o,l,void 0,arguments)},filter(o,l){return Fe(this,"filter",o,l,(d)=>d.map((f)=>_e(this,f)),arguments)},find(o,l){return Fe(this,"find",o,l,(d)=>_e(this,d),arguments)},findIndex(o,l){return Fe(this,"findIndex",o,l,void 0,arguments)},findLast(o,l){return Fe(this,"findLast",o,l,(d)=>_e(this,d),arguments)},findLastIndex(o,l){return Fe(this,"findLastIndex",o,l,void 0,arguments)},forEach(o,l){return Fe(this,"forEach",o,l,void 0,arguments)},includes(...o){return Sr(this,"includes",o)},indexOf(...o){return Sr(this,"indexOf",o)},join(o){return mt(this).join(o)},lastIndexOf(...o){return Sr(this,"lastIndexOf",o)},map(o,l){return Fe(this,"map",o,l,void 0,arguments)},pop(){return Dt(this,"pop")},push(...o){return Dt(this,"push",o)},reduce(o,...l){return gi(this,"reduce",o,l)},reduceRight(o,...l){return gi(this,"reduceRight",o,l)},shift(){return Dt(this,"shift")},some(o,l){return Fe(this,"some",o,l,void 0,arguments)},splice(...o){return Dt(this,"splice",o)},toReversed(){return mt(this).toReversed()},toSorted(o){return mt(this).toSorted(o)},toSpliced(...o){return mt(this).toSpliced(...o)},unshift(...o){return Dt(this,"unshift",o)},values(){return br(this,"values",(o)=>_e(this,o))}};function br(o,l,d){let f=Rr(o),p=f[l],m=p.call(f);if(f!==o&&!ze(o)){if(m[Symbol.toStringTag]==="Array Iterator"){let g=Object.create(Object.getPrototypeOf(m));if(g.next=()=>hi(m.next(),d),p!==Ci[l])Object.defineProperties(g,{return:{get(){let h=m.return;return typeof h==="function"?h.bind(m):h}},throw:{get(){let h=m.throw;return typeof h==="function"?h.bind(m):h}}});return g}m._next=m.next,m.next=()=>hi(m._next(),d)}return m}function hi(o,l){if(!o.done)o.value=l(o.value);return o}var Ci=Array.prototype;function Fe(o,l,d,f,p,m){let g=Rr(o),h=g!==o&&!ze(o),y=g[l];if(y!==Ci[l]){let T=y.apply(o,m);return h?Le(T):T}let E=d;if(g!==o){if(h)E=function(T,C){return d.call(this,_e(o,T),C,o)};else if(d.length>2)E=function(T,C){return d.call(this,T,C,o)}}let A=y.call(g,E,f);return h&&p?p(A):A}function gi(o,l,d,f){let p=Rr(o),m=p!==o&&!ze(o),g=d,h=!1;if(p!==o){if(m)h=f.length===0,g=function(E,A,T){if(h)h=!1,E=_e(o,E);return d.call(this,E,_e(o,A),T,o)};else if(d.length>3)g=function(E,A,T){return d.call(this,E,A,T,o)}}let y=p[l](g,...f);return h?_e(o,y):y}function Sr(o,l,d){let f=le(o);Te(f,"iterate",jt);let p=f[l](...d);if((p===-1||p===!1)&&kc(d[0]))return d[0]=le(d[0]),f[l](...d);return p}function Dt(o,l,d=[]){ht(),Cr();let f=le(o)[l].apply(o,d);return Pr(),gt(),f}var vc=xr("__proto__,__v_isRef,__isVue"),Pi=new Set(Object.getOwnPropertyNames(Symbol).filter((o)=>o!=="arguments"&&o!=="caller").map((o)=>Symbol[o]).filter(ft));function Ec(o){if(!ft(o))o=String(o);let l=le(this);return Te(l,"has",o),l.hasOwnProperty(o)}class $r{constructor(o=!1,l=!1){this._isReadonly=o,this._isShallow=l}get(o,l,d){if(l==="__v_skip")return o.__v_skip;let f=this._isReadonly,p=this._isShallow;if(l==="__v_isReactive")return!f;else if(l==="__v_isReadonly")return f;else if(l==="__v_isShallow")return p;else if(l==="__v_raw"){if(d===(f?p?Oc:Oi:p?$i:Ri).get(o)||Object.getPrototypeOf(o)===Object.getPrototypeOf(d))return o;return}let m=dt(o);if(!f){let h;if(m&&(h=Sc[l]))return h;if(l==="hasOwnProperty")return Ec}let g=Reflect.get(o,l,qe(o)?o:d);if(ft(l)?Pi.has(l):vc(l))return g;if(!f)Te(o,"get",l);if(p)return g;if(qe(g)){let h=m&&yn(l)?g:g.value;return f&&pt(h)?Ar(h):h}if(pt(g))return f?Ar(g):An(g);return g}}class Or extends $r{constructor(o=!1){super(!1,o)}set(o,l,d,f){let p=o[l],m=dt(o)&&yn(l);if(!this._isShallow){let y=Ve(p);if(!ze(d)&&!Ve(d))p=le(p),d=le(d);if(!m&&qe(p)&&!qe(d))if(y)return!0;else return p.value=d,!0}let g=m?Number(l)<o.length:xn(o,l),h=Reflect.set(o,l,d,qe(o)?o:f);if(o===le(f)&&h){if(!g)Ue(o,"add",l,d);else if(He(d,p))Ue(o,"set",l,d,p)}return h}deleteProperty(o,l){let d=xn(o,l),f=o[l],p=Reflect.deleteProperty(o,l);if(p&&d)Ue(o,"delete",l,void 0,f);return p}has(o,l){let d=Reflect.has(o,l);if(!ft(l)||!Pi.has(l))Te(o,"has",l);return d}ownKeys(o){return Te(o,"iterate",dt(o)?"length":tt),Reflect.ownKeys(o)}}class Ni extends $r{constructor(o=!1){super(!0,o)}set(o,l){return!0}deleteProperty(o,l){return!0}}var wc=new Or,Tc=new Ni,Ac=new Or(!0);var Tr=(o)=>o,Sn=(o)=>Reflect.getPrototypeOf(o);function Cc(o,l,d){return function(...f){let p=this.__v_raw,m=le(p),g=Jt(m),h=o==="entries"||o===Symbol.iterator&&g,y=o==="keys"&&g,E=p[o](...f),A=d?Tr:l?nt:Le;return!l&&Te(m,"iterate",y?wr:tt),gn(Object.create(E),{next(){let{value:T,done:C}=E.next();return C?{value:T,done:C}:{value:h?[A(T[0]),A(T[1])]:A(T),done:C}}})}}function vn(o){return function(...l){return o==="delete"?!1:o==="clear"?void 0:this}}function Pc(o,l){let d={get(p){let m=this.__v_raw,g=le(m),h=le(p);if(!o){if(He(p,h))Te(g,"get",p);Te(g,"get",h)}let{has:y}=Sn(g),E=l?Tr:o?nt:Le;if(y.call(g,p))return E(m.get(p));else if(y.call(g,h))return E(m.get(h));else if(m!==g)m.get(p)},get size(){let p=this.__v_raw;return!o&&Te(le(p),"iterate",tt),p.size},has(p){let m=this.__v_raw,g=le(m),h=le(p);if(!o){if(He(p,h))Te(g,"has",p);Te(g,"has",h)}return p===h?m.has(p):m.has(p)||m.has(h)},forEach(p,m){let g=this,h=g.__v_raw,y=le(h),E=l?Tr:o?nt:Le;return!o&&Te(y,"iterate",tt),h.forEach((A,T)=>p.call(m,E(A),E(T),g))}};return gn(d,o?{add:vn("add"),set:vn("set"),delete:vn("delete"),clear:vn("clear")}:{add(p){let m=le(this),g=Sn(m),h=le(p),y=!l&&!ze(p)&&!Ve(p)?h:p;if(!(g.has.call(m,y)||He(p,y)&&g.has.call(m,p)||He(h,y)&&g.has.call(m,h)))m.add(y),Ue(m,"add",y,y);return this},set(p,m){if(!l&&!ze(m)&&!Ve(m))m=le(m);let g=le(this),{has:h,get:y}=Sn(g),E=h.call(g,p);if(!E)p=le(p),E=h.call(g,p);let A=y.call(g,p);if(g.set(p,m),!E)Ue(g,"add",p,m);else if(He(m,A))Ue(g,"set",p,m,A);return this},delete(p){let m=le(this),{has:g,get:h}=Sn(m),y=g.call(m,p);if(!y)p=le(p),y=g.call(m,p);let E=h?h.call(m,p):void 0,A=m.delete(p);if(y)Ue(m,"delete",p,void 0,E);return A},clear(){let p=le(this),m=p.size!==0,g=void 0,h=p.clear();if(m)Ue(p,"clear",void 0,void 0,void 0);return h}}),["keys","values","entries",Symbol.iterator].forEach((p)=>{d[p]=Cc(p,o,l)}),d}function Mr(o,l){let d=Pc(o,l);return(f,p,m)=>{if(p==="__v_isReactive")return!o;else if(p==="__v_isReadonly")return o;else if(p==="__v_isShallow")return l;else if(p==="__v_raw")return f;return Reflect.get(xn(d,p)&&p in f?d:f,p,m)}}var Nc={get:Mr(!1,!1)},Rc={get:Mr(!1,!0)},$c={get:Mr(!0,!1)};var Ri=new WeakMap,$i=new WeakMap,Oi=new WeakMap,Oc=new WeakMap;function Mc(o){switch(o){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function An(o){if(Ve(o))return o;return kr(o,!1,wc,Nc,Ri)}function Mi(o){return kr(o,!1,Ac,Rc,$i)}function Ar(o){return kr(o,!0,Tc,$c,Oi)}function kr(o,l,d,f,p){if(!pt(o))return o;if(o.__v_raw&&!(l&&o.__v_isReactive))return o;if(o.__v_skip||!Object.isExtensible(o))return o;let m=p.get(o);if(m)return m;let g=Mc(fi(o));if(g===0)return o;let h=new Proxy(o,g===2?f:d);return p.set(o,h),h}function Ft(o){if(Ve(o))return Ft(o.__v_raw);return!!(o&&o.__v_isReactive)}function Ve(o){return!!(o&&o.__v_isReadonly)}function ze(o){return!!(o&&o.__v_isShallow)}function kc(o){return o?!!o.__v_raw:!1}function le(o){let l=o&&o.__v_raw;return l?le(l):o}var Le=(o)=>pt(o)?An(o):o,nt=(o)=>pt(o)?Ar(o):o;function qe(o){return o?o.__v_isRef===!0:!1}function Ge(o){return Jc(o,!1)}function Jc(o,l){if(qe(o))return o;return new ki(o,l)}class ki{constructor(o,l){this.dep=new Tn,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=l?o:le(o),this._value=l?o:Le(o),this.__v_isShallow=l}get value(){return this.dep.track(),this._value}set value(o){let l=this._rawValue,d=this.__v_isShallow||ze(o)||Ve(o);if(o=d?o:le(o),He(o,l))this._rawValue=o,this._value=d?o:Le(o),this.dep.trigger()}}class Ji{constructor(o,l,d){this.fn=o,this.setter=l,this._value=void 0,this.dep=new Tn(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=It-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!l,this.isSSR=d}notify(){if(this.flags|=16,!(this.flags&8)&&ue!==this)return bi(this,!0),!0}get value(){let o=this.dep.track();if(Ei(this),o)o.version=this.dep.version;return this._value}set value(o){if(this.setter)this.setter(o)}}function Vt(o,l,d=!1){let f,p;if(ui(o))f=o;else f=o.get,p=o.set;return new Ji(f,p,d)}function Cn(o){return o.replaceAll(/[A-Z]/g,(l)=>`-${l.toLowerCase()}`)}var Dc=new Set(["all","print","screen","speech"]);function Di(o,l){if(o.startsWith("@--"))return l[o.slice(1)]??o.slice(1);if(o.startsWith("@(")){let d=o.slice(2,-1).trim();return Dc.has(d.toLowerCase())?d:o.slice(1)}return null}function Wt(o){return o.startsWith("@position-try")||o.startsWith("@property")||o.startsWith("@font-face")||o.startsWith("@counter-style")}function Kt(o){return o.startsWith("@keyframes")}function _i(o,l){let d=[];for(let f of Jr(o))for(let p of Jr(l))d.push(_c(f,p));return d.join(", ")}function _c(o,l){let d=Li(l,o);if(d!==null)return d;if(l.startsWith("[")||l.startsWith(":")||l.startsWith("."))return`${o}${l}`;return`${o} ${l}`}function Dr(o){let l=[],d=null,f=0;for(let p=0;p<o.length;p+=1){let m=o[p];if(d){if(m==="\\")p+=1;else if(m===d)d=null;continue}if(m==="\\")p+=1;else if(m==='"'||m==="'")d=m;else if(m==="[")f+=1;else if(m==="]")f=Math.max(0,f-1);else if(m==="&"&&f===0)l.push(p)}return l}function Li(o,l){return Dr(o).length>0?Lc(o,l):null}function Lc(o,l){let d="",f=0;for(let p of Dr(o))d+=o.slice(f,p)+l,f=p+1;return d+o.slice(f)}function Jr(o){let l=[],d=0,f=null,p=0;for(let g=0;g<o.length;g+=1){let h=o[g];if(f){if(h==="\\")g+=1;else if(h===f)f=null;continue}if(h==='"'||h==="'")f=h;else if(h==="("||h==="[")d+=1;else if(h===")"||h==="]")d=Math.max(0,d-1);else if(h===","&&d===0)l.push(o.slice(p,g)),p=g+1}l.push(o.slice(p));let m=l.flatMap((g)=>{let h=g.trim();return h===""?[]:[h]});return m.length>0?m:[o]}var Ic=/[\s>+~,()]/,jc=/^[A-Za-z_\u{00A0}-\u{FFFF}][\w\u{00A0}-\u{FFFF}-]*/u;function Hc(o,l){let d="",f=0;for(;;){let p=o.indexOf("[open]",f);if(p===-1)return d+o.slice(f);let m=p;while(m>0&&!Ic.test(o.charAt(m-1)))m-=1;let g=jc.exec(o.slice(m,p))?.[0]?.toLowerCase(),h=g===void 0?l.dialog===!0:g==="dialog";d+=o.slice(f,p)+(h?"[data-jx-dialog-open]":"[open]"),f=p+6}}function _r(o,l={}){if(o.includes("::backdrop"))return null;let d=o.replaceAll(":popover-open","[data-jx-popover-open]").replaceAll(":modal","[data-jx-dialog-open]").replaceAll("[inert]","[data-jx-inert]");return Hc(d,l)}var Ye="data-color-scheme";function Pn(o){let l=/^\(\s*prefers-color-scheme\s*:\s*(light|dark)\s*\)$/.exec(o.trim())?.[1];return l==="light"||l==="dark"?l:null}function Ii(o,l){if(o===":root"||o==="html")return{auto:`${o}:where(:not([${Ye}]))`,forced:`${o}:where([${Ye}="${l}"])`};return{auto:`:where(:root:not([${Ye}])) ${o}`,forced:`:where(:root[${Ye}="${l}"]) ${o}`}}function Ut(o){return o.startsWith(":")||o.startsWith(".")||o.startsWith("&")||o.startsWith("[")}function Lr(o){return o.startsWith("--")?o:Cn(o)}function Bt(o){let l=2166136261;for(let d=0;d<o.length;d+=1)l^=o.charCodeAt(d),l=Math.imul(l,16777619);return(l>>>0).toString(36)}function ji(o,l,d){let f=d.map(([m,g])=>`${m}: ${g}`).join("; "),p=l===null?f:`${l} { ${f} }`;for(let m=o.length-1;m>=0;m-=1)p=`${o[m]} { ${p} }`;return p}function Fc(o,l,d){let f=d.map(({selector:m,declarations:g})=>`${m} { ${g.map(([h,y])=>`${h}: ${y}`).join("; ")} }`).join(" "),p=`@keyframes ${l} { ${f} }`;for(let m=o.length-1;m>=0;m-=1)p=`${o[m]} { ${p} }`;return p}function Vc(o){let l=Object.keys(o).filter((f)=>Kt(f));if(l.length===0)return o;let d={...o};for(let f of l)delete d[f];return d}function Wc(o){let d=Dr(o).at(-1),f=d===void 0?o:o.slice(d+1);return f===""||f.startsWith(":")||f.startsWith(".")||f.startsWith("[")}function qt(o,l={}){let{scope:d=null,mediaQueries:f={},transposeValue:p=(_)=>_,transposeSelector:m=(_)=>_,resolveValue:g}=l,h=[],y=(_)=>_!==null&&typeof _==="object"&&!Array.isArray(_)&&!r(_),E=(_,k)=>{if(y(k))return[k];if(!Wt(_)||!Array.isArray(k)||k.length===0)return[];return k.every((Y)=>y(Y))?k:[]},A=(_,k,Y,U)=>{if(k===void 0||k===null)return null;if(r(k))return Y?g?.(_,k,U)??null:null;if(n(k))return null;let G=String(k);if(a(G))return Y?g?.(_,G,U)??null:null;return p(G)},T=(_,k,Y=!0,U="self")=>{let G=[];for(let[ne,M]of Object.entries(_)){if(E(ne,M).length>0)continue;if(k&&(ne.startsWith("@")||Ut(ne)))continue;if(ne.startsWith("$"))continue;let B=A(ne,M,Y,U);if(B!==null)G.push([Lr(ne),B])}return G},C=(_,k,Y,U,G)=>{if(Y.length===0)return;let ne=k;if(ne!==null){let q=m(ne);if(q===null)return;ne=q}let M=ji(_,ne,Y),B={text:M,conditions:[..._],selector:ne,declarations:Y,target:U,key:Bt(M)};if(e(G)&&G!=="")B.description=G;h.push(B)},L=(_,k,Y)=>{let U=_.slice(10).trim();if(U==="")return;let G=[];for(let[M,B]of Object.entries(k)){if(!y(B))continue;let q=T(B,!0,!1,"unscoped");if(q.length>0)G.push({declarations:q,selector:M.trim()})}if(G.length===0)return;let ne=Fc(Y,U,G);h.push({blocks:G,conditions:[...Y],declarations:[],key:Bt(ne),selector:null,target:"unscoped",text:ne})},O=(_,k,Y,U,G)=>{if(_==="@--")return;if(Wt(_)){C([...U,_],null,T(k,!1,!0,"unscoped"),"unscoped",k.$description);return}if(Kt(_)){L(_,k,U);return}let ne=Di(_,f),M=ne===null?_:`@media ${ne}`,B=ne===null?null:Pn(ne);if(B!==null&&Y!==null){let{auto:q,forced:X}=Ii(Y,B);K(k,q,[...U,M],G),K(Vc(k),X,U,G);return}K(k,Y,[...U,M],G)};function K(_,k,Y,U){C(Y,k,T(_,!0,!0,U),U,_.$description);for(let[G,ne]of Object.entries(_))for(let M of E(G,ne))if(G.startsWith("@"))O(G,M,k,Y,U);else if(k!==null)K(M,_i(k,G),Y,Wc(G)?U:"descendant")}return K(o,d,[],"self"),h}var We="en-US",Hi="UTC",Fi=[{api:"Intl.NumberFormat",params:["value","locale","options"],path:"Intl/formatNumber",summary:"Format a number for a locale — grouping, decimals, currency, percent, units."},{api:"Intl.DateTimeFormat",params:["value","locale","options"],path:"Intl/formatDate",summary:"Format a date or timestamp for a locale. Pass `timeZone` in options."},{api:"Intl.RelativeTimeFormat",params:["value","unit","locale","options"],path:"Intl/formatRelativeTime",summary:'Format a relative time — `-3, "day"` becomes "3 days ago".'},{api:"Intl.ListFormat",params:["values","locale","options"],path:"Intl/formatList",summary:'Join a list the way a locale does — "a, b, and c", not a hand-written comma join.'},{api:"Intl.PluralRules",params:["value","locale","options"],path:"Intl/plural",summary:'Which plural category a number falls in ("one", "few", "other") — many languages have '+"more than two, so a ternary on `n === 1` is wrong outside English."},{api:"Intl.Collator",params:["a","b","locale","options"],path:"Intl/compare",summary:'Compare two strings for sorting. `<` and `sort()` order by UTF-16 code unit, which puts "Zebra" before "apple" and sorts every accented word into the wrong place.'},{api:"Intl.DisplayNames",params:["code","type","locale","options"],path:"Intl/displayName",summary:'The name of a language, region, script or currency in a locale — "de" as "German" or '+'"Deutsch", from CLDR rather than a hand-kept table.'},{api:"Intl.Segmenter",params:["value","granularity","locale"],path:"Intl/segment",summary:"Split text into graphemes, words or sentences (UAX #29). `[...str]` splits code points, so it cuts an emoji with a skin-tone modifier in half."}],Vi=Fi.map((o)=>o.path),Wi=Object.fromEntries(Fi.map((o)=>[o.path,o.params.indexOf("locale")]));function Bc(o){return o.replaceAll("~1","/").replaceAll("~0","~")}function Ir(o){if(o==="")return[];return o.split("/").map((l)=>Bc(l))}function ge(o,l){let d=o;for(let f of Ir(l))d=d?.[f];return d}function jr(o){let l=o.$map;return n(l)?l:void 0}function Kc(o){return n(o)&&!Array.isArray(o)&&"operator"in o}function Ui(o){return n(o)&&!Array.isArray(o)&&"$ref"in o}var qi=new Set(["=","+=","-=","*=","/=","push","pop","shift","unshift","splice"]),zi=new Set(["!","-"]),Gi=new Set(["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||","??"]),Uc=new Set(["=","+=","-=","*=","/="]),qc=new Set(["push","pop","shift","unshift","splice"]),Yi=new Set(["reduce","map","filter"]),Xi=new Set(["?:","switch"]),Zi=new Set(["includes","indexOf","lastIndexOf","join","slice","concat","at","flat","toSorted","toReversed","toSpliced","with","toUpperCase","toLowerCase","trim","trimStart","trimEnd","split","startsWith","endsWith","padStart","padEnd","replaceAll","repeat","charAt","normalize","toLocaleUpperCase","toLocaleLowerCase","toFixed","toPrecision","toLocaleString"]),zc=new Set([...qi,...zi,...Gi,...Yi,...Xi,...Zi,"call"]),Gc=new Set(["isNaN","isFinite","parseFloat","parseInt","encodeURIComponent","decodeURIComponent","structuredClone","Math/abs","Math/ceil","Math/floor","Math/round","Math/trunc","Math/sign","Math/sqrt","Math/cbrt","Math/pow","Math/exp","Math/log","Math/log2","Math/log10","Math/min","Math/max","Math/hypot","Number/isInteger","Number/isFinite","Number/isNaN","Number/parseFloat","Number/parseInt","JSON/parse","JSON/stringify","Object/keys","Object/values","Object/entries","Object/fromEntries","Array/from","Array/isArray","Array/of","String/fromCharCode","String/fromCodePoint",...Vi]),Yc=new Map([["Intl/compare",(o,l,d,f)=>new Intl.Collator(d??We,f).compare(o,l)],["Intl/displayName",(o,l,d,f)=>new Intl.DisplayNames(d??We,{...f,type:l??"language"}).of(o)],["Intl/formatDate",(o,l,d)=>new Intl.DateTimeFormat(l??We,{timeZone:Hi,...d}).format(new Date(o))],["Intl/formatList",(o,l,d)=>new Intl.ListFormat(l??We,d).format(o)],["Intl/formatNumber",(o,l,d)=>new Intl.NumberFormat(l??We,d).format(o)],["Intl/formatRelativeTime",(o,l,d,f)=>new Intl.RelativeTimeFormat(d??We,f).format(o,l)],["Intl/plural",(o,l,d)=>new Intl.PluralRules(l??We,d).select(o)],["Intl/segment",(o,l,d)=>[...new Intl.Segmenter(d??We,{granularity:l??"grapheme"}).segment(o)].map((f)=>f.segment)]]);function Xc(o,l,d){let f=Wi[o];if(f===void 0||f<0||l[f]!=null)return l;let p=ge(d.$page,"locale");if(!e(p)||p==="")return l;let m=[...l];return m[f]=p,m}function Zc(o){return o.startsWith("window#/")&&Gc.has(o.slice(8))}function Qi(o){return qi.has(o)}var Bi=64,Qc=64;function me(o,l){if(!o)return;let d=(o.depth??0)+1;if(d>Qc)return;return{depth:d,path:[...o.path??[],...Array.isArray(l)?l:[l]],report:o.report}}function fe(o,l,d,f,p){if(o===null||o===void 0)return o;if(Kc(o))return Ae(o,l,d,f,p);if(Ui(o)){let m=Nn(o.$ref,l,d,f);return p?.report(p.path??[],m),m}if(Array.isArray(o))return es(o,l,d,f,p);return p?.report(p.path??[],o),o}function es(o,l,d,f,p){return o.map((m,g)=>fe(m,l,d,f,me(p,g)))}function eu(o,l,d,f){let p=(m)=>{if(!o.slice(m.length).includes("/"))return l;return Nn(o.slice(0,o.lastIndexOf("/")),l,d,f)};if(o.startsWith("#/state/"))return p("#/state/");if(o.startsWith("parent#/"))return p("parent#/");if(o.startsWith("$map/")||o.startsWith("$args/"))return o.split("/").length>2?Nn(o.slice(0,o.lastIndexOf("/")),l,d,f):void 0;return}function Nn(o,l,d,f){if(o==="$reduce/acc")return f?.acc;if(o.startsWith("$reduce/"))return f?.acc;if(o.startsWith("$args/")){let p=o.slice(6).split("/"),m=f?.args?.[p[0]];return p.length>1?ge(m,p.slice(1).join("/")):m}if(o.startsWith("event#/")){let p=o.slice(7);return ge(d,p)}if(o.startsWith("$map/")){let p=o.split("/"),[,m]=p,g,h=jr(l);if(m==="item")g=f?.item??h?.item??l["$map/item"];else if(m==="index")g=f?.index??h?.index??l["$map/index"];else g=h?.[m]??l[`$map/${m}`];return p.length>2?ge(g,p.slice(2).join("/")):g}if(o.startsWith("#/state/"))return ge(l,o.slice(8));if(o.startsWith("parent#/"))return ge(l,o.slice(8));if(o.startsWith("window#/"))return ge(globalThis.window,o.slice(8));if(o.startsWith("document#/"))return ge(globalThis.document,o.slice(10));return ge(l,o)??null}function tu(o,l,d,f){if(o.startsWith("$map/")){let p=o.split("/"),[,m]=p,g,h=jr(l);if(m==="item")g=f?.item??h?.item??l["$map/item"];else if(m==="index")g=f?.index??h?.index??l["$map/index"];else g=h?.[m]??l[`$map/${m}`];if(p.length>2){let y=p.slice(2),E=y.pop(),A=y.length>0?ge(g,y.join("/")):g;return{key:E,obj:A}}return{key:m==="item"?"$map/item":"$map/index",obj:jr(l)??l}}if(o.startsWith("#/state/")){let p=o.slice(8);if(p.indexOf("/")===-1)return{key:p,obj:l};let g=Ir(p),h=g.pop(),y=l;for(let E of g)y=y[E];return{key:h,obj:y}}return{key:o,obj:l}}function Ae(o,l,d,f,p){let m=nu(o,l,d,f,p);return p?.report(p.path??[],m),m}function Ki(o,l,d){switch(o){case"+":return l+d;case"-":return l-d;case"*":return l*d;case"/":return l/d;case"%":return l%d;case"<":return l<d;case"<=":return l<=d;case">":return l>d;default:return l>=d}}function nu(o,l,d,f,p){let{operator:m,target:g,value:h,initial:y}=o;if(!zc.has(m))throw Error(`$expression: unknown operator "${m}"`);if(zi.has(m)&&!("value"in o)){let E=fe(g,l,d,f,me(p,"target"));if(m==="!")return!E;if(m==="-")return-E}if(m==="call"){let E=Ui(g)?g.$ref:void 0;if(!e(E))throw TypeError("$expression: call target must be a $ref pointer");let A=(f?.callDepth??0)+1;if(A>Bi)throw Error(`$expression: call depth exceeded (${Bi})`);let T=Array.isArray(h)?h.map((L,O)=>fe(L,l,d,f,me(p,["value",O]))):[];if(E.startsWith("window#/")){if(!Zc(E))throw Error(`$expression: "${E}" is not a blessed pure global`);let L=E.slice(8),O=Yc.get(L);if(O)return O(...Xc(L,T,l));let K=ge(globalThis.window,L),_=L.lastIndexOf("/"),k=_===-1?globalThis.window:ge(globalThis.window,L.slice(0,_));return K.apply(k,T)}let C=Nn(E,l,d,f);if(t(C))return C.apply(eu(E,l,d,f),T);if(n(C)&&"$expression"in C){let L=C,O={};for(let[K,_]of(L.parameters??[]).entries()){let k=e(_)?_:_?.name??"";if(!k)continue;O[k]=T[K]===void 0&&n(_)&&"default"in _?_.default:T[K]}return Ae(L.$expression,l,d,{args:O,callDepth:A})}throw TypeError(`$expression: call target "${E}" is not callable`)}if(Xi.has(m)){if(m==="?:"){let L=fe(g,l,d,f,me(p,"target"));if(p){let O=fe(h,l,d,f,me(p,"value")),K=fe(y,l,d,f,me(p,"initial"));return L?O:K}return L?fe(h,l,d,f):fe(y,l,d,f)}let E=fe(g,l,d,f,me(p,"target")),A=String(E),T=o.cases??{},C=Object.hasOwn(T,A);if(p){let L;for(let[K,_]of Object.entries(T)){let k=fe(_,l,d,f,me(p,["cases",K]));if(K===A)L=k}let O=fe(o.default,l,d,f,me(p,"default"));return C?L:O}return C?fe(T[A],l,d,f):fe(o.default,l,d,f)}if(Gi.has(m)){let E=fe(g,l,d,f,me(p,"target")),A=fe(h,l,d,f,me(p,"value"));switch(m){case"===":return E===A;case"!==":return E!==A;case"&&":return E&&A;case"||":return E||A;case"??":return E??A;default:return Ki(m,E,A)}}if(Uc.has(m)){let E=fe(h,l,d,f,me(p,"value")),{obj:A,key:T}=tu(g.$ref,l,d,f);A[T]=m==="="?E:Ki(m.slice(0,-1),A[T],E);return}if(qc.has(m)){let E=fe(g,l,d,f,me(p,"target"));switch(m){case"push":return E.push(fe(h,l,d,f,me(p,"value")));case"unshift":return E.unshift(fe(h,l,d,f,me(p,"value")));case"pop":return E.pop();case"shift":return E.shift();case"splice":{let A=fe(h,l,d,f,me(p,"value"));return E.splice(...A)}default:break}}if(Zi.has(m)){let E=fe(g,l,d,f,me(p,"target")),A=h===void 0?[]:Array.isArray(h)?es(h,l,d,f,me(p,"value")):[fe(h,l,d,f,me(p,"value"))],T=ge(E,m);if(!t(T))return;return T.apply(E,A)}if(Yi.has(m)){let E=fe(g,l,d,f,me(p,"target")),A=h;if(m==="reduce"){let T=fe(y,l,d,f,me(p,"initial"));for(let[C,L]of E.entries())T=Ae(A,l,d,{acc:T,index:C,item:L},C===0?me(p,"value"):void 0);return T}if(m==="map")return E.map((T,C)=>Ae(A,l,d,{...f,index:C,item:T},C===0?me(p,"value"):void 0));if(m==="filter")return E.filter((T,C)=>Ae(A,l,d,{...f,index:C,item:T},C===0?me(p,"value"):void 0))}return}function ot(o,l,d,f){return fe(o,l,d,f)}function Rn(o){let l=o.replaceAll("\\","/");return l.length>1&&l.endsWith("/")?l.slice(0,-1):l}function ts(o){let l=Rn(o);return l.startsWith("/")?l:`/${l}`}function ns(o,l){return[...o].toSorted((d,f)=>f[l].length-d[l].length)}function ru(o,l){return o===l||o.startsWith(`${l}/`)}function rs(o,l){let d=Rn(l);for(let f of ns(o,"dir")){let p=Rn(f.dir);if(!ru(d,p)||d===p)continue;let m=d.slice(p.length+1),{filter:g}=f;if(g&&!g(m))return null;let h=m.split("/").map((y)=>encodeURIComponent(y)).join("/");return`${ts(f.urlPrefix)}/${h}`}return null}function ou(o,l){let d=l.split("#")[0].split("?")[0];if(!d.startsWith("/"))return null;let f;try{f=decodeURIComponent(d)}catch{return null}if(/%2e|%2f/i.test(f))return null;for(let p of ns(o,"urlPrefix")){let m=ts(p.urlPrefix);if(!f.startsWith(`${m}/`))continue;let h=f.slice(m.length+1).split("/");if(h.some((E)=>E===""||E==="."||E===".."))return null;let{filter:y}=p;if(y&&!y(h.join("/")))return null;return`${Rn(p.dir)}/${h.join("/")}`}return null}var rm=String.raw`"'\s<>()\\`;var iu="public";function zt(o){let l=o.search(/[#?]/);return l===-1?{path:o,suffix:""}:{path:o.slice(0,l),suffix:o.slice(l)}}function Hr(o){return o===""||o.startsWith("/")||o.startsWith("#")||o.includes("${")||/^[a-z][\w+.-]*:/i.test(o)}function Fr(o){return o.replaceAll("\\","/").replace(/^\.\//,"").replace(/^\/+/,"").replace(/\/+$/,"")}function Vr(o,l){let f=(o===""||o==="."?[]:Fr(o).split("/")).filter((p)=>p!==""&&p!==".");for(let p of l.replaceAll("\\","/").split("/")){if(p===""||p===".")continue;if(p===".."){if(f.length===0)return null;f.pop();continue}f.push(p)}return f.join("/")}function su(o,l,d){let{path:f}=zt(o);if(!f.startsWith("/"))return[];let p;try{p=decodeURIComponent(f)}catch{return[]}if(/%2e|%2f/i.test(p))return[];let m=p.replace(/^\/+/,"");if(m===""||m.split("/").some((h)=>h==="."||h===".."))return[];let g=[];for(let h of d){if(h==="mounts"){let y=ou(l,f);if(y!==null&&!y.startsWith("/")&&!/^[A-Za-z]:/.test(y))g.push(Fr(y));continue}g.push(h==="root"?m:`${iu}/${m}`)}return[...new Set(g)]}function Wr(o,l,d,f){let{path:p}=zt(o);if(p==="")return null;if(Hr(o))return p.startsWith("/")?su(p,d,f)[0]??null:null;if(p.endsWith("/"))return null;let m;try{m=decodeURIComponent(p)}catch{return null}let g=Vr(l,m);if(g===null||g===""||g===Fr(l))return null;return g}function os(o){return o.split("/").map((l)=>encodeURIComponent(l)).join("/")}function is(o){let l=[],d=0;while(d<o.length){while(d<o.length&&(/\s/.test(o[d])||o[d]===","))d+=1;if(d>=o.length)break;let f=d;while(d<o.length&&!/\s/.test(o[d]))d+=1;let p=o.slice(f,d);if(p.endsWith(",")){l.push({descriptor:"",url:p.replace(/,+$/,"")});continue}while(d<o.length&&/\s/.test(o[d]))d+=1;let m=d;while(d<o.length&&o[d]!==",")d+=1;let g=o.slice(m,d).trim();if(d+=1,p=p.replace(/,+$/,""),p!=="")l.push({descriptor:g,url:p})}return l}function ss(o){return o.map(({url:l,descriptor:d})=>d?`${l} ${d}`:l).join(", ")}function au(o){if("operator"in o)return{kind:"expression",node:o};if("if"in o)return{kind:"if",node:o};if("$switch"in o)return{kind:"switch",node:o};if("stopPropagation"in o)return{kind:"stopPropagation"};if("preventDefault"in o)return{kind:"preventDefault"};return{kind:"dispatch",node:o}}function lu(o){return(n(o)||t(o))&&"then"in o&&t(o.then)}async function xt(o,l,d,f={}){let p=f.args?{args:f.args}:void 0;for(let m of o){let g=au(m);switch(g.kind){case"expression":{let h=Ae(g.node,l,d,p);if(lu(h))await h;break}case"if":{let h=g.node,y=ot(h.if,l,d,p)?h.then:h.else;if(Array.isArray(y))await xt(y,l,d,f);break}case"switch":{let h=g.node,y=String(ot(h.$switch,l,d,p)),E=h.cases??{},A=Object.hasOwn(E,y)?E[y]:h.default;if(Array.isArray(A))await xt(A,l,d,f);break}case"dispatch":{let h=g.node,y=t(f.target)?f.target():f.target,E=d?.currentTarget??y;if(!E)break;let A={};if("detail"in h)A.detail=ot(h.detail,l,d,p);if(h.bubbles!==void 0)A.bubbles=h.bubbles;if(h.composed!==void 0)A.composed=h.composed;E.dispatchEvent(new CustomEvent(h.dispatchEvent,A));break}case"stopPropagation":{d?.stopPropagation();break}case"preventDefault":{d?.preventDefault();break}default:break}}}function as(o,l){for(let d of o.split(";")){let f=d.indexOf("=");if(f===-1)continue;if(d.slice(0,f).trim()===l)return d.slice(f+1)}return null}function ls(o,l,d){let f=o.startsWith("__Host-"),p=[`${o}=${encodeURIComponent(JSON.stringify(l))}`];if(d.maxAge!==void 0)p.push(`Max-Age=${d.maxAge}`);let m=f?"/":d.path;if(m)p.push(`Path=${m}`);if(d.domain&&!f)p.push(`Domain=${d.domain}`);let{sameSite:g}=d;if(d.secure===!0||f||o.startsWith("__Secure-")||g?.toLowerCase()==="none")p.push("Secure");if(g)p.push(`SameSite=${g}`);return p.join("; ")}function Br(o){return t(o)}var Kr=new Map;function cu(o){return o.headers?.get("Content-Type")??""}async function Qr(o,l){if(!e(o))return o;let d=l?.resolver?.(o);if(d)return d;if(Kr.has(o))return Kr.get(o);let f=fetch(o).then(async(p)=>{if(!p.ok)throw Error(`Jx: failed to fetch ${o} (${p.status})`);let m=cu(p);if(m.includes("text/html"))throw Error(`Jx: ${o} returned HTML, not a document — the host answered a missing file with its `+"app shell (a single-page fallback), so this path is not served.");if(uu.test(o)&&!m.includes("json")){if(!qr)throw Error(`Jx: ${o} is a .jxn file and this page has no parser for it. Serve it from a Jx site, which answers JSON, or call setDocumentParser(parseJxn) with parseJxn from @jxsuite/schema/jxn.`);return qr(await p.text(),o)}return await p.json()});return Kr.set(o,f),f}var uu=/\.jxn(?:[?#]|$)/iu,qr=null;function $s(o){qr=o}var du=new Set(["type","properties","items","enum","minimum","maximum","minLength","maxLength","pattern","required","examples"]),Os={skip:!1};function Ms(o){Os.skip=o}var ks={skip:!1};function Js(o){ks.skip=o}var zr=null;function Ds(o){zr=o||null}function _s(o){return zr?`${o}?token=${encodeURIComponent(zr)}`:o}function Ls(o){let l=rt(!0);return l.run(()=>{we(o)}),()=>l.stop()}function Et(o){let l=rt(!0);try{return{result:l.run(o),stop:()=>l.stop()}}catch(d){throw l.stop(),d}}var Is=!1;function js(o){Is=o}var fu=/(-?\d*\.?\d+)(?:s|l|d)?v(h|w|min|max|i|b)\b/gi,pu=new Map([["b","cqb"],["h","cqh"],["i","cqi"],["max","cqmax"],["min","cqmin"],["w","cqw"]]);function mu(o){if(!Is||!o.includes("v"))return o;return o.replaceAll(fu,(l,d,f)=>`${d}${pu.get(f.toLowerCase())??`cq${f}`}`)}var Hs=!1;function Fs(o){Hs=o}var eo=!1;function Vs(o){eo=o}var to=!1;function Ws(o){to=o}var On=!1;function Gr(o){return On||o.dataset.jxPath!==void 0}function hu(o,l){if(Hs&&l==="href"&&(o.tagName==="A"||o.tagName==="AREA"))return"data-jx-href";if(eo&&l==="popover"&&Gr(o))return"data-jx-popover";if(to&&Gr(o)){if(l==="commandfor")return"data-jx-commandfor";if(l==="inert")return"data-jx-inert";if(l==="open"&&o.tagName==="DIALOG")return"data-jx-open"}return l}var St=null;function Hn(o){St=o}var gu=new Set(["src","poster","data"]),xu=new Set(["srcset","imagesrcset"]),yu=new Set(["LINK"]);function bu(o,l){return gu.has(l)||l==="href"&&yu.has(o)}function no(o,l,d){if(!St||d==="")return d;let f=l.toLowerCase();if(xu.has(f)){let p=is(d),m=p.map((h)=>{let y=St?.(h.url,f)??null;if(y===null||y===h.url)return h;return{descriptor:h.descriptor,url:y}});return m.some((h,y)=>h!==p[y])?ss(m):d}if(!bu(o,f))return d;return St(d,f)??d}var Su=/\burl\(\s*(?<q>["']?)(?<u>[^"')]*)\k<q>\s*\)/g;function vu(o){if(!St||!o.includes("url("))return o;return o.replaceAll(Su,(l,d,f)=>{let p=f===""?null:St?.(f,"url()")??null;return p===null?l:`url(${d}${p}${d})`})}function kn(o){return mu(vu(o))}var Bs=!1;function Ks(o){Bs=o}var Eu=/^\s*\$\{\s*state\.(\w+)\s*\}\s*$/;function wu(o,l,d){if(!Bs||o!=="textContent")return null;let f=null;if(r(l)){if(!l.$ref.startsWith("#/state/"))return null;let m=l.$ref.slice(8);f=m&&!m.includes("/")?m:null}else if(e(l))f=Eu.exec(l)?.[1]??null;if(!f)return null;let p=le(d)[f];if(qe(p)||t(p))return null;if(n(p))return null;return f}async function Fn(o,l={},d=location.href,f){let p=()=>f?.root??null,m={},g=o.state??{},h=Ft(l);for(let T of Object.keys(l))if(h&&!(T in g))Object.defineProperty(m,T,{configurable:!0,enumerable:!0,get:()=>l[T],set:(C)=>{l[T]=C}});else m[T]=l[T];let y=o.imports??{};for(let[,T]of Object.entries(g))if(H(T)&&!T.$src){let C=y[T.$prototype];if(C){if(!C.endsWith(".class.json")){console.warn(`Jx: import "${T.$prototype}" must map to a .class.json path, got "${C}"`);continue}T.$src=C}}for(let[T,C]of Object.entries(g)){if(e(C)){if(!C.includes("${"))m[T]=C;continue}if(s(C)||x(C)||C===null){m[T]=C;continue}if(Array.isArray(C)){m[T]=C;continue}if(n(C)){if(C.$prototype)continue;if(b(C))continue;if(I(C))continue;if("default"in C){m[T]=C.default;continue}if(Tu(C))continue;m[T]=C}}let E=An(m);for(let[T,C]of Object.entries(g))if(e(C)&&C.includes("${"))E[T]=Vt(()=>oo(C,E));for(let[T,C]of Object.entries(g))if(b(C)){let L=C.$expression;if(V(C)){let O=C.parameters;E[T]=(...K)=>Ae(L,E,null,{args:cs(O,K)})}else if(Qi(L.operator)){let O=(K,_)=>Ae(L,K,_);E[T]=O}else E[T]=Vt(()=>Ae(L,E,null))}for(let[T,C]of Object.entries(g))if(P(C)){let{body:L}=C;if(Array.isArray(C.parameters)&&C.parameters.length>0){let O=C.parameters;E[T]=(...K)=>xt(L,E,null,{args:cs(O,K),target:p})}else{let O=(K,_)=>{xt(L,K,_??null,{target:p})};E[T]=O}}else if(v(C))E[T]=await $u(C,E,T,d);for(let[T,C]of Object.entries(g))if(H(C))E[T]=await Uu(C,E,T,d,f);if(!(f?.skipServerFunctions??Os.skip)){for(let[T,C]of Object.entries(g))if(I(C))E[T]=await Qu(C,E,T,d)}let A=f?.media??la;if(o.$media)E.$media=o.$media;else if(!E.$media&&Object.keys(A).length>0)E.$media=A;return E}function cs(o,l){let d={};for(let[f,p]of o.entries()){let m=e(p)?p:p?.name??"";if(!m)continue;d[m]=l[f]===void 0&&p!==null&&!e(p)&&"default"in p?p.default:l[f]}return d}function Tu(o){for(let l of Object.keys(o))if(du.has(l))return!0;return!1}var Us=["state","$map","item","index","$site","$page"];function qs(o){let l=Pu(o);return[o,l,l?.item,l?.index,o.$site,o.$page]}function Xe(o,l){let d=us.get(o);if(!d)d=Function(...Us,`return \`${o}\``),zs(us,o,d);return d(...qs(l))}var us=new Map,ds=new Map,Au=4096;function zs(o,l,d){if(o.size>=Au)o.clear();o.set(l,d)}var fs=new Set,ps=null;function Gs(o,l){if(!fs.has(o))fs.add(o),console.warn(`jx: template ${JSON.stringify(o)} threw:`,l)}var Mn=0,Jn=new Map,Cu=[];function ro(o){Mn+=1,o.finally(()=>{if(Mn-=1,Mn===0){for(let{error:l,source:d}of Jn.values())Gs(d,l);Jn.clear();for(let l of Cu.splice(0))l()}})}function Zt(o,l,d){we(()=>{try{l(),Jn.delete(l)}catch(f){let p=f instanceof Error?f:Error(String(f));if(ps)ps(p,o);else if(Mn>0)Jn.set(l,{error:p,source:o});else Gs(o,p);d?.()}})}function Pu(o){return o.$map}function Nu(o){if(!o.startsWith("${")||!o.endsWith("}"))return!1;let l=0;for(let d=1;d<o.length;d+=1){let f=o[d];if(f==="{")l+=1;else if(f==="}"){if(l-=1,l===0)return d===o.length-1}}return!1}function oo(o,l){if(!Nu(o))return Xe(o,l);let d=ds.get(o);if(!d)d=Function(...Us,`return (${o.slice(2,-1)})`),zs(ds,o,d);return d(...qs(l))}var Ys=null;function Xs(o){Ys=o}var ms="npm:";async function Ru(o,l){if(o.startsWith(ms)){let d=o.slice(ms.length);return yt(Ys?.(d)??d)}if(l)try{return await yt(new URL(o,l).href)}catch{return yt(o)}return yt(o)}function yt(o){return import(o)}var wt=new Map,bt=new Map,Zs=new Set;function Qs(o,l){if(Zs.add(o),t(l)){wt.delete(o),bt.set(o,l);return}bt.delete(o),wt.set(o,l)}function io(o){let l=wt.get(o);if(l)return l;let d=bt.get(o);if(!d)return;if(!t(d))return d;let f=d(),p=(async()=>{try{let m=await f;return wt.set(o,m),bt.delete(o),m}catch(m){throw bt.set(o,d),m}})();return bt.set(o,p),p}async function $u(o,l,d,f){if(o.body&&o.$src)throw Error(`Jx: '${d}' declares both body and $src — these are mutually exclusive`);if(!o.body&&!o.$src){let h=Yr(o),y=Function(...h,"");return Object.defineProperty(y,"name",{configurable:!0,value:o.name??d}),y}let p;if(e(o.body)){let h=Yr(o);p=Function(...h,o.body),Object.defineProperty(p,"name",{configurable:!0,value:o.name??d})}else{let h=o.$src;if(!h)throw Error(`Jx: '${d}' has neither body nor $src`);let y=o.$export??d,E,A=io(h);if(A instanceof Promise)E=await A;else if(A)E=A;else E=await Ru(h,f),wt.set(h,E);let T=E[y]??E.default?.[y];if(!t(T))throw TypeError(`Jx: export "${y}" not found or not a function in "${h}"`);p=T}let m=(o.parameters??o.arguments??[]).length>0,g=!1;if(!m)g=e(o.body)?D(o.body):p.length<=1&&D(p.toString());if(g)return Vt(()=>p(l));return p}function Yr(o){let l=o.parameters?W(o.parameters):o.arguments??[];return l.length>0&&l[0]==="state"?l:["state",...l]}var Qt=new Set(["$schema","$id","$defs","state","$ref","$props","$elements","$title","$description","$switch","$prototype","$src","$export","$media","$map","timing","default","description","body","parameters","arguments","name","tagName","children","style","attributes","items","map","filter","sort","cases","observedAttributes"]);function so(o){let l=Object.create(o);return new Proxy(l,{set(d,f,p){if(Object.hasOwn(d,f))return Reflect.set(d,f,p);if(f in o)return Reflect.set(o,f,p);return Vn(d,f,p),!0}})}function Vn(o,l,d){Object.defineProperty(o,l,{configurable:!0,enumerable:!0,value:d,writable:!0})}function Wn(o){return o.$media??{}}function Bn(o){return o}function Ou(o){let l=Bn(o)._state;return n(l)?l:null}function Mu(o){return t(o)}var hs=new Set,ku="http://www.w3.org/2000/svg",Ju="http://www.w3.org/1998/Math/MathML";function Du(o,l){if(o==="svg")return ku;if(o==="math")return Ju;return l??null}function Ne(o,l,d){let f=d?._path??[];if(e(o)||s(o)||x(o)){let T=document.createTextNode(String(o));if(a(o))Zt(o,()=>{T.textContent=Xe(o,l)},()=>{T.textContent=""});return T}let p=l;for(let[T,C]of Object.entries(o))if(T.startsWith("$")&&!Qt.has(T)){if(p===l)p=so(l);Vn(p,T,r(C)?Ee(C.$ref,l):C)}if("$ref"in o&&!o.tagName){let T=String(o.$ref??"");if(!hs.has(T))hs.add(T),console.warn(`Jx: a $ref child ("${T}") is not a supported component instance; register the `+"component in $elements and use its custom-element tag instead (spec §13).")}let m=co(o.tagName,p),g=m.includes("-")&&customElements.get(m);if(o.$props&&g)return Cs(o,p,d,f);if(o.$props){if(m.includes("-"))return Cs(o,p,d,f);let{$props:T,...C}=o;return Ne(C,od(o,p),d)}if(o.$switch)return Ku(o,p,d);let h=Du(m,d?._ns),y=m==="foreignObject"?null:h,E=h?document.createElementNS(h,m):document.createElement(m);if(d?.onNodeCreated)d.onNodeCreated(E,f,o,p);if(ao(E,o,p),o.style&&m.includes("-"))lo.set(E,o.style);Kn(E,o.style??{},Wn(p),p),qn(E,o.attributes??{},p);let A=o.children;if(S(A)){let T=d||y?{...d,_ns:y,_path:[...f,"children"]}:void 0;Xr(E,A,p,T)}else if(Array.isArray(A))for(let T=0;T<A.length;T++){let C=A[T],L=d||y?{...d,_ns:y,_path:[...f,"children",T]}:void 0;if(S(C))Xr(E,C,p,L);else E.append(Ne(C,p,L))}else if(a(A))_u(E,A,p,{...d,_ns:y,_path:[...f,"children"]});return E}function _u(o,l,d,f){let p=f._path??[],m=null,g=()=>{o.replaceChildren(),m?.stop(),m=null};Zt(l,()=>{let h=oo(l,d);if(g(),!Array.isArray(h))return;let y=rt(!0);m=y,ht();try{y.run(()=>{for(let[E,A]of h.entries())o.append(Ne(A,d,{...f,_path:[...p,E]}))})}finally{gt()}},g),Ht(()=>m?.stop(),!0)}function ao(o,l,d){for(let[f,p]of Object.entries(l)){if(Qt.has(f))continue;if(f.startsWith("$"))continue;if(f.startsWith("on")&&ea(o,f,p,d))continue;ta(o,f,p,d)}}function ea(o,l,d,f){let p=l.slice(2),m=f;if(r(d)){let g=Ee(d.$ref,f);if(Mu(g))o.addEventListener(p,(h)=>g(m,h));return!0}if(P(d)){let{body:g}=d;return o.addEventListener(p,(h)=>{xt(g,m,h)}),!0}if(v(d)&&e(d.body)){let g=Yr(d),h=Function(...g,d.body);return o.addEventListener(p,(y)=>h(m,y)),!0}if(b(d)){let g=d.$expression;return o.addEventListener(p,(h)=>Ae(g,m,h)),!0}return!1}function Lu(o,l,d){for(let[f,p]of Object.entries(l))if(f.startsWith("on")&&!Qt.has(f))ea(o,f,p,d)}function ta(o,l,d,f){let p=Bn(o),m=wu(l,d,f);if(m)o.dataset.jxBoundProp=m;let g=(y)=>e(y)?no(o.tagName,l,y):y,h=(y)=>{let E=o;if(l==="className"&&!(E instanceof HTMLElement)){E.setAttribute("class",y==null?"":String(y));return}if(p[l]===y)return;p[l]=y};if(r(d)){let y=d;if(l==="id"){p[l]=Ee(y.$ref,f);return}we(()=>{h(g(Ee(y.$ref,f)))});return}if(a(d)){let y=d;Zt(y,()=>{h(g(Xe(y,f)))});return}h(g(d))}function gs(o,l){let d=[];return{detach:l,insert(f){let p=[];for(let g of f){let h=o.cssRules.length;try{o.insertRule(g,h)}catch{continue}let y=o.cssRules[h];if(y)p.push(y)}let m={rules:p,texts:f};return d.push(m),m},remove(f){let p=d.indexOf(f);if(p!==-1)d.splice(p,1);if(f.rules.length===0)return;let m=[...o.cssRules],g=f.rules.map((h)=>m.indexOf(h)).filter((h)=>h>=0).toSorted((h,y)=>y-h);for(let h of g)o.deleteRule(h);f.rules.length=0},replaceAll(f){d.length=0,d.push({rules:[],texts:f}),o.replaceSync(f.join(`
|
|
3
3
|
`))},text(){return d.flatMap((f)=>f.texts.join(`
|
|
4
4
|
`)).join(`
|
|
5
|
-
`)}}}function
|
|
5
|
+
`)}}}function Iu(o){let l=[],d=()=>{o.textContent=l.map((f)=>f.texts.join(`
|
|
6
6
|
`)).join(`
|
|
7
|
-
`)};return{detach(){o.remove()},insert(f){let p={rules:[],texts:f};return l.push(p),d(),p},remove(f){let p=l.indexOf(f);if(p!==-1)l.splice(p,1),d()},replaceAll(f){l.length=0,l.push({rules:[],texts:f}),d()},text(){return o.textContent}}}function Xs(o){let d=o.defaultView?.CSSStyleSheet;if(t(d)&&Array.isArray(o.adoptedStyleSheets))try{let p=new d;return o.adoptedStyleSheets=[...o.adoptedStyleSheets,p],fs(p,()=>{o.adoptedStyleSheets=o.adoptedStyleSheets.filter((m)=>m!==p)})}catch{}let f=o.createElement("style");return f.dataset.jxSheet="",(Mu(o)??o.documentElement).append(f),f.sheet?fs(f.sheet,()=>f.remove()):Ou(f)}function Mu(o){return o.head}var Yt=new WeakMap;function ku(o){let l=Yt.get(o);if(l)return l;let d={hoisted:new Map,interned:new Map,scratch:null,scratchOwners:new Map,serial:0,shared:Xs(o)};return Yt.set(o,d),d}var Jn=new WeakMap,ps="\x01jx-scope\x01";function Zs(o){o.scratch.replaceAll([...o.scratchOwners.values()].flat())}function ms(o,l,d){let f=l.get(d);if(f.refs-=1,f.refs<=0)l.delete(d),o.shared.remove(f.inserted)}function hs(o,l,d,f){let p=l.get(d);if(p){p.refs+=1;return}l.set(d,{inserted:o.shared.insert(f),refs:1})}function _n(o,l){let d=Jn.get(o);if(!d||l!==void 0&&d!==l)return;Jn.delete(o),d.stop?.();for(let p of d.vars)o.style.removeProperty(p);if(delete o.dataset.jx,Yt.get(d.doc)!==d.state)return;let{state:f}=d;if(d.interned===null){if(f.scratchOwners.delete(o))Zs(f)}else ms(f,f.interned,d.interned);for(let p of d.hoisted)ms(f,f.hoisted,p)}function Qs(o=document){let l=Yt.get(o);if(!l)return;Yt.delete(o);for(let d of l.scratchOwners.keys())Jn.delete(d),delete d.dataset.jx;l.scratchOwners.clear(),l.interned.clear(),l.hoisted.clear(),l.shared.detach(),l.scratch?.detach()}function Ju(o){return n(o)&&"display"in o}var oo=new WeakMap;function ea(o,l){if(!l)return o;let d={...o};for(let[f,p]of Object.entries(l)){let m=d[f];d[f]=F(p)&&n(m)?ea(Array.isArray(m)?Object.fromEntries(Object.entries(m)):m,p):p}return d}function Wn(o,l,d={},f={}){ta(o,l,d,f,!1)}function Bn(o,l,d={},f={}){ta(o,l??{},d,f,!0)}function ta(o,l,d,f,p){_n(o);let m=o.ownerDocument,g=ku(m),h=(Yr||Xr)&&Kr(o)?(_)=>kr(_,{dialog:o.tagName==="DIALOG"}):(_)=>_,y=-1,E=0,A=[],T=Ut(l,{mediaQueries:d,resolveValue:(_,Y,U)=>{if(U==="self"&&_.startsWith("--"))return A.push({name:_,value:Y}),null;let G;if(U==="self")G=`--jx-s${E}`;else{if(y<0)({serial:y}=g),g.serial+=1;G=`--jx-r${y}-${E}`}return E+=1,A.push({name:G,value:Y}),`var(${G})`},scope:ps,transposeSelector:h,transposeValue:Mn});if(T.length===0&&A.length===0)return;let C=T.filter((_)=>_.target!=="unscoped"),H=T.filter((_)=>_.target==="unscoped");for(let _ of H)hs(g,g.hoisted,_.text,[_.text]);let M=`jx-${Wt(C.map((_)=>_.key).join("|"))}`,K=C.map((_)=>_.text.replaceAll(ps,`[data-jx="${M}"]`));if(K.length>0)if(o.dataset.jx=M,p)g.scratch??=Xs(m),g.scratchOwners.set(o,K),Zs(g);else hs(g,g.interned,M,K);let L={doc:m,hoisted:H.map((_)=>_.text),interned:K.length>0&&!p?M:null,state:g,stop:null,uid:M,vars:A.map((_)=>_.name)};if(A.length>0){let _=rt();_.run(()=>{for(let{name:Y,value:U}of A)we(()=>{let G=r(U)?ve(U.$ref,f):Ye(U,f);o.style.setProperty(Y,Mn(String(G??"")))})}),L.stop=()=>_.stop()}Jn.set(o,L),jt(()=>_n(o,L),!0)}var _u=new Set(["contenteditable","draggable","spellcheck"]);function Du(o,l){let d=o.toLowerCase();if(d.startsWith("aria-")||_u.has(d))return String(l);return l?"":null}function Kn(o,l,d){for(let[f,p]of Object.entries(l)){let m=lu(o,f),g=(h)=>{if(h===null||h===void 0){o.removeAttribute(m);return}if(x(h)){let y=Du(m,h);if(y===null)o.removeAttribute(m);else o.setAttribute(m,y);return}o.setAttribute(m,Zr(o.tagName,f,String(h)))};if(r(p))we(()=>g(ve(p.$ref,d)));else if(a(p))Xt(p,()=>g(eo(p,d)));else g(p)}}function qr(o,l,d,f){let p=f?._path??[],m=document.createComment("jx-array");o.append(m);let{items:g,map:h,filter:y,sort:E,key:A}=l,T=r(A)?A.$ref:null,C=vt,H=!1,M=(B)=>{if(!H)H=!0,console.warn(`Jx $map: ${B}`)},K=[],L=(B)=>{B.node.remove(),B.scope.stop()},_=(B,q,X)=>{let ce=Ni({index:X,item:q}),ee=no(d);ee.$map=ce,Object.defineProperty(ee,"$map/item",{enumerable:!0,get:()=>ce.item}),Object.defineProperty(ee,"$map/index",{enumerable:!0,get:()=>ce.index});let re=rt(!0),be=f?{...f,_path:[...p,"map",X]}:void 0,V=re.run(()=>Ne(h,ee,be));return{key:B,map:ce,node:V,scope:re}},Y=(B,q)=>{let X=new Map;for(let re of K)X.set(re.key,re);let ce=[];for(let re=0;re<B.length;re++){let be=q[re],V=B[re],N=X.get(be);if(N){if(X.delete(be),N.map.item!==V)N.map.item=V;if(N.map.index!==re)N.map.index=re,f?.onNodeMoved?.(N.node,[...p,"map",re]);ce.push(N)}else ce.push(_(be,V,re))}for(let re of X.values())L(re);let ee=K.find((re)=>!X.has(re.key))?.node??m;for(let re of ce){if(re.node===ee){ee=ee.nextSibling??m;continue}ee.before(re.node)}K=ce},U=()=>{let B=r(g)?ve(g.$ref,d):g;if(Array.isArray(B)&&r(y)){let ee=ve(y.$ref,d);if(t(ee))B=B.filter(ee)}if(Array.isArray(B)&&r(E)){let ee=ve(E.$ref,d);if(t(ee)){let re=ee;B=[...B].toSorted(re)}}let q=Array.isArray(B)&&h?B:[],X=q.map((ee,re)=>Lu(T,ee,re,M)),ce=new Set;for(let ee=0;ee<X.length;ee++)if(ce.has(X[ee]))M(`duplicate key ${String(X[ee])} — every occurrence after the first is rebuilt on each change`),X[ee]={duplicate:ee};else ce.add(X[ee]);ht();try{In(zr(C),()=>Y(q,X))}finally{gt()}},G=!1,ne=!1,k=we(U,{scheduler:()=>{if(G)return;G=!0,queueMicrotask(()=>{if(G=!1,!ne)k()})}});jt(()=>{ne=!0;for(let B of K)L(B);K=[]},!0)}function Lu(o,l,d,f){if(o===null)return d;if(o==="$map/item")return l;if(o.startsWith("$map/item/")){let p=he(l,o.slice(10));if(p===void 0||p===null)return f(`key "${o}" is empty for some items — those rows fall back to their index`),d;return p}return f(`key "${o}" is not a $map/item pointer — rows fall back to their index`),d}function io(o,l){if(e(o))return o;if(!J(o))return"div";let d=o.$expression;if(d.operator==="?:")return ot(d.target,l,null)?d.value:d.initial;let f=ot(d.target,l,null);return d.cases[String(f)]??d.default}function Iu(o,l,d){let f=d?._path??[],p=document.createElement(io(o.tagName,l)),m=vt;if(d?.onNodeCreated)d.onNodeCreated(p,f,o,l);ro(p,o,l),Wn(p,o.style??{},Fn(l),l),Kn(p,o.attributes??{},l);let g=0,h=null,y=null,E=()=>{h?.stop(),h=null};return we(()=>{if(!r(o.$switch)){p.replaceChildren(),E(),g+=1;return}let A=String(ve(o.$switch.$ref,l));if(A===y)return;y=A,p.replaceChildren(),E(),g+=1;let T=o.cases?.[A];if(!T)return;let C=g,H=rt(!0);h=H;let M=d?{...d,_path:[...f,"cases",A]}:void 0;if(r(T)){let{href:K}=new URL(T.$ref,d?._ctx?.base??location.href);Gr(K,d?._ctx).then(async(L)=>{if(C!==g)return;let _=await Hn(L,{},K,d?._ctx);if(C!==g)return;p.replaceChildren(),In(zr(m),()=>H.run(()=>p.append(Ne(L,_,M))))}).catch((L)=>console.error("Jx $switch: failed to load external case",T.$ref,L));return}ht();try{In(zr(m),()=>H.run(()=>p.append(Ne(T,l,M))))}finally{gt()}}),jt(E,!0),p}var Dn=ze;async function ju(o,l,d,f,p){if(o.$src)return Fu(o,l,d,f);switch(o.$prototype){case"Request":{let m=ze(null),g=o.debounce??0,h=null;if(!o.manual&&!(p?.skipAutoRequests??Ns.skip))we(()=>{let y;if(a(o.url))y=Ye(o.url,l);else({url:y}=o);if(!y||y==="undefined"||y.includes("undefined"))return;let E=new AbortController;En(()=>{if(E.abort(),h!==null)clearTimeout(h)});let A=()=>{Qr(fetch(y,{method:o.method??"GET",signal:E.signal,...o.headers&&{headers:o.headers},...o.body&&{body:n(o.body)?JSON.stringify(o.body):o.body}}).then((T)=>T.ok?T.json():Promise.reject(T.statusText)).then((T)=>{m.value=T}).catch((T)=>{if(!(T instanceof Error&&T.name==="AbortError"))m.value={error:String(T)}}))};if(g>0)h=setTimeout(A,g);else A()});return m}case"URLSearchParams":return Ft(()=>{let m={};for(let[g,h]of Object.entries(o))if(g!=="$prototype")m[g]=r(h)?ve(h.$ref,l):a(h)?Ye(h,l):h;return new URLSearchParams(m).toString()});case"LocalStorage":case"SessionStorage":{let m=o.$prototype==="LocalStorage"?localStorage:sessionStorage,g=o.key??d,h;try{let E=m.getItem(g);h=E!==null?JSON.parse(E):o.default??null}catch{h=o.default??null}let y=Dn(h);return we(()=>{let E=y.value;if(E===null)try{m.removeItem(g)}catch{}else try{m.setItem(g,JSON.stringify(E))}catch{}}),y}case"Cookie":{let m=o.name??d,h=Dn((()=>{let y=rs(document.cookie,m);if(y===null)return null;try{return JSON.parse(decodeURIComponent(y))}catch{return y}})()??o.default??null);return we(()=>{document.cookie=os(m,h.value,o)}),h}case"IndexedDB":{let m=ze(null),{database:g,store:h,version:y=1,keyPath:E="id",autoIncrement:A=!0,indexes:T=[]}=o;if(!g||!h)throw Error(`Jx: IndexedDB entry '${d}' requires database and store`);let C=indexedDB.open(g,y);return C.addEventListener("upgradeneeded",(H)=>{let M=H.target.result;if(!M.objectStoreNames.contains(h)){let K=M.createObjectStore(h,{autoIncrement:A,keyPath:E});for(let L of T)K.createIndex(L.name,L.keyPath,{unique:L.unique??!1})}}),C.addEventListener("success",(H)=>{let M=H.target.result;m.value={database:g,getStore:(K="readwrite")=>Promise.resolve(M.transaction(h,K).objectStore(h)),isReady:!0,store:h,version:y}}),C.addEventListener("error",()=>{m.value={error:C.error?.message}}),m}case"Set":return new Set(Array.isArray(o.default)?o.default:[]);case"Map":return new Map(Object.entries(s(o.default)?o.default:{}));case"FormData":{let m=new FormData;for(let[g,h]of Object.entries(o.fields??{}))m.append(g,h);return m}case"Blob":{let m=o.parts;return new Blob(m??[],{type:e(o.type)?o.type:"text/plain"})}case"ReadableStream":return null;default:return console.warn(`Jx: unknown $prototype "${o.$prototype}" for "${d}". Did you mean to add '$src'?`),ze(null)}}var Hu=new Set(["$prototype","$src","$export","timing","default","description","body","parameters","arguments","name"]);function so(o){let l={};for(let[d,f]of Object.entries(o))if(!Hu.has(d))l[d]=f;return l}async function Fu(o,l,d,f){let p=o.$src;if(!p||!p.endsWith(".class.json"))throw Error(`Jx: $prototype "${o.$prototype}" requires a .class.json $src, got "${p}". Wrap the class in a .class.json schema with $implementation.`);return Wu(o,l,d,f)}async function Vu(o,l,d,f){let p,m=to(l);if(m instanceof Promise)p=await m;else if(m)p=m;else{try{p=await yt(l)}catch{if(f){let A=new URL(l,f).href;p=await yt(A)}else throw Error(`Failed to import "${l}"`)}wt.set(l,p)}let g=p[d]??p.default?.[d];if(!g)throw Error(`Jx: export "${d}" not found in "${l}"`);if(!t(g))throw TypeError(`Jx: "${d}" from "${l}" is not a class`);let h=new g(so(o)),y=t(h.resolve)?await h.resolve():("value"in h)?h.value:h,E=Dn(y);if(t(h.subscribe))h.subscribe((A)=>{E.value=A});return E}async function Wu(o,l,d,f){let p=o.$src,m;if(!p.startsWith(".")&&!p.startsWith("/")&&!p.startsWith("http")&&!p.startsWith("file:"))return Rn(o,l,d,f);try{let T=f?new URL(p,f).href:p,C=await fetch(T);if(!C.ok)throw Error(`HTTP ${C.status}`);m=await C.json()}catch{return Rn(o,l,d,f)}if(m.$implementation){if(JSON.stringify(m).includes('"#/$context/'))return Rn(o,l,d,f);let C=f?new URL(p,f).href:new URL(p,location.href).href,H=new URL(m.$implementation,C).href,M=o.$export??m.title??o.$prototype;try{return await Vu(o,H,M,f)}catch{return Rn(o,l,d,f)}}let y=new(Ku(m))(so(o)),E=t(y.resolve)?await y.resolve():("value"in y)?y.value:y,A=Dn(E);if(t(y.subscribe))y.subscribe((T)=>{A.value=T});return A}function Bu(o){return n(o)}function Ku(o){let l=o.$defs?.fields??{},d=o.$defs?.constructor,f=Bu(d)?d:void 0,p=o.$defs?.methods??{};class m{constructor(g={}){for(let[h,y]of Object.entries(l)){let E=y.identifier??h,A=y.access==="private"?`_${E}`:E;if(g[E]!==void 0)this[A]=g[E];else if(y.initializer!==void 0)this[A]=y.initializer;else if(y.default!==void 0)this[A]=structuredClone(y.default);else this[A]=null}if(f?.body){let h=Array.isArray(f.body)?f.body.join(`
|
|
7
|
+
`)};return{detach(){o.remove()},insert(f){let p={rules:[],texts:f};return l.push(p),d(),p},remove(f){let p=l.indexOf(f);if(p!==-1)l.splice(p,1),d()},replaceAll(f){l.length=0,l.push({rules:[],texts:f}),d()},text(){return o.textContent}}}function na(o){let d=o.defaultView?.CSSStyleSheet;if(t(d)&&Array.isArray(o.adoptedStyleSheets))try{let p=new d;return o.adoptedStyleSheets=[...o.adoptedStyleSheets,p],gs(p,()=>{o.adoptedStyleSheets=o.adoptedStyleSheets.filter((m)=>m!==p)})}catch{}let f=o.createElement("style");return f.dataset.jxSheet="",(ju(o)??o.documentElement).append(f),f.sheet?gs(f.sheet,()=>f.remove()):Iu(f)}function ju(o){return o.head}var Xt=new WeakMap;function Hu(o){let l=Xt.get(o);if(l)return l;let d={hoisted:new Map,interned:new Map,scratch:null,scratchOwners:new Map,serial:0,shared:na(o)};return Xt.set(o,d),d}var Dn=new WeakMap,xs="\x01jx-scope\x01";function ra(o){o.scratch.replaceAll([...o.scratchOwners.values()].flat())}function ys(o,l,d){let f=l.get(d);if(f.refs-=1,f.refs<=0)l.delete(d),o.shared.remove(f.inserted)}function bs(o,l,d,f){let p=l.get(d);if(p){p.refs+=1;return}l.set(d,{inserted:o.shared.insert(f),refs:1})}function _n(o,l){let d=Dn.get(o);if(!d||l!==void 0&&d!==l)return;Dn.delete(o),d.stop?.();for(let p of d.vars)o.style.removeProperty(p);if(delete o.dataset.jx,Xt.get(d.doc)!==d.state)return;let{state:f}=d;if(d.interned===null){if(f.scratchOwners.delete(o))ra(f)}else ys(f,f.interned,d.interned);for(let p of d.hoisted)ys(f,f.hoisted,p)}function oa(o=document){let l=Xt.get(o);if(!l)return;Xt.delete(o);for(let d of l.scratchOwners.keys())Dn.delete(d),delete d.dataset.jx;l.scratchOwners.clear(),l.interned.clear(),l.hoisted.clear(),l.shared.detach(),l.scratch?.detach()}function Fu(o){return n(o)&&"display"in o}var lo=new WeakMap;function ia(o,l){if(!l)return o;let d={...o};for(let[f,p]of Object.entries(l)){let m=d[f];d[f]=F(p)&&n(m)?ia(Array.isArray(m)?Object.fromEntries(Object.entries(m)):m,p):p}return d}function Kn(o,l,d={},f={}){sa(o,l,d,f,!1)}function Un(o,l,d={},f={}){sa(o,l??{},d,f,!0)}function sa(o,l,d,f,p){_n(o);let m=o.ownerDocument,g=Hu(m),h=(eo||to)&&Gr(o)?(k)=>_r(k,{dialog:o.tagName==="DIALOG"}):(k)=>k,y=-1,E=0,A=[],T=qt(l,{mediaQueries:d,resolveValue:(k,Y,U)=>{if(U==="self"&&k.startsWith("--"))return A.push({name:k,value:Y}),null;let G;if(U==="self")G=`--jx-s${E}`;else{if(y<0)({serial:y}=g),g.serial+=1;G=`--jx-r${y}-${E}`}return E+=1,A.push({name:G,value:Y}),`var(${G})`},scope:xs,transposeSelector:h,transposeValue:kn});if(T.length===0&&A.length===0)return;let C=T.filter((k)=>k.target!=="unscoped"),L=T.filter((k)=>k.target==="unscoped");for(let k of L)bs(g,g.hoisted,k.text,[k.text]);let O=`jx-${Bt(C.map((k)=>k.key).join("|"))}`,K=C.map((k)=>k.text.replaceAll(xs,`[data-jx="${O}"]`));if(K.length>0)if(o.dataset.jx=O,p)g.scratch??=na(m),g.scratchOwners.set(o,K),ra(g);else bs(g,g.interned,O,K);let _={doc:m,hoisted:L.map((k)=>k.text),interned:K.length>0&&!p?O:null,state:g,stop:null,uid:O,vars:A.map((k)=>k.name)};if(A.length>0){let k=rt();k.run(()=>{for(let{name:Y,value:U}of A)we(()=>{let G=r(U)?Ee(U.$ref,f):Xe(U,f);o.style.setProperty(Y,kn(String(G??"")))})}),_.stop=()=>k.stop()}Dn.set(o,_),Ht(()=>_n(o,_),!0)}var Vu=new Set(["contenteditable","draggable","spellcheck"]);function Wu(o,l){let d=o.toLowerCase();if(d.startsWith("aria-")||Vu.has(d))return String(l);return l?"":null}function qn(o,l,d){for(let[f,p]of Object.entries(l)){let m=hu(o,f),g=(h)=>{if(h===null||h===void 0){o.removeAttribute(m);return}if(x(h)){let y=Wu(m,h);if(y===null)o.removeAttribute(m);else o.setAttribute(m,y);return}o.setAttribute(m,no(o.tagName,f,String(h)))};if(r(p))we(()=>g(Ee(p.$ref,d)));else if(a(p))Zt(p,()=>g(oo(p,d)));else g(p)}}function Xr(o,l,d,f){let p=f?._path??[],m=document.createComment("jx-array");o.append(m);let{items:g,map:h,filter:y,sort:E,key:A}=l,T=r(A)?A.$ref:null,C=vt,L=!1,O=(B)=>{if(!L)L=!0,console.warn(`Jx $map: ${B}`)},K=[],_=(B)=>{B.node.remove(),B.scope.stop()},k=(B,q,X)=>{let ce=Mi({index:X,item:q}),ee=so(d);Vn(ee,"$map",ce),Object.defineProperty(ee,"$map/item",{enumerable:!0,get:()=>ce.item}),Object.defineProperty(ee,"$map/index",{enumerable:!0,get:()=>ce.index});let re=rt(!0),be=f?{...f,_path:[...p,"map",X]}:void 0,j=re.run(()=>Ne(h,ee,be));return{key:B,map:ce,node:j,scope:re}},Y=(B,q)=>{let X=new Map;for(let re of K)X.set(re.key,re);let ce=[];for(let re=0;re<B.length;re++){let be=q[re],j=B[re],R=X.get(be);if(R){if(X.delete(be),R.map.item!==j)R.map.item=j;if(R.map.index!==re)R.map.index=re,f?.onNodeMoved?.(R.node,[...p,"map",re]);ce.push(R)}else ce.push(k(be,j,re))}for(let re of X.values())_(re);let ee=K.find((re)=>!X.has(re.key))?.node??m;for(let re of ce){if(re.node===ee){ee=ee.nextSibling??m;continue}ee.before(re.node)}K=ce},U=()=>{let B=r(g)?Ee(g.$ref,d):g;if(Array.isArray(B)&&r(y)){let ee=Ee(y.$ref,d);if(t(ee))B=B.filter(ee)}if(Array.isArray(B)&&r(E)){let ee=Ee(E.$ref,d);if(t(ee)){let re=ee;B=[...B].toSorted(re)}}let q=Array.isArray(B)&&h?B:[],X=q.map((ee,re)=>Bu(T,ee,re,O)),ce=new Set;for(let ee=0;ee<X.length;ee++)if(ce.has(X[ee]))O(`duplicate key ${String(X[ee])} — every occurrence after the first is rebuilt on each change`),X[ee]={duplicate:ee};else ce.add(X[ee]);ht();try{jn(Zr(C),()=>Y(q,X))}finally{gt()}},G=!1,ne=!1,M=we(U,{scheduler:()=>{if(G)return;G=!0,queueMicrotask(()=>{if(G=!1,!ne)M()})}});Ht(()=>{ne=!0;for(let B of K)_(B);K=[]},!0)}function Bu(o,l,d,f){if(o===null)return d;if(o==="$map/item")return l;if(o.startsWith("$map/item/")){let p=ge(l,o.slice(10));if(p===void 0||p===null)return f(`key "${o}" is empty for some items — those rows fall back to their index`),d;return p}return f(`key "${o}" is not a $map/item pointer — rows fall back to their index`),d}function co(o,l){if(e(o))return o;if(!J(o))return"div";let d=o.$expression;if(d.operator==="?:")return ot(d.target,l,null)?d.value:d.initial;let f=ot(d.target,l,null);return d.cases[String(f)]??d.default}function Ku(o,l,d){let f=d?._path??[],p=document.createElement(co(o.tagName,l)),m=vt;if(d?.onNodeCreated)d.onNodeCreated(p,f,o,l);ao(p,o,l),Kn(p,o.style??{},Wn(l),l),qn(p,o.attributes??{},l);let g=0,h=null,y=null,E=()=>{h?.stop(),h=null};return we(()=>{if(!r(o.$switch)){p.replaceChildren(),E(),g+=1;return}let A=String(Ee(o.$switch.$ref,l));if(A===y)return;y=A,p.replaceChildren(),E(),g+=1;let T=o.cases?.[A];if(!T)return;let C=g,L=rt(!0);h=L;let O=d?{...d,_path:[...f,"cases",A]}:void 0;if(r(T)){let{href:K}=new URL(T.$ref,d?._ctx?.base??location.href);Qr(K,d?._ctx).then(async(_)=>{if(C!==g)return;let k=await Fn(_,{},K,d?._ctx);if(C!==g)return;p.replaceChildren(),jn(Zr(m),()=>L.run(()=>p.append(Ne(_,k,O))))}).catch((_)=>console.error("Jx $switch: failed to load external case",T.$ref,_));return}ht();try{jn(Zr(m),()=>L.run(()=>p.append(Ne(T,l,O))))}finally{gt()}}),Ht(E,!0),p}var Ln=Ge;async function Uu(o,l,d,f,p){if(o.$src)return zu(o,l,d,f);switch(o.$prototype){case"Request":{let m=Ge(null),g=o.debounce??0,h=null;if(!o.manual&&!(p?.skipAutoRequests??ks.skip))we(()=>{let y;if(a(o.url))y=Xe(o.url,l);else({url:y}=o);if(!y||y==="undefined"||y.includes("undefined"))return;let E=new AbortController;wn(()=>{if(E.abort(),h!==null)clearTimeout(h)});let A=()=>{ro(fetch(y,{method:o.method??"GET",signal:E.signal,...o.headers&&{headers:o.headers},...o.body&&{body:n(o.body)?JSON.stringify(o.body):o.body}}).then((T)=>T.ok?T.json():Promise.reject(T.statusText)).then((T)=>{m.value=T}).catch((T)=>{if(!(T instanceof Error&&T.name==="AbortError"))m.value={error:String(T)}}))};if(g>0)h=setTimeout(A,g);else A()});return m}case"URLSearchParams":return Vt(()=>{let m={};for(let[g,h]of Object.entries(o))if(g!=="$prototype")m[g]=r(h)?Ee(h.$ref,l):a(h)?Xe(h,l):h;return new URLSearchParams(m).toString()});case"LocalStorage":case"SessionStorage":{let m=o.$prototype==="LocalStorage"?localStorage:sessionStorage,g=o.key??d,h;try{let E=m.getItem(g);h=E!==null?JSON.parse(E):o.default??null}catch{h=o.default??null}let y=Ln(h);return we(()=>{let E=y.value;if(E===null)try{m.removeItem(g)}catch{}else try{m.setItem(g,JSON.stringify(E))}catch{}}),y}case"Cookie":{let m=o.name??d,h=Ln((()=>{let y=as(document.cookie,m);if(y===null)return null;try{return JSON.parse(decodeURIComponent(y))}catch{return y}})()??o.default??null);return we(()=>{document.cookie=ls(m,h.value,o)}),h}case"IndexedDB":{let m=Ge(null),{database:g,store:h,version:y=1,keyPath:E="id",autoIncrement:A=!0,indexes:T=[]}=o;if(!g||!h)throw Error(`Jx: IndexedDB entry '${d}' requires database and store`);let C=indexedDB.open(g,y);return C.addEventListener("upgradeneeded",(L)=>{let O=L.target.result;if(!O.objectStoreNames.contains(h)){let K=O.createObjectStore(h,{autoIncrement:A,keyPath:E});for(let _ of T)K.createIndex(_.name,_.keyPath,{unique:_.unique??!1})}}),C.addEventListener("success",(L)=>{let O=L.target.result;m.value={database:g,getStore:(K="readwrite")=>Promise.resolve(O.transaction(h,K).objectStore(h)),isReady:!0,store:h,version:y}}),C.addEventListener("error",()=>{m.value={error:C.error?.message}}),m}case"Set":return new Set(Array.isArray(o.default)?o.default:[]);case"Map":return new Map(Object.entries(i(o.default)?o.default:{}));case"FormData":{let m=new FormData;for(let[g,h]of Object.entries(o.fields??{}))m.append(g,h);return m}case"Blob":{let m=o.parts;return new Blob(m??[],{type:e(o.type)?o.type:"text/plain"})}case"ReadableStream":return null;default:return console.warn(`Jx: unknown $prototype "${o.$prototype}" for "${d}". Did you mean to add '$src'?`),Ge(null)}}var qu=new Set(["$prototype","$src","$export","timing","default","description","body","parameters","arguments","name"]);function uo(o){let l={};for(let[d,f]of Object.entries(o))if(!qu.has(d))l[d]=f;return l}async function zu(o,l,d,f){let p=o.$src;if(!p||!p.endsWith(".class.json"))throw Error(`Jx: $prototype "${o.$prototype}" requires a .class.json $src, got "${p}". Wrap the class in a .class.json schema with $implementation.`);return Yu(o,l,d,f)}async function Gu(o,l,d,f){let p,m=io(l);if(m instanceof Promise)p=await m;else if(m)p=m;else{try{p=await yt(l)}catch{if(f){let A=new URL(l,f).href;p=await yt(A)}else throw Error(`Failed to import "${l}"`)}wt.set(l,p)}let g=p[d]??p.default?.[d];if(!g)throw Error(`Jx: export "${d}" not found in "${l}"`);if(!t(g))throw TypeError(`Jx: "${d}" from "${l}" is not a class`);let h=new g(uo(o)),y=t(h.resolve)?await h.resolve():("value"in h)?h.value:h,E=Ln(y);if(t(h.subscribe))h.subscribe((A)=>{E.value=A});return E}async function Yu(o,l,d,f){let p=o.$src,m;if(!p.startsWith(".")&&!p.startsWith("/")&&!p.startsWith("http")&&!p.startsWith("file:"))return $n(o,l,d,f);try{let T=f?new URL(p,f).href:p,C=await fetch(T);if(!C.ok)throw Error(`HTTP ${C.status}`);m=await C.json()}catch{return $n(o,l,d,f)}if(m.$implementation){if(JSON.stringify(m).includes('"#/$context/'))return $n(o,l,d,f);let C=f?new URL(p,f).href:new URL(p,location.href).href,L=new URL(m.$implementation,C).href,O=o.$export??m.title??o.$prototype;try{return await Gu(o,L,O,f)}catch{return $n(o,l,d,f)}}let y=new(Zu(m))(uo(o)),E=t(y.resolve)?await y.resolve():("value"in y)?y.value:y,A=Ln(E);if(t(y.subscribe))y.subscribe((T)=>{A.value=T});return A}function Xu(o){return n(o)}function Zu(o){let l=o.$defs?.fields??{},d=o.$defs?.constructor,f=Xu(d)?d:void 0,p=o.$defs?.methods??{};class m{constructor(g={}){for(let[h,y]of Object.entries(l)){let E=y.identifier??h,A=y.access==="private"?`_${E}`:E;if(g[E]!==void 0)this[A]=g[E];else if(y.initializer!==void 0)this[A]=y.initializer;else if(y.default!==void 0)this[A]=structuredClone(y.default);else this[A]=null}if(f?.body){let h=Array.isArray(f.body)?f.body.join(`
|
|
8
8
|
`):f.body;Function("config",h).call(this,g)}}}for(let[g,h]of Object.entries(p)){let y=h.identifier??g,E=(h.parameters??[]).map((T)=>{if(T.$ref)return T.$ref.split("/").pop()??"";let C=T.identifier??T.name;return e(C)?C:"arg"}),A=Array.isArray(h.body)?h.body.join(`
|
|
9
|
-
`):h.body??"";if(h.role==="accessor"){let T={};if(h.getter)T.get=Function(h.getter.body??"");if(h.setter){let C=(h.setter.parameters??[]).map((H)=>H.$ref?.split("/").pop()??"v");T.set=Function(...C,h.setter.body??"")}Object.defineProperty(m.prototype,y,{...T,configurable:!0})}else if(h.scope==="static")m[y]=Function(...E,A);else m.prototype[y]=Function(...E,A)}return Object.defineProperty(m,"name",{configurable:!0,value:o.title}),m}async function Rn(o,l,d,f){let p=so(o),m=Object.values(p).some((E)=>a(E)),g=(E)=>fetch(Os("/__jx_resolve__"),{body:JSON.stringify({$base:f,$export:o.$export,$prototype:o.$prototype,$src:o.$src,...E}),headers:{"Content-Type":"application/json"},method:"POST"}).then((A)=>{if(!A.ok)throw Error(`Jx dev proxy ${A.status} for "${d}"`);return A.json()}),h=ze(null),y=(E)=>{Qr(g(E).then((A)=>{h.value=A}).catch((A)=>console.error("Jx dev proxy:",A)))};if(m)we(()=>{let E={};for(let[A,T]of Object.entries(p))E[A]=a(T)?Ye(T,l):T;y(E)});else y(p);return h}function na(o,l,d){let f=0;return(p)=>{f+=1;let m=f;Qr(new Promise((g)=>{g(l(p))}).then((g)=>{if(m===f)o.value=g}).catch((g)=>{if(m===f)console.error(d,g)}))}}async function Uu(o,l,d,f){let{$src:p,$export:m}=o,g=qs.has(p)?to(p):void 0;if(!g)return qu(o,l,d,f);let h=g instanceof Promise?await g:g,y=h[m]??h.default?.[m];if(!y)throw Error(`Jx: export "${m}" not found in "${p}" for "${d}"`);if(!t(y))throw TypeError(`Jx: "${m}" from "${p}" is not a function`);let E=y,A=o.arguments??{},T=Object.values(A).some((M)=>r(M)),C=()=>{let M={};for(let[K,L]of Object.entries(A))M[K]=r(L)?ve(L.$ref,l):L;return M},H=ze(null);if(T){let M=na(H,E,"Jx server function:");we(()=>{let K=C();En(()=>{}),M(K)})}else H.value=await E(C());return H}async function qu(o,l,d,f){let p=o.arguments??{},m=Object.values(p).some((A)=>r(A)),g=()=>{let A={};for(let[T,C]of Object.entries(p))A[T]=r(C)?ve(C.$ref,l):C;return A},h=(A)=>fetch(Os("/__jx_server__"),{body:JSON.stringify({$base:f,$export:o.$export,$src:o.$src,arguments:A}),headers:{"Content-Type":"application/json"},method:"POST"}).then((T)=>{if(!T.ok)throw Error(`Jx server proxy ${T.status} for "${d}"`);return T.json()}),y=ze(null),E=na(y,h,"Jx server proxy:");if(m)we(()=>{let A=g();En(()=>{}),E(A)});else E(g());return y}function ve(o,l){if(!e(o))return o;if(o.startsWith("$map/")||o.startsWith("#/$map/")){let d=(o.startsWith("#/")?o.slice(2):o).split("/"),[,f]=d,m=l.$map?.[f]??l[`$map/${f}`];return d.length>2?he(m,d.slice(2).join("/")):m}if(o.startsWith("#/state/"))return he(l,o.slice(8));if(o.startsWith("parent#/"))return he(l,o.slice(8));if(o.startsWith("window#/"))return he(globalThis.window,o.slice(8));if(o.startsWith("document#/"))return he(globalThis.document,o.slice(10));return he(l,o)??null}function gs(o,l,d,f){let p=l.replaceAll(/-([a-z])/g,(g,h)=>h.toUpperCase()),m=o[p];if(x(m)){o[p]=d!==null&&d!=="false";return}if(d===null){let g=f?.get(p);o[p]=g===void 0?i(m)?0:"":g;return}o[p]=i(m)?Number(d):d}function xs(o){let l=new Map;for(let[d,f]of Object.entries(o.state??{})){if(n(f)){if("default"in f){l.set(d,f.default);continue}if(zu.some((p)=>(p in f)))continue}l.set(d,f)}return l}var zu=["$expression","$prototype","$ref","$src"],ys=new Set;function Gu(o,l){if(Object.hasOwn(o,l))return!0;if(o.hasAttribute(l))return!0;let d=l.replaceAll(/[A-Z]/gu,(f)=>`-${f.toLowerCase()}`);return d!==l&&o.hasAttribute(d)}function Yu(o,l){for(let d=Reflect.getPrototypeOf(o);d;d=Reflect.getPrototypeOf(d)){let f=Object.getOwnPropertyDescriptor(d,l);if(f)return f.set}return}function Ln(o,l){if(!w(o))return!1;let d=l===void 0?o:`${l}:${o}`;if(!ys.has(d))ys.add(d),console.warn(`Jx: "${o}" is private state (spec.md §5.6) and cannot be set through $props`+`${l===void 0?"":` (${l})`}. The write was ignored; rename the entry without the leading # to make it part of the component's interface.`);return!0}function Xu(o,l){let d=no(l);for(let[f,p]of Object.entries(o.$props??{})){if(Ln(f,"$props"))continue;d[f]=r(p)?ve(p.$ref,l):p}return d}var ra={},Gt=new Map;async function oa(o,l){let d=l??location.href,{tagName:f}=o;if(!f||!f.includes("-"))throw Error(`Jx redefineElement: tagName "${f}" must contain a hyphen`);if(!customElements.get(f)){await Qt(o,d);return}if(o.$elements)await ao(o.$elements,d);let p=Gt.get(f)?.doc.observedAttributes??[],m=o.observedAttributes??[];if(JSON.stringify(p)!==JSON.stringify(m))console.warn(`Jx redefineElement: <${f}> keeps observedAttributes [${p.join(", ")}] as first defined; [${m.join(", ")}] takes effect only in a fresh realm`);Gt.set(f,{base:d,doc:o})}function ia(o){ra=o??{}}async function ao(o,l,d){for(let f of o){if(e(f)){try{await import(f.startsWith("/")||f.startsWith(".")?f:`/node_modules/${f}`)}catch(g){console.warn(`Jx: failed to import package "${f}"`,g)}continue}if(!r(f))continue;let{href:p}=new URL(f.$ref,l),m=await Gr(p,d);if(!m.tagName||!m.tagName.includes("-"))continue;if(customElements.get(m.tagName))continue;if(m.$elements)await ao(m.$elements,p,d);await Qt(m,p)}}var bs=32,Zu={expansion:0,frames:[]},vt=Zu;function Wr(o,l,d){if(!o.isConnected)return;console.error(`Jx: <${l}> was not rendered:`,d),o.dispatchEvent(new ErrorEvent("jx-error",{bubbles:!0,composed:!0,error:d,message:d.message}))}function In(o,l){let d=vt;vt=o;try{return l()}finally{vt=d}}function zr(o){return{expansion:o.frames.length,frames:o.frames}}function Qu(o,l){if(Object.is(o,l))return!0;if(!Ss(o)||!Ss(l))return!1;try{return JSON.stringify(o)===JSON.stringify(l)}catch{return!1}}function Ss(o){if(!n(o))return!1;let l=le(o);if(Array.isArray(l))return!0;let d=Object.getPrototypeOf(l);return d===Object.prototype||d===null}function ed(o,l){if(o.tag!==l.tag)return!1;let d=Object.keys(o.props);if(d.length!==Object.keys(l.props).length)return!1;return d.every((f)=>Object.hasOwn(l.props,f)&&Qu(o.props[f],l.props[f]))}function td(o,l){let d=[...o.frames.map((f)=>f.tag),l.tag].join(" → ");if(o.frames.slice(o.expansion).some((f)=>ed(f,l)))throw Error(`Component <${l.tag}> renders itself: ${d}. A component cannot appear inside its own `+"definition with the same props — the expansion would never end.");if(o.frames.length>=bs)throw Error(`Component nesting exceeds ${bs} levels: ${d}. A component that renders itself with changing props needs a case that stops.`);return{expansion:o.expansion,frames:[...o.frames,l]}}var vs=new Set;async function Qt(o,l){let d=l,f;if(e(o)){if(d=new URL(o,d??location.href).href,vs.has(d))return;vs.add(d),f=await Gr(o)}else f=o;d??=location.href;let{tagName:p}=f;if(!p||!p.includes("-"))throw Error(`Jx defineElement: tagName "${p}" must contain a hyphen`);if(customElements.get(p))return;if(f.$elements)await ao(f.$elements,d);Gt.set(p,{base:d,doc:f});let m=f,g=d,h=m.observedAttributes??[],y=class extends HTMLElement{_jxInitialized=!1;_state=null;static get observedAttributes(){return h}async connectedCallback(){if(this.dataset.jxDefinitionRoot!==void 0)return;if(this._jxInitialized)return;this._jxInitialized=!0;let E=vt,A={},T=Gt.get(p)??{base:g,doc:m},{doc:C,base:H}=T,M=await Hn(C,{},H,{base:H,media:null,root:this});for(let N of h)if(this.hasAttribute(N))gs(M,N,this.getAttribute(N)),A[N]=this.getAttribute(N);let K=this.dataset.jxProps;if(K){try{let N=JSON.parse(K),z=n(N)||e(N)?Object.entries(N):[];for(let[Q,de]of z){if(Ln(Q,"data-jx-props"))continue;if(Q in(C.state??{}))M[Q]=de,A[Q]=de}}catch{}delete this.dataset.jxProps}let L=this.getAttributeNames().filter((N)=>N.startsWith("props.")&&N.length>6);for(let N of L){let z=N.slice(6);if(Ln(z,"props.* attribute")){this.removeAttribute(N);continue}if(z in(C.state??{}))M[z]=this.getAttribute(N),A[z]=this.getAttribute(N),this.removeAttribute(N)}for(let N of Object.keys(C.state??{})){if(w(N))continue;let z=Vn(this);if(N in this&&z[N]!==void 0&&Gu(this,N))M[N]=z[N],A[N]=z[N]}let _;try{_=td(E,{props:A,tag:p})}catch(N){this.replaceChildren(),Wr(this,p,N instanceof Error?N:Error(String(N)));return}for(let N of Object.keys(C.state??{})){if(w(N))continue;let z=Yu(this,N);Object.defineProperty(this,N,{configurable:!0,get:()=>M[N],set:(Q)=>{z?.call(this,Q),M[N]=Q}})}this._state=M;let Y=od(this);this.replaceChildren();let U=C.style,G=U&&Ju(U)?U:{display:"block",...U},ne=ea(G,oo.get(this));if(Wn(this,ne,Fn(M),M),Kn(this,C.attributes??{},M),$u(this,C,M),!Array.isArray(C.children)&&C.textContent!==void 0)Ys(this,"textContent",C.textContent,M);let k=Array.isArray(C.children)?C.children:[],B=()=>{let N=$n;$n||=this.dataset.jxPath!==void 0;let z=null;try{In(_,()=>{for(let Q of k)this.append(Ne(Q,M))})}catch(Q){z=Q instanceof Error?Q:Error(String(Q))}finally{$n=N}return sd(this,Y),z},q=()=>{let{onMount:N}=M;if(Fr(N))queueMicrotask(()=>N.call(this,M,this))},X=Et(B),ce=X.result;if(!ce){q();return}Wr(this,p,ce);let ee=[...xs(C).keys()].filter((N)=>!w(N)),re=ce.message,be=!1,V=we(()=>{for(let N of ee)M[N]},{scheduler:()=>{if(be)return;be=!0,queueMicrotask(()=>{if(be=!1,!this.isConnected){V.effect.stop();return}V(),X.stop(),this.replaceChildren(),ht();try{X=Et(B)}finally{gt()}let N=X.result;if(!N)V.effect.stop(),q();else if(N.message!==re)re=N.message,Wr(this,p,N)})}})}disconnectedCallback(){let E=this._state;if(E&&Fr(E.onUnmount))E.onUnmount(E)}adoptedCallback(){let E=this._state;if(E&&Fr(E.onAdopted))E.onAdopted(E)}attributeChangedCallback(E,A,T){if(!this._state||A===T)return;gs(this._state,E,T,xs(Gt.get(p)?.doc??m))}};customElements.define(p,y)}function Es(o,l,d,f){let p=document.createElement(io(o.tagName,l));if(d?.onNodeCreated)d.onNodeCreated(p,f??[],o,l);for(let[g,h]of Object.entries(o.$props??{})){if(Ln(g,"$props"))continue;let y=(E)=>{let A=e(E)?Zr(p.tagName,g,E):E;Vn(p)[g]=A;let T=Tu(p);if(T&&g in HTMLElement.prototype&&Object.hasOwn(le(T),g))T[g]=A};if(r(h)){let E=h;y(ve(E.$ref,l)),we(()=>{y(ve(E.$ref,l))})}else if(a(h))Xt(h,()=>{y(Ye(h,l))});else y(h)}if(o.style)oo.set(p,o.style);Wn(p,o.style??{},Fn(l),l),Kn(p,o.attributes??{},l),ro(p,o,l);let m=Array.isArray(o.children)?o.children:[];for(let g=0;g<m.length;g++){let h=m[g],y=d&&f?{...d,_path:[...f,"children",g]}:void 0;if(S(h))qr(p,h,l,y);else p.append(Ne(h,l,y))}return p}function sa(o){return o.nodeType===Node.ELEMENT_NODE}function aa(o){return o.nodeType===Node.TEXT_NODE}function ws(o){return o.nodeType===Node.COMMENT_NODE}var nd=/^[\t\n\f\r ]+$/u,Ts="jx-slot",As="data-jx-slots",rd="jx.slot.group",zt=(()=>{let o=Symbol.for(rd),l=globalThis;return l[o]??=new WeakMap,l[o]})();function od(o){let l=o.getAttribute(As);if(l===null)return[...o.childNodes];o.removeAttribute(As);let d=`${Ts} ${l} `,f=`/${Ts} ${l}`,p=[],m=o.ownerDocument.createTreeWalker(o,NodeFilter.SHOW_COMMENT);for(let h=m.nextNode();h;h=m.nextNode())if(ws(h)&&h.data.startsWith(d))p.push(h);let g=[];for(let h of p){let y=decodeURIComponent(h.data.slice(d.length));for(let E=h.nextSibling;E;E=E.nextSibling){if(ws(E)&&E.data===f)break;zt.set(E,y),g.push(E)}}return g}function id(o){return o.some((l)=>sa(l)||aa(l)&&l.data!=="")}function sd(o,l){let d=[...o.querySelectorAll("slot")];if(d.length===0)return;let f=new Map;for(let m of l){if(aa(m)&&nd.test(m.data))continue;let g=zt.get(m);zt.delete(m);let h=g??(sa(m)?m.getAttribute("slot")??"":""),y=f.get(h);if(!y)y=[],f.set(h,y);y.push(m)}let p=new Set;for(let m of d){let g=m.getAttribute("name")??"",h=[];if(!p.has(g))p.add(g),h=f.get(g)??[];let y=id(h)?h:[...h,...m.childNodes],E=m.parentElement;if(E&&E!==o&&E.localName.includes("-")){let A=zt.get(m)??m.getAttribute("slot")??"";for(let T of y)zt.set(T,A)}m.replaceWith(...y)}}function ld(o,l){return ca(o,"v",l)}function la(o,l){return ca(o,"r",l)}function ca(o,l,d){if(!e(d)||d==="")return o;let f=o.indexOf("#"),p=f===-1?"":o.slice(f),m=f===-1?o:o.slice(0,f),g=m.indexOf("?"),h=g===-1?m:m.slice(0,g),E=(g===-1?[]:m.slice(g+1).split("&")).filter((A)=>A!==""&&!cd(A,l));return E.push(`${l}=${encodeURIComponent(d)}`),`${h}?${E.join("&")}${p}`}function cd(o,l){let d=o.indexOf("="),f=d===-1?o:o.slice(0,d);if(f===l)return!0;if(!f.includes("%"))return!1;try{return decodeURIComponent(f)===l}catch{return!1}}function lo(o,l){if(!o||!Object.hasOwn(o,l))return;let d=o[l];return e(d)?d:void 0}function en(o,l){if(!l||o==="")return null;if(l.space==="repo"){if(!l.fileBaseUrl)return null;let m=Hr(o,l.documentDir,l.mounts,l.lanes);if(m===null)return null;let{suffix:g}=qt(o);return la(ld(`${l.fileBaseUrl}${es(m)}${g}`,lo(l.versions,m)),lo(l.revisions,m))}let[d]=l.mounts,f=d?dd(o,l.documentDir,d):null,p=ud(o,l);return p===void 0?f:la(f??o,p)}function ud(o,l){if(!l.revisions||Object.keys(l.revisions).length===0)return;let d=Hr(o,l.documentDir,l.mounts,l.lanes);return d===null?void 0:lo(l.revisions,d)}function dd(o,l,d){if(Lr(o))return null;let{path:f,suffix:p}=qt(o),m;try{m=decodeURIComponent(f)}catch{return null}let g=jr(l,m);if(g===null)return null;let h=Qi([d],g);if(!h)return null;return`${h}${p}`}var ua=`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="320" height="180" viewBox="0 0 320 180"><rect width="320" height="180" fill="#808080" fill-opacity="0.16"/><g fill="#808080" fill-opacity="0.38"><circle cx="118" cy="64" r="14"/><path d="M60 140l52-50 34 30 38-46 76 66z"/></g></svg>')}`;function fd(o){let l=o.getAttribute("src")?.trim()??"",d=o.getAttribute("srcset")?.trim()??"";if(l!==""||d!=="")return!1;return!(o.parentElement?.localName==="picture"?o.parentElement:null)?.querySelector("source[srcset]:not([srcset=''])")}function co(o){if(fd(o))o.setAttribute("data-jx-image-placeholder",""),o.setAttribute("src",ua);else if(o.hasAttribute("data-jx-image-placeholder")&&o.getAttribute("src")!==ua)o.removeAttribute("data-jx-image-placeholder")}function fa(o){return o.localName==="img"}function da(o){if(o.nodeType!==o.ELEMENT_NODE||!("querySelectorAll"in o))return[];let l=o,d=[...l.querySelectorAll("img")];return fa(l)?[l,...d]:d}function pa(o){for(let f of da(o))co(f);let d=new(o.ownerDocument.defaultView?.MutationObserver??MutationObserver)((f)=>{for(let p of f){if(p.type==="attributes"){let{target:m}=p;if(m.nodeType===m.ELEMENT_NODE&&"localName"in m){let g=m;if(fa(g))co(g)}continue}for(let m of p.addedNodes)for(let g of da(m))co(g)}});return d.observe(o,{attributeFilter:["src","srcset"],attributes:!0,childList:!0,subtree:!0}),()=>d.disconnect()}function it(o){return`[data-jx-path='${o.replaceAll("\\",String.raw`\\`).replaceAll("'",String.raw`\'`)}']`}function pd(o,l){if(!l)return!1;return o.length<=l.length&&o.every((d,f)=>l[f]===d)}function ma(o,l,d){let f=d.layoutWrapped&&n(l)?l.$__layout:void 0;if(f){let m=s(f)?f:{},{file:g,path:h}=m;return{chrome:o.length>0&&!pd(o,d.pageContentPrefix),kind:"layout",layoutFile:e(g)?g:"",layoutPath:Array.isArray(h)?h:[]}}let p=o;if(d.layoutWrapped&&d.pageContentPrefix){let m=d.pageContentPrefix;if(o.length>=m.length&&m.every((g,h)=>o[h]===g)){let g=o.slice(m.length),[h]=g;p=i(h)?["children",h-(d.pageContentOffset??0),...g.slice(1)]:["children",...g]}}if(d.arrayPaths.size>0){let m=!0;while(m){m=!1;for(let g=1;g<p.length-1;g++)if(p[g]==="children"&&p[g+1]===0&&d.arrayPaths.has(p.slice(0,g).join("/"))){p=[...p.slice(0,g),"map",...p.slice(g+2)],m=!0;break}}}return{kind:"path",path:p}}function ae(o){return JSON.stringify(o)}function ge(o){return JSON.parse(o)}function ha(o){if(o.dataset.jxDefinitionRoot!==void 0)return!1;return o.getAttribute("contenteditable")==="false"||o.tagName.includes("-")}function Un(o,l){let d=o instanceof Element?o:o?.parentElement??null;while(d){if(d instanceof HTMLElement){if(d.dataset.jxPath&&l(d))return{el:d,path:ge(d.dataset.jxPath)};if(ha(d))return null}d=d.parentElement}return null}function qn(o,l){let d=o.querySelector(it(ae(l)));return d instanceof HTMLElement?d:null}function uo(o){return o.textContent.length}function md(o,l,d){if(!o.contains(l))return null;let f=o.ownerDocument.createRange();f.setStart(o,0);try{f.setEnd(l,d)}catch{return null}return f.toString().length}function hd(o,l){let d=Math.max(0,Math.min(l,uo(o))),f=o.ownerDocument.createTreeWalker(o,NodeFilter.SHOW_TEXT),p=0,m=null,g=f.nextNode();while(g){let h=g.length;if(p+h>=d)return{node:g,offset:d-p};p+=h,m=g,g=f.nextNode()}return m?{node:m,offset:m.length}:{node:o,offset:0}}function tn(o,l,d){let f=Un(o,d);if(!f||!o)return null;let p=md(f.el,o,l);return p===null?null:{offset:p,path:f.path}}function fo(o,l){let d=qn(o,l.path);return d?hd(d,l.offset):null}function ga(o){return o.offset<=0}function nn(o,l){return ae(o.path)===ae(l.path)}function po(o,l){let d=[];for(let f of o.querySelectorAll("[data-jx-path]"))if(l(f)&&!gd(f,o))d.push(f);return d}function gd(o,l){let d=o.parentElement;while(d&&d!==l){if(ha(d))return!0;d=d.parentElement}return!1}function xa(o,l,d,f){let p=po(o,f),m=ae(l),g=p.findIndex((y)=>y.dataset.jxPath===m),h=g===-1?void 0:p[g+d];return h?{el:h,path:ge(h.dataset.jxPath)}:null}var mo="jx-site-style",xd={body:"body",root:":root"};function ya(o,l,d,f,p=xd){let m=[],g=(T,C)=>{let H={mediaQueries:l,scope:C,transposeValue:d};if(f)H.resolveValue=(M,K)=>f(M,K,C);for(let M of Ut(T,H))m.push(M.text)},h={},y={},E=[],A=[];for(let[T,C]of Object.entries(o)){if(n(C)&&!Array.isArray(C)){if(T.startsWith("@"))E.push([T,C]);else if(!T.startsWith("--"))A.push([T,C]);continue}if(Kt(T)||T.startsWith("@"))continue;if(T.startsWith("--")||T==="colorScheme"||T==="color-scheme")h[T]=C;else y[T]=C}g(h,p.root),g(y,p.body);for(let[T,C]of A)if(T.startsWith("&"))g({[T]:C},p.root);else g(C,T);for(let[T,C]of E){if(Vt(T)||Bt(T)){g({[T]:C},null);continue}let H={},M={},K=[];for(let[L,_]of Object.entries(C)){if(n(_)&&!Array.isArray(_)){if(!L.startsWith("@"))K.push([L,_]);continue}if(L.startsWith("--"))H[L]=_;else M[L]=_}g({[T]:H},p.root),g({[T]:M},p.body);for(let[L,_]of K)g({[T]:_},L)}if(Object.values(l).some((T)=>Cn(T)!==null)&&!("colorScheme"in o))m.push(`${p.root} { color-scheme: light dark }`,`${p.root}:where([${Ge}="light"]) { color-scheme: light }`,`${p.root}:where([${Ge}="dark"]) { color-scheme: dark }`);return m.join(`
|
|
10
|
-
`)}async function
|
|
9
|
+
`):h.body??"";if(h.role==="accessor"){let T={};if(h.getter)T.get=Function(h.getter.body??"");if(h.setter){let C=(h.setter.parameters??[]).map((L)=>L.$ref?.split("/").pop()??"v");T.set=Function(...C,h.setter.body??"")}Object.defineProperty(m.prototype,y,{...T,configurable:!0})}else if(h.scope==="static")m[y]=Function(...E,A);else m.prototype[y]=Function(...E,A)}return Object.defineProperty(m,"name",{configurable:!0,value:o.title}),m}async function $n(o,l,d,f){let p=uo(o),m=Object.values(p).some((E)=>a(E)),g=(E)=>fetch(_s("/__jx_resolve__"),{body:JSON.stringify({$base:f,$export:o.$export,$prototype:o.$prototype,$src:o.$src,...E}),headers:{"Content-Type":"application/json"},method:"POST"}).then((A)=>{if(!A.ok)throw Error(`Jx dev proxy ${A.status} for "${d}"`);return A.json()}),h=Ge(null),y=(E)=>{ro(g(E).then((A)=>{h.value=A}).catch((A)=>console.error("Jx dev proxy:",A)))};if(m)we(()=>{let E={};for(let[A,T]of Object.entries(p))E[A]=a(T)?Xe(T,l):T;y(E)});else y(p);return h}function aa(o,l,d){let f=0;return(p)=>{f+=1;let m=f;ro(new Promise((g)=>{g(l(p))}).then((g)=>{if(m===f)o.value=g}).catch((g)=>{if(m===f)console.error(d,g)}))}}async function Qu(o,l,d,f){let{$src:p,$export:m}=o,g=Zs.has(p)?io(p):void 0;if(!g)return ed(o,l,d,f);let h=g instanceof Promise?await g:g,y=h[m]??h.default?.[m];if(!y)throw Error(`Jx: export "${m}" not found in "${p}" for "${d}"`);if(!t(y))throw TypeError(`Jx: "${m}" from "${p}" is not a function`);let E=y,A=o.arguments??{},T=Object.values(A).some((O)=>r(O)),C=()=>{let O={};for(let[K,_]of Object.entries(A))O[K]=r(_)?Ee(_.$ref,l):_;return O},L=Ge(null);if(T){let O=aa(L,E,"Jx server function:");we(()=>{let K=C();wn(()=>{}),O(K)})}else L.value=await E(C());return L}async function ed(o,l,d,f){let p=o.arguments??{},m=Object.values(p).some((A)=>r(A)),g=()=>{let A={};for(let[T,C]of Object.entries(p))A[T]=r(C)?Ee(C.$ref,l):C;return A},h=(A)=>fetch(_s("/__jx_server__"),{body:JSON.stringify({$base:f,$export:o.$export,$src:o.$src,arguments:A}),headers:{"Content-Type":"application/json"},method:"POST"}).then((T)=>{if(!T.ok)throw Error(`Jx server proxy ${T.status} for "${d}"`);return T.json()}),y=Ge(null),E=aa(y,h,"Jx server proxy:");if(m)we(()=>{let A=g();wn(()=>{}),E(A)});else E(g());return y}function Ee(o,l){if(!e(o))return o;if(o.startsWith("$map/")||o.startsWith("#/$map/")){let d=(o.startsWith("#/")?o.slice(2):o).split("/"),[,f]=d,m=l.$map?.[f]??l[`$map/${f}`];return d.length>2?ge(m,d.slice(2).join("/")):m}if(o.startsWith("#/state/"))return ge(l,o.slice(8));if(o.startsWith("parent#/"))return ge(l,o.slice(8));if(o.startsWith("window#/"))return ge(globalThis.window,o.slice(8));if(o.startsWith("document#/"))return ge(globalThis.document,o.slice(10));return ge(l,o)??null}function Ss(o,l,d,f){let p=l.replaceAll(/-([a-z])/g,(g,h)=>h.toUpperCase()),m=o[p];if(x(m)){o[p]=d!==null&&d!=="false";return}if(d===null){let g=f?.get(p);o[p]=g===void 0?s(m)?0:"":g;return}o[p]=s(m)?Number(d):d}function vs(o){let l=new Map;for(let[d,f]of Object.entries(o.state??{})){if(n(f)){if("default"in f){l.set(d,f.default);continue}if(td.some((p)=>(p in f)))continue}l.set(d,f)}return l}var td=["$expression","$prototype","$ref","$src"],Es=new Set;function nd(o,l){if(Object.hasOwn(o,l))return!0;if(o.hasAttribute(l))return!0;let d=l.replaceAll(/[A-Z]/gu,(f)=>`-${f.toLowerCase()}`);return d!==l&&o.hasAttribute(d)}function rd(o,l){for(let d=Reflect.getPrototypeOf(o);d;d=Reflect.getPrototypeOf(d)){let f=Object.getOwnPropertyDescriptor(d,l);if(f)return f.set}return}function In(o,l){if(!w(o))return!1;let d=l===void 0?o:`${l}:${o}`;if(!Es.has(d))Es.add(d),console.warn(`Jx: "${o}" is private state (spec.md §5.6) and cannot be set through $props`+`${l===void 0?"":` (${l})`}. The write was ignored; rename the entry without the leading # to make it part of the component's interface.`);return!0}function od(o,l){let d=so(l);for(let[f,p]of Object.entries(o.$props??{})){if(In(f,"$props"))continue;Vn(d,f,r(p)?Ee(p.$ref,l):p)}return d}var la={},Yt=new Map;async function ca(o,l){let d=l??location.href,{tagName:f}=o;if(!f||!f.includes("-"))throw Error(`Jx redefineElement: tagName "${f}" must contain a hyphen`);if(!customElements.get(f)){await en(o,d);return}if(o.$elements)await fo(o.$elements,d);let p=Yt.get(f)?.doc.observedAttributes??[],m=o.observedAttributes??[];if(JSON.stringify(p)!==JSON.stringify(m))console.warn(`Jx redefineElement: <${f}> keeps observedAttributes [${p.join(", ")}] as first defined; [${m.join(", ")}] takes effect only in a fresh realm`);Yt.set(f,{base:d,doc:o})}function ua(o){la=o??{}}async function fo(o,l,d){for(let f of o){if(e(f)){try{await import(f.startsWith("/")||f.startsWith(".")?f:`/node_modules/${f}`)}catch(g){console.warn(`Jx: failed to import package "${f}"`,g)}continue}if(!r(f))continue;let{href:p}=new URL(f.$ref,l),m=await Qr(p,d);if(!m.tagName||!m.tagName.includes("-"))continue;if(customElements.get(m.tagName))continue;if(m.$elements)await fo(m.$elements,p,d);await en(m,p)}}var ws=32,id={expansion:0,frames:[]},vt=id;function Ur(o,l,d){if(!o.isConnected)return;console.error(`Jx: <${l}> was not rendered:`,d),o.dispatchEvent(new ErrorEvent("jx-error",{bubbles:!0,composed:!0,error:d,message:d.message}))}function jn(o,l){let d=vt;vt=o;try{return l()}finally{vt=d}}function Zr(o){return{expansion:o.frames.length,frames:o.frames}}function sd(o,l){if(Object.is(o,l))return!0;if(!Ts(o)||!Ts(l))return!1;try{return JSON.stringify(o)===JSON.stringify(l)}catch{return!1}}function Ts(o){if(!n(o))return!1;let l=le(o);if(Array.isArray(l))return!0;let d=Object.getPrototypeOf(l);return d===Object.prototype||d===null}function ad(o,l){if(o.tag!==l.tag)return!1;let d=Object.keys(o.props);if(d.length!==Object.keys(l.props).length)return!1;return d.every((f)=>Object.hasOwn(l.props,f)&&sd(o.props[f],l.props[f]))}function ld(o,l){let d=[...o.frames.map((f)=>f.tag),l.tag].join(" → ");if(o.frames.slice(o.expansion).some((f)=>ad(f,l)))throw Error(`Component <${l.tag}> renders itself: ${d}. A component cannot appear inside its own `+"definition with the same props — the expansion would never end.");if(o.frames.length>=ws)throw Error(`Component nesting exceeds ${ws} levels: ${d}. A component that renders itself with changing props needs a case that stops.`);return{expansion:o.expansion,frames:[...o.frames,l]}}var As=new Set;async function en(o,l){let d=l,f;if(e(o)){if(d=new URL(o,d??location.href).href,As.has(d))return;As.add(d),f=await Qr(o)}else f=o;d??=location.href;let{tagName:p}=f;if(!p||!p.includes("-"))throw Error(`Jx defineElement: tagName "${p}" must contain a hyphen`);if(customElements.get(p))return;if(f.$elements)await fo(f.$elements,d);Yt.set(p,{base:d,doc:f});let m=f,g=d,h=m.observedAttributes??[],y=class extends HTMLElement{_jxInitialized=!1;_state=null;static get observedAttributes(){return h}async connectedCallback(){if(this.dataset.jxDefinitionRoot!==void 0)return;if(this._jxInitialized)return;this._jxInitialized=!0;let E=vt,A={},T=Yt.get(p)??{base:g,doc:m},{doc:C,base:L}=T,O=await Fn(C,{},L,{base:L,media:null,root:this});for(let R of h)if(this.hasAttribute(R))Ss(O,R,this.getAttribute(R)),A[R]=this.getAttribute(R);let K=this.dataset.jxProps;if(K){try{let R=JSON.parse(K),z=n(R)||e(R)?Object.entries(R):[];for(let[Q,de]of z){if(In(Q,"data-jx-props"))continue;if(Q in(C.state??{}))O[Q]=de,A[Q]=de}}catch{}delete this.dataset.jxProps}let _=this.getAttributeNames().filter((R)=>R.startsWith("props.")&&R.length>6);for(let R of _){let z=R.slice(6);if(In(z,"props.* attribute")){this.removeAttribute(R);continue}if(z in(C.state??{}))O[z]=this.getAttribute(R),A[z]=this.getAttribute(R),this.removeAttribute(R)}for(let R of Object.keys(C.state??{})){if(w(R))continue;let z=Bn(this);if(R in this&&z[R]!==void 0&&nd(this,R))O[R]=z[R],A[R]=z[R]}let k;try{k=ld(E,{props:A,tag:p})}catch(R){this.replaceChildren(),Ur(this,p,R instanceof Error?R:Error(String(R)));return}for(let R of Object.keys(C.state??{})){if(w(R))continue;let z=rd(this,R);Object.defineProperty(this,R,{configurable:!0,get:()=>O[R],set:(Q)=>{z?.call(this,Q),O[R]=Q}})}this._state=O;let Y=dd(this);this.replaceChildren();let U=C.style,G=U&&Fu(U)?U:{display:"block",...U},ne=ia(G,lo.get(this));if(Kn(this,ne,Wn(O),O),qn(this,C.attributes??{},O),Lu(this,C,O),!Array.isArray(C.children)&&C.textContent!==void 0)ta(this,"textContent",C.textContent,O);let M=Array.isArray(C.children)?C.children:[],B=()=>{let R=On;On||=this.dataset.jxPath!==void 0;let z=null;try{jn(k,()=>{for(let Q of M)this.append(Ne(Q,O))})}catch(Q){z=Q instanceof Error?Q:Error(String(Q))}finally{On=R}return pd(this,Y),z},q=()=>{let{onMount:R}=O;if(Br(R))queueMicrotask(()=>R.call(this,O,this))},X=Et(B),ce=X.result;if(!ce){q();return}Ur(this,p,ce);let ee=[...vs(C).keys()].filter((R)=>!w(R)),re=ce.message,be=!1,j=we(()=>{for(let R of ee)O[R]},{scheduler:()=>{if(be)return;be=!0,queueMicrotask(()=>{if(be=!1,!this.isConnected){j.effect.stop();return}j(),X.stop(),this.replaceChildren(),ht();try{X=Et(B)}finally{gt()}let R=X.result;if(!R)j.effect.stop(),q();else if(R.message!==re)re=R.message,Ur(this,p,R)})}})}disconnectedCallback(){let E=this._state;if(E&&Br(E.onUnmount))E.onUnmount(E)}adoptedCallback(){let E=this._state;if(E&&Br(E.onAdopted))E.onAdopted(E)}attributeChangedCallback(E,A,T){if(!this._state||A===T)return;Ss(this._state,E,T,vs(Yt.get(p)?.doc??m))}};customElements.define(p,y)}function Cs(o,l,d,f){let p=document.createElement(co(o.tagName,l));if(d?.onNodeCreated)d.onNodeCreated(p,f??[],o,l);for(let[g,h]of Object.entries(o.$props??{})){if(In(g,"$props"))continue;let y=(E)=>{let A=e(E)?no(p.tagName,g,E):E;Bn(p)[g]=A;let T=Ou(p);if(T&&g in HTMLElement.prototype&&Object.hasOwn(le(T),g))T[g]=A};if(r(h)){let E=h;y(Ee(E.$ref,l)),we(()=>{y(Ee(E.$ref,l))})}else if(a(h))Zt(h,()=>{y(Xe(h,l))});else y(h)}if(o.style)lo.set(p,o.style);Kn(p,o.style??{},Wn(l),l),qn(p,o.attributes??{},l),ao(p,o,l);let m=Array.isArray(o.children)?o.children:[];for(let g=0;g<m.length;g++){let h=m[g],y=d&&f?{...d,_path:[...f,"children",g]}:void 0;if(S(h))Xr(p,h,l,y);else p.append(Ne(h,l,y))}return p}function da(o){return o.nodeType===Node.ELEMENT_NODE}function fa(o){return o.nodeType===Node.TEXT_NODE}function Ps(o){return o.nodeType===Node.COMMENT_NODE}var cd=/^[\t\n\f\r ]+$/u,Ns="jx-slot",Rs="data-jx-slots",ud="jx.slot.group",Gt=(()=>{let o=Symbol.for(ud),l=globalThis;return l[o]??=new WeakMap,l[o]})();function dd(o){let l=o.getAttribute(Rs);if(l===null)return[...o.childNodes];o.removeAttribute(Rs);let d=`${Ns} ${l} `,f=`/${Ns} ${l}`,p=[],m=o.ownerDocument.createTreeWalker(o,NodeFilter.SHOW_COMMENT);for(let h=m.nextNode();h;h=m.nextNode())if(Ps(h)&&h.data.startsWith(d))p.push(h);let g=[];for(let h of p){let y=decodeURIComponent(h.data.slice(d.length));for(let E=h.nextSibling;E;E=E.nextSibling){if(Ps(E)&&E.data===f)break;Gt.set(E,y),g.push(E)}}return g}function fd(o){return o.some((l)=>da(l)||fa(l)&&l.data!=="")}function pd(o,l){let d=[...o.querySelectorAll("slot")];if(d.length===0)return;let f=new Map;for(let m of l){if(fa(m)&&cd.test(m.data))continue;let g=Gt.get(m);Gt.delete(m);let h=g??(da(m)?m.getAttribute("slot")??"":""),y=f.get(h);if(!y)y=[],f.set(h,y);y.push(m)}let p=new Set;for(let m of d){let g=m.getAttribute("name")??"",h=[];if(!p.has(g))p.add(g),h=f.get(g)??[];let y=fd(h)?h:[...h,...m.childNodes],E=m.parentElement;if(E&&E!==o&&E.localName.includes("-")){let A=Gt.get(m)??m.getAttribute("slot")??"";for(let T of y)Gt.set(T,A)}m.replaceWith(...y)}}function hd(o,l){return ma(o,"v",l)}function pa(o,l){return ma(o,"r",l)}function ma(o,l,d){if(!e(d)||d==="")return o;let f=o.indexOf("#"),p=f===-1?"":o.slice(f),m=f===-1?o:o.slice(0,f),g=m.indexOf("?"),h=g===-1?m:m.slice(0,g),E=(g===-1?[]:m.slice(g+1).split("&")).filter((A)=>A!==""&&!gd(A,l));return E.push(`${l}=${encodeURIComponent(d)}`),`${h}?${E.join("&")}${p}`}function gd(o,l){let d=o.indexOf("="),f=d===-1?o:o.slice(0,d);if(f===l)return!0;if(!f.includes("%"))return!1;try{return decodeURIComponent(f)===l}catch{return!1}}function po(o,l){if(!o||!Object.hasOwn(o,l))return;let d=o[l];return e(d)?d:void 0}function tn(o,l){if(!l||o==="")return null;if(l.space==="repo"){if(!l.fileBaseUrl)return null;let m=Wr(o,l.documentDir,l.mounts,l.lanes);if(m===null)return null;let{suffix:g}=zt(o);return pa(hd(`${l.fileBaseUrl}${os(m)}${g}`,po(l.versions,m)),po(l.revisions,m))}let[d]=l.mounts,f=d?yd(o,l.documentDir,d):null,p=xd(o,l);return p===void 0?f:pa(f??o,p)}function xd(o,l){if(!l.revisions||Object.keys(l.revisions).length===0)return;let d=Wr(o,l.documentDir,l.mounts,l.lanes);return d===null?void 0:po(l.revisions,d)}function yd(o,l,d){if(Hr(o))return null;let{path:f,suffix:p}=zt(o),m;try{m=decodeURIComponent(f)}catch{return null}let g=Vr(l,m);if(g===null)return null;let h=rs([d],g);if(!h)return null;return`${h}${p}`}var ha=`data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="320" height="180" viewBox="0 0 320 180"><rect width="320" height="180" fill="#808080" fill-opacity="0.16"/><g fill="#808080" fill-opacity="0.38"><circle cx="118" cy="64" r="14"/><path d="M60 140l52-50 34 30 38-46 76 66z"/></g></svg>')}`;function bd(o){let l=o.getAttribute("src")?.trim()??"",d=o.getAttribute("srcset")?.trim()??"";if(l!==""||d!=="")return!1;return!(o.parentElement?.localName==="picture"?o.parentElement:null)?.querySelector("source[srcset]:not([srcset=''])")}function mo(o){if(bd(o))o.setAttribute("data-jx-image-placeholder",""),o.setAttribute("src",ha);else if(o.hasAttribute("data-jx-image-placeholder")&&o.getAttribute("src")!==ha)o.removeAttribute("data-jx-image-placeholder")}function xa(o){return o.localName==="img"}function ga(o){if(o.nodeType!==o.ELEMENT_NODE||!("querySelectorAll"in o))return[];let l=o,d=[...l.querySelectorAll("img")];return xa(l)?[l,...d]:d}function ya(o){for(let f of ga(o))mo(f);let d=new(o.ownerDocument.defaultView?.MutationObserver??MutationObserver)((f)=>{for(let p of f){if(p.type==="attributes"){let{target:m}=p;if(m.nodeType===m.ELEMENT_NODE&&"localName"in m){let g=m;if(xa(g))mo(g)}continue}for(let m of p.addedNodes)for(let g of ga(m))mo(g)}});return d.observe(o,{attributeFilter:["src","srcset"],attributes:!0,childList:!0,subtree:!0}),()=>d.disconnect()}function it(o){return`[data-jx-path='${o.replaceAll("\\",String.raw`\\`).replaceAll("'",String.raw`\'`)}']`}function Sd(o,l){if(!l)return!1;return o.length<=l.length&&o.every((d,f)=>l[f]===d)}function ba(o,l,d){let f=d.layoutWrapped&&n(l)?l.$__layout:void 0;if(f){let m=i(f)?f:{},{file:g,path:h}=m;return{chrome:o.length>0&&!Sd(o,d.pageContentPrefix),kind:"layout",layoutFile:e(g)?g:"",layoutPath:Array.isArray(h)?h:[]}}let p=o;if(d.layoutWrapped&&d.pageContentPrefix){let m=d.pageContentPrefix;if(o.length>=m.length&&m.every((g,h)=>o[h]===g)){let g=o.slice(m.length),[h]=g;p=s(h)?["children",h-(d.pageContentOffset??0),...g.slice(1)]:["children",...g]}}if(d.arrayPaths.size>0){let m=!0;while(m){m=!1;for(let g=1;g<p.length-1;g++)if(p[g]==="children"&&p[g+1]===0&&d.arrayPaths.has(p.slice(0,g).join("/"))){p=[...p.slice(0,g),"map",...p.slice(g+2)],m=!0;break}}}return{kind:"path",path:p}}function ae(o){return JSON.stringify(o)}function he(o){return JSON.parse(o)}function Sa(o){if(o.dataset.jxDefinitionRoot!==void 0)return!1;return o.getAttribute("contenteditable")==="false"||o.tagName.includes("-")}function zn(o,l){let d=o instanceof Element?o:o?.parentElement??null;while(d){if(d instanceof HTMLElement){if(d.dataset.jxPath&&l(d))return{el:d,path:he(d.dataset.jxPath)};if(Sa(d))return null}d=d.parentElement}return null}function Gn(o,l){let d=o.querySelector(it(ae(l)));return d instanceof HTMLElement?d:null}function ho(o){return o.textContent.length}function vd(o,l,d){if(!o.contains(l))return null;let f=o.ownerDocument.createRange();f.setStart(o,0);try{f.setEnd(l,d)}catch{return null}return f.toString().length}function Ed(o,l){let d=Math.max(0,Math.min(l,ho(o))),f=o.ownerDocument.createTreeWalker(o,NodeFilter.SHOW_TEXT),p=0,m=null,g=f.nextNode();while(g){let h=g.length;if(p+h>=d)return{node:g,offset:d-p};p+=h,m=g,g=f.nextNode()}return m?{node:m,offset:m.length}:{node:o,offset:0}}function nn(o,l,d){let f=zn(o,d);if(!f||!o)return null;let p=vd(f.el,o,l);return p===null?null:{offset:p,path:f.path}}function go(o,l){let d=Gn(o,l.path);return d?Ed(d,l.offset):null}function va(o){return o.offset<=0}function rn(o,l){return ae(o.path)===ae(l.path)}function xo(o,l){let d=[];for(let f of o.querySelectorAll("[data-jx-path]"))if(l(f)&&!wd(f,o))d.push(f);return d}function wd(o,l){let d=o.parentElement;while(d&&d!==l){if(Sa(d))return!0;d=d.parentElement}return!1}function Ea(o,l,d,f){let p=xo(o,f),m=ae(l),g=p.findIndex((y)=>y.dataset.jxPath===m),h=g===-1?void 0:p[g+d];return h?{el:h,path:he(h.dataset.jxPath)}:null}var yo="jx-site-style",Td={body:"body",root:":root"};function wa(o,l,d,f,p=Td){let m=[],g=(T,C)=>{let L={mediaQueries:l,scope:C,transposeValue:d};if(f)L.resolveValue=(O,K)=>f(O,K,C);for(let O of qt(T,L))m.push(O.text)},h={},y={},E=[],A=[];for(let[T,C]of Object.entries(o)){if(n(C)&&!Array.isArray(C)){if(T.startsWith("@"))E.push([T,C]);else if(!T.startsWith("--"))A.push([T,C]);continue}if(Ut(T)||T.startsWith("@"))continue;if(T.startsWith("--")||T==="colorScheme"||T==="color-scheme")h[T]=C;else y[T]=C}g(h,p.root),g(y,p.body);for(let[T,C]of A)if(T.startsWith("&"))g({[T]:C},p.root);else g(C,T);for(let[T,C]of E){if(Wt(T)||Kt(T)){g({[T]:C},null);continue}let L={},O={},K=[];for(let[_,k]of Object.entries(C)){if(n(k)&&!Array.isArray(k)){if(!_.startsWith("@"))K.push([_,k]);continue}if(_.startsWith("--"))L[_]=k;else O[_]=k}g({[T]:L},p.root),g({[T]:O},p.body);for(let[_,k]of K)g({[T]:k},_)}if(Object.values(l).some((T)=>Pn(T)!==null)&&!("colorScheme"in o))m.push(`${p.root} { color-scheme: light dark }`,`${p.root}:where([${Ye}="light"]) { color-scheme: light }`,`${p.root}:where([${Ye}="dark"]) { color-scheme: dark }`);return m.join(`
|
|
10
|
+
`)}async function Ad(o,l){let{parseJxn:d}=await (pe("eytr7av4"),import("./chunks/index-eytr7av4.js"));return d(o,l)}async function Cd(o,l){let d=o.$elements;if(!Array.isArray(d))return;await Promise.all(d.map(async(f)=>{let p=(async()=>{if(e(f))await import(f.startsWith("/")||f.startsWith(".")?f:`/node_modules/${f}`);else if(n(f)&&"$ref"in f)await en(new URL(String(f.$ref),l).href);else if(n(f))await en(f,l)})();try{await Promise.race([p,new Promise((m,g)=>{setTimeout(()=>g(Error("register timeout")),5000)})])}catch(m){console.warn("iframe canvas: failed to register element",JSON.stringify(f),m)}}))}var Ta="jx-canvas-edit-css",Pd=`
|
|
11
11
|
.empty-media-placeholder {
|
|
12
12
|
display: inline-block;
|
|
13
13
|
min-width: 120px;
|
|
@@ -96,7 +96,7 @@ var fr="jx:canvas";function ri(o){let{target:l,source:d,targetOrigin:f,acceptOri
|
|
|
96
96
|
[data-jx-layout-region] [data-jx-layout-region]::before {
|
|
97
97
|
content: none;
|
|
98
98
|
}
|
|
99
|
-
`;function
|
|
99
|
+
`;function Nd(o,l){let d=o.head.querySelector(`#${Ta}`);if(l!=="design"&&l!=="edit"){d?.remove();return}if(d)return;let f=o.createElement("style");f.id=Ta,f.textContent=Pd,o.head.append(f)}var Aa="jx-canvas-overlay-css",Rd=`
|
|
100
100
|
/* The UA rule a de-popovered element lost, re-supplied at UA-EQUIVALENT PRECEDENCE.
|
|
101
101
|
|
|
102
102
|
The cascade layer is the mechanism and it is the whole point. An unlayered author declaration
|
|
@@ -184,7 +184,7 @@ dialog[data-jx-dialog-open]::before {
|
|
|
184
184
|
letter-spacing: 0.08em;
|
|
185
185
|
pointer-events: none;
|
|
186
186
|
}
|
|
187
|
-
`;function
|
|
187
|
+
`;function $d(o,l){let d=o.head.querySelector(`#${Aa}`);if(l==="preview"){d?.remove();return}if(d)return;let f=o.createElement("style");f.id=Aa,f.textContent=Rd,o.head.append(f)}var Ca="jx-canvas-diff-css",Od=`
|
|
188
188
|
[data-jx-diff] {
|
|
189
189
|
position: relative;
|
|
190
190
|
border-left-width: 3px;
|
|
@@ -227,7 +227,7 @@ dialog[data-jx-dialog-open]::before {
|
|
|
227
227
|
border-left-color: CanvasText;
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
|
-
`;function
|
|
230
|
+
`;function Md(o,l){let d=o.head.querySelector(`#${Ca}`);if(!l){d?.remove();return}if(d)return;let f=o.createElement("style");f.id=Ca,f.textContent=Od,o.head.append(f)}function kd(o,l){for(let d of o.querySelectorAll("[data-jx-diff], [data-jx-diff-within]"))if(d instanceof HTMLElement)delete d.dataset.jxDiff,delete d.dataset.jxDiffWithin;if(!l?.length)return;for(let d of l){let f=Gn(o,d.path);if(f){f.dataset.jxDiff=d.kind;continue}let{path:p}=d;while(p.length>=2){p=p.slice(0,-2);let m=Gn(o,p);if(m){m.dataset.jxDiffWithin="";break}}}}function Jd(o,l){o.documentElement.toggleAttribute("data-jx-preview",l==="preview")}function Yn(o){return o==="design"||o==="edit"}function Dd(o,l){if(!Yn(l)){o.removeAttribute("contenteditable"),o.removeAttribute("spellcheck"),o.removeAttribute("role"),o.removeAttribute("aria-multiline"),o.removeAttribute("aria-label");return}o.contentEditable="true",o.spellcheck=!0,o.setAttribute("autocorrect","off"),o.setAttribute("writingsuggestions","false"),o.setAttribute("draggable","false"),o.setAttribute("role","textbox"),o.setAttribute("aria-multiline","true"),o.setAttribute("aria-label","Document content")}var Pa="jx-canvas-stylebook-css",_d=`
|
|
231
231
|
.sb-root {
|
|
232
232
|
padding: 16px;
|
|
233
233
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
|
|
@@ -310,10 +310,10 @@ dialog[data-jx-dialog-open]::before {
|
|
|
310
310
|
color: color-mix(in srgb, #808080 70%, transparent);
|
|
311
311
|
font-size: 13px;
|
|
312
312
|
}
|
|
313
|
-
`;function Rd(o,l){let d=o.head.querySelector(`#${Ea}`);if(l!=="stylebook"){d?.remove();return}if(d)return;let f=o.createElement("style");f.id=Ea,f.textContent=Nd,o.head.append(f)}function ho(o,l={}){let d=document.head.querySelector(`#${mo}`);if(!o||!n(o)){d?.remove();return}let f=ya(o,l,Mn);if(d){d.textContent=f;return}let p=document.createElement("style");p.id=mo,p.textContent=f,document.head.append(p)}function go(o,l){if(l)o.documentElement.dataset.colorScheme=l;else delete o.documentElement.dataset.colorScheme}function Ta(o){let l=o.documentElement;return{dir:l.getAttribute("dir"),lang:l.getAttribute("lang")}}function wa(o,l,d){if(d===null)o.removeAttribute(l);else o.setAttribute(l,d)}function Gn(o,l,d){let f=o.documentElement;wa(f,"lang",l?.locale??d.lang),wa(f,"dir",l?.dir==="rtl"?"rtl":d.dir)}function rn(o,l){for(let f of o.querySelectorAll("[data-jx-popover-open]"))delete f.dataset.jxPopoverOpen;if(l===null)return;let d=o.querySelector(`[data-jx-popover]${it(l)}`);if(d)d.dataset.jxPopoverOpen=""}function Tt(o,l){for(let f of o.querySelectorAll("[data-jx-dialog-open]"))delete f.dataset.jxDialogOpen;if(l===null)return;let d=o.querySelector(`dialog${it(l)}`);if(d)d.dataset.jxDialogOpen=""}function $d(o,l=null){let d=o.$head;if(!Array.isArray(d))return;for(let f of d){if(!n(f)||!f.tagName)continue;let p=String(f.tagName).toLowerCase();if(p==="script"&&!f.attributes?.src)continue;let m={...f.attributes};for(let y of["href","src"]){let E=m[y];if(!e(E)||E==="")continue;if(!E.startsWith("/")&&!E.startsWith(".")&&!E.startsWith("http")){m[y]=`/node_modules/${E}`;continue}m[y]=en(E,l)??E}let g=`${p}${m.href?`[href="${String(m.href)}"]`:""}${m.src?`[src="${String(m.src)}"]`:""}`;if(g!==p&&document.head.querySelector(g))continue;let h=document.createElement(p);for(let[y,E]of Object.entries(m))h.setAttribute(y,String(E));if(f.textContent)h.textContent=String(f.textContent);document.head.append(h)}}function xo(o){let l=[],d=(f)=>l.some((p)=>f.length>p.length&&p.every((m,g)=>f[g]===m));return(f,p,m)=>{if(!(f instanceof HTMLElement))return;let g=p.length===0&&n(m)&&e(m.tagName)&&m.tagName.includes("-");if(g)f.dataset.jxDefinitionRoot="";let h=!g&&f.tagName.includes("-")&&zn(o.canvasMode);if(h)f.contentEditable="false",l.push(p);let y=ma(p,m,o);if(y.kind==="layout"){if(f.dataset.jxLayoutPath=ae(y.layoutPath),y.layoutFile)f.dataset.jxLayoutFile=y.layoutFile;if(y.chrome){if(f.dataset.jxLayoutRegion="",zn(o.canvasMode))f.contentEditable="false"}return}if(f.dataset.jxPath=ae(y.path),!h&&zn(o.canvasMode)&&d(p))f.contentEditable="true"}}function yo(o){let l=o.getAttribute("src")?.trim()??"";return l!==""&&!l.startsWith("data:")}function Aa(o,l=3){let d=new WeakMap,f=(p)=>{let m=p.target;if(!(m instanceof HTMLImageElement))return;if(!yo(m))return;let g=(d.get(m)??0)+1;if(g>l)return;d.set(m,g),setTimeout(()=>{let h=m.src;m.src="",m.src=h},150*g)};return o.addEventListener("error",f,!0),()=>o.removeEventListener("error",f,!0)}async function Ca(o){let l=o.assets??null;jn(l?(h)=>en(h,l):null),Ps(o.mode!=="preview"),Rs(o.mode!=="preview"&&!o.allowAutoRequests),Js(!0),Ds(o.mode!=="preview"&&o.mode!=="stylebook"),Ls(o.mode!=="preview"),Is(o.mode!=="preview"),Hs(o.mode==="design"||o.mode==="edit"),ho(o.siteStyle,o.doc.$media??{}),$d(o.doc,l),Sd(o.container.ownerDocument,o.mode),Ed(o.container.ownerDocument,o.mode),Cd(o.container.ownerDocument,o.mode),Rd(o.container.ownerDocument,o.mode),Td(o.container.ownerDocument,Boolean(o.diffMarks?.length)),ia(o.doc.$media??{}),await yd(o.doc,o.docBase);let d=await Hn(o.doc,{},o.docBase),f=xo(o.mapperCtx),{result:p,stop:m}=Et(()=>Ne(o.doc,d,{_path:[],onNodeCreated:f}));o.container.replaceChildren(p),rn(o.container,o.popoverOpen??null),Tt(o.container,o.dialogOpen??null),Pd(o.container,o.mode),Ad(o.container,o.diffMarks??null);let g=o.mode==="stylebook"?pa(o.container):null;return{ctx:{defs:d,docBase:o.docBase,mapperCtx:o.mapperCtx,mode:o.mode},dispose:()=>{g?.(),m()}}}function Od(o){return JSON.parse(JSON.stringify(o))}function Yn(o){return o===void 0||o===null?o:Od(o)}function xe(o,l){let d=o;for(let f of l){if(d==null)return;d=d[f]}return d}function Pa(o){if(Array.isArray(o))throw TypeError("Cannot insert into a children array; parentPath must point at a node");if(!o.children)o.children=[];if(!Array.isArray(o.children))throw TypeError("Cannot insert into mapped-array children; edit the map template instead");return o.children}function bo(o,l){let{op:d}=l;switch(l.op){case"set-key":{let f=xe(o,l.path);if(!f)throw Error(`doc-op-node-not-found:${l.path.join("/")}`);if(l.value===void 0)delete f[l.key];else f[l.key]=Yn(l.value);return}case"insert-child":{on(o,l.parentPath).splice(l.index,0,Yn(l.node));return}case"remove-child":{on(o,l.parentPath).splice(l.index,1);return}case"set-child":{on(o,l.parentPath).splice(l.index,1,Yn(l.node));return}case"move-child":{Md(l);let f=on(o,l.fromParentPath),p=on(o,l.toParentPath),[m]=f.splice(l.fromIndex,1);p.splice(l.toIndex,0,m);return}default:break}throw Error(`unknown-doc-op:${d}`)}function on(o,l){let d=xe(o,l);if(d==null)throw TypeError(`doc-op-node-not-found:${l.join("/")}`);return Pa(d)}function Md(o){let l=[...o.fromParentPath,"children",o.fromIndex],d=o.toParentPath;if(d.length>=l.length&&l.every((f,p)=>f===d[p]))throw Error(`doc-op-move-into-self:${d.join("/")}`)}function st(o,l){if(o.length>l.length)return!1;return o.every((d,f)=>d===l[f])}function Na(o){return o.length>=2?o.slice(0,-2):null}function Ra(o){return o.at(-1)}function $a(o,l){if(o===l)return!0;if(!o||!l||o.length!==l.length)return!1;return o.every((d,f)=>d===l[f])}var Xn=14,kd="empty-container-placeholder";function Oa(o){let l=Pe(o);return{height:l.height,width:l.width,x:l.x,y:l.y}}function Jd(o){let l=getComputedStyle(o),{display:d}=l,f=d==="flex"||d==="inline-flex",p=d==="grid"||d==="inline-grid";return f&&l.flexDirection.startsWith("row")||p&&l.gridAutoFlow.startsWith("column")}function Ja(o,l,d){let f=o.dataset.jxPath;if(f==null)return null;let p=ge(f);if(o.classList.contains(kd))return[{edge:"center",index:0,insertParentPath:p,rect:Oa(o)}];let m=Na(p);if(!m)return null;let g=o.parentElement;if(!g)return null;let h=Ra(p);if(!i(h))return null;let y=Oa(o);if(Jd(g)){let A=l.x-y.x;if(A<Xn)return[Zn("left",m,h,Ma(y,!0))];if(y.width-A<Xn)return[Zn("right",m,h+1,ka(y,!0))];return null}let E=l.y-y.y;if(E<Xn)return[Zn("top",m,h,Ma(y,!1))];if(y.height-E<Xn)return[Zn("bottom",m,h+1,ka(y,!1))];return null}function Zn(o,l,d,f){return{edge:o,index:d,insertParentPath:l,rect:f}}function Ma(o,l){return l?{height:o.height,width:0,x:o.x,y:o.y}:{height:0,width:o.width,x:o.x,y:o.y}}function ka(o,l){return l?{height:o.height,width:0,x:o.x+o.width,y:o.y}:{height:0,width:o.width,x:o.x,y:o.y+o.height}}function _a(o){if(!o||o.length===0)return"none";return o.map((l)=>`${l.edge}:${l.insertParentPath.join("/")}:${l.index}`).join("|")}var Qn=new Set(["strong","em","b","i","u","del","s","strike","code","sub","sup","span"]);function So(o){return o.nodeType===Node.ELEMENT_NODE}function Da(o){return o.nodeType===Node.TEXT_NODE}function Ia(o,l){if(!l)return!1;if(l.contentEditable==="plaintext-only")return!1;let d=window.getSelection();if(!d||!d.rangeCount)return!1;let{anchorNode:f,focusNode:p}=d;if(!f||!p)return!1;if(!l.contains(f)||!l.contains(p))return!1;let m=(g)=>{let h=g;while(h&&h!==l){if(So(h)&&h.tagName.toLowerCase()===o)return!0;h=h.parentNode}return!1};return m(f)&&m(p)}function ja(o,l){if(!l)return;let d=window.getSelection();if(!d||!d.rangeCount)return;let f=d.getRangeAt(0);if(f.collapsed)return;if(!l.contains(f.commonAncestorContainer))return;Ud(f);let p=_d(o,f,l);if(p.length>0)Dd(o,f,l,p);else Ld(o,f,l);At(l)}function _d(o,l,d){let f=[];for(let p of d.querySelectorAll("*"))if(p.tagName.toLowerCase()===o&&l.intersectsNode(p))f.push(p);return f}function Dd(o,l,d,f){for(let p=f.length-1;p>=0;p--){let m=f[p];Ha(m)}}function Ha(o){if(!o.parentNode)return;let d=document.createDocumentFragment();while(o.firstChild)d.append(o.firstChild);o.replaceWith(d)}function Ld(o,l,d){let f=l.extractContents(),p=Id(f),m=jd(f);if(!f.hasChildNodes()){if(p)l.insertNode(document.createTextNode(p));if(m){let E=document.createTextNode(m);l.collapse(!1),l.insertNode(E)}return}let g=document.createElement(o);g.append(f);let h=document.createDocumentFragment();if(p)h.append(document.createTextNode(p));if(h.append(g),m)h.append(document.createTextNode(m));l.insertNode(h);let y=window.getSelection();if(y){y.removeAllRanges();let E=document.createRange();E.selectNodeContents(g),y.addRange(E)}}function Id(o){let l=o.firstChild;if(!l||l.nodeType!==Node.TEXT_NODE)return null;let d=l.textContent??"",f=d.match(/^(\s+)/);if(!f)return null;let p=f[1];if(d.length===p.length)l.remove();else l.textContent=d.slice(p.length);return p}function jd(o){let l=o.lastChild;if(!l||l.nodeType!==Node.TEXT_NODE)return null;let d=l.textContent??"",f=d.match(/(\s+)$/);if(!f)return null;let p=f[1];if(d.length===p.length)l.remove();else l.textContent=d.slice(0,-p.length);return p}function At(o){if(!o)return;let l=!0,d=0;while(l&&d<10){if(l=!1,d+=1,o.normalize(),Hd(o))l=!0;if(Fd(o))l=!0;if(Vd(o))l=!0;if(Wd(o))l=!0;if(Bd(o))l=!0}}function Hd(o){let l=!1,d=[];for(let f of o.querySelectorAll("*")){let p=f.nextSibling;if(p&&So(p)&&p.tagName===f.tagName&&Qn.has(f.tagName.toLowerCase())&&Kd(f,p))d.push([f,p])}for(let f=d.length-1;f>=0;f--){let[p,m]=d[f];while(m.firstChild)p.append(m.firstChild);m.remove(),l=!0}return l}function Fd(o){let l=!1,d=[];for(let f of o.querySelectorAll("*")){if(!Qn.has(f.tagName.toLowerCase()))continue;let p=f.firstChild;if(f.childNodes.length===1&&p!==null&&So(p)&&p.tagName===f.tagName)d.push(f)}for(let f of d){let p=f.firstChild;if(p===null)throw TypeError("collapseRedundantNesting: an earlier collapse emptied this wrapper");while(p.firstChild)p.before(p.firstChild);p.remove(),l=!0}return l}function Vd(o){let l=!1,d=[];for(let f of o.querySelectorAll("*")){if(!Qn.has(f.tagName.toLowerCase()))continue;if(f.childNodes.length===0&&!f.textContent)d.push(f)}for(let f of d)f.remove(),l=!0;return l}function Wd(o){let l=!1,d=[];for(let f of o.querySelectorAll("*")){if(!Qn.has(f.tagName.toLowerCase()))continue;if(f===o)continue;let p=f.firstChild;if(p&&Da(p)){let g=p.textContent,h=g.match(/^(\s+)/);if(h&&g.length>h[1].length)d.push({el:f,text:p,type:"lift-leading",ws:h[1]})}let m=f.lastChild;if(m&&Da(m)&&m!==p){let g=m.textContent,h=g.match(/(\s+)$/);if(h&&g.length>h[1].length)d.push({el:f,text:m,type:"lift-trailing",ws:h[1]})}}for(let f of d){if(f.type==="lift-leading")f.text.textContent=f.text.textContent.slice(f.ws.length),f.el.parentNode?.insertBefore(document.createTextNode(f.ws),f.el);else f.text.textContent=f.text.textContent.slice(0,-f.ws.length),f.el.parentNode?.insertBefore(document.createTextNode(f.ws),f.el.nextSibling);l=!0}return l}function Bd(o){let l=!1,d=[];for(let f of o.querySelectorAll("*")){if(f.tagName.toLowerCase()!=="span")continue;if(f===o)continue;if(f.attributes.length>0)continue;d.push(f)}for(let f of d)Ha(f),l=!0;return l}function Kd(o,l){if(o.tagName.toLowerCase()==="a")return o.getAttribute("href")===l.getAttribute("href");return!0}function Ud(o){La(o,!0),La(o,!1)}function La(o,l){let d=l?o.startContainer:o.endContainer,f=l?o.startOffset:o.endOffset;if(d.nodeType!==Node.TEXT_NODE)return;let p=d.textContent??"",m=qd(p);for(let g of m)if(l){if(f>g.start&&f<g.end)o.setStart(d,g.start)}else if(f>g.start&&f<g.end)o.setEnd(d,g.end)}function qd(o){let l=[],d=0;while(d<o.length-1){if(o[d]==="$"&&o[d+1]==="{"){let f=d,p=1,m=d+2;while(m<o.length&&p>0){if(o[m]==="{")p+=1;else if(o[m]==="}")p-=1;m+=1}if(p===0){l.push({end:m,start:f}),d=m;continue}}d+=1}return l}var er=(o,l)=>document.execCommand(o,!1,l);function Fa(o){return o.nodeType===Node.ELEMENT_NODE&&o.nodeName.toLowerCase()==="a"}function Va(o){let l=window.getSelection();if(!l||!l.rangeCount)return{active:!1,href:null};let d=l.anchorNode;while(d&&d!==o){if(Fa(d))return{active:!0,href:d.dataset.jxHref??d.getAttribute("href")};d=d.parentNode}return{active:!1,href:null}}function zd(o){let l=window.getSelection();if(!l||!l.rangeCount)return null;let d=l.anchorNode;while(d&&d!==o){if(Fa(d))return d;d=d.parentNode}return null}function Wa(o,l){let d=zd(o);if(d)if(l)d.setAttribute("href",l);else{let f=document.createDocumentFragment();while(d.firstChild)f.append(d.firstChild);d.replaceWith(f)}else if(l)er("createLink",l);At(o)}function Ba(o,l){o.focus(),er("insertText",`\${${l}}`)}var Ka={$id:"elements-meta",title:"HTML Element Metadata",description:"Inline scoping and inline toolbar action metadata for HTML elements.",$convertGroups:{text:["p","h1","h2","h3","h4","h5","h6","blockquote"],container:["div","section","article","aside","main","header","footer","nav","search"],list:["ul","ol"]},$defs:{p:{$convertTo:"text",$convertToWhenEmpty:["text","container"],$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:[{tag:"strong",label:"Bold",command:"bold"},{tag:"em",label:"Italic",command:"italic"},{tag:"u",label:"Underline",command:"underline"},{tag:"del",label:"Strikethrough",command:"strikethrough"},{tag:"sup",label:"Superscript",command:"superscript"},{tag:"sub",label:"Subscript",command:"subscript"},{tag:"code",label:"Code",command:"code"},{tag:"a",label:"Link",command:"link"}]},h1:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:[{tag:"strong",label:"Bold",command:"bold"},{tag:"em",label:"Italic",command:"italic"},{tag:"code",label:"Code",command:"code"},{tag:"a",label:"Link",command:"link"}]},h2:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},h3:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},h4:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},h5:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},h6:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},li:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},td:{$inlineChildren:["em","strong","del","code","a","span","br","b","i","u","sub","sup","s"],$inlineActions:"p"},th:{$inlineChildren:["em","strong","del","code","a","span","br","b","i","u","sub","sup","s"],$inlineActions:"p"},blockquote:{$convertTo:"text",$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},figcaption:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},caption:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},summary:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},dt:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},dd:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},label:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},a:{$inlineChildren:["em","strong","code","span","br","b","i","u","sub","sup"],$inlineActions:[{tag:"strong",label:"Bold",command:"bold"},{tag:"em",label:"Italic",command:"italic"},{tag:"code",label:"Code",command:"code"}]},span:{$inlineChildren:["em","strong","del","code","a","br","b","i","u","sub","sup","s"],$inlineActions:"p"},div:{$convertTo:"container",$convertToWhenEmpty:["container","text"],$inlineChildren:[]},section:{$convertTo:"container",$inlineChildren:[]},article:{$convertTo:"container",$inlineChildren:[]},nav:{$convertTo:"container",$inlineChildren:[]},main:{$convertTo:"container",$inlineChildren:[]},header:{$convertTo:"container",$inlineChildren:[]},footer:{$convertTo:"container",$inlineChildren:[]},aside:{$convertTo:"container",$inlineChildren:[]},ul:{$convertTo:"list",$inlineChildren:[]},ol:{$convertTo:"list",$inlineChildren:[]},pre:{$inlineChildren:["code"]},table:{$inlineChildren:[]},thead:{$inlineChildren:[]},tbody:{$inlineChildren:[]},tr:{$inlineChildren:[]}}};var Ua=Ka.$defs,Yd=new Set(["pre"]),Xd=new Set(Object.entries(Ua).filter(([o,l])=>!Yd.has(o)&&(l.$inlineChildren?.length??0)>0).map(([o])=>o));function qa(o,l){return l?.[o.toLowerCase()]??Xd.has(o.toLowerCase())}var Zd={dismiss:()=>{},isOpen:()=>!1,show:()=>{}},Ze=Zd;function vo(o){Ze=o}var te=null,Re=null,Ct=null,sn=null,Pt=null,Xe=null,Me=!1,ln="",an=!1,Ga=null;function Ya(o){Ga=o}function at(o){return o.getAttribute("contenteditable")!=="false"&&qa(o.tagName,Ga)}function Eo(o,l,d,f){if(te)Le(!0);if(te=o,Re=l,Ct=d.onCommit,sn=d.onSplit,Pt=d.onInsert,Xe=d.onEnd,Me=f?.plainText===!0,ln=Me?o.textContent:"",an=!1,o.dataset.jxActiveBlock="",Me){try{o.contentEditable="plaintext-only"}catch{o.contentEditable="true"}o.focus()}o.addEventListener("keydown",wo),o.addEventListener("input",To),o.addEventListener("paste",Ao)}function Le(o=!1){if(!te)return;if(rl(!1),Ze.dismiss(),delete te.dataset.jxActiveBlock,Me)te.contentEditable="false";if(te.removeEventListener("keydown",wo),te.removeEventListener("input",To),te.removeEventListener("paste",Ao),te=null,Re=null,Ct=null,sn=null,Pt=null,Me=!1,ln="",an=!1,o)Xe=null;else if(Xe){let l=Xe;Xe=null,l()}}function Xa(){rl(!0)}function Za(){return Me&&te!==null}function ke(){return te!==null}function Nt(){return te}function Qa(){return Re}function el(){return Ze.isOpen()}function wo(o){if(Me){if(o.key==="Escape"){if(o.preventDefault(),o.stopPropagation(),te)te.textContent=ln;Le();return}if(o.key==="Enter"){o.preventDefault(),o.stopPropagation(),Le();return}if((o.ctrlKey||o.metaKey)&&["b","i","u","`"].includes(o.key))o.preventDefault()}}function To(){if(Ze.isOpen())No()}function Ao(o){o.preventDefault();let l=o.clipboardData?.getData("text/plain")??"";er("insertText",l)}function tl(){if(!sn||!te||!Re)return!1;let o=window.getSelection();if(!o||!o.rangeCount)return!1;let l=o.getRangeAt(0),d=document.createRange();d.setStart(te,0),d.setEnd(l.startContainer,l.startOffset);let f=document.createRange();f.setStart(l.endContainer,l.endOffset),f.setEnd(te,te.childNodes.length);let p=za(d.cloneContents()),m=za(f.cloneContents()),g=[...Re],h=sn;return nl(),h(g,p,m),!0}function nl(){if(!te)return;if(delete te.dataset.jxActiveBlock,Me)te.contentEditable="false";if(te.removeEventListener("keydown",wo),te.removeEventListener("input",To),te.removeEventListener("paste",Ao),te=null,Re=null,Ct=null,sn=null,Pt=null,Me=!1,ln="",an=!1,Xe){let o=Xe;Xe=null,o()}}function rl(o){if(!Ct||!te||!Re)return;if(Me){let d=te.textContent.replaceAll(`
|
|
314
|
-
`," ");if(d===
|
|
315
|
-
`," ")&&!
|
|
316
|
-
`))requestAnimationFrame(()=>Po())}function No(){if(!te||!tr)return;let o=window.getSelection();if(!o||!o.rangeCount){Ze.dismiss();return}let l=o.getRangeAt(0),d=nr(l),f=d.lastIndexOf("/");if(f===-1||d.length<il-1){Ze.dismiss();return}let p=d.slice(f+1).toLowerCase();Ze.show(te,p,{onSelect:al})}function al(o){if(!te||!Pt||!Re)return;let l=tr?window.getSelection():null;if(l&&l.rangeCount){let m=l.getRangeAt(0),h=nr(m).lastIndexOf("/");if(h!==-1){let y=document.createTreeWalker(te,NodeFilter.SHOW_TEXT),E=0,A=null,T=0;while(y.nextNode()){let C=y.currentNode;if(E+C.length>h){A=C,T=h-E;break}E+=C.length}if(A){let C=document.createRange();C.setStart(A,T),C.setEnd(m.startContainer,m.startOffset),C.deleteContents()}}}At(te);let d=ol(te),f=[...Re],p=Pt;nl(),p(f,o,d)}function nf(o,l){let{target:d}=o;return d===l||d===l.documentElement||d===l.body}function Ro(o){let l=o instanceof Element?o:null;while(l){if(l instanceof HTMLElement&&l.dataset.jxPath)return l;l=l.parentElement}return null}function cl(o,l){let d=Pe(o);return{path:ge(l),rect:{height:d.height,width:d.width,x:d.x,y:d.y}}}function ll(o){let l=Ro(o instanceof Element?o:null);if(!l)return null;return cl(l,l.dataset.jxPath)}function ul(o){let l=o.checkVisibility;if(!t(l)||l.call(o,{checkVisibilityCSS:!0}))return!0;return pr(o)&&[...o.children].some((d)=>ul(d))}function dl(o,l=document){let d=[],f=[];for(let p of o){let m=l.querySelector(it(ae(p)));if(!m)continue;if(ul(m)){let g=Pe(m);d.push({path:p,rect:{height:g.height,width:g.width,x:g.x,y:g.y}})}else f.push(p)}return{hidden:f,hits:d}}var rf=new Set(["toggle","show","hide"]);function of(o){return rf.has(o)}function sf(o,l){if(!(o instanceof Element))return;let d=o.closest("[popovertarget]"),f=d?.getAttribute("popovertarget");if(!d||!f)return;let g=[...d.ownerDocument.querySelectorAll("[data-jx-popover]")].find((E)=>E.id===f)?.dataset.jxPath;if(!g)return;let h=d.getAttribute("popovertargetaction")??"toggle",y=of(h)?h:"toggle";l.post({action:y,kind:"popoverTargetClick",targetPath:ge(g)})}function af(o,l){if(!(o instanceof Element))return;let d=o.closest("[data-jx-commandfor]"),f=d?.dataset.jxCommandfor,p=d?.getAttribute("command")?.trim().toLowerCase()??"";if(!d||!f||!p)return;let h=[...d.ownerDocument.querySelectorAll("[data-jx-popover], dialog[data-jx-path]")].find((y)=>y.id===f)?.dataset.jxPath;if(!h)return;l.post({command:p,kind:"commandTargetClick",targetPath:ge(h)})}function fl(o,l=document,d){let f=null,p=null,m=d?.getGen?.()??0,g=()=>d?.getMode?.()==="preview",h=()=>{o.post({kind:"paneFocus"})},y=(k)=>{if(g()){if(k.target instanceof Element){let X=k.target.closest("a[href]")?.getAttribute("href");if(X&&!X.startsWith("#"))k.preventDefault(),o.post({href:X,kind:"previewNavigate"})}return}if(d?.getMode?.()==="stylebook"&&k.target instanceof Element&&k.target.closest("a"))k.preventDefault();let B=ll(k.target);if(B)o.post({additive:k.ctrlKey===!0||k.metaKey===!0,hit:B,kind:"hit"});sf(k.target,o),af(k.target,o)},E=(k)=>{if(g())return;let B=k?.dataset.jxPath??null;if(B===f)return;f=B,o.post({hit:k&&B?cl(k,B):null,kind:"hover"})},A=()=>{let k=d?.getGen?.()??m;if(k!==m)m=k,p="none"},T=(k,B)=>{if(!d||d.getMode?.()==="stylebook"||g())return;A();let q=d.getShadowDoc(),X=Ro(k instanceof Element?k:null),ce=X&&q?Ja(X,B,q):null,ee=_a(ce);if(ee===p)return;p=ee,o.post({kind:"insertZones",zones:ce})},C=0,H=null,M=0,K=0,L=(k)=>l.defaultView?.requestAnimationFrame(k)??requestAnimationFrame(k),_=(k)=>l.defaultView?.cancelAnimationFrame(k)??cancelAnimationFrame(k),Y=()=>{C=0;let k=H;H=null,E(Ro(k instanceof Element?k:null)),T(k,{x:M,y:K})},U=(k)=>{if(H=k.target,M=k.clientX,K=k.clientY,C)return;C=L(Y)},G=(k)=>{if(!nf(k,l))return;if(E(null),d&&!g()&&p!=="none")p="none",o.post({kind:"insertZones",zones:null})},ne=(k)=>{if(g())return;let B=ke()?Nt():null;if(B&&k.target instanceof Node&&B.contains(k.target))return;let q=ll(k.target);if(!q)return;k.preventDefault(),o.post({kind:"contextMenu",path:q.path,x:k.clientX,y:k.clientY})};return l.addEventListener("pointerdown",h,!0),l.addEventListener("click",y,!0),l.addEventListener("pointermove",U,!0),l.addEventListener("pointerleave",G,!0),l.addEventListener("contextmenu",ne,!0),()=>{if(C)_(C),C=0;l.removeEventListener("pointerdown",h,!0),l.removeEventListener("click",y,!0),l.removeEventListener("pointermove",U,!0),l.removeEventListener("pointerleave",G,!0),l.removeEventListener("contextmenu",ne,!0)}}var lf=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),pl=new Set(["a","abbr","b","bdi","bdo","br","cite","code","data","del","dfn","em","i","ins","kbd","mark","q","s","samp","small","span","strong","sub","sup","time","u","var","wbr"]),cf=new Set([...pl,"button","dt","h1","h2","h3","h4","h5","h6","label","legend","p","pre","summary"]);function ml(o){return(u(o?.tagName)||"div").toLowerCase()}function uf(o,l){let d=o.type==="block"?o.tag??"":ml(xe(l,o.path));return pl.has(d.toLowerCase())}function df(o,l){let d=null,f=o;while(f){let p=ge(f.dataset.jxPath??"");if(p.length===0)break;if(cf.has(ml(xe(l,p))))d=f;f=hl(f.parentElement)}return d}function hl(o){let l=o;while(l){if(l instanceof HTMLElement&&l.dataset.jxPath)return l;l=l.parentElement}return null}function $o(o,l,d){let f=ii(o,l,d);return hl(f)}function Oo(o,l,d,f){let p=o.dataset.jxPath;if(p==null)return null;let m=ge(p);if(m.length===0){let H=[...o.children];if(H.length===0)return rr(f,m)?{edge:"inside",instruction:"make-child",referenceRect:Qe(o),targetPath:m}:null;return ff(H,l,m,f)}if(!rr(f,m))return null;let g=uf(f,d)?null:df(o,d);if(g){let H=ge(g.dataset.jxPath??"");if(!rr(f,H))return null;let M=Qe(g);return(M.height===0?0:(l-M.y)/M.height)<0.5?{edge:"top",instruction:"reorder-above",referenceRect:M,targetPath:H}:{edge:"bottom",instruction:"reorder-below",referenceRect:M,targetPath:H}}let h=xe(d,m),y=(u(h?.tagName)||"div").toLowerCase(),E=Array.isArray(h?.children)&&h.children.some((H)=>n(H)),A=lf.has(y)||!E,T=Qe(o),C=T.height===0?0:(l-T.y)/T.height;if(A)return C<0.5?{edge:"top",instruction:"reorder-above",referenceRect:T,targetPath:m}:{edge:"bottom",instruction:"reorder-below",referenceRect:T,targetPath:m};if(C<0.25)return{edge:"top",instruction:"reorder-above",referenceRect:T,targetPath:m};if(C>0.75)return{edge:"bottom",instruction:"reorder-below",referenceRect:T,targetPath:m};return{edge:"inside",instruction:"make-child",referenceRect:T,targetPath:m}}function ff(o,l,d,f){let p=1/0,m="reorder-below",g=o.length-1;for(let y=0;y<o.length;y++){let E=Qe(o[y]),A=Math.abs(l-E.y),T=Math.abs(l-(E.y+E.height));if(A<p)p=A,m="reorder-above",g=y;if(T<p)p=T,m="reorder-below",g=y}let h=[...d,"children",g];if(!rr(f,h))return null;return{edge:m==="reorder-above"?"top":"bottom",instruction:m,referenceRect:Qe(o[g]),targetPath:h}}function rr(o,l){if(o.type!=="tree-node")return!0;let d=o.path;if($a(d,l))return!1;return!st(d,l)}function Qe(o){let l=Pe(o);return{height:l.height,width:l.width,x:l.x,y:l.y}}var pf=40,gl=12;function Mo(o,l,d=pf){if(o<d)return-1;if(o>l-d)return 1;return 0}var ko=new Set(["deleteContentBackward","deleteWordBackward","deleteSoftLineBackward","deleteHardLineBackward"]),Jo=new Set(["deleteContentForward","deleteWordForward","deleteSoftLineForward","deleteHardLineForward"]),xl=new Set(["deleteByCut","deleteContent"]),yl=new Set(["insertText","insertReplacementText","insertFromPaste","insertFromPasteAsQuotation","insertFromYank","insertTranspose"]),mf="format",hf=new Set(["insertParagraph","insertLineBreak"]);function bl(o){let{inputType:l,from:d,to:f}=o;if(l==="insertCompositionText"||l==="insertFromComposition")return{kind:"native"};if(l==="historyUndo"||l==="historyRedo")return{kind:"reject"};if(l.startsWith(mf))return{kind:"reject"};if(l==="insertFromDrop"||l==="deleteByDrag")return{kind:"reject"};if(o.inPropHost)return hf.has(l)?{kind:"reject"}:{kind:"native"};if(!d||!f)return{kind:"reject"};let p=nn(d,f)&&d.offset===f.offset,m=!nn(d,f);if(l==="insertParagraph")return{from:d,kind:"split",to:f};if(l==="insertLineBreak"&&!m)return{kind:"native"};if(p&&ko.has(l)&&o.atBlockStart)return{at:d,kind:"mergeBackward"};if(p&&Jo.has(l)&&o.atBlockEnd)return{at:d,kind:"mergeForward"};if(m){if(yl.has(l)||l==="insertLineBreak")return{from:d,kind:"replaceRange",text:o.data,to:f};if(ko.has(l)||Jo.has(l)||xl.has(l))return{from:d,kind:"replaceRange",text:"",to:f};return{kind:"reject"}}if(yl.has(l)||ko.has(l)||Jo.has(l)||xl.has(l))return{kind:"native"};return{kind:"native"}}var gf=500;function or(o,l){let d=o.ownerDocument.getSelection();if(!d||d.rangeCount===0||!d.anchorNode||!d.focusNode)return null;if(!o.contains(d.anchorNode)||!o.contains(d.focusNode))return null;let f=tn(d.anchorNode,d.anchorOffset,l),p=tn(d.focusNode,d.focusOffset,l);return f&&p?{anchor:f,head:p}:null}function cn(o,l){let d=fo(o,l.anchor),f=fo(o,l.head)??d;if(!d)return!1;let p=o.ownerDocument.getSelection();if(!p)return!1;let m=o.ownerDocument.createRange();if(m.setStart(d.node,d.offset),p.removeAllRanges(),p.addRange(m),f&&f!==d)p.extend(f.node,f.offset);return!0}function Sl(o){return"dataset"in o}function vl(o,l){let d=o.ownerDocument,f=null,p=null,m=()=>{let k=l.getMode?.();return k===void 0||k==="design"||k==="edit"},g=null,h=()=>{if(g!==null)clearTimeout(g),g=null},y=()=>{if(g=null,!f||!l.onCommitTick)return;let k=or(o,l.isEditableBlock);if(l.onCommitTick(),k)cn(o,k)},E=!1,A=()=>{if(!l.onCommitTick||!f||E)return;h(),g=setTimeout(y,l.commitDelayMs??gf)},T=()=>{E=!0,h()},C=()=>{E=!1,A()},H=()=>{h(),f=null,p=null},M=()=>{if(!f)return;h(),f=null,p=null,l.onDeactivate()},K=()=>{if(!m()){M();return}let B=d.getSelection()?.focusNode??null;if(!B)return;if(!o.contains(B)){M();return}let q=Un(B,l.isEditableBlock);if(!q){if(f?.contains(B)){l.onSelectionChange?.();return}M();return}let X=ae(q.path);if(X===p){l.onSelectionChange?.();return}M(),f=q.el,p=X,l.onActivate(q.el,q.path)},L=(k)=>{let[B]=t(k.getTargetRanges)?k.getTargetRanges():[],q=d.getSelection(),X=q&&q.rangeCount>0&&(q.isCollapsed||!B),ce,ee,re,be;if(X)({startContainer:ce,startOffset:ee,endContainer:re,endOffset:be}=q.getRangeAt(0));else if(B)({startContainer:ce,startOffset:ee,endContainer:re,endOffset:be}=B);else return null;let V=tn(ce,ee,l.isEditableBlock),N=tn(re,be,l.isEditableBlock),z=Un(re,l.isEditableBlock);return V&&N&&z?{endEl:z.el,from:V,to:N}:null},_=(k)=>{if(!m())return;let B=L(k),q=bl({atBlockEnd:B?B.to.offset>=uo(B.endEl):!1,atBlockStart:B?ga(B.from):!1,data:k.data??"",from:B?.from??null,inPropHost:f!==null&&p===null,inputType:k.inputType,to:B?.to??null});switch(q.kind){case"native":return;case"split":{if(k.preventDefault(),!nn(q.from,q.to)&&!l.onReplaceRange)return;l.onSplit?.();return}case"mergeBackward":{k.preventDefault(),l.onMergeBackward?.(q.at);return}case"mergeForward":{k.preventDefault(),l.onMergeForward?.(q.at);return}case"replaceRange":{k.preventDefault(),l.onReplaceRange?.(q.from,q.to,q.text);return}default:k.preventDefault()}},Y=(k)=>{if(!m()||k.button===2)return;let B=k.target instanceof Element?k.target:null,q=l.onPropActivate?B:null;while(q&&q!==o){if(Sl(q)&&q.dataset.jxBoundProp&&l.onPropActivate){let X=q;if(X!==f){if(M(),l.onPropActivate(X))f=X,p=null}return}if(Sl(q)&&q.dataset.jxPath)break;q=q.parentElement}if(B?.closest("[contenteditable]")?.getAttribute("contenteditable")==="false")d.getSelection()?.removeAllRanges()},U=(k)=>{if(k.button!==2||!m())return;if(f&&k.target instanceof Node&&f.contains(k.target))return;if(k.preventDefault(),f)M(),d.getSelection()?.removeAllRanges()},G=(k)=>{k.preventDefault()},ne=()=>A();return d.addEventListener("selectionchange",K),o.addEventListener("beforeinput",_),o.addEventListener("input",ne),o.addEventListener("compositionstart",T),o.addEventListener("compositionend",C),o.addEventListener("dragstart",G),d.addEventListener("pointerdown",Y,!0),d.addEventListener("mousedown",U,!0),{capture:()=>or(o,l.isEditableBlock),forget:H,isComposing:()=>E,flush:()=>{if(E)return;if(g!==null)h(),y()},placeCaret:(k)=>{let B=cn(o,{anchor:k,head:k});if(B)K();return B},restore:(k)=>{let B=cn(o,k);if(B)K();return B},stop:()=>{d.removeEventListener("selectionchange",K),o.removeEventListener("beforeinput",_),o.removeEventListener("input",ne),o.removeEventListener("compositionstart",T),o.removeEventListener("compositionend",C),o.removeEventListener("dragstart",G),d.removeEventListener("pointerdown",Y,!0),d.removeEventListener("mousedown",U,!0),M()},sync:K}}function Ie(o){return n(o)}function Rt(o){if(Array.isArray(o))return o.map((d)=>Rt(d));if(!c(o))return o;let l={};for(let[d,f]of Object.entries(o)){if(d.startsWith("on")&&Z(f))continue;if(d==="children")l.children=Array.isArray(f)?f.map((p)=>Rt(p)):Rt(f);else if(d==="cases"&&Ie(f)){let p={};for(let[m,g]of Object.entries(f))p[m]=Rt(g);l.cases=p}else if(d==="state"&&Ie(f)){let p={};for(let[m,g]of Object.entries(f)){if(s(g)&&g.timing==="server")continue;p[m]=g}l.state=p}else l[d]=f}return l}var xf=new Set(["img","video","source","iframe","audio"]),El="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",yf="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='32'%20height='32'%3E%3Crect%20width='32'%20height='32'%20fill='%23d0d0d0'/%3E%3C/svg%3E";var bf=/(src|poster|image|bg|background|icon|logo|photo|avatar|thumbnail|cover|banner)$/i;function wl(o){return bf.test(o)}var Sf=/(?<![\w$.])(?:item|index|\$map)\b/u;function We(o){if(e(o))return o.includes("${")&&Sf.test(o);return c(o)&&e(o.$ref)&&/^(?:#\/)?\$map\//u.test(o.$ref)}function ir(o,l){if(o==="href"||o==="action")return"";if(wl(o))return yf;if(e(l))return $t(l);return c(l)&&e(l.$ref)?Ml(l.$ref):""}var vf=new Set(["p","h1","h2","h3","h4","h5","h6","blockquote","li","dt","dd","th","td","span","strong","em","small","mark","code","abbr","q","sub","sup","time","a","button","label","legend","caption","summary","pre","option"]),Ef=new Set(["div","section","article","aside","header","footer","main","nav","figure","figcaption","details","fieldset","form","ul","ol","dl","table"]),Tl=["empty-text-placeholder","empty-container-placeholder"],wf=["width","height","inlineSize","blockSize"];function Tf(o){let{style:l}=o;if(!n(l))return!1;return wf.some((d)=>{let f=l[d],p=i(f)?String(f):e(f)?f.trim():"";return p!==""&&p!=="auto"})}function Do(o){if(!o.tagName||o.textContent||o.innerHTML)return null;if(o.$__layout)return null;if(Array.isArray(o.children)&&o.children.length>0)return null;if(a(o.children))return null;if(Tf(o))return null;if(vf.has(u(o.tagName)))return"empty-text-placeholder";if(Ef.has(u(o.tagName)))return"empty-container-placeholder";return null}function $t(o){return o.replaceAll(/\$\{([^}]+)\}/g,"❪ $1 ❫")}function Af(o){return $t(o.replaceAll(/\s*\?\?\s*\[\s*\]\s*(?=\})/gu,""))}function Al(o){let l=document.createTreeWalker(o,NodeFilter.SHOW_TEXT);while(l.nextNode()){let d=l.currentNode;if(d.data.includes("❪"))d.data=d.data.replaceAll(/\u276A\s*(.*?)\s*\u276B/g,"${$1}")}}function Cf(o,l){let d=o.map;return{children:n(d)?[et(d,Nl(o.items,l))]:[],className:"repeater-perimeter",tagName:"div"}}function Cl(o){return JSON.stringify(o)}function Pl(o){let l=o.startsWith("#/")?o.slice(2):o,[d,...f]=l.split("/"),p=d==="state"||d==="$map"?d:null;if(p===null)return null;let m=f.map((g)=>g.replaceAll("~1","/").replaceAll("~0","~"));return p+m.map((g)=>`?.[${Cl(g)}]`).join("")}function _o(o,l){if(l===null)return`(${o})`;return`((r) => ((item, index, $map) => (${o}))(r, 0, { index: 0, item: r }))(${l})`}function Nl(o,l){if(Array.isArray(o))return`${Cl(o)}[0]`;if(r(o)){let f=Pl(o.$ref);return f===null?null:`${_o(f,l)}?.[0]`}let d=e(o)?Rl(o):[];if(e(o)&&d.length===1&&Pf(o,d[0]))return`${_o(d[0].expr,l)}?.[0]`;return null}function Pf(o,l){return l.start===0&&l.end===o.length-1}function Rl(o){let l=[],d=o.indexOf("${");while(d!==-1){let f=0,p=-1;for(let m=d+1;m<o.length;m+=1)if(o[m]==="{")f+=1;else if(o[m]==="}"){if(f-=1,f===0){p=m;break}}if(p===-1)break;l.push({end:p,expr:o.slice(d+2,p),start:d}),d=o.indexOf("${",p+1)}return l}function $l(o,l=null){let d=Rl(o);if(d.length===0)return o;let f="",p=0;for(let{start:m,end:g,expr:h}of d)f+=o.slice(p,m),f+=`\${(() => { try { return ${_o(h,l)}; } catch { return ""; } })()}`,p=g+1;return f+o.slice(p)}function Nf(o,l){let d=o.startsWith("#/")?o.slice(2):o;if(d!=="$map"&&!d.startsWith("$map/"))return{$ref:o};let f=Pl(o);return l===null||f===null?void 0:$l(`\${${f}}`,l)}function Ol(o,l){let d=o,f=null;for(let p of l){if(Array.isArray(d)){d=i(p)?d[p]:void 0;continue}if(!c(d))return f;if(p==="map"&&d.$prototype==="Array")f=Nl(d.items,f);d=e(p)?d[p]:void 0}return f}function Ml(o){return`{${o.startsWith("#/state/")?o.slice(8):o}}`}function kl(o,l=null){return et(o,l)}function et(o,l){if(Array.isArray(o))return o.map((h)=>et(h,l));if(!c(o))return o;if(o.$prototype==="Array")return Cf(o,l);let d=o,f={},p=!1,m=e(d.tagName)&&xf.has(d.tagName);if(m){let{attributes:h,src:y}=d,E=h?.src,A=d.poster,T=h?.poster;if(!(y&&y!==""||E&&E!=="")&&!(A&&A!==""||T&&T!==""))p=!0}for(let[h,y]of Object.entries(d))if(h==="state"||h==="$media"||h==="$elements")f[h]=y;else if(h==="$props"&&Ie(y)){let E={};for(let[A,T]of Object.entries(y))if(!We(T))E[A]=T;else if(e(T))E[A]=wl(A)||A==="href"||A==="action"?ir(A,T):$l(T,l);else if(r(T)){let C=Nf(T.$ref,l);if(C!==void 0)E[A]=C}else E[A]=T;f[h]=E}else if(h==="children"){if(Array.isArray(y))f.children=y.map((E)=>et(E,l));else if(c(y)&&y.$prototype==="Array")f.children=[et(y,l)];else if(!a(y))f.children=et(y,l)}else if(h==="cases"&&d.$switch&&Ie(y)){let[E]=Object.entries(y);if(E){let[,A]=E;f.children=Ie(A)&&!(c(A)&&A.$ref)?[et(A,l)]:[{style:{background:"color-mix(in srgb, var(--danger) 8%, transparent)",border:"1px dashed color-mix(in srgb, var(--danger) 40%, transparent)",borderRadius:"4px",color:"var(--danger)",fontFamily:"'JetBrains Mono', 'SF Mono', 'Fira Code', monospace",fontSize:"11px",fontStyle:"italic",padding:"6px 10px"},tagName:"div",textContent:`[$switch: ${Object.keys(y).join(" | ")}]`}]}}else if(h==="attributes"&&m&&Ie(y)){let E={};for(let[A,T]of Object.entries(y))if((A==="src"||A==="poster")&&(T===""||T==null||We(T)))p=!0,E[A]=El;else E[A]=We(T)?ir(A,T):T;f.attributes=E}else if(h==="attributes"&&Ie(y)){let E={};for(let[A,T]of Object.entries(y))E[A]=We(T)?ir(A,T):T;f.attributes=E}else if(h==="style")if(Ie(y)){let E={};for(let[A,T]of Object.entries(y))if(!We(T))E[A]=T;f.style=E}else f.style=y;else if(h==="$switch"&&e(y)&&y.includes("${"))f[h]=$t(y);else if(h==="textContent"&&e(y)&&y.includes("${"))f[h]=$t(y);else if(h==="textContent"&&c(y)&&y.$ref)f[h]=Ml(y.$ref);else if(m&&(h==="src"||h==="poster"))if(y===""||y==null||We(y))p=!0,f[h]=El;else f[h]=y;else if(We(y))f[h]=ir(h,y);else if(e(y)||c(y)&&y.$ref)f[h]=y;else f[h]=et(y,l);if(a(d.children)){f.textContent=Af(d.children);let{attributes:h}=f;f.attributes=Ie(h)?{...h,contenteditable:"false"}:{contenteditable:"false"}}let g=Do(f);if(g)f.className=f.className?`${f.className} ${g}`:g;if(p){let h=e(f.className)?f.className:"";if(!h.includes("empty-media-placeholder"))f.className=h?`${h} empty-media-placeholder`:"empty-media-placeholder"}return f}var Rf={bold:"strong",code:"code",italic:"em",strikethrough:"del",subscript:"sub",superscript:"sup",underline:"u"},Lo=globalThis,$f=["strong","em","u","del","sub","sup","code"],sr="jx-pending-format",Jl="jx-pending-format-style";function Of(o){let l=o.parentElement;while(l){if(l.tagName.includes("-"))return l;l=l.parentElement}return null}function Mf(o,l){if(!o)return!1;let d=o.attributes;if(d){if(d[`props.${l}`]!==void 0)return!0;let f=new Set([l.toLowerCase(),An(l).toLowerCase()]);for(let m of Object.keys(d))if(d[m]!==void 0&&f.has(m.toLowerCase()))return!0;let p=d["data-jx-props"];if(e(p)&&kf(p,l))return!0}if(Zt.has(l)||l.startsWith("$"))return!1;return o[l]!==void 0}function kf(o,l){try{let d=JSON.parse(o);return n(d)&&l in d}catch{return!1}}function _l(o,l){let f=ae(l).replaceAll("\\",String.raw`\\`).replaceAll("'",String.raw`\'`),p=o.querySelector(`[data-jx-path='${f}']`);return p instanceof HTMLElement?p:null}function Jf(o){return{height:o.height,width:o.width,x:o.x,y:o.y}}function Dl(o,l,d){let f=l.ownerDocument,p=()=>{let V=d?.getMode?.();return V===void 0||V==="design"||V==="edit"},m=null,g=0,h=(V)=>{let N=window.getSelection();if(!N||!N.rangeCount)return null;let z=N.getRangeAt(0);return V.contains(z.commonAncestorContainer)?z:null},y=()=>{let V=Nt();if(!V)return;let N=h(V);if(N&&!N.collapsed)m=N.cloneRange()},E=()=>{if(f.querySelector(`#${Jl}`))return;let V=f.createElement("style");V.id=Jl,V.textContent=`::highlight(${sr}) { background-color: Highlight; color: HighlightText; }`,f.head.append(V)},A=()=>{let V=Lo.Highlight,N=Lo.CSS?.highlights;if(!V||!N)return;if(m&&m.startContainer.isConnected)E(),N.set(sr,new V(m.cloneRange()));else N.delete(sr)},T=()=>{Lo.CSS?.highlights?.delete(sr)},C=()=>{let V=Nt();if(!V||!V.dataset.jxPath)return null;let N=h(V),z=N??m,Q=z?Jf(oi(z)):null,de=N?N.collapsed:!0,Je=$f.filter((Ce)=>Ia(Ce,V)),ye=Va(V);if(ye.active)Je.push("a");return g+=1,{activeTags:Je,collapsed:de,kind:"selectionChanged",link:ye,localScope:null,path:ge(V.dataset.jxPath),rect:Q,seq:g}},H=()=>{if(!ke())return;y(),A();let V=C();if(V)o.post(V)},M=!1,K=(V,N)=>{Al(V),o.post({kind:"editStart",path:N}),Eo(V,N,{onCommit:(z,Q,de,Je)=>{M=!1;let ye={children:Q,kind:"editCommit",path:z,textContent:de};if(Je)ye.inPlace=!0;o.post(ye)},onEnd:()=>{T(),m=null,o.post({kind:"editEnd"})},onInsert:(z,Q,de)=>o.post({cmd:Q,commitData:de,kind:"editInsert",path:z}),onSplit:(z,Q,de)=>o.post({after:de,before:Q,kind:"editSplit",path:z})}),y(),H()},L=(V,N)=>{let z=d?.getShadowDoc?.();if(!z)return!0;let Q=xe(z,V);if(Mf(Q,N))return!1;let de=Q?.$props?.[N];if(de==null)return!0;if(!e(de))return!1;return!de.includes("${")},_=(V,N,z)=>{o.post({kind:"editStart",path:N,prop:z}),Eo(V,N,{onCommit:(Q,de,Je,ye)=>{M=!1;let Ce={kind:"editCommitProp",path:Q,prop:z,value:Je??""};if(ye)Ce.inPlace=!0;o.post(Ce)},onEnd:()=>{T(),m=null,X.forget(),o.post({kind:"editEnd"})},onInsert:()=>{},onSplit:()=>{}},{plainText:!0})},Y=(V)=>{let N=Nt();if(!N)return;if(Za())return;if(m&&m.startContainer.isConnected&&N.contains(m.commonAncestorContainer)){let z=window.getSelection();N.focus(),z?.removeAllRanges(),z?.addRange(m)}if(V.command==="link")Wa(N,V.href);else if(V.command==="insertData")Ba(N,V.token);else{let z=Rf[V.command];if(z)ja(z,N)}y(),H()},U=(V)=>{let N=V.dataset.jxBoundProp,z=Of(V),Q=z?.dataset.jxPath;if(!N||!z||!Q)return!1;let de=ge(Q);if(!L(de,N))return!1;return _(V,de,N),!0},G=(V,N)=>{let z=xa(l,V,N,at);if(!z)return!1;let[Q,de]=N===-1?[V,z.path]:[z.path,V];return X.flush(),o.post({fromPath:Q,intoPath:de,kind:"editMerge"}),!0},ne=(V,N,z)=>{let Q=po(l,at),de=ae(V.path),Je=ae(N.path),ye=Q.findIndex((Be)=>Be.dataset.jxPath===de),Ce=Q.findIndex((Be)=>Be.dataset.jxPath===Je);if(ye===-1||Ce===-1||Ce<=ye)return!1;let dn=Q.slice(ye+1,Ce).map((Be)=>ge(Be.dataset.jxPath));return X.flush(),o.post({between:dn,from:V,kind:"editRangeReplace",text:z,to:N}),!0},k=()=>y(),B=()=>y(),q=()=>y(),X=vl(l,{getMode:()=>d?.getMode?.()??"edit",isEditableBlock:at,onActivate:(V,N)=>K(V,N),onDeactivate:()=>{if(ke())Le()},onCommitTick:()=>Xa(),onMergeBackward:(V)=>G(V.path,-1),onMergeForward:(V)=>G(V.path,1),onReplaceRange:(V,N,z)=>ne(V,N,z),onPropActivate:U,onSelectionChange:()=>H(),onSplit:()=>tl()}),ce=(V)=>sl(V),ee=()=>{if(el())No()},re=()=>{if(!M)M=!0,o.post({kind:"editInput"})};l.addEventListener("input",re),l.addEventListener("keydown",ce),l.addEventListener("input",ee),f.addEventListener("mouseup",k,!0),f.addEventListener("keyup",B,!0),f.addEventListener("blur",q,!0);let be=o.onMessage((V)=>{if(V.kind==="applyFormat"){Y(V.intent);return}if(V.kind==="openSlash"){Po({anchored:!1});return}if(V.kind==="flushEdits"){X.flush(),o.post({kind:"flushComplete",reqId:V.reqId});return}if(V.kind==="endEdit"){if(ke())Le();return}if(V.kind!=="enterEdit")return;if(!p())return;if(V.prop!==void 0){let Q=_l(l,V.path)?.querySelector(`[data-jx-bound-prop="${CSS.escape(V.prop)}"]`);if(Q)U(Q);return}let N=_l(l,V.path);if(N&&at(N))X.placeCaret({offset:V.offset??0,path:V.path})});return()=>{if(l.removeEventListener("keydown",ce),l.removeEventListener("input",ee),l.removeEventListener("input",re),f.removeEventListener("mouseup",k,!0),f.removeEventListener("keyup",B,!0),f.removeEventListener("blur",q,!0),X.stop(),be(),T(),m=null,ke())Le()}}var _f=new Set(["ArrowUp","ArrowDown","Enter","Escape"]);function Df(o){return _f.has(o)}function Ll(o,l){let d=!1,f=null,p=null,m={dismiss:()=>{if(!d)return;d=!1,p=null,o.post({kind:"slashDismiss"})},isOpen:()=>d,show:(E,A,T)=>{if({onSelect:f}=T,d&&A===p)return;d=!0,p=A;let C=Pe(E),H={filter:A,kind:"slashShow",rect:{height:C.height,width:C.width,x:C.left,y:C.top}};if(T.showFilter===!0)H.showFilter=!0;o.post(H)}};vo(m);let g=(E)=>{if(!d||!Df(E.key))return;E.preventDefault(),E.stopPropagation(),o.post({key:E.key,kind:"slashNav"})},h=()=>{if(d)m.dismiss()};l.addEventListener("keydown",g,!0),l.addEventListener("mousedown",h,!0);let y=o.onMessage((E)=>{if(E.kind==="slashSelect"){d=!1,p=null,f?.({...E.cmd});return}if(E.kind==="slashDismissed")d=!1,p=null});return()=>{l.removeEventListener("keydown",g,!0),l.removeEventListener("mousedown",h,!0),y(),vo({dismiss:()=>{},isOpen:()=>!1,show:()=>{}})}}var Il=["global","canvas","caret","grid","code","dock","palette"];var Bh={"commandbar/primary":{admits:["application","document"],note:"document only for Save / Undo / Redo / Open in Browser, by frequency; ≤5 total"},"commandbar/overflow":{admits:["application","project","document"],note:"never selection — the Command Bar is not a selection surface"},"statusbar/project":{admits:["project"],note:"the status bar's left field"},"statusbar/document":{admits:["document"],note:"the status bar's centre field"},"statusbar/selection":{admits:["selection"],note:"the status bar's right field"},"context/element":{admits:["selection"],note:"the canvas element menu acts on a selection"},"context/file":{admits:["project"],note:"a file row addresses the project's file set"},"context/layer":{admits:["selection"],note:"an outline row IS a selection"},"context/tab":{admits:["document"],note:"a tab addresses one document"},"context/pane":{admits:["document"],note:"a pane hosts one document"},blockbar:{admits:["selection"],note:"the floating bar owns selection-scoped verbs"},"blockbar/format":{admits:["selection"],note:"the bar's inline-format cluster — a range inside the selection is still the selection"},"outline/row":{admits:["selection"],note:"row actions act on the row's node"},"settings/menu":{admits:["application","project"],note:"the rail foot's gear menu — the settings family. It is a MENU, not a pinned slot, so it "+"may host two levels for the reason commandbar/overflow does: a menu prints each row's own name, chord and gate, and draws a divider where the level changes. The rail's PINNED groups stay single-level, in PANEL_PLACEMENT_MATRIX"},palette:{admits:["application","project","document","selection"],note:"the level-agnostic surface; it groups rows by level"},never:{admits:["application","project","document","selection"],note:"keyboard- and API-only; no rendered surface to be misplaced in"}};var Lf=["mod","ctrl","alt","shift"],If=new Map([["mod","mod"],["cmd","mod"],["command","mod"],["meta","mod"],["super","mod"],["ctrl","ctrl"],["control","ctrl"],["alt","alt"],["opt","alt"],["option","alt"],["shift","shift"]]),jf=new Map([["up","arrowup"],["down","arrowdown"],["left","arrowleft"],["right","arrowright"],["esc","escape"],["space"," "],["spacebar"," "],["del","delete"],["plus","="],["return","enter"]]);function Hf(o){return[...Lf.filter((d)=>o[d]),o.key].join("+")}function Ff(o){return/^Digit(\d)$/.exec(o??"")?.[1]}function jl(o,l){let d=Ff(o.code)??o.key.toLowerCase();if(If.has(d))return"";let f={mod:l?o.metaKey:o.ctrlKey,ctrl:l?o.ctrlKey:!1,alt:o.altKey,shift:o.shiftKey,key:jf.get(d)??d};return Hf(f)}var zh=["global",...Il.filter((o)=>o!=="global"&&o!=="palette")];var Vf=["caret","global"],Wf=["canvas","global"],Bf=["global"],ar={chords:[],mac:!1};function Kf(o){if(!(o instanceof HTMLElement))return!1;return o.tagName==="INPUT"||o.tagName==="TEXTAREA"||o.tagName==="SELECT"}function Uf(o,l){if(o)return Vf;return l==="preview"?Bf:Wf}function qf(o,l=ar,d=!1,f="design"){if(Kf(o.target))return!1;let p=jl(o,l.mac);if(!p)return!1;let m=Uf(d,f);return l.chords.some((g)=>g.chord===p&&m.includes(g.scope))}function zf(o){return{altKey:o.altKey,code:o.code,ctrlKey:o.ctrlKey,key:o.key,metaKey:o.metaKey,shiftKey:o.shiftKey}}function Hl(o,l=document,d=()=>!1,f=()=>ar,p=()=>"design"){let m=(g)=>{if(!qf(g,f(),d(),p()))return;g.preventDefault(),o.post({event:zf(g),kind:"forwardKey"})};return l.addEventListener("keydown",m,!0),()=>l.removeEventListener("keydown",m,!0)}var Io=new WeakMap,lr=new Set;function jo(o,l,d){let f=xe(o,l);if(f===void 0)throw Error(`iframe-patch-node-not-found:${l.join("/")}`);let p=e(f)?f:kl(Rt(f),Ol(o,l)),{result:m,stop:g}=Et(()=>Ne(p,d.defs,{_path:Gf(l,d),onNodeCreated:xo(d.mapperCtx)}));if(lr.add(g),m instanceof HTMLElement)Io.set(m,g);return m}function Ho(o){let l=[o,...o.querySelectorAll("*")];for(let d of l){if(!(d instanceof HTMLElement))continue;_n(d);let f=Io.get(d);if(f)f(),lr.delete(f),Io.delete(d)}}function Fl(){for(let o of lr)o();lr.clear()}function Gf(o,l){let{mapperCtx:d}=l;if(d.layoutWrapped&&d.pageContentPrefix&&o[0]==="children"){let[,f]=o;return i(f)?[...d.pageContentPrefix,f+(d.pageContentOffset??0),...o.slice(2)]:[...d.pageContentPrefix,...o.slice(1)]}return o}function Bl(o,l,d,f,p){for(let g of l)bo(o,g);if(!p?.length){for(let g of l)Vl(o,g,d,f);return}let m=new Set(p.map((g)=>ae(g)));for(let g of l){if(g.op==="set-key"&&m.has(ae(g.path))){Yf(o,g.path,d);continue}Vl(o,g,d,f)}}function Yf(o,l,d){let f=ql(d,l);if(f)Ot(f,xe(o,l))}function Fo(o){if(!o)throw Error("iframe-patch-no-render-ctx");return o}function Vl(o,l,d,f){switch(l.op){case"set-key":{if(l.key==="style"){tp(o,l.path,d,f);return}if(l.key==="textContent"){np(o,l.path,d);return}if(l.key.startsWith("on"))return;Wl(o,l.path,d,Fo(f));return}case"insert-child":{Xf(o,l.parentPath,l.index,d,Fo(f));return}case"set-child":{Wl(o,[...l.parentPath,"children",l.index],d,Fo(f));return}case"remove-child":{Zf(o,l.parentPath,l.index,d);return}case"move-child":{Qf(o,l.fromParentPath,l.fromIndex,l.toParentPath,l.toIndex,d);return}default:throw Error(`iframe-patch-unsupported-op:${JSON.stringify(l)}`)}}function Xf(o,l,d,f,p){let m=lt(f,l),g=xe(o,l),h=jo(o,[...l,"children",d],p);cr(f,l,d,1),Kl(m,h,Ul(m,g,d)),Ot(m,g)}function Wl(o,l,d,f){let p=lt(d,l),m=jo(o,l,f);Ho(p),p.replaceWith(m)}function Zf(o,l,d,f){let p=lt(f,[...l,"children",d]),m=p.parentElement;if(Ho(p),p.remove(),cr(f,l,d+1,-1),m)Ot(m,xe(o,l))}function Qf(o,l,d,f,p,m){let g=[...l,"children",d],h=lt(m,g),y=h.parentElement,E=lt(m,f);h.remove(),cr(m,l,d+1,-1);let A=ur(E)??f;cr(m,A,p,1),ep(h,g,[...A,"children",p]);let T=xe(o,A);if(Kl(E,h,Ul(E,T,p)),y)Ot(y,xe(o,ur(y)??l));Ot(E,T)}function Ot(o,l){for(let f of Tl)o.classList.remove(f);let d=l?Do(l):null;if(d)o.classList.add(d)}function Kl(o,l,d){if(d)d.before(l);else o.append(l)}function Ul(o,l,d){let f=l?.textContent,p=f!=null&&String(f)!==""?1:0;return o.childNodes[p+d]??null}function cr(o,l,d,f){let p=l.length;for(let m of o.querySelectorAll("[data-jx-path]")){let g=ur(m);if(!g||g.length<p+2||g[p]!=="children")continue;let h=g[p+1];if(!i(h)||h<d)continue;if(!l.every((E,A)=>g[A]===E))continue;let y=[...g];y[p+1]=h+f,m.dataset.jxPath=ae(y)}}function ep(o,l,d){let f=[o,...o.querySelectorAll("[data-jx-path]")];for(let p of f){let m=ur(p);if(!m||m.length<l.length||!l.every((g,h)=>m[h]===g))continue;p.dataset.jxPath=ae([...d,...m.slice(l.length)])}}function ur(o){let l=o.dataset.jxPath;return l===void 0?null:ge(l)}function tp(o,l,d,f){let p=lt(d,l),m=xe(o,l),g=f?.defs.$media??{};Bn(p,rp(m?.style),g,f?.defs??{})}function np(o,l,d){let f=lt(d,l),p=xe(o,l);f.textContent=op(p),Ot(f,p)}function lt(o,l){let d=ql(o,l);if(!d)throw Error(`iframe-patch-element-not-found:${ae(l)}`);return d}function ql(o,l){let f=ae(l).replaceAll("\\",String.raw`\\`).replaceAll("'",String.raw`\'`),p=o.querySelector(`[data-jx-path='${f}']`);return p instanceof HTMLElement?p:null}function rp(o){if(!o||!n(o))return;let l={};for(let[d,f]of Object.entries(o)){if(We(f))continue;l[d]=f}return l}function op(o){let l=o?.textContent;if(l==null)return"";if(e(l))return l.includes("${")?$t(l):l;if(n(l)&&l.$ref){let d=String(l.$ref);return`{${d.startsWith("#/state/")?d.slice(8):d}}`}return String(l)}function zl(o){if(o===void 0)return"undefined";let l;try{l=JSON.stringify(o)??"undefined"}catch{l=String(o)}if(l.length>48)l=`${l.slice(0,47)}…`;return l}function ip(o){return s(o)&&"$expression"in o&&Array.isArray(o.parameters)}function sp(o){try{return structuredClone(o)}catch{return null}}function ap(o,l){let d={};for(let f of Object.keys(o))try{let p=o[f];if(t(p)){if(ip(l?.[f]))d[f]=p;continue}let m=JSON.stringify(p);d[f]=m===void 0?null:JSON.parse(m)}catch{d[f]=null}return d}function lp(o,l,d){if(!d||d.length===0)return o;let f=l,p=o;for(let m of d){if(!n(f))break;let g=f;if(g.$prototype==="Array"&&m==="map"){let h=g.items,y=r(h)?ve(h.$ref,p):h;if(Array.isArray(y)&&y.length>0){let[E]=y,A=sp(E),T=Object.create(p);T.$map={index:0,item:A},T["$map/item"]=A,T["$map/index"]=0,p=T}}f=g[m]}return p}function Gl(o,l,d,f){let p=d?.state??null;return o.map(({id:m,node:g})=>{let h=new Map,y;try{y=lp(ap(l,p),d,f)}catch(E){return{error:E instanceof Error?E.message:String(E),id:m,values:[]}}try{if(!n(g)||!("operator"in g))throw Error("not an expression node");return Ae(g,y,null,void 0,{report:(E,A)=>{h.set(E.join("/"),zl(A))}}),{id:m,values:[...h.entries()]}}catch(E){return{error:E instanceof Error?E.message:String(E),id:m,values:[...h.entries()]}}})}var cp=256000,up="[large value omitted]";function Yl(o){let l={};for(let d of Object.keys(o))try{let f=o[d];if(t(f))continue;let p=JSON.stringify(f);if(p===void 0){l[d]=null;continue}if(p.length>cp){l[d]=up;continue}l[d]=JSON.parse(p)}catch{l[d]=null}return l}function Xl(o,l){return new URL(`/node_modules/${o}`,l).href}var Zl={"jx-ui:/behaviors/color-area.ts":()=>(me("gbcftzh3"),import("./chunks/color-area-gbcftzh3.js")),"jx-ui:/behaviors/color-field.ts":()=>(me("85136598"),import("./chunks/color-field-85136598.js")),"jx-ui:/behaviors/color-slider.ts":()=>(me("w1s3ndd8"),import("./chunks/color-slider-w1s3ndd8.js")),"jx-ui:/behaviors/combobox.ts":()=>(me("dk98wc5x"),import("./chunks/combobox-dk98wc5x.js")),"jx-ui:/behaviors/dialog.ts":()=>(me("c4x05vyx"),import("./chunks/dialog-c4x05vyx.js")),"jx-ui:/behaviors/listbox.ts":()=>(me("k5p41049"),import("./chunks/listbox-k5p41049.js")),"jx-ui:/behaviors/menu.ts":()=>(me("26nez152"),import("./chunks/menu-26nez152.js")),"jx-ui:/behaviors/number-field.ts":()=>(me("y62xq0ty"),import("./chunks/number-field-y62xq0ty.js")),"jx-ui:/behaviors/action-group.ts":()=>(me("4aan7g6g"),import("./chunks/action-group-4aan7g6g.js")),"jx-ui:/behaviors/popover.ts":()=>(me("fhdnt4be"),import("./chunks/popover-fhdnt4be.js")),"jx-ui:/behaviors/select.ts":()=>(me("rzds841e"),import("./chunks/select-rzds841e.js")),"jx-ui:/behaviors/split.ts":()=>(me("qh21j2b0"),import("./chunks/split-qh21j2b0.js")),"jx-ui:/behaviors/swatch-group.ts":()=>(me("ewh24n1f"),import("./chunks/swatch-group-ewh24n1f.js")),"jx-ui:/behaviors/tabs.ts":()=>(me("f5cw3tgp"),import("./chunks/tabs-f5cw3tgp.js")),"jx-ui:/behaviors/toolbar.ts":()=>(me("44cm5cta"),import("./chunks/toolbar-44cm5cta.js")),"jx-ui:/behaviors/tree.ts":()=>(me("a19s1c05"),import("./chunks/tree-a19s1c05.js")),"jx-ui:/behaviors/tooltip.ts":()=>(me("gtx40bjg"),import("./chunks/tooltip-gtx40bjg.js")),"jx-ui:/behaviors/textfield.ts":()=>(me("wewc8rq2"),import("./chunks/textfield-wewc8rq2.js")),"jx-ui:/behaviors/toast.ts":()=>(me("w11qpkyz"),import("./chunks/toast-w11qpkyz.js")),"jx-ui:/behaviors/toast-host.ts":()=>(me("g3r2s0kn"),import("./chunks/toast-host-g3r2s0kn.js")),"jx-ui:/color.ts":()=>(me("thzpppyc"),import("./chunks/color-thzpppyc.js")),"jx-ui:/icons.ts":()=>(me("j9eksgew"),import("./chunks/icons-j9eksgew.js"))};var dp;function Ql(o){dp=new URL("./",o).href}Ql(import.meta.url);for(let[o,l]of Object.entries(Zl))zs(o,l);Us((o)=>Xl(o,location.href));function un(o,l,d,f){let p=$o(o.x,o.y,f);if(!p)return null;return Oo(p,o.y,d,l)}function Vo(o){return[...o.dataTransfer?.types??[]].includes("Files")}var fp={type:"block"},Bo={},Ko={},Wo=null;function ec(o){return o?{...o,revisions:Ko,versions:Bo}:null}function pp(o,l){let d=o.dataset.jxPath;if(d==null)return null;let f=ge(d),p=l?xe(l,f):void 0;return{path:f,rect:Qe(o),tagName:(u(p?.tagName)||o.tagName).toLowerCase()}}function mp(o){if(!(o instanceof Element))return null;if(o.closest("[data-jx-path]"))return null;let l=o.closest("[data-jx-layout-region]");if(!(l instanceof HTMLElement))return null;return{className:l.className,layoutFile:l.dataset.jxLayoutFile??"",layoutPath:ge(l.dataset.jxLayoutPath??"[]"),rect:Qe(l),tagName:l.tagName.toLowerCase()}}function tc(o){let l=n(o)&&"message"in o?o.message:void 0;return String(l??o)}var hp=new Set(["style","textContent"]);function gp(o){let l=Qa();if(!l)return!1;for(let d of o){let f;if(d.op==="set-key"){if(hp.has(d.key)||d.key.startsWith("on"))continue;f=d.path}else if(d.op==="move-child"){if(f=d.fromParentPath,st(f,l)||st(d.toParentPath,l))return!0;continue}else f=d.parentPath;if(st(f,l))return!0}return!1}var xp=2,yp=5000,bp=500;function Sp(o){let{channel:l,container:d}=o;Bo={},Ko={},Wo=null;let f=null,p=null,m=-1,g=Ta(d.ownerDocument),h=null,y=-1,E="design",A=null,T=null,C=ar,H=null,M=null,K=-1,L=-1,_=0,Y=null,U=d.ownerDocument.defaultView;function G(){if(_&&U)U.cancelAnimationFrame(_);_=0,Y=null}function ne(){_=0;let P=Y?.src??M;if(!U||!Y||!P||!h)return;let ie=Mo(Y.y,U.innerHeight);if(ie===0)return;let oe=U.scrollY;if(U.scrollBy(0,ie*gl),U.scrollY===oe)return;let Ee=un(Y,P,h,d.ownerDocument),se={dragSeq:Y.dragSeq,gen:Y.gen??K,kind:"dragOver",preview:Ee};if(Y.withCursor)se.cursor={x:Y.x,y:Y.y};l.post(se),_=U.requestAnimationFrame(ne)}function k(P,ie,oe){if(!U||Mo(P.y,U.innerHeight)===0){G();return}let Ee={dragSeq:ie,withCursor:oe!=null,x:P.x,y:P.y};if(oe)Ee.gen=oe.gen,Ee.src=oe.src;if(Y=Ee,!_)_=U.requestAnimationFrame(ne)}let B=fl(l,d.ownerDocument,{getGen:()=>y,getMode:()=>E,getShadowDoc:()=>h}),q=(P)=>{if(E!=="design"&&E!=="edit")return;let ie=mp(P.target);if(ie)l.post({hit:ie,kind:"layoutHit"})};d.ownerDocument.addEventListener("click",q,!0);let X=Hl(l,d.ownerDocument,ke,()=>C,()=>E),ce=Dl(l,d,{getMode:()=>E,getShadowDoc:()=>h}),ee=Ll(l,d.ownerDocument),re=Aa(d),be=30000,V=-1;function N(){let P=d.querySelectorAll("[data-jx-popover][data-jx-popover-open], dialog[data-jx-dialog-open]"),ie=Pe(d),oe=0;for(let Ee of P)oe=Math.max(oe,Pe(Ee).bottom-ie.top);return oe}function z(){let P=Math.max(d.scrollHeight,N()),ie=Math.min(P,be);if(ie>0&&Math.abs(ie-V)>=1){V=ie;let oe=d.firstElementChild,Ee=oe instanceof HTMLElement&&oe.dataset.jxDefinitionRoot!==void 0;l.post({fragment:Ee,height:ie,kind:"contentHeight"}),ct()}}let Q=U?.ResizeObserver,de=Q?new Q(()=>z()):null,Je=d.ownerDocument,ye=0,Ce=0,dn=0,Be="",Mt=new Map;function nc(){let P=Date.now();for(let[ie,oe]of Mt)if(oe<=P)Mt.delete(ie);return Mt.size}function rc(){let P=Je;return{animations:P.getAnimations?.().filter((oe)=>oe.playState==="running").length??0,fonts:P.fonts?P.fonts.status==="loaded":!0,gen:y,images:nc(),kind:"idle"}}function Uo(){ye=0;let P=rc(),ie=`${P.gen}|${P.fonts}|${P.animations}|${P.images}`,oe=ie!==Be;if(oe)Be=ie,l.post(P);if(Ce=P.fonts&&P.animations===0&&P.images===0?oe?1:Ce+1:0,Ce>=xp){z();return}if(Date.now()>=dn)return;ye=U?U.requestAnimationFrame(Uo):0}function ct(){if(Ce=0,dn=Date.now()+yp,!ye&&U)ye=U.requestAnimationFrame(Uo)}let qo=(P)=>{if(P.target instanceof HTMLImageElement&&yo(P.target))Mt.set(P.target,Date.now()+bp),ct()},zo=(P)=>{if(P.target instanceof HTMLImageElement&&Mt.delete(P.target))ct()};d.addEventListener("error",qo,!0),d.addEventListener("load",zo,!0),ct(),de?.observe(d);let Go=(P)=>{if(E==="preview"){if(P.ctrlKey||P.metaKey)P.preventDefault();return}P.preventDefault(),l.post({ctrlKey:P.ctrlKey,deltaX:P.deltaX,deltaY:P.deltaY,kind:"forwardWheel",metaKey:P.metaKey,shiftKey:P.shiftKey,x:P.clientX,y:P.clientY})};d.ownerDocument.addEventListener("wheel",Go,{passive:!1});let oc=300,Yo=0,Xo=(P,ie)=>{P.preventDefault(),P.stopPropagation();let oe={x:P.clientX,y:P.clientY},Ee=d.ownerDocument,se=$o(oe.x,oe.y,Ee),$e=se?pp(se,h):null,pn=h&&se?Oo(se,oe.y,h,fp):null;if(ie==="fileDragOver"){if(P.dataTransfer)P.dataTransfer.dropEffect="copy";l.post({hit:$e,kind:"fileDragOver",preview:pn});return}l.post({files:[...P.dataTransfer?.files??[]],hit:$e,kind:"fileDrop",preview:pn})},fn=(P)=>{if(!M){if(Vo(P)){Xo(P,"fileDragOver");return}let Ee=Date.now();if(Ee-Yo>=oc)Yo=Ee,l.post({kind:"nativeDragEnter"});return}if(P.preventDefault(),P.dataTransfer)P.dataTransfer.dropEffect="move";let ie={x:P.clientX,y:P.clientY},oe=h?un(ie,M,h,d.ownerDocument):null;l.post({cursor:ie,dragSeq:L,gen:K,kind:"dragOver",preview:oe}),k(ie,L)},Zo=(P)=>{if(!M){if(Vo(P))Xo(P,"fileDrop");return}P.preventDefault();let ie={x:P.clientX,y:P.clientY},oe=h?un(ie,M,h,d.ownerDocument):null;l.post({dragSeq:L,gen:K,instruction:oe?.instruction??null,kind:"dropResult",targetPath:oe?.targetPath??null}),M=null,K=-1,L=-1,G()},Qo=(P)=>{if(!M&&Vo(P)&&!P.relatedTarget)l.post({kind:"fileDragLeave"})};d.ownerDocument.addEventListener("dragenter",fn,!0),d.ownerDocument.addEventListener("dragover",fn,!0),d.ownerDocument.addEventListener("dragleave",Qo,!0),d.ownerDocument.addEventListener("drop",Zo,!0);let ic=l.onMessage((P)=>{if(P.kind==="measure"){let{hidden:se,hits:$e}=dl(P.paths,d.ownerDocument);l.post({hidden:se,hits:$e,kind:"geometry",reqId:P.reqId});return}if(P.kind==="evalExpr"){let se=P.gen===y&&H&&h?Gl(P.exprs,H.defs,h,P.contextPath):[];l.post({gen:P.gen,kind:"evalResult",reqId:P.reqId,results:se});return}if(P.kind==="patch"){let{gen:se}=P;if(se<y){l.post({gen:se,kind:"patchError",message:"patch-behind-render"});return}if(se>y||!h||!H){l.post({gen:se,kind:"patchError",message:"patch-ahead-of-render"});return}let $e=new Set((P.echoPaths??[]).map((ut)=>ae(ut))),pn=$e.size===0?P.forwardOps:P.forwardOps.filter((ut)=>!(ut.op==="set-key"&&$e.has(ae(ut.path)))),ei=ke()&&gp(pn),ti=ei?or(d,at):null;if(ei)Le();try{if(Bl(h,P.forwardOps,d,H,P.echoPaths),rn(d,A),Tt(d,T),ti)cn(d,ti);l.post({gen:se,kind:"patchComplete"}),ct()}catch(ut){l.post({gen:se,kind:"patchError",message:tc(ut)})}return}if(P.kind==="styleUpdate"){if(P.gen!==y||!h)return;h.style=P.style;let se=d.firstElementChild;if(se instanceof HTMLElement)Bn(se,P.style,h.$media??{});return}if(P.kind==="dragStart"){M=P.src,K=P.gen,L=P.dragSeq;return}if(P.kind==="dragEnd"||P.kind==="dragCancel"){M=null,K=-1,L=-1,G();return}if(P.kind==="dragMove"){let se=M&&h?un(P.cursor,M,h,d.ownerDocument):null;l.post({dragSeq:P.dragSeq,gen:K,kind:"dragOver",preview:se}),k(P.cursor,P.dragSeq);return}if(P.kind==="drop"){let se=M&&h?un(P.cursor,M,h,d.ownerDocument):null;l.post({dragSeq:P.dragSeq,gen:K,instruction:se?.instruction??null,kind:"dropResult",targetPath:se?.targetPath??null}),M=null,K=-1,L=-1,G();return}if(P.kind==="assetVersions"){Bo=P.versions,Ko=P.revisions??{};let se=ec(Wo);if(se)jn(($e)=>en($e,se));return}if(P.kind==="keymap"){C={chords:P.chords,mac:P.mac};return}if(P.kind==="setColorScheme"){go(d.ownerDocument,P.scheme);return}if(P.kind==="setPopoverOpen"){if(E==="preview")return;A=P.path===null?null:ae(P.path),rn(d,A),Tt(d,T),z();return}if(P.kind==="setDialogOpen"){if(E==="preview")return;T=P.path===null?null:ae(P.path),Tt(d,T),z();return}if(P.kind==="redefineElement"){oa(P.doc,P.base);return}if(P.kind==="setLocale"){Gn(d.ownerDocument,P.locale===null?null:{dir:P.dir,locale:P.locale},g);return}if(P.kind==="siteStyleUpdate"){ho(P.siteStyle,P.media);return}if(P.kind!=="render"||P.gen<m)return;if(go(d.ownerDocument,P.colorScheme??null),Gn(d.ownerDocument,P.locale??null,g),ke())Le();m=P.gen,Wo=P.assets??null,Ya(P.editableTags??null);let{gen:ie,mapperCtx:oe}=P,Ee=P.shadowDoc;(async()=>{try{Fl(),p?.(),p=null,f?.dispose(),Qs(d.ownerDocument);let se={assets:ec(P.assets??null),container:d,doc:P.doc,docBase:P.docBase,mapperCtx:{arrayPaths:new Set(oe.arrayPaths),canvasMode:oe.canvasMode,layoutWrapped:oe.layoutWrapped,pageContentOffset:oe.pageContentOffset,pageContentPrefix:oe.pageContentPrefix},diffMarks:P.diffMarks??null,mode:P.mode,popoverOpen:P.popoverOpen?ae(P.popoverOpen):null,dialogOpen:P.dialogOpen?ae(P.dialogOpen):null,siteStyle:P.siteStyle};if(P.allowAutoRequests)se.allowAutoRequests=!0;if(f=await Ca(se),ie===m){A=P.popoverOpen?ae(P.popoverOpen):null,T=P.dialogOpen?ae(P.dialogOpen):null,rn(d,A),Tt(d,T),h=Ee,H=f.ctx,y=ie,E=P.mode,l.post({gen:ie,kind:"renderComplete"}),ct();let{defs:$e}=f.ctx;p=Ms(()=>{try{l.post({gen:ie,kind:"dataScope",scope:Yl($e)})}catch{}}),z()}}catch(se){l.post({gen:ie,kind:"renderError",message:tc(se)})}})()});return l.post({kind:"ready"}),()=>{if(ic(),Gn(d.ownerDocument,null,g),B(),X(),ce(),ee(),re(),ye&&U)U.cancelAnimationFrame(ye);ye=0,d.removeEventListener("error",qo,!0),d.removeEventListener("load",zo,!0),G(),de?.disconnect(),d.ownerDocument.removeEventListener("click",q,!0),d.ownerDocument.removeEventListener("wheel",Go),d.ownerDocument.removeEventListener("dragenter",fn,!0),d.ownerDocument.removeEventListener("dragleave",Qo,!0),d.ownerDocument.removeEventListener("dragover",fn,!0),d.ownerDocument.removeEventListener("drop",Zo,!0),p?.(),f?.dispose()}}function vp(o){let l=new URLSearchParams(o.location.search);$s(l.get("rpcToken"));let d=l.get("parentOrigin"),f=d||"*";if(!d)console.warn("[jx-canvas] no parentOrigin in iframe URL — accepting messages from any origin (token-gated). "+"The parent origin did not round-trip; the channel relies on the shared token alone.");let p=o.document.querySelector("#jx-canvas-root"),m=p instanceof HTMLElement?p:o.document.body,g=ri({acceptOrigin:f,source:o,target:o.parent,targetOrigin:f,token:l.get("token")||""});return Sp({channel:g,container:m})}if(typeof window<"u"&&window.parent!==window)vp(window);export{xp as IDLE_QUIET_FRAMES,yp as IDLE_WATCH_MAX_MS,bp as IMAGE_RETRY_WINDOW_MS,vp as bootCanvasIframe,pp as fileDropHitFor,Vo as isExternalFileDrag,mp as layoutHitFor,gp as patchDisturbsActiveEdit,Sp as startCanvasIframe};
|
|
313
|
+
`;function Ld(o,l){let d=o.head.querySelector(`#${Pa}`);if(l!=="stylebook"){d?.remove();return}if(d)return;let f=o.createElement("style");f.id=Pa,f.textContent=_d,o.head.append(f)}function bo(o,l={}){let d=document.head.querySelector(`#${yo}`);if(!o||!n(o)){d?.remove();return}let f=wa(o,l,kn);if(d){d.textContent=f;return}let p=document.createElement("style");p.id=yo,p.textContent=f,document.head.append(p)}function So(o,l){if(l)o.documentElement.dataset.colorScheme=l;else delete o.documentElement.dataset.colorScheme}function Ra(o){let l=o.documentElement;return{dir:l.getAttribute("dir"),lang:l.getAttribute("lang")}}function Na(o,l,d){if(d===null)o.removeAttribute(l);else o.setAttribute(l,d)}function Xn(o,l,d){let f=o.documentElement;Na(f,"lang",l?.locale??d.lang),Na(f,"dir",l?.dir==="rtl"?"rtl":d.dir)}function on(o,l){for(let f of o.querySelectorAll("[data-jx-popover-open]"))delete f.dataset.jxPopoverOpen;if(l===null)return;let d=o.querySelector(`[data-jx-popover]${it(l)}`);if(d)d.dataset.jxPopoverOpen=""}function Tt(o,l){for(let f of o.querySelectorAll("[data-jx-dialog-open]"))delete f.dataset.jxDialogOpen;if(l===null)return;let d=o.querySelector(`dialog${it(l)}`);if(d)d.dataset.jxDialogOpen=""}function Id(o,l=null){let d=o.$head;if(!Array.isArray(d))return;for(let f of d){if(!n(f)||!f.tagName)continue;let p=String(f.tagName).toLowerCase();if(p==="script"&&!f.attributes?.src)continue;let m={...f.attributes};for(let y of["href","src"]){let E=m[y];if(!e(E)||E==="")continue;if(!E.startsWith("/")&&!E.startsWith(".")&&!E.startsWith("http")){m[y]=`/node_modules/${E}`;continue}m[y]=tn(E,l)??E}let g=`${p}${m.href?`[href="${String(m.href)}"]`:""}${m.src?`[src="${String(m.src)}"]`:""}`;if(g!==p&&document.head.querySelector(g))continue;let h=document.createElement(p);for(let[y,E]of Object.entries(m))h.setAttribute(y,String(E));if(f.textContent)h.textContent=String(f.textContent);document.head.append(h)}}function vo(o){let l=[],d=(f)=>l.some((p)=>f.length>p.length&&p.every((m,g)=>f[g]===m));return(f,p,m)=>{if(!(f instanceof HTMLElement))return;let g=p.length===0&&n(m)&&e(m.tagName)&&m.tagName.includes("-");if(g)f.dataset.jxDefinitionRoot="";let h=!g&&f.tagName.includes("-")&&Yn(o.canvasMode);if(h)f.contentEditable="false",l.push(p);let y=ba(p,m,o);if(y.kind==="layout"){if(f.dataset.jxLayoutPath=ae(y.layoutPath),y.layoutFile)f.dataset.jxLayoutFile=y.layoutFile;if(y.chrome){if(f.dataset.jxLayoutRegion="",Yn(o.canvasMode))f.contentEditable="false"}return}if(f.dataset.jxPath=ae(y.path),!h&&Yn(o.canvasMode)&&d(p))f.contentEditable="true"}}function Eo(o){let l=o.getAttribute("src")?.trim()??"";return l!==""&&!l.startsWith("data:")}function $a(o,l=3){let d=new WeakMap,f=(p)=>{let m=p.target;if(!(m instanceof HTMLImageElement))return;if(!Eo(m))return;let g=(d.get(m)??0)+1;if(g>l)return;d.set(m,g),setTimeout(()=>{let h=m.src;m.src="",m.src=h},150*g)};return o.addEventListener("error",f,!0),()=>o.removeEventListener("error",f,!0)}async function Oa(o){let l=o.assets??null;Hn(l?(h)=>tn(h,l):null),Ms(o.mode!=="preview"),$s(Ad),Js(o.mode!=="preview"&&!o.allowAutoRequests),js(!0),Fs(o.mode!=="preview"&&o.mode!=="stylebook"),Vs(o.mode!=="preview"),Ws(o.mode!=="preview"),Ks(o.mode==="design"||o.mode==="edit"),bo(o.siteStyle,o.doc.$media??{}),Id(o.doc,l),Nd(o.container.ownerDocument,o.mode),$d(o.container.ownerDocument,o.mode),Jd(o.container.ownerDocument,o.mode),Ld(o.container.ownerDocument,o.mode),Md(o.container.ownerDocument,Boolean(o.diffMarks?.length)),ua(o.doc.$media??{}),await Cd(o.doc,o.docBase);let d=await Fn(o.doc,{},o.docBase),f=vo(o.mapperCtx),{result:p,stop:m}=Et(()=>Ne(o.doc,d,{_path:[],onNodeCreated:f}));o.container.replaceChildren(p),on(o.container,o.popoverOpen??null),Tt(o.container,o.dialogOpen??null),Dd(o.container,o.mode),kd(o.container,o.diffMarks??null);let g=o.mode==="stylebook"?ya(o.container):null;return{ctx:{defs:d,docBase:o.docBase,mapperCtx:o.mapperCtx,mode:o.mode},dispose:()=>{g?.(),m()}}}function jd(o){return JSON.parse(JSON.stringify(o))}function Zn(o){return o===void 0||o===null?o:jd(o)}function xe(o,l){let d=o;for(let f of l){if(d==null)return;d=d[f]}return d}function Ma(o){if(Array.isArray(o))throw TypeError("Cannot insert into a children array; parentPath must point at a node");if(!o.children)o.children=[];if(!Array.isArray(o.children))throw TypeError("Cannot insert into mapped-array children; edit the map template instead");return o.children}function wo(o,l){let{op:d}=l;switch(l.op){case"set-key":{let f=xe(o,l.path);if(!f)throw Error(`doc-op-node-not-found:${l.path.join("/")}`);if(l.value===void 0)delete f[l.key];else f[l.key]=Zn(l.value);return}case"insert-child":{sn(o,l.parentPath).splice(l.index,0,Zn(l.node));return}case"remove-child":{sn(o,l.parentPath).splice(l.index,1);return}case"set-child":{sn(o,l.parentPath).splice(l.index,1,Zn(l.node));return}case"move-child":{Hd(l);let f=sn(o,l.fromParentPath),p=sn(o,l.toParentPath),[m]=f.splice(l.fromIndex,1);p.splice(l.toIndex,0,m);return}default:break}throw Error(`unknown-doc-op:${d}`)}function sn(o,l){let d=xe(o,l);if(d==null)throw TypeError(`doc-op-node-not-found:${l.join("/")}`);return Ma(d)}function Hd(o){let l=[...o.fromParentPath,"children",o.fromIndex],d=o.toParentPath;if(d.length>=l.length&&l.every((f,p)=>f===d[p]))throw Error(`doc-op-move-into-self:${d.join("/")}`)}function st(o,l){if(o.length>l.length)return!1;return o.every((d,f)=>d===l[f])}function ka(o){return o.length>=2?o.slice(0,-2):null}function Ja(o){return o.at(-1)}function Da(o,l){if(o===l)return!0;if(!o||!l||o.length!==l.length)return!1;return o.every((d,f)=>d===l[f])}var Qn=14,Fd="empty-container-placeholder";function _a(o){let l=Pe(o);return{height:l.height,width:l.width,x:l.x,y:l.y}}function Vd(o){let l=getComputedStyle(o),{display:d}=l,f=d==="flex"||d==="inline-flex",p=d==="grid"||d==="inline-grid";return f&&l.flexDirection.startsWith("row")||p&&l.gridAutoFlow.startsWith("column")}function ja(o,l,d){let f=o.dataset.jxPath;if(f==null)return null;let p=he(f);if(o.classList.contains(Fd))return[{edge:"center",index:0,insertParentPath:p,rect:_a(o)}];let m=ka(p);if(!m)return null;let g=o.parentElement;if(!g)return null;let h=Ja(p);if(!s(h))return null;let y=_a(o);if(Vd(g)){let A=l.x-y.x;if(A<Qn)return[er("left",m,h,La(y,!0))];if(y.width-A<Qn)return[er("right",m,h+1,Ia(y,!0))];return null}let E=l.y-y.y;if(E<Qn)return[er("top",m,h,La(y,!1))];if(y.height-E<Qn)return[er("bottom",m,h+1,Ia(y,!1))];return null}function er(o,l,d,f){return{edge:o,index:d,insertParentPath:l,rect:f}}function La(o,l){return l?{height:o.height,width:0,x:o.x,y:o.y}:{height:0,width:o.width,x:o.x,y:o.y}}function Ia(o,l){return l?{height:o.height,width:0,x:o.x+o.width,y:o.y}:{height:0,width:o.width,x:o.x,y:o.y+o.height}}function Ha(o){if(!o||o.length===0)return"none";return o.map((l)=>`${l.edge}:${l.insertParentPath.join("/")}:${l.index}`).join("|")}var tr=new Set(["strong","em","b","i","u","del","s","strike","code","sub","sup","span"]);function To(o){return o.nodeType===Node.ELEMENT_NODE}function Fa(o){return o.nodeType===Node.TEXT_NODE}function Wa(o,l){if(!l)return!1;if(l.contentEditable==="plaintext-only")return!1;let d=window.getSelection();if(!d||!d.rangeCount)return!1;let{anchorNode:f,focusNode:p}=d;if(!f||!p)return!1;if(!l.contains(f)||!l.contains(p))return!1;let m=(g)=>{let h=g;while(h&&h!==l){if(To(h)&&h.tagName.toLowerCase()===o)return!0;h=h.parentNode}return!1};return m(f)&&m(p)}function Ba(o,l){if(!l)return;let d=window.getSelection();if(!d||!d.rangeCount)return;let f=d.getRangeAt(0);if(f.collapsed)return;if(!l.contains(f.commonAncestorContainer))return;ef(f);let p=Wd(o,f,l);if(p.length>0)Bd(o,f,l,p);else Kd(o,f,l);At(l)}function Wd(o,l,d){let f=[];for(let p of d.querySelectorAll("*"))if(p.tagName.toLowerCase()===o&&l.intersectsNode(p))f.push(p);return f}function Bd(o,l,d,f){for(let p=f.length-1;p>=0;p--){let m=f[p];Ka(m)}}function Ka(o){if(!o.parentNode)return;let d=document.createDocumentFragment();while(o.firstChild)d.append(o.firstChild);o.replaceWith(d)}function Kd(o,l,d){let f=l.extractContents(),p=Ud(f),m=qd(f);if(!f.hasChildNodes()){if(p)l.insertNode(document.createTextNode(p));if(m){let E=document.createTextNode(m);l.collapse(!1),l.insertNode(E)}return}let g=document.createElement(o);g.append(f);let h=document.createDocumentFragment();if(p)h.append(document.createTextNode(p));if(h.append(g),m)h.append(document.createTextNode(m));l.insertNode(h);let y=window.getSelection();if(y){y.removeAllRanges();let E=document.createRange();E.selectNodeContents(g),y.addRange(E)}}function Ud(o){let l=o.firstChild;if(!l||l.nodeType!==Node.TEXT_NODE)return null;let d=l.textContent??"",f=d.match(/^(\s+)/);if(!f)return null;let p=f[1];if(d.length===p.length)l.remove();else l.textContent=d.slice(p.length);return p}function qd(o){let l=o.lastChild;if(!l||l.nodeType!==Node.TEXT_NODE)return null;let d=l.textContent??"",f=d.match(/(\s+)$/);if(!f)return null;let p=f[1];if(d.length===p.length)l.remove();else l.textContent=d.slice(0,-p.length);return p}function At(o){if(!o)return;let l=!0,d=0;while(l&&d<10){if(l=!1,d+=1,o.normalize(),zd(o))l=!0;if(Gd(o))l=!0;if(Yd(o))l=!0;if(Xd(o))l=!0;if(Zd(o))l=!0}}function zd(o){let l=!1,d=[];for(let f of o.querySelectorAll("*")){let p=f.nextSibling;if(p&&To(p)&&p.tagName===f.tagName&&tr.has(f.tagName.toLowerCase())&&Qd(f,p))d.push([f,p])}for(let f=d.length-1;f>=0;f--){let[p,m]=d[f];while(m.firstChild)p.append(m.firstChild);m.remove(),l=!0}return l}function Gd(o){let l=!1,d=[];for(let f of o.querySelectorAll("*")){if(!tr.has(f.tagName.toLowerCase()))continue;let p=f.firstChild;if(f.childNodes.length===1&&p!==null&&To(p)&&p.tagName===f.tagName)d.push(f)}for(let f of d){let p=f.firstChild;if(p===null)throw TypeError("collapseRedundantNesting: an earlier collapse emptied this wrapper");while(p.firstChild)p.before(p.firstChild);p.remove(),l=!0}return l}function Yd(o){let l=!1,d=[];for(let f of o.querySelectorAll("*")){if(!tr.has(f.tagName.toLowerCase()))continue;if(f.childNodes.length===0&&!f.textContent)d.push(f)}for(let f of d)f.remove(),l=!0;return l}function Xd(o){let l=!1,d=[];for(let f of o.querySelectorAll("*")){if(!tr.has(f.tagName.toLowerCase()))continue;if(f===o)continue;let p=f.firstChild;if(p&&Fa(p)){let g=p.textContent,h=g.match(/^(\s+)/);if(h&&g.length>h[1].length)d.push({el:f,text:p,type:"lift-leading",ws:h[1]})}let m=f.lastChild;if(m&&Fa(m)&&m!==p){let g=m.textContent,h=g.match(/(\s+)$/);if(h&&g.length>h[1].length)d.push({el:f,text:m,type:"lift-trailing",ws:h[1]})}}for(let f of d){if(f.type==="lift-leading")f.text.textContent=f.text.textContent.slice(f.ws.length),f.el.parentNode?.insertBefore(document.createTextNode(f.ws),f.el);else f.text.textContent=f.text.textContent.slice(0,-f.ws.length),f.el.parentNode?.insertBefore(document.createTextNode(f.ws),f.el.nextSibling);l=!0}return l}function Zd(o){let l=!1,d=[];for(let f of o.querySelectorAll("*")){if(f.tagName.toLowerCase()!=="span")continue;if(f===o)continue;if(f.attributes.length>0)continue;d.push(f)}for(let f of d)Ka(f),l=!0;return l}function Qd(o,l){if(o.tagName.toLowerCase()==="a")return o.getAttribute("href")===l.getAttribute("href");return!0}function ef(o){Va(o,!0),Va(o,!1)}function Va(o,l){let d=l?o.startContainer:o.endContainer,f=l?o.startOffset:o.endOffset;if(d.nodeType!==Node.TEXT_NODE)return;let p=d.textContent??"",m=tf(p);for(let g of m)if(l){if(f>g.start&&f<g.end)o.setStart(d,g.start)}else if(f>g.start&&f<g.end)o.setEnd(d,g.end)}function tf(o){let l=[],d=0;while(d<o.length-1){if(o[d]==="$"&&o[d+1]==="{"){let f=d,p=1,m=d+2;while(m<o.length&&p>0){if(o[m]==="{")p+=1;else if(o[m]==="}")p-=1;m+=1}if(p===0){l.push({end:m,start:f}),d=m;continue}}d+=1}return l}var nr=(o,l)=>document.execCommand(o,!1,l);function Ua(o){return o.nodeType===Node.ELEMENT_NODE&&o.nodeName.toLowerCase()==="a"}function qa(o){let l=window.getSelection();if(!l||!l.rangeCount)return{active:!1,href:null};let d=l.anchorNode;while(d&&d!==o){if(Ua(d))return{active:!0,href:d.dataset.jxHref??d.getAttribute("href")};d=d.parentNode}return{active:!1,href:null}}function nf(o){let l=window.getSelection();if(!l||!l.rangeCount)return null;let d=l.anchorNode;while(d&&d!==o){if(Ua(d))return d;d=d.parentNode}return null}function za(o,l){let d=nf(o);if(d)if(l)d.setAttribute("href",l);else{let f=document.createDocumentFragment();while(d.firstChild)f.append(d.firstChild);d.replaceWith(f)}else if(l)nr("createLink",l);At(o)}function Ga(o,l){o.focus(),nr("insertText",`\${${l}}`)}var Ya={$id:"elements-meta",title:"HTML Element Metadata",description:"Inline scoping and inline toolbar action metadata for HTML elements.",$convertGroups:{text:["p","h1","h2","h3","h4","h5","h6","blockquote"],container:["div","section","article","aside","main","header","footer","nav","search"],list:["ul","ol"]},$defs:{p:{$convertTo:"text",$convertToWhenEmpty:["text","container"],$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:[{tag:"strong",label:"Bold",command:"bold"},{tag:"em",label:"Italic",command:"italic"},{tag:"u",label:"Underline",command:"underline"},{tag:"del",label:"Strikethrough",command:"strikethrough"},{tag:"sup",label:"Superscript",command:"superscript"},{tag:"sub",label:"Subscript",command:"subscript"},{tag:"code",label:"Code",command:"code"},{tag:"a",label:"Link",command:"link"}]},h1:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:[{tag:"strong",label:"Bold",command:"bold"},{tag:"em",label:"Italic",command:"italic"},{tag:"code",label:"Code",command:"code"},{tag:"a",label:"Link",command:"link"}]},h2:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},h3:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},h4:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},h5:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},h6:{$convertTo:"text",$inlineChildren:["em","strong","code","a","span","br","b","i","u","sub","sup"],$inlineActions:"h1"},li:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},td:{$inlineChildren:["em","strong","del","code","a","span","br","b","i","u","sub","sup","s"],$inlineActions:"p"},th:{$inlineChildren:["em","strong","del","code","a","span","br","b","i","u","sub","sup","s"],$inlineActions:"p"},blockquote:{$convertTo:"text",$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},figcaption:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},caption:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},summary:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},dt:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},dd:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},label:{$inlineChildren:["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"],$inlineActions:"p"},a:{$inlineChildren:["em","strong","code","span","br","b","i","u","sub","sup"],$inlineActions:[{tag:"strong",label:"Bold",command:"bold"},{tag:"em",label:"Italic",command:"italic"},{tag:"code",label:"Code",command:"code"}]},span:{$inlineChildren:["em","strong","del","code","a","br","b","i","u","sub","sup","s"],$inlineActions:"p"},div:{$convertTo:"container",$convertToWhenEmpty:["container","text"],$inlineChildren:[]},section:{$convertTo:"container",$inlineChildren:[]},article:{$convertTo:"container",$inlineChildren:[]},nav:{$convertTo:"container",$inlineChildren:[]},main:{$convertTo:"container",$inlineChildren:[]},header:{$convertTo:"container",$inlineChildren:[]},footer:{$convertTo:"container",$inlineChildren:[]},aside:{$convertTo:"container",$inlineChildren:[]},ul:{$convertTo:"list",$inlineChildren:[]},ol:{$convertTo:"list",$inlineChildren:[]},pre:{$inlineChildren:["code"]},table:{$inlineChildren:[]},thead:{$inlineChildren:[]},tbody:{$inlineChildren:[]},tr:{$inlineChildren:[]}}};var Xa=Ya.$defs,of=new Set(["pre"]),sf=new Set(Object.entries(Xa).filter(([o,l])=>!of.has(o)&&(l.$inlineChildren?.length??0)>0).map(([o])=>o));function Za(o,l){return l?.[o.toLowerCase()]??sf.has(o.toLowerCase())}var af={dismiss:()=>{},isOpen:()=>!1,show:()=>{}},Qe=af;function Ao(o){Qe=o}var te=null,Re=null,Ct=null,an=null,Pt=null,Ze=null,ke=!1,cn="",ln=!1,el=null;function tl(o){el=o}function at(o){return o.getAttribute("contenteditable")!=="false"&&Za(o.tagName,el)}function Co(o,l,d,f){if(te)Ie(!0);if(te=o,Re=l,Ct=d.onCommit,an=d.onSplit,Pt=d.onInsert,Ze=d.onEnd,ke=f?.plainText===!0,cn=ke?o.textContent:"",ln=!1,o.dataset.jxActiveBlock="",ke){try{o.contentEditable="plaintext-only"}catch{o.contentEditable="true"}o.focus()}o.addEventListener("keydown",Po),o.addEventListener("input",No),o.addEventListener("paste",Ro)}function Ie(o=!1){if(!te)return;if(ll(!1),Qe.dismiss(),delete te.dataset.jxActiveBlock,ke)te.contentEditable="false";if(te.removeEventListener("keydown",Po),te.removeEventListener("input",No),te.removeEventListener("paste",Ro),te=null,Re=null,Ct=null,an=null,Pt=null,ke=!1,cn="",ln=!1,o)Ze=null;else if(Ze){let l=Ze;Ze=null,l()}}function nl(){ll(!0)}function rl(){return ke&&te!==null}function Je(){return te!==null}function Nt(){return te}function ol(){return Re}function il(){return Qe.isOpen()}function Po(o){if(ke){if(o.key==="Escape"){if(o.preventDefault(),o.stopPropagation(),te)te.textContent=cn;Ie();return}if(o.key==="Enter"){o.preventDefault(),o.stopPropagation(),Ie();return}if((o.ctrlKey||o.metaKey)&&["b","i","u","`"].includes(o.key))o.preventDefault()}}function No(){if(Qe.isOpen())Mo()}function Ro(o){o.preventDefault();let l=o.clipboardData?.getData("text/plain")??"";nr("insertText",l)}function sl(){if(!an||!te||!Re)return!1;let o=window.getSelection();if(!o||!o.rangeCount)return!1;let l=o.getRangeAt(0),d=document.createRange();d.setStart(te,0),d.setEnd(l.startContainer,l.startOffset);let f=document.createRange();f.setStart(l.endContainer,l.endOffset),f.setEnd(te,te.childNodes.length);let p=Qa(d.cloneContents()),m=Qa(f.cloneContents()),g=[...Re],h=an;return al(),h(g,p,m),!0}function al(){if(!te)return;if(delete te.dataset.jxActiveBlock,ke)te.contentEditable="false";if(te.removeEventListener("keydown",Po),te.removeEventListener("input",No),te.removeEventListener("paste",Ro),te=null,Re=null,Ct=null,an=null,Pt=null,ke=!1,cn="",ln=!1,Ze){let o=Ze;Ze=null,o()}}function ll(o){if(!Ct||!te||!Re)return;if(ke){let d=te.textContent.replaceAll(`
|
|
314
|
+
`," ");if(d===cn.replaceAll(`
|
|
315
|
+
`," ")&&!ln)return;ln=!0,Ct(Re,null,d,o);return}At(te);let l=cl(te);Ct(Re,l.children??null,l.textContent??null,o)}function lf(o){if(!Array.isArray(o.children)||o.children.length===0)return{textContent:""};let l=[];for(let d of o.children){let f=l.at(-1);if(e(d)&&e(f))l[l.length-1]=f+d;else l.push(d)}if(l.every((d)=>e(d)))return{textContent:l.join("")};return{children:l}}function cl(o){let l=o.childNodes;if(l.length===0)return{textContent:""};if(l.length===1&&l[0].nodeType===Node.TEXT_NODE)return{textContent:l[0].textContent};let d=[];for(let f of l){let p=$o(f);if(p!==null)d.push(p)}return lf({children:d})}function cf(o){return o.nodeType===Node.ELEMENT_NODE&&"dataset"in o}var uf=new Map([["b","strong"],["i","em"],["s","del"],["strike","del"]]);function $o(o){if(o.nodeType===Node.TEXT_NODE){let h=o.textContent;if(!h)return null;return h}if(!cf(o))return null;let l=o,d=l.tagName.toLowerCase(),f={tagName:d},p=uf.get(d);if(p)f.tagName=p;let m=l.dataset.jxHref??l.getAttribute("href");if(d==="a"&&m!=null){if(f.attributes={href:m},"title"in l&&e(l.title)&&l.title)f.attributes.title=l.title}if(d==="code")return f.textContent=l.textContent,f;let{childNodes:g}=l;if(g.length===0)f.textContent="";else if(g.length===1&&g[0].nodeType===Node.TEXT_NODE)f.textContent=g[0].textContent;else{f.children=[];for(let h of g){let y=$o(h);if(y)f.children.push(y)}}return f}function Qa(o){let l=o.childNodes;if(l.length===0)return{textContent:""};if(l.length===1&&l[0].nodeType===Node.TEXT_NODE)return{textContent:l[0].textContent};let d=[];for(let p of l){let m=$o(p);if(m)d.push(m)}let[f]=d;if(d.length===1&&f!==void 0&&!e(f)&&f.tagName==="span"&&e(f.textContent))return{textContent:f.textContent};return d.length>0?{children:d}:{textContent:""}}function or(o){let l=document.createRange();return l.setStart(te,0),l.setEnd(o.startContainer,o.startOffset),l.toString()}var ul=0,rr=!0;function Oo(o){if(!te||!Pt||!Re)return;if(ke)return;let l=window.getSelection();if(!l||!l.rangeCount)return;let d=l.getRangeAt(0);rr=o?.anchored!==!1,ul=or(d).length;let f={onSelect:fl};if(!rr)f.showFilter=!0;Qe.show(te,"",f)}function dl(o){if(o.key!=="/"||o.ctrlKey||o.metaKey||!te)return;let l=window.getSelection();if(!l||l.rangeCount===0)return;let d=or(l.getRangeAt(0));if(d===""||d.endsWith(" ")||d.endsWith(`
|
|
316
|
+
`))requestAnimationFrame(()=>Oo())}function Mo(){if(!te||!rr)return;let o=window.getSelection();if(!o||!o.rangeCount){Qe.dismiss();return}let l=o.getRangeAt(0),d=or(l),f=d.lastIndexOf("/");if(f===-1||d.length<ul-1){Qe.dismiss();return}let p=d.slice(f+1).toLowerCase();Qe.show(te,p,{onSelect:fl})}function fl(o){if(!te||!Pt||!Re)return;let l=rr?window.getSelection():null;if(l&&l.rangeCount){let m=l.getRangeAt(0),h=or(m).lastIndexOf("/");if(h!==-1){let y=document.createTreeWalker(te,NodeFilter.SHOW_TEXT),E=0,A=null,T=0;while(y.nextNode()){let C=y.currentNode;if(E+C.length>h){A=C,T=h-E;break}E+=C.length}if(A){let C=document.createRange();C.setStart(A,T),C.setEnd(m.startContainer,m.startOffset),C.deleteContents()}}}At(te);let d=cl(te),f=[...Re],p=Pt;al(),p(f,o,d)}function df(o,l){let{target:d}=o;return d===l||d===l.documentElement||d===l.body}function ko(o){let l=o instanceof Element?o:null;while(l){if(l instanceof HTMLElement&&l.dataset.jxPath)return l;l=l.parentElement}return null}function ml(o,l){let d=Pe(o);return{path:he(l),rect:{height:d.height,width:d.width,x:d.x,y:d.y}}}function pl(o){let l=ko(o instanceof Element?o:null);if(!l)return null;return ml(l,l.dataset.jxPath)}function hl(o){let l=o.checkVisibility;if(!t(l)||l.call(o,{checkVisibilityCSS:!0}))return!0;return hr(o)&&[...o.children].some((d)=>hl(d))}function gl(o,l=document){let d=[],f=[];for(let p of o){let m=l.querySelector(it(ae(p)));if(!m)continue;if(hl(m)){let g=Pe(m);d.push({path:p,rect:{height:g.height,width:g.width,x:g.x,y:g.y}})}else f.push(p)}return{hidden:f,hits:d}}var ff=new Set(["toggle","show","hide"]);function pf(o){return ff.has(o)}function mf(o,l){if(!(o instanceof Element))return;let d=o.closest("[popovertarget]"),f=d?.getAttribute("popovertarget");if(!d||!f)return;let g=[...d.ownerDocument.querySelectorAll("[data-jx-popover]")].find((E)=>E.id===f)?.dataset.jxPath;if(!g)return;let h=d.getAttribute("popovertargetaction")??"toggle",y=pf(h)?h:"toggle";l.post({action:y,kind:"popoverTargetClick",targetPath:he(g)})}function hf(o,l){if(!(o instanceof Element))return;let d=o.closest("[data-jx-commandfor]"),f=d?.dataset.jxCommandfor,p=d?.getAttribute("command")?.trim().toLowerCase()??"";if(!d||!f||!p)return;let h=[...d.ownerDocument.querySelectorAll("[data-jx-popover], dialog[data-jx-path]")].find((y)=>y.id===f)?.dataset.jxPath;if(!h)return;l.post({command:p,kind:"commandTargetClick",targetPath:he(h)})}function xl(o,l=document,d){let f=null,p=null,m=d?.getGen?.()??0,g=()=>d?.getMode?.()==="preview",h=()=>{o.post({kind:"paneFocus"})},y=(M)=>{if(g()){if(M.target instanceof Element){let X=M.target.closest("a[href]")?.getAttribute("href");if(X&&!X.startsWith("#"))M.preventDefault(),o.post({href:X,kind:"previewNavigate"})}return}if(d?.getMode?.()==="stylebook"&&M.target instanceof Element&&M.target.closest("a"))M.preventDefault();let B=pl(M.target);if(B)o.post({additive:M.ctrlKey===!0||M.metaKey===!0,hit:B,kind:"hit"});mf(M.target,o),hf(M.target,o)},E=(M)=>{if(g())return;let B=M?.dataset.jxPath??null;if(B===f)return;f=B,o.post({hit:M&&B?ml(M,B):null,kind:"hover"})},A=()=>{let M=d?.getGen?.()??m;if(M!==m)m=M,p="none"},T=(M,B)=>{if(!d||d.getMode?.()==="stylebook"||g())return;A();let q=d.getShadowDoc(),X=ko(M instanceof Element?M:null),ce=X&&q?ja(X,B,q):null,ee=Ha(ce);if(ee===p)return;p=ee,o.post({kind:"insertZones",zones:ce})},C=0,L=null,O=0,K=0,_=(M)=>l.defaultView?.requestAnimationFrame(M)??requestAnimationFrame(M),k=(M)=>l.defaultView?.cancelAnimationFrame(M)??cancelAnimationFrame(M),Y=()=>{C=0;let M=L;L=null,E(ko(M instanceof Element?M:null)),T(M,{x:O,y:K})},U=(M)=>{if(L=M.target,O=M.clientX,K=M.clientY,C)return;C=_(Y)},G=(M)=>{if(!df(M,l))return;if(E(null),d&&!g()&&p!=="none")p="none",o.post({kind:"insertZones",zones:null})},ne=(M)=>{if(g())return;let B=Je()?Nt():null;if(B&&M.target instanceof Node&&B.contains(M.target))return;let q=pl(M.target);if(!q)return;M.preventDefault(),o.post({kind:"contextMenu",path:q.path,x:M.clientX,y:M.clientY})};return l.addEventListener("pointerdown",h,!0),l.addEventListener("click",y,!0),l.addEventListener("pointermove",U,!0),l.addEventListener("pointerleave",G,!0),l.addEventListener("contextmenu",ne,!0),()=>{if(C)k(C),C=0;l.removeEventListener("pointerdown",h,!0),l.removeEventListener("click",y,!0),l.removeEventListener("pointermove",U,!0),l.removeEventListener("pointerleave",G,!0),l.removeEventListener("contextmenu",ne,!0)}}var gf=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),bl=new Set(["a","abbr","b","bdi","bdo","br","cite","code","data","del","dfn","em","i","ins","kbd","mark","q","s","samp","small","span","strong","sub","sup","time","u","var","wbr"]),xf=new Set([...bl,"button","dt","h1","h2","h3","h4","h5","h6","label","legend","p","pre","summary"]);function Sl(o){return(u(o?.tagName)||"div").toLowerCase()}function yf(o,l){let d=o.type==="block"?o.tag??"":Sl(xe(l,o.path));return bl.has(d.toLowerCase())}function bf(o,l){let d=null,f=o;while(f){let p=he(f.dataset.jxPath??"");if(p.length===0)break;if(xf.has(Sl(xe(l,p))))d=f;f=Jo(f.parentElement)}return d}function Jo(o){let l=o;while(l){if(l instanceof HTMLElement&&l.dataset.jxPath)return l;l=l.parentElement}return null}function Do(o,l,d){let f=gr(o,l,d);return Jo(f)}function _o(o,l,d,f,p){let m=gr(o,l,d);if(!m||Jo(m)||m.closest("[data-jx-layout-region]"))return null;let g=d.querySelector(`[data-jx-path="${ae([])}"]`);if(g)return ir(g,l,f,p);let h=[...d.querySelectorAll("[data-jx-path]")].filter((A)=>he(A.dataset.jxPath??"").length===2),[y,...E]=h;if(!y)return Rt(p,[])?{edge:"inside",instruction:"make-child",referenceRect:$e(m),targetPath:[]}:null;return Sf(y,E,l,p)}function yl(o,l){let d=$e(o),f=Math.abs(l-d.y),p=Math.abs(l-(d.y+d.height));return{below:p<=f,block:o,distance:Math.min(f,p)}}function Sf(o,l,d,f){let p=yl(o,d);for(let g of l){let h=yl(g,d);if(h.distance<p.distance)p=h}let m=he(p.block.dataset.jxPath??"");if(!Rt(f,m))return null;return p.below?{edge:"bottom",instruction:"reorder-below",referenceRect:$e(p.block),targetPath:m}:{edge:"top",instruction:"reorder-above",referenceRect:$e(p.block),targetPath:m}}function ir(o,l,d,f){let p=o.dataset.jxPath;if(p==null)return null;let m=he(p);if(m.length===0){let L=[...o.children];if(L.length===0)return Rt(f,m)?{edge:"inside",instruction:"make-child",referenceRect:$e(o),targetPath:m}:null;return vf(L,l,m,f)}if(!Rt(f,m))return null;let g=yf(f,d)?null:bf(o,d);if(g){let L=he(g.dataset.jxPath??"");if(!Rt(f,L))return null;let O=$e(g);return(O.height===0?0:(l-O.y)/O.height)<0.5?{edge:"top",instruction:"reorder-above",referenceRect:O,targetPath:L}:{edge:"bottom",instruction:"reorder-below",referenceRect:O,targetPath:L}}let h=xe(d,m),y=(u(h?.tagName)||"div").toLowerCase(),E=Array.isArray(h?.children)&&h.children.some((L)=>n(L)),A=gf.has(y)||!E,T=$e(o),C=T.height===0?0:(l-T.y)/T.height;if(A)return C<0.5?{edge:"top",instruction:"reorder-above",referenceRect:T,targetPath:m}:{edge:"bottom",instruction:"reorder-below",referenceRect:T,targetPath:m};if(C<0.25)return{edge:"top",instruction:"reorder-above",referenceRect:T,targetPath:m};if(C>0.75)return{edge:"bottom",instruction:"reorder-below",referenceRect:T,targetPath:m};return{edge:"inside",instruction:"make-child",referenceRect:T,targetPath:m}}function vf(o,l,d,f){let p=1/0,m="reorder-below",g=o.length-1;for(let y=0;y<o.length;y++){let E=$e(o[y]),A=Math.abs(l-E.y),T=Math.abs(l-(E.y+E.height));if(A<p)p=A,m="reorder-above",g=y;if(T<p)p=T,m="reorder-below",g=y}let h=[...d,"children",g];if(!Rt(f,h))return null;return{edge:m==="reorder-above"?"top":"bottom",instruction:m,referenceRect:$e(o[g]),targetPath:h}}function Rt(o,l){if(o.type!=="tree-node")return!0;let d=o.path;if(Da(d,l))return!1;return!st(d,l)}function $e(o){let l=Pe(o);return{height:l.height,width:l.width,x:l.x,y:l.y}}var Ef=40,vl=12;function Lo(o,l,d=Ef){if(o<d)return-1;if(o>l-d)return 1;return 0}var Io=new Set(["deleteContentBackward","deleteWordBackward","deleteSoftLineBackward","deleteHardLineBackward"]),jo=new Set(["deleteContentForward","deleteWordForward","deleteSoftLineForward","deleteHardLineForward"]),El=new Set(["deleteByCut","deleteContent"]),wl=new Set(["insertText","insertReplacementText","insertFromPaste","insertFromPasteAsQuotation","insertFromYank","insertTranspose"]),wf="format",Tf=new Set(["insertParagraph","insertLineBreak"]);function Tl(o){let{inputType:l,from:d,to:f}=o;if(l==="insertCompositionText"||l==="insertFromComposition")return{kind:"native"};if(l==="historyUndo"||l==="historyRedo")return{kind:"reject"};if(l.startsWith(wf))return{kind:"reject"};if(l==="insertFromDrop"||l==="deleteByDrag")return{kind:"reject"};if(o.inPropHost)return Tf.has(l)?{kind:"reject"}:{kind:"native"};if(!d||!f)return{kind:"reject"};let p=rn(d,f)&&d.offset===f.offset,m=!rn(d,f);if(l==="insertParagraph")return{from:d,kind:"split",to:f};if(l==="insertLineBreak"&&!m)return{kind:"native"};if(p&&Io.has(l)&&o.atBlockStart)return{at:d,kind:"mergeBackward"};if(p&&jo.has(l)&&o.atBlockEnd)return{at:d,kind:"mergeForward"};if(m){if(wl.has(l)||l==="insertLineBreak")return{from:d,kind:"replaceRange",text:o.data,to:f};if(Io.has(l)||jo.has(l)||El.has(l))return{from:d,kind:"replaceRange",text:"",to:f};return{kind:"reject"}}if(wl.has(l)||Io.has(l)||jo.has(l)||El.has(l))return{kind:"native"};return{kind:"native"}}var Af=500;function sr(o,l){let d=o.ownerDocument.getSelection();if(!d||d.rangeCount===0||!d.anchorNode||!d.focusNode)return null;if(!o.contains(d.anchorNode)||!o.contains(d.focusNode))return null;let f=nn(d.anchorNode,d.anchorOffset,l),p=nn(d.focusNode,d.focusOffset,l);return f&&p?{anchor:f,head:p}:null}function un(o,l){let d=go(o,l.anchor),f=go(o,l.head)??d;if(!d)return!1;let p=o.ownerDocument.getSelection();if(!p)return!1;let m=o.ownerDocument.createRange();if(m.setStart(d.node,d.offset),p.removeAllRanges(),p.addRange(m),f&&f!==d)p.extend(f.node,f.offset);return!0}function Al(o){return"dataset"in o}function Cl(o,l){let d=o.ownerDocument,f=null,p=null,m=()=>{let M=l.getMode?.();return M===void 0||M==="design"||M==="edit"},g=null,h=()=>{if(g!==null)clearTimeout(g),g=null},y=()=>{if(g=null,!f||!l.onCommitTick)return;let M=sr(o,l.isEditableBlock);if(l.onCommitTick(),M)un(o,M)},E=!1,A=()=>{if(!l.onCommitTick||!f||E)return;h(),g=setTimeout(y,l.commitDelayMs??Af)},T=()=>{E=!0,h()},C=()=>{E=!1,A()},L=()=>{h(),f=null,p=null},O=()=>{if(!f)return;h(),f=null,p=null,l.onDeactivate()},K=()=>{if(!m()){O();return}let B=d.getSelection()?.focusNode??null;if(!B)return;if(!o.contains(B)){O();return}let q=zn(B,l.isEditableBlock);if(!q){if(f?.contains(B)){l.onSelectionChange?.();return}O();return}let X=ae(q.path);if(X===p){l.onSelectionChange?.();return}O(),f=q.el,p=X,l.onActivate(q.el,q.path)},_=(M)=>{let[B]=t(M.getTargetRanges)?M.getTargetRanges():[],q=d.getSelection(),X=q&&q.rangeCount>0&&(q.isCollapsed||!B),ce,ee,re,be;if(X)({startContainer:ce,startOffset:ee,endContainer:re,endOffset:be}=q.getRangeAt(0));else if(B)({startContainer:ce,startOffset:ee,endContainer:re,endOffset:be}=B);else return null;let j=nn(ce,ee,l.isEditableBlock),R=nn(re,be,l.isEditableBlock),z=zn(re,l.isEditableBlock);return j&&R&&z?{endEl:z.el,from:j,to:R}:null},k=(M)=>{if(!m())return;let B=_(M),q=Tl({atBlockEnd:B?B.to.offset>=ho(B.endEl):!1,atBlockStart:B?va(B.from):!1,data:M.data??"",from:B?.from??null,inPropHost:f!==null&&p===null,inputType:M.inputType,to:B?.to??null});switch(q.kind){case"native":return;case"split":{if(M.preventDefault(),!rn(q.from,q.to)&&!l.onReplaceRange)return;l.onSplit?.();return}case"mergeBackward":{M.preventDefault(),l.onMergeBackward?.(q.at);return}case"mergeForward":{M.preventDefault(),l.onMergeForward?.(q.at);return}case"replaceRange":{M.preventDefault(),l.onReplaceRange?.(q.from,q.to,q.text);return}default:M.preventDefault()}},Y=(M)=>{if(!m()||M.button===2)return;let B=M.target instanceof Element?M.target:null,q=l.onPropActivate?B:null;while(q&&q!==o){if(Al(q)&&q.dataset.jxBoundProp&&l.onPropActivate){let X=q;if(X!==f){if(O(),l.onPropActivate(X))f=X,p=null}return}if(Al(q)&&q.dataset.jxPath)break;q=q.parentElement}if(B?.closest("[contenteditable]")?.getAttribute("contenteditable")==="false")d.getSelection()?.removeAllRanges()},U=(M)=>{if(M.button!==2||!m())return;if(f&&M.target instanceof Node&&f.contains(M.target))return;if(M.preventDefault(),f)O(),d.getSelection()?.removeAllRanges()},G=(M)=>{M.preventDefault()},ne=()=>A();return d.addEventListener("selectionchange",K),o.addEventListener("beforeinput",k),o.addEventListener("input",ne),o.addEventListener("compositionstart",T),o.addEventListener("compositionend",C),o.addEventListener("dragstart",G),d.addEventListener("pointerdown",Y,!0),d.addEventListener("mousedown",U,!0),{capture:()=>sr(o,l.isEditableBlock),forget:L,isComposing:()=>E,flush:()=>{if(E)return;if(g!==null)h(),y()},placeCaret:(M)=>{let B=un(o,{anchor:M,head:M});if(B)K();return B},restore:(M)=>{let B=un(o,M);if(B)K();return B},stop:()=>{d.removeEventListener("selectionchange",K),o.removeEventListener("beforeinput",k),o.removeEventListener("input",ne),o.removeEventListener("compositionstart",T),o.removeEventListener("compositionend",C),o.removeEventListener("dragstart",G),d.removeEventListener("pointerdown",Y,!0),d.removeEventListener("mousedown",U,!0),O()},sync:K}}function je(o){return n(o)}function $t(o){if(Array.isArray(o))return o.map((d)=>$t(d));if(!c(o))return o;let l={};for(let[d,f]of Object.entries(o)){if(d.startsWith("on")&&Z(f))continue;if(d==="children")l.children=Array.isArray(f)?f.map((p)=>$t(p)):$t(f);else if(d==="cases"&&je(f)){let p={};for(let[m,g]of Object.entries(f))p[m]=$t(g);l.cases=p}else if(d==="state"&&je(f)){let p={};for(let[m,g]of Object.entries(f)){if(i(g)&&g.timing==="server")continue;p[m]=g}l.state=p}else l[d]=f}return l}var Cf=new Set(["img","video","source","iframe","audio"]),Pl="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",Pf="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='32'%20height='32'%3E%3Crect%20width='32'%20height='32'%20fill='%23d0d0d0'/%3E%3C/svg%3E";var Nf=/(src|poster|image|bg|background|icon|logo|photo|avatar|thumbnail|cover|banner)$/i;function Nl(o){return Nf.test(o)}var Rf=/(?<![\w$.])(?:item|index|\$map)\b/u;function Be(o){if(e(o))return o.includes("${")&&Rf.test(o);return c(o)&&e(o.$ref)&&/^(?:#\/)?\$map\//u.test(o.$ref)}function ar(o,l){if(o==="href"||o==="action")return"";if(Nl(o))return Pf;if(e(l))return Ot(l);return c(l)&&e(l.$ref)?Ll(l.$ref):""}var $f=new Set(["p","h1","h2","h3","h4","h5","h6","blockquote","li","dt","dd","th","td","span","strong","em","small","mark","code","abbr","q","sub","sup","time","a","button","label","legend","caption","summary","pre","option"]),Of=new Set(["div","section","article","aside","header","footer","main","nav","figure","figcaption","details","fieldset","form","ul","ol","dl","table"]),Rl=["empty-text-placeholder","empty-container-placeholder"],Mf=["width","height","inlineSize","blockSize"];function kf(o){let{style:l}=o;if(!n(l))return!1;return Mf.some((d)=>{let f=l[d],p=s(f)?String(f):e(f)?f.trim():"";return p!==""&&p!=="auto"})}function Fo(o){if(!o.tagName||o.textContent||o.innerHTML)return null;if(o.$__layout)return null;if(Array.isArray(o.children)&&o.children.length>0)return null;if(a(o.children))return null;if(kf(o))return null;if($f.has(u(o.tagName)))return"empty-text-placeholder";if(Of.has(u(o.tagName)))return"empty-container-placeholder";return null}function Ot(o){return o.replaceAll(/\$\{([^}]+)\}/g,"❪ $1 ❫")}function Jf(o){return Ot(o.replaceAll(/\s*\?\?\s*\[\s*\]\s*(?=\})/gu,""))}function $l(o){let l=document.createTreeWalker(o,NodeFilter.SHOW_TEXT);while(l.nextNode()){let d=l.currentNode;if(d.data.includes("❪"))d.data=d.data.replaceAll(/\u276A\s*(.*?)\s*\u276B/g,"${$1}")}}function Df(o,l){let d=o.map;return{children:n(d)?[et(d,kl(o.items,l))]:[],className:"repeater-perimeter",tagName:"div"}}function Ol(o){return JSON.stringify(o)}function Ml(o){let l=o.startsWith("#/")?o.slice(2):o,[d,...f]=l.split("/"),p=d==="state"||d==="$map"?d:null;if(p===null)return null;let m=f.map((g)=>g.replaceAll("~1","/").replaceAll("~0","~"));return p+m.map((g)=>`?.[${Ol(g)}]`).join("")}function Ho(o,l){if(l===null)return`(${o})`;return`((r) => ((item, index, $map) => (${o}))(r, 0, { index: 0, item: r }))(${l})`}function kl(o,l){if(Array.isArray(o))return`${Ol(o)}[0]`;if(r(o)){let f=Ml(o.$ref);return f===null?null:`${Ho(f,l)}?.[0]`}let d=e(o)?Jl(o):[];if(e(o)&&d.length===1&&_f(o,d[0]))return`${Ho(d[0].expr,l)}?.[0]`;return null}function _f(o,l){return l.start===0&&l.end===o.length-1}function Jl(o){let l=[],d=o.indexOf("${");while(d!==-1){let f=0,p=-1;for(let m=d+1;m<o.length;m+=1)if(o[m]==="{")f+=1;else if(o[m]==="}"){if(f-=1,f===0){p=m;break}}if(p===-1)break;l.push({end:p,expr:o.slice(d+2,p),start:d}),d=o.indexOf("${",p+1)}return l}function Dl(o,l=null){let d=Jl(o);if(d.length===0)return o;let f="",p=0;for(let{start:m,end:g,expr:h}of d)f+=o.slice(p,m),f+=`\${(() => { try { return ${Ho(h,l)}; } catch { return ""; } })()}`,p=g+1;return f+o.slice(p)}function Lf(o,l){let d=o.startsWith("#/")?o.slice(2):o;if(d!=="$map"&&!d.startsWith("$map/"))return{$ref:o};let f=Ml(o);return l===null||f===null?void 0:Dl(`\${${f}}`,l)}function _l(o,l){let d=o,f=null;for(let p of l){if(Array.isArray(d)){d=s(p)?d[p]:void 0;continue}if(!c(d))return f;if(p==="map"&&d.$prototype==="Array")f=kl(d.items,f);d=e(p)?d[p]:void 0}return f}function Ll(o){return`{${o.startsWith("#/state/")?o.slice(8):o}}`}function Il(o,l=null){return et(o,l)}function et(o,l){if(Array.isArray(o))return o.map((h)=>et(h,l));if(!c(o))return o;if(o.$prototype==="Array")return Df(o,l);let d=o,f={},p=!1,m=e(d.tagName)&&Cf.has(d.tagName);if(m){let{attributes:h,src:y}=d,E=h?.src,A=d.poster,T=h?.poster;if(!(y&&y!==""||E&&E!=="")&&!(A&&A!==""||T&&T!==""))p=!0}for(let[h,y]of Object.entries(d))if(h==="state"||h==="$media"||h==="$elements")f[h]=y;else if(h==="$props"&&je(y)){let E={};for(let[A,T]of Object.entries(y))if(!Be(T))E[A]=T;else if(e(T))E[A]=Nl(A)||A==="href"||A==="action"?ar(A,T):Dl(T,l);else if(r(T)){let C=Lf(T.$ref,l);if(C!==void 0)E[A]=C}else E[A]=T;f[h]=E}else if(h==="children"){if(Array.isArray(y))f.children=y.map((E)=>et(E,l));else if(c(y)&&y.$prototype==="Array")f.children=[et(y,l)];else if(!a(y))f.children=et(y,l)}else if(h==="cases"&&d.$switch&&je(y)){let[E]=Object.entries(y);if(E){let[,A]=E;f.children=je(A)&&!(c(A)&&A.$ref)?[et(A,l)]:[{style:{background:"color-mix(in srgb, var(--danger) 8%, transparent)",border:"1px dashed color-mix(in srgb, var(--danger) 40%, transparent)",borderRadius:"4px",color:"var(--danger)",fontFamily:"'JetBrains Mono', 'SF Mono', 'Fira Code', monospace",fontSize:"11px",fontStyle:"italic",padding:"6px 10px"},tagName:"div",textContent:`[$switch: ${Object.keys(y).join(" | ")}]`}]}}else if(h==="attributes"&&m&&je(y)){let E={};for(let[A,T]of Object.entries(y))if((A==="src"||A==="poster")&&(T===""||T==null||Be(T)))p=!0,E[A]=Pl;else E[A]=Be(T)?ar(A,T):T;f.attributes=E}else if(h==="attributes"&&je(y)){let E={};for(let[A,T]of Object.entries(y))E[A]=Be(T)?ar(A,T):T;f.attributes=E}else if(h==="style")if(je(y)){let E={};for(let[A,T]of Object.entries(y))if(!Be(T))E[A]=T;f.style=E}else f.style=y;else if(h==="$switch"&&e(y)&&y.includes("${"))f[h]=Ot(y);else if(h==="textContent"&&e(y)&&y.includes("${"))f[h]=Ot(y);else if(h==="textContent"&&c(y)&&y.$ref)f[h]=Ll(y.$ref);else if(m&&(h==="src"||h==="poster"))if(y===""||y==null||Be(y))p=!0,f[h]=Pl;else f[h]=y;else if(Be(y))f[h]=ar(h,y);else if(e(y)||c(y)&&y.$ref)f[h]=y;else f[h]=et(y,l);if(a(d.children)){f.textContent=Jf(d.children);let{attributes:h}=f;f.attributes=je(h)?{...h,contenteditable:"false"}:{contenteditable:"false"}}let g=Fo(f);if(g)f.className=f.className?`${f.className} ${g}`:g;if(p){let h=e(f.className)?f.className:"";if(!h.includes("empty-media-placeholder"))f.className=h?`${h} empty-media-placeholder`:"empty-media-placeholder"}return f}var If={bold:"strong",code:"code",italic:"em",strikethrough:"del",subscript:"sub",superscript:"sup",underline:"u"},Vo=globalThis,jf=["strong","em","u","del","sub","sup","code"],lr="jx-pending-format",jl="jx-pending-format-style";function Hf(o){let l=o.parentElement;while(l){if(l.tagName.includes("-"))return l;l=l.parentElement}return null}function Ff(o,l){if(!o)return!1;let d=o.attributes;if(d){if(d[`props.${l}`]!==void 0)return!0;let f=new Set([l.toLowerCase(),Cn(l).toLowerCase()]);for(let m of Object.keys(d))if(d[m]!==void 0&&f.has(m.toLowerCase()))return!0;let p=d["data-jx-props"];if(e(p)&&Vf(p,l))return!0}if(Qt.has(l)||l.startsWith("$"))return!1;return o[l]!==void 0}function Vf(o,l){try{let d=JSON.parse(o);return n(d)&&l in d}catch{return!1}}function Hl(o,l){let f=ae(l).replaceAll("\\",String.raw`\\`).replaceAll("'",String.raw`\'`),p=o.querySelector(`[data-jx-path='${f}']`);return p instanceof HTMLElement?p:null}function Wf(o){return{height:o.height,width:o.width,x:o.x,y:o.y}}function Fl(o,l,d){let f=l.ownerDocument,p=()=>{let j=d?.getMode?.();return j===void 0||j==="design"||j==="edit"},m=null,g=0,h=(j)=>{let R=window.getSelection();if(!R||!R.rangeCount)return null;let z=R.getRangeAt(0);return j.contains(z.commonAncestorContainer)?z:null},y=()=>{let j=Nt();if(!j)return;let R=h(j);if(R&&!R.collapsed)m=R.cloneRange()},E=()=>{if(f.querySelector(`#${jl}`))return;let j=f.createElement("style");j.id=jl,j.textContent=`::highlight(${lr}) { background-color: Highlight; color: HighlightText; }`,f.head.append(j)},A=()=>{let j=Vo.Highlight,R=Vo.CSS?.highlights;if(!j||!R)return;if(m&&m.startContainer.isConnected)E(),R.set(lr,new j(m.cloneRange()));else R.delete(lr)},T=()=>{Vo.CSS?.highlights?.delete(lr)},C=()=>{let j=Nt();if(!j||!j.dataset.jxPath)return null;let R=h(j),z=R??m,Q=z?Wf(ci(z)):null,de=R?R.collapsed:!0,De=jf.filter((Ce)=>Wa(Ce,j)),ye=qa(j);if(ye.active)De.push("a");return g+=1,{activeTags:De,collapsed:de,kind:"selectionChanged",link:ye,localScope:null,path:he(j.dataset.jxPath),rect:Q,seq:g}},L=()=>{if(!Je())return;y(),A();let j=C();if(j)o.post(j)},O=!1,K=(j,R)=>{$l(j),o.post({kind:"editStart",path:R}),Co(j,R,{onCommit:(z,Q,de,De)=>{O=!1;let ye={children:Q,kind:"editCommit",path:z,textContent:de};if(De)ye.inPlace=!0;o.post(ye)},onEnd:()=>{T(),m=null,o.post({kind:"editEnd"})},onInsert:(z,Q,de)=>o.post({cmd:Q,commitData:de,kind:"editInsert",path:z}),onSplit:(z,Q,de)=>o.post({after:de,before:Q,kind:"editSplit",path:z})}),y(),L()},_=(j,R)=>{let z=d?.getShadowDoc?.();if(!z)return!0;let Q=xe(z,j);if(Ff(Q,R))return!1;let de=Q?.$props?.[R];if(de==null)return!0;if(!e(de))return!1;return!de.includes("${")},k=(j,R,z)=>{o.post({kind:"editStart",path:R,prop:z}),Co(j,R,{onCommit:(Q,de,De,ye)=>{O=!1;let Ce={kind:"editCommitProp",path:Q,prop:z,value:De??""};if(ye)Ce.inPlace=!0;o.post(Ce)},onEnd:()=>{T(),m=null,X.forget(),o.post({kind:"editEnd"})},onInsert:()=>{},onSplit:()=>{}},{plainText:!0})},Y=(j)=>{let R=Nt();if(!R)return;if(rl())return;if(m&&m.startContainer.isConnected&&R.contains(m.commonAncestorContainer)){let z=window.getSelection();R.focus(),z?.removeAllRanges(),z?.addRange(m)}if(j.command==="link")za(R,j.href);else if(j.command==="insertData")Ga(R,j.token);else{let z=If[j.command];if(z)Ba(z,R)}y(),L()},U=(j)=>{let R=j.dataset.jxBoundProp,z=Hf(j),Q=z?.dataset.jxPath;if(!R||!z||!Q)return!1;let de=he(Q);if(!_(de,R))return!1;return k(j,de,R),!0},G=(j,R)=>{let z=Ea(l,j,R,at);if(!z)return!1;let[Q,de]=R===-1?[j,z.path]:[z.path,j];return X.flush(),o.post({fromPath:Q,intoPath:de,kind:"editMerge"}),!0},ne=(j,R,z)=>{let Q=xo(l,at),de=ae(j.path),De=ae(R.path),ye=Q.findIndex((Ke)=>Ke.dataset.jxPath===de),Ce=Q.findIndex((Ke)=>Ke.dataset.jxPath===De);if(ye===-1||Ce===-1||Ce<=ye)return!1;let fn=Q.slice(ye+1,Ce).map((Ke)=>he(Ke.dataset.jxPath));return X.flush(),o.post({between:fn,from:j,kind:"editRangeReplace",text:z,to:R}),!0},M=()=>y(),B=()=>y(),q=()=>y(),X=Cl(l,{getMode:()=>d?.getMode?.()??"edit",isEditableBlock:at,onActivate:(j,R)=>K(j,R),onDeactivate:()=>{if(Je())Ie()},onCommitTick:()=>nl(),onMergeBackward:(j)=>G(j.path,-1),onMergeForward:(j)=>G(j.path,1),onReplaceRange:(j,R,z)=>ne(j,R,z),onPropActivate:U,onSelectionChange:()=>L(),onSplit:()=>sl()}),ce=(j)=>dl(j),ee=()=>{if(il())Mo()},re=()=>{if(!O)O=!0,o.post({kind:"editInput"})};l.addEventListener("input",re),l.addEventListener("keydown",ce),l.addEventListener("input",ee),f.addEventListener("mouseup",M,!0),f.addEventListener("keyup",B,!0),f.addEventListener("blur",q,!0);let be=o.onMessage((j)=>{if(j.kind==="applyFormat"){Y(j.intent);return}if(j.kind==="openSlash"){Oo({anchored:!1});return}if(j.kind==="flushEdits"){X.flush(),o.post({kind:"flushComplete",reqId:j.reqId});return}if(j.kind==="endEdit"){if(Je())Ie();return}if(j.kind!=="enterEdit")return;if(!p())return;if(j.prop!==void 0){let Q=Hl(l,j.path)?.querySelector(`[data-jx-bound-prop="${CSS.escape(j.prop)}"]`);if(Q)U(Q);return}let R=Hl(l,j.path);if(R&&at(R))X.placeCaret({offset:j.offset??0,path:j.path})});return()=>{if(l.removeEventListener("keydown",ce),l.removeEventListener("input",ee),l.removeEventListener("input",re),f.removeEventListener("mouseup",M,!0),f.removeEventListener("keyup",B,!0),f.removeEventListener("blur",q,!0),X.stop(),be(),T(),m=null,Je())Ie()}}var Bf=new Set(["ArrowUp","ArrowDown","Enter","Escape"]);function Kf(o){return Bf.has(o)}function Vl(o,l){let d=!1,f=null,p=null,m={dismiss:()=>{if(!d)return;d=!1,p=null,o.post({kind:"slashDismiss"})},isOpen:()=>d,show:(E,A,T)=>{if({onSelect:f}=T,d&&A===p)return;d=!0,p=A;let C=Pe(E),L={filter:A,kind:"slashShow",rect:{height:C.height,width:C.width,x:C.left,y:C.top}};if(T.showFilter===!0)L.showFilter=!0;o.post(L)}};Ao(m);let g=(E)=>{if(!d||!Kf(E.key))return;E.preventDefault(),E.stopPropagation(),o.post({key:E.key,kind:"slashNav"})},h=()=>{if(d)m.dismiss()};l.addEventListener("keydown",g,!0),l.addEventListener("mousedown",h,!0);let y=o.onMessage((E)=>{if(E.kind==="slashSelect"){d=!1,p=null,f?.({...E.cmd});return}if(E.kind==="slashDismissed")d=!1,p=null});return()=>{l.removeEventListener("keydown",g,!0),l.removeEventListener("mousedown",h,!0),y(),Ao({dismiss:()=>{},isOpen:()=>!1,show:()=>{}})}}var Wl=["global","canvas","caret","grid","code","dock","palette"];var Zh={"commandbar/primary":{admits:["application","document"],note:"document only for Save / Undo / Redo / Open in Browser, by frequency; ≤5 total"},"commandbar/overflow":{admits:["application","project","document"],note:"never selection — the Command Bar is not a selection surface"},"statusbar/project":{admits:["project"],note:"the status bar's left field"},"statusbar/document":{admits:["document"],note:"the status bar's centre field"},"statusbar/selection":{admits:["selection"],note:"the status bar's right field"},"context/element":{admits:["selection"],note:"the canvas element menu acts on a selection"},"context/file":{admits:["project"],note:"a file row addresses the project's file set"},"context/layer":{admits:["selection"],note:"an outline row IS a selection"},"context/tab":{admits:["document"],note:"a tab addresses one document"},"context/pane":{admits:["document"],note:"a pane hosts one document"},blockbar:{admits:["selection"],note:"the floating bar owns selection-scoped verbs"},"blockbar/format":{admits:["selection"],note:"the bar's inline-format cluster — a range inside the selection is still the selection"},"outline/row":{admits:["selection"],note:"row actions act on the row's node"},"settings/menu":{admits:["application","project"],note:"the rail foot's gear menu — the settings family. It is a MENU, not a pinned slot, so it "+"may host two levels for the reason commandbar/overflow does: a menu prints each row's own name, chord and gate, and draws a divider where the level changes. The rail's PINNED groups stay single-level, in PANEL_PLACEMENT_MATRIX"},palette:{admits:["application","project","document","selection"],note:"the level-agnostic surface; it groups rows by level"},never:{admits:["application","project","document","selection"],note:"keyboard- and API-only; no rendered surface to be misplaced in"}};var Uf=["mod","ctrl","alt","shift"],qf=new Map([["mod","mod"],["cmd","mod"],["command","mod"],["meta","mod"],["super","mod"],["ctrl","ctrl"],["control","ctrl"],["alt","alt"],["opt","alt"],["option","alt"],["shift","shift"]]),zf=new Map([["up","arrowup"],["down","arrowdown"],["left","arrowleft"],["right","arrowright"],["esc","escape"],["space"," "],["spacebar"," "],["del","delete"],["plus","="],["return","enter"]]);function Gf(o){return[...Uf.filter((d)=>o[d]),o.key].join("+")}function Yf(o){return/^Digit(\d)$/.exec(o??"")?.[1]}function Bl(o,l){let d=Yf(o.code)??o.key.toLowerCase();if(qf.has(d))return"";let f={mod:l?o.metaKey:o.ctrlKey,ctrl:l?o.ctrlKey:!1,alt:o.altKey,shift:o.shiftKey,key:zf.get(d)??d};return Gf(f)}var ng=["global",...Wl.filter((o)=>o!=="global"&&o!=="palette")];var Xf=["caret","global"],Zf=["canvas","global"],Qf=["global"],cr={chords:[],mac:!1};function ep(o){if(!(o instanceof HTMLElement))return!1;return o.tagName==="INPUT"||o.tagName==="TEXTAREA"||o.tagName==="SELECT"}function tp(o,l){if(o)return Xf;return l==="preview"?Qf:Zf}function np(o,l=cr,d=!1,f="design"){if(ep(o.target))return!1;let p=Bl(o,l.mac);if(!p)return!1;let m=tp(d,f);return l.chords.some((g)=>g.chord===p&&m.includes(g.scope))}function rp(o){return{altKey:o.altKey,code:o.code,ctrlKey:o.ctrlKey,key:o.key,metaKey:o.metaKey,shiftKey:o.shiftKey}}function Kl(o,l=document,d=()=>!1,f=()=>cr,p=()=>"design"){let m=(g)=>{if(!np(g,f(),d(),p()))return;g.preventDefault(),o.post({event:rp(g),kind:"forwardKey"})};return l.addEventListener("keydown",m,!0),()=>l.removeEventListener("keydown",m,!0)}var Wo=new WeakMap,ur=new Set;function Bo(o,l,d){let f=xe(o,l);if(f===void 0)throw Error(`iframe-patch-node-not-found:${l.join("/")}`);let p=e(f)?f:Il($t(f),_l(o,l)),{result:m,stop:g}=Et(()=>Ne(p,d.defs,{_path:op(l,d),onNodeCreated:vo(d.mapperCtx)}));if(ur.add(g),m instanceof HTMLElement)Wo.set(m,g);return m}function Ko(o){let l=[o,...o.querySelectorAll("*")];for(let d of l){if(!(d instanceof HTMLElement))continue;_n(d);let f=Wo.get(d);if(f)f(),ur.delete(f),Wo.delete(d)}}function Ul(){for(let o of ur)o();ur.clear()}function op(o,l){let{mapperCtx:d}=l;if(d.layoutWrapped&&d.pageContentPrefix&&o[0]==="children"){let[,f]=o;return s(f)?[...d.pageContentPrefix,f+(d.pageContentOffset??0),...o.slice(2)]:[...d.pageContentPrefix,...o.slice(1)]}return o}function Gl(o,l,d,f,p){for(let g of l)wo(o,g);if(!p?.length){for(let g of l)ql(o,g,d,f);return}let m=new Set(p.map((g)=>ae(g)));for(let g of l){if(g.op==="set-key"&&m.has(ae(g.path))){ip(o,g.path,d);continue}ql(o,g,d,f)}}function ip(o,l,d){let f=Zl(d,l);if(f)Mt(f,xe(o,l))}function Uo(o){if(!o)throw Error("iframe-patch-no-render-ctx");return o}function ql(o,l,d,f){switch(l.op){case"set-key":{if(l.key==="style"){up(o,l.path,d,f);return}if(l.key==="textContent"){dp(o,l.path,d);return}if(l.key.startsWith("on"))return;zl(o,l.path,d,Uo(f));return}case"insert-child":{sp(o,l.parentPath,l.index,d,Uo(f));return}case"set-child":{zl(o,[...l.parentPath,"children",l.index],d,Uo(f));return}case"remove-child":{ap(o,l.parentPath,l.index,d);return}case"move-child":{lp(o,l.fromParentPath,l.fromIndex,l.toParentPath,l.toIndex,d);return}default:throw Error(`iframe-patch-unsupported-op:${JSON.stringify(l)}`)}}function sp(o,l,d,f,p){let m=lt(f,l),g=xe(o,l),h=Bo(o,[...l,"children",d],p);dr(f,l,d,1),Yl(m,h,Xl(m,g,d)),Mt(m,g)}function zl(o,l,d,f){let p=lt(d,l),m=Bo(o,l,f);Ko(p),p.replaceWith(m)}function ap(o,l,d,f){let p=lt(f,[...l,"children",d]),m=p.parentElement;if(Ko(p),p.remove(),dr(f,l,d+1,-1),m)Mt(m,xe(o,l))}function lp(o,l,d,f,p,m){let g=[...l,"children",d],h=lt(m,g),y=h.parentElement,E=lt(m,f);h.remove(),dr(m,l,d+1,-1);let A=fr(E)??f;dr(m,A,p,1),cp(h,g,[...A,"children",p]);let T=xe(o,A);if(Yl(E,h,Xl(E,T,p)),y)Mt(y,xe(o,fr(y)??l));Mt(E,T)}function Mt(o,l){for(let f of Rl)o.classList.remove(f);let d=l?Fo(l):null;if(d)o.classList.add(d)}function Yl(o,l,d){if(d)d.before(l);else o.append(l)}function Xl(o,l,d){let f=l?.textContent,p=f!=null&&String(f)!==""?1:0;return o.childNodes[p+d]??null}function dr(o,l,d,f){let p=l.length;for(let m of o.querySelectorAll("[data-jx-path]")){let g=fr(m);if(!g||g.length<p+2||g[p]!=="children")continue;let h=g[p+1];if(!s(h)||h<d)continue;if(!l.every((E,A)=>g[A]===E))continue;let y=[...g];y[p+1]=h+f,m.dataset.jxPath=ae(y)}}function cp(o,l,d){let f=[o,...o.querySelectorAll("[data-jx-path]")];for(let p of f){let m=fr(p);if(!m||m.length<l.length||!l.every((g,h)=>m[h]===g))continue;p.dataset.jxPath=ae([...d,...m.slice(l.length)])}}function fr(o){let l=o.dataset.jxPath;return l===void 0?null:he(l)}function up(o,l,d,f){let p=lt(d,l),m=xe(o,l),g=f?.defs.$media??{};Un(p,fp(m?.style),g,f?.defs??{})}function dp(o,l,d){let f=lt(d,l),p=xe(o,l);f.textContent=pp(p),Mt(f,p)}function lt(o,l){let d=Zl(o,l);if(!d)throw Error(`iframe-patch-element-not-found:${ae(l)}`);return d}function Zl(o,l){let f=ae(l).replaceAll("\\",String.raw`\\`).replaceAll("'",String.raw`\'`),p=o.querySelector(`[data-jx-path='${f}']`);return p instanceof HTMLElement?p:null}function fp(o){if(!o||!n(o))return;let l={};for(let[d,f]of Object.entries(o)){if(Be(f))continue;l[d]=f}return l}function pp(o){let l=o?.textContent;if(l==null)return"";if(e(l))return l.includes("${")?Ot(l):l;if(n(l)&&l.$ref){let d=String(l.$ref);return`{${d.startsWith("#/state/")?d.slice(8):d}}`}return String(l)}function Ql(o){if(o===void 0)return"undefined";let l;try{l=JSON.stringify(o)??"undefined"}catch{l=String(o)}if(l.length>48)l=`${l.slice(0,47)}…`;return l}function mp(o){return i(o)&&"$expression"in o&&Array.isArray(o.parameters)}function hp(o){try{return structuredClone(o)}catch{return null}}function gp(o,l){let d={};for(let f of Object.keys(o))try{let p=o[f];if(t(p)){if(mp(l?.[f]))d[f]=p;continue}let m=JSON.stringify(p);d[f]=m===void 0?null:JSON.parse(m)}catch{d[f]=null}return d}function xp(o,l,d){if(!d||d.length===0)return o;let f=l,p=o;for(let m of d){if(!n(f))break;let g=f;if(g.$prototype==="Array"&&m==="map"){let h=g.items,y=r(h)?Ee(h.$ref,p):h;if(Array.isArray(y)&&y.length>0){let[E]=y,A=hp(E),T=Object.create(p);T.$map={index:0,item:A},T["$map/item"]=A,T["$map/index"]=0,p=T}}f=g[m]}return p}function ec(o,l,d,f){let p=d?.state??null;return o.map(({id:m,node:g})=>{let h=new Map,y;try{y=xp(gp(l,p),d,f)}catch(E){return{error:E instanceof Error?E.message:String(E),id:m,values:[]}}try{if(!n(g)||!("operator"in g))throw Error("not an expression node");return Ae(g,y,null,void 0,{report:(E,A)=>{h.set(E.join("/"),Ql(A))}}),{id:m,values:[...h.entries()]}}catch(E){return{error:E instanceof Error?E.message:String(E),id:m,values:[...h.entries()]}}})}var yp=256000,bp="[large value omitted]";function tc(o){let l={};for(let d of Object.keys(o))try{let f=o[d];if(t(f))continue;let p=JSON.stringify(f);if(p===void 0){l[d]=null;continue}if(p.length>yp){l[d]=bp;continue}l[d]=JSON.parse(p)}catch{l[d]=null}return l}function nc(o,l){return new URL(`/node_modules/${o}`,l).href}var rc={"jx-ui:/behaviors/color-area.ts":()=>(pe("frd9y9q6"),import("./chunks/color-area-frd9y9q6.js")),"jx-ui:/behaviors/color-field.ts":()=>(pe("rebpbe33"),import("./chunks/color-field-rebpbe33.js")),"jx-ui:/behaviors/color-slider.ts":()=>(pe("6bzmk3s7"),import("./chunks/color-slider-6bzmk3s7.js")),"jx-ui:/behaviors/combobox.ts":()=>(pe("c49x7gf1"),import("./chunks/combobox-c49x7gf1.js")),"jx-ui:/behaviors/dialog.ts":()=>(pe("c4x05vyx"),import("./chunks/dialog-c4x05vyx.js")),"jx-ui:/behaviors/listbox.ts":()=>(pe("tktzq5xj"),import("./chunks/listbox-tktzq5xj.js")),"jx-ui:/behaviors/menu.ts":()=>(pe("xc3cbgsd"),import("./chunks/menu-xc3cbgsd.js")),"jx-ui:/behaviors/number-field.ts":()=>(pe("y62xq0ty"),import("./chunks/number-field-y62xq0ty.js")),"jx-ui:/behaviors/action-group.ts":()=>(pe("4aan7g6g"),import("./chunks/action-group-4aan7g6g.js")),"jx-ui:/behaviors/popover.ts":()=>(pe("cnmsav6b"),import("./chunks/popover-cnmsav6b.js")),"jx-ui:/behaviors/select.ts":()=>(pe("rzds841e"),import("./chunks/select-rzds841e.js")),"jx-ui:/behaviors/split.ts":()=>(pe("d15yencd"),import("./chunks/split-d15yencd.js")),"jx-ui:/behaviors/swatch-group.ts":()=>(pe("ewh24n1f"),import("./chunks/swatch-group-ewh24n1f.js")),"jx-ui:/behaviors/tabs.ts":()=>(pe("f5cw3tgp"),import("./chunks/tabs-f5cw3tgp.js")),"jx-ui:/behaviors/toolbar.ts":()=>(pe("44cm5cta"),import("./chunks/toolbar-44cm5cta.js")),"jx-ui:/behaviors/tree.ts":()=>(pe("vw4nc63s"),import("./chunks/tree-vw4nc63s.js")),"jx-ui:/behaviors/tooltip.ts":()=>(pe("ghkxkasp"),import("./chunks/tooltip-ghkxkasp.js")),"jx-ui:/behaviors/textfield.ts":()=>(pe("wewc8rq2"),import("./chunks/textfield-wewc8rq2.js")),"jx-ui:/behaviors/toast.ts":()=>(pe("2kn2vrn4"),import("./chunks/toast-2kn2vrn4.js")),"jx-ui:/behaviors/toast-host.ts":()=>(pe("3rxeyj3d"),import("./chunks/toast-host-3rxeyj3d.js")),"jx-ui:/color.ts":()=>(pe("t2bnnj8y"),import("./chunks/color-t2bnnj8y.js")),"jx-ui:/icons.ts":()=>(pe("qp8fn1k8"),import("./chunks/icons-qp8fn1k8.js"))};var Sp;function oc(o){Sp=new URL("./",o).href}oc(import.meta.url);for(let[o,l]of Object.entries(rc))Qs(o,l);Xs((o)=>nc(o,location.href));function dn(o,l,d,f){let p=Do(o.x,o.y,f);if(!p)return _o(o.x,o.y,f,d,l);return ir(p,o.y,d,l)}function qo(o){return[...o.dataTransfer?.types??[]].includes("Files")}var ic={type:"block"},Go={},Yo={},zo=null;function sc(o){return o?{...o,revisions:Yo,versions:Go}:null}function vp(o,l){let d=o.dataset.jxPath;if(d==null)return null;let f=he(d),p=l?xe(l,f):void 0;return{path:f,rect:$e(o),tagName:(u(p?.tagName)||o.tagName).toLowerCase()}}function Ep(o){if(!(o instanceof Element))return null;if(o.closest("[data-jx-path]"))return null;let l=o.closest("[data-jx-layout-region]");if(!(l instanceof HTMLElement))return null;return{className:l.className,layoutFile:l.dataset.jxLayoutFile??"",layoutPath:he(l.dataset.jxLayoutPath??"[]"),rect:$e(l),tagName:l.tagName.toLowerCase()}}function ac(o){let l=n(o)&&"message"in o?o.message:void 0;return String(l??o)}var wp=new Set(["style","textContent"]);function Tp(o){let l=ol();if(!l)return!1;for(let d of o){let f;if(d.op==="set-key"){if(wp.has(d.key)||d.key.startsWith("on"))continue;f=d.path}else if(d.op==="move-child"){if(f=d.fromParentPath,st(f,l)||st(d.toParentPath,l))return!0;continue}else f=d.parentPath;if(st(f,l))return!0}return!1}var Ap=2,Cp=5000,Pp=500;function Np(o){let{channel:l,container:d}=o;Go={},Yo={},zo=null;let f=null,p=null,m=-1,g=Ra(d.ownerDocument),h=null,y=-1,E="design",A=null,T=null,C=cr,L=null,O=null,K=-1,_=-1,k=0,Y=null,U=d.ownerDocument.defaultView;function G(){if(k&&U)U.cancelAnimationFrame(k);k=0,Y=null}function ne(){k=0;let N=Y?.src??O;if(!U||!Y||!N||!h)return;let ie=Lo(Y.y,U.innerHeight);if(ie===0)return;let oe=U.scrollY;if(U.scrollBy(0,ie*vl),U.scrollY===oe)return;let Se=dn(Y,N,h,d.ownerDocument),se={dragSeq:Y.dragSeq,gen:Y.gen??K,kind:"dragOver",preview:Se};if(Y.withCursor)se.cursor={x:Y.x,y:Y.y};l.post(se),k=U.requestAnimationFrame(ne)}function M(N,ie,oe){if(!U||Lo(N.y,U.innerHeight)===0){G();return}let Se={dragSeq:ie,withCursor:oe!=null,x:N.x,y:N.y};if(oe)Se.gen=oe.gen,Se.src=oe.src;if(Y=Se,!k)k=U.requestAnimationFrame(ne)}let B=xl(l,d.ownerDocument,{getGen:()=>y,getMode:()=>E,getShadowDoc:()=>h}),q=(N)=>{if(E!=="design"&&E!=="edit")return;let ie=Ep(N.target);if(ie)l.post({hit:ie,kind:"layoutHit"})};d.ownerDocument.addEventListener("click",q,!0);let X=Kl(l,d.ownerDocument,Je,()=>C,()=>E),ce=Fl(l,d,{getMode:()=>E,getShadowDoc:()=>h}),ee=Vl(l,d.ownerDocument),re=$a(d),be=30000,j=-1;function R(){let N=d.querySelectorAll("[data-jx-popover][data-jx-popover-open], dialog[data-jx-dialog-open]"),ie=Pe(d),oe=0;for(let Se of N)oe=Math.max(oe,Pe(Se).bottom-ie.top);return oe}function z(){let N=Math.max(d.scrollHeight,R()),ie=Math.min(N,be);if(ie>0&&Math.abs(ie-j)>=1){j=ie;let oe=d.firstElementChild,Se=oe instanceof HTMLElement&&oe.dataset.jxDefinitionRoot!==void 0;l.post({fragment:Se,height:ie,kind:"contentHeight"}),ct()}}let Q=U?.ResizeObserver,de=Q?new Q(()=>z()):null,De=d.ownerDocument,ye=0,Ce=0,fn=0,Ke="",kt=new Map;function lc(){let N=Date.now();for(let[ie,oe]of kt)if(oe<=N)kt.delete(ie);return kt.size}function cc(){let N=De;return{animations:N.getAnimations?.().filter((oe)=>oe.playState==="running").length??0,fonts:N.fonts?N.fonts.status==="loaded":!0,gen:y,images:lc(),kind:"idle"}}function Xo(){ye=0;let N=cc(),ie=`${N.gen}|${N.fonts}|${N.animations}|${N.images}`,oe=ie!==Ke;if(oe)Ke=ie,l.post(N);if(Ce=N.fonts&&N.animations===0&&N.images===0?oe?1:Ce+1:0,Ce>=Ap){z();return}if(Date.now()>=fn)return;ye=U?U.requestAnimationFrame(Xo):0}function ct(){if(Ce=0,fn=Date.now()+Cp,!ye&&U)ye=U.requestAnimationFrame(Xo)}let Zo=(N)=>{if(N.target instanceof HTMLImageElement&&Eo(N.target))kt.set(N.target,Date.now()+Pp),ct()},Qo=(N)=>{if(N.target instanceof HTMLImageElement&&kt.delete(N.target))ct()};d.addEventListener("error",Zo,!0),d.addEventListener("load",Qo,!0),ct(),de?.observe(d);let ei=(N)=>{if(E==="preview"){if(N.ctrlKey||N.metaKey)N.preventDefault();return}N.preventDefault(),l.post({ctrlKey:N.ctrlKey,deltaX:N.deltaX,deltaY:N.deltaY,kind:"forwardWheel",metaKey:N.metaKey,shiftKey:N.shiftKey,x:N.clientX,y:N.clientY})};d.ownerDocument.addEventListener("wheel",ei,{passive:!1});let uc=300,ti=0,ni=(N,ie)=>{N.preventDefault(),N.stopPropagation();let oe={x:N.clientX,y:N.clientY},Se=d.ownerDocument,se=Do(oe.x,oe.y,Se),Oe=se?vp(se,h):null,mn=h?se?ir(se,oe.y,h,ic):_o(oe.x,oe.y,Se,h,ic):null;if(ie==="fileDragOver"){if(N.dataTransfer)N.dataTransfer.dropEffect="copy";l.post({hit:Oe,kind:"fileDragOver",preview:mn});return}l.post({files:[...N.dataTransfer?.files??[]],hit:Oe,kind:"fileDrop",preview:mn})},pn=(N)=>{if(!O){if(qo(N)){ni(N,"fileDragOver");return}let Se=Date.now();if(Se-ti>=uc)ti=Se,l.post({kind:"nativeDragEnter"});return}if(N.preventDefault(),N.dataTransfer)N.dataTransfer.dropEffect="move";let ie={x:N.clientX,y:N.clientY},oe=h?dn(ie,O,h,d.ownerDocument):null;l.post({cursor:ie,dragSeq:_,gen:K,kind:"dragOver",preview:oe}),M(ie,_)},ri=(N)=>{if(!O){if(qo(N))ni(N,"fileDrop");return}N.preventDefault();let ie={x:N.clientX,y:N.clientY},oe=h?dn(ie,O,h,d.ownerDocument):null;l.post({dragSeq:_,gen:K,instruction:oe?.instruction??null,kind:"dropResult",targetPath:oe?.targetPath??null}),O=null,K=-1,_=-1,G()},oi=(N)=>{if(!O&&qo(N)&&!N.relatedTarget)l.post({kind:"fileDragLeave"})};d.ownerDocument.addEventListener("dragenter",pn,!0),d.ownerDocument.addEventListener("dragover",pn,!0),d.ownerDocument.addEventListener("dragleave",oi,!0),d.ownerDocument.addEventListener("drop",ri,!0);let dc=l.onMessage((N)=>{if(N.kind==="measure"){let{hidden:se,hits:Oe}=gl(N.paths,d.ownerDocument);l.post({hidden:se,hits:Oe,kind:"geometry",reqId:N.reqId});return}if(N.kind==="evalExpr"){let se=N.gen===y&&L&&h?ec(N.exprs,L.defs,h,N.contextPath):[];l.post({gen:N.gen,kind:"evalResult",reqId:N.reqId,results:se});return}if(N.kind==="patch"){let{gen:se}=N;if(se<y){l.post({gen:se,kind:"patchError",message:"patch-behind-render"});return}if(se>y||!h||!L){l.post({gen:se,kind:"patchError",message:"patch-ahead-of-render"});return}let Oe=new Set((N.echoPaths??[]).map((ut)=>ae(ut))),mn=Oe.size===0?N.forwardOps:N.forwardOps.filter((ut)=>!(ut.op==="set-key"&&Oe.has(ae(ut.path)))),ii=Je()&&Tp(mn),si=ii?sr(d,at):null;if(ii)Ie();try{if(Gl(h,N.forwardOps,d,L,N.echoPaths),on(d,A),Tt(d,T),si)un(d,si);l.post({gen:se,kind:"patchComplete"}),ct()}catch(ut){l.post({gen:se,kind:"patchError",message:ac(ut)})}return}if(N.kind==="styleUpdate"){if(N.gen!==y||!h)return;h.style=N.style;let se=d.firstElementChild;if(se instanceof HTMLElement)Un(se,N.style,h.$media??{});return}if(N.kind==="dragStart"){O=N.src,K=N.gen,_=N.dragSeq;return}if(N.kind==="dragEnd"||N.kind==="dragCancel"){O=null,K=-1,_=-1,G();return}if(N.kind==="dragMove"){let se=O&&h?dn(N.cursor,O,h,d.ownerDocument):null;l.post({dragSeq:N.dragSeq,gen:K,kind:"dragOver",preview:se}),M(N.cursor,N.dragSeq);return}if(N.kind==="drop"){let se=O&&h?dn(N.cursor,O,h,d.ownerDocument):null;l.post({dragSeq:N.dragSeq,gen:K,instruction:se?.instruction??null,kind:"dropResult",targetPath:se?.targetPath??null}),O=null,K=-1,_=-1,G();return}if(N.kind==="assetVersions"){Go=N.versions,Yo=N.revisions??{};let se=sc(zo);if(se)Hn((Oe)=>tn(Oe,se));return}if(N.kind==="keymap"){C={chords:N.chords,mac:N.mac};return}if(N.kind==="setColorScheme"){So(d.ownerDocument,N.scheme);return}if(N.kind==="setPopoverOpen"){if(E==="preview")return;A=N.path===null?null:ae(N.path),on(d,A),Tt(d,T),z();return}if(N.kind==="setDialogOpen"){if(E==="preview")return;T=N.path===null?null:ae(N.path),Tt(d,T),z();return}if(N.kind==="redefineElement"){ca(N.doc,N.base);return}if(N.kind==="setLocale"){Xn(d.ownerDocument,N.locale===null?null:{dir:N.dir,locale:N.locale},g);return}if(N.kind==="siteStyleUpdate"){bo(N.siteStyle,N.media);return}if(N.kind!=="render"||N.gen<m)return;if(So(d.ownerDocument,N.colorScheme??null),Xn(d.ownerDocument,N.locale??null,g),Je())Ie();m=N.gen,zo=N.assets??null,tl(N.editableTags??null);let{gen:ie,mapperCtx:oe}=N,Se=N.shadowDoc;(async()=>{try{Ul(),p?.(),p=null,f?.dispose(),oa(d.ownerDocument);let se={assets:sc(N.assets??null),container:d,doc:N.doc,docBase:N.docBase,mapperCtx:{arrayPaths:new Set(oe.arrayPaths),canvasMode:oe.canvasMode,layoutWrapped:oe.layoutWrapped,pageContentOffset:oe.pageContentOffset,pageContentPrefix:oe.pageContentPrefix},diffMarks:N.diffMarks??null,mode:N.mode,popoverOpen:N.popoverOpen?ae(N.popoverOpen):null,dialogOpen:N.dialogOpen?ae(N.dialogOpen):null,siteStyle:N.siteStyle};if(N.allowAutoRequests)se.allowAutoRequests=!0;if(f=await Oa(se),ie===m){A=N.popoverOpen?ae(N.popoverOpen):null,T=N.dialogOpen?ae(N.dialogOpen):null,on(d,A),Tt(d,T),h=Se,L=f.ctx,y=ie,E=N.mode,l.post({gen:ie,kind:"renderComplete"}),ct();let{defs:Oe}=f.ctx;p=Ls(()=>{try{l.post({gen:ie,kind:"dataScope",scope:tc(Oe)})}catch{}}),z()}}catch(se){l.post({gen:ie,kind:"renderError",message:ac(se)})}})()});return l.post({kind:"ready"}),()=>{if(dc(),Xn(d.ownerDocument,null,g),B(),X(),ce(),ee(),re(),ye&&U)U.cancelAnimationFrame(ye);ye=0,d.removeEventListener("error",Zo,!0),d.removeEventListener("load",Qo,!0),G(),de?.disconnect(),d.ownerDocument.removeEventListener("click",q,!0),d.ownerDocument.removeEventListener("wheel",ei),d.ownerDocument.removeEventListener("dragenter",pn,!0),d.ownerDocument.removeEventListener("dragleave",oi,!0),d.ownerDocument.removeEventListener("dragover",pn,!0),d.ownerDocument.removeEventListener("drop",ri,!0),p?.(),f?.dispose()}}function Rp(o){let l=new URLSearchParams(o.location.search);Ds(l.get("rpcToken"));let d=l.get("parentOrigin"),f=d||"*";if(!d)console.warn("[jx-canvas] no parentOrigin in iframe URL — accepting messages from any origin (token-gated). "+"The parent origin did not round-trip; the channel relies on the shared token alone.");let p=o.document.querySelector("#jx-canvas-root"),m=p instanceof HTMLElement?p:o.document.body,g=li({acceptOrigin:f,source:o,target:o.parent,targetOrigin:f,token:l.get("token")||""});return Np({channel:g,container:m})}if(typeof window<"u"&&window.parent!==window)Rp(window);export{Ap as IDLE_QUIET_FRAMES,Cp as IDLE_WATCH_MAX_MS,Pp as IMAGE_RETRY_WINDOW_MS,Rp as bootCanvasIframe,vp as fileDropHitFor,qo as isExternalFileDrag,Ep as layoutHitFor,Tp as patchDisturbsActiveEdit,Np as startCanvasIframe};
|
|
317
317
|
|
|
318
|
-
//# debugId=
|
|
318
|
+
//# debugId=21A235E6173BCBD064756E2164756E21
|
|
319
319
|
//# sourceMappingURL=iframe-entry.js.map
|