@stacksjs/stx 0.2.765 → 0.2.769

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (182) hide show
  1. package/dist/chunk-096g00ba.js +2 -0
  2. package/dist/chunk-0ga7sn1k.js +2 -0
  3. package/dist/{chunk-4tppbw4r.js → chunk-0hf0mtaf.js} +2 -2
  4. package/dist/{chunk-31e7xkrt.js → chunk-0nhk9p9r.js} +1 -1
  5. package/dist/{chunk-scq0h2cs.js → chunk-1a4vpk9x.js} +2 -2
  6. package/dist/{chunk-zfaa5xn5.js → chunk-1e67szzk.js} +4 -4
  7. package/dist/chunk-1nzg53pv.js +2 -0
  8. package/dist/chunk-1respkkp.js +2 -0
  9. package/dist/{chunk-w2nzevn0.js → chunk-20dsfgmq.js} +1 -1
  10. package/dist/{chunk-6h6teyxp.js → chunk-2bb4g9qr.js} +2 -2
  11. package/dist/{chunk-ftt3r7wh.js → chunk-2w16z2y1.js} +2 -2
  12. package/dist/{chunk-4yk7zngj.js → chunk-30kemrry.js} +5 -5
  13. package/dist/{chunk-51dxp9w9.js → chunk-33jagtss.js} +2 -2
  14. package/dist/{chunk-as4s0nf5.js → chunk-342e6mhn.js} +3 -3
  15. package/dist/{chunk-n8gfetjx.js → chunk-3g8cnsbk.js} +2 -2
  16. package/dist/chunk-3k6tem86.js +2 -0
  17. package/dist/chunk-3pma2q0h.js +2 -0
  18. package/dist/chunk-4cr8bep2.js +2 -0
  19. package/dist/chunk-4ew0291t.js +2 -0
  20. package/dist/{chunk-qv2k0qb1.js → chunk-4qrr2mdd.js} +50 -49
  21. package/dist/{chunk-et831a4y.js → chunk-4rtr07x9.js} +2 -2
  22. package/dist/{chunk-8zgvr0fw.js → chunk-528b302x.js} +3 -3
  23. package/dist/{chunk-6jnrpnxb.js → chunk-586xes7a.js} +2 -2
  24. package/dist/{chunk-rv0yth27.js → chunk-5fab5wt2.js} +2 -2
  25. package/dist/chunk-5ftthxab.js +2 -0
  26. package/dist/{chunk-7aw9qm74.js → chunk-5q97egpw.js} +5 -5
  27. package/dist/chunk-5wp7s24b.js +3 -0
  28. package/dist/{chunk-1w4a0xya.js → chunk-7s9wx19m.js} +3 -3
  29. package/dist/{chunk-mdtjjzqc.js → chunk-7vqq2w3x.js} +2 -2
  30. package/dist/{chunk-3mf27gj6.js → chunk-80gg1k0h.js} +2 -2
  31. package/dist/{chunk-49w4cbqb.js → chunk-8x4gmead.js} +5 -5
  32. package/dist/{chunk-bnwkytme.js → chunk-90n5kb78.js} +3 -3
  33. package/dist/chunk-9v21mwfs.js +2 -0
  34. package/dist/{chunk-vy1weqvj.js → chunk-9y6hbdfh.js} +4 -4
  35. package/dist/{chunk-ay5g5cbk.js → chunk-a81m2ewb.js} +2 -2
  36. package/dist/chunk-b6kfq08s.js +2 -0
  37. package/dist/chunk-b94xf9vs.js +2 -0
  38. package/dist/chunk-bjggcj45.js +2 -0
  39. package/dist/chunk-bk3b5jyw.js +2 -0
  40. package/dist/chunk-bntw35k0.js +2 -0
  41. package/dist/chunk-bt01gdaj.js +2 -0
  42. package/dist/chunk-ctmadzad.js +2 -0
  43. package/dist/chunk-cwmjqker.js +2 -0
  44. package/dist/{chunk-c5mbhfff.js → chunk-cyd10m6m.js} +3 -3
  45. package/dist/{chunk-ay02q27h.js → chunk-cz3trbvn.js} +6 -6
  46. package/dist/{chunk-p42kp93g.js → chunk-dbpzrkmj.js} +1 -1
  47. package/dist/chunk-dbx628ra.js +2 -0
  48. package/dist/{chunk-cswar3zs.js → chunk-ddpt7ejx.js} +3 -3
  49. package/dist/chunk-ddwsms1t.js +2 -0
  50. package/dist/chunk-dpjf62qw.js +2 -0
  51. package/dist/chunk-e4bsnxsj.js +2 -0
  52. package/dist/{chunk-t6d7m4tf.js → chunk-ecakhzkq.js} +7 -7
  53. package/dist/{chunk-z6sg0dq3.js → chunk-enzrpxsj.js} +2 -2
  54. package/dist/chunk-f8jwrvky.js +2 -0
  55. package/dist/{chunk-8hanmv49.js → chunk-fxy7jjnv.js} +29 -2
  56. package/dist/{chunk-xcstrdhp.js → chunk-ggvnmmv3.js} +2 -2
  57. package/dist/chunk-h8yy3y3p.js +2 -0
  58. package/dist/chunk-hddwx35m.js +2 -0
  59. package/dist/{chunk-mpaepc7n.js → chunk-hpdb8vkt.js} +78 -8
  60. package/dist/{chunk-kwy0spcd.js → chunk-hxyarbb6.js} +1 -1
  61. package/dist/chunk-hyqsvw1b.js +2 -0
  62. package/dist/{chunk-stww901w.js → chunk-j34wqxb1.js} +5 -5
  63. package/dist/{chunk-fta169tc.js → chunk-j5dd5ncz.js} +2 -2
  64. package/dist/chunk-j835421z.js +2 -0
  65. package/dist/{chunk-0d29b573.js → chunk-jd84zgn3.js} +2 -2
  66. package/dist/{chunk-dxk5r71v.js → chunk-jgmmg2fw.js} +4 -4
  67. package/dist/{chunk-74y29xxs.js → chunk-knvt4bap.js} +4 -4
  68. package/dist/{chunk-8prk7e1z.js → chunk-mg38q3jh.js} +5 -5
  69. package/dist/chunk-mhc72pp2.js +2 -0
  70. package/dist/{chunk-nj5azxxj.js → chunk-mkk8k3nd.js} +4 -4
  71. package/dist/{chunk-1day2nbr.js → chunk-msy46ges.js} +3 -3
  72. package/dist/{chunk-q22hwm64.js → chunk-napd81ht.js} +3 -3
  73. package/dist/{chunk-c1b481my.js → chunk-nrh8t8re.js} +2 -2
  74. package/dist/{chunk-k54pgbzm.js → chunk-nsxg0t06.js} +1 -1
  75. package/dist/{chunk-rzh4xgb4.js → chunk-p66fgjeb.js} +1 -1
  76. package/dist/{chunk-0nzeqc13.js → chunk-p7cvn8q9.js} +2 -2
  77. package/dist/{chunk-vkpmemb1.js → chunk-p7h4y7mk.js} +1 -1
  78. package/dist/chunk-phjfsm8d.js +2 -0
  79. package/dist/chunk-pts7jpqc.js +2 -0
  80. package/dist/{chunk-qv99gqee.js → chunk-py818vbj.js} +1 -1
  81. package/dist/{chunk-4m3666pm.js → chunk-pzt3g2m0.js} +1 -1
  82. package/dist/{chunk-vvm38ysm.js → chunk-q69dvpg1.js} +1 -1
  83. package/dist/chunk-qcjtfrzm.js +2 -0
  84. package/dist/{chunk-e1e5xf8z.js → chunk-qdysx0fd.js} +5 -5
  85. package/dist/{chunk-3ffz7pd4.js → chunk-qr6jyd08.js} +1 -1
  86. package/dist/{chunk-2hbwpm36.js → chunk-r3qez0ph.js} +14 -14
  87. package/dist/{chunk-tqf8a258.js → chunk-rfzfk8zd.js} +6 -6
  88. package/dist/{chunk-t8cgxk8w.js → chunk-rj9dcjeg.js} +1 -1
  89. package/dist/{chunk-s9m2gfns.js → chunk-rk2v0wzs.js} +3 -3
  90. package/dist/chunk-rqpktvkn.js +2 -0
  91. package/dist/chunk-s1a69a8q.js +2 -0
  92. package/dist/{chunk-b8hsvzqb.js → chunk-s5kfndxv.js} +2 -2
  93. package/dist/{chunk-dphhs29v.js → chunk-s6ss1qnq.js} +2 -2
  94. package/dist/chunk-spmbnchd.js +2 -0
  95. package/dist/{chunk-knzp4c6m.js → chunk-svrjbeyq.js} +1 -1
  96. package/dist/chunk-t1gk6y8z.js +2 -0
  97. package/dist/chunk-t3cdnbq1.js +2 -0
  98. package/dist/chunk-t96gj0ey.js +2 -0
  99. package/dist/{chunk-fjbhtakz.js → chunk-tykyhmyx.js} +1 -1
  100. package/dist/chunk-vcks4gwd.js +2 -0
  101. package/dist/chunk-vg6p0zst.js +2 -0
  102. package/dist/chunk-vjsyf8m1.js +2 -0
  103. package/dist/{chunk-2mckhfet.js → chunk-vp8sjx6w.js} +5 -5
  104. package/dist/chunk-vq88tjma.js +2 -0
  105. package/dist/chunk-vqa2s0v4.js +2 -0
  106. package/dist/chunk-wtqj99tg.js +2 -0
  107. package/dist/{chunk-ccedry39.js → chunk-xj1k9bx9.js} +2 -2
  108. package/dist/chunk-xqa8f03q.js +2 -0
  109. package/dist/chunk-y7a0y5jq.js +2 -0
  110. package/dist/chunk-ydj0r3kw.js +2 -0
  111. package/dist/chunk-ydq170j1.js +2 -0
  112. package/dist/chunk-yz30cgyx.js +2 -0
  113. package/dist/{chunk-cft1sprt.js → chunk-yz85drm8.js} +1 -1
  114. package/dist/{chunk-mmcqgwk7.js → chunk-zg43k117.js} +2 -2
  115. package/dist/{chunk-m3dr63n0.js → chunk-zj32s5na.js} +2 -2
  116. package/dist/{chunk-m15nbvck.js → chunk-zmesddf4.js} +1 -1
  117. package/dist/{chunk-dvh63p75.js → chunk-znhzrjbm.js} +2 -2
  118. package/dist/{chunk-zs8yjtaz.js → chunk-zv924m9g.js} +5 -5
  119. package/dist/cli.js +11 -11
  120. package/dist/client/signals-for-runtime.js +2 -0
  121. package/dist/client/signals-if-runtime.js +2 -0
  122. package/dist/client/signals-loop-conditional-runtime.js +66 -0
  123. package/dist/component-contract-checks.js +3 -2
  124. package/dist/craft-entry.js +2 -2
  125. package/dist/craft.js +2 -2
  126. package/dist/expressions.js +15 -0
  127. package/dist/native/event-names.js +2 -0
  128. package/dist/native/prop-names.js +2 -0
  129. package/dist/pwa.js +3 -3
  130. package/dist/signal-processing.d.ts +12 -0
  131. package/dist/signal-processing.js +12 -1
  132. package/dist/ssg.js +2 -2
  133. package/package.json +5 -5
  134. package/dist/chunk-09cera09.js +0 -2
  135. package/dist/chunk-0f5276fm.js +0 -2
  136. package/dist/chunk-16n128gh.js +0 -2
  137. package/dist/chunk-171bbyqv.js +0 -2
  138. package/dist/chunk-1g0g498y.js +0 -2
  139. package/dist/chunk-1qppvj48.js +0 -2
  140. package/dist/chunk-1z77g0j6.js +0 -2
  141. package/dist/chunk-4bhbtvtm.js +0 -2
  142. package/dist/chunk-59r38w60.js +0 -2
  143. package/dist/chunk-5x312c05.js +0 -2
  144. package/dist/chunk-65h2h51z.js +0 -2
  145. package/dist/chunk-6ch8t3d9.js +0 -3
  146. package/dist/chunk-6rd0zz6k.js +0 -2
  147. package/dist/chunk-7bvhpdqv.js +0 -2
  148. package/dist/chunk-axxd53tn.js +0 -2
  149. package/dist/chunk-b8ar6431.js +0 -2
  150. package/dist/chunk-bnm7ym0g.js +0 -2
  151. package/dist/chunk-brg2ydrk.js +0 -2
  152. package/dist/chunk-c0fwppzc.js +0 -2
  153. package/dist/chunk-c5kpc7rn.js +0 -2
  154. package/dist/chunk-c8256r1a.js +0 -2
  155. package/dist/chunk-cap6exxx.js +0 -2
  156. package/dist/chunk-dt0deg4z.js +0 -2
  157. package/dist/chunk-ejqr5cva.js +0 -2
  158. package/dist/chunk-evbxyw80.js +0 -2
  159. package/dist/chunk-f66n66c8.js +0 -2
  160. package/dist/chunk-f6h8yagj.js +0 -2
  161. package/dist/chunk-fpsm2qed.js +0 -2
  162. package/dist/chunk-fzf7yfpn.js +0 -2
  163. package/dist/chunk-gaatje2g.js +0 -2
  164. package/dist/chunk-jhz0dvqz.js +0 -2
  165. package/dist/chunk-kkx2gqk8.js +0 -2
  166. package/dist/chunk-n9zka6dg.js +0 -2
  167. package/dist/chunk-pvx57vpw.js +0 -2
  168. package/dist/chunk-qcz104h3.js +0 -2
  169. package/dist/chunk-qgvez75f.js +0 -2
  170. package/dist/chunk-r0j6jkxc.js +0 -2
  171. package/dist/chunk-rzv9xcyp.js +0 -2
  172. package/dist/chunk-sy4wqxta.js +0 -2
  173. package/dist/chunk-szdm8wfn.js +0 -2
  174. package/dist/chunk-t424gvwc.js +0 -2
  175. package/dist/chunk-vtvaa8y9.js +0 -2
  176. package/dist/chunk-vvj09a7b.js +0 -2
  177. package/dist/chunk-vwjy6491.js +0 -2
  178. package/dist/chunk-wadp2rmj.js +0 -2
  179. package/dist/chunk-wbkcwj27.js +0 -2
  180. package/dist/chunk-wzp8y0a4.js +0 -2
  181. package/dist/chunk-xc1he6hs.js +0 -2
  182. package/dist/chunk-zhxg6b64.js +0 -2
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{Yr}from"./chunk-fz717vpc.js";import{S}from"./chunk-qv2k0qb1.js";import{a}from"./chunk-tqf8a258.js";import{qe,re}from"./chunk-kc3kt59e.js";import{Wa}from"./chunk-xcstrdhp.js";import{L}from"./chunk-0wj31pqy.js";import{g}from"./chunk-0dve54ne.js";import{existsSync as F,mkdirSync as y,copyFileSync as P,chmodSync as I,rmSync as he}from"fs";import{join as c,basename as ve,resolve as G}from"path";import{spawn as z}from"child_process";import{platform as xe}from"os";function E(e,r,i){let n=new RegExp(`</${r}\\s*>`,"iy"),s=S(e,(t,o)=>(n.lastIndex=o,n.exec(t)?n.lastIndex:-1))[0];return s?e.slice(0,s.start)+i+e.slice(s.start):null}var lu=`
2
+ import{Yr}from"./chunk-fz717vpc.js";import{S}from"./chunk-4qrr2mdd.js";import{a}from"./chunk-rfzfk8zd.js";import{qe,re}from"./chunk-kc3kt59e.js";import{Wa}from"./chunk-ggvnmmv3.js";import{L}from"./chunk-0wj31pqy.js";import{g}from"./chunk-0dve54ne.js";import{existsSync as F,mkdirSync as y,copyFileSync as P,chmodSync as I,rmSync as he}from"fs";import{join as c,basename as ve,resolve as G}from"path";import{spawn as z}from"child_process";import{platform as xe}from"os";function E(e,r,i){let n=new RegExp(`</${r}\\s*>`,"iy"),s=S(e,(t,o)=>(n.lastIndex=o,n.exec(t)?n.lastIndex:-1))[0];return s?e.slice(0,s.start)+i+e.slice(s.start):null}var lu=`
3
3
  <script>
4
4
  (function() {
5
5
  'use strict';
@@ -468,7 +468,7 @@ else if (data.type === 'event' && data.method) {
468
468
  }
469
469
  })();
470
470
  </script>
471
- `;function ya(e={}){let{debug:r=!1,timeout:i=30000}=e;return lu.replace("debug: false,",`debug: ${r},`).replace("timeout: 30000",`timeout: ${i}`)}function uh(){return!1}function dh(e,r={}){let i=/@craft(?:\(([\s\S]*?)\))?/g;return e.replace(i,(n,s)=>{let t={};if(s)try{t=JSON.parse(s.replace(/'/g,'"'))}catch{try{t=Function(`return ${s}`)()}catch{console.warn(`[stx] Invalid @craft config: ${s}`)}}return ya(t)})}function ba(e,r={}){if(e.includes("__craftBridgeInitialized"))return e;let i=ya(r),n=E(e,"head",`${i}
471
+ `;function ya(e={}){let{debug:r=!1,timeout:i=30000}=e;return lu.replace("debug: false,",`debug: ${r},`).replace("timeout: 30000",`timeout: ${i}`)}function dh(){return!1}function ph(e,r={}){let i=/@craft(?:\(([\s\S]*?)\))?/g;return e.replace(i,(n,s)=>{let t={};if(s)try{t=JSON.parse(s.replace(/'/g,'"'))}catch{try{t=Function(`return ${s}`)()}catch{console.warn(`[stx] Invalid @craft config: ${s}`)}}return ya(t)})}function ba(e,r={}){if(e.includes("__craftBridgeInitialized"))return e;let i=ya(r),n=E(e,"head",`${i}
472
472
  `);if(n!==null)return n;let s=L(e);if(s){let t=s.index+s.tag.length;return e.slice(0,t)+`
473
473
  ${i}`+e.slice(t)}return i+e}var wo={button:{nativeType:"craft-button",fallbackTag:"button",fallbackClasses:"craft-button",nativeProps:["variant","size","disabled","loading"]},"text-input":{nativeType:"craft-text-input",fallbackTag:"input",fallbackClasses:"craft-text-input",nativeProps:["placeholder","value","type","disabled","readonly"]},textarea:{nativeType:"craft-textarea",fallbackTag:"textarea",fallbackClasses:"craft-textarea",nativeProps:["placeholder","value","rows","disabled","readonly"]},checkbox:{nativeType:"craft-checkbox",fallbackTag:"input",fallbackClasses:"craft-checkbox",nativeProps:["checked","disabled","label"],render:(e,r)=>{let i=e.checked?"checked":"",n=e.disabled?"disabled":"";return`<label class="craft-checkbox-wrapper">
474
474
  <input type="checkbox" class="craft-checkbox" ${i} ${n}>
@@ -1029,7 +1029,7 @@ ${i}`+e.slice(t)}return i+e}var wo={button:{nativeType:"craft-button",fallbackTa
1029
1029
  ${e.icon?`<span class="craft-sidebar-item-icon" data-icon="${x(e.icon)}"${i}></span>`:""}
1030
1030
  <span class="craft-sidebar-item-label">${T(e.label)}</span>
1031
1031
  ${e.badge?`<span class="craft-sidebar-item-badge">${T(e.badge)}</span>`:""}
1032
- </button>`}function B(e){return e.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-|-$/g,"")||"craft-sidebar"}function le(e){let r=5381;for(let i=0;i<e.length;i++)r=r*33^e.charCodeAt(i);return(r>>>0).toString(36)}function T(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function x(e){return T(e).replace(/`/g,"&#96;")}function ue(e){return JSON.stringify(e).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026")}function fe(e,r,i){let n=[];n.push(`class="${i.join(" ")}"`),n.push(`data-craft="${r.nativeType}"`);for(let[s,t]of Object.entries(e))if(t===!0)n.push(s);else if(t!==!1&&t!==void 0&&t!==null){let o=String(t).replace(/"/g,"&quot;");n.push(`${s}="${o}"`)}return n.join(" ")}function ph(e,r){wo[e]=r}function fh(){return{...wo}}import{chmodSync as pe,copyFileSync as be,mkdtempSync as V,rmSync as ge,writeFileSync as J}from"fs";import{tmpdir as W}from"os";import{join as O}from"path";function me(e){let r=Bun.spawnSync(["/usr/bin/plutil","-extract","Entitlements","xml1","-o","-","-"],{stdin:e});if(r.exitCode!==0)throw Error(`Could not extract the macOS profile entitlements: ${r.stderr.toString().trim()||r.stdout.toString().trim()}`);let i=Bun.spawnSync(["/usr/bin/plutil","-convert","json","-o","-","-"],{stdin:r.stdout});if(i.exitCode!==0)throw Error(`Could not convert the macOS profile entitlements: ${i.stderr.toString().trim()||i.stdout.toString().trim()}`);let n=JSON.parse(i.stdout.toString());if(!n||typeof n!=="object"||Array.isArray(n))throw Error("The macOS profile entitlements must be a dictionary.");return n}function we(e,r){let i=O(r,"Contents","embedded.provisionprofile");be(e,i),pe(i,420)}async function Q(e,r=[],i={}){if(process.platform!=="darwin")return;let n=i.entitlements,s;try{if(i.provisioningProfile){if(!i.identity||i.identity==="-")throw Error("A provisioning profile requires a signing identity.");let u=Bun.spawnSync(["/usr/bin/security","cms","-D","-i",i.provisioningProfile]);if(u.exitCode!==0)throw Error("Could not decode the macOS provisioning profile.");let l=me(u.stdout),p={};if(i.entitlements){let b=Bun.spawnSync(["/usr/bin/plutil","-convert","json","-o","-",i.entitlements]);if(b.exitCode!==0)throw Error("Could not read the app entitlements plist.");p=JSON.parse(b.stdout.toString())}for(let b of["com.apple.application-identifier","com.apple.developer.team-identifier"])if(l[b])p[b]=l[b];if(s=V(O(W(),"stx-entitlements-")),n=O(s,"entitlements.plist"),J(n,JSON.stringify(p)),Bun.spawnSync(["/usr/bin/plutil","-convert","xml1",n]).exitCode!==0)throw Error("Could not generate the provisioned app entitlements.");we(i.provisioningProfile,e)}let t;if(r.length){let u=!1;if(n){let l=Bun.spawnSync(["/usr/bin/plutil","-convert","json","-o","-",n]);if(l.exitCode!==0)throw Error("Could not read native parent entitlements.");u=JSON.parse(l.stdout.toString())["com.apple.security.app-sandbox"]===!0}if(s??=V(O(W(),"stx-entitlements-")),t=O(s,"helper.entitlements.plist"),J(t,JSON.stringify({"com.apple.security.cs.allow-jit":!0,...u?{"com.apple.security.app-sandbox":!0,"com.apple.security.inherit":!0}:{}})),Bun.spawnSync(["/usr/bin/plutil","-convert","xml1",t]).exitCode!==0)throw Error("Could not generate native helper entitlements.")}for(let u of[...r,e]){let l=i.hardenedRuntime?["--options","runtime"]:[];if(u===e&&n)l.push("--entitlements",n);if(u!==e&&t)l.push("--entitlements",t);let p=i.identity&&i.identity!=="-"?"--timestamp":"--timestamp=none",b=Bun.spawn(["/usr/bin/codesign","--force","--sign",i.identity||"-",p,...l,u],{stdout:"pipe",stderr:"pipe"}),[m,v]=await Promise.all([new Response(b.stderr).text(),b.exited]);if(v!==0)throw Error(`Could not sign native bundle ${u}: ${m.trim()}`)}let o=Bun.spawn(["/usr/bin/codesign","--verify","--strict",e],{stdout:"pipe",stderr:"pipe"}),[d,f]=await Promise.all([new Response(o.stderr).text(),o.exited]);if(f!==0)throw Error(`Invalid native bundle signature: ${d.trim()}`)}finally{if(s)ge(s,{recursive:!0,force:!0})}}async function xa(e){if(e.window?.cornerRadius!==void 0&&(!Number.isFinite(e.window.cornerRadius)||e.window.cornerRadius<0||e.window.cornerRadius>128))throw Error("Native window cornerRadius must be between 0 and 128");let r=Date.now();try{if(!await Bun.file(e.input).exists())return{success:!1,target:e.target||D(),format:e.format||"app",error:`Input file not found: ${e.input}`};let i=e.target||D(),n=e.format||Be(i);if(e.backend&&i!=="macos")throw Error("Native backend bundles currently support macOS only.");if(e.backend&&!F(G(e.backend.entry)))throw Error(`Native backend not found: ${e.backend.entry}`);let s=e.output||c(process.cwd(),"dist","native");if(!F(s))y(s,{recursive:!0});let t=await a(process.cwd()),o=await Wa(e.input,{context:e.context,options:{...t,isDev:!1},injectCSS:!0});if(o=ba(o,{debug:e.verbose}),o=va(o),!o.includes("craft-component-styles")){if(o.includes("</head>"))o=o.replace("</head>",`${Jr}
1032
+ </button>`}function B(e){return e.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-|-$/g,"")||"craft-sidebar"}function le(e){let r=5381;for(let i=0;i<e.length;i++)r=r*33^e.charCodeAt(i);return(r>>>0).toString(36)}function T(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function x(e){return T(e).replace(/`/g,"&#96;")}function ue(e){return JSON.stringify(e).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026")}function fe(e,r,i){let n=[];n.push(`class="${i.join(" ")}"`),n.push(`data-craft="${r.nativeType}"`);for(let[s,t]of Object.entries(e))if(t===!0)n.push(s);else if(t!==!1&&t!==void 0&&t!==null){let o=String(t).replace(/"/g,"&quot;");n.push(`${s}="${o}"`)}return n.join(" ")}function fh(e,r){wo[e]=r}function gh(){return{...wo}}import{chmodSync as pe,copyFileSync as be,mkdtempSync as V,rmSync as ge,writeFileSync as J}from"fs";import{tmpdir as W}from"os";import{join as O}from"path";function me(e){let r=Bun.spawnSync(["/usr/bin/plutil","-extract","Entitlements","xml1","-o","-","-"],{stdin:e});if(r.exitCode!==0)throw Error(`Could not extract the macOS profile entitlements: ${r.stderr.toString().trim()||r.stdout.toString().trim()}`);let i=Bun.spawnSync(["/usr/bin/plutil","-convert","json","-o","-","-"],{stdin:r.stdout});if(i.exitCode!==0)throw Error(`Could not convert the macOS profile entitlements: ${i.stderr.toString().trim()||i.stdout.toString().trim()}`);let n=JSON.parse(i.stdout.toString());if(!n||typeof n!=="object"||Array.isArray(n))throw Error("The macOS profile entitlements must be a dictionary.");return n}function we(e,r){let i=O(r,"Contents","embedded.provisionprofile");be(e,i),pe(i,420)}async function Q(e,r=[],i={}){if(process.platform!=="darwin")return;let n=i.entitlements,s;try{if(i.provisioningProfile){if(!i.identity||i.identity==="-")throw Error("A provisioning profile requires a signing identity.");let u=Bun.spawnSync(["/usr/bin/security","cms","-D","-i",i.provisioningProfile]);if(u.exitCode!==0)throw Error("Could not decode the macOS provisioning profile.");let l=me(u.stdout),p={};if(i.entitlements){let b=Bun.spawnSync(["/usr/bin/plutil","-convert","json","-o","-",i.entitlements]);if(b.exitCode!==0)throw Error("Could not read the app entitlements plist.");p=JSON.parse(b.stdout.toString())}for(let b of["com.apple.application-identifier","com.apple.developer.team-identifier"])if(l[b])p[b]=l[b];if(s=V(O(W(),"stx-entitlements-")),n=O(s,"entitlements.plist"),J(n,JSON.stringify(p)),Bun.spawnSync(["/usr/bin/plutil","-convert","xml1",n]).exitCode!==0)throw Error("Could not generate the provisioned app entitlements.");we(i.provisioningProfile,e)}let t;if(r.length){let u=!1;if(n){let l=Bun.spawnSync(["/usr/bin/plutil","-convert","json","-o","-",n]);if(l.exitCode!==0)throw Error("Could not read native parent entitlements.");u=JSON.parse(l.stdout.toString())["com.apple.security.app-sandbox"]===!0}if(s??=V(O(W(),"stx-entitlements-")),t=O(s,"helper.entitlements.plist"),J(t,JSON.stringify({"com.apple.security.cs.allow-jit":!0,...u?{"com.apple.security.app-sandbox":!0,"com.apple.security.inherit":!0}:{}})),Bun.spawnSync(["/usr/bin/plutil","-convert","xml1",t]).exitCode!==0)throw Error("Could not generate native helper entitlements.")}for(let u of[...r,e]){let l=i.hardenedRuntime?["--options","runtime"]:[];if(u===e&&n)l.push("--entitlements",n);if(u!==e&&t)l.push("--entitlements",t);let p=i.identity&&i.identity!=="-"?"--timestamp":"--timestamp=none",b=Bun.spawn(["/usr/bin/codesign","--force","--sign",i.identity||"-",p,...l,u],{stdout:"pipe",stderr:"pipe"}),[m,v]=await Promise.all([new Response(b.stderr).text(),b.exited]);if(v!==0)throw Error(`Could not sign native bundle ${u}: ${m.trim()}`)}let o=Bun.spawn(["/usr/bin/codesign","--verify","--strict",e],{stdout:"pipe",stderr:"pipe"}),[d,f]=await Promise.all([new Response(o.stderr).text(),o.exited]);if(f!==0)throw Error(`Invalid native bundle signature: ${d.trim()}`)}finally{if(s)ge(s,{recursive:!0,force:!0})}}async function xa(e){if(e.window?.cornerRadius!==void 0&&(!Number.isFinite(e.window.cornerRadius)||e.window.cornerRadius<0||e.window.cornerRadius>128))throw Error("Native window cornerRadius must be between 0 and 128");let r=Date.now();try{if(!await Bun.file(e.input).exists())return{success:!1,target:e.target||D(),format:e.format||"app",error:`Input file not found: ${e.input}`};let i=e.target||D(),n=e.format||Be(i);if(e.backend&&i!=="macos")throw Error("Native backend bundles currently support macOS only.");if(e.backend&&!F(G(e.backend.entry)))throw Error(`Native backend not found: ${e.backend.entry}`);let s=e.output||c(process.cwd(),"dist","native");if(!F(s))y(s,{recursive:!0});let t=await a(process.cwd()),o=await Wa(e.input,{context:e.context,options:{...t,isDev:!1},injectCSS:!0});if(o=ba(o,{debug:e.verbose}),o=va(o),!o.includes("craft-component-styles")){if(o.includes("</head>"))o=o.replace("</head>",`${Jr}
1033
1033
  </head>`)}let d=e.name||ve(e.input,".stx"),f=e.version||"1.0.0",u=e.craftPath||Sa(e.runtimeProfile);if(!u)return{success:!1,target:i,format:n,error:"Craft native binary not found on PATH. Run pantry install craft, or specify craftPath for framework development."};if(e.runtimeProfile==="webview"){if(i!=="macos")throw Error("The webview runtime profile is currently available on macOS only.");let p=Bun.spawnSync([u,"--runtime-profile"],{stdout:"pipe",stderr:"pipe",timeout:1e4});if(p.exitCode!==0||p.stdout.toString().trim()!=="webview")throw Error("The requested Craft webview runtime is unavailable. Upgrade Craft with Pantry before building.")}if(u=Yr(e.craftPath,e.runtimeProfile),e.verbose)console.log(`\uD83D\uDCE6 Building native app for ${i}...`),console.log(` Input: ${e.input}`),console.log(` Output: ${s}`),console.log(` Craft: ${u}`);let l;switch(i){case"macos":l=await ye(o,d,f,s,n,e,u);break;case"windows":l=await $e(o,d,f,s,n,e,u);break;case"linux":l=await Te(o,d,f,s,n,e,u);break;case"ios":l=await Pe(o,d,f,s,e,u);break;case"android":l=await Ie(o,d,f,s,e,u);break;default:l={success:!1,target:i,format:n,error:`Unsupported target: ${i}`}}return l.duration=Date.now()-r,l}catch(i){return{success:!1,target:e.target||D(),format:e.format||"app",error:i.message,duration:Date.now()-r}}}async function ye(e,r,i,n,s,t,o){let d=t.bundleId||`com.stx.${r.toLowerCase().replace(/[^a-z0-9]/g,"")}`,f=c(n,`${r}.app`),u=c(f,"Contents"),l=c(u,"MacOS"),p=c(u,"Resources");he(f,{recursive:!0,force:!0}),y(l,{recursive:!0}),y(p,{recursive:!0});let b=c(p,"index.html");await Bun.write(b,e);let m="";if(t.sidebar?.enabled&&t.sidebar?.config)m=c(p,"sidebar-config.json"),await Bun.write(m,JSON.stringify(t.sidebar.config));let v=t.sidebar?.enabled?`--native-sidebar --sidebar-width ${t.sidebar?.width||240} --sidebar-config "$(cat "$RESOURCES/sidebar-config.json")"`:"",k=t.menubarOnly??t.systemTray,h=t.bundleStyle||(await Ce(o)?"executable":"launcher");if(t.backend){if(!await Se(o))throw Error("This Craft runtime does not support bundled backends. Upgrade Craft before building this app.");P(o,c(l,r)),I(c(l,r),493);let C=qe("native-backend");try{let w=c(C,"launcher.ts"),M=c(import.meta.dir,"native-backend"+(import.meta.path.endsWith(".ts")?".ts":".js"));await Bun.write(w,`import { runNativeBackend } from ${JSON.stringify(M)}
1034
1034
  import * as backend from ${JSON.stringify(G(t.backend.entry))}
1035
1035
  await runNativeBackend({ html: ${JSON.stringify(e)}, fetch: backend.default, shutdown: Reflect.get(backend, "shutdown"),
@@ -1097,5 +1097,5 @@ Exec=${i.toLowerCase()}
1097
1097
  Terminal=false
1098
1098
  Categories=Utility;
1099
1099
  Icon=${i.toLowerCase()}
1100
- `;g("fs").writeFileSync(c(o,`${i.toLowerCase()}.desktop`),m);let v=Buffer.from([137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,1,0,0,0,1,8,2,0,0,0,144,119,83,222,0,0,0,12,73,68,65,84,8,215,99,248,255,255,63,0,5,254,2,254,220,204,89,231,0,0,0,0,73,69,78,68,174,66,96,130]);if(g("fs").writeFileSync(c(o,`${i.toLowerCase()}.png`),v),n.icon&&F(n.icon))P(n.icon,c(o,`${i.toLowerCase()}.png`));let k=z("appimagetool",[o,r],{env:{...process.env,ARCH:"x86_64"}});k.on("close",(h)=>{if(re(t),h===0)I(r,493),s({success:!0});else s({success:!1,error:`appimagetool exited with code ${h}. Install from https://appimage.github.io/appimagetool/`})}),k.on("error",(h)=>{re(t),s({success:!1,error:`appimagetool not found: ${h.message}`})})}catch(o){re(t),s({success:!1,error:o.message})}})}function ka(){return[D()]}function _a(e){switch(e){case"macos":return["app","dmg","pkg"];case"windows":return["app","zip","msi"];case"linux":return["app","deb","rpm","appimage"];case"ios":return["ipa"];case"android":return["apk"];default:return["app"]}}var Ae={buildNative:xa,getAvailableTargets:ka,getAvailableFormats:_a,detectPlatform:D},gh=Ae;
1101
- export{lu,ya,uh,dh,ba,wo,Jr,wa,va,ph,fh,xa,Sa,ka,_a,gh};
1100
+ `;g("fs").writeFileSync(c(o,`${i.toLowerCase()}.desktop`),m);let v=Buffer.from([137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,1,0,0,0,1,8,2,0,0,0,144,119,83,222,0,0,0,12,73,68,65,84,8,215,99,248,255,255,63,0,5,254,2,254,220,204,89,231,0,0,0,0,73,69,78,68,174,66,96,130]);if(g("fs").writeFileSync(c(o,`${i.toLowerCase()}.png`),v),n.icon&&F(n.icon))P(n.icon,c(o,`${i.toLowerCase()}.png`));let k=z("appimagetool",[o,r],{env:{...process.env,ARCH:"x86_64"}});k.on("close",(h)=>{if(re(t),h===0)I(r,493),s({success:!0});else s({success:!1,error:`appimagetool exited with code ${h}. Install from https://appimage.github.io/appimagetool/`})}),k.on("error",(h)=>{re(t),s({success:!1,error:`appimagetool not found: ${h.message}`})})}catch(o){re(t),s({success:!1,error:o.message})}})}function ka(){return[D()]}function _a(e){switch(e){case"macos":return["app","dmg","pkg"];case"windows":return["app","zip","msi"];case"linux":return["app","deb","rpm","appimage"];case"ios":return["ipa"];case"android":return["apk"];default:return["app"]}}var Ae={buildNative:xa,getAvailableTargets:ka,getAvailableFormats:_a,detectPlatform:D},mh=Ae;
1101
+ export{lu,ya,dh,ph,ba,wo,Jr,wa,va,fh,gh,xa,Sa,ka,_a,mh};
@@ -1,2 +1,2 @@
1
1
  // @bun
2
- import{_l,Qi,Cl,El,ea,Tl,$l,Rl,Al,ta,Pl,Ug}from"./chunk-0d29b573.js";import{la,Ml}from"./chunk-pqgk9mxp.js";import{Q,ee,te,On,me,Te,Wr,ft,Kt,Nn,Dn,Mn,ne,Ln,jn,qr}from"./chunk-t70s45hc.js";import{ou}from"./chunk-ysfeg3cn.js";import"./chunk-kc3kt59e.js";export{ee as DEFAULT_FORMATS,te as DEFAULT_QUALITY,Q as DEFAULT_WIDTHS,qr as ImageProcessingError,El as clearImageCache,ea as createImageDirective,Ml as createImageHandler,$l as createImagePlugin,Ug as defaultImageConfig,jn as formatSize,ta as generateImageManifest,Kt as generateSizes,ft as generateSrcSet,Nn as getFallbackVariant,Wr as getImageMetadata,ne as getMimeType,Ln as getTotalSize,Dn as groupVariantsByFormat,la as handleImageRequest,Tl as imageDirective,me as isImageBackendAvailable,Mn as isImageFile,On as isSharpAvailable,Al as optimizeDirectory,Rl as optimizeImage,Qi as parseImageComponent,Te as processImage,Cl as processImageComponents,_l as renderImageComponent,ou as rewriteImagesWithSiblings,Pl as writeImageManifest};
2
+ import{_l,Qi,Cl,El,ea,Tl,$l,Rl,Al,ta,Pl,Wg}from"./chunk-jd84zgn3.js";import{la,Ml}from"./chunk-pqgk9mxp.js";import{Q,ee,te,On,me,Te,Wr,ft,Kt,Nn,Dn,Mn,ne,Ln,jn,qr}from"./chunk-t70s45hc.js";import{ou}from"./chunk-ysfeg3cn.js";import"./chunk-kc3kt59e.js";export{ee as DEFAULT_FORMATS,te as DEFAULT_QUALITY,Q as DEFAULT_WIDTHS,qr as ImageProcessingError,El as clearImageCache,ea as createImageDirective,Ml as createImageHandler,$l as createImagePlugin,Wg as defaultImageConfig,jn as formatSize,ta as generateImageManifest,Kt as generateSizes,ft as generateSrcSet,Nn as getFallbackVariant,Wr as getImageMetadata,ne as getMimeType,Ln as getTotalSize,Dn as groupVariantsByFormat,la as handleImageRequest,Tl as imageDirective,me as isImageBackendAvailable,Mn as isImageFile,On as isSharpAvailable,Al as optimizeDirectory,Rl as optimizeImage,Qi as parseImageComponent,Te as processImage,Cl as processImageComponents,_l as renderImageComponent,ou as rewriteImagesWithSiblings,Pl as writeImageManifest};