@fluentic/style 0.1.0-beta.4 → 0.1.0-beta.5

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 (370) hide show
  1. package/CHANGELOG.md +42 -1
  2. package/README.md +10 -9
  3. package/atomic/className.ts +10 -4
  4. package/atomic/debug/className/className.ts +10 -0
  5. package/atomic/rule.ts +6 -3
  6. package/atomic/utils/selector.ts +14 -1
  7. package/builder/classname/class_name_builder.ts +68 -24
  8. package/builder/classname/fns.ts +2 -2
  9. package/builder/classname/types.ts +7 -0
  10. package/builder/data/const.ts +6 -0
  11. package/builder/data/create.ts +42 -0
  12. package/builder/data/data.ts +20 -1
  13. package/builder/data/index.ts +0 -1
  14. package/builder/data/is.ts +23 -0
  15. package/builder/data/merge/scope.ts +20 -19
  16. package/builder/data/merge/style.ts +70 -20
  17. package/builder/data/state.ts +16 -2
  18. package/builder/extract/index.ts +1 -0
  19. package/builder/extract/sheet.ts +26 -0
  20. package/builder/extract/utils.ts +2 -0
  21. package/builder/extract/withTokens.ts +2 -1
  22. package/builder/selector_override.noop.ts +11 -0
  23. package/builder/selector_override.ts +30 -0
  24. package/builder/selector_override_core.ts +66 -0
  25. package/builder/style_builder.ts +127 -3
  26. package/builder/style_data.ts +24 -0
  27. package/builder/style_fns.ts +24 -24
  28. package/builder/types/alias.ts +34 -6
  29. package/builder/types/fns.ts +13 -5
  30. package/builder/types/types.ts +32 -2
  31. package/builder/utils.ts +1 -0
  32. package/compiler/compiler/compiler.ts +4 -7
  33. package/compiler/compiler/constants.ts +6 -0
  34. package/compiler/compiler/index.ts +1 -0
  35. package/compiler/compiler/types.ts +2 -0
  36. package/compiler/cssProp.ts +35 -0
  37. package/compiler/index.ts +1 -0
  38. package/compiler/transform/cssProp/index.ts +1 -0
  39. package/compiler/transform/cssProp/plugin.ts +129 -0
  40. package/compiler/transform/debug/plugin.ts +6 -0
  41. package/compiler/transform/debug/transform.ts +2 -1
  42. package/compiler/transform/evaluator/evaluator.ts +32 -4
  43. package/compiler/transform/evaluator/tracer.ts +30 -2
  44. package/compiler/transform/extract/chain/chain.ts +540 -62
  45. package/compiler/transform/extract/chain/extract_chain.ts +12 -4
  46. package/compiler/transform/extract/chain/types.ts +1 -1
  47. package/compiler/transform/extract/plugin.ts +20 -4
  48. package/compiler/transform/extract/transform.ts +2 -1
  49. package/compiler/transform/extract/utils/replacement.ts +47 -2
  50. package/compiler/transform/extract/utils/state.ts +2 -0
  51. package/compiler/transform/index.ts +1 -0
  52. package/compiler/transform/syntax/isStaticStyleValue.ts +15 -9
  53. package/compiler/utils/constants.ts +8 -1
  54. package/compiler/utils/imports.ts +11 -1
  55. package/config/config/css.ts +1 -0
  56. package/css/index.ts +2 -0
  57. package/css/sheet.ts +119 -0
  58. package/css/styleTarget.ts +251 -0
  59. package/dist/adapter/preact.js +2 -0
  60. package/dist/adapter/react.js +2 -0
  61. package/dist/adapter/solid.js +2 -0
  62. package/dist/className-hiAsQ9V6.js +303 -0
  63. package/dist/className-hiAsQ9V6.js.map +1 -0
  64. package/dist/combine-Ca6LfFxv.js +1279 -0
  65. package/dist/combine-Ca6LfFxv.js.map +1 -0
  66. package/dist/compiler/index.mjs +2 -2
  67. package/dist/{compiler-CE0ZgkdH.mjs → compiler-OgDBuqfs.mjs} +1427 -546
  68. package/dist/compiler-OgDBuqfs.mjs.map +1 -0
  69. package/dist/config-B-KbXpIh.js +6 -0
  70. package/dist/{config-oKOjOTWi.js.map → config-B-KbXpIh.js.map} +1 -1
  71. package/dist/config-Barf8f4B.js +35 -0
  72. package/dist/config-Barf8f4B.js.map +1 -0
  73. package/dist/{config-lJNLh7eM.js → config-CsB4MuFI.js} +2 -2
  74. package/dist/{config-lJNLh7eM.js.map → config-CsB4MuFI.js.map} +1 -1
  75. package/dist/config-DOWSNV8w.js +1 -0
  76. package/dist/{config-CduqubI8.js → config-t76UljYv.js} +3 -3
  77. package/dist/config-t76UljYv.js.map +1 -0
  78. package/dist/createTransformElement-DDqld3RF.js +34 -0
  79. package/dist/createTransformElement-DDqld3RF.js.map +1 -0
  80. package/dist/css-CZwrac6F.js +3923 -0
  81. package/dist/css-CZwrac6F.js.map +1 -0
  82. package/dist/css-GtUPEO9U.js.map +1 -1
  83. package/dist/css-YfHN_8Nk.js +479 -0
  84. package/dist/css-YfHN_8Nk.js.map +1 -0
  85. package/dist/css-a9O5so0b.js +1246 -0
  86. package/dist/css-a9O5so0b.js.map +1 -0
  87. package/dist/css.js +2 -2
  88. package/dist/{css_extra-DYtS3g6Z.js → css_extra-CXXZAylc.js} +2 -2
  89. package/dist/{css_extra-DYtS3g6Z.js.map → css_extra-CXXZAylc.js.map} +1 -1
  90. package/dist/{data-D7NFt4JG.js → data-CzHJg147.js} +145 -59
  91. package/dist/data-CzHJg147.js.map +1 -0
  92. package/dist/{debug-Cvpo5cVu.js → debug-DkrxyknP.js} +80 -5
  93. package/dist/debug-DkrxyknP.js.map +1 -0
  94. package/dist/dev/rsc.js +5 -8
  95. package/dist/dev/rsc.js.map +1 -1
  96. package/dist/{dev-DdRWa6dJ.js → dev-z4laBwlS.js} +4 -4
  97. package/dist/{dev-DdRWa6dJ.js.map → dev-z4laBwlS.js.map} +1 -1
  98. package/dist/dev.js +1 -1
  99. package/dist/dialect/extracted/index.js +1 -1
  100. package/dist/dialect/index.js +1 -1
  101. package/dist/{elementMarker-ng0y3fN0.js → elementMarker-CqhU_l_m.js} +94 -8
  102. package/dist/elementMarker-CqhU_l_m.js.map +1 -0
  103. package/dist/entry/dev/adapter/preact.js +12 -0
  104. package/dist/entry/dev/adapter/preact.js.map +1 -0
  105. package/dist/entry/dev/adapter/react.js +12 -0
  106. package/dist/entry/dev/adapter/react.js.map +1 -0
  107. package/dist/entry/dev/adapter/solid.js +12 -0
  108. package/dist/entry/dev/adapter/solid.js.map +1 -0
  109. package/dist/entry/dev/css.js +3 -3
  110. package/dist/entry/dev/jsx-dev-runtime.js +2 -2
  111. package/dist/entry/dev/jsx-runtime.js +2 -2
  112. package/dist/entry/dev.js +10 -8
  113. package/dist/entry/prod/adapter/preact.js +12 -0
  114. package/dist/entry/prod/adapter/preact.js.map +1 -0
  115. package/dist/entry/prod/adapter/react.js +12 -0
  116. package/dist/entry/prod/adapter/react.js.map +1 -0
  117. package/dist/entry/prod/adapter/solid.js +12 -0
  118. package/dist/entry/prod/adapter/solid.js.map +1 -0
  119. package/dist/entry/prod/css.js +3 -3
  120. package/dist/entry/prod/extract.js +240 -3
  121. package/dist/entry/prod/extract.js.map +1 -0
  122. package/dist/entry/prod/jsx-dev-runtime.js +2 -2
  123. package/dist/entry/prod/jsx-runtime.js +2 -2
  124. package/dist/entry/prod/runtime.js +3 -5
  125. package/dist/entry/prod.js +84 -1229
  126. package/dist/entry/prod.js.map +1 -1
  127. package/dist/entry/rsc-dev/adapter/preact.js +12 -0
  128. package/dist/entry/rsc-dev/adapter/preact.js.map +1 -0
  129. package/dist/entry/rsc-dev/adapter/react.js +12 -0
  130. package/dist/entry/rsc-dev/adapter/react.js.map +1 -0
  131. package/dist/entry/rsc-dev/adapter/solid.js +12 -0
  132. package/dist/entry/rsc-dev/adapter/solid.js.map +1 -0
  133. package/dist/entry/rsc-dev/css.js +3 -3
  134. package/dist/entry/rsc-dev/dev.js +6 -10
  135. package/dist/entry/rsc-dev/dev.js.map +1 -1
  136. package/dist/entry/rsc-dev/jsx-dev-runtime.js +2 -2
  137. package/dist/entry/rsc-dev/jsx-runtime.js +2 -2
  138. package/dist/entry/rsc-dev.js +252 -750
  139. package/dist/entry/rsc-dev.js.map +1 -1
  140. package/dist/entry/rsc-prod/adapter/preact.js +2 -0
  141. package/dist/entry/rsc-prod/adapter/react.js +2 -0
  142. package/dist/entry/rsc-prod/adapter/solid.js +2 -0
  143. package/dist/entry/rsc-prod/css.js +9 -3
  144. package/dist/entry/rsc-prod/css.js.map +1 -0
  145. package/dist/entry/rsc-prod/jsx-dev-runtime.js +2 -2
  146. package/dist/entry/rsc-prod/jsx-runtime.js +2 -2
  147. package/dist/entry/rsc-prod/runtime.js +3 -5
  148. package/dist/entry/rsc-prod.js +236 -11
  149. package/dist/entry/rsc-prod.js.map +1 -1
  150. package/dist/{styleStore-CajcAEPO.js → env-Db2cRt-h.js} +1185 -162
  151. package/dist/env-Db2cRt-h.js.map +1 -0
  152. package/dist/{jsx-DL-DEAz8.js → getClassName-DKtQl5ZX.js} +5 -12
  153. package/dist/getClassName-DKtQl5ZX.js.map +1 -0
  154. package/dist/{utils-B_VhPBHH.js → getClassName-DaZF5nfJ.js} +28 -65
  155. package/dist/getClassName-DaZF5nfJ.js.map +1 -0
  156. package/dist/getClassName-a6p2uMFM.js +536 -0
  157. package/dist/getClassName-a6p2uMFM.js.map +1 -0
  158. package/dist/{getClassName-CrNVjAoJ.js → getClassName-aD9zqg9U.js} +31 -10
  159. package/dist/getClassName-aD9zqg9U.js.map +1 -0
  160. package/dist/global-zYTvWskP.js +10 -0
  161. package/dist/{global-CZBlA9E7.js.map → global-zYTvWskP.js.map} +1 -1
  162. package/dist/{hash-BfeJDf5U.js → hash-BOlQThNz.js} +37 -2
  163. package/dist/hash-BOlQThNz.js.map +1 -0
  164. package/dist/index.js +7 -6
  165. package/dist/jsx/jsx-dev-runtime.js +2 -2
  166. package/dist/jsx/jsx-dev-runtime.server.js +1 -1
  167. package/dist/jsx/jsx-runtime.js +2 -2
  168. package/dist/jsx/jsx-runtime.server.js +1 -1
  169. package/dist/jsx-C2pnWLcb.js +39 -0
  170. package/dist/jsx-C2pnWLcb.js.map +1 -0
  171. package/dist/{jsx_dev_runtime-aAhNYDeS.js → jsx_dev_runtime-kSrmu6b1.js} +2 -3
  172. package/dist/{jsx_dev_runtime-aAhNYDeS.js.map → jsx_dev_runtime-kSrmu6b1.js.map} +1 -1
  173. package/dist/{jsx_runtime-D7Y5up6H.js → jsx_runtime-BgK90E2O.js} +2 -3
  174. package/dist/{jsx_runtime-D7Y5up6H.js.map → jsx_runtime-BgK90E2O.js.map} +1 -1
  175. package/dist/{jsx_runtime-C6i1bWlu.js → jsx_runtime-XJSHujgI.js} +2 -2
  176. package/dist/{jsx_runtime-C6i1bWlu.js.map → jsx_runtime-XJSHujgI.js.map} +1 -1
  177. package/dist/{loader-BmYS_Rju.mjs → loader-DHvgp0fK.mjs} +3 -3
  178. package/dist/{loader-BmYS_Rju.mjs.map → loader-DHvgp0fK.mjs.map} +1 -1
  179. package/dist/{misc-BIS_c7BJ.mjs → misc-BuSLnvx0.mjs} +4 -4
  180. package/dist/misc-BuSLnvx0.mjs.map +1 -0
  181. package/dist/{namedTokens-CN_yhhik.js → namedTokens-D3tt-joz.js} +3 -3
  182. package/dist/{namedTokens-CN_yhhik.js.map → namedTokens-D3tt-joz.js.map} +1 -1
  183. package/dist/plugin/farm/index.mjs +4 -3
  184. package/dist/plugin/farm/index.mjs.map +1 -1
  185. package/dist/plugin/nextjs/index.mjs +5 -5
  186. package/dist/plugin/nextjs/index.mjs.map +1 -1
  187. package/dist/plugin/nextjs/loader.mjs +4 -4
  188. package/dist/plugin/parcel/index.cjs +2 -0
  189. package/dist/plugin/parcel/index.mjs +3 -1
  190. package/dist/plugin/parcel/optimizer.cjs +1 -1
  191. package/dist/plugin/parcel/optimizer.mjs +2 -2
  192. package/dist/plugin/parcel/resolver.cjs +1 -1
  193. package/dist/plugin/parcel/resolver.mjs +2 -2
  194. package/dist/plugin/parcel/runtime.cjs +1 -1
  195. package/dist/plugin/parcel/runtime.mjs +1 -1
  196. package/dist/plugin/parcel/transformer.cjs +1 -1
  197. package/dist/plugin/parcel/transformer.mjs +2 -2
  198. package/dist/plugin/rspack/index.mjs +3 -2
  199. package/dist/plugin/rspack/index.mjs.map +1 -1
  200. package/dist/plugin/vite/index.mjs +6 -6
  201. package/dist/plugin/vite/index.mjs.map +1 -1
  202. package/dist/plugin/webpack/index.mjs +3 -2
  203. package/dist/plugin/webpack/loader.mjs +2 -2
  204. package/dist/presets/tailwind/index.js +3 -4
  205. package/dist/presets/tailwind/index.js.map +1 -1
  206. package/dist/{assert-BGdigdr5.js → presets-DSanixJV.js} +106 -2
  207. package/dist/presets-DSanixJV.js.map +1 -0
  208. package/dist/{registry-IaXmLQzA.mjs → registry-r3BKWqpI.mjs} +2 -2
  209. package/dist/{registry-IaXmLQzA.mjs.map → registry-r3BKWqpI.mjs.map} +1 -1
  210. package/dist/resolveClassNameRuntime-D5a37GNr.js +63 -0
  211. package/dist/resolveClassNameRuntime-D5a37GNr.js.map +1 -0
  212. package/dist/{rules-CxVzovt-.js → rules-B0_rKPfB.js} +583 -154
  213. package/dist/rules-B0_rKPfB.js.map +1 -0
  214. package/dist/{combine-C9vjpKCs.js → scope-BSuRLice.js} +239 -150
  215. package/dist/scope-BSuRLice.js.map +1 -0
  216. package/dist/selector/index.js +1 -2
  217. package/dist/server.js +12 -9
  218. package/dist/server.js.map +1 -1
  219. package/dist/{shared-CaJuvw03.cjs → shared-8_Msr7Q5.cjs} +1352 -466
  220. package/dist/shared-8_Msr7Q5.cjs.map +1 -0
  221. package/dist/{shared-DdPTZ0O3.mjs → shared-BGO_05rW.mjs} +4 -4
  222. package/dist/{shared-DdPTZ0O3.mjs.map → shared-BGO_05rW.mjs.map} +1 -1
  223. package/dist/sheet-BpLZIIuO.js +7 -0
  224. package/dist/{sheet-BWBzuy4D.js.map → sheet-BpLZIIuO.js.map} +1 -1
  225. package/dist/{sidecar-B3oCK9vC.mjs → sidecar-Bu2x35JE.mjs} +3 -3
  226. package/dist/{sidecar-B3oCK9vC.mjs.map → sidecar-Bu2x35JE.mjs.map} +1 -1
  227. package/dist/{styleStore-0fARJlZV.js → styleStore-BDy5TH6N.js} +3 -4
  228. package/dist/{styleStore-0fARJlZV.js.map → styleStore-BDy5TH6N.js.map} +1 -1
  229. package/dist/styleStore-DX3z_UVK.js +51 -0
  230. package/dist/styleStore-DX3z_UVK.js.map +1 -0
  231. package/dist/{token-D-S-4_mN.js → token-BsW_S8fN.js} +2 -2
  232. package/dist/{token-D-S-4_mN.js.map → token-BsW_S8fN.js.map} +1 -1
  233. package/dist/{trace-CFnhyCVf.js → trace-BdKEpgME.js} +2 -2
  234. package/dist/{trace-CFnhyCVf.js.map → trace-BdKEpgME.js.map} +1 -1
  235. package/dist/{trace-ZtgeY-8s.js → trace-DcuMxR45.js} +3 -3
  236. package/dist/{trace-ZtgeY-8s.js.map → trace-DcuMxR45.js.map} +1 -1
  237. package/dist/{style-CGaJndOl.js → types-BEUgXuu2.js} +268 -89
  238. package/dist/types-BEUgXuu2.js.map +1 -0
  239. package/dist/{utils-B5Xqf1lV.mjs → utils-BPDxr-oc.mjs} +4 -4
  240. package/dist/{utils-B5Xqf1lV.mjs.map → utils-BPDxr-oc.mjs.map} +1 -1
  241. package/dist/utils-CLnpwhJd.js +83 -0
  242. package/dist/utils-CLnpwhJd.js.map +1 -0
  243. package/dist/utils-CUl1BU40.js +72 -0
  244. package/dist/utils-CUl1BU40.js.map +1 -0
  245. package/dist/{utils-DaAiEEIG.mjs → utils-DZjLTV4D.mjs} +3 -3
  246. package/dist/{utils-DaAiEEIG.mjs.map → utils-DZjLTV4D.mjs.map} +1 -1
  247. package/dist/utils-okFWrQsg.js +41 -0
  248. package/dist/utils-okFWrQsg.js.map +1 -0
  249. package/dist/{utils-DzydRwYo.js → utils-sBVZEq4u.js} +141 -111
  250. package/dist/utils-sBVZEq4u.js.map +1 -0
  251. package/dist/utils.js +4 -4
  252. package/dist/utils.js.map +1 -1
  253. package/dist/value-CpJpQ00y.js +145 -0
  254. package/dist/value-CpJpQ00y.js.map +1 -0
  255. package/dist/{webpack-CHydnRXB.mjs → webpack-DTKgR-HY.mjs} +5 -5
  256. package/dist/webpack-DTKgR-HY.mjs.map +1 -0
  257. package/entry/dev/adapter/preact.ts +8 -0
  258. package/entry/dev/adapter/react.ts +8 -0
  259. package/entry/dev/adapter/solid.ts +8 -0
  260. package/entry/prod/adapter/preact.ts +8 -0
  261. package/entry/prod/adapter/react.ts +8 -0
  262. package/entry/prod/adapter/solid.ts +8 -0
  263. package/entry/rsc_dev/adapter/preact.ts +1 -0
  264. package/entry/rsc_dev/adapter/react.ts +1 -0
  265. package/entry/rsc_dev/adapter/solid.ts +1 -0
  266. package/entry/rsc_prod/adapter/preact.ts +1 -0
  267. package/entry/rsc_prod/adapter/react.ts +1 -0
  268. package/entry/rsc_prod/adapter/solid.ts +1 -0
  269. package/entry/shared/config_dev.ts +1 -1
  270. package/jsx/types/index.ts +3 -0
  271. package/jsx/types/preact.ts +14 -0
  272. package/jsx/{types.ts → types/react.ts} +2 -2
  273. package/jsx/types/solid.ts +32 -0
  274. package/package.json +78 -12
  275. package/plugin/bundler/farm/plugin.ts +2 -0
  276. package/plugin/bundler/parcel/plugin.ts +2 -0
  277. package/plugin/bundler/rspack/plugin.ts +1 -0
  278. package/plugin/bundler/vite/plugin.ts +3 -8
  279. package/plugin/bundler/vite/state.ts +2 -2
  280. package/plugin/bundler/webpack/plugin.ts +2 -1
  281. package/plugin/nextjs/plugin.ts +3 -0
  282. package/plugin/utils/compiler.ts +2 -0
  283. package/plugin/utils/runtimeEntry.ts +2 -2
  284. package/runtime/adapter/utils.ts +94 -0
  285. package/runtime/core/cache/combine.ts +33 -4
  286. package/runtime/core/cache/item.ts +31 -12
  287. package/runtime/core/cache/itemWithResolver.ts +44 -0
  288. package/runtime/core/cache/prop.ts +7 -6
  289. package/runtime/core/cache/result.ts +2 -2
  290. package/runtime/core/cache/stateItem.ts +16 -1
  291. package/runtime/core/combinedStyle.ts +4 -4
  292. package/runtime/extract/combineStyle.ts +179 -5
  293. package/runtime/extract/getClassName.ts +49 -6
  294. package/runtime/sheet/rule.ts +3 -10
  295. package/runtime/style/scope.ts +0 -24
  296. package/runtime/style/style.ts +179 -5
  297. package/runtime/types.ts +3 -3
  298. package/style/classname.ts +12 -6
  299. package/style/important.ts +19 -0
  300. package/style/index.ts +2 -0
  301. package/style/style.ts +16 -4
  302. package/style/types.ts +6 -4
  303. package/style/utils/expose.ts +4 -3
  304. package/style/weight.ts +21 -0
  305. package/dist/assert-BGdigdr5.js.map +0 -1
  306. package/dist/className-Do2Crx4b.js +0 -143
  307. package/dist/className-Do2Crx4b.js.map +0 -1
  308. package/dist/combine-C9vjpKCs.js.map +0 -1
  309. package/dist/combineStyle-DwAhsOmS.js +0 -26
  310. package/dist/combineStyle-DwAhsOmS.js.map +0 -1
  311. package/dist/compiler-CE0ZgkdH.mjs.map +0 -1
  312. package/dist/config-BE5D5x2N.js +0 -2
  313. package/dist/config-CduqubI8.js.map +0 -1
  314. package/dist/config-oKOjOTWi.js +0 -7
  315. package/dist/css-BewrRz3_.js +0 -243
  316. package/dist/css-BewrRz3_.js.map +0 -1
  317. package/dist/css-CiTI58yl.js +0 -1094
  318. package/dist/css-CiTI58yl.js.map +0 -1
  319. package/dist/css-Rc7ILf-3.js +0 -236
  320. package/dist/css-Rc7ILf-3.js.map +0 -1
  321. package/dist/cssIdent-BsyUXNNk.js +0 -38
  322. package/dist/cssIdent-BsyUXNNk.js.map +0 -1
  323. package/dist/cssVar-DGgQ2GIK.js +0 -92
  324. package/dist/cssVar-DGgQ2GIK.js.map +0 -1
  325. package/dist/data-D7NFt4JG.js.map +0 -1
  326. package/dist/debug-Cvpo5cVu.js.map +0 -1
  327. package/dist/dev-px0_6TNq.js +0 -81
  328. package/dist/dev-px0_6TNq.js.map +0 -1
  329. package/dist/elementMarker-ng0y3fN0.js.map +0 -1
  330. package/dist/extract-B-Vs88ME.js +0 -3
  331. package/dist/extract-CM8Fk2eK.js +0 -130
  332. package/dist/extract-CM8Fk2eK.js.map +0 -1
  333. package/dist/getClassName-CrNVjAoJ.js.map +0 -1
  334. package/dist/global-CZBlA9E7.js +0 -14
  335. package/dist/hash-BfeJDf5U.js.map +0 -1
  336. package/dist/jsx-BY1iFewe.js +0 -39
  337. package/dist/jsx-BY1iFewe.js.map +0 -1
  338. package/dist/jsx-DL-DEAz8.js.map +0 -1
  339. package/dist/layer-BSxAr-hy.js +0 -94
  340. package/dist/layer-BSxAr-hy.js.map +0 -1
  341. package/dist/misc-BIS_c7BJ.mjs.map +0 -1
  342. package/dist/presets-BhXa232U.js +0 -108
  343. package/dist/presets-BhXa232U.js.map +0 -1
  344. package/dist/property-BuLbzviK.js +0 -406
  345. package/dist/property-BuLbzviK.js.map +0 -1
  346. package/dist/rules-CxVzovt-.js.map +0 -1
  347. package/dist/selector-A-mRmMnI.js +0 -64
  348. package/dist/selector-A-mRmMnI.js.map +0 -1
  349. package/dist/shared-CaJuvw03.cjs.map +0 -1
  350. package/dist/sheet-BWBzuy4D.js +0 -7
  351. package/dist/style-CGaJndOl.js.map +0 -1
  352. package/dist/style-DDxjKdX0.js +0 -1891
  353. package/dist/style-DDxjKdX0.js.map +0 -1
  354. package/dist/style-S7LTQbRu.js +0 -5
  355. package/dist/styleStore-CajcAEPO.js.map +0 -1
  356. package/dist/symbols-Cp4ymzKF.js +0 -14
  357. package/dist/symbols-Cp4ymzKF.js.map +0 -1
  358. package/dist/utils-B_VhPBHH.js.map +0 -1
  359. package/dist/utils-CDUaX81o.js +0 -170
  360. package/dist/utils-CDUaX81o.js.map +0 -1
  361. package/dist/utils-DzydRwYo.js.map +0 -1
  362. package/dist/value-C0JRsyax.js +0 -64
  363. package/dist/value-C0JRsyax.js.map +0 -1
  364. package/dist/value-D08AocUs.js +0 -1053
  365. package/dist/value-D08AocUs.js.map +0 -1
  366. package/dist/valueRef-M3E1oza7.js +0 -16
  367. package/dist/valueRef-M3E1oza7.js.map +0 -1
  368. package/dist/webpack-CHydnRXB.mjs.map +0 -1
  369. package/dist/withTokens-DAzUIPvA.js +0 -95
  370. package/dist/withTokens-DAzUIPvA.js.map +0 -1
@@ -0,0 +1,1246 @@
1
+ import { $ as isSelectorData, B as isStyleTokenData, Et as getDebugCallsite, Gt as normalizePropertyName, Ht as getIdentifierSafeHash, Jt as DEV_CONFIG, Kt as sanitizeDebugPropertyName, L as getStyleTokenId, Nt as traceCallsite, Ot as getDebugFieldCallsite, Pt as traceError, Ut as createNameFormatter, V as isStyleTokenOverrideData, Wt as normalizeDebugKeywordValue, X as getSelectorSelectors, Z as isScopeData, at as BUILDER_CALLSITE, c as shouldAppendCssPx, ct as BUILDER_SELECTOR, d as hasSheetSelectorAnchor, dn as symbol, dt as BUILDER_TYPE, en as hashString, et as isSelectorOverrideData, f as getCssPropertyName, g as getCssVarRawFallback, h as getTokenVar, in as CSS_CONFIG, it as isStyleData, kt as getDebugFieldVarName, l as getSelectorHash, lt as BUILDER_SLOT_ID, nt as isSlotData, ot as BUILDER_SCOPE, rt as isSlotOverrideData, s as getCssPropertyValue, st as BUILDER_SCOPE_ID, tn as DEBUG_CONFIG, u as getSelectorText$1, un as globalData, ut as BUILDER_STATE } from "./env-Db2cRt-h.js";
2
+ import { t as CSS_EXTRA_CONFIG } from "./css_extra-CXXZAylc.js";
3
+ import { t as getClassName } from "./getClassName-DKtQl5ZX.js";
4
+ import { t as createTransformElement } from "./createTransformElement-DDqld3RF.js";
5
+ //#region builder/data/create.ts
6
+ function createStyleData(callsite) {
7
+ return {
8
+ [BUILDER_TYPE]: 1,
9
+ [BUILDER_STATE]: {
10
+ items: [],
11
+ lookup: {}
12
+ },
13
+ [BUILDER_CALLSITE]: callsite
14
+ };
15
+ }
16
+ function createSheetData(callsite) {
17
+ return {
18
+ [BUILDER_TYPE]: 9,
19
+ [BUILDER_STATE]: {
20
+ items: [],
21
+ lookup: {}
22
+ },
23
+ [BUILDER_CALLSITE]: callsite
24
+ };
25
+ }
26
+ function createSlotData(callsite, slotId) {
27
+ return {
28
+ [BUILDER_TYPE]: 2,
29
+ [BUILDER_STATE]: {
30
+ items: [],
31
+ lookup: {}
32
+ },
33
+ [BUILDER_CALLSITE]: callsite,
34
+ [BUILDER_SLOT_ID]: slotId
35
+ };
36
+ }
37
+ function createSlotOverrideData(callsite, slotId) {
38
+ return {
39
+ [BUILDER_TYPE]: 3,
40
+ [BUILDER_STATE]: {
41
+ items: [],
42
+ lookup: {}
43
+ },
44
+ [BUILDER_CALLSITE]: callsite,
45
+ [BUILDER_SLOT_ID]: slotId
46
+ };
47
+ }
48
+ function createSelectorOverrideData(callsite, selectors) {
49
+ return {
50
+ [BUILDER_TYPE]: 8,
51
+ [BUILDER_STATE]: {
52
+ items: [],
53
+ lookup: {}
54
+ },
55
+ [BUILDER_CALLSITE]: callsite,
56
+ [BUILDER_SELECTOR]: selectors
57
+ };
58
+ }
59
+ function createSelectorData(callsite, selectors) {
60
+ return {
61
+ [BUILDER_TYPE]: 7,
62
+ [BUILDER_STATE]: {
63
+ items: [],
64
+ lookup: {}
65
+ },
66
+ [BUILDER_CALLSITE]: callsite,
67
+ [BUILDER_SELECTOR]: selectors
68
+ };
69
+ }
70
+ function createScopeData(callsite) {
71
+ return {
72
+ [BUILDER_TYPE]: 4,
73
+ [BUILDER_STATE]: {
74
+ items: [],
75
+ lookup: {}
76
+ },
77
+ [BUILDER_CALLSITE]: callsite
78
+ };
79
+ }
80
+ function createScopeTargetData(scope, slot) {
81
+ return {
82
+ [BUILDER_TYPE]: 5,
83
+ [BUILDER_SCOPE]: scope,
84
+ [BUILDER_SCOPE_ID]: slot[BUILDER_SLOT_ID]
85
+ };
86
+ }
87
+ function createThemeData(callsite, id, className, tokens) {
88
+ return {
89
+ [BUILDER_TYPE]: 6,
90
+ [BUILDER_STATE]: {
91
+ items: [],
92
+ lookup: {}
93
+ },
94
+ [BUILDER_CALLSITE]: callsite,
95
+ id,
96
+ className,
97
+ tokens
98
+ };
99
+ }
100
+ const formatClassName = createNameFormatter([
101
+ "atRule",
102
+ "scopeSelector",
103
+ "property",
104
+ "selector",
105
+ "value"
106
+ ]);
107
+ const formatTransformClassName = createNameFormatter(["className"]);
108
+ function getDebugClassName(format, hash, info) {
109
+ return formatClassName(format || "[(atRule)-][(scopeSelector)-](property)[-(selector)][-(value)]--$hash", hash, info);
110
+ }
111
+ function getDebugSheetClassName(format, hash, info) {
112
+ return formatClassName(format || "sheet-(property)[-(value)]--$hash", hash, info);
113
+ }
114
+ function getDebugTransformClassName(format, hash, info) {
115
+ return formatTransformClassName(format || "(className)--$hash", hash, info);
116
+ }
117
+ //#endregion
118
+ //#region atomic/debug/value.ts
119
+ function getDebugValueName(value) {
120
+ if (!value) return {
121
+ value: null,
122
+ arbitraryValue: null
123
+ };
124
+ const normalized = value.trim().toLowerCase();
125
+ if (!normalized) return {
126
+ value: null,
127
+ arbitraryValue: null
128
+ };
129
+ if (normalized.startsWith("url") || normalized.includes("gradient") || normalized.startsWith("image") || normalized.startsWith("calc(") || normalized.startsWith("var(") || normalized.startsWith("env(") || normalized.startsWith("rgb") || normalized.startsWith("hsl")) return {
130
+ value: null,
131
+ arbitraryValue: null
132
+ };
133
+ if (/^[a-z][a-z0-9-]*$/.test(normalized)) return {
134
+ value: normalized,
135
+ arbitraryValue: null
136
+ };
137
+ const name = normalized.replace(/px/g, "").replace(/rem/g, "rem").replace(/em/g, "em").replace(/%/g, "pct").replace(/fr/g, "fr").replace(/[,()"'#]/g, "-").replace(/\s+/g, "-").replace(/[^a-z0-9._%-]+/g, "-").replace(/[-_]+/g, "-").replace(/^-+|-+$/g, "");
138
+ if (!name) return {
139
+ value: null,
140
+ arbitraryValue: null
141
+ };
142
+ return {
143
+ value: null,
144
+ arbitraryValue: name
145
+ };
146
+ }
147
+ //#endregion
148
+ //#region atomic/debug/property/data.ts
149
+ const PROPERTY_ALIASES = {
150
+ "border-radius": "radius",
151
+ "flex-direction": "flex",
152
+ "font-style": "font",
153
+ "font-weight": "font",
154
+ "grid-template-columns": "grid-cols",
155
+ "grid-template-rows": "grid-rows",
156
+ "align-items": "items",
157
+ "justify-content": "justify",
158
+ "z-index": "zindex",
159
+ "pointer-events": "pointer"
160
+ };
161
+ const KEYWORD_VALUE_PROPERTIES = new Set([
162
+ "align-content",
163
+ "align-items",
164
+ "align-self",
165
+ "background-repeat",
166
+ "background-size",
167
+ "border-collapse",
168
+ "border-style",
169
+ "box-sizing",
170
+ "clear",
171
+ "cursor",
172
+ "display",
173
+ "flex-direction",
174
+ "flex-wrap",
175
+ "float",
176
+ "font-weight",
177
+ "font-style",
178
+ "justify-content",
179
+ "justify-items",
180
+ "justify-self",
181
+ "list-style-position",
182
+ "list-style-type",
183
+ "object-fit",
184
+ "object-position",
185
+ "overflow",
186
+ "overflow-x",
187
+ "overflow-y",
188
+ "pointer-events",
189
+ "place-content",
190
+ "place-items",
191
+ "place-self",
192
+ "position",
193
+ "resize",
194
+ "table-layout",
195
+ "text-align",
196
+ "text-decoration-line",
197
+ "text-transform",
198
+ "user-select",
199
+ "vertical-align",
200
+ "visibility",
201
+ "white-space"
202
+ ]);
203
+ const ARBITRARY_VALUE_PROPERTIES = new Set(["font-weight"]);
204
+ //#endregion
205
+ //#region atomic/debug/property/property.ts
206
+ function getDebugPropertyName(property, value) {
207
+ if (!property) return null;
208
+ const normalized = normalizePropertyName(property);
209
+ const name = PROPERTY_ALIASES[normalized] || sanitizeDebugPropertyName(normalized);
210
+ if (!name) return null;
211
+ return {
212
+ property: name,
213
+ ...withKeywordValueFallback(normalized, value, withArbitraryValueFallback(normalized, getDebugValueName(value)))
214
+ };
215
+ }
216
+ function withArbitraryValueFallback(property, valueName) {
217
+ if (!valueName.arbitraryValue || ARBITRARY_VALUE_PROPERTIES.has(property)) return valueName;
218
+ return {
219
+ value: valueName.value,
220
+ arbitraryValue: null
221
+ };
222
+ }
223
+ function withKeywordValueFallback(property, value, valueName) {
224
+ if (valueName.value || valueName.arbitraryValue) return valueName;
225
+ if (!KEYWORD_VALUE_PROPERTIES.has(property)) return valueName;
226
+ const normalized = normalizeDebugKeywordValue(value);
227
+ if (!normalized) return valueName;
228
+ return {
229
+ value: normalized,
230
+ arbitraryValue: null
231
+ };
232
+ }
233
+ //#endregion
234
+ //#region atomic/debug/selector.ts
235
+ function getDebugSelectorName(selector) {
236
+ if (!selector) return null;
237
+ const normalized = selector.trim().toLowerCase();
238
+ if (/^[a-z0-9]+$/.test(normalized)) return null;
239
+ return validateName(normalized.replace(/\$\$/g, "args").replace(/\$/g, "arg").replace(/\.\.\./g, "merge").replace(/:not\(/g, "not-").replace(/:(is|where|has)\(/g, "$1-").replace(/:nth-(child|of-type)\(/g, "nth-").replace(/[.#]/g, "-").replace(/[[\]()]/g, "-").replace(/:+/g, "-").replace(/\s+/g, "-").replace(/[^a-z0-9_-]+/g, "-").replace(/[-_]+/g, "-").replace(/^-+|-+$/g, ""));
240
+ }
241
+ function getDebugAtRuleName(selector) {
242
+ if (!selector || Array.isArray(selector) && selector.length === 0) return null;
243
+ return validateName((Array.isArray(selector) ? selector.map(parseAtRule).filter(Boolean).join("-") : parseAtRule(selector)).replace(/[-_]+/g, "-").replace(/^-+|-+$/g, ""));
244
+ }
245
+ function compressQuery(query) {
246
+ return query.trim().toLowerCase().replace(/prefers-color-scheme\s*:\s*dark/g, "dark").replace(/prefers-color-scheme\s*:\s*light/g, "light").replace(/min-width\s*:\s*/g, "min-").replace(/max-width\s*:\s*/g, "max-").replace(/min-height\s*:\s*/g, "minh-").replace(/max-height\s*:\s*/g, "maxh-").replace(/inline-size/g, "inline").replace(/\b(and|or|only|not)\b/g, "").replace(/>=/g, "-gte-").replace(/<=/g, "-lte-").replace(/>/g, "-gt-").replace(/</g, "-lt-").replace(/[():=\s]+/g, "-").replace(/[-_]+/g, "-").replace(/^-+|-+$/g, "");
247
+ }
248
+ function validateName(name) {
249
+ if (!name || name === "selector" || name.length < 2) return null;
250
+ return name;
251
+ }
252
+ function parseAtRule(rule) {
253
+ const normalized = rule.trim().toLowerCase();
254
+ if (normalized.startsWith("@media")) return compressQuery(normalized.slice(6));
255
+ if (normalized.startsWith("@container")) return compressQuery(normalized.slice(10));
256
+ if (normalized.startsWith("@supports")) return compressQuery(normalized.slice(9));
257
+ return compressQuery(normalized);
258
+ }
259
+ //#endregion
260
+ //#region atomic/className.ts
261
+ function getAtomicClassName(property, priority, important, value, selector, parentSelector, atRule, callsite, localClassName, debugClassName, classNameFormat, transformClassName, transformClassNameFormat, sheetClassNameFormat = null, hashLength = null) {
262
+ let hash = property;
263
+ hash += "\n" + (priority || "");
264
+ if (important) hash += "\nimportant";
265
+ hash += "\n" + value;
266
+ hash += "\n" + (selector ? getSelectorHash(selector) : "");
267
+ hash += "\n" + (parentSelector ? getSelectorHash(parentSelector) : "");
268
+ hash += "\n" + (atRule ? atRule.map(getSelectorHash).join("\n") : "");
269
+ hash += "\n" + getCallsiteHash(callsite, localClassName);
270
+ hash = getIdentifierSafeHash(hash, hashLength ?? getRuntimeClassNameHashLength(debugClassName));
271
+ if (!debugClassName) return hash;
272
+ if (transformClassName) return getDebugTransformClassName(transformClassNameFormat, hash, { className: transformClassName });
273
+ const propertyName = getDebugPropertyName(property, value);
274
+ const isSheetClassName = hasSheetSelectorAnchor(selector);
275
+ return (isSheetClassName ? getDebugSheetClassName : getDebugClassName)(isSheetClassName ? sheetClassNameFormat : classNameFormat, hash, {
276
+ atRule: atRule ? getDebugAtRuleName(atRule.map(getSelectorText$1)) : null,
277
+ scopeSelector: parentSelector ? getDebugSelectorName(getSelectorText$1(parentSelector)) : null,
278
+ selector: selector ? getDebugSelectorName(getSelectorText$1(selector)) : null,
279
+ property: propertyName ? propertyName.property : property,
280
+ value: propertyName ? propertyName.value ?? propertyName.arbitraryValue : null
281
+ });
282
+ }
283
+ function getRuntimeClassNameHashLength(debugClassName) {
284
+ if (debugClassName && DEV_CONFIG.isDev) return DEV_CONFIG.hashLength ?? CSS_CONFIG.hashLength ?? 3;
285
+ return CSS_CONFIG.hashLength ?? 7;
286
+ }
287
+ function getClassNameDedupe(property, priority, important, selector, parentSelector, atRule) {
288
+ let hash = property;
289
+ hash += "\n" + (priority || "");
290
+ if (important) hash += "\nimportant";
291
+ hash += "\n" + (selector ? getSelectorHash(selector) : "");
292
+ hash += "\n" + (parentSelector ? getSelectorHash(parentSelector) : "");
293
+ hash += "\n" + (atRule ? atRule.map(getSelectorHash).join("\n") : "");
294
+ return hashString(hash);
295
+ }
296
+ function getCallsiteHash(callsite, localClassName) {
297
+ if (!localClassName || !callsite) return "";
298
+ return callsite.filePath + "\n" + callsite.line + ":" + callsite.column;
299
+ }
300
+ //#endregion
301
+ //#region builder/data/merge/utils.ts
302
+ function cloneData(data, source, debug, merge = true) {
303
+ const runtimeType = DEV_CONFIG.isDev ? debug ? -2 : -1 : -3;
304
+ const state = data[BUILDER_STATE];
305
+ state.items = merge ? source[BUILDER_STATE].items.slice() : [];
306
+ state.lookup = Object.assign(Object.create(null), merge ? source[BUILDER_STATE].lookup : null);
307
+ const lookup = state.lookup;
308
+ return [
309
+ runtimeType,
310
+ data,
311
+ state.items,
312
+ lookup
313
+ ];
314
+ }
315
+ function logInvalidData(message, data) {
316
+ console.log(traceError(message), "data:", data);
317
+ }
318
+ //#endregion
319
+ //#region builder/data/merge/scope.ts
320
+ function mergeScopeData(scope, callsite, items, debug, parentSelector, scopeAtRule) {
321
+ if (!items) return scope;
322
+ const sourceItems = Array.isArray(items) ? items : [items];
323
+ const [runtimeType, data, styles, lookup] = cloneData(scope, scope, debug);
324
+ let source;
325
+ let item;
326
+ let lookupIndex;
327
+ let weight;
328
+ let important;
329
+ let value;
330
+ let atRule;
331
+ let dedupe;
332
+ let className;
333
+ let itemDebug;
334
+ let itemCallsite;
335
+ for (let i = 0, len = sourceItems.length; i < len; i++) {
336
+ source = sourceItems[i];
337
+ if (!source) continue;
338
+ if (isStyleTokenOverrideData(source)) {
339
+ addTokenOverride(source, styles, lookup);
340
+ continue;
341
+ }
342
+ if (isScopeData(source)) {
343
+ const scopeItems = source[BUILDER_STATE].items;
344
+ for (let j = 0, len = scopeItems.length; j < len; j++) {
345
+ item = scopeItems[j];
346
+ if (isStyleTokenOverrideData(item)) {
347
+ addTokenOverride(item, styles, lookup);
348
+ continue;
349
+ }
350
+ if (Array.isArray(item) || item.type !== 4) {
351
+ logInvalidData("invalid scope data", {
352
+ source,
353
+ item
354
+ });
355
+ continue;
356
+ }
357
+ const sourceScopeItem = item;
358
+ atRule = scopeAtRule ? sourceScopeItem.atRule ? [scopeAtRule].concat(sourceScopeItem.atRule) : [scopeAtRule] : sourceScopeItem.atRule;
359
+ const scopeItem = {
360
+ ...sourceScopeItem,
361
+ runtime: runtimeType,
362
+ atRule,
363
+ parentSelector: parentSelector ?? sourceScopeItem.parentSelector
364
+ };
365
+ itemDebug = getMergedScopeDebug(debug, scopeItem);
366
+ itemCallsite = getDebugFieldCallsite(itemDebug ?? null, scopeItem.property) ?? callsite ?? scopeItem.callsite;
367
+ value = scopeItem.value;
368
+ weight = scopeItem.weight;
369
+ important = scopeItem.important;
370
+ dedupe = getClassNameDedupe(scopeItem.property, weight, important, scopeItem.selector, scopeItem.parentSelector, scopeItem.atRule);
371
+ className = getAtomicClassName(scopeItem.property, weight, important, value, scopeItem.selector, scopeItem.parentSelector, scopeItem.atRule, itemCallsite, DEV_CONFIG.isLocalClassNameEnabled, DEBUG_CONFIG.isDebugClassNameEnabled, CSS_CONFIG.classNameFormat ?? null, scopeItem.transformClassName ?? null, CSS_CONFIG.transformClassNameFormat ?? null, CSS_CONFIG.sheetClassNameFormat ?? null);
372
+ scopeItem.dedupe = dedupe;
373
+ scopeItem.className = className;
374
+ scopeItem.callsite = itemCallsite;
375
+ scopeItem.debug = itemDebug ?? null;
376
+ scopeItem.debugField = itemDebug ? scopeItem.property : null;
377
+ const lookupKey = getScopeLookupKey(scopeItem.slotId, dedupe);
378
+ lookupIndex = lookup[lookupKey];
379
+ if (typeof lookupIndex === "number") styles[lookupIndex] = scopeItem;
380
+ else lookup[lookupKey] = styles.push(scopeItem) - 1;
381
+ }
382
+ continue;
383
+ }
384
+ if (!isSlotOverrideData(source)) {
385
+ logInvalidData("invalid scope data", { source });
386
+ continue;
387
+ }
388
+ const slotId = source[BUILDER_SLOT_ID];
389
+ const overrideItems = source[BUILDER_STATE].items;
390
+ for (let j = 0, len = overrideItems.length; j < len; j++) {
391
+ item = overrideItems[j];
392
+ if (Array.isArray(item) || isStyleTokenOverrideData(item) || item.type !== 3) {
393
+ logInvalidData("invalid scope data", {
394
+ source,
395
+ item
396
+ });
397
+ continue;
398
+ }
399
+ const overrideItem = item;
400
+ atRule = scopeAtRule ? overrideItem.atRule ? [scopeAtRule].concat(overrideItem.atRule) : [scopeAtRule] : overrideItem.atRule;
401
+ const scopeItem = {
402
+ type: 4,
403
+ slotId,
404
+ runtime: runtimeType,
405
+ dedupe: "",
406
+ className: "",
407
+ property: overrideItem.property,
408
+ weight: overrideItem.weight,
409
+ important: overrideItem.important,
410
+ value: overrideItem.value,
411
+ transformClassName: overrideItem.transformClassName,
412
+ token: overrideItem.token,
413
+ selector: overrideItem.selector,
414
+ atRule,
415
+ callsite: overrideItem.callsite ?? callsite,
416
+ debug: overrideItem.debug,
417
+ debugField: overrideItem.debugField,
418
+ parentSelector
419
+ };
420
+ value = scopeItem.value;
421
+ weight = scopeItem.weight;
422
+ important = scopeItem.important;
423
+ dedupe = getClassNameDedupe(scopeItem.property, weight, important, scopeItem.selector, parentSelector, scopeItem.atRule);
424
+ className = getAtomicClassName(scopeItem.property, weight, important, value, scopeItem.selector, parentSelector, scopeItem.atRule, scopeItem.callsite, DEV_CONFIG.isLocalClassNameEnabled, DEBUG_CONFIG.isDebugClassNameEnabled, CSS_CONFIG.classNameFormat ?? null, scopeItem.transformClassName ?? null, CSS_CONFIG.transformClassNameFormat ?? null, CSS_CONFIG.sheetClassNameFormat ?? null);
425
+ scopeItem.dedupe = dedupe;
426
+ scopeItem.className = className;
427
+ const lookupKey = getScopeLookupKey(slotId, dedupe);
428
+ lookupIndex = lookup[lookupKey];
429
+ if (typeof lookupIndex === "number") styles[lookupIndex] = scopeItem;
430
+ else lookup[lookupKey] = styles.push(scopeItem) - 1;
431
+ }
432
+ }
433
+ return data;
434
+ }
435
+ function addTokenOverride(item, styles, lookup) {
436
+ const lookupKey = getTokenLookupKey(getStyleTokenId(item));
437
+ const lookupIndex = lookup[lookupKey];
438
+ if (typeof lookupIndex === "number") styles[lookupIndex] = item;
439
+ else lookup[lookupKey] = styles.push(item) - 1;
440
+ }
441
+ function getMergedScopeDebug(debug, item) {
442
+ if (!debug) return item.debug;
443
+ if (debug.fields?.[item.property]) return debug;
444
+ const valueLoc = getRuntimeScopeItemValueLoc(item);
445
+ if (!valueLoc) return debug;
446
+ return {
447
+ ...debug,
448
+ fields: {
449
+ ...debug.fields,
450
+ [item.property]: {
451
+ [0]: debug.loc,
452
+ [1]: valueLoc
453
+ }
454
+ }
455
+ };
456
+ }
457
+ function getRuntimeScopeItemValueLoc(item) {
458
+ if (item.debug && item.debugField) {
459
+ const loc = item.debug.fields?.[item.debugField];
460
+ if (Array.isArray(loc)) return withDebugSource$1(loc, item.debug.sourceUrl, item.debug.code);
461
+ if (loc) {
462
+ const valueLoc = loc[1] ?? loc[0] ?? null;
463
+ return valueLoc ? withDebugSource$1(valueLoc, item.debug.sourceUrl, item.debug.code) : null;
464
+ }
465
+ }
466
+ return item.callsite ? [
467
+ item.callsite.line,
468
+ item.callsite.column,
469
+ void 0,
470
+ item.callsite.sourceUrl,
471
+ item.callsite.sourceContent
472
+ ] : null;
473
+ }
474
+ function withDebugSource$1(loc, sourceUrl, sourceContent) {
475
+ return loc[3] ? loc : [
476
+ loc[0],
477
+ loc[1],
478
+ loc[2],
479
+ sourceUrl,
480
+ sourceContent
481
+ ];
482
+ }
483
+ function getScopeLookupKey(slotId, dedupe) {
484
+ return slotId + "\0" + dedupe;
485
+ }
486
+ function getTokenLookupKey(tokenId) {
487
+ return "token\0" + tokenId;
488
+ }
489
+ //#endregion
490
+ //#region style/important.ts
491
+ const STYLE_IMPORTANT = symbol("style.important");
492
+ function importantValue(value) {
493
+ return {
494
+ [STYLE_IMPORTANT]: true,
495
+ value
496
+ };
497
+ }
498
+ function isStyleImportantValue(value) {
499
+ return !!value && typeof value === "object" && value[STYLE_IMPORTANT] === true;
500
+ }
501
+ //#endregion
502
+ //#region style/transform.ts
503
+ const CLASS_NAME_VALUE = symbol("transform.classNameValue");
504
+ function classNameValue(value, className) {
505
+ return {
506
+ [CLASS_NAME_VALUE]: true,
507
+ value,
508
+ className
509
+ };
510
+ }
511
+ function isClassNameValue(value) {
512
+ return !!value && typeof value === "object" && value[CLASS_NAME_VALUE] === true && typeof value.className === "string";
513
+ }
514
+ function styleTransform(options) {
515
+ return options;
516
+ }
517
+ function classNameTransform(options) {
518
+ return options;
519
+ }
520
+ //#endregion
521
+ //#region style/valueRef.ts
522
+ const AT_RULE_REF = symbol("atRule.ref");
523
+ function createAtRuleRef(data) {
524
+ return {
525
+ [AT_RULE_REF]: true,
526
+ ...data
527
+ };
528
+ }
529
+ function isAtRuleRef(value) {
530
+ return !!value && typeof value === "object" && value[AT_RULE_REF] === true;
531
+ }
532
+ //#endregion
533
+ //#region style/weight.ts
534
+ const STYLE_WEIGHT = symbol("style.weight");
535
+ function weightValue(value, weight) {
536
+ return {
537
+ [STYLE_WEIGHT]: true,
538
+ value,
539
+ weight
540
+ };
541
+ }
542
+ function isStyleWeightValue(value) {
543
+ return !!value && typeof value === "object" && value[STYLE_WEIGHT] === true;
544
+ }
545
+ //#endregion
546
+ //#region builder/data/merge/style.ts
547
+ function mergeBuilderData(create, callsite, source, style, debug, selector, atRule, type) {
548
+ if (!style) return source;
549
+ const [runtimeType, data, styles, lookup] = cloneData(create(callsite, source), source, debug);
550
+ const slotId = isSlotData(source) || isSlotOverrideData(source) ? source[BUILDER_SLOT_ID] : null;
551
+ const items = [];
552
+ let item;
553
+ let itemData;
554
+ let valueRaw;
555
+ let value;
556
+ let weight;
557
+ let important;
558
+ let itemCallsite;
559
+ let className;
560
+ let dedupe;
561
+ let token;
562
+ let ref;
563
+ let variableName;
564
+ let transformClassName;
565
+ let lookupIndex;
566
+ if (isStyleData(style)) {
567
+ const stylesItems = style[BUILDER_STATE].items;
568
+ for (let i = 0, len = stylesItems.length; i < len; i++) {
569
+ item = stylesItems[i];
570
+ if (Array.isArray(item) || isStyleTokenOverrideData(item) || item.type !== 1) {
571
+ logInvalidData("invalid style data", {
572
+ item,
573
+ style
574
+ });
575
+ continue;
576
+ }
577
+ if (atRule) item = Object.assign({}, item, { atRule: item.atRule ? atRule.concat(item.atRule) : atRule });
578
+ if (selector) item = Object.assign({}, item, { selector: item.selector ? combineSelectors(selector, item.selector) : selector });
579
+ if (type === 2 && slotId !== null) item = Object.assign({}, item, {
580
+ type: 2,
581
+ slotId
582
+ });
583
+ else if (type === 3 && slotId !== null) item = Object.assign({}, item, {
584
+ type: 3,
585
+ slotId
586
+ });
587
+ else if (type === 8) item = Object.assign({}, item, { type: 1 });
588
+ const itemDebug = getMergedStyleDebug(debug, item);
589
+ const debugCallsite = getDebugFieldCallsite(itemDebug, item.property);
590
+ if (debugCallsite) item = Object.assign({}, item, {
591
+ callsite: debugCallsite,
592
+ debug: itemDebug,
593
+ debugField: item.property
594
+ });
595
+ items.push(item);
596
+ }
597
+ } else for (const property in style) {
598
+ valueRaw = style[property];
599
+ [valueRaw, weight, important] = unwrapAuthoredStyleValue(valueRaw);
600
+ transformClassName = null;
601
+ if (isClassNameValue(valueRaw)) {
602
+ transformClassName = valueRaw.className;
603
+ valueRaw = valueRaw.value;
604
+ }
605
+ ref = isAtRuleRef(valueRaw) ? valueRaw : null;
606
+ if (ref) valueRaw = ref.value;
607
+ token = isStyleTokenData(valueRaw) ? valueRaw : null;
608
+ variableName = getDebugFieldVarName(debug, property);
609
+ value = variableName && token ? getCssVarRawFallback(variableName, getTokenVar(token, CSS_CONFIG.tokenNameFormat ?? null)) : token ? getTokenVar(token, CSS_CONFIG.tokenNameFormat ?? null) : String(valueRaw ?? "");
610
+ itemCallsite = getDebugFieldCallsite(debug, property) ?? callsite;
611
+ itemData = {
612
+ runtime: runtimeType,
613
+ debug,
614
+ debugField: property,
615
+ dedupe: "",
616
+ className: "",
617
+ property,
618
+ weight,
619
+ important,
620
+ value,
621
+ transformClassName,
622
+ variable: ref ? [3, ref] : variableName && token ? [
623
+ 1,
624
+ variableName,
625
+ valueRaw,
626
+ shouldAppendCssPx(property) ? 1 : void 0
627
+ ] : ref ? [3, ref] : void 0,
628
+ token,
629
+ selector,
630
+ atRule,
631
+ callsite: itemCallsite
632
+ };
633
+ if (type === 1 || type === 8) {
634
+ items.push({
635
+ ...itemData,
636
+ type: 1
637
+ });
638
+ continue;
639
+ }
640
+ if (slotId === null) {
641
+ logInvalidData("invalid style data", {
642
+ property,
643
+ style
644
+ });
645
+ continue;
646
+ }
647
+ if (type === 2) {
648
+ items.push({
649
+ ...itemData,
650
+ type: 2,
651
+ slotId
652
+ });
653
+ continue;
654
+ }
655
+ if (type === 3) {
656
+ items.push({
657
+ ...itemData,
658
+ type: 3,
659
+ slotId
660
+ });
661
+ continue;
662
+ }
663
+ logInvalidData("invalid style data", {
664
+ property,
665
+ style
666
+ });
667
+ }
668
+ if (!items.length) return data;
669
+ for (let i = 0, len = items.length; i < len; i++) {
670
+ item = items[i];
671
+ if (Array.isArray(item) || isStyleTokenOverrideData(item)) {
672
+ logInvalidData("invalid style data", {
673
+ item,
674
+ style
675
+ });
676
+ continue;
677
+ }
678
+ const runtimeItem = item;
679
+ value = runtimeItem.value;
680
+ weight = runtimeItem.weight;
681
+ important = runtimeItem.important;
682
+ dedupe = getClassNameDedupe(runtimeItem.property, weight, important, runtimeItem.selector, null, runtimeItem.atRule);
683
+ className = getAtomicClassName(runtimeItem.property, weight, important, value, runtimeItem.selector, null, runtimeItem.atRule, runtimeItem.callsite, DEV_CONFIG.isLocalClassNameEnabled, DEBUG_CONFIG.isDebugClassNameEnabled, CSS_CONFIG.classNameFormat ?? null, runtimeItem.transformClassName ?? null, CSS_CONFIG.transformClassNameFormat ?? null, CSS_CONFIG.sheetClassNameFormat ?? null);
684
+ runtimeItem.dedupe = dedupe;
685
+ runtimeItem.className = className;
686
+ lookupIndex = lookup[dedupe];
687
+ if (typeof lookupIndex === "number") styles[lookupIndex] = runtimeItem;
688
+ else lookup[dedupe] = styles.push(runtimeItem) - 1;
689
+ }
690
+ return data;
691
+ }
692
+ function unwrapAuthoredStyleValue(value) {
693
+ let weight = null;
694
+ let important = false;
695
+ while (true) {
696
+ if (isStyleImportantValue(value)) {
697
+ important = true;
698
+ value = value.value;
699
+ continue;
700
+ }
701
+ if (isStyleWeightValue(value)) {
702
+ weight = value.weight;
703
+ value = value.value;
704
+ continue;
705
+ }
706
+ break;
707
+ }
708
+ return [
709
+ value,
710
+ weight,
711
+ important
712
+ ];
713
+ }
714
+ function combineSelectors(parent, child) {
715
+ const parentText = getSelectorText(parent);
716
+ const childText = getSelectorText(child);
717
+ const priority = Math.max(getSelectorPriority(parent), getSelectorPriority(child));
718
+ const selector = parentText + childText;
719
+ return priority > 0 ? [selector, priority] : selector;
720
+ }
721
+ function getSelectorText(selector) {
722
+ return Array.isArray(selector) ? selector[0] : selector;
723
+ }
724
+ function getSelectorPriority(selector) {
725
+ return Array.isArray(selector) ? selector[1] : 0;
726
+ }
727
+ function getMergedStyleDebug(debug, item) {
728
+ if (!debug) return null;
729
+ if (debug.fields?.[item.property]) return debug;
730
+ const valueLoc = getMergedItemValueLoc(item);
731
+ if (!valueLoc) return debug;
732
+ return {
733
+ ...debug,
734
+ fields: {
735
+ ...debug.fields,
736
+ [item.property]: {
737
+ [0]: withDebugSource(debug.loc, debug),
738
+ [1]: valueLoc
739
+ }
740
+ }
741
+ };
742
+ }
743
+ function getMergedItemValueLoc(item) {
744
+ if (item.debug && item.debugField) {
745
+ const loc = item.debug.fields?.[item.debugField];
746
+ if (Array.isArray(loc)) return withDebugSource(loc, item.debug);
747
+ if (loc) {
748
+ const traceLoc = loc[1] ?? loc[0] ?? null;
749
+ return traceLoc ? withDebugSource(traceLoc, item.debug) : null;
750
+ }
751
+ }
752
+ return item.callsite ? [
753
+ item.callsite.line,
754
+ item.callsite.column,
755
+ void 0,
756
+ item.callsite.sourceUrl,
757
+ item.callsite.sourceContent
758
+ ] : null;
759
+ }
760
+ function withDebugSource(loc, debug) {
761
+ return loc[3] ? loc : [
762
+ loc[0],
763
+ loc[1],
764
+ loc[2],
765
+ debug.sourceUrl,
766
+ debug.code
767
+ ];
768
+ }
769
+ //#endregion
770
+ //#region builder/data/selector.ts
771
+ const SELECTOR_MEDIA = "@media";
772
+ const SELECTOR_CONTAINER = "@container";
773
+ function normalizeSelectorArg(arg) {
774
+ return arg.includes("\n") ? arg.replace(/\n/g, "") : arg;
775
+ }
776
+ //#endregion
777
+ //#region runtime/core/getToken.ts
778
+ function getToken(value) {
779
+ if (isStyleTokenData(value)) return getTokenVar(value, CSS_CONFIG.tokenNameFormat ?? null);
780
+ return value;
781
+ }
782
+ //#endregion
783
+ //#region builder/style_data.ts
784
+ const mergeStyleCreate = (callsite) => {
785
+ return createStyleData(callsite);
786
+ };
787
+ const mergeStyleData = createMerge(mergeStyleCreate, 1);
788
+ const mergeSheetCreate = (callsite) => {
789
+ return createSheetData(callsite);
790
+ };
791
+ const mergeSheetData = createMerge(mergeSheetCreate, 1);
792
+ const mergeSlotCreate = (callsite, data) => {
793
+ return createSlotData(callsite, data[BUILDER_SLOT_ID]);
794
+ };
795
+ const mergeSlotData = createMerge(mergeSlotCreate, 2);
796
+ const mergeSlotOverrideCreate = (callsite, data) => {
797
+ return createSlotOverrideData(callsite, data[BUILDER_SLOT_ID]);
798
+ };
799
+ const mergeSlotOverrideData = createMerge(mergeSlotOverrideCreate, 3);
800
+ const mergeSelectorOverrideCreate = (callsite, data) => {
801
+ return createSelectorOverrideData(callsite, data[BUILDER_SELECTOR]);
802
+ };
803
+ const mergeSelectorOverrideData = createMerge(mergeSelectorOverrideCreate, 8);
804
+ function createMerge(create, type) {
805
+ return (data, callsite, style, debug, selector, atRule) => {
806
+ return mergeBuilderData(create, callsite, data, style, debug, selector, atRule, type);
807
+ };
808
+ }
809
+ //#endregion
810
+ //#region builder/utils.ts
811
+ const FnPrefixStyle = "style.";
812
+ const FnPrefixSlot = "slot.";
813
+ const FnPrefixScope = "scope.";
814
+ const FnPrefixSelector = "selector.";
815
+ function runtimeCallsite() {
816
+ return traceCallsite();
817
+ }
818
+ function resolveCallsite(debug) {
819
+ return debug ? getDebugCallsite(debug) : runtimeCallsite();
820
+ }
821
+ function transformStyle(style, transform) {
822
+ return transform ? transform.transform(style) : style;
823
+ }
824
+ //#endregion
825
+ //#region atomic/atRule/utils.ts
826
+ function createAtRuleNameFormatter(defaultFormat, prefix) {
827
+ const formatter = createNameFormatter(["name"]);
828
+ return (format, id, info) => {
829
+ const hash = getIdentifierSafeHash(id, CSS_CONFIG.hashLength);
830
+ const name = formatter(format || defaultFormat, hash, info);
831
+ if (!prefix) return name;
832
+ return name.startsWith(prefix) ? name : prefix + name;
833
+ };
834
+ }
835
+ function buildNamedAtRuleCss(atRule, name, descriptors, tokens, tokenLookup, tokenNameFormat) {
836
+ return `@${atRule} ${name} {${buildAtRuleDeclarationCss(descriptors, tokens, tokenLookup, tokenNameFormat, true)}}`;
837
+ }
838
+ function buildAtRuleDeclarationCss(style, tokens, tokenLookup, tokenNameFormat, rawValue, shouldInclude) {
839
+ let css = "";
840
+ for (const property in style) {
841
+ if (shouldInclude && !shouldInclude(property)) continue;
842
+ let value = style[property];
843
+ if (Array.isArray(value) && value.length === 2 && typeof value[0] === "number") value = value[1];
844
+ if (isStyleTokenData(value)) {
845
+ const tokenId = getStyleTokenId(value);
846
+ if (!tokenLookup.has(tokenId)) {
847
+ tokenLookup.add(tokenId);
848
+ tokens.push(value);
849
+ }
850
+ css += `${getCssPropertyName(property)}: ${getTokenVar(value, tokenNameFormat)};`;
851
+ continue;
852
+ }
853
+ const valueString = String(value ?? "");
854
+ css += `${getCssPropertyName(property)}: ${rawValue ? valueString : getCssPropertyValue(property, valueString)};`;
855
+ }
856
+ return css;
857
+ }
858
+ //#endregion
859
+ //#region atomic/atRule/counterStyle.ts
860
+ const COUNTER_STYLE_AT_RULE = "counter-style";
861
+ const formatCounterStyleName = createAtRuleNameFormatter("counter-style[-(name)]-$hash");
862
+ function buildCounterStyleCss(format, name, id, descriptors, tokens, tokenLookup, tokenNameFormat) {
863
+ name = formatCounterStyleName(format, id, { name });
864
+ const css = buildNamedAtRuleCss(COUNTER_STYLE_AT_RULE, name, descriptors, tokens, tokenLookup, tokenNameFormat);
865
+ return {
866
+ name,
867
+ css
868
+ };
869
+ }
870
+ //#endregion
871
+ //#region utils/id.ts
872
+ function createIdCounter(name) {
873
+ return globalData("idCounter." + name, () => ({ value: 0 }));
874
+ }
875
+ function getId(idCounter, stableId) {
876
+ return stableId || {
877
+ name: null,
878
+ id: String(idCounter.value++)
879
+ };
880
+ }
881
+ //#endregion
882
+ //#region css/utils.ts
883
+ function createNamedAtRuleRef(config) {
884
+ const { id, name } = getId(config.idCounter, config.stableId || null);
885
+ const tokens = [];
886
+ const tokenLookup = /* @__PURE__ */ new Set();
887
+ const css = config.buildCss(config.format || null, name, id, config.value, tokens, tokenLookup, CSS_CONFIG.tokenNameFormat || null);
888
+ return createAtRuleRef({
889
+ key: css.name,
890
+ value: css.name,
891
+ css: css.css,
892
+ tokens: tokens.length ? tokens : void 0
893
+ });
894
+ }
895
+ //#endregion
896
+ //#region css/counterStyle.ts
897
+ const idCounter$5 = createIdCounter("counterStyle");
898
+ function createCounterStyle(descriptors, stableId) {
899
+ return createNamedAtRuleRef({
900
+ format: CSS_EXTRA_CONFIG.namedRuleFormat.counterStyle,
901
+ buildCss: buildCounterStyleCss,
902
+ value: descriptors,
903
+ idCounter: idCounter$5,
904
+ stableId
905
+ });
906
+ }
907
+ //#endregion
908
+ //#region atomic/atRule/fontFace.ts
909
+ const FONT_FACE_AT_RULE = "font-face";
910
+ const formatFontFaceName = createAtRuleNameFormatter("font[-(name)]-$hash");
911
+ function buildFontFaceCss(format, name, id, descriptors, tokens, tokenLookup, tokenNameFormat) {
912
+ name = formatFontFaceName(format, id, { name });
913
+ let css = buildAtRuleDeclarationCss(descriptors, tokens, tokenLookup, tokenNameFormat, true, (property) => property !== "fontFamily");
914
+ css = `@${FONT_FACE_AT_RULE} { font-family: ${name}; ${css} }`;
915
+ return {
916
+ name,
917
+ css
918
+ };
919
+ }
920
+ //#endregion
921
+ //#region atomic/atRule/fontSrc.ts
922
+ function fontSrc(url, format) {
923
+ if (typeof url !== "string") throw new Error("fontSrc url must be a static string");
924
+ const src = `url("${escapeFontSrcPart(url)}")`;
925
+ return format ? `${src} format("${escapeFontSrcPart(format)}")` : src;
926
+ }
927
+ function escapeFontSrcPart(value) {
928
+ return value.replace(/\\/g, "\\\\").replace(/"/g, "\\\"");
929
+ }
930
+ //#endregion
931
+ //#region css/fontFace.ts
932
+ const idCounter$4 = createIdCounter("fontFace");
933
+ function createFontFace(descriptors, stableId) {
934
+ if (typeof descriptors.src !== "string") throw new Error("createFontFace \"src\" must be a static string");
935
+ return createNamedAtRuleRef({
936
+ format: CSS_EXTRA_CONFIG.namedRuleFormat.fontFace,
937
+ buildCss: buildFontFaceCss,
938
+ value: descriptors,
939
+ idCounter: idCounter$4,
940
+ stableId
941
+ });
942
+ }
943
+ //#endregion
944
+ //#region atomic/atRule/fontPaletteValues.ts
945
+ const FONT_PALETTE_VALUES_AT_RULE = "font-palette-values";
946
+ const formatFontPaletteValuesName = createAtRuleNameFormatter("font-palettle[-(name)]-$hash", "--");
947
+ function buildFontPaletteValuesCss(format, name, id, descriptors, tokens, tokenLookup, tokenNameFormat) {
948
+ name = formatFontPaletteValuesName(format, id, { name });
949
+ const css = buildNamedAtRuleCss(FONT_PALETTE_VALUES_AT_RULE, name, descriptors, tokens, tokenLookup, tokenNameFormat);
950
+ return {
951
+ name,
952
+ css
953
+ };
954
+ }
955
+ //#endregion
956
+ //#region css/fontPaletteValues.ts
957
+ const idCounter$3 = createIdCounter("fontPaletteValues");
958
+ function createFontPaletteValues(descriptors, stableId) {
959
+ return createNamedAtRuleRef({
960
+ format: CSS_EXTRA_CONFIG.namedRuleFormat.fontPaletteValues,
961
+ buildCss: buildFontPaletteValuesCss,
962
+ value: descriptors,
963
+ idCounter: idCounter$3,
964
+ stableId
965
+ });
966
+ }
967
+ //#endregion
968
+ //#region atomic/atRule/keyframes.ts
969
+ const KEYFRAMES_AT_RULE = "keyframes";
970
+ const formatKeyFramesName = createAtRuleNameFormatter("keyframes[-(name)]-$hash");
971
+ function buildKeyframesCss(format, name, id, frames, tokens, tokenLookup, tokenNameFormat) {
972
+ name = formatKeyFramesName(format, id, { name });
973
+ let css = `@${KEYFRAMES_AT_RULE} ${name} {`;
974
+ for (const selector in frames) {
975
+ const frame = frames[selector];
976
+ if (!frame) continue;
977
+ css += selector + "{";
978
+ css += buildAtRuleDeclarationCss(frame, tokens, tokenLookup, tokenNameFormat, false);
979
+ css += "}";
980
+ }
981
+ css += "}";
982
+ return {
983
+ name,
984
+ css
985
+ };
986
+ }
987
+ //#endregion
988
+ //#region css/keyframes.ts
989
+ const idCounter$2 = createIdCounter("keyframes");
990
+ function createKeyframes(frames, stableId) {
991
+ return createNamedAtRuleRef({
992
+ format: CSS_EXTRA_CONFIG.namedRuleFormat.keyframes,
993
+ buildCss: buildKeyframesCss,
994
+ value: frames,
995
+ idCounter: idCounter$2,
996
+ stableId
997
+ });
998
+ }
999
+ //#endregion
1000
+ //#region atomic/atRule/positionTry.ts
1001
+ const POSITION_TRY_AT_RULE = "position-try";
1002
+ const formatPositionTryName = createAtRuleNameFormatter("position-try[-(name)]-$hash", "--");
1003
+ function buildPositionTryCss(format, name, id, descriptors, tokens, tokenLookup, tokenNameFormat) {
1004
+ name = formatPositionTryName(format, id, { name });
1005
+ const css = buildNamedAtRuleCss(POSITION_TRY_AT_RULE, name, descriptors, tokens, tokenLookup, tokenNameFormat);
1006
+ return {
1007
+ name,
1008
+ css
1009
+ };
1010
+ }
1011
+ //#endregion
1012
+ //#region css/positionTry.ts
1013
+ const idCounter$1 = createIdCounter("positionTry");
1014
+ function createPositionTry(descriptors, stableId) {
1015
+ return createNamedAtRuleRef({
1016
+ format: CSS_EXTRA_CONFIG.namedRuleFormat.positionTry,
1017
+ buildCss: buildPositionTryCss,
1018
+ value: descriptors,
1019
+ idCounter: idCounter$1,
1020
+ stableId
1021
+ });
1022
+ }
1023
+ //#endregion
1024
+ //#region atomic/atRule/property.ts
1025
+ const PROPERTY_AT_RULE = "property";
1026
+ const formatPropertyName = createAtRuleNameFormatter("[-(name)]-$hash", "--");
1027
+ function buildPropertyCss(format, name, id, descriptors, tokens, tokenLookup, tokenNameFormat) {
1028
+ name = formatPropertyName(format, id, { name });
1029
+ return {
1030
+ css: buildNamedAtRuleCss(PROPERTY_AT_RULE, name, descriptors, tokens, tokenLookup, tokenNameFormat),
1031
+ name
1032
+ };
1033
+ }
1034
+ //#endregion
1035
+ //#region css/property.ts
1036
+ const idCounter = createIdCounter("property");
1037
+ function createProperty(nameOrDescriptors, descriptorsOrStableId) {
1038
+ const descriptors = typeof nameOrDescriptors === "string" ? descriptorsOrStableId : nameOrDescriptors;
1039
+ return createNamedAtRuleRef({
1040
+ idCounter,
1041
+ stableId: typeof nameOrDescriptors === "string" ? {
1042
+ name: nameOrDescriptors,
1043
+ id: nameOrDescriptors
1044
+ } : descriptorsOrStableId,
1045
+ format: CSS_EXTRA_CONFIG.namedRuleFormat.property,
1046
+ value: descriptors,
1047
+ buildCss: buildPropertyCss
1048
+ });
1049
+ }
1050
+ //#endregion
1051
+ //#region css/sheet.ts
1052
+ function createSheet(items, debug) {
1053
+ const callsite = resolveCallsite(debug);
1054
+ let data = createSheetData(callsite);
1055
+ if (items) data = mergeSheetItems(data, callsite, items);
1056
+ return data;
1057
+ }
1058
+ function mergeSheetItems(data, callsite, items) {
1059
+ if (!items) return data;
1060
+ if (Array.isArray(items)) {
1061
+ let next = data;
1062
+ for (let i = 0, len = items.length; i < len; i++) next = mergeSheetItems(next, callsite, items[i]);
1063
+ return next;
1064
+ }
1065
+ if (isStyleTokenOverrideData(items)) {
1066
+ addSheetTokenOverride(data, items);
1067
+ return data;
1068
+ }
1069
+ if (!isSelectorData(items) && !isSelectorOverrideData(items)) throw new Error("createSheet(items) requires selector items from style.selector(...) or token overrides");
1070
+ const selectorItem = items;
1071
+ const selectors = getSelectorSelectors(selectorItem);
1072
+ let next = data;
1073
+ if (isSelectorData(selectorItem)) return next;
1074
+ for (let i = 0, len = selectors.length; i < len; i++) next = mergeSheetData(next, callsite, getSelectorItemStyleData(selectorItem), null, selectors[i], null);
1075
+ return next;
1076
+ }
1077
+ function addSheetTokenOverride(data, item) {
1078
+ const state = data[BUILDER_STATE];
1079
+ const lookup = state.lookup ??= {};
1080
+ const lookupKey = getSheetTokenLookupKey(getStyleTokenId(item));
1081
+ const lookupIndex = lookup[lookupKey];
1082
+ if (typeof lookupIndex === "number") state.items[lookupIndex] = item;
1083
+ else lookup[lookupKey] = state.items.push(item) - 1;
1084
+ }
1085
+ function getSelectorItemStyleData(data) {
1086
+ return {
1087
+ [BUILDER_TYPE]: 1,
1088
+ [BUILDER_STATE]: data[BUILDER_STATE],
1089
+ [BUILDER_CALLSITE]: data[BUILDER_CALLSITE]
1090
+ };
1091
+ }
1092
+ function getSheetTokenLookupKey(tokenId) {
1093
+ return "token\0" + tokenId;
1094
+ }
1095
+ createTransformElement(getClassName);
1096
+ //#endregion
1097
+ //#region css/styleTarget.ts
1098
+ const sharedTargets = /* @__PURE__ */ new WeakMap();
1099
+ function createStyleTarget() {
1100
+ const owner = {};
1101
+ const targets = /* @__PURE__ */ new Map();
1102
+ return {
1103
+ apply(target, css, options) {
1104
+ if (!target) return;
1105
+ if (options?.enabled === false) {
1106
+ clearTarget(targets, owner, target);
1107
+ return;
1108
+ }
1109
+ const result = getClassName(css);
1110
+ const classNames = new Set(result.className?.split(/\s+/).filter(Boolean) ?? []);
1111
+ const styleEntries = Object.entries(result.style ?? {});
1112
+ const signature = createSignature(classNames, styleEntries);
1113
+ const previous = targets.get(target);
1114
+ if (previous?.signature === signature) return;
1115
+ const state = previous ?? {
1116
+ classNames: /* @__PURE__ */ new Set(),
1117
+ styleValues: /* @__PURE__ */ new Map(),
1118
+ signature: ""
1119
+ };
1120
+ updateClasses(target, state.classNames, classNames);
1121
+ updateStyles(target, owner, state.styleValues, styleEntries);
1122
+ state.classNames = classNames;
1123
+ state.signature = signature;
1124
+ targets.set(target, state);
1125
+ },
1126
+ destroy() {
1127
+ targets.forEach((_, target) => clearTarget(targets, owner, target));
1128
+ }
1129
+ };
1130
+ }
1131
+ function createSignature(classNames, styleEntries) {
1132
+ let signature = [...classNames].sort().join(" ");
1133
+ for (let i = 0, len = styleEntries.length; i < len; i++) {
1134
+ const [name, value] = styleEntries[i];
1135
+ signature += `\n${name}:${String(value)}`;
1136
+ }
1137
+ return signature;
1138
+ }
1139
+ function updateClasses(target, previous, next) {
1140
+ previous.forEach((className) => {
1141
+ if (!next.has(className)) removeClassName(target, className);
1142
+ });
1143
+ next.forEach((className) => {
1144
+ if (!previous.has(className)) addClassName(target, className);
1145
+ });
1146
+ }
1147
+ function addClassName(target, className) {
1148
+ const state = getSharedTargetState(target);
1149
+ const count = state.classNames.get(className) ?? 0;
1150
+ if (count === 0) target.classList.add(className);
1151
+ state.classNames.set(className, count + 1);
1152
+ }
1153
+ function removeClassName(target, className) {
1154
+ const state = getSharedTargetState(target);
1155
+ const count = state.classNames.get(className) ?? 0;
1156
+ if (count <= 1) {
1157
+ state.classNames.delete(className);
1158
+ target.classList.remove(className);
1159
+ deleteSharedStateIfEmpty(target, state);
1160
+ return;
1161
+ }
1162
+ state.classNames.set(className, count - 1);
1163
+ }
1164
+ function updateStyles(target, owner, previousValues, nextEntries) {
1165
+ const nextNames = /* @__PURE__ */ new Set();
1166
+ for (let i = 0, len = nextEntries.length; i < len; i++) {
1167
+ const [name, value] = nextEntries[i];
1168
+ const nextValue = String(value);
1169
+ nextNames.add(name);
1170
+ if (previousValues.get(name) !== nextValue) {
1171
+ setStyleValue(target, owner, name, nextValue);
1172
+ previousValues.set(name, nextValue);
1173
+ }
1174
+ }
1175
+ previousValues.forEach((_, name) => {
1176
+ if (nextNames.has(name)) return;
1177
+ removeStyleValue(target, owner, name);
1178
+ previousValues.delete(name);
1179
+ });
1180
+ }
1181
+ function clearTarget(targets, owner, target) {
1182
+ const state = targets.get(target);
1183
+ if (!state) return;
1184
+ state.classNames.forEach((className) => removeClassName(target, className));
1185
+ state.styleValues.forEach((_, name) => {
1186
+ removeStyleValue(target, owner, name);
1187
+ });
1188
+ targets.delete(target);
1189
+ }
1190
+ function setStyleValue(target, owner, name, value) {
1191
+ const targetState = getSharedTargetState(target);
1192
+ let styleState = targetState.styleNames.get(name);
1193
+ if (!styleState) {
1194
+ styleState = {
1195
+ initialValue: target.style.getPropertyValue(name),
1196
+ owners: /* @__PURE__ */ new Map()
1197
+ };
1198
+ targetState.styleNames.set(name, styleState);
1199
+ }
1200
+ styleState.owners.delete(owner);
1201
+ styleState.owners.set(owner, value);
1202
+ target.style.setProperty(name, value);
1203
+ }
1204
+ function removeStyleValue(target, owner, name) {
1205
+ const targetState = getSharedTargetState(target);
1206
+ const styleState = targetState.styleNames.get(name);
1207
+ if (!styleState) return;
1208
+ styleState.owners.delete(owner);
1209
+ const currentValue = getLastStyleValue(styleState);
1210
+ if (currentValue !== null) {
1211
+ target.style.setProperty(name, currentValue);
1212
+ return;
1213
+ }
1214
+ targetState.styleNames.delete(name);
1215
+ restoreStyleValue(target, name, styleState.initialValue);
1216
+ deleteSharedStateIfEmpty(target, targetState);
1217
+ }
1218
+ function getLastStyleValue(styleState) {
1219
+ let value = null;
1220
+ styleState.owners.forEach((ownerValue) => {
1221
+ value = ownerValue;
1222
+ });
1223
+ return value;
1224
+ }
1225
+ function getSharedTargetState(target) {
1226
+ let state = sharedTargets.get(target);
1227
+ if (!state) {
1228
+ state = {
1229
+ classNames: /* @__PURE__ */ new Map(),
1230
+ styleNames: /* @__PURE__ */ new Map()
1231
+ };
1232
+ sharedTargets.set(target, state);
1233
+ }
1234
+ return state;
1235
+ }
1236
+ function deleteSharedStateIfEmpty(target, state) {
1237
+ if (!state.classNames.size && !state.styleNames.size) sharedTargets.delete(target);
1238
+ }
1239
+ function restoreStyleValue(target, name, value) {
1240
+ if (value) target.style.setProperty(name, value);
1241
+ else target.style.removeProperty(name);
1242
+ }
1243
+ //#endregion
1244
+ export { isAtRuleRef as A, createSelectorData as B, SELECTOR_CONTAINER as C, weightValue as D, isStyleWeightValue as E, importantValue as F, createThemeData as G, createSlotData as H, isStyleImportantValue as I, mergeScopeData as L, classNameValue as M, isClassNameValue as N, AT_RULE_REF as O, styleTransform as P, createScopeData as R, getToken as S, normalizeSelectorArg as T, createSlotOverrideData as U, createSelectorOverrideData as V, createStyleData as W, transformStyle as _, createKeyframes as a, mergeSlotOverrideData as b, fontSrc as c, getId as d, FnPrefixScope as f, resolveCallsite as g, FnPrefixStyle as h, createPositionTry as i, classNameTransform as j, createAtRuleRef as k, createCounterStyle as l, FnPrefixSlot as m, createSheet as n, createFontPaletteValues as o, FnPrefixSelector as p, createProperty as r, createFontFace as s, createStyleTarget as t, createIdCounter as u, mergeSelectorOverrideData as v, SELECTOR_MEDIA as w, mergeStyleData as x, mergeSlotData as y, createScopeTargetData as z };
1245
+
1246
+ //# sourceMappingURL=css-a9O5so0b.js.map