@stacksjs/stx 0.2.699 → 0.2.703
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/chunk-03rwab7g.js +2 -0
- package/dist/{chunk-m0tbymwv.js → chunk-0e5vpnzr.js} +1 -1
- package/dist/chunk-0qdgt6gc.js +2 -0
- package/dist/chunk-0x2zqb7d.js +2 -0
- package/dist/{chunk-x31c5aez.js → chunk-27n1yqtw.js} +11 -11
- package/dist/{chunk-pwwv06bk.js → chunk-2f7d7mjb.js} +1 -1
- package/dist/{chunk-0vpk16gq.js → chunk-2gzrx4ma.js} +7 -7
- package/dist/{chunk-cq21rc0g.js → chunk-2nqt1m3m.js} +2 -2
- package/dist/{chunk-4tnr23cm.js → chunk-2vbnt58h.js} +5 -5
- package/dist/{chunk-x3hw124a.js → chunk-2xtzzx00.js} +1 -1
- package/dist/{chunk-edjgkheg.js → chunk-4t9cggwf.js} +1 -1
- package/dist/{chunk-dg3zkjq8.js → chunk-4v0w8h7w.js} +1 -1
- package/dist/{chunk-3kjdx33e.js → chunk-4ykrvjss.js} +1 -1
- package/dist/chunk-51zgnftt.js +2 -0
- package/dist/{chunk-7rd38brt.js → chunk-5349365w.js} +1 -1
- package/dist/{chunk-m9ttegj1.js → chunk-57vw2k0c.js} +4 -4
- package/dist/{chunk-ybz74w1t.js → chunk-5j9mxa2q.js} +1 -1
- package/dist/{chunk-pc0jc7b5.js → chunk-5tdq6crw.js} +3 -3
- package/dist/{chunk-65z146rz.js → chunk-8afh663x.js} +9 -9
- package/dist/{chunk-6dmtb9bv.js → chunk-8g6rqh9v.js} +1 -1
- package/dist/chunk-8ne5d50r.js +2 -0
- package/dist/chunk-9ctjadsk.js +2 -0
- package/dist/{chunk-g2c4s35j.js → chunk-9dz8xj1j.js} +1 -1
- package/dist/chunk-9yq5wttm.js +2 -0
- package/dist/{chunk-mb4tbeza.js → chunk-a4fmk7qf.js} +5 -5
- package/dist/{chunk-pzb10fzw.js → chunk-a6df4es1.js} +1 -1
- package/dist/{chunk-7zvd1hd0.js → chunk-a9qetxqw.js} +1 -1
- package/dist/{chunk-ttcxgrc4.js → chunk-bxcneh6f.js} +1 -1
- package/dist/{chunk-3dyvffvg.js → chunk-c7kbywge.js} +2 -2
- package/dist/{chunk-k2q1hts9.js → chunk-cp0889bs.js} +7 -7
- package/dist/{chunk-q48wtyq6.js → chunk-cr1xkjg5.js} +1 -1
- package/dist/{chunk-dnw2nth5.js → chunk-eejn8aqh.js} +2 -2
- package/dist/{chunk-y8ta8t9s.js → chunk-f66x2hff.js} +1 -1
- package/dist/{chunk-2ejj7ye1.js → chunk-f6yzgf9s.js} +2 -2
- package/dist/{chunk-t7v8q9t9.js → chunk-ff68f7sm.js} +1 -1
- package/dist/{chunk-whaq89wy.js → chunk-ft534en1.js} +36 -36
- package/dist/{chunk-0f4hmytc.js → chunk-fyaedq4a.js} +1 -1
- package/dist/{chunk-f5fgpj19.js → chunk-g575srz3.js} +1 -1
- package/dist/{chunk-19rqfb03.js → chunk-gabr4cq6.js} +2 -2
- package/dist/chunk-ha4vb9a6.js +2 -0
- package/dist/chunk-ht0dycd1.js +2 -0
- package/dist/{chunk-enjd9hb3.js → chunk-jahes462.js} +4 -4
- package/dist/{chunk-yft8yn6y.js → chunk-jkywbfb0.js} +2 -2
- package/dist/chunk-mrxmbenj.js +2 -0
- package/dist/{chunk-45es05ph.js → chunk-n2ema4wf.js} +2 -2
- package/dist/chunk-ndsw688j.js +2 -0
- package/dist/{chunk-e9qtd6hb.js → chunk-pmgwk7yr.js} +10 -10
- package/dist/{chunk-60tctrsm.js → chunk-prc2b120.js} +1 -1
- package/dist/chunk-ptv1ye08.js +2 -0
- package/dist/{chunk-0jkajjdy.js → chunk-q510c32j.js} +2 -2
- package/dist/chunk-q60c63an.js +2 -0
- package/dist/{chunk-revrs5ew.js → chunk-q7mcakeg.js} +5 -5
- package/dist/{chunk-vkp0d7nw.js → chunk-qxey1fsb.js} +1 -1
- package/dist/{chunk-31kts5ct.js → chunk-r2n8kpzq.js} +1 -1
- package/dist/{chunk-6qavdmj4.js → chunk-r2tmvna1.js} +1 -1
- package/dist/{chunk-jeyxqsdk.js → chunk-rf3haj5d.js} +1 -1
- package/dist/{chunk-av6j81hv.js → chunk-rg94ez9c.js} +1 -1
- package/dist/{chunk-8ha8chmp.js → chunk-s4qje08f.js} +3 -3
- package/dist/chunk-s8dc9bvk.js +2 -0
- package/dist/{chunk-18xsrwv2.js → chunk-t8zyce19.js} +1 -1
- package/dist/{chunk-bmgrydmc.js → chunk-v7xv88cv.js} +1 -1
- package/dist/{chunk-06dv852k.js → chunk-w7e28p74.js} +3 -3
- package/dist/chunk-w8fbyhr1.js +2 -0
- package/dist/chunk-wsdqxpjh.js +2 -0
- package/dist/{chunk-ay971fa1.js → chunk-xbckkzqb.js} +1 -1
- package/dist/{chunk-3f8ya237.js → chunk-xen2gsqb.js} +1 -1
- package/dist/chunk-ynzhp77r.js +2 -0
- package/dist/{chunk-s3gq14xg.js → chunk-yxwvj7fs.js} +3 -3
- package/dist/chunk-yyx89zxs.js +2 -0
- package/dist/chunk-z0x54ynx.js +3 -0
- package/dist/{chunk-scdk7g78.js → chunk-z1wmhe0g.js} +1 -1
- package/dist/{chunk-dcqjdbkp.js → chunk-z9csfarm.js} +1 -1
- package/dist/{chunk-yvpe1m3a.js → chunk-zw6jbzfm.js} +1 -1
- package/dist/cli.js +9 -9
- package/dist/craft-entry.js +1 -1
- package/dist/craft.js +1 -1
- package/dist/native/compiler/html-to-ir.js +16 -0
- package/dist/native/compiler/ir.d.ts +1 -0
- package/dist/native/runtime/craft-bridge.js +2 -0
- package/dist/native/runtime/native-host.d.ts +1 -1
- package/dist/native/runtime/native-host.js +3 -1
- package/dist/pwa.js +1 -1
- package/dist/ssg.js +8 -8
- package/package.json +5 -5
- package/dist/chunk-1wkvarf2.js +0 -2
- package/dist/chunk-7yv5nygj.js +0 -2
- package/dist/chunk-80y4kjjg.js +0 -2
- package/dist/chunk-amcsa9xc.js +0 -2
- package/dist/chunk-fnbsdf2d.js +0 -2
- package/dist/chunk-fp88bmhj.js +0 -2
- package/dist/chunk-ftwybhyp.js +0 -2
- package/dist/chunk-g7bynj9j.js +0 -2
- package/dist/chunk-h984vmht.js +0 -2
- package/dist/chunk-k2hrwk7d.js +0 -3
- package/dist/chunk-m148t3f6.js +0 -2
- package/dist/chunk-pfv6dzev.js +0 -2
- package/dist/chunk-pksz8dq4.js +0 -2
- package/dist/chunk-q6r76jd6.js +0 -2
- package/dist/chunk-s4vdczw0.js +0 -2
- package/dist/chunk-sdyprm6w.js +0 -2
- package/dist/chunk-v55m619e.js +0 -2
- package/dist/chunk-vnqx5ex0.js +0 -2
- package/dist/chunk-w0w5ttpq.js +0 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{f}from"./chunk-b7e07ybq.js";function ut(){if(typeof Notification<"u"&&Notification.permission==="granted")return!0;return!1}function oe(){return typeof window<"u"&&typeof document<"u"}async function
|
|
2
|
+
import{f}from"./chunk-b7e07ybq.js";function ut(){if(typeof Notification<"u"&&Notification.permission==="granted")return!0;return!1}function oe(){return typeof window<"u"&&typeof document<"u"}async function Gl(){if(typeof Notification>"u")return!1;if(Notification.permission==="granted")return!0;if(Notification.permission==="denied")return!1;return await Notification.requestPermission()==="granted"}var N=new Map;function pt(){return`alert-${Date.now()}-${Math.random().toString(36).substring(2,9)}`}function ft(e){switch(e){case"info":return"ℹ";case"success":return"✔";case"warning":return"⚠";case"error":return"✖";default:return"ℹ"}}function mt(e="top-right"){if(!oe())throw Error("Toast container requires browser environment");try{let r=document.querySelector(`.stx-toast-container[data-position="${e}"]`);if(r)return r}catch{}let t=document.createElement("div");t.className=`stx-toast-container ${e}`,t.dataset.position=e;try{if(document.body)document.body.appendChild(t)}catch{}return t}function gt(e){let{options:t}=e,r=ft(t.type),n=t.type||"info",o=t.duration!==0;return`
|
|
3
3
|
<div class="stx-toast ${n}" data-alert-id="${e.id}" role="alert" aria-live="polite">
|
|
4
4
|
<div class="stx-toast-icon">${r}</div>
|
|
5
5
|
<div class="stx-toast-content">
|
|
@@ -8,7 +8,7 @@ import{f}from"./chunk-b7e07ybq.js";function ut(){if(typeof Notification<"u"&&Not
|
|
|
8
8
|
</div>
|
|
9
9
|
${o?'<button class="stx-toast-close" aria-label="Close">×</button>':""}
|
|
10
10
|
</div>
|
|
11
|
-
`}function ke(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function X(e){if(e.timeout)clearTimeout(e.timeout);if(N.delete(e.id),e.element&&oe())e.element.classList.add("dismissing"),setTimeout(()=>{e.element?.remove()},200)}async function oo(e){let t=pt(),r=ut(),n=e.duration??5000,o={id:t,options:e};if(N.set(t,o),r&&e.type!=="error")try{let a=new Notification(e.title||"Notification",{body:e.message,icon:e.type==="success"?"\u2713":e.type==="warning"?"\u26A0":"\u2139",tag:t});if(a.onclick=()=>{if(e.onClick)e.onClick();a.close()},n>0)o.timeout=setTimeout(()=>{a.close(),N.delete(t)},n);return}catch{}if(oe())try{let a=mt(e.position),s=document.createElement("div");s.innerHTML=gt(o);let c=s.firstElementChild;if(!c){let l=(e.type||"info").toUpperCase();console.log(`[stx-alert] ${l}: ${e.title||""}`),console.log(`[stx-alert] ${e.message}`);return}o.element=c;try{a.appendChild(c)}catch{let l=(e.type||"info").toUpperCase();console.log(`[stx-alert] ${l}: ${e.title||""}`),console.log(`[stx-alert] ${e.message}`);return}if(typeof requestAnimationFrame==="function")requestAnimationFrame(()=>{try{c.classList.add("visible")}catch{}});try{c.addEventListener("click",(l)=>{if(l.target.classList?.contains("stx-toast-close")){X(o);return}if(e.onClick)e.onClick()})}catch{}if(n>0)o.timeout=setTimeout(()=>{X(o)},n)}catch{let a=(e.type||"info").toUpperCase();console.log(`[stx-alert] ${a}: ${e.title||""}`),console.log(`[stx-alert] ${e.message}`)}else{let a=(e.type||"info").toUpperCase();if(console.log(`[stx-alert] ${a}: ${e.title||""}`),console.log(`[stx-alert] ${e.message}`),n>0)o.timeout=setTimeout(()=>{N.delete(t)},n)}}async function zn(e){return oo({...e,position:e.position||"top-right"})}async function
|
|
11
|
+
`}function ke(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function X(e){if(e.timeout)clearTimeout(e.timeout);if(N.delete(e.id),e.element&&oe())e.element.classList.add("dismissing"),setTimeout(()=>{e.element?.remove()},200)}async function oo(e){let t=pt(),r=ut(),n=e.duration??5000,o={id:t,options:e};if(N.set(t,o),r&&e.type!=="error")try{let a=new Notification(e.title||"Notification",{body:e.message,icon:e.type==="success"?"\u2713":e.type==="warning"?"\u26A0":"\u2139",tag:t});if(a.onclick=()=>{if(e.onClick)e.onClick();a.close()},n>0)o.timeout=setTimeout(()=>{a.close(),N.delete(t)},n);return}catch{}if(oe())try{let a=mt(e.position),s=document.createElement("div");s.innerHTML=gt(o);let c=s.firstElementChild;if(!c){let l=(e.type||"info").toUpperCase();console.log(`[stx-alert] ${l}: ${e.title||""}`),console.log(`[stx-alert] ${e.message}`);return}o.element=c;try{a.appendChild(c)}catch{let l=(e.type||"info").toUpperCase();console.log(`[stx-alert] ${l}: ${e.title||""}`),console.log(`[stx-alert] ${e.message}`);return}if(typeof requestAnimationFrame==="function")requestAnimationFrame(()=>{try{c.classList.add("visible")}catch{}});try{c.addEventListener("click",(l)=>{if(l.target.classList?.contains("stx-toast-close")){X(o);return}if(e.onClick)e.onClick()})}catch{}if(n>0)o.timeout=setTimeout(()=>{X(o)},n)}catch{let a=(e.type||"info").toUpperCase();console.log(`[stx-alert] ${a}: ${e.title||""}`),console.log(`[stx-alert] ${e.message}`)}else{let a=(e.type||"info").toUpperCase();if(console.log(`[stx-alert] ${a}: ${e.title||""}`),console.log(`[stx-alert] ${e.message}`),n>0)o.timeout=setTimeout(()=>{N.delete(t)},n)}}async function zn(e){return oo({...e,position:e.position||"top-right"})}async function Kl(e,t=3000){return zn({message:e,type:"info",duration:t})}async function Xl(e,t=3000){return zn({message:e,type:"success",duration:t})}async function Jl(e,t=3000){return zn({message:e,type:"warning",duration:t})}async function Yl(e,t=5000){return zn({message:e,type:"error",duration:t})}async function Zl(e,t,r="info"){return oo({title:e,message:t,type:r})}function Ql(e){let t=N.get(e);if(t)X(t)}function eu(){for(let e of N.values())X(e)}function tu(){return N.size}var nu=`
|
|
12
12
|
.stx-toast-container {
|
|
13
13
|
position: fixed;
|
|
14
14
|
z-index: 10001;
|
|
@@ -559,7 +559,7 @@ import{f}from"./chunk-b7e07ybq.js";function ut(){if(typeof Notification<"u"&&Not
|
|
|
559
559
|
<div class="stx-modal-buttons">${a}</div>
|
|
560
560
|
</div>
|
|
561
561
|
</div>
|
|
562
|
-
`}function Ce(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function M(e,t,r=!1){let n=F.indexOf(e);if(n>-1)F.splice(n,1);if(e.element&&ie())e.element.remove();let a=(e.options.buttons||J(e.options.type))[t];if(a?.action)a.action();e.resolve({buttonIndex:t,cancelled:r})}async function
|
|
562
|
+
`}function Ce(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function M(e,t,r=!1){let n=F.indexOf(e);if(n>-1)F.splice(n,1);if(e.element&&ie())e.element.remove();let a=(e.options.buttons||J(e.options.type))[t];if(a?.action)a.action();e.resolve({buttonIndex:t,cancelled:r})}async function Gt(e){let t=wt(),r=bt();return new Promise((n)=>{let o={id:r,options:e,resolve:n};if(F.push(o),t)console.log(`[stx-modal] Showing native modal: ${e.title||"Modal"}`),setTimeout(()=>{M(o,e.defaultButton??0,!1)},0);else if(ie())try{let a=document.createElement("div");a.innerHTML=yt(o);let s=a.firstElementChild;if(!s){console.log(`[stx-modal] ${e.type?.toUpperCase()||"INFO"}: ${e.title||"Modal"}`),console.log(`[stx-modal] ${e.message}`),setTimeout(()=>{M(o,e.defaultButton??0,!1)},0);return}o.element=s;try{document.body.appendChild(s)}catch{console.log(`[stx-modal] ${e.type?.toUpperCase()||"INFO"}: ${e.title||"Modal"}`),console.log(`[stx-modal] ${e.message}`),setTimeout(()=>{M(o,e.defaultButton??0,!1)},0);return}try{s.querySelectorAll(".stx-modal-btn").forEach((c)=>{c.addEventListener("click",()=>{let l=Number.parseInt(c.dataset.index||"0",10);M(o,l,!1)})})}catch{}try{s.addEventListener("click",(c)=>{if(c.target===s){let l=e.cancelButton??0;M(o,l,!0)}})}catch{}try{let c=(l)=>{if(l.key==="Escape"){let d=e.cancelButton??0;M(o,d,!0),document.removeEventListener("keydown",c)}else if(l.key==="Enter"){let d=e.defaultButton??(e.buttons||J(e.type)).length-1;M(o,d,!1),document.removeEventListener("keydown",c)}};document.addEventListener("keydown",c)}catch{}try{let c=s.querySelector(".stx-modal-btn[autofocus]");if(c)c.focus()}catch{}if(typeof process<"u"&&process.env.BUN_TEST)setTimeout(()=>{M(o,e.defaultButton??0,!1)},0)}catch{console.log(`[stx-modal] ${e.type?.toUpperCase()||"INFO"}: ${e.title||"Modal"}`),console.log(`[stx-modal] ${e.message}`),setTimeout(()=>{M(o,e.defaultButton??0,!1)},0)}else{console.log(`[stx-modal] ${e.type?.toUpperCase()||"INFO"}: ${e.title||"Modal"}`),console.log(`[stx-modal] ${e.message}`);let a=e.buttons||J(e.type);console.log(`[stx-modal] Buttons: ${a.map((s)=>s.label).join(", ")}`),setTimeout(()=>{M(o,e.defaultButton??0,!1)},0)}})}async function pa(e,t){return Gt({title:e,message:t,type:"info"})}async function Bu(e,t){return Gt({title:e,message:t,type:"warning"})}async function Fu(e,t){return Gt({title:e,message:t,type:"error"})}async function zu(e,t){return Gt({title:e,message:t,type:"success"})}async function fa(e,t){return Gt({title:e,message:t,type:"question",buttons:[{label:"No",style:"default"},{label:"Yes",style:"primary"}],defaultButton:1,cancelButton:0})}async function Hu(e,t="Confirm"){return(await fa(t,e)).buttonIndex===1}async function Vu(e,t="Alert"){await pa(t,e)}async function Uu(e,t="",r="Input"){if(ie()&&typeof window.prompt==="function")return window.prompt(e,t);return console.log(`[stx-modal] PROMPT: ${r}`),console.log(`[stx-modal] ${e}`),console.log(`[stx-modal] Default: ${t}`),t}function Wu(){return F.length}function qu(){while(F.length>0){let e=F[F.length-1];M(e,0,!0)}}var Gu=`
|
|
563
563
|
.stx-modal-overlay {
|
|
564
564
|
position: fixed;
|
|
565
565
|
inset: 0;
|
|
@@ -691,7 +691,7 @@ import{f}from"./chunk-b7e07ybq.js";function ut(){if(typeof Notification<"u"&&Not
|
|
|
691
691
|
background: #555;
|
|
692
692
|
}
|
|
693
693
|
}
|
|
694
|
-
`;import Ie from"process";function vt(){if(Ie.platform)return Ie.platform;return"unknown"}function Te(){if(typeof window<"u"&&window.craft?.tray)return!0;return!1}function Ee(e,t){if(e.type==="separator")return{id:`sep-${t}`,label:"",type:"separator"};let r={id:`item-${t}-${e.label.replace(/\s+/g,"-").toLowerCase()}`,label:e.label,type:e.type||"normal",enabled:e.enabled!==!1};if(e.accelerator)r.shortcut=e.accelerator;if(e.type==="checkbox")r.checked=e.checked||!1;if(e.type==="submenu"&&e.submenu)r.submenu=e.submenu.map((n,o)=>Ee(n,o));return r}function ae(e){return e.map((t,r)=>Ee(t,r))}function Me(e,t=0){if(e.type==="separator")return'<hr class="stx-tray-separator" />';let r=" ".repeat(t),n=e.enabled===!1?"disabled":"",o=e.checked?"\u2713 ":"",a=e.accelerator?`<span class="accelerator">${e.accelerator}</span>`:"",s=`${r}<div class="stx-tray-item ${n}" data-action="${e.label}">`;if(s+=`<span class="label">${o}${e.label}</span>${a}`,e.type==="submenu"&&e.submenu){s+='<span class="arrow">\u25B8</span>',s+='<div class="stx-tray-submenu">';for(let c of e.submenu)s+=Me(c,t+1);s+="</div>"}return s+="</div>",s}function Pt(e){let t='<div class="stx-tray-menu">';for(let r of e)t+=Me(r);return t+="</div>",t}var L=new Map;function St(){return`tray-${Date.now()}-${Math.random().toString(36).substring(2,9)}`}var $e=!1;function kt(){if($e||typeof window>"u")return;window.addEventListener("craft:tray:menu",(e)=>{let{action:t}=e.detail;for(let r of L.values()){let n=r.handlers.get(t);if(n){n();break}}}),$e=!0}async function ga(e={}){let t=St(),r=vt(),n=Te(),o={icon:e.icon||"",tooltip:e.tooltip||"stx Application",menu:e.menu||[],visible:!0},a=new Map;for(let c of e.menu||[]){if(c.type!=="separator"&&c.onClick)a.set(c.label,c.onClick);if(c.type==="submenu"&&c.submenu){for(let l of c.submenu)if(l.type!=="separator"&&l.onClick)a.set(l.label,l.onClick)}}if(L.set(t,{state:o,handlers:a}),n){kt();let c=window;try{if(o.tooltip)await c.craft.tray.setTitle({title:o.tooltip}),await c.craft.tray.setTooltip({tooltip:o.tooltip});if(o.icon)await c.craft.tray.setIcon({icon:o.icon});let l=ae(o.menu);await c.craft.tray.setMenu({items:l}),console.log(`[stx-tray] Native tray created for ${r}`)}catch(l){console.warn("[stx-tray] Failed to create native tray:",l)}}else console.log("[stx-tray] Created simulated tray (not in Craft window)"),console.log(`[stx-tray] ID: ${t}`),console.log(`[stx-tray] Tooltip: ${o.tooltip}`),console.log(`[stx-tray] Menu items: ${o.menu.length}`);return{id:t,setIcon:(c)=>{if(o.icon=c,n)window.craft.tray.setIcon({icon:c}).catch((d)=>{console.warn("[stx-tray] Failed to set icon:",d)});console.log(`[stx-tray:${t}] Icon updated`)},setTooltip:(c)=>{if(o.tooltip=c,n)window.craft.tray.setTooltip({tooltip:c}).catch((d)=>{console.warn("[stx-tray] Failed to set tooltip:",d)});console.log(`[stx-tray:${t}] Tooltip: ${c}`)},setMenu:(c)=>{o.menu=c,a.clear();for(let l of c){if(l.type!=="separator"&&l.onClick)a.set(l.label,l.onClick);if(l.type==="submenu"&&l.submenu){for(let d of l.submenu)if(d.type!=="separator"&&d.onClick)a.set(d.label,d.onClick)}}if(n){let l=window,d=ae(c);l.craft.tray.setMenu({items:d}).catch((p)=>{console.warn("[stx-tray] Failed to set menu:",p)})}console.log(`[stx-tray:${t}] Menu updated (${c.length} items)`)},destroy:()=>{if(o.visible=!1,L.delete(t),n)window.craft.tray.destroy?.().catch((l)=>{console.warn("[stx-tray] Failed to destroy tray:",l)});console.log(`[stx-tray:${t}] Destroyed`)}}}var
|
|
694
|
+
`;import Ie from"process";function vt(){if(Ie.platform)return Ie.platform;return"unknown"}function Te(){if(typeof window<"u"&&window.craft?.tray)return!0;return!1}function Ee(e,t){if(e.type==="separator")return{id:`sep-${t}`,label:"",type:"separator"};let r={id:`item-${t}-${e.label.replace(/\s+/g,"-").toLowerCase()}`,label:e.label,type:e.type||"normal",enabled:e.enabled!==!1};if(e.accelerator)r.shortcut=e.accelerator;if(e.type==="checkbox")r.checked=e.checked||!1;if(e.type==="submenu"&&e.submenu)r.submenu=e.submenu.map((n,o)=>Ee(n,o));return r}function ae(e){return e.map((t,r)=>Ee(t,r))}function Me(e,t=0){if(e.type==="separator")return'<hr class="stx-tray-separator" />';let r=" ".repeat(t),n=e.enabled===!1?"disabled":"",o=e.checked?"\u2713 ":"",a=e.accelerator?`<span class="accelerator">${e.accelerator}</span>`:"",s=`${r}<div class="stx-tray-item ${n}" data-action="${e.label}">`;if(s+=`<span class="label">${o}${e.label}</span>${a}`,e.type==="submenu"&&e.submenu){s+='<span class="arrow">\u25B8</span>',s+='<div class="stx-tray-submenu">';for(let c of e.submenu)s+=Me(c,t+1);s+="</div>"}return s+="</div>",s}function Pt(e){let t='<div class="stx-tray-menu">';for(let r of e)t+=Me(r);return t+="</div>",t}var L=new Map;function St(){return`tray-${Date.now()}-${Math.random().toString(36).substring(2,9)}`}var $e=!1;function kt(){if($e||typeof window>"u")return;window.addEventListener("craft:tray:menu",(e)=>{let{action:t}=e.detail;for(let r of L.values()){let n=r.handlers.get(t);if(n){n();break}}}),$e=!0}async function ga(e={}){let t=St(),r=vt(),n=Te(),o={icon:e.icon||"",tooltip:e.tooltip||"stx Application",menu:e.menu||[],visible:!0},a=new Map;for(let c of e.menu||[]){if(c.type!=="separator"&&c.onClick)a.set(c.label,c.onClick);if(c.type==="submenu"&&c.submenu){for(let l of c.submenu)if(l.type!=="separator"&&l.onClick)a.set(l.label,l.onClick)}}if(L.set(t,{state:o,handlers:a}),n){kt();let c=window;try{if(o.tooltip)await c.craft.tray.setTitle({title:o.tooltip}),await c.craft.tray.setTooltip({tooltip:o.tooltip});if(o.icon)await c.craft.tray.setIcon({icon:o.icon});let l=ae(o.menu);await c.craft.tray.setMenu({items:l}),console.log(`[stx-tray] Native tray created for ${r}`)}catch(l){console.warn("[stx-tray] Failed to create native tray:",l)}}else console.log("[stx-tray] Created simulated tray (not in Craft window)"),console.log(`[stx-tray] ID: ${t}`),console.log(`[stx-tray] Tooltip: ${o.tooltip}`),console.log(`[stx-tray] Menu items: ${o.menu.length}`);return{id:t,setIcon:(c)=>{if(o.icon=c,n)window.craft.tray.setIcon({icon:c}).catch((d)=>{console.warn("[stx-tray] Failed to set icon:",d)});console.log(`[stx-tray:${t}] Icon updated`)},setTooltip:(c)=>{if(o.tooltip=c,n)window.craft.tray.setTooltip({tooltip:c}).catch((d)=>{console.warn("[stx-tray] Failed to set tooltip:",d)});console.log(`[stx-tray:${t}] Tooltip: ${c}`)},setMenu:(c)=>{o.menu=c,a.clear();for(let l of c){if(l.type!=="separator"&&l.onClick)a.set(l.label,l.onClick);if(l.type==="submenu"&&l.submenu){for(let d of l.submenu)if(d.type!=="separator"&&d.onClick)a.set(d.label,d.onClick)}}if(n){let l=window,d=ae(c);l.craft.tray.setMenu({items:d}).catch((p)=>{console.warn("[stx-tray] Failed to set menu:",p)})}console.log(`[stx-tray:${t}] Menu updated (${c.length} items)`)},destroy:()=>{if(o.visible=!1,L.delete(t),n)window.craft.tray.destroy?.().catch((l)=>{console.warn("[stx-tray] Failed to destroy tray:",l)});console.log(`[stx-tray:${t}] Destroyed`)}}}var Ku=ga;function Xu(){return Array.from(L.keys())}function Ju(e){let t=L.get(e);if(!t)return null;let r=Te();return{id:e,setIcon:(n)=>{if(t.state.icon=n,r)window.craft.tray.setIcon({icon:n}).catch(()=>{})},setTooltip:(n)=>{if(t.state.tooltip=n,r)window.craft.tray.setTooltip({tooltip:n}).catch(()=>{})},setMenu:(n)=>{if(t.state.menu=n,r){let o=window,a=ae(n);o.craft.tray.setMenu({items:a}).catch(()=>{})}},destroy:()=>{if(L.delete(e),r)window.craft.tray.destroy?.().catch(()=>{})}}}function Yu(e,t){let r=L.get(e);if(!r)return!1;let n=r.handlers.get(t);if(n)return n(),!0;return!1}function Zu(e){let t=L.get(e);if(!t)return null;return Pt(t.state.menu)}function Qu(){return`
|
|
695
695
|
// STX Desktop Tray Bridge
|
|
696
696
|
// Provides convenient wrappers around window.craft.tray APIs
|
|
697
697
|
window.stxTray = {
|
|
@@ -894,7 +894,7 @@ window.stxWindow = {
|
|
|
894
894
|
|
|
895
895
|
// Expose as global for backwards compatibility
|
|
896
896
|
window.desktop = window.stxWindow;
|
|
897
|
-
`}import{accessSync as Mt,closeSync as Dt,constants as Bt,openSync as Ot,readSync as Rt,realpathSync as Lt}from"fs";import{resolveCraftBinary as _t}from"craft-native";import{macOSRuntimeExecutablePath as wd,pack as xd,packageApp as Sd}from"craft-native";import{craftBinaryNotFoundMessage as kd,resolveCraftBinary as _d}from"craft-native";function Hr(e,t="full"){let r=_t(e,t),n=r;if(r==="craft"||r==="craft-webview"){let d=Bun.spawnSync(["pantry","which",r,"--resolve"]);if(d.exitCode!==0){let p=`${d.stderr}${d.stdout}`.trim();throw Error(`Cannot locate Craft's native executable. Install Craft through Pantry and use Pantry 0.11.114 or newer.${p?` ${p}`:""}`)}n=d.stdout.toString().trim()}let o=Lt(n);Mt(o,Bt.X_OK);let a=Ot(o,"r"),s=Buffer.alloc(4);try{Rt(a,s,0,s.length,0)}finally{Dt(a)}let c=s.readUInt32BE(0);if(!(process.platform==="darwin"?[4277009102,3472551422,4277009103,3489328638,3405691582,3199925962,3405691583,3216703178].includes(c):process.platform==="win32"?s[0]===77&&s[1]===90:c===2135247942))throw Error(`Craft packaging requires a native executable, received: ${o}`);return o}import V from"process";import{spawn as Nt}from"child_process";import{AutoUpdater as ma,canReplaceBundle as Cd,clearQuarantine as Ed,extractBundle as Td,generateUpdateManifest as ha,readBundleIdentity as ao,swapBundle as $d,verifyBundleTrust as Rd}from"craft-native";var ya="update.json";function ba(e,t){return`https://github.com/${e}/releases/latest/download/${t}`}function va(e,t,r){return`https://github.com/${e}/releases/download/${t}/${r}`}function wa(e){let{repository:t,manifestAsset:r=ya,...n}=e;return new ma({...n,updateUrl:ba(t,r)})}function Ad(e){let t=e.tag??`v${e.version}`,r={};for(let[n,o]of Object.entries(e.artifacts)){if(!o)continue;r[n]={path:o,url:va(e.repository,t,o.split("/").pop())}}return ha({version:e.version,releaseNotes:e.releaseNotes,platforms:r})}function Vr(e=V.execPath){let t=e.split("/");for(let r=0;r<t.length;r++)if(t[r].endsWith(".app"))return t.slice(0,r+1).join("/");return null}async function Pd(){let e=Vr();if(!e)return null;return(await ao(e)).teamId}function xa(){let e=V.ppid;if(e>1)try{V.kill(e,"SIGTERM");return}catch{}V.exit(0)}function Sa(e={}){let t=e.appPath??Vr(),r=e.quit??(()=>V.exit(0));if(t)Nt("/usr/bin/open",["-n",t],{detached:!0,stdio:"ignore"}).unref();let n=e.quitDelayMs??0;if(n>0){setTimeout(r,n).unref?.();return}r()}async function Id(e){let{appPath:t,requireSameTeam:r=!0,macos:n,...o}=e,a=t??Vr();if(!a)throw Error("createSelfUpdater: this process is not running from an .app bundle, so there is nothing to update. Pass `appPath` explicitly, or skip the updater in development.");let s=n?.teamId??(r?(await ao(a)).teamId??void 0:void 0);return wa({...o,appPath:a,macos:{...n,teamId:s},relaunch:e.relaunch??((c)=>Sa({appPath:c,quit:xa,quitDelayMs:250}))})}function _e(e){if(typeof process>"u"||process.platform!=="darwin")throw Error("Caffeinate requires macOS");let{dlopen:t,ptr:r}=f("bun:ffi"),n=t("/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation",{CFStringCreateWithCString:{args:["ptr","ptr","u32"],returns:"ptr"},CFRelease:{args:["ptr"],returns:"void"}}),o=t("/System/Library/Frameworks/IOKit.framework/IOKit",{IOPMAssertionCreateWithName:{args:["ptr","u32","ptr","ptr"],returns:"i32"},IOPMAssertionRelease:{args:["u32"],returns:"i32"},IOPMAssertionDeclareUserActivity:{args:["ptr","u32","ptr"],returns:"i32"}}),a=[],s=!1;function c(){if(s)return;s=!0;for(let d of a)o.symbols.IOPMAssertionRelease(d);o.close(),n.close()}function l(d){let p=Buffer.from(`${d}\x00`),m=n.symbols.CFStringCreateWithCString(null,r(p),134217984);if(!m)throw Error("Could not create power assertion name");return m}try{let d=[[e.preventDisplaySleep??!0,"PreventUserIdleDisplaySleep"],[e.preventIdleSleep??!0,"PreventUserIdleSystemSleep"],[e.preventSystemSleep??!0,"PreventSystemSleep"],[e.preventDiskSleep??!1,"PreventDiskIdle"]];for(let[p,m]of d){if(!p)continue;let u=l(e.reason||"stx: keeping your Mac awake"),w=l(m),b=new Uint32Array(1);try{let S=o.symbols.IOPMAssertionCreateWithName(w,255,u,r(b));if(S!==0)throw Error(`Could not acquire ${m} (${S})`);a.push(b[0])}finally{n.symbols.CFRelease(u),n.symbols.CFRelease(w)}}if(!a.length)throw Error("At least one sleep prevention option must be enabled");if(e.assertUserActivity??!0){let p=l("stx: user activity"),m=new Uint32Array(1);try{let u=o.symbols.IOPMAssertionDeclareUserActivity(p,0,r(m));if(u!==0)throw Error(`Could not declare user activity (${u})`);a.push(m[0])}finally{n.symbols.CFRelease(p)}}return c}catch(d){throw c(),d}}var C=null;class Ne{_release;_startedAt;_endsAt;_options;_expireHandlers=[];_expireTimer=null;_stopped=!1;constructor(e,t){this._release=e,this._options={...t},this._startedAt=new Date;let r=t.duration;if(r&&r>0){let n=r*60*1000;this._endsAt=new Date(this._startedAt.getTime()+n),this._expireTimer=setTimeout(()=>{this.stop();for(let o of this._expireHandlers)try{o()}catch{}},n)}else this._endsAt=null}get pid(){return process.pid}get startedAt(){return this._startedAt}get endsAt(){return this._endsAt}get options(){return{...this._options}}get isActive(){return!this._stopped}get remainingMs(){if(!this._endsAt)return null;let e=this._endsAt.getTime()-Date.now();return Math.max(0,e)}get elapsedMs(){return Date.now()-this._startedAt.getTime()}stop(){if(this._stopped)return;if(this._stopped=!0,this._expireTimer)clearTimeout(this._expireTimer),this._expireTimer=null;this._release()}onExpire(e){this._expireHandlers.push(e)}}function Od(e={}){if(e.duration!==void 0&&e.duration!==-1&&(!Number.isFinite(e.duration)||e.duration<=0))throw RangeError("duration must be positive minutes or -1 for indefinitely");let t=_e(e),r=new Ne(t,e);return co(),C=r,r}function co(e){if(e){if(e.stop(),C===e)C=null;return}if(C)C.stop();C=null}function Nd(){return C!==null&&C.isActive}function Dd(){if(!C||!C.isActive)return{active:!1,instance:null,startedAt:null,endsAt:null,durationMinutes:null};let t=C.options.duration;return{active:!0,instance:C,startedAt:C.startedAt,endsAt:C.endsAt,durationMinutes:t&&t>0?t:-1}}function Md(e){let t=e||C;if(!t||!t.isActive)return"0:00";let r=t.remainingMs;if(r===null)return"\u221E";let n=Math.ceil(r/1000),o=Math.floor(n/3600),a=Math.floor(n%3600/60),s=n%60;if(o>0)return`${o}:${String(a).padStart(2,"0")}:${String(s).padStart(2,"0")}`;return`${a}:${String(s).padStart(2,"0")}`}function Ld(e){if(e<=0||e===-1)return"Indefinitely";if(e<60)return`${e} minutes`;if(e===60)return"1 hour";if(e%60===0)return`${e/60} hours`;let t=Math.floor(e/60),r=e%60;return`${t}h ${r}m`}if(typeof process<"u")process.once("exit",()=>co());import{existsSync as pe,mkdirSync as Ft,readFileSync as Wt,watch as zt,writeFileSync as Ht}from"fs";import{homedir as Ut,platform as qt}from"os";import{dirname as Vt,join as j}from"path";function jt(e){let t=qt(),r=Ut();switch(t){case"darwin":return j(r,"Library","Application Support",e);case"win32":return j(process.env.APPDATA||j(r,"AppData","Roaming"),e);default:return j(r,".config",e)}}class Fe{_defaults;_data;_path;_changeHandlers=new Map;_anyChangeHandlers=new Set;_watcher=null;_writeTimer=null;_writing=!1;constructor(e){this._defaults={...e.defaults};let t=e.path?Vt(e.path):jt(e.name);if(this._path=e.path||j(t,"preferences.json"),!pe(t))Ft(t,{recursive:!0});if(this._data=this._load(),e.watch!==!1)this._setupWatcher()}get path(){return this._path}get(e){if(e in this._data)return this._data[e];return this._defaults[e]}set(e,t){let r=this.get(e);if(JSON.stringify(r)===JSON.stringify(t))return;this._data[e]=t,this._scheduleSave(),this._notifyChange(e,t,r)}getAll(){return{...this._defaults,...this._data}}has(e){return e in this._data}delete(e){if(!(e in this._data))return;let t=this._data[e];delete this._data[e],this._scheduleSave(),this._notifyChange(e,this._defaults[e],t)}reset(){let e={...this._data};this._data={},this._save();for(let t of Object.keys(e)){let r=this._defaults[t];this._notifyChange(t,r,e[t])}}onChange(e,t){let r=e;if(!this._changeHandlers.has(r))this._changeHandlers.set(r,new Set);return this._changeHandlers.get(r).add(t),()=>{this._changeHandlers.get(r)?.delete(t)}}onAnyChange(e){return this._anyChangeHandlers.add(e),()=>{this._anyChangeHandlers.delete(e)}}close(){if(this._watcher)this._watcher.close(),this._watcher=null;if(this._writeTimer)clearTimeout(this._writeTimer),this._writeTimer=null,this._save()}_load(){try{if(pe(this._path)){let e=Wt(this._path,"utf-8");return JSON.parse(e)}}catch{}return{}}_save(){this._writing=!0;try{let e=JSON.stringify({...this._defaults,...this._data},null,2);Ht(this._path,e,"utf-8")}catch(e){console.error(`Failed to save preferences to ${this._path}:`,e)}finally{setTimeout(()=>{this._writing=!1},100)}}_scheduleSave(){if(this._writeTimer)clearTimeout(this._writeTimer);this._writeTimer=setTimeout(()=>{this._writeTimer=null,this._save()},50)}_setupWatcher(){try{if(!pe(this._path))this._save();this._watcher=zt(this._path,()=>{if(this._writing)return;let e=this._load(),t={...this._data};this._data=e;let r=new Set([...Object.keys(t),...Object.keys(e)]);for(let n of r){let o=n in t?t[n]:this._defaults[n],a=n in e?e[n]:this._defaults[n];if(JSON.stringify(o)!==JSON.stringify(a))this._notifyChange(n,a,o)}})}catch{}}_notifyChange(e,t,r){let n=this._changeHandlers.get(e);if(n)for(let o of n)try{o(t,r)}catch{}for(let o of this._anyChangeHandlers)try{o(e,t,r)}catch{}}}function jd(e){return new Fe(e)}import{existsSync as U,mkdirSync as We,readFileSync as Gt,unlinkSync as ze,writeFileSync as He}from"fs";import{homedir as ee,platform as Ue}from"os";import{join as q}from"path";function qe(e){let t=e.toLowerCase().replace(/[^a-z0-9]/g,"-");return q(ee(),"Library","LaunchAgents",`com.${t}.plist`)}function Ve(e){let t=process.env.XDG_CONFIG_HOME||q(ee(),".config");return q(t,"autostart",`${e.toLowerCase()}.desktop`)}async function Yt(e,t){let r=t.appName||"StxApp",n=qe(r),o=q(ee(),"Library","LaunchAgents");if(e){let a=t.appPath||process.execPath,s=t.args||[],c=[a,...s],l=`<?xml version="1.0" encoding="UTF-8"?>
|
|
897
|
+
`}import{accessSync as Mt,closeSync as Dt,constants as Bt,openSync as Ot,readSync as Rt,realpathSync as Lt}from"fs";import{resolveCraftBinary as _t}from"craft-native";import{macOSRuntimeExecutablePath as wd,pack as xd,packageApp as Sd}from"craft-native";import{craftBinaryNotFoundMessage as kd,resolveCraftBinary as _d}from"craft-native";function Hr(e,t="full"){let r=_t(e,t),n=r;if(r==="craft"||r==="craft-webview"){let d=Bun.spawnSync(["pantry","which",r,"--resolve"]);if(d.exitCode!==0){let p=`${d.stderr}${d.stdout}`.trim();throw Error(`Cannot locate Craft's native executable. Install Craft through Pantry and use Pantry 0.11.114 or newer.${p?` ${p}`:""}`)}n=d.stdout.toString().trim()}let o=Lt(n);Mt(o,Bt.X_OK);let a=Ot(o,"r"),s=Buffer.alloc(4);try{Rt(a,s,0,s.length,0)}finally{Dt(a)}let c=s.readUInt32BE(0);if(!(process.platform==="darwin"?[4277009102,3472551422,4277009103,3489328638,3405691582,3199925962,3405691583,3216703178].includes(c):process.platform==="win32"?s[0]===77&&s[1]===90:c===2135247942))throw Error(`Craft packaging requires a native executable, received: ${o}`);return o}import V from"process";import{spawn as Nt}from"child_process";import{AutoUpdater as ma,canReplaceBundle as Cd,clearQuarantine as Ed,extractBundle as Td,generateUpdateManifest as ha,readBundleIdentity as ao,swapBundle as $d,verifyBundleTrust as Rd}from"craft-native";var ya="update.json";function ba(e,t){return`https://github.com/${e}/releases/latest/download/${t}`}function va(e,t,r){return`https://github.com/${e}/releases/download/${t}/${r}`}function wa(e){let{repository:t,manifestAsset:r=ya,...n}=e;return new ma({...n,updateUrl:ba(t,r)})}function Ad(e){let t=e.tag??`v${e.version}`,r={};for(let[n,o]of Object.entries(e.artifacts)){if(!o)continue;r[n]={path:o,url:va(e.repository,t,o.split("/").pop())}}return ha({version:e.version,releaseNotes:e.releaseNotes,platforms:r})}function Vr(e=V.execPath){let t=e.split("/");for(let r=0;r<t.length;r++)if(t[r].endsWith(".app"))return t.slice(0,r+1).join("/");return null}async function Pd(){let e=Vr();if(!e)return null;return(await ao(e)).teamId}function xa(){let e=V.ppid;if(e>1)try{V.kill(e,"SIGTERM");return}catch{}V.exit(0)}function Sa(e={}){let t=e.appPath??Vr(),r=e.quit??(()=>V.exit(0));if(t)Nt("/usr/bin/open",["-n",t],{detached:!0,stdio:"ignore"}).unref();let n=e.quitDelayMs??0;if(n>0){setTimeout(r,n).unref?.();return}r()}async function Id(e){let{appPath:t,requireSameTeam:r=!0,macos:n,...o}=e,a=t??Vr();if(!a)throw Error("createSelfUpdater: this process is not running from an .app bundle, so there is nothing to update. Pass `appPath` explicitly, or skip the updater in development.");let s=n?.teamId??(r?(await ao(a)).teamId??void 0:void 0);return wa({...o,appPath:a,macos:{...n,teamId:s},relaunch:e.relaunch??((c)=>Sa({appPath:c,quit:xa,quitDelayMs:250}))})}function _e(e){if(typeof process>"u"||process.platform!=="darwin")throw Error("Caffeinate requires macOS");let{dlopen:t,ptr:r}=f("bun:ffi"),n=t("/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation",{CFStringCreateWithCString:{args:["ptr","ptr","u32"],returns:"ptr"},CFRelease:{args:["ptr"],returns:"void"}}),o=t("/System/Library/Frameworks/IOKit.framework/IOKit",{IOPMAssertionCreateWithName:{args:["ptr","u32","ptr","ptr"],returns:"i32"},IOPMAssertionRelease:{args:["u32"],returns:"i32"},IOPMAssertionDeclareUserActivity:{args:["ptr","u32","ptr"],returns:"i32"}}),a=[],s=!1;function c(){if(s)return;s=!0;for(let d of a)o.symbols.IOPMAssertionRelease(d);o.close(),n.close()}function l(d){let p=Buffer.from(`${d}\x00`),m=n.symbols.CFStringCreateWithCString(null,r(p),134217984);if(!m)throw Error("Could not create power assertion name");return m}try{let d=[[e.preventDisplaySleep??!0,"PreventUserIdleDisplaySleep"],[e.preventIdleSleep??!0,"PreventUserIdleSystemSleep"],[e.preventSystemSleep??!0,"PreventSystemSleep"],[e.preventDiskSleep??!1,"PreventDiskIdle"]];for(let[p,m]of d){if(!p)continue;let u=l(e.reason||"stx: keeping your Mac awake"),w=l(m),b=new Uint32Array(1);try{let S=o.symbols.IOPMAssertionCreateWithName(w,255,u,r(b));if(S!==0)throw Error(`Could not acquire ${m} (${S})`);a.push(b[0])}finally{n.symbols.CFRelease(u),n.symbols.CFRelease(w)}}if(!a.length)throw Error("At least one sleep prevention option must be enabled");if(e.assertUserActivity??!0){let p=l("stx: user activity"),m=new Uint32Array(1);try{let u=o.symbols.IOPMAssertionDeclareUserActivity(p,0,r(m));if(u!==0)throw Error(`Could not declare user activity (${u})`);a.push(m[0])}finally{n.symbols.CFRelease(p)}}return c}catch(d){throw c(),d}}var C=null;class Ne{_release;_startedAt;_endsAt;_options;_expireHandlers=[];_expireTimer=null;_stopped=!1;constructor(e,t){this._release=e,this._options={...t},this._startedAt=new Date;let r=t.duration;if(r&&r>0){let n=r*60*1000;this._endsAt=new Date(this._startedAt.getTime()+n),this._expireTimer=setTimeout(()=>{this.stop();for(let o of this._expireHandlers)try{o()}catch{}},n)}else this._endsAt=null}get pid(){return process.pid}get startedAt(){return this._startedAt}get endsAt(){return this._endsAt}get options(){return{...this._options}}get isActive(){return!this._stopped}get remainingMs(){if(!this._endsAt)return null;let e=this._endsAt.getTime()-Date.now();return Math.max(0,e)}get elapsedMs(){return Date.now()-this._startedAt.getTime()}stop(){if(this._stopped)return;if(this._stopped=!0,this._expireTimer)clearTimeout(this._expireTimer),this._expireTimer=null;this._release()}onExpire(e){this._expireHandlers.push(e)}}function Od(e={}){if(e.duration!==void 0&&e.duration!==-1&&(!Number.isFinite(e.duration)||e.duration<=0))throw RangeError("duration must be positive minutes or -1 for indefinitely");let t=_e(e),r=new Ne(t,e);return co(),C=r,r}function co(e){if(e){if(e.stop(),C===e)C=null;return}if(C)C.stop();C=null}function Nd(){return C!==null&&C.isActive}function Dd(){if(!C||!C.isActive)return{active:!1,instance:null,startedAt:null,endsAt:null,durationMinutes:null};let t=C.options.duration;return{active:!0,instance:C,startedAt:C.startedAt,endsAt:C.endsAt,durationMinutes:t&&t>0?t:-1}}function Md(e){let t=e||C;if(!t||!t.isActive)return"0:00";let r=t.remainingMs;if(r===null)return"\u221E";let n=Math.ceil(r/1000),o=Math.floor(n/3600),a=Math.floor(n%3600/60),s=n%60;if(o>0)return`${o}:${String(a).padStart(2,"0")}:${String(s).padStart(2,"0")}`;return`${a}:${String(s).padStart(2,"0")}`}function Ld(e){if(e<=0||e===-1)return"Indefinitely";if(e<60)return`${e} minutes`;if(e===60)return"1 hour";if(e%60===0)return`${e/60} hours`;let t=Math.floor(e/60),r=e%60;return`${t}h ${r}m`}if(typeof process<"u")process.once("exit",()=>co());import{existsSync as pe,mkdirSync as Ft,readFileSync as Wt,watch as zt,writeFileSync as Ht}from"fs";import{homedir as Ut,platform as qt}from"os";import{dirname as Vt,join as j}from"path";function jt(e){let t=qt(),r=Ut();switch(t){case"darwin":return j(r,"Library","Application Support",e);case"win32":return j(process.env.APPDATA||j(r,"AppData","Roaming"),e);default:return j(r,".config",e)}}class Fe{_defaults;_data;_path;_changeHandlers=new Map;_anyChangeHandlers=new Set;_watcher=null;_writeTimer=null;_writing=!1;constructor(e){this._defaults={...e.defaults};let t=e.path?Vt(e.path):jt(e.name);if(this._path=e.path||j(t,"preferences.json"),!pe(t))Ft(t,{recursive:!0});if(this._data=this._load(),e.watch!==!1)this._setupWatcher()}get path(){return this._path}get(e){if(e in this._data)return this._data[e];return this._defaults[e]}set(e,t){let r=this.get(e);if(JSON.stringify(r)===JSON.stringify(t))return;this._data[e]=t,this._scheduleSave(),this._notifyChange(e,t,r)}getAll(){return{...this._defaults,...this._data}}has(e){return e in this._data}delete(e){if(!(e in this._data))return;let t=this._data[e];delete this._data[e],this._scheduleSave(),this._notifyChange(e,this._defaults[e],t)}reset(){let e={...this._data};this._data={},this._save();for(let t of Object.keys(e)){let r=this._defaults[t];this._notifyChange(t,r,e[t])}}onChange(e,t){let r=e;if(!this._changeHandlers.has(r))this._changeHandlers.set(r,new Set);return this._changeHandlers.get(r).add(t),()=>{this._changeHandlers.get(r)?.delete(t)}}onAnyChange(e){return this._anyChangeHandlers.add(e),()=>{this._anyChangeHandlers.delete(e)}}close(){if(this._watcher)this._watcher.close(),this._watcher=null;if(this._writeTimer)clearTimeout(this._writeTimer),this._writeTimer=null,this._save()}_load(){try{if(pe(this._path)){let e=Wt(this._path,"utf-8");return JSON.parse(e)}}catch{}return{}}_save(){this._writing=!0;try{let e=JSON.stringify({...this._defaults,...this._data},null,2);Ht(this._path,e,"utf-8")}catch(e){console.error(`Failed to save preferences to ${this._path}:`,e)}finally{setTimeout(()=>{this._writing=!1},100)}}_scheduleSave(){if(this._writeTimer)clearTimeout(this._writeTimer);this._writeTimer=setTimeout(()=>{this._writeTimer=null,this._save()},50)}_setupWatcher(){try{if(!pe(this._path))this._save();this._watcher=zt(this._path,()=>{if(this._writing)return;let e=this._load(),t={...this._data};this._data=e;let r=new Set([...Object.keys(t),...Object.keys(e)]);for(let n of r){let o=n in t?t[n]:this._defaults[n],a=n in e?e[n]:this._defaults[n];if(JSON.stringify(o)!==JSON.stringify(a))this._notifyChange(n,a,o)}})}catch{}}_notifyChange(e,t,r){let n=this._changeHandlers.get(e);if(n)for(let o of n)try{o(t,r)}catch{}for(let o of this._anyChangeHandlers)try{o(e,t,r)}catch{}}}function jd(e){return new Fe(e)}import{existsSync as U,mkdirSync as We,readFileSync as Kt,unlinkSync as ze,writeFileSync as He}from"fs";import{homedir as ee,platform as Ue}from"os";import{join as q}from"path";function qe(e){let t=e.toLowerCase().replace(/[^a-z0-9]/g,"-");return q(ee(),"Library","LaunchAgents",`com.${t}.plist`)}function Ve(e){let t=process.env.XDG_CONFIG_HOME||q(ee(),".config");return q(t,"autostart",`${e.toLowerCase()}.desktop`)}async function Yt(e,t){let r=t.appName||"StxApp",n=qe(r),o=q(ee(),"Library","LaunchAgents");if(e){let a=t.appPath||process.execPath,s=t.args||[],c=[a,...s],l=`<?xml version="1.0" encoding="UTF-8"?>
|
|
898
898
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
899
899
|
<plist version="1.0">
|
|
900
900
|
<dict>
|
|
@@ -920,11 +920,11 @@ Terminal=false
|
|
|
920
920
|
StartupNotify=false
|
|
921
921
|
${t.isHidden?`X-GNOME-Autostart-enabled=true
|
|
922
922
|
NoDisplay=true`:""}
|
|
923
|
-
`;if(!U(o))We(o,{recursive:!0});He(n,l,"utf-8")}else if(U(n))ze(n)}async function Jt(e){return U(qe(e))}async function Qt(e){let t=Ve(e);if(!U(t))return!1;try{let r=
|
|
923
|
+
`;if(!U(o))We(o,{recursive:!0});He(n,l,"utf-8")}else if(U(n))ze(n)}async function Jt(e){return U(qe(e))}async function Qt(e){let t=Ve(e);if(!U(t))return!1;try{let r=Kt(t,"utf-8");if(r.includes("X-GNOME-Autostart-enabled=false"))return!1;if(r.includes("Hidden=true"))return!1;return!0}catch{return!1}}function Zt(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}async function Bd(e,t={}){let r=Ue();switch(r){case"darwin":return Yt(e,t);case"linux":return Xt(e,t);default:throw Error(`Auto-launch is not yet supported on ${r}`)}}async function Fd(e){let t=e||"StxApp";switch(Ue()){case"darwin":return Jt(t);case"linux":return Qt(t);default:return!1}}var R=new Map,er=0,te=!1;function ka(e){let t=e.split("+").map((n)=>n.trim()),r={key:"",meta:!1,ctrl:!1,shift:!1,alt:!1};for(let n of t){let o=n.toLowerCase();switch(o){case"cmd":case"command":case"meta":case"\u2318":r.meta=!0;break;case"ctrl":case"control":case"\u2303":r.ctrl=!0;break;case"shift":case"\u21E7":r.shift=!0;break;case"alt":case"option":case"opt":case"\u2325":r.alt=!0;break;case"cmdorctrl":case"commandorcontrol":if(typeof process<"u"&&process.platform==="darwin")r.meta=!0;else r.ctrl=!0;break;default:r.key=o}}return r}function zd(e){let t=[];if(e.ctrl)t.push("\u2303");if(e.alt)t.push("\u2325");if(e.shift)t.push("\u21E7");if(e.meta)t.push("\u2318");return t.push(e.key.toUpperCase()),t.join("")}function tr(e,t){if(t.meta!==e.metaKey)return!1;if(t.ctrl!==e.ctrlKey)return!1;if(t.shift!==e.shiftKey)return!1;if(t.alt!==e.altKey)return!1;return e.key.toLowerCase()===t.key||e.code.toLowerCase()===`key${t.key}`}function je(e){for(let[,t]of R)if(tr(e,t.parsed)){e.preventDefault(),e.stopPropagation();try{t.handler()}catch{}break}}function rr(){if(te)return;if(typeof document>"u")return;document.addEventListener("keydown",je,!0),te=!0}function fe(){if(!te)return;if(typeof document>"u")return;document.removeEventListener("keydown",je,!0),te=!1}async function nr(e,t){if(typeof window>"u")return!1;let r=window.craft;if(!r?.hotkeys?.register)return!1;try{return await r.hotkeys.register(e,t),!0}catch{return!1}}async function me(e){if(typeof window>"u")return;let t=window.craft;if(!t?.hotkeys?.unregister)return;try{await t.hotkeys.unregister(e)}catch{}}function Hd(e,t){let r=`hotkey_${++er}_${Date.now()}`,n=ka(e);R.set(r,{shortcut:e,handler:t,parsed:n}),nr(r,e),rr();let o={shortcut:e,id:r,unregister(){_a(o)}};return o}function _a(e){if(R.delete(e.id),me(e.id),R.size===0)fe()}function Vd(){for(let[e]of R)me(e);R.clear(),fe()}function Ud(){return Array.from(R.entries()).map(([e,t])=>({shortcut:t.shortcut,id:e,unregister(){if(R.delete(e),me(e),R.size===0)fe()}}))}class Ke{_duration;_tickInterval;_remaining;_running=!1;_paused=!1;_complete=!1;_intervalId=null;_lastTick=0;_completionHandlers=new Set;_tickHandlers=new Set;constructor(e){if(this._duration=e.duration,this._tickInterval=e.tickInterval||1000,this._remaining=e.duration,e.onComplete)this._completionHandlers.add(e.onComplete);if(e.onTick)this._tickHandlers.add(e.onTick);if(e.autoStart)this.start()}get isRunning(){return this._running&&!this._paused}get isPaused(){return this._paused}get isComplete(){return this._complete}get remaining(){if(this._running&&!this._paused){let e=Date.now()-this._lastTick;return Math.max(0,this._remaining-e)}return Math.max(0,this._remaining)}get elapsed(){return this._duration-this.remaining}get duration(){return this._duration}get progress(){if(this._duration===0)return 1;return Math.min(1,this.elapsed/this._duration)}start(){if(this._running)return;this._running=!0,this._paused=!1,this._complete=!1,this._lastTick=Date.now(),this._startInterval()}stop(){this._clearInterval(),this._running=!1,this._paused=!1,this._remaining=this._duration}pause(){if(!this._running||this._paused)return;let e=Date.now()-this._lastTick;this._remaining=Math.max(0,this._remaining-e),this._clearInterval(),this._paused=!0}resume(){if(!this._paused)return;this._paused=!1,this._lastTick=Date.now(),this._startInterval()}reset(){this._clearInterval(),this._running=!1,this._paused=!1,this._complete=!1,this._remaining=this._duration}onComplete(e){return this._completionHandlers.add(e),()=>{this._completionHandlers.delete(e)}}onTick(e){return this._tickHandlers.add(e),()=>{this._tickHandlers.delete(e)}}_startInterval(){this._clearInterval(),this._intervalId=setInterval(()=>{let e=Date.now(),t=e-this._lastTick;this._lastTick=e,this._remaining=Math.max(0,this._remaining-t);for(let r of this._tickHandlers)try{r(this._remaining)}catch{}if(this._remaining<=0){this._clearInterval(),this._running=!1,this._complete=!0;for(let r of this._completionHandlers)try{r()}catch{}}},this._tickInterval)}_clearInterval(){if(this._intervalId!==null)clearInterval(this._intervalId),this._intervalId=null}}class Ge{_interval;_handler;_immediate;_running=!1;_intervalId=null;constructor(e){if(this._interval=e.interval,this._handler=e.handler,this._immediate=e.immediate!==!1,this._immediate)this.start()}get isRunning(){return this._running}start(){if(this._running)return;this._running=!0,this._intervalId=setInterval(()=>{try{this._handler()}catch{}},this._interval)}stop(){if(this._intervalId!==null)clearInterval(this._intervalId),this._intervalId=null;this._running=!1}}function Wd(e){return new Ke(e)}function qd(e){return new Ge(e)}function Gd(e){return new Promise((t)=>setTimeout(t,e))}function Kd(e){let t=Math.ceil(e/1000),r=Math.floor(t/3600),n=Math.floor(t%3600/60),o=t%60;if(r>0)return`${r}:${String(n).padStart(2,"0")}:${String(o).padStart(2,"0")}`;return`${n}:${String(o).padStart(2,"0")}`}function Xd(e){let t=Math.ceil(e/1000),r=Math.floor(t/3600),n=Math.floor(t%3600/60),o=t%60;if(r>0){if(n>0)return`${r}h ${n}m`;return`${r}h`}if(n>0){if(o>0)return`${n}m ${o}s`;return`${n}m`}return`${o}s`}function i(e){if(typeof window>"u")return!1;let t=window.craft;return!!(t&&t[e])}function v(e){if(!i(e))throw Error(`craft.${e} is not available \u2014 this API requires a Craft native window`);return window.craft[e]}function h(e,t){if(typeof window>"u")return()=>{};let r=(n)=>t(n.detail??{});return window.addEventListener(e,r),()=>window.removeEventListener(e,r)}var Jd={async writeText(e){if(i("clipboard")){await window.craft.clipboard.writeText(e);return}if(typeof navigator<"u"&&navigator.clipboard)await navigator.clipboard.writeText(e)},async readText(){if(i("clipboard")){let e=await window.craft.clipboard.readText();return typeof e==="string"?e:""}if(typeof navigator<"u"&&navigator.clipboard?.readText)try{return await navigator.clipboard.readText()}catch{return""}return""},async writeHTML(e){if(i("clipboard")){await window.craft.clipboard.writeHTML(e);return}if(typeof navigator<"u"&&navigator.clipboard?.write)try{let t=new window.ClipboardItem({"text/html":new Blob([e],{type:"text/html"}),"text/plain":new Blob([or(e)],{type:"text/plain"})});await navigator.clipboard.write([t])}catch{}},async readHTML(){if(i("clipboard")){let e=await window.craft.clipboard.readHTML();return typeof e==="string"?e:""}if(typeof navigator<"u"&&navigator.clipboard?.read)try{let e=await navigator.clipboard.read();for(let t of e)if(t.types.includes("text/html"))return await(await t.getType("text/html")).text()}catch{}return""},async clear(){if(i("clipboard")){await window.craft.clipboard.clear();return}if(typeof navigator<"u"&&navigator.clipboard?.writeText)try{await navigator.clipboard.writeText("")}catch{}},async hasText(){if(i("clipboard"))return await window.craft.clipboard.hasText();return(await this.readText()).length>0},async hasHTML(){if(i("clipboard"))return await window.craft.clipboard.hasHTML();return(await this.readHTML()).length>0},async hasImage(){if(i("clipboard"))return await window.craft.clipboard.hasImage();return!1}};function or(e){return e.replace(/<(script|style)[^>]*>[\s\S]*?<\/\1>/gi,"").replace(/<\/?(br|p|div|li|h[1-6])\b[^>]*>/gi,`
|
|
924
924
|
`).replace(/<[^>]+>/g,"").replace(/ /g," ").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/\n{3,}/g,`
|
|
925
925
|
|
|
926
926
|
`).trim()}var Yd={async show(e){if(!e.title)throw Error("notification title is required");if(i("notifications")){await window.craft.notifications.show(e);return}if(typeof window<"u"&&"Notification"in window){let t=window.Notification;if(t.permission==="granted")new t(e.title,{body:e.body,icon:e.icon});else if(t.permission==="default"){if(await t.requestPermission()==="granted")new t(e.title,{body:e.body,icon:e.icon})}}},async schedule(e){if(i("notifications")){let n={...e};if(n.triggerAt instanceof Date)n.triggerAt=n.triggerAt.toISOString();await window.craft.notifications.schedule(n);return}let t=ir(e.triggerAt),r=Math.max(0,t-Date.now());setTimeout(()=>{this.show(e).catch(()=>{})},r)},async cancel(e){if(i("notifications"))await window.craft.notifications.cancel(e)},async cancelAll(){if(i("notifications"))await window.craft.notifications.cancelAll()},async setBadge(e){let t=Math.max(0,Math.round(Number.isFinite(e)?e:0));if(i("notifications")){await window.craft.notifications.setBadge(t);return}if(typeof navigator<"u"&&navigator.setAppBadge)try{await navigator.setAppBadge(t)}catch{}},async clearBadge(){if(i("notifications")){await window.craft.notifications.clearBadge();return}if(typeof navigator<"u"&&navigator.clearAppBadge)try{await navigator.clearAppBadge()}catch{}},async requestPermission(){if(i("notifications"))return await window.craft.notifications.requestPermission();if(typeof window<"u"&&"Notification"in window){let e=window.Notification;if(e.permission==="granted")return!0;if(e.permission==="denied")return!1;return await e.requestPermission()==="granted"}return!1},async registerCategories(e){if(!Array.isArray(e)||e.length===0)return;if(i("notifications")){let t=window.craft.notifications.registerCategories;if(typeof t==="function")await t(e)}},onActionClicked(e){return h("craft:notification:actionClicked",e)},onReply(e){return h("craft:notification:reply",e)}};function ir(e){if(e==null)return Date.now();if(e instanceof Date)return e.getTime();if(typeof e==="number")return e;let t=Date.parse(e);return Number.isNaN(t)?Date.now():t}var Zd={async readFile(e){let t=await v("fs").readFile(e);return t&&t.data||""},async readBuffer(e){let t=await v("fs").readFile(e),r=t&&t.data||"";if(t&&t.base64===!0)return sr(r);return new TextEncoder().encode(r)},async writeFile(e,t){await v("fs").writeFile(e,t)},async writeBuffer(e,t){let r=ar(t),n=v("fs");if(typeof n.writeFileBytes==="function")await n.writeFileBytes(e,r);else await n.writeFile(e,r)},async copy(e,t){if(e===t)throw Error("fs.copy: source and destination must differ");await v("fs").copy(e,t)},async move(e,t){if(e===t)throw Error("fs.move: source and destination must differ");await v("fs").move(e,t)},async appendFile(e,t){await v("fs").appendFile(e,t)},async deleteFile(e){await v("fs").deleteFile(e)},async exists(e){return await v("fs").exists(e)},async stat(e){return cr(await v("fs").stat(e))},async readDir(e){let t=await v("fs").readDir(e),r=t&&t.entries||[],n=e.endsWith("/")?e.slice(0,-1):e;return r.map((o)=>({name:o.name,path:`${n}/${o.name}`,isDirectory:!!o.isDirectory}))},async mkdir(e,t){await v("fs").mkdir(e,t)},async rmdir(e,t){await v("fs").rmdir(e,t)},async watch(e,t){await v("fs").watch(e,t)},async unwatch(e){await v("fs").unwatch(e)},onChange(e){return h("craft:fs:change",e)},async watchTree(e,t,r){let n=`watch-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,o=v("fs");await o.watch(e,n,{recursive:!!t.recursive});let a=t.kinds&&t.kinds.length>0?new Set(t.kinds):null,s=Math.max(0,Math.floor(t.coalesceMs??0)),c=[],l=null,d=!1,p=()=>{if(l=null,c.length===0)return;let u=c;c=[];try{r(u)}catch{}},m=h("craft:fs:change",(u)=>{if(d)return;if(u.id!==n)return;if(a&&u.kind&&!a.has(u.kind))return;if(c.push(u),s===0){p();return}if(l==null)l=setTimeout(p,s)});return{id:n,async stop(){if(d)return;if(d=!0,m(),l)clearTimeout(l),l=null;if(c.length>0)p();try{await o.unwatch(n)}catch{}}}},async homeDir(){return await v("fs").homeDir()},async tempDir(){return await v("fs").tempDir()},async appDataDir(){return await v("fs").appDataDir()}};function ar(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return typeof btoa==="function"?btoa(t):Buffer.from(e).toString("base64")}function sr(e){let t=typeof atob==="function"?atob(e):Buffer.from(e,"base64").toString("binary"),r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}function cr(e){return{isFile:!!e.isFile,isDirectory:!!e.isDirectory,isSymlink:!!e.isSymlink,size:Number(e.size)||0,modifiedAt:e.modifiedAt!=null?e.modifiedAt<1000000000000?e.modifiedAt*1000:e.modifiedAt:0}}var K=new Set,Ye=!1;function lr(){if(Ye)return;if(typeof window>"u"||typeof window.addEventListener!=="function")return;window.addEventListener("craft:shell:exit",(e)=>{let t=e.detail;if(t?.id)K.delete(t.id)}),Ye=!0}var dr=new Set(["javascript:","data:","file:","vbscript:"]),Qd={async openExternal(e){let t=e.trim().toLowerCase();for(let r of dr)if(t.startsWith(r))throw Error(`shell.openExternal: ${r} URLs are blocked for safety`);if(i("shell")){await window.craft.shell.openExternal(e);return}if(typeof window<"u"&&typeof window.open==="function")window.open(e,"_blank","noopener,noreferrer")},async openPath(e){await v("shell").openPath(e)},async showInFinder(e){await v("shell").showInFinder(e)},async spawn(e,t,r=[],n={}){if(lr(),!e||typeof e!=="string")throw Error("shell.spawn: id must be a non-empty string");if(!t||typeof t!=="string")throw Error("shell.spawn: command must be a non-empty string");if(!Array.isArray(r))throw Error("shell.spawn: args must be an array");for(let o of r)if(typeof o!=="string")throw Error("shell.spawn: args entries must be strings");if(K.has(e))throw Error(`shell.spawn: id "${e}" is already in use \u2014 call kill(id) first or pick a different id`);K.add(e);try{await v("shell").spawn(e,t,r,n)}catch(o){throw K.delete(e),o}},async kill(e){await v("shell").kill(e),K.delete(e)},async getEnv(e){if(i("shell")){let t=await window.craft.shell.getEnv(e);return t==null?void 0:String(t)}return},async setEnv(e,t){await v("shell").setEnv(e,t)},onStdout(e){return h("craft:shell:stdout",e)},onStderr(e){return h("craft:shell:stderr",e)},onExit(e){return h("craft:shell:exit",e)}};function W(){return window.craft.shortcuts}var ep={async register(e,t,r){if(!i("shortcuts"))return;await W().register(e,t,r)},async unregister(e){if(!i("shortcuts"))return;await W().unregister(e)},async unregisterAll(){if(!i("shortcuts"))return;await W().unregisterAll()},async enable(e){if(!i("shortcuts"))return;await W().enable(e)},async disable(e){if(!i("shortcuts"))return;await W().disable(e)},async isRegistered(e){if(!i("shortcuts"))return!1;return await W().isRegistered(e)},async list(){if(!i("shortcuts"))return[];return await W().list()},on(e){return h("craft:shortcut",e)}};var tp={get(){if(i("theme"))try{return window.craft.theme.get()}catch{}return{appearance:ur()}},onChange(e){if(e(this.get()),i("theme"))return h("craft:theme",e);if(typeof window<"u"&&window.matchMedia){let t=window.matchMedia("(prefers-color-scheme: dark)"),r=()=>e({appearance:t.matches?"dark":"light"});return t.addEventListener("change",r),()=>t.removeEventListener("change",r)}return()=>{}},async current(){return this.get()}};function ur(){if(typeof window>"u"||!window.matchMedia)return"light";return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}async function np(e,t={}){if(!i("dragOut"))throw Error("dragOut requires a Craft native window");let r=Array.isArray(e)?e:[e];if(r.length===0)throw Error("dragOut: at least one path required");await window.craft.dragOut.start(r,t)}function rp(){return i("dragOut")}var sp={onUrl(e){if(!i("deepLink"))return()=>{};return h("craft:deepLink",e)},getInitialUrl(){if(typeof window>"u")return null;if(i("deepLink"))try{return window.craft.deepLink.getInitialUrl()}catch{return null}return window.__craftPendingDeepLink||null},consumeInitialUrl(){let e=this.getInitialUrl();if(typeof window<"u")window.__craftPendingDeepLink=void 0;return e},isAvailable(){return i("deepLink")}};var op={async isCharging(){if(i("power"))return await window.craft.power.isCharging();let e=await re();return e?!!e.charging:!1},async isPluggedIn(){if(i("power"))return await window.craft.power.isPluggedIn();let e=await re();return e?!!e.charging||e.level>=0.999:!1},async isLowPowerMode(){if(i("power"))return await window.craft.power.isLowPowerMode();return!1},async level(){if(i("power")){let t=await window.craft.power.batteryLevel();return typeof t==="number"?t:null}let e=await re();return e?e.level:null},async timeRemaining(){if(i("power")){let r=await window.craft.power.timeRemaining();return typeof r==="number"?r:null}let e=await re();if(!e)return null;let t=e.charging?e.chargingTime:e.dischargingTime;return Number.isFinite(t)?Math.round(t/60):null},async thermalState(){if(i("power"))return await window.craft.power.thermalState()||"unknown";return"unknown"},async uptimeSeconds(){if(i("power"))return await window.craft.power.uptimeSeconds();if(typeof performance<"u"&&typeof performance.now==="function")return Math.round(performance.now()/1000);return 0},async preventSleep(e="app is busy"){if(i("power")){await window.craft.power.preventSleep(e);return}if(typeof navigator>"u"||!navigator.wakeLock)return;let t=window;if(t.__craftWebWakeLock?.release){try{await t.__craftWebWakeLock.release()}catch{}t.__craftWebWakeLock=null}try{let r=await navigator.wakeLock.request("screen");t.__craftWebWakeLock=r}catch{}},async allowSleep(){if(i("power")){await window.craft.power.allowSleep();return}let e=window.__craftWebWakeLock;if(e&&typeof e.release==="function"){try{await e.release()}catch{}window.__craftWebWakeLock=null}},onSleep(e){return h("craft:powerSleep",e)},onWake(e){return h("craft:powerWake",e)}};async function re(){if(typeof navigator>"u")return null;let e=navigator;if(typeof e.getBattery!=="function")return null;try{return await e.getBattery()}catch{return null}}var ip={async connectionType(){if(i("network"))return await window.craft.network.connectionType();return Xe()},async wifiSSID(){if(i("network"))return await window.craft.network.wifiSSID()||void 0;return},async wifiSignalStrength(){if(i("network")){let e=await window.craft.network.wifiSignalStrength();return typeof e==="number"?e:void 0}return},async ipAddress(){if(i("network"))return await window.craft.network.ipAddress();return""},async macAddress(){if(i("network"))return await window.craft.network.macAddress();return""},async interfaces(){if(i("network"))return await window.craft.network.interfaces();return[]},async isVPNConnected(){if(i("network"))return await window.craft.network.isVPNConnected();return!1},async proxySettings(){if(i("network"))return await window.craft.network.proxySettings()||{};return{}},async openPreferences(){if(i("network"))await window.craft.network.openPreferences()},onChange(e){if(i("network"))return h("craft:networkChange",e);if(typeof window>"u")return()=>{};let t=()=>e({type:Xe(),online:!0}),r=()=>e({type:"none",online:!1});return window.addEventListener("online",t),window.addEventListener("offline",r),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}};function Xe(){if(typeof navigator>"u")return"unknown";if(navigator.onLine===!1)return"none";let e=navigator.connection;if(!e)return"unknown";let t=String(e.type||e.effectiveType||"unknown").toLowerCase();if(t==="wifi"||t==="cellular"||t==="ethernet"||t==="bluetooth"||t==="none")return t;return"unknown"}var ap={async checkForUpdates(){if(!i("updater"))return;await window.craft.updater.checkForUpdates()},async checkInBackground(){if(!i("updater"))return;await window.craft.updater.checkInBackground()},async setAutomaticChecks(e){if(!i("updater"))return;await window.craft.updater.setAutomaticChecks(e)},async setCheckInterval(e){if(!i("updater"))return;if(!Number.isFinite(e))throw Error("setCheckInterval: must be a finite number");let t=e<=0?0:Math.max(60,Math.round(e));await window.craft.updater.setCheckInterval(t)},async setFeedURL(e){if(!i("updater"))return;await window.craft.updater.setFeedURL(e)},async getLastUpdateCheckDate(){if(!i("updater"))return null;return await window.craft.updater.getLastUpdateCheckDate()||null},async getUpdateInfo(){if(!i("updater"))return null;let e=await window.craft.updater.getUpdateInfo();if(!e||typeof e.version!=="string"||e.version.length===0)return null;return e},onAvailable(e){return h("craft:updateAvailable",e)},onDownloaded(e){return h("craft:updateDownloaded",e)},async verifySignature({payload:e,signatureB64:t,publicKeyB64:r}){let n=Je(e),o;try{o=await crypto.subtle.importKey("raw",ne(r),{name:"Ed25519"},!1,["verify"])}catch{return!1}try{return await crypto.subtle.verify("Ed25519",o,ne(t),n)}catch{return!1}},async verifyDownload({url:e,signatureB64:t,publicKeyB64:r,fetchInit:n}){let o;try{o=await fetch(e,n)}catch{return{ok:!1,reason:"fetch-failed"}}if(!o.ok)return{ok:!1,reason:"http-error",status:o.status};let a=new Uint8Array(await o.arrayBuffer()),s;try{s=await crypto.subtle.importKey("raw",ne(r),{name:"Ed25519"},!1,["verify"])}catch{return{ok:!1,reason:"bad-key"}}let c=!1;try{c=await crypto.subtle.verify("Ed25519",s,ne(t),Je(a))}catch{c=!1}if(!c)return{ok:!1,reason:"bad-signature"};return{ok:!0,payload:a}}};function Je(e){if(e instanceof ArrayBuffer)return new Uint8Array(e);let t=new ArrayBuffer(e.byteLength),r=new Uint8Array(t);return r.set(e),r}function ne(e){if(typeof atob==="function"){let n=atob(e),o=new ArrayBuffer(n.length),a=new Uint8Array(o);for(let s=0;s<n.length;s++)a[s]=n.charCodeAt(s);return a}let t=Buffer.from(e,"base64"),r=new ArrayBuffer(t.length);return new Uint8Array(r).set(t),new Uint8Array(r)}var cp={onFocus(e){if(i("window"))return h("craft:window:focus",()=>e());return ge("focus",e)},onBlur(e){if(i("window"))return h("craft:window:blur",()=>e());return ge("blur",e)},onResize(e){if(i("window"))return h("craft:window:resize",e);if(typeof window>"u")return()=>{};let t=()=>e({width:window.innerWidth,height:window.innerHeight});return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},onMove(e){if(i("window"))return h("craft:window:move",e);return()=>{}},onClose(e){if(i("window"))return h("craft:window:close",()=>e());return ge("beforeunload",e)},onMinimize(e){if(i("window"))return h("craft:window:minimize",()=>e());if(typeof document>"u")return()=>{};let t=()=>{if(document.visibilityState==="hidden")e()};return document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)},onRestore(e){if(i("window"))return h("craft:window:restore",()=>e());if(typeof document>"u")return()=>{};let t=()=>{if(document.visibilityState==="visible")e()};return document.addEventListener("visibilitychange",t),()=>document.removeEventListener("visibilitychange",t)}};function ge(e,t){if(typeof window>"u")return()=>{};let r=()=>t();return window.addEventListener(e,r),()=>window.removeEventListener(e,r)}var Qe={name:"",version:"0.0.0"},lp={async hideDockIcon(){if(i("app"))await window.craft.app.hideDockIcon()},async showDockIcon(){if(i("app"))await window.craft.app.showDockIcon()},async quit(){if(i("app"))await window.craft.app.quit()},async getInfo(){if(!i("app"))return Qe;let e=await window.craft.app.getInfo();return{...Qe,...e||{}}},async notify(e){if(!e.title)throw Error("notify: title is required");if(i("app"))await window.craft.app.notify(e)},async setBadge(e){if(i("app"))await window.craft.app.setBadge(e)},async bounce(e="informational"){if(i("app"))await window.craft.app.bounce(e)}};var up={app(e,t={}){return{label:e,items:[{label:`About ${e}`,role:"about"},{separator:!0},...t.settings?[{id:"stx.menu.settings",label:"Settings\u2026",shortcut:"cmd+,",onClick:t.settings},{separator:!0}]:[],{label:`Hide ${e}`,role:"hide",shortcut:"cmd+h"},{label:"Hide Others",role:"hideOthers",shortcut:"cmd+alt+h"},{label:"Show All",role:"showAll"},{separator:!0},{label:`Quit ${e}`,role:"quit",shortcut:"cmd+q"}]}},edit(){return{label:"Edit",items:[{label:"Undo",role:"undo",shortcut:"cmd+z"},{label:"Redo",role:"redo",shortcut:"cmd+shift+z"},{separator:!0},{label:"Cut",role:"cut",shortcut:"cmd+x"},{label:"Copy",role:"copy",shortcut:"cmd+c"},{label:"Paste",role:"paste",shortcut:"cmd+v"},{label:"Select All",role:"selectAll",shortcut:"cmd+a"}]}},window(){return{label:"Window",items:[{label:"Minimize",role:"minimize",shortcut:"cmd+m"},{label:"Zoom",role:"zoom"},{separator:!0},{label:"Close Window",role:"close",shortcut:"cmd+w"}]}},leading(e,t={}){return[this.app(e,t),this.edit()]}},pr=0;function fr(e){let t=new Map;return{payload:{menus:e.menus.map((n)=>({label:n.label,items:n.items.map((o)=>{let{onClick:a,...s}=o;if(s.separator)return s;let c=s.id??`stx.menu.${pr++}`;if(a)t.set(c,a);return{...s,id:c}})}))},handlers:t}}var he=null,dp={async set(e){if(!i("menu"))return!1;let{payload:t,handlers:r}=fr(e);if(he?.(),he=null,r.size>0)he=h("craft:menu:action",(n)=>{r.get(n.id)?.()});return await window.craft.menu.set(t),!0},async setDock(e){if(i("menu"))await window.craft.menu.setDock(e)},async addItem(e,t){if(i("menu"))await window.craft.menu.addItem(e,t)},async removeItem(e){if(i("menu"))await window.craft.menu.removeItem(e)},async enableItem(e){if(i("menu"))await window.craft.menu.enableItem(e)},async disableItem(e){if(i("menu"))await window.craft.menu.disableItem(e)},async checkItem(e){if(i("menu"))await window.craft.menu.checkItem(e)},async uncheckItem(e){if(i("menu"))await window.craft.menu.uncheckItem(e)},async setItemLabel(e,t){if(i("menu"))await window.craft.menu.setItemLabel(e,t)},async clearDock(){if(i("menu"))await window.craft.menu.clearDock()},onAction(e){return h("craft:menu:action",e)}};function et(e){if(e.separator)return{id:e.id||"",title:"",type:"separator"};return{id:e.id||"",title:e.title||"",icon:e.icon,shortcut:e.shortcut,enabled:e.disabled?!1:void 0,checked:e.checked?!0:void 0,type:e.submenu?"submenu":void 0,submenu:e.submenu?.map(et)}}async function Ze(e){if(!e.items||e.items.length===0)throw Error("contextMenu.show requires at least one item");if(!i("nativeUI"))return null;let t=window.craft?.nativeUI;if(!t)return null;let r=await t.showContextMenu({targetId:e.targetId||"",targetType:"general",x:Math.round(e.x),y:Math.round(e.y),items:e.items.map(et)});return{id:typeof r?.id==="string"?r.id:null,targetId:r?.targetId}}var pp={available(){return i("nativeUI")},async show(e){return await Ze(e)!==null},async pick(e){return(await Ze(e))?.id??null},onAction(e){return h("craft:contextmenu:action",(t)=>{if(typeof t.id==="string")e({id:t.id,targetId:t.targetId??""})})}};function we(e){if(e===null||e===void 0||e===0)return"";return String(e)}function tt(e){return e.map((t)=>({id:t.id,header:t.header,items:t.items.map((r)=>({id:r.id,label:r.label,icon:r.icon,badge:we(r.badge)||void 0}))}))}function rt(e){return JSON.stringify(e.map((t)=>[t.id,t.header??"",t.items.map((r)=>[r.id,r.label,r.icon??""])]))}function nt(e){return new Map(e.flatMap((t)=>t.items.map((r)=>[r.id,we(r.badge)])))}var Ca={available(){return i("nativeUI")&&typeof window.craft?.nativeUI?._emitSidebarSelect==="function"},create(e){if(!Ca.available())return null;let t=window.craft?.nativeUI;if(!t)return null;let r=t.createSidebar({id:e.id,sections:tt(e.sections),selected:e.selected}),n=e.sections,o=new Set;return r.onSelect((a)=>{for(let s of[...o])s(a)}),{id:r.id,update(a){if(rt(a)===rt(n)){let s=nt(n);for(let[c,l]of nt(a))if(s.get(c)!==l)r.updateItem(c,{badge:l})}else r.setSections(tt(a));n=a},updateItem(a,s){r.updateItem(a,{...s.label!==void 0?{label:s.label}:{},...s.icon!==void 0?{icon:s.icon}:{},..."badge"in s?{badge:we(s.badge)}:{}}),n=n.map((c)=>({...c,items:c.items.map((l)=>l.id===a?{...l,...s}:l)}))},select(a){r.setSelectedItem(a)},onSelect(a){return o.add(a),()=>o.delete(a)},destroy(){o.clear(),r.destroy()}}}};var fp={accentColor:()=>E("system","accentColor",()=>""),highlightColor:()=>E("system","highlightColor",()=>""),language:()=>E("system","language",()=>{if(typeof navigator>"u")return"";return navigator.language?.split("-")[0]||""}),locale:()=>E("system","locale",()=>{if(typeof navigator>"u")return"";return navigator.language||""}),timezone:()=>E("system","timezone",()=>{try{return Intl.DateTimeFormat().resolvedOptions().timeZone||""}catch{return""}}),is24HourTime:()=>E("system","is24HourTime",()=>{try{let e=new Intl.DateTimeFormat([],{hour:"numeric"}).resolvedOptions();return e.hourCycle==="h23"||e.hourCycle==="h24"}catch{return!1}}),reduceMotion:()=>E("system","reduceMotion",()=>be("(prefers-reduced-motion: reduce)")),reduceTransparency:()=>E("system","reduceTransparency",()=>be("(prefers-reduced-transparency: reduce)")),increaseContrast:()=>E("system","increaseContrast",()=>be("(prefers-contrast: more)")),systemVersion:()=>E("system","systemVersion",()=>""),hostname:()=>E("system","hostname",()=>""),username:()=>E("system","username",()=>""),async openPreferences(){if(i("system"))await window.craft.system.openPreferences()}};async function E(e,t,r){if(i(e))return await window.craft[e][t]();return await r()}function be(e){if(typeof window>"u"||!window.matchMedia)return!1;return window.matchMedia(e).matches}var gp={async getDisplays(){if(i("screen"))return await window.craft.screen.getDisplays();return ot()},async getPrimary(){if(i("screen")){let e=await window.craft.screen.getPrimary();return e&&typeof e.width==="number"?e:null}return ot()[0]??null},onChange(e){if(i("screen"))return h("craft:screen:change",()=>e());if(typeof window>"u")return()=>{};let t=()=>e();return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)}};function ot(){if(typeof window>"u"||!window.screen)return[];let e=window.screen;return[{id:0,x:e.left??0,y:e.top??0,width:e.width||0,height:e.height||0,workX:e.availLeft??0,workY:e.availTop??0,workWidth:e.availWidth??e.width??0,workHeight:e.availHeight??e.height??0,scaleFactor:window.devicePixelRatio||1}]}var mp={async set(e,t,r){if(!e)throw Error("keychain.set: service is required");if(!t)throw Error("keychain.set: account is required");await v("keychain").set(e,t,r)},async get(e,t){if(!e)throw Error("keychain.get: service is required");if(!t)throw Error("keychain.get: account is required");let r=await v("keychain").get(e,t);return typeof r==="string"?r:null},async delete(e,t){if(!e)throw Error("keychain.delete: service is required");if(!t)throw Error("keychain.delete: account is required");await v("keychain").delete(e,t)},async has(e,t){if(!e)throw Error("keychain.has: service is required");if(!t)throw Error("keychain.has: account is required");return await v("keychain").has(e,t)}};var hp={async check(e){if(i("permissions"))return await window.craft.permissions.check(e);return await it(e)},async request(e){if(i("permissions"))return await window.craft.permissions.request(e);return await mr(e)},async openSettings(e){if(i("permissions"))await window.craft.permissions.openSettings(e)}};async function it(e){if(typeof navigator>"u"||!navigator.permissions?.query)return"not-supported";try{let t=await navigator.permissions.query({name:e});return gr(t.state)}catch{return"not-supported"}}async function mr(e){if(e==="notifications"&&typeof window<"u"&&"Notification"in window){let t=await window.Notification.requestPermission();return t==="granted"?"granted":t==="denied"?"denied":"undetermined"}return await it(e)}function gr(e){if(e==="granted")return"granted";if(e==="denied")return"denied";if(e==="prompt")return"undetermined";return"undetermined"}var yp={async print(){if(i("printing")){await window.craft.printing.print();return}if(typeof window<"u"&&typeof window.print==="function")window.print()},async printToPDF(e){if(!e)throw Error("printToPDF: path is required");let t=e.startsWith("/"),r=/^[a-zA-Z]:[\\/]/.test(e)||e.startsWith("\\\\");if(!t&&!r)throw Error("printToPDF: path must be absolute");let n=await v("printing").printToPDF(e);return{ok:!!(n&&n.ok),path:n?.path}}};var bp={async enable(){if(!i("autoLaunch"))return!1;return await window.craft.autoLaunch.enable()},async disable(){if(!i("autoLaunch"))return!1;return await window.craft.autoLaunch.disable()},async isEnabled(){if(!i("autoLaunch"))return!1;return await window.craft.autoLaunch.isEnabled()}};async function xe(e){if(!i("tray"))return;let t=window.craft.tray;await e(t)}var vp={setIcon:(e)=>xe((t)=>t.setIcon(e)),setTitle:(e)=>xe((t)=>t.setTitle(e)),setTooltip:(e)=>xe((t)=>t.setTooltip(e))};function ye(){if(!i("window"))return null;return window.craft.window}function D(e){let t=ye();if(!t)return Promise.resolve();try{return Promise.resolve(e(t)).then(()=>{return},()=>{return})}catch{return Promise.resolve()}}var wp={get available(){return ye()!==null},open(e){let t=()=>{if(typeof window<"u"&&e.url)window.open(e.url,e.name);return{name:e.name}},r=ye();if(!r?.open)return Promise.resolve(t());return r.open(e).then((n)=>({name:n?.name||e.name})).catch(t)},close:()=>D((e)=>e.close?.()),show:()=>D((e)=>e.show?.()),hide:()=>D((e)=>e.hide?.()),focus:()=>D((e)=>e.focus?.()),minimize:()=>D((e)=>e.minimize?.()),maximize:()=>D((e)=>e.maximize?.()),center:()=>D((e)=>e.center?.()),startDrag:()=>D((e)=>e.startDrag?.()),setTitle:(e)=>D((t)=>t.setTitle?.(e)),setSize:(e,t)=>D((r)=>r.setSize?.(e,t)),setAppearance:(e)=>D((t)=>t.setAppearance?.(e))};var xp={async addItem(e){if(i("touchbar"))await window.craft.touchbar.addItem(e)},async removeItem(e){if(i("touchbar"))await window.craft.touchbar.removeItem(e)},async updateItem(e,t){if(i("touchbar"))await window.craft.touchbar.updateItem(e,t)},async setLabel(e,t){if(i("touchbar"))await window.craft.touchbar.setLabel(e,t)},async setIcon(e,t){if(i("touchbar"))await window.craft.touchbar.setIcon(e,t)},async setEnabled(e,t){if(i("touchbar"))await window.craft.touchbar.setEnabled(e,t)},async setSliderValue(e,t){if(i("touchbar"))await window.craft.touchbar.setSliderValue(e,t)},async clear(){if(i("touchbar"))await window.craft.touchbar.clear()},async show(){if(i("touchbar"))await window.craft.touchbar.show()},async hide(){if(i("touchbar"))await window.craft.touchbar.hide()},onAction(e){return h("craft:touchbar:action",e)}};var hr=/^[\da-f]*$/i;function wr(e,t){if(typeof t!=="string"||!hr.test(t)||t.length%2!==0)throw Error(`${e}: must be a hex string with even length, got ${JSON.stringify(t)}`)}var Sp={async isEnabled(){return i("bluetooth")?await window.craft.bluetooth.isEnabled():!1},async powerState(){return i("bluetooth")?await window.craft.bluetooth.powerState():"unknown"},async connectedDevices(){return i("bluetooth")?await window.craft.bluetooth.connectedDevices():[]},async pairedDevices(){return i("bluetooth")?await window.craft.bluetooth.pairedDevices():[]},async startDiscovery(){if(i("bluetooth"))await window.craft.bluetooth.startDiscovery()},async stopDiscovery(){if(i("bluetooth"))await window.craft.bluetooth.stopDiscovery()},async isDiscovering(){return i("bluetooth")?await window.craft.bluetooth.isDiscovering():!1},async connect(e){if(i("bluetooth"))await window.craft.bluetooth.connect(e)},async disconnect(e){if(i("bluetooth"))await window.craft.bluetooth.disconnect(e)},async openPreferences(){if(i("bluetooth"))await window.craft.bluetooth.openPreferences()},async discoverServices(e){if(!e)throw Error("bluetooth.discoverServices: deviceId is required");if(!i("bluetooth"))return[];let t=await window.craft.bluetooth.discoverServices(e);return Array.isArray(t)?t:[]},async discoverCharacteristics(e,t){if(!e||!t)throw Error("bluetooth.discoverCharacteristics: deviceId and serviceUuid are required");if(!i("bluetooth"))return[];let r=await window.craft.bluetooth.discoverCharacteristics(e,t);return Array.isArray(r)?r:[]},async readCharacteristic(e,t,r){if(!e||!t||!r)throw Error("bluetooth.readCharacteristic: deviceId, serviceUuid, characteristicUuid are required");if(!i("bluetooth"))return{ok:!1,reason:"bridge unavailable"};return await window.craft.bluetooth.readCharacteristic(e,t,r)},async writeCharacteristic(e,t,r,n,o="with-response"){if(!e||!t||!r)throw Error("bluetooth.writeCharacteristic: deviceId, serviceUuid, characteristicUuid are required");if(wr("bluetooth.writeCharacteristic.valueHex",n),!i("bluetooth"))return{ok:!1,reason:"bridge unavailable"};return await window.craft.bluetooth.writeCharacteristic(e,t,r,n,o)},async setCharacteristicNotify(e,t,r,n){if(!e||!t||!r)throw Error("bluetooth.setCharacteristicNotify: deviceId, serviceUuid, characteristicUuid are required");if(!i("bluetooth"))return{ok:!1,reason:"bridge unavailable"};return await window.craft.bluetooth.setCharacteristicNotify(e,t,r,n)},onDeviceFound(e){return h("craft:bluetooth:deviceFound",e)},onDeviceConnected(e){return h("craft:bluetooth:deviceConnected",e)},onDeviceDisconnected(e){return h("craft:bluetooth:deviceDisconnected",e)},onCharacteristicValue(e){return h("craft:bluetooth:characteristicValue",e)}};var kp={async speak(e,t){if(!e)throw Error("speech.speak: text is required");if(i("speech")){await window.craft.speech.speak(e,t);return}if(typeof window<"u"&&window.speechSynthesis){let r=new window.SpeechSynthesisUtterance(e);if(t){if(t.rate!=null)r.rate=t.rate;if(t.pitch!=null)r.pitch=t.pitch;if(t.volume!=null)r.volume=t.volume;if(t.voice){let o=window.speechSynthesis.getVoices().find((a)=>a.voiceURI===t.voice||a.name===t.voice||a.lang===t.voice);if(o)r.voice=o}}window.speechSynthesis.speak(r)}},async stop(){if(i("speech")){await window.craft.speech.stop();return}if(typeof window<"u"&&window.speechSynthesis)window.speechSynthesis.cancel()},async pause(){if(i("speech")){await window.craft.speech.pause();return}if(typeof window<"u"&&window.speechSynthesis)window.speechSynthesis.pause()},async resume(){if(i("speech")){await window.craft.speech.resume();return}if(typeof window<"u"&&window.speechSynthesis)window.speechSynthesis.resume()},async isSpeaking(){if(i("speech"))return await window.craft.speech.isSpeaking();if(typeof window<"u"&&window.speechSynthesis)return!!window.speechSynthesis.speaking;return!1},async getVoices(){if(i("speech"))return await window.craft.speech.getVoices();if(typeof window<"u"&&window.speechSynthesis)return window.speechSynthesis.getVoices().map((t)=>({id:t.voiceURI||t.name,name:t.name,language:t.lang||"",quality:"default"}));return[]}};var G=[],ve=!0,Pe,Se,Vn={async report(e){if(i("crashReporter")){await window.craft.crashReporter.report(e);return}if(!ve)return;let t=e instanceof Error?{timestamp:Date.now(),severity:"error",message:e.message,source:"js",stack:e.stack||"",userId:Pe,appVersion:Se}:{timestamp:Date.now(),severity:e.severity||"error",message:e.message||"",source:e.source||"js",stack:e.stack||"",userId:Pe,appVersion:Se};if(G.length>=64)G.shift();G.push(t)},async flush(){if(i("crashReporter"))return await window.craft.crashReporter.flush();return[...G]},async clear(){if(i("crashReporter")){await window.craft.crashReporter.clear();return}G.length=0},async setEnabled(e){if(i("crashReporter")){await window.craft.crashReporter.setEnabled(e);return}ve=e},async isEnabled(){if(i("crashReporter"))return await window.craft.crashReporter.isEnabled();return ve},async setUser(e){if(i("crashReporter")){await window.craft.crashReporter.setUser(e);return}Pe=e||void 0},async setAppVersion(e){if(i("crashReporter")){await window.craft.crashReporter.setAppVersion(e);return}Se=e||void 0},attachGlobalHandlers(){if(i("crashReporter")&&window.craft.crashReporter.attachGlobalHandlers)return window.craft.crashReporter.attachGlobalHandlers();if(typeof window>"u")return()=>{};let e=(r)=>{Vn.report({severity:"error",message:r.message,source:"js",stack:r.error?.stack||`${r.message}
|
|
927
927
|
at ${r.filename}:${r.lineno}:${r.colno}`}).catch(()=>{})},t=(r)=>{let n=r.reason;Vn.report({severity:"error",message:n?.message||String(n),source:"js",stack:n?.stack||""}).catch(()=>{})};return window.addEventListener("error",e),window.addEventListener("unhandledrejection",t),()=>{window.removeEventListener("error",e),window.removeEventListener("unhandledrejection",t)}},forwardTo(e){return Sr(e)}},br="craft:crashReporter:pending",xr=/[\w.+-]+@[\w-]+\.[\w.-]+/g,yr=/\b(?:\d{1,3}\.){3}\d{1,3}\b/g,vr=/\/(?:Users|home)\/[^\s/'"`]+/g;function Ea(e){let t=(r)=>r.replace(xr,"<email>").replace(yr,"<ip>").replace(vr,"/<home>");return{...e,message:t(e.message),stack:t(e.stack)}}async function Ta(e,t){let r=new TextEncoder,n=await crypto.subtle.importKey("raw",r.encode(e),{name:"HMAC",hash:"SHA-256"},!1,["sign"]),o=await crypto.subtle.sign("HMAC",n,r.encode(t));return[...new Uint8Array(o)].map((a)=>a.toString(16).padStart(2,"0")).join("")}function Pr(e){if(!e||typeof localStorage>"u")return[];try{let t=localStorage.getItem(e);if(!t)return[];let r=JSON.parse(t);return Array.isArray(r)?r:[]}catch{return[]}}function at(e,t){if(!e||typeof localStorage>"u")return;try{if(t.length===0)localStorage.removeItem(e);else localStorage.setItem(e,JSON.stringify(t))}catch{}}function Sr(e){let{endpoint:t,intervalMs:r=60000,signingSecret:n,redact:o=!0,headers:a={},maxRetries:s=5,persistKey:c}=e,l=c===null?null:c??br,d=Pr(l),p=!1,m=null,u=null,w=typeof o==="function"?o:o===!1?(k)=>k:Ea;async function b(k){let A=JSON.stringify({entries:k}),B={"Content-Type":"application/json",...a};if(n)B["X-Craft-Signature"]=await Ta(n,A);let Y=0,O=1000;while(!p)try{let z=await fetch(t,{method:"POST",headers:B,body:A});if(z.ok)return;if(z.status>=400&&z.status<500)return;throw Error(`HTTP ${z.status}`)}catch(z){if(Y+=1,Y>s)throw d=[...k,...d],at(l,d),z;await new Promise((dt)=>{setTimeout(dt,O)}),O=Math.min(O*2,60000)}}async function S(){if(p||u)return u??void 0;let k=await Vn.flush();if(k.length>0)await Vn.clear();if(d=[...d,...k.map((B)=>w(B))],d.length===0)return;let A=d;return d=[],at(l,d),u=b(A).catch(()=>{}).finally(()=>{u=null}),u}if(r>0)m=setInterval(()=>{S().catch(()=>{})},r);return{async flushNow(){await S()},stop(){if(p=!0,m)clearInterval(m);m=null},pending(){return[...d]}}}var _p={async isAvailable(){if(!i("iap"))return!1;return await window.craft.iap.isAvailable()},async getProducts(e){if(!i("iap"))return[];let t=Array.isArray(e)?e:[String(e)];return await window.craft.iap.getProducts(t)},async purchase(e){if(!i("iap"))return{queued:!1,productId:e,reason:"IAP bridge not available"};let t=await window.craft.iap.purchase(e);return{queued:!!(t&&t.queued),productId:t?.productId,reason:t?.reason}},async restorePurchases(){if(!i("iap"))return{ok:!1};let e=await window.craft.iap.restorePurchases();return{ok:!!(e&&e.ok)}},async finishTransaction(e){if(!i("iap"))return;await window.craft.iap.finishTransaction(e)},async getReceiptData(){if(!i("iap"))return null;let e=await window.craft.iap.getReceiptData();return e?String(e):null},onPurchased(e){return h("craft:iap:purchased",e)},onFailed(e){return h("craft:iap:failed",e)},onRestored(e){return h("craft:iap:restored",e)},onProductsLoaded(e){return h("craft:iap:productsLoaded",(t)=>e(t.products||[]))},onRefunded(e){return h("craft:iap:refunded",e)},onSubscriptionStatusChanged(e){return h("craft:iap:subscriptionStatusChanged",e)},async getActiveSubscriptions(){if(!i("iap"))return[];let e=window.craft.iap.getActiveSubscriptions;if(typeof e!=="function")return[];let t=await e();return Array.isArray(t)?t:[]},async isEligibleForIntroOffer(e){if(!i("iap"))return!1;let t=window.craft.iap.isEligibleForIntroOffer;if(typeof t!=="function")return!1;return!!await t(e)}};var Un={async startActivity(e,t){if(!e)throw Error("handoff.startActivity: type is required");if(!i("handoff"))return!1;let r=await window.craft.handoff.startActivity(e,t);return typeof r==="boolean"?r:!!(r&&r.ok)},async updateActivity(e){if(!i("handoff"))return!1;let t=await window.craft.handoff.updateActivity(e);return typeof t==="boolean"?t:!!(t&&t.ok)},async stopActivity(){if(!i("handoff"))return;await window.craft.handoff.stopActivity()},async getCurrentActivity(){if(!i("handoff"))return null;let e=await window.craft.handoff.getCurrentActivity();return e&&typeof e.type==="string"?e:null},onIncoming(e){return h("craft:handoff:incoming",e)}};var Cp={async start(e,t){return Un.startActivity(e,{title:t?.title,webpageURL:t?.webpageURL,userInfo:t?.state})},async update(e){return Un.updateActivity({title:e.title,webpageURL:e.webpageURL,userInfo:e.state})},async stop(){await Un.stopActivity()}};var Ep={async requestPermission(e="whenInUse"){if(i("location"))return await window.craft.location.requestPermission(e);if(typeof navigator<"u"&&navigator.geolocation)return"undetermined";return"not-supported"},async getAuthorization(){if(i("location"))return await window.craft.location.getAuthorization();return"unknown"},async getCurrentLocation(){if(i("location"))return await window.craft.location.getCurrentLocation();if(typeof navigator<"u"&&navigator.geolocation)return navigator.geolocation.getCurrentPosition((e)=>{window.dispatchEvent(new CustomEvent("craft:location:update",{detail:{latitude:e.coords.latitude,longitude:e.coords.longitude,altitude:e.coords.altitude,horizontalAccuracy:e.coords.accuracy,verticalAccuracy:e.coords.altitudeAccuracy,speed:e.coords.speed}}))},(e)=>{window.dispatchEvent(new CustomEvent("craft:location:error",{detail:{message:e.message||String(e)}}))}),{requested:!0};return{requested:!1}},async startWatching(e){if(i("location"))return await window.craft.location.startWatching(e);if(typeof navigator<"u"&&navigator.geolocation){let t=navigator.geolocation.watchPosition((r)=>{window.dispatchEvent(new CustomEvent("craft:location:update",{detail:{latitude:r.coords.latitude,longitude:r.coords.longitude,altitude:r.coords.altitude,horizontalAccuracy:r.coords.accuracy,verticalAccuracy:r.coords.altitudeAccuracy,speed:r.coords.speed}}))});return window.__craftWebLocationWatchId=t,!0}return!1},async stopWatching(){if(i("location")){await window.craft.location.stopWatching();return}if(typeof navigator<"u"&&navigator.geolocation){let e=window.__craftWebLocationWatchId;if(e!=null)navigator.geolocation.clearWatch(e),window.__craftWebLocationWatchId=null}},onUpdate(e){return h("craft:location:update",e)},onError(e){return h("craft:location:error",e)},onAuthChanged(e){return h("craft:location:authChanged",e)}};var Tp={async captureScreen(){if(!i("screenCapture"))return null;let e=await window.craft.screenCapture.captureScreen();return e?String(e):null},async captureWindow(e){if(!i("screenCapture"))return null;if(!Number.isFinite(e)||e<=0)throw Error("captureWindow: id must be a positive number");let t=await window.craft.screenCapture.captureWindow(e);return t?String(t):null},async listWindows(){if(!i("screenCapture"))return[];return await window.craft.screenCapture.listWindows()}};var $a=250,Ra=60000,Ur=2000,st={sharing:!1,signals:{systemScreenShare:!1,remoteSession:!1,conferenceSharing:!1,screenRecording:!1},sources:[]};function kr(){return{...st,signals:{...st.signals},sources:[]}}var Wr={async getState(){if(!i("screenSharing"))return kr();return await window.craft.screenSharing.getState()},async watch(e=Ur){let t=Number.isFinite(e)?Math.min(Ra,Math.max($a,Math.round(e))):Ur;if(!i("screenSharing"))return t;let r=await window.craft.screenSharing.watch(t);return r&&r.intervalMs||t},async stop(){if(!i("screenSharing"))return;await window.craft.screenSharing.unwatch()},onChange(e){return h("craft:screenSharing:change",e)}};async function $p(e,t=Ur){let r=Wr.onChange(e);try{await Wr.watch(t)}catch(o){throw r(),o}let n;return()=>{if(!n)r(),n=Wr.stop();return n}}var Ar={supported:!1,isFocused:null,authorization:"unsupported"};function ct(){return{ok:!1,error:"Focus control is only available in a Craft window on macOS"}}var lo={async getStatus(){if(!i("focus"))return{...Ar};return await window.craft.focus.getStatus()},async requestAuthorization(){if(!i("focus"))return"unsupported";return await window.craft.focus.requestAuthorization()},async setEnabled(e,t={}){if(!i("focus"))return ct();if(!(e?t.onShortcut:t.offShortcut))return{ok:!1,error:`focus.setEnabled: no ${e?"onShortcut":"offShortcut"} configured`};return await window.craft.focus.setEnabled(e,t)},async runShortcut(e){if(!i("focus"))return ct();if(!e)throw Error("focus.runShortcut: name is required");return await window.craft.focus.runShortcut(e)},async listShortcuts(){if(!i("focus"))return[];return await window.craft.focus.listShortcuts()},async listShortcutsResult(){if(!i("focus"))return{canList:!1,shortcuts:[]};let t=await window.craft.focus.listShortcutsResult?.();return{canList:Boolean(t?.canList),shortcuts:t?.shortcuts??[]}}};async function Rp(...e){if(e.length===0)return!1;let t=new Set(await lo.listShortcuts());return e.every((r)=>t.has(r))}async function Ap(...e){if(e.length===0)return!1;let{canList:t,shortcuts:r}=await lo.listShortcutsResult();if(!t)return"unknown";let n=new Set(r);return e.every((o)=>n.has(o))}var Pp={async start(e=0,t="127.0.0.1"){if(!i("localServer"))return{port:0,started:!1,reason:"bridge unavailable"};return await window.craft.localServer.start(e,t)},async stop(){if(!i("localServer"))return;await window.craft.localServer.stop()},async respond(e){if(!i("localServer"))return;await window.craft.localServer.respond(e||{status:200,body:"OK"})},onRequest(e){return h("craft:localServer:request",e)},async awaitOAuthCallback(e={}){v("localServer");let{port:t=0,host:r="127.0.0.1",timeoutMs:n=300000,successHTML:o}=e,a=await this.start(t,r);if(!a.started)throw Error(`localServer: start failed${a.reason?` \u2014 ${a.reason}`:""}`);return new Promise((s,c)=>{let l=setTimeout(()=>{d(),this.stop().catch(()=>{}),c(Error("localServer: OAuth callback timed out"))},n),d=this.onRequest(({url:p})=>{clearTimeout(l),d();let m=o??`<!doctype html><meta charset="utf-8"><title>Done</title>
|
|
928
928
|
<style>body{font-family:-apple-system,BlinkMacSystemFont,sans-serif;display:flex;align-items:center;justify-content:center;height:100vh;margin:0;background:#f5f5f7}</style>
|
|
929
929
|
<div><h1>You can close this tab.</h1><p>Returning to the app\u2026</p></div>
|
|
930
|
-
<script>setTimeout(()=>window.close(),1500)</script>`;this.respond({status:200,body:m,contentType:"text/html; charset=utf-8"}).catch(()=>{}).finally(()=>this.stop().catch(()=>{})),s({url:p,port:a.port})})})}};var Ip={async isAvailable(){if(!i("biometric"))return!1;return await window.craft.biometric.isAvailable()},async getBiometryType(){if(!i("biometric"))return"none";return await window.craft.biometric.getBiometryType()},async evaluate(e,t){if(!e)throw Error("biometric.evaluate: reason is required");if(!i("biometric"))return{success:!1,errorCode:-1};return await window.craft.biometric.evaluate(e,t)}};var I=null,Op={async play(e,t){if(i("audio"))return await window.craft.audio.play(e,t);if(typeof window>"u"||typeof Audio>"u")return!1;if(I)I.pause(),I=null;if(I=new Audio(e),t?.volume!=null)I.volume=t.volume;if(t?.loops)I.loop=!0;try{return await I.play(),!0}catch{return!1}},async playSystemSound(e){if(i("audio"))return await window.craft.audio.playSystemSound(e);if(typeof window>"u"||typeof Audio>"u")return!1;try{return I=new Audio(`/System/Library/Sounds/${e}.aiff`),await I.play(),!0}catch{return!1}},async stop(){if(i("audio")){await window.craft.audio.stop();return}if(I)I.pause(),I.currentTime=0,I=null},async isPlaying(){if(i("audio"))return await window.craft.audio.isPlaying();return!!(I&&!I.paused)},async startRecording(e,t){if(i("audio"))return await window.craft.audio.startRecording(e,t);return!1},async stopRecording(){if(i("audio"))await window.craft.audio.stopRecording()},async isRecording(){if(i("audio"))return await window.craft.audio.isRecording();return!1}};var Np={async execute(e){if(!e)throw Error("appleScript.execute: source is required");if(!i("appleScript"))return{ok:!1};return await window.craft.appleScript.execute(e)}};var Dp={async getDefault(e){if(!e)throw Error("fileAssociations.getDefault: uti is required");if(!i("fileAssociations"))return null;let t=await window.craft.fileAssociations.getDefault(e);return t?String(t):null},async setDefault(e,t){if(!e||!t)throw Error("fileAssociations.setDefault: uti and bundleId are required");if(!i("fileAssociations"))return!1;return await window.craft.fileAssociations.setDefault(e,t)}};var Mp={async get(e){if(!e)throw Error("tags.get: path is required");if(!i("tags"))return[];return await window.craft.tags.get(e)},async set(e,t){if(!e)throw Error("tags.set: path is required");if(!i("tags"))return!1;let r=Array.isArray(t)?t:[String(t)];return await window.craft.tags.set(e,r)},async clear(e){if(!e)throw Error("tags.clear: path is required");if(!i("tags"))return!1;return await window.craft.tags.clear(e)}};var Lp={async countPages(e){if(!e)throw Error("pdf.countPages: path is required");if(!i("pdf"))return 0;return await window.craft.pdf.countPages(e)},async extractText(e){if(!e)throw Error("pdf.extractText: path is required");if(!i("pdf"))return"";return await window.craft.pdf.extractText(e)}};var jp={async debug(e){if(i("log"))await window.craft.log.debug(e);else console.debug(e)},async info(e){if(i("log"))await window.craft.log.info(e);else console.info(e)},async warn(e){if(i("log"))await window.craft.log.warn(e);else console.warn(e)},async error(e){if(i("log"))await window.craft.log.error(e);else console.error(e)}};var Bp={async browse(e){if(!i("bonjour"))return{started:!1,reason:"bridge unavailable"};return await window.craft.bonjour.browse(e)},async stop(){if(i("bonjour"))await window.craft.bonjour.stop()},onFound(e){return h("craft:bonjour:found",e)},onLost(e){return h("craft:bonjour:lost",e)}};var Fp={async index(e){if(!i("spotlight"))return{ok:!1,reason:"bridge unavailable"};return await window.craft.spotlight.index(e)},async remove(e){if(!i("spotlight"))return{ok:!1};return await window.craft.spotlight.remove(e)},async removeAll(){if(!i("spotlight"))return{ok:!1};return await window.craft.spotlight.removeAll()}};var zp={async isAvailable(){if(!i("speechRecognition"))return!1;return await window.craft.speechRecognition.isAvailable()},async start(e){if(!i("speechRecognition"))return{started:!1,reason:"bridge unavailable"};return await window.craft.speechRecognition.start(e)},async stop(){if(i("speechRecognition"))await window.craft.speechRecognition.stop()},onPartial(e){return h("craft:speechRecognition:partial",e)},onFinal(e){return h("craft:speechRecognition:final",e)}};var Hp={async recognizeText(e){if(!e)throw Error("vision.recognizeText: path is required");if(!i("vision"))return[];return await window.craft.vision.recognizeText(e)},async detectFaces(e){if(!e)throw Error("vision.detectFaces: path is required");if(!i("vision"))return[];return await window.craft.vision.detectFaces(e)},async detectBarcodes(e){if(!e)throw Error("vision.detectBarcodes: path is required");if(!i("vision"))return[];return await window.craft.vision.detectBarcodes(e)}};var Vp={async listSources(){if(!i("midi"))return[];return await window.craft.midi.listSources()},async listDestinations(){if(!i("midi"))return[];return await window.craft.midi.listDestinations()},async send(e,t){if(!i("midi"))return{ok:!1,reason:"bridge unavailable"};return await window.craft.midi.send(e,t)},async subscribe(e){if(!i("midi"))return{ok:!1,reason:"bridge unavailable"};return await window.craft.midi.subscribe(e)},async unsubscribe(e){if(!i("midi"))return{ok:!1};return await window.craft.midi.unsubscribe(e)},onMessage(e){return h("craft:midi:message",e)}};var Up={async loadModel(e,t){if(!e||!t)throw Error("coreml.loadModel: id and path are required");if(!i("coreml"))return!1;return await window.craft.coreml.loadModel(e,t)},async unloadModel(e){if(!i("coreml"))return;await window.craft.coreml.unloadModel(e)},async predict(e,t){if(!e)throw Error("coreml.predict: id is required");if(!i("coreml"))return null;return await window.craft.coreml.predict(e,t)}};var Wp={async listCameras(){if(!i("continuityCamera"))return[];return await window.craft.continuityCamera.listCameras()}};var qp={async register(e){if(!e)throw Error("serviceMenu.register: name is required");if(!i("serviceMenu"))return{ok:!1,reason:"bridge unavailable"};return await window.craft.serviceMenu.register(e)},async unregister(e){if(!e)throw Error("serviceMenu.unregister: name is required");if(!i("serviceMenu"))return;await window.craft.serviceMenu.unregister(e)},onInvoked(e){return h("craft:serviceMenu:invoked",e)}};var
|
|
930
|
+
<script>setTimeout(()=>window.close(),1500)</script>`;this.respond({status:200,body:m,contentType:"text/html; charset=utf-8"}).catch(()=>{}).finally(()=>this.stop().catch(()=>{})),s({url:p,port:a.port})})})}};var Ip={async isAvailable(){if(!i("biometric"))return!1;return await window.craft.biometric.isAvailable()},async getBiometryType(){if(!i("biometric"))return"none";return await window.craft.biometric.getBiometryType()},async evaluate(e,t){if(!e)throw Error("biometric.evaluate: reason is required");if(!i("biometric"))return{success:!1,errorCode:-1};return await window.craft.biometric.evaluate(e,t)}};var I=null,Op={async play(e,t){if(i("audio"))return await window.craft.audio.play(e,t);if(typeof window>"u"||typeof Audio>"u")return!1;if(I)I.pause(),I=null;if(I=new Audio(e),t?.volume!=null)I.volume=t.volume;if(t?.loops)I.loop=!0;try{return await I.play(),!0}catch{return!1}},async playSystemSound(e){if(i("audio"))return await window.craft.audio.playSystemSound(e);if(typeof window>"u"||typeof Audio>"u")return!1;try{return I=new Audio(`/System/Library/Sounds/${e}.aiff`),await I.play(),!0}catch{return!1}},async stop(){if(i("audio")){await window.craft.audio.stop();return}if(I)I.pause(),I.currentTime=0,I=null},async isPlaying(){if(i("audio"))return await window.craft.audio.isPlaying();return!!(I&&!I.paused)},async startRecording(e,t){if(i("audio"))return await window.craft.audio.startRecording(e,t);return!1},async stopRecording(){if(i("audio"))await window.craft.audio.stopRecording()},async isRecording(){if(i("audio"))return await window.craft.audio.isRecording();return!1}};var Np={async execute(e){if(!e)throw Error("appleScript.execute: source is required");if(!i("appleScript"))return{ok:!1};return await window.craft.appleScript.execute(e)}};var Dp={async getDefault(e){if(!e)throw Error("fileAssociations.getDefault: uti is required");if(!i("fileAssociations"))return null;let t=await window.craft.fileAssociations.getDefault(e);return t?String(t):null},async setDefault(e,t){if(!e||!t)throw Error("fileAssociations.setDefault: uti and bundleId are required");if(!i("fileAssociations"))return!1;return await window.craft.fileAssociations.setDefault(e,t)}};var Mp={async get(e){if(!e)throw Error("tags.get: path is required");if(!i("tags"))return[];return await window.craft.tags.get(e)},async set(e,t){if(!e)throw Error("tags.set: path is required");if(!i("tags"))return!1;let r=Array.isArray(t)?t:[String(t)];return await window.craft.tags.set(e,r)},async clear(e){if(!e)throw Error("tags.clear: path is required");if(!i("tags"))return!1;return await window.craft.tags.clear(e)}};var Lp={async countPages(e){if(!e)throw Error("pdf.countPages: path is required");if(!i("pdf"))return 0;return await window.craft.pdf.countPages(e)},async extractText(e){if(!e)throw Error("pdf.extractText: path is required");if(!i("pdf"))return"";return await window.craft.pdf.extractText(e)}};var jp={async debug(e){if(i("log"))await window.craft.log.debug(e);else console.debug(e)},async info(e){if(i("log"))await window.craft.log.info(e);else console.info(e)},async warn(e){if(i("log"))await window.craft.log.warn(e);else console.warn(e)},async error(e){if(i("log"))await window.craft.log.error(e);else console.error(e)}};var Bp={async browse(e){if(!i("bonjour"))return{started:!1,reason:"bridge unavailable"};return await window.craft.bonjour.browse(e)},async stop(){if(i("bonjour"))await window.craft.bonjour.stop()},onFound(e){return h("craft:bonjour:found",e)},onLost(e){return h("craft:bonjour:lost",e)}};var Fp={async index(e){if(!i("spotlight"))return{ok:!1,reason:"bridge unavailable"};return await window.craft.spotlight.index(e)},async remove(e){if(!i("spotlight"))return{ok:!1};return await window.craft.spotlight.remove(e)},async removeAll(){if(!i("spotlight"))return{ok:!1};return await window.craft.spotlight.removeAll()}};var zp={async isAvailable(){if(!i("speechRecognition"))return!1;return await window.craft.speechRecognition.isAvailable()},async start(e){if(!i("speechRecognition"))return{started:!1,reason:"bridge unavailable"};return await window.craft.speechRecognition.start(e)},async stop(){if(i("speechRecognition"))await window.craft.speechRecognition.stop()},onPartial(e){return h("craft:speechRecognition:partial",e)},onFinal(e){return h("craft:speechRecognition:final",e)}};var Hp={async recognizeText(e){if(!e)throw Error("vision.recognizeText: path is required");if(!i("vision"))return[];return await window.craft.vision.recognizeText(e)},async detectFaces(e){if(!e)throw Error("vision.detectFaces: path is required");if(!i("vision"))return[];return await window.craft.vision.detectFaces(e)},async detectBarcodes(e){if(!e)throw Error("vision.detectBarcodes: path is required");if(!i("vision"))return[];return await window.craft.vision.detectBarcodes(e)}};var Vp={async listSources(){if(!i("midi"))return[];return await window.craft.midi.listSources()},async listDestinations(){if(!i("midi"))return[];return await window.craft.midi.listDestinations()},async send(e,t){if(!i("midi"))return{ok:!1,reason:"bridge unavailable"};return await window.craft.midi.send(e,t)},async subscribe(e){if(!i("midi"))return{ok:!1,reason:"bridge unavailable"};return await window.craft.midi.subscribe(e)},async unsubscribe(e){if(!i("midi"))return{ok:!1};return await window.craft.midi.unsubscribe(e)},onMessage(e){return h("craft:midi:message",e)}};var Up={async loadModel(e,t){if(!e||!t)throw Error("coreml.loadModel: id and path are required");if(!i("coreml"))return!1;return await window.craft.coreml.loadModel(e,t)},async unloadModel(e){if(!i("coreml"))return;await window.craft.coreml.unloadModel(e)},async predict(e,t){if(!e)throw Error("coreml.predict: id is required");if(!i("coreml"))return null;return await window.craft.coreml.predict(e,t)}};var Wp={async listCameras(){if(!i("continuityCamera"))return[];return await window.craft.continuityCamera.listCameras()}};var qp={async register(e){if(!e)throw Error("serviceMenu.register: name is required");if(!i("serviceMenu"))return{ok:!1,reason:"bridge unavailable"};return await window.craft.serviceMenu.register(e)},async unregister(e){if(!e)throw Error("serviceMenu.unregister: name is required");if(!i("serviceMenu"))return;await window.craft.serviceMenu.unregister(e)},onInvoked(e){return h("craft:serviceMenu:invoked",e)}};var Gp={async list(){if(!i("serial"))return[];return await window.craft.serial.list()},async open(e,t=9600){if(!e)throw Error("serial.open: path is required");if(!i("serial"))return{ok:!1,reason:"bridge unavailable"};return await window.craft.serial.open(e,t)},async write(e,t){if(!e)throw Error("serial.write: id is required");if(!i("serial"))return{ok:!1,reason:"bridge unavailable"};return await window.craft.serial.write(e,t)},async close(e){if(!i("serial"))return;await window.craft.serial.close(e)},onData(e){return h("craft:serial:data",e)}};var lt=[{name:"fs",support:"native"},{name:"shell",support:"native"},{name:"system",support:"all"},{name:"clipboard",support:"all"},{name:"dialog",support:"all"},{name:"window",support:"native"},{name:"tray",support:"native"},{name:"menu",support:"native"},{name:"theme",support:"all"},{name:"screen",support:"all"},{name:"network",support:"all"},{name:"power",support:"all"},{name:"battery",support:"all"},{name:"notifications",support:"all"},{name:"globalShortcuts",support:"native"},{name:"autolaunch",support:"native"},{name:"appInfo",support:"all"},{name:"localServer",support:"native"},{name:"bluetooth",support:"native"},{name:"crashReporter",support:"all"},{name:"updater",support:"native"},{name:"iap",support:"macos"},{name:"keychain",support:"native"},{name:"log",support:"all"},{name:"biometric",support:"macos"},{name:"location",support:"macos"},{name:"audio",support:"macos"},{name:"deepLink",support:"native"},{name:"handoff",support:"macos"},{name:"liveActivities",support:"macos"},{name:"touchbar",support:"macos"},{name:"dragOut",support:"macos"},{name:"appleScript",support:"macos"},{name:"fileAssociations",support:"native"},{name:"tags",support:"macos"},{name:"pdf",support:"macos"},{name:"bonjour",support:"macos"},{name:"spotlight",support:"macos"},{name:"speechRecognition",support:"macos"},{name:"vision",support:"macos"},{name:"midi",support:"macos"},{name:"coreml",support:"macos"},{name:"continuityCamera",support:"macos"},{name:"serviceMenu",support:"macos"},{name:"serial",support:"native"}];function Kp(){return lt.map(({name:e,support:t})=>({name:e,support:t,available:i(e)}))}function Aa(e){let t=lt.find((r)=>r.name===e);if(!t)return;return{...t,available:i(e)}}function Xp(e){let t=Aa(e);return!!t&&t.available}function Jp(e,t={}){if(!Number.isInteger(e)||e<0||e>86400000)return Promise.reject(RangeError("delayMs must be an integer between 0 and 86400000"));let{signal:r}=t,n=()=>new DOMException("Background delay aborted","AbortError");if(r?.aborted)return Promise.reject(n());if(i("timers"))return v("timers").sleep(e,t);if(typeof window<"u"&&window.craft)return Promise.reject(Error("Native background deadlines require a Craft runtime with timers.sleep support"));return new Promise((o,a)=>{let s=setTimeout(()=>{r?.removeEventListener("abort",c),o()},e);function c(){clearTimeout(s),r?.removeEventListener("abort",c),a(n())}r?.addEventListener("abort",c,{once:!0})})}export{Gl,oo,zn,Kl,Xl,Jl,Yl,Zl,Ql,eu,tu,nu,ru,su,ou,iu,au,cu,lu,uu,du,pu,fu,gu,mu,hu,yu,bu,vu,wu,xu,Su,ku,_u,Cu,Eu,Tu,$u,Ru,Au,Pu,Iu,Ou,Nu,Du,Mu,Lu,ju,Gt,pa,Bu,Fu,zu,fa,Hu,Vu,Uu,Wu,qu,Gu,ga,Ku,Xu,Ju,Yu,Zu,Qu,ed,td,nd,Hn,rd,sd,od,id,ad,cd,ld,ud,dd,pd,fd,gd,io,md,hd,yd,bd,vd,Hr,wd,xd,Sd,kd,_d,ma,Cd,Ed,Td,ha,ao,$d,Rd,ya,ba,va,wa,Ad,Vr,Pd,xa,Sa,Id,Od,co,Nd,Dd,Md,Ld,jd,Bd,Fd,ka,zd,Hd,_a,Vd,Ud,Wd,qd,Gd,Kd,Xd,Jd,Yd,Zd,Qd,ep,tp,np,rp,sp,op,ip,ap,cp,lp,up,dp,pp,Ca,fp,gp,mp,hp,yp,bp,vp,wp,xp,Sp,kp,Vn,Ea,Ta,_p,Un,Cp,Ep,Tp,$a,Ra,Ur,Wr,$p,lo,Rp,Ap,Pp,Ip,Op,Np,Dp,Mp,Lp,jp,Bp,Fp,zp,Hp,Vp,Up,Wp,qp,Gp,Kp,Aa,Xp,Jp};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import l from"fs";import u from"path";var m=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useModel)\s*(?:<[^<>()]*>)?\s*\(/,g=/(?:^|\n)\s*(?:import|export)\s+(?:[^'"]*?\sfrom\s+)?['"](\.[^'"]*)['"]/g,b=["",".ts",".tsx",".js",".jsx",".mts",".mjs","/index.ts","/index.js"],x=3;function h(e,t){let r=u.resolve(u.dirname(t),e);for(let o of b){let s=r+o;try{if(l.statSync(s).isFile())return s}catch{}}return null}function Er(e,t,r=0,o=new Set){if(!t||r>=x)return!1;for(let s of e.matchAll(g)){let n=h(s[1],t);if(!n||o.has(n))continue;o.add(n);let i;try{i=l.readFileSync(n,"utf8")}catch{continue}if(m.test(i))return!0;if(Er(i,n,r+1,o))return!0}return!1}var S=["batch","cachedQuery","clearServerData","computed","configureFetch","defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","defineStore","derived","effect","flushKeptState","forgetKeptState","goBack","goForward","inject","invalidateRoute","isDerived","isSignal","keptState","memo","navigate","nextTick","onBeforeMount","onBeforeUnmount","onDestroy","onMount","onMounted","onUnmounted","peek","provide","reactive","ref","refDebounced","refresh","registerStoresClient","setKeptScope","setRouteParams","sharedRequest","state","untrack","useAsync","useClickOutside","useColorMode","useCookie","useCounter","useDark","useDebounce","useDebounceFn","useDebouncedValue","useDocumentVisibility","useEventListener","useFetch","useFocus","useHead","useId","useInterval","useLocalStorage","useMediaQuery","useModel","useMutation","useNativeDesktop","useOptimistic","usePreferredContrast","usePreferredDark","usePreferredLight","usePreferredReducedMotion","useQuery","useReactiveProp","useRef","useRoute","useRouteParam","useRouteParams","useScrollLock","useSearchParams","useSeoMeta","useSessionStorage","useSlots","useStore","useThrottle","useThrottleFn","useTimeout","useTimeoutFn","useToggle","useWebSocket","watch","watchEffect","watchMultiple","withDefaults"],Uc=["onMount","onDestroy"];function st(e="const",t=[],r){let o=t.length?S.filter((s)=>!t.includes(s)):S;if(r!==void 0)o=o.filter((s)=>{let n=s.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(^|[^\\w$])${n}(?![\\w$])`).test(r)});return`${e} { ${o.join(", ")} } = window.stx;`}var y=["defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","withDefaults"];var v=S.filter((e)=>!y.includes(e));function pi(e){if(!e)return!1;return v.some((t)=>new RegExp(`\\b${t}\\s*(?:<[^>]*>)?\\s*\\(`).test(e))}var E=[/@if\s*=/,/@for\s*=/,/@show\s*=/,/@model\s*=/,/@bind:/,/@class\s*=/,/@style\s*=/,/\bx-data\s*=/,/\bstate\s*(?:<[^>]*>)?\s*\(/,/\bderived\s*(?:<[^>]*>)?\s*\(/,/\beffect\s*(?:<[^>]*>)?\s*\(/,/\bref\s*(?:<[^>]*>)?\s*\(/,/\bcomputed\s*(?:<[^>]*>)?\s*\(/,/\breactive\s*(?:<[^>]*>)?\s*\(/,/\bwatch\s*(?:<[^>]*>)?\s*\(/,/\bwatchEffect\s*(?:<[^>]*>)?\s*\(/,/\s:[a-z][\w-]*\s*=\s*["']/i,/\s:(?:if|else-if|else|for|show|text|html|model)\s*=/,/data-stx(?:-auto)?(?![-\w])/,/data-stx-scoped/],T=/\s@[a-z][\w.:-]*\s*=/i;function Wc(e,t){if(!e)return!1;let r=f(e);return d(r,t)}function d(e,t){if(E.some((r)=>r.test(e)))return!0;if(pi(e))return!0;return R(e,t)}function R(e,t){if(!t)return!1;for(let r of e.matchAll(/<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script\s*>/gi))if(Er(r[1],t))return!0;return!1}function qc(e,t){if(!e)return!1;let r=f(e);return T.test(r)||d(r,t)}var _=["if","else-if","elseif","else","for","show","key","text","html","model","ref"];function
|
|
3
|
-
export{Er,S,Uc,st,pi,Wc,qc,
|
|
2
|
+
import l from"fs";import u from"path";var m=/\b(?:state|derived|effect|ref|reactive|computed|watch|watchEffect|useModel)\s*(?:<[^<>()]*>)?\s*\(/,g=/(?:^|\n)\s*(?:import|export)\s+(?:[^'"]*?\sfrom\s+)?['"](\.[^'"]*)['"]/g,b=["",".ts",".tsx",".js",".jsx",".mts",".mjs","/index.ts","/index.js"],x=3;function h(e,t){let r=u.resolve(u.dirname(t),e);for(let o of b){let s=r+o;try{if(l.statSync(s).isFile())return s}catch{}}return null}function Er(e,t,r=0,o=new Set){if(!t||r>=x)return!1;for(let s of e.matchAll(g)){let n=h(s[1],t);if(!n||o.has(n))continue;o.add(n);let i;try{i=l.readFileSync(n,"utf8")}catch{continue}if(m.test(i))return!0;if(Er(i,n,r+1,o))return!0}return!1}var S=["batch","cachedQuery","clearServerData","computed","configureFetch","defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","defineStore","derived","effect","flushKeptState","forgetKeptState","goBack","goForward","inject","invalidateRoute","isDerived","isSignal","keptState","memo","navigate","nextTick","onBeforeMount","onBeforeUnmount","onDestroy","onMount","onMounted","onUnmounted","peek","provide","reactive","ref","refDebounced","refresh","registerStoresClient","setKeptScope","setRouteParams","sharedRequest","state","untrack","useAsync","useClickOutside","useColorMode","useCookie","useCounter","useDark","useDebounce","useDebounceFn","useDebouncedValue","useDocumentVisibility","useEventListener","useFetch","useFocus","useHead","useId","useInterval","useLocalStorage","useMediaQuery","useModel","useMutation","useNativeDesktop","useOptimistic","usePreferredContrast","usePreferredDark","usePreferredLight","usePreferredReducedMotion","useQuery","useReactiveProp","useRef","useRoute","useRouteParam","useRouteParams","useScrollLock","useSearchParams","useSeoMeta","useSessionStorage","useSlots","useStore","useThrottle","useThrottleFn","useTimeout","useTimeoutFn","useToggle","useWebSocket","watch","watchEffect","watchMultiple","withDefaults"],Uc=["onMount","onDestroy"];function st(e="const",t=[],r){let o=t.length?S.filter((s)=>!t.includes(s)):S;if(r!==void 0)o=o.filter((s)=>{let n=s.replace(/[$()*+.?[\\\]^{|}-]/g,"\\$&");return new RegExp(`(^|[^\\w$])${n}(?![\\w$])`).test(r)});return`${e} { ${o.join(", ")} } = window.stx;`}var y=["defineEmits","defineExpose","definePageMeta","defineProps","defineSlots","withDefaults"];var v=S.filter((e)=>!y.includes(e));function pi(e){if(!e)return!1;return v.some((t)=>new RegExp(`\\b${t}\\s*(?:<[^>]*>)?\\s*\\(`).test(e))}var E=[/@if\s*=/,/@for\s*=/,/@show\s*=/,/@model\s*=/,/@bind:/,/@class\s*=/,/@style\s*=/,/\bx-data\s*=/,/\bstate\s*(?:<[^>]*>)?\s*\(/,/\bderived\s*(?:<[^>]*>)?\s*\(/,/\beffect\s*(?:<[^>]*>)?\s*\(/,/\bref\s*(?:<[^>]*>)?\s*\(/,/\bcomputed\s*(?:<[^>]*>)?\s*\(/,/\breactive\s*(?:<[^>]*>)?\s*\(/,/\bwatch\s*(?:<[^>]*>)?\s*\(/,/\bwatchEffect\s*(?:<[^>]*>)?\s*\(/,/\s:[a-z][\w-]*\s*=\s*["']/i,/\s:(?:if|else-if|else|for|show|text|html|model)\s*=/,/data-stx(?:-auto)?(?![-\w])/,/data-stx-scoped/],T=/\s@[a-z][\w.:-]*\s*=/i;function Wc(e,t){if(!e)return!1;let r=f(e);return d(r,t)}function d(e,t){if(E.some((r)=>r.test(e)))return!0;if(pi(e))return!0;return R(e,t)}function R(e,t){if(!t)return!1;for(let r of e.matchAll(/<script\b(?![^>]*\bserver\b)(?![^>]*\bsrc\s*=)[^>]*>([\s\S]*?)<\/script\s*>/gi))if(Er(r[1],t))return!0;return!1}function qc(e,t){if(!e)return!1;let r=f(e);return T.test(r)||d(r,t)}var _=["if","else-if","elseif","else","for","show","key","text","html","model","ref"];function Gc(e){return _.includes(e.toLowerCase())}var Ls=["x-text","x-html","x-model","x-show","x-if","x-for","x-cloak","x-ref","x-data","x-bind","x-class","x-style","x-tooltip","x-tooltip-position"],w=["x-init","x-transition","x-effect","x-on"],Kc=[...Ls,...w];function Xc(){return`{${Ls.map((e)=>`'${e}':1`).join(",")}}`}var fi=["class","style","text","html","show","model","if","ref"];function Jc(){return`{${fi.map((e)=>e==="if"?"'if':1":`${e}:1`).join(",")}}`}var p=["click","dblclick","mousedown","mouseup","mousemove","mouseenter","mouseleave","keydown","keyup","keypress","input","change","submit","focus","blur","scroll","resize","touchstart","touchend","touchmove","contextmenu","wheel","pointerdown","pointerup","pointermove"];function Yc(){return`/^(${p.join("|")})(?:\\.|$)/`}function Zc(e){return p.some((t)=>e===t||e.startsWith(`${t}.`))}var A=65536,N=4,c=new Map;function f(e){if(!e)return e;if(!e.includes("<!--")&&!/<(?:pre|code)\b/i.test(e))return e;let t=e.length>=A;if(t){let s=c.get(e);if(s!==void 0)return s}let r=(s)=>s.replace(/(<[^>]*>)|([^<]+)/g,(n,i,a)=>i??" ".repeat(a.length)),o=e.replace(/(<pre\b[^>]*>)([\s\S]*?)(<\/pre>)/gi,(s,n,i,a)=>n+r(i)+a).replace(/(<code\b[^>]*>)([\s\S]*?)(<\/code>)/gi,(s,n,i,a)=>n+r(i)+a).replace(/<!--[\s\S]*?-->/g,(s)=>" ".repeat(s.length));if(t){while(c.size>=N){let s=c.keys().next();if(s.done)break;c.delete(s.value)}c.set(e,o)}return o}
|
|
3
|
+
export{Er,S,Uc,st,pi,Wc,qc,Gc,Ls,Kc,Xc,fi,Jc,Yc,Zc};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{t,a}from"./chunk-xc03cdet.js";import{n,mn,m}from"./chunk-
|
|
2
|
+
import{t,a}from"./chunk-xc03cdet.js";import{n,mn,m}from"./chunk-ft534en1.js";import{Ze}from"./chunk-m4j9gedb.js";import{cs,ls}from"./chunk-p78v88ng.js";import{nc,Oo,is,as}from"./chunk-fgr56q3w.js";import{Qa,ec}from"./chunk-ff68f7sm.js";import{bt}from"./chunk-3hxd5td3.js";import{on,cc,lr,ur}from"./chunk-93ft5jea.js";import{f}from"./chunk-b7e07ybq.js";import{Fs}from"./chunk-c3hr5mm2.js";import Q from"fs";import j from"path";import{loadConfigWithResult as Ht}from"bunfig";var B={duration:300,delay:0,ease:"ease",direction:"both"};function nt(e,r={}){let{duration:o,delay:l,ease:s,direction:c,custom:d}={...B,...r};if(e==="custom"&&d)return d;switch(e){case"fade":return`${c==="in"?"opacity: 0; animation: fadeIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":c==="out"?"opacity: 1; animation: fadeOut var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":"opacity: 1; transition: opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);"}
|
|
3
3
|
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
|
|
4
4
|
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }`;case"slide":return`${c==="in"?"transform: translateY(20px); opacity: 0; animation: slideIn var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":c==="out"?"transform: translateY(0); opacity: 1; animation: slideOut var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms) forwards;":"transform: translateY(0); opacity: 1; transition: transform var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms), opacity var(--stx-transition-duration, 300ms) var(--stx-transition-ease, ease) var(--stx-transition-delay, 0ms);"}
|
|
5
5
|
@keyframes slideIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
|
|
@@ -234,7 +234,7 @@ else {
|
|
|
234
234
|
</script>
|
|
235
235
|
`}var De={name:"transition",handler:(e,r,o,l)=>{if(r.length<1)return`<div class="stx-error">@transition directive requires at least a transition type</div>${e}`;let s=r[0],c=r.length>1?Number.parseInt(r[1],10)||B.duration:B.duration,d=r.length>2?r[2]||B.ease:B.ease,p=r.length>3?Number.parseInt(r[3],10)||B.delay:B.delay,u=r.length>4?r[4]||B.direction:B.direction,g=`stx-transition-${Math.random().toString(36).substr(2,9)}`,y=nt(s,{duration:c,delay:p,ease:d,direction:u}),h="stx-transition",v="";if(s==="fade")v="stx-fade";else if(s==="slide")v="stx-slide";else if(s==="scale")v="stx-scale";else if(s==="flip")v="stx-flip";else if(s==="rotate")v="stx-rotate";return`<div id="${g}" class="${h} ${v} ${u==="out"?"stx-out":""}"
|
|
236
236
|
style="--stx-transition-duration: ${c}ms; --stx-transition-ease: ${d}; --stx-transition-delay: ${p}ms;">${e}</div>`},hasEndTag:!0,description:"Applies transition effects to an element"},Pe={name:"scrollAnimate",handler:(e,r,o,l)=>{if(r.length<1)return`<div class="stx-error">@scrollAnimate directive requires at least an animation type</div>${e}`;let s=r[0],c=r.length>1?Number.parseInt(r[1],10)||300:300,d=r.length>2?r[2]||"ease":"ease",p=r.length>3?Number.parseFloat(r[3])||0.2:0.2,u=r.length>4?Number.parseInt(r[4],10)||0:0,g=`stx-scroll-${Math.random().toString(36).substr(2,9)}`,y=`--stx-transition-duration: ${c}ms; --stx-transition-ease: ${d}; --stx-transition-delay: ${u}ms; will-change: opacity, transform;`,h="stx-transition stx-observe stx-out";if(s==="fade")h+=" stx-fade";else if(s==="slide-up"||s==="slide")h+=" stx-from-bottom";else if(s==="slide-down")h+=" stx-from-top";else if(s==="slide-left")h+=" stx-from-right";else if(s==="slide-right")h+=" stx-from-left";else if(s==="scale")h+=" stx-scale";else if(s.includes("-"))h+=` stx-${s}`;else h+=` stx-${s}`;return`<div id="${g}" class="${h}" style="${y}" data-threshold="${p}">${e}</div>`},hasEndTag:!0,description:"Applies animations that trigger when scrolled into view"},ke={name:"animationGroup",handler:(e,r,o,l)=>{if(r.length<2)return`<div class="stx-error">@animationGroup directive requires a group name and at least one element selector</div>${e}`;let s=r[0],c=r.slice(1).map((g)=>g.startsWith("#")||g.startsWith(".")?g:`#${g}`),d=o.staggerDelay||50,p=o.sequence||!0,u=ct(s,c,{staggerDelay:d,sequence:p});return`${e}
|
|
237
|
-
${u}`},hasEndTag:!1,description:"Coordinates multiple animations together as a group"},Ae={name:"motion",handler:(e,r,o,l)=>{let s=r.length>0?r[0].toLowerCase()==="true":!0,c=it();return`<div data-animate="${s?"auto":"true"}">${e}</div>${c}`},hasEndTag:!0,description:"Controls motion and animation preferences"};function
|
|
237
|
+
${u}`},hasEndTag:!1,description:"Coordinates multiple animations together as a group"},Ae={name:"motion",handler:(e,r,o,l)=>{let s=r.length>0?r[0].toLowerCase()==="true":!0,c=it();return`<div data-animate="${s?"auto":"true"}">${e}</div>${c}`},hasEndTag:!0,description:"Controls motion and animation preferences"};function Ga(e,r,o,l){let s=e;if(l.animation?.enabled===!1)return s;let c=o.includes("test")&&o.includes("animation");if(!at(s)&&!c)return s;if(!s.includes('<style id="stx-animation-base">')){let p=lt();s=s.replace("</head>",`${p}
|
|
238
238
|
</head>`)}if(s.includes("stx-observe")){if(!s.includes("Intersection Observer for scroll animations")){let u=ot(),g=s.lastIndexOf("</body>");if(g!==-1)s=s.slice(0,g)+u+`
|
|
239
239
|
`+s.slice(g)}}return s}async function dt(e,r,o,l){let s=r[0]?.replace(/['"]/g,"")||"main",c=Ze();if(s!=="main")c=c.replace("container:'main'",`container:'${s}'`);return`<script data-stx-router>${c}</script>`}var _e={name:"stxRouter",handler:dt,hasEndTag:!1,description:"Inject the STX SPA router script for client-side navigation"};var ut={enabled:!1,trackMouse:!0,trackClicks:!0,trackScroll:!0,samplingRate:100,honorDnt:!0,batchSize:50,maxDataPoints:1000,sessionTimeout:30,persistData:!1,storagePrefix:"stx_heatmap",captureAttributes:["data-heatmap-id","data-track"],ignoreSelectors:["[data-heatmap-ignore]",".heatmap-ignore"],debugOverlay:!1};function Re(e){let r=e.heatmap;if(!r?.enabled)return"";let o={...ut,...r};return`
|
|
240
240
|
<!-- stx Heatmap - Privacy-Compliant Tracking -->
|
|
@@ -619,7 +619,7 @@ else {
|
|
|
619
619
|
};
|
|
620
620
|
})();
|
|
621
621
|
</script>
|
|
622
|
-
`}function
|
|
622
|
+
`}function Ka(e,r){let o=Re(r);if(!o)return e;let l=e.lastIndexOf("</body>");if(l!==-1)return e.slice(0,l)+o+e.slice(l);return e+o}var Oe={name:"heatmap",hasEndTag:!1,description:"Inject privacy-compliant heatmap tracking script",handler:async(e,r,o,l)=>{let s=o.__stx_config||{};if(r.length>0){let c=pt(r.join(" "));s.heatmap={...s.heatmap,...c,enabled:!0}}return Re(s)}};function pt(e){let r={},o=e.match(/(\w+)=["']?([^"'\s]+)["']?/g)||[];for(let l of o){let[s,c]=l.split("="),d=c?.replace(/["']/g,"");switch(s){case"endpoint":r.endpoint=d;break;case"samplingRate":r.samplingRate=Number.parseInt(d,10);break;case"batchSize":r.batchSize=Number.parseInt(d,10);break;case"trackMouse":r.trackMouse=d==="true";break;case"trackClicks":r.trackClicks=d==="true";break;case"trackScroll":r.trackScroll=d==="true";break;case"honorDnt":r.honorDnt=d==="true";break;case"debugOverlay":r.debugOverlay=d==="true";break}}return r}function J(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Ee(e){let r=e.trim().toLowerCase();return!r.startsWith("javascript:")&&!r.startsWith("vbscript:")&&!r.startsWith("data:text/html")}function or(e){let r=/^---\r?\n([\s\S]*?)\r?\n---\r?\n/,o=e.match(r);if(!o)return{data:{},content:e.trim()};let l=o[1],s=e.slice(o[0].length),c={};for(let d of l.split(`
|
|
623
623
|
`)){let p=d.trim();if(!p||p.startsWith("#"))continue;let u=p.indexOf(":");if(u===-1)continue;let g=p.slice(0,u).trim(),y=p.slice(u+1).trim();if(typeof y==="string"){if(y.startsWith('"')&&y.endsWith('"')||y.startsWith("'")&&y.endsWith("'"))y=y.slice(1,-1);else if(y.startsWith("[")&&y.endsWith("]"))try{y=JSON.parse(y)}catch{}else if(y==="true")y=!0;else if(y==="false")y=!1;else if(/^-?\d+(?:\.\d+)?$/.test(y))y=Number(y)}c[g]=y}return{data:c,content:s.trim()}}function Je(e,r={}){let{gfm:o=!0,breaks:l=!1}=r,s=e,c=[];if(s=s.replace(/```(\w*)\n([\s\S]*?)```/g,(y,h,v)=>{let b=c.length,x=h?` class="language-${J(h)}"`:"";return c.push(`<pre><code${x}>${J(v.trim())}</code></pre>`),`\x00CODEBLOCK${b}\x00`}),s=s.replace(/`([^`]*)`/g,(y,h)=>`<code>${J(h)}</code>`),s=s.replace(/^######\s+(.*)$/gm,"<h6>$1</h6>"),s=s.replace(/^#####\s+(.*)$/gm,"<h5>$1</h5>"),s=s.replace(/^####\s+(.*)$/gm,"<h4>$1</h4>"),s=s.replace(/^###\s+(.*)$/gm,"<h3>$1</h3>"),s=s.replace(/^##\s+(.*)$/gm,"<h2>$1</h2>"),s=s.replace(/^#\s+(.*)$/gm,"<h1>$1</h1>"),s=s.replace(/\*\*\*(.+?)\*\*\*/g,"<strong><em>$1</em></strong>"),s=s.replace(/___(.+?)___/g,"<strong><em>$1</em></strong>"),s=s.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>"),s=s.replace(/__(.+?)__/g,"<strong>$1</strong>"),s=s.replace(/\*(.+?)\*/g,"<em>$1</em>"),s=s.replace(/(?<![a-zA-Z0-9])_(.+?)_(?![a-zA-Z0-9])/g,"<em>$1</em>"),o)s=s.replace(/~~(.+?)~~/g,"<del>$1</del>");if(s=s.replace(/!\[([^\]]*)\]\(([^)]+)\)/g,(y,h,v)=>`<img src="${Ee(v)?J(v):""}" alt="${J(h)}" />`),s=s.replace(/\[([^\]]+)\]\(([^)]+)\)/g,(y,h,v)=>`<a href="${Ee(v)?J(v):""}">${h}</a>`),s=s.replace(/^(?:---|\*\*\*|___)\s*$/gm,"<hr />"),s=s.replace(/^>\s+(.*)$/gm,"<blockquote>$1</blockquote>"),s=s.replace(/<\/blockquote>\n<blockquote>/g,`
|
|
624
624
|
`),s=s.replace(/^[*\-+]\s+(.*)$/gm,"<li data-ul>$1</li>"),s=s.replace(/(<li data-ul>.*<\/li>\n?)+/g,"<ul>$&</ul>"),s=s.replace(/<\/ul>\n<ul>/g,""),s=s.replace(/^\d+\.\s+(.*)$/gm,"<li data-ol>$1</li>"),s=s.replace(/(<li data-ol>.*<\/li>\n?)+/g,"<ol>$&</ol>"),s=s.replace(/<\/ol>\n<ol>/g,""),s=s.replace(/<li data-ul>/g,"<li>"),s=s.replace(/<li data-ol>/g,"<li>"),o)s=s.replace(/^\|(.+)\|\s*\n\|[-:\s|]+\|\s*\n((?:\|.+\|\s*\n)*)/gm,(y,h,v)=>{let x=`<tr>${h.split("|").map((S)=>S.trim()).filter(Boolean).map((S)=>`<th>${J(S)}</th>`).join("")}</tr>`,P=v.trim().split(`
|
|
625
625
|
`).map((S)=>`<tr>${S.split("|").map((k)=>k.trim()).filter(Boolean).map((k)=>`<td>${J(k)}</td>`).join("")}</tr>`).join(`
|
|
@@ -1307,6 +1307,6 @@ ${y}
|
|
|
1307
1307
|
customElements.define('${r}', ${d});
|
|
1308
1308
|
`}async function Qe(e,r,o,l){if(r.length<1)return a("WebComponent","@webcomponent directive requires at least the tag name parameter",t.INVALID_DIRECTIVE_SYNTAX);let s=r[0].replace(/['"]/g,""),d=(o.__stx_options||{}).componentsDir||"components",p=q.isAbsolute(d)?[q.join(d,`${s}.stx`),q.join(q.dirname(l),`${s}.stx`)]:[q.join(q.dirname(l),d,`${s}.stx`),q.join(process.cwd(),d,`${s}.stx`),q.join(q.dirname(l),`${s}.stx`)],u=null;for(let h of p)if(await n(h)){u=await Bun.file(h).text();break}if(!u)return a("WebComponent",`Component file not found: ${s}.stx`,t.FILE_NOT_FOUND);let g=Ft(u,s);return`<script type="module">
|
|
1309
1309
|
${qt(g)}
|
|
1310
|
-
</script>`}var N={enabled:!0,ssr:!1,partialsDir:"partials",componentsDir:"components",layoutsDir:"layouts",defaultLayout:"default",debug:!1,cache:!0,stateDir:on,cachePath:".stx/cache",cacheVersion:"1.0.0",componentRenderCacheBytes:33554432,build:{pagesDir:"pages",outputDir:"dist",baseUrl:"/",sitemap:!0,minify:!0,cache:!0,cacheDir:".stx/ssg-cache",concurrency:10,generate404:!0,publicDir:"public",trailingSlash:!1,cleanOutput:!0},customDirectives:[{name:"markdown",handler:Ie,hasEndTag:!0,description:"Render markdown content to HTML"},{name:"webcomponent",handler:Qe,hasEndTag:!1,description:"Include a web component in the template"},Qa,ec,cs,ls,De,ke,Ae,Pe,_e,Oe,Fe,$e,...Fs],middleware:[],i18n:{defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},webComponents:{enabled:!1,outputDir:"dist/web-components",components:[]},docs:{enabled:!1,outputDir:"docs",format:"markdown",components:!0,templates:!0,directives:!0},streaming:{enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},hydration:{enabled:!1,mode:"islands",clientEntry:"src/client.ts",autoMarkers:!0,preload:"lazy"},router:{enabled:!0,container:"main",linkSelector:"a[href]",viewTransitions:!0,scrollToTop:!0,scrollRestoration:!0,prefetch:!0,cache:!0,cacheTTL:300000,skipSelectors:'[data-no-router], [target="_blank"]',viewTransitionCSS:{oldRoot:"fade-out 0.15s ease-in",newRoot:"fade-in 0.2s ease-out",oldContent:"slide-out 0.2s ease-in",newContent:"slide-in 0.25s ease-out"}},a11y:{enabled:!0,addSrOnlyStyles:!0,level:"AA",autoFix:!1,ignoreChecks:[]},seo:{enabled:!0,socialPreview:!0,defaultConfig:{title:"stx Project",description:"A website built with stx templating engine"}},animation:{enabled:!0,defaultDuration:300,defaultEase:"ease",respectMotionPreferences:!0,staggerDelay:50},markdown:{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0,additionalThemes:["light-plus","one-dark-pro","dracula","monokai","solarized-light","nord","github-dark"]}},loops:{maxWhileIterations:1000,useAltLoopVariable:!1},story:{enabled:!0,outDir:".stx/dist/story",storyMatch:["**/*.story.stx"],storyIgnored:["**/node_modules/**","**/dist/**","**/.stx/**"],port:6006},pwa:{enabled:!1,manifest:{name:"stx App",shortName:"stx",description:"A Progressive Web App built with stx",startUrl:"/",display:"standalone",orientation:"any",themeColor:"#000000",backgroundColor:"#ffffff",scope:"/"},icons:{src:"public/icon.png",sizes:[72,96,128,144,152,192,384,512],generateWebP:!0,generateAppleIcons:!0,outputDir:"pwa-icons",purpose:["any","maskable"]},routes:[{pattern:"/",strategy:"network-first"},{pattern:"/static/*",strategy:"cache-first",maxAgeSeconds:2592000},{pattern:"/api/*",strategy:"network-only"},{pattern:"*.js",strategy:"stale-while-revalidate"},{pattern:"*.css",strategy:"stale-while-revalidate"},{pattern:"*.png",strategy:"cache-first"},{pattern:"*.jpg",strategy:"cache-first"},{pattern:"*.webp",strategy:"cache-first"},{pattern:"*.svg",strategy:"cache-first"}],offline:{enabled:!0,fallbackTitle:"You are offline",fallbackMessage:"Please check your internet connection and try again.",precacheAssets:[]},serviceWorker:{fileName:"sw.js",cacheVersion:"1.0.0",skipWaiting:!0,clientsClaim:!0,navigationPreload:!1,excludeRoutes:["/api/auth/*"],cacheFileTypes:["html","css","js","png","jpg","jpeg","webp","svg","woff","woff2"],useWorkbox:!1},autoInject:!0,push:{enabled:!1,defaultOptions:{vibrate:[100,50,100],requireInteraction:!1}},backgroundSync:{enabled:!1,queueName:"stx-sync-queue",maxRetentionMinutes:1440,maxRetries:3,minInterval:1000,forms:[],endpoints:[]},shareTarget:{enabled:!1,action:"/share-target",method:"POST",enctype:"multipart/form-data",params:{title:"title",text:"text",url:"url"}},fileHandlers:{enabled:!1},protocolHandlers:[],cacheStorage:{maxSize:100,maxEntries:500,maxAge:30,purgeStrategy:"lru"},updates:{enabled:!0,promptUser:!0,autoReload:!1,message:"A new version is available. Reload to update?"},precache:{enabled:!0,includeHtml:!0,includeJs:!0,includeCss:!0,includeImages:!0,includeFonts:!0,include:[],exclude:["*.map","*.LICENSE.txt"],maxFileSizeKB:500}},media:{enabled:!0,image:{enabled:!0,defaultWidths:[320,480,640,768,1024,1280,1536,1920],defaultFormats:["avif","webp","jpeg"],defaultQuality:80,placeholderStrategy:"thumbhash",lazyByDefault:!0,enableDpr:!0,defaultDpr:[1,2,3],tsImages:{enabled:!0,outputDir:"dist/images",baseUrl:"/images",formatQuality:{jpeg:{quality:85,mozjpeg:!0,progressive:!0},png:{compressionLevel:9,palette:!1},webp:{quality:82,effort:5,smartSubsample:!0},avif:{quality:75,effort:4,lossless:!1}},breakpoints:[320,480,640,768,1024,1280,1536,1920],batchOptions:{concurrency:4,optimizationPreset:"web"}}},video:{enabled:!0,lazyByDefault:!0,defaultControls:!0,tsVideos:{enabled:!0,outputDir:"dist/videos",baseUrl:"/videos",defaultQuality:"high",streaming:{enabled:!0,format:"hls",segmentDuration:6,defaultQualities:[{label:"1080p",width:1920,height:1080,bitrate:5000000,audioBitrate:192000},{label:"720p",width:1280,height:720,bitrate:2500000,audioBitrate:128000},{label:"480p",width:854,height:480,bitrate:1e6,audioBitrate:96000}]},thumbnails:{enabled:!0,count:10,format:"webp",width:320},transcoding:{defaultCodec:"h264",defaultAudioCodec:"aac",speedPreset:"medium"}}},upload:{enabled:!0,maxSize:10485760,allowedTypes:["image/*","video/*","audio/*","application/pdf"],maxConcurrent:3},protected:{enabled:!0,expirationSeconds:3600,batchSize:10},cache:{enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500}},broadcasting:{enabled:!1,driver:"bun",host:"0.0.0.0",port:6001,scheme:"ws",verbose:!1}};function Ut(e,r,o){let l=r||"pages";if(e)return{root:e,pagesDir:l};let s=o||process.cwd(),c=j.join(s,"resources","views"),d=j.join(s,"resources","layouts");if(Q.existsSync(c)&&Q.existsSync(d))return{root:"resources",pagesDir:"views"};let p=j.join(s,"resources","views","pages");if(Q.existsSync(p))return{root:"resources/views",pagesDir:l};return{root:".",pagesDir:l}}var et=new Set,ue=["partialsDir","componentsDir","layoutsDir"],Se=new WeakMap;function Bt(e,r){let o=r.replace(/[\\/]+$/,"");if(!o||o===".")return!0;let l=e.replace(/\\/g,"/"),s=o.replace(/\\/g,"/");return l===s||l.startsWith(`${s}/`)}function bf(e,r){let o=!e.root,l=Ut(e.root,e.pagesDir,r);if(e.root=l.root,e.pagesDir=l.pagesDir,o&&l.root!=="."){let s=`${r}::${l.root}`;if(!et.has(s))et.add(s),console.warn(`[stx] No "root" in config \u2014 inferred "${l.root}" from the project layout. Template directories are resolved under it; set root explicitly to pin this.`)}if(!Se.has(e)){let s={};for(let c of ue){let d=e[c];if(typeof d==="string"&&d)s[c]=d}Se.set(e,s)}if(e.root&&e.root!=="."){let s=e.root;for(let c of ue){let d=e[c];if(typeof d!=="string"||!d)continue;if(j.isAbsolute(d)||Bt(d,s))continue;e[c]=j.join(s,d)}}for(let s of ue){let c=e[s];if(typeof c!=="string"||!c||j.isAbsolute(c))continue;e[s]=j.resolve(r,c)}return e}function Jt(e,r){let o=Se.get(e);for(let l of ue){let s=e[l];if(typeof s!=="string"||!s)continue;let c=j.isAbsolute(s)?s:j.join(r,s);if(Q.existsSync(c))continue;let d=o?.[l]??s,p=e.root,u=!!p&&p!==".";console.warn(`[stx] ${String(l)} resolves to "${c}", which does not exist. Configured as "${d}"`+(u?`, resolved under root "${p}".`:"."))}}function Kt(e){if(e.customDirectives)e.customDirectives=[...e.customDirectives];if(e.middleware)e.middleware=[...e.middleware];if(e.apiRoutes)e.apiRoutes={...e.apiRoutes}}function Gt(e){if(cc(e.stateDir),e.stateDir=lr(),e.cachePath=ur(e.cachePath),e.build)e.build.cacheDir=ur(e.build.cacheDir);if(e.media?.cache)e.media.cache.directory=ur(e.media.cache.directory);if(e.story)e.story.outDir=ur(e.story.outDir)}var K=null,Y=new Map,de=new Map,se=null;async function Po(e,r=Ht){try{return await r(e)}catch(o){if(o instanceof Error&&o.name==="ConfigNotFoundError")return{config:e.defaultConfig};throw o}}async function i(e){let r=e?j.resolve(e):process.cwd(),o=de.get(r);if(o&&o.signature!==is(o.graph)){let c=Y.get(r);if(Y.delete(r),de.delete(r),!e)K=null,se=null;let{clearComponentCache:d}=await import("./chunk-q48wtyq6.js"),{partialsCache:p}=await import("./chunk-v55m619e.js");if(d(),p.clear(),c&&o.configSignature===as(o.graph)){let u=c.then(async(g)=>{let y={...o.graph};await Oo(y,r),de.set(r,{graph:y,signature:is(y),configSignature:as(y)});let h={...g,_layerGraph:y};if(!e)K=h;return h});return Y.set(r,u),u}}if(!e){if(K)return K;if(se)return se}let l=Y.get(r);if(l)return l;let s=(async()=>{let c=[".ts",".js",".mjs",".cjs",".json"],d=c.some((v)=>Q.existsSync(j.join(r,`stx.config${v}`))),p=c.some((v)=>Q.existsSync(j.join(r,"config",`ui${v}`))),u;if(d&&p){let v=await Po({name:"ui",cwd:j.join(r,"config"),defaultConfig:N,errorPolicy:"throw",verbose:!1});u=(await Po({name:"stx",alias:"ui",cwd:r,defaultConfig:v.config,errorPolicy:"throw",verbose:!1})).config}else u=(await Po({name:"stx",alias:"ui",cwd:r,defaultConfig:N,errorPolicy:"throw",verbose:!1})).config;if(u.extends!==void 0||o){let v=await nc(r,N);u=v.config,de.set(r,{graph:v.graph,signature:is(v.graph),configSignature:as(v.graph)})}if(u.runtimeConfig){let{resolveRuntimeConfig:v}=await import("./chunk-68wezwr7.js");v(u.runtimeConfig,{});let{generateRuntimeConfigTypes:b}=await import("./chunk-pwwv06bk.js");await b(r,u.runtimeConfig)}Kt(u),Gt(u),bf(u,r),Jt(u,r);let g=[],y=new Set((u.plugins??[]).map((v)=>typeof v==="string"?v:v[0]));for(let v of u.componentPackages??["@stacksjs/components"]){let b=`${v}/stx-plugin`;if(y.has(b)||y.has(v))continue;try{f.resolve(b,{paths:[r]}),g.push(b)}catch{}}let h=[...u.plugins??[],...g];if(h.length>0){let{pluginManager:v}=await import("./chunk-dpjs0ajs.js"),b=[],x=[];for(let P of h){let S=typeof P==="string"?P:P[0],A=typeof P==="string"?{}:P[1]||{};try{let k,E;try{let w=f.resolve(S,{paths:[r]});k=await import(w),E=j.dirname(w)}catch{let w=j.resolve(r,S);k=await import(w),E=j.dirname(w)}let I=k.default||k;if(!v.has(I.name))await v.register(I,u);if(I.components){let w=Array.isArray(I.components)?I.components:[I.components];for(let C of w)b.push(j.resolve(E,C))}if(I.pages){let w=j.resolve(E,I.pages),C=A.path||"/";x.push({dir:w,prefix:C})}if(I.setup){let w={addDirective:(C)=>{u.customDirectives=u.customDirectives||[],u.customDirectives.push(C)},addRoute:(C,D)=>{u.apiRoutes=u.apiRoutes||{},u.apiRoutes[C]=D},addMiddleware:(C)=>{u.middleware=u.middleware||[],u.middleware.push(C)},pluginDir:E,config:u};await I.setup(A,w)}process.stderr.write(`[stx] Plugin loaded: ${I.name||S}
|
|
1310
|
+
</script>`}var N={enabled:!0,ssr:!1,partialsDir:"partials",componentsDir:"components",layoutsDir:"layouts",defaultLayout:"default",debug:!1,cache:!0,stateDir:on,cachePath:".stx/cache",cacheVersion:"1.0.0",componentRenderCacheBytes:33554432,build:{pagesDir:"pages",outputDir:"dist",baseUrl:"/",sitemap:!0,minify:!0,cache:!0,cacheDir:".stx/ssg-cache",concurrency:10,generate404:!0,publicDir:"public",trailingSlash:!1,cleanOutput:!0},customDirectives:[{name:"markdown",handler:Ie,hasEndTag:!0,description:"Render markdown content to HTML"},{name:"webcomponent",handler:Qe,hasEndTag:!1,description:"Include a web component in the template"},Qa,ec,cs,ls,De,ke,Ae,Pe,_e,Oe,Fe,$e,...Fs],middleware:[],i18n:{defaultLocale:"en",locale:"en",translationsDir:"translations",format:"yaml",fallbackToKey:!0,cache:!0},webComponents:{enabled:!1,outputDir:"dist/web-components",components:[]},docs:{enabled:!1,outputDir:"docs",format:"markdown",components:!0,templates:!0,directives:!0},streaming:{enabled:!0,bufferSize:16384,strategy:"auto",timeout:30000},hydration:{enabled:!1,mode:"islands",clientEntry:"src/client.ts",autoMarkers:!0,preload:"lazy"},router:{enabled:!0,container:"main",linkSelector:"a[href]",viewTransitions:!0,scrollToTop:!0,scrollRestoration:!0,prefetch:!0,cache:!0,cacheTTL:300000,skipSelectors:'[data-no-router], [target="_blank"]',viewTransitionCSS:{oldRoot:"fade-out 0.15s ease-in",newRoot:"fade-in 0.2s ease-out",oldContent:"slide-out 0.2s ease-in",newContent:"slide-in 0.25s ease-out"}},a11y:{enabled:!0,addSrOnlyStyles:!0,level:"AA",autoFix:!1,ignoreChecks:[]},seo:{enabled:!0,socialPreview:!0,defaultConfig:{title:"stx Project",description:"A website built with stx templating engine"}},animation:{enabled:!0,defaultDuration:300,defaultEase:"ease",respectMotionPreferences:!0,staggerDelay:50},markdown:{enabled:!0,syntaxHighlighting:{enabled:!0,serverSide:!0,defaultTheme:"github-dark",highlightUnknownLanguages:!0,additionalThemes:["light-plus","one-dark-pro","dracula","monokai","solarized-light","nord","github-dark"]}},loops:{maxWhileIterations:1000,useAltLoopVariable:!1},story:{enabled:!0,outDir:".stx/dist/story",storyMatch:["**/*.story.stx"],storyIgnored:["**/node_modules/**","**/dist/**","**/.stx/**"],port:6006},pwa:{enabled:!1,manifest:{name:"stx App",shortName:"stx",description:"A Progressive Web App built with stx",startUrl:"/",display:"standalone",orientation:"any",themeColor:"#000000",backgroundColor:"#ffffff",scope:"/"},icons:{src:"public/icon.png",sizes:[72,96,128,144,152,192,384,512],generateWebP:!0,generateAppleIcons:!0,outputDir:"pwa-icons",purpose:["any","maskable"]},routes:[{pattern:"/",strategy:"network-first"},{pattern:"/static/*",strategy:"cache-first",maxAgeSeconds:2592000},{pattern:"/api/*",strategy:"network-only"},{pattern:"*.js",strategy:"stale-while-revalidate"},{pattern:"*.css",strategy:"stale-while-revalidate"},{pattern:"*.png",strategy:"cache-first"},{pattern:"*.jpg",strategy:"cache-first"},{pattern:"*.webp",strategy:"cache-first"},{pattern:"*.svg",strategy:"cache-first"}],offline:{enabled:!0,fallbackTitle:"You are offline",fallbackMessage:"Please check your internet connection and try again.",precacheAssets:[]},serviceWorker:{fileName:"sw.js",cacheVersion:"1.0.0",skipWaiting:!0,clientsClaim:!0,navigationPreload:!1,excludeRoutes:["/api/auth/*"],cacheFileTypes:["html","css","js","png","jpg","jpeg","webp","svg","woff","woff2"],useWorkbox:!1},autoInject:!0,push:{enabled:!1,defaultOptions:{vibrate:[100,50,100],requireInteraction:!1}},backgroundSync:{enabled:!1,queueName:"stx-sync-queue",maxRetentionMinutes:1440,maxRetries:3,minInterval:1000,forms:[],endpoints:[]},shareTarget:{enabled:!1,action:"/share-target",method:"POST",enctype:"multipart/form-data",params:{title:"title",text:"text",url:"url"}},fileHandlers:{enabled:!1},protocolHandlers:[],cacheStorage:{maxSize:100,maxEntries:500,maxAge:30,purgeStrategy:"lru"},updates:{enabled:!0,promptUser:!0,autoReload:!1,message:"A new version is available. Reload to update?"},precache:{enabled:!0,includeHtml:!0,includeJs:!0,includeCss:!0,includeImages:!0,includeFonts:!0,include:[],exclude:["*.map","*.LICENSE.txt"],maxFileSizeKB:500}},media:{enabled:!0,image:{enabled:!0,defaultWidths:[320,480,640,768,1024,1280,1536,1920],defaultFormats:["avif","webp","jpeg"],defaultQuality:80,placeholderStrategy:"thumbhash",lazyByDefault:!0,enableDpr:!0,defaultDpr:[1,2,3],tsImages:{enabled:!0,outputDir:"dist/images",baseUrl:"/images",formatQuality:{jpeg:{quality:85,mozjpeg:!0,progressive:!0},png:{compressionLevel:9,palette:!1},webp:{quality:82,effort:5,smartSubsample:!0},avif:{quality:75,effort:4,lossless:!1}},breakpoints:[320,480,640,768,1024,1280,1536,1920],batchOptions:{concurrency:4,optimizationPreset:"web"}}},video:{enabled:!0,lazyByDefault:!0,defaultControls:!0,tsVideos:{enabled:!0,outputDir:"dist/videos",baseUrl:"/videos",defaultQuality:"high",streaming:{enabled:!0,format:"hls",segmentDuration:6,defaultQualities:[{label:"1080p",width:1920,height:1080,bitrate:5000000,audioBitrate:192000},{label:"720p",width:1280,height:720,bitrate:2500000,audioBitrate:128000},{label:"480p",width:854,height:480,bitrate:1e6,audioBitrate:96000}]},thumbnails:{enabled:!0,count:10,format:"webp",width:320},transcoding:{defaultCodec:"h264",defaultAudioCodec:"aac",speedPreset:"medium"}}},upload:{enabled:!0,maxSize:10485760,allowedTypes:["image/*","video/*","audio/*","application/pdf"],maxConcurrent:3},protected:{enabled:!0,expirationSeconds:3600,batchSize:10},cache:{enabled:!0,directory:".stx/media-cache",maxAge:30,maxSize:500}},broadcasting:{enabled:!1,driver:"bun",host:"0.0.0.0",port:6001,scheme:"ws",verbose:!1}};function Ut(e,r,o){let l=r||"pages";if(e)return{root:e,pagesDir:l};let s=o||process.cwd(),c=j.join(s,"resources","views"),d=j.join(s,"resources","layouts");if(Q.existsSync(c)&&Q.existsSync(d))return{root:"resources",pagesDir:"views"};let p=j.join(s,"resources","views","pages");if(Q.existsSync(p))return{root:"resources/views",pagesDir:l};return{root:".",pagesDir:l}}var et=new Set,ue=["partialsDir","componentsDir","layoutsDir"],Se=new WeakMap;function Bt(e,r){let o=r.replace(/[\\/]+$/,"");if(!o||o===".")return!0;let l=e.replace(/\\/g,"/"),s=o.replace(/\\/g,"/");return l===s||l.startsWith(`${s}/`)}function bf(e,r){let o=!e.root,l=Ut(e.root,e.pagesDir,r);if(e.root=l.root,e.pagesDir=l.pagesDir,o&&l.root!=="."){let s=`${r}::${l.root}`;if(!et.has(s))et.add(s),console.warn(`[stx] No "root" in config \u2014 inferred "${l.root}" from the project layout. Template directories are resolved under it; set root explicitly to pin this.`)}if(!Se.has(e)){let s={};for(let c of ue){let d=e[c];if(typeof d==="string"&&d)s[c]=d}Se.set(e,s)}if(e.root&&e.root!=="."){let s=e.root;for(let c of ue){let d=e[c];if(typeof d!=="string"||!d)continue;if(j.isAbsolute(d)||Bt(d,s))continue;e[c]=j.join(s,d)}}for(let s of ue){let c=e[s];if(typeof c!=="string"||!c||j.isAbsolute(c))continue;e[s]=j.resolve(r,c)}return e}function Jt(e,r){let o=Se.get(e);for(let l of ue){let s=e[l];if(typeof s!=="string"||!s)continue;let c=j.isAbsolute(s)?s:j.join(r,s);if(Q.existsSync(c))continue;let d=o?.[l]??s,p=e.root,u=!!p&&p!==".";console.warn(`[stx] ${String(l)} resolves to "${c}", which does not exist. Configured as "${d}"`+(u?`, resolved under root "${p}".`:"."))}}function Kt(e){if(e.customDirectives)e.customDirectives=[...e.customDirectives];if(e.middleware)e.middleware=[...e.middleware];if(e.apiRoutes)e.apiRoutes={...e.apiRoutes}}function Gt(e){if(cc(e.stateDir),e.stateDir=lr(),e.cachePath=ur(e.cachePath),e.build)e.build.cacheDir=ur(e.build.cacheDir);if(e.media?.cache)e.media.cache.directory=ur(e.media.cache.directory);if(e.story)e.story.outDir=ur(e.story.outDir)}var K=null,Y=new Map,de=new Map,se=null;async function Po(e,r=Ht){try{return await r(e)}catch(o){if(o instanceof Error&&o.name==="ConfigNotFoundError")return{config:e.defaultConfig};throw o}}async function i(e){let r=e?j.resolve(e):process.cwd(),o=de.get(r);if(o&&o.signature!==is(o.graph)){let c=Y.get(r);if(Y.delete(r),de.delete(r),!e)K=null,se=null;let{clearComponentCache:d}=await import("./chunk-cr1xkjg5.js"),{partialsCache:p}=await import("./chunk-wsdqxpjh.js");if(d(),p.clear(),c&&o.configSignature===as(o.graph)){let u=c.then(async(g)=>{let y={...o.graph};await Oo(y,r),de.set(r,{graph:y,signature:is(y),configSignature:as(y)});let h={...g,_layerGraph:y};if(!e)K=h;return h});return Y.set(r,u),u}}if(!e){if(K)return K;if(se)return se}let l=Y.get(r);if(l)return l;let s=(async()=>{let c=[".ts",".js",".mjs",".cjs",".json"],d=c.some((v)=>Q.existsSync(j.join(r,`stx.config${v}`))),p=c.some((v)=>Q.existsSync(j.join(r,"config",`ui${v}`))),u;if(d&&p){let v=await Po({name:"ui",cwd:j.join(r,"config"),defaultConfig:N,errorPolicy:"throw",verbose:!1});u=(await Po({name:"stx",alias:"ui",cwd:r,defaultConfig:v.config,errorPolicy:"throw",verbose:!1})).config}else u=(await Po({name:"stx",alias:"ui",cwd:r,defaultConfig:N,errorPolicy:"throw",verbose:!1})).config;if(u.extends!==void 0||o){let v=await nc(r,N);u=v.config,de.set(r,{graph:v.graph,signature:is(v.graph),configSignature:as(v.graph)})}if(u.runtimeConfig){let{resolveRuntimeConfig:v}=await import("./chunk-68wezwr7.js");v(u.runtimeConfig,{});let{generateRuntimeConfigTypes:b}=await import("./chunk-2f7d7mjb.js");await b(r,u.runtimeConfig)}Kt(u),Gt(u),bf(u,r),Jt(u,r);let g=[],y=new Set((u.plugins??[]).map((v)=>typeof v==="string"?v:v[0]));for(let v of u.componentPackages??["@stacksjs/components"]){let b=`${v}/stx-plugin`;if(y.has(b)||y.has(v))continue;try{f.resolve(b,{paths:[r]}),g.push(b)}catch{}}let h=[...u.plugins??[],...g];if(h.length>0){let{pluginManager:v}=await import("./chunk-dpjs0ajs.js"),b=[],x=[];for(let P of h){let S=typeof P==="string"?P:P[0],A=typeof P==="string"?{}:P[1]||{};try{let k,E;try{let w=f.resolve(S,{paths:[r]});k=await import(w),E=j.dirname(w)}catch{let w=j.resolve(r,S);k=await import(w),E=j.dirname(w)}let I=k.default||k;if(!v.has(I.name))await v.register(I,u);if(I.components){let w=Array.isArray(I.components)?I.components:[I.components];for(let C of w)b.push(j.resolve(E,C))}if(I.pages){let w=j.resolve(E,I.pages),C=A.path||"/";x.push({dir:w,prefix:C})}if(I.setup){let w={addDirective:(C)=>{u.customDirectives=u.customDirectives||[],u.customDirectives.push(C)},addRoute:(C,D)=>{u.apiRoutes=u.apiRoutes||{},u.apiRoutes[C]=D},addMiddleware:(C)=>{u.middleware=u.middleware||[],u.middleware.push(C)},pluginDir:E,config:u};await I.setup(A,w)}process.stderr.write(`[stx] Plugin loaded: ${I.name||S}
|
|
1311
1311
|
`)}catch(k){console.warn(`[stx] Failed to load plugin ${S}:`,k.message)}}u._pluginComponentDirs=b,u._pluginPageDirs=x}return u})();if(Y.set(r,s),s.catch(()=>{if(Y.get(r)===s)Y.delete(r)}),!e)se=s,s.then((c)=>{K=c}).catch(()=>{});return s}var R=new Proxy(N,{get(e,r){if(K&&r in K)return K[r];if(!se)i().catch((o)=>{console.warn("[stx] Failed to load config file:",o?.message||o)});return e[r]}});function uh(e){return e}function dh(e){let r=[],o=[];if(e.partialsDir!==void 0&&typeof e.partialsDir!=="string")r.push({path:"partialsDir",message:"partialsDir must be a string",severity:"error"});if(e.componentsDir!==void 0&&typeof e.componentsDir!=="string")r.push({path:"componentsDir",message:"componentsDir must be a string",severity:"error"});if(e.cache!==void 0&&typeof e.cache!=="boolean")r.push({path:"cache",message:"cache must be a boolean",severity:"error"});if(e.debug!==void 0&&typeof e.debug!=="boolean")r.push({path:"debug",message:"debug must be a boolean",severity:"error"});if(e.streaming){if(e.streaming.bufferSize!==void 0){if(typeof e.streaming.bufferSize!=="number"||e.streaming.bufferSize<=0)r.push({path:"streaming.bufferSize",message:"streaming.bufferSize must be a positive number",severity:"error"})}if(e.streaming.timeout!==void 0){if(typeof e.streaming.timeout!=="number"||e.streaming.timeout<=0)r.push({path:"streaming.timeout",message:"streaming.timeout must be a positive number",severity:"error"})}if(e.streaming.strategy!==void 0){let l=["auto","manual","sections"];if(!l.includes(e.streaming.strategy))r.push({path:"streaming.strategy",message:`streaming.strategy must be one of: ${l.join(", ")}`,severity:"error"})}}if(e.i18n){if(e.i18n.format!==void 0){let l=["json","yaml","yml","js"];if(!l.includes(e.i18n.format))r.push({path:"i18n.format",message:`i18n.format must be one of: ${l.join(", ")}`,severity:"error"})}}if(e.animation){if(e.animation.defaultDuration!==void 0){if(typeof e.animation.defaultDuration!=="number"||e.animation.defaultDuration<0)r.push({path:"animation.defaultDuration",message:"animation.defaultDuration must be a non-negative number",severity:"error"})}if(e.animation.staggerDelay!==void 0){if(typeof e.animation.staggerDelay!=="number"||e.animation.staggerDelay<0)r.push({path:"animation.staggerDelay",message:"animation.staggerDelay must be a non-negative number",severity:"error"})}}if(e.a11y){if(e.a11y.level!==void 0){let l=["AA","AAA"];if(!l.includes(e.a11y.level))r.push({path:"a11y.level",message:`a11y.level must be one of: ${l.join(", ")}`,severity:"error"})}}if(e.hydration){if(e.hydration.mode!==void 0){let l=["progressive","islands"];if(!l.includes(e.hydration.mode))r.push({path:"hydration.mode",message:`hydration.mode must be one of: ${l.join(", ")}`,severity:"error"})}if(e.hydration.preload!==void 0){let l=["none","eager","lazy"];if(!l.includes(e.hydration.preload))r.push({path:"hydration.preload",message:`hydration.preload must be one of: ${l.join(", ")}`,severity:"error"})}}if(e.customDirectives)if(!Array.isArray(e.customDirectives))r.push({path:"customDirectives",message:"customDirectives must be an array",severity:"error"});else e.customDirectives.forEach((l,s)=>{if(!l.name||typeof l.name!=="string")r.push({path:`customDirectives[${s}].name`,message:"Custom directive must have a name string",severity:"error"});if(!l.handler||typeof l.handler!=="function")r.push({path:`customDirectives[${s}].handler`,message:"Custom directive must have a handler function",severity:"error"})});if(e.middleware)if(!Array.isArray(e.middleware))r.push({path:"middleware",message:"middleware must be an array",severity:"error"});else e.middleware.forEach((l,s)=>{if(!l.name||typeof l.name!=="string")r.push({path:`middleware[${s}].name`,message:"Middleware must have a name string",severity:"error"});if(!l.handler||typeof l.handler!=="function")r.push({path:`middleware[${s}].handler`,message:"Middleware must have a handler function",severity:"error"});if(!l.timing||!["before","after"].includes(l.timing))r.push({path:`middleware[${s}].timing`,message:'Middleware timing must be "before" or "after"',severity:"error"})});if(e.debug===!0&&e.cache===!0)o.push({path:"debug+cache",message:"Debug mode with caching enabled may show stale content during development",severity:"warning"});if(e.seo?.enabled===!0&&!e.seo?.defaultConfig?.title)o.push({path:"seo.defaultConfig.title",message:"SEO is enabled but no default title is set",severity:"warning"});if(e.pwa){if(e.pwa.enabled===!0&&!e.pwa.manifest?.name)r.push({path:"pwa.manifest.name",message:"PWA manifest name is required when PWA is enabled",severity:"error"});if(e.pwa.manifest?.display!==void 0){let l=["fullscreen","standalone","minimal-ui","browser"];if(!l.includes(e.pwa.manifest.display))r.push({path:"pwa.manifest.display",message:`PWA display must be one of: ${l.join(", ")}`,severity:"error"})}if(e.pwa.manifest?.orientation!==void 0){let l=["portrait","landscape","any","portrait-primary","portrait-secondary","landscape-primary","landscape-secondary"];if(!l.includes(e.pwa.manifest.orientation))r.push({path:"pwa.manifest.orientation",message:`PWA orientation must be one of: ${l.join(", ")}`,severity:"error"})}if(e.pwa.routes){let l=["cache-first","network-first","stale-while-revalidate","network-only","cache-only"];e.pwa.routes.forEach((s,c)=>{if(!s.pattern||typeof s.pattern!=="string")r.push({path:`pwa.routes[${c}].pattern`,message:"PWA route must have a pattern string",severity:"error"});if(!l.includes(s.strategy))r.push({path:`pwa.routes[${c}].strategy`,message:`PWA route strategy must be one of: ${l.join(", ")}`,severity:"error"});if(s.maxAgeSeconds!==void 0&&(typeof s.maxAgeSeconds!=="number"||s.maxAgeSeconds<0))r.push({path:`pwa.routes[${c}].maxAgeSeconds`,message:"PWA route maxAgeSeconds must be a non-negative number",severity:"error"});if(s.maxEntries!==void 0&&(typeof s.maxEntries!=="number"||s.maxEntries<1))r.push({path:`pwa.routes[${c}].maxEntries`,message:"PWA route maxEntries must be a positive number",severity:"error"})})}if(e.pwa.icons?.sizes){if(!Array.isArray(e.pwa.icons.sizes))r.push({path:"pwa.icons.sizes",message:"PWA icon sizes must be an array of numbers",severity:"error"});else if(e.pwa.icons.sizes.filter((s)=>typeof s!=="number"||s<16||s>1024).length>0)r.push({path:"pwa.icons.sizes",message:"PWA icon sizes must be numbers between 16 and 1024",severity:"error"})}if(e.pwa.icons?.purpose){let l=["any","maskable","monochrome"];if(e.pwa.icons.purpose.filter((c)=>!l.includes(c)).length>0)r.push({path:"pwa.icons.purpose",message:`PWA icon purpose must be one of: ${l.join(", ")}`,severity:"error"})}if(e.pwa.enabled===!0&&!e.pwa.icons?.src)o.push({path:"pwa.icons.src",message:"PWA is enabled but no icon source specified. Provide a 512x512 PNG for best results.",severity:"warning"});if(e.pwa.enabled===!0&&!e.pwa.manifest?.themeColor)o.push({path:"pwa.manifest.themeColor",message:"PWA theme color not set, defaulting to black",severity:"warning"})}return{valid:r.length===0,errors:r,warnings:o}}
|
|
1312
|
-
export{Ka,
|
|
1312
|
+
export{Ga,Ka,or,Je,Xa,os,N,bf,Po,i,R,uh,dh};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Gl,oo,zn,Kl,Xl,Jl,Yl,Zl,Ql,eu,tu,nu,ru,su,ou,iu,au,cu,lu,uu,du,pu,fu,gu,mu,hu,yu,bu,vu,wu,xu,Su,ku,_u,Cu,Eu,Tu,$u,Ru,Au,Pu,Iu,Ou,Nu,Du,Mu,Lu,ju,Gt,pa,Bu,Fu,zu,fa,Hu,Vu,Uu,Wu,qu,Gu,ga,Ku,Xu,Ju,Yu,Zu,Qu,ed,td,nd,Hn,rd,sd,od,id,ad,cd,ld,ud,dd,pd,fd,gd,io,md,hd,yd,bd,vd,Hr,wd,xd,Sd,kd,_d,ma,Cd,Ed,Td,ha,ao,$d,Rd,ya,ba,va,wa,Ad,Vr,Pd,xa,Sa,Id,Od,co,Nd,Dd,Md,Ld,jd,Bd,Fd,ka,zd,Hd,_a,Vd,Ud,Wd,qd,Gd,Kd,Xd,Jd,Yd,Zd,Qd,ep,tp,np,rp,sp,op,ip,ap,cp,lp,up,dp,pp,Ca,fp,gp,mp,hp,yp,bp,vp,wp,xp,Sp,kp,Vn,Ea,Ta,_p,Un,Cp,Ep,Tp,$a,Ra,Ur,Wr,$p,lo,Rp,Ap,Pp,Ip,Op,Np,Dp,Mp,Lp,jp,Bp,Fp,zp,Hp,Vp,Up,Wp,qp,Gp,Kp,Aa,Xp,Jp}from"./chunk-2gzrx4ma.js";export{Lu as AVAILABLE_COMPONENTS,ma as AutoUpdater,ju as COMPONENT_STYLES,Ur as DEFAULT_WATCH_INTERVAL_MS,Ra as MAX_WATCH_INTERVAL_MS,$a as MIN_WATCH_INTERVAL_MS,Gu as MODAL_STYLES,nu as TOAST_STYLES,ed as TRAY_MENU_STYLES,ya as UPDATE_MANIFEST_ASSET,Vu as alert,lp as appInfo,Np as appleScript,Op as audio,Jp as backgroundDelay,op as battery,Ip as biometric,Sp as bluetooth,Bp as bonjour,Vr as bundlePathForExecutable,Od as caffeinate,Cd as canReplaceBundle,Ed as clearQuarantine,Jd as clipboard,qu as closeAllModals,gd as closeAllWindows,Hu as confirm,pp as contextMenu,Wp as continuityCamera,Up as coreml,kd as craftBinaryNotFoundMessage,io as craftWindowArguments,Vn as crashReporter,Cu as createAccordion,bu as createAutocomplete,lu as createAvatar,cu as createBadge,ru as createButton,uu as createCard,Iu as createChart,ou as createCheckbox,xu as createChip,Ou as createCodeEditor,mu as createColorPicker,Pu as createDataGrid,hu as createDatePicker,pu as createDropdown,Du as createFileExplorer,Ad as createGitHubUpdateManifest,wa as createGitHubUpdater,wu as createImageView,qd as createInterval,vu as createLabel,$u as createListView,Nu as createMediaPlayer,Ku as createMenubar,Tu as createModalComponent,jd as createPreferences,au as createProgressBar,gu as createRadioButton,fu as createRating,ku as createScrollView,Id as createSelfUpdater,iu as createSlider,_u as createSplitView,Eu as createStepper,ga as createSystemTray,Ru as createTable,du as createTabs,su as createTextInput,yu as createTimePicker,Wd as createTimer,Su as createTooltip,Au as createTreeView,Mu as createWebView,md as createWindow,yd as createWindowWithHTML,co as decaffeinate,sp as deepLinks,Gd as delay,Ql as dismissAlertById,eu as dismissAllAlerts,np as dragOut,Td as extractBundle,Dp as fileAssociations,lo as focus,Ap as focusShortcutsReady,Xd as formatCompact,Ld as formatDuration,Md as formatRemainingTime,zd as formatShortcut,Kd as formatTime,Zd as fs,ha as generateUpdateManifest,tu as getActiveAlertCount,Wu as getActiveModalCount,Xu as getActiveTrayInstances,pd as getActiveWindowIds,Dd as getCaffeinateStatus,Kp as getCapabilities,Aa as getCapability,ud as getDesktopConfig,cd as getDialogBridgeScript,Ud as getRegisteredHotkeys,Zu as getSimulatedTrayHTML,Qu as getTrayBridgeScript,Ju as getTrayInstance,fd as getWindow,vd as getWindowBridgeScript,ba as githubLatestAssetUrl,va as githubReleaseAssetUrl,ep as globalShortcuts,Un as handoff,Rp as hasFocusShortcuts,_p as iap,Fd as isAutoLaunchEnabled,Xp as isAvailable,Nd as isCaffeinated,rp as isDragOutAvailable,bd as isWebviewAvailable,mp as keychain,Cp as liveActivities,Pp as localServer,Ep as location,jp as log,wd as macOSRuntimeExecutablePath,dp as menu,Vp as midi,bp as nativeAutoLaunch,vp as nativeTray,wp as nativeWindow,ip as network,Yd as notifications,Zl as notify,hd as openDevWindow,xd as pack,Sd as packageApp,ka as parseShortcut,Lp as pdf,hp as permissions,yp as printing,Uu as prompt,xa as quitLauncher,ao as readBundleIdentity,Ea as redactPII,Hd as registerHotkey,Sa as relaunchBundle,Gl as requestNotificationPermission,dd as resetDesktopConfig,_d as resolveCraftBinary,Hr as resolveCraftExecutablePath,Pd as runningBundleTeamId,gp as screen,Tp as screenCapture,Wr as screenSharing,Gp as serial,qp as serviceMenu,Bd as setAutoLaunch,ld as setDesktopConfig,Qd as shell,oo as showAlert,sd as showAlertDialog,rd as showColorPicker,od as showConfirmDialog,id as showErrorDialog,Fu as showErrorModal,Yl as showErrorToast,pa as showInfoModal,Kl as showInfoToast,Hn as showMessageBox,Gt as showModal,td as showOpenDialog,fa as showQuestionModal,nd as showSaveDialog,zu as showSuccessModal,Xl as showSuccessToast,zn as showToast,ad as showWarningDialog,Bu as showWarningModal,Jl as showWarningToast,Ca as sidebar,Ta as signPayload,kp as speech,zp as speechRecognition,Fp as spotlight,up as standardMenus,$d as swapBundle,fp as system,Mp as tags,tp as theme,xp as touchbar,Yu as triggerTrayAction,Vd as unregisterAllHotkeys,_a as unregisterHotkey,ap as updater,Rd as verifyBundleTrust,Hp as vision,$p as watchScreenSharing,cp as windowEvents};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{ft,Mn,Im}from"./chunk-
|
|
2
|
+
import{ft,Mn,Im}from"./chunk-z9csfarm.js";import{ce,Ln,Om,jn,to,Br,Fr,Nm,Dm,Mm,Bn,Fn,no,zr,Lm}from"./chunk-gp9k0t3g.js";import"./chunk-2nqt1m3m.js";export{to as batch,Im as default,Ln as derived,jn as effect,ft as generateSignalsRuntime,Mn as generateSignalsRuntimeDev,Fn as isDerived,Bn as isSignal,Om as memo,Fr as onDestroy,Br as onMount,zr as peek,Mm as pendingLifecycleCounts,Dm as runDestroyCallbacks,Nm as runMountCallbacks,ce as state,no as untrack,Lm as useOptimistic};
|