@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,4 @@
1
+ import{Cy,ba,e_,rs,t_,ss}from"./studio-h4jbgne2.js";import{Se}from"./studio-nfwacw31.js";import{n,Z,v}from"./studio-ywf9y1e2.js";var HI="meta",BI="frontmatter",zI="structure",WI="source",VI=2;function m(e){return v(e)}function wu(e){return e.getMap(HI)}function UI(e){return e.getMap(BI)}function Og(e){return e.getMap(zI)}function qI(e){return e.getText(WI)}var Y=new Set(["textContent"]),h=new Set(["style","attributes","$props"]);function y(e,t){let o=e.toString();if(o===t)return!1;let r=0,s=Math.min(o.length,t.length);while(r<s&&o[r]===t[r])r+=1;let a=o.length,i=t.length;while(a>r&&i>r&&o[a-1]===t[i-1])a-=1,i-=1;if(a>r)e.delete(r,a-r);if(i>r)e.insert(r,t.slice(r,i));return!0}function f(e){let t=new rs;for(let[o,r]of Object.entries(e)){if(r===void 0)continue;t.set(o,m(r)?f(r):Se(r))}return t}function g(e,t){for(let o of[...e.keys()])if(!(o in t)||t[o]===void 0)e.delete(o);for(let[o,r]of Object.entries(t)){if(r===void 0)continue;let s=e.get(o);if(m(r))if(s instanceof rs)g(s,r);else e.set(o,f(r));else if(!b(s,r))e.set(o,Se(r))}}function b(e,t){if(e===t)return!0;if(e instanceof rs||e instanceof ba||e instanceof ss)return!1;return JSON.stringify(e??null)===JSON.stringify(t??null)}function d(e){return n(e)?new ss(e):GI(e)}function Vf(e){let t=new ba;return t.insert(0,e.map((o)=>d(o))),t}function GI(e){if(!m(e))throw TypeError("collab-schema: a document node must be a plain object");let t=new rs;for(let[o,r]of Object.entries(e)){if(r===void 0)continue;if(o==="children"&&Array.isArray(r))t.set(o,Vf(r));else if(Y.has(o)&&n(r))t.set(o,new ss(r));else if(h.has(o)&&m(r))t.set(o,f(r));else t.set(o,Se(r))}return t}function S(e){return Object.fromEntries(Array.from(e.entries(),([t,o])=>[t,Uf(o)]))}function E(e){if(n(e))return e;return e instanceof ss?e.toString():S(e)}function Uf(e){if(e instanceof rs)return S(e);if(e instanceof ba)return e.toArray().map((t)=>Uf(t));if(e instanceof ss)return e.toString();return e}function d2(e){return S(Og(e))}function X0(e,t){let o=Og(e);for(let r of t)if(o instanceof rs)o=o.get(String(r));else if(o instanceof ba){let s=Number(r);if(!Number.isInteger(s)||s<0||s>=o.length)return;o=o.get(s)}else return;return o}function ck(e,t,o){let r=qI(e);if(r.toString()===t)return!1;return e.transact(()=>{y(r,t)},o),!0}function u2(e,t,o={}){let r=wu(e);if(r.get("structureSeeded")===!0)return!1;return e.transact(()=>{let s=Og(e);for(let[i,c]of Object.entries(t)){if(c===void 0)continue;if(i==="children"&&Array.isArray(c))s.set(i,Vf(c));else s.set(i,Se(c))}let a=UI(e);for(let[i,c]of Object.entries(o.frontmatter??{}))if(c!==void 0)a.set(i,Se(c));r.set("schemaVersion",VI),r.set("canonical","structure"),r.set("canonicalRev",0),r.set("sourceFormat",o.sourceFormat??null),r.set("structureSeeded",!0)},o.origin),!0}var h2="jx-local",p2="jx-mirror",f2="jx-seed";class xu extends Error{constructor(e){super(`collab-path-unresolved:${e.join("/")}`);this.name="CollabPathError"}}function O(e,t){let o=X0(e,t);if(!(o instanceof rs))throw new xu(t);return o}function p(e,t,o){let r=O(e,t),s=r.get("children");if(s instanceof ba)return s;if(o&&s===void 0){let a=new ba;return r.set("children",a),a}throw new xu([...t,"children"])}function J(e,t,o){let r=e.get(t);if(t==="children"&&Array.isArray(o)){e.set(t,Vf(o));return}if(Y.has(t)&&n(o)){if(r instanceof ss)y(r,o);else e.set(t,new ss(o));return}if(h.has(t)&&v(o)){if(r instanceof rs)g(r,o);else e.set(t,f(o));return}e.set(t,Se(o))}function V(e,t){let{op:o}=t;switch(t.op){case"set-key":{let r=O(e,t.path);if(t.value===void 0)r.delete(t.key);else J(r,t.key,t.value);return}case"insert-child":{let r=p(e,t.parentPath,!0);if(t.index<0||t.index>r.length)throw new xu([...t.parentPath,"children",t.index]);r.insert(t.index,[d(t.node)]);return}case"remove-child":{let r=p(e,t.parentPath,!1);if(t.index<0||t.index>=r.length)throw new xu([...t.parentPath,"children",t.index]);r.delete(t.index,1);return}case"set-child":{let r=p(e,t.parentPath,!1);if(t.index<0||t.index>=r.length)throw new xu([...t.parentPath,"children",t.index]);let s=r.get(t.index);if(s instanceof ss&&n(t.node)){y(s,t.node);return}r.delete(t.index,1),r.insert(t.index,[d(t.node)]);return}case"move-child":{let r=p(e,t.fromParentPath,!1),s=p(e,t.toParentPath,!0);if(t.fromIndex<0||t.fromIndex>=r.length)throw new xu([...t.fromParentPath,"children",t.fromIndex]);let a=Uf(r.get(t.fromIndex));if(r.delete(t.fromIndex,1),t.toIndex<0||t.toIndex>s.length)throw new xu([...t.toParentPath,"children",t.toIndex]);s.insert(t.toIndex,[d(a)]);return}default:throw Error(`unknown-doc-op:${o}`)}}function m2(e,t,o){e.transact(()=>{for(let r of t)V(e,r)},o)}function w(e){for(let t=0;t<e.length;t++){let o=e[t];if(!n(o))continue;if(h.has(o))return{key:o,nodePath:e.slice(0,t)};if(Y.has(o))return{key:o,nodePath:e.slice(0,t)}}return null}function P(e){return e instanceof ss||e instanceof rs||n(e)}function C(e){return e.every((t)=>n(t)||Z(t))}function g2(e){if(e.length===0)return[];let t=e.map((s)=>s.path);if(!t.every((s)=>C(s)))return null;for(let s=0;s<t.length;s++)for(let a=0;a<t.length;a++){if(s===a)continue;let i=t[s],c=t[a];if(i.length<=c.length&&i.every((u,l)=>u===c[l]))return null}if(e.filter((s)=>s instanceof Cy).length>1)return null;let r=[];for(let s of e){let{path:a}=s,i=w(a);if(i){let{doc:c}=s.target;if(!c)return null;let u=X0(c,[...i.nodePath,i.key]);if(u===void 0)return null;r.push({key:i.key,op:"set-key",path:i.nodePath,value:Uf(u)});continue}if(s instanceof t_){let c=a.at(-1);if(a.at(-2)==="children"&&Z(c)){r.push({index:c,node:s.target.toString(),op:"set-child",parentPath:a.slice(0,-2)});continue}return null}if(s instanceof e_){let c=s.target;for(let[u,l]of s.changes.keys)if(l.action==="delete")r.push({key:u,op:"set-key",path:a});else r.push({key:u,op:"set-key",path:a,value:Uf(c.get(u))})}else if(s instanceof Cy){if(a.at(-1)!=="children")return null;let c=a.slice(0,-1),u=0;for(let l of s.changes.delta)if(l.retain!==void 0)u+=l.retain;else if(l.delete!==void 0)for(let x=0;x<l.delete;x++)r.push({index:u,op:"remove-child",parentPath:c});else if(l.insert!==void 0){let x=Array.isArray(l.insert)?l.insert:[l.insert];for(let D of x){if(!P(D))return null;r.push({index:u,node:E(D),op:"insert-child",parentPath:c}),u+=1}}}else return null}return r}function b2(e,t,o){e.transact(()=>{let r=Og(e),s=[...r.keys()];for(let i of s)if(!(i in t)||t[i]===void 0)r.delete(i);for(let[i,c]of Object.entries(t)){if(c===void 0)continue;if(i==="children"&&Array.isArray(c))r.set(i,Vf(c));else r.set(i,Se(c))}let a=wu(e);a.set("canonicalRev",Number(a.get("canonicalRev")??0)+1)},o)}function dk(e){return wu(e).get("canonical")==="source"?"source":"structure"}function uk(e){return Number(wu(e).get("canonicalRev")??0)}function v2(e,t,o){if(dk(e)==="source")return!1;return e.transact(()=>{ck(e,t,o);let r=wu(e);r.set("canonical","source"),r.set("canonicalRev",uk(e)+1)},o),!0}function y2(e,t){if(dk(e)!=="source")return!1;return e.transact(()=>{let o=wu(e);o.set("canonical","structure"),o.set("canonicalRev",uk(e)+1)},t),!0}function w2(e,t,o){let r=[];for(let[s,a]of e.getStates()){let i=a;if(s!==o&&i.mode==="source"&&i.focusedPath===t)r.push(s)}return r}function x2(e,t){let o=e.clientID,r=e.getStates().get(o);if(r?.mode!=="source"||r.focusedPath!==t)return!1;let s=o;for(let[a,i]of e.getStates()){let c=i;if(c.mode==="source"&&c.focusedPath===t&&c.canWrite!==!1&&a<s)s=a}return s===o}var hk=["#4f9cf9","#e5484d","#30a46c","#f5a524","#8e4ec6","#00a2c7","#e93d82","#a8845c"];function _2(e){let t=5381;for(let r=0;r<e.length;r++)t=Math.imul(t,33)+(e.codePointAt(r)??0);let o=Math.abs(t)%hk.length;return hk[o]}export{HI,BI,zI,WI,VI,wu,UI,Og,qI,Vf,GI,Uf,d2,X0,ck,u2,h2,p2,f2,xu,m2,g2,b2,dk,uk,v2,y2,w2,x2,hk,_2};
2
+
3
+ //# debugId=20065791D853C43464756E2164756E21
4
+ //# sourceMappingURL=studio-3hpcawh8.js.map
@@ -1,5 +1,5 @@
1
- import{n,_}from"./studio-kt2j51sa.js";var w=["order","widths","hidden","sort","groupBy","filter"],g="jx-grid-layout:";function c(){try{return typeof localStorage>"u"?null:localStorage}catch{return null}}function u(e){let t=c()?.getItem(g+e);if(!t)return null;try{let r=JSON.parse(t);return _(r)?r:null}catch{return null}}function f(e,t){c()?.setItem(g+e,JSON.stringify(t))}function a(e){let t={};for(let r of w)if(e[r]!==void 0)Object.assign(t,{[r]:e[r]});return t}function v(e){return JSON.stringify(w.map((t)=>e[t]??null))}function Cd(e){let t=u(e);return t?a(t):null}function em(e,t){if(!c())return;let o=u(e)??{},s={...o,widths:{...o.widths,...t.widths}};for(let i of w)if(i!=="widths"&&t[i]!==void 0)Object.assign(s,{[i]:t[i]});f(e,s)}function zk(e){let t=u(e);if(!t)return;let r={active:null};if(t.views)r.views=t.views;f(e,r)}function Du(e){let t=u(e)?.views;return Array.isArray(t)?t.filter((r)=>G(r)):[]}function G(e){return _(e)&&"name"in e&&n(e.name)}function E_(e){return u(e)?.active??null}function FR(e){let t=u(e),r=t?.active;if(!t||!r)return!1;let o=Du(e).find((s)=>s.name===r);return o?v(a(o))!==v(a(t)):!1}function jR(e,t){let r=t.trim(),o=c();if(r===""||!o)return null;let s=u(e)??{},i={name:r,...a(s)},d=Du(e).filter((l)=>l.name!==r);return d.push(i),f(e,{...s,active:r,views:d}),i}function Fy(e,t){let r=Du(e).find((i)=>i.name===t);if(!r||!c())return null;let o=u(e)??{},s=a(r);return f(e,{active:r.name,views:o.views??[],...s}),s}function Wk(e,t){let r=u(e);if(!r||!c())return!1;let o=Du(e),s=o.filter((i)=>i.name!==t);if(s.length===o.length)return!1;return f(e,{...r,active:r.active===t?null:r.active??null,views:s}),!0}function HR(e,t){if(!t)return e;let r=new Set(t.hidden),o=[];for(let i of e){if(i.field!==void 0&&r.has(i.field))continue;let d=i.field?t.widths?.[i.field]:void 0;o.push(d?{...i,width:d}:i)}if(!t.order?.length)return o;let s=new Map(t.order.map((i,d)=>[i,d]));return o.map((i,d)=>({def:i,index:d})).toSorted((i,d)=>{let l=s.get(i.def.field??"")??t.order.length+i.index,p=s.get(d.def.field??"")??t.order.length+d.index;return l-p}).map(({def:i})=>i)}
2
- export{Cd,em,zk,Du,E_,FR,jR,Fy,Wk,HR};
1
+ import{n,_}from"./studio-ywf9y1e2.js";var w=["order","widths","hidden","sort","groupBy","filter"],g="jx-grid-layout:";function c(){try{return typeof localStorage>"u"?null:localStorage}catch{return null}}function u(e){let t=c()?.getItem(g+e);if(!t)return null;try{let r=JSON.parse(t);return _(r)?r:null}catch{return null}}function f(e,t){c()?.setItem(g+e,JSON.stringify(t))}function a(e){let t={};for(let r of w)if(e[r]!==void 0)Object.assign(t,{[r]:e[r]});return t}function v(e){return JSON.stringify(w.map((t)=>e[t]??null))}function _d(e){let t=u(e);return t?a(t):null}function im(e,t){if(!c())return;let o=u(e)??{},s={...o,widths:{...o.widths,...t.widths}};for(let i of w)if(i!=="widths"&&t[i]!==void 0)Object.assign(s,{[i]:t[i]});f(e,s)}function Vk(e){let t=u(e);if(!t)return;let r={active:null};if(t.views)r.views=t.views;f(e,r)}function Ru(e){let t=u(e)?.views;return Array.isArray(t)?t.filter((r)=>G(r)):[]}function G(e){return _(e)&&"name"in e&&n(e.name)}function L_(e){return u(e)?.active??null}function BR(e){let t=u(e),r=t?.active;if(!t||!r)return!1;let o=Ru(e).find((s)=>s.name===r);return o?v(a(o))!==v(a(t)):!1}function zR(e,t){let r=t.trim(),o=c();if(r===""||!o)return null;let s=u(e)??{},i={name:r,...a(s)},d=Ru(e).filter((l)=>l.name!==r);return d.push(i),f(e,{...s,active:r,views:d}),i}function zy(e,t){let r=Ru(e).find((i)=>i.name===t);if(!r||!c())return null;let o=u(e)??{},s=a(r);return f(e,{active:r.name,views:o.views??[],...s}),s}function Uk(e,t){let r=u(e);if(!r||!c())return!1;let o=Ru(e),s=o.filter((i)=>i.name!==t);if(s.length===o.length)return!1;return f(e,{...r,active:r.active===t?null:r.active??null,views:s}),!0}function WR(e,t){if(!t)return e;let r=new Set(t.hidden),o=[];for(let i of e){if(i.field!==void 0&&r.has(i.field))continue;let d=i.field?t.widths?.[i.field]:void 0;o.push(d?{...i,width:d}:i)}if(!t.order?.length)return o;let s=new Map(t.order.map((i,d)=>[i,d]));return o.map((i,d)=>({def:i,index:d})).toSorted((i,d)=>{let l=s.get(i.def.field??"")??t.order.length+i.index,p=s.get(d.def.field??"")??t.order.length+d.index;return l-p}).map(({def:i})=>i)}
2
+ export{_d,im,Vk,Ru,L_,BR,zR,zy,Uk,WR};
3
3
 
4
- //# debugId=FE514F84F46649C464756E2164756E21
5
- //# sourceMappingURL=studio-zm7dnr9g.js.map
4
+ //# debugId=C14D4840DE9CEAC664756E2164756E21
5
+ //# sourceMappingURL=studio-4j35hgsw.js.map
@@ -1,5 +1,5 @@
1
- import{m,_i,Ht}from"./studio-y1x65h5r.js";import{ge,ne,g}from"./studio-hw60n5dh.js";import{nn}from"./studio-gmhd0j3f.js";import{Pd,Vc,JL,Ob,or}from"./studio-hvxt8z79.js";import{vp}from"./studio-e1g64q43.js";import{Dd,Nd,Uu,yp,NT}from"./studio-332hesdk.js";import{Rw,Ku,oN}from"./studio-wcakp5bt.js";import{wi,T,R}from"./studio-02phtmqn.js";import{le}from"./studio-fqs1a22a.js";var M={$schema:"https://jxsuite.com/schema/v1",$id:"StudioMediaPane",$description:"The Media viewer: a pane that SHOWS a file the studio has no document model for — an image at its own size, a video or audio player, an embedded PDF, a font set in a pangram, or an honest line about a format nothing here can draw. The adapter hands in one projection: which of the six stages to draw, the URL that loads it, the file's name and facts, the reference a document would write for it, and the documents that already do. Nothing here decides anything; a control asks the host to copy, to open a path, or to record the pixel size the browser just learned.",tagName:"div",attributes:{part:"viewer","data-jx-region":"${state.region}"},style:{$description:"What `.media-viewer`, `.media-stage`, `.media-image`, `.media-video`, `.media-embed`, `.media-audio`, `.media-specimen`, `.media-specimen-line`, `.media-unviewable`, `.media-note`, `.media-details`, `.media-name`, `.media-facts`, `.media-ref`, `.media-ref-value`, `.media-usage`, `.media-usage-title`, `.media-usage-headline`, `.media-usage-list`, `.media-usage-link` and `.media-usage-count` said in `styles/overlays.css`, keyed on `part` and re-pointed at the studio token layer. All twenty-two were this surface's alone, so the stylesheet block goes with the conversion rather than being copied. Eight `var(--spectrum-font-size-…)` names could not come with the declarations: every one of them resolves only inside `<sp-theme>`, and this document is mounted in a pane stage that is outside it, so each would silently have taken its hex fallback — they are the kit's `--jx-text-xs`, `--jx-text-sm`, `--jx-text-md` and `--jx-text-lg` instead.",height:"100%",display:"flex",gap:"var(--jx-space-5)",padding:"var(--jx-space-5)",overflowY:"auto",background:"var(--bg-panel)",fontFamily:"var(--jx-font-sans)",color:"var(--fg)",'& [part="asset-slot"], & [part="usage-slot"], & [part="list-slot"]':{$description:"A `$switch` renders its own container, and none of these three is a box: each stands exactly where its case does, so the case's own rule is the only one that lays anything out.",display:"contents"},'& [part="stage"]':{$description:"The asset takes the room and the details column keeps a fixed width, so the file is the thing being looked at and the facts about it are beside it rather than on top of it.",flex:"1",minWidth:"0",display:"flex",alignItems:"flex-start",justifyContent:"center"},'& [part="image"]':{$description:"Never larger than its own pixels: an upscaled thumbnail is a lie about the asset, and judging whether an imported image is big enough is the whole reason somebody opens this.",maxWidth:"100%",height:"auto",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"var(--bg-input)"},'& [part="video"], & [part="embed"]':{width:"100%",maxHeight:"70vh",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"var(--bg-input)"},'& [part="audio"]':{width:"100%"},'& [part="specimen"]':{$description:"A font is shown by being USED. The face itself arrives as a `@font-face` the adapter writes, under a family name generated from the path so two specimens open side by side cannot claim the same one; the element carries only that NAME, as a custom property, and the fallback stack that catches a face the browser refuses stays here where it is a rule rather than data.",width:"100%",padding:"var(--jx-space-5)",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"var(--bg-input)",color:"var(--fg)",fontFamily:"var(--jx-specimen-family, system-ui), system-ui, sans-serif"},'& [part="specimen-line"]':{margin:"0 0 var(--jx-space-4)",lineHeight:"1.3",overflowWrap:"anywhere"},'& [part="specimen-line"][data-size="48"]':{fontSize:"48px"},'& [part="specimen-line"][data-size="32"]':{fontSize:"32px"},'& [part="specimen-line"][data-size="24"]':{fontSize:"24px"},'& [part="specimen-line"][data-size="18"]':{fontSize:"18px"},'& [part="specimen-line"][data-size="14"]':{fontSize:"var(--jx-text-lg)"},'& [part="unviewable"]':{$description:"Not a failure state. A file the browser cannot render is a zip, or a format this build has never heard of, so the box says what the file IS and that the project still builds with it in.",padding:"var(--jx-space-6)",border:"1px dashed var(--border)",borderRadius:"var(--radius)",color:"var(--fg-dim)",textAlign:"center"},'& [part="note"]':{fontSize:"var(--jx-text-md)",color:"var(--fg-dim)"},'& [part="details"]':{flex:"0 0 260px",display:"flex",flexDirection:"column",gap:"var(--jx-space-4)"},'& [part="title"]':{margin:"0",fontSize:"var(--jx-text-lg)",color:"var(--fg)",overflowWrap:"anywhere"},'& [part="facts"]':{$description:'Kind, pixel size, bytes and modified date, joined by the adapter. Each is omitted rather than zeroed when it is not known: a real file can almost be `0 × 0` or `0 B`, so neither may double as "we did not find out".',margin:"0",fontSize:"var(--jx-text-md)",color:"var(--fg-dim)"},'& [part="ref"]':{$description:"The reference a document writes for this file — `/hero.jpg` for `public/hero.jpg`, which shares not one segment with it. Getting this wrong is the commonest way an image goes missing from a page, which is why it is on screen next to a button that copies it.",display:"flex",alignItems:"center",gap:"6px"},'& [part="ref-value"]':{flex:"1",minWidth:"0",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-sm)",background:"var(--bg-input)",border:"1px solid var(--border)",borderRadius:"var(--radius)",padding:"3px 6px",overflowWrap:"anywhere"},'& [part="usage"]':{display:"flex",flexDirection:"column"},'& [part="group-title"]':{margin:"0 0 var(--jx-space-2)",fontSize:"var(--jx-text-md)",fontWeight:"500",color:"var(--fg-dim)"},'& [part="message"]':{margin:"0",fontSize:"var(--jx-text-md)",color:"var(--fg-dim)"},'& [part="list"]':{listStyle:"none",margin:"var(--jx-space-3) 0 0",padding:"0",display:"flex",flexDirection:"column",gap:"var(--jx-space-1)"},'& [part="row"]':{display:"flex",alignItems:"baseline",gap:"6px",fontSize:"var(--jx-text-md)"},'& [part="file-path"]':{$description:'The path is a control, not a label: it opens the document that references this file. A plain button rather than a `jx-button`, for the reason the Problems rows give — what it has to look like is a line of text, and every fill, border and control height the kit draws would have to be taken back off again. Named `file-path` and not `path` because `jx-icon` puts `part="path"` on the `<path>` of every glyph it draws, so `[part="path"]` would select this button and any SVG path beside it.',flex:"1",minWidth:"0",margin:"0",padding:"0",background:"none",border:"none",borderRadius:"var(--jx-radius-xs)",textAlign:"left",color:"var(--accent)",cursor:"pointer",font:"inherit",overflowWrap:"anywhere",":hover":{textDecoration:"underline"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"2px"}},'& [part="count"]':{flex:"0 0 auto",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-xs)",color:"var(--fg-dim)"}},children:[{tagName:"div",attributes:{part:"stage"},children:[{tagName:"div",attributes:{part:"asset-slot",role:"none"},$switch:{$ref:"#/state/kind"},cases:{image:{tagName:"img",attributes:{part:"image",src:"${state.src}",alt:""},onload:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/imageLoaded"},value:[{$ref:"event#/target/naturalWidth"},{$ref:"event#/target/naturalHeight"}]}],description:"The only honest source of pixel dimensions in a browser is an image that has loaded, and this viewer is showing one at full size anyway. The host decides whether the numbers are new; a repeat load of the same picture must not repaint the pane."}},video:{tagName:"video",attributes:{part:"video",src:"${state.src}",controls:!0}},audio:{tagName:"audio",attributes:{part:"audio",src:"${state.src}",controls:!0}},embed:{tagName:"embed",attributes:{part:"embed",src:"${state.src}",type:"application/pdf",title:"${state.name}"}},font:{tagName:"div",attributes:{part:"specimen",style:"${state.specimenFamily}"},children:[{tagName:"style",textContent:"${state.fontFace}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"48"},textContent:"${state.specimen}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"32"},textContent:"${state.specimen}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"24"},textContent:"${state.specimen}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"18"},textContent:"${state.specimen}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"14"},textContent:"${state.specimen}"}]},unviewable:{tagName:"div",attributes:{part:"unviewable"},children:[{tagName:"p",children:[{tagName:"span",textContent:"Jx has no viewer for "},{tagName:"code",textContent:"${state.extLabel}"},{tagName:"span",textContent:"."}]},{tagName:"p",attributes:{part:"note"},textContent:"The file is in the project and builds normally."}]}}}]},{tagName:"div",attributes:{part:"details"},children:[{tagName:"h3",attributes:{part:"title"},textContent:"${state.name}"},{tagName:"p",attributes:{part:"facts"},textContent:"${state.facts}"},{tagName:"div",attributes:{part:"ref"},children:[{tagName:"code",attributes:{part:"ref-value"},textContent:"${state.ref}"},{tagName:"jx-action-button",$props:{size:"sm",quiet:!0,hint:"Copy the reference"},attributes:{part:"copy"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/copyRef"}}]},children:[{tagName:"span",textContent:"Copy"}]}]},{tagName:"div",attributes:{part:"usage-slot",role:"none"},$switch:{$ref:"#/state/usageState"},cases:{shown:{tagName:"div",attributes:{part:"usage"},children:[{tagName:"h4",attributes:{part:"group-title"},textContent:"Used by"},{tagName:"p",attributes:{part:"message"},textContent:"${state.usageHeadline}"},{tagName:"div",attributes:{part:"list-slot",role:"none"},$switch:{$ref:"#/state/hasUsageFiles"},cases:{true:{tagName:"ul",attributes:{part:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/usageFiles"},key:{$ref:"$map/item/path"},map:{tagName:"li",attributes:{part:"row","data-usage":"${$map.item.path}"},children:[{tagName:"button",attributes:{part:"file-path",type:"button"},textContent:"${$map.item.path}",onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openDocument"},value:[{$ref:"$map/item/path"}]}]}},{tagName:"span",attributes:{part:"count"},textContent:"${$map.item.count}"}]}}]}}}]}}}]}]};T("media-pane",M);function S(e,t){e.region=t.region,e.name=t.name,e.kind=t.kind,e.src=t.src,e.facts=t.facts,e.ref=t.ref,e.specimen=t.specimen,e.specimenFamily=t.specimenFamily,e.fontFace=t.fontFace,e.extLabel=t.extLabel,e.usageState=t.usageState,e.usageHeadline=t.usageHeadline,e.usageFiles=t.usageFiles,e.hasUsageFiles=t.usageFiles.length>0}function F(e,t,a){e.replaceChildren();let r=g({copyRef:a.copyRef,extLabel:"",facts:"",fontFace:"",hasUsageFiles:!1,imageLoaded:a.imageLoaded,kind:"unviewable",name:"",openDocument:a.openDocument,ref:"",region:"",specimen:"",specimenFamily:"",src:"",usageFiles:[],usageHeadline:"",usageState:"hidden"});S(r,t);let i=null,s=!1,p=R("media-pane",r,e).then((n)=>{if(s)n.dispose();else i=n;return n.root});return{attached:()=>{if(s)return!1;let n=i?.root;return n===void 0?!0:n instanceof HTMLElement&&e.contains(n)},dispose(){s=!0,i?.dispose(),i=null},ready:p,update:(n)=>S(r,n)}}var b="media",k="The quick brown fox jumps over the lazy dog",c=new Map;function h(e){return c.get(e)??null}function LT(e,t){let a=h(e);return a!==null&&a.tabId===t.id&&a.wrap.isConnected&&a.surface.attached()}function _w(e){let t=c.get(e);if(!t)return;t.scope.stop(),t.surface.dispose(),c.delete(e)}function $T(e){let t=nn(e);if(JL.has(t))return"font";let a=Vc({name:e});if(a==="image"||a==="video"||a==="audio")return a;return t===".pdf"?"embed":"unviewable"}function IT(e,t){let a=[Vc({name:e})];if(t?.width!=null&&t.height!=null)a.push(`${t.width} × ${t.height}`);if(t?.bytes!=null)a.push(NT(t.bytes));if(t?.modified)a.push(`modified ${vp(new Date(t.modified))}`);return a.join(" · ")}function z(e){return`jx-specimen-${e.replaceAll(/[^a-zA-Z0-9]/g,"-")}`}function RT(e){let t=z(e);return{fontFace:`@font-face { font-family: "${t}"; src: url("${or(e)}"); }`,specimen:k,specimenFamily:`--jx-specimen-family: "${t}"`}}function DT(e){let t=oN(e);if(t===null)return{usageFiles:[],usageHeadline:"",usageState:"hidden"};return{usageFiles:(e?.status==="ready"?e.result.files:[]).map((r)=>({count:String(r.count),path:r.path})),usageHeadline:t,usageState:"shown"}}async function C(e){let{openFileInTab:t}=await (le("ybpp3j38"),import("./files-ybpp3j38.js"));await t(e)}function UD(e,t){let{paneId:a,wrap:r}=e;if(LT(a,t))return;_w(a);let i=t.documentPath??"",s=or(i),p=Ob(i),n=nn(i),x=$T(i),o=null,u=()=>{if(o!==null&&h(a)===o)y()},v=()=>{let d=Nd(i),l=Rw(i);if(!Dd(i))Uu(i).then(u);if(l===null||l.status==="pending")Ku(i).then(u);let f=RT(i);return{extLabel:n||"this file",facts:IT(i,d),fontFace:x==="font"?f.fontFace:"",kind:x,name:i.split("/").pop()??"",ref:p,region:wi(a,"media"),specimen:f.specimen,specimenFamily:f.specimenFamily,src:s,...DT(l)}},y=()=>{o?.surface.update(v())},w=ge(),N=F(r,v(),{copyRef:()=>{if("clipboard"in navigator)navigator.clipboard.writeText(p)},imageLoaded:(d,l)=>{if(yp(i,d,l))u()},openDocument:(d)=>{C(d)}});o={paneId:a,scope:w,surface:N,tabId:t.id,wrap:r},c.set(a,o),w.run(()=>{ne(()=>{if(h(a)!==o)return;t.documentPath,y()})})}var H={children:[],tagName:"div"};function Sw(e){return Pd(e)}function A(e){return nn(e)===".svg"?[b,"source"]:[b]}function pb(e,t={}){let a=m.tabs.get(e);if(a)return Ht(e,{focus:t.focus!==!1}),a;return _i({capabilities:{modes:A(e)},document:structuredClone(H),documentPath:e,id:e,sourceFormat:null,...t.paneId!==void 0&&{paneId:t.paneId},...t.preview===!0&&{preview:!0},...t.focus===!1&&{focus:!1}})}
2
- export{LT,_w,$T,IT,RT,DT,UD,Sw,pb};
1
+ import{m,_i,jt}from"./studio-ztppbam0.js";import{ge,ne,g}from"./studio-tfmhnwyr.js";import{nn}from"./studio-t6dqnnft.js";import{Od,Wc,ZL,jb,tr}from"./studio-vtey9w98.js";import{xp}from"./studio-732mw0g8.js";import{Rd,Dd,qu,_p,WT}from"./studio-kqh7fxn6.js";import{Ow,Gu,aN}from"./studio-9179bsm7.js";import{wi,T,R}from"./studio-myb4mf0h.js";import{le}from"./studio-k5n4es74.js";var M={$schema:"https://jxsuite.com/schema/v1",$id:"StudioMediaPane",$description:"The Media viewer: a pane that SHOWS a file the studio has no document model for — an image at its own size, a video or audio player, an embedded PDF, a font set in a pangram, or an honest line about a format nothing here can draw. The adapter hands in one projection: which of the six stages to draw, the URL that loads it, the file's name and facts, the reference a document would write for it, and the documents that already do. Nothing here decides anything; a control asks the host to copy, to open a path, or to record the pixel size the browser just learned.",tagName:"div",attributes:{part:"viewer","data-jx-region":"${state.region}"},style:{$description:"What `.media-viewer`, `.media-stage`, `.media-image`, `.media-video`, `.media-embed`, `.media-audio`, `.media-specimen`, `.media-specimen-line`, `.media-unviewable`, `.media-note`, `.media-details`, `.media-name`, `.media-facts`, `.media-ref`, `.media-ref-value`, `.media-usage`, `.media-usage-title`, `.media-usage-headline`, `.media-usage-list`, `.media-usage-link` and `.media-usage-count` said in `styles/overlays.css`, keyed on `part` and re-pointed at the studio token layer. All twenty-two were this surface's alone, so the stylesheet block goes with the conversion rather than being copied. Eight `var(--spectrum-font-size-…)` names could not come with the declarations: every one of them resolves only inside `<sp-theme>`, and this document is mounted in a pane stage that is outside it, so each would silently have taken its hex fallback — they are the kit's `--jx-text-xs`, `--jx-text-sm`, `--jx-text-md` and `--jx-text-lg` instead.",height:"100%",display:"flex",gap:"var(--jx-space-5)",padding:"var(--jx-space-5)",overflowY:"auto",background:"var(--bg-panel)",fontFamily:"var(--jx-font-sans)",color:"var(--fg)",'& [part="asset-slot"], & [part="usage-slot"], & [part="list-slot"]':{$description:"A `$switch` renders its own container, and none of these three is a box: each stands exactly where its case does, so the case's own rule is the only one that lays anything out.",display:"contents"},'& [part="stage"]':{$description:"The asset takes the room and the details column keeps a fixed width, so the file is the thing being looked at and the facts about it are beside it rather than on top of it.",flex:"1",minWidth:"0",display:"flex",alignItems:"flex-start",justifyContent:"center"},'& [part="image"]':{$description:"Never larger than its own pixels: an upscaled thumbnail is a lie about the asset, and judging whether an imported image is big enough is the whole reason somebody opens this.",maxWidth:"100%",height:"auto",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"var(--bg-input)"},'& [part="video"], & [part="embed"]':{width:"100%",maxHeight:"70vh",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"var(--bg-input)"},'& [part="audio"]':{width:"100%"},'& [part="specimen"]':{$description:"A font is shown by being USED. The face itself arrives as a `@font-face` the adapter writes, under a family name generated from the path so two specimens open side by side cannot claim the same one; the element carries only that NAME, as a custom property, and the fallback stack that catches a face the browser refuses stays here where it is a rule rather than data.",width:"100%",padding:"var(--jx-space-5)",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"var(--bg-input)",color:"var(--fg)",fontFamily:"var(--jx-specimen-family, system-ui), system-ui, sans-serif"},'& [part="specimen-line"]':{margin:"0 0 var(--jx-space-4)",lineHeight:"1.3",overflowWrap:"anywhere"},'& [part="specimen-line"][data-size="48"]':{fontSize:"48px"},'& [part="specimen-line"][data-size="32"]':{fontSize:"32px"},'& [part="specimen-line"][data-size="24"]':{fontSize:"24px"},'& [part="specimen-line"][data-size="18"]':{fontSize:"18px"},'& [part="specimen-line"][data-size="14"]':{fontSize:"var(--jx-text-lg)"},'& [part="unviewable"]':{$description:"Not a failure state. A file the browser cannot render is a zip, or a format this build has never heard of, so the box says what the file IS and that the project still builds with it in.",padding:"var(--jx-space-6)",border:"1px dashed var(--border)",borderRadius:"var(--radius)",color:"var(--fg-dim)",textAlign:"center"},'& [part="note"]':{fontSize:"var(--jx-text-md)",color:"var(--fg-dim)"},'& [part="details"]':{flex:"0 0 260px",display:"flex",flexDirection:"column",gap:"var(--jx-space-4)"},'& [part="title"]':{margin:"0",fontSize:"var(--jx-text-lg)",color:"var(--fg)",overflowWrap:"anywhere"},'& [part="facts"]':{$description:'Kind, pixel size, bytes and modified date, joined by the adapter. Each is omitted rather than zeroed when it is not known: a real file can almost be `0 × 0` or `0 B`, so neither may double as "we did not find out".',margin:"0",fontSize:"var(--jx-text-md)",color:"var(--fg-dim)"},'& [part="ref"]':{$description:"The reference a document writes for this file — `/hero.jpg` for `public/hero.jpg`, which shares not one segment with it. Getting this wrong is the commonest way an image goes missing from a page, which is why it is on screen next to a button that copies it.",display:"flex",alignItems:"center",gap:"6px"},'& [part="ref-value"]':{flex:"1",minWidth:"0",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-sm)",background:"var(--bg-input)",border:"1px solid var(--border)",borderRadius:"var(--radius)",padding:"3px 6px",overflowWrap:"anywhere"},'& [part="usage"]':{display:"flex",flexDirection:"column"},'& [part="group-title"]':{margin:"0 0 var(--jx-space-2)",fontSize:"var(--jx-text-md)",fontWeight:"500",color:"var(--fg-dim)"},'& [part="message"]':{margin:"0",fontSize:"var(--jx-text-md)",color:"var(--fg-dim)"},'& [part="list"]':{listStyle:"none",margin:"var(--jx-space-3) 0 0",padding:"0",display:"flex",flexDirection:"column",gap:"var(--jx-space-1)"},'& [part="row"]':{display:"flex",alignItems:"baseline",gap:"6px",fontSize:"var(--jx-text-md)"},'& [part="file-path"]':{$description:'The path is a control, not a label: it opens the document that references this file. A plain button rather than a `jx-button`, for the reason the Problems rows give — what it has to look like is a line of text, and every fill, border and control height the kit draws would have to be taken back off again. Named `file-path` and not `path` because `jx-icon` puts `part="path"` on the `<path>` of every glyph it draws, so `[part="path"]` would select this button and any SVG path beside it.',flex:"1",minWidth:"0",margin:"0",padding:"0",background:"none",border:"none",borderRadius:"var(--jx-radius-xs)",textAlign:"left",color:"var(--accent)",cursor:"pointer",font:"inherit",overflowWrap:"anywhere",":hover":{textDecoration:"underline"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"2px"}},'& [part="count"]':{flex:"0 0 auto",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-xs)",color:"var(--fg-dim)"}},children:[{tagName:"div",attributes:{part:"stage"},children:[{tagName:"div",attributes:{part:"asset-slot",role:"none"},$switch:{$ref:"#/state/kind"},cases:{image:{tagName:"img",attributes:{part:"image",src:"${state.src}",alt:""},onload:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/imageLoaded"},value:[{$ref:"event#/target/naturalWidth"},{$ref:"event#/target/naturalHeight"}]}],description:"The only honest source of pixel dimensions in a browser is an image that has loaded, and this viewer is showing one at full size anyway. The host decides whether the numbers are new; a repeat load of the same picture must not repaint the pane."}},video:{tagName:"video",attributes:{part:"video",src:"${state.src}",controls:!0}},audio:{tagName:"audio",attributes:{part:"audio",src:"${state.src}",controls:!0}},embed:{tagName:"embed",attributes:{part:"embed",src:"${state.src}",type:"application/pdf",title:"${state.name}"}},font:{tagName:"div",attributes:{part:"specimen",style:"${state.specimenFamily}"},children:[{tagName:"style",textContent:"${state.fontFace}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"48"},textContent:"${state.specimen}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"32"},textContent:"${state.specimen}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"24"},textContent:"${state.specimen}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"18"},textContent:"${state.specimen}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"14"},textContent:"${state.specimen}"}]},unviewable:{tagName:"div",attributes:{part:"unviewable"},children:[{tagName:"p",children:[{tagName:"span",textContent:"Jx has no viewer for "},{tagName:"code",textContent:"${state.extLabel}"},{tagName:"span",textContent:"."}]},{tagName:"p",attributes:{part:"note"},textContent:"The file is in the project and builds normally."}]}}}]},{tagName:"div",attributes:{part:"details"},children:[{tagName:"h3",attributes:{part:"title"},textContent:"${state.name}"},{tagName:"p",attributes:{part:"facts"},textContent:"${state.facts}"},{tagName:"div",attributes:{part:"ref"},children:[{tagName:"code",attributes:{part:"ref-value"},textContent:"${state.ref}"},{tagName:"jx-action-button",$props:{size:"sm",quiet:!0,hint:"Copy the reference"},attributes:{part:"copy"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/copyRef"}}]},children:[{tagName:"span",textContent:"Copy"}]}]},{tagName:"div",attributes:{part:"usage-slot",role:"none"},$switch:{$ref:"#/state/usageState"},cases:{shown:{tagName:"div",attributes:{part:"usage"},children:[{tagName:"h4",attributes:{part:"group-title"},textContent:"Used by"},{tagName:"p",attributes:{part:"message"},textContent:"${state.usageHeadline}"},{tagName:"div",attributes:{part:"list-slot",role:"none"},$switch:{$ref:"#/state/hasUsageFiles"},cases:{true:{tagName:"ul",attributes:{part:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/usageFiles"},key:{$ref:"$map/item/path"},map:{tagName:"li",attributes:{part:"row","data-usage":"${$map.item.path}"},children:[{tagName:"button",attributes:{part:"file-path",type:"button"},textContent:"${$map.item.path}",onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openDocument"},value:[{$ref:"$map/item/path"}]}]}},{tagName:"span",attributes:{part:"count"},textContent:"${$map.item.count}"}]}}]}}}]}}}]}]};T("media-pane",M);function S(e,t){e.region=t.region,e.name=t.name,e.kind=t.kind,e.src=t.src,e.facts=t.facts,e.ref=t.ref,e.specimen=t.specimen,e.specimenFamily=t.specimenFamily,e.fontFace=t.fontFace,e.extLabel=t.extLabel,e.usageState=t.usageState,e.usageHeadline=t.usageHeadline,e.usageFiles=t.usageFiles,e.hasUsageFiles=t.usageFiles.length>0}function F(e,t,a){e.replaceChildren();let r=g({copyRef:a.copyRef,extLabel:"",facts:"",fontFace:"",hasUsageFiles:!1,imageLoaded:a.imageLoaded,kind:"unviewable",name:"",openDocument:a.openDocument,ref:"",region:"",specimen:"",specimenFamily:"",src:"",usageFiles:[],usageHeadline:"",usageState:"hidden"});S(r,t);let i=null,s=!1,p=R("media-pane",r,e).then((n)=>{if(s)n.dispose();else i=n;return n.root});return{attached:()=>{if(s)return!1;let n=i?.root;return n===void 0?!0:n instanceof HTMLElement&&e.contains(n)},dispose(){s=!0,i?.dispose(),i=null},ready:p,update:(n)=>S(r,n)}}var b="media",k="The quick brown fox jumps over the lazy dog",c=new Map;function h(e){return c.get(e)??null}function FT(e,t){let a=h(e);return a!==null&&a.tabId===t.id&&a.wrap.isConnected&&a.surface.attached()}function Dw(e){let t=c.get(e);if(!t)return;t.scope.stop(),t.surface.dispose(),c.delete(e)}function jT(e){let t=nn(e);if(ZL.has(t))return"font";let a=Wc({name:e});if(a==="image"||a==="video"||a==="audio")return a;return t===".pdf"?"embed":"unviewable"}function HT(e,t){let a=[Wc({name:e})];if(t?.width!=null&&t.height!=null)a.push(`${t.width} × ${t.height}`);if(t?.bytes!=null)a.push(WT(t.bytes));if(t?.modified)a.push(`modified ${xp(new Date(t.modified))}`);return a.join(" · ")}function z(e){return`jx-specimen-${e.replaceAll(/[^a-zA-Z0-9]/g,"-")}`}function BT(e){let t=z(e);return{fontFace:`@font-face { font-family: "${t}"; src: url("${tr(e)}"); }`,specimen:k,specimenFamily:`--jx-specimen-family: "${t}"`}}function zT(e){let t=aN(e);if(t===null)return{usageFiles:[],usageHeadline:"",usageState:"hidden"};return{usageFiles:(e?.status==="ready"?e.result.files:[]).map((r)=>({count:String(r.count),path:r.path})),usageHeadline:t,usageState:"shown"}}async function C(e){let{openFileInTab:t}=await (le("yswdhxrf"),import("./files-yswdhxrf.js"));await t(e)}function nN(e,t){let{paneId:a,wrap:r}=e;if(FT(a,t))return;Dw(a);let i=t.documentPath??"",s=tr(i),p=jb(i),n=nn(i),x=jT(i),o=null,u=()=>{if(o!==null&&h(a)===o)y()},v=()=>{let d=Dd(i),l=Ow(i);if(!Rd(i))qu(i).then(u);if(l===null||l.status==="pending")Gu(i).then(u);let f=BT(i);return{extLabel:n||"this file",facts:HT(i,d),fontFace:x==="font"?f.fontFace:"",kind:x,name:i.split("/").pop()??"",ref:p,region:wi(a,"media"),specimen:f.specimen,specimenFamily:f.specimenFamily,src:s,...zT(l)}},y=()=>{o?.surface.update(v())},w=ge(),N=F(r,v(),{copyRef:()=>{if("clipboard"in navigator)navigator.clipboard.writeText(p)},imageLoaded:(d,l)=>{if(_p(i,d,l))u()},openDocument:(d)=>{C(d)}});o={paneId:a,scope:w,surface:N,tabId:t.id,wrap:r},c.set(a,o),w.run(()=>{ne(()=>{if(h(a)!==o)return;t.documentPath,y()})})}var H={children:[],tagName:"div"};function Nw(e){return Od(e)}function A(e){return nn(e)===".svg"?[b,"source"]:[b]}function _b(e,t={}){let a=m.tabs.get(e);if(a)return jt(e,{focus:t.focus!==!1}),a;return _i({capabilities:{modes:A(e)},document:structuredClone(H),documentPath:e,id:e,sourceFormat:null,...t.paneId!==void 0&&{paneId:t.paneId},...t.preview===!0&&{preview:!0},...t.focus===!1&&{focus:!1}})}
2
+ export{FT,Dw,jT,HT,BT,zT,nN,Nw,_b};
3
3
 
4
- //# debugId=0415CEFD091A4C2264756E2164756E21
5
- //# sourceMappingURL=studio-bqgs90r8.js.map
4
+ //# debugId=8D9F33CDEC344D5964756E2164756E21
5
+ //# sourceMappingURL=studio-4qg61g9j.js.map
@@ -0,0 +1,5 @@
1
+ import{de,C}from"./studio-tfmhnwyr.js";import{Q,_}from"./studio-ywf9y1e2.js";var st={functionEditor:null,blockActionBarEl:null,selDragCleanup:null,dndCleanups:[],elementsCollapsed:new Set,elementsFilter:"",_currentDropTargetRow:null,layerDragSourceHeight:0,_completionRegistered:!1,_layersCollapsed:null};var m=0;function zO(){return m+=1,m}var l=new Map;function bo(e){let r=l.get(e);if(!r)r=v(e),l.set(e,r);return r}function v(e){return{centerObserver:null,monacoDiffEditor:null,monacoEditor:null,needsCenter:!0,panX:0,panY:0,panels:[],paneId:e,panzoomWrap:null,stage:null,prevCanvasMode:null,prevStylebookCustomizedOnly:null,prevStylebookFilter:null,renderGeneration:0,sourceCollabCleanup:null,stageScrollbar:null,wrap:null}}function wh(e){return e.wrap}function Gp(){return[...l.values()]}function Zc(e){if(!e)return null;for(let r of l.values())if(wh(r)?.contains(e))return r;return null}function g(e){for(let r of e.panels)r.renderScope?.stop(),r.renderScope=null;e.panels.length=0,e.prevCanvasMode=null}function WO(e,r){let t=bo(e);return t.wrap=r,g(t),t}function VO(e){if(l.get(e))G$(e);let t=v(e);return l.set(e,t),t}var S=null;function UO(e){S=e}function G$(e){let r=l.get(e);if(!r)return;S?.(r),g(r),y(e)}function y(e){l.delete(e)}var Kp="commit";function b(e){return _(e)&&Q(e.then)}function mv(e){let r=new Map,t=new Map,o=new Map,a=!1,u=!1,c=!1;function f(n,i){if(!b(i))return i;let s=i.finally(()=>{if(o.get(n)===s)o.delete(n)});return o.set(n,s),s}let d={arm(n,i,s){clearTimeout(r.get(n)),t.set(n,s),r.set(n,setTimeout(()=>{r.delete(n),t.delete(n),f(n,s())},i))},cancel(){for(let n of r.values())clearTimeout(n);r.clear(),t.clear()},flush(n){let i=t.get(n);if(!i)return o.get(n);return clearTimeout(r.get(n)),r.delete(n),t.delete(n),f(n,i())},ahead:()=>a,markAhead(){a=!0},typed:()=>u,markTyped(){a=!0,u=!0},markSettled(){a=!1,u=!1},shared:()=>c,markShared(){c=!0}};return e._writes=d,d}var T={logic:{holds:"The handler you were typing",reached:"written into",source:"Logic"},source:{holds:"The source you were typing",reached:"parsed into",source:"Editor"}};function p(e,r,t){if(e._writes?.typed()!==!0)return!0;let a=e._editingTab??null,u=a?.documentPath??"Untitled",{holds:c,reached:f,source:d}=T[r],n=t?{detail:h(t.error)}:{};if(n.key=`buffer-discarded:${r}:${a?.id??"none"}`,n.source=d,a?.documentPath)n.path=a.documentPath;return C.warn(`${c} was discarded — it was never ${f} "${u}".`,n),!1}function h(e){return e instanceof Error?e.stack??e.message:String(e)}function gv(e,r){let t=e?._writes;if(!e||!t)return!0;let o;try{o=t.flush(Kp)}catch(a){return t.cancel(),p(e,r,{error:a})}if(t.cancel(),b(o))return o.then(()=>p(e,r,null),(a)=>p(e,r,{error:a})),!0;return p(e,r,null)}function K$(e){e?._writes?.cancel()}function Jd(e){return Boolean(e?.getModel())}function Jp(e,r){if(!Jd(e)||e.hasTextFocus()||e._writes?.ahead()||e._writes?.shared())return!0;return r!==void 0&&e.getValue()!==r}function w(e){let r=de(e);return[...Gp().map((o)=>o.monacoEditor),st.functionEditor].filter((o)=>o!=null&&o._editingTab!=null&&de(o._editingTab)===r&&Jd(o))}async function Yd(e){for(let r of w(e)){if(!Jd(r))continue;try{await r._writes?.flush(Kp)}catch(t){let o={detail:h(t),key:`buffer-commit:${e.id}`,source:"Editor"};if(e.documentPath)o.path=e.documentPath;C.error(`Could not save the editor's contents into "${e.documentPath??"Untitled"}".`,o)}}}function Yp(e){return w(e).some((r)=>r._writes?.typed()===!0)}
2
+ export{st,zO,bo,wh,Gp,Zc,WO,VO,UO,G$,Kp,mv,gv,K$,Jd,Jp,Yd,Yp};
3
+
4
+ //# debugId=12648C4DBECBACBC64756E2164756E21
5
+ //# sourceMappingURL=studio-4rgem12q.js.map
@@ -0,0 +1,5 @@
1
+ import{Ot,Nt,ae}from"./studio-qs5fmhtj.js";import{p}from"./studio-9ndgd55w.js";import{ds}from"./studio-y47090vq.js";import{g}from"./studio-tfmhnwyr.js";import{Ue,ft,T,R,Jt,tt}from"./studio-myb4mf0h.js";import{zl,lN,Sb,qT,cN,Ri,Nd}from"./studio-0nefxhar.js";import{cb,DE}from"./studio-nr0kcqc6.js";import{S}from"./studio-9ra9e7m4.js";import{Q}from"./studio-ywf9y1e2.js";import{le}from"./studio-k5n4es74.js";function Rl(e){let t=e.trim().replaceAll("\\","/").split("/").filter((n)=>n!=="");return t.some((n)=>n==="."||n==="..")?null:t.join("/")}var C={$schema:"https://jxsuite.com/schema/v1",$id:"StudioPublish",$description:"Publish: the one-click Cloudflare Pages flow, as a `jx-dialog` over the kit. Eight bodies, one at a time, because the reader is at exactly one point of a chain — a host that cannot reach Cloudflare at all, a question still in flight, a connection that lapsed, an invitation to connect, a stored token Cloudflare refused, a field to paste a replacement into, the create-and-connect form, and the connected status. `publish/publish-panel.ts` keeps every one of those decisions and the calls that settle them; this document knows only which of the eight it was told to draw. **The token is never painted.** The field below binds no `value` — it is written by the reader and read once, on its way to storage — so a stored secret cannot reach the attribute, the serialised HTML or the accessibility tree, which is `studio.md` §15 rule 1 written as a missing binding rather than as a rule somebody remembers.",tagName:"jx-dialog",$props:{headline:"Publish",confirmLabel:"",cancelLabel:"Close",size:"md"},attributes:{part:"publish"},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},style:{$description:"What the five `.publish-*` names carried, keyed on `part`, and most of them do not survive the move. `.publish-modal` and its `.new-project-modal` base were a fixed card, a scroll body, a border, a shadow and a `z-index: 1000` — a modal `<dialog>` is every one of those, and the top layer is what the z-index was climbing towards. `.publish-field` was a label stacked over a control, which is `jx-field`'s whole shape. What is left is the column gap between bodies, the two button rows, the hint and the refusal. Nothing here uses `--spectrum-*`: those custom properties resolve only inside `<sp-theme>`, and a document mounted in a layer host is outside it, so each would silently have taken its hard-coded fallback.",'& [part="body"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)"},'& [part="note"], & [part="status-line"], & [part="deployment"]':{margin:"0",lineHeight:"1.5"},'& [part="rows"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)"},'& [part="actions"]':{$description:'Wraps rather than overflows (studio-ui-guidelines.md §4.6): two buttons whose labels are whole phrases — "Verify & Connect", "Preferences › Accounts" — are wider than a narrow dialog at the sizes a reader may have set.',display:"flex",flexWrap:"wrap",gap:"var(--jx-space-2)"},'& [part="submit"]':{alignSelf:"flex-start"},'& [part="hint"]':{$description:"Publishing rides every commit, so the connected body's only job is to say what is already happening. Dim, because it is a standing fact rather than something to act on.",margin:"0",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="failure"]':{$description:'`failure` and not `error`: `jx-textfield` and `jx-select` each draw a `[part="error"]` of their own inside this same tree, and the kit is light DOM — a scoped rule on that name would restyle the token field\'s refusal line too.',margin:"0",color:"var(--danger)",lineHeight:"1.5"},'& [part="link"], & [part="install-link"]':{color:"var(--accent)",textDecoration:"underline"},"& code":{fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-sm)"}},children:[{tagName:"div",attributes:{part:"body"},children:[{tagName:"div",attributes:{part:"body-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/body"},cases:{unsupported:{tagName:"p",attributes:{part:"note"},children:["This platform cannot reach the Cloudflare API. Publish by committing and pushing — your host builds ",{tagName:"code",textContent:"bunx jx build"}," and serves ",{tagName:"code",textContent:"dist/"},"."]},loading:{tagName:"p",attributes:{part:"note"},textContent:"Checking Cloudflare connection…"},lapsed:{tagName:"div",attributes:{part:"lapsed",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},textContent:"Your Cloudflare connection has expired, so publishing cannot reach your account. Reconnect to restore it — this site's Pages project and its settings are untouched."},{tagName:"jx-button",$props:{variant:"accent",disabled:{$ref:"#/state/busy"}},attributes:{part:"reconnect"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/connect"},value:[]}]},children:[{tagName:"span",textContent:"${state.connectLabel}"}]}]},hosted:{tagName:"div",attributes:{part:"hosted",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},textContent:"Connect your Cloudflare account to publish this site."},{tagName:"jx-button",$props:{disabled:{$ref:"#/state/busy"}},attributes:{part:"connect"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/connect"},value:[]}]},children:[{tagName:"span",textContent:"Connect Cloudflare"}]}]},stored:{tagName:"div",attributes:{part:"stored",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},textContent:"A Cloudflare API token is stored on this machine, and Cloudflare did not accept it. It may have been revoked, or it may be missing the Account Settings Read and Pages Read/Write permissions."},{tagName:"div",attributes:{part:"actions"},children:[{tagName:"jx-button",$props:{disabled:{$ref:"#/state/busy"}},attributes:{part:"replace"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/replace"},value:[]}]},children:[{tagName:"span",textContent:"Replace token"}]},{tagName:"jx-button",$props:{quiet:!0},attributes:{part:"accounts"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openAccounts"},value:[]}]},children:[{tagName:"span",textContent:"Preferences › Accounts"}]}]}]},token:{tagName:"div",attributes:{part:"token-form",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},textContent:"Paste a Cloudflare API token (permissions: Account Settings Read, Pages Read/Write). It is stored on this machine and only sent to the same-origin proxy — Studio never renders it back."},{tagName:"jx-field",$props:{span:!0,label:"API token"},attributes:{part:"token-row","data-field":"token"},children:[{tagName:"jx-textfield",$description:"No `value` binding, and its absence is the contract: a secret may pass through a field the reader typed it into and may never be painted into one they did not. The draft lives in the adapter's closure until Verify reads it, so nothing here — not the attribute, not the accessibility tree, not a DOM dump — has ever held it.",$props:{type:"password",placeholder:"cf_..."},attributes:{part:"token"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setToken"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"div",attributes:{part:"actions"},children:[{tagName:"jx-button",$props:{variant:"accent",disabled:{$ref:"#/state/busy"}},attributes:{part:"verify"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/verify"},value:[]}]},children:[{tagName:"span",textContent:"Verify & Connect"}]},{tagName:"jx-button",$props:{quiet:!0},attributes:{part:"accounts"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openAccounts"},value:[]}]},children:[{tagName:"span",textContent:"Preferences › Accounts"}]}]}]},form:{tagName:"div",attributes:{part:"connect-form",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},children:["Create a Cloudflare Pages project connected to this repository. Every commit then builds and publishes automatically (",{tagName:"code",textContent:"bunx jx build"},")."]},{tagName:"div",attributes:{part:"rows"},children:[{tagName:"jx-field",$props:{span:!0,label:"Account"},attributes:{part:"row","data-field":"account"},children:[{tagName:"jx-select",$props:{options:{$ref:"#/state/accountOptions"},value:{$ref:"#/state/accountId"}},attributes:{part:"account"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setAccount"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"Pages project name"},attributes:{part:"row","data-field":"projectName"},children:[{tagName:"jx-textfield",$props:{value:{$ref:"#/state/projectName"}},attributes:{part:"project-name"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setProjectName"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"GitHub owner"},attributes:{part:"row","data-field":"owner"},children:[{tagName:"jx-textfield",$props:{value:{$ref:"#/state/owner"}},attributes:{part:"owner"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setOwner"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"GitHub repository"},attributes:{part:"row","data-field":"repo"},children:[{tagName:"jx-textfield",$props:{value:{$ref:"#/state/repo"}},attributes:{part:"repo"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setRepo"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"Production branch"},attributes:{part:"row","data-field":"branch"},children:[{tagName:"jx-textfield",$props:{value:{$ref:"#/state/branch"}},attributes:{part:"branch"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setBranch"},value:[{$ref:"event#/target/value"}]}]}}]}]},{tagName:"jx-button",$props:{variant:"accent",disabled:{$ref:"#/state/busy"}},attributes:{part:"submit"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/submit"},value:[]}]},children:[{tagName:"span",textContent:"${state.submitLabel}"}]}]},status:{tagName:"div",attributes:{part:"status",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"status-line"},children:["Connected to Pages project ",{tagName:"strong",attributes:{part:"project-name"},textContent:"${state.deployProject}"},{tagName:"span",attributes:{part:"site-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasProductionUrl"},cases:{true:{tagName:"span",children:[" — ",{tagName:"a",attributes:{part:"link",href:"${state.productionUrl}",target:"_blank",rel:"noreferrer"},textContent:"${state.productionUrl}"}]}}}]},{tagName:"div",attributes:{part:"deployment-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasDeployment"},cases:{true:{tagName:"p",attributes:{part:"deployment"},children:["Latest deployment: ",{tagName:"strong",attributes:{part:"deployment-state"},textContent:"${state.deploymentState}"}," (${state.deploymentEnvironment}) — ",{tagName:"a",attributes:{part:"link",href:"${state.deploymentUrl}",target:"_blank",rel:"noreferrer"},textContent:"preview"}]},false:{tagName:"p",attributes:{part:"deployment"},textContent:"No deployments yet — the first commit after connecting triggers one."}}},{tagName:"p",attributes:{part:"hint"},textContent:"Publishing happens automatically on every commit."},{tagName:"div",attributes:{part:"actions"},children:[{tagName:"jx-button",$props:{disabled:{$ref:"#/state/busy"}},attributes:{part:"refresh"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/refresh"},value:[]}]},children:[{tagName:"span",textContent:"Refresh"}]},{tagName:"jx-button",$props:{variant:"negative",disabled:{$ref:"#/state/busy"}},attributes:{part:"disconnect"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/disconnect"},value:[]}]},children:[{tagName:"span",textContent:"Disconnect"}]}]}]}}},{tagName:"div",attributes:{part:"failure-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasFailure"},cases:{true:{tagName:"p",attributes:{part:"failure"},children:["${state.failure}",{tagName:"span",attributes:{part:"pages-app-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/needsPagesApp"},cases:{true:{tagName:"span",children:[" — if the Cloudflare Pages GitHub App is not installed on the repository, ",{tagName:"a",attributes:{part:"install-link",href:"${state.pagesAppUrl}",target:"_blank",rel:"noreferrer"},textContent:"install it"}," and retry."]}}}]}}}]}]};T("publish",C);var D="https://github.com/apps/cloudflare-pages/installations/new";function I(e){if(!e.supported)return"unsupported";if(e.loading)return"loading";if(e.connected&&e.lapsed)return"lapsed";if(!e.connected){if(e.hosted)return"hosted";return e.tokenStored&&!e.replacing?"stored":"token"}return e.deploy?"status":"form"}function w(e){let{error:t}=e;return{accountId:e.form.accountId,accountOptions:e.accounts,body:I(e),branch:e.form.branch,busy:e.busy,connectLabel:e.busy?"Reconnecting…":"Reconnect Cloudflare",deploymentEnvironment:e.deployment?.environment??"",deploymentState:e.deployment?`${e.deployment.stage}: ${e.deployment.status}`:"",deploymentUrl:e.deployment?.url??"",deployProject:e.deploy?.projectName??"",failure:t,hasDeployment:e.deployment!==null,hasFailure:t!=="",hasProductionUrl:(e.deploy?.productionUrl??"")!=="",needsPagesApp:/github/i.test(t)&&/app|install|source|repo/i.test(t),owner:e.form.owner,pagesAppUrl:D,productionUrl:e.deploy?.productionUrl??"",projectName:e.form.projectName,repo:e.form.repo,submitLabel:e.busy?"Connecting…":"Create & Connect"}}function j(e){let t=document.createElement("div");t.style.pointerEvents="auto",e.layer.append(t);let n="",m=!1,N=()=>{if(m)return;m=!0,e.onClosed()},P=()=>m,d=g({...w(e.view),closed:N,connect:()=>{e.onConnect()},disconnect:()=>{e.onDisconnect()},openAccounts:()=>{e.onOpenAccounts()},refresh:()=>{e.onRefresh()},replace:()=>{n="",e.onReplaceToken()},setAccount:(o)=>{d.accountId=o,e.onField("accountId",o)},setBranch:(o)=>{d.branch=o,e.onField("branch",o)},setOwner:(o)=>{d.owner=o,e.onField("owner",o)},setProjectName:(o)=>{d.projectName=o,e.onField("projectName",o)},setRepo:(o)=>{d.repo=o,e.onField("repo",o)},setToken:(o)=>{n=o},submit:()=>{e.onSubmit()},verify:()=>{let o=n;n="",e.onSaveToken(o)}}),y=null,A=R("publish",d,t).then(async(o)=>{y=o;let u=o.root;if(P())return o.dispose(),u;if(await Jt(u),P())return u;return(u.querySelector('dialog[part="dialog"]')??u).setAttribute(Ue,ft("modal","publish")),Ot(u),u});return{close(){let o=y?.root;if(o instanceof HTMLElement)Nt(o);y?.dispose(),y=null,n="",t.remove(),N()},host:t,ready:A,update(o){Object.assign(d,w(o))}}}var f=null,i="loading",h=[],l=null,r="",c=!1,b=!1,a={accountId:"",branch:"main",owner:"",projectName:"",repo:""};function x(){return S?.projectConfig??null}function O(e){return e.toLowerCase().replaceAll(/[^a-z0-9]+/g,"-").replaceAll(/^-+|-+$/g,"").slice(0,58)||"site"}function H(){let e=p().projectRoot,t=/^([\w.-]+)\/([\w.-]+)(?:@.+)?$/.exec(e);return t?{owner:t[1],repo:t[2]}:{owner:"",repo:""}}function L(){let e=/^[\w.-]+\/[\w.-]+@[^:]+:(.+)$/.exec(p().projectRoot)?.[1]??"";return Rl(e)??""}function U(){let e=Ri();return e?{productionUrl:e.productionUrl??"",projectName:e.projectName}:null}function k(){let e=zl(),t=i==="loading"?null:i;return{accounts:h.map((n)=>({label:n.name,value:n.id})),busy:c,connected:t?.connected===!0,deploy:U(),deployment:l?{environment:l.environment,stage:l.stage,status:l.status,url:l.url}:null,error:r,form:{...a},hosted:e&&Q(p().cfConnect),lapsed:t?.connected===!0&&t.needsReconnect===!0,loading:i==="loading",replacing:b,supported:e,tokenStored:cb()!==""}}function s(){if(f){f.update(k());return}f=j({layer:tt("modal"),onClosed:B,onConnect:()=>{M()},onDisconnect:()=>{z()},onField:(e,t)=>{a={...a,[e]:t}},onOpenAccounts:_,onRefresh:()=>{v()},onReplaceToken:()=>{b=!0,r="",s()},onSaveToken:(e)=>{E(e)},onSubmit:()=>{V()},view:k()})}async function v(){i="loading",s();try{if(i=await p().cfConnection?.()??null,i?.connected&&!i.needsReconnect){h=await lN(),a={...a,accountId:i.accountId??h[0]?.id??""};let e=Ri();if(e)l=await Sb(e),Nd(l)}}catch(e){i=null,r=e instanceof Error?e.message:String(e)}s()}async function E(e){let t=e.trim();if(!t){r="Paste a token, or use Preferences › Accounts to forget the stored one.",s();return}DE(t),b=!1,r="",await v()}function _(){ae()?.run("app.preferences",{section:"accounts"})}async function M(){c=!0,r="",s();try{let e=await p().cfConnect?.()??null;if(e?.status==="timeout")r="The Cloudflare window didn't finish. Sign in there, then reconnect — nothing was changed.";else if(e?.status==="connected"&&!e.connection.accountId){let{openCfAccountPicker:t}=await (le("2e06qxey"),import("./cf-account-picker-2e06qxey.js"));await t()}}catch(e){r=e instanceof Error?e.message:String(e)}c=!1,ds(),await v()}async function V(){let e=x();if(!e)return;if(!a.projectName||!a.owner||!a.repo||!a.accountId){r="Account, project name, and the GitHub owner/repo are all required.",s();return}c=!0,r="",s();try{let t=L(),n={accountId:a.accountId,owner:a.owner,productionBranch:a.branch||"main",projectName:a.projectName,repo:a.repo};if(t)n.rootDir=t;let m=await cN(e,n);l=await Sb(m).catch(()=>null)}catch(t){r=t instanceof Error?t.message:String(t)}c=!1,s()}async function z(){let e=x();if(!e)return;c=!0,s();try{await qT(e,null),l=null}catch(t){r=t instanceof Error?t.message:String(t)}c=!1,s()}function B(){let e=f;f=null,e?.close()}function wk(e){i={accountId:e.accountId??"demo-account",connected:!0},h=[],l=e.deployment,Nd(e.deployment),r="",c=!1,b=!1,s()}function K2(){let e=x(),{owner:t,repo:n}=H();i="loading",h=[],l=null,r="",c=!1,b=!1,a={accountId:"",branch:"main",owner:t,projectName:Ri()?.projectName??O(e?.name??""),repo:n},s(),v()}
2
+ export{Rl,wk,K2};
3
+
4
+ //# debugId=9F3334C857B4DE0E64756E2164756E21
5
+ //# sourceMappingURL=studio-6k9djnxw.js.map
@@ -0,0 +1,9 @@
1
+ import{p,_e}from"./studio-9ndgd55w.js";import{te}from"./studio-psh8mwnw.js";import{ge,Qs,ne,g}from"./studio-tfmhnwyr.js";import{ln,wx,Yl,Bi,Un,Y,qd,m,jt}from"./studio-ztppbam0.js";import{kv}from"./studio-a6e5fzve.js";import{Lo}from"./studio-8pne0rx4.js";import{us}from"./studio-by8x0jvc.js";import{Js,nn,Rp}from"./studio-t6dqnnft.js";import{tr}from"./studio-vtey9w98.js";import{Id,Cs,gp,jl,Rc}from"./studio-fg4fj9ec.js";import{ae}from"./studio-qs5fmhtj.js";import{wi,T,R}from"./studio-myb4mf0h.js";import{yr,Yu,$S,Eb,di,Vl}from"./studio-0rg30pvs.js";import{er,YD}from"./studio-x2trkhk5.js";import{Fl,mp}from"./studio-nfmpmkqb.js";import{ya,Ic,FD,jD}from"./studio-n4qq1n57.js";import{xp}from"./studio-732mw0g8.js";import{S}from"./studio-9ra9e7m4.js";import{Se}from"./studio-nfwacw31.js";import{n,Z,Ze,_,v}from"./studio-ywf9y1e2.js";import{le}from"./studio-k5n4es74.js";var he=["title","name","label","heading"];function hp(e,t={}){let r=(i)=>{for(let o of he){let s=i.find((a)=>a.toLowerCase()===o);if(s!==void 0)return s}return null};return r(Object.keys(e?.properties??{}))??r(Object.keys(t).filter((i)=>n(t[i])))}function j(e){if(e instanceof Date)return ob(e);if(n(e))return e;if(Z(e)||Ze(e))return String(e);if(Array.isArray(e))return e.filter((t)=>n(t)||Z(t)).map(String).join(", ");return""}function be(e,t){return Object.fromEntries(Object.keys(e?.properties??{}).filter((r)=>(r in t)).map((r)=>[r,j(t[r])]))}var xe=["date","published","publishedAt","pubDate","publishDate"];function V_(e,t){for(let[r,i]of Object.entries(e?.properties??{}))if(i.format==="date"||i.format==="date-time")return r;return xe.find((r)=>(r in t))??null}function yE(e){let t=e?.properties??{};return V_(e,Object.fromEntries(Object.keys(t).map((r)=>[r,""])))}function ob(e){if(e instanceof Date)return Number.isNaN(e.getTime())?"":e.toISOString().slice(0,10);if(!n(e))return"";let t=/^(\d{4}-\d{2}-\d{2})/.exec(e.trim());if(t)return t[1];let r=new Date(e);if(e.trim()===""||Number.isNaN(r.getTime()))return"";if(!e.includes(":")){let i=String(r.getMonth()+1).padStart(2,"0"),o=String(r.getDate()).padStart(2,"0");return`${r.getFullYear()}-${i}-${o}`}return r.toISOString().slice(0,10)}function P(e){let t=e.split("/").pop()??e,r=t.lastIndexOf(".");return r>0?t.slice(0,r):t}function B(e,t){if(t.startsWith("/"))return`public${t}`;let r=e.includes("/")?e.slice(0,e.lastIndexOf("/")):"",i=[...r===""?[]:r.split("/"),...t.split("/")],o=[];for(let s of i){if(s===""||s===".")continue;if(s==="..")o.pop();else o.push(s)}return o.join("/")}var W=/^[a-z][\d+.a-z-]*:/i;function Ee(e,t){let r=t.trim();if(r==="")return"";return W.test(r)?r:tr(B(e,r))}function q(e){if(n(e))return e.split(",")[0]?.trim()??"";if(Array.isArray(e)){let[t]=e;return t===void 0?"":q(t)}if(v(e)){let{src:t}=e;return n(t)?t:""}return""}function U(e){if(e.format==="image")return!0;let t=e.properties?.src;if(e.type==="object"&&t?.type==="string")return!0;return e.type==="array"&&e.items!==void 0&&U(e.items)}function wE(e,t,r){for(let[i,o]of Object.entries(r?.properties??{}))if(U(o)){let s=Ee(e,q(t[i]));if(s!=="")return s}for(let i of Object.values(t)){if(!n(i)||W.test(i))continue;let o=i.lastIndexOf(".");if(o>0&&Rp(i.slice(o)))return tr(B(e,i))}return""}function X(e,t,r){let i=ya(t)?.schema??null,o=hp(i,r),s=o===null?void 0:r[o],a=jl(r),l=V_(i,r);return{date:l===null?"":ob(r[l]),fields:be(i,r),path:e,status:Rc(i,r)?a?"Draft":"Published":"",thumb:wE(e,r,i),title:n(s)&&s.trim()!==""?s:P(e)}}async function we(e){try{let t=await p().readFile(e);if(e.endsWith(".json")){let o=JSON.parse(t);return _(o)&&!Array.isArray(o)?o:{}}let{parseSourceForPath:r}=await (le("kkhp9ma7"),import("./file-ops-kkhp9ma7.js"));return(await r(e,t)).frontmatter}catch{return{}}}var E=new Map,x=new Map,N=0,F=new Set,K=200;async function Fe(e,t){let r=t.slice(0,K),i=await Promise.all(r.map(async(s)=>X(s,e,await we(s)))),o=t.slice(K).map((s)=>({date:"",path:s,status:"",thumb:"",title:P(s)}));return[...i,...o]}function iw(e,t){let r=t.join(`
2
+ `),i=E.get(e);if(i?.key===r)return i.entries;if(!_e())return t.map((s)=>({date:"",path:s,status:"",thumb:"",title:P(s)}));let o=`${e}
3
+ ${r}`;if(!x.has(o)){let s=N,a=Fe(e,t).then((l)=>{if(x.get(o)===a)x.delete(o);if(s===N){E.set(e,{entries:l,key:r});for(let c of F)c()}return l});x.set(o,a)}return null}function Le(e,t,r){let i=E.get(t),o=i?.entries.findIndex((a)=>a.path===e)??-1;if(!i||o===-1)return!1;let s=i.entries.with(o,X(e,t,r));E.set(t,{entries:s,key:i.key});for(let a of F)a();return!0}function hD(e,t){let r=Vl(e);if(e===null||r===null||r===di)return!1;return Le(e,r,t)}function xE(){N+=1,E.clear(),x.clear()}function ow(e){return F.add(e),()=>{F.delete(e)}}var ve=/^\d{4}-\d{2}-\d{2}/,y="entry",b=g(new Map);function O(e){let t=b.get(e.id);if(t===void 0)return null;if("key"in t)return t.key;return er(e)?.state.rows[t.row]?.key??null}function Ce(e){return b.has(e.id)}function k(e,t){b.set(e.id,{key:t})}function Te(e){b.delete(e.id)}function h(e){return Ce(e)&&er(e)!==null}function Q(e){let t=er(e),r=O(e);if(!t||r===null)return{};let i={};for(let o of t.state.columns){let s=t.buffer.effectiveValue(r,o.field);if(s===null||s==="")continue;if(o.kind==="date"&&n(s)&&!ve.test(s)){i[o.field]=ob(s)||s;continue}i[o.field]=_(s)&&!Array.isArray(s)?s.$ref:s}return i}function Re(e){if(e===void 0||e===null)return null;if(Array.isArray(e))return e.map((t)=>n(t)?t:JSON.stringify(t));if(n(e)||Z(e)||Ze(e))return e;return JSON.stringify(e)}function A(e,t){let r=er(e),i=O(e);if(!r||i===null)return;let o=new Set(r.state.columns.map((s)=>s.field));r.buffer.group(()=>{for(let[s,a]of Object.entries(t))if(o.has(s))r.buffer.setCell(i,s,Re(a))})}function w(e){let t=er(e),r=O(e),i=t?.state.rows??[],o=r===null?-1:i.findIndex((s)=>s.key===r);return{index:o,next:o===-1?null:i[o+1]?.key??null,previous:o<=0?null:i[o-1]?.key??null,total:i.length}}async function pD(e,t){let{openFileInTab:r}=await (le("yswdhxrf"),import("./files-yswdhxrf.js"));await r(e);let i=m.tabs.get(e)??null;if(!i||!er(i))return i;if(!b.has(i.id))i.scope.run(()=>{Qs(()=>Te(i))});if(b.set(i.id,{row:t}),!i.capabilities.modes.includes(y))i.capabilities.modes.unshift(y);return i.session.ui.canvasMode=y,i.session.ui.preview=!1,jt(i.id),i}function ee(e){return e.doc.sourceFormat==null&&e.doc.mode!=="content"}function Pl(e){if(h(e))return Q(e);return ee(e)?e.doc.document:e.doc.content.frontmatter}function De(e,t,r){let i=e.doc.document,o=Object.hasOwn(i,t)?Se(i[t]):void 0,s=r===void 0||r===null||r==="";if(s)delete i[t];else i[t]=r;let a=s?void 0:Se(r);Bi({forward:{key:t,op:"set-key",path:[],value:a},inverse:{key:t,op:"set-key",path:[],value:o}}),e.doc.dirty=!0,YD()}function I(e,t,r){if(h(e))A(e,{[t]:r});else if(ee(e))De(e,t,r);else qd(e,t,r)}function U_(e,t){if(h(e)){A(e,t);return}Y(e,(r)=>{for(let[i,o]of Object.entries(t))I(r,i,o)})}var re={$schema:"https://jxsuite.com/schema/v1",$id:"StudioEntryEditor",$description:"The Entry editor (site-architecture.md §7.4) — one content entry's fields, in a pane, as a Jx document over the kit. The adapter (`surfaces/entry-editor.ts`) hands in a projection; `content/entry-editor.ts` decides everything in it — which collection the file belongs to, which record its fields live in, which required keys are absent and what a draft flag commits into. The FORM is an island: a schema is `ui/schema-form.ts`'s subject, so this document renders an empty `fields` node and the flow places the element that engine hands back (studio-ui-guidelines.md §9.3, §9.4). That is the whole of the difference between this and the card the lit version drew, and it is why the engine converting in batch 7 is what unblocked this one.",tagName:"div",attributes:{part:"entry","data-jx-region":"${state.region}"},style:{$description:"What `.entry-editor`, `.entry-editor-header`, `.entry-editor-collection`, `.entry-draft-switch`, `.entry-editor-fields`, `.entry-editor-note` and `.entry-editor-empty` said in `styles/overlays.css`, keyed on `part` and re-pointed at the studio token layer. This editor was the only emitter of all seven, so those rules are dead in the stylesheet from here; a central sweep removes them rather than this change, which owns no stylesheet. Every `--spectrum-font-size-*` reference is gone rather than renamed: those names resolve only inside `<sp-theme>`, and a pane editor is mounted outside it, so each would silently have taken its hard-coded fallback.",height:"100%",padding:"var(--jx-space-5)",overflowY:"auto",background:"var(--bg-panel)",'& [part="header"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-4)",marginBottom:"var(--jx-space-5)"},'& [part="name"]':{margin:"0",fontSize:"var(--jx-text-lg)",fontWeight:"600",color:"var(--fg)"},'& [part="collection"]':{padding:"1px var(--jx-space-3)",borderRadius:"var(--radius)",background:"var(--bg)",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="draft"]':{$description:"Pushed to the far end of the header rather than placed there: the heading and the collection chip are both content-width, so `margin-left: auto` is what keeps the switch on the right edge whatever the entry is called.",marginLeft:"auto"},'& [part="fields"]':{$description:"The schema form's host is `display: contents`, so its rows are the flex items of THIS box — which is why the column lives here and not inside the engine.",display:"flex",flexDirection:"column"},'& [part="note"]':{margin:"0 0 var(--jx-space-4)",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)",lineHeight:"1.5"},'& [part="empty"]':{display:"flex",maxWidth:"46ch",flexDirection:"column",alignItems:"flex-start",gap:"var(--jx-space-3)",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)",lineHeight:"1.5"},'& [part="record-nav"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-2)",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"}},children:[{tagName:"div",attributes:{part:"stage-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/stage"},cases:{entry:{tagName:"div",attributes:{part:"body",role:"none"},style:{display:"contents"},children:[{tagName:"div",attributes:{part:"header"},children:[{tagName:"h3",attributes:{part:"name"},textContent:"${state.name}"},{tagName:"span",attributes:{part:"collection"},textContent:"${state.collection}"},{tagName:"div",attributes:{part:"record-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/recordNav"},cases:{shown:{$description:"A record of a file-backed collection (a CSV row): which row of the file this is, the rows either side of it, and the grid that shows them all. A file entry has no neighbours to step to, so it draws none of this.",tagName:"div",attributes:{part:"record-nav",role:"group","aria-label":"Records"},children:[{tagName:"jx-action-button",attributes:{part:"previous"},$props:{size:"sm",quiet:!0,label:"Previous record",hint:"Previous record",disabled:{$ref:"#/state/previousDisabled"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/showPrevious"},value:[]}]},children:[{tagName:"span",textContent:"‹ Previous"}]},{tagName:"span",attributes:{part:"place"},textContent:"${state.place}"},{tagName:"jx-action-button",attributes:{part:"next"},$props:{size:"sm",quiet:!0,label:"Next record",hint:"Next record",disabled:{$ref:"#/state/nextDisabled"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/showNext"},value:[]}]},children:[{tagName:"span",textContent:"Next ›"}]},{tagName:"jx-action-button",attributes:{part:"grid"},$props:{size:"sm",quiet:!0,label:"Edit in grid",hint:"Every record of the file, as a table"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openGrid"},value:[]}]},children:[{tagName:"span",textContent:"Edit in grid"}]}]}}},{tagName:"div",attributes:{part:"draft-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/draftAxis"},cases:{shown:{$description:"No `label`: the slotted word is on screen and carries the name, so an aria-label would be read twice. The tooltip is `hint`, which is what DRAFT_MEANING has always been.",tagName:"jx-switch",attributes:{part:"draft"},$props:{checked:{$ref:"#/state/draft"},hint:"${state.draftHint}",size:"sm"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setDraft"},value:[{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Draft"}]}}}]},{tagName:"div",attributes:{part:"note-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/noteState"},cases:{shown:{tagName:"p",attributes:{part:"note"},textContent:"${state.note}"}}},{$description:"An island: `ui/schema-form.ts` draws this entry's fields into this node, and nothing in this document knows what a schema is.",tagName:"div",attributes:{part:"fields","data-jx-region":"${state.fieldsRegion}"}}]},empty:{$description:"The mode is reachable from the palette and from `__jxAutomation` on any tab, so this state is real: it names the reason and the fix rather than drawing an empty form.",tagName:"div",attributes:{part:"empty"},children:[{tagName:"p",attributes:{part:"empty-line"},textContent:"${state.emptyLine}"},{tagName:"p",attributes:{part:"note"},children:[{tagName:"span",textContent:"A collection is a "},{tagName:"code",textContent:"content"},{tagName:"span",textContent:" entry in "},{tagName:"code",textContent:"project.json"},{tagName:"span",textContent:" whose "},{tagName:"code",textContent:"source"},{tagName:"span",textContent:" directory contains this file and which declares a "},{tagName:"code",textContent:"schema"},{tagName:"span",textContent:"."}]},{tagName:"jx-action-button",attributes:{part:"content-types"},$props:{label:"Content types",size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openContentTypes"},value:[]}]},children:[{tagName:"span",textContent:"Content types…"}]}]}}}]};T("entry-editor",re);function ie(e,t){e.region=t.region,e.fieldsRegion=t.fieldsRegion,e.stage=t.stage,e.name=t.name,e.collection=t.collection,e.draftAxis=t.draftAxis,e.draft=t.draft,e.draftHint=t.draftHint,e.noteState=t.noteState,e.note=t.note,e.emptyLine=t.emptyLine,e.recordNav=t.recordNav,e.place=t.place,e.previousDisabled=t.previousDisabled,e.nextDisabled=t.nextDisabled}function je(e){let t=n(e)?void 0:e.attributes?.part;return n(t)?t:""}function oe(e,t,r,i){e.replaceChildren();let o=g({collection:"",draft:!1,draftAxis:"hidden",draftHint:"",emptyLine:"",fieldsRegion:"",name:"",nextDisabled:!0,note:"",noteState:"hidden",openContentTypes:r.openContentTypes,openGrid:r.openGrid,place:"",previousDisabled:!0,recordNav:"hidden",region:"",setDraft:r.setDraft,showNext:r.showNext,showPrevious:r.showPrevious,stage:"empty"});ie(o,t);let s=null,a=!1,l=R("entry-editor",o,e,{onNodeCreated:(c,d,f)=>{if(c instanceof HTMLElement&&je(f)==="fields")i.fieldsSlot(c)}}).then((c)=>{let d=c.root;if(a)return c.dispose(),d;return s=c,d});return{attached:()=>{if(a)return!1;let c=s?.root;return c===void 0?!0:c instanceof HTMLElement&&e.contains(c)},dispose(){a=!0,s?.dispose(),s=null},ready:l,update:(c)=>ie(o,c)}}var H=g(new Map);function se(e,t){H.set(e,t)}function fD(e){return e?H.get(e):void 0}function mD(e){H.delete(e)}function M(e){return e.replaceAll("\\","/").replace(/^(?:\.\/)+/,"").replace(/\/+$/,"")}function Pe(e){if(e.endsWith("/"))return!1;let t=e.slice(e.lastIndexOf("/")+1);return/\.[a-z\d]+$/i.test(t)}function ce(e,t){let r=[];for(let s of e)r.push(M(s));let i=[],o=t?.content??{};for(let s of Object.values(o)){if(!n(s.source)||s.source===""||Pe(s.source))continue;let a=M(s.source),l=a.indexOf(Lo);if(l!==-1)a=M(a.slice(0,l));if(a===""||a===".")continue;if(![...r,...i].some((d)=>a===d||a.startsWith(`${d}/`)))i.push(a)}return i.length===0?e:[...e,...i]}function Oe(e,t){let r=Vl(e);if(r===null)return null;if(r===di)return t===void 0||Yu(e,t)?r:null;let i=Un(e);if(!i||i.name!==r||!i.def.format||i.ext===null)return r;return e.toLowerCase().endsWith(i.ext.toLowerCase())?r:null}var ke=new Set(["node_modules",".git",".jx",".cache"]);async function de(e,t,r,i,o,s=!1,a){let l;try{l=await us(()=>t.listDirectory(e))}catch(d){if(!s)i.push({dir:e,error:te(d)});return}let c=[];for(let d of l){if(d.type==="directory"){if(!ke.has(d.name))c.push(d.path);continue}let f=nn(d.name);r.push({collection:Oe(d.path,a),ext:f,locale:wx(d.path,o)??void 0,media:Js.has(f),modified:d.modified,name:d.name,path:d.path,size:d.size,type:f||"file"})}await Promise.all(c.map((d)=>de(d,t,r,i,o,!1,a)))}async function cm(e,t,r=new Set,i){let o=[],s=[],{i18n:a}=ln(S?.projectConfig??{});return await Promise.all(e.map((l)=>de(l,t,o,s,a,r.has(l),i))),o.sort((l,c)=>l.path.localeCompare(c.path)),{failures:s,files:o}}function _E(e,t){let r=e.filter((s)=>s.collection===t.collection),i=t.query.trim().toLowerCase();if(i)r=r.filter((s)=>s.name.toLowerCase().includes(i)||s.path.toLowerCase().includes(i));let o=t.locale?.trim();if(o)r=r.filter((s)=>s.locale===o);return r}var dm=["table","cards","calendar","board"],rw={board:"Board",calendar:"Calendar",cards:"Cards",table:"Table"};var gD=new Set(["cards"]),Ae=/^(\d{4}-\d{2}-\d{2})/;function SE(e){let t=Ae.exec(e.name);if(t)return t[1];if(e.modified){let r=xp(new Date(e.modified));if(r)return r}return null}function rb(){return ln(S?.projectConfig??{}).i18n?.locales??[]}function bD(e){let t=new Set;for(let r of e)if(r.locale)t.add(r.locale);return rb().filter((r)=>t.has(r))}function vD(e,t=SE){let r=new Map,i=[];for(let s of e){let a=t(s);if(a===null){i.push(s);continue}let l=r.get(a);if(l)l.push(s);else r.set(a,[s])}return{days:[...r.entries()].map(([s,a])=>({date:s,files:a})).toSorted((s,a)=>a.date.localeCompare(s.date)),undated:i}}function $e(e){let t=e.lastIndexOf("/");return t===-1?".":e.slice(0,t)}function yD(e){let t=new Map;for(let r of e){let i=$e(r.path),o=t.get(i);if(o)o.push(r);else t.set(i,[r])}return[...t.entries()].map(([r,i])=>({files:i,group:r})).toSorted((r,i)=>r.group.localeCompare(i.group))}function Ie(e,t,r,i){let o=hp(e,t),s=o===null?"":t[o]??"",a=Object.values(t).find((l)=>l.trim()!=="");return(s||a||i||`Row ${r+1}`).trim()}function He(e){let{headers:t,rows:r}=Id(e);return r.flatMap((i,o)=>i.some((s)=>s.trim()!=="")?[{fields:Object.fromEntries(t.map((s,a)=>[s,i[a]??""])),row:o}]:[])}function Me(e){let t;try{t=JSON.parse(e)}catch{return null}let r=(i)=>_(i)&&!Array.isArray(i)?Object.fromEntries(Object.entries(i).map(([o,s])=>[o,j(s)])):{};if(!Array.isArray(t))return[{fields:r(t),row:0,single:!0}];return t.map((i,o)=>({fields:r(i),row:o}))}function ue(e,t,r){let i=e.toLowerCase(),o=i.endsWith(".csv")?He(t):i.endsWith(".json")?Me(t):null;if(o===null)return null;let s=(e.split("/").pop()??e).replace(/\.[^.]+$/,"");return o.map(({fields:a,row:l,single:c},d)=>({fields:a,index:d,row:l,title:Ie(r,a,d,c?s:"")}))}function fe(e,t){return`${e}#${t+1}`}var G="The Content workspace lists files; it does not edit them in the list. Rename, duplicate or delete from the file's context menu, or open the file to edit it.";function Ge(e){return`field:${e}`}function wD(e){return e.startsWith("field:")?e.slice(6):null}var Ve=6,me=new Set(["image","markdown","html","richtext"]);function V(e){return Eb($S(e))}function xD(e,t){return Object.entries(e?.properties??{}).filter(([r,i])=>{if(t.has(r)||r===Cs)return!1;if(i.type==="object"||n(i.format)&&me.has(i.format))return!1;let o=i.items?.format;return i.type!=="array"||i.items?.type==="string"&&!(n(o)&&me.has(o))}).slice(0,Ve).map(([r,i])=>{let o={name:r,title:V(r)};if(i.type==="array")o.list=!0;if(i.type==="number"||i.type==="integer"||i.format==="date"||i.format==="date-time")o.measure=!0;return o})}function Je(e){let t=[{editable:!1,field:"title",kind:"string",title:"Title",widthHint:240},{editable:!1,field:"url",kind:"string",pk:!0,title:"URL",widthHint:200},{editable:!1,field:"template",kind:"string",title:"Template",widthHint:140}];if(e?.status)t.push({editable:!1,field:"status",kind:"string",title:"Status",widthHint:100});if(e?.locale)t.push({editable:!1,field:"locale",kind:"string",title:"Language",widthHint:110});return t.push({editable:!1,field:"modified",kind:"date",title:"Edited",widthHint:120}),t}function CE(e=di,t){let r=[...t?.locale?[{editable:!1,field:"locale",kind:"string",title:"Locale",widthHint:90}]:[],{editable:!1,field:"modified",kind:"date",title:"Modified",widthHint:160},{editable:!1,field:"path",kind:"readonly",title:"Path",widthHint:320}];if(e===di)return Je(t);let i=[{editable:!1,field:"title",kind:"string",title:"Title",widthHint:260}];if(t?.status)i.push({editable:!1,field:"status",kind:"string",title:"Status",widthHint:100});if(t?.date)i.push({editable:!1,field:"date",kind:"date",title:"Date",widthHint:120});for(let o of t?.fields??[])i.push({editable:!1,field:Ge(o.name),kind:"string",title:o.title,widthHint:140});return[...i,...r]}function ze(e){return{cells:{locale:e.locale??null,modified:e.modified??null,status:null,template:null,title:e.name,url:e.collection===di?yr(e.path).urlPattern:null},key:e.path}}async function Ke(e,t){return(await Promise.all(e.map(async(i)=>{let o=i.collection===null?null:Un(i.path);if(!o?.fileBacked)return[i];let s;try{s=await t(i.path)}catch{return[i]}let a=ue(i.path,s,o.def.schema);if(a===null)return[i];return a.map((l)=>Ye(i,l))}))).flat()}function Ye(e,t){return{...e,name:t.title,path:fe(e.path,t.index),record:{fields:t.fields,row:t.row,source:e.path}}}async function Be(e){let t=p(),r=await Ke(e.files,(i)=>t.readFile(i));return{...e,files:r}}function _D(e){let t=null,r=null,i=null,o=e??(()=>ce(S?.projectDirs??[],S?.projectConfig??null));async function s(){if(t)return t;let a=o(),l=new Set(e?a:S?.projectDirs??[]),c=new Set(a.filter((d)=>!l.has(d)));return r??=kv().then((d)=>cm(a,p(),c,d)).then(Be).then((d)=>(t=d,i=a.join(`
4
+ `),r=null,d)),r}return{capabilities:{delete:!1,insert:!1,remotePaging:!1,remoteSort:!1},columns:()=>Promise.resolve(CE()),commit(a){return Promise.resolve({cells:a.cells.map((l)=>({error:G,field:l.field,ok:!1,rowKey:l.rowKey})),deletes:a.deletes.map((l)=>({error:G,ok:!1,rowKey:l.rowKey})),inserts:a.inserts.map((l)=>({error:G,ok:!1,tempKey:l.tempKey}))})},failures:()=>t?.failures??[],files:()=>t?.files??[],id:Yl("content"),label:"Content",async refresh(){t=null,r=null,await s()},async rows(){let a=await s();return{rows:a.files.map((l)=>ze(l)),total:a.files.length}},scanned:()=>t!==null,stale:()=>t!==null&&i!==o().join(`
5
+ `)}}var We=[y],C=new Map;function J(e){return C.get(e)??null}function kE(e,t){let r=J(e);return r!==null&&r.tabId===t.id&&r.wrap.isConnected&&r.surface.attached()}function sw(e){let t=C.get(e);if(!t)return;t.scope.stop(),t.surface.dispose(),C.delete(e)}function sb(e,t){Y(e,(r)=>I(r,Cs,t))}function SD(e){let t=L(e),r=Pl(e);if(!t||!Rc(t.schema,r))return null;let i=jl(r);return{draft:i,text:i?"Draft":"Published",title:i?gp:"Not marked a draft."}}function EE(e){return Object.fromEntries(Object.entries(e?.properties??{}).map(([t,r])=>[t,{label:n(r.title)&&r.title!==""?r.title:V(t)}]))}function TE(e){return{fieldKeyPrefix:`entry:${e.id}`,resolvePointer:(t,r)=>mp(t,{projectConfig:S?.projectConfig??{},scope:r})}}function LE(e,t){return Object.fromEntries(jD(e.schema,t).map((r)=>[r,"Required — this entry does not have one."]))}function L(e){return h(e)?FD(e.documentPath):Ic(e.documentPath)}function $E(e,t,r){let i=hp(t,r),o=e.properties??{},s=i===null?void 0:o[i];if(i===null||s===void 0)return e;return{...e,properties:{[i]:s,...o}}}function qe(e){return`${e.documentPath??"This document"} is not an entry of any content collection, so there is no schema to draw a form from.`}function pe(e,t,r){let i=wi(e,"entry"),o=wi(e,"entry/fields");if(!r)return{collection:"",draft:!1,draftAxis:"hidden",draftHint:gp,emptyLine:qe(t),fieldsRegion:o,name:"",nextDisabled:!0,note:"",noteState:"hidden",place:"",previousDisabled:!0,recordNav:"hidden",region:i,stage:"empty"};let s=Pl(t),a=jl(s),l=h(t),c=w(t);return{collection:r.name,draft:a,draftAxis:Rc(r.schema,s)?"shown":"hidden",draftHint:gp,emptyLine:"",fieldsRegion:o,name:l?Ue(r,s,c.index):t.documentPath?.split("/").pop()??"Untitled",nextDisabled:c.next===null,note:gp,noteState:a?"shown":"hidden",place:c.index===-1?"":`${c.index+1} of ${c.total}`,previousDisabled:c.previous===null,recordNav:l?"shown":"hidden",region:i,stage:"entry"}}function Ue(e,t,r){let i=hp(e.schema,t),o=i===null?void 0:t[i];if(n(o)&&o.trim()!=="")return o.trim();return r===-1?"Record":`Row ${r+1}`}function CD(e,t){let{paneId:r,wrap:i}=e;if(kE(r,t))return;sw(r);let o=null,s=null,a=()=>{if(o!==null&&J(r)===o)c()},l=(u)=>{if(!s||!u)return;let D=Pl(t),z=Fl(`entry:${r}`,$E(u.schema,u.schema,D),D,{context:TE(t),errors:LE(u,D),onChange:(ye)=>U_(t,ye),rerender:a,ui:EE(u.schema)});if(z.parentNode!==s)s.replaceChildren(z)},c=()=>{let u=L(t);if(!u)s=null;o?.surface.update(pe(r,t,u)),l(u)},d=ge(),f=oe(i,pe(r,t,L(t)),{openContentTypes:()=>{ae()?.run("settings.open",{section:"content"})},openGrid:()=>{let{index:u}=w(t);if(u!==-1&&t.documentPath)se(t.documentPath,u);t.session.ui.canvasMode="grid"},setDraft:(u)=>sb(t,u),showNext:()=>{let{next:u}=w(t);if(u!==null)k(t,u)},showPrevious:()=>{let{previous:u}=w(t);if(u!==null)k(t,u)}},{fieldsSlot:(u)=>{s=u,l(L(t))}});o={paneId:r,scope:d,surface:f,tabId:t.id,wrap:i},C.set(r,o),d.run(()=>{ne(()=>{if(J(r)!==o)return;t.doc.document,t.doc.content.frontmatter,S?.projectConfig?.content,c()})})}async function kD(e){let{openFileInTab:t}=await (le("yswdhxrf"),import("./files-yswdhxrf.js"));await t(e);for(let[r,i]of m.tabs.entries()){if(i.documentPath!==e)continue;for(let o of We)if(!i.capabilities.modes.includes(o))i.capabilities.modes.unshift(o);return i.session.ui.canvasMode=y,i.session.ui.preview=!1,jt(r),i}return null}
6
+ export{hp,V_,yE,ob,wE,iw,hD,xE,ow,pD,Pl,U_,fD,mD,cm,_E,dm,rw,gD,SE,rb,bD,vD,yD,wD,xD,CE,_D,kE,sw,sb,SD,EE,TE,LE,$E,CD,kD};
7
+
8
+ //# debugId=80C250D2C840E90264756E2164756E21
9
+ //# sourceMappingURL=studio-6rbaedw2.js.map
@@ -0,0 +1,5 @@
1
+ function xp(t){if(Number.isNaN(t.getTime()))return"";let r=String(t.getMonth()+1).padStart(2,"0"),n=String(t.getDate()).padStart(2,"0");return`${String(t.getFullYear()).padStart(4,"0")}-${r}-${n}`}
2
+ export{xp};
3
+
4
+ //# debugId=9AD8167F1024EA6864756E2164756E21
5
+ //# sourceMappingURL=studio-732mw0g8.js.map
@@ -0,0 +1,7 @@
1
+ import{te}from"./studio-psh8mwnw.js";import{g,C}from"./studio-tfmhnwyr.js";import{Ot,Nt}from"./studio-qs5fmhtj.js";import{Ue,ft,T,R,Jt,tt}from"./studio-myb4mf0h.js";var _={$schema:"https://jxsuite.com/schema/v1",$id:"StudioGithubAuth",$description:"The RFC 8628 device flow's waiting room: the code GitHub minted, the page to type it into, and a Cancel. A `jx-dialog`, so the platform owns modality, Escape, focus restoration and the backdrop — and it is the reason the dialog has no confirm button at all: the answer arrives from GitHub over a poll rather than from anything the reader can press here, so a primary button would be a control with nothing to do. Nothing in this document talks to GitHub: `github/github-auth.ts` keeps the client id, the poll loop, its failure budget and every report the three outcomes raise.",tagName:"jx-dialog",$props:{headline:"Sign in to GitHub",confirmLabel:"",cancelLabel:"Cancel",size:"sm"},attributes:{part:"github-auth"},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/cancel"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},style:{$description:"Four `.github-auth-*` rules in `styles/overlays.css` become the parts below, and two things in them do not travel. `.github-auth-dialog`'s `padding: 16px 0` was the card's own body padding drawn by hand, and `jx-dialog` already pads its body; `.github-auth-dialog p { font-size: 13px }` was a body size this surface picked for itself, and what the paragraphs now inherit is the dialog's own `--jx-text-md`. The `8px 0` margins go with them — the column is a flex column with a gap, so a margin between two rows would be a second opinion about the same space. The code keeps its 24px, which is above the token scale on purpose: it is a string the reader has to copy onto another screen, and reading it out loud is the whole job of this dialog.",'& [part="device"]':{display:"flex",flexDirection:"column",alignItems:"center",gap:"var(--jx-space-3)",textAlign:"center"},'& [part="lede"], & [part="waiting"]':{margin:"0"},'& [part="code"]':{$description:"`<code>`, not a styled `<div>`: this is a literal string to be transcribed, and the element that says so is also the one a reader's own stylesheet and a screen reader's character-by-character mode already know about. It is this dialog's message, and the one string in it the reader must carry to another screen, so it opts back in to selection against the root's `user-select: none`. `all` rather than `text`: one click selects the whole code, so a copy never leaves a character behind.",userSelect:"all",fontFamily:"var(--font-mono)",fontSize:"24px",fontWeight:"700",letterSpacing:"2px",padding:"var(--jx-space-3) var(--jx-space-4)",background:"var(--hover-bg)",borderRadius:"var(--radius)"},'& [part="link"]':{$description:"The blue this carried as a `var(--accent, …)` fallback is gone: `--accent` is declared on `:root` in `styles/tokens.css`, so the fallback could only ever have painted when the token was missing — which is a theme fault to fix rather than a colour to hard-code.",color:"var(--accent)",textDecoration:"underline"},'& [part="waiting"]':{color:"var(--fg-dim)",fontStyle:"italic"}},children:[{tagName:"div",attributes:{part:"device"},children:[{tagName:"p",attributes:{part:"lede"},textContent:"Enter this code on GitHub to authorize Jx Studio:"},{tagName:"code",attributes:{part:"code"},textContent:"${state.userCode}"},{tagName:"a",attributes:{part:"link",href:"${state.verificationUri}",target:"_blank",rel:"noreferrer"},textContent:"Open ${state.verificationUri}"},{tagName:"p",attributes:{part:"waiting"},textContent:"Waiting for authorization…"}]}]};T("github-auth",_);function A(e){let t=document.createElement("div");t.style.pointerEvents="auto",t.setAttribute(Ue,ft("dialog","github-auth")),e.layer.append(t);let s=!1,l=()=>{if(s)return;s=!0,e.onClosed()},u=()=>s,b=g({cancel:()=>{e.onCancel()},closed:l,userCode:e.userCode,verificationUri:e.verificationUri}),n=null,r=R("github-auth",b,t).then(async(i)=>{n=i;let o=i.root;if(u())return i.dispose(),o;if(await Jt(o),u())return o;return Ot(o),o});return{close(){let i=n?.root;if(i instanceof HTMLElement)Nt(i);n?.dispose(),n=null,t.remove(),l()},host:t,ready:r}}var S="jx_github_token",v="Ov23liYVlMFpgjOEPXJH";function P(e){return typeof e==="object"&&e!==null&&"githubAuth"in e&&e.githubAuth!=null}function p(){let e=globalThis,t="__jxPlatform"in e?e.__jxPlatform:void 0;return P(t)?t.githubAuth:null}var f=null,H=!1;function E(e){f=e}function kT(){return f!==null||H||localStorage.getItem("jx_github_token")!==null}function ET(){return p()?"desktop":"browser"}function y(){return f??localStorage.getItem("jx_github_token")}function TT(){f=null,H=!1,localStorage.removeItem("jx_github_token"),p()?.signOut().catch(()=>{})}var O="github.auth",j="Source Control",N="git.signInToGithub",Y=3,z="The request never reached GitHub. GitHub's device-flow endpoints send no CORS headers, so a "+"browser cannot call them directly — the desktop app can. A machine that is offline fails "+"identically, and the browser does not say which happened.";function I(e){C.error("Could not reach GitHub to sign in.",{action:N,detail:`${z}
2
+
3
+ ${te(e)}`,key:O,source:j})}function w(e,t){C.warn(e,{action:N,detail:t,key:O,source:j})}async function F(){let e;try{e=await fetch("https://github.com/login/device/code",{body:JSON.stringify({client_id:v,scope:"repo"}),headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"})}catch(t){return I(t),null}if(!e.ok)return w("GitHub refused to start the sign-in.",`GitHub answered ${e.status}${e.statusText?` ${e.statusText}`:""}.`),null;return await e.json()}async function hS(){let e=y();if(e)return e;let t=p();if(t)try{let{token:r}=await t.signIn();return E(r),r}catch(r){return w("GitHub sign-in was not completed.",te(r)),null}let s=await F();if(!s)return null;let{device_code:l,user_code:u,verification_uri:b,interval:n=5}=s;return new Promise((r)=>{let i=!1,o=null,m=0,k=!1,L=(c)=>{if(k)return;if(k=!0,i=!0,o)clearTimeout(o),o=null;r(c)},x=!1,G=()=>{if(x)return;x=!0,D.close()},d=(c)=>{L(c),G()},h=async()=>{if(i)return;try{let a=await(await fetch("https://github.com/login/oauth/access_token",{body:JSON.stringify({client_id:v,device_code:l,grant_type:"urn:ietf:params:oauth:grant-type:device_code"}),headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"})).json();if(m=0,a.access_token){localStorage.setItem(S,a.access_token),d(a.access_token);return}if(a.error==="authorization_pending"){o=setTimeout(h,n*1000);return}if(a.error==="slow_down"){o=setTimeout(h,(n+5)*1000);return}w("GitHub sign-in was not completed.",a.error==="access_denied"?"The authorization was declined on GitHub.":a.error==="expired_token"?"The device code expired before it was entered.":`GitHub answered "${a.error??"an unrecognised response"}".`),d(null)}catch(c){if(m+=1,m>=Y){I(c),d(null);return}o=setTimeout(h,n*1000)}},D=A({layer:tt("dialog"),onCancel:()=>{G()},onClosed:()=>{d(null)},userCode:u,verificationUri:b});o=setTimeout(h,n*1000)})}
4
+ export{kT,ET,TT,hS};
5
+
6
+ //# debugId=9874028950EA5E4C64756E2164756E21
7
+ //# sourceMappingURL=studio-79r8msnr.js.map
@@ -0,0 +1,5 @@
1
+ import{p,_e}from"./studio-9ndgd55w.js";import{te}from"./studio-psh8mwnw.js";import{Q}from"./studio-ywf9y1e2.js";function hh(){return _e()&&Q(p().findReferences)}function u(e){return`${e.path??""}\x00${e.tagName??""}`}var i=new Map,o=new Map;function Bd(e){if(!hh())return{status:"unsupported"};return i.get(u(e))??(o.has(u(e))?{status:"pending"}:null)}async function La(e){if(!hh())return{status:"unsupported"};if(!e.path&&!e.tagName)return{status:"failed",message:"no target to look for"};let t=u(e),s=i.get(t);if(s)return s;let r=o.get(t);if(r)return r;let n={};if(e.path!==void 0)n.path=e.path;if(e.tagName!==void 0)n.tagName=e.tagName;let a=(async()=>{try{return{result:await p().findReferences(n),status:"ready"}}catch(c){return{message:te(c),status:"failed"}}})();o.set(t,a);let d=f,l=await a;if(o.get(t)===a)o.delete(t);if(d!==f)return l;return i.set(t,l),l}function k$(e){return i.delete(u(e)),La(e)}var f=0,g=new Set;function Sr(){f+=1,i.clear(),o.clear();for(let e of g)e()}function E$(e){return g.add(e),()=>{g.delete(e)}}function h(e){let t=0;for(let s of e.files)if(s.path.startsWith("pages/"))t+=1;return{others:e.files.length-t,pages:t}}function Xb(e){let{others:t,pages:s}=h(e);if(s===0&&t===0)return"Not used yet";let r=t===1?"file":"files";if(s===0)return`Used in ${t} ${r}`;let n=`Used on ${s} page${s===1?"":"s"}`;return t===0?n:`${n} and ${t} other ${r}`}function T$(e,t){if(e.status==="unsupported")return null;if(e.status==="pending")return"Counting references…";if(e.status==="failed")return`References could not be counted (${e.message}) — this may break more than it appears to.`;let{files:s,refsTotal:r}=e.result;if(s.length===0)return t==="delete"?"Nothing else in this project refers to it.":"Nothing else in this project refers to it, so nothing needs updating.";let n=`${r} reference${r===1?"":"s"} in ${s.length} file${s.length===1?"":"s"}`,a=e.result.errors.length>0?" (at least — some documents could not be read)":"";if(t==="delete")return`${n}${a} will break. Those files stay on disk; the references in them stop resolving.`;if(t==="convert")return`${n}${a} will be updated automatically to point at the new file.`;return`${n}${a} will be updated automatically. Nothing else changes.`}function Qb(e){return e.files.toSorted((t,s)=>s.count-t.count||t.path.localeCompare(s.path))}
2
+ export{hh,Bd,La,k$,Sr,E$,Xb,T$,Qb};
3
+
4
+ //# debugId=F361F04543F4725164756E2164756E21
5
+ //# sourceMappingURL=studio-7q6jdd4h.js.map