@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
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{Wt,vl,ky,xn,ra,Jn,Aa,Sh,X,Zd,eu,mi,g,h,pn,ko,sg,_1,lc,ag,lg,id,$1,b_,HR,tu,Ft,Oy}from"./studio-ybkd5w8k.js";import{w,Sl}from"./studio-5k9mfafh.js";import{iu,rf}from"./studio-r85zw6ay.js";import{p}from"./studio-1b79rpcb.js";import{MA,gl,Ax,u,dy}from"./studio-3kmqhwtt.js";import{ae}from"./studio-dbex091t.js";import{qu,Zl}from"./studio-8vmad6x2.js";import{Tn,it,Kr,u1}from"./studio-yetr4gg1.js";import{Vt}from"./studio-zdbsv5q2.js";import{Gl,AS,Ab,HD,IT,NT,DT,OT}from"./studio-z89e6wpg.js";import{la,Ot}from"./studio-6tnpg0vx.js";import{Lp,Om,Ts,dO,Rp}from"./studio-qcc5hsw2.js";import{dl}from"./studio-qvb2jr83.js";import{bt,ey,nc,zc,ah,Mp,OC,Hi}from"./studio-m25ry0mf.js";import{bl,Uo,Xs,Qs,qo}from"./studio-y2zsnzye.js";import{Ql,Pm,Dp}from"./studio-a4ymg4vd.js";import{Bu,uT}from"./studio-gahswxp4.js";import{hi}from"./studio-8atmfjjm.js";import{ST}from"./studio-dj8ctxey.js";import{Js,ll}from"./studio-pafmb06w.js";import{ed}from"./studio-meajkr51.js";import{of,x,wn,_l}from"./studio-anc8067x.js";import{gf,E,I}from"./studio-xxttcym1.js";import{Me,E_}from"./studio-4xadhxj1.js";import{me,te,b}from"./studio-y3tjh2xb.js";import{Ni}from"./studio-213pyfxh.js";import{n,qe,f}from"./studio-0z8kp4xk.js";import{ce}from"./studio-nhpg405j.js";var Ie={$schema:"https://jxsuite.com/schema/v1",$id:"StudioEmptyState",$description:"The one empty-state pattern (studio-ui-guidelines.md §11), as the document every region draws it from. Nine surfaces had already copied it into their own JSON — the Source Control panel's (since folded into `publish-workspace.json`), `logic-panel.json`, `panel-outline.json` and the rest each carry a `[part=\"empty\"]` block written from the same rules — because `panels/empty-state.ts` is a lit template a document cannot call. This is the copy those were waiting for: the region that has NO document of its own hands its box to this one instead of rendering the helper, so a shell with three surfaces still lit and eight converted has one empty state rather than two. The copy rules stay where they are stated, in `panels/empty-state.ts`'s header: one sentence saying what the region is FOR, the action that fills it, and one shared verb across equivalent surfaces. Nothing here decides any of them — the adapter is handed a message, an optional second sentence and a list of buttons, and this draws exactly that.",tagName:"div",attributes:{part:"empty","data-compact":"${state.compact ? '' : null}"},style:{$description:"What `.empty-state`, `.empty-state--teach`, `.empty-state-message`, `.empty-state-detail`, `.empty-state-actions`, `.empty-state-action` and the `--compact` pair said across `styles/overlays.css` and `styles/panels.css`, keyed on `part`. Neither stylesheet loses its rules: `ui/expression-editor.ts` still renders the lit helper for its own compact state, so this is a copy until that surface converts. Two values did not travel. `.empty-state`'s `font-size: 13px` was a number nothing else in the shell uses and is the kit's `--jx-text-md`; `.empty-state-detail`'s `var(--spectrum-font-size-50, 11px)` resolves only inside `<sp-theme>`, and a document mounted into a Navigator body or a canvas stage is outside it, so it would silently have taken its hard-coded fallback on every paint — it is `--jx-text-sm`, which is the step it was.",display:"flex",flexDirection:"column",alignItems:"center",gap:"var(--jx-space-3)",padding:"var(--jx-space-6)",textAlign:"center",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)",'& [part="empty-message"]':{margin:"0",maxWidth:"34ch",lineHeight:"1.5"},'& [part="empty-detail"]':{$description:"The second sentence: where the region's content comes from. Dimmer than the first, because the first is the one a reader has to take in.",margin:"0",maxWidth:"34ch",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)",opacity:"0.8"},'& [part="empty-actions"]':{display:"flex",flexWrap:"wrap",justifyContent:"center",gap:"var(--jx-space-3)"},'& [part="empty-action"]':{flex:"none"},"&[data-compact]":{$description:"An inline section inside an otherwise populated panel — tighter and left-aligned, because it sits directly above its own add form rather than filling a region on its own.",alignItems:"flex-start",gap:"var(--jx-space-2)",padding:"var(--jx-space-3) var(--jx-space-4)",textAlign:"left",fontSize:"var(--jx-text-sm)"},'&[data-compact] [part="empty-actions"]':{justifyContent:"flex-start"}},children:[{tagName:"p",attributes:{part:"empty-message"},textContent:"${state.message}"},{tagName:"div",attributes:{part:"empty-detail-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasDetail"},cases:{true:{tagName:"p",attributes:{part:"empty-detail"},textContent:"${state.detail}"}}},{tagName:"div",attributes:{part:"empty-actions-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasActions"},cases:{true:{tagName:"div",attributes:{part:"empty-actions"},children:[{$prototype:"Array",items:{$ref:"#/state/actions"},key:{$ref:"$map/item/id"},map:{tagName:"jx-button",attributes:{part:"empty-action"},$props:{size:"sm",variant:"secondary",disabled:{$ref:"$map/item/disabled"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/runAction"},value:[{$ref:"$map/item/id"}]}]},children:[{tagName:"span",textContent:"${$map.item.label}"}]}}]}}}]};E("empty-state",Ie);function Tt(e){let t=document.createElement("div");t.style.display="contents";let a=[],r=b({...Ce(e),runAction:(s)=>{a[Number(s)]?.()}});a=Oe(e);let i=null,o=!1;return I("empty-state",r,t).then((s)=>{if(o){s.dispose();return}i=s}),{dispose(){o=!0,i?.dispose(),i=null,t.replaceChildren()},host:t,update(s){a=Oe(s),Object.assign(r,Ce(s))}}}function Ce(e){let t=e.actions??[];return{actions:t.map((a,r)=>({disabled:Boolean(a.disabled),id:String(r),label:a.label})),compact:Boolean(e.compact),detail:e.detail??"",hasActions:t.length>0,hasDetail:(e.detail??"")!=="",message:e.message}}function Oe(e){return(e.actions??[]).map((t)=>t.run)}var Fe=new WeakMap;function ju(e,t){let a=Fe.get(e);if(a)return a.update(t),a.host;let r=Tt(t);return Fe.set(e,r),r.host}var kt=new Set(["entry"]);function pb(e){let t=vl(e.id);if(t)return t;let a=e.session.ui.canvasMode;if(a==="git-diff")return"publish";if(a==="media"||a==="image")return"media";if(kt.has(a))return"content";let r=Ql(e.id);if(r)return r.kind==="data"?"design":"content";if(Ni(e.documentPath))return"styles";return Jn(e.documentPath)?"content":"design"}var Et=new Set(["edit","design","stylebook"]);function DE(e){return e.documentPath!==null&&Ql(e.id)===null&&Et.has(e.session.ui.canvasMode)}function Mc(e,t=u.workspace){let a=g.tabs.get(e);return a!==void 0&&pb(a)===t}function ne(e,t=u.workspace){return e.tabOrder.filter((a)=>Mc(a,t))}function VN(e){let t=g.mruOrder.find((a)=>Mc(a,e));if(t)return t;for(let a of g.panes){let r=a.tabOrder.find((i)=>Mc(i,e));if(r)return r}return null}function OE(e,t){if(e.activeTabId&&Mc(e.activeTabId,t))return e.activeTabId;return g.mruOrder.find((a)=>e.tabOrder.includes(a)&&Mc(a,t))??e.tabOrder.find((a)=>Mc(a,t))??null}var Le={$schema:"https://jxsuite.com/schema/v1",$id:"StudioTabStrip",$description:"One pane's tab strip, as a Jx document over the kit: a real `tablist` of `jx-tab`s, or — for a pane that owns no document — the derivation chip naming what it is a projection of, and in both cases one trailing button. `panels/tab-strip.ts` keeps every decision: which pane a host is drawing, what each tab is called (the shortest unique suffix, and a page's ROUTE), what its tooltip says, whether closing it needs a prompt, what the overflow chevron lists and what the context menu offers. This document owns the markup, the ARIA, the keyboard and the style, and it holds THREE things the old chip drew by hand and the kit now draws: the tab's own selected state (`aria-selected`, not an `.active` class), its close button, and its dirty dot. The three that are Studio's alone go in `jx-tab`'s slots — the drill-in marker in `icon`, the hold pill in `status`, the pin toggle in `actions` (ui.md §5.4) — which is the gap that kept this strip out of the tab pattern until now. **Drag is `@atlaskit/pragmatic-drag-and-drop`, not native HTML5 DnD**: a chip carries no `draggable` attribute and no `ondrag*` handler, because `panels/tab-strip.ts` registers every chip and every strip as a pragmatic source/target through `onNodeCreated` and resolves a completed drag in `panels/tab-drop.ts`. What is left here is three SCOPE comparisons, exactly as `files-panel.json` marks a row under drag: `data-dragging` on the chip being carried, `data-drop` on the chip a drop would land beside, `data-drop-tail` on the strip when the drop is its empty tail.",tagName:"div",attributes:{part:"strip-row","data-focused":"${state.focused ? '' : null}",hidden:"${state.mode === 'empty' ? '' : null}"},onmousedown:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/focusPane"},value:[]}]},style:{$description:"`styles/shell.css`'s `.tab-strip*` rules and `styles/canvas.css`'s pane-state rules, keyed on `part` and carried in. What did NOT come with them is the point: the chip's own hover, its selected underline, its close button and its dirty dot are `jx-tab`'s, and the strip's flex row and hairline are `jx-tabs`'s. What is left here is the pane strip's own shape — the scroll container the chevron exists for, the 11px type of a chrome row, the states the PANE model adds (pinned, preview, dragging, an unfocused pane's dimmed underline), and the three slotted marks.",display:"flex",alignItems:"stretch",minWidth:"0",background:"var(--bg-panel)",borderBottom:"1px solid var(--border)",fontFamily:"var(--jx-font-sans)","&[hidden]":{display:"none"},'& [part="tabs"]':{$description:"`.tab-strip`. The kit's strip draws its own hairline; the ROW draws this one, so the strip's is taken off rather than doubled. The scrollbar is hidden by design — the wheel handler is a mouse affordance and the chevron is the pointer-independent route to the same tabs — so `overflow-x: auto` here is a scrolling box with no visible bar.",flex:"1 1 auto",minWidth:"0",gap:"0",padding:"0 var(--jx-space-2)",border:"0",overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none",fontSize:"var(--jx-text-sm)","&::-webkit-scrollbar":{display:"none"}},'& [part="tabs"][data-drop-tail]::after':{$description:"The strip's own tail target: a drop onto the empty space after the last chip, or onto a pane whose strip carries no chips at all — an empty pane made a target during a drag by `panels/tab-strip.ts`'s `project`. A fixed-width bar rather than a background tint, so it reads the same as a chip's own `data-drop` edge instead of a second visual language for the same gesture.",content:'""',flex:"0 0 2px",alignSelf:"stretch",background:"var(--accent)"},'& [part="tab"]':{$description:"`.tab-strip-tab`. The kit's tab caps itself at 220px and reserves a control's height; a chrome row is tighter than that and its labels are the shortest unique suffix, so both are re-declared. `flex-shrink: 0` is what makes the strip scroll rather than squeeze fifteen documents into one width.",gap:"var(--jx-space-1)",padding:"4px var(--jx-space-2)",minHeight:"0",maxWidth:"none",flexShrink:"0",marginBlockEnd:"0",color:"var(--fg-dim)",cursor:"pointer",":hover":{color:"var(--fg)",background:"var(--hover-bg)"},'&[aria-selected="true"]':{color:"var(--fg)",borderBlockEndColor:"var(--accent)"},"&[data-dragging]":{opacity:"0.4"},"&[data-drop]":{$description:"The chip a drop would land BESIDE. An inset shadow rather than a border, so the indicator draws no layout shift mid-drag — the same reason `files-panel.json`'s row indicators are backgrounds rather than borders.",boxShadow:"inset 2px 0 0 var(--accent)"}},'& [part="tab"] [part="label"]':{maxWidth:"140px"},'& [part="tab"][data-preview] [part="label"]':{fontStyle:"italic"},'&:not([data-focused]) [part="tab"][aria-selected="true"]':{$description:"The unfocused pane's strip still says which of ITS documents is current, in a colour that does not compete with the pane holding the keyboard.",borderBlockEndColor:"var(--border)"},'& [part="tab"] [part="close"]':{$description:"`.tab-strip-close`'s reveal, applied to the kit's own close button: a row of fifteen ✕ glyphs is noise, so the affordance appears on the tab under the pointer and on the current one. The button keeps its own 24px target either way (SC 2.5.8) — this moves no pixel of layout.",opacity:"0"},'& [part="tab"]:hover [part="close"], & [part="tab"][aria-selected="true"] [part="close"]':{opacity:"1"},'& [part="origin"]':{$description:"`.tab-strip-origin` — the drill-in marker, in `jx-tab`'s icon slot. Hidden from assistive technology by the document that writes it: a reader hears where a document was opened from in the tooltip, and an arrow announced beside a file name says nothing.",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)",lineHeight:"1"},'& [part="pill"]':{$description:'`.entry-pill` — the hold pill (site-architecture.md §7.6), in `jx-tab`\'s status slot. It is ON THE CHIP and not only inside the entry editor because the mistake it prevents, publishing something you believed was private, is made while glancing at a row of tabs. "Published" is deliberately as visible as "Draft": a state you can only see one half of is a state you cannot check. The two Spectrum colours it used to name are `--jx-signal` against `--jx-bg`, which flips with the theme where a fixed yellow and a fixed black did not.',padding:"0 5px",borderRadius:"var(--radius)",background:"var(--bg)",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)",lineHeight:"15px",whiteSpace:"nowrap"},'& [part="pill"][data-held]':{background:"var(--jx-signal)",color:"var(--jx-bg)"},'& [part="pin"]':{$description:"`.tab-strip-pin`, in `jx-tab`'s actions slot, on the current chip and on a pinned one (the rule below). A click on it never also selects the tab, and that is the KIT's doing now rather than a `stopPropagation` this document has to remember: `jx-tab` stops a click inside its actions slot exactly as it stops one on its own close button.",display:"flex",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",padding:"0",border:"none",background:"none",color:"var(--fg-dim)",font:"inherit",fontSize:"var(--jx-text-md)",lineHeight:"1",borderRadius:"var(--radius)",cursor:"pointer",":hover":{background:"var(--hover-bg)",color:"var(--fg)"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"-1px"}},'& [part="tab"]:not([aria-selected="true"]):not([data-pinned]) [part="pin"]':{$description:"An inactive, unpinned chip draws no pin and keeps no box for one. It was `opacity: 0` here and revealed on hover, so the invisible button still took 16px of the chip and every click on it: the centre of a short chip (the Media home's, beside its viewer tab) was the pin, so the click toggled a pin nobody could see and the tab did not activate. A box that takes clicks is a control, and a control is either shown or absent. The current chip shows its pin, a pinned chip shows its mark, and any chip pins from its context menu (`document.togglePinned`).",display:"none"},'& [part="tab"][data-pinned] [part="pin"]':{color:"var(--accent)"},'& [part="derivation"]':{$description:"A LENS pane's strip: one chip naming the projection and the document it projects, where an ordinary pane draws tab chips. It is not a tab and must not look like one — no close ✕ of its own, because a lens owns no document to close. Its vertical box is a tab chip's, `4px` top and bottom plus the 2px underline `[part=\"tab\"]` reserves, so the lens's one-chip row sits on the same baseline grid as the tab row in the pane beside it; `tab-strip.test.ts` compares the two declarations rather than the two boxes, because happy-dom lays nothing out and a 19px strip against a 28px one is the class of defect only a picture catches. Horizontally it is 10px rather than a chip's 8px: this row is one chip wide with nothing to sit beside, and a chip's tighter inset exists so several of them read as a series.",display:"flex",flex:"1 1 auto",alignItems:"baseline",gap:"6px",minWidth:"0",padding:"4px 10px",borderBottom:"2px solid transparent",whiteSpace:"nowrap",overflow:"hidden"},'& [part="preset"]':{color:"var(--fg)",fontSize:"var(--jx-text-md)"},'& [part="subject"]':{color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)",textOverflow:"ellipsis",overflow:"hidden"},'& [part="overflow"]':{$description:"`.tab-strip-overflow`. It sits OUTSIDE the scrolling strip, so it stays reachable at any scroll offset — which is the whole point of it. One button draws both trailing affordances, because they are the same control in the same place: the chevron that lists the tabs currently out of view, and, on a derived pane, the ✕ that is a lens's only exit.",flex:"0 0 auto",display:"flex",alignItems:"center",justifyContent:"center",width:"22px",padding:"0",border:"none",borderLeft:"1px solid var(--border)",background:"none",color:"var(--fg-dim)",font:"inherit",fontSize:"var(--jx-text-lg)",lineHeight:"1",cursor:"pointer",":hover":{background:"var(--hover-bg)",color:"var(--fg)"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"-2px"}},'& [part="overflow"][hidden]':{display:"none"}},children:[{$description:"One row draws one pane, and a pane is either a set of open documents or a projection of somebody else's. A third answer — a pane with neither — draws nothing at all, which is the case with no branch here: the row itself is `hidden`.",tagName:"div",attributes:{part:"body"},style:{$description:"The switch container generates no box: the branch inside it IS the row's flex item, so a lens chip and a tab strip sit at the same depth and take the same `flex` the row gives them.",display:"contents"},$switch:{$ref:"#/state/mode"},cases:{tabs:{tagName:"jx-tabs",attributes:{part:"tabs",label:"${state.stripLabel}",selected:"${state.active}","data-drop-tail":"${state.dropTail ? '' : null}"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/activate"},value:[{$ref:"event#/detail"}]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closeTab"},value:[{$ref:"event#/detail"}]}]},onwheel:{$ref:"#/state/wheel"},children:[{$prototype:"Array",items:{$ref:"#/state/tabs"},key:{$ref:"$map/item/key"},map:{tagName:"jx-tab",attributes:{part:"tab","data-tab":"${$map.item.key}",value:"${$map.item.key}",label:"${$map.item.label}",title:"${$map.item.title}",closable:"",dirty:"${$map.item.dirty ? '' : null}","data-pinned":"${$map.item.pinned ? '' : null}","data-preview":"${$map.item.preview ? '' : null}","data-dragging":"${state.dragKey === $map.item.key ? '' : null}","data-drop":"${state.dropIndex === $map.item.index ? '' : null}"},ondblclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/promote"},value:[{$ref:"$map/item/key"}]}]},onauxclick:{$prototype:"Function",body:[{if:{operator:"===",target:{$ref:"event#/button"},value:1},then:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/closeTab"},value:[{$ref:"$map/item/key"}]}]}]},oncontextmenu:{$prototype:"Function",body:[{preventDefault:!0},{stopPropagation:!0},{operator:"call",target:{$ref:"#/state/context"},value:[{$ref:"$map/item/key"},{$ref:"event#/clientX"},{$ref:"event#/clientY"}]}]},children:[{$description:"The drill-in marker: this document was opened FROM another one. `jx-tab`'s icon slot draws it before the label, which is where it has always been.",tagName:"span",attributes:{slot:"icon",part:"origin","aria-hidden":"true",hidden:"${$map.item.origin ? null : ''}"},textContent:"↳"},{$description:"The hold pill. It is a `<span>` in the status slot rather than a mounted document of its own, which is what kept it a lit fragment inside `content/entry-editor.ts` until the strip converted: a document mounted per chip would be an async mount inside a synchronous rebuild. `entryHoldPill` states the two facts; this draws them.",tagName:"span",attributes:{slot:"status",part:"pill",title:"${$map.item.pillTitle}","data-held":"${$map.item.held ? '' : null}",hidden:"${$map.item.pill ? null : ''}"},textContent:"${$map.item.pill}"},{$description:"The pin, in the actions slot. `title` is the whole accessible name (studio-ui-guidelines.md §10): the glyph is hidden, so a matching `aria-label` would announce it twice. `tabindex` follows the tab's own selectedness, exactly as the close button's does — the strip is ONE stop in the tab order, and a control inside every chip that took the platform's default would make fifteen.",tagName:"button",attributes:{slot:"actions",part:"pin",type:"button",title:"${$map.item.pinTitle}",tabindex:"${$map.item.tabindex}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/togglePin"},value:[{$ref:"$map/item/key"}]}]},children:[{tagName:"span",attributes:{part:"pin-glyph","aria-hidden":"true"},textContent:"${$map.item.pinGlyph}"}]}]}}]},derivation:{$description:`THE CHIP FINISHES ITS OWN SENTENCE, and both halves are the flow's: two of the presets are labelled with an unfinished phrase — "Same page at", "Same page in" — because the interesting half is the value, and a chip whose source pane shows nothing says "no document" rather than trailing off.`,tagName:"div",attributes:{part:"derivation",title:"${state.chipTitle}"},children:[{tagName:"span",attributes:{part:"preset"},textContent:"${state.preset}"},{tagName:"span",attributes:{part:"subject"},textContent:"${state.subject}"}]}}},{tagName:"button",attributes:{part:"overflow",type:"button",title:"${state.trailingTitle}",hidden:"${state.trailing ? null : ''}"},onclick:{$prototype:"Function",body:[{stopPropagation:!0},{operator:"call",target:{$ref:"#/state/openTrailing"},value:[{$ref:"event#/currentTarget"}]}]},children:[{tagName:"span",attributes:{part:"overflow-glyph","aria-hidden":"true"},textContent:"${state.trailingGlyph}"}]}]};E("tab-strip",Le);function Nt(e){let t=n(e)?void 0:e.attributes?.part;return n(t)?t:""}function Ht(e){let t=e?.$map,a=f(t)?t.item:void 0,r=f(a)?a.key:void 0;return n(r)?r:""}function Ae(e,t,a){let r=b({...t,...a,dragKey:"",dropIndex:-1,dropTail:!1});e.replaceChildren();let i=null,o=!1,s=null;return I("tab-strip",r,e,{onNodeCreated:(l,c,d,m)=>{if(o||!(l instanceof HTMLElement))return;let y=Nt(d);if(y==="tabs"){s=l,a.stripHost(l);return}if(y==="tab"){let S=Ht(m);if(S)a.chipHost(l,S)}}}).then((l)=>{if(o){l.dispose();return}i=l}),{dispose(){o=!0,i?.dispose(),i=null,s=null,e.replaceChildren()},drag(l){r.dragKey=l.dragKey,r.dropIndex=l.dropIndex,r.dropTail=l.dropTail},strip:()=>s,update(l){r.focused=l.focused,r.stripLabel=l.stripLabel,r.active=l.active,r.tabs=l.tabs,r.preset=l.preset,r.subject=l.subject,r.chipTitle=l.chipTitle,r.trailing=l.trailing,r.trailingTitle=l.trailingTitle,r.trailingGlyph=l.trailingGlyph,r.mode=l.mode}}}function De(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),a.push.apply(a,r)}return a}function Re(e){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?arguments[t]:{};t%2?De(Object(a),!0).forEach(function(r){bl(e,r,a[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):De(Object(a)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(a,r))})}return e}var jt={top:function e(t,a){return Math.abs(a.y-t.top)},right:function e(t,a){return Math.abs(t.right-a.x)},bottom:function e(t,a){return Math.abs(t.bottom-a.y)},left:function e(t,a){return Math.abs(a.x-t.left)}};function fe(e,t){var a,r,{element:i,input:o,allowedEdges:s}=t,l={x:o.clientX,y:o.clientY},c=i.getBoundingClientRect(),d=s.map(function(y){return{edge:y,value:jt[y](c,l)}}),m=(a=(r=d.sort(function(y,S){return y.value-S.value})[0])===null||r===void 0?void 0:r.edge)!==null&&a!==void 0?a:null;return Re(Re({},e),{},bl({},re,m))}function he(e){var t;return(t=e[re])!==null&&t!==void 0?t:null}var re=Symbol("closestEdge");function _e(e){var{startIndex:t,closestEdgeOfTarget:a,indexOfTarget:r,axis:i}=e;if(t===-1||r===-1)return t;if(t===r)return t;if(a==null)return r;var o=i==="vertical"&&a==="bottom"||i==="horizontal"&&a==="right",s=t<r;if(s)return o?r:r-1;return o?r+1:r}function Fu(e){return f(e)&&(e.type==="tab"||e.type==="file-tree"&&e.entryType==="file")}function ge(e,t,a){if(pn(t)?.derived)uT(t);if(!Oy(e,t,a))return;id(e),Ft(e)}async function It(e,t,a){let r=[...g.tabs.values()].find((o)=>o.documentPath===e);if(r){ge(r.id,t,a);return}await hi(e,{focus:!0,paneId:t});let i=[...g.tabs.values()].find((o)=>o.documentPath===e);if(i)ge(i.id,t,a)}function Je(e,t){if(e.tabId===void 0)return e.index;return t==="left"?e.index:e.index+1}async function Mt(e,t){let a=he(t);if(e.type==="tab"){if(e.paneId===t.paneId){let r=pn(t.paneId);if(!r)return;let i=r.tabOrder.indexOf(e.tabId);if(i===-1)return;let o=t.tabId===void 0?r.tabOrder.length-1:_e({axis:"horizontal",closestEdgeOfTarget:a,indexOfTarget:t.index,startIndex:i});if(o!==i)HR(e.tabId,o);return}ge(e.tabId,t.paneId,Je(t,a));return}await It(e.path,t.paneId,Je(t,a))}async function Ct(e,t){if(e.type==="tab"){if(_1(e.tabId))id(e.tabId);return}let a=lc(t.paneId);if(await hi(e.path,{paneId:a.id}),![...g.tabs.values()].some((i)=>i.documentPath===e.path)&&lg(a))ag(a.id)}async function Ve(e,t){if(!t||!Fu(e.data))return;let a=e.data;if(t.data.type==="tab-slot"){await Mt(a,t.data);return}if(t.data.type==="pane-edge")await Ct(a,t.data)}var we=null,ie=null,z=new Map,_=new Map,k=new Map,L=new Map,O=new Map,J=null,j=null,N=null,U=new Map,oe=new Map,ve=null;function Lt(e){return`pane.${e}/tabs`}function At(e){return gf(Lt(e.id))??we}function WN(e){Dt(),we=e,ve=Qs({onDragStart({source:t}){if(!Fu(t.data))return;j=t.data.type==="tab"?{kind:"tab",tabId:t.data.tabId}:{kind:"file",path:t.data.path},be(),ye()},onDrag({location:t}){if(!j)return;let[a]=t.current.dropTargets,r=a?.data;N=r?.type==="tab-slot"?{index:r.tabId===void 0?-1:r.index,paneId:r.paneId,tail:r.tabId===void 0}:null,ye()},onDrop({location:t,source:a}){if(!Fu(a.data))return;let[r]=t.current.dropTargets;j=null,N=null,ye(),be(),Ve(a,r)}}),ie=me(),ie.run(()=>{te(()=>{g.activePaneId;for(let t of g.panes)t.id,t.tabOrder,t.activeTabId;u.workspace;for(let t of g.tabs.values()){t.session.ui.canvasMode,t.doc.dirty,dl(t),t.documentPath,t.pinned,t.preview,t.session.openedFrom;for(let a of dO(ll(t.documentPath)?.def))t.doc.content.frontmatter[a]}$1(),be()})})}function Dt(){Jt(),Se(),ze(),ie?.stop(),ie=null,ve?.(),ve=null;for(let e of k.keys())$e(e);for(let e of k.values())e.dispose();k.clear(),L.clear(),we=null,j=null,N=null,z.clear(),O.clear(),_.clear()}function $e(e){let t=U.get(e);if(t){for(let a of t.values())a();U.delete(e)}oe.get(e)?.(),oe.delete(e)}function be(){let e=dy(),t=new Map;for(let r of g.panes){let i=At(r);if(i&&(!t.has(i)||sg(r.id)))t.set(i,r)}let a=new Set;for(let[r,i]of t){if(e||i.derived)Rt(i,r);_.set(i.id,r),a.add(i.id)}for(let[r,i]of _){if(a.has(r))continue;if(_.delete(r),z.delete(r),O.delete(r),!t.has(i))$e(i),k.get(i)?.dispose(),k.delete(i),L.delete(i)}}function Rt(e,t){let a=We(e);L.set(t,{mode:a.mode,paneId:e.id});let r=k.get(t);if(r)r.update(a);else k.set(t,Ae(t,a,Ut(t)));if(Xt(t,a),k.get(t)?.strip()&&e.activeTabId!==z.get(e.id))z.set(e.id,e.activeTabId),le.add(t);_t(t)}var V=new Map,le=new Set;function _t(e){if(V.has(e))return;V.set(e,requestAnimationFrame(()=>{V.delete(e);let t=F(e);if(t&&dy())zt(t,e);le.delete(e)}))}function Jt(){for(let e of V.values())cancelAnimationFrame(e);V.clear(),le.clear()}function zt(e,t){let a=k.get(t)?.strip();if(a&&le.has(t))[...a.children].find((r)=>r instanceof HTMLElement&&r.dataset.tab===e.activeTabId)?.scrollIntoView({block:"nearest",inline:"nearest"});Zt(e,t)}function F(e){let t=L.get(e)?.paneId;return g.panes.find((a)=>a.id===t)??null}function Ut(e){return{activate:(t)=>{Ft(t)},chipHost:(t,a)=>{Kt(e,t,a)},closeTab:(t)=>{fb(t)},context:(t,a,r)=>{let i=g.tabs.get(t);if(i)sa(i,a,r)},focusPane:()=>{ko(F(e)?.id??mi)},openTrailing:(t)=>{Qt(e,t)},promote:(t)=>{id(t)},stripHost:(t)=>{Yt(e,t)},togglePin:(t)=>{let a=g.tabs.get(t);if(a)b_(t,!a.pinned)},wheel:(t,a)=>{ea(a)}}}function Bt(e,t){let a=ae(),r=bt(e.id)??bt(t.sourcePaneId),i=t.kind==="lens"&&t.preset==="breakpoint"?`${Bu.breakpoint} ${t.media?Hi(t.media):"Base"}`:t.kind==="companion"&&t.preset==="locale"?`${Bu.locale} ${t.locale?Wt(t.locale):"—"}`:Bu[t.preset],o=r?Id(r):"no document";return{active:"",chipTitle:`${i} · ${r?.documentPath??"no document"}`,focused:sg(e.id),mode:"derivation",preset:i,stripLabel:se(e),subject:o,tabs:[],trailing:!0,trailingGlyph:"✕",trailingTitle:a?.get("pane.unsplit")?.title??"Close Side Pane"}}function se(e){return e.id===mi?"Open documents":"Open documents in the side pane"}function Gt(e){return{active:"",chipTitle:"",focused:sg(e.id),mode:"empty",preset:"",stripLabel:se(e),subject:"",tabs:[],trailing:!1,trailingGlyph:"",trailingTitle:""}}function We(e){let{derived:t}=e,a=ne(e);if(t&&a.length===0)return Bt(e,t);if(a.length===0){if(j)return{active:"",chipTitle:"",focused:sg(e.id),mode:"tabs",preset:"",stripLabel:se(e),subject:"",tabs:[],trailing:!1,trailingGlyph:"⌄",trailingTitle:"Show hidden tabs"};return z.set(e.id,null),O.set(e.id,!1),Gt(e)}let r=Ue(e);return{active:e.activeTabId??"",chipTitle:"",focused:sg(e.id),mode:"tabs",preset:"",stripLabel:se(e),subject:"",tabs:a.flatMap((i)=>qt(e,i,e.tabOrder.indexOf(i),r)),trailing:O.get(e.id)===!0,trailingGlyph:"⌄",trailingTitle:"Show hidden tabs"}}function qt(e,t,a,r){let i=g.tabs.get(t);if(!i)return[];let o=HD(i);return[{dirty:i.doc.dirty||dl(i),held:o?.held??!1,index:a,key:t,label:r.get(t)??"Untitled",origin:Boolean(i.session.openedFrom),pill:o?.text??"",pillTitle:o?.title??"",pinGlyph:i.pinned?"◉":"◎",pinTitle:i.pinned?"Unpin":"Pin",pinned:i.pinned,preview:i.preview,tabindex:t===e.activeTabId?"0":"-1",title:ca(i)}]}function Kt(e,t,a){let r=U.get(e);if(!r)r=new Map,U.set(e,r);r.get(a)?.();let i=Uo(qo({element:t,canDrag({input:o}){let s=E_(o.clientX,o.clientY);return!(s instanceof Element&&s.closest('[part="pin"], [part="close"]'))},getInitialData(){return{paneId:F(e)?.id,tabId:a,type:"tab"}}}),Xs({canDrop({source:o}){return Fu(o.data)},element:t,getData({element:o,input:s}){let l=F(e);if(!l)return{type:"tab-slot-refused"};return fe({index:l.tabOrder.indexOf(a),paneId:l.id,tabId:a,type:"tab-slot"},{allowedEdges:["left","right"],element:o,input:s})}}));r.set(a,i)}function Yt(e,t){oe.get(e)?.();let a=Xs({canDrop({source:r}){return Fu(r.data)},element:t,getData(){let r=F(e);return r?{index:r.tabOrder.length,paneId:r.id,type:"tab-slot"}:{type:"tab-slot-refused"}}});oe.set(e,a)}function Xt(e,t){if(t.mode!=="tabs"){$e(e);return}let a=new Set(t.tabs.map((i)=>i.key)),r=U.get(e);if(!r)return;for(let[i,o]of r)if(!a.has(i))o(),r.delete(i)}function ye(){let e=j?.kind==="tab"?j.tabId:"";for(let[t,a]of L){let r=k.get(t);if(!r)continue;let i=N!==null&&N.paneId===a.paneId;r.drag({dragKey:e,dropIndex:i&&N?N.index:-1,dropTail:i&&N?N.tail:!1})}}function Zt(e,t){let a=k.get(t),r=a?.strip();if(!a||!r)return;let i=r.scrollWidth>r.clientWidth;if(i!==(O.get(e.id)===!0))O.set(e.id,i),a.update(We(e))}function Qt(e,t){let a=F(e);if(!a)return;if(L.get(e)?.mode==="derivation"){it("pane.unsplit",void 0,"Tabs");return}aa(a,Ue(a),t)}function ea(e){if(e.ctrlKey)return;let t=e.currentTarget;if(!(t instanceof HTMLElement)||t.scrollWidth<=t.clientWidth)return;let a=Math.abs(e.deltaX)>Math.abs(e.deltaY)?e.deltaX:e.deltaY;if(!a)return;e.preventDefault(),t.scrollLeft+=a}function ta(e=g.activePaneId){let t=g.panes.find((d)=>d.id===e),a=_.get(e),r=a?k.get(a)?.strip()??null:null;if(!t||!r)return[];let i=r.scrollLeft,o=i+r.clientWidth,s=[],l=ne(t),c=[...r.querySelectorAll('[part="tab"]')];for(let[d,m]of c.entries()){let y=l[d];if(y&&(m.offsetLeft<i||m.offsetLeft+m.offsetWidth>o))s.push(y)}return s}function Se(){J?.close(),J=null}function aa(e,t,a){Se();let r=ta(e.id),i=r.length>0?r:ne(e),o=Me(a??document.body);J=Vt({label:"Hidden tabs",onClosed:(s)=>{if(J===s)J=null},opener:a,place:(s)=>({x:Math.max(4,o.right-s.width),y:o.bottom}),placement:"block-end span-inline-start",region:"tab-overflow",rows:i.map((s)=>({checked:s===e.activeTabId?"true":"false",destructive:!1,disabled:!1,dividerAbove:!1,id:s,run:()=>{Ft(s)},title:t.get(s)??"Untitled"}))})}var W=null;function ze(){W?.close(),W=null}function na(e){let t={},a=Ts(ll(e.documentPath)?.def);if(a)t.hold=Gl(e)[a.field]!==!0;return t}function ia(e){let t=Object.entries(e),a=t.length===1?t[0]?.[1]:void 0;if(!qe(a))return;return a?"false":"true"}function oa(e){let t=ae();if(!t)return[];let a=na(e),r=[],i;for(let o of t.forPlacement("context/tab")){let s=o.args;if(!(s?.required??[]).every((S)=>(S in a)))continue;let l={};for(let S of Object.keys(s?.properties??{}))if(S in a)l[S]=a[S];let c=r.length>0&&o.group!==i;({group:i}=o);let d=t.disabledReason(o.id),m=ia(l),y={destructive:o.destructive===!0,dividerAbove:c,id:o.id,title:o.title};if(m!==void 0)y.checked=m;r.push(d===void 0?{...y,disabled:!1,run:()=>{Tn(t,o.id,l,"Tabs")}}:{...y,disabled:!0,requires:d})}return r}function sa(e,t,a){ze(),Se(),Ft(e.id);let r=oa(e);if(r.length===0)return;W=Vt({label:"Tab actions",onClosed:(i)=>{if(W===i)W=null},origin:{x:t,y:a},region:"tab",rows:r})}function fm(e){let t=e.replace(/^\.\//,"");if(!t.startsWith("pages/"))return null;let r=t.slice(6).replace(/\.[^./]+$/,"").split("/").filter((i)=>i!=="");if(r.at(-1)==="index")r.pop();return`/${r.join("/")}`}function da(e){let t=e.map((a)=>{let r=a.documentPath;if(!r)return{depth:0,fixed:!0,id:a.id,label:a.fallback,parts:[]};let i=fm(r);if(i!==null)return{depth:0,fixed:!0,id:a.id,label:i,parts:[]};let o=r.split("/").filter((s)=>s!==""&&s!==".");return{depth:1,fixed:!1,id:a.id,label:o.slice(-1).join("/")||r,parts:o}});for(;;){let a=new Map;for(let i of t){let o=a.get(i.label);if(o)o.push(i);else a.set(i.label,[i])}let r=!1;for(let i of a.values()){if(i.length<2)continue;for(let o of i){if(o.fixed||o.depth>=o.parts.length)continue;o.depth+=1,o.label=o.parts.slice(-o.depth).join("/"),r=!0}}if(!r)break}return new Map(t.map((a)=>[a.id,a.label]))}function Ue(e){return da(e.tabOrder.flatMap((t)=>{let a=g.tabs.get(t);return a?[{documentPath:a.documentPath,fallback:Pm(a.id)??ky(a.id)??"Untitled",id:t}]:[]}))}function ca(e){let t=e.documentPath||Pm(e.id)||ky(e.id)||"Untitled",a=e.session.openedFrom,r=a?.documentPath?`${t}
|
|
2
|
+
Opened from ${a.documentPath}`:t;return e.preview?`${r}
|
|
3
|
+
Preview — double-click to keep open`:r}function Id(e){let t=e.documentPath;if(!t)return Pm(e.id)??"Untitled";return fm(t)??t.split("/").at(-1)??t}function Be(e){let t=rf(e),a=dl(e);if(!e.doc.dirty&&!t&&!a)return!1;let r=xn(e);if(!r.active)return!0;if(ra(e))return!0;if(t||a)return!0;return r.peers.filter((o)=>o.state.focusedPath===e.documentPath).length===0}function xe(e){if(ra(e))return`You have read access to this session, so "${Id(e)}" has changes that were never published and have nowhere to be saved. Closing discards them.`;if(rf(e))return`"${Id(e)}" has text in its editor that the document could not be given — the `+"source does not parse, or a collaborator holds the source lock. Saving would write the file without it, so it is not offered. Closing discards that text.";return null}async function pa(e){let t=xe(e);if(t)return Kr("Changes Cannot Be Saved",t,{cancelLabel:"Keep Editing",confirmLabel:"Close Without Saving",destructive:!0});let a=await u1("Unsaved Changes",`"${Id(e)}" has unsaved changes.`,{discardLabel:"Close Without Saving"});if(a==="cancel")return!1;return a==="discard"||await Dp(e)}async function fb(e){let t=g.tabs.get(e);if(!t)return;if(await iu(t),!g.tabs.has(e))return;if(Be(t)&&!await pa(t))return;tu(e)}async function AE(e){let t=[...g.tabs.values()];for(let c of t)await iu(c);let a=[...g.tabs.values()].filter((c)=>Be(c));if(a.length===0)return!0;let r=a.length===1?`"${Id(a[0])}" has unsaved changes`:`${a.length} documents have unsaved changes`,i=a.filter((c)=>xe(c)!==null),o=a.filter((c)=>xe(c)===null),s=i.length===1?`"${Id(i[0])}"`:`${i.length} of them`;if(o.length===0)return Kr("Changes Cannot Be Saved",`${e} closes every open document, and ${r}. ${s} cannot be saved at all, so saving would leave work behind. Closing discards it.`,{cancelLabel:"Keep Editing",confirmLabel:"Close Without Saving",destructive:!0});let l=await u1("Unsaved Changes",i.length===0?`${e} closes every open document, and ${r}.`:`${e} closes every open document, and ${r}. ${s} cannot be saved at `+`all — saving writes the other ${o.length} and discards ${i.length===1?"that one":"those"}.`,{discardLabel:"Close Without Saving",saveLabel:i.length===0?"Save All":`Save ${o.length} of ${a.length}`});if(l==="cancel")return!1;if(l==="discard")return!0;for(let c of o)if(!await Dp(c))return!1;return!0}function Ge(e,t){if(!n(t)||t.trim()==="")return[...e];return[{attributes:{content:t,name:"description"},tagName:"meta"},...e]}function Ke(e,t,a){let r=e.doc.content.frontmatter,i=Sh(e.documentPath,t),o=i?.schema,s=o?.properties,l=new Set(o?.required||[]),c=[];if(s){for(let[d,m]of Object.entries(s)){if(a.has(d))continue;c.push({entry:m,field:d,value:r[d]})}for(let[d,m]of Object.entries(r)){if(s[d]||d.startsWith("$")||a.has(d))continue;c.push({entry:{type:qe(m)?"boolean":"string"},field:d,value:m})}}else for(let[d,m]of Object.entries(r)){if(d.startsWith("$")||a.has(d))continue;c.push({entry:{type:qe(m)?"boolean":"string"},field:d,value:m})}return{collection:i,fields:c,hasSchema:Boolean(s),requiredFields:l}}function B(e){return n(e)?e:""}function ua(e){return{checked:!1,hasNote:!1,hasThumb:!1,isSet:!1,kind:"text",label:e,note:"",options:[],placeholder:"",thumb:"",value:""}}function Ye(e,t,a,r,i){let o=e.replaceAll(/([A-Z])/g," $1").replace(/^./,(d)=>d.toUpperCase()),s=ua(o+(r.has(e)?" *":""));s.isSet=a!==void 0&&a!==""&&a!==!1;let l=(d)=>String(d)||void 0,c=qu(t);if(c!==null){let d=B(a),m=ST(c,i.rerender);if(s.kind="select",s.value=d,m===null)return s.options=[{label:"Loading…",value:d}],{parse:l,row:s};if("error"in m)return s.kind="text",s.hasNote=!0,s.note=`Could not list ${c} entries — ${m.error}`,{parse:l,row:s};let y=d!==""&&!m.ids.includes(d);if(s.options=[{label:"—",value:""},...y?[{label:`${d} — not found`,value:d}]:[],...m.ids.map((S)=>({label:S,value:S}))],m.ids.length===0)s.hasNote=!0,s.note=`No ${c} entries yet.`;return{parse:l,row:s}}if(t.type==="boolean")return s.kind="boolean",s.checked=Boolean(a),{parse:(d)=>d===!0?!0:void 0,row:s};if(t.type==="array")return s.value=Array.isArray(a)?a.join(", "):B(a),s.placeholder="comma, separated",{parse:(d)=>{let m=String(d);return m?m.split(",").map((y)=>y.trim()).filter(Boolean):void 0},row:s};if(Array.isArray(t.enum))return s.kind="select",s.value=B(a),s.options=[{label:"—",value:""},...t.enum.map((d)=>({label:d,value:d}))],{parse:l,row:s};if(Aa(t.format)){let d=B(a);return s.kind="media",s.value=d,s.hasThumb=d!==""&&la.has(Ot(d)),s.thumb=s.hasThumb?ed(d):"",{parse:l,row:s}}if(t.type==="number")return s.kind="number",s.value=a===void 0?"":String(a),{parse:(d)=>{let m=String(d).trim(),y=Number(m);return m===""||Number.isNaN(y)?void 0:y},row:s};return s.value=B(a),s.placeholder=t.format==="date"?"YYYY-MM-DD":"",{parse:l,row:s}}var Xe="https://fonts.googleapis.com/css2?",Ze=["https://fonts.googleapis.com","https://fonts.gstatic.com"];function uw(e){return e?.tagName==="link"&&e.attributes?.rel==="stylesheet"&&n(e.attributes.href)&&e.attributes.href.startsWith(Xe)}function Te(e){return e?.tagName==="link"&&e.attributes?.rel==="preconnect"&&n(e.attributes.href)&&Ze.includes(e.attributes.href)}function FN(e){let t=e.match(/family=([^&:]+)/);if(!t)return"";return decodeURIComponent(t[1].replaceAll("+"," "))}function jN(e){return`${Xe}family=${encodeURIComponent(e).replaceAll("%20","+")}&display=swap`}function HN(e){for(let t of Ze)if(!e.some((r)=>r?.tagName==="link"&&r.attributes?.rel==="preconnect"&&r.attributes.href===t)){let r={href:t,rel:"preconnect"};if(t==="https://fonts.gstatic.com")r.crossorigin="";e.push({attributes:r,tagName:"link"})}}function BN(e){if(!e.some((a)=>uw(a)))return e.filter((a)=>!Te(a));return e}var Qe={$schema:"https://jxsuite.com/schema/v1",$id:"StudioPanelPage",$description:"The Inspector's Page tab (specs/studio.md §6), the former Navigator Page panel: everything the open document says about itself before anybody reads its body — its frontmatter, the layout it is poured into, its title, description, viewport and icon, its OpenGraph card, and the raw `$head` tags no structured control owns. ONE row vocabulary across the first four sections, told apart by `kind`, because a Title, a Layout picker and a schema-driven frontmatter field differ in what they COMMIT rather than in what they look like — and what they commit is `panels/head-panel.ts`'s decision, reached by the row's `key`. Nothing here knows what a `$head` entry is, which of them are managed, what a content collection is or that a page has a layout: the flow hands over sections whose every field is already a string and this draws them. The Custom Tags section is the one different shape — a read-only list plus the form that adds to it — because those rows are markup a reader is being SHOWN rather than a value they are editing.",tagName:"div",attributes:{part:"page"},style:{$description:"The eleven `.imports-*` and four `.head-*` rules in `styles/panels.css` plus the row vocabulary the panel used to borrow from `styles/inspector.css` (`.style-row`, `.style-row-label`, `.set-dot`) and `styles/overlays.css` (`.media-picker`, `.media-picker-thumb`). The borrowed ones are TRANSCRIBED rather than shared, because a document emits no class, so a class cannot style it, and the lit panels that still draw a `.style-row` go on owning those rules until they convert. Four token repairs travel with them. `--spectrum-font-size-50` resolved only inside `<sp-theme>` and a document is mounted outside it, so every rule that read it would silently have taken its 11px fallback and stopped following the theme; each is `--jx-text-sm` here, and the two bare `10px` literals are `--jx-text-xs`. `.imports-count` read `--text-hint`, a name NO stylesheet in this package defines — an unresolvable custom property makes the whole declaration invalid at computed-value time, so the count has been inheriting its colour rather than taking the one written for it, and it says `--fg-dim`, which is what it was drawing anyway. And `.head-section-body .style-row > sp-textfield` reached INSIDE another component to widen it, which a part cannot do and no longer has to: `[part=\"widget\"]` is the field itself. Two things changed on purpose. THE CLEAR DOT IS A BUTTON — it was a `<span>` with a click handler and no role, so a row's only route to clearing its value could not be reached from the keyboard at all. AND THE ADD FORM IS STATE, not three `ref()` handles read at submit time: a document binding writes only when the scope moves, so the flow states what each field holds and clearing one after a successful add is a real change the runtime carries back.",display:"block",overflowY:"auto",padding:"var(--jx-space-2)",fontFamily:"var(--jx-font-sans)",color:"var(--fg)",'& [part="section"]':{marginBottom:"var(--jx-space-4)"},'& [part="section-header"]':{$description:'The uppercase band every section opens with. It is the only thing that ever styled a section title, which is why `[part="title"]` carries no declaration of its own: the weight, the size, the colour and the letter-spacing are all inherited from here.',display:"flex",alignItems:"center",gap:"6px",padding:"6px 8px 2px",fontSize:"var(--jx-text-sm)",fontWeight:"600",color:"var(--fg-dim)",textTransform:"uppercase",letterSpacing:"0.5px"},'& [part="count"]':{fontWeight:"400",color:"var(--fg-dim)"},'& [part="seo-button"]':{$description:"The door to Search appearance, pushed to the right edge of the band so the section still reads as a heading and the button as its affordance. The band's own uppercasing and tracking stop here: this is a sentence, not a heading.",marginLeft:"auto",textTransform:"none",letterSpacing:"normal"},'& [part="body"]':{padding:"0 var(--jx-space-2)"},'& [part="row"]':{$description:"studio-ui-guidelines.md §4.1's standard form row, stacked: the label sits above a control that takes the whole width. `min-width: 0` is what keeps it honest in a 240px dock (studio-ui-guidelines.md §4.6) — a field refuses to shrink below its own min-content without it.",display:"flex",flexDirection:"column",alignItems:"stretch",gap:"2px",padding:"2px 0",minWidth:"0"},'& [part="row-label"]':{display:"flex",alignItems:"center",gap:"4px",fontSize:"var(--jx-text-xs)",color:"var(--fg-dim)"},'& [part="chip"]':{$description:"studio-ui-guidelines.md §4.2's set dot: a 6px accent dot, drawn only where the value is set on this document, that clears it when pressed. A real `button` — it is pressable, and it is the row's only keyboard route to clearing — stripped of the chrome a button brings so the row still reads as a label with a dot beside it.",width:"6px",height:"6px",padding:"0",border:"none",borderRadius:"50%",background:"var(--accent)",cursor:"pointer",flexShrink:"0"},'& [part="chip"]:hover':{background:"var(--danger)"},'& [part="chip"]:focus-visible':{outline:"var(--jx-focus-ring)",outlineOffset:"2px"},'& [part="row-name"]':{$description:"The visible label, `aria-hidden` in the markup: every control in the row carries the same words as its own accessible name, so a label node in the tree as well would have each field announced twice. That is the trade the kit's naming makes — a control names itself — and it is also why this row needs no minted ids.",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="widget"]':{width:"100%",minWidth:"0"},'& [part="readout"]':{$description:"A derived value set as text in the field's place, monospaced because a URL is read character by character.",display:"block",padding:"2px 0",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontFamily:"var(--font-mono, monospace)",fontSize:"var(--jx-text-sm)"},'& [part="row-action"]':{alignSelf:"flex-start"},'& [part="note"]':{$description:"What the row could not find out — the entries of a referenced collection that is empty, or the reason listing it failed. A sentence under the control, in the row's own label size, so it reads as part of the field rather than as an error banner.",margin:"0",fontSize:"var(--jx-text-xs)",color:"var(--fg-dim)"},'& [part="media"]':{display:"flex",alignItems:"center",gap:"4px",minWidth:"0"},'& [part="media"] [part="widget"]':{flex:"1",minWidth:"0"},'& [part="thumb"]':{width:"24px",height:"24px",objectFit:"cover",borderRadius:"var(--radius)",border:"1px solid var(--border)",flexShrink:"0"},'& [part="list"]':{padding:"0 var(--jx-space-2)"},'& [part="tag-row"]':{display:"flex",alignItems:"center",gap:"4px",padding:"3px var(--jx-space-2)",borderRadius:"var(--radius)",fontSize:"var(--jx-text-sm)"},'& [part="tag-row"]:hover':{background:"var(--hover-bg)"},'& [part="tag-name"]':{fontWeight:"500",whiteSpace:"nowrap"},'& [part="tag-value"]':{$description:"What the tag says. It takes the row's slack and ellipses rather than wrapping, because a row is a line and a wrapped value would push the remove button off the one the eye is on. The `title` beside it is what makes the full text readable when it does.",flex:"1",minWidth:"0",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontFamily:"var(--font-mono, monospace)",fontSize:"var(--jx-text-xs)",color:"var(--fg-dim)"},'& [part="empty"]':{$description:"The compact teaching state, drawn here rather than by `panels/empty-state.ts`: that helper is a lit template, and a surface is a document or a lit template and never a mix. It keeps the compact variant's shape — left-aligned, above the add form that IS its action, so it offers no button of its own (empty-state rule 2's stated exception).",margin:"0",padding:"var(--jx-space-3) var(--jx-space-4)",maxWidth:"34ch",lineHeight:"1.5",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="add"]':{display:"flex",alignItems:"center",gap:"4px",padding:"var(--jx-space-2)"},'& [part="add"] [part="field"]':{flex:"1",minWidth:"0"},'& [part="tag-picker"]':{minWidth:"70px"}},children:[{$prototype:"Array",items:{$ref:"#/state/sections"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"section","data-section":"${$map.item.key}"},children:[{tagName:"div",attributes:{part:"section-header"},children:[{tagName:"span",attributes:{part:"title"},textContent:"${$map.item.title}"},{tagName:"div",attributes:{part:"seo-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasSeo"},cases:{true:{tagName:"jx-action-button",attributes:{part:"seo-button"},$props:{size:"sm",quiet:!0,label:"Search appearance",hint:"Preview how this page appears in search and when shared"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openSeo"},value:[]}]},children:[{tagName:"span",textContent:"Search appearance…"}]}}}]},{tagName:"div",attributes:{part:"body"},children:[{$prototype:"Array",items:{$ref:"$map/item/rows"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"row","data-prop":"${$map.item.prop}"},children:[{tagName:"div",attributes:{part:"row-label"},children:[{tagName:"div",attributes:{part:"chip-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/isSet"},cases:{true:{tagName:"button",attributes:{part:"chip",type:"button",title:"${$map.item.clearLabel}","aria-label":"${$map.item.clearLabel}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/clear"},value:[{$ref:"$map/item/key"}]}]}}}},{tagName:"span",attributes:{part:"row-name","aria-hidden":"true"},textContent:"${$map.item.label}"}]},{tagName:"div",attributes:{part:"widget-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/kind"},cases:{text:{tagName:"jx-textfield",attributes:{part:"widget"},$props:{size:"sm",label:"${$map.item.label}",placeholder:{$ref:"$map/item/placeholder"},value:{$ref:"$map/item/value"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editText"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/commitText"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},textarea:{tagName:"jx-textfield",attributes:{part:"widget"},$props:{size:"sm",multiline:!0,rows:3,label:"${$map.item.label}",placeholder:{$ref:"$map/item/placeholder"},value:{$ref:"$map/item/value"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editText"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/commitText"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},number:{tagName:"jx-number-field",attributes:{part:"widget"},$props:{size:"sm",label:"${$map.item.label}",value:{$ref:"$map/item/value"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setNumber"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},boolean:{tagName:"jx-checkbox",attributes:{part:"widget"},$props:{size:"sm",label:"${$map.item.label}",checked:{$ref:"$map/item/checked"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setBoolean"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/checked"}]}]}},readout:{$description:"A value the document derives rather than stores, such as a page's URL, which is its file's place under `pages/`. Shown, never edited here: an editable URL would be a rename, and a rename is the file tree's.",tagName:"output",attributes:{part:"readout","aria-label":"${$map.item.label}"},textContent:"${$map.item.value}"},select:{tagName:"jx-select",attributes:{part:"widget"},$props:{size:"sm",label:"${$map.item.label}",options:{$ref:"$map/item/options"},value:{$ref:"$map/item/value"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setChoice"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},media:{tagName:"div",attributes:{part:"media"},children:[{tagName:"div",attributes:{part:"thumb-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasThumb"},cases:{true:{tagName:"img",attributes:{part:"thumb",src:"${$map.item.thumb}",alt:""}}}},{tagName:"jx-textfield",attributes:{part:"widget"},$props:{size:"sm",label:"${$map.item.label}",placeholder:"/image.jpg",value:{$ref:"$map/item/value"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editText"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/commitText"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"jx-action-button",attributes:{part:"upload"},$props:{size:"sm",quiet:!0,icon:"upload-simple",label:"Upload media",hint:"Upload media"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/upload"},value:[{$ref:"$map/item/key"}]}]}},{tagName:"jx-action-button",attributes:{part:"browse"},$props:{size:"sm",quiet:!0,icon:"image",label:"Browse media",hint:"Browse media"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/browse"},value:[{$ref:"$map/item/key"},{$ref:"event#/currentTarget"}]}]}}]}}},{tagName:"div",attributes:{part:"action-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasAction"},cases:{true:{$description:"The row's one door elsewhere, named for what it opens: the Layout row's Edit template opens the layout in Design.",tagName:"jx-button",attributes:{part:"row-action"},$props:{size:"sm",variant:"secondary"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/runRowAction"},value:[{$ref:"$map/item/key"}]}]},children:[{tagName:"span",textContent:"${$map.item.action}"}]}}},{tagName:"div",attributes:{part:"note-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasNote"},cases:{true:{tagName:"p",attributes:{part:"note"},textContent:"${$map.item.note}"}}}]}}]}]}},{tagName:"div",attributes:{part:"section","data-section":"custom"},children:[{tagName:"div",attributes:{part:"section-header"},children:[{tagName:"span",attributes:{part:"title"},textContent:"Custom Tags"},{tagName:"span",attributes:{part:"count"},textContent:"${state.customCount}"}]},{tagName:"div",attributes:{part:"custom-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/customState"},cases:{empty:{tagName:"p",attributes:{part:"empty"},textContent:"Custom tags add your own meta, link and script elements to this page — analytics, verification, a webfont. Add one below."},listed:{tagName:"div",attributes:{part:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/customEntries"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"tag-row","data-tag":"${$map.item.key}"},children:[{tagName:"span",attributes:{part:"tag-name",title:"${$map.item.value}"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"tag-value"},textContent:"${$map.item.value}"},{tagName:"jx-action-button",attributes:{part:"remove"},$props:{icon:"x",size:"sm",quiet:!0,label:"${$map.item.removeLabel}",hint:"Remove"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/removeEntry"},value:[{$ref:"$map/item/key"}]}]}}]}}]}}},{tagName:"div",attributes:{part:"add","data-add":"tag"},children:[{tagName:"jx-select",attributes:{part:"tag-picker","data-field":"tag"},$props:{size:"sm",label:"Tag",options:{$ref:"#/state/tagOptions"},value:{$ref:"#/state/addTag"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editTag"},value:[{$ref:"event#/target/value"}]}]}},{tagName:"jx-textfield",attributes:{part:"field","data-field":"attr"},$props:{size:"sm",label:"Attribute",placeholder:"Attribute (e.g. name)",value:{$ref:"#/state/addAttr"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editAttr"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/addEntry"},value:[]}]}}]}},{tagName:"jx-textfield",attributes:{part:"field","data-field":"value"},$props:{size:"sm",label:"Value",placeholder:"Value",value:{$ref:"#/state/addValue"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editValue"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/addEntry"},value:[]}]}}]}},{tagName:"jx-action-button",attributes:{part:"add-button","data-add":"tag"},$props:{icon:"plus",size:"sm",quiet:!0,label:"Add tag",hint:"Add tag"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/addEntry"},value:[]}]}}]}]}]};E("panel-page",Qe);function et(e,t){e.sections=t.sections,e.customCount=t.customCount,e.customState=t.customState,e.customEntries=t.customEntries,e.addTag=t.addTag,e.addAttr=t.addAttr,e.addValue=t.addValue,e.tagOptions=t.tagOptions}function fa(){return{addAttr:"",addTag:"",addValue:"",customCount:"0",customEntries:[],customState:"empty",sections:[],tagOptions:[]}}var G=new WeakMap;function tt(e,t,a){let r=G.get(e);if(r&&(r.handle===null||r.handle.root.isConnected)){et(r.scope,t);return}r?.handle?.dispose(),e.textContent="";let i=b({...fa(),...a});et(i,t);let o={handle:null,scope:i};G.set(e,o),I("panel-page",i,e).then((s)=>{if(G.get(e)!==o){s.dispose();return}o.handle=s})}function de(e){let t=G.get(e);if(!t)return;G.delete(e),t.handle?.dispose(),e.textContent=""}var at={$schema:"https://jxsuite.com/schema/v1",$id:"StudioEntryInspector",$description:"The Inspector's Entry tab (specs/studio.md §6, §22.5): one collection entry's own settings while it is written on the canvas, the Content-Entry board's sidebar. Its status (a hold rule's label, or Published), its fields as the collection's schema types them, the URL its collection page publishes it at, and the file it is stored in. `content/entry-inspector.ts` keeps every decision; the field form is an island it fills, `ui/schema-form.ts`'s, the same form the form-only entry editor draws.",tagName:"div",attributes:{part:"entry","data-jx-region":"${state.region}"},style:{$description:"A column of sections, each a small uppercase heading over its rows, like the Page tab beside it.",display:"flex",flexDirection:"column",gap:"var(--jx-space-4)",padding:"var(--jx-space-3)",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-md)",color:"var(--fg)",'& [part="section"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-2)"},'& [part="section-title"]':{margin:"0",fontSize:"var(--jx-text-sm)",fontWeight:"700",letterSpacing:"0.06em",textTransform:"uppercase",color:"var(--fg-dim)"},'& [part="head"]':{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:"var(--jx-space-2)"},'& [part="kind"]':{fontWeight:"600"},'& [part="status"]':{fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="status"][data-held="true"]':{color:"var(--warning)"},'& [part="note"]':{margin:"0",fontSize:"var(--jx-text-sm)",lineHeight:"1.5",color:"var(--fg-dim)"},'& [part="url"]':{fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-sm)",wordBreak:"break-all"},'& [part="path"]':{fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-sm)",color:"var(--fg)",wordBreak:"break-all"},'& [part="fields-head"]':{display:"flex",alignItems:"center",justifyContent:"space-between"}},children:[{tagName:"section",attributes:{part:"section","aria-labelledby":"entry-inspector-entry"},children:[{tagName:"div",attributes:{part:"head"},children:[{tagName:"h3",attributes:{part:"section-title",id:"entry-inspector-entry"},textContent:"Entry"},{tagName:"span",attributes:{part:"status","data-held":"${state.held ? 'true' : 'false'}"},textContent:"${state.status}"}]},{tagName:"span",attributes:{part:"kind"},textContent:"${state.kind}"},{tagName:"div",attributes:{part:"hold-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/holdSwitch"},cases:{shown:{$description:"The entry's hold switch, on a collection whose rules offer one: the one field every such collection has in common. The state this shares (site-architecture.md §7.6). A setter: the switch names the state it reaches.",tagName:"jx-switch",attributes:{part:"hold"},$props:{checked:{$ref:"#/state/holdOn"},hint:"${state.holdHint}",size:"sm"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setHold"},value:[{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"${state.holdLabel}"}]}}}]},{tagName:"section",attributes:{part:"section","aria-labelledby":"entry-inspector-fields"},children:[{tagName:"div",attributes:{part:"fields-head"},children:[{tagName:"h3",attributes:{part:"section-title",id:"entry-inspector-fields"},textContent:"Fields"},{tagName:"jx-action-button",attributes:{part:"edit-fields"},$props:{size:"sm",quiet:!0,hint:"Edit this collection's fields in Project Settings",haspopup:"dialog"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openFields"},value:[]}]},children:[{tagName:"span",textContent:"Edit"}]}]},{tagName:"div",attributes:{part:"fields-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/fieldsState"},cases:{form:{tagName:"div",attributes:{part:"fields"}},none:{tagName:"p",attributes:{part:"note"},textContent:"This collection declares no fields. Edit adds some in Project Settings."}}}]},{tagName:"section",attributes:{part:"section","aria-labelledby":"entry-inspector-page"},children:[{tagName:"div",attributes:{part:"fields-head"},children:[{tagName:"h3",attributes:{part:"section-title",id:"entry-inspector-page"},textContent:"Page"},{$description:"The door to Search appearance, the same `document.openSeo` the Page tab's button runs: an entry's search title, description and social image are its frontmatter too (studio.md §4.2).",tagName:"jx-action-button",attributes:{part:"seo-button"},$props:{size:"sm",quiet:!0,label:"Search appearance",hint:"Preview how this entry appears in search and when shared",haspopup:"dialog"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openSeo"},value:[]}]},children:[{tagName:"span",textContent:"Search appearance…"}]}]},{tagName:"div",attributes:{part:"url-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/urlState"},cases:{shown:{tagName:"code",attributes:{part:"url"},textContent:"${state.url}"},none:{tagName:"p",attributes:{part:"note"},textContent:"Entries of this collection have no page of their own."},unlisted:{$description:"The collection has a page, but the page lists the ids it publishes (`$paths.values`) and this entry is not one of them: naming a URL the build never writes would be a link to nothing.",tagName:"p",attributes:{part:"note"},textContent:"Not published: this collection's page lists the entries it publishes, and this is not one of them."},loading:{tagName:"p",attributes:{part:"note"},textContent:"Finding the page this entry is published at…"}}},{tagName:"p",attributes:{part:"note"},children:[{tagName:"span",textContent:"Stored as "},{tagName:"code",attributes:{part:"path"},textContent:"${state.path}"},{tagName:"span",textContent:"${state.storage}"}]}]}]};E("entry-inspector",at);function ga(e,t){e.region=t.region,e.kind=t.kind,e.status=t.status,e.holdSwitch=t.holdSwitch,e.holdOn=t.holdOn,e.holdLabel=t.holdLabel,e.holdHint=t.holdHint,e.held=t.held,e.fieldsState=t.fieldsState,e.urlState=t.urlState,e.url=t.url,e.path=t.path,e.storage=t.storage}function ba(e){let t=n(e)?void 0:e.attributes?.part;return n(t)?t:""}function nt(e,t,a,r){e.replaceChildren();let i=b({...t,...a}),o=null,s=!1,l=I("entry-inspector",i,e,{onNodeCreated:(c,d,m)=>{if(!s&&c instanceof HTMLElement&&ba(m)==="fields")r.fieldsSlot(c)}}).then((c)=>{if(s)c.dispose();else o=c;return c});return{attached:()=>{if(s)return!1;let c=o?.root;return c===void 0?!0:e.contains(c)},dispose(){s=!0,o?.dispose(),o=null},ready:l,update:(c)=>ga(i,c)}}var ya="inspector/entry";function ot(e){let t=Jn(e?.documentPath);return t!==null&&!t.fileBacked}function st(e){let t=e.documentPath??"",r=Jn(t)?.name??"",i=Js(r),o=Gl(e),s=i?.def,l=Lp(s,o),c=Ts(s),d=r===""?null:ah(r,zc(t)),m=d?OC(d,t,o):null,y=t.endsWith(".json");return{fieldsState:i?.schema?"form":"none",held:l!==null,holdHint:Rp(l),holdLabel:c?.label??"",holdOn:c!==null&&o[c.field]===!0,holdSwitch:c?"shown":"hidden",kind:ey(nc(r)?.item??"entry"),path:t,region:ya,status:Om(s,o),storage:y?". Its fields are the file itself.":". Fields are its frontmatter, and the body is its Markdown.",url:m??"",urlState:d===void 0?"loading":m?"shown":d?"unlisted":"none"}}var v=null;function lt(e,t){let a=Js(Jn(t.documentPath)?.name??"");if(!e.formHost||!a?.schema)return;let r=Gl(t),i=Zl("entry-inspector",OT(a.schema,a.schema,r),r,{context:NT(t),errors:DT(a,r),onChange:(o)=>AS(t,o),rerender:e.redraw,ui:IT(a.schema)});if(i.parentNode!==e.formHost)e.formHost.replaceChildren(i)}function rt(e,t){let a=st(t);if(a.fieldsState==="none")e.formHost=null;e.handle.update(a),lt(e,t)}function q(e){if(!v||e!==void 0&&v.host!==e)return;v.unlisten(),v.scope.stop(),v.handle.dispose(),v=null}function dt(e,t){if(v&&v.host===e&&v.tabId===t.id&&v.handle.attached()){rt(v,t);return}q();let a=me(),r=()=>{if(v===i)rt(i,t)},i={formHost:null,handle:nt(e,st(t),{openFields:()=>{let o=Jn(t.documentPath)?.name;it("settings.open",o?{entry:o,section:"content"}:{section:"content"},"Entry")},openSeo:()=>{it("document.openSeo",void 0,"Entry")},setHold:(o)=>Ab(t,o)},{fieldsSlot:(o)=>{if(v===i)i.formHost=o,lt(i,t)}}),host:e,redraw:r,scope:a,tabId:t.id,unlisten:Mp(r)};v=i,a.run(()=>{te(()=>{t.doc.document,t.doc.content.frontmatter,x?.projectConfig?.content,r()})})}var A=null;async function PE(){try{A=(await p().listDirectory("layouts")).filter((a)=>a.type==="file"&&a.name.endsWith(".json")).map((a)=>({name:a.name.replace(/\.json$/,"").replaceAll(/[-_]+/g," ").replaceAll(/\b\w/g,(r)=>r.toUpperCase()),path:`./layouts/${a.name}`}))}catch{A=[]}return A}async function va(){await PE(),wn("rightPanel","seoModal")}function hw(){A=null,Ia()}function xa(){if(A===null)va();return A}var pw=[{attr:"name",key:"description",label:"Description"},{attr:"name",key:"viewport",label:"Viewport"}],fw=[{attr:"property",key:"og:title",label:"Title"},{attr:"property",key:"og:description",label:"Description",multiline:!0},{attr:"property",key:"og:image",label:"Image",media:!0},{attr:"property",key:"og:type",label:"Type"}],ct=new Set([...pw,...fw].map((e)=>e.key)),pt=new Set(["title"]);function wa(e){return He(e)?new Set([...pt,"description"]):pt}function ME(e){let t=mw(e.$head??[],"name","description");if(t)return String(t.attributes?.content??"");return n(e.description)?e.description:""}function rS(e,t){if(!mw(e.$head??[],"name","description")&&n(e.description)){if(t)e.description=t;else delete e.description;return}gw(e,"name","description",t)}function mw(e,t,a){return e.find((r)=>r?.tagName==="meta"&&r.attributes?.[t]===a)}function FE(e,t){return e.find((a)=>a?.tagName==="link"&&a.attributes?.rel===t)}function $a(e){if(!e?.tagName)return!1;if(e.tagName==="meta"){let t=String(e.attributes?.name??""),a=String(e.attributes?.property??"");return Boolean(t&&ct.has(t))||Boolean(a&&ct.has(a))}if(e.tagName==="link"&&e.attributes?.rel==="icon")return!0;return!1}function gw(e,t,a,r){if(!e.$head)e.$head=[];let i=e.$head.findIndex((o)=>o?.tagName==="meta"&&o.attributes?.[t]===a);if(r){let o={attributes:{[t]:a,content:r},tagName:"meta"};if(i!==-1)e.$head[i]=o;else e.$head.push(o)}else if(i!==-1)e.$head.splice(i,1)}function oS(e,t,a){if(!e.$head)e.$head=[];let r=e.$head.findIndex((i)=>i?.tagName==="link"&&i.attributes?.rel===t);if(a){let i={attributes:{href:a,rel:t},tagName:"link"};if(r!==-1)e.$head[r]=i;else e.$head.push(i)}else if(r!==-1)e.$head.splice(r,1)}function Sa(e){if(!e?.tagName)return"unknown";let t=e.attributes??{};if(t.name)return`<meta name="${String(t.name)}">`;if(t.property)return`<meta property="${String(t.property)}">`;if(t.rel&&t.href)return`<link rel="${String(t.rel)}">`;if(t.src)return`<script src="${String(t.src)}">`;if(t.charset)return`<meta charset="${String(t.charset)}">`;return`<${e.tagName}>`}function Ta(e){let t=e?.attributes??{};return String(t.content??t.href??t.src??e?.textContent??"")}var yt="Jx Site",vt={donor:null,source:"none",value:""};function ke(e,t,a){let r=null;for(let i of e)if(i?.tagName==="meta"&&i.attributes?.[t]===a)r=String(i.attributes.content??"");return r}function K(e,t,a){let r=ke(e.page,t,a);if(r!==null)return{donor:null,source:"page",value:r};let i=ke(e.layout,t,a);if(i!==null)return{donor:e.layoutName??"the layout",source:"layout",value:i};let o=ke(e.site,t,a);if(o!==null)return{donor:"Site head",source:"site",value:o};return vt}function ka(e,t){let a=e.trim();if(a)return{donor:null,source:"page",value:a};let r=t?.trim();if(r)return{donor:"Site name",source:"site",value:r};return{donor:"the build",source:"build",value:yt}}function Ea(e,t){let a=e??"",r=a.split("/").filter((s)=>s!=="");if(!t||e===null)return{crumb:a||"/",host:"",href:null};let i;try{i=new URL(a,t)}catch{return{crumb:a||"/",host:"",href:null}}let{host:o}=i;return{crumb:[o,...r].join(" › "),host:o,href:i.href}}var xt=new Map([["description",160],["og:description",200],["og:title",60],["title",60]]),Pa=new Intl.Segmenter("en-US",{granularity:"grapheme"});function jE(e){let t=0;for(let a of Pa.segment(e))t+=1;return t}var ut="Search appearance";function zN(e,t){Sl((a)=>a.source===ut);for(let a of e.warnings){let r={action:"document.openSeo",key:`seo.${a.id}`,source:ut,tier:"problem"};if(t!==void 0)r.path=t;w.warn(a.message,r)}return e.warnings.length}function mb(e,t){return e.fields.find((a)=>a.key===t)??{...vt,key:t,label:t,limit:xt.get(t)??null}}function Na(e){return[...e.site,...e.layout,...e.page].some((t)=>t?.tagName==="title")}function Ha(e,t){let a=[],r=(o)=>e.fields.find((s)=>s.key===o);if(r("title")?.source==="build")a.push({field:"title",id:"title-missing",message:`Neither this page nor the project names a title, so the build ships “${yt}”.`});if(r("description")?.value.trim()==="")a.push({field:"description",id:"description-missing",message:"No description reaches this page from the site, its layout or the page itself — a "+"result row shows whatever text the engine picks instead."});if(r("og:title")?.value.trim()==="")a.push({field:"og:title",id:"og-title-missing",message:"No og:title — a shared link carries no headline of its own."});if(r("og:description")?.value.trim()==="")a.push({field:"og:description",id:"og-description-missing",message:"No og:description — a shared link carries no summary of its own."});if(r("og:image")?.value.trim()==="")a.push({field:"og:image",id:"og-image-missing",message:"No og:image — a shared link renders as a text-only card."});for(let o of e.fields){let s=jE(o.value);if(o.limit!==null&&s>o.limit){let l=o.key.endsWith("description")?"summaries":"headlines";a.push({field:o.key,id:`${o.key}-long`,message:`${o.label} is ${s} characters; ${l} are cut near ${o.limit}.`})}}if(e.url.href===null)a.push({field:"url",id:"site-url-missing",message:"Project Settings names no site URL, so the build emits no canonical link and no og:url."});if(Na(t))a.push({field:"title",id:"head-title-ignored",message:"A <title> element in $head is discarded — the build writes the title from the "+"document's own title property."});return a}function ja(e,t){let a=(s,l,c)=>({...c,key:s,label:l,limit:xt.get(s)??null}),r=[a("title","Title",ka(t.pageTitle,t.siteName)),a("description","Description",K(e,"name","description")),a("og:title","Social title",K(e,"property","og:title")),a("og:description","Social description",K(e,"property","og:description")),a("og:image","Social image",K(e,"property","og:image")),a("og:type","Social type",K(e,"property","og:type"))],i=Ea(t.route,t.siteUrl),o={fields:r,url:i};return{...o,warnings:Ha(o,e)}}var Pe=null,Ne=[],Y=null;function Ia(){Pe=null,Ne=[],Y=null}async function Ma(e){if(Y===e)return;Y=e;let t=await Ax(e);if(Y!==e)return;Y=null,Pe=e,Ne=t?.$head??[],wn("seoModal")}function wt(e){return e.replace(/^\.\//,"").replace(/^layouts\//,"").replace(/\.json$/,"").replaceAll(/[-_/]+/g," ").replaceAll(/\b\w/g,(t)=>t.toUpperCase())||e}function Ca(e,t){let a=He(e)?gl(t):null;if(a===null)return{entries:[],name:null};let r=wt(a);if(a===Pe)return{entries:Ne,name:r};return Ma(a),{entries:[],name:r}}function HE(e,t){let a=x?.projectConfig,r=Ca(e,t.$layout),i=e?.documentPath,o={pageTitle:n(t.title)?t.title:"",route:i?fm(i):null};if(a?.name!==void 0)o.siteName=a.name;if(a?.url!==void 0)o.siteUrl=a.url;return ja({layout:r.entries,layoutName:r.name,page:Ge(t.$head??[],t.description),site:a?.$head??[]},o)}function He(e){let t=e?.documentPath;return Boolean(t&&x?.isSiteProject&&(t.startsWith("pages/")||t.startsWith("./pages/")))}function sS(e,t){let a={...e};if(t.title!==void 0)a.title=t.title;if(n(t.description))a.description=t.description;if(n(t.$layout)||t.$layout===!1)a.$layout=t.$layout;if(t.$head!==void 0)a.$head=t.$head;return a}function BE(e,t,a){if(!e)return;let r=e.doc.content.frontmatter,i=sS({},r).$head,o={};if(n(r.title))o.title=r.title;if(n(r.description))o.description=r.description;if(i)o.$head=[...i];if(n(r.$layout)||r.$layout===!1)o.$layout=r.$layout;a(o);let s=o.$head&&o.$head.length>0?o.$head:void 0,l=o.$layout!==r.$layout,c=o.title!==r.title,d=n(r.description)&&o.description!==r.description,m=JSON.stringify(s)!==JSON.stringify(i);if(l||c||d||m)X(e,(y)=>{if(l)eu(y,"$layout",n(o.$layout)||o.$layout===!1?o.$layout:void 0);if(c)eu(y,"title",o.title);if(d)eu(y,"description",n(o.description)?o.description:void 0);if(m)eu(y,"$head",s)});t()}var P=null,H=null,ue="meta",Q="",ee="",T=new Map,je=new Map;function Oa(e){let t=e?.documentPath?fm(e.documentPath):null;if(t===null)return null;return{...C("__url","url","URL"),kind:"readout",value:t}}var Ee=new Map,R=new Map,Fa=[{label:"meta",value:"meta"},{label:"link",value:"link"},{label:"script",value:"script"}];function C(e,t,a){return{action:"",checked:!1,clearLabel:`Clear ${t}`,hasAction:!1,hasNote:!1,hasThumb:!1,isSet:!1,key:e,kind:"text",label:a,note:"",options:[],placeholder:"",prop:t,thumb:"",value:""}}function $t(e,t){e.hasThumb=t!==""&&la.has(Ot(t)),e.thumb=e.hasThumb?ed(t):""}function La(e,t){let a=n(e.title)?e.title:"";return T.set("title",{images:!1,clear:()=>t((r)=>{delete r.title}),commit:(r)=>t((i)=>{let o=String(r).trim();if(o)i.title=o;else delete i.title})}),{...C("title","title","Title"),clearLabel:"Clear title",isSet:Boolean(a),placeholder:"Page title…",value:a}}function mt(e,t,a){let r=String(mw(t,e.attr,e.key)?.attributes?.content??""),i=`meta:${e.attr}:${e.key}`;T.set(i,{images:e.media===!0,clear:()=>a((s)=>gw(s,e.attr,e.key,"")),commit:(s)=>a((l)=>gw(l,e.attr,e.key,e.media?String(s):String(s).trim()))});let o=C(i,e.key,e.label);if(o.isSet=Boolean(r),o.value=r,e.media)return o.kind="media",$t(o,r),o;return o.kind=e.multiline?"textarea":"text",o.placeholder=e.key==="viewport"?"width=device-width, initial-scale=1":`${e.label}…`,o}function Da(e,t){let a=ME(e),r="meta:name:description";T.set("meta:name:description",{images:!1,clear:()=>t((o)=>rS(o,"")),commit:(o)=>t((s)=>rS(s,String(o).trim()))});let i=C("meta:name:description","description","Description");return i.isSet=Boolean(a),i.value=a,i.kind="text",i.placeholder="Description…",i}function Ra(e,t){let a=String(FE(e,"icon")?.attributes?.href??"");T.set("link:icon",{images:!0,clear:()=>t((i)=>oS(i,"icon","")),commit:(i)=>t((o)=>oS(o,"icon",String(i)))});let r=C("link:icon","icon","Icon");return r.isSet=Boolean(a),r.kind="media",r.value=a,$t(r,a),r}function _a(e,t,a){if(!He(e))return null;let r=xa();if(r===null)return null;let i=t.$layout,o=x?.projectConfig?.defaults?.layout,s=o?wt(o):"";T.set("__layout",{images:!1,clear:()=>a((d)=>{delete d.$layout}),commit:(d)=>{let m=String(d);a((y)=>{if(m==="__default__")delete y.$layout;else if(m==="__none__")y.$layout=!1;else y.$layout=m}),MA()}});let l=C("__layout","layout","Layout");l.kind="select",l.isSet=i!==void 0,l.options=[{label:s?`Default (${s})`:"Default",value:"__default__"},{label:"None",value:"__none__"},...r.map((d)=>({label:d.name,value:d.path}))],l.value=i===!1?"__none__":i||"__default__";let c=gl(i);if(c)l.action="Edit template",l.hasAction=!0,je.set("__layout",()=>{(ce("8pf70854"),import("./files-8pf70854.js")).then(({openFileInTab:d})=>d(c.replace(/^\.\//,"")))});return{hasSeo:!1,key:"layout",rows:[l],title:"Layout"}}function Ja(e){if(!e||e.doc.mode!=="content")return null;let{collection:t,fields:a,hasSchema:r,requiredFields:i}=Ke(e,x?.projectConfig,wa(e));if(a.length===0&&!r)return null;return{hasSeo:!1,key:"frontmatter",rows:a.map((s)=>{let l=`fm:${s.field}`,{parse:c,row:d}=Ye(s.field,s.entry,s.value,i,{rerender:D});return T.set(l,{images:d.kind==="media"&&s.entry.format==="image",clear:()=>X(e,(m)=>eu(m,s.field)),commit:(m)=>X(e,(y)=>eu(y,s.field,c(m)))}),Object.assign(C(l,s.field,d.label),d,{clearLabel:`Clear ${s.field}`})}),title:t?`Frontmatter (${t.name})`:"Frontmatter"}}function Va(e){Ee.clear();let t=[];for(let a of e){if($a(a)||uw(a)||Te(a))continue;let r=`tag:${t.length}`;Ee.set(r,a);let i=Sa(a);t.push({key:r,label:i,removeLabel:`Remove ${i}`,value:Ta(a)})}return t}function Wa(e){T.clear(),je.clear();let t=h.value,a=e.document,r=a.$head??[],i=[],o=Ja(t);if(o)i.push(o);let s=_a(t,a,e.applyMutation);if(s)i.push(s);let l=Oa(t);i.push({hasSeo:!0,key:"page",rows:[La(a,e.applyMutation),...l?[l]:[],...pw.map((d)=>d.key==="description"?Da(a,e.applyMutation):mt(d,r,e.applyMutation)),Ra(r,e.applyMutation)],title:"Page"},{hasSeo:!1,key:"opengraph",rows:fw.map((d)=>mt(d,r,e.applyMutation)),title:"OpenGraph"});let c=Va(r);return{addAttr:Q,addTag:ue,addValue:ee,customCount:String(c.length),customEntries:c,customState:c.length===0?"empty":"listed",sections:i,tagOptions:Fa}}function D(){if(!P||!H)return;tt(P,Wa(H),Ba)}function ft(){for(let{timer:e}of R.values())clearTimeout(e);R.clear()}function Z(e){let t=R.get(e);if(t)clearTimeout(t.timer),R.delete(e)}function pe(e,t){Z(e),T.get(e)?.commit(t)}function za(){let e=H,t=Q.trim(),a=ee.trim();if(!e||!t||!a)return;let r=ue||"meta";Q="",ee="",D();let i={attributes:{},tagName:r};if(r==="meta")i.attributes={content:a,name:t};else if(r==="link")i.attributes={href:a,rel:t};else if(r==="script")i.attributes={[t]:a};e.applyMutation((o)=>{if(!o.$head)o.$head=[];o.$head.push(i)}),e.rerender()}function Ua(e){let t=H,a=Ee.get(e);if(!t||!a)return;t.applyMutation((r)=>{if(!r.$head)return;let i=r.$head.indexOf(a);if(i!==-1)r.$head.splice(i,1)}),t.rerender()}var ht=null;function gt(){return ht??=(ce("bzktmmwr"),import("./media-picker-bzktmmwr.js")),ht}var Ba={addEntry:za,browse:(e,t)=>{Z(e),gt().then((a)=>{if(t instanceof HTMLElement)a.showMediaPickerPopover(t,(r)=>{T.get(e)?.commit(r)},{images:T.get(e)?.images??!0})})},clear:(e)=>{Z(e),T.get(e)?.clear()},commitText:(e,t)=>pe(e,t),editAttr:(e)=>{Q=e,D()},editText:(e,t)=>{Z(e);let a=()=>{R.delete(e),T.get(e)?.commit(t)};R.set(e,{commit:a,timer:setTimeout(a,of)})},editTag:(e)=>{ue=e,D()},editValue:(e)=>{ee=e,D()},openSeo:()=>{ae()?.run("document.openSeo")},removeEntry:Ua,runRowAction:(e)=>{je.get(e)?.()},setBoolean:(e,t)=>pe(e,t),setChoice:(e,t)=>pe(e,t),setNumber:(e,t)=>pe(e,t),upload:(e)=>{Z(e),gt().then((t)=>{t.pickAndUpload((a)=>{T.get(e)?.commit(a)})})}};function Ga(e,t){if(e!==P)ue="meta",Q="",ee="",ft();if(t.document!==H?.document)ft();P=e,H=t,D()}function VE(e){if(!e)return"Document";if(e.startsWith("pages/"))return"Page";if(e.startsWith("layouts/"))return"Template";if(e.startsWith("components/"))return"Component";let t=Jn(e);return t&&!t.fileBacked?"Entry":"Document"}var qa="A component has no page settings: its title, search and social details come from the page that uses it.";function Ka(e){return{actions:[{label:"Edit tag and props",run:()=>{_l(e,{selection:[[]],ui:{rightTab:"properties"}})}}],detail:"Its tag name and the props it takes are set on its root element.",message:qa}}var UN="Open a page to edit its title, description and social preview.",M=null;function WE(e){if(M&&M!==e){if(q(M),de(M),P===M)P=null,H=null}M=e,bw()}function bw(){let e=M;if(!e)return;let t=h.value;if(!t||ot(t)){if(de(e),P===e)P=null,H=null;if(t)dt(e,t);else q(e);return}if(q(e),VE(t.documentPath)==="Component"){if(de(e),P===e)P=null,H=null;let r=ju(e,Ka(t));if(e.firstChild!==r||e.childNodes.length!==1)e.replaceChildren(r);return}let a=t.doc.mode==="content";Ga(e,{applyMutation:a?(r)=>BE(h.value,bw,r):(r)=>{Zd(h.value,r)},document:a?sS(t.doc.document,t.doc.content.frontmatter):t.doc.document,rerender:bw})}
|
|
4
|
+
export{uw,FN,jN,HN,BN,pb,DE,Mc,VN,OE,Fu,WN,fm,Id,fb,AE,ju,PE,hw,pw,fw,ME,rS,mw,FE,gw,oS,jE,zN,mb,HE,sS,BE,VE,UN,WE,bw};
|
|
5
|
+
|
|
6
|
+
//# debugId=64B5BB126F90892F64756E2164756E21
|
|
7
|
+
//# sourceMappingURL=studio-hdf01j7q.js.map
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import{p}from"./studio-1b79rpcb.js";import{H_}from"./studio-mkjrjpr2.js";import{n,J,f}from"./studio-0z8kp4xk.js";import{ce}from"./studio-nhpg405j.js";var Ie=null,ft=null,ct=null,Rn=!1;function dt(e){return ct=e,Rn=!0,Ie?pt():Promise.resolve()}async function pt(){if(!Rn)return;Rn=!1;try{let{applyProjectSchemas:e}=await (ce("fstdew02"),import("./monaco-setup-fstdew02.js"));e(ct)}catch{}}function hg(){if(Ie)return Promise.resolve(Ie);return ft??=(async()=>{let[e]=await Promise.all([(ce("mb9jzdrw"),import("./editor-mb9jzdrw.js")),(ce("fstdew02"),import("./monaco-setup-fstdew02.js"))]);return Ie=e,await pt(),Ie})(),ft}function df(){return Ie}function Hy(e,t,r){if(!e?.isConnected||t)return!1;return r()}var ur=/\0/u,lr=/^[^\s\\/(){};[\]"#=]+/u;class ht{index;text;constructor(e){this.text=e,this.index=e.codePointAt(0)===65279?1:0}get done(){return this.index>=this.text.length}startsWith(e){return this.text.startsWith(e,this.index)}skipLine(){let e=this.text.indexOf(`
|
|
2
|
+
`,this.index);this.index=e===-1?this.text.length:e}skipBlock(){let e=1;this.index+=2;while(!this.done&&e>0)if(this.startsWith("/*"))e+=1,this.index+=2;else if(this.startsWith("*/"))e-=1,this.index+=2;else this.index+=1}skipTrivia(){for(;;){while(!this.done&&/[\s;]/u.test(this.text.charAt(this.index)))this.index+=1;if(this.startsWith("//"))this.skipLine();else if(this.startsWith("/*"))this.skipBlock();else if(this.startsWith("/-"))this.index+=2,this.skipNode();else return}}skipString(){let e=0,t=this.index;while(this.text.charAt(t)==="#")e+=1,t+=1;let r=this.text.startsWith('"""',t),o=r?'"""':'"',s=o+"#".repeat(e);t+=o.length;while(t<this.text.length)if(e===0&&this.text.charAt(t)==="\\")t+=2;else if(this.text.startsWith(s,t))return this.index=t+s.length,!0;else if(!r&&this.text.charAt(t)===`
|
|
3
|
+
`)return!1;else t+=1;return!1}skipNode(){let e=0;while(!this.done){let t=this.text.charAt(this.index);if(t==='"'||t==="#"&&/^#+"/u.test(this.text.slice(this.index,this.index+16))){if(!this.skipString())return!1}else if(this.startsWith("//"))this.skipLine();else if(this.startsWith("/*"))this.skipBlock();else if(t==="{")e+=1,this.index+=1;else if(t==="}"){if(e===0)return!1;e-=1,this.index+=1}else if((t===`
|
|
4
|
+
`||t===";")&&e===0)return this.index+=1,!0;else this.index+=1}return e===0}}function w_(e){if(ur.test(e))return"unreadable";let t=new ht(e);for(;;){if(t.skipTrivia(),t.done)return"document";if(t.startsWith("(")){let r=e.indexOf(")",t.index);if(r===-1)return"unreadable";t.index=r+1}else{let[r]=lr.exec(e.slice(t.index,t.index+256))??[];if(!r)return t.startsWith('"')||t.startsWith("#")?"document":"unreadable";if(!r.startsWith("$"))return r==="project"?"project":"document";if(t.index+=r.length,!t.skipNode())return"unreadable"}}}var ue=1,_e=2,ge=3,rn=4,on=5,Be=6,sn=7,an=8,Ve=9,le=10,F=11,ve=12,Oe=13,un=14,re=15,ln=16,cn=17,xe=18,fe=19,dn=20,pn=21,hn=22,Fe=23,ye=24;var Y=28;function Pe(e){switch(e){case 9:case 32:case 160:case 5760:case 8192:case 8193:case 8194:case 8195:case 8196:case 8197:case 8198:case 8199:case 8200:case 8201:case 8202:case 8239:case 8287:case 12288:return!0}return!1}function de(e){return e===13||e===10||e===133||e===11||e===12||e===8232||e===8233||!1}function mn(e){return e<8||e>=14&&e<=25||e===127||e>=55296&&e<=57343||e>1114111||e===8206||e===8207||e>=8234&&e<=8238||e>=8294&&e<=8297||e===65279}function I(e){return!isNaN(e)&&!Pe(e)&&!de(e)&&e!==61&&e!==92&&e!==47&&e!==40&&e!==41&&e!==123&&e!==125&&e!==59&&e!==91&&e!==93&&e!==34&&e!==35&&!0}function mt(e){return e>=65&&e<91||e>=97&&e<123||!1}function Mn(e){return e>=48&&e<64||e>=65&&e<71||e>=97&&e<103||!1}function Dn(e){return Mn(e)||e===95}function oe(e){return e>=48&&e<58}function be(e){return oe(e)||e===95}function Ln(e){return e>=48&&e<56}function gt(e){return Ln(e)||e===95}function jn(e){return e===48||e===49}function xt(e){return jn(e)||e===95}function yt(e){return e===45||e===43}var fr;function*cr(e){for(let t of(fr??=new Intl.Segmenter("en")).segment(e))yield t.segment}function dr(e){return e[Symbol.iterator]()}function bt(e,{flags:t,graphemeLocations:r=!1}){let o=r?cr(e):dr(e),s=o.next();return{text:e,graphemeLocations:r,line:1,column:1,offset:0,length:e.length,iterator:o,currentIter:s,current:s.done?NaN:s.value.codePointAt(0),start:{line:1,column:1,offset:0},errorsInToken:null,flags:t}}function*wt(e){if(w(e,65279))e.column=1,yield x(e,_e);if(mn(e.current))throw Z(e,`Invalid character \\u${e.current.toString(16)}`)}function _(e){e.offset+=e.currentIter.value.length,e.column++;let t=e.currentIter=e.iterator.next(),r=e.current=t.done?NaN:t.value.codePointAt(0);if(mn(r))if(r>=55296&&r<=57343||r>1114111)Ue(e,`Invalid character \\u${r.toString(16)}`);else Ue(e,`Invalid character \\u${r.toString(16)}, this character is not allowed but can be included in strings as \\u{${r.toString(16)}}`);return r}function z(e,t){if(t(e.current)){let r=e.current;return _(e),r}}function w(e,t){if(e.current===t)return _(e),t}function ke(e){if(!de(e.current))return!1;if(!e.graphemeLocations&&e.current===13&&e.text.codePointAt(e.offset+1)===10)e.iterator.next(),e.offset++;return _(e),e.column=1,e.line++,!0}function Wn(e,t){while(e.current===t)_(e)}function A(e,t){while(t(e.current))_(e)}function x(e,t,r){let{line:o,column:s,offset:i}=e,a={line:o,column:s,offset:i},l=e.start;e.start=a;let u=e.errorsInToken;e.errorsInToken=null;let c={type:t,text:e.text.slice(l.offset,a.offset),start:l,end:a,errors:u};if(r){if(!c.errors)c.errors=[];c.errors.push(new N(r,{token:c}))}return c}function Z(e,t){if(t instanceof N)return t;let{line:r,column:o,offset:s}=e,i={line:r,column:o,offset:s},a;if(s<e.length)if(de(e.current))a={line:r+1,column:1,offset:s+1};else a={line:r,column:o+1,offset:s+1};return new N(`${t}`,{start:i,end:a})}function Ue(e,t){(e.errorsInToken??=[]).push(Z(e,t))}function we(e){return(t)=>(_(t),x(t,e))}function qe(e){return A(e,Pe),x(e,xe)}function Ne(e){return ke(e),x(e,fe)}function pr(e){_(e);let t=!1,r=!1;if(w(e,34)){if(!w(e,34))return x(e,Ve);if(r=!0,e.current===34)throw Z(e,"Multiline strings must start with exactly three quotes");while(!t&&e.offset<e.length)if(w(e,34)){if(w(e,34)&&w(e,34))t=!0}else w(e,92),ke(e)||_(e)}else while(!t&&e.offset<e.length)if(w(e,34))t=!0;else w(e,92),ke(e)||_(e);if(!t)throw Z(e,"Unexpected EOF inside string");return x(e,r?Fe:Ve)}function Nt(e){if(_(e),e.current===35||e.current===34){let t=1;while(w(e,35))t++;if(!w(e,34))throw Z(e,`Expected a quote after ${"#".repeat(t)}`);let r=!1;if(w(e,34))if(w(e,34)){if(e.current===34)throw Z(e,"Multiline strings must start with exactly three quotes");r=!0}else{let o=0;while(w(e,35))o++;if(o===t)return x(e,le)}while(!0){if(e.offset>=e.length)throw Z(e,"Unexpected EOF while parsing raw string");if(w(e,34)){if(r){if(!w(e,34)||!w(e,34))continue}let o=0;while(o<t&&w(e,35))o++;if(o===t)return x(e,r?ye:le)}else ke(e)||_(e)}}else{let t;if(e.current<255){let r=y[e.current];t=r(e)}else if(Pe(e.current))t=qe(e);else if(de(e.current))t=Ne(e);else t=Vn(e);if(t.type!==F)(t.errors??=[]).push(new N("Expected a valid identifier",{token:t}));return t.type=Oe,t}}function hr(e){if(_(e),z(e,oe))return A(e,I),x(e,F,"Invalid identifier, identifiers that start with a sign and a dot must be quoted if the next character is a digit to prevent confusion with decimal numbers");return A(e,I),x(e,F)}function mr(e){if(_(e),w(e,45))return x(e,ge);else if(w(e,47)){while(e.offset<e.length&&!de(e.current))_(e);return x(e,pn)}else if(w(e,42)){let t=1;while(e.offset<e.length)if(w(e,42)){if(w(e,47)){if(t--,t===0)return x(e,hn)}}else if(w(e,47)){if(w(e,42))t++}else ke(e)||_(e);throw Z(e,"Unexpected EOF in multiline comment")}else xn(e)}function Et(e){return _(e),gr(e)}function gr(e){if(oe(e.current))return K(e);else if(w(e,46)){if(z(e,oe))return A(e,I),x(e,F,"Invalid identifier or number, surround with quotes to make it an identifier or add a zero between the sign and the decimal point");return A(e,I),x(e,F)}else return A(e,I),x(e,F)}function Bn(e,t,r,o){return(s)=>{let i=_(s);if(z(s,r))return A(s,o),x(s,t);else if(!s.flags.experimentalSuffixedNumbers){if(w(s,95)){if(A(s,o),!I(s.current))return x(s,t,`Invalid ${e} number, the first character after 0${String.fromCodePoint(i)} cannot be an underscore`)}return A(s,I),x(s,F,`Invalid ${e} number`)}else if(w(s,95)){if(Wn(s,95),r(s.current)){if(A(s,o),!I(s.current))return x(s,t,`Invalid ${e} number, the first character after 0${String.fromCodePoint(i)} cannot be an underscore`)}return A(s,I),x(s,F,"Invalid number with suffix, a suffix cannot start with a letter followed by an underscore")}else if(oe(s.current))return x(s,F,"Invalid number with suffix, a suffix cannot start with a letter followed by a number");else return A(s,I),x(s,Y)}}var gn=Array(256).fill(null);gn[98]=Bn("binary",cn,jn,xt);gn[111]=Bn("octal",ln,Ln,gt);gn[120]=Bn("hexadecimal",un,Mn,Dn);function K(e){if(w(e,48)){let t=gn[e.current];if(t)return t(e)}if(A(e,be),w(e,46)){if(!z(e,oe))if(e.current===95)Ue(e,"Invalid decimal number, the part after the decimal point mustn't start on an underscore");else Ue(e,"Invalid decimal number, a decimal point must be followed by a digit");A(e,be)}if(w(e,101)||w(e,69))if(z(e,yt),z(e,oe)){if(A(e,be),I(e.current))return A(e,I),x(e,F,"Invalid number with suffix, a number with an exponent cannot have a suffix");return x(e,re)}else if(!e.flags.experimentalSuffixedNumbers)if(e.current===95)return A(e,be),x(e,re,"Invalid decimal number, the number after the exponent mustn't start on an underscore");else return A(e,I),x(e,re,"Invalid decimal number, missing a number after the exponent");else if(w(e,95)){if(Wn(e,95),oe(e.current)){if(A(e,be),!I(e.current))return x(e,re,"Invalid decimal number, the number after the exponent mustn't start on an underscore")}return A(e,I),x(e,F,"Invalid number with suffix, a suffix cannot start with a letter followed by an underscore")}else return A(e,I),x(e,Y);else if(e.flags.experimentalSuffixedNumbers)if(e.current===88||e.current===120){_(e);let t=null;if(z(e,Dn))t="Invalid number with suffix, a suffix cannot start with an x followed by a hexidecimal number";return A(e,I),x(e,Y,t)}else if(z(e,mt)){let t=null;if(z(e,be))t="Invalid number with suffix, a suffix cannot start with a letter followed by a digit";return A(e,I),x(e,Y,t)}else if(w(e,44))return A(e,I),x(e,Y,"Invalid number with suffix, a suffix cannot start with a comma");else if(w(e,46))return A(e,I),x(e,Y,"Invalid number with suffix, a suffix cannot start with a dot");else if(z(e,I))return A(e,I),x(e,Y);else return x(e,re);else return x(e,re)}function xr(e){if(_(e),e.current!=35)return A(e,I),x(e,F);let t=Nt(e);t.start.offset--,t.start.column--;let r;switch(t.type){case le:case ye:r='Invalid raw string, the correct syntax is #" "#, not r#" "#';break;default:r="Invalid token, did you forget a whitespace after this r?"}return(t.errors??=[]).push(new N(r,{token:t})),t}function Vn(e){return _(e),A(e,I),x(e,F)}function xn(e){throw Z(e,`Unexpected character ${JSON.stringify(String.fromCodePoint(e.current))}, did you forget to quote an identifier?`)}var y=Array(255);y.fill(Vn);for(let e=0;e<32;e++)y[e]=xn;y[9]=qe;y[10]=Ne;y[11]=Ne;y[12]=Ne;y[13]=Ne;y[32]=qe;y[34]=pr;y[35]=Nt;y[40]=we(rn);y[41]=we(Be);y[43]=Et;y[45]=Et;y[46]=hr;y[47]=mr;y[48]=K;y[49]=K;y[50]=K;y[51]=K;y[52]=K;y[53]=K;y[54]=K;y[55]=K;y[56]=K;y[57]=K;y[59]=we(an);y[61]=we(ve);y[91]=xn;y[92]=we(dn);y[93]=xn;y[114]=xr;y[123]=we(on);y[125]=we(sn);y[133]=Ne;y[160]=qe;function*He(e,t){let r=bt(e,t);yield*wt(r);while(!r.currentIter.done){if(r.current<255){let o=y[r.current];yield o(r);continue}if(Pe(r.current)){yield qe(r);continue}if(de(r.current)){yield Ne(r);continue}yield Vn(r)}yield x(r,ue)}class N extends Error{name="InvalidKdlError";start;end;token;errors;constructor(e,{token:t,start:r=t?.start,end:o=t?.end,errors:s,...i}={}){if(t?.type===ue)e=`${e} at end of input`;else if(r)e=`${e} at ${r.line}:${r.column}`;super(e,i);this.token=t,this.start=r,this.end=o,this.errors=s}*flat(){if(this.errors==null){yield this;return}for(let e of this.errors)yield*e.flat()}}var $t=new WeakMap;function Ce(e){return $t.get(e)}function At(e,{start:t},{end:r}){$t.set(e,{start:t,end:r})}function Tt({experimentalSuffixedNumbers:e=!1}={}){return{experimentalSuffixedNumbers:e}}class G{type="identifier";static type="identifier";representation;constructor(e){this.name=e}getName(){return this.name}setName(e){if(e!==this.name)this.name=e,this.representation=void 0}clone(){let e=new G(this.name);return e.representation=this.representation,e}}class ee{type="tag";static type="tag";representation;leading;trailing;suffix;constructor(e){this.name,Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!1,value:e})}getName(){return this.name}setName(e){if(e!==this.name)this.name=e,this.representation=void 0}clone(){let e=new ee(this.name);return e.representation=this.representation,e.leading=this.leading,e.trailing=this.trailing,e.suffix=this.suffix,e}}class Q{type="value";static type="value";representation;tag=null;betweenTagAndValue;constructor(e){this.value=e}clone(){let e=new Q(this.value);return e.tag=this.tag?.clone()??null,e.betweenTagAndValue=this.betweenTagAndValue,e.representation=this.representation,e}getValue(){return this.value}setValue(e){if(e!==this.value)this.value=e,this.representation=void 0}getTag(){return this.tag?this.tag.name:null}setTag(e){if(e==null)this.tag=null;else if(this.tag!=null)this.tag.setName(e);else this.tag=new ee(e)}}class W{static createArgument(e){return new W(new Q(e),null)}static createProperty(e,t){return new W(new Q(t),new G(e))}type="entry";static type="entry";name;value;leading;trailing;equals;constructor(e,t){this.value=e,this.name=t}clone(){let e=new W(this.value.clone(),this.name?.clone()??null);return e.leading=this.leading,e.trailing=this.trailing,e.equals=this.equals,e}getTag(){return this.value.getTag()}setTag(e){this.value.setTag(e)}getName(){return this.name?this.name.name:null}setName(e){this.name=e!=null?new G(e):null}getValue(){return this.value.value}setValue(e){this.value=new Q(e)}isArgument(){return this.name==null}isProperty(){return this.name!=null}}function*Je(e){for(let t=e.length-1;t>=0;t--)yield e[t]}function Pn(e){return e.children??(e.children=new pe)}class Re{static create(e){return new Re(new G(e))}type="node";static type="node";name;tag=null;entries;children;leading;trailing;beforeChildren;betweenTagAndName;constructor(e,t=[],r=null){this.name=e,this.entries=t,this.children=r}clone({shallow:e=!1}={}){let t=new Re(this.name.clone(),e?[]:this.entries.map((r)=>r.clone()),this.children?.clone({shallow:e}));if(this.tag)t.tag=this.tag.clone();return t.leading=this.leading,t.betweenTagAndName=this.betweenTagAndName,t.beforeChildren=this.beforeChildren,t.trailing=this.trailing,t}getTag(){return this.tag?this.tag.name:null}setTag(e){this.tag=e!=null?new ee(e):null}getName(){return this.name.name}setName(e){this.name.setName(e)}hasArguments(){return this.entries.some((e)=>e.isArgument())}getArguments(){return this.getArgumentEntries().map((e)=>e.getValue())}getArgumentEntries(){return this.entries.filter((e)=>e.isArgument())}hasArgument(e){return this.getArgumentEntry(e)!=null}getArgument(e){return this.getArgumentEntry(e)?.getValue()}getArgumentEntry(e){for(let t of this.entries){if(!t.isArgument())continue;if(e===0)return t;e--}}addArgument(e,t,r){let o=W.createArgument(e);if(o.value.setTag(t),r!=null)for(let[s,i]of this.entries.entries()){if(!i.isArgument())continue;if(r===0){this.entries.splice(s,0,i);return}r--}this.entries.push(o)}removeArgument(e){for(let[t,r]of this.entries.entries()){if(!r.isArgument())continue;if(e===0){this.entries.splice(t,1);return}e--}}hasProperties(){return this.entries.some((e)=>e.isProperty())}getProperties(){return new Map(this.getPropertyEntries().map((e)=>[e.getName(),e.getValue()]))}getPropertyEntries(){return this.entries.filter((e)=>e.isProperty())}getPropertyEntryMap(){return new Map(this.getPropertyEntries().map((e)=>[e.getName(),e]))}hasProperty(e){return this.getPropertyEntry(e)!=null}getProperty(e){return this.getPropertyEntry(e)?.getValue()}getPropertyEntry(e){for(let t of Je(this.entries))if(t.getName()===e)return t;return}setProperty(e,t,r){for(let s of Je(this.entries))if(s.getName()===e){s.setValue(t),s.value.setTag(r);return}let o=W.createProperty(e,t);o.value.setTag(r),this.entries.push(o)}deleteProperty(e){this.entries=this.entries.filter((t)=>t.getName()!==e)}hasChildren(){return this.children!=null&&!this.children.isEmpty()}appendNode(e){Pn(this).appendNode(e)}insertNodeBefore(e,t){Pn(this).insertNodeBefore(e,t)}insertNodeAfter(e,t){Pn(this).insertNodeAfter(e,t)}removeNode(e){if(this.children==null)throw Error("Node to remove is not in document");this.children.removeNode(e)}replaceNode(e,t){if(this.children==null)throw Error("Node to remove is not in document");this.children.replaceNode(e,t)}findNodesByName(e){return this.children!=null?this.children.findNodesByName(e):[]}findNodeByName(e){return this.children?.findNodeByName(e)}findParameterizedNode(e,t){return this.children?.findParameterizedNode(e,t)}removeNodesByName(e){this.children?.removeNodesByName(e)}}function*Me(e){if(e instanceof pe)yield*e.nodes;else yield e}class pe{type="document";static type="document";nodes;trailing;constructor(e=[]){this.nodes=e}clone({shallow:e}={}){let t=new pe(e?[]:this.nodes.map((r)=>r.clone()));return t.trailing=this.trailing,t}appendNode(e){this.nodes.push(...Me(e))}insertNodeBefore(e,t){if(t==null){this.nodes.push(...Me(e));return}let r=this.nodes.indexOf(t);if(r===-1)throw Error("Reference node is not in document");this.nodes.splice(r,0,...Me(e))}insertNodeAfter(e,t){if(t==null){this.nodes.unshift(...Me(e));return}let r=this.nodes.indexOf(t);if(r===-1)throw Error("Reference node is not in document");this.nodes.splice(r+1,0,...Me(e))}removeNode(e){let t=this.nodes.indexOf(e);if(t===-1)throw Error("Node to remove is not in document");this.nodes.splice(t,1)}replaceNode(e,t){let r=this.nodes.indexOf(e);if(r===-1)throw Error("Node to replace is not in document");this.nodes.splice(r,1,...Me(t))}findNodesByName(e){return this.nodes.filter((t)=>t.name.name===e)}findNodeByName(e){for(let t of Je(this.nodes))if(t.name.name===e)return t;return}findParameterizedNode(e,t){for(let r of Je(this.nodes)){if(r.name.name!==e)continue;let o=r.getArguments();if(o.length!==1||t!==void 0&&o[0]!==t)continue;return r}return}removeNodesByName(e){this.nodes=this.nodes.filter((t)=>t.name.name!==e)}isEmpty(){return this.nodes.length===0}}var Zo=new Map([...Array.from({length:32},(e,t)=>[t,`\\u{${t.toString(16).padStart(2,"0")}}`]),[127,"\\u{7f}"],[8206,"\\u{200e}"],[8207,"\\u{200f}"],[8234,"\\u{202a}"],[8235,"\\u{202b}"],[8236,"\\u{202c}"],[8237,"\\u{202d}"],[8238,"\\u{202e}"],[8294,"\\u{2066}"],[8295,"\\u{2067}"],[8296,"\\u{2068}"],[8297,"\\u{2069}"],[65279,"\\u{feff}"],[34,"\\\""],[92,"\\\\"],[10,"\\n"],[11,"\\u{0b}"],[12,"\\f"],[13,"\\r"],[133,"\\u{85}"],[8232,"\\u{2028}"],[8233,"\\u{2029}"],[8,"\\b"],[9,"\\t"]]);var yr=new Map([["\\n",`
|
|
5
|
+
`],["\\r","\r"],["\\t","\t"],["\\\\","\\"],["\\\"",'"'],["\\b","\b"],["\\f","\f"],["\\s"," "]]),De=/\x0D\x0A|[\x0A\x0B\x0C\x0D\x85\u2028\u2029]/,br=/\x0D\x0A|[\x0A\x0B\x0C\x0D\x85\u2028\u2029]/g,wr=/(?:^|[^\\\uFEFF\u0009\u0020\u00A0\u1680\u2000-\u200A\u202F\u205F\u3000\x0A\x0B\x0C\x0D\x85\u2028\u2029])(?:\\\\)*[\uFEFF\u0009\u0020\u00A0\u1680\u2000-\u200A\u202F\u205F\u3000\x0A\x0B\x0C\x0D\x85\u2028\u2029]*(\x0D\x0A|[\x0A\x0B\x0C\x0D\x85\u2028\u2029])/s,Nr=/(?:^|[^\\\uFEFF\u0009\u0020\u00A0\u1680\u2000-\u200A\u202F\u205F\u3000\x0A\x0B\x0C\x0D\x85\u2028\u2029])(?:\\\\)*[\uFEFF\u0009\u0020\u00A0\u1680\u2000-\u200A\u202F\u205F\u3000\x0A\x0B\x0C\x0D\x85\u2028\u2029]*(\x0D\x0A|[\x0A\x0B\x0C\x0D\x85\u2028\u2029])/dgs;function St(e,t,r){let o;while(o=br.exec(t)){let s=ze(r,t,o.index);e.push(new N("Raw strings with single quotes cannot contain any unescaped newlines, use triple-quotes for multiline strings",{token:r,start:s,end:{offset:s.offset+o[0].length,line:s.line+1,column:1}}))}return t}var Er=/[\x0A\x0B\x0C\x0D\x85\u2028\u2029]([\uFEFF\u0009\u0020\u00A0\u1680\u2000-\u200A\u202F\u205F\u3000]*)$/,$r=/(?:^|[^\\\x0A\x0B\x0C\x0D\x85\u2028\u2029\uFEFF\u0009\u0020\u00A0\u1680\u2000-\u200A\u202F\u205F\u3000])(?:\\\\)*[\x0A\x0B\x0C\x0D\x85\u2028\u2029\uFEFF\u0009\u0020\u00A0\u1680\u2000-\u200A\u202F\u205F\u3000]*[\x0A\x0B\x0C\x0D\x85\u2028\u2029]([\uFEFF\u0009\u0020\u00A0\u1680\u2000-\u200A\u202F\u205F\u3000]*)(?:\\[\x0A\x0B\x0C\x0D\x85\u2028\u2029\uFEFF\u0009\u0020\u00A0\u1680\u2000-\u200A\u202F\u205F\u3000]*)*$/,Ar=/(\x0D\x0A|[\x0A\x0B\x0C\x0D\x85\u2028\u2029])([\uFEFF\u0009\u0020\u00A0\u1680\u2000-\u200A\u202F\u205F\u3000]*)([^\x0A\x0B\x0C\x0D\x85\u2028\u2029\uFEFF\u0009\u0020\u00A0\u1680\u2000-\u200A\u202F\u205F\u3000]?)/g,Tr=/([^\x0A\x0B\x0C\x0D\x85\u2028\u2029\uFEFF\u0009\u0020\u00A0\u1680\u2000-\u200A\u202F\u205F\u3000])[\x0A\x0B\x0C\x0D\x85\u2028\u2029\uFEFF\u0009\u0020\u00A0\u1680\u2000-\u200A\u202F\u205F\u3000]*$/;function It(e,t,r){if(!De.test(t))return e.push(new N("Raw strings with three quotes must be multiline strings",{token:r})),t;if(!De.test(t[0]))return e.push(new N("Multi-line strings must start with a newline",{token:r})),t;let o=Er.exec(t)?.[1];if(o==null)return e.push(new N("The final line in a multiline string may only contain whitespace",{token:r})),t;return t.replace(Ar,(s,i,a,l,u)=>{if(!l)return`
|
|
6
|
+
`;if(!a.startsWith(o)){let c=ze(r,t,u+i.length);return e.push(new N("Every non-blank line of a multi-line string must start with the offset defined by the last line of the string",{token:r,start:c,end:{offset:c.offset+o.length,line:c.line,column:c.column+o.length}})),`
|
|
7
|
+
`}return`
|
|
8
|
+
`+a.slice(o.length)+l}).slice(1,-1)}var Sr=/\\(?:$|u\{(0[0-9a-fA-F]{0,5}|10[0-9a-fA-F]{4}|[1-9a-fA-F][0-9a-fA-F]{0,4})\}|u(\{[^}]{1,6}\}?|[0-9a-fA-F]{1,5}|10[0-9a-fA-F]{4})|([\x0A\x0B\x0C\x0D\x85\u2028\u2029\uFEFF\u0009\u0020\u00A0\u1680\u2000-\u200A\u202F\u205F\u3000]+)|.)/g;function _t(e,t,r){let o;while(o=Nr.exec(t)){let s=ze(r,t,o.indices[1][0]);e.push(new N("Strings with single quotes cannot contain any unescaped newlines, use triple-quotes for multiline strings",{token:r,start:s,end:{offset:s.offset+o[1].length,line:s.line+1,column:1}}))}return t.replace(Sr,(s,i,a,l,u)=>Ot(e,t,r,s,i,a,l,u))}var Ir=/(\x0D\x0A|[\x0A\x0B\x0C\x0D\x85\u2028\u2029])([\uFEFF\u0009\u0020\u00A0\u1680\u2000-\u200A\u202F\u205F\u3000]*)|\\(?:$|u\{(0[0-9a-fA-F]{0,5}|10[0-9a-fA-F]{4}|[1-9a-fA-F][0-9a-fA-F]{0,4})\}|u(\{[^}]{1,6}\}?|[0-9a-fA-F]{1,5}|10[0-9a-fA-F]{4})|([\x0A\x0B\x0C\x0D\x85\u2028\u2029\uFEFF\u0009\u0020\u00A0\u1680\u2000-\u200A\u202F\u205F\u3000]+)|.)/g;function vt(e,t,r){if(!wr.test(t))return e.push(new N("Strings with three quotes must be multiline strings",{token:r})),t;if(!De.test(t[0]))return e.push(new N("Multi-line strings must start with a newline",{token:r})),t;let o=$r.exec(t)?.[1];if(o==null){let s=Tr.exec(t),i=s?ze(r,t,s.index):void 0,a="The final line in a multiline string may only contain whitespace";if(s?.[0][0]==="\\")a+=" after removing escaped whitespace";return e.push(new N(a,{token:r,start:i,end:i&&{offset:i.offset,line:i.line,column:i.column+1}})),t}return t.replace(Ir,(s,i,a,l,u,c,d)=>{if(!i)return Ot(e,t,r,s,l,u,c,d);let h=t[d+i.length+(a?a.length:0)];if(De.test(h))return`
|
|
9
|
+
`;if(!a.startsWith(o)){let m=ze(r,t,d+i.length);return e.push(new N("Every non-blank line of a multi-line string must start with the offset defined by the last line of the string",{token:r,start:m,end:{offset:m.offset+o.length,line:m.line,column:m.column+o.length}})),`
|
|
10
|
+
`}return`
|
|
11
|
+
`+a.slice(o.length)}).slice(1,-1)}function Ot(e,t,r,o,s,i,a,l){if(a)return"";if(i){let u=r.text.startsWith('"""'),c=t.slice(0,l).split(De),d={offset:r.start.offset+(u?3:1)+l,line:r.start.line+(c.length-1),column:c.length===1?r.start.column+(u?3:1)+l:c.at(-1).length},h={offset:d.offset+o.length,line:d.line,column:d.column+o.length};if(!i.startsWith("{"))e.push(new N(String.raw`Invalid unicode escape "\u${i}", did you forget to use {}? "\u{${i}}"`,{token:r,start:d,end:h}));else e.push(new N(String.raw`Invalid unicode escape "\u${i.endsWith("}")?i:`${i}...`}"`,{token:r,start:d,end:h}));return""}else if(s){let u=parseInt(s,16);if(u>=55296&&u<=57343)e.push(new N(String.raw`Invalid unicode escape "\u{${s}}, only scalar values can be added using an escape`,{token:r}));return String.fromCodePoint(u)}else{let u=yr.get(o);if(u==null)return e.push(new N(o.length<2?"Invalid whitespace escape at the end of a string":`Invalid escape "${o}"`,{token:r})),"";return u}}function ze(e,t,r){let o=1;switch(e.type){case Fe:o=3;break;case le:o=e.text.indexOf('"')+1;break;case ye:o=e.text.indexOf('"')+3;break}let s=t.slice(0,r).split(De);return{offset:e.start.offset+o+r,line:e.start.line+(s.length-1),column:s.length===1?e.start.column+o+r:1+s[s.length-1].length}}function se(e){if(!e.current.done)e.lastToken=e.current.value;e.current=e.tokens.next();let t=!e.current.done&&e.current.value.errors;if(t)e.errors.push(...t)}function T(e,t){if(!e.current.done&&e.current.value.type===t){let r=e.current.value;return se(e),r}}function b(e,t){let r="current"in e?e.current.value??e.lastToken:e;return new N(t,{token:r})}function D(e,t,r,o=r){if(e.storeLocations)At(t,r,o)}function k(e="",t="",r=""){return e+t+r||void 0}function wn(e,t,{storeLocations:r=!1,flags:o}){let s={type:-1,text:"",start:{offset:0,line:1,column:1},end:{offset:0,line:1,column:1},errors:null},i={text:e,tokens:t[Symbol.iterator](),current:{done:!1,value:s},storeLocations:r,lastToken:s,errors:[],flags:o};return se(i),i}function qn(e,t){if(!t&&!e.current.done&&e.current.value.type!==ue)t=b(e,`Unexpected token ${JSON.stringify(e.current.value.text)}, did you forget to quote an identifier?`);let r=e.errors??[];if(t!=null)if(t instanceof N)if(t.errors)r.push(...t.errors);else r.push(t);else r.push(new N(`An unexpected error occurred, ${String(t)}, this is likely a bug in the KDL parser`,{cause:t}));if(r.length)if(r.length===1)throw r[0];else throw new N("Encountered multiple errors",{errors:r})}function yn(e){switch(e){case"#null":return null;case"#true":return!0;case"#false":return!1;case"#inf":return 1/0;case"#-inf":return-1/0;case"#nan":return NaN}}function Ft(e){return e==="inf"||e==="-inf"||e==="nan"||e==="true"||e==="false"||e==="null"||!1}function Hn(e){let{value:t}=e.current,r,o,s,i,a,l=!1;if(t?.text[0]==="-"||t?.text[0]==="+")a=t.text[0];switch(t?.type){case Y:{if(!e.flags.experimentalSuffixedNumbers)throw new N("Unreachable code: got a suffixed number from the tokenizer but the suffixed number flag is not set",{token:t});let d=a?t.text.slice(1):t.text,h=d.search(/[^0-9._]/);if(o=(a??"")+d.slice(0,h),r=Number.parseFloat(o.replaceAll("_","")),i=s=d.slice(h),Ft(s))e.errors.push(b(e,`Invalid suffix ${s}, values that look like keywords cannot be used as suffix`))}break;case cn:l=!0,r=(a==="-"?-1:1)*Number.parseInt(t.text.slice(a?3:2).replaceAll("_",""),2);break;case ln:l=!0,r=(a==="-"?-1:1)*Number.parseInt(t.text.slice(a?3:2).replaceAll("_",""),8);break;case re:l=!0,r=Number.parseFloat(t.text.replaceAll("_",""));break;case un:l=!0,r=(a==="-"?-1:1)*Number.parseInt(t.text.slice(a?3:2).replaceAll("_",""),16);break;case Oe:if(r=yn(t.text),r===void 0)if(r=null,yn(t.text.toLowerCase())!==void 0)e.errors.push(b(e,`Invalid keyword ${t.text}, keywords are case sensitive, write ${t.text.toLowerCase()} instead`));else switch(t.text.toLowerCase()){case"#nul":case"#nill":e.errors.push(b(e,`Invalid keyword ${t.text}, did you mean #null?`));break;case"#fals":case"#fasle":e.errors.push(b(e,`Invalid keyword ${t.text}, did you mean #false?`));break;case"#ture":case"#treu":e.errors.push(b(e,`Invalid keyword ${t.text}, did you mean #true?`));break;case"#ifn":e.errors.push(b(e,`Invalid keyword ${t.text}, did you mean #inf?`));break;case"#-ifn":e.errors.push(b(e,`Invalid keyword ${t.text}, did you mean #-inf?`));break;default:e.errors.push(b(e,`Invalid keyword ${t.text}, surround it with quotes to use a string`))}break;default:return}se(e);let u=e.flags.experimentalSuffixedNumbers&&T(e,Oe);if(u)if(l){if(i=u.text,yn(i)!==void 0)e.errors.push(b(u,`Invalid number suffix ${i}, did you forget a space between the number and the keyword?`));s=i.slice(1)}else if(s)e.errors.push(b(u,"Unexpected hashed suffix, a number can only have one suffix"));else if(typeof r==="number")e.errors.push(b(u,"Unexpected hashed suffix, you cannot place suffixes on number keywords"));else e.errors.push(b(u,"Unexpected hashed suffix, you can only place suffixes on numbers"));let c=new Q(r);if(c.representation=o??t.text,D(e,c,t),s){let d=new ee(s);d.representation=i,d.suffix=!0,D(e,d,e.lastToken),c.tag=d}return c}function Ke(e){if(e.current.done)return;let{value:t}=e.current,r;switch(t.type){case F:if(se(e),Ft(t.text))e.errors.push(b(e,`Invalid keyword "${t.text}", add a leading # to use the keyword or surround with quotes to make it a string`));r=[t.text,t.text,t];break;case Ve:se(e),r=[_t(e.errors,t.text.slice(1,-1),t),t.text,t];break;case Fe:se(e),r=[vt(e.errors,t.text.slice(3,-3),t),t.text,t];break;case le:{se(e);let o=t.text,s=o.indexOf('"');r=[St(e.errors,o.slice(s+1,-(s+1)),t),o,t];break}case ye:{se(e);let o=t.text,s=o.indexOf('"');r=[It(e.errors,o.slice(s+3,-(s+3)),t),o,t];break}default:return}if(T(e,Oe))e.errors.push(b(e.lastToken,yn(e.lastToken.text)===void 0?"Unexpected hashed suffix on a string, you can only place suffixes on numbers":"Unexpected keyword, did you forget to add whitespace?"));return r}function zn(e){let t=Ke(e);if(!t)return;let r=new G(t[0]);return r.representation=t[1],D(e,r,t[2],e.lastToken),r}function bn(e){let t=Hn(e);if(t)return t;let r=Ke(e);if(!r)return;let o=new Q(r[0]);return o.representation=r[1],D(e,o,r[2],e.lastToken),o}function Ge(e){let t=T(e,pn);if(!t)return;let{value:r}=e.current;return se(e),t.text+(r?.text??"")}function Nn(e){return T(e,hn)?.text}function Kn(e){return T(e,xe)??Nn(e)}function En(e){let t=T(e,dn);if(!t)return;while(Kn(e));if(!Ge(e)&&!T(e,fe)&&!T(e,ue))e.errors.push(b(e,`Expected newline or single-line comment after backslash but got ${e.current.value?.text??"EOF"}`));return e.text.slice(t.start.offset,e.lastToken.end.offset)}function he(e){let t=e.lastToken.end;while(T(e,fe)?.text??Ge(e)??Kn(e)??En(e));if(e.lastToken.end===t)return;return e.text.slice(t.offset,e.lastToken.end.offset)}function O(e){let t=e.lastToken.end;while(Kn(e)??En(e));if(e.lastToken.end===t)return;return e.text.slice(t.offset,e.lastToken.end.offset)}function Un(e){let t=T(e,rn);if(!t)return;let r=O(e),o=Ke(e);if(!o&&e.current.value){let l=e.current.value;if(he(e))e.errors.push(b(l,"This type of whitespace is not allowed inside a tag"));o=Ke(e)}if(!o){if(Hn(e))e.errors.push(b(e,"Invalid tag, did you forget to quote a string?")),o=["error","error"]}if(!o)throw b(e,"Invalid tag, did you forget to quote a string?");let s=O(e),i=T(e,Be);if(!i&&e.current.value){let l=e.current.value;if(he(e))e.errors.push(b(l,"This type of whitespace is not allowed inside a tag"));i=T(e,Be)}if(!i)throw b(e,"Invalid tag, did you forget to quote a string?");let a=new ee(o[0]);return a.representation=o[1],a.leading=r,a.trailing=s,D(e,a,t,e.lastToken),a}function $n(e){return Ge(e)??T(e,fe)?.text??T(e,an)?.text??T(e,ue)?.text}function Gn(e){if(!T(e,on))return;let t=Rt(e);if(!T(e,sn))throw b(e,"Invalid node children");return t}function Le(e){let t=e.current.value;{let h=Un(e);if(h){let m=O(e),g=bn(e);if(!g)throw b(e,"Invalid argument");if(g.tag)e.errors.push(b(e.lastToken,"A number suffix cannot be combined with a regular tag"));g.tag=h,g.betweenTagAndValue=m;let V=new W(g,null);D(e,g,t,e.lastToken),D(e,V,t,e.lastToken);let Te=O(e);if(T(e,ve))e.errors.push(b(e.lastToken,typeof g.value==="string"?"Unexpected equals sign, properties are name=(tag)value not (tag)name=value":"Unexpected equals sign")),Te=k(Te,O(e))||" ";return[V,Te]}}{let h=Hn(e);if(h){let m=new W(h,null);D(e,m,t,e.lastToken);let g=O(e);if(T(e,ve))e.errors.push(b(e.lastToken,"Unexpected equals sign, did you forget to quote the property name?")),g=k(g,O(e))||" ";return[m,g]}}let r=Ke(e);if(!r)return;let o=O(e),s=T(e,ve);if(!s){let h=new Q(r[0]);h.representation=r[1],D(e,h,r[2]);let m=new W(h,null);return D(e,m,t,e.lastToken),[m,o]}let i=new G(r[0]);i.representation=r[1],D(e,i,r[2]);let a=O(e),l=Un(e),u=l&&O(e),c=bn(e);if(!c)throw b(e,"Expected a value");if(l){if(c.tag)e.errors.push(b(e.lastToken,"A number suffix cannot be combined with a regular tag"));c.tag=l,c.betweenTagAndValue=u}let d=new W(c,i);return D(e,d,t,e.lastToken),d.equals=k(o,s.text,a),[d,void 0]}function kt(e){let t=O(e)??"",r;while(r=Ee(e)){let a=e.lastToken.end,l=Le(e);if(!l)throw b(e,"Expected a property or argument");if(!(l[1]??O(e)))throw b(e,"Expected space after slashdashed property or argument");t=t+r+e.text.slice(a.offset,e.lastToken.end.offset)}let o=Le(e);if(!o)return;let s=o[1]??O(e)??"";while(r=Ee(e)){let a=e.lastToken.end,l=Le(e);if(!l)throw b(e,"Expected a property or argument");if(!(l[1]??O(e)))break;s=s+r+e.text.slice(a.offset,e.lastToken.end.offset)}let i=o[0];return i.leading=t,i.trailing=s,i}function Ee(e){let t=T(e,ge)?.text;if(!t)return;return k(t,he(e))}function An(e){let t=e.current.value,r=Un(e),o=r&&O(e),s=zn(e);if(!s)if(r)throw b(e,"Couldn't find node name");else return;let i=O(e),a=i!=null,l=Ee(e),u=[];while(a||l){let m=e.lastToken.end,g=Le(e);if(!g)break;if(l)a=(g[1]||O(e))!=null,i=k(i,l,e.text.slice(m.offset,e.lastToken.end.offset)),l=Ee(e);else{let V=g[0];V.leading=i,u.push(V),i=g[1]||O(e),a=i!=null,l=Ee(e)}}let c,d;while(!0){l??=Ee(e);let m=e.lastToken.end,g=Gn(e);if(!g){if(l)throw b(e,"Unexpected slashdash");break}if(l)i=k(i,l,e.text.slice(m.offset,e.lastToken.end.offset)),l=void 0;else{if(c)e.errors.push(b(e,"A node can only have one children block"));c=g,d=i??"",i=void 0}i=k(i,O(e))}let h=new Re(s,u,c);return h.tag=r??null,h.betweenTagAndName=o,h.beforeChildren=d,h.trailing=i??"",D(e,h,t,e.lastToken),h}function Ct(e){let t=he(e),r=An(e);if(!r)return;let o=k($n(e),he(e));return r.leading=k(t,r.leading),r.trailing=k(r.trailing,o),r}function Jt(e){let t=T(e,_e)?.text,r=Rt(e);if(!t)return r;if(r.nodes[0])r.nodes[0].leading=k(t,r.nodes[0].leading);else r.trailing=k(t,r.trailing);return r}function Rt(e){let t=e.current.value,r=[],o=!0,s=he(e);while(o){let a=e.lastToken.end,l=Ee(e),u=An(e);if(!u){if(l)throw b(e,"Unexpected slashdash");break}let c=O(e),d=$n(e);if(l)s=k(s,e.text.slice(a.offset,e.lastToken.end.offset),he(e));else u.trailing=k(u.trailing,c,d)??"",r.push(u),u.leading=s??"",s=he(e);o=d!=null}let i=new pe(r);return D(e,i,t,e.lastToken),i.trailing=s??"",i}function Mt(e,t){let r=[],o;while(o=t(e))r.push(o);return r.length>0?r:void 0}function _r(e){{let t=T(e,_e);if(t)return{type:"bom",text:t.text}}{let t=T(e,fe);if(t)return{type:"newline",text:t.text}}{let t=T(e,xe);if(t)return{type:"space",text:t.text}}{let t=Ge(e);if(t)return{type:"singleline",text:t}}{let t=Nn(e);if(t)return{type:"multiline",text:t}}return}function Tn(e){{let t=En(e);if(t)return{type:"line-escape",text:t}}{let t=T(e,xe);if(t)return{type:"space",text:t.text}}{let t=Nn(e);if(t)return{type:"multiline",text:t}}return}function Dt(e){let t=[];while(!0){{let r=_r(e);if(r){t.push(r);continue}}if(T(e,ge)?.text){let o,s=Mt(e,Tn)??[],i=An(e);if(!i)throw b(e,"Invalid slashdash, expected a commented node");i.trailing=k(i.trailing,Mt(e,Tn)?.map((a)=>a.text).join(""),$n(e)),t.push({type:"slashdash",preface:s,value:i});continue}break}return t}function vr(e){let t=T(e,ge);if(t==null)return;let r,o=[];while(r=Tn(e))o.push(r);let s,i,a="";if(i=Le(e)){if(s=i[0],i[1])a=i[1]}else if(i=Gn(e))s=i;else throw b(t,"Couldn't find argument, property, or children that were commented by slashdash");return[{type:"slashdash",preface:o,value:s},a]}function Qn(e){let t=[];while(!0){let r=Tn(e);if(!r)break;let o=!0;t.push(r);while(o){let s=vr(e);if(!s)break;if(t.push(s[0]),s[1][0])t.push(...Qn(wn(s[1][0],He(s[1][0],{flags:e.flags}),{flags:e.flags})));o=!!s[1][0]}}return t}var Or={value:bn,identifier:zn,node:Ct,entry:kt,document:Jt,"whitespace in document":Dt,"whitespace in node":Qn};function me(e,{as:t="document",flags:r,...o}={}){let s=Or[t];if(s==null)throw TypeError(`Invalid "as" target passed: ${JSON.stringify(t)}`);if(typeof e!=="string"){if(typeof TextDecoder!=="function")throw TypeError("Uint8Array input is only supported on platforms that include TextDecoder");e=new TextDecoder("utf-8",{fatal:!0}).decode(e)}let i=Tt(r),a=He(e,{...o,flags:i}),l=wn(e,a,{...o,flags:i}),u;try{u=s(l)}catch(c){qn(l,c)}if(qn(l),!u)throw new N(`Expected ${/^[aeiouy]/.exec(t)?"an":"a"} ${t}`);return u}class L extends Error{column;line;offset;reason;constructor(e,t=null){super(t?`${e} (line ${t.line}, column ${t.column})`:e);this.name="JxnError",this.column=t?.column??null,this.line=t?.line??null,this.offset=t?.offset??null,this.reason=e}inFile(e){let t=this.line!==null&&this.column!==null&&this.offset!==null?{column:this.column,line:this.line,offset:this.offset}:null;return new L(`${e}: ${this.reason}`,t)}}function Qe(e,t){let r=e.slice(0,t),o=r.split(`
|
|
12
|
+
`).length;return{column:t-r.lastIndexOf(`
|
|
13
|
+
`),line:o,offset:t}}var Lt=new Set(["onabort","onactivate","onaddsourcebuffer","onaddtrack","onadvertisementreceived","onafterprint","onanimationcancel","onanimationend","onanimationiteration","onanimationstart","onappinstalled","onaudioend","onaudioprocess","onaudiostart","onauxclick","onavailabilitychanged","onbackgroundfetchabort","onbackgroundfetchclick","onbackgroundfetchfail","onbackgroundfetchsuccess","onbeforeinput","onbeforeinstallprompt","onbeforematch","onbeforeprint","onbeforetoggle","onbeforexrselect","onbegin","onblocked","onblur","onboundary","onbufferedamountlow","onbufferedchange","oncancel","oncanmakepayment","oncanplay","oncanplaythrough","oncaptureaction","oncapturedmousechange","oncapturehandlechange","onchange","oncharacterboundsupdate","oncharacteristicvaluechanged","onchargingchange","onchargingtimechange","onclick","onclose","onclosing","oncommand","oncomplete","oncompositionend","oncompositionstart","onconfigurationchange","onconnect","onconnecting","onconnectionavailable","onconnectionstatechange","oncontentdelete","oncontextlost","oncontextmenu","oncontextoverflow","oncontextrestored","oncontrollerchange","oncookiechange","oncopy","oncuechange","oncurrententrychange","oncurrentscreenchange","oncut","ondataavailable","ondatachannel","ondblclick","ondequeue","ondevicechange","ondevicemotion","ondeviceorientation","ondeviceorientationabsolute","ondischargingtimechange","ondisconnect","ondispose","ondownloadprogress","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onencrypted","onend","onended","onendstreaming","onenter","onenterpictureinpicture","onerror","onexit","onfencedtreeclick","onfetch","onfinish","onfocus","onformdata","onframeratechange","onfreeze","onfullscreenchange","onfullscreenerror","ongamepadconnected","ongamepaddisconnected","ongatheringstatechange","ongattserverdisconnected","ongeometrychange","ongotpointercapture","onhashchange","onicecandidate","onicecandidateerror","oniceconnectionstatechange","onicegatheringstatechange","oninput","oninputreport","oninputsourceschange","oninstall","oninstallresult","oninvalid","onisolationchange","onkeydown","onkeyframerequest","onkeypress","onkeystatuseschange","onkeyup","onlanguagechange","onlayoutchange","onleavepictureinpicture","onlevelchange","onload","onloadeddata","onloadedmetadata","onloadend","onloading","onloadingdone","onloadingerror","onloadstart","onlocation","onlostpointercapture","onmanagedconfigurationchange","onmark","onmessage","onmessageerror","onmidimessage","onmousedown","onmouseenter","onmouseleave","onmousemove","onmouseout","onmouseover","onmouseup","onmute","onnavigate","onnavigateerror","onnavigatesuccess","onnegotiationneeded","onnomatch","onnotificationclick","onnotificationclose","onoffline","ononline","onopen","onorientationchange","onpagehide","onpagereveal","onpageshow","onpageswap","onpaste","onpause","onpayerdetailchange","onpaymentmethodchange","onpaymentrequest","onperiodicsync","onplay","onplaying","onpointercancel","onpointerdown","onpointerenter","onpointerleave","onpointerlockchange","onpointerlockerror","onpointermove","onpointerout","onpointerover","onpointerrawupdate","onpointerup","onpopstate","onportalactivate","onprerenderingchange","onprioritychange","onprocessorerror","onprogress","onpromptaction","onpromptdismiss","onpush","onpushsubscriptionchange","onquotaoverflow","onratechange","onreading","onreadingerror","onreadystatechange","onredraw","onreflectionchange","onrejectionhandled","onrelease","onremove","onremovesourcebuffer","onremovetrack","onrepeat","onreset","onresize","onresourcetimingbufferfull","onresult","onresume","onrtctransform","onscreenschange","onscroll","onscrollend","onsecuritypolicyviolation","onseeked","onseeking","onselect","onselectedcandidatepairchange","onselectend","onselectionchange","onselectstart","onserviceadded","onservicechanged","onserviceremoved","onshippingaddresschange","onshippingoptionchange","onshow","onsignalingstatechange","onsinkchange","onslotchange","onsnapchanged","onsnapchanging","onsoundend","onsoundstart","onsourceclose","onsourceended","onsourceopen","onspeechend","onspeechstart","onsqueeze","onsqueezeend","onsqueezestart","onstalled","onstart","onstartstreaming","onstatechange","onstop","onstorage","onstream","onsubmit","onsuccess","onsuspend","onsync","onterminate","ontextformatupdate","ontextupdate","ontimeout","ontimeupdate","ontoggle","ontonechange","ontoolactivated","ontoolcancel","ontoolchange","ontouchcancel","ontouchend","ontouchmove","ontouchstart","ontrack","ontransitioncancel","ontransitionend","ontransitionrun","ontransitionstart","onuncapturederror","onunhandledrejection","onunload","onunmute","onupdate","onupdateend","onupdatefound","onupdatestart","onupgradeneeded","onvalidationstatuschange","onversionchange","onvisibilitychange","onvoiceschanged","onvolumechange","onwaiting","onwaitingforkey","onwebkitanimationend","onwebkitanimationiteration","onwebkitanimationstart","onwebkittransitionend","onwheel","onzoomlevelchange"]);var Fr=/(?![\t\n\v\f\r])\p{Cc}/u,kr=new Set(["array","fn","object","on","ref"]),Cr=new Set(["attributes","script","state","style"]);function E(e,t,r,o,s){let i=t.normalize("NFC");if(i==="__proto__")throw S(o,s,'"__proto__" cannot be a key: it would not be data');if(Object.hasOwn(e,i))throw S(o,s,`"${i}" is written twice, and one of them would be lost`);e[i]=r}function S(e,t,r){let o=Wt(t)?.start;return new L(r,o===void 0?null:Qe(e.text,o))}function Wt(e){let t=Ce(e);return t?{end:t.end.offset,start:t.start.offset}:null}function j(e,t,r){let o=e.spans?Wt(r):null;if(o)e.spans?.set(t,o)}function X(e){return e.replaceAll("~","~0").replaceAll("/","~1")}function In(e,t){let r=t.getTag();if(r!==null&&!kr.has(r))throw S(e,t,`(${r}) is not an annotation Jx Notation has`);if(r==="ref")throw S(e,t,"(ref) annotates a value, and this is a name");return r}function je(e,t){let r=t.getTag(),o=t.getValue();if(r!==null&&r!=="ref")throw S(e,t,`(${r}) cannot annotate a value here; only (ref) can`);if(J(o)){if(!Number.isFinite(o))throw S(e,t,"JSON has no way to hold #inf or #nan");if(Number.isInteger(o)&&!Number.isSafeInteger(o))throw S(e,t,"This number is too large to survive being read as JSON")}if(r==="ref"){if(!n(o))throw S(e,t,"(ref) needs a string");return{$ref:o}}return o}function $e(e,t){return t.entries.filter((r)=>!r.name).map((r)=>je(e,r))}function Ae(e){return e.entries.filter((t)=>t.name)}function P(e){return e.children?.nodes??[]}function Xe(e){return e.getName()??""}function Jr(e,t,r){let o={$prototype:"Function"},s=$e(e,t),i=P(t);for(let a of Ae(t))E(o,Xe(a),je(e,a),e,a);if(i.length>0){if(s.length>0)E(o,"parameters",s,e,t);E(o,"body",Xn(e,i,`${r}/body`),e,t)}else if(s.length>0){let a=s.at(-1)??null,l=s.slice(0,-1);if(l.length>0)E(o,"parameters",l,e,t);E(o,"body",a,e,t)}return j(e,r,t),o}function Xn(e,t,r){return t.map((o,s)=>{if(o.getName()!=="-")throw S(e,o,`A list holds only "-" items, and this is "${o.getName()}"`);return ne(e,o,`${r}/${s}`)})}function ne(e,t,r){let o=In(e,t);if(j(e,r,t),o==="fn")return Jr(e,t,r);let s=$e(e,t),i=Ae(t),a=P(t);if(o==="array"){if(i.length>0)throw S(e,t,"(array) holds items, and these are named");return[...s,...Xn(e,a,r)]}if(o!=="object"){if(s.length>1){if(i.length>0||a.length>0)throw S(e,t,"A list of values cannot also have names or a block");return s}if(s.length===1){if(i.length>0||a.length>0)throw S(e,t,"A value cannot also have names or a block");return s[0]??null}if(a.length>0&&i.length===0&&a.every((u)=>u.getName()==="-"))return Xn(e,a,r)}else if(s.length>0)throw S(e,t,"(object) holds names, and this is a value");let l={};for(let u of i){let c=Xe(u);E(l,c,je(e,u),e,u),j(e,`${r}/${X(c)}`,u)}for(let u of a){let c=u.getName();E(l,c,ne(e,u,`${r}/${X(c)}`),e,u)}return l}function Bt(e,t,r){let o={};if(j(e,r,t),$e(e,t).length>0)throw S(e,t,"A style block holds declarations, and this is a value");for(let s of Ae(t)){let i=Xe(s);E(o,i,je(e,s),e,s),j(e,`${r}/${X(i)}`,s)}for(let s of P(t)){let i=s.getName(),a=`${r}/${X(i)}`,l=P(s);if(s.getTag()==="array"||l.length>0&&l.every((c)=>c.getName()==="-")){E(o,i,ne(e,s,a),e,s);continue}let u=$e(e,s);if(u.length>1)throw S(e,s,`"${i}" has more than one value. A selector with a space in it needs quotes`);if(u.length===1){if(Ae(s).length>0||P(s).length>0)throw S(e,s,`"${i}" has a value and names. A selector with a space in it needs quotes`);E(o,i,u[0]??null,e,s),j(e,a,s)}else E(o,i,Bt(e,s,a),e,s)}return o}function Sn(e,t,r){let o=P(t);if(o.length!==1||!o[0])throw S(e,t,`"${t.getName()}" holds one element`);return Pt(e,o[0],r)}function Vt(e,t,r){let o={$prototype:"Array"};if(j(e,r,t),$e(e,t).length>0)throw S(e,t,"$array holds names and one element, and this is a value");for(let s of Ae(t)){let i=Xe(s);E(o,i.startsWith(".")?i.slice(1):i,je(e,s),e,s)}if(P(t).length>0)E(o,"map",Sn(e,t,`${r}/map`),e,t);return o}function Pt(e,t,r){let o=t.getName();if(o==="-"){let s=$e(e,t);if(s.length!==1||Ae(t).length>0||P(t).length>0)throw S(e,t,'"-" is one piece of text or one (ref)');return j(e,r,t),s[0]??null}if(o==="$array")return Vt(e,t,r);return Yn(e,t,r)}function Rr(e,t,r,o){let s=In(e,r);if(t==="map")return Sn(e,r,o);if(t==="cases"){let i={};for(let a of P(r)){let l=a.getName();E(i,l,Sn(e,a,`${o}/${X(l)}`),e,a)}return i}if(t==="children"&&s!=="array"&&P(r).length>0)return Sn(e,r,o);return ne(e,r,o)}function Yn(e,t,r){let o={},s=t.getName(),i=In(e,t);if(j(e,r,t),i!==null)throw S(e,t,`(${i}) cannot annotate an element`);let a=$e(e,t);if(s==="$element"){let[u,c,...d]=a;if(d.length>0)throw S(e,t,"$element takes at most a tag and a text value");if(u!==void 0)E(o,"tagName",u,e,t);if(c!==void 0)E(o,"textContent",c,e,t)}else{if(s.startsWith("$"))throw S(e,t,`"${s}" is not a kind of element`);if(E(o,"tagName",s,e,t),a.length>1)throw S(e,t,"An element has one text value. A list of them needs a block");if(a[0]!==void 0)E(o,"textContent",a[0],e,t),j(e,`${r}/textContent`,t)}Mr(e,t,o,r);let l=[];for(let u of P(t))Dr(e,u,o,l,r);if(l.length>0)E(o,"children",l,e,t);return o}function Ut(e){let{attributes:t}=e;if(f(t))return t;let r={};return e.attributes=r,r}function Mr(e,t,r,o){for(let s of Ae(t)){let i=Xe(s),a=s.getTag();if(a==="fn")throw S(e,s,"A function has a block form: (fn)name, on a line of its own");let l=je(e,s);if(i.startsWith(".")||i.startsWith("$")){let u=i.startsWith(".")?i.slice(1):i;E(r,u,l,e,s),j(e,`${o}/${X(u)}`,s)}else if(i.startsWith("on")&&a==="ref")E(r,i,l,e,s),j(e,`${o}/${X(i)}`,s);else if(i.startsWith("on")&&Lt.has(i))throw S(e,s,`${i} needs (ref)"pointer", or a function on a line of its own: (fn)${i} "…"`);else E(Ut(r),i,l,e,s),j(e,`${o}/attributes/${X(i)}`,s)}}function Dr(e,t,r,o,s){let i=t.getName(),a=In(e,t),l=(u)=>`${s}/${X(u)}`;if(a==="fn"||a==="on"){if(!i.startsWith("on"))throw S(e,t,`(${a}) in an element marks a handler, and "${i}" is not one`);E(r,i,ne(e,t,l(i)),e,t)}else if(i==="script")throw S(e,t,'"script" is reserved. A <script> element is $element "script"');else if(i==="state")E(r,"state",ne(e,t,l("state")),e,t);else if(i==="style")E(r,"style",Bt(e,t,l("style")),e,t);else if(i==="attributes"){let u=ne(e,t,l("attributes"));if(f(u))for(let[c,d]of Object.entries(u))E(Ut(r),c,d,e,t);else E(r,"attributes",u,e,t)}else if(i.startsWith(".")){let u=i.slice(1);E(r,u,Rr(e,u,t,l(u)),e,t)}else if(i.startsWith("$")&&i!=="$array"&&i!=="$element")E(r,i,ne(e,t,l(i)),e,t);else{if(Cr.has(i))throw S(e,t,`"${i}" is reserved here`);o.push(Pt(e,t,`${s}/children/${o.length}`))}}function Lr(e,t){return P(t).map((r,o)=>{let s=`/$head/${o}`;return r.getName()==="-"?ne(e,r,s):Yn(e,r,s)})}function jr(e){let t=Fr.exec(e);if(t)throw new L(`A raw control character (U+${t[0].codePointAt(0)?.toString(16).toUpperCase().padStart(4,"0")}) cannot be in a Jx Notation file. Escape it, as \\u{1b}`,Qe(e,t.index));try{return me(e,{storeLocations:!0})}catch(r){let s=(r instanceof N?r.errors?.[0]??r:null)?.start,i=r instanceof Error?r.message:String(r);throw new L(i.split(`
|
|
14
|
+
`)[0]??i,s?Qe(e,s.offset):null)}}function qt(e){if(w_(e.text)==="project")throw new L('This is a project file: its first node is "project". A document has an element there, and a <project> element is $element "project"');let r=jr(e.text),o={},s=null;for(let i of r.nodes){let a=i.getName();if(a==="$head"&&i.getTag()===null)E(o,a,Lr(e,i),e,i);else if(a.startsWith("$")&&a!=="$array"&&a!=="$element")E(o,a,ne(e,i,`/${X(a)}`),e,i),j(e,`/${X(a)}`,i);else if(s)throw S(e,i,"A document has one root element, and this is a second");else s=i}if(s){let i=s.getName()==="$array"?Vt(e,s,""):Yn(e,s,"");for(let[a,l]of Object.entries(i))E(o,a,l,e,s)}return H_(o)}function uf(e,t){try{return qt({spans:null,text:e})}catch(r){throw t!==void 0&&r instanceof L?r.inFile(t):r}}function Zn(e){let t=new Map;return{document:qt({spans:t,text:e}),spans:t}}function By(e){return e.toLowerCase().endsWith(".jxn")}function x_(e){return e.endsWith(".json")||By(e)}var qs=new Map([["b",String.raw`\b in a quoted string is a backspace, not a word boundary. Use a raw string, like #"…"#, if this is a pattern.`],["s",String.raw`\s in a quoted string is a space, not whitespace. Use a raw string, like #"…"#, if this is a pattern.`]]);function We(e,t=!1){if(Array.isArray(e))return`[${e.map((s)=>We(s,t)).join(",")}]`;if(!f(e))return e===void 0?"null":JSON.stringify(e);return`{${(t?Object.keys(e):Object.keys(e).toSorted()).map((s)=>`${JSON.stringify(s)}:${We(e[s],t||s==="style")}`).join(",")}}`}function Wr(e,t){let r=e;for(let o of t.split("/").slice(1)){let s=o.replaceAll("~1","/").replaceAll("~0","~");if(Array.isArray(r))r=r[Number(s)];else r=f(r)?r[s]:void 0}return r}function Br({spans:e}){let t=new Map;for(let[r,o]of e){let s=t.get(o.start);if(s===void 0||r.length<s.length)t.set(o.start,r)}return t}function Ht(e,t){let r=Br(e),o=new Map;for(let[s,i]of r)o.set(s,We(Wr(e.document,i)));return{meanings:o,pointers:r,text:t}}function ie(e){let t=Ce(e);return{end:t?.end.offset??0,start:t?.start.offset??0}}function vn(e,t){let{end:r,start:o}=ie(e);return t.slice(o,r).trimEnd()}function _n(e,t){let{end:r,start:o}=ie(e);return`${e.leading??" "}${t.slice(o,r).trimEnd()}`}function rt(e){return e.children?.nodes??[]}function et(e){let t=e.entries.map((i)=>`${i.getName()??""}=(${i.getTag()??""})${JSON.stringify(i.getValue())}`),r=t.filter((i)=>!i.startsWith("=")).toSorted(),o=t.filter((i)=>i.startsWith("=")),s=rt(e).map((i)=>et(i));return`(${e.getTag()??""})${e.getName()} ${[...r,...o].join(" ")} {${s.join(";")}}`}function nt(e,t,r){if(et(t)===et(r))return!0;let o=e.previous.meanings.get(ie(t).start);return o!==void 0&&o===e.next.meanings.get(ie(r).start)}function zt(e){let r=e.entries.filter((o)=>["$id","key"].includes(o.getName()??"")).map((o)=>JSON.stringify(o.getValue()));return`(${e.getTag()??""})${e.getName()} ${r.join(" ")}`}function Kt(e,t,r){let o=e.length+1,s=t.length+1,i=new Int32Array(o*s);for(let c=e.length-1;c>=0;c-=1)for(let d=t.length-1;d>=0;d-=1){let h=e[c],m=t[d];i[c*s+d]=h!==void 0&&m!==void 0&&r(h,m)?(i[(c+1)*s+d+1]??0)+1:Math.max(i[(c+1)*s+d]??0,i[c*s+d+1]??0)}let a=[],l=0,u=0;while(l<e.length&&u<t.length){let c=e[l],d=t[u];if(c!==void 0&&d!==void 0&&r(c,d))a.push([l,u]),l+=1,u+=1;else if((i[(l+1)*s+u]??0)>=(i[l*s+u+1]??0))l+=1;else u+=1}return a}function Vr(e,t,r){let o=new Map,s=new Set,i=(c,d)=>{let h=t[c];if(h)o.set(d,h),s.add(c)},a=Kt(t,r,(c,d)=>nt(e,c,d)),l=0,u=0;for(let[c,d]of[...a,[t.length,r.length]]){let h=Kt(t.slice(l,c),r.slice(u,d),(m,g)=>zt(m)===zt(g));for(let[m,g]of h)i(l+m,u+g);if(c<t.length)i(c,d);l=c+1,u=d+1}for(let[c,d]of r.entries())if(!o.has(c)){let h=t.findIndex((m,g)=>!s.has(g)&&nt(e,m,d));if(h!==-1)i(h,c)}return o}function ot(e){let t=e.leading??"";return t.slice(t.lastIndexOf(`
|
|
15
|
+
`)+1)}function Pr(e,t,r){return e.split(`
|
|
16
|
+
`).map((o,s)=>s>0&&o.startsWith(t)?r+o.slice(t.length):o).join(`
|
|
17
|
+
`)}function Ur(e,t,r){let o=[...r],s=(a)=>{let l=a.getName(),u=o.findIndex((c)=>c.getName()===l);return u===-1?void 0:o.splice(u,1)[0]},i="";for(let a of t.entries){let l=s(a);if(l){let u=l.getTag()===a.getTag()&&l.getValue()===a.getValue();i+=u?_n(a,e.previous.text):`${a.leading??" "}${_n(l,e.next.text).trimStart()}`}}for(let a of o)i+=` ${_n(a,e.next.text).trimStart()}`;return i}function qr(e,t,r){let o=new Map;for(let i of rt(t)){let a=e.previous.pointers.get(ie(i).start);if(a!==void 0)o.set(a,i)}let s=new Map;for(let i of r.entries){let a=e.next.pointers.get(ie(i).start),l=a===void 0?void 0:o.get(a);if(l&&i.getName()!==null)s.set(l,i)}return s}function Hr(e,t,r){let{text:o}=e.previous,s=_n(r,e.next.text).trimStart().slice(`${r.getName()}=`.length),[i]=t.entries;if(i?.getName()===null&&t.entries.length===1&&!t.children){if(i.getValue()===r.getValue()&&i.getTag()===r.getTag())return vn(t,o);return`${tt(t,o)}${i.leading??" "}${s}`}return`${tt(t,o)} ${s}`}function tt(e,t){let{start:r}=ie(e),[o]=e.entries;if(o)return t.slice(r,ie(o).start-(o.leading??"").length);let s=e.children&&Ce(e.children);if(s)return t.slice(r,s.start.offset-1).trimEnd();return vn(e,t)}function zr(e,t,r,o){let s=qr(e,t,r),i=new Set(s.values()),a=r.entries.filter((g)=>!i.has(g)),l=`${tt(t,e.previous.text)}${Ur(e,t,a)}`,u=rt(r);if(u.length===0&&s.size===0)return l;let c=u[0]?ot(u[0]):`${o} `,d=t.children,h=t.beforeChildren===""?" ":t.beforeChildren??" ";if(d&&d.nodes.length>0&&Gr(d,e.previous.text,t)){let g=`${o}${Kr(d,o)}`;return`${l}${h}{${Qt(e,d,u,g,c,s)}}`}let m=u.map((g)=>Gt(e,g,c,`${o} `));return`${l}${h}{
|
|
18
|
+
${m.join("")}${o}}`}function Kr(e,t){let[r]=e.nodes,o=r?ot(r):"";return o.startsWith(t)?o.slice(t.length):" "}function Gr(e,t,r){let{end:o,start:s}=ie(r),[i]=e.nodes;return i!==void 0&&(i.leading??"").includes(`
|
|
19
|
+
`)&&t.slice(s,o).includes(`
|
|
20
|
+
`)}function Gt(e,t,r,o){return`${o}${Pr(vn(t,e.next.text),r,o)}
|
|
21
|
+
`}function Qt(e,t,r,o,s,i){let a=t.nodes.filter((H)=>!i.has(H)),l=Vr(e,a,r),u=t.nodes[0]?.leading??"",c=u.indexOf(`
|
|
22
|
+
`),d=c===-1?"":u.slice(0,c+1),h=d,m=-1,g=()=>{if(h!==""&&!h.endsWith(`
|
|
23
|
+
`)&&!h.endsWith(";"))h+=`
|
|
24
|
+
`},V=(H,te)=>{let C=t.nodes.indexOf(H),Se=C===m+1||C>m;m=Math.max(m,C);let tn=H===t.nodes[0]?u.slice(d.length):H.leading??"";if(Se&&(tn.includes(`
|
|
25
|
+
`)||h===d||h.endsWith(";"))){h+=`${tn}${te}${H.trailing??""}`;return}if(!h.endsWith(`
|
|
26
|
+
`))h+=`
|
|
27
|
+
`;let ar=(H.trailing??"").replace(/^;/u,"");h+=`${tn.includes(`
|
|
28
|
+
`)?tn:o}${te}${ar}`},Te=(H)=>{for(let[te,C]of t.nodes.entries()){let Se=i.get(C);if(Se&&te<H&&te>m)g(),V(C,Hr(e,C,Se))}};for(let[H,te]of r.entries()){let C=l.get(H);if(C){Te(t.nodes.indexOf(C)),g();let Se=nt(e,C,te)?vn(C,e.previous.text):zr(e,C,te,ot(C));V(C,Se)}else g(),h+=Gt(e,te,s,o)}return Te(t.nodes.length),`${h}${t.trailing??""}`}function st(e,t,r){let o;try{o=r(e)}catch{return t}let s=r(t),i=We(s.document);if(We(o.document)===i)return e;let a={next:Ht(s,t),previous:Ht(o,e)},l=Qt(a,me(e,{storeLocations:!0}),me(t,{storeLocations:!0}).nodes,"","",new Map);try{return We(r(l).document)===i?l:t}catch{return t}}var R=" ",it=100,Yt=/^(?![-+]?\.?\d)(?!(?:true|false|null|inf|-inf|nan)$)[^\s\\/(){};[\]"#=,\p{Cc}\p{Cf}\p{Zl}\p{Zp}]+$/u,Zt=/[\p{Cc}\p{Zl}\p{Zp}--]/u,Qr=/(?!\n)\p{Cc}|[\p{Zl}\p{Zp}--]/u,Xr=new Set(["-","attributes","script","state","style"]),q=(e)=>f(e),On=(e)=>q(e)&&n(e.$ref)&&Object.keys(e).length===1;function er(e){return!/\p{Cs}/u.test(e)}function nr(e,t){try{return me(`x ${e}`).nodes[0]?.entries[0]?.getValue()===t}catch{return!1}}function Fn(e){let t='"';for(let r of e)if(r==='"')t+=String.raw`\"`;else if(r==="\\")t+=String.raw`\\`;else if(r===`
|
|
29
|
+
`)t+=String.raw`\n`;else if(r==="\t")t+=String.raw`\t`;else if(r==="\r")t+=String.raw`\r`;else if(Zt.test(r))t+=`\\u{${r.codePointAt(0)?.toString(16)}}`;else t+=r;return`${t}"`}function tr(e,t){let r="#";while(e.includes(t+r))r+="#";return r}function Yr(e,t){if(Qr.test(e))return null;let r=tr(e,'"""'),o=`${t}${R}`,s=e.split(`
|
|
30
|
+
`).map((a)=>a===""?"":o+a),i=`${r}"""
|
|
31
|
+
${s.join(`
|
|
32
|
+
`)}
|
|
33
|
+
${o}"""${r}`;return nr(i,e)?i:null}function at(e,t,r){if(!er(e))throw new L(`${r} holds a lone surrogate, which Jx Notation has no way to spell`);if(Yt.test(e))return e;if(e.includes(`
|
|
34
|
+
`)){let o=Yr(e,t);if(o)return o}else if((e.includes("\\")||e.includes('"'))&&!Zt.test(e)){let o=tr(e,'"'),s=`${o}"${e}"${o}`;if(nr(s,e))return s}return Fn(e)}function B(e,t){if(!er(e))throw new L(`${t} is a key with a lone surrogate, which Jx Notation cannot spell`);return Yt.test(e)?e:Fn(e)}function M(e,t,r){if(e===null)return"#null";if(e===!0)return"#true";if(e===!1)return"#false";if(J(e))return Object.is(e,-0)?"-0":String(e);if(n(e))return at(e,t,r);return On(e)?`(ref)${Fn(e.$ref)}`:null}var v=(e,t)=>`${e}/${String(t).replaceAll("~","~0").replaceAll("/","~1")}`;function rr(e){if(!q(e)||e.$prototype!=="Function")return!1;let{$prototype:t,body:r,parameters:o,...s}=e,i=Object.values(s).every((c)=>M(c,"","")!==null),a=o===void 0||Array.isArray(o)&&o.length>0&&o.every((c)=>n(c))&&r!==void 0,l=r===void 0||n(r)||Array.isArray(r),u=Array.isArray(r)&&r.length===0;return i&&a&&l&&!u}function or(e,t,r,o){let{$prototype:s,body:i,parameters:a,...l}=t,u=[`${r}(fn)${B(e,o)}`];for(let[c,d]of Object.entries(l))u.push(`${B(c,o)}=${M(d,r,v(o,c))}`);if(Array.isArray(a))for(let c of a)u.push(at(String(c),r,v(o,"parameters")));if(n(i))u.push(at(i,r,v(o,"body")));else if(Array.isArray(i))return[`${u.join(" ")} {`,...i.flatMap((c,d)=>U("-",c,r+R,v(v(o,"body"),d))),`${r}}`];return[u.join(" ")]}function U(e,t,r,o){let s=B(e,o),i=r+s,a=M(t,r,o);if(a!==null)return[`${i} ${a}`];if(rr(t))return or(e,t,r,o);if(Array.isArray(t)){if(t.length===0)return[`${r}(array)${s}`];let d=t.map((m,g)=>M(m,r,v(o,g)));if(t.length>1&&d.every((m)=>m!==null&&!m.includes(`
|
|
35
|
+
`))){let m=`${i} ${d.join(" ")}`;if(m.length<=it)return[m]}return[`${i} {`,...t.flatMap((m,g)=>U("-",m,r+R,v(o,g))),`${r}}`]}let l=q(t)?Object.entries(t):[];if(l.length===0)return[`${i} {}`];let u=l.every(([d])=>d==="-")?`${r}(object)${s}`:i,c=l.map(([d,h])=>{let m=M(h,r,v(o,d));return m===null||m.includes(`
|
|
36
|
+
`)?null:`${B(d,o)}=${m}`});if(c.every((d)=>d!==null)){let d=`${u} ${c.join(" ")}`;if(d.length<=it)return[d]}return[`${u} {`,...l.flatMap(([d,h])=>U(d,h,r+R,v(o,d))),`${r}}`]}function sr(e,t,r,o){let s=Object.entries(t),i=r+B(e,o);if(s.length===0)return[`${i} {}`];let a=[],l=0;for(let[m,g]of s){let V=M(g,r,v(o,m));if(V===null||V.includes(`
|
|
37
|
+
`))break;a.push(`${B(m,o)}=${V}`),l+=1}let u=`${i} ${a.join(" ")}`,c=a.length>0&&u.length<=it,d=c?l:0,h=s.slice(d).flatMap(([m,g])=>{if(q(g)&&!On(g))return sr(m,g,r+R,v(o,m));return U(m,g,r+R,v(o,m))});if(c&&h.length===0)return[u];return[`${c?u:i} {`,...h,`${r}}`]}function Zr(e){if(!q(e)||e.$prototype!=="Array"||!q(e.map))return!1;let{$prototype:t,map:r,...o}=e;return Object.values(o).every((s)=>{let i=M(s,"","");return i!==null&&!i.includes(`
|
|
38
|
+
`)})}function eo(e,t,r){let{$prototype:o,map:s,...i}=e,a=[`${t}$array`];for(let[l,u]of Object.entries(i))a.push(`${B(l,r)}=${M(u,t,v(r,l))}`);return[`${a.join(" ")} {`,...Ye(s??null,t+R,v(r,"map")),`${t}}`]}function Ye(e,t,r){let o=M(e,t,r);if(o!==null)return[`${t}- ${o}`];if(Zr(e))return eo(e,t,r);if(q(e))return ut(e,t,r);throw new L(`${r} is a list inside a list of children, which has no spelling`)}function no(e,t,r){let{tagName:o}=e;if(!n(o))return`${t}$element`;if(Xr.has(o)||o.startsWith("$")||o.startsWith("."))return`${t}$element ${Fn(o)}`;return t+B(o,r)}function to(e,t){return t!==null&&!t.includes(`
|
|
39
|
+
`)&&!e.startsWith("on")&&!e.startsWith("$")&&!e.startsWith(".")}function ut(e,t,r){let o=[no(e,t,r)],s=t+R,i=[],a={},l=null;for(let[u,c]of Object.entries(e)){let d=v(r,u);if(u==="tagName"&&n(c))continue;if(u==="children")continue;if(u==="textContent"){let h=M(c,t,d);if(h===null||!n(e.tagName))Xt(o,i,u,c,s,t,d);else l=h}else if(u==="attributes"&&q(c))for(let[h,m]of Object.entries(c)){let g=M(m,t,v(d,h));if(to(h,g))o.push(`${B(h,d)}=${g}`);else a[h]=m}else if(u==="state")i.push(...U("state",c,s,d));else if(u==="style"&&q(c))i.push(...sr("style",c,s,d));else if(u.startsWith("on")&&On(c))o.push(`${B(u,d)}=${M(c,t,d)}`);else if(u.startsWith("on"))i.push(...rr(c)?or(u,c,s,d):U(u,c,s,d).map((h,m)=>m===0?h.replace(s,`${s}(on)`):h));else if(u.startsWith("$")){let h=M(c,t,d);if(h===null||h.includes(`
|
|
40
|
+
`))i.push(...U(u,c,s,d));else o.push(`${B(u,d)}=${h}`)}else Xt(o,i,u,c,s,t,d)}if(Object.keys(a).length>0)i.push(...U("attributes",a,s,v(r,"attributes")));if(i.push(...ro(e.children,s,v(r,"children"))),l!==null)o.push(l);return i.length===0?[o.join(" ")]:[`${o.join(" ")} {`,...i,`${t}}`]}function ro(e,t,r){if(e===void 0)return[];if(Array.isArray(e)){if(e.length===0)return[`${t}(array).children`];return e.flatMap((s,i)=>Ye(s,t,v(r,i)))}let o=M(e,t,r);if(o!==null)return[`${t}.children ${o}`];return[`${t}.children {`,...Ye(e,t+R,r),`${t}}`]}function Xt(e,t,r,o,s,i,a){let l=B(`.${r}`,a);if(r==="map"&&q(o)){t.push(`${s}${l} {`,...Ye(o,s+R,a),`${s}}`);return}if(r==="cases"&&q(o)){t.push(`${s}${l} {`);for(let[c,d]of Object.entries(o))t.push(`${s}${R}${B(c,a)} {`,...Ye(d,s+R+R,v(a,c)),`${s}${R}}`);t.push(`${s}}`);return}let u=M(o,i,a);if(u===null||u.includes(`
|
|
41
|
+
`))t.push(...U(`.${r}`,o,s,a));else e.push(`${l}=${u}`)}function oo(e,t){return["$head {",...e.flatMap((r,o)=>q(r)&&!On(r)&&n(r.tagName)&&!r.$ref?ut(r,t,`/$head/${o}`):U("-",r,t,`/$head/${o}`)),"}"]}function so(e){let{document:t,spans:r}=Zn(e);return{document:f(t)?t:null,spans:r}}function lt(e,t){let r=io(e);return t===void 0?r:st(t,r,so)}function io(e){if(!f(e))throw new L("A document is an object");let t=e,r=["/- kdl-version 2"],o={};for(let[s,i]of Object.entries(t))if(s==="$head"&&Array.isArray(i))r.push(...oo(i,R));else if(s==="$head")r.push(`(object)${U(s,i,"","/$head").join(`
|
|
42
|
+
`)}`);else if(s.startsWith("$"))r.push(...U(s,i,"",v("",s)));else o[s]=i;if(Object.keys(o).length>0)r.push("",...ut(o,"",""));return`${r.join(`
|
|
43
|
+
`)}
|
|
44
|
+
`}var nn={capabilities:{parse:{identifier:"parse",timing:["compiler","server"]},serialize:{identifier:"serialize",timing:["compiler","server"]}},documentKinds:["page","component"],exportTarget:!1,extensions:[".jxn"],mediaType:null,name:"jxn",remote:!1,studio:{documentMode:{default:"component"}}},ae=[],kn=null;function jt(){if(!kn)kn=(async()=>{try{ae=await p().listFormats?.()??[]}catch{ae=[]}return ae})();return kn}function Ih(){kn=null,ae=[],Cn=null,Ze=[],Jn=null,en=[]}var Ze=[],Cn=null;function sd(){if(!Cn)Cn=(async()=>{try{Ze=await p().listExtensions?.()??[]}catch{Ze=[]}return Ze})();return Cn}function Vy(){return Ze}var en=[],Jn=null;function ao(){if(!Jn)Jn=(async()=>{try{en=await p().listExtensionCatalog?.()??[]}catch{en=[]}return en})();return Jn}function __(){return en}async function uo(e){let t=null;try{t=await e.fetchProjectSchemas?.()??null}catch{}dt(t),await (ce("bbd1mary"),import("./jx-validate-bbd1mary.js")).then(({applyProjectSchemas:r})=>r(t)).catch(()=>!1)}function dc(e){uo(e),ao(),(ce("4z9qq0gh"),import("./extension-sections-4z9qq0gh.js")).then(({syncExtensionSettingsSections:t})=>t()).catch(()=>{})}function su(){return ae}function Fa(e,t){let r=e.startsWith(".")?e.toLowerCase():`.${e.toLowerCase()}`;if(r===".jxn")return nn;return ae.find((o)=>o.extensions.includes(r)&&(!t||o.capabilities[t]))}function zi(e){if(!e)return;return e===nn.name?nn:ae.find((t)=>t.name===e)}function hf(e){return Error(`No format class imported for "${e}" — add one to project.json imports `+`(e.g. "Markdown": "@jxsuite/parser/Markdown.class.json") and make sure the project's dependencies are installed`)}function fn(e){if(!e)return;let t=e.lastIndexOf(".");if(t===-1)return;return Fa(e.slice(t))}function Cl(e){let t=new Set;for(let r of ae){if(e&&!r.documentKinds.includes(e))continue;for(let o of r.extensions)t.add(o)}return t.delete(".json"),[...t]}async function Wy(){return await jt(),[".json",...Cl("page")]}function co(){return ae.find((e)=>e.capabilities.serialize&&e.documentKinds.includes("content"))}async function ir(e){let t=p();if(!t.formatAction)throw Error("Platform does not support format actions");return t.formatAction(e)}async function QR(e,t,r){if(e===nn.name)return uf(t);return await ir({action:"parse",format:e,options:r,source:t})}async function ja(e,t,r){if(e===nn.name)return lt(t,r?.source);return await ir({action:"serialize",doc:t,format:e,options:r})}function eI(e,t){let r=e?.studio?.documentMode,o=r?.componentWhen;if(o?.frontmatterKey){let u=t[o.frontmatterKey],c=o.matches?new RegExp(o.matches):/./;if(n(u)&&c.test(u))return{document:t,frontmatter:{},mode:"component"}}if(r?.default==="component")return{document:t,frontmatter:{},mode:"component"};let s=t.children??[];if(Array.isArray(s)&&s.length===0)s.push({children:[],tagName:"p"});let i=new Set(["state","imports"]),a={children:s},l={};for(let[u,c]of Object.entries(t)){if(u==="children")continue;if(i.has(u))a[u]=c;else l[u]=c}return{document:a,frontmatter:l,mode:"content"}}
|
|
45
|
+
export{hg,df,Hy,w_,uf,By,x_,jt,Ih,sd,Vy,__,dc,su,Fa,zi,hf,fn,Cl,Wy,co,QR,ja,eI};
|
|
46
|
+
|
|
47
|
+
//# debugId=A585A4E4637E470D64756E2164756E21
|
|
48
|
+
//# sourceMappingURL=studio-hf259xzd.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{Jn,g,Ft}from"./studio-ybkd5w8k.js";import{VD}from"./studio-z89e6wpg.js";import{sh}from"./studio-m25ry0mf.js";import{ce}from"./studio-nhpg405j.js";var e="edit",a=new Set(["edit","design"]);function r(t){for(let i of g.tabs.values())if(i.documentPath===t)return i;return null}async function Kl(t){if(!sh(t)){let o=Jn(t);if(o&&!o.fileBacked)return VD(t);let{openFileInTab:s}=await (ce("8pf70854"),import("./files-8pf70854.js"));return await s(t),r(t)}let{openFileInTab:i}=await (ce("8pf70854"),import("./files-8pf70854.js"));await i(t);let n=r(t);if(!n)return null;if(!a.has(n.session.ui.canvasMode)&&n.capabilities.modes.includes(e))n.session.ui.canvasMode=e,n.session.ui.preview=!1;return Ft(n.id),n}
|
|
2
|
+
export{Kl};
|
|
3
|
+
|
|
4
|
+
//# debugId=5D401367746C1FE664756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-jbva4wxw.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{Z}from"./studio-mkjrjpr2.js";import{p,we}from"./studio-1b79rpcb.js";import{w}from"./studio-5k9mfafh.js";import{ps}from"./studio-pk961xgz.js";import{DR,l_,Ry,h}from"./studio-ybkd5w8k.js";import{M1,gi,Xy}from"./studio-52mzbxqm.js";import{Is,Gd,dP,uP,hP}from"./studio-44drsmhw.js";import{Rs}from"./studio-wqsmvtqj.js";import{la,wI,xI,ca,Ot}from"./studio-6tnpg0vx.js";import{h1,CR,bh}from"./studio-meajkr51.js";import{x}from"./studio-anc8067x.js";import{J}from"./studio-0z8kp4xk.js";var d1="__other__";function hs(t){return t.trim().toLowerCase().replaceAll(/\s+/g,"-").replaceAll(/[^a-z\d-]/g,"")}function uR(t){let e=t.lastIndexOf(".");return e>0?t.slice(e):""}function hR(t,e,n){let r=t.trim();if(n===void 0||e==="__other__")return r;if(n.kind==="fixed"){let i=hs(r);return i===""?"":`${i}${n.ext}`}return r.toLowerCase().endsWith(e.toLowerCase())?r:`${r}${e}`}function hy(t,e,n){let{choice:r,dir:i,known:o=new Set,rows:s=null,taken:a}=n,l=t.trim();if(!l)return r?.kind==="fixed"?"Enter a name.":"Enter a file name.";if(r?.kind==="fixed"&&hs(l)==="")return"Enter at least one letter or number.";let d=l.replaceAll("\\","/");if(d.startsWith("/")||d.endsWith("/"))return"Enter a name, not a path that starts or ends with a slash.";if(d.split("/").includes(".."))return"A name cannot step outside the destination folder.";if(d.includes("/")&&r!==void 0&&e!=="__other__")return`Pick Other… to create a file in a subfolder of ${i==="."?"the project root":i}.`;let u=uR(d);if(e!==""&&e!=="__other__"&&u!==""&&u.toLowerCase()!==e.toLowerCase()&&o.has(u.toLowerCase()))return`You picked ${s?.find((v)=>v.value===e)?.label??e}; this name ends in ${u}.`;if(r?.kind==="locked"&&e==="__other__"){if(u!==""&&u.toLowerCase()!==r.ext.toLowerCase()&&o.has(u.toLowerCase()))return r.because}let m=hR(t,e,r);return a.has(m.toLowerCase())?`${m} already exists in ${i}/.`:""}function Ym(t,e,n){let r=e.trim();if(r==="")return"Enter a file name.";if(/[/\\]/.test(r))return"Enter a name, not a path. A rename keeps the file in its folder.";let i=(t.split("/").pop()??t).toLowerCase();if(r.startsWith(".")&&!i.startsWith("."))return"A name cannot start with a dot: hidden files are not listed, so the file could disappear.";let o=r.toLowerCase();if(o!==i&&[...n].some((s)=>s.toLowerCase()===o))return`${r} already exists in this folder.`;return""}function y(t){let e=["B","KB","MB","GB"],n=t,r=0;while(n>=1024&&r<e.length-1)n/=1024,r+=1;return`${r===0?n:Number(n.toFixed(1))} ${e[r]}`}var R=["image/*","video/*","audio/*",".pdf",".svg",".woff",".woff2",".ttf",".otf"].join(",");function Zc(){return(we()?p().assetCapabilities?.accept:void 0)??R}function zd(t){return ca.has(Ot(t))}function Ud(t){let e=t.type??"";if(e.startsWith("image/"))return"image";if(e.startsWith("video/"))return"video";if(e.startsWith("audio/"))return"audio";let n=Ot(t.name);if(la.has(n))return"image";if(wI.has(n))return"video";if(xI.has(n))return"audio";return"file"}var pR=new Set([".woff",".woff2",".ttf",".otf"]);function eP(t){if(pR.has(Ot(t)))return"font";let e=Ud({name:t});return e==="file"?"document":e}var k=/^content\/([^/]+)\//,Ia="public/media";function fR(t){let e=t?k.exec(t.replaceAll("\\","/")):null;return e?`content/${e[1]}/images`:Ia}function tP(t){let e=t.replaceAll("\\","/");return e===Ia||/^content\/[^/]+\/images$/.test(e)}function T(t){let e=t.replaceAll("\\","/");if(e.startsWith("public/"))return e.slice(6);let n=/^content\/[^/]+\/(.+)$/.exec(e);if(n)return`./${n[1]}`;return`./${e}`}function P(t,e){let n=new Set([...e].map((o)=>o.toLowerCase()));if(!n.has(t.toLowerCase()))return t;let r=Ot(t),i=r?t.slice(0,-r.length):t;for(let o=1;;o++){let s=`${i}-${o}${r}`;if(!n.has(s.toLowerCase()))return s}}function mR(t,e){let n=t.replaceAll("\\","/").replace(/\/+$/,"");return n==="."||n===""?e:`${n}/${e}`}var b=null;function nP(t){b=t}async function Ux(t,e){await(e===void 0?b?.(t):b?.(t,e))}function E(t){let e=t.replaceAll("\\","/"),n=e.lastIndexOf("/");return n>0?e.slice(0,n):"."}function I(t,e){let n=(o)=>e==="image"?la.has(Ot(o.name)):zd(o.name),r=[],i=[];for(let o of t)if(n(o))r.push(o);else i.push(o.name);if(i.length>0)w.warn(i.length===1?`Skipped ${i[0]}`:`Skipped ${i.length} files`,{detail:e==="image"?`Only images can be used here: ${i.join(", ")}.`:`Studio lists images, video, audio, PDFs and fonts as media, so ${i.join(", ")} would not appear in it.`,source:"Media"});return r}async function ea(t,e={}){let n=e.only===void 0?[...t]:I([...t],e.only);if(n.length===0)return[];let r=p(),i=e.dir??fR(h.value?.documentPath??null),o=e.source??"Media",s;try{let d=await Is(()=>r.listDirectory(i));s=new Set(d.map((u)=>u.name))}catch(d){if(e.dirExists===!0)return w.error(`Could not write to ${i}/.`,{detail:`The folder could not be read to choose a name that overwrites nothing: ${Z(d)}`,path:i,source:o}),[];s=new Set}let a=we()?p().assetCapabilities?.maxUploadBytes:void 0,l=[];for(let d of n){if(a!==void 0&&d.size>a){w.error(`${d.name} is too large.`,{detail:`This backend accepts at most ${y(a)}; that file is ${y(d.size)}.`,source:"Media"});continue}let u=P(d.name,s);s.add(u);let m=mR(i,u);try{let{path:f}=await(e.write?e.write(m):r.uploadFile(m,d));Gd([f]),l.push({kind:Ud(d),name:u,path:f,ref:T(f)})}catch(f){w.error(`Could not upload ${d.name}.`,{detail:Z(f),path:m,source:o})}}if(l.length>0){if(e.quiet!==!0)w.success(l.length===1?`Uploaded ${l[0].name} to ${i}/`:`Uploaded ${l.length} files to ${i}/`);await b?.(i)}return l}function L(t){try{let e=new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0}).decode(t);return e.startsWith("\uFEFF")?null:e}catch{return null}}function D(t){let e=t.slice(0,t.length-Ot(t).length);return`${e.replace(/-copy(?:-\d+)?$/,"")}-copy${t.slice(e.length)}`}async function qx(t,e={}){let n=t.split("/").pop()??t,r=e.source??"Media",i;try{let a=p();if(a.readFileBytes===void 0)throw Error("This backend cannot read a file's raw bytes.");i=await a.readFileBytes(t)}catch(a){return w.error(`Could not duplicate ${n}.`,{detail:Z(a),path:t,source:r}),null}let o=e.document===!0?L(i):null,[s]=await ea([new File([i],D(n))],{dir:E(t),dirExists:!0,quiet:!0,source:r,...o!==null&&{write:async(a)=>(await p().writeFile(a,o),{path:a})}});if(!s)return null;if(s.path===t)return w.warn(`${n} was not duplicated.`,{detail:"The backend keeps identical files once, so it made no second file.",path:t,source:r}),null;return w.success(`Duplicated ${n} as ${s.name}`),s}var z=[new Set([".jpg",".jpeg"]),new Set([".tif",".tiff"])];function N(t){return z.find((e)=>e.has(t))??new Set([t])}function iP(t){return[...N(Ot(t))].join(",")}function F(t,e){return N(Ot(t)).has(Ot(e.name))}function rP(t,e,n){let r=Ym(t,e,n);if(r!=="")return r;if(!F(t,{name:e.trim()}))return`Keep the ${Ot(t)} extension. A rename does not convert the file, so another extension would break it on every page.`;return""}async function Jx(t,e,n={}){let r=t.split("/").pop()??t;if(!F(t,e))return w.error(`${e.name} cannot replace ${r}.`,{detail:`${r} is ${Ot(t)||"a file with no extension"} and ${e.name} is ${Ot(e.name)||"a file with no extension"}. Every page that uses ${r} would get bytes its address does not describe; choose a file of the same type, or upload it as a new file.`,path:t,source:"Media"}),!1;let i=we()?p().assetCapabilities?.maxUploadBytes:void 0;if(i!==void 0&&e.size>i)return w.error(`${e.name} is too large.`,{detail:`This backend accepts at most ${y(i)}; that file is ${y(e.size)}.`,source:"Media"}),!1;Rs(t);let o;try{({path:o}=await p().uploadFile(t,e))}catch(s){return w.error(`Could not replace ${r}.`,{detail:Z(s),path:t,source:"Media"}),!1}if(Gd([t,o]),o===t)uP(t);if(ps(),await(o===t?Ux(E(t),t):Ux(E(t))),o!==t)return w.warn(`${r} was not replaced.`,{detail:`The backend stored the new file as ${o}, so every reference still shows the old one.`,path:t,source:"Media",tier:"problem"}),!1;return w.success(n.note===void 0?`Replaced ${r}`:`Replaced ${r}: ${n.note}`),!0}function Kx(t){let e=gi(t),n=e.lastIndexOf("/");return n===-1?e:e.slice(n+1)}function py(t){let e=gi(t),n=e.lastIndexOf("/");return n===-1?".":e.slice(0,n)}function B(){return x?.projectConfig?.content??null}function _(t){return Ry(t,B(),CR())}function U(t,e){return`${gi(e.urlPrefix)}/${t.slice(e.dir.length+1)}`}function fy(t){let e=gi(t);if(e.startsWith(`${M1}/`))return`/${e.slice(M1.length+1)}`;let n=_(e);return n?`/${U(e,n)}`:`/${e}`}function io(t){let e=gi(t);if(e==="")return t;let{space:n,fileBaseUrl:r}=bh(),i=hP(e);if(n==="repo")return l_(DR(`${r}${Xy(e)}`,dP(e)),i);let o=Xy(fy(e).slice(1));return l_(h1(`/${o}`),i)}var c=new Map,S=new Map,g=new Map,M=new Set;function A(t){return Ot(t)===".svg"}function C(t){let e=t===null?null:/^\s*(\d+(?:\.\d+)?)\s*(?:px)?\s*$/.exec(t),n=e?Number(e[1]):Number.NaN;return n>0?n:null}function j(t){let e=new DOMParser().parseFromString(t,"image/svg+xml").documentElement;if(e.localName!=="svg")return null;let n=C(e.getAttribute("width")),r=C(e.getAttribute("height")),i=(e.getAttribute("viewBox")??"").trim().split(/[\s,]+/).map(Number),o=i[2]??Number.NaN,s=i[3]??Number.NaN,a=i.length===4&&o>0&&s>0,l=null;if(n!==null&&r!==null)l={height:r,width:n};else if(a&&n!==null)l={height:n*s/o,width:n};else if(a&&r!==null)l={height:r,width:r*o/s};else if(a)l={height:s,width:o};return l&&{height:Math.round(l.height),width:Math.round(l.width)}}async function K(t){M.add(t);try{let e=j(await p().readFile(t));if(e&&e.width>0&&e.height>0)g.set(t,e)}catch{}}function qd(t){let e=gi(t);return c.has(e)&&(!A(e)||M.has(e))}function O(t,e){let n=Kx(t),r=g.get(t);return{bytes:J(e?.size)?e.size:null,ext:Ot(n),height:r?.height??null,kind:Ud({name:n}),modified:e?.modified??null,name:n,path:t,width:r?.width??null}}function Xc(t){return c.get(gi(t))??null}function oP(t){for(let e of t){if(e.type!=="file")continue;let n=gi(e.path);if(!c.has(n))c.set(n,O(n,e))}}async function fh(t){let e=gi(t),n=c.get(e);if(n&&qd(e))return n;let r=S.get(e);if(r)return r;let i=(async()=>{if(A(e)&&!M.has(e))await K(e);if(n){let a=g.get(e);return{...n,height:a?.height??null,width:a?.width??null}}let s;try{s=(await Is(()=>p().listDirectory(py(e)))).find((l)=>gi(l.path)===e)}catch{s=void 0}return O(e,s)})();S.set(e,i);let o=await i;return S.delete(e),c.set(e,o),o}function yl(t,e,n){if(!(e>0&&n>0))return!1;let r=gi(t);if(A(r))return!1;let i=g.get(r);if(i&&i.width===e&&i.height===n)return!1;g.set(r,{height:n,width:e});let o=c.get(r);if(o)c.set(r,{...o,height:n,width:e});return!0}function sP(){c.clear(),g.clear(),M.clear()}function Zm(t){if(t<1024)return`${t} B`;if(t<1048576)return`${Math.round(t/1024)} KB`;return`${(t/1048576).toFixed(1)} MB`}function Gx(t){if(!t)return"";let e=[];if(t.width!==null&&t.height!==null)e.push(`${t.width} × ${t.height}`);if(t.bytes!==null)e.push(Zm(t.bytes));return e.join(" · ")}
|
|
2
|
+
export{d1,hs,uR,hR,hy,Ym,Zc,zd,Ud,pR,eP,Ia,fR,tP,mR,nP,Ux,ea,qx,iP,rP,Jx,Kx,py,fy,io,qd,Xc,oP,fh,yl,sP,Zm,Gx};
|
|
3
|
+
|
|
4
|
+
//# debugId=8907CFCFC19AE97F64756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-jj9gf1qc.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{Z}from"./studio-mkjrjpr2.js";import{Pe,ro,Zd,h}from"./studio-ybkd5w8k.js";import{w}from"./studio-5k9mfafh.js";import{p}from"./studio-1b79rpcb.js";import{De,Ra,Kc}from"./studio-mrb10hv3.js";import{Fn}from"./studio-yetr4gg1.js";import{Ow,Nb}from"./studio-0wa4wv4s.js";import{oC}from"./studio-a4ymg4vd.js";import{zt,Wi}from"./studio-anc8067x.js";import{re}from"./studio-ft706q02.js";import{vr}from"./studio-213pyfxh.js";import{S,rt}from"./studio-0z8kp4xk.js";function yw(){let t=h.value,e=Pe(t?.session.selection);if(!t||!e||e.length<2)return null;let o=re(t.doc.document,e);if(!o||!o.tagName)return null;return{node:o,path:e}}async function mm(){let t=yw();if(!t)return;let e=await b(g(t.node));if(!e)return;await zE(e.toLowerCase())}async function zE(t){let e=h.value,o=yw();if(!e||!o)return null;let{node:m,path:f}=o,l=v(m);l.tagName=t;let r=`components/${t}.json`,c=Kc(e.documentPath,r),u=f;if(!Zd(e,(n)=>{let s=zt(u)??[],d=Wi(u),a=n;for(let i of s)a=a[i];if(!Array.isArray(a.children))a.children=[];if(a.children[d]={tagName:t},!n.$elements)n.$elements=[];if(!n.$elements.some((i)=>S(i)&&("$ref"in i)&&i.$ref===c))n.$elements.push({$ref:c})}))return null;try{await p().writeFile(r,vr(l,null)),await Ra();let s=oC(l);if(w.success(`Converted to <${t}>`),s)w.warn(`<${t}> has a slot problem: ${s}`,{path:r,source:"Components",tier:"problem"});return r}catch(n){return w.error(`Could not save the <${t}> component.`,{detail:Z(n),path:r,source:"Components"}),null}}function g(t){if(t.$id){let o=Nb(t.$id);if(o!=="")return o}let e=(rt(t.tagName)||"div").toLowerCase();return e.includes("-")?e:Nb(e)}function v(t){let e=ro(t);return delete e.$id,delete e.$layout,delete e.$paths,e}function N(t){let e=t.trim().toLowerCase(),o=Ow(e);if(o!=="")return o;return De.some((m)=>m.tagName===e)?`Component <${e}> already exists`:""}function b(t){return Fn("Convert to Component",{confirmLabel:"Convert",message:"Enter a hyphenated tag name for the new component.",placeholder:"my-component",validate:N,value:t})}
|
|
2
|
+
export{yw,mm,zE};
|
|
3
|
+
|
|
4
|
+
//# debugId=9E5EFA93F8BA2D3864756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-jsjg3mjv.js.map
|