@jxsuite/studio 6.1.0 → 6.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/2020-va2wwra4.js +4 -0
- package/dist/chunks/adapter-f93pafd7.js +4 -0
- package/dist/chunks/{cf-account-picker-n8hr38v7.js → cf-account-picker-af1h381v.js} +3 -3
- package/dist/chunks/cf-settings-125tdm0w.js +4 -0
- package/dist/chunks/components-ax2f1fnn.js +4 -0
- package/dist/chunks/content-source-108aqtk1.js +4 -0
- package/dist/chunks/{convert-to-repeater-7wns8kf1.js → convert-to-repeater-ry5rmppr.js} +3 -3
- package/dist/chunks/editor-pfgdmkb0.js +4 -0
- package/dist/chunks/entry-commands-t0k1q0kx.js +4 -0
- package/dist/chunks/{extension-sections-na7rj3nr.js → extension-sections-6mwh2hf8.js} +3 -3
- package/dist/chunks/file-ops-meej5mqf.js +4 -0
- package/dist/chunks/files-44vp8a2s.js +4 -0
- package/dist/chunks/format-host-7q1petb9.js +4 -0
- package/dist/chunks/fs-events-h2mwnxaz.js +4 -0
- package/dist/chunks/git-panel-zngbymvd.js +4 -0
- package/dist/chunks/{grid-view-7tt4bxw1.js → grid-view-sx9vynsp.js} +15 -15
- package/dist/chunks/icons-p44xhjf0.js +4 -0
- package/dist/chunks/iframe-host-qk3ycq87.js +4 -0
- package/dist/chunks/{index-gybvv7a6.js → index-2veqmnhr.js} +3 -3
- package/dist/chunks/index-wkyfjeqz.js +4 -0
- package/dist/chunks/{javascript-rnvdp3k4.js → javascript-8nbvs12s.js} +3 -3
- package/dist/chunks/jsonMode-s8kt9dsj.js +13 -0
- package/dist/chunks/jx-validate-psgd7vsx.js +4 -0
- package/dist/chunks/layers-panel-1kq2jyfk.js +4 -0
- package/dist/chunks/layers-xd92fg8d.js +4 -0
- package/dist/chunks/lit-html-ac4cwwr4.js +4 -0
- package/dist/chunks/media-picker-0svzkdyb.js +4 -0
- package/dist/chunks/menu-5c55ea3d.js +4 -0
- package/dist/chunks/{monaco-binding-2jnhjjvr.js → monaco-binding-z6r70pdt.js} +3 -3
- package/dist/chunks/monaco-buffer-fz6gq5y7.js +4 -0
- package/dist/chunks/monaco-setup-q4axkgj7.js +4 -0
- package/dist/chunks/notify-0xgtn8q1.js +4 -0
- package/dist/chunks/platform-v1qctbe6.js +4 -0
- package/dist/chunks/publish-panel-ym1fmgq5.js +4 -0
- package/dist/chunks/quick-search-a54e6t5n.js +4 -0
- package/dist/chunks/references-gmqp82fs.js +4 -0
- package/dist/chunks/right-panel-v7t9awbk.js +4 -0
- package/dist/chunks/section-registry-vhyf3zsr.js +4 -0
- package/dist/chunks/studio-0bhx5hz6.js +5 -0
- package/dist/chunks/studio-0k1ddnyy.js +6 -0
- package/dist/chunks/studio-1b04pd0j.js +64 -0
- package/dist/chunks/{studio-5g0ag7c0.js → studio-1q1sh2ax.js} +3 -3
- package/dist/chunks/studio-4dwbj6gb.js +5 -0
- package/dist/chunks/studio-4tanh828.js +5 -0
- package/dist/chunks/{studio-vzacdfsc.js → studio-55h4mstj.js} +3 -3
- package/dist/chunks/studio-5tnvjkz4.js +5 -0
- package/dist/chunks/{studio-rggdb3hm.js → studio-60dqgb0c.js} +4 -4
- package/dist/chunks/studio-61dp09qg.js +9 -0
- package/dist/chunks/studio-63epcrj2.js +5 -0
- package/dist/chunks/studio-74k29dy9.js +5 -0
- package/dist/chunks/{studio-qvasen3f.js → studio-7vg6jcd3.js} +4 -4
- package/dist/chunks/studio-7zx31knw.js +9 -0
- package/dist/chunks/studio-8bxk97km.js +5 -0
- package/dist/chunks/{studio-anyrgzvb.js → studio-8grwxtqk.js} +4 -4
- package/dist/chunks/studio-933e30n4.js +5 -0
- package/dist/chunks/{studio-h0xgswew.js → studio-98wnwhbg.js} +4 -4
- package/dist/chunks/studio-9mccjwjh.js +14 -0
- package/dist/chunks/studio-a2ke1e4t.js +5 -0
- package/dist/chunks/studio-e3a2a6v3.js +4 -0
- package/dist/chunks/{studio-vk9ezads.js → studio-e81q1vb9.js} +4 -4
- package/dist/chunks/{studio-z8w183sh.js → studio-epgrmqqm.js} +4 -4
- package/dist/chunks/studio-g1shz58g.js +5 -0
- package/dist/chunks/studio-gf0fz03c.js +5 -0
- package/dist/chunks/studio-gjtpe62q.js +6 -0
- package/dist/chunks/{studio-y78s8r2n.js → studio-gkskhg7m.js} +4 -4
- package/dist/chunks/studio-gx4dnjzd.js +5 -0
- package/dist/chunks/{studio-pxg4ap1e.js → studio-h46vtzk8.js} +4 -4
- package/dist/chunks/studio-j03zga3y.js +9 -0
- package/dist/chunks/{studio-ar8jcf2y.js → studio-jhpxeckz.js} +4 -4
- package/dist/chunks/{studio-w4c0xmrw.js → studio-k01r7ykp.js} +4 -4
- package/dist/chunks/{studio-cpxkgjrj.js → studio-kggey1jt.js} +4 -4
- package/dist/chunks/{studio-zxp13sss.js → studio-kk7h30ne.js} +6 -6
- package/dist/chunks/{studio-ecaz25vk.js → studio-kt1zqney.js} +4 -4
- package/dist/chunks/{studio-zygnmm01.js → studio-m3cwhvye.js} +4 -4
- package/dist/chunks/{studio-2sqcndak.js → studio-mcayt6hz.js} +4 -4
- package/dist/chunks/{studio-qqz8e5gk.js → studio-myjcghv3.js} +4 -4
- package/dist/chunks/studio-n8bxwc3y.js +4 -0
- package/dist/chunks/{studio-wfjqhhbk.js → studio-ngm8gvpb.js} +4 -4
- package/dist/chunks/{studio-zscd9ty4.js → studio-nj5a01jy.js} +196 -196
- package/dist/chunks/{studio-3bpdkq2s.js → studio-pcgz8heb.js} +4 -4
- package/dist/chunks/{studio-v2bvmbjj.js → studio-pre0skq6.js} +4 -4
- package/dist/chunks/{studio-ghkb32r8.js → studio-qcsq0t15.js} +4 -4
- package/dist/chunks/studio-qkstvve9.js +5 -0
- package/dist/chunks/studio-qv1pwd3c.js +5 -0
- package/dist/chunks/{studio-bmn4mn9j.js → studio-rc6dvxjb.js} +5 -5
- package/dist/chunks/{studio-qbj760tx.js → studio-rv11kfwa.js} +7 -7
- package/dist/chunks/studio-s8dmmz66.js +5 -0
- package/dist/chunks/studio-sp5xzbj4.js +6 -0
- package/dist/chunks/{studio-tyasmc39.js → studio-szsjbj0g.js} +4 -4
- package/dist/chunks/studio-t1xzawhr.js +16 -0
- package/dist/chunks/{studio-skprc6ef.js → studio-t6b6qe31.js} +4 -4
- package/dist/chunks/{studio-ghrhy2y7.js → studio-tdcprbqb.js} +4 -4
- package/dist/chunks/{studio-txjjzrsm.js → studio-vrmcjf9g.js} +5 -5
- package/dist/chunks/studio-vyc0b4he.js +10 -0
- package/dist/chunks/{studio-5g4t8v6w.js → studio-w0cgf6jg.js} +4 -4
- package/dist/chunks/{studio-acdksxx6.js → studio-w3hskzqk.js} +4 -4
- package/dist/chunks/{studio-0x3jyb8r.js → studio-wszjyh0j.js} +4 -4
- package/dist/chunks/studio-xgrgcdyh.js +9 -0
- package/dist/chunks/{studio-qpqa7vk3.js → studio-xz2yxfcb.js} +4 -4
- package/dist/chunks/{studio-77kt594t.js → studio-y6n42tgs.js} +4 -4
- package/dist/chunks/{studio-19x1c75w.js → studio-yb560vxr.js} +4 -4
- package/dist/chunks/{studio-wgh5kxpj.js → studio-yn9f8vtx.js} +4 -4
- package/dist/chunks/{studio-a2138x5k.js → studio-yw05w8f0.js} +5 -5
- package/dist/chunks/{studio-h9c4p2tx.js → studio-z16sgavc.js} +4 -4
- package/dist/chunks/studio-zey7zsdw.js +12 -0
- package/dist/chunks/{studio-g7nse7zb.js → studio-zyqn40w4.js} +4 -4
- package/dist/chunks/tsMode-2frah6h1.js +14 -0
- package/dist/chunks/workspace-zt81g1ms.js +4 -0
- package/dist/chunks/ws-client-n2bh4hkf.js +4 -0
- package/dist/iframe-entry.js +13 -13
- package/dist/manifest.json +62 -62
- package/dist/studio.js +77 -77
- package/dist/workers/ts.worker.js +3 -3
- package/package.json +10 -10
- package/src/canvas/canvas-render.ts +4 -1
- package/src/canvas/canvas-utils.ts +73 -15
- package/src/canvas/iframe-host.ts +67 -21
- package/src/canvas/iframe-inline-edit.ts +22 -4
- package/src/canvas/iframe-interaction.ts +7 -1
- package/src/canvas/iframe-protocol.ts +3 -0
- package/src/canvas/iframe-render.ts +5 -2
- package/src/commands/defaults.ts +4 -1
- package/src/commands/live-context.ts +3 -1
- package/src/editor/shortcuts.ts +55 -27
- package/src/files/media-paths.ts +3 -1
- package/src/panels/editors.ts +3 -1
- package/src/panels/style-panel.ts +36 -11
- package/src/platforms/devserver.ts +47 -12
- package/src/studio.ts +14 -2
- package/src/surfaces/library-pane.ts +6 -0
- package/src/surfaces/rail.json +126 -73
- package/src/surfaces/rail.ts +31 -5
- package/src/tabs/typing.ts +31 -0
- package/src/utils/edit-display.ts +30 -1
- package/src/workspace/workspace.ts +7 -0
- package/dist/chunks/2020-nkxms0ay.js +0 -4
- package/dist/chunks/adapter-m948ab5f.js +0 -4
- package/dist/chunks/cf-settings-356xdtne.js +0 -4
- package/dist/chunks/components-yk3t844e.js +0 -4
- package/dist/chunks/content-source-bawmyc09.js +0 -4
- package/dist/chunks/editor-6sc8nacq.js +0 -4
- package/dist/chunks/entry-commands-8ay9fh81.js +0 -4
- package/dist/chunks/file-ops-gye0qw56.js +0 -4
- package/dist/chunks/files-dmc2xvcq.js +0 -4
- package/dist/chunks/format-host-t76b53f8.js +0 -4
- package/dist/chunks/fs-events-cg4tpz06.js +0 -4
- package/dist/chunks/git-panel-yef7bshy.js +0 -4
- package/dist/chunks/icons-qbh8akb1.js +0 -4
- package/dist/chunks/iframe-host-tmz30gfp.js +0 -4
- package/dist/chunks/index-nag78a9h.js +0 -4
- package/dist/chunks/jsonMode-zhwsprqk.js +0 -13
- package/dist/chunks/jx-validate-3gbp5nkn.js +0 -4
- package/dist/chunks/layers-fvz99859.js +0 -4
- package/dist/chunks/layers-panel-gchmbf9p.js +0 -4
- package/dist/chunks/lit-html-9agdspkt.js +0 -4
- package/dist/chunks/media-picker-rhjvyy00.js +0 -4
- package/dist/chunks/menu-2e4y9j7b.js +0 -4
- package/dist/chunks/monaco-buffer-rp21359g.js +0 -4
- package/dist/chunks/monaco-setup-vhh7gayr.js +0 -4
- package/dist/chunks/notify-h3www560.js +0 -4
- package/dist/chunks/platform-hz34wcd7.js +0 -4
- package/dist/chunks/publish-panel-exsmjzyj.js +0 -4
- package/dist/chunks/quick-search-pgaqeh0m.js +0 -4
- package/dist/chunks/references-2cgdxnb8.js +0 -4
- package/dist/chunks/right-panel-jf856w5w.js +0 -4
- package/dist/chunks/section-registry-jnf8r5gy.js +0 -4
- package/dist/chunks/studio-0f55h9ye.js +0 -5
- package/dist/chunks/studio-0sqdhnew.js +0 -12
- package/dist/chunks/studio-3aey7dd3.js +0 -5
- package/dist/chunks/studio-47y6fbpf.js +0 -5
- package/dist/chunks/studio-4m3826v2.js +0 -5
- package/dist/chunks/studio-4nx2dj1g.js +0 -4
- package/dist/chunks/studio-4xv5s47r.js +0 -9
- package/dist/chunks/studio-5py436sf.js +0 -5
- package/dist/chunks/studio-8f87n763.js +0 -10
- package/dist/chunks/studio-8mb00b84.js +0 -5
- package/dist/chunks/studio-8p51gq2h.js +0 -6
- package/dist/chunks/studio-954ds834.js +0 -5
- package/dist/chunks/studio-9ft45c83.js +0 -9
- package/dist/chunks/studio-a9yzstqj.js +0 -5
- package/dist/chunks/studio-e7xxa0sj.js +0 -5
- package/dist/chunks/studio-fzdywr6p.js +0 -9
- package/dist/chunks/studio-g5fmf0c1.js +0 -5
- package/dist/chunks/studio-geq1ea6k.js +0 -14
- package/dist/chunks/studio-grawhey1.js +0 -5
- package/dist/chunks/studio-jyzj5cxs.js +0 -5
- package/dist/chunks/studio-mgx8yhnz.js +0 -64
- package/dist/chunks/studio-mpb04y1d.js +0 -6
- package/dist/chunks/studio-n17mty64.js +0 -5
- package/dist/chunks/studio-nwh2eqsk.js +0 -6
- package/dist/chunks/studio-q1h883bt.js +0 -16
- package/dist/chunks/studio-q4tv82h7.js +0 -9
- package/dist/chunks/studio-sghy936h.js +0 -4
- package/dist/chunks/studio-tt2nactf.js +0 -5
- package/dist/chunks/studio-xasj0796.js +0 -5
- package/dist/chunks/tsMode-gr0m4dzr.js +0 -14
- package/dist/chunks/workspace-m15qtcqp.js +0 -4
- package/dist/chunks/ws-client-nf61frr1.js +0 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{tt}from"./studio-5g0ag7c0.js";import{te}from"./studio-ery42sqr.js";import{fk,p,We}from"./studio-qpqa7vk3.js";import{Zt}from"./studio-tt2nactf.js";import{ge,Q,v,Mo,k}from"./studio-vzacdfsc.js";import{xn,YC,m,u,No,ci}from"./studio-3aey7dd3.js";import{Gi,pm,hp,Rd,zu}from"./studio-4m3826v2.js";import{un,rn}from"./studio-geq1ea6k.js";import{y}from"./studio-q1h883bt.js";import{rt,Zi,zt,T,R,An,Ct,Xo,Nn,vk}from"./studio-e7xxa0sj.js";import{qn}from"./studio-bmn4mn9j.js";import{kw}from"./studio-txjjzrsm.js";import{aa,KE,la,YE,kb,ZE}from"./studio-9ft45c83.js";import{cC,dC,cm}from"./studio-47y6fbpf.js";import{vE}from"./studio-5py436sf.js";import{ab,wE,lb,b1}from"./studio-954ds834.js";import{sI,D,cI,Oo}from"./studio-wgh5kxpj.js";import{Oe}from"./studio-a9yzstqj.js";import{me}from"./studio-v2bvmbjj.js";var Y={$schema:"https://jxsuite.com/schema/v1",$id:"StudioMediaPane",$description:"The Media viewer: a pane that SHOWS a file the studio has no document model for — an image at its own size, a video or audio player, an embedded PDF, a font set in a pangram, or an honest line about a format nothing here can draw. The adapter hands in one projection: which of the six stages to draw, the URL that loads it, the file's name and facts, the reference a document would write for it, and the documents that already do. Nothing here decides anything; a control asks the host to copy, to open a path, or to record the pixel size the browser just learned.",tagName:"div",attributes:{part:"viewer","data-jx-region":"${state.region}"},style:{$description:"What `.media-viewer`, `.media-stage`, `.media-image`, `.media-video`, `.media-embed`, `.media-audio`, `.media-specimen`, `.media-specimen-line`, `.media-unviewable`, `.media-note`, `.media-details`, `.media-name`, `.media-facts`, `.media-ref`, `.media-ref-value`, `.media-usage`, `.media-usage-title`, `.media-usage-headline`, `.media-usage-list`, `.media-usage-link` and `.media-usage-count` said in `styles/overlays.css`, keyed on `part` and re-pointed at the studio token layer. All twenty-two were this surface's alone, so the stylesheet block goes with the conversion rather than being copied. Eight `var(--spectrum-font-size-…)` names could not come with the declarations: every one of them resolves only inside `<sp-theme>`, and this document is mounted in a pane stage that is outside it, so each would silently have taken its hex fallback — they are the kit's `--jx-text-xs`, `--jx-text-sm`, `--jx-text-md` and `--jx-text-lg` instead.",height:"100%",display:"flex",gap:"var(--jx-space-5)",padding:"var(--jx-space-5)",overflowY:"auto",background:"var(--bg-panel)",fontFamily:"var(--jx-font-sans)",color:"var(--fg)",'& [part="asset-slot"], & [part="usage-slot"], & [part="list-slot"]':{$description:"A `$switch` renders its own container, and none of these three is a box: each stands exactly where its case does, so the case's own rule is the only one that lays anything out.",display:"contents"},'& [part="stage"]':{$description:"The asset takes the room and the details column keeps a fixed width, so the file is the thing being looked at and the facts about it are beside it rather than on top of it.",flex:"1",minWidth:"0",display:"flex",alignItems:"flex-start",justifyContent:"center"},'& [part="image"]':{$description:"Never larger than its own pixels: an upscaled thumbnail is a lie about the asset, and judging whether an imported image is big enough is the whole reason somebody opens this.",maxWidth:"100%",height:"auto",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"var(--bg-input)"},'& [part="video"], & [part="embed"]':{width:"100%",maxHeight:"70vh",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"var(--bg-input)"},'& [part="audio"]':{width:"100%"},'& [part="specimen"]':{$description:"A font is shown by being USED. The face itself arrives as a `@font-face` the adapter writes, under a family name generated from the path so two specimens open side by side cannot claim the same one; the element carries only that NAME, as a custom property, and the fallback stack that catches a face the browser refuses stays here where it is a rule rather than data.",width:"100%",padding:"var(--jx-space-5)",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"var(--bg-input)",color:"var(--fg)",fontFamily:"var(--jx-specimen-family, system-ui), system-ui, sans-serif"},'& [part="specimen-line"]':{margin:"0 0 var(--jx-space-4)",lineHeight:"1.3",overflowWrap:"anywhere"},'& [part="specimen-line"][data-size="48"]':{fontSize:"48px"},'& [part="specimen-line"][data-size="32"]':{fontSize:"32px"},'& [part="specimen-line"][data-size="24"]':{fontSize:"24px"},'& [part="specimen-line"][data-size="18"]':{fontSize:"18px"},'& [part="specimen-line"][data-size="14"]':{fontSize:"var(--jx-text-lg)"},'& [part="unviewable"]':{$description:"Not a failure state. A file the browser cannot render is a zip, or a format this build has never heard of, so the box says what the file IS and that the project still builds with it in.",padding:"var(--jx-space-6)",border:"1px dashed var(--border)",borderRadius:"var(--radius)",color:"var(--fg-dim)",textAlign:"center"},'& [part="note"]':{fontSize:"var(--jx-text-md)",color:"var(--fg-dim)"},'& [part="details"]':{flex:"0 0 260px",display:"flex",flexDirection:"column",gap:"var(--jx-space-4)"},'& [part="title"]':{margin:"0",fontSize:"var(--jx-text-lg)",color:"var(--fg)",overflowWrap:"anywhere"},'& [part="facts"]':{$description:'Kind, pixel size, bytes and modified date, joined by the adapter. Each is omitted rather than zeroed when it is not known: a real file can almost be `0 × 0` or `0 B`, so neither may double as "we did not find out".',margin:"0",fontSize:"var(--jx-text-md)",color:"var(--fg-dim)"},'& [part="ref"]':{$description:"The reference a document writes for this file — `/hero.jpg` for `public/hero.jpg`, which shares not one segment with it. Getting this wrong is the commonest way an image goes missing from a page, which is why it is on screen next to a button that copies it.",display:"flex",alignItems:"center",gap:"6px"},'& [part="ref-value"]':{flex:"1",minWidth:"0",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-sm)",background:"var(--bg-input)",border:"1px solid var(--border)",borderRadius:"var(--radius)",padding:"3px 6px",overflowWrap:"anywhere"},'& [part="usage"]':{display:"flex",flexDirection:"column"},'& [part="group-title"]':{margin:"0 0 var(--jx-space-2)",fontSize:"var(--jx-text-md)",fontWeight:"500",color:"var(--fg-dim)"},'& [part="message"]':{margin:"0",fontSize:"var(--jx-text-md)",color:"var(--fg-dim)"},'& [part="list"]':{listStyle:"none",margin:"var(--jx-space-3) 0 0",padding:"0",display:"flex",flexDirection:"column",gap:"var(--jx-space-1)"},'& [part="row"]':{display:"flex",alignItems:"baseline",gap:"6px",fontSize:"var(--jx-text-md)"},'& [part="file-path"]':{$description:'The path is a control, not a label: it opens the document that references this file. A plain button rather than a `jx-button`, for the reason the Problems rows give — what it has to look like is a line of text, and every fill, border and control height the kit draws would have to be taken back off again. Named `file-path` and not `path` because `jx-icon` puts `part="path"` on the `<path>` of every glyph it draws, so `[part="path"]` would select this button and any SVG path beside it.',flex:"1",minWidth:"0",margin:"0",padding:"0",background:"none",border:"none",borderRadius:"var(--jx-radius-xs)",textAlign:"left",color:"var(--accent)",cursor:"pointer",font:"inherit",overflowWrap:"anywhere",":hover":{textDecoration:"underline"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"2px"}},'& [part="count"]':{flex:"0 0 auto",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-xs)",color:"var(--fg-dim)"}},children:[{tagName:"div",attributes:{part:"stage"},children:[{tagName:"div",attributes:{part:"asset-slot",role:"none"},$switch:{$ref:"#/state/kind"},cases:{image:{tagName:"img",attributes:{part:"image",src:"${state.src}",alt:""},onload:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/imageLoaded"},value:[{$ref:"event#/target/naturalWidth"},{$ref:"event#/target/naturalHeight"}]}],description:"The only honest source of pixel dimensions in a browser is an image that has loaded, and this viewer is showing one at full size anyway. The host decides whether the numbers are new; a repeat load of the same picture must not repaint the pane."}},video:{tagName:"video",attributes:{part:"video",src:"${state.src}",controls:!0}},audio:{tagName:"audio",attributes:{part:"audio",src:"${state.src}",controls:!0}},embed:{tagName:"embed",attributes:{part:"embed",src:"${state.src}",type:"application/pdf",title:"${state.name}"}},font:{tagName:"div",attributes:{part:"specimen",style:"${state.specimenFamily}"},children:[{tagName:"style",textContent:"${state.fontFace}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"48"},textContent:"${state.specimen}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"32"},textContent:"${state.specimen}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"24"},textContent:"${state.specimen}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"18"},textContent:"${state.specimen}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"14"},textContent:"${state.specimen}"}]},unviewable:{tagName:"div",attributes:{part:"unviewable"},children:[{tagName:"p",children:[{tagName:"span",textContent:"Jx has no viewer for "},{tagName:"code",textContent:"${state.extLabel}"},{tagName:"span",textContent:"."}]},{tagName:"p",attributes:{part:"note"},textContent:"The file is in the project and builds normally."}]}}}]},{tagName:"div",attributes:{part:"details"},children:[{tagName:"h3",attributes:{part:"title"},textContent:"${state.name}"},{tagName:"p",attributes:{part:"facts"},textContent:"${state.facts}"},{tagName:"div",attributes:{part:"ref"},children:[{tagName:"code",attributes:{part:"ref-value"},textContent:"${state.ref}"},{tagName:"jx-action-button",$props:{size:"sm",quiet:!0,hint:"Copy the reference"},attributes:{part:"copy"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/copyRef"}}]},children:[{tagName:"span",textContent:"Copy"}]}]},{tagName:"div",attributes:{part:"usage-slot",role:"none"},$switch:{$ref:"#/state/usageState"},cases:{shown:{tagName:"div",attributes:{part:"usage"},children:[{tagName:"h4",attributes:{part:"group-title"},textContent:"Used by"},{tagName:"p",attributes:{part:"message"},textContent:"${state.usageHeadline}"},{tagName:"div",attributes:{part:"list-slot",role:"none"},$switch:{$ref:"#/state/hasUsageFiles"},cases:{true:{tagName:"ul",attributes:{part:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/usageFiles"},key:{$ref:"$map/item/path"},map:{tagName:"li",attributes:{part:"row","data-usage":"${$map.item.path}"},children:[{tagName:"button",attributes:{part:"file-path",type:"button"},textContent:"${$map.item.path}",onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openDocument"},value:[{$ref:"$map/item/path"}]}]}},{tagName:"span",attributes:{part:"count"},textContent:"${$map.item.count}"}]}}]}}}]}}}]}]};T("media-pane",Y);function et(t,e){t.region=e.region,t.name=e.name,t.kind=e.kind,t.src=e.src,t.facts=e.facts,t.ref=e.ref,t.specimen=e.specimen,t.specimenFamily=e.specimenFamily,t.fontFace=e.fontFace,t.extLabel=e.extLabel,t.usageState=e.usageState,t.usageHeadline=e.usageHeadline,t.usageFiles=e.usageFiles,t.hasUsageFiles=e.usageFiles.length>0}function at(t,e,a){t.replaceChildren();let r=v({copyRef:a.copyRef,extLabel:"",facts:"",fontFace:"",hasUsageFiles:!1,imageLoaded:a.imageLoaded,kind:"unviewable",name:"",openDocument:a.openDocument,ref:"",region:"",specimen:"",specimenFamily:"",src:"",usageFiles:[],usageHeadline:"",usageState:"hidden"});et(r,e);let i=null,o=!1,n=R("media-pane",r,t).then((s)=>{if(o)return s.dispose(),s.root;return i=s,s.root});return{attached:()=>{if(o)return!1;let s=i?.root;return s===void 0?!0:s instanceof HTMLElement&&t.contains(s)},dispose(){o=!0,i?.dispose(),i=null},ready:n,update:(s)=>et(r,s)}}var z="media",Ht=new Set([".woff",".woff2",".ttf",".otf"]),Ot="The quick brown fox jumps over the lazy dog",A=new Map;function H(t){return A.get(t)??null}function l1(t,e){let a=H(t);return a!==null&&a.tabId===e.id&&a.wrap.isConnected&&a.surface.attached()}function sb(t){let e=A.get(t);if(!e)return;e.scope.stop(),e.surface.dispose(),A.delete(t)}function Vt(t){let e=Gi(t);if(Ht.has(e))return"font";let a=hp({name:t});if(a==="image"||a==="video"||a==="audio")return a;return e===".pdf"?"embed":"unviewable"}function _t(t,e){let a=[hp({name:t})];if(e?.width!=null&&e.height!=null)a.push(`${e.width} × ${e.height}`);if(e?.bytes!=null)a.push(b1(e.bytes));if(e?.modified)a.push(`modified ${e.modified.slice(0,10)}`);return a.join(" · ")}function Jt(t){return`jx-specimen-${t.replaceAll(/[^a-zA-Z0-9]/g,"-")}`}function Wt(t){let e=ZE(t);if(e===null)return{usageFiles:[],usageHeadline:"",usageState:"hidden"};return{usageFiles:(t?.status==="ready"?t.result.files:[]).map((r)=>({count:String(r.count),path:r.path})),usageHeadline:e,usageState:"shown"}}async function Bt(t){let{openFileInTab:e}=await (me("dmc2xvcq"),import("./files-dmc2xvcq.js"));await e(t)}function mE(t,e){let{paneId:a,wrap:r}=t;if(l1(a,e))return;sb(a);let i=e.documentPath??"",o=Jt(i),n=zu(i),s=Rd(i),l=Gi(i),c=Vt(i),h=null,g=()=>{if(h!==null&&H(a)===h)f()},x=()=>{let j=ab(i),d=YE(i);if(j===null)wE(i).then(g);if(d===null||d.status==="pending")kb(i).then(g);return{extLabel:l||"this file",facts:_t(i,j),fontFace:c==="font"?`@font-face { font-family: "${o}"; src: url("${n}"); }`:"",kind:c,name:i.split("/").pop()??"",ref:s,region:Zi(a,"media"),specimen:Ot,specimenFamily:`--jx-specimen-family: "${o}"`,src:n,...Wt(d)}},f=()=>{h?.surface.update(x())},S=ge(),N=at(r,x(),{copyRef:()=>{navigator.clipboard?.writeText(s)},imageLoaded:(j,d)=>{if(lb(i,j,d))g()},openDocument:(j)=>{Bt(j)}});h={paneId:a,scope:S,surface:N,tabId:e.id,wrap:r},A.set(a,h),S.run(()=>{Q(()=>{if(H(a)!==h)return;e.documentPath,f()})})}var qt={children:[],tagName:"div"};function xw(t){return pm(t)}function Kt(t){return Gi(t)===".svg"?[z,"source"]:[z]}function gE(t,e={}){let a=m.tabs.get(t);if(a)return ci(t,{focus:e.focus!==!1}),a;return No({capabilities:{modes:Kt(t)},document:structuredClone(qt),documentPath:t,id:t,sourceFormat:null,...e.paneId!==void 0&&{paneId:e.paneId},...e.preview===!0&&{preview:!0},...e.focus===!1&&{focus:!1}})}var Xt={children:[],tagName:"div"},Yt=new Set(["bunfig.json","jsconfig.json","package-lock.json","package.json","tsconfig.json","wrangler.json"]);function Bf(t){let e=t.slice(t.lastIndexOf("/")+1);if(Yt.has(e)||e.endsWith(".schema.json"))return!1;return t.endsWith(".json")||Boolean(Zt(t))}function it(t,e){if(t.startsWith("../")||t.includes("/../"))return`"${t}" is outside this project, so its comparison belongs to the project that owns it.`;if(e==="R")return"A renamed file's comparison needs both paths, and Studio does not model the old name yet.";if(xw(t))return`"${t}" is an image or media file, and a comparison of one is not text.`;return null}function Qt(){return["git-diff"]}function ee(t){let e=m.tabs.get(t);if(e)return ci(t),e;return No({capabilities:{modes:Qt()},document:structuredClone(Xt),documentPath:t,id:t,sourceFormat:null})}async function ot(t){if(!Bf(t))return ee(t);let e=await (me("dmc2xvcq"),import("./files-dmc2xvcq.js"));return await e.openFileInTab(t,{})??[...m.tabs.values()].find((r)=>r.documentPath===t)??null}var nt={$schema:"https://jxsuite.com/schema/v1",$id:"StudioGithubPublish",$description:"Create GitHub Repository: the three things the flow needs before it calls the API — the repository's name, an optional description, and whether it is private. A `jx-dialog`, so the platform owns modality, Escape, focus restoration and the backdrop, and the kit draws both answer buttons. Nothing here reaches GitHub: `github/github-publish.ts` keeps the token, the request and the activity, and this document only collects.",tagName:"jx-dialog",$props:{headline:"Create GitHub Repository",confirmLabel:"Create Repository",cancelLabel:"Cancel",size:"sm"},attributes:{part:"github-publish"},onconfirm:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/confirm"},value:[]}]},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/cancel"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},style:{$description:'What is NOT here is most of the conversion. `.github-publish-dialog` was a flex column with an 8px gap and `8px 0` of padding: the gap is the one thing it said that nothing else draws, and `jx-dialog`\'s own body already pads the content, so only the gap survives. `.github-publish-dialog sp-textfield { width: 100% }` had nothing to transcribe either — a `jx-field` row is a grid whose control cell stretches, so the field fills the row without being told to. The three `sp-field-label`s are gone with them, because `jx-field` draws the label AND names the control from it; the third of them carried no `for` at all, so "Visibility" was text beside a switch rather than a name for it.','& [part="rows"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)"}},children:[{tagName:"div",attributes:{part:"rows"},children:[{tagName:"jx-field",$props:{span:!0,label:"Repository name"},attributes:{part:"row","data-field":"name"},children:[{tagName:"jx-textfield",$props:{placeholder:"my-project",value:{$ref:"#/state/name"}},attributes:{part:"field"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setName"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"Description (optional)"},attributes:{part:"row","data-field":"description"},children:[{tagName:"jx-textfield",$props:{placeholder:"A brief description",value:{$ref:"#/state/description"}},attributes:{part:"field"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setDescription"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"Visibility"},attributes:{part:"row","data-field":"visibility"},children:[{tagName:"div",$description:'The row opens with a plain `div`, and that is the whole reason it exists: `jx-field` names the first thing slotted into it that observes `labelledby`, so a switch slotted straight in would be announced "Visibility" over the top of the words printed beside it. A `div` observes no naming, so the switch keeps the name its own label gives it.',attributes:{part:"visibility-row"},children:[{tagName:"jx-switch",attributes:{part:"toggle"},$props:{checked:{$ref:"#/state/isPrivate"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setPrivate"},value:[{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Private repository"}]}]}]}]}]};T("github-publish",nt);function st(t){let e=document.createElement("div");e.style.pointerEvents="auto",e.setAttribute(rt,zt("dialog","github-publish")),t.layer.append(e);let a=!1,r=()=>{if(a)return;a=!0,t.onClosed()},i=v({cancel:()=>{t.onCancel()},closed:r,confirm:()=>{t.onConfirm({description:i.description,isPrivate:i.isPrivate,name:i.name})},description:"",isPrivate:!0,name:t.name,setDescription:(l)=>{i.description=l},setName:(l)=>{i.name=l},setPrivate:(l)=>{i.isPrivate=l}}),o=null,n=R("github-publish",i,e).then(async(l)=>{o=l;let c=l.root;if(a)return l.dispose(),c;if(await An(c),a)return c;return un(c),c});return{close(){if(a)return;let l=o?.root;if(l instanceof HTMLElement)rn(l);o?.dispose(),o=null,e.remove(),r()},host:e,ready:n}}var M=["Create the repository","Add the remote","Push"];function re(t){return new Promise((e)=>{let a=!1,r=(o)=>{if(a)return;a=!0,e(o)},i=st({layer:Ct("dialog"),name:t,onCancel:()=>{i.close()},onClosed:()=>{r(null)},onConfirm:(o)=>{r({...o,name:o.name||t}),i.close()}})})}async function O({projectName:t}){let e=await kw();if(!e)return!1;let a=await re(t);if(!a)return!1;let r=aa({source:"Source Control",status:`Creating ${a.name}…`,steps:[...M],title:"Create GitHub repository"});r.step(M[0]);let i=await fetch("https://api.github.com/user/repos",{body:JSON.stringify({auto_init:!1,description:a.description,name:a.name,private:a.isPrivate}),headers:{Accept:"application/vnd.github+json",Authorization:`Bearer ${e}`,"Content-Type":"application/json"},method:"POST"}).catch((l)=>(r.log(te(l)),null));if(!i)return r.fail("Could not reach GitHub to create the repository.",{action:"git.createGithubRepository"}),!1;if(!i.ok){let l=await i.json();return r.log(l.errors?.[0]?.message||l.message||`GitHub answered ${i.status}.`),r.fail("Could not create the GitHub repository.",{action:"git.createGithubRepository"}),!1}let o=await i.json();r.log(`Created ${o.html_url}`);let n=p();r.step(M[1]);try{await n.gitAddRemote("origin",o.clone_url)}catch(l){return r.log(te(l)),r.fail("The repository was created, but the remote could not be added.",{action:"panel.focus.git"}),!1}r.step(M[2]);try{await n.gitPush({setUpstream:!0})}catch(l){return r.log(te(l)),r.fail("The repository was created, but the push failed.",{action:"git.push"}),!1}let{refreshGitStatus:s}=await (me("yef7bshy"),import("./git-panel-yef7bshy.js"));return await s(),r.done(o.html_url),k.success(`Repository created: ${o.html_url}`,{key:"github.repo"}),!0}var P=[];function ie(){return We()&&typeof p().listProjects==="function"}async function yw(){if(!ie()){P=[];return}try{P=await p().listProjects?.()??[]}catch{P=[]}}function pE(){return P}function lt(t){P=t}var ct=2,oe=1e4;class pt extends Error{blockedBy;constructor(t,e){super(t.length===0?`Studio did not report ${ct} consecutive quiet frames within ${e}ms`:`Studio was not idle after ${e}ms — blocked by ${t.join("; ")}`);this.name="NotIdleError",this.blockedBy=t}}function dt(){return[{blockers:()=>{let t=cI();return t>0?[`render: ${t} renderer(s) mid-paint`]:[]},name:"render"},{blockers:cC,name:"canvas"},{blockers:()=>{let t=fk();if(t.length===0)return[];return[`platform: ${t.length} in-flight (${[...new Set(t)].join(", ")})`]},name:"platform"},{blockers:vk,name:"overlay"},{blockers:KE,name:"activity"},{blockers:vE,name:"grid"}]}function ne(t=dt()){let e=[];for(let a of t)e.push(...a.blockers());return e}function ut(t={}){let{frames:e=ct,now:a=()=>Date.now(),raf:r=(n)=>{requestAnimationFrame(()=>n())},sources:i=dt(),timeoutMs:o=oe}=t;return new Promise((n,s)=>{let l=a()+o,c=0,h=!1,g=[],x=()=>{if(h)return;let f=ne(i);if(f.length>0)g=f,c=0;else if(c+=1,c>=e){h=!0,n();return}if(a()>=l){h=!0,s(new pt(f.length>0?f:g,o));return}r(x)};r(x)})}var mt=/\.toggle[A-Z]/;function se(t){return t.replace(/\.toggle([A-Z])/,(e,a)=>`.set${a}`)}function ht(t){return!mt.test(t.id)}var le={"file.contextMenu":{disposition:"refused",note:"opening a menu to press an item names a control; the ITEM is the command"},"layers.contextMenu":{disposition:"refused",note:"matched RENDERED TEXT, which R1 of scripts/screenshots/README.md forbids; a row is addressed by its data-jx-path"},"media.browse":{disposition:"command",note:"media.browse, site-architecture.md §9.4"},"project.showWelcome":{disposition:"refused",note:"cold start is a startup profile (?profile=fresh), not an action"},"settings.setSection":{disposition:"refused",note:`mirrored the section registry's LABELS; say settings.open { section: "cssVars" }`},"view.setStatus":{disposition:"refused",note:"the status bar is not staged — if a capture needs a calm shell, the app must BE calm"}},ce={openSettings:'a user opens Settings — run("settings.open")',select:'a user selects a node — run("selection.set", { path })',setActivity:'a user picks a Navigator panel — run("navigator.showPanel", { panel })',setRightTab:'a user picks an Inspector tab — run("inspector.setTab", { tab })',setStatus:"the status bar reports what the app just did; staging it is the one lie the Remote Rule (studio.md §13.5) names outright",setZoom:'a user zooms — run("canvas.setZoom", { zoom })'};function V(t,e){let a=t[e];if(a===void 0)return[];if(!Array.isArray(a))throw TypeError(`seed argument "${e}" must be an array`);return a}function pe(t,e){let a=t[e];if(a===null||typeof a!=="object")throw TypeError(`seed argument "${e}" must be an object`);return a}function de(t,e){let a=t[e];if(a===void 0)return;if(typeof a!=="string")throw TypeError(`seed argument "${e}" must be a string`);return a}function ue(t){return[{boundary:"the assistant's model stream",id:"seed.assistant",run:(e)=>{t.seedAssistantMessages(V(e,"messages"))}},{boundary:"the collaboration websocket (awareness + sync)",id:"seed.collab",run:(e)=>{let a=u.value;if(!a)return;let r=xn(a);r.status="synced",r.active=!0;let i=[];for(let o of V(e,"peers")){let n={...o.state};n.focusedPath??=a.documentPath,i.push({...o,state:n})}r.peers=i,Oo()}},{boundary:"the Cloudflare Pages API",id:"seed.publish",run:(e)=>{let a=de(e,"accountId");t.seedPublishConnected({deployment:pe(e,"deployment"),...a?{accountId:a}:{}})}},{boundary:"the platform's git routes (`gitStatus` / `gitBranches` / `gitLog`)",id:"seed.git",run:(e)=>{y.git.status=e.status??null,y.git.branches=e.branches??null,y.git.logEntries=e.log??null,y.git.loading=!1,y.git.error=null,Oo()}},{boundary:"the platform's recent-projects store (desktop IPC / cloud API)",id:"seed.projectList",run:(e)=>{lt(V(e,"projects")),Oo()}}]}class _ extends Error{id;constructor(t,e){super(`automation refuses "${t}" — ${e}`);this.name="AutomationRefusedError",this.id=t}}function he(t){let e=[];for(let a of t.visible()){if(!ht(a))continue;let r=t.disabledReason(a.id),i={enabled:r===void 0,id:a.id,title:a.title};if(a.args)i.args=a.args;if(r!==void 0)i.requires=r;e.push(i)}return e}function fe(t,e,a){if(a.has(t))return`"${t}" is a seed, not a command — call seed("${t}", …)`;let r=le[t];if(r?.disposition==="refused")return`"${t}" is refused by spec §13.5: ${r.note}`;if(r)return`"${t}" has no command record yet (${r.note}) — __jxAutomation.run projects the registry and nothing else`;let i=e.list().filter((o)=>ht(o)).map((o)=>o.id);return`unknown command "${t}" — the registry declares ${i.length} scriptable id(s)`}function be(t){let e=new Map(ue(t).map((r)=>[r.id,r])),a=new Set(e.keys());return{probe:{commands:()=>he(t.registry),idle:(r={})=>ut(r),pointAt:(r)=>dC(r.path),revealPath:(r)=>cm(r),seeds:()=>[...e.values()].map((r)=>({boundary:r.boundary,id:r.id})),state:()=>t.registry.context()},async run(r,i={}){if(mt.test(r))throw new _(r,`it names a delta against state the caller cannot observe; call "${se(r)}"`);let{registry:o}=t;if(!o.get(r))throw Error(fe(r,o,a));await o.run(r,i)},async seed(r,i={}){let o=r.startsWith("seed.")?r.slice(5):r,n=ce[o];if(n)throw new _(r,`a seed stands in for a remote, never for a user: ${n}`);let s=e.get(r.startsWith("seed.")?r:`seed.${r}`);if(!s)throw Error(`unknown seed "${r}" — declared seeds are ${[...e.keys()].join(", ")}`);await s.run(i)}}}function ob(t){return new URLSearchParams(t).get("automation")==="1"}function fE(t){if(!ob(location.search))return!1;return globalThis.__jxAutomation=be(t),!0}var gt={$schema:"https://jxsuite.com/schema/v1",$id:"StudioJxsuiteUpdate",$description:"The on-open offer to bring a project's `@jxsuite/*` dependencies up to their newest published versions: one sentence, and the packages that would move. A `jx-dialog`, so the platform owns modality, Escape, focus restoration and the backdrop, and the kit draws both answers. Nothing here asks the registry or writes a manifest: `packages/jxsuite-update.ts` keeps the lookup, the dismissal key and the install, and this document only says what is on offer.",tagName:"jx-dialog",$props:{headline:"Update @jxsuite packages?",confirmLabel:"Update",cancelLabel:"Not now",size:"sm"},attributes:{part:"jxsuite-update"},onconfirm:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/confirm"},value:[]}]},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/cancel"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},style:{$description:'The old body was a lit template with no stylesheet at all, which is why the conversion is mostly a deletion. Two `<br />`s stood in for a paragraph break, and one `<span style="white-space: pre-line">` held every package as a single `\\n`-joined string — a list spelled as whitespace. Neither is addressable and neither announces as what it is, so a screen reader read one run-on line and a test could only match a substring of it. It is a `<ul>` of keyed rows now: the list says how many packages there are, and each row is `[data-package]`. The one token repair travels with it — that span asked for `--spectrum-font-size-75`, which resolves only inside `<sp-theme>`, and a document mounted in the dialog layer is outside it, so the size silently fell back to the hard-coded `12px` written beside it.','& [part="offer"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)"},'& [part="lede"]':{margin:"0"},'& [part="list"]':{$description:"Capped and scrolling, because the count is the registry's rather than this dialog's: a project that has not been opened in a year can have every `@jxsuite/*` package behind at once, and a dialog that grows past the viewport puts its own Update button off screen.",listStyle:"none",margin:"0",padding:"0",display:"flex",flexDirection:"column",gap:"var(--jx-space-1)",maxHeight:"240px",overflowY:"auto"},'& [part="package"]':{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:"var(--jx-space-3)",fontSize:"var(--jx-text-sm)"},'& [part="package-name"]':{color:"var(--fg)"},'& [part="package-move"]':{$description:"Tabular figures, so a column of versions does not jitter between rows of different widths.",color:"var(--fg-dim)",fontVariantNumeric:"tabular-nums",whiteSpace:"nowrap"}},children:[{tagName:"div",attributes:{part:"offer"},children:[{tagName:"p",attributes:{part:"lede"},textContent:"Newer versions of these packages have been published. Update the project to them?"},{tagName:"ul",attributes:{part:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/packages"},key:{$ref:"$map/item/name"},map:{tagName:"li",attributes:{part:"package","data-package":"${$map.item.name}"},children:[{tagName:"span",attributes:{part:"package-name"},textContent:"${$map.item.name}"},{tagName:"span",attributes:{part:"package-move"},textContent:"${$map.item.current} → ${$map.item.target}"}]}}]}]}]};T("jxsuite-update",gt);function ft(t){let e=document.createElement("div");e.style.pointerEvents="auto",e.setAttribute(rt,zt("dialog","jxsuite-update")),t.layer.append(e);let a=!1,r=()=>{if(a)return;a=!0,t.onClosed()},i=v({cancel:()=>{t.onCancel()},closed:r,confirm:()=>{t.onConfirm()},packages:t.packages}),o=null,n=R("jxsuite-update",i,e).then(async(s)=>{o=s;let l=s.root;if(a)return s.dispose(),l;if(await An(l),a)return l;return un(l),l});return{close(){let s=o?.root;if(s instanceof HTMLElement)rn(s);o?.dispose(),o=null,e.remove(),r()},host:e,ready:n}}function rb(t){return t.replace(/^[\^~>=<v\s]+/,"").trim().split(/\s+/)[0]??""}function bt(t){if(t.includes(":"))return!1;return/^\d+\.\d+/.test(rb(t))}function yt(t){let e=rb(t).split(/[-+]/)[0]??"",[a=0,r=0,i=0]=e.split(".").map((o)=>Math.trunc(Number(o))||0);return[a,r,i]}function we(t,e){let a=yt(t),r=yt(e);for(let i=0;i<3;i++){let o=a[i]??0,n=r[i]??0;if(o!==n)return o<n?-1:1}return 0}function ww(t,e){if(!bt(t)||!bt(e))return!1;return we(e,t)>0}var ve="@jxsuite/";async function J(){let t=p();if(!t.packageVersions)return[];let e;try{e=await t.packageVersions()}catch{return[]}let a=[];for(let r of e)if(r.name.startsWith(ve)&&ww(r.current,r.latest))a.push({current:r.current,dev:Boolean(r.dev),latest:r.latest,name:r.name});return a}function wt(t,e){let a=e.map((r)=>`${r.name}@${r.latest}`).toSorted().join(",");return`jx:jxsuite-update-dismissed:${t}:${a}`}function xe(t,e){try{return localStorage.getItem(wt(t,e))==="1"}catch{return!1}}function $e(t,e){try{localStorage.setItem(wt(t,e),"1")}catch{}}async function W(t){let e=p();if(!e.setPackageVersions||t.length===0)return;let a=la({status:"Updating @jxsuite packages…",title:"Updating dependencies"});try{let r=await e.setPackageVersions(t.map((i)=>({dev:i.dev,name:i.name,version:`^${i.latest}`})));if(r.ok)a.done(),k.success(`Updated ${t.length} @jxsuite package(s) to their latest versions.`);else a.fail(r.log??"Update failed")}catch(r){a.fail(r instanceof Error?r.message:String(r))}}function Se(t){return new Promise((e)=>{let a=!1,r=(s)=>{if(a)return;a=!0,e(s)},i=!1,o=()=>{if(i)return;i=!0,n.close()},n=ft({layer:Ct("dialog"),onCancel:()=>{o()},onClosed:()=>{r(!1),o()},onConfirm:()=>{r(!0),o()},packages:t.map((s)=>({current:s.current,name:s.name,target:`^${s.latest}`}))})})}async function np(t){if(ob(location.search))return;if(!p().setPackageVersions)return;let a=await J();if(a.length===0||xe(t,a))return;if(!await Se(a)){$e(t,a);return}await W(a)}var G=["package.json","bun.lock","bun.lockb"],ke=new Set(["??","U"]),je=25,Pe="@jxsuite/";function F(t){return typeof t==="object"&&t!==null&&!Array.isArray(t)}function E(t){if(Array.isArray(t))return t.map((e)=>E(e));if(F(t)){let e={};for(let a of Object.keys(t).toSorted())e[a]=E(t[a]);return e}return t}function vt(t){let e={...t};for(let a of["dependencies","devDependencies"]){let r=e[a];if(!F(r))continue;let i={...r};for(let o of Object.keys(i))if(o.startsWith(Pe))i[o]="*";e[a]=i}return e}function Ce(t,e){if(t===null||e===null)return!1;let a,r;try{a=JSON.parse(t),r=JSON.parse(e)}catch{return!1}if(!F(a)||!F(r))return!1;return JSON.stringify(E(vt(a)))===JSON.stringify(E(vt(r)))}async function L(t,e){try{return await p().gitShow({path:t,ref:e})}catch{return null}}async function $t(t){try{return await p().readFile(t)}catch{return null}}async function St(t){let e=[],a=[],r=!0;for(let i of G){let o=t.files.filter((l)=>l.path===i);if(o.length===0)continue;let n=await L(i,"@{u}");if(o.every((l)=>ke.has(l.status))){if(n!==null)a.push(i);continue}let s=await L(i,"HEAD");if(n===null||n===s)continue;if(e.push(i),i==="package.json")r&&=Ce(s,await $t(i))}return{automated:r,discard:e,removeUntracked:a}}function kt(t){return t.discard.length===0&&t.removeUntracked.length===0}async function Ne(t){let e=[...new Set(t.files.filter((a)=>!G.includes(a.path)).map((a)=>a.path))];if(e.length>je)return!0;for(let a of e){let r=await L(a,"@{u}");if(r!==null&&r!==await L(a,"HEAD"))return!0}return!1}async function Ae(t){let e=p();if(t.discard.length>0)await e.gitUnstage(t.discard),await e.gitDiscard(t.discard);for(let a of t.removeUntracked)await e.deleteFile(a)}async function B(){let t=p(),e=[];try{e=await J()}catch{e=[]}if(e.length>0&&t.setPackageVersions){await W(e);return}if(!t.installDependencies)return;let a=la({status:"Running bun install…",title:"Syncing dependencies"});try{let r=await t.installDependencies();if(r.ok)a.done();else a.fail(r.log??"bun install failed")}catch(r){a.fail(te(r))}}async function jt(t){let e=p();try{await Ae(t)}catch(a){throw Error(`Could not reset local package files: ${te(a)}`,{cause:a})}try{await e.gitPull()}catch(a){throw await B(),a}k.warn("Local package updates were superseded by pulled changes.",{source:"Source Control"}),await B()}async function Re(t){let e=p(),a;try{a=await e.gitStatus()}catch{throw t}if(!(a.behind>0))throw t;let r=await St(a);if(kt(r)||await Ne(a))throw t;if(!r.automated){if(!await Xo("Discard local package changes?","package.json / bun.lock have local edits that conflict with incoming changes. Discard them, pull, and re-sync packages?",{confirmLabel:"Discard and pull",destructive:!0}))throw t}await jt(r)}async function xt(){let t;try{let e=await p().listDirectory("");t=new Set(e.filter((a)=>a.type==="file").map((a)=>a.name))}catch{t=new Set(G)}return Promise.all(G.map((e)=>t.has(e)?$t(e):Promise.resolve(null)))}async function q(){let t=p(),e=await xt(),a=null;try{await t.gitFetch(),a=await t.gitStatus()}catch{a=null}if(a&&a.behind>0){let i=await St(a);if(!kt(i)&&i.automated){await jt(i);return}}try{await t.gitPull()}catch(i){await Re(i);return}let r=await xt();if(e.some((i,o)=>i!==r[o]))await B()}async function ip(){let t=p(),e;try{e=await t.gitStatus()}catch{return}if(!e?.isRepo||(e.remotes?.length??0)===0)return;k.info("Syncing project…",{key:"project.sync",source:"Source Control"});try{await q()}catch(a){k.warn("The project could not be synced with its remote.",{detail:te(a),key:"project.sync",source:"Source Control",tier:"problem"})}}var Pt={$schema:"https://jxsuite.com/schema/v1",$id:"StudioPanelGit",$description:"The Navigator's Source Control panel: what git says about this project, and every verb that answers. It has four moods and the adapter names which one — no project, a first read still in flight, a project git is not tracking yet, and a repository — so nothing here asks whether `status` is null or what `isRepo` means. Under the fourth mood it draws the sync bar (with or without a remote), the branch row, the two sub-tabs, and then either the commit form over the changed files or the log. `panels/git-panel.ts` keeps every decision: what a comparison is, which files group under which component, what a status letter reads aloud, what a commit does before it runs, and which of the four verbs a row's buttons are. Rows arrive as strings and booleans, keyed by path.",tagName:"div",attributes:{part:"git-panel"},style:{$description:"The sixty-odd `.git-*` rules in `styles/overlays.css`, keyed on `part` and carried here. Four token repairs travel with them, all of the shape `surfaces/panel-imports.json` describes: `--spectrum-font-size-75` and `--spectrum-font-size-50` resolved only inside `<sp-theme>` and a document is mounted outside it, so every rule that read one would silently have taken its px fallback — they are `--jx-text-md` (12px) and `--jx-text-sm` (11px) here, at the same values, and the bare `10px` literals are `--jx-text-xs`. The one deliberate move is the two headline values, the sync label and the branch name: they were 13px, which is not a step on the scale, and they take `--jx-text-lg` (14px). Three rules are DELETED rather than moved, because the kit already draws them: the sub-tab strip's own fill, hover and selected underline are `jx-tabs`/`jx-tab`, the branch picker's box is `jx-select`, and `.git-split-btn`'s hand-built dropdown is the kit menu (see `openCommitMenu`). And one is repaired: a row's action buttons were `opacity: 0` until the ROW was hovered, so tabbing to Stage moved the keyboard onto an invisible control — the reveal is `:focus-within` as well as `:hover`.",display:"flex",flexDirection:"column",height:"100%",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-md)",color:"var(--fg)",'& [part="empty"]':{$description:"Drawn here rather than borrowed from `panels/empty-state.ts`, which is a lit template a document cannot call. What is kept is the pattern's rules (studio-ui-guidelines.md §11): one sentence saying what the region is for, then the action that fills it.",display:"flex",flex:"1",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"var(--jx-space-3)",padding:"var(--jx-space-5)",textAlign:"center",color:"var(--fg-dim)"},'& [part="empty-message"]':{margin:"0",maxWidth:"34ch",lineHeight:"1.5"},'& [part="empty-actions"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-2)"},'& [part="sync-bar"]':{$description:'A wrapping row (studio-ui-guidelines.md §4.6), and it has exactly two items: `sync-head` (Refresh and the status, which never split) and what answers the status (the Fetch/Pull/Push group, or Create GitHub repository with no remote). It was a single line whose only shrinkable item was the status text, so a narrow Navigator never moved a button: it broke "3 behind / Last updated 09:04 AM" into a column one word wide (25px at the 160px floor) and painted "(no" under Create GitHub repository at the default 240px. Now the second item drops to a line of its own when the two no longer fit, and where that happens is decided by the status text\'s own width (a count, a locale\'s clock), never by a breakpoint. The row gap is the smaller step so a wrapped bar reads as one block.',display:"flex",flexWrap:"wrap",alignItems:"center",gap:"var(--jx-space-3) var(--jx-space-4)",padding:"var(--jx-space-4)",borderBottom:"1px solid var(--border)"},'& [part="sync-bar"][data-remote="none"], & [part="sync-bar"][data-remote="none"] > [part="sync-head"]':{$description:"The no-remote bar keeps its tighter 8px between Refresh and the sentence, and on both axes: the head carries that gap now that Refresh and the text sit in it rather than in the bar.",gap:"var(--jx-space-3)"},'& [part="sync-head"]':{$description:"Refresh and the status, as one item of the bar, so wrapping never leaves the icon alone on a line above its text. `flex: 1 1 auto` makes its basis the status text's own width, which is the wrap threshold; with `min-width: 0` it can then shrink below that when it is alone on a line, and the status wraps as a sentence rather than word by word.",display:"flex",flex:"1 1 auto",alignItems:"center",gap:"var(--jx-space-4)",minWidth:"0"},'& [part="sync-text"]':{$description:"`1 1 auto` rather than `1`: the head's basis decides whether the verbs fit beside it, and it should be the status text's own width. An auto basis says that directly; the `0%` basis of `flex: 1` only reaches the same answer through how an engine treats a percentage while it measures.",display:"flex",flex:"1 1 auto",flexDirection:"column",gap:"1px",minWidth:"0"},'& [part="sync-label"]':{fontSize:"var(--jx-text-lg)",fontWeight:"600",color:"var(--fg)"},'& [part="sync-time"]':{fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="sync-actions"]':{$description:"The verbs never shrink: they are what moves. `margin-left: auto` keeps them at the inline end whether they share the status's line or sit on one of their own.",display:"flex",flex:"none",marginLeft:"auto"},'& [part="branch-row"]':{$description:'A wrapping row (studio-ui-guidelines.md §4.6) of two items, `branch-head` and the picker. It was a single line with the picker capped at 40% of it, so a long branch name was cut twice ("chor…" beside "cho…") and a narrow Navigator word-stacked "Active / branch". Now the picker drops below the name when the two no longer fit, at a width the name decides.',display:"flex",flexWrap:"wrap",alignItems:"center",gap:"var(--jx-space-3) var(--jx-space-4)",padding:"10px var(--jx-space-4)",borderBottom:"1px solid var(--border)"},'& [part="branch-head"]':{$description:"The branch icon and the name, as one item so the icon is never alone on a line. The 999:1 grow ratio against the picker gives nearly all spare room to the name while the two share a line, so the picker stays the width of the branch it shows; once the picker wraps, it is alone and takes the whole line. A third item in this row needs its own flex decision.",display:"flex",flex:"999 1 auto",alignItems:"center",gap:"var(--jx-space-4)",minWidth:"0"},'& [part="branch-icon"]':{$description:"The hand-drawn 18px branch SVG this panel carried is the kit's `git-branch` glyph — the same key `PanelRecord.icon` already names for this panel's rail button, so the two drawings cannot drift.",flex:"none","--jx-icon-size":"18px",color:"var(--fg-dim)"},'& [part="branch-text"]':{display:"flex",flex:"1 1 auto",flexDirection:"column",gap:"1px",minWidth:"0"},'& [part="branch-label"]':{fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="branch-name"]':{overflow:"hidden",fontSize:"var(--jx-text-lg)",fontWeight:"600",color:"var(--fg)",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="branch-picker"]':{$description:"Sized by the branch it shows while it shares the name's line, and the full width of the row once it wraps below it, which is where a long branch name finally reads whole. `min-width: 0` is the kit's own default, restated because studio-ui-guidelines.md §4.6 asks it of every flex child: when even a line of its own is narrower than the name, the picker shrinks and the kit's preview ellipsizes.",flex:"1 1 auto",minWidth:"0"},'& [part="tab"]':{$description:`The sub-tabs may shrink below their labels. A flex item's automatic minimum is its content, and a tab's label is nowrap, so "Local Changes (3)" and "History" held 179px against the 159px the Navigator has at its 160px floor and scrolled the whole panel sideways; the kit's label ellipsis could never engage. \`inspector-dock.json\` makes the same call for its tabs. It is a surface decision and not a kit default because the document tab strip deliberately scrolls instead.`,minWidth:"0"},'& [part="create-repository"] > [part="control"], & [part="init"] > [part="control"], & [part="clone"] > [part="control"], & [part="commit-button"] > [part="control"]':{$description:`The panel's labelled buttons wrap their words at the Navigator's floor instead of overflowing it. The kit's control is nowrap, which is right for a toolbar and made each label a floor of its own: "Create GitHub repository" held 165px in a 135px sync bar, "Clone Git Repository" and "Initialize Repository" held 141px and 135px in the empty state's 127px, and "Commit and sync" beside its menu had about a pixel to spare in the commit form's 135px. Nothing changes where the label fits, because a nowrap label and a wrapping one have the same max-content width. This reaches into the kit's \`control\` part as \`commandbar.json\` does for its primary button.`,whiteSpace:"normal"},'& [part="commit"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)",padding:"var(--jx-space-4)",borderBottom:"1px solid var(--border)"},'& [part="commit-label"]':{fontWeight:"500",color:"var(--fg-dim)"},'& [part="commit-actions"]':{display:"flex",gap:"var(--jx-space-2)"},'& [part="commit-button"]':{flex:"1"},'& [part="section"]':{borderBottom:"1px solid var(--border)"},'& [part="section-header"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-3)",padding:"var(--jx-space-3) var(--jx-space-4) 6px",fontWeight:"700",color:"var(--fg)"},'& [part="count"]':{$description:"The pill beside a section title. `margin-inline-end: auto` is what pushes the section's own button to the right edge — it was a second rule (`.git-section-header .git-count`) over the same element, and there is only one place a count is drawn.",display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"18px",height:"18px",marginInlineEnd:"auto",padding:"0 5px",borderRadius:"9px",background:"var(--accent-15)",color:"var(--accent)",fontSize:"var(--jx-text-xs)",fontWeight:"600"},'& [part="group"]':{marginBottom:"var(--jx-space-1)"},'& [part="group-header"]':{display:"flex",alignItems:"center",gap:"6px",padding:"var(--jx-space-2) var(--jx-space-3)"},'& [part="group-name"]':{fontWeight:"500",color:"var(--fg)"},'& [part="file-row"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-2)",padding:"var(--jx-space-1) var(--jx-space-3) var(--jx-space-1) var(--jx-space-5)"},'& [part="file-row"]:hover':{background:"var(--hover-bg)"},'& [part="file-open"]':{$description:"A REAL button, because it does something. It was a bare span with a cursor and a `title`: not focusable, no role, and Enter did nothing — so the panel's primary verb was mouse-only. A `<button>` needs no role, no tabindex and no key handler of its own, which is three lines of the old row that simply go.",display:"flex",flex:"1",alignItems:"baseline",gap:"6px",minWidth:"0",margin:"0",padding:"0",overflow:"hidden",border:"none",borderRadius:"var(--radius)",background:"none",color:"inherit",font:"inherit",textAlign:"left",cursor:"pointer",":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"-2px"}},'& [part="file-name"]':{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="file-dir"]':{overflow:"hidden",color:"var(--fg-dim)",fontSize:"var(--jx-text-xs)",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="file-actions"]':{$description:"Revealed on `:focus-within` as well as on the row's hover. Opacity alone hid a control the keyboard could still reach: tabbing through a changed file landed on an invisible Stage button.",display:"flex",flex:"none",opacity:"0"},'& [part="file-row"]:hover [part="file-actions"], & [part="file-actions"]:focus-within':{opacity:"1"},'& [part="badge"]':{$description:"One letter and a colour, which is why every row's open button carries the status in words as well.",flex:"none",width:"16px",color:"var(--signal)",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-xs)",fontWeight:"700",textAlign:"center"},'& [part="badge"][data-status="A"], & [part="badge"][data-status="U"]':{color:"var(--success)"},'& [part="badge"][data-status="D"]':{color:"var(--danger)"},'& [part="badge"][data-status="R"], & [part="badge"][data-status="C"]':{color:"var(--tag)"},'& [part="history"]':{flex:"1",overflowY:"auto",padding:"var(--jx-space-2) 0"},'& [part="history-list"]':{margin:"0",padding:"0",listStyle:"none"},'& [part="history-entry"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-1)",padding:"6px var(--jx-space-4)",borderBottom:"1px solid var(--border)"},'& [part="history-entry"]:hover':{background:"var(--hover-bg)"},'& [part="history-hash"]':{color:"var(--accent)",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-xs)"},'& [part="history-message"]':{color:"var(--fg)"},'& [part="history-meta"]':{color:"var(--fg-dim)",fontSize:"var(--jx-text-xs)"},'& [part="status"]':{margin:"0",padding:"var(--jx-space-3)",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)",textAlign:"center"},'& [part="failure"]':{$description:"The panel's own refusal banner. It is `failure` rather than `error` because the branch picker and the commit field each draw a permanent, empty `[part=\"error\"]` of their own inside this same light-DOM tree: under that name this padding, rule and wash drew a 16×13 box over both fields' top-left corners that took the click, and dressed either field's real refusal sentence as a banner.",margin:"0",padding:"6px var(--jx-space-3)",borderBottom:"1px solid var(--border)",background:"color-mix(in srgb, var(--danger) 8%, transparent)",color:"var(--danger)",fontSize:"var(--jx-text-sm)"},"@(forced-colors: active)":{'& [part="failure"]':{$description:"The wash behind the banner collapses into the page when every author colour is replaced, so the border is what is left to mark it.",border:"1px solid CanvasText",color:"CanvasText"}}},children:[{tagName:"div",attributes:{part:"view-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/view"},cases:{"no-project":{tagName:"div",attributes:{part:"empty","data-view":"no-project"},children:[{tagName:"p",attributes:{part:"empty-message"},textContent:"Source control keeps every version of a project, so any change can be undone. Open a project to see its history."},{tagName:"div",attributes:{part:"clone-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/canClone"},cases:{true:{tagName:"div",attributes:{part:"empty-actions"},children:[{tagName:"jx-button",attributes:{part:"clone","data-action":"clone"},$props:{size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/clone"},value:[]}]},children:[{tagName:"jx-icon",$props:{name:"download-simple"}},{tagName:"span",textContent:"Clone Git Repository"}]}]}}}]},loading:{tagName:"p",attributes:{part:"status","data-view":"loading"},textContent:"Loading…"},"no-repo":{tagName:"div",attributes:{part:"empty","data-view":"no-repo"},children:[{tagName:"p",attributes:{part:"empty-message"},textContent:"This project is not tracked by git yet. Start tracking it to keep a history of every change and to publish it anywhere."},{tagName:"div",attributes:{part:"empty-actions"},children:[{tagName:"jx-button",attributes:{part:"init","data-action":"init"},$props:{size:"sm",variant:"accent",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/initRepository"},value:[]}]},children:[{tagName:"jx-icon",$props:{name:"plus"}},{tagName:"span",textContent:"Initialize Repository"}]},{tagName:"jx-button",attributes:{part:"create-repository","data-action":"create-repository"},$props:{size:"sm",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/createRepository"},value:[]}]},children:[{tagName:"jx-icon",$props:{name:"share-network"}},{tagName:"span",textContent:"Create GitHub repository"}]}]}]},repo:{tagName:"div",attributes:{part:"repo",role:"none"},style:{display:"contents"},children:[{tagName:"div",attributes:{part:"remote-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/remoteState"},cases:{remote:{tagName:"div",attributes:{part:"sync-bar","data-remote":"yes"},children:[{tagName:"div",attributes:{part:"sync-head"},children:[{tagName:"jx-action-button",attributes:{part:"refresh","data-action":"refresh"},$props:{icon:"arrows-clockwise",size:"sm",quiet:!0,label:"Refresh",hint:"Refresh",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/refresh"},value:[]}]}},{tagName:"div",attributes:{part:"sync-text"},children:[{tagName:"span",attributes:{part:"sync-label"},textContent:"${state.syncLabel}"},{tagName:"span",attributes:{part:"updated-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasLastUpdated"},cases:{true:{tagName:"span",attributes:{part:"sync-time"},textContent:"${state.lastUpdated}"}}}]}]},{$description:"Three quiet tools, so NOT compact. A compact group draws every member's frame and fill whatever its quiet says, so the `quiet: true` each verb below writes would have been silently framed into a segmented control; Spectrum's group here was quiet and never compact, which is what compact=false and the 2px gap between the verbs restore.",tagName:"jx-action-group",attributes:{part:"sync-actions"},$props:{label:"Remote actions",compact:!1},children:[{tagName:"jx-action-button",attributes:{part:"fetch","data-action":"fetch"},$props:{icon:"download-simple",size:"sm",quiet:!0,label:"Fetch",hint:"Fetch",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/fetch"},value:[]}]}},{tagName:"jx-action-button",attributes:{part:"pull","data-action":"pull"},$props:{icon:"arrow-down",size:"sm",quiet:!0,label:{$ref:"#/state/pullLabel"},hint:{$ref:"#/state/pullLabel"},disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pull"},value:[]}]}},{tagName:"jx-action-button",attributes:{part:"push","data-action":"push"},$props:{icon:"arrow-up",size:"sm",quiet:!0,label:{$ref:"#/state/pushLabel"},hint:{$ref:"#/state/pushLabel"},disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/push"},value:[]}]}}]}]},local:{tagName:"div",attributes:{part:"sync-bar","data-remote":"none"},children:[{tagName:"div",attributes:{part:"sync-head"},children:[{tagName:"jx-action-button",attributes:{part:"refresh","data-action":"refresh"},$props:{icon:"arrows-clockwise",size:"sm",quiet:!0,label:"Refresh",hint:"Refresh",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/refresh"},value:[]}]}},{tagName:"div",attributes:{part:"sync-text"},children:[{tagName:"span",attributes:{part:"sync-label"},textContent:"Local only (no remote)"}]}]},{tagName:"jx-button",attributes:{part:"create-repository","data-action":"create-repository"},$props:{size:"sm",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/createRepository"},value:[]}]},children:[{tagName:"jx-icon",$props:{name:"share-network"}},{tagName:"span",textContent:"Create GitHub repository"}]}]}}},{tagName:"div",attributes:{part:"branch-row"},children:[{tagName:"div",attributes:{part:"branch-head"},children:[{tagName:"jx-icon",attributes:{part:"branch-icon"},$props:{name:"git-branch"}},{tagName:"div",attributes:{part:"branch-text"},children:[{tagName:"span",attributes:{part:"branch-label"},textContent:"Active branch"},{tagName:"span",attributes:{part:"branch-name"},textContent:"${state.branchName}"}]}]},{tagName:"jx-select",attributes:{part:"branch-picker"},$props:{label:"Switch branch",size:"sm",options:{$ref:"#/state/branchOptions"},value:{$ref:"#/state/branchValue"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/chooseBranch"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-tabs",attributes:{part:"tabs",selected:"${state.subTab}"},$props:{label:"Source control views"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/selectTab"},value:[{$ref:"event#/detail"}]}]},children:[{tagName:"jx-tab",attributes:{part:"tab","data-tab":"changes",value:"changes",label:"${state.changesLabel}",panel:"git-panel-body"}},{tagName:"jx-tab",attributes:{part:"tab","data-tab":"history",value:"history",label:"History",panel:"git-panel-body"}}]},{tagName:"div",attributes:{part:"body",id:"git-panel-body",role:"tabpanel","data-tab":"${state.subTab}"},style:{display:"contents"},$switch:{$ref:"#/state/subTab"},cases:{changes:{tagName:"div",attributes:{part:"changes",role:"none"},style:{display:"contents"},children:[{tagName:"div",attributes:{part:"commit","data-jx-region":"navigator/panel:git/commit"},children:[{tagName:"span",attributes:{part:"commit-label",id:"git-commit-label"},textContent:"Please write a commit message"},{tagName:"jx-textfield",attributes:{part:"commit-input","data-field":"commit-message"},$props:{labelledby:"git-commit-label",multiline:!0,size:"sm",placeholder:"Describe your changes",value:{$ref:"#/state/commitMessage"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editMessage"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{if:{operator:"||",target:{$ref:"event#/ctrlKey"},value:{$ref:"event#/metaKey"}},then:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/commit"},value:[]}]}]}}]}},{tagName:"div",attributes:{part:"commit-actions"},children:[{tagName:"jx-button",attributes:{part:"commit-button","data-action":"commit-and-sync"},$props:{size:"sm",variant:"accent",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/commitAndSync"},value:[]}]},children:[{tagName:"span",textContent:"Commit and sync"}]},{tagName:"jx-action-button",attributes:{part:"commit-menu","data-action":"commit-menu"},$props:{icon:"caret-down",size:"sm",label:"More commit options",hint:"More commit options",haspopup:"menu"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openCommitMenu"},value:[{$ref:"event#/currentTarget"}]}]}}]}]},{tagName:"div",attributes:{part:"staged-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasStaged"},cases:{true:{tagName:"section",attributes:{part:"section","data-section":"staged","aria-label":"Staged Changes"},children:[{tagName:"div",attributes:{part:"section-header"},children:[{tagName:"span",attributes:{part:"section-title"},textContent:"Staged Changes"},{tagName:"span",attributes:{part:"count"},textContent:"${state.stagedCount}"},{tagName:"jx-action-button",attributes:{part:"unstage-all","data-action":"unstage-all"},$props:{icon:"minus",size:"sm",quiet:!0,label:"Unstage all",hint:"Unstage all"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/unstageAll"},value:[]}]}}]},{$prototype:"Array",items:{$ref:"#/state/stagedFiles"},key:{$ref:"$map/item/key"},map:{$description:"One changed file. Every row opens the file it names — renderability decides which VIEW opens, not whether the row responds — and carries the two or three verbs its staged state allows. `$map/item` inside a nested map is the FILE, which is why the row hands its own path back to every action rather than an index.",tagName:"div",attributes:{part:"file-row","data-path":"${$map.item.path}","data-status":"${$map.item.status}"},children:[{tagName:"button",attributes:{part:"file-open",type:"button","aria-label":"${$map.item.label}",title:"Open this file's comparison"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openFile"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"file-name"},textContent:"${$map.item.name}"},{tagName:"span",attributes:{part:"dir-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasDir"},cases:{true:{tagName:"span",attributes:{part:"file-dir"},textContent:"${$map.item.dir}"}}}]},{tagName:"span",attributes:{part:"file-actions"},$switch:{$ref:"$map/item/staged"},cases:{true:{tagName:"jx-action-button",attributes:{part:"unstage","data-action":"unstage"},$props:{icon:"minus",size:"sm",quiet:!0,label:"Unstage ${$map.item.path}",hint:"Unstage"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/unstage"},value:[{$ref:"$map/item/path"}]}]}},false:{tagName:"span",attributes:{part:"unstaged-actions",role:"none"},style:{display:"contents"},children:[{tagName:"jx-action-button",attributes:{part:"discard","data-action":"discard"},$props:{icon:"arrow-u-up-left",size:"sm",quiet:!0,label:"Discard changes to ${$map.item.path}",hint:"Discard changes",disabled:{$ref:"$map/item/cannotDiscard"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/discard"},value:[{$ref:"$map/item/path"}]}]}},{tagName:"jx-action-button",attributes:{part:"stage","data-action":"stage"},$props:{icon:"plus",size:"sm",quiet:!0,label:"Stage ${$map.item.path}",hint:"Stage"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/stage"},value:[{$ref:"$map/item/path"}]}]}}]}}},{tagName:"span",attributes:{part:"badge","data-status":"${$map.item.status}"},textContent:"${$map.item.status}"}]}}]}}},{tagName:"section",attributes:{part:"section","data-section":"changed","aria-label":"Changed Components"},children:[{tagName:"div",attributes:{part:"section-header"},children:[{tagName:"span",attributes:{part:"section-title"},textContent:"Changed Components"},{tagName:"span",attributes:{part:"count"},textContent:"${state.changedCount}"},{tagName:"span",attributes:{part:"stage-all-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasUnstaged"},cases:{true:{tagName:"jx-action-button",attributes:{part:"stage-all","data-action":"stage-all"},$props:{icon:"plus",size:"sm",quiet:!0,label:"Stage all",hint:"Stage all"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/stageAll"},value:[]}]}}}}]},{tagName:"div",attributes:{part:"groups-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/filesState"},cases:{listed:{tagName:"div",attributes:{part:"groups"},children:[{$prototype:"Array",items:{$ref:"#/state/groups"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"group","data-group":"${$map.item.key}"},children:[{tagName:"div",attributes:{part:"group-header"},children:[{tagName:"span",attributes:{part:"group-name"},textContent:"${$map.item.name}"}]},{$prototype:"Array",items:{$ref:"$map/item/files"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"file-row","data-path":"${$map.item.path}","data-status":"${$map.item.status}"},children:[{tagName:"button",attributes:{part:"file-open",type:"button","aria-label":"${$map.item.label}",title:"Open this file's comparison"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openFile"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"file-name"},textContent:"${$map.item.name}"},{tagName:"span",attributes:{part:"dir-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasDir"},cases:{true:{tagName:"span",attributes:{part:"file-dir"},textContent:"${$map.item.dir}"}}}]},{tagName:"span",attributes:{part:"file-actions"},$switch:{$ref:"$map/item/staged"},cases:{true:{tagName:"jx-action-button",attributes:{part:"unstage","data-action":"unstage"},$props:{icon:"minus",size:"sm",quiet:!0,label:"Unstage ${$map.item.path}",hint:"Unstage"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/unstage"},value:[{$ref:"$map/item/path"}]}]}},false:{tagName:"span",attributes:{part:"unstaged-actions",role:"none"},style:{display:"contents"},children:[{tagName:"jx-action-button",attributes:{part:"discard","data-action":"discard"},$props:{icon:"arrow-u-up-left",size:"sm",quiet:!0,label:"Discard changes to ${$map.item.path}",hint:"Discard changes",disabled:{$ref:"$map/item/cannotDiscard"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/discard"},value:[{$ref:"$map/item/path"}]}]}},{tagName:"jx-action-button",attributes:{part:"stage","data-action":"stage"},$props:{icon:"plus",size:"sm",quiet:!0,label:"Stage ${$map.item.path}",hint:"Stage"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/stage"},value:[{$ref:"$map/item/path"}]}]}}]}}},{tagName:"span",attributes:{part:"badge","data-status":"${$map.item.status}"},textContent:"${$map.item.status}"}]}}]}}]},empty:{tagName:"p",attributes:{part:"empty-message","data-empty":"changes"},textContent:"Nothing to commit. Files you edit and save show up here."}}}]}]},history:{tagName:"div",attributes:{part:"history"},children:[{tagName:"div",attributes:{part:"history-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/historyState"},cases:{listed:{tagName:"ul",attributes:{part:"history-list"},children:[{$prototype:"Array",items:{$ref:"#/state/commits"},key:{$ref:"$map/item/key"},map:{tagName:"li",attributes:{part:"history-entry","data-hash":"${$map.item.hash}"},children:[{tagName:"span",attributes:{part:"history-hash"},textContent:"${$map.item.hash}"},{tagName:"span",attributes:{part:"history-message"},textContent:"${$map.item.message}"},{tagName:"span",attributes:{part:"history-meta"},textContent:"${$map.item.meta}"}]}}]},empty:{tagName:"p",attributes:{part:"empty-message","data-empty":"history"},textContent:"No commits yet. Each commit you make is a version you can come back to."}}}]}}},{tagName:"div",attributes:{part:"busy-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/busy"},cases:{true:{tagName:"p",attributes:{part:"status","data-status":"busy"},textContent:"Loading…"}}},{tagName:"div",attributes:{part:"failure-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasError"},cases:{true:{tagName:"p",attributes:{part:"failure",role:"alert"},textContent:"${state.error}"}}}]}}}]};T("git-panel",Pt);function Nt(t,e){t.view=e.view,t.canClone=e.canClone,t.busy=e.busy,t.hasError=e.hasError,t.error=e.error,t.remoteState=e.remoteState,t.syncLabel=e.syncLabel,t.lastUpdated=e.lastUpdated,t.hasLastUpdated=e.hasLastUpdated,t.pullLabel=e.pullLabel,t.pushLabel=e.pushLabel,t.branchName=e.branchName,t.branchValue=e.branchValue,t.branchOptions=e.branchOptions,t.subTab=e.subTab,t.changesLabel=e.changesLabel,t.commitMessage=e.commitMessage,t.hasStaged=e.hasStaged,t.stagedCount=e.stagedCount,t.stagedFiles=e.stagedFiles,t.changedCount=e.changedCount,t.hasUnstaged=e.hasUnstaged,t.filesState=e.filesState,t.groups=e.groups,t.historyState=e.historyState,t.commits=e.commits}function Me(){return{branchName:"",branchOptions:[],branchValue:"",busy:!1,canClone:!1,changedCount:"0",changesLabel:"Local Changes",commitMessage:"",commits:[],error:"",filesState:"empty",groups:[],hasError:!1,hasLastUpdated:!1,hasStaged:!1,hasUnstaged:!1,historyState:"empty",lastUpdated:"",pullLabel:"Pull",pushLabel:"Push",remoteState:"local",stagedCount:"0",stagedFiles:[],subTab:"changes",syncLabel:"",view:"loading"}}function At(t,e,a){let r=v({...Me(),...a});Nt(r,e);let i=null,o=!1;return R("git-panel",r,t).then((n)=>{if(o){n.dispose();return}i=n}),{connected:()=>!o&&(i===null||i.root.parentNode===t),dispose(){o=!0,i?.dispose(),i=null},update:(n)=>{Nt(r,n)}}}async function uc(){if(!D)return;let t=p(),{git:e}=y;e.loading=!0,e.error=null;try{let[a,r]=await Promise.allSettled([t.gitStatus(),t.gitBranches()]);if(a.status==="fulfilled")e.status=a.value;if(r.status==="fulfilled")e.branches=r.value;let i=a.status==="rejected"?a.reason:r.status==="rejected"&&a.value?.isRepo?r.reason:null;if(i)e.error=te(i);e.lastUpdated=Mo(),e.rev+=1,await Ge()}catch(a){e.error=te(a)}finally{e.loading=!1}}async function Ge(){let t=y.git.diffState;if(!t)return;let e=y.git.status?.files.find((a)=>a.path===t.filePath);if(!e||!Tt(e.status)){y.git.diffState=null;return}try{y.git.diffState=await I(t.filePath,e.status)}catch{}}async function c1(t){y.git.rev+=1;let e=y.git.diffState;if(!t||e?.filePath!==t)return;try{y.git.diffState=await I(t,e.fileStatus)}catch{}}async function _w(t){let e=p();if(!e.gitClone){k.warn("Cloning is not supported on this platform.",{source:"Source Control"});return}let a=await Nn("Clone Git Repository",{confirmLabel:"Clone",message:"Repository URL",placeholder:"https://github.com/user/repo.git",validate:(r)=>r.trim()?"":"Enter a repository URL."});if(!a)return;try{k.info("Cloning repository…",{key:"git.clone",source:"Source Control"});let r=await e.gitClone(a);if(r?.root)k.success("Clone complete.",{key:"git.clone"}),await t.openRecentProject(r.root)}catch(r){k.error("Could not clone the repository.",{detail:te(r),key:"git.clone",source:"Source Control"})}}function Cw(){return We()&&Boolean(p().gitClone)}var Fe={A:"added",D:"deleted",M:"modified",R:"renamed",U:"untracked"},De=new Set(["M","A","U","D"]);function Tt(t){return De.has(t)}async function I(t,e){let a=p(),r=e!=="A"&&e!=="U",i=e!=="D",[o,n]=await Promise.all([r?a.gitShow({path:t,ref:"HEAD"}):Promise.resolve(""),i?a.readFile(t):Promise.resolve("")]);return{currentContent:n,filePath:t,fileStatus:e,originalContent:o}}async function d1(t,e){try{return await I(t,e)}catch(a){return console.warn("loadDiffForLens:",te(a)),null}}async function Mt(){try{k.info("Initializing repository…",{key:"git.init"}),await p().gitInit(),k.success("Repository initialized.",{key:"git.init"})}catch(t){k.error("Could not initialize the repository.",{action:"git.init",detail:te(t),key:"git.init",source:"Source Control"});return}await uc()}async function Ee(){await b("gitPush")}async function Le(){if(await kw())k.success("Signed in to GitHub.",{key:"github.auth"})}async function b(t,e){let a=p();y.git.loading=!0,y.git.error=null;try{return await a[t](e),await uc(),!0}catch(r){return y.git.error=te(r),y.git.loading=!1,!1}}function Gt(t){if(!y.git.commitMessage)y.git.commitMessage=t}async function Ue(){y.git.loading=!0,y.git.error=null;try{await q(),await uc()}catch(t){y.git.error=te(t),y.git.loading=!1}}var C=null;async function Ie(){let t=p();try{y.git.logEntries=await t.gitLog(30)}catch(e){y.git.error=te(e)}}var U={},K=null;function Ft(t){let e=t.path.split("/"),a=e.pop()??t.path,r=e.join("/");return{cannotDiscard:t.status==="U",dir:r,hasDir:r!=="",key:t.path,label:`${t.path}, ${Fe[t.status]??"changed"}`,name:a,path:t.path,staged:Boolean(t.staged),status:t.status}}function He(t){let e=new Map;for(let a of t){let r=a.path.split("/"),i;if(a.path.endsWith(".json")||a.path.endsWith(".class.json")||Zt(a.path))i=r.length>1?`/${r.at(-2)}`:`/${r[0]}`;else i="Other";if(!e.has(i))e.set(i,[]);e.get(i).push(a)}return[...e.entries()].map(([a,r])=>({files:r.map((i)=>Ft(i)),key:a,name:a}))}function ze(t){return{hash:t.hash.slice(0,7),key:t.hash,message:t.message,meta:`${t.author} · ${ta(t.date)}`}}function Ve(t){return t?`Last updated ${new Date(t).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}`:""}function Dt(){if(!D)return"no-project";let{error:t,loading:e,status:a}=y.git;if(!a&&!e&&!t)return"loading";return a&&!a.isRepo?"no-repo":"repo"}function X(){let{branches:t,commitMessage:e,error:a,lastUpdated:r,loading:i,logEntries:o,status:n,subTab:s}=y.git,l=n?.files??[],c=l.filter((d)=>d.staged),h=l.filter((d)=>!d.staged),g=[...c,...h],x=!n?.ahead&&!n?.behind,f=n?.ahead?`${n.ahead} ahead`:"",S=n?.behind?`${n.behind} behind`:"",N=o??[];return{branchName:(t?.current??n?.branch??"")||"—",branchOptions:[...(t?.branches??[]).map((d)=>({label:d,value:d})),{label:"+ New branch…",value:Z}],branchValue:K??t?.current??"",busy:Boolean(i),canClone:Cw(),changedCount:String(g.length),changesLabel:g.length>0?`Local Changes (${g.length})`:"Local Changes",commitMessage:e,commits:N.map((d)=>ze(d)),error:a??"",filesState:g.length>0?"listed":"empty",groups:He(g),hasError:Boolean(a),hasLastUpdated:Boolean(r),hasStaged:c.length>0,hasUnstaged:h.length>0,historyState:N.length>0?"listed":"empty",lastUpdated:Ve(r),pullLabel:S?`Pull (${S})`:"Pull",pushLabel:f?`Push (${f})`:"Push",remoteState:(n?.remotes?.length??0)>0?"remote":"local",stagedCount:String(c.length),stagedFiles:c.map((d)=>Ft(d)),subTab:s,syncLabel:x?"Up to date":`${f}${f&&S?", ":""}${S}`,view:Dt()}}var Z="__new__";function Et(t){return y.git.status?.files.find((e)=>e.path===t)}async function Lt(){let t=y.git.commitMessage.trim();if(!t)return;if(y.git.commitMessage="",await YC(),!await b("gitCommit",t))Gt(t)}async function _e(){let t=y.git.commitMessage.trim();if(!t)return;y.git.commitMessage="",y.git.loading=!0,y.git.error=null,await YC();let e=p(),a=!1;try{await e.gitCommit(t),a=!0,await e.gitPush(),await uc()}catch(r){if(y.git.error=te(r),y.git.loading=!1,!a)Gt(t)}}async function Je(t){let{branches:e,status:a}=y.git;if(t===Z){K=Z,Rt();let r=await Nn("New Branch",{confirmLabel:"Create",message:`Branching from ${e?.current||a?.branch||"the current branch"}.`,placeholder:"feature/my-change",validate:(i)=>i.trim()?"":"Enter a branch name."});if(K=null,Rt(),r)await b("gitCreateBranch",r);return}if(t!==e?.current)await b("gitCheckout",t)}async function Be(t){let e=Et(t);if(!e)return;let a=Tt(e.status)?it(e.path,e.status):`"${e.path}" has no change this view can open.`;if(a){y.git.error=a;return}try{y.git.loading=!0;let r=await I(e.path,e.status);y.git.diffState=r;let i=await ot(e.path);if(U.setGitDiffState?.(r),i)U.setCanvasMode?.(i,"git-diff")}catch(r){y.git.error=`Failed to load diff: ${te(r)}`}finally{y.git.loading=!1}}async function qe(t){if(Et(t)?.status==="U")return;if(!await Xo("Discard Changes",`Discard changes to ${t}?`,{confirmLabel:"Discard",destructive:!0}))return;await b("gitDiscard",[t])}function Ke(t){(me("2e4y9j7b"),import("./menu-2e4y9j7b.js")).then(({openMenu:e})=>{e({label:"Commit options",opener:t,place:(a)=>{let r=Oe(t);return{x:Math.max(4,r.right-a.width),y:r.bottom+4}},region:"git-commit",rows:[{destructive:!1,disabled:!1,dividerAbove:!1,id:"git.commitWithoutSync",run:()=>{Lt()},title:"Commit (don't sync)"}]})})}function Xe(t){if(y.git.subTab=t,t==="history"&&!y.git.logEntries)Ie()}var Ze={chooseBranch:(t)=>{Je(t)},clone:()=>{U.cloneRepository?.()},commit:()=>{Lt()},commitAndSync:()=>{_e()},createRepository:()=>{O({projectName:D?.name||"my-project"})},discard:(t)=>{qe(t)},editMessage:(t)=>{y.git.commitMessage=t},fetch:()=>{b("gitFetch")},initRepository:()=>{Mt()},openCommitMenu:Ke,openFile:(t)=>{Be(t)},pull:()=>{Ue()},push:()=>{b("gitPush")},refresh:()=>{uc()},selectTab:Xe,stage:(t)=>{b("gitStage",[t])},stageAll:()=>{let t=(y.git.status?.files??[]).filter((e)=>!e.staged).map((e)=>e.path);b("gitStage",t)},unstage:(t)=>{b("gitUnstage",[t])},unstageAll:()=>{let t=(y.git.status?.files??[]).filter((e)=>e.staged).map((e)=>e.path);b("gitUnstage",t)}},w=null;function Ut(){if(!w)return;w.scope.stop(),w.handle.dispose(),w=null}function Rt(){w?.handle.update(X())}function Ye(){if(C)return;C=setInterval(()=>{if(y.leftTab==="git"&&!y.git.loading)uc()},sI)}function Qe(t,e){U=e;let a=t.querySelector(".panel-content")??t;if(We()&&Dt()==="loading")uc();if(w&&(w.host!==a||!w.handle.connected()))Ut();if(w)return;let r=At(a,X(),Ze),i=ge();i.run(()=>{Q(()=>{let o=X();if(o.view==="repo")Ye();r.update(o)})}),w={handle:r,host:a,scope:i}}function u1(t){return tt}function ta(t){let e=new Date(t),a=Mo()-e.getTime(),r=Math.floor(a/60000);if(r<1)return"just now";if(r<60)return`${r}m ago`;let i=Math.floor(r/60);if(i<24)return`${i}h ago`;let o=Math.floor(i/24);if(o<30)return`${o}d ago`;return e.toLocaleDateString()}function ea(){return[{category:"Source Control",id:"git.init",level:"project",menus:["commandbar/overflow","palette"],group:"7_scm",requires:"an open project that git is not already tracking",when:(t)=>t.project.open,enablement:(t)=>!t.project.isRepo,run:async()=>{await Mt()},title:"Initialize Repository"},{category:"Source Control",id:"git.createGithubRepository",level:"project",menus:["commandbar/overflow","palette"],group:"7_scm",requires:"a project tracked by git",when:(t)=>t.project.open,enablement:(t)=>t.project.isRepo,run:async()=>{await O({projectName:D?.name||"my-project"})},title:"Create GitHub Repository"},{category:"Source Control",id:"git.push",level:"project",menus:["commandbar/overflow","palette"],group:"7_scm",requires:"a project tracked by git",when:(t)=>t.project.open,enablement:(t)=>t.project.isRepo,run:async()=>{await Ee()},title:"Push"},{category:"Source Control",id:"git.signInToGithub",level:"application",menus:["palette"],group:"7_scm",run:async()=>{await Le()},title:"Sign In to GitHub"}]}function h1(t){t.registerAll(ea())}function zf(){if(C)clearInterval(C),C=null;Ut()}function p1(){qn({id:"git",title:"Source Control",railLabel:"Source",level:"project",dock:"navigator",icon:"git-branch",badge:(t)=>t.git.dirtyCount||null,render:()=>tt,afterRender:(t,e)=>{Qe(e,t.deps)}})}
|
|
2
|
-
export{
|
|
1
|
+
import{Sn,u1,m,u,Mr,ui}from"./studio-a2ke1e4t.js";import{ge,Q,y,jr,C}from"./studio-55h4mstj.js";import{R1,p,Ve}from"./studio-xz2yxfcb.js";import{Qt}from"./studio-5tnvjkz4.js";import{te}from"./studio-ery42sqr.js";import{Ji,Tm,Tp,Bd,th}from"./studio-gx4dnjzd.js";import{pn,an}from"./studio-9mccjwjh.js";import{v}from"./studio-t1xzawhr.js";import{SC,kC,Sm}from"./studio-gf0fz03c.js";import{tt}from"./studio-1q1sh2ax.js";import{ot,Qi,zt,T,I,An,Ct,to,Pn,N1}from"./studio-g1shz58g.js";import{ba,cT,ya,uT,jb,hT}from"./studio-7zx31knw.js";import{Kn}from"./studio-rc6dvxjb.js";import{jw}from"./studio-vrmcjf9g.js";import{NE}from"./studio-4dwbj6gb.js";import{xb,AE,_b,DS}from"./studio-4tanh828.js";import{xR,D,CR,Fr}from"./studio-yn9f8vtx.js";import{Ie}from"./studio-0bhx5hz6.js";import{me}from"./studio-pre0skq6.js";var Y={$schema:"https://jxsuite.com/schema/v1",$id:"StudioMediaPane",$description:"The Media viewer: a pane that SHOWS a file the studio has no document model for — an image at its own size, a video or audio player, an embedded PDF, a font set in a pangram, or an honest line about a format nothing here can draw. The adapter hands in one projection: which of the six stages to draw, the URL that loads it, the file's name and facts, the reference a document would write for it, and the documents that already do. Nothing here decides anything; a control asks the host to copy, to open a path, or to record the pixel size the browser just learned.",tagName:"div",attributes:{part:"viewer","data-jx-region":"${state.region}"},style:{$description:"What `.media-viewer`, `.media-stage`, `.media-image`, `.media-video`, `.media-embed`, `.media-audio`, `.media-specimen`, `.media-specimen-line`, `.media-unviewable`, `.media-note`, `.media-details`, `.media-name`, `.media-facts`, `.media-ref`, `.media-ref-value`, `.media-usage`, `.media-usage-title`, `.media-usage-headline`, `.media-usage-list`, `.media-usage-link` and `.media-usage-count` said in `styles/overlays.css`, keyed on `part` and re-pointed at the studio token layer. All twenty-two were this surface's alone, so the stylesheet block goes with the conversion rather than being copied. Eight `var(--spectrum-font-size-…)` names could not come with the declarations: every one of them resolves only inside `<sp-theme>`, and this document is mounted in a pane stage that is outside it, so each would silently have taken its hex fallback — they are the kit's `--jx-text-xs`, `--jx-text-sm`, `--jx-text-md` and `--jx-text-lg` instead.",height:"100%",display:"flex",gap:"var(--jx-space-5)",padding:"var(--jx-space-5)",overflowY:"auto",background:"var(--bg-panel)",fontFamily:"var(--jx-font-sans)",color:"var(--fg)",'& [part="asset-slot"], & [part="usage-slot"], & [part="list-slot"]':{$description:"A `$switch` renders its own container, and none of these three is a box: each stands exactly where its case does, so the case's own rule is the only one that lays anything out.",display:"contents"},'& [part="stage"]':{$description:"The asset takes the room and the details column keeps a fixed width, so the file is the thing being looked at and the facts about it are beside it rather than on top of it.",flex:"1",minWidth:"0",display:"flex",alignItems:"flex-start",justifyContent:"center"},'& [part="image"]':{$description:"Never larger than its own pixels: an upscaled thumbnail is a lie about the asset, and judging whether an imported image is big enough is the whole reason somebody opens this.",maxWidth:"100%",height:"auto",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"var(--bg-input)"},'& [part="video"], & [part="embed"]':{width:"100%",maxHeight:"70vh",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"var(--bg-input)"},'& [part="audio"]':{width:"100%"},'& [part="specimen"]':{$description:"A font is shown by being USED. The face itself arrives as a `@font-face` the adapter writes, under a family name generated from the path so two specimens open side by side cannot claim the same one; the element carries only that NAME, as a custom property, and the fallback stack that catches a face the browser refuses stays here where it is a rule rather than data.",width:"100%",padding:"var(--jx-space-5)",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"var(--bg-input)",color:"var(--fg)",fontFamily:"var(--jx-specimen-family, system-ui), system-ui, sans-serif"},'& [part="specimen-line"]':{margin:"0 0 var(--jx-space-4)",lineHeight:"1.3",overflowWrap:"anywhere"},'& [part="specimen-line"][data-size="48"]':{fontSize:"48px"},'& [part="specimen-line"][data-size="32"]':{fontSize:"32px"},'& [part="specimen-line"][data-size="24"]':{fontSize:"24px"},'& [part="specimen-line"][data-size="18"]':{fontSize:"18px"},'& [part="specimen-line"][data-size="14"]':{fontSize:"var(--jx-text-lg)"},'& [part="unviewable"]':{$description:"Not a failure state. A file the browser cannot render is a zip, or a format this build has never heard of, so the box says what the file IS and that the project still builds with it in.",padding:"var(--jx-space-6)",border:"1px dashed var(--border)",borderRadius:"var(--radius)",color:"var(--fg-dim)",textAlign:"center"},'& [part="note"]':{fontSize:"var(--jx-text-md)",color:"var(--fg-dim)"},'& [part="details"]':{flex:"0 0 260px",display:"flex",flexDirection:"column",gap:"var(--jx-space-4)"},'& [part="title"]':{margin:"0",fontSize:"var(--jx-text-lg)",color:"var(--fg)",overflowWrap:"anywhere"},'& [part="facts"]':{$description:'Kind, pixel size, bytes and modified date, joined by the adapter. Each is omitted rather than zeroed when it is not known: a real file can almost be `0 × 0` or `0 B`, so neither may double as "we did not find out".',margin:"0",fontSize:"var(--jx-text-md)",color:"var(--fg-dim)"},'& [part="ref"]':{$description:"The reference a document writes for this file — `/hero.jpg` for `public/hero.jpg`, which shares not one segment with it. Getting this wrong is the commonest way an image goes missing from a page, which is why it is on screen next to a button that copies it.",display:"flex",alignItems:"center",gap:"6px"},'& [part="ref-value"]':{flex:"1",minWidth:"0",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-sm)",background:"var(--bg-input)",border:"1px solid var(--border)",borderRadius:"var(--radius)",padding:"3px 6px",overflowWrap:"anywhere"},'& [part="usage"]':{display:"flex",flexDirection:"column"},'& [part="group-title"]':{margin:"0 0 var(--jx-space-2)",fontSize:"var(--jx-text-md)",fontWeight:"500",color:"var(--fg-dim)"},'& [part="message"]':{margin:"0",fontSize:"var(--jx-text-md)",color:"var(--fg-dim)"},'& [part="list"]':{listStyle:"none",margin:"var(--jx-space-3) 0 0",padding:"0",display:"flex",flexDirection:"column",gap:"var(--jx-space-1)"},'& [part="row"]':{display:"flex",alignItems:"baseline",gap:"6px",fontSize:"var(--jx-text-md)"},'& [part="file-path"]':{$description:'The path is a control, not a label: it opens the document that references this file. A plain button rather than a `jx-button`, for the reason the Problems rows give — what it has to look like is a line of text, and every fill, border and control height the kit draws would have to be taken back off again. Named `file-path` and not `path` because `jx-icon` puts `part="path"` on the `<path>` of every glyph it draws, so `[part="path"]` would select this button and any SVG path beside it.',flex:"1",minWidth:"0",margin:"0",padding:"0",background:"none",border:"none",borderRadius:"var(--jx-radius-xs)",textAlign:"left",color:"var(--accent)",cursor:"pointer",font:"inherit",overflowWrap:"anywhere",":hover":{textDecoration:"underline"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"2px"}},'& [part="count"]':{flex:"0 0 auto",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-xs)",color:"var(--fg-dim)"}},children:[{tagName:"div",attributes:{part:"stage"},children:[{tagName:"div",attributes:{part:"asset-slot",role:"none"},$switch:{$ref:"#/state/kind"},cases:{image:{tagName:"img",attributes:{part:"image",src:"${state.src}",alt:""},onload:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/imageLoaded"},value:[{$ref:"event#/target/naturalWidth"},{$ref:"event#/target/naturalHeight"}]}],description:"The only honest source of pixel dimensions in a browser is an image that has loaded, and this viewer is showing one at full size anyway. The host decides whether the numbers are new; a repeat load of the same picture must not repaint the pane."}},video:{tagName:"video",attributes:{part:"video",src:"${state.src}",controls:!0}},audio:{tagName:"audio",attributes:{part:"audio",src:"${state.src}",controls:!0}},embed:{tagName:"embed",attributes:{part:"embed",src:"${state.src}",type:"application/pdf",title:"${state.name}"}},font:{tagName:"div",attributes:{part:"specimen",style:"${state.specimenFamily}"},children:[{tagName:"style",textContent:"${state.fontFace}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"48"},textContent:"${state.specimen}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"32"},textContent:"${state.specimen}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"24"},textContent:"${state.specimen}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"18"},textContent:"${state.specimen}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"14"},textContent:"${state.specimen}"}]},unviewable:{tagName:"div",attributes:{part:"unviewable"},children:[{tagName:"p",children:[{tagName:"span",textContent:"Jx has no viewer for "},{tagName:"code",textContent:"${state.extLabel}"},{tagName:"span",textContent:"."}]},{tagName:"p",attributes:{part:"note"},textContent:"The file is in the project and builds normally."}]}}}]},{tagName:"div",attributes:{part:"details"},children:[{tagName:"h3",attributes:{part:"title"},textContent:"${state.name}"},{tagName:"p",attributes:{part:"facts"},textContent:"${state.facts}"},{tagName:"div",attributes:{part:"ref"},children:[{tagName:"code",attributes:{part:"ref-value"},textContent:"${state.ref}"},{tagName:"jx-action-button",$props:{size:"sm",quiet:!0,hint:"Copy the reference"},attributes:{part:"copy"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/copyRef"}}]},children:[{tagName:"span",textContent:"Copy"}]}]},{tagName:"div",attributes:{part:"usage-slot",role:"none"},$switch:{$ref:"#/state/usageState"},cases:{shown:{tagName:"div",attributes:{part:"usage"},children:[{tagName:"h4",attributes:{part:"group-title"},textContent:"Used by"},{tagName:"p",attributes:{part:"message"},textContent:"${state.usageHeadline}"},{tagName:"div",attributes:{part:"list-slot",role:"none"},$switch:{$ref:"#/state/hasUsageFiles"},cases:{true:{tagName:"ul",attributes:{part:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/usageFiles"},key:{$ref:"$map/item/path"},map:{tagName:"li",attributes:{part:"row","data-usage":"${$map.item.path}"},children:[{tagName:"button",attributes:{part:"file-path",type:"button"},textContent:"${$map.item.path}",onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openDocument"},value:[{$ref:"$map/item/path"}]}]}},{tagName:"span",attributes:{part:"count"},textContent:"${$map.item.count}"}]}}]}}}]}}}]}]};T("media-pane",Y);function et(t,e){t.region=e.region,t.name=e.name,t.kind=e.kind,t.src=e.src,t.facts=e.facts,t.ref=e.ref,t.specimen=e.specimen,t.specimenFamily=e.specimenFamily,t.fontFace=e.fontFace,t.extLabel=e.extLabel,t.usageState=e.usageState,t.usageHeadline=e.usageHeadline,t.usageFiles=e.usageFiles,t.hasUsageFiles=e.usageFiles.length>0}function at(t,e,a){t.replaceChildren();let r=y({copyRef:a.copyRef,extLabel:"",facts:"",fontFace:"",hasUsageFiles:!1,imageLoaded:a.imageLoaded,kind:"unviewable",name:"",openDocument:a.openDocument,ref:"",region:"",specimen:"",specimenFamily:"",src:"",usageFiles:[],usageHeadline:"",usageState:"hidden"});et(r,e);let i=null,o=!1,n=I("media-pane",r,t).then((s)=>{if(o)return s.dispose(),s.root;return i=s,s.root});return{attached:()=>{if(o)return!1;let s=i?.root;return s===void 0?!0:s instanceof HTMLElement&&t.contains(s)},dispose(){o=!0,i?.dispose(),i=null},ready:n,update:(s)=>et(r,s)}}var z="media",Ht=new Set([".woff",".woff2",".ttf",".otf"]),Ot="The quick brown fox jumps over the lazy dog",A=new Map;function H(t){return A.get(t)??null}function SS(t,e){let a=H(t);return a!==null&&a.tabId===e.id&&a.wrap.isConnected&&a.surface.attached()}function wb(t){let e=A.get(t);if(!e)return;e.scope.stop(),e.surface.dispose(),A.delete(t)}function Vt(t){let e=Ji(t);if(Ht.has(e))return"font";let a=Tp({name:t});if(a==="image"||a==="video"||a==="audio")return a;return e===".pdf"?"embed":"unviewable"}function _t(t,e){let a=[Tp({name:t})];if(e?.width!=null&&e.height!=null)a.push(`${e.width} × ${e.height}`);if(e?.bytes!=null)a.push(DS(e.bytes));if(e?.modified)a.push(`modified ${e.modified.slice(0,10)}`);return a.join(" · ")}function Jt(t){return`jx-specimen-${t.replaceAll(/[^a-zA-Z0-9]/g,"-")}`}function Wt(t){let e=hT(t);if(e===null)return{usageFiles:[],usageHeadline:"",usageState:"hidden"};return{usageFiles:(t?.status==="ready"?t.result.files:[]).map((r)=>({count:String(r.count),path:r.path})),usageHeadline:e,usageState:"shown"}}async function Bt(t){let{openFileInTab:e}=await (me("44vp8a2s"),import("./files-44vp8a2s.js"));await e(t)}function $E(t,e){let{paneId:a,wrap:r}=t;if(SS(a,e))return;wb(a);let i=e.documentPath??"",o=Jt(i),n=th(i),s=Bd(i),l=Ji(i),c=Vt(i),h=null,g=()=>{if(h!==null&&H(a)===h)f()},x=()=>{let k=xb(i),d=uT(i);if(k===null)AE(i).then(g);if(d===null||d.status==="pending")jb(i).then(g);return{extLabel:l||"this file",facts:_t(i,k),fontFace:c==="font"?`@font-face { font-family: "${o}"; src: url("${n}"); }`:"",kind:c,name:i.split("/").pop()??"",ref:s,region:Qi(a,"media"),specimen:Ot,specimenFamily:`--jx-specimen-family: "${o}"`,src:n,...Wt(d)}},f=()=>{h?.surface.update(x())},S=ge(),N=at(r,x(),{copyRef:()=>{navigator.clipboard?.writeText(s)},imageLoaded:(k,d)=>{if(_b(i,k,d))g()},openDocument:(k)=>{Bt(k)}});h={paneId:a,scope:S,surface:N,tabId:e.id,wrap:r},A.set(a,h),S.run(()=>{Q(()=>{if(H(a)!==h)return;e.documentPath,f()})})}var qt={children:[],tagName:"div"};function Pw(t){return Tm(t)}function Kt(t){return Ji(t)===".svg"?[z,"source"]:[z]}function IE(t,e={}){let a=m.tabs.get(t);if(a)return ui(t,{focus:e.focus!==!1}),a;return Mr({capabilities:{modes:Kt(t)},document:structuredClone(qt),documentPath:t,id:t,sourceFormat:null,...e.paneId!==void 0&&{paneId:e.paneId},...e.preview===!0&&{preview:!0},...e.focus===!1&&{focus:!1}})}var Xt={children:[],tagName:"div"},Zt=new Set(["bunfig.json","jsconfig.json","package-lock.json","package.json","tsconfig.json","wrangler.json"]);function tm(t){let e=t.slice(t.lastIndexOf("/")+1);if(Zt.has(e)||e.endsWith(".schema.json"))return!1;return t.endsWith(".json")||Boolean(Qt(t))}function rt(t,e){if(t.startsWith("../")||t.includes("/../"))return`"${t}" is outside this project, so its comparison belongs to the project that owns it.`;if(e==="R")return"A renamed file's comparison needs both paths, and Studio does not model the old name yet.";if(Pw(t))return`"${t}" is an image or media file, and a comparison of one is not text.`;return null}function Yt(){return["git-diff"]}function ee(t){let e=m.tabs.get(t);if(e)return ui(t),e;return Mr({capabilities:{modes:Yt()},document:structuredClone(Xt),documentPath:t,id:t,sourceFormat:null})}async function it(t){if(!tm(t))return ee(t);let e=await (me("44vp8a2s"),import("./files-44vp8a2s.js"));return await e.openFileInTab(t,{})??[...m.tabs.values()].find((r)=>r.documentPath===t)??null}var j=[];function ae(){return Ve()&&typeof p().listProjects==="function"}async function Ow(){if(!ae()){j=[];return}try{j=await p().listProjects?.()??[]}catch{j=[]}}function LE(){return j}function nt(t){j=t}var st=2,re=1e4;class lt extends Error{blockedBy;constructor(t,e){super(t.length===0?`Studio did not report ${st} consecutive quiet frames within ${e}ms`:`Studio was not idle after ${e}ms — blocked by ${t.join("; ")}`);this.name="NotIdleError",this.blockedBy=t}}function ct(){return[{blockers:()=>{let t=CR();return t>0?[`render: ${t} renderer(s) mid-paint`]:[]},name:"render"},{blockers:SC,name:"canvas"},{blockers:()=>{let t=R1();if(t.length===0)return[];return[`platform: ${t.length} in-flight (${[...new Set(t)].join(", ")})`]},name:"platform"},{blockers:N1,name:"overlay"},{blockers:cT,name:"activity"},{blockers:NE,name:"grid"}]}function ie(t=ct()){let e=[];for(let a of t)e.push(...a.blockers());return e}function pt(t={}){let{frames:e=st,now:a=()=>Date.now(),raf:r=(n)=>{requestAnimationFrame(()=>n())},sources:i=ct(),timeoutMs:o=re}=t;return new Promise((n,s)=>{let l=a()+o,c=0,h=!1,g=[],x=()=>{if(h)return;let f=ie(i);if(f.length>0)g=f,c=0;else if(c+=1,c>=e){h=!0,n();return}if(a()>=l){h=!0,s(new lt(f.length>0?f:g,o));return}r(x)};r(x)})}var dt=/\.toggle[A-Z]/;function oe(t){return t.replace(/\.toggle([A-Z])/,(e,a)=>`.set${a}`)}function ut(t){return!dt.test(t.id)}var ne={"file.contextMenu":{disposition:"refused",note:"opening a menu to press an item names a control; the ITEM is the command"},"layers.contextMenu":{disposition:"refused",note:"matched RENDERED TEXT, which R1 of scripts/screenshots/README.md forbids; a row is addressed by its data-jx-path"},"media.browse":{disposition:"command",note:"media.browse, site-architecture.md §9.4"},"project.showWelcome":{disposition:"refused",note:"cold start is a startup profile (?profile=fresh), not an action"},"settings.setSection":{disposition:"refused",note:`mirrored the section registry's LABELS; say settings.open { section: "cssVars" }`},"view.setStatus":{disposition:"refused",note:"the status bar is not staged — if a capture needs a calm shell, the app must BE calm"}},se={openSettings:'a user opens Settings — run("settings.open")',select:'a user selects a node — run("selection.set", { path })',setActivity:'a user picks a Navigator panel — run("navigator.showPanel", { panel })',setRightTab:'a user picks an Inspector tab — run("inspector.setTab", { tab })',setStatus:"the status bar reports what the app just did; staging it is the one lie the Remote Rule (studio.md §13.5) names outright",setZoom:'a user zooms — run("canvas.setZoom", { zoom })'};function O(t,e){let a=t[e];if(a===void 0)return[];if(!Array.isArray(a))throw TypeError(`seed argument "${e}" must be an array`);return a}function le(t,e){let a=t[e];if(a===null||typeof a!=="object")throw TypeError(`seed argument "${e}" must be an object`);return a}function ce(t,e){let a=t[e];if(a===void 0)return;if(typeof a!=="string")throw TypeError(`seed argument "${e}" must be a string`);return a}function pe(t){return[{boundary:"the assistant's model stream",id:"seed.assistant",run:(e)=>{t.seedAssistantMessages(O(e,"messages"))}},{boundary:"the collaboration websocket (awareness + sync)",id:"seed.collab",run:(e)=>{let a=u.value;if(!a)return;let r=Sn(a);r.status="synced",r.active=!0;let i=[];for(let o of O(e,"peers")){let n={...o.state};n.focusedPath??=a.documentPath,i.push({...o,state:n})}r.peers=i,Fr()}},{boundary:"the Cloudflare Pages API",id:"seed.publish",run:(e)=>{let a=ce(e,"accountId");t.seedPublishConnected({deployment:le(e,"deployment"),...a?{accountId:a}:{}})}},{boundary:"the platform's git routes (`gitStatus` / `gitBranches` / `gitLog`)",id:"seed.git",run:(e)=>{v.git.status=e.status??null,v.git.branches=e.branches??null,v.git.logEntries=e.log??null,v.git.loading=!1,v.git.error=null,Fr()}},{boundary:"the platform's recent-projects store (desktop IPC / cloud API)",id:"seed.projectList",run:(e)=>{nt(O(e,"projects")),Fr()}}]}class V extends Error{id;constructor(t,e){super(`automation refuses "${t}" — ${e}`);this.name="AutomationRefusedError",this.id=t}}function de(t){let e=[];for(let a of t.visible()){if(!ut(a))continue;let r=t.disabledReason(a.id),i={enabled:r===void 0,id:a.id,title:a.title};if(a.args)i.args=a.args;if(r!==void 0)i.requires=r;e.push(i)}return e}function ue(t,e,a){if(a.has(t))return`"${t}" is a seed, not a command — call seed("${t}", …)`;let r=ne[t];if(r?.disposition==="refused")return`"${t}" is refused by spec §13.5: ${r.note}`;if(r)return`"${t}" has no command record yet (${r.note}) — __jxAutomation.run projects the registry and nothing else`;let i=e.list().filter((o)=>ut(o)).map((o)=>o.id);return`unknown command "${t}" — the registry declares ${i.length} scriptable id(s)`}function he(t){let e=new Map(pe(t).map((r)=>[r.id,r])),a=new Set(e.keys());return{probe:{commands:()=>de(t.registry),idle:(r={})=>pt(r),pointAt:(r)=>kC(r.path),revealPath:(r)=>Sm(r),seeds:()=>[...e.values()].map((r)=>({boundary:r.boundary,id:r.id})),state:()=>t.registry.context()},async run(r,i={}){if(dt.test(r))throw new V(r,`it names a delta against state the caller cannot observe; call "${oe(r)}"`);let{registry:o}=t;if(!o.get(r))throw Error(ue(r,o,a));await o.run(r,i)},async seed(r,i={}){let o=r.startsWith("seed.")?r.slice(5):r,n=se[o];if(n)throw new V(r,`a seed stands in for a remote, never for a user: ${n}`);let s=e.get(r.startsWith("seed.")?r:`seed.${r}`);if(!s)throw Error(`unknown seed "${r}" — declared seeds are ${[...e.keys()].join(", ")}`);await s.run(i)}}}function yb(t){return new URLSearchParams(t).get("automation")==="1"}function RE(t){if(!yb(location.search))return!1;return globalThis.__jxAutomation=he(t),!0}var mt={$schema:"https://jxsuite.com/schema/v1",$id:"StudioJxsuiteUpdate",$description:"The on-open offer to bring a project's `@jxsuite/*` dependencies up to their newest published versions: one sentence, and the packages that would move. A `jx-dialog`, so the platform owns modality, Escape, focus restoration and the backdrop, and the kit draws both answers. Nothing here asks the registry or writes a manifest: `packages/jxsuite-update.ts` keeps the lookup, the dismissal key and the install, and this document only says what is on offer.",tagName:"jx-dialog",$props:{headline:"Update @jxsuite packages?",confirmLabel:"Update",cancelLabel:"Not now",size:"sm"},attributes:{part:"jxsuite-update"},onconfirm:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/confirm"},value:[]}]},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/cancel"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},style:{$description:'The old body was a lit template with no stylesheet at all, which is why the conversion is mostly a deletion. Two `<br />`s stood in for a paragraph break, and one `<span style="white-space: pre-line">` held every package as a single `\\n`-joined string — a list spelled as whitespace. Neither is addressable and neither announces as what it is, so a screen reader read one run-on line and a test could only match a substring of it. It is a `<ul>` of keyed rows now: the list says how many packages there are, and each row is `[data-package]`. The one token repair travels with it — that span asked for `--spectrum-font-size-75`, which resolves only inside `<sp-theme>`, and a document mounted in the dialog layer is outside it, so the size silently fell back to the hard-coded `12px` written beside it.','& [part="offer"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)"},'& [part="lede"]':{margin:"0"},'& [part="list"]':{$description:"Capped and scrolling, because the count is the registry's rather than this dialog's: a project that has not been opened in a year can have every `@jxsuite/*` package behind at once, and a dialog that grows past the viewport puts its own Update button off screen.",listStyle:"none",margin:"0",padding:"0",display:"flex",flexDirection:"column",gap:"var(--jx-space-1)",maxHeight:"240px",overflowY:"auto"},'& [part="package"]':{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:"var(--jx-space-3)",fontSize:"var(--jx-text-sm)"},'& [part="package-name"]':{color:"var(--fg)"},'& [part="package-move"]':{$description:"Tabular figures, so a column of versions does not jitter between rows of different widths.",color:"var(--fg-dim)",fontVariantNumeric:"tabular-nums",whiteSpace:"nowrap"}},children:[{tagName:"div",attributes:{part:"offer"},children:[{tagName:"p",attributes:{part:"lede"},textContent:"Newer versions of these packages have been published. Update the project to them?"},{tagName:"ul",attributes:{part:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/packages"},key:{$ref:"$map/item/name"},map:{tagName:"li",attributes:{part:"package","data-package":"${$map.item.name}"},children:[{tagName:"span",attributes:{part:"package-name"},textContent:"${$map.item.name}"},{tagName:"span",attributes:{part:"package-move"},textContent:"${$map.item.current} → ${$map.item.target}"}]}}]}]}]};T("jxsuite-update",mt);function ht(t){let e=document.createElement("div");e.style.pointerEvents="auto",e.setAttribute(ot,zt("dialog","jxsuite-update")),t.layer.append(e);let a=!1,r=()=>{if(a)return;a=!0,t.onClosed()},i=y({cancel:()=>{t.onCancel()},closed:r,confirm:()=>{t.onConfirm()},packages:t.packages}),o=null,n=I("jxsuite-update",i,e).then(async(s)=>{o=s;let l=s.root;if(a)return s.dispose(),l;if(await An(l),a)return l;return pn(l),l});return{close(){let s=o?.root;if(s instanceof HTMLElement)an(s);o?.dispose(),o=null,e.remove(),r()},host:e,ready:n}}function vb(t){return t.replace(/^[\^~>=<v\s]+/,"").trim().split(/\s+/)[0]??""}function gt(t){if(t.includes(":"))return!1;return/^\d+\.\d+/.test(vb(t))}function ft(t){let e=vb(t).split(/[-+]/)[0]??"",[a=0,r=0,i=0]=e.split(".").map((o)=>Math.trunc(Number(o))||0);return[a,r,i]}function be(t,e){let a=ft(t),r=ft(e);for(let i=0;i<3;i++){let o=a[i]??0,n=r[i]??0;if(o!==n)return o<n?-1:1}return 0}function Aw(t,e){if(!gt(t)||!gt(e))return!1;return be(e,t)>0}var ye="@jxsuite/";async function _(){let t=p();if(!t.packageVersions)return[];let e;try{e=await t.packageVersions()}catch{return[]}let a=[];for(let r of e)if(r.name.startsWith(ye)&&Aw(r.current,r.latest))a.push({current:r.current,dev:Boolean(r.dev),latest:r.latest,name:r.name});return a}function bt(t,e){let a=e.map((r)=>`${r.name}@${r.latest}`).toSorted().join(",");return`jx:jxsuite-update-dismissed:${t}:${a}`}function we(t,e){try{return localStorage.getItem(bt(t,e))==="1"}catch{return!1}}function ve(t,e){try{localStorage.setItem(bt(t,e),"1")}catch{}}async function J(t){let e=p();if(!e.setPackageVersions||t.length===0)return;let a=ya({status:"Updating @jxsuite packages…",title:"Updating dependencies"});try{let r=await e.setPackageVersions(t.map((i)=>({dev:i.dev,name:i.name,version:`^${i.latest}`})));if(r.ok)a.done(),C.success(`Updated ${t.length} @jxsuite package(s) to their latest versions.`);else a.fail(r.log??"Update failed")}catch(r){a.fail(r instanceof Error?r.message:String(r))}}function xe(t){return new Promise((e)=>{let a=!1,r=(s)=>{if(a)return;a=!0,e(s)},i=!1,o=()=>{if(i)return;i=!0,n.close()},n=ht({layer:Ct("dialog"),onCancel:()=>{o()},onClosed:()=>{r(!1),o()},onConfirm:()=>{r(!0),o()},packages:t.map((s)=>({current:s.current,name:s.name,target:`^${s.latest}`}))})})}async function mp(t){if(yb(location.search))return;if(!p().setPackageVersions)return;let a=await _();if(a.length===0||we(t,a))return;if(!await xe(a)){ve(t,a);return}await J(a)}var R=["package.json","bun.lock","bun.lockb"],$e=new Set(["??","U"]),Se=25,ke="@jxsuite/";function M(t){return typeof t==="object"&&t!==null&&!Array.isArray(t)}function G(t){if(Array.isArray(t))return t.map((e)=>G(e));if(M(t)){let e={};for(let a of Object.keys(t).toSorted())e[a]=G(t[a]);return e}return t}function yt(t){let e={...t};for(let a of["dependencies","devDependencies"]){let r=e[a];if(!M(r))continue;let i={...r};for(let o of Object.keys(i))if(o.startsWith(ke))i[o]="*";e[a]=i}return e}function je(t,e){if(t===null||e===null)return!1;let a,r;try{a=JSON.parse(t),r=JSON.parse(e)}catch{return!1}if(!M(a)||!M(r))return!1;return JSON.stringify(G(yt(a)))===JSON.stringify(G(yt(r)))}async function F(t,e){try{return await p().gitShow({path:t,ref:e})}catch{return null}}async function vt(t){try{return await p().readFile(t)}catch{return null}}async function xt(t){let e=[],a=[],r=!0;for(let i of R){let o=t.files.filter((l)=>l.path===i);if(o.length===0)continue;let n=await F(i,"@{u}");if(o.every((l)=>$e.has(l.status))){if(n!==null)a.push(i);continue}let s=await F(i,"HEAD");if(n===null||n===s)continue;if(e.push(i),i==="package.json")r&&=je(s,await vt(i))}return{automated:r,discard:e,removeUntracked:a}}function $t(t){return t.discard.length===0&&t.removeUntracked.length===0}async function Pe(t){let e=[...new Set(t.files.filter((a)=>!R.includes(a.path)).map((a)=>a.path))];if(e.length>Se)return!0;for(let a of e){let r=await F(a,"@{u}");if(r!==null&&r!==await F(a,"HEAD"))return!0}return!1}async function Ce(t){let e=p();if(t.discard.length>0)await e.gitUnstage(t.discard),await e.gitDiscard(t.discard);for(let a of t.removeUntracked)await e.deleteFile(a)}async function W(){let t=p(),e=[];try{e=await _()}catch{e=[]}if(e.length>0&&t.setPackageVersions){await J(e);return}if(!t.installDependencies)return;let a=ya({status:"Running bun install…",title:"Syncing dependencies"});try{let r=await t.installDependencies();if(r.ok)a.done();else a.fail(r.log??"bun install failed")}catch(r){a.fail(te(r))}}async function St(t){let e=p();try{await Ce(t)}catch(a){throw Error(`Could not reset local package files: ${te(a)}`,{cause:a})}try{await e.gitPull()}catch(a){throw await W(),a}C.warn("Local package updates were superseded by pulled changes.",{source:"Source Control"}),await W()}async function Ne(t){let e=p(),a;try{a=await e.gitStatus()}catch{throw t}if(!(a.behind>0))throw t;let r=await xt(a);if($t(r)||await Pe(a))throw t;if(!r.automated){if(!await to("Discard local package changes?","package.json / bun.lock have local edits that conflict with incoming changes. Discard them, pull, and re-sync packages?",{confirmLabel:"Discard and pull",destructive:!0}))throw t}await St(r)}async function wt(){let t;try{let e=await p().listDirectory("");t=new Set(e.filter((a)=>a.type==="file").map((a)=>a.name))}catch{t=new Set(R)}return Promise.all(R.map((e)=>t.has(e)?vt(e):Promise.resolve(null)))}async function B(){let t=p(),e=await wt(),a=null;try{await t.gitFetch(),a=await t.gitStatus()}catch{a=null}if(a&&a.behind>0){let i=await xt(a);if(!$t(i)&&i.automated){await St(i);return}}try{await t.gitPull()}catch(i){await Ne(i);return}let r=await wt();if(e.some((i,o)=>i!==r[o]))await W()}async function gp(){let t=p(),e;try{e=await t.gitStatus()}catch{return}if(!e?.isRepo||(e.remotes?.length??0)===0)return;C.info("Syncing project…",{key:"project.sync",source:"Source Control"});try{await B()}catch(a){C.warn("The project could not be synced with its remote.",{detail:te(a),key:"project.sync",source:"Source Control",tier:"problem"})}}var kt={$schema:"https://jxsuite.com/schema/v1",$id:"StudioGithubPublish",$description:"Create GitHub Repository: the three things the flow needs before it calls the API — the repository's name, an optional description, and whether it is private. A `jx-dialog`, so the platform owns modality, Escape, focus restoration and the backdrop, and the kit draws both answer buttons. Nothing here reaches GitHub: `github/github-publish.ts` keeps the token, the request and the activity, and this document only collects.",tagName:"jx-dialog",$props:{headline:"Create GitHub Repository",confirmLabel:"Create Repository",cancelLabel:"Cancel",size:"sm"},attributes:{part:"github-publish"},onconfirm:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/confirm"},value:[]}]},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/cancel"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},style:{$description:'What is NOT here is most of the conversion. `.github-publish-dialog` was a flex column with an 8px gap and `8px 0` of padding: the gap is the one thing it said that nothing else draws, and `jx-dialog`\'s own body already pads the content, so only the gap survives. `.github-publish-dialog sp-textfield { width: 100% }` had nothing to transcribe either — a `jx-field` row is a grid whose control cell stretches, so the field fills the row without being told to. The three `sp-field-label`s are gone with them, because `jx-field` draws the label AND names the control from it; the third of them carried no `for` at all, so "Visibility" was text beside a switch rather than a name for it.','& [part="rows"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)"}},children:[{tagName:"div",attributes:{part:"rows"},children:[{tagName:"jx-field",$props:{span:!0,label:"Repository name"},attributes:{part:"row","data-field":"name"},children:[{tagName:"jx-textfield",$props:{placeholder:"my-project",value:{$ref:"#/state/name"}},attributes:{part:"field"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setName"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"Description (optional)"},attributes:{part:"row","data-field":"description"},children:[{tagName:"jx-textfield",$props:{placeholder:"A brief description",value:{$ref:"#/state/description"}},attributes:{part:"field"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setDescription"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"Visibility"},attributes:{part:"row","data-field":"visibility"},children:[{tagName:"div",$description:'The row opens with a plain `div`, and that is the whole reason it exists: `jx-field` names the first thing slotted into it that observes `labelledby`, so a switch slotted straight in would be announced "Visibility" over the top of the words printed beside it. A `div` observes no naming, so the switch keeps the name its own label gives it.',attributes:{part:"visibility-row"},children:[{tagName:"jx-switch",attributes:{part:"toggle"},$props:{checked:{$ref:"#/state/isPrivate"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setPrivate"},value:[{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Private repository"}]}]}]}]}]};T("github-publish",kt);function jt(t){let e=document.createElement("div");e.style.pointerEvents="auto",e.setAttribute(ot,zt("dialog","github-publish")),t.layer.append(e);let a=!1,r=()=>{if(a)return;a=!0,t.onClosed()},i=y({cancel:()=>{t.onCancel()},closed:r,confirm:()=>{t.onConfirm({description:i.description,isPrivate:i.isPrivate,name:i.name})},description:"",isPrivate:!0,name:t.name,setDescription:(l)=>{i.description=l},setName:(l)=>{i.name=l},setPrivate:(l)=>{i.isPrivate=l}}),o=null,n=I("github-publish",i,e).then(async(l)=>{o=l;let c=l.root;if(a)return l.dispose(),c;if(await An(c),a)return c;return pn(c),c});return{close(){if(a)return;let l=o?.root;if(l instanceof HTMLElement)an(l);o?.dispose(),o=null,e.remove(),r()},host:e,ready:n}}var E=["Create the repository","Add the remote","Push"];function Re(t){return new Promise((e)=>{let a=!1,r=(o)=>{if(a)return;a=!0,e(o)},i=jt({layer:Ct("dialog"),name:t,onCancel:()=>{i.close()},onClosed:()=>{r(null)},onConfirm:(o)=>{r({...o,name:o.name||t}),i.close()}})})}async function q({projectName:t}){let e=await jw();if(!e)return!1;let a=await Re(t);if(!a)return!1;let r=ba({source:"Source Control",status:`Creating ${a.name}…`,steps:[...E],title:"Create GitHub repository"});r.step(E[0]);let i=await fetch("https://api.github.com/user/repos",{body:JSON.stringify({auto_init:!1,description:a.description,name:a.name,private:a.isPrivate}),headers:{Accept:"application/vnd.github+json",Authorization:`Bearer ${e}`,"Content-Type":"application/json"},method:"POST"}).catch((l)=>(r.log(te(l)),null));if(!i)return r.fail("Could not reach GitHub to create the repository.",{action:"git.createGithubRepository"}),!1;if(!i.ok){let l=await i.json();return r.log(l.errors?.[0]?.message||l.message||`GitHub answered ${i.status}.`),r.fail("Could not create the GitHub repository.",{action:"git.createGithubRepository"}),!1}let o=await i.json();r.log(`Created ${o.html_url}`);let n=p();r.step(E[1]);try{await n.gitAddRemote("origin",o.clone_url)}catch(l){return r.log(te(l)),r.fail("The repository was created, but the remote could not be added.",{action:"panel.focus.git"}),!1}r.step(E[2]);try{await n.gitPush({setUpstream:!0})}catch(l){return r.log(te(l)),r.fail("The repository was created, but the push failed.",{action:"git.push"}),!1}let{refreshGitStatus:s}=await (me("zngbymvd"),import("./git-panel-zngbymvd.js"));return await s(),r.done(o.html_url),C.success(`Repository created: ${o.html_url}`,{key:"github.repo"}),!0}var Pt={$schema:"https://jxsuite.com/schema/v1",$id:"StudioPanelGit",$description:"The Navigator's Source Control panel: what git says about this project, and every verb that answers. It has four moods and the adapter names which one — no project, a first read still in flight, a project git is not tracking yet, and a repository — so nothing here asks whether `status` is null or what `isRepo` means. Under the fourth mood it draws the sync bar (with or without a remote), the branch row, the two sub-tabs, and then either the commit form over the changed files or the log. `panels/git-panel.ts` keeps every decision: what a comparison is, which files group under which component, what a status letter reads aloud, what a commit does before it runs, and which of the four verbs a row's buttons are. Rows arrive as strings and booleans, keyed by path.",tagName:"div",attributes:{part:"git-panel"},style:{$description:"The sixty-odd `.git-*` rules in `styles/overlays.css`, keyed on `part` and carried here. Four token repairs travel with them, all of the shape `surfaces/panel-imports.json` describes: `--spectrum-font-size-75` and `--spectrum-font-size-50` resolved only inside `<sp-theme>` and a document is mounted outside it, so every rule that read one would silently have taken its px fallback — they are `--jx-text-md` (12px) and `--jx-text-sm` (11px) here, at the same values, and the bare `10px` literals are `--jx-text-xs`. The one deliberate move is the two headline values, the sync label and the branch name: they were 13px, which is not a step on the scale, and they take `--jx-text-lg` (14px). Three rules are DELETED rather than moved, because the kit already draws them: the sub-tab strip's own fill, hover and selected underline are `jx-tabs`/`jx-tab`, the branch picker's box is `jx-select`, and `.git-split-btn`'s hand-built dropdown is the kit menu (see `openCommitMenu`). And one is repaired: a row's action buttons were `opacity: 0` until the ROW was hovered, so tabbing to Stage moved the keyboard onto an invisible control — the reveal is `:focus-within` as well as `:hover`.",display:"flex",flexDirection:"column",height:"100%",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-md)",color:"var(--fg)",'& [part="empty"]':{$description:"Drawn here rather than borrowed from `panels/empty-state.ts`, which is a lit template a document cannot call. What is kept is the pattern's rules (studio-ui-guidelines.md §11): one sentence saying what the region is for, then the action that fills it.",display:"flex",flex:"1",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"var(--jx-space-3)",padding:"var(--jx-space-5)",textAlign:"center",color:"var(--fg-dim)"},'& [part="empty-message"]':{margin:"0",maxWidth:"34ch",lineHeight:"1.5"},'& [part="empty-actions"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-2)"},'& [part="sync-bar"]':{$description:'A wrapping row (studio-ui-guidelines.md §4.6), and it has exactly two items: `sync-head` (Refresh and the status, which never split) and what answers the status (the Fetch/Pull/Push group, or Create GitHub repository with no remote). It was a single line whose only shrinkable item was the status text, so a narrow Navigator never moved a button: it broke "3 behind / Last updated 09:04 AM" into a column one word wide (25px at the 160px floor) and painted "(no" under Create GitHub repository at the default 240px. Now the second item drops to a line of its own when the two no longer fit, and where that happens is decided by the status text\'s own width (a count, a locale\'s clock), never by a breakpoint. The row gap is the smaller step so a wrapped bar reads as one block.',display:"flex",flexWrap:"wrap",alignItems:"center",gap:"var(--jx-space-3) var(--jx-space-4)",padding:"var(--jx-space-4)",borderBottom:"1px solid var(--border)"},'& [part="sync-bar"][data-remote="none"], & [part="sync-bar"][data-remote="none"] > [part="sync-head"]':{$description:"The no-remote bar keeps its tighter 8px between Refresh and the sentence, and on both axes: the head carries that gap now that Refresh and the text sit in it rather than in the bar.",gap:"var(--jx-space-3)"},'& [part="sync-head"]':{$description:"Refresh and the status, as one item of the bar, so wrapping never leaves the icon alone on a line above its text. `flex: 1 1 auto` makes its basis the status text's own width, which is the wrap threshold; with `min-width: 0` it can then shrink below that when it is alone on a line, and the status wraps as a sentence rather than word by word.",display:"flex",flex:"1 1 auto",alignItems:"center",gap:"var(--jx-space-4)",minWidth:"0"},'& [part="sync-text"]':{$description:"`1 1 auto` rather than `1`: the head's basis decides whether the verbs fit beside it, and it should be the status text's own width. An auto basis says that directly; the `0%` basis of `flex: 1` only reaches the same answer through how an engine treats a percentage while it measures.",display:"flex",flex:"1 1 auto",flexDirection:"column",gap:"1px",minWidth:"0"},'& [part="sync-label"]':{fontSize:"var(--jx-text-lg)",fontWeight:"600",color:"var(--fg)"},'& [part="sync-time"]':{fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="sync-actions"]':{$description:"The verbs never shrink: they are what moves. `margin-left: auto` keeps them at the inline end whether they share the status's line or sit on one of their own.",display:"flex",flex:"none",marginLeft:"auto"},'& [part="branch-row"]':{$description:'A wrapping row (studio-ui-guidelines.md §4.6) of two items, `branch-head` and the picker. It was a single line with the picker capped at 40% of it, so a long branch name was cut twice ("chor…" beside "cho…") and a narrow Navigator word-stacked "Active / branch". Now the picker drops below the name when the two no longer fit, at a width the name decides.',display:"flex",flexWrap:"wrap",alignItems:"center",gap:"var(--jx-space-3) var(--jx-space-4)",padding:"10px var(--jx-space-4)",borderBottom:"1px solid var(--border)"},'& [part="branch-head"]':{$description:"The branch icon and the name, as one item so the icon is never alone on a line. The 999:1 grow ratio against the picker gives nearly all spare room to the name while the two share a line, so the picker stays the width of the branch it shows; once the picker wraps, it is alone and takes the whole line. A third item in this row needs its own flex decision.",display:"flex",flex:"999 1 auto",alignItems:"center",gap:"var(--jx-space-4)",minWidth:"0"},'& [part="branch-icon"]':{$description:"The hand-drawn 18px branch SVG this panel carried is the kit's `git-branch` glyph — the same key `PanelRecord.icon` already names for this panel's rail button, so the two drawings cannot drift.",flex:"none","--jx-icon-size":"18px",color:"var(--fg-dim)"},'& [part="branch-text"]':{display:"flex",flex:"1 1 auto",flexDirection:"column",gap:"1px",minWidth:"0"},'& [part="branch-label"]':{fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="branch-name"]':{overflow:"hidden",fontSize:"var(--jx-text-lg)",fontWeight:"600",color:"var(--fg)",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="branch-picker"]':{$description:"Sized by the branch it shows while it shares the name's line, and the full width of the row once it wraps below it, which is where a long branch name finally reads whole. `min-width: 0` is the kit's own default, restated because studio-ui-guidelines.md §4.6 asks it of every flex child: when even a line of its own is narrower than the name, the picker shrinks and the kit's preview ellipsizes.",flex:"1 1 auto",minWidth:"0"},'& [part="tab"]':{$description:`The sub-tabs may shrink below their labels. A flex item's automatic minimum is its content, and a tab's label is nowrap, so "Local Changes (3)" and "History" held 179px against the 159px the Navigator has at its 160px floor and scrolled the whole panel sideways; the kit's label ellipsis could never engage. \`inspector-dock.json\` makes the same call for its tabs. It is a surface decision and not a kit default because the document tab strip deliberately scrolls instead.`,minWidth:"0"},'& [part="create-repository"] > [part="control"], & [part="init"] > [part="control"], & [part="clone"] > [part="control"], & [part="commit-button"] > [part="control"]':{$description:`The panel's labelled buttons wrap their words at the Navigator's floor instead of overflowing it. The kit's control is nowrap, which is right for a toolbar and made each label a floor of its own: "Create GitHub repository" held 165px in a 135px sync bar, "Clone Git Repository" and "Initialize Repository" held 141px and 135px in the empty state's 127px, and "Commit and sync" beside its menu had about a pixel to spare in the commit form's 135px. Nothing changes where the label fits, because a nowrap label and a wrapping one have the same max-content width. This reaches into the kit's \`control\` part as \`commandbar.json\` does for its primary button.`,whiteSpace:"normal"},'& [part="commit"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)",padding:"var(--jx-space-4)",borderBottom:"1px solid var(--border)"},'& [part="commit-label"]':{fontWeight:"500",color:"var(--fg-dim)"},'& [part="commit-actions"]':{display:"flex",gap:"var(--jx-space-2)"},'& [part="commit-button"]':{flex:"1"},'& [part="section"]':{borderBottom:"1px solid var(--border)"},'& [part="section-header"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-3)",padding:"var(--jx-space-3) var(--jx-space-4) 6px",fontWeight:"700",color:"var(--fg)"},'& [part="count"]':{$description:"The pill beside a section title. `margin-inline-end: auto` is what pushes the section's own button to the right edge — it was a second rule (`.git-section-header .git-count`) over the same element, and there is only one place a count is drawn.",display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:"18px",height:"18px",marginInlineEnd:"auto",padding:"0 5px",borderRadius:"9px",background:"var(--accent-15)",color:"var(--accent)",fontSize:"var(--jx-text-xs)",fontWeight:"600"},'& [part="group"]':{marginBottom:"var(--jx-space-1)"},'& [part="group-header"]':{display:"flex",alignItems:"center",gap:"6px",padding:"var(--jx-space-2) var(--jx-space-3)"},'& [part="group-name"]':{fontWeight:"500",color:"var(--fg)"},'& [part="file-row"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-2)",padding:"var(--jx-space-1) var(--jx-space-3) var(--jx-space-1) var(--jx-space-5)"},'& [part="file-row"]:hover':{background:"var(--hover-bg)"},'& [part="file-open"]':{$description:"A REAL button, because it does something. It was a bare span with a cursor and a `title`: not focusable, no role, and Enter did nothing — so the panel's primary verb was mouse-only. A `<button>` needs no role, no tabindex and no key handler of its own, which is three lines of the old row that simply go.",display:"flex",flex:"1",alignItems:"baseline",gap:"6px",minWidth:"0",margin:"0",padding:"0",overflow:"hidden",border:"none",borderRadius:"var(--radius)",background:"none",color:"inherit",font:"inherit",textAlign:"left",cursor:"pointer",":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"-2px"}},'& [part="file-name"]':{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="file-dir"]':{overflow:"hidden",color:"var(--fg-dim)",fontSize:"var(--jx-text-xs)",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="file-actions"]':{$description:"Revealed on `:focus-within` as well as on the row's hover. Opacity alone hid a control the keyboard could still reach: tabbing through a changed file landed on an invisible Stage button.",display:"flex",flex:"none",opacity:"0"},'& [part="file-row"]:hover [part="file-actions"], & [part="file-actions"]:focus-within':{opacity:"1"},'& [part="badge"]':{$description:"One letter and a colour, which is why every row's open button carries the status in words as well.",flex:"none",width:"16px",color:"var(--signal)",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-xs)",fontWeight:"700",textAlign:"center"},'& [part="badge"][data-status="A"], & [part="badge"][data-status="U"]':{color:"var(--success)"},'& [part="badge"][data-status="D"]':{color:"var(--danger)"},'& [part="badge"][data-status="R"], & [part="badge"][data-status="C"]':{color:"var(--tag)"},'& [part="history"]':{flex:"1",overflowY:"auto",padding:"var(--jx-space-2) 0"},'& [part="history-list"]':{margin:"0",padding:"0",listStyle:"none"},'& [part="history-entry"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-1)",padding:"6px var(--jx-space-4)",borderBottom:"1px solid var(--border)"},'& [part="history-entry"]:hover':{background:"var(--hover-bg)"},'& [part="history-hash"]':{color:"var(--accent)",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-xs)"},'& [part="history-message"]':{color:"var(--fg)"},'& [part="history-meta"]':{color:"var(--fg-dim)",fontSize:"var(--jx-text-xs)"},'& [part="status"]':{margin:"0",padding:"var(--jx-space-3)",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)",textAlign:"center"},'& [part="failure"]':{$description:"The panel's own refusal banner. It is `failure` rather than `error` because the branch picker and the commit field each draw a permanent, empty `[part=\"error\"]` of their own inside this same light-DOM tree: under that name this padding, rule and wash drew a 16×13 box over both fields' top-left corners that took the click, and dressed either field's real refusal sentence as a banner.",margin:"0",padding:"6px var(--jx-space-3)",borderBottom:"1px solid var(--border)",background:"color-mix(in srgb, var(--danger) 8%, transparent)",color:"var(--danger)",fontSize:"var(--jx-text-sm)"},"@(forced-colors: active)":{'& [part="failure"]':{$description:"The wash behind the banner collapses into the page when every author colour is replaced, so the border is what is left to mark it.",border:"1px solid CanvasText",color:"CanvasText"}}},children:[{tagName:"div",attributes:{part:"view-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/view"},cases:{"no-project":{tagName:"div",attributes:{part:"empty","data-view":"no-project"},children:[{tagName:"p",attributes:{part:"empty-message"},textContent:"Source control keeps every version of a project, so any change can be undone. Open a project to see its history."},{tagName:"div",attributes:{part:"clone-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/canClone"},cases:{true:{tagName:"div",attributes:{part:"empty-actions"},children:[{tagName:"jx-button",attributes:{part:"clone","data-action":"clone"},$props:{size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/clone"},value:[]}]},children:[{tagName:"jx-icon",$props:{name:"download-simple"}},{tagName:"span",textContent:"Clone Git Repository"}]}]}}}]},loading:{tagName:"p",attributes:{part:"status","data-view":"loading"},textContent:"Loading…"},"no-repo":{tagName:"div",attributes:{part:"empty","data-view":"no-repo"},children:[{tagName:"p",attributes:{part:"empty-message"},textContent:"This project is not tracked by git yet. Start tracking it to keep a history of every change and to publish it anywhere."},{tagName:"div",attributes:{part:"empty-actions"},children:[{tagName:"jx-button",attributes:{part:"init","data-action":"init"},$props:{size:"sm",variant:"accent",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/initRepository"},value:[]}]},children:[{tagName:"jx-icon",$props:{name:"plus"}},{tagName:"span",textContent:"Initialize Repository"}]},{tagName:"jx-button",attributes:{part:"create-repository","data-action":"create-repository"},$props:{size:"sm",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/createRepository"},value:[]}]},children:[{tagName:"jx-icon",$props:{name:"share-network"}},{tagName:"span",textContent:"Create GitHub repository"}]}]}]},repo:{tagName:"div",attributes:{part:"repo",role:"none"},style:{display:"contents"},children:[{tagName:"div",attributes:{part:"remote-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/remoteState"},cases:{remote:{tagName:"div",attributes:{part:"sync-bar","data-remote":"yes"},children:[{tagName:"div",attributes:{part:"sync-head"},children:[{tagName:"jx-action-button",attributes:{part:"refresh","data-action":"refresh"},$props:{icon:"arrows-clockwise",size:"sm",quiet:!0,label:"Refresh",hint:"Refresh",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/refresh"},value:[]}]}},{tagName:"div",attributes:{part:"sync-text"},children:[{tagName:"span",attributes:{part:"sync-label"},textContent:"${state.syncLabel}"},{tagName:"span",attributes:{part:"updated-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasLastUpdated"},cases:{true:{tagName:"span",attributes:{part:"sync-time"},textContent:"${state.lastUpdated}"}}}]}]},{$description:"Three quiet tools, so NOT compact. A compact group draws every member's frame and fill whatever its quiet says, so the `quiet: true` each verb below writes would have been silently framed into a segmented control; Spectrum's group here was quiet and never compact, which is what compact=false and the 2px gap between the verbs restore.",tagName:"jx-action-group",attributes:{part:"sync-actions"},$props:{label:"Remote actions",compact:!1},children:[{tagName:"jx-action-button",attributes:{part:"fetch","data-action":"fetch"},$props:{icon:"download-simple",size:"sm",quiet:!0,label:"Fetch",hint:"Fetch",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/fetch"},value:[]}]}},{tagName:"jx-action-button",attributes:{part:"pull","data-action":"pull"},$props:{icon:"arrow-down",size:"sm",quiet:!0,label:{$ref:"#/state/pullLabel"},hint:{$ref:"#/state/pullLabel"},disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pull"},value:[]}]}},{tagName:"jx-action-button",attributes:{part:"push","data-action":"push"},$props:{icon:"arrow-up",size:"sm",quiet:!0,label:{$ref:"#/state/pushLabel"},hint:{$ref:"#/state/pushLabel"},disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/push"},value:[]}]}}]}]},local:{tagName:"div",attributes:{part:"sync-bar","data-remote":"none"},children:[{tagName:"div",attributes:{part:"sync-head"},children:[{tagName:"jx-action-button",attributes:{part:"refresh","data-action":"refresh"},$props:{icon:"arrows-clockwise",size:"sm",quiet:!0,label:"Refresh",hint:"Refresh",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/refresh"},value:[]}]}},{tagName:"div",attributes:{part:"sync-text"},children:[{tagName:"span",attributes:{part:"sync-label"},textContent:"Local only (no remote)"}]}]},{tagName:"jx-button",attributes:{part:"create-repository","data-action":"create-repository"},$props:{size:"sm",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/createRepository"},value:[]}]},children:[{tagName:"jx-icon",$props:{name:"share-network"}},{tagName:"span",textContent:"Create GitHub repository"}]}]}}},{tagName:"div",attributes:{part:"branch-row"},children:[{tagName:"div",attributes:{part:"branch-head"},children:[{tagName:"jx-icon",attributes:{part:"branch-icon"},$props:{name:"git-branch"}},{tagName:"div",attributes:{part:"branch-text"},children:[{tagName:"span",attributes:{part:"branch-label"},textContent:"Active branch"},{tagName:"span",attributes:{part:"branch-name"},textContent:"${state.branchName}"}]}]},{tagName:"jx-select",attributes:{part:"branch-picker"},$props:{label:"Switch branch",size:"sm",options:{$ref:"#/state/branchOptions"},value:{$ref:"#/state/branchValue"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/chooseBranch"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-tabs",attributes:{part:"tabs",selected:"${state.subTab}"},$props:{label:"Source control views"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/selectTab"},value:[{$ref:"event#/detail"}]}]},children:[{tagName:"jx-tab",attributes:{part:"tab","data-tab":"changes",value:"changes",label:"${state.changesLabel}",panel:"git-panel-body"}},{tagName:"jx-tab",attributes:{part:"tab","data-tab":"history",value:"history",label:"History",panel:"git-panel-body"}}]},{tagName:"div",attributes:{part:"body",id:"git-panel-body",role:"tabpanel","data-tab":"${state.subTab}"},style:{display:"contents"},$switch:{$ref:"#/state/subTab"},cases:{changes:{tagName:"div",attributes:{part:"changes",role:"none"},style:{display:"contents"},children:[{tagName:"div",attributes:{part:"commit","data-jx-region":"navigator/panel:git/commit"},children:[{tagName:"span",attributes:{part:"commit-label",id:"git-commit-label"},textContent:"Please write a commit message"},{tagName:"jx-textfield",attributes:{part:"commit-input","data-field":"commit-message"},$props:{labelledby:"git-commit-label",multiline:!0,size:"sm",placeholder:"Describe your changes",value:{$ref:"#/state/commitMessage"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editMessage"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{if:{operator:"||",target:{$ref:"event#/ctrlKey"},value:{$ref:"event#/metaKey"}},then:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/commit"},value:[]}]}]}}]}},{tagName:"div",attributes:{part:"commit-actions"},children:[{tagName:"jx-button",attributes:{part:"commit-button","data-action":"commit-and-sync"},$props:{size:"sm",variant:"accent",disabled:{$ref:"#/state/busy"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/commitAndSync"},value:[]}]},children:[{tagName:"span",textContent:"Commit and sync"}]},{tagName:"jx-action-button",attributes:{part:"commit-menu","data-action":"commit-menu"},$props:{icon:"caret-down",size:"sm",label:"More commit options",hint:"More commit options",haspopup:"menu"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openCommitMenu"},value:[{$ref:"event#/currentTarget"}]}]}}]}]},{tagName:"div",attributes:{part:"staged-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasStaged"},cases:{true:{tagName:"section",attributes:{part:"section","data-section":"staged","aria-label":"Staged Changes"},children:[{tagName:"div",attributes:{part:"section-header"},children:[{tagName:"span",attributes:{part:"section-title"},textContent:"Staged Changes"},{tagName:"span",attributes:{part:"count"},textContent:"${state.stagedCount}"},{tagName:"jx-action-button",attributes:{part:"unstage-all","data-action":"unstage-all"},$props:{icon:"minus",size:"sm",quiet:!0,label:"Unstage all",hint:"Unstage all"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/unstageAll"},value:[]}]}}]},{$prototype:"Array",items:{$ref:"#/state/stagedFiles"},key:{$ref:"$map/item/key"},map:{$description:"One changed file. Every row opens the file it names — renderability decides which VIEW opens, not whether the row responds — and carries the two or three verbs its staged state allows. `$map/item` inside a nested map is the FILE, which is why the row hands its own path back to every action rather than an index.",tagName:"div",attributes:{part:"file-row","data-path":"${$map.item.path}","data-status":"${$map.item.status}"},children:[{tagName:"button",attributes:{part:"file-open",type:"button","aria-label":"${$map.item.label}",title:"Open this file's comparison"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openFile"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"file-name"},textContent:"${$map.item.name}"},{tagName:"span",attributes:{part:"dir-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasDir"},cases:{true:{tagName:"span",attributes:{part:"file-dir"},textContent:"${$map.item.dir}"}}}]},{tagName:"span",attributes:{part:"file-actions"},$switch:{$ref:"$map/item/staged"},cases:{true:{tagName:"jx-action-button",attributes:{part:"unstage","data-action":"unstage"},$props:{icon:"minus",size:"sm",quiet:!0,label:"Unstage ${$map.item.path}",hint:"Unstage"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/unstage"},value:[{$ref:"$map/item/path"}]}]}},false:{tagName:"span",attributes:{part:"unstaged-actions",role:"none"},style:{display:"contents"},children:[{tagName:"jx-action-button",attributes:{part:"discard","data-action":"discard"},$props:{icon:"arrow-u-up-left",size:"sm",quiet:!0,label:"Discard changes to ${$map.item.path}",hint:"Discard changes",disabled:{$ref:"$map/item/cannotDiscard"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/discard"},value:[{$ref:"$map/item/path"}]}]}},{tagName:"jx-action-button",attributes:{part:"stage","data-action":"stage"},$props:{icon:"plus",size:"sm",quiet:!0,label:"Stage ${$map.item.path}",hint:"Stage"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/stage"},value:[{$ref:"$map/item/path"}]}]}}]}}},{tagName:"span",attributes:{part:"badge","data-status":"${$map.item.status}"},textContent:"${$map.item.status}"}]}}]}}},{tagName:"section",attributes:{part:"section","data-section":"changed","aria-label":"Changed Components"},children:[{tagName:"div",attributes:{part:"section-header"},children:[{tagName:"span",attributes:{part:"section-title"},textContent:"Changed Components"},{tagName:"span",attributes:{part:"count"},textContent:"${state.changedCount}"},{tagName:"span",attributes:{part:"stage-all-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasUnstaged"},cases:{true:{tagName:"jx-action-button",attributes:{part:"stage-all","data-action":"stage-all"},$props:{icon:"plus",size:"sm",quiet:!0,label:"Stage all",hint:"Stage all"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/stageAll"},value:[]}]}}}}]},{tagName:"div",attributes:{part:"groups-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/filesState"},cases:{listed:{tagName:"div",attributes:{part:"groups"},children:[{$prototype:"Array",items:{$ref:"#/state/groups"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"group","data-group":"${$map.item.key}"},children:[{tagName:"div",attributes:{part:"group-header"},children:[{tagName:"span",attributes:{part:"group-name"},textContent:"${$map.item.name}"}]},{$prototype:"Array",items:{$ref:"$map/item/files"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"file-row","data-path":"${$map.item.path}","data-status":"${$map.item.status}"},children:[{tagName:"button",attributes:{part:"file-open",type:"button","aria-label":"${$map.item.label}",title:"Open this file's comparison"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openFile"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"file-name"},textContent:"${$map.item.name}"},{tagName:"span",attributes:{part:"dir-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasDir"},cases:{true:{tagName:"span",attributes:{part:"file-dir"},textContent:"${$map.item.dir}"}}}]},{tagName:"span",attributes:{part:"file-actions"},$switch:{$ref:"$map/item/staged"},cases:{true:{tagName:"jx-action-button",attributes:{part:"unstage","data-action":"unstage"},$props:{icon:"minus",size:"sm",quiet:!0,label:"Unstage ${$map.item.path}",hint:"Unstage"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/unstage"},value:[{$ref:"$map/item/path"}]}]}},false:{tagName:"span",attributes:{part:"unstaged-actions",role:"none"},style:{display:"contents"},children:[{tagName:"jx-action-button",attributes:{part:"discard","data-action":"discard"},$props:{icon:"arrow-u-up-left",size:"sm",quiet:!0,label:"Discard changes to ${$map.item.path}",hint:"Discard changes",disabled:{$ref:"$map/item/cannotDiscard"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/discard"},value:[{$ref:"$map/item/path"}]}]}},{tagName:"jx-action-button",attributes:{part:"stage","data-action":"stage"},$props:{icon:"plus",size:"sm",quiet:!0,label:"Stage ${$map.item.path}",hint:"Stage"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/stage"},value:[{$ref:"$map/item/path"}]}]}}]}}},{tagName:"span",attributes:{part:"badge","data-status":"${$map.item.status}"},textContent:"${$map.item.status}"}]}}]}}]},empty:{tagName:"p",attributes:{part:"empty-message","data-empty":"changes"},textContent:"Nothing to commit. Files you edit and save show up here."}}}]}]},history:{tagName:"div",attributes:{part:"history"},children:[{tagName:"div",attributes:{part:"history-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/historyState"},cases:{listed:{tagName:"ul",attributes:{part:"history-list"},children:[{$prototype:"Array",items:{$ref:"#/state/commits"},key:{$ref:"$map/item/key"},map:{tagName:"li",attributes:{part:"history-entry","data-hash":"${$map.item.hash}"},children:[{tagName:"span",attributes:{part:"history-hash"},textContent:"${$map.item.hash}"},{tagName:"span",attributes:{part:"history-message"},textContent:"${$map.item.message}"},{tagName:"span",attributes:{part:"history-meta"},textContent:"${$map.item.meta}"}]}}]},empty:{tagName:"p",attributes:{part:"empty-message","data-empty":"history"},textContent:"No commits yet. Each commit you make is a version you can come back to."}}}]}}},{tagName:"div",attributes:{part:"busy-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/busy"},cases:{true:{tagName:"p",attributes:{part:"status","data-status":"busy"},textContent:"Loading…"}}},{tagName:"div",attributes:{part:"failure-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasError"},cases:{true:{tagName:"p",attributes:{part:"failure",role:"alert"},textContent:"${state.error}"}}}]}}}]};T("git-panel",Pt);function Nt(t,e){t.view=e.view,t.canClone=e.canClone,t.busy=e.busy,t.hasError=e.hasError,t.error=e.error,t.remoteState=e.remoteState,t.syncLabel=e.syncLabel,t.lastUpdated=e.lastUpdated,t.hasLastUpdated=e.hasLastUpdated,t.pullLabel=e.pullLabel,t.pushLabel=e.pushLabel,t.branchName=e.branchName,t.branchValue=e.branchValue,t.branchOptions=e.branchOptions,t.subTab=e.subTab,t.changesLabel=e.changesLabel,t.commitMessage=e.commitMessage,t.hasStaged=e.hasStaged,t.stagedCount=e.stagedCount,t.stagedFiles=e.stagedFiles,t.changedCount=e.changedCount,t.hasUnstaged=e.hasUnstaged,t.filesState=e.filesState,t.groups=e.groups,t.historyState=e.historyState,t.commits=e.commits}function Me(){return{branchName:"",branchOptions:[],branchValue:"",busy:!1,canClone:!1,changedCount:"0",changesLabel:"Local Changes",commitMessage:"",commits:[],error:"",filesState:"empty",groups:[],hasError:!1,hasLastUpdated:!1,hasStaged:!1,hasUnstaged:!1,historyState:"empty",lastUpdated:"",pullLabel:"Pull",pushLabel:"Push",remoteState:"local",stagedCount:"0",stagedFiles:[],subTab:"changes",syncLabel:"",view:"loading"}}function At(t,e,a){let r=y({...Me(),...a});Nt(r,e);let i=null,o=!1;return I("git-panel",r,t).then((n)=>{if(o){n.dispose();return}i=n}),{connected:()=>!o&&(i===null||i.root.parentNode===t),dispose(){o=!0,i?.dispose(),i=null},update:(n)=>{Nt(r,n)}}}async function _c(){if(!D)return;let t=p(),{git:e}=v;e.loading=!0,e.error=null;try{let[a,r]=await Promise.allSettled([t.gitStatus(),t.gitBranches()]);if(a.status==="fulfilled")e.status=a.value;if(r.status==="fulfilled")e.branches=r.value;let i=a.status==="rejected"?a.reason:r.status==="rejected"&&a.value?.isRepo?r.reason:null;if(i)e.error=te(i);e.lastUpdated=jr(),e.rev+=1,await Ge()}catch(a){e.error=te(a)}finally{e.loading=!1}}async function Ge(){let t=v.git.diffState;if(!t)return;let e=v.git.status?.files.find((a)=>a.path===t.filePath);if(!e||!Tt(e.status)){v.git.diffState=null;return}try{v.git.diffState=await U(t.filePath,e.status)}catch{}}async function CS(t){v.git.rev+=1;let e=v.git.diffState;if(!t||e?.filePath!==t)return;try{v.git.diffState=await U(t,e.fileStatus)}catch{}}async function Mw(t){let e=p();if(!e.gitClone){C.warn("Cloning is not supported on this platform.",{source:"Source Control"});return}let a=await Pn("Clone Git Repository",{confirmLabel:"Clone",message:"Repository URL",placeholder:"https://github.com/user/repo.git",validate:(r)=>r.trim()?"":"Enter a repository URL."});if(!a)return;try{C.info("Cloning repository…",{key:"git.clone",source:"Source Control"});let r=await e.gitClone(a);if(r?.root)C.success("Clone complete.",{key:"git.clone"}),await t.openRecentProject(r.root)}catch(r){C.error("Could not clone the repository.",{detail:te(r),key:"git.clone",source:"Source Control"})}}function Fw(){return Ve()&&Boolean(p().gitClone)}var Fe={A:"added",D:"deleted",M:"modified",R:"renamed",U:"untracked"},De=new Set(["M","A","U","D"]);function Tt(t){return De.has(t)}async function U(t,e){let a=p(),r=e!=="A"&&e!=="U",i=e!=="D",[o,n]=await Promise.all([r?a.gitShow({path:t,ref:"HEAD"}):Promise.resolve(""),i?a.readFile(t):Promise.resolve("")]);return{currentContent:n,filePath:t,fileStatus:e,originalContent:o}}async function kS(t,e){try{return await U(t,e)}catch(a){return console.warn("loadDiffForLens:",te(a)),null}}async function Mt(){try{C.info("Initializing repository…",{key:"git.init"}),await p().gitInit(),C.success("Repository initialized.",{key:"git.init"})}catch(t){C.error("Could not initialize the repository.",{action:"git.init",detail:te(t),key:"git.init",source:"Source Control"});return}await _c()}async function Ee(){await b("gitPush")}async function Le(){if(await jw())C.success("Signed in to GitHub.",{key:"github.auth"})}async function b(t,e){let a=p();v.git.loading=!0,v.git.error=null;try{return await a[t](e),await _c(),!0}catch(r){return v.git.error=te(r),v.git.loading=!1,!1}}function Gt(t){if(!v.git.commitMessage)v.git.commitMessage=t}async function Ue(){v.git.loading=!0,v.git.error=null;try{await B(),await _c()}catch(t){v.git.error=te(t),v.git.loading=!1}}var P=null;async function He(){let t=p();try{v.git.logEntries=await t.gitLog(30)}catch(e){v.git.error=te(e)}}var L={},K=null;function Ft(t){let e=t.path.split("/"),a=e.pop()??t.path,r=e.join("/");return{cannotDiscard:t.status==="U",dir:r,hasDir:r!=="",key:t.path,label:`${t.path}, ${Fe[t.status]??"changed"}`,name:a,path:t.path,staged:Boolean(t.staged),status:t.status}}function ze(t){let e=new Map;for(let a of t){let r=a.path.split("/"),i;if(a.path.endsWith(".json")||a.path.endsWith(".class.json")||Qt(a.path))i=r.length>1?`/${r.at(-2)}`:`/${r[0]}`;else i="Other";if(!e.has(i))e.set(i,[]);e.get(i).push(a)}return[...e.entries()].map(([a,r])=>({files:r.map((i)=>Ft(i)),key:a,name:a}))}function Oe(t){return{hash:t.hash.slice(0,7),key:t.hash,message:t.message,meta:`${t.author} · ${ta(t.date)}`}}function _e(t){return t?`Last updated ${new Date(t).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}`:""}function Dt(){if(!D)return"no-project";let{error:t,loading:e,status:a}=v.git;if(!a&&!e&&!t)return"loading";return a&&!a.isRepo?"no-repo":"repo"}function X(){let{branches:t,commitMessage:e,error:a,lastUpdated:r,loading:i,logEntries:o,status:n,subTab:s}=v.git,l=n?.files??[],c=l.filter((d)=>d.staged),h=l.filter((d)=>!d.staged),g=[...c,...h],x=!n?.ahead&&!n?.behind,f=n?.ahead?`${n.ahead} ahead`:"",S=n?.behind?`${n.behind} behind`:"",N=o??[];return{branchName:(t?.current??n?.branch??"")||"—",branchOptions:[...(t?.branches??[]).map((d)=>({label:d,value:d})),{label:"+ New branch…",value:Z}],branchValue:K??t?.current??"",busy:Boolean(i),canClone:Fw(),changedCount:String(g.length),changesLabel:g.length>0?`Local Changes (${g.length})`:"Local Changes",commitMessage:e,commits:N.map((d)=>Oe(d)),error:a??"",filesState:g.length>0?"listed":"empty",groups:ze(g),hasError:Boolean(a),hasLastUpdated:Boolean(r),hasStaged:c.length>0,hasUnstaged:h.length>0,historyState:N.length>0?"listed":"empty",lastUpdated:_e(r),pullLabel:S?`Pull (${S})`:"Pull",pushLabel:f?`Push (${f})`:"Push",remoteState:(n?.remotes?.length??0)>0?"remote":"local",stagedCount:String(c.length),stagedFiles:c.map((d)=>Ft(d)),subTab:s,syncLabel:x?"Up to date":`${f}${f&&S?", ":""}${S}`,view:Dt()}}var Z="__new__";function Et(t){return v.git.status?.files.find((e)=>e.path===t)}async function Lt(){let t=v.git.commitMessage.trim();if(!t)return;if(v.git.commitMessage="",await u1(),!await b("gitCommit",t))Gt(t)}async function Je(){let t=v.git.commitMessage.trim();if(!t)return;v.git.commitMessage="",v.git.loading=!0,v.git.error=null,await u1();let e=p(),a=!1;try{await e.gitCommit(t),a=!0,await e.gitPush(),await _c()}catch(r){if(v.git.error=te(r),v.git.loading=!1,!a)Gt(t)}}async function We(t){let{branches:e,status:a}=v.git;if(t===Z){K=Z,Rt();let r=await Pn("New Branch",{confirmLabel:"Create",message:`Branching from ${e?.current||a?.branch||"the current branch"}.`,placeholder:"feature/my-change",validate:(i)=>i.trim()?"":"Enter a branch name."});if(K=null,Rt(),r)await b("gitCreateBranch",r);return}if(t!==e?.current)await b("gitCheckout",t)}async function Be(t){let e=Et(t);if(!e)return;let a=Tt(e.status)?rt(e.path,e.status):`"${e.path}" has no change this view can open.`;if(a){v.git.error=a;return}try{v.git.loading=!0;let r=await U(e.path,e.status);v.git.diffState=r;let i=await it(e.path);if(L.setGitDiffState?.(r),i)L.setCanvasMode?.(i,"git-diff")}catch(r){v.git.error=`Failed to load diff: ${te(r)}`}finally{v.git.loading=!1}}async function qe(t){if(Et(t)?.status==="U")return;if(!await to("Discard Changes",`Discard changes to ${t}?`,{confirmLabel:"Discard",destructive:!0}))return;await b("gitDiscard",[t])}function Ke(t){(me("5c55ea3d"),import("./menu-5c55ea3d.js")).then(({openMenu:e})=>{e({label:"Commit options",opener:t,place:(a)=>{let r=Ie(t);return{x:Math.max(4,r.right-a.width),y:r.bottom+4}},region:"git-commit",rows:[{destructive:!1,disabled:!1,dividerAbove:!1,id:"git.commitWithoutSync",run:()=>{Lt()},title:"Commit (don't sync)"}]})})}function Xe(t){if(v.git.subTab=t,t==="history"&&!v.git.logEntries)He()}var Ze={chooseBranch:(t)=>{We(t)},clone:()=>{L.cloneRepository?.()},commit:()=>{Lt()},commitAndSync:()=>{Je()},createRepository:()=>{q({projectName:D?.name||"my-project"})},discard:(t)=>{qe(t)},editMessage:(t)=>{v.git.commitMessage=t},fetch:()=>{b("gitFetch")},initRepository:()=>{Mt()},openCommitMenu:Ke,openFile:(t)=>{Be(t)},pull:()=>{Ue()},push:()=>{b("gitPush")},refresh:()=>{_c()},selectTab:Xe,stage:(t)=>{b("gitStage",[t])},stageAll:()=>{let t=(v.git.status?.files??[]).filter((e)=>!e.staged).map((e)=>e.path);b("gitStage",t)},unstage:(t)=>{b("gitUnstage",[t])},unstageAll:()=>{let t=(v.git.status?.files??[]).filter((e)=>e.staged).map((e)=>e.path);b("gitUnstage",t)}},w=null;function Ut(){if(!w)return;w.scope.stop(),w.handle.dispose(),w=null}function Rt(){w?.handle.update(X())}function Ye(){if(P)return;P=setInterval(()=>{if(v.leftTab==="git"&&!v.git.loading)_c()},xR)}function Qe(t,e){L=e;let a=t.querySelector(".panel-content")??t;if(Ve()&&Dt()==="loading")_c();if(w&&(w.host!==a||!w.handle.connected()))Ut();if(w)return;let r=At(a,X(),Ze),i=ge();i.run(()=>{Q(()=>{let o=X();if(o.view==="repo")Ye();r.update(o)})}),w={handle:r,host:a,scope:i}}function ES(t){return tt}function ta(t){let e=new Date(t),a=jr()-e.getTime(),r=Math.floor(a/60000);if(r<1)return"just now";if(r<60)return`${r}m ago`;let i=Math.floor(r/60);if(i<24)return`${i}h ago`;let o=Math.floor(i/24);if(o<30)return`${o}d ago`;return e.toLocaleDateString()}function ea(){return[{category:"Source Control",id:"git.init",level:"project",menus:["commandbar/overflow","palette"],group:"7_scm",requires:"an open project that git is not already tracking",when:(t)=>t.project.open,enablement:(t)=>!t.project.isRepo,run:async()=>{await Mt()},title:"Initialize Repository"},{category:"Source Control",id:"git.createGithubRepository",level:"project",menus:["commandbar/overflow","palette"],group:"7_scm",requires:"a project tracked by git",when:(t)=>t.project.open,enablement:(t)=>t.project.isRepo,run:async()=>{await q({projectName:D?.name||"my-project"})},title:"Create GitHub Repository"},{category:"Source Control",id:"git.push",level:"project",menus:["commandbar/overflow","palette"],group:"7_scm",requires:"a project tracked by git",when:(t)=>t.project.open,enablement:(t)=>t.project.isRepo,run:async()=>{await Ee()},title:"Push"},{category:"Source Control",id:"git.signInToGithub",level:"application",menus:["palette"],group:"7_scm",run:async()=>{await Le()},title:"Sign In to GitHub"}]}function TS(t){t.registerAll(ea())}function nm(){if(P)clearInterval(P),P=null;Ut()}function LS(){Kn({id:"git",title:"Source Control",railLabel:"Source",level:"project",dock:"navigator",icon:"git-branch",badge:(t)=>t.git.dirtyCount||null,render:()=>tt,afterRender:(t,e)=>{Qe(e,t.deps)}})}
|
|
2
|
+
export{Ow,LE,yb,RE,vb,Aw,mp,gp,SS,wb,$E,Pw,IE,tm,_c,CS,Mw,Fw,kS,ES,TS,nm,LS};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
4
|
+
//# debugId=FCB556997718C71264756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-myjcghv3.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var e=new Map,r=new Set;function o(){for(let t of r)t()}function Ya(){o()}function kb(t){return r.add(t),()=>{r.delete(t)}}function ms(t){e.set(t.key,t),o()}function FS(t){if(e.delete(t))o()}function om(){return[...e.values()].toSorted((t,s)=>t.order-s.order)}function zw(){return om().map((t)=>t.key)}function Uw(t){return e.get(t)}var i=null,n="overview";function Eb(){if(i!==null&&e.has(i))return n=i,i=null,n;if(e.has(n))return n;return zw()[0]??n}function Tb(t){if(e.has(t))n=t,i=null;else i=t;o()}export{Ya,kb,ms,FS,om,zw,Uw,Eb,Tb};
|
|
2
|
+
|
|
3
|
+
//# debugId=FB228AD501C1EAE764756E2164756E21
|
|
4
|
+
//# sourceMappingURL=studio-n8bxwc3y.js.map
|