@ohos-ports/stacksjs-stx 0.2.287-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (946) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +1042 -0
  3. package/dist/a11y.d.ts +256 -0
  4. package/dist/a11y.js +671 -0
  5. package/dist/analytics.d.ts +40 -0
  6. package/dist/analytics.js +159 -0
  7. package/dist/analyzer.d.ts +68 -0
  8. package/dist/analyzer.js +240 -0
  9. package/dist/animation.d.ts +123 -0
  10. package/dist/animation.js +688 -0
  11. package/dist/app-shell.d.ts +76 -0
  12. package/dist/app-shell.js +209 -0
  13. package/dist/app.d.ts +65 -0
  14. package/dist/app.js +79 -0
  15. package/dist/appearance-bootstrap.d.ts +54 -0
  16. package/dist/appearance-bootstrap.js +92 -0
  17. package/dist/asset-roots.d.ts +32 -0
  18. package/dist/asset-roots.js +7 -0
  19. package/dist/assets.d.ts +21 -0
  20. package/dist/assets.js +155 -0
  21. package/dist/ast.d.ts +265 -0
  22. package/dist/ast.js +630 -0
  23. package/dist/async-components.d.ts +123 -0
  24. package/dist/async-components.js +428 -0
  25. package/dist/auth.d.ts +13 -0
  26. package/dist/auth.js +12 -0
  27. package/dist/broadcasting.d.ts +77 -0
  28. package/dist/broadcasting.js +103 -0
  29. package/dist/browser-composables.d.ts +348 -0
  30. package/dist/browser-composables.js +606 -0
  31. package/dist/browser-core-imports.d.ts +12 -0
  32. package/dist/browser-core-imports.js +28 -0
  33. package/dist/build-assets.d.ts +32 -0
  34. package/dist/build-assets.js +29 -0
  35. package/dist/build-externalize-repeated.d.ts +34 -0
  36. package/dist/build-externalize-repeated.js +101 -0
  37. package/dist/build-externalize.d.ts +73 -0
  38. package/dist/build-externalize.js +80 -0
  39. package/dist/build-id.d.ts +57 -0
  40. package/dist/build-id.js +25 -0
  41. package/dist/build-message.d.ts +81 -0
  42. package/dist/build-message.js +65 -0
  43. package/dist/build-mode-detector.d.ts +26 -0
  44. package/dist/build-mode-detector.js +50 -0
  45. package/dist/build-optimizer.d.ts +101 -0
  46. package/dist/build-optimizer.js +433 -0
  47. package/dist/build-views.d.ts +56 -0
  48. package/dist/build-views.js +180 -0
  49. package/dist/build.d.ts +31 -0
  50. package/dist/build.js +34 -0
  51. package/dist/builtins/attrs.d.ts +49 -0
  52. package/dist/builtins/attrs.js +39 -0
  53. package/dist/builtins/drawer.d.ts +24 -0
  54. package/dist/builtins/drawer.js +37 -0
  55. package/dist/builtins/escape.d.ts +12 -0
  56. package/dist/builtins/escape.js +3 -0
  57. package/dist/builtins/icon.d.ts +45 -0
  58. package/dist/builtins/icon.js +100 -0
  59. package/dist/builtins/image-delivery.d.ts +16 -0
  60. package/dist/builtins/image-delivery.js +115 -0
  61. package/dist/builtins/image-placeholder.d.ts +78 -0
  62. package/dist/builtins/image-placeholder.js +137 -0
  63. package/dist/builtins/index.d.ts +26 -0
  64. package/dist/builtins/index.js +34 -0
  65. package/dist/builtins/modal.d.ts +26 -0
  66. package/dist/builtins/modal.js +38 -0
  67. package/dist/builtins/safe-image.d.ts +44 -0
  68. package/dist/builtins/safe-image.js +45 -0
  69. package/dist/builtins/stx-image.d.ts +29 -0
  70. package/dist/builtins/stx-image.js +222 -0
  71. package/dist/builtins/stx-link.d.ts +11 -0
  72. package/dist/builtins/stx-link.js +35 -0
  73. package/dist/builtins/stx-loading-indicator.d.ts +13 -0
  74. package/dist/builtins/stx-loading-indicator.js +35 -0
  75. package/dist/builtins/suspense.d.ts +30 -0
  76. package/dist/builtins/suspense.js +24 -0
  77. package/dist/builtins/toast.d.ts +19 -0
  78. package/dist/builtins/toast.js +42 -0
  79. package/dist/builtins/tooltip.d.ts +18 -0
  80. package/dist/builtins/tooltip.js +106 -0
  81. package/dist/builtins/transition-group.d.ts +27 -0
  82. package/dist/builtins/transition-group.js +22 -0
  83. package/dist/bun-shim.js +496 -0
  84. package/dist/bundle-analyzer/collector.d.ts +66 -0
  85. package/dist/bundle-analyzer/collector.js +233 -0
  86. package/dist/bundle-analyzer/index.d.ts +98 -0
  87. package/dist/bundle-analyzer/index.js +82 -0
  88. package/dist/bundle-analyzer/report.d.ts +39 -0
  89. package/dist/bundle-analyzer/report.js +318 -0
  90. package/dist/bundle-analyzer/treemap.d.ts +19 -0
  91. package/dist/bundle-analyzer/treemap.js +594 -0
  92. package/dist/bundle-analyzer.js +499 -0
  93. package/dist/caching.d.ts +69 -0
  94. package/dist/caching.js +135 -0
  95. package/dist/chunk-0y46fbkx.js +3 -0
  96. package/dist/chunk-122tyfre.js +2 -0
  97. package/dist/chunk-19nfvxfw.js +43 -0
  98. package/dist/chunk-1kah92n2.js +3 -0
  99. package/dist/chunk-1kms3b9d.js +2 -0
  100. package/dist/chunk-1q4y74mh.js +1194 -0
  101. package/dist/chunk-248e84r1.js +4 -0
  102. package/dist/chunk-24ps8kft.js +2 -0
  103. package/dist/chunk-2et5hxfv.js +2 -0
  104. package/dist/chunk-2r1rd8f0.js +2 -0
  105. package/dist/chunk-2tk1zkrz.js +2 -0
  106. package/dist/chunk-38ejahd9.js +3 -0
  107. package/dist/chunk-3zv4wz87.js +2 -0
  108. package/dist/chunk-4122k1bh.js +2 -0
  109. package/dist/chunk-45az9zht.js +2 -0
  110. package/dist/chunk-4qr85f07.js +2 -0
  111. package/dist/chunk-4ww3znrr.js +15 -0
  112. package/dist/chunk-54st8g2j.js +397 -0
  113. package/dist/chunk-58f0mthg.js +3 -0
  114. package/dist/chunk-5a19dhx5.js +2 -0
  115. package/dist/chunk-5kk8gsj2.js +3 -0
  116. package/dist/chunk-5w1e3yxs.js +499 -0
  117. package/dist/chunk-6gdycmxr.js +2 -0
  118. package/dist/chunk-6hmnaza7.js +4473 -0
  119. package/dist/chunk-71t0yan0.js +5 -0
  120. package/dist/chunk-74cv4ta1.js +3 -0
  121. package/dist/chunk-74v15e8z.js +2 -0
  122. package/dist/chunk-7b329e5v.js +3 -0
  123. package/dist/chunk-7q9mwh4v.js +84 -0
  124. package/dist/chunk-866y9d8b.js +8169 -0
  125. package/dist/chunk-8fwerspy.js +2 -0
  126. package/dist/chunk-8mjdpr94.js +147 -0
  127. package/dist/chunk-92mj1t26.js +60 -0
  128. package/dist/chunk-9b22663r.js +2 -0
  129. package/dist/chunk-9hjdgm4d.js +2 -0
  130. package/dist/chunk-9n0gvfrg.js +4 -0
  131. package/dist/chunk-9wr7zcad.js +18 -0
  132. package/dist/chunk-9y0g8kzt.js +358 -0
  133. package/dist/chunk-a0nfbmeh.js +3 -0
  134. package/dist/chunk-acn1b56m.js +1280 -0
  135. package/dist/chunk-awkq3xfx.js +2 -0
  136. package/dist/chunk-b6ej2fdf.js +1814 -0
  137. package/dist/chunk-b8rrnqry.js +2 -0
  138. package/dist/chunk-bfqfs07m.js +3022 -0
  139. package/dist/chunk-bs6kapy7.js +2 -0
  140. package/dist/chunk-btav940g.js +2 -0
  141. package/dist/chunk-bz820epz.js +3 -0
  142. package/dist/chunk-ccspd3mc.js +2 -0
  143. package/dist/chunk-csbgwaa5.js +2 -0
  144. package/dist/chunk-d8t4sjsp.js +2 -0
  145. package/dist/chunk-dap191q2.js +2 -0
  146. package/dist/chunk-de7fye10.js +4 -0
  147. package/dist/chunk-dgrt76d2.js +2 -0
  148. package/dist/chunk-dhh5q7qt.js +3 -0
  149. package/dist/chunk-dsffsqnt.js +2 -0
  150. package/dist/chunk-dtq7y5ym.js +2 -0
  151. package/dist/chunk-fed3xsp9.js +3 -0
  152. package/dist/chunk-ferav3bw.js +19 -0
  153. package/dist/chunk-fvhm8psm.js +3 -0
  154. package/dist/chunk-g4vpzv6b.js +2 -0
  155. package/dist/chunk-g9csmj0s.js +2 -0
  156. package/dist/chunk-gtcrpmz1.js +2 -0
  157. package/dist/chunk-h4xh8cms.js +4 -0
  158. package/dist/chunk-h8yqsz9m.js +2 -0
  159. package/dist/chunk-hcq5dw7a.js +2 -0
  160. package/dist/chunk-hm0xha6c.js +12 -0
  161. package/dist/chunk-hpybjwwf.js +8 -0
  162. package/dist/chunk-jegt35zh.js +2 -0
  163. package/dist/chunk-jr3jp3ev.js +8 -0
  164. package/dist/chunk-k56rjjc0.js +24 -0
  165. package/dist/chunk-kdh37tp8.js +194 -0
  166. package/dist/chunk-kxzb4et3.js +29 -0
  167. package/dist/chunk-mf4n3x1j.js +14 -0
  168. package/dist/chunk-mkd9kjgb.js +3 -0
  169. package/dist/chunk-mxfh1nxg.js +2 -0
  170. package/dist/chunk-n3ggrhb3.js +3 -0
  171. package/dist/chunk-nkb3scg6.js +8 -0
  172. package/dist/chunk-nnd4wq8j.js +231 -0
  173. package/dist/chunk-nsp1cw38.js +11 -0
  174. package/dist/chunk-nx5qkm8k.js +30 -0
  175. package/dist/chunk-p3242nck.js +2 -0
  176. package/dist/chunk-p98kfh94.js +2 -0
  177. package/dist/chunk-pkaabd8h.js +3 -0
  178. package/dist/chunk-pzm13sdc.js +3 -0
  179. package/dist/chunk-q4p5k2p3.js +2 -0
  180. package/dist/chunk-q9n5swx7.js +3 -0
  181. package/dist/chunk-qc1f74ek.js +3 -0
  182. package/dist/chunk-qpyjak7z.js +2 -0
  183. package/dist/chunk-qr82je1m.js +22 -0
  184. package/dist/chunk-qy73j6m4.js +288 -0
  185. package/dist/chunk-qzkhpsam.js +505 -0
  186. package/dist/chunk-r3ayvdz3.js +2 -0
  187. package/dist/chunk-r7r66978.js +2 -0
  188. package/dist/chunk-rbb7dvja.js +30 -0
  189. package/dist/chunk-refwkt87.js +71 -0
  190. package/dist/chunk-rj4kajww.js +2 -0
  191. package/dist/chunk-rp4rjjmf.js +2 -0
  192. package/dist/chunk-se0p17c2.js +898 -0
  193. package/dist/chunk-sj9pmene.js +2 -0
  194. package/dist/chunk-sscwkffs.js +2 -0
  195. package/dist/chunk-svpqxn2c.js +2 -0
  196. package/dist/chunk-t6nseeb9.js +351 -0
  197. package/dist/chunk-t8y1ggdy.js +2 -0
  198. package/dist/chunk-tndhnk9e.js +2 -0
  199. package/dist/chunk-v5e1gxwm.js +3 -0
  200. package/dist/chunk-vqxmxgaj.js +4 -0
  201. package/dist/chunk-vrrax298.js +2 -0
  202. package/dist/chunk-w3ycm4na.js +3 -0
  203. package/dist/chunk-wcm80anz.js +321 -0
  204. package/dist/chunk-wrzwgkbx.js +22 -0
  205. package/dist/chunk-x650vjcp.js +302 -0
  206. package/dist/chunk-xgnc1wy6.js +116 -0
  207. package/dist/chunk-xpp135ad.js +11 -0
  208. package/dist/chunk-xttsqmkm.js +216 -0
  209. package/dist/chunk-y11cxbxd.js +3757 -0
  210. package/dist/chunk-y7m2dpd3.js +341 -0
  211. package/dist/chunk-y98jsjqq.js +2 -0
  212. package/dist/chunk-ya386h70.js +2 -0
  213. package/dist/chunk-ydrz60kr.js +2 -0
  214. package/dist/chunk-ypmqf7tm.js +4 -0
  215. package/dist/chunk-z4jhj5e5.js +28 -0
  216. package/dist/chunk-zg75gjns.js +2 -0
  217. package/dist/chunk-zqqx1qaj.js +2 -0
  218. package/dist/cli-flags.d.ts +34 -0
  219. package/dist/cli-flags.js +20 -0
  220. package/dist/cli.js +174 -0
  221. package/dist/client/directive.d.ts +17 -0
  222. package/dist/client/directive.js +14 -0
  223. package/dist/client/index.d.ts +7 -0
  224. package/dist/client/index.js +2 -0
  225. package/dist/client-helpers.d.ts +317 -0
  226. package/dist/client-helpers.js +312 -0
  227. package/dist/client-script-bundler.d.ts +103 -0
  228. package/dist/client-script-bundler.js +390 -0
  229. package/dist/client-script.d.ts +215 -0
  230. package/dist/client-script.js +865 -0
  231. package/dist/client.d.ts +21 -0
  232. package/dist/client.js +73 -0
  233. package/dist/codemod.d.ts +33 -0
  234. package/dist/codemod.js +244 -0
  235. package/dist/color-mode-boot.d.ts +92 -0
  236. package/dist/color-mode-boot.js +72 -0
  237. package/dist/component-client-factories.d.ts +33 -0
  238. package/dist/component-client-factories.js +77 -0
  239. package/dist/component-hmr.d.ts +107 -0
  240. package/dist/component-hmr.js +585 -0
  241. package/dist/component-library.d.ts +38 -0
  242. package/dist/component-library.js +994 -0
  243. package/dist/component-processing.d.ts +198 -0
  244. package/dist/component-processing.js +677 -0
  245. package/dist/component-registry.d.ts +127 -0
  246. package/dist/component-registry.js +90 -0
  247. package/dist/component-renderer.d.ts +52 -0
  248. package/dist/component-renderer.js +790 -0
  249. package/dist/components/StxImage.stx +12 -0
  250. package/dist/components/StxLink.stx +18 -0
  251. package/dist/components.d.ts +28 -0
  252. package/dist/components.js +213 -0
  253. package/dist/composable-loader.d.ts +62 -0
  254. package/dist/composable-loader.js +190 -0
  255. package/dist/composables/index.d.ts +417 -0
  256. package/dist/composables/index.js +222 -0
  257. package/dist/composables/use-battery.d.ts +46 -0
  258. package/dist/composables/use-battery.js +101 -0
  259. package/dist/composables/use-broadcast-channel.d.ts +59 -0
  260. package/dist/composables/use-broadcast-channel.js +80 -0
  261. package/dist/composables/use-channel.d.ts +67 -0
  262. package/dist/composables/use-channel.js +124 -0
  263. package/dist/composables/use-clipboard.d.ts +30 -0
  264. package/dist/composables/use-clipboard.js +90 -0
  265. package/dist/composables/use-color-mode.d.ts +67 -0
  266. package/dist/composables/use-color-mode.js +152 -0
  267. package/dist/composables/use-cookie.d.ts +59 -0
  268. package/dist/composables/use-cookie.js +86 -0
  269. package/dist/composables/use-device-orientation.d.ts +116 -0
  270. package/dist/composables/use-device-orientation.js +181 -0
  271. package/dist/composables/use-event-listener.d.ts +35 -0
  272. package/dist/composables/use-event-listener.js +27 -0
  273. package/dist/composables/use-event-source.d.ts +90 -0
  274. package/dist/composables/use-event-source.js +166 -0
  275. package/dist/composables/use-eye-dropper.d.ts +117 -0
  276. package/dist/composables/use-eye-dropper.js +142 -0
  277. package/dist/composables/use-fetch.d.ts +59 -0
  278. package/dist/composables/use-fetch.js +273 -0
  279. package/dist/composables/use-form.d.ts +91 -0
  280. package/dist/composables/use-form.js +112 -0
  281. package/dist/composables/use-fullscreen.d.ts +47 -0
  282. package/dist/composables/use-fullscreen.js +110 -0
  283. package/dist/composables/use-geolocation.d.ts +62 -0
  284. package/dist/composables/use-geolocation.js +101 -0
  285. package/dist/composables/use-idle.d.ts +102 -0
  286. package/dist/composables/use-idle.js +182 -0
  287. package/dist/composables/use-intersection-observer.d.ts +83 -0
  288. package/dist/composables/use-intersection-observer.js +168 -0
  289. package/dist/composables/use-keyboard.d.ts +100 -0
  290. package/dist/composables/use-keyboard.js +224 -0
  291. package/dist/composables/use-media-query.d.ts +56 -0
  292. package/dist/composables/use-media-query.js +62 -0
  293. package/dist/composables/use-meta.d.ts +35 -0
  294. package/dist/composables/use-meta.js +48 -0
  295. package/dist/composables/use-mouse.d.ts +65 -0
  296. package/dist/composables/use-mouse.js +286 -0
  297. package/dist/composables/use-mutation-observer.d.ts +101 -0
  298. package/dist/composables/use-mutation-observer.js +129 -0
  299. package/dist/composables/use-network.d.ts +40 -0
  300. package/dist/composables/use-network.js +85 -0
  301. package/dist/composables/use-notification.d.ts +98 -0
  302. package/dist/composables/use-notification.js +94 -0
  303. package/dist/composables/use-permissions.d.ts +119 -0
  304. package/dist/composables/use-permissions.js +132 -0
  305. package/dist/composables/use-query.d.ts +48 -0
  306. package/dist/composables/use-query.js +0 -0
  307. package/dist/composables/use-resize-observer.d.ts +60 -0
  308. package/dist/composables/use-resize-observer.js +157 -0
  309. package/dist/composables/use-router.d.ts +80 -0
  310. package/dist/composables/use-router.js +105 -0
  311. package/dist/composables/use-scroll-lock.d.ts +13 -0
  312. package/dist/composables/use-scroll-lock.js +55 -0
  313. package/dist/composables/use-share.d.ts +74 -0
  314. package/dist/composables/use-share.js +104 -0
  315. package/dist/composables/use-speech.d.ts +117 -0
  316. package/dist/composables/use-speech.js +294 -0
  317. package/dist/composables/use-storage.d.ts +69 -0
  318. package/dist/composables/use-storage.js +196 -0
  319. package/dist/composables/use-text-selection.d.ts +121 -0
  320. package/dist/composables/use-text-selection.js +205 -0
  321. package/dist/composables/use-timer.d.ts +92 -0
  322. package/dist/composables/use-timer.js +193 -0
  323. package/dist/composables/use-utilities.d.ts +103 -0
  324. package/dist/composables/use-utilities.js +176 -0
  325. package/dist/composables/use-wake-lock.d.ts +85 -0
  326. package/dist/composables/use-wake-lock.js +122 -0
  327. package/dist/composables/use-websocket.d.ts +70 -0
  328. package/dist/composables/use-websocket.js +165 -0
  329. package/dist/composables/use-window.d.ts +84 -0
  330. package/dist/composables/use-window.js +163 -0
  331. package/dist/composables.d.ts +287 -0
  332. package/dist/composables.js +562 -0
  333. package/dist/composition-api.d.ts +197 -0
  334. package/dist/composition-api.js +199 -0
  335. package/dist/compression.d.ts +30 -0
  336. package/dist/compression.js +107 -0
  337. package/dist/computed.d.ts +138 -0
  338. package/dist/computed.js +382 -0
  339. package/dist/conditionals.d.ts +48 -0
  340. package/dist/conditionals.js +626 -0
  341. package/dist/config.d.ts +77 -0
  342. package/dist/config.js +828 -0
  343. package/dist/cookie-serialize.d.ts +40 -0
  344. package/dist/cookie-serialize.js +18 -0
  345. package/dist/craft-bridge.d.ts +525 -0
  346. package/dist/craft-bridge.js +511 -0
  347. package/dist/craft-compiler.d.ts +245 -0
  348. package/dist/craft-compiler.js +810 -0
  349. package/dist/craft-components.d.ts +739 -0
  350. package/dist/craft-components.js +1074 -0
  351. package/dist/craft-entry.d.ts +6 -0
  352. package/dist/craft-entry.js +9 -0
  353. package/dist/craft-ssr.d.ts +147 -0
  354. package/dist/craft-ssr.js +559 -0
  355. package/dist/craft.js +9 -0
  356. package/dist/csp.d.ts +295 -0
  357. package/dist/csp.js +220 -0
  358. package/dist/csrf.d.ts +38 -0
  359. package/dist/csrf.js +38 -0
  360. package/dist/custom-directives.d.ts +5 -0
  361. package/dist/custom-directives.js +136 -0
  362. package/dist/database.d.ts +391 -0
  363. package/dist/database.js +5 -0
  364. package/dist/defer.d.ts +28 -0
  365. package/dist/defer.js +156 -0
  366. package/dist/deploy/config-generators.d.ts +75 -0
  367. package/dist/deploy/config-generators.js +214 -0
  368. package/dist/deploy/index.d.ts +88 -0
  369. package/dist/deploy/index.js +203 -0
  370. package/dist/deploy/netlify.d.ts +109 -0
  371. package/dist/deploy/netlify.js +167 -0
  372. package/dist/desktop.d.ts +16 -0
  373. package/dist/desktop.js +1 -0
  374. package/dist/dev-server/index.d.ts +22 -0
  375. package/dist/dev-server/index.js +7 -0
  376. package/dist/dev-server/keyboard-shortcuts.d.ts +34 -0
  377. package/dist/dev-server/keyboard-shortcuts.js +81 -0
  378. package/dist/dev-server/native-window.d.ts +59 -0
  379. package/dist/dev-server/native-window.js +91 -0
  380. package/dist/dev-server/port-utils.d.ts +27 -0
  381. package/dist/dev-server/port-utils.js +40 -0
  382. package/dist/dev-server/serve-app.d.ts +15 -0
  383. package/dist/dev-server/serve-app.js +727 -0
  384. package/dist/dev-server/serve-file.d.ts +3 -0
  385. package/dist/dev-server/serve-file.js +443 -0
  386. package/dist/dev-server/serve-markdown.d.ts +3 -0
  387. package/dist/dev-server/serve-markdown.js +284 -0
  388. package/dist/dev-server/serve-multi.d.ts +5 -0
  389. package/dist/dev-server/serve-multi.js +596 -0
  390. package/dist/dev-server/terminal-colors.d.ts +56 -0
  391. package/dist/dev-server/terminal-colors.js +45 -0
  392. package/dist/dev-server/theme-selector.d.ts +32 -0
  393. package/dist/dev-server/theme-selector.js +111 -0
  394. package/dist/dev-server/ts-css.d.ts +108 -0
  395. package/dist/dev-server/ts-css.js +438 -0
  396. package/dist/dev-server/types.d.ts +99 -0
  397. package/dist/dev-server/types.js +43 -0
  398. package/dist/dev-server.d.ts +6 -0
  399. package/dist/dev-server.js +4 -0
  400. package/dist/devtools.d.ts +182 -0
  401. package/dist/devtools.js +593 -0
  402. package/dist/directive-api.d.ts +154 -0
  403. package/dist/directive-api.js +355 -0
  404. package/dist/docs.d.ts +56 -0
  405. package/dist/docs.js +567 -0
  406. package/dist/doctor.d.ts +29 -0
  407. package/dist/doctor.js +123 -0
  408. package/dist/document-shell.d.ts +218 -0
  409. package/dist/document-shell.js +338 -0
  410. package/dist/dynamic-components.d.ts +23 -0
  411. package/dist/dynamic-components.js +197 -0
  412. package/dist/edge-runtime.d.ts +193 -0
  413. package/dist/edge-runtime.js +525 -0
  414. package/dist/env.d.ts +3 -0
  415. package/dist/env.js +9 -0
  416. package/dist/error-boundaries.d.ts +78 -0
  417. package/dist/error-boundaries.js +281 -0
  418. package/dist/error-handling.d.ts +14 -0
  419. package/dist/error-handling.js +1 -0
  420. package/dist/errors/codes.d.ts +92 -0
  421. package/dist/errors/codes.js +97 -0
  422. package/dist/errors/formatter.d.ts +84 -0
  423. package/dist/errors/formatter.js +196 -0
  424. package/dist/errors/index.d.ts +12 -0
  425. package/dist/errors/index.js +44 -0
  426. package/dist/errors/logger.d.ts +135 -0
  427. package/dist/errors/logger.js +250 -0
  428. package/dist/errors/sanitizer.d.ts +73 -0
  429. package/dist/errors/sanitizer.js +181 -0
  430. package/dist/errors/types.d.ts +92 -0
  431. package/dist/errors/types.js +86 -0
  432. package/dist/events.d.ts +145 -0
  433. package/dist/events.js +396 -0
  434. package/dist/expressions.d.ts +180 -0
  435. package/dist/expressions.js +719 -0
  436. package/dist/find-body-tag.d.ts +50 -0
  437. package/dist/find-body-tag.js +57 -0
  438. package/dist/formatter.d.ts +19 -0
  439. package/dist/formatter.js +265 -0
  440. package/dist/forms-validation.d.ts +189 -0
  441. package/dist/forms-validation.js +421 -0
  442. package/dist/forms.d.ts +224 -0
  443. package/dist/forms.js +729 -0
  444. package/dist/fragment-container.d.ts +57 -0
  445. package/dist/fragment-container.js +123 -0
  446. package/dist/framework-composables.d.ts +73 -0
  447. package/dist/framework-composables.js +126 -0
  448. package/dist/head-injection.d.ts +61 -0
  449. package/dist/head-injection.js +28 -0
  450. package/dist/head.d.ts +282 -0
  451. package/dist/head.js +231 -0
  452. package/dist/heatmap.d.ts +206 -0
  453. package/dist/heatmap.js +566 -0
  454. package/dist/hot-reload.d.ts +87 -0
  455. package/dist/hot-reload.js +373 -0
  456. package/dist/html-masking.d.ts +125 -0
  457. package/dist/html-masking.js +196 -0
  458. package/dist/hydration-runtime.d.ts +44 -0
  459. package/dist/hydration-runtime.js +195 -0
  460. package/dist/hydration.d.ts +135 -0
  461. package/dist/hydration.js +654 -0
  462. package/dist/i18n.d.ts +342 -0
  463. package/dist/i18n.js +678 -0
  464. package/dist/image-optimization/auto-sibling.d.ts +42 -0
  465. package/dist/image-optimization/auto-sibling.js +88 -0
  466. package/dist/image-optimization/build-plugin.d.ts +54 -0
  467. package/dist/image-optimization/build-plugin.js +241 -0
  468. package/dist/image-optimization/component.d.ts +46 -0
  469. package/dist/image-optimization/component.js +244 -0
  470. package/dist/image-optimization/directive.d.ts +30 -0
  471. package/dist/image-optimization/directive.js +203 -0
  472. package/dist/image-optimization/index.d.ts +156 -0
  473. package/dist/image-optimization/index.js +54 -0
  474. package/dist/image-optimization/processor.d.ts +140 -0
  475. package/dist/image-optimization/processor.js +262 -0
  476. package/dist/image-optimization/serve.d.ts +54 -0
  477. package/dist/image-optimization/serve.js +102 -0
  478. package/dist/import-rebase.d.ts +16 -0
  479. package/dist/import-rebase.js +16 -0
  480. package/dist/imported-signals.d.ts +43 -0
  481. package/dist/imported-signals.js +35 -0
  482. package/dist/includes.d.ts +171 -0
  483. package/dist/includes.js +764 -0
  484. package/dist/index.d.ts +365 -0
  485. package/dist/index.js +202 -0
  486. package/dist/init.d.ts +39 -0
  487. package/dist/init.js +505 -0
  488. package/dist/inline-assets.d.ts +28 -0
  489. package/dist/inline-assets.js +82 -0
  490. package/dist/interactive.d.ts +14 -0
  491. package/dist/interactive.js +383 -0
  492. package/dist/internal-markdown.d.ts +22 -0
  493. package/dist/internal-markdown.js +141 -0
  494. package/dist/island-chunking.d.ts +48 -0
  495. package/dist/island-chunking.js +52 -0
  496. package/dist/isolated-build.d.ts +12 -0
  497. package/dist/isolated-build.js +18 -0
  498. package/dist/js-ts.d.ts +10 -0
  499. package/dist/js-ts.js +60 -0
  500. package/dist/jsx-runtime.d.ts +92 -0
  501. package/dist/jsx-runtime.js +289 -0
  502. package/dist/keep-alive.d.ts +108 -0
  503. package/dist/keep-alive.js +421 -0
  504. package/dist/layout-types.d.ts +45 -0
  505. package/dist/layout-types.js +56 -0
  506. package/dist/lazy-loader.d.ts +90 -0
  507. package/dist/lazy-loader.js +245 -0
  508. package/dist/lazy-module.d.ts +11 -0
  509. package/dist/lazy-module.js +18 -0
  510. package/dist/loading-indicator.d.ts +50 -0
  511. package/dist/loading-indicator.js +322 -0
  512. package/dist/loops.d.ts +91 -0
  513. package/dist/loops.js +690 -0
  514. package/dist/manifest.d.ts +41 -0
  515. package/dist/manifest.js +31 -0
  516. package/dist/markdown-view.d.ts +25 -0
  517. package/dist/markdown-view.js +39 -0
  518. package/dist/markdown.d.ts +10 -0
  519. package/dist/markdown.js +68 -0
  520. package/dist/media/client/blur-up.d.ts +66 -0
  521. package/dist/media/client/blur-up.js +217 -0
  522. package/dist/media/client/index.d.ts +93 -0
  523. package/dist/media/client/index.js +53 -0
  524. package/dist/media/client/lazy-load.d.ts +74 -0
  525. package/dist/media/client/lazy-load.js +283 -0
  526. package/dist/media/client/upload-handler.d.ts +80 -0
  527. package/dist/media/client/upload-handler.js +354 -0
  528. package/dist/media/image/component.d.ts +60 -0
  529. package/dist/media/image/component.js +574 -0
  530. package/dist/media/image/directive.d.ts +23 -0
  531. package/dist/media/image/directive.js +160 -0
  532. package/dist/media/image/editing.d.ts +212 -0
  533. package/dist/media/image/editing.js +193 -0
  534. package/dist/media/image/index.d.ts +142 -0
  535. package/dist/media/image/index.js +80 -0
  536. package/dist/media/image/placeholder.d.ts +89 -0
  537. package/dist/media/image/placeholder.js +188 -0
  538. package/dist/media/image/processor/cache.d.ts +53 -0
  539. package/dist/media/image/processor/cache.js +51 -0
  540. package/dist/media/image/processor/index.d.ts +11 -0
  541. package/dist/media/image/processor/index.js +3 -0
  542. package/dist/media/image/processor/optimizer.d.ts +24 -0
  543. package/dist/media/image/processor/optimizer.js +202 -0
  544. package/dist/media/image/processor/responsive.d.ts +28 -0
  545. package/dist/media/image/processor/responsive.js +162 -0
  546. package/dist/media/image/srcset.d.ts +157 -0
  547. package/dist/media/image/srcset.js +194 -0
  548. package/dist/media/index.d.ts +331 -0
  549. package/dist/media/index.js +198 -0
  550. package/dist/media/manager/embed.d.ts +25 -0
  551. package/dist/media/manager/embed.js +253 -0
  552. package/dist/media/protected/component.d.ts +33 -0
  553. package/dist/media/protected/component.js +235 -0
  554. package/dist/media/protected/index.d.ts +47 -0
  555. package/dist/media/protected/index.js +20 -0
  556. package/dist/media/protected/signature.d.ts +72 -0
  557. package/dist/media/protected/signature.js +205 -0
  558. package/dist/media/shared/cache.d.ts +76 -0
  559. package/dist/media/shared/cache.js +132 -0
  560. package/dist/media/shared/hash.d.ts +31 -0
  561. package/dist/media/shared/hash.js +35 -0
  562. package/dist/media/shared/index.d.ts +7 -0
  563. package/dist/media/shared/index.js +2 -0
  564. package/dist/media/types.d.ts +1477 -0
  565. package/dist/media/types.js +0 -0
  566. package/dist/media/upload/component.d.ts +9 -0
  567. package/dist/media/upload/component.js +320 -0
  568. package/dist/media/upload/index.d.ts +8 -0
  569. package/dist/media/upload/index.js +1 -0
  570. package/dist/media/video/directive.d.ts +23 -0
  571. package/dist/media/video/directive.js +142 -0
  572. package/dist/media/video/index.d.ts +76 -0
  573. package/dist/media/video/index.js +583 -0
  574. package/dist/media/video/processor/cache.d.ts +55 -0
  575. package/dist/media/video/processor/cache.js +52 -0
  576. package/dist/media/video/processor/index.d.ts +12 -0
  577. package/dist/media/video/processor/index.js +4 -0
  578. package/dist/media/video/processor/streaming.d.ts +26 -0
  579. package/dist/media/video/processor/streaming.js +197 -0
  580. package/dist/media/video/processor/thumbnail.d.ts +35 -0
  581. package/dist/media/video/processor/thumbnail.js +134 -0
  582. package/dist/media/video/processor/transcoder.d.ts +19 -0
  583. package/dist/media/video/processor/transcoder.js +283 -0
  584. package/dist/menubar.d.ts +65 -0
  585. package/dist/menubar.js +99 -0
  586. package/dist/method-spoofing.d.ts +20 -0
  587. package/dist/method-spoofing.js +17 -0
  588. package/dist/middleware.d.ts +112 -0
  589. package/dist/middleware.js +40 -0
  590. package/dist/misc-directives.d.ts +55 -0
  591. package/dist/misc-directives.js +328 -0
  592. package/dist/native-build.d.ts +88 -0
  593. package/dist/native-build.js +575 -0
  594. package/dist/owned-routes.d.ts +42 -0
  595. package/dist/owned-routes.js +26 -0
  596. package/dist/page-action.d.ts +73 -0
  597. package/dist/page-action.js +91 -0
  598. package/dist/page-meta.d.ts +38 -0
  599. package/dist/page-meta.js +16 -0
  600. package/dist/page-response.d.ts +120 -0
  601. package/dist/page-response.js +117 -0
  602. package/dist/parser/directive-parser.d.ts +119 -0
  603. package/dist/parser/directive-parser.js +249 -0
  604. package/dist/parser/expression-parser.d.ts +58 -0
  605. package/dist/parser/expression-parser.js +358 -0
  606. package/dist/parser/index.d.ts +13 -0
  607. package/dist/parser/index.js +23 -0
  608. package/dist/parser/tokenizer.d.ts +77 -0
  609. package/dist/parser/tokenizer.js +534 -0
  610. package/dist/partial-hydration.d.ts +123 -0
  611. package/dist/partial-hydration.js +427 -0
  612. package/dist/performance-utils.d.ts +318 -0
  613. package/dist/performance-utils.js +466 -0
  614. package/dist/placeholder.d.ts +54 -0
  615. package/dist/placeholder.js +35 -0
  616. package/dist/plugin-system.d.ts +301 -0
  617. package/dist/plugin-system.js +214 -0
  618. package/dist/plugin.d.ts +3 -0
  619. package/dist/plugin.js +174 -0
  620. package/dist/precompiler.d.ts +43 -0
  621. package/dist/precompiler.js +670 -0
  622. package/dist/process.d.ts +16 -0
  623. package/dist/process.js +879 -0
  624. package/dist/production-build.d.ts +163 -0
  625. package/dist/production-build.js +596 -0
  626. package/dist/production-builder.d.ts +42 -0
  627. package/dist/production-builder.js +146 -0
  628. package/dist/production-server.d.ts +19 -0
  629. package/dist/production-server.js +208 -0
  630. package/dist/prop-sentinels.d.ts +31 -0
  631. package/dist/prop-sentinels.js +7 -0
  632. package/dist/props.d.ts +216 -0
  633. package/dist/props.js +224 -0
  634. package/dist/public-env.d.ts +29 -0
  635. package/dist/public-env.js +19 -0
  636. package/dist/pwa/audit.d.ts +42 -0
  637. package/dist/pwa/audit.js +255 -0
  638. package/dist/pwa/directives.d.ts +38 -0
  639. package/dist/pwa/directives.js +332 -0
  640. package/dist/pwa/icons.d.ts +42 -0
  641. package/dist/pwa/icons.js +109 -0
  642. package/dist/pwa/index.d.ts +104 -0
  643. package/dist/pwa/index.js +47 -0
  644. package/dist/pwa/inject.d.ts +32 -0
  645. package/dist/pwa/inject.js +102 -0
  646. package/dist/pwa/manifest.d.ts +104 -0
  647. package/dist/pwa/manifest.js +186 -0
  648. package/dist/pwa/offline.d.ts +8 -0
  649. package/dist/pwa/offline.js +259 -0
  650. package/dist/pwa/precache.d.ts +35 -0
  651. package/dist/pwa/precache.js +116 -0
  652. package/dist/pwa/service-worker.d.ts +33 -0
  653. package/dist/pwa/service-worker.js +860 -0
  654. package/dist/pwa/workbox-strategies.d.ts +100 -0
  655. package/dist/pwa/workbox-strategies.js +167 -0
  656. package/dist/pwa/workbox.d.ts +51 -0
  657. package/dist/pwa/workbox.js +382 -0
  658. package/dist/pwa.d.ts +52 -0
  659. package/dist/pwa.js +236 -0
  660. package/dist/reactive-bindings.d.ts +47 -0
  661. package/dist/reactive-bindings.js +268 -0
  662. package/dist/reactive-tracking.d.ts +81 -0
  663. package/dist/reactive-tracking.js +49 -0
  664. package/dist/reactive.d.ts +117 -0
  665. package/dist/reactive.js +593 -0
  666. package/dist/reactivity.d.ts +206 -0
  667. package/dist/reactivity.js +574 -0
  668. package/dist/release.d.ts +1 -0
  669. package/dist/release.js +1 -0
  670. package/dist/render-memo.d.ts +40 -0
  671. package/dist/render-memo.js +33 -0
  672. package/dist/render.d.ts +54 -0
  673. package/dist/render.js +153 -0
  674. package/dist/resolve-stx-targets.d.ts +49 -0
  675. package/dist/resolve-stx-targets.js +38 -0
  676. package/dist/route-middleware.d.ts +2 -0
  677. package/dist/route-middleware.js +17 -0
  678. package/dist/route-types.d.ts +134 -0
  679. package/dist/route-types.js +24 -0
  680. package/dist/router.d.ts +9 -0
  681. package/dist/router.js +9 -0
  682. package/dist/routes.d.ts +6 -0
  683. package/dist/routes.js +14 -0
  684. package/dist/runtime-globals.d.ts +236 -0
  685. package/dist/runtime-globals.js +230 -0
  686. package/dist/runtime-injection.d.ts +113 -0
  687. package/dist/runtime-injection.js +156 -0
  688. package/dist/runtime.d.ts +140 -0
  689. package/dist/runtime.js +94 -0
  690. package/dist/safe-evaluator.d.ts +165 -0
  691. package/dist/safe-evaluator.js +461 -0
  692. package/dist/scaffolding.d.ts +113 -0
  693. package/dist/scaffolding.js +897 -0
  694. package/dist/screenshot.d.ts +22 -0
  695. package/dist/screenshot.js +100 -0
  696. package/dist/script-classifier.d.ts +41 -0
  697. package/dist/script-classifier.js +51 -0
  698. package/dist/script-emit.d.ts +50 -0
  699. package/dist/script-emit.js +11 -0
  700. package/dist/script-json.d.ts +36 -0
  701. package/dist/script-json.js +6 -0
  702. package/dist/script-validation.d.ts +26 -0
  703. package/dist/script-validation.js +179 -0
  704. package/dist/seo.d.ts +225 -0
  705. package/dist/seo.js +486 -0
  706. package/dist/serve.d.ts +44 -0
  707. package/dist/serve.js +233 -0
  708. package/dist/server-bindings.d.ts +39 -0
  709. package/dist/server-bindings.js +171 -0
  710. package/dist/server-components.d.ts +138 -0
  711. package/dist/server-components.js +427 -0
  712. package/dist/sfc-template.d.ts +17 -0
  713. package/dist/sfc-template.js +32 -0
  714. package/dist/signal-processing.d.ts +222 -0
  715. package/dist/signal-processing.js +1081 -0
  716. package/dist/signals-api.d.ts +459 -0
  717. package/dist/signals-api.js +172 -0
  718. package/dist/signals.d.ts +41 -0
  719. package/dist/signals.js +8233 -0
  720. package/dist/site-builder/build.d.ts +18 -0
  721. package/dist/site-builder/build.js +252 -0
  722. package/dist/site-builder/i18n.d.ts +104 -0
  723. package/dist/site-builder/i18n.js +150 -0
  724. package/dist/site-builder/index.d.ts +27 -0
  725. package/dist/site-builder/index.js +16 -0
  726. package/dist/site-builder/robots.d.ts +2 -0
  727. package/dist/site-builder/robots.js +26 -0
  728. package/dist/site-builder/router.d.ts +10 -0
  729. package/dist/site-builder/router.js +27 -0
  730. package/dist/site-builder/seo.d.ts +8 -0
  731. package/dist/site-builder/seo.js +67 -0
  732. package/dist/site-builder/sitemap.d.ts +10 -0
  733. package/dist/site-builder/sitemap.js +26 -0
  734. package/dist/site-builder/theme.d.ts +12 -0
  735. package/dist/site-builder/theme.js +38 -0
  736. package/dist/site-builder/types.d.ts +74 -0
  737. package/dist/site-builder/types.js +0 -0
  738. package/dist/site-url.d.ts +46 -0
  739. package/dist/site-url.js +70 -0
  740. package/dist/slots.d.ts +129 -0
  741. package/dist/slots.js +286 -0
  742. package/dist/source-maps.d.ts +98 -0
  743. package/dist/source-maps.js +350 -0
  744. package/dist/source-signature.d.ts +45 -0
  745. package/dist/source-signature.js +20 -0
  746. package/dist/spa-nav.d.ts +49 -0
  747. package/dist/spa-nav.js +12 -0
  748. package/dist/spa-shell.d.ts +21 -0
  749. package/dist/spa-shell.js +34 -0
  750. package/dist/ssg.d.ts +357 -0
  751. package/dist/ssg.js +94 -0
  752. package/dist/ssr.d.ts +116 -0
  753. package/dist/ssr.js +339 -0
  754. package/dist/state-dir.d.ts +36 -0
  755. package/dist/state-dir.js +22 -0
  756. package/dist/state-management.d.ts +299 -0
  757. package/dist/state-management.js +519 -0
  758. package/dist/store-imports.d.ts +47 -0
  759. package/dist/store-imports.js +16 -0
  760. package/dist/store-loader.d.ts +15 -0
  761. package/dist/store-loader.js +111 -0
  762. package/dist/stores-client.d.ts +70 -0
  763. package/dist/stores-client.js +132 -0
  764. package/dist/story/addons.d.ts +123 -0
  765. package/dist/story/addons.js +261 -0
  766. package/dist/story/analytics.d.ts +163 -0
  767. package/dist/story/analytics.js +235 -0
  768. package/dist/story/auto-stories.d.ts +38 -0
  769. package/dist/story/auto-stories.js +158 -0
  770. package/dist/story/bookmarks.d.ts +102 -0
  771. package/dist/story/bookmarks.js +277 -0
  772. package/dist/story/bun-test.d.ts +45 -0
  773. package/dist/story/bun-test.js +102 -0
  774. package/dist/story/cli.d.ts +132 -0
  775. package/dist/story/cli.js +155 -0
  776. package/dist/story/collect/analyzer.d.ts +33 -0
  777. package/dist/story/collect/analyzer.js +305 -0
  778. package/dist/story/collect/index.d.ts +31 -0
  779. package/dist/story/collect/index.js +27 -0
  780. package/dist/story/collect/parser.d.ts +17 -0
  781. package/dist/story/collect/parser.js +129 -0
  782. package/dist/story/collect/scanner.d.ts +17 -0
  783. package/dist/story/collect/scanner.js +101 -0
  784. package/dist/story/collect/tree.d.ts +24 -0
  785. package/dist/story/collect/tree.js +110 -0
  786. package/dist/story/commands/build.d.ts +19 -0
  787. package/dist/story/commands/build.js +172 -0
  788. package/dist/story/commands/dev.d.ts +23 -0
  789. package/dist/story/commands/dev.js +78 -0
  790. package/dist/story/commands/index.d.ts +9 -0
  791. package/dist/story/commands/index.js +3 -0
  792. package/dist/story/commands/preview.d.ts +21 -0
  793. package/dist/story/commands/preview.js +56 -0
  794. package/dist/story/compiled-output.d.ts +27 -0
  795. package/dist/story/compiled-output.js +151 -0
  796. package/dist/story/composition.d.ts +47 -0
  797. package/dist/story/composition.js +261 -0
  798. package/dist/story/config-watcher.d.ts +33 -0
  799. package/dist/story/config-watcher.js +67 -0
  800. package/dist/story/config.d.ts +29 -0
  801. package/dist/story/config.js +64 -0
  802. package/dist/story/context.d.ts +27 -0
  803. package/dist/story/context.js +27 -0
  804. package/dist/story/controls/index.d.ts +54 -0
  805. package/dist/story/controls/index.js +320 -0
  806. package/dist/story/desktop-preview.d.ts +34 -0
  807. package/dist/story/desktop-preview.js +105 -0
  808. package/dist/story/docs-generator.d.ts +30 -0
  809. package/dist/story/docs-generator.js +187 -0
  810. package/dist/story/errors.d.ts +47 -0
  811. package/dist/story/errors.js +239 -0
  812. package/dist/story/figma-export.d.ts +169 -0
  813. package/dist/story/figma-export.js +224 -0
  814. package/dist/story/generator.d.ts +21 -0
  815. package/dist/story/generator.js +165 -0
  816. package/dist/story/hmr.d.ts +62 -0
  817. package/dist/story/hmr.js +131 -0
  818. package/dist/story/hot-swap.d.ts +46 -0
  819. package/dist/story/hot-swap.js +207 -0
  820. package/dist/story/index.d.ts +99 -0
  821. package/dist/story/index.js +49 -0
  822. package/dist/story/interactions.d.ts +53 -0
  823. package/dist/story/interactions.js +225 -0
  824. package/dist/story/keyboard-shortcuts.d.ts +39 -0
  825. package/dist/story/keyboard-shortcuts.js +345 -0
  826. package/dist/story/output.d.ts +115 -0
  827. package/dist/story/output.js +153 -0
  828. package/dist/story/performance.d.ts +129 -0
  829. package/dist/story/performance.js +252 -0
  830. package/dist/story/presets.d.ts +123 -0
  831. package/dist/story/presets.js +289 -0
  832. package/dist/story/props-validation.d.ts +45 -0
  833. package/dist/story/props-validation.js +215 -0
  834. package/dist/story/renderer.d.ts +69 -0
  835. package/dist/story/renderer.js +209 -0
  836. package/dist/story/search-index.d.ts +47 -0
  837. package/dist/story/search-index.js +106 -0
  838. package/dist/story/search.d.ts +56 -0
  839. package/dist/story/search.js +140 -0
  840. package/dist/story/server.d.ts +31 -0
  841. package/dist/story/server.js +965 -0
  842. package/dist/story/setup.d.ts +56 -0
  843. package/dist/story/setup.js +78 -0
  844. package/dist/story/snapshots.d.ts +65 -0
  845. package/dist/story/snapshots.js +171 -0
  846. package/dist/story/testing.d.ts +83 -0
  847. package/dist/story/testing.js +164 -0
  848. package/dist/story/theme.d.ts +68 -0
  849. package/dist/story/theme.js +170 -0
  850. package/dist/story/ts-css.d.ts +29 -0
  851. package/dist/story/ts-css.js +189 -0
  852. package/dist/story/types.d.ts +342 -0
  853. package/dist/story/types.js +0 -0
  854. package/dist/story/ui/code-panel.d.ts +43 -0
  855. package/dist/story/ui/code-panel.js +175 -0
  856. package/dist/story/ui/controls-panel.d.ts +25 -0
  857. package/dist/story/ui/controls-panel.js +168 -0
  858. package/dist/story/ui/index.d.ts +8 -0
  859. package/dist/story/ui/index.js +4 -0
  860. package/dist/story/ui/navigation.d.ts +55 -0
  861. package/dist/story/ui/navigation.js +250 -0
  862. package/dist/story/ui/preview.d.ts +46 -0
  863. package/dist/story/ui/preview.js +251 -0
  864. package/dist/story/visual-testing.d.ts +45 -0
  865. package/dist/story/visual-testing.js +248 -0
  866. package/dist/streaming.d.ts +238 -0
  867. package/dist/streaming.js +537 -0
  868. package/dist/strict-lint.d.ts +52 -0
  869. package/dist/strict-lint.js +269 -0
  870. package/dist/strip-literals.d.ts +40 -0
  871. package/dist/strip-literals.js +149 -0
  872. package/dist/stx-virtual-ts.d.ts +358 -0
  873. package/dist/stx-virtual-ts.js +670 -0
  874. package/dist/stx.d.ts +924 -0
  875. package/dist/style-scoping.d.ts +42 -0
  876. package/dist/style-scoping.js +82 -0
  877. package/dist/suspense.d.ts +98 -0
  878. package/dist/suspense.js +398 -0
  879. package/dist/teleport.d.ts +31 -0
  880. package/dist/teleport.js +109 -0
  881. package/dist/template-compiler.d.ts +33 -0
  882. package/dist/template-compiler.js +68 -0
  883. package/dist/template-hydrator.d.ts +28 -0
  884. package/dist/template-hydrator.js +95 -0
  885. package/dist/template-tag-balance.d.ts +32 -0
  886. package/dist/template-tag-balance.js +93 -0
  887. package/dist/testing.d.ts +330 -0
  888. package/dist/testing.js +588 -0
  889. package/dist/theme-tokens.d.ts +88 -0
  890. package/dist/theme-tokens.js +71 -0
  891. package/dist/transitions.d.ts +99 -0
  892. package/dist/transitions.js +443 -0
  893. package/dist/ts-css-config.d.ts +71 -0
  894. package/dist/ts-css-config.js +44 -0
  895. package/dist/type-checker.d.ts +85 -0
  896. package/dist/type-checker.js +581 -0
  897. package/dist/typecheck.d.ts +70 -0
  898. package/dist/typecheck.js +365 -0
  899. package/dist/types/component-types.d.ts +248 -0
  900. package/dist/types/component-types.js +0 -0
  901. package/dist/types/config-types.d.ts +938 -0
  902. package/dist/types/config-types.js +0 -0
  903. package/dist/types/context-types.d.ts +122 -0
  904. package/dist/types/context-types.js +0 -0
  905. package/dist/types/csp-types.d.ts +83 -0
  906. package/dist/types/csp-types.js +0 -0
  907. package/dist/types/directive-types.d.ts +315 -0
  908. package/dist/types/directive-types.js +3 -0
  909. package/dist/types/index.d.ts +20 -0
  910. package/dist/types/index.js +1 -0
  911. package/dist/types/pwa-types.d.ts +338 -0
  912. package/dist/types/pwa-types.js +0 -0
  913. package/dist/types.d.ts +27 -0
  914. package/dist/types.js +1 -0
  915. package/dist/typescript-templates.d.ts +156 -0
  916. package/dist/typescript-templates.js +386 -0
  917. package/dist/unresolved-identifiers.d.ts +52 -0
  918. package/dist/unresolved-identifiers.js +148 -0
  919. package/dist/utils.d.ts +112 -0
  920. package/dist/utils.js +1170 -0
  921. package/dist/validator.d.ts +80 -0
  922. package/dist/validator.js +171 -0
  923. package/dist/variable-extractor.d.ts +142 -0
  924. package/dist/variable-extractor.js +1306 -0
  925. package/dist/view-composers.d.ts +171 -0
  926. package/dist/view-composers.js +29 -0
  927. package/dist/virtual-scrolling.d.ts +127 -0
  928. package/dist/virtual-scrolling.js +454 -0
  929. package/dist/visual-editor.d.ts +185 -0
  930. package/dist/visual-editor.js +735 -0
  931. package/dist/visual-testing.d.ts +135 -0
  932. package/dist/visual-testing.js +126 -0
  933. package/dist/vue-template.d.ts +39 -0
  934. package/dist/vue-template.js +476 -0
  935. package/dist/web-components/css-scoping.d.ts +64 -0
  936. package/dist/web-components/css-scoping.js +210 -0
  937. package/dist/web-components/index.d.ts +29 -0
  938. package/dist/web-components/index.js +13 -0
  939. package/dist/web-components/reactive-generator.d.ts +72 -0
  940. package/dist/web-components/reactive-generator.js +484 -0
  941. package/dist/web-components.d.ts +253 -0
  942. package/dist/web-components.js +1466 -0
  943. package/dist/x-element.d.ts +42 -0
  944. package/dist/x-element.js +301 -0
  945. package/package.json +107 -0
  946. package/stx.d.ts +924 -0
@@ -0,0 +1,3022 @@
1
+ // @bun
2
+ import{tk as m}from"./chunk-9wr7zcad.js";import{gv as z}from"./chunk-qc1f74ek.js";import{existsSync as s,mkdirSync as T,copyFileSync as F,chmodSync as A}from"fs";import{join as Z,basename as Yq}from"path";import{spawn as j,execSync as Zq}from"child_process";import{tmpdir as c,homedir as P,platform as Lq}from"os";var Iq=`
3
+ <script>
4
+ (function() {
5
+ 'use strict';
6
+
7
+ // Skip if already initialized or not in Craft environment
8
+ if (window.__craftBridgeInitialized) return;
9
+ window.__craftBridgeInitialized = true;
10
+
11
+ // Message ID counter
12
+ let messageId = 0;
13
+ const generateId = () => 'msg_' + Date.now() + '_' + (++messageId);
14
+
15
+ // Pending requests
16
+ const pending = new Map();
17
+
18
+ // Event listeners
19
+ const eventListeners = new Map();
20
+
21
+ // Configuration
22
+ const config = {
23
+ debug: false,
24
+ timeout: 30000
25
+ };
26
+
27
+ // Send message to native
28
+ function send(message) {
29
+ const json = JSON.stringify(message);
30
+
31
+ if (config.debug) {
32
+ console.log('[Craft Bridge] Sending:', message.method, message.params);
33
+ }
34
+
35
+ // iOS WKWebView
36
+ if (window.webkit?.messageHandlers?.craft) {
37
+ window.webkit.messageHandlers.craft.postMessage(message);
38
+ return true;
39
+ }
40
+
41
+ // Android WebView
42
+ if (window.CraftBridge) {
43
+ window.CraftBridge.postMessage(json);
44
+ return true;
45
+ }
46
+
47
+ // Electron IPC
48
+ if (window.craftIPC) {
49
+ window.craftIPC.send('bridge-message', message);
50
+ return true;
51
+ }
52
+
53
+ return false;
54
+ }
55
+
56
+ // Make a request and wait for response
57
+ function request(method, params) {
58
+ return new Promise((resolve, reject) => {
59
+ const id = generateId();
60
+ const timeout = setTimeout(() => {
61
+ pending.delete(id);
62
+ reject(new Error('Request timeout: ' + method));
63
+ }, config.timeout);
64
+
65
+ pending.set(id, { resolve, reject, timeout });
66
+
67
+ const sent = send({
68
+ id,
69
+ type: 'request',
70
+ method,
71
+ params
72
+ });
73
+
74
+ if (!sent) {
75
+ clearTimeout(timeout);
76
+ pending.delete(id);
77
+ // Return gracefully if not in Craft environment
78
+ resolve(undefined);
79
+ }
80
+ });
81
+ }
82
+
83
+ // Handle incoming messages
84
+ function handleMessage(event) {
85
+ let data;
86
+ try {
87
+ data = event.detail || (typeof event.data === 'string' ? JSON.parse(event.data) : event.data);
88
+ }
89
+ catch (e) {
90
+ return;
91
+ }
92
+
93
+ if (!data || !data.id) return;
94
+
95
+ if (config.debug) {
96
+ console.log('[Craft Bridge] Received:', data);
97
+ }
98
+
99
+ if (data.type === 'response') {
100
+ const req = pending.get(data.id);
101
+ if (req) {
102
+ clearTimeout(req.timeout);
103
+ pending.delete(data.id);
104
+ if (data.error) {
105
+ req.reject(new Error(data.error.message));
106
+ }
107
+ else {
108
+ req.resolve(data.result);
109
+ }
110
+ }
111
+ }
112
+ else if (data.type === 'event' && data.method) {
113
+ const listeners = eventListeners.get(data.method) || [];
114
+ listeners.forEach(fn => fn(data.params));
115
+ }
116
+ }
117
+
118
+ // Listen for messages
119
+ window.addEventListener('message', handleMessage);
120
+ window.addEventListener('craft-bridge-message', handleMessage);
121
+
122
+ // Check if running in Craft
123
+ function isCraft() {
124
+ return !!(
125
+ window.webkit?.messageHandlers?.craft ||
126
+ window.CraftBridge ||
127
+ window.craftIPC
128
+ );
129
+ }
130
+
131
+ // Subscribe to events
132
+ function on(event, callback) {
133
+ if (!eventListeners.has(event)) {
134
+ eventListeners.set(event, []);
135
+ }
136
+ eventListeners.get(event).push(callback);
137
+ return () => {
138
+ const listeners = eventListeners.get(event);
139
+ const idx = listeners.indexOf(callback);
140
+ if (idx > -1) listeners.splice(idx, 1);
141
+ };
142
+ }
143
+
144
+ function sendNativeUI(action, data) {
145
+ if (window.webkit?.messageHandlers?.craft) {
146
+ window.webkit.messageHandlers.craft.postMessage({ t: 'nativeUI', a: action, d: data || {} });
147
+ return true;
148
+ }
149
+
150
+ if (window.CraftBridge?.postMessage) {
151
+ window.CraftBridge.postMessage(JSON.stringify({ t: 'nativeUI', a: action, d: data || {} }));
152
+ return true;
153
+ }
154
+
155
+ return send({
156
+ id: generateId(),
157
+ type: 'nativeUI',
158
+ action,
159
+ data: data || {}
160
+ });
161
+ }
162
+
163
+ // Live component handles, keyed by id, so an event coming back from the host
164
+ // can be routed to the callbacks registered on the right one. Without this
165
+ // the onSelect/onSpaceChange callbacks were stored and never invoked.
166
+ const sidebars = new Map();
167
+ const spacesSidebars = new Map();
168
+
169
+ function createNativeUIFacade() {
170
+ class Sidebar {
171
+ constructor(id) {
172
+ this.id = id;
173
+ this._selectCallbacks = [];
174
+ }
175
+ addSection(section) {
176
+ sendNativeUI('addSidebarSection', { sidebarId: this.id, section });
177
+ return this;
178
+ }
179
+ setSelectedItem(itemId) {
180
+ sendNativeUI('setSelectedItem', { sidebarId: this.id, itemId });
181
+ return this;
182
+ }
183
+ onSelect(callback) {
184
+ this._selectCallbacks.push(callback);
185
+ return this;
186
+ }
187
+ destroy() {
188
+ sidebars.delete(this.id);
189
+ sendNativeUI('destroyComponent', { id: this.id, type: 'sidebar' });
190
+ }
191
+ }
192
+
193
+ /**
194
+ * An Arc-style sidebar of swipeable spaces.
195
+ *
196
+ * Separate from Sidebar rather than an option on it: a source list selects
197
+ * one row out of many, while a spaces sidebar selects one whole SCENE, and
198
+ * a host that renders the switcher natively (a segmented control in the
199
+ * toolbar, a Touch Bar strip) needs the space list, not the item list.
200
+ */
201
+ class SpacesSidebar {
202
+ constructor(id) {
203
+ this.id = id;
204
+ this._spaceCallbacks = [];
205
+ }
206
+ setSpaces(spaces) {
207
+ sendNativeUI('setSidebarSpaces', { sidebarId: this.id, spaces });
208
+ return this;
209
+ }
210
+ setActiveSpace(spaceId) {
211
+ sendNativeUI('setActiveSpace', { sidebarId: this.id, spaceId });
212
+ return this;
213
+ }
214
+ onSpaceChange(callback) {
215
+ this._spaceCallbacks.push(callback);
216
+ return this;
217
+ }
218
+ destroy() {
219
+ spacesSidebars.delete(this.id);
220
+ sendNativeUI('destroyComponent', { id: this.id, type: 'spacesSidebar' });
221
+ }
222
+ }
223
+
224
+ class FileBrowser {
225
+ constructor(id) {
226
+ this.id = id;
227
+ }
228
+ addFile(file) {
229
+ sendNativeUI('addFile', { browserId: this.id, file });
230
+ return this;
231
+ }
232
+ addFiles(files) {
233
+ sendNativeUI('addFiles', { browserId: this.id, files });
234
+ return this;
235
+ }
236
+ clearFiles() {
237
+ sendNativeUI('clearFiles', { browserId: this.id });
238
+ return this;
239
+ }
240
+ destroy() {
241
+ sendNativeUI('destroyComponent', { id: this.id, type: 'fileBrowser' });
242
+ }
243
+ }
244
+
245
+ class SplitView {
246
+ constructor(id, sidebar, browser) {
247
+ this.id = id;
248
+ this.sidebar = sidebar;
249
+ this.browser = browser;
250
+ }
251
+ setDividerPosition(position) {
252
+ sendNativeUI('setDividerPosition', { splitViewId: this.id, position });
253
+ return this;
254
+ }
255
+ destroy() {
256
+ sendNativeUI('destroyComponent', { id: this.id, type: 'splitView' });
257
+ }
258
+ }
259
+
260
+ // Host -> page. The host names the component in the payload; we look up the
261
+ // handle and fan out to whatever the page registered on it.
262
+ on('sidebar.select', function(params) {
263
+ const sidebar = sidebars.get(params && params.sidebarId);
264
+ if (sidebar) sidebar._selectCallbacks.forEach(fn => fn(params.itemId));
265
+ });
266
+ on('sidebar.spaceChange', function(params) {
267
+ const sidebar = spacesSidebars.get(params && params.sidebarId);
268
+ if (sidebar) sidebar._spaceCallbacks.forEach(fn => fn(params.spaceId));
269
+ });
270
+
271
+ return {
272
+ createSidebar(options) {
273
+ const opts = options || {};
274
+ const id = opts.id || 'sidebar-' + Date.now() + '-' + Math.random().toString(36).slice(2);
275
+ sendNativeUI('createSidebar', Object.assign({}, opts, { id }));
276
+ const sidebar = new Sidebar(id);
277
+ sidebars.set(id, sidebar);
278
+ return sidebar;
279
+ },
280
+ createSpacesSidebar(options) {
281
+ const opts = options || {};
282
+ const id = opts.id || 'spaces-' + Date.now() + '-' + Math.random().toString(36).slice(2);
283
+ sendNativeUI('createSpacesSidebar', Object.assign({}, opts, { id }));
284
+ const sidebar = new SpacesSidebar(id);
285
+ spacesSidebars.set(id, sidebar);
286
+ return sidebar;
287
+ },
288
+ createFileBrowser(options) {
289
+ const opts = options || {};
290
+ const id = opts.id || 'browser-' + Date.now() + '-' + Math.random().toString(36).slice(2);
291
+ sendNativeUI('createFileBrowser', Object.assign({}, opts, { id }));
292
+ return new FileBrowser(id);
293
+ },
294
+ createSplitView(options) {
295
+ if (!options?.sidebar || !options?.browser) {
296
+ throw new Error('createSplitView requires sidebar and browser options');
297
+ }
298
+ const id = options.id || 'splitview-' + Date.now() + '-' + Math.random().toString(36).slice(2);
299
+ sendNativeUI('createSplitView', {
300
+ id,
301
+ sidebarId: options.sidebar.id,
302
+ browserId: options.browser.id
303
+ });
304
+ return new SplitView(id, options.sidebar, options.browser);
305
+ },
306
+ showQuickLook(options) {
307
+ sendNativeUI('showQuickLook', options);
308
+ },
309
+ closeQuickLook() {
310
+ sendNativeUI('closeQuickLook', {});
311
+ },
312
+ toggleQuickLook(options) {
313
+ sendNativeUI('toggleQuickLook', options);
314
+ }
315
+ };
316
+ }
317
+
318
+ const existingCraft = window.craft || {};
319
+ const nativeUI = existingCraft.nativeUI || createNativeUIFacade();
320
+ const componentAPI = existingCraft.components || Object.assign({}, nativeUI, {
321
+ updateComponent: (id, props) => request('component.update', { componentId: id, props }),
322
+ destroyComponent: (id) => request('component.destroy', { componentId: id })
323
+ });
324
+
325
+ // Build the craft API object
326
+ window.craft = Object.assign({}, existingCraft, {
327
+ // Meta
328
+ isCraft,
329
+ on,
330
+ config,
331
+
332
+ // Window API
333
+ window: {
334
+ show: () => request('window.show'),
335
+ hide: () => request('window.hide'),
336
+ close: () => request('window.close'),
337
+ minimize: () => request('window.minimize'),
338
+ maximize: () => request('window.maximize'),
339
+ restore: () => request('window.restore'),
340
+ focus: () => request('window.focus'),
341
+ blur: () => request('window.blur'),
342
+ setTitle: (title) => request('window.setTitle', { title }),
343
+ setSize: (width, height) => request('window.setSize', { width, height }),
344
+ setPosition: (x, y) => request('window.setPosition', { x, y }),
345
+ setFullscreen: (fullscreen) => request('window.setFullscreen', { fullscreen }),
346
+ setAlwaysOnTop: (alwaysOnTop) => request('window.setAlwaysOnTop', { alwaysOnTop }),
347
+ getSize: () => request('window.getSize'),
348
+ getPosition: () => request('window.getPosition'),
349
+ isFullscreen: () => request('window.isFullscreen'),
350
+ isMaximized: () => request('window.isMaximized'),
351
+ isMinimized: () => request('window.isMinimized'),
352
+ isVisible: () => request('window.isVisible'),
353
+ center: () => request('window.center'),
354
+ toggleFullscreen: () => request('window.toggleFullscreen'),
355
+ startDrag: () => request('window.startDrag'),
356
+ },
357
+
358
+ // System Tray/Menubar API
359
+ tray: {
360
+ setTitle: (title) => request('tray.setTitle', { title }),
361
+ setTooltip: (tooltip) => request('tray.setTooltip', { tooltip }),
362
+ setIcon: (icon) => request('tray.setIcon', { icon }),
363
+ setMenu: (menu) => request('tray.setMenu', { menu }),
364
+ show: () => request('tray.show'),
365
+ hide: () => request('tray.hide'),
366
+ onClick: (callback) => on('tray.click', callback),
367
+ onDoubleClick: (callback) => on('tray.doubleClick', callback),
368
+ onRightClick: (callback) => on('tray.rightClick', callback),
369
+ },
370
+
371
+ // App API
372
+ app: {
373
+ quit: () => request('app.quit'),
374
+ hide: () => request('app.hide'),
375
+ show: () => request('app.show'),
376
+ focus: () => request('app.focus'),
377
+ getInfo: () => request('app.getInfo'),
378
+ getVersion: () => request('app.getVersion'),
379
+ getName: () => request('app.getName'),
380
+ getPath: (name) => request('app.getPath', { name }),
381
+ isDarkMode: () => request('app.isDarkMode'),
382
+ getLocale: () => request('app.getLocale'),
383
+ setBadge: (badge) => request('app.setBadge', { badge }),
384
+ hideDockIcon: () => request('app.hideDockIcon'),
385
+ showDockIcon: () => request('app.showDockIcon'),
386
+ notify: (options) => request('app.notify', options),
387
+ registerShortcut: (accelerator, callback) => {
388
+ const id = generateId();
389
+ on('shortcut.' + id, callback);
390
+ return request('app.registerShortcut', { accelerator, id });
391
+ },
392
+ unregisterShortcut: (accelerator) => request('app.unregisterShortcut', { accelerator }),
393
+ },
394
+
395
+ // Dialog API
396
+ dialog: {
397
+ openFile: (options) => request('dialog.openFile', options),
398
+ openFolder: (options) => request('dialog.openFolder', options),
399
+ saveFile: (options) => request('dialog.saveFile', options),
400
+ showAlert: (options) => request('dialog.showAlert', options),
401
+ showConfirm: (options) => request('dialog.showConfirm', options),
402
+ showPrompt: (options) => request('dialog.showPrompt', options),
403
+ showColorPicker: (options) => request('dialog.showColorPicker', options),
404
+ },
405
+
406
+ // Clipboard API
407
+ clipboard: {
408
+ writeText: (text) => request('clipboard.writeText', { text }),
409
+ readText: () => request('clipboard.readText'),
410
+ writeHTML: (html) => request('clipboard.writeHTML', { html }),
411
+ readHTML: () => request('clipboard.readHTML'),
412
+ clear: () => request('clipboard.clear'),
413
+ },
414
+
415
+ // File System API (limited for security)
416
+ fs: {
417
+ readFile: (path, encoding) => request('fs.readFile', { path, encoding }),
418
+ writeFile: (path, content, encoding) => request('fs.writeFile', { path, content, encoding }),
419
+ exists: (path) => request('fs.exists', { path }),
420
+ stat: (path) => request('fs.stat', { path }),
421
+ readDir: (path) => request('fs.readDir', { path }),
422
+ createDir: (path, recursive) => request('fs.createDir', { path, recursive }),
423
+ remove: (path, recursive) => request('fs.remove', { path, recursive }),
424
+ },
425
+
426
+ // Process/Shell API (limited for security)
427
+ process: {
428
+ exec: (command, options) => request('process.exec', { command, ...options }),
429
+ spawn: (command, args, options) => request('process.spawn', { command, args, ...options }),
430
+ env: () => request('process.env'),
431
+ cwd: () => request('process.cwd'),
432
+ platform: () => request('process.platform'),
433
+ },
434
+
435
+ // Gesture stream
436
+ //
437
+ // A webview's wheel events carry no phase information, so a page can only
438
+ // guess where a trackpad swipe begins and ends \u2014 typically with an idle
439
+ // timeout, which mistimes the release and cannot see momentum at all. The
440
+ // host holds the real NSEvent, so it forwards the phases instead:
441
+ //
442
+ // { axis: 'horizontal' | 'vertical',
443
+ // phase: 'begin' | 'change' | 'end',
444
+ // deltaX, deltaY, // points since the last event
445
+ // velocityX, velocityY, // points per second, at 'end'
446
+ // momentum: boolean } // the OS is coasting, not the finger
447
+ //
448
+ // Consumers must stay correct when nothing ever arrives: a host without
449
+ // gesture support simply never emits, so keep the wheel path bound and let
450
+ // a begin phase take over from it.
451
+ gestures: {
452
+ onSwipe: (callback) => on('gesture.swipe', callback),
453
+ },
454
+
455
+ // Native component helpers
456
+ nativeUI,
457
+ components: componentAPI
458
+ });
459
+
460
+ // Dispatch ready event
461
+ window.dispatchEvent(new CustomEvent('craft:ready', { detail: { isCraft: isCraft() } }));
462
+
463
+ if (config.debug) {
464
+ console.log('[Craft Bridge] Initialized, isCraft:', isCraft());
465
+ }
466
+ })();
467
+ </script>
468
+ `;function D(q={}){let{debug:U=!1,timeout:$=30000}=q;return`
469
+ <script>
470
+ (function() {
471
+ 'use strict';
472
+
473
+ // Skip if already initialized or not in Craft environment
474
+ if (window.__craftBridgeInitialized) return;
475
+ window.__craftBridgeInitialized = true;
476
+
477
+ // Message ID counter
478
+ let messageId = 0;
479
+ const generateId = () => 'msg_' + Date.now() + '_' + (++messageId);
480
+
481
+ // Pending requests
482
+ const pending = new Map();
483
+
484
+ // Event listeners
485
+ const eventListeners = new Map();
486
+
487
+ // Configuration
488
+ const config = {
489
+ debug: false,
490
+ timeout: 30000
491
+ };
492
+
493
+ // Send message to native
494
+ function send(message) {
495
+ const json = JSON.stringify(message);
496
+
497
+ if (config.debug) {
498
+ console.log('[Craft Bridge] Sending:', message.method, message.params);
499
+ }
500
+
501
+ // iOS WKWebView
502
+ if (window.webkit?.messageHandlers?.craft) {
503
+ window.webkit.messageHandlers.craft.postMessage(message);
504
+ return true;
505
+ }
506
+
507
+ // Android WebView
508
+ if (window.CraftBridge) {
509
+ window.CraftBridge.postMessage(json);
510
+ return true;
511
+ }
512
+
513
+ // Electron IPC
514
+ if (window.craftIPC) {
515
+ window.craftIPC.send('bridge-message', message);
516
+ return true;
517
+ }
518
+
519
+ return false;
520
+ }
521
+
522
+ // Make a request and wait for response
523
+ function request(method, params) {
524
+ return new Promise((resolve, reject) => {
525
+ const id = generateId();
526
+ const timeout = setTimeout(() => {
527
+ pending.delete(id);
528
+ reject(new Error('Request timeout: ' + method));
529
+ }, config.timeout);
530
+
531
+ pending.set(id, { resolve, reject, timeout });
532
+
533
+ const sent = send({
534
+ id,
535
+ type: 'request',
536
+ method,
537
+ params
538
+ });
539
+
540
+ if (!sent) {
541
+ clearTimeout(timeout);
542
+ pending.delete(id);
543
+ // Return gracefully if not in Craft environment
544
+ resolve(undefined);
545
+ }
546
+ });
547
+ }
548
+
549
+ // Handle incoming messages
550
+ function handleMessage(event) {
551
+ let data;
552
+ try {
553
+ data = event.detail || (typeof event.data === 'string' ? JSON.parse(event.data) : event.data);
554
+ }
555
+ catch (e) {
556
+ return;
557
+ }
558
+
559
+ if (!data || !data.id) return;
560
+
561
+ if (config.debug) {
562
+ console.log('[Craft Bridge] Received:', data);
563
+ }
564
+
565
+ if (data.type === 'response') {
566
+ const req = pending.get(data.id);
567
+ if (req) {
568
+ clearTimeout(req.timeout);
569
+ pending.delete(data.id);
570
+ if (data.error) {
571
+ req.reject(new Error(data.error.message));
572
+ }
573
+ else {
574
+ req.resolve(data.result);
575
+ }
576
+ }
577
+ }
578
+ else if (data.type === 'event' && data.method) {
579
+ const listeners = eventListeners.get(data.method) || [];
580
+ listeners.forEach(fn => fn(data.params));
581
+ }
582
+ }
583
+
584
+ // Listen for messages
585
+ window.addEventListener('message', handleMessage);
586
+ window.addEventListener('craft-bridge-message', handleMessage);
587
+
588
+ // Check if running in Craft
589
+ function isCraft() {
590
+ return !!(
591
+ window.webkit?.messageHandlers?.craft ||
592
+ window.CraftBridge ||
593
+ window.craftIPC
594
+ );
595
+ }
596
+
597
+ // Subscribe to events
598
+ function on(event, callback) {
599
+ if (!eventListeners.has(event)) {
600
+ eventListeners.set(event, []);
601
+ }
602
+ eventListeners.get(event).push(callback);
603
+ return () => {
604
+ const listeners = eventListeners.get(event);
605
+ const idx = listeners.indexOf(callback);
606
+ if (idx > -1) listeners.splice(idx, 1);
607
+ };
608
+ }
609
+
610
+ function sendNativeUI(action, data) {
611
+ if (window.webkit?.messageHandlers?.craft) {
612
+ window.webkit.messageHandlers.craft.postMessage({ t: 'nativeUI', a: action, d: data || {} });
613
+ return true;
614
+ }
615
+
616
+ if (window.CraftBridge?.postMessage) {
617
+ window.CraftBridge.postMessage(JSON.stringify({ t: 'nativeUI', a: action, d: data || {} }));
618
+ return true;
619
+ }
620
+
621
+ return send({
622
+ id: generateId(),
623
+ type: 'nativeUI',
624
+ action,
625
+ data: data || {}
626
+ });
627
+ }
628
+
629
+ // Live component handles, keyed by id, so an event coming back from the host
630
+ // can be routed to the callbacks registered on the right one. Without this
631
+ // the onSelect/onSpaceChange callbacks were stored and never invoked.
632
+ const sidebars = new Map();
633
+ const spacesSidebars = new Map();
634
+
635
+ function createNativeUIFacade() {
636
+ class Sidebar {
637
+ constructor(id) {
638
+ this.id = id;
639
+ this._selectCallbacks = [];
640
+ }
641
+ addSection(section) {
642
+ sendNativeUI('addSidebarSection', { sidebarId: this.id, section });
643
+ return this;
644
+ }
645
+ setSelectedItem(itemId) {
646
+ sendNativeUI('setSelectedItem', { sidebarId: this.id, itemId });
647
+ return this;
648
+ }
649
+ onSelect(callback) {
650
+ this._selectCallbacks.push(callback);
651
+ return this;
652
+ }
653
+ destroy() {
654
+ sidebars.delete(this.id);
655
+ sendNativeUI('destroyComponent', { id: this.id, type: 'sidebar' });
656
+ }
657
+ }
658
+
659
+ /**
660
+ * An Arc-style sidebar of swipeable spaces.
661
+ *
662
+ * Separate from Sidebar rather than an option on it: a source list selects
663
+ * one row out of many, while a spaces sidebar selects one whole SCENE, and
664
+ * a host that renders the switcher natively (a segmented control in the
665
+ * toolbar, a Touch Bar strip) needs the space list, not the item list.
666
+ */
667
+ class SpacesSidebar {
668
+ constructor(id) {
669
+ this.id = id;
670
+ this._spaceCallbacks = [];
671
+ }
672
+ setSpaces(spaces) {
673
+ sendNativeUI('setSidebarSpaces', { sidebarId: this.id, spaces });
674
+ return this;
675
+ }
676
+ setActiveSpace(spaceId) {
677
+ sendNativeUI('setActiveSpace', { sidebarId: this.id, spaceId });
678
+ return this;
679
+ }
680
+ onSpaceChange(callback) {
681
+ this._spaceCallbacks.push(callback);
682
+ return this;
683
+ }
684
+ destroy() {
685
+ spacesSidebars.delete(this.id);
686
+ sendNativeUI('destroyComponent', { id: this.id, type: 'spacesSidebar' });
687
+ }
688
+ }
689
+
690
+ class FileBrowser {
691
+ constructor(id) {
692
+ this.id = id;
693
+ }
694
+ addFile(file) {
695
+ sendNativeUI('addFile', { browserId: this.id, file });
696
+ return this;
697
+ }
698
+ addFiles(files) {
699
+ sendNativeUI('addFiles', { browserId: this.id, files });
700
+ return this;
701
+ }
702
+ clearFiles() {
703
+ sendNativeUI('clearFiles', { browserId: this.id });
704
+ return this;
705
+ }
706
+ destroy() {
707
+ sendNativeUI('destroyComponent', { id: this.id, type: 'fileBrowser' });
708
+ }
709
+ }
710
+
711
+ class SplitView {
712
+ constructor(id, sidebar, browser) {
713
+ this.id = id;
714
+ this.sidebar = sidebar;
715
+ this.browser = browser;
716
+ }
717
+ setDividerPosition(position) {
718
+ sendNativeUI('setDividerPosition', { splitViewId: this.id, position });
719
+ return this;
720
+ }
721
+ destroy() {
722
+ sendNativeUI('destroyComponent', { id: this.id, type: 'splitView' });
723
+ }
724
+ }
725
+
726
+ // Host -> page. The host names the component in the payload; we look up the
727
+ // handle and fan out to whatever the page registered on it.
728
+ on('sidebar.select', function(params) {
729
+ const sidebar = sidebars.get(params && params.sidebarId);
730
+ if (sidebar) sidebar._selectCallbacks.forEach(fn => fn(params.itemId));
731
+ });
732
+ on('sidebar.spaceChange', function(params) {
733
+ const sidebar = spacesSidebars.get(params && params.sidebarId);
734
+ if (sidebar) sidebar._spaceCallbacks.forEach(fn => fn(params.spaceId));
735
+ });
736
+
737
+ return {
738
+ createSidebar(options) {
739
+ const opts = options || {};
740
+ const id = opts.id || 'sidebar-' + Date.now() + '-' + Math.random().toString(36).slice(2);
741
+ sendNativeUI('createSidebar', Object.assign({}, opts, { id }));
742
+ const sidebar = new Sidebar(id);
743
+ sidebars.set(id, sidebar);
744
+ return sidebar;
745
+ },
746
+ createSpacesSidebar(options) {
747
+ const opts = options || {};
748
+ const id = opts.id || 'spaces-' + Date.now() + '-' + Math.random().toString(36).slice(2);
749
+ sendNativeUI('createSpacesSidebar', Object.assign({}, opts, { id }));
750
+ const sidebar = new SpacesSidebar(id);
751
+ spacesSidebars.set(id, sidebar);
752
+ return sidebar;
753
+ },
754
+ createFileBrowser(options) {
755
+ const opts = options || {};
756
+ const id = opts.id || 'browser-' + Date.now() + '-' + Math.random().toString(36).slice(2);
757
+ sendNativeUI('createFileBrowser', Object.assign({}, opts, { id }));
758
+ return new FileBrowser(id);
759
+ },
760
+ createSplitView(options) {
761
+ if (!options?.sidebar || !options?.browser) {
762
+ throw new Error('createSplitView requires sidebar and browser options');
763
+ }
764
+ const id = options.id || 'splitview-' + Date.now() + '-' + Math.random().toString(36).slice(2);
765
+ sendNativeUI('createSplitView', {
766
+ id,
767
+ sidebarId: options.sidebar.id,
768
+ browserId: options.browser.id
769
+ });
770
+ return new SplitView(id, options.sidebar, options.browser);
771
+ },
772
+ showQuickLook(options) {
773
+ sendNativeUI('showQuickLook', options);
774
+ },
775
+ closeQuickLook() {
776
+ sendNativeUI('closeQuickLook', {});
777
+ },
778
+ toggleQuickLook(options) {
779
+ sendNativeUI('toggleQuickLook', options);
780
+ }
781
+ };
782
+ }
783
+
784
+ const existingCraft = window.craft || {};
785
+ const nativeUI = existingCraft.nativeUI || createNativeUIFacade();
786
+ const componentAPI = existingCraft.components || Object.assign({}, nativeUI, {
787
+ updateComponent: (id, props) => request('component.update', { componentId: id, props }),
788
+ destroyComponent: (id) => request('component.destroy', { componentId: id })
789
+ });
790
+
791
+ // Build the craft API object
792
+ window.craft = Object.assign({}, existingCraft, {
793
+ // Meta
794
+ isCraft,
795
+ on,
796
+ config,
797
+
798
+ // Window API
799
+ window: {
800
+ show: () => request('window.show'),
801
+ hide: () => request('window.hide'),
802
+ close: () => request('window.close'),
803
+ minimize: () => request('window.minimize'),
804
+ maximize: () => request('window.maximize'),
805
+ restore: () => request('window.restore'),
806
+ focus: () => request('window.focus'),
807
+ blur: () => request('window.blur'),
808
+ setTitle: (title) => request('window.setTitle', { title }),
809
+ setSize: (width, height) => request('window.setSize', { width, height }),
810
+ setPosition: (x, y) => request('window.setPosition', { x, y }),
811
+ setFullscreen: (fullscreen) => request('window.setFullscreen', { fullscreen }),
812
+ setAlwaysOnTop: (alwaysOnTop) => request('window.setAlwaysOnTop', { alwaysOnTop }),
813
+ getSize: () => request('window.getSize'),
814
+ getPosition: () => request('window.getPosition'),
815
+ isFullscreen: () => request('window.isFullscreen'),
816
+ isMaximized: () => request('window.isMaximized'),
817
+ isMinimized: () => request('window.isMinimized'),
818
+ isVisible: () => request('window.isVisible'),
819
+ center: () => request('window.center'),
820
+ toggleFullscreen: () => request('window.toggleFullscreen'),
821
+ startDrag: () => request('window.startDrag'),
822
+ },
823
+
824
+ // System Tray/Menubar API
825
+ tray: {
826
+ setTitle: (title) => request('tray.setTitle', { title }),
827
+ setTooltip: (tooltip) => request('tray.setTooltip', { tooltip }),
828
+ setIcon: (icon) => request('tray.setIcon', { icon }),
829
+ setMenu: (menu) => request('tray.setMenu', { menu }),
830
+ show: () => request('tray.show'),
831
+ hide: () => request('tray.hide'),
832
+ onClick: (callback) => on('tray.click', callback),
833
+ onDoubleClick: (callback) => on('tray.doubleClick', callback),
834
+ onRightClick: (callback) => on('tray.rightClick', callback),
835
+ },
836
+
837
+ // App API
838
+ app: {
839
+ quit: () => request('app.quit'),
840
+ hide: () => request('app.hide'),
841
+ show: () => request('app.show'),
842
+ focus: () => request('app.focus'),
843
+ getInfo: () => request('app.getInfo'),
844
+ getVersion: () => request('app.getVersion'),
845
+ getName: () => request('app.getName'),
846
+ getPath: (name) => request('app.getPath', { name }),
847
+ isDarkMode: () => request('app.isDarkMode'),
848
+ getLocale: () => request('app.getLocale'),
849
+ setBadge: (badge) => request('app.setBadge', { badge }),
850
+ hideDockIcon: () => request('app.hideDockIcon'),
851
+ showDockIcon: () => request('app.showDockIcon'),
852
+ notify: (options) => request('app.notify', options),
853
+ registerShortcut: (accelerator, callback) => {
854
+ const id = generateId();
855
+ on('shortcut.' + id, callback);
856
+ return request('app.registerShortcut', { accelerator, id });
857
+ },
858
+ unregisterShortcut: (accelerator) => request('app.unregisterShortcut', { accelerator }),
859
+ },
860
+
861
+ // Dialog API
862
+ dialog: {
863
+ openFile: (options) => request('dialog.openFile', options),
864
+ openFolder: (options) => request('dialog.openFolder', options),
865
+ saveFile: (options) => request('dialog.saveFile', options),
866
+ showAlert: (options) => request('dialog.showAlert', options),
867
+ showConfirm: (options) => request('dialog.showConfirm', options),
868
+ showPrompt: (options) => request('dialog.showPrompt', options),
869
+ showColorPicker: (options) => request('dialog.showColorPicker', options),
870
+ },
871
+
872
+ // Clipboard API
873
+ clipboard: {
874
+ writeText: (text) => request('clipboard.writeText', { text }),
875
+ readText: () => request('clipboard.readText'),
876
+ writeHTML: (html) => request('clipboard.writeHTML', { html }),
877
+ readHTML: () => request('clipboard.readHTML'),
878
+ clear: () => request('clipboard.clear'),
879
+ },
880
+
881
+ // File System API (limited for security)
882
+ fs: {
883
+ readFile: (path, encoding) => request('fs.readFile', { path, encoding }),
884
+ writeFile: (path, content, encoding) => request('fs.writeFile', { path, content, encoding }),
885
+ exists: (path) => request('fs.exists', { path }),
886
+ stat: (path) => request('fs.stat', { path }),
887
+ readDir: (path) => request('fs.readDir', { path }),
888
+ createDir: (path, recursive) => request('fs.createDir', { path, recursive }),
889
+ remove: (path, recursive) => request('fs.remove', { path, recursive }),
890
+ },
891
+
892
+ // Process/Shell API (limited for security)
893
+ process: {
894
+ exec: (command, options) => request('process.exec', { command, ...options }),
895
+ spawn: (command, args, options) => request('process.spawn', { command, args, ...options }),
896
+ env: () => request('process.env'),
897
+ cwd: () => request('process.cwd'),
898
+ platform: () => request('process.platform'),
899
+ },
900
+
901
+ // Gesture stream
902
+ //
903
+ // A webview's wheel events carry no phase information, so a page can only
904
+ // guess where a trackpad swipe begins and ends \u2014 typically with an idle
905
+ // timeout, which mistimes the release and cannot see momentum at all. The
906
+ // host holds the real NSEvent, so it forwards the phases instead:
907
+ //
908
+ // { axis: 'horizontal' | 'vertical',
909
+ // phase: 'begin' | 'change' | 'end',
910
+ // deltaX, deltaY, // points since the last event
911
+ // velocityX, velocityY, // points per second, at 'end'
912
+ // momentum: boolean } // the OS is coasting, not the finger
913
+ //
914
+ // Consumers must stay correct when nothing ever arrives: a host without
915
+ // gesture support simply never emits, so keep the wheel path bound and let
916
+ // a begin phase take over from it.
917
+ gestures: {
918
+ onSwipe: (callback) => on('gesture.swipe', callback),
919
+ },
920
+
921
+ // Native component helpers
922
+ nativeUI,
923
+ components: componentAPI
924
+ });
925
+
926
+ // Dispatch ready event
927
+ window.dispatchEvent(new CustomEvent('craft:ready', { detail: { isCraft: isCraft() } }));
928
+
929
+ if (config.debug) {
930
+ console.log('[Craft Bridge] Initialized, isCraft:', isCraft());
931
+ }
932
+ })();
933
+ </script>
934
+ `.replace("debug: false,",`debug: ${U},`).replace("timeout: 30000",`timeout: ${$}`)}function Cq(){return!1}function yq(q,U={}){let $=/@craft(?:\(([\s\S]*?)\))?/g;return q.replace($,(J,W)=>{let K={};if(W)try{K=JSON.parse(W.replace(/'/g,'"'))}catch{try{K=Function(`return ${W}`)()}catch{console.warn(`[stx] Invalid @craft config: ${W}`)}}return D(K)})}function N(q,U={}){if(q.includes("__craftBridgeInitialized"))return q;let $=D(U);if(q.includes("</head>"))return q.replace("</head>",`${$}
935
+ </head>`);if(q.includes("<body"))return q.replace(/(<body[^>]*>)/,`$1
936
+ ${$}`);return $+q}var b={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:(q,U)=>{let $=q.checked?"checked":"",J=q.disabled?"disabled":"";return`<label class="craft-checkbox-wrapper">
937
+ <input type="checkbox" class="craft-checkbox" ${$} ${J}>
938
+ <span class="craft-checkbox-label">${U||q.label||""}</span>
939
+ </label>`}},radio:{nativeType:"craft-radio",fallbackTag:"input",fallbackClasses:"craft-radio",nativeProps:["checked","disabled","name","value","label"]},select:{nativeType:"craft-select",fallbackTag:"select",fallbackClasses:"craft-select",nativeProps:["value","disabled","options","placeholder"]},slider:{nativeType:"craft-slider",fallbackTag:"input",fallbackClasses:"craft-slider",nativeProps:["value","min","max","step","disabled"],render:(q,U)=>{let $=q.min??0,J=q.max??100,W=q.step??1,K=q.value??50,Y=q.disabled?"disabled":"";return`<input type="range" class="craft-slider" min="${$}" max="${J}" step="${W}" value="${K}" ${Y}>`}},label:{nativeType:"craft-label",fallbackTag:"span",fallbackClasses:"craft-label",nativeProps:["text","for"]},badge:{nativeType:"craft-badge",fallbackTag:"span",fallbackClasses:"craft-badge",nativeProps:["variant","size"]},avatar:{nativeType:"craft-avatar",fallbackTag:"div",fallbackClasses:"craft-avatar",nativeProps:["src","alt","size","fallback"],render:(q,U)=>{let $=q.size||40,J=q.src,W=String(q.alt||""),K=q.fallback||(W?W.charAt(0).toUpperCase():"?");if(J)return`<img class="craft-avatar" src="${J}" alt="${W}" style="width:${$}px;height:${$}px;border-radius:50%">`;return`<div class="craft-avatar craft-avatar-fallback" style="width:${$}px;height:${$}px;border-radius:50%;display:flex;align-items:center;justify-content:center">${K}</div>`}},progress:{nativeType:"craft-progress",fallbackTag:"div",fallbackClasses:"craft-progress",nativeProps:["value","max","variant"],render:(q,U)=>{let $=Number(q.value)||0,J=Number(q.max)||100;return`<div class="craft-progress"><div class="craft-progress-bar" style="width:${Math.min(100,Math.max(0,$/J*100))}%"></div></div>`}},spinner:{nativeType:"craft-spinner",fallbackTag:"div",fallbackClasses:"craft-spinner",nativeProps:["size"],render:(q,U)=>{let $=q.size||24;return`<div class="craft-spinner" style="width:${$}px;height:${$}px"></div>`}},card:{nativeType:"craft-card",fallbackTag:"div",fallbackClasses:"craft-card",nativeProps:["title","subtitle","variant"]},modal:{nativeType:"craft-modal",fallbackTag:"dialog",fallbackClasses:"craft-modal",nativeProps:["open","title","closable","size"],render:(q,U)=>{let $=q.open?"open":"",J=q.title||"";return`<dialog class="craft-modal" ${$}>
940
+ <div class="craft-modal-content">
941
+ ${J?`<div class="craft-modal-header"><h2>${J}</h2></div>`:""}
942
+ <div class="craft-modal-body">${U}</div>
943
+ </div>
944
+ </dialog>`}},tabs:{nativeType:"craft-tabs",fallbackTag:"div",fallbackClasses:"craft-tabs",nativeProps:["activeTab","tabs"]},accordion:{nativeType:"craft-accordion",fallbackTag:"details",fallbackClasses:"craft-accordion",nativeProps:["open","title"],render:(q,U)=>{let $=q.open?"open":"",J=q.title||"Details";return`<details class="craft-accordion" ${$}>
945
+ <summary class="craft-accordion-header">${J}</summary>
946
+ <div class="craft-accordion-content">${U}</div>
947
+ </details>`}},divider:{nativeType:"craft-divider",fallbackTag:"hr",fallbackClasses:"craft-divider",nativeProps:["orientation","variant"]},table:{nativeType:"craft-table",fallbackTag:"table",fallbackClasses:"craft-table",nativeProps:["columns","rows","sortable","selectable"]},list:{nativeType:"craft-list",fallbackTag:"ul",fallbackClasses:"craft-list",nativeProps:["items","selectable"]},tree:{nativeType:"craft-tree",fallbackTag:"div",fallbackClasses:"craft-tree",nativeProps:["nodes","expandable","selectable"]},alert:{nativeType:"craft-alert",fallbackTag:"div",fallbackClasses:"craft-alert",nativeProps:["variant","title","dismissible"],render:(q,U)=>{let $=q.variant||"info",J=q.title||"";return`<div class="craft-alert craft-alert-${$}" role="alert">
948
+ ${J?`<div class="craft-alert-title">${J}</div>`:""}
949
+ <div class="craft-alert-content">${U}</div>
950
+ </div>`}},toast:{nativeType:"craft-toast",fallbackTag:"div",fallbackClasses:"craft-toast",nativeProps:["variant","duration","position"]},tooltip:{nativeType:"craft-tooltip",fallbackTag:"span",fallbackClasses:"craft-tooltip",nativeProps:["content","position"],render:(q,U)=>{let $=q.content||"",J=q.position||"top";return`<span class="craft-tooltip" data-tooltip="${$}" data-position="${J}">${U}</span>`}},menu:{nativeType:"craft-menu",fallbackTag:"nav",fallbackClasses:"craft-menu",nativeProps:["items","orientation"]},breadcrumb:{nativeType:"craft-breadcrumb",fallbackTag:"nav",fallbackClasses:"craft-breadcrumb",nativeProps:["items","separator"]},sidebar:{nativeType:"craft-sidebar",fallbackTag:"aside",fallbackClasses:"craft-sidebar craft-sidebar-tahoe",nativeProps:["id","variant","material","backgroundEffect","allowsVibrancy","materialOpacity","materialDarkOpacity","minWidth","maxWidth","canCollapse","searchPlaceholder","selectedItem","sections","spaces","selectedSpace"],render:r},"sidebar-space":{nativeType:"craft-sidebar-space",fallbackTag:"section",fallbackClasses:"craft-sidebar-space",nativeProps:["id","label","icon","tint"],render:a},"sidebar-section":{nativeType:"craft-sidebar-section",fallbackTag:"section",fallbackClasses:"craft-sidebar-section",nativeProps:["id","title","header"],render:t},"sidebar-item":{nativeType:"craft-sidebar-item",fallbackTag:"button",fallbackClasses:"craft-sidebar-item",nativeProps:["id","label","icon","badge","tintColor"],render:o},pagination:{nativeType:"craft-pagination",fallbackTag:"nav",fallbackClasses:"craft-pagination",nativeProps:["total","page","pageSize"]},"code-editor":{nativeType:"craft-code-editor",fallbackTag:"textarea",fallbackClasses:"craft-code-editor",nativeProps:["value","language","theme","readonly","lineNumbers"]},"file-browser":{nativeType:"craft-file-browser",fallbackTag:"div",fallbackClasses:"craft-file-browser",nativeProps:["path","showHidden","selectable"]},"color-picker":{nativeType:"craft-color-picker",fallbackTag:"input",fallbackClasses:"craft-color-picker",nativeProps:["value","format"],render:(q,U)=>{return`<input type="color" class="craft-color-picker" value="${q.value||"#000000"}">`}},"date-picker":{nativeType:"craft-date-picker",fallbackTag:"input",fallbackClasses:"craft-date-picker",nativeProps:["value","min","max","format"],render:(q,U)=>{let $=q.value||"",J=q.min||"",W=q.max||"";return`<input type="date" class="craft-date-picker" value="${$}" min="${J}" max="${W}">`}},"time-picker":{nativeType:"craft-time-picker",fallbackTag:"input",fallbackClasses:"craft-time-picker",nativeProps:["value","min","max","step"],render:(q,U)=>{return`<input type="time" class="craft-time-picker" value="${q.value||""}">`}}},h=`
951
+ <style id="craft-component-styles">
952
+ /* Craft Component Base Styles */
953
+ .craft-button {
954
+ display: inline-flex;
955
+ align-items: center;
956
+ justify-content: center;
957
+ padding: 8px 16px;
958
+ border: none;
959
+ border-radius: 6px;
960
+ font-family: inherit;
961
+ font-size: 14px;
962
+ font-weight: 500;
963
+ cursor: pointer;
964
+ transition: all 0.2s ease;
965
+ background: var(--craft-primary, #3b82f6);
966
+ color: white;
967
+ }
968
+ .craft-button:hover { opacity: 0.9; }
969
+ .craft-button:disabled { opacity: 0.5; cursor: not-allowed; }
970
+ .craft-button-secondary { background: var(--craft-secondary, #6b7280); }
971
+ .craft-button-outline { background: transparent; border: 1px solid currentColor; color: var(--craft-primary, #3b82f6); }
972
+
973
+ .craft-text-input, .craft-textarea, .craft-select {
974
+ padding: 8px 12px;
975
+ border: 1px solid var(--craft-border, #d1d5db);
976
+ border-radius: 6px;
977
+ font-family: inherit;
978
+ font-size: 14px;
979
+ background: var(--craft-bg, #fff);
980
+ color: var(--craft-text, #1f2937);
981
+ transition: border-color 0.2s ease;
982
+ }
983
+ .craft-text-input:focus, .craft-textarea:focus, .craft-select:focus {
984
+ outline: none;
985
+ border-color: var(--craft-primary, #3b82f6);
986
+ box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
987
+ }
988
+
989
+ .craft-checkbox-wrapper {
990
+ display: inline-flex;
991
+ align-items: center;
992
+ gap: 8px;
993
+ cursor: pointer;
994
+ }
995
+ .craft-checkbox {
996
+ width: 18px;
997
+ height: 18px;
998
+ cursor: pointer;
999
+ }
1000
+
1001
+ .craft-slider {
1002
+ width: 100%;
1003
+ height: 6px;
1004
+ border-radius: 3px;
1005
+ cursor: pointer;
1006
+ }
1007
+
1008
+ .craft-badge {
1009
+ display: inline-flex;
1010
+ align-items: center;
1011
+ padding: 2px 8px;
1012
+ border-radius: 9999px;
1013
+ font-size: 12px;
1014
+ font-weight: 500;
1015
+ background: var(--craft-primary, #3b82f6);
1016
+ color: white;
1017
+ }
1018
+
1019
+ .craft-avatar {
1020
+ display: inline-flex;
1021
+ align-items: center;
1022
+ justify-content: center;
1023
+ background: var(--craft-secondary, #6b7280);
1024
+ color: white;
1025
+ font-weight: 600;
1026
+ overflow: hidden;
1027
+ }
1028
+ .craft-avatar img { width: 100%; height: 100%; object-fit: cover; }
1029
+
1030
+ .craft-progress {
1031
+ width: 100%;
1032
+ height: 8px;
1033
+ background: var(--craft-border, #e5e7eb);
1034
+ border-radius: 4px;
1035
+ overflow: hidden;
1036
+ }
1037
+ .craft-progress-bar {
1038
+ height: 100%;
1039
+ background: var(--craft-primary, #3b82f6);
1040
+ transition: width 0.3s ease;
1041
+ }
1042
+
1043
+ .craft-spinner {
1044
+ border: 2px solid var(--craft-border, #e5e7eb);
1045
+ border-top-color: var(--craft-primary, #3b82f6);
1046
+ border-radius: 50%;
1047
+ animation: craft-spin 0.8s linear infinite;
1048
+ }
1049
+ @keyframes craft-spin { to { transform: rotate(360deg); } }
1050
+
1051
+ .craft-card {
1052
+ background: var(--craft-bg, #fff);
1053
+ border: 1px solid var(--craft-border, #e5e7eb);
1054
+ border-radius: 8px;
1055
+ padding: 16px;
1056
+ box-shadow: 0 1px 3px rgba(0,0,0,0.1);
1057
+ }
1058
+
1059
+ .craft-modal {
1060
+ border: none;
1061
+ border-radius: 12px;
1062
+ padding: 0;
1063
+ max-width: 90vw;
1064
+ max-height: 90vh;
1065
+ box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
1066
+ }
1067
+ .craft-modal::backdrop { background: rgba(0,0,0,0.5); }
1068
+ .craft-modal-header {
1069
+ padding: 16px 20px;
1070
+ border-bottom: 1px solid var(--craft-border, #e5e7eb);
1071
+ }
1072
+ .craft-modal-header h2 { margin: 0; font-size: 18px; }
1073
+ .craft-modal-body { padding: 20px; }
1074
+
1075
+ .craft-accordion {
1076
+ border: 1px solid var(--craft-border, #e5e7eb);
1077
+ border-radius: 6px;
1078
+ overflow: hidden;
1079
+ }
1080
+ .craft-accordion-header {
1081
+ padding: 12px 16px;
1082
+ cursor: pointer;
1083
+ font-weight: 500;
1084
+ background: var(--craft-bg-secondary, #f9fafb);
1085
+ }
1086
+ .craft-accordion-content { padding: 16px; }
1087
+
1088
+ .craft-divider {
1089
+ border: none;
1090
+ border-top: 1px solid var(--craft-border, #e5e7eb);
1091
+ margin: 16px 0;
1092
+ }
1093
+
1094
+ .craft-alert {
1095
+ padding: 12px 16px;
1096
+ border-radius: 6px;
1097
+ border-left: 4px solid;
1098
+ }
1099
+ .craft-alert-info { background: #eff6ff; border-color: #3b82f6; color: #1e40af; }
1100
+ .craft-alert-success { background: #f0fdf4; border-color: #22c55e; color: #166534; }
1101
+ .craft-alert-warning { background: #fffbeb; border-color: #f59e0b; color: #92400e; }
1102
+ .craft-alert-error { background: #fef2f2; border-color: #ef4444; color: #991b1b; }
1103
+ .craft-alert-title { font-weight: 600; margin-bottom: 4px; }
1104
+
1105
+ .craft-tooltip {
1106
+ position: relative;
1107
+ cursor: help;
1108
+ }
1109
+ .craft-tooltip::after {
1110
+ content: attr(data-tooltip);
1111
+ position: absolute;
1112
+ bottom: 100%;
1113
+ left: 50%;
1114
+ transform: translateX(-50%);
1115
+ padding: 4px 8px;
1116
+ background: #1f2937;
1117
+ color: white;
1118
+ font-size: 12px;
1119
+ border-radius: 4px;
1120
+ white-space: nowrap;
1121
+ opacity: 0;
1122
+ pointer-events: none;
1123
+ transition: opacity 0.2s;
1124
+ }
1125
+ .craft-tooltip:hover::after { opacity: 1; }
1126
+
1127
+ .craft-table {
1128
+ width: 100%;
1129
+ border-collapse: collapse;
1130
+ }
1131
+ .craft-table th, .craft-table td {
1132
+ padding: 12px;
1133
+ text-align: left;
1134
+ border-bottom: 1px solid var(--craft-border, #e5e7eb);
1135
+ }
1136
+ .craft-table th { font-weight: 600; background: var(--craft-bg-secondary, #f9fafb); }
1137
+
1138
+ .craft-list {
1139
+ list-style: none;
1140
+ padding: 0;
1141
+ margin: 0;
1142
+ }
1143
+ .craft-list li {
1144
+ padding: 12px;
1145
+ border-bottom: 1px solid var(--craft-border, #e5e7eb);
1146
+ }
1147
+ .craft-list li:last-child { border-bottom: none; }
1148
+
1149
+ .craft-sidebar {
1150
+ --craft-sidebar-width: 286px;
1151
+ --craft-sidebar-bg: rgba(255, 255, 255, 0.68);
1152
+ --craft-sidebar-border: rgba(255, 255, 255, 0.62);
1153
+ --craft-sidebar-shadow: 0 24px 70px rgba(15, 23, 42, 0.22), 0 1px 0 rgba(255, 255, 255, 0.72) inset;
1154
+ --craft-sidebar-text: rgba(24, 24, 27, 0.86);
1155
+ --craft-sidebar-muted: rgba(63, 63, 70, 0.62);
1156
+ --craft-sidebar-hover: rgba(255, 255, 255, 0.42);
1157
+ --craft-sidebar-selected: rgba(10, 132, 255, 0.86);
1158
+ position: relative;
1159
+ display: flex;
1160
+ flex-direction: column;
1161
+ width: var(--craft-sidebar-width);
1162
+ min-width: var(--craft-sidebar-width);
1163
+ height: 100vh;
1164
+ padding: 58px 10px 12px;
1165
+ color: var(--craft-sidebar-text);
1166
+ background:
1167
+ linear-gradient(135deg, rgba(255,255,255,0.28), rgba(255,255,255,0.08)),
1168
+ var(--craft-sidebar-bg);
1169
+ border: 1px solid var(--craft-sidebar-border);
1170
+ border-radius: 18px;
1171
+ box-shadow: var(--craft-sidebar-shadow);
1172
+ backdrop-filter: blur(34px) saturate(180%);
1173
+ -webkit-backdrop-filter: blur(34px) saturate(180%);
1174
+ overflow: hidden;
1175
+ user-select: none;
1176
+ }
1177
+ .craft-sidebar::before {
1178
+ content: "";
1179
+ position: absolute;
1180
+ inset: 0;
1181
+ pointer-events: none;
1182
+ background:
1183
+ radial-gradient(circle at 18% 0%, rgba(255,255,255,0.68), transparent 32%),
1184
+ linear-gradient(100deg, transparent 0%, rgba(255,255,255,0.30) 42%, transparent 58%);
1185
+ mix-blend-mode: screen;
1186
+ opacity: 0.72;
1187
+ }
1188
+ .craft-sidebar[data-native-active="true"] { display: none; }
1189
+ .craft-sidebar-search {
1190
+ position: relative;
1191
+ z-index: 1;
1192
+ margin: 0 0 12px;
1193
+ }
1194
+ .craft-sidebar-search input {
1195
+ width: 100%;
1196
+ min-height: 28px;
1197
+ padding: 5px 10px;
1198
+ border: 1px solid rgba(0, 0, 0, 0.05);
1199
+ border-radius: 8px;
1200
+ background: rgba(255, 255, 255, 0.34);
1201
+ color: inherit;
1202
+ font: inherit;
1203
+ font-size: 13px;
1204
+ outline: none;
1205
+ }
1206
+ .craft-sidebar-section {
1207
+ position: relative;
1208
+ z-index: 1;
1209
+ margin: 0 0 14px;
1210
+ }
1211
+ .craft-sidebar-section-title {
1212
+ padding: 0 8px 5px;
1213
+ color: var(--craft-sidebar-muted);
1214
+ font-size: 11px;
1215
+ font-weight: 700;
1216
+ letter-spacing: 0;
1217
+ text-transform: uppercase;
1218
+ }
1219
+ .craft-sidebar-item {
1220
+ width: calc(100% - 4px);
1221
+ min-height: 28px;
1222
+ margin: 1px 2px;
1223
+ padding: 5px 8px;
1224
+ display: flex;
1225
+ align-items: center;
1226
+ gap: 8px;
1227
+ border: 0;
1228
+ border-radius: 8px;
1229
+ background: transparent;
1230
+ color: inherit;
1231
+ font: inherit;
1232
+ font-size: 13px;
1233
+ text-align: left;
1234
+ cursor: default;
1235
+ }
1236
+ .craft-sidebar-item:hover { background: var(--craft-sidebar-hover); }
1237
+ .craft-sidebar-item[data-selected="true"] {
1238
+ color: white;
1239
+ background: var(--craft-sidebar-selected);
1240
+ box-shadow: 0 1px 0 rgba(255,255,255,0.22) inset, 0 8px 18px rgba(10, 132, 255, 0.22);
1241
+ }
1242
+ .craft-sidebar-item-icon {
1243
+ position: relative;
1244
+ display: inline-block;
1245
+ width: 16px;
1246
+ height: 16px;
1247
+ min-width: 16px;
1248
+ opacity: 0.82;
1249
+ overflow: hidden;
1250
+ color: transparent;
1251
+ }
1252
+ .craft-sidebar-item-icon::before {
1253
+ content: "";
1254
+ position: absolute;
1255
+ inset: 2px;
1256
+ border-radius: 4px;
1257
+ background: var(--craft-sidebar-icon-color, rgba(63, 63, 70, 0.62));
1258
+ box-shadow: 0 1px 0 rgba(255,255,255,0.24) inset;
1259
+ }
1260
+ .craft-sidebar-item-icon[data-icon*="circle"]::before {
1261
+ inset: 4px;
1262
+ border-radius: 999px;
1263
+ }
1264
+ .craft-sidebar-item[data-selected="true"] .craft-sidebar-item-icon::before {
1265
+ background: rgba(255, 255, 255, 0.9);
1266
+ }
1267
+ .craft-sidebar-item-label {
1268
+ flex: 1;
1269
+ overflow: hidden;
1270
+ white-space: nowrap;
1271
+ text-overflow: ellipsis;
1272
+ }
1273
+ .craft-sidebar-item-badge {
1274
+ min-width: 18px;
1275
+ padding: 1px 6px;
1276
+ border-radius: 999px;
1277
+ background: rgba(0, 0, 0, 0.08);
1278
+ color: var(--craft-sidebar-muted);
1279
+ font-size: 10px;
1280
+ font-weight: 700;
1281
+ text-align: center;
1282
+ }
1283
+ .craft-sidebar-item[data-selected="true"] .craft-sidebar-item-badge {
1284
+ color: white;
1285
+ background: rgba(255, 255, 255, 0.24);
1286
+ }
1287
+
1288
+ /* Spaces fallback. Stacked in document order behind a rail \u2014 legible without
1289
+ a native host, and deliberately not a second swipe implementation. */
1290
+ .craft-sidebar-spaces {
1291
+ position: relative;
1292
+ z-index: 1;
1293
+ flex: 1;
1294
+ min-height: 0;
1295
+ overflow-y: auto;
1296
+ }
1297
+ .craft-sidebar-space-title {
1298
+ padding: 10px 8px 4px;
1299
+ font-size: 13px;
1300
+ font-weight: 600;
1301
+ }
1302
+ .craft-sidebar-space-switcher {
1303
+ position: relative;
1304
+ z-index: 1;
1305
+ display: flex;
1306
+ align-items: center;
1307
+ gap: 1px;
1308
+ padding-top: 6px;
1309
+ }
1310
+ .craft-sidebar-space-tab {
1311
+ display: grid;
1312
+ place-items: center;
1313
+ width: 28px;
1314
+ height: 26px;
1315
+ border: 0;
1316
+ border-radius: 7px;
1317
+ background: transparent;
1318
+ color: inherit;
1319
+ font: inherit;
1320
+ font-size: 11px;
1321
+ font-weight: 700;
1322
+ opacity: 0.4;
1323
+ cursor: default;
1324
+ }
1325
+ .craft-sidebar-space-tab[data-selected="true"] {
1326
+ opacity: 1;
1327
+ background: rgba(255, 255, 255, 0.55);
1328
+ }
1329
+
1330
+ .craft-code-editor {
1331
+ font-family: 'SF Mono', 'Fira Code', monospace;
1332
+ font-size: 13px;
1333
+ line-height: 1.5;
1334
+ padding: 12px;
1335
+ background: #1e1e1e;
1336
+ color: #d4d4d4;
1337
+ border-radius: 6px;
1338
+ resize: vertical;
1339
+ }
1340
+
1341
+ /* Dark mode support */
1342
+ @media (prefers-color-scheme: dark) {
1343
+ .craft-text-input, .craft-textarea, .craft-select, .craft-card {
1344
+ background: #1f2937;
1345
+ color: #f3f4f6;
1346
+ border-color: #374151;
1347
+ }
1348
+ .craft-modal {
1349
+ background: #1f2937;
1350
+ color: #f3f4f6;
1351
+ }
1352
+ .craft-accordion-header { background: #374151; }
1353
+ .craft-table th { background: #374151; }
1354
+ .craft-sidebar {
1355
+ --craft-sidebar-bg: rgba(24, 24, 27, 0.58);
1356
+ --craft-sidebar-border: rgba(255, 255, 255, 0.12);
1357
+ --craft-sidebar-shadow: 0 26px 74px rgba(0, 0, 0, 0.44), 0 1px 0 rgba(255, 255, 255, 0.11) inset;
1358
+ --craft-sidebar-text: rgba(244, 244, 245, 0.92);
1359
+ --craft-sidebar-muted: rgba(212, 212, 216, 0.58);
1360
+ --craft-sidebar-hover: rgba(255, 255, 255, 0.10);
1361
+ }
1362
+ .craft-sidebar-search input {
1363
+ border-color: rgba(255,255,255,0.08);
1364
+ background: rgba(255,255,255,0.08);
1365
+ }
1366
+ }
1367
+ </style>
1368
+ `,bq=`
1369
+ <script id="craft-component-runtime">
1370
+ (function() {
1371
+ if (window.__stxCraftComponentRuntime) return;
1372
+ window.__stxCraftComponentRuntime = true;
1373
+
1374
+ function parseConfig(sidebar) {
1375
+ var id = sidebar.getAttribute('data-craft-sidebar-id');
1376
+ var script = id && document.querySelector('script[data-craft-sidebar-config="' + id + '"]');
1377
+ if (!script) return null;
1378
+ try {
1379
+ return JSON.parse(script.textContent || '{}');
1380
+ } catch (error) {
1381
+ console.warn('[stx] Invalid Craft sidebar config', error);
1382
+ return null;
1383
+ }
1384
+ }
1385
+
1386
+ function getNativeUI() {
1387
+ if (!window.craft) return null;
1388
+ var hasNativeHost = window.craft.isCraft?.() ||
1389
+ !!(window.webkit?.messageHandlers?.craft || window.CraftBridge || window.craftIPC);
1390
+ if (!hasNativeHost) return null;
1391
+ return window.craft.nativeUI || window.craft.components;
1392
+ }
1393
+
1394
+ function initializeSidebar(sidebar) {
1395
+ if (sidebar.dataset.craftInitialized === 'true') return;
1396
+ if (sidebar.dataset.native === 'false') return;
1397
+
1398
+ var nativeUI = getNativeUI();
1399
+ if (!nativeUI || typeof nativeUI.createSidebar !== 'function') return;
1400
+
1401
+ var config = parseConfig(sidebar);
1402
+ if (!config) return;
1403
+
1404
+ var hasSpaces = !!(config.spaces && config.spaces.length);
1405
+ // Spaces need a host that can swipe between whole scenes. Falling back to
1406
+ // createSidebar would flatten every space into one list, which is worse
1407
+ // than the web rendering already on the page \u2014 so leave that in place.
1408
+ if (hasSpaces && typeof nativeUI.createSpacesSidebar !== 'function') return;
1409
+
1410
+ try {
1411
+ var nativeConfig = Object.assign({}, config);
1412
+ delete nativeConfig.sections;
1413
+ delete nativeConfig.spaces;
1414
+
1415
+ var nativeSidebar = hasSpaces
1416
+ ? nativeUI.createSpacesSidebar(nativeConfig)
1417
+ : nativeUI.createSidebar(nativeConfig);
1418
+
1419
+ if (nativeSidebar && hasSpaces && nativeSidebar.setSpaces) {
1420
+ nativeSidebar.setSpaces(config.spaces);
1421
+ }
1422
+ if (nativeSidebar && hasSpaces && config.selectedSpace && nativeSidebar.setActiveSpace) {
1423
+ nativeSidebar.setActiveSpace(config.selectedSpace);
1424
+ }
1425
+ if (nativeSidebar && hasSpaces && nativeSidebar.onSpaceChange) {
1426
+ nativeSidebar.onSpaceChange(function(spaceId) {
1427
+ sidebar.dispatchEvent(new CustomEvent('craft-sidebar:space', {
1428
+ bubbles: true,
1429
+ detail: { spaceId: spaceId, sidebarId: config.id }
1430
+ }));
1431
+ });
1432
+ }
1433
+ if (nativeSidebar && !hasSpaces && config.sections) {
1434
+ config.sections.forEach(function(section) {
1435
+ if (nativeSidebar.addSection) nativeSidebar.addSection(section);
1436
+ });
1437
+ }
1438
+ if (nativeSidebar && config.selectedItem && nativeSidebar.setSelectedItem) {
1439
+ nativeSidebar.setSelectedItem(config.selectedItem);
1440
+ }
1441
+ if (nativeSidebar && nativeSidebar.onSelect) {
1442
+ nativeSidebar.onSelect(function(itemId) {
1443
+ sidebar.dispatchEvent(new CustomEvent('craft-sidebar:select', {
1444
+ bubbles: true,
1445
+ detail: { itemId: itemId, sidebarId: config.id }
1446
+ }));
1447
+ });
1448
+ }
1449
+ sidebar.dataset.craftInitialized = 'true';
1450
+ sidebar.dataset.nativeActive = 'true';
1451
+ window.__stxCraftNativeSidebars = window.__stxCraftNativeSidebars || {};
1452
+ window.__stxCraftNativeSidebars[config.id] = nativeSidebar;
1453
+ } catch (error) {
1454
+ sidebar.dataset.nativeError = error.message || 'unknown';
1455
+ console.warn('[stx] Failed to create native Craft sidebar', error);
1456
+ }
1457
+ }
1458
+
1459
+ function initializeCraftComponents() {
1460
+ document.querySelectorAll('[data-craft-native-sidebar]').forEach(initializeSidebar);
1461
+ }
1462
+
1463
+ if (document.readyState === 'loading') {
1464
+ document.addEventListener('DOMContentLoaded', initializeCraftComponents);
1465
+ } else {
1466
+ initializeCraftComponents();
1467
+ }
1468
+ window.addEventListener('craft:ready', initializeCraftComponents);
1469
+ document.addEventListener('craft:nativeui:ready', initializeCraftComponents);
1470
+ })();
1471
+ </script>
1472
+ `;function u(q,U={}){let{classPrefix:$="craft"}=U;if(!q.includes("craft-component-styles"))if(q.includes("</head>"))q=q.replace("</head>",`${`
1473
+ <style id="craft-component-styles">
1474
+ /* Craft Component Base Styles */
1475
+ .craft-button {
1476
+ display: inline-flex;
1477
+ align-items: center;
1478
+ justify-content: center;
1479
+ padding: 8px 16px;
1480
+ border: none;
1481
+ border-radius: 6px;
1482
+ font-family: inherit;
1483
+ font-size: 14px;
1484
+ font-weight: 500;
1485
+ cursor: pointer;
1486
+ transition: all 0.2s ease;
1487
+ background: var(--craft-primary, #3b82f6);
1488
+ color: white;
1489
+ }
1490
+ .craft-button:hover { opacity: 0.9; }
1491
+ .craft-button:disabled { opacity: 0.5; cursor: not-allowed; }
1492
+ .craft-button-secondary { background: var(--craft-secondary, #6b7280); }
1493
+ .craft-button-outline { background: transparent; border: 1px solid currentColor; color: var(--craft-primary, #3b82f6); }
1494
+
1495
+ .craft-text-input, .craft-textarea, .craft-select {
1496
+ padding: 8px 12px;
1497
+ border: 1px solid var(--craft-border, #d1d5db);
1498
+ border-radius: 6px;
1499
+ font-family: inherit;
1500
+ font-size: 14px;
1501
+ background: var(--craft-bg, #fff);
1502
+ color: var(--craft-text, #1f2937);
1503
+ transition: border-color 0.2s ease;
1504
+ }
1505
+ .craft-text-input:focus, .craft-textarea:focus, .craft-select:focus {
1506
+ outline: none;
1507
+ border-color: var(--craft-primary, #3b82f6);
1508
+ box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
1509
+ }
1510
+
1511
+ .craft-checkbox-wrapper {
1512
+ display: inline-flex;
1513
+ align-items: center;
1514
+ gap: 8px;
1515
+ cursor: pointer;
1516
+ }
1517
+ .craft-checkbox {
1518
+ width: 18px;
1519
+ height: 18px;
1520
+ cursor: pointer;
1521
+ }
1522
+
1523
+ .craft-slider {
1524
+ width: 100%;
1525
+ height: 6px;
1526
+ border-radius: 3px;
1527
+ cursor: pointer;
1528
+ }
1529
+
1530
+ .craft-badge {
1531
+ display: inline-flex;
1532
+ align-items: center;
1533
+ padding: 2px 8px;
1534
+ border-radius: 9999px;
1535
+ font-size: 12px;
1536
+ font-weight: 500;
1537
+ background: var(--craft-primary, #3b82f6);
1538
+ color: white;
1539
+ }
1540
+
1541
+ .craft-avatar {
1542
+ display: inline-flex;
1543
+ align-items: center;
1544
+ justify-content: center;
1545
+ background: var(--craft-secondary, #6b7280);
1546
+ color: white;
1547
+ font-weight: 600;
1548
+ overflow: hidden;
1549
+ }
1550
+ .craft-avatar img { width: 100%; height: 100%; object-fit: cover; }
1551
+
1552
+ .craft-progress {
1553
+ width: 100%;
1554
+ height: 8px;
1555
+ background: var(--craft-border, #e5e7eb);
1556
+ border-radius: 4px;
1557
+ overflow: hidden;
1558
+ }
1559
+ .craft-progress-bar {
1560
+ height: 100%;
1561
+ background: var(--craft-primary, #3b82f6);
1562
+ transition: width 0.3s ease;
1563
+ }
1564
+
1565
+ .craft-spinner {
1566
+ border: 2px solid var(--craft-border, #e5e7eb);
1567
+ border-top-color: var(--craft-primary, #3b82f6);
1568
+ border-radius: 50%;
1569
+ animation: craft-spin 0.8s linear infinite;
1570
+ }
1571
+ @keyframes craft-spin { to { transform: rotate(360deg); } }
1572
+
1573
+ .craft-card {
1574
+ background: var(--craft-bg, #fff);
1575
+ border: 1px solid var(--craft-border, #e5e7eb);
1576
+ border-radius: 8px;
1577
+ padding: 16px;
1578
+ box-shadow: 0 1px 3px rgba(0,0,0,0.1);
1579
+ }
1580
+
1581
+ .craft-modal {
1582
+ border: none;
1583
+ border-radius: 12px;
1584
+ padding: 0;
1585
+ max-width: 90vw;
1586
+ max-height: 90vh;
1587
+ box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
1588
+ }
1589
+ .craft-modal::backdrop { background: rgba(0,0,0,0.5); }
1590
+ .craft-modal-header {
1591
+ padding: 16px 20px;
1592
+ border-bottom: 1px solid var(--craft-border, #e5e7eb);
1593
+ }
1594
+ .craft-modal-header h2 { margin: 0; font-size: 18px; }
1595
+ .craft-modal-body { padding: 20px; }
1596
+
1597
+ .craft-accordion {
1598
+ border: 1px solid var(--craft-border, #e5e7eb);
1599
+ border-radius: 6px;
1600
+ overflow: hidden;
1601
+ }
1602
+ .craft-accordion-header {
1603
+ padding: 12px 16px;
1604
+ cursor: pointer;
1605
+ font-weight: 500;
1606
+ background: var(--craft-bg-secondary, #f9fafb);
1607
+ }
1608
+ .craft-accordion-content { padding: 16px; }
1609
+
1610
+ .craft-divider {
1611
+ border: none;
1612
+ border-top: 1px solid var(--craft-border, #e5e7eb);
1613
+ margin: 16px 0;
1614
+ }
1615
+
1616
+ .craft-alert {
1617
+ padding: 12px 16px;
1618
+ border-radius: 6px;
1619
+ border-left: 4px solid;
1620
+ }
1621
+ .craft-alert-info { background: #eff6ff; border-color: #3b82f6; color: #1e40af; }
1622
+ .craft-alert-success { background: #f0fdf4; border-color: #22c55e; color: #166534; }
1623
+ .craft-alert-warning { background: #fffbeb; border-color: #f59e0b; color: #92400e; }
1624
+ .craft-alert-error { background: #fef2f2; border-color: #ef4444; color: #991b1b; }
1625
+ .craft-alert-title { font-weight: 600; margin-bottom: 4px; }
1626
+
1627
+ .craft-tooltip {
1628
+ position: relative;
1629
+ cursor: help;
1630
+ }
1631
+ .craft-tooltip::after {
1632
+ content: attr(data-tooltip);
1633
+ position: absolute;
1634
+ bottom: 100%;
1635
+ left: 50%;
1636
+ transform: translateX(-50%);
1637
+ padding: 4px 8px;
1638
+ background: #1f2937;
1639
+ color: white;
1640
+ font-size: 12px;
1641
+ border-radius: 4px;
1642
+ white-space: nowrap;
1643
+ opacity: 0;
1644
+ pointer-events: none;
1645
+ transition: opacity 0.2s;
1646
+ }
1647
+ .craft-tooltip:hover::after { opacity: 1; }
1648
+
1649
+ .craft-table {
1650
+ width: 100%;
1651
+ border-collapse: collapse;
1652
+ }
1653
+ .craft-table th, .craft-table td {
1654
+ padding: 12px;
1655
+ text-align: left;
1656
+ border-bottom: 1px solid var(--craft-border, #e5e7eb);
1657
+ }
1658
+ .craft-table th { font-weight: 600; background: var(--craft-bg-secondary, #f9fafb); }
1659
+
1660
+ .craft-list {
1661
+ list-style: none;
1662
+ padding: 0;
1663
+ margin: 0;
1664
+ }
1665
+ .craft-list li {
1666
+ padding: 12px;
1667
+ border-bottom: 1px solid var(--craft-border, #e5e7eb);
1668
+ }
1669
+ .craft-list li:last-child { border-bottom: none; }
1670
+
1671
+ .craft-sidebar {
1672
+ --craft-sidebar-width: 286px;
1673
+ --craft-sidebar-bg: rgba(255, 255, 255, 0.68);
1674
+ --craft-sidebar-border: rgba(255, 255, 255, 0.62);
1675
+ --craft-sidebar-shadow: 0 24px 70px rgba(15, 23, 42, 0.22), 0 1px 0 rgba(255, 255, 255, 0.72) inset;
1676
+ --craft-sidebar-text: rgba(24, 24, 27, 0.86);
1677
+ --craft-sidebar-muted: rgba(63, 63, 70, 0.62);
1678
+ --craft-sidebar-hover: rgba(255, 255, 255, 0.42);
1679
+ --craft-sidebar-selected: rgba(10, 132, 255, 0.86);
1680
+ position: relative;
1681
+ display: flex;
1682
+ flex-direction: column;
1683
+ width: var(--craft-sidebar-width);
1684
+ min-width: var(--craft-sidebar-width);
1685
+ height: 100vh;
1686
+ padding: 58px 10px 12px;
1687
+ color: var(--craft-sidebar-text);
1688
+ background:
1689
+ linear-gradient(135deg, rgba(255,255,255,0.28), rgba(255,255,255,0.08)),
1690
+ var(--craft-sidebar-bg);
1691
+ border: 1px solid var(--craft-sidebar-border);
1692
+ border-radius: 18px;
1693
+ box-shadow: var(--craft-sidebar-shadow);
1694
+ backdrop-filter: blur(34px) saturate(180%);
1695
+ -webkit-backdrop-filter: blur(34px) saturate(180%);
1696
+ overflow: hidden;
1697
+ user-select: none;
1698
+ }
1699
+ .craft-sidebar::before {
1700
+ content: "";
1701
+ position: absolute;
1702
+ inset: 0;
1703
+ pointer-events: none;
1704
+ background:
1705
+ radial-gradient(circle at 18% 0%, rgba(255,255,255,0.68), transparent 32%),
1706
+ linear-gradient(100deg, transparent 0%, rgba(255,255,255,0.30) 42%, transparent 58%);
1707
+ mix-blend-mode: screen;
1708
+ opacity: 0.72;
1709
+ }
1710
+ .craft-sidebar[data-native-active="true"] { display: none; }
1711
+ .craft-sidebar-search {
1712
+ position: relative;
1713
+ z-index: 1;
1714
+ margin: 0 0 12px;
1715
+ }
1716
+ .craft-sidebar-search input {
1717
+ width: 100%;
1718
+ min-height: 28px;
1719
+ padding: 5px 10px;
1720
+ border: 1px solid rgba(0, 0, 0, 0.05);
1721
+ border-radius: 8px;
1722
+ background: rgba(255, 255, 255, 0.34);
1723
+ color: inherit;
1724
+ font: inherit;
1725
+ font-size: 13px;
1726
+ outline: none;
1727
+ }
1728
+ .craft-sidebar-section {
1729
+ position: relative;
1730
+ z-index: 1;
1731
+ margin: 0 0 14px;
1732
+ }
1733
+ .craft-sidebar-section-title {
1734
+ padding: 0 8px 5px;
1735
+ color: var(--craft-sidebar-muted);
1736
+ font-size: 11px;
1737
+ font-weight: 700;
1738
+ letter-spacing: 0;
1739
+ text-transform: uppercase;
1740
+ }
1741
+ .craft-sidebar-item {
1742
+ width: calc(100% - 4px);
1743
+ min-height: 28px;
1744
+ margin: 1px 2px;
1745
+ padding: 5px 8px;
1746
+ display: flex;
1747
+ align-items: center;
1748
+ gap: 8px;
1749
+ border: 0;
1750
+ border-radius: 8px;
1751
+ background: transparent;
1752
+ color: inherit;
1753
+ font: inherit;
1754
+ font-size: 13px;
1755
+ text-align: left;
1756
+ cursor: default;
1757
+ }
1758
+ .craft-sidebar-item:hover { background: var(--craft-sidebar-hover); }
1759
+ .craft-sidebar-item[data-selected="true"] {
1760
+ color: white;
1761
+ background: var(--craft-sidebar-selected);
1762
+ box-shadow: 0 1px 0 rgba(255,255,255,0.22) inset, 0 8px 18px rgba(10, 132, 255, 0.22);
1763
+ }
1764
+ .craft-sidebar-item-icon {
1765
+ position: relative;
1766
+ display: inline-block;
1767
+ width: 16px;
1768
+ height: 16px;
1769
+ min-width: 16px;
1770
+ opacity: 0.82;
1771
+ overflow: hidden;
1772
+ color: transparent;
1773
+ }
1774
+ .craft-sidebar-item-icon::before {
1775
+ content: "";
1776
+ position: absolute;
1777
+ inset: 2px;
1778
+ border-radius: 4px;
1779
+ background: var(--craft-sidebar-icon-color, rgba(63, 63, 70, 0.62));
1780
+ box-shadow: 0 1px 0 rgba(255,255,255,0.24) inset;
1781
+ }
1782
+ .craft-sidebar-item-icon[data-icon*="circle"]::before {
1783
+ inset: 4px;
1784
+ border-radius: 999px;
1785
+ }
1786
+ .craft-sidebar-item[data-selected="true"] .craft-sidebar-item-icon::before {
1787
+ background: rgba(255, 255, 255, 0.9);
1788
+ }
1789
+ .craft-sidebar-item-label {
1790
+ flex: 1;
1791
+ overflow: hidden;
1792
+ white-space: nowrap;
1793
+ text-overflow: ellipsis;
1794
+ }
1795
+ .craft-sidebar-item-badge {
1796
+ min-width: 18px;
1797
+ padding: 1px 6px;
1798
+ border-radius: 999px;
1799
+ background: rgba(0, 0, 0, 0.08);
1800
+ color: var(--craft-sidebar-muted);
1801
+ font-size: 10px;
1802
+ font-weight: 700;
1803
+ text-align: center;
1804
+ }
1805
+ .craft-sidebar-item[data-selected="true"] .craft-sidebar-item-badge {
1806
+ color: white;
1807
+ background: rgba(255, 255, 255, 0.24);
1808
+ }
1809
+
1810
+ /* Spaces fallback. Stacked in document order behind a rail \u2014 legible without
1811
+ a native host, and deliberately not a second swipe implementation. */
1812
+ .craft-sidebar-spaces {
1813
+ position: relative;
1814
+ z-index: 1;
1815
+ flex: 1;
1816
+ min-height: 0;
1817
+ overflow-y: auto;
1818
+ }
1819
+ .craft-sidebar-space-title {
1820
+ padding: 10px 8px 4px;
1821
+ font-size: 13px;
1822
+ font-weight: 600;
1823
+ }
1824
+ .craft-sidebar-space-switcher {
1825
+ position: relative;
1826
+ z-index: 1;
1827
+ display: flex;
1828
+ align-items: center;
1829
+ gap: 1px;
1830
+ padding-top: 6px;
1831
+ }
1832
+ .craft-sidebar-space-tab {
1833
+ display: grid;
1834
+ place-items: center;
1835
+ width: 28px;
1836
+ height: 26px;
1837
+ border: 0;
1838
+ border-radius: 7px;
1839
+ background: transparent;
1840
+ color: inherit;
1841
+ font: inherit;
1842
+ font-size: 11px;
1843
+ font-weight: 700;
1844
+ opacity: 0.4;
1845
+ cursor: default;
1846
+ }
1847
+ .craft-sidebar-space-tab[data-selected="true"] {
1848
+ opacity: 1;
1849
+ background: rgba(255, 255, 255, 0.55);
1850
+ }
1851
+
1852
+ .craft-code-editor {
1853
+ font-family: 'SF Mono', 'Fira Code', monospace;
1854
+ font-size: 13px;
1855
+ line-height: 1.5;
1856
+ padding: 12px;
1857
+ background: #1e1e1e;
1858
+ color: #d4d4d4;
1859
+ border-radius: 6px;
1860
+ resize: vertical;
1861
+ }
1862
+
1863
+ /* Dark mode support */
1864
+ @media (prefers-color-scheme: dark) {
1865
+ .craft-text-input, .craft-textarea, .craft-select, .craft-card {
1866
+ background: #1f2937;
1867
+ color: #f3f4f6;
1868
+ border-color: #374151;
1869
+ }
1870
+ .craft-modal {
1871
+ background: #1f2937;
1872
+ color: #f3f4f6;
1873
+ }
1874
+ .craft-accordion-header { background: #374151; }
1875
+ .craft-table th { background: #374151; }
1876
+ .craft-sidebar {
1877
+ --craft-sidebar-bg: rgba(24, 24, 27, 0.58);
1878
+ --craft-sidebar-border: rgba(255, 255, 255, 0.12);
1879
+ --craft-sidebar-shadow: 0 26px 74px rgba(0, 0, 0, 0.44), 0 1px 0 rgba(255, 255, 255, 0.11) inset;
1880
+ --craft-sidebar-text: rgba(244, 244, 245, 0.92);
1881
+ --craft-sidebar-muted: rgba(212, 212, 216, 0.58);
1882
+ --craft-sidebar-hover: rgba(255, 255, 255, 0.10);
1883
+ }
1884
+ .craft-sidebar-search input {
1885
+ border-color: rgba(255,255,255,0.08);
1886
+ background: rgba(255,255,255,0.08);
1887
+ }
1888
+ }
1889
+ </style>
1890
+ `}
1891
+ </head>`);else if(q.includes("<style>"))q=q.replace("<style>",`${`
1892
+ <style id="craft-component-styles">
1893
+ /* Craft Component Base Styles */
1894
+ .craft-button {
1895
+ display: inline-flex;
1896
+ align-items: center;
1897
+ justify-content: center;
1898
+ padding: 8px 16px;
1899
+ border: none;
1900
+ border-radius: 6px;
1901
+ font-family: inherit;
1902
+ font-size: 14px;
1903
+ font-weight: 500;
1904
+ cursor: pointer;
1905
+ transition: all 0.2s ease;
1906
+ background: var(--craft-primary, #3b82f6);
1907
+ color: white;
1908
+ }
1909
+ .craft-button:hover { opacity: 0.9; }
1910
+ .craft-button:disabled { opacity: 0.5; cursor: not-allowed; }
1911
+ .craft-button-secondary { background: var(--craft-secondary, #6b7280); }
1912
+ .craft-button-outline { background: transparent; border: 1px solid currentColor; color: var(--craft-primary, #3b82f6); }
1913
+
1914
+ .craft-text-input, .craft-textarea, .craft-select {
1915
+ padding: 8px 12px;
1916
+ border: 1px solid var(--craft-border, #d1d5db);
1917
+ border-radius: 6px;
1918
+ font-family: inherit;
1919
+ font-size: 14px;
1920
+ background: var(--craft-bg, #fff);
1921
+ color: var(--craft-text, #1f2937);
1922
+ transition: border-color 0.2s ease;
1923
+ }
1924
+ .craft-text-input:focus, .craft-textarea:focus, .craft-select:focus {
1925
+ outline: none;
1926
+ border-color: var(--craft-primary, #3b82f6);
1927
+ box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
1928
+ }
1929
+
1930
+ .craft-checkbox-wrapper {
1931
+ display: inline-flex;
1932
+ align-items: center;
1933
+ gap: 8px;
1934
+ cursor: pointer;
1935
+ }
1936
+ .craft-checkbox {
1937
+ width: 18px;
1938
+ height: 18px;
1939
+ cursor: pointer;
1940
+ }
1941
+
1942
+ .craft-slider {
1943
+ width: 100%;
1944
+ height: 6px;
1945
+ border-radius: 3px;
1946
+ cursor: pointer;
1947
+ }
1948
+
1949
+ .craft-badge {
1950
+ display: inline-flex;
1951
+ align-items: center;
1952
+ padding: 2px 8px;
1953
+ border-radius: 9999px;
1954
+ font-size: 12px;
1955
+ font-weight: 500;
1956
+ background: var(--craft-primary, #3b82f6);
1957
+ color: white;
1958
+ }
1959
+
1960
+ .craft-avatar {
1961
+ display: inline-flex;
1962
+ align-items: center;
1963
+ justify-content: center;
1964
+ background: var(--craft-secondary, #6b7280);
1965
+ color: white;
1966
+ font-weight: 600;
1967
+ overflow: hidden;
1968
+ }
1969
+ .craft-avatar img { width: 100%; height: 100%; object-fit: cover; }
1970
+
1971
+ .craft-progress {
1972
+ width: 100%;
1973
+ height: 8px;
1974
+ background: var(--craft-border, #e5e7eb);
1975
+ border-radius: 4px;
1976
+ overflow: hidden;
1977
+ }
1978
+ .craft-progress-bar {
1979
+ height: 100%;
1980
+ background: var(--craft-primary, #3b82f6);
1981
+ transition: width 0.3s ease;
1982
+ }
1983
+
1984
+ .craft-spinner {
1985
+ border: 2px solid var(--craft-border, #e5e7eb);
1986
+ border-top-color: var(--craft-primary, #3b82f6);
1987
+ border-radius: 50%;
1988
+ animation: craft-spin 0.8s linear infinite;
1989
+ }
1990
+ @keyframes craft-spin { to { transform: rotate(360deg); } }
1991
+
1992
+ .craft-card {
1993
+ background: var(--craft-bg, #fff);
1994
+ border: 1px solid var(--craft-border, #e5e7eb);
1995
+ border-radius: 8px;
1996
+ padding: 16px;
1997
+ box-shadow: 0 1px 3px rgba(0,0,0,0.1);
1998
+ }
1999
+
2000
+ .craft-modal {
2001
+ border: none;
2002
+ border-radius: 12px;
2003
+ padding: 0;
2004
+ max-width: 90vw;
2005
+ max-height: 90vh;
2006
+ box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
2007
+ }
2008
+ .craft-modal::backdrop { background: rgba(0,0,0,0.5); }
2009
+ .craft-modal-header {
2010
+ padding: 16px 20px;
2011
+ border-bottom: 1px solid var(--craft-border, #e5e7eb);
2012
+ }
2013
+ .craft-modal-header h2 { margin: 0; font-size: 18px; }
2014
+ .craft-modal-body { padding: 20px; }
2015
+
2016
+ .craft-accordion {
2017
+ border: 1px solid var(--craft-border, #e5e7eb);
2018
+ border-radius: 6px;
2019
+ overflow: hidden;
2020
+ }
2021
+ .craft-accordion-header {
2022
+ padding: 12px 16px;
2023
+ cursor: pointer;
2024
+ font-weight: 500;
2025
+ background: var(--craft-bg-secondary, #f9fafb);
2026
+ }
2027
+ .craft-accordion-content { padding: 16px; }
2028
+
2029
+ .craft-divider {
2030
+ border: none;
2031
+ border-top: 1px solid var(--craft-border, #e5e7eb);
2032
+ margin: 16px 0;
2033
+ }
2034
+
2035
+ .craft-alert {
2036
+ padding: 12px 16px;
2037
+ border-radius: 6px;
2038
+ border-left: 4px solid;
2039
+ }
2040
+ .craft-alert-info { background: #eff6ff; border-color: #3b82f6; color: #1e40af; }
2041
+ .craft-alert-success { background: #f0fdf4; border-color: #22c55e; color: #166534; }
2042
+ .craft-alert-warning { background: #fffbeb; border-color: #f59e0b; color: #92400e; }
2043
+ .craft-alert-error { background: #fef2f2; border-color: #ef4444; color: #991b1b; }
2044
+ .craft-alert-title { font-weight: 600; margin-bottom: 4px; }
2045
+
2046
+ .craft-tooltip {
2047
+ position: relative;
2048
+ cursor: help;
2049
+ }
2050
+ .craft-tooltip::after {
2051
+ content: attr(data-tooltip);
2052
+ position: absolute;
2053
+ bottom: 100%;
2054
+ left: 50%;
2055
+ transform: translateX(-50%);
2056
+ padding: 4px 8px;
2057
+ background: #1f2937;
2058
+ color: white;
2059
+ font-size: 12px;
2060
+ border-radius: 4px;
2061
+ white-space: nowrap;
2062
+ opacity: 0;
2063
+ pointer-events: none;
2064
+ transition: opacity 0.2s;
2065
+ }
2066
+ .craft-tooltip:hover::after { opacity: 1; }
2067
+
2068
+ .craft-table {
2069
+ width: 100%;
2070
+ border-collapse: collapse;
2071
+ }
2072
+ .craft-table th, .craft-table td {
2073
+ padding: 12px;
2074
+ text-align: left;
2075
+ border-bottom: 1px solid var(--craft-border, #e5e7eb);
2076
+ }
2077
+ .craft-table th { font-weight: 600; background: var(--craft-bg-secondary, #f9fafb); }
2078
+
2079
+ .craft-list {
2080
+ list-style: none;
2081
+ padding: 0;
2082
+ margin: 0;
2083
+ }
2084
+ .craft-list li {
2085
+ padding: 12px;
2086
+ border-bottom: 1px solid var(--craft-border, #e5e7eb);
2087
+ }
2088
+ .craft-list li:last-child { border-bottom: none; }
2089
+
2090
+ .craft-sidebar {
2091
+ --craft-sidebar-width: 286px;
2092
+ --craft-sidebar-bg: rgba(255, 255, 255, 0.68);
2093
+ --craft-sidebar-border: rgba(255, 255, 255, 0.62);
2094
+ --craft-sidebar-shadow: 0 24px 70px rgba(15, 23, 42, 0.22), 0 1px 0 rgba(255, 255, 255, 0.72) inset;
2095
+ --craft-sidebar-text: rgba(24, 24, 27, 0.86);
2096
+ --craft-sidebar-muted: rgba(63, 63, 70, 0.62);
2097
+ --craft-sidebar-hover: rgba(255, 255, 255, 0.42);
2098
+ --craft-sidebar-selected: rgba(10, 132, 255, 0.86);
2099
+ position: relative;
2100
+ display: flex;
2101
+ flex-direction: column;
2102
+ width: var(--craft-sidebar-width);
2103
+ min-width: var(--craft-sidebar-width);
2104
+ height: 100vh;
2105
+ padding: 58px 10px 12px;
2106
+ color: var(--craft-sidebar-text);
2107
+ background:
2108
+ linear-gradient(135deg, rgba(255,255,255,0.28), rgba(255,255,255,0.08)),
2109
+ var(--craft-sidebar-bg);
2110
+ border: 1px solid var(--craft-sidebar-border);
2111
+ border-radius: 18px;
2112
+ box-shadow: var(--craft-sidebar-shadow);
2113
+ backdrop-filter: blur(34px) saturate(180%);
2114
+ -webkit-backdrop-filter: blur(34px) saturate(180%);
2115
+ overflow: hidden;
2116
+ user-select: none;
2117
+ }
2118
+ .craft-sidebar::before {
2119
+ content: "";
2120
+ position: absolute;
2121
+ inset: 0;
2122
+ pointer-events: none;
2123
+ background:
2124
+ radial-gradient(circle at 18% 0%, rgba(255,255,255,0.68), transparent 32%),
2125
+ linear-gradient(100deg, transparent 0%, rgba(255,255,255,0.30) 42%, transparent 58%);
2126
+ mix-blend-mode: screen;
2127
+ opacity: 0.72;
2128
+ }
2129
+ .craft-sidebar[data-native-active="true"] { display: none; }
2130
+ .craft-sidebar-search {
2131
+ position: relative;
2132
+ z-index: 1;
2133
+ margin: 0 0 12px;
2134
+ }
2135
+ .craft-sidebar-search input {
2136
+ width: 100%;
2137
+ min-height: 28px;
2138
+ padding: 5px 10px;
2139
+ border: 1px solid rgba(0, 0, 0, 0.05);
2140
+ border-radius: 8px;
2141
+ background: rgba(255, 255, 255, 0.34);
2142
+ color: inherit;
2143
+ font: inherit;
2144
+ font-size: 13px;
2145
+ outline: none;
2146
+ }
2147
+ .craft-sidebar-section {
2148
+ position: relative;
2149
+ z-index: 1;
2150
+ margin: 0 0 14px;
2151
+ }
2152
+ .craft-sidebar-section-title {
2153
+ padding: 0 8px 5px;
2154
+ color: var(--craft-sidebar-muted);
2155
+ font-size: 11px;
2156
+ font-weight: 700;
2157
+ letter-spacing: 0;
2158
+ text-transform: uppercase;
2159
+ }
2160
+ .craft-sidebar-item {
2161
+ width: calc(100% - 4px);
2162
+ min-height: 28px;
2163
+ margin: 1px 2px;
2164
+ padding: 5px 8px;
2165
+ display: flex;
2166
+ align-items: center;
2167
+ gap: 8px;
2168
+ border: 0;
2169
+ border-radius: 8px;
2170
+ background: transparent;
2171
+ color: inherit;
2172
+ font: inherit;
2173
+ font-size: 13px;
2174
+ text-align: left;
2175
+ cursor: default;
2176
+ }
2177
+ .craft-sidebar-item:hover { background: var(--craft-sidebar-hover); }
2178
+ .craft-sidebar-item[data-selected="true"] {
2179
+ color: white;
2180
+ background: var(--craft-sidebar-selected);
2181
+ box-shadow: 0 1px 0 rgba(255,255,255,0.22) inset, 0 8px 18px rgba(10, 132, 255, 0.22);
2182
+ }
2183
+ .craft-sidebar-item-icon {
2184
+ position: relative;
2185
+ display: inline-block;
2186
+ width: 16px;
2187
+ height: 16px;
2188
+ min-width: 16px;
2189
+ opacity: 0.82;
2190
+ overflow: hidden;
2191
+ color: transparent;
2192
+ }
2193
+ .craft-sidebar-item-icon::before {
2194
+ content: "";
2195
+ position: absolute;
2196
+ inset: 2px;
2197
+ border-radius: 4px;
2198
+ background: var(--craft-sidebar-icon-color, rgba(63, 63, 70, 0.62));
2199
+ box-shadow: 0 1px 0 rgba(255,255,255,0.24) inset;
2200
+ }
2201
+ .craft-sidebar-item-icon[data-icon*="circle"]::before {
2202
+ inset: 4px;
2203
+ border-radius: 999px;
2204
+ }
2205
+ .craft-sidebar-item[data-selected="true"] .craft-sidebar-item-icon::before {
2206
+ background: rgba(255, 255, 255, 0.9);
2207
+ }
2208
+ .craft-sidebar-item-label {
2209
+ flex: 1;
2210
+ overflow: hidden;
2211
+ white-space: nowrap;
2212
+ text-overflow: ellipsis;
2213
+ }
2214
+ .craft-sidebar-item-badge {
2215
+ min-width: 18px;
2216
+ padding: 1px 6px;
2217
+ border-radius: 999px;
2218
+ background: rgba(0, 0, 0, 0.08);
2219
+ color: var(--craft-sidebar-muted);
2220
+ font-size: 10px;
2221
+ font-weight: 700;
2222
+ text-align: center;
2223
+ }
2224
+ .craft-sidebar-item[data-selected="true"] .craft-sidebar-item-badge {
2225
+ color: white;
2226
+ background: rgba(255, 255, 255, 0.24);
2227
+ }
2228
+
2229
+ /* Spaces fallback. Stacked in document order behind a rail \u2014 legible without
2230
+ a native host, and deliberately not a second swipe implementation. */
2231
+ .craft-sidebar-spaces {
2232
+ position: relative;
2233
+ z-index: 1;
2234
+ flex: 1;
2235
+ min-height: 0;
2236
+ overflow-y: auto;
2237
+ }
2238
+ .craft-sidebar-space-title {
2239
+ padding: 10px 8px 4px;
2240
+ font-size: 13px;
2241
+ font-weight: 600;
2242
+ }
2243
+ .craft-sidebar-space-switcher {
2244
+ position: relative;
2245
+ z-index: 1;
2246
+ display: flex;
2247
+ align-items: center;
2248
+ gap: 1px;
2249
+ padding-top: 6px;
2250
+ }
2251
+ .craft-sidebar-space-tab {
2252
+ display: grid;
2253
+ place-items: center;
2254
+ width: 28px;
2255
+ height: 26px;
2256
+ border: 0;
2257
+ border-radius: 7px;
2258
+ background: transparent;
2259
+ color: inherit;
2260
+ font: inherit;
2261
+ font-size: 11px;
2262
+ font-weight: 700;
2263
+ opacity: 0.4;
2264
+ cursor: default;
2265
+ }
2266
+ .craft-sidebar-space-tab[data-selected="true"] {
2267
+ opacity: 1;
2268
+ background: rgba(255, 255, 255, 0.55);
2269
+ }
2270
+
2271
+ .craft-code-editor {
2272
+ font-family: 'SF Mono', 'Fira Code', monospace;
2273
+ font-size: 13px;
2274
+ line-height: 1.5;
2275
+ padding: 12px;
2276
+ background: #1e1e1e;
2277
+ color: #d4d4d4;
2278
+ border-radius: 6px;
2279
+ resize: vertical;
2280
+ }
2281
+
2282
+ /* Dark mode support */
2283
+ @media (prefers-color-scheme: dark) {
2284
+ .craft-text-input, .craft-textarea, .craft-select, .craft-card {
2285
+ background: #1f2937;
2286
+ color: #f3f4f6;
2287
+ border-color: #374151;
2288
+ }
2289
+ .craft-modal {
2290
+ background: #1f2937;
2291
+ color: #f3f4f6;
2292
+ }
2293
+ .craft-accordion-header { background: #374151; }
2294
+ .craft-table th { background: #374151; }
2295
+ .craft-sidebar {
2296
+ --craft-sidebar-bg: rgba(24, 24, 27, 0.58);
2297
+ --craft-sidebar-border: rgba(255, 255, 255, 0.12);
2298
+ --craft-sidebar-shadow: 0 26px 74px rgba(0, 0, 0, 0.44), 0 1px 0 rgba(255, 255, 255, 0.11) inset;
2299
+ --craft-sidebar-text: rgba(244, 244, 245, 0.92);
2300
+ --craft-sidebar-muted: rgba(212, 212, 216, 0.58);
2301
+ --craft-sidebar-hover: rgba(255, 255, 255, 0.10);
2302
+ }
2303
+ .craft-sidebar-search input {
2304
+ border-color: rgba(255,255,255,0.08);
2305
+ background: rgba(255,255,255,0.08);
2306
+ }
2307
+ }
2308
+ </style>
2309
+ `}
2310
+ <style>`);else q=`
2311
+ <style id="craft-component-styles">
2312
+ /* Craft Component Base Styles */
2313
+ .craft-button {
2314
+ display: inline-flex;
2315
+ align-items: center;
2316
+ justify-content: center;
2317
+ padding: 8px 16px;
2318
+ border: none;
2319
+ border-radius: 6px;
2320
+ font-family: inherit;
2321
+ font-size: 14px;
2322
+ font-weight: 500;
2323
+ cursor: pointer;
2324
+ transition: all 0.2s ease;
2325
+ background: var(--craft-primary, #3b82f6);
2326
+ color: white;
2327
+ }
2328
+ .craft-button:hover { opacity: 0.9; }
2329
+ .craft-button:disabled { opacity: 0.5; cursor: not-allowed; }
2330
+ .craft-button-secondary { background: var(--craft-secondary, #6b7280); }
2331
+ .craft-button-outline { background: transparent; border: 1px solid currentColor; color: var(--craft-primary, #3b82f6); }
2332
+
2333
+ .craft-text-input, .craft-textarea, .craft-select {
2334
+ padding: 8px 12px;
2335
+ border: 1px solid var(--craft-border, #d1d5db);
2336
+ border-radius: 6px;
2337
+ font-family: inherit;
2338
+ font-size: 14px;
2339
+ background: var(--craft-bg, #fff);
2340
+ color: var(--craft-text, #1f2937);
2341
+ transition: border-color 0.2s ease;
2342
+ }
2343
+ .craft-text-input:focus, .craft-textarea:focus, .craft-select:focus {
2344
+ outline: none;
2345
+ border-color: var(--craft-primary, #3b82f6);
2346
+ box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
2347
+ }
2348
+
2349
+ .craft-checkbox-wrapper {
2350
+ display: inline-flex;
2351
+ align-items: center;
2352
+ gap: 8px;
2353
+ cursor: pointer;
2354
+ }
2355
+ .craft-checkbox {
2356
+ width: 18px;
2357
+ height: 18px;
2358
+ cursor: pointer;
2359
+ }
2360
+
2361
+ .craft-slider {
2362
+ width: 100%;
2363
+ height: 6px;
2364
+ border-radius: 3px;
2365
+ cursor: pointer;
2366
+ }
2367
+
2368
+ .craft-badge {
2369
+ display: inline-flex;
2370
+ align-items: center;
2371
+ padding: 2px 8px;
2372
+ border-radius: 9999px;
2373
+ font-size: 12px;
2374
+ font-weight: 500;
2375
+ background: var(--craft-primary, #3b82f6);
2376
+ color: white;
2377
+ }
2378
+
2379
+ .craft-avatar {
2380
+ display: inline-flex;
2381
+ align-items: center;
2382
+ justify-content: center;
2383
+ background: var(--craft-secondary, #6b7280);
2384
+ color: white;
2385
+ font-weight: 600;
2386
+ overflow: hidden;
2387
+ }
2388
+ .craft-avatar img { width: 100%; height: 100%; object-fit: cover; }
2389
+
2390
+ .craft-progress {
2391
+ width: 100%;
2392
+ height: 8px;
2393
+ background: var(--craft-border, #e5e7eb);
2394
+ border-radius: 4px;
2395
+ overflow: hidden;
2396
+ }
2397
+ .craft-progress-bar {
2398
+ height: 100%;
2399
+ background: var(--craft-primary, #3b82f6);
2400
+ transition: width 0.3s ease;
2401
+ }
2402
+
2403
+ .craft-spinner {
2404
+ border: 2px solid var(--craft-border, #e5e7eb);
2405
+ border-top-color: var(--craft-primary, #3b82f6);
2406
+ border-radius: 50%;
2407
+ animation: craft-spin 0.8s linear infinite;
2408
+ }
2409
+ @keyframes craft-spin { to { transform: rotate(360deg); } }
2410
+
2411
+ .craft-card {
2412
+ background: var(--craft-bg, #fff);
2413
+ border: 1px solid var(--craft-border, #e5e7eb);
2414
+ border-radius: 8px;
2415
+ padding: 16px;
2416
+ box-shadow: 0 1px 3px rgba(0,0,0,0.1);
2417
+ }
2418
+
2419
+ .craft-modal {
2420
+ border: none;
2421
+ border-radius: 12px;
2422
+ padding: 0;
2423
+ max-width: 90vw;
2424
+ max-height: 90vh;
2425
+ box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
2426
+ }
2427
+ .craft-modal::backdrop { background: rgba(0,0,0,0.5); }
2428
+ .craft-modal-header {
2429
+ padding: 16px 20px;
2430
+ border-bottom: 1px solid var(--craft-border, #e5e7eb);
2431
+ }
2432
+ .craft-modal-header h2 { margin: 0; font-size: 18px; }
2433
+ .craft-modal-body { padding: 20px; }
2434
+
2435
+ .craft-accordion {
2436
+ border: 1px solid var(--craft-border, #e5e7eb);
2437
+ border-radius: 6px;
2438
+ overflow: hidden;
2439
+ }
2440
+ .craft-accordion-header {
2441
+ padding: 12px 16px;
2442
+ cursor: pointer;
2443
+ font-weight: 500;
2444
+ background: var(--craft-bg-secondary, #f9fafb);
2445
+ }
2446
+ .craft-accordion-content { padding: 16px; }
2447
+
2448
+ .craft-divider {
2449
+ border: none;
2450
+ border-top: 1px solid var(--craft-border, #e5e7eb);
2451
+ margin: 16px 0;
2452
+ }
2453
+
2454
+ .craft-alert {
2455
+ padding: 12px 16px;
2456
+ border-radius: 6px;
2457
+ border-left: 4px solid;
2458
+ }
2459
+ .craft-alert-info { background: #eff6ff; border-color: #3b82f6; color: #1e40af; }
2460
+ .craft-alert-success { background: #f0fdf4; border-color: #22c55e; color: #166534; }
2461
+ .craft-alert-warning { background: #fffbeb; border-color: #f59e0b; color: #92400e; }
2462
+ .craft-alert-error { background: #fef2f2; border-color: #ef4444; color: #991b1b; }
2463
+ .craft-alert-title { font-weight: 600; margin-bottom: 4px; }
2464
+
2465
+ .craft-tooltip {
2466
+ position: relative;
2467
+ cursor: help;
2468
+ }
2469
+ .craft-tooltip::after {
2470
+ content: attr(data-tooltip);
2471
+ position: absolute;
2472
+ bottom: 100%;
2473
+ left: 50%;
2474
+ transform: translateX(-50%);
2475
+ padding: 4px 8px;
2476
+ background: #1f2937;
2477
+ color: white;
2478
+ font-size: 12px;
2479
+ border-radius: 4px;
2480
+ white-space: nowrap;
2481
+ opacity: 0;
2482
+ pointer-events: none;
2483
+ transition: opacity 0.2s;
2484
+ }
2485
+ .craft-tooltip:hover::after { opacity: 1; }
2486
+
2487
+ .craft-table {
2488
+ width: 100%;
2489
+ border-collapse: collapse;
2490
+ }
2491
+ .craft-table th, .craft-table td {
2492
+ padding: 12px;
2493
+ text-align: left;
2494
+ border-bottom: 1px solid var(--craft-border, #e5e7eb);
2495
+ }
2496
+ .craft-table th { font-weight: 600; background: var(--craft-bg-secondary, #f9fafb); }
2497
+
2498
+ .craft-list {
2499
+ list-style: none;
2500
+ padding: 0;
2501
+ margin: 0;
2502
+ }
2503
+ .craft-list li {
2504
+ padding: 12px;
2505
+ border-bottom: 1px solid var(--craft-border, #e5e7eb);
2506
+ }
2507
+ .craft-list li:last-child { border-bottom: none; }
2508
+
2509
+ .craft-sidebar {
2510
+ --craft-sidebar-width: 286px;
2511
+ --craft-sidebar-bg: rgba(255, 255, 255, 0.68);
2512
+ --craft-sidebar-border: rgba(255, 255, 255, 0.62);
2513
+ --craft-sidebar-shadow: 0 24px 70px rgba(15, 23, 42, 0.22), 0 1px 0 rgba(255, 255, 255, 0.72) inset;
2514
+ --craft-sidebar-text: rgba(24, 24, 27, 0.86);
2515
+ --craft-sidebar-muted: rgba(63, 63, 70, 0.62);
2516
+ --craft-sidebar-hover: rgba(255, 255, 255, 0.42);
2517
+ --craft-sidebar-selected: rgba(10, 132, 255, 0.86);
2518
+ position: relative;
2519
+ display: flex;
2520
+ flex-direction: column;
2521
+ width: var(--craft-sidebar-width);
2522
+ min-width: var(--craft-sidebar-width);
2523
+ height: 100vh;
2524
+ padding: 58px 10px 12px;
2525
+ color: var(--craft-sidebar-text);
2526
+ background:
2527
+ linear-gradient(135deg, rgba(255,255,255,0.28), rgba(255,255,255,0.08)),
2528
+ var(--craft-sidebar-bg);
2529
+ border: 1px solid var(--craft-sidebar-border);
2530
+ border-radius: 18px;
2531
+ box-shadow: var(--craft-sidebar-shadow);
2532
+ backdrop-filter: blur(34px) saturate(180%);
2533
+ -webkit-backdrop-filter: blur(34px) saturate(180%);
2534
+ overflow: hidden;
2535
+ user-select: none;
2536
+ }
2537
+ .craft-sidebar::before {
2538
+ content: "";
2539
+ position: absolute;
2540
+ inset: 0;
2541
+ pointer-events: none;
2542
+ background:
2543
+ radial-gradient(circle at 18% 0%, rgba(255,255,255,0.68), transparent 32%),
2544
+ linear-gradient(100deg, transparent 0%, rgba(255,255,255,0.30) 42%, transparent 58%);
2545
+ mix-blend-mode: screen;
2546
+ opacity: 0.72;
2547
+ }
2548
+ .craft-sidebar[data-native-active="true"] { display: none; }
2549
+ .craft-sidebar-search {
2550
+ position: relative;
2551
+ z-index: 1;
2552
+ margin: 0 0 12px;
2553
+ }
2554
+ .craft-sidebar-search input {
2555
+ width: 100%;
2556
+ min-height: 28px;
2557
+ padding: 5px 10px;
2558
+ border: 1px solid rgba(0, 0, 0, 0.05);
2559
+ border-radius: 8px;
2560
+ background: rgba(255, 255, 255, 0.34);
2561
+ color: inherit;
2562
+ font: inherit;
2563
+ font-size: 13px;
2564
+ outline: none;
2565
+ }
2566
+ .craft-sidebar-section {
2567
+ position: relative;
2568
+ z-index: 1;
2569
+ margin: 0 0 14px;
2570
+ }
2571
+ .craft-sidebar-section-title {
2572
+ padding: 0 8px 5px;
2573
+ color: var(--craft-sidebar-muted);
2574
+ font-size: 11px;
2575
+ font-weight: 700;
2576
+ letter-spacing: 0;
2577
+ text-transform: uppercase;
2578
+ }
2579
+ .craft-sidebar-item {
2580
+ width: calc(100% - 4px);
2581
+ min-height: 28px;
2582
+ margin: 1px 2px;
2583
+ padding: 5px 8px;
2584
+ display: flex;
2585
+ align-items: center;
2586
+ gap: 8px;
2587
+ border: 0;
2588
+ border-radius: 8px;
2589
+ background: transparent;
2590
+ color: inherit;
2591
+ font: inherit;
2592
+ font-size: 13px;
2593
+ text-align: left;
2594
+ cursor: default;
2595
+ }
2596
+ .craft-sidebar-item:hover { background: var(--craft-sidebar-hover); }
2597
+ .craft-sidebar-item[data-selected="true"] {
2598
+ color: white;
2599
+ background: var(--craft-sidebar-selected);
2600
+ box-shadow: 0 1px 0 rgba(255,255,255,0.22) inset, 0 8px 18px rgba(10, 132, 255, 0.22);
2601
+ }
2602
+ .craft-sidebar-item-icon {
2603
+ position: relative;
2604
+ display: inline-block;
2605
+ width: 16px;
2606
+ height: 16px;
2607
+ min-width: 16px;
2608
+ opacity: 0.82;
2609
+ overflow: hidden;
2610
+ color: transparent;
2611
+ }
2612
+ .craft-sidebar-item-icon::before {
2613
+ content: "";
2614
+ position: absolute;
2615
+ inset: 2px;
2616
+ border-radius: 4px;
2617
+ background: var(--craft-sidebar-icon-color, rgba(63, 63, 70, 0.62));
2618
+ box-shadow: 0 1px 0 rgba(255,255,255,0.24) inset;
2619
+ }
2620
+ .craft-sidebar-item-icon[data-icon*="circle"]::before {
2621
+ inset: 4px;
2622
+ border-radius: 999px;
2623
+ }
2624
+ .craft-sidebar-item[data-selected="true"] .craft-sidebar-item-icon::before {
2625
+ background: rgba(255, 255, 255, 0.9);
2626
+ }
2627
+ .craft-sidebar-item-label {
2628
+ flex: 1;
2629
+ overflow: hidden;
2630
+ white-space: nowrap;
2631
+ text-overflow: ellipsis;
2632
+ }
2633
+ .craft-sidebar-item-badge {
2634
+ min-width: 18px;
2635
+ padding: 1px 6px;
2636
+ border-radius: 999px;
2637
+ background: rgba(0, 0, 0, 0.08);
2638
+ color: var(--craft-sidebar-muted);
2639
+ font-size: 10px;
2640
+ font-weight: 700;
2641
+ text-align: center;
2642
+ }
2643
+ .craft-sidebar-item[data-selected="true"] .craft-sidebar-item-badge {
2644
+ color: white;
2645
+ background: rgba(255, 255, 255, 0.24);
2646
+ }
2647
+
2648
+ /* Spaces fallback. Stacked in document order behind a rail \u2014 legible without
2649
+ a native host, and deliberately not a second swipe implementation. */
2650
+ .craft-sidebar-spaces {
2651
+ position: relative;
2652
+ z-index: 1;
2653
+ flex: 1;
2654
+ min-height: 0;
2655
+ overflow-y: auto;
2656
+ }
2657
+ .craft-sidebar-space-title {
2658
+ padding: 10px 8px 4px;
2659
+ font-size: 13px;
2660
+ font-weight: 600;
2661
+ }
2662
+ .craft-sidebar-space-switcher {
2663
+ position: relative;
2664
+ z-index: 1;
2665
+ display: flex;
2666
+ align-items: center;
2667
+ gap: 1px;
2668
+ padding-top: 6px;
2669
+ }
2670
+ .craft-sidebar-space-tab {
2671
+ display: grid;
2672
+ place-items: center;
2673
+ width: 28px;
2674
+ height: 26px;
2675
+ border: 0;
2676
+ border-radius: 7px;
2677
+ background: transparent;
2678
+ color: inherit;
2679
+ font: inherit;
2680
+ font-size: 11px;
2681
+ font-weight: 700;
2682
+ opacity: 0.4;
2683
+ cursor: default;
2684
+ }
2685
+ .craft-sidebar-space-tab[data-selected="true"] {
2686
+ opacity: 1;
2687
+ background: rgba(255, 255, 255, 0.55);
2688
+ }
2689
+
2690
+ .craft-code-editor {
2691
+ font-family: 'SF Mono', 'Fira Code', monospace;
2692
+ font-size: 13px;
2693
+ line-height: 1.5;
2694
+ padding: 12px;
2695
+ background: #1e1e1e;
2696
+ color: #d4d4d4;
2697
+ border-radius: 6px;
2698
+ resize: vertical;
2699
+ }
2700
+
2701
+ /* Dark mode support */
2702
+ @media (prefers-color-scheme: dark) {
2703
+ .craft-text-input, .craft-textarea, .craft-select, .craft-card {
2704
+ background: #1f2937;
2705
+ color: #f3f4f6;
2706
+ border-color: #374151;
2707
+ }
2708
+ .craft-modal {
2709
+ background: #1f2937;
2710
+ color: #f3f4f6;
2711
+ }
2712
+ .craft-accordion-header { background: #374151; }
2713
+ .craft-table th { background: #374151; }
2714
+ .craft-sidebar {
2715
+ --craft-sidebar-bg: rgba(24, 24, 27, 0.58);
2716
+ --craft-sidebar-border: rgba(255, 255, 255, 0.12);
2717
+ --craft-sidebar-shadow: 0 26px 74px rgba(0, 0, 0, 0.44), 0 1px 0 rgba(255, 255, 255, 0.11) inset;
2718
+ --craft-sidebar-text: rgba(244, 244, 245, 0.92);
2719
+ --craft-sidebar-muted: rgba(212, 212, 216, 0.58);
2720
+ --craft-sidebar-hover: rgba(255, 255, 255, 0.10);
2721
+ }
2722
+ .craft-sidebar-search input {
2723
+ border-color: rgba(255,255,255,0.08);
2724
+ background: rgba(255,255,255,0.08);
2725
+ }
2726
+ }
2727
+ </style>
2728
+ `+q;if(!q.includes("craft-component-runtime"))if(q.includes("</body>"))q=q.replace("</body>",`${`
2729
+ <script id="craft-component-runtime">
2730
+ (function() {
2731
+ if (window.__stxCraftComponentRuntime) return;
2732
+ window.__stxCraftComponentRuntime = true;
2733
+
2734
+ function parseConfig(sidebar) {
2735
+ var id = sidebar.getAttribute('data-craft-sidebar-id');
2736
+ var script = id && document.querySelector('script[data-craft-sidebar-config="' + id + '"]');
2737
+ if (!script) return null;
2738
+ try {
2739
+ return JSON.parse(script.textContent || '{}');
2740
+ } catch (error) {
2741
+ console.warn('[stx] Invalid Craft sidebar config', error);
2742
+ return null;
2743
+ }
2744
+ }
2745
+
2746
+ function getNativeUI() {
2747
+ if (!window.craft) return null;
2748
+ var hasNativeHost = window.craft.isCraft?.() ||
2749
+ !!(window.webkit?.messageHandlers?.craft || window.CraftBridge || window.craftIPC);
2750
+ if (!hasNativeHost) return null;
2751
+ return window.craft.nativeUI || window.craft.components;
2752
+ }
2753
+
2754
+ function initializeSidebar(sidebar) {
2755
+ if (sidebar.dataset.craftInitialized === 'true') return;
2756
+ if (sidebar.dataset.native === 'false') return;
2757
+
2758
+ var nativeUI = getNativeUI();
2759
+ if (!nativeUI || typeof nativeUI.createSidebar !== 'function') return;
2760
+
2761
+ var config = parseConfig(sidebar);
2762
+ if (!config) return;
2763
+
2764
+ var hasSpaces = !!(config.spaces && config.spaces.length);
2765
+ // Spaces need a host that can swipe between whole scenes. Falling back to
2766
+ // createSidebar would flatten every space into one list, which is worse
2767
+ // than the web rendering already on the page \u2014 so leave that in place.
2768
+ if (hasSpaces && typeof nativeUI.createSpacesSidebar !== 'function') return;
2769
+
2770
+ try {
2771
+ var nativeConfig = Object.assign({}, config);
2772
+ delete nativeConfig.sections;
2773
+ delete nativeConfig.spaces;
2774
+
2775
+ var nativeSidebar = hasSpaces
2776
+ ? nativeUI.createSpacesSidebar(nativeConfig)
2777
+ : nativeUI.createSidebar(nativeConfig);
2778
+
2779
+ if (nativeSidebar && hasSpaces && nativeSidebar.setSpaces) {
2780
+ nativeSidebar.setSpaces(config.spaces);
2781
+ }
2782
+ if (nativeSidebar && hasSpaces && config.selectedSpace && nativeSidebar.setActiveSpace) {
2783
+ nativeSidebar.setActiveSpace(config.selectedSpace);
2784
+ }
2785
+ if (nativeSidebar && hasSpaces && nativeSidebar.onSpaceChange) {
2786
+ nativeSidebar.onSpaceChange(function(spaceId) {
2787
+ sidebar.dispatchEvent(new CustomEvent('craft-sidebar:space', {
2788
+ bubbles: true,
2789
+ detail: { spaceId: spaceId, sidebarId: config.id }
2790
+ }));
2791
+ });
2792
+ }
2793
+ if (nativeSidebar && !hasSpaces && config.sections) {
2794
+ config.sections.forEach(function(section) {
2795
+ if (nativeSidebar.addSection) nativeSidebar.addSection(section);
2796
+ });
2797
+ }
2798
+ if (nativeSidebar && config.selectedItem && nativeSidebar.setSelectedItem) {
2799
+ nativeSidebar.setSelectedItem(config.selectedItem);
2800
+ }
2801
+ if (nativeSidebar && nativeSidebar.onSelect) {
2802
+ nativeSidebar.onSelect(function(itemId) {
2803
+ sidebar.dispatchEvent(new CustomEvent('craft-sidebar:select', {
2804
+ bubbles: true,
2805
+ detail: { itemId: itemId, sidebarId: config.id }
2806
+ }));
2807
+ });
2808
+ }
2809
+ sidebar.dataset.craftInitialized = 'true';
2810
+ sidebar.dataset.nativeActive = 'true';
2811
+ window.__stxCraftNativeSidebars = window.__stxCraftNativeSidebars || {};
2812
+ window.__stxCraftNativeSidebars[config.id] = nativeSidebar;
2813
+ } catch (error) {
2814
+ sidebar.dataset.nativeError = error.message || 'unknown';
2815
+ console.warn('[stx] Failed to create native Craft sidebar', error);
2816
+ }
2817
+ }
2818
+
2819
+ function initializeCraftComponents() {
2820
+ document.querySelectorAll('[data-craft-native-sidebar]').forEach(initializeSidebar);
2821
+ }
2822
+
2823
+ if (document.readyState === 'loading') {
2824
+ document.addEventListener('DOMContentLoaded', initializeCraftComponents);
2825
+ } else {
2826
+ initializeCraftComponents();
2827
+ }
2828
+ window.addEventListener('craft:ready', initializeCraftComponents);
2829
+ document.addEventListener('craft:nativeui:ready', initializeCraftComponents);
2830
+ })();
2831
+ </script>
2832
+ `}
2833
+ </body>`);else q+=`
2834
+ <script id="craft-component-runtime">
2835
+ (function() {
2836
+ if (window.__stxCraftComponentRuntime) return;
2837
+ window.__stxCraftComponentRuntime = true;
2838
+
2839
+ function parseConfig(sidebar) {
2840
+ var id = sidebar.getAttribute('data-craft-sidebar-id');
2841
+ var script = id && document.querySelector('script[data-craft-sidebar-config="' + id + '"]');
2842
+ if (!script) return null;
2843
+ try {
2844
+ return JSON.parse(script.textContent || '{}');
2845
+ } catch (error) {
2846
+ console.warn('[stx] Invalid Craft sidebar config', error);
2847
+ return null;
2848
+ }
2849
+ }
2850
+
2851
+ function getNativeUI() {
2852
+ if (!window.craft) return null;
2853
+ var hasNativeHost = window.craft.isCraft?.() ||
2854
+ !!(window.webkit?.messageHandlers?.craft || window.CraftBridge || window.craftIPC);
2855
+ if (!hasNativeHost) return null;
2856
+ return window.craft.nativeUI || window.craft.components;
2857
+ }
2858
+
2859
+ function initializeSidebar(sidebar) {
2860
+ if (sidebar.dataset.craftInitialized === 'true') return;
2861
+ if (sidebar.dataset.native === 'false') return;
2862
+
2863
+ var nativeUI = getNativeUI();
2864
+ if (!nativeUI || typeof nativeUI.createSidebar !== 'function') return;
2865
+
2866
+ var config = parseConfig(sidebar);
2867
+ if (!config) return;
2868
+
2869
+ var hasSpaces = !!(config.spaces && config.spaces.length);
2870
+ // Spaces need a host that can swipe between whole scenes. Falling back to
2871
+ // createSidebar would flatten every space into one list, which is worse
2872
+ // than the web rendering already on the page \u2014 so leave that in place.
2873
+ if (hasSpaces && typeof nativeUI.createSpacesSidebar !== 'function') return;
2874
+
2875
+ try {
2876
+ var nativeConfig = Object.assign({}, config);
2877
+ delete nativeConfig.sections;
2878
+ delete nativeConfig.spaces;
2879
+
2880
+ var nativeSidebar = hasSpaces
2881
+ ? nativeUI.createSpacesSidebar(nativeConfig)
2882
+ : nativeUI.createSidebar(nativeConfig);
2883
+
2884
+ if (nativeSidebar && hasSpaces && nativeSidebar.setSpaces) {
2885
+ nativeSidebar.setSpaces(config.spaces);
2886
+ }
2887
+ if (nativeSidebar && hasSpaces && config.selectedSpace && nativeSidebar.setActiveSpace) {
2888
+ nativeSidebar.setActiveSpace(config.selectedSpace);
2889
+ }
2890
+ if (nativeSidebar && hasSpaces && nativeSidebar.onSpaceChange) {
2891
+ nativeSidebar.onSpaceChange(function(spaceId) {
2892
+ sidebar.dispatchEvent(new CustomEvent('craft-sidebar:space', {
2893
+ bubbles: true,
2894
+ detail: { spaceId: spaceId, sidebarId: config.id }
2895
+ }));
2896
+ });
2897
+ }
2898
+ if (nativeSidebar && !hasSpaces && config.sections) {
2899
+ config.sections.forEach(function(section) {
2900
+ if (nativeSidebar.addSection) nativeSidebar.addSection(section);
2901
+ });
2902
+ }
2903
+ if (nativeSidebar && config.selectedItem && nativeSidebar.setSelectedItem) {
2904
+ nativeSidebar.setSelectedItem(config.selectedItem);
2905
+ }
2906
+ if (nativeSidebar && nativeSidebar.onSelect) {
2907
+ nativeSidebar.onSelect(function(itemId) {
2908
+ sidebar.dispatchEvent(new CustomEvent('craft-sidebar:select', {
2909
+ bubbles: true,
2910
+ detail: { itemId: itemId, sidebarId: config.id }
2911
+ }));
2912
+ });
2913
+ }
2914
+ sidebar.dataset.craftInitialized = 'true';
2915
+ sidebar.dataset.nativeActive = 'true';
2916
+ window.__stxCraftNativeSidebars = window.__stxCraftNativeSidebars || {};
2917
+ window.__stxCraftNativeSidebars[config.id] = nativeSidebar;
2918
+ } catch (error) {
2919
+ sidebar.dataset.nativeError = error.message || 'unknown';
2920
+ console.warn('[stx] Failed to create native Craft sidebar', error);
2921
+ }
2922
+ }
2923
+
2924
+ function initializeCraftComponents() {
2925
+ document.querySelectorAll('[data-craft-native-sidebar]').forEach(initializeSidebar);
2926
+ }
2927
+
2928
+ if (document.readyState === 'loading') {
2929
+ document.addEventListener('DOMContentLoaded', initializeCraftComponents);
2930
+ } else {
2931
+ initializeCraftComponents();
2932
+ }
2933
+ window.addEventListener('craft:ready', initializeCraftComponents);
2934
+ document.addEventListener('craft:nativeui:ready', initializeCraftComponents);
2935
+ })();
2936
+ </script>
2937
+ `;return q=q.replace(/<@craft-sidebar(?![-\w])\s*([^>]*)>([\s\S]*?)<\/@craft-sidebar>/g,(J,W,K)=>{return C("sidebar",W,K.trim(),U,$)}),q=q.replace(/<@craft-sidebar(?![-\w])\s*([^>]*?)\/>/g,(J,W)=>{return C("sidebar",W,"",U,$)}),q=q.replace(/<@craft-(\w+[-\w]*)\s*([^>]*?)\/>/g,(J,W,K)=>{return C(W,K,"",U,$)}),q=q.replace(/<@craft-(\w+[-\w]*)\s*([^>]*)>([\s\S]*?)<\/@craft-\1>/g,(J,W,K,Y)=>{return C(W,K,Y.trim(),U,$)}),q}function C(q,U,$,J,W){let K=J.components?.[q]||b[q];if(!K)return console.warn(`[stx] Unknown Craft component: @craft-${q}`),`<div class="${W}-unknown" data-component="${q}">${$}</div>`;let Y=y(U),L=[K.fallbackClasses||`${W}-${q}`];if(Y.class)L.push(Y.class),delete Y.class;if(K.render)return Y.__fallbackClasses=L.join(" "),K.render(Y,$);let Q=Wq(Y,K,L);if(["input","hr","br","img"].includes(K.fallbackTag))return`<${K.fallbackTag} ${Q}>`;return`<${K.fallbackTag} ${Q}>${$}</${K.fallbackTag}>`}function y(q){let U={},$=/(?::|@)?(\w+[-\w]*)(?:=(?:"([^"]*)"|'([^']*)'))?/g,J;while((J=$.exec(q))!==null){let[W,K,Y,L]=J,Q=Y??L;if(W.startsWith(":"))U[K]=Q;else if(W.startsWith("@"))U[`on${K.charAt(0).toUpperCase()}${K.slice(1)}`]=Q;else if(Q===void 0)U[K]=!0;else U[K]=Q}return U}function r(q,U){let $=k(String(q.id||`craft-sidebar-${$q(U||JSON.stringify(q))}`)),J=qq(q.spaces)||e(U),W=J.length?[]:Uq(q.sections)||d(U),K=String(q.selectedSpace||J[0]?.id||""),Y=J.find((E)=>E.id===K)||J[0],L=String(q.selectedItem||q.selected||(J.length?Y?.sections[0]?.items[0]?.id:W[0]?.items[0]?.id)||""),Q={id:$,variant:String(q.variant||"desktop"),material:String(q.material||"sidebar"),backgroundEffect:String(q.backgroundEffect||"shimmer"),allowsVibrancy:q.allowsVibrancy!==!1&&q.allowsVibrancy!=="false",materialOpacity:Number(q.materialOpacity??0.68),materialDarkOpacity:q.materialDarkOpacity===void 0?void 0:Number(q.materialDarkOpacity),minWidth:q.minWidth===void 0?240:Number(q.minWidth),maxWidth:q.maxWidth===void 0?340:Number(q.maxWidth),canCollapse:q.canCollapse!==!1&&q.canCollapse!=="false",searchPlaceholder:q.searchPlaceholder?String(q.searchPlaceholder):void 0,selectedItem:L,sections:W,spaces:J,selectedSpace:K||void 0},X=String(q.__fallbackClasses||"craft-sidebar craft-sidebar-tahoe"),w=Number(q.width||q.sidebarWidth||286),G=q.native===!1||q.native==="false"?"false":"true",B=Q.searchPlaceholder?`<div class="craft-sidebar-search"><input type="search" placeholder="${O(Q.searchPlaceholder)}"></div>`:"",_;if(J.length)_=Kq(J,K,L);else if(W.length)_=W.map((E)=>g(E,L)).join("");else _=U;return`<aside class="${R(X)}" data-craft="craft-sidebar" data-craft-native-sidebar data-craft-sidebar-id="${R($)}" data-native="${G}" style="--craft-sidebar-width:${w}px">
2938
+ ${B}
2939
+ ${_}
2940
+ </aside>
2941
+ <script type="application/json" data-craft-sidebar-config="${R($)}">${Jq(Q)}</script>`}function a(q,U){let $=k(String(q.id||q.label||"space"));return`<section class="craft-sidebar-space" data-craft="craft-sidebar-space" data-space-id="${R($)}">
2942
+ ${q.label?`<div class="craft-sidebar-space-title">${O(String(q.label))}</div>`:""}
2943
+ ${U}
2944
+ </section>`}function t(q,U){let $=String(q.header||q.title||"");return`<section class="craft-sidebar-section" data-craft="craft-sidebar-section" data-section-id="${R(String(q.id||"section"))}">
2945
+ ${$?`<div class="craft-sidebar-section-title">${O($)}</div>`:""}
2946
+ ${U}
2947
+ </section>`}function o(q,U){let $={id:String(q.id||k(String(q.label||U||"item"))),label:String(q.label||U||""),icon:q.icon?String(q.icon):void 0,badge:q.badge?String(q.badge):void 0,tintColor:q.tintColor?String(q.tintColor):void 0};return f($,String(q.selected||"")==="true")}function d(q){let U=[],$=/<@craft-sidebar-section\s*([^>]*?)(?:\/>|>([\s\S]*?)<\/@craft-sidebar-section>)/g,J;while((J=$.exec(q))!==null){let W=y(J[1]||""),K=J[2]||"",Y=String(W.id||k(String(W.header||W.title||`section-${U.length+1}`))),L=String(W.header||W.title||Y),Q=p(K);U.push({id:Y,header:L,title:L,items:Q})}return U}function p(q){let U=[],$=/<@craft-sidebar-item\s*([^>]*?)(?:\/>|>([\s\S]*?)<\/@craft-sidebar-item>)/g,J;while((J=$.exec(q))!==null){let W=y(J[1]||""),K=String(W.label||(J[2]||"").replace(/<[^>]*>/g,"").trim()),Y=String(W.id||k(K||`item-${U.length+1}`));U.push({id:Y,label:K,icon:W.icon?String(W.icon):void 0,badge:W.badge?String(W.badge):void 0,tintColor:W.tintColor?String(W.tintColor):void 0})}return U}function e(q){let U=[],$=/<@craft-sidebar-space\s*([^>]*?)(?:\/>|>([\s\S]*?)<\/@craft-sidebar-space>)/g,J;while((J=$.exec(q))!==null){let W=y(J[1]||""),K=J[2]||"",Y=String(W.label||W.title||`Space ${U.length+1}`);U.push({id:String(W.id||k(Y)),label:Y,icon:W.icon?String(W.icon):void 0,tint:W.tint?String(W.tint):void 0,sections:d(K)})}return U}function qq(q){if(!q)return;if(Array.isArray(q))return q;if(typeof q!=="string")return;try{let U=JSON.parse(q);return Array.isArray(U)?U:void 0}catch{return}}function Kq(q,U,$){let J=q.map((K)=>`<button class="craft-sidebar-space-tab" type="button" data-space-target="${R(K.id)}" data-selected="${K.id===U?"true":"false"}" title="${R(K.label||K.id)}">${K.icon?`<span class="craft-sidebar-item-icon" data-icon="${R(K.icon)}"></span>`:O((K.label||K.id).charAt(0))}</button>`).join("");return`<div class="craft-sidebar-spaces">${q.map((K)=>`<section class="craft-sidebar-space" data-space-id="${R(K.id)}" data-selected="${K.id===U?"true":"false"}">
2948
+ ${K.label?`<div class="craft-sidebar-space-title">${O(K.label)}</div>`:""}
2949
+ ${K.sections.map((Y)=>g(Y,$)).join("")}
2950
+ </section>`).join("")}</div>
2951
+ <div class="craft-sidebar-space-switcher">${J}</div>`}function Uq(q){if(!q)return;if(Array.isArray(q))return q;if(typeof q!=="string")return;try{let U=JSON.parse(q);return Array.isArray(U)?U:void 0}catch{return}}function g(q,U){let $=q.header||q.title||q.id;return`<section class="craft-sidebar-section" data-section-id="${R(q.id)}">
2952
+ <div class="craft-sidebar-section-title">${O($)}</div>
2953
+ ${q.items.map((J)=>f(J,J.id===U)).join("")}
2954
+ </section>`}function f(q,U){let $=q.tintColor?` style="--craft-sidebar-icon-color:${R(q.tintColor)}"`:"";return`<button class="craft-sidebar-item" type="button" data-item-id="${R(q.id)}" data-selected="${U?"true":"false"}">
2955
+ ${q.icon?`<span class="craft-sidebar-item-icon" data-icon="${R(q.icon)}"${$}></span>`:""}
2956
+ <span class="craft-sidebar-item-label">${O(q.label)}</span>
2957
+ ${q.badge?`<span class="craft-sidebar-item-badge">${O(q.badge)}</span>`:""}
2958
+ </button>`}function k(q){return q.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-|-$/g,"")||"craft-sidebar"}function $q(q){let U=5381;for(let $=0;$<q.length;$++)U=U*33^q.charCodeAt($);return(U>>>0).toString(36)}function O(q){return q.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function R(q){return O(q).replace(/`/g,"&#96;")}function Jq(q){return JSON.stringify(q).replace(/</g,"\\u003c").replace(/>/g,"\\u003e").replace(/&/g,"\\u0026")}function Wq(q,U,$){let J=[];J.push(`class="${$.join(" ")}"`),J.push(`data-craft="${U.nativeType}"`);for(let[W,K]of Object.entries(q))if(K===!0)J.push(W);else if(K!==!1&&K!==void 0&&K!==null){let Y=String(K).replace(/"/g,"&quot;");J.push(`${W}="${Y}"`)}return J.join(" ")}function Pq(q,U){b[q]=U}function vq(){return{...b}}async function Qq(q){let U=Date.now();try{if(!await Bun.file(q.input).exists())return{success:!1,target:q.target||I(),format:q.format||"app",error:`Input file not found: ${q.input}`};let $=q.target||I(),J=q.format||Tq($),W=q.output||Z(process.cwd(),"dist","native");if(!s(W))T(W,{recursive:!0});let K=await m(q.input,{context:q.context,options:{isDev:!1}});if(K=N(K,{debug:q.verbose}),K=u(K),!K.includes("craft-component-styles")){if(K.includes("</head>"))K=K.replace("</head>",`${h}
2959
+ </head>`)}let Y=q.name||Yq(q.input,".stx"),L=q.version||"1.0.0",Q=q.craftPath||await Mq();if(!Q)return{success:!1,target:$,format:J,error:"Craft binary not found. Please install Craft or specify craftPath."};if(q.verbose)console.log(`\uD83D\uDCE6 Building native app for ${$}...`),console.log(` Input: ${q.input}`),console.log(` Output: ${W}`),console.log(` Craft: ${Q}`);let X;switch($){case"macos":X=await Xq(K,Y,L,W,J,q,Q);break;case"windows":X=await _q(K,Y,L,W,J,q,Q);break;case"linux":X=await Eq(K,Y,L,W,J,q,Q);break;case"ios":X=await Hq(K,Y,L,W,q,Q);break;case"android":X=await Rq(K,Y,L,W,q,Q);break;default:X={success:!1,target:$,format:J,error:`Unsupported target: ${$}`}}return X.duration=Date.now()-U,X}catch($){return{success:!1,target:q.target||I(),format:q.format||"app",error:$.message,duration:Date.now()-U}}}async function Xq(q,U,$,J,W,K,Y){let L=K.bundleId||`com.stx.${U.toLowerCase().replace(/[^a-z0-9]/g,"")}`,Q=Z(J,`${U}.app`),X=Z(Q,"Contents"),w=Z(X,"MacOS"),G=Z(X,"Resources");T(w,{recursive:!0}),T(G,{recursive:!0});let B=Z(G,"index.html");await Bun.write(B,q);let _="";if(K.sidebar?.enabled&&K.sidebar?.config)_=Z(G,"sidebar-config.json"),await Bun.write(_,JSON.stringify(K.sidebar.config));let E=K.sidebar?.enabled?`--native-sidebar --sidebar-width ${K.sidebar?.width||240} --sidebar-config "$(cat "$RESOURCES/sidebar-config.json")"`:"",H=K.menubarOnly??K.systemTray;if((K.bundleStyle||(await Gq(Y)?"executable":"launcher"))==="executable"){let V=Z(w,U);F(Y,V),A(V,493);let M={html:"index.html",title:K.window?.title||U,width:K.window?.width||1200,height:K.window?.height||800,devTools:Boolean(K.devTools)};if(H)M.menubarOnly=!0;else if(K.systemTray)M.systemTray=!0;if(K.window?.frameless)M.frameless=!0;if(K.window?.transparent)M.transparent=!0;if(K.window?.alwaysOnTop)M.alwaysOnTop=!0;if(K.window?.resizable===!1)M.resizable=!1;await Bun.write(Z(G,"craft.json"),`${JSON.stringify(M,null,2)}
2960
+ `)}else{let V=Z(w,"craft");F(Y,V),A(V,493);let M=K.sidebar?.enabled?`--native-sidebar --sidebar-width ${K.sidebar?.width||240} --sidebar-config "$(cat "$RESOURCES/sidebar-config.json")"`:"",n=`#!/bin/bash
2961
+ set -euo pipefail
2962
+ DIR="$( cd "$( dirname "\${BASH_SOURCE[0]}" )" && pwd )"
2963
+ RESOURCES="$DIR/../Resources"
2964
+ exec "$DIR/craft" --html-file "$RESOURCES/index.html" \\
2965
+ ${[`--title "${K.window?.title||U}"`,`--width ${K.window?.width||1200}`,`--height ${K.window?.height||800}`,H?"--menubar-only":K.systemTray?"--system-tray":"",K.devTools?"":"--no-devtools",K.window?.frameless?"--frameless":"",K.window?.transparent?"--transparent":"",K.window?.alwaysOnTop?"--always-on-top":"",K.window?.resizable===!1?"--no-resize":"",M].filter(Boolean).join(" \\\n ")}
2966
+ `,S=Z(w,U);await Bun.write(S,n),A(S,493)}let v=Boolean(K.icon&&await Bun.file(K.icon).exists());if(v)F(K.icon,Z(G,"AppIcon.icns"));let i={CFBundleExecutable:U,CFBundleIdentifier:L,CFBundleName:U,CFBundleDisplayName:U,CFBundleShortVersionString:$,CFBundleVersion:$,CFBundlePackageType:"APPL",CFBundleSignature:"????",LSMinimumSystemVersion:K.minimumSystemVersion||"13.0",NSHighResolutionCapable:!0,NSSupportsAutomaticGraphicsSwitching:!0,LSUIElement:K.menubarOnly??Boolean(K.systemTray),...v?{CFBundleIconFile:"AppIcon"}:{},...K.category?{LSApplicationCategoryType:K.category}:{},...K.copyright?{NSHumanReadableCopyright:K.copyright}:{},...K.infoPlist||{}};if(await Bun.write(Z(X,"Info.plist"),wq(i)),W==="dmg"){let V=Z(J,`${U}-${$}.dmg`),M=await zq(Q,V,U);if(!M.success)return{success:!1,target:"macos",format:"dmg",error:M.error};return{success:!0,target:"macos",format:"dmg",outputPath:V}}return{success:!0,target:"macos",format:"app",outputPath:Q}}async function Gq(q){try{let U=Bun.spawn([q,"--version"],{stdout:"pipe",stderr:"pipe"}),[$,J]=await Promise.all([new Response(U.stdout).text(),new Response(U.stderr).text()]);await U.exited;let K=`${$}
2967
+ ${J}`.match(/(\d+)\.(\d+)\.(\d+)/);if(!K)return!1;let[Y,L,Q]=K.slice(1).map(Number);if(Y>0||L>0)return!0;return Q>=57}catch{return!1}}function l(q){return q.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function wq(q){return`<?xml version="1.0" encoding="UTF-8"?>
2968
+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
2969
+ <plist version="1.0">
2970
+ <dict>
2971
+ ${Object.entries(q).map(([$,J])=>{let W=typeof J==="boolean"?`<${J}/>`:typeof J==="number"?`<integer>${J}</integer>`:`<string>${l(String(J))}</string>`;return` <key>${l($)}</key>
2972
+ ${W}`}).join(`
2973
+ `)}
2974
+ </dict>
2975
+ </plist>
2976
+ `}async function _q(q,U,$,J,W,K,Y){let L=Z(J,U);T(L,{recursive:!0});let Q=Z(L,"index.html");await Bun.write(Q,q),F(Y,Z(L,"craft.exe"));let X=`@echo off
2977
+ set DIR=%~dp0
2978
+ "%DIR%craft.exe" --html-file "%DIR%index.html" ^
2979
+ --title "${K.window?.title||U}" ^
2980
+ --width ${K.window?.width||1200} ^
2981
+ --height ${K.window?.height||800} ^
2982
+ ${K.systemTray?"--system-tray":""} ^
2983
+ ${K.devTools?"":"--no-devtools"}
2984
+ `;if(await Bun.write(Z(L,`${U}.bat`),X),W==="zip"){let w=Z(J,`${U}-${$}-windows.zip`),G=await Bq(L,w);if(!G.success)return{success:!1,target:"windows",format:"zip",error:G.error};return{success:!0,target:"windows",format:"zip",outputPath:w}}return{success:!0,target:"windows",format:"app",outputPath:L}}async function Eq(q,U,$,J,W,K,Y){let L=Z(J,U);T(L,{recursive:!0});let Q=Z(L,"index.html");await Bun.write(Q,q);let X=Z(L,"craft");F(Y,X),A(X,493);let w=`#!/bin/bash
2985
+ set -euo pipefail
2986
+ DIR="$( cd "$( dirname "\${BASH_SOURCE[0]}" )" && pwd )"
2987
+ exec "$DIR/craft" --html-file "$DIR/index.html" \\
2988
+ --title "${K.window?.title||U}" \\
2989
+ --width ${K.window?.width||1200} \\
2990
+ --height ${K.window?.height||800} \\
2991
+ ${K.systemTray?"--system-tray":""} \\
2992
+ ${K.devTools?"":"--no-devtools"}
2993
+ `,G=Z(L,U.toLowerCase());await Bun.write(G,w),A(G,493);let B=`[Desktop Entry]
2994
+ Type=Application
2995
+ Name=${U}
2996
+ Exec=${G}
2997
+ Terminal=false
2998
+ Categories=Utility;
2999
+ `;if(await Bun.write(Z(L,`${U.toLowerCase()}.desktop`),B),W==="deb"){let _=Z(J,`${U.toLowerCase()}_${$}_amd64.deb`),E=await Oq(L,_,U,$,K);if(!E.success)return{success:!1,target:"linux",format:"deb",error:E.error};return{success:!0,target:"linux",format:"deb",outputPath:_}}if(W==="appimage"){let _=Z(J,`${U}-${$}-x86_64.AppImage`),E=await xq(L,_,U,K);if(!E.success)return{success:!1,target:"linux",format:"appimage",error:E.error};return{success:!0,target:"linux",format:"appimage",outputPath:_}}return{success:!0,target:"linux",format:"app",outputPath:L}}async function Hq(q,U,$,J,W,K){return{success:!1,target:"ios",format:"ipa",error:`iOS build requires Xcode and additional setup. Use 'stx init:ios ${U}' to create an iOS project.`}}async function Rq(q,U,$,J,W,K){return{success:!1,target:"android",format:"apk",error:`Android build requires Android SDK and additional setup. Use 'stx init:android ${U}' to create an Android project.`}}async function Mq(){if(process.env.CRAFT_BIN&&await Bun.file(process.env.CRAFT_BIN).exists())return process.env.CRAFT_BIN;let q=[Z(process.cwd(),"../../craft/packages/zig/zig-out/bin/craft"),Z(process.cwd(),"../craft/packages/zig/zig-out/bin/craft"),Z(P(),"Code/Tools/craft/packages/zig/zig-out/bin/craft"),Z(P(),"Code/craft/packages/zig/zig-out/bin/craft"),"/usr/local/bin/craft","/usr/bin/craft",Z(P(),".local/bin/craft"),Z(process.env.LOCALAPPDATA||"","craft","craft.exe"),Z(process.env.PROGRAMFILES||"","craft","craft.exe")];for(let U of q)if(await Bun.file(U).exists())return U;try{let $=Zq("which craft 2>/dev/null || where craft 2>nul",{encoding:"utf-8"}).trim().split(`
3000
+ `)[0];if($&&await Bun.file($).exists())return $}catch{}return null}function I(){switch(Lq()){case"darwin":return"macos";case"win32":return"windows";default:return"linux"}}function Tq(q){switch(q){case"macos":return"app";case"windows":return"zip";case"linux":return"appimage";case"ios":return"ipa";case"android":return"apk";default:return"app"}}async function zq(q,U,$){return new Promise((J)=>{let W=j("hdiutil",["create","-volname",$,"-srcfolder",q,"-ov","-format","UDZO",U]);W.on("close",(K)=>{if(K===0)J({success:!0});else J({success:!1,error:`hdiutil exited with code ${K}`})}),W.on("error",(K)=>{J({success:!1,error:K.message})})})}async function Bq(q,U){return new Promise(($)=>{let J=j("zip",["-r",U,"."],{cwd:q});J.on("close",(W)=>{if(W===0)$({success:!0});else $({success:!1,error:`zip exited with code ${W}`})}),J.on("error",(W)=>{$({success:!1,error:W.message})})})}async function Oq(q,U,$,J,W){return new Promise((K)=>{try{let Y=Z(c(),`stx-deb-${Date.now()}`),L=Z(Y,"DEBIAN"),Q=Z(Y,"usr","bin"),X=Z(Y,"usr","share","applications"),w=Z(Y,"usr","share",$.toLowerCase());T(L,{recursive:!0}),T(Q,{recursive:!0}),T(X,{recursive:!0}),T(w,{recursive:!0});let G=z("fs").readdirSync(q);for(let H of G)F(Z(q,H),Z(w,H));let B=`#!/bin/bash
3001
+ exec /usr/share/${$.toLowerCase()}/${$.toLowerCase()} "$@"`;z("fs").writeFileSync(Z(Q,$.toLowerCase()),B),A(Z(Q,$.toLowerCase()),493);let _=`Package: ${$.toLowerCase()}
3002
+ Version: ${J}
3003
+ Section: utils
3004
+ Priority: optional
3005
+ Architecture: amd64
3006
+ Depends: libgtk-3-0, libwebkit2gtk-4.0-37
3007
+ Maintainer: ${W.author||"Unknown"}
3008
+ Description: ${W.description||$}
3009
+ `;z("fs").writeFileSync(Z(L,"control"),_);let E=j("dpkg-deb",["--build",Y,U]);E.on("close",(H)=>{if(z("fs").rmSync(Y,{recursive:!0,force:!0}),H===0)K({success:!0});else K({success:!1,error:`dpkg-deb exited with code ${H}`})}),E.on("error",(H)=>{z("fs").rmSync(Y,{recursive:!0,force:!0}),K({success:!1,error:H.message})})}catch(Y){K({success:!1,error:Y.message})}})}async function xq(q,U,$,J){return new Promise((W)=>{try{let K=Z(c(),`stx-appimage-${Date.now()}`),Y=Z(K,`${$}.AppDir`),L=Z(Y,"usr"),Q=Z(L,"bin"),X=Z(L,"share");T(Q,{recursive:!0}),T(X,{recursive:!0});let w=Z(X,$.toLowerCase());T(w,{recursive:!0});let G=z("fs").readdirSync(q);for(let x of G)F(Z(q,x),Z(w,x));let B=`#!/bin/bash
3010
+ SELF=$(readlink -f "$0")
3011
+ HERE=\${SELF%/*}
3012
+ export PATH="\${HERE}/usr/bin:\${PATH}"
3013
+ exec "\${HERE}/usr/share/${$.toLowerCase()}/${$.toLowerCase()}" "$@"
3014
+ `;z("fs").writeFileSync(Z(Y,"AppRun"),B),A(Z(Y,"AppRun"),493);let _=`[Desktop Entry]
3015
+ Type=Application
3016
+ Name=${$}
3017
+ Exec=${$.toLowerCase()}
3018
+ Terminal=false
3019
+ Categories=Utility;
3020
+ Icon=${$.toLowerCase()}
3021
+ `;z("fs").writeFileSync(Z(Y,`${$.toLowerCase()}.desktop`),_);let E=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(z("fs").writeFileSync(Z(Y,`${$.toLowerCase()}.png`),E),J.icon&&s(J.icon))F(J.icon,Z(Y,`${$.toLowerCase()}.png`));let H=j("appimagetool",[Y,U],{env:{...process.env,ARCH:"x86_64"}});H.on("close",(x)=>{if(z("fs").rmSync(K,{recursive:!0,force:!0}),x===0)A(U,493),W({success:!0});else W({success:!1,error:`appimagetool exited with code ${x}. Install from https://appimage.github.io/appimagetool/`})}),H.on("error",(x)=>{z("fs").rmSync(K,{recursive:!0,force:!0}),W({success:!1,error:`appimagetool not found: ${x.message}`})})}catch(K){W({success:!1,error:K.message})}})}function Vq(){return[I()]}function Fq(q){switch(q){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 Aq={buildNative:Qq,getAvailableTargets:Vq,getAvailableFormats:Fq,detectPlatform:I},cq=Aq;
3022
+ export{Iq as bk,D as ck,Cq as dk,yq as ek,N as fk,b as gk,h as hk,bq as ik,u as jk,Pq as kk,vq as lk,Qq as mk,Vq as nk,Fq as ok,cq as pk};