@jxsuite/studio 10.4.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-rqm7qrje.js +4 -0
- package/dist/chunks/adapter-cyy8vbcx.js +4 -0
- package/dist/chunks/add-new-flow-8cgtejv2.js +4 -0
- package/dist/chunks/{cf-account-picker-xb8vvt2h.js → cf-account-picker-v3qd2dhw.js} +3 -3
- package/dist/chunks/cf-settings-1fnw874z.js +4 -0
- package/dist/chunks/{color-area-h8dbasp1.js → color-area-frd9y9q6.js} +2 -2
- package/dist/chunks/color-field-rebpbe33.js +4 -0
- package/dist/chunks/{color-slider-nz2mrzky.js → color-slider-6bzmk3s7.js} +2 -2
- package/dist/chunks/color-t2bnnj8y.js +4 -0
- package/dist/chunks/{combobox-6hs00996.js → combobox-c49x7gf1.js} +3 -3
- 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-2f03wcgw.js → grid-view-a51mgzmq.js} +17 -17
- package/dist/chunks/{icons-gb967qc8.js → icons-qp8fn1k8.js} +2 -2
- package/dist/chunks/{iframe-entry-btck0e9s.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-b5qgggyp.js → iframe-entry-v40cr813.js} +4 -4
- package/dist/chunks/iframe-host-q0s0wwy3.js +4 -0
- package/dist/chunks/{image-bake-4afr4y6a.js → image-bake-q9ajdjsj.js} +3 -3
- package/dist/chunks/{image-editor-x7t8jbjn.js → image-editor-ke9std9b.js} +3 -3
- package/dist/chunks/index-57ang7ma.js +4 -0
- package/dist/chunks/index-eytr7av4.js +17 -0
- package/dist/chunks/{index-yjrfeks8.js → index-x495reff.js} +3 -3
- package/dist/chunks/{javascript-hy2mws8v.js → javascript-qe34bvaz.js} +3 -3
- package/dist/chunks/jsonMode-m8rseh31.js +13 -0
- 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-7gka1h86.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-xc3cbgsd.js +4 -0
- package/dist/chunks/{monaco-binding-a51py33c.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-cnmsav6b.js +4 -0
- 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-m5rwn31z.js → split-d15yencd.js} +2 -2
- package/dist/chunks/studio-0jhhznxy.js +9 -0
- package/dist/chunks/studio-0nb57pjg.js +7 -0
- package/dist/chunks/{studio-s24mhq0z.js → studio-0wa4wv4s.js} +4 -4
- package/dist/chunks/studio-0z8kp4xk.js +5 -0
- package/dist/chunks/{studio-g0hxtcga.js → studio-18gc5t3v.js} +4 -4
- package/dist/chunks/{studio-4fnb5648.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-nwf0c32p.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-2pk7kc7z.js → studio-495b6f2r.js} +4 -4
- package/dist/chunks/{studio-jma2q8r9.js → studio-4gthb2fd.js} +4 -4
- package/dist/chunks/{studio-0gvvqj3h.js → studio-4xadhxj1.js} +4 -4
- package/dist/chunks/{studio-nvcn2ykc.js → studio-52mzbxqm.js} +4 -4
- package/dist/chunks/{studio-v7a7yb5w.js → studio-56mmnsw8.js} +7 -7
- package/dist/chunks/studio-59hz8f4r.js +5 -0
- package/dist/chunks/{studio-sce30r7b.js → studio-5k9mfafh.js} +3 -3
- package/dist/chunks/{studio-rr00ex23.js → studio-5qez462c.js} +6 -6
- 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-wmjmsw0p.js → studio-8n99z71s.js} +4 -4
- package/dist/chunks/studio-8vmad6x2.js +5 -0
- package/dist/chunks/studio-93p5k4r4.js +5 -0
- package/dist/chunks/{studio-2x972v58.js → studio-9gb0m81w.js} +4 -4
- package/dist/chunks/studio-a4ymg4vd.js +5 -0
- package/dist/chunks/studio-anc8067x.js +5 -0
- package/dist/chunks/{studio-2e4hry72.js → studio-dbdt67kr.js} +5 -5
- package/dist/chunks/studio-dbex091t.js +5 -0
- package/dist/chunks/{studio-amaz545p.js → studio-dj8ctxey.js} +4 -4
- package/dist/chunks/{studio-k2evngrj.js → studio-ed9bz68j.js} +5 -5
- package/dist/chunks/{studio-4bgvvzhv.js → studio-fe2d1fp5.js} +4 -4
- package/dist/chunks/{studio-45mj4jqe.js → studio-fgp4cyy3.js} +4 -4
- package/dist/chunks/studio-ft706q02.js +5 -0
- package/dist/chunks/studio-g79s1dyg.js +6 -0
- package/dist/chunks/{studio-pj216fmn.js → studio-gahswxp4.js} +4 -4
- package/dist/chunks/studio-gbqc12bk.js +5 -0
- package/dist/chunks/studio-gxphbetb.js +6 -0
- 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-jj9gf1qc.js +5 -0
- package/dist/chunks/studio-jsjg3mjv.js +5 -0
- package/dist/chunks/studio-jtvb8hd7.js +5 -0
- package/dist/chunks/{studio-g9brbewz.js → studio-kp4vzrct.js} +4 -4
- package/dist/chunks/studio-kpx02gaa.js +7 -0
- package/dist/chunks/{studio-3na1r48j.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-eqcddvc2.js → studio-mr084886.js} +201 -201
- package/dist/chunks/studio-mrb10hv3.js +5 -0
- package/dist/chunks/{studio-0939t1q1.js → studio-nhpg405j.js} +4 -4
- package/dist/chunks/studio-nsec0hxm.js +64 -0
- package/dist/chunks/{studio-xx3r3sb0.js → studio-nv0mh0p5.js} +4 -4
- package/dist/chunks/studio-pafmb06w.js +5 -0
- package/dist/chunks/{studio-pm17wdc4.js → studio-pgftd79b.js} +4 -4
- package/dist/chunks/{studio-4zd6an2b.js → studio-pk961xgz.js} +4 -4
- package/dist/chunks/studio-pzbr7g05.js +5 -0
- package/dist/chunks/studio-qcc5hsw2.js +10 -0
- package/dist/chunks/studio-qfq58c8n.js +5 -0
- package/dist/chunks/studio-qvb2jr83.js +5 -0
- package/dist/chunks/studio-r85zw6ay.js +5 -0
- package/dist/chunks/studio-s0kwce5w.js +9 -0
- package/dist/chunks/studio-s6ymkf3q.js +14 -0
- package/dist/chunks/{studio-0x6f3nk9.js → studio-s7p5ccxa.js} +4 -4
- package/dist/chunks/{studio-1410q5dw.js → studio-s9jjap3x.js} +4 -4
- package/dist/chunks/{studio-evq47j2z.js → studio-t5hde1ws.js} +4 -4
- package/dist/chunks/studio-vj9yv897.js +5 -0
- package/dist/chunks/studio-wmak8xjw.js +5 -0
- package/dist/chunks/{studio-bnc50f9h.js → studio-wqsmvtqj.js} +4 -4
- package/dist/chunks/studio-x3z3rhej.js +5 -0
- package/dist/chunks/{studio-bg8pzprg.js → studio-xb55kpmy.js} +4 -4
- package/dist/chunks/studio-xxtdajmv.js +12 -0
- package/dist/chunks/studio-xxttcym1.js +5 -0
- package/dist/chunks/{studio-90zkgne5.js → studio-y2zsnzye.js} +7 -7
- package/dist/chunks/{studio-3qr08sxq.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-tpxcryf2.js → studio-yetr4gg1.js} +4 -4
- package/dist/chunks/studio-z295anhs.js +6 -0
- package/dist/chunks/studio-z89e6wpg.js +9 -0
- package/dist/chunks/{studio-5tet77de.js → studio-zbwr6prc.js} +3 -3
- package/dist/chunks/{studio-daksw8kh.js → studio-zdbsv5q2.js} +4 -4
- package/dist/chunks/{studio-abh9kfdh.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-dj1pvgz7.js → tooltip-ghkxkasp.js} +3 -3
- package/dist/chunks/{tree-j0ebwr5s.js → tree-vw4nc63s.js} +2 -2
- package/dist/chunks/tsMode-7gngmamr.js +14 -0
- package/dist/chunks/workspace-gv0hxgsm.js +4 -0
- package/dist/chunks/workspace-home-j7e0mjy5.js +4 -0
- package/dist/chunks/{ws-client-arz2qsy9.js → ws-client-vs11sxc5.js} +3 -3
- package/dist/iframe-entry.js +14 -14
- package/dist/manifest.json +84 -83
- package/dist/studio.js +99 -98
- package/dist/workers/ts.worker.js +3 -3
- package/package.json +12 -12
- package/src/browse/library-layouts.ts +9 -12
- package/src/browse/library-pane.ts +22 -16
- package/src/browse/library-source.ts +3 -4
- package/src/browse/preview-style.ts +2 -1
- package/src/canvas/canvas-live-render.ts +2 -5
- package/src/canvas/canvas-page-context.ts +5 -0
- 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/content/entry-commands.ts +32 -27
- package/src/content/entry-editor.ts +46 -44
- package/src/content/entry-inspector.ts +15 -12
- package/src/content/entry-model.ts +3 -3
- package/src/content/entry-summaries.ts +5 -5
- package/src/content/hold-state.ts +172 -0
- package/src/content/page-summaries.ts +10 -14
- package/src/create/add-new-flow.ts +2 -1
- package/src/editor/convert-targets.ts +2 -23
- package/src/editor/inline-edit.ts +6 -1
- package/src/editor/repeater-scope.ts +333 -74
- 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/grid/sources/content-source.ts +42 -66
- package/src/locale/element-names.ts +131 -0
- package/src/panels/block-action-bar.ts +3 -4
- package/src/panels/dnd.ts +3 -1
- package/src/panels/elements-panel.ts +93 -36
- package/src/panels/events-panel.ts +6 -2
- package/src/panels/formula-workspace.ts +9 -0
- 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/properties-panel.ts +127 -35
- package/src/panels/site-panel.ts +2 -1
- package/src/panels/statement-editor.ts +4 -0
- package/src/panels/style-panel.ts +2 -1
- package/src/panels/styles-panel.ts +2 -2
- package/src/panels/tab-strip.ts +29 -26
- package/src/platforms/cloud.ts +5 -2
- package/src/services/ai-command-tools.ts +2 -1
- package/src/services/ai-project-tools.ts +21 -8
- package/src/services/ai-tools.ts +5 -5
- package/src/services/ai-write-report.ts +22 -4
- package/src/services/context-manager.ts +110 -2
- package/src/services/document-assistant.ts +2 -2
- package/src/services/harness/chat-reducer.ts +9 -4
- 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/services/render-critic.ts +234 -12
- package/src/services/tool-executor.ts +16 -8
- 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/collections-panel.json +1 -1
- package/src/surfaces/collections-panel.ts +1 -1
- package/src/surfaces/entry-editor.json +10 -10
- package/src/surfaces/entry-editor.ts +22 -19
- package/src/surfaces/entry-inspector.json +11 -11
- package/src/surfaces/entry-inspector.ts +17 -10
- package/src/surfaces/panel-elements.json +466 -206
- package/src/surfaces/panel-elements.ts +61 -25
- package/src/surfaces/tab-strip.json +5 -5
- package/src/surfaces/tab-strip.ts +2 -2
- package/src/tabs/project-config.ts +13 -13
- package/src/tabs/tab.ts +7 -2
- package/src/types.ts +13 -2
- package/src/ui/expression-editor.ts +10 -5
- package/src/ui/schema-form.ts +18 -1
- package/src/utils/edit-display.ts +27 -1
- 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/2020-906vx2dq.js +0 -4
- package/dist/chunks/adapter-hnvad61x.js +0 -4
- package/dist/chunks/add-new-flow-v0pm96mr.js +0 -4
- package/dist/chunks/cf-settings-mkbcz4z2.js +0 -4
- package/dist/chunks/color-04361ttk.js +0 -4
- package/dist/chunks/color-field-qv5r2b16.js +0 -4
- package/dist/chunks/components-w5zqwva1.js +0 -4
- package/dist/chunks/content-source-g38w0d3f.js +0 -4
- package/dist/chunks/convert-to-repeater-r8sfxjjm.js +0 -4
- package/dist/chunks/editor-wvf5e6j9.js +0 -4
- package/dist/chunks/entry-commands-t13dyw3c.js +0 -4
- package/dist/chunks/extension-sections-vjzw46xb.js +0 -4
- package/dist/chunks/file-ops-1sghzgcr.js +0 -4
- package/dist/chunks/files-zrqtgt41.js +0 -4
- package/dist/chunks/format-host-9gy76erh.js +0 -4
- package/dist/chunks/fs-events-45rhg3me.js +0 -4
- package/dist/chunks/grid-open-t4fq6bbm.js +0 -4
- package/dist/chunks/iframe-entry-42hpmwz5.js +0 -5
- package/dist/chunks/iframe-host-9aq8ze3q.js +0 -4
- package/dist/chunks/index-f9qr7kzh.js +0 -4
- package/dist/chunks/jsonMode-vj30te2h.js +0 -13
- package/dist/chunks/jx-validate-r4ax11e3.js +0 -4
- package/dist/chunks/layers-m49nmwvx.js +0 -4
- package/dist/chunks/layers-panel-zr92pwdp.js +0 -4
- package/dist/chunks/lit-html-k2mb9k0r.js +0 -4
- package/dist/chunks/media-library-j74rt0w4.js +0 -4
- package/dist/chunks/media-open-mypr0k6b.js +0 -4
- package/dist/chunks/media-picker-pemtbsjv.js +0 -4
- package/dist/chunks/menu-d2jxpgma.js +0 -4
- package/dist/chunks/monaco-buffer-pa0g6ax7.js +0 -4
- package/dist/chunks/monaco-setup-0hw9f835.js +0 -4
- package/dist/chunks/notify-bwehrp7q.js +0 -4
- package/dist/chunks/parse-hee7ne9b.js +0 -4
- package/dist/chunks/platform-kv0k65cy.js +0 -4
- package/dist/chunks/popover-9tf4cjrk.js +0 -4
- package/dist/chunks/publish-panel-vg1n880b.js +0 -4
- package/dist/chunks/publish-quick-4fwngwrw.js +0 -4
- package/dist/chunks/publish-workspace-jv4w2bx2.js +0 -4
- package/dist/chunks/quick-search-nh29rt8a.js +0 -4
- package/dist/chunks/references-vqyr5s9x.js +0 -4
- package/dist/chunks/right-panel-3ws9f2w0.js +0 -4
- package/dist/chunks/source-control-h3hcs5gy.js +0 -4
- package/dist/chunks/studio-0khd8xtx.js +0 -4
- package/dist/chunks/studio-1ctnw3xv.js +0 -5
- package/dist/chunks/studio-1ks5d9y4.js +0 -5
- package/dist/chunks/studio-1y9mab9m.js +0 -5
- package/dist/chunks/studio-2kpxm0eh.js +0 -7
- package/dist/chunks/studio-2zz4qbv9.js +0 -5
- package/dist/chunks/studio-3pz4t5a2.js +0 -5
- package/dist/chunks/studio-4f7thq0p.js +0 -5
- package/dist/chunks/studio-61rg2cz5.js +0 -5
- package/dist/chunks/studio-7rrdbvex.js +0 -5
- package/dist/chunks/studio-9c6cbq2c.js +0 -4
- package/dist/chunks/studio-9dq7rwc7.js +0 -5
- package/dist/chunks/studio-9gr7xs9r.js +0 -6
- package/dist/chunks/studio-a88ej93p.js +0 -7
- package/dist/chunks/studio-acer0g8w.js +0 -5
- package/dist/chunks/studio-az3wvyh2.js +0 -5
- package/dist/chunks/studio-brh8d2pr.js +0 -5
- package/dist/chunks/studio-c2fa783p.js +0 -9
- package/dist/chunks/studio-cfnn70h1.js +0 -5
- package/dist/chunks/studio-cqxj4fcy.js +0 -5
- package/dist/chunks/studio-cw11h078.js +0 -5
- package/dist/chunks/studio-dn56z7sn.js +0 -5
- package/dist/chunks/studio-egnjpyde.js +0 -9
- package/dist/chunks/studio-ejrypvmq.js +0 -5
- package/dist/chunks/studio-frc16j8v.js +0 -10
- package/dist/chunks/studio-gnazwtv3.js +0 -5
- package/dist/chunks/studio-hfqpfmpk.js +0 -5
- package/dist/chunks/studio-hh394phe.js +0 -5
- package/dist/chunks/studio-j0zf5x2x.js +0 -5
- package/dist/chunks/studio-j5fcp6gj.js +0 -5
- package/dist/chunks/studio-jd1qb1st.js +0 -7
- package/dist/chunks/studio-k0xzrse2.js +0 -64
- package/dist/chunks/studio-k1xqrgm5.js +0 -5
- package/dist/chunks/studio-k3we3kqb.js +0 -5
- package/dist/chunks/studio-knsjyx7n.js +0 -5
- package/dist/chunks/studio-mrjtnm62.js +0 -5
- package/dist/chunks/studio-n9qba0gx.js +0 -5
- package/dist/chunks/studio-nzemfbkk.js +0 -14
- package/dist/chunks/studio-pwctzka3.js +0 -16
- package/dist/chunks/studio-q80fg1d6.js +0 -12
- package/dist/chunks/studio-q9hx2qp0.js +0 -5
- package/dist/chunks/studio-qrzmfaf6.js +0 -5
- package/dist/chunks/studio-r6mx7vm5.js +0 -7
- package/dist/chunks/studio-swedpd82.js +0 -5
- package/dist/chunks/studio-tmfcn347.js +0 -6
- package/dist/chunks/studio-v5wktj6f.js +0 -5
- package/dist/chunks/studio-vpevkfxw.js +0 -5
- package/dist/chunks/studio-wqfaqw4m.js +0 -5
- package/dist/chunks/studio-xpx91fby.js +0 -6
- package/dist/chunks/studio-xva3hzkv.js +0 -5
- package/dist/chunks/studio-z3fztxrp.js +0 -9
- package/dist/chunks/studio-z9453ypn.js +0 -6
- package/dist/chunks/toast-w11qpkyz.js +0 -4
- package/dist/chunks/tsMode-jg1dtphj.js +0 -14
- package/dist/chunks/workspace-6ztqcrsh.js +0 -4
- package/dist/chunks/workspace-home-rse9h8a0.js +0 -4
- package/src/content/draft-state.ts +0 -108
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{n,Y,_}from"./studio-k3we3kqb.js";function y(t){return JSON.parse(JSON.stringify(t))}function Ce(t){return t===void 0||t===null?t:y(t)}function oe(t,e){let r=t;for(let o of e){if(r==null)return;r=r[o]}return r}function Ov(t){if(Array.isArray(t))throw TypeError("Cannot insert into a children array; parentPath must point at a node");if(!t.children)t.children=[];if(!Array.isArray(t.children))throw TypeError("Cannot insert into mapped-array children; edit the map template instead");return t.children}function Mv(t,e){let{op:r}=e;switch(e.op){case"set-key":{let o=oe(t,e.path);if(!o)throw Error(`doc-op-node-not-found:${e.path.join("/")}`);if(e.value===void 0)delete o[e.key];else o[e.key]=Ce(e.value);return}case"insert-child":{l(t,e.parentPath).splice(e.index,0,Ce(e.node));return}case"remove-child":{l(t,e.parentPath).splice(e.index,1);return}case"set-child":{l(t,e.parentPath).splice(e.index,1,Ce(e.node));return}case"move-child":{P(e);let o=l(t,e.fromParentPath),a=l(t,e.toParentPath),[i]=o.splice(e.fromIndex,1);a.splice(e.toIndex,0,i);return}default:break}throw Error(`unknown-doc-op:${r}`)}function l(t,e){let r=oe(t,e);if(r==null)throw TypeError(`doc-op-node-not-found:${e.join("/")}`);return Ov(r)}function h1(t,e,r,o,a){let i=t.length,c=i<e.length&&t.every((s,u)=>s===e[u]),d=e[i+1];if(!c||e[i]!=="children"||!Y(d))return e;if(a?d<r:d<=r)return e;let h=[...e];return h[i+1]=d+o,h}function P(t){let e=[...t.fromParentPath,"children",t.fromIndex],r=t.toParentPath;if(r.length>=e.length&&e.every((o,a)=>o===r[a]))throw Error(`doc-op-move-into-self:${r.join("/")}`)}function df(t,e){return t<0?Math.max(e+t,0):Math.min(t,e)}function p1(t,e){let{op:r}=e;switch(b(e),e.op){case"set-key":{let o=oe(t,e.path);if(o===void 0)throw Error(`doc-op-node-not-found:${e.path.join("/")}`);if(!_(o)||Array.isArray(o))throw TypeError(`doc-op-not-a-node:${e.path.join("/")}`);let a=Ce(o[e.key]);return a===void 0?{key:e.key,op:"set-key",path:e.path}:{key:e.key,op:"set-key",path:e.path,value:a}}case"insert-child":{let{length:o}=f(t,e.parentPath);return{index:df(e.index,o),op:"remove-child",parentPath:e.parentPath}}case"remove-child":{let o=x(t,e.parentPath,e.index);return{index:e.index,node:o,op:"insert-child",parentPath:e.parentPath}}case"set-child":{let o=x(t,e.parentPath,e.index);return{index:e.index,node:o,op:"set-child",parentPath:e.parentPath}}case"move-child":{P(e);let o=J(t,e.fromParentPath);m(o,e.fromParentPath,e.fromIndex);let a=f(t,e.toParentPath),i=df(e.toIndex,a.length-(a===o?1:0));return{fromIndex:i,fromParentPath:h1(e.fromParentPath,e.toParentPath,e.fromIndex,-1,!1),op:"move-child",toIndex:e.fromIndex,toParentPath:h1(e.toParentPath,e.fromParentPath,i,1,!0)}}default:break}throw Error(`unknown-doc-op:${r}`)}function b(t){let e=[];if(t.op==="move-child")e.push([t.fromParentPath,t.fromIndex],[t.toParentPath,t.toIndex]);else if(t.op==="insert-child"||t.op==="remove-child"||t.op==="set-child")e.push([t.parentPath,t.index]);for(let[r,o]of e)if(!Number.isInteger(o))throw TypeError(`doc-op-index:${[...r,"children",String(o)].join("/")}`)}function J(t,e){let r=oe(t,e);return r&&Array.isArray(r.children)?r.children:null}function m(t,e,r){if(!t||r<0||r>=t.length)throw Error(`doc-op-node-not-found:${[...e,"children",r].join("/")}`)}function x(t,e,r){let o=J(t,e);return m(o,e,r),Ce(o[r])}function f(t,e){let r=oe(t,e);if(!_(r)||Array.isArray(r))throw Error(`doc-op-node-not-found:${e.join("/")}`);if(r.children===void 0)return[];if(!Array.isArray(r.children))throw TypeError(`doc-op-mapped-children:${e.join("/")}`);return r.children}function na(t,e){if(t.length>e.length)return!1;return t.every((r,o)=>r===e[o])}function g(t,e){let r=Math.min(t.length,e.length);for(let o=0;o<r;o++){let a=t[o],i=e[o];if(a===i)continue;if(Y(a)&&Y(i))return a-i;return String(a)<String(i)?-1:1}return t.length-e.length}function w(t){let e=[];for(let r of t)if(!t.some((o)=>!v(o,r)&&na(o,r)))e.push([...r]);return e}function v(t,e){return t.length===e.length&&na(t,e)}function uf(t){let e=t?.at(-1);return t&&t.at(-2)==="children"&&Y(e)?{index:e,parentPath:t.slice(0,-2)}:null}function ru(t){return uf(t)!==null}function sg(t){return w(t).filter((e)=>ru(e)).toSorted((e,r)=>g(r,e))}function c0(t){if(Y(t)&&Number.isInteger(t))return t;return n(t)&&/^(?:0|[1-9]\d*)$/.test(t)?Number(t):null}function d0(t,e,r,o){let a=uf(e),i=a&&oe(t,a.parentPath),c=oe(t,r);if(!a||!i||!Array.isArray(i.children)||!c)return null;if(i.children[a.index]===void 0)return null;let d=i===c,h=d&&a.index<o?o-1:o,s=Array.isArray(c.children)?c.children.length:0,u={fromIndex:a.index,fromParentPath:a.parentPath,op:"move-child",toIndex:df(h,s-(d?1:0)),toParentPath:r},p=p1(t,u);return{forward:u,inverse:p}}
|
|
2
|
-
export{Ce,oe,Ov,Mv,h1,df,p1,na,uf,ru,sg,c0,d0};
|
|
3
|
-
|
|
4
|
-
//# debugId=83EBFA104545DF0064756E2164756E21
|
|
5
|
-
//# sourceMappingURL=studio-v5wktj6f.js.map
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
var s=new Set(["project.schema.json","document.schema.json"]);function iR(e){return s.has(e)?`file:///.jx/generated/${e}`:`file:///${e}`}function v2(e,r){return{head:`file:///.jx/diff/${e}/head/${r}`,work:`file:///.jx/diff/${e}/work/${r}`}}function y2(e){switch(e.slice(e.lastIndexOf(".")+1).toLowerCase()){case"cjs":case"js":case"mjs":return"javascript";case"css":return"css";case"htm":case"html":return"html";case"json":return"json";case"md":return"markdown";case"cts":case"mts":case"ts":return"typescript";case"yaml":case"yml":return"yaml";default:return"plaintext"}}
|
|
2
|
-
export{iR,v2,y2};
|
|
3
|
-
|
|
4
|
-
//# debugId=9404E8EB25D80EE864756E2164756E21
|
|
5
|
-
//# sourceMappingURL=studio-vpevkfxw.js.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{p,ye}from"./studio-4fnb5648.js";import{rt,Eo,kO,Bp,Dx,xr,TO,zp}from"./studio-g9brbewz.js";import{w}from"./studio-sce30r7b.js";import{Zs,dt}from"./studio-tpxcryf2.js";import{n,Y,Ze,Q,v}from"./studio-k3we3kqb.js";var u=null;async function Hd(){if(!ye()||!Q(p().getAccountStatus)){u=null;return}try{u=await p().getAccountStatus?.()??null}catch{u=null}}function iC(){return u}function oC(){return u!==null&&u.installations.length===0&&Boolean(u.appInstallUrl)}function dA(){if(u===null)return null;let e=u.installations.flatMap((r)=>r.manageUrl?[{account:r.account??`Installation ${r.id}`,url:r.manageUrl}]:[]);if(e.length===0&&!u.appInstallUrl)return null;let t={manage:e};if(u.appInstallUrl)t.installUrl=u.appInstallUrl;return t}function uA(){return u?.entries??[]}function AL(){return(u?.notices??[]).filter((e)=>e.display!=="toast")}var X=new Set;function Z(){let e=(u?.notices??[]).filter((t)=>t.display==="toast"&&!X.has(t.id));for(let t of e)X.add(t.id);return e}var ee="https://jxsuite.com/problems/";function N(e){return typeof e==="string"}function fe(e){return typeof e==="object"&&e!==null}function Bb(e){if(!N(e)||!e.startsWith("https://jxsuite.com/problems/"))return null;let t=e.slice(29);return t===""?null:t}function tr(e){if(N(e))return e.trim()===""?null:e;if(!fe(e))return null;for(let t of[e.detail,e.error,e.title])if(N(t)&&t.trim()!=="")return t;return null}function ll(e,t){return tr(e)??(t===void 0?"Request failed":`Request failed (${t})`)}var m=(e,t,r,i)=>{let s={status:t,title:r,type:`${ee}${e}`};if(i!==void 0)s.extensions=i;return s},Ne={invalidRequest:m("invalid-request",400,"The request was malformed or incomplete"),notFound:m("not-found",404,"The requested resource does not exist"),methodNotAllowed:m("method-not-allowed",405,"That method is not allowed on this route"),conflict:m("conflict",409,"The request conflicts with the current state",["conflicts"]),payloadTooLarge:m("payload-too-large",413,"The request body is too large"),unauthorized:m("unauthorized",401,"Credentials are missing or not accepted"),forbidden:m("forbidden",403,"The request was refused"),needsInstallationAccess:m("needs-installation-access",403,"The GitHub App is not installed for that account",["installUrl"]),pathOutsideProject:m("path-outside-project",403,"The path resolves outside the active project"),actionRequired:m("action-required",403,"An action is required first",["actions","heading","retry"]),noActiveProject:m("no-active-project",409,"No project is active on this backend"),capabilityUnavailable:m("capability-unavailable",501,"This backend does not provide that capability"),upstreamFailure:m("upstream-failure",502,"An upstream service failed",["upstream"]),internalError:m("internal-error",500,"The backend failed to complete the request")};var o=(e,t,r,i)=>{let s={method:e,path:t,optional:i!==void 0,summary:r};if(i!==void 0)s.degradation=i;return s},Fe={activate:o("POST","/__studio/activate","Bind the backend to a project root"),project:o("GET","/__studio/project","Root project metadata {name, root}"),projectInfo:o("GET","/__studio/project-info","Probe a directory: {isSiteProject, projectConfig?, directories?}"),resolveSite:o("GET","/__studio/resolve-site","Resolve the owning site of a file path {sitePath, projectConfig?, fileRelPath?}"),sites:o("GET","/__studio/sites","Enumerate site projects [{config, path}] (backs listProjects)","The welcome screen's Projects catalogue stays hidden."),createProject:o("POST","/__studio/create-project","Scaffold a project at a caller-chosen destination → {root, config}"),starters:o("GET","/__studio/starters","Starter templates (StarterInfo[])","The New Project picker offers only blank/templates."),importSite:o("POST","/__studio/import-site","Clone a live website into a project; streams NDJSON progress","The New Project Import tab is unavailable."),files:o("GET","/__studio/files","List a directory (DirEntry[]) in stable path order; an entry may carry an opaque content `version` the backend vouches for; with ?glob=<pattern>, search matching files project-wide"),fileRead:o("GET","/__studio/file","Read a file's text content"),filesRead:o("POST","/__studio/files/read","Read many files' text content {paths} → ReadFilesResult {files: [path, {content} | "+"{error: {status, code?, message}}][], omitted}. At most READ_FILES_MAX_PATHS (200) paths and a backend byte budget per call: the excess is listed in `omitted` (never a 400) and the first path is always answered. Per-path errors: 404 missing/deleted, 415 binary, 413 too large, 502 upstream. Allowed for read-only sessions; keeps fileRead's server-side effects","Adapters fall back to one fileRead per path."),fileWrite:o("PUT","/__studio/file","Write a file's text content"),fileDelete:o("DELETE","/__studio/file","Delete a file"),fileUpload:o("POST","/__studio/file/upload","Upload binary content to a path → UploadResult {path, size?}. `path` is the answer, not an "+"echo: a store that de-duplicates, suffixes, or normalizes names reports what it really wrote"),fileBytes:o("GET","/__studio/file/bytes","A project file's raw bytes, undecoded — the read side of `fileUpload`, for a caller that must "+"not go through UTF-8","Studio can only read a project file as text, so any surface that must decode one stays hidden."),documentRaw:o("GET","/__studio/raw/","A project file as its own bytes, at its own URL — the mount a canvas renders against when "+"the editor origin does not serve the site's URL space. The project-relative path is appended to this prefix","The canvas cannot address project files by URL, so a host whose origin does not serve the site URL space renders no component $refs and no images."),fileRename:o("POST","/__studio/file/rename","Rename/move (+ refactor report). `from`/`to` are server-root-relative; every path in the "+"report is relative to the active project (specs/server.md §4.1)"),references:o("GET","/__studio/references","Where a file or a component tag is used (?path=&tag=, at least one) → ReferencesResult "+"{files, filesReferencing, refsTotal} — the read side of the rename refactor's own walker, "+"cached until the backend's watcher sees the tree move (backs findReferences). `?path=` is server-root-relative and every path in the answer is relative to the active project; a "+"target outside that project is a 400, never a zero-result 200 (specs/server.md §4.1)",'Usage counts are hidden: no "Used on N pages" in the inspector, no Selection: Find Usages, and delete/rename confirmations state no reference count.'),locate:o("POST","/__studio/locate","Find a file by name → {path | null}"),collab:o("GET","/__studio/collab","Realtime co-editing: a WebSocket upgrade speaking the @jxsuite/collab wire envelope (one socket per project, documents multiplexed by path; y-protocols sync + project-level "+"awareness in lib0 binary frames — see @jxsuite/collab/envelope for the frame layout and "+"the docEpoch/doc-reset lifecycle). A plain GET (no Upgrade) answers {collab, protocols, version} as the capability probe, and `protocols` is the subprotocol negotiation: the client offers one of them as Sec-WebSocket-Protocol and the server echoes it, or the "+"client offers none when the server advertises none, because RFC 6455 §4.1 fails a "+"connection whose offer went unechoed.","Realtime co-editing is unavailable; Studio edits solo with file-level saves"),components:o("GET","/__studio/components","Discover components (ComponentMeta[])"),cem:o("GET","/__studio/cem","Custom-elements manifest of an npm dependency","Dependency components lose prop/slot metadata."),formats:o("GET","/__studio/formats","The project's format registry entries plus a sibling `extensions` array — per enabled "+"extension its manifest identity and project-section contributions (ExtensionsInfo[]; backs listFormats and listExtensions).","Only .json documents open (backs listFormats); descriptor-contributed settings sections do not appear."),extensionCatalog:o("GET","/__studio/catalog","Extensions this backend can OFFER (ExtensionCatalogEntry[]) — the shipped first-party "+"catalogue plus any package in the project's own dependencies exporting a jx-extension.json, each marked with whether the host resolves it without a project install and whether the project has it installed. A capability rather than a constant: a Worker ships a fixed set "+"of extension packages (specs/extensions.md §5.5). Backs listExtensionCatalog.","The Extensions section offers no catalogue; adding an extension stays a typed package name."),projectSchemas:o("GET","/__studio/project-schemas","The project's generated entry documents (project.schema.json / document.schema.json), "+"PRE-BUNDLED into self-contained schemas — {project, document} (backs fetchProjectSchemas). "+"Regenerated on demand when missing or older than project.json.","The JSON editor falls back to the bundled core schemas (extension sections get no editor validation/completion)."),format:o("POST","/__studio/format","Dispatch a format capability {format, action: parse|serialize, source?|doc?}","Non-JSON documents cannot be parsed/serialized (backs formatAction)."),pluginSchema:o("GET","/__studio/plugin-schema","Extract a $studio schema from a class source","Plugin property panels fall back to generic JSON editing."),codeFormat:o("POST","/__studio/code/format","Format posted source {code, path?} → {code, errors}","Code editors skip format-on-open/save (codeService returns null)."),codeMinify:o("POST","/__studio/code/minify","Minify posted source {code} → {code}","Compiled-output minification is skipped."),codeLint:o("POST","/__studio/code/lint","Lint posted source {code, path?} → {diagnostics}","Code editors show no lint markers."),buildSite:o("POST","/__studio/build","Build or render the site → {routes, files, errors, mode?, url}","Build Site reports that this target cannot build."),previewSite:o("POST","/__studio/preview","Preview the working tree at a route → {routes, files, errors, mode, url, reused}","Open in Browser falls back to buildSite."),previewOverlay:o("POST","/__studio/preview/overlay","Publish (POST) or retract (DELETE) a document's unsaved bytes → 204","A live preview shows the last saved state instead of the editor's."),packages:o("GET","/__studio/packages","List dependencies (PackageInfo[])"),packagesAdd:o("POST","/__studio/packages/add","Add a registry dependency, writing package.json and package-lock.json together"),packagesRemove:o("POST","/__studio/packages/remove","Remove a dependency, writing package.json and package-lock.json together"),packagesInstall:o("POST","/__studio/packages/install","Install the declared dependencies (npm's installer, writing package-lock.json)","Install/reinstall affordances are hidden; add, remove and version updates still work where the backend serves them (a cloud session updates the lockfile without installing)."),packagesNeedsInstall:o("GET","/__studio/packages/needs-install","Whether node_modules is stale","The install-on-open prompt never shows."),packagesVersions:o("GET","/__studio/packages/versions","Newest published version of each dependency (PackageVersionInfo[])","The Latest column stays empty and the update affordances are hidden."),packagesSetVersions:o("POST","/__studio/packages/set-versions","Rewrite dependency ranges and install (lockfile-only where nothing installs)","Bulk version updates are hidden."),gitStatus:o("GET","/__studio/git/status","Working-tree status (GitStatusResult)"),gitBranches:o("GET","/__studio/git/branches","Branch list (GitBranchesResult)"),gitLog:o("GET","/__studio/git/log","Recent commits (GitLogEntry[])"),gitStage:o("POST","/__studio/git/stage","Stage files"),gitUnstage:o("POST","/__studio/git/unstage","Unstage files"),gitCommit:o("POST","/__studio/git/commit","Commit staged (else all dirty) files"),gitPush:o("POST","/__studio/git/push","Push (cloud: sync check — commits land on push)"),gitPull:o("POST","/__studio/git/pull","Pull/fast-forward; 409 {conflicts} on overlap"),gitFetch:o("POST","/__studio/git/fetch","Refresh remote tracking state"),gitCheckout:o("POST","/__studio/git/checkout","Switch branches"),gitCreateBranch:o("POST","/__studio/git/create-branch","Create a branch"),gitCommitBranch:o("POST","/__studio/git/commit-branch","Commit the change set as a NEW branch off the session's base, then take it out of this one "+"→ GitCommitBranchResult; 409 branch_exists","A publish the remote conflicts with reports the conflict alone, and Send for review stays refused on a branch whose every commit is live."),gitDiff:o("GET","/__studio/git/diff","Unified diff of dirty files (or one path)"),gitShow:o("GET","/__studio/git/show","File content at a ref"),gitDiscard:o("POST","/__studio/git/discard","Discard working changes"),gitInit:o("POST","/__studio/git/init","Initialize a repository"),gitAddRemote:o("POST","/__studio/git/add-remote","Add a remote"),gitClone:o("POST","/__studio/git/clone","Clone a repository","The welcome screen hides Clone Git Repository."),gitPr:o("POST","/__studio/git/pr","Open a pull request → PullRequestInfo","Studio falls back to a direct GitHub API call with the user's token."),dataConnections:o("GET","/__studio/data/connections","Connector connections with configured/missingSecrets/isDefault state, reachable table names, and registry-descriptor provider metadata (DataConnectionsResponse; backs dataConnections)","The connections settings section shows no status, and data-domain actions stay hidden."),dataConnectionTest:o("POST","/__studio/data/connections/test","Probe a connection {connection} → DataConnectionTestResult (backs dataConnectionTest)","The Test Connection action is hidden."),dataPush:o("POST","/__studio/data/push","Additive schema push {connection?, dryRun?} → DataPushResult (plan of DataPushStep[], "+"applied, warnings/errors; backs dataPush)","The Push Schema action is hidden; schemas deploy via `jx db push` instead."),dataRows:o("GET","/__studio/data/rows","Page a table (DataRowsQuery params) → DataRowsResult {rows, total, columns} (backs dataRows)","The data grid is unavailable."),dataInsertRow:o("POST","/__studio/data/rows","Insert a row {table, connection?, values} → {row} (backs dataInsertRow)","The data grid hides its add-row footer."),dataUpdateRow:o("PUT","/__studio/data/rows","Update a row keyed on its primary key {table, connection?, pk, set} → {row} (backs "+"dataUpdateRow)","Data grid cells are read-only."),dataDeleteRow:o("DELETE","/__studio/data/rows","Delete a row (?table=&pk=&connection=) → {ok} (backs dataDeleteRow)","The data grid hides row deletion."),secretsList:o("GET","/__studio/secrets","Configured secret env-var NAMES, never values (SecretsListResponse; backs listSecrets)","Secret fields cannot show set/unset state."),secretsSet:o("PUT","/__studio/secrets","Write/remove secrets in the backend store (.dev.vars locally) {set?, remove?} → names "+"(backs setSecrets)","The secret form control renders disabled; secrets are edited in .dev.vars by hand."),aiChat:o("POST","/__studio/ai/chat","StreamEvent SSE chat proxy {messages, tools, systemPrompt, model}"),aiModels:o("GET","/__studio/ai/models","Model catalogue (AiModelsResponse)"),cfProxy:o("POST","/__studio/cf/proxy","Allowlisted Cloudflare API passthrough {path, method?, body?} (backs cfApi)","The Publish panel explains the git-push publishing path instead.")};var OL=200,ML=100,PL=12;var me=new Set(["reload","repeat","none"]);function Dp(e){if(!Array.isArray(e))return[];return e.flatMap((r)=>{if(!v(r))return[];let{href:i,id:s,label:d,primary:l}=r;if(!n(s)||!s||!n(d)||!d)return[];let g={id:s,label:d};if(n(i)&&i)g.href=i;if(l===!0)g.primary=!0;return[g]})}function te(e){return n(e)&&me.has(e)}function FL(e){return te(e)?e:void 0}function ge(e){return e.replaceAll("_","-")}function P(e){if(!v(e))return{};let{actions:t,code:r,conflicts:i,heading:s,installUrl:d,retry:l,type:g}=e,a={},c=Bb(g)??(n(r)?ge(r):null);if(c!==null)a.code=c;if(n(d))a.installUrl=d;if(t!==void 0)a.actions=Dp(t);if(n(s)&&s)a.heading=s;if(te(l))a.retry=l;if(Array.isArray(i))a.conflicts=i.filter((b)=>n(b));return a}function hA(e){let t=P(e);return(t.code==="pull-conflict"||t.code==="conflict")&&t.conflicts?t.conflicts:null}function pA(e){let t=P(e);return t.code==="needs-installation-access"&&t.installUrl?t.installUrl:null}function fA(e){return P(e).code==="action-required"}var B="X-Jx-Ai-Session";var F="X-Api-Provider";function oe(e){return typeof e==="string"}function be(e){return oe(e)&&e!==""}function O(e){return typeof e==="object"&&e!==null}function xe(e){return Array.isArray(e)}function Se(e,t){if(!e)return t;let r;try{r=JSON.parse(e)}catch{return e}if(O(r)){if("error"in r){let{error:i}=r;if(oe(i))return i;if(O(i)&&"message"in i&&Boolean(i.message))return String(i.message)}if("errors"in r&&xe(r.errors)){let[i]=r.errors;if(O(i)&&"message"in i&&Boolean(i.message))return String(i.message)}}return e}function _e(e){let t;try{t=JSON.parse(e)}catch{return""}return O(t)&&"code"in t&&be(t.code)?t.code:""}function ne(e,t){let r=t;if(r.name==="AbortError")return{type:"done",stopReason:"cancelled"};return{type:"error",message:`${e}: ${r.message}`}}function Ae(e){return typeof e==="function"}function jL({chatUrl:e,model:t="gpt-4o",apiKey:r,baseUrl:i,provider:s,sessionId:d}){let l=null;async function*g(a,c,b,A){let S={"Content-Type":"application/json"};if(r)S["X-Api-Key"]=r;if(i)S["X-Api-Base-URL"]=i;if(s&&s!=="openai-compat")S[F]=s;if(d)S[B]=d;l??=Promise.resolve(Ae(e)?e():e);let x;try{x=await l}catch(h){if(A.aborted){yield{type:"done",stopReason:"cancelled"};return}throw h}if(A.aborted){yield{type:"done",stopReason:"cancelled"};return}let f;try{f=await fetch(x,{method:"POST",headers:S,body:JSON.stringify({messages:a,tools:c,systemPrompt:b,model:t}),signal:A})}catch(h){yield ne("Network error",h);return}if(!f.ok){let h="";try{h=await f.text()}catch{}let T=Se(h,f.statusText),M=_e(h);yield{type:"error",message:T,code:M||String(f.status)};return}let y=f.body?.getReader();if(!y){yield{type:"error",message:"No response body"};return}let ue=new TextDecoder,U="";try{for(let h=await y.read();!h.done;h=await y.read()){U+=ue.decode(h.value,{stream:!0});let T=U.split(`
|
|
2
|
-
`);U=T.pop()||"";for(let M of T){let L=M.trim();if(!L||!L.startsWith("data: "))continue;let pe=L.slice(6),E;try{E=JSON.parse(pe)}catch{continue}if(yield E,E.type==="done"||E.type==="error")return}}}catch(h){y.cancel(),yield ne("Stream error",h)}}return{streamChat:g}}function Qu(){return Eo(rt.aiOpenAiKey)}function mA(e){xr(rt.aiOpenAiKey,e||"")}function tx(){return kO(rt.aiOpenAiKey)}function cl(){return Eo(rt.aiBaseUrl)}function Ca(){return Eo(rt.aiProvider)==="anthropic"?"anthropic":"openai-compat"}function gA(){return Ca()==="openai-compat"?Qu():""}function nx(){return Eo(rt.aiModel)}function bA(e){xr(rt.aiModel,e||"")}function G(e){return e==="anthropic"?"anthropic":""}function vA(e){TO([[rt.aiOpenAiKey,e.apiKey],[rt.aiBaseUrl,e.baseUrl],[rt.aiModel,e.model],[rt.aiProvider,G(e.provider)]])}function yA(e){return!Dm(rt.aiOpenAiKey,e.apiKey,Qu())||!Dm(rt.aiBaseUrl,e.baseUrl,cl())||!Dm(rt.aiModel,e.model,nx())||G(e.provider)!==G(Ca())}function Dm(e,t,r){return Dx(e,t)===Dx(e,r)}function wA(){zp([rt.aiOpenAiKey,rt.aiBaseUrl,rt.aiModel,rt.aiProvider])}var Pe="claude-opus-5-5";function rC(){return{apiKey:Qu(),baseUrl:cl(),provider:Ca()}}function se(e){let t=e.provider??"openai-compat";return`${e.apiKey}\x00${e.baseUrl}\x00${t}`}var _=null,k="",q=!1,j=!1,J="",H,V="",C=null,K=["openai-compat"],W=null,re=new Set,Re=600000,R=0,ie=!1;function cs(){_=null,k="",q=!1,j=!1,J="",H=void 0,V="",C=null,K=["openai-compat"],W=null,R=0}var ve=new Set([rt.aiOpenAiKey.key,rt.aiBaseUrl.key,rt.aiProvider.key,rt.cfToken.key,rt.cfAccountId.key]);Bp((e)=>{if(e.some((t)=>ve.has(t)))cs()});function HL(e){return _&&k===se(e)?_:null}function ae(e){return _?.find((t)=>t.id===e)}function BL(e){return ae(e)?.toolSupport}function xA(e){return ae(e)?.contextWindow}function ix(e){if(e)re.add(e);W??=eh({force:!0}).catch(()=>{}).then(()=>{R=Date.now();for(let t of re)t()})}function Te(){if(!j||R===0||Date.now()-R<Re)return!1;return W=null,R=0,ix(),!0}function Ee(){if(typeof window>"u"||ie)return;ie=!0,window.addEventListener("focus",()=>{Te()})}Ee();function zb(){return tx()||sC()}function sC(){return q}function _A(){return j}function Nm(){return H}function SA(){return V}function aC(){return C}function CA(){return K}function we(){return J}function Xl(){let e=Ca()==="anthropic"?Pe:rt.aiModel.default;return nx()||we()||e}function Oe(e,t){let r;try{r=new URL(e,"http://jx.invalid")}catch{return e}return r.pathname=r.pathname.replace(/[^/]*$/,t),/^https?:/i.test(e)?r.href:`${r.pathname}${r.search}`}function ke(e){if(e===void 0)return["openai-compat"];return e.filter((t)=>["anthropic","openai-compat"].includes(t))}async function eh(e={}){let t=e.credentials??rC(),r=se(t);if(_&&k===r&&!e.force)return _;let i=p(),s=await Promise.resolve(i.aiChatUrl()),d=Oe(s,"models"),l={};if(t.apiKey)l["X-Api-Key"]=t.apiKey;if(t.baseUrl)l["X-Api-Base-URL"]=t.baseUrl;if(t.provider==="anthropic")l[F]=t.provider;let g=await fetch(d,{headers:l});if(!g.ok)throw Error(`HTTP ${g.status}`);let a=await g.json();if(q=a.configured===!0,j=a.managed===!0,J=a.defaultModel??"",H=a.code,V=a.upstreamError!==void 0?a.upstreamMessage??"":"",C=null,K=ke(a.providers),a.code==="action_required"){let c={actions:Dp(a.actions)};if(n(a.detail)&&a.detail)c.detail=a.detail;C=c}return _=(a.models||[]).map((c)=>{let b={id:c.id,name:c.name||c.id};if(Y(c.contextWindow))b.contextWindow=c.contextWindow;if(Ze(c.toolSupport))b.toolSupport=c.toolSupport;return b}),k=r,_}var I=new Set,z=null;function kA(e){if(I.size===0){z=e;return}for(let t of I)t(e)}function ce(e){I.add(e);let t=z;if(z=null,t)e(t);return()=>{I.delete(e)}}function lC(){return ye()&&Q(p().performAction)}function zL(e){let t=e.find((i)=>i.primary)??e[0];if(!t)return null;let r=e.find((i)=>i!==t);return r?{lead:t,other:r}:{lead:t}}var D=null,le=!1;function cC(e){let t=zL(e.actions);if(!lC()||!t)return Promise.resolve(!1);return D??=Ce(e,t).finally(()=>{D=null}),D}async function Am(e){let t=P(e);if(t.code!=="action-required"||!t.actions?.length)return!1;return cC({actions:t.actions,detail:e instanceof Error?e.message:void 0,heading:t.heading,retry:t.retry})}async function de(){cs(),await Hd(),WL()}function Ce(e,t){let r=e.detail??"This needs one more step first.";return new Promise((i)=>{let s="offer",d=(x)=>{if(s==="done")return;s="done",S.close(),i(x)},l=(x)=>{s="offer",S.update({cancelLabel:"Not now",confirmLabel:t.lead.label,message:x,secondaryLabel:t.other?.label??""})},g=async(x)=>{let f;try{f=await x}catch(y){if(s==="waiting")l(y instanceof Error?y.message:String(y));return}if(f?.status==="done"){await de(),d(!0);return}if(s!=="waiting"||!f||f.status==="redirect")return;Hd(),l(r)},a=(x)=>{if(s!=="offer")return;s="waiting";let f;try{f=p().performAction(x)}catch(y){l(y instanceof Error?y.message:String(y));return}S.update({cancelLabel:"Cancel",confirmLabel:"Waiting…",message:"Finish in the window that opened. This closes by itself once it is done.",secondaryLabel:""}),g(f)},{lead:c,other:b}=t,A={cancelLabel:"Not now",confirmLabel:c.label,headline:e.heading??"One more step",layer:dt("dialog"),message:r,onCancel:()=>{le=!0,d(!1)},onClosed:()=>{d(!1)},onConfirm:()=>{a(c)},region:"account/action"};if(b)A.onSecondary=()=>{a(b)},A.secondaryLabel=b.label;let S=Zs(A)})}function je(e){if(e==="reload")location.reload();else if(e==="repeat")w.info("Done. Run that again now.",{key:"account.action.retry",source:"Account"})}function EA(){return ce((e)=>{if(le||D)return;cC(e).then((t)=>{if(t)je(e.retry)})})}async function ox(e){if(!lC())return!1;let t=p().performAction(e),r;try{r=await t}catch(i){return w.error(i instanceof Error?i.message:String(i),{key:"account.action",source:"Account",tier:"toast"}),!1}if(r?.status==="done")return await de(),!0;if(r?.status!=="redirect")await Hd();return!1}function WL(){for(let e of Z()){let t={key:`account.notice.${e.id}`,source:"Account"};if(e.level==="warning")w.warn(e.message,t);else w.info(e.message,t)}}
|
|
3
|
-
export{Hd,iC,oC,dA,uA,AL,Bb,tr,ll,OL,ML,PL,Dp,FL,hA,pA,fA,jL,Qu,mA,tx,cl,Ca,gA,nx,bA,vA,yA,Dm,wA,rC,cs,HL,BL,xA,ix,zb,sC,_A,Nm,SA,aC,CA,Xl,eh,kA,lC,zL,cC,Am,EA,ox,WL};
|
|
4
|
-
|
|
5
|
-
//# debugId=89C05923FB8BBA4C64756E2164756E21
|
|
6
|
-
//# sourceMappingURL=studio-xpx91fby.js.map
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{p,ye}from"./studio-4fnb5648.js";import{jn,fv,Wt,ln,go,jx,VO,xn,Oe,Ia,Jx,St,Zx,Hi,qn,Se,pi,gI,To,Fe,Gn,Z,or,_h,Kp,Qe,Jp,fi,m,h,pn,Sr,Yp}from"./studio-knsjyx7n.js";import{w}from"./studio-sce30r7b.js";import{st,bo,Zp,nd}from"./studio-swedpd82.js";import{od,Wi}from"./studio-q9hx2qp0.js";import{MC,Ne,Uc,qc}from"./studio-n9qba0gx.js";import{pv,gh,Vp}from"./studio-hh394phe.js";import{ra,At}from"./studio-1ks5d9y4.js";import{mf,su,jv,sd,Is,Lo,Rs,Fa,bf,ac,Hv,e2,Er,oo,Ah,Bv}from"./studio-nzemfbkk.js";import{pl,Br,Ks,Js,zr}from"./studio-90zkgne5.js";import{ae}from"./studio-wqfaqw4m.js";import{to,hO,O$,xx,_x,Ts,Hp,hl,Sx,M$,u,U$}from"./studio-pwctzka3.js";import{fh,Gd,uv,mh}from"./studio-acer0g8w.js";import{rr,Vt,zi,Cr,C,Eh,nf,Th,wn}from"./studio-4f7thq0p.js";import{oe,na}from"./studio-v5wktj6f.js";import{Me,h0}from"./studio-0gvvqj3h.js";import{me,te,le}from"./studio-3qr08sxq.js";import{k0}from"./studio-abh9kfdh.js";import{n,Y,Q,_,v,Pe,Go,Jn,it,cd}from"./studio-k3we3kqb.js";import{ce}from"./studio-0939t1q1.js";var at="jx:canvas";function en(e){let{target:t,source:o,targetOrigin:r,acceptOrigin:i,token:a}=e,l=new Set,s=(c)=>{if(i!=="*"&&c.origin!==i)return;let d=c.data;if(!_(d)||!(at in d)||d[at]!==a)return;let f="payload"in d?d.payload:void 0;for(let g of l)g(f)};return o.addEventListener("message",s),{dispose(){l.clear(),o.removeEventListener("message",s)},onMessage(c){return l.add(c),()=>l.delete(c)},post(c){t.postMessage({[at]:a,payload:c},r)}}}var lt=null;function tn(){return lt}function Vb(e){if(lt){lt(e);return}window.open(e,"_blank","noopener,noreferrer")}function vr(){return bo(m.activePaneId)}function bt(e){let t=pn(e),o=t?.derived,r=o?.kind==="lens"?pn(o.sourcePaneId)?.activeTabId:t?.activeTabId;return r?m.tabs.get(r)??null:null}function jr(e){return pn(e)?.derived??null}function uC(e){if(!e)return[];let t=[];for(let o of m.panes)if(bt(o.id)?.id===e.id)t.push(bo(o.id));return t}function B(e){for(let t of Zp()){let o=t.panels.find((r)=>r.canvas===e);if(o)return{panel:o,surface:t}}return null}function nn(e){let t=e.canvas,o=t?B(t):null;return o?bt(o.surface.paneId):null}function ka(e){let t=e?.session.ui,o=t?.canvasMode??"design";return t?.preview&&(o==="edit"||o==="design")?"preview":o}function Vo(e){let t=jr(e);if(t?.kind==="lens"){let o=t.mode;return bt(e)?.session.ui?.preview&&(o==="edit"||o==="design")?"preview":o}return ka(bt(e))}function dl(e){let t=jr(e);if(t?.kind==="lens"&&t.preset==="breakpoint")return t.media;return bt(e)?.session.ui.activeMedia??null}function ct(e){return nd(e)?.paneId??fi}function pe(e){return bt(ct(e))}function Te(e,t,o,r=null,i=null,a=[]){if(!e.state)e.state={};let l={};if(i!==null)l.defaultLocale=i.defaultLocale,l.locales=i.locales;e.state.$site={name:t.name??"Jx Site",url:t.url??"",...l,...t.state};let s=(n(e.$lang)?e.$lang:void 0)??VO(o.urlPattern,i)??t.defaults?.lang,c=a.map((f)=>({code:f.locale,current:f.urlPattern===o.urlPattern,dir:fv(f.locale),label:Wt(f.locale),url:f.urlPattern})),d={params:o._pathParams??{},title:e.title??e._pageTitle??t.name??"",url:o.urlPattern};if(c.length>0)d.alternates=c;if(o.pagination){let{first:f,itemCount:g,last:y,next:x,number:S,pageCount:D,pageSize:R,pages:k,prev:F}=o.pagination;d.pagination={first:f,itemCount:g,last:y,next:x,number:S,pageCount:D,pageSize:R,pages:k.map(({current:de,number:re,url:P})=>({current:de,number:re,url:P})),prev:F}}if(s!==void 0)d.dir=fv(s),d.locale=s;if(e.state.$page=d,t.state){for(let[f,g]of Object.entries(t.state))if(f!=="$site"&&f!=="$page"&&!(f in e.state))e.state[f]=g}if(t.$media)e.$media={...t.$media,...e.$media};if(t.imports&&Object.keys(t.imports).length>0){if(!e.imports)e.imports={};for(let[f,g]of Object.entries(t.imports))if(!(f in e.imports))e.imports[f]=r&&(g.startsWith("./")||g.startsWith("../"))?r(g,o):g}if(t.$elements?.length)if(!e.$elements?.length)e.$elements=[...t.$elements];else{let f=new Set,g=[];for(let y of[...t.$elements,...e.$elements]){let x=n(y)?y:_(y)?y.$ref:void 0;if(x&&!f.has(x))f.add(x),g.push(y)}e.$elements=g}return e}var Ir=/\[\.\.\.(\w+)\]|\[(\w+)\]/g;function on(e){return e.split("\\").join("/").replace(/^\.\//,"").replace(/^\//,"").replace(/^pages\//,"")}function yr(e){let t=on(e),o=t.slice(t.lastIndexOf("/")+1),r=o.lastIndexOf(".");if(r>0)t=t.slice(0,t.length-(o.length-r));if(t.endsWith("/index"))t=t.slice(0,-6)||"/";else if(t==="index")t="/";if(!t.startsWith("/"))t=`/${t}`;let i=[],a=!1,l=!1,s=t.replaceAll(Ir,(c,d,f)=>{if(a=!0,d)return l=!0,i.push(d),"*";return i.push(f),`:${f}`});return{isCatchAll:l,isDynamic:a,params:i,urlPattern:s}}function nh(e){if(!e)return"/";return yr(e).urlPattern}function Bc(e){if(!e)return[];return yr(e).params}function ih(e,t){let o=on(e).split("/");if(!o.every((l)=>l!==""&&l[0]!=="_"))return!1;if(t===void 0)return!0;let r=o.at(-1)??"",i=r.lastIndexOf("."),a=i>0?r.slice(i).toLowerCase():"";return a!==""&&new Set(t).has(a)}function hC(e,t){if(e.isDynamic!==t.isDynamic)return e.isDynamic?1:-1;if(e.isCatchAll!==t.isCatchAll)return e.isCatchAll?1:-1;return e.urlPattern.localeCompare(t.urlPattern)}var Dr=new Set(["img","video","source","iframe","audio"]),rn="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",ut="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";function NA(e,t){e.addEventListener("error",(o)=>{let{target:r}=o;if(r instanceof HTMLImageElement&&r.getAttribute("src")!==ut)r.setAttribute("src",ut),r.removeAttribute("srcset"),r.dataset.placeholder=""},{capture:!0,signal:t})}var kr=/(src|poster|image|bg|background|icon|logo|photo|avatar|thumbnail|cover|banner)$/i;function an(e){return kr.test(e)}var Jr=/(?<![\w$.])(?:item|index|\$map)\b/u;function z(e){if(n(e))return e.includes("${")&&Jr.test(e);return Jn(e)&&n(e.$ref)&&/^(?:#\/)?\$map\//u.test(e.$ref)}function Re(e,t){if(e==="href"||e==="action")return"";if(an(e))return ut;if(n(t))return dt(t);return Jn(t)&&n(t.$ref)?fn(t.$ref):""}var Lr=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"]),_r=new Set(["div","section","article","aside","header","footer","main","nav","figure","figcaption","details","fieldset","form","ul","ol","dl","table"]);var Fr=["width","height","inlineSize","blockSize"];function Vr(e){let{style:t}=e;if(!_(t))return!1;return Fr.some((o)=>{let r=t[o],i=Y(r)?String(r):n(r)?r.trim():"";return i!==""&&i!=="auto"})}function qr(e){if(!e.tagName||e.textContent||e.innerHTML)return null;if(e.$__layout)return null;if(Array.isArray(e.children)&&e.children.length>0)return null;if(Vr(e))return null;if(Lr.has(it(e.tagName)))return"empty-text-placeholder";if(_r.has(it(e.tagName)))return"empty-container-placeholder";return null}function dt(e){return e.replaceAll(/\$\{([^}]+)\}/g,"❪ $1 ❫")}function Wr(e,t){let o=e.map;return{children:_(o)?[V(o,Kr(e.items,t))]:[],className:"repeater-perimeter",tagName:"div"}}function sn(e){return JSON.stringify(e)}function cn(e){let t=e.startsWith("#/")?e.slice(2):e,[o,...r]=t.split("/"),i=o==="state"||o==="$map"?o:null;if(i===null)return null;let a=r.map((l)=>l.replaceAll("~1","/").replaceAll("~0","~"));return i+a.map((l)=>`?.[${sn(l)}]`).join("")}function pt(e,t){if(t===null)return`(${e})`;return`((r) => ((item, index, $map) => (${e}))(r, 0, { index: 0, item: r }))(${t})`}function Kr(e,t){if(Array.isArray(e))return`${sn(e)}[0]`;if(Pe(e)){let r=cn(e.$ref);return r===null?null:`${pt(r,t)}?.[0]`}let o=n(e)?un(e):[];if(n(e)&&o.length===1&&Ur(e,o[0]))return`${pt(o[0].expr,t)}?.[0]`;return null}function Ur(e,t){return t.start===0&&t.end===e.length-1}function un(e){let t=[],o=e.indexOf("${");while(o!==-1){let r=0,i=-1;for(let a=o+1;a<e.length;a+=1)if(e[a]==="{")r+=1;else if(e[a]==="}"){if(r-=1,r===0){i=a;break}}if(i===-1)break;t.push({end:i,expr:e.slice(o+2,i),start:o}),o=e.indexOf("${",i+1)}return t}function dn(e,t=null){let o=un(e);if(o.length===0)return e;let r="",i=0;for(let{start:a,end:l,expr:s}of o)r+=e.slice(i,a),r+=`\${(() => { try { return ${pt(s,t)}; } catch { return ""; } })()}`,i=l+1;return r+e.slice(i)}function Gr(e,t){let o=e.startsWith("#/")?e.slice(2):e;if(o!=="$map"&&!o.startsWith("$map/"))return{$ref:e};let r=cn(e);return t===null||r===null?void 0:dn(`\${${r}}`,t)}function fn(e){return`{${e.startsWith("#/state/")?e.slice(8):e}}`}function ft(e,t=null){return V(e,t)}function V(e,t){if(Array.isArray(e))return e.map((s)=>V(s,t));if(!Jn(e))return e;if(e.$prototype==="Array")return Wr(e,t);let o=e,r={},i=!1,a=n(o.tagName)&&Dr.has(o.tagName);if(a){let{attributes:s,src:c}=o,d=s?.src,f=o.poster,g=s?.poster;if(!(c&&c!==""||d&&d!=="")&&!(f&&f!==""||g&&g!==""))i=!0}for(let[s,c]of Object.entries(o))if(s==="state"||s==="$media"||s==="$elements")r[s]=c;else if(s==="$props"&&Eh(c)){let d={};for(let[f,g]of Object.entries(c))if(!z(g))d[f]=g;else if(n(g))d[f]=an(f)||f==="href"||f==="action"?Re(f,g):dn(g,t);else if(Pe(g)){let y=Gr(g.$ref,t);if(y!==void 0)d[f]=y}else d[f]=g;r[s]=d}else if(s==="children")if(Array.isArray(c))r.children=c.map((d)=>V(d,t));else if(Jn(c)&&c.$prototype==="Array")r.children=[V(c,t)];else r.children=V(c,t);else if(s==="cases"&&o.$switch&&Eh(c)){let[d]=Object.entries(c);if(d){let[,f]=d;r.children=Eh(f)&&!(Jn(f)&&f.$ref)?[V(f,t)]:[{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(c).join(" | ")}]`}]}}else if(s==="attributes"&&a&&Eh(c)){let d={};for(let[f,g]of Object.entries(c))if((f==="src"||f==="poster")&&(g===""||g==null||z(g)))i=!0,d[f]=rn;else d[f]=z(g)?Re(f,g):g;r.attributes=d}else if(s==="attributes"&&Eh(c)){let d={};for(let[f,g]of Object.entries(c))d[f]=z(g)?Re(f,g):g;r.attributes=d}else if(s==="style")if(Eh(c)){let d={};for(let[f,g]of Object.entries(c))if(!z(g))d[f]=g;r.style=d}else r.style=c;else if(s==="$switch"&&n(c)&&c.includes("${"))r[s]=dt(c);else if(s==="textContent"&&n(c)&&c.includes("${"))r[s]=dt(c);else if(s==="textContent"&&Jn(c)&&c.$ref)r[s]=fn(c.$ref);else if(a&&(s==="src"||s==="poster"))if(c===""||c==null||z(c))i=!0,r[s]=rn;else r[s]=c;else if(z(c))r[s]=Re(s,c);else if(n(c)||Jn(c)&&c.$ref)r[s]=c;else r[s]=V(c,t);let l=qr(r);if(l)r.className=r.className?`${r.className} ${l}`:l;if(i){let s=n(r.className)?r.className:"";if(!s.includes("empty-media-placeholder"))r.className=s?`${s} empty-media-placeholder`:"empty-media-placeholder"}return r}function pC(e){let t=e.document?.$paths,o=e.frontmatter?.$paths;return t??o??null}var $e=new Map;function AA(){$e.clear()}function OA(e,t){if(!t)return Promise.resolve({});let o=`${e??""}::${JSON.stringify(t)}`,r=$e.get(o);if(!r)r=Zr(t).catch((i)=>($e.delete(o),console.warn("page-params: failed to enumerate $paths values:",i),{})),$e.set(o,r);return r}async function Zr(e){if(Array.isArray(e)){let t={};for(let o of e)for(let[r,i]of Object.entries(o))Ae(t,r,i);return t}if("contentType"in e&&n(e.contentType)&&e.contentType){let t=e.param??"slug",o=e.field??"id",r=await Xr(e.contentType),i={[t]:[]};if(!Array.isArray(r))return i;let a=r;for(let l of a)Ae(i,t,o==="id"?l.id:l.data?.[o]??l.id);return i}if("values"in e&&Array.isArray(e.values)){let t=e.param??"value",o={[t]:[]};for(let r of e.values)Ae(o,t,r);return o}if("$ref"in e&&n(e.$ref)&&e.$ref){let t=e.param??"id",o=e.field??"id",r=await p().readFile(e.$ref.replace(/^\.\//,"")),i=JSON.parse(r),a={[t]:[]};if(!Array.isArray(i))return a;for(let l of i)Ae(a,t,v(l)?l[o]??l.id??l:l);return a}return{}}async function Yr(){let e=await od();for(let t of e){let o=t.classes?.find((r)=>r.name==="ContentCollection");if(o)return o.path}return"@jxsuite/parser/ContentCollection.class.json"}async function Xr(e){let t={$prototype:"ContentCollection",$src:await Yr(),contentType:e},o=p();if(o.resolveClass)return o.resolveClass(t);return fetch("/__jx_resolve__",{body:JSON.stringify(t),headers:{"content-type":"application/json"},method:"POST"}).then((r)=>{if(!r.ok)throw Error(`Class resolution failed: ${r.status}`);return r.json()})}function Ae(e,t,o){if(o===null||o===void 0||o==="")return;let r=String(o);e[t]??=[];let i=e[t];if(!i.includes(r))i.push(r)}function mn(e,t,o){if(Object.keys(t).length===0)return e;let r=yn(e,t);return r.state??={},r.state.$page={params:{...t},title:n(r.title)?r.title:"",url:nh(o)},r}function gn(e){if(!e)return[];return Object.keys(e).filter((t)=>{let o=e[t];return v(o)&&n(o.$prototype)&&n(o.$src)&&JSON.stringify(o).includes('"#/$params/')})}async function hn(e,t,o){if(t.length===0)return;let r=p(),{resolveClass:i}=r;if(!i)return;let{state:a}=e;if(!a)return;await Promise.all(t.map(async(l)=>{let s=a[l];if(!v(s))return;let c={...s};if(o)c.$base=o;try{a[l]=await i.call(r,c)}catch(d){console.warn(`page-params: failed to resolve state.${l} for preview:`,d)}}))}function vn(e,t){let o=Qr(e,t);if(o!==null)return o;if(Array.isArray(e))return e.map((r)=>vn(r,t));return v(e)?yn(e,t):e}function yn(e,t){let o={};for(let[r,i]of Object.entries(e))o[r]=vn(i,t);return o}function Qr(e,t){if(!Pe(e)||!e.$ref.startsWith("#/$params/"))return null;return t[e.$ref.slice(10)]??null}function fC(e){let t=e?.tagName;return n(t)&&t.includes("-")}function ei(e){return _(e)&&!Array.isArray(e)}function bn(e){if(e===void 0)return null;if(ei(e)){if(e.$expression||e.$compute||e.$prototype||e.$handler)return null;return"default"in e||"type"in e?"signal":"literal"}return n(e)&&e.includes("${")?null:"literal"}function MA(e){let t=e?.state??{},o=[];for(let[r,i]of Object.entries(t)){if(cd(r))continue;let a=bn(i);if(!a)continue;let l=a==="signal"?i.default:i;o.push({name:r,value:l})}return o}function Cn(e,t){let o={...e.state},r=!1;for(let[i,a]of Object.entries(t)){let l=o[i],s=bn(l);if(!s)continue;o[i]=s==="signal"?{...l,default:a}:a,r=!0}if(!r)return e;return{...e,state:o}}var ti=new Set(["data","media","metadata","news","series","species"]),ni=new Set(["archive","catalog","catalogue","collection","directory","faq","gallery","inventory","library","menu","portfolio","showcase"]);function mC(e){return e.replaceAll(/[_-]+/g," ").replaceAll(/([a-z\d])([A-Z])/g,"$1 $2").trim().replaceAll(/\s+/g," ").toLowerCase()}function oh(e){let t=/[_-]|[a-z\d][A-Z]/.test(e)?mC(e):e,o=t.lastIndexOf(" "),r=t.slice(o+1);if(ni.has(r.toLowerCase()))return`${t} item`;return`${t.slice(0,o+1)}${oi(r)}`}function oi(e){if(ti.has(e.toLowerCase()))return e;if(/[^aeiou]ies$/.test(e))return`${e.slice(0,-3)}y`;if(/(?:ss|x|ch|sh|z)es$/.test(e))return e.slice(0,-2);if(/(?:us|is|ss)$/.test(e))return e;if(e.endsWith("s"))return e.slice(0,-1);return e}function Ub(e){return e.charAt(0).toUpperCase()+e.slice(1)}function qb(e){return(e.replaceAll("\\","/").split("/").pop()??e).replace(/\.[^.]+$/,"").replaceAll(/[-_]+/g," ").replaceAll(/\b\w/g,(o)=>o.toUpperCase())}var hi="pages";function mt(){return C?.projectConfig?.content??{}}function Pn(e){return e!==void 0&&/\.[\da-z]+$/i.test(e.replace(/\/+$/,""))}var ri={fileBacked:!1,item:"page",key:hi,kind:"pages",title:"Pages"};function Om(){let e=Object.entries(mt()).map(([t,o])=>({fileBacked:Pn(o.source),item:oh(t),key:t,kind:"collection",title:Ub(mC(t))}));return[ri,...e]}function UL(){return Om().map((e)=>e.key)}function ax(e){let t=mt()[e]?.source;return t!==void 0&&Pn(t)?t.replace(/^\.\//,""):null}function PA(e){return mt()[e]?.schema??null}function Ql(e){return Om().find((t)=>t.key===e)??null}function ec(e){if(!e)return null;let t=e.replaceAll("\\","/").replace(/^\.\//,"");if(ra.has(At(t)))return null;if(t.startsWith("pages/"))return ih(t)?hi:null;return Gn(t)?.name??null}function rh(e){if(!e)return!1;let t=Gn(e);if(!t||t.fileBacked)return!1;let o=At(e);return o!==".json"&&o!==".csv"}function FA(e,t){if(e===void 0||t)return{entries:!0,pages:!0,scan:!0};let o=e.map((r)=>r.replaceAll("\\","/").replace(/^\.\//,""));return{entries:o.some((r)=>{let i=ec(r);return i!==null&&i!==hi}),pages:o.some((r)=>r.startsWith("pages/")),scan:!1}}function ii(e,t,o){let r=e?.state??t?.state,i=`#/$params/${o}`;for(let a of Object.values(v(r)?r:{})){if(!v(a)||a.$prototype!=="ContentEntry")continue;let{contentType:l,id:s}=a;if(v(s)&&s.$ref===i&&n(l)&&l!=="")return l}return null}function gC(e,t){let o=pC({document:e,frontmatter:t}),r=null,i=null,a=null,l=null;if(o&&!Array.isArray(o)&&"contentType"in o){let d=o.contentType;r=n(d)&&d!==""?d:null;let f="param"in o?o.param:void 0;i=n(f)&&f!==""?f:null;let g="field"in o?o.field:void 0;a=n(g)&&g!==""&&g!=="id"?g:null}else if(o&&!Array.isArray(o)&&"values"in o){let d="param"in o?o.param:void 0,f=n(d)&&d!==""?d:null;r=f===null?null:ii(e,t,f),i=r===null?null:f;let g=o.values;l=r!==null&&Array.isArray(g)?g.flatMap((y)=>{let x=ht(y);return x===null?[]:[x]}):null}let s=e?.$layout??t?.$layout,c=n(s)||s===!1?s:void 0;return{contentType:r,field:a,layout:c,param:i,...l!==null&&{values:l}}}async function qL(e){let t={contentType:null,field:null,layout:void 0,param:null};try{let o=await p().readFile(e);if(e.endsWith(".json"))return gC(JSON.parse(o),null);let{parseSourceForPath:r}=await (ce("1sghzgcr"),import("./file-ops-1sghzgcr.js")),i=await r(e,o);return gC(i.document,i.frontmatter)}catch{return t}}var q=null,fe=null,gt=0,Ie=new Set;async function Sn(e,t){let o;try{o=await p().listDirectory(e)}catch{return}await Promise.all(o.map(async(r)=>{if(r.type==="directory")await Sn(r.path,t);else t.push(r.path)}))}async function ai(){let e=[];await Sn("pages",e);let t=e.filter((a)=>a.includes("[")&&ih(a)).toSorted(),o=await Promise.all(t.map(async(a)=>[a,await qL(a)])),{i18n:r}=ln(C?.projectConfig??{}),i=new Map;for(let[a,l]of o)if(l.contentType){let s={field:l.field,layout:l.layout,locale:jx(a,r),param:l.param,path:a,pattern:yr(a).urlPattern,...l.values&&{values:l.values}};i.set(l.contentType,[...i.get(l.contentType)??[],s])}return i}function vt(){if(q)return Promise.resolve(q);if(!ye()||!C)return Promise.resolve(new Map);if(!fe){let e=gt;fe=ai().then((t)=>{if(e===gt){q=t,fe=null;for(let o of Ie)o()}return t})}return fe}function En(e,t){if(!e||e.length===0)return null;let o=jn(t),r=ln(C?.projectConfig??{}).i18n?.defaultLocale??null;return(o===null?void 0:e.find((i)=>i.locale===o))??(r===null?void 0:e.find((i)=>i.locale===r))??e.find((i)=>i.locale===null)??e[0]}function zc(e){if(!e)return null;return go(e,ln(C?.projectConfig??{}).i18n)}function sh(e,t){if(!q){vt();return}return En(q.get(e),t)}function jA(e){if(!q){vt();return}return q.get(e)??[]}async function De(e,t){let o=await vt();return En(o.get(e),t)}function Gb(){gt+=1,q=null,fe=null}function Ap(e){return Ie.add(e),()=>{Ie.delete(e)}}function ht(e){if(n(e)&&e!=="")return e;return Y(e)&&Number.isFinite(e)?String(e):null}function bC(e,t,o){if(!e)return null;let r=t.split("/").pop()??t,i=r.lastIndexOf("."),a=i>0?r.slice(0,i):r,l=e.field===null?null:ht(o?.[e.field]),s=t.endsWith(".json")?ht(o?.id):null,c=l??s??a;if(e.values&&!e.values.includes(c))return null;if(e.param)return e.pattern.replace(`:${e.param}`,c);return e.pattern.replace(/:[A-Za-z_]\w*/,c)}function vC(e,t){if(e===!1)return null;if(n(e)&&e!=="")return e;if(t?.layout===!1)return null;if(n(t?.layout)&&t.layout!=="")return t.layout;return C?.projectConfig?.defaults?.layout??null}function HA(){Gb(),Ie.clear()}function si(e,t){let o=t.split("/"),r={};for(let[i,a]of e.split("/").entries()){let l=o[i];if(a.startsWith(":")&&l!==void 0)r[a.slice(1)]=l}return r}async function li(e){let{documentPath:t,fields:o,isEntry:r,params:i}=e;if(!r)return{_pathParams:{...i},sourcePath:t,urlPattern:nh(t)};let a=Gn(t),l=a?await De(a.name,zc(t)):null,s=bC(l,t,o);if(!l||s===null)return{_pathParams:{},sourcePath:t,urlPattern:l?.pattern??"/"};return{_pathParams:si(l.pattern,s),sourcePath:l.path,urlPattern:s}}async function Tn(e,t){if(!t)return null;let o=await li(e),r=e.fields?.title,i=n(e.title)?e.title:n(r)?r:null,a={state:{}};if(i!==null)a.title=i;if(n(e.lang))a.$lang=e.lang;let l=Te(a,t,o,null,ln(t).i18n),{$page:s,$site:c}=l.state??{};return s===void 0||c===void 0?null:{$page:s,$site:c}}var ke=new Map;function yC(){ke=new Map}function ci(e){if(!e.startsWith("#/state/"))return null;let[t]=e.slice(8).split("/");return t?t.replaceAll("~1","/").replaceAll("~0","~"):null}function yt(e){if(n(e))return e.includes("${");if(Array.isArray(e))return e.some((t)=>yt(t));return v(e)&&Object.values(e).some((t)=>yt(t))}function Mn(e,t){if(n(e.$src))return e.$src;return n(e.$prototype)&&Object.hasOwn(t,e.$prototype)?t[e.$prototype]??null:null}function xt(e,t={}){return v(e)&&n(e.$prototype)&&Mn(e,t)!==null&&!yt(e)}function Nn(e,t){return Object.entries(e.state??{}).filter(([,o])=>v(o)&&!n(o.$src)&&xt(o,t)).map(([o])=>o)}function Rn(e){let t=new Set,o=(i)=>{if(Array.isArray(i)){for(let a of i)o(a);return}if(!Jn(i))return;if(i.$prototype==="Array"&&Pe(i.items)){let a=ci(i.items.$ref);if(a)t.add(a)}o(i.map),o(i.children);for(let a of Object.values(i.cases??{}))o(a)};o(e.children);let r=e.state??{};return[...t].filter((i)=>xt(r[i]))}function ui(e,t){return console.warn(`canvas: could not resolve state.${e} before the render:`,t),null}async function On(e,t,o,r={}){let i=p(),{resolveClass:a}=i,l=e.state;if(t.length===0||!a||!l)return e;let s={...l};return await Promise.all(t.map(async(c)=>{let d=s[c];if(!xt(d,r))return;let f={...d,$src:Mn(d,r)};if(o)f.$base=o;let g=JSON.stringify(f),y=ke.get(g);if(!y)y=a.call(i,f).then((S)=>S??null,(S)=>(ke.delete(g),ui(c,S))),ke.set(g,y);let x=await y;if(x!==null)s[c]=x})),{...e,state:s}}function An(e,t=[]){if(!_(e))return null;if(Array.isArray(e.children)){let o=e.children.findIndex((r)=>_(r)&&!r.$__layout);if(o!==-1)return{offset:o,prefix:[...t,"children"]};for(let r=0;r<e.children.length;r++){let i=e.children[r];if(_(i)&&i.$__layout){let a=An(i,[...t,"children",r]);if(a)return a}}}return null}function Ct(e,t,o=[]){if(!_(e))return;if(e.$__layout={file:t,path:o},Array.isArray(e.children))for(let[r,i]of e.children.entries()){if(n(i))continue;Ct(i,t,[...o,"children",r])}if(Array.isArray(e.$elements)){for(let[r,i]of e.$elements.entries())if(!n(i))Ct(i,t,[...o,"$elements",r])}}async function $n(e,t=new Set){let o=e.replace(/^\.\//,"");if(t.has(o))return null;t.add(o);let r=await Sx(e);if(!r)return null;Ct(r,o);let i=r.$layout;if(!n(i)||!i)return r;let a=await $n(i,t);if(!a)return r;let l=M$(a,r);return delete l.$layout,l}function di(e,t){for(let o of e??[]){if(!_(o)||!n(o.$ref)||!/^\.\.?\//.test(o.$ref))continue;let r=o.$__layout;if(!v(r)||!n(r.file))continue;let i=new URL(o.$ref,`jx-project:/${r.file}`).pathname.replace(/^\//,"");o.$ref=qc(t,i)}}function In(e,t){if(e.$layout!==void 0)return e.$layout;let o=t?.doc.content.frontmatter.$layout;return n(o)||o===!1?o:void 0}async function mi(e,t,o){let r=In(e,t),i=o?Gn(o):null,a=i?await De(i.name,zc(o)):null;return vC(r,a)}async function Dn(e,t,o=null){let r={documentPath:t?.documentPath,mode:t?.doc.mode},i=o??ka(t),a=i==="preview"?structuredClone(le(e)):ft(nf(e)),l=!1,s=r.documentPath&&C?.isSiteProject&&(r.documentPath.startsWith("pages/")||r.documentPath.startsWith("./pages/")),c=!s&&Boolean(C?.isSiteProject)&&rh(r.documentPath),d=null,f=0;if((s||c)&&t?.session.ui.showLayout!==!1){let P=c?await mi(e,t,r.documentPath):hl(In(e,t));if(P){let M=await $n(P);if(M){let J=i==="preview"?structuredClone(le(e)):a,E=M$(M,J);if(a=i==="preview"?E:ft(nf(E)),l=!0,r.documentPath)di(a.$elements,r.documentPath);let O=An(E);d=O?.prefix??null,f=O?.offset??0}}}let g=C?.projectConfig;if(s&&g){if(a={...a,state:{...a.state}},a.imports)a.imports={...a.imports};Te(a,g,{urlPattern:nh(r.documentPath)})}let y=Gd(C?.projectRoot),x=r.documentPath?new URL(r.documentPath,y).href:void 0,S=uv(r.documentPath,mh());if(s&&t){let{previewParams:P}=t.session.ui;if(Object.keys(P).length>0){let M=gn(e.state??null);a=mn(a,P,r.documentPath),await hn(a,M,x)}}if((s||c)&&r.documentPath){let P=await Tn({documentPath:r.documentPath,fields:c?t?.doc.content.frontmatter??null:null,isEntry:c,lang:e.$lang,params:t?.session.ui.previewParams??{},title:e.title},C?.projectConfig);if(P)a={...a,state:{...a.state,...P}}}let D=await od(),R=O$(D),k=Nn(a,R);if(i!=="preview")k.push(...Rn(e));if(a=await On(a,[...new Set(k)],x,R),!s&&t&&fC(a)){let{previewProps:P}=t.session.ui;if(P&&Object.keys(P).length>0)a=Cn(a,P)}let F=new Set;if(i!=="preview")(function P(M,J){if(!_(M))return;if(M.$prototype==="Array"){F.add(J.join("/"));let E=M.map;if(_(E))P(E,[...J,"map"]);return}if(Array.isArray(M.children))for(let[E,O]of M.children.entries()){if(n(O))continue;P(O,[...J,"children",E])}else if(Go(M.children))P(M.children,[...J,"children"]);if(M.$switch&&M.cases)for(let[E,O]of Object.entries(M.cases))P(O,[...J,"cases",E])})(e,[]);let de=r.documentPath!=null&&(r.documentPath.startsWith("layouts/")||r.documentPath.startsWith("./layouts/")),re=xx(a.$elements);if((r.mode==="content"||l||de)&&Ne.length>0){let P=new Set(re.map((E)=>_(E)?E.$ref:E)),M=new Map(Ne.map((E)=>[E.tagName,E])),J=MC(a);if(a.tagName)J.add(it(a.tagName));for(let E of J)for(let O of M.get(E)?.uses??[])J.add(O);for(let E of J){let O=M.get(E);if(O&&O.source!=="npm"&&O.path){let rt=qc(r.documentPath??null,O.path);if(!P.has(rt))re.push({$ref:rt}),P.add(rt)}}}if(re.length>0)a.$elements=re;return a.imports=hO(a.imports,D),a.$media=to(a.$media),a.$head=_x(a.$head),{assets:S,docBase:x,mapperCtx:{arrayPaths:[...F],canvasMode:i,layoutWrapped:l,pageContentOffset:f,pageContentPrefix:d},renderDoc:a,siteStyle:C?.projectConfig?.style??null}}var gi=128,GL="fullRender",BA="mountCanvas",zA="patchBatch",Ln="prepareRender",Uo={derivedResolves:0,derivedRetargets:0,escalations:0,fullRenders:0,hostRenderPosts:0,lastEscalationReason:"",lastFullRenderMs:0,p95FullRenderMs:0,panelRenders:0,patchedOps:0,renderPreparations:0,skippedFullRenders:0,timings:{}};globalThis.__jxCanvasPerf=Uo;var kn=new Map;function _n(){try{return typeof localStorage<"u"&&Boolean(localStorage.getItem("jx-canvas-debug"))}catch{return!1}}function Hn(){return typeof performance<"u"&&Q(performance.now)?performance.now():0}function Fn(e,t){if(_n())console.debug(`[jx-canvas] ${e}`,t??"")}function lx(e){Uo.escalations+=1,Uo.lastEscalationReason=e,Fn("escalation",e)}function vi(e){if(e.length===0)return 0;let t=e.toSorted((r,i)=>r-i),o=Math.min(t.length-1,Math.ceil(t.length*0.95)-1);return t[Math.max(0,o)]??0}function yi(e,t){let o=Number.isFinite(t)&&t>0?t:0,r=kn.get(e);if(!r)r=[],kn.set(e,r);if(r.push(o),r.length>gi)r.shift();let i=Uo.timings[e],a={count:(i?.count??0)+1,lastMs:o,maxMs:Math.max(i?.maxMs??0,o),p95Ms:vi(r),totalMs:(i?.totalMs??0)+o};if(Uo.timings[e]=a,e===GL)Uo.lastFullRenderMs=a.lastMs,Uo.p95FullRenderMs=a.p95Ms;Fn(`span:${e}`,`${o.toFixed(2)}ms`)}function Vn(e){let t=Hn(),o=_n(),r=`jx-${e}-start`;if(o)try{performance.mark(r)}catch{}let i=!1;return()=>{if(i)return Uo.timings[e]?.lastMs??0;i=!0;let a=Hn()-t;if(o)try{performance.measure(`jx-${e}`,r),performance.clearMarks(r)}catch{}return yi(e,a),a}}function wC(e,t){let o=Vn(e);try{return t()}finally{o()}}async function xC(e,t){let o=Vn(e);try{return await t()}finally{o()}}function ji(e){if(e==="--")return"Base";return e.replace(/^--/,"").replaceAll("-"," ").replaceAll(/\b\w/g,(t)=>t.toUpperCase())||e}var Wn=new Set(["script","style","link","iframe","object","embed"]);function ah(e){let t={tagName:e};if(/^h[1-6]$/.test(e))t.textContent="Heading";else if(e==="p")t.textContent="Paragraph text";else if(e==="span"||e==="strong"||e==="em"||e==="small"||e==="mark"||e==="code"||e==="abbr"||e==="q"||e==="sub"||e==="sup"||e==="time")t.textContent="Text";else if(e==="a")t.textContent="Link",t.attributes={href:"#"};else if(e==="button")t.textContent="Button";else if(e==="label")t.textContent="Label";else if(e==="legend")t.textContent="Legend";else if(e==="caption")t.textContent="Caption";else if(e==="summary")t.textContent="Summary";else if(e==="li"||e==="dt"||e==="dd"||e==="th"||e==="td"||e==="option")t.textContent="Item";else if(e==="blockquote")t.textContent="Quote";else if(e==="pre")t.textContent="Preformatted text";else if(e==="input")t.attributes={placeholder:"Enter text...",type:"text"};else if(e==="img")t.attributes={alt:"Image"};else if(e==="iframe")t.attributes={src:""};else if(e==="slot")t.children=[{tagName:"p",textContent:"Slot content"}];else if(e==="select")t.children=[{tagName:"option",textContent:"Option 1"}];else if(e==="ul"||e==="ol")t.children=[{tagName:"li",textContent:"Item"}];else if(e==="dl")t.children=[{tagName:"dt",textContent:"Term"},{tagName:"dd",textContent:"Definition"}];else if(e==="table")t.children=[{children:[{children:[{tagName:"th",textContent:"Header"}],tagName:"tr"}],tagName:"thead"},{children:[{children:[{tagName:"td",textContent:"Cell"}],tagName:"tr"}],tagName:"tbody"}];else if(e==="details")t.children=[{tagName:"summary",textContent:"Summary"},{tagName:"p",textContent:"Detail content"}];return t}function Pt(e){return _(e)&&n(e.$ref)?e.$ref:null}function Je(e){if(e.source!=="npm"||!e.package)return null;return e.modulePath?`${e.package}/${e.modulePath}`:e.package}function xi(e,t){let o=Je(e);if(o)return o;return e.path?{$ref:qc(t,e.path)}:null}function KL(e,t,o){let r=Je(t);if(r)return e.some((a)=>n(a)&&(a===r||a===t.package));if(!t.path)return!1;let i=ie(qc(o,t.path));return e.some((a)=>{let l=Pt(a);return l!==null&&ie(l)===i})}function ie(e){return e.replace(/^(?:\.\/)+/,"")}function Kb(e,t,o){let r=xi(t,o);if(!r)return[...e];let a=Je(t)&&t.modulePath?e.filter((l)=>l!==t.package):[...e];return KL(a,t,o)?a:[...a,r]}function JL(e,t,o){let r=Je(t);if(r)return e.filter((a)=>!(n(a)&&(a===r||a===t.package)));if(!t.path)return[...e];let i=ie(qc(o,t.path));return e.filter((a)=>{let l=Pt(a);return l===null||ie(l)!==i})}function WA(e,t){return e.filter((o)=>!n(o)||!(o===t||o.startsWith(`${t}/`)))}function VA(e,t){let o=ie(t);return e.filter((r)=>{let i=Pt(r);return i===null||ie(i)!==o})}var bi="Components";function Op(e,t){let o=Ci(e,t);if(o)Qe(e,[],"$elements",o)}function Ci(e,t){if(!n(t)||!t.includes("-"))return null;let o=Ne.find((a)=>a.tagName===t);if(!o)return null;let r=e.doc.document.$elements??[],i=Kb(r,o,e.documentPath??null);return i.length===r.length?null:i}function _C(e){let t=Ne.find((o)=>o.tagName===e);return t?Uc(t):null}function UA(){return Ne.map((e)=>({component:!0,description:(e.source==="npm"?e.package:e.path)??"",group:bi,label:`<${e.tagName}>`,tag:e.tagName}))}function K(e){if(!e)return[];if(Array.isArray(e.children))return e.children;return n(e.textContent)&&e.textContent.length>0?[e.textContent]:[]}function ge(e){let t=0;for(let o of e)t+=n(o)?o.length:ge(K(o));return t}function wt(e,t,o){let r=[],i=0;for(let a of e){if(i>=o)break;if(n(a)){let d=i+a.length;if(d>t){let f=a.slice(Math.max(0,t-i),Math.max(0,Math.min(o,d)-i));if(f)r.push(f)}i=d;continue}let l=K(a),s=ge(l),c=i+s;if(s===0){if(i>=t&&i<o)r.push({...a})}else if(c>t){let d=wt(l,Math.max(0,t-i),Math.min(o,c)-i);if(d.length>0)r.push(Pi(a,d))}i=c}return r}function Pi(e,t){let{children:o,textContent:r,...i}=e;if(t.length===0)return{...i,textContent:""};if(t.length===1&&n(t[0]))return{...i,textContent:t[0]};return{...i,children:t}}function Bn(e){let t=[];for(let o of e){if(n(o)){if(o.length===0)continue;let r=t.at(-1);if(n(r)){t[t.length-1]=r+o;continue}}t.push(o)}return t}function zn(e,t,o,r,i=""){return Bn([...wt(e,0,t),...i?[i]:[],...wt(o,r,ge(o))])}function Et(e){let t=Bn(e);if(t.length===0)return{textContent:""};if(t.length===1&&n(t[0]))return{textContent:t[0]};return{children:t}}function Kn(e){if(!e)return!0;if(e.textContent!=null&&e.textContent.trim()==="")return!0;let t=e.children;if(!t)return!1;if(t.length===0)return!0;let[o]=t;if(t.length===1&&n(o)&&o.trim()==="")return!0;return t.length===1&&_(o)&&o.tagName==="br"}function Tt(e){return{index:zi(e),parentPath:Vt(e)}}function Un(e,t,o,r,i={}){if(!e)return;let a=oe(e.doc.document,t);if(o){if(a&&JSON.stringify(a.children)===JSON.stringify(o))return;Z(e,(l)=>{if(a?.textContent!=null)Qe(l,t,"textContent");Qe(l,t,"children",o)},{coalesceKey:i.coalesceKey??null})}else if(r!=null){if(a&&a.textContent===r&&!a.children)return;Z(e,(l)=>{if(a?.children)Qe(l,t,"children");Qe(l,t,"textContent",r)},{coalesceKey:i.coalesceKey??null})}}function Zn(e,t,o,r){if(!e)return!1;let i=oe(e.doc.document,t);if(!i)return!1;if(`${i.$props?.[o]??""}`===r)return!1;return Z(e,(l)=>{Jp(l,t,o,r)}),!0}function Yn(e,t,o){if(!e)return null;let r=oe(e.doc.document,t),i=oe(e.doc.document,o);if(!r||!i)return null;if(na(t,o)||na(o,t))return null;let a=K(i),l=K(r),s=ge(a),c=Et([...a,...l]);return Z(e,(d)=>{if(c.children){if(i.textContent!=null)Qe(d,o,"textContent");Qe(d,o,"children",c.children)}else{if(i.children)Qe(d,o,"children");Qe(d,o,"textContent",c.textContent??"")}if(_h(d,t),Xn(d,Vt(t)),Yp(e))d.session.selection=[o]}),{offset:s,path:o}}function Xn(e,t){let o=t;while(o.length>0){let r=oe(e.doc.document,o),i=r?.children;if(!r||!Array.isArray(i)||i.length>0)return;let a=Vt(o);if(_h(e,o),!a)return;o=a}}function Qn(e,t,o,r){let{parentPath:i,index:a}=Tt(t),l=[...i,"children",a+1];if(!e)return l;let s={tagName:"p"};if(r.textContent!=null)s.textContent=r.textContent;else if(r.children)s.children=r.children;else s.textContent="";return Z(e,(c)=>{if(o.textContent!=null)Qe(c,t,"children"),Qe(c,t,"textContent",o.textContent);else if(o.children)Qe(c,t,"textContent"),Qe(c,t,"children",o.children);if(or(c,i,a+1,s),Yp(e))c.session.selection=[l]}),l}function Si(e,t,o,r){let{parentPath:i,index:a}=Tt(t),l=Kn(r),s=l?a:a+1,c=[...i,"children",s];if(!e)return c;return Z(e,(d)=>{if(l)_h(d,t);else if(r?.children)Qe(d,t,"textContent"),Qe(d,t,"children",r.children);else if(r?.textContent!=null)Qe(d,t,"children"),Qe(d,t,"textContent",r.textContent);if(or(d,i,s,o),Op(d,o.tagName),Yp(e))d.session.selection=[c]}),c}function eo(e,t,o,r){let i=o.component===!0?_C(o.tag):null;if(i)return Si(e,t,i,r);if(Kn(r)){if(!e)return t;return Z(e,(d)=>{Qe(d,t,"tagName",o.tag),Qe(d,t,"children");let f=ah(o.tag);if(f.textContent&&f.textContent!=="Paragraph text")Qe(d,t,"textContent",f.textContent);else Qe(d,t,"textContent");if(Yp(e))d.session.selection=[t]}),t}let{parentPath:a,index:l}=Tt(t),s=[...a,"children",l+1];if(!e)return s;let c=ah(o.tag);return Z(e,(d)=>{if(r?.children)Qe(d,t,"textContent"),Qe(d,t,"children",r.children);else if(r?.textContent!=null)Qe(d,t,"children"),Qe(d,t,"textContent",r.textContent);if(or(d,a,l+1,structuredClone(c)),Yp(e))d.session.selection=[s]}),s}function no(e,t,o,r,i){if(!e)return null;let a=oe(e.doc.document,t.path),l=oe(e.doc.document,o.path);if(!a||!l)return null;if(na(t.path,o.path)||na(o.path,t.path))return null;let s=Et(zn(K(a),t.offset,K(l),o.offset,i)),c=[...r,o.path].toSorted(wi);return Z(e,(d)=>{if(s.children){if(a.textContent!=null)Qe(d,t.path,"textContent");Qe(d,t.path,"children",s.children)}else{if(a.children)Qe(d,t.path,"children");Qe(d,t.path,"textContent",s.textContent??"")}for(let f of c)if(oe(d.doc.document,f))_h(d,f),Xn(d,Vt(f));if(Yp(e))d.session.selection=[t.path]}),{offset:t.offset+i.length,path:t.path}}function wi(e,t){let o=Math.min(e.length,t.length);for(let r=0;r<o;r++){let i=e[r],a=t[r];if(i===a)continue;if(Y(i)&&Y(a))return a-i;return String(a).localeCompare(String(i))}return t.length-e.length}function A(e,t=1){return{height:e.height*t,left:e.x*t,top:e.y*t,width:e.width*t}}function qA(e,t,o=1){return{x:(e.x-t.left)/o,y:(e.y-t.top)/o}}function He(e,t){if(!t){e.style.display="none";return}e.style.display="block",e.style.left=`${t.left}px`,e.style.top=`${t.top}px`,e.style.width=`${t.width}px`,e.style.height=`${t.height}px`}function ro(e=document){let t=e.createElement("div");t.className="jx-canvas-iframe-overlay",t.style.cssText="position:absolute;inset:0;pointer-events:none;overflow:hidden;z-index:2";let o=e.createElement("div");o.className="overlay-box overlay-selection",o.style.display="none";let r=e.createElement("div");r.className="overlay-label",r.style.display="none",o.append(r);let i=e.createElement("div");i.className="overlay-box overlay-hover",i.style.display="none";let a=e.createElement("div");a.className="canvas-drop-indicator",a.style.display="none";let l=e.createElement("button");l.className="insertion-helper",l.textContent="+",l.style.pointerEvents="auto",l.style.display="none";let s=e.createElement("div");s.className="canvas-replace-target",s.style.display="none";let c=e.createElement("div");c.className="overlay-presence-group";let d=e.createElement("div");return d.className="overlay-coselection-group",t.append(i,o,d,a,s,l,c),{dispose:()=>t.remove(),insertButton:l,root:t,setDropIndicator:(f,g="inside")=>Ti(a,f,g),setHover:(f)=>He(i,f),setInsertZone:(f,g="center")=>Ei(l,f,g),setReplaceTarget:(f)=>He(s,f),setSuppressed:(f)=>{t.style.display=f?"none":""},setCoSelection:(f)=>{d.replaceChildren();for(let g of f){let y=e.createElement("div");y.className="overlay-box overlay-selection overlay-coselection",He(y,g),d.append(y)}},setPresence:(f)=>{c.replaceChildren();for(let g of f){let y=e.createElement("div");y.className="overlay-box overlay-presence",y.style.cssText=`position:absolute;display:block;pointer-events:none;outline:1.5px solid ${g.color};outline-offset:1px;left:${g.placement.left}px;top:${g.placement.top}px;width:${g.placement.width}px;height:${g.placement.height}px`;let x=e.createElement("div");x.className="overlay-presence-tag",x.textContent=g.label,x.style.cssText=`position:absolute;top:-18px;left:-2px;padding:1px 5px;border-radius:3px;font:10px/1.4 sans-serif;color:#fff;white-space:nowrap;background:${g.color}`,y.append(x),c.append(y)}},setSelection:(f,g=null)=>{if(He(o,f),f&&g)r.textContent=g,r.style.display="block";else r.style.display="none"}}}function Ei(e,t,o){if(!t){e.style.display="none",e.classList.remove("visible");return}e.dataset.edge=o,e.classList.add("visible"),e.style.display="grid",e.style.left=`${t.left+t.width/2}px`,e.style.top=`${t.top+t.height/2}px`,e.style.translate="-50% -50%"}function Ti(e,t,o){if(!t){e.style.display="none";return}if(e.style.display="block",e.style.left=`${t.left}px`,e.style.width=`${t.width}px`,o==="inside"){e.className="canvas-drop-indicator inside",e.style.top=`${t.top}px`,e.style.height=`${t.height}px`;return}e.className="canvas-drop-indicator line",e.style.height="",e.style.top=`${o==="top"?t.top:t.top+t.height}px`}function Wc(e){return JSON.stringify(e)}var SC={$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 Mm=SC.$defs,Ri=new Set(["pre"]),fc=new Set(Object.entries(Mm).filter(([e,t])=>!Ri.has(e)&&(t.$inlineChildren?.length??0)>0).map(([e])=>e));var io=new Set(["em","strong","del","code","a","span","br","img","b","i","u","sub","sup","s"]);function Mt(e,t){if(!t)return io.has(e);let o=Mm[t];if(!o||!o.$inlineChildren)return!1;return o.$inlineChildren.includes(e)}function GA(e){let t=Mm[e];if(!t)return null;let o=t.$inlineActions;if(n(o))o=Mm[o]?.$inlineActions??void 0;if(!Array.isArray(o))return null;return o}var Oi=null;function cx(e,t){if(!_(e))return!1;let o=(it(e.tagName)||"div").toLowerCase();if(t){let r=(it(t.tagName)||"div").toLowerCase();return Mt(o,r)}return io.has(o)}function KA(){return Oi!==null}function Le(e){return!e||e==="base"?null:e}function dx(e){let t=e.panels;if(t.length===0)return null;if(t.length===1)return t[0];let o=dl(e.paneId);for(let r of t){if(o===null&&r.mediaName==="base")return r;if(r.mediaName===o)return r}return t[0]}function ao(){return dx(vr())}function JA(e,t){if(!e)return t;let o=t;for(let r=Vt(o);r;r=Vt(o)){let i=oe(e,o),a=oe(e,r);if(!i||!a)break;let l=(it(i.tagName)||"div").toLowerCase(),s=(it(a.tagName)||"div").toLowerCase();if(!Mt(l,s))break;o=r}return o}function ux(e){return mf(e)!==null}function Mp(e){return mf(e)}function Hr(e){if(!e)return{baseWidth:320,featureQueries:[],sizeBreakpoints:[]};let t=[],o=[],r=320;for(let[i,a]of Object.entries(e)){if(i==="--"){let c=String(a).match(/^(\d+)\s*px$/);r=c?Number(c[1]):320;continue}let l=a.match(/min-width:\s*([\d.]+)px/),s=a.match(/max-width:\s*([\d.]+)px/);if(l)o.push({name:i,query:a,type:"min",width:Number(l[1])});else if(s)o.push({name:i,query:a,type:"max",width:Number(s[1])});else t.push({name:i,query:a})}return o.sort((i,a)=>i.type==="min"?i.width-a.width:a.width-i.width),{baseWidth:r,featureQueries:t,sizeBreakpoints:o}}function Ai(e,t){let o=new Set;for(let r of e)if(r.type==="min"&&t>=r.width)o.add(r.name);else if(r.type==="max"&&t<=r.width)o.add(r.name);return o}function so(e,t){let o=Ai(e,t),r=null;for(let i of e){if(!o.has(i.name))continue;let a=Math.abs(i.width-t);if(r===null){r=i;continue}let l=Math.abs(r.width-t);if(a<l||a===l&&i.width<r.width)r=i}return r?.name??null}function YA(e,t,o=8){let r=null;for(let i of t){let a=Math.abs(i-e);if(a>o)continue;if(r===null||a<Math.abs(r-e))r=i}return r??e}var Pm=240,ZA=8,XA=16,_e=new Map;function Nt(e){return Hr(to(e.doc.document.$media))}function CC(e){let{baseWidth:t,sizeBreakpoints:o}=Nt(e),r=e.session.ui.activeMedia;return o.find((i)=>i.name===r)?.width??t}function $i(e,t){let o=_e.get(e);if(!o)return null;if(!t||o.tabId!==t.id||o.media!==t.session.ui.activeMedia)return _e.delete(e),null;return o.width}function QA(e,t){let o=t?CC(t):0;return $i(e.paneId,t)??o}function kC(e){_e.delete(e)}function eO(e){let{baseWidth:t,sizeBreakpoints:o}=Nt(e);return[t,...o.map((r)=>r.width)]}function EC(e,t,o){let{sizeBreakpoints:r}=Nt(t),i=so(r,o);return t.session.ui.activeMedia=i,_e.set(e,{media:i,tabId:t.id,width:o}),i}var Rt={invokerTags:Bv,popoverTags:Ah};function YL(e,t){if(!e||!t)return null;for(let o=t.length;o>=0;o-=1){let r=t.slice(0,o),i=oe(e,r);if(_(i)&&Fa(i,Rt))return r}return null}function lo(e,t){let o=e.doc.document;if(!o)return null;if(t){let r=oe(o,t);return _(r)&&Fa(r,Rt)?t:null}return YL(o,Oe(e.session.selection))}function co(){let e=h.value?.doc.document;return e?e2(e,Rt):!1}var po=["toggle-popover","show-popover","hide-popover","show-modal","close","request-close"],Ot=new Set(["show-modal","close","request-close"]),$t=new Set(["toggle-popover","show-popover","hide-popover"]),Ii=["any","closerequest","none"],Di=new Set(po),ki=new Set(Ii),Ji=new Set(["button"]);function H(e){return Lo(e)==="dialog"}function uo(e){return e.startsWith("--")}function Li(e){let t=[];for(let{node:o}of ac(e)){let r=bf(o);if(H(o)&&r!==null&&!t.includes(r))t.push(r)}return t}function fo(e){for(let{node:t}of ac(e))if(H(t))return!0;return!1}function _i(e){let t=e.oncommand;return t!==void 0&&t!==null}function Fi(e,t){for(let{node:o}of ac(e)){if(o===e)continue;let r=Lo(o);if(r==="button"){let i=Is(o,"command"),a=Is(o,"commandfor");if(i!==null&&(i==="close"||i==="request-close")&&(a===null||a===t))return!0}if(r==="form"&&Is(o,"method")?.toLowerCase()==="dialog")return!0}return!1}function DA(e,t){let o=[...ac(e,[],null,t)],r=Li(e),i=Hv(e,t),a=r.length>0||i.length>0,l=new Map,s=new Map;for(let{node:d}of o){let f=bf(d);if(f!==null&&!l.has(f))l.set(f,d);if(Lo(d)==="button"){let g=Is(d,"commandfor"),y=Is(d,"command");if(g!==null){let x=s.get(g)??new Set;x.add(y??""),s.set(g,x)}}}let c=[];for(let{node:d,path:f}of o)if(c.push(...Vi(d,f,l,r,i,a,t)),H(d))c.push(...qi(d,f,s));return c}function Vi(e,t,o,r,i,a,l){let s=[],c=Lo(e),d=l?.invokerTags?.has(c)??!1,f=Is(e,"command"),g=Is(e,"commandfor");if(!(f!==null||g!==null||("command"in sd(e))||("commandfor"in sd(e))))return s;let x=Rs(e,"the element");if(!Ji.has(c)&&!d)return s.push({detail:"`command` and `commandfor` are attributes of `HTMLButtonElement` and of no other "+"interface — not even `<input>`, which `popovertarget` does allow. Elsewhere they parse "+`and do nothing. Make it a <button>, or remove both attributes. ${oo}`,fix:"invoker",message:`<${c||"element"}> carries command/commandfor, which only <button> supports.`,path:t,rule:"invoker-not-button",severity:"error"}),s;if(f!==null&&!Di.has(f)&&!uo(f))return s.push({detail:`\`command\` is an enumerated attribute taking ${po.map((S)=>`\`${S}\``).join(", ")}, or a custom command starting with \`--\`. Anything else is the invalid-value state, and a button in that state does nothing when clicked. ${oo}`,message:`${x} declares command="${f}", which is not a built-in or --custom command.`,path:t,rule:"command-invalid",severity:"error"}),s;if(g!==null){let S=o.get(g),D=r.includes(g),R=i.includes(g);if(!S&&a){let k=[...r,...i].map((F)=>`"${F}"`).join(", ");return s.push({detail:`No element in this document has the id "${g}". The dialogs and popovers here are: ${k}. A commandfor that names nothing does nothing, silently. ${oo}`,message:`commandfor="${g}" names nothing in this document.`,path:t,rule:"command-target-missing",severity:"error"}),s}if(f!==null&&S){if(Ot.has(f)&&!H(S))s.push({detail:`\`${f}\` acts on a <dialog>, and "${g}" is ${R?"a popover":`a <${Lo(S)||"element"}>`}. The click is ignored. ${R?"Use `toggle-popover`, `show-popover` or `hide-popover` for a popover.":"Point it at a dialog, or make the target one."} ${oo}`,message:`${x} sends ${f} to "${g}", which is not a dialog.`,path:t,rule:"command-target-mismatch",severity:"error"});else if($t.has(f)&&!Fa(S,l))s.push({detail:`\`${f}\` acts on a popover, and "${g}" is ${D?"a dialog":`a <${Lo(S)||"element"}>`} that declares no \`popover\`. The click is ignored. ${D?"Use `show-modal`, `close` or `request-close` for a dialog.":"Give the target a `popover` attribute, or point the button elsewhere."} ${oo}`,message:`${x} sends ${f} to "${g}", which is not a popover.`,path:t,rule:"command-target-mismatch",severity:"error"});else if(uo(f)&&!_i(S))s.push({detail:`A custom command is a \`CommandEvent\` dispatched at its target, and "${g}" has no `+"`oncommand` handler to answer it — so the click does nothing. Add one that switches on "+`\`event#/command\`, or use a built-in command. ${oo}`,message:`${x} sends ${f} to "${g}", which handles no command.`,path:t,rule:"custom-command-unhandled",severity:"warn"})}}return s}function qi(e,t,o){let r=[],i=Rs(e,"the dialog"),a=bf(e),{style:l}=e,s=Is(e,"closedby");if(s!==null&&!ki.has(s))r.push({detail:`\`closedby\` is an enumerated attribute taking \`any\` (light dismiss and Escape), \`closerequest\` (Escape only, the default for a modal) or \`none\`. Anything else is the invalid-value default, \`auto\`, which is the same as leaving it out. ${oo}`,message:`${i} declares closedby="${s}", which is not any, closerequest or none.`,path:t,rule:"dialog-closedby-invalid",severity:"error"});if(Er(l,"display")!==null)r.push({detail:`A closed dialog is hidden by the browser's own \`dialog:not([open]) { display: none }\`. That rule is UA-origin, so any author \`display\` beats it, and the dialog is laid out on every page whether or not anyone opened it. \`display\` belongs in the \`&[open]\` rule and nowhere else. ${oo}`,fix:"display",message:`${i} sets display in its base rule.`,path:t,rule:"dialog-display",severity:"error"});let c=a===null?void 0:o.get(a),d=Is(e,"open")!==null||sd(e).open===!0||e.open===!0;if(a!==null&&!c?.has("show-modal")&&!d)r.push({detail:`No <button> in this document opens it with \`command="show-modal"\`. If it is opened from another file or from a function that calls \`showModal()\`, this is fine; otherwise there is no way for a reader to open it. ${oo}`,message:`${i} has no invoker in this document.`,path:t,rule:"dialog-no-invoker",severity:"warn"});if(c?.has("show-modal")&&s==="none"&&!Fi(e,a))r.push({detail:`A modal dialog makes everything outside it inert, so the only ways out are the ones it offers: \`closedby="none"\` turns off Escape and light dismiss, and nothing inside it closes it. A reader who opens it cannot leave. Add a <button command="close"> inside, or drop \`closedby="none"\`. ${oo}`,message:`${i} opens modally, closes on nothing, and has no close button.`,path:t,rule:"modal-without-close",severity:"error"});return r}function ZL(e,t){if(!e||!t)return null;for(let o=t.length;o>=0;o-=1){let r=t.slice(0,o),i=oe(e,r);if(_(i)&&H(i))return r}return null}function TC(e,t){let o=e.doc.document;if(!o)return null;if(t){let r=oe(o,t);return _(r)&&H(r)?t:null}return ZL(o,Oe(e.session.selection))}function mo(){let e=h.value?.doc.document;return e?fo(e):!1}function X(e){return bt(e.paneId)}function he(e){let t=jr(e.paneId);if(t?.kind==="lens")return t.zoom;return X(e)?.session.ui.zoom??1}function Fm(e=vr()){return he(e)}function je(e,t){let o=jr(e.paneId);if(o?.kind==="lens"){o.zoom=t;return}let r=X(e);if(r)r.session.ui.zoom=t}function Bi(e){return Boolean(e.canvas&&e.viewport)}function Pp(e,t,o,r=null){let a={_width:r||null,canvas:null,element:null,mediaName:e||"",ready:!1,renderScope:null,scrollContainer:null,viewport:null},l=[];if(r&&!o)l.push(`--panel-viewport-w:${r}px`);if(r)l.push(`--panel-canvas-w:${r}px`);return{item:{fullWidth:o,header:t?"shown":"hidden",key:e??"",label:t??"",mediaAttr:e,widthVars:l.join(";")},panel:a}}function tO(e,t){for(let{item:o,panel:r}of e){let i=(a)=>t.panelNode(o.key,a);r.element=i("panel"),r.viewport=i("panel-viewport"),r.canvas=i("panel-canvas")}}function nO(e,t){let o=e.find((i)=>i.item.key===t);if(!o)return;let r=nn(o.panel);if(r)r.session.ui.activeMedia=Le(o.item.mediaAttr)}function Jt(e){if(!e.panzoomWrap)return;let t=e.wrap.clientWidth,o=e.panzoomWrap.scrollWidth,r=he(e),i=t-o*r;e.panX=i>=0?i/2:16,e.panY=0}function hx(e){if(e.centerObserver)e.centerObserver.disconnect(),e.centerObserver=null;if(!e.panzoomWrap)return;e.needsCenter=!0,e.centerObserver=new ResizeObserver(()=>{if(!e.needsCenter){e.centerObserver?.disconnect(),e.centerObserver=null;return}Jt(e),Gs(e)}),e.centerObserver.observe(e.panzoomWrap),Jt(e)}function Gs(e){if(!e.panzoomWrap)return;let t=he(e);e.panzoomWrap.style.transform=`translate(${e.panX}px, ${e.panY}px) scale(${t})`,wn("overlays")}var Ht=0.25,Lt=3;function yo(e){return Math.min(Lt,Math.max(Ht,e))}function Ki(e,t,o){let r=e.wrap.querySelector('[part="edit-canvas"]'),i=e.panels[0]?.canvas;if(!r||!i)return null;let a=e.wrap.querySelector('[part="edit-column"]'),l=a?Me(a).width:0,s=t&&l>0?l/t:1,c=o;if(c===null){let d=Me(r);c=d.top+d.height/2}return{layoutY:Math.max(0,(c-Me(i).top)/s),scroller:r,zoom:s}}function lh(e=vr(),t=null){if(Vo(e.paneId)!=="edit")return;let[o]=e.panels;if(!o||!Bi(o))return;let r=o.canvas,i=r.querySelector("iframe"),a=X(e)?.session.ui.editZoom??1,l=Ki(e,o._width??null,t);if(a===1){if(o._width=null,r.style.width="",r.style.transform="",r.style.transformOrigin="",i)i.style.width="100%";o.viewport.style.height=""}else{let s=e.wrap.querySelector('[part="edit-column"]');if(!s)return;let c=Me(s).width;if(c<=0)return;let d=c/a;if(o._width=d,r.style.width=`${d}px`,r.style.transform=`scale(${a})`,r.style.transformOrigin="top left",i)i.style.width=`${d}px`,o.viewport.style.height=`${i.offsetHeight*a}px`}if(l)l.scroller.scrollTop+=l.layoutY*(a-l.zoom);wn("overlays")}function Fp(e,t=vr()){let o=X(t);if(!o)return;o.session.ui.editZoom=yo(e),lh(t)}var It=new Map,Dt=new Map;function iO(e,t=vr(),o=null){let r=X(t);if(!r)return;if(r.session.ui.editZoom=yo(e),Dt.set(t.paneId,o),It.has(t.paneId))return;It.set(t.paneId,requestAnimationFrame(()=>{It.delete(t.paneId);let i=Dt.get(t.paneId)??null;Dt.delete(t.paneId),lh(t,i)}))}function Ui(e){let t=getComputedStyle(e).getPropertyValue("--boards-inset").trim(),o=Number(t.replace(/px$/,""));return Number.isFinite(o)?o:0}function xo(e,t,o){if(!e.panzoomWrap)return;let r=e.wrap.clientWidth,i=e.wrap.clientHeight-Ui(e.panzoomWrap),a=24,l=32,s=0,{panels:c}=e;for(let de of c)s+=de._width||800;s+=a*Math.max(0,c.length-1)+l;let d=he(e),y=Me(e.panzoomWrap).height/d+l,x=r/s,S=i/y,D=t==="width"?x:Math.min(x,S),R=Math.min(o,Math.max(U,D));je(e,R);let k=s*R,F=y*R;e.panX=Math.max(0,(r-k)/2),e.panY=Math.max(0,(i-F)/2),Gs(e)}function oO({maxZoom:e=G,surface:t=vr()}={}){Ve("page",t),xo(t,"page",e)}var U=0.05,G=5;function Co(e){return Math.min(G,Math.max(U,e))}var Gi="page",_t=["width","page","none"];function Zi(e,t,o){let r=t[o];if(Yi(r))return r;if(Y(r)&&r>=U&&r<=G)return r;throw RangeError(`command "${e}" argument "${o}": expected ${_t.map((i)=>`"${i}"`).join(" | ")} or a number in [${U}, ${G}], got ${JSON.stringify(r)}`)}function Yi(e){return n(e)&&_t.includes(e)}var Po=new Map;function So(e){let t=X(e);if(!t)return null;let o=jr(e.paneId)?.kind==="lens"?`::${e.paneId}`:"";return`${t.id}::${t.documentPath??""}${o}`}function Ve(e,t){let o=So(t);if(o)Po.set(o,e)}function LC(e=vr()){let t=So(e);return(t===null?void 0:Po.get(t))??Gi}function wo(e,t=vr()){let o=e??LC(t);if(o==="none"){Gs(t);return}if(Y(o)){je(t,Co(o)),Gs(t);return}xo(t,o,1)}function XL(e,t=vr()){Ve(e,t),wo(e,t)}function jm(e,t=vr(),o=null){if(!X(t))return;let i=Co(e),a=i/he(t);if(Ve(i,t),t.panzoomWrap&&a!==1){let l=Me(t.panzoomWrap),s=Me(t.wrap),c=o?.clientX??s.left+s.width/2,d=o?.clientY??s.top+s.height/2;t.panX+=(c-l.left)*(1-a),t.panY+=(d-l.top)*(1-a),t.needsCenter=!1}je(t,i),Gs(t)}function $C(e){if(e.wrap.clientWidth<=0){Gs(e);return}wo(LC(e),e)}function rO(e=vr()){if(Ve(1,e),!e.panzoomWrap)return;je(e,1),Jt(e),Gs(e)}function Eo(e,t){let o=Me(Mo(e)??e.wrap),r=t.top+t.height/2-o.top;return o.height/2-r}function Mo(e){return dx(e)?.scrollContainer??null}function Xi(e,t,o){let r=Mo(e);if(!r){Ro(e,t);return}let i=r.scrollTop-t;if(o){r.scrollTo({behavior:"smooth",top:i});return}r.scrollTop=i}function IC(e,t=vr()){Xi(t,Eo(t,e),!1)}function No(e,t=vr()){let o=Me(t.wrap);if(e.top>=o.top&&e.top+e.height<=o.top+o.height)return;let r=Eo(t,e),i=Math.max(t.panY,0)-t.panY,a=Math.min(r,i);if(a!==0)t.needsCenter=!1,Ro(t,a)}function Ro(e,t){let o=e.panY,r=o+t,i=performance.now(),a=250,l=(s)=>{let c=Math.min((s-i)/250,1),d=c*(2-c);if(e.panY=o+(r-o)*d,Gs(e),c<1)requestAnimationFrame(l)};requestAnimationFrame(l)}var Qi=["edit","design","preview","source","stylebook","tokens","grid","git-diff"],kt=Qi.filter((e)=>e!=="git-diff"),qe=new Set(["edit","design"]);function ea(e){return qe.has(e)}var QL=["edit","design","preview"];function ta(e){return QL.filter((t)=>e.capabilities.modes.includes(t))}function sO(e){return ta(e).filter((t)=>t!=="preview")}function e$(e){let t=e.session.ui.canvasMode;return ea(t)?t:null}function t$(e){return{available:e.capabilities.modes.includes("preview")&&qe.has(e.session.ui.canvasMode),on:e.session.ui.preview===!0}}function n$(e,t,o){if(t==="preview"){if(qe.has(e.session.ui.canvasMode))e.session.ui.preview=!0;return}if(e.session.ui.preview=!1,e.session.ui.canvasMode!==t)o(e,t)}var ho=new Set(["design","stylebook","git-diff"]),I=(e)=>e.document.open,vo=["auto","light","dark"];function oa(e){function t(l){let s=h.value;if(!s)throw RangeError(`command "${l}" needs an open document; no tab is active`);return s}function o(l,s){let{pane:c}=s;if(c===void 0)return t(l);let d=St(l,s,"pane"),f=bt(d);if(!f)throw RangeError(`command "${l}" argument "pane": "${d}" has no open document`);return f}let r={pane:Fe("Which pane to render this way. Defaults to the focused one.")};function i(l){e.renderPane(a(l))}function a(l){let{pane:s}=l;return n(s)?s:m.activePaneId}return[{args:Se({mode:pi(kt,"The canvas mode to switch the active pane to.")}),category:"View",id:"canvas.setMode",level:"document",menus:["palette"],group:"3_canvas",requires:"an open document",when:I,aiTool:{description:"Switch the active document's editor mode. edit and design put its element tree on the canvas, where the document tools work; preview renders it as a visitor sees it; source shows the JSON; stylebook, tokens and grid open other editors. Use it to return a document to edit or design when the tree tools are refused.",name:"set_canvas_mode",report:({after:l,args:s})=>{let c=qn("canvas.setMode",s,"mode",kt),d=l.editor.kind==="canvas"?"the document tools address its element tree":"the tree-editing tools are unavailable until it returns to edit or design";return`The active document is in ${c} mode; ${d}.`}},run:(l,s)=>{let c=qn("canvas.setMode",s,"mode",kt),d=t("canvas.setMode"),{modes:f}=d.capabilities;if(!f.includes(c))throw RangeError(`command "canvas.setMode" argument "mode": "${c}" is not a mode this document `+`supports — it declares: ${f.join(", ")}`);if(c==="preview"){let g=d.session.ui.canvasMode;if(!qe.has(g))throw RangeError(`command "canvas.setMode" argument "mode": "preview" composes with the edit and design base modes; this pane is in "${g}"`);d.session.ui.preview=!0;return}d.session.ui.preview=!1,e.setCanvasMode(d,c)},title:"Set Canvas Mode"},{args:Se({zoom:gI("Pan-zoom scale, 1 = 100%.",{maximum:G,minimum:U})}),category:"View",id:"canvas.setZoom",level:"document",menus:["palette"],group:"3_canvas",requires:"a document on the pan-zoom surface",when:I,enablement:()=>ho.has(e.getCanvasMode()),run:(l,s)=>{t("canvas.setZoom"),jm(Zx("canvas.setZoom",s,"zoom",U,G))},title:"Set Zoom"},{args:Se({fit:{description:'How the document is framed: "width" | "page" | "none", or a numeric pan-zoom scale.',oneOf:[{enum:[..._t],type:"string"},{maximum:G,minimum:U,type:"number"}]}}),category:"View",id:"canvas.setFit",level:"document",menus:["palette"],group:"3_canvas",requires:"a document on the pan-zoom surface",when:I,enablement:()=>ho.has(e.getCanvasMode()),run:(l,s)=>{t("canvas.setFit"),XL(Zi("canvas.setFit",s,"fit"))},title:"Set Fit"},{args:Se({zoom:gI("Edit-mode content zoom, 1 = 100%.",{maximum:Lt,minimum:Ht})}),category:"View",id:"canvas.setEditZoom",level:"document",menus:["palette"],group:"3_canvas",requires:"a document in edit mode",when:I,enablement:()=>e.getCanvasMode()==="edit",run:(l,s)=>{t("canvas.setEditZoom"),Fp(Zx("canvas.setEditZoom",s,"zoom",Ht,Lt))},title:"Set Edit Zoom"},{args:{additionalProperties:!1,properties:{...r,width:{description:"How wide the Edit column should render, in CSS pixels, or null to go back to the chosen breakpoint's own width.",type:["number","null"]}},required:["width"],type:"object"},category:"View",id:"canvas.setEditWidth",level:"document",menus:["palette"],group:"3_canvas",requires:"a document in edit mode",when:I,enablement:()=>e.getCanvasMode()==="edit",run:(l,s)=>{let c=o("canvas.setEditWidth",s),{width:d}=s;if(d===null){kC(a(s)),i(s);return}EC(a(s),c,Zx("canvas.setEditWidth",s,"width",Pm,1e4)),i(s)},title:"Set Edit Width"},{args:{additionalProperties:!1,properties:{...r,media:{description:"A breakpoint key the document renders under, or null for the base rendering.",type:["string","null"]}},required:["media"],type:"object"},category:"View",id:"canvas.setBreakpoint",level:"document",menus:["palette"],group:"3_canvas",requires:"an open document",when:I,run:(l,s)=>{let c=o("canvas.setBreakpoint",s),{media:d}=s;if(d!==null&&!n(d))throw RangeError('command "canvas.setBreakpoint" argument "media": expected a breakpoint key or null');let f=Object.keys(to(c.doc.document.$media));if(d!==null&&!f.includes(d))throw RangeError(`command "canvas.setBreakpoint" argument "media": "${d}" is not a breakpoint this `+`document defines — it defines: ${f.length>0?f.join(", "):"nothing"}`);c.session.ui.activeMedia=d,i(s)},title:"Set Breakpoint"},{args:Se({...r,scheme:pi(vo,"Which color scheme the canvas renders in.")},["scheme"]),category:"View",id:"canvas.setColorScheme",level:"document",menus:["palette"],group:"3_canvas",requires:"an open document",when:I,run:(l,s)=>{let c=o("canvas.setColorScheme",s);c.session.ui.previewColorScheme=qn("canvas.setColorScheme",s,"scheme",vo),i(s)},title:"Set Color Scheme"},{args:Se({...r,locale:Fe("BCP 47 tag this pane renders as.")},["locale"]),category:"View",id:"i18n.switchLocale",level:"document",menus:["palette"],group:"3_canvas",requires:"an open document in a project that declares more than one locale",when:(l)=>l.document.open&&l.project.isMultilingual,run:(l,s)=>{let c=o("i18n.switchLocale",s),d=St("i18n.switchLocale",s,"locale"),f=Ts();if(f===null||!f.locales.includes(d))throw RangeError(`command "i18n.switchLocale" argument "locale": "${d}" is not a locale this `+`project declares — it declares: ${f===null?"nothing":f.locales.join(", ")}`);c.session.ui.previewLocale=d,i(s)},title:"Set Rendering Language"},{args:Se({...r,visible:To("True to draw the page's layout elements, false to hide them.")},["visible"]),category:"View",id:"canvas.setLayoutVisible",level:"document",menus:["palette"],group:"3_canvas",requires:"an open document",when:I,run:(l,s)=>{let c=o("canvas.setLayoutVisible",s);c.session.ui.showLayout=Hi("canvas.setLayoutVisible",s,"visible"),i(s)},title:"Show Layout Elements"},{args:Se({...r,open:To("True to draw the popover open, false to close it."),path:{description:"Document path of the popover. Defaults to the popover the selection is in or at.",items:{type:["string","number"]},type:"array"}},[]),category:"View",enablement:()=>co(),group:"3_canvas",id:"canvas.setPopoverOpen",level:"document",menus:["palette"],requires:"a popover in the open document",run:(l,s)=>{let c=o("canvas.setPopoverOpen",s),d=s.path,f=s.open===void 0?!0:Hi("canvas.setPopoverOpen",s,"open");if(!f&&d===void 0){e.setOpenPopover(c,null);return}let g=lo(c,d);if(g===null)throw RangeError('command "canvas.setPopoverOpen" argument "path": names no popover in this document — '+"a popover is an element with a `popover` attribute, and <dialog> is not one");e.setOpenPopover(c,f?g:null)},title:"Show Popover",when:I},{args:Se({...r,open:To("True to draw the dialog open, false to close it."),path:{description:"Document path of the dialog. Defaults to the dialog the selection is in or at.",items:{type:["string","number"]},type:"array"}},[]),category:"View",enablement:()=>mo(),group:"3_canvas",id:"canvas.setDialogOpen",level:"document",menus:["palette"],requires:"a dialog in the open document",run:(l,s)=>{let c=o("canvas.setDialogOpen",s),d=s.path,f=s.open===void 0?!0:Hi("canvas.setDialogOpen",s,"open");if(!f&&d===void 0){e.setOpenDialog(c,null);return}let g=TC(c,d);if(g===null)throw RangeError('command "canvas.setDialogOpen" argument "path": names no dialog in this document — '+"a dialog is a <dialog> element, and a popover is not one");e.setOpenDialog(c,f?g:null)},title:"Show Dialog",when:I},{args:{additionalProperties:!1,properties:{...r,open:{default:!0,description:"True to open the resolving-with popover, false to close it.",type:"boolean"}},required:[],type:"object"},category:"View",id:"canvas.setResolvingOpen",level:"document",menus:["palette"],group:"3_canvas",requires:"an open document",when:I,run:(l,s)=>{o("canvas.setResolvingOpen",s);let{open:c,pane:d}=s;e.setResolvingOpen(n(d)?d:m.activePaneId,c===void 0||Hi("canvas.setResolvingOpen",s,"open"))},title:"Show Resolving Values"},{args:{additionalProperties:!1,properties:{...r,name:Fe("The prop's name, as the component's state declares it."),value:{description:"The test value — any JSON. Null clears it and the prop returns to its default.",type:["string","number","boolean","array","object","null"]}},required:["name"],type:"object"},category:"View",id:"canvas.setTestProp",level:"document",menus:["palette"],group:"3_canvas",requires:"an open component document",when:I,run:(l,s)=>{let c=o("canvas.setTestProp",s),d=St("canvas.setTestProp",s,"name"),f=Object.keys(c.doc.document.state??{});if(!f.includes(d))throw RangeError(`command "canvas.setTestProp" argument "name": "${d}" is not a prop this component `+`declares — it declares: ${f.length>0?f.join(", "):"nothing"}`);let{value:g}=s,y={...c.session.ui.previewProps};if(g===null||g===void 0)delete y[d];else y[d]=g;c.session.ui.previewProps=Object.keys(y).length>0?y:null,i(s)},title:"Set Test Value"},{args:{additionalProperties:!1,properties:{...r,name:Fe("The route parameter's name, without brackets."),value:Fe("The value to preview the route with. Empty clears it.")},required:["name","value"],type:"object"},category:"View",id:"canvas.setRouteParam",level:"document",menus:["palette"],group:"3_canvas",requires:"an open page with a dynamic route",when:I,run:(l,s)=>{let c=o("canvas.setRouteParam",s),d=St("canvas.setRouteParam",s,"name"),f=Bc(c.documentPath);if(!f.includes(d))throw RangeError(`command "canvas.setRouteParam" argument "name": "${d}" is not a parameter of this `+`route — it has: ${f.length>0?f.join(", "):"none"}`);c.session.ui.previewParams={...c.session.ui.previewParams,[d]:St("canvas.setRouteParam",s,"value")},i(s)},title:"Set Route Parameter"}]}function aO(e,t){e.registerAll(oa(t))}function px(e=vr()){let t=dl(e.paneId),o=e.panels;for(let r of o){let i=r.element?.querySelector('[part="panel-header"]');if(i){let a=t===null&&r.mediaName==="base"||t===r.mediaName;i.toggleAttribute("data-active",a)}}}var L=null;function ia(e){if(L?.isConnected)return L;let t=e.createElement("div");return t.className="jx-drag-ghost",t.style.cssText="position:fixed;left:0;top:0;z-index:9999;pointer-events:none;display:none;padding:2px 8px;border-radius:4px;font-size:12px;line-height:1.4;white-space:nowrap;background:var(--accent,#3b82f6);color:var(--accent-fg,#fff);box-shadow:0 2px 8px rgba(0,0,0,0.25);transform:translate(8px,8px)",e.body.append(t),L=t,t}function i$(e,t,o,r=document){let i=ia(r);i.textContent=e,i.style.left=`${t}px`,i.style.top=`${o}px`,i.style.display="block"}function RC(e,t){if(!L||L.style.display==="none")return;L.style.left=`${e}px`,L.style.top=`${t}px`}function ch(){if(L)L.style.display="none"}var Oo=function(){if(typeof window>"u")return null;var e=new Image;return e.src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",e}();function ul(e){var t=e.nativeSetDragImage;if(t&&Oo)t(Oo,0,0)}function Ao(e,t){if(e==null)return{};var o={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;o[r]=e[r]}return o}function $o(e,t){if(e==null)return{};var o,r,i=Ao(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)o=a[r],t.indexOf(o)===-1&&{}.propertyIsEnumerable.call(e,o)&&(i[o]=e[o])}return i}function We(e,t){var o=Object.keys(e),r=Object.keys(t);if(o.length!==r.length)return!1;return o.every(function(i){return Object.is(e[i],t[i])})}function Io(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:We,t=null;return function(o){if(t&&e(t.value,o))return t.value;return t={value:o},t.value}}var aa=["block"];function Do(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),o.push.apply(o,r)}return o}function ko(e){for(var t=1;t<arguments.length;t++){var o=arguments[t]!=null?arguments[t]:{};t%2?Do(Object(o),!0).forEach(function(r){pl(e,r,o[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):Do(Object(o)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(o,r))})}return e}function sa(e){return{x:(e.right+e.left)/2,y:(e.bottom+e.top)/2}}function jt(e){var{client:t,borderBox:o}=e,r=o.height/4;if(t.y<=o.top+r)return"reorder-above";if(t.y>=o.bottom-r)return"reorder-below";return"make-child"}function la(e){var{element:t,input:o,currentLevel:r,indentPerLevel:i,mode:a}=e,l={x:o.clientX,y:o.clientY},s=t.getBoundingClientRect();if(a==="standard"){var c=jt({borderBox:s,client:l});return{type:c,indentPerLevel:i,currentLevel:r}}var d=sa(s);if(a==="expanded"){var f=jt({borderBox:s,client:l});return{type:f==="reorder-above"?f:"make-child",indentPerLevel:i,currentLevel:r}}var g=i*r;if(l.x<s.left+g){if(l.y<d.y)return{type:"reorder-above",indentPerLevel:i,currentLevel:r};var y=(l.x-s.left)/i,x=Math.max(Math.floor(y),0);return{type:"reparent",desiredLevel:x,indentPerLevel:i,currentLevel:r}}return{type:jt({borderBox:s,client:l}),indentPerLevel:i,currentLevel:r}}function Jo(e,t){if(e.type!==t.type)return!1;if(e.type==="instruction-blocked"&&t.type==="instruction-blocked")return Jo(e.desired,t.desired);return We(e,t)}var ca=Io(Jo);function ua(e){var{desired:t,block:o}=e;if(o!==null&&o!==void 0&&o.includes(t.type)&&t.type!=="instruction-blocked"){var r={type:"instruction-blocked",desired:t};return r}return t}function fx(e,t){var o=t.block,r=$o(t,aa),i=la(r),a=ua({desired:i,block:o}),l=ca(a);return ko(ko({},e),{},pl({},Be,l))}function jp(e){var t;return(t=e[Be])!==null&&t!==void 0?t:null}var Be=Symbol("tree-item-instruction");var Ho=`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 da(e){let t=e.getAttribute("src")?.trim()??"",o=e.getAttribute("srcset")?.trim()??"";if(t!==""||o!=="")return!1;return!(e.parentElement?.localName==="picture"?e.parentElement:null)?.querySelector("source[srcset]:not([srcset=''])")}function Ft(e){if(da(e))e.setAttribute("data-jx-image-placeholder",""),e.setAttribute("src",Ho);else if(e.hasAttribute("data-jx-image-placeholder")&&e.getAttribute("src")!==Ho)e.removeAttribute("data-jx-image-placeholder")}function jo(e){return e.localName==="img"}function _o(e){if(e.nodeType!==e.ELEMENT_NODE||!("querySelectorAll"in e))return[];let t=e,o=[...t.querySelectorAll("img")];return jo(t)?[t,...o]:o}function Fo(e){for(let r of _o(e))Ft(r);let o=new(e.ownerDocument.defaultView?.MutationObserver??MutationObserver)((r)=>{for(let i of r){if(i.type==="attributes"){let{target:a}=i;if(a.nodeType===a.ELEMENT_NODE&&"localName"in a){let l=a;if(jo(l))Ft(l)}continue}for(let a of i.addedNodes)for(let l of _o(a))Ft(l)}});return o.observe(e,{attributeFilter:["src","srcset"],attributes:!0,childList:!0,subtree:!0}),()=>o.disconnect()}async function mx(e,t=new Map){su(!0);try{if(!await pa(e))return qo(e.tagName);let o=document.createElement(e.tagName);for(let i of e.props||[])if(i.default!==void 0&&i.default!=="false"&&i.default!=="''"){let a=String(i.default).replaceAll(/^'|'$/g,"");o.setAttribute(i.name,a)}let r=o;for(let[i,a]of t)r[i]=a;return Fo(o),o}catch(o){return console.warn("Component preview failed:",e.tagName,o),qo(e.tagName)}}async function pa(e){if(e.source==="npm")return Boolean(customElements.get(e.tagName));if(e.path&&!e.path.endsWith(".json"))return!1;let t=C?.projectRoot;return await jv(`${location.origin}/${t?`${t}/`:""}${e.path}`),!0}function qo(e){let t=document.createElement("div");return t.style.cssText="padding:12px;border:1px dashed var(--border);border-radius:var(--radius);color:var(--fg-dim)",t.textContent=`<${e}>`,t}var fa='[part="outline"]',qt='[part="row"]',ma='[part="verbs"]',ze=null;function lO(){if(ze!==null)cancelAnimationFrame(ze);for(let e of st.dndCleanups)e();st.dndCleanups=[],ze=requestAnimationFrame(()=>{ze=null;let e=Th?.querySelector(fa);if(!e)return;for(let o of e.querySelectorAll("[data-dnd-row]")){let r=o.dataset.value.split("/").map((c)=>/^\d+$/.test(c)?Math.trunc(Number(c)):c),i=Math.trunc(Number(o.dataset.dndDepth))||0,a=Object.hasOwn(o.dataset,"dndVoid"),l=Object.hasOwn(o.dataset,"dndExpanded"),s=Br(zr({canDrag({element:c,input:d}){if(h0(d.clientX,d.clientY)?.closest(ma))return!1;return!0},element:o,getInitialData(){return{path:r,type:"tree-node"}},onGenerateDragPreview({nativeSetDragImage:c}){ul({nativeSetDragImage:c})},onDragStart(){if(o.dataset.dragging="",st.layerDragSourceHeight=o.offsetHeight,l)ga(o,e)},onDrop(){if(delete o.dataset.dragging,l)wn("leftPanel")}}),Ks({element:o,canDrop({source:c}){let d=c.data.path;if(Array.isArray(d)&&na(d,r))return!1;return!0},getData({input:c,element:d}){return fx({path:r},{block:a?["make-child"]:[],currentLevel:i,element:d,indentPerLevel:16,input:c,mode:l?"expanded":"standard"})},onDragEnter({self:c}){Wo(o,c.data,e)},onDrag({self:c}){Wo(o,c.data,e)},onDrop(){ve(e)}}));st.dndCleanups.push(s)}let t=Js({onDrop({source:o,location:r}){ve(e);let[i]=r.current.dropTargets;if(!i)return;let a=jp(i.data);if(!a||a.type==="instruction-blocked")return;let l=o.data,s=i.data.path;if(!Array.isArray(s))return;let c=l.type==="tree-node"&&o.element,d=c&&Object.hasOwn(c.dataset,"dndExpanded");if(Jb(h.value,a,l,s),d){let f=h.value,g=Oe(f?.session.selection);if(g)st._layersCollapsed||=new Set,st._layersCollapsed.add(g.join("/"))}},onDropTargetChange({location:o}){let[r]=o.current.dropTargets;if(r&&!jp(r.data))ve(e)}});st.dndCleanups.push(t)})}function cO(){requestAnimationFrame(()=>{let e=Th?.querySelector(".components-section");if(!e)return;for(let t of e.querySelectorAll("[data-component-tag]")){let o=t.dataset.componentTag;if(!o)continue;let r=Ne.find((s)=>s.tagName===o);if(!r)continue;let i=t.querySelector(".element-card-preview");if(i&&!i.querySelector(o))mx(r).then((s)=>{i.textContent="",i.append(s)});let a=Uc(r),l=zr({element:t,getInitialData(){return{fragment:structuredClone(a),type:"block"}},onGenerateDragPreview({nativeSetDragImage:s}){ul({nativeSetDragImage:s})}});st.dndCleanups.push(l)}})}function dO(){requestAnimationFrame(()=>{let e=Th?.querySelector('[part="content"]');if(!e)return;for(let t of e.querySelectorAll("[data-block-tag]")){let o=t.dataset.blockTag,r=t.querySelector(".element-card-preview");if(r&&!r.firstChild){let l=document.createElement(Wn.has(o)?"span":o);l.textContent=o,r.append(l)}let i=ah(o),a=zr({element:t,getInitialData(){return{fragment:structuredClone(i),type:"block"}},onGenerateDragPreview({nativeSetDragImage:l}){ul({nativeSetDragImage:l})}});st.dndCleanups.push(a)}})}function ga(e,t){let o=`${e.dataset.value}/`,r=t.querySelectorAll(qt);for(let i of r)if(i.dataset.value?.startsWith(o))i.style.display="none"}function Wo(e,t,o){let r=jp(t);if(st._currentDropTargetRow&&st._currentDropTargetRow!==e)delete st._currentDropTargetRow.dataset.drop;if(!r||r.type==="instruction-blocked"){ve(o);return}if(r.type==="make-child"){ve(o),e.dataset.drop="",st._currentDropTargetRow=e;return}delete e.dataset.drop,st._currentDropTargetRow=e;let i=[...o.querySelectorAll(qt)],a=i.indexOf(e),l=st.layerDragSourceHeight;for(let[s,c]of i.entries()){if(c.dataset.dragging!==void 0)continue;if(r.type==="reorder-above")c.style.transform=s>=a?`translateY(${l}px)`:"";else c.style.transform=s>a?`translateY(${l}px)`:""}}function ve(e){if(st._currentDropTargetRow)delete st._currentDropTargetRow.dataset.drop,st._currentDropTargetRow=null;let t=e.querySelectorAll(qt);for(let o of t)o.style.transform="",o.style.display=""}function Bo(e,t,o){if(t==="make-child")return{index:rr(oe(e,o)).length,parent:o};let r=Vt(o),i=zi(o);if(!r||!Y(i))return;if(t==="reorder-above")return{index:i,parent:r};if(t==="reorder-below")return{index:i+1,parent:r};return null}function Jb(e,t,o,r){if(!e)return;if(o.type==="tree-node"){let i=o.path,a=Bo(e.doc.document,t.type,r);if(a)Z(e,(l)=>Kp(l,i,a.parent,a.index))}else if(o.type==="block"){let i=Bo(e.doc.document,t.type,r);if(i===void 0)return;let a=o.fragment;if(i)Z(e,(l)=>{or(l,i.parent,i.index,structuredClone(a)),Op(l,a.tagName),l.session.selection=[[...i.parent,"children",i.index]]})}}function zo(e){let t={};for(let[o,r]of Object.entries(e?.nesting??{}))if(o!=="_root")t[o]=r?.inline===!0;for(let o of e?.inline??[])t[o]=!1;return t}function j(e){return JSON.parse(JSON.stringify(e))}var et=new WeakMap,b=new Set,ne=0,be=new Map,lr=-1,cr=0,ha=600;function o$(e){return lr===e&&Date.now()-cr<=ha}var Ko=0,ur=new Set;function va(e,t){let o;try{o=new URL(e,t.iframe.src||fh())}catch{return}if(!["http:","https:","mailto:","tel:"].includes(o.protocol))return;let r=o.href,i=tn();if(i){i(r);return}window.open(r,"_blank","noopener,noreferrer")}function r$(e){ur.add(e)}function ya(e){return ur.delete(e)}var W=new Map,se=new Map,Ce=new Map,xa=300;function s$(e,t,o,r=xa){let i=null;for(let s of b){if(!s.iframe.isConnected){b.delete(s);continue}if(s.ready&&!s.stylebook&&e!==null&&s.tabId===e){i=s;break}}if(!i)return Promise.resolve(null);Ko+=1;let a=Ko,l=j(t);return i.channel.post({contextPath:o?[...o]:null,exprs:l,gen:i.lastRenderedGen,kind:"evalExpr",reqId:a}),new Promise((s)=>{let c=setTimeout(()=>{W.delete(a),se.delete(a),s(null)},r);se.set(a,i),W.set(a,(d)=>{clearTimeout(c),se.delete(a),s(d)})})}var Zo=0,ue=new Map,ba=250;function a$(e,t=ba){let o=[];for(let r of b){if(!r.iframe.isConnected){b.delete(r);continue}if(r.ready&&!r.stylebook&&e!==null&&r.tabId===e)o.push(r)}if(o.length===0)return Promise.resolve();return new Promise((r)=>{let i=o.length,a=setTimeout(()=>{for(let c of s)ue.delete(c),Ce.delete(c);r()},t),l=()=>{if(i-=1,i===0)clearTimeout(a),r()},s=[];for(let c of o){Zo+=1;let d=Zo;s.push(d),ue.set(d,l),Ce.set(d,c),c.channel.post({kind:"flushEdits",reqId:d})}})}function DC(e){return et.get(e)??null}function Yb(e){for(let t of b){if(!t.iframe.isConnected)continue;let o=Me(t.iframe);if(e.x>=o.left&&e.x<=o.right&&e.y>=o.top&&e.y<=o.bottom)return t}return null}function Zb(e,t,o){ne+=1,be.set(ne,o);let r=t.type==="tree-node"?{path:[...t.path],type:"tree-node"}:{type:t.type};return e.channel.post({dragSeq:ne,gen:e.lastRenderedGen,kind:"dragStart",src:r}),ne}function NC(){return ne}function tc(e){let t=Me(e.iframe),o=e.iframe.clientWidth>0?t.width/e.iframe.clientWidth:1;return{rect:t,scale:o}}function dr(e){if(e.stylebook)return"stylebook";return e.tabId??"unbound"}function l$(){let e=[];for(let t of b){if(!t.iframe.isConnected){b.delete(t);continue}let o=`canvas[${dr(t)}]`;if(!t.ready){e.push(`${o}: frame has not handshaked`);continue}let r=[...t.pendingTabIds.keys()];if(r.length>0)e.push(`${o}: gen ${r.join(", ")} unacked`);if(t.pendingPatches>0)e.push(`${o}: ${t.pendingPatches} unacked patch(es)`);if(t.pendingMeasures.size>0)e.push(`${o}: ${t.pendingMeasures.size} measure(s) in flight`);let{idle:i}=t;if(!i){e.push(`${o}: no quiescence report yet`);continue}if(i.gen!==t.lastRenderedGen)e.push(`${o}: quiescence is for gen ${i.gen}, DOM is gen ${t.lastRenderedGen}`);if(!i.fonts)e.push(`${o}: fonts still loading`);if(i.animations>0)e.push(`${o}: ${i.animations} running animation(s)`);if(i.images>0)e.push(`${o}: ${i.images} pending image retry(ies)`)}if(W.size>0)e.push(`canvas: ${W.size} expression eval(s) in flight`);return e}var Ca=500,Pa=2,Sa=40;function pr(){let e=h.value?.id??null,t=null;for(let o of b){if(!o.iframe.isConnected){b.delete(o);continue}if(!o.ready||o.stylebook)continue;if(o.tabId===e)return o;t??=o}return t}function fr(e,t){let{rect:o,scale:r}=tc(e),i=o.left+t.x*r,a=o.top+t.y*r,l=t.width*r,s=t.height*r;return{height:s,left:i,top:a,width:l,x:i+l/2,y:a+s/2}}function we(e,t){return new Promise((o)=>{e.measureSeq+=1;let r=e.measureSeq,i=setTimeout(()=>{e.pendingMeasures.delete(r),o(null)},Ca);e.pendingMeasures.set(r,(a)=>{clearTimeout(i);let[l]=a;o(l?fr(e,l.rect):null)}),e.channel.post({kind:"measure",paths:[[...t]],reqId:r})})}function c$(e){let t=DC(e),o=t?.lastHover;if(!t||!o)return null;return{settle:async()=>(await we(t,o.path))?.top??null,top:fr(t,o.rect).top}}function d$(e){let t=pr();return t?we(t,e):Promise.resolve(null)}function wa(e){return new Promise((t)=>{let o=Number.NaN,r=0,i=0,a=()=>{let{top:l}=Me(e.iframe);if(r=l===o?r+1:0,o=l,i+=1,r>=Pa||i>=Sa){t();return}requestAnimationFrame(a)};requestAnimationFrame(a)})}async function Xb(e){let t=pr();return t?QP(t,e):null}async function QP(e,t){let o=await we(e,t);if(!o)return null;let r=B(e.canvasEl)?.surface;return IC({height:o.height,top:o.top},r),await wa(e),we(e,t)}function yF(e,t){let o=DC(e);return o?we(o,t):Promise.resolve(null)}function Ea(e){let t=e.canvasEl.parentElement;if(!t)return;let o=/scale\(([\d.]+)\)/.exec(e.canvasEl.style.transform),r=o?Number(o[1]):1;t.style.height=r===1?"":`${e.iframe.offsetHeight*r}px`}function mr(e){if(e.preview){e.iframe.style.height="100%",e.iframe.style.minHeight="0px";return}if(e.contentHeight===null)return;e.iframe.style.height=`${e.contentHeight}px`,e.iframe.style.minHeight=e.contentFragment?"0px":"480px",Ea(e)}function Gt(e,t){if(e.preview=t,e.overlay.setSuppressed(t),t)e.pendingEnterEdit=null;mr(e)}function u$(e,t){Gt(Yt(e),t)}function Vc(e,t){if(!e.iframe.isConnected)return;e.channel.post(t)}function gx(e){be.delete(e)}function bx(e){e.overlay.setDropIndicator(null)}var gr=null;function h$(e){gr=e}var Ta=300,hr=null;function p$(e){hr=e}var Zt=null;function f$(e){Zt=e}function Ma(e,t,o){if((t?Na(t.tagName):!1)&&t){e.overlay.setDropIndicator(null),e.overlay.setReplaceTarget(A(t.rect));return}e.overlay.setReplaceTarget(null),e.overlay.setDropIndicator(o?A(o.referenceRect):null,o?.edge)}function Yo(e){e.overlay.setReplaceTarget(null),e.overlay.setDropIndicator(null)}function Na(e){return e==="img"||e==="video"||e==="source"}function Ra(e,t){if(e.dataset.jxGutterDrop==="1")return;e.dataset.jxGutterDrop="1",e.addEventListener("dragover",(o)=>{if(![...o.dataTransfer?.types??[]].includes("Files"))return;if(o.preventDefault(),o.dataTransfer)o.dataTransfer.dropEffect="copy"}),e.addEventListener("drop",(o)=>{let r=o.dataTransfer?.files,i=t();if(!r?.length||!i||i.stylebook)return;o.preventDefault(),Zt?.(T(i),[...r],null,null)})}var Ge=null;function m$(e){Ge=e}var Ze=null;function g$(e){Ze=e}var xr=null;function b$(e){xr=e}function Xo(e,t){let o=[...t];for(;;){let r=e.get(Wc(o));if(r)return r;if(o.length<2)return null;o=o.slice(0,-2)}}var N=null;function v$(){let e=N;return Boolean(e?.editing&&e.iframe.isConnected)}var Ye=null;function y$(e){Ye=e}var Ut=null;function w$(e){Ut=e}var Qo=null,br=null;function x$(e){br=e}function _$(e,t){for(let o of b){if(!o.iframe.isConnected){b.delete(o);continue}if(o.ready&&o.tabId===e.id&&!o.preview)o.popoverOpen=t,o.channel.post({kind:"setPopoverOpen",path:t})}}function S$(e,t){for(let o of b){if(!o.iframe.isConnected){b.delete(o);continue}if(o.ready&&o.tabId===e.id&&!o.preview)o.dialogOpen=t,o.channel.post({kind:"setDialogOpen",path:t})}}function AC(e,t){let o=0;for(let r of b){if(!r.iframe.isConnected){b.delete(r);continue}if(r.ready&&r.tabId===t){let i=B(r.canvasEl)?.surface;if(!i){lx("host-stage-unresolved");continue}let a=i.renderGeneration,l=tt?.host===r?tt.paths:void 0;nt(r),r.channel.post(l?{echoPaths:l,forwardOps:e,gen:a,kind:"patch"}:{forwardOps:e,gen:a,kind:"patch"}),r.pendingPatches+=1,o+=1}}return o}var tt=null,Oa=0;function er(e,t,o){tt={host:e,paths:t};try{o()}finally{tt=null}}var Bt=null,zt=null;function Aa(e,t,o){return!e&&t===o}function $a(e,t){let o=T(e);if(!o)return;let r=oe(o.doc.document,t);if(!r)return;AC([{key:"$props",op:"set-key",path:t,value:r.$props}],o.id)}function T(e){return e.tabId?m.tabs.get(e.tabId)??null:null}function C$(e){return T(e)}function Ke(e){let t=B(e.canvasEl)?.surface.paneId;if(t)Sr(t)}var Da=Object.freeze([]);function Ja(){let e=new Map;for(let t of m.panes){let o=t.activeTabId?m.tabs.get(t.activeTabId):null;if(!o)continue;let r=o.session.selection;r.map((i)=>i.join("/")).join("|"),e.set(o.id,r)}return e}function Ha(){if(Qo)return;let e=me(!0);e.run(()=>{te(()=>{let t=Ja();u.stylebook.selection;for(let o of b)ot(o,(o.tabId?t.get(o.tabId):null)??Da)})}),Qo={stop:()=>e.stop()}}function nt(e){if(!e.ready)return;let t=gh(),o=Vp();if(t===e.postedVersions&&o===e.postedRevisions)return;let r=e.postedVersions===null;if(e.postedVersions=t,e.postedRevisions=o,r&&Object.keys(t).length===0&&Object.keys(o).length===0)return;e.channel.post({kind:"assetVersions",revisions:o,versions:t})}var tr=!1,Kt=!1;function La(){if(tr)return;tr=!0,me(!0).run(()=>{te(()=>{if(pv.value,Kt)return;Kt=!0,queueMicrotask(()=>{Kt=!1,_a()})})})}function _a(){for(let e of b){if(!e.iframe.isConnected){b.delete(e);continue}nt(e)}}var nr=!1,Ue=null;function ja(){if(nr)return;nr=!0,me(!0).run(()=>{te(()=>{for(let t of m.panes){let o=t.activeTabId?m.tabs.get(t.activeTabId):null;if(!o)continue;let{peers:r}=xn(o);r.map((i)=>JSON.stringify(i.state.structuralSelection??null)).join("|")}if(Ue)clearTimeout(Ue);Ue=setTimeout(()=>{Ue=null;for(let t of b)Pr(t)},100)})})}function Pr(e){if(e.stylebook||!e.ready||!e.iframe.isConnected)return;let t=T(e),o=t?xn(t).peers:[];e.presenceMeta.clear();let r=[];for(let i of o){let{structuralSelection:a}=i.state;if(!a||i.state.focusedPath!==t?.documentPath)continue;for(let l of a){let s=[...l];r.push(s),e.presenceMeta.set(JSON.stringify(s),{color:i.state.user.color,label:i.state.user.name??i.state.user.login})}}if(r.length===0){e.presenceReqId=-1,e.overlay.setPresence([]);return}e.measureSeq+=1,e.presenceReqId=e.measureSeq,e.channel.post({kind:"measure",paths:r,reqId:e.presenceReqId})}function ot(e,t){if(e.stylebook){Va(e);return}let o=Oe(t);if(e.selectionPath=o,e.selectionPaths=t,!e.iframe.isConnected){b.delete(e);return}if(!o){e.selReqId=-1,e.coSelectionKeys.clear(),e.overlay.setSelection(null),e.overlay.setCoSelection([]);return}if(!e.ready)return;let r=Ia(t.slice(0,-1));e.coSelectionKeys=new Set(r.map((i)=>JSON.stringify(i))),e.measureSeq+=1,e.selReqId=e.measureSeq,e.channel.post({kind:"measure",paths:[[...o],...r],reqId:e.selReqId})}function Va(e){if(!e.iframe.isConnected){b.delete(e);return}let t=u.stylebook.selection,o=t?e.stylebook?.tagToCardPath.get(t):void 0;if(!t||!o){e.selReqId=-1,e.overlay.setSelection(null);return}if(!e.ready)return;e.measureSeq+=1,e.selReqId=e.measureSeq,e.channel.post({kind:"measure",paths:[[...o]],reqId:e.selReqId})}function ir(){return k0("../canvas.html")}function wr(e){e.channel.dispose();for(let[t,o]of W)if(se.get(t)===e)W.delete(t),se.delete(t),o(null);for(let[t,o]of ue)if(Ce.get(t)===e)ue.delete(t),Ce.delete(t),o();for(let[,t]of e.pendingMeasures)t([]);if(e.pendingMeasures.clear(),e.pendingTabIds.clear(),Ee(e),N===e)N=null;e.overlay.root.remove(),e.iframe.remove(),et.delete(e.canvasEl),b.delete(e)}function qa(){if(!ye())return ir();return p().canvasUrl||ir()}function Qb(e){let t=0;for(let o of new Set(b))if(e.contains(o.canvasEl))wr(o),t+=1;return t}function Yt(e){let t=qa(),o=et.get(e);if(o){if(o.canvasUrl===t)return o;wr(o)}let r=location.origin,i=crypto.randomUUID(),a=new URL(t,location.href).origin,l=document.createElement("iframe");l.className="jx-canvas-iframe",l.title="Canvas — live page render",l.style.cssText="width:100%;min-height:480px;height:100%;border:0;display:block;background:#fff";let s=new URL(t,location.href);if(s.searchParams.set("token",i),location.protocol==="http:"||location.protocol==="https:")s.searchParams.set("parentOrigin",r);if(l.src=a===r?`${s.pathname}${s.search}`:s.href,!e.style.position)e.style.position="relative";let c=ro(document);e.replaceChildren(l,c.root),Ra(e,()=>DC(e));let d=en({acceptOrigin:a,source:window,target:{postMessage:(g,y)=>l.contentWindow?.postMessage(g,y)},targetOrigin:a,token:i}),f={canvasEl:e,canvasUrl:t,channel:d,contentFragment:!1,contentHeight:null,hiddenPaths:new Set,popoverOpen:null,dialogOpen:null,editing:!1,editingProp:null,iframe:l,insertHideTimer:null,insertHover:!1,coSelectionKeys:new Set,insertZone:null,lastRenderedGen:-1,lastHover:null,lastSelectionRect:null,lastSnapshotSeq:0,measureSeq:0,overlay:c,panReqId:-1,pending:null,postedVersions:null,postedRevisions:null,idle:null,pendingEnterEdit:null,pendingMeasures:new Map,pendingPatches:0,pendingTabIds:new Map,presenceMeta:new Map,presenceReqId:-1,preview:!1,ready:!1,selectionPath:null,selectionPaths:[],selReqId:-1,snapshot:null,stylebook:null,tabId:null};return c.insertButton.addEventListener("click",(g)=>za(f,g)),c.insertButton.addEventListener("mouseenter",()=>{f.insertHover=!0,Ee(f)}),c.insertButton.addEventListener("mouseleave",()=>{f.insertHover=!1,Mr(f)}),d.onMessage((g)=>Ua(f,g)),et.set(e,f),b.add(f),Ha(),ja(),La(),f}function Wa(e,t){Ee(e),e.insertZone=t,e.overlay.setInsertZone(A(t.rect),t.edge)}function Tr(e){Ee(e),e.insertZone=null,e.insertHover=!1,e.overlay.setInsertZone(null)}function Ba(e){let t=e.overlay.insertButton;return e.insertHover||t.matches(":hover")}function Mr(e){Ee(e),e.insertHideTimer=setTimeout(()=>{if(e.insertHideTimer=null,Ba(e))return;Tr(e)},Ta)}function Ee(e){if(e.insertHideTimer!==null)clearTimeout(e.insertHideTimer),e.insertHideTimer=null}function za(e,t){t.stopPropagation(),t.preventDefault();let o=e.insertZone;if(!o)return;hr?.(e.overlay.insertButton,o)}var Ka=new Set(["contextMenu","dragOver","dropResult","editCommit","editCommitProp","editInput","editInsert","editMerge","editRangeReplace","editSplit","editStart","fileDragOver","fileDrop","hit","hover","insertZones","layoutHit","nativeDragEnter"]);function Ua(e,t){if(e.preview&&Ka.has(t.kind))return;switch(t.kind){case"ready":{e.ready=!0;let o=Xt?.();if(o)e.channel.post({chords:o.chords,kind:"keymap",mac:o.mac});if(e.postedVersions=null,e.postedRevisions=null,nt(e),e.pending)e.channel.post(e.pending),e.pending=null;ot(e,e.selectionPaths);return}case"paneFocus":{Ke(e),Ut?.();return}case"popoverTargetClick":{let o=T(e);if(!o||e.preview)return;let r=JSON.stringify(o.session.ui.openPopover)===JSON.stringify(t.targetPath),i=t.action==="show"||t.action==="toggle"&&!r;if(i||r)ae()?.run("canvas.setPopoverOpen",{open:i,path:t.targetPath});return}case"commandTargetClick":{let o=T(e);if(!o||e.preview)return;let r=(a)=>JSON.stringify(a)===JSON.stringify(t.targetPath),i=oe(o.doc.document,t.targetPath);if(!Jn(i))return;if($t.has(t.command)){if(!Fa(i))return;let a=t.command==="show-popover"||t.command==="toggle-popover"&&!r(o.session.ui.openPopover);if(a||r(o.session.ui.openPopover))ae()?.run("canvas.setPopoverOpen",{open:a,path:t.targetPath})}else if(Ot.has(t.command)){if(!H(i))return;let a=t.command==="show-modal";if(a||r(o.session.ui.openDialog))ae()?.run("canvas.setDialogOpen",{open:a,path:t.targetPath})}return}case"hit":{Ke(e),Ut?.(),U$(null);let o=null,r=B(e.canvasEl)?.panel;if(r?.mediaName&&!r.mediaName.startsWith("git-diff")){o=Le(r.mediaName);let a=T(e);if(a)a.session.ui.activeMedia=o}if(Ze?.dismiss(),e.stylebook){let a=Xo(e.stylebook.pathToTag,t.hit.path);if(xr?.(a,o),a){let l=A(t.hit.rect);e.overlay.setSelection(l,`<${a}>`),e.lastSelectionRect=l}else e.overlay.setSelection(null);return}e.selectionPath=t.hit.path,e.selectionPaths=[t.hit.path];let i=T(e);if(i)i.session.selection=t.additive?Jx(i.session.selection,t.hit.path):[t.hit.path];{let a=A(t.hit.rect);e.overlay.setSelection(a),e.lastSelectionRect=a}return}case"layoutHit":{if(e.stylebook)return;Ke(e),Ze?.dismiss(),U$(t.hit),e.selectionPath=null,e.selectionPaths=[];let o=T(e);if(o)o.session.selection=[];let r=A(t.hit.rect);e.overlay.setSelection(r,`LAYOUT · ${t.hit.layoutFile}`),e.lastSelectionRect=r,wn("rightPanel");return}case"hover":{if(e.stylebook){let o=t.hit?Xo(e.stylebook.pathToTag,t.hit.path):null,r=u.stylebook.selection;if(t.hit&&o&&o!==r)e.overlay.setHover(A(t.hit.rect));else e.overlay.setHover(null);return}e.lastHover=t.hit,Xa(e,t.hit);return}case"insertZones":{if(e.stylebook)return;let o=t.zones?.[0]??null;if(o)Wa(e,o);else Mr(e);return}case"geometry":{let o=e.pendingMeasures.get(t.reqId);if(o){e.pendingMeasures.delete(t.reqId),o(t.hits);return}if(t.reqId===e.presenceReqId){e.presenceReqId=-1;let r=[];for(let i of t.hits){let a=e.presenceMeta.get(JSON.stringify(i.path));if(a)r.push({...a,placement:A(i.rect)})}e.overlay.setPresence(r);return}if(t.reqId===e.panReqId){e.panReqId=-1;let[r]=t.hits;if(r){let{rect:i,scale:a}=tc(e);No({height:r.rect.height*a,top:r.rect.y*a+i.top})}return}if(t.reqId===e.selReqId){let r=JSON.stringify(e.selectionPath),i=[],a=null;if(e.stylebook){let[s]=t.hits;a=s?A(s.rect):null}else for(let s of t.hits){let c=JSON.stringify(s.path);if(c===r)a=A(s.rect);else if(e.coSelectionKeys.has(c))i.push(A(s.rect))}let l=e.stylebook?u.stylebook.selection:null;e.overlay.setSelection(a,l?`<${l}>`:null),e.overlay.setCoSelection(i),e.lastSelectionRect=a,e.hiddenPaths=new Set((t.hidden??[]).map((s)=>JSON.stringify(s)))}return}case"evalResult":{let o=W.get(t.reqId);if(!o)return;W.delete(t.reqId),se.delete(t.reqId),o(t.gen===e.lastRenderedGen?t.results:null);return}case"renderComplete":{if(e.pendingTabIds.has(t.gen))e.tabId=e.pendingTabIds.get(t.gen)??null;for(let o of e.pendingTabIds.keys())if(o<=t.gen)e.pendingTabIds.delete(o);ar(e,t.gen);return}case"patchComplete":{e.pendingPatches=Math.max(0,e.pendingPatches-1),ar(e,t.gen);return}case"idle":{e.idle={animations:t.animations,fonts:t.fonts,gen:t.gen,images:t.images};return}case"renderError":{e.pendingTabIds.delete(t.gen);let o=T(e);if(o)o.session.canvas.refreshing=!1,wn("leftPanel");w.error("The page could not be rendered.",{detail:t.message,key:`canvas.render:${dr(e)}`,source:"Canvas"});return}case"dataScope":{if(t.gen!==e.lastRenderedGen)return;let o=T(e);if(o)o.session.canvas.scope=t.scope,o.session.canvas.refreshing=!1;wn("leftPanel");return}case"contentHeight":{e.contentHeight=t.height,e.contentFragment=t.fragment,mr(e);return}case"dragOver":{if(t.dragSeq!==ne)return;if(t.cursor)lr=t.dragSeq,cr=Date.now();if(t.gen!==e.lastRenderedGen)return;if(t.preview)e.overlay.setDropIndicator(A(t.preview.referenceRect),t.preview.edge);else e.overlay.setDropIndicator(null);if(t.cursor){let o=tc(e);RC(t.cursor.x*o.scale+o.rect.left,t.cursor.y*o.scale+o.rect.top)}return}case"nativeDragEnter":{if(e.stylebook)return;gr?.(e);return}case"dragEnd":{e.overlay.setDropIndicator(null),ch(),be.delete(t.dragSeq);return}case"dropResult":{if(t.dragSeq!==ne||t.gen!==e.lastRenderedGen)return;if(t.instruction&&t.targetPath){let o=be.get(t.dragSeq);if(o)Jb(T(e),{type:t.instruction},o,t.targetPath)}be.delete(t.dragSeq),e.overlay.setDropIndicator(null),ch();return}case"fileDragOver":{if(e.stylebook)return;Ma(e,t.hit,t.preview);return}case"fileDragLeave":{Yo(e);return}case"fileDrop":{if(Yo(e),e.stylebook)return;Zt?.(T(e),t.files,t.hit,t.preview);return}case"patchError":{e.pendingPatches=Math.max(0,e.pendingPatches-1);let o=B(e.canvasEl)?.surface;if(o)br?.(o.paneId);return}case"forwardKey":{Ya(t.event);return}case"forwardWheel":{Za(e,t);return}case"editStart":{if(N&&N!==e)N.editing=!1,N.editingProp=null,N.snapshot=null;if(N=e,t.prop!==void 0&&zt===Wc(t.path))xe(e,t.path,void 0,t.prop);zt=null,Oa+=1,e.editing=!0,e.editingProp=t.prop??null,e.snapshot=null,e.lastSnapshotSeq=0,Ye?.();return}case"selectionChanged":{if(t.seq<=e.lastSnapshotSeq)return;if(e.lastSnapshotSeq=t.seq,e.snapshot=t,!e.editing)e.editing=!0,N=e;Ye?.();return}case"flushComplete":{let o=ue.get(t.reqId);if(o)ue.delete(t.reqId),Ce.delete(t.reqId),o();return}case"editInput":{let o=T(e);if(o)o.doc.dirty=!0;return}case"editCommit":{let o=()=>Un(T(e),t.path,t.children,t.textContent);if(t.inPlace)er(e,[t.path],o);else o();return}case"editCommitProp":{let o=()=>Zn(T(e),t.path,t.prop,t.value);if(t.inPlace){er(e,[t.path],o),Bt=Wc(t.path);return}let r=o();if(Aa(r,Bt,Wc(t.path)))$a(e,t.path);Bt=null,zt=r?Wc(t.path):null;return}case"editMerge":{let o=Yn(T(e),t.fromPath,t.intoPath);if(o)xe(e,o.path,o.offset);return}case"editRangeReplace":{let o=no(T(e),t.from,t.to,t.between,t.text);if(o)xe(e,o.path,o.offset);return}case"editSplit":{xe(e,Qn(T(e),t.path,t.before,t.after));return}case"editInsert":{xe(e,eo(T(e),t.path,t.cmd,t.commitData));return}case"slashShow":{let{rect:o,scale:r}=tc(e),i=t.rect.x*r+o.left,a=t.rect.y*r+o.top,l={filter:t.filter,onDismiss:()=>e.channel.post({kind:"slashDismissed"}),onSelect:(s)=>e.channel.post({cmd:{...s},kind:"slashSelect"}),rect:{bottom:a+t.rect.height*r,height:t.rect.height*r,left:i,top:a,width:t.rect.width*r}};if(t.showFilter===!0)l.showFilter=!0;Ge?.show(l);return}case"slashNav":{Ge?.nav(t.key);return}case"slashDismiss":{Ge?.dismiss();return}case"previewNavigate":{va(t.href,e);return}case"contextMenu":{if(e.stylebook)return;Ke(e);let{rect:o,scale:r}=tc(e);Ze?.show({clientX:t.x*r+o.left,clientY:t.y*r+o.top,path:t.path?[...t.path]:null});return}case"editEnd":{if(!e.editing)return;if(e.editing=!1,e.editingProp=null,e.snapshot=null,N===e)N=null;Ye?.();break}default:break}}function ar(e,t){if(e.lastRenderedGen=t,ot(e,e.selectionPaths),Pr(e),Tr(e),ns(e),e.pendingEnterEdit&&t>=e.pendingEnterEdit.minGen){let{offset:o,path:r,prop:i}=e.pendingEnterEdit;if(e.pendingEnterEdit=null,e.tabId!==null&&e.tabId===pe(e.canvasEl)?.id)Ga(e,r,o,i)}}function xe(e,t,o,r){let i={minGen:e.lastRenderedGen,path:[...t]};if(o!==void 0)i.offset=o;if(r!==void 0)i.prop=r;e.pendingEnterEdit=i}function Ga(e,t,o,r){let i={kind:"enterEdit",path:[...t]};if(o!==void 0)i.offset=o;if(r!==void 0)i.prop=r;e.channel.post(i)}function Za(e,t){let{rect:o,scale:r}=tc(e),i=nd(e.canvasEl)?.wrap;if(!i)return;i.dispatchEvent(new WheelEvent("wheel",{bubbles:!0,cancelable:!0,clientX:o.left+t.x*r,clientY:o.top+t.y*r,ctrlKey:t.ctrlKey,deltaX:t.deltaX,deltaY:t.deltaY,metaKey:t.metaKey,shiftKey:t.shiftKey}))}function Ya(e){document.dispatchEvent(new KeyboardEvent("keydown",{altKey:e.altKey,bubbles:!0,cancelable:!0,code:e.code,ctrlKey:e.ctrlKey,key:e.key,metaKey:e.metaKey,shiftKey:e.shiftKey}))}function Xa(e,t){if(!t||Cr(t.path,e.selectionPath)){e.overlay.setHover(null);return}e.overlay.setHover(A(t.rect))}var Qa=4,ee=new Map;function es(e){let t=ee.get(e);if(t)return ee.delete(e),ee.set(e,t),t;let o=new Map;ee.set(e,o);for(let r of ee.keys()){if(ee.size<=Qa)break;ee.delete(r)}return o}function ts(e,t,o,r,i,a=null){let l=es(e),s=r?.id??null,c=l.get(t);if(c&&c.tabId===o&&c.viewTabId===s&&c.mode===a)return c.payload;let d=ya(i),f=xC(Ln,async()=>{Uo.renderPreparations+=1;let g=await Dn(t,r,a),y=j(g.renderDoc),x=j(t),S=o?m.tabs.get(o)??null:null,D=Wi(S?.doc.sourceFormat)?.studio?.elements,R=D?zo(D):void 0,k={assets:g.assets,doc:y,docBase:g.docBase??`${fh()}/`,mapperCtx:g.mapperCtx,mode:g.mapperCtx.canvasMode,shadowDoc:x,siteStyle:g.siteStyle};if(R)k.editableTags=R;if(d)k.allowAutoRequests=!0;return k});return l.set(t,{mode:a,payload:f,tabId:o,viewTabId:s}),f}async function k$(e,t,o,r,i=null,a=pe(o),l=null,s=null){let c=Yt(o);c.pendingTabIds.set(e,i),c.stylebook=null,c.iframe.style.width=r?`${r}px`:"100%";let f={...await ts(e,t,i,a,ct(o),l),colorScheme:Rr(a),gen:e,kind:"render",locale:Ar(a),popoverOpen:a?.session.ui.openPopover??null,dialogOpen:a?.session.ui.openDialog??null};if(s)f.diffMarks=s;c.popoverOpen=f.popoverOpen??null,c.dialogOpen=f.dialogOpen??null,Gt(c,f.mode==="preview"),Nr(c,f)}function Nr(e,t){if(Uo.hostRenderPosts+=1,e.ready){nt(e),e.channel.post(t);return}let o=e.pending;if(o?.kind==="render"&&o.gen>t.gen){e.pendingTabIds.delete(t.gen);return}e.pending=t}function E$(e,t,o,r){let i=Yt(o);i.pendingTabIds.set(e,null),i.stylebook={pathToTag:t.pathToTag,tagToCardPath:t.tagToCardPath},Gt(i,!1),i.pendingEnterEdit=null,i.iframe.style.width=r?`${r}px`:"100%";let a=j(t.doc),l=j(t.doc),s={assets:null,colorScheme:Rr(pe(o)),locale:Ar(pe(o)),doc:a,docBase:`${fh()}/`,gen:e,kind:"render",mapperCtx:{arrayPaths:[],canvasMode:"stylebook",layoutWrapped:!1,pageContentOffset:null,pageContentPrefix:null},mode:"stylebook",shadowDoc:l,siteStyle:null};Nr(i,s)}function Rr(e){let t=e?.session.ui.previewColorScheme;return t==="light"||t==="dark"?t:null}function T$(e,t){for(let o of b){if(!o.iframe.isConnected){b.delete(o);continue}if(t&&!t.contains(o.iframe))continue;if(o.ready)o.channel.post({kind:"setColorScheme",scheme:e})}}function Or(e){return e===null?null:{dir:fv(e),locale:e}}function Ar(e){return Or(e?Hp(e.session.ui.previewLocale,e.documentPath):null)}function L$(e,t){let o=fv(e);for(let r of b){if(!r.iframe.isConnected){b.delete(r);continue}if(t&&!t.contains(r.iframe))continue;if(r.ready)r.channel.post({dir:o,kind:"setLocale",locale:e});else if(r.pending?.kind==="render")r.pending={...r.pending,locale:Or(e)}}}function $$(e,t){let o=j(e),r=0;for(let i of b){if(!i.iframe.isConnected){b.delete(i);continue}if(i.ready)i.channel.post({base:t,doc:o,kind:"redefineElement"}),r+=1}return r}function I$(){let e=C?.projectConfig;if(!e)return;let t=j(e.style??null),o=j(e.$media??{});for(let r of b){if(!r.iframe.isConnected){b.delete(r);continue}if(r.ready&&!r.stylebook)r.channel.post({kind:"siteStyleUpdate",media:o,siteStyle:t})}}function vx(e){let t=0,o=j(e);for(let r of b){if(!r.iframe.isConnected){b.delete(r);continue}if(r.ready&&r.stylebook)r.channel.post({gen:r.lastRenderedGen,kind:"styleUpdate",style:o}),t+=1,ot(r,r.selectionPaths)}return t}var Xe=null;function $r(e,t){if(!e?.stylebook||!e.ready)return!1;let o=e.stylebook.tagToCardPath.get(t);if(!o)return!1;return e.measureSeq+=1,e.panReqId=e.measureSeq,e.channel.post({kind:"measure",paths:[[...o]],reqId:e.panReqId}),!0}function R$(e){Xe=$r(Qt(),e)?null:e}function ns(e){let t=Xe;if(t===null||!e.stylebook)return;if(u.stylebook.selection!==t){Xe=null;return}if(e===Qt()&&$r(e,t))Xe=null}function nc(){let e=N;if(!e||!e.iframe.isConnected)return{editing:!1,editingProp:null,snapshot:null};return{editing:e.editing,editingProp:e.editingProp,snapshot:e.snapshot}}var Xt=null;function D$(e,t){Xt=e,t?.(()=>sr()),sr()}function sr(){let e=Xt?.();if(!e)return;for(let t of b){if(!t.iframe.isConnected){b.delete(t);continue}if(t.ready)t.channel.post({chords:e.chords,kind:"keymap",mac:e.mac})}}function dh(e){let t=N;if(!t||!t.ready)return;t.channel.post({intent:e,kind:"applyFormat"})}function N$(){let e=N;if(!e||!e.ready)return;e.channel.post({kind:"openSlash"})}function yx(){let e=N;if(e?.editing&&e.ready&&e.iframe.isConnected)e.channel.post({kind:"endEdit"})}function Qt(){let e=ao();return e?DC(e.canvas):null}function OC(){let e=N,t=e??Qt();if(!t)return null;let{rect:o,scale:r}=tc(t);if(t.lastSelectionRect)return{height:t.lastSelectionRect.height*r,left:t.lastSelectionRect.left*r+o.left,top:t.lastSelectionRect.top*r+o.top,width:t.lastSelectionRect.width*r};let i=t===e?t.snapshot?.rect:null;if(i)return{height:i.height*r,left:i.x*r+o.left,top:i.y*r+o.top,width:i.width*r};return null}
|
|
2
|
-
export{vr,bt,jr,uC,ka,Vo,dl,DA,Vb,yr,nh,Bc,ih,hC,NA,pC,AA,OA,fC,MA,mC,oh,Ub,qb,hi,Om,UL,ax,PA,Ql,ec,rh,FA,gC,qL,zc,sh,jA,Gb,Ap,bC,vC,HA,yC,GL,BA,zA,Uo,lx,wC,xC,ji,ah,KL,Kb,JL,WA,VA,Op,_C,UA,qA,Wc,SC,Mm,GA,cx,KA,dx,JA,ux,Mp,Hr,YA,Pm,ZA,XA,CC,QA,kC,eO,EC,YL,ZL,TC,Fm,Pp,tO,nO,hx,Gs,lh,Fp,iO,oO,LC,XL,jm,$C,rO,IC,QL,sO,e$,t$,n$,aO,px,i$,RC,ch,ul,fx,jp,mx,lO,cO,dO,Jb,o$,r$,s$,a$,DC,Yb,Zb,NC,tc,l$,c$,d$,Xb,QP,yF,u$,Vc,gx,bx,h$,p$,f$,m$,g$,b$,v$,y$,w$,x$,_$,S$,AC,C$,Qb,k$,E$,T$,L$,$$,I$,vx,R$,nc,D$,dh,N$,yx,OC};
|
|
3
|
-
|
|
4
|
-
//# debugId=709CECE8E9F7C5CF64756E2164756E21
|
|
5
|
-
//# sourceMappingURL=studio-xva3hzkv.js.map
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{p,ye}from"./studio-4fnb5648.js";import{X}from"./studio-9c6cbq2c.js";import{ln,jx,$a,Bi,Gn,Z,Qd,m,Ft}from"./studio-knsjyx7n.js";import{Nv}from"./studio-q9hx2qp0.js";import{$o}from"./studio-nvcn2ykc.js";import{$s}from"./studio-hh394phe.js";import{ra,At,yf}from"./studio-1ks5d9y4.js";import{nr}from"./studio-61rg2cz5.js";import{Fd,Cs,Tp,Jl,jc}from"./studio-frc16j8v.js";import{ae}from"./studio-wqfaqw4m.js";import{yr,ih,mC,Ub,hi,ec}from"./studio-xva3hzkv.js";import{er,VN}from"./studio-hfqpfmpk.js";import{Gl,Ep}from"./studio-cqxj4fcy.js";import{Sa,Fc,PN,FN}from"./studio-qrzmfaf6.js";import{Rp}from"./studio-cfnn70h1.js";import{C}from"./studio-4f7thq0p.js";import{Ce}from"./studio-v5wktj6f.js";import{Ln,E,R}from"./studio-9dq7rwc7.js";import{me,ia,te,g}from"./studio-3qr08sxq.js";import{n,Y,Ze,_,v}from"./studio-k3we3kqb.js";import{ce}from"./studio-0939t1q1.js";var be=["title","name","label","heading"];function Sp(e,t={}){let r=(i)=>{for(let s of be){let o=i.find((a)=>a.toLowerCase()===s);if(o!==void 0)return o}return null};return r(Object.keys(e?.properties??{}))??r(Object.keys(t).filter((i)=>n(t[i])))}function j(e){if(e instanceof Date)return kb(e);if(n(e))return e;if(Y(e)||Ze(e))return String(e);if(Array.isArray(e))return e.filter((t)=>n(t)||Y(t)).map(String).join(", ");return""}function xe(e,t){return Object.fromEntries(Object.keys(e?.properties??{}).filter((r)=>(r in t)).map((r)=>[r,j(t[r])]))}var Ee=["date","published","publishedAt","pubDate","publishDate"];function wS(e,t){for(let[r,i]of Object.entries(e?.properties??{}))if(i.format==="date"||i.format==="date-time")return r;return Ee.find((r)=>(r in t))??null}function sT(e){let t=e?.properties??{};return wS(e,Object.fromEntries(Object.keys(t).map((r)=>[r,""])))}function kb(e){if(e instanceof Date)return Number.isNaN(e.getTime())?"":e.toISOString().slice(0,10);if(!n(e))return"";let t=/^(\d{4}-\d{2}-\d{2})/.exec(e.trim());if(t)return t[1];let r=new Date(e);if(e.trim()===""||Number.isNaN(r.getTime()))return"";if(!e.includes(":")){let i=String(r.getMonth()+1).padStart(2,"0"),s=String(r.getDate()).padStart(2,"0");return`${r.getFullYear()}-${i}-${s}`}return r.toISOString().slice(0,10)}function O(e){let t=e.split("/").pop()??e,r=t.lastIndexOf(".");return r>0?t.slice(0,r):t}function B(e,t){if(t.startsWith("/"))return`public${t}`;let r=e.includes("/")?e.slice(0,e.lastIndexOf("/")):"",i=[...r===""?[]:r.split("/"),...t.split("/")],s=[];for(let o of i){if(o===""||o===".")continue;if(o==="..")s.pop();else s.push(o)}return s.join("/")}var W=/^[a-z][\d+.a-z-]*:/i;function we(e,t){let r=t.trim();if(r==="")return"";return W.test(r)?r:nr(B(e,r))}function q(e){if(n(e))return e.split(",")[0]?.trim()??"";if(Array.isArray(e)){let[t]=e;return t===void 0?"":q(t)}if(v(e)){let{src:t}=e;return n(t)?t:""}return""}function U(e){if(e.format==="image")return!0;let t=e.properties?.src;if(e.type==="object"&&t?.type==="string")return!0;return e.type==="array"&&e.items!==void 0&&U(e.items)}function aT(e,t,r){for(let[i,s]of Object.entries(r?.properties??{}))if(U(s)){let o=we(e,q(t[i]));if(o!=="")return o}for(let i of Object.values(t)){if(!n(i)||W.test(i))continue;let s=i.lastIndexOf(".");if(s>0&&yf(i.slice(s)))return nr(B(e,i))}return""}function Q(e,t,r){let i=Sa(t)?.schema??null,s=Sp(i,r),o=s===null?void 0:r[s],a=Jl(r),l=wS(i,r);return{date:l===null?"":kb(r[l]),fields:xe(i,r),path:e,status:jc(i,r)?a?"Draft":"Published":"",thumb:aT(e,r,i),title:n(o)&&o.trim()!==""?o:O(e)}}async function Se(e){try{let t=await p().readFile(e);if(e.endsWith(".json")){let s=JSON.parse(t);return _(s)&&!Array.isArray(s)?s:{}}let{parseSourceForPath:r}=await (ce("1sghzgcr"),import("./file-ops-1sghzgcr.js"));return(await r(e,t)).frontmatter}catch{return{}}}var w=new Map,x=new Map,P=0,F=new Set,K=200;async function Fe(e,t){let r=t.slice(0,K),i=await Promise.all(r.map(async(o)=>Q(o,e,await Se(o)))),s=t.slice(K).map((o)=>({date:"",path:o,status:"",thumb:"",title:O(o)}));return[...i,...s]}function Cw(e,t){let r=t.join(`
|
|
2
|
-
`),i=w.get(e);if(i?.key===r)return i.entries;if(!ye())return t.map((o)=>({date:"",path:o,status:"",thumb:"",title:O(o)}));let s=`${e}
|
|
3
|
-
${r}`;if(!x.has(s)){let o=P,a=Fe(e,t).then((l)=>{if(x.get(s)===a)x.delete(s);if(o===P){w.set(e,{entries:l,key:r});for(let c of F)c()}return l});x.set(s,a)}return null}function ve(e,t,r){let i=w.get(t),s=i?.entries.findIndex((a)=>a.path===e)??-1;if(!i||s===-1)return!1;let o=i.entries.with(s,Q(e,t,r));w.set(t,{entries:o,key:i.key});for(let a of F)a();return!0}function aN(e,t){let r=ec(e);if(e===null||r===null||r===hi)return!1;return ve(e,r,t)}function lT(){P+=1,w.clear(),x.clear()}function kw(e){return F.add(e),()=>{F.delete(e)}}var Le=/^\d{4}-\d{2}-\d{2}/,f="entry",h=g(new Map);function k(e){let t=h.get(e.id);if(t===void 0)return null;if("key"in t)return t.key;return er(e)?.state.rows[t.row]?.key??null}function Te(e){return h.has(e.id)}function A(e,t){h.set(e.id,{key:t})}function Re(e){h.delete(e.id)}function y(e){return Te(e)&&er(e)!==null}function ee(e){let t=er(e),r=k(e);if(!t||r===null)return{};let i={};for(let s of t.state.columns){let o=t.buffer.effectiveValue(r,s.field);if(o===null||o==="")continue;if(s.kind==="date"&&n(o)&&!Le.test(o)){i[s.field]=kb(o)||o;continue}i[s.field]=_(o)&&!Array.isArray(o)?o.$ref:o}return i}function De(e){if(e===void 0||e===null)return null;if(Array.isArray(e))return e.map((t)=>n(t)?t:JSON.stringify(t));if(n(e)||Y(e)||Ze(e))return e;return JSON.stringify(e)}function I(e,t){let r=er(e),i=k(e);if(!r||i===null)return;let s=new Set(r.state.columns.map((o)=>o.field));r.buffer.group(()=>{for(let[o,a]of Object.entries(t))if(s.has(o))r.buffer.setCell(i,o,De(a))})}function S(e){let t=er(e),r=k(e),i=t?.state.rows??[],s=r===null?-1:i.findIndex((o)=>o.key===r);return{index:s,next:s===-1?null:i[s+1]?.key??null,previous:s<=0?null:i[s-1]?.key??null,total:i.length}}async function lN(e,t){let{openFileInTab:r}=await (ce("zrqtgt41"),import("./files-zrqtgt41.js"));await r(e);let i=m.tabs.get(e)??null;if(!i||!er(i))return i;if(!h.has(i.id))i.scope.run(()=>{ia(()=>Re(i))});if(h.set(i.id,{row:t}),!i.capabilities.modes.includes(f))i.capabilities.modes.unshift(f);return i.session.ui.canvasMode=f,i.session.ui.preview=!1,Ft(i.id),i}function re(e){return e.doc.sourceFormat==null&&e.doc.mode!=="content"}function Ul(e){if(y(e))return ee(e);return re(e)?e.doc.document:e.doc.content.frontmatter}function Ne(e,t,r){let i=e.doc.document,s=Object.hasOwn(i,t)?Ce(i[t]):void 0,o=r===void 0||r===null||r==="";if(o)delete i[t];else i[t]=r;let a=o?void 0:Ce(r);Bi({forward:{key:t,op:"set-key",path:[],value:a},inverse:{key:t,op:"set-key",path:[],value:s}}),e.doc.dirty=!0,VN()}function H(e,t,r){if(y(e))I(e,{[t]:r});else if(re(e))Ne(e,t,r);else Qd(e,t,r)}function xS(e,t){if(y(e)){I(e,t);return}Z(e,(r)=>{for(let[i,s]of Object.entries(t))H(r,i,s)})}var ne={$schema:"https://jxsuite.com/schema/v1",$id:"StudioEntryEditor",$description:"The Entry editor (site-architecture.md §7.4) — one content entry's fields, in a pane, as a Jx document over the kit. The adapter (`surfaces/entry-editor.ts`) hands in a projection; `content/entry-editor.ts` decides everything in it — which collection the file belongs to, which record its fields live in, which required keys are absent and what a draft flag commits into. The FORM is an island: a schema is `ui/schema-form.ts`'s subject, so this document renders an empty `fields` node and the flow places the element that engine hands back (studio-ui-guidelines.md §9.3, §9.4). That is the whole of the difference between this and the card the lit version drew, and it is why the engine converting in batch 7 is what unblocked this one.",tagName:"div",attributes:{part:"entry","data-jx-region":"${state.region}"},style:{$description:"What `.entry-editor`, `.entry-editor-header`, `.entry-editor-collection`, `.entry-draft-switch`, `.entry-editor-fields`, `.entry-editor-note` and `.entry-editor-empty` said in `styles/overlays.css`, keyed on `part` and re-pointed at the studio token layer. This editor was the only emitter of all seven, so those rules are dead in the stylesheet from here; a central sweep removes them rather than this change, which owns no stylesheet. Every `--spectrum-font-size-*` reference is gone rather than renamed: those names resolve only inside `<sp-theme>`, and a pane editor is mounted outside it, so each would silently have taken its hard-coded fallback.",height:"100%",padding:"var(--jx-space-5)",overflowY:"auto",background:"var(--bg-panel)",'& [part="header"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-4)",marginBottom:"var(--jx-space-5)"},'& [part="name"]':{margin:"0",fontSize:"var(--jx-text-lg)",fontWeight:"600",color:"var(--fg)"},'& [part="collection"]':{padding:"1px var(--jx-space-3)",borderRadius:"var(--radius)",background:"var(--bg)",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="draft"]':{$description:"Pushed to the far end of the header rather than placed there: the heading and the collection chip are both content-width, so `margin-left: auto` is what keeps the switch on the right edge whatever the entry is called.",marginLeft:"auto"},'& [part="fields"]':{$description:"The schema form's host is `display: contents`, so its rows are the flex items of THIS box — which is why the column lives here and not inside the engine.",display:"flex",flexDirection:"column"},'& [part="note"]':{margin:"0 0 var(--jx-space-4)",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)",lineHeight:"1.5"},'& [part="empty"]':{display:"flex",maxWidth:"46ch",flexDirection:"column",alignItems:"flex-start",gap:"var(--jx-space-3)",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)",lineHeight:"1.5"},'& [part="record-nav"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-2)",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"}},children:[{tagName:"div",attributes:{part:"stage-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/stage"},cases:{entry:{tagName:"div",attributes:{part:"body",role:"none"},style:{display:"contents"},children:[{tagName:"div",attributes:{part:"header"},children:[{tagName:"h3",attributes:{part:"name"},textContent:"${state.name}"},{tagName:"span",attributes:{part:"collection"},textContent:"${state.collection}"},{tagName:"div",attributes:{part:"record-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/recordNav"},cases:{shown:{$description:"A record of a file-backed collection (a CSV row): which row of the file this is, the rows either side of it, and the grid that shows them all. A file entry has no neighbours to step to, so it draws none of this.",tagName:"div",attributes:{part:"record-nav",role:"group","aria-label":"Records"},children:[{tagName:"jx-action-button",attributes:{part:"previous"},$props:{size:"sm",quiet:!0,label:"Previous record",hint:"Previous record",disabled:{$ref:"#/state/previousDisabled"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/showPrevious"},value:[]}]},children:[{tagName:"span",textContent:"‹ Previous"}]},{tagName:"span",attributes:{part:"place"},textContent:"${state.place}"},{tagName:"jx-action-button",attributes:{part:"next"},$props:{size:"sm",quiet:!0,label:"Next record",hint:"Next record",disabled:{$ref:"#/state/nextDisabled"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/showNext"},value:[]}]},children:[{tagName:"span",textContent:"Next ›"}]},{tagName:"jx-action-button",attributes:{part:"grid"},$props:{size:"sm",quiet:!0,label:"Edit in grid",hint:"Every record of the file, as a table"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openGrid"},value:[]}]},children:[{tagName:"span",textContent:"Edit in grid"}]}]}}},{tagName:"div",attributes:{part:"draft-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/draftAxis"},cases:{shown:{$description:"No `label`: the slotted word is on screen and carries the name, so an aria-label would be read twice. The tooltip is `hint`, which is what DRAFT_MEANING has always been.",tagName:"jx-switch",attributes:{part:"draft"},$props:{checked:{$ref:"#/state/draft"},hint:"${state.draftHint}",size:"sm"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setDraft"},value:[{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Draft"}]}}}]},{tagName:"div",attributes:{part:"note-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/noteState"},cases:{shown:{tagName:"p",attributes:{part:"note"},textContent:"${state.note}"}}},{$description:"An island: `ui/schema-form.ts` draws this entry's fields into this node, and nothing in this document knows what a schema is.",tagName:"div",attributes:{part:"fields","data-jx-region":"${state.fieldsRegion}"}}]},empty:{$description:"The mode is reachable from the palette and from `__jxAutomation` on any tab, so this state is real: it names the reason and the fix rather than drawing an empty form.",tagName:"div",attributes:{part:"empty"},children:[{tagName:"p",attributes:{part:"empty-line"},textContent:"${state.emptyLine}"},{tagName:"p",attributes:{part:"note"},children:[{tagName:"span",textContent:"A collection is a "},{tagName:"code",textContent:"content"},{tagName:"span",textContent:" entry in "},{tagName:"code",textContent:"project.json"},{tagName:"span",textContent:" whose "},{tagName:"code",textContent:"source"},{tagName:"span",textContent:" directory contains this file and which declares a "},{tagName:"code",textContent:"schema"},{tagName:"span",textContent:"."}]},{tagName:"jx-action-button",attributes:{part:"content-types"},$props:{label:"Content types",size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openContentTypes"},value:[]}]},children:[{tagName:"span",textContent:"Content types…"}]}]}}}]};E("entry-editor",ne);function ie(e,t){e.region=t.region,e.fieldsRegion=t.fieldsRegion,e.stage=t.stage,e.name=t.name,e.collection=t.collection,e.draftAxis=t.draftAxis,e.draft=t.draft,e.draftHint=t.draftHint,e.noteState=t.noteState,e.note=t.note,e.emptyLine=t.emptyLine,e.recordNav=t.recordNav,e.place=t.place,e.previousDisabled=t.previousDisabled,e.nextDisabled=t.nextDisabled}function je(e){let t=n(e)?void 0:e.attributes?.part;return n(t)?t:""}function oe(e,t,r,i){e.replaceChildren();let s=g({collection:"",draft:!1,draftAxis:"hidden",draftHint:"",emptyLine:"",fieldsRegion:"",name:"",nextDisabled:!0,note:"",noteState:"hidden",openContentTypes:r.openContentTypes,openGrid:r.openGrid,place:"",previousDisabled:!0,recordNav:"hidden",region:"",setDraft:r.setDraft,showNext:r.showNext,showPrevious:r.showPrevious,stage:"empty"});ie(s,t);let o=null,a=!1,l=R("entry-editor",s,e,{onNodeCreated:(c,d,D)=>{if(c instanceof HTMLElement&&je(D)==="fields")i.fieldsSlot(c)}}).then((c)=>{let d=c.root;if(a)return c.dispose(),d;return o=c,d});return{attached:()=>{if(a)return!1;let c=o?.root;return c===void 0?!0:c instanceof HTMLElement&&e.contains(c)},dispose(){a=!0,o?.dispose(),o=null},ready:l,update:(c)=>ie(s,c)}}var M=g(new Map);function se(e,t){M.set(e,t)}function cN(e){return e?M.get(e):void 0}function dN(e){M.delete(e)}function b(e){return e.replaceAll("\\","/").replace(/^(?:\.\/)+/,"").replace(/\/+$/,"")}function Oe(e){if(e.endsWith("/"))return!1;let t=e.slice(e.lastIndexOf("/")+1);return/\.[a-z\d]+$/i.test(t)}function le(e,t){let r=[];for(let o of e)r.push(b(o));let i=[],s=t?.content??{};for(let o of Object.values(s)){if(!n(o.source)||o.source===""||Oe(o.source))continue;let a=b(o.source),l=a.indexOf($o);if(l!==-1)a=b(a.slice(0,l));if(a===""||a===".")continue;if(![...r,...i].some((d)=>a===d||a.startsWith(`${d}/`)))i.push(a)}return i.length===0?e:[...e,...i]}function ke(e,t){let r=ec(e);if(r===null)return null;if(r===hi)return t===void 0||ih(e,t)?r:null;let i=Gn(e);if(!i||i.name!==r||!i.def.format||i.ext===null)return r;return e.toLowerCase().endsWith(i.ext.toLowerCase())?r:null}var Ae=new Set(["node_modules",".git",".jx",".cache"]);function $e(e){let t=b(e);return t===""||t==="."}async function de(e,t,r=!1){let i;try{i=await $s(()=>t.platform.listDirectory(e))}catch(o){if(!r)t.failures.push({dir:e,error:X(o)});return}let s=[];for(let o of i){if(o.type==="directory"){let l=b(o.path);if(!Ae.has(o.name)&&!$e(l)&&!t.claimed.has(l))t.claimed.add(l),s.push(o.path);continue}let a=At(o.name);t.out.push({collection:ke(o.path,t.pageExtensions),ext:a,locale:jx(o.path,t.i18n)??void 0,media:ra.has(a),modified:o.modified,name:o.name,path:o.path,size:o.size,type:a||"file"})}await Promise.all(s.map((o)=>de(o,t)))}async function xm(e,t,r=new Set,i){let{i18n:s}=ln(C?.projectConfig??{}),o={claimed:new Set,failures:[],i18n:s,out:[],pageExtensions:i,platform:t};await Promise.all(e.map((c)=>{let d=b(c);if(o.claimed.has(d))return Promise.resolve();return o.claimed.add(d),de(c,o,r.has(c))}));let{failures:a,out:l}=o;return l.sort((c,d)=>c.path.localeCompare(d.path)),{failures:a,files:l}}function cT(e,t){let r=e.filter((o)=>o.collection===t.collection),i=t.query.trim().toLowerCase();if(i)r=r.filter((o)=>o.name.toLowerCase().includes(i)||o.path.toLowerCase().includes(i));let s=t.locale?.trim();if(s)r=r.filter((o)=>o.locale===s);return r}var _m=["table","cards","calendar","board"],Ew={board:"Board",calendar:"Calendar",cards:"Cards",table:"Table"};var uN=new Set(["cards"]),Ie=/^(\d{4}-\d{2}-\d{2})/;function dT(e){let t=Ie.exec(e.name);if(t)return t[1];if(e.modified){let r=Rp(new Date(e.modified));if(r)return r}return null}function Eb(){return ln(C?.projectConfig??{}).i18n?.locales??[]}function hN(e){let t=new Set;for(let r of e)if(r.locale)t.add(r.locale);return Eb().filter((r)=>t.has(r))}function pN(e,t=dT){let r=new Map,i=[];for(let o of e){let a=t(o);if(a===null){i.push(o);continue}let l=r.get(a);if(l)l.push(o);else r.set(a,[o])}return{days:[...r.entries()].map(([o,a])=>({date:o,files:a})).toSorted((o,a)=>a.date.localeCompare(o.date)),undated:i}}function _e(e){let t=e.lastIndexOf("/");return t===-1?".":e.slice(0,t)}function fN(e){let t=new Map;for(let r of e){let i=_e(r.path),s=t.get(i);if(s)s.push(r);else t.set(i,[r])}return[...t.entries()].map(([r,i])=>({files:i,group:r})).toSorted((r,i)=>r.group.localeCompare(i.group))}function He(e,t,r,i){let s=Sp(e,t),o=s===null?"":t[s]??"",a=Object.values(t).find((l)=>l.trim()!=="");return(o||a||i||`Row ${r+1}`).trim()}function Me(e){let{headers:t,rows:r}=Fd(e);return r.flatMap((i,s)=>i.some((o)=>o.trim()!=="")?[{fields:Object.fromEntries(t.map((o,a)=>[o,i[a]??""])),row:s}]:[])}function Ge(e){let t;try{t=JSON.parse(e)}catch{return null}let r=(i)=>_(i)&&!Array.isArray(i)?Object.fromEntries(Object.entries(i).map(([s,o])=>[s,j(o)])):{};if(!Array.isArray(t))return[{fields:r(t),row:0,single:!0}];return t.map((i,s)=>({fields:r(i),row:s}))}function ue(e,t,r){let i=e.toLowerCase(),s=i.endsWith(".csv")?Me(t):i.endsWith(".json")?Ge(t):null;if(s===null)return null;let o=(e.split("/").pop()??e).replace(/\.[^.]+$/,"");return s.map(({fields:a,row:l,single:c},d)=>({fields:a,index:d,row:l,title:He(r,a,d,c?o:"")}))}function fe(e,t){return`${e}#${t+1}`}var G="The Content workspace lists files; it does not edit them in the list. Rename, duplicate or delete from the file's context menu, or open the file to edit it.";function Ve(e){return`field:${e}`}function mN(e){return e.startsWith("field:")?e.slice(6):null}var Je=6,pe=new Set(["image","markdown","html","richtext"]);function V(e){return Ub(mC(e))}function gN(e,t){return Object.entries(e?.properties??{}).filter(([r,i])=>{if(t.has(r)||r===Cs)return!1;if(i.type==="object"||n(i.format)&&pe.has(i.format))return!1;let s=i.items?.format;return i.type!=="array"||i.items?.type==="string"&&!(n(s)&&pe.has(s))}).slice(0,Je).map(([r,i])=>{let s={name:r,title:V(r)};if(i.type==="array")s.list=!0;if(i.type==="number"||i.type==="integer"||i.format==="date"||i.format==="date-time")s.measure=!0;return s})}function ze(e){let t=[{editable:!1,field:"title",kind:"string",title:"Title",widthHint:240},{editable:!1,field:"url",kind:"string",pk:!0,title:"URL",widthHint:200},{editable:!1,field:"template",kind:"string",title:"Template",widthHint:140}];if(e?.status)t.push({editable:!1,field:"status",kind:"string",title:"Status",widthHint:100});if(e?.locale)t.push({editable:!1,field:"locale",kind:"string",title:"Language",widthHint:110});return t.push({editable:!1,field:"modified",kind:"date",title:"Edited",widthHint:120}),t}function uT(e=hi,t){let r=[...t?.locale?[{editable:!1,field:"locale",kind:"string",title:"Locale",widthHint:90}]:[],{editable:!1,field:"modified",kind:"date",title:"Modified",widthHint:160},{editable:!1,field:"path",kind:"readonly",title:"Path",widthHint:320}];if(e===hi)return ze(t);let i=[{editable:!1,field:"title",kind:"string",title:"Title",widthHint:260}];if(t?.status)i.push({editable:!1,field:"status",kind:"string",title:"Status",widthHint:100});if(t?.date)i.push({editable:!1,field:"date",kind:"date",title:"Date",widthHint:120});for(let s of t?.fields??[])i.push({editable:!1,field:Ve(s.name),kind:"string",title:s.title,widthHint:140});return[...i,...r]}function Ke(e){return{cells:{locale:e.locale??null,modified:e.modified??null,status:null,template:null,title:e.name,url:e.collection===hi?yr(e.path).urlPattern:null},key:e.path}}async function Ye(e,t){return(await Promise.all(e.map(async(i)=>{let s=i.collection===null?null:Gn(i.path);if(!s?.fileBacked)return[i];let o;try{o=await t(i.path)}catch{return[i]}let a=ue(i.path,o,s.def.schema);if(a===null)return[i];return a.map((l)=>Be(i,l))}))).flat()}function Be(e,t){return{...e,name:t.title,path:fe(e.path,t.index),record:{fields:t.fields,row:t.row,source:e.path}}}async function We(e){let t=p(),r=await Ye(e.files,(i)=>t.readFile(i));return{...e,files:r}}function bN(e){let t=null,r=null,i=null,s=e??(()=>le(C?.projectDirs??[],C?.projectConfig??null));async function o(){if(t)return t;let a=s(),l=new Set(e?a:C?.projectDirs??[]),c=new Set(a.filter((d)=>!l.has(d)));return r??=Nv().then((d)=>xm(a,p(),c,d)).then(We).then((d)=>(t=d,i=a.join(`
|
|
4
|
-
`),r=null,d)),r}return{capabilities:{delete:!1,insert:!1,remotePaging:!1,remoteSort:!1},columns:()=>Promise.resolve(uT()),commit(a){return Promise.resolve({cells:a.cells.map((l)=>({error:G,field:l.field,ok:!1,rowKey:l.rowKey})),deletes:a.deletes.map((l)=>({error:G,ok:!1,rowKey:l.rowKey})),inserts:a.inserts.map((l)=>({error:G,ok:!1,tempKey:l.tempKey}))})},failures:()=>t?.failures??[],files:()=>t?.files??[],id:$a("content"),label:"Content",async refresh(){t=null,r=null,await o()},async rows(){let a=await o();return{rows:a.files.map((l)=>Ke(l)),total:a.files.length}},scanned:()=>t!==null,stale:()=>t!==null&&i!==s().join(`
|
|
5
|
-
`)}}var qe=[f],T=new Map;function J(e){return T.get(e)??null}function hT(e,t){let r=J(e);return r!==null&&r.tabId===t.id&&r.wrap.isConnected&&r.surface.attached()}function Tw(e){let t=T.get(e);if(!t)return;t.scope.stop(),t.surface.dispose(),T.delete(e)}function Tb(e,t){Z(e,(r)=>H(r,Cs,t))}function vN(e){let t=L(e),r=Ul(e);if(!t||!jc(t.schema,r))return null;let i=Jl(r);return{draft:i,text:i?"Draft":"Published",title:i?Tp:"Not marked a draft."}}function pT(e){return Object.fromEntries(Object.entries(e?.properties??{}).map(([t,r])=>[t,{label:n(r.title)&&r.title!==""?r.title:V(t)}]))}function fT(e){return{fieldKeyPrefix:`entry:${e.id}`,resolvePointer:(t,r)=>Ep(t,{projectConfig:C?.projectConfig??{},scope:r})}}function mT(e,t){return Object.fromEntries(FN(e.schema,t).map((r)=>[r,"Required — this entry does not have one."]))}function L(e){return y(e)?PN(e.documentPath):Fc(e.documentPath)}function gT(e,t,r){let i=Sp(t,r),s=e.properties??{},o=i===null?void 0:s[i];if(i===null||o===void 0)return e;return{...e,properties:{[i]:o,...s}}}function Ue(e){return`${e.documentPath??"This document"} is not an entry of any content collection, so there is no schema to draw a form from.`}function he(e,t,r){let i=Ln(e,"entry"),s=Ln(e,"entry/fields");if(!r)return{collection:"",draft:!1,draftAxis:"hidden",draftHint:Tp,emptyLine:Ue(t),fieldsRegion:s,name:"",nextDisabled:!0,note:"",noteState:"hidden",place:"",previousDisabled:!0,recordNav:"hidden",region:i,stage:"empty"};let o=Ul(t),a=Jl(o),l=y(t),c=S(t);return{collection:r.name,draft:a,draftAxis:jc(r.schema,o)?"shown":"hidden",draftHint:Tp,emptyLine:"",fieldsRegion:s,name:l?Xe(r,o,c.index):t.documentPath?.split("/").pop()??"Untitled",nextDisabled:c.next===null,note:Tp,noteState:a?"shown":"hidden",place:c.index===-1?"":`${c.index+1} of ${c.total}`,previousDisabled:c.previous===null,recordNav:l?"shown":"hidden",region:i,stage:"entry"}}function Xe(e,t,r){let i=Sp(e.schema,t),s=i===null?void 0:t[i];if(n(s)&&s.trim()!=="")return s.trim();return r===-1?"Record":`Row ${r+1}`}function yN(e,t){let{paneId:r,wrap:i}=e;if(hT(r,t))return;Tw(r);let s=null,o=null,a=()=>{if(s!==null&&J(r)===s)c()},l=(u)=>{if(!o||!u)return;let N=Ul(t),z=Gl(`entry:${r}`,gT(u.schema,u.schema,N),N,{context:fT(t),errors:mT(u,N),onChange:(ge)=>xS(t,ge),rerender:a,ui:pT(u.schema)});if(z.parentNode!==o)o.replaceChildren(z)},c=()=>{let u=L(t);if(!u)o=null;s?.surface.update(he(r,t,u)),l(u)},d=me(),D=oe(i,he(r,t,L(t)),{openContentTypes:()=>{ae()?.run("settings.open",{section:"content"})},openGrid:()=>{let{index:u}=S(t);if(u!==-1&&t.documentPath)se(t.documentPath,u);t.session.ui.canvasMode="grid"},setDraft:(u)=>Tb(t,u),showNext:()=>{let{next:u}=S(t);if(u!==null)A(t,u)},showPrevious:()=>{let{previous:u}=S(t);if(u!==null)A(t,u)}},{fieldsSlot:(u)=>{o=u,l(L(t))}});s={paneId:r,scope:d,surface:D,tabId:t.id,wrap:i},T.set(r,s),d.run(()=>{te(()=>{if(J(r)!==s)return;t.doc.document,t.doc.content.frontmatter,C?.projectConfig?.content,c()})})}async function wN(e){let{openFileInTab:t}=await (ce("zrqtgt41"),import("./files-zrqtgt41.js"));await t(e);for(let[r,i]of m.tabs.entries()){if(i.documentPath!==e)continue;for(let s of qe)if(!i.capabilities.modes.includes(s))i.capabilities.modes.unshift(s);return i.session.ui.canvasMode=f,i.session.ui.preview=!1,Ft(r),i}return null}
|
|
6
|
-
export{Sp,wS,sT,kb,aT,Cw,aN,lT,kw,lN,Ul,xS,cN,dN,xm,cT,_m,Ew,uN,dT,Eb,hN,pN,fN,mN,gN,uT,bN,hT,Tw,Tb,vN,pT,fT,mT,gT,yN,wN};
|
|
7
|
-
|
|
8
|
-
//# debugId=66DE3D0E0D534F9764756E2164756E21
|
|
9
|
-
//# sourceMappingURL=studio-z3fztxrp.js.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{p0,pf,ff,mf,f0,ag,su,Fv,gf,zI,Rh,cg,XM,Pa}from"./studio-nzemfbkk.js";import{p}from"./studio-4fnb5648.js";import{gh,Vp}from"./studio-hh394phe.js";import{_v}from"./studio-knsjyx7n.js";import{jt,fn}from"./studio-q9hx2qp0.js";import{Ne}from"./studio-n9qba0gx.js";import{mx}from"./studio-xva3hzkv.js";import{Fr}from"./studio-hfqpfmpk.js";import{fh,dv,Gd,uv,hv,mh}from"./studio-acer0g8w.js";import{C}from"./studio-4f7thq0p.js";import{n,Q,_,v,cd}from"./studio-k3we3kqb.js";function w(e,t){return new URL(`/node_modules/${e}`,t).href}function g(e){if(e===void 0)return!1;if(n(e))return!e.includes("${");if(Array.isArray(e))return e.every((t)=>g(t));if(v(e))return!("$ref"in e)&&!("$prototype"in e)&&!("$expression"in e)&&Object.values(e).every((t)=>g(t));return!0}function uS(e){let t=new Map;for(let[s,r]of Object.entries(e.state??{})){if(cd(s)||!v(r)||!Array.isArray(r.examples))continue;let[o]=r.examples;if(g(o))t.set(s,o)}return t}var k={body:"body",root:":root"};function R(e,t,s,r,o=k){let l=[],a=(i,c)=>{let d={mediaQueries:t,scope:c,transposeValue:s};if(r)d.resolveValue=(m,h)=>r(m,h,c);for(let m of ag(i,d))l.push(m.text)},S={},y={},x=[],b=[];for(let[i,c]of Object.entries(e)){if(_(c)&&!Array.isArray(c)){if(i.startsWith("@"))x.push([i,c]);else if(!i.startsWith("--"))b.push([i,c]);continue}if(f0(i)||i.startsWith("@"))continue;if(i.startsWith("--")||i==="colorScheme"||i==="color-scheme")S[i]=c;else y[i]=c}a(S,o.root),a(y,o.body);for(let[i,c]of b)if(i.startsWith("&"))a({[i]:c},o.root);else a(c,i);for(let[i,c]of x){if(p0(i)||pf(i)){a({[i]:c},null);continue}let d={},m={},h=[];for(let[u,f]of Object.entries(c)){if(_(f)&&!Array.isArray(f)){if(!u.startsWith("@"))h.push([u,f]);continue}if(u.startsWith("--"))d[u]=f;else m[u]=f}a({[i]:d},o.root),a({[i]:m},o.body);for(let[u,f]of h)a({[i]:f},u)}if(Object.values(t).some((i)=>mf(i)!==null)&&!("colorScheme"in e))l.push(`${o.root} { color-scheme: light dark }`,`${o.root}:where([${ff}="light"]) { color-scheme: light }`,`${o.root}:where([${ff}="dark"]) { color-scheme: dark }`);return l.join(`
|
|
2
|
-
`)}var T={body:":host",root:":host"},P=new WeakMap,J=new WeakMap;function A(e){let t=e.replaceAll(/:root\b/g,":host").replaceAll(/(^|[\s,>+~(])(?:html|body)(?![\w-])/g,"$1:host").replaceAll(/:host(?:\s*>?\s*:host)+/g,":host");return t===e?null:t}function j(e){for(let t=0;t<e.cssRules.length;t+=1){let s=e.cssRules[t],r=s instanceof CSSStyleRule?A(s.selectorText):null;if(s instanceof CSSStyleRule&&r!==null){let l=`${r}${s.cssText.slice(s.cssText.indexOf("{"))}`;try{e.insertRule(l,t),e.deleteRule(t+1)}catch{}}let o=e.cssRules[t];if(o instanceof CSSGroupingRule)j(o)}}function D(e){let t=[];for(let s of e??[]){if(!_(s)||String(s.tagName).toLowerCase()!=="link")continue;let{href:r,rel:o}=s.attributes??{};if(n(r)&&r!==""&&n(o)&&o.split(/\s+/).includes("stylesheet"))t.push(r)}return t}async function M(e){let t=hv(e,"project.json");try{let s=await fetch(t);if(!s.ok)return null;let r=new URL(t,location.href).href,o=new CSSStyleSheet({baseURL:r});return o.replaceSync(await s.text()),j(o),o}catch{return null}}async function L(e){let s=(await Promise.all(D(e.$head).map((o)=>M(o)))).filter((o)=>o!==null),{style:r}=e;if(_(r)){let o=new CSSStyleSheet;o.replaceSync(R(r,e.$media??{},(l)=>l,void 0,T)),s.push(o)}return s}function E(){let e=C?.projectConfig;if(!e||!Q(globalThis.CSSStyleSheet))return Promise.resolve([]);let t=P.get(e);if(!t)t=L(e).then((s)=>(J.set(e,s),s)),P.set(e,t);return t}function iN(){let e=C?.projectConfig;return(e&&J.get(e))??[]}var H=150;function yw(e=H){let t=new Map;function s(){for(let[r,o]of t){if(t.size<=e)break;t.delete(r),o.remove()}}return{clear(){for(let r of t.values())r.remove();t.clear()},get(r){let o=t.get(r);if(o!==void 0)t.delete(r),t.set(r,o);return o},has:(r)=>t.has(r),keys:()=>[...t.keys()],set(r,o){t.delete(r),t.set(r,o),s()},size:()=>t.size}}function O(e){let t=Gd(C?.projectRoot);return URL.canParse(t)?new URL(e,t).href:location.href}async function N(e){try{let t=await p().readFile(e);su(!0);let s=uv(e,mh());await jt();let r;if(fn(e))r=(await Fr(e,t)).document;else r=JSON.parse(t);return await F(r,e,s)}catch{return null}}async function F(e,t,s){su(!0),Fv(dv());let r=await Rh(e,{},O(t)),o=s&&{...s,revisions:Vp(),versions:gh()};zI((l)=>_v(l,o));try{let l=Pa(e,r);return l instanceof HTMLElement?l:null}finally{zI(null)}}async function W(e,t){let s=await XE(t);if(!s)return null;let r=uS(s);return await hS(s,t,r)?mx(e,r):null}async function XE(e){try{let t=JSON.parse(await p().readFile(e));return _(t)&&!Array.isArray(t)?t:null}catch{return null}}async function hS(e,t,s){let r=null;try{su(!0),Fv(dv());let o=await Rh(e,{},O(t));for(let[S,y]of s)o[S]=y;let l=!1;cg(()=>{l=!0});let{stop:a}=gf(()=>Pa({...e,tagName:"div"},o));return r=a,!l}catch{return!1}finally{cg(null),r?.()}}function V(e){return e.source!=="npm"&&(e.path?.endsWith(".json")??!1)}async function ww(e,t){let s=t.get(e);if(s)return s;let r;try{XM((l)=>w(l,`${fh()}/`)),await E();let o=Ne.find((l)=>l.path===e);if(o&&V(o))r=await W(o,e);else r=o?await mx(o):await N(e)}catch{return}if(!r)return;return t.set(e,r),r}function _p(e){if(!Q(globalThis.IntersectionObserver))return{destroy(){},observe:(r)=>e(r),releaseDetached:()=>0};let t=new Set,s=new IntersectionObserver((r)=>{for(let o of r)if(o.isIntersecting)t.delete(o.target),s.unobserve(o.target),e(o.target)},{rootMargin:"200px"});return{destroy(){s.disconnect(),t.clear()},observe(r){if(t.has(r))return;t.add(r),s.observe(r)},releaseDetached(){let r=0;for(let o of t)if(!o.isConnected)t.delete(o),s.unobserve(o),r+=1;return r}}}
|
|
3
|
-
export{uS,iN,yw,XE,hS,ww,_p};
|
|
4
|
-
|
|
5
|
-
//# debugId=1F63FE53C2A6F9CC64756E2164756E21
|
|
6
|
-
//# sourceMappingURL=studio-z9453ypn.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{L,C,A,P,q,z,G,Y,X,Q}from"./iframe-entry-2x9bn5ng.js";export{L as TOAST_PAUSE,C as TOAST_RESUME,P as closeToast,Q as onToastAction,X as onToastDismiss,G as onToastHold,q as onToastMount,Y as onToastRelease,z as onToastUnmount,A as staysInside};
|
|
2
|
-
|
|
3
|
-
//# debugId=CA76A88119B868B264756E2164756E21
|
|
4
|
-
//# sourceMappingURL=toast-w11qpkyz.js.map
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import{hp,wa,C_,Ed,Un,xe}from"./studio-eqcddvc2.js";import{_0}from"./studio-egnjpyde.js";import{pR}from"./studio-k0xzrse2.js";class z{constructor(o,e){this._modeId=o,this._defaults=e,this._worker=null,this._client=null,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker()),this._updateExtraLibsToken=0,this._extraLibsChangeListener=this._defaults.onDidExtraLibsChange(()=>this._updateExtraLibs())}dispose(){this._configChangeListener.dispose(),this._extraLibsChangeListener.dispose(),this._stopWorker()}_stopWorker(){if(this._worker)this._worker.dispose(),this._worker=null;this._client=null}async _updateExtraLibs(){if(!this._worker)return;let o=++this._updateExtraLibsToken,e=await this._worker.getProxy();if(this._updateExtraLibsToken!==o)return;e.updateExtraLibs(this._defaults.getExtraLibs())}_getClient(){if(!this._client)this._client=(async()=>{if(this._worker=_0({moduleId:"vs/language/typescript/tsWorker",createWorker:()=>new Worker(new URL("ts.worker.js",import.meta.url),{type:"module"}),label:this._modeId,keepIdleModels:!0,createData:{compilerOptions:this._defaults.getCompilerOptions(),extraLibs:this._defaults.getExtraLibs(),customWorkerPath:this._defaults.workerOptions.customWorkerPath,inlayHintsOptions:this._defaults.inlayHintsOptions}}),this._defaults.getEagerModelSync())return await this._worker.withSyncedResources(Un.getModels().filter((o)=>o.getLanguageId()===this._modeId).map((o)=>o.uri));return await this._worker.getProxy()})();return this._client}async getLanguageServiceWorker(...o){let e=await this._getClient();if(this._worker)await this._worker.withSyncedResources(o);return e}}var i={};i["lib.d.ts"]=!0;i["lib.decorators.d.ts"]=!0;i["lib.decorators.legacy.d.ts"]=!0;i["lib.dom.asynciterable.d.ts"]=!0;i["lib.dom.d.ts"]=!0;i["lib.dom.iterable.d.ts"]=!0;i["lib.es2015.collection.d.ts"]=!0;i["lib.es2015.core.d.ts"]=!0;i["lib.es2015.d.ts"]=!0;i["lib.es2015.generator.d.ts"]=!0;i["lib.es2015.iterable.d.ts"]=!0;i["lib.es2015.promise.d.ts"]=!0;i["lib.es2015.proxy.d.ts"]=!0;i["lib.es2015.reflect.d.ts"]=!0;i["lib.es2015.symbol.d.ts"]=!0;i["lib.es2015.symbol.wellknown.d.ts"]=!0;i["lib.es2016.array.include.d.ts"]=!0;i["lib.es2016.d.ts"]=!0;i["lib.es2016.full.d.ts"]=!0;i["lib.es2016.intl.d.ts"]=!0;i["lib.es2017.arraybuffer.d.ts"]=!0;i["lib.es2017.d.ts"]=!0;i["lib.es2017.date.d.ts"]=!0;i["lib.es2017.full.d.ts"]=!0;i["lib.es2017.intl.d.ts"]=!0;i["lib.es2017.object.d.ts"]=!0;i["lib.es2017.sharedmemory.d.ts"]=!0;i["lib.es2017.string.d.ts"]=!0;i["lib.es2017.typedarrays.d.ts"]=!0;i["lib.es2018.asyncgenerator.d.ts"]=!0;i["lib.es2018.asynciterable.d.ts"]=!0;i["lib.es2018.d.ts"]=!0;i["lib.es2018.full.d.ts"]=!0;i["lib.es2018.intl.d.ts"]=!0;i["lib.es2018.promise.d.ts"]=!0;i["lib.es2018.regexp.d.ts"]=!0;i["lib.es2019.array.d.ts"]=!0;i["lib.es2019.d.ts"]=!0;i["lib.es2019.full.d.ts"]=!0;i["lib.es2019.intl.d.ts"]=!0;i["lib.es2019.object.d.ts"]=!0;i["lib.es2019.string.d.ts"]=!0;i["lib.es2019.symbol.d.ts"]=!0;i["lib.es2020.bigint.d.ts"]=!0;i["lib.es2020.d.ts"]=!0;i["lib.es2020.date.d.ts"]=!0;i["lib.es2020.full.d.ts"]=!0;i["lib.es2020.intl.d.ts"]=!0;i["lib.es2020.number.d.ts"]=!0;i["lib.es2020.promise.d.ts"]=!0;i["lib.es2020.sharedmemory.d.ts"]=!0;i["lib.es2020.string.d.ts"]=!0;i["lib.es2020.symbol.wellknown.d.ts"]=!0;i["lib.es2021.d.ts"]=!0;i["lib.es2021.full.d.ts"]=!0;i["lib.es2021.intl.d.ts"]=!0;i["lib.es2021.promise.d.ts"]=!0;i["lib.es2021.string.d.ts"]=!0;i["lib.es2021.weakref.d.ts"]=!0;i["lib.es2022.array.d.ts"]=!0;i["lib.es2022.d.ts"]=!0;i["lib.es2022.error.d.ts"]=!0;i["lib.es2022.full.d.ts"]=!0;i["lib.es2022.intl.d.ts"]=!0;i["lib.es2022.object.d.ts"]=!0;i["lib.es2022.regexp.d.ts"]=!0;i["lib.es2022.string.d.ts"]=!0;i["lib.es2023.array.d.ts"]=!0;i["lib.es2023.collection.d.ts"]=!0;i["lib.es2023.d.ts"]=!0;i["lib.es2023.full.d.ts"]=!0;i["lib.es2023.intl.d.ts"]=!0;i["lib.es2024.arraybuffer.d.ts"]=!0;i["lib.es2024.collection.d.ts"]=!0;i["lib.es2024.d.ts"]=!0;i["lib.es2024.full.d.ts"]=!0;i["lib.es2024.object.d.ts"]=!0;i["lib.es2024.promise.d.ts"]=!0;i["lib.es2024.regexp.d.ts"]=!0;i["lib.es2024.sharedmemory.d.ts"]=!0;i["lib.es2024.string.d.ts"]=!0;i["lib.es5.d.ts"]=!0;i["lib.es6.d.ts"]=!0;i["lib.esnext.array.d.ts"]=!0;i["lib.esnext.collection.d.ts"]=!0;i["lib.esnext.d.ts"]=!0;i["lib.esnext.decorators.d.ts"]=!0;i["lib.esnext.disposable.d.ts"]=!0;i["lib.esnext.error.d.ts"]=!0;i["lib.esnext.float16.d.ts"]=!0;i["lib.esnext.full.d.ts"]=!0;i["lib.esnext.intl.d.ts"]=!0;i["lib.esnext.iterator.d.ts"]=!0;i["lib.esnext.promise.d.ts"]=!0;i["lib.esnext.sharedmemory.d.ts"]=!0;i["lib.scripthost.d.ts"]=!0;i["lib.webworker.asynciterable.d.ts"]=!0;i["lib.webworker.d.ts"]=!0;i["lib.webworker.importscripts.d.ts"]=!0;i["lib.webworker.iterable.d.ts"]=!0;function M(o,e,n=0){if(typeof o==="string")return o;else if(o===void 0)return"";let c="";if(n){c+=e;for(let r=0;r<n;r++)c+=" "}if(c+=o.messageText,n++,o.next)for(let r of o.next)c+=M(r,e,n);return c}function v(o){if(o)return o.map((e)=>e.text).join("");return""}class b{constructor(o){this._worker=o}_textSpanToRange(o,e){let n=o.getPositionAt(e.start),c=o.getPositionAt(e.start+e.length),{lineNumber:r,column:s}=n,{lineNumber:d,column:t}=c;return{startLineNumber:r,startColumn:s,endLineNumber:d,endColumn:t}}}class A{constructor(o){this._worker=o,this._libFiles={},this._hasFetchedLibFiles=!1,this._fetchLibFilesPromise=null}isLibFile(o){if(!o)return!1;if(o.path.indexOf("/lib.")===0)return!!i[o.path.slice(1)];return!1}getOrCreateModel(o){let e=Ed.parse(o),n=Un.getModel(e);if(n)return n;if(this.isLibFile(e)&&this._hasFetchedLibFiles)return Un.createModel(this._libFiles[e.path.slice(1)],"typescript",e);let c=pR.getExtraLibs()[o];if(c)return Un.createModel(c.content,"typescript",e);return null}_containsLibFile(o){for(let e of o)if(this.isLibFile(e))return!0;return!1}async fetchLibFilesIfNecessary(o){if(!this._containsLibFile(o))return;await this._fetchLibFiles()}_fetchLibFiles(){if(!this._fetchLibFilesPromise)this._fetchLibFilesPromise=this._worker().then((o)=>o.getLibFiles()).then((o)=>{this._hasFetchedLibFiles=!0,this._libFiles=o});return this._fetchLibFilesPromise}}class C extends b{constructor(o,e,n,c){super(c);this._libFiles=o,this._defaults=e,this._selector=n,this._disposables=[],this._listener=Object.create(null);let r=(t)=>{if(t.getLanguageId()!==n)return;let l=()=>{let{onlyVisible:u}=this._defaults.getDiagnosticsOptions();if(u){if(t.isAttachedToEditor())this._doValidate(t)}else this._doValidate(t)},p,g=t.onDidChangeContent(()=>{clearTimeout(p),p=window.setTimeout(l,500)}),m=t.onDidChangeAttached(()=>{let{onlyVisible:u}=this._defaults.getDiagnosticsOptions();if(u)if(t.isAttachedToEditor())l();else Un.setModelMarkers(t,this._selector,[])});this._listener[t.uri.toString()]={dispose(){g.dispose(),m.dispose(),clearTimeout(p)}},l()},s=(t)=>{Un.setModelMarkers(t,this._selector,[]);let l=t.uri.toString();if(this._listener[l])this._listener[l].dispose(),delete this._listener[l]};this._disposables.push(Un.onDidCreateModel((t)=>r(t))),this._disposables.push(Un.onWillDisposeModel(s)),this._disposables.push(Un.onDidChangeModelLanguage((t)=>{s(t.model),r(t.model)})),this._disposables.push({dispose(){for(let t of Un.getModels())s(t)}});let d=()=>{for(let t of Un.getModels())s(t),r(t)};this._disposables.push(this._defaults.onDidChange(d)),this._disposables.push(this._defaults.onDidExtraLibsChange(d)),Un.getModels().forEach((t)=>r(t))}dispose(){this._disposables.forEach((o)=>o&&o.dispose()),this._disposables=[]}async _doValidate(o){let e=await this._worker(o.uri);if(o.isDisposed())return;let n=[],{noSyntaxValidation:c,noSemanticValidation:r,noSuggestionDiagnostics:s}=this._defaults.getDiagnosticsOptions();if(!c)n.push(e.getSyntacticDiagnostics(o.uri.toString()));if(!r)n.push(e.getSemanticDiagnostics(o.uri.toString()));if(!s)n.push(e.getSuggestionDiagnostics(o.uri.toString()));let d=await Promise.all(n);if(!d||o.isDisposed())return;let t=d.reduce((p,g)=>g.concat(p),[]).filter((p)=>(this._defaults.getDiagnosticsOptions().diagnosticCodesToIgnore||[]).indexOf(p.code)===-1),l=t.map((p)=>p.relatedInformation||[]).reduce((p,g)=>g.concat(p),[]).map((p)=>p.file?Ed.parse(p.file.fileName):null);if(await this._libFiles.fetchLibFilesIfNecessary(l),o.isDisposed())return;Un.setModelMarkers(o,this._selector,t.map((p)=>this._convertDiagnostics(o,p)))}_convertDiagnostics(o,e){let n=e.start||0,c=e.length||1,{lineNumber:r,column:s}=o.getPositionAt(n),{lineNumber:d,column:t}=o.getPositionAt(n+c),l=[];if(e.reportsUnnecessary)l.push(C_.Unnecessary);if(e.reportsDeprecated)l.push(C_.Deprecated);return{severity:this._tsDiagnosticCategoryToMarkerSeverity(e.category),startLineNumber:r,startColumn:s,endLineNumber:d,endColumn:t,message:M(e.messageText,`
|
|
2
|
-
`),code:e.code.toString(),tags:l,relatedInformation:this._convertRelatedInformation(o,e.relatedInformation)}}_convertRelatedInformation(o,e){if(!e)return[];let n=[];return e.forEach((c)=>{let r=o;if(c.file)r=this._libFiles.getOrCreateModel(c.file.fileName);if(!r)return;let s=c.start||0,d=c.length||1,{lineNumber:t,column:l}=r.getPositionAt(s),{lineNumber:p,column:g}=r.getPositionAt(s+d);n.push({resource:r.uri,startLineNumber:t,startColumn:l,endLineNumber:p,endColumn:g,message:M(c.messageText,`
|
|
3
|
-
`)})}),n}_tsDiagnosticCategoryToMarkerSeverity(o){switch(o){case 1:return wa.Error;case 3:return wa.Info;case 0:return wa.Warning;case 2:return wa.Hint}return wa.Info}}class x extends b{get triggerCharacters(){return["."]}async provideCompletionItems(o,e,n,c){let r=o.getWordUntilPosition(e),s=new hp(e.lineNumber,r.startColumn,e.lineNumber,r.endColumn),d=o.uri,t=o.getOffsetAt(e),l=await this._worker(d);if(o.isDisposed())return;let p=await l.getCompletionsAtPosition(d.toString(),t);if(!p||o.isDisposed())return;return{suggestions:p.entries.map((m)=>{let u=s;if(m.replacementSpan){let k=o.getPositionAt(m.replacementSpan.start),y=o.getPositionAt(m.replacementSpan.start+m.replacementSpan.length);u=new hp(k.lineNumber,k.column,y.lineNumber,y.column)}let w=[];if(m.kindModifiers!==void 0&&m.kindModifiers.indexOf("deprecated")!==-1)w.push(xe.CompletionItemTag.Deprecated);return{uri:d,position:e,offset:t,range:u,label:m.name,insertText:m.name,sortText:m.sortText,kind:x.convertKind(m.kind),tags:w}})}}async resolveCompletionItem(o,e){let n=o,{uri:c,position:r,offset:s}=n,t=await(await this._worker(c)).getCompletionEntryDetails(c.toString(),s,n.label);if(!t)return n;return{uri:c,position:r,label:t.name,kind:x.convertKind(t.kind),detail:v(t.displayParts),documentation:{value:x.createDocumentationString(t)}}}static convertKind(o){switch(o){case a.primitiveType:case a.keyword:return xe.CompletionItemKind.Keyword;case a.variable:case a.localVariable:return xe.CompletionItemKind.Variable;case a.memberVariable:case a.memberGetAccessor:case a.memberSetAccessor:return xe.CompletionItemKind.Field;case a.function:case a.memberFunction:case a.constructSignature:case a.callSignature:case a.indexSignature:return xe.CompletionItemKind.Function;case a.enum:return xe.CompletionItemKind.Enum;case a.module:return xe.CompletionItemKind.Module;case a.class:return xe.CompletionItemKind.Class;case a.interface:return xe.CompletionItemKind.Interface;case a.warning:return xe.CompletionItemKind.File}return xe.CompletionItemKind.Property}static createDocumentationString(o){let e=v(o.documentation);if(o.tags)for(let n of o.tags)e+=`
|
|
4
|
-
|
|
5
|
-
${R(n)}`;return e}}function R(o){let e=`*@${o.name}*`;if(o.name==="param"&&o.text){let[n,...c]=o.text;if(e+=`\`${n.text}\``,c.length>0)e+=` — ${c.map((r)=>r.text).join(" ")}`}else if(Array.isArray(o.text))e+=` — ${o.text.map((n)=>n.text).join(" ")}`;else if(o.text)e+=` — ${o.text}`;return e}class L extends b{constructor(){super(...arguments);this.signatureHelpTriggerCharacters=["(",","]}static _toSignatureHelpTriggerReason(o){switch(o.triggerKind){case xe.SignatureHelpTriggerKind.TriggerCharacter:if(o.triggerCharacter)if(o.isRetrigger)return{kind:"retrigger",triggerCharacter:o.triggerCharacter};else return{kind:"characterTyped",triggerCharacter:o.triggerCharacter};else return{kind:"invoked"};case xe.SignatureHelpTriggerKind.ContentChange:return o.isRetrigger?{kind:"retrigger"}:{kind:"invoked"};case xe.SignatureHelpTriggerKind.Invoke:default:return{kind:"invoked"}}}async provideSignatureHelp(o,e,n,c){let r=o.uri,s=o.getOffsetAt(e),d=await this._worker(r);if(o.isDisposed())return;let t=await d.getSignatureHelpItems(r.toString(),s,{triggerReason:L._toSignatureHelpTriggerReason(c)});if(!t||o.isDisposed())return;let l={activeSignature:t.selectedItemIndex,activeParameter:t.argumentIndex,signatures:[]};return t.items.forEach((p)=>{let g={label:"",parameters:[]};g.documentation={value:v(p.documentation)},g.label+=v(p.prefixDisplayParts),p.parameters.forEach((m,u,w)=>{let k=v(m.displayParts),y={label:k,documentation:{value:v(m.documentation)}};if(g.label+=k,g.parameters.push(y),u<w.length-1)g.label+=v(p.separatorDisplayParts)}),g.label+=v(p.suffixDisplayParts),l.signatures.push(g)}),{value:l,dispose(){}}}}class S extends b{async provideHover(o,e,n){let c=o.uri,r=o.getOffsetAt(e),s=await this._worker(c);if(o.isDisposed())return;let d=await s.getQuickInfoAtPosition(c.toString(),r);if(!d||o.isDisposed())return;let t=v(d.documentation),l=d.tags?d.tags.map((g)=>R(g)).join(`
|
|
6
|
-
|
|
7
|
-
`):"",p=v(d.displayParts);return{range:this._textSpanToRange(o,d.textSpan),contents:[{value:"```typescript\n"+p+"\n```\n"},{value:t+(l?`
|
|
8
|
-
|
|
9
|
-
`+l:"")}]}}}class I extends b{async provideDocumentHighlights(o,e,n){let c=o.uri,r=o.getOffsetAt(e),s=await this._worker(c);if(o.isDisposed())return;let d=await s.getDocumentHighlights(c.toString(),r,[c.toString()]);if(!d||o.isDisposed())return;return d.flatMap((t)=>t.highlightSpans.map((l)=>({range:this._textSpanToRange(o,l.textSpan),kind:l.kind==="writtenReference"?xe.DocumentHighlightKind.Write:xe.DocumentHighlightKind.Text})))}}class T extends b{constructor(o,e){super(e);this._libFiles=o}async provideDefinition(o,e,n){let c=o.uri,r=o.getOffsetAt(e),s=await this._worker(c);if(o.isDisposed())return;let d=await s.getDefinitionAtPosition(c.toString(),r);if(!d||o.isDisposed())return;if(await this._libFiles.fetchLibFilesIfNecessary(d.map((l)=>Ed.parse(l.fileName))),o.isDisposed())return;let t=[];for(let l of d){let p=this._libFiles.getOrCreateModel(l.fileName);if(p)t.push({uri:p.uri,range:this._textSpanToRange(p,l.textSpan)})}return t}}class D extends b{constructor(o,e){super(e);this._libFiles=o}async provideReferences(o,e,n,c){let r=o.uri,s=o.getOffsetAt(e),d=await this._worker(r);if(o.isDisposed())return;let t=await d.getReferencesAtPosition(r.toString(),s);if(!t||o.isDisposed())return;if(await this._libFiles.fetchLibFilesIfNecessary(t.map((p)=>Ed.parse(p.fileName))),o.isDisposed())return;let l=[];for(let p of t){let g=this._libFiles.getOrCreateModel(p.fileName);if(g)l.push({uri:g.uri,range:this._textSpanToRange(g,p.textSpan)})}return l}}class j extends b{async provideDocumentSymbols(o,e){let n=o.uri,c=await this._worker(n);if(o.isDisposed())return;let r=await c.getNavigationTree(n.toString());if(!r||o.isDisposed())return;let s=(t,l)=>({name:t.text,detail:"",kind:h[t.kind]||xe.SymbolKind.Variable,range:this._textSpanToRange(o,t.spans[0]),selectionRange:this._textSpanToRange(o,t.spans[0]),tags:[],children:t.childItems?.map((g)=>s(g,t.text)),containerName:l});return r.childItems?r.childItems.map((t)=>s(t)):[]}}class a{}a.unknown="";a.keyword="keyword";a.script="script";a.module="module";a.class="class";a.interface="interface";a.type="type";a.enum="enum";a.variable="var";a.localVariable="local var";a.function="function";a.localFunction="local function";a.memberFunction="method";a.memberGetAccessor="getter";a.memberSetAccessor="setter";a.memberVariable="property";a.constructorImplementation="constructor";a.callSignature="call";a.indexSignature="index";a.constructSignature="construct";a.parameter="parameter";a.typeParameter="type parameter";a.primitiveType="primitive type";a.label="label";a.alias="alias";a.const="const";a.let="let";a.warning="warning";var h=Object.create(null);h[a.module]=xe.SymbolKind.Module;h[a.class]=xe.SymbolKind.Class;h[a.enum]=xe.SymbolKind.Enum;h[a.interface]=xe.SymbolKind.Interface;h[a.memberFunction]=xe.SymbolKind.Method;h[a.memberVariable]=xe.SymbolKind.Property;h[a.memberGetAccessor]=xe.SymbolKind.Property;h[a.memberSetAccessor]=xe.SymbolKind.Property;h[a.variable]=xe.SymbolKind.Variable;h[a.const]=xe.SymbolKind.Variable;h[a.localVariable]=xe.SymbolKind.Variable;h[a.variable]=xe.SymbolKind.Variable;h[a.function]=xe.SymbolKind.Function;h[a.localFunction]=xe.SymbolKind.Function;class f extends b{static _convertOptions(o){return{ConvertTabsToSpaces:o.insertSpaces,TabSize:o.tabSize,IndentSize:o.tabSize,IndentStyle:2,NewLineCharacter:`
|
|
10
|
-
`,InsertSpaceAfterCommaDelimiter:!0,InsertSpaceAfterSemicolonInForStatements:!0,InsertSpaceBeforeAndAfterBinaryOperators:!0,InsertSpaceAfterKeywordsInControlFlowStatements:!0,InsertSpaceAfterFunctionKeywordForAnonymousFunctions:!0,InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis:!1,InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets:!1,InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces:!1,PlaceOpenBraceOnNewLineForControlBlocks:!1,PlaceOpenBraceOnNewLineForFunctions:!1}}_convertTextChanges(o,e){return{text:e.newText,range:this._textSpanToRange(o,e.span)}}}class q extends f{constructor(){super(...arguments);this.canFormatMultipleRanges=!1}async provideDocumentRangeFormattingEdits(o,e,n,c){let r=o.uri,s=o.getOffsetAt({lineNumber:e.startLineNumber,column:e.startColumn}),d=o.getOffsetAt({lineNumber:e.endLineNumber,column:e.endColumn}),t=await this._worker(r);if(o.isDisposed())return;let l=await t.getFormattingEditsForRange(r.toString(),s,d,f._convertOptions(n));if(!l||o.isDisposed())return;return l.map((p)=>this._convertTextChanges(o,p))}}class B extends f{get autoFormatTriggerCharacters(){return[";","}",`
|
|
11
|
-
`]}async provideOnTypeFormattingEdits(o,e,n,c,r){let s=o.uri,d=o.getOffsetAt(e),t=await this._worker(s);if(o.isDisposed())return;let l=await t.getFormattingEditsAfterKeystroke(s.toString(),d,n,f._convertOptions(c));if(!l||o.isDisposed())return;return l.map((p)=>this._convertTextChanges(o,p))}}class F extends f{async provideCodeActions(o,e,n,c){let r=o.uri,s=o.getOffsetAt({lineNumber:e.startLineNumber,column:e.startColumn}),d=o.getOffsetAt({lineNumber:e.endLineNumber,column:e.endColumn}),t=f._convertOptions(o.getOptions()),l=n.markers.filter((u)=>u.code).map((u)=>u.code).map(Number),p=await this._worker(r);if(o.isDisposed())return;let g=await p.getCodeFixesAtPosition(r.toString(),s,d,l,t);if(!g||o.isDisposed())return{actions:[],dispose:()=>{}};return{actions:g.filter((u)=>u.changes.filter((w)=>w.isNewFile).length===0).map((u)=>this._tsCodeFixActionToMonacoCodeAction(o,n,u)),dispose:()=>{}}}_tsCodeFixActionToMonacoCodeAction(o,e,n){let c=[];for(let s of n.changes)for(let d of s.textChanges)c.push({resource:o.uri,versionId:void 0,textEdit:{range:this._textSpanToRange(o,d.span),text:d.newText}});return{title:n.description,edit:{edits:c},diagnostics:e.markers,kind:"quickfix"}}}class E extends b{constructor(o,e){super(e);this._libFiles=o}async provideRenameEdits(o,e,n,c){let r=o.uri,s=r.toString(),d=o.getOffsetAt(e),t=await this._worker(r);if(o.isDisposed())return;let l=await t.getRenameInfo(s,d,{allowRenameOfImportPath:!1});if(l.canRename===!1)return{edits:[],rejectReason:l.localizedErrorMessage};if(l.fileToRename!==void 0)throw Error("Renaming files is not supported.");let p=await t.findRenameLocations(s,d,!1,!1,!1);if(!p||o.isDisposed())return;let g=[];for(let m of p){let u=this._libFiles.getOrCreateModel(m.fileName);if(u)g.push({resource:u.uri,versionId:void 0,textEdit:{range:this._textSpanToRange(u,m.textSpan),text:n}});else throw Error(`Unknown file ${m.fileName}.`)}return{edits:g}}}class N extends b{async provideInlayHints(o,e,n){let c=o.uri,r=c.toString(),s=o.getOffsetAt({lineNumber:e.startLineNumber,column:e.startColumn}),d=o.getOffsetAt({lineNumber:e.endLineNumber,column:e.endColumn}),t=await this._worker(c);if(o.isDisposed())return null;return{hints:(await t.provideInlayHints(r,s,d)).map((g)=>({...g,label:g.text,position:o.getPositionAt(g.position),kind:this._convertHintKind(g.kind)})),dispose:()=>{}}}_convertHintKind(o){switch(o){case"Parameter":return xe.InlayHintKind.Parameter;case"Type":return xe.InlayHintKind.Type;default:return xe.InlayHintKind.Type}}}var W,H;function Ot(o){H=O(o,"typescript")}function _t(o){W=O(o,"javascript")}function Pt(){return new Promise((o,e)=>{if(!W)return e("JavaScript not registered!");o(W)})}function Vt(){return new Promise((o,e)=>{if(!H)return e("TypeScript not registered!");o(H)})}function O(o,e){let n=[],c=new z(e,o),r=(...t)=>c.getLanguageServiceWorker(...t),s=new A(r);function d(){let{modeConfiguration:t}=o;if(_(n),t.completionItems)n.push(xe.registerCompletionItemProvider(e,new x(r)));if(t.signatureHelp)n.push(xe.registerSignatureHelpProvider(e,new L(r)));if(t.hovers)n.push(xe.registerHoverProvider(e,new S(r)));if(t.documentHighlights)n.push(xe.registerDocumentHighlightProvider(e,new I(r)));if(t.definitions)n.push(xe.registerDefinitionProvider(e,new T(s,r)));if(t.references)n.push(xe.registerReferenceProvider(e,new D(s,r)));if(t.documentSymbols)n.push(xe.registerDocumentSymbolProvider(e,new j(r)));if(t.rename)n.push(xe.registerRenameProvider(e,new E(s,r)));if(t.documentRangeFormattingEdits)n.push(xe.registerDocumentRangeFormattingEditProvider(e,new q(r)));if(t.onTypeFormattingEdits)n.push(xe.registerOnTypeFormattingEditProvider(e,new B(r)));if(t.codeActions)n.push(xe.registerCodeActionProvider(e,new F(r)));if(t.inlayHints)n.push(xe.registerInlayHintsProvider(e,new N(r)));if(t.diagnostics)n.push(new C(s,o,e,r))}return d(),r}function _(o){while(o.length)o.pop().dispose()}export{b as Adapter,F as CodeActionAdaptor,T as DefinitionAdapter,C as DiagnosticsAdapter,I as DocumentHighlightAdapter,q as FormatAdapter,f as FormatHelper,B as FormatOnTypeAdapter,N as InlayHintsAdapter,a as Kind,A as LibFiles,j as OutlineAdapter,S as QuickInfoAdapter,D as ReferenceAdapter,E as RenameAdapter,L as SignatureHelpAdapter,x as SuggestAdapter,z as WorkerManager,M as flattenDiagnosticMessageText,Pt as getJavaScriptWorker,Vt as getTypeScriptWorker,_t as setupJavaScript,Ot as setupTypeScript};
|
|
12
|
-
|
|
13
|
-
//# debugId=9030420828D5214B64756E2164756E21
|
|
14
|
-
//# sourceMappingURL=tsMode-jg1dtphj.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{fi,Xm,yI,m,h,qr,pn,Da,Sr,Qm,i1,o1,oc,eg,tg,r1,s1,a1,ng,Sh,rc,Yp,bl,l1,Si,td,c1,wI,Cv,r0,xI,eu,_I,SI,Ft,kv,CI,kI}from"./studio-knsjyx7n.js";import"./studio-swedpd82.js";import"./studio-sce30r7b.js";import"./studio-q9hx2qp0.js";import"./studio-4fnb5648.js";import"./studio-nvcn2ykc.js";export{yI as MAX_PANES,fi as PRIMARY_PANE,Xm as SECONDARY_PANE,Ft as activateTab,qr as activePane,h as activeTab,l1 as clearPaneActiveTab,_I as closeAllTabs,eg as closePane,eu as closeTab,ng as detachTab,Sr as focusPane,Sh as insertIntoPane,Qm as isPaneFocused,Yp as isTabActive,xI as moveTab,kv as moveTabToPane,Si as openTab,o1 as paneBeside,pn as paneById,tg as paneIsEmpty,Da as paneOfTab,c1 as promoteDirtyPreviewTabs,td as promoteTab,oc as receivingPane,kI as registerTabCommands,CI as renameTab,SI as replaceAllTabs,a1 as setCloseLanding,wI as setEditBesideDocument,s1 as setEmptyPaneFallback,r0 as setTabPinned,r1 as setTabScope,rc as setWorkspaceProject,i1 as splitRight,Cv as tabHoldsEditBesideDocument,bl as tabIsLive,m as workspace};
|
|
2
|
-
|
|
3
|
-
//# debugId=325891B045F9C5F964756E2164756E21
|
|
4
|
-
//# sourceMappingURL=workspace-6ztqcrsh.js.map
|