@jxsuite/studio 5.7.0 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{cf-account-picker-882a7ecm.js → cf-account-picker-bb2yq946.js} +2 -2
- package/dist/chunks/content-source-t0q184js.js +4 -0
- package/dist/chunks/{convert-to-repeater-grfep2w8.js → convert-to-repeater-vqkt7s3s.js} +2 -2
- package/dist/chunks/entry-commands-fxzgcc4k.js +4 -0
- package/dist/chunks/{extension-sections-dp8endhx.js → extension-sections-8beq9ac3.js} +2 -2
- package/dist/chunks/file-ops-2n77759h.js +4 -0
- package/dist/chunks/files-fjy7zpxt.js +4 -0
- package/dist/chunks/{format-host-e2pjvd25.js → format-host-wj3mf3n8.js} +2 -2
- package/dist/chunks/fs-events-7kcgn4e9.js +4 -0
- package/dist/chunks/git-panel-7z2mpt2d.js +4 -0
- package/dist/chunks/{grid-view-5amhg604.js → grid-view-ca10def6.js} +2 -2
- package/dist/chunks/{iframe-host-t819mcg5.js → iframe-host-a0zjd6xp.js} +2 -2
- package/dist/chunks/{layers-4bsr82wz.js → layers-p677nrh5.js} +2 -2
- package/dist/chunks/layers-panel-y4w1dq90.js +4 -0
- package/dist/chunks/media-picker-xg7yjpz9.js +4 -0
- package/dist/chunks/menu-fpekzj6w.js +4 -0
- package/dist/chunks/publish-panel-xtbfgg2r.js +4 -0
- package/dist/chunks/quick-search-d3a6m7j3.js +4 -0
- package/dist/chunks/right-panel-31vbk5xp.js +4 -0
- package/dist/chunks/studio-1q6amtph.js +5 -0
- package/dist/chunks/{studio-56z7evx4.js → studio-3ck2a5c4.js} +2 -2
- package/dist/chunks/{studio-gh97gngt.js → studio-4fde4a0x.js} +2 -2
- package/dist/chunks/{studio-gfn1kpxj.js → studio-4jj9gme2.js} +3 -3
- package/dist/chunks/{studio-zpnk016a.js → studio-4m50vh74.js} +3 -3
- package/dist/chunks/{studio-dkn3x3hz.js → studio-4r0sjtx8.js} +2 -2
- package/dist/chunks/{studio-a7xqhc3n.js → studio-5d7wfmnp.js} +2 -2
- package/dist/chunks/{studio-ceb34dxj.js → studio-5gs9th4b.js} +2 -2
- package/dist/chunks/{studio-j6gnhvaa.js → studio-5vy2wfm5.js} +2 -2
- package/dist/chunks/{studio-spf2skgc.js → studio-7qvs7v0m.js} +2 -2
- package/dist/chunks/{studio-e6re3rk1.js → studio-84rtc120.js} +2 -2
- package/dist/chunks/{studio-nt06yybj.js → studio-8xcwewjq.js} +2 -2
- package/dist/chunks/{studio-cxt150pj.js → studio-aekhcdzw.js} +2 -2
- package/dist/chunks/{studio-222rqyyc.js → studio-bftp4n4b.js} +2 -2
- package/dist/chunks/{studio-xta2vxp6.js → studio-capk0583.js} +2 -2
- package/dist/chunks/{studio-wma2c6g8.js → studio-cbr9czkn.js} +2 -2
- package/dist/chunks/{studio-c9d3pxf7.js → studio-chdmwwzw.js} +2 -2
- package/dist/chunks/{studio-0k9mvpgj.js → studio-cp1gbff9.js} +2 -2
- package/dist/chunks/{studio-1x8x26k3.js → studio-cqmtbg2p.js} +2 -2
- package/dist/chunks/{studio-c6w3tq7t.js → studio-e47215hh.js} +2 -2
- package/dist/chunks/{studio-frb0qbf7.js → studio-fbx6twps.js} +2 -2
- package/dist/chunks/{studio-xk0z6msk.js → studio-fthwn4kf.js} +2 -2
- package/dist/chunks/{studio-0scebvb9.js → studio-g8dsj3d2.js} +2 -2
- package/dist/chunks/{studio-54g077x3.js → studio-ge5fqjth.js} +2 -2
- package/dist/chunks/{studio-p7c1agz0.js → studio-gjknvzam.js} +3 -3
- package/dist/chunks/{studio-mwxgyn9h.js → studio-hnvnfbdv.js} +3 -3
- package/dist/chunks/{studio-9mqfamps.js → studio-mk00zd5d.js} +2 -2
- package/dist/chunks/{studio-skzanb0k.js → studio-qa73881a.js} +2 -2
- package/dist/chunks/{studio-xry7tk3z.js → studio-rmn2dz59.js} +2 -2
- package/dist/chunks/{studio-eh0rac07.js → studio-rr4xkv81.js} +2 -2
- package/dist/chunks/{studio-f195h2hq.js → studio-tmeq6mjb.js} +2 -2
- package/dist/chunks/{studio-cvbkkfqb.js → studio-x5g1xk77.js} +2 -2
- package/dist/chunks/{studio-65fhspdd.js → studio-xg1942as.js} +2 -2
- package/dist/chunks/{studio-888knnkc.js → studio-xkfs0dp2.js} +2 -2
- package/dist/chunks/{studio-xy3tv3az.js → studio-zev8ssp1.js} +3 -3
- package/dist/chunks/{studio-tw7rre6s.js → studio-ztvcxm3w.js} +2 -2
- package/dist/chunks/{workspace-b69mgm0e.js → workspace-5vmgsagj.js} +2 -2
- package/dist/iframe-entry.js +3 -3
- package/dist/manifest.json +36 -36
- package/dist/studio.js +10 -10
- package/package.json +11 -11
- package/src/ui/schema-form.ts +6 -2
- package/dist/chunks/content-source-37x3vsap.js +0 -4
- package/dist/chunks/entry-commands-c5h3nqck.js +0 -4
- package/dist/chunks/file-ops-937cvqk6.js +0 -4
- package/dist/chunks/files-tznwe1p1.js +0 -4
- package/dist/chunks/fs-events-fv64ak3s.js +0 -4
- package/dist/chunks/git-panel-gb713ttc.js +0 -4
- package/dist/chunks/layers-panel-b6shnaax.js +0 -4
- package/dist/chunks/media-picker-ej0kdh1j.js +0 -4
- package/dist/chunks/menu-rtxf9chb.js +0 -4
- package/dist/chunks/publish-panel-bq36xcmj.js +0 -4
- package/dist/chunks/quick-search-zm00h9dh.js +0 -4
- package/dist/chunks/right-panel-pq2f71q3.js +0 -4
- package/dist/chunks/studio-693nhyky.js +0 -5
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{un,rn,ne}from"./studio-0k9mvpgj.js";import{p}from"./studio-y7jehjrp.js";import{Tr}from"./studio-222rqyyc.js";import{v}from"./studio-fqq890ap.js";import{rt,zt,T,R,An,Ct}from"./studio-spf2skgc.js";import{gd,YE,Zf,P1,ZE,ca,rp}from"./studio-cxt150pj.js";import{Rf,$_}from"./studio-1a99w39s.js";import{D}from"./studio-tp642n5g.js";import{me}from"./studio-0bbxhhce.js";var P={$schema:"https://jxsuite.com/schema/v1",$id:"StudioPublish",$description:"Publish: the one-click Cloudflare Pages flow, as a `jx-dialog` over the kit. Eight bodies, one at a time, because the reader is at exactly one point of a chain — a host that cannot reach Cloudflare at all, a question still in flight, a connection that lapsed, an invitation to connect, a stored token Cloudflare refused, a field to paste a replacement into, the create-and-connect form, and the connected status. `publish/publish-panel.ts` keeps every one of those decisions and the calls that settle them; this document knows only which of the eight it was told to draw. **The token is never painted.** The field below binds no `value` — it is written by the reader and read once, on its way to storage — so a stored secret cannot reach the attribute, the serialised HTML or the accessibility tree, which is `studio.md` §15 rule 1 written as a missing binding rather than as a rule somebody remembers.",tagName:"jx-dialog",$props:{headline:"Publish",confirmLabel:"",cancelLabel:"Close",size:"md"},attributes:{part:"publish"},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},style:{$description:"What the five `.publish-*` names carried, keyed on `part`, and most of them do not survive the move. `.publish-modal` and its `.new-project-modal` base were a fixed card, a scroll body, a border, a shadow and a `z-index: 1000` — a modal `<dialog>` is every one of those, and the top layer is what the z-index was climbing towards. `.publish-field` was a label stacked over a control, which is `jx-field`'s whole shape. What is left is the column gap between bodies, the two button rows, the hint and the refusal. Nothing here uses `--spectrum-*`: those custom properties resolve only inside `<sp-theme>`, and a document mounted in a layer host is outside it, so each would silently have taken its hard-coded fallback.",'& [part="body"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)"},'& [part="note"], & [part="status-line"], & [part="deployment"]':{margin:"0",lineHeight:"1.5"},'& [part="rows"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)"},'& [part="actions"]':{$description:'Wraps rather than overflows (studio-ui-guidelines.md §4.6): two buttons whose labels are whole phrases — "Verify & Connect", "Preferences › Accounts" — are wider than a narrow dialog at the sizes a reader may have set.',display:"flex",flexWrap:"wrap",gap:"var(--jx-space-2)"},'& [part="submit"]':{alignSelf:"flex-start"},'& [part="hint"]':{$description:"Publishing rides every commit, so the connected body's only job is to say what is already happening. Dim, because it is a standing fact rather than something to act on.",margin:"0",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="failure"]':{$description:'`failure` and not `error`: `jx-textfield` and `jx-select` each draw a `[part="error"]` of their own inside this same tree, and the kit is light DOM — a scoped rule on that name would restyle the token field\'s refusal line too.',margin:"0",color:"var(--danger)",lineHeight:"1.5"},'& [part="link"], & [part="install-link"]':{color:"var(--accent)",textDecoration:"underline"},"& code":{fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-sm)"}},children:[{tagName:"div",attributes:{part:"body"},children:[{tagName:"div",attributes:{part:"body-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/body"},cases:{unsupported:{tagName:"p",attributes:{part:"note"},children:["This platform cannot reach the Cloudflare API. Publish by committing and pushing — your host builds ",{tagName:"code",textContent:"bunx jx build"}," and serves ",{tagName:"code",textContent:"dist/"},"."]},loading:{tagName:"p",attributes:{part:"note"},textContent:"Checking Cloudflare connection…"},lapsed:{tagName:"div",attributes:{part:"lapsed",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},textContent:"Your Cloudflare connection has expired, so publishing cannot reach your account. Reconnect to restore it — this site's Pages project and its settings are untouched."},{tagName:"jx-button",$props:{variant:"accent",disabled:{$ref:"#/state/busy"}},attributes:{part:"reconnect"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/connect"},value:[]}]},children:[{tagName:"span",textContent:"${state.connectLabel}"}]}]},hosted:{tagName:"div",attributes:{part:"hosted",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},textContent:"Connect your Cloudflare account to publish this site."},{tagName:"jx-button",$props:{disabled:{$ref:"#/state/busy"}},attributes:{part:"connect"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/connect"},value:[]}]},children:[{tagName:"span",textContent:"Connect Cloudflare"}]}]},stored:{tagName:"div",attributes:{part:"stored",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},textContent:"A Cloudflare API token is stored on this machine, and Cloudflare did not accept it. It may have been revoked, or it may be missing the Account Settings Read and Pages Read/Write permissions."},{tagName:"div",attributes:{part:"actions"},children:[{tagName:"jx-button",$props:{disabled:{$ref:"#/state/busy"}},attributes:{part:"replace"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/replace"},value:[]}]},children:[{tagName:"span",textContent:"Replace token"}]},{tagName:"jx-button",$props:{quiet:!0},attributes:{part:"accounts"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openAccounts"},value:[]}]},children:[{tagName:"span",textContent:"Preferences › Accounts"}]}]}]},token:{tagName:"div",attributes:{part:"token-form",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},textContent:"Paste a Cloudflare API token (permissions: Account Settings Read, Pages Read/Write). It is stored on this machine and only sent to the same-origin proxy — Studio never renders it back."},{tagName:"jx-field",$props:{span:!0,label:"API token"},attributes:{part:"token-row","data-field":"token"},children:[{tagName:"jx-textfield",$description:"No `value` binding, and its absence is the contract: a secret may pass through a field the reader typed it into and may never be painted into one they did not. The draft lives in the adapter's closure until Verify reads it, so nothing here — not the attribute, not the accessibility tree, not a DOM dump — has ever held it.",$props:{type:"password",placeholder:"cf_..."},attributes:{part:"token"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setToken"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"div",attributes:{part:"actions"},children:[{tagName:"jx-button",$props:{variant:"accent",disabled:{$ref:"#/state/busy"}},attributes:{part:"verify"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/verify"},value:[]}]},children:[{tagName:"span",textContent:"Verify & Connect"}]},{tagName:"jx-button",$props:{quiet:!0},attributes:{part:"accounts"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openAccounts"},value:[]}]},children:[{tagName:"span",textContent:"Preferences › Accounts"}]}]}]},form:{tagName:"div",attributes:{part:"connect-form",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},children:["Create a Cloudflare Pages project connected to this repository. Every commit then builds and publishes automatically (",{tagName:"code",textContent:"bunx jx build"},")."]},{tagName:"div",attributes:{part:"rows"},children:[{tagName:"jx-field",$props:{span:!0,label:"Account"},attributes:{part:"row","data-field":"account"},children:[{tagName:"jx-select",$props:{options:{$ref:"#/state/accountOptions"},value:{$ref:"#/state/accountId"}},attributes:{part:"account"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setAccount"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"Pages project name"},attributes:{part:"row","data-field":"projectName"},children:[{tagName:"jx-textfield",$props:{value:{$ref:"#/state/projectName"}},attributes:{part:"project-name"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setProjectName"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"GitHub owner"},attributes:{part:"row","data-field":"owner"},children:[{tagName:"jx-textfield",$props:{value:{$ref:"#/state/owner"}},attributes:{part:"owner"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setOwner"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"GitHub repository"},attributes:{part:"row","data-field":"repo"},children:[{tagName:"jx-textfield",$props:{value:{$ref:"#/state/repo"}},attributes:{part:"repo"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setRepo"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"Production branch"},attributes:{part:"row","data-field":"branch"},children:[{tagName:"jx-textfield",$props:{value:{$ref:"#/state/branch"}},attributes:{part:"branch"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setBranch"},value:[{$ref:"event#/target/value"}]}]}}]}]},{tagName:"jx-button",$props:{variant:"accent",disabled:{$ref:"#/state/busy"}},attributes:{part:"submit"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/submit"},value:[]}]},children:[{tagName:"span",textContent:"${state.submitLabel}"}]}]},status:{tagName:"div",attributes:{part:"status",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"status-line"},children:["Connected to Pages project ",{tagName:"strong",attributes:{part:"project-name"},textContent:"${state.deployProject}"},{tagName:"span",attributes:{part:"site-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasProductionUrl"},cases:{true:{tagName:"span",children:[" — ",{tagName:"a",attributes:{part:"link",href:"${state.productionUrl}",target:"_blank",rel:"noreferrer"},textContent:"${state.productionUrl}"}]}}}]},{tagName:"div",attributes:{part:"deployment-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasDeployment"},cases:{true:{tagName:"p",attributes:{part:"deployment"},children:["Latest deployment: ",{tagName:"strong",attributes:{part:"deployment-state"},textContent:"${state.deploymentState}"}," (${state.deploymentEnvironment}) — ",{tagName:"a",attributes:{part:"link",href:"${state.deploymentUrl}",target:"_blank",rel:"noreferrer"},textContent:"preview"}]},false:{tagName:"p",attributes:{part:"deployment"},textContent:"No deployments yet — the first commit after connecting triggers one."}}},{tagName:"p",attributes:{part:"hint"},textContent:"Publishing happens automatically on every commit."},{tagName:"div",attributes:{part:"actions"},children:[{tagName:"jx-button",$props:{disabled:{$ref:"#/state/busy"}},attributes:{part:"refresh"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/refresh"},value:[]}]},children:[{tagName:"span",textContent:"Refresh"}]},{tagName:"jx-button",$props:{variant:"negative",disabled:{$ref:"#/state/busy"}},attributes:{part:"disconnect"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/disconnect"},value:[]}]},children:[{tagName:"span",textContent:"Disconnect"}]}]}]}}},{tagName:"div",attributes:{part:"failure-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasFailure"},cases:{true:{tagName:"p",attributes:{part:"failure"},children:["${state.failure}",{tagName:"span",attributes:{part:"pages-app-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/needsPagesApp"},cases:{true:{tagName:"span",children:[" — if the Cloudflare Pages GitHub App is not installed on the repository, ",{tagName:"a",attributes:{part:"install-link",href:"${state.pagesAppUrl}",target:"_blank",rel:"noreferrer"},textContent:"install it"}," and retry."]}}}]}}}]}]};T("publish",P);var S="https://github.com/apps/cloudflare-pages/installations/new";function F(e){if(!e.supported)return"unsupported";if(e.loading)return"loading";if(e.connected&&e.lapsed)return"lapsed";if(!e.connected){if(e.hosted)return"hosted";return e.tokenStored&&!e.replacing?"stored":"token"}return e.deploy?"status":"form"}function w(e){let{error:t}=e;return{accountId:e.form.accountId,accountOptions:e.accounts,body:F(e),branch:e.form.branch,busy:e.busy,connectLabel:e.busy?"Reconnecting…":"Reconnect Cloudflare",deploymentEnvironment:e.deployment?.environment??"",deploymentState:e.deployment?`${e.deployment.stage}: ${e.deployment.status}`:"",deploymentUrl:e.deployment?.url??"",deployProject:e.deploy?.projectName??"",failure:t,hasDeployment:e.deployment!==null,hasFailure:t!=="",hasProductionUrl:(e.deploy?.productionUrl??"")!=="",needsPagesApp:/github/i.test(t)&&/app|install|source|repo/i.test(t),owner:e.form.owner,pagesAppUrl:S,productionUrl:e.deploy?.productionUrl??"",projectName:e.form.projectName,repo:e.form.repo,submitLabel:e.busy?"Connecting…":"Create & Connect"}}function C(e){let t=document.createElement("div");t.style.pointerEvents="auto",e.layer.append(t);let l="",g=!1,N=()=>{if(g)return;g=!0,e.onClosed()},d=v({...w(e.view),closed:N,connect:()=>{e.onConnect()},disconnect:()=>{e.onDisconnect()},openAccounts:()=>{e.onOpenAccounts()},refresh:()=>{e.onRefresh()},replace:()=>{l="",e.onReplaceToken()},setAccount:(o)=>{d.accountId=o,e.onField("accountId",o)},setBranch:(o)=>{d.branch=o,e.onField("branch",o)},setOwner:(o)=>{d.owner=o,e.onField("owner",o)},setProjectName:(o)=>{d.projectName=o,e.onField("projectName",o)},setRepo:(o)=>{d.repo=o,e.onField("repo",o)},setToken:(o)=>{l=o},submit:()=>{e.onSubmit()},verify:()=>{let o=l;l="",e.onSaveToken(o)}}),b=null,k=R("publish",d,t).then(async(o)=>{b=o;let u=o.root;if(g)return o.dispose(),u;if(await An(u),g)return u;return(u.querySelector('dialog[part="dialog"]')??u).setAttribute(rt,zt("modal","publish")),un(u),u});return{close(){let o=b?.root;if(o instanceof HTMLElement)rn(o);b?.dispose(),b=null,l="",t.remove(),N()},host:t,ready:k,update(o){Object.assign(d,w(o))}}}var m=null,s="loading",f=[],i=null,a="",c=!1,h=!1,n={accountId:"",branch:"main",owner:"",projectName:"",repo:""};function x(){return D?.projectConfig??null}function I(e){return e.toLowerCase().replaceAll(/[^a-z0-9]+/g,"-").replaceAll(/^-+|-+$/g,"").slice(0,58)||"site"}function H(){let e=p().projectRoot,t=/^([\w.-]+)\/([\w.-]+)(?:@.+)?$/.exec(e);return t?{owner:t[1],repo:t[2]}:{owner:"",repo:""}}function L(){let e=ca();return e?{productionUrl:e.productionUrl??"",projectName:e.projectName}:null}function j(){let e=gd(),t=s==="loading"?null:s;return{accounts:f.map((l)=>({label:l.name,value:l.id})),busy:c,connected:t?.connected===!0,deploy:L(),deployment:i?{environment:i.environment,stage:i.stage,status:i.status,url:i.url}:null,error:a,form:{...n},hosted:e&&typeof p().cfConnect==="function",lapsed:t?.connected===!0&&t.needsReconnect===!0,loading:s==="loading",replacing:h,supported:e,tokenStored:Rf()!==""}}function r(){if(m){m.update(j());return}m=C({layer:Ct("modal"),onClosed:V,onConnect:()=>{O()},onDisconnect:()=>{M()},onField:(e,t)=>{n={...n,[e]:t}},onOpenAccounts:E,onRefresh:()=>{y()},onReplaceToken:()=>{h=!0,a="",r()},onSaveToken:(e)=>{U(e)},onSubmit:()=>{_()},view:j()})}async function y(){s="loading",r();try{if(s=await p().cfConnection?.()??null,s?.connected&&!s.needsReconnect){f=await YE(),n={...n,accountId:s.accountId??f[0]?.id??""};let e=ca();if(e)i=await Zf(e),rp(i)}}catch(e){s=null,a=e instanceof Error?e.message:String(e)}r()}async function U(e){let t=e.trim();if(!t){a="Paste a token, or use Preferences › Accounts to forget the stored one.",r();return}$_(t),h=!1,a="",await y()}function E(){ne()?.run("app.preferences",{section:"accounts"})}async function O(){c=!0,a="",r();try{let e=await p().cfConnect?.()??null;if(e?.status==="timeout")a="The Cloudflare window didn't finish. Sign in there, then reconnect — nothing was changed.";else if(e?.status==="connected"&&!e.connection.accountId){let{openCfAccountPicker:t}=await (me("882a7ecm"),import("./cf-account-picker-882a7ecm.js"));await t()}}catch(e){a=e instanceof Error?e.message:String(e)}c=!1,Tr(),await y()}async function _(){let e=x();if(!e)return;if(!n.projectName||!n.owner||!n.repo||!n.accountId){a="Account, project name, and the GitHub owner/repo are all required.",r();return}c=!0,a="",r();try{let t=await ZE(e,{accountId:n.accountId,owner:n.owner,productionBranch:n.branch||"main",projectName:n.projectName,repo:n.repo});i=await Zf(t).catch(()=>null)}catch(t){a=t instanceof Error?t.message:String(t)}c=!1,r()}async function M(){let e=x();if(!e)return;c=!0,r();try{await P1(e,null),i=null}catch(t){a=t instanceof Error?t.message:String(t)}c=!1,r()}function V(){let e=m;m=null,e?.close()}function __(e){s={accountId:e.accountId??"demo-account",connected:!0},f=[],i=e.deployment,rp(e.deployment),a="",c=!1,h=!1,r()}function u$(){let e=x(),{owner:t,repo:l}=H();s="loading",f=[],i=null,a="",c=!1,h=!1,n={accountId:"",branch:"main",owner:t,projectName:ca()?.projectName??I(e?.name??""),repo:l},r(),y()}
|
|
1
|
+
import{un,rn,ne}from"./studio-cp1gbff9.js";import{p}from"./studio-y7jehjrp.js";import{Tr}from"./studio-bftp4n4b.js";import{v}from"./studio-fqq890ap.js";import{rt,zt,T,R,An,Ct}from"./studio-7qvs7v0m.js";import{gd,YE,Zf,P1,ZE,ca,rp}from"./studio-aekhcdzw.js";import{Rf,$_}from"./studio-1a99w39s.js";import{D}from"./studio-tp642n5g.js";import{me}from"./studio-0bbxhhce.js";var P={$schema:"https://jxsuite.com/schema/v1",$id:"StudioPublish",$description:"Publish: the one-click Cloudflare Pages flow, as a `jx-dialog` over the kit. Eight bodies, one at a time, because the reader is at exactly one point of a chain — a host that cannot reach Cloudflare at all, a question still in flight, a connection that lapsed, an invitation to connect, a stored token Cloudflare refused, a field to paste a replacement into, the create-and-connect form, and the connected status. `publish/publish-panel.ts` keeps every one of those decisions and the calls that settle them; this document knows only which of the eight it was told to draw. **The token is never painted.** The field below binds no `value` — it is written by the reader and read once, on its way to storage — so a stored secret cannot reach the attribute, the serialised HTML or the accessibility tree, which is `studio.md` §15 rule 1 written as a missing binding rather than as a rule somebody remembers.",tagName:"jx-dialog",$props:{headline:"Publish",confirmLabel:"",cancelLabel:"Close",size:"md"},attributes:{part:"publish"},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},style:{$description:"What the five `.publish-*` names carried, keyed on `part`, and most of them do not survive the move. `.publish-modal` and its `.new-project-modal` base were a fixed card, a scroll body, a border, a shadow and a `z-index: 1000` — a modal `<dialog>` is every one of those, and the top layer is what the z-index was climbing towards. `.publish-field` was a label stacked over a control, which is `jx-field`'s whole shape. What is left is the column gap between bodies, the two button rows, the hint and the refusal. Nothing here uses `--spectrum-*`: those custom properties resolve only inside `<sp-theme>`, and a document mounted in a layer host is outside it, so each would silently have taken its hard-coded fallback.",'& [part="body"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)"},'& [part="note"], & [part="status-line"], & [part="deployment"]':{margin:"0",lineHeight:"1.5"},'& [part="rows"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)"},'& [part="actions"]':{$description:'Wraps rather than overflows (studio-ui-guidelines.md §4.6): two buttons whose labels are whole phrases — "Verify & Connect", "Preferences › Accounts" — are wider than a narrow dialog at the sizes a reader may have set.',display:"flex",flexWrap:"wrap",gap:"var(--jx-space-2)"},'& [part="submit"]':{alignSelf:"flex-start"},'& [part="hint"]':{$description:"Publishing rides every commit, so the connected body's only job is to say what is already happening. Dim, because it is a standing fact rather than something to act on.",margin:"0",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="failure"]':{$description:'`failure` and not `error`: `jx-textfield` and `jx-select` each draw a `[part="error"]` of their own inside this same tree, and the kit is light DOM — a scoped rule on that name would restyle the token field\'s refusal line too.',margin:"0",color:"var(--danger)",lineHeight:"1.5"},'& [part="link"], & [part="install-link"]':{color:"var(--accent)",textDecoration:"underline"},"& code":{fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-sm)"}},children:[{tagName:"div",attributes:{part:"body"},children:[{tagName:"div",attributes:{part:"body-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/body"},cases:{unsupported:{tagName:"p",attributes:{part:"note"},children:["This platform cannot reach the Cloudflare API. Publish by committing and pushing — your host builds ",{tagName:"code",textContent:"bunx jx build"}," and serves ",{tagName:"code",textContent:"dist/"},"."]},loading:{tagName:"p",attributes:{part:"note"},textContent:"Checking Cloudflare connection…"},lapsed:{tagName:"div",attributes:{part:"lapsed",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},textContent:"Your Cloudflare connection has expired, so publishing cannot reach your account. Reconnect to restore it — this site's Pages project and its settings are untouched."},{tagName:"jx-button",$props:{variant:"accent",disabled:{$ref:"#/state/busy"}},attributes:{part:"reconnect"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/connect"},value:[]}]},children:[{tagName:"span",textContent:"${state.connectLabel}"}]}]},hosted:{tagName:"div",attributes:{part:"hosted",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},textContent:"Connect your Cloudflare account to publish this site."},{tagName:"jx-button",$props:{disabled:{$ref:"#/state/busy"}},attributes:{part:"connect"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/connect"},value:[]}]},children:[{tagName:"span",textContent:"Connect Cloudflare"}]}]},stored:{tagName:"div",attributes:{part:"stored",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},textContent:"A Cloudflare API token is stored on this machine, and Cloudflare did not accept it. It may have been revoked, or it may be missing the Account Settings Read and Pages Read/Write permissions."},{tagName:"div",attributes:{part:"actions"},children:[{tagName:"jx-button",$props:{disabled:{$ref:"#/state/busy"}},attributes:{part:"replace"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/replace"},value:[]}]},children:[{tagName:"span",textContent:"Replace token"}]},{tagName:"jx-button",$props:{quiet:!0},attributes:{part:"accounts"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openAccounts"},value:[]}]},children:[{tagName:"span",textContent:"Preferences › Accounts"}]}]}]},token:{tagName:"div",attributes:{part:"token-form",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},textContent:"Paste a Cloudflare API token (permissions: Account Settings Read, Pages Read/Write). It is stored on this machine and only sent to the same-origin proxy — Studio never renders it back."},{tagName:"jx-field",$props:{span:!0,label:"API token"},attributes:{part:"token-row","data-field":"token"},children:[{tagName:"jx-textfield",$description:"No `value` binding, and its absence is the contract: a secret may pass through a field the reader typed it into and may never be painted into one they did not. The draft lives in the adapter's closure until Verify reads it, so nothing here — not the attribute, not the accessibility tree, not a DOM dump — has ever held it.",$props:{type:"password",placeholder:"cf_..."},attributes:{part:"token"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setToken"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"div",attributes:{part:"actions"},children:[{tagName:"jx-button",$props:{variant:"accent",disabled:{$ref:"#/state/busy"}},attributes:{part:"verify"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/verify"},value:[]}]},children:[{tagName:"span",textContent:"Verify & Connect"}]},{tagName:"jx-button",$props:{quiet:!0},attributes:{part:"accounts"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openAccounts"},value:[]}]},children:[{tagName:"span",textContent:"Preferences › Accounts"}]}]}]},form:{tagName:"div",attributes:{part:"connect-form",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},children:["Create a Cloudflare Pages project connected to this repository. Every commit then builds and publishes automatically (",{tagName:"code",textContent:"bunx jx build"},")."]},{tagName:"div",attributes:{part:"rows"},children:[{tagName:"jx-field",$props:{span:!0,label:"Account"},attributes:{part:"row","data-field":"account"},children:[{tagName:"jx-select",$props:{options:{$ref:"#/state/accountOptions"},value:{$ref:"#/state/accountId"}},attributes:{part:"account"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setAccount"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"Pages project name"},attributes:{part:"row","data-field":"projectName"},children:[{tagName:"jx-textfield",$props:{value:{$ref:"#/state/projectName"}},attributes:{part:"project-name"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setProjectName"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"GitHub owner"},attributes:{part:"row","data-field":"owner"},children:[{tagName:"jx-textfield",$props:{value:{$ref:"#/state/owner"}},attributes:{part:"owner"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setOwner"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"GitHub repository"},attributes:{part:"row","data-field":"repo"},children:[{tagName:"jx-textfield",$props:{value:{$ref:"#/state/repo"}},attributes:{part:"repo"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setRepo"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"Production branch"},attributes:{part:"row","data-field":"branch"},children:[{tagName:"jx-textfield",$props:{value:{$ref:"#/state/branch"}},attributes:{part:"branch"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setBranch"},value:[{$ref:"event#/target/value"}]}]}}]}]},{tagName:"jx-button",$props:{variant:"accent",disabled:{$ref:"#/state/busy"}},attributes:{part:"submit"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/submit"},value:[]}]},children:[{tagName:"span",textContent:"${state.submitLabel}"}]}]},status:{tagName:"div",attributes:{part:"status",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"status-line"},children:["Connected to Pages project ",{tagName:"strong",attributes:{part:"project-name"},textContent:"${state.deployProject}"},{tagName:"span",attributes:{part:"site-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasProductionUrl"},cases:{true:{tagName:"span",children:[" — ",{tagName:"a",attributes:{part:"link",href:"${state.productionUrl}",target:"_blank",rel:"noreferrer"},textContent:"${state.productionUrl}"}]}}}]},{tagName:"div",attributes:{part:"deployment-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasDeployment"},cases:{true:{tagName:"p",attributes:{part:"deployment"},children:["Latest deployment: ",{tagName:"strong",attributes:{part:"deployment-state"},textContent:"${state.deploymentState}"}," (${state.deploymentEnvironment}) — ",{tagName:"a",attributes:{part:"link",href:"${state.deploymentUrl}",target:"_blank",rel:"noreferrer"},textContent:"preview"}]},false:{tagName:"p",attributes:{part:"deployment"},textContent:"No deployments yet — the first commit after connecting triggers one."}}},{tagName:"p",attributes:{part:"hint"},textContent:"Publishing happens automatically on every commit."},{tagName:"div",attributes:{part:"actions"},children:[{tagName:"jx-button",$props:{disabled:{$ref:"#/state/busy"}},attributes:{part:"refresh"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/refresh"},value:[]}]},children:[{tagName:"span",textContent:"Refresh"}]},{tagName:"jx-button",$props:{variant:"negative",disabled:{$ref:"#/state/busy"}},attributes:{part:"disconnect"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/disconnect"},value:[]}]},children:[{tagName:"span",textContent:"Disconnect"}]}]}]}}},{tagName:"div",attributes:{part:"failure-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasFailure"},cases:{true:{tagName:"p",attributes:{part:"failure"},children:["${state.failure}",{tagName:"span",attributes:{part:"pages-app-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/needsPagesApp"},cases:{true:{tagName:"span",children:[" — if the Cloudflare Pages GitHub App is not installed on the repository, ",{tagName:"a",attributes:{part:"install-link",href:"${state.pagesAppUrl}",target:"_blank",rel:"noreferrer"},textContent:"install it"}," and retry."]}}}]}}}]}]};T("publish",P);var S="https://github.com/apps/cloudflare-pages/installations/new";function F(e){if(!e.supported)return"unsupported";if(e.loading)return"loading";if(e.connected&&e.lapsed)return"lapsed";if(!e.connected){if(e.hosted)return"hosted";return e.tokenStored&&!e.replacing?"stored":"token"}return e.deploy?"status":"form"}function w(e){let{error:t}=e;return{accountId:e.form.accountId,accountOptions:e.accounts,body:F(e),branch:e.form.branch,busy:e.busy,connectLabel:e.busy?"Reconnecting…":"Reconnect Cloudflare",deploymentEnvironment:e.deployment?.environment??"",deploymentState:e.deployment?`${e.deployment.stage}: ${e.deployment.status}`:"",deploymentUrl:e.deployment?.url??"",deployProject:e.deploy?.projectName??"",failure:t,hasDeployment:e.deployment!==null,hasFailure:t!=="",hasProductionUrl:(e.deploy?.productionUrl??"")!=="",needsPagesApp:/github/i.test(t)&&/app|install|source|repo/i.test(t),owner:e.form.owner,pagesAppUrl:S,productionUrl:e.deploy?.productionUrl??"",projectName:e.form.projectName,repo:e.form.repo,submitLabel:e.busy?"Connecting…":"Create & Connect"}}function C(e){let t=document.createElement("div");t.style.pointerEvents="auto",e.layer.append(t);let l="",g=!1,N=()=>{if(g)return;g=!0,e.onClosed()},d=v({...w(e.view),closed:N,connect:()=>{e.onConnect()},disconnect:()=>{e.onDisconnect()},openAccounts:()=>{e.onOpenAccounts()},refresh:()=>{e.onRefresh()},replace:()=>{l="",e.onReplaceToken()},setAccount:(o)=>{d.accountId=o,e.onField("accountId",o)},setBranch:(o)=>{d.branch=o,e.onField("branch",o)},setOwner:(o)=>{d.owner=o,e.onField("owner",o)},setProjectName:(o)=>{d.projectName=o,e.onField("projectName",o)},setRepo:(o)=>{d.repo=o,e.onField("repo",o)},setToken:(o)=>{l=o},submit:()=>{e.onSubmit()},verify:()=>{let o=l;l="",e.onSaveToken(o)}}),b=null,k=R("publish",d,t).then(async(o)=>{b=o;let u=o.root;if(g)return o.dispose(),u;if(await An(u),g)return u;return(u.querySelector('dialog[part="dialog"]')??u).setAttribute(rt,zt("modal","publish")),un(u),u});return{close(){let o=b?.root;if(o instanceof HTMLElement)rn(o);b?.dispose(),b=null,l="",t.remove(),N()},host:t,ready:k,update(o){Object.assign(d,w(o))}}}var m=null,s="loading",f=[],i=null,a="",c=!1,h=!1,n={accountId:"",branch:"main",owner:"",projectName:"",repo:""};function x(){return D?.projectConfig??null}function I(e){return e.toLowerCase().replaceAll(/[^a-z0-9]+/g,"-").replaceAll(/^-+|-+$/g,"").slice(0,58)||"site"}function H(){let e=p().projectRoot,t=/^([\w.-]+)\/([\w.-]+)(?:@.+)?$/.exec(e);return t?{owner:t[1],repo:t[2]}:{owner:"",repo:""}}function L(){let e=ca();return e?{productionUrl:e.productionUrl??"",projectName:e.projectName}:null}function j(){let e=gd(),t=s==="loading"?null:s;return{accounts:f.map((l)=>({label:l.name,value:l.id})),busy:c,connected:t?.connected===!0,deploy:L(),deployment:i?{environment:i.environment,stage:i.stage,status:i.status,url:i.url}:null,error:a,form:{...n},hosted:e&&typeof p().cfConnect==="function",lapsed:t?.connected===!0&&t.needsReconnect===!0,loading:s==="loading",replacing:h,supported:e,tokenStored:Rf()!==""}}function r(){if(m){m.update(j());return}m=C({layer:Ct("modal"),onClosed:V,onConnect:()=>{O()},onDisconnect:()=>{M()},onField:(e,t)=>{n={...n,[e]:t}},onOpenAccounts:E,onRefresh:()=>{y()},onReplaceToken:()=>{h=!0,a="",r()},onSaveToken:(e)=>{U(e)},onSubmit:()=>{_()},view:j()})}async function y(){s="loading",r();try{if(s=await p().cfConnection?.()??null,s?.connected&&!s.needsReconnect){f=await YE(),n={...n,accountId:s.accountId??f[0]?.id??""};let e=ca();if(e)i=await Zf(e),rp(i)}}catch(e){s=null,a=e instanceof Error?e.message:String(e)}r()}async function U(e){let t=e.trim();if(!t){a="Paste a token, or use Preferences › Accounts to forget the stored one.",r();return}$_(t),h=!1,a="",await y()}function E(){ne()?.run("app.preferences",{section:"accounts"})}async function O(){c=!0,a="",r();try{let e=await p().cfConnect?.()??null;if(e?.status==="timeout")a="The Cloudflare window didn't finish. Sign in there, then reconnect — nothing was changed.";else if(e?.status==="connected"&&!e.connection.accountId){let{openCfAccountPicker:t}=await (me("bb2yq946"),import("./cf-account-picker-bb2yq946.js"));await t()}}catch(e){a=e instanceof Error?e.message:String(e)}c=!1,Tr(),await y()}async function _(){let e=x();if(!e)return;if(!n.projectName||!n.owner||!n.repo||!n.accountId){a="Account, project name, and the GitHub owner/repo are all required.",r();return}c=!0,a="",r();try{let t=await ZE(e,{accountId:n.accountId,owner:n.owner,productionBranch:n.branch||"main",projectName:n.projectName,repo:n.repo});i=await Zf(t).catch(()=>null)}catch(t){a=t instanceof Error?t.message:String(t)}c=!1,r()}async function M(){let e=x();if(!e)return;c=!0,r();try{await P1(e,null),i=null}catch(t){a=t instanceof Error?t.message:String(t)}c=!1,r()}function V(){let e=m;m=null,e?.close()}function __(e){s={accountId:e.accountId??"demo-account",connected:!0},f=[],i=e.deployment,rp(e.deployment),a="",c=!1,h=!1,r()}function u$(){let e=x(),{owner:t,repo:l}=H();s="loading",f=[],i=null,a="",c=!1,h=!1,n={accountId:"",branch:"main",owner:t,projectName:ca()?.projectName??I(e?.name??""),repo:l},r(),y()}
|
|
2
2
|
export{__,u$};
|
|
3
3
|
|
|
4
4
|
//# debugId=86CB7ADEC271EE1764756E2164756E21
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
5
|
+
//# sourceMappingURL=studio-chdmwwzw.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{II,RI}from"./studio-693nhyky.js";import{nt,Ot,Za,ba,Mv,Tk,Lk,Ik,Vx,Ks,Rk,ih,va,Pv,Hd,Mp}from"./studio-nbxqcgvf.js";import{ge,Xa,Q,sh,ah,Ux,v,Hm,Bm,re,Bd,Qa,el,zd}from"./studio-fqq890ap.js";import{$i}from"./studio-0bbxhhce.js";var Ht={};$i(Ht,{SUBMENU_PLACEMENT:()=>Sa,clampIntoViewport:()=>ae,ensureCaret:()=>_k,focusRow:()=>Z,hideMenu:()=>oe,onMenuBeforeToggle:()=>cs,onMenuKeydown:()=>ds,onMenuPointerOver:()=>fs,onMenuToggle:()=>hs,openSubmenu:()=>At,parentRowOf:()=>U,rootMenuOf:()=>Ue,rowsOf:()=>W,showMenu:()=>Ta,submenuOf:()=>ie});var Et={};$i(Et,{anchorOf:()=>ye,clampIntoViewport:()=>ae,close:()=>Fd,measureAnchor:()=>ja,onBeforeToggle:()=>es,onToggle:()=>ts,onTransitionEnd:()=>ns,openAt:()=>zl,supportsAnchorPositioning:()=>te});function te(){let e=globalThis.CSS;return typeof e?.supports==="function"&&e.supports("position-area","block-end")}function ya(e){return e}var Be=new WeakMap;function ka(e){let t=e.currentTarget;return t instanceof HTMLElement?t:null}function ye(e){return Be.get(e)??null}function zl(e,t){let n=ya(e);if(typeof n.showPopover!=="function")return;if(!t){n.showPopover();return}Be.set(e,t);try{Yi(n,t)}catch(a){throw Be.delete(e),a}}function Yi(e,t){try{e.showPopover?.({source:t})}catch(n){if(!(n instanceof TypeError))throw n;e.showPopover?.()}}function Fd(e){let t=ya(e);if(typeof t.hidePopover==="function")t.hidePopover()}function Xi(e){let{id:t}=e;if(!t)return null;for(let n of e.ownerDocument.querySelectorAll("[popovertarget]"))if(n.getAttribute("popovertarget")===t)return n;return null}function $a(e,t){let{source:n}=t;if(n instanceof Element)return n;return ye(e)??Xi(e)}function ja(e,t,n=ye(t)){if(e.matchWidth!==!0||!n)return;let a=n.getBoundingClientRect();if(a.width>0)e.anchorWidth=Math.round(a.width)}function Qi(e,t){let n=()=>{if(typeof t.getAnimations==="function"&&t.getAnimations().length>0)return;e.settling=!1};if(typeof requestAnimationFrame==="function")requestAnimationFrame(n);else n()}function es(e,t){let n=ka(t);if(!n)return;let a=t.newState==="open",o=Number(e.floor??0);e.anchored=a&&o<=0&&$a(n,t)!==null}function ts(e,t){let n=ka(t);if(!n)return;let a=t.newState==="open";if(e.open=a,e.settling=!0,a){if(ja(e,n,$a(n,t)),!(e.anchored===!0&&te()))ae(e,n,{floor:Number(e.floor??0)})}else Be.delete(n);Qi(e,n)}function ns(e,t){if(t.target===t.currentTarget)e.settling=!1}function as(e){let t=Number.parseFloat(getComputedStyle(e).marginBlockStart);return Number.isFinite(t)&&t>0?t:0}function ae(e,t,n={}){let a=()=>{let o=t.getBoundingClientRect();if(o.width===0&&o.height===0)return;let r=4,i=n.floor&&n.floor>0?n.floor:window.innerHeight;if(o.right>window.innerWidth-r){let s=n.flipAgainst??null,d=s?Math.round(s.getBoundingClientRect().left)-o.width+2:-1;e.x=d>=r?d:Math.max(r,Math.round(window.innerWidth-o.width-r))}if(o.bottom>i)e.y=Math.max(r,Math.round(i-o.height-as(t)))};if(typeof requestAnimationFrame==="function")requestAnimationFrame(a);else a()}var qe="jx-menu-item",G="jx-menu",Sa="inline-end span-block-end";function Ke(e){let t=e.currentTarget;return t instanceof HTMLElement&&t.localName===G?t:null}function os(e,t){return t instanceof Element&&t.closest(G)===e}function W(e,t={}){let n=[...e.querySelectorAll(qe)].filter((a)=>a.closest(G)===e);return t.includeDisabled?n:n.filter((a)=>a.getAttribute("aria-disabled")!=="true")}function ie(e){for(let t of e.querySelectorAll(G))if(t.parentElement?.closest(qe)===e)return t;return null}function U(e){return e.parentElement?.closest(qe)??null}function Ue(e){let t=e;for(;;){let n=U(t),a=n?.closest(G);if(!n||!(a instanceof HTMLElement))return t;t=a}}function Ge(e){return e.open===!0}function Ta(e,t){if(!Ge(e))zl(e,t??null)}function oe(e){if(Ge(e)&&typeof e.hidePopover==="function")e.hidePopover()}function Z(e,t){if(e.length===0)return null;let n=(t%e.length+e.length)%e.length;for(let[o,r]of e.entries())r.tabIndex=o===n?0:-1;let a=e[n];return a.focus(),a}function rs(e,t){return e.findIndex((n)=>n===t||t instanceof Node&&n.contains(t))}function At(e,t={}){let n=ie(e);if(!n)return null;let a=e.getBoundingClientRect();if(n.x=Math.round(a.right)-2,n.y=Math.round(a.top)-4,e.expanded=!0,Ta(n,e),t.focus)Z(W(n),0);return n}function Mt(e,t=null){for(let n of W(e,{includeDisabled:!0})){if(n===t)continue;let a=ie(n);if(a)oe(a)}}function is(e){return e.querySelector('[part="label"]')?.textContent??e.textContent??""}function ss(e,t,n){let a=e.map((o)=>is(o).trim().toLowerCase());for(let o=1;o<=a.length;o++){let r=(t+o)%a.length;if(a[r].startsWith(n))return r}return-1}function ls(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey?e.key.toLowerCase():null}function ds(e,t){let n=Ke(t);if(!n||!os(n,t.target))return;let a=W(n),o=rs(a,t.target);switch(t.key){case"ArrowDown":{Z(a,o+1);break}case"ArrowUp":{Z(a,o===-1?-1:o-1);break}case"Home":{Z(a,0);break}case"End":{Z(a,-1);break}case"Enter":case" ":{a[o]?.click();break}case"ArrowRight":{let r=a[o];if(!r||!ie(r))return;Mt(n,r),At(r,{focus:!0});break}case"ArrowLeft":{let r=U(n);if(!r)return;oe(n),r.focus();break}case"Escape":{let r=U(n);oe(n),r?.focus();break}case"Tab":{oe(Ue(n));break}default:{let r=ls(t);if(r===null)return;let i=ss(a,o,r);if(i===-1)return;Z(a,i)}}t.preventDefault(),t.stopPropagation()}function cs(e,t){let n=Ke(t);if(!n)return;let a=t.newState==="open",o=String(e.placement??"")||(U(n)?Sa:"");e.area=o;let{source:r}=t,i=r instanceof Element?r:ye(n);e.anchored=a&&o!==""&&i!==null&&!us(n)}function hs(e,t){let n=Ke(t);if(!n)return;let a=t.newState==="open";e.open=a;let o=U(n);if(!a){if(Mt(n),o)o.expanded=!1;return}if(!(e.anchored===!0&&te()))ae(e,n,{flipAgainst:o?.closest(G)??null,floor:ps(n)});if(!n.contains(document.activeElement))Z(W(n),0)}function us(e){return Number(Ue(e).floor??0)>0}function ps(e){let t=Number(Ue(e).floor??0);return t>0?t:window.innerHeight}function _k(e){if(e.contains(document.activeElement))return;let t=e;for(;;){let a=W(t,{includeDisabled:!0}).map((o)=>ie(o)).find((o)=>o!==null&&Ge(o));if(!a)break;t=a}let n=U(t);if(W(t).length===0&&n){oe(t),n.focus();return}Z(W(t),0)}function fs(e,t){let n=Ke(t);if(!n||!(t.target instanceof Element))return;let a=t.target.closest(qe);if(!a||a.closest(G)!==n)return;let o=ie(a);if(Mt(n,a),o&&!Ge(o)&&a.getAttribute("aria-disabled")!=="true")At(a)}var ms=["auto","manual","hint"],Ea=new Set(["button","input"]),kk="auto";function Wl(e){return nt(e.attributes)?e.attributes:{}}function Kr(e,t){let n=Wl(e)[t];return typeof n==="string"?n:null}function ro(e){return typeof e.tagName==="string"?e.tagName.toLowerCase():""}function Jr(e,t="the popover"){let n=typeof e.id==="string"?e.id:Kr(e,"id");if(n)return`#${n}`;let a=ro(e);return a===""?t:`the <${a}>`}function bs(e){let t=Wl(e).popover;return typeof t==="string"?t:null}var gs=["popovertarget","popovertargetaction","command","commandfor"];function Aa(e){let t=new Set,n=new Set;for(let a of e){let o=typeof a?.tagName==="string"?a.tagName:"";if(!o.includes("-"))continue;if(Lt(a))t.add(o);let r=a.observedAttributes;if(Array.isArray(r)&&gs.every((i)=>r.includes(i)))n.add(o)}return{invokerTags:n,popoverTags:t}}function Lt(e){return"popover"in Wl(e)||"popover"in e}function Gs(e,t){return Lt(e)||(t?.popoverTags?.has(ro(e))??!1)}function nh(e){if(typeof e.id==="string"&&e.id!=="")return e.id;let t=Kr(e,"id");return t===""?null:t}function*Ya(e,t=[],n=null,a){yield{enclosing:n,node:e,path:t};let o=Gs(e,a)?e:n,{children:r}=e;if(Array.isArray(r)){for(let[d,l]of r.entries())if(l&&typeof l==="object")yield*Ya(l,[...t,"children",d],o,a)}else if(nt(r)&&nt(r.map))yield*Ya(r.map,[...t,"children","map"],o,a);let i=nt(e.map)?e.map:null;if(i)yield*Ya(i,[...t,"map"],o,a);let s=nt(e.cases)?e.cases:{};for(let[d,l]of Object.entries(s))if(l&&typeof l==="object")yield*Ya(l,[...t,"cases",d],o,a)}function Fm(e,t){let n=[];for(let{node:a}of Ya(e,[],null,t)){if(!Gs(a,t))continue;let o=nh(a);if(o!==null&&!n.includes(o))n.push(o)}return n}function wI(e,t){for(let{node:n}of Ya(e,[],null,t))if(Gs(n,t))return!0;return!1}function Ye(e){return e.startsWith("@")}function Ma(e){return e.startsWith(":")||e.startsWith("&")||e.startsWith(".")||e.startsWith("[")}function Qo(e,t){let n=e?.[t];if(n===void 0||ih(n)||Array.isArray(n))return null;return String(n)}function Ha(e){for(let[t,n]of Object.entries(e??{})){if(!ih(n))continue;if(Ma(t)&&t.includes(":popover-open")&&Qo(n,"display")!==null)return!0;if(Ye(t)&&Ha(n))return!0}return!1}function La(e){for(let[t,n]of Object.entries(e??{})){if(!ih(n))continue;if(Ma(t)&&t.includes(":popover-open"))return!0;if(Ye(t)&&La(n))return!0}return!1}var ws=["flexDirection","flex-direction","alignItems","align-items","justifyContent","justify-content","flexWrap","flex-wrap","gridTemplateColumns","grid-template-columns","gridTemplateRows","grid-template-rows","gap"];function xs(e){return ws.some((t)=>Qo(e,t)!==null)}function Na(e){if(!e)return[];let t=[];for(let[n,a]of Object.entries(e))if(Ye(n)&&ih(a)&&Qo(a,"display")!==null)t.push(n);return t}function Ia(e){if(!e)return[];let t=[],n=Qo(e,"transition");if(n!==null)t.push(n);for(let[a,o]of Object.entries(e))if(Ye(a)&&ih(o))t.push(...Ia(o));return t}function vs(e){if(!e)return!1;if(Qo(e,"positionAnchor")!==null||Qo(e,"position-anchor")!==null)return!0;return["top","left","right","bottom","inset","insetBlockStart","insetInlineStart"].some((t)=>(Qo(e,t)??"").includes("anchor("))}function ys(e){if(!e)return!1;if(Qo(e,"positionArea")!==null||Qo(e,"position-area")!==null||Qo(e,"positionTryFallbacks")!==null||Qo(e,"position-try-fallbacks")!==null)return!0;return Object.keys(e).some((t)=>t.startsWith("@supports"))}var R="See docs/framework/concepts/overlays.";function xI(e,t){let n=[...Ya(e,[],null,t)],a=Fm(e,t),o=n.some(({node:s})=>Gs(s,t)),r=new Set;for(let{node:s}of n)if(Ea.has(ro(s))){let d=Kr(s,"popovertarget");if(d!==null)r.add(d)}let i=[];for(let{enclosing:s,node:d,path:l}of n)if(i.push(...ks(d,l,s,a,o,t)),Lt(d))i.push(...$s(d,l,r));return i}function ks(e,t,n,a,o,r){let i=[],s=ro(e),d=Kr(e,"popovertarget"),l=Ea.has(s)||(r?.invokerTags?.has(s)??!1);if(d!==null&&!l)return i.push({detail:"`popovertarget` and `popovertargetaction` come from the `PopoverTargetAttributes` IDL mixin, which HTML includes into `HTMLButtonElement` and `HTMLInputElement` and into nothing else. Elsewhere they parse and do nothing. A link inside an open popover "+"dismisses it by navigating away, which is why this looks like it works — but it does "+`not for a new tab or a same-page fragment. Remove both attributes. ${R}`,fix:"invoker",message:`<${s||"element"}> carries popovertarget, which only <button> and <input> support.`,path:t,rule:"invoker-not-button",severity:"error"}),i;if(d!==null){if(o&&!a.includes(d)){let h=a.length>0?`The popovers here are: ${a.map((c)=>`"${c}"`).join(", ")}. `:"";i.push({detail:`No element in this document declares \`popover\` with the id "${d}". ${h}A target that names nothing does nothing, silently. ${R}`,message:`popovertarget="${d}" names no popover in this document.`,path:t,rule:"target-missing",severity:"error"})}else if(n!==null&&nh(n)!==null&&nh(n)!==d)i.push({detail:`This control is inside ${Jr(n)} but targets "${d}". Dismissing a different popover leaves the one the reader is looking at open. This is usually a copy-paste between two panels in the same file. ${R}`,message:`A control inside ${Jr(n)} targets "${d}" instead.`,path:t,rule:"target-mismatch",severity:"warn"})}if(s==="a"&&n!==null&&d===null){let h=Kr(e,"href")??(typeof e.href==="string"?e.href:null),c=Kr(e,"target")==="_blank",u=h!==null&&h.includes("#");if(c||u){let p=c?"it opens a new tab, so the panel stays open on the page behind it. ":"it is a same-document fragment, so the page scrolls behind the open panel. ";i.push({detail:`A link inside a panel normally dismisses it by navigating away. This one does not: ${p}`+"There is no declarative fix — a link cannot carry `popovertarget`. Move it out of the "+`panel, make it a <button>, or accept it deliberately. ${R}`,message:`A link inside ${Jr(n)} does not dismiss it.`,path:t,rule:"link-does-not-dismiss",severity:"warn"})}}return i}function $s(e,t,n){let a=[],{style:o}=e,r=Jr(e),i=bs(e);if(i!==null&&i!==""&&!ms.includes(i))a.push({detail:"`popover` is an enumerated attribute taking `auto`, `manual` or `hint`. Anything else falls back to the invalid-value default `manual`, which gives up light dismiss and gives "+`up Escape — so the panel opens and there is no way to close it. Write "auto". ${R}`,fix:"mode",message:`${r} declares popover="${i}", which is not one of auto, manual or hint.`,path:t,rule:"invalid-mode",severity:"error"});else if(typeof Wl(e).popover==="boolean")a.push({detail:`\`popover\` carries its value in its text, so a boolean is not the right shape. Written as \`true\` it reaches two of the compiler's emitters as \`popover="true"\`, which is not one of the three keywords, so HTML falls back to \`manual\`: no light dismiss, no Escape, and the trigger stops toggling. Write "auto". ${R}`,fix:"mode",message:`${r} writes popover as a boolean.`,path:t,rule:"invalid-mode",severity:"error"});let s=Qo(o,"display");if(s!==null&&s!=="revert"&&s!=="revert-layer")a.push({detail:"A closed popover is hidden by the browser's own `[popover]:not(:popover-open) { display: none }`. That rule is UA-origin, so any author `display` beats it at any specificity, and "+"the panel is laid out on every page whether it is open or not — usually parked off the "+`side of the viewport by the transform meant to animate it, so nothing looks wrong until you scroll sideways. \`display\` belongs in \`:popover-open\` and nowhere else. ${R}`,fix:"display",message:`${r} sets display in its base rule.`,path:t,rule:"base-display",severity:"error"});for(let l of Na(o))a.push({detail:`The same defect as a base \`display\`, arriving through \`${l}\` and therefore only at `+"one width — which is what makes it hard to see. Gate the TRIGGER on a breakpoint, never "+`the panel: the popover mechanism is what hides the panel. ${R}`,fix:"display",message:`${r} sets display inside ${l}.`,path:t,rule:"breakpoint-display",severity:"error"});if(Qo(o,"visibility")!==null)a.push({detail:`A second hiding mechanism the browser already provides. Once \`display\` leaves the base rule this one only adds a frame of flicker on open, and it hides the element from assistive technology in a way \`display: none\` already did. ${R}`,fix:"display",message:`${r} also hides itself with visibility.`,path:t,rule:"base-visibility",severity:"warn"});if(!La(o))a.push({detail:"Nothing changes when it opens, so no transition on it can run and — if `display` is not "+"in the base rule — the panel has no `display` at all while open. This is usually a panel "+`that was styled before it was made a popover. ${R}`,message:`${r} has no :popover-open rule.`,path:t,rule:"no-open-rule",severity:"warn"});else if(!Ha(o)&&s===null&&xs(o))a.push({detail:`${r} declares flex or grid properties, but neither its base rule nor its `+"`:popover-open` rule sets a `display` for them to apply to — and the base rule must not "+`(that is what keeps the closed panel hidden). So it opens with the UA's \`display: block\` and the layout silently does nothing. Put \`display: flex\` in \`:popover-open\`. ${R}`,fix:"open-display",message:`${r} is laid out with flex or grid but never sets display.`,path:t,rule:"no-open-display",severity:"error"});for(let l of Ia(o))if(l.includes("display")&&!l.includes("overlay")){a.push({detail:"`display …allow-discrete` keeps the box alive while it animates out; `overlay "+"…allow-discrete` is what keeps it in the TOP LAYER for those same milliseconds. "+`Without it the panel drops behind the page content and the backdrop disappears a frame early, so the exit reads as a flicker rather than an animation. ${R}`,message:`${r} transitions display but not overlay.`,path:t,rule:"cut-exit",severity:"warn"});break}if(vs(o)&&!ys(o))a.push({detail:"When `anchor()` does not resolve, every inset it feeds computes to `auto` — and a "+`\`position: fixed\` box with four \`auto\` insets falls back to its STATIC position, which for a panel declared inside a header is in the middle of the header. Use \`position-area\` with \`position-try-fallbacks\`, or add a \`@supports\` block that positions it without anchors. ${R}`,message:`${r} is anchor-positioned with no fallback.`,path:t,rule:"unsafe-anchor",severity:"warn"});let d=nh(e);if(d!==null&&!n.has(d))a.push({detail:`No \`<button>\` or \`<input>\` in this document names it with \`popovertarget\`. If it is opened from another file or from a function that calls \`showPopover()\`, this is fine; otherwise there is no way for a reader to open it. ${R}`,message:`${r} has no invoker in this document.`,path:t,rule:"no-invoker",severity:"warn"});return a}function _I(e){if(!e)return null;let t=[];if(Qo(e,"display")!==null)t.push("display");if(Qo(e,"visibility")!==null)t.push("visibility");let n=Na(e);if(t.length===0&&n.length===0)return null;let a=va(e,":popover-open")??va(e,"&:popover-open"),o=Qo(a,"display")!==null?null:Qo(e,"display")??null;return{base:t,breakpoints:n,openDisplay:o}}var Ca=el(null);function kI(e){Ca.value=e}function ne(){return Ca.value}function Oa(e){return e.replaceAll(/[A-Z]/g,(t)=>`-${t.toLowerCase()}`)}var js=new Set(["all","print","screen","speech"]);function Ra(e,t){if(e.startsWith("@--"))return t[e.slice(1)]??e.slice(1);if(e.startsWith("@(")){let n=e.slice(2,-1).trim();return js.has(n.toLowerCase())?n:e.slice(1)}return null}function Nt(e){return e.startsWith("@position-try")||e.startsWith("@property")||e.startsWith("@font-face")||e.startsWith("@counter-style")}function $v(e){return e.startsWith("@keyframes")}function Da(e,t){let n=[];for(let a of It(e))for(let o of It(t))n.push(Ss(a,o));return n.join(", ")}function Ss(e,t){if(t.startsWith("&"))return t.replaceAll("&",e);if(t.startsWith("[")||t.startsWith(":")||t.startsWith("."))return`${e}${t}`;return`${e} ${t}`}function It(e){let t=[],n=0,a=null,o=0;for(let i=0;i<e.length;i+=1){let s=e[i];if(a){if(s==="\\")i+=1;else if(s===a)a=null;continue}if(s==='"'||s==="'")a=s;else if(s==="("||s==="[")n+=1;else if(s===")"||s==="]")n=Math.max(0,n-1);else if(s===","&&n===0)t.push(e.slice(o,i)),o=i+1}t.push(e.slice(o));let r=t.map((i)=>i.trim()).filter((i)=>i!=="");return r.length>0?r:[e]}var Ts=/[\s>+~,()]/,Es=/^[A-Za-z_\u{00A0}-\u{FFFF}][\w\u{00A0}-\u{FFFF}-]*/u;function As(e,t){let n="",a=0;for(;;){let o=e.indexOf("[open]",a);if(o===-1)return n+e.slice(a);let r=o;while(r>0&&!Ts.test(e[r-1]))r-=1;let i=Es.exec(e.slice(r,o))?.[0]?.toLowerCase(),s=i===void 0?t.dialog===!0:i==="dialog";n+=e.slice(a,o)+(s?"[data-jx-dialog-open]":"[open]"),a=o+6}}function Ct(e,t={}){if(e.includes("::backdrop"))return null;let n=e.replaceAll(":popover-open","[data-jx-popover-open]").replaceAll(":modal","[data-jx-dialog-open]").replaceAll("[inert]","[data-jx-inert]");return As(n,t)}var ke="data-color-scheme";function Dv(e){return/^\(\s*prefers-color-scheme\s*:\s*(light|dark)\s*\)$/.exec(e.trim())?.[1]??null}function Pa(e,t){if(e===":root"||e==="html")return{auto:`${e}:where(:not([${ke}]))`,forced:`${e}:where([${ke}="${t}"])`};return{auto:`:where(:root:not([${ke}])) ${e}`,forced:`:where(:root[${ke}="${t}"]) ${e}`}}function Rt(e){return e.startsWith(":")||e.startsWith(".")||e.startsWith("&")||e.startsWith("[")}function Dt(e){return e.startsWith("--")?e:Oa(e)}function $e(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function Fa(e,t,n){let a=n.map(([r,i])=>`${r}: ${i}`).join("; "),o=t===null?a:`${t} { ${a} }`;for(let r=e.length-1;r>=0;r-=1)o=`${e[r]} { ${o} }`;return o}function Ms(e,t,n){let a=n.map(({selector:r,declarations:i})=>`${r} { ${i.map(([s,d])=>`${s}: ${d}`).join("; ")} }`).join(" "),o=`@keyframes ${t} { ${a} }`;for(let r=e.length-1;r>=0;r-=1)o=`${e[r]} { ${o} }`;return o}function Hs(e){let t=Object.keys(e).filter((a)=>$v(a));if(t.length===0)return e;let n={...e};for(let a of t)delete n[a];return n}function Ls(e){let t=e.startsWith("&")?e.slice(1):e;return t===""||t.startsWith(":")||t.startsWith(".")||t.startsWith("[")}function je(e,t={}){let{scope:n=null,mediaQueries:a={},transposeValue:o=(f)=>f,transposeSelector:r=(f)=>f,resolveValue:i}=t,s=[],d=(f)=>f!==null&&typeof f==="object"&&!Array.isArray(f)&&!Ot(f),l=(f,m)=>{if(d(m))return[m];if(!Nt(f)||!Array.isArray(m)||m.length===0)return[];return m.every((x)=>d(x))?m:[]},h=(f,m,x,y)=>{if(m===void 0||m===null)return null;if(Ot(m))return x?i?.(f,m,y)??null:null;if(typeof m==="object")return null;let k=String(m);if(Ks(k))return x?i?.(f,k,y)??null:null;return o(k)},c=(f,m,x=!0,y="self")=>{let k=[];for(let[T,I]of Object.entries(f)){if(l(T,I).length>0)continue;if(m&&(T.startsWith("@")||Rt(T)))continue;if(T.startsWith("$"))continue;let j=h(T,I,x,y);if(j!==null)k.push([Dt(T),j])}return k},u=(f,m,x,y,k)=>{if(x.length===0)return;let T=m;if(T!==null){let j=r(T);if(j===null)return;T=j}let I=Fa(f,T,x);s.push({text:I,conditions:[...f],selector:T,declarations:x,target:y,key:$e(I),...typeof k==="string"&&k!==""?{description:k}:{}})},p=(f,m,x)=>{let y=f.slice(10).trim();if(y==="")return;let k=[];for(let[I,j]of Object.entries(m)){if(!d(j))continue;let C=c(j,!0,!1,"unscoped");if(C.length>0)k.push({declarations:C,selector:I.trim()})}if(k.length===0)return;let T=Ms(x,y,k);s.push({blocks:k,conditions:[...x],declarations:[],key:$e(T),selector:null,target:"unscoped",text:T})},g=(f,m,x,y,k)=>{if(f==="@--")return;if(Nt(f)){u([...y,f],null,c(m,!1,!0,"unscoped"),"unscoped",m.$description);return}if($v(f)){p(f,m,y);return}let T=Ra(f,a),I=T===null?f:`@media ${T}`,j=T===null?null:Dv(T);if(j!==null&&x!==null){let{auto:C,forced:w}=Pa(x,j);b(m,C,[...y,I],k),b(Hs(m),w,y,k);return}b(m,x,[...y,I],k)};function b(f,m,x,y){u(x,m,c(f,!0,!0,y),y,f.$description);for(let[k,T]of Object.entries(f))for(let I of l(k,T))if(k.startsWith("@"))g(k,I,m,x,y);else if(m!==null)b(I,Da(m,k),x,Ls(k)?y:"descendant")}return b(e,n,[],"self"),s}var z="en-US",za="UTC",Va=[{api:"Intl.NumberFormat",params:["value","locale","options"],path:"Intl/formatNumber",summary:"Format a number for a locale — grouping, decimals, currency, percent, units."},{api:"Intl.DateTimeFormat",params:["value","locale","options"],path:"Intl/formatDate",summary:"Format a date or timestamp for a locale. Pass `timeZone` in options."},{api:"Intl.RelativeTimeFormat",params:["value","unit","locale","options"],path:"Intl/formatRelativeTime",summary:'Format a relative time — `-3, "day"` becomes "3 days ago".'},{api:"Intl.ListFormat",params:["values","locale","options"],path:"Intl/formatList",summary:'Join a list the way a locale does — "a, b, and c", not a hand-written comma join.'},{api:"Intl.PluralRules",params:["value","locale","options"],path:"Intl/plural",summary:'Which plural category a number falls in ("one", "few", "other") — many languages have '+"more than two, so a ternary on `n === 1` is wrong outside English."},{api:"Intl.Collator",params:["a","b","locale","options"],path:"Intl/compare",summary:'Compare two strings for sorting. `<` and `sort()` order by UTF-16 code unit, which puts "Zebra" before "apple" and sorts every accented word into the wrong place.'},{api:"Intl.DisplayNames",params:["code","type","locale","options"],path:"Intl/displayName",summary:'The name of a language, region, script or currency in a locale — "de" as "German" or '+'"Deutsch", from CLDR rather than a hand-kept table.'},{api:"Intl.Segmenter",params:["value","granularity","locale"],path:"Intl/segment",summary:"Split text into graphemes, words or sentences (UAX #29). `[...str]` splits code points, so it cuts an emoji with a skin-tone modifier in half."}],Pt=Va.map((e)=>e.path),Wa=Object.fromEntries(Va.map((e)=>[e.path,e.params.indexOf("locale")]));function bI(){return`the Intl helpers ${Pt.join(", ")}`}function Ns(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function Ft(e){if(e==="")return[];return e.split("/").map((t)=>Ns(t))}function P(e,t){let n=e;for(let a of Ft(t))n=n?.[a];return n}function Zt(e){let t=e.$map;return t&&typeof t==="object"?t:void 0}var Ba=new Set(["=","+=","-=","*=","/=","push","pop","shift","unshift","splice"]),qa=new Set(["!","-"]),Ka=new Set(["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||","??"]),Is=new Set(["=","+=","-=","*=","/="]),Cs=new Set(["push","pop","shift","unshift","splice"]),Ua=new Set(["reduce","map","filter"]),Ga=new Set(["?:","switch"]),Rp=new Set(["includes","indexOf","lastIndexOf","join","slice","concat","at","flat","toSorted","toReversed","toSpliced","with","toUpperCase","toLowerCase","trim","trimStart","trimEnd","split","startsWith","endsWith","padStart","padEnd","replaceAll","repeat","charAt","normalize","toLocaleUpperCase","toLocaleLowerCase","toFixed","toPrecision","toLocaleString"]),vk=new Set([...Ba,...qa,...Ka,...Ua,...Ga,...Rp,"call"]),yk=new Set(["isNaN","isFinite","parseFloat","parseInt","encodeURIComponent","decodeURIComponent","structuredClone","Math/abs","Math/ceil","Math/floor","Math/round","Math/trunc","Math/sign","Math/sqrt","Math/cbrt","Math/pow","Math/exp","Math/log","Math/log2","Math/log10","Math/min","Math/max","Math/hypot","Number/isInteger","Number/isFinite","Number/isNaN","Number/parseFloat","Number/parseInt","JSON/parse","JSON/stringify","Object/keys","Object/values","Object/entries","Object/fromEntries","Array/from","Array/isArray","Array/of","String/fromCharCode","String/fromCodePoint",...Pt]),Os={"Intl/compare":(e,t,n,a)=>new Intl.Collator(n??z,a).compare(e,t),"Intl/displayName":(e,t,n,a)=>new Intl.DisplayNames(n??z,{...a,type:t??"language"}).of(e),"Intl/formatDate":(e,t,n)=>new Intl.DateTimeFormat(t??z,{timeZone:za,...n}).format(new Date(e)),"Intl/formatList":(e,t,n)=>new Intl.ListFormat(t??z,n).format(e),"Intl/formatNumber":(e,t,n)=>new Intl.NumberFormat(t??z,n).format(e),"Intl/formatRelativeTime":(e,t,n,a)=>new Intl.RelativeTimeFormat(n??z,a).format(e,t),"Intl/plural":(e,t,n)=>new Intl.PluralRules(t??z,n).select(e),"Intl/segment":(e,t,n)=>[...new Intl.Segmenter(n??z,{granularity:t??"grapheme"}).segment(e)].map((a)=>a.segment)};function Rs(e,t,n){let a=Wa[e];if(a===void 0||a<0||t[a]!=null)return t;let r=n.$page?.locale;if(typeof r!=="string"||r==="")return t;let i=[...t];return i[a]=r,i}function Ds(e){return e.startsWith("window#/")&&yk.has(e.slice(8))}function Om(e){return Ba.has(e)}var _a=64,Ps=64;function L(e,t){if(!e)return;let n=(e.depth??0)+1;if(n>Ps)return;return{depth:n,path:[...e.path??[],...Array.isArray(t)?t:[t]],report:e.report}}function H(e,t,n,a,o){if(e===null||e===void 0)return e;if(typeof e==="object"&&!Array.isArray(e)&&"operator"in e)return qs(e,t,n,a,o);if(typeof e==="object"&&!Array.isArray(e)&&"$ref"in e){let r=Xe(e.$ref,t,n,a);return o?.report(o.path??[],r),r}if(Array.isArray(e))return e.map((r,i)=>H(r,t,n,a,L(o,i)));return o?.report(o.path??[],e),e}function Fs(e,t,n,a){let o=(r)=>{if(!e.slice(r.length).includes("/"))return t;return Xe(e.slice(0,e.lastIndexOf("/")),t,n,a)};if(e.startsWith("#/state/"))return o("#/state/");if(e.startsWith("parent#/"))return o("parent#/");if(e.startsWith("$map/")||e.startsWith("$args/"))return e.split("/").length>2?Xe(e.slice(0,e.lastIndexOf("/")),t,n,a):void 0;return}function Xe(e,t,n,a){if(e==="$reduce/acc")return a?.acc;if(e.startsWith("$reduce/"))return a?.acc;if(e.startsWith("$args/")){let o=e.slice(6).split("/"),r=a?.args?.[o[0]];return o.length>1?_(r,o.slice(1).join("/")):r}if(e.startsWith("event#/")){let o=e.slice(7);return _(n,o)}if(e.startsWith("$map/")){let o=e.split("/"),[,r]=o,i,s=Zt(t);if(r==="item")i=a?.item??s?.item??t["$map/item"];else if(r==="index")i=a?.index??s?.index??t["$map/index"];else i=s?.[r]??t[`$map/${r}`];return o.length>2?_(i,o.slice(2).join("/")):i}if(e.startsWith("#/state/"))return P(t,e.slice(8));if(e.startsWith("parent#/"))return P(t,e.slice(8));if(e.startsWith("window#/"))return _(globalThis.window,e.slice(8));if(e.startsWith("document#/"))return _(globalThis.document,e.slice(10));return P(t,e)??null}function Zs(e,t,n,a){if(e.startsWith("$map/")){let o=e.split("/"),[,r]=o,i,s=Zt(t);if(r==="item")i=a?.item??s?.item??t["$map/item"];else if(r==="index")i=a?.index??s?.index??t["$map/index"];else i=s?.[r]??t[`$map/${r}`];if(o.length>2){let d=o.slice(2),l=d.pop(),h=d.length>0?_(i,d.join("/")):i;return{key:l,obj:h}}return{key:r==="item"?"$map/item":"$map/index",obj:Zt(t)??t}}if(e.startsWith("#/state/")){let o=e.slice(8);if(o.indexOf("/")===-1)return{key:o,obj:t};let i=Ft(o),s=i.pop(),d=t;for(let l of i)d=d[l];return{key:s,obj:d}}return{key:e,obj:t}}function qs(e,t,n,a,o){let r=zs(e,t,n,a,o);return o?.report(o.path??[],r),r}function zs(e,t,n,a,o){let{operator:r,target:i,value:s,initial:d}=e;if(!vk.has(r))throw Error(`$expression: unknown operator "${r}"`);if(qa.has(r)&&!("value"in e)){let l=H(i,t,n,a,L(o,"target"));if(r==="!")return!l;if(r==="-")return-l}if(r==="call"){let l=i?.$ref;if(typeof l!=="string")throw TypeError("$expression: call target must be a $ref pointer");let h=(a?.callDepth??0)+1;if(h>_a)throw Error(`$expression: call depth exceeded (${_a})`);let c=Array.isArray(s)?s.map((p,g)=>H(p,t,n,a,L(o,["value",g]))):[];if(l.startsWith("window#/")){if(!Ds(l))throw Error(`$expression: "${l}" is not a blessed pure global`);let p=l.slice(8),g=Os[p];if(g)return g(...Rs(p,c,t));let b=_(globalThis.window,p),f=p.lastIndexOf("/"),m=f===-1?globalThis.window:_(globalThis.window,p.slice(0,f));return b.apply(m,c)}let u=Xe(l,t,n,a);if(typeof u==="function")return u.apply(Fs(l,t,n,a),c);if(u&&typeof u==="object"&&"$expression"in u){let p=u,g={};for(let[b,f]of(p.parameters??[]).entries()){let m=typeof f==="string"?f:f?.name??"";if(!m)continue;g[m]=c[b]===void 0&&typeof f==="object"&&f!==null&&"default"in f?f.default:c[b]}return qs(p.$expression,t,n,{args:g,callDepth:h})}throw TypeError(`$expression: call target "${l}" is not callable`)}if(Ga.has(r)){if(r==="?:"){let p=H(i,t,n,a,L(o,"target"));if(o){let g=H(s,t,n,a,L(o,"value")),b=H(d,t,n,a,L(o,"initial"));return p?g:b}return p?H(s,t,n,a):H(d,t,n,a)}let l=H(i,t,n,a,L(o,"target")),h=String(l),c=e.cases??{},u=Object.hasOwn(c,h);if(o){let p;for(let[b,f]of Object.entries(c)){let m=H(f,t,n,a,L(o,["cases",b]));if(b===h)p=m}let g=H(e.default,t,n,a,L(o,"default"));return u?p:g}return u?H(c[h],t,n,a):H(e.default,t,n,a)}if(Ka.has(r)){let l=H(i,t,n,a,L(o,"target")),h=H(s,t,n,a,L(o,"value"));switch(r){case"+":return l+h;case"-":return l-h;case"*":return l*h;case"/":return l/h;case"%":return l%h;case"===":return l===h;case"!==":return l!==h;case"<":return l<h;case"<=":return l<=h;case">":return l>h;case">=":return l>=h;case"&&":return l&&h;case"||":return l||h;case"??":return l??h;default:break}}if(Is.has(r)){let l=H(s,t,n,a,L(o,"value")),{obj:h,key:c}=Zs(i.$ref,t,n,a);switch(r){case"=":{h[c]=l;break}case"+=":{let u=h[c];h[c]=u+l;break}case"-=":{let u=h[c];h[c]=u-l;break}case"*=":{let u=h[c];h[c]=u*l;break}case"/=":{let u=h[c];h[c]=u/l;break}default:break}return}if(Cs.has(r)){let l=H(i,t,n,a,L(o,"target"));switch(r){case"push":return l.push(H(s,t,n,a,L(o,"value")));case"unshift":return l.unshift(H(s,t,n,a,L(o,"value")));case"pop":return l.pop();case"shift":return l.shift();case"splice":{let h=H(s,t,n,a,L(o,"value"));return l.splice(...h)}default:break}}if(Rp.has(r)){let l=H(i,t,n,a,L(o,"target")),h=s===void 0?[]:Array.isArray(s)?H(s,t,n,a,L(o,"value")):[H(s,t,n,a,L(o,"value"))],c=l?.[r];if(typeof c!=="function")return;return c.apply(l,h)}if(Ua.has(r)){let l=H(i,t,n,a,L(o,"target"));if(r==="reduce"){let h=H(d,t,n,a,L(o,"initial"));for(let[c,u]of l.entries())h=qs(s,t,n,{acc:h,index:c,item:u},c===0?L(o,"value"):void 0);return h}if(r==="map")return l.map((h,c)=>qs(s,t,n,{...a,index:c,item:h},c===0?L(o,"value"):void 0));if(r==="filter")return l.filter((h,c)=>qs(s,t,n,{...a,index:c,item:h},c===0?L(o,"value"):void 0))}return}function _(e,t){return P(e,t)}function Y(e,t,n,a){return H(e,t,n,a)}function Js(e){if("operator"in e)return"expression";if("if"in e)return"if";if("$switch"in e)return"switch";if("stopPropagation"in e)return"stopPropagation";if("preventDefault"in e)return"preventDefault";return"dispatch"}async function se(e,t,n,a={}){let o=a.args?{args:a.args}:void 0;for(let r of e)switch(Js(r)){case"expression":{let i=qs(r,t,n,o);if(i&&typeof i.then==="function")await i;break}case"if":{let i=r,s=Y(i.if,t,n,o)?i.then:i.else;if(Array.isArray(s))await se(s,t,n,a);break}case"switch":{let i=r,s=String(Y(i.$switch,t,n,o)),d=i.cases??{},l=Object.hasOwn(d,s)?d[s]:i.default;if(Array.isArray(l))await se(l,t,n,a);break}case"dispatch":{let i=r,s=typeof a.target==="function"?a.target():a.target,d=n?.currentTarget??s;if(!d)break;let l={};if("detail"in i)l.detail=Y(i.detail,t,n,o);if(i.bubbles!==void 0)l.bubbles=i.bubbles;if(i.composed!==void 0)l.composed=i.composed;d.dispatchEvent(new CustomEvent(i.dispatchEvent,l));break}case"stopPropagation":{n?.stopPropagation();break}case"preventDefault":{n?.preventDefault();break}default:break}}function eo(e,t){for(let n of e.split(";")){let a=n.indexOf("=");if(a===-1)continue;if(n.slice(0,a).trim()===t)return n.slice(a+1)}return null}function to(e,t,n){let a=e.startsWith("__Host-"),o=[`${e}=${encodeURIComponent(JSON.stringify(t))}`];if(n.maxAge!==void 0)o.push(`Max-Age=${n.maxAge}`);let r=a?"/":n.path;if(r)o.push(`Path=${r}`);if(n.domain&&!a)o.push(`Domain=${n.domain}`);let{sameSite:i}=n;if(n.secure===!0||a||e.startsWith("__Secure-")||i?.toLowerCase()==="none")o.push("Secure");if(i)o.push(`SameSite=${i}`);return o.join("; ")}var no=1,ao=!1;function Vs(e){if(ao||typeof e!=="string")return;let t=e.match(/\/schema\/v(\d+)\b/);if(t&&Number(t[1])!==no)ao=!0,console.warn(`Jx: document $schema is version v${t[1]} but this runtime supports v${no}. Behavior may be undefined; there is no format migrator yet.`)}var Ws=/^[$#]/;function _s(e){for(let t of Object.keys(e))if(Ws.test(t))throw TypeError(`Jx mount: host scope key "${t}" is reserved — names beginning with "$" or "#" are `+"runtime vocabulary")}async function vI(e,t,n={}){let a=n.scope??{};_s(a);let o=n.base?new URL(n.base,location.href).href:location.href,r={base:o,media:n.media??e.$media??null,root:null,...n.resolver?{resolver:n.resolver}:{},...n.skipServerFunctions===void 0?{}:{skipServerFunctions:n.skipServerFunctions},...n.skipAutoRequests===void 0?{}:{skipAutoRequests:n.skipAutoRequests}};if(Vs(e.$schema),e.$elements)await st(e.$elements,o,r);if(e.$head)Zl(e.$head,o);let i=await Dp(e,a,o,r),s=new Set,d={_ctx:r,onNodeCreated:(g,b,f,m)=>{if(g instanceof Element&&g.tagName.includes("-"))s.add(g.tagName.toLowerCase());n.onNodeCreated?.(g,b,f,m)},...n.onNodeMoved?{onNodeMoved:n.onNodeMoved}:{}},{result:l,stop:h}=wk(()=>Ja(e,i,d));r.root=l;let c=!1,u=!1,p=()=>{if(u)return;if(u=!0,n.signal?.removeEventListener("abort",p),h(),c&&typeof i.onUnmount==="function")i.onUnmount(i);l.remove()};if(n.signal?.aborted)p();else if(n.signal?.addEventListener("abort",p,{once:!0}),t.append(l),c=!0,typeof i.onMount==="function")i.onMount(i);return{scope:i,root:l,elements:s,dispose:p}}var Se=new Map;function zx(e,t){let n=Promise.resolve(t);Se.set(e,n);try{Se.set(new URL(e,location.href).href,n)}catch{}}async function Kt(e,t){if(typeof e!=="string")return e;let n=t?.resolver?.(e);if(n)return n;if(Se.has(e))return Se.get(e);let a=fetch(e).then(async(o)=>{if(!o.ok)throw Error(`Jx: failed to fetch ${e} (${o.status})`);if((o.headers?.get("Content-Type")??"").includes("text/html"))throw Error(`Jx: ${e} returned HTML, not a document — the host answered a missing file with its `+"app shell (a single-page fallback), so this path is not served.");return await o.json()});return Se.set(e,a),a}var Bs=new Set(["type","properties","items","enum","minimum","maximum","minLength","maxLength","pattern","required","examples"]),yo={skip:!1};function $p(e){yo.skip=e}var Us={skip:!1};var oo=null;function ko(e){return oo?`${e}?token=${encodeURIComponent(oo)}`:e}function wk(e){let t=ge(!0);try{return{result:t.run(e),stop:()=>t.stop()}}catch(n){throw t.stop(),n}}var Ys=!1;var Xs=/(-?\d*\.?\d+)(?:s|l|d)?v(h|w|min|max|i|b)\b/gi,Qs={b:"cqb",h:"cqh",i:"cqi",max:"cqmax",min:"cqmin",w:"cqw"};function tl(e){if(!Ys||!e.includes("v"))return e;return e.replace(Xs,(t,n,a)=>`${n}${Qs[a.toLowerCase()]??`cq${a}`}`)}var nl=!1;var $o=!1;var jo=!1;var et=!1;function Jt(e){return et||e.dataset.jxPath!==void 0}function al(e,t){if(nl&&t==="href"&&(e.tagName==="A"||e.tagName==="AREA"))return"data-jx-href";if($o&&t==="popover"&&Jt(e))return"data-jx-popover";if(jo&&Jt(e)){if(t==="commandfor")return"data-jx-commandfor";if(t==="inert")return"data-jx-inert";if(t==="open"&&e.tagName==="DIALOG")return"data-jx-open"}return t}var de=null;function xk(e){de=e}var ol=new Set(["src","poster","data"]),rl=new Set(["srcset","imagesrcset"]),il=new Set(["LINK"]);function sl(e,t){return ol.has(t)||t==="href"&&il.has(e)}function ot(e,t,n){if(!de||n==="")return n;let a=t.toLowerCase();if(rl.has(a)){let o=II(n),r=!1,i=o.map((s)=>{let d=de?.(s.url,a)??null;if(d===null||d===s.url)return s;return r=!0,{descriptor:s.descriptor,url:d}});return r?RI(i):n}if(!sl(e,a))return n;return de(n,a)??n}var ll=/\burl\(\s*(?<q>["']?)(?<u>[^"')]*)\k<q>\s*\)/g;function dl(e){if(!de||!e.includes("url("))return e;return e.replaceAll(ll,(t,n,a)=>{let o=a===""?null:de?.(a,"url()")??null;return o===null?t:`url(${n}${o}${n})`})}function io(e){return tl(dl(e))}var cl=!1;var hl=/^\s*\$\{\s*state\.(\w+)\s*\}\s*$/;function ul(e,t,n){if(!cl||e!=="textContent")return null;let a=null;if(N(t)){if(!t.$ref.startsWith("#/state/"))return null;let r=t.$ref.slice(8);a=r&&!r.includes("/")?r:null}else if(typeof t==="string")a=hl.exec(t)?.[1]??null;if(!a)return null;let o=re(n)[a];if(Bd(o)||typeof o==="function")return null;if(typeof o==="object"&&o!==null)return null;return a}async function Dp(e,t={},n=location.href,a){let o=()=>a?.root??null,r={},i=e.state??{},s=Bm(t);for(let c of Object.keys(t))if(s&&!(c in i))Object.defineProperty(r,c,{configurable:!0,enumerable:!0,get:()=>t[c],set:(u)=>{t[c]=u}});else r[c]=t[c];let d=e.imports??{};for(let[,c]of Object.entries(i))if(Lk(c)&&!c.$src){let u=d[c.$prototype];if(u){if(!u.endsWith(".class.json")){console.warn(`Jx: import "${c.$prototype}" must map to a .class.json path, got "${u}"`);continue}c.$src=u}}for(let[c,u]of Object.entries(i)){if(typeof u==="string"){if(!u.includes("${"))r[c]=u;continue}if(typeof u==="number"||typeof u==="boolean"||u===null){r[c]=u;continue}if(Array.isArray(u)){r[c]=u;continue}if(typeof u==="object"){if(u.$prototype)continue;if(ba(u))continue;if(Ik(u))continue;if("default"in u){r[c]=u.default;continue}if(pl(u))continue;r[c]=u}}let l=v(r);for(let[c,u]of Object.entries(i))if(typeof u==="string"&&u.includes("${"))l[c]=zd(()=>J(u,l));for(let[c,u]of Object.entries(i))if(ba(u)){let p=u.$expression;if(Mv(u)){let g=u.parameters;l[c]=(...b)=>{let f={};for(let[m,x]of g.entries()){let y=typeof x==="string"?x:x?.name??"";if(!y)continue;f[y]=b[m]===void 0&&typeof x==="object"&&x!==null&&"default"in x?x.default:b[m]}return qs(p,l,null,{args:f})}}else if(Om(p.operator)){let g=(b,f)=>qs(p,b,f);l[c]=g}else l[c]=zd(()=>qs(p,l,null))}for(let[c,u]of Object.entries(i))if(Tk(u)){let{body:p}=u;if(Array.isArray(u.parameters)&&u.parameters.length>0){let g=u.parameters;l[c]=(...b)=>{let f={};for(let[m,x]of g.entries()){let y=typeof x==="string"?x:x?.name??"";if(!y)continue;f[y]=b[m]===void 0&&typeof x==="object"&&x!==null&&"default"in x?x.default:b[m]}return se(p,l,null,{args:f,target:o})}}else{let g=(b,f)=>{se(p,b,f??null,{target:o})};l[c]=g}}else if(Za(u))l[c]=await bl(u,l,c,n);for(let[c,u]of Object.entries(i))if(Lk(u))l[c]=await Ml(u,l,c,n,a);if(!(a?.skipServerFunctions??yo.skip)){for(let[c,u]of Object.entries(i))if(Ik(u))l[c]=await Cl(u,l,c,n)}let h=a?.media??Fl;if(e.$media)l.$media=e.$media;else if(!l.$media&&Object.keys(h).length>0)l.$media=h;return l}function pl(e){for(let t of Object.keys(e))if(Bs.has(t))return!0;return!1}function J(e,t){let n=t?.$map;return Function("state","$map","item","index",`return \`${e}\``)(t,n,n?.item,n?.index)}function fl(e){if(!e.startsWith("${")||!e.endsWith("}"))return!1;let t=0;for(let n=1;n<e.length;n+=1){let a=e[n];if(a==="{")t+=1;else if(a==="}"){if(t-=1,t===0)return n===e.length-1}}return!1}function ml(e,t){if(!fl(e))return J(e,t);let n=t?.$map;return Function("state","$map","item","index",`return (${e.slice(2,-1)})`)(t,n,n?.item,n?.index)}var X=new Map,le=new Map;function So(e,t){if(typeof t==="function"){X.delete(e),le.set(e,t);return}le.delete(e),X.set(e,t)}function Ut(e){let t=X.get(e);if(t)return t;let n=le.get(e);if(!n)return;if(typeof n!=="function")return n;let a=Promise.resolve(n()).then((o)=>(X.set(e,o),le.delete(e),o),(o)=>{throw le.set(e,n),o});return le.set(e,a),a}async function bl(e,t,n,a){if(e.body&&e.$src)throw Error(`Jx: '${n}' declares both body and $src — these are mutually exclusive`);if(!e.body&&!e.$src){let s=Vt(e),d=Function(...s,"");return Object.defineProperty(d,"name",{configurable:!0,value:e.name??n}),d}let o;if(typeof e.body==="string"){let s=Vt(e);o=Function(...s,e.body),Object.defineProperty(o,"name",{configurable:!0,value:e.name??n})}else{let s=e.$src;if(!s)throw Error(`Jx: '${n}' has neither body nor $src`);let d=e.$export??n,l,h=Ut(s);if(h instanceof Promise)l=await h;else if(h)l=h;else{if(a){let u=new URL(s,a).href;try{l=await import(u)}catch{l=await import(s)}}else l=await import(s);X.set(s,l)}let c=l[d]??l.default?.[d];if(typeof c!=="function")throw TypeError(`Jx: export "${d}" not found or not a function in "${s}"`);o=c}let r=(e.parameters??e.arguments??[]).length>0,i=!1;if(!r){if(typeof e.body==="string")i=Rk(e.body);else if(o)i=o.length<=1&&Rk(o.toString())}if(i)return zd(()=>o(t));return o}function Vt(e){let t=e.parameters?Pv(e.parameters):e.arguments??[];return t.length>0&&t[0]==="state"?t:["state",...t]}var Gt=new Set(["$schema","$id","$defs","state","$ref","$props","$elements","$title","$description","$switch","$prototype","$src","$export","$media","$map","timing","default","description","body","parameters","arguments","name","tagName","children","style","attributes","items","map","filter","sort","cases","observedAttributes"]),so=new Set,gl="http://www.w3.org/2000/svg",wl="http://www.w3.org/1998/Math/MathML";function xl(e,t){if(e==="svg")return gl;if(e==="math")return wl;return t??null}function Ja(e,t,n){let a=n?._path??[];if(typeof e==="string"||typeof e==="number"||typeof e==="boolean"){let c=document.createTextNode(String(e));if(typeof e==="string"&&Ks(e))Q(()=>{c.textContent=J(e,t)});return c}let o=t;for(let[c,u]of Object.entries(e))if(c.startsWith("$")&&!Gt.has(c)){if(o===t)o=Object.create(t);o[c]=N(u)?O(u.$ref,t):u}if("$ref"in e&&!e.tagName){let c=String(e.$ref??"");if(!so.has(c))so.add(c),console.warn(`Jx: a $ref child ("${c}") is not a supported component instance; register the `+"component in $elements and use its custom-element tag instead (spec §13).")}let r=Qt(e.tagName,o),i=r.includes("-")&&customElements.get(r);if(e.$props&&i)return vo(e,o,n,a);if(e.$props){if(r.includes("-"))return vo(e,o,n,a);let{$props:c,...u}=e;return Ja(u,Pl(e,o),n)}if(e.$switch)return Al(e,o,n);let s=xl(r,n?._ns),d=r==="foreignObject"?null:s,l=s?document.createElementNS(s,r):document.createElement(r);if(n?.onNodeCreated)n.onNodeCreated(l,a,e,o);if(Yt(l,e,o),e.style&&r.includes("-"))Xt.set(l,e.style);rt(l,e.style??{},o.$media??{},o),it(l,e.attributes??{},o);let h=e.children;if(Vx(h)){let c=n||d?{...n,_ns:d,_path:[...a,"children"]}:void 0;Bt(l,h,o,c)}else if(Array.isArray(h))for(let c=0;c<h.length;c++){let u=h[c],p=n||d?{...n,_ns:d,_path:[...a,"children",c]}:void 0;if(Vx(u))Bt(l,u,o,p);else l.append(Ja(u,o,p))}return l}function Yt(e,t,n){for(let[a,o]of Object.entries(t)){if(Gt.has(a))continue;if(a.startsWith("$"))continue;if(a.startsWith("on")&&To(e,a,o,n))continue;Eo(e,a,o,n)}}function To(e,t,n,a){let o=t.slice(2),r=a;if(N(n)){let i=O(n.$ref,a);if(typeof i==="function"){let s=i;e.addEventListener(o,(d)=>s(r,d))}return!0}if(Tk(n)){let{body:i}=n;return e.addEventListener(o,(s)=>{se(i,r,s)}),!0}if(Za(n)&&typeof n.body==="string"){let i=Vt(n),s=Function(...i,n.body);return e.addEventListener(o,(d)=>s(r,d)),!0}if(ba(n)){let i=n.$expression;return e.addEventListener(o,(s)=>qs(i,r,s)),!0}return!1}function vl(e,t,n){for(let[a,o]of Object.entries(t))if(a.startsWith("on")&&!Gt.has(a))To(e,a,o,n)}function Eo(e,t,n,a){let o=e,r=ul(t,n,a);if(r)e.dataset.jxBoundProp=r;let i=(d)=>typeof d==="string"?ot(e.tagName,t,d):d,s=(d)=>{let l=e;if(t==="className"&&!(l instanceof HTMLElement)){l.setAttribute("class",d==null?"":String(d));return}if(o[t]===d)return;o[t]=d};if(N(n)){let d=n;if(t==="id"){o[t]=O(d.$ref,a);return}Q(()=>{s(i(O(d.$ref,a)))});return}if(Ks(n)){Q(()=>{s(i(J(n,a)))});return}s(i(n))}function lo(e,t){let n=[];return{detach:t,insert(a){let o=[];for(let i of a){let s=e.cssRules.length;try{e.insertRule(i,s)}catch{continue}let d=e.cssRules[s];if(d)o.push(d)}let r={rules:o,texts:a};return n.push(r),r},remove(a){let o=n.indexOf(a);if(o!==-1)n.splice(o,1);if(a.rules.length===0)return;let r=[...e.cssRules],i=a.rules.map((s)=>r.indexOf(s)).filter((s)=>s>=0).toSorted((s,d)=>d-s);for(let s of i)e.deleteRule(s);a.rules.length=0},replaceAll(a){n.length=0,n.push({rules:[],texts:a}),e.replaceSync(a.join(`
|
|
1
|
+
import{II,RI}from"./studio-1q6amtph.js";import{nt,Ot,Za,ba,Mv,Tk,Lk,Ik,Vx,Ks,Rk,ih,va,Pv,Hd,Mp}from"./studio-nbxqcgvf.js";import{ge,Xa,Q,sh,ah,Ux,v,Hm,Bm,re,Bd,Qa,el,zd}from"./studio-fqq890ap.js";import{$i}from"./studio-0bbxhhce.js";var Ht={};$i(Ht,{SUBMENU_PLACEMENT:()=>Sa,clampIntoViewport:()=>ae,ensureCaret:()=>_k,focusRow:()=>Z,hideMenu:()=>oe,onMenuBeforeToggle:()=>cs,onMenuKeydown:()=>ds,onMenuPointerOver:()=>fs,onMenuToggle:()=>hs,openSubmenu:()=>At,parentRowOf:()=>U,rootMenuOf:()=>Ue,rowsOf:()=>W,showMenu:()=>Ta,submenuOf:()=>ie});var Et={};$i(Et,{anchorOf:()=>ye,clampIntoViewport:()=>ae,close:()=>Fd,measureAnchor:()=>ja,onBeforeToggle:()=>es,onToggle:()=>ts,onTransitionEnd:()=>ns,openAt:()=>zl,supportsAnchorPositioning:()=>te});function te(){let e=globalThis.CSS;return typeof e?.supports==="function"&&e.supports("position-area","block-end")}function ya(e){return e}var Be=new WeakMap;function ka(e){let t=e.currentTarget;return t instanceof HTMLElement?t:null}function ye(e){return Be.get(e)??null}function zl(e,t){let n=ya(e);if(typeof n.showPopover!=="function")return;if(!t){n.showPopover();return}Be.set(e,t);try{Yi(n,t)}catch(a){throw Be.delete(e),a}}function Yi(e,t){try{e.showPopover?.({source:t})}catch(n){if(!(n instanceof TypeError))throw n;e.showPopover?.()}}function Fd(e){let t=ya(e);if(typeof t.hidePopover==="function")t.hidePopover()}function Xi(e){let{id:t}=e;if(!t)return null;for(let n of e.ownerDocument.querySelectorAll("[popovertarget]"))if(n.getAttribute("popovertarget")===t)return n;return null}function $a(e,t){let{source:n}=t;if(n instanceof Element)return n;return ye(e)??Xi(e)}function ja(e,t,n=ye(t)){if(e.matchWidth!==!0||!n)return;let a=n.getBoundingClientRect();if(a.width>0)e.anchorWidth=Math.round(a.width)}function Qi(e,t){let n=()=>{if(typeof t.getAnimations==="function"&&t.getAnimations().length>0)return;e.settling=!1};if(typeof requestAnimationFrame==="function")requestAnimationFrame(n);else n()}function es(e,t){let n=ka(t);if(!n)return;let a=t.newState==="open",o=Number(e.floor??0);e.anchored=a&&o<=0&&$a(n,t)!==null}function ts(e,t){let n=ka(t);if(!n)return;let a=t.newState==="open";if(e.open=a,e.settling=!0,a){if(ja(e,n,$a(n,t)),!(e.anchored===!0&&te()))ae(e,n,{floor:Number(e.floor??0)})}else Be.delete(n);Qi(e,n)}function ns(e,t){if(t.target===t.currentTarget)e.settling=!1}function as(e){let t=Number.parseFloat(getComputedStyle(e).marginBlockStart);return Number.isFinite(t)&&t>0?t:0}function ae(e,t,n={}){let a=()=>{let o=t.getBoundingClientRect();if(o.width===0&&o.height===0)return;let r=4,i=n.floor&&n.floor>0?n.floor:window.innerHeight;if(o.right>window.innerWidth-r){let s=n.flipAgainst??null,d=s?Math.round(s.getBoundingClientRect().left)-o.width+2:-1;e.x=d>=r?d:Math.max(r,Math.round(window.innerWidth-o.width-r))}if(o.bottom>i)e.y=Math.max(r,Math.round(i-o.height-as(t)))};if(typeof requestAnimationFrame==="function")requestAnimationFrame(a);else a()}var qe="jx-menu-item",G="jx-menu",Sa="inline-end span-block-end";function Ke(e){let t=e.currentTarget;return t instanceof HTMLElement&&t.localName===G?t:null}function os(e,t){return t instanceof Element&&t.closest(G)===e}function W(e,t={}){let n=[...e.querySelectorAll(qe)].filter((a)=>a.closest(G)===e);return t.includeDisabled?n:n.filter((a)=>a.getAttribute("aria-disabled")!=="true")}function ie(e){for(let t of e.querySelectorAll(G))if(t.parentElement?.closest(qe)===e)return t;return null}function U(e){return e.parentElement?.closest(qe)??null}function Ue(e){let t=e;for(;;){let n=U(t),a=n?.closest(G);if(!n||!(a instanceof HTMLElement))return t;t=a}}function Ge(e){return e.open===!0}function Ta(e,t){if(!Ge(e))zl(e,t??null)}function oe(e){if(Ge(e)&&typeof e.hidePopover==="function")e.hidePopover()}function Z(e,t){if(e.length===0)return null;let n=(t%e.length+e.length)%e.length;for(let[o,r]of e.entries())r.tabIndex=o===n?0:-1;let a=e[n];return a.focus(),a}function rs(e,t){return e.findIndex((n)=>n===t||t instanceof Node&&n.contains(t))}function At(e,t={}){let n=ie(e);if(!n)return null;let a=e.getBoundingClientRect();if(n.x=Math.round(a.right)-2,n.y=Math.round(a.top)-4,e.expanded=!0,Ta(n,e),t.focus)Z(W(n),0);return n}function Mt(e,t=null){for(let n of W(e,{includeDisabled:!0})){if(n===t)continue;let a=ie(n);if(a)oe(a)}}function is(e){return e.querySelector('[part="label"]')?.textContent??e.textContent??""}function ss(e,t,n){let a=e.map((o)=>is(o).trim().toLowerCase());for(let o=1;o<=a.length;o++){let r=(t+o)%a.length;if(a[r].startsWith(n))return r}return-1}function ls(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey?e.key.toLowerCase():null}function ds(e,t){let n=Ke(t);if(!n||!os(n,t.target))return;let a=W(n),o=rs(a,t.target);switch(t.key){case"ArrowDown":{Z(a,o+1);break}case"ArrowUp":{Z(a,o===-1?-1:o-1);break}case"Home":{Z(a,0);break}case"End":{Z(a,-1);break}case"Enter":case" ":{a[o]?.click();break}case"ArrowRight":{let r=a[o];if(!r||!ie(r))return;Mt(n,r),At(r,{focus:!0});break}case"ArrowLeft":{let r=U(n);if(!r)return;oe(n),r.focus();break}case"Escape":{let r=U(n);oe(n),r?.focus();break}case"Tab":{oe(Ue(n));break}default:{let r=ls(t);if(r===null)return;let i=ss(a,o,r);if(i===-1)return;Z(a,i)}}t.preventDefault(),t.stopPropagation()}function cs(e,t){let n=Ke(t);if(!n)return;let a=t.newState==="open",o=String(e.placement??"")||(U(n)?Sa:"");e.area=o;let{source:r}=t,i=r instanceof Element?r:ye(n);e.anchored=a&&o!==""&&i!==null&&!us(n)}function hs(e,t){let n=Ke(t);if(!n)return;let a=t.newState==="open";e.open=a;let o=U(n);if(!a){if(Mt(n),o)o.expanded=!1;return}if(!(e.anchored===!0&&te()))ae(e,n,{flipAgainst:o?.closest(G)??null,floor:ps(n)});if(!n.contains(document.activeElement))Z(W(n),0)}function us(e){return Number(Ue(e).floor??0)>0}function ps(e){let t=Number(Ue(e).floor??0);return t>0?t:window.innerHeight}function _k(e){if(e.contains(document.activeElement))return;let t=e;for(;;){let a=W(t,{includeDisabled:!0}).map((o)=>ie(o)).find((o)=>o!==null&&Ge(o));if(!a)break;t=a}let n=U(t);if(W(t).length===0&&n){oe(t),n.focus();return}Z(W(t),0)}function fs(e,t){let n=Ke(t);if(!n||!(t.target instanceof Element))return;let a=t.target.closest(qe);if(!a||a.closest(G)!==n)return;let o=ie(a);if(Mt(n,a),o&&!Ge(o)&&a.getAttribute("aria-disabled")!=="true")At(a)}var ms=["auto","manual","hint"],Ea=new Set(["button","input"]),kk="auto";function Wl(e){return nt(e.attributes)?e.attributes:{}}function Kr(e,t){let n=Wl(e)[t];return typeof n==="string"?n:null}function ro(e){return typeof e.tagName==="string"?e.tagName.toLowerCase():""}function Jr(e,t="the popover"){let n=typeof e.id==="string"?e.id:Kr(e,"id");if(n)return`#${n}`;let a=ro(e);return a===""?t:`the <${a}>`}function bs(e){let t=Wl(e).popover;return typeof t==="string"?t:null}var gs=["popovertarget","popovertargetaction","command","commandfor"];function Aa(e){let t=new Set,n=new Set;for(let a of e){let o=typeof a?.tagName==="string"?a.tagName:"";if(!o.includes("-"))continue;if(Lt(a))t.add(o);let r=a.observedAttributes;if(Array.isArray(r)&&gs.every((i)=>r.includes(i)))n.add(o)}return{invokerTags:n,popoverTags:t}}function Lt(e){return"popover"in Wl(e)||"popover"in e}function Gs(e,t){return Lt(e)||(t?.popoverTags?.has(ro(e))??!1)}function nh(e){if(typeof e.id==="string"&&e.id!=="")return e.id;let t=Kr(e,"id");return t===""?null:t}function*Ya(e,t=[],n=null,a){yield{enclosing:n,node:e,path:t};let o=Gs(e,a)?e:n,{children:r}=e;if(Array.isArray(r)){for(let[d,l]of r.entries())if(l&&typeof l==="object")yield*Ya(l,[...t,"children",d],o,a)}else if(nt(r)&&nt(r.map))yield*Ya(r.map,[...t,"children","map"],o,a);let i=nt(e.map)?e.map:null;if(i)yield*Ya(i,[...t,"map"],o,a);let s=nt(e.cases)?e.cases:{};for(let[d,l]of Object.entries(s))if(l&&typeof l==="object")yield*Ya(l,[...t,"cases",d],o,a)}function Fm(e,t){let n=[];for(let{node:a}of Ya(e,[],null,t)){if(!Gs(a,t))continue;let o=nh(a);if(o!==null&&!n.includes(o))n.push(o)}return n}function wI(e,t){for(let{node:n}of Ya(e,[],null,t))if(Gs(n,t))return!0;return!1}function Ye(e){return e.startsWith("@")}function Ma(e){return e.startsWith(":")||e.startsWith("&")||e.startsWith(".")||e.startsWith("[")}function Qo(e,t){let n=e?.[t];if(n===void 0||ih(n)||Array.isArray(n))return null;return String(n)}function Ha(e){for(let[t,n]of Object.entries(e??{})){if(!ih(n))continue;if(Ma(t)&&t.includes(":popover-open")&&Qo(n,"display")!==null)return!0;if(Ye(t)&&Ha(n))return!0}return!1}function La(e){for(let[t,n]of Object.entries(e??{})){if(!ih(n))continue;if(Ma(t)&&t.includes(":popover-open"))return!0;if(Ye(t)&&La(n))return!0}return!1}var ws=["flexDirection","flex-direction","alignItems","align-items","justifyContent","justify-content","flexWrap","flex-wrap","gridTemplateColumns","grid-template-columns","gridTemplateRows","grid-template-rows","gap"];function xs(e){return ws.some((t)=>Qo(e,t)!==null)}function Na(e){if(!e)return[];let t=[];for(let[n,a]of Object.entries(e))if(Ye(n)&&ih(a)&&Qo(a,"display")!==null)t.push(n);return t}function Ia(e){if(!e)return[];let t=[],n=Qo(e,"transition");if(n!==null)t.push(n);for(let[a,o]of Object.entries(e))if(Ye(a)&&ih(o))t.push(...Ia(o));return t}function vs(e){if(!e)return!1;if(Qo(e,"positionAnchor")!==null||Qo(e,"position-anchor")!==null)return!0;return["top","left","right","bottom","inset","insetBlockStart","insetInlineStart"].some((t)=>(Qo(e,t)??"").includes("anchor("))}function ys(e){if(!e)return!1;if(Qo(e,"positionArea")!==null||Qo(e,"position-area")!==null||Qo(e,"positionTryFallbacks")!==null||Qo(e,"position-try-fallbacks")!==null)return!0;return Object.keys(e).some((t)=>t.startsWith("@supports"))}var R="See docs/framework/concepts/overlays.";function xI(e,t){let n=[...Ya(e,[],null,t)],a=Fm(e,t),o=n.some(({node:s})=>Gs(s,t)),r=new Set;for(let{node:s}of n)if(Ea.has(ro(s))){let d=Kr(s,"popovertarget");if(d!==null)r.add(d)}let i=[];for(let{enclosing:s,node:d,path:l}of n)if(i.push(...ks(d,l,s,a,o,t)),Lt(d))i.push(...$s(d,l,r));return i}function ks(e,t,n,a,o,r){let i=[],s=ro(e),d=Kr(e,"popovertarget"),l=Ea.has(s)||(r?.invokerTags?.has(s)??!1);if(d!==null&&!l)return i.push({detail:"`popovertarget` and `popovertargetaction` come from the `PopoverTargetAttributes` IDL mixin, which HTML includes into `HTMLButtonElement` and `HTMLInputElement` and into nothing else. Elsewhere they parse and do nothing. A link inside an open popover "+"dismisses it by navigating away, which is why this looks like it works — but it does "+`not for a new tab or a same-page fragment. Remove both attributes. ${R}`,fix:"invoker",message:`<${s||"element"}> carries popovertarget, which only <button> and <input> support.`,path:t,rule:"invoker-not-button",severity:"error"}),i;if(d!==null){if(o&&!a.includes(d)){let h=a.length>0?`The popovers here are: ${a.map((c)=>`"${c}"`).join(", ")}. `:"";i.push({detail:`No element in this document declares \`popover\` with the id "${d}". ${h}A target that names nothing does nothing, silently. ${R}`,message:`popovertarget="${d}" names no popover in this document.`,path:t,rule:"target-missing",severity:"error"})}else if(n!==null&&nh(n)!==null&&nh(n)!==d)i.push({detail:`This control is inside ${Jr(n)} but targets "${d}". Dismissing a different popover leaves the one the reader is looking at open. This is usually a copy-paste between two panels in the same file. ${R}`,message:`A control inside ${Jr(n)} targets "${d}" instead.`,path:t,rule:"target-mismatch",severity:"warn"})}if(s==="a"&&n!==null&&d===null){let h=Kr(e,"href")??(typeof e.href==="string"?e.href:null),c=Kr(e,"target")==="_blank",u=h!==null&&h.includes("#");if(c||u){let p=c?"it opens a new tab, so the panel stays open on the page behind it. ":"it is a same-document fragment, so the page scrolls behind the open panel. ";i.push({detail:`A link inside a panel normally dismisses it by navigating away. This one does not: ${p}`+"There is no declarative fix — a link cannot carry `popovertarget`. Move it out of the "+`panel, make it a <button>, or accept it deliberately. ${R}`,message:`A link inside ${Jr(n)} does not dismiss it.`,path:t,rule:"link-does-not-dismiss",severity:"warn"})}}return i}function $s(e,t,n){let a=[],{style:o}=e,r=Jr(e),i=bs(e);if(i!==null&&i!==""&&!ms.includes(i))a.push({detail:"`popover` is an enumerated attribute taking `auto`, `manual` or `hint`. Anything else falls back to the invalid-value default `manual`, which gives up light dismiss and gives "+`up Escape — so the panel opens and there is no way to close it. Write "auto". ${R}`,fix:"mode",message:`${r} declares popover="${i}", which is not one of auto, manual or hint.`,path:t,rule:"invalid-mode",severity:"error"});else if(typeof Wl(e).popover==="boolean")a.push({detail:`\`popover\` carries its value in its text, so a boolean is not the right shape. Written as \`true\` it reaches two of the compiler's emitters as \`popover="true"\`, which is not one of the three keywords, so HTML falls back to \`manual\`: no light dismiss, no Escape, and the trigger stops toggling. Write "auto". ${R}`,fix:"mode",message:`${r} writes popover as a boolean.`,path:t,rule:"invalid-mode",severity:"error"});let s=Qo(o,"display");if(s!==null&&s!=="revert"&&s!=="revert-layer")a.push({detail:"A closed popover is hidden by the browser's own `[popover]:not(:popover-open) { display: none }`. That rule is UA-origin, so any author `display` beats it at any specificity, and "+"the panel is laid out on every page whether it is open or not — usually parked off the "+`side of the viewport by the transform meant to animate it, so nothing looks wrong until you scroll sideways. \`display\` belongs in \`:popover-open\` and nowhere else. ${R}`,fix:"display",message:`${r} sets display in its base rule.`,path:t,rule:"base-display",severity:"error"});for(let l of Na(o))a.push({detail:`The same defect as a base \`display\`, arriving through \`${l}\` and therefore only at `+"one width — which is what makes it hard to see. Gate the TRIGGER on a breakpoint, never "+`the panel: the popover mechanism is what hides the panel. ${R}`,fix:"display",message:`${r} sets display inside ${l}.`,path:t,rule:"breakpoint-display",severity:"error"});if(Qo(o,"visibility")!==null)a.push({detail:`A second hiding mechanism the browser already provides. Once \`display\` leaves the base rule this one only adds a frame of flicker on open, and it hides the element from assistive technology in a way \`display: none\` already did. ${R}`,fix:"display",message:`${r} also hides itself with visibility.`,path:t,rule:"base-visibility",severity:"warn"});if(!La(o))a.push({detail:"Nothing changes when it opens, so no transition on it can run and — if `display` is not "+"in the base rule — the panel has no `display` at all while open. This is usually a panel "+`that was styled before it was made a popover. ${R}`,message:`${r} has no :popover-open rule.`,path:t,rule:"no-open-rule",severity:"warn"});else if(!Ha(o)&&s===null&&xs(o))a.push({detail:`${r} declares flex or grid properties, but neither its base rule nor its `+"`:popover-open` rule sets a `display` for them to apply to — and the base rule must not "+`(that is what keeps the closed panel hidden). So it opens with the UA's \`display: block\` and the layout silently does nothing. Put \`display: flex\` in \`:popover-open\`. ${R}`,fix:"open-display",message:`${r} is laid out with flex or grid but never sets display.`,path:t,rule:"no-open-display",severity:"error"});for(let l of Ia(o))if(l.includes("display")&&!l.includes("overlay")){a.push({detail:"`display …allow-discrete` keeps the box alive while it animates out; `overlay "+"…allow-discrete` is what keeps it in the TOP LAYER for those same milliseconds. "+`Without it the panel drops behind the page content and the backdrop disappears a frame early, so the exit reads as a flicker rather than an animation. ${R}`,message:`${r} transitions display but not overlay.`,path:t,rule:"cut-exit",severity:"warn"});break}if(vs(o)&&!ys(o))a.push({detail:"When `anchor()` does not resolve, every inset it feeds computes to `auto` — and a "+`\`position: fixed\` box with four \`auto\` insets falls back to its STATIC position, which for a panel declared inside a header is in the middle of the header. Use \`position-area\` with \`position-try-fallbacks\`, or add a \`@supports\` block that positions it without anchors. ${R}`,message:`${r} is anchor-positioned with no fallback.`,path:t,rule:"unsafe-anchor",severity:"warn"});let d=nh(e);if(d!==null&&!n.has(d))a.push({detail:`No \`<button>\` or \`<input>\` in this document names it with \`popovertarget\`. If it is opened from another file or from a function that calls \`showPopover()\`, this is fine; otherwise there is no way for a reader to open it. ${R}`,message:`${r} has no invoker in this document.`,path:t,rule:"no-invoker",severity:"warn"});return a}function _I(e){if(!e)return null;let t=[];if(Qo(e,"display")!==null)t.push("display");if(Qo(e,"visibility")!==null)t.push("visibility");let n=Na(e);if(t.length===0&&n.length===0)return null;let a=va(e,":popover-open")??va(e,"&:popover-open"),o=Qo(a,"display")!==null?null:Qo(e,"display")??null;return{base:t,breakpoints:n,openDisplay:o}}var Ca=el(null);function kI(e){Ca.value=e}function ne(){return Ca.value}function Oa(e){return e.replaceAll(/[A-Z]/g,(t)=>`-${t.toLowerCase()}`)}var js=new Set(["all","print","screen","speech"]);function Ra(e,t){if(e.startsWith("@--"))return t[e.slice(1)]??e.slice(1);if(e.startsWith("@(")){let n=e.slice(2,-1).trim();return js.has(n.toLowerCase())?n:e.slice(1)}return null}function Nt(e){return e.startsWith("@position-try")||e.startsWith("@property")||e.startsWith("@font-face")||e.startsWith("@counter-style")}function $v(e){return e.startsWith("@keyframes")}function Da(e,t){let n=[];for(let a of It(e))for(let o of It(t))n.push(Ss(a,o));return n.join(", ")}function Ss(e,t){if(t.startsWith("&"))return t.replaceAll("&",e);if(t.startsWith("[")||t.startsWith(":")||t.startsWith("."))return`${e}${t}`;return`${e} ${t}`}function It(e){let t=[],n=0,a=null,o=0;for(let i=0;i<e.length;i+=1){let s=e[i];if(a){if(s==="\\")i+=1;else if(s===a)a=null;continue}if(s==='"'||s==="'")a=s;else if(s==="("||s==="[")n+=1;else if(s===")"||s==="]")n=Math.max(0,n-1);else if(s===","&&n===0)t.push(e.slice(o,i)),o=i+1}t.push(e.slice(o));let r=t.map((i)=>i.trim()).filter((i)=>i!=="");return r.length>0?r:[e]}var Ts=/[\s>+~,()]/,Es=/^[A-Za-z_\u{00A0}-\u{FFFF}][\w\u{00A0}-\u{FFFF}-]*/u;function As(e,t){let n="",a=0;for(;;){let o=e.indexOf("[open]",a);if(o===-1)return n+e.slice(a);let r=o;while(r>0&&!Ts.test(e[r-1]))r-=1;let i=Es.exec(e.slice(r,o))?.[0]?.toLowerCase(),s=i===void 0?t.dialog===!0:i==="dialog";n+=e.slice(a,o)+(s?"[data-jx-dialog-open]":"[open]"),a=o+6}}function Ct(e,t={}){if(e.includes("::backdrop"))return null;let n=e.replaceAll(":popover-open","[data-jx-popover-open]").replaceAll(":modal","[data-jx-dialog-open]").replaceAll("[inert]","[data-jx-inert]");return As(n,t)}var ke="data-color-scheme";function Dv(e){return/^\(\s*prefers-color-scheme\s*:\s*(light|dark)\s*\)$/.exec(e.trim())?.[1]??null}function Pa(e,t){if(e===":root"||e==="html")return{auto:`${e}:where(:not([${ke}]))`,forced:`${e}:where([${ke}="${t}"])`};return{auto:`:where(:root:not([${ke}])) ${e}`,forced:`:where(:root[${ke}="${t}"]) ${e}`}}function Rt(e){return e.startsWith(":")||e.startsWith(".")||e.startsWith("&")||e.startsWith("[")}function Dt(e){return e.startsWith("--")?e:Oa(e)}function $e(e){let t=2166136261;for(let n=0;n<e.length;n+=1)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function Fa(e,t,n){let a=n.map(([r,i])=>`${r}: ${i}`).join("; "),o=t===null?a:`${t} { ${a} }`;for(let r=e.length-1;r>=0;r-=1)o=`${e[r]} { ${o} }`;return o}function Ms(e,t,n){let a=n.map(({selector:r,declarations:i})=>`${r} { ${i.map(([s,d])=>`${s}: ${d}`).join("; ")} }`).join(" "),o=`@keyframes ${t} { ${a} }`;for(let r=e.length-1;r>=0;r-=1)o=`${e[r]} { ${o} }`;return o}function Hs(e){let t=Object.keys(e).filter((a)=>$v(a));if(t.length===0)return e;let n={...e};for(let a of t)delete n[a];return n}function Ls(e){let t=e.startsWith("&")?e.slice(1):e;return t===""||t.startsWith(":")||t.startsWith(".")||t.startsWith("[")}function je(e,t={}){let{scope:n=null,mediaQueries:a={},transposeValue:o=(f)=>f,transposeSelector:r=(f)=>f,resolveValue:i}=t,s=[],d=(f)=>f!==null&&typeof f==="object"&&!Array.isArray(f)&&!Ot(f),l=(f,m)=>{if(d(m))return[m];if(!Nt(f)||!Array.isArray(m)||m.length===0)return[];return m.every((x)=>d(x))?m:[]},h=(f,m,x,y)=>{if(m===void 0||m===null)return null;if(Ot(m))return x?i?.(f,m,y)??null:null;if(typeof m==="object")return null;let k=String(m);if(Ks(k))return x?i?.(f,k,y)??null:null;return o(k)},c=(f,m,x=!0,y="self")=>{let k=[];for(let[T,I]of Object.entries(f)){if(l(T,I).length>0)continue;if(m&&(T.startsWith("@")||Rt(T)))continue;if(T.startsWith("$"))continue;let j=h(T,I,x,y);if(j!==null)k.push([Dt(T),j])}return k},u=(f,m,x,y,k)=>{if(x.length===0)return;let T=m;if(T!==null){let j=r(T);if(j===null)return;T=j}let I=Fa(f,T,x);s.push({text:I,conditions:[...f],selector:T,declarations:x,target:y,key:$e(I),...typeof k==="string"&&k!==""?{description:k}:{}})},p=(f,m,x)=>{let y=f.slice(10).trim();if(y==="")return;let k=[];for(let[I,j]of Object.entries(m)){if(!d(j))continue;let C=c(j,!0,!1,"unscoped");if(C.length>0)k.push({declarations:C,selector:I.trim()})}if(k.length===0)return;let T=Ms(x,y,k);s.push({blocks:k,conditions:[...x],declarations:[],key:$e(T),selector:null,target:"unscoped",text:T})},g=(f,m,x,y,k)=>{if(f==="@--")return;if(Nt(f)){u([...y,f],null,c(m,!1,!0,"unscoped"),"unscoped",m.$description);return}if($v(f)){p(f,m,y);return}let T=Ra(f,a),I=T===null?f:`@media ${T}`,j=T===null?null:Dv(T);if(j!==null&&x!==null){let{auto:C,forced:w}=Pa(x,j);b(m,C,[...y,I],k),b(Hs(m),w,y,k);return}b(m,x,[...y,I],k)};function b(f,m,x,y){u(x,m,c(f,!0,!0,y),y,f.$description);for(let[k,T]of Object.entries(f))for(let I of l(k,T))if(k.startsWith("@"))g(k,I,m,x,y);else if(m!==null)b(I,Da(m,k),x,Ls(k)?y:"descendant")}return b(e,n,[],"self"),s}var z="en-US",za="UTC",Va=[{api:"Intl.NumberFormat",params:["value","locale","options"],path:"Intl/formatNumber",summary:"Format a number for a locale — grouping, decimals, currency, percent, units."},{api:"Intl.DateTimeFormat",params:["value","locale","options"],path:"Intl/formatDate",summary:"Format a date or timestamp for a locale. Pass `timeZone` in options."},{api:"Intl.RelativeTimeFormat",params:["value","unit","locale","options"],path:"Intl/formatRelativeTime",summary:'Format a relative time — `-3, "day"` becomes "3 days ago".'},{api:"Intl.ListFormat",params:["values","locale","options"],path:"Intl/formatList",summary:'Join a list the way a locale does — "a, b, and c", not a hand-written comma join.'},{api:"Intl.PluralRules",params:["value","locale","options"],path:"Intl/plural",summary:'Which plural category a number falls in ("one", "few", "other") — many languages have '+"more than two, so a ternary on `n === 1` is wrong outside English."},{api:"Intl.Collator",params:["a","b","locale","options"],path:"Intl/compare",summary:'Compare two strings for sorting. `<` and `sort()` order by UTF-16 code unit, which puts "Zebra" before "apple" and sorts every accented word into the wrong place.'},{api:"Intl.DisplayNames",params:["code","type","locale","options"],path:"Intl/displayName",summary:'The name of a language, region, script or currency in a locale — "de" as "German" or '+'"Deutsch", from CLDR rather than a hand-kept table.'},{api:"Intl.Segmenter",params:["value","granularity","locale"],path:"Intl/segment",summary:"Split text into graphemes, words or sentences (UAX #29). `[...str]` splits code points, so it cuts an emoji with a skin-tone modifier in half."}],Pt=Va.map((e)=>e.path),Wa=Object.fromEntries(Va.map((e)=>[e.path,e.params.indexOf("locale")]));function bI(){return`the Intl helpers ${Pt.join(", ")}`}function Ns(e){return e.replaceAll("~1","/").replaceAll("~0","~")}function Ft(e){if(e==="")return[];return e.split("/").map((t)=>Ns(t))}function P(e,t){let n=e;for(let a of Ft(t))n=n?.[a];return n}function Zt(e){let t=e.$map;return t&&typeof t==="object"?t:void 0}var Ba=new Set(["=","+=","-=","*=","/=","push","pop","shift","unshift","splice"]),qa=new Set(["!","-"]),Ka=new Set(["+","-","*","/","%","===","!==","<","<=",">",">=","&&","||","??"]),Is=new Set(["=","+=","-=","*=","/="]),Cs=new Set(["push","pop","shift","unshift","splice"]),Ua=new Set(["reduce","map","filter"]),Ga=new Set(["?:","switch"]),Rp=new Set(["includes","indexOf","lastIndexOf","join","slice","concat","at","flat","toSorted","toReversed","toSpliced","with","toUpperCase","toLowerCase","trim","trimStart","trimEnd","split","startsWith","endsWith","padStart","padEnd","replaceAll","repeat","charAt","normalize","toLocaleUpperCase","toLocaleLowerCase","toFixed","toPrecision","toLocaleString"]),vk=new Set([...Ba,...qa,...Ka,...Ua,...Ga,...Rp,"call"]),yk=new Set(["isNaN","isFinite","parseFloat","parseInt","encodeURIComponent","decodeURIComponent","structuredClone","Math/abs","Math/ceil","Math/floor","Math/round","Math/trunc","Math/sign","Math/sqrt","Math/cbrt","Math/pow","Math/exp","Math/log","Math/log2","Math/log10","Math/min","Math/max","Math/hypot","Number/isInteger","Number/isFinite","Number/isNaN","Number/parseFloat","Number/parseInt","JSON/parse","JSON/stringify","Object/keys","Object/values","Object/entries","Object/fromEntries","Array/from","Array/isArray","Array/of","String/fromCharCode","String/fromCodePoint",...Pt]),Os={"Intl/compare":(e,t,n,a)=>new Intl.Collator(n??z,a).compare(e,t),"Intl/displayName":(e,t,n,a)=>new Intl.DisplayNames(n??z,{...a,type:t??"language"}).of(e),"Intl/formatDate":(e,t,n)=>new Intl.DateTimeFormat(t??z,{timeZone:za,...n}).format(new Date(e)),"Intl/formatList":(e,t,n)=>new Intl.ListFormat(t??z,n).format(e),"Intl/formatNumber":(e,t,n)=>new Intl.NumberFormat(t??z,n).format(e),"Intl/formatRelativeTime":(e,t,n,a)=>new Intl.RelativeTimeFormat(n??z,a).format(e,t),"Intl/plural":(e,t,n)=>new Intl.PluralRules(t??z,n).select(e),"Intl/segment":(e,t,n)=>[...new Intl.Segmenter(n??z,{granularity:t??"grapheme"}).segment(e)].map((a)=>a.segment)};function Rs(e,t,n){let a=Wa[e];if(a===void 0||a<0||t[a]!=null)return t;let r=n.$page?.locale;if(typeof r!=="string"||r==="")return t;let i=[...t];return i[a]=r,i}function Ds(e){return e.startsWith("window#/")&&yk.has(e.slice(8))}function Om(e){return Ba.has(e)}var _a=64,Ps=64;function L(e,t){if(!e)return;let n=(e.depth??0)+1;if(n>Ps)return;return{depth:n,path:[...e.path??[],...Array.isArray(t)?t:[t]],report:e.report}}function H(e,t,n,a,o){if(e===null||e===void 0)return e;if(typeof e==="object"&&!Array.isArray(e)&&"operator"in e)return qs(e,t,n,a,o);if(typeof e==="object"&&!Array.isArray(e)&&"$ref"in e){let r=Xe(e.$ref,t,n,a);return o?.report(o.path??[],r),r}if(Array.isArray(e))return e.map((r,i)=>H(r,t,n,a,L(o,i)));return o?.report(o.path??[],e),e}function Fs(e,t,n,a){let o=(r)=>{if(!e.slice(r.length).includes("/"))return t;return Xe(e.slice(0,e.lastIndexOf("/")),t,n,a)};if(e.startsWith("#/state/"))return o("#/state/");if(e.startsWith("parent#/"))return o("parent#/");if(e.startsWith("$map/")||e.startsWith("$args/"))return e.split("/").length>2?Xe(e.slice(0,e.lastIndexOf("/")),t,n,a):void 0;return}function Xe(e,t,n,a){if(e==="$reduce/acc")return a?.acc;if(e.startsWith("$reduce/"))return a?.acc;if(e.startsWith("$args/")){let o=e.slice(6).split("/"),r=a?.args?.[o[0]];return o.length>1?_(r,o.slice(1).join("/")):r}if(e.startsWith("event#/")){let o=e.slice(7);return _(n,o)}if(e.startsWith("$map/")){let o=e.split("/"),[,r]=o,i,s=Zt(t);if(r==="item")i=a?.item??s?.item??t["$map/item"];else if(r==="index")i=a?.index??s?.index??t["$map/index"];else i=s?.[r]??t[`$map/${r}`];return o.length>2?_(i,o.slice(2).join("/")):i}if(e.startsWith("#/state/"))return P(t,e.slice(8));if(e.startsWith("parent#/"))return P(t,e.slice(8));if(e.startsWith("window#/"))return _(globalThis.window,e.slice(8));if(e.startsWith("document#/"))return _(globalThis.document,e.slice(10));return P(t,e)??null}function Zs(e,t,n,a){if(e.startsWith("$map/")){let o=e.split("/"),[,r]=o,i,s=Zt(t);if(r==="item")i=a?.item??s?.item??t["$map/item"];else if(r==="index")i=a?.index??s?.index??t["$map/index"];else i=s?.[r]??t[`$map/${r}`];if(o.length>2){let d=o.slice(2),l=d.pop(),h=d.length>0?_(i,d.join("/")):i;return{key:l,obj:h}}return{key:r==="item"?"$map/item":"$map/index",obj:Zt(t)??t}}if(e.startsWith("#/state/")){let o=e.slice(8);if(o.indexOf("/")===-1)return{key:o,obj:t};let i=Ft(o),s=i.pop(),d=t;for(let l of i)d=d[l];return{key:s,obj:d}}return{key:e,obj:t}}function qs(e,t,n,a,o){let r=zs(e,t,n,a,o);return o?.report(o.path??[],r),r}function zs(e,t,n,a,o){let{operator:r,target:i,value:s,initial:d}=e;if(!vk.has(r))throw Error(`$expression: unknown operator "${r}"`);if(qa.has(r)&&!("value"in e)){let l=H(i,t,n,a,L(o,"target"));if(r==="!")return!l;if(r==="-")return-l}if(r==="call"){let l=i?.$ref;if(typeof l!=="string")throw TypeError("$expression: call target must be a $ref pointer");let h=(a?.callDepth??0)+1;if(h>_a)throw Error(`$expression: call depth exceeded (${_a})`);let c=Array.isArray(s)?s.map((p,g)=>H(p,t,n,a,L(o,["value",g]))):[];if(l.startsWith("window#/")){if(!Ds(l))throw Error(`$expression: "${l}" is not a blessed pure global`);let p=l.slice(8),g=Os[p];if(g)return g(...Rs(p,c,t));let b=_(globalThis.window,p),f=p.lastIndexOf("/"),m=f===-1?globalThis.window:_(globalThis.window,p.slice(0,f));return b.apply(m,c)}let u=Xe(l,t,n,a);if(typeof u==="function")return u.apply(Fs(l,t,n,a),c);if(u&&typeof u==="object"&&"$expression"in u){let p=u,g={};for(let[b,f]of(p.parameters??[]).entries()){let m=typeof f==="string"?f:f?.name??"";if(!m)continue;g[m]=c[b]===void 0&&typeof f==="object"&&f!==null&&"default"in f?f.default:c[b]}return qs(p.$expression,t,n,{args:g,callDepth:h})}throw TypeError(`$expression: call target "${l}" is not callable`)}if(Ga.has(r)){if(r==="?:"){let p=H(i,t,n,a,L(o,"target"));if(o){let g=H(s,t,n,a,L(o,"value")),b=H(d,t,n,a,L(o,"initial"));return p?g:b}return p?H(s,t,n,a):H(d,t,n,a)}let l=H(i,t,n,a,L(o,"target")),h=String(l),c=e.cases??{},u=Object.hasOwn(c,h);if(o){let p;for(let[b,f]of Object.entries(c)){let m=H(f,t,n,a,L(o,["cases",b]));if(b===h)p=m}let g=H(e.default,t,n,a,L(o,"default"));return u?p:g}return u?H(c[h],t,n,a):H(e.default,t,n,a)}if(Ka.has(r)){let l=H(i,t,n,a,L(o,"target")),h=H(s,t,n,a,L(o,"value"));switch(r){case"+":return l+h;case"-":return l-h;case"*":return l*h;case"/":return l/h;case"%":return l%h;case"===":return l===h;case"!==":return l!==h;case"<":return l<h;case"<=":return l<=h;case">":return l>h;case">=":return l>=h;case"&&":return l&&h;case"||":return l||h;case"??":return l??h;default:break}}if(Is.has(r)){let l=H(s,t,n,a,L(o,"value")),{obj:h,key:c}=Zs(i.$ref,t,n,a);switch(r){case"=":{h[c]=l;break}case"+=":{let u=h[c];h[c]=u+l;break}case"-=":{let u=h[c];h[c]=u-l;break}case"*=":{let u=h[c];h[c]=u*l;break}case"/=":{let u=h[c];h[c]=u/l;break}default:break}return}if(Cs.has(r)){let l=H(i,t,n,a,L(o,"target"));switch(r){case"push":return l.push(H(s,t,n,a,L(o,"value")));case"unshift":return l.unshift(H(s,t,n,a,L(o,"value")));case"pop":return l.pop();case"shift":return l.shift();case"splice":{let h=H(s,t,n,a,L(o,"value"));return l.splice(...h)}default:break}}if(Rp.has(r)){let l=H(i,t,n,a,L(o,"target")),h=s===void 0?[]:Array.isArray(s)?H(s,t,n,a,L(o,"value")):[H(s,t,n,a,L(o,"value"))],c=l?.[r];if(typeof c!=="function")return;return c.apply(l,h)}if(Ua.has(r)){let l=H(i,t,n,a,L(o,"target"));if(r==="reduce"){let h=H(d,t,n,a,L(o,"initial"));for(let[c,u]of l.entries())h=qs(s,t,n,{acc:h,index:c,item:u},c===0?L(o,"value"):void 0);return h}if(r==="map")return l.map((h,c)=>qs(s,t,n,{...a,index:c,item:h},c===0?L(o,"value"):void 0));if(r==="filter")return l.filter((h,c)=>qs(s,t,n,{...a,index:c,item:h},c===0?L(o,"value"):void 0))}return}function _(e,t){return P(e,t)}function Y(e,t,n,a){return H(e,t,n,a)}function Js(e){if("operator"in e)return"expression";if("if"in e)return"if";if("$switch"in e)return"switch";if("stopPropagation"in e)return"stopPropagation";if("preventDefault"in e)return"preventDefault";return"dispatch"}async function se(e,t,n,a={}){let o=a.args?{args:a.args}:void 0;for(let r of e)switch(Js(r)){case"expression":{let i=qs(r,t,n,o);if(i&&typeof i.then==="function")await i;break}case"if":{let i=r,s=Y(i.if,t,n,o)?i.then:i.else;if(Array.isArray(s))await se(s,t,n,a);break}case"switch":{let i=r,s=String(Y(i.$switch,t,n,o)),d=i.cases??{},l=Object.hasOwn(d,s)?d[s]:i.default;if(Array.isArray(l))await se(l,t,n,a);break}case"dispatch":{let i=r,s=typeof a.target==="function"?a.target():a.target,d=n?.currentTarget??s;if(!d)break;let l={};if("detail"in i)l.detail=Y(i.detail,t,n,o);if(i.bubbles!==void 0)l.bubbles=i.bubbles;if(i.composed!==void 0)l.composed=i.composed;d.dispatchEvent(new CustomEvent(i.dispatchEvent,l));break}case"stopPropagation":{n?.stopPropagation();break}case"preventDefault":{n?.preventDefault();break}default:break}}function eo(e,t){for(let n of e.split(";")){let a=n.indexOf("=");if(a===-1)continue;if(n.slice(0,a).trim()===t)return n.slice(a+1)}return null}function to(e,t,n){let a=e.startsWith("__Host-"),o=[`${e}=${encodeURIComponent(JSON.stringify(t))}`];if(n.maxAge!==void 0)o.push(`Max-Age=${n.maxAge}`);let r=a?"/":n.path;if(r)o.push(`Path=${r}`);if(n.domain&&!a)o.push(`Domain=${n.domain}`);let{sameSite:i}=n;if(n.secure===!0||a||e.startsWith("__Secure-")||i?.toLowerCase()==="none")o.push("Secure");if(i)o.push(`SameSite=${i}`);return o.join("; ")}var no=1,ao=!1;function Vs(e){if(ao||typeof e!=="string")return;let t=e.match(/\/schema\/v(\d+)\b/);if(t&&Number(t[1])!==no)ao=!0,console.warn(`Jx: document $schema is version v${t[1]} but this runtime supports v${no}. Behavior may be undefined; there is no format migrator yet.`)}var Ws=/^[$#]/;function _s(e){for(let t of Object.keys(e))if(Ws.test(t))throw TypeError(`Jx mount: host scope key "${t}" is reserved — names beginning with "$" or "#" are `+"runtime vocabulary")}async function vI(e,t,n={}){let a=n.scope??{};_s(a);let o=n.base?new URL(n.base,location.href).href:location.href,r={base:o,media:n.media??e.$media??null,root:null,...n.resolver?{resolver:n.resolver}:{},...n.skipServerFunctions===void 0?{}:{skipServerFunctions:n.skipServerFunctions},...n.skipAutoRequests===void 0?{}:{skipAutoRequests:n.skipAutoRequests}};if(Vs(e.$schema),e.$elements)await st(e.$elements,o,r);if(e.$head)Zl(e.$head,o);let i=await Dp(e,a,o,r),s=new Set,d={_ctx:r,onNodeCreated:(g,b,f,m)=>{if(g instanceof Element&&g.tagName.includes("-"))s.add(g.tagName.toLowerCase());n.onNodeCreated?.(g,b,f,m)},...n.onNodeMoved?{onNodeMoved:n.onNodeMoved}:{}},{result:l,stop:h}=wk(()=>Ja(e,i,d));r.root=l;let c=!1,u=!1,p=()=>{if(u)return;if(u=!0,n.signal?.removeEventListener("abort",p),h(),c&&typeof i.onUnmount==="function")i.onUnmount(i);l.remove()};if(n.signal?.aborted)p();else if(n.signal?.addEventListener("abort",p,{once:!0}),t.append(l),c=!0,typeof i.onMount==="function")i.onMount(i);return{scope:i,root:l,elements:s,dispose:p}}var Se=new Map;function zx(e,t){let n=Promise.resolve(t);Se.set(e,n);try{Se.set(new URL(e,location.href).href,n)}catch{}}async function Kt(e,t){if(typeof e!=="string")return e;let n=t?.resolver?.(e);if(n)return n;if(Se.has(e))return Se.get(e);let a=fetch(e).then(async(o)=>{if(!o.ok)throw Error(`Jx: failed to fetch ${e} (${o.status})`);if((o.headers?.get("Content-Type")??"").includes("text/html"))throw Error(`Jx: ${e} returned HTML, not a document — the host answered a missing file with its `+"app shell (a single-page fallback), so this path is not served.");return await o.json()});return Se.set(e,a),a}var Bs=new Set(["type","properties","items","enum","minimum","maximum","minLength","maxLength","pattern","required","examples"]),yo={skip:!1};function $p(e){yo.skip=e}var Us={skip:!1};var oo=null;function ko(e){return oo?`${e}?token=${encodeURIComponent(oo)}`:e}function wk(e){let t=ge(!0);try{return{result:t.run(e),stop:()=>t.stop()}}catch(n){throw t.stop(),n}}var Ys=!1;var Xs=/(-?\d*\.?\d+)(?:s|l|d)?v(h|w|min|max|i|b)\b/gi,Qs={b:"cqb",h:"cqh",i:"cqi",max:"cqmax",min:"cqmin",w:"cqw"};function tl(e){if(!Ys||!e.includes("v"))return e;return e.replace(Xs,(t,n,a)=>`${n}${Qs[a.toLowerCase()]??`cq${a}`}`)}var nl=!1;var $o=!1;var jo=!1;var et=!1;function Jt(e){return et||e.dataset.jxPath!==void 0}function al(e,t){if(nl&&t==="href"&&(e.tagName==="A"||e.tagName==="AREA"))return"data-jx-href";if($o&&t==="popover"&&Jt(e))return"data-jx-popover";if(jo&&Jt(e)){if(t==="commandfor")return"data-jx-commandfor";if(t==="inert")return"data-jx-inert";if(t==="open"&&e.tagName==="DIALOG")return"data-jx-open"}return t}var de=null;function xk(e){de=e}var ol=new Set(["src","poster","data"]),rl=new Set(["srcset","imagesrcset"]),il=new Set(["LINK"]);function sl(e,t){return ol.has(t)||t==="href"&&il.has(e)}function ot(e,t,n){if(!de||n==="")return n;let a=t.toLowerCase();if(rl.has(a)){let o=II(n),r=!1,i=o.map((s)=>{let d=de?.(s.url,a)??null;if(d===null||d===s.url)return s;return r=!0,{descriptor:s.descriptor,url:d}});return r?RI(i):n}if(!sl(e,a))return n;return de(n,a)??n}var ll=/\burl\(\s*(?<q>["']?)(?<u>[^"')]*)\k<q>\s*\)/g;function dl(e){if(!de||!e.includes("url("))return e;return e.replaceAll(ll,(t,n,a)=>{let o=a===""?null:de?.(a,"url()")??null;return o===null?t:`url(${n}${o}${n})`})}function io(e){return tl(dl(e))}var cl=!1;var hl=/^\s*\$\{\s*state\.(\w+)\s*\}\s*$/;function ul(e,t,n){if(!cl||e!=="textContent")return null;let a=null;if(N(t)){if(!t.$ref.startsWith("#/state/"))return null;let r=t.$ref.slice(8);a=r&&!r.includes("/")?r:null}else if(typeof t==="string")a=hl.exec(t)?.[1]??null;if(!a)return null;let o=re(n)[a];if(Bd(o)||typeof o==="function")return null;if(typeof o==="object"&&o!==null)return null;return a}async function Dp(e,t={},n=location.href,a){let o=()=>a?.root??null,r={},i=e.state??{},s=Bm(t);for(let c of Object.keys(t))if(s&&!(c in i))Object.defineProperty(r,c,{configurable:!0,enumerable:!0,get:()=>t[c],set:(u)=>{t[c]=u}});else r[c]=t[c];let d=e.imports??{};for(let[,c]of Object.entries(i))if(Lk(c)&&!c.$src){let u=d[c.$prototype];if(u){if(!u.endsWith(".class.json")){console.warn(`Jx: import "${c.$prototype}" must map to a .class.json path, got "${u}"`);continue}c.$src=u}}for(let[c,u]of Object.entries(i)){if(typeof u==="string"){if(!u.includes("${"))r[c]=u;continue}if(typeof u==="number"||typeof u==="boolean"||u===null){r[c]=u;continue}if(Array.isArray(u)){r[c]=u;continue}if(typeof u==="object"){if(u.$prototype)continue;if(ba(u))continue;if(Ik(u))continue;if("default"in u){r[c]=u.default;continue}if(pl(u))continue;r[c]=u}}let l=v(r);for(let[c,u]of Object.entries(i))if(typeof u==="string"&&u.includes("${"))l[c]=zd(()=>J(u,l));for(let[c,u]of Object.entries(i))if(ba(u)){let p=u.$expression;if(Mv(u)){let g=u.parameters;l[c]=(...b)=>{let f={};for(let[m,x]of g.entries()){let y=typeof x==="string"?x:x?.name??"";if(!y)continue;f[y]=b[m]===void 0&&typeof x==="object"&&x!==null&&"default"in x?x.default:b[m]}return qs(p,l,null,{args:f})}}else if(Om(p.operator)){let g=(b,f)=>qs(p,b,f);l[c]=g}else l[c]=zd(()=>qs(p,l,null))}for(let[c,u]of Object.entries(i))if(Tk(u)){let{body:p}=u;if(Array.isArray(u.parameters)&&u.parameters.length>0){let g=u.parameters;l[c]=(...b)=>{let f={};for(let[m,x]of g.entries()){let y=typeof x==="string"?x:x?.name??"";if(!y)continue;f[y]=b[m]===void 0&&typeof x==="object"&&x!==null&&"default"in x?x.default:b[m]}return se(p,l,null,{args:f,target:o})}}else{let g=(b,f)=>{se(p,b,f??null,{target:o})};l[c]=g}}else if(Za(u))l[c]=await bl(u,l,c,n);for(let[c,u]of Object.entries(i))if(Lk(u))l[c]=await Ml(u,l,c,n,a);if(!(a?.skipServerFunctions??yo.skip)){for(let[c,u]of Object.entries(i))if(Ik(u))l[c]=await Cl(u,l,c,n)}let h=a?.media??Fl;if(e.$media)l.$media=e.$media;else if(!l.$media&&Object.keys(h).length>0)l.$media=h;return l}function pl(e){for(let t of Object.keys(e))if(Bs.has(t))return!0;return!1}function J(e,t){let n=t?.$map;return Function("state","$map","item","index",`return \`${e}\``)(t,n,n?.item,n?.index)}function fl(e){if(!e.startsWith("${")||!e.endsWith("}"))return!1;let t=0;for(let n=1;n<e.length;n+=1){let a=e[n];if(a==="{")t+=1;else if(a==="}"){if(t-=1,t===0)return n===e.length-1}}return!1}function ml(e,t){if(!fl(e))return J(e,t);let n=t?.$map;return Function("state","$map","item","index",`return (${e.slice(2,-1)})`)(t,n,n?.item,n?.index)}var X=new Map,le=new Map;function So(e,t){if(typeof t==="function"){X.delete(e),le.set(e,t);return}le.delete(e),X.set(e,t)}function Ut(e){let t=X.get(e);if(t)return t;let n=le.get(e);if(!n)return;if(typeof n!=="function")return n;let a=Promise.resolve(n()).then((o)=>(X.set(e,o),le.delete(e),o),(o)=>{throw le.set(e,n),o});return le.set(e,a),a}async function bl(e,t,n,a){if(e.body&&e.$src)throw Error(`Jx: '${n}' declares both body and $src — these are mutually exclusive`);if(!e.body&&!e.$src){let s=Vt(e),d=Function(...s,"");return Object.defineProperty(d,"name",{configurable:!0,value:e.name??n}),d}let o;if(typeof e.body==="string"){let s=Vt(e);o=Function(...s,e.body),Object.defineProperty(o,"name",{configurable:!0,value:e.name??n})}else{let s=e.$src;if(!s)throw Error(`Jx: '${n}' has neither body nor $src`);let d=e.$export??n,l,h=Ut(s);if(h instanceof Promise)l=await h;else if(h)l=h;else{if(a){let u=new URL(s,a).href;try{l=await import(u)}catch{l=await import(s)}}else l=await import(s);X.set(s,l)}let c=l[d]??l.default?.[d];if(typeof c!=="function")throw TypeError(`Jx: export "${d}" not found or not a function in "${s}"`);o=c}let r=(e.parameters??e.arguments??[]).length>0,i=!1;if(!r){if(typeof e.body==="string")i=Rk(e.body);else if(o)i=o.length<=1&&Rk(o.toString())}if(i)return zd(()=>o(t));return o}function Vt(e){let t=e.parameters?Pv(e.parameters):e.arguments??[];return t.length>0&&t[0]==="state"?t:["state",...t]}var Gt=new Set(["$schema","$id","$defs","state","$ref","$props","$elements","$title","$description","$switch","$prototype","$src","$export","$media","$map","timing","default","description","body","parameters","arguments","name","tagName","children","style","attributes","items","map","filter","sort","cases","observedAttributes"]),so=new Set,gl="http://www.w3.org/2000/svg",wl="http://www.w3.org/1998/Math/MathML";function xl(e,t){if(e==="svg")return gl;if(e==="math")return wl;return t??null}function Ja(e,t,n){let a=n?._path??[];if(typeof e==="string"||typeof e==="number"||typeof e==="boolean"){let c=document.createTextNode(String(e));if(typeof e==="string"&&Ks(e))Q(()=>{c.textContent=J(e,t)});return c}let o=t;for(let[c,u]of Object.entries(e))if(c.startsWith("$")&&!Gt.has(c)){if(o===t)o=Object.create(t);o[c]=N(u)?O(u.$ref,t):u}if("$ref"in e&&!e.tagName){let c=String(e.$ref??"");if(!so.has(c))so.add(c),console.warn(`Jx: a $ref child ("${c}") is not a supported component instance; register the `+"component in $elements and use its custom-element tag instead (spec §13).")}let r=Qt(e.tagName,o),i=r.includes("-")&&customElements.get(r);if(e.$props&&i)return vo(e,o,n,a);if(e.$props){if(r.includes("-"))return vo(e,o,n,a);let{$props:c,...u}=e;return Ja(u,Pl(e,o),n)}if(e.$switch)return Al(e,o,n);let s=xl(r,n?._ns),d=r==="foreignObject"?null:s,l=s?document.createElementNS(s,r):document.createElement(r);if(n?.onNodeCreated)n.onNodeCreated(l,a,e,o);if(Yt(l,e,o),e.style&&r.includes("-"))Xt.set(l,e.style);rt(l,e.style??{},o.$media??{},o),it(l,e.attributes??{},o);let h=e.children;if(Vx(h)){let c=n||d?{...n,_ns:d,_path:[...a,"children"]}:void 0;Bt(l,h,o,c)}else if(Array.isArray(h))for(let c=0;c<h.length;c++){let u=h[c],p=n||d?{...n,_ns:d,_path:[...a,"children",c]}:void 0;if(Vx(u))Bt(l,u,o,p);else l.append(Ja(u,o,p))}return l}function Yt(e,t,n){for(let[a,o]of Object.entries(t)){if(Gt.has(a))continue;if(a.startsWith("$"))continue;if(a.startsWith("on")&&To(e,a,o,n))continue;Eo(e,a,o,n)}}function To(e,t,n,a){let o=t.slice(2),r=a;if(N(n)){let i=O(n.$ref,a);if(typeof i==="function"){let s=i;e.addEventListener(o,(d)=>s(r,d))}return!0}if(Tk(n)){let{body:i}=n;return e.addEventListener(o,(s)=>{se(i,r,s)}),!0}if(Za(n)&&typeof n.body==="string"){let i=Vt(n),s=Function(...i,n.body);return e.addEventListener(o,(d)=>s(r,d)),!0}if(ba(n)){let i=n.$expression;return e.addEventListener(o,(s)=>qs(i,r,s)),!0}return!1}function vl(e,t,n){for(let[a,o]of Object.entries(t))if(a.startsWith("on")&&!Gt.has(a))To(e,a,o,n)}function Eo(e,t,n,a){let o=e,r=ul(t,n,a);if(r)e.dataset.jxBoundProp=r;let i=(d)=>typeof d==="string"?ot(e.tagName,t,d):d,s=(d)=>{let l=e;if(t==="className"&&!(l instanceof HTMLElement)){l.setAttribute("class",d==null?"":String(d));return}if(o[t]===d)return;o[t]=d};if(N(n)){let d=n;if(t==="id"){o[t]=O(d.$ref,a);return}Q(()=>{s(i(O(d.$ref,a)))});return}if(Ks(n)){Q(()=>{s(i(J(n,a)))});return}s(i(n))}function lo(e,t){let n=[];return{detach:t,insert(a){let o=[];for(let i of a){let s=e.cssRules.length;try{e.insertRule(i,s)}catch{continue}let d=e.cssRules[s];if(d)o.push(d)}let r={rules:o,texts:a};return n.push(r),r},remove(a){let o=n.indexOf(a);if(o!==-1)n.splice(o,1);if(a.rules.length===0)return;let r=[...e.cssRules],i=a.rules.map((s)=>r.indexOf(s)).filter((s)=>s>=0).toSorted((s,d)=>d-s);for(let s of i)e.deleteRule(s);a.rules.length=0},replaceAll(a){n.length=0,n.push({rules:[],texts:a}),e.replaceSync(a.join(`
|
|
2
2
|
`))},text(){return n.flatMap((a)=>a.texts.join(`
|
|
3
3
|
`)).join(`
|
|
4
4
|
`)}}}function yl(e){let t=[],n=()=>{e.textContent=t.map((a)=>a.texts.join(`
|
|
@@ -11,4 +11,4 @@ import{II,RI}from"./studio-693nhyky.js";import{nt,Ot,Za,ba,Mv,Tk,Lk,Ik,Vx,Ks,Rk,
|
|
|
11
11
|
export{$v,Dv,bI,Rp,vk,yk,Om,qs,vI,zx,$p,wk,xk,Dp,Ja,yI,Mm,zl,Fd,un,rn,_k,Ap,Ck,Av,Pm,kk,Wl,Kr,ro,Jr,Gs,nh,Ya,Fm,wI,Qo,xI,_I,jd,jm,Wx,CI,kI,ne};
|
|
12
12
|
|
|
13
13
|
//# debugId=8DF7CF213E018EC864756E2164756E21
|
|
14
|
-
//# sourceMappingURL=studio-
|
|
14
|
+
//# sourceMappingURL=studio-cp1gbff9.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{p}from"./studio-y7jehjrp.js";import{me}from"./studio-0bbxhhce.js";var s=null,y=null,h=null,g=!1;function E(n){return h=n,g=!0,s?P():Promise.resolve()}async function P(){if(!g)return;g=!1;try{let{applyProjectSchemas:n}=await (me("tj13ndtm"),import("./monaco-setup-tj13ndtm.js"));n(h)}catch{}}function Ep(){if(s)return Promise.resolve(s);return y??=(async()=>{let[n]=await Promise.all([(me("j5sq149q"),import("./editor-j5sq149q.js")),(me("tj13ndtm"),import("./monaco-setup-tj13ndtm.js"))]);return s=n,await P(),s})(),y}function th(){return s}function Rm(n,t,o){if(!n?.isConnected||t)return!1;return o()}var r=[],l=null;function qt(){if(!l)l=(async()=>{try{r=await p().listFormats?.()??[]}catch{r=[]}return r})();return l}function Md(){l=null,r=[],m=null,a=[],d=null,c=[]}var a=[],m=null;function Pd(){if(!m)m=(async()=>{try{a=await p().listExtensions?.()??[]}catch{a=[]}return a})();return m}function $m(){return a}var c=[],d=null;function F(){if(!d)d=(async()=>{try{c=await p().listExtensionCatalog?.()??[]}catch{c=[]}return c})();return d}function Lv(){return c}async function M(n){let t=null;try{t=await n.fetchProjectSchemas?.()??null}catch{}E(t),await (me("zc9zp77s"),import("./jx-validate-zc9zp77s.js")).then(({applyProjectSchemas:o})=>o(t)).catch(()=>!1)}function Ga(n){M(n),F(),(me("
|
|
1
|
+
import{p}from"./studio-y7jehjrp.js";import{me}from"./studio-0bbxhhce.js";var s=null,y=null,h=null,g=!1;function E(n){return h=n,g=!0,s?P():Promise.resolve()}async function P(){if(!g)return;g=!1;try{let{applyProjectSchemas:n}=await (me("tj13ndtm"),import("./monaco-setup-tj13ndtm.js"));n(h)}catch{}}function Ep(){if(s)return Promise.resolve(s);return y??=(async()=>{let[n]=await Promise.all([(me("j5sq149q"),import("./editor-j5sq149q.js")),(me("tj13ndtm"),import("./monaco-setup-tj13ndtm.js"))]);return s=n,await P(),s})(),y}function th(){return s}function Rm(n,t,o){if(!n?.isConnected||t)return!1;return o()}var r=[],l=null;function qt(){if(!l)l=(async()=>{try{r=await p().listFormats?.()??[]}catch{r=[]}return r})();return l}function Md(){l=null,r=[],m=null,a=[],d=null,c=[]}var a=[],m=null;function Pd(){if(!m)m=(async()=>{try{a=await p().listExtensions?.()??[]}catch{a=[]}return a})();return m}function $m(){return a}var c=[],d=null;function F(){if(!d)d=(async()=>{try{c=await p().listExtensionCatalog?.()??[]}catch{c=[]}return c})();return d}function Lv(){return c}async function M(n){let t=null;try{t=await n.fetchProjectSchemas?.()??null}catch{}E(t),await (me("zc9zp77s"),import("./jx-validate-zc9zp77s.js")).then(({applyProjectSchemas:o})=>o(t)).catch(()=>!1)}function Ga(n){M(n),F(),(me("8beq9ac3"),import("./extension-sections-8beq9ac3.js")).then(({syncExtensionSettingsSections:t})=>t()).catch(()=>{})}function Tp(){return r}function Vs(n,t){let o=n.startsWith(".")?n.toLowerCase():`.${n.toLowerCase()}`;return r.find((e)=>e.extensions.includes(o)&&(!t||e.capabilities[t]))}function wi(n){if(!n)return;return r.find((t)=>t.name===n)}function Lp(n){return Error(`No format class imported for "${n}" — add one to project.json imports `+`(e.g. "Markdown": "@jxsuite/parser/Markdown.class.json") and make sure the project's dependencies are installed`)}function Zt(n){if(!n)return;let t=n.lastIndexOf(".");if(t===-1)return;return Vs(n.slice(t))}function Ka(n){let t=new Set;for(let o of r){if(n&&!o.documentKinds.includes(n))continue;for(let e of o.extensions)t.add(e)}return t.delete(".json"),[...t]}function Dr(){return r.find((n)=>n.capabilities.serialize&&n.documentKinds.includes("content"))}async function k(n){let t=p();if(!t.formatAction)throw Error("Platform does not support format actions");return t.formatAction(n)}async function ck(n,t,o){return await k({action:"parse",format:n,options:o,source:t})}async function Us(n,t,o){return await k({action:"serialize",doc:t,format:n,options:o})}function dk(n,t){let o=n?.studio?.documentMode,e=o?.componentWhen;if(e?.frontmatterKey){let i=t[e.frontmatterKey],u=e.matches?new RegExp(e.matches):/./;if(typeof i==="string"&&u.test(i))return{document:t,frontmatter:{},mode:"component"}}if(o?.default==="component")return{document:t,frontmatter:{},mode:"component"};let f=t.children??[];if(f.length===0)f.push({children:[],tagName:"p"});let S=new Set(["state","imports"]),x={children:f},w={};for(let[i,u]of Object.entries(t)){if(i==="children")continue;if(S.has(i))x[i]=u;else w[i]=u}return{document:x,frontmatter:w,mode:"content"}}
|
|
2
2
|
export{Ep,th,Rm,qt,Md,Pd,$m,Lv,Ga,Tp,Vs,wi,Lp,Zt,Ka,Dr,ck,Us,dk};
|
|
3
3
|
|
|
4
4
|
//# debugId=AFD18F3445E6650C64756E2164756E21
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
5
|
+
//# sourceMappingURL=studio-cqmtbg2p.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{te}from"./studio-ery42sqr.js";import{p,We}from"./studio-y7jehjrp.js";import{k}from"./studio-fqq890ap.js";import{u}from"./studio-
|
|
1
|
+
import{te}from"./studio-ery42sqr.js";import{p,We}from"./studio-y7jehjrp.js";import{k}from"./studio-fqq890ap.js";import{u}from"./studio-x5g1xk77.js";import{Np,di,Ov}from"./studio-1q6amtph.js";import{Ir,gm,mL}from"./studio-xkfs0dp2.js";import{PC,tv,kx,FC,mm}from"./studio-5d7wfmnp.js";import{D}from"./studio-tp642n5g.js";var Al=new Set([".jpg",".jpeg",".png",".gif",".svg",".webp",".avif",".ico"]),Ld=new Set([...Al,".mp4",".webm",".mp3",".wav",".ogg",".pdf",".woff",".woff2",".ttf",".otf"]);function m(e){let t=["B","KB","MB","GB"],n=e,r=0;while(n>=1024&&r<t.length-1)n/=1024,r+=1;return`${r===0?n:Number(n.toFixed(1))} ${t[r]}`}var h=["image/*","video/*","audio/*",".pdf",".svg",".woff",".woff2",".ttf",".otf"].join(",");function _c(){return(We()?p().assetCapabilities?.accept:void 0)??h}function Gi(e){let t=e.lastIndexOf(".");return t>0?e.slice(t).toLowerCase():""}function ev(e){return Al.has(e.startsWith(".")?e.toLowerCase():`.${e.toLowerCase()}`)}function hm(e){return Ld.has(Gi(e))}var x=new Set([".mp4",".webm",".mov",".m4v"]),w=new Set([".mp3",".wav",".ogg",".m4a",".flac"]);function up(e){let t=e.type??"";if(t.startsWith("image/"))return"image";if(t.startsWith("video/"))return"video";if(t.startsWith("audio/"))return"audio";let n=Gi(e.name);if(Al.has(n))return"image";if(x.has(n))return"video";if(w.has(n))return"audio";return"file"}var S=/^content\/([^/]+)\//;function v(e){let t=e?S.exec(e.replaceAll("\\","/")):null;return t?`content/${t[1]}/images`:"public"}function A(e){let t=e.replaceAll("\\","/");if(t.startsWith("public/"))return t.slice(6);let n=/^content\/[^/]+\/(.+)$/.exec(t);if(n)return`./${n[1]}`;return`./${t}`}function b(e,t){if(!t.has(e))return e;let n=Gi(e),r=n?e.slice(0,-n.length):e;for(let i=1;;i++){let s=`${r}-${i}${n}`;if(!t.has(s))return s}}function y(e,t){let n=e.replaceAll("\\","/").replace(/\/+$/,"");return n==="."||n===""?t:`${n}/${t}`}var g=null;function hL(e){g=e}async function Va(e,t={}){let n=[...e];if(n.length===0)return[];let r=p(),i=t.dir??v(u.value?.documentPath??null),s;try{let o=await Ir(()=>r.listDirectory(i));s=new Set(o.map((c)=>c.name))}catch{s=new Set}let f=We()?p().assetCapabilities?.maxUploadBytes:void 0,a=[];for(let o of n){if(f!==void 0&&o.size>f){k.error(`${o.name} is too large.`,{detail:`This backend accepts at most ${m(f)}; that file is ${m(o.size)}.`,source:"Media"});continue}let c=b(o.name,s);s.add(c);let d=y(i,c);try{let{path:l}=await r.uploadFile(d,o);gm([l]),a.push({kind:up(o),name:c,path:l,ref:A(l)})}catch(l){k.error(`Could not upload ${o.name}.`,{detail:te(l),path:d,source:"Media"})}}if(a.length>0)k.success(a.length===1?`Uploaded ${a[0].name} to ${i}/`:`Uploaded ${a.length} files to ${i}/`),await g?.(i);return a}function pL(e){let t=di(e),n=t.lastIndexOf("/");return n===-1?t:t.slice(n+1)}function fL(e){let t=di(e),n=t.lastIndexOf("/");return n===-1?".":t.slice(0,n)}function E(){return D?.projectConfig?.content??null}function C(e){return tv(e,E(),FC())}function I(e,t){return`${di(t.urlPrefix)}/${e.slice(t.dir.length+1)}`}function Id(e){let t=di(e);if(t.startsWith(`${Np}/`))return`/${t.slice(Np.length+1)}`;let n=C(t);return n?`/${I(t,n)}`:`/${t}`}function Bu(e){let t=di(e);if(t==="")return e;let{space:n,fileBaseUrl:r}=mm();if(n==="repo")return PC(`${r}${Ov(t)}`,mL(t));return kx(Id(t))}
|
|
2
2
|
export{Al,Ld,_c,Gi,ev,hm,up,hL,Va,pL,fL,Id,Bu};
|
|
3
3
|
|
|
4
4
|
//# debugId=2310F1E15B711CFB64756E2164756E21
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
5
|
+
//# sourceMappingURL=studio-e47215hh.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{p}from"./studio-y7jehjrp.js";import{K,D}from"./studio-tp642n5g.js";import{th}from"./studio-
|
|
1
|
+
import{p}from"./studio-y7jehjrp.js";import{K,D}from"./studio-tp642n5g.js";import{th}from"./studio-cqmtbg2p.js";import{nt,Pv}from"./studio-nbxqcgvf.js";async function xb(e,s){let o=p();if(!o.codeService)return null;return o.codeService(e,s)}var gc=new Map;async function _b(e,s){let o=e.$prototype?D?.projectConfig?.imports?.[e.$prototype]:null,t=e.$src||o;if(!t||!e.$prototype)return null;let r=`${t}::${e.$prototype}`;if(gc.has(r))return gc.get(r);try{let n=p();if(!n.fetchPluginSchema)return gc.set(r,null),null;let i=!o&&s.documentPath?`${location.origin}/${s.documentPath}`:void 0,a=await n.fetchPluginSchema(t,e.$prototype,i);return gc.set(r,a),a}catch{return gc.set(r,null),null}}function M1(e,s){let o=e.getModel();if(!o)return;let t=th();if(!t)return;let r=s.map((n)=>{let i=n.labels?.[0];if(!i)return null;let{line:a,column:l,length:c}=i.span;return{code:n.url?{target:t.Uri.parse(n.url),value:n.code}:n.code,endColumn:l+(c||1),endLineNumber:a,message:n.message+(n.help?`
|
|
2
2
|
${n.help}`:""),severity:n.severity==="error"?t.MarkerSeverity.Error:t.MarkerSeverity.Warning,source:"oxlint",startColumn:l,startLineNumber:a}}).filter(Boolean);t.editor.setModelMarkers(o,"oxlint",r)}function UE(e,s){let o=(t)=>{if(!nt(t))return null;let r=t.parameters;if(!Array.isArray(r)||r.length===0)return null;return Pv(r)};if(e.type==="def"){let t=e.defName?o(s?.state?.[e.defName]):null;if(t)return t}else if(e.type==="event"){if(!s||!e.path)return["state","event"];let t=K(s,e.path),r=t&&e.eventKey?o(t[e.eventKey]):null;if(r)return r}return["state","event"]}
|
|
3
3
|
export{xb,gc,_b,M1,UE};
|
|
4
4
|
|
|
5
5
|
//# debugId=602B7A9B1AEF7FB564756E2164756E21
|
|
6
|
-
//# sourceMappingURL=studio-
|
|
6
|
+
//# sourceMappingURL=studio-fbx6twps.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{p}from"./studio-y7jehjrp.js";import{di}from"./studio-
|
|
1
|
+
import{p}from"./studio-y7jehjrp.js";import{di}from"./studio-1q6amtph.js";import{Ir}from"./studio-xkfs0dp2.js";import{Gi,up,pL,fL}from"./studio-e47215hh.js";var r=new Map,d=new Map,a=new Map;function l(e,t){let n=pL(e),i=a.get(e);return{bytes:typeof t?.size==="number"?t.size:null,ext:Gi(n),height:i?.height??null,kind:up({name:n}),modified:t?.modified??null,name:n,path:e,width:i?.width??null}}function sb(e){return r.get(di(e))??null}function bE(e){for(let t of e){if(t.type!=="file")continue;let n=di(t.path);if(!r.has(n))r.set(n,l(n,t))}}async function vE(e){let t=di(e),n=r.get(t);if(n)return n;let i=d.get(t);if(i)return i;let o=(async()=>{let u;try{u=(await Ir(()=>p().listDirectory(fL(t)))).find((f)=>di(f.path)===t)}catch{u=void 0}return l(t,u)})();d.set(t,o);let s=await o;return d.delete(t),r.set(t,s),s}function ab(e,t,n){if(!(t>0&&n>0))return!1;let i=di(e),o=a.get(i);if(o&&o.width===t&&o.height===n)return!1;a.set(i,{height:n,width:t});let s=r.get(i);if(s)r.set(i,{...s,height:n,width:t});return!0}function yE(){r.clear(),a.clear()}function m1(e){if(e<1024)return`${e} B`;if(e<1048576)return`${Math.round(e/1024)} KB`;return`${(e/1048576).toFixed(1)} MB`}function wE(e){if(!e)return"";let t=[];if(e.width!==null&&e.height!==null)t.push(`${e.width} × ${e.height}`);if(e.bytes!==null)t.push(m1(e.bytes));return t.join(" · ")}
|
|
2
2
|
export{sb,bE,vE,ab,yE,m1,wE};
|
|
3
3
|
|
|
4
4
|
//# debugId=4F04E6D76DE7569064756E2164756E21
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
5
|
+
//# sourceMappingURL=studio-fthwn4kf.js.map
|