@unicom-cloud/utils 0.1.24 → 0.1.26

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 (416) hide show
  1. package/axios/index.d.ts +791 -0
  2. package/axios/index.js +41 -0
  3. package/axios/lib/adapters/adapters.js +65 -0
  4. package/axios/lib/adapters/fetch.js +186 -0
  5. package/axios/lib/adapters/xhr.js +105 -0
  6. package/axios/lib/axios.js +47 -0
  7. package/axios/lib/cancel/CancelToken.js +78 -0
  8. package/axios/lib/cancel/CanceledError.js +18 -0
  9. package/axios/lib/cancel/isCancel.js +7 -0
  10. package/axios/lib/core/Axios.js +170 -0
  11. package/axios/lib/core/AxiosError.js +64 -0
  12. package/axios/lib/core/AxiosHeaders.js +192 -0
  13. package/axios/lib/core/InterceptorManager.js +59 -0
  14. package/axios/lib/core/buildFullPath.js +10 -0
  15. package/axios/lib/core/dispatchRequest.js +35 -0
  16. package/axios/lib/core/mergeConfig.js +74 -0
  17. package/axios/lib/core/settle.js +17 -0
  18. package/axios/lib/core/transformData.js +19 -0
  19. package/axios/lib/defaults/index.js +103 -0
  20. package/axios/lib/defaults/transitional.js +9 -0
  21. package/axios/lib/env/data.js +5 -0
  22. package/axios/lib/helpers/AxiosURLSearchParams.js +37 -0
  23. package/axios/lib/helpers/HttpStatusCode.js +78 -0
  24. package/axios/lib/helpers/bind.js +9 -0
  25. package/axios/lib/helpers/buildURL.js +24 -0
  26. package/axios/lib/helpers/combineURLs.js +7 -0
  27. package/axios/lib/helpers/composeSignals.js +38 -0
  28. package/axios/lib/helpers/cookies.js +37 -0
  29. package/axios/lib/helpers/formDataToJSON.js +32 -0
  30. package/axios/lib/helpers/isAbsoluteURL.js +7 -0
  31. package/axios/lib/helpers/isAxiosError.js +8 -0
  32. package/axios/lib/helpers/isURLSameOrigin.js +9 -0
  33. package/axios/lib/helpers/parseHeaders.js +31 -0
  34. package/axios/lib/helpers/parseProtocol.js +8 -0
  35. package/axios/lib/helpers/progressEventReducer.js +39 -0
  36. package/axios/lib/helpers/resolveConfig.js +44 -0
  37. package/axios/lib/helpers/speedometer.js +20 -0
  38. package/axios/lib/helpers/spread.js +9 -0
  39. package/axios/lib/helpers/throttle.js +16 -0
  40. package/axios/lib/helpers/toFormData.js +91 -0
  41. package/axios/lib/helpers/toURLEncodedForm.js +15 -0
  42. package/axios/lib/helpers/trackStream.js +67 -0
  43. package/axios/lib/helpers/validator.js +66 -0
  44. package/axios/lib/platform/browser/classes/Blob.js +5 -0
  45. package/axios/lib/platform/browser/classes/FormData.js +5 -0
  46. package/axios/lib/platform/browser/classes/URLSearchParams.js +6 -0
  47. package/axios/lib/platform/browser/index.js +16 -0
  48. package/axios/lib/platform/common/utils.js +9 -0
  49. package/axios/lib/platform/index.js +10 -0
  50. package/axios/lib/utils.js +248 -0
  51. package/axios-mock-adapter/index.d.ts +59 -0
  52. package/axios-mock-adapter/index.js +206 -0
  53. package/axios-mock-adapter/request.js +51 -0
  54. package/axios-mock-adapter/utils.js +129 -0
  55. package/axios.js +24 -0
  56. package/axiosMockAdapter.js +9 -0
  57. package/case-name/index.js +1 -1
  58. package/caseName.js +1 -1
  59. package/class-name/index.js +1 -1
  60. package/className.js +1 -1
  61. package/clipboard-copy/index.js +1 -1
  62. package/clipboardCopy.js +1 -1
  63. package/constant/address.js +1 -1
  64. package/constant/chineseCharacters.js +1 -1
  65. package/constant/constellations.js +1 -1
  66. package/constant/domain.js +1 -1
  67. package/constant/emoji.js +1 -1
  68. package/constant/identity.js +1 -1
  69. package/constant/index.js +1 -1
  70. package/constant/keyboardCode.js +1 -1
  71. package/constant/licensePlate.js +1 -1
  72. package/constant/name.js +1 -1
  73. package/constant/platform.js +1 -1
  74. package/constant/protocol.js +1 -1
  75. package/constant/ui.js +1 -1
  76. package/constant.js +1 -1
  77. package/content-disposition/index.js +1 -1
  78. package/contentDisposition.js +1 -1
  79. package/cookie/index.js +1 -1
  80. package/cookie/src/index.js +1 -1
  81. package/cookie.js +1 -1
  82. package/date/convertTime.js +1 -1
  83. package/date/convertToDuration.js +1 -1
  84. package/date/index.js +1 -1
  85. package/date.js +1 -1
  86. package/decimal/decimal.js +22 -22
  87. package/decimal/index.js +1 -1
  88. package/decimal.js +1 -1
  89. package/dom-helpers/activeElement.js +1 -1
  90. package/dom-helpers/addClass.js +1 -1
  91. package/dom-helpers/addEventListener.js +1 -1
  92. package/dom-helpers/animate.js +1 -1
  93. package/dom-helpers/animationFrame.js +1 -1
  94. package/dom-helpers/attribute.js +1 -1
  95. package/dom-helpers/camelize.js +1 -1
  96. package/dom-helpers/camelizeStyle.js +1 -1
  97. package/dom-helpers/canUseDOM.js +1 -1
  98. package/dom-helpers/childElements.js +1 -1
  99. package/dom-helpers/childNodes.js +1 -1
  100. package/dom-helpers/clear.js +1 -1
  101. package/dom-helpers/closest.js +1 -1
  102. package/dom-helpers/collectElements.js +1 -1
  103. package/dom-helpers/collectSiblings.js +1 -1
  104. package/dom-helpers/contains.js +1 -1
  105. package/dom-helpers/css.js +1 -1
  106. package/dom-helpers/filterEventHandler.js +1 -1
  107. package/dom-helpers/getComputedStyle.js +1 -1
  108. package/dom-helpers/getScrollAccessor.js +1 -1
  109. package/dom-helpers/hasClass.js +1 -1
  110. package/dom-helpers/height.js +1 -1
  111. package/dom-helpers/hyphenate.js +1 -1
  112. package/dom-helpers/hyphenateStyle.js +1 -1
  113. package/dom-helpers/index.js +1 -1
  114. package/dom-helpers/insertAfter.js +1 -1
  115. package/dom-helpers/isDocument.js +1 -1
  116. package/dom-helpers/isInput.js +1 -1
  117. package/dom-helpers/isTransform.js +1 -1
  118. package/dom-helpers/isVisible.js +1 -1
  119. package/dom-helpers/isWindow.js +1 -1
  120. package/dom-helpers/listen.js +1 -1
  121. package/dom-helpers/matches.js +1 -1
  122. package/dom-helpers/nextUntil.js +1 -1
  123. package/dom-helpers/offset.js +1 -1
  124. package/dom-helpers/offsetParent.js +1 -1
  125. package/dom-helpers/ownerDocument.js +1 -1
  126. package/dom-helpers/ownerWindow.js +1 -1
  127. package/dom-helpers/parents.js +1 -1
  128. package/dom-helpers/position.js +1 -1
  129. package/dom-helpers/prepend.js +1 -1
  130. package/dom-helpers/querySelectorAll.js +1 -1
  131. package/dom-helpers/reflow.js +1 -1
  132. package/dom-helpers/remove.js +1 -1
  133. package/dom-helpers/removeClass.js +1 -1
  134. package/dom-helpers/removeEventListener.js +1 -1
  135. package/dom-helpers/scrollLeft.js +1 -1
  136. package/dom-helpers/scrollParent.js +1 -1
  137. package/dom-helpers/scrollTo.js +1 -1
  138. package/dom-helpers/scrollTop.js +1 -1
  139. package/dom-helpers/scrollbarSize.js +1 -1
  140. package/dom-helpers/siblings.js +1 -1
  141. package/dom-helpers/text.js +1 -1
  142. package/dom-helpers/toggleClass.js +1 -1
  143. package/dom-helpers/transitionEnd.js +1 -1
  144. package/dom-helpers/triggerEvent.js +1 -1
  145. package/dom-helpers/types.js +5 -1
  146. package/dom-helpers/width.js +1 -1
  147. package/domHelpers.js +1 -1
  148. package/emitter/index.js +1 -1
  149. package/emitter/src/index.js +1 -1
  150. package/emitter.js +1 -1
  151. package/file/fileToURL.js +1 -1
  152. package/file/index.js +1 -1
  153. package/file/saveAs.js +1 -1
  154. package/file.js +1 -1
  155. package/idb/index.js +1 -1
  156. package/idb.js +1 -1
  157. package/index.js +1 -1
  158. package/invariant/index.js +1 -1
  159. package/invariant.js +1 -1
  160. package/is/index.js +140 -123
  161. package/is.js +77 -76
  162. package/js-cookie/index.js +1 -1
  163. package/js-cookie/src/api.js +1 -1
  164. package/js-cookie/src/assign.js +1 -1
  165. package/js-cookie/src/converter.js +1 -1
  166. package/jsCookie.js +1 -1
  167. package/lunar/index.js +1 -1
  168. package/lunar/lib/Holiday.js +1 -1
  169. package/lunar/lib/HolidayUtil.js +1 -1
  170. package/lunar/lib/I18n.js +1 -1
  171. package/lunar/lib/JieQi.js +1 -1
  172. package/lunar/lib/Lunar.js +1 -1
  173. package/lunar/lib/LunarMonth.js +1 -1
  174. package/lunar/lib/LunarTime.js +1 -1
  175. package/lunar/lib/LunarUtil.js +1 -1
  176. package/lunar/lib/LunarYear.js +1 -1
  177. package/lunar/lib/ShouXingUtil.js +1 -1
  178. package/lunar/lib/Solar.js +1 -1
  179. package/lunar/lib/SolarHalfYear.js +1 -1
  180. package/lunar/lib/SolarMonth.js +1 -1
  181. package/lunar/lib/SolarSeason.js +1 -1
  182. package/lunar/lib/SolarUtil.js +1 -1
  183. package/lunar/lib/SolarWeek.js +1 -1
  184. package/lunar/lib/SolarYear.js +1 -1
  185. package/lunar/lib/index.js +1 -1
  186. package/lunar.js +1 -1
  187. package/math/index.js +1 -1
  188. package/math.js +1 -1
  189. package/md5/index.js +1 -1
  190. package/md5.js +1 -1
  191. package/mock/MockWebSocket.js +1 -1
  192. package/mock/MockXMLHttpRequest.js +1 -1
  193. package/mock/index.js +1 -1
  194. package/mock.js +1 -1
  195. package/normalize-wheel/ExecutionEnvironment.js +1 -1
  196. package/normalize-wheel/UserAgent_DEPRECATED.js +1 -1
  197. package/normalize-wheel/index.js +1 -1
  198. package/normalize-wheel/isEventSupported.js +10 -14
  199. package/normalizeWheel.js +1 -1
  200. package/number-to-chinese/index.js +1 -1
  201. package/numberToChinese.js +1 -1
  202. package/nzh/cn.js +1 -1
  203. package/nzh/hk.js +1 -1
  204. package/nzh/index.js +1 -1
  205. package/nzh/nzh.js +1 -1
  206. package/nzh/src/autoGet.js +1 -1
  207. package/nzh/src/index.js +1 -1
  208. package/nzh/src/langs/cn_b.js +1 -1
  209. package/nzh/src/langs/cn_s.js +1 -1
  210. package/nzh/src/langs/hk_b.js +1 -1
  211. package/nzh/src/langs/hk_s.js +1 -1
  212. package/nzh/src/utils.js +1 -1
  213. package/nzh.js +1 -1
  214. package/object-keys-sort/index.js +1 -1
  215. package/object-prototype-to-string-call/index.js +7 -0
  216. package/objectKeysSort.js +1 -1
  217. package/objectPrototypeToStringCall.js +5 -0
  218. package/package.json +1 -1
  219. package/pinyin/index.js +1 -1
  220. package/pinyin/simplified.js +1 -1
  221. package/pinyin/src/core.js +1 -1
  222. package/pinyin/src/simplified.js +1 -1
  223. package/pinyin/src/simplified_dict.js +1 -1
  224. package/pinyin/src/traditional.js +1 -1
  225. package/pinyin/src/traditional_dict.js +1 -1
  226. package/pinyin/traditional.js +1 -1
  227. package/pinyin.js +1 -1
  228. package/query-string/base.js +1 -1
  229. package/query-string/index.js +1 -1
  230. package/query-string/splitOnFirst.js +1 -1
  231. package/queryString.js +1 -1
  232. package/random/address.js +1 -1
  233. package/random/constellation.js +1 -1
  234. package/random/image.js +1 -1
  235. package/random/index.js +1 -1
  236. package/random/licensePlate.js +1 -1
  237. package/random/name.js +1 -1
  238. package/random/number.js +1 -1
  239. package/random/text.js +12 -11
  240. package/random/time.js +1 -1
  241. package/random/web.js +1 -1
  242. package/random.js +1 -1
  243. package/screenfull/index.js +21 -20
  244. package/screenfull.js +4 -3
  245. package/sleep/index.js +1 -1
  246. package/sleep.js +1 -1
  247. package/snapdom/index.js +1 -1
  248. package/snapdom/src/api/preCache.js +51 -49
  249. package/snapdom/src/api/snapdom.js +171 -67
  250. package/snapdom/src/core/cache.js +2 -2
  251. package/snapdom/src/core/capture.js +249 -234
  252. package/snapdom/src/core/clone.js +151 -120
  253. package/snapdom/src/core/context.js +10 -8
  254. package/snapdom/src/core/plugins.js +69 -0
  255. package/snapdom/src/core/prepare.js +2 -2
  256. package/snapdom/src/exporters/download.js +1 -1
  257. package/snapdom/src/exporters/toBlob.js +1 -1
  258. package/snapdom/src/exporters/toCanvas.js +40 -40
  259. package/snapdom/src/exporters/toImg.js +1 -1
  260. package/snapdom/src/modules/CSSVar.js +66 -40
  261. package/snapdom/src/modules/background.js +39 -23
  262. package/snapdom/src/modules/changeCSS.js +1 -1
  263. package/snapdom/src/modules/counter.js +100 -86
  264. package/snapdom/src/modules/fonts.js +4 -4
  265. package/snapdom/src/modules/iconFonts.js +98 -14
  266. package/snapdom/src/modules/images.js +1 -1
  267. package/snapdom/src/modules/lineClamp.js +1 -1
  268. package/snapdom/src/modules/pseudo.js +147 -138
  269. package/snapdom/src/modules/rasterize.js +1 -1
  270. package/snapdom/src/modules/snapFetch.js +1 -1
  271. package/snapdom/src/modules/styles.js +1 -1
  272. package/snapdom/src/modules/svgDefs.js +86 -39
  273. package/snapdom/src/utils/browser.js +1 -1
  274. package/snapdom/src/utils/css.js +1 -1
  275. package/snapdom/src/utils/helpers.js +1 -1
  276. package/snapdom/src/utils/image.js +1 -1
  277. package/snapdom/types/snapdom.d.ts +253 -184
  278. package/snapdom.js +1 -1
  279. package/tinycolor/index.js +1 -1
  280. package/tinycolor/src/conversion.js +1 -1
  281. package/tinycolor/src/css-color-names.js +1 -1
  282. package/tinycolor/src/format-input.js +1 -1
  283. package/tinycolor/src/from-ratio.js +1 -1
  284. package/tinycolor/src/index.js +1 -1
  285. package/tinycolor/src/random.js +1 -1
  286. package/tinycolor/src/readability.js +1 -1
  287. package/tinycolor/src/to-ms-filter.js +1 -1
  288. package/tinycolor/src/utils.js +1 -1
  289. package/tinycolor.js +1 -1
  290. package/tree/index.js +31 -30
  291. package/tree/search/index.js +1 -1
  292. package/tree.js +13 -12
  293. package/tween/index.js +8 -0
  294. package/tween/src/easing.js +62 -0
  295. package/tween/src/tween.js +46 -0
  296. package/tween.js +8 -0
  297. package/types/axios/index.d.ts +19 -0
  298. package/types/axios/lib/adapters/adapters.d.ts +28 -0
  299. package/types/axios/lib/adapters/fetch.d.ts +3 -0
  300. package/types/axios/lib/adapters/http.d.ts +12 -0
  301. package/types/axios/lib/adapters/xhr.d.ts +2 -0
  302. package/types/axios/lib/axios.d.ts +3 -0
  303. package/types/axios/lib/cancel/CancelToken.d.ts +34 -0
  304. package/types/axios/lib/cancel/CanceledError.d.ts +24 -0
  305. package/types/axios/lib/cancel/isCancel.d.ts +1 -0
  306. package/types/axios/lib/core/Axios.d.ts +28 -0
  307. package/types/axios/lib/core/AxiosError.d.ts +38 -0
  308. package/types/axios/lib/core/AxiosHeaders.d.ts +23 -0
  309. package/types/axios/lib/core/InterceptorManager.d.ts +38 -0
  310. package/types/axios/lib/core/buildFullPath.d.ts +11 -0
  311. package/types/axios/lib/core/dispatchRequest.d.ts +8 -0
  312. package/types/axios/lib/core/mergeConfig.d.ts +10 -0
  313. package/types/axios/lib/core/settle.d.ts +10 -0
  314. package/types/axios/lib/core/transformData.d.ts +9 -0
  315. package/types/axios/lib/defaults/index.d.ts +30 -0
  316. package/types/axios/lib/defaults/transitional.d.ts +6 -0
  317. package/types/axios/lib/env/classes/FormData.d.ts +2 -0
  318. package/types/axios/lib/env/data.d.ts +1 -0
  319. package/types/axios/lib/helpers/AxiosTransformStream.d.ts +19 -0
  320. package/types/axios/lib/helpers/AxiosURLSearchParams.d.ts +30 -0
  321. package/types/axios/lib/helpers/HttpStatusCode.d.ts +72 -0
  322. package/types/axios/lib/helpers/ZlibHeaderTransformStream.d.ts +5 -0
  323. package/types/axios/lib/helpers/bind.d.ts +8 -0
  324. package/types/axios/lib/helpers/buildURL.d.ts +10 -0
  325. package/types/axios/lib/helpers/callbackify.d.ts +2 -0
  326. package/types/axios/lib/helpers/combineURLs.d.ts +9 -0
  327. package/types/axios/lib/helpers/composeSignals.d.ts +2 -0
  328. package/types/axios/lib/helpers/cookies.d.ts +6 -0
  329. package/types/axios/lib/helpers/deprecatedMethod.d.ts +11 -0
  330. package/types/axios/lib/helpers/estimateDataURLDecodedBytes.d.ts +10 -0
  331. package/types/axios/lib/helpers/formDataToJSON.d.ts +11 -0
  332. package/types/axios/lib/helpers/formDataToStream.d.ts +2 -0
  333. package/types/axios/lib/helpers/fromDataURI.d.ts +11 -0
  334. package/types/axios/lib/helpers/isAbsoluteURL.d.ts +8 -0
  335. package/types/axios/lib/helpers/isAxiosError.d.ts +8 -0
  336. package/types/axios/lib/helpers/isURLSameOrigin.d.ts +2 -0
  337. package/types/axios/lib/helpers/null.d.ts +2 -0
  338. package/types/axios/lib/helpers/parseHeaders.d.ts +2 -0
  339. package/types/axios/lib/helpers/parseProtocol.d.ts +1 -0
  340. package/types/axios/lib/helpers/progressEventReducer.d.ts +3 -0
  341. package/types/axios/lib/helpers/readBlob.d.ts +2 -0
  342. package/types/axios/lib/helpers/resolveConfig.d.ts +2 -0
  343. package/types/axios/lib/helpers/speedometer.d.ts +8 -0
  344. package/types/axios/lib/helpers/spread.d.ts +22 -0
  345. package/types/axios/lib/helpers/throttle.d.ts +8 -0
  346. package/types/axios/lib/helpers/toFormData.d.ts +26 -0
  347. package/types/axios/lib/helpers/toURLEncodedForm.d.ts +1 -0
  348. package/types/axios/lib/helpers/trackStream.d.ts +3 -0
  349. package/types/axios/lib/helpers/validator.d.ts +28 -0
  350. package/types/axios/lib/platform/browser/classes/Blob.d.ts +5 -0
  351. package/types/axios/lib/platform/browser/classes/FormData.d.ts +5 -0
  352. package/types/axios/lib/platform/browser/classes/URLSearchParams.d.ts +6 -0
  353. package/types/axios/lib/platform/browser/index.d.ts +13 -0
  354. package/types/axios/lib/platform/common/utils.d.ts +32 -0
  355. package/types/axios/lib/platform/index.d.ts +24 -0
  356. package/types/axios/lib/platform/node/classes/FormData.d.ts +1 -0
  357. package/types/axios/lib/platform/node/classes/URLSearchParams.d.ts +2 -0
  358. package/types/axios/lib/platform/node/index.d.ts +25 -0
  359. package/types/axios/lib/utils.d.ts +289 -0
  360. package/types/axios-mock-adapter/index.d.ts +19 -0
  361. package/types/axios-mock-adapter/request.d.ts +2 -0
  362. package/types/axios-mock-adapter/utils.d.ts +31 -0
  363. package/types/dom-helpers/types.d.ts +2 -0
  364. package/types/is/index.d.ts +16 -16
  365. package/types/normalize-wheel/index.d.ts +1 -1
  366. package/types/object-prototype-to-string-call/index.d.ts +2 -0
  367. package/types/snapdom/src/api/snapdom.d.ts +4 -0
  368. package/types/snapdom/src/core/capture.d.ts +4 -18
  369. package/types/snapdom/src/core/context.d.ts +5 -5
  370. package/types/snapdom/src/core/exporters.d.ts +33 -0
  371. package/types/snapdom/src/core/plugins.d.ts +59 -0
  372. package/types/snapdom/src/modules/CSSVar.d.ts +3 -7
  373. package/types/snapdom/src/modules/iconFonts.d.ts +34 -0
  374. package/types/snapdom/src/modules/svgDefs.d.ts +9 -15
  375. package/types/tween/index.d.ts +1 -0
  376. package/types/tween/src/easing.d.ts +22 -0
  377. package/types/tween/src/index.d.ts +3 -0
  378. package/types/tween/src/tween.d.ts +22 -0
  379. package/types/validate/index.d.ts +3 -0
  380. package/types/validate/src/index.d.ts +39 -0
  381. package/types/validate/src/interface.d.ts +53 -0
  382. package/types/validate/src/locale/en-US.d.ts +47 -0
  383. package/types/validate/src/locale/zh-CN.d.ts +47 -0
  384. package/types/validate/src/message.d.ts +2 -0
  385. package/types/validate/src/rules/array.d.ts +12 -0
  386. package/types/validate/src/rules/base.d.ts +25 -0
  387. package/types/validate/src/rules/boolean.d.ts +8 -0
  388. package/types/validate/src/rules/custom.d.ts +7 -0
  389. package/types/validate/src/rules/number.d.ts +12 -0
  390. package/types/validate/src/rules/object.d.ts +9 -0
  391. package/types/validate/src/rules/string.d.ts +12 -0
  392. package/types/validate/src/rules/type.d.ts +9 -0
  393. package/types/validate/src/utils.d.ts +3 -0
  394. package/ui-color/compareColorByRange.js +1 -1
  395. package/ui-color/index.js +1 -1
  396. package/uiColor.js +1 -1
  397. package/url-toolkit/index.js +1 -1
  398. package/url-toolkit/src/url-toolkit.js +1 -1
  399. package/urlToolkit.js +1 -1
  400. package/validate/index.js +28 -0
  401. package/validate/src/index.js +106 -0
  402. package/validate/src/locale/en-US.js +50 -0
  403. package/validate/src/locale/zh-CN.js +50 -0
  404. package/validate/src/message.js +5 -0
  405. package/validate/src/rules/array.js +73 -0
  406. package/validate/src/rules/base.js +69 -0
  407. package/validate/src/rules/boolean.js +29 -0
  408. package/validate/src/rules/custom.js +26 -0
  409. package/validate/src/rules/number.js +54 -0
  410. package/validate/src/rules/object.js +39 -0
  411. package/validate/src/rules/string.js +54 -0
  412. package/validate/src/rules/type.js +35 -0
  413. package/validate/src/utils.js +8 -0
  414. package/validate.js +28 -0
  415. package/version/index.js +1 -1
  416. package/version.js +1 -1
@@ -1,15 +1,17 @@
1
- /* 2025-10-28 09:57:10 */
2
- import { inlineBackgroundImages as Ft } from "../modules/background.js";
3
- import { collectUsedFontVariants as $t, collectUsedCodepoints as Pt, ensureFontsReady as Tt, embedCustomFonts as At } from "../modules/fonts.js";
4
- import { inlineImages as Bt } from "../modules/images.js";
5
- import { lineClamp as Xt } from "../modules/lineClamp.js";
6
- import { idle as U, isSafari as G } from "../utils/browser.js";
7
- import { collectUsedTagNames as Ot, generateDedupedBaseCSS as Yt } from "../utils/css.js";
8
- import { applyCachePolicy as Wt, cache as et } from "./cache.js";
9
- import { prepareClone as Ht } from "./prepare.js";
10
- function Nt(e, t) {
11
- if (!e || !t || !t.style) return;
12
- const a = getComputedStyle(e);
1
+ /* 2025-11-04 10:32:44 */
2
+ import { applyCachePolicy as St, cache as Z } from "./cache.js";
3
+ import { inlineBackgroundImages as vt } from "../modules/background.js";
4
+ import { collectUsedFontVariants as Ct, collectUsedCodepoints as Ft, ensureFontsReady as $t, embedCustomFonts as Tt } from "../modules/fonts.js";
5
+ import { ligatureIconToImage as Pt } from "../modules/iconFonts.js";
6
+ import { inlineImages as At } from "../modules/images.js";
7
+ import { lineClamp as Bt } from "../modules/lineClamp.js";
8
+ import { idle as D, isSafari as q } from "../utils/browser.js";
9
+ import { collectUsedTagNames as Xt, generateDedupedBaseCSS as Ot } from "../utils/css.js";
10
+ import { runHook as E } from "./plugins.js";
11
+ import { prepareClone as Yt } from "./prepare.js";
12
+ function Ht(n, t) {
13
+ if (!n || !t || !t.style) return;
14
+ const o = getComputedStyle(n);
13
15
  try {
14
16
  t.style.boxShadow = "none";
15
17
  } catch {
@@ -22,163 +24,176 @@ function Nt(e, t) {
22
24
  t.style.outline = "none";
23
25
  } catch {
24
26
  }
25
- const c = (a.filter || "").replace(/\bblur\([^()]*\)\s*/gi, "").replace(/\bdrop-shadow\([^()]*\)\s*/gi, "").trim().replace(/\s+/g, " ");
27
+ const m = (o.filter || "").replace(/\bblur\([^()]*\)\s*/gi, "").replace(/\bdrop-shadow\([^()]*\)\s*/gi, "").trim().replace(/\s+/g, " ");
26
28
  try {
27
- t.style.filter = c.length ? c : "none";
29
+ t.style.filter = m.length ? m : "none";
28
30
  } catch {
29
31
  }
30
32
  }
31
- async function oe(e, t) {
32
- if (!e) throw new Error("Element cannot be null or undefined");
33
- Wt(t.cache);
34
- const a = t.fast, r = !!t.straighten, c = !!t.noShadows;
35
- let n, o, i, s = "", l = "", x, h, d = null;
36
- const f = Xt(e);
33
+ async function re(n, t) {
34
+ if (!n) throw new Error("Element cannot be null or undefined");
35
+ St(t.cache);
36
+ const o = t.fast, i = t.outerTransforms !== !1, m = !!t.outerShadows;
37
+ let e = { element: n, options: t, plugins: t.plugins }, r, l, s, c = "", f = "", h, b, u = null;
38
+ await E("beforeSnap", e), await E("beforeClone", e);
39
+ const g = Bt(e.element);
37
40
  try {
38
- ({ clone: n, classCSS: o, styleCache: i } = await Ht(e, t)), r && n && (d = It(e, n)), c && n && Nt(e, n);
41
+ ({ clone: r, classCSS: l, styleCache: s } = await Yt(
42
+ e.element,
43
+ e.options
44
+ )), !i && r && (u = It(e.element, r)), !m && r && Ht(e.element, r);
39
45
  } finally {
40
- f();
46
+ g();
41
47
  }
42
- await new Promise((m) => {
43
- U(
48
+ e = { clone: r, classCSS: l, styleCache: s, ...e }, await E("afterClone", e);
49
+ try {
50
+ await Pt(e.clone, e.element);
51
+ } catch {
52
+ }
53
+ await new Promise((d) => {
54
+ D(
44
55
  async () => {
45
- await Bt(n, t), m();
56
+ await At(e.clone, e.options), d();
46
57
  },
47
- { fast: a }
58
+ { fast: o }
48
59
  );
49
- }), await new Promise((m) => {
50
- U(
60
+ }), await new Promise((d) => {
61
+ D(
51
62
  async () => {
52
- await Ft(e, n, i, t), m();
63
+ await vt(
64
+ e.element,
65
+ e.clone,
66
+ e.styleCache,
67
+ e.options
68
+ ), d();
53
69
  },
54
- { fast: a }
70
+ { fast: o }
55
71
  );
56
- }), t.embedFonts && await new Promise((m) => {
57
- U(
72
+ }), t.embedFonts && await new Promise((d) => {
73
+ D(
58
74
  async () => {
59
- const u = $t(e), S = Pt(e);
60
- if (G()) {
61
- const v = new Set(
62
- Array.from(u).map((p) => String(p).split("__")[0]).filter(Boolean)
75
+ const p = Ct(e.element), v = Ft(e.element);
76
+ if (q()) {
77
+ const y = new Set(
78
+ Array.from(p).map((x) => String(x).split("__")[0]).filter(Boolean)
63
79
  );
64
- await Tt(v, 1);
80
+ await $t(y, 1);
65
81
  }
66
- s = await At({
67
- required: u,
68
- usedCodepoints: S,
69
- exclude: t.excludeFonts,
70
- useProxy: t.useProxy
71
- }), m();
82
+ c = await Tt({
83
+ required: p,
84
+ usedCodepoints: v,
85
+ exclude: e.options.excludeFonts,
86
+ useProxy: e.options.useProxy
87
+ }), d();
72
88
  },
73
- { fast: a }
89
+ { fast: o }
74
90
  );
75
91
  });
76
- const y = Ot(n).sort(), b = y.join(",");
77
- et.baseStyle.has(b) ? l = et.baseStyle.get(b) : await new Promise((m) => {
78
- U(
92
+ const w = Xt(e.clone).sort(), M = w.join(",");
93
+ Z.baseStyle.has(M) ? f = Z.baseStyle.get(M) : await new Promise((d) => {
94
+ D(
79
95
  () => {
80
- l = Yt(y), et.baseStyle.set(b, l), m();
96
+ f = Ot(w), Z.baseStyle.set(M, f), d();
81
97
  },
82
- { fast: a }
98
+ { fast: o }
83
99
  );
84
- }), await new Promise((m) => {
85
- U(
100
+ }), e = { fontsCSS: c, baseCSS: f, ...e }, await E("beforeRender", e), await new Promise((d) => {
101
+ D(
86
102
  () => {
87
- const u = getComputedStyle(e);
88
- function S(C) {
89
- const w = `${C.filter || ""} ${C.webkitFilter || ""}`.trim();
90
- if (!w || w === "none")
91
- return {
92
- bleed: { top: 0, right: 0, bottom: 0, left: 0 },
93
- has: !1
94
- };
95
- const P = w.match(/drop-shadow\((?:[^()]|\([^()]*\))*\)/gi) || [];
96
- let B = 0, I = 0, D = 0, E = 0, X = !1;
97
- for (const vt of P) {
98
- X = !0;
99
- const St = vt.match(/-?\d+(?:\.\d+)?px/gi)?.map((Ct) => parseFloat(Ct)) || [], [R = 0, tt = 0, ut = 0] = St, mt = Math.abs(R) + ut, ft = Math.abs(tt) + ut;
100
- I = Math.max(I, mt + Math.max(R, 0)), E = Math.max(E, mt + Math.max(-R, 0)), D = Math.max(D, ft + Math.max(tt, 0)), B = Math.max(B, ft + Math.max(-tt, 0));
101
- }
102
- return {
103
- bleed: {
104
- top: Math.ceil(B),
105
- right: Math.ceil(I),
106
- bottom: Math.ceil(D),
107
- left: Math.ceil(E)
108
- },
109
- has: X
110
- };
111
- }
112
- const v = e.getBoundingClientRect(), p = Math.max(
103
+ const p = getComputedStyle(e.element), v = e.element.getBoundingClientRect(), y = Math.max(
113
104
  1,
114
- Math.ceil(
115
- e.offsetWidth || parseFloat(u.width) || v.width || 1
105
+ a(
106
+ e.element.offsetWidth || parseFloat(p.width) || v.width || 1
116
107
  )
117
- ), g = Math.max(
108
+ ), x = Math.max(
118
109
  1,
119
- Math.ceil(
120
- e.offsetHeight || parseFloat(u.height) || v.height || 1
110
+ a(
111
+ e.element.offsetHeight || parseFloat(p.height) || v.height || 1
121
112
  )
122
- ), nt = (C, w = NaN) => {
123
- const P = typeof C == "string" ? parseFloat(C) : C;
124
- return Number.isFinite(P) ? P : w;
125
- }, V = nt(t.width), J = nt(t.height);
126
- let T = p, A = g;
127
- const Y = Number.isFinite(V), W = Number.isFinite(J), st = g > 0 ? p / g : 1;
128
- Y && W ? (T = Math.max(1, Math.ceil(V)), A = Math.max(1, Math.ceil(J))) : Y ? (T = Math.max(1, Math.ceil(V)), A = Math.max(1, Math.ceil(T / (st || 1)))) : W ? (A = Math.max(1, Math.ceil(J)), T = Math.max(1, Math.ceil(A * (st || 1)))) : (T = p, A = g);
129
- let H = 0, N = 0, j = p, k = g;
130
- if (r && d && Number.isFinite(d.a)) {
131
- const C = {
132
- a: d.a,
133
- b: d.b || 0,
134
- c: d.c || 0,
135
- d: d.d || 1,
113
+ ), tt = (O, $ = NaN) => {
114
+ const Y = typeof O == "string" ? parseFloat(O) : O;
115
+ return Number.isFinite(Y) ? Y : $;
116
+ }, K = tt(e.options.width), G = tt(e.options.height);
117
+ let T = y, P = x;
118
+ const H = Number.isFinite(K), W = Number.isFinite(G), et = x > 0 ? y / x : 1;
119
+ H && W ? (T = Math.max(1, a(K)), P = Math.max(1, a(G))) : H ? (T = Math.max(1, a(K)), P = Math.max(1, a(T / (et || 1)))) : W ? (P = Math.max(1, a(G)), T = Math.max(1, a(P * (et || 1)))) : (T = y, P = x);
120
+ let A = 0, B = 0, I = y, N = x;
121
+ if (!i && u && Number.isFinite(u.a)) {
122
+ const O = {
123
+ a: u.a,
124
+ b: u.b || 0,
125
+ c: u.c || 0,
126
+ d: u.d || 1,
136
127
  e: 0,
137
128
  f: 0
138
- }, w = ht(p, g, C, 0, 0);
139
- H = w.minX, N = w.minY, j = w.maxX, k = w.maxY;
140
- } else if (!r && jt(e)) {
141
- const w = u.transform && u.transform !== "none" ? u.transform : "", P = kt(e), B = qt({
142
- baseTransform: w,
143
- rotate: P.rotate || "0deg",
144
- scale: P.scale,
145
- translate: P.translate
146
- }), { ox: I, oy: D } = Lt(u, p, g), E = B.is2D ? B : new DOMMatrix(B.toString()), X = ht(p, g, E, I, D);
147
- H = X.minX, N = X.minY, j = X.maxX, k = X.maxY;
129
+ }, $ = it(y, x, O, 0, 0);
130
+ A = a($.minX), B = a($.minY), I = a($.maxX), N = a($.maxY);
131
+ } else if (i && Ut(e.element)) {
132
+ const $ = p.transform && p.transform !== "none" ? p.transform : "", Y = kt(e.element), Q = _t({
133
+ baseTransform: $,
134
+ rotate: Y.rotate || "0deg",
135
+ scale: Y.scale,
136
+ translate: Y.translate
137
+ }), { ox: bt, oy: wt } = jt(p, y, x), Mt = Q.is2D ? Q : new DOMMatrix(Q.toString()), _ = it(y, x, Mt, bt, wt);
138
+ A = a(_.minX), B = a(_.minY), I = a(_.maxX), N = a(_.maxY);
148
139
  }
149
- const z = Dt(u), L = Et(u), _ = Ut(u), q = S(u), K = c ? { top: 0, right: 0, bottom: 0, left: 0 } : {
150
- top: z.top + L.top + _.top + q.bleed.top,
151
- right: z.right + L.right + _.right + q.bleed.right,
152
- bottom: z.bottom + L.bottom + _.bottom + q.bleed.bottom,
153
- left: z.left + L.left + _.left + q.bleed.left
154
- };
155
- H -= K.left, N -= K.top, j += K.right, k += K.bottom;
156
- const rt = Math.max(1, Math.ceil(j - H)), ot = Math.max(1, Math.ceil(k - N)), pt = Math.max(
157
- 1,
158
- Math.round(rt * (Y || W ? T / p : 1))
159
- ), xt = Math.max(
160
- 1,
161
- Math.round(ot * (W || Y ? A / g : 1))
162
- ), it = "http://www.w3.org/2000/svg", F = (G() ? 1 : 0) + (r ? 1 : 0), $ = document.createElementNS(it, "foreignObject"), gt = Math.floor(H), yt = Math.floor(N);
163
- $.setAttribute("x", String(-(gt - F))), $.setAttribute("y", String(-(yt - F))), $.setAttribute("width", String(Math.ceil(p + F * 2))), $.setAttribute("height", String(Math.ceil(g + F * 2))), $.style.overflow = "visible";
164
- const lt = document.createElement("style");
165
- lt.textContent = l + s + "svg{overflow:visible;} foreignObject{overflow:visible;}" + o, $.appendChild(lt);
166
- const O = document.createElement("div");
167
- O.setAttribute("xmlns", "http://www.w3.org/1999/xhtml"), O.style.width = `${p}px`, O.style.height = `${g}px`, O.style.overflow = "visible", n.setAttribute("xmlns", "http://www.w3.org/1999/xhtml"), O.appendChild(n), $.appendChild(O);
168
- const bt = new XMLSerializer().serializeToString($), Q = rt + F * 2, Z = ot + F * 2, ct = Y || W;
169
- t.meta = { w0: p, h0: g, vbW: Q, vbH: Z, targetW: T, targetH: A };
170
- const Mt = G() && ct ? Q : pt + F * 2, wt = G() && ct ? Z : xt + F * 2;
171
- h = `<svg xmlns="${it}" width="${Mt}" height="${wt}" viewBox="0 0 ${Q} ${Z}">` + bt + "</svg>", x = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(h)}`, m();
140
+ const U = Nt(p), k = Dt(p), L = Et(p), j = Wt(p), z = m ? {
141
+ top: a(
142
+ U.top + k.top + L.top + j.bleed.top
143
+ ),
144
+ right: a(
145
+ U.right + k.right + L.right + j.bleed.right
146
+ ),
147
+ bottom: a(
148
+ U.bottom + k.bottom + L.bottom + j.bleed.bottom
149
+ ),
150
+ left: a(
151
+ U.left + k.left + L.left + j.bleed.left
152
+ )
153
+ } : { top: 0, right: 0, bottom: 0, left: 0 };
154
+ A = a(A - z.left), B = a(B - z.top), I = a(I + z.right), N = a(N + z.bottom);
155
+ const nt = Math.max(1, a(I - A)), at = Math.max(1, a(N - B)), ct = H || W ? a(T / y) : 1, mt = W || H ? a(P / x) : 1, ut = Math.max(1, a(nt * ct)), ft = Math.max(1, a(at * mt)), ot = "http://www.w3.org/2000/svg", ht = q() ? 1 : 0, C = a(ht + (i ? 0 : 1)), F = document.createElementNS(ot, "foreignObject"), dt = a(A), pt = a(B);
156
+ F.setAttribute("x", String(a(-(dt - C)))), F.setAttribute("y", String(a(-(pt - C)))), F.setAttribute("width", String(a(y + C * 2))), F.setAttribute("height", String(a(x + C * 2))), F.style.overflow = "visible";
157
+ const st = document.createElement("style");
158
+ st.textContent = e.baseCSS + e.fontsCSS + "svg{overflow:visible;} foreignObject{overflow:visible;}" + e.classCSS, F.appendChild(st);
159
+ const X = document.createElement("div");
160
+ X.setAttribute("xmlns", "http://www.w3.org/1999/xhtml"), X.style.width = `${a(y)}px`, X.style.height = `${a(x)}px`, X.style.overflow = "visible", e.clone.setAttribute("xmlns", "http://www.w3.org/1999/xhtml"), X.appendChild(e.clone), F.appendChild(X);
161
+ const xt = new XMLSerializer().serializeToString(F), V = a(nt + C * 2), J = a(at + C * 2), rt = H || W;
162
+ t.meta = { w0: y, h0: x, vbW: V, vbH: J, targetW: T, targetH: P };
163
+ const gt = q() && rt ? V : a(ut + C * 2), yt = q() && rt ? J : a(ft + C * 2);
164
+ b = `<svg xmlns="${ot}" width="${gt}" height="${yt}" viewBox="0 0 ${V} ${J}">` + xt + "</svg>", h = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(b)}`, e = { svgString: b, dataURL: h, ...e }, d();
172
165
  },
173
- { fast: a }
166
+ { fast: o }
174
167
  );
175
- });
176
- const M = document.getElementById("snapdom-sandbox");
177
- return M && M.style.position === "absolute" && M.remove(), x;
168
+ }), await E("afterRender", e);
169
+ const S = document.getElementById("snapdom-sandbox");
170
+ return S && S.style.position === "absolute" && S.remove(), e.dataURL;
171
+ }
172
+ const a = (n, t = 3) => Number.isFinite(n) ? Math.round(n * 10 ** t) / 10 ** t : n;
173
+ function Wt(n) {
174
+ const t = `${n.filter || ""} ${n.webkitFilter || ""}`.trim();
175
+ if (!t || t === "none")
176
+ return { bleed: { top: 0, right: 0, bottom: 0, left: 0 }, has: !1 };
177
+ const o = t.match(/drop-shadow\((?:[^()]|\([^()]*\))*\)/gi) || [];
178
+ let i = 0, m = 0, e = 0, r = 0, l = !1;
179
+ for (const s of o) {
180
+ l = !0;
181
+ const c = s.match(/-?\d+(?:\.\d+)?px/gi)?.map((w) => parseFloat(w)) || [], [f = 0, h = 0, b = 0] = c, u = Math.abs(f) + b, g = Math.abs(h) + b;
182
+ m = Math.max(m, u + Math.max(f, 0)), r = Math.max(r, u + Math.max(-f, 0)), e = Math.max(e, g + Math.max(h, 0)), i = Math.max(i, g + Math.max(-h, 0));
183
+ }
184
+ return {
185
+ bleed: {
186
+ top: a(i),
187
+ right: a(m),
188
+ bottom: a(e),
189
+ left: a(r)
190
+ },
191
+ has: l
192
+ };
178
193
  }
179
- function It(e, t) {
180
- if (!e || !t || !t.style) return null;
181
- const a = getComputedStyle(e);
194
+ function It(n, t) {
195
+ if (!n || !t || !t.style) return null;
196
+ const o = getComputedStyle(n);
182
197
  try {
183
198
  t.style.transformOrigin = "0 0";
184
199
  } catch {
@@ -187,88 +202,88 @@ function It(e, t) {
187
202
  "translate" in t.style && (t.style.translate = "none"), "rotate" in t.style && (t.style.rotate = "none");
188
203
  } catch {
189
204
  }
190
- const r = a.transform || "none";
191
- if (r === "none")
205
+ const i = o.transform || "none";
206
+ if (i === "none")
192
207
  try {
193
- const n = dt(e);
194
- if (n.a === 1 && n.b === 0 && n.c === 0 && n.d === 1)
208
+ const e = lt(n);
209
+ if (e.a === 1 && e.b === 0 && e.c === 0 && e.d === 1)
195
210
  return t.style.transform = "none", { a: 1, b: 0, c: 0, d: 1 };
196
211
  } catch {
197
212
  }
198
- const c = r.match(/^matrix\(\s*([^)]+)\)$/i);
199
- if (c) {
200
- const n = c[1].split(",").map((o) => parseFloat(o.trim()));
201
- if (n.length === 6 && n.every(Number.isFinite)) {
202
- const [o, i, s, l] = n, x = Math.sqrt(o * o + i * i) || 0;
203
- let h = 0, d = 0, f = 0, y = 0, b = 0, M = 0;
204
- x > 0 && (h = o / x, d = i / x, f = h * s + d * l, y = s - h * f, b = l - d * f, M = Math.sqrt(y * y + b * b) || 0, M > 0 ? f = f / M : f = 0);
205
- const m = x, u = 0, S = f * M, v = M;
213
+ const m = i.match(/^matrix\(\s*([^)]+)\)$/i);
214
+ if (m) {
215
+ const e = m[1].split(",").map((r) => parseFloat(r.trim()));
216
+ if (e.length === 6 && e.every(Number.isFinite)) {
217
+ const [r, l, s, c] = e, f = Math.sqrt(r * r + l * l) || 0;
218
+ let h = 0, b = 0, u = 0, g = 0, w = 0, M = 0;
219
+ f > 0 && (h = r / f, b = l / f, u = h * s + b * c, g = s - h * u, w = c - b * u, M = Math.sqrt(g * g + w * w) || 0, M > 0 ? u = u / M : u = 0);
220
+ const S = f, d = 0, p = u * M, v = M;
206
221
  try {
207
- t.style.transform = `matrix(${m}, ${u}, ${S}, ${v}, 0, 0)`;
222
+ t.style.transform = `matrix(${S}, ${d}, ${p}, ${v}, 0, 0)`;
208
223
  } catch {
209
224
  }
210
- return { a: m, b: u, c: S, d: v };
225
+ return { a: S, b: d, c: p, d: v };
211
226
  }
212
227
  }
213
228
  try {
214
- const n = String(r).trim();
215
- return t.style.transform = n + " translate(0px, 0px) rotate(0deg)", null;
229
+ const e = String(i).trim();
230
+ return t.style.transform = e + " translate(0px, 0px) rotate(0deg)", null;
216
231
  } catch {
217
232
  return null;
218
233
  }
219
234
  }
220
- function Dt(e) {
221
- const t = e.boxShadow || "";
235
+ function Nt(n) {
236
+ const t = n.boxShadow || "";
222
237
  if (!t || t === "none") return { top: 0, right: 0, bottom: 0, left: 0 };
223
- const a = t.split(/\),(?=(?:[^()]*\([^()]*\))*[^()]*$)/).map((i) => i.trim());
224
- let r = 0, c = 0, n = 0, o = 0;
225
- for (const i of a) {
226
- const s = i.match(/-?\d+(\.\d+)?px/g)?.map((b) => parseFloat(b)) || [];
238
+ const o = t.split(/\),(?=(?:[^()]*\([^()]*\))*[^()]*$)/).map((l) => l.trim());
239
+ let i = 0, m = 0, e = 0, r = 0;
240
+ for (const l of o) {
241
+ const s = l.match(/-?\d+(\.\d+)?px/g)?.map((w) => parseFloat(w)) || [];
227
242
  if (s.length < 2) continue;
228
- const [l, x, h = 0, d = 0] = s, f = Math.abs(l) + h + d, y = Math.abs(x) + h + d;
229
- c = Math.max(c, f + Math.max(l, 0)), o = Math.max(o, f + Math.max(-l, 0)), n = Math.max(n, y + Math.max(x, 0)), r = Math.max(r, y + Math.max(-x, 0));
243
+ const [c, f, h = 0, b = 0] = s, u = Math.abs(c) + h + b, g = Math.abs(f) + h + b;
244
+ m = Math.max(m, u + Math.max(c, 0)), r = Math.max(r, u + Math.max(-c, 0)), e = Math.max(e, g + Math.max(f, 0)), i = Math.max(i, g + Math.max(-f, 0));
230
245
  }
231
246
  return {
232
- top: Math.ceil(r),
233
- right: Math.ceil(c),
234
- bottom: Math.ceil(n),
235
- left: Math.ceil(o)
247
+ top: Math.ceil(i),
248
+ right: Math.ceil(m),
249
+ bottom: Math.ceil(e),
250
+ left: Math.ceil(r)
236
251
  };
237
252
  }
238
- function Et(e) {
239
- const t = (e.filter || "").match(/blur\(\s*([0-9.]+)px\s*\)/), a = t ? Math.ceil(parseFloat(t[1]) || 0) : 0;
240
- return { top: a, right: a, bottom: a, left: a };
253
+ function Dt(n) {
254
+ const t = (n.filter || "").match(/blur\(\s*([0-9.]+)px\s*\)/), o = t ? Math.ceil(parseFloat(t[1]) || 0) : 0;
255
+ return { top: o, right: o, bottom: o, left: o };
241
256
  }
242
- function Ut(e) {
243
- if ((e.outlineStyle || "none") === "none")
257
+ function Et(n) {
258
+ if ((n.outlineStyle || "none") === "none")
244
259
  return { top: 0, right: 0, bottom: 0, left: 0 };
245
- const t = Math.ceil(parseFloat(e.outlineWidth || "0") || 0);
260
+ const t = Math.ceil(parseFloat(n.outlineWidth || "0") || 0);
246
261
  return { top: t, right: t, bottom: t, left: t };
247
262
  }
248
- function ht(e, t, a, r, c) {
249
- const n = a.a, o = a.b, i = a.c, s = a.d, l = a.e || 0, x = a.f || 0;
250
- function h(m, u) {
251
- let S = m - r, v = u - c, p = n * S + i * v, g = o * S + s * v;
252
- return p += r + l, g += c + x, [p, g];
263
+ function it(n, t, o, i, m) {
264
+ const e = o.a, r = o.b, l = o.c, s = o.d, c = o.e || 0, f = o.f || 0;
265
+ function h(S, d) {
266
+ let p = S - i, v = d - m, y = e * p + l * v, x = r * p + s * v;
267
+ return y += i + c, x += m + f, [y, x];
253
268
  }
254
- const d = [h(0, 0), h(e, 0), h(0, t), h(e, t)];
255
- let f = 1 / 0, y = 1 / 0, b = -1 / 0, M = -1 / 0;
256
- for (const [m, u] of d)
257
- m < f && (f = m), u < y && (y = u), m > b && (b = m), u > M && (M = u);
269
+ const b = [h(0, 0), h(n, 0), h(0, t), h(n, t)];
270
+ let u = 1 / 0, g = 1 / 0, w = -1 / 0, M = -1 / 0;
271
+ for (const [S, d] of b)
272
+ S < u && (u = S), d < g && (g = d), S > w && (w = S), d > M && (M = d);
258
273
  return {
259
- minX: f,
260
- minY: y,
261
- maxX: b,
274
+ minX: u,
275
+ minY: g,
276
+ maxX: w,
262
277
  maxY: M,
263
- width: b - f,
264
- height: M - y
278
+ width: w - u,
279
+ height: M - g
265
280
  };
266
281
  }
267
- function jt(e) {
268
- return zt(e);
282
+ function Ut(n) {
283
+ return Lt(n);
269
284
  }
270
- function dt(e) {
271
- const t = getComputedStyle(e).transform;
285
+ function lt(n) {
286
+ const t = getComputedStyle(n).transform;
272
287
  if (!t || t === "none") return new DOMMatrix();
273
288
  try {
274
289
  return new DOMMatrix(t);
@@ -276,67 +291,67 @@ function dt(e) {
276
291
  return new WebKitCSSMatrix(t);
277
292
  }
278
293
  }
279
- function kt(e) {
280
- const t = { rotate: "0deg", scale: null, translate: null }, a = typeof e.computedStyleMap == "function" ? e.computedStyleMap() : null;
281
- if (a) {
282
- const c = (s) => {
294
+ function kt(n) {
295
+ const t = { rotate: "0deg", scale: null, translate: null }, o = typeof n.computedStyleMap == "function" ? n.computedStyleMap() : null;
296
+ if (o) {
297
+ const m = (s) => {
283
298
  try {
284
- return typeof a.has == "function" && !a.has(s) || typeof a.get != "function" ? null : a.get(s);
299
+ return typeof o.has == "function" && !o.has(s) || typeof o.get != "function" ? null : o.get(s);
285
300
  } catch {
286
301
  return null;
287
302
  }
288
- }, n = c("rotate");
289
- if (n)
290
- if (n.angle) {
291
- const s = n.angle;
303
+ }, e = m("rotate");
304
+ if (e)
305
+ if (e.angle) {
306
+ const s = e.angle;
292
307
  t.rotate = s.unit === "rad" ? s.value * 180 / Math.PI + "deg" : s.value + s.unit;
293
- } else n.unit ? t.rotate = n.unit === "rad" ? n.value * 180 / Math.PI + "deg" : n.value + n.unit : t.rotate = String(n);
308
+ } else e.unit ? t.rotate = e.unit === "rad" ? e.value * 180 / Math.PI + "deg" : e.value + e.unit : t.rotate = String(e);
294
309
  else {
295
- const s = getComputedStyle(e);
310
+ const s = getComputedStyle(n);
296
311
  t.rotate = s.rotate && s.rotate !== "none" ? s.rotate : "0deg";
297
312
  }
298
- const o = c("scale");
299
- if (o) {
300
- const s = "x" in o && o.x?.value != null ? o.x.value : Array.isArray(o) ? o[0]?.value : Number(o) || 1, l = "y" in o && o.y?.value != null ? o.y.value : Array.isArray(o) ? o[1]?.value : s;
301
- t.scale = `${s} ${l}`;
313
+ const r = m("scale");
314
+ if (r) {
315
+ const s = "x" in r && r.x?.value != null ? r.x.value : Array.isArray(r) ? r[0]?.value : Number(r) || 1, c = "y" in r && r.y?.value != null ? r.y.value : Array.isArray(r) ? r[1]?.value : s;
316
+ t.scale = `${s} ${c}`;
302
317
  } else {
303
- const s = getComputedStyle(e);
318
+ const s = getComputedStyle(n);
304
319
  t.scale = s.scale && s.scale !== "none" ? s.scale : null;
305
320
  }
306
- const i = c("translate");
307
- if (i) {
308
- const s = "x" in i && "value" in i.x ? i.x.value : Array.isArray(i) ? i[0]?.value : 0, l = "y" in i && "value" in i.y ? i.y.value : Array.isArray(i) ? i[1]?.value : 0, x = "x" in i && i.x?.unit ? i.x.unit : "px", h = "y" in i && i.y?.unit ? i.y.unit : "px";
309
- t.translate = `${s}${x} ${l}${h}`;
321
+ const l = m("translate");
322
+ if (l) {
323
+ const s = "x" in l && "value" in l.x ? l.x.value : Array.isArray(l) ? l[0]?.value : 0, c = "y" in l && "value" in l.y ? l.y.value : Array.isArray(l) ? l[1]?.value : 0, f = "x" in l && l.x?.unit ? l.x.unit : "px", h = "y" in l && l.y?.unit ? l.y.unit : "px";
324
+ t.translate = `${s}${f} ${c}${h}`;
310
325
  } else {
311
- const s = getComputedStyle(e);
326
+ const s = getComputedStyle(n);
312
327
  t.translate = s.translate && s.translate !== "none" ? s.translate : null;
313
328
  }
314
329
  return t;
315
330
  }
316
- const r = getComputedStyle(e);
317
- return t.rotate = r.rotate && r.rotate !== "none" ? r.rotate : "0deg", t.scale = r.scale && r.scale !== "none" ? r.scale : null, t.translate = r.translate && r.translate !== "none" ? r.translate : null, t;
331
+ const i = getComputedStyle(n);
332
+ 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;
318
333
  }
319
- function zt(e) {
320
- const t = getComputedStyle(e), a = t.transform || "none";
321
- 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;
322
- const c = t.rotate && t.rotate !== "none" && t.rotate !== "0deg", n = t.scale && t.scale !== "none" && t.scale !== "1", o = t.translate && t.translate !== "none" && t.translate !== "0px 0px";
323
- return !!(c || n || o);
334
+ function Lt(n) {
335
+ const t = getComputedStyle(n), o = t.transform || "none";
336
+ if (o !== "none" && !/^matrix\(\s*1\s*,\s*0\s*,\s*0\s*,\s*1\s*,\s*0\s*,\s*0\s*\)$/i.test(o)) return !0;
337
+ const m = t.rotate && t.rotate !== "none" && t.rotate !== "0deg", e = t.scale && t.scale !== "none" && t.scale !== "1", r = t.translate && t.translate !== "none" && t.translate !== "0px 0px";
338
+ return !!(m || e || r);
324
339
  }
325
- function Lt(e, t, a) {
326
- const r = (e.transformOrigin || "0 0").trim().split(/\s+/), [c, n] = [r[0] || "0", r[1] || "0"], o = (i, s) => {
327
- const l = i.toLowerCase();
328
- return l === "left" || l === "top" ? 0 : l === "center" ? s / 2 : l === "right" || l === "bottom" ? s : l.endsWith("px") ? parseFloat(l) || 0 : l.endsWith("%") ? (parseFloat(l) || 0) * s / 100 : /^-?\d+(\.\d+)?$/.test(l) && parseFloat(l) || 0;
340
+ function jt(n, t, o) {
341
+ const i = (n.transformOrigin || "0 0").trim().split(/\s+/), [m, e] = [i[0] || "0", i[1] || "0"], r = (l, s) => {
342
+ const c = l.toLowerCase();
343
+ return c === "left" || c === "top" ? 0 : c === "center" ? s / 2 : c === "right" || c === "bottom" ? s : c.endsWith("px") ? parseFloat(c) || 0 : c.endsWith("%") ? (parseFloat(c) || 0) * s / 100 : /^-?\d+(\.\d+)?$/.test(c) && parseFloat(c) || 0;
329
344
  };
330
345
  return {
331
- ox: o(c, t),
332
- oy: o(n, a)
346
+ ox: r(m, t),
347
+ oy: r(e, o)
333
348
  };
334
349
  }
335
- var at = null;
336
- function _t() {
337
- if (at) return at;
338
- const e = document.createElement("div");
339
- return e.id = "snapdom-measure-slot", e.setAttribute("aria-hidden", "true"), Object.assign(e.style, {
350
+ var R = null;
351
+ function zt() {
352
+ if (R) return R;
353
+ const n = document.createElement("div");
354
+ return n.id = "snapdom-measure-slot", n.setAttribute("aria-hidden", "true"), Object.assign(n.style, {
340
355
  position: "absolute",
341
356
  left: "-99999px",
342
357
  top: "0px",
@@ -346,14 +361,14 @@ function _t() {
346
361
  opacity: "0",
347
362
  pointerEvents: "none",
348
363
  contain: "size layout style"
349
- }), document.documentElement.appendChild(e), at = e, e;
364
+ }), document.documentElement.appendChild(n), R = n, n;
350
365
  }
351
- function qt(e) {
352
- const t = _t(), a = document.createElement("div");
353
- 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);
354
- const r = dt(a);
355
- return t.removeChild(a), r;
366
+ function _t(n) {
367
+ const t = zt(), o = document.createElement("div");
368
+ o.style.transformOrigin = "0 0", n.baseTransform && (o.style.transform = n.baseTransform), n.rotate && (o.style.rotate = n.rotate), n.scale && (o.style.scale = n.scale), n.translate && (o.style.translate = n.translate), t.appendChild(o);
369
+ const i = lt(o);
370
+ return t.removeChild(o), i;
356
371
  }
357
372
  export {
358
- oe as captureDOM
373
+ re as captureDOM
359
374
  };