@unicom-cloud/utils 0.1.24 → 0.1.25

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 (290) hide show
  1. package/case-name/index.js +1 -1
  2. package/caseName.js +1 -1
  3. package/class-name/index.js +1 -1
  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/keyboardCode.js +1 -1
  15. package/constant/licensePlate.js +1 -1
  16. package/constant/name.js +1 -1
  17. package/constant/platform.js +1 -1
  18. package/constant/protocol.js +1 -1
  19. package/constant/ui.js +1 -1
  20. package/constant.js +1 -1
  21. package/content-disposition/index.js +1 -1
  22. package/contentDisposition.js +1 -1
  23. package/cookie/index.js +1 -1
  24. package/cookie/src/index.js +1 -1
  25. package/cookie.js +1 -1
  26. package/date/convertTime.js +1 -1
  27. package/date/convertToDuration.js +1 -1
  28. package/date/index.js +1 -1
  29. package/date.js +1 -1
  30. package/decimal/decimal.js +22 -22
  31. package/decimal/index.js +1 -1
  32. package/decimal.js +1 -1
  33. package/dom-helpers/activeElement.js +1 -1
  34. package/dom-helpers/addClass.js +1 -1
  35. package/dom-helpers/addEventListener.js +1 -1
  36. package/dom-helpers/animate.js +1 -1
  37. package/dom-helpers/animationFrame.js +1 -1
  38. package/dom-helpers/attribute.js +1 -1
  39. package/dom-helpers/camelize.js +1 -1
  40. package/dom-helpers/camelizeStyle.js +1 -1
  41. package/dom-helpers/canUseDOM.js +1 -1
  42. package/dom-helpers/childElements.js +1 -1
  43. package/dom-helpers/childNodes.js +1 -1
  44. package/dom-helpers/clear.js +1 -1
  45. package/dom-helpers/closest.js +1 -1
  46. package/dom-helpers/collectElements.js +1 -1
  47. package/dom-helpers/collectSiblings.js +1 -1
  48. package/dom-helpers/contains.js +1 -1
  49. package/dom-helpers/css.js +1 -1
  50. package/dom-helpers/filterEventHandler.js +1 -1
  51. package/dom-helpers/getComputedStyle.js +1 -1
  52. package/dom-helpers/getScrollAccessor.js +1 -1
  53. package/dom-helpers/hasClass.js +1 -1
  54. package/dom-helpers/height.js +1 -1
  55. package/dom-helpers/hyphenate.js +1 -1
  56. package/dom-helpers/hyphenateStyle.js +1 -1
  57. package/dom-helpers/index.js +1 -1
  58. package/dom-helpers/insertAfter.js +1 -1
  59. package/dom-helpers/isDocument.js +1 -1
  60. package/dom-helpers/isInput.js +1 -1
  61. package/dom-helpers/isTransform.js +1 -1
  62. package/dom-helpers/isVisible.js +1 -1
  63. package/dom-helpers/isWindow.js +1 -1
  64. package/dom-helpers/listen.js +1 -1
  65. package/dom-helpers/matches.js +1 -1
  66. package/dom-helpers/nextUntil.js +1 -1
  67. package/dom-helpers/offset.js +1 -1
  68. package/dom-helpers/offsetParent.js +1 -1
  69. package/dom-helpers/ownerDocument.js +1 -1
  70. package/dom-helpers/ownerWindow.js +1 -1
  71. package/dom-helpers/parents.js +1 -1
  72. package/dom-helpers/position.js +1 -1
  73. package/dom-helpers/prepend.js +1 -1
  74. package/dom-helpers/querySelectorAll.js +1 -1
  75. package/dom-helpers/reflow.js +1 -1
  76. package/dom-helpers/remove.js +1 -1
  77. package/dom-helpers/removeClass.js +1 -1
  78. package/dom-helpers/removeEventListener.js +1 -1
  79. package/dom-helpers/scrollLeft.js +1 -1
  80. package/dom-helpers/scrollParent.js +1 -1
  81. package/dom-helpers/scrollTo.js +1 -1
  82. package/dom-helpers/scrollTop.js +1 -1
  83. package/dom-helpers/scrollbarSize.js +1 -1
  84. package/dom-helpers/siblings.js +1 -1
  85. package/dom-helpers/text.js +1 -1
  86. package/dom-helpers/toggleClass.js +1 -1
  87. package/dom-helpers/transitionEnd.js +1 -1
  88. package/dom-helpers/triggerEvent.js +1 -1
  89. package/dom-helpers/types.js +5 -1
  90. package/dom-helpers/width.js +1 -1
  91. package/domHelpers.js +1 -1
  92. package/emitter/index.js +1 -1
  93. package/emitter/src/index.js +1 -1
  94. package/emitter.js +1 -1
  95. package/file/fileToURL.js +1 -1
  96. package/file/index.js +1 -1
  97. package/file/saveAs.js +1 -1
  98. package/file.js +1 -1
  99. package/idb/index.js +1 -1
  100. package/idb.js +1 -1
  101. package/index.js +1 -1
  102. package/invariant/index.js +1 -1
  103. package/invariant.js +1 -1
  104. package/is/index.js +1 -1
  105. package/is.js +1 -1
  106. package/js-cookie/index.js +1 -1
  107. package/js-cookie/src/api.js +1 -1
  108. package/js-cookie/src/assign.js +1 -1
  109. package/js-cookie/src/converter.js +1 -1
  110. package/jsCookie.js +1 -1
  111. package/lunar/index.js +1 -1
  112. package/lunar/lib/Holiday.js +1 -1
  113. package/lunar/lib/HolidayUtil.js +1 -1
  114. package/lunar/lib/I18n.js +1 -1
  115. package/lunar/lib/JieQi.js +1 -1
  116. package/lunar/lib/Lunar.js +1 -1
  117. package/lunar/lib/LunarMonth.js +1 -1
  118. package/lunar/lib/LunarTime.js +1 -1
  119. package/lunar/lib/LunarUtil.js +1 -1
  120. package/lunar/lib/LunarYear.js +1 -1
  121. package/lunar/lib/ShouXingUtil.js +1 -1
  122. package/lunar/lib/Solar.js +1 -1
  123. package/lunar/lib/SolarHalfYear.js +1 -1
  124. package/lunar/lib/SolarMonth.js +1 -1
  125. package/lunar/lib/SolarSeason.js +1 -1
  126. package/lunar/lib/SolarUtil.js +1 -1
  127. package/lunar/lib/SolarWeek.js +1 -1
  128. package/lunar/lib/SolarYear.js +1 -1
  129. package/lunar/lib/index.js +1 -1
  130. package/lunar.js +1 -1
  131. package/math/index.js +1 -1
  132. package/math.js +1 -1
  133. package/md5/index.js +1 -1
  134. package/md5.js +1 -1
  135. package/mock/MockWebSocket.js +1 -1
  136. package/mock/MockXMLHttpRequest.js +1 -1
  137. package/mock/index.js +1 -1
  138. package/mock.js +1 -1
  139. package/normalize-wheel/ExecutionEnvironment.js +1 -1
  140. package/normalize-wheel/UserAgent_DEPRECATED.js +1 -1
  141. package/normalize-wheel/index.js +1 -1
  142. package/normalize-wheel/isEventSupported.js +10 -14
  143. package/normalizeWheel.js +1 -1
  144. package/number-to-chinese/index.js +1 -1
  145. package/numberToChinese.js +1 -1
  146. package/nzh/cn.js +1 -1
  147. package/nzh/hk.js +1 -1
  148. package/nzh/index.js +1 -1
  149. package/nzh/nzh.js +1 -1
  150. package/nzh/src/autoGet.js +1 -1
  151. package/nzh/src/index.js +1 -1
  152. package/nzh/src/langs/cn_b.js +1 -1
  153. package/nzh/src/langs/cn_s.js +1 -1
  154. package/nzh/src/langs/hk_b.js +1 -1
  155. package/nzh/src/langs/hk_s.js +1 -1
  156. package/nzh/src/utils.js +1 -1
  157. package/nzh.js +1 -1
  158. package/object-keys-sort/index.js +1 -1
  159. package/objectKeysSort.js +1 -1
  160. package/package.json +1 -1
  161. package/pinyin/index.js +1 -1
  162. package/pinyin/simplified.js +1 -1
  163. package/pinyin/src/core.js +1 -1
  164. package/pinyin/src/simplified.js +1 -1
  165. package/pinyin/src/simplified_dict.js +1 -1
  166. package/pinyin/src/traditional.js +1 -1
  167. package/pinyin/src/traditional_dict.js +1 -1
  168. package/pinyin/traditional.js +1 -1
  169. package/pinyin.js +1 -1
  170. package/query-string/base.js +1 -1
  171. package/query-string/index.js +1 -1
  172. package/query-string/splitOnFirst.js +1 -1
  173. package/queryString.js +1 -1
  174. package/random/address.js +1 -1
  175. package/random/constellation.js +1 -1
  176. package/random/image.js +1 -1
  177. package/random/index.js +1 -1
  178. package/random/licensePlate.js +1 -1
  179. package/random/name.js +1 -1
  180. package/random/number.js +1 -1
  181. package/random/text.js +1 -1
  182. package/random/time.js +1 -1
  183. package/random/web.js +1 -1
  184. package/random.js +1 -1
  185. package/screenfull/index.js +1 -1
  186. package/screenfull.js +1 -1
  187. package/sleep/index.js +1 -1
  188. package/sleep.js +1 -1
  189. package/snapdom/index.js +1 -1
  190. package/snapdom/src/api/preCache.js +51 -49
  191. package/snapdom/src/api/snapdom.js +171 -67
  192. package/snapdom/src/core/cache.js +2 -2
  193. package/snapdom/src/core/capture.js +249 -234
  194. package/snapdom/src/core/clone.js +151 -120
  195. package/snapdom/src/core/context.js +10 -8
  196. package/snapdom/src/core/plugins.js +69 -0
  197. package/snapdom/src/core/prepare.js +2 -2
  198. package/snapdom/src/exporters/download.js +1 -1
  199. package/snapdom/src/exporters/toBlob.js +1 -1
  200. package/snapdom/src/exporters/toCanvas.js +40 -40
  201. package/snapdom/src/exporters/toImg.js +1 -1
  202. package/snapdom/src/modules/CSSVar.js +66 -40
  203. package/snapdom/src/modules/background.js +39 -23
  204. package/snapdom/src/modules/changeCSS.js +1 -1
  205. package/snapdom/src/modules/counter.js +100 -86
  206. package/snapdom/src/modules/fonts.js +4 -4
  207. package/snapdom/src/modules/iconFonts.js +98 -14
  208. package/snapdom/src/modules/images.js +1 -1
  209. package/snapdom/src/modules/lineClamp.js +1 -1
  210. package/snapdom/src/modules/pseudo.js +147 -138
  211. package/snapdom/src/modules/rasterize.js +1 -1
  212. package/snapdom/src/modules/snapFetch.js +1 -1
  213. package/snapdom/src/modules/styles.js +1 -1
  214. package/snapdom/src/modules/svgDefs.js +86 -39
  215. package/snapdom/src/utils/browser.js +1 -1
  216. package/snapdom/src/utils/css.js +1 -1
  217. package/snapdom/src/utils/helpers.js +1 -1
  218. package/snapdom/src/utils/image.js +1 -1
  219. package/snapdom/types/snapdom.d.ts +253 -184
  220. package/snapdom.js +1 -1
  221. package/tinycolor/index.js +1 -1
  222. package/tinycolor/src/conversion.js +1 -1
  223. package/tinycolor/src/css-color-names.js +1 -1
  224. package/tinycolor/src/format-input.js +1 -1
  225. package/tinycolor/src/from-ratio.js +1 -1
  226. package/tinycolor/src/index.js +1 -1
  227. package/tinycolor/src/random.js +1 -1
  228. package/tinycolor/src/readability.js +1 -1
  229. package/tinycolor/src/to-ms-filter.js +1 -1
  230. package/tinycolor/src/utils.js +1 -1
  231. package/tinycolor.js +1 -1
  232. package/tree/index.js +1 -1
  233. package/tree/search/index.js +1 -1
  234. package/tree.js +1 -1
  235. package/tween/index.js +8 -0
  236. package/tween/src/easing.js +62 -0
  237. package/tween/src/tween.js +46 -0
  238. package/tween.js +8 -0
  239. package/types/dom-helpers/types.d.ts +2 -0
  240. package/types/normalize-wheel/index.d.ts +1 -1
  241. package/types/snapdom/src/api/snapdom.d.ts +4 -0
  242. package/types/snapdom/src/core/capture.d.ts +4 -18
  243. package/types/snapdom/src/core/context.d.ts +4 -4
  244. package/types/snapdom/src/core/exporters.d.ts +33 -0
  245. package/types/snapdom/src/core/plugins.d.ts +59 -0
  246. package/types/snapdom/src/modules/CSSVar.d.ts +3 -7
  247. package/types/snapdom/src/modules/iconFonts.d.ts +34 -0
  248. package/types/snapdom/src/modules/svgDefs.d.ts +9 -15
  249. package/types/tween/index.d.ts +1 -0
  250. package/types/tween/src/easing.d.ts +22 -0
  251. package/types/tween/src/index.d.ts +3 -0
  252. package/types/tween/src/tween.d.ts +22 -0
  253. package/types/validate/index.d.ts +3 -0
  254. package/types/validate/src/index.d.ts +39 -0
  255. package/types/validate/src/interface.d.ts +53 -0
  256. package/types/validate/src/locale/en-US.d.ts +47 -0
  257. package/types/validate/src/locale/zh-CN.d.ts +47 -0
  258. package/types/validate/src/message.d.ts +2 -0
  259. package/types/validate/src/rules/array.d.ts +12 -0
  260. package/types/validate/src/rules/base.d.ts +25 -0
  261. package/types/validate/src/rules/boolean.d.ts +8 -0
  262. package/types/validate/src/rules/custom.d.ts +7 -0
  263. package/types/validate/src/rules/number.d.ts +12 -0
  264. package/types/validate/src/rules/object.d.ts +9 -0
  265. package/types/validate/src/rules/string.d.ts +12 -0
  266. package/types/validate/src/rules/type.d.ts +9 -0
  267. package/types/validate/src/utils.d.ts +3 -0
  268. package/ui-color/compareColorByRange.js +1 -1
  269. package/ui-color/index.js +1 -1
  270. package/uiColor.js +1 -1
  271. package/url-toolkit/index.js +1 -1
  272. package/url-toolkit/src/url-toolkit.js +1 -1
  273. package/urlToolkit.js +1 -1
  274. package/validate/index.js +28 -0
  275. package/validate/src/index.js +106 -0
  276. package/validate/src/locale/en-US.js +50 -0
  277. package/validate/src/locale/zh-CN.js +50 -0
  278. package/validate/src/message.js +5 -0
  279. package/validate/src/rules/array.js +73 -0
  280. package/validate/src/rules/base.js +69 -0
  281. package/validate/src/rules/boolean.js +29 -0
  282. package/validate/src/rules/custom.js +26 -0
  283. package/validate/src/rules/number.js +54 -0
  284. package/validate/src/rules/object.js +39 -0
  285. package/validate/src/rules/string.js +54 -0
  286. package/validate/src/rules/type.js +35 -0
  287. package/validate/src/utils.js +8 -0
  288. package/validate.js +28 -0
  289. package/version/index.js +1 -1
  290. package/version.js +1 -1
@@ -1,4 +1,4 @@
1
- /* 2025-10-28 09:57:10 */
1
+ /* 2025-11-03 10:27:31 */
2
2
  import { isSafari as b } from "../utils/browser.js";
3
3
  function y(e) {
4
4
  return typeof e == "string" && /^data:image\/svg\+xml/i.test(e);
@@ -7,99 +7,99 @@ function S(e) {
7
7
  const s = e.indexOf(",");
8
8
  return s >= 0 ? decodeURIComponent(e.slice(s + 1)) : "";
9
9
  }
10
- function M(e) {
10
+ function C(e) {
11
11
  return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`;
12
12
  }
13
- function C(e) {
14
- let s = [], t = "", n = 0;
13
+ function v(e) {
14
+ let s = [], t = "", i = 0;
15
15
  for (let r = 0; r < e.length; r++) {
16
16
  const o = e[r];
17
- o === "(" && n++, o === ")" && (n = Math.max(0, n - 1)), o === ";" && n === 0 ? (s.push(t), t = "") : t += o;
17
+ o === "(" && i++, o === ")" && (i = Math.max(0, i - 1)), o === ";" && i === 0 ? (s.push(t), t = "") : t += o;
18
18
  }
19
19
  return t.trim() && s.push(t), s.map((r) => r.trim()).filter(Boolean);
20
20
  }
21
- function v(e) {
21
+ function D(e) {
22
22
  const s = [];
23
- let t = "", n = 0;
23
+ let t = "", i = 0;
24
24
  for (let o = 0; o < e.length; o++) {
25
25
  const a = e[o];
26
- a === "(" && n++, a === ")" && (n = Math.max(0, n - 1)), a === "," && n === 0 ? (s.push(t.trim()), t = "") : t += a;
26
+ a === "(" && i++, a === ")" && (i = Math.max(0, i - 1)), a === "," && i === 0 ? (s.push(t.trim()), t = "") : t += a;
27
27
  }
28
28
  t.trim() && s.push(t.trim());
29
29
  const r = [];
30
30
  for (const o of s) {
31
31
  if (/\binset\b/i.test(o)) continue;
32
- const a = o.match(/-?\d+(?:\.\d+)?px/gi) || [], [i = "0px", l = "0px", f = "0px"] = a;
32
+ const a = o.match(/-?\d+(?:\.\d+)?px/gi) || [], [n = "0px", l = "0px", f = "0px"] = a;
33
33
  let c = o.replace(/-?\d+(?:\.\d+)?px/gi, "").replace(/\binset\b/gi, "").trim().replace(/\s{2,}/g, " ");
34
34
  const m = !!c && c !== ",";
35
- r.push(`drop-shadow(${i} ${l} ${f}${m ? ` ${c}` : ""})`);
35
+ r.push(`drop-shadow(${n} ${l} ${f}${m ? ` ${c}` : ""})`);
36
36
  }
37
37
  return r.join(" ");
38
38
  }
39
39
  function $(e) {
40
- const s = C(e);
41
- let t = null, n = null, r = null;
40
+ const s = v(e);
41
+ let t = null, i = null, r = null;
42
42
  const o = [];
43
- for (const i of s) {
44
- const l = i.indexOf(":");
43
+ for (const n of s) {
44
+ const l = n.indexOf(":");
45
45
  if (l < 0) continue;
46
- const f = i.slice(0, l).trim().toLowerCase(), c = i.slice(l + 1).trim();
47
- f === "box-shadow" ? r = c : f === "filter" ? t = c : f === "-webkit-filter" ? n = c : o.push([f, c]);
46
+ const f = n.slice(0, l).trim().toLowerCase(), c = n.slice(l + 1).trim();
47
+ f === "box-shadow" ? r = c : f === "filter" ? t = c : f === "-webkit-filter" ? i = c : o.push([f, c]);
48
48
  }
49
49
  if (r) {
50
- const i = v(r);
51
- i && (t = t ? `${t} ${i}` : i, n = n ? `${n} ${i}` : i);
50
+ const n = D(r);
51
+ n && (t = t ? `${t} ${n}` : n, i = i ? `${i} ${n}` : n);
52
52
  }
53
53
  const a = [...o];
54
- return t && a.push(["filter", t]), n && a.push(["-webkit-filter", n]), a.map(([i, l]) => `${i}:${l}`).join(";");
54
+ return t && a.push(["filter", t]), i && a.push(["-webkit-filter", i]), a.map(([n, l]) => `${n}:${l}`).join(";");
55
55
  }
56
- function D(e) {
56
+ function F(e) {
57
57
  return e.replace(
58
58
  /([^{}]+)\{([^}]*)\}/g,
59
- (s, t, n) => `${t}{${$(n)}}`
59
+ (s, t, i) => `${t}{${$(i)}}`
60
60
  );
61
61
  }
62
- function F(e) {
62
+ function H(e) {
63
63
  return e = e.replace(
64
64
  /<style[^>]*>([\s\S]*?)<\/style>/gi,
65
- (s, t) => s.replace(t, D(t))
65
+ (s, t) => s.replace(t, F(t))
66
66
  ), e = e.replace(
67
67
  /style=(['"])([\s\S]*?)\1/gi,
68
- (s, t, n) => `style=${t}${$(n)}${t}`
68
+ (s, t, i) => `style=${t}${$(i)}${t}`
69
69
  ), e;
70
70
  }
71
- function H(e) {
71
+ function M(e) {
72
72
  if (!b() || !y(e)) return e;
73
73
  try {
74
- const s = S(e), t = F(s);
75
- return M(t);
74
+ const s = S(e), t = H(s);
75
+ return C(t);
76
76
  } catch {
77
77
  return e;
78
78
  }
79
79
  }
80
80
  async function k(e, s) {
81
- let { width: t, height: n, scale: r = 1, dpr: o = 1, meta: a = {} } = s;
82
- e = H(e);
83
- const i = new Image();
84
- i.loading = "eager", i.decoding = "sync", i.crossOrigin = "anonymous", i.src = e, await i.decode();
85
- const l = i.naturalWidth, f = i.naturalHeight, c = Number.isFinite(a.w0) ? a.w0 : l, m = Number.isFinite(a.h0) ? a.h0 : f;
81
+ let { width: t, height: i, scale: r = 1, dpr: o = 1, meta: a = {} } = s;
82
+ e = M(e);
83
+ const n = new Image();
84
+ n.loading = "eager", n.decoding = "sync", n.crossOrigin = "anonymous", n.src = e, await n.decode();
85
+ const l = n.naturalWidth, f = n.naturalHeight, c = Number.isFinite(a.w0) ? a.w0 : l, m = Number.isFinite(a.h0) ? a.h0 : f;
86
86
  let h, u;
87
- const g = Number.isFinite(t), x = Number.isFinite(n);
87
+ const g = Number.isFinite(t), x = Number.isFinite(i);
88
88
  if (g && x)
89
- h = Math.max(1, t), u = Math.max(1, n);
89
+ h = Math.max(1, t), u = Math.max(1, i);
90
90
  else if (g) {
91
91
  const p = t / Math.max(1, c);
92
- h = t, u = Math.round(m * p);
92
+ h = t, u = m * p;
93
93
  } else if (x) {
94
- const p = n / Math.max(1, m);
95
- u = n, h = Math.round(c * p);
94
+ const p = i / Math.max(1, m);
95
+ u = i, h = c * p;
96
96
  } else
97
97
  h = l, u = f;
98
- h = Math.round(h * r), u = Math.round(u * r);
98
+ h = h * r, u = u * r;
99
99
  const d = document.createElement("canvas");
100
- d.width = Math.ceil(h * o), d.height = Math.ceil(u * o), d.style.width = `${h}px`, d.style.height = `${u}px`;
100
+ d.width = h * o, d.height = u * o, d.style.width = `${h}px`, d.style.height = `${u}px`;
101
101
  const w = d.getContext("2d");
102
- return o !== 1 && w.scale(o, o), w.drawImage(i, 0, 0, h, u), d;
102
+ return o !== 1 && w.scale(o, o), w.drawImage(n, 0, 0, h, u), d;
103
103
  }
104
104
  export {
105
105
  k as toCanvas
@@ -1,4 +1,4 @@
1
- /* 2025-10-28 09:57:10 */
1
+ /* 2025-11-03 10:27:31 */
2
2
  import { rasterize as p } from "../modules/rasterize.js";
3
3
  import { isSafari as f } from "../utils/browser.js";
4
4
  async function x(i, g) {
@@ -1,61 +1,87 @@
1
- /* 2025-10-28 09:57:10 */
2
- function f(n, s) {
3
- if (!(n instanceof Element) || !(s instanceof Element)) return;
4
- const y = n.getAttribute?.("style");
5
- let o = !!(y && y.includes("var("));
6
- if (!o && n.attributes?.length) {
7
- const r = n.attributes;
8
- for (let t = 0; t < r.length; t++) {
9
- const e = r[t];
10
- if (e && typeof e.value == "string" && e.value.includes("var(")) {
11
- o = !0;
1
+ /* 2025-11-03 10:27:31 */
2
+ const f = ["fill", "stroke", "color", "background-color", "stop-color"], p = /* @__PURE__ */ new Map();
3
+ function y(r, c) {
4
+ const l = c + "::" + r.toLowerCase();
5
+ let a = p.get(l);
6
+ if (a) return a;
7
+ const n = document, o = c === "http://www.w3.org/2000/svg" ? n.createElementNS(c, r) : n.createElement(r), e = n.createElement("div");
8
+ e.style.cssText = "position:absolute;left:-99999px;top:-99999px;contain:strict;display:block;", e.appendChild(o), n.documentElement.appendChild(e);
9
+ const t = getComputedStyle(o), s = {};
10
+ for (const i of f)
11
+ s[i] = t.getPropertyValue(i) || "";
12
+ return e.remove(), p.set(l, s), s;
13
+ }
14
+ function u(r, c) {
15
+ if (!(r instanceof Element) || !(c instanceof Element)) return;
16
+ const l = r.getAttribute?.("style");
17
+ let a = !!(l && l.includes("var("));
18
+ if (!a && r.attributes?.length) {
19
+ const o = r.attributes;
20
+ for (let e = 0; e < o.length; e++) {
21
+ const t = o[e];
22
+ if (t && typeof t.value == "string" && t.value.includes("var(")) {
23
+ a = !0;
12
24
  break;
13
25
  }
14
26
  }
15
27
  }
16
- if (!o) return;
17
- let l;
18
- try {
19
- l = getComputedStyle(n);
20
- } catch {
21
- return;
28
+ let n = null;
29
+ if (a)
30
+ try {
31
+ n = getComputedStyle(r);
32
+ } catch {
33
+ }
34
+ if (a) {
35
+ const o = r.style;
36
+ if (o && o.length)
37
+ for (let e = 0; e < o.length; e++) {
38
+ const t = o[e], s = o.getPropertyValue(t);
39
+ if (!s || !s.includes("var(")) continue;
40
+ const i = n && n.getPropertyValue(t);
41
+ if (i)
42
+ try {
43
+ c.style.setProperty(
44
+ t,
45
+ i.trim(),
46
+ o.getPropertyPriority(t)
47
+ );
48
+ } catch {
49
+ }
50
+ }
22
51
  }
23
- const a = n.style;
24
- if (a && a.length)
25
- for (let r = 0; r < a.length; r++) {
26
- const t = a[r], e = a.getPropertyValue(t);
27
- if (!e || !e.includes("var(")) continue;
28
- const i = l.getPropertyValue(t);
52
+ if (a && r.attributes?.length) {
53
+ const o = r.attributes;
54
+ for (let e = 0; e < o.length; e++) {
55
+ const t = o[e];
56
+ if (!t || typeof t.value != "string" || !t.value.includes("var("))
57
+ continue;
58
+ const s = t.name, i = n && n.getPropertyValue(s);
29
59
  if (i)
30
60
  try {
31
- s.style.setProperty(
32
- t,
33
- i.trim(),
34
- a.getPropertyPriority(t)
35
- );
61
+ c.style.setProperty(s, i.trim());
36
62
  } catch {
37
63
  }
38
64
  }
39
- if (n.attributes?.length) {
40
- const r = n.attributes;
41
- for (let t = 0; t < r.length; t++) {
42
- const e = r[t];
43
- if (!e || typeof e.value != "string" || !e.value.includes("var("))
44
- continue;
45
- const i = e.name;
46
- let c = "";
65
+ }
66
+ if (!a) {
67
+ if (!n)
47
68
  try {
48
- c = l.getPropertyValue(i);
69
+ n = getComputedStyle(r);
49
70
  } catch {
71
+ n = null;
50
72
  }
51
- if (c)
73
+ if (!n) return;
74
+ const o = r.namespaceURI || "html", e = y(r.tagName, o);
75
+ for (const t of f) {
76
+ const s = n.getPropertyValue(t) || "", i = e[t] || "";
77
+ if (s && s !== i)
52
78
  try {
53
- s.style.setProperty(i, c.trim());
79
+ c.style.setProperty(t, s.trim());
54
80
  } catch {
55
81
  }
56
82
  }
57
83
  }
58
84
  }
59
85
  export {
60
- f as resolveCSSVars
86
+ u as resolveCSSVars
61
87
  };
@@ -1,8 +1,8 @@
1
- /* 2025-10-28 09:57:10 */
2
- import { getStyle as P, splitBackgroundImage as w } from "../utils/css.js";
3
- import { inlineSingleBackgroundEntry as h } from "../utils/image.js";
4
- async function A(k, g, n, p = {}) {
5
- const a = [[k, g]], u = [
1
+ /* 2025-11-03 10:27:31 */
2
+ import { getStyle as h, splitBackgroundImage as w } from "../utils/css.js";
3
+ import { inlineSingleBackgroundEntry as O } from "../utils/image.js";
4
+ async function _(k, d, s, l = {}) {
5
+ const a = [[k, d]], p = [
6
6
  "background-image",
7
7
  // Mask shorthands & images (both standard and WebKit)
8
8
  "mask",
@@ -17,7 +17,7 @@ async function A(k, g, n, p = {}) {
17
17
  // Border image
18
18
  "border-image",
19
19
  "border-image-source"
20
- ], b = [
20
+ ], u = [
21
21
  "mask-position",
22
22
  "mask-size",
23
23
  "mask-repeat",
@@ -33,41 +33,57 @@ async function A(k, g, n, p = {}) {
33
33
  // Some engines expose X/Y position separately:
34
34
  "-webkit-mask-position-x",
35
35
  "-webkit-mask-position-y"
36
- ], d = [
36
+ ], b = [
37
+ "background-position",
38
+ "background-position-x",
39
+ "background-position-y",
40
+ "background-size",
41
+ "background-repeat",
42
+ "background-origin",
43
+ "background-clip",
44
+ "background-attachment",
45
+ "background-blend-mode"
46
+ ], f = [
37
47
  "border-image-slice",
38
48
  "border-image-width",
39
49
  "border-image-outset",
40
50
  "border-image-repeat"
41
51
  ];
42
52
  for (; a.length; ) {
43
- const [i, s] = a.shift(), t = n.get(i) || P(i);
44
- n.has(i) || n.set(i, t);
45
- const f = (() => {
53
+ const [r, i] = a.shift(), t = s.get(r) || h(r);
54
+ s.has(r) || s.set(r, t);
55
+ const y = (() => {
46
56
  const e = t.getPropertyValue("border-image"), o = t.getPropertyValue("border-image-source");
47
57
  return e && e !== "none" || o && o !== "none";
48
58
  })();
49
- for (const e of u) {
59
+ for (const e of b) {
60
+ const o = t.getPropertyValue(e);
61
+ o && i.style.setProperty(e, o);
62
+ }
63
+ for (const e of p) {
50
64
  const o = t.getPropertyValue(e);
51
65
  if (!o || o === "none") continue;
52
- const y = w(o), l = await Promise.all(
53
- y.map((r) => h(r, p))
66
+ const P = w(o), g = await Promise.all(
67
+ P.map((n) => O(n, l))
54
68
  );
55
- l.some((r) => r && r !== "none" && !/^url\(undefined/.test(r)) && s.style.setProperty(e, l.join(", "));
69
+ g.some((n) => n && n !== "none" && !/^url\(undefined/.test(n)) && i.style.setProperty(e, g.join(", "));
56
70
  }
57
- for (const e of b) {
71
+ for (const e of u) {
58
72
  const o = t.getPropertyValue(e);
59
- !o || o === "initial" || s.style.setProperty(e, o);
73
+ !o || o === "initial" || i.style.setProperty(e, o);
60
74
  }
61
- if (f)
62
- for (const e of d) {
75
+ if (y)
76
+ for (const e of f) {
63
77
  const o = t.getPropertyValue(e);
64
- !o || o === "initial" || s.style.setProperty(e, o);
78
+ !o || o === "initial" || i.style.setProperty(e, o);
65
79
  }
66
- const m = Array.from(i.children), c = Array.from(s.children);
67
- for (let e = 0; e < Math.min(m.length, c.length); e++)
68
- a.push([m[e], c[e]]);
80
+ const c = Array.from(r.children), m = Array.from(i.children).filter(
81
+ (e) => !(e.dataset && e.dataset.snapdomPseudo)
82
+ );
83
+ for (let e = 0; e < Math.min(c.length, m.length); e++)
84
+ a.push([c[e], m[e]]);
69
85
  }
70
86
  }
71
87
  export {
72
- A as inlineBackgroundImages
88
+ _ as inlineBackgroundImages
73
89
  };
@@ -1,4 +1,4 @@
1
- /* 2025-10-28 09:57:10 */
1
+ /* 2025-11-03 10:27:31 */
2
2
  function F(t, n) {
3
3
  if (!t || !n) return;
4
4
  const o = t.scrollTop || 0;
@@ -1,18 +1,19 @@
1
- /* 2025-10-28 09:57:10 */
2
- function I(e) {
1
+ /* 2025-11-03 10:27:31 */
2
+ import { cache as F } from "../core/cache.js";
3
+ function D(e) {
3
4
  return /\bcounter\s*\(|\bcounters\s*\(/.test(e || "");
4
5
  }
5
- function x(e) {
6
+ function X(e) {
6
7
  return (e || "").replace(/"([^"]*)"/g, "$1");
7
8
  }
8
- function S(e, o = !1) {
9
- let u = "", c = Math.max(1, e);
10
- for (; c > 0; )
11
- c--, u = String.fromCharCode(97 + c % 26) + u, c = Math.floor(c / 26);
12
- return o ? u.toUpperCase() : u;
9
+ function k(e, u = !1) {
10
+ let c = "", o = Math.max(1, e);
11
+ for (; o > 0; )
12
+ o--, c = String.fromCharCode(97 + o % 26) + c, o = Math.floor(o / 26);
13
+ return u ? c.toUpperCase() : c;
13
14
  }
14
- function L(e, o = !0) {
15
- const u = [
15
+ function x(e, u = !0) {
16
+ const c = [
16
17
  [1e3, "M"],
17
18
  [900, "CM"],
18
19
  [500, "D"],
@@ -27,104 +28,116 @@ function L(e, o = !0) {
27
28
  [4, "IV"],
28
29
  [1, "I"]
29
30
  ];
30
- let c = Math.max(1, Math.min(3999, e)), p = "";
31
- for (const [C, b] of u)
32
- for (; c >= C; )
33
- p += b, c -= C;
34
- return o ? p : p.toLowerCase();
31
+ let o = Math.max(1, Math.min(3999, e)), f = "";
32
+ for (const [N, C] of c)
33
+ for (; o >= N; )
34
+ f += C, o -= N;
35
+ return u ? f : f.toLowerCase();
35
36
  }
36
- function k(e, o) {
37
- switch ((o || "decimal").toLowerCase()) {
37
+ function I(e, u) {
38
+ switch ((u || "decimal").toLowerCase()) {
38
39
  case "decimal":
39
40
  return String(Math.max(0, e));
40
41
  case "decimal-leading-zero":
41
42
  return (e < 10 ? "0" : "") + String(Math.max(0, e));
42
43
  case "lower-alpha":
43
- return S(e, !1);
44
+ return k(e, !1);
44
45
  case "upper-alpha":
45
- return S(e, !0);
46
+ return k(e, !0);
46
47
  case "lower-roman":
47
- return L(e, !1);
48
+ return x(e, !1);
48
49
  case "upper-roman":
49
- return L(e, !0);
50
+ return x(e, !0);
50
51
  default:
51
52
  return String(Math.max(0, e));
52
53
  }
53
54
  }
54
- function X(e) {
55
- const o = /* @__PURE__ */ new WeakMap(), u = e instanceof Document ? e.documentElement : e, c = (n) => n && n.tagName === "LI", p = (n) => {
56
- let s = 0, t = n?.parentElement;
55
+ function $(e) {
56
+ const u = () => F?.session?.__counterEpoch ?? 0;
57
+ let c = u();
58
+ const o = /* @__PURE__ */ new WeakMap(), f = e instanceof Document ? e.documentElement : e, N = (n) => n && n.tagName === "LI", C = (n) => {
59
+ let r = 0, t = n?.parentElement;
57
60
  if (!t) return 0;
58
- for (const r of t.children) {
59
- if (r === n) break;
60
- r.tagName === "LI" && s++;
61
+ for (const s of t.children) {
62
+ if (s === n) break;
63
+ s.tagName === "LI" && r++;
61
64
  }
62
- return s;
63
- }, C = (n) => {
64
- const s = /* @__PURE__ */ new Map();
65
- for (const [t, r] of n) s.set(t, r.slice());
66
- return s;
67
- }, b = (n, s, t) => {
68
- const r = C(n);
69
- let g;
65
+ return r;
66
+ }, S = (n) => {
67
+ const r = /* @__PURE__ */ new Map();
68
+ for (const [t, s] of n) r.set(t, s.slice());
69
+ return r;
70
+ }, g = (n, r, t) => {
71
+ const s = S(n);
72
+ let h;
70
73
  try {
71
- g = t.style?.counterReset || getComputedStyle(t).counterReset;
74
+ h = t.style?.counterReset || getComputedStyle(t).counterReset;
72
75
  } catch {
73
76
  }
74
- if (g && g !== "none")
75
- for (const d of g.split(",")) {
76
- const l = d.trim().split(/\s+/), i = l[0], m = Number.isFinite(Number(l[1])) ? Number(l[1]) : 0;
77
+ if (h && h !== "none")
78
+ for (const M of h.split(",")) {
79
+ const m = M.trim().split(/\s+/), i = m[0], l = Number.isFinite(Number(m[1])) ? Number(m[1]) : 0;
77
80
  if (!i) continue;
78
- const a = s.get(i);
81
+ const a = r.get(i);
79
82
  if (a && a.length) {
80
- const N = a.slice();
81
- N.push(m), r.set(i, N);
83
+ const w = a.slice();
84
+ w.push(l), s.set(i, w);
82
85
  } else
83
- r.set(i, [m]);
86
+ s.set(i, [l]);
84
87
  }
85
- let h;
88
+ let y;
86
89
  try {
87
- h = t.style?.counterIncrement || getComputedStyle(t).counterIncrement;
90
+ y = t.style?.counterIncrement || getComputedStyle(t).counterIncrement;
88
91
  } catch {
89
92
  }
90
- if (h && h !== "none")
91
- for (const d of h.split(",")) {
92
- const l = d.trim().split(/\s+/), i = l[0], m = Number.isFinite(Number(l[1])) ? Number(l[1]) : 1;
93
+ if (y && y !== "none")
94
+ for (const M of y.split(",")) {
95
+ const m = M.trim().split(/\s+/), i = m[0], l = Number.isFinite(Number(m[1])) ? Number(m[1]) : 1;
93
96
  if (!i) continue;
94
- const a = r.get(i) || [];
95
- a.length === 0 && a.push(0), a[a.length - 1] += m, r.set(i, a);
97
+ const a = s.get(i) || [];
98
+ a.length === 0 && a.push(0), a[a.length - 1] += l, s.set(i, a);
96
99
  }
97
100
  try {
98
- if (getComputedStyle(t).display === "list-item" && c(t)) {
99
- const l = t.parentElement;
101
+ if (getComputedStyle(t).display === "list-item" && N(t)) {
102
+ const m = t.parentElement;
100
103
  let i = 1;
101
- if (l && l.tagName === "OL") {
102
- const a = l.getAttribute("start"), N = Number.isFinite(Number(a)) ? Number(a) : 1, w = p(t), M = t.getAttribute("value");
103
- i = Number.isFinite(Number(M)) ? Number(M) : N + w;
104
+ if (m && m.tagName === "OL") {
105
+ const a = m.getAttribute("start"), w = Number.isFinite(Number(a)) ? Number(a) : 1, E = C(t), L = t.getAttribute("value");
106
+ i = Number.isFinite(Number(L)) ? Number(L) : w + E;
104
107
  } else
105
- i = 1 + p(t);
106
- const m = r.get("list-item") || [];
107
- m.length === 0 && m.push(0), m[m.length - 1] = i, r.set("list-item", m);
108
+ i = 1 + C(t);
109
+ const l = s.get("list-item") || [];
110
+ l.length === 0 && l.push(0), l[l.length - 1] = i, s.set("list-item", l);
108
111
  }
109
112
  } catch {
110
113
  }
111
- return r;
112
- }, y = (n, s, t) => {
113
- const r = b(t, s, n);
114
- o.set(n, r);
115
- let g = r;
116
- for (const h of n.children)
117
- g = y(h, r, g);
118
- return r;
119
- }, f = /* @__PURE__ */ new Map();
120
- return y(u, f, f), {
114
+ return s;
115
+ }, p = (n, r, t) => {
116
+ const s = g(t, r, n);
117
+ o.set(n, s);
118
+ let h = s;
119
+ for (const y of n.children)
120
+ h = p(y, s, h);
121
+ return s;
122
+ }, b = /* @__PURE__ */ new Map();
123
+ p(f, b, b);
124
+ function d() {
125
+ const n = u();
126
+ if (n !== c) {
127
+ c = n;
128
+ const r = /* @__PURE__ */ new Map();
129
+ p(f, r, r);
130
+ }
131
+ }
132
+ return {
121
133
  /**
122
134
  * Get top value for counter name at given node.
123
135
  * @param {Element} node
124
136
  * @param {string} name
125
137
  */
126
- get(n, s) {
127
- const t = o.get(n)?.get(s);
138
+ get(n, r) {
139
+ d();
140
+ const t = o.get(n)?.get(r);
128
141
  return t && t.length ? t[t.length - 1] : 0;
129
142
  },
130
143
  /**
@@ -132,34 +145,35 @@ function X(e) {
132
145
  * @param {Element} node
133
146
  * @param {string} name
134
147
  */
135
- getStack(n, s) {
136
- const t = o.get(n)?.get(s);
148
+ getStack(n, r) {
149
+ d();
150
+ const t = o.get(n)?.get(r);
137
151
  return t ? t.slice() : [];
138
152
  }
139
153
  };
140
154
  }
141
- function A(e, o, u) {
155
+ function R(e, u, c) {
142
156
  if (!e || e === "none") return e;
143
157
  try {
144
- const c = /\b(counter|counters)\s*\(([^)]+)\)/g;
145
- let p = e.replace(c, (C, b, y) => {
146
- const f = String(y).split(",").map((n) => n.trim());
147
- if (b === "counter") {
148
- const n = f[0]?.replace(/^["']|["']$/g, ""), s = (f[1] || "decimal").toLowerCase(), t = u.get(o, n);
149
- return k(t, s);
158
+ const o = /\b(counter|counters)\s*\(([^)]+)\)/g;
159
+ let f = e.replace(o, (N, C, S) => {
160
+ const g = String(S).split(",").map((p) => p.trim());
161
+ if (C === "counter") {
162
+ const p = g[0]?.replace(/^["']|["']$/g, ""), b = (g[1] || "decimal").toLowerCase(), d = c.get(u, p);
163
+ return I(d, b);
150
164
  } else {
151
- const n = f[0]?.replace(/^["']|["']$/g, ""), s = f[1]?.replace(/^["']|["']$/g, "") ?? "", t = (f[2] || "decimal").toLowerCase(), r = u.getStack(o, n);
152
- return r.length ? r.map((h) => k(h, t)).join(s) : "";
165
+ const p = g[0]?.replace(/^["']|["']$/g, ""), b = g[1]?.replace(/^["']|["']$/g, "") ?? "", d = (g[2] || "decimal").toLowerCase(), n = c.getStack(u, p);
166
+ return n.length ? n.map((t) => I(t, d)).join(b) : "";
153
167
  }
154
168
  });
155
- return x(p);
169
+ return X(f);
156
170
  } catch {
157
171
  return "- ";
158
172
  }
159
173
  }
160
174
  export {
161
- X as buildCounterContext,
162
- I as hasCounters,
163
- A as resolveCountersInContent,
164
- x as unquoteDoubleStrings
175
+ $ as buildCounterContext,
176
+ D as hasCounters,
177
+ R as resolveCountersInContent,
178
+ X as unquoteDoubleStrings
165
179
  };