@stacksjs/stx 0.2.279 → 0.2.281
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-an8s3rjv.js → chunk-0cdkfqw6.js} +2 -2
- package/dist/{chunk-08a9bfpq.js → chunk-0kexd0d9.js} +1 -1
- package/dist/{chunk-wz87behc.js → chunk-3p2w5dag.js} +1 -1
- package/dist/{chunk-rqx69p0n.js → chunk-3rbdvrp0.js} +1 -1
- package/dist/{chunk-1wbr71dj.js → chunk-40bzrw9q.js} +1 -1
- package/dist/{chunk-ddh7j0ed.js → chunk-4k0y2fnh.js} +1 -1
- package/dist/{chunk-1k3zp68a.js → chunk-61rfw29f.js} +1 -1
- package/dist/{chunk-2x85y8hb.js → chunk-6vaa771b.js} +1 -1
- package/dist/{chunk-2r0sm7yh.js → chunk-78yh2zqa.js} +9 -9
- package/dist/{chunk-4afj0w1m.js → chunk-86d1vte8.js} +1 -1
- package/dist/{chunk-9334fg4q.js → chunk-99ppngnm.js} +1 -1
- package/dist/{chunk-aj9xtx4y.js → chunk-9w2e55wt.js} +2 -2
- package/dist/{chunk-dgtbkxfd.js → chunk-bavv2k2z.js} +1 -1
- package/dist/{chunk-42mwkqa5.js → chunk-bkbnxd7s.js} +1 -1
- package/dist/{chunk-0m5vyswh.js → chunk-cnbqznms.js} +1 -1
- package/dist/{chunk-1kgz9eet.js → chunk-d8j22791.js} +1 -1
- package/dist/chunk-e7avk421.js +28 -0
- package/dist/{chunk-3cqwrprg.js → chunk-edctags2.js} +1 -1
- package/dist/{chunk-cbaa2gpx.js → chunk-exwdzxbq.js} +1 -1
- package/dist/{chunk-fg50mb11.js → chunk-gdja5ak8.js} +1 -1
- package/dist/{chunk-gyr2qp4d.js → chunk-gex3spzq.js} +1 -1
- package/dist/{chunk-e3m5zefg.js → chunk-gm2wsf2d.js} +1 -1
- package/dist/{chunk-qs1kypwa.js → chunk-h0t73k2z.js} +325 -325
- package/dist/{chunk-34d33f18.js → chunk-hcjmvwnt.js} +1 -1
- package/dist/{chunk-c40n039h.js → chunk-hghg9hcj.js} +1 -1
- package/dist/{chunk-2m8aq999.js → chunk-hqsadyfr.js} +1 -1
- package/dist/{chunk-s0v2g53x.js → chunk-hysmnz0q.js} +1 -1
- package/dist/{chunk-083kj0ge.js → chunk-k7m8p93y.js} +1 -1
- package/dist/{chunk-kr2q64k9.js → chunk-pgvskhg2.js} +1 -1
- package/dist/{chunk-8c18h010.js → chunk-q2twgdxk.js} +1 -1
- package/dist/{chunk-b6txvycf.js → chunk-qp1shwek.js} +1 -1
- package/dist/{chunk-ashkqdsb.js → chunk-qrx23zbx.js} +1 -1
- package/dist/{chunk-f0f8pne1.js → chunk-rvmt27kv.js} +1 -1
- package/dist/{chunk-zpne6q7q.js → chunk-s6759be9.js} +1 -1
- package/dist/chunk-vc973skb.js +898 -0
- package/dist/{chunk-tjgyd8gt.js → chunk-vxskcekj.js} +1 -1
- package/dist/{chunk-jsnybr5z.js → chunk-x8pbbdp1.js} +1 -1
- package/dist/{chunk-q0ctxav6.js → chunk-xen25bsv.js} +1 -1
- package/dist/{chunk-eakr9att.js → chunk-y8sqjqwg.js} +1 -1
- package/dist/{chunk-3564b157.js → chunk-y91519ss.js} +1 -1
- package/dist/{chunk-abx8rmt4.js → chunk-ydzmhy4c.js} +1 -1
- package/dist/{chunk-q9y29cgw.js → chunk-yqkjgz9q.js} +1 -1
- package/dist/{chunk-ev7490c4.js → chunk-z4mrwx1z.js} +1 -1
- package/dist/{chunk-5q8yyck0.js → chunk-ztzas1ew.js} +1 -1
- package/dist/cli.js +7 -7
- package/dist/color-mode-boot.d.ts +0 -50
- package/dist/color-mode-boot.js +2 -12
- package/dist/component-processing.js +12 -1
- package/dist/composable-loader.d.ts +10 -1
- package/dist/composable-loader.js +4 -4
- package/dist/craft-entry.js +1 -1
- package/dist/craft.js +1 -1
- package/dist/head-injection.d.ts +17 -0
- package/dist/head-injection.js +14 -6
- package/dist/process.js +37 -36
- package/dist/pwa.js +1 -1
- package/dist/runtime-injection.js +5 -6
- package/dist/seo.js +9 -1
- package/dist/ssg.js +2 -2
- package/package.json +5 -5
- package/dist/chunk-9mjw29f1.js +0 -28
- package/dist/chunk-dqzxr0pk.js +0 -898
|
@@ -0,0 +1,898 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{$u as y}from"./chunk-z45t29sf.js";function I4(){if(typeof Notification<"u"&&Notification.permission==="granted")return!0;return!1}function FZ(){return typeof window<"u"&&typeof document<"u"}async function S4(){if(typeof Notification>"u")return!1;if(Notification.permission==="granted")return!0;if(Notification.permission==="denied")return!1;return await Notification.requestPermission()==="granted"}var g=new Map;function w4(){return`alert-${Date.now()}-${Math.random().toString(36).substring(2,9)}`}function B4(Z){switch(Z){case"info":return"ℹ";case"success":return"✔";case"warning":return"⚠";case"error":return"✖";default:return"ℹ"}}function f4(Z="top-right"){if(!FZ())throw Error("Toast container requires browser environment");try{let $=document.querySelector(`.stx-toast-container[data-position="${Z}"]`);if($)return $}catch{}let Y=document.createElement("div");Y.className=`stx-toast-container ${Z}`,Y.dataset.position=Z;try{if(document.body)document.body.appendChild(Y)}catch{}return Y}function v4(Z){let{options:Y}=Z,$=B4(Y.type),J=Y.type||"info",Q=Y.duration!==0;return`
|
|
3
|
+
<div class="stx-toast ${J}" data-alert-id="${Z.id}" role="alert" aria-live="polite">
|
|
4
|
+
<div class="stx-toast-icon">${$}</div>
|
|
5
|
+
<div class="stx-toast-content">
|
|
6
|
+
${Y.title?`<div class="stx-toast-title">${wZ(Y.title)}</div>`:""}
|
|
7
|
+
<div class="stx-toast-message">${wZ(Y.message)}</div>
|
|
8
|
+
</div>
|
|
9
|
+
${Q?'<button class="stx-toast-close" aria-label="Close">×</button>':""}
|
|
10
|
+
</div>
|
|
11
|
+
`}function wZ(Z){return Z.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function e(Z){if(Z.timeout)clearTimeout(Z.timeout);if(g.delete(Z.id),Z.element&&FZ())Z.element.classList.add("dismissing"),setTimeout(()=>{Z.element?.remove()},200)}async function OZ(Z){let Y=w4(),$=I4(),J=Z.duration??5000,Q={id:Y,options:Z};if(g.set(Y,Q),$&&Z.type!=="error")try{let X=new Notification(Z.title||"Notification",{body:Z.message,icon:Z.type==="success"?"\u2713":Z.type==="warning"?"\u26A0":"\u2139",tag:Y});if(X.onclick=()=>{if(Z.onClick)Z.onClick();X.close()},J>0)Q.timeout=setTimeout(()=>{X.close(),g.delete(Y)},J);return}catch{}if(FZ())try{let X=f4(Z.position),R=document.createElement("div");R.innerHTML=v4(Q);let z=R.firstElementChild;if(!z){let K=(Z.type||"info").toUpperCase();console.log(`[stx-alert] ${K}: ${Z.title||""}`),console.log(`[stx-alert] ${Z.message}`);return}Q.element=z;try{X.appendChild(z)}catch{let K=(Z.type||"info").toUpperCase();console.log(`[stx-alert] ${K}: ${Z.title||""}`),console.log(`[stx-alert] ${Z.message}`);return}if(typeof requestAnimationFrame==="function")requestAnimationFrame(()=>{try{z.classList.add("visible")}catch{}});try{z.addEventListener("click",(K)=>{if(K.target.classList?.contains("stx-toast-close")){e(Q);return}if(Z.onClick)Z.onClick()})}catch{}if(J>0)Q.timeout=setTimeout(()=>{e(Q)},J)}catch{let X=(Z.type||"info").toUpperCase();console.log(`[stx-alert] ${X}: ${Z.title||""}`),console.log(`[stx-alert] ${Z.message}`)}else{let X=(Z.type||"info").toUpperCase();if(console.log(`[stx-alert] ${X}: ${Z.title||""}`),console.log(`[stx-alert] ${Z.message}`),J>0)Q.timeout=setTimeout(()=>{g.delete(Y)},J)}}async function l(Z){return OZ({...Z,position:Z.position||"top-right"})}async function y4(Z,Y=3000){return l({message:Z,type:"info",duration:Y})}async function g4(Z,Y=3000){return l({message:Z,type:"success",duration:Y})}async function b4(Z,Y=3000){return l({message:Z,type:"warning",duration:Y})}async function u4(Z,Y=5000){return l({message:Z,type:"error",duration:Y})}async function m4(Z,Y,$="info"){return OZ({title:Z,message:Y,type:$})}function h4(Z){let Y=g.get(Z);if(Y)e(Y)}function c4(){for(let Z of g.values())e(Z)}function p4(){return g.size}var l4=`
|
|
12
|
+
.stx-toast-container {
|
|
13
|
+
position: fixed;
|
|
14
|
+
z-index: 10001;
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
gap: 8px;
|
|
18
|
+
max-width: 400px;
|
|
19
|
+
pointer-events: none;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.stx-toast-container.top-left { top: 16px; left: 16px; }
|
|
23
|
+
.stx-toast-container.top-center { top: 16px; left: 50%; transform: translateX(-50%); }
|
|
24
|
+
.stx-toast-container.top-right { top: 16px; right: 16px; }
|
|
25
|
+
.stx-toast-container.bottom-left { bottom: 16px; left: 16px; }
|
|
26
|
+
.stx-toast-container.bottom-center { bottom: 16px; left: 50%; transform: translateX(-50%); }
|
|
27
|
+
.stx-toast-container.bottom-right { bottom: 16px; right: 16px; }
|
|
28
|
+
|
|
29
|
+
.stx-toast {
|
|
30
|
+
display: flex;
|
|
31
|
+
align-items: flex-start;
|
|
32
|
+
gap: 12px;
|
|
33
|
+
padding: 12px 16px;
|
|
34
|
+
background: #fff;
|
|
35
|
+
border-radius: 8px;
|
|
36
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
37
|
+
pointer-events: auto;
|
|
38
|
+
cursor: pointer;
|
|
39
|
+
opacity: 0;
|
|
40
|
+
transform: translateY(-10px);
|
|
41
|
+
transition: opacity 0.2s, transform 0.2s;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.stx-toast.visible {
|
|
45
|
+
opacity: 1;
|
|
46
|
+
transform: translateY(0);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.stx-toast.dismissing {
|
|
50
|
+
opacity: 0;
|
|
51
|
+
transform: translateX(100%);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
@media (prefers-color-scheme: dark) {
|
|
55
|
+
.stx-toast {
|
|
56
|
+
background: #2d2d2d;
|
|
57
|
+
color: #fff;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.stx-toast-icon {
|
|
62
|
+
font-size: 20px;
|
|
63
|
+
flex-shrink: 0;
|
|
64
|
+
margin-top: 2px;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.stx-toast.info .stx-toast-icon { color: #3498db; }
|
|
68
|
+
.stx-toast.success .stx-toast-icon { color: #27ae60; }
|
|
69
|
+
.stx-toast.warning .stx-toast-icon { color: #f39c12; }
|
|
70
|
+
.stx-toast.error .stx-toast-icon { color: #e74c3c; }
|
|
71
|
+
|
|
72
|
+
.stx-toast-content {
|
|
73
|
+
flex: 1;
|
|
74
|
+
min-width: 0;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.stx-toast-title {
|
|
78
|
+
font-weight: 600;
|
|
79
|
+
margin-bottom: 4px;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.stx-toast-message {
|
|
83
|
+
color: #666;
|
|
84
|
+
font-size: 14px;
|
|
85
|
+
line-height: 1.4;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
@media (prefers-color-scheme: dark) {
|
|
89
|
+
.stx-toast-message { color: #aaa; }
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.stx-toast-close {
|
|
93
|
+
background: none;
|
|
94
|
+
border: none;
|
|
95
|
+
font-size: 20px;
|
|
96
|
+
cursor: pointer;
|
|
97
|
+
opacity: 0.5;
|
|
98
|
+
padding: 0;
|
|
99
|
+
line-height: 1;
|
|
100
|
+
color: inherit;
|
|
101
|
+
transition: opacity 0.15s;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.stx-toast-close:hover {
|
|
105
|
+
opacity: 1;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/* Border accent for different types */
|
|
109
|
+
.stx-toast.info { border-left: 4px solid #3498db; }
|
|
110
|
+
.stx-toast.success { border-left: 4px solid #27ae60; }
|
|
111
|
+
.stx-toast.warning { border-left: 4px solid #f39c12; }
|
|
112
|
+
.stx-toast.error { border-left: 4px solid #e74c3c; }
|
|
113
|
+
`;function T(Z="stx"){return`${Z}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`}function q(Z){return Z.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function D(...Z){return Z.filter(Boolean).join(" ")}function W(Z){if(!Z)return"";return Object.entries(Z).map(([Y,$])=>`${Y.replace(/([A-Z])/g,"-$1").toLowerCase()}: ${$}`).join("; ")}function d4(Z){let{text:Y,variant:$="primary",size:J="medium",disabled:Q=!1,loading:X=!1,icon:R,iconPosition:z="left",id:K=T("btn"),className:F,style:j}=Z,V=D("stx-button",`stx-button--${$}`,`stx-button--${J}`,Q&&"stx-button--disabled",X&&"stx-button--loading",F),O=W(j),P=R?`<span class="stx-button-icon">${R}</span>`:"",L=X?'<span class="stx-button-spinner"></span>':"",_=z==="left"?`${P}${L}<span class="stx-button-text">${q(Y)}</span>`:`<span class="stx-button-text">${q(Y)}</span>${P}${L}`;return`<button id="${K}" class="${V}" ${Q||X?"disabled":""} ${O?`style='${O}'`:""}>${_}</button>`}function r4(Z){let{value:Y="",placeholder:$="",type:J="text",disabled:Q=!1,readonly:X=!1,maxLength:R,minLength:z,pattern:K,required:F=!1,autocomplete:j,label:V,error:O,hint:P,id:L=T("input"),className:_,style:N}=Z,E=D("stx-input",O&&"stx-input--error",Q&&"stx-input--disabled",_),S=W(N),t=[`type="${J}"`,`id="${L}"`,`class="${E}"`,Y&&`value="${q(Y)}"`,$&&`placeholder="${q($)}"`,Q&&"disabled",X&&"readonly",F&&"required",R&&`maxlength="${R}"`,z&&`minlength="${z}"`,K&&`pattern="${q(K)}"`,j&&`autocomplete="${j}"`,S&&`style="${S}"`].filter(Boolean).join(" "),w="";if(V)w+=`<label class="stx-input-label" for="${L}">${q(V)}</label>`;if(w+=`<input ${t} />`,O)w+=`<div class="stx-input-error">${q(O)}</div>`;else if(P)w+=`<div class="stx-input-hint">${q(P)}</div>`;return`<div class="stx-input-wrapper">${w}</div>`}function n4(Z){let{checked:Y=!1,label:$,disabled:J=!1,indeterminate:Q=!1,id:X=T("checkbox"),className:R,style:z}=Z,K=D("stx-checkbox",J&&"stx-checkbox--disabled",R),F=W(z),j=['type="checkbox"',`id="${X}"`,Y&&"checked",J&&"disabled",Q&&'data-indeterminate="true"'].filter(Boolean).join(" ");return`
|
|
114
|
+
<label class="${K}" ${F?`style="${F}"`:""}>
|
|
115
|
+
<input ${j} />
|
|
116
|
+
<span class="stx-checkbox-box"></span>
|
|
117
|
+
${$?`<span class="stx-checkbox-label">${q($)}</span>`:""}
|
|
118
|
+
</label>
|
|
119
|
+
`}function o4(Z){let{value:Y=50,min:$=0,max:J=100,step:Q=1,disabled:X=!1,label:R,showValue:z=!0,id:K=T("slider"),className:F,style:j}=Z,V=D("stx-slider",X&&"stx-slider--disabled",F),O=W(j),P=['type="range"',`id="${K}"`,`value="${Y}"`,`min="${$}"`,`max="${J}"`,`step="${Q}"`,X&&"disabled"].filter(Boolean).join(" "),L="";if(R)L+=`<label class="stx-slider-label" for="${K}">${q(R)}</label>`;if(L+=`<div class="stx-slider-track"><input ${P} /></div>`,z)L+=`<span class="stx-slider-value">${Y}</span>`;return`<div class="${V}" ${O?`style='${O}'`:""}>${L}</div>`}function a4(Z){let{value:Y,max:$=100,variant:J="default",size:Q="medium",showLabel:X=!1,indeterminate:R=!1,id:z=T("progress"),className:K,style:F}=Z,j=Math.min(100,Math.max(0,Y/$*100)),V=D("stx-progress",`stx-progress--${J}`,`stx-progress--${Q}`,R&&"stx-progress--indeterminate",K),O=W(F);return`
|
|
120
|
+
<div id="${z}" class="${V}" role="progressbar" aria-valuenow="${Y}" aria-valuemin="0" aria-valuemax="${$}" ${O?`style="${O}"`:""}>
|
|
121
|
+
<div class="stx-progress-bar" style="width: ${R?"100%":`${j}%`}"></div>
|
|
122
|
+
${X?`<span class="stx-progress-label">${Math.round(j)}%</span>`:""}
|
|
123
|
+
</div>
|
|
124
|
+
`}function i4(Z){let{text:Y,variant:$="default",size:J="medium",id:Q=T("badge"),className:X,style:R}=Z,z=D("stx-badge",`stx-badge--${$}`,`stx-badge--${J}`,X),K=W(R);return`<span id="${Q}" class="${z}" ${K?`style='${K}'`:""}>${q(Y)}</span>`}function s4(Z){let{src:Y,alt:$="",name:J,size:Q="medium",shape:X="circle",id:R=T("avatar"),className:z,style:K}=Z,F=typeof Q==="number"?"":`stx-avatar--${Q}`,j=typeof Q==="number"?`width: ${Q}px; height: ${Q}px;`:"",V=D("stx-avatar",F,`stx-avatar--${X}`,z),O=[j,W(K)].filter(Boolean).join(" "),P=J?J.split(" ").map((L)=>L[0]).join("").toUpperCase().slice(0,2):"";if(Y)return`<div id="${R}" class="${V}" ${O?`style="${O}"`:""}>
|
|
125
|
+
<img src="${q(Y)}" alt="${q($)}" class="stx-avatar-img" />
|
|
126
|
+
</div>`;return`<div id="${R}" class="${V}" ${O?`style="${O}"`:""}>
|
|
127
|
+
<span class="stx-avatar-initials">${P}</span>
|
|
128
|
+
</div>`}function t4(Z){let{title:Y,subtitle:$,content:J,image:Q,footer:X,variant:R="default",id:z=T("card"),className:K,style:F}=Z,j=D("stx-card",`stx-card--${R}`,K),V=W(F),O="";if(Q)O+=`<div class="stx-card-image"><img src="${q(Q)}" alt="" /></div>`;if(O+='<div class="stx-card-body">',Y)O+=`<h3 class="stx-card-title">${q(Y)}</h3>`;if($)O+=`<p class="stx-card-subtitle">${q($)}</p>`;if(J)O+=`<div class="stx-card-content">${q(J)}</div>`;if(O+="</div>",X)O+=`<div class="stx-card-footer">${q(X)}</div>`;return`<div id="${z}" class="${j}" ${V?`style='${V}'`:""}>${O}</div>`}function e4(Z){let{tabs:Y,activeTab:$,variant:J="default",id:Q=T("tabs"),className:X,style:R}=Z,z=D("stx-tabs",`stx-tabs--${J}`,X),K=W(R),F=Y.map((j,V)=>{let O=$?j.value===$:V===0;return`<button class="${D("stx-tab",O&&"stx-tab--active",j.disabled&&"stx-tab--disabled")}" data-value="${q(j.value)}" ${j.disabled?"disabled":""} role="tab" aria-selected="${O}">${q(j.label)}</button>`}).join("");return`<div id="${Q}" class="${z}" role="tablist" ${K?`style='${K}'`:""}>${F}</div>`}function ZY(Z){let{options:Y,value:$,placeholder:J="Select...",disabled:Q=!1,id:X=T("dropdown"),className:R,style:z}=Z,K=D("stx-dropdown",Q&&"stx-dropdown--disabled",R),F=W(z),j=Y.map((O)=>{let P=O.value===$?"selected":"",L=O.disabled?"disabled":"";return`<option value="${q(O.value)}" ${P} ${L}>${q(O.label)}</option>`}).join(""),V=$?"":`<option value="" disabled selected>${q(J)}</option>`;return`<select id="${X}" class="${K}" ${Q?"disabled":""} ${F?`style='${F}'`:""}>${V}${j}</select>`}function YY(Z){let{value:Y=0,max:$=5,readonly:J=!1,size:Q="medium",allowHalf:X=!1,id:R=T("rating"),className:z,style:K}=Z,F=D("stx-rating",`stx-rating--${Q}`,J&&"stx-rating--readonly",z),j=W(K),V="";for(let O=1;O<=$;O++){let P=O<=Y,L=X&&O-0.5===Y;V+=`<span class="stx-star ${P?"stx-star--filled":L?"stx-star--half":""}" data-value="${O}">\u2605</span>`}return`<div id="${R}" class="${F}" role="slider" aria-valuenow="${Y}" aria-valuemin="0" aria-valuemax="${$}" ${j?`style='${j}'`:""}>${V}</div>`}function $Y(Z){let{value:Y,name:$,checked:J=!1,label:Q,disabled:X=!1,id:R=T("radio"),className:z,style:K}=Z,F=D("stx-radio",X&&"stx-radio--disabled",z),j=W(K),V=['type="radio"',`id="${R}"`,`name="${q($)}"`,`value="${q(Y)}"`,J&&"checked",X&&"disabled"].filter(Boolean).join(" ");return`
|
|
129
|
+
<label class="${F}" ${j?`style="${j}"`:""}>
|
|
130
|
+
<input ${V} />
|
|
131
|
+
<span class="stx-radio-circle"></span>
|
|
132
|
+
${Q?`<span class="stx-radio-label">${q(Q)}</span>`:""}
|
|
133
|
+
</label>
|
|
134
|
+
`}function JY(Z){let{value:Y="#3498db",disabled:$=!1,label:J,presetColors:Q=["#e74c3c","#f39c12","#27ae60","#3498db","#9b59b6","#1abc9c","#34495e","#000000"],id:X=T("color"),className:R,style:z}=Z,K=D("stx-color-picker",$&&"stx-color-picker--disabled",R),F=W(z),j="";if(J)j+=`<label class="stx-color-picker-label" for="${X}">${q(J)}</label>`;if(j+=`<div class="stx-color-picker-input">
|
|
135
|
+
<input type="color" id="${X}" value="${q(Y)}" ${$?"disabled":""} />
|
|
136
|
+
<span class="stx-color-picker-value">${q(Y)}</span>
|
|
137
|
+
</div>`,Q.length>0){j+='<div class="stx-color-picker-presets">';for(let V of Q)j+=`<button class="stx-color-preset" style="background: ${q(V)}" data-color="${q(V)}" ${$?"disabled":""}></button>`;j+="</div>"}return`<div class="${K}" ${F?`style='${F}'`:""}>${j}</div>`}function GY(Z){let{value:Y,min:$,max:J,disabled:Q=!1,label:X,placeholder:R="Select date",showClear:z=!0,id:K=T("date"),className:F,style:j}=Z,V=D("stx-date-picker",Q&&"stx-date-picker--disabled",F),O=W(j),P=Y instanceof Date?Y.toISOString().split("T")[0]:Y||"",L=$ instanceof Date?$.toISOString().split("T")[0]:$,_=J instanceof Date?J.toISOString().split("T")[0]:J,N=['type="date"',`id="${K}"`,P&&`value="${P}"`,L&&`min="${L}"`,_&&`max="${_}"`,Q&&"disabled",`placeholder="${q(R)}"`].filter(Boolean).join(" "),E="";if(X)E+=`<label class="stx-date-picker-label" for="${K}">${q(X)}</label>`;return E+=`<div class="stx-date-picker-input">
|
|
138
|
+
<input ${N} />
|
|
139
|
+
${z&&P?'<button class="stx-date-picker-clear" type="button">×</button>':""}
|
|
140
|
+
</div>`,`<div class="${V}" ${O?`style='${O}'`:""}>${E}</div>`}function QY(Z){let{value:Y="",disabled:$=!1,label:J,step:Q=60,min:X,max:R,id:z=T("time"),className:K,style:F}=Z,j=D("stx-time-picker",$&&"stx-time-picker--disabled",K),V=W(F),O=['type="time"',`id="${z}"`,Y&&`value="${q(Y)}"`,`step="${Q}"`,X&&`min="${q(X)}"`,R&&`max="${q(R)}"`,$&&"disabled"].filter(Boolean).join(" "),P="";if(J)P+=`<label class="stx-time-picker-label" for="${z}">${q(J)}</label>`;return P+=`<input ${O} class="stx-time-picker-input" />`,`<div class="${j}" ${V?`style='${V}'`:""}>${P}</div>`}function XY(Z){let{options:Y,value:$="",placeholder:J="Search...",disabled:Q=!1,label:X,loading:R=!1,id:z=T("autocomplete"),className:K,style:F}=Z,j=D("stx-autocomplete",Q&&"stx-autocomplete--disabled",K),V=W(F),O=Y.find((_)=>_.value===$),P=O?O.label:$,L="";if(X)L+=`<label class="stx-autocomplete-label" for="${z}">${q(X)}</label>`;L+=`<div class="stx-autocomplete-input-wrapper">
|
|
141
|
+
<input type="text" id="${z}" value="${q(P)}" placeholder="${q(J)}" ${Q?"disabled":""} autocomplete="off" class="stx-autocomplete-input" />
|
|
142
|
+
${R?'<span class="stx-autocomplete-spinner"></span>':""}
|
|
143
|
+
</div>`,L+='<ul class="stx-autocomplete-list">';for(let _ of Y)L+=`<li class="stx-autocomplete-item ${_.value===$?"stx-autocomplete-item--selected":""}" data-value="${q(_.value)}">${q(_.label)}</li>`;return L+="</ul>",`<div class="${j}" ${V?`style='${V}'`:""}>${L}</div>`}function zY(Z){let{text:Y,htmlFor:$,required:J=!1,size:Q="medium",id:X=T("label"),className:R,style:z}=Z,K=D("stx-label",`stx-label--${Q}`,R),F=W(z);return`<label id="${X}" class="${K}" ${$?`for='${q($)}'`:""} ${F?`style='${F}'`:""}>${q(Y)}${J?'<span class="stx-label-required">*</span>':""}</label>`}function RY(Z){let{src:Y,alt:$="",width:J,height:Q,objectFit:X="cover",fallback:R,loading:z="lazy",id:K=T("image"),className:F,style:j}=Z,V=D("stx-image",F),O={objectFit:X};if(J)O.width=typeof J==="number"?`${J}px`:J;if(Q)O.height=typeof Q==="number"?`${Q}px`:Q;let P=[W(O),W(j)].filter(Boolean).join("; "),L=R?`onerror="this.src='${q(R)}'"`:"";return`<img id="${K}" class="${V}" src="${q(Y)}" alt="${q($)}" loading="${z}" ${P?`style='${P}'`:""} ${L} />`}function KY(Z){let{text:Y,variant:$="default",size:J="medium",removable:Q=!1,icon:X,id:R=T("chip"),className:z,style:K}=Z,F=D("stx-chip",`stx-chip--${$}`,`stx-chip--${J}`,z),j=W(K),V="";if(X)V+=`<span class="stx-chip-icon">${X}</span>`;if(V+=`<span class="stx-chip-text">${q(Y)}</span>`,Q)V+='<button class="stx-chip-remove" type="button">×</button>';return`<span id="${R}" class="${F}" ${j?`style='${j}'`:""}>${V}</span>`}function FY(Z){let{text:Y,position:$="top",delay:J=200,children:Q,id:X=T("tooltip"),className:R,style:z}=Z,K=D("stx-tooltip-wrapper",R),F=W(z);return`<div id="${X}" class="${K}" ${F?`style="${F}"`:""} data-tooltip="${q(Y)}" data-position="${$}" data-delay="${J}">
|
|
144
|
+
${Q}
|
|
145
|
+
<span class="stx-tooltip stx-tooltip--${$}">${q(Y)}</span>
|
|
146
|
+
</div>`}function OY(Z){let{direction:Y="vertical",showScrollbar:$=!0,smooth:J=!0,height:Q,width:X,children:R,id:z=T("scroll"),className:K,style:F}=Z,j=D("stx-scroll-view",`stx-scroll-view--${Y}`,!$&&"stx-scroll-view--hide-scrollbar",J&&"stx-scroll-view--smooth",K),V={};if(Q)V.height=typeof Q==="number"?`${Q}px`:Q;if(X)V.width=typeof X==="number"?`${X}px`:X;let O=[W(V),W(F)].filter(Boolean).join("; ");return`<div id="${z}" class="${j}" ${O?`style='${O}'`:""}>${R}</div>`}function jY(Z){let{direction:Y="horizontal",sizes:$=[50,50],resizable:J=!0,children:Q,id:X=T("split"),className:R,style:z}=Z,K=D("stx-split-view",`stx-split-view--${Y}`,J&&"stx-split-view--resizable",R),F=W(z),j=Y==="horizontal"?"width":"height";return`<div id="${X}" class="${K}" ${F?`style="${F}"`:""}>
|
|
147
|
+
<div class="stx-split-pane" style="${j}: ${$[0]}%">${Q[0]}</div>
|
|
148
|
+
${J?'<div class="stx-split-divider"></div>':""}
|
|
149
|
+
<div class="stx-split-pane" style="${j}: ${$[1]}%">${Q[1]}</div>
|
|
150
|
+
</div>`}function VY(Z){let{items:Y,multiple:$=!1,defaultOpen:J=[],id:Q=T("accordion"),className:X,style:R}=Z,z=D("stx-accordion",X),K=W(R),F="";return Y.forEach((j,V)=>{let O=J.includes(V),P=D("stx-accordion-item",O&&"stx-accordion-item--open",j.disabled&&"stx-accordion-item--disabled");F+=`<div class="${P}" data-index="${V}">
|
|
151
|
+
<button class="stx-accordion-header" ${j.disabled?"disabled":""} aria-expanded="${O}" data-multiple="${$}">
|
|
152
|
+
<span class="stx-accordion-title">${q(j.title)}</span>
|
|
153
|
+
<span class="stx-accordion-icon">\u25BC</span>
|
|
154
|
+
</button>
|
|
155
|
+
<div class="stx-accordion-content" ${O?"":"hidden"}>
|
|
156
|
+
${q(j.content)}
|
|
157
|
+
</div>
|
|
158
|
+
</div>`}),`<div id="${Q}" class="${z}" ${K?`style='${K}'`:""}>${F}</div>`}function qY(Z){let{steps:Y,currentStep:$,orientation:J="horizontal",id:Q=T("stepper"),className:X,style:R}=Z,z=D("stx-stepper",`stx-stepper--${J}`,X),K=W(R),F="";return Y.forEach((j,V)=>{let O=D("stx-step",V<$&&"stx-step--completed",V===$&&"stx-step--active");if(F+=`<div class="${O}" data-step="${V}">
|
|
159
|
+
<div class="stx-step-indicator">
|
|
160
|
+
${V<$?"\u2713":V+1}
|
|
161
|
+
</div>
|
|
162
|
+
<div class="stx-step-content">
|
|
163
|
+
<div class="stx-step-label">${q(j.label)}</div>
|
|
164
|
+
${j.description?`<div class="stx-step-description">${q(j.description)}</div>`:""}
|
|
165
|
+
</div>
|
|
166
|
+
</div>`,V<Y.length-1)F+='<div class="stx-step-connector"></div>'}),`<div id="${Q}" class="${z}" ${K?`style='${K}'`:""}>${F}</div>`}function UY(Z){let{open:Y=!1,title:$,size:J="medium",closable:Q=!0,children:X,footer:R,id:z=T("modal"),className:K,style:F}=Z,j=D("stx-modal-component",`stx-modal-component--${J}`,K),V=W(F);if(!Y)return`<div id="${z}" class="${j} stx-modal-component--hidden" ${V?`style='${V}'`:""}></div>`;let O='<div class="stx-modal-component-overlay">';if(O+='<div class="stx-modal-component-dialog">',$||Q){if(O+='<div class="stx-modal-component-header">',$)O+=`<h3 class="stx-modal-component-title">${q($)}</h3>`;if(Q)O+='<button class="stx-modal-component-close">×</button>';O+="</div>"}if(O+=`<div class="stx-modal-component-body">${X}</div>`,R)O+=`<div class="stx-modal-component-footer">${R}</div>`;return O+="</div></div>",`<div id="${z}" class="${j}" ${V?`style='${V}'`:""}>${O}</div>`}function PY(Z){let{items:Y,selectable:$=!1,multiSelect:J=!1,emptyMessage:Q="No items",id:X=T("list"),className:R,style:z}=Z,K=D("stx-list-view",$&&"stx-list-view--selectable",J&&"stx-list-view--multi",R),F=W(z);if(Y.length===0)return`<div id="${X}" class="${K}" ${F?`style="${F}"`:""}>
|
|
167
|
+
<div class="stx-list-view-empty">${q(Q)}</div>
|
|
168
|
+
</div>`;let j='<ul class="stx-list-view-items">';for(let V of Y){let O=D("stx-list-view-item",V.selected&&"stx-list-view-item--selected");j+=`<li class="${O}" data-id="${q(V.id)}" ${$?'tabindex="0"':""}>${V.content}</li>`}return j+="</ul>",`<div id="${X}" class="${K}" ${F?`style='${F}'`:""}>${j}</div>`}function LY(Z){let{columns:Y,data:$,striped:J=!1,bordered:Q=!1,hoverable:X=!0,sortBy:R,sortOrder:z,id:K=T("table"),className:F,style:j}=Z,V=D("stx-table",J&&"stx-table--striped",Q&&"stx-table--bordered",X&&"stx-table--hoverable",F),O=W(j),P="<table>";P+="<thead><tr>";for(let L of Y){let N=L.key===R?`stx-table-sorted stx-table-sorted--${z}`:"",E=L.sortable?'data-sortable="true"':"",S=L.width?`style="width: ${L.width}"`:"";P+=`<th class="${N}" ${E} ${S} data-key="${q(L.key)}">${q(L.label)}${L.sortable?'<span class="stx-table-sort-icon"></span>':""}</th>`}P+="</tr></thead>",P+="<tbody>";for(let L of $){P+="<tr>";for(let _ of Y){let N=L[_.key];P+=`<td>${N!=null?q(String(N)):""}</td>`}P+="</tr>"}return P+="</tbody></table>",`<div id="${K}" class="${V}" ${O?`style='${O}'`:""}>${P}</div>`}function BZ(Z,Y,$,J){let Q=Y.includes(Z.key),X=$.includes(Z.key),R=Z.children&&Z.children.length>0,K=`<div class="${D("stx-tree-node",X&&"stx-tree-node--selected",Z.disabled&&"stx-tree-node--disabled")}" data-key="${q(Z.key)}">`;if(K+='<div class="stx-tree-node-content">',R)K+=`<span class="stx-tree-toggle ${Q?"stx-tree-toggle--expanded":""}">\u25B6</span>`;else K+='<span class="stx-tree-toggle-placeholder"></span>';if(J)K+=`<input type="checkbox" class="stx-tree-checkbox" ${X?"checked":""} ${Z.disabled?"disabled":""} />`;if(Z.icon)K+=`<span class="stx-tree-icon">${Z.icon}</span>`;if(K+=`<span class="stx-tree-label">${q(Z.label)}</span>`,K+="</div>",R&&Q){K+='<div class="stx-tree-children">';for(let F of Z.children)K+=BZ(F,Y,$,J);K+="</div>"}return K+="</div>",K}function WY(Z){let{nodes:Y,expandedKeys:$=[],selectedKeys:J=[],checkable:Q=!1,id:X=T("tree"),className:R,style:z}=Z,K=D("stx-tree-view",Q&&"stx-tree-view--checkable",R),F=W(z),j="";for(let V of Y)j+=BZ(V,$,J,Q);return`<div id="${X}" class="${K}" role="tree" ${F?`style='${F}'`:""}>${j}</div>`}function DY(Z){let{columns:Y,data:$,pagination:J,selectable:Q=!1,id:X=T("datagrid"),className:R,style:z}=Z,K=D("stx-data-grid",Q&&"stx-data-grid--selectable",R),F=W(z),j='<div class="stx-data-grid-table-wrapper">';if(j+='<table class="stx-data-grid-table">',j+="<thead><tr>",Q)j+='<th class="stx-data-grid-select-all"><input type="checkbox" /></th>';for(let V of Y){let O=V.width?`style="width: ${V.width}"`:"";j+=`<th ${O}>
|
|
169
|
+
<div class="stx-data-grid-header-cell">
|
|
170
|
+
<span>${q(V.label)}</span>
|
|
171
|
+
${V.sortable?'<button class="stx-data-grid-sort">\u21C5</button>':""}
|
|
172
|
+
${V.filterable?'<button class="stx-data-grid-filter">\u22BB</button>':""}
|
|
173
|
+
</div>
|
|
174
|
+
</th>`}j+="</tr></thead>",j+="<tbody>";for(let V of $){if(j+="<tr>",Q)j+='<td class="stx-data-grid-select"><input type="checkbox" /></td>';for(let O of Y){let P=V[O.key];j+=`<td>${P!=null?q(String(P)):""}</td>`}j+="</tr>"}if(j+="</tbody></table></div>",J){let V=Math.ceil(J.total/J.pageSize);j+=`<div class="stx-data-grid-pagination">
|
|
175
|
+
<span class="stx-data-grid-page-info">Page ${J.page} of ${V} (${J.total} items)</span>
|
|
176
|
+
<div class="stx-data-grid-page-buttons">
|
|
177
|
+
<button class="stx-data-grid-page-btn" ${J.page<=1?"disabled":""}>\u25C0</button>
|
|
178
|
+
<button class="stx-data-grid-page-btn" ${J.page>=V?"disabled":""}>\u25B6</button>
|
|
179
|
+
</div>
|
|
180
|
+
</div>`}return`<div id="${X}" class="${K}" ${F?`style='${F}'`:""}>${j}</div>`}function MY(Z){let{type:Y,data:$,options:J={},width:Q="100%",height:X=300,id:R=T("chart"),className:z,style:K}=Z,F=D("stx-chart",`stx-chart--${Y}`,z),j={width:typeof Q==="number"?`${Q}px`:Q,height:typeof X==="number"?`${X}px`:X},V=[W(j),W(K)].filter(Boolean).join("; "),O=JSON.stringify({type:Y,data:$,options:J});return`<div id="${R}" class="${F}" style="${V}" data-chart='${q(O)}'>
|
|
181
|
+
<div class="stx-chart-placeholder">
|
|
182
|
+
${J.title?`<div class="stx-chart-title">${q(J.title)}</div>`:""}
|
|
183
|
+
<div class="stx-chart-type">${Y.charAt(0).toUpperCase()+Y.slice(1)} Chart</div>
|
|
184
|
+
<div class="stx-chart-info">${$.datasets.length} dataset(s), ${$.labels.length} labels</div>
|
|
185
|
+
</div>
|
|
186
|
+
</div>`}function TY(Z){let{value:Y="",language:$="plaintext",theme:J="dark",lineNumbers:Q=!0,readOnly:X=!1,height:R=300,tabSize:z=2,wordWrap:K=!1,id:F=T("code"),className:j,style:V}=Z,O=D("stx-code-editor",`stx-code-editor--${J}`,Q&&"stx-code-editor--line-numbers",X&&"stx-code-editor--readonly",K&&"stx-code-editor--wrap",j),P={height:typeof R==="number"?`${R}px`:R},L=[W(P),W(V)].filter(Boolean).join("; "),_=Y.split(`
|
|
187
|
+
`),N="";if(Q){N+='<div class="stx-code-editor-gutter">';for(let E=1;E<=_.length;E++)N+=`<div class="stx-code-editor-line-number">${E}</div>`;N+="</div>"}return N+=`<pre class="stx-code-editor-content"><code class="language-${q($)}">${q(Y)}</code></pre>`,`<div id="${F}" class="${O}" style="${L}" data-language="${q($)}" data-tab-size="${z}">${N}</div>`}function _Y(Z){let{src:Y,type:$="video",poster:J,autoplay:Q=!1,loop:X=!1,muted:R=!1,controls:z=!0,width:K,height:F,id:j=T("media"),className:V,style:O}=Z,P=D("stx-media-player",`stx-media-player--${$}`,V),L={};if(K)L.width=typeof K==="number"?`${K}px`:K;if(F)L.height=typeof F==="number"?`${F}px`:F;let _=[W(L),W(O)].filter(Boolean).join("; "),N=[`id="${j}-media"`,`src="${q(Y)}"`,z&&"controls",Q&&"autoplay",X&&"loop",R&&"muted",$==="video"&&J&&`poster="${q(J)}"`].filter(Boolean).join(" "),E=$==="video"?`<video ${N}>Your browser does not support the video tag.</video>`:`<audio ${N}>Your browser does not support the audio tag.</audio>`;return`<div id="${j}" class="${P}" ${_?`style='${_}'`:""}>${E}</div>`}function NY(Z){if(Z===void 0)return"";let Y=["B","KB","MB","GB"],$=Z,J=0;while($>=1024&&J<Y.length-1)$/=1024,J++;return`${$.toFixed(1)} ${Y[J]}`}function EY(Z){let{files:Y,viewMode:$="list",showHidden:J=!1,selectable:Q=!0,id:X=T("files"),className:R,style:z}=Z,K=D("stx-file-explorer",`stx-file-explorer--${$}`,R),F=W(z),j=J?Y:Y.filter((O)=>!O.name.startsWith(".")),V="";if($==="list"){V='<table class="stx-file-explorer-list"><thead><tr><th>Name</th><th>Size</th><th>Modified</th></tr></thead><tbody>';for(let O of j){let P=O.icon||(O.type==="folder"?"\uD83D\uDCC1":"\uD83D\uDCC4"),L=O.type==="file"?NY(O.size):"",_=O.modified?O.modified.toLocaleDateString():"";V+=`<tr class="stx-file-explorer-item ${Q?"stx-file-explorer-item--selectable":""}" data-path="${q(O.path)}" data-type="${O.type}">
|
|
188
|
+
<td><span class="stx-file-explorer-icon">${P}</span>${q(O.name)}</td>
|
|
189
|
+
<td>${L}</td>
|
|
190
|
+
<td>${_}</td>
|
|
191
|
+
</tr>`}V+="</tbody></table>"}else{V='<div class="stx-file-explorer-grid">';for(let O of j){let P=O.icon||(O.type==="folder"?"\uD83D\uDCC1":"\uD83D\uDCC4");V+=`<div class="stx-file-explorer-item ${Q?"stx-file-explorer-item--selectable":""}" data-path="${q(O.path)}" data-type="${O.type}">
|
|
192
|
+
<div class="stx-file-explorer-icon">${P}</div>
|
|
193
|
+
<div class="stx-file-explorer-name">${q(O.name)}</div>
|
|
194
|
+
</div>`}V+="</div>"}return`<div id="${X}" class="${K}" ${F?`style='${F}'`:""}>${V}</div>`}function AY(Z){let{url:Y,width:$="100%",height:J=400,sandbox:Q=!0,allowScripts:X=!0,id:R=T("webview"),className:z,style:K}=Z,F=D("stx-webview",z),j={width:typeof $==="number"?`${$}px`:$,height:typeof J==="number"?`${J}px`:J},V=[W(j),W(K)].filter(Boolean).join("; "),O=[];if(Q){if(O.push("allow-same-origin"),X)O.push("allow-scripts")}let P=Q?`sandbox="${O.join(" ")}"`:"";return`<iframe id="${R}" class="${F}" src="${q(Y)}" style="${V}" ${P} loading="lazy" frameborder="0"></iframe>`}var kY=["Button","TextInput","Checkbox","RadioButton","Slider","ColorPicker","DatePicker","TimePicker","Autocomplete","Label","ImageView","ProgressBar","Avatar","Badge","Chip","Card","Tooltip","Toast","ScrollView","SplitView","Accordion","Stepper","Modal","Tabs","Dropdown","ListView","Table","TreeView","DataGrid","Chart","Rating","CodeEditor","MediaPlayer","FileExplorer","WebView"],HY=`
|
|
195
|
+
/* Button */
|
|
196
|
+
.stx-button {
|
|
197
|
+
display: inline-flex;
|
|
198
|
+
align-items: center;
|
|
199
|
+
justify-content: center;
|
|
200
|
+
gap: 8px;
|
|
201
|
+
padding: 8px 16px;
|
|
202
|
+
border: none;
|
|
203
|
+
border-radius: 6px;
|
|
204
|
+
font-size: 14px;
|
|
205
|
+
font-weight: 500;
|
|
206
|
+
cursor: pointer;
|
|
207
|
+
transition: all 0.15s;
|
|
208
|
+
}
|
|
209
|
+
.stx-button--primary { background: #3498db; color: #fff; }
|
|
210
|
+
.stx-button--primary:hover { background: #2980b9; }
|
|
211
|
+
.stx-button--secondary { background: #6c757d; color: #fff; }
|
|
212
|
+
.stx-button--outline { background: transparent; border: 1px solid #3498db; color: #3498db; }
|
|
213
|
+
.stx-button--ghost { background: transparent; color: #3498db; }
|
|
214
|
+
.stx-button--destructive { background: #e74c3c; color: #fff; }
|
|
215
|
+
.stx-button--small { padding: 4px 8px; font-size: 12px; }
|
|
216
|
+
.stx-button--large { padding: 12px 24px; font-size: 16px; }
|
|
217
|
+
.stx-button--disabled { opacity: 0.5; cursor: not-allowed; }
|
|
218
|
+
.stx-button--loading { pointer-events: none; }
|
|
219
|
+
.stx-button-spinner { width: 16px; height: 16px; border: 2px solid transparent; border-top-color: currentColor; border-radius: 50%; animation: spin 0.6s linear infinite; }
|
|
220
|
+
@keyframes spin { to { transform: rotate(360deg); } }
|
|
221
|
+
|
|
222
|
+
/* Input */
|
|
223
|
+
.stx-input-wrapper { display: flex; flex-direction: column; gap: 4px; }
|
|
224
|
+
.stx-input-label { font-size: 14px; font-weight: 500; color: #333; }
|
|
225
|
+
.stx-input { padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; transition: border-color 0.15s; }
|
|
226
|
+
.stx-input:focus { outline: none; border-color: #3498db; }
|
|
227
|
+
.stx-input--error { border-color: #e74c3c; }
|
|
228
|
+
.stx-input-error { font-size: 12px; color: #e74c3c; }
|
|
229
|
+
.stx-input-hint { font-size: 12px; color: #666; }
|
|
230
|
+
|
|
231
|
+
/* Checkbox */
|
|
232
|
+
.stx-checkbox { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
|
|
233
|
+
.stx-checkbox input { display: none; }
|
|
234
|
+
.stx-checkbox-box { width: 18px; height: 18px; border: 2px solid #ddd; border-radius: 4px; transition: all 0.15s; }
|
|
235
|
+
.stx-checkbox input:checked + .stx-checkbox-box { background: #3498db; border-color: #3498db; }
|
|
236
|
+
.stx-checkbox--disabled { opacity: 0.5; cursor: not-allowed; }
|
|
237
|
+
|
|
238
|
+
/* Progress */
|
|
239
|
+
.stx-progress { height: 8px; background: #e0e0e0; border-radius: 4px; overflow: hidden; position: relative; }
|
|
240
|
+
.stx-progress-bar { height: 100%; background: #3498db; transition: width 0.3s; }
|
|
241
|
+
.stx-progress--success .stx-progress-bar { background: #27ae60; }
|
|
242
|
+
.stx-progress--warning .stx-progress-bar { background: #f39c12; }
|
|
243
|
+
.stx-progress--error .stx-progress-bar { background: #e74c3c; }
|
|
244
|
+
.stx-progress--indeterminate .stx-progress-bar { animation: progress-indeterminate 1.5s infinite; }
|
|
245
|
+
@keyframes progress-indeterminate { 0% { transform: translateX(-100%); } 100% { transform: translateX(200%); } }
|
|
246
|
+
|
|
247
|
+
/* Badge */
|
|
248
|
+
.stx-badge { display: inline-flex; padding: 2px 8px; border-radius: 12px; font-size: 12px; font-weight: 500; }
|
|
249
|
+
.stx-badge--default { background: #e0e0e0; color: #333; }
|
|
250
|
+
.stx-badge--primary { background: #3498db; color: #fff; }
|
|
251
|
+
.stx-badge--success { background: #27ae60; color: #fff; }
|
|
252
|
+
.stx-badge--warning { background: #f39c12; color: #fff; }
|
|
253
|
+
.stx-badge--error { background: #e74c3c; color: #fff; }
|
|
254
|
+
|
|
255
|
+
/* Avatar */
|
|
256
|
+
.stx-avatar { display: inline-flex; align-items: center; justify-content: center; background: #3498db; color: #fff; overflow: hidden; }
|
|
257
|
+
.stx-avatar--circle { border-radius: 50%; }
|
|
258
|
+
.stx-avatar--square { border-radius: 0; }
|
|
259
|
+
.stx-avatar--rounded { border-radius: 8px; }
|
|
260
|
+
.stx-avatar--small { width: 32px; height: 32px; font-size: 12px; }
|
|
261
|
+
.stx-avatar--medium { width: 40px; height: 40px; font-size: 14px; }
|
|
262
|
+
.stx-avatar--large { width: 56px; height: 56px; font-size: 18px; }
|
|
263
|
+
.stx-avatar-img { width: 100%; height: 100%; object-fit: cover; }
|
|
264
|
+
|
|
265
|
+
/* Card */
|
|
266
|
+
.stx-card { background: #fff; border-radius: 8px; overflow: hidden; }
|
|
267
|
+
.stx-card--outlined { border: 1px solid #e0e0e0; }
|
|
268
|
+
.stx-card--elevated { box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
|
|
269
|
+
.stx-card-image img { width: 100%; display: block; }
|
|
270
|
+
.stx-card-body { padding: 16px; }
|
|
271
|
+
.stx-card-title { margin: 0 0 4px; font-size: 18px; }
|
|
272
|
+
.stx-card-subtitle { margin: 0 0 8px; color: #666; font-size: 14px; }
|
|
273
|
+
.stx-card-footer { padding: 12px 16px; border-top: 1px solid #e0e0e0; }
|
|
274
|
+
|
|
275
|
+
/* Tabs */
|
|
276
|
+
.stx-tabs { display: flex; gap: 4px; border-bottom: 1px solid #e0e0e0; }
|
|
277
|
+
.stx-tab { padding: 8px 16px; border: none; background: none; cursor: pointer; color: #666; border-bottom: 2px solid transparent; transition: all 0.15s; }
|
|
278
|
+
.stx-tab:hover { color: #333; }
|
|
279
|
+
.stx-tab--active { color: #3498db; border-bottom-color: #3498db; }
|
|
280
|
+
.stx-tab--disabled { opacity: 0.5; cursor: not-allowed; }
|
|
281
|
+
.stx-tabs--pills { border-bottom: none; }
|
|
282
|
+
.stx-tabs--pills .stx-tab { border-radius: 20px; border-bottom: none; }
|
|
283
|
+
.stx-tabs--pills .stx-tab--active { background: #3498db; color: #fff; }
|
|
284
|
+
|
|
285
|
+
/* Dropdown */
|
|
286
|
+
.stx-dropdown { padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; background: #fff; cursor: pointer; min-width: 150px; }
|
|
287
|
+
.stx-dropdown:focus { outline: none; border-color: #3498db; }
|
|
288
|
+
.stx-dropdown--disabled { opacity: 0.5; cursor: not-allowed; }
|
|
289
|
+
|
|
290
|
+
/* Rating */
|
|
291
|
+
.stx-rating { display: inline-flex; gap: 4px; }
|
|
292
|
+
.stx-star { color: #ddd; cursor: pointer; transition: color 0.15s; }
|
|
293
|
+
.stx-star--filled { color: #f1c40f; }
|
|
294
|
+
.stx-star--half { background: linear-gradient(90deg, #f1c40f 50%, #ddd 50%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
|
|
295
|
+
.stx-rating--readonly .stx-star { cursor: default; }
|
|
296
|
+
.stx-rating--small .stx-star { font-size: 16px; }
|
|
297
|
+
.stx-rating--medium .stx-star { font-size: 24px; }
|
|
298
|
+
.stx-rating--large .stx-star { font-size: 32px; }
|
|
299
|
+
|
|
300
|
+
/* Slider */
|
|
301
|
+
.stx-slider { display: flex; align-items: center; gap: 12px; }
|
|
302
|
+
.stx-slider-track { flex: 1; }
|
|
303
|
+
.stx-slider input[type="range"] { width: 100%; }
|
|
304
|
+
.stx-slider-value { min-width: 40px; text-align: right; font-size: 14px; }
|
|
305
|
+
|
|
306
|
+
/* Radio Button */
|
|
307
|
+
.stx-radio { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
|
|
308
|
+
.stx-radio input { display: none; }
|
|
309
|
+
.stx-radio-circle { width: 18px; height: 18px; border: 2px solid #ddd; border-radius: 50%; position: relative; transition: all 0.15s; }
|
|
310
|
+
.stx-radio input:checked + .stx-radio-circle { border-color: #3498db; }
|
|
311
|
+
.stx-radio input:checked + .stx-radio-circle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 8px; height: 8px; background: #3498db; border-radius: 50%; }
|
|
312
|
+
.stx-radio--disabled { opacity: 0.5; cursor: not-allowed; }
|
|
313
|
+
|
|
314
|
+
/* Color Picker */
|
|
315
|
+
.stx-color-picker { display: flex; flex-direction: column; gap: 8px; }
|
|
316
|
+
.stx-color-picker-input { display: flex; align-items: center; gap: 8px; }
|
|
317
|
+
.stx-color-picker-input input[type="color"] { width: 40px; height: 40px; border: none; cursor: pointer; }
|
|
318
|
+
.stx-color-picker-value { font-family: monospace; }
|
|
319
|
+
.stx-color-picker-presets { display: flex; gap: 4px; flex-wrap: wrap; }
|
|
320
|
+
.stx-color-preset { width: 24px; height: 24px; border: 2px solid transparent; border-radius: 4px; cursor: pointer; }
|
|
321
|
+
.stx-color-preset:hover { border-color: #333; }
|
|
322
|
+
|
|
323
|
+
/* Date/Time Picker */
|
|
324
|
+
.stx-date-picker, .stx-time-picker { display: flex; flex-direction: column; gap: 4px; }
|
|
325
|
+
.stx-date-picker-input, .stx-time-picker-input { display: flex; align-items: center; gap: 4px; }
|
|
326
|
+
.stx-date-picker-input input, .stx-time-picker-input { padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; }
|
|
327
|
+
.stx-date-picker-clear { background: none; border: none; cursor: pointer; font-size: 16px; }
|
|
328
|
+
|
|
329
|
+
/* Autocomplete */
|
|
330
|
+
.stx-autocomplete { position: relative; }
|
|
331
|
+
.stx-autocomplete-input-wrapper { position: relative; }
|
|
332
|
+
.stx-autocomplete-input { width: 100%; padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px; }
|
|
333
|
+
.stx-autocomplete-spinner { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; border: 2px solid #ddd; border-top-color: #3498db; border-radius: 50%; animation: spin 0.6s linear infinite; }
|
|
334
|
+
.stx-autocomplete-list { position: absolute; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid #ddd; border-radius: 6px; max-height: 200px; overflow-y: auto; display: none; z-index: 10; }
|
|
335
|
+
.stx-autocomplete:focus-within .stx-autocomplete-list { display: block; }
|
|
336
|
+
.stx-autocomplete-item { padding: 8px 12px; cursor: pointer; }
|
|
337
|
+
.stx-autocomplete-item:hover { background: #f5f5f5; }
|
|
338
|
+
.stx-autocomplete-item--selected { background: #e8f4fc; }
|
|
339
|
+
|
|
340
|
+
/* Label */
|
|
341
|
+
.stx-label { display: inline-block; font-weight: 500; }
|
|
342
|
+
.stx-label--small { font-size: 12px; }
|
|
343
|
+
.stx-label--medium { font-size: 14px; }
|
|
344
|
+
.stx-label--large { font-size: 16px; }
|
|
345
|
+
.stx-label-required { color: #e74c3c; margin-left: 2px; }
|
|
346
|
+
|
|
347
|
+
/* Image */
|
|
348
|
+
.stx-image { display: block; max-width: 100%; }
|
|
349
|
+
|
|
350
|
+
/* Chip */
|
|
351
|
+
.stx-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; border-radius: 16px; font-size: 13px; }
|
|
352
|
+
.stx-chip--default { background: #e0e0e0; color: #333; }
|
|
353
|
+
.stx-chip--primary { background: #e8f4fc; color: #3498db; }
|
|
354
|
+
.stx-chip--success { background: #e8f8f0; color: #27ae60; }
|
|
355
|
+
.stx-chip--warning { background: #fef5e7; color: #f39c12; }
|
|
356
|
+
.stx-chip--error { background: #fdebeb; color: #e74c3c; }
|
|
357
|
+
.stx-chip--small { padding: 2px 8px; font-size: 11px; }
|
|
358
|
+
.stx-chip--large { padding: 6px 16px; font-size: 15px; }
|
|
359
|
+
.stx-chip-remove { background: none; border: none; cursor: pointer; opacity: 0.6; padding: 0 2px; }
|
|
360
|
+
.stx-chip-remove:hover { opacity: 1; }
|
|
361
|
+
|
|
362
|
+
/* Tooltip */
|
|
363
|
+
.stx-tooltip-wrapper { position: relative; display: inline-block; }
|
|
364
|
+
.stx-tooltip { position: absolute; background: #333; color: #fff; padding: 4px 8px; border-radius: 4px; font-size: 12px; white-space: nowrap; opacity: 0; visibility: hidden; transition: opacity 0.2s, visibility 0.2s; z-index: 1000; }
|
|
365
|
+
.stx-tooltip-wrapper:hover .stx-tooltip { opacity: 1; visibility: visible; }
|
|
366
|
+
.stx-tooltip--top { bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 8px; }
|
|
367
|
+
.stx-tooltip--bottom { top: 100%; left: 50%; transform: translateX(-50%); margin-top: 8px; }
|
|
368
|
+
.stx-tooltip--left { right: 100%; top: 50%; transform: translateY(-50%); margin-right: 8px; }
|
|
369
|
+
.stx-tooltip--right { left: 100%; top: 50%; transform: translateY(-50%); margin-left: 8px; }
|
|
370
|
+
|
|
371
|
+
/* Scroll View */
|
|
372
|
+
.stx-scroll-view { overflow: auto; }
|
|
373
|
+
.stx-scroll-view--vertical { overflow-x: hidden; overflow-y: auto; }
|
|
374
|
+
.stx-scroll-view--horizontal { overflow-x: auto; overflow-y: hidden; }
|
|
375
|
+
.stx-scroll-view--hide-scrollbar::-webkit-scrollbar { display: none; }
|
|
376
|
+
.stx-scroll-view--hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
|
|
377
|
+
.stx-scroll-view--smooth { scroll-behavior: smooth; }
|
|
378
|
+
|
|
379
|
+
/* Split View */
|
|
380
|
+
.stx-split-view { display: flex; }
|
|
381
|
+
.stx-split-view--horizontal { flex-direction: row; }
|
|
382
|
+
.stx-split-view--vertical { flex-direction: column; }
|
|
383
|
+
.stx-split-pane { overflow: auto; }
|
|
384
|
+
.stx-split-divider { background: #e0e0e0; flex-shrink: 0; }
|
|
385
|
+
.stx-split-view--horizontal .stx-split-divider { width: 4px; cursor: col-resize; }
|
|
386
|
+
.stx-split-view--vertical .stx-split-divider { height: 4px; cursor: row-resize; }
|
|
387
|
+
.stx-split-divider:hover { background: #3498db; }
|
|
388
|
+
|
|
389
|
+
/* Accordion */
|
|
390
|
+
.stx-accordion { border: 1px solid #e0e0e0; border-radius: 8px; overflow: hidden; }
|
|
391
|
+
.stx-accordion-item { border-bottom: 1px solid #e0e0e0; }
|
|
392
|
+
.stx-accordion-item:last-child { border-bottom: none; }
|
|
393
|
+
.stx-accordion-header { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: none; border: none; cursor: pointer; font-size: 14px; }
|
|
394
|
+
.stx-accordion-header:hover { background: #f5f5f5; }
|
|
395
|
+
.stx-accordion-icon { transition: transform 0.2s; }
|
|
396
|
+
.stx-accordion-item--open .stx-accordion-icon { transform: rotate(180deg); }
|
|
397
|
+
.stx-accordion-content { padding: 0 16px 16px; }
|
|
398
|
+
.stx-accordion-item--disabled { opacity: 0.5; }
|
|
399
|
+
.stx-accordion-item--disabled .stx-accordion-header { cursor: not-allowed; }
|
|
400
|
+
|
|
401
|
+
/* Stepper */
|
|
402
|
+
.stx-stepper { display: flex; }
|
|
403
|
+
.stx-stepper--horizontal { flex-direction: row; align-items: flex-start; }
|
|
404
|
+
.stx-stepper--vertical { flex-direction: column; }
|
|
405
|
+
.stx-step { display: flex; align-items: center; }
|
|
406
|
+
.stx-stepper--vertical .stx-step { flex-direction: row; }
|
|
407
|
+
.stx-step-indicator { width: 32px; height: 32px; border-radius: 50%; background: #e0e0e0; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 500; flex-shrink: 0; }
|
|
408
|
+
.stx-step--completed .stx-step-indicator { background: #27ae60; color: #fff; }
|
|
409
|
+
.stx-step--active .stx-step-indicator { background: #3498db; color: #fff; }
|
|
410
|
+
.stx-step-content { margin-left: 12px; }
|
|
411
|
+
.stx-step-label { font-size: 14px; font-weight: 500; }
|
|
412
|
+
.stx-step-description { font-size: 12px; color: #666; }
|
|
413
|
+
.stx-step-connector { flex: 1; height: 2px; background: #e0e0e0; margin: 0 8px; min-width: 20px; }
|
|
414
|
+
.stx-stepper--vertical .stx-step-connector { width: 2px; height: 20px; margin: 8px 0 8px 15px; }
|
|
415
|
+
|
|
416
|
+
/* Modal Component */
|
|
417
|
+
.stx-modal-component--hidden { display: none; }
|
|
418
|
+
.stx-modal-component-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 10000; }
|
|
419
|
+
.stx-modal-component-dialog { background: #fff; border-radius: 12px; max-height: 90vh; overflow: hidden; display: flex; flex-direction: column; }
|
|
420
|
+
.stx-modal-component--small .stx-modal-component-dialog { width: 300px; }
|
|
421
|
+
.stx-modal-component--medium .stx-modal-component-dialog { width: 500px; }
|
|
422
|
+
.stx-modal-component--large .stx-modal-component-dialog { width: 800px; }
|
|
423
|
+
.stx-modal-component--fullscreen .stx-modal-component-dialog { width: 100%; height: 100%; border-radius: 0; }
|
|
424
|
+
.stx-modal-component-header { display: flex; justify-content: space-between; align-items: center; padding: 16px; border-bottom: 1px solid #e0e0e0; }
|
|
425
|
+
.stx-modal-component-title { margin: 0; font-size: 18px; }
|
|
426
|
+
.stx-modal-component-close { background: none; border: none; font-size: 24px; cursor: pointer; opacity: 0.6; }
|
|
427
|
+
.stx-modal-component-close:hover { opacity: 1; }
|
|
428
|
+
.stx-modal-component-body { padding: 16px; overflow-y: auto; flex: 1; }
|
|
429
|
+
.stx-modal-component-footer { padding: 16px; border-top: 1px solid #e0e0e0; display: flex; justify-content: flex-end; gap: 8px; }
|
|
430
|
+
|
|
431
|
+
/* List View */
|
|
432
|
+
.stx-list-view { border: 1px solid #e0e0e0; border-radius: 8px; overflow: hidden; }
|
|
433
|
+
.stx-list-view-items { list-style: none; margin: 0; padding: 0; }
|
|
434
|
+
.stx-list-view-item { padding: 12px 16px; border-bottom: 1px solid #e0e0e0; }
|
|
435
|
+
.stx-list-view-item:last-child { border-bottom: none; }
|
|
436
|
+
.stx-list-view--selectable .stx-list-view-item { cursor: pointer; }
|
|
437
|
+
.stx-list-view--selectable .stx-list-view-item:hover { background: #f5f5f5; }
|
|
438
|
+
.stx-list-view-item--selected { background: #e8f4fc; }
|
|
439
|
+
.stx-list-view-empty { padding: 24px; text-align: center; color: #666; }
|
|
440
|
+
|
|
441
|
+
/* Table */
|
|
442
|
+
.stx-table { overflow-x: auto; }
|
|
443
|
+
.stx-table table { width: 100%; border-collapse: collapse; }
|
|
444
|
+
.stx-table th, .stx-table td { padding: 12px; text-align: left; }
|
|
445
|
+
.stx-table th { font-weight: 600; background: #f5f5f5; }
|
|
446
|
+
.stx-table--bordered th, .stx-table--bordered td { border: 1px solid #e0e0e0; }
|
|
447
|
+
.stx-table--striped tbody tr:nth-child(even) { background: #f9f9f9; }
|
|
448
|
+
.stx-table--hoverable tbody tr:hover { background: #f5f5f5; }
|
|
449
|
+
.stx-table th[data-sortable] { cursor: pointer; }
|
|
450
|
+
.stx-table-sort-icon::after { content: '\u21C5'; margin-left: 4px; opacity: 0.3; }
|
|
451
|
+
.stx-table-sorted .stx-table-sort-icon::after { opacity: 1; }
|
|
452
|
+
.stx-table-sorted--asc .stx-table-sort-icon::after { content: '\u2191'; }
|
|
453
|
+
.stx-table-sorted--desc .stx-table-sort-icon::after { content: '\u2193'; }
|
|
454
|
+
|
|
455
|
+
/* Tree View */
|
|
456
|
+
.stx-tree-view { font-size: 14px; }
|
|
457
|
+
.stx-tree-node { padding-left: 20px; }
|
|
458
|
+
.stx-tree-node-content { display: flex; align-items: center; gap: 4px; padding: 4px; cursor: pointer; border-radius: 4px; }
|
|
459
|
+
.stx-tree-node-content:hover { background: #f5f5f5; }
|
|
460
|
+
.stx-tree-node--selected > .stx-tree-node-content { background: #e8f4fc; }
|
|
461
|
+
.stx-tree-node--disabled { opacity: 0.5; }
|
|
462
|
+
.stx-tree-toggle { width: 16px; cursor: pointer; transition: transform 0.2s; }
|
|
463
|
+
.stx-tree-toggle--expanded { transform: rotate(90deg); }
|
|
464
|
+
.stx-tree-toggle-placeholder { width: 16px; }
|
|
465
|
+
.stx-tree-children { padding-left: 8px; }
|
|
466
|
+
|
|
467
|
+
/* Data Grid */
|
|
468
|
+
.stx-data-grid { border: 1px solid #e0e0e0; border-radius: 8px; overflow: hidden; }
|
|
469
|
+
.stx-data-grid-table-wrapper { overflow-x: auto; }
|
|
470
|
+
.stx-data-grid-table { width: 100%; border-collapse: collapse; }
|
|
471
|
+
.stx-data-grid-table th, .stx-data-grid-table td { padding: 12px; text-align: left; border-bottom: 1px solid #e0e0e0; }
|
|
472
|
+
.stx-data-grid-table th { background: #f5f5f5; }
|
|
473
|
+
.stx-data-grid-header-cell { display: flex; align-items: center; gap: 8px; }
|
|
474
|
+
.stx-data-grid-sort, .stx-data-grid-filter { background: none; border: none; cursor: pointer; opacity: 0.5; }
|
|
475
|
+
.stx-data-grid-sort:hover, .stx-data-grid-filter:hover { opacity: 1; }
|
|
476
|
+
.stx-data-grid-pagination { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-top: 1px solid #e0e0e0; }
|
|
477
|
+
.stx-data-grid-page-buttons { display: flex; gap: 4px; }
|
|
478
|
+
.stx-data-grid-page-btn { padding: 4px 8px; border: 1px solid #e0e0e0; background: #fff; cursor: pointer; border-radius: 4px; }
|
|
479
|
+
.stx-data-grid-page-btn:disabled { opacity: 0.5; cursor: not-allowed; }
|
|
480
|
+
|
|
481
|
+
/* Chart */
|
|
482
|
+
.stx-chart { background: #f9f9f9; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
|
|
483
|
+
.stx-chart-placeholder { text-align: center; padding: 20px; }
|
|
484
|
+
.stx-chart-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
|
|
485
|
+
.stx-chart-type { font-size: 14px; color: #666; }
|
|
486
|
+
.stx-chart-info { font-size: 12px; color: #999; margin-top: 4px; }
|
|
487
|
+
|
|
488
|
+
/* Code Editor */
|
|
489
|
+
.stx-code-editor { display: flex; font-family: 'Monaco', 'Menlo', monospace; font-size: 13px; line-height: 1.5; overflow: hidden; border-radius: 8px; }
|
|
490
|
+
.stx-code-editor--dark { background: #1e1e1e; color: #d4d4d4; }
|
|
491
|
+
.stx-code-editor--light { background: #fff; color: #333; border: 1px solid #e0e0e0; }
|
|
492
|
+
.stx-code-editor-gutter { padding: 12px 8px; background: rgba(0,0,0,0.1); text-align: right; user-select: none; }
|
|
493
|
+
.stx-code-editor-line-number { color: #858585; }
|
|
494
|
+
.stx-code-editor-content { flex: 1; padding: 12px; overflow: auto; }
|
|
495
|
+
.stx-code-editor-content pre { margin: 0; }
|
|
496
|
+
.stx-code-editor--wrap .stx-code-editor-content { white-space: pre-wrap; word-wrap: break-word; }
|
|
497
|
+
|
|
498
|
+
/* Media Player */
|
|
499
|
+
.stx-media-player video, .stx-media-player audio { width: 100%; display: block; }
|
|
500
|
+
.stx-media-player--video { background: #000; }
|
|
501
|
+
|
|
502
|
+
/* File Explorer */
|
|
503
|
+
.stx-file-explorer { border: 1px solid #e0e0e0; border-radius: 8px; overflow: hidden; }
|
|
504
|
+
.stx-file-explorer-list { width: 100%; border-collapse: collapse; }
|
|
505
|
+
.stx-file-explorer-list th { text-align: left; padding: 8px 12px; background: #f5f5f5; font-weight: 500; }
|
|
506
|
+
.stx-file-explorer-list td { padding: 8px 12px; border-top: 1px solid #e0e0e0; }
|
|
507
|
+
.stx-file-explorer-item--selectable { cursor: pointer; }
|
|
508
|
+
.stx-file-explorer-item--selectable:hover { background: #f5f5f5; }
|
|
509
|
+
.stx-file-explorer-icon { margin-right: 8px; }
|
|
510
|
+
.stx-file-explorer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 16px; padding: 16px; }
|
|
511
|
+
.stx-file-explorer--grid .stx-file-explorer-item { text-align: center; padding: 12px; border-radius: 8px; }
|
|
512
|
+
.stx-file-explorer--grid .stx-file-explorer-icon { font-size: 32px; display: block; margin-bottom: 8px; }
|
|
513
|
+
.stx-file-explorer--grid .stx-file-explorer-name { font-size: 12px; word-break: break-all; }
|
|
514
|
+
|
|
515
|
+
/* WebView */
|
|
516
|
+
.stx-webview { border: none; display: block; }
|
|
517
|
+
|
|
518
|
+
/* Dark mode support */
|
|
519
|
+
@media (prefers-color-scheme: dark) {
|
|
520
|
+
.stx-input-label { color: #eee; }
|
|
521
|
+
.stx-input { background: #333; border-color: #555; color: #fff; }
|
|
522
|
+
.stx-card { background: #2d2d2d; color: #fff; }
|
|
523
|
+
.stx-card-subtitle { color: #aaa; }
|
|
524
|
+
.stx-progress { background: #444; }
|
|
525
|
+
.stx-dropdown { background: #333; border-color: #555; color: #fff; }
|
|
526
|
+
.stx-accordion { border-color: #444; }
|
|
527
|
+
.stx-accordion-item { border-color: #444; }
|
|
528
|
+
.stx-accordion-header:hover { background: #333; }
|
|
529
|
+
.stx-list-view { border-color: #444; }
|
|
530
|
+
.stx-list-view-item { border-color: #444; }
|
|
531
|
+
.stx-list-view--selectable .stx-list-view-item:hover { background: #333; }
|
|
532
|
+
.stx-table th { background: #333; }
|
|
533
|
+
.stx-table--bordered th, .stx-table--bordered td { border-color: #444; }
|
|
534
|
+
.stx-tree-node-content:hover { background: #333; }
|
|
535
|
+
.stx-data-grid { border-color: #444; }
|
|
536
|
+
.stx-data-grid-table th, .stx-data-grid-table td { border-color: #444; }
|
|
537
|
+
.stx-data-grid-table th { background: #333; }
|
|
538
|
+
.stx-modal-component-dialog { background: #2d2d2d; color: #fff; }
|
|
539
|
+
.stx-modal-component-header, .stx-modal-component-footer { border-color: #444; }
|
|
540
|
+
.stx-file-explorer { border-color: #444; }
|
|
541
|
+
.stx-file-explorer-list th { background: #333; }
|
|
542
|
+
.stx-file-explorer-list td { border-color: #444; }
|
|
543
|
+
.stx-autocomplete-list { background: #333; border-color: #444; }
|
|
544
|
+
.stx-autocomplete-item:hover { background: #444; }
|
|
545
|
+
.stx-chip--default { background: #444; color: #eee; }
|
|
546
|
+
.stx-chip--primary { background: #1a3a52; }
|
|
547
|
+
.stx-chip--success { background: #1a3a2a; }
|
|
548
|
+
.stx-chip--warning { background: #3a2a1a; }
|
|
549
|
+
.stx-chip--error { background: #3a1a1a; }
|
|
550
|
+
}
|
|
551
|
+
`;function xY(){return!1}function jZ(){return typeof window<"u"&&typeof document<"u"}var b=[];function CY(){return`modal-${Date.now()}-${Math.random().toString(36).substring(2,9)}`}function IY(Z){switch(Z){case"info":return"ℹ";case"warning":return"⚠";case"error":return"✖";case"success":return"✔";case"question":return"❓";default:return"ℹ"}}function ZZ(Z){if(Z==="question")return[{label:"No",style:"default"},{label:"Yes",style:"primary"}];return[{label:"OK",style:"primary"}]}function SY(Z){let{options:Y}=Z,$=IY(Y.type),J=Y.buttons||ZZ(Y.type),Q=Y.type||"info",X="";return J.forEach((R,z)=>{let K=R.style==="destructive"?"destructive":R.style==="primary"?"primary":"default",F=z===(Y.defaultButton??J.length-1)?"autofocus":"";X+=`<button class="stx-modal-btn ${K}" data-index="${z}" ${F}>${R.label}</button>`}),`
|
|
552
|
+
<div class="stx-modal-overlay" data-modal-id="${Z.id}">
|
|
553
|
+
<div class="stx-modal ${Q}" role="dialog" aria-modal="true" aria-labelledby="${Z.id}-title">
|
|
554
|
+
<div class="stx-modal-icon">${$}</div>
|
|
555
|
+
<div class="stx-modal-content">
|
|
556
|
+
${Y.title?`<h2 id="${Z.id}-title" class="stx-modal-title">${fZ(Y.title)}</h2>`:""}
|
|
557
|
+
<p class="stx-modal-message">${fZ(Y.message)}</p>
|
|
558
|
+
</div>
|
|
559
|
+
<div class="stx-modal-buttons">${X}</div>
|
|
560
|
+
</div>
|
|
561
|
+
</div>
|
|
562
|
+
`}function fZ(Z){return Z.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function C(Z,Y,$=!1){let J=b.indexOf(Z);if(J>-1)b.splice(J,1);if(Z.element&&jZ())Z.element.remove();let X=(Z.options.buttons||ZZ(Z.options.type))[Y];if(X?.action)X.action();Z.resolve({buttonIndex:Y,cancelled:$})}async function m(Z){let Y=xY(),$=CY();return new Promise((J)=>{let Q={id:$,options:Z,resolve:J};if(b.push(Q),Y)console.log(`[stx-modal] Showing native modal: ${Z.title||"Modal"}`),setTimeout(()=>{C(Q,Z.defaultButton??0,!1)},0);else if(jZ())try{let X=document.createElement("div");X.innerHTML=SY(Q);let R=X.firstElementChild;if(!R){console.log(`[stx-modal] ${Z.type?.toUpperCase()||"INFO"}: ${Z.title||"Modal"}`),console.log(`[stx-modal] ${Z.message}`),setTimeout(()=>{C(Q,Z.defaultButton??0,!1)},0);return}Q.element=R;try{document.body.appendChild(R)}catch{console.log(`[stx-modal] ${Z.type?.toUpperCase()||"INFO"}: ${Z.title||"Modal"}`),console.log(`[stx-modal] ${Z.message}`),setTimeout(()=>{C(Q,Z.defaultButton??0,!1)},0);return}try{R.querySelectorAll(".stx-modal-btn").forEach((z)=>{z.addEventListener("click",()=>{let K=Number.parseInt(z.dataset.index||"0",10);C(Q,K,!1)})})}catch{}try{R.addEventListener("click",(z)=>{if(z.target===R){let K=Z.cancelButton??0;C(Q,K,!0)}})}catch{}try{let z=(K)=>{if(K.key==="Escape"){let F=Z.cancelButton??0;C(Q,F,!0),document.removeEventListener("keydown",z)}else if(K.key==="Enter"){let F=Z.defaultButton??(Z.buttons||ZZ(Z.type)).length-1;C(Q,F,!1),document.removeEventListener("keydown",z)}};document.addEventListener("keydown",z)}catch{}try{let z=R.querySelector(".stx-modal-btn[autofocus]");if(z)z.focus()}catch{}if(typeof process<"u"&&process.env.BUN_TEST)setTimeout(()=>{C(Q,Z.defaultButton??0,!1)},0)}catch{console.log(`[stx-modal] ${Z.type?.toUpperCase()||"INFO"}: ${Z.title||"Modal"}`),console.log(`[stx-modal] ${Z.message}`),setTimeout(()=>{C(Q,Z.defaultButton??0,!1)},0)}else{console.log(`[stx-modal] ${Z.type?.toUpperCase()||"INFO"}: ${Z.title||"Modal"}`),console.log(`[stx-modal] ${Z.message}`);let X=Z.buttons||ZZ(Z.type);console.log(`[stx-modal] Buttons: ${X.map((R)=>R.label).join(", ")}`),setTimeout(()=>{C(Q,Z.defaultButton??0,!1)},0)}})}async function vZ(Z,Y){return m({title:Z,message:Y,type:"info"})}async function wY(Z,Y){return m({title:Z,message:Y,type:"warning"})}async function BY(Z,Y){return m({title:Z,message:Y,type:"error"})}async function fY(Z,Y){return m({title:Z,message:Y,type:"success"})}async function yZ(Z,Y){return m({title:Z,message:Y,type:"question",buttons:[{label:"No",style:"default"},{label:"Yes",style:"primary"}],defaultButton:1,cancelButton:0})}async function vY(Z,Y="Confirm"){return(await yZ(Y,Z)).buttonIndex===1}async function yY(Z,Y="Alert"){await vZ(Y,Z)}async function gY(Z,Y="",$="Input"){if(jZ()&&typeof window.prompt==="function")return window.prompt(Z,Y);return console.log(`[stx-modal] PROMPT: ${$}`),console.log(`[stx-modal] ${Z}`),console.log(`[stx-modal] Default: ${Y}`),Y}function bY(){return b.length}function uY(){while(b.length>0){let Z=b[b.length-1];C(Z,0,!0)}}var mY=`
|
|
563
|
+
.stx-modal-overlay {
|
|
564
|
+
position: fixed;
|
|
565
|
+
inset: 0;
|
|
566
|
+
background: rgba(0, 0, 0, 0.5);
|
|
567
|
+
display: flex;
|
|
568
|
+
align-items: center;
|
|
569
|
+
justify-content: center;
|
|
570
|
+
z-index: 10000;
|
|
571
|
+
animation: stx-modal-fade-in 0.15s ease-out;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
@keyframes stx-modal-fade-in {
|
|
575
|
+
from { opacity: 0; }
|
|
576
|
+
to { opacity: 1; }
|
|
577
|
+
}
|
|
578
|
+
|
|
579
|
+
.stx-modal {
|
|
580
|
+
background: #fff;
|
|
581
|
+
border-radius: 12px;
|
|
582
|
+
padding: 24px;
|
|
583
|
+
max-width: 400px;
|
|
584
|
+
width: 90%;
|
|
585
|
+
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
|
|
586
|
+
animation: stx-modal-slide-up 0.2s ease-out;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
@keyframes stx-modal-slide-up {
|
|
590
|
+
from { transform: translateY(20px); opacity: 0; }
|
|
591
|
+
to { transform: translateY(0); opacity: 1; }
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
@media (prefers-color-scheme: dark) {
|
|
595
|
+
.stx-modal {
|
|
596
|
+
background: #2d2d2d;
|
|
597
|
+
color: #fff;
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
.stx-modal-icon {
|
|
602
|
+
font-size: 48px;
|
|
603
|
+
text-align: center;
|
|
604
|
+
margin-bottom: 16px;
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
.stx-modal.info .stx-modal-icon { color: #3498db; }
|
|
608
|
+
.stx-modal.warning .stx-modal-icon { color: #f39c12; }
|
|
609
|
+
.stx-modal.error .stx-modal-icon { color: #e74c3c; }
|
|
610
|
+
.stx-modal.success .stx-modal-icon { color: #27ae60; }
|
|
611
|
+
.stx-modal.question .stx-modal-icon { color: #9b59b6; }
|
|
612
|
+
|
|
613
|
+
.stx-modal-content {
|
|
614
|
+
text-align: center;
|
|
615
|
+
margin-bottom: 24px;
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
.stx-modal-title {
|
|
619
|
+
margin: 0 0 8px;
|
|
620
|
+
font-size: 20px;
|
|
621
|
+
font-weight: 600;
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
.stx-modal-message {
|
|
625
|
+
margin: 0;
|
|
626
|
+
color: #666;
|
|
627
|
+
line-height: 1.5;
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
@media (prefers-color-scheme: dark) {
|
|
631
|
+
.stx-modal-message { color: #aaa; }
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
.stx-modal-buttons {
|
|
635
|
+
display: flex;
|
|
636
|
+
gap: 8px;
|
|
637
|
+
justify-content: center;
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
.stx-modal-btn {
|
|
641
|
+
padding: 10px 24px;
|
|
642
|
+
border-radius: 6px;
|
|
643
|
+
font-size: 14px;
|
|
644
|
+
font-weight: 500;
|
|
645
|
+
cursor: pointer;
|
|
646
|
+
border: none;
|
|
647
|
+
transition: background 0.15s, transform 0.1s;
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
.stx-modal-btn:hover {
|
|
651
|
+
transform: translateY(-1px);
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
.stx-modal-btn:active {
|
|
655
|
+
transform: translateY(0);
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
.stx-modal-btn.default {
|
|
659
|
+
background: #e0e0e0;
|
|
660
|
+
color: #333;
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
.stx-modal-btn.default:hover {
|
|
664
|
+
background: #d0d0d0;
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
.stx-modal-btn.primary {
|
|
668
|
+
background: #3498db;
|
|
669
|
+
color: #fff;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
.stx-modal-btn.primary:hover {
|
|
673
|
+
background: #2980b9;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
.stx-modal-btn.destructive {
|
|
677
|
+
background: #e74c3c;
|
|
678
|
+
color: #fff;
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
.stx-modal-btn.destructive:hover {
|
|
682
|
+
background: #c0392b;
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
@media (prefers-color-scheme: dark) {
|
|
686
|
+
.stx-modal-btn.default {
|
|
687
|
+
background: #444;
|
|
688
|
+
color: #fff;
|
|
689
|
+
}
|
|
690
|
+
.stx-modal-btn.default:hover {
|
|
691
|
+
background: #555;
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
`;import gZ from"process";function hY(){if(gZ.platform)return gZ.platform;return"unknown"}function uZ(){if(typeof window<"u"&&window.craft?.tray)return!0;return!1}function mZ(Z,Y){if(Z.type==="separator")return{id:`sep-${Y}`,label:"",type:"separator"};let $={id:`item-${Y}-${Z.label.replace(/\s+/g,"-").toLowerCase()}`,label:Z.label,type:Z.type||"normal",enabled:Z.enabled!==!1};if(Z.accelerator)$.shortcut=Z.accelerator;if(Z.type==="checkbox")$.checked=Z.checked||!1;if(Z.type==="submenu"&&Z.submenu)$.submenu=Z.submenu.map((J,Q)=>mZ(J,Q));return $}function VZ(Z){return Z.map((Y,$)=>mZ(Y,$))}function hZ(Z,Y=0){if(Z.type==="separator")return'<hr class="stx-tray-separator" />';let $=" ".repeat(Y),J=Z.enabled===!1?"disabled":"",Q=Z.checked?"\u2713 ":"",X=Z.accelerator?`<span class="accelerator">${Z.accelerator}</span>`:"",R=`${$}<div class="stx-tray-item ${J}" data-action="${Z.label}">`;if(R+=`<span class="label">${Q}${Z.label}</span>${X}`,Z.type==="submenu"&&Z.submenu){R+='<span class="arrow">\u25B8</span>',R+='<div class="stx-tray-submenu">';for(let z of Z.submenu)R+=hZ(z,Y+1);R+="</div>"}return R+="</div>",R}function cY(Z){let Y='<div class="stx-tray-menu">';for(let $ of Z)Y+=hZ($);return Y+="</div>",Y}var v=new Map;function pY(){return`tray-${Date.now()}-${Math.random().toString(36).substring(2,9)}`}var bZ=!1;function lY(){if(bZ||typeof window>"u")return;window.addEventListener("craft:tray:menu",(Z)=>{let{action:Y}=Z.detail;for(let $ of v.values()){let J=$.handlers.get(Y);if(J){J();break}}}),bZ=!0}async function cZ(Z={}){let Y=pY(),$=hY(),J=uZ(),Q={icon:Z.icon||"",tooltip:Z.tooltip||"stx Application",menu:Z.menu||[],visible:!0},X=new Map;for(let z of Z.menu||[]){if(z.type!=="separator"&&z.onClick)X.set(z.label,z.onClick);if(z.type==="submenu"&&z.submenu){for(let K of z.submenu)if(K.type!=="separator"&&K.onClick)X.set(K.label,K.onClick)}}if(v.set(Y,{state:Q,handlers:X}),J){lY();let z=window;try{if(Q.tooltip)await z.craft.tray.setTitle({title:Q.tooltip}),await z.craft.tray.setTooltip({tooltip:Q.tooltip});if(Q.icon)await z.craft.tray.setIcon({icon:Q.icon});let K=VZ(Q.menu);await z.craft.tray.setMenu({items:K}),console.log(`[stx-tray] Native tray created for ${$}`)}catch(K){console.warn("[stx-tray] Failed to create native tray:",K)}}else console.log("[stx-tray] Created simulated tray (not in Craft window)"),console.log(`[stx-tray] ID: ${Y}`),console.log(`[stx-tray] Tooltip: ${Q.tooltip}`),console.log(`[stx-tray] Menu items: ${Q.menu.length}`);return{id:Y,setIcon:(z)=>{if(Q.icon=z,J)window.craft.tray.setIcon({icon:z}).catch((F)=>{console.warn("[stx-tray] Failed to set icon:",F)});console.log(`[stx-tray:${Y}] Icon updated`)},setTooltip:(z)=>{if(Q.tooltip=z,J)window.craft.tray.setTooltip({tooltip:z}).catch((F)=>{console.warn("[stx-tray] Failed to set tooltip:",F)});console.log(`[stx-tray:${Y}] Tooltip: ${z}`)},setMenu:(z)=>{Q.menu=z,X.clear();for(let K of z){if(K.type!=="separator"&&K.onClick)X.set(K.label,K.onClick);if(K.type==="submenu"&&K.submenu){for(let F of K.submenu)if(F.type!=="separator"&&F.onClick)X.set(F.label,F.onClick)}}if(J){let K=window,F=VZ(z);K.craft.tray.setMenu({items:F}).catch((j)=>{console.warn("[stx-tray] Failed to set menu:",j)})}console.log(`[stx-tray:${Y}] Menu updated (${z.length} items)`)},destroy:()=>{if(Q.visible=!1,v.delete(Y),J)window.craft.tray.destroy?.().catch((K)=>{console.warn("[stx-tray] Failed to destroy tray:",K)});console.log(`[stx-tray:${Y}] Destroyed`)}}}var dY=cZ;function rY(){return Array.from(v.keys())}function nY(Z){let Y=v.get(Z);if(!Y)return null;let $=uZ();return{id:Z,setIcon:(J)=>{if(Y.state.icon=J,$)window.craft.tray.setIcon({icon:J}).catch(()=>{})},setTooltip:(J)=>{if(Y.state.tooltip=J,$)window.craft.tray.setTooltip({tooltip:J}).catch(()=>{})},setMenu:(J)=>{if(Y.state.menu=J,$){let Q=window,X=VZ(J);Q.craft.tray.setMenu({items:X}).catch(()=>{})}},destroy:()=>{if(v.delete(Z),$)window.craft.tray.destroy?.().catch(()=>{})}}}function oY(Z,Y){let $=v.get(Z);if(!$)return!1;let J=$.handlers.get(Y);if(J)return J(),!0;return!1}function aY(Z){let Y=v.get(Z);if(!Y)return null;return cY(Y.state.menu)}function iY(){return`
|
|
695
|
+
// STX Desktop Tray Bridge
|
|
696
|
+
// Provides convenient wrappers around window.craft.tray APIs
|
|
697
|
+
window.stxTray = {
|
|
698
|
+
setTitle: (title) => window.craft?.tray?.setTitle({ title }),
|
|
699
|
+
setTooltip: (tooltip) => window.craft?.tray?.setTooltip({ tooltip }),
|
|
700
|
+
setIcon: (icon) => window.craft?.tray?.setIcon({ icon }),
|
|
701
|
+
setMenu: (items) => window.craft?.tray?.setMenu({ items }),
|
|
702
|
+
destroy: () => window.craft?.tray?.destroy(),
|
|
703
|
+
|
|
704
|
+
// Check if tray is available
|
|
705
|
+
isAvailable: () => typeof window.craft?.tray !== 'undefined',
|
|
706
|
+
};
|
|
707
|
+
`}var sY=`
|
|
708
|
+
.stx-tray-menu {
|
|
709
|
+
background: #2d2d2d;
|
|
710
|
+
border-radius: 8px;
|
|
711
|
+
padding: 4px 0;
|
|
712
|
+
min-width: 200px;
|
|
713
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
|
|
714
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
715
|
+
font-size: 13px;
|
|
716
|
+
color: #fff;
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
.stx-tray-item {
|
|
720
|
+
padding: 6px 12px;
|
|
721
|
+
display: flex;
|
|
722
|
+
align-items: center;
|
|
723
|
+
justify-content: space-between;
|
|
724
|
+
cursor: pointer;
|
|
725
|
+
position: relative;
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
.stx-tray-item:hover {
|
|
729
|
+
background: #3d3d3d;
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
.stx-tray-item.disabled {
|
|
733
|
+
opacity: 0.5;
|
|
734
|
+
cursor: not-allowed;
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
.stx-tray-item .label {
|
|
738
|
+
flex: 1;
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
.stx-tray-item .accelerator {
|
|
742
|
+
margin-left: 20px;
|
|
743
|
+
opacity: 0.6;
|
|
744
|
+
font-size: 12px;
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
.stx-tray-item .arrow {
|
|
748
|
+
margin-left: 8px;
|
|
749
|
+
font-size: 10px;
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
.stx-tray-separator {
|
|
753
|
+
margin: 4px 0;
|
|
754
|
+
border: none;
|
|
755
|
+
border-top: 1px solid #444;
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
.stx-tray-submenu {
|
|
759
|
+
position: absolute;
|
|
760
|
+
left: 100%;
|
|
761
|
+
top: 0;
|
|
762
|
+
background: #2d2d2d;
|
|
763
|
+
border-radius: 8px;
|
|
764
|
+
padding: 4px 0;
|
|
765
|
+
min-width: 150px;
|
|
766
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
|
|
767
|
+
display: none;
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
.stx-tray-item:hover > .stx-tray-submenu {
|
|
771
|
+
display: block;
|
|
772
|
+
}
|
|
773
|
+
`;function pZ(Z){let Y=new Set(Z.properties??[]);if(Z.canChooseDirectories)Y.add("openDirectory");if(Z.canChooseFiles)Y.add("openFile");if(Z.multiSelections)Y.add("multiSelections");if(Z.showHiddenFiles)Y.add("showHiddenFiles");if(Z.canCreateDirectories)Y.add("createDirectory");return{...Z,properties:[...Y]}}function YZ(){if(typeof window<"u"&&window.craft?.dialog)return!0;return!1}async function tY(Z={}){if(YZ()){let Y=window;try{return await Y.craft.dialog.showOpenDialog(pZ(Z))}catch($){console.warn("[stx-dialog] Failed to show native open dialog:",$)}}return new Promise((Y)=>{if(typeof document>"u"){Y({canceled:!0,filePaths:[]});return}let $=new Set(pZ(Z).properties),J=document.createElement("input");if(J.type="file",J.multiple=$.has("multiSelections"),Z.filters?.length){let Q=Z.filters.flatMap((X)=>X.extensions.map((R)=>`.${R}`));J.accept=Q.join(",")}if($.has("openDirectory")&&!$.has("openFile"))J.webkitdirectory=!0;J.onchange=()=>{let Q=Array.from(J.files||[]);if(Q.length===0)Y({canceled:!0,filePaths:[]});else{let X=Q.map((R)=>R.name);Y({canceled:!1,filePaths:X})}},J.oncancel=()=>{Y({canceled:!0,filePaths:[]})},J.click()})}async function eY(Z={}){if(YZ()){let $=window;try{return await $.craft.dialog.showSaveDialog(Z)}catch(J){console.warn("[stx-dialog] Failed to show native save dialog:",J)}}if(typeof window<"u"&&"showSaveFilePicker"in window)try{let $=Z.filters?.map((Q)=>({description:Q.name,accept:{"*/*":Q.extensions.map((X)=>`.${X}`)}}));return{canceled:!1,filePath:(await window.showSaveFilePicker({suggestedName:Z.defaultPath,types:$})).name}}catch($){return{canceled:!0}}console.warn("[stx-dialog] Save dialog not available, using prompt fallback");let Y=prompt("Enter filename:",Z.defaultPath||"file.txt");if(Y)return{canceled:!1,filePath:Y};return{canceled:!0}}async function d(Z){if(YZ()){let R=window;try{return await R.craft.dialog.showMessageBox(Z)}catch(z){console.warn("[stx-dialog] Failed to show native message box:",z)}}let Y=Z.buttons||["OK"],$=Z.detail?`
|
|
774
|
+
|
|
775
|
+
${Z.detail}`:"",J=`${Z.message}${$}`;if(Y.length===1)return alert(J),{response:0};let Q=Z.cancelButton??Y.length-1,X=Z.defaultButton!==void 0&&Z.defaultButton!==Q?Z.defaultButton:Y.findIndex((R,z)=>z!==Q);if(Y.length>2)console.warn(`[stx-dialog] ${Y.length} buttons requested; a browser confirm offers two. Reachable: "${Y[X]}" and "${Y[Q]}".`);return{response:confirm(J)?X:Q}}async function Z6(Z={}){if(YZ()){let Y=window;try{return await Y.craft.dialog.showColorPicker(Z)}catch($){console.warn("[stx-dialog] Failed to show native color picker:",$)}}return new Promise((Y)=>{if(typeof document>"u"){Y({canceled:!0});return}let $=document.createElement("input");$.type="color",$.value=Z.color||"#000000",$.onchange=()=>{Y({canceled:!1,color:$.value})},$.oncancel=()=>{Y({canceled:!0})},$.click()})}async function Y6(Z,Y){await d({type:"info",title:Y||"Alert",message:Z,buttons:["OK"]})}async function $6(Z,Y){return(await d({type:"question",title:Y||"Confirm",message:Z,buttons:["OK","Cancel"],defaultButton:0,cancelButton:1})).response===0}async function J6(Z,Y){await d({type:"error",title:Y||"Error",message:Z,buttons:["OK"]})}async function G6(Z,Y){await d({type:"warning",title:Y||"Warning",message:Z,buttons:["OK"]})}function Q6(){return`
|
|
776
|
+
// STX Desktop Dialog Bridge
|
|
777
|
+
// Provides convenient wrappers around window.craft.dialog APIs
|
|
778
|
+
window.stxDialog = {
|
|
779
|
+
// File dialogs
|
|
780
|
+
showOpenDialog: (options) => window.craft?.dialog?.showOpenDialog(options),
|
|
781
|
+
showSaveDialog: (options) => window.craft?.dialog?.showSaveDialog(options),
|
|
782
|
+
|
|
783
|
+
// Message dialogs
|
|
784
|
+
showMessageBox: (options) => window.craft?.dialog?.showMessageBox(options),
|
|
785
|
+
|
|
786
|
+
// Color picker
|
|
787
|
+
showColorPicker: (options) => window.craft?.dialog?.showColorPicker(options),
|
|
788
|
+
|
|
789
|
+
// Font picker
|
|
790
|
+
showFontPicker: (options) => window.craft?.dialog?.showFontPicker(options),
|
|
791
|
+
|
|
792
|
+
// Convenience functions
|
|
793
|
+
alert: async (message, title) => {
|
|
794
|
+
return window.craft?.dialog?.showMessageBox({
|
|
795
|
+
type: 'info',
|
|
796
|
+
title: title || 'Alert',
|
|
797
|
+
message,
|
|
798
|
+
buttons: ['OK'],
|
|
799
|
+
});
|
|
800
|
+
},
|
|
801
|
+
|
|
802
|
+
confirm: async (message, title) => {
|
|
803
|
+
const result = await window.craft?.dialog?.showMessageBox({
|
|
804
|
+
type: 'question',
|
|
805
|
+
title: title || 'Confirm',
|
|
806
|
+
message,
|
|
807
|
+
buttons: ['Cancel', 'OK'],
|
|
808
|
+
});
|
|
809
|
+
return result?.response === 1;
|
|
810
|
+
},
|
|
811
|
+
|
|
812
|
+
error: async (message, title) => {
|
|
813
|
+
return window.craft?.dialog?.showMessageBox({
|
|
814
|
+
type: 'error',
|
|
815
|
+
title: title || 'Error',
|
|
816
|
+
message,
|
|
817
|
+
buttons: ['OK'],
|
|
818
|
+
});
|
|
819
|
+
},
|
|
820
|
+
|
|
821
|
+
// Check if dialog is available
|
|
822
|
+
isAvailable: () => typeof window.craft?.dialog !== 'undefined',
|
|
823
|
+
};
|
|
824
|
+
`}import I from"process";import{existsSync as X6}from"fs";import{dirname as z6,join as R6}from"path";import{craftBinaryNotFoundMessage as lZ,resolveCraftBinary as K6}from"craft-native";var h={};function F6(Z){h={...h,...Z}}function O6(){return{...h}}function j6(){h={}}function qZ(Z){if(!Z.sidebarConfig)return;let Y={...Z.sidebarConfig};if(Y.variant==="desktop")Y.material=Y.material??"sidebar",Y.backgroundEffect=Y.backgroundEffect??"shimmer",Y.allowsVibrancy=Y.allowsVibrancy??!0;return Y}function $Z(){let Z=z6(I.execPath),Y=Z.includes(".app/Contents/MacOS")?R6(Z,"craft"):void 0,$=[I.env.CRAFT_BINARY_PATH,h.craftBinaryPath,...h.additionalSearchPaths||[],Y];for(let J of $)if(J&&X6(J))return J;return K6()}var H=new Map;function UZ(Z){let Y=H.get(Z);if(!Y||Y.closed)return;Y.closed=!0;for(let $ of Y.closeListeners??[])try{$()}catch(J){console.warn(`[stx/desktop] window ${Z} close listener threw:`,J)}Y.closeListeners?.clear()}var V6=50;async function PZ(Z,Y){let $=Y.show().then(()=>({failed:!1}),(Q)=>({failed:!0,error:Q})),J=await Promise.race([$,new Promise((Q)=>setTimeout(()=>Q(null),V6))]);if(J?.failed)throw J.error;$.then(()=>UZ(Z))}function q6(){return Array.from(H.keys())}function U6(Z){let Y=H.get(Z);if(!Y)return null;return JZ(Z,Y.app)}function P6(){for(let[Z,Y]of H)try{Y.app?.close?.()}catch($){console.warn(`Failed to close window ${Z}:`,$)}H.clear()}function JZ(Z,Y){return{id:Z,show:()=>{console.log(`[stx/desktop] Window ${Z} shown`)},hide:()=>{console.log("[stx/desktop] To hide window, use window.craft.window.hide() from inside the webview")},close:()=>{let $=H.get(Z);if($?.app)$.app.close(),UZ(Z),H.delete(Z),console.log(`[stx/desktop] Window ${Z} closed`)},onClosed:($)=>{let J=H.get(Z);if(!J||J.closed)return queueMicrotask($),()=>{};return J.closeListeners??=new Set,J.closeListeners.add($),()=>J.closeListeners?.delete($)},focus:()=>{console.log("[stx/desktop] To focus window, use window.craft.window.focus() from inside the webview")},minimize:()=>{console.log("[stx/desktop] To minimize window, use window.craft.window.minimize() from inside the webview")},maximize:()=>{console.log("[stx/desktop] To maximize window, use window.craft.window.maximize() from inside the webview")},restore:()=>{console.log("[stx/desktop] To restore window, use window.craft.window.show() from inside the webview")},setTitle:($)=>{console.log(`[stx/desktop] To set title, use window.craft.window.setTitle({ title: "${$}" }) from inside the webview`)},loadURL:($)=>{console.log(`[stx/desktop] To navigate, use window.location.href = "${$}" from inside the webview`)},reload:()=>{console.log("[stx/desktop] To reload, use window.craft.window.reload() from inside the webview")}}}function LZ(Z,Y={}){let $=["--url",Z,"--title",Y.title||"stx Desktop","--width",String(Y.width??1200),"--height",String(Y.height??800)];if(Y.darkMode)$.push("--dark");if(Y.hotReload)$.push("--hot-reload");if(Y.resizable===!1)$.push("--no-resize");if(Y.frameless)$.push("--frameless");if(Y.alwaysOnTop)$.push("--always-on-top");if(Y.titlebarHidden)$.push("--titlebar-hidden");if(Y.systemTray)$.push("--system-tray");if(Y.hideDockIcon)$.push("--hide-dock-icon");if(Y.devTools===!1)$.push("--no-devtools");if(Y.nativeSidebar)$.push("--native-sidebar");if(Y.sidebarWidth!==void 0)$.push("--sidebar-width",String(Y.sidebarWidth));let J=qZ(Y);if(J)$.push("--sidebar-config",JSON.stringify(J));return $}async function L6(Z,Y={}){let $=`craft-window-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,J=$Z();try{let{createApp:Q}=await import("craft-native"),X=Q({url:Z,craftPath:J,window:{title:Y.title||"stx Desktop",width:Y.width??1200,height:Y.height??800,darkMode:Y.darkMode??!1,hotReload:Y.hotReload??!1,resizable:Y.resizable??!0,frameless:Y.frameless??!1,alwaysOnTop:Y.alwaysOnTop??!1,titlebarHidden:Y.titlebarHidden??!1,systemTray:Y.systemTray??!1,hideDockIcon:Y.hideDockIcon??!1,devTools:Y.devTools??!1,nativeSidebar:Y.nativeSidebar??!1,sidebarWidth:Y.sidebarWidth,sidebarConfig:qZ(Y)}});return H.set($,{app:X,url:Z,options:Y}),await PZ($,X),JZ($,X)}catch{try{let{spawn:Q}=await import("child_process"),X=Q(J,LZ(Z,Y),{stdio:"inherit"});X.on("error",(z)=>{console.error(z.code==="ENOENT"?lZ(J):`craft child error: ${z.message}`)});let R={close:()=>X.kill()};return H.set($,{app:R,url:Z,options:Y}),X.on("exit",()=>UZ($)),JZ($,R)}catch(Q){return console.error("Failed to spawn craft binary:",Q.message),null}}}async function W6(Z,Y={}){let $=`http://localhost:${Z}/`;if(I.env.NODE_ENV==="test"||I.env.BUN_TEST)return console.warn("\u26A0 Skipping native window in test environment"),console.log("(Skipping browser fallback in test environment)"),!1;try{let{createApp:Q}=await import("craft-native");console.log("\u26A1 Opening native window via craft-native\u2026");let X=!Y.nativeSidebar,R=qZ(Y),z=Q({url:$,craftPath:$Z(),window:{title:Y.title||"stx Development",width:Y.width||1400,height:Y.height||900,resizable:!0,systemTray:X,darkMode:Y.darkMode??!0,hotReload:Y.hotReload??!0,devTools:!0,titlebarHidden:Y.titlebarHidden??!1,nativeSidebar:Y.nativeSidebar??!1,sidebarWidth:Y.sidebarWidth??260,sidebarConfig:R}}),K=`dev-window-${Z}`;return H.set(K,{app:z,url:$,options:Y}),await PZ(K,z),console.log(`\u2713 Native window opened at ${$}`),!0}catch{let Q=$Z();try{console.log(`\u26A1 Opening native window via craft binary (${Q})\u2026`);let{spawn:X}=await import("child_process"),R=X(Q,LZ($,{title:"stx Development",width:1400,height:900,hotReload:!0,...Y}),{stdio:"inherit"});R.on("exit",()=>I.exit(0)),R.on("error",(K)=>{console.warn(K.code==="ENOENT"?lZ(Q):`craft child error: ${K.message}`)});let z=`dev-window-${Z}`;return H.set(z,{app:{close:()=>R.kill()},url:$,options:Y}),console.log(`\u2713 Native window opened at ${$}`),!0}catch(X){console.warn("\u26A0 Could not spawn craft binary:",X.message)}if(I.env.NODE_ENV==="test"||I.env.BUN_TEST)return console.log("(Skipping browser fallback in test environment)"),!1;console.log("\uD83D\uDCF1 Opening in browser instead\u2026");try{let{spawn:X}=await import("child_process"),R=I.platform;return X(R==="darwin"?"open":R==="win32"?"cmd":"xdg-open",R==="win32"?["/c","start",$]:[$],{detached:!0,stdio:"ignore"}).unref(),console.log(`\u2713 Browser opened at ${$}`),!0}catch(X){return console.error("Could not open browser:",X),console.log(`Please open manually: ${$}`),!1}}}async function D6(Z,Y={}){let{title:$="stx Desktop",width:J=1200,height:Q=800,darkMode:X=!1,hotReload:R=!1,resizable:z=!0,frameless:K=!1,alwaysOnTop:F=!1}=Y;try{let{createApp:j}=await import("craft-native"),V=$Z(),O=j({html:Z,craftPath:V,window:{title:$,width:J,height:Q,darkMode:X,hotReload:R,resizable:z,frameless:K,alwaysOnTop:F}}),P=`craft-window-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;return H.set(P,{app:O,url:"html-content",options:Y}),await PZ(P,O),JZ(P,O)}catch(j){return console.error("Failed to create window with HTML:",j),null}}function M6(){try{return y.resolve("craft-native"),!0}catch{return!1}}function T6(){return`
|
|
825
|
+
// STX Desktop Window Bridge
|
|
826
|
+
// Provides convenient wrappers around window.craft APIs
|
|
827
|
+
window.stxWindow = {
|
|
828
|
+
// Window control
|
|
829
|
+
hide: () => window.craft?.window?.hide(),
|
|
830
|
+
show: () => window.craft?.window?.show(),
|
|
831
|
+
toggle: () => window.craft?.window?.toggle(),
|
|
832
|
+
close: () => window.craft?.window?.close(),
|
|
833
|
+
minimize: () => window.craft?.window?.minimize(),
|
|
834
|
+
maximize: () => window.craft?.window?.maximize(),
|
|
835
|
+
focus: () => window.craft?.window?.focus(),
|
|
836
|
+
center: () => window.craft?.window?.center(),
|
|
837
|
+
reload: () => window.craft?.window?.reload(),
|
|
838
|
+
toggleFullscreen: () => window.craft?.window?.toggleFullscreen(),
|
|
839
|
+
|
|
840
|
+
// Window properties
|
|
841
|
+
setTitle: (title) => window.craft?.window?.setTitle({ title }),
|
|
842
|
+
setSize: (width, height) => window.craft?.window?.setSize({ width, height }),
|
|
843
|
+
setPosition: (x, y) => window.craft?.window?.setPosition({ x, y }),
|
|
844
|
+
setAlwaysOnTop: (alwaysOnTop) => window.craft?.window?.setAlwaysOnTop({ alwaysOnTop }),
|
|
845
|
+
setResizable: (resizable) => window.craft?.window?.setResizable({ resizable }),
|
|
846
|
+
setOpacity: (opacity) => window.craft?.window?.setOpacity({ opacity }),
|
|
847
|
+
|
|
848
|
+
// macOS-specific
|
|
849
|
+
setVibrancy: (vibrancy) => window.craft?.window?.setVibrancy({ vibrancy }),
|
|
850
|
+
|
|
851
|
+
// App control
|
|
852
|
+
quit: () => window.craft?.app?.quit(),
|
|
853
|
+
isDarkMode: () => window.craft?.app?.isDarkMode(),
|
|
854
|
+
getLocale: () => window.craft?.app?.getLocale(),
|
|
855
|
+
|
|
856
|
+
// Notifications
|
|
857
|
+
notify: (options) => window.craft?.app?.notify(options),
|
|
858
|
+
|
|
859
|
+
// Check if running in Craft
|
|
860
|
+
isCraftAvailable: () => typeof window.craft !== 'undefined',
|
|
861
|
+
};
|
|
862
|
+
|
|
863
|
+
// Expose as global for backwards compatibility
|
|
864
|
+
window.desktop = window.stxWindow;
|
|
865
|
+
`}import{pack as _6,packageApp as N6}from"craft-native";import{craftBinaryNotFoundMessage as E6,resolveCraftBinary as A6}from"craft-native";import{spawn as k6}from"child_process";import r from"process";import{AutoUpdater as dZ,canReplaceBundle as H6,clearQuarantine as x6,extractBundle as C6,generateUpdateManifest as rZ,readBundleIdentity as WZ,swapBundle as I6,verifyBundleTrust as S6}from"craft-native";var nZ="update.json";function oZ(Z,Y){return`https://github.com/${Z}/releases/latest/download/${Y}`}function aZ(Z,Y,$){return`https://github.com/${Z}/releases/download/${Y}/${$}`}function iZ(Z){let{repository:Y,manifestAsset:$=nZ,...J}=Z;return new dZ({...J,updateUrl:oZ(Y,$)})}function w6(Z){let Y=Z.tag??`v${Z.version}`,$={};for(let[J,Q]of Object.entries(Z.artifacts)){if(!Q)continue;$[J]={path:Q,url:aZ(Z.repository,Y,Q.split("/").pop())}}return rZ({version:Z.version,releaseNotes:Z.releaseNotes,platforms:$})}function GZ(Z=r.execPath){let Y=Z.split("/");for(let $=0;$<Y.length;$++)if(Y[$].endsWith(".app"))return Y.slice(0,$+1).join("/");return null}async function B6(){let Z=GZ();if(!Z)return null;return(await WZ(Z)).teamId}function sZ(){let Z=r.ppid;if(Z>1)try{r.kill(Z,"SIGTERM");return}catch{}r.exit(0)}function tZ(Z={}){let Y=Z.appPath??GZ(),$=Z.quit??(()=>r.exit(0));if(Y)k6("/usr/bin/open",["-n",Y],{detached:!0,stdio:"ignore"}).unref();let J=Z.quitDelayMs??0;if(J>0){setTimeout($,J).unref?.();return}$()}async function f6(Z){let{appPath:Y,requireSameTeam:$=!0,macos:J,...Q}=Z,X=Y??GZ();if(!X)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 R=J?.teamId??($?(await WZ(X)).teamId??void 0:void 0);return iZ({...Q,appPath:X,macos:{...J,teamId:R},relaunch:Z.relaunch??((z)=>tZ({appPath:z,quit:sZ,quitDelayMs:250}))})}var DZ=null,A=null;class eZ{_process;_startedAt;_endsAt;_options;_expireHandlers=[];_expireTimer=null;_stopped=!1;constructor(Z,Y){this._process=Z,this._options=Y,this._startedAt=new Date;let $=Y.duration;if($&&$>0){let J=$*60*1000;this._endsAt=new Date(this._startedAt.getTime()+J),this._expireTimer=setTimeout(()=>{this._stopped=!0;for(let Q of this._expireHandlers)try{Q()}catch{}},J)}else this._endsAt=null}get pid(){return this._process.pid}get startedAt(){return this._startedAt}get endsAt(){return this._endsAt}get options(){return{...this._options}}get isActive(){if(this._stopped)return!1;return this._process.exitCode===null}get remainingMs(){if(!this._endsAt)return null;let Z=this._endsAt.getTime()-Date.now();return Math.max(0,Z)}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;try{this._process.kill()}catch{}}onExpire(Z){this._expireHandlers.push(Z)}}function v6(Z={}){Z4();let{duration:Y,preventDisplaySleep:$=!0,preventIdleSleep:J=!0,preventSystemSleep:Q=!0,preventDiskSleep:X=!1,assertUserActivity:R=!0}=Z,z=[];if($)z.push("-d");if(J)z.push("-i");if(Q)z.push("-s");if(X)z.push("-m");if(R)z.push("-u");let K=[...z];if(Y&&Y>0)K.push("-t",String(Y*60));let F=Bun.spawn(["/usr/bin/caffeinate",...K],{stdio:["ignore","ignore","ignore"]}),j=new eZ(F,Z);return DZ=F,A=j,j}function Z4(Z){if(Z){if(Z.stop(),A===Z)DZ=null,A=null;return}if(A)A.stop();DZ=null,A=null}function y6(){return A!==null&&A.isActive}function g6(){if(!A||!A.isActive)return{active:!1,instance:null,startedAt:null,endsAt:null,durationMinutes:null};let Y=A.options.duration;return{active:!0,instance:A,startedAt:A.startedAt,endsAt:A.endsAt,durationMinutes:Y&&Y>0?Y:-1}}function b6(Z){let Y=Z||A;if(!Y||!Y.isActive)return"0:00";let $=Y.remainingMs;if($===null)return"\u221E";let J=Math.ceil($/1000),Q=Math.floor(J/3600),X=Math.floor(J%3600/60),R=J%60;if(Q>0)return`${Q}:${String(X).padStart(2,"0")}:${String(R).padStart(2,"0")}`;return`${X}:${String(R).padStart(2,"0")}`}function u6(Z){if(Z<=0||Z===-1)return"Indefinitely";if(Z<60)return`${Z} minutes`;if(Z===60)return"1 hour";if(Z%60===0)return`${Z/60} hours`;let Y=Math.floor(Z/60),$=Z%60;return`${Y}h ${$}m`}import{existsSync as MZ,mkdirSync as m6,readFileSync as h6,watch as c6,writeFileSync as p6}from"fs";import{homedir as l6,platform as d6}from"os";import{dirname as r6,join as n}from"path";function n6(Z){let Y=d6(),$=l6();switch(Y){case"darwin":return n($,"Library","Application Support",Z);case"win32":return n(process.env.APPDATA||n($,"AppData","Roaming"),Z);default:return n($,".config",Z)}}class Y4{_defaults;_data;_path;_changeHandlers=new Map;_anyChangeHandlers=new Set;_watcher=null;_writeTimer=null;_writing=!1;constructor(Z){this._defaults={...Z.defaults};let Y=Z.path?r6(Z.path):n6(Z.name);if(this._path=Z.path||n(Y,"preferences.json"),!MZ(Y))m6(Y,{recursive:!0});if(this._data=this._load(),Z.watch!==!1)this._setupWatcher()}get path(){return this._path}get(Z){if(Z in this._data)return this._data[Z];return this._defaults[Z]}set(Z,Y){let $=this.get(Z);if(JSON.stringify($)===JSON.stringify(Y))return;this._data[Z]=Y,this._scheduleSave(),this._notifyChange(Z,Y,$)}getAll(){return{...this._defaults,...this._data}}has(Z){return Z in this._data}delete(Z){if(!(Z in this._data))return;let Y=this._data[Z];delete this._data[Z],this._scheduleSave(),this._notifyChange(Z,this._defaults[Z],Y)}reset(){let Z={...this._data};this._data={},this._save();for(let Y of Object.keys(Z)){let $=this._defaults[Y];this._notifyChange(Y,$,Z[Y])}}onChange(Z,Y){let $=Z;if(!this._changeHandlers.has($))this._changeHandlers.set($,new Set);return this._changeHandlers.get($).add(Y),()=>{this._changeHandlers.get($)?.delete(Y)}}onAnyChange(Z){return this._anyChangeHandlers.add(Z),()=>{this._anyChangeHandlers.delete(Z)}}close(){if(this._watcher)this._watcher.close(),this._watcher=null;if(this._writeTimer)clearTimeout(this._writeTimer),this._writeTimer=null,this._save()}_load(){try{if(MZ(this._path)){let Z=h6(this._path,"utf-8");return JSON.parse(Z)}}catch{}return{}}_save(){this._writing=!0;try{let Z=JSON.stringify({...this._defaults,...this._data},null,2);p6(this._path,Z,"utf-8")}catch(Z){console.error(`Failed to save preferences to ${this._path}:`,Z)}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(!MZ(this._path))this._save();this._watcher=c6(this._path,()=>{if(this._writing)return;let Z=this._load(),Y={...this._data};this._data=Z;let $=new Set([...Object.keys(Y),...Object.keys(Z)]);for(let J of $){let Q=J in Y?Y[J]:this._defaults[J],X=J in Z?Z[J]:this._defaults[J];if(JSON.stringify(Q)!==JSON.stringify(X))this._notifyChange(J,X,Q)}})}catch{}}_notifyChange(Z,Y,$){let J=this._changeHandlers.get(Z);if(J)for(let Q of J)try{Q(Y,$)}catch{}for(let Q of this._anyChangeHandlers)try{Q(Z,Y,$)}catch{}}}function o6(Z){return new Y4(Z)}import{existsSync as c,mkdirSync as $4,readFileSync as a6,unlinkSync as J4,writeFileSync as G4}from"fs";import{homedir as QZ,platform as Q4}from"os";import{join as p}from"path";function X4(Z){let Y=Z.toLowerCase().replace(/[^a-z0-9]/g,"-");return p(QZ(),"Library","LaunchAgents",`com.${Y}.plist`)}function z4(Z){let Y=process.env.XDG_CONFIG_HOME||p(QZ(),".config");return p(Y,"autostart",`${Z.toLowerCase()}.desktop`)}async function i6(Z,Y){let $=Y.appName||"StxApp",J=X4($),Q=p(QZ(),"Library","LaunchAgents");if(Z){let X=Y.appPath||process.execPath,R=Y.args||[],z=[X,...R],K=`<?xml version="1.0" encoding="UTF-8"?>
|
|
866
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
867
|
+
<plist version="1.0">
|
|
868
|
+
<dict>
|
|
869
|
+
<key>Label</key>
|
|
870
|
+
<string>com.${$.toLowerCase().replace(/[^a-z0-9]/g,"-")}</string>
|
|
871
|
+
<key>ProgramArguments</key>
|
|
872
|
+
<array>
|
|
873
|
+
${z.map((F)=>` <string>${Z8(F)}</string>`).join(`
|
|
874
|
+
`)}
|
|
875
|
+
</array>
|
|
876
|
+
<key>RunAtLoad</key>
|
|
877
|
+
<true/>
|
|
878
|
+
<key>KeepAlive</key>
|
|
879
|
+
<false/>
|
|
880
|
+
${Y.isHidden?` <key>ProcessType</key>
|
|
881
|
+
<string>Background</string>`:""}
|
|
882
|
+
</dict>
|
|
883
|
+
</plist>`;if(!c(Q))$4(Q,{recursive:!0});G4(J,K,"utf-8")}else if(c(J))J4(J)}async function s6(Z,Y){let $=Y.appName||"StxApp",J=z4($),Q=p(process.env.XDG_CONFIG_HOME||p(QZ(),".config"),"autostart");if(Z){let X=Y.appPath||process.execPath,R=Y.args||[],z=[X,...R].join(" "),K=`[Desktop Entry]
|
|
884
|
+
Type=Application
|
|
885
|
+
Name=${$}
|
|
886
|
+
Exec=${z}
|
|
887
|
+
Terminal=false
|
|
888
|
+
StartupNotify=false
|
|
889
|
+
${Y.isHidden?`X-GNOME-Autostart-enabled=true
|
|
890
|
+
NoDisplay=true`:""}
|
|
891
|
+
`;if(!c(Q))$4(Q,{recursive:!0});G4(J,K,"utf-8")}else if(c(J))J4(J)}async function t6(Z){return c(X4(Z))}async function e6(Z){let Y=z4(Z);if(!c(Y))return!1;try{let $=a6(Y,"utf-8");if($.includes("X-GNOME-Autostart-enabled=false"))return!1;if($.includes("Hidden=true"))return!1;return!0}catch{return!1}}function Z8(Z){return Z.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}async function Y8(Z,Y={}){let $=Q4();switch($){case"darwin":return i6(Z,Y);case"linux":return s6(Z,Y);default:throw Error(`Auto-launch is not yet supported on ${$}`)}}async function $8(Z){let Y=Z||"StxApp";switch(Q4()){case"darwin":return t6(Y);case"linux":return e6(Y);default:return!1}}var B=new Map,J8=0,XZ=!1;function R4(Z){let Y=Z.split("+").map((J)=>J.trim()),$={key:"",meta:!1,ctrl:!1,shift:!1,alt:!1};for(let J of Y){let Q=J.toLowerCase();switch(Q){case"cmd":case"command":case"meta":case"\u2318":$.meta=!0;break;case"ctrl":case"control":case"\u2303":$.ctrl=!0;break;case"shift":case"\u21E7":$.shift=!0;break;case"alt":case"option":case"opt":case"\u2325":$.alt=!0;break;case"cmdorctrl":case"commandorcontrol":if(typeof process<"u"&&process.platform==="darwin")$.meta=!0;else $.ctrl=!0;break;default:$.key=Q}}return $}function G8(Z){let Y=[];if(Z.ctrl)Y.push("\u2303");if(Z.alt)Y.push("\u2325");if(Z.shift)Y.push("\u21E7");if(Z.meta)Y.push("\u2318");return Y.push(Z.key.toUpperCase()),Y.join("")}function Q8(Z,Y){if(Y.meta!==Z.metaKey)return!1;if(Y.ctrl!==Z.ctrlKey)return!1;if(Y.shift!==Z.shiftKey)return!1;if(Y.alt!==Z.altKey)return!1;return Z.key.toLowerCase()===Y.key||Z.code.toLowerCase()===`key${Y.key}`}function K4(Z){for(let[,Y]of B)if(Q8(Z,Y.parsed)){Z.preventDefault(),Z.stopPropagation();try{Y.handler()}catch{}break}}function X8(){if(XZ)return;if(typeof document>"u")return;document.addEventListener("keydown",K4,!0),XZ=!0}function TZ(){if(!XZ)return;if(typeof document>"u")return;document.removeEventListener("keydown",K4,!0),XZ=!1}async function z8(Z,Y){if(typeof window>"u")return!1;let $=window.craft;if(!$?.hotkeys?.register)return!1;try{return await $.hotkeys.register(Z,Y),!0}catch{return!1}}async function _Z(Z){if(typeof window>"u")return;let Y=window.craft;if(!Y?.hotkeys?.unregister)return;try{await Y.hotkeys.unregister(Z)}catch{}}function R8(Z,Y){let $=`hotkey_${++J8}_${Date.now()}`,J=R4(Z);B.set($,{shortcut:Z,handler:Y,parsed:J}),z8($,Z),X8();let Q={shortcut:Z,id:$,unregister(){F4(Q)}};return Q}function F4(Z){if(B.delete(Z.id),_Z(Z.id),B.size===0)TZ()}function K8(){for(let[Z]of B)_Z(Z);B.clear(),TZ()}function F8(){return Array.from(B.entries()).map(([Z,Y])=>({shortcut:Y.shortcut,id:Z,unregister(){if(B.delete(Z),_Z(Z),B.size===0)TZ()}}))}class O4{_duration;_tickInterval;_remaining;_running=!1;_paused=!1;_complete=!1;_intervalId=null;_lastTick=0;_completionHandlers=new Set;_tickHandlers=new Set;constructor(Z){if(this._duration=Z.duration,this._tickInterval=Z.tickInterval||1000,this._remaining=Z.duration,Z.onComplete)this._completionHandlers.add(Z.onComplete);if(Z.onTick)this._tickHandlers.add(Z.onTick);if(Z.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 Z=Date.now()-this._lastTick;return Math.max(0,this._remaining-Z)}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 Z=Date.now()-this._lastTick;this._remaining=Math.max(0,this._remaining-Z),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(Z){return this._completionHandlers.add(Z),()=>{this._completionHandlers.delete(Z)}}onTick(Z){return this._tickHandlers.add(Z),()=>{this._tickHandlers.delete(Z)}}_startInterval(){this._clearInterval(),this._intervalId=setInterval(()=>{let Z=Date.now(),Y=Z-this._lastTick;this._lastTick=Z,this._remaining=Math.max(0,this._remaining-Y);for(let $ of this._tickHandlers)try{$(this._remaining)}catch{}if(this._remaining<=0){this._clearInterval(),this._running=!1,this._complete=!0;for(let $ of this._completionHandlers)try{$()}catch{}}},this._tickInterval)}_clearInterval(){if(this._intervalId!==null)clearInterval(this._intervalId),this._intervalId=null}}class j4{_interval;_handler;_immediate;_running=!1;_intervalId=null;constructor(Z){if(this._interval=Z.interval,this._handler=Z.handler,this._immediate=Z.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 O8(Z){return new O4(Z)}function j8(Z){return new j4(Z)}function V8(Z){return new Promise((Y)=>setTimeout(Y,Z))}function q8(Z){let Y=Math.ceil(Z/1000),$=Math.floor(Y/3600),J=Math.floor(Y%3600/60),Q=Y%60;if($>0)return`${$}:${String(J).padStart(2,"0")}:${String(Q).padStart(2,"0")}`;return`${J}:${String(Q).padStart(2,"0")}`}function U8(Z){let Y=Math.ceil(Z/1000),$=Math.floor(Y/3600),J=Math.floor(Y%3600/60),Q=Y%60;if($>0){if(J>0)return`${$}h ${J}m`;return`${$}h`}if(J>0){if(Q>0)return`${J}m ${Q}s`;return`${J}m`}return`${Q}s`}function G(Z){if(typeof window>"u")return!1;let Y=window.craft;return!!(Y&&Y[Z])}function M(Z){if(!G(Z))throw Error(`craft.${Z} is not available \u2014 this API requires a Craft native window`);return window.craft[Z]}function U(Z,Y){if(typeof window>"u")return()=>{};let $=(J)=>Y(J.detail??{});return window.addEventListener(Z,$),()=>window.removeEventListener(Z,$)}var P8={async writeText(Z){if(G("clipboard")){await window.craft.clipboard.writeText(Z);return}if(typeof navigator<"u"&&navigator.clipboard)await navigator.clipboard.writeText(Z)},async readText(){if(G("clipboard")){let Z=await window.craft.clipboard.readText();return typeof Z==="string"?Z:""}if(typeof navigator<"u"&&navigator.clipboard?.readText)try{return await navigator.clipboard.readText()}catch{return""}return""},async writeHTML(Z){if(G("clipboard")){await window.craft.clipboard.writeHTML(Z);return}if(typeof navigator<"u"&&navigator.clipboard?.write)try{let Y=new window.ClipboardItem({"text/html":new Blob([Z],{type:"text/html"}),"text/plain":new Blob([L8(Z)],{type:"text/plain"})});await navigator.clipboard.write([Y])}catch{}},async readHTML(){if(G("clipboard")){let Z=await window.craft.clipboard.readHTML();return typeof Z==="string"?Z:""}if(typeof navigator<"u"&&navigator.clipboard?.read)try{let Z=await navigator.clipboard.read();for(let Y of Z)if(Y.types.includes("text/html"))return await(await Y.getType("text/html")).text()}catch{}return""},async clear(){if(G("clipboard")){await window.craft.clipboard.clear();return}if(typeof navigator<"u"&&navigator.clipboard?.writeText)try{await navigator.clipboard.writeText("")}catch{}},async hasText(){if(G("clipboard"))return await window.craft.clipboard.hasText();return(await this.readText()).length>0},async hasHTML(){if(G("clipboard"))return await window.craft.clipboard.hasHTML();return(await this.readHTML()).length>0},async hasImage(){if(G("clipboard"))return await window.craft.clipboard.hasImage();return!1}};function L8(Z){return Z.replace(/<(script|style)[^>]*>[\s\S]*?<\/\1>/gi,"").replace(/<\/?(br|p|div|li|h[1-6])\b[^>]*>/gi,`
|
|
892
|
+
`).replace(/<[^>]+>/g,"").replace(/ /g," ").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/\n{3,}/g,`
|
|
893
|
+
|
|
894
|
+
`).trim()}var W8={async show(Z){if(!Z.title)throw Error("notification title is required");if(G("notifications")){await window.craft.notifications.show(Z);return}if(typeof window<"u"&&"Notification"in window){let Y=window.Notification;if(Y.permission==="granted")new Y(Z.title,{body:Z.body,icon:Z.icon});else if(Y.permission==="default"){if(await Y.requestPermission()==="granted")new Y(Z.title,{body:Z.body,icon:Z.icon})}}},async schedule(Z){if(G("notifications")){let J={...Z};if(J.triggerAt instanceof Date)J.triggerAt=J.triggerAt.toISOString();await window.craft.notifications.schedule(J);return}let Y=D8(Z.triggerAt),$=Math.max(0,Y-Date.now());setTimeout(()=>{this.show(Z).catch(()=>{})},$)},async cancel(Z){if(G("notifications"))await window.craft.notifications.cancel(Z)},async cancelAll(){if(G("notifications"))await window.craft.notifications.cancelAll()},async setBadge(Z){let Y=Math.max(0,Math.round(Number.isFinite(Z)?Z:0));if(G("notifications")){await window.craft.notifications.setBadge(Y);return}if(typeof navigator<"u"&&navigator.setAppBadge)try{await navigator.setAppBadge(Y)}catch{}},async clearBadge(){if(G("notifications")){await window.craft.notifications.clearBadge();return}if(typeof navigator<"u"&&navigator.clearAppBadge)try{await navigator.clearAppBadge()}catch{}},async requestPermission(){if(G("notifications"))return await window.craft.notifications.requestPermission();if(typeof window<"u"&&"Notification"in window){let Z=window.Notification;if(Z.permission==="granted")return!0;if(Z.permission==="denied")return!1;return await Z.requestPermission()==="granted"}return!1},async registerCategories(Z){if(!Array.isArray(Z)||Z.length===0)return;if(G("notifications")){let Y=window.craft.notifications.registerCategories;if(typeof Y==="function")await Y(Z)}},onActionClicked(Z){return U("craft:notification:actionClicked",Z)},onReply(Z){return U("craft:notification:reply",Z)}};function D8(Z){if(Z==null)return Date.now();if(Z instanceof Date)return Z.getTime();if(typeof Z==="number")return Z;let Y=Date.parse(Z);return Number.isNaN(Y)?Date.now():Y}var M8={async readFile(Z){let Y=await M("fs").readFile(Z);return Y&&Y.data||""},async readBuffer(Z){let Y=await M("fs").readFile(Z),$=Y&&Y.data||"";if(Y&&Y.base64===!0)return _8($);return new TextEncoder().encode($)},async writeFile(Z,Y){await M("fs").writeFile(Z,Y)},async writeBuffer(Z,Y){let $=T8(Y),J=M("fs");if(typeof J.writeFileBytes==="function")await J.writeFileBytes(Z,$);else await J.writeFile(Z,$)},async copy(Z,Y){if(Z===Y)throw Error("fs.copy: source and destination must differ");await M("fs").copy(Z,Y)},async move(Z,Y){if(Z===Y)throw Error("fs.move: source and destination must differ");await M("fs").move(Z,Y)},async appendFile(Z,Y){await M("fs").appendFile(Z,Y)},async deleteFile(Z){await M("fs").deleteFile(Z)},async exists(Z){return await M("fs").exists(Z)},async stat(Z){return N8(await M("fs").stat(Z))},async readDir(Z){let Y=await M("fs").readDir(Z),$=Y&&Y.entries||[],J=Z.endsWith("/")?Z.slice(0,-1):Z;return $.map((Q)=>({name:Q.name,path:`${J}/${Q.name}`,isDirectory:!!Q.isDirectory}))},async mkdir(Z,Y){await M("fs").mkdir(Z,Y)},async rmdir(Z,Y){await M("fs").rmdir(Z,Y)},async watch(Z,Y){await M("fs").watch(Z,Y)},async unwatch(Z){await M("fs").unwatch(Z)},onChange(Z){return U("craft:fs:change",Z)},async watchTree(Z,Y,$){let J=`watch-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`,Q=M("fs");await Q.watch(Z,J,{recursive:!!Y.recursive});let X=Y.kinds&&Y.kinds.length>0?new Set(Y.kinds):null,R=Math.max(0,Math.floor(Y.coalesceMs??0)),z=[],K=null,F=!1,j=()=>{if(K=null,z.length===0)return;let O=z;z=[];try{$(O)}catch{}},V=U("craft:fs:change",(O)=>{if(F)return;if(O.id!==J)return;if(X&&O.kind&&!X.has(O.kind))return;if(z.push(O),R===0){j();return}if(K==null)K=setTimeout(j,R)});return{id:J,async stop(){if(F)return;if(F=!0,V(),K)clearTimeout(K),K=null;if(z.length>0)j();try{await Q.unwatch(J)}catch{}}}},async homeDir(){return await M("fs").homeDir()},async tempDir(){return await M("fs").tempDir()},async appDataDir(){return await M("fs").appDataDir()}};function T8(Z){let Y="";for(let $=0;$<Z.length;$++)Y+=String.fromCharCode(Z[$]);return typeof btoa==="function"?btoa(Y):Buffer.from(Z).toString("base64")}function _8(Z){let Y=typeof atob==="function"?atob(Z):Buffer.from(Z,"base64").toString("binary"),$=new Uint8Array(Y.length);for(let J=0;J<Y.length;J++)$[J]=Y.charCodeAt(J);return $}function N8(Z){return{isFile:!!Z.isFile,isDirectory:!!Z.isDirectory,isSymlink:!!Z.isSymlink,size:Number(Z.size)||0,modifiedAt:Z.modifiedAt!=null?Z.modifiedAt<1000000000000?Z.modifiedAt*1000:Z.modifiedAt:0}}var o=new Set,V4=!1;function E8(){if(V4)return;if(typeof window>"u"||typeof window.addEventListener!=="function")return;window.addEventListener("craft:shell:exit",(Z)=>{let Y=Z.detail;if(Y?.id)o.delete(Y.id)}),V4=!0}var A8=new Set(["javascript:","data:","file:","vbscript:"]),k8={async openExternal(Z){let Y=Z.trim().toLowerCase();for(let $ of A8)if(Y.startsWith($))throw Error(`shell.openExternal: ${$} URLs are blocked for safety`);if(G("shell")){await window.craft.shell.openExternal(Z);return}if(typeof window<"u"&&typeof window.open==="function")window.open(Z,"_blank","noopener,noreferrer")},async openPath(Z){await M("shell").openPath(Z)},async showInFinder(Z){await M("shell").showInFinder(Z)},async spawn(Z,Y,$=[],J={}){if(E8(),!Z||typeof Z!=="string")throw Error("shell.spawn: id must be a non-empty string");if(!Y||typeof Y!=="string")throw Error("shell.spawn: command must be a non-empty string");if(!Array.isArray($))throw Error("shell.spawn: args must be an array");for(let Q of $)if(typeof Q!=="string")throw Error("shell.spawn: args entries must be strings");if(o.has(Z))throw Error(`shell.spawn: id "${Z}" is already in use \u2014 call kill(id) first or pick a different id`);o.add(Z);try{await M("shell").spawn(Z,Y,$,J)}catch(Q){throw o.delete(Z),Q}},async kill(Z){await M("shell").kill(Z),o.delete(Z)},async getEnv(Z){if(G("shell")){let Y=await window.craft.shell.getEnv(Z);return Y==null?void 0:String(Y)}return},async setEnv(Z,Y){await M("shell").setEnv(Z,Y)},onStdout(Z){return U("craft:shell:stdout",Z)},onStderr(Z){return U("craft:shell:stderr",Z)},onExit(Z){return U("craft:shell:exit",Z)}};var H8={async register(Z,Y,$){if(!G("shortcuts"))return;await window.craft.shortcuts.register(Z,Y,$)},async unregister(Z){if(!G("shortcuts"))return;await window.craft.shortcuts.unregister(Z)},async unregisterAll(){if(!G("shortcuts"))return;await window.craft.shortcuts.unregisterAll()},async enable(Z){if(!G("shortcuts"))return;await window.craft.shortcuts.enable(Z)},async disable(Z){if(!G("shortcuts"))return;await window.craft.shortcuts.disable(Z)},async isRegistered(Z){if(!G("shortcuts"))return!1;return await window.craft.shortcuts.isRegistered(Z)},async list(){if(!G("shortcuts"))return[];return await window.craft.shortcuts.list()},on(Z){return U("craft:shortcut",Z)}};var x8={get(){if(G("theme"))try{return window.craft.theme.get()}catch{}return{appearance:C8()}},onChange(Z){if(Z(this.get()),G("theme"))return U("craft:theme",Z);if(typeof window<"u"&&window.matchMedia){let Y=window.matchMedia("(prefers-color-scheme: dark)"),$=()=>Z({appearance:Y.matches?"dark":"light"});return Y.addEventListener("change",$),()=>Y.removeEventListener("change",$)}return()=>{}},async current(){return this.get()}};function C8(){if(typeof window>"u"||!window.matchMedia)return"light";return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}async function I8(Z,Y={}){if(!G("dragOut"))throw Error("dragOut requires a Craft native window");let $=Array.isArray(Z)?Z:[Z];if($.length===0)throw Error("dragOut: at least one path required");await window.craft.dragOut.start($,Y)}function S8(){return G("dragOut")}var w8={onUrl(Z){if(!G("deepLink"))return()=>{};return U("craft:deepLink",Z)},getInitialUrl(){if(typeof window>"u")return null;if(G("deepLink"))try{return window.craft.deepLink.getInitialUrl()}catch{return null}return window.__craftPendingDeepLink||null},consumeInitialUrl(){let Z=this.getInitialUrl();if(typeof window<"u")window.__craftPendingDeepLink=void 0;return Z},isAvailable(){return G("deepLink")}};var B8={async isCharging(){if(G("power"))return await window.craft.power.isCharging();let Z=await zZ();return Z?!!Z.charging:!1},async isPluggedIn(){if(G("power"))return await window.craft.power.isPluggedIn();let Z=await zZ();return Z?!!Z.charging||Z.level>=0.999:!1},async isLowPowerMode(){if(G("power"))return await window.craft.power.isLowPowerMode();return!1},async level(){if(G("power")){let Y=await window.craft.power.batteryLevel();return typeof Y==="number"?Y:null}let Z=await zZ();return Z?Z.level:null},async timeRemaining(){if(G("power")){let $=await window.craft.power.timeRemaining();return typeof $==="number"?$:null}let Z=await zZ();if(!Z)return null;let Y=Z.charging?Z.chargingTime:Z.dischargingTime;return Number.isFinite(Y)?Math.round(Y/60):null},async thermalState(){if(G("power"))return await window.craft.power.thermalState()||"unknown";return"unknown"},async uptimeSeconds(){if(G("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(Z="app is busy"){if(G("power")){await window.craft.power.preventSleep(Z);return}if(typeof navigator>"u"||!navigator.wakeLock)return;let Y=window;if(Y.__craftWebWakeLock?.release){try{await Y.__craftWebWakeLock.release()}catch{}Y.__craftWebWakeLock=null}try{let $=await navigator.wakeLock.request("screen");Y.__craftWebWakeLock=$}catch{}},async allowSleep(){if(G("power")){await window.craft.power.allowSleep();return}let Z=window.__craftWebWakeLock;if(Z&&typeof Z.release==="function"){try{await Z.release()}catch{}window.__craftWebWakeLock=null}},onSleep(Z){return U("craft:powerSleep",Z)},onWake(Z){return U("craft:powerWake",Z)}};async function zZ(){if(typeof navigator>"u")return null;let Z=navigator;if(typeof Z.getBattery!=="function")return null;try{return await Z.getBattery()}catch{return null}}var f8={async connectionType(){if(G("network"))return await window.craft.network.connectionType();return q4()},async wifiSSID(){if(G("network"))return await window.craft.network.wifiSSID()||void 0;return},async wifiSignalStrength(){if(G("network")){let Z=await window.craft.network.wifiSignalStrength();return typeof Z==="number"?Z:void 0}return},async ipAddress(){if(G("network"))return await window.craft.network.ipAddress();return""},async macAddress(){if(G("network"))return await window.craft.network.macAddress();return""},async interfaces(){if(G("network"))return await window.craft.network.interfaces();return[]},async isVPNConnected(){if(G("network"))return await window.craft.network.isVPNConnected();return!1},async proxySettings(){if(G("network"))return await window.craft.network.proxySettings()||{};return{}},async openPreferences(){if(G("network"))await window.craft.network.openPreferences()},onChange(Z){if(G("network"))return U("craft:networkChange",Z);if(typeof window>"u")return()=>{};let Y=()=>Z({type:q4(),online:!0}),$=()=>Z({type:"none",online:!1});return window.addEventListener("online",Y),window.addEventListener("offline",$),()=>{window.removeEventListener("online",Y),window.removeEventListener("offline",$)}}};function q4(){if(typeof navigator>"u")return"unknown";if(navigator.onLine===!1)return"none";let Z=navigator.connection;if(!Z)return"unknown";let Y=String(Z.type||Z.effectiveType||"unknown").toLowerCase();if(Y==="wifi"||Y==="cellular"||Y==="ethernet"||Y==="bluetooth"||Y==="none")return Y;return"unknown"}var v8={async checkForUpdates(){if(!G("updater"))return;await window.craft.updater.checkForUpdates()},async checkInBackground(){if(!G("updater"))return;await window.craft.updater.checkInBackground()},async setAutomaticChecks(Z){if(!G("updater"))return;await window.craft.updater.setAutomaticChecks(Z)},async setCheckInterval(Z){if(!G("updater"))return;if(!Number.isFinite(Z))throw Error("setCheckInterval: must be a finite number");let Y=Z<=0?0:Math.max(60,Math.round(Z));await window.craft.updater.setCheckInterval(Y)},async setFeedURL(Z){if(!G("updater"))return;await window.craft.updater.setFeedURL(Z)},async getLastUpdateCheckDate(){if(!G("updater"))return null;return await window.craft.updater.getLastUpdateCheckDate()||null},async getUpdateInfo(){if(!G("updater"))return null;let Z=await window.craft.updater.getUpdateInfo();if(!Z||typeof Z.version!=="string"||Z.version.length===0)return null;return Z},onAvailable(Z){return U("craft:updateAvailable",Z)},onDownloaded(Z){return U("craft:updateDownloaded",Z)},async verifySignature({payload:Z,signatureB64:Y,publicKeyB64:$}){let J=U4(Z),Q;try{Q=await crypto.subtle.importKey("raw",RZ($),{name:"Ed25519"},!1,["verify"])}catch{return!1}try{return await crypto.subtle.verify("Ed25519",Q,RZ(Y),J)}catch{return!1}},async verifyDownload({url:Z,signatureB64:Y,publicKeyB64:$,fetchInit:J}){let Q;try{Q=await fetch(Z,J)}catch{return{ok:!1,reason:"fetch-failed"}}if(!Q.ok)return{ok:!1,reason:"http-error",status:Q.status};let X=new Uint8Array(await Q.arrayBuffer()),R;try{R=await crypto.subtle.importKey("raw",RZ($),{name:"Ed25519"},!1,["verify"])}catch{return{ok:!1,reason:"bad-key"}}let z=!1;try{z=await crypto.subtle.verify("Ed25519",R,RZ(Y),U4(X))}catch{z=!1}if(!z)return{ok:!1,reason:"bad-signature"};return{ok:!0,payload:X}}};function U4(Z){if(Z instanceof ArrayBuffer)return new Uint8Array(Z);let Y=new ArrayBuffer(Z.byteLength),$=new Uint8Array(Y);return $.set(Z),$}function RZ(Z){if(typeof atob==="function"){let J=atob(Z),Q=new ArrayBuffer(J.length),X=new Uint8Array(Q);for(let R=0;R<J.length;R++)X[R]=J.charCodeAt(R);return X}let Y=Buffer.from(Z,"base64"),$=new ArrayBuffer(Y.length);return new Uint8Array($).set(Y),new Uint8Array($)}var y8={onFocus(Z){if(G("window"))return U("craft:window:focus",()=>Z());return NZ("focus",Z)},onBlur(Z){if(G("window"))return U("craft:window:blur",()=>Z());return NZ("blur",Z)},onResize(Z){if(G("window"))return U("craft:window:resize",Z);if(typeof window>"u")return()=>{};let Y=()=>Z({width:window.innerWidth,height:window.innerHeight});return window.addEventListener("resize",Y),()=>window.removeEventListener("resize",Y)},onMove(Z){if(G("window"))return U("craft:window:move",Z);return()=>{}},onClose(Z){if(G("window"))return U("craft:window:close",()=>Z());return NZ("beforeunload",Z)},onMinimize(Z){if(G("window"))return U("craft:window:minimize",()=>Z());if(typeof document>"u")return()=>{};let Y=()=>{if(document.visibilityState==="hidden")Z()};return document.addEventListener("visibilitychange",Y),()=>document.removeEventListener("visibilitychange",Y)},onRestore(Z){if(G("window"))return U("craft:window:restore",()=>Z());if(typeof document>"u")return()=>{};let Y=()=>{if(document.visibilityState==="visible")Z()};return document.addEventListener("visibilitychange",Y),()=>document.removeEventListener("visibilitychange",Y)}};function NZ(Z,Y){if(typeof window>"u")return()=>{};let $=()=>Y();return window.addEventListener(Z,$),()=>window.removeEventListener(Z,$)}var P4={name:"",version:"0.0.0"},g8={async hideDockIcon(){if(G("app"))await window.craft.app.hideDockIcon()},async showDockIcon(){if(G("app"))await window.craft.app.showDockIcon()},async quit(){if(G("app"))await window.craft.app.quit()},async getInfo(){if(!G("app"))return P4;let Z=await window.craft.app.getInfo();return{...P4,...Z||{}}},async notify(Z){if(!Z.title)throw Error("notify: title is required");if(G("app"))await window.craft.app.notify(Z)},async setBadge(Z){if(G("app"))await window.craft.app.setBadge(Z)},async bounce(Z="informational"){if(G("app"))await window.craft.app.bounce(Z)}};var b8={app(Z){return{label:Z,items:[{label:`About ${Z}`,role:"about"},{separator:!0},{label:`Hide ${Z}`,role:"hide",shortcut:"cmd+h"},{label:"Hide Others",role:"hideOthers",shortcut:"cmd+alt+h"},{label:"Show All",role:"showAll"},{separator:!0},{label:`Quit ${Z}`,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(Z){return[this.app(Z),this.edit()]}},u8=0;function m8(Z){let Y=new Map;return{payload:{menus:Z.menus.map((J)=>({label:J.label,items:J.items.map((Q)=>{let{onClick:X,...R}=Q;if(R.separator)return R;let z=R.id??`stx.menu.${u8++}`;if(X)Y.set(z,X);return{...R,id:z}})}))},handlers:Y}}var EZ=null,h8={async set(Z){if(!G("menu"))return!1;let{payload:Y,handlers:$}=m8(Z);if(EZ?.(),EZ=null,$.size>0)EZ=U("craft:menu:action",(J)=>{$.get(J.id)?.()});return await window.craft.menu.set(Y),!0},async setDock(Z){if(G("menu"))await window.craft.menu.setDock(Z)},async addItem(Z,Y){if(G("menu"))await window.craft.menu.addItem(Z,Y)},async removeItem(Z){if(G("menu"))await window.craft.menu.removeItem(Z)},async enableItem(Z){if(G("menu"))await window.craft.menu.enableItem(Z)},async disableItem(Z){if(G("menu"))await window.craft.menu.disableItem(Z)},async checkItem(Z){if(G("menu"))await window.craft.menu.checkItem(Z)},async uncheckItem(Z){if(G("menu"))await window.craft.menu.uncheckItem(Z)},async setItemLabel(Z,Y){if(G("menu"))await window.craft.menu.setItemLabel(Z,Y)},async clearDock(){if(G("menu"))await window.craft.menu.clearDock()},onAction(Z){return U("craft:menu:action",Z)}};function L4(Z){if(Z.separator)return{id:Z.id||"",title:"",type:"separator"};return{id:Z.id||"",title:Z.title||"",icon:Z.icon,shortcut:Z.shortcut,enabled:Z.disabled?!1:void 0,submenu:Z.submenu?.map(L4)}}var c8={available(){return G("nativeUI")},async show(Z){if(!Z.items||Z.items.length===0)throw Error("contextMenu.show requires at least one item");if(!G("nativeUI"))return!1;return await window.craft.nativeUI.showContextMenu({targetId:Z.targetId||"",targetType:"general",x:Math.round(Z.x),y:Math.round(Z.y),items:Z.items.map(L4)}),!0},onAction(Z){return U("craft:menu:action",Z)}};var p8={accentColor:()=>x("system","accentColor",()=>""),highlightColor:()=>x("system","highlightColor",()=>""),language:()=>x("system","language",()=>{if(typeof navigator>"u")return"";return navigator.language?.split("-")[0]||""}),locale:()=>x("system","locale",()=>{if(typeof navigator>"u")return"";return navigator.language||""}),timezone:()=>x("system","timezone",()=>{try{return Intl.DateTimeFormat().resolvedOptions().timeZone||""}catch{return""}}),is24HourTime:()=>x("system","is24HourTime",()=>{try{let Z=new Intl.DateTimeFormat([],{hour:"numeric"}).resolvedOptions();return Z.hourCycle==="h23"||Z.hourCycle==="h24"}catch{return!1}}),reduceMotion:()=>x("system","reduceMotion",()=>AZ("(prefers-reduced-motion: reduce)")),reduceTransparency:()=>x("system","reduceTransparency",()=>AZ("(prefers-reduced-transparency: reduce)")),increaseContrast:()=>x("system","increaseContrast",()=>AZ("(prefers-contrast: more)")),systemVersion:()=>x("system","systemVersion",()=>""),hostname:()=>x("system","hostname",()=>""),username:()=>x("system","username",()=>""),async openPreferences(){if(G("system"))await window.craft.system.openPreferences()}};async function x(Z,Y,$){if(G(Z))return await window.craft[Z][Y]();return await $()}function AZ(Z){if(typeof window>"u"||!window.matchMedia)return!1;return window.matchMedia(Z).matches}var l8={async getDisplays(){if(G("screen"))return await window.craft.screen.getDisplays();return W4()},async getPrimary(){if(G("screen")){let Z=await window.craft.screen.getPrimary();return Z&&typeof Z.width==="number"?Z:null}return W4()[0]??null},onChange(Z){if(G("screen"))return U("craft:screen:change",()=>Z());if(typeof window>"u")return()=>{};let Y=()=>Z();return window.addEventListener("resize",Y),()=>window.removeEventListener("resize",Y)}};function W4(){if(typeof window>"u"||!window.screen)return[];let Z=window.screen;return[{id:0,x:Z.left??0,y:Z.top??0,width:Z.width||0,height:Z.height||0,workX:Z.availLeft??0,workY:Z.availTop??0,workWidth:Z.availWidth??Z.width??0,workHeight:Z.availHeight??Z.height??0,scaleFactor:window.devicePixelRatio||1}]}var d8={async set(Z,Y,$){if(!Z)throw Error("keychain.set: service is required");if(!Y)throw Error("keychain.set: account is required");await M("keychain").set(Z,Y,$)},async get(Z,Y){if(!Z)throw Error("keychain.get: service is required");if(!Y)throw Error("keychain.get: account is required");let $=await M("keychain").get(Z,Y);return typeof $==="string"?$:null},async delete(Z,Y){if(!Z)throw Error("keychain.delete: service is required");if(!Y)throw Error("keychain.delete: account is required");await M("keychain").delete(Z,Y)},async has(Z,Y){if(!Z)throw Error("keychain.has: service is required");if(!Y)throw Error("keychain.has: account is required");return await M("keychain").has(Z,Y)}};var r8={async check(Z){if(G("permissions"))return await window.craft.permissions.check(Z);return await D4(Z)},async request(Z){if(G("permissions"))return await window.craft.permissions.request(Z);return await n8(Z)},async openSettings(Z){if(G("permissions"))await window.craft.permissions.openSettings(Z)}};async function D4(Z){if(typeof navigator>"u"||!navigator.permissions?.query)return"not-supported";try{let Y=await navigator.permissions.query({name:Z});return o8(Y.state)}catch{return"not-supported"}}async function n8(Z){if(Z==="notifications"&&typeof window<"u"&&"Notification"in window){let Y=await window.Notification.requestPermission();return Y==="granted"?"granted":Y==="denied"?"denied":"undetermined"}return await D4(Z)}function o8(Z){if(Z==="granted")return"granted";if(Z==="denied")return"denied";if(Z==="prompt")return"undetermined";return"undetermined"}var a8={async print(){if(G("printing")){await window.craft.printing.print();return}if(typeof window<"u"&&typeof window.print==="function")window.print()},async printToPDF(Z){if(!Z)throw Error("printToPDF: path is required");let Y=Z.startsWith("/"),$=/^[a-zA-Z]:[\\/]/.test(Z)||Z.startsWith("\\\\");if(!Y&&!$)throw Error("printToPDF: path must be absolute");let J=await M("printing").printToPDF(Z);return{ok:!!(J&&J.ok),path:J?.path}}};var i8={async enable(){if(!G("autoLaunch"))return!1;return await window.craft.autoLaunch.enable()},async disable(){if(!G("autoLaunch"))return!1;return await window.craft.autoLaunch.disable()},async isEnabled(){if(!G("autoLaunch"))return!1;return await window.craft.autoLaunch.isEnabled()}};function kZ(){if(!G("window"))return null;return window.craft.window}function f(Z){let Y=kZ();if(!Y)return Promise.resolve();try{return Promise.resolve(Z(Y)).then(()=>{return},()=>{return})}catch{return Promise.resolve()}}var s8={get available(){return kZ()!==null},open(Z){let Y=kZ();if(!Y?.open){if(typeof window<"u"&&Z.url)window.open(Z.url,Z.name);return Promise.resolve({name:Z.name})}return Y.open(Z).then(($)=>({name:$?.name||Z.name})).catch(()=>{if(typeof window<"u"&&Z.url)window.open(Z.url,Z.name);return{name:Z.name}})},close:()=>f((Z)=>Z.close?.()),focus:()=>f((Z)=>Z.focus?.()),minimize:()=>f((Z)=>Z.minimize?.()),maximize:()=>f((Z)=>Z.maximize?.()),center:()=>f((Z)=>Z.center?.()),startDrag:()=>f((Z)=>Z.startDrag?.()),setTitle:(Z)=>f((Y)=>Y.setTitle?.(Z)),setSize:(Z,Y)=>f(($)=>$.setSize?.(Z,Y)),setAppearance:(Z)=>f((Y)=>Y.setAppearance?.(Z))};var t8={async addItem(Z){if(G("touchbar"))await window.craft.touchbar.addItem(Z)},async removeItem(Z){if(G("touchbar"))await window.craft.touchbar.removeItem(Z)},async updateItem(Z,Y){if(G("touchbar"))await window.craft.touchbar.updateItem(Z,Y)},async setLabel(Z,Y){if(G("touchbar"))await window.craft.touchbar.setLabel(Z,Y)},async setIcon(Z,Y){if(G("touchbar"))await window.craft.touchbar.setIcon(Z,Y)},async setEnabled(Z,Y){if(G("touchbar"))await window.craft.touchbar.setEnabled(Z,Y)},async setSliderValue(Z,Y){if(G("touchbar"))await window.craft.touchbar.setSliderValue(Z,Y)},async clear(){if(G("touchbar"))await window.craft.touchbar.clear()},async show(){if(G("touchbar"))await window.craft.touchbar.show()},async hide(){if(G("touchbar"))await window.craft.touchbar.hide()},onAction(Z){return U("craft:touchbar:action",Z)}};var e8=/^[\da-f]*$/i;function Z9(Z,Y){if(typeof Y!=="string"||!e8.test(Y)||Y.length%2!==0)throw Error(`${Z}: must be a hex string with even length, got ${JSON.stringify(Y)}`)}var Y9={async isEnabled(){return G("bluetooth")?await window.craft.bluetooth.isEnabled():!1},async powerState(){return G("bluetooth")?await window.craft.bluetooth.powerState():"unknown"},async connectedDevices(){return G("bluetooth")?await window.craft.bluetooth.connectedDevices():[]},async pairedDevices(){return G("bluetooth")?await window.craft.bluetooth.pairedDevices():[]},async startDiscovery(){if(G("bluetooth"))await window.craft.bluetooth.startDiscovery()},async stopDiscovery(){if(G("bluetooth"))await window.craft.bluetooth.stopDiscovery()},async isDiscovering(){return G("bluetooth")?await window.craft.bluetooth.isDiscovering():!1},async connect(Z){if(G("bluetooth"))await window.craft.bluetooth.connect(Z)},async disconnect(Z){if(G("bluetooth"))await window.craft.bluetooth.disconnect(Z)},async openPreferences(){if(G("bluetooth"))await window.craft.bluetooth.openPreferences()},async discoverServices(Z){if(!Z)throw Error("bluetooth.discoverServices: deviceId is required");if(!G("bluetooth"))return[];let Y=await window.craft.bluetooth.discoverServices(Z);return Array.isArray(Y)?Y:[]},async discoverCharacteristics(Z,Y){if(!Z||!Y)throw Error("bluetooth.discoverCharacteristics: deviceId and serviceUuid are required");if(!G("bluetooth"))return[];let $=await window.craft.bluetooth.discoverCharacteristics(Z,Y);return Array.isArray($)?$:[]},async readCharacteristic(Z,Y,$){if(!Z||!Y||!$)throw Error("bluetooth.readCharacteristic: deviceId, serviceUuid, characteristicUuid are required");if(!G("bluetooth"))return{ok:!1,reason:"bridge unavailable"};return await window.craft.bluetooth.readCharacteristic(Z,Y,$)},async writeCharacteristic(Z,Y,$,J,Q="with-response"){if(!Z||!Y||!$)throw Error("bluetooth.writeCharacteristic: deviceId, serviceUuid, characteristicUuid are required");if(Z9("bluetooth.writeCharacteristic.valueHex",J),!G("bluetooth"))return{ok:!1,reason:"bridge unavailable"};return await window.craft.bluetooth.writeCharacteristic(Z,Y,$,J,Q)},async setCharacteristicNotify(Z,Y,$,J){if(!Z||!Y||!$)throw Error("bluetooth.setCharacteristicNotify: deviceId, serviceUuid, characteristicUuid are required");if(!G("bluetooth"))return{ok:!1,reason:"bridge unavailable"};return await window.craft.bluetooth.setCharacteristicNotify(Z,Y,$,J)},onDeviceFound(Z){return U("craft:bluetooth:deviceFound",Z)},onDeviceConnected(Z){return U("craft:bluetooth:deviceConnected",Z)},onDeviceDisconnected(Z){return U("craft:bluetooth:deviceDisconnected",Z)},onCharacteristicValue(Z){return U("craft:bluetooth:characteristicValue",Z)}};var $9={async speak(Z,Y){if(!Z)throw Error("speech.speak: text is required");if(G("speech")){await window.craft.speech.speak(Z,Y);return}if(typeof window<"u"&&window.speechSynthesis){let $=new window.SpeechSynthesisUtterance(Z);if(Y){if(Y.rate!=null)$.rate=Y.rate;if(Y.pitch!=null)$.pitch=Y.pitch;if(Y.volume!=null)$.volume=Y.volume;if(Y.voice){let Q=window.speechSynthesis.getVoices().find((X)=>X.voiceURI===Y.voice||X.name===Y.voice||X.lang===Y.voice);if(Q)$.voice=Q}}window.speechSynthesis.speak($)}},async stop(){if(G("speech")){await window.craft.speech.stop();return}if(typeof window<"u"&&window.speechSynthesis)window.speechSynthesis.cancel()},async pause(){if(G("speech")){await window.craft.speech.pause();return}if(typeof window<"u"&&window.speechSynthesis)window.speechSynthesis.pause()},async resume(){if(G("speech")){await window.craft.speech.resume();return}if(typeof window<"u"&&window.speechSynthesis)window.speechSynthesis.resume()},async isSpeaking(){if(G("speech"))return await window.craft.speech.isSpeaking();if(typeof window<"u"&&window.speechSynthesis)return!!window.speechSynthesis.speaking;return!1},async getVoices(){if(G("speech"))return await window.craft.speech.getVoices();if(typeof window<"u"&&window.speechSynthesis)return window.speechSynthesis.getVoices().map((Y)=>({id:Y.voiceURI||Y.name,name:Y.name,language:Y.lang||"",quality:"default"}));return[]}};var a=[],HZ=!0,xZ,CZ,i={async report(Z){if(G("crashReporter")){await window.craft.crashReporter.report(Z);return}if(!HZ)return;let Y=Z instanceof Error?{timestamp:Date.now(),severity:"error",message:Z.message,source:"js",stack:Z.stack||"",userId:xZ,appVersion:CZ}:{timestamp:Date.now(),severity:Z.severity||"error",message:Z.message||"",source:Z.source||"js",stack:Z.stack||"",userId:xZ,appVersion:CZ};if(a.length>=64)a.shift();a.push(Y)},async flush(){if(G("crashReporter"))return await window.craft.crashReporter.flush();return[...a]},async clear(){if(G("crashReporter")){await window.craft.crashReporter.clear();return}a.length=0},async setEnabled(Z){if(G("crashReporter")){await window.craft.crashReporter.setEnabled(Z);return}HZ=Z},async isEnabled(){if(G("crashReporter"))return await window.craft.crashReporter.isEnabled();return HZ},async setUser(Z){if(G("crashReporter")){await window.craft.crashReporter.setUser(Z);return}xZ=Z||void 0},async setAppVersion(Z){if(G("crashReporter")){await window.craft.crashReporter.setAppVersion(Z);return}CZ=Z||void 0},attachGlobalHandlers(){if(G("crashReporter")&&window.craft.crashReporter.attachGlobalHandlers)return window.craft.crashReporter.attachGlobalHandlers();if(typeof window>"u")return()=>{};let Z=($)=>{i.report({severity:"error",message:$.message,source:"js",stack:$.error?.stack||`${$.message}
|
|
895
|
+
at ${$.filename}:${$.lineno}:${$.colno}`}).catch(()=>{})},Y=($)=>{let J=$.reason;i.report({severity:"error",message:J?.message||String(J),source:"js",stack:J?.stack||""}).catch(()=>{})};return window.addEventListener("error",Z),window.addEventListener("unhandledrejection",Y),()=>{window.removeEventListener("error",Z),window.removeEventListener("unhandledrejection",Y)}},forwardTo(Z){return R9(Z)}},J9="craft:crashReporter:pending",G9=/[\w.+-]+@[\w-]+\.[\w.-]+/g,Q9=/\b(?:\d{1,3}\.){3}\d{1,3}\b/g,X9=/\/(?:Users|home)\/[^\s/'"`]+/g;function T4(Z){let Y=($)=>$.replace(G9,"<email>").replace(Q9,"<ip>").replace(X9,"/<home>");return{...Z,message:Y(Z.message),stack:Y(Z.stack)}}async function _4(Z,Y){let $=new TextEncoder,J=await crypto.subtle.importKey("raw",$.encode(Z),{name:"HMAC",hash:"SHA-256"},!1,["sign"]),Q=await crypto.subtle.sign("HMAC",J,$.encode(Y));return[...new Uint8Array(Q)].map((X)=>X.toString(16).padStart(2,"0")).join("")}function z9(Z){if(!Z||typeof localStorage>"u")return[];try{let Y=localStorage.getItem(Z);if(!Y)return[];let $=JSON.parse(Y);return Array.isArray($)?$:[]}catch{return[]}}function M4(Z,Y){if(!Z||typeof localStorage>"u")return;try{if(Y.length===0)localStorage.removeItem(Z);else localStorage.setItem(Z,JSON.stringify(Y))}catch{}}function R9(Z){let{endpoint:Y,intervalMs:$=60000,signingSecret:J,redact:Q=!0,headers:X={},maxRetries:R=5,persistKey:z}=Z,K=z===null?null:z??J9,F=z9(K),j=!1,V=null,O=null,P=typeof Q==="function"?Q:Q===!1?(N)=>N:T4;async function L(N){let E=JSON.stringify({entries:N}),S={"Content-Type":"application/json",...X};if(J)S["X-Craft-Signature"]=await _4(J,E);let t=0,w=1000;while(!j)try{let u=await fetch(Y,{method:"POST",headers:S,body:E});if(u.ok)return;if(u.status>=400&&u.status<500)return;throw Error(`HTTP ${u.status}`)}catch(u){if(t+=1,t>R)throw F=[...N,...F],M4(K,F),u;await new Promise((C4)=>{setTimeout(C4,w)}),w=Math.min(w*2,60000)}}async function _(){if(j||O)return O??void 0;let N=await i.flush();if(N.length>0)await i.clear();if(F=[...F,...N.map((S)=>P(S))],F.length===0)return;let E=F;return F=[],M4(K,F),O=L(E).catch(()=>{}).finally(()=>{O=null}),O}if($>0)V=setInterval(()=>{_().catch(()=>{})},$);return{async flushNow(){await _()},stop(){if(j=!0,V)clearInterval(V);V=null},pending(){return[...F]}}}var K9={async isAvailable(){if(!G("iap"))return!1;return await window.craft.iap.isAvailable()},async getProducts(Z){if(!G("iap"))return[];let Y=Array.isArray(Z)?Z:[String(Z)];return await window.craft.iap.getProducts(Y)},async purchase(Z){if(!G("iap"))return{queued:!1,productId:Z,reason:"IAP bridge not available"};let Y=await window.craft.iap.purchase(Z);return{queued:!!(Y&&Y.queued),productId:Y?.productId,reason:Y?.reason}},async restorePurchases(){if(!G("iap"))return{ok:!1};let Z=await window.craft.iap.restorePurchases();return{ok:!!(Z&&Z.ok)}},async finishTransaction(Z){if(!G("iap"))return;await window.craft.iap.finishTransaction(Z)},async getReceiptData(){if(!G("iap"))return null;let Z=await window.craft.iap.getReceiptData();return Z?String(Z):null},onPurchased(Z){return U("craft:iap:purchased",Z)},onFailed(Z){return U("craft:iap:failed",Z)},onRestored(Z){return U("craft:iap:restored",Z)},onProductsLoaded(Z){return U("craft:iap:productsLoaded",(Y)=>Z(Y.products||[]))},onRefunded(Z){return U("craft:iap:refunded",Z)},onSubscriptionStatusChanged(Z){return U("craft:iap:subscriptionStatusChanged",Z)},async getActiveSubscriptions(){if(!G("iap"))return[];let Z=window.craft.iap.getActiveSubscriptions;if(typeof Z!=="function")return[];let Y=await Z();return Array.isArray(Y)?Y:[]},async isEligibleForIntroOffer(Z){if(!G("iap"))return!1;let Y=window.craft.iap.isEligibleForIntroOffer;if(typeof Y!=="function")return!1;return!!await Y(Z)}};var s={async startActivity(Z,Y){if(!Z)throw Error("handoff.startActivity: type is required");if(!G("handoff"))return!1;let $=await window.craft.handoff.startActivity(Z,Y);return typeof $==="boolean"?$:!!($&&$.ok)},async updateActivity(Z){if(!G("handoff"))return!1;let Y=await window.craft.handoff.updateActivity(Z);return typeof Y==="boolean"?Y:!!(Y&&Y.ok)},async stopActivity(){if(!G("handoff"))return;await window.craft.handoff.stopActivity()},async getCurrentActivity(){if(!G("handoff"))return null;let Z=await window.craft.handoff.getCurrentActivity();return Z&&typeof Z.type==="string"?Z:null},onIncoming(Z){return U("craft:handoff:incoming",Z)}};var F9={async start(Z,Y){return s.startActivity(Z,{title:Y?.title,webpageURL:Y?.webpageURL,userInfo:Y?.state})},async update(Z){return s.updateActivity({title:Z.title,webpageURL:Z.webpageURL,userInfo:Z.state})},async stop(){await s.stopActivity()}};var O9={async requestPermission(Z="whenInUse"){if(G("location"))return await window.craft.location.requestPermission(Z);if(typeof navigator<"u"&&navigator.geolocation)return"undetermined";return"not-supported"},async getAuthorization(){if(G("location"))return await window.craft.location.getAuthorization();return"unknown"},async getCurrentLocation(){if(G("location"))return await window.craft.location.getCurrentLocation();if(typeof navigator<"u"&&navigator.geolocation)return navigator.geolocation.getCurrentPosition((Z)=>{window.dispatchEvent(new CustomEvent("craft:location:update",{detail:{latitude:Z.coords.latitude,longitude:Z.coords.longitude,altitude:Z.coords.altitude,horizontalAccuracy:Z.coords.accuracy,verticalAccuracy:Z.coords.altitudeAccuracy,speed:Z.coords.speed}}))},(Z)=>{window.dispatchEvent(new CustomEvent("craft:location:error",{detail:{message:Z.message||String(Z)}}))}),{requested:!0};return{requested:!1}},async startWatching(Z){if(G("location"))return await window.craft.location.startWatching(Z);if(typeof navigator<"u"&&navigator.geolocation){let Y=navigator.geolocation.watchPosition(($)=>{window.dispatchEvent(new CustomEvent("craft:location:update",{detail:{latitude:$.coords.latitude,longitude:$.coords.longitude,altitude:$.coords.altitude,horizontalAccuracy:$.coords.accuracy,verticalAccuracy:$.coords.altitudeAccuracy,speed:$.coords.speed}}))});return window.__craftWebLocationWatchId=Y,!0}return!1},async stopWatching(){if(G("location")){await window.craft.location.stopWatching();return}if(typeof navigator<"u"&&navigator.geolocation){let Z=window.__craftWebLocationWatchId;if(Z!=null)navigator.geolocation.clearWatch(Z),window.__craftWebLocationWatchId=null}},onUpdate(Z){return U("craft:location:update",Z)},onError(Z){return U("craft:location:error",Z)},onAuthChanged(Z){return U("craft:location:authChanged",Z)}};var j9={async captureScreen(){if(!G("screenCapture"))return null;let Z=await window.craft.screenCapture.captureScreen();return Z?String(Z):null},async captureWindow(Z){if(!G("screenCapture"))return null;if(!Number.isFinite(Z)||Z<=0)throw Error("captureWindow: id must be a positive number");let Y=await window.craft.screenCapture.captureWindow(Z);return Y?String(Y):null},async listWindows(){if(!G("screenCapture"))return[];return await window.craft.screenCapture.listWindows()}};var E4=250,A4=60000,IZ=2000,N4={sharing:!1,signals:{systemScreenShare:!1,remoteSession:!1,conferenceSharing:!1,screenRecording:!1},sources:[]};function V9(){return{...N4,signals:{...N4.signals},sources:[]}}var KZ={async getState(){if(!G("screenSharing"))return V9();return await window.craft.screenSharing.getState()},async watch(Z=IZ){let Y=Math.min(A4,Math.max(E4,Math.round(Z)));if(!G("screenSharing"))return Y;let $=await window.craft.screenSharing.watch(Y);return $&&$.intervalMs||Y},async stop(){if(!G("screenSharing"))return;await window.craft.screenSharing.unwatch()},onChange(Z){return U("craft:screenSharing:change",Z)}};async function q9(Z,Y=IZ){let $=KZ.onChange(Z);return await KZ.watch(Y),()=>{$(),KZ.stop()}}var U9={supported:!1,isFocused:null,authorization:"unsupported"};function k4(){return{ok:!1,error:"Focus control is only available in a Craft window on macOS"}}var SZ={async getStatus(){if(!G("focus"))return{...U9};return await window.craft.focus.getStatus()},async requestAuthorization(){if(!G("focus"))return"unsupported";return await window.craft.focus.requestAuthorization()},async setEnabled(Z,Y={}){if(!G("focus"))return k4();if(!(Z?Y.onShortcut:Y.offShortcut))return{ok:!1,error:`focus.setEnabled: no ${Z?"onShortcut":"offShortcut"} configured`};return await window.craft.focus.setEnabled(Z,Y)},async runShortcut(Z){if(!G("focus"))return k4();if(!Z)throw Error("focus.runShortcut: name is required");return await window.craft.focus.runShortcut(Z)},async listShortcuts(){if(!G("focus"))return[];return await window.craft.focus.listShortcuts()},async listShortcutsResult(){if(!G("focus"))return{canList:!1,shortcuts:[]};let Y=await window.craft.focus.listShortcutsResult?.();return{canList:Boolean(Y?.canList),shortcuts:Y?.shortcuts??[]}}};async function P9(...Z){if(Z.length===0)return!1;let Y=new Set(await SZ.listShortcuts());return Z.every(($)=>Y.has($))}async function L9(...Z){if(Z.length===0)return!1;let{canList:Y,shortcuts:$}=await SZ.listShortcutsResult();if(!Y)return"unknown";let J=new Set($);return Z.every((Q)=>J.has(Q))}var W9={async start(Z=0,Y="127.0.0.1"){if(!G("localServer"))return{port:0,started:!1,reason:"bridge unavailable"};return await window.craft.localServer.start(Z,Y)},async stop(){if(!G("localServer"))return;await window.craft.localServer.stop()},async respond(Z){if(!G("localServer"))return;await window.craft.localServer.respond(Z||{status:200,body:"OK"})},onRequest(Z){return U("craft:localServer:request",Z)},async awaitOAuthCallback(Z={}){M("localServer");let{port:Y=0,host:$="127.0.0.1",timeoutMs:J=300000,successHTML:Q}=Z,X=await this.start(Y,$);if(!X.started)throw Error(`localServer: start failed${X.reason?` \u2014 ${X.reason}`:""}`);return new Promise((R,z)=>{let K=setTimeout(()=>{F(),this.stop().catch(()=>{}),z(Error("localServer: OAuth callback timed out"))},J),F=this.onRequest(({url:j})=>{clearTimeout(K),F();let V=Q??`<!doctype html><meta charset="utf-8"><title>Done</title>
|
|
896
|
+
<style>body{font-family:-apple-system,BlinkMacSystemFont,sans-serif;display:flex;align-items:center;justify-content:center;height:100vh;margin:0;background:#f5f5f7}</style>
|
|
897
|
+
<div><h1>You can close this tab.</h1><p>Returning to the app\u2026</p></div>
|
|
898
|
+
<script>setTimeout(()=>window.close(),1500)</script>`;this.respond({status:200,body:V,contentType:"text/html; charset=utf-8"}).catch(()=>{}).finally(()=>this.stop().catch(()=>{})),R({url:j,port:X.port})})})}};var D9={async isAvailable(){if(!G("biometric"))return!1;return await window.craft.biometric.isAvailable()},async getBiometryType(){if(!G("biometric"))return"none";return await window.craft.biometric.getBiometryType()},async evaluate(Z,Y){if(!Z)throw Error("biometric.evaluate: reason is required");if(!G("biometric"))return{success:!1,errorCode:-1};return await window.craft.biometric.evaluate(Z,Y)}};var k=null,M9={async play(Z,Y){if(G("audio"))return await window.craft.audio.play(Z,Y);if(typeof window>"u"||typeof Audio>"u")return!1;if(k)k.pause(),k=null;if(k=new Audio(Z),Y?.volume!=null)k.volume=Y.volume;if(Y?.loops)k.loop=!0;try{return await k.play(),!0}catch{return!1}},async playSystemSound(Z){if(G("audio"))return await window.craft.audio.playSystemSound(Z);if(typeof window>"u"||typeof Audio>"u")return!1;try{return k=new Audio(`/System/Library/Sounds/${Z}.aiff`),await k.play(),!0}catch{return!1}},async stop(){if(G("audio")){await window.craft.audio.stop();return}if(k)k.pause(),k.currentTime=0,k=null},async isPlaying(){if(G("audio"))return await window.craft.audio.isPlaying();return!!(k&&!k.paused)},async startRecording(Z,Y){if(G("audio"))return await window.craft.audio.startRecording(Z,Y);return!1},async stopRecording(){if(G("audio"))await window.craft.audio.stopRecording()},async isRecording(){if(G("audio"))return await window.craft.audio.isRecording();return!1}};var T9={async execute(Z){if(!Z)throw Error("appleScript.execute: source is required");if(!G("appleScript"))return{ok:!1};return await window.craft.appleScript.execute(Z)}};var _9={async getDefault(Z){if(!Z)throw Error("fileAssociations.getDefault: uti is required");if(!G("fileAssociations"))return null;let Y=await window.craft.fileAssociations.getDefault(Z);return Y?String(Y):null},async setDefault(Z,Y){if(!Z||!Y)throw Error("fileAssociations.setDefault: uti and bundleId are required");if(!G("fileAssociations"))return!1;return await window.craft.fileAssociations.setDefault(Z,Y)}};var N9={async get(Z){if(!Z)throw Error("tags.get: path is required");if(!G("tags"))return[];return await window.craft.tags.get(Z)},async set(Z,Y){if(!Z)throw Error("tags.set: path is required");if(!G("tags"))return!1;let $=Array.isArray(Y)?Y:[String(Y)];return await window.craft.tags.set(Z,$)},async clear(Z){if(!Z)throw Error("tags.clear: path is required");if(!G("tags"))return!1;return await window.craft.tags.clear(Z)}};var E9={async countPages(Z){if(!Z)throw Error("pdf.countPages: path is required");if(!G("pdf"))return 0;return await window.craft.pdf.countPages(Z)},async extractText(Z){if(!Z)throw Error("pdf.extractText: path is required");if(!G("pdf"))return"";return await window.craft.pdf.extractText(Z)}};var A9={async debug(Z){if(G("log"))await window.craft.log.debug(Z);else console.debug(Z)},async info(Z){if(G("log"))await window.craft.log.info(Z);else console.info(Z)},async warn(Z){if(G("log"))await window.craft.log.warn(Z);else console.warn(Z)},async error(Z){if(G("log"))await window.craft.log.error(Z);else console.error(Z)}};var k9={async browse(Z){if(!G("bonjour"))return{started:!1,reason:"bridge unavailable"};return await window.craft.bonjour.browse(Z)},async stop(){if(G("bonjour"))await window.craft.bonjour.stop()},onFound(Z){return U("craft:bonjour:found",Z)},onLost(Z){return U("craft:bonjour:lost",Z)}};var H9={async index(Z){if(!G("spotlight"))return{ok:!1,reason:"bridge unavailable"};return await window.craft.spotlight.index(Z)},async remove(Z){if(!G("spotlight"))return{ok:!1};return await window.craft.spotlight.remove(Z)},async removeAll(){if(!G("spotlight"))return{ok:!1};return await window.craft.spotlight.removeAll()}};var x9={async isAvailable(){if(!G("speechRecognition"))return!1;return await window.craft.speechRecognition.isAvailable()},async start(Z){if(!G("speechRecognition"))return{started:!1,reason:"bridge unavailable"};return await window.craft.speechRecognition.start(Z)},async stop(){if(G("speechRecognition"))await window.craft.speechRecognition.stop()},onPartial(Z){return U("craft:speechRecognition:partial",Z)},onFinal(Z){return U("craft:speechRecognition:final",Z)}};var C9={async recognizeText(Z){if(!Z)throw Error("vision.recognizeText: path is required");if(!G("vision"))return[];return await window.craft.vision.recognizeText(Z)},async detectFaces(Z){if(!Z)throw Error("vision.detectFaces: path is required");if(!G("vision"))return[];return await window.craft.vision.detectFaces(Z)},async detectBarcodes(Z){if(!Z)throw Error("vision.detectBarcodes: path is required");if(!G("vision"))return[];return await window.craft.vision.detectBarcodes(Z)}};var I9={async listSources(){if(!G("midi"))return[];return await window.craft.midi.listSources()},async listDestinations(){if(!G("midi"))return[];return await window.craft.midi.listDestinations()},async send(Z,Y){if(!G("midi"))return{ok:!1,reason:"bridge unavailable"};return await window.craft.midi.send(Z,Y)},async subscribe(Z){if(!G("midi"))return{ok:!1,reason:"bridge unavailable"};return await window.craft.midi.subscribe(Z)},async unsubscribe(Z){if(!G("midi"))return{ok:!1};return await window.craft.midi.unsubscribe(Z)},onMessage(Z){return U("craft:midi:message",Z)}};var S9={async loadModel(Z,Y){if(!Z||!Y)throw Error("coreml.loadModel: id and path are required");if(!G("coreml"))return!1;return await window.craft.coreml.loadModel(Z,Y)},async unloadModel(Z){if(!G("coreml"))return;await window.craft.coreml.unloadModel(Z)},async predict(Z,Y){if(!Z)throw Error("coreml.predict: id is required");if(!G("coreml"))return null;return await window.craft.coreml.predict(Z,Y)}};var w9={async listCameras(){if(!G("continuityCamera"))return[];return await window.craft.continuityCamera.listCameras()}};var B9={async register(Z){if(!Z)throw Error("serviceMenu.register: name is required");if(!G("serviceMenu"))return{ok:!1,reason:"bridge unavailable"};return await window.craft.serviceMenu.register(Z)},async unregister(Z){if(!Z)throw Error("serviceMenu.unregister: name is required");if(!G("serviceMenu"))return;await window.craft.serviceMenu.unregister(Z)},onInvoked(Z){return U("craft:serviceMenu:invoked",Z)}};var f9={async list(){if(!G("serial"))return[];return await window.craft.serial.list()},async open(Z,Y=9600){if(!Z)throw Error("serial.open: path is required");if(!G("serial"))return{ok:!1,reason:"bridge unavailable"};return await window.craft.serial.open(Z,Y)},async write(Z,Y){if(!Z)throw Error("serial.write: id is required");if(!G("serial"))return{ok:!1,reason:"bridge unavailable"};return await window.craft.serial.write(Z,Y)},async close(Z){if(!G("serial"))return;await window.craft.serial.close(Z)},onData(Z){return U("craft:serial:data",Z)}};var H4=[{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 v9(){return H4.map(({name:Z,support:Y})=>({name:Z,support:Y,available:G(Z)}))}function x4(Z){let Y=H4.find(($)=>$.name===Z);if(!Y)return;return{...Y,available:G(Z)}}function y9(Z){let Y=x4(Z);return!!Y&&Y.available}export{y8 as windowEvents,q9 as watchScreenSharing,C9 as vision,S6 as verifyBundleTrust,v8 as updater,F4 as unregisterHotkey,K8 as unregisterAllHotkeys,oY as triggerTrayAction,t8 as touchbar,x8 as theme,N9 as tags,p8 as system,I6 as swapBundle,b8 as standardMenus,H9 as spotlight,x9 as speechRecognition,$9 as speech,_4 as signPayload,b4 as showWarningToast,wY as showWarningModal,G6 as showWarningDialog,l as showToast,g4 as showSuccessToast,fY as showSuccessModal,eY as showSaveDialog,yZ as showQuestionModal,tY as showOpenDialog,m as showModal,d as showMessageBox,y4 as showInfoToast,vZ as showInfoModal,u4 as showErrorToast,BY as showErrorModal,J6 as showErrorDialog,$6 as showConfirmDialog,Z6 as showColorPicker,Y6 as showAlertDialog,OZ as showAlert,k8 as shell,F6 as setDesktopConfig,Y8 as setAutoLaunch,B9 as serviceMenu,f9 as serial,KZ as screenSharing,j9 as screenCapture,l8 as screen,B6 as runningBundleTeamId,A6 as resolveCraftBinary,j6 as resetDesktopConfig,S4 as requestNotificationPermission,tZ as relaunchBundle,R8 as registerHotkey,T4 as redactPII,WZ as readBundleIdentity,sZ as quitLauncher,gY as prompt,a8 as printing,r8 as permissions,E9 as pdf,R4 as parseShortcut,N6 as packageApp,_6 as pack,W6 as openDevWindow,m4 as notify,W8 as notifications,f8 as network,s8 as nativeWindow,i8 as nativeAutoLaunch,I9 as midi,h8 as menu,A9 as log,O9 as location,W9 as localServer,F9 as liveActivities,d8 as keychain,M6 as isWebviewAvailable,S8 as isDragOutAvailable,y6 as isCaffeinated,y9 as isAvailable,$8 as isAutoLaunchEnabled,K9 as iap,P9 as hasFocusShortcuts,s as handoff,H8 as globalShortcuts,aZ as githubReleaseAssetUrl,oZ as githubLatestAssetUrl,T6 as getWindowBridgeScript,U6 as getWindow,nY as getTrayInstance,iY as getTrayBridgeScript,aY as getSimulatedTrayHTML,F8 as getRegisteredHotkeys,Q6 as getDialogBridgeScript,O6 as getDesktopConfig,x4 as getCapability,v9 as getCapabilities,g6 as getCaffeinateStatus,q6 as getActiveWindowIds,rY as getActiveTrayInstances,bY as getActiveModalCount,p4 as getActiveAlertCount,rZ as generateUpdateManifest,M8 as fs,q8 as formatTime,G8 as formatShortcut,b6 as formatRemainingTime,u6 as formatDuration,U8 as formatCompact,L9 as focusShortcutsReady,SZ as focus,_9 as fileAssociations,C6 as extractBundle,I8 as dragOut,c4 as dismissAllAlerts,h4 as dismissAlertById,V8 as delay,w8 as deepLinks,Z4 as decaffeinate,D6 as createWindowWithHTML,L6 as createWindow,AY as createWebView,WY as createTreeView,FY as createTooltip,O8 as createTimer,QY as createTimePicker,r4 as createTextInput,e4 as createTabs,LY as createTable,cZ as createSystemTray,qY as createStepper,jY as createSplitView,o4 as createSlider,f6 as createSelfUpdater,OY as createScrollView,YY as createRating,$Y as createRadioButton,a4 as createProgressBar,o6 as createPreferences,UY as createModalComponent,dY as createMenubar,_Y as createMediaPlayer,PY as createListView,zY as createLabel,j8 as createInterval,RY as createImageView,iZ as createGitHubUpdater,w6 as createGitHubUpdateManifest,EY as createFileExplorer,ZY as createDropdown,GY as createDatePicker,DY as createDataGrid,JY as createColorPicker,TY as createCodeEditor,KY as createChip,n4 as createCheckbox,MY as createChart,t4 as createCard,d4 as createButton,i4 as createBadge,s4 as createAvatar,XY as createAutocomplete,VY as createAccordion,i as crashReporter,LZ as craftWindowArguments,E6 as craftBinaryNotFoundMessage,S9 as coreml,w9 as continuityCamera,c8 as contextMenu,vY as confirm,P6 as closeAllWindows,uY as closeAllModals,P8 as clipboard,x6 as clearQuarantine,H6 as canReplaceBundle,v6 as caffeinate,GZ as bundlePathForExecutable,k9 as bonjour,Y9 as bluetooth,D9 as biometric,B8 as battery,M9 as audio,T9 as appleScript,g8 as appInfo,yY as alert,nZ as UPDATE_MANIFEST_ASSET,sY as TRAY_MENU_STYLES,l4 as TOAST_STYLES,mY as MODAL_STYLES,E4 as MIN_WATCH_INTERVAL_MS,A4 as MAX_WATCH_INTERVAL_MS,IZ as DEFAULT_WATCH_INTERVAL_MS,HY as COMPONENT_STYLES,dZ as AutoUpdater,kY as AVAILABLE_COMPONENTS};
|