@jxsuite/studio 6.0.0 → 6.1.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 (159) hide show
  1. package/dist/chunks/{2020-cs2sb9t1.js → 2020-nkxms0ay.js} +3 -3
  2. package/dist/chunks/adapter-m948ab5f.js +4 -0
  3. package/dist/chunks/{cf-account-picker-bb2yq946.js → cf-account-picker-n8hr38v7.js} +3 -3
  4. package/dist/chunks/cf-settings-356xdtne.js +4 -0
  5. package/dist/chunks/components-yk3t844e.js +4 -0
  6. package/dist/chunks/content-source-bawmyc09.js +4 -0
  7. package/dist/chunks/{convert-to-repeater-vqkt7s3s.js → convert-to-repeater-7wns8kf1.js} +3 -3
  8. package/dist/chunks/editor-6sc8nacq.js +4 -0
  9. package/dist/chunks/entry-commands-8ay9fh81.js +4 -0
  10. package/dist/chunks/{extension-sections-8beq9ac3.js → extension-sections-na7rj3nr.js} +3 -3
  11. package/dist/chunks/file-ops-gye0qw56.js +4 -0
  12. package/dist/chunks/files-dmc2xvcq.js +4 -0
  13. package/dist/chunks/format-host-t76b53f8.js +4 -0
  14. package/dist/chunks/fs-events-cg4tpz06.js +4 -0
  15. package/dist/chunks/git-panel-yef7bshy.js +4 -0
  16. package/dist/chunks/{grid-view-ca10def6.js → grid-view-7tt4bxw1.js} +6 -6
  17. package/dist/chunks/iframe-host-tmz30gfp.js +4 -0
  18. package/dist/chunks/{index-9ydfe04y.js → index-gybvv7a6.js} +3 -3
  19. package/dist/chunks/index-nag78a9h.js +4 -0
  20. package/dist/chunks/{javascript-d9pqgc2p.js → javascript-rnvdp3k4.js} +2 -2
  21. package/dist/chunks/{jsonMode-800yvbem.js → jsonMode-zhwsprqk.js} +5 -5
  22. package/dist/chunks/jx-validate-3gbp5nkn.js +4 -0
  23. package/dist/chunks/layers-fvz99859.js +4 -0
  24. package/dist/chunks/layers-panel-gchmbf9p.js +4 -0
  25. package/dist/chunks/lit-html-9agdspkt.js +4 -0
  26. package/dist/chunks/media-picker-rhjvyy00.js +4 -0
  27. package/dist/chunks/menu-2e4y9j7b.js +4 -0
  28. package/dist/chunks/{monaco-binding-62dtmgbf.js → monaco-binding-2jnhjjvr.js} +3 -3
  29. package/dist/chunks/monaco-buffer-rp21359g.js +4 -0
  30. package/dist/chunks/{monaco-setup-tj13ndtm.js → monaco-setup-vhh7gayr.js} +3 -3
  31. package/dist/chunks/notify-h3www560.js +4 -0
  32. package/dist/chunks/platform-hz34wcd7.js +4 -0
  33. package/dist/chunks/publish-panel-exsmjzyj.js +4 -0
  34. package/dist/chunks/quick-search-pgaqeh0m.js +4 -0
  35. package/dist/chunks/references-2cgdxnb8.js +4 -0
  36. package/dist/chunks/right-panel-jf856w5w.js +4 -0
  37. package/dist/chunks/section-registry-jnf8r5gy.js +4 -0
  38. package/dist/chunks/studio-0f55h9ye.js +5 -0
  39. package/dist/chunks/{studio-hjbg8d5y.js → studio-0sqdhnew.js} +7 -7
  40. package/dist/chunks/{studio-1wvfxkyy.js → studio-0x3jyb8r.js} +4 -4
  41. package/dist/chunks/{studio-yr04mv2j.js → studio-19x1c75w.js} +4 -4
  42. package/dist/chunks/{studio-evwgp1ym.js → studio-2sqcndak.js} +4 -4
  43. package/dist/chunks/{studio-x5g1xk77.js → studio-3aey7dd3.js} +4 -4
  44. package/dist/chunks/{studio-xkfs0dp2.js → studio-3bpdkq2s.js} +4 -4
  45. package/dist/chunks/{studio-5gs9th4b.js → studio-47y6fbpf.js} +4 -4
  46. package/dist/chunks/{studio-e47215hh.js → studio-4m3826v2.js} +4 -4
  47. package/dist/chunks/studio-4nx2dj1g.js +4 -0
  48. package/dist/chunks/{studio-gjknvzam.js → studio-4xv5s47r.js} +5 -5
  49. package/dist/chunks/{studio-sxc0zvpt.js → studio-5g0ag7c0.js} +3 -3
  50. package/dist/chunks/{studio-semd1s8s.js → studio-5g4t8v6w.js} +4 -4
  51. package/dist/chunks/studio-5py436sf.js +5 -0
  52. package/dist/chunks/{studio-aje966s9.js → studio-77kt594t.js} +4 -4
  53. package/dist/chunks/{studio-3ck2a5c4.js → studio-8f87n763.js} +6 -6
  54. package/dist/chunks/studio-8mb00b84.js +5 -0
  55. package/dist/chunks/studio-8p51gq2h.js +6 -0
  56. package/dist/chunks/studio-954ds834.js +5 -0
  57. package/dist/chunks/{studio-capk0583.js → studio-9ft45c83.js} +6 -6
  58. package/dist/chunks/studio-a2138x5k.js +7 -0
  59. package/dist/chunks/studio-a9yzstqj.js +5 -0
  60. package/dist/chunks/{studio-gp02nqnw.js → studio-acdksxx6.js} +4 -4
  61. package/dist/chunks/{studio-edbtvcd1.js → studio-anyrgzvb.js} +4 -4
  62. package/dist/chunks/{studio-4r0sjtx8.js → studio-ar8jcf2y.js} +4 -4
  63. package/dist/chunks/{studio-rmn2dz59.js → studio-bmn4mn9j.js} +5 -5
  64. package/dist/chunks/{studio-03wwfvyt.js → studio-cpxkgjrj.js} +4 -4
  65. package/dist/chunks/{studio-7qvs7v0m.js → studio-e7xxa0sj.js} +4 -4
  66. package/dist/chunks/{studio-01qza1n3.js → studio-ecaz25vk.js} +4 -4
  67. package/dist/chunks/{studio-5e9zsamh.js → studio-fzdywr6p.js} +6 -6
  68. package/dist/chunks/{studio-xg1942as.js → studio-g5fmf0c1.js} +4 -4
  69. package/dist/chunks/{studio-1q6amtph.js → studio-g7nse7zb.js} +4 -4
  70. package/dist/chunks/studio-geq1ea6k.js +14 -0
  71. package/dist/chunks/{studio-n78gjfy8.js → studio-ghkb32r8.js} +4 -4
  72. package/dist/chunks/{studio-bftp4n4b.js → studio-ghrhy2y7.js} +4 -4
  73. package/dist/chunks/{studio-5d7wfmnp.js → studio-grawhey1.js} +4 -4
  74. package/dist/chunks/{studio-rr4xkv81.js → studio-h0xgswew.js} +4 -4
  75. package/dist/chunks/{studio-cbr9czkn.js → studio-h9c4p2tx.js} +4 -4
  76. package/dist/chunks/studio-jyzj5cxs.js +5 -0
  77. package/dist/chunks/{studio-x92tgnee.js → studio-mgx8yhnz.js} +31 -31
  78. package/dist/chunks/{studio-g8dsj3d2.js → studio-mpb04y1d.js} +5 -5
  79. package/dist/chunks/{studio-zev8ssp1.js → studio-n17mty64.js} +4 -4
  80. package/dist/chunks/{studio-4jj9gme2.js → studio-nwh2eqsk.js} +5 -5
  81. package/dist/chunks/{studio-8xcwewjq.js → studio-pxg4ap1e.js} +3 -3
  82. package/dist/chunks/{studio-4m50vh74.js → studio-q1h883bt.js} +5 -5
  83. package/dist/chunks/{studio-c6zdm25z.js → studio-q4tv82h7.js} +6 -6
  84. package/dist/chunks/{studio-st75kn99.js → studio-qbj760tx.js} +5 -5
  85. package/dist/chunks/{studio-y7jehjrp.js → studio-qpqa7vk3.js} +4 -4
  86. package/dist/chunks/{studio-5vy2wfm5.js → studio-qqz8e5gk.js} +4 -4
  87. package/dist/chunks/{studio-qa73881a.js → studio-qvasen3f.js} +4 -4
  88. package/dist/chunks/studio-rggdb3hm.js +5 -0
  89. package/dist/chunks/{studio-4xppwncr.js → studio-sghy936h.js} +3 -3
  90. package/dist/chunks/{studio-mk00zd5d.js → studio-skprc6ef.js} +4 -4
  91. package/dist/chunks/{studio-cqmtbg2p.js → studio-tt2nactf.js} +4 -4
  92. package/dist/chunks/{studio-ge5fqjth.js → studio-txjjzrsm.js} +5 -5
  93. package/dist/chunks/{studio-tmeq6mjb.js → studio-tyasmc39.js} +4 -4
  94. package/dist/chunks/{studio-0bbxhhce.js → studio-v2bvmbjj.js} +4 -4
  95. package/dist/chunks/{studio-pwqfmt4p.js → studio-vk9ezads.js} +4 -4
  96. package/dist/chunks/{studio-fqq890ap.js → studio-vzacdfsc.js} +3 -3
  97. package/dist/chunks/{studio-zd4kayn2.js → studio-w4c0xmrw.js} +4 -4
  98. package/dist/chunks/{studio-ztvcxm3w.js → studio-wfjqhhbk.js} +4 -4
  99. package/dist/chunks/{studio-tp642n5g.js → studio-wgh5kxpj.js} +4 -4
  100. package/dist/chunks/studio-xasj0796.js +5 -0
  101. package/dist/chunks/{studio-tzegmy4w.js → studio-y78s8r2n.js} +4 -4
  102. package/dist/chunks/{studio-7pgy3xaf.js → studio-z8w183sh.js} +4 -4
  103. package/dist/chunks/{studio-01kbbqg3.js → studio-zscd9ty4.js} +124 -124
  104. package/dist/chunks/{studio-hnvnfbdv.js → studio-zxp13sss.js} +6 -6
  105. package/dist/chunks/{studio-r3kaka4d.js → studio-zygnmm01.js} +4 -4
  106. package/dist/chunks/{tsMode-k9s9fcag.js → tsMode-gr0m4dzr.js} +5 -5
  107. package/dist/chunks/workspace-m15qtcqp.js +4 -0
  108. package/dist/chunks/{ws-client-0ja08haa.js → ws-client-nf61frr1.js} +3 -3
  109. package/dist/manifest.json +62 -62
  110. package/dist/studio.js +83 -83
  111. package/package.json +2 -2
  112. package/src/new-project/add-repo-modal.ts +459 -59
  113. package/src/platforms/cloud.ts +95 -18
  114. package/src/publish/pages-service.ts +7 -0
  115. package/src/publish/publish-panel.ts +16 -2
  116. package/src/surfaces/add-repo.json +721 -224
  117. package/src/surfaces/add-repo.ts +196 -31
  118. package/src/types.ts +42 -3
  119. package/src/utils/project-dir.ts +24 -0
  120. package/dist/chunks/adapter-y5gdq19c.js +0 -4
  121. package/dist/chunks/cf-settings-20dznc3j.js +0 -4
  122. package/dist/chunks/components-q037dya7.js +0 -4
  123. package/dist/chunks/content-source-t0q184js.js +0 -4
  124. package/dist/chunks/editor-j5sq149q.js +0 -4
  125. package/dist/chunks/entry-commands-fxzgcc4k.js +0 -4
  126. package/dist/chunks/file-ops-2n77759h.js +0 -4
  127. package/dist/chunks/files-fjy7zpxt.js +0 -4
  128. package/dist/chunks/format-host-wj3mf3n8.js +0 -4
  129. package/dist/chunks/fs-events-7kcgn4e9.js +0 -4
  130. package/dist/chunks/git-panel-7z2mpt2d.js +0 -4
  131. package/dist/chunks/iframe-host-a0zjd6xp.js +0 -4
  132. package/dist/chunks/index-m0x5ztax.js +0 -4
  133. package/dist/chunks/jx-validate-zc9zp77s.js +0 -4
  134. package/dist/chunks/layers-p677nrh5.js +0 -4
  135. package/dist/chunks/layers-panel-y4w1dq90.js +0 -4
  136. package/dist/chunks/lit-html-cfn61dn7.js +0 -4
  137. package/dist/chunks/media-picker-xg7yjpz9.js +0 -4
  138. package/dist/chunks/menu-fpekzj6w.js +0 -4
  139. package/dist/chunks/monaco-buffer-nn4dtx27.js +0 -4
  140. package/dist/chunks/notify-ahs57a2z.js +0 -4
  141. package/dist/chunks/platform-v9xyfkbx.js +0 -4
  142. package/dist/chunks/publish-panel-xtbfgg2r.js +0 -4
  143. package/dist/chunks/quick-search-d3a6m7j3.js +0 -4
  144. package/dist/chunks/references-99ws0b0m.js +0 -4
  145. package/dist/chunks/right-panel-31vbk5xp.js +0 -4
  146. package/dist/chunks/section-registry-b2yzp9sw.js +0 -4
  147. package/dist/chunks/studio-1a99w39s.js +0 -5
  148. package/dist/chunks/studio-4fde4a0x.js +0 -5
  149. package/dist/chunks/studio-84rtc120.js +0 -5
  150. package/dist/chunks/studio-aekhcdzw.js +0 -7
  151. package/dist/chunks/studio-aqmph6k4.js +0 -5
  152. package/dist/chunks/studio-chdmwwzw.js +0 -5
  153. package/dist/chunks/studio-cp1gbff9.js +0 -14
  154. package/dist/chunks/studio-fbx6twps.js +0 -6
  155. package/dist/chunks/studio-fthwn4kf.js +0 -5
  156. package/dist/chunks/studio-nbxqcgvf.js +0 -5
  157. package/dist/chunks/studio-t1eedsyx.js +0 -4
  158. package/dist/chunks/studio-vavmwshr.js +0 -5
  159. package/dist/chunks/workspace-5vmgsagj.js +0 -4
@@ -1,9 +1,9 @@
1
- import{$v}from"./studio-cp1gbff9.js";import{v}from"./studio-fqq890ap.js";import{Nl,Cv,u}from"./studio-x5g1xk77.js";import{Di,qo,y}from"./studio-4m50vh74.js";import{st}from"./studio-pwqfmt4p.js";import{lt,bi,Il,Ou,hr,kC,IC}from"./studio-5gs9th4b.js";import{D,Lc}from"./studio-tp642n5g.js";import{T,R}from"./studio-7qvs7v0m.js";import{me}from"./studio-0bbxhhce.js";var qg={$sections:[{label:"Headings",elements:[{tag:"h1",text:"Code Is Poetry"},{tag:"h2",text:"Code Is Poetry"},{tag:"h3",text:"Code Is Poetry"},{tag:"h4",text:"Code Is Poetry"},{tag:"h5",text:"Code Is Poetry"},{tag:"h6",text:"Code Is Poetry"}]},{label:"Paragraph",elements:[{tag:"p",text:"In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing."}]},{label:"List",elements:[{tag:"ul",children:[{tag:"li",text:"Alice."},{tag:"li",text:"The White Rabbit."},{tag:"li",text:"The Cheshire Cat."},{tag:"li",text:"The Mad Hatter."},{tag:"li",text:"The Queen of Hearts."}]},{tag:"ol",children:[{tag:"li",text:"First item"},{tag:"li",text:"Second item"},{tag:"li",text:"Third item"}]}]},{label:"Quote",elements:[{tag:"blockquote",children:[{tag:"p",text:"In quoting others, we cite ourselves.",style:"font-size:1.25em;font-style:italic"},{tag:"p",text:"— Julio Cortázar"}]}]},{label:"Code",elements:[{tag:"pre",children:[{tag:"code",text:`// A "block" is the abstract term used
1
+ import{Dv}from"./studio-geq1ea6k.js";import{v}from"./studio-vzacdfsc.js";import{Ol,kv,u}from"./studio-3aey7dd3.js";import{Di,qo,y}from"./studio-q1h883bt.js";import{st}from"./studio-vk9ezads.js";import{lt,bi,Rl,Mu,hr,EC,$C}from"./studio-47y6fbpf.js";import{D,Ic}from"./studio-wgh5kxpj.js";import{T,R}from"./studio-e7xxa0sj.js";import{me}from"./studio-v2bvmbjj.js";var Gg={$sections:[{label:"Headings",elements:[{tag:"h1",text:"Code Is Poetry"},{tag:"h2",text:"Code Is Poetry"},{tag:"h3",text:"Code Is Poetry"},{tag:"h4",text:"Code Is Poetry"},{tag:"h5",text:"Code Is Poetry"},{tag:"h6",text:"Code Is Poetry"}]},{label:"Paragraph",elements:[{tag:"p",text:"In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing."}]},{label:"List",elements:[{tag:"ul",children:[{tag:"li",text:"Alice."},{tag:"li",text:"The White Rabbit."},{tag:"li",text:"The Cheshire Cat."},{tag:"li",text:"The Mad Hatter."},{tag:"li",text:"The Queen of Hearts."}]},{tag:"ol",children:[{tag:"li",text:"First item"},{tag:"li",text:"Second item"},{tag:"li",text:"Third item"}]}]},{label:"Quote",elements:[{tag:"blockquote",children:[{tag:"p",text:"In quoting others, we cite ourselves.",style:"font-size:1.25em;font-style:italic"},{tag:"p",text:"— Julio Cortázar"}]}]},{label:"Code",elements:[{tag:"pre",children:[{tag:"code",text:`// A "block" is the abstract term used
2
2
  // to describe units of markup that
3
3
  // when composed together, form the
4
4
  // content or layout of a page.
5
- registerBlockType( name, settings );`}]}]},{label:"Inline",elements:[{tag:"a",text:"Visit the documentation",attributes:{href:"#"}},{tag:"strong",text:"Bold text emphasis"},{tag:"em",text:"Italic text emphasis"},{tag:"small",text:"Fine print and legal text"},{tag:"mark",text:"Highlighted text"},{tag:"code",text:"const x = 42;"},{tag:"abbr",text:"HTML",attributes:{title:"HyperText Markup Language"}},{tag:"sub",text:"subscript"},{tag:"sup",text:"superscript"}]},{label:"Form",elements:[{tag:"input",attributes:{type:"text",placeholder:"Enter text…"}},{tag:"button",text:"Click Me"},{tag:"select",children:[{tag:"option",text:"Option 1"},{tag:"option",text:"Option 2"},{tag:"option",text:"Option 3"}]},{tag:"textarea",attributes:{placeholder:"Enter longer text…",rows:"3"}}]},{label:"Table",elements:[{tag:"table",children:[{tag:"thead",children:[{tag:"tr",children:[{tag:"th",text:"Name"},{tag:"th",text:"Role"},{tag:"th",text:"Status"}]}]},{tag:"tbody",children:[{tag:"tr",children:[{tag:"td",text:"Alice"},{tag:"td",text:"Developer"},{tag:"td",text:"Active"}]},{tag:"tr",children:[{tag:"td",text:"Bob"},{tag:"td",text:"Designer"},{tag:"td",text:"Away"}]},{tag:"tr",children:[{tag:"td",text:"Carol"},{tag:"td",text:"Manager"},{tag:"td",text:"Active"}]}]}]}]},{label:"Interactive",elements:[{tag:"details",attributes:{open:""},children:[{tag:"summary",text:"Click to expand details"},{tag:"p",text:"Additional detail content revealed when the disclosure widget is toggled open."}]}]},{label:"Media",elements:[{tag:"img",attributes:{alt:"Placeholder image"},style:"width:100%;max-width:400px;height:200px;background:#e0e0e0;display:block;border-radius:4px"},{tag:"video",attributes:{controls:""},style:"width:100%;max-width:400px;height:200px;background:#e0e0e0;display:block;border-radius:4px"},{tag:"audio",attributes:{controls:""},style:"width:100%"}]}],$variables:{color:{label:"Color",prefix:"--color-",placeholder:"#007acc"},font:{label:"Font",prefix:"--font-",placeholder:"system-ui, sans-serif"},size:{label:"Size",prefix:"--size-",placeholder:"16px"},other:{label:"Other",prefix:"--",placeholder:"value"}}};var O={$schema:"https://jxsuite.com/schema/v1",$id:"StudioStylebookChrome",$description:"The bar across the top of the Project Styles canvas: the filter that narrows the specimen catalogue, and the toggle that reduces it to the elements this file has already styled. Both are shell state rather than document state — the adapter owns which — and the two names come in as values, because the surface is called Project Styles and the canvas view it draws is the wire word `stylebook`; nothing a reader sees here may be spelled from that. **The bar IS the kit's toolbar now.** It used to write `role=\"toolbar\"` and its own `aria-label` on a `<div>`, which is a role with none of the behaviour under it: two controls, two tab stops, and no arrow key between them. `jx-action-group` is not the element for it — that one roves `jx-action-button` and this bar's first control is a `jx-textfield` — so `jx-toolbar` is, and the field keeps its own arrows while its caret still has text to walk (ui.md §5.5).",tagName:"jx-toolbar",attributes:{part:"chrome"},$props:{label:{$ref:"#/state/title"}},style:{$description:'What `.sb-chrome` said in `styles/overlays.css`, plus the six inline declarations the template carried beside it, plus `.tb-toggle` — all three go dead with this conversion, and none of them is shared with another surface. Three repairs on the way. The bar is one element rather than a positioned box wrapping a `role="toolbar"` row that declared the same flex layout again. The flex layout is not declared here EITHER any more: `display: flex`, `align-items: center`, the `--jx-space-2` gap, the sans face and the foreground colour are all `jx-toolbar`\'s own, so what is left below is only what a positioned BAND is. And `.tb-toggle` read `var(--spectrum-font-size-50, 11px)`, which the kit spells `--jx-text-sm` at the same value; the rest of its drawing is a `jx-action-button` reaching in through `part="control"`, because what it has to look like is a small bordered chip and every fill and control height the kit draws would otherwise have to be taken back off.',position:"absolute",top:"0",left:"0",right:"0",zIndex:"15",flexShrink:"0",padding:"var(--jx-space-2) var(--jx-space-3)",background:"var(--bg-panel)",borderBottom:"1px solid var(--border)",'& [part="filter"]':{flex:"1",maxWidth:"200px"},'& [part="customized"] > [part="control"]':{$description:"Bordered, unfilled and dimmed until it is on, which is what says it is a filter rather than an action: the catalogue it narrows is the thing the reader is looking at, so the control has to be quieter than its subject.",padding:"3px var(--jx-space-3)",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"transparent",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)",":hover":{background:"var(--hover-bg)"}},'& [part="customized"][data-selected] > [part="control"]':{$description:"`data-selected` and not `selected`: the kit reflects the pressed state as a data attribute (`jx-action-button.json`), and the property this document binds never reaches the attribute of the same name.",borderColor:"var(--accent)",background:"var(--accent-15)",color:"var(--accent)"}},children:[{tagName:"jx-textfield",attributes:{part:"filter"},$props:{size:"sm",type:"search",clearable:!0,label:{$ref:"#/state/filterLabel"},placeholder:"Filter…",value:{$ref:"#/state/filter"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setFilter"},value:[{$ref:"event#/target/value"}]}]}},{tagName:"jx-action-button",$description:"`onchange` and not `onclick`: a `toggles` button owns its own pressed state and says so with `change` (`jx-action-button.json`), and an `onclick` written here would replace the element's own click handler on the same property — the toggle would stop flipping and stop announcing `aria-pressed`.",attributes:{part:"customized"},$props:{size:"sm",toggles:!0,selected:{$ref:"#/state/customizedOnly"},label:{$ref:"#/state/customizedLabel"},hint:{$ref:"#/state/customizedHint"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/toggleCustomized"},value:[]}]},children:[{tagName:"span",textContent:"${state.customizedLabel}"}]}]};T("stylebook-chrome",O);function z(e,o){let t=document.createElement("div");t.style.display="contents";let n=v({...e,...o}),r=null,s=!1;function i(){s=!0,R("stylebook-chrome",n,t).then((d)=>{s=!1,r=d})}return i(),{host:t,update(d){if(Object.assign(n,d),s||r!==null&&t.contains(r.root))return;r?.dispose(),r=null,t.textContent="",i()}}}function E(e){return!e.startsWith(":")&&!e.startsWith(".")&&!e.startsWith("&")&&!e.startsWith("[")&&!e.startsWith("@")&&!e.startsWith("--")}function w(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}var M="& .element-card-preview";function Wg(e){let o=e,t={},n=(r)=>{let s={};for(let[i,d]of Object.entries(r))if(i!=="@--")s[i]=d;return s};for(let[r,s]of Object.entries(o)){if(!w(s)){t[r]=s;continue}if(r==="@--")continue;if($v(r)){t[r]=s;continue}if(r.startsWith("@")){let i={};for(let[d,g]of Object.entries(s))if(w(g)&&E(d))i[`${M} ${d}`]=n(g);else i[d]=g;t[r]=i;continue}if(E(r)){t[`${M} ${r}`]=n(s);continue}t[r]=s}return t}function I(e,o){let t=o.split(" "),n=e;for(let r of t){if(!w(n))return null;n=n[r]}return w(n)?n:null}function J(e,o){let t=e,n=I(t,o);if(n&&Object.keys(n).length>0)return!0;for(let[r,s]of Object.entries(t)){if(!r.startsWith("@")||!w(s))continue;let i=I(s,o);if(i&&Object.keys(i).length>0)return!0}return!1}function _(e){let o=new Map,t=new Map,n=e.filter.toLowerCase(),r=(a,c,h)=>{let p=a.tag===h?h:`${h} ${a.tag}`;o.set(Il(c),p);let m=a.children??[];for(let[l,C]of m.entries())r(C,[...c,"children",l],h)},s=(a)=>{let c={...a.attributes};if(a.style)c.style=a.style;return{tagName:a.tag,...a.text?{textContent:a.text}:{},...Object.keys(c).length>0?{attributes:c}:{},...a.children?{children:a.children.map(s)}:{}}},i=(a,c,h,p,m)=>{o.set(Il(p),a),o.set(Il([...p,"children",0]),a);let l=[...p,"children",0,"children",0];if(m)r(m,l,a);else o.set(Il(l),a);if(!t.has(a))t.set(a,p);return{attributes:{class:"element-card"},children:[{attributes:{class:"element-card-preview"},children:[h],tagName:"div"},{attributes:{class:"element-card-label"},tagName:"div",textContent:c}],tagName:"div"}},d=[],g=(a,c)=>({attributes:{class:"sb-section"},children:[{attributes:{class:"sb-label"},tagName:"div",textContent:a},{attributes:{class:"sb-body"},children:c,tagName:"div"}],tagName:"div"}),f=()=>["children",d.length,"children",1];for(let a of e.meta.$sections){let c=a.elements;if(n)c=c.filter((m)=>m.tag.includes(n)||a.label.toLowerCase().includes(n));if(e.customizedOnly)c=c.filter((m)=>J(e.effectiveStyle,m.tag));if(c.length===0)continue;let h=f(),p=c.map((m,l)=>i(m.tag,`<${m.tag}>`,s(m),[...h,"children",l],m));d.push(g(a.label,p))}let b=[];{let a=e.components;if(n)a=a.filter((c)=>c.tagName.toLowerCase().includes(n));if(e.customizedOnly)a=a.filter((c)=>J(e.effectiveStyle,c.tagName));if(a.length>0){let c=f(),h=a.map((p,m)=>{let l=[...c,"children",m];if(p.source!=="npm"&&p.path?.endsWith(".json")){b.push({$ref:`/${e.projectRoot?`${e.projectRoot}/`:""}${p.path}`.replace(/^\/+/,"/")});let j={};for(let k of p.props??[])if(k.default!==void 0&&k.default!=="false"&&k.default!=="''")j[k.name]=String(k.default).replaceAll(/^'|'$/g,"");let q={tagName:p.tagName,...Object.keys(j).length>0?{attributes:j}:{}};return i(p.tagName,`<${p.tagName}>`,q,l,null)}let V={attributes:{class:"sb-fallback"},tagName:"div",textContent:`<${p.tagName}>`};return i(p.tagName,`<${p.tagName}>`,V,l,null)});d.push(g("Components",h))}}if(d.length===0)d.push({attributes:{class:"sb-empty"},tagName:"div",textContent:e.customizedOnly?"No customized elements":"No matching elements"});return{doc:{...b.length>0?{$elements:b}:{},$media:e.effectiveMedia,attributes:{class:"sb-root"},children:d,style:Wg(e.effectiveStyle),tagName:"div"},pathToTag:o,tagToCardPath:t}}var Vg="Project Styles",WS="stylebook",Qy=[{id:"color",prefix:"--color-",title:"Colors"},{id:"font",prefix:"--font-",title:"Fonts"},{id:"size",prefix:"--size-",title:"Sizes & Spacing"},{id:"other",prefix:"--",title:"Other"}];function L(e){if(e.startsWith("--color"))return"color";if(e.startsWith("--font"))return"font";if(e.startsWith("--size")||e.startsWith("--spacing")||e.startsWith("--radius"))return"size";return"other"}function j_(e){let o=L(e);if(o==="other")return e;let{prefix:t}=Qy.find((n)=>n.id===o);return Cv(e,t)}function U(e){if(!e)return[];let o=[];for(let[t,n]of Object.entries(e)){if(!t.startsWith("--"))continue;if(typeof n!=="string"&&typeof n!=="number")continue;o.push({group:L(t),label:j_(t),name:t,value:n})}return o}function VS(e){let o=U(e);return Qy.map((t)=>({group:t,tokens:o.filter((n)=>n.group===t.id)}))}function US(e){if(!e)return[];let{featureQueries:o,sizeBreakpoints:t}=hr(e),n=[],r=[];for(let{name:i,query:d}of o){let g=Ou(d);if(g)n.push({key:`@${i}`,kind:"scheme",label:g==="dark"?"Dark":"Light",name:i,scheme:g});else r.push({key:`@${i}`,kind:"feature",label:`@${i}`,name:i})}let s=t.map(({name:i})=>({key:`@${i}`,kind:"size",label:`@${i}`,name:i}));return[...n,...s,...r]}function A(e,o){let t=e[o.key];return t&&typeof t==="object"?t:void 0}function Ug(e,o,t){let n=A(e,o)?.[t];return typeof n==="string"||typeof n==="number"?n:void 0}function H_(e,o,t,n){if(n){let s=e[o.key]??={};s[t]=n;return}let r=A(e,o);if(!r)return;if(delete r[t],Object.keys(r).length===0)delete e[o.key]}function qS(e,o,t,n=[]){let r=new Set(n.map((s)=>s.name));return o.filter((s)=>!r.has(s.name)&&Ug(e,s,t)===void 0)}var W=new WeakMap;function K(e){let o={customizedHint:"Show only the elements this file has already styled",customizedLabel:"Customized",customizedOnly:y.stylebook.customizedOnly,filter:y.stylebook.filter,filterLabel:`Filter the ${Vg} catalogue`,title:Vg},t=W.get(e);if(t)return t.update(o),t.host;let n=z(o,{setFilter:(r)=>{y.stylebook.filter=r},toggleCustomized:()=>{y.stylebook.customizedOnly=!y.stylebook.customizedOnly}});return W.set(e,n),n.host}async function GS(e,o){let t=e.wrap,n=lt(e.paneId),r=y.stylebook.filter.toLowerCase(),{customizedOnly:s}=y.stylebook,i=Di(n?.doc.document?.$media),{sizeBreakpoints:d,baseWidth:g}=hr(i),f=d.length>0,b=K(e);t.style.overflow="hidden";let S=[];if(f){S.push({displayName:bi("--"),name:"base",width:g});for(let l of d)S.push({displayName:bi(l.name),name:l.name,width:l.width})}let a;if(!f){let l=i&&i["--"],C=l?`${bi("--")} (${g}px)`:null;a=[o.canvasPanelEntry(l?"base":null,C,!l,l?g:void 0)]}else a=S.map((l)=>o.canvasPanelEntry(l.name,`${l.displayName} (${l.width}px)`,!1,l.width));if(!await o.drawStage(e,{frame:"boards",framePart:"panzoom",frameVars:"--boards-inset:40px",handles:"hidden",hug:!1,innerPart:"boards",lead:"chrome",panels:a.map((l)=>l.item)},a))return;let h=o.stageHost(e,"chrome-host");if(h&&h.firstChild!==b)h.replaceChildren(b);let p=_({components:st,customizedOnly:Boolean(s),effectiveMedia:i??{},effectiveStyle:qo(n?.doc.document?.style),filter:r,meta:qg,projectRoot:D?.projectRoot??null}),{panels:m}=e;for(let{panel:l}of a)m.push(l),kC(e.renderGeneration,p,l.canvas,l._width);if(f)o.updateActivePanelHeaders(e);o.applyTransform(e),o.observeCenterUntilStable(e)}function wu(e,o,{panCanvas:t=!1}={}){if(y.stylebook.selection=e,Lc(u.value,{selection:[[]],ui:{activeSelector:e,rightTab:"style",...o!==void 0?{activeMedia:o}:{}}}),e&&t)IC(e)}var Q=8,ew=[{id:"properties",title:"Content"},{id:"style",title:"Style"},{id:"events",title:"Logic"},{id:"assistant",title:"Assistant"}];function tw(){return{saveDocument:()=>{},undo:()=>{},redo:()=>{},openInBrowser:()=>{},buildSite:()=>{},closeDocument:()=>{},duplicateSelection:()=>{},deleteSelection:()=>{},selectParent:()=>{},toggleDock:()=>{},toggleZen:()=>{},openPalette:()=>{},openProject:()=>{},newWindow:()=>{},panelRoster:[],focusPanel:()=>{},focusInspectorTab:()=>{},cycleRegion:()=>{}}}var x=(e)=>e.document.open,P=(e)=>e.selection.count>0&&e.editor.kind==="canvas",N=(e)=>!e.selection.isRoot&&e.selection.paths.every((o)=>Nl(o)),B="an element selected on the canvas that has a sibling position: not the document root, a repeater's template or a switch case",H=(e)=>e.map((o)=>`[${o.join(", ")}]`).join(" and ");function Jh(e){return[{id:"file.save",title:"Save",category:"File",level:"document",icon:"floppy-disk",keybinding:"mod+s",menus:["commandbar/primary","statusbar/document","palette"],group:"1_file",undo:"none",when:x,requires:"an open document",run:()=>e.saveDocument()},{id:"document.close",title:"Close Document",category:"Document",level:"document",keybinding:"mod+w",menus:["context/tab","palette"],group:"1_file",when:x,requires:"an open document",run:()=>e.closeDocument()},{id:"view.openInBrowser",title:"Open in Browser",category:"View",level:"document",icon:"arrow-square-out",keybinding:"mod+shift+o",menus:["commandbar/primary","statusbar/document","palette"],group:"2_output",when:(t)=>t.project.isSite,enablement:x,requires:"a page to preview",run:()=>e.openInBrowser()},{id:"project.buildSite",title:"Build Site",category:"Project",level:"project",menus:["commandbar/overflow","palette"],group:"2_output",when:(t)=>t.project.isSite,requires:"a site project",run:()=>e.buildSite()},{id:"edit.undo",title:"Undo",category:"Edit",level:"document",icon:"arrow-u-up-left",keybinding:"mod+z",menus:["commandbar/primary","palette"],group:"1_history",when:x,enablement:(t)=>t.document.canUndo,requires:"a change to undo",run:()=>e.undo()},{id:"edit.redo",title:"Redo",category:"Edit",level:"document",icon:"arrow-u-up-right",keybinding:["mod+shift+z","mod+y"],menus:["commandbar/primary","palette"],group:"1_history",when:x,enablement:(t)=>t.document.canRedo,requires:"a change to redo",run:()=>e.redo()},{id:"selection.duplicate",title:"Duplicate",category:"Selection",level:"selection",keyScope:"canvas",keybinding:"mod+d",menus:["blockbar","context/element","context/layer","outline/row","palette"],group:"3_structure",undo:"document",when:P,enablement:N,requires:B,aiTool:{name:"duplicate_node",description:"Duplicate elements in the document, inserting each copy after its original, as one undoable step. The copies become the selection.",report:({after:t})=>{let n=t.selection.paths.length;return`Duplicated ${n} element${n===1?"":"s"}; the ${n===1?"copy is":"copies are"} selected at ${H(t.selection.paths)}.`}},run:()=>e.duplicateSelection()},{id:"selection.repeat",title:"Repeat...",category:"Selection",level:"selection",keyScope:"canvas",menus:["context/element","palette"],group:"3_structure",undo:"document",when:P,enablement:(t)=>N(t)&&!t.selection.isRepeater,requires:"an element with a sibling position that is not already a repeater",run:()=>{(me("vqkt7s3s"),import("./convert-to-repeater-vqkt7s3s.js")).then(({convertToRepeater:t})=>t())}},{id:"selection.delete",title:"Delete",category:"Selection",level:"selection",keyScope:"canvas",keybinding:["delete","backspace"],menus:["blockbar","context/element","context/layer","outline/row","palette"],group:"9_danger",destructive:!0,undo:"document",when:P,enablement:N,requires:B,aiTool:{name:"delete_node",description:"Delete elements from the document as one undoable step.",report:({before:t,after:n})=>{let r=t.selection.paths.length;return`Deleted ${r} element${r===1?"":"s"} at ${H(t.selection.paths)} in one undo step; the selection is now ${n.selection.count===0?"empty":"elsewhere"}.`}},run:()=>e.deleteSelection()},{id:"selection.selectParent",title:"Select Parent",category:"Selection",level:"selection",keyScope:"canvas",keybinding:["escape","arrowleft"],menus:["palette"],group:"2_navigate",when:P,requires:"an element selection",run:()=>e.selectParent()},{id:"view.toggleNavigator",title:"Toggle Navigator Dock",category:"View",level:"application",keybinding:"mod+b",menus:["commandbar/overflow","palette"],group:"4_docks",run:()=>e.toggleDock("navigator")},{id:"view.toggleInspector",title:"Toggle Inspector Dock",category:"View",level:"application",keybinding:"mod+alt+b",menus:["commandbar/overflow","palette"],group:"4_docks",run:()=>e.toggleDock("inspector")},{id:"view.zen",title:"Zen Mode",category:"View",level:"application",keybinding:"mod+.",menus:["commandbar/overflow","palette"],group:"4_docks",run:()=>e.toggleZen()},{id:"palette.open",title:"Open Command Center",category:"View",level:"application",keybinding:"mod+k",menus:["palette"],group:"5_palette",run:()=>e.openPalette("picker")},{id:"palette.openFiles",title:"Go to File…",category:"File",level:"application",keybinding:"mod+p",menus:["palette"],group:"5_palette",run:()=>e.openPalette("files")},{id:"palette.openCommands",title:"Run Command…",category:"View",level:"application",keybinding:"mod+shift+p",menus:["palette"],group:"5_palette",run:()=>e.openPalette("commands")},{id:"palette.openNodes",title:"Go to Symbol in Document…",category:"Selection",level:"document",menus:["palette"],group:"5_palette",when:x,requires:"an open document",run:()=>e.openPalette("nodes")},{id:"project.open",title:"Open Project…",category:"Project",level:"project",keybinding:"mod+o",menus:["commandbar/overflow","statusbar/project","palette"],group:"1_file",run:()=>e.openProject()},{id:"view.newWindow",title:"New Window",category:"View",level:"application",keybinding:"mod+shift+n",menus:["commandbar/overflow","palette"],group:"1_file",when:(t)=>t.capability.windowControls,requires:"a host that can hold more than one window",run:()=>e.newWindow()},{id:"project.openRecent",title:"Open Recent…",category:"Project",level:"project",menus:["commandbar/overflow","statusbar/project","palette"],group:"1_file",run:()=>e.openPalette("projects")},...Z(e),...Y(e),{id:"view.cycleRegion",title:"Focus Next Region",category:"View",level:"application",keybinding:"f6",menus:["palette"],group:"4_docks",run:()=>e.cycleRegion(1)},{id:"view.cycleRegionBack",title:"Focus Previous Region",category:"View",level:"application",keybinding:"shift+f6",menus:["palette"],group:"4_docks",run:()=>e.cycleRegion(-1)}]}function Z(e){let o=0;return e.panelRoster.map((t)=>{let n={id:`panel.focus.${t.id}`,title:`Show ${t.title}`,category:"View",level:"application",menus:["palette"],group:"4_docks",requires:"an open project",when:(r)=>r.project.open&&(t.when?.(r)??!0),run:()=>e.focusPanel(t.id)};if(t.rail!==!1&&o<Q)o+=1,n.keybinding=`mod+${o}`;return n})}function Y(e){return ew.map((o,t)=>({id:`inspector.focus.${o.id}`,title:`Show ${o.title}`,category:"View",level:"document",keybinding:`mod+shift+${t+1}`,menus:["palette"],group:"4_docks",requires:"an open document",when:(r)=>r.document.open,run:()=>e.focusInspectorTab(o.id)}))}
6
- export{Wg,Vg,WS,Qy,j_,VS,US,Ug,H_,qS,qg,GS,wu,ew,tw,Jh};
5
+ registerBlockType( name, settings );`}]}]},{label:"Inline",elements:[{tag:"a",text:"Visit the documentation",attributes:{href:"#"}},{tag:"strong",text:"Bold text emphasis"},{tag:"em",text:"Italic text emphasis"},{tag:"small",text:"Fine print and legal text"},{tag:"mark",text:"Highlighted text"},{tag:"code",text:"const x = 42;"},{tag:"abbr",text:"HTML",attributes:{title:"HyperText Markup Language"}},{tag:"sub",text:"subscript"},{tag:"sup",text:"superscript"}]},{label:"Form",elements:[{tag:"input",attributes:{type:"text",placeholder:"Enter text…"}},{tag:"button",text:"Click Me"},{tag:"select",children:[{tag:"option",text:"Option 1"},{tag:"option",text:"Option 2"},{tag:"option",text:"Option 3"}]},{tag:"textarea",attributes:{placeholder:"Enter longer text…",rows:"3"}}]},{label:"Table",elements:[{tag:"table",children:[{tag:"thead",children:[{tag:"tr",children:[{tag:"th",text:"Name"},{tag:"th",text:"Role"},{tag:"th",text:"Status"}]}]},{tag:"tbody",children:[{tag:"tr",children:[{tag:"td",text:"Alice"},{tag:"td",text:"Developer"},{tag:"td",text:"Active"}]},{tag:"tr",children:[{tag:"td",text:"Bob"},{tag:"td",text:"Designer"},{tag:"td",text:"Away"}]},{tag:"tr",children:[{tag:"td",text:"Carol"},{tag:"td",text:"Manager"},{tag:"td",text:"Active"}]}]}]}]},{label:"Interactive",elements:[{tag:"details",attributes:{open:""},children:[{tag:"summary",text:"Click to expand details"},{tag:"p",text:"Additional detail content revealed when the disclosure widget is toggled open."}]}]},{label:"Media",elements:[{tag:"img",attributes:{alt:"Placeholder image"},style:"width:100%;max-width:400px;height:200px;background:#e0e0e0;display:block;border-radius:4px"},{tag:"video",attributes:{controls:""},style:"width:100%;max-width:400px;height:200px;background:#e0e0e0;display:block;border-radius:4px"},{tag:"audio",attributes:{controls:""},style:"width:100%"}]}],$variables:{color:{label:"Color",prefix:"--color-",placeholder:"#007acc"},font:{label:"Font",prefix:"--font-",placeholder:"system-ui, sans-serif"},size:{label:"Size",prefix:"--size-",placeholder:"16px"},other:{label:"Other",prefix:"--",placeholder:"value"}}};var O={$schema:"https://jxsuite.com/schema/v1",$id:"StudioStylebookChrome",$description:"The bar across the top of the Project Styles canvas: the filter that narrows the specimen catalogue, and the toggle that reduces it to the elements this file has already styled. Both are shell state rather than document state — the adapter owns which — and the two names come in as values, because the surface is called Project Styles and the canvas view it draws is the wire word `stylebook`; nothing a reader sees here may be spelled from that. **The bar IS the kit's toolbar now.** It used to write `role=\"toolbar\"` and its own `aria-label` on a `<div>`, which is a role with none of the behaviour under it: two controls, two tab stops, and no arrow key between them. `jx-action-group` is not the element for it — that one roves `jx-action-button` and this bar's first control is a `jx-textfield` — so `jx-toolbar` is, and the field keeps its own arrows while its caret still has text to walk (ui.md §5.5).",tagName:"jx-toolbar",attributes:{part:"chrome"},$props:{label:{$ref:"#/state/title"}},style:{$description:'What `.sb-chrome` said in `styles/overlays.css`, plus the six inline declarations the template carried beside it, plus `.tb-toggle` — all three go dead with this conversion, and none of them is shared with another surface. Three repairs on the way. The bar is one element rather than a positioned box wrapping a `role="toolbar"` row that declared the same flex layout again. The flex layout is not declared here EITHER any more: `display: flex`, `align-items: center`, the `--jx-space-2` gap, the sans face and the foreground colour are all `jx-toolbar`\'s own, so what is left below is only what a positioned BAND is. And `.tb-toggle` read `var(--spectrum-font-size-50, 11px)`, which the kit spells `--jx-text-sm` at the same value; the rest of its drawing is a `jx-action-button` reaching in through `part="control"`, because what it has to look like is a small bordered chip and every fill and control height the kit draws would otherwise have to be taken back off.',position:"absolute",top:"0",left:"0",right:"0",zIndex:"15",flexShrink:"0",padding:"var(--jx-space-2) var(--jx-space-3)",background:"var(--bg-panel)",borderBottom:"1px solid var(--border)",'& [part="filter"]':{flex:"1",maxWidth:"200px"},'& [part="customized"] > [part="control"]':{$description:"Bordered, unfilled and dimmed until it is on, which is what says it is a filter rather than an action: the catalogue it narrows is the thing the reader is looking at, so the control has to be quieter than its subject.",padding:"3px var(--jx-space-3)",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"transparent",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)",":hover":{background:"var(--hover-bg)"}},'& [part="customized"][data-selected] > [part="control"]':{$description:"`data-selected` and not `selected`: the kit reflects the pressed state as a data attribute (`jx-action-button.json`), and the property this document binds never reaches the attribute of the same name.",borderColor:"var(--accent)",background:"var(--accent-15)",color:"var(--accent)"}},children:[{tagName:"jx-textfield",attributes:{part:"filter"},$props:{size:"sm",type:"search",clearable:!0,label:{$ref:"#/state/filterLabel"},placeholder:"Filter…",value:{$ref:"#/state/filter"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setFilter"},value:[{$ref:"event#/target/value"}]}]}},{tagName:"jx-action-button",$description:"`onchange` and not `onclick`: a `toggles` button owns its own pressed state and says so with `change` (`jx-action-button.json`), and an `onclick` written here would replace the element's own click handler on the same property — the toggle would stop flipping and stop announcing `aria-pressed`.",attributes:{part:"customized"},$props:{size:"sm",toggles:!0,selected:{$ref:"#/state/customizedOnly"},label:{$ref:"#/state/customizedLabel"},hint:{$ref:"#/state/customizedHint"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/toggleCustomized"},value:[]}]},children:[{tagName:"span",textContent:"${state.customizedLabel}"}]}]};T("stylebook-chrome",O);function z(e,o){let t=document.createElement("div");t.style.display="contents";let n=v({...e,...o}),r=null,s=!1;function i(){s=!0,R("stylebook-chrome",n,t).then((d)=>{s=!1,r=d})}return i(),{host:t,update(d){if(Object.assign(n,d),s||r!==null&&t.contains(r.root))return;r?.dispose(),r=null,t.textContent="",i()}}}function E(e){return!e.startsWith(":")&&!e.startsWith(".")&&!e.startsWith("&")&&!e.startsWith("[")&&!e.startsWith("@")&&!e.startsWith("--")}function w(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}var M="& .element-card-preview";function Vg(e){let o=e,t={},n=(r)=>{let s={};for(let[i,d]of Object.entries(r))if(i!=="@--")s[i]=d;return s};for(let[r,s]of Object.entries(o)){if(!w(s)){t[r]=s;continue}if(r==="@--")continue;if(Dv(r)){t[r]=s;continue}if(r.startsWith("@")){let i={};for(let[d,g]of Object.entries(s))if(w(g)&&E(d))i[`${M} ${d}`]=n(g);else i[d]=g;t[r]=i;continue}if(E(r)){t[`${M} ${r}`]=n(s);continue}t[r]=s}return t}function I(e,o){let t=o.split(" "),n=e;for(let r of t){if(!w(n))return null;n=n[r]}return w(n)?n:null}function J(e,o){let t=e,n=I(t,o);if(n&&Object.keys(n).length>0)return!0;for(let[r,s]of Object.entries(t)){if(!r.startsWith("@")||!w(s))continue;let i=I(s,o);if(i&&Object.keys(i).length>0)return!0}return!1}function _(e){let o=new Map,t=new Map,n=e.filter.toLowerCase(),r=(a,c,h)=>{let p=a.tag===h?h:`${h} ${a.tag}`;o.set(Rl(c),p);let m=a.children??[];for(let[l,C]of m.entries())r(C,[...c,"children",l],h)},s=(a)=>{let c={...a.attributes};if(a.style)c.style=a.style;return{tagName:a.tag,...a.text?{textContent:a.text}:{},...Object.keys(c).length>0?{attributes:c}:{},...a.children?{children:a.children.map(s)}:{}}},i=(a,c,h,p,m)=>{o.set(Rl(p),a),o.set(Rl([...p,"children",0]),a);let l=[...p,"children",0,"children",0];if(m)r(m,l,a);else o.set(Rl(l),a);if(!t.has(a))t.set(a,p);return{attributes:{class:"element-card"},children:[{attributes:{class:"element-card-preview"},children:[h],tagName:"div"},{attributes:{class:"element-card-label"},tagName:"div",textContent:c}],tagName:"div"}},d=[],g=(a,c)=>({attributes:{class:"sb-section"},children:[{attributes:{class:"sb-label"},tagName:"div",textContent:a},{attributes:{class:"sb-body"},children:c,tagName:"div"}],tagName:"div"}),f=()=>["children",d.length,"children",1];for(let a of e.meta.$sections){let c=a.elements;if(n)c=c.filter((m)=>m.tag.includes(n)||a.label.toLowerCase().includes(n));if(e.customizedOnly)c=c.filter((m)=>J(e.effectiveStyle,m.tag));if(c.length===0)continue;let h=f(),p=c.map((m,l)=>i(m.tag,`<${m.tag}>`,s(m),[...h,"children",l],m));d.push(g(a.label,p))}let b=[];{let a=e.components;if(n)a=a.filter((c)=>c.tagName.toLowerCase().includes(n));if(e.customizedOnly)a=a.filter((c)=>J(e.effectiveStyle,c.tagName));if(a.length>0){let c=f(),h=a.map((p,m)=>{let l=[...c,"children",m];if(p.source!=="npm"&&p.path?.endsWith(".json")){b.push({$ref:`/${e.projectRoot?`${e.projectRoot}/`:""}${p.path}`.replace(/^\/+/,"/")});let j={};for(let k of p.props??[])if(k.default!==void 0&&k.default!=="false"&&k.default!=="''")j[k.name]=String(k.default).replaceAll(/^'|'$/g,"");let q={tagName:p.tagName,...Object.keys(j).length>0?{attributes:j}:{}};return i(p.tagName,`<${p.tagName}>`,q,l,null)}let V={attributes:{class:"sb-fallback"},tagName:"div",textContent:`<${p.tagName}>`};return i(p.tagName,`<${p.tagName}>`,V,l,null)});d.push(g("Components",h))}}if(d.length===0)d.push({attributes:{class:"sb-empty"},tagName:"div",textContent:e.customizedOnly?"No customized elements":"No matching elements"});return{doc:{...b.length>0?{$elements:b}:{},$media:e.effectiveMedia,attributes:{class:"sb-root"},children:d,style:Vg(e.effectiveStyle),tagName:"div"},pathToTag:o,tagToCardPath:t}}var Ug="Project Styles",US="stylebook",ew=[{id:"color",prefix:"--color-",title:"Colors"},{id:"font",prefix:"--font-",title:"Fonts"},{id:"size",prefix:"--size-",title:"Sizes & Spacing"},{id:"other",prefix:"--",title:"Other"}];function L(e){if(e.startsWith("--color"))return"color";if(e.startsWith("--font"))return"font";if(e.startsWith("--size")||e.startsWith("--spacing")||e.startsWith("--radius"))return"size";return"other"}function B_(e){let o=L(e);if(o==="other")return e;let{prefix:t}=ew.find((n)=>n.id===o);return kv(e,t)}function U(e){if(!e)return[];let o=[];for(let[t,n]of Object.entries(e)){if(!t.startsWith("--"))continue;if(typeof n!=="string"&&typeof n!=="number")continue;o.push({group:L(t),label:B_(t),name:t,value:n})}return o}function qS(e){let o=U(e);return ew.map((t)=>({group:t,tokens:o.filter((n)=>n.group===t.id)}))}function GS(e){if(!e)return[];let{featureQueries:o,sizeBreakpoints:t}=hr(e),n=[],r=[];for(let{name:i,query:d}of o){let g=Mu(d);if(g)n.push({key:`@${i}`,kind:"scheme",label:g==="dark"?"Dark":"Light",name:i,scheme:g});else r.push({key:`@${i}`,kind:"feature",label:`@${i}`,name:i})}let s=t.map(({name:i})=>({key:`@${i}`,kind:"size",label:`@${i}`,name:i}));return[...n,...s,...r]}function A(e,o){let t=e[o.key];return t&&typeof t==="object"?t:void 0}function qg(e,o,t){let n=A(e,o)?.[t];return typeof n==="string"||typeof n==="number"?n:void 0}function z_(e,o,t,n){if(n){let s=e[o.key]??={};s[t]=n;return}let r=A(e,o);if(!r)return;if(delete r[t],Object.keys(r).length===0)delete e[o.key]}function KS(e,o,t,n=[]){let r=new Set(n.map((s)=>s.name));return o.filter((s)=>!r.has(s.name)&&qg(e,s,t)===void 0)}var W=new WeakMap;function K(e){let o={customizedHint:"Show only the elements this file has already styled",customizedLabel:"Customized",customizedOnly:y.stylebook.customizedOnly,filter:y.stylebook.filter,filterLabel:`Filter the ${Ug} catalogue`,title:Ug},t=W.get(e);if(t)return t.update(o),t.host;let n=z(o,{setFilter:(r)=>{y.stylebook.filter=r},toggleCustomized:()=>{y.stylebook.customizedOnly=!y.stylebook.customizedOnly}});return W.set(e,n),n.host}async function JS(e,o){let t=e.wrap,n=lt(e.paneId),r=y.stylebook.filter.toLowerCase(),{customizedOnly:s}=y.stylebook,i=Di(n?.doc.document?.$media),{sizeBreakpoints:d,baseWidth:g}=hr(i),f=d.length>0,b=K(e);t.style.overflow="hidden";let S=[];if(f){S.push({displayName:bi("--"),name:"base",width:g});for(let l of d)S.push({displayName:bi(l.name),name:l.name,width:l.width})}let a;if(!f){let l=i&&i["--"],C=l?`${bi("--")} (${g}px)`:null;a=[o.canvasPanelEntry(l?"base":null,C,!l,l?g:void 0)]}else a=S.map((l)=>o.canvasPanelEntry(l.name,`${l.displayName} (${l.width}px)`,!1,l.width));if(!await o.drawStage(e,{frame:"boards",framePart:"panzoom",frameVars:"--boards-inset:40px",handles:"hidden",hug:!1,innerPart:"boards",lead:"chrome",panels:a.map((l)=>l.item)},a))return;let h=o.stageHost(e,"chrome-host");if(h&&h.firstChild!==b)h.replaceChildren(b);let p=_({components:st,customizedOnly:Boolean(s),effectiveMedia:i??{},effectiveStyle:qo(n?.doc.document?.style),filter:r,meta:Gg,projectRoot:D?.projectRoot??null}),{panels:m}=e;for(let{panel:l}of a)m.push(l),EC(e.renderGeneration,p,l.canvas,l._width);if(f)o.updateActivePanelHeaders(e);o.applyTransform(e),o.observeCenterUntilStable(e)}function xu(e,o,{panCanvas:t=!1}={}){if(y.stylebook.selection=e,Ic(u.value,{selection:[[]],ui:{activeSelector:e,rightTab:"style",...o!==void 0?{activeMedia:o}:{}}}),e&&t)$C(e)}var Q=8,tw=[{id:"properties",title:"Content"},{id:"style",title:"Style"},{id:"events",title:"Logic"},{id:"assistant",title:"Assistant"}];function nw(){return{saveDocument:()=>{},undo:()=>{},redo:()=>{},openInBrowser:()=>{},buildSite:()=>{},closeDocument:()=>{},duplicateSelection:()=>{},deleteSelection:()=>{},selectParent:()=>{},toggleDock:()=>{},toggleZen:()=>{},openPalette:()=>{},openProject:()=>{},newWindow:()=>{},panelRoster:[],focusPanel:()=>{},focusInspectorTab:()=>{},cycleRegion:()=>{}}}var x=(e)=>e.document.open,P=(e)=>e.selection.count>0&&e.editor.kind==="canvas",N=(e)=>!e.selection.isRoot&&e.selection.paths.every((o)=>Ol(o)),B="an element selected on the canvas that has a sibling position: not the document root, a repeater's template or a switch case",H=(e)=>e.map((o)=>`[${o.join(", ")}]`).join(" and ");function Yh(e){return[{id:"file.save",title:"Save",category:"File",level:"document",icon:"floppy-disk",keybinding:"mod+s",menus:["commandbar/primary","statusbar/document","palette"],group:"1_file",undo:"none",when:x,requires:"an open document",run:()=>e.saveDocument()},{id:"document.close",title:"Close Document",category:"Document",level:"document",keybinding:"mod+w",menus:["context/tab","palette"],group:"1_file",when:x,requires:"an open document",run:()=>e.closeDocument()},{id:"view.openInBrowser",title:"Open in Browser",category:"View",level:"document",icon:"arrow-square-out",keybinding:"mod+shift+o",menus:["commandbar/primary","statusbar/document","palette"],group:"2_output",when:(t)=>t.project.isSite,enablement:x,requires:"a page to preview",run:()=>e.openInBrowser()},{id:"project.buildSite",title:"Build Site",category:"Project",level:"project",menus:["commandbar/overflow","palette"],group:"2_output",when:(t)=>t.project.isSite,requires:"a site project",run:()=>e.buildSite()},{id:"edit.undo",title:"Undo",category:"Edit",level:"document",icon:"arrow-u-up-left",keybinding:"mod+z",menus:["commandbar/primary","palette"],group:"1_history",when:x,enablement:(t)=>t.document.canUndo,requires:"a change to undo",run:()=>e.undo()},{id:"edit.redo",title:"Redo",category:"Edit",level:"document",icon:"arrow-u-up-right",keybinding:["mod+shift+z","mod+y"],menus:["commandbar/primary","palette"],group:"1_history",when:x,enablement:(t)=>t.document.canRedo,requires:"a change to redo",run:()=>e.redo()},{id:"selection.duplicate",title:"Duplicate",category:"Selection",level:"selection",keyScope:"canvas",keybinding:"mod+d",menus:["blockbar","context/element","context/layer","outline/row","palette"],group:"3_structure",undo:"document",when:P,enablement:N,requires:B,aiTool:{name:"duplicate_node",description:"Duplicate elements in the document, inserting each copy after its original, as one undoable step. The copies become the selection.",report:({after:t})=>{let n=t.selection.paths.length;return`Duplicated ${n} element${n===1?"":"s"}; the ${n===1?"copy is":"copies are"} selected at ${H(t.selection.paths)}.`}},run:()=>e.duplicateSelection()},{id:"selection.repeat",title:"Repeat...",category:"Selection",level:"selection",keyScope:"canvas",menus:["context/element","palette"],group:"3_structure",undo:"document",when:P,enablement:(t)=>N(t)&&!t.selection.isRepeater,requires:"an element with a sibling position that is not already a repeater",run:()=>{(me("7wns8kf1"),import("./convert-to-repeater-7wns8kf1.js")).then(({convertToRepeater:t})=>t())}},{id:"selection.delete",title:"Delete",category:"Selection",level:"selection",keyScope:"canvas",keybinding:["delete","backspace"],menus:["blockbar","context/element","context/layer","outline/row","palette"],group:"9_danger",destructive:!0,undo:"document",when:P,enablement:N,requires:B,aiTool:{name:"delete_node",description:"Delete elements from the document as one undoable step.",report:({before:t,after:n})=>{let r=t.selection.paths.length;return`Deleted ${r} element${r===1?"":"s"} at ${H(t.selection.paths)} in one undo step; the selection is now ${n.selection.count===0?"empty":"elsewhere"}.`}},run:()=>e.deleteSelection()},{id:"selection.selectParent",title:"Select Parent",category:"Selection",level:"selection",keyScope:"canvas",keybinding:["escape","arrowleft"],menus:["palette"],group:"2_navigate",when:P,requires:"an element selection",run:()=>e.selectParent()},{id:"view.toggleNavigator",title:"Toggle Navigator Dock",category:"View",level:"application",keybinding:"mod+b",menus:["commandbar/overflow","palette"],group:"4_docks",run:()=>e.toggleDock("navigator")},{id:"view.toggleInspector",title:"Toggle Inspector Dock",category:"View",level:"application",keybinding:"mod+alt+b",menus:["commandbar/overflow","palette"],group:"4_docks",run:()=>e.toggleDock("inspector")},{id:"view.zen",title:"Zen Mode",category:"View",level:"application",keybinding:"mod+.",menus:["commandbar/overflow","palette"],group:"4_docks",run:()=>e.toggleZen()},{id:"palette.open",title:"Open Command Center",category:"View",level:"application",keybinding:"mod+k",menus:["palette"],group:"5_palette",run:()=>e.openPalette("picker")},{id:"palette.openFiles",title:"Go to File…",category:"File",level:"application",keybinding:"mod+p",menus:["palette"],group:"5_palette",run:()=>e.openPalette("files")},{id:"palette.openCommands",title:"Run Command…",category:"View",level:"application",keybinding:"mod+shift+p",menus:["palette"],group:"5_palette",run:()=>e.openPalette("commands")},{id:"palette.openNodes",title:"Go to Symbol in Document…",category:"Selection",level:"document",menus:["palette"],group:"5_palette",when:x,requires:"an open document",run:()=>e.openPalette("nodes")},{id:"project.open",title:"Open Project…",category:"Project",level:"project",keybinding:"mod+o",menus:["commandbar/overflow","statusbar/project","palette"],group:"1_file",run:()=>e.openProject()},{id:"view.newWindow",title:"New Window",category:"View",level:"application",keybinding:"mod+shift+n",menus:["commandbar/overflow","palette"],group:"1_file",when:(t)=>t.capability.windowControls,requires:"a host that can hold more than one window",run:()=>e.newWindow()},{id:"project.openRecent",title:"Open Recent…",category:"Project",level:"project",menus:["commandbar/overflow","statusbar/project","palette"],group:"1_file",run:()=>e.openPalette("projects")},...Z(e),...Y(e),{id:"view.cycleRegion",title:"Focus Next Region",category:"View",level:"application",keybinding:"f6",menus:["palette"],group:"4_docks",run:()=>e.cycleRegion(1)},{id:"view.cycleRegionBack",title:"Focus Previous Region",category:"View",level:"application",keybinding:"shift+f6",menus:["palette"],group:"4_docks",run:()=>e.cycleRegion(-1)}]}function Z(e){let o=0;return e.panelRoster.map((t)=>{let n={id:`panel.focus.${t.id}`,title:`Show ${t.title}`,category:"View",level:"application",menus:["palette"],group:"4_docks",requires:"an open project",when:(r)=>r.project.open&&(t.when?.(r)??!0),run:()=>e.focusPanel(t.id)};if(t.rail!==!1&&o<Q)o+=1,n.keybinding=`mod+${o}`;return n})}function Y(e){return tw.map((o,t)=>({id:`inspector.focus.${o.id}`,title:`Show ${o.title}`,category:"View",level:"document",keybinding:`mod+shift+${t+1}`,menus:["palette"],group:"4_docks",requires:"an open document",when:(r)=>r.document.open,run:()=>e.focusInspectorTab(o.id)}))}
6
+ export{Vg,Ug,US,ew,B_,qS,GS,qg,z_,KS,Gg,JS,xu,tw,nw,Yh};
7
7
 
8
- //# debugId=672B287246E1308B64756E2164756E21
9
- //# sourceMappingURL=studio-gjknvzam.js.map
8
+ //# debugId=5EDF225B11B8A82B64756E2164756E21
9
+ //# sourceMappingURL=studio-4xv5s47r.js.map
@@ -2,7 +2,7 @@ var C=globalThis,O=(t)=>t,b=C.trustedTypes,j=b?b.createPolicy("lit-html",{create
2
2
  \f\r](?:([^\\s"'>=/]+)([
3
3
  \f\r]*=[
4
4
  \f\r]*(?:[^
5
- \f\r"'\`<>=]|("|')|))|$)`,"g"),R=/'/g,V=/"/g,z=/^(?:script|style|textarea|title)$/i,E=(t)=>(e,...s)=>({_$litType$:t,strings:e,values:s}),br=E(1),J=E(2),K=E(3),Bl=Symbol.for("lit-noChange"),tt=Symbol.for("lit-nothing"),W=new WeakMap,u=g.createTreeWalker(g,129);function Z(t,e){if(!w(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return j!==void 0?j.createHTML(e):e}var k=(t,e)=>{let s=t.length-1,i=[],n,l=e===2?"<svg>":e===3?"<math>":"",r=y;for(let o=0;o<s;o++){let a=t[o],T,h,A=-1,_=0;for(;_<a.length&&(r.lastIndex=_,h=r.exec(a),h!==null);)_=r.lastIndex,r===y?h[1]==="!--"?r=D:h[1]!==void 0?r=L:h[2]!==void 0?(z.test(h[2])&&(n=RegExp("</"+h[2],"g")),r=p):h[3]!==void 0&&(r=p):r===p?h[0]===">"?(r=n??y,A=-1):h[1]===void 0?A=-2:(A=r.lastIndex-h[2].length,T=h[1],r=h[3]===void 0?p:h[3]==='"'?V:R):r===V||r===R?r=p:r===D||r===L?r=y:(r=p,n=void 0);let d=r===p&&t[o+1].startsWith("/>")?" ":"";l+=r===y?a+q:A>=0?(i.push(T),a.slice(0,A)+"$lit$"+a.slice(A)+c+d):a+c+(A===-2?o:d)}return[Z(t,l+(t[s]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]};class N{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let n=0,l=0,r=t.length-1,o=this.parts,[a,T]=k(t,e);if(this.el=N.createElement(a,s),u.currentNode=this.el.content,e===2||e===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(i=u.nextNode())!==null&&o.length<r;){if(i.nodeType===1){if(i.hasAttributes())for(let h of i.getAttributeNames())if(h.endsWith("$lit$")){let A=T[l++],_=i.getAttribute(h).split(c),d=/([.?@])?(.*)/.exec(A);o.push({type:1,index:n,name:d[2],strings:_,ctor:d[1]==="."?I:d[1]==="?"?S:d[1]==="@"?P:v}),i.removeAttribute(h)}else h.startsWith(c)&&(o.push({type:6,index:n}),i.removeAttribute(h));if(z.test(i.tagName)){let h=i.textContent.split(c),A=h.length-1;if(A>0){i.textContent=b?b.emptyScript:"";for(let _=0;_<A;_++)i.append(h[_],x()),u.nextNode(),o.push({type:2,index:++n});i.append(h[A],x())}}}else if(i.nodeType===8)if(i.data===M)o.push({type:2,index:n});else{let h=-1;for(;(h=i.data.indexOf(c,h+1))!==-1;)o.push({type:7,index:n}),h+=c.length-1}n++}}static createElement(t,e){let s=g.createElement("template");return s.innerHTML=t,s}}function f(t,e,s=t,i){if(e===Bl)return e;let n=i!==void 0?s._$Co?.[i]:s._$Cl,l=H(e)?void 0:e._$litDirective$;return n?.constructor!==l&&(n?._$AO?.(!1),l===void 0?n=void 0:(n=new l(t),n._$AT(t,s,i)),i!==void 0?(s._$Co??=[])[i]=n:s._$Cl=n),n!==void 0&&(e=f(t,n._$AS(t,e.values),n,i)),e}class B{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:e},parts:s}=this._$AD,i=(t?.creationScope??g).importNode(e,!0);u.currentNode=i;let n=u.nextNode(),l=0,r=0,o=s[0];for(;o!==void 0;){if(l===o.index){let a;o.type===2?a=new m(n,n.nextSibling,this,t):o.type===1?a=new o.ctor(n,o.name,o.strings,this,t):o.type===6&&(a=new U(n,this,t)),this._$AV.push(a),o=s[++r]}l!==o?.index&&(n=u.nextNode(),l++)}return u.currentNode=g,i}p(t){let e=0;for(let s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class m{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=tt,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=f(this,t,e),H(t)?t===tt||t==null||t===""?(this._$AH!==tt&&this._$AR(),this._$AH=tt):t!==this._$AH&&t!==Bl&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):F(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==tt&&H(this._$AH)?this._$AA.nextSibling.data=t:this.T(g.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:s}=t,i=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=N.createElement(Z(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(e);else{let n=new B(i,this),l=n.u(this.options);n.p(e),this.T(l),this._$AH=n}}_$AC(t){let e=W.get(t.strings);return e===void 0&&W.set(t.strings,e=new N(t)),e}k(t){w(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,s,i=0;for(let n of t)i===e.length?e.push(s=new m(this.O(x()),this.O(x()),this,this.options)):s=e[i],s._$AI(n),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){let s=O(t).nextSibling;O(t).remove(),t=s}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}}class v{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,n){this.type=1,this._$AH=tt,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=n,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=tt}_$AI(t,e=this,s,i){let n=this.strings,l=!1;if(n===void 0)t=f(this,t,e,0),l=!H(t)||t!==this._$AH&&t!==Bl,l&&(this._$AH=t);else{let r=t,o,a;for(t=n[0],o=0;o<n.length-1;o++)a=f(this,r[s+o],e,o),a===Bl&&(a=this._$AH[o]),l||=!H(a)||a!==this._$AH[o],a===tt?t=tt:t!==tt&&(t+=(a??"")+n[o+1]),this._$AH[o]=a}l&&!i&&this.j(t)}j(t){t===tt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class I extends v{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===tt?void 0:t}}class S extends v{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==tt)}}class P extends v{constructor(t,e,s,i,n){super(t,e,s,i,n),this.type=5}_$AI(t,e=this){if((t=f(this,t,e,0)??tt)===Bl)return;let s=this._$AH,i=t===tt&&s!==tt||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==tt&&(s===tt||i);i&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class U{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){f(this,t)}}var bk={M:"$lit$",P:c,A:M,C:1,L:k,R:B,D:F,V:f,I:m,H:v,N:S,U:P,B:I,F:U},G=C.litHtmlPolyfillSupport;G?.(N,m),(C.litHtmlVersions??=[]).push("3.3.3");var Ni=(t,e,s)=>{let i=s?.renderBefore??e,n=i._$litPart$;if(n===void 0){let l=s?.renderBefore??null;i._$litPart$=n=new m(e.insertBefore(x(),l),l,void 0,s??{})}return n._$AI(t),n};export{br,Bl,tt,bk,Ni};
5
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),R=/'/g,V=/"/g,z=/^(?:script|style|textarea|title)$/i,E=(t)=>(e,...s)=>({_$litType$:t,strings:e,values:s}),br=E(1),J=E(2),K=E(3),zl=Symbol.for("lit-noChange"),tt=Symbol.for("lit-nothing"),W=new WeakMap,u=g.createTreeWalker(g,129);function Z(t,e){if(!w(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return j!==void 0?j.createHTML(e):e}var k=(t,e)=>{let s=t.length-1,i=[],n,l=e===2?"<svg>":e===3?"<math>":"",r=y;for(let o=0;o<s;o++){let a=t[o],T,h,A=-1,_=0;for(;_<a.length&&(r.lastIndex=_,h=r.exec(a),h!==null);)_=r.lastIndex,r===y?h[1]==="!--"?r=D:h[1]!==void 0?r=L:h[2]!==void 0?(z.test(h[2])&&(n=RegExp("</"+h[2],"g")),r=p):h[3]!==void 0&&(r=p):r===p?h[0]===">"?(r=n??y,A=-1):h[1]===void 0?A=-2:(A=r.lastIndex-h[2].length,T=h[1],r=h[3]===void 0?p:h[3]==='"'?V:R):r===V||r===R?r=p:r===D||r===L?r=y:(r=p,n=void 0);let d=r===p&&t[o+1].startsWith("/>")?" ":"";l+=r===y?a+q:A>=0?(i.push(T),a.slice(0,A)+"$lit$"+a.slice(A)+c+d):a+c+(A===-2?o:d)}return[Z(t,l+(t[s]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]};class N{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let n=0,l=0,r=t.length-1,o=this.parts,[a,T]=k(t,e);if(this.el=N.createElement(a,s),u.currentNode=this.el.content,e===2||e===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(i=u.nextNode())!==null&&o.length<r;){if(i.nodeType===1){if(i.hasAttributes())for(let h of i.getAttributeNames())if(h.endsWith("$lit$")){let A=T[l++],_=i.getAttribute(h).split(c),d=/([.?@])?(.*)/.exec(A);o.push({type:1,index:n,name:d[2],strings:_,ctor:d[1]==="."?I:d[1]==="?"?S:d[1]==="@"?P:v}),i.removeAttribute(h)}else h.startsWith(c)&&(o.push({type:6,index:n}),i.removeAttribute(h));if(z.test(i.tagName)){let h=i.textContent.split(c),A=h.length-1;if(A>0){i.textContent=b?b.emptyScript:"";for(let _=0;_<A;_++)i.append(h[_],x()),u.nextNode(),o.push({type:2,index:++n});i.append(h[A],x())}}}else if(i.nodeType===8)if(i.data===M)o.push({type:2,index:n});else{let h=-1;for(;(h=i.data.indexOf(c,h+1))!==-1;)o.push({type:7,index:n}),h+=c.length-1}n++}}static createElement(t,e){let s=g.createElement("template");return s.innerHTML=t,s}}function f(t,e,s=t,i){if(e===zl)return e;let n=i!==void 0?s._$Co?.[i]:s._$Cl,l=H(e)?void 0:e._$litDirective$;return n?.constructor!==l&&(n?._$AO?.(!1),l===void 0?n=void 0:(n=new l(t),n._$AT(t,s,i)),i!==void 0?(s._$Co??=[])[i]=n:s._$Cl=n),n!==void 0&&(e=f(t,n._$AS(t,e.values),n,i)),e}class B{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:e},parts:s}=this._$AD,i=(t?.creationScope??g).importNode(e,!0);u.currentNode=i;let n=u.nextNode(),l=0,r=0,o=s[0];for(;o!==void 0;){if(l===o.index){let a;o.type===2?a=new m(n,n.nextSibling,this,t):o.type===1?a=new o.ctor(n,o.name,o.strings,this,t):o.type===6&&(a=new U(n,this,t)),this._$AV.push(a),o=s[++r]}l!==o?.index&&(n=u.nextNode(),l++)}return u.currentNode=g,i}p(t){let e=0;for(let s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class m{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=tt,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=f(this,t,e),H(t)?t===tt||t==null||t===""?(this._$AH!==tt&&this._$AR(),this._$AH=tt):t!==this._$AH&&t!==zl&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):F(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==tt&&H(this._$AH)?this._$AA.nextSibling.data=t:this.T(g.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:s}=t,i=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=N.createElement(Z(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(e);else{let n=new B(i,this),l=n.u(this.options);n.p(e),this.T(l),this._$AH=n}}_$AC(t){let e=W.get(t.strings);return e===void 0&&W.set(t.strings,e=new N(t)),e}k(t){w(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,s,i=0;for(let n of t)i===e.length?e.push(s=new m(this.O(x()),this.O(x()),this,this.options)):s=e[i],s._$AI(n),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){let s=O(t).nextSibling;O(t).remove(),t=s}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}}class v{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,n){this.type=1,this._$AH=tt,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=n,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=tt}_$AI(t,e=this,s,i){let n=this.strings,l=!1;if(n===void 0)t=f(this,t,e,0),l=!H(t)||t!==this._$AH&&t!==zl,l&&(this._$AH=t);else{let r=t,o,a;for(t=n[0],o=0;o<n.length-1;o++)a=f(this,r[s+o],e,o),a===zl&&(a=this._$AH[o]),l||=!H(a)||a!==this._$AH[o],a===tt?t=tt:t!==tt&&(t+=(a??"")+n[o+1]),this._$AH[o]=a}l&&!i&&this.j(t)}j(t){t===tt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class I extends v{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===tt?void 0:t}}class S extends v{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==tt)}}class P extends v{constructor(t,e,s,i,n){super(t,e,s,i,n),this.type=5}_$AI(t,e=this){if((t=f(this,t,e,0)??tt)===zl)return;let s=this._$AH,i=t===tt&&s!==tt||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==tt&&(s===tt||i);i&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class U{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){f(this,t)}}var yk={M:"$lit$",P:c,A:M,C:1,L:k,R:B,D:F,V:f,I:m,H:v,N:S,U:P,B:I,F:U},G=C.litHtmlPolyfillSupport;G?.(N,m),(C.litHtmlVersions??=[]).push("3.3.3");var Ni=(t,e,s)=>{let i=s?.renderBefore??e,n=i._$litPart$;if(n===void 0){let l=s?.renderBefore??null;i._$litPart$=n=new m(e.insertBefore(x(),l),l,void 0,s??{})}return n._$AI(t),n};export{br,zl,tt,yk,Ni};
6
6
 
7
- //# debugId=732581C40428621064756E2164756E21
8
- //# sourceMappingURL=studio-sxc0zvpt.js.map
7
+ //# debugId=7591B26DF15D755E64756E2164756E21
8
+ //# sourceMappingURL=studio-5g0ag7c0.js.map
@@ -1,5 +1,5 @@
1
- import{p,We}from"./studio-y7jehjrp.js";import{k}from"./studio-fqq890ap.js";function h(e){return e.trim().replace(/\/+$/,"")}function u(e){return e.trim()}var _t={aiBaseUrl:{default:"",key:"jx.ai.baseUrl",normalize:h,scope:"user"},aiOpenAiKey:{default:"",key:"jx.ai.openaiKey",normalize:u,scope:"user",secret:!0},aiModel:{default:"gpt-4o",key:"jx.ai.model",normalize:u,scope:"user"},keybindings:{default:"",key:"jx.keybindings",normalize:(e)=>e.trim()==="{}"?"":e.trim(),scope:"user"},theme:{default:"",key:"jx-studio-theme",normalize:u,scope:"user"},showIgnoredFiles:{default:"",key:"jx.files.showIgnored",normalize:u,scope:"user"},cfAccountId:{default:"",key:"jx.cf.accountId",normalize:u,scope:"user"},cfToken:{default:"",key:"jx.cf.token",normalize:u,scope:"user",secret:!0}},S=Object.values(_t),l=S.filter((e)=>e.scope==="user"),P=l.map((e)=>e.key);function y(e){let t=e.schedule??queueMicrotask,n=null,i=Promise.resolve(),r=Promise.resolve();function s(){let o=n;if(n=null,!o)return i;return i=i.then(()=>e.send(o)).catch((a)=>{e.onError?.(a,o)}),i}return{enqueue(o){if(n){Object.assign(n,o);return}n={...o},r=new Promise((a)=>{t(()=>{s().then(a)})})},settled(){return r}}}var c=new Map;function v(e,t){try{if(t===null)globalThis.localStorage?.removeItem(e);else globalThis.localStorage?.setItem(e,t)}catch{}}try{for(let e of S){let t=globalThis.localStorage?.getItem(e.key);if(t!==null&&t!==void 0)c.set(e.key,t)}}catch{}function Lr(e){return c.get(e.key)??""}function aL(e){return(c.get(e.key)??"")!==""}var m=new Set;function Xb(e){return m.add(e),()=>{m.delete(e)}}function f(e){for(let t of m)t(e)}var g=y({onError(e){k("error","Your settings could not be saved.",{detail:e instanceof Error?e.message:String(e),key:"settings-write",source:"Settings"})},async send(e){if(!We())return;let t=p();if(!t.patchSettings)return;let n={},i=[];for(let[r,s]of Object.entries(e))if(s)n[r]=s;else i.push(r);await t.patchSettings({remove:i,set:n})}});function lL(){return g.settled()}function d(e){let t=[];for(let[n,i]of Object.entries(e)){if((c.get(n)??null)===i)continue;if(i===null)c.delete(n);else c.set(n,i);v(n,i),t.push(n)}return t}function Qb(e,t){return e.normalize?e.normalize(t):t}function qr(e,t){let n=Qb(e,t),i=d({[e.key]:n});if(i.length>0)g.enqueue({[e.key]:n}),f(i)}function cL(e){let t={};for(let[i,r]of e)t[i.key]=Qb(i,r);let n=d(t);if(n.length>0)g.enqueue(t),f(n)}function Hu(e){let t={};for(let i of e)t[i.key]=null;let n=d(t);if(n.length>0)g.enqueue(t),f(n)}async function dL(){if(!We())return;let e=p();if(!e.getSettings)return;let t;try{t=await e.getSettings()}catch{return}let n={},i=!1;for(let s of l){let o=t[s.key];if(o)n[s.key]=o;else if(c.get(s.key))i=!0}let r=d(n);if(r.length>0)f(r);if(i){let s={};for(let o of l){let a=c.get(o.key);if(a&&!t[o.key])s[o.key]=a}g.enqueue(s)}}function x(e){let t={};for(let i of l)t[i.key]=e[i.key]??null;let n=d(t);if(n.length>0)f(n)}function uL(){if(!We())return;p().subscribeSettings?.(x)}
2
- export{_t,Lr,aL,Xb,lL,Qb,qr,cL,Hu,dL,uL};
1
+ import{p,We}from"./studio-qpqa7vk3.js";import{k}from"./studio-vzacdfsc.js";function h(e){return e.trim().replace(/\/+$/,"")}function u(e){return e.trim()}var _t={aiBaseUrl:{default:"",key:"jx.ai.baseUrl",normalize:h,scope:"user"},aiOpenAiKey:{default:"",key:"jx.ai.openaiKey",normalize:u,scope:"user",secret:!0},aiModel:{default:"gpt-4o",key:"jx.ai.model",normalize:u,scope:"user"},keybindings:{default:"",key:"jx.keybindings",normalize:(e)=>e.trim()==="{}"?"":e.trim(),scope:"user"},theme:{default:"",key:"jx-studio-theme",normalize:u,scope:"user"},showIgnoredFiles:{default:"",key:"jx.files.showIgnored",normalize:u,scope:"user"},cfAccountId:{default:"",key:"jx.cf.accountId",normalize:u,scope:"user"},cfToken:{default:"",key:"jx.cf.token",normalize:u,scope:"user",secret:!0}},S=Object.values(_t),l=S.filter((e)=>e.scope==="user"),P=l.map((e)=>e.key);function y(e){let t=e.schedule??queueMicrotask,n=null,i=Promise.resolve(),r=Promise.resolve();function s(){let o=n;if(n=null,!o)return i;return i=i.then(()=>e.send(o)).catch((a)=>{e.onError?.(a,o)}),i}return{enqueue(o){if(n){Object.assign(n,o);return}n={...o},r=new Promise((a)=>{t(()=>{s().then(a)})})},settled(){return r}}}var c=new Map;function v(e,t){try{if(t===null)globalThis.localStorage?.removeItem(e);else globalThis.localStorage?.setItem(e,t)}catch{}}try{for(let e of S){let t=globalThis.localStorage?.getItem(e.key);if(t!==null&&t!==void 0)c.set(e.key,t)}}catch{}function Lr(e){return c.get(e.key)??""}function cL(e){return(c.get(e.key)??"")!==""}var m=new Set;function Qb(e){return m.add(e),()=>{m.delete(e)}}function f(e){for(let t of m)t(e)}var g=y({onError(e){k("error","Your settings could not be saved.",{detail:e instanceof Error?e.message:String(e),key:"settings-write",source:"Settings"})},async send(e){if(!We())return;let t=p();if(!t.patchSettings)return;let n={},i=[];for(let[r,s]of Object.entries(e))if(s)n[r]=s;else i.push(r);await t.patchSettings({remove:i,set:n})}});function dL(){return g.settled()}function d(e){let t=[];for(let[n,i]of Object.entries(e)){if((c.get(n)??null)===i)continue;if(i===null)c.delete(n);else c.set(n,i);v(n,i),t.push(n)}return t}function ev(e,t){return e.normalize?e.normalize(t):t}function qr(e,t){let n=ev(e,t),i=d({[e.key]:n});if(i.length>0)g.enqueue({[e.key]:n}),f(i)}function uL(e){let t={};for(let[i,r]of e)t[i.key]=ev(i,r);let n=d(t);if(n.length>0)g.enqueue(t),f(n)}function Bu(e){let t={};for(let i of e)t[i.key]=null;let n=d(t);if(n.length>0)g.enqueue(t),f(n)}async function hL(){if(!We())return;let e=p();if(!e.getSettings)return;let t;try{t=await e.getSettings()}catch{return}let n={},i=!1;for(let s of l){let o=t[s.key];if(o)n[s.key]=o;else if(c.get(s.key))i=!0}let r=d(n);if(r.length>0)f(r);if(i){let s={};for(let o of l){let a=c.get(o.key);if(a&&!t[o.key])s[o.key]=a}g.enqueue(s)}}function x(e){let t={};for(let i of l)t[i.key]=e[i.key]??null;let n=d(t);if(n.length>0)f(n)}function pL(){if(!We())return;p().subscribeSettings?.(x)}
2
+ export{_t,Lr,cL,Qb,dL,ev,qr,uL,Bu,hL,pL};
3
3
 
4
- //# debugId=B77F0A03C3A129AC64756E2164756E21
5
- //# sourceMappingURL=studio-semd1s8s.js.map
4
+ //# debugId=A77F1FEF8FA8672A64756E2164756E21
5
+ //# sourceMappingURL=studio-5g4t8v6w.js.map
@@ -0,0 +1,5 @@
1
+ var e=new Set;function bE(r){return e.add(r),()=>e.delete(r)}function vE(){let r=[];for(let t of e)try{let o=t();if(o)r.push(o)}catch{}return r}
2
+ export{bE,vE};
3
+
4
+ //# debugId=B7CA6AC50D4B03CD64756E2164756E21
5
+ //# sourceMappingURL=studio-5py436sf.js.map
@@ -1,5 +1,5 @@
1
- function Zy(o){if(o===null||typeof o!=="object")return{offer:[],refused:null};let e=o;if(e.collab===!1){let t=typeof e.detail==="string"?e.detail.trim():"";return{offer:[],refused:t||"This server has collaboration disabled."}}let{protocols:r}=e;if(!Array.isArray(r)||r.length===0)return{offer:[],refused:null};if(r.includes("jx.collab.v1"))return{offer:["jx.collab.v1"],refused:null};let n=r.filter((t)=>typeof t==="string").join(", ")||"none";return{offer:[],refused:`This server speaks collab envelope ${n}; this editor speaks jx.collab.v1.`}}
2
- export{Zy};
1
+ function Xy(o){if(o===null||typeof o!=="object")return{offer:[],refused:null};let e=o;if(e.collab===!1){let t=typeof e.detail==="string"?e.detail.trim():"";return{offer:[],refused:t||"This server has collaboration disabled."}}let{protocols:r}=e;if(!Array.isArray(r)||r.length===0)return{offer:[],refused:null};if(r.includes("jx.collab.v1"))return{offer:["jx.collab.v1"],refused:null};let n=r.filter((t)=>typeof t==="string").join(", ")||"none";return{offer:[],refused:`This server speaks collab envelope ${n}; this editor speaks jx.collab.v1.`}}
2
+ export{Xy};
3
3
 
4
- //# debugId=9E2F4DC69B554C8964756E2164756E21
5
- //# sourceMappingURL=studio-aje966s9.js.map
4
+ //# debugId=B08485D2E7AF80C964756E2164756E21
5
+ //# sourceMappingURL=studio-77kt594t.js.map
@@ -1,10 +1,10 @@
1
- import{v}from"./studio-fqq890ap.js";import{$o,bL,ot,Jo,Se,He,qu,m,No,ci}from"./studio-x5g1xk77.js";import{p}from"./studio-y7jehjrp.js";import{qt,Zt}from"./studio-cqmtbg2p.js";import{T,R,bs,Ct}from"./studio-7qvs7v0m.js";import{te}from"./studio-ery42sqr.js";import{Ir}from"./studio-xkfs0dp2.js";import{Ps,mc}from"./studio-mk00zd5d.js";import{Fw,R1,$1}from"./studio-xg1942as.js";import{Ld,Gi}from"./studio-e47215hh.js";import{ds,Kf,vb,yb,Iu,Io,Ru}from"./studio-qa73881a.js";import{D}from"./studio-tp642n5g.js";var I={$schema:"https://jxsuite.com/schema/v1",$id:"StudioGridOpen",$description:"Every grid-able source a project has, grouped by where it comes from: the project's own pages and content collections first, then each connection's tables. It is the ISLAND of a confirm dialog rather than a dialog of its own — `ui/layers.ts`'s dialog owns the headline, the cancel button, modality and focus, and this document is only the list — because a second answer to \"what is a dialog\" is a defect (studio-ui-guidelines.md §12.5). Group headings are why it is not the kit menu: a menu row can carry a divider above it and cannot carry a name for the run it opens.",tagName:"div",attributes:{part:"sources"},style:{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)",minWidth:"280px",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-md)",color:"var(--fg)",'& [part="group-title"]':{margin:"0",fontSize:"var(--jx-text-xs)",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.04em",color:"var(--fg-dim)"},'& [part="rows"]':{display:"flex",flexDirection:"column",gap:"1px",marginTop:"var(--jx-space-1)"},'& [part="source"]':{textAlign:"left",background:"none",border:"none",color:"var(--fg)",font:"inherit",padding:"var(--jx-space-2) var(--jx-space-2)",borderRadius:"var(--jx-radius-sm)",cursor:"pointer"},'& [part="source"]:hover':{background:"var(--bg-hover)"},'& [part="source"]:focus-visible':{outline:"var(--jx-focus-ring)",outlineOffset:"-2px"},'& [part="group-empty"]':{margin:"0",padding:"var(--jx-space-2)",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"}},children:[{$prototype:"Array",items:{$ref:"#/state/groups"},key:{$ref:"$map/item/key"},map:{$description:"One origin of grid-able sources. A connection with no tables says why it has none instead of drawing an empty box — an author who has not pushed a schema yet is exactly the reader who needs the sentence.",tagName:"section",attributes:{part:"group","data-group":"${$map.item.key}"},children:[{tagName:"h3",attributes:{part:"group-title"},textContent:"${$map.item.title}"},{tagName:"div",attributes:{part:"rows"},$switch:{$ref:"$map/item/state"},cases:{listed:{tagName:"div",attributes:{part:"rows-list",role:"none"},style:{display:"contents"},children:[{$prototype:"Array",items:{$ref:"$map/item/rows"},key:{$ref:"$map/item/id"},map:{tagName:"button",attributes:{part:"source",type:"button","data-source":"${$map.item.id}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/open"},value:[{$ref:"$map/item/id"}]}]},textContent:"${$map.item.label}"}}]},empty:{tagName:"p",attributes:{part:"group-empty"},textContent:"${$map.item.emptyMessage}"}}}]}}]};T("grid-open",I);function j(e,r,t){let n=v({groups:r,open:t}),o=null,i=!1,s=R("grid-open",n,e).then((l)=>{if(i)return l.dispose(),l.root;return o=l,l.root});return{dispose(){i=!0,o?.dispose(),o=null},ready:s}}function S(){try{return p()}catch{return null}}function Rw(){return typeof S()?.dataRows==="function"}async function E(){let e=S();if(typeof e?.dataConnections!=="function")return null;return e.dataConnections()}async function SE(e){let r=S();if(typeof r?.dataConnectionTest!=="function")return{error:"Connection tests are not supported by this backend",ok:!1};try{return await r.dataConnectionTest(e)}catch(t){return{error:t instanceof Error?t.message:String(t),ok:!1}}}async function _1(e){let r=S();if(typeof r?.dataPush!=="function")return{applied:!1,errors:["Schema push is not supported by this backend"],plan:[]};try{return await r.dataPush(e)}catch(t){return{applied:!1,errors:[t instanceof Error?t.message:String(t)],plan:[]}}}function C(e){let t=S()?.[e];if(t===void 0||t===null)throw Error(`The ${String(e)} surface is not supported by this backend`);return t}function x(e){return C("dataRows")(e)}function M(e){return C("dataInsertRow")(e)}function A(e){return C("dataUpdateRow")(e)}function K(e){return C("dataDeleteRow")(e)}function EE(e,r,t){let n=(s)=>s.replaceAll(/([a-z0-9])([A-Z])/g,"$1_$2").replaceAll(/[^A-Za-z0-9]+/g,"_").replaceAll(/^_+|_+$/g,"").toUpperCase(),i=[r??e,t.replace(/Env$/,"")].map((s)=>n(s)).filter(Boolean).join("_")||"SECRET";return/^\d/.test(i)?`JX_${i}`:i}function W(e){let r=[],t=[],n="",o=!1,i=!1,s=()=>{t.push(n),n="",i=!1},l=()=>{if(s(),t.length===1&&t[0]===""){t=[];return}r.push(t),t=[]};for(let a=0;a<e.length;a++){let c=e[a];if(o){if(c==='"')if(e[a+1]==='"')n+='"',a+=1;else o=!1;else n+=c;continue}if(c==='"'&&!i)o=!0,i=!0;else if(c==='"')n+=c;else if(c===",")s();else if(c===`
1
+ import{v}from"./studio-vzacdfsc.js";import{$o,yL,ot,Jo,Se,He,Gu,m,No,ci}from"./studio-3aey7dd3.js";import{p}from"./studio-qpqa7vk3.js";import{qt,Zt}from"./studio-tt2nactf.js";import{T,R,bs,Ct}from"./studio-e7xxa0sj.js";import{te}from"./studio-ery42sqr.js";import{Ir}from"./studio-3bpdkq2s.js";import{Ps,gc}from"./studio-skprc6ef.js";import{jw,D1,A1}from"./studio-g5fmf0c1.js";import{Id,Gi}from"./studio-4m3826v2.js";import{ds,Jf,yb,wb,Ru,Io,$u}from"./studio-qvasen3f.js";import{D}from"./studio-wgh5kxpj.js";var I={$schema:"https://jxsuite.com/schema/v1",$id:"StudioGridOpen",$description:"Every grid-able source a project has, grouped by where it comes from: the project's own pages and content collections first, then each connection's tables. It is the ISLAND of a confirm dialog rather than a dialog of its own — `ui/layers.ts`'s dialog owns the headline, the cancel button, modality and focus, and this document is only the list — because a second answer to \"what is a dialog\" is a defect (studio-ui-guidelines.md §12.5). Group headings are why it is not the kit menu: a menu row can carry a divider above it and cannot carry a name for the run it opens.",tagName:"div",attributes:{part:"sources"},style:{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)",minWidth:"280px",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-md)",color:"var(--fg)",'& [part="group-title"]':{margin:"0",fontSize:"var(--jx-text-xs)",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.04em",color:"var(--fg-dim)"},'& [part="rows"]':{display:"flex",flexDirection:"column",gap:"1px",marginTop:"var(--jx-space-1)"},'& [part="source"]':{textAlign:"left",background:"none",border:"none",color:"var(--fg)",font:"inherit",padding:"var(--jx-space-2) var(--jx-space-2)",borderRadius:"var(--jx-radius-sm)",cursor:"pointer"},'& [part="source"]:hover':{background:"var(--bg-hover)"},'& [part="source"]:focus-visible':{outline:"var(--jx-focus-ring)",outlineOffset:"-2px"},'& [part="group-empty"]':{margin:"0",padding:"var(--jx-space-2)",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"}},children:[{$prototype:"Array",items:{$ref:"#/state/groups"},key:{$ref:"$map/item/key"},map:{$description:"One origin of grid-able sources. A connection with no tables says why it has none instead of drawing an empty box — an author who has not pushed a schema yet is exactly the reader who needs the sentence.",tagName:"section",attributes:{part:"group","data-group":"${$map.item.key}"},children:[{tagName:"h3",attributes:{part:"group-title"},textContent:"${$map.item.title}"},{tagName:"div",attributes:{part:"rows"},$switch:{$ref:"$map/item/state"},cases:{listed:{tagName:"div",attributes:{part:"rows-list",role:"none"},style:{display:"contents"},children:[{$prototype:"Array",items:{$ref:"$map/item/rows"},key:{$ref:"$map/item/id"},map:{tagName:"button",attributes:{part:"source",type:"button","data-source":"${$map.item.id}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/open"},value:[{$ref:"$map/item/id"}]}]},textContent:"${$map.item.label}"}}]},empty:{tagName:"p",attributes:{part:"group-empty"},textContent:"${$map.item.emptyMessage}"}}}]}}]};T("grid-open",I);function j(e,r,t){let n=v({groups:r,open:t}),o=null,i=!1,s=R("grid-open",n,e).then((l)=>{if(i)return l.dispose(),l.root;return o=l,l.root});return{dispose(){i=!0,o?.dispose(),o=null},ready:s}}function S(){try{return p()}catch{return null}}function $w(){return typeof S()?.dataRows==="function"}async function E(){let e=S();if(typeof e?.dataConnections!=="function")return null;return e.dataConnections()}async function TE(e){let r=S();if(typeof r?.dataConnectionTest!=="function")return{error:"Connection tests are not supported by this backend",ok:!1};try{return await r.dataConnectionTest(e)}catch(t){return{error:t instanceof Error?t.message:String(t),ok:!1}}}async function k1(e){let r=S();if(typeof r?.dataPush!=="function")return{applied:!1,errors:["Schema push is not supported by this backend"],plan:[]};try{return await r.dataPush(e)}catch(t){return{applied:!1,errors:[t instanceof Error?t.message:String(t)],plan:[]}}}function C(e){let t=S()?.[e];if(t===void 0||t===null)throw Error(`The ${String(e)} surface is not supported by this backend`);return t}function x(e){return C("dataRows")(e)}function M(e){return C("dataInsertRow")(e)}function A(e){return C("dataUpdateRow")(e)}function K(e){return C("dataDeleteRow")(e)}function LE(e,r,t){let n=(s)=>s.replaceAll(/([a-z0-9])([A-Z])/g,"$1_$2").replaceAll(/[^A-Za-z0-9]+/g,"_").replaceAll(/^_+|_+$/g,"").toUpperCase(),i=[r??e,t.replace(/Env$/,"")].map((s)=>n(s)).filter(Boolean).join("_")||"SECRET";return/^\d/.test(i)?`JX_${i}`:i}function W(e){let r=[],t=[],n="",o=!1,i=!1,s=()=>{t.push(n),n="",i=!1},l=()=>{if(s(),t.length===1&&t[0]===""){t=[];return}r.push(t),t=[]};for(let a=0;a<e.length;a++){let c=e[a];if(o){if(c==='"')if(e[a+1]==='"')n+='"',a+=1;else o=!1;else n+=c;continue}if(c==='"'&&!i)o=!0,i=!0;else if(c==='"')n+=c;else if(c===",")s();else if(c===`
2
2
  `)l();else if(c==="\r"){if(e[a+1]===`
3
- `)a+=1;l()}else n+=c,i=!0}if(n!==""||t.length>0)l();return r}function $w(e){let r=(e.match(/\r\n/g)??[]).length,t=(e.match(/(?<!\r)\n/g)??[]).length,n=r>t?`\r
3
+ `)a+=1;l()}else n+=c,i=!0}if(n!==""||t.length>0)l();return r}function Dw(e){let r=(e.match(/\r\n/g)??[]).length,t=(e.match(/(?<!\r)\n/g)??[]).length,n=r>t?`\r
4
4
  `:`
5
5
  `,o=e.endsWith(`
6
- `),i=W(e),s=i[0]??[],l=i.slice(1),a=Math.max(s.length,...l.map((c)=>c.length),0);while(s.length<a)s.push("");for(let c of l)while(c.length<a)c.push("");return{eol:n,headers:s,rows:l,trailingNewline:o}}function U(e){if(/[",\n\r]/.test(e))return`"${e.replaceAll('"','""')}"`;return e}function k(e){return[e.headers,...e.rows].map((t)=>t.map((n)=>U(n)).join(",")).join(e.eol)+(e.trailingNewline?e.eol:"")}var Q=["id","sku","slug","Slug"];function q(e){let r=new Set;return e.map((t,n)=>{let o=t.trim()===""?`column${n+1}`:t;if(r.has(o))o=`${o}__${n+1}`;return r.add(o),o})}function J(e,r){for(let t of Q){let n=e.indexOf(t);if(n===-1)continue;let o=r.rows.map((i)=>i[n]??"");if(o.every((i)=>i!=="")&&new Set(o).size===o.length)return t}return null}function O(e,r){let t=$w(e),n=q(t.headers),o=J(n,t),i=o?n.indexOf(o):-1,s=t.rows.map((d,u)=>i===-1?String(u):d[i]),l=new Map(s.map((d,u)=>[d,u])),a=qu(r,D?.projectConfig),c=a?.schema?.properties??{},y=t.rows.slice(0,50).map((d)=>{let u={};for(let[h,w]of n.entries())u[w]=d[h]??"";return u}),f=new Map(yb(y).map((d)=>[d.field,d])),g=new Map(vb(a?.schema,{idField:o??void 0}).map((d)=>[d.field,d]));return{columns:n.map((d,u)=>{let w=(d in c?g.get(d):void 0)??f.get(d)??{editable:!0,field:d,kind:"string",title:t.headers[u]||d};return{...w,pk:d===o,title:t.headers[u]?.trim()||w.title}}),doc:t,fields:n,keys:s,keyToIndex:l,loadText:e}}function X(e,r){let t={},n=e.doc.rows[r]??[];for(let[o,i]of e.fields.entries()){let s=e.columns[o],l=n[o]??"";t[i]=s.kind==="string"||s.kind==="text"||s.kind==="readonly"?l:Iu(l,s)}return t}function _(e,r){let t=e.doc.rows.map((i)=>[...i]),n=(i)=>e.fields.indexOf(i);for(let i of r.cells){let s=e.keyToIndex.get(i.rowKey),l=n(i.field);if(s===void 0||l===-1)continue;t[s][l]=Io(i.value)}for(let i of r.inserts){let s=e.fields.map((l)=>Io(i.cells[l]??null));t.push(s)}let o=r.deletes.map((i)=>e.keyToIndex.get(i.rowKey)).filter((i)=>i!==void 0).toSorted((i,s)=>s-i);for(let i of o)t.splice(i,1);return{...e.doc,rows:t}}function N(e,r){return{cells:e.cells.map((t)=>({field:t.field,rowKey:t.rowKey,...r})),deletes:e.deletes.map((t)=>({rowKey:t.rowKey,...r})),inserts:e.inserts.map((t)=>({error:r.error,ok:r.ok,tempKey:t.tempKey}))}}function Dw(e){let r=null,t=(n=!1)=>{if(!n&&r)return r;return r=p().readFile(e).then((o)=>O(o,e)),r};return{backingPaths:()=>new Map([[e,"*"]]),capabilities:{delete:!0,insert:!0,remotePaging:!1,remoteSort:!1},async columns(){return(await t()).columns},async commit(n){let o=await t(),i=p(),s=null;try{s=await i.readFile(e)}catch{s=null}if(s!==o.loadText&&!mc(e))return N(n,{error:"File changed on disk — refresh to reload",ok:!1,stale:!0});let l=_(o,n),a=k(l);return Ps(e),await i.writeFile(e,a),r=Promise.resolve(O(a,e)),N(n,{ok:!0})},id:e,label:e.split("/").pop()??e,async refresh(){await t(!0)},async rows(){let n=await t(),o=n.doc.rows.map((i,s)=>({cells:X(n,s),key:n.keys[s]}));return{rows:o,total:o.length}},async serializeForSource(n){let o=await t();return k(_(o,n))}}}var Z=50;function ee(e){let r=e.toLowerCase();if(/(int|real|floa|doub|num|dec)/.test(r))return"number";if(r.includes("bool"))return"boolean";if(/(timestamp|datetime|date)/.test(r))return"date";return"string"}function re(e){return!e.pk&&e.name!=="created_at"&&e.name!=="updated_at"}function ne(e){if(e===null||e===void 0)return null;if(typeof e==="string"||typeof e==="number"||typeof e==="boolean")return e;return JSON.stringify(e)}function B(e,r){let t=[],n="id",o=new Map,i=(a)=>{if(a.length>0)t=a,n=a.find((c)=>c.pk)?.name??"id"},s=(a)=>({table:r,...e?{connection:e}:{},limit:a?.limit??Z,offset:a?.offset??0,...a?.orderBy?{dir:a.dir??"asc",orderBy:a.orderBy}:{}}),l=(a,c)=>{let y=a[n];if(typeof y==="string"||typeof y==="number")return o.set(String(y),y),String(y);return`row-${c}`};return{capabilities:{delete:!0,insert:!0,remotePaging:!0,remoteSort:!0},async columns(){if(t.length===0){let a=await x(s({limit:1,offset:0}));i(a.columns)}return t.map((a)=>{let c=re(a)?ee(a.type):"readonly";return{editable:c!=="readonly",field:a.name,kind:c,pk:a.pk===!0,title:a.name,widthHint:a.pk?80:void 0}})},async commit(a){let c={cells:[],deletes:[],inserts:[]},y=new Map;for(let f of a.cells){let g=y.get(f.rowKey)??[];g.push({field:f.field,value:f.value}),y.set(f.rowKey,g)}for(let[f,g]of y){let b=o.get(f),d=(u,h)=>{for(let w of g)c.cells.push({error:h,field:w.field,ok:u,rowKey:f})};if(b===void 0){d(!1,"Row has no primary key — refresh the grid");continue}try{let u={};for(let h of g)u[h.field]=h.value;await A({pk:b,set:u,table:r,...e?{connection:e}:{}}),d(!0)}catch(u){d(!1,u instanceof Error?u.message:String(u))}}for(let f of a.inserts)try{let g={};for(let[h,w]of Object.entries(f.cells))if(w!==null)g[h]=w;let{row:b}=await M({table:r,values:g,...e?{connection:e}:{}}),d=b[n],u=typeof d==="string"||typeof d==="number"?String(d):void 0;if(u!==void 0&&(typeof d==="string"||typeof d==="number"))o.set(u,d);c.inserts.push({newKey:u,ok:!0,tempKey:f.tempKey})}catch(g){c.inserts.push({error:g instanceof Error?g.message:String(g),ok:!1,tempKey:f.tempKey})}for(let f of a.deletes){let g=o.get(f.rowKey);if(g===void 0){c.deletes.push({error:"Row has no primary key — refresh the grid",ok:!1,rowKey:f.rowKey});continue}try{await K({pk:g,table:r,...e?{connection:e}:{}}),c.deletes.push({ok:!0,rowKey:f.rowKey})}catch(b){c.deletes.push({error:b instanceof Error?b.message:String(b),ok:!1,rowKey:f.rowKey})}}return c},id:ds({connection:e??"default",kind:"data",table:r}),label:r,async refresh(){t=[],o.clear()},async rows(a){let c=await x(s(a));return i(c.columns),{rows:c.rows.map((f,g)=>{let b=l(f,g),d={};for(let u of t)d[u.name]=ne(f[u.name]);return{cells:d,key:b}}),total:c.total}}}}var pb=[{key:"all",label:"All"},{dir:"pages",key:"pages",label:"Pages"},{dir:"layouts",key:"layouts",label:"Layouts"},{dir:"components",key:"components",label:"Components"},{dir:"content",key:"content",label:"Content"},{dir:"public",key:"media",label:"Media"}],C1=pb.map((e)=>e.key);function Aw(e){return pb.find((r)=>r.key===e)}function k1(e){return Aw(e)?.dir}function oe(e,r){if(r&&Ld.has(r))return"Media";if(e.startsWith("pages"))return"Pages";if(e.startsWith("layouts"))return"Layouts";if(e.startsWith("components"))return"Components";if(e.startsWith("content"))return"Content";if(e.startsWith("public"))return"Media";if(e.startsWith("data"))return"Content";if(e.startsWith("styles"))return"Components";return"Other"}function ie(e){let r=D?.projectConfig?.content??{};for(let[t,n]of Object.entries(r)){if(!n.source)continue;let o=n.source.replace(/^\.\//,"").replace(/\/$/,"");if(e.startsWith(`${o}/`)||e===o)return t.charAt(0).toUpperCase()+t.slice(1)}return null}var se=new Set(["node_modules",".git",".jx","dist","build",".cache"]);async function H(e,r,t,n,o){let i;try{i=await Ir(()=>r.listDirectory(e))}catch(l){n.push({dir:e,error:te(l)});return}let s=[];for(let l of i){if(l.type==="directory"){if(!se.has(l.name))s.push(l.path);continue}let a=Gi(l.name),c=oe(l.path,a);t.push({category:c,ext:a,locale:bL(l.path,o)??void 0,modified:l.modified,name:l.name,path:l.path,size:l.size,type:c==="Content"?ie(l.path)??a??"file":a||"file"})}await Promise.all(s.map((l)=>H(l,r,t,n,o)))}async function Uf(e,r){let t=[],n=[],{i18n:o}=$o(D?.projectConfig??{});return await Promise.all(e.map((i)=>H(i,r,t,n,o))),t.sort((i,s)=>i.path.localeCompare(s.path)),{failures:n,files:t}}function TE(e,r){let t=e,n=Aw(r.category);if(n&&n.key!=="all")t=t.filter((s)=>s.category===n.label);let o=r.query.trim().toLowerCase();if(o)t=t.filter((s)=>s.name.toLowerCase().includes(o)||s.path.toLowerCase().includes(o));let i=r.locale?.trim();if(i)t=t.filter((s)=>s.locale===i);return t}var qf=["table","cards","media","calendar","board"],Nw={board:"Board",calendar:"Calendar",cards:"Cards",media:"Media",table:"Table"};var LE=new Set(["cards","media"]),ae=/^(\d{4}-\d{2}-\d{2})/;function le(e){let r=ae.exec(e.name);if(r)return r[1];if(e.modified){let t=new Date(e.modified);if(!Number.isNaN(t.getTime()))return t.toISOString().slice(0,10)}return null}function S1(){return $o(D?.projectConfig??{}).i18n?.locales??[]}function IE(e){let r=new Set;for(let t of e)if(t.locale)r.add(t.locale);return S1().filter((t)=>r.has(t))}function RE(e){let r=new Map,t=[];for(let o of e){let i=le(o);if(i===null){t.push(o);continue}let s=r.get(i);if(s)s.push(o);else r.set(i,[o])}return{days:[...r.entries()].map(([o,i])=>({date:o,files:i})).toSorted((o,i)=>i.date.localeCompare(o.date)),undated:t}}function $E(e){let r=new Map;for(let n of e){let o=r.get(n.category);if(o)o.push(n);else r.set(n.category,[n])}let t=pb.map((n)=>n.label);return[...r.entries()].map(([n,o])=>({files:o,group:n})).toSorted((n,o)=>{let i=t.indexOf(n.group),s=t.indexOf(o.group);if(i===s)return n.group.localeCompare(o.group);return(i===-1?t.length:i)-(s===-1?t.length:s)})}var G="The Library lists files; it does not edit them. Rename, duplicate or delete from the file's context menu, or open the file to edit it.";function Ow(){return[{editable:!1,field:"name",kind:"string",pk:!0,title:"Name",widthHint:260},{editable:!1,field:"category",kind:"string",title:"Category",widthHint:120},{editable:!1,field:"locale",kind:"string",title:"Locale",widthHint:90},{editable:!1,field:"type",kind:"string",title:"Type",widthHint:120},{editable:!1,field:"size",kind:"number",title:"Size",widthHint:90},{editable:!1,field:"modified",kind:"date",title:"Modified",widthHint:160},{editable:!1,field:"path",kind:"readonly",title:"Path",widthHint:320}]}function ce(e){return{cells:{category:e.category,locale:e.locale??null,modified:e.modified??null,name:e.name,path:e.path,size:e.size??null,type:e.type},key:e.path}}function L(){return ds({kind:"library"})}function DE(e){let r=null,t=null,n=e??(()=>D?.projectDirs??[]);async function o(){if(r)return r;return t??=Uf(n(),p()).then((i)=>(r=i,t=null,i)),t}return{capabilities:{delete:!1,insert:!1,remotePaging:!1,remoteSort:!1},columns:()=>Promise.resolve(Ow()),commit(i){return Promise.resolve({cells:i.cells.map((s)=>({error:G,field:s.field,ok:!1,rowKey:s.rowKey})),deletes:i.deletes.map((s)=>({error:G,ok:!1,rowKey:s.rowKey})),inserts:i.inserts.map((s)=>({error:G,ok:!1,tempKey:s.tempKey}))})},failures:()=>r?.failures??[],files:()=>r?.files??[],id:L(),label:"Library",async refresh(){r=null,t=null,await o()},async rows(){let i=await o();return{rows:i.files.map((s)=>ce(s)),total:i.files.length}},scanned:()=>r!==null}}var P={children:[],tagName:"div"};async function AE(e,r={}){let t=m.tabs.get(e);if(t)return ci(e,{focus:r.focus!==!1}),t;try{await qt()}catch{}let n=Dw(e),o=No({capabilities:{modes:["grid","source"]},document:structuredClone(P),documentPath:e,id:e,sourceFormat:Zt(e)?.name??null,...r.paneId!==void 0&&{paneId:r.paneId},...r.preview===!0&&{preview:!0},...r.focus===!1&&{focus:!1}});return Ru(o,n).load(),o}function F(e){let r=No({capabilities:{modes:["grid"]},document:structuredClone(P),documentPath:null,id:e.id});return Ru(r,e).load(),r}function z(e){let r=ds({kind:"collection",name:e}),t=m.tabs.get(r);if(t)return ci(r),t;return F(R1(e))}function NE(){let e=L(),r=m.tabs.get(e);if(r)return ci(e),r;return No({capabilities:{modes:["manage"]},document:structuredClone(P),documentPath:null,id:e})}function E1(){let e=ds({kind:"pages"}),r=m.tabs.get(e);if(r)return ci(e),r;return F($1())}function Y(e,r){let t=ds({connection:e??"default",kind:"data",table:r}),n=m.tabs.get(t);if(n)return ci(t),n;return F(B(e,r))}function de(e){let r=Kf(e);if(r?.kind==="pages")E1();else if(r?.kind==="collection")z(r.name);else if(r?.kind==="data")Y(r.connection,r.table)}function ue(e,r){return[{emptyMessage:"",key:"project",rows:[{id:ds({kind:"pages"}),label:"Pages"},...e.map(({name:t})=>({id:ds({kind:"collection",name:t}),label:`Collection: ${t}`}))],state:"listed",title:"Project"},...r.map((t)=>({emptyMessage:"No tables — push a schema first.",key:`data:${t.name}`,rows:t.tables.map((n)=>({id:ds({connection:t.name,kind:"data",table:n}),label:n})),state:t.tables.length===0?"empty":"listed",title:`Data · ${t.name}`}))]}async function OE(){let e=Fw(),r=[];if(Rw())r=(await E().catch(()=>null))?.connections??[];let t=null,n=bs({cancelLabel:"Cancel",confirmLabel:"",headline:"Open Grid",island:(o)=>{t=j(o,ue(e,r),(i)=>{n.close(),de(i)})},layer:Ct("dialog"),onCancel:()=>n.close(),onClosed:()=>{t?.dispose(),t=null},onConfirm:()=>{},region:"grid/open"});n.ready}function pe(){return[{args:Se({name:He("The content collection's name, as project.json declares it.")}),category:"Project",id:"collection.editInGrid",level:"project",menus:["context/file","palette"],group:"5_data",requires:"a project that declares content collections",when:(e)=>e.project.open,run:(e,r)=>{let t=ot("collection.editInGrid",r,"name"),n=Fw().map((o)=>o.name);if(!n.includes(t))throw RangeError(`command "collection.editInGrid" argument "name": "${t}" is not a content `+"collection this project declares — it declares: "+`${n.length>0?n.join(", "):"none"}`);z(t)},title:"Edit Collection in Grid"},{args:{additionalProperties:!1,properties:{connection:He('The connection name from project.json. Defaults to "default".'),table:He("The table to open.")},required:["table"],type:"object"},category:"Project",id:"data.openGrid",level:"project",menus:["palette"],group:"5_data",requires:"a platform that serves the data routes",when:(e)=>e.project.open,enablement:(e)=>e.capability.dataRows,run:(e,r)=>{let t=ot("data.openGrid",r,"table");Y(Jo("data.openGrid",r,"connection"),t)},title:"Open Data Grid"}]}function ME(e){e.registerAll(pe())}
7
- export{Rw,SE,_1,EE,$w,Dw,pb,C1,Aw,k1,Uf,TE,qf,Nw,LE,S1,IE,RE,$E,Ow,DE,AE,NE,E1,OE,ME};
6
+ `),i=W(e),s=i[0]??[],l=i.slice(1),a=Math.max(s.length,...l.map((c)=>c.length),0);while(s.length<a)s.push("");for(let c of l)while(c.length<a)c.push("");return{eol:n,headers:s,rows:l,trailingNewline:o}}function U(e){if(/[",\n\r]/.test(e))return`"${e.replaceAll('"','""')}"`;return e}function k(e){return[e.headers,...e.rows].map((t)=>t.map((n)=>U(n)).join(",")).join(e.eol)+(e.trailingNewline?e.eol:"")}var Q=["id","sku","slug","Slug"];function q(e){let r=new Set;return e.map((t,n)=>{let o=t.trim()===""?`column${n+1}`:t;if(r.has(o))o=`${o}__${n+1}`;return r.add(o),o})}function J(e,r){for(let t of Q){let n=e.indexOf(t);if(n===-1)continue;let o=r.rows.map((i)=>i[n]??"");if(o.every((i)=>i!=="")&&new Set(o).size===o.length)return t}return null}function O(e,r){let t=Dw(e),n=q(t.headers),o=J(n,t),i=o?n.indexOf(o):-1,s=t.rows.map((d,u)=>i===-1?String(u):d[i]),l=new Map(s.map((d,u)=>[d,u])),a=Gu(r,D?.projectConfig),c=a?.schema?.properties??{},y=t.rows.slice(0,50).map((d)=>{let u={};for(let[h,w]of n.entries())u[w]=d[h]??"";return u}),f=new Map(wb(y).map((d)=>[d.field,d])),g=new Map(yb(a?.schema,{idField:o??void 0}).map((d)=>[d.field,d]));return{columns:n.map((d,u)=>{let w=(d in c?g.get(d):void 0)??f.get(d)??{editable:!0,field:d,kind:"string",title:t.headers[u]||d};return{...w,pk:d===o,title:t.headers[u]?.trim()||w.title}}),doc:t,fields:n,keys:s,keyToIndex:l,loadText:e}}function X(e,r){let t={},n=e.doc.rows[r]??[];for(let[o,i]of e.fields.entries()){let s=e.columns[o],l=n[o]??"";t[i]=s.kind==="string"||s.kind==="text"||s.kind==="readonly"?l:Ru(l,s)}return t}function _(e,r){let t=e.doc.rows.map((i)=>[...i]),n=(i)=>e.fields.indexOf(i);for(let i of r.cells){let s=e.keyToIndex.get(i.rowKey),l=n(i.field);if(s===void 0||l===-1)continue;t[s][l]=Io(i.value)}for(let i of r.inserts){let s=e.fields.map((l)=>Io(i.cells[l]??null));t.push(s)}let o=r.deletes.map((i)=>e.keyToIndex.get(i.rowKey)).filter((i)=>i!==void 0).toSorted((i,s)=>s-i);for(let i of o)t.splice(i,1);return{...e.doc,rows:t}}function N(e,r){return{cells:e.cells.map((t)=>({field:t.field,rowKey:t.rowKey,...r})),deletes:e.deletes.map((t)=>({rowKey:t.rowKey,...r})),inserts:e.inserts.map((t)=>({error:r.error,ok:r.ok,tempKey:t.tempKey}))}}function Aw(e){let r=null,t=(n=!1)=>{if(!n&&r)return r;return r=p().readFile(e).then((o)=>O(o,e)),r};return{backingPaths:()=>new Map([[e,"*"]]),capabilities:{delete:!0,insert:!0,remotePaging:!1,remoteSort:!1},async columns(){return(await t()).columns},async commit(n){let o=await t(),i=p(),s=null;try{s=await i.readFile(e)}catch{s=null}if(s!==o.loadText&&!gc(e))return N(n,{error:"File changed on disk — refresh to reload",ok:!1,stale:!0});let l=_(o,n),a=k(l);return Ps(e),await i.writeFile(e,a),r=Promise.resolve(O(a,e)),N(n,{ok:!0})},id:e,label:e.split("/").pop()??e,async refresh(){await t(!0)},async rows(){let n=await t(),o=n.doc.rows.map((i,s)=>({cells:X(n,s),key:n.keys[s]}));return{rows:o,total:o.length}},async serializeForSource(n){let o=await t();return k(_(o,n))}}}var Z=50;function ee(e){let r=e.toLowerCase();if(/(int|real|floa|doub|num|dec)/.test(r))return"number";if(r.includes("bool"))return"boolean";if(/(timestamp|datetime|date)/.test(r))return"date";return"string"}function re(e){return!e.pk&&e.name!=="created_at"&&e.name!=="updated_at"}function ne(e){if(e===null||e===void 0)return null;if(typeof e==="string"||typeof e==="number"||typeof e==="boolean")return e;return JSON.stringify(e)}function B(e,r){let t=[],n="id",o=new Map,i=(a)=>{if(a.length>0)t=a,n=a.find((c)=>c.pk)?.name??"id"},s=(a)=>({table:r,...e?{connection:e}:{},limit:a?.limit??Z,offset:a?.offset??0,...a?.orderBy?{dir:a.dir??"asc",orderBy:a.orderBy}:{}}),l=(a,c)=>{let y=a[n];if(typeof y==="string"||typeof y==="number")return o.set(String(y),y),String(y);return`row-${c}`};return{capabilities:{delete:!0,insert:!0,remotePaging:!0,remoteSort:!0},async columns(){if(t.length===0){let a=await x(s({limit:1,offset:0}));i(a.columns)}return t.map((a)=>{let c=re(a)?ee(a.type):"readonly";return{editable:c!=="readonly",field:a.name,kind:c,pk:a.pk===!0,title:a.name,widthHint:a.pk?80:void 0}})},async commit(a){let c={cells:[],deletes:[],inserts:[]},y=new Map;for(let f of a.cells){let g=y.get(f.rowKey)??[];g.push({field:f.field,value:f.value}),y.set(f.rowKey,g)}for(let[f,g]of y){let b=o.get(f),d=(u,h)=>{for(let w of g)c.cells.push({error:h,field:w.field,ok:u,rowKey:f})};if(b===void 0){d(!1,"Row has no primary key — refresh the grid");continue}try{let u={};for(let h of g)u[h.field]=h.value;await A({pk:b,set:u,table:r,...e?{connection:e}:{}}),d(!0)}catch(u){d(!1,u instanceof Error?u.message:String(u))}}for(let f of a.inserts)try{let g={};for(let[h,w]of Object.entries(f.cells))if(w!==null)g[h]=w;let{row:b}=await M({table:r,values:g,...e?{connection:e}:{}}),d=b[n],u=typeof d==="string"||typeof d==="number"?String(d):void 0;if(u!==void 0&&(typeof d==="string"||typeof d==="number"))o.set(u,d);c.inserts.push({newKey:u,ok:!0,tempKey:f.tempKey})}catch(g){c.inserts.push({error:g instanceof Error?g.message:String(g),ok:!1,tempKey:f.tempKey})}for(let f of a.deletes){let g=o.get(f.rowKey);if(g===void 0){c.deletes.push({error:"Row has no primary key — refresh the grid",ok:!1,rowKey:f.rowKey});continue}try{await K({pk:g,table:r,...e?{connection:e}:{}}),c.deletes.push({ok:!0,rowKey:f.rowKey})}catch(b){c.deletes.push({error:b instanceof Error?b.message:String(b),ok:!1,rowKey:f.rowKey})}}return c},id:ds({connection:e??"default",kind:"data",table:r}),label:r,async refresh(){t=[],o.clear()},async rows(a){let c=await x(s(a));return i(c.columns),{rows:c.rows.map((f,g)=>{let b=l(f,g),d={};for(let u of t)d[u.name]=ne(f[u.name]);return{cells:d,key:b}}),total:c.total}}}}var fb=[{key:"all",label:"All"},{dir:"pages",key:"pages",label:"Pages"},{dir:"layouts",key:"layouts",label:"Layouts"},{dir:"components",key:"components",label:"Components"},{dir:"content",key:"content",label:"Content"},{dir:"public",key:"media",label:"Media"}],S1=fb.map((e)=>e.key);function Nw(e){return fb.find((r)=>r.key===e)}function E1(e){return Nw(e)?.dir}function oe(e,r){if(r&&Id.has(r))return"Media";if(e.startsWith("pages"))return"Pages";if(e.startsWith("layouts"))return"Layouts";if(e.startsWith("components"))return"Components";if(e.startsWith("content"))return"Content";if(e.startsWith("public"))return"Media";if(e.startsWith("data"))return"Content";if(e.startsWith("styles"))return"Components";return"Other"}function ie(e){let r=D?.projectConfig?.content??{};for(let[t,n]of Object.entries(r)){if(!n.source)continue;let o=n.source.replace(/^\.\//,"").replace(/\/$/,"");if(e.startsWith(`${o}/`)||e===o)return t.charAt(0).toUpperCase()+t.slice(1)}return null}var se=new Set(["node_modules",".git",".jx","dist","build",".cache"]);async function H(e,r,t,n,o){let i;try{i=await Ir(()=>r.listDirectory(e))}catch(l){n.push({dir:e,error:te(l)});return}let s=[];for(let l of i){if(l.type==="directory"){if(!se.has(l.name))s.push(l.path);continue}let a=Gi(l.name),c=oe(l.path,a);t.push({category:c,ext:a,locale:yL(l.path,o)??void 0,modified:l.modified,name:l.name,path:l.path,size:l.size,type:c==="Content"?ie(l.path)??a??"file":a||"file"})}await Promise.all(s.map((l)=>H(l,r,t,n,o)))}async function qf(e,r){let t=[],n=[],{i18n:o}=$o(D?.projectConfig??{});return await Promise.all(e.map((i)=>H(i,r,t,n,o))),t.sort((i,s)=>i.path.localeCompare(s.path)),{failures:n,files:t}}function IE(e,r){let t=e,n=Nw(r.category);if(n&&n.key!=="all")t=t.filter((s)=>s.category===n.label);let o=r.query.trim().toLowerCase();if(o)t=t.filter((s)=>s.name.toLowerCase().includes(o)||s.path.toLowerCase().includes(o));let i=r.locale?.trim();if(i)t=t.filter((s)=>s.locale===i);return t}var Gf=["table","cards","media","calendar","board"],Ow={board:"Board",calendar:"Calendar",cards:"Cards",media:"Media",table:"Table"};var RE=new Set(["cards","media"]),ae=/^(\d{4}-\d{2}-\d{2})/;function le(e){let r=ae.exec(e.name);if(r)return r[1];if(e.modified){let t=new Date(e.modified);if(!Number.isNaN(t.getTime()))return t.toISOString().slice(0,10)}return null}function T1(){return $o(D?.projectConfig??{}).i18n?.locales??[]}function $E(e){let r=new Set;for(let t of e)if(t.locale)r.add(t.locale);return T1().filter((t)=>r.has(t))}function DE(e){let r=new Map,t=[];for(let o of e){let i=le(o);if(i===null){t.push(o);continue}let s=r.get(i);if(s)s.push(o);else r.set(i,[o])}return{days:[...r.entries()].map(([o,i])=>({date:o,files:i})).toSorted((o,i)=>i.date.localeCompare(o.date)),undated:t}}function AE(e){let r=new Map;for(let n of e){let o=r.get(n.category);if(o)o.push(n);else r.set(n.category,[n])}let t=fb.map((n)=>n.label);return[...r.entries()].map(([n,o])=>({files:o,group:n})).toSorted((n,o)=>{let i=t.indexOf(n.group),s=t.indexOf(o.group);if(i===s)return n.group.localeCompare(o.group);return(i===-1?t.length:i)-(s===-1?t.length:s)})}var G="The Library lists files; it does not edit them. Rename, duplicate or delete from the file's context menu, or open the file to edit it.";function Mw(){return[{editable:!1,field:"name",kind:"string",pk:!0,title:"Name",widthHint:260},{editable:!1,field:"category",kind:"string",title:"Category",widthHint:120},{editable:!1,field:"locale",kind:"string",title:"Locale",widthHint:90},{editable:!1,field:"type",kind:"string",title:"Type",widthHint:120},{editable:!1,field:"size",kind:"number",title:"Size",widthHint:90},{editable:!1,field:"modified",kind:"date",title:"Modified",widthHint:160},{editable:!1,field:"path",kind:"readonly",title:"Path",widthHint:320}]}function ce(e){return{cells:{category:e.category,locale:e.locale??null,modified:e.modified??null,name:e.name,path:e.path,size:e.size??null,type:e.type},key:e.path}}function L(){return ds({kind:"library"})}function NE(e){let r=null,t=null,n=e??(()=>D?.projectDirs??[]);async function o(){if(r)return r;return t??=qf(n(),p()).then((i)=>(r=i,t=null,i)),t}return{capabilities:{delete:!1,insert:!1,remotePaging:!1,remoteSort:!1},columns:()=>Promise.resolve(Mw()),commit(i){return Promise.resolve({cells:i.cells.map((s)=>({error:G,field:s.field,ok:!1,rowKey:s.rowKey})),deletes:i.deletes.map((s)=>({error:G,ok:!1,rowKey:s.rowKey})),inserts:i.inserts.map((s)=>({error:G,ok:!1,tempKey:s.tempKey}))})},failures:()=>r?.failures??[],files:()=>r?.files??[],id:L(),label:"Library",async refresh(){r=null,t=null,await o()},async rows(){let i=await o();return{rows:i.files.map((s)=>ce(s)),total:i.files.length}},scanned:()=>r!==null}}var P={children:[],tagName:"div"};async function OE(e,r={}){let t=m.tabs.get(e);if(t)return ci(e,{focus:r.focus!==!1}),t;try{await qt()}catch{}let n=Aw(e),o=No({capabilities:{modes:["grid","source"]},document:structuredClone(P),documentPath:e,id:e,sourceFormat:Zt(e)?.name??null,...r.paneId!==void 0&&{paneId:r.paneId},...r.preview===!0&&{preview:!0},...r.focus===!1&&{focus:!1}});return $u(o,n).load(),o}function F(e){let r=No({capabilities:{modes:["grid"]},document:structuredClone(P),documentPath:null,id:e.id});return $u(r,e).load(),r}function z(e){let r=ds({kind:"collection",name:e}),t=m.tabs.get(r);if(t)return ci(r),t;return F(D1(e))}function ME(){let e=L(),r=m.tabs.get(e);if(r)return ci(e),r;return No({capabilities:{modes:["manage"]},document:structuredClone(P),documentPath:null,id:e})}function L1(){let e=ds({kind:"pages"}),r=m.tabs.get(e);if(r)return ci(e),r;return F(A1())}function Y(e,r){let t=ds({connection:e??"default",kind:"data",table:r}),n=m.tabs.get(t);if(n)return ci(t),n;return F(B(e,r))}function de(e){let r=Jf(e);if(r?.kind==="pages")L1();else if(r?.kind==="collection")z(r.name);else if(r?.kind==="data")Y(r.connection,r.table)}function ue(e,r){return[{emptyMessage:"",key:"project",rows:[{id:ds({kind:"pages"}),label:"Pages"},...e.map(({name:t})=>({id:ds({kind:"collection",name:t}),label:`Collection: ${t}`}))],state:"listed",title:"Project"},...r.map((t)=>({emptyMessage:"No tables — push a schema first.",key:`data:${t.name}`,rows:t.tables.map((n)=>({id:ds({connection:t.name,kind:"data",table:n}),label:n})),state:t.tables.length===0?"empty":"listed",title:`Data · ${t.name}`}))]}async function PE(){let e=jw(),r=[];if($w())r=(await E().catch(()=>null))?.connections??[];let t=null,n=bs({cancelLabel:"Cancel",confirmLabel:"",headline:"Open Grid",island:(o)=>{t=j(o,ue(e,r),(i)=>{n.close(),de(i)})},layer:Ct("dialog"),onCancel:()=>n.close(),onClosed:()=>{t?.dispose(),t=null},onConfirm:()=>{},region:"grid/open"});n.ready}function pe(){return[{args:Se({name:He("The content collection's name, as project.json declares it.")}),category:"Project",id:"collection.editInGrid",level:"project",menus:["context/file","palette"],group:"5_data",requires:"a project that declares content collections",when:(e)=>e.project.open,run:(e,r)=>{let t=ot("collection.editInGrid",r,"name"),n=jw().map((o)=>o.name);if(!n.includes(t))throw RangeError(`command "collection.editInGrid" argument "name": "${t}" is not a content `+"collection this project declares — it declares: "+`${n.length>0?n.join(", "):"none"}`);z(t)},title:"Edit Collection in Grid"},{args:{additionalProperties:!1,properties:{connection:He('The connection name from project.json. Defaults to "default".'),table:He("The table to open.")},required:["table"],type:"object"},category:"Project",id:"data.openGrid",level:"project",menus:["palette"],group:"5_data",requires:"a platform that serves the data routes",when:(e)=>e.project.open,enablement:(e)=>e.capability.dataRows,run:(e,r)=>{let t=ot("data.openGrid",r,"table");Y(Jo("data.openGrid",r,"connection"),t)},title:"Open Data Grid"}]}function FE(e){e.registerAll(pe())}
7
+ export{$w,TE,k1,LE,Dw,Aw,fb,S1,Nw,E1,qf,IE,Gf,Ow,RE,T1,$E,DE,AE,Mw,NE,OE,ME,L1,PE,FE};
8
8
 
9
- //# debugId=5E34916DF590526664756E2164756E21
10
- //# sourceMappingURL=studio-3ck2a5c4.js.map
9
+ //# debugId=E975C172B650280F64756E2164756E21
10
+ //# sourceMappingURL=studio-8f87n763.js.map
@@ -0,0 +1,5 @@
1
+ function nt(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function Ot(e){return nt(e)&&typeof e.$ref==="string"}function Xa(e){return nt(e)&&e.$prototype==="Function"}function ba(e){return nt(e)&&nt(e.$expression)}function Pv(e){return ba(e)&&Array.isArray(e.parameters)&&e.parameters.length>0}function Ik(e){return Xa(e)&&Array.isArray(e.body)}function Rk(e){return nt(e)&&typeof e.$prototype==="string"&&e.$prototype!=="Function"}function $k(e){return nt(e)&&e.timing==="server"&&typeof e.$src==="string"&&typeof e.$export==="string"&&!e.$prototype}function qx(e){return nt(e)&&e.$prototype==="Array"}function Ks(e){return typeof e==="string"&&e.includes("${")}function Dk(e){return/\breturn\b[^\S\n]*(?![;}\s]|$)/.test(e)}function oh(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function va(e,n){let t=e?.[n];return oh(t)?t:void 0}function rh(e,n){let t=e[n];if(oh(t))return t;let r={};return e[n]=r,r}function sh(e){return Ot(e)||Xa(e)||ba(e)}function Mp(e,n){let t=e[n];return sh(t)?t:void 0}function Fv(e){if(!e)return[];return e.map((n)=>typeof n==="string"?n:n.name)}function Bd(e){if(!nt(e)||!nt(e.$expression))return!1;let n=e.$expression;if(n.operator==="?:")return typeof n.value==="string"&&typeof n.initial==="string";if(n.operator==="switch")return nt(n.cases)&&Object.values(n.cases).every((t)=>typeof t==="string")&&typeof n.default==="string";return!1}function Ak(e){if(typeof e==="string")return[e];if(!Bd(e))return[];let n=e.$expression;if(n.operator==="?:")return[...new Set([n.value,n.initial])];return[...new Set([...Object.values(n.cases),n.default])]}function qe(e){return typeof e==="string"?e:Ak(e).join("|")}function Pp(e){return e.startsWith("#")}
2
+ export{nt,Ot,Xa,ba,Pv,Ik,Rk,$k,qx,Ks,Dk,oh,va,rh,sh,Mp,Fv,Bd,Ak,qe,Pp};
3
+
4
+ //# debugId=00B85B5B5E64A41964756E2164756E21
5
+ //# sourceMappingURL=studio-8mb00b84.js.map
@@ -0,0 +1,6 @@
1
+ import{p}from"./studio-qpqa7vk3.js";import{K,D}from"./studio-wgh5kxpj.js";import{nh}from"./studio-tt2nactf.js";import{nt,Fv}from"./studio-8mb00b84.js";async function _b(e,s){let o=p();if(!o.codeService)return null;return o.codeService(e,s)}var bc=new Map;async function Cb(e,s){let o=e.$prototype?D?.projectConfig?.imports?.[e.$prototype]:null,t=e.$src||o;if(!t||!e.$prototype)return null;let r=`${t}::${e.$prototype}`;if(bc.has(r))return bc.get(r);try{let n=p();if(!n.fetchPluginSchema)return bc.set(r,null),null;let i=!o&&s.documentPath?`${location.origin}/${s.documentPath}`:void 0,a=await n.fetchPluginSchema(t,e.$prototype,i);return bc.set(r,a),a}catch{return bc.set(r,null),null}}function F1(e,s){let o=e.getModel();if(!o)return;let t=nh();if(!t)return;let r=s.map((n)=>{let i=n.labels?.[0];if(!i)return null;let{line:a,column:l,length:c}=i.span;return{code:n.url?{target:t.Uri.parse(n.url),value:n.code}:n.code,endColumn:l+(c||1),endLineNumber:a,message:n.message+(n.help?`
2
+ ${n.help}`:""),severity:n.severity==="error"?t.MarkerSeverity.Error:t.MarkerSeverity.Warning,source:"oxlint",startColumn:l,startLineNumber:a}}).filter(Boolean);t.editor.setModelMarkers(o,"oxlint",r)}function GE(e,s){let o=(t)=>{if(!nt(t))return null;let r=t.parameters;if(!Array.isArray(r)||r.length===0)return null;return Fv(r)};if(e.type==="def"){let t=e.defName?o(s?.state?.[e.defName]):null;if(t)return t}else if(e.type==="event"){if(!s||!e.path)return["state","event"];let t=K(s,e.path),r=t&&e.eventKey?o(t[e.eventKey]):null;if(r)return r}return["state","event"]}
3
+ export{_b,bc,Cb,F1,GE};
4
+
5
+ //# debugId=E5B7B5855F07E31664756E2164756E21
6
+ //# sourceMappingURL=studio-8p51gq2h.js.map
@@ -0,0 +1,5 @@
1
+ import{p}from"./studio-qpqa7vk3.js";import{di}from"./studio-g7nse7zb.js";import{Ir}from"./studio-3bpdkq2s.js";import{Gi,hp,mL,gL}from"./studio-4m3826v2.js";var r=new Map,d=new Map,a=new Map;function l(e,t){let n=mL(e),i=a.get(e);return{bytes:typeof t?.size==="number"?t.size:null,ext:Gi(n),height:i?.height??null,kind:hp({name:n}),modified:t?.modified??null,name:n,path:e,width:i?.width??null}}function ab(e){return r.get(di(e))??null}function yE(e){for(let t of e){if(t.type!=="file")continue;let n=di(t.path);if(!r.has(n))r.set(n,l(n,t))}}async function wE(e){let t=di(e),n=r.get(t);if(n)return n;let i=d.get(t);if(i)return i;let o=(async()=>{let u;try{u=(await Ir(()=>p().listDirectory(gL(t)))).find((f)=>di(f.path)===t)}catch{u=void 0}return l(t,u)})();d.set(t,o);let s=await o;return d.delete(t),r.set(t,s),s}function lb(e,t,n){if(!(t>0&&n>0))return!1;let i=di(e),o=a.get(i);if(o&&o.width===t&&o.height===n)return!1;a.set(i,{height:n,width:t});let s=r.get(i);if(s)r.set(i,{...s,height:n,width:t});return!0}function xE(){r.clear(),a.clear()}function b1(e){if(e<1024)return`${e} B`;if(e<1048576)return`${Math.round(e/1024)} KB`;return`${(e/1048576).toFixed(1)} MB`}function _E(e){if(!e)return"";let t=[];if(e.width!==null&&e.height!==null)t.push(`${e.width} × ${e.height}`);if(e.bytes!==null)t.push(b1(e.bytes));return t.join(" · ")}
2
+ export{ab,yE,wE,lb,xE,b1,_E};
3
+
4
+ //# debugId=AF9D29FBF9522AD364756E2164756E21
5
+ //# sourceMappingURL=studio-954ds834.js.map
@@ -1,9 +1,9 @@
1
- import{br}from"./studio-sxc0zvpt.js";import{un,rn}from"./studio-cp1gbff9.js";import{ge,Q,v,Mo,k}from"./studio-fqq890ap.js";import{di}from"./studio-1q6amtph.js";import{rt,zt,T,R,An,Ct}from"./studio-7qvs7v0m.js";import{Td}from"./studio-4m50vh74.js";import{QE}from"./studio-aekhcdzw.js";import{qn}from"./studio-rmn2dz59.js";import{yc,js,tm}from"./studio-yr04mv2j.js";var y={$schema:"https://jxsuite.com/schema/v1",$id:"StudioPanelActivity",$description:'The Activity feed: one row per operation this session, newest last, drawn from the projection `panels/activity-panel.ts` hands in. A row is a glyph, a head line (what the operation is, who is running it, how long it has taken), the line it is doing now, the plan it declared, the log it captured and — only when the operation handed a callback over — its Cancel. Every conditional the row has is a boolean field on the projected item, because `$switch` over a value is the only conditional a document has and "is this entry cancellable" is a question the panel has already answered. Nothing here reads the activity store: the panel owns what an operation IS, and the surface owns what it looks like.',tagName:"div",attributes:{part:"panel"},style:{$description:"What `.activity-panel`, `.activity-actions`, `.activity-list`, `.activity-row`, `.activity-icon`, `.activity-body`, `.activity-head`, `.activity-title`, `.activity-source`, `.activity-duration`, `.activity-status`, `.activity-steps`, `.activity-step`, `.activity-step-icon`, `.activity-log-toggle` and `.activity-log` said in `styles/panels.css`, keyed on `part`. Two rules were DELETED rather than moved: `.activity-clear` and `.activity-cancel` drew a small bordered button by hand, and `jx-button` is that button — so the sizes, the border, the hover fill and the disabled state are the kit's now. Three token names changed meaning on the way: `--spectrum-font-size-50`, `--spectrum-font-size-75` and `--spectrum-corner-radius-75` resolve only inside `<sp-theme>`, and this document is mounted into the Bottom dock's body where that element is not an ancestor — every one of them would silently have taken its px fallback. They are the kit's own scale here (`--jx-text-sm`, `--jx-text-md`, `--jx-radius-xs`), which is the step each of them was. The `.activity-*` rules stay in the stylesheet regardless: `publish/deploy-checklist.ts` still draws the checklist above this feed in that same vocabulary, and it is a lit template until it converts.",display:"flex",flexDirection:"column",gap:"8px",padding:"8px",minWidth:"0",fontFamily:"var(--jx-font-sans)",color:"var(--fg)",'& [part="feed"]':{display:"flex",flexDirection:"column",gap:"8px",minWidth:"0"},'& [part="actions"]':{display:"flex",justifyContent:"flex-end"},'& [part="list"]':{display:"flex",flexDirection:"column",gap:"4px",margin:"0",padding:"0",listStyle:"none"},'& [part="row"]':{$description:"The left border is the state, at 3px, which is the one thing that must be legible in a column of twenty rows without reading any of them. Its default is the dim foreground so a state nobody has a colour for still draws a border rather than a gap.",display:"flex",alignItems:"flex-start",gap:"8px",padding:"6px 8px",border:"1px solid var(--border)",borderLeft:"3px solid var(--fg-dim)",borderRadius:"var(--radius)",background:"var(--bg-panel)",color:"var(--fg)",fontSize:"var(--jx-text-md)"},'& [part="row"][data-state="running"]':{borderLeftColor:"var(--accent)"},'& [part="row"][data-state="done"]':{borderLeftColor:"var(--success)"},'& [part="row"][data-state="failed"]':{borderLeftColor:"var(--danger)"},'& [part="row"][data-state="cancelled"]':{borderLeftColor:"var(--fg-dim)"},'& [part="icon"]':{flex:"none",width:"14px",textAlign:"center",fontWeight:"700",lineHeight:"1.5"},'& [part="row"][data-state="running"] [part="icon"]':{color:"var(--accent)"},'& [part="row"][data-state="done"] [part="icon"]':{color:"var(--success)"},'& [part="row"][data-state="failed"] [part="icon"]':{color:"var(--danger)"},'& [part="body"]':{flex:"1",minWidth:"0",display:"flex",flexDirection:"column",gap:"2px"},'& [part="head"]':{display:"flex",alignItems:"baseline",gap:"8px",minWidth:"0"},'& [part="row-title"]':{fontWeight:"700",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="source"], & [part="duration"]':{flex:"none",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="duration"]':{$description:"Pushed to the far edge so a column of rows reads as a column of times.",marginLeft:"auto"},'& [part="status"]':{color:"var(--fg-dim)",overflowWrap:"anywhere"},'& [part="steps"]':{$description:'The plan, declared up front, so "which of the three steps is this on" is answered by looking rather than by reading the status line and remembering what came before it.',display:"flex",flexDirection:"column",gap:"1px",margin:"2px 0 0",padding:"0",listStyle:"none",fontSize:"var(--jx-text-sm)"},'& [part="step"]':{display:"flex",gap:"6px",color:"var(--fg-dim)"},'& [part="step"][data-state="running"]':{color:"var(--fg)"},'& [part="step"][data-state="done"] [part="step-icon"]':{color:"var(--success)"},'& [part="step"][data-state="failed"] [part="step-icon"]':{color:"var(--danger)"},'& [part="step-icon"]':{flex:"none",width:"10px",textAlign:"center"},'& [part="log-toggle"]':{$description:"A plain button rather than a kit one, and the one element here that is not the kit's. The control has to carry `aria-expanded` on the node the reader actually focuses, and a `jx-button` forwards a fixed set of ARIA properties to the control inside its shadow root — an attribute written on the host would name the wrapper and not the button. Its wording is the disclosure's whole state (`docs/studio/interface/problems-and-progress.md` calls it the Show log disclosure), so nothing else has to draw one.",alignSelf:"flex-start",padding:"0",border:"none",background:"none",color:"var(--accent)",font:"inherit",fontSize:"var(--jx-text-sm)",cursor:"pointer",":hover":{textDecoration:"underline"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"2px"}},'& [part="log"]':{$description:"The captured output the progress modal used to show once and then lose. It scrolls inside the row rather than growing it, so one 400-line `bun install` failure does not become the whole panel. It is selectable against the root's `user-select: none`, the one part of an activity row that is: the output is what a reader pastes into a bug report, and the row offers no copy action.",userSelect:"text",maxHeight:"180px",margin:"2px 0 0",padding:"6px",overflow:"auto",borderRadius:"var(--jx-radius-xs)",background:"var(--bg)",color:"var(--fg-dim)",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-sm)",whiteSpace:"pre-wrap"},'& [part="cancel"]':{flex:"none"},'& [part="empty"]':{$description:"The teaching empty state, drawn here rather than borrowed from `panels/empty-state.ts`: that helper is a lit template and a document cannot call one. What it says is what is kept — one sentence saying what the region is FOR, then where its content comes from — and this region's fill is an operation somebody else starts, so it offers no button.",display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",padding:"24px",textAlign:"center",fontSize:"13px",color:"var(--fg-dim)"},'& [part="empty-message"], & [part="empty-detail"]':{margin:"0",maxWidth:"34ch",lineHeight:"1.5"},'& [part="empty-detail"]':{fontSize:"var(--jx-text-sm)",opacity:"0.8"}},children:[{tagName:"div",attributes:{part:"feed-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasRows"},cases:{true:{tagName:"div",attributes:{part:"feed"},children:[{tagName:"div",attributes:{part:"actions-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasFinished"},cases:{true:{tagName:"div",attributes:{part:"actions"},children:[{tagName:"jx-button",$props:{size:"sm",quiet:!0},attributes:{part:"clear"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/clearFinished"}}]},children:[{tagName:"span",textContent:"${state.clearLabel}"}]}]}}},{tagName:"ul",attributes:{part:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/rows"},key:{$ref:"$map/item/id"},map:{tagName:"li",attributes:{part:"row","data-state":"${$map.item.state}"},children:[{tagName:"span",attributes:{part:"icon","aria-hidden":"true"},textContent:"${$map.item.icon}"},{tagName:"div",attributes:{part:"body"},children:[{tagName:"div",attributes:{part:"head"},children:[{tagName:"span",attributes:{part:"row-title"},textContent:"${$map.item.title}"},{tagName:"span",attributes:{part:"source-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasSource"},cases:{true:{tagName:"span",attributes:{part:"source"},textContent:"${$map.item.source}"}}},{tagName:"span",attributes:{part:"duration"},textContent:"${$map.item.duration}"}]},{tagName:"div",attributes:{part:"status-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasStatus"},cases:{true:{tagName:"div",attributes:{part:"status"},textContent:"${$map.item.status}"}}},{tagName:"div",attributes:{part:"steps-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasSteps"},cases:{true:{tagName:"ol",attributes:{part:"steps"},children:[{$prototype:"Array",items:{$ref:"$map/item/steps"},key:{$ref:"$map/item/key"},map:{tagName:"li",attributes:{part:"step","data-state":"${$map.item.state}"},children:[{tagName:"span",attributes:{part:"step-icon","aria-hidden":"true"},textContent:"${$map.item.icon}"},{tagName:"span",attributes:{part:"step-label"},textContent:"${$map.item.label}"}]}}]}}},{tagName:"div",attributes:{part:"log-toggle-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasLog"},cases:{true:{tagName:"button",attributes:{part:"log-toggle",type:"button","aria-expanded":"${$map.item.expanded ? 'true' : 'false'}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/toggleLog"},value:[{$ref:"$map/item/id"}]}]},textContent:"${$map.item.logLabel}"}}},{tagName:"div",attributes:{part:"log-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/showLog"},cases:{true:{tagName:"pre",attributes:{part:"log"},textContent:"${$map.item.logText}"}}}]},{tagName:"div",attributes:{part:"cancel-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/cancellable"},cases:{true:{tagName:"jx-button",$props:{size:"sm"},attributes:{part:"cancel",title:"Stop this operation"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/cancel"},value:[{$ref:"$map/item/id"}]}]},children:[{tagName:"span",textContent:"Cancel"}]}}}]}}]}]},false:{tagName:"div",attributes:{part:"empty"},children:[{tagName:"p",attributes:{part:"empty-message"},textContent:"Long operations show their progress, their log and their Cancel button here."},{tagName:"p",attributes:{part:"empty-detail"},textContent:"Installs, clones, publishes and imports report here while they run."}]}}}]};T("panel-activity",y);var g=null,h=null,p=null,d=null;function E(t,e){t.rows=e.rows,t.hasRows=e.hasRows,t.hasFinished=e.hasFinished,t.clearLabel=e.clearLabel}function j(t){if(g!==t)return!1;return d===null?p!==null:d.root.parentNode===t}function b(t,e){if(j(t))return;f(),g=t;let a=v({cancel:e.cancel,clearFinished:e.clearFinished,clearLabel:"",hasFinished:!1,hasRows:!1,rows:[],toggleLog:e.toggleLog});h=ge(),h.run(()=>{Q(()=>{E(a,e.project())})});let o=R("panel-activity",a,t);p=o,o.then((i)=>{if(p===o)d=i;else i.dispose()})}function f(){h?.stop(),h=null;let t=p;if(p=null,d)d.dispose(),d=null;else if(t)t.then((e)=>e.dispose());g=null}var s=v([]),I=20,u=new Map,w=0;function H(){return w+=1,`a${w}`}function c(t){return t.state!=="running"}function x(){let t=s.filter((e)=>c(e)).length-I;while(t>0){let e=s.findIndex((a)=>c(a));if(e===-1)return;u.delete(s[e].id),s.splice(e,1),t-=1}}function aa(t){let e={cancellable:t.cancel!==void 0,endedAt:null,expanded:!1,id:H(),log:[],startedAt:Mo(),state:"running",status:t.status??"",steps:(t.steps??[]).map((i)=>({label:i,state:"pending"})),title:t.title,...t.source===void 0?{}:{source:t.source}};if(t.cancel)u.set(e.id,t.cancel);s.push(e);let a=s.at(-1);x();let o=(i,r)=>{if(c(a))return;if(a.state=i,a.endedAt=Mo(),r!==void 0)a.status=r;for(let n of a.steps)n.state=n.state==="done"?"done":i==="done"?"done":"failed";a.cancellable=!1,u.delete(a.id),x()};return{done(i){o("done",i)},entry:a,fail(i,r={}){if(c(a))return;let n=a.log.join(`
2
- `);o("failed",i),k.error(i,{source:a.source??a.title,...n===""?{}:{detail:n},...r.action===void 0?{}:{action:r.action},...r.path===void 0?{}:{path:r.path}})},id:a.id,log(i){let r=i.replace(/\s+$/,"");if(r!=="")a.log.push(r)},setStatus(i){if(!c(a))a.status=i},step(i){let r=a.steps.findIndex((n)=>n.label===i);if(r===-1)a.steps.push({label:i,state:"pending"}),r=a.steps.length-1;for(let[n,l]of a.steps.entries())l.state=n<r?"done":n===r?"running":l.state;a.status=i}}}function S(t){return s.find((e)=>e.id===t)}function m(){return s.filter((t)=>!c(t))}function F(t){let e=S(t),a=u.get(t);if(!e||!a||c(e))return!1;return a(),u.delete(t),e.state="cancelled",e.endedAt=Mo(),e.cancellable=!1,e.status="Cancelled",!0}function P(){let t=s.filter((a)=>!c(a)),e=s.length-t.length;return s.splice(0,s.length,...t),e}function qE(){return m().map((t)=>`activity: ${t.title} — ${t.status||"running"}`)}var M={cancelled:"⊘",done:"✓",failed:"✕",running:"⋯"},D={done:"✓",failed:"✕",pending:"·",running:"⋯"};function V(t,e=Mo()){let a=Math.max(0,(t.endedAt??e)-t.startedAt);if(a<1000)return`${a}ms`;let o=Math.round(a/1000);return o<60?`${o}s`:`${Math.floor(o/60)}m ${o%60}s`}function z(t,e){return{icon:D[t.state],key:`${e}:${t.label}`,label:t.label,state:t.state}}function _(t){let e=t.log.length;return{cancellable:t.cancellable,duration:V(t),expanded:t.expanded,hasLog:e>0,hasSource:(t.source??"")!=="",hasStatus:t.status!=="",hasSteps:t.steps.length>0,icon:M[t.state],id:t.id,logLabel:t.expanded?"Hide log":`Show log (${e} line(s))`,logText:t.log.join(`
1
+ import{br}from"./studio-5g0ag7c0.js";import{un,rn}from"./studio-geq1ea6k.js";import{ge,Q,v,Mo,k}from"./studio-vzacdfsc.js";import{di}from"./studio-g7nse7zb.js";import{rt,zt,T,R,An,Ct}from"./studio-e7xxa0sj.js";import{Ld}from"./studio-q1h883bt.js";import{tT}from"./studio-a2138x5k.js";import{qn}from"./studio-bmn4mn9j.js";import{wc,js,nm}from"./studio-19x1c75w.js";var y={$schema:"https://jxsuite.com/schema/v1",$id:"StudioPanelActivity",$description:'The Activity feed: one row per operation this session, newest last, drawn from the projection `panels/activity-panel.ts` hands in. A row is a glyph, a head line (what the operation is, who is running it, how long it has taken), the line it is doing now, the plan it declared, the log it captured and — only when the operation handed a callback over — its Cancel. Every conditional the row has is a boolean field on the projected item, because `$switch` over a value is the only conditional a document has and "is this entry cancellable" is a question the panel has already answered. Nothing here reads the activity store: the panel owns what an operation IS, and the surface owns what it looks like.',tagName:"div",attributes:{part:"panel"},style:{$description:"What `.activity-panel`, `.activity-actions`, `.activity-list`, `.activity-row`, `.activity-icon`, `.activity-body`, `.activity-head`, `.activity-title`, `.activity-source`, `.activity-duration`, `.activity-status`, `.activity-steps`, `.activity-step`, `.activity-step-icon`, `.activity-log-toggle` and `.activity-log` said in `styles/panels.css`, keyed on `part`. Two rules were DELETED rather than moved: `.activity-clear` and `.activity-cancel` drew a small bordered button by hand, and `jx-button` is that button — so the sizes, the border, the hover fill and the disabled state are the kit's now. Three token names changed meaning on the way: `--spectrum-font-size-50`, `--spectrum-font-size-75` and `--spectrum-corner-radius-75` resolve only inside `<sp-theme>`, and this document is mounted into the Bottom dock's body where that element is not an ancestor — every one of them would silently have taken its px fallback. They are the kit's own scale here (`--jx-text-sm`, `--jx-text-md`, `--jx-radius-xs`), which is the step each of them was. The `.activity-*` rules stay in the stylesheet regardless: `publish/deploy-checklist.ts` still draws the checklist above this feed in that same vocabulary, and it is a lit template until it converts.",display:"flex",flexDirection:"column",gap:"8px",padding:"8px",minWidth:"0",fontFamily:"var(--jx-font-sans)",color:"var(--fg)",'& [part="feed"]':{display:"flex",flexDirection:"column",gap:"8px",minWidth:"0"},'& [part="actions"]':{display:"flex",justifyContent:"flex-end"},'& [part="list"]':{display:"flex",flexDirection:"column",gap:"4px",margin:"0",padding:"0",listStyle:"none"},'& [part="row"]':{$description:"The left border is the state, at 3px, which is the one thing that must be legible in a column of twenty rows without reading any of them. Its default is the dim foreground so a state nobody has a colour for still draws a border rather than a gap.",display:"flex",alignItems:"flex-start",gap:"8px",padding:"6px 8px",border:"1px solid var(--border)",borderLeft:"3px solid var(--fg-dim)",borderRadius:"var(--radius)",background:"var(--bg-panel)",color:"var(--fg)",fontSize:"var(--jx-text-md)"},'& [part="row"][data-state="running"]':{borderLeftColor:"var(--accent)"},'& [part="row"][data-state="done"]':{borderLeftColor:"var(--success)"},'& [part="row"][data-state="failed"]':{borderLeftColor:"var(--danger)"},'& [part="row"][data-state="cancelled"]':{borderLeftColor:"var(--fg-dim)"},'& [part="icon"]':{flex:"none",width:"14px",textAlign:"center",fontWeight:"700",lineHeight:"1.5"},'& [part="row"][data-state="running"] [part="icon"]':{color:"var(--accent)"},'& [part="row"][data-state="done"] [part="icon"]':{color:"var(--success)"},'& [part="row"][data-state="failed"] [part="icon"]':{color:"var(--danger)"},'& [part="body"]':{flex:"1",minWidth:"0",display:"flex",flexDirection:"column",gap:"2px"},'& [part="head"]':{display:"flex",alignItems:"baseline",gap:"8px",minWidth:"0"},'& [part="row-title"]':{fontWeight:"700",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="source"], & [part="duration"]':{flex:"none",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="duration"]':{$description:"Pushed to the far edge so a column of rows reads as a column of times.",marginLeft:"auto"},'& [part="status"]':{color:"var(--fg-dim)",overflowWrap:"anywhere"},'& [part="steps"]':{$description:'The plan, declared up front, so "which of the three steps is this on" is answered by looking rather than by reading the status line and remembering what came before it.',display:"flex",flexDirection:"column",gap:"1px",margin:"2px 0 0",padding:"0",listStyle:"none",fontSize:"var(--jx-text-sm)"},'& [part="step"]':{display:"flex",gap:"6px",color:"var(--fg-dim)"},'& [part="step"][data-state="running"]':{color:"var(--fg)"},'& [part="step"][data-state="done"] [part="step-icon"]':{color:"var(--success)"},'& [part="step"][data-state="failed"] [part="step-icon"]':{color:"var(--danger)"},'& [part="step-icon"]':{flex:"none",width:"10px",textAlign:"center"},'& [part="log-toggle"]':{$description:"A plain button rather than a kit one, and the one element here that is not the kit's. The control has to carry `aria-expanded` on the node the reader actually focuses, and a `jx-button` forwards a fixed set of ARIA properties to the control inside its shadow root — an attribute written on the host would name the wrapper and not the button. Its wording is the disclosure's whole state (`docs/studio/interface/problems-and-progress.md` calls it the Show log disclosure), so nothing else has to draw one.",alignSelf:"flex-start",padding:"0",border:"none",background:"none",color:"var(--accent)",font:"inherit",fontSize:"var(--jx-text-sm)",cursor:"pointer",":hover":{textDecoration:"underline"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"2px"}},'& [part="log"]':{$description:"The captured output the progress modal used to show once and then lose. It scrolls inside the row rather than growing it, so one 400-line `bun install` failure does not become the whole panel. It is selectable against the root's `user-select: none`, the one part of an activity row that is: the output is what a reader pastes into a bug report, and the row offers no copy action.",userSelect:"text",maxHeight:"180px",margin:"2px 0 0",padding:"6px",overflow:"auto",borderRadius:"var(--jx-radius-xs)",background:"var(--bg)",color:"var(--fg-dim)",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-sm)",whiteSpace:"pre-wrap"},'& [part="cancel"]':{flex:"none"},'& [part="empty"]':{$description:"The teaching empty state, drawn here rather than borrowed from `panels/empty-state.ts`: that helper is a lit template and a document cannot call one. What it says is what is kept — one sentence saying what the region is FOR, then where its content comes from — and this region's fill is an operation somebody else starts, so it offers no button.",display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",padding:"24px",textAlign:"center",fontSize:"13px",color:"var(--fg-dim)"},'& [part="empty-message"], & [part="empty-detail"]':{margin:"0",maxWidth:"34ch",lineHeight:"1.5"},'& [part="empty-detail"]':{fontSize:"var(--jx-text-sm)",opacity:"0.8"}},children:[{tagName:"div",attributes:{part:"feed-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasRows"},cases:{true:{tagName:"div",attributes:{part:"feed"},children:[{tagName:"div",attributes:{part:"actions-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasFinished"},cases:{true:{tagName:"div",attributes:{part:"actions"},children:[{tagName:"jx-button",$props:{size:"sm",quiet:!0},attributes:{part:"clear"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/clearFinished"}}]},children:[{tagName:"span",textContent:"${state.clearLabel}"}]}]}}},{tagName:"ul",attributes:{part:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/rows"},key:{$ref:"$map/item/id"},map:{tagName:"li",attributes:{part:"row","data-state":"${$map.item.state}"},children:[{tagName:"span",attributes:{part:"icon","aria-hidden":"true"},textContent:"${$map.item.icon}"},{tagName:"div",attributes:{part:"body"},children:[{tagName:"div",attributes:{part:"head"},children:[{tagName:"span",attributes:{part:"row-title"},textContent:"${$map.item.title}"},{tagName:"span",attributes:{part:"source-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasSource"},cases:{true:{tagName:"span",attributes:{part:"source"},textContent:"${$map.item.source}"}}},{tagName:"span",attributes:{part:"duration"},textContent:"${$map.item.duration}"}]},{tagName:"div",attributes:{part:"status-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasStatus"},cases:{true:{tagName:"div",attributes:{part:"status"},textContent:"${$map.item.status}"}}},{tagName:"div",attributes:{part:"steps-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasSteps"},cases:{true:{tagName:"ol",attributes:{part:"steps"},children:[{$prototype:"Array",items:{$ref:"$map/item/steps"},key:{$ref:"$map/item/key"},map:{tagName:"li",attributes:{part:"step","data-state":"${$map.item.state}"},children:[{tagName:"span",attributes:{part:"step-icon","aria-hidden":"true"},textContent:"${$map.item.icon}"},{tagName:"span",attributes:{part:"step-label"},textContent:"${$map.item.label}"}]}}]}}},{tagName:"div",attributes:{part:"log-toggle-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasLog"},cases:{true:{tagName:"button",attributes:{part:"log-toggle",type:"button","aria-expanded":"${$map.item.expanded ? 'true' : 'false'}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/toggleLog"},value:[{$ref:"$map/item/id"}]}]},textContent:"${$map.item.logLabel}"}}},{tagName:"div",attributes:{part:"log-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/showLog"},cases:{true:{tagName:"pre",attributes:{part:"log"},textContent:"${$map.item.logText}"}}}]},{tagName:"div",attributes:{part:"cancel-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/cancellable"},cases:{true:{tagName:"jx-button",$props:{size:"sm"},attributes:{part:"cancel",title:"Stop this operation"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/cancel"},value:[{$ref:"$map/item/id"}]}]},children:[{tagName:"span",textContent:"Cancel"}]}}}]}}]}]},false:{tagName:"div",attributes:{part:"empty"},children:[{tagName:"p",attributes:{part:"empty-message"},textContent:"Long operations show their progress, their log and their Cancel button here."},{tagName:"p",attributes:{part:"empty-detail"},textContent:"Installs, clones, publishes and imports report here while they run."}]}}}]};T("panel-activity",y);var g=null,h=null,p=null,d=null;function E(t,e){t.rows=e.rows,t.hasRows=e.hasRows,t.hasFinished=e.hasFinished,t.clearLabel=e.clearLabel}function j(t){if(g!==t)return!1;return d===null?p!==null:d.root.parentNode===t}function b(t,e){if(j(t))return;f(),g=t;let a=v({cancel:e.cancel,clearFinished:e.clearFinished,clearLabel:"",hasFinished:!1,hasRows:!1,rows:[],toggleLog:e.toggleLog});h=ge(),h.run(()=>{Q(()=>{E(a,e.project())})});let o=R("panel-activity",a,t);p=o,o.then((i)=>{if(p===o)d=i;else i.dispose()})}function f(){h?.stop(),h=null;let t=p;if(p=null,d)d.dispose(),d=null;else if(t)t.then((e)=>e.dispose());g=null}var s=v([]),I=20,u=new Map,w=0;function H(){return w+=1,`a${w}`}function c(t){return t.state!=="running"}function x(){let t=s.filter((e)=>c(e)).length-I;while(t>0){let e=s.findIndex((a)=>c(a));if(e===-1)return;u.delete(s[e].id),s.splice(e,1),t-=1}}function aa(t){let e={cancellable:t.cancel!==void 0,endedAt:null,expanded:!1,id:H(),log:[],startedAt:Mo(),state:"running",status:t.status??"",steps:(t.steps??[]).map((i)=>({label:i,state:"pending"})),title:t.title,...t.source===void 0?{}:{source:t.source}};if(t.cancel)u.set(e.id,t.cancel);s.push(e);let a=s.at(-1);x();let o=(i,r)=>{if(c(a))return;if(a.state=i,a.endedAt=Mo(),r!==void 0)a.status=r;for(let n of a.steps)n.state=n.state==="done"?"done":i==="done"?"done":"failed";a.cancellable=!1,u.delete(a.id),x()};return{done(i){o("done",i)},entry:a,fail(i,r={}){if(c(a))return;let n=a.log.join(`
2
+ `);o("failed",i),k.error(i,{source:a.source??a.title,...n===""?{}:{detail:n},...r.action===void 0?{}:{action:r.action},...r.path===void 0?{}:{path:r.path}})},id:a.id,log(i){let r=i.replace(/\s+$/,"");if(r!=="")a.log.push(r)},setStatus(i){if(!c(a))a.status=i},step(i){let r=a.steps.findIndex((n)=>n.label===i);if(r===-1)a.steps.push({label:i,state:"pending"}),r=a.steps.length-1;for(let[n,l]of a.steps.entries())l.state=n<r?"done":n===r?"running":l.state;a.status=i}}}function S(t){return s.find((e)=>e.id===t)}function m(){return s.filter((t)=>!c(t))}function F(t){let e=S(t),a=u.get(t);if(!e||!a||c(e))return!1;return a(),u.delete(t),e.state="cancelled",e.endedAt=Mo(),e.cancellable=!1,e.status="Cancelled",!0}function P(){let t=s.filter((a)=>!c(a)),e=s.length-t.length;return s.splice(0,s.length,...t),e}function KE(){return m().map((t)=>`activity: ${t.title} — ${t.status||"running"}`)}var M={cancelled:"⊘",done:"✓",failed:"✕",running:"⋯"},D={done:"✓",failed:"✕",pending:"·",running:"⋯"};function V(t,e=Mo()){let a=Math.max(0,(t.endedAt??e)-t.startedAt);if(a<1000)return`${a}ms`;let o=Math.round(a/1000);return o<60?`${o}s`:`${Math.floor(o/60)}m ${o%60}s`}function z(t,e){return{icon:D[t.state],key:`${e}:${t.label}`,label:t.label,state:t.state}}function _(t){let e=t.log.length;return{cancellable:t.cancellable,duration:V(t),expanded:t.expanded,hasLog:e>0,hasSource:(t.source??"")!=="",hasStatus:t.status!=="",hasSteps:t.steps.length>0,icon:M[t.state],id:t.id,logLabel:t.expanded?"Hide log":`Show log (${e} line(s))`,logText:t.log.join(`
3
3
  `),showLog:t.expanded&&e>0,source:t.source??"",state:t.state,status:t.status,steps:t.steps.map((a,o)=>z(a,o)),title:t.title}}function O(){let t=s.filter((e)=>c(e)).length;return{clearLabel:`Clear ${t} finished`,hasFinished:t>0,hasRows:s.length>0,rows:s.map((e)=>_(e))}}var U={cancel:(t)=>{F(t)},clearFinished:()=>{P()},project:O,toggleLog:(t)=>{let e=S(t);if(e)e.expanded=!e.expanded}};function W(){return br`<div data-deploy-checklist></div>
4
- <div data-activity-surface></div>`}function B(t){let e=t.querySelector("[data-activity-surface]");if(!e){f();return}b(e,U)}function GE(){qn({id:"activity",title:"Activity",level:"project",dock:"bottom",icon:"clock-counter-clockwise",rail:!1,badge:()=>m().length>0?m().length:null,render:()=>W(),afterRender:(t,e)=>{QE(e),B(e)}})}var q={message:"no media file to look for",status:"failed"};function A(t){let e=di(t);return e===""?null:{path:e}}function KE(t){let e=A(t);return e===null?null:yc(e)}async function Cb(t){let e=A(t);return e===null?q:js(e)}function JE(t){if(t===null)return"Counting references…";switch(t.status){case"unsupported":return null;case"pending":return"Counting references…";case"failed":return"Usage unknown";default:return tm(t.result)}}var L={$schema:"https://jxsuite.com/schema/v1",$id:"StudioProgressModal",$description:"The one surface in Studio that blocks while it works: the operation's name, a spinner, the line under it, and the two ways out. A `jx-dialog`, so the platform owns modality, the backdrop, focus restoration and Escape — which is what retired the `sp-underlay` this surface used to paint beside itself, and with it the fixed box, the panel, the shadow and the `z-index: 1000` that box needed to climb back out from under its own scrim. The two answers are the dialog's own: confirm is `Run in the background`, which stops the BLOCKING and leaves the work running in Activity, and the secondary answer is Cancel, drawn only when the operation handed one over. It is the secondary rather than the cancel answer for a reason that is behavioural, not cosmetic: the platform raises one `cancel` for Escape, for a light dismissal and for the cancel button alike, and a surface that cannot tell them apart would stop a dependency install on a keystroke. Escape therefore means what confirm means — stop blocking, not stop working — and the answer that stops the work is a button and only a button.",tagName:"jx-dialog",$props:{headline:{$ref:"#/state/title"},confirmLabel:"Run in the background",secondaryLabel:{$ref:"#/state/cancelLabel"},cancelLabel:"",size:"sm"},attributes:{part:"progress"},onconfirm:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/background"},value:[]}]},onsecondary:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/cancel"},value:[]}]},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/background"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},style:{$description:"What is left once `jx-dialog` has drawn the dialog. `.progress-modal` is gone rather than moved — it positioned a fixed box, painted its panel, border, radius and shadow, capped its height and then lifted itself above the scrim it rendered beside — and a modal `<dialog>` in the top layer is every one of those. `.progress-title` went the same way: the operation's name is the dialog's headline, which is also its accessible name, so nothing here draws a title.",'& [part="row"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-4)"},'& [part="status"]':{$description:"`anywhere`, because a status line is usually a path or a package spec with no space in it, and one of those would otherwise be the thing that decides how wide the dialog is. `min-width: 0` is what lets it wrap at all: a flex item's automatic minimum is its content, so without this the row refuses to shrink and the text overflows instead.",minWidth:"0",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)",overflowWrap:"anywhere"}},children:[{tagName:"div",attributes:{part:"row"},children:[{tagName:"jx-spinner",attributes:{part:"busy"},$props:{size:"lg"}},{tagName:"span",attributes:{part:"status","aria-live":"polite"},textContent:"${state.status}"}]}]};T("progress-modal",L);function N(t){let e=document.createElement("div");e.style.pointerEvents="auto",e.setAttribute(rt,zt("modal","progress")),t.layer.append(e);let a=!1,o=v({background:()=>{t.onBackground()},cancel:()=>{t.onCancel()},cancelLabel:t.cancellable?"Cancel":"",closed:()=>{t.onClosed()},status:t.status,title:t.title}),i=null,r=R("progress-modal",o,e).then(async(n)=>{let l=n.root;if(a)return n.dispose(),l;if(i=n,await An(l),a)return l;return un(l),l});return{close(){if(a)return;a=!0;let n=i?.root;if(n instanceof HTMLElement)rn(n);i?.dispose(),i=null,e.remove()},host:e,ready:r,setStatus(n){o.status=n}}}function la(t){let e=!1,a=aa({title:t.title,...t.status===void 0?{}:{status:t.status},...t.source===void 0?{}:{source:t.source},...t.cancel===void 0?{}:{cancel:t.cancel}}),o=()=>{if(e)return;e=!0,r.close()},i=()=>{o(),Td("activity")},r=N({cancellable:t.cancel!==void 0,layer:Ct("modal"),onBackground:i,onCancel:()=>{o(),t.cancel?.()},onClosed:o,status:t.status??"",title:t.title});return{activity:a,done(){a.done(),o()},fail(n){let l=(n??"").trim();if(l===""||l.includes(`
4
+ <div data-activity-surface></div>`}function B(t){let e=t.querySelector("[data-activity-surface]");if(!e){f();return}b(e,U)}function JE(){qn({id:"activity",title:"Activity",level:"project",dock:"bottom",icon:"clock-counter-clockwise",rail:!1,badge:()=>m().length>0?m().length:null,render:()=>W(),afterRender:(t,e)=>{tT(e),B(e)}})}var q={message:"no media file to look for",status:"failed"};function A(t){let e=di(t);return e===""?null:{path:e}}function YE(t){let e=A(t);return e===null?null:wc(e)}async function kb(t){let e=A(t);return e===null?q:js(e)}function ZE(t){if(t===null)return"Counting references…";switch(t.status){case"unsupported":return null;case"pending":return"Counting references…";case"failed":return"Usage unknown";default:return nm(t.result)}}var L={$schema:"https://jxsuite.com/schema/v1",$id:"StudioProgressModal",$description:"The one surface in Studio that blocks while it works: the operation's name, a spinner, the line under it, and the two ways out. A `jx-dialog`, so the platform owns modality, the backdrop, focus restoration and Escape — which is what retired the `sp-underlay` this surface used to paint beside itself, and with it the fixed box, the panel, the shadow and the `z-index: 1000` that box needed to climb back out from under its own scrim. The two answers are the dialog's own: confirm is `Run in the background`, which stops the BLOCKING and leaves the work running in Activity, and the secondary answer is Cancel, drawn only when the operation handed one over. It is the secondary rather than the cancel answer for a reason that is behavioural, not cosmetic: the platform raises one `cancel` for Escape, for a light dismissal and for the cancel button alike, and a surface that cannot tell them apart would stop a dependency install on a keystroke. Escape therefore means what confirm means — stop blocking, not stop working — and the answer that stops the work is a button and only a button.",tagName:"jx-dialog",$props:{headline:{$ref:"#/state/title"},confirmLabel:"Run in the background",secondaryLabel:{$ref:"#/state/cancelLabel"},cancelLabel:"",size:"sm"},attributes:{part:"progress"},onconfirm:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/background"},value:[]}]},onsecondary:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/cancel"},value:[]}]},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/background"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},style:{$description:"What is left once `jx-dialog` has drawn the dialog. `.progress-modal` is gone rather than moved — it positioned a fixed box, painted its panel, border, radius and shadow, capped its height and then lifted itself above the scrim it rendered beside — and a modal `<dialog>` in the top layer is every one of those. `.progress-title` went the same way: the operation's name is the dialog's headline, which is also its accessible name, so nothing here draws a title.",'& [part="row"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-4)"},'& [part="status"]':{$description:"`anywhere`, because a status line is usually a path or a package spec with no space in it, and one of those would otherwise be the thing that decides how wide the dialog is. `min-width: 0` is what lets it wrap at all: a flex item's automatic minimum is its content, so without this the row refuses to shrink and the text overflows instead.",minWidth:"0",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)",overflowWrap:"anywhere"}},children:[{tagName:"div",attributes:{part:"row"},children:[{tagName:"jx-spinner",attributes:{part:"busy"},$props:{size:"lg"}},{tagName:"span",attributes:{part:"status","aria-live":"polite"},textContent:"${state.status}"}]}]};T("progress-modal",L);function N(t){let e=document.createElement("div");e.style.pointerEvents="auto",e.setAttribute(rt,zt("modal","progress")),t.layer.append(e);let a=!1,o=v({background:()=>{t.onBackground()},cancel:()=>{t.onCancel()},cancelLabel:t.cancellable?"Cancel":"",closed:()=>{t.onClosed()},status:t.status,title:t.title}),i=null,r=R("progress-modal",o,e).then(async(n)=>{let l=n.root;if(a)return n.dispose(),l;if(i=n,await An(l),a)return l;return un(l),l});return{close(){if(a)return;a=!0;let n=i?.root;if(n instanceof HTMLElement)rn(n);i?.dispose(),i=null,e.remove()},host:e,ready:r,setStatus(n){o.status=n}}}function la(t){let e=!1,a=aa({title:t.title,...t.status===void 0?{}:{status:t.status},...t.source===void 0?{}:{source:t.source},...t.cancel===void 0?{}:{cancel:t.cancel}}),o=()=>{if(e)return;e=!0,r.close()},i=()=>{o(),Ld("activity")},r=N({cancellable:t.cancel!==void 0,layer:Ct("modal"),onBackground:i,onCancel:()=>{o(),t.cancel?.()},onClosed:o,status:t.status??"",title:t.title});return{activity:a,done(){a.done(),o()},fail(n){let l=(n??"").trim();if(l===""||l.includes(`
5
5
  `))a.log(l),a.fail(`${t.title} failed`);else a.fail(l);o()},log(n){a.log(n)},setStatus(n){if(a.setStatus(n),!e)r.setStatus(n)}}}
6
- export{aa,qE,GE,la,KE,Cb,JE};
6
+ export{aa,KE,JE,la,YE,kb,ZE};
7
7
 
8
- //# debugId=3D86C10737F90A3D64756E2164756E21
9
- //# sourceMappingURL=studio-capk0583.js.map
8
+ //# debugId=9770191B6FB90C3064756E2164756E21
9
+ //# sourceMappingURL=studio-9ft45c83.js.map
@@ -0,0 +1,7 @@
1
+ import{p}from"./studio-qpqa7vk3.js";import{cp}from"./studio-ghrhy2y7.js";import{ge,Q,v,Bm}from"./studio-vzacdfsc.js";import{ne}from"./studio-geq1ea6k.js";import{T,R}from"./studio-e7xxa0sj.js";import{Bi,y}from"./studio-q1h883bt.js";import{D}from"./studio-wgh5kxpj.js";function k({slug:e,adapter:t}){let o=new Date().toISOString().slice(0,10);return`${JSON.stringify(t==="cloudflare-workers"?{assets:{binding:"ASSETS",directory:"./dist"},compatibility_date:o,compatibility_flags:["nodejs_compat"],main:"./dist/worker.js",name:e}:{compatibility_date:o,compatibility_flags:["nodejs_compat"],name:e,pages_build_output_dir:"./dist"},null,"\t")}
2
+ `}function m(e,{slug:t,adapter:o}){if(!e)return{content:k({adapter:o,slug:t}),patched:!0};let n;try{n=JSON.parse(e)}catch{return{content:e,patched:!1}}if(n.name=t,o==="cloudflare-workers")delete n.pages_build_output_dir,n.main="./dist/worker.js",n.assets={binding:"ASSETS",directory:"./dist"};else delete n.main,delete n.assets,n.pages_build_output_dir="./dist";return{content:`${JSON.stringify(n,null,"\t")}
3
+ `,patched:!0}}function bd(){try{return typeof p().cfApi==="function"}catch{return!1}}async function l(e,t){let o=p().cfApi;if(!o)throw Error("This platform cannot reach the Cloudflare API");try{return await o(e,t)}catch(n){throw cp(n),n}}async function XE(){return l("/accounts")}async function j(e,t){try{return await l(`/accounts/${e}/pages/projects/${t}`)}catch{return null}}async function C(e){return l(`/accounts/${e.accountId}/pages/projects`,{method:"POST",body:{name:e.projectName,production_branch:e.productionBranch,build_config:{build_command:"bunx jx build",destination_dir:"dist",...e.rootDir?{root_dir:e.rootDir}:{}},source:{type:"github",config:{owner:e.owner,repo_name:e.repo,production_branch:e.productionBranch,deployments_enabled:!0}}}})}async function Xf(e){let t=await l(`/accounts/${e.accountId}/pages/projects/${e.projectName}/deployments`),[o]=t;if(!o)return null;return{id:o.id,url:o.url,environment:o.environment,stage:o.latest_stage?.name??"unknown",status:o.latest_stage?.status??"unknown",createdOn:o.created_on}}async function j1(e,t){let o={...e.build};if(t===null)delete o.deploy;else o.deploy=t;if(await Bi({build:o}),t!==null){let n=p(),i=null;try{i=await n.readFile("wrangler.jsonc")}catch{i=null}let w=o.adapter==="cloudflare-workers"?"cloudflare-workers":"cloudflare-pages",{content:x,patched:S}=m(i,{adapter:w,slug:t.projectName});if(S)await n.writeFile("wrangler.jsonc",x)}}async function QE(e,t){let n=await j(t.accountId,t.projectName)??await C(t),i={provider:"cloudflare-pages",accountId:t.accountId,projectName:t.projectName,...n.subdomain?{productionUrl:`https://${n.subdomain}`}:{}};return await j1(e,i),i}var h={$schema:"https://jxsuite.com/schema/v1",$id:"StudioPanelDeployChecklist",$description:"The deploy checklist, drawn above the Activity feed in the Bottom dock's Activity tab: what is MISSING before this project can ship, as one row with the chain of prerequisites under it. `publish/deploy-checklist.ts` owns the chain — which link is forged, which is merely unasked, and which command forges the next one — and hands this document a row, four steps and at most one action. Nothing here reads source control, the project config or the command registry. It draws in the Activity tab's own vocabulary because a deploy is an ordered list of stages that finish, which is exactly what a row of that feed already is; a fifth visual idiom for it would be a second design of a thing the tab has.",tagName:"div",attributes:{part:"checklist"},style:{$description:"What `.activity-list`, `.activity-row`, `.activity-row--running`, `.activity-row--done`, `.activity-icon`, `.activity-body`, `.activity-head`, `.activity-title`, `.activity-source`, `.activity-status`, `.activity-steps`, `.activity-step`, `.activity-step--done` and `.activity-step-icon` said in `styles/panels.css`, keyed on `part`. This is the LAST reader of those rules — `surfaces/panel-activity.json` carried its own copy when the feed converted, and left the stylesheet standing because this file still drew from it — so the whole `.problem-*, .activity-*` block is dead once this lands. Three token names could not travel: `--spectrum-font-size-50`, `--spectrum-font-size-75` and `--spectrum-corner-radius-75` resolve only inside `<sp-theme>`, and a document mounted into the dock body is outside it, so each would silently have taken its hard-coded px fallback. They are the kit's own scale here. One thing changed meaning on purpose: the step's `data-state` is the checklist's own three-valued state rather than the two CSS classes it used to collapse into, so `unknown` — \"nobody has asked\" — is a state the styling can tell apart from `todo` the day it should.",display:"block",minWidth:"0",fontFamily:"var(--jx-font-sans)",color:"var(--fg)",'& [part="list"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-1)",margin:"0",padding:"0",listStyle:"none"},'& [part="row"]':{$description:"The left border is the state, at 3px, which is the one thing that must be legible without reading the row. Its default is the dim foreground so a state nobody has a colour for still draws a border rather than a gap.",display:"flex",alignItems:"flex-start",gap:"var(--jx-space-2)",padding:"6px var(--jx-space-2)",border:"1px solid var(--border)",borderLeft:"3px solid var(--fg-dim)",borderRadius:"var(--radius)",background:"var(--bg-panel)",color:"var(--fg)",fontSize:"var(--jx-text-md)"},'& [part="row"][data-state="running"]':{borderLeftColor:"var(--accent)"},'& [part="row"][data-state="done"]':{borderLeftColor:"var(--success)"},'& [part="state-icon"]':{$description:'Named `state-icon` rather than `icon`: `jx-button` puts `part="icon"` on the glyph slot of every button it draws, and the action button below is inside this same light-DOM tree — a rule on the bare name would reach into the kit\'s own drawing and a devtools query could not tell the two apart.',flex:"none",width:"14px",textAlign:"center",fontWeight:"700",lineHeight:"1.5"},'& [part="row"][data-state="running"] > [part="state-icon"]':{color:"var(--accent)"},'& [part="row"][data-state="done"] > [part="state-icon"]':{color:"var(--success)"},'& [part="row-body"]':{flex:"1",minWidth:"0",display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"2px"},'& [part="head"]':{display:"flex",alignItems:"baseline",gap:"var(--jx-space-2)",alignSelf:"stretch",minWidth:"0"},'& [part="row-title"]':{fontWeight:"700",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="source"]':{$description:"Pushed to the far edge, so the tab reads as a column of who raised what.",flex:"none",marginLeft:"auto",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="summary"]':{color:"var(--fg-dim)",overflowWrap:"anywhere"},'& [part="steps"]':{$description:'The chain, declared up front, so "which link is missing" is answered by looking rather than by reading the summary and remembering what came before it.',display:"flex",flexDirection:"column",gap:"1px",margin:"2px 0 0",padding:"0",listStyle:"none",fontSize:"var(--jx-text-sm)"},'& [part="step"]':{display:"flex",gap:"6px",color:"var(--fg-dim)"},'& [part="step"][data-state="done"] > [part="step-icon"]':{color:"var(--success)"},'& [part="step-icon"]':{flex:"none",width:"10px",textAlign:"center"},'& [part="action"]':{marginTop:"var(--jx-space-1)"}},children:[{tagName:"div",attributes:{part:"body-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasProject"},cases:{true:{tagName:"ul",attributes:{part:"list"},children:[{tagName:"li",attributes:{part:"row","data-state":"${state.rowState}"},children:[{tagName:"span",attributes:{part:"state-icon","aria-hidden":"true"},textContent:"${state.rowIcon}"},{tagName:"div",attributes:{part:"row-body"},children:[{tagName:"div",attributes:{part:"head"},children:[{tagName:"span",attributes:{part:"row-title"},textContent:"Deploy checklist"},{tagName:"span",attributes:{part:"source"},textContent:"Publish"}]},{tagName:"div",attributes:{part:"summary"},textContent:"${state.summary}"},{tagName:"ol",attributes:{part:"steps"},children:[{$prototype:"Array",items:{$ref:"#/state/steps"},key:{$ref:"$map/item/id"},map:{tagName:"li",attributes:{part:"step","data-step":"${$map.item.id}","data-state":"${$map.item.state}"},children:[{tagName:"span",attributes:{part:"step-icon","aria-hidden":"true"},textContent:"${$map.item.icon}"},{tagName:"span",attributes:{part:"step-text"},textContent:"${$map.item.text}"}]}}]},{tagName:"span",attributes:{part:"action-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasAction"},cases:{true:{tagName:"jx-button",$description:"The recovery button wears the command's own title, so it reads as a verb rather than as a decoration, and a refused command is dimmed with the reason it names in its tooltip. A command the registry does not have, or whose `when` is false, draws NOTHING rather than a dead label — a surface may choose whether to show a command, never whether it exists (§13).",$props:{size:"sm",disabled:{$ref:"#/state/actionDisabled"}},attributes:{part:"action",title:"${state.actionTitle}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/runAction"},value:[]}]},children:[{tagName:"span",textContent:"${state.actionLabel}"}]}}}]}]}]}}}]};T("panel-deploy-checklist",h);var d=null,c=null,a=null,r=null;function A(e,t){e.hasProject=t.hasProject,e.rowState=t.rowState,e.rowIcon=t.rowIcon,e.summary=t.summary,e.steps=t.steps,e.hasAction=t.hasAction,e.actionLabel=t.actionLabel,e.actionTitle=t.actionTitle,e.actionDisabled=t.actionDisabled}function N(e){if(d!==e)return!1;return r===null?a!==null:r.root.parentNode===e}function f(e,t){if(N(e))return;u(),d=e;let o=v({actionDisabled:!1,actionLabel:"",actionTitle:"",hasAction:!1,hasProject:!1,rowIcon:"",rowState:"running",runAction:t.runAction,steps:[],summary:""});c=ge(),c.run(()=>{Q(()=>{A(o,t.project())})});let n=R("panel-deploy-checklist",o,e);a=n,n.then((i)=>{if(a===n)r=i;else i.dispose()})}function u(){c?.stop(),c=null;let e=a;if(a=null,r)r.dispose(),r=null;else if(e)e.then((t)=>t.dispose());d=null}function I(){return D?.projectConfig??null}function ca(){return I()?.build?.deploy}var s=Bm({asked:!1,observed:null});function sp(e){s.observed=e,s.asked=!0}function _(){let{status:e}=y.git;if(e===null)return{command:"git.init",detail:"Source control has not reported on this project yet.",id:"repo",label:"Track this project with git",state:"unknown"};return e.isRepo?{command:"git.init",detail:`Tracked${e.branch?` — on branch ${e.branch}`:""}.`,id:"repo",label:"Track this project with git",state:"done"}:{command:"git.init",detail:"A deploy ships what the repository holds, so the repository comes first.",id:"repo",label:"Track this project with git",state:"todo"}}function L(){let{status:e}=y.git;if(e===null||!e.isRepo)return{command:"git.createGithubRepository",detail:"A remote is where the provider builds from.",id:"remote",label:"Push to a remote",state:e===null?"unknown":"todo"};if((e.remotes??[]).length===0)return{command:"git.createGithubRepository",detail:"This repository is local only — nothing outside this machine can build it.",id:"remote",label:"Push to a remote",state:"todo"};return e.ahead>0?{command:"git.push",detail:`${e.ahead} commit(s) are not on ${e.remotes[0]} yet, so a build would ship the older tree.`,id:"remote",label:"Push to a remote",state:"todo"}:{command:"git.push",detail:`Up to date with ${e.remotes[0]}.`,id:"remote",label:"Push to a remote",state:"done"}}function O(){let e=ca();if(e)return{command:"publish.setUp",detail:`Cloudflare Pages project ${e.projectName}.`,id:"provider",label:"Connect a deploy provider",state:"done"};return bd()?{command:"publish.setUp",detail:"Connecting one makes every commit build and publish on its own.",id:"provider",label:"Connect a deploy provider",state:"todo"}:{command:"publish.setUp",detail:"This platform cannot reach the Cloudflare API. Commit and push instead — your host "+"runs bunx jx build and serves dist/.",id:"provider",label:"Connect a deploy provider",state:"unknown"}}function E(){if(!ca())return{command:"publish.deploy",detail:"Nothing has been deployed, because no provider is connected.",id:"deployed",label:"Deploy",state:"todo"};if(!s.asked)return{command:"publish.deploy",detail:"Cloudflare has not been asked yet, so this is not a claim that nothing shipped.",id:"deployed",label:"Deploy",state:"unknown"};if(s.observed===null)return{command:"publish.deploy",detail:"Cloudflare reports no deployments for this project.",id:"deployed",label:"Deploy",state:"todo"};let{observed:e}=s;return e.status==="success"?{command:"publish.deploy",detail:`${e.environment} — ${e.url}`,id:"deployed",label:"Deploy",state:"done"}:{command:"publish.deploy",detail:`Last deployment ${e.stage}: ${e.status}.`,id:"deployed",label:"Deploy",state:"todo"}}function g(){return[_(),L(),O(),E()]}function b(){return g().find((e)=>e.state!=="done")??null}function eT(){if(!D)return null;let e=b();if(e)return{command:e.command,label:e.label,title:e.detail};return{command:"publish.openDashboard",label:"Deployed",title:ca()?.productionUrl??"Everything this project needs to ship is in place."}}var W={done:"✓",todo:"·",unknown:"?"};function V(e){return{icon:W[e.state],id:e.id,state:e.state,text:e.state==="done"?e.label:`${e.label} — ${e.detail}`}}function H(e){let t={actionDisabled:!1,actionLabel:"",actionTitle:"",hasAction:!1};if(!e)return t;let o=ne(),n=o?.get(e.command);if(!o||!n||!o.isVisible(e.command))return t;let i=o.disabledReason(e.command);return{actionDisabled:i!==void 0,actionLabel:n.title,actionTitle:i?`${n.title} — requires ${i}`:n.title,hasAction:!0}}function J(){if(!D)return{actionDisabled:!1,actionLabel:"",actionTitle:"",hasAction:!1,hasProject:!1,rowIcon:"",rowState:"running",steps:[],summary:""};let e=g(),t=e.find((o)=>o.state!=="done")??null;return{...H(t),hasProject:!0,rowIcon:t?"⋯":"✓",rowState:t?"running":"done",steps:e.map((o)=>V(o)),summary:t?t.detail:"Everything this project needs to ship is in place."}}function B(){let e=b();if(!e)return;ne()?.run(e.command)}var F={project:J,runAction:B};function tT(e){let t=e.querySelector("[data-deploy-checklist]");if(!t){u();return}f(t,F)}
4
+ export{bd,XE,Xf,j1,QE,ca,sp,eT,tT};
5
+
6
+ //# debugId=CAB26A675E8D8A2F64756E2164756E21
7
+ //# sourceMappingURL=studio-a2138x5k.js.map
@@ -0,0 +1,5 @@
1
+ function Oe(e){return e.getBoundingClientRect()}function $v(e,t,n=document){return n.elementFromPoint(e,t)}
2
+ export{Oe,$v};
3
+
4
+ //# debugId=B5F9DA301481750D64756E2164756E21
5
+ //# sourceMappingURL=studio-a9yzstqj.js.map
@@ -1,5 +1,5 @@
1
- var r=new Set(["project.schema.json","document.schema.json"]);function Dk(e){return r.has(e)?`file:///.jx/generated/${e}`:`file:///${e}`}function DI(e,s){return{head:`file:///.jx/diff/${e}/head/${s}`,work:`file:///.jx/diff/${e}/work/${s}`}}function AI(e){switch(e.slice(e.lastIndexOf(".")+1).toLowerCase()){case"cjs":case"js":case"mjs":return"javascript";case"css":return"css";case"htm":case"html":return"html";case"json":return"json";case"md":return"markdown";case"cts":case"mts":case"ts":return"typescript";case"yaml":case"yml":return"yaml";default:return"plaintext"}}
2
- export{Dk,DI,AI};
1
+ var r=new Set(["project.schema.json","document.schema.json"]);function Nk(e){return r.has(e)?`file:///.jx/generated/${e}`:`file:///${e}`}function NI(e,s){return{head:`file:///.jx/diff/${e}/head/${s}`,work:`file:///.jx/diff/${e}/work/${s}`}}function OI(e){switch(e.slice(e.lastIndexOf(".")+1).toLowerCase()){case"cjs":case"js":case"mjs":return"javascript";case"css":return"css";case"htm":case"html":return"html";case"json":return"json";case"md":return"markdown";case"cts":case"mts":case"ts":return"typescript";case"yaml":case"yml":return"yaml";default:return"plaintext"}}
2
+ export{Nk,NI,OI};
3
3
 
4
- //# debugId=E905198A61A8DA0D64756E2164756E21
5
- //# sourceMappingURL=studio-gp02nqnw.js.map
4
+ //# debugId=FABBCE4AE802E99164756E2164756E21
5
+ //# sourceMappingURL=studio-acdksxx6.js.map