@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.
- package/axios/index.d.ts +791 -0
- package/axios/index.js +41 -0
- package/axios/lib/adapters/adapters.js +65 -0
- package/axios/lib/adapters/fetch.js +186 -0
- package/axios/lib/adapters/xhr.js +105 -0
- package/axios/lib/axios.js +47 -0
- package/axios/lib/cancel/CancelToken.js +78 -0
- package/axios/lib/cancel/CanceledError.js +18 -0
- package/axios/lib/cancel/isCancel.js +7 -0
- package/axios/lib/core/Axios.js +170 -0
- package/axios/lib/core/AxiosError.js +64 -0
- package/axios/lib/core/AxiosHeaders.js +192 -0
- package/axios/lib/core/InterceptorManager.js +59 -0
- package/axios/lib/core/buildFullPath.js +10 -0
- package/axios/lib/core/dispatchRequest.js +35 -0
- package/axios/lib/core/mergeConfig.js +74 -0
- package/axios/lib/core/settle.js +17 -0
- package/axios/lib/core/transformData.js +19 -0
- package/axios/lib/defaults/index.js +103 -0
- package/axios/lib/defaults/transitional.js +9 -0
- package/axios/lib/env/data.js +5 -0
- package/axios/lib/helpers/AxiosURLSearchParams.js +37 -0
- package/axios/lib/helpers/HttpStatusCode.js +78 -0
- package/axios/lib/helpers/bind.js +9 -0
- package/axios/lib/helpers/buildURL.js +24 -0
- package/axios/lib/helpers/combineURLs.js +7 -0
- package/axios/lib/helpers/composeSignals.js +38 -0
- package/axios/lib/helpers/cookies.js +37 -0
- package/axios/lib/helpers/formDataToJSON.js +32 -0
- package/axios/lib/helpers/isAbsoluteURL.js +7 -0
- package/axios/lib/helpers/isAxiosError.js +8 -0
- package/axios/lib/helpers/isURLSameOrigin.js +9 -0
- package/axios/lib/helpers/parseHeaders.js +31 -0
- package/axios/lib/helpers/parseProtocol.js +8 -0
- package/axios/lib/helpers/progressEventReducer.js +39 -0
- package/axios/lib/helpers/resolveConfig.js +44 -0
- package/axios/lib/helpers/speedometer.js +20 -0
- package/axios/lib/helpers/spread.js +9 -0
- package/axios/lib/helpers/throttle.js +16 -0
- package/axios/lib/helpers/toFormData.js +91 -0
- package/axios/lib/helpers/toURLEncodedForm.js +15 -0
- package/axios/lib/helpers/trackStream.js +67 -0
- package/axios/lib/helpers/validator.js +66 -0
- package/axios/lib/platform/browser/classes/Blob.js +5 -0
- package/axios/lib/platform/browser/classes/FormData.js +5 -0
- package/axios/lib/platform/browser/classes/URLSearchParams.js +6 -0
- package/axios/lib/platform/browser/index.js +16 -0
- package/axios/lib/platform/common/utils.js +9 -0
- package/axios/lib/platform/index.js +10 -0
- package/axios/lib/utils.js +248 -0
- package/axios-mock-adapter/index.d.ts +59 -0
- package/axios-mock-adapter/index.js +206 -0
- package/axios-mock-adapter/request.js +51 -0
- package/axios-mock-adapter/utils.js +129 -0
- package/axios.js +24 -0
- package/axiosMockAdapter.js +9 -0
- package/case-name/index.js +1 -1
- package/caseName.js +1 -1
- package/class-name/index.js +1 -1
- package/className.js +1 -1
- package/clipboard-copy/index.js +1 -1
- package/clipboardCopy.js +1 -1
- package/constant/address.js +1 -1
- package/constant/chineseCharacters.js +1 -1
- package/constant/constellations.js +1 -1
- package/constant/domain.js +1 -1
- package/constant/emoji.js +1 -1
- package/constant/identity.js +1 -1
- package/constant/index.js +1 -1
- package/constant/keyboardCode.js +1 -1
- package/constant/licensePlate.js +1 -1
- package/constant/name.js +1 -1
- package/constant/platform.js +1 -1
- package/constant/protocol.js +1 -1
- package/constant/ui.js +1 -1
- package/constant.js +1 -1
- package/content-disposition/index.js +1 -1
- package/contentDisposition.js +1 -1
- package/cookie/index.js +1 -1
- package/cookie/src/index.js +1 -1
- package/cookie.js +1 -1
- package/date/convertTime.js +1 -1
- package/date/convertToDuration.js +1 -1
- package/date/index.js +1 -1
- package/date.js +1 -1
- package/decimal/decimal.js +22 -22
- package/decimal/index.js +1 -1
- package/decimal.js +1 -1
- package/dom-helpers/activeElement.js +1 -1
- package/dom-helpers/addClass.js +1 -1
- package/dom-helpers/addEventListener.js +1 -1
- package/dom-helpers/animate.js +1 -1
- package/dom-helpers/animationFrame.js +1 -1
- package/dom-helpers/attribute.js +1 -1
- package/dom-helpers/camelize.js +1 -1
- package/dom-helpers/camelizeStyle.js +1 -1
- package/dom-helpers/canUseDOM.js +1 -1
- package/dom-helpers/childElements.js +1 -1
- package/dom-helpers/childNodes.js +1 -1
- package/dom-helpers/clear.js +1 -1
- package/dom-helpers/closest.js +1 -1
- package/dom-helpers/collectElements.js +1 -1
- package/dom-helpers/collectSiblings.js +1 -1
- package/dom-helpers/contains.js +1 -1
- package/dom-helpers/css.js +1 -1
- package/dom-helpers/filterEventHandler.js +1 -1
- package/dom-helpers/getComputedStyle.js +1 -1
- package/dom-helpers/getScrollAccessor.js +1 -1
- package/dom-helpers/hasClass.js +1 -1
- package/dom-helpers/height.js +1 -1
- package/dom-helpers/hyphenate.js +1 -1
- package/dom-helpers/hyphenateStyle.js +1 -1
- package/dom-helpers/index.js +1 -1
- package/dom-helpers/insertAfter.js +1 -1
- package/dom-helpers/isDocument.js +1 -1
- package/dom-helpers/isInput.js +1 -1
- package/dom-helpers/isTransform.js +1 -1
- package/dom-helpers/isVisible.js +1 -1
- package/dom-helpers/isWindow.js +1 -1
- package/dom-helpers/listen.js +1 -1
- package/dom-helpers/matches.js +1 -1
- package/dom-helpers/nextUntil.js +1 -1
- package/dom-helpers/offset.js +1 -1
- package/dom-helpers/offsetParent.js +1 -1
- package/dom-helpers/ownerDocument.js +1 -1
- package/dom-helpers/ownerWindow.js +1 -1
- package/dom-helpers/parents.js +1 -1
- package/dom-helpers/position.js +1 -1
- package/dom-helpers/prepend.js +1 -1
- package/dom-helpers/querySelectorAll.js +1 -1
- package/dom-helpers/reflow.js +1 -1
- package/dom-helpers/remove.js +1 -1
- package/dom-helpers/removeClass.js +1 -1
- package/dom-helpers/removeEventListener.js +1 -1
- package/dom-helpers/scrollLeft.js +1 -1
- package/dom-helpers/scrollParent.js +1 -1
- package/dom-helpers/scrollTo.js +1 -1
- package/dom-helpers/scrollTop.js +1 -1
- package/dom-helpers/scrollbarSize.js +1 -1
- package/dom-helpers/siblings.js +1 -1
- package/dom-helpers/text.js +1 -1
- package/dom-helpers/toggleClass.js +1 -1
- package/dom-helpers/transitionEnd.js +1 -1
- package/dom-helpers/triggerEvent.js +1 -1
- package/dom-helpers/types.js +5 -1
- package/dom-helpers/width.js +1 -1
- package/domHelpers.js +1 -1
- package/emitter/index.js +1 -1
- package/emitter/src/index.js +1 -1
- package/emitter.js +1 -1
- package/file/fileToURL.js +1 -1
- package/file/index.js +1 -1
- package/file/saveAs.js +1 -1
- package/file.js +1 -1
- package/idb/index.js +1 -1
- package/idb.js +1 -1
- package/index.js +1 -1
- package/invariant/index.js +1 -1
- package/invariant.js +1 -1
- package/is/index.js +140 -123
- package/is.js +77 -76
- package/js-cookie/index.js +1 -1
- package/js-cookie/src/api.js +1 -1
- package/js-cookie/src/assign.js +1 -1
- package/js-cookie/src/converter.js +1 -1
- package/jsCookie.js +1 -1
- package/lunar/index.js +1 -1
- package/lunar/lib/Holiday.js +1 -1
- package/lunar/lib/HolidayUtil.js +1 -1
- package/lunar/lib/I18n.js +1 -1
- package/lunar/lib/JieQi.js +1 -1
- package/lunar/lib/Lunar.js +1 -1
- package/lunar/lib/LunarMonth.js +1 -1
- package/lunar/lib/LunarTime.js +1 -1
- package/lunar/lib/LunarUtil.js +1 -1
- package/lunar/lib/LunarYear.js +1 -1
- package/lunar/lib/ShouXingUtil.js +1 -1
- package/lunar/lib/Solar.js +1 -1
- package/lunar/lib/SolarHalfYear.js +1 -1
- package/lunar/lib/SolarMonth.js +1 -1
- package/lunar/lib/SolarSeason.js +1 -1
- package/lunar/lib/SolarUtil.js +1 -1
- package/lunar/lib/SolarWeek.js +1 -1
- package/lunar/lib/SolarYear.js +1 -1
- package/lunar/lib/index.js +1 -1
- package/lunar.js +1 -1
- package/math/index.js +1 -1
- package/math.js +1 -1
- package/md5/index.js +1 -1
- package/md5.js +1 -1
- package/mock/MockWebSocket.js +1 -1
- package/mock/MockXMLHttpRequest.js +1 -1
- package/mock/index.js +1 -1
- package/mock.js +1 -1
- package/normalize-wheel/ExecutionEnvironment.js +1 -1
- package/normalize-wheel/UserAgent_DEPRECATED.js +1 -1
- package/normalize-wheel/index.js +1 -1
- package/normalize-wheel/isEventSupported.js +10 -14
- package/normalizeWheel.js +1 -1
- package/number-to-chinese/index.js +1 -1
- package/numberToChinese.js +1 -1
- package/nzh/cn.js +1 -1
- package/nzh/hk.js +1 -1
- package/nzh/index.js +1 -1
- package/nzh/nzh.js +1 -1
- package/nzh/src/autoGet.js +1 -1
- package/nzh/src/index.js +1 -1
- package/nzh/src/langs/cn_b.js +1 -1
- package/nzh/src/langs/cn_s.js +1 -1
- package/nzh/src/langs/hk_b.js +1 -1
- package/nzh/src/langs/hk_s.js +1 -1
- package/nzh/src/utils.js +1 -1
- package/nzh.js +1 -1
- package/object-keys-sort/index.js +1 -1
- package/object-prototype-to-string-call/index.js +7 -0
- package/objectKeysSort.js +1 -1
- package/objectPrototypeToStringCall.js +5 -0
- package/package.json +1 -1
- package/pinyin/index.js +1 -1
- package/pinyin/simplified.js +1 -1
- package/pinyin/src/core.js +1 -1
- package/pinyin/src/simplified.js +1 -1
- package/pinyin/src/simplified_dict.js +1 -1
- package/pinyin/src/traditional.js +1 -1
- package/pinyin/src/traditional_dict.js +1 -1
- package/pinyin/traditional.js +1 -1
- package/pinyin.js +1 -1
- package/query-string/base.js +1 -1
- package/query-string/index.js +1 -1
- package/query-string/splitOnFirst.js +1 -1
- package/queryString.js +1 -1
- package/random/address.js +1 -1
- package/random/constellation.js +1 -1
- package/random/image.js +1 -1
- package/random/index.js +1 -1
- package/random/licensePlate.js +1 -1
- package/random/name.js +1 -1
- package/random/number.js +1 -1
- package/random/text.js +12 -11
- package/random/time.js +1 -1
- package/random/web.js +1 -1
- package/random.js +1 -1
- package/screenfull/index.js +21 -20
- package/screenfull.js +4 -3
- package/sleep/index.js +1 -1
- package/sleep.js +1 -1
- package/snapdom/index.js +1 -1
- package/snapdom/src/api/preCache.js +51 -49
- package/snapdom/src/api/snapdom.js +171 -67
- package/snapdom/src/core/cache.js +2 -2
- package/snapdom/src/core/capture.js +249 -234
- package/snapdom/src/core/clone.js +151 -120
- package/snapdom/src/core/context.js +10 -8
- package/snapdom/src/core/plugins.js +69 -0
- package/snapdom/src/core/prepare.js +2 -2
- package/snapdom/src/exporters/download.js +1 -1
- package/snapdom/src/exporters/toBlob.js +1 -1
- package/snapdom/src/exporters/toCanvas.js +40 -40
- package/snapdom/src/exporters/toImg.js +1 -1
- package/snapdom/src/modules/CSSVar.js +66 -40
- package/snapdom/src/modules/background.js +39 -23
- package/snapdom/src/modules/changeCSS.js +1 -1
- package/snapdom/src/modules/counter.js +100 -86
- package/snapdom/src/modules/fonts.js +4 -4
- package/snapdom/src/modules/iconFonts.js +98 -14
- package/snapdom/src/modules/images.js +1 -1
- package/snapdom/src/modules/lineClamp.js +1 -1
- package/snapdom/src/modules/pseudo.js +147 -138
- package/snapdom/src/modules/rasterize.js +1 -1
- package/snapdom/src/modules/snapFetch.js +1 -1
- package/snapdom/src/modules/styles.js +1 -1
- package/snapdom/src/modules/svgDefs.js +86 -39
- package/snapdom/src/utils/browser.js +1 -1
- package/snapdom/src/utils/css.js +1 -1
- package/snapdom/src/utils/helpers.js +1 -1
- package/snapdom/src/utils/image.js +1 -1
- package/snapdom/types/snapdom.d.ts +253 -184
- package/snapdom.js +1 -1
- package/tinycolor/index.js +1 -1
- package/tinycolor/src/conversion.js +1 -1
- package/tinycolor/src/css-color-names.js +1 -1
- package/tinycolor/src/format-input.js +1 -1
- package/tinycolor/src/from-ratio.js +1 -1
- package/tinycolor/src/index.js +1 -1
- package/tinycolor/src/random.js +1 -1
- package/tinycolor/src/readability.js +1 -1
- package/tinycolor/src/to-ms-filter.js +1 -1
- package/tinycolor/src/utils.js +1 -1
- package/tinycolor.js +1 -1
- package/tree/index.js +31 -30
- package/tree/search/index.js +1 -1
- package/tree.js +13 -12
- package/tween/index.js +8 -0
- package/tween/src/easing.js +62 -0
- package/tween/src/tween.js +46 -0
- package/tween.js +8 -0
- package/types/axios/index.d.ts +19 -0
- package/types/axios/lib/adapters/adapters.d.ts +28 -0
- package/types/axios/lib/adapters/fetch.d.ts +3 -0
- package/types/axios/lib/adapters/http.d.ts +12 -0
- package/types/axios/lib/adapters/xhr.d.ts +2 -0
- package/types/axios/lib/axios.d.ts +3 -0
- package/types/axios/lib/cancel/CancelToken.d.ts +34 -0
- package/types/axios/lib/cancel/CanceledError.d.ts +24 -0
- package/types/axios/lib/cancel/isCancel.d.ts +1 -0
- package/types/axios/lib/core/Axios.d.ts +28 -0
- package/types/axios/lib/core/AxiosError.d.ts +38 -0
- package/types/axios/lib/core/AxiosHeaders.d.ts +23 -0
- package/types/axios/lib/core/InterceptorManager.d.ts +38 -0
- package/types/axios/lib/core/buildFullPath.d.ts +11 -0
- package/types/axios/lib/core/dispatchRequest.d.ts +8 -0
- package/types/axios/lib/core/mergeConfig.d.ts +10 -0
- package/types/axios/lib/core/settle.d.ts +10 -0
- package/types/axios/lib/core/transformData.d.ts +9 -0
- package/types/axios/lib/defaults/index.d.ts +30 -0
- package/types/axios/lib/defaults/transitional.d.ts +6 -0
- package/types/axios/lib/env/classes/FormData.d.ts +2 -0
- package/types/axios/lib/env/data.d.ts +1 -0
- package/types/axios/lib/helpers/AxiosTransformStream.d.ts +19 -0
- package/types/axios/lib/helpers/AxiosURLSearchParams.d.ts +30 -0
- package/types/axios/lib/helpers/HttpStatusCode.d.ts +72 -0
- package/types/axios/lib/helpers/ZlibHeaderTransformStream.d.ts +5 -0
- package/types/axios/lib/helpers/bind.d.ts +8 -0
- package/types/axios/lib/helpers/buildURL.d.ts +10 -0
- package/types/axios/lib/helpers/callbackify.d.ts +2 -0
- package/types/axios/lib/helpers/combineURLs.d.ts +9 -0
- package/types/axios/lib/helpers/composeSignals.d.ts +2 -0
- package/types/axios/lib/helpers/cookies.d.ts +6 -0
- package/types/axios/lib/helpers/deprecatedMethod.d.ts +11 -0
- package/types/axios/lib/helpers/estimateDataURLDecodedBytes.d.ts +10 -0
- package/types/axios/lib/helpers/formDataToJSON.d.ts +11 -0
- package/types/axios/lib/helpers/formDataToStream.d.ts +2 -0
- package/types/axios/lib/helpers/fromDataURI.d.ts +11 -0
- package/types/axios/lib/helpers/isAbsoluteURL.d.ts +8 -0
- package/types/axios/lib/helpers/isAxiosError.d.ts +8 -0
- package/types/axios/lib/helpers/isURLSameOrigin.d.ts +2 -0
- package/types/axios/lib/helpers/null.d.ts +2 -0
- package/types/axios/lib/helpers/parseHeaders.d.ts +2 -0
- package/types/axios/lib/helpers/parseProtocol.d.ts +1 -0
- package/types/axios/lib/helpers/progressEventReducer.d.ts +3 -0
- package/types/axios/lib/helpers/readBlob.d.ts +2 -0
- package/types/axios/lib/helpers/resolveConfig.d.ts +2 -0
- package/types/axios/lib/helpers/speedometer.d.ts +8 -0
- package/types/axios/lib/helpers/spread.d.ts +22 -0
- package/types/axios/lib/helpers/throttle.d.ts +8 -0
- package/types/axios/lib/helpers/toFormData.d.ts +26 -0
- package/types/axios/lib/helpers/toURLEncodedForm.d.ts +1 -0
- package/types/axios/lib/helpers/trackStream.d.ts +3 -0
- package/types/axios/lib/helpers/validator.d.ts +28 -0
- package/types/axios/lib/platform/browser/classes/Blob.d.ts +5 -0
- package/types/axios/lib/platform/browser/classes/FormData.d.ts +5 -0
- package/types/axios/lib/platform/browser/classes/URLSearchParams.d.ts +6 -0
- package/types/axios/lib/platform/browser/index.d.ts +13 -0
- package/types/axios/lib/platform/common/utils.d.ts +32 -0
- package/types/axios/lib/platform/index.d.ts +24 -0
- package/types/axios/lib/platform/node/classes/FormData.d.ts +1 -0
- package/types/axios/lib/platform/node/classes/URLSearchParams.d.ts +2 -0
- package/types/axios/lib/platform/node/index.d.ts +25 -0
- package/types/axios/lib/utils.d.ts +289 -0
- package/types/axios-mock-adapter/index.d.ts +19 -0
- package/types/axios-mock-adapter/request.d.ts +2 -0
- package/types/axios-mock-adapter/utils.d.ts +31 -0
- package/types/dom-helpers/types.d.ts +2 -0
- package/types/is/index.d.ts +16 -16
- package/types/normalize-wheel/index.d.ts +1 -1
- package/types/object-prototype-to-string-call/index.d.ts +2 -0
- package/types/snapdom/src/api/snapdom.d.ts +4 -0
- package/types/snapdom/src/core/capture.d.ts +4 -18
- package/types/snapdom/src/core/context.d.ts +5 -5
- package/types/snapdom/src/core/exporters.d.ts +33 -0
- package/types/snapdom/src/core/plugins.d.ts +59 -0
- package/types/snapdom/src/modules/CSSVar.d.ts +3 -7
- package/types/snapdom/src/modules/iconFonts.d.ts +34 -0
- package/types/snapdom/src/modules/svgDefs.d.ts +9 -15
- package/types/tween/index.d.ts +1 -0
- package/types/tween/src/easing.d.ts +22 -0
- package/types/tween/src/index.d.ts +3 -0
- package/types/tween/src/tween.d.ts +22 -0
- package/types/validate/index.d.ts +3 -0
- package/types/validate/src/index.d.ts +39 -0
- package/types/validate/src/interface.d.ts +53 -0
- package/types/validate/src/locale/en-US.d.ts +47 -0
- package/types/validate/src/locale/zh-CN.d.ts +47 -0
- package/types/validate/src/message.d.ts +2 -0
- package/types/validate/src/rules/array.d.ts +12 -0
- package/types/validate/src/rules/base.d.ts +25 -0
- package/types/validate/src/rules/boolean.d.ts +8 -0
- package/types/validate/src/rules/custom.d.ts +7 -0
- package/types/validate/src/rules/number.d.ts +12 -0
- package/types/validate/src/rules/object.d.ts +9 -0
- package/types/validate/src/rules/string.d.ts +12 -0
- package/types/validate/src/rules/type.d.ts +9 -0
- package/types/validate/src/utils.d.ts +3 -0
- package/ui-color/compareColorByRange.js +1 -1
- package/ui-color/index.js +1 -1
- package/uiColor.js +1 -1
- package/url-toolkit/index.js +1 -1
- package/url-toolkit/src/url-toolkit.js +1 -1
- package/urlToolkit.js +1 -1
- package/validate/index.js +28 -0
- package/validate/src/index.js +106 -0
- package/validate/src/locale/en-US.js +50 -0
- package/validate/src/locale/zh-CN.js +50 -0
- package/validate/src/message.js +5 -0
- package/validate/src/rules/array.js +73 -0
- package/validate/src/rules/base.js +69 -0
- package/validate/src/rules/boolean.js +29 -0
- package/validate/src/rules/custom.js +26 -0
- package/validate/src/rules/number.js +54 -0
- package/validate/src/rules/object.js +39 -0
- package/validate/src/rules/string.js +54 -0
- package/validate/src/rules/type.js +35 -0
- package/validate/src/utils.js +8 -0
- package/validate.js +28 -0
- package/version/index.js +1 -1
- package/version.js +1 -1
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
/* 2025-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
|
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 =
|
|
29
|
+
t.style.filter = m.length ? m : "none";
|
|
28
30
|
} catch {
|
|
29
31
|
}
|
|
30
32
|
}
|
|
31
|
-
async function
|
|
32
|
-
if (!
|
|
33
|
-
|
|
34
|
-
const
|
|
35
|
-
let n,
|
|
36
|
-
|
|
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:
|
|
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
|
-
|
|
46
|
+
g();
|
|
41
47
|
}
|
|
42
|
-
await
|
|
43
|
-
|
|
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
|
|
56
|
+
await At(e.clone, e.options), d();
|
|
46
57
|
},
|
|
47
|
-
{ fast:
|
|
58
|
+
{ fast: o }
|
|
48
59
|
);
|
|
49
|
-
}), await new Promise((
|
|
50
|
-
|
|
60
|
+
}), await new Promise((d) => {
|
|
61
|
+
D(
|
|
51
62
|
async () => {
|
|
52
|
-
await
|
|
63
|
+
await vt(
|
|
64
|
+
e.element,
|
|
65
|
+
e.clone,
|
|
66
|
+
e.styleCache,
|
|
67
|
+
e.options
|
|
68
|
+
), d();
|
|
53
69
|
},
|
|
54
|
-
{ fast:
|
|
70
|
+
{ fast: o }
|
|
55
71
|
);
|
|
56
|
-
}), t.embedFonts && await new Promise((
|
|
57
|
-
|
|
72
|
+
}), t.embedFonts && await new Promise((d) => {
|
|
73
|
+
D(
|
|
58
74
|
async () => {
|
|
59
|
-
const
|
|
60
|
-
if (
|
|
61
|
-
const
|
|
62
|
-
Array.from(
|
|
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
|
|
80
|
+
await $t(y, 1);
|
|
65
81
|
}
|
|
66
|
-
|
|
67
|
-
required:
|
|
68
|
-
usedCodepoints:
|
|
69
|
-
exclude:
|
|
70
|
-
useProxy:
|
|
71
|
-
}),
|
|
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:
|
|
89
|
+
{ fast: o }
|
|
74
90
|
);
|
|
75
91
|
});
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
|
|
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
|
-
|
|
96
|
+
f = Ot(w), Z.baseStyle.set(M, f), d();
|
|
81
97
|
},
|
|
82
|
-
{ fast:
|
|
98
|
+
{ fast: o }
|
|
83
99
|
);
|
|
84
|
-
}), await new Promise((
|
|
85
|
-
|
|
100
|
+
}), e = { fontsCSS: c, baseCSS: f, ...e }, await E("beforeRender", e), await new Promise((d) => {
|
|
101
|
+
D(
|
|
86
102
|
() => {
|
|
87
|
-
const
|
|
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
|
-
|
|
115
|
-
e.offsetWidth || parseFloat(
|
|
105
|
+
a(
|
|
106
|
+
e.element.offsetWidth || parseFloat(p.width) || v.width || 1
|
|
116
107
|
)
|
|
117
|
-
),
|
|
108
|
+
), x = Math.max(
|
|
118
109
|
1,
|
|
119
|
-
|
|
120
|
-
e.offsetHeight || parseFloat(
|
|
110
|
+
a(
|
|
111
|
+
e.element.offsetHeight || parseFloat(p.height) || v.height || 1
|
|
121
112
|
)
|
|
122
|
-
),
|
|
123
|
-
const
|
|
124
|
-
return Number.isFinite(
|
|
125
|
-
},
|
|
126
|
-
let T =
|
|
127
|
-
const
|
|
128
|
-
|
|
129
|
-
let
|
|
130
|
-
if (
|
|
131
|
-
const
|
|
132
|
-
a:
|
|
133
|
-
b:
|
|
134
|
-
c:
|
|
135
|
-
d:
|
|
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
|
-
},
|
|
139
|
-
|
|
140
|
-
} else if (
|
|
141
|
-
const
|
|
142
|
-
baseTransform:
|
|
143
|
-
rotate:
|
|
144
|
-
scale:
|
|
145
|
-
translate:
|
|
146
|
-
}), { ox:
|
|
147
|
-
|
|
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
|
|
150
|
-
top:
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
const
|
|
165
|
-
|
|
166
|
-
const
|
|
167
|
-
|
|
168
|
-
const
|
|
169
|
-
|
|
170
|
-
const
|
|
171
|
-
|
|
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:
|
|
166
|
+
{ fast: o }
|
|
174
167
|
);
|
|
175
|
-
});
|
|
176
|
-
const
|
|
177
|
-
return
|
|
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(
|
|
180
|
-
if (!
|
|
181
|
-
const
|
|
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
|
|
191
|
-
if (
|
|
205
|
+
const i = o.transform || "none";
|
|
206
|
+
if (i === "none")
|
|
192
207
|
try {
|
|
193
|
-
const
|
|
194
|
-
if (
|
|
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
|
|
199
|
-
if (
|
|
200
|
-
const
|
|
201
|
-
if (
|
|
202
|
-
const [
|
|
203
|
-
let h = 0,
|
|
204
|
-
|
|
205
|
-
const
|
|
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(${
|
|
222
|
+
t.style.transform = `matrix(${S}, ${d}, ${p}, ${v}, 0, 0)`;
|
|
208
223
|
} catch {
|
|
209
224
|
}
|
|
210
|
-
return { a:
|
|
225
|
+
return { a: S, b: d, c: p, d: v };
|
|
211
226
|
}
|
|
212
227
|
}
|
|
213
228
|
try {
|
|
214
|
-
const
|
|
215
|
-
return t.style.transform =
|
|
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
|
|
221
|
-
const t =
|
|
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
|
|
224
|
-
let
|
|
225
|
-
for (const
|
|
226
|
-
const s =
|
|
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 [
|
|
229
|
-
|
|
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(
|
|
233
|
-
right: Math.ceil(
|
|
234
|
-
bottom: Math.ceil(
|
|
235
|
-
left: Math.ceil(
|
|
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
|
|
239
|
-
const t = (
|
|
240
|
-
return { top:
|
|
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
|
|
243
|
-
if ((
|
|
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(
|
|
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
|
|
249
|
-
const
|
|
250
|
-
function h(
|
|
251
|
-
let
|
|
252
|
-
return
|
|
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
|
|
255
|
-
let
|
|
256
|
-
for (const [
|
|
257
|
-
|
|
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:
|
|
260
|
-
minY:
|
|
261
|
-
maxX:
|
|
274
|
+
minX: u,
|
|
275
|
+
minY: g,
|
|
276
|
+
maxX: w,
|
|
262
277
|
maxY: M,
|
|
263
|
-
width:
|
|
264
|
-
height: M -
|
|
278
|
+
width: w - u,
|
|
279
|
+
height: M - g
|
|
265
280
|
};
|
|
266
281
|
}
|
|
267
|
-
function
|
|
268
|
-
return
|
|
282
|
+
function Ut(n) {
|
|
283
|
+
return Lt(n);
|
|
269
284
|
}
|
|
270
|
-
function
|
|
271
|
-
const t = getComputedStyle(
|
|
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(
|
|
280
|
-
const t = { rotate: "0deg", scale: null, translate: null },
|
|
281
|
-
if (
|
|
282
|
-
const
|
|
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
|
|
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
|
-
},
|
|
289
|
-
if (
|
|
290
|
-
if (
|
|
291
|
-
const s =
|
|
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
|
|
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(
|
|
310
|
+
const s = getComputedStyle(n);
|
|
296
311
|
t.rotate = s.rotate && s.rotate !== "none" ? s.rotate : "0deg";
|
|
297
312
|
}
|
|
298
|
-
const
|
|
299
|
-
if (
|
|
300
|
-
const s = "x" in
|
|
301
|
-
t.scale = `${s} ${
|
|
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(
|
|
318
|
+
const s = getComputedStyle(n);
|
|
304
319
|
t.scale = s.scale && s.scale !== "none" ? s.scale : null;
|
|
305
320
|
}
|
|
306
|
-
const
|
|
307
|
-
if (
|
|
308
|
-
const s = "x" in
|
|
309
|
-
t.translate = `${s}${
|
|
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(
|
|
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
|
|
317
|
-
return t.rotate =
|
|
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
|
|
320
|
-
const t = getComputedStyle(
|
|
321
|
-
if (
|
|
322
|
-
const
|
|
323
|
-
return !!(
|
|
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
|
|
326
|
-
const
|
|
327
|
-
const
|
|
328
|
-
return
|
|
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:
|
|
332
|
-
oy:
|
|
346
|
+
ox: r(m, t),
|
|
347
|
+
oy: r(e, o)
|
|
333
348
|
};
|
|
334
349
|
}
|
|
335
|
-
var
|
|
336
|
-
function
|
|
337
|
-
if (
|
|
338
|
-
const
|
|
339
|
-
return
|
|
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(
|
|
364
|
+
}), document.documentElement.appendChild(n), R = n, n;
|
|
350
365
|
}
|
|
351
|
-
function
|
|
352
|
-
const t =
|
|
353
|
-
|
|
354
|
-
const
|
|
355
|
-
return t.removeChild(
|
|
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
|
-
|
|
373
|
+
re as captureDOM
|
|
359
374
|
};
|