@jxsuite/studio 8.1.0 → 9.0.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.
Files changed (247) hide show
  1. package/dist/chunks/{2020-dg097k3e.js → 2020-89fz3pfy.js} +3 -3
  2. package/dist/chunks/adapter-ay13gema.js +4 -0
  3. package/dist/chunks/add-new-flow-nmkqpjym.js +4 -0
  4. package/dist/chunks/cf-account-picker-2e06qxey.js +4 -0
  5. package/dist/chunks/cf-settings-5y04810c.js +4 -0
  6. package/dist/chunks/color-04361ttk.js +4 -0
  7. package/dist/chunks/{color-area-vh9cew51.js → color-area-h8dbasp1.js} +2 -2
  8. package/dist/chunks/{color-field-e78f16bs.js → color-field-qv5r2b16.js} +3 -3
  9. package/dist/chunks/{color-slider-fg4yhvk6.js → color-slider-nz2mrzky.js} +2 -2
  10. package/dist/chunks/components-3vf75n83.js +4 -0
  11. package/dist/chunks/content-source-4f2raf4a.js +4 -0
  12. package/dist/chunks/{convert-to-repeater-grnmea6c.js → convert-to-repeater-j9hfcj4f.js} +3 -3
  13. package/dist/chunks/editor-645krvtz.js +4 -0
  14. package/dist/chunks/entry-commands-3qmv8wkr.js +4 -0
  15. package/dist/chunks/{extension-sections-rp7fkega.js → extension-sections-thfke054.js} +3 -3
  16. package/dist/chunks/file-ops-kkhp9ma7.js +4 -0
  17. package/dist/chunks/files-yswdhxrf.js +4 -0
  18. package/dist/chunks/format-host-4g8ex6bz.js +4 -0
  19. package/dist/chunks/fs-events-z9gpvc6t.js +4 -0
  20. package/dist/chunks/grid-open-fm4j183c.js +4 -0
  21. package/dist/chunks/{grid-view-x26rfpz1.js → grid-view-7d2nx83y.js} +10 -10
  22. package/dist/chunks/{iframe-entry-pkgmcgp0.js → iframe-entry-2x9bn5ng.js} +4 -4
  23. package/dist/chunks/{iframe-entry-02wzcyvy.js → iframe-entry-btck0e9s.js} +4 -4
  24. package/dist/chunks/iframe-host-q7fedsmr.js +4 -0
  25. package/dist/chunks/{index-203h71wy.js → index-jxmt7vh8.js} +3 -3
  26. package/dist/chunks/index-pt4wh98x.js +4 -0
  27. package/dist/chunks/{javascript-ww5pv5ae.js → javascript-vmqp56ke.js} +2 -2
  28. package/dist/chunks/{jsonMode-vwbdwwq3.js → jsonMode-n3wmpant.js} +6 -6
  29. package/dist/chunks/jx-validate-19y62knt.js +4 -0
  30. package/dist/chunks/layers-panel-1qvc83y9.js +4 -0
  31. package/dist/chunks/layers-qf0bc7ze.js +4 -0
  32. package/dist/chunks/lit-html-wyqw04y2.js +4 -0
  33. package/dist/chunks/media-library-f9d5qcjb.js +4 -0
  34. package/dist/chunks/media-picker-rsb1fmk2.js +4 -0
  35. package/dist/chunks/{monaco-binding-63tqze27.js → monaco-binding-wfhmz89d.js} +3 -3
  36. package/dist/chunks/monaco-buffer-ak0raadw.js +4 -0
  37. package/dist/chunks/{monaco-setup-zyyynnj8.js → monaco-setup-fty7a8vg.js} +3 -3
  38. package/dist/chunks/notify-4qj70q0x.js +4 -0
  39. package/dist/chunks/parse-n8dfxnqf.js +4 -0
  40. package/dist/chunks/platform-ehg6t9vd.js +4 -0
  41. package/dist/chunks/publish-panel-yhmda3cd.js +4 -0
  42. package/dist/chunks/{publish-quick-ajzdhhs6.js → publish-quick-12hh8926.js} +3 -3
  43. package/dist/chunks/publish-workspace-hx8qdv9p.js +4 -0
  44. package/dist/chunks/quick-search-r955m3q1.js +4 -0
  45. package/dist/chunks/references-8gxv0x7t.js +4 -0
  46. package/dist/chunks/right-panel-jarwqjpy.js +4 -0
  47. package/dist/chunks/source-control-84qt25m9.js +4 -0
  48. package/dist/chunks/studio-0nefxhar.js +7 -0
  49. package/dist/chunks/studio-0rg30pvs.js +5 -0
  50. package/dist/chunks/{studio-3q6n9qvq.js → studio-14hh60j8.js} +4 -4
  51. package/dist/chunks/studio-1cfyd1ys.js +5 -0
  52. package/dist/chunks/studio-2bq7hheq.js +5 -0
  53. package/dist/chunks/{studio-mmqr9awv.js → studio-32d8wyxq.js} +33 -33
  54. package/dist/chunks/studio-3hpcawh8.js +4 -0
  55. package/dist/chunks/{studio-zm7dnr9g.js → studio-4j35hgsw.js} +4 -4
  56. package/dist/chunks/{studio-bqgs90r8.js → studio-4qg61g9j.js} +4 -4
  57. package/dist/chunks/studio-4rgem12q.js +5 -0
  58. package/dist/chunks/studio-6k9djnxw.js +5 -0
  59. package/dist/chunks/studio-6rbaedw2.js +9 -0
  60. package/dist/chunks/studio-732mw0g8.js +5 -0
  61. package/dist/chunks/studio-79r8msnr.js +7 -0
  62. package/dist/chunks/studio-7q6jdd4h.js +5 -0
  63. package/dist/chunks/{studio-jqrg9xxg.js → studio-881z1xrx.js} +4 -4
  64. package/dist/chunks/{studio-9wyqyfqy.js → studio-8hf8qcm1.js} +4 -4
  65. package/dist/chunks/{studio-6vrxzkba.js → studio-8pne0rx4.js} +4 -4
  66. package/dist/chunks/{studio-wcakp5bt.js → studio-9179bsm7.js} +7 -7
  67. package/dist/chunks/{studio-xddgbwhe.js → studio-9ff0vqff.js} +3 -3
  68. package/dist/chunks/{studio-25a5by3h.js → studio-9gzvypw4.js} +4 -4
  69. package/dist/chunks/studio-9ndgd55w.js +5 -0
  70. package/dist/chunks/studio-9ra9e7m4.js +5 -0
  71. package/dist/chunks/studio-a6e5fzve.js +5 -0
  72. package/dist/chunks/studio-a9k86nq6.js +5 -0
  73. package/dist/chunks/studio-ae7a69jc.js +6 -0
  74. package/dist/chunks/studio-aghsg0ds.js +7 -0
  75. package/dist/chunks/{studio-2b8443ms.js → studio-ajw4k8hp.js} +3 -3
  76. package/dist/chunks/{studio-957jg8g3.js → studio-apapy17g.js} +4 -4
  77. package/dist/chunks/{studio-hnx1h1pr.js → studio-by8x0jvc.js} +4 -4
  78. package/dist/chunks/{studio-hxq1ebp0.js → studio-c88gq88j.js} +6 -6
  79. package/dist/chunks/{studio-a6x058ew.js → studio-cg54vtet.js} +4 -4
  80. package/dist/chunks/studio-dvhxxxbd.js +5 -0
  81. package/dist/chunks/{studio-1meqbxns.js → studio-e4rq6x0q.js} +4 -4
  82. package/dist/chunks/{studio-v2ek69cb.js → studio-ekzbgnjp.js} +4 -4
  83. package/dist/chunks/{studio-2dtc90zs.js → studio-fg4fj9ec.js} +6 -6
  84. package/dist/chunks/studio-fj6jzgxw.js +5 -0
  85. package/dist/chunks/{studio-txkx6586.js → studio-g45r5vm8.js} +7 -7
  86. package/dist/chunks/{studio-v0gsjav0.js → studio-gczve8zf.js} +4 -4
  87. package/dist/chunks/studio-ge08zwpv.js +5 -0
  88. package/dist/chunks/{studio-1gdfsr49.js → studio-gk9yk8dj.js} +7 -7
  89. package/dist/chunks/{studio-cpdzrdgp.js → studio-gskkgfe3.js} +4 -4
  90. package/dist/chunks/{studio-94ppxeqy.js → studio-h4jbgne2.js} +8 -8
  91. package/dist/chunks/{studio-kdseew9m.js → studio-hcy9zeac.js} +4 -4
  92. package/dist/chunks/studio-ht81xjkr.js +5 -0
  93. package/dist/chunks/{studio-73wz63nn.js → studio-jr30g4ae.js} +4 -4
  94. package/dist/chunks/{studio-fqs1a22a.js → studio-k5n4es74.js} +4 -4
  95. package/dist/chunks/{studio-j5jqvyn3.js → studio-k6hbx2fc.js} +4 -4
  96. package/dist/chunks/{studio-332hesdk.js → studio-kqh7fxn6.js} +4 -4
  97. package/dist/chunks/{studio-8nyw10dp.js → studio-kyw47pet.js} +4 -4
  98. package/dist/chunks/studio-mkw17ngg.js +5 -0
  99. package/dist/chunks/{studio-02phtmqn.js → studio-myb4mf0h.js} +4 -4
  100. package/dist/chunks/{studio-d140sy8e.js → studio-n4qq1n57.js} +4 -4
  101. package/dist/chunks/{studio-bf0rgyf7.js → studio-nfmpmkqb.js} +4 -4
  102. package/dist/chunks/studio-nfwacw31.js +5 -0
  103. package/dist/chunks/{studio-z42kysg7.js → studio-nm86874b.js} +136 -136
  104. package/dist/chunks/studio-nqexty8x.js +16 -0
  105. package/dist/chunks/studio-nr0kcqc6.js +5 -0
  106. package/dist/chunks/{studio-dmn7gpba.js → studio-nvfa137z.js} +5 -5
  107. package/dist/chunks/studio-psh8mwnw.js +4 -0
  108. package/dist/chunks/{studio-4dsdnan2.js → studio-qd0cycm4.js} +5 -5
  109. package/dist/chunks/{studio-zht0x0v3.js → studio-qevf5z9d.js} +4 -4
  110. package/dist/chunks/studio-qs5fmhtj.js +14 -0
  111. package/dist/chunks/studio-ry4789ng.js +7 -0
  112. package/dist/chunks/studio-s4fq9jht.js +5 -0
  113. package/dist/chunks/studio-sc35ttdk.js +5 -0
  114. package/dist/chunks/studio-sm2f0sc6.js +6 -0
  115. package/dist/chunks/{studio-rdnezzkd.js → studio-spza69tb.js} +5 -5
  116. package/dist/chunks/studio-t6dqnnft.js +5 -0
  117. package/dist/chunks/{studio-hw60n5dh.js → studio-tfmhnwyr.js} +3 -3
  118. package/dist/chunks/studio-tn7v8gey.js +6 -0
  119. package/dist/chunks/{studio-nsv7g1qn.js → studio-trcfer2b.js} +4 -4
  120. package/dist/chunks/studio-tyw7tk0x.js +5 -0
  121. package/dist/chunks/{studio-533py3yy.js → studio-tyzgte21.js} +4 -4
  122. package/dist/chunks/studio-vtey9w98.js +5 -0
  123. package/dist/chunks/studio-ws2r1d7e.js +5 -0
  124. package/dist/chunks/studio-x2trkhk5.js +5 -0
  125. package/dist/chunks/{studio-c5dj3dzk.js → studio-xzgp0cp7.js} +4 -4
  126. package/dist/chunks/studio-y47090vq.js +5 -0
  127. package/dist/chunks/{studio-nm9qev4p.js → studio-yjh9gddd.js} +5 -5
  128. package/dist/chunks/studio-ywf9y1e2.js +5 -0
  129. package/dist/chunks/{studio-x3ge4rts.js → studio-z1p91z5a.js} +4 -4
  130. package/dist/chunks/studio-ztppbam0.js +5 -0
  131. package/dist/chunks/{toast-host-1yg5ar8d.js → toast-host-g3r2s0kn.js} +2 -2
  132. package/dist/chunks/toast-w11qpkyz.js +4 -0
  133. package/dist/chunks/{tsMode-vra2hh7y.js → tsMode-byje4a01.js} +5 -5
  134. package/dist/chunks/workspace-7q4arnt3.js +4 -0
  135. package/dist/chunks/workspace-home-ge027kr6.js +4 -0
  136. package/dist/chunks/{ws-client-72x5n99j.js → ws-client-h09h6sqg.js} +3 -3
  137. package/dist/iframe-entry.js +13 -13
  138. package/dist/manifest.json +77 -77
  139. package/dist/studio.js +89 -89
  140. package/package.json +11 -12
  141. package/src/collab/collab-session.ts +6 -2
  142. package/src/commands/context.ts +4 -0
  143. package/src/commands/defaults.ts +2 -0
  144. package/src/commands/live-context.ts +2 -0
  145. package/src/files/files.ts +6 -3
  146. package/src/new-project/new-project-modal.ts +1 -4
  147. package/src/panels/ai-panel.ts +27 -34
  148. package/src/platform.ts +20 -0
  149. package/src/platforms/devserver.ts +2 -120
  150. package/src/services/ai-ask.ts +29 -171
  151. package/src/services/ai-command-tools.ts +40 -50
  152. package/src/services/ai-import-tools.ts +4 -5
  153. package/src/services/ai-project-tools.ts +13 -3
  154. package/src/services/ai-tools.ts +26 -564
  155. package/src/services/ai-writes.ts +84 -2
  156. package/src/services/document-assistant.ts +29 -58
  157. package/src/services/harness/assistant-tools.ts +68 -0
  158. package/src/services/harness/interaction-store.ts +118 -0
  159. package/src/services/harness/studio-documents.ts +105 -0
  160. package/src/services/harness/turn-hooks.ts +1 -6
  161. package/src/services/project-adoption.ts +8 -16
  162. package/src/services/tool-executor.ts +25 -22
  163. package/src/state.ts +3 -13
  164. package/src/surfaces/files-panel.json +12 -0
  165. package/src/surfaces/files-panel.ts +5 -2
  166. package/src/surfaces/welcome.ts +4 -1
  167. package/src/tabs/selection.ts +14 -109
  168. package/src/tabs/tab.ts +10 -1
  169. package/src/tabs/transact.ts +316 -124
  170. package/src/types.ts +13 -8
  171. package/dist/chunks/adapter-tck81zft.js +0 -4
  172. package/dist/chunks/add-new-flow-a1w0bnm6.js +0 -4
  173. package/dist/chunks/cf-account-picker-ce3kp3x1.js +0 -4
  174. package/dist/chunks/cf-settings-7ye6x7g2.js +0 -4
  175. package/dist/chunks/color-4gj49xq6.js +0 -4
  176. package/dist/chunks/components-qce0v93f.js +0 -4
  177. package/dist/chunks/content-source-jjx8kgzr.js +0 -4
  178. package/dist/chunks/editor-bkja5dbv.js +0 -4
  179. package/dist/chunks/entry-commands-1wh0btvg.js +0 -4
  180. package/dist/chunks/file-ops-6pe4z7an.js +0 -4
  181. package/dist/chunks/files-ybpp3j38.js +0 -4
  182. package/dist/chunks/format-host-3mtbhxk1.js +0 -4
  183. package/dist/chunks/fs-events-xfanfxds.js +0 -4
  184. package/dist/chunks/grid-open-dg5qmnaj.js +0 -4
  185. package/dist/chunks/iframe-host-j2bk2xkc.js +0 -4
  186. package/dist/chunks/index-fkrm7pdk.js +0 -4
  187. package/dist/chunks/jx-validate-w7v32f6a.js +0 -4
  188. package/dist/chunks/layers-g7j732cm.js +0 -4
  189. package/dist/chunks/layers-panel-gjrsxcck.js +0 -4
  190. package/dist/chunks/lit-html-jdfz9rhc.js +0 -4
  191. package/dist/chunks/media-library-9j0v4wmk.js +0 -4
  192. package/dist/chunks/media-picker-cpyyt2m0.js +0 -4
  193. package/dist/chunks/monaco-buffer-9wcme176.js +0 -4
  194. package/dist/chunks/notify-rahnnnv4.js +0 -4
  195. package/dist/chunks/parse-v77xtwv7.js +0 -4
  196. package/dist/chunks/platform-b2aqv7v5.js +0 -4
  197. package/dist/chunks/publish-panel-4yk2461b.js +0 -4
  198. package/dist/chunks/publish-workspace-mxestzcf.js +0 -4
  199. package/dist/chunks/quick-search-9g6z65b0.js +0 -4
  200. package/dist/chunks/references-c26enpxs.js +0 -4
  201. package/dist/chunks/right-panel-9d0e0yg7.js +0 -4
  202. package/dist/chunks/source-control-xyn3a8ds.js +0 -4
  203. package/dist/chunks/studio-0khd0xdw.js +0 -5
  204. package/dist/chunks/studio-1fvzq9vs.js +0 -5
  205. package/dist/chunks/studio-1yhz0s8p.js +0 -5
  206. package/dist/chunks/studio-2c2mjyzj.js +0 -6
  207. package/dist/chunks/studio-3pndhat0.js +0 -9
  208. package/dist/chunks/studio-4fjqdzrb.js +0 -6
  209. package/dist/chunks/studio-5abge3wy.js +0 -5
  210. package/dist/chunks/studio-74nzv280.js +0 -5
  211. package/dist/chunks/studio-7cg75gtj.js +0 -14
  212. package/dist/chunks/studio-89cwmnae.js +0 -5
  213. package/dist/chunks/studio-8m1t83kn.js +0 -7
  214. package/dist/chunks/studio-a3evp7f6.js +0 -6
  215. package/dist/chunks/studio-ana67wax.js +0 -5
  216. package/dist/chunks/studio-b4xhpcwy.js +0 -4
  217. package/dist/chunks/studio-c4rcaftm.js +0 -5
  218. package/dist/chunks/studio-cgjt1zce.js +0 -5
  219. package/dist/chunks/studio-cq87hree.js +0 -5
  220. package/dist/chunks/studio-e1g64q43.js +0 -5
  221. package/dist/chunks/studio-e8pzjjhf.js +0 -5
  222. package/dist/chunks/studio-f8kz3krj.js +0 -7
  223. package/dist/chunks/studio-fw3jp9m7.js +0 -5
  224. package/dist/chunks/studio-g6ysm05p.js +0 -7
  225. package/dist/chunks/studio-gmhd0j3f.js +0 -5
  226. package/dist/chunks/studio-gqpty626.js +0 -5
  227. package/dist/chunks/studio-grp684wx.js +0 -5
  228. package/dist/chunks/studio-h98520qr.js +0 -5
  229. package/dist/chunks/studio-hvxt8z79.js +0 -5
  230. package/dist/chunks/studio-j4e627w1.js +0 -5
  231. package/dist/chunks/studio-kt2j51sa.js +0 -5
  232. package/dist/chunks/studio-m4w6sygj.js +0 -16
  233. package/dist/chunks/studio-nqxqf8p2.js +0 -4
  234. package/dist/chunks/studio-p89w12s2.js +0 -7
  235. package/dist/chunks/studio-pbagym4j.js +0 -5
  236. package/dist/chunks/studio-pr23qhrw.js +0 -5
  237. package/dist/chunks/studio-r4ya3sb2.js +0 -5
  238. package/dist/chunks/studio-rm9m3z60.js +0 -5
  239. package/dist/chunks/studio-tpmnbgmt.js +0 -5
  240. package/dist/chunks/studio-ttxhq5yt.js +0 -5
  241. package/dist/chunks/studio-y1x65h5r.js +0 -5
  242. package/dist/chunks/studio-zf188hnd.js +0 -5
  243. package/dist/chunks/toast-1gv0h53h.js +0 -4
  244. package/dist/chunks/workspace-3nt93k48.js +0 -4
  245. package/dist/chunks/workspace-home-zbgyqqws.js +0 -4
  246. package/src/services/directory-picker.ts +0 -187
  247. package/src/services/gated-registry.ts +0 -77
@@ -0,0 +1,5 @@
1
+ import{te}from"./studio-psh8mwnw.js";import{cw,Hu}from"./studio-nfmpmkqb.js";import{T,R}from"./studio-myb4mf0h.js";import{g}from"./studio-tfmhnwyr.js";import{Jc,Nx}from"./studio-ztppbam0.js";import{Hl,bm}from"./studio-cg54vtet.js";import{n,v}from"./studio-ywf9y1e2.js";import{le}from"./studio-k5n4es74.js";var z_=["string","number","boolean","array","object","reference"],W_=["","image","date","color"],Ed={format:"",name:"",required:!1,type:"string"};function ib(e){if(e.$ref)return"reference";return e.type||"string"}function Td(e){if(e.type==="array"&&e.items?.format)return e.items.format;return e.format||""}function va(e,s){switch(e){case"number":return{type:"number"};case"boolean":return{type:"boolean"};case"array":return s?{items:{format:s,type:"string"},type:"array"}:{items:{type:"string"},type:"array"};case"object":return{properties:{},required:[],type:"object"};case"reference":return{$ref:"#/content/"};default:return s?{format:s,type:"string"}:{type:"string"}}}var B={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSchemaBuilder",$description:'The `schema-builder` form control (specs/extensions.md §9.1): the visual editor for a JSON Schema object, drawn as one card per property. A descriptor names it with `"ui": { "<prop>": { "control": "schema-builder" } }`, and `ui/schema-form.ts` mounts it into the empty host its own document announces for that field. The adapter (`surfaces/schema-builder.ts`) hands in the fields already classified and every draft the reader is part-way through typing; `ui/form-controls.ts` decides what a field may be renamed to and what reaches the host\'s `onChange`. Nothing here reads a schema: a document that re-derived a field\'s type while drawing would be a second opinion about what one module already owns. **The card is `surfaces/settings-defs.json`\'s, part for part.** Data Shapes edits the project\'s `$defs` and this edits a content type\'s `schema`; they are the same object with the same six controls per row, so the row vocabulary — `card`, `field-row`, `field-label`, `field-name`, `field-type`, `field-format`, `field-required`, `field-delete`, `nested`, `nested-card`, `nested-add-name`/`-type`/`-button`, `ref-target`, `add-form` — is ONE vocabulary, and the row views it is drawn from are that surface\'s own types rather than a second declaration of them. What differs is only what encloses it: Data Shapes carries the two-column chrome that chooses WHICH shape is being edited, and this one is handed the object to edit.',tagName:"div",attributes:{part:"builder"},style:{$description:"What `.schema-builder`, `.schema-field-list`, `.schema-field-card`, `.schema-field-row`, `.schema-field-nested`, `.schema-field-name-input`, `.schema-nested-add`, `.schema-nested-add-name` and `.schema-add-field` said in `styles/overlays.css`, keyed on `part` and re-pointed at the studio token layer — the same translation `surfaces/settings-defs.json` carries, because it is the same card. Two values could not come with them. `.schema-field-card--nested` read `var(--spectrum-gray-300, #444)`, and the caption was an `sp-field-label` at whatever size Spectrum drew it; a document is mounted in the pane rather than inside `<sp-theme>`, so both would have taken their hard-coded fallback every time. The nested card takes the studio layer's `--border`, and the caption says what it is in the type ramp instead.",display:"block",'& [part="fields"]':{display:"flex",flexDirection:"column",gap:"4px",marginBottom:"12px"},'& [part="card"], & [part="nested-card"]':{border:"1px solid var(--border)",borderRadius:"var(--radius)",padding:"6px 10px"},'& [part="field-row"]':{display:"flex",alignItems:"center",gap:"8px"},'& [part="field-label"]':{$description:"The field's name in words: a caption on the row rather than a label for a control, since the raw key beside it is what the reader edits and what carries the accessible name.",flex:"none",minWidth:"84px",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)",overflowWrap:"anywhere"},'& [part="field-name"]':{flex:"1",maxWidth:"140px"},'& [part="nested"]':{marginLeft:"16px",marginTop:"6px",paddingLeft:"8px",borderLeft:"2px solid var(--border)",display:"flex",flexDirection:"column",gap:"4px"},'& [part="ref-target"]':{display:"flex",marginTop:"6px",maxWidth:"220px"},'& [part="nested-add"]':{display:"flex",alignItems:"center",gap:"6px",padding:"4px 0"},'& [part="nested-add-name"]':{flex:"1",maxWidth:"120px"},'& [part="add-form"]':{display:"flex",alignItems:"center",gap:"8px",padding:"8px 0"}},children:[{tagName:"div",attributes:{part:"fields"},children:[{$prototype:"Array",items:{$ref:"#/state/fields"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"card","data-field":"${$map.item.key}"},children:[{tagName:"div",attributes:{part:"field-row"},children:[{tagName:"span",attributes:{part:"field-label"},textContent:"${$map.item.label}"},{tagName:"jx-textfield",attributes:{part:"field-name"},$props:{label:"Name for ${$map.item.label}",size:"sm",value:{$ref:"$map/item/name"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/renameField"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"jx-select",attributes:{part:"field-type"},$props:{label:"Type for ${$map.item.label}",size:"sm",options:{$ref:"#/state/typeOptions"},value:{$ref:"$map/item/type"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setType"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"div",attributes:{part:"format-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasFormat"},cases:{true:{tagName:"jx-select",attributes:{part:"field-format"},$props:{label:"Format for ${$map.item.label}",size:"sm",options:{$ref:"#/state/formatOptions"},value:{$ref:"$map/item/format"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setFormat"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}}}},{tagName:"jx-switch",$description:"Whether the object requires this field. The word on screen is the name: `Req` is slotted rather than passed as `label`, because the kit's switch wraps its control in the label the slot lands in, and a second name would be announced over the top of it. Which row it belongs to is the tooltip's job instead, which is what `hint` is.",attributes:{part:"field-required"},$props:{hint:"Require ${$map.item.label}",size:"sm",checked:{$ref:"$map/item/required"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setRequired"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Req"}]},{tagName:"jx-action-button",attributes:{part:"field-delete"},$props:{label:"Delete ${$map.item.label}",hint:"Delete ${$map.item.label}",icon:"trash",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/removeField"},value:[{$ref:"$map/item/key"}]}]}}]},{tagName:"div",attributes:{part:"extra-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/extra"},cases:{reference:{tagName:"div",attributes:{part:"ref-target"},children:[{tagName:"jx-select",attributes:{part:"ref-target-select"},$props:{label:"Target for ${$map.item.label}",size:"sm",options:{$ref:"#/state/targets"},value:{$ref:"$map/item/refTarget"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setTarget"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}}]},nested:{tagName:"div",attributes:{part:"nested"},children:[{$prototype:"Array",items:{$ref:"$map/item/children"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"nested-card","data-nested":"${$map.item.key}"},children:[{tagName:"div",attributes:{part:"field-row"},children:[{tagName:"jx-textfield",attributes:{part:"field-name"},$props:{label:"Name for ${$map.item.parent}.${$map.item.key}",size:"sm",value:{$ref:"$map/item/name"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/renameNested"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"jx-select",attributes:{part:"field-type"},$props:{label:"Type for ${$map.item.parent}.${$map.item.key}",size:"sm",options:{$ref:"#/state/typeOptions"},value:{$ref:"$map/item/type"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setNestedType"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"div",attributes:{part:"format-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasFormat"},cases:{true:{tagName:"jx-select",attributes:{part:"field-format"},$props:{label:"Format for ${$map.item.parent}.${$map.item.key}",size:"sm",options:{$ref:"#/state/formatOptions"},value:{$ref:"$map/item/format"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setNestedFormat"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}}}},{tagName:"jx-switch",attributes:{part:"field-required"},$props:{hint:"Require ${$map.item.parent}.${$map.item.key}",size:"sm",checked:{$ref:"$map/item/required"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setNestedRequired"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"},{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Req"}]},{tagName:"jx-action-button",attributes:{part:"field-delete"},$props:{label:"Delete ${$map.item.parent}.${$map.item.key}",hint:"Delete ${$map.item.parent}.${$map.item.key}",icon:"trash",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/removeNested"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"}]}]}}]}]}},{tagName:"div",attributes:{part:"nested-add"},children:[{tagName:"jx-textfield",attributes:{part:"nested-add-name"},$props:{label:"New field in ${$map.item.label}",placeholder:"field name",size:"sm",value:{$ref:"$map/item/draftName"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editDraftName"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/addNested"},value:[{$ref:"$map/item/key"}]}]}}]}},{tagName:"jx-select",attributes:{part:"nested-add-type"},$props:{label:"Type of the new field in ${$map.item.label}",size:"sm",options:{$ref:"#/state/typeOptions"},value:{$ref:"$map/item/draftType"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editDraftType"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"jx-action-button",attributes:{part:"nested-add-button"},$props:{label:"Add a field to ${$map.item.label}",hint:"Add a field to ${$map.item.label}",icon:"plus",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/addNested"},value:[{$ref:"$map/item/key"}]}]}}]}]}}}]}}]},{tagName:"div",attributes:{part:"add-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/addState"},cases:{closed:{tagName:"jx-action-button",attributes:{part:"add-open"},$props:{label:"Add Field",icon:"plus",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openAdd"},value:[]}]},children:[{tagName:"span",textContent:"Add Field"}]},open:{tagName:"div",attributes:{part:"add-form"},children:[{tagName:"jx-textfield",attributes:{part:"add-name"},$props:{label:"New field name",placeholder:"Field name",size:"sm",value:{$ref:"#/state/addName"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editAddName"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/confirmAdd"},value:[]}],Escape:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/cancelAdd"},value:[]}]}}]}},{tagName:"jx-select",attributes:{part:"add-type"},$props:{label:"Type of the new field",size:"sm",options:{$ref:"#/state/typeOptions"},value:{$ref:"#/state/addType"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editAddType"},value:[{$ref:"event#/target/value"}]}]}},{tagName:"div",attributes:{part:"add-format-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/addHasFormat"},cases:{true:{tagName:"jx-select",attributes:{part:"add-format"},$props:{label:"Format of the new field",size:"sm",options:{$ref:"#/state/formatOptions"},value:{$ref:"#/state/addFormat"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editAddFormat"},value:[{$ref:"event#/target/value"}]}]}}}},{tagName:"jx-switch",attributes:{part:"add-required"},$props:{hint:"Require the new field",size:"sm",checked:{$ref:"#/state/addRequired"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editAddRequired"},value:[{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Required"}]},{tagName:"jx-button",attributes:{part:"add-confirm"},$props:{size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/confirmAdd"},value:[]}]},children:[{tagName:"span",textContent:"Add"}]},{tagName:"jx-button",attributes:{part:"add-cancel"},$props:{size:"sm",quiet:!0},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/cancelAdd"},value:[]}]},children:[{tagName:"span",textContent:"Cancel"}]}]}}}]};T("schema-builder",B);function _(){return{addFormat:"",addHasFormat:!0,addName:"",addRequired:!1,addState:"closed",addType:"string",fields:[],formatOptions:[],targets:[],typeOptions:[]}}function E(e,s){e.textContent="";let t=g({..._(),...s}),o=null,r=!0,l=!1,p=()=>R("schema-builder",t,e).then((d)=>{let y=d.root;if(r=!1,l)return d.dispose(),y;return o=d,y}),u=p();return{dispose(){l=!0,o?.dispose(),o=null,e.textContent=""},host:e,ready:u,update(d){if(t.addFormat=d.addFormat,t.addHasFormat=d.addHasFormat,t.addName=d.addName,t.addRequired=d.addRequired,t.addState=d.addState,t.addType=d.addType,t.fields=d.fields,t.formatOptions=d.formatOptions,t.targets=d.targets,t.typeOptions=d.typeOptions,l||r||o!==null&&e.contains(o.root))return;o?.dispose(),o=null,r=!0,e.textContent="",p()}}}var M={$schema:"https://jxsuite.com/schema/v1",$id:"StudioReferenceField",$description:'The `reference` form control — site-architecture.md §6.1\'s `{ "$ref": "#/content/x" }` and site-architecture.md §7.4\'s entry picker. Registered once and dispatched to by `ui/schema-form.ts` for any property whose `$ref` names a collection, so the settings forms, the entry editor and an array-of-objects cell all draw the same control without any of them knowing it exists. `ui/form-controls.ts` decides which of the three states the field is in and what each gesture commits; nothing here reads a schema or lists a directory. The three states are drawn as three different controls on purpose: a picker while the entries are known, a TEXT field while they are not — a failed read leaves the value editable with the reason beside it, because swapping it for an empty dropdown would present "no entries" and "could not find out" as the same screen — and a disabled picker saying so while the read is in flight.',tagName:"div",attributes:{part:"reference",role:"none"},style:{$description:"The five `.reference-*` rules from `styles/inspector.css`, keyed on `part` and re-pointed at the studio token layer. Two values could not come with them. The note read `var(--spectrum-font-size-50, 11px)`, which resolves only inside `<sp-theme>` — this document is mounted in a settings pane, an entry editor or a frontmatter card, all outside that element, so it would silently have taken its hard-coded fallback every time. And `.reference-missing` coloured ONE row of the dropdown red; the kit's select offers a row a face, a swatch and a border style but no tone, so the dangling entry says what it is in words (\"— not found\") and the colour is not replaced by a second channel. The 6px gap comes onto the kit's spacing scale.",display:"flex",flex:"1",minWidth:"0",alignItems:"center",gap:"var(--jx-space-2)",'& [part="picker"], & [part="text"]':{flex:"1",minWidth:"0"},'& [part="note"]':{margin:"0",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)",lineHeight:"1.4"},'& [part="note"][data-tone="danger"]':{$description:"A listing that failed is a FAULT rather than a fact about the project, and the two notes this control draws are otherwise the same sentence in the same place.",color:"var(--danger)"},'& [part="retry"]':{flex:"none"}},children:[{tagName:"div",attributes:{part:"control-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/kind"},cases:{picker:{$description:"The collection's entries. The empty row is `\"\"` rather than a sentinel, because the kit's select treats the empty string as a legal value a reader can arrow to; a dangling reference is kept in the list and marked, since blanking the field would delete the evidence and the value in one repaint. While the read is in flight the same control is disabled and offers one row saying so.",tagName:"jx-select",attributes:{part:"picker"},$props:{size:"sm",label:{$ref:"#/state/label"},options:{$ref:"#/state/options"},value:{$ref:"#/state/value"},disabled:{$ref:"#/state/disabled"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/choose"},value:[{$ref:"event#/target/value"}]}]}},text:{$description:"The id as the string it is: what a reader gets when the choices could not be listed, and when the control was named by a `ui.control` override on a property that references nothing. Refusing to draw anything would lose the value that is already there.",tagName:"jx-textfield",attributes:{part:"text"},$props:{size:"sm",label:{$ref:"#/state/label"},value:{$ref:"#/state/value"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/edit"},value:[{$ref:"event#/target/value"}]}]}}}},{tagName:"div",attributes:{part:"note-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasNote"},cases:{true:{tagName:"p",attributes:{part:"note","data-tone":"${state.noteTone}",role:"status"},textContent:"${state.note}"}}},{tagName:"div",attributes:{part:"retry-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/canRetry"},cases:{true:{$description:"Offered only where there is something to try again — a listing that failed. It used to be offered only where the HOST passed a repaint hook, because a template control cannot draw a second frame of its own and a button that cannot do the thing it is named after is worse than its absence. A mounted control redraws itself, so the condition is now the failure rather than the host.",tagName:"jx-action-button",attributes:{part:"retry"},$props:{size:"sm",quiet:!0,label:"Retry listing entries"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/retry"},value:[]}]},children:[{tagName:"span",textContent:"Retry"}]}}}]};T("reference-field",M);function Y(){return{canRetry:!1,disabled:!0,hasNote:!1,kind:"picker",label:"",note:"",noteTone:"dim",options:[],value:""}}function L(e,s){e.textContent="";let t=g({...Y(),...s}),o=null,r=!0,l=!1,p=()=>R("reference-field",t,e).then((d)=>{let y=d.root;if(r=!1,l)return d.dispose(),y;return o=d,y}),u=p();return{dispose(){l=!0,o?.dispose(),o=null,e.textContent=""},host:e,ready:u,update(d){if(t.canRetry=d.canRetry,t.disabled=d.disabled,t.hasNote=d.hasNote,t.kind=d.kind,t.label=d.label,t.note=d.note,t.noteTone=d.noteTone,t.options=d.options,t.value=d.value,l||r||o!==null&&e.contains(o.root))return;o?.dispose(),o=null,r=!0,e.textContent="",p()}}}var V={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSecretField",$description:'The `secret` form control (specs/extensions.md §9.1, §13): one password field whose VALUE goes to the platform\'s secret store and never to project.json. A descriptor names it with `"ui": { "<field>": { "control": "secret" } }`, and `ui/schema-form.ts` mounts it into the empty host its own document announces for that field. **A surface never renders back the secret it describes, and this document is where that is visible rather than remembered**: the only thing bound to the field\'s value is `#/state/shown`, a scope path whose whole purpose is to hold nothing. What the field is worth is said in the placeholder instead — the env NAME the store gave it, which is the only half of a secret a screen may carry. `ui/form-controls.ts` decides everything else: whether the host has a secret store at all, what the placeholder says, what a commit is worth and what the field persists.',tagName:"div",attributes:{part:"secret",role:"none"},style:{$description:"`.secret-field` carried no rule anywhere — it was one of `check-styles.ts`'s ALLOWED_ORPHANS, a class emitted only so a test could find the control — so there is nothing to translate and the wrapper takes no box of its own. The field takes the width of the control host the form drew, which is the flex item; a kit field is inline-flex by default and would otherwise sit at its intrinsic width in a row sized for it.",display:"contents",'& [part="field"]':{width:"100%"}},children:[{$description:"`autocomplete: new-password` because this is a place to PUT a secret rather than to prove one: without it a password manager offers to fill the field with a credential belonging to whatever site the reader last logged in to, and the offer is the manager's own UI drawn over an editor. The value binding is `#/state/shown` and nothing else ever writes to it — see the document description.",tagName:"jx-textfield",attributes:{part:"field"},$props:{type:"password",size:"sm",autocomplete:"new-password",label:{$ref:"#/state/label"},placeholder:{$ref:"#/state/placeholder"},disabled:{$ref:"#/state/disabled"},value:{$ref:"#/state/shown"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/commit"},value:[{$ref:"event#/target/value"}]}],description:"The change bubbles out of the field's own input, so what the reader typed is read off the event rather than off the element — and it is read here, handed to the flow, and never written back onto the scope."}}]};T("secret-field",V);function G(){return{disabled:!0,label:"",placeholder:"Not set"}}function z(e,s){e.textContent="";let t=g({...G(),...s,shown:""}),o=null,r=!0,l=!1,p=()=>R("secret-field",t,e).then((d)=>{let y=d.root;if(r=!1,l)return d.dispose(),y;return o=d,y}),u=p();return{clear(){t.shown=" ",t.shown=""},dispose(){l=!0,o?.dispose(),o=null,e.textContent=""},host:e,ready:u,update(d){if(t.disabled=d.disabled,t.label=d.label,t.placeholder=d.placeholder,l||r||o!==null&&e.contains(o.root))return;o?.dispose(),o=null,r=!0,e.textContent="",p()}}}var Q=z_.map((e)=>({label:e,value:e})),Z=W_.map((e)=>({label:e||"(none)",value:e})),P=[],I=" ";function ee(e){let s=e.resolvePointer("#/$context/content"),t=v(s)?Object.keys(s):[],o=t.join(" ");if(o!==I)I=o,P=t.map((r)=>({label:r,value:r}));return P}function S(e){return e==="string"||e==="array"}function re(e){if(!v(e))return{properties:{},required:[],type:"object"};return e}function ae(e){return JSON.parse(JSON.stringify(e))}function ne(e){let s=e;return s.type??="object",s.properties??={},s.required??=[],s}function k(e){return`name:${e}`}function q(e){return`required:${e}`}function H(e,s){return`${e} ${s}`}function O(e,s,t){return e.echo?.id===s?e.echo.value:t}function oe(e,s,t,o,r){let l=H(s,t),p=ib(o);return{format:Td(o),hasFormat:S(p),key:t,name:O(e,k(l),t),parent:s,required:O(e,q(l),r),type:p}}function ie(e,s,t,o,r){let l=ib(t),p=l==="object",u=e.drafts.get(s),d=t.required??[];return{children:p?Object.entries(t.properties??{}).map(([y,h])=>oe(e,s,y,h,d.includes(y))):[],draftName:u?.name??"",draftType:u?.type??"string",extra:l==="reference"&&r?"reference":p?"nested":"none",format:Td(t),hasFormat:S(l),key:s,label:Jc(s),name:O(e,k(s),s),refTarget:t.$ref?t.$ref.replace(/^#\/[^/]+\//,""):"",required:O(e,q(s),o),type:l}}function W(e,s,t){let o={};for(let[r,l]of Object.entries(e))o[r===s?t:r]=l,delete e[r];Object.assign(e,o)}function C(e,s,t){e.required??=[];let o=e.required.indexOf(s);if(t&&o===-1)e.required.push(s);if(!t&&o!==-1)e.required.splice(o,1)}function se(e,s){let t=s,o=null,r={add:{...Ed},addOpen:!1,drafts:new Map,echo:null},l=()=>o??re(t.value),p=()=>{let a=l(),i=a.required??[],c=ee(t.ctx);return{addFormat:r.add.format,addHasFormat:S(r.add.type),addName:r.add.name,addRequired:r.add.required,addState:r.addOpen?"open":"closed",addType:r.add.type,fields:Object.entries(a.properties??{}).map(([m,f])=>ie(r,m,f,i.includes(m),c.length>0)),formatOptions:Z,targets:c,typeOptions:Q}},u=()=>D.update(p()),d=(a,i)=>{r.echo={id:a,value:i},u()},y=()=>{r.echo=null,u()},h=(a)=>{let i=ae(l()),c=ne(i);if(!a(c)){y();return}o=c,r.echo=null,t.onChange(i),u()},w=(a,i)=>a.properties[i],A=(a)=>{let i=r.drafts.get(a);if(!i)i={name:"",type:"string"},r.drafts.set(a,i);return i},D=E(e,{addNested(a){let i=A(a),c=Nx(i.name.trim());if(!c)return;h((m)=>{let f=w(m,a);if(!f)return!1;return f.properties??={},f.properties[c]=va(i.type||"string"),i.name="",!0})},cancelAdd(){r.addOpen=!1,r.add={...Ed},u()},confirmAdd(){let a=Nx(r.add.name.trim());if(!a)return;let{format:i,required:c,type:m}=r.add;r.addOpen=!1,r.add={...Ed},h((f)=>{if(f.properties[a]=va(m,i||void 0),c)C(f,a,!0);return!0})},editAddFormat(a){r.add.format=a,u()},editAddName(a){r.add.name=a,u()},editAddRequired(a){r.add.required=a,u()},editAddType(a){r.add.type=a,u()},editDraftName(a,i){A(a).name=i,u()},editDraftType(a,i){A(a).type=i,u()},openAdd(){r.addOpen=!0,r.add={...Ed},u()},removeField(a){h((i)=>{if(!i.properties[a])return!1;return delete i.properties[a],i.required=i.required.filter((c)=>c!==a),!0})},removeNested(a,i){h((c)=>{let m=w(c,a);if(!m?.properties?.[i])return!1;if(delete m.properties[i],m.required)m.required=m.required.filter((f)=>f!==i);return!0})},renameField(a,i){d(k(a),i);let c=Nx(i.trim());h((m)=>{if(!m.properties[a]||!c||c===a||m.properties[c])return!1;return W(m.properties,a,c),m.required=m.required.map((f)=>f===a?c:f),!0})},renameNested(a,i,c){d(k(H(a,i)),c);let m=Nx(c.trim());h((f)=>{let b=w(f,a);if(!b?.properties?.[i]||!m||m===i||b.properties[m])return!1;if(W(b.properties,i,m),b.required)b.required=b.required.map((N)=>N===i?m:N);return!0})},setFormat(a,i){h((c)=>{let m=c.properties[a];if(!m)return!1;return c.properties[a]=va(m.type||"string",i||void 0),!0})},setNestedFormat(a,i,c){h((m)=>{let f=w(m,a),b=f?.properties?.[i];if(!f?.properties||!b)return!1;return f.properties[i]=va(b.type||"string",c||void 0),!0})},setNestedRequired(a,i,c){d(q(H(a,i)),c),h((m)=>{let f=w(m,a);if(!f)return!1;return C(f,i,c),!0})},setNestedType(a,i,c){h((m)=>{let f=w(m,a),b=f?.properties?.[i];if(!f?.properties||!b)return!1;let N=S(c)?Td(b):void 0;return f.properties[i]=va(c,N||void 0),!0})},setRequired(a,i){d(q(a),i),h((c)=>{if(!c.properties[a])return!1;return C(c,a,i),!0})},setTarget(a,i){h((c)=>{if(!c.properties[a])return!1;return c.properties[a]={$ref:`#/content/${i}`},!0})},setType(a,i){h((c)=>{let m=c.properties[a];if(!m)return!1;let f=S(i)?Td(m):void 0;return c.properties[a]=va(i,f||void 0),!0})}});return u(),{dispose:()=>D.dispose(),update(a){t=a,o=null,r.echo=null,u()}}}var de={mount:se};cw("schema-builder",de);function J(e){return n(e)&&e?e:null}function ce(e,s){let t=s,o=()=>{let l=J(t.value);r.update({disabled:!t.ctx.commitSecret,label:t.key,placeholder:l?`Stored as ${l}`:"Not set"})},r=z(e,{commit(l){let{commitSecret:p}=t.ctx;if(!p||!l)return;r.clear();let{key:u,onChange:d}=t,y=J(t.value);Promise.resolve(p(u,l)).then((h)=>{if(n(h)&&h&&h!==y)d(h)})}});return o(),{dispose:()=>r.dispose(),update(l){t=l,o()}}}var pe={mount:ce};cw("secret",pe);function me(e,s){let t=s,o=()=>{Hl(e,t.key,n(t.value)?t.value:"",(r)=>t.onChange(r===""?void 0:r),{images:!0})};return o(),{dispose:()=>bm(e),update(r){t=r,o()}}}var ue={mount:me};cw("media",ue);var F=new Map,j=new Map,x=new Map;function lm(e){if(e===void 0)F.clear(),j.clear(),x.clear();else F.delete(e),j.delete(e),x.delete(e)}function fe(e){let s=F.get(e);if(s)return s;let t=(le("4f2raf4a"),import("./content-source-4f2raf4a.js")).then((o)=>o.listCollectionEntryIds(e));return F.set(e,t),t}function vE(e,s){let t=j.get(e);if(t)return t;let o=fe(e),r=x.get(e);if(r){if(s)r.add(s);return null}x.set(e,new Set(s?[s]:[]));let l=(p)=>{if(F.get(e)!==o)return;let u=x.get(e);x.delete(e),j.set(e,p);for(let d of u??[])d()};return o.then((p)=>l({ids:p}),(p)=>l({error:te(p)})),null}function he(e,s){let t=n(e.value)?e.value:"",o={canRetry:!1,disabled:!1,hasNote:!1,label:e.key,note:"",noteTone:"dim",options:[],value:t},r=Hu(e.schema);if(r===null)return{...o,hasNote:!0,kind:"text",note:'No collection referenced — add "$ref": "#/content/<type>" to this field.'};let l=vE(r,s);if(l===null)return{...o,disabled:!0,kind:"picker",options:[{label:"Loading…",value:t}]};if("error"in l)return{...o,canRetry:!0,hasNote:!0,kind:"text",note:`Could not list ${r} entries — ${l.error}`,noteTone:"danger"};let p=t!==""&&!l.ids.includes(t);return{...o,hasNote:l.ids.length===0,kind:"picker",note:l.ids.length===0?`No ${r} entries yet.`:"",options:[{label:"—",value:""},...p?[{label:`${t} — not found`,value:t}]:[],...l.ids.map((u)=>({label:u,value:u}))]}}function ge(e,s){let t=s,o=!1,r=()=>{if(!o)l.update(he(t,r))},l=L(e,{choose(p){t.onChange(p===""?void 0:p)},edit(p){t.onChange(p.trim()||void 0)},retry(){let p=Hu(t.schema);if(p!==null)lm(p);r()}});return r(),{dispose(){o=!0,l.dispose()},update(p){t=p,r()}}}var ye={mount:ge};cw("reference",ye);
2
+ export{z_,W_,Ed,ib,Td,va,lm,vE};
3
+
4
+ //# debugId=401309381CEC098C64756E2164756E21
5
+ //# sourceMappingURL=studio-ht81xjkr.js.map
@@ -1,5 +1,5 @@
1
- import{qx,Gx}from"./studio-jqrg9xxg.js";import{n,v}from"./studio-kt2j51sa.js";import{op,le}from"./studio-fqs1a22a.js";var a={document:qx,project:Gx},i={...a},s={document:null,project:null},d=!1;function u(e){return s[e]??=(async()=>{try{let{default:t}=await (le("dg097k3e"),import("./2020-dg097k3e.js").then((m)=>op(m.default,1))),{default:r}=await (le("203h71wy"),import("./index-203h71wy.js").then((m)=>op(m.default,1))),o=new t({allErrors:!0,strict:!1,allowUnionTypes:!0});return r(o),o.compile(i[e])}catch(t){if(!d)d=!0,console.error(`[jx] ${e} schema validation is unavailable — the AI assistant's schema gate is a `+"no-op for this session:",t);return null}})(),s[e]}function p(e){return v(e)&&Object.keys(e).length>0}function U2(e){let t=e?.document,r=e?.project,o=p(t)?t:a.document,c=p(r)?r:a.project,m=o!==a.document||c!==a.project;if(o===i.document&&c===i.project)return m;return i.document=o,i.project=c,s.document=null,s.project=null,m}var j=["unevaluatedProperty","additionalProperty","missingProperty"];function l(e){return(e.errors||[]).map((t)=>{let r=j.find((c)=>n(t.params[c])),o=r?` (${String(t.params[r])})`:"";return`${t.instancePath||"(root)"}: ${t.message}${o}`})}async function cm(e){let t=await u("document");if(!t||t(e))return[];return l(t)}async function q2(e){let t=await u("document");if(!t)return null;return t(e)?[]:l(t)}async function zu(e){let t=await u("project");if(!t||t(e))return[];return l(t)}
2
- export{U2,cm,q2,zu};
1
+ import{Jx,Yx}from"./studio-881z1xrx.js";import{n,v}from"./studio-ywf9y1e2.js";import{ip,le}from"./studio-k5n4es74.js";var a={document:Jx,project:Yx},i={...a},s={document:null,project:null},d=!1;function u(e){return s[e]??=(async()=>{try{let{default:t}=await (le("89fz3pfy"),import("./2020-89fz3pfy.js").then((m)=>ip(m.default,1))),{default:r}=await (le("jxmt7vh8"),import("./index-jxmt7vh8.js").then((m)=>ip(m.default,1))),o=new t({allErrors:!0,strict:!1,allowUnionTypes:!0});return r(o),o.compile(i[e])}catch(t){if(!d)d=!0,console.error(`[jx] ${e} schema validation is unavailable — the AI assistant's schema gate is a `+"no-op for this session:",t);return null}})(),s[e]}function p(e){return v(e)&&Object.keys(e).length>0}function X2(e){let t=e?.document,r=e?.project,o=p(t)?t:a.document,c=p(r)?r:a.project,m=o!==a.document||c!==a.project;if(o===i.document&&c===i.project)return m;return i.document=o,i.project=c,s.document=null,s.project=null,m}var j=["unevaluatedProperty","additionalProperty","missingProperty"];function l(e){return(e.errors||[]).map((t)=>{let r=j.find((c)=>n(t.params[c])),o=r?` (${String(t.params[r])})`:"";return`${t.instancePath||"(root)"}: ${t.message}${o}`})}async function hm(e){let t=await u("document");if(!t||t(e))return[];return l(t)}async function Q2(e){let t=await u("document");if(!t)return null;return t(e)?[]:l(t)}async function Bu(e){let t=await u("project");if(!t||t(e))return[];return l(t)}
2
+ export{X2,hm,Q2,Bu};
3
3
 
4
- //# debugId=9EA3201F4DC45CE064756E2164756E21
5
- //# sourceMappingURL=studio-73wz63nn.js.map
4
+ //# debugId=862CC439A0A0B2F464756E2164756E21
5
+ //# sourceMappingURL=studio-jr30g4ae.js.map
@@ -1,5 +1,5 @@
1
- var s=Object.create;var{getPrototypeOf:t,defineProperty:n,getOwnPropertyNames:u}=Object;var q=Object.prototype.hasOwnProperty;function v(a){return this[a]}var w,x,op=(a,b,c)=>{var i=a!=null&&typeof a==="object";if(i){var f=b?w??=new WeakMap:x??=new WeakMap,d=f.get(a);if(d)return d}c=a!=null?s(t(a)):{};let g=b||!a||!a.__esModule||!q.call(a,"default")?n(c,"default",{value:a,enumerable:!0}):c;if(a&&typeof a==="object"||typeof a==="function"){for(let e of u(a))if(!q.call(g,e))n(g,e,{get:v.bind(a,e),enumerable:!0})}if(i)f.set(a,g);return g};var pe=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports);var y=(a)=>a;function z(a,b){this[a]=y.bind(null,b)}var Qi=(a,b)=>{for(var c in b)n(a,c,{get:b[c],enumerable:!0,configurable:!0,set:z.bind(b,c)})};var r,o,m,le=(a,b)=>{for(var[c,i,f]of r||[])for(var d=[a],g=globalThis,e=g.document,p,k,l,h,j;k=d.pop();)if(!o[k]&&(l=i[k])){o[k]=1;for(h=1;h<l.length;h++)d.push(f[l[h]]);if(!b&&k!==a&&(p=e&&e.head)){if(m===void 0)m=(h=e.querySelector("meta[property=csp-nonce]"))&&(h.nonce||h.getAttribute("nonce"))||"";if(j=e.createElement("link"),j.rel="modulepreload",j.crossOrigin="",m)j.nonce=m;j.href=new g.URL(l[0],c),p.appendChild(j)}}},H2=(a,b,c,i)=>{for(var f={},d=0;d<b.length;d++)f[b[d]]=c[d];(r||=[]).push([a,f,b]),o||={},le(b[i],1)};
2
- export{op,pe,Qi,le,H2};
1
+ var s=Object.create;var{getPrototypeOf:t,defineProperty:n,getOwnPropertyNames:u}=Object;var q=Object.prototype.hasOwnProperty;function v(a){return this[a]}var w,x,ip=(a,b,c)=>{var i=a!=null&&typeof a==="object";if(i){var f=b?w??=new WeakMap:x??=new WeakMap,d=f.get(a);if(d)return d}c=a!=null?s(t(a)):{};let g=b||!a||!a.__esModule||!q.call(a,"default")?n(c,"default",{value:a,enumerable:!0}):c;if(a&&typeof a==="object"||typeof a==="function"){for(let e of u(a))if(!q.call(g,e))n(g,e,{get:v.bind(a,e),enumerable:!0})}if(i)f.set(a,g);return g};var pe=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports);var y=(a)=>a;function z(a,b){this[a]=y.bind(null,b)}var eo=(a,b)=>{for(var c in b)n(a,c,{get:b[c],enumerable:!0,configurable:!0,set:z.bind(b,c)})};var r,o,m,le=(a,b)=>{for(var[c,i,f]of r||[])for(var d=[a],g=globalThis,e=g.document,p,k,l,h,j;k=d.pop();)if(!o[k]&&(l=i[k])){o[k]=1;for(h=1;h<l.length;h++)d.push(f[l[h]]);if(!b&&k!==a&&(p=e&&e.head)){if(m===void 0)m=(h=e.querySelector("meta[property=csp-nonce]"))&&(h.nonce||h.getAttribute("nonce"))||"";if(j=e.createElement("link"),j.rel="modulepreload",j.crossOrigin="",m)j.nonce=m;j.href=new g.URL(l[0],c),p.appendChild(j)}}},G2=(a,b,c,i)=>{for(var f={},d=0;d<b.length;d++)f[b[d]]=c[d];(r||=[]).push([a,f,b]),o||={},le(b[i],1)};
2
+ export{ip,pe,eo,le,G2};
3
3
 
4
- //# debugId=AA4F0B9FACCFC42564756E2164756E21
5
- //# sourceMappingURL=studio-fqs1a22a.js.map
4
+ //# debugId=EF96E641A2CD513D64756E2164756E21
5
+ //# sourceMappingURL=studio-k5n4es74.js.map
@@ -1,5 +1,5 @@
1
- import{as}from"./studio-nsv7g1qn.js";var r="site-",f=new Set(["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),o=[[183,183],[192,214],[216,246],[248,893],[895,8191],[8204,8205],[8255,8256],[8304,8591],[11264,12271],[12289,55295],[63744,64975],[65008,65533],[65536,983039]];function n(e){return`${String.fromCodePoint(92)}u{${e.toString(16)}}`}var a=[String.raw`\-.0-9_a-z`,...o.map(([e,t])=>`${n(e)}-${n(t)}`)].join(""),s=new RegExp(`^[${a}]$`,"u");function iw(e){if(e==="")return"Enter a tag name.";if(!/^[a-z]/.test(e))return"A tag name starts with a lower-case letter.";for(let t of e.slice(1))if(!s.test(t))return/[A-Z]/.test(t)?"A tag name is lower case.":`“${t}” cannot appear in a tag name.`;if(!e.includes("-"))return"A tag name needs a hyphen, such as my-card.";if(f.has(e))return`<${e}> is reserved by HTML.`;return""}function ib(e){let t=as(e).replaceAll(/-+/g,"-").replaceAll(/^-|-$/g,"");if(t==="")return"";return/^[a-z]/.test(t)&&t.includes("-")?t:`${r}${t}`}
2
- export{iw,ib};
1
+ import{as}from"./studio-trcfer2b.js";var r="site-",f=new Set(["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),o=[[183,183],[192,214],[216,246],[248,893],[895,8191],[8204,8205],[8255,8256],[8304,8591],[11264,12271],[12289,55295],[63744,64975],[65008,65533],[65536,983039]];function n(e){return`${String.fromCodePoint(92)}u{${e.toString(16)}}`}var a=[String.raw`\-.0-9_a-z`,...o.map(([e,t])=>`${n(e)}-${n(t)}`)].join(""),s=new RegExp(`^[${a}]$`,"u");function aw(e){if(e==="")return"Enter a tag name.";if(!/^[a-z]/.test(e))return"A tag name starts with a lower-case letter.";for(let t of e.slice(1))if(!s.test(t))return/[A-Z]/.test(t)?"A tag name is lower case.":`“${t}” cannot appear in a tag name.`;if(!e.includes("-"))return"A tag name needs a hyphen, such as my-card.";if(f.has(e))return`<${e}> is reserved by HTML.`;return""}function ab(e){let t=as(e).replaceAll(/-+/g,"-").replaceAll(/^-|-$/g,"");if(t==="")return"";return/^[a-z]/.test(t)&&t.includes("-")?t:`${r}${t}`}
2
+ export{aw,ab};
3
3
 
4
- //# debugId=F221616972B4F42E64756E2164756E21
5
- //# sourceMappingURL=studio-j5jqvyn3.js.map
4
+ //# debugId=CFB1CAD40B22D7F764756E2164756E21
5
+ //# sourceMappingURL=studio-k6hbx2fc.js.map
@@ -1,5 +1,5 @@
1
- import{p}from"./studio-pr23qhrw.js";import{Si}from"./studio-6vrxzkba.js";import{us}from"./studio-hnx1h1pr.js";import{nn}from"./studio-gmhd0j3f.js";import{Vc,uA,Ab}from"./studio-hvxt8z79.js";import{Z}from"./studio-kt2j51sa.js";var u=new Map,h=new Map,d=new Map,g=new Set;function m(e){return nn(e)===".svg"}function c(e){let t=e===null?null:/^\s*(\d+(?:\.\d+)?)\s*(?:px)?\s*$/.exec(e),n=t?Number(t[1]):Number.NaN;return n>0?n:null}function M(e){let t=new DOMParser().parseFromString(e,"image/svg+xml").documentElement;if(t.localName!=="svg")return null;let n=c(t.getAttribute("width")),i=c(t.getAttribute("height")),r=(t.getAttribute("viewBox")??"").trim().split(/[\s,]+/).map(Number),o=r[2]??Number.NaN,l=r[3]??Number.NaN,a=r.length===4&&o>0&&l>0,s=null;if(n!==null&&i!==null)s={height:i,width:n};else if(a&&n!==null)s={height:n*l/o,width:n};else if(a&&i!==null)s={height:i,width:i*o/l};else if(a)s={height:l,width:o};return s&&{height:Math.round(s.height),width:Math.round(s.width)}}async function b(e){g.add(e);try{let t=M(await p().readFile(e));if(t&&t.width>0&&t.height>0)d.set(e,t)}catch{}}function Dd(e){let t=Si(e);return u.has(t)&&(!m(t)||g.has(t))}function f(e,t){let n=uA(e),i=d.get(e);return{bytes:Z(t?.size)?t.size:null,ext:nn(n),height:i?.height??null,kind:Vc({name:n}),modified:t?.modified??null,name:n,path:e,width:i?.width??null}}function Nd(e){return u.get(Si(e))??null}function qD(e){for(let t of e){if(t.type!=="file")continue;let n=Si(t.path);if(!u.has(n))u.set(n,f(n,t))}}async function Uu(e){let t=Si(e),n=u.get(t);if(n&&Dd(t))return n;let i=h.get(t);if(i)return i;let r=(async()=>{if(m(t)&&!g.has(t))await b(t);if(n){let a=d.get(t);return{...n,height:a?.height??null,width:a?.width??null}}let l;try{l=(await us(()=>p().listDirectory(Ab(t)))).find((s)=>Si(s.path)===t)}catch{l=void 0}return f(t,l)})();h.set(t,r);let o=await r;return h.delete(t),u.set(t,o),o}function yp(e,t,n){if(!(t>0&&n>0))return!1;let i=Si(e);if(m(i))return!1;let r=d.get(i);if(r&&r.width===t&&r.height===n)return!1;d.set(i,{height:n,width:t});let o=u.get(i);if(o)u.set(i,{...o,height:n,width:t});return!0}function GD(){u.clear(),d.clear(),g.clear()}function NT(e){if(e<1024)return`${e} B`;if(e<1048576)return`${Math.round(e/1024)} KB`;return`${(e/1048576).toFixed(1)} MB`}function Cw(e){if(!e)return"";let t=[];if(e.width!==null&&e.height!==null)t.push(`${e.width} × ${e.height}`);if(e.bytes!==null)t.push(NT(e.bytes));return t.join(" · ")}
2
- export{Dd,Nd,qD,Uu,yp,GD,NT,Cw};
1
+ import{p}from"./studio-9ndgd55w.js";import{Si}from"./studio-8pne0rx4.js";import{us}from"./studio-by8x0jvc.js";import{nn}from"./studio-t6dqnnft.js";import{Wc,fA,Fb}from"./studio-vtey9w98.js";import{Z}from"./studio-ywf9y1e2.js";var u=new Map,h=new Map,d=new Map,g=new Set;function m(e){return nn(e)===".svg"}function c(e){let t=e===null?null:/^\s*(\d+(?:\.\d+)?)\s*(?:px)?\s*$/.exec(e),n=t?Number(t[1]):Number.NaN;return n>0?n:null}function M(e){let t=new DOMParser().parseFromString(e,"image/svg+xml").documentElement;if(t.localName!=="svg")return null;let n=c(t.getAttribute("width")),i=c(t.getAttribute("height")),r=(t.getAttribute("viewBox")??"").trim().split(/[\s,]+/).map(Number),o=r[2]??Number.NaN,l=r[3]??Number.NaN,a=r.length===4&&o>0&&l>0,s=null;if(n!==null&&i!==null)s={height:i,width:n};else if(a&&n!==null)s={height:n*l/o,width:n};else if(a&&i!==null)s={height:i,width:i*o/l};else if(a)s={height:l,width:o};return s&&{height:Math.round(s.height),width:Math.round(s.width)}}async function b(e){g.add(e);try{let t=M(await p().readFile(e));if(t&&t.width>0&&t.height>0)d.set(e,t)}catch{}}function Rd(e){let t=Si(e);return u.has(t)&&(!m(t)||g.has(t))}function f(e,t){let n=fA(e),i=d.get(e);return{bytes:Z(t?.size)?t.size:null,ext:nn(n),height:i?.height??null,kind:Wc({name:n}),modified:t?.modified??null,name:n,path:e,width:i?.width??null}}function Dd(e){return u.get(Si(e))??null}function iN(e){for(let t of e){if(t.type!=="file")continue;let n=Si(t.path);if(!u.has(n))u.set(n,f(n,t))}}async function qu(e){let t=Si(e),n=u.get(t);if(n&&Rd(t))return n;let i=h.get(t);if(i)return i;let r=(async()=>{if(m(t)&&!g.has(t))await b(t);if(n){let a=d.get(t);return{...n,height:a?.height??null,width:a?.width??null}}let l;try{l=(await us(()=>p().listDirectory(Fb(t)))).find((s)=>Si(s.path)===t)}catch{l=void 0}return f(t,l)})();h.set(t,r);let o=await r;return h.delete(t),u.set(t,o),o}function _p(e,t,n){if(!(t>0&&n>0))return!1;let i=Si(e);if(m(i))return!1;let r=d.get(i);if(r&&r.width===t&&r.height===n)return!1;d.set(i,{height:n,width:t});let o=u.get(i);if(o)u.set(i,{...o,height:n,width:t});return!0}function oN(){u.clear(),d.clear(),g.clear()}function WT(e){if(e<1024)return`${e} B`;if(e<1048576)return`${Math.round(e/1024)} KB`;return`${(e/1048576).toFixed(1)} MB`}function Aw(e){if(!e)return"";let t=[];if(e.width!==null&&e.height!==null)t.push(`${e.width} × ${e.height}`);if(e.bytes!==null)t.push(WT(e.bytes));return t.join(" · ")}
2
+ export{Rd,Dd,iN,qu,_p,oN,WT,Aw};
3
3
 
4
- //# debugId=058F9F991DB85F6F64756E2164756E21
5
- //# sourceMappingURL=studio-332hesdk.js.map
4
+ //# debugId=7386B99F4F26428664756E2164756E21
5
+ //# sourceMappingURL=studio-kqh7fxn6.js.map
@@ -1,5 +1,5 @@
1
- function m(s,n={}){let t=n.baseMs??1000,o=n.maxMs??30000,i=n.random??Math.random,e=Math.min(o,t*2**Math.max(0,s));return e/2+i()*e/2}function xy(s,n={}){let t=n.win??(typeof window>"u"?void 0:window),o=n.doc??(typeof document>"u"?void 0:document),i=0,e=null,r=!1,a=()=>{if(e=null,!r)s()},c=()=>{if(r||e===null)return;clearTimeout(e),i=0,a()},u=(d)=>{if(d.persisted)c()},l=()=>{if(o?.visibilityState==="visible")c()};return t?.addEventListener("online",c),t?.addEventListener("pageshow",u),o?.addEventListener("visibilitychange",l),{dispose(){if(r)return;if(r=!0,e!==null)clearTimeout(e),e=null;t?.removeEventListener("online",c),t?.removeEventListener("pageshow",u),o?.removeEventListener("visibilitychange",l)},opened(){i=0},scheduleRetry(){if(r||e!==null)return;let d=m(i,n);i+=1,e=setTimeout(a,d)},wake:c}}
2
- export{xy};
1
+ function m(s,n={}){let t=n.baseMs??1000,o=n.maxMs??30000,i=n.random??Math.random,e=Math.min(o,t*2**Math.max(0,s));return e/2+i()*e/2}function ky(s,n={}){let t=n.win??(typeof window>"u"?void 0:window),o=n.doc??(typeof document>"u"?void 0:document),i=0,e=null,r=!1,a=()=>{if(e=null,!r)s()},c=()=>{if(r||e===null)return;clearTimeout(e),i=0,a()},u=(d)=>{if(d.persisted)c()},l=()=>{if(o?.visibilityState==="visible")c()};return t?.addEventListener("online",c),t?.addEventListener("pageshow",u),o?.addEventListener("visibilitychange",l),{dispose(){if(r)return;if(r=!0,e!==null)clearTimeout(e),e=null;t?.removeEventListener("online",c),t?.removeEventListener("pageshow",u),o?.removeEventListener("visibilitychange",l)},opened(){i=0},scheduleRetry(){if(r||e!==null)return;let d=m(i,n);i+=1,e=setTimeout(a,d)},wake:c}}
2
+ export{ky};
3
3
 
4
- //# debugId=EB760674662B804464756E2164756E21
5
- //# sourceMappingURL=studio-8nyw10dp.js.map
4
+ //# debugId=299FBD6E991CCBF664756E2164756E21
5
+ //# sourceMappingURL=studio-kyw47pet.js.map
@@ -0,0 +1,5 @@
1
+ import{Ht,Wi,fn,lr,Aa}from"./studio-a6e5fzve.js";import{C}from"./studio-tfmhnwyr.js";import{Pn,Kc,St,Hi,Ce,To,We,Wd,u}from"./studio-ztppbam0.js";import{Lo}from"./studio-8pne0rx4.js";import{te}from"./studio-psh8mwnw.js";import{lm}from"./studio-ht81xjkr.js";import{_a}from"./studio-vtey9w98.js";import{WD,tT}from"./studio-fg4fj9ec.js";import{Co}from"./studio-nqexty8x.js";import{yr,Zu}from"./studio-0rg30pvs.js";import{aw,ab}from"./studio-k6hbx2fc.js";import{sb}from"./studio-6rbaedw2.js";import{Ml}from"./studio-ge08zwpv.js";import{ya,Ic,GE}from"./studio-n4qq1n57.js";import{as,pb}from"./studio-trcfer2b.js";import{v}from"./studio-ywf9y1e2.js";import{le}from"./studio-k5n4es74.js";var tb=["page","collection","template","component","media","entry"],tw={collection:{cta:"Create collection",hint:"Posts, products, team… with a page each",icon:"stack",id:"collection",label:"Collection",nameLabel:"Collection name",placeholder:"Recipes"},component:{cta:"Create component",hint:"A reusable block for any page",icon:"cube",id:"component",label:"Component",nameLabel:"Component name",placeholder:"Pricing table"},entry:{cta:"Create entry",hint:"A new item in a collection",icon:"file-text",id:"entry",label:"Entry",nameLabel:"Entry name",placeholder:"My first post"},media:{cta:"Upload",hint:"Images, video, documents",icon:"image",id:"media",label:"Media",nameLabel:"",placeholder:""},page:{cta:"Create page",hint:"A new URL on your site",icon:"file",id:"page",label:"Page",nameLabel:"Page name",placeholder:"Pricing"},template:{cta:"Create template",hint:"Shared frame that pages sit inside",icon:"frame-corners",id:"template",label:"Template",nameLabel:"Template name",placeholder:"Landing"}},Hs="blank",$c="article",P_="selection",sm="copy",nw=["title","image","richText","date","tags","number","link"],F_={date:{key:"date",label:"Date",schema:{format:"date",type:"string"}},image:{key:"cover",label:"Image",schema:{format:"image",type:"string"}},link:{key:"link",label:"Link",schema:{format:"uri",type:"string"}},number:{key:"number",label:"Number",schema:{type:"number"}},richText:{key:null,label:"Rich text",schema:null},tags:{key:"tags",label:"Tags",schema:{items:{type:"string"},type:"array"}},title:{key:"title",label:"Title",schema:{type:"string"}}},hE=["title","image","richText"];function p(e,n){return e==="."||e===""?n:`${e}/${n}`}function Qa(e){return e.replace(/^\.\//,"")}function j_(e,n){let t=n.defaultLayout;if(e===Hs||e==="")return t?!1:void 0;if(t&&Qa(t)===Qa(e))return;return e}function Mu(e){let n=e.defaultLayout;if(n)return e.layouts.find((r)=>Qa(r.ref)===Qa(n))?.ref??n;return e.layouts[0]?.ref??Hs}function H_(e,n){let t=Pn(n??"");if(t!==null){let r=e.layouts.find((o)=>Qa(o.ref).replace(/\.json$/i,"").split("/").some((l)=>Pn(l)===t));if(r)return r.ref}return Mu(e)}function R(e){return e.trim().replaceAll("\\","/").split("/").map((n)=>as(n)).filter((n)=>n!=="")}function I(e){let n={};for(let r of nw){let o=F_[r];if(e.includes(r)&&o.key!==null&&o.schema!==null)n[o.key]={...o.schema}}let t={properties:n,type:"object"};if(e.includes("title"))t.required=["title"];return t}function cD(e,n){let t=e?.properties??{};return nw.filter((r)=>{let{key:o}=F_[r];return o===null?n:Object.hasOwn(t,o)})}function w(e,n){let t=GE(e.schema);if(n!==void 0&&n!==""&&e.schema?.properties?.title!==void 0)t.title=n;if(e.ext===".json"||e.formatName===null)return{doc:t,format:null};return{doc:{...t,children:[]},format:e.formatName,frontmatter:Object.keys(t).length>0}}function pE(e,n,t,r){let o=[];if(n.includes("title"))o.push({tagName:"h1",textContent:"${state.entry.data.title}"});if(n.includes("image"))o.push({attributes:{alt:n.includes("title")?"${state.entry.data.title}":"",loading:"lazy",src:"${state.entry.data.cover}"},tagName:"img"});if(n.includes("richText")&&r.contentFormat!==null)o.push({children:"${state.entry.$children}",tagName:"div"});let i={};if(t!==void 0)i.$layout=t;return i.$paths={contentType:e,field:"id",param:"slug"},i.title=n.includes("title")?"${state.entry.data.title}":Zu(e),i.state={entry:{$prototype:"ContentEntry",$src:"@jxsuite/parser/ContentEntry.class.json",contentType:e,field:"id",id:{$ref:"#/$params/slug"}}},i.tagName="article",i.children=o,i}function am(e,n){let t=n.i18n??null,r=Pn(e);return t!==null&&r!==null&&t.locales.includes(r)?r:null}function nb(e){return e.dir.includes(Lo)}function _(e,n){return e.localeDirs?.[n]??e.dir.replace(Lo,n.toLowerCase())}function E(e,n,t){let r=t.i18n??null;if(n===null||r===null)return e;return Kc(e,n,{...r,locales:[...r.locales]})??e}function J(e){let n=e.lastIndexOf("/");return n===-1?[".",e]:[e.slice(0,n),e.slice(n+1)]}function W(e,n,t){if(n.startFrom===sm&&n.copyOf!==void 0){let r=t.componentDocs?.get(n.copyOf);if(r){let o=JSON.parse(JSON.stringify(r));return delete o.$id,o.tagName=e,o}}return{children:[],tagName:e}}function B(e,n,t){let r=n.startFrom??Mu(t),o=r===$c&&t.article!==null?t.article:null,i=o?.ext??".json",l=n.url===void 0?[as(e)].filter((m)=>m!==""):R(n.url),a=l.length===0?n.url===void 0?"":"index":l.at(-1),s=["pages",...l.slice(0,-1)].join("/"),c=a===""?"":`${a}${i}`,f=am(n.locale,t),d=c===""?p(s,c):E(p(s,c),f,t),b=c===""?s:J(d)[0],g=e.trim(),y;if(o)y={doc:{children:[{tagName:"h1",textContent:g}],title:g},format:o.name,frontmatter:!0};else{let m={},h=j_(r===$c?Hs:r,t);if(h!==void 0)m.$layout=h;m.title=g,m.tagName="main",m.children=[{tagName:"h1",textContent:g}],y={doc:m,format:null}}let N=c===""?"":yr(d).urlPattern;return{content:y,dir:b,ext:i,extraWrites:[],fileName:c,kind:"page",path:d,route:N,saved:c===""?"":`Saved as ${d} · opens at ${N}`}}function K(e,n,t){let r=as(e),o=n.fields??hE,i=t.i18n??null,l=i!==null&&n.localized!==!1,a=`content/${r}`,s=l?`${a}/${i.defaultLocale.toLowerCase()}`:a,c=t.contentFormat,f=c?.ext??".json",d=Zu(r),b=r===""?"":`first-${d.replaceAll(" ","-")}${f}`,g=I(o),y=structuredClone(g),N={format:c?.name??"json",schema:v(y)?y:{},source:l?`./${a}/${Lo}`:`./${a}`},m=w({ext:f,formatName:c?.name??null,schema:g},`First ${d}`),h=[],k,L="";if(n.ownPage!==!1&&r!==""){let j=n.pageTemplate??Mu(t),D=l?[i.defaultLocale,...i.locales.filter((x)=>x!==i.defaultLocale)]:[null],T=[];for(let x of D){let O=E(`pages/${r}/[slug].json`,x,t),A=x===null||j!==Mu(t)?j:H_(t,x);k??=yr(O).urlPattern,h.push({body:{doc:pE(r,o,j_(A,t),t),format:null},path:O}),T.push(O)}L=T.length===1?`, and ${T[0]} at ${k}`:`, and a page in each language (${T.join(", ")})`}let P={config:{entry:N,name:r},content:m,dir:s,ext:f,extraWrites:h,fileName:b,kind:"collection",path:p(s,b),saved:r===""?"":l?`Adds a “${r}” collection to project.json with one folder per language under ${a}/, a first entry in ${s}/${L}.`:`Adds a “${r}” collection to project.json, a ${s}/ folder with a first entry${L}.`};if(k!==void 0)P.route=k;return P}function M(e,n){let t=as(e),r=t===""?"":`${t}.json`,o=p("layouts",r),i={},l=n.startFrom??"";if(l!==""&&l!==Hs)i.$layout=l;return i.tagName="div",i.children=[{children:[{tagName:"slot"}],tagName:"main"}],{content:{doc:i,format:null},dir:"layouts",ext:".json",extraWrites:[],fileName:r,kind:"template",path:o,saved:r===""?"":`Saved as ${o} with one slot.`}}function z(e,n,t){let r=ab(e),o=r===""?"":`${r}.json`,i=p("components",o);return{content:{doc:W(r,n,t),format:null},dir:"components",ext:".json",extraWrites:[],fileName:o,kind:"component",path:i,saved:o===""?"":`Saved as ${i} with tag <${r}>.`,tag:r}}function U(e,n,t){let r=t.collections.find((d)=>d.name===n.collection)??null,o=as(e),i=r?.ext??".json",l=am(n.locale,t),a=r!==null&&nb(r)&&l===null,s=r===null?"content":nb(r)&&l!==null?_(r,l):r.dir,c=o===""||r===null||a?"":`${o}${i}`,f=p(s,c);return{content:r?w(r,e.trim()):{doc:{},format:null},dir:s,ext:i,extraWrites:[],fileName:c,kind:"entry",path:f,saved:c===""?"":`Saved as ${f} in ${r.name}.`}}function fE(e,n,t,r){switch(e){case"page":return B(n,t,r);case"collection":return K(n,t,r);case"template":return M(n,t);case"component":return z(n,t,r);case"entry":return U(n,t,r);default:{let o=t.files??0;return{content:{doc:{},format:null},dir:_a,ext:"",extraWrites:[],fileName:"",kind:e,path:_a,saved:o===0?`Saved under ${_a}/. No folder to choose.`:`${o===1?"1 file":`${o} files`} will be saved under ${_a}/.`}}}}function q(e,n){let t=e.lastIndexOf("/"),r=t===-1?".":e.slice(0,t),o=n(r);return pb(e.slice(t+1),"",{dir:r,taken:o??new Set})}function S(e){if(e.kind!=="page"||e.fileName==="")return[];let n=e.fileName.slice(0,e.fileName.length-e.ext.length);if(n!=="index")return[{dir:e.dir,stem:n},{dir:p(e.dir,n),stem:"index"}];let t=e.dir.lastIndexOf("/");if(t===-1)return[{dir:e.dir,stem:n}];return[{dir:e.dir,stem:n},{dir:e.dir.slice(0,t),stem:e.dir.slice(t+1)}]}function V(e,n){let t=e.fileName.toLowerCase();for(let{dir:r,stem:o}of S(e)){let i=`${o.toLowerCase()}.`;for(let l of n(r)??[])if(l.startsWith(i)&&!(r===e.dir&&l===t))return p(r,l)}return null}function H(e){return pb(e,"",{choice:{ext:"",kind:"fixed"},dir:".",taken:new Set})}function mE(e,n,t,r,o){if(e.kind==="media")return(t.files??0)===0?"Drop files here, or browse for them.":"";let i=H(n);if(i!=="")return i;switch(e.kind){case"page":{if(t.url!==void 0){if(t.url.replaceAll("\\","/").split("/").includes(".."))return"A URL cannot step outside the site.";if(!t.url.trim().startsWith("/"))return"A URL starts with a slash, such as /pricing."}let a=V(e,o);if(a!==null)return`${a} already opens at ${e.route??"/"}.`;break}case"component":{let a=e.tag??"",s=aw(a);if(s!=="")return s;if(r.componentTags.includes(a))return`A component named <${a}> already exists.`;if(t.startFrom===P_&&r.hasSelection!==!0)return"Select an element on the canvas to make a component from it.";if(t.startFrom===sm&&(t.copyOf===void 0||r.componentDocs?.get(t.copyOf)===void 0))return"Choose the component to copy.";break}case"collection":{let a=e.config?.name??"";if(r.declaredContent.includes(a))return`A collection named “${a}” already exists.`;if(o("content")?.has(a)===!0)return`content/${a}/ already exists.`;break}case"entry":{let a=r.collections.find((s)=>s.name===t.collection);if(!a)return"Choose the collection this entry belongs to.";if(nb(a)&&am(t.locale,r)===null)return`Choose the language this ${Zu(a.name)} is written in.`;break}default:break}let l=[...e.kind==="collection"?[]:[e.path],...e.extraWrites.map((a)=>a.path)];for(let a of l){let s=q(a,o);if(s!=="")return s}return""}function gE(e){let n=new Set,t=(r)=>{let o=r.lastIndexOf("/");n.add(o===-1?".":r.slice(0,o))};if(e.kind==="media")return[];if(e.kind==="collection")n.add("content");else if(e.fileName!=="")t(e.path);for(let r of e.extraWrites)t(r.path);for(let{dir:r}of S(e))n.add(r);return[...n]}function dD(e){let n=(r)=>r==="."?0:r.split("/").length,t=new Map;for(let r of e){let o=n(r);t.set(o,[...t.get(o)??[],r])}return[...t.entries()].toSorted(([r],[o])=>r-o).map(([,r])=>r)}function uD(e,n){if(e===".")return!1;let t=e.lastIndexOf("/"),r=n.get(t===-1?".":e.slice(0,t));return r!==void 0&&!r.has(e.slice(t+1).toLowerCase())}function B_(e){if(e.ext===".json")return null;return(e.def.format?Wi(e.def.format)?.name:void 0)??fn(`untitled${e.ext}`)?.name??lr()?.name??null}async function G(e){let n=w({ext:e.ext,formatName:B_(e),schema:e.schema});if(n.format===null)return Co(n.doc,null);return Aa(n.format,n.doc,{frontmatter:n.frontmatter??!1,mode:"roundtrip"})}async function Y2(e,n={}){let t=ya(e);if(!t)return C.error(`No content collection named "${e}" to create an entry in.`,{detail:"A collection needs a `content` entry in project.json whose `source` is a directory. A collection whose source names a single file (a CSV catalogue) has rows, not entry files.",source:"Content"}),null;await Ht().catch(()=>{});let r;try{r=await G(t)}catch(s){return C.error(`Could not prepare a new ${t.name} entry.`,{detail:te(s),path:t.dir,source:"Content"}),null}let o=n.dir,i=o!==void 0&&Wd(o)?.name===t.name?o:t.dir;if(i.includes(Lo))return C.error(`"${t.name}" is a localized collection.`,{detail:`Its entries live in one directory per language (${t.dir}). Open the folder for the language you are writing in and create the entry there.`,path:t.dir,source:"Content"}),null;let{createFileIn:l}=await (le("yswdhxrf"),import("./files-yswdhxrf.js")),a=await l({content:r,dir:i,format:{ext:t.ext,kind:"fixed"},source:"Content",suggestedName:"untitled",title:`New ${t.name} entry`});if(a===null)return null;return lm(t.name),await Ml(a),a}function F(){let e=u.value;return e&&Ic(e.documentPath)?e:null}function Y(){return[{args:Ce({path:We("Project-relative path of the entry file to open.")}),category:"File",id:"content.openEntry",level:"project",menus:["context/file","palette"],group:"1_file",requires:"an open project",when:(e)=>e.project.open,run:async(e,n)=>{await Ml(St("content.openEntry",n,"path"))},title:"Open Entry"},{args:Ce({draft:To("True marks the open entry a draft; false marks it published. Written as a `draft` field on the entry.")}),category:"Document",id:"content.setDraft",level:"document",menus:["context/tab","palette"],group:"3_document",requires:"a content entry open",when:(e)=>e.document.open,enablement:()=>F()!==null,undo:"document",run:(e,n)=>{let t=F();if(!t)throw Error("content.setDraft: the active document is not a content entry");sb(t,Hi("content.setDraft",n,"draft"))},title:"Set Draft"},{args:Ce({include:To("True lists entries marked `draft: true` alongside the rest.")}),category:"View",id:"content.setIncludeDrafts",level:"project",menus:["palette"],group:"2_view",requires:"an open project",when:(e)=>e.project.open,run:async(e,n)=>{WD(Hi("content.setIncludeDrafts",n,"include")),await tT()},title:"Include Drafts"}]}function bE(e){e.registerAll(Y())}
2
+ export{tb,tw,Hs,$c,P_,sm,nw,F_,hE,Qa,j_,Mu,H_,cD,pE,am,nb,fE,mE,gE,dD,uD,B_,Y2,bE};
3
+
4
+ //# debugId=466AE0DD27DC0A1D64756E2164756E21
5
+ //# sourceMappingURL=studio-mkw17ngg.js.map
@@ -1,5 +1,5 @@
1
- import{mt,no}from"./studio-2b8443ms.js";import{HA,hC,Mt,Nt,uh,qA,ae}from"./studio-7cg75gtj.js";import{ge,ne,g,Qd,C,Lh}from"./studio-hw60n5dh.js";import{Q}from"./studio-nqxqf8p2.js";import{n,te}from"./studio-kt2j51sa.js";var qe="data-jx-region",fe=["rail","navigator","inspector","pane","dock.bottom","statusbar","commandbar","overlay"],pe=new Set(["dock.bottom"]);function me(e){let t=e.indexOf("/"),o=t===-1?e:e.slice(0,t),r=t===-1?void 0:e.slice(t+1);if(r===""||o==="")return null;let s=o,i;if(!pe.has(o)){let c=o.indexOf(".");if(c!==-1){if(s=o.slice(0,c),i=o.slice(c+1),i==="")return null}}let l=fe.find((c)=>c===s);if(l===void 0)return null;return i===void 0?r===void 0?{surface:l}:{part:r,surface:l}:r===void 0?{instance:i,surface:l}:{instance:i,part:r,surface:l}}function ve(e){return me(e)!==null}function he(e){if(e==="pane")return"pane.primary";return e.startsWith("pane/")?`pane.primary/${e.slice(5)}`:e}function X(e){return e??document}var be=[{locate:([,e],t)=>{let r=Mp(`inspector/field:${e}`,t)?.querySelector('[part="browse"]');return r?[r]:[]},pattern:/^inspector\/field:(.+)\/browse$/},{locate:([,e],t)=>{let o=Mp("inspector",t);return o?[...o.querySelectorAll(`[data-prop="${CSS.escape(e)}"]`)]:[]},pattern:/^inspector\/field:(.+)$/}];function ye(e,t){let o=he(e);if(!ve(o))return[];let r=[...X(t).querySelectorAll(`[data-jx-region="${CSS.escape(o)}"]`)];if(r.length>0)return r;for(let s of be){let i=o.match(s.pattern);if(i)return s.locate(i,X(t))}return[]}function Mp(e,t){return ye(e,t).at(-1)??null}var u$={dock:"dock.bottom",inspector:"inspector",navigator:"navigator",pane:"pane.primary",rail:"rail",status:"statusbar"};function wi(e,t){return t?`pane.${e}/${t}`:`pane.${e}`}function NA(e){return wi(e,"tabs")}function AA(e){return`navigator/panel:${e}`}function OA(e){return`inspector/tab:${e}`}var MA="navigator/statements";function PA(e){return`inspector/statements:${e}`}function ux(e){return`dock.bottom/panel:${e}`}var xe={dialog:"dialog",modal:"dialog",popover:"menu",toast:"toasts"};function ft(e,t){let o=xe[e];return t?`overlay.${o}:${t}`:`overlay.${o}`}var _=new Map,Z=1;function ee(e){let t=Z;return Z+=1,_.set(t,{...e,id:t}),t}function I(e){_.delete(e)}function oe(){return[..._.values()]}function RA(e){let t=e.toLowerCase();return oe().filter((o)=>o.elements.has(t))}function DA(e){return oe().filter((t)=>t.name===e)}var F=null;function d$(e=document){return F??=qA({document:e}),F}function re(){return F??d$()}var E="jx-studio:/surfaces/",M=new Map;function T(e,t){M.set(e,t),hC(Se(e),t)}function Se(e){return`${E}${e}.json`}function FA(e){return M.get(e)}function $e(e){if(!e.startsWith(E)||!e.endsWith(".json"))return;return M.get(e.slice(E.length,-5))}async function R(e,t,o,r={}){let s=M.get(e);if(!s)throw Error(`Studio surface "${e}" is not registered`);if(await re(),r.region)o.setAttribute(qe,r.region);let i={scope:t,base:E,resolver:$e};if(r.onNodeCreated)i.onNodeCreated=r.onNodeCreated;if(r.onNodeMoved)i.onNodeMoved=r.onNodeMoved;if(r.signal)i.signal=r.signal;let l=await HA(s,o,i),c=(a)=>({dispose:a,elements:l.elements,root:l.root,scope:l.scope});if(r.signal?.aborted)return c(l.dispose);let d=0,p=()=>{l.dispose(),I(d)};return d=ee({elements:l.elements,host:o,name:e,remount:async()=>{p(),await R(e,t,o,r)}}),r.signal?.addEventListener("abort",()=>I(d),{once:!0}),c(p)}var ie={$schema:"https://jxsuite.com/schema/v1",$id:"StudioDialog",$description:"Studio's confirm, save-or-discard and prompt dialogs: one jx-dialog whose body is projected from the adapter's scope. `message` is a sentence; `choice` is a `jx-select` over the options; `field` is the prompt's jx-textfield with its refusal. The four answers call the host's functions, and the host decides when the dialog closes.",tagName:"jx-dialog",$props:{headline:{$ref:"#/state/headline"},confirmLabel:{$ref:"#/state/confirmLabel"},secondaryLabel:{$ref:"#/state/secondaryLabel"},cancelLabel:{$ref:"#/state/cancelLabel"},destructive:{$ref:"#/state/destructive"},size:{$ref:"#/state/size"}},attributes:{headline:"${state.headline}","confirm-label":"${state.confirmLabel || null}","secondary-label":"${state.secondaryLabel || null}","cancel-label":"${state.cancelLabel || null}",part:"dialog-host"},onconfirm:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/confirm"},value:[]}]},onsecondary:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/secondary"},value:[]}]},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/cancel"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},style:{'& [part="message"]':{$description:"The one part of a dialog that is text rather than interface, so it opts back in to selection. The root sets `user-select: none` and `styles/tokens.json` restates it on every `dialog`, so the headline, the labels and the buttons around this sentence stay unselectable; a message is often the thing a reader copies into a search or a bug report.",margin:"0 0 var(--jx-space-3)",userSelect:"text"},'& [part="message"]:last-child':{margin:"0"},'& [part="island"] > p, & [part="island"] > span, & [part="island"] > strong, & [part="island"] > em, & [part="island"] > code':{$description:"The island's own prose is the message's other form — a body richer than a sentence, written straight into the island from a lit template (studio-ui-guidelines.md §9.4) — so it is selectable for the same reason `[part=\"message\"]` is. The opt-in stops at those children because the island is ALSO the mount point for a whole document: the Open Grid picker and Push Schema's plan put their surfaces here, and `user-select` inherits, so a rule on the island itself would hand selection to every heading, source row and button they draw, which is the interface the policy exists to keep unselectable. A mounted surface roots a `div`; a message writes paragraphs and text-level spans, so the two forms are told apart by the child that arrives.",userSelect:"text"},'& [part="island"]:empty':{display:"none"},'& [part="message-slot"], & [part="choice-slot"], & [part="field-slot"]':{display:"contents"},'& [part="choice-row"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-1)",margin:"0 0 var(--jx-space-3)"},'& [part="choice-label"]':{fontSize:"var(--jx-text-sm)",color:"var(--jx-fg-dim)"},"& jx-textfield":{width:"100%"}},children:[{tagName:"div",attributes:{part:"message-slot",role:"none"},$switch:{$ref:"#/state/hasMessage"},cases:{true:{tagName:"p",attributes:{part:"message"},textContent:"${state.message}"}}},{tagName:"div",attributes:{part:"island"}},{tagName:"div",attributes:{part:"choice-slot",role:"none"},$switch:{$ref:"#/state/hasChoice"},cases:{true:{tagName:"div",attributes:{part:"choice-row"},children:[{tagName:"span",attributes:{part:"choice-label"},textContent:"${state.choiceLabel}"},{tagName:"jx-select",$props:{label:{$ref:"#/state/choiceLabel"},options:{$ref:"#/state/options"},value:{$ref:"#/state/chosen"}},attributes:{part:"choice"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pick"},value:[{$ref:"event#/target/value"}]}]}}]}}},{tagName:"div",attributes:{part:"field-slot",role:"none"},$switch:{$ref:"#/state/hasField"},cases:{true:{tagName:"jx-textfield",$props:{label:{$ref:"#/state/headline"},value:{$ref:"#/state/value"},placeholder:{$ref:"#/state/placeholder"},invalid:{$ref:"#/state/invalid"},error:{$ref:"#/state/error"},multiline:{$ref:"#/state/multiline"},rows:{$ref:"#/state/rows"},mono:{$ref:"#/state/mono"}},attributes:{part:"field"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/input"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"#/state/singleLine"},cases:{true:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/confirm"},value:[]}]}}]}}]},$description:"The prompt's one field. `multiline` is what makes it a paste box rather than a line: an import the author copied out of a `_redirects` file is column-aligned, so it also asks for `mono`. A multiline field takes Enter as a newline, which is why the Enter-confirms handler below is guarded on it — a paste box whose second line submits the dialog cannot be typed into."}}}]};T("dialog",ie);function Jt(e){if(e.querySelector('[part="dialog"]'))return Promise.resolve(e);return new Promise((t)=>{e.addEventListener("jx-ready",function o(r){if(r.target!==e&&!e.querySelector('[part="dialog"]'))return;e.removeEventListener("jx-ready",o),t(e)})})}function Ys(e){let t=document.createElement("div");t.style.pointerEvents="auto",t.setAttribute(qe,ft("dialog",e.region)),e.layer.append(t);let o=g({cancel:()=>{e.onCancel()},cancelLabel:e.cancelLabel,choiceLabel:e.choice?.label??"",chosen:e.choice?.chosen??"",closed:()=>{e.onClosed()},confirm:()=>{e.onConfirm()},confirmLabel:e.confirmLabel,destructive:e.destructive===!0,error:"",hasChoice:e.choice!==void 0,hasField:e.field!==void 0,mono:e.field?.mono===!0,multiline:e.field?.multiline===!0,rows:e.field?.rows??"3",singleLine:e.field!==void 0&&e.field.multiline!==!0?"true":"false",hasMessage:e.message!==void 0&&e.message!=="",headline:e.headline,input:(a)=>{o.value=a,e.onInput?.(a)},invalid:!1,message:e.message??"",options:e.choice?.options??[],pick:(a)=>{e.onPick?.(a)},placeholder:e.field?.placeholder??"",secondary:()=>{e.onSecondary?.()},secondaryLabel:e.secondaryLabel??"",size:e.size??"sm",value:e.field?.value??""}),r=null,s=!1,i=()=>s,l=()=>{},c=new Promise((a)=>{l=a}),p=R("dialog",o,t).then(async(a)=>{let u=a.root;if(i())return a.dispose(),u;if(r=a,await Promise.race([Jt(u),c]),i())return u;if(e.island?.(u.querySelector('[part="island"]')??u),Mt(u),e.field){let x=u.querySelector("jx-textfield");if(x)setTimeout(()=>{if(!s)uh(x,e.field?.select??"all")},0)}return u});return{close(){if(s)return;s=!0,l();let a=r?.root;if(a instanceof HTMLElement)Nt(a);r?.dispose(),r=null,t.remove()},host:t,ready:p,update(a){if(a.confirmLabel!==void 0)o.confirmLabel=a.confirmLabel;if(a.cancelLabel!==void 0)o.cancelLabel=a.cancelLabel;if(a.secondaryLabel!==void 0)o.secondaryLabel=a.secondaryLabel;if(a.message!==void 0)o.message=a.message,o.hasMessage=a.message!=="";if(a.value!==void 0)o.value=a.value;if(a.placeholder!==void 0)o.placeholder=a.placeholder;if(a.invalid!==void 0)o.invalid=a.invalid;if(a.error!==void 0)if(a.error!==""&&a.error===o.error){o.error="";let u=a.error;queueMicrotask(()=>{o.error=u})}else o.error=a.error;if(a.options!==void 0)o.options=a.options;if(a.chosen!==void 0)o.chosen=a.chosen}}}var se={$schema:"https://jxsuite.com/schema/v1",$id:"StudioToasts",$description:"The toast stack: a rendering of the notification service's toasts, newest last. Each row is projected by ui/layers.ts with its severity glyph and, where a recovery command exists, that command's title and gate; the two buttons call back into the host, which owns the records and their timers.",tagName:"div",attributes:{part:"stack"},style:{position:"absolute",right:"var(--jx-space-4)",bottom:"36px",display:"flex",flexDirection:"column",gap:"var(--jx-space-3)",alignItems:"flex-end",maxWidth:"min(420px, calc(100vw - 24px))",'& [part="toast"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-3)",pointerEvents:"auto",padding:"var(--jx-space-3)",border:"1px solid var(--jx-border)",borderLeft:"3px solid var(--jx-fg-dim)",borderRadius:"var(--jx-radius-md)",background:"var(--jx-bg-panel)",color:"var(--jx-fg)",fontSize:"var(--jx-text-sm)",lineHeight:"var(--jx-leading-sm)",boxShadow:"var(--jx-shadow-popover)"},'& [part="toast"][data-severity="success"]':{borderLeftColor:"var(--jx-success)"},'& [part="toast"][data-severity="info"]':{borderLeftColor:"var(--jx-accent)"},'& [part="toast"][data-severity="warn"]':{borderLeftColor:"var(--jx-warning)"},'& [part="toast"][data-severity="error"]':{borderLeftColor:"var(--jx-danger)"},'& [part="icon"]':{flex:"none",width:"14px",textAlign:"center",fontWeight:"700"},'& [data-severity="success"] [part="icon"]':{color:"var(--jx-success)"},'& [data-severity="info"] [part="icon"]':{color:"var(--jx-accent)"},'& [data-severity="warn"] [part="icon"]':{color:"var(--jx-warning)"},'& [data-severity="error"] [part="icon"]':{color:"var(--jx-danger)"},'& [part="message"]':{flex:"1",minWidth:"0",overflow:"hidden",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"3"},'& [part="action-slot"]':{display:"contents"},'& [part="action"] > [part="control"]':{color:"var(--jx-accent)"}},children:[{$prototype:"Array",items:{$ref:"#/state/toasts"},key:{$ref:"$map/item/id"},map:{tagName:"div",attributes:{part:"toast","data-severity":"${$map.item.severity}"},children:[{tagName:"span",attributes:{part:"icon","aria-hidden":"true"},textContent:"${$map.item.icon}"},{tagName:"span",attributes:{part:"message"},textContent:"${$map.item.message}"},{tagName:"span",attributes:{part:"action-slot",role:"none"},$switch:{$ref:"$map/item/hasAction"},cases:{true:{tagName:"jx-button",$props:{size:"sm",quiet:!0,disabled:{$ref:"$map/item/actionDisabled"}},attributes:{part:"action",title:"${$map.item.actionTitle}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/runAction"},value:[{$ref:"$map/item/id"}]}]},children:[{tagName:"span",textContent:"${$map.item.actionLabel}"}]}}},{tagName:"jx-action-button",$props:{label:"Dismiss notification",hint:"Dismiss notification",icon:"x",size:"sm"},attributes:{part:"dismiss"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/dismissToast"},value:[{$ref:"$map/item/id"}]}]}}]}}]};function Te(e){return e instanceof RangeError||e instanceof Error&&e.name==="CommandUnavailableError"}function En(e,t,o,r=t){let s=(l)=>{if(!Te(l))console.error(`${r}: command "${t}" failed`,l);C.error(Q(l),{key:`command.run:${t}`,source:r})},i;try{i=e.run(t,o)}catch(l){return s(l),Promise.resolve()}return Promise.resolve(i).catch(s)}function rt(e,t,o){let r=ae();return r?En(r,e,t,o):Promise.resolve()}var de=null,z=null,J=null,j=null;function tt(e){return(e==="popover"?de:e==="modal"?z:e==="toast"?j:J)??document.body}function h$(){de=document.querySelector("#layer-popover"),z=document.querySelector("#layer-modal"),J=document.querySelector("#layer-dialog"),j=document.querySelector("#layer-toast"),Ne()}var le="jx-dialog[data-open], dialog[open]";function Bb(){return Boolean(J?.querySelector(le)||z?.querySelector(le))}function p$(){return document.querySelector(":popover-open")!==null}function Ko(e,t,o={}){let{confirmLabel:r="Confirm",cancelLabel:s="Cancel",destructive:i=!1}=o;return new Promise((l)=>{let c=!1,d=(a)=>{if(c)return;c=!0,p.close(),l(a)},p=Ys({cancelLabel:s,confirmLabel:r,destructive:i,headline:e,layer:tt("dialog"),...U(t),onCancel:()=>d(!1),onClosed:()=>d(!1),onConfirm:()=>d(!0)})})}function uC(e,t,o={}){let{saveLabel:r="Save",discardLabel:s="Discard",cancelLabel:i="Cancel"}=o;return new Promise((l)=>{let c=!1,d=(a)=>{if(c)return;c=!0,p.close(),l(a)},p=Ys({cancelLabel:i,confirmLabel:r,headline:e,layer:tt("dialog"),...U(t),onCancel:()=>d("cancel"),onClosed:()=>d("cancel"),onConfirm:()=>d("save"),onSecondary:()=>d("discard"),secondaryLabel:s})})}function U(e){if(n(e))return{message:e};return{island:(t)=>{no(e,t)}}}function xi(e,t={}){let{cancelLabel:o="Cancel",choice:r,confirmLabel:s="OK",message:i,mono:l=!1,multiline:c=!1,placeholder:d="",rows:p="3",select:a="all",size:u,validate:x,value:ue=""}=t,P=(v)=>x?x(v,L):v.trim()?"":"Enter a value.",h=ue,L=r?.initial??"",m="",V=!1,W=()=>te(d)?d():d,K=()=>r?r.options().map((v)=>({label:v.label,value:v.value})):[];return new Promise((v)=>{let B=!1,D=(f)=>{if(B)return;B=!0,k.close(),v(f)},Y=(f)=>{m=f,k.update({error:m,invalid:m!==""})},S={cancelLabel:o,confirmLabel:s,headline:e,layer:tt("dialog"),onCancel:()=>D(null),onClosed:()=>D(null),onConfirm:()=>{let f=P(h);if(f){Y(f);return}D(h.trim())},onInput:(f)=>{V=!0,h=f;let w=P(h);if(w!==m)Y(w)},onPick:(f)=>{L=f,r?.onChange?.(f);let w=P(h);m=V||m?w:"",k.update({chosen:L,error:m,invalid:m!=="",options:K(),placeholder:W()})}};if(i!==void 0)Object.assign(S,U(i));if(r)S.choice={chosen:L,label:r.label,options:K()};if(S.field={mono:l,multiline:c,placeholder:W(),rows:p,select:a,value:h},u!==void 0)S.size=u;let k=Ys(S)})}var N=new Map;function Zs(e,t){let o=`${e}:${t}`,r=N.get(o);if(r&&r.parentElement)return r;return r=document.createElement("div"),r.style.pointerEvents="auto",r.setAttribute(qe,ft(e,t)),tt(e).append(r),N.set(o,r),r}function zb(e,t){let o=`${e}:${t}`,r=N.get(o);if(r)no(mt,r),r.remove(),N.delete(o)}var we=180,Ee={error:"✕",info:"ℹ",success:"✓",warn:"!"},A=null,y=new Map,b=new Set;function Me(){if(!("matchMedia"in globalThis))return!1;return globalThis.matchMedia("(prefers-reduced-motion: reduce)").matches===!0}function Oe(){try{return new URLSearchParams(globalThis.location.search).get("automation")==="1"}catch{return!1}}function f$(){return[...b].map((e)=>`overlay: toast ${e} settling in`)}function q(e){let t=y.get(e);if(t!==void 0)clearTimeout(t),y.delete(e);b.delete(e),Lh(e)}function Ce(e){if(y.has(e.id)||b.has(e.id))return;let t=Me()?0:we;if(t>0)b.add(e.id),setTimeout(()=>b.delete(e.id),t);let o=e.timeoutMs??0;if(o<=0||Oe())return;y.set(e.id,setTimeout(()=>q(e.id),o))}T("toasts",se);var G=null,H=null,O=null;function ce(){return G??=g({dismissToast:(e)=>{q(e)},runAction:(e)=>{let t=Qd.find((r)=>r.id===e),o=ae();if(!t?.action||!o)return;q(e),En(o,t.action,t.actionArgs,"Notifications")},toasts:[]}),G}function je(e){let t=e.action===void 0?null:ae(),o=e.action,r=t&&o!==void 0?t.get(o):void 0,s=r&&o!==void 0&&t.isVisible(o)?r:null,i=s&&o!==void 0?t.disabledReason(o):void 0;return{actionDisabled:i!==void 0,actionLabel:s?.title??"",actionTitle:s===null?"":i===void 0?s.title:`${s.title} — requires ${i}`,hasAction:s!==null,icon:Ee[e.severity],id:e.id,message:e.message,severity:e.severity}}function Ne(){if(Ae(),!j)return;A=ge(),A.run(()=>{ne(()=>{Qd.length,ae();for(let e of Qd)Ce(e);ce().toasts=Qd.map((e)=>je(e))})}),H=R("toasts",ce(),j),H.then((e)=>{O=e})}function Ae(){A?.stop(),A=null;for(let t of y.values())clearTimeout(t);y.clear(),b.clear();let e=H;if(H=null,O)O.dispose(),O=null;else if(e)e.then((t)=>t.dispose());G=null}
2
- export{RA,DA,d$,qe,Mp,u$,wi,NA,AA,OA,MA,PA,ux,ft,T,FA,R,Jt,Ys,En,rt,tt,h$,Bb,p$,Ko,uC,xi,Zs,zb,f$};
1
+ import{mt,io}from"./studio-ajw4k8hp.js";import{WA,fC,Ot,Nt,dh,JA,ae}from"./studio-qs5fmhtj.js";import{ge,ne,g,Zd,C,Th}from"./studio-tfmhnwyr.js";import{te}from"./studio-psh8mwnw.js";import{n,Q}from"./studio-ywf9y1e2.js";var Ue="data-jx-region",fe=["rail","navigator","inspector","pane","dock.bottom","statusbar","commandbar","overlay"],pe=new Set(["dock.bottom"]);function me(e){let t=e.indexOf("/"),o=t===-1?e:e.slice(0,t),r=t===-1?void 0:e.slice(t+1);if(r===""||o==="")return null;let s=o,i;if(!pe.has(o)){let c=o.indexOf(".");if(c!==-1){if(s=o.slice(0,c),i=o.slice(c+1),i==="")return null}}let l=fe.find((c)=>c===s);if(l===void 0)return null;return i===void 0?r===void 0?{surface:l}:{part:r,surface:l}:r===void 0?{instance:i,surface:l}:{instance:i,part:r,surface:l}}function ve(e){return me(e)!==null}function he(e){if(e==="pane")return"pane.primary";return e.startsWith("pane/")?`pane.primary/${e.slice(5)}`:e}function X(e){return e??document}var be=[{locate:([,e],t)=>{let r=Op(`inspector/field:${e}`,t)?.querySelector('[part="browse"]');return r?[r]:[]},pattern:/^inspector\/field:(.+)\/browse$/},{locate:([,e],t)=>{let o=Op("inspector",t);return o?[...o.querySelectorAll(`[data-prop="${CSS.escape(e)}"]`)]:[]},pattern:/^inspector\/field:(.+)$/}];function ye(e,t){let o=he(e);if(!ve(o))return[];let r=[...X(t).querySelectorAll(`[data-jx-region="${CSS.escape(o)}"]`)];if(r.length>0)return r;for(let s of be){let i=o.match(s.pattern);if(i)return s.locate(i,X(t))}return[]}function Op(e,t){return ye(e,t).at(-1)??null}var p$={dock:"dock.bottom",inspector:"inspector",navigator:"navigator",pane:"pane.primary",rail:"rail",status:"statusbar"};function wi(e,t){return t?`pane.${e}/${t}`:`pane.${e}`}function MA(e){return wi(e,"tabs")}function PA(e){return`navigator/panel:${e}`}function FA(e){return`inspector/tab:${e}`}var jA="navigator/statements";function HA(e){return`inspector/statements:${e}`}function mx(e){return`dock.bottom/panel:${e}`}var xe={dialog:"dialog",modal:"dialog",popover:"menu",toast:"toasts"};function ft(e,t){let o=xe[e];return t?`overlay.${o}:${t}`:`overlay.${o}`}var _=new Map,Z=1;function ee(e){let t=Z;return Z+=1,_.set(t,{...e,id:t}),t}function I(e){_.delete(e)}function oe(){return[..._.values()]}function AA(e){let t=e.toLowerCase();return oe().filter((o)=>o.elements.has(t))}function OA(e){return oe().filter((t)=>t.name===e)}var F=null;function h$(e=document){return F??=JA({document:e}),F}function re(){return F??h$()}var E="jx-studio:/surfaces/",M=new Map;function T(e,t){M.set(e,t),fC(Se(e),t)}function Se(e){return`${E}${e}.json`}function BA(e){return M.get(e)}function $e(e){if(!e.startsWith(E)||!e.endsWith(".json"))return;return M.get(e.slice(E.length,-5))}async function R(e,t,o,r={}){let s=M.get(e);if(!s)throw Error(`Studio surface "${e}" is not registered`);if(await re(),r.region)o.setAttribute(Ue,r.region);let i={scope:t,base:E,resolver:$e};if(r.onNodeCreated)i.onNodeCreated=r.onNodeCreated;if(r.onNodeMoved)i.onNodeMoved=r.onNodeMoved;if(r.signal)i.signal=r.signal;let l=await WA(s,o,i),c=(a)=>({dispose:a,elements:l.elements,root:l.root,scope:l.scope});if(r.signal?.aborted)return c(l.dispose);let d=0,p=()=>{l.dispose(),I(d)};return d=ee({elements:l.elements,host:o,name:e,remount:async()=>{p(),await R(e,t,o,r)}}),r.signal?.addEventListener("abort",()=>I(d),{once:!0}),c(p)}var ie={$schema:"https://jxsuite.com/schema/v1",$id:"StudioDialog",$description:"Studio's confirm, save-or-discard and prompt dialogs: one jx-dialog whose body is projected from the adapter's scope. `message` is a sentence; `choice` is a `jx-select` over the options; `field` is the prompt's jx-textfield with its refusal. The four answers call the host's functions, and the host decides when the dialog closes.",tagName:"jx-dialog",$props:{headline:{$ref:"#/state/headline"},confirmLabel:{$ref:"#/state/confirmLabel"},secondaryLabel:{$ref:"#/state/secondaryLabel"},cancelLabel:{$ref:"#/state/cancelLabel"},destructive:{$ref:"#/state/destructive"},size:{$ref:"#/state/size"}},attributes:{headline:"${state.headline}","confirm-label":"${state.confirmLabel || null}","secondary-label":"${state.secondaryLabel || null}","cancel-label":"${state.cancelLabel || null}",part:"dialog-host"},onconfirm:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/confirm"},value:[]}]},onsecondary:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/secondary"},value:[]}]},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/cancel"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},style:{'& [part="message"]':{$description:"The one part of a dialog that is text rather than interface, so it opts back in to selection. The root sets `user-select: none` and `styles/tokens.json` restates it on every `dialog`, so the headline, the labels and the buttons around this sentence stay unselectable; a message is often the thing a reader copies into a search or a bug report.",margin:"0 0 var(--jx-space-3)",userSelect:"text"},'& [part="message"]:last-child':{margin:"0"},'& [part="island"] > p, & [part="island"] > span, & [part="island"] > strong, & [part="island"] > em, & [part="island"] > code':{$description:"The island's own prose is the message's other form — a body richer than a sentence, written straight into the island from a lit template (studio-ui-guidelines.md §9.4) — so it is selectable for the same reason `[part=\"message\"]` is. The opt-in stops at those children because the island is ALSO the mount point for a whole document: the Open Grid picker and Push Schema's plan put their surfaces here, and `user-select` inherits, so a rule on the island itself would hand selection to every heading, source row and button they draw, which is the interface the policy exists to keep unselectable. A mounted surface roots a `div`; a message writes paragraphs and text-level spans, so the two forms are told apart by the child that arrives.",userSelect:"text"},'& [part="island"]:empty':{display:"none"},'& [part="message-slot"], & [part="choice-slot"], & [part="field-slot"]':{display:"contents"},'& [part="choice-row"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-1)",margin:"0 0 var(--jx-space-3)"},'& [part="choice-label"]':{fontSize:"var(--jx-text-sm)",color:"var(--jx-fg-dim)"},"& jx-textfield":{width:"100%"}},children:[{tagName:"div",attributes:{part:"message-slot",role:"none"},$switch:{$ref:"#/state/hasMessage"},cases:{true:{tagName:"p",attributes:{part:"message"},textContent:"${state.message}"}}},{tagName:"div",attributes:{part:"island"}},{tagName:"div",attributes:{part:"choice-slot",role:"none"},$switch:{$ref:"#/state/hasChoice"},cases:{true:{tagName:"div",attributes:{part:"choice-row"},children:[{tagName:"span",attributes:{part:"choice-label"},textContent:"${state.choiceLabel}"},{tagName:"jx-select",$props:{label:{$ref:"#/state/choiceLabel"},options:{$ref:"#/state/options"},value:{$ref:"#/state/chosen"}},attributes:{part:"choice"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pick"},value:[{$ref:"event#/target/value"}]}]}}]}}},{tagName:"div",attributes:{part:"field-slot",role:"none"},$switch:{$ref:"#/state/hasField"},cases:{true:{tagName:"jx-textfield",$props:{label:{$ref:"#/state/headline"},value:{$ref:"#/state/value"},placeholder:{$ref:"#/state/placeholder"},invalid:{$ref:"#/state/invalid"},error:{$ref:"#/state/error"},multiline:{$ref:"#/state/multiline"},rows:{$ref:"#/state/rows"},mono:{$ref:"#/state/mono"}},attributes:{part:"field"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/input"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"#/state/singleLine"},cases:{true:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/confirm"},value:[]}]}}]}}]},$description:"The prompt's one field. `multiline` is what makes it a paste box rather than a line: an import the author copied out of a `_redirects` file is column-aligned, so it also asks for `mono`. A multiline field takes Enter as a newline, which is why the Enter-confirms handler below is guarded on it — a paste box whose second line submits the dialog cannot be typed into."}}}]};T("dialog",ie);function Jt(e){if(e.querySelector('[part="dialog"]'))return Promise.resolve(e);return new Promise((t)=>{e.addEventListener("jx-ready",function o(r){if(r.target!==e&&!e.querySelector('[part="dialog"]'))return;e.removeEventListener("jx-ready",o),t(e)})})}function Ys(e){let t=document.createElement("div");t.style.pointerEvents="auto",t.setAttribute(Ue,ft("dialog",e.region)),e.layer.append(t);let o=g({cancel:()=>{e.onCancel()},cancelLabel:e.cancelLabel,choiceLabel:e.choice?.label??"",chosen:e.choice?.chosen??"",closed:()=>{e.onClosed()},confirm:()=>{e.onConfirm()},confirmLabel:e.confirmLabel,destructive:e.destructive===!0,error:"",hasChoice:e.choice!==void 0,hasField:e.field!==void 0,mono:e.field?.mono===!0,multiline:e.field?.multiline===!0,rows:e.field?.rows??"3",singleLine:e.field!==void 0&&e.field.multiline!==!0?"true":"false",hasMessage:e.message!==void 0&&e.message!=="",headline:e.headline,input:(a)=>{o.value=a,e.onInput?.(a)},invalid:!1,message:e.message??"",options:e.choice?.options??[],pick:(a)=>{e.onPick?.(a)},placeholder:e.field?.placeholder??"",secondary:()=>{e.onSecondary?.()},secondaryLabel:e.secondaryLabel??"",size:e.size??"sm",value:e.field?.value??""}),r=null,s=!1,i=()=>s,l=()=>{},c=new Promise((a)=>{l=a}),p=R("dialog",o,t).then(async(a)=>{let u=a.root;if(i())return a.dispose(),u;if(r=a,await Promise.race([Jt(u),c]),i())return u;if(e.island?.(u.querySelector('[part="island"]')??u),Ot(u),e.field){let x=u.querySelector("jx-textfield");if(x)setTimeout(()=>{if(!s)dh(x,e.field?.select??"all")},0)}return u});return{close(){if(s)return;s=!0,l();let a=r?.root;if(a instanceof HTMLElement)Nt(a);r?.dispose(),r=null,t.remove()},host:t,ready:p,update(a){if(a.confirmLabel!==void 0)o.confirmLabel=a.confirmLabel;if(a.cancelLabel!==void 0)o.cancelLabel=a.cancelLabel;if(a.secondaryLabel!==void 0)o.secondaryLabel=a.secondaryLabel;if(a.message!==void 0)o.message=a.message,o.hasMessage=a.message!=="";if(a.value!==void 0)o.value=a.value;if(a.placeholder!==void 0)o.placeholder=a.placeholder;if(a.invalid!==void 0)o.invalid=a.invalid;if(a.error!==void 0)if(a.error!==""&&a.error===o.error){o.error="";let u=a.error;queueMicrotask(()=>{o.error=u})}else o.error=a.error;if(a.options!==void 0)o.options=a.options;if(a.chosen!==void 0)o.chosen=a.chosen}}}var se={$schema:"https://jxsuite.com/schema/v1",$id:"StudioToasts",$description:"The toast stack: a rendering of the notification service's toasts, newest last. Each row is projected by ui/layers.ts with its severity glyph and, where a recovery command exists, that command's title and gate; the two buttons call back into the host, which owns the records and their timers.",tagName:"div",attributes:{part:"stack"},style:{position:"absolute",right:"var(--jx-space-4)",bottom:"36px",display:"flex",flexDirection:"column",gap:"var(--jx-space-3)",alignItems:"flex-end",maxWidth:"min(420px, calc(100vw - 24px))",'& [part="toast"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-3)",pointerEvents:"auto",padding:"var(--jx-space-3)",border:"1px solid var(--jx-border)",borderLeft:"3px solid var(--jx-fg-dim)",borderRadius:"var(--jx-radius-md)",background:"var(--jx-bg-panel)",color:"var(--jx-fg)",fontSize:"var(--jx-text-sm)",lineHeight:"var(--jx-leading-sm)",boxShadow:"var(--jx-shadow-popover)"},'& [part="toast"][data-severity="success"]':{borderLeftColor:"var(--jx-success)"},'& [part="toast"][data-severity="info"]':{borderLeftColor:"var(--jx-accent)"},'& [part="toast"][data-severity="warn"]':{borderLeftColor:"var(--jx-warning)"},'& [part="toast"][data-severity="error"]':{borderLeftColor:"var(--jx-danger)"},'& [part="icon"]':{flex:"none",width:"14px",textAlign:"center",fontWeight:"700"},'& [data-severity="success"] [part="icon"]':{color:"var(--jx-success)"},'& [data-severity="info"] [part="icon"]':{color:"var(--jx-accent)"},'& [data-severity="warn"] [part="icon"]':{color:"var(--jx-warning)"},'& [data-severity="error"] [part="icon"]':{color:"var(--jx-danger)"},'& [part="message"]':{flex:"1",minWidth:"0",overflow:"hidden",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"3"},'& [part="action-slot"]':{display:"contents"},'& [part="action"] > [part="control"]':{color:"var(--jx-accent)"}},children:[{$prototype:"Array",items:{$ref:"#/state/toasts"},key:{$ref:"$map/item/id"},map:{tagName:"div",attributes:{part:"toast","data-severity":"${$map.item.severity}"},children:[{tagName:"span",attributes:{part:"icon","aria-hidden":"true"},textContent:"${$map.item.icon}"},{tagName:"span",attributes:{part:"message"},textContent:"${$map.item.message}"},{tagName:"span",attributes:{part:"action-slot",role:"none"},$switch:{$ref:"$map/item/hasAction"},cases:{true:{tagName:"jx-button",$props:{size:"sm",quiet:!0,disabled:{$ref:"$map/item/actionDisabled"}},attributes:{part:"action",title:"${$map.item.actionTitle}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/runAction"},value:[{$ref:"$map/item/id"}]}]},children:[{tagName:"span",textContent:"${$map.item.actionLabel}"}]}}},{tagName:"jx-action-button",$props:{label:"Dismiss notification",hint:"Dismiss notification",icon:"x",size:"sm"},attributes:{part:"dismiss"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/dismissToast"},value:[{$ref:"$map/item/id"}]}]}}]}}]};function Te(e){return e instanceof RangeError||e instanceof Error&&e.name==="CommandUnavailableError"}function En(e,t,o,r=t){let s=(l)=>{if(!Te(l))console.error(`${r}: command "${t}" failed`,l);C.error(te(l),{key:`command.run:${t}`,source:r})},i;try{i=e.run(t,o)}catch(l){return s(l),Promise.resolve()}return Promise.resolve(i).catch(s)}function rt(e,t,o){let r=ae();return r?En(r,e,t,o):Promise.resolve()}var de=null,z=null,J=null,j=null;function tt(e){return(e==="popover"?de:e==="modal"?z:e==="toast"?j:J)??document.body}function f$(){de=document.querySelector("#layer-popover"),z=document.querySelector("#layer-modal"),J=document.querySelector("#layer-dialog"),j=document.querySelector("#layer-toast"),Ne()}var le="jx-dialog[data-open], dialog[open]";function Ub(){return Boolean(J?.querySelector(le)||z?.querySelector(le))}function m$(){return document.querySelector(":popover-open")!==null}function qo(e,t,o={}){let{confirmLabel:r="Confirm",cancelLabel:s="Cancel",destructive:i=!1}=o;return new Promise((l)=>{let c=!1,d=(a)=>{if(c)return;c=!0,p.close(),l(a)},p=Ys({cancelLabel:s,confirmLabel:r,destructive:i,headline:e,layer:tt("dialog"),...U(t),onCancel:()=>d(!1),onClosed:()=>d(!1),onConfirm:()=>d(!0)})})}function pC(e,t,o={}){let{saveLabel:r="Save",discardLabel:s="Discard",cancelLabel:i="Cancel"}=o;return new Promise((l)=>{let c=!1,d=(a)=>{if(c)return;c=!0,p.close(),l(a)},p=Ys({cancelLabel:i,confirmLabel:r,headline:e,layer:tt("dialog"),...U(t),onCancel:()=>d("cancel"),onClosed:()=>d("cancel"),onConfirm:()=>d("save"),onSecondary:()=>d("discard"),secondaryLabel:s})})}function U(e){if(n(e))return{message:e};return{island:(t)=>{io(e,t)}}}function xi(e,t={}){let{cancelLabel:o="Cancel",choice:r,confirmLabel:s="OK",message:i,mono:l=!1,multiline:c=!1,placeholder:d="",rows:p="3",select:a="all",size:u,validate:x,value:ue=""}=t,P=(v)=>x?x(v,L):v.trim()?"":"Enter a value.",h=ue,L=r?.initial??"",m="",V=!1,W=()=>Q(d)?d():d,K=()=>r?r.options().map((v)=>({label:v.label,value:v.value})):[];return new Promise((v)=>{let B=!1,D=(f)=>{if(B)return;B=!0,k.close(),v(f)},Y=(f)=>{m=f,k.update({error:m,invalid:m!==""})},S={cancelLabel:o,confirmLabel:s,headline:e,layer:tt("dialog"),onCancel:()=>D(null),onClosed:()=>D(null),onConfirm:()=>{let f=P(h);if(f){Y(f);return}D(h.trim())},onInput:(f)=>{V=!0,h=f;let w=P(h);if(w!==m)Y(w)},onPick:(f)=>{L=f,r?.onChange?.(f);let w=P(h);m=V||m?w:"",k.update({chosen:L,error:m,invalid:m!=="",options:K(),placeholder:W()})}};if(i!==void 0)Object.assign(S,U(i));if(r)S.choice={chosen:L,label:r.label,options:K()};if(S.field={mono:l,multiline:c,placeholder:W(),rows:p,select:a,value:h},u!==void 0)S.size=u;let k=Ys(S)})}var N=new Map;function Zs(e,t){let o=`${e}:${t}`,r=N.get(o);if(r&&r.parentElement)return r;return r=document.createElement("div"),r.style.pointerEvents="auto",r.setAttribute(Ue,ft(e,t)),tt(e).append(r),N.set(o,r),r}function qb(e,t){let o=`${e}:${t}`,r=N.get(o);if(r)io(mt,r),r.remove(),N.delete(o)}var we=180,Ee={error:"✕",info:"ℹ",success:"✓",warn:"!"},A=null,y=new Map,b=new Set;function Me(){if(!("matchMedia"in globalThis))return!1;return globalThis.matchMedia("(prefers-reduced-motion: reduce)").matches===!0}function Oe(){try{return new URLSearchParams(globalThis.location.search).get("automation")==="1"}catch{return!1}}function g$(){return[...b].map((e)=>`overlay: toast ${e} settling in`)}function q(e){let t=y.get(e);if(t!==void 0)clearTimeout(t),y.delete(e);b.delete(e),Th(e)}function Ce(e){if(y.has(e.id)||b.has(e.id))return;let t=Me()?0:we;if(t>0)b.add(e.id),setTimeout(()=>b.delete(e.id),t);let o=e.timeoutMs??0;if(o<=0||Oe())return;y.set(e.id,setTimeout(()=>q(e.id),o))}T("toasts",se);var G=null,H=null,O=null;function ce(){return G??=g({dismissToast:(e)=>{q(e)},runAction:(e)=>{let t=Zd.find((r)=>r.id===e),o=ae();if(!t?.action||!o)return;q(e),En(o,t.action,t.actionArgs,"Notifications")},toasts:[]}),G}function je(e){let t=e.action===void 0?null:ae(),o=e.action,r=t&&o!==void 0?t.get(o):void 0,s=r&&o!==void 0&&t.isVisible(o)?r:null,i=s&&o!==void 0?t.disabledReason(o):void 0;return{actionDisabled:i!==void 0,actionLabel:s?.title??"",actionTitle:s===null?"":i===void 0?s.title:`${s.title} — requires ${i}`,hasAction:s!==null,icon:Ee[e.severity],id:e.id,message:e.message,severity:e.severity}}function Ne(){if(Ae(),!j)return;A=ge(),A.run(()=>{ne(()=>{Zd.length,ae();for(let e of Zd)Ce(e);ce().toasts=Zd.map((e)=>je(e))})}),H=R("toasts",ce(),j),H.then((e)=>{O=e})}function Ae(){A?.stop(),A=null;for(let t of y.values())clearTimeout(t);y.clear(),b.clear();let e=H;if(H=null,O)O.dispose(),O=null;else if(e)e.then((t)=>t.dispose());G=null}
2
+ export{AA,OA,h$,Ue,Op,p$,wi,MA,PA,FA,jA,HA,mx,ft,T,BA,R,Jt,Ys,En,rt,tt,f$,Ub,m$,qo,pC,xi,Zs,qb,g$};
3
3
 
4
- //# debugId=F711815A92DC732064756E2164756E21
5
- //# sourceMappingURL=studio-02phtmqn.js.map
4
+ //# debugId=5C519E11B5D939E964756E2164756E21
5
+ //# sourceMappingURL=studio-myb4mf0h.js.map
@@ -1,5 +1,5 @@
1
- import{yh}from"./studio-y1x65h5r.js";import{fb}from"./studio-2dtc90zs.js";import{S}from"./studio-ana67wax.js";import{n,_}from"./studio-kt2j51sa.js";function VE(){return Object.keys(S?.projectConfig?.content??{})}function ya(e){let t=fb(e);if(!t)return null;if(/\.[a-z\d]+$/i.test(t.dir))return null;return{def:t.def,dir:t.dir,ext:t.ext,name:t.name,schema:t.def.schema??null}}function pw(){return VE().map((e)=>ya(e)).filter((e)=>e!==null)}function Rc(e){let t=yh(e??null,S?.projectConfig);return t?ya(t.name):null}function OD(e){let t=yh(e??null,S?.projectConfig),r=t?fb(t.name):null;if(!t||!r)return null;return{def:r.def,dir:r.dir,ext:r.ext,name:r.name,schema:t.schema}}function c(e){if(e===null||!_(e))return e;return JSON.parse(JSON.stringify(e))}function u(e){if(n(e.$ref))return"";switch(e.type){case"boolean":return!1;case"integer":case"number":return 0;case"array":return[];case"object":return UE(e);default:return""}}function UE(e){let t=e?.properties;if(!t)return{};let r=new Set(Array.isArray(e.required)?e.required:[]),o={};for(let[i,l]of Object.entries(t))if(l.default!==void 0)o[i]=c(l.default);else if(r.has(i))o[i]=u(l);return o}function MD(e,t){return(Array.isArray(e?.required)?e.required:[]).filter((o)=>t[o]===void 0)}
2
- export{VE,ya,pw,Rc,OD,UE,MD};
1
+ import{bh}from"./studio-ztppbam0.js";import{fb}from"./studio-fg4fj9ec.js";import{S}from"./studio-9ra9e7m4.js";import{n,_}from"./studio-ywf9y1e2.js";function qE(){return Object.keys(S?.projectConfig?.content??{})}function ya(e){let t=fb(e);if(!t)return null;if(/\.[a-z\d]+$/i.test(t.dir))return null;return{def:t.def,dir:t.dir,ext:t.ext,name:t.name,schema:t.def.schema??null}}function bw(){return qE().map((e)=>ya(e)).filter((e)=>e!==null)}function Ic(e){let t=bh(e??null,S?.projectConfig);return t?ya(t.name):null}function FD(e){let t=bh(e??null,S?.projectConfig),r=t?fb(t.name):null;if(!t||!r)return null;return{def:r.def,dir:r.dir,ext:r.ext,name:r.name,schema:t.schema}}function c(e){if(e===null||!_(e))return e;return JSON.parse(JSON.stringify(e))}function u(e){if(n(e.$ref))return"";switch(e.type){case"boolean":return!1;case"integer":case"number":return 0;case"array":return[];case"object":return GE(e);default:return""}}function GE(e){let t=e?.properties;if(!t)return{};let r=new Set(Array.isArray(e.required)?e.required:[]),o={};for(let[i,l]of Object.entries(t))if(l.default!==void 0)o[i]=c(l.default);else if(r.has(i))o[i]=u(l);return o}function jD(e,t){return(Array.isArray(e?.required)?e.required:[]).filter((o)=>t[o]===void 0)}
2
+ export{qE,ya,bw,Ic,FD,GE,jD};
3
3
 
4
- //# debugId=1BB137D4B38DC27164756E2164756E21
5
- //# sourceMappingURL=studio-d140sy8e.js.map
4
+ //# debugId=76BF7B88C8AA6E1164756E2164756E21
5
+ //# sourceMappingURL=studio-n4qq1n57.js.map