@unicom-cloud/utils 0.1.31 → 0.1.33

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 (369) hide show
  1. package/case-name/index.js +1 -1
  2. package/caseName.js +1 -1
  3. package/class-name/index.js +6 -5
  4. package/className.js +1 -1
  5. package/clipboard-copy/index.js +1 -1
  6. package/clipboardCopy.js +1 -1
  7. package/constant/address.js +1 -1
  8. package/constant/chineseCharacters.js +1 -1
  9. package/constant/constellations.js +1 -1
  10. package/constant/domain.js +1 -1
  11. package/constant/emoji.js +1 -1
  12. package/constant/identity.js +1 -1
  13. package/constant/index.js +1 -1
  14. package/constant/isMobile.js +7 -0
  15. package/constant/keyboardCode.js +1 -1
  16. package/constant/licensePlate.js +1 -1
  17. package/constant/name.js +1 -1
  18. package/constant/platform.js +18 -17
  19. package/constant/protocol.js +1 -1
  20. package/constant/string.js +1 -1
  21. package/constant/ui.js +1 -1
  22. package/constant.js +1 -1
  23. package/content-disposition/index.js +1 -1
  24. package/contentDisposition.js +1 -1
  25. package/cookie/index.js +1 -1
  26. package/cookie/src/api.js +1 -1
  27. package/cookie/src/assign.js +1 -1
  28. package/cookie/src/converter.js +1 -1
  29. package/cookie.js +1 -1
  30. package/date/convertTime.js +1 -1
  31. package/date/convertToDuration.js +1 -1
  32. package/date/index.js +5 -5
  33. package/date.js +5 -5
  34. package/decimal/decimal.js +1 -1
  35. package/decimal/index.js +1 -1
  36. package/decimal.js +1 -1
  37. package/dom-helpers/activeElement.js +1 -1
  38. package/dom-helpers/addClass.js +1 -1
  39. package/dom-helpers/addEventListener.js +1 -1
  40. package/dom-helpers/animate.js +1 -1
  41. package/dom-helpers/animationFrame.js +1 -1
  42. package/dom-helpers/attribute.js +1 -1
  43. package/dom-helpers/camelize.js +1 -1
  44. package/dom-helpers/camelizeStyle.js +1 -1
  45. package/dom-helpers/canUseDOM.js +1 -1
  46. package/dom-helpers/childElements.js +1 -1
  47. package/dom-helpers/childNodes.js +1 -1
  48. package/dom-helpers/clear.js +1 -1
  49. package/dom-helpers/closest.js +1 -1
  50. package/dom-helpers/collectElements.js +1 -1
  51. package/dom-helpers/collectSiblings.js +1 -1
  52. package/dom-helpers/contains.js +1 -1
  53. package/dom-helpers/css.js +1 -1
  54. package/dom-helpers/filterEventHandler.js +1 -1
  55. package/dom-helpers/getComputedStyle.js +1 -1
  56. package/dom-helpers/getElementCoordinates.js +46 -0
  57. package/dom-helpers/getScrollAccessor.js +1 -1
  58. package/dom-helpers/hasClass.js +1 -1
  59. package/dom-helpers/height.js +1 -1
  60. package/dom-helpers/hyphenate.js +1 -1
  61. package/dom-helpers/hyphenateStyle.js +1 -1
  62. package/dom-helpers/index.js +87 -84
  63. package/dom-helpers/insertAfter.js +1 -1
  64. package/dom-helpers/isDocument.js +1 -1
  65. package/dom-helpers/isInput.js +1 -1
  66. package/dom-helpers/isTransform.js +1 -1
  67. package/dom-helpers/isVisible.js +1 -1
  68. package/dom-helpers/isWindow.js +1 -1
  69. package/dom-helpers/listen.js +1 -1
  70. package/dom-helpers/matches.js +1 -1
  71. package/dom-helpers/nextUntil.js +1 -1
  72. package/dom-helpers/offset.js +1 -1
  73. package/dom-helpers/offsetParent.js +1 -1
  74. package/dom-helpers/ownerDocument.js +1 -1
  75. package/dom-helpers/ownerWindow.js +1 -1
  76. package/dom-helpers/parents.js +1 -1
  77. package/dom-helpers/position.js +1 -1
  78. package/dom-helpers/prepend.js +1 -1
  79. package/dom-helpers/querySelectorAll.js +1 -1
  80. package/dom-helpers/reflow.js +1 -1
  81. package/dom-helpers/remove.js +1 -1
  82. package/dom-helpers/removeClass.js +1 -1
  83. package/dom-helpers/removeEventListener.js +1 -1
  84. package/dom-helpers/scrollLeft.js +1 -1
  85. package/dom-helpers/scrollParent.js +1 -1
  86. package/dom-helpers/scrollTo.js +1 -1
  87. package/dom-helpers/scrollTop.js +1 -1
  88. package/dom-helpers/scrollbarSize.js +1 -1
  89. package/dom-helpers/siblings.js +1 -1
  90. package/dom-helpers/text.js +1 -1
  91. package/dom-helpers/toggleClass.js +1 -1
  92. package/dom-helpers/transitionEnd.js +2 -2
  93. package/dom-helpers/triggerEvent.js +1 -1
  94. package/dom-helpers/types.js +1 -1
  95. package/dom-helpers/width.js +1 -1
  96. package/domHelpers.js +65 -63
  97. package/emitter/index.js +1 -1
  98. package/emitter/src/index.js +1 -1
  99. package/emitter.js +1 -1
  100. package/escape/index.js +11 -0
  101. package/escape.js +6 -0
  102. package/file/fileToURL.js +1 -1
  103. package/file/index.js +1 -1
  104. package/file/saveAs.js +1 -1
  105. package/file.js +1 -1
  106. package/idb/index.js +1 -1
  107. package/idb.js +1 -1
  108. package/index.js +1 -1
  109. package/invariant/index.js +1 -1
  110. package/invariant.js +1 -1
  111. package/is/index.js +196 -141
  112. package/is/lib/isAscii.js +9 -0
  113. package/is/lib/isBase64.js +13 -0
  114. package/is/lib/isChinese.js +19 -0
  115. package/is/lib/isDataURI.js +25 -0
  116. package/is/lib/isEmail.js +72 -0
  117. package/is/lib/isFQDN.js +21 -0
  118. package/is/lib/isFullWidth.js +10 -0
  119. package/is/lib/isHSL.js +11 -0
  120. package/is/lib/isHalfWidth.js +10 -0
  121. package/is/lib/isHash.js +23 -0
  122. package/is/lib/isHexColor.js +12 -0
  123. package/is/lib/isIMEI.js +19 -0
  124. package/is/lib/isIP.js +21 -0
  125. package/is/lib/isIPRange.js +25 -0
  126. package/is/lib/isIdentityCard.js +190 -0
  127. package/is/lib/isJWT.js +14 -0
  128. package/is/lib/isMACAddress.js +9 -0
  129. package/is/lib/isMD5.js +9 -0
  130. package/is/lib/isMimeType.js +9 -0
  131. package/is/lib/isMobilePhone.js +192 -0
  132. package/is/lib/isPort.js +7 -0
  133. package/is/lib/isRgbColor.js +18 -0
  134. package/is/lib/isSemVer.js +20 -0
  135. package/is/lib/isSlug.js +9 -0
  136. package/is/lib/isStrongPassword.js +48 -0
  137. package/is/lib/isURL.js +78 -0
  138. package/is/lib/isUUID.js +24 -0
  139. package/is/lib/isVariableWidth.js +10 -0
  140. package/is/lib/util/assertString.js +12 -0
  141. package/is.js +122 -66
  142. package/lunar/index.js +1 -1
  143. package/lunar/lib/Holiday.js +1 -1
  144. package/lunar/lib/HolidayUtil.js +1 -1
  145. package/lunar/lib/I18n.js +1 -1
  146. package/lunar/lib/JieQi.js +1 -1
  147. package/lunar/lib/Lunar.js +1 -1
  148. package/lunar/lib/LunarMonth.js +1 -1
  149. package/lunar/lib/LunarTime.js +1 -1
  150. package/lunar/lib/LunarUtil.js +1 -1
  151. package/lunar/lib/LunarYear.js +1 -1
  152. package/lunar/lib/ShouXingUtil.js +1 -1
  153. package/lunar/lib/Solar.js +1 -1
  154. package/lunar/lib/SolarHalfYear.js +1 -1
  155. package/lunar/lib/SolarMonth.js +1 -1
  156. package/lunar/lib/SolarSeason.js +1 -1
  157. package/lunar/lib/SolarUtil.js +1 -1
  158. package/lunar/lib/SolarWeek.js +1 -1
  159. package/lunar/lib/SolarYear.js +1 -1
  160. package/lunar/lib/index.js +1 -1
  161. package/lunar.js +1 -1
  162. package/math/index.js +1 -1
  163. package/math.js +1 -1
  164. package/md5/index.js +1 -1
  165. package/md5.js +1 -1
  166. package/mock/MockWebSocket.js +1 -1
  167. package/mock/MockXMLHttpRequest.js +1 -1
  168. package/mock/index.js +1 -1
  169. package/mock.js +1 -1
  170. package/normalize-wheel/ExecutionEnvironment.js +1 -1
  171. package/normalize-wheel/UserAgent_DEPRECATED.js +1 -1
  172. package/normalize-wheel/index.js +1 -1
  173. package/normalize-wheel/isEventSupported.js +1 -1
  174. package/normalizeWheel.js +1 -1
  175. package/number-to-chinese/index.js +1 -1
  176. package/numberToChinese.js +1 -1
  177. package/nzh/cn.js +1 -1
  178. package/nzh/hk.js +1 -1
  179. package/nzh/index.js +1 -1
  180. package/nzh/nzh.js +1 -1
  181. package/nzh/src/autoGet.js +1 -1
  182. package/nzh/src/index.js +1 -1
  183. package/nzh/src/langs/cn_b.js +1 -1
  184. package/nzh/src/langs/cn_s.js +1 -1
  185. package/nzh/src/langs/hk_b.js +1 -1
  186. package/nzh/src/langs/hk_s.js +1 -1
  187. package/nzh/src/utils.js +1 -1
  188. package/nzh.js +1 -1
  189. package/object-keys-sort/index.js +1 -1
  190. package/object-prototype-to-string-call/index.js +2 -2
  191. package/objectKeysSort.js +1 -1
  192. package/objectPrototypeToStringCall.js +1 -1
  193. package/package.json +1 -1
  194. package/pinyin/index.js +1 -1
  195. package/pinyin/simplified.js +1 -1
  196. package/pinyin/src/core.js +1 -1
  197. package/pinyin/src/simplified.js +6 -6
  198. package/pinyin/src/simplified_dict.js +5 -4
  199. package/pinyin/src/traditional.js +4 -4
  200. package/pinyin/src/traditional_dict.js +4 -3
  201. package/pinyin/traditional.js +1 -1
  202. package/pinyin.js +1 -1
  203. package/query-string/base.js +1 -1
  204. package/query-string/index.js +1 -1
  205. package/query-string/splitOnFirst.js +1 -1
  206. package/queryString.js +1 -1
  207. package/random/address.js +1 -1
  208. package/random/constellation.js +1 -1
  209. package/random/image.js +1 -1
  210. package/random/index.js +1 -1
  211. package/random/licensePlate.js +1 -1
  212. package/random/name.js +1 -1
  213. package/random/number.js +1 -1
  214. package/random/text.js +1 -1
  215. package/random/time.js +1 -1
  216. package/random/web.js +1 -1
  217. package/random.js +1 -1
  218. package/screenfull/index.js +1 -1
  219. package/screenfull.js +1 -1
  220. package/sleep/index.js +1 -1
  221. package/sleep.js +1 -1
  222. package/snapdom/index.js +1 -1
  223. package/snapdom/src/api/preCache.js +1 -1
  224. package/snapdom/src/api/snapdom.js +198 -153
  225. package/snapdom/src/core/cache.js +1 -1
  226. package/snapdom/src/core/capture.js +121 -326
  227. package/snapdom/src/core/clone.js +117 -266
  228. package/snapdom/src/core/context.js +1 -1
  229. package/snapdom/src/core/plugins.js +1 -1
  230. package/snapdom/src/core/prepare.js +48 -157
  231. package/snapdom/src/exporters/download.js +15 -11
  232. package/snapdom/src/exporters/toBlob.js +10 -15
  233. package/snapdom/src/exporters/toCanvas.js +72 -65
  234. package/snapdom/src/exporters/toImg.js +1 -1
  235. package/snapdom/src/modules/CSSVar.js +1 -1
  236. package/snapdom/src/modules/background.js +1 -1
  237. package/snapdom/src/modules/changeCSS.js +1 -1
  238. package/snapdom/src/modules/counter.js +1 -1
  239. package/snapdom/src/modules/fonts.js +118 -112
  240. package/snapdom/src/modules/iconFonts.js +133 -69
  241. package/snapdom/src/modules/images.js +36 -33
  242. package/snapdom/src/modules/lineClamp.js +1 -1
  243. package/snapdom/src/modules/pseudo.js +275 -161
  244. package/snapdom/src/modules/rasterize.js +6 -7
  245. package/snapdom/src/modules/snapFetch.js +1 -1
  246. package/snapdom/src/modules/styles.js +89 -67
  247. package/snapdom/src/modules/svgDefs.js +73 -60
  248. package/snapdom/src/utils/browser.js +13 -8
  249. package/snapdom/src/utils/capture.helpers.js +131 -0
  250. package/snapdom/src/utils/clone.helpers.js +283 -0
  251. package/snapdom/src/utils/css.js +1 -1
  252. package/snapdom/src/utils/helpers.js +1 -1
  253. package/snapdom/src/utils/image.js +15 -24
  254. package/snapdom/src/utils/prepare.helpers.js +8 -0
  255. package/snapdom/src/utils/transforms.helpers.js +211 -0
  256. package/snapdom.js +1 -1
  257. package/string/index.js +1 -1
  258. package/string.js +1 -1
  259. package/tinycolor/index.js +1 -1
  260. package/tinycolor/src/conversion.js +1 -1
  261. package/tinycolor/src/css-color-names.js +1 -1
  262. package/tinycolor/src/format-input.js +1 -1
  263. package/tinycolor/src/from-ratio.js +12 -11
  264. package/tinycolor/src/index.js +1 -1
  265. package/tinycolor/src/random.js +30 -29
  266. package/tinycolor/src/readability.js +1 -1
  267. package/tinycolor/src/to-ms-filter.js +1 -1
  268. package/tinycolor/src/utils.js +1 -1
  269. package/tinycolor.js +1 -1
  270. package/tree/index.js +54 -75
  271. package/tree/search/index.js +1 -1
  272. package/tree.js +9 -11
  273. package/tween/index.js +1 -1
  274. package/tween/src/easing.js +1 -1
  275. package/tween/src/tween.js +15 -14
  276. package/tween.js +1 -1
  277. package/types/constant/isMobile.d.ts +3 -0
  278. package/types/date/index.d.ts +3 -3
  279. package/types/dom-helpers/getElementCoordinates.d.ts +40 -0
  280. package/types/dom-helpers/index.d.ts +3 -1
  281. package/types/escape/index.d.ts +2 -0
  282. package/types/is/index.d.ts +28 -1
  283. package/types/is/lib/isAscii.d.ts +1 -0
  284. package/types/is/lib/isBase64.d.ts +1 -0
  285. package/types/is/lib/isChinese.d.ts +4 -0
  286. package/types/is/lib/isDataURI.d.ts +1 -0
  287. package/types/is/lib/isEmail.d.ts +1 -0
  288. package/types/is/lib/isFQDN.d.ts +1 -0
  289. package/types/is/lib/isFullWidth.d.ts +2 -0
  290. package/types/is/lib/isHSL.d.ts +1 -0
  291. package/types/is/lib/isHalfWidth.d.ts +2 -0
  292. package/types/is/lib/isHash.d.ts +1 -0
  293. package/types/is/lib/isHexColor.d.ts +1 -0
  294. package/types/is/lib/isIMEI.d.ts +1 -0
  295. package/types/is/lib/isIP.d.ts +1 -0
  296. package/types/is/lib/isIPRange.d.ts +1 -0
  297. package/types/is/lib/isIdentityCard.d.ts +1 -0
  298. package/types/is/lib/isJWT.d.ts +1 -0
  299. package/types/is/lib/isMACAddress.d.ts +1 -0
  300. package/types/is/lib/isMD5.d.ts +1 -0
  301. package/types/is/lib/isMimeType.d.ts +1 -0
  302. package/types/is/lib/isMobilePhone.d.ts +2 -0
  303. package/types/is/lib/isOctal.d.ts +1 -0
  304. package/types/is/lib/isPort.d.ts +1 -0
  305. package/types/is/lib/isRgbColor.d.ts +1 -0
  306. package/types/is/lib/isSemVer.d.ts +1 -0
  307. package/types/is/lib/isSlug.d.ts +1 -0
  308. package/types/is/lib/isStrongPassword.d.ts +1 -0
  309. package/types/is/lib/isURL.d.ts +1 -0
  310. package/types/is/lib/isUUID.d.ts +1 -0
  311. package/types/is/lib/isVariableWidth.d.ts +1 -0
  312. package/types/is/lib/util/assertString.d.ts +1 -0
  313. package/types/pinyin/es/main.d.ts +4 -0
  314. package/types/pinyin/es/traditional.d.ts +4 -0
  315. package/types/snapdom/src/api/snapdom.d.ts +11 -79
  316. package/types/snapdom/src/exporters/toCanvas.d.ts +11 -3
  317. package/types/snapdom/src/exporters/toJpg.d.ts +1 -0
  318. package/types/snapdom/src/exporters/toPng.d.ts +6 -0
  319. package/types/snapdom/src/exporters/toSvg.d.ts +1 -0
  320. package/types/snapdom/src/exporters/toWebp.d.ts +1 -0
  321. package/types/snapdom/src/modules/iconFonts.d.ts +7 -20
  322. package/types/snapdom/src/modules/pseudo.d.ts +18 -0
  323. package/types/snapdom/src/modules/rasterize.d.ts +6 -10
  324. package/types/snapdom/src/utils/browser.d.ts +0 -3
  325. package/types/snapdom/src/utils/capture.helpers.d.ts +45 -0
  326. package/types/snapdom/src/utils/clone.helpers.d.ts +97 -0
  327. package/types/snapdom/src/utils/image.d.ts +0 -8
  328. package/types/snapdom/src/utils/index.d.ts +1 -1
  329. package/types/snapdom/src/utils/prepare.helpers.d.ts +9 -0
  330. package/types/snapdom/src/utils/transforms.helpers.d.ts +118 -0
  331. package/types/tree/index.d.ts +3 -4
  332. package/types/validate/src/index.d.ts +23 -25
  333. package/types/validate/src/interface.d.ts +5 -3
  334. package/types/validate/src/locale/en-US.d.ts +12 -2
  335. package/types/validate/src/locale/index.d.ts +171 -0
  336. package/types/validate/src/locale/zh-CN.d.ts +12 -2
  337. package/types/validate/src/rules/base.d.ts +3 -1
  338. package/types/validate/src/rules/custom.d.ts +1 -1
  339. package/types/validate/src/rules/type.d.ts +10 -0
  340. package/ui-color/compareColorByRange.js +1 -1
  341. package/ui-color/index.js +8 -7
  342. package/uiColor.js +25 -24
  343. package/url-toolkit/index.js +1 -1
  344. package/url-toolkit/src/url-toolkit.js +1 -1
  345. package/urlToolkit.js +1 -1
  346. package/validate/index.js +23 -25
  347. package/validate/src/index.js +116 -73
  348. package/validate/src/locale/en-US.js +12 -2
  349. package/validate/src/locale/index.js +11 -0
  350. package/validate/src/locale/zh-CN.js +12 -2
  351. package/validate/src/rules/array.js +2 -2
  352. package/validate/src/rules/base.js +35 -31
  353. package/validate/src/rules/boolean.js +1 -1
  354. package/validate/src/rules/custom.js +2 -2
  355. package/validate/src/rules/number.js +1 -1
  356. package/validate/src/rules/object.js +1 -1
  357. package/validate/src/rules/string.js +6 -5
  358. package/validate/src/rules/type.js +84 -14
  359. package/validate.js +23 -25
  360. package/version/index.js +1 -1
  361. package/version.js +1 -1
  362. package/xlsx/index.d.ts +4 -8
  363. package/xlsx/index.js +1 -1
  364. package/xlsx/xlsx.js +2 -2
  365. package/xlsx.js +1 -1
  366. package/types/validate/src/message.d.ts +0 -2
  367. package/types/validate/src/utils.d.ts +0 -3
  368. package/validate/src/message.js +0 -5
  369. package/validate/src/utils.js +0 -8
@@ -0,0 +1,283 @@
1
+ /* 2025-12-17 18:26:57 */
2
+ import { cache as y } from "../core/cache.js";
3
+ import { snapFetch as w } from "../modules/snapFetch.js";
4
+ import { inlineAllStyles as b } from "../modules/styles.js";
5
+ import { idle as S } from "./browser.js";
6
+ function _(t, r, n) {
7
+ return Promise.all(
8
+ t.map((e) => new Promise((i) => {
9
+ function a() {
10
+ S(
11
+ (o) => {
12
+ (o && typeof o.timeRemaining == "function" ? o.timeRemaining() > 0 : !0) ? r(e, i) : a();
13
+ },
14
+ { fast: n }
15
+ );
16
+ }
17
+ a();
18
+ }))
19
+ );
20
+ }
21
+ function A(t) {
22
+ return t = t.trim(), !t || /:not\(\s*\[data-sd-slotted\]\s*\)\s*$/.test(t) ? t : `${t}:not([data-sd-slotted])`;
23
+ }
24
+ function $(t, r, n = !0) {
25
+ return t.split(",").map((e) => e.trim()).filter(Boolean).map((e) => {
26
+ if (e.startsWith(":where(") || e.startsWith("@")) return e;
27
+ const i = n ? A(e) : e;
28
+ return `:where(${r} ${i})`;
29
+ }).join(", ");
30
+ }
31
+ function N(t, r) {
32
+ return t ? (t = t.replace(/:host\(([^)]+)\)/g, (n, e) => `:where(${r}:is(${e.trim()}))`), t = t.replace(/:host\b/g, `:where(${r})`), t = t.replace(/:host-context\(([^)]+)\)/g, (n, e) => `:where(:where(${e.trim()}) ${r})`), t = t.replace(/::slotted\(([^)]+)\)/g, (n, e) => `:where(${r} ${e.trim()})`), t = t.replace(
33
+ /(^|})(\s*)([^@}{]+){/g,
34
+ (n, e, i, a) => {
35
+ const o = $(
36
+ a,
37
+ r,
38
+ /*excludeSlotted*/
39
+ !0
40
+ );
41
+ return `${e}${i}${o}{`;
42
+ }
43
+ ), t) : "";
44
+ }
45
+ function k(t) {
46
+ return t.shadowScopeSeq = (t.shadowScopeSeq || 0) + 1, `s${t.shadowScopeSeq}`;
47
+ }
48
+ function F(t) {
49
+ let r = "";
50
+ try {
51
+ t.querySelectorAll("style").forEach((e) => {
52
+ r += (e.textContent || "") + `
53
+ `;
54
+ });
55
+ const n = t.adoptedStyleSheets || [];
56
+ for (const e of n)
57
+ try {
58
+ if (e && e.cssRules)
59
+ for (const i of e.cssRules) r += i.cssText + `
60
+ `;
61
+ } catch {
62
+ }
63
+ } catch {
64
+ }
65
+ return r;
66
+ }
67
+ function L(t, r, n) {
68
+ if (!r) return;
69
+ const e = document.createElement("style");
70
+ e.setAttribute("data-sd", n), e.textContent = r, t.insertBefore(e, t.firstChild || null);
71
+ }
72
+ function D(t, r) {
73
+ try {
74
+ const n = t.currentSrc || t.src || "";
75
+ if (!n) return;
76
+ r.setAttribute("src", n), r.removeAttribute("srcset"), r.removeAttribute("sizes"), r.loading = "eager", r.decoding = "sync";
77
+ } catch {
78
+ }
79
+ }
80
+ function j(t) {
81
+ const r = /* @__PURE__ */ new Set();
82
+ if (!t) return r;
83
+ const n = /var\(\s*(--[A-Za-z0-9_-]+)\b/g;
84
+ let e;
85
+ for (; e = n.exec(t); ) r.add(e[1]);
86
+ return r;
87
+ }
88
+ function C(t, r) {
89
+ try {
90
+ let e = getComputedStyle(t).getPropertyValue(r).trim();
91
+ if (e) return e;
92
+ } catch {
93
+ }
94
+ try {
95
+ let e = getComputedStyle(document.documentElement).getPropertyValue(r).trim();
96
+ if (e) return e;
97
+ } catch {
98
+ }
99
+ return "";
100
+ }
101
+ function z(t, r, n) {
102
+ const e = [];
103
+ for (const i of r) {
104
+ const a = C(t, i);
105
+ a && e.push(`${i}: ${a};`);
106
+ }
107
+ return e.length ? `${n}{${e.join("")}}
108
+ ` : "";
109
+ }
110
+ function O(t) {
111
+ t && (t.nodeType === Node.ELEMENT_NODE && t.setAttribute("data-sd-slotted", ""), t.querySelectorAll && t.querySelectorAll("*").forEach((r) => r.setAttribute("data-sd-slotted", "")));
112
+ }
113
+ async function E(t, r = 3) {
114
+ const n = () => {
115
+ try {
116
+ return t.contentDocument || t.contentWindow?.document || null;
117
+ } catch {
118
+ return null;
119
+ }
120
+ };
121
+ let e = n(), i = 0;
122
+ for (; i < r && (!e || !e.body && !e.documentElement); )
123
+ await new Promise((a) => setTimeout(a, 0)), e = n(), i++;
124
+ return e && (e.body || e.documentElement) ? e : null;
125
+ }
126
+ function v(t) {
127
+ const r = t.getBoundingClientRect();
128
+ let n = 0, e = 0, i = 0, a = 0;
129
+ try {
130
+ const s = getComputedStyle(t);
131
+ n = parseFloat(s.borderLeftWidth) || 0, e = parseFloat(s.borderRightWidth) || 0, i = parseFloat(s.borderTopWidth) || 0, a = parseFloat(s.borderBottomWidth) || 0;
132
+ } catch {
133
+ }
134
+ const o = Math.max(0, Math.round(r.width - (n + e))), c = Math.max(0, Math.round(r.height - (i + a)));
135
+ return { contentWidth: o, contentHeight: c, rect: r };
136
+ }
137
+ function q(t, r, n) {
138
+ const e = t.createElement("style");
139
+ return e.setAttribute("data-sd-iframe-pin", ""), e.textContent = `html, body {margin: 0 !important;padding: 0 !important;width: ${r}px !important;height: ${n}px !important;min-width: ${r}px !important;min-height: ${n}px !important;box-sizing: border-box !important;overflow: hidden !important;background-clip: border-box !important;}`, (t.head || t.documentElement).appendChild(e), () => {
140
+ try {
141
+ e.remove();
142
+ } catch {
143
+ }
144
+ };
145
+ }
146
+ async function V(t, r, n) {
147
+ const e = await E(t, 3);
148
+ if (!e) throw new Error("iframe document not accessible/ready");
149
+ const { contentWidth: i, contentHeight: a, rect: o } = v(t), c = n?.snap;
150
+ if (!c || typeof c.toPng != "function")
151
+ throw new Error("snapdom.toPng not available in iframe or window");
152
+ const s = { ...n, scale: 1 }, u = q(e, i, a);
153
+ let d;
154
+ try {
155
+ d = await c.toPng(e.documentElement, s);
156
+ } finally {
157
+ u();
158
+ }
159
+ d.style.display = "block", d.style.width = `${i}px`, d.style.height = `${a}px`;
160
+ const l = document.createElement("div");
161
+ return r.nodeMap.set(l, t), b(t, l, r, n), l.style.overflow = "hidden", l.style.display = "block", l.style.width || (l.style.width = `${Math.round(o.width)}px`), l.style.height || (l.style.height = `${Math.round(o.height)}px`), l.appendChild(d), l;
162
+ }
163
+ var f = /* @__PURE__ */ new Map();
164
+ async function h(t) {
165
+ if (y.resource?.has(t)) return y.resource.get(t);
166
+ if (f.has(t)) return f.get(t);
167
+ const r = (async () => {
168
+ const n = await w(t, { as: "dataURL", silent: !0 });
169
+ if (!n.ok || typeof n.data != "string")
170
+ throw new Error(`[snapDOM] Failed to read blob URL: ${t}`);
171
+ return y.resource?.set(t, n.data), n.data;
172
+ })();
173
+ f.set(t, r);
174
+ try {
175
+ const n = await r;
176
+ return f.set(t, n), n;
177
+ } catch (n) {
178
+ throw f.delete(t), n;
179
+ }
180
+ }
181
+ var B = /\bblob:[^)"'\s]+/g;
182
+ async function g(t) {
183
+ if (!t || t.indexOf("blob:") === -1) return t;
184
+ const r = Array.from(new Set(t.match(B) || []));
185
+ if (r.length === 0) return t;
186
+ let n = t;
187
+ for (const e of r)
188
+ try {
189
+ const i = await h(e);
190
+ n = n.split(e).join(i);
191
+ } catch {
192
+ }
193
+ return n;
194
+ }
195
+ function m(t) {
196
+ return typeof t == "string" && t.startsWith("blob:");
197
+ }
198
+ function R(t) {
199
+ return (t || "").split(",").map((r) => r.trim()).filter(Boolean).map((r) => {
200
+ const n = r.match(/^(\S+)(\s+.+)?$/);
201
+ return n ? { url: n[1], desc: n[2] || "" } : null;
202
+ }).filter(Boolean);
203
+ }
204
+ function x(t) {
205
+ return t.map((r) => r.desc ? `${r.url} ${r.desc.trim()}` : r.url).join(", ");
206
+ }
207
+ async function H(t) {
208
+ if (!t) return;
209
+ const r = t.querySelectorAll ? t.querySelectorAll("img") : [];
210
+ for (const o of r)
211
+ try {
212
+ const s = o.getAttribute("src") || o.currentSrc || "";
213
+ if (m(s)) {
214
+ const d = await h(s);
215
+ o.setAttribute("src", d);
216
+ }
217
+ const u = o.getAttribute("srcset");
218
+ if (u && u.includes("blob:")) {
219
+ const d = R(u);
220
+ let l = !1;
221
+ for (const p of d)
222
+ if (m(p.url))
223
+ try {
224
+ p.url = await h(p.url), l = !0;
225
+ } catch {
226
+ }
227
+ l && o.setAttribute("srcset", x(d));
228
+ }
229
+ } catch {
230
+ }
231
+ const n = t.querySelectorAll ? t.querySelectorAll("image") : [];
232
+ for (const o of n)
233
+ try {
234
+ const c = "http://www.w3.org/1999/xlink", s = o.getAttribute("href") || o.getAttributeNS?.(c, "href");
235
+ if (m(s)) {
236
+ const u = await h(s);
237
+ o.setAttribute("href", u), o.removeAttributeNS?.(c, "href");
238
+ }
239
+ } catch {
240
+ }
241
+ const e = t.querySelectorAll ? t.querySelectorAll("[style*='blob:']") : [];
242
+ for (const o of e)
243
+ try {
244
+ const c = o.getAttribute("style");
245
+ if (c && c.includes("blob:")) {
246
+ const s = await g(c);
247
+ o.setAttribute("style", s);
248
+ }
249
+ } catch {
250
+ }
251
+ const i = t.querySelectorAll ? t.querySelectorAll("style") : [];
252
+ for (const o of i)
253
+ try {
254
+ const c = o.textContent || "";
255
+ c.includes("blob:") && (o.textContent = await g(c));
256
+ } catch {
257
+ }
258
+ const a = ["poster"];
259
+ for (const o of a) {
260
+ const c = t.querySelectorAll ? t.querySelectorAll(`[${o}^='blob:']`) : [];
261
+ for (const s of c)
262
+ try {
263
+ const u = s.getAttribute(o);
264
+ m(u) && s.setAttribute(o, await h(u));
265
+ } catch {
266
+ }
267
+ }
268
+ }
269
+ export {
270
+ h as blobUrlToDataUrl,
271
+ z as buildSeedCustomPropsRule,
272
+ j as collectCustomPropsFromCSS,
273
+ F as extractShadowCSS,
274
+ D as freezeImgSrcset,
275
+ E as getAccessibleIframeDocument,
276
+ _ as idleCallback,
277
+ L as injectScopedStyle,
278
+ O as markSlottedSubtree,
279
+ k as nextShadowScopeId,
280
+ V as rasterizeIframe,
281
+ H as resolveBlobUrlsInTree,
282
+ N as rewriteShadowCSS
283
+ };
@@ -1,4 +1,4 @@
1
- /* 2025-11-19 10:03:21 */
1
+ /* 2025-12-17 18:26:57 */
2
2
  import { cache as s } from "../core/cache.js";
3
3
  const p = /* @__PURE__ */ new Set([
4
4
  "meta",
@@ -1,4 +1,4 @@
1
- /* 2025-11-19 10:03:21 */
1
+ /* 2025-12-17 18:26:57 */
2
2
  function c(t) {
3
3
  const e = t.match(/url\((['"]?)(.*?)(\1)\)/);
4
4
  if (!e) return null;
@@ -1,39 +1,30 @@
1
- /* 2025-11-19 10:03:21 */
2
- import { cache as c } from "../core/cache.js";
3
- import { snapFetch as a } from "../modules/snapFetch.js";
4
- import { extractURL as d, safeEncodeURI as u } from "./helpers.js";
5
- function f(t, o) {
6
- if (!o || !t.width || !t.height)
7
- return t;
8
- const r = document.createElement("canvas");
9
- r.width = t.width, r.height = t.height;
10
- const n = r.getContext("2d");
11
- return n.fillStyle = o, n.fillRect(0, 0, r.width, r.height), n.drawImage(t, 0, 0), r;
12
- }
13
- async function m(t, o = {}) {
1
+ /* 2025-12-17 18:26:57 */
2
+ import { cache as a } from "../core/cache.js";
3
+ import { snapFetch as c } from "../modules/snapFetch.js";
4
+ import { extractURL as i, safeEncodeURI as u } from "./helpers.js";
5
+ async function f(t, o = {}) {
14
6
  if (/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(
15
7
  t
16
8
  ) || t.trim() === "none")
17
9
  return t;
18
- const n = d(t);
19
- if (!n)
10
+ const e = i(t);
11
+ if (!e)
20
12
  return t;
21
- const e = u(n);
22
- if (c.background.has(e)) {
23
- const i = c.background.get(e);
24
- return i ? `url("${i}")` : "none";
13
+ const r = u(e);
14
+ if (a.background.has(r)) {
15
+ const n = a.background.get(r);
16
+ return n ? `url("${n}")` : "none";
25
17
  }
26
18
  try {
27
- const i = await a(e, {
19
+ const n = await c(r, {
28
20
  as: "dataURL",
29
21
  useProxy: o.useProxy
30
22
  });
31
- return i.ok ? (c.background.set(e, i.data), `url("${i.data}")`) : (c.background.set(e, null), "none");
23
+ return n.ok ? (a.background.set(r, n.data), `url("${n.data}")`) : (a.background.set(r, null), "none");
32
24
  } catch {
33
- return c.background.set(e, null), "none";
25
+ return a.background.set(r, null), "none";
34
26
  }
35
27
  }
36
28
  export {
37
- f as createBackground,
38
- m as inlineSingleBackgroundEntry
29
+ f as inlineSingleBackgroundEntry
39
30
  };
@@ -0,0 +1,8 @@
1
+ /* 2025-12-17 18:26:57 */
2
+ function d(o) {
3
+ const t = getComputedStyle(o), n = t.outlineStyle, e = t.outlineWidth, r = t.borderStyle, i = t.borderWidth, l = n !== "none" && parseFloat(e) > 0, s = r === "none" || parseFloat(i) === 0;
4
+ l && s && (o.style.border = `${e} solid transparent`);
5
+ }
6
+ export {
7
+ d as stabilizeLayout
8
+ };
@@ -0,0 +1,211 @@
1
+ /* 2025-12-17 18:26:57 */
2
+ import { limitDecimals as v } from "./capture.helpers.js";
3
+ function X(e) {
4
+ const t = e.boxShadow || "";
5
+ if (!t || t === "none") return { top: 0, right: 0, bottom: 0, left: 0 };
6
+ const a = t.split(/\),(?=(?:[^()]*\([^()]*\))*[^()]*$)/).map((o) => o.trim());
7
+ let i = 0, c = 0, r = 0, s = 0;
8
+ for (const o of a) {
9
+ const n = o.match(/-?\d+(\.\d+)?px/g)?.map((p) => parseFloat(p)) || [];
10
+ if (n.length < 2) continue;
11
+ const [l, m, f = 0, x = 0] = n, u = Math.abs(l) + f + x, h = Math.abs(m) + f + x;
12
+ c = Math.max(c, u + Math.max(l, 0)), s = Math.max(s, u + Math.max(-l, 0)), r = Math.max(r, h + Math.max(m, 0)), i = Math.max(i, h + Math.max(-m, 0));
13
+ }
14
+ return {
15
+ top: Math.ceil(i),
16
+ right: Math.ceil(c),
17
+ bottom: Math.ceil(r),
18
+ left: Math.ceil(s)
19
+ };
20
+ }
21
+ function Y(e) {
22
+ const t = (e.filter || "").match(/blur\(\s*([0-9.]+)px\s*\)/), a = t ? Math.ceil(parseFloat(t[1]) || 0) : 0;
23
+ return { top: a, right: a, bottom: a, left: a };
24
+ }
25
+ function O(e) {
26
+ if ((e.outlineStyle || "none") === "none")
27
+ return { top: 0, right: 0, bottom: 0, left: 0 };
28
+ const t = Math.ceil(parseFloat(e.outlineWidth || "0") || 0);
29
+ return { top: t, right: t, bottom: t, left: t };
30
+ }
31
+ function P(e) {
32
+ const t = `${e.filter || ""} ${e.webkitFilter || ""}`.trim();
33
+ if (!t || t === "none")
34
+ return { bleed: { top: 0, right: 0, bottom: 0, left: 0 }, has: !1 };
35
+ const a = t.match(/drop-shadow\((?:[^()]|\([^()]*\))*\)/gi) || [];
36
+ let i = 0, c = 0, r = 0, s = 0, o = !1;
37
+ for (const n of a) {
38
+ o = !0;
39
+ const l = n.match(/-?\d+(?:\.\d+)?px/gi)?.map((p) => parseFloat(p)) || [], [m = 0, f = 0, x = 0] = l, u = Math.abs(m) + x, h = Math.abs(f) + x;
40
+ c = Math.max(c, u + Math.max(m, 0)), s = Math.max(s, u + Math.max(-m, 0)), r = Math.max(r, h + Math.max(f, 0)), i = Math.max(i, h + Math.max(-f, 0));
41
+ }
42
+ return {
43
+ bleed: {
44
+ top: v(i),
45
+ right: v(c),
46
+ bottom: v(r),
47
+ left: v(s)
48
+ },
49
+ has: o
50
+ };
51
+ }
52
+ function T(e, t) {
53
+ if (!e || !t || !t.style) return null;
54
+ const a = getComputedStyle(e);
55
+ try {
56
+ t.style.transformOrigin = "0 0";
57
+ } catch {
58
+ }
59
+ try {
60
+ "translate" in t.style && (t.style.translate = "none"), "rotate" in t.style && (t.style.rotate = "none");
61
+ } catch {
62
+ }
63
+ const i = a.transform || "none";
64
+ if (i === "none")
65
+ try {
66
+ const r = F(e);
67
+ if (r.a === 1 && r.b === 0 && r.c === 0 && r.d === 1)
68
+ return t.style.transform = "none", { a: 1, b: 0, c: 0, d: 1 };
69
+ } catch {
70
+ }
71
+ const c = i.match(/^matrix\(\s*([^)]+)\)$/i);
72
+ if (c) {
73
+ const r = c[1].split(",").map((s) => parseFloat(s.trim()));
74
+ if (r.length === 6 && r.every(Number.isFinite)) {
75
+ const [s, o, n, l] = r, m = Math.sqrt(s * s + o * o) || 0;
76
+ let f = 0, x = 0, u = 0, h = 0, p = 0, d = 0;
77
+ m > 0 && (f = s / m, x = o / m, u = f * n + x * l, h = n - f * u, p = l - x * u, d = Math.sqrt(h * h + p * p) || 0, d > 0 ? u = u / d : u = 0);
78
+ const y = m, g = 0, b = u * d, M = d;
79
+ try {
80
+ t.style.transform = `matrix(${y}, ${g}, ${b}, ${M}, 0, 0)`;
81
+ } catch {
82
+ }
83
+ return { a: y, b: g, c: b, d: M };
84
+ }
85
+ }
86
+ try {
87
+ const r = String(i).trim();
88
+ return t.style.transform = r + " translate(0px, 0px) rotate(0deg)", null;
89
+ } catch {
90
+ return null;
91
+ }
92
+ }
93
+ function I(e, t, a, i, c) {
94
+ const r = a.a, s = a.b, o = a.c, n = a.d, l = a.e || 0, m = a.f || 0;
95
+ function f(y, g) {
96
+ let b = y - i, M = g - c, w = r * b + o * M, $ = s * b + n * M;
97
+ return w += i + l, $ += c + m, [w, $];
98
+ }
99
+ const x = [f(0, 0), f(e, 0), f(0, t), f(e, t)];
100
+ let u = 1 / 0, h = 1 / 0, p = -1 / 0, d = -1 / 0;
101
+ for (const [y, g] of x)
102
+ y < u && (u = y), g < h && (h = g), y > p && (p = y), g > d && (d = g);
103
+ return {
104
+ minX: u,
105
+ minY: h,
106
+ maxX: p,
107
+ maxY: d,
108
+ width: p - u,
109
+ height: d - h
110
+ };
111
+ }
112
+ function B(e, t, a) {
113
+ const i = (e.transformOrigin || "0 0").trim().split(/\s+/), [c, r] = [i[0] || "0", i[1] || "0"], s = (o, n) => {
114
+ const l = o.toLowerCase();
115
+ return l === "left" || l === "top" ? 0 : l === "center" ? n / 2 : l === "right" || l === "bottom" ? n : l.endsWith("px") ? parseFloat(l) || 0 : l.endsWith("%") ? (parseFloat(l) || 0) * n / 100 : /^-?\d+(\.\d+)?$/.test(l) && parseFloat(l) || 0;
116
+ };
117
+ return {
118
+ ox: s(c, t),
119
+ oy: s(r, a)
120
+ };
121
+ }
122
+ function W(e) {
123
+ const t = { rotate: "0deg", scale: null, translate: null }, a = typeof e.computedStyleMap == "function" ? e.computedStyleMap() : null;
124
+ if (a) {
125
+ const c = (n) => {
126
+ try {
127
+ return typeof a.has == "function" && !a.has(n) || typeof a.get != "function" ? null : a.get(n);
128
+ } catch {
129
+ return null;
130
+ }
131
+ }, r = c("rotate");
132
+ if (r)
133
+ if (r.angle) {
134
+ const n = r.angle;
135
+ t.rotate = n.unit === "rad" ? n.value * 180 / Math.PI + "deg" : n.value + n.unit;
136
+ } else r.unit ? t.rotate = r.unit === "rad" ? r.value * 180 / Math.PI + "deg" : r.value + r.unit : t.rotate = String(r);
137
+ else {
138
+ const n = getComputedStyle(e);
139
+ t.rotate = n.rotate && n.rotate !== "none" ? n.rotate : "0deg";
140
+ }
141
+ const s = c("scale");
142
+ if (s) {
143
+ const n = "x" in s && s.x?.value != null ? s.x.value : Array.isArray(s) ? s[0]?.value : Number(s) || 1, l = "y" in s && s.y?.value != null ? s.y.value : Array.isArray(s) ? s[1]?.value : n;
144
+ t.scale = `${n} ${l}`;
145
+ } else {
146
+ const n = getComputedStyle(e);
147
+ t.scale = n.scale && n.scale !== "none" ? n.scale : null;
148
+ }
149
+ const o = c("translate");
150
+ if (o) {
151
+ const n = "x" in o && "value" in o.x ? o.x.value : Array.isArray(o) ? o[0]?.value : 0, l = "y" in o && "value" in o.y ? o.y.value : Array.isArray(o) ? o[1]?.value : 0, m = "x" in o && o.x?.unit ? o.x.unit : "px", f = "y" in o && o.y?.unit ? o.y.unit : "px";
152
+ t.translate = `${n}${m} ${l}${f}`;
153
+ } else {
154
+ const n = getComputedStyle(e);
155
+ t.translate = n.translate && n.translate !== "none" ? n.translate : null;
156
+ }
157
+ return t;
158
+ }
159
+ const i = getComputedStyle(e);
160
+ return t.rotate = i.rotate && i.rotate !== "none" ? i.rotate : "0deg", t.scale = i.scale && i.scale !== "none" ? i.scale : null, t.translate = i.translate && i.translate !== "none" ? i.translate : null, t;
161
+ }
162
+ var S = null;
163
+ function C() {
164
+ if (S) return S;
165
+ const e = document.createElement("div");
166
+ return e.id = "snapdom-measure-slot", e.setAttribute("aria-hidden", "true"), Object.assign(e.style, {
167
+ position: "absolute",
168
+ left: "-99999px",
169
+ top: "0px",
170
+ width: "0px",
171
+ height: "0px",
172
+ overflow: "hidden",
173
+ opacity: "0",
174
+ pointerEvents: "none",
175
+ contain: "size layout style"
176
+ }), document.documentElement.appendChild(e), S = e, e;
177
+ }
178
+ function D(e) {
179
+ const t = C(), a = document.createElement("div");
180
+ a.style.transformOrigin = "0 0", e.baseTransform && (a.style.transform = e.baseTransform), e.rotate && (a.style.rotate = e.rotate), e.scale && (a.style.scale = e.scale), e.translate && (a.style.translate = e.translate), t.appendChild(a);
181
+ const i = F(a);
182
+ return t.removeChild(a), i;
183
+ }
184
+ function k(e) {
185
+ const t = getComputedStyle(e), a = t.transform || "none";
186
+ if (a !== "none" && !/^matrix\(\s*1\s*,\s*0\s*,\s*0\s*,\s*1\s*,\s*0\s*,\s*0\s*\)$/i.test(a)) return !0;
187
+ const c = t.rotate && t.rotate !== "none" && t.rotate !== "0deg", r = t.scale && t.scale !== "none" && t.scale !== "1", s = t.translate && t.translate !== "none" && t.translate !== "0px 0px";
188
+ return !!(c || r || s);
189
+ }
190
+ function F(e) {
191
+ const t = getComputedStyle(e).transform;
192
+ if (!t || t === "none") return new DOMMatrix();
193
+ try {
194
+ return new DOMMatrix(t);
195
+ } catch {
196
+ return new WebKitCSSMatrix(t);
197
+ }
198
+ }
199
+ export {
200
+ I as bboxWithOriginFull,
201
+ k as hasBBoxAffectingTransform,
202
+ F as matrixFromComputed,
203
+ T as normalizeRootTransforms,
204
+ X as parseBoxShadow,
205
+ Y as parseFilterBlur,
206
+ P as parseFilterDropShadows,
207
+ O as parseOutline,
208
+ B as parseTransformOriginPx,
209
+ W as readIndividualTransforms,
210
+ D as readTotalTransformMatrix
211
+ };
package/snapdom.js CHANGED
@@ -1,4 +1,4 @@
1
- /* 2025-11-19 10:03:21 */
1
+ /* 2025-12-17 18:26:57 */
2
2
  import { preCache as e } from "./snapdom/src/api/preCache.js";
3
3
  import { snapdom as m } from "./snapdom/src/api/snapdom.js";
4
4
  export {
package/string/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /* 2025-11-19 10:03:21 */
1
+ /* 2025-12-17 18:26:57 */
2
2
  import e from "lodash/isNil";
3
3
  import t from "lodash/isString";
4
4
  import { HYPHEN as o } from "../constant/string.js";
package/string.js CHANGED
@@ -1,4 +1,4 @@
1
- /* 2025-11-19 10:03:21 */
1
+ /* 2025-12-17 18:26:57 */
2
2
  import "lodash/isNil";
3
3
  import "lodash/isString";
4
4
  import "./constant/string.js";
@@ -1,4 +1,4 @@
1
- /* 2025-11-19 10:03:21 */
1
+ /* 2025-12-17 18:26:57 */
2
2
  import { cmykToRgb as e, convertDecimalToHex as t, convertHexToDecimal as a, hslToRgb as n, hsvToRgb as b, numberInputToObject as m, parseIntFromHex as T, rgbToCmyk as i, rgbToHex as g, rgbToHsl as p, rgbToHsv as l, rgbToRgb as s, rgbaToArgbHex as x, rgbaToHex as c } from "./src/conversion.js";
3
3
  import { names as f } from "./src/css-color-names.js";
4
4
  import { inputToRGB as u, isValidCSSUnit as H, stringInputToObject as y } from "./src/format-input.js";
@@ -1,4 +1,4 @@
1
- /* 2025-11-19 10:03:21 */
1
+ /* 2025-12-17 18:26:57 */
2
2
  import { bound01 as s, pad2 as h } from "./utils.js";
3
3
  function A(n, r, t) {
4
4
  return {
@@ -1,4 +1,4 @@
1
- /* 2025-11-19 10:03:21 */
1
+ /* 2025-12-17 18:26:57 */
2
2
  const e = {
3
3
  aliceblue: "#f0f8ff",
4
4
  antiquewhite: "#faebd7",
@@ -1,4 +1,4 @@
1
- /* 2025-11-19 10:03:21 */
1
+ /* 2025-12-17 18:26:57 */
2
2
  import { rgbToRgb as S, hsvToRgb as v, hslToRgb as E, cmykToRgb as F, convertHexToDecimal as A, parseIntFromHex as s } from "./conversion.js";
3
3
  import { names as R } from "./css-color-names.js";
4
4
  import { convertToPercentage as g, boundAlpha as T } from "./utils.js";
@@ -1,15 +1,16 @@
1
- /* 2025-11-19 10:03:21 */
1
+ /* 2025-12-17 18:26:57 */
2
+ import t from "lodash/isUndefined.js";
2
3
  import { TinyColor as e } from "./index.js";
3
- import { convertToPercentage as o } from "./utils.js";
4
- function c(n, m) {
5
- const r = {
6
- r: o(n.r),
7
- g: o(n.g),
8
- b: o(n.b)
4
+ import { convertToPercentage as r } from "./utils.js";
5
+ function d(n, m) {
6
+ const o = {
7
+ r: r(n.r),
8
+ g: r(n.g),
9
+ b: r(n.b)
9
10
  };
10
- return n.a !== void 0 && (r.a = Number(n.a)), new e(r, m);
11
+ return t(n.a) || (o.a = Number(n.a)), new e(o, m);
11
12
  }
12
- function f() {
13
+ function i() {
13
14
  return new e({
14
15
  r: Math.random(),
15
16
  g: Math.random(),
@@ -17,6 +18,6 @@ function f() {
17
18
  });
18
19
  }
19
20
  export {
20
- c as fromRatio,
21
- f as legacyRandom
21
+ d as fromRatio,
22
+ i as legacyRandom
22
23
  };
@@ -1,4 +1,4 @@
1
- /* 2025-11-19 10:03:21 */
1
+ /* 2025-12-17 18:26:57 */
2
2
  import { numberInputToObject as d, rgbToHsv as g, rgbToHsl as u, rgbToHex as b, rgbaToHex as m, rgbToCmyk as c } from "./conversion.js";
3
3
  import { names as $ } from "./css-color-names.js";
4
4
  import { inputToRGB as f } from "./format-input.js";