native-fn 1.0.37 → 1.0.39
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/dist/index.d.ts +23 -20
- package/dist/native.cjs +23 -2
- package/dist/native.min.cjs +1 -1
- package/dist/native.min.mjs +1 -1
- package/dist/native.mjs +23 -2
- package/dist/native.umd.js +23 -2
- package/dist/native.umd.min.js +1 -1
- package/dist/plugin/app/index.cjs +352 -192
- package/dist/plugin/app/index.d.ts +22 -23
- package/dist/plugin/app/index.min.cjs +1 -1
- package/dist/plugin/app/index.min.mjs +1 -1
- package/dist/plugin/app/index.mjs +352 -192
- package/dist/plugin/app/index.umd.js +352 -192
- package/dist/plugin/app/index.umd.min.js +1 -1
- package/dist/plugin/app/src/constants/platform.d.ts +17 -2
- package/dist/plugin/app/src/errors/plugin-not-extended-error.d.ts +2 -0
- package/dist/plugin/app/src/plugin/app/constants/app.d.ts +1 -2
- package/dist/plugin/app/src/plugin/app/cores/app.d.ts +1 -1
- package/dist/plugin/app/src/plugin/app/index.d.ts +10 -3
- package/dist/plugin/app/src/plugin/app/types/app.d.ts +7 -16
- package/dist/plugin/app/src/plugin/app/types/index.d.ts +4 -4
- package/dist/plugin/app/src/plugin/camera/constants/camera.d.ts +4 -0
- package/dist/plugin/app/src/plugin/camera/cores/camera.d.ts +3 -0
- package/dist/plugin/app/src/plugin/camera/index.d.ts +8 -0
- package/dist/plugin/app/src/plugin/camera/types/camera.d.ts +4 -0
- package/dist/plugin/app/src/plugin/camera/types/index.d.ts +13 -0
- package/dist/plugin/app/src/plugin/camera/utils/try-open-camera.d.ts +2 -0
- package/dist/plugin/app/src/plugin/clipboard/constants/clipboard.d.ts +4 -0
- package/dist/plugin/app/src/plugin/clipboard/cores/clipboard.d.ts +3 -0
- package/dist/plugin/app/src/plugin/clipboard/errors/unsupported-color-error.d.ts +2 -0
- package/dist/plugin/app/src/plugin/clipboard/index.d.ts +5 -0
- package/dist/plugin/app/src/plugin/clipboard/types/clipboard.d.ts +4 -0
- package/dist/plugin/app/src/plugin/clipboard/types/index.d.ts +11 -0
- package/dist/plugin/app/src/plugin/clipboard/utils/copy.d.ts +1 -0
- package/dist/plugin/app/src/plugin/clipboard/utils/html-string-to-plain-string.d.ts +1 -0
- package/dist/plugin/app/src/plugin/fullscreen/cores/fullscreen.d.ts +3 -0
- package/dist/plugin/app/src/plugin/fullscreen/index.d.ts +5 -0
- package/dist/plugin/app/src/plugin/fullscreen/types/fullscreen.d.ts +10 -0
- package/dist/plugin/app/src/plugin/fullscreen/types/index.d.ts +11 -0
- package/dist/plugin/app/src/plugin/media/constants/media.d.ts +5 -0
- package/dist/plugin/app/src/plugin/media/cores/media.d.ts +3 -0
- package/dist/plugin/app/src/plugin/media/index.d.ts +5 -0
- package/dist/plugin/app/src/plugin/media/types/index.d.ts +13 -0
- package/dist/plugin/app/src/plugin/media/types/media.d.ts +4 -0
- package/dist/plugin/app/src/plugin/media/utils/try-open-camera.d.ts +2 -0
- package/dist/plugin/app/src/plugin/platform/cores/platform.d.ts +1 -1
- package/dist/plugin/app/src/plugin/platform/index.d.ts +9 -3
- package/dist/plugin/app/src/plugin/platform/types/index.d.ts +2 -2
- package/dist/plugin/app/src/plugin/platform/types/platform.d.ts +3 -1
- package/dist/plugin/app/src/plugin/theme/constants/theme.d.ts +1 -3
- package/dist/plugin/app/src/plugin/theme/cores/theme.d.ts +1 -1
- package/dist/plugin/app/src/plugin/theme/index.d.ts +15 -3
- package/dist/plugin/app/src/plugin/theme/types/index.d.ts +4 -4
- package/dist/plugin/app/src/plugin/theme/types/theme.d.ts +7 -7
- package/dist/plugin/app/src/plugin/theme/utils/parse-color.d.ts +1 -1
- package/dist/plugin/app/src/plugin/theme/utils/parse-easing-function.d.ts +1 -1
- package/dist/plugin/app/src/types/clipboard-utils.d.ts +4 -0
- package/dist/plugin/app/src/types/event-listener-util.d.ts +11 -0
- package/dist/plugin/app/src/types/index.d.ts +1 -1
- package/dist/plugin/app/src/types/native.d.ts +20 -13
- package/dist/plugin/app/src/utils/clipboard-utils.d.ts +4 -0
- package/dist/plugin/app/src/utils/compare-version.d.ts +1 -0
- package/dist/plugin/app/src/utils/create-hidden-element.d.ts +1 -0
- package/dist/plugin/app/src/utils/dispatch-click-event.d.ts +1 -0
- package/dist/plugin/app/src/utils/event-listener-utils.d.ts +3 -0
- package/dist/plugin/app/src/utils/fullscreen-utils.d.ts +44 -0
- package/dist/plugin/app/src/utils/get-tag-name.d.ts +1 -0
- package/dist/plugin/app/src/utils/get-topmost-window.d.ts +1 -0
- package/dist/plugin/app/src/utils/is-secure-context.d.ts +1 -0
- package/dist/plugin/camera/index.cjs +377 -0
- package/dist/plugin/camera/index.d.ts +34 -0
- package/dist/plugin/camera/index.min.cjs +1 -0
- package/dist/plugin/camera/index.min.mjs +1 -0
- package/dist/plugin/camera/index.mjs +375 -0
- package/dist/plugin/camera/index.umd.js +383 -0
- package/dist/plugin/camera/index.umd.min.js +1 -0
- package/dist/plugin/camera/src/constants/platform.d.ts +50 -0
- package/dist/plugin/camera/src/constants/user-agent.d.ts +1 -0
- package/dist/plugin/camera/src/errors/plugin-not-extended-error.d.ts +2 -0
- package/dist/plugin/camera/src/errors/url-open-error.d.ts +2 -0
- package/dist/plugin/camera/src/plugin/app/constants/app.d.ts +12 -0
- package/dist/plugin/camera/src/plugin/app/cores/app.d.ts +3 -0
- package/dist/plugin/camera/src/plugin/app/errors/url-open-error.d.ts +2 -0
- package/dist/plugin/camera/src/plugin/app/index.d.ts +12 -0
- package/dist/plugin/camera/src/plugin/app/types/app.d.ts +45 -0
- package/dist/plugin/camera/src/plugin/app/types/index.d.ts +16 -0
- package/dist/plugin/camera/src/plugin/app/utils/try-open-url.d.ts +1 -0
- package/dist/plugin/camera/src/plugin/camera/constants/camera.d.ts +4 -0
- package/dist/plugin/camera/src/plugin/camera/cores/camera.d.ts +3 -0
- package/dist/plugin/camera/src/plugin/camera/index.d.ts +8 -0
- package/dist/plugin/camera/src/plugin/camera/types/camera.d.ts +4 -0
- package/dist/plugin/camera/src/plugin/camera/types/index.d.ts +13 -0
- package/dist/plugin/camera/src/plugin/camera/utils/try-open-camera.d.ts +2 -0
- package/dist/plugin/camera/src/plugin/clipboard/constants/clipboard.d.ts +4 -0
- package/dist/plugin/camera/src/plugin/clipboard/cores/clipboard.d.ts +3 -0
- package/dist/plugin/camera/src/plugin/clipboard/errors/unsupported-color-error.d.ts +2 -0
- package/dist/plugin/camera/src/plugin/clipboard/index.d.ts +5 -0
- package/dist/plugin/camera/src/plugin/clipboard/types/clipboard.d.ts +4 -0
- package/dist/plugin/camera/src/plugin/clipboard/types/index.d.ts +11 -0
- package/dist/plugin/camera/src/plugin/clipboard/utils/copy.d.ts +1 -0
- package/dist/plugin/camera/src/plugin/clipboard/utils/html-string-to-plain-string.d.ts +1 -0
- package/dist/plugin/camera/src/plugin/fullscreen/cores/fullscreen.d.ts +3 -0
- package/dist/plugin/camera/src/plugin/fullscreen/index.d.ts +5 -0
- package/dist/plugin/camera/src/plugin/fullscreen/types/fullscreen.d.ts +10 -0
- package/dist/plugin/camera/src/plugin/fullscreen/types/index.d.ts +11 -0
- package/dist/plugin/camera/src/plugin/platform/cores/platform.d.ts +3 -0
- package/dist/plugin/camera/src/plugin/platform/index.d.ts +11 -0
- package/dist/plugin/camera/src/plugin/platform/types/index.d.ts +7 -0
- package/dist/plugin/camera/src/plugin/platform/types/platform.d.ts +15 -0
- package/dist/plugin/camera/src/plugin/theme/constants/theme.d.ts +14 -0
- package/dist/plugin/camera/src/plugin/theme/cores/theme.d.ts +3 -0
- package/dist/plugin/camera/src/plugin/theme/errors/easing-error.d.ts +6 -0
- package/dist/plugin/camera/src/plugin/theme/errors/unsupported-color-error.d.ts +2 -0
- package/dist/plugin/camera/src/plugin/theme/index.d.ts +17 -0
- package/dist/plugin/camera/src/plugin/theme/types/color.d.ts +17 -0
- package/dist/plugin/camera/src/plugin/theme/types/easing-syntax.d.ts +16 -0
- package/dist/plugin/camera/src/plugin/theme/types/index.d.ts +23 -0
- package/dist/plugin/camera/src/plugin/theme/types/theme.d.ts +23 -0
- package/dist/plugin/camera/src/plugin/theme/utils/parse-color.d.ts +2 -0
- package/dist/plugin/camera/src/plugin/theme/utils/parse-easing-function.d.ts +2 -0
- package/dist/plugin/camera/src/types/clipboard-utils.d.ts +4 -0
- package/dist/plugin/camera/src/types/event-listener-util.d.ts +11 -0
- package/dist/plugin/camera/src/types/index.d.ts +1 -0
- package/dist/plugin/camera/src/types/native.d.ts +27 -0
- package/dist/plugin/camera/src/utils/assign.d.ts +1 -0
- package/dist/plugin/camera/src/utils/clipboard-utils.d.ts +4 -0
- package/dist/plugin/camera/src/utils/compare-version.d.ts +1 -0
- package/dist/plugin/camera/src/utils/create-custom-error.d.ts +1 -0
- package/dist/plugin/camera/src/utils/create-hidden-element.d.ts +1 -0
- package/dist/plugin/camera/src/utils/dispatch-click-event.d.ts +1 -0
- package/dist/plugin/camera/src/utils/event-listener-utils.d.ts +3 -0
- package/dist/plugin/camera/src/utils/fullscreen-utils.d.ts +44 -0
- package/dist/plugin/camera/src/utils/get-tag-name.d.ts +1 -0
- package/dist/plugin/camera/src/utils/get-topmost-window.d.ts +1 -0
- package/dist/plugin/camera/src/utils/is-secure-context.d.ts +1 -0
- package/dist/plugin/clipboard/index.cjs +491 -0
- package/dist/plugin/clipboard/index.d.ts +27 -0
- package/dist/plugin/clipboard/index.min.cjs +1 -0
- package/dist/plugin/clipboard/index.min.mjs +1 -0
- package/dist/plugin/clipboard/index.mjs +489 -0
- package/dist/plugin/clipboard/index.umd.js +497 -0
- package/dist/plugin/clipboard/index.umd.min.js +1 -0
- package/dist/plugin/clipboard/src/constants/platform.d.ts +50 -0
- package/dist/plugin/clipboard/src/constants/user-agent.d.ts +1 -0
- package/dist/plugin/clipboard/src/errors/plugin-not-extended-error.d.ts +2 -0
- package/dist/plugin/clipboard/src/errors/url-open-error.d.ts +2 -0
- package/dist/plugin/clipboard/src/plugin/app/constants/app.d.ts +12 -0
- package/dist/plugin/clipboard/src/plugin/app/cores/app.d.ts +3 -0
- package/dist/plugin/clipboard/src/plugin/app/errors/url-open-error.d.ts +2 -0
- package/dist/plugin/clipboard/src/plugin/app/index.d.ts +12 -0
- package/dist/plugin/clipboard/src/plugin/app/types/app.d.ts +45 -0
- package/dist/plugin/clipboard/src/plugin/app/types/index.d.ts +16 -0
- package/dist/plugin/clipboard/src/plugin/app/utils/try-open-url.d.ts +1 -0
- package/dist/plugin/clipboard/src/plugin/camera/constants/camera.d.ts +4 -0
- package/dist/plugin/clipboard/src/plugin/camera/cores/camera.d.ts +3 -0
- package/dist/plugin/clipboard/src/plugin/camera/index.d.ts +8 -0
- package/dist/plugin/clipboard/src/plugin/camera/types/camera.d.ts +4 -0
- package/dist/plugin/clipboard/src/plugin/camera/types/index.d.ts +13 -0
- package/dist/plugin/clipboard/src/plugin/camera/utils/try-open-camera.d.ts +2 -0
- package/dist/plugin/clipboard/src/plugin/clipboard/constants/clipboard.d.ts +4 -0
- package/dist/plugin/clipboard/src/plugin/clipboard/cores/clipboard.d.ts +3 -0
- package/dist/plugin/clipboard/src/plugin/clipboard/errors/unsupported-color-error.d.ts +2 -0
- package/dist/plugin/clipboard/src/plugin/clipboard/index.d.ts +5 -0
- package/dist/plugin/clipboard/src/plugin/clipboard/types/clipboard.d.ts +4 -0
- package/dist/plugin/clipboard/src/plugin/clipboard/types/index.d.ts +11 -0
- package/dist/plugin/clipboard/src/plugin/clipboard/utils/copy.d.ts +1 -0
- package/dist/plugin/clipboard/src/plugin/clipboard/utils/html-string-to-plain-string.d.ts +1 -0
- package/dist/plugin/clipboard/src/plugin/fullscreen/cores/fullscreen.d.ts +3 -0
- package/dist/plugin/clipboard/src/plugin/fullscreen/index.d.ts +5 -0
- package/dist/plugin/clipboard/src/plugin/fullscreen/types/fullscreen.d.ts +10 -0
- package/dist/plugin/clipboard/src/plugin/fullscreen/types/index.d.ts +11 -0
- package/dist/plugin/clipboard/src/plugin/platform/cores/platform.d.ts +3 -0
- package/dist/plugin/clipboard/src/plugin/platform/index.d.ts +11 -0
- package/dist/plugin/clipboard/src/plugin/platform/types/index.d.ts +7 -0
- package/dist/plugin/clipboard/src/plugin/platform/types/platform.d.ts +15 -0
- package/dist/plugin/clipboard/src/plugin/theme/constants/theme.d.ts +14 -0
- package/dist/plugin/clipboard/src/plugin/theme/cores/theme.d.ts +3 -0
- package/dist/plugin/clipboard/src/plugin/theme/errors/easing-error.d.ts +6 -0
- package/dist/plugin/clipboard/src/plugin/theme/errors/unsupported-color-error.d.ts +2 -0
- package/dist/plugin/clipboard/src/plugin/theme/index.d.ts +17 -0
- package/dist/plugin/clipboard/src/plugin/theme/types/color.d.ts +17 -0
- package/dist/plugin/clipboard/src/plugin/theme/types/easing-syntax.d.ts +16 -0
- package/dist/plugin/clipboard/src/plugin/theme/types/index.d.ts +23 -0
- package/dist/plugin/clipboard/src/plugin/theme/types/theme.d.ts +23 -0
- package/dist/plugin/clipboard/src/plugin/theme/utils/parse-color.d.ts +2 -0
- package/dist/plugin/clipboard/src/plugin/theme/utils/parse-easing-function.d.ts +2 -0
- package/dist/plugin/clipboard/src/types/clipboard-utils.d.ts +4 -0
- package/dist/plugin/clipboard/src/types/event-listener-util.d.ts +11 -0
- package/dist/plugin/clipboard/src/types/index.d.ts +1 -0
- package/dist/plugin/clipboard/src/types/native.d.ts +27 -0
- package/dist/plugin/clipboard/src/utils/assign.d.ts +1 -0
- package/dist/plugin/clipboard/src/utils/clipboard-utils.d.ts +4 -0
- package/dist/plugin/clipboard/src/utils/compare-version.d.ts +1 -0
- package/dist/plugin/clipboard/src/utils/create-custom-error.d.ts +1 -0
- package/dist/plugin/clipboard/src/utils/create-hidden-element.d.ts +1 -0
- package/dist/plugin/clipboard/src/utils/dispatch-click-event.d.ts +1 -0
- package/dist/plugin/clipboard/src/utils/event-listener-utils.d.ts +3 -0
- package/dist/plugin/clipboard/src/utils/fullscreen-utils.d.ts +44 -0
- package/dist/plugin/clipboard/src/utils/get-tag-name.d.ts +1 -0
- package/dist/plugin/clipboard/src/utils/get-topmost-window.d.ts +1 -0
- package/dist/plugin/clipboard/src/utils/is-secure-context.d.ts +1 -0
- package/dist/plugin/fullscreen/index.cjs +521 -0
- package/dist/plugin/fullscreen/index.d.ts +33 -0
- package/dist/plugin/fullscreen/index.min.cjs +1 -0
- package/dist/plugin/fullscreen/index.min.mjs +1 -0
- package/dist/plugin/fullscreen/index.mjs +519 -0
- package/dist/plugin/fullscreen/index.umd.js +527 -0
- package/dist/plugin/fullscreen/index.umd.min.js +1 -0
- package/dist/plugin/fullscreen/src/constants/platform.d.ts +50 -0
- package/dist/plugin/fullscreen/src/constants/user-agent.d.ts +1 -0
- package/dist/plugin/fullscreen/src/errors/plugin-not-extended-error.d.ts +2 -0
- package/dist/plugin/fullscreen/src/errors/url-open-error.d.ts +2 -0
- package/dist/plugin/fullscreen/src/plugin/app/constants/app.d.ts +12 -0
- package/dist/plugin/fullscreen/src/plugin/app/cores/app.d.ts +3 -0
- package/dist/plugin/fullscreen/src/plugin/app/errors/url-open-error.d.ts +2 -0
- package/dist/plugin/fullscreen/src/plugin/app/index.d.ts +12 -0
- package/dist/plugin/fullscreen/src/plugin/app/types/app.d.ts +45 -0
- package/dist/plugin/fullscreen/src/plugin/app/types/index.d.ts +16 -0
- package/dist/plugin/fullscreen/src/plugin/app/utils/try-open-url.d.ts +1 -0
- package/dist/plugin/fullscreen/src/plugin/camera/constants/camera.d.ts +4 -0
- package/dist/plugin/fullscreen/src/plugin/camera/cores/camera.d.ts +3 -0
- package/dist/plugin/fullscreen/src/plugin/camera/index.d.ts +8 -0
- package/dist/plugin/fullscreen/src/plugin/camera/types/camera.d.ts +4 -0
- package/dist/plugin/fullscreen/src/plugin/camera/types/index.d.ts +13 -0
- package/dist/plugin/fullscreen/src/plugin/camera/utils/try-open-camera.d.ts +2 -0
- package/dist/plugin/fullscreen/src/plugin/clipboard/cores/clipboard.d.ts +3 -0
- package/dist/plugin/fullscreen/src/plugin/clipboard/index.d.ts +5 -0
- package/dist/plugin/fullscreen/src/plugin/clipboard/types/clipboard.d.ts +4 -0
- package/dist/plugin/fullscreen/src/plugin/clipboard/types/index.d.ts +11 -0
- package/dist/plugin/fullscreen/src/plugin/fullscreen/cores/fullscreen.d.ts +3 -0
- package/dist/plugin/fullscreen/src/plugin/fullscreen/index.d.ts +5 -0
- package/dist/plugin/fullscreen/src/plugin/fullscreen/types/fullscreen.d.ts +10 -0
- package/dist/plugin/fullscreen/src/plugin/fullscreen/types/index.d.ts +11 -0
- package/dist/plugin/fullscreen/src/plugin/platform/cores/platform.d.ts +3 -0
- package/dist/plugin/fullscreen/src/plugin/platform/index.d.ts +11 -0
- package/dist/plugin/fullscreen/src/plugin/platform/types/index.d.ts +7 -0
- package/dist/plugin/fullscreen/src/plugin/platform/types/platform.d.ts +15 -0
- package/dist/plugin/fullscreen/src/plugin/theme/constants/theme.d.ts +14 -0
- package/dist/plugin/fullscreen/src/plugin/theme/cores/theme.d.ts +3 -0
- package/dist/plugin/fullscreen/src/plugin/theme/errors/easing-error.d.ts +6 -0
- package/dist/plugin/fullscreen/src/plugin/theme/errors/unsupported-color-error.d.ts +2 -0
- package/dist/plugin/fullscreen/src/plugin/theme/index.d.ts +17 -0
- package/dist/plugin/fullscreen/src/plugin/theme/types/color.d.ts +17 -0
- package/dist/plugin/fullscreen/src/plugin/theme/types/easing-syntax.d.ts +16 -0
- package/dist/plugin/fullscreen/src/plugin/theme/types/index.d.ts +23 -0
- package/dist/plugin/fullscreen/src/plugin/theme/types/theme.d.ts +23 -0
- package/dist/plugin/fullscreen/src/plugin/theme/utils/parse-color.d.ts +2 -0
- package/dist/plugin/fullscreen/src/plugin/theme/utils/parse-easing-function.d.ts +2 -0
- package/dist/plugin/fullscreen/src/types/clipboard-utils.d.ts +4 -0
- package/dist/plugin/fullscreen/src/types/event-listener-util.d.ts +11 -0
- package/dist/plugin/fullscreen/src/types/index.d.ts +1 -0
- package/dist/plugin/fullscreen/src/types/native.d.ts +27 -0
- package/dist/plugin/fullscreen/src/utils/assign.d.ts +1 -0
- package/dist/plugin/fullscreen/src/utils/clipboard-utils.d.ts +4 -0
- package/dist/plugin/fullscreen/src/utils/compare-version.d.ts +1 -0
- package/dist/plugin/fullscreen/src/utils/create-custom-error.d.ts +1 -0
- package/dist/plugin/fullscreen/src/utils/create-hidden-element.d.ts +1 -0
- package/dist/plugin/fullscreen/src/utils/dispatch-click-event.d.ts +1 -0
- package/dist/plugin/fullscreen/src/utils/event-listener-utils.d.ts +3 -0
- package/dist/plugin/fullscreen/src/utils/fullscreen-utils.d.ts +44 -0
- package/dist/plugin/fullscreen/src/utils/get-tag-name.d.ts +1 -0
- package/dist/plugin/fullscreen/src/utils/get-topmost-window.d.ts +1 -0
- package/dist/plugin/fullscreen/src/utils/is-secure-context.d.ts +1 -0
- package/dist/plugin/media/index.cjs +241 -0
- package/dist/plugin/media/index.d.ts +33 -0
- package/dist/plugin/media/index.min.cjs +1 -0
- package/dist/plugin/media/index.min.mjs +1 -0
- package/dist/plugin/media/index.mjs +239 -0
- package/dist/plugin/media/index.umd.js +247 -0
- package/dist/plugin/media/index.umd.min.js +1 -0
- package/dist/plugin/media/src/constants/platform.d.ts +35 -0
- package/dist/plugin/media/src/constants/user-agent.d.ts +1 -0
- package/dist/plugin/media/src/errors/url-open-error.d.ts +2 -0
- package/dist/plugin/media/src/plugin/app/constants/app.d.ts +13 -0
- package/dist/plugin/media/src/plugin/app/cores/app.d.ts +3 -0
- package/dist/plugin/media/src/plugin/app/errors/url-open-error.d.ts +2 -0
- package/dist/plugin/media/src/plugin/app/index.d.ts +12 -0
- package/dist/plugin/media/src/plugin/app/types/app.d.ts +43 -0
- package/dist/plugin/media/src/plugin/app/types/index.d.ts +16 -0
- package/dist/plugin/media/src/plugin/app/utils/try-open-url.d.ts +1 -0
- package/dist/plugin/media/src/plugin/media/constants/media.d.ts +5 -0
- package/dist/plugin/media/src/plugin/media/cores/media.d.ts +3 -0
- package/dist/plugin/media/src/plugin/media/index.d.ts +5 -0
- package/dist/plugin/media/src/plugin/media/types/index.d.ts +13 -0
- package/dist/plugin/media/src/plugin/media/types/media.d.ts +4 -0
- package/dist/plugin/media/src/plugin/media/utils/try-open-camera.d.ts +2 -0
- package/dist/plugin/media/src/plugin/platform/cores/platform.d.ts +3 -0
- package/dist/plugin/media/src/plugin/platform/index.d.ts +5 -0
- package/dist/plugin/media/src/plugin/platform/types/index.d.ts +7 -0
- package/dist/plugin/media/src/plugin/platform/types/platform.d.ts +13 -0
- package/dist/plugin/media/src/plugin/theme/constants/theme.d.ts +16 -0
- package/dist/plugin/media/src/plugin/theme/cores/theme.d.ts +3 -0
- package/dist/plugin/media/src/plugin/theme/errors/easing-error.d.ts +6 -0
- package/dist/plugin/media/src/plugin/theme/errors/unsupported-color-error.d.ts +2 -0
- package/dist/plugin/media/src/plugin/theme/index.d.ts +17 -0
- package/dist/plugin/media/src/plugin/theme/types/color.d.ts +17 -0
- package/dist/plugin/media/src/plugin/theme/types/easing-syntax.d.ts +16 -0
- package/dist/plugin/media/src/plugin/theme/types/index.d.ts +23 -0
- package/dist/plugin/media/src/plugin/theme/types/theme.d.ts +23 -0
- package/dist/plugin/media/src/plugin/theme/utils/parse-color.d.ts +2 -0
- package/dist/plugin/media/src/plugin/theme/utils/parse-easing-function.d.ts +2 -0
- package/dist/plugin/media/src/types/event-listener-util.d.ts +11 -0
- package/dist/plugin/media/src/types/index.d.ts +2 -0
- package/dist/plugin/media/src/types/native.d.ts +27 -0
- package/dist/plugin/media/src/utils/assign.d.ts +1 -0
- package/dist/plugin/media/src/utils/create-custom-error.d.ts +1 -0
- package/dist/plugin/media/src/utils/dispatch-click-event.d.ts +1 -0
- package/dist/plugin/media/src/utils/event-listener-utils.d.ts +3 -0
- package/dist/plugin/media/src/utils/get-topmost-window.d.ts +1 -0
- package/dist/plugin/platform/index.cjs +164 -62
- package/dist/plugin/platform/index.d.ts +26 -6
- package/dist/plugin/platform/index.min.cjs +1 -1
- package/dist/plugin/platform/index.min.mjs +1 -1
- package/dist/plugin/platform/index.mjs +164 -62
- package/dist/plugin/platform/index.umd.js +164 -62
- package/dist/plugin/platform/index.umd.min.js +1 -1
- package/dist/plugin/platform/src/constants/platform.d.ts +17 -2
- package/dist/plugin/platform/src/errors/plugin-not-extended-error.d.ts +2 -0
- package/dist/plugin/platform/src/plugin/app/constants/app.d.ts +1 -2
- package/dist/plugin/platform/src/plugin/app/cores/app.d.ts +1 -1
- package/dist/plugin/platform/src/plugin/app/index.d.ts +10 -3
- package/dist/plugin/platform/src/plugin/app/types/app.d.ts +7 -16
- package/dist/plugin/platform/src/plugin/app/types/index.d.ts +4 -4
- package/dist/plugin/platform/src/plugin/camera/constants/camera.d.ts +4 -0
- package/dist/plugin/platform/src/plugin/camera/cores/camera.d.ts +3 -0
- package/dist/plugin/platform/src/plugin/camera/index.d.ts +8 -0
- package/dist/plugin/platform/src/plugin/camera/types/camera.d.ts +4 -0
- package/dist/plugin/platform/src/plugin/camera/types/index.d.ts +13 -0
- package/dist/plugin/platform/src/plugin/camera/utils/try-open-camera.d.ts +2 -0
- package/dist/plugin/platform/src/plugin/clipboard/constants/clipboard.d.ts +4 -0
- package/dist/plugin/platform/src/plugin/clipboard/cores/clipboard.d.ts +3 -0
- package/dist/plugin/platform/src/plugin/clipboard/errors/unsupported-color-error.d.ts +2 -0
- package/dist/plugin/platform/src/plugin/clipboard/index.d.ts +5 -0
- package/dist/plugin/platform/src/plugin/clipboard/types/clipboard.d.ts +4 -0
- package/dist/plugin/platform/src/plugin/clipboard/types/index.d.ts +11 -0
- package/dist/plugin/platform/src/plugin/clipboard/utils/copy.d.ts +1 -0
- package/dist/plugin/platform/src/plugin/clipboard/utils/html-string-to-plain-string.d.ts +1 -0
- package/dist/plugin/platform/src/plugin/fullscreen/cores/fullscreen.d.ts +3 -0
- package/dist/plugin/platform/src/plugin/fullscreen/index.d.ts +5 -0
- package/dist/plugin/platform/src/plugin/fullscreen/types/fullscreen.d.ts +10 -0
- package/dist/plugin/platform/src/plugin/fullscreen/types/index.d.ts +11 -0
- package/dist/plugin/platform/src/plugin/media/constants/media.d.ts +5 -0
- package/dist/plugin/platform/src/plugin/media/cores/media.d.ts +3 -0
- package/dist/plugin/platform/src/plugin/media/index.d.ts +5 -0
- package/dist/plugin/platform/src/plugin/media/types/index.d.ts +13 -0
- package/dist/plugin/platform/src/plugin/media/types/media.d.ts +4 -0
- package/dist/plugin/platform/src/plugin/media/utils/try-open-camera.d.ts +2 -0
- package/dist/plugin/platform/src/plugin/platform/cores/platform.d.ts +1 -1
- package/dist/plugin/platform/src/plugin/platform/index.d.ts +9 -3
- package/dist/plugin/platform/src/plugin/platform/types/index.d.ts +2 -2
- package/dist/plugin/platform/src/plugin/platform/types/platform.d.ts +3 -1
- package/dist/plugin/platform/src/plugin/theme/constants/theme.d.ts +1 -3
- package/dist/plugin/platform/src/plugin/theme/cores/theme.d.ts +1 -1
- package/dist/plugin/platform/src/plugin/theme/index.d.ts +15 -3
- package/dist/plugin/platform/src/plugin/theme/types/index.d.ts +4 -4
- package/dist/plugin/platform/src/plugin/theme/types/theme.d.ts +7 -7
- package/dist/plugin/platform/src/plugin/theme/utils/parse-color.d.ts +1 -1
- package/dist/plugin/platform/src/plugin/theme/utils/parse-easing-function.d.ts +1 -1
- package/dist/plugin/platform/src/types/clipboard-utils.d.ts +4 -0
- package/dist/plugin/platform/src/types/event-listener-util.d.ts +11 -0
- package/dist/plugin/platform/src/types/index.d.ts +1 -1
- package/dist/plugin/platform/src/types/native.d.ts +20 -13
- package/dist/plugin/platform/src/utils/clipboard-utils.d.ts +4 -0
- package/dist/plugin/platform/src/utils/compare-version.d.ts +1 -0
- package/dist/plugin/platform/src/utils/create-hidden-element.d.ts +1 -0
- package/dist/plugin/platform/src/utils/dispatch-click-event.d.ts +1 -0
- package/dist/plugin/platform/src/utils/event-listener-utils.d.ts +3 -0
- package/dist/plugin/platform/src/utils/fullscreen-utils.d.ts +44 -0
- package/dist/plugin/platform/src/utils/get-tag-name.d.ts +1 -0
- package/dist/plugin/platform/src/utils/get-topmost-window.d.ts +1 -0
- package/dist/plugin/platform/src/utils/is-secure-context.d.ts +1 -0
- package/dist/plugin/theme/index.cjs +317 -50
- package/dist/plugin/theme/index.d.ts +20 -11
- package/dist/plugin/theme/index.min.cjs +1 -1
- package/dist/plugin/theme/index.min.mjs +1 -1
- package/dist/plugin/theme/index.mjs +317 -50
- package/dist/plugin/theme/index.umd.js +317 -50
- package/dist/plugin/theme/index.umd.min.js +1 -1
- package/dist/plugin/theme/src/constants/platform.d.ts +17 -2
- package/dist/plugin/theme/src/errors/plugin-not-extended-error.d.ts +2 -0
- package/dist/plugin/theme/src/plugin/app/constants/app.d.ts +1 -2
- package/dist/plugin/theme/src/plugin/app/cores/app.d.ts +1 -1
- package/dist/plugin/theme/src/plugin/app/index.d.ts +10 -3
- package/dist/plugin/theme/src/plugin/app/types/app.d.ts +7 -16
- package/dist/plugin/theme/src/plugin/app/types/index.d.ts +4 -4
- package/dist/plugin/theme/src/plugin/camera/constants/camera.d.ts +4 -0
- package/dist/plugin/theme/src/plugin/camera/cores/camera.d.ts +3 -0
- package/dist/plugin/theme/src/plugin/camera/index.d.ts +8 -0
- package/dist/plugin/theme/src/plugin/camera/types/camera.d.ts +4 -0
- package/dist/plugin/theme/src/plugin/camera/types/index.d.ts +13 -0
- package/dist/plugin/theme/src/plugin/camera/utils/try-open-camera.d.ts +2 -0
- package/dist/plugin/theme/src/plugin/clipboard/constants/clipboard.d.ts +4 -0
- package/dist/plugin/theme/src/plugin/clipboard/cores/clipboard.d.ts +3 -0
- package/dist/plugin/theme/src/plugin/clipboard/errors/unsupported-color-error.d.ts +2 -0
- package/dist/plugin/theme/src/plugin/clipboard/index.d.ts +5 -0
- package/dist/plugin/theme/src/plugin/clipboard/types/clipboard.d.ts +4 -0
- package/dist/plugin/theme/src/plugin/clipboard/types/index.d.ts +11 -0
- package/dist/plugin/theme/src/plugin/clipboard/utils/copy.d.ts +1 -0
- package/dist/plugin/theme/src/plugin/clipboard/utils/html-string-to-plain-string.d.ts +1 -0
- package/dist/plugin/theme/src/plugin/fullscreen/cores/fullscreen.d.ts +3 -0
- package/dist/plugin/theme/src/plugin/fullscreen/index.d.ts +5 -0
- package/dist/plugin/theme/src/plugin/fullscreen/types/fullscreen.d.ts +10 -0
- package/dist/plugin/theme/src/plugin/fullscreen/types/index.d.ts +11 -0
- package/dist/plugin/theme/src/plugin/media/constants/media.d.ts +5 -0
- package/dist/plugin/theme/src/plugin/media/cores/media.d.ts +3 -0
- package/dist/plugin/theme/src/plugin/media/index.d.ts +5 -0
- package/dist/plugin/theme/src/plugin/media/types/index.d.ts +13 -0
- package/dist/plugin/theme/src/plugin/media/types/media.d.ts +4 -0
- package/dist/plugin/theme/src/plugin/media/utils/try-open-camera.d.ts +2 -0
- package/dist/plugin/theme/src/plugin/platform/cores/platform.d.ts +1 -1
- package/dist/plugin/theme/src/plugin/platform/index.d.ts +9 -3
- package/dist/plugin/theme/src/plugin/platform/types/index.d.ts +2 -2
- package/dist/plugin/theme/src/plugin/platform/types/platform.d.ts +3 -1
- package/dist/plugin/theme/src/plugin/theme/constants/theme.d.ts +1 -3
- package/dist/plugin/theme/src/plugin/theme/cores/theme.d.ts +1 -1
- package/dist/plugin/theme/src/plugin/theme/index.d.ts +15 -3
- package/dist/plugin/theme/src/plugin/theme/types/index.d.ts +4 -4
- package/dist/plugin/theme/src/plugin/theme/types/theme.d.ts +7 -7
- package/dist/plugin/theme/src/plugin/theme/utils/parse-color.d.ts +1 -1
- package/dist/plugin/theme/src/plugin/theme/utils/parse-easing-function.d.ts +1 -1
- package/dist/plugin/theme/src/types/clipboard-utils.d.ts +4 -0
- package/dist/plugin/theme/src/types/event-listener-util.d.ts +11 -0
- package/dist/plugin/theme/src/types/index.d.ts +1 -1
- package/dist/plugin/theme/src/types/native.d.ts +20 -13
- package/dist/plugin/theme/src/utils/clipboard-utils.d.ts +4 -0
- package/dist/plugin/theme/src/utils/compare-version.d.ts +1 -0
- package/dist/plugin/theme/src/utils/create-hidden-element.d.ts +1 -0
- package/dist/plugin/theme/src/utils/dispatch-click-event.d.ts +1 -0
- package/dist/plugin/theme/src/utils/event-listener-utils.d.ts +3 -0
- package/dist/plugin/theme/src/utils/fullscreen-utils.d.ts +44 -0
- package/dist/plugin/theme/src/utils/get-tag-name.d.ts +1 -0
- package/dist/plugin/theme/src/utils/get-topmost-window.d.ts +1 -0
- package/dist/plugin/theme/src/utils/is-secure-context.d.ts +1 -0
- package/dist/src/constants/platform.d.ts +17 -2
- package/dist/src/errors/plugin-not-extended-error.d.ts +2 -0
- package/dist/src/plugin/app/constants/app.d.ts +1 -2
- package/dist/src/plugin/app/cores/app.d.ts +1 -1
- package/dist/src/plugin/app/index.d.ts +10 -3
- package/dist/src/plugin/app/types/app.d.ts +7 -16
- package/dist/src/plugin/app/types/index.d.ts +4 -4
- package/dist/src/plugin/camera/constants/camera.d.ts +4 -0
- package/dist/src/plugin/camera/cores/camera.d.ts +3 -0
- package/dist/src/plugin/camera/index.d.ts +8 -0
- package/dist/src/plugin/camera/types/camera.d.ts +4 -0
- package/dist/src/plugin/camera/types/index.d.ts +13 -0
- package/dist/src/plugin/camera/utils/try-open-camera.d.ts +2 -0
- package/dist/src/plugin/clipboard/constants/clipboard.d.ts +4 -0
- package/dist/src/plugin/clipboard/cores/clipboard.d.ts +3 -0
- package/dist/src/plugin/clipboard/errors/unsupported-color-error.d.ts +2 -0
- package/dist/src/plugin/clipboard/index.d.ts +5 -0
- package/dist/src/plugin/clipboard/types/clipboard.d.ts +4 -0
- package/dist/src/plugin/clipboard/types/index.d.ts +11 -0
- package/dist/src/plugin/clipboard/utils/copy.d.ts +1 -0
- package/dist/src/plugin/clipboard/utils/html-string-to-plain-string.d.ts +1 -0
- package/dist/src/plugin/fullscreen/cores/fullscreen.d.ts +3 -0
- package/dist/src/plugin/fullscreen/index.d.ts +5 -0
- package/dist/src/plugin/fullscreen/types/fullscreen.d.ts +10 -0
- package/dist/src/plugin/fullscreen/types/index.d.ts +11 -0
- package/dist/src/plugin/media/constants/media.d.ts +5 -0
- package/dist/src/plugin/media/cores/media.d.ts +3 -0
- package/dist/src/plugin/media/index.d.ts +5 -0
- package/dist/src/plugin/media/types/index.d.ts +13 -0
- package/dist/src/plugin/media/types/media.d.ts +4 -0
- package/dist/src/plugin/media/utils/try-open-camera.d.ts +2 -0
- package/dist/src/plugin/platform/cores/platform.d.ts +1 -1
- package/dist/src/plugin/platform/index.d.ts +9 -3
- package/dist/src/plugin/platform/types/index.d.ts +2 -2
- package/dist/src/plugin/platform/types/platform.d.ts +3 -1
- package/dist/src/plugin/theme/constants/theme.d.ts +1 -3
- package/dist/src/plugin/theme/cores/theme.d.ts +1 -1
- package/dist/src/plugin/theme/index.d.ts +15 -3
- package/dist/src/plugin/theme/types/index.d.ts +4 -4
- package/dist/src/plugin/theme/types/theme.d.ts +7 -7
- package/dist/src/plugin/theme/utils/parse-color.d.ts +1 -1
- package/dist/src/plugin/theme/utils/parse-easing-function.d.ts +1 -1
- package/dist/src/types/clipboard-utils.d.ts +4 -0
- package/dist/src/types/event-listener-util.d.ts +11 -0
- package/dist/src/types/index.d.ts +1 -1
- package/dist/src/types/native.d.ts +20 -13
- package/dist/src/utils/clipboard-utils.d.ts +4 -0
- package/dist/src/utils/compare-version.d.ts +1 -0
- package/dist/src/utils/create-hidden-element.d.ts +1 -0
- package/dist/src/utils/dispatch-click-event.d.ts +1 -0
- package/dist/src/utils/event-listener-utils.d.ts +3 -0
- package/dist/src/utils/fullscreen-utils.d.ts +44 -0
- package/dist/src/utils/get-tag-name.d.ts +1 -0
- package/dist/src/utils/get-topmost-window.d.ts +1 -0
- package/dist/src/utils/is-secure-context.d.ts +1 -0
- package/package.json +22 -1
|
@@ -6,27 +6,244 @@
|
|
|
6
6
|
|
|
7
7
|
var USER_AGENT = navigator.userAgent;
|
|
8
8
|
|
|
9
|
+
var OS;
|
|
10
|
+
(function (OS) {
|
|
11
|
+
OS["Unknown"] = "Unknown";
|
|
12
|
+
OS["Android"] = "Android";
|
|
13
|
+
OS["iOS"] = "iOS";
|
|
14
|
+
OS["Windows"] = "Windows";
|
|
15
|
+
OS["MacOS"] = "MacOS";
|
|
16
|
+
})(OS || (OS = {}));
|
|
17
|
+
var Devices;
|
|
18
|
+
(function (Devices) {
|
|
19
|
+
Devices["Unknown"] = "Unknown";
|
|
20
|
+
Devices["Mobile"] = "Mobile";
|
|
21
|
+
Devices["Desktop"] = "Desktop";
|
|
22
|
+
})(Devices || (Devices = {}));
|
|
23
|
+
var Engines;
|
|
24
|
+
(function (Engines) {
|
|
25
|
+
Engines["Unknown"] = "Unknown";
|
|
26
|
+
Engines["EdgeHTML"] = "EdgeHTML";
|
|
27
|
+
Engines["ArkWeb"] = "ArkWeb";
|
|
28
|
+
Engines["Blink"] = "Blink";
|
|
29
|
+
Engines["Presto"] = "Presto";
|
|
30
|
+
Engines["WebKit"] = "WebKit";
|
|
31
|
+
Engines["Trident"] = "Trident";
|
|
32
|
+
Engines["NetFront"] = "NetFront";
|
|
33
|
+
Engines["KHTML"] = "KHTML";
|
|
34
|
+
Engines["Tasman"] = "Tasman";
|
|
35
|
+
Engines["Gecko"] = "Gecko";
|
|
36
|
+
})(Engines || (Engines = {}));
|
|
37
|
+
var Browsers;
|
|
38
|
+
(function (Browsers) {
|
|
39
|
+
Browsers["Unknown"] = "Unknown";
|
|
40
|
+
Browsers["Chrome"] = "Chrome";
|
|
41
|
+
Browsers["Safari"] = "Safari";
|
|
42
|
+
Browsers["Edge"] = "Edge";
|
|
43
|
+
Browsers["Firefox"] = "Firefox";
|
|
44
|
+
Browsers["Opera"] = "Opera";
|
|
45
|
+
Browsers["IE"] = "IE";
|
|
46
|
+
Browsers["SamsungInternet"] = "SamsungInternet";
|
|
47
|
+
})(Browsers || (Browsers = {}));
|
|
48
|
+
var DEVICE_NAME = Devices.Unknown;
|
|
49
|
+
var OS_NAME = OS.Unknown;
|
|
50
|
+
Engines.Unknown;
|
|
51
|
+
var BROWSER_NAME = Browsers.Unknown;
|
|
52
|
+
var BROWSER_VERSION = '';
|
|
53
|
+
function resolveWindowsVersion(string) {
|
|
54
|
+
if (string === undefined)
|
|
55
|
+
return '';
|
|
56
|
+
var mapped = {
|
|
57
|
+
'4.90': 'ME',
|
|
58
|
+
'NT3.51': 'NT 3.11',
|
|
59
|
+
'NT4.0': 'NT 4.0',
|
|
60
|
+
'NT 5.0': '2000',
|
|
61
|
+
'NT 5.1': 'XP',
|
|
62
|
+
'NT 5.2': 'XP',
|
|
63
|
+
'NT 6.0': 'Vista',
|
|
64
|
+
'NT 6.1': '7',
|
|
65
|
+
'NT 6.2': '8',
|
|
66
|
+
'NT 6.3': '8.1',
|
|
67
|
+
'NT 6.4': '10',
|
|
68
|
+
'NT 10.0': '10',
|
|
69
|
+
'ARM': 'RT'
|
|
70
|
+
}[string];
|
|
71
|
+
if (mapped !== undefined)
|
|
72
|
+
return mapped;
|
|
73
|
+
return string;
|
|
74
|
+
}
|
|
75
|
+
function resolveUnderscoreVersion(string) {
|
|
76
|
+
if (string === undefined)
|
|
77
|
+
return '';
|
|
78
|
+
return string.replace(/_/g, '.');
|
|
79
|
+
}
|
|
80
|
+
function resolveVersion(string, resolver) {
|
|
81
|
+
if (typeof resolver === 'function')
|
|
82
|
+
return resolver(string);
|
|
83
|
+
if (typeof resolver === 'string')
|
|
84
|
+
return resolver;
|
|
85
|
+
if (string === undefined)
|
|
86
|
+
return '';
|
|
87
|
+
return string;
|
|
88
|
+
}
|
|
89
|
+
var OS_RESOLVER_MAP = [
|
|
90
|
+
[/windows nt (6\.[23]); arm/i, OS.Windows, resolveWindowsVersion],
|
|
91
|
+
[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i, OS.Windows, resolveWindowsVersion],
|
|
92
|
+
[/windows[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i, OS.Windows, resolveWindowsVersion],
|
|
93
|
+
[/windows nt ?([\d.)]*)(?!.+xbox)/i, OS.Windows, resolveWindowsVersion],
|
|
94
|
+
[/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d.;]*)/i, OS.Windows, resolveWindowsVersion],
|
|
95
|
+
[/windows ce\/?([\d.]*)/i, OS.Windows, resolveWindowsVersion],
|
|
96
|
+
[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i, OS.iOS, resolveUnderscoreVersion],
|
|
97
|
+
[/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w.]+)/i, OS.iOS, resolveUnderscoreVersion],
|
|
98
|
+
[/cfnetwork\/.+darwin/i, OS.iOS, resolveUnderscoreVersion],
|
|
99
|
+
[/mac os x ?([\w. ]*)/i, OS.MacOS, resolveUnderscoreVersion],
|
|
100
|
+
[/(?:macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i, OS.MacOS, resolveUnderscoreVersion],
|
|
101
|
+
[/droid ([\w.]+)\b.+(android[- ]x86)/i, OS.Android],
|
|
102
|
+
[/android\w*[-\/.; ]?([\d.]*)/i, OS.Android],
|
|
103
|
+
];
|
|
104
|
+
var ENGINE_RESOLVER_MAP = [
|
|
105
|
+
[/windows.+ edge\/([\w.]+)/i, Engines.EdgeHTML],
|
|
106
|
+
[/arkweb\/([\w.]+)/i, Engines.ArkWeb],
|
|
107
|
+
[/webkit\/537\.36.+chrome\/(?!27)([\w.]+)/i, Engines.Blink],
|
|
108
|
+
[/presto\/([\w.]+)/i, Engines.Presto],
|
|
109
|
+
[/webkit\/([\w.]+)/i, Engines.WebKit],
|
|
110
|
+
[/trident\/([\w.]+)/i, Engines.Trident],
|
|
111
|
+
[/netfront\/([\w.]+)/i, Engines.NetFront],
|
|
112
|
+
[/khtml[\/ ]\(?([\w.]+)/i, Engines.KHTML],
|
|
113
|
+
[/tasman[\/ ]\(?([\w.]+)/i, Engines.Tasman],
|
|
114
|
+
[/rv:([\w.]{1,9})\b.+gecko/i, Engines.Gecko]
|
|
115
|
+
];
|
|
116
|
+
var BROWSER_RESOLVER_MAP = [
|
|
117
|
+
[/\b(?:crmo|crios)\/([\w.]+)/i, Browsers.Chrome],
|
|
118
|
+
[/webview.+edge\/([\w.]+)/i, Browsers.Edge],
|
|
119
|
+
[/edg(?:e|ios|a)?\/([\w.]+)/i, Browsers.Edge],
|
|
120
|
+
[/opera mini\/([-\w.]+)/i, Browsers.Opera],
|
|
121
|
+
[/opera [mobileta]{3,6}\b.+version\/([-\w.]+)/i, Browsers.Opera],
|
|
122
|
+
[/opera(?:.+version\/|[\/ ]+)([\w.]+)/i, Browsers.Opera],
|
|
123
|
+
[/opios[\/ ]+([\w.]+)/i, Browsers.Opera],
|
|
124
|
+
[/\bop(?:rg)?x\/([\w.]+)/i, Browsers.Opera],
|
|
125
|
+
[/\bopr\/([\w.]+)/i, Browsers.Opera],
|
|
126
|
+
[/iemobile(?:browser|boat|jet)[\/ ]?([\d.]*)/i, Browsers.IE],
|
|
127
|
+
[/(?:ms|\()ie ([\w.]+)/i, Browsers.IE],
|
|
128
|
+
[/trident.+rv[: ]([\w.]{1,9})\b.+like gecko/i, Browsers.IE],
|
|
129
|
+
[/\bfocus\/([\w.]+)/i, Browsers.Firefox],
|
|
130
|
+
[/\bopt\/([\w.]+)/i, Browsers.Opera],
|
|
131
|
+
[/coast\/([\w.]+)/i, Browsers.Opera],
|
|
132
|
+
[/fxios\/([\w.-]+)/i, Browsers.Firefox],
|
|
133
|
+
[/samsungbrowser\/([\w.]+)/i, Browsers.SamsungInternet],
|
|
134
|
+
[/headlesschrome(?:\/([\w.]+)| )/i, Browsers.Chrome],
|
|
135
|
+
[/wv\).+chrome\/([\w.]+).+edgw\//i, Browsers.Edge],
|
|
136
|
+
[/ wv\).+(chrome)\/([\w.]+)/i, Browsers.Chrome],
|
|
137
|
+
[/chrome\/([\w.]+) mobile/i, Browsers.Chrome],
|
|
138
|
+
[/chrome\/v?([\w.]+)/i, Browsers.Chrome],
|
|
139
|
+
[/version\/([\w.,]+) .*mobile(?:\/\w+ | ?)safari/i, Browsers.Safari],
|
|
140
|
+
[/iphone .*mobile(?:\/\w+ | ?)safari/i, Browsers.Safari],
|
|
141
|
+
[/version\/([\w.,]+) .*safari/i, Browsers.Safari],
|
|
142
|
+
[/webkit.+?(?:mobile ?safari|safari)(\/[\w.]+)/i, Browsers.Safari, '1'],
|
|
143
|
+
[/(?:mobile|tablet);.*firefox\/([\w.-]+)/i, Browsers.Firefox],
|
|
144
|
+
[/mobile vr; rv:([\w.]+)\).+firefox/i, Browsers.Firefox],
|
|
145
|
+
[/firefox\/([\w.]+)/i, Browsers.Firefox],
|
|
146
|
+
];
|
|
147
|
+
for (var i = 0; i < OS_RESOLVER_MAP.length; i++) {
|
|
148
|
+
var map = OS_RESOLVER_MAP[i];
|
|
149
|
+
var regexp = map[0];
|
|
150
|
+
var os = map[1];
|
|
151
|
+
var resolver = map[2];
|
|
152
|
+
var matched = USER_AGENT.match(regexp);
|
|
153
|
+
if (matched !== null) {
|
|
154
|
+
OS_NAME = os;
|
|
155
|
+
resolveVersion(matched[1], resolver);
|
|
156
|
+
if (os === OS.iOS || os === OS.Android)
|
|
157
|
+
DEVICE_NAME = Devices.Mobile;
|
|
158
|
+
else if (os === OS.Windows || os === OS.MacOS)
|
|
159
|
+
DEVICE_NAME = Devices.Desktop;
|
|
160
|
+
break;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
for (var i = 0; i < ENGINE_RESOLVER_MAP.length; i++) {
|
|
164
|
+
var map = ENGINE_RESOLVER_MAP[i];
|
|
165
|
+
var regexp = map[0];
|
|
166
|
+
map[1];
|
|
167
|
+
var resolver = map[2];
|
|
168
|
+
var matched = USER_AGENT.match(regexp);
|
|
169
|
+
if (matched !== null) {
|
|
170
|
+
resolveVersion(matched[1], resolver);
|
|
171
|
+
break;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
for (var i = 0; i < BROWSER_RESOLVER_MAP.length; i++) {
|
|
175
|
+
var map = BROWSER_RESOLVER_MAP[i];
|
|
176
|
+
var regexp = map[0];
|
|
177
|
+
var browser = map[1];
|
|
178
|
+
var resolver = map[2];
|
|
179
|
+
var matched = USER_AGENT.match(regexp);
|
|
180
|
+
if (matched !== null) {
|
|
181
|
+
BROWSER_NAME = browser;
|
|
182
|
+
BROWSER_VERSION = resolveVersion(matched[1], resolver);
|
|
183
|
+
break;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
((function () {
|
|
187
|
+
var canvas = globalThis.document.createElement('canvas');
|
|
188
|
+
if (typeof canvas.getContext !== 'function')
|
|
189
|
+
return '';
|
|
190
|
+
var context = canvas.getContext('webgl2') || canvas.getContext('experimental-webgl') || canvas.getContext('webgl');
|
|
191
|
+
if (context === null)
|
|
192
|
+
return '';
|
|
193
|
+
if (context instanceof WebGLRenderingContext || 'getParameter' in context && typeof context.getParameter === 'function') {
|
|
194
|
+
var extension = context.getExtension('WEBGL_debug_renderer_info');
|
|
195
|
+
if (extension === null)
|
|
196
|
+
return context.getParameter(context.RENDERER);
|
|
197
|
+
else
|
|
198
|
+
return context.getParameter(extension.UNMASKED_RENDERER_WEBGL);
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
return '';
|
|
202
|
+
}
|
|
203
|
+
}))();
|
|
204
|
+
var IS_MOBILE = DEVICE_NAME === Devices.Mobile;
|
|
205
|
+
DEVICE_NAME === Devices.Desktop;
|
|
206
|
+
var IS_STANDALONE = (function () {
|
|
207
|
+
if (OS_NAME === OS.iOS)
|
|
208
|
+
return 'standalone' in navigator && !!navigator.standalone;
|
|
209
|
+
else
|
|
210
|
+
return globalThis.matchMedia('(display-mode: standalone)').matches;
|
|
211
|
+
})();
|
|
212
|
+
|
|
213
|
+
function compareVersion(lhs, rhs) {
|
|
214
|
+
var pa = lhs.split('.');
|
|
215
|
+
var pb = rhs.split('.');
|
|
216
|
+
var length = Math.max(pa.length, pb.length);
|
|
217
|
+
for (var i = 0; i < length; i++) {
|
|
218
|
+
var a = void 0;
|
|
219
|
+
var b = void 0;
|
|
220
|
+
if (i < pa.length)
|
|
221
|
+
a = parseInt(pa[i], 10);
|
|
222
|
+
else
|
|
223
|
+
a = 0;
|
|
224
|
+
if (i < pb.length)
|
|
225
|
+
b = parseInt(pb[i], 10);
|
|
226
|
+
else
|
|
227
|
+
b = 0;
|
|
228
|
+
if (a > b)
|
|
229
|
+
return 1;
|
|
230
|
+
if (a < b)
|
|
231
|
+
return -1;
|
|
232
|
+
}
|
|
233
|
+
return 0;
|
|
234
|
+
}
|
|
235
|
+
|
|
9
236
|
var Appearances;
|
|
10
237
|
(function (Appearances) {
|
|
11
238
|
Appearances["Unknown"] = "unknown";
|
|
12
239
|
Appearances["Light"] = "light";
|
|
13
240
|
Appearances["Dark"] = "dark";
|
|
14
241
|
})(Appearances || (Appearances = {}));
|
|
15
|
-
var
|
|
16
|
-
var matched = USER_AGENT.match(/chrome\/([\w.]+) mobile/i);
|
|
17
|
-
if (matched === null)
|
|
18
|
-
return NaN;
|
|
19
|
-
var version = parseInt(matched[1]);
|
|
20
|
-
if (isNaN(version))
|
|
21
|
-
return NaN;
|
|
22
|
-
return version;
|
|
23
|
-
})();
|
|
24
|
-
var MEDIA_QUERY_LIST = window.matchMedia('(prefers-color-scheme: dark)');
|
|
242
|
+
var MEDIA_QUERY_LIST = globalThis.matchMedia('(prefers-color-scheme: dark)');
|
|
25
243
|
var SUPPORT_PREFERS_COLOR_SCHEME = MEDIA_QUERY_LIST.media !== 'not all';
|
|
26
|
-
var IS_FULL_SUPPORT_THEME_COLOR =
|
|
27
|
-
var CONTEXT = document.createElement('canvas').getContext('2d', { willReadFrequently: true });
|
|
244
|
+
var IS_FULL_SUPPORT_THEME_COLOR = BROWSER_NAME !== Browsers.Chrome || (IS_MOBILE && compareVersion(BROWSER_VERSION, '92') >= 0);
|
|
245
|
+
var CONTEXT = globalThis.document.createElement('canvas').getContext('2d', { willReadFrequently: true });
|
|
28
246
|
var SVG_PIXEL_DATA_URL = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxyZWN0IHdpZHRoPSIxIiBoZWlnaHQ9IjEiIGZpbGw9IndoaXRlIi8+PC9zdmc+';
|
|
29
|
-
var IS_SAMSUNG = /Samsung/i.test(USER_AGENT);
|
|
30
247
|
var IS_IE_MOBILE = /iemobile/i.test(USER_AGENT);
|
|
31
248
|
var IS_WINDOWS_PHONE = /windows phone/i.test(USER_AGENT);
|
|
32
249
|
var ENTRIES = [];
|
|
@@ -298,8 +515,8 @@
|
|
|
298
515
|
points.push({ position: 1, value: 1 });
|
|
299
516
|
return points;
|
|
300
517
|
}
|
|
301
|
-
function getLinearValue(
|
|
302
|
-
var points = parseLinear(
|
|
518
|
+
function getLinearValue(string) {
|
|
519
|
+
var points = parseLinear(string);
|
|
303
520
|
return function (t) {
|
|
304
521
|
t = clamp(t, 0, 1);
|
|
305
522
|
if (t <= points[0].position)
|
|
@@ -376,6 +593,58 @@
|
|
|
376
593
|
|
|
377
594
|
var UnsupportedColorError = createCustomError('UnsupportedColorError');
|
|
378
595
|
|
|
596
|
+
function createHiddenElement(tagName, focusable) {
|
|
597
|
+
if (focusable === void 0) { focusable = true; }
|
|
598
|
+
var element = globalThis.document.createElement(tagName);
|
|
599
|
+
if ('width' in element)
|
|
600
|
+
element.width = '0';
|
|
601
|
+
if ('height' in element)
|
|
602
|
+
element.height = '0';
|
|
603
|
+
if ('border' in element)
|
|
604
|
+
element.border = '0';
|
|
605
|
+
if ('frameBorder' in element)
|
|
606
|
+
element.frameBorder = '0';
|
|
607
|
+
if ('scrolling' in element)
|
|
608
|
+
element.scrolling = 'no';
|
|
609
|
+
if ('cellPadding' in element)
|
|
610
|
+
element.cellPadding = '0';
|
|
611
|
+
if ('cellSpacing' in element)
|
|
612
|
+
element.cellSpacing = '0';
|
|
613
|
+
if ('frame' in element)
|
|
614
|
+
element.frame = 'void';
|
|
615
|
+
if ('rules' in element)
|
|
616
|
+
element.rules = 'none';
|
|
617
|
+
if ('noWrap' in element)
|
|
618
|
+
element.noWrap = true;
|
|
619
|
+
element.tabIndex = -1;
|
|
620
|
+
element.setAttribute('role', 'presentation');
|
|
621
|
+
if (focusable) {
|
|
622
|
+
element.style.width = '1px';
|
|
623
|
+
element.style.height = '1px';
|
|
624
|
+
}
|
|
625
|
+
else {
|
|
626
|
+
element.setAttribute('aria-hidden', 'true');
|
|
627
|
+
element.style.width = '0';
|
|
628
|
+
element.style.height = '0';
|
|
629
|
+
element.style.zIndex = '-9999';
|
|
630
|
+
element.style.display = 'none';
|
|
631
|
+
element.style.visibility = 'hidden';
|
|
632
|
+
element.style.pointerEvents = 'none';
|
|
633
|
+
}
|
|
634
|
+
element.style.position = 'absolute';
|
|
635
|
+
element.style.top = '0';
|
|
636
|
+
element.style.left = '0';
|
|
637
|
+
element.style.padding = '0';
|
|
638
|
+
element.style.margin = '0';
|
|
639
|
+
element.style.border = 'none';
|
|
640
|
+
element.style.outline = 'none';
|
|
641
|
+
element.style.clip = 'rect(1px, 1px, 1px, 1px)';
|
|
642
|
+
element.style.clipPath = 'inset(50%)';
|
|
643
|
+
element.style.overflow = 'hidden';
|
|
644
|
+
element.style.whiteSpace = 'nowrap';
|
|
645
|
+
return element;
|
|
646
|
+
}
|
|
647
|
+
|
|
379
648
|
function parseColor(color) {
|
|
380
649
|
if (typeof CSS !== 'undefined' && CSS.supports && !CSS.supports('color', color))
|
|
381
650
|
throw new UnsupportedColorError('Unsupported color: \"' + color + '\".');
|
|
@@ -395,16 +664,11 @@
|
|
|
395
664
|
catch (_) {
|
|
396
665
|
}
|
|
397
666
|
}
|
|
398
|
-
var div =
|
|
399
|
-
div.style.position = 'absolute';
|
|
400
|
-
div.style.top = '-9999px';
|
|
401
|
-
div.style.left = '-9999px';
|
|
402
|
-
div.style.width = '1px';
|
|
403
|
-
div.style.height = '1px';
|
|
667
|
+
var div = createHiddenElement('div');
|
|
404
668
|
div.style.color = color;
|
|
405
|
-
document.body.appendChild(div);
|
|
669
|
+
globalThis.document.body.appendChild(div);
|
|
406
670
|
try {
|
|
407
|
-
var computedColor =
|
|
671
|
+
var computedColor = globalThis.getComputedStyle(div).color;
|
|
408
672
|
var legacyMatch = computedColor.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\s*\)/);
|
|
409
673
|
var modernMatch = computedColor.match(/rgba?\(\s*(\d+)\s+(\d+)\s+(\d+)\s*(?:\/\s*([\d.]+%?))?\s*\)/);
|
|
410
674
|
var matched = legacyMatch || modernMatch;
|
|
@@ -415,11 +679,11 @@
|
|
|
415
679
|
var blue = parseInt(matched[3], 10);
|
|
416
680
|
var alpha = 1;
|
|
417
681
|
if (matched[4] !== undefined) {
|
|
418
|
-
var
|
|
419
|
-
if (
|
|
420
|
-
alpha = parseFloat((parseFloat(
|
|
682
|
+
var alphaString = matched[4];
|
|
683
|
+
if (alphaString.charAt(alphaString.length - 1) === '%')
|
|
684
|
+
alpha = parseFloat((parseFloat(alphaString) / 100).toFixed(2));
|
|
421
685
|
else
|
|
422
|
-
alpha = parseFloat(parseFloat(
|
|
686
|
+
alpha = parseFloat(parseFloat(alphaString).toFixed(2));
|
|
423
687
|
}
|
|
424
688
|
if (isNaN(red) || isNaN(green) || isNaN(blue) || isNaN(alpha))
|
|
425
689
|
throw new UnsupportedColorError('Failed to parse color values from: \"' + color + '\".');
|
|
@@ -431,7 +695,7 @@
|
|
|
431
695
|
};
|
|
432
696
|
}
|
|
433
697
|
finally {
|
|
434
|
-
document.body.removeChild(div);
|
|
698
|
+
globalThis.document.body.removeChild(div);
|
|
435
699
|
}
|
|
436
700
|
}
|
|
437
701
|
|
|
@@ -457,7 +721,7 @@
|
|
|
457
721
|
var meta = themeColorMetaGroup[effective];
|
|
458
722
|
if (meta !== undefined)
|
|
459
723
|
return meta;
|
|
460
|
-
meta = document.createElement('meta');
|
|
724
|
+
meta = globalThis.document.createElement('meta');
|
|
461
725
|
if (IS_IE_MOBILE)
|
|
462
726
|
meta.setAttribute('name', 'msapplication-navbutton-color');
|
|
463
727
|
else if (IS_WINDOWS_PHONE)
|
|
@@ -466,20 +730,20 @@
|
|
|
466
730
|
meta.setAttribute('name', 'theme-color');
|
|
467
731
|
if (appearance !== 'default')
|
|
468
732
|
meta.setAttribute('media', '(prefers-color-scheme: ' + effective + ')');
|
|
469
|
-
document.head.prepend(meta);
|
|
733
|
+
globalThis.document.head.prepend(meta);
|
|
470
734
|
return themeColorMetaGroup[appearance] = meta;
|
|
471
735
|
}
|
|
472
736
|
function estimateDefaultThemeColor() {
|
|
473
|
-
if (
|
|
474
|
-
if (
|
|
737
|
+
if (BROWSER_NAME === Browsers.Safari) {
|
|
738
|
+
if (IS_STANDALONE) {
|
|
475
739
|
if (detectFromMediaQuery() === Appearances.Dark)
|
|
476
740
|
return '#ffffffff';
|
|
477
741
|
else
|
|
478
742
|
return '#000000ff';
|
|
479
743
|
}
|
|
480
|
-
return rgbaToHex(parseColor(
|
|
744
|
+
return rgbaToHex(parseColor(globalThis.getComputedStyle(globalThis.document.body).backgroundColor));
|
|
481
745
|
}
|
|
482
|
-
if (
|
|
746
|
+
if (BROWSER_NAME === Browsers.Chrome) {
|
|
483
747
|
if (detectFromMediaQuery() === Appearances.Dark)
|
|
484
748
|
return '#28292cff';
|
|
485
749
|
else
|
|
@@ -490,9 +754,12 @@
|
|
|
490
754
|
function toHex(n) {
|
|
491
755
|
var hex = n.toString(16);
|
|
492
756
|
switch (hex.length) {
|
|
493
|
-
case 0:
|
|
494
|
-
|
|
495
|
-
|
|
757
|
+
case 0:
|
|
758
|
+
return '00';
|
|
759
|
+
case 1:
|
|
760
|
+
return '0' + hex;
|
|
761
|
+
default:
|
|
762
|
+
return hex;
|
|
496
763
|
}
|
|
497
764
|
}
|
|
498
765
|
function rgbaToHex(rgba) {
|
|
@@ -533,7 +800,7 @@
|
|
|
533
800
|
.then(function (appearance) {
|
|
534
801
|
currentAppearance = appearance;
|
|
535
802
|
});
|
|
536
|
-
appearanceIntervalId =
|
|
803
|
+
appearanceIntervalId = globalThis.setInterval(function () {
|
|
537
804
|
detectFromEngine()
|
|
538
805
|
.then(function (appearance) {
|
|
539
806
|
if (appearance !== currentAppearance) {
|
|
@@ -586,7 +853,7 @@
|
|
|
586
853
|
if (index !== -1)
|
|
587
854
|
ENTRIES.splice(index, 1);
|
|
588
855
|
if (ENTRIES.length === 0) {
|
|
589
|
-
if (
|
|
856
|
+
if (BROWSER_NAME === Browsers.SamsungInternet)
|
|
590
857
|
stopPolling();
|
|
591
858
|
else
|
|
592
859
|
removeListener(entry.capture);
|
|
@@ -607,7 +874,7 @@
|
|
|
607
874
|
selector = 'meta[name=\"msapplication-TileColor\"]';
|
|
608
875
|
else
|
|
609
876
|
selector = 'meta[name=\"theme-color\"]';
|
|
610
|
-
var nodes = document.querySelectorAll(selector);
|
|
877
|
+
var nodes = globalThis.document.querySelectorAll(selector);
|
|
611
878
|
if (!IS_FULL_SUPPORT_THEME_COLOR || !SUPPORT_PREFERS_COLOR_SCHEME || IS_IE_MOBILE || IS_WINDOWS_PHONE) {
|
|
612
879
|
themeColorMetaGroup.default = nodes[0];
|
|
613
880
|
return;
|
|
@@ -627,12 +894,12 @@
|
|
|
627
894
|
}
|
|
628
895
|
function getCurrentAppliedThemeColorMeta() {
|
|
629
896
|
if (IS_IE_MOBILE)
|
|
630
|
-
return document.querySelector('meta[name=\"msapplication-navbutton-color\"]');
|
|
897
|
+
return globalThis.document.querySelector('meta[name=\"msapplication-navbutton-color\"]');
|
|
631
898
|
if (IS_WINDOWS_PHONE)
|
|
632
|
-
return document.querySelector('meta[name=\"msapplication-TileColor\"]');
|
|
899
|
+
return globalThis.document.querySelector('meta[name=\"msapplication-TileColor\"]');
|
|
633
900
|
if (!IS_FULL_SUPPORT_THEME_COLOR || !SUPPORT_PREFERS_COLOR_SCHEME)
|
|
634
|
-
return document.querySelector('meta[name=\"theme-color\"]');
|
|
635
|
-
var nodes = document.querySelectorAll('meta[name=\"theme-color\"]');
|
|
901
|
+
return globalThis.document.querySelector('meta[name=\"theme-color\"]');
|
|
902
|
+
var nodes = globalThis.document.querySelectorAll('meta[name=\"theme-color\"]');
|
|
636
903
|
var isDark = detectFromMediaQuery() === Appearances.Dark;
|
|
637
904
|
var query;
|
|
638
905
|
if (isDark)
|
|
@@ -667,7 +934,7 @@
|
|
|
667
934
|
MEDIA_QUERY_LIST.addEventListener('change', syncThemeColorMeta);
|
|
668
935
|
else if (typeof MEDIA_QUERY_LIST.addListener === 'function')
|
|
669
936
|
MEDIA_QUERY_LIST.addListener(syncThemeColorMeta);
|
|
670
|
-
observer.observe(document.head, { childList: true });
|
|
937
|
+
observer.observe(globalThis.document.head, { childList: true });
|
|
671
938
|
syncThemeColorMeta();
|
|
672
939
|
}
|
|
673
940
|
init();
|
|
@@ -677,7 +944,7 @@
|
|
|
677
944
|
var easingFn = parseEasingFunction(options.easingFunction);
|
|
678
945
|
var appearance = options.appearance;
|
|
679
946
|
if (themeIntervalId !== null) {
|
|
680
|
-
|
|
947
|
+
globalThis.cancelAnimationFrame(themeIntervalId);
|
|
681
948
|
themeIntervalId = null;
|
|
682
949
|
if (currentResolve !== null) {
|
|
683
950
|
currentResolve(getThemeColor());
|
|
@@ -719,7 +986,7 @@
|
|
|
719
986
|
};
|
|
720
987
|
getThemeColorMeta(appearance).setAttribute('content', rgbaToHex(current));
|
|
721
988
|
if (t < 1) {
|
|
722
|
-
themeIntervalId =
|
|
989
|
+
themeIntervalId = globalThis.requestAnimationFrame(animate);
|
|
723
990
|
}
|
|
724
991
|
else {
|
|
725
992
|
themeIntervalId = null;
|
|
@@ -729,7 +996,7 @@
|
|
|
729
996
|
}
|
|
730
997
|
}
|
|
731
998
|
}
|
|
732
|
-
themeIntervalId =
|
|
999
|
+
themeIntervalId = globalThis.requestAnimationFrame(animate);
|
|
733
1000
|
});
|
|
734
1001
|
}
|
|
735
1002
|
function getThemeColor() {
|
|
@@ -746,7 +1013,7 @@
|
|
|
746
1013
|
themeColorMetaGroup[appearance] = undefined;
|
|
747
1014
|
}
|
|
748
1015
|
function detectAppearance() {
|
|
749
|
-
if (
|
|
1016
|
+
if (BROWSER_NAME === Browsers.SamsungInternet)
|
|
750
1017
|
return detectFromEngine();
|
|
751
1018
|
else
|
|
752
1019
|
return Promise.resolve(detectFromMediaQuery());
|
|
@@ -766,7 +1033,7 @@
|
|
|
766
1033
|
if (index === -1) {
|
|
767
1034
|
ENTRIES.push(entry);
|
|
768
1035
|
if (ENTRIES.length === 1) {
|
|
769
|
-
if (
|
|
1036
|
+
if (BROWSER_NAME === Browsers.SamsungInternet)
|
|
770
1037
|
startPolling();
|
|
771
1038
|
else
|
|
772
1039
|
addListener(entry.capture);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Theme=t()}(this,(function(){"use strict";var e,t=navigator.userAgent;!function(e){e.Unknown="unknown",e.Light="light",e.Dark="dark"}(e||(e={}));var r=function(){var e=t.match(/chrome\/([\w.]+) mobile/i);if(null===e)return NaN;var r=parseInt(e[1]);return isNaN(r)?NaN:r}(),n=window.matchMedia("(prefers-color-scheme: dark)"),o="not all"!==n.media,a=isNaN(r)||r>=92,i=document.createElement("canvas").getContext("2d",{willReadFrequently:!0}),u=/Samsung/i.test(t),l=/iemobile/i.test(t),s=/windows phone/i.test(t),c=[];function f(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function d(e,t){function r(n){if(!(this instanceof r))return new r(n);var o=new t(n||"");if("function"==typeof Object.setPrototypeOf?Object.setPrototypeOf(o,r.prototype):o.__proto__=r.prototype,o.name=e,void 0!==n&&(o.message=n),"undefined"!=typeof Symbol&&Symbol.toStringTag)try{Object.defineProperty(o,Symbol.toStringTag,{value:e,writable:!1,enumerable:!1,configurable:!0})}catch(e){}if("function"==typeof Error.captureStackTrace)Error.captureStackTrace(o,r);else if(t.captureStackTrace&&"function"==typeof t.captureStackTrace)t.captureStackTrace(o,r);else try{var a=new t;a.stack&&(o.stack=a.stack)}catch(e){}return o}void 0===t&&(t=Error),r.prototype=Object.create(t.prototype,{constructor:{value:r,writable:!0,enumerable:!1,configurable:!0}});try{Object.defineProperty(r.prototype,"name",{value:e,writable:!0,enumerable:!1,configurable:!0})}catch(t){try{r.prototype.name=e}catch(e){}}try{Object.defineProperty(r,"name",{value:e,writable:!1,enumerable:!1,configurable:!0})}catch(e){}return r}"function"==typeof SuppressedError&&SuppressedError;var p=d("EasingError"),m=d("CubicBezierSyntaxError",p),v=d("LinearSyntaxError",p),h=d("StepSyntaxError",p),b=d("UnsupportedEasingFunctionError",p),g={linear:"linear(0, 1)",ease:"cubic-bezier(0.25, 0.1, 0.25, 1)","ease-in":"cubic-bezier(0.42, 0, 1, 1)","ease-out":"cubic-bezier(0, 0, 0.58, 1)","ease-in-out":"cubic-bezier(0.42, 0, 0.58, 1)","step-start":"steps(1, jump-start)","step-end":"steps(1, jump-end)"};function y(e,t,r){return e<t?t:e>r?r:e}function w(e){var t=function(e){var t=e.match(/cubic-bezier\((.*)\)/);if(null===t)throw new m("Invalid cubic-bezier syntax");var r=t[1].trim().split(","),n=[];if(4!==r.length)throw new m("Cubic-bezier must have exactly 4 numeric values");for(var o=0;o<4;o++){var a=parseFloat(r[o]);if(isNaN(a))throw new m("Cubic-bezier must have exactly 4 numeric values");if(o%2==0&&(a<0||a>1))throw new m("x1 and x2 must be between 0 and 1");n.push(a)}return{x1:n[0],y1:n[1],x2:n[2],y2:n[3]}}(e),r=t.x1,n=t.x2,o=t.y1,a=t.y2;return function(e){if(0===(e=y(e,0,1))||1===e)return e;var t=function(e,t,o){if(void 0===t&&(t=1e-6),void 0===o&&(o=50),e<=0)return 0;if(e>=1)return 1;for(var a=e,i=0;i<o;i++){var u=3*(1-a)*(1-a)*a*r+3*(1-a)*a*a*n+a*a*a,l=3*(1-a)*(1-a)*r+6*(1-a)*a*(n-r)+3*a*a*(1-n);if(Math.abs(l)<t)break;var s=a-(u-e)/l;if(Math.abs(s-a)<t){a=s;break}a=Math.max(0,Math.min(1,s))}return a}(e);return 3*(1-t)*(1-t)*t*o+3*(1-t)*t*t*a+t*t*t}}function S(e){var t=function(e){var t,r,n=e.match(/linear\((.*)\)/);if(null===n)throw new v("Invalid linear syntax");var o=n[1].trim();if(""===o)throw new v("Linear function must have at least one point");for(var a=o.split(","),i=[],u=0;u<a.length;u++){var l=a[u].trim(),s=l.match(/^([+-]?\d*\.?\d+)((?:\s+[+-]?\d*\.?\d+%){2,})$/);if(null===s){var c=l.match(/^([+-]?\d*\.?\d+)\s+([+-]?\d*\.?\d+)%$/);if(null===c){var d=l.match(/^([+-]?\d*\.?\d+)$/);if(null===d)throw new v('Invalid linear point format: "'+l+'"');i.push({position:1===a.length?0:u/(a.length-1),value:parseFloat(d[1])})}else i.push({position:parseFloat(c[2])/100,value:parseFloat(c[1])})}else{var p=parseFloat(s[1]),m=s[2].trim().split(/\s+/);try{for(var h=(t=void 0,f(m)),b=h.next();!b.done;b=h.next()){var g=b.value;i.push({value:p,position:parseFloat(g)/100})}}catch(e){t={error:e}}finally{try{b&&!b.done&&(r=h.return)&&r.call(h)}finally{if(t)throw t.error}}}}if(0===i.length)throw new v("No valid points found in linear function");return i.sort((function(e,t){return e.position-t.position})),i[0].position>0&&i.unshift({position:0,value:0}),i[i.length-1].position<1&&i.push({position:1,value:1}),i}(e);return function(e){if((e=y(e,0,1))<=t[0].position)return t[0].value;if(e>=t[t.length-1].position)return t[t.length-1].value;for(var r=0;r<t.length-1;r++){var n=t[r],o=t[r+1];if(e>=n.position&&e<=o.position){if(n.position===o.position)return o.value;var a=(e-n.position)/(o.position-n.position);return n.value+(o.value-n.value)*a}}return t[t.length-1].value}}function x(e){if(function(e){return!/(linear|cubic-bezier|steps)\((.*)\)/.test(e)}(e)&&(e=g[e]),function(e){return/cubic-bezier\(/.test(e)}(e))return w(e);if(function(e){return/linear\(/.test(e)}(e))return S(e);if(function(e){return/steps\(\s*(\d+)\s*(?:,\s*(jump-start|jump-end|jump-none|jump-both|start|end)\s*)?\)$/.test(e)}(e))return function(e){var t=e.match(/steps\(\s*(\d+)\s*(?:,\s*(jump-start|jump-end|jump-none|jump-both|start|end)\s*)?\)$/);if(null===t)throw new h("Invalid steps syntax");var r=parseInt(t[1],10),n=t[2];if(r<=0)throw new h("Steps count must be a positive integer");if("jump-none"===n&&r<2)throw new h("jump-none requires at least 2 steps");return function(e){switch(e=y(e,0,1),n){case"start":case"jump-start":return 0===e?1/r:1===e?1:Math.ceil(e*r)/r;case void 0:case"end":case"jump-end":return 1===e?1:Math.floor(e*r)/r;case"jump-both":return 0===e?0:1===e?1:Math.round(e*(r+1))/(r+1);case"jump-none":return 0===e?0:1===e?1:Math.floor(e*(r-1))/(r-1);default:throw new h('Unsupported step position: "'+n+'"')}}}(e);throw new b('Unsupported easing function: "'+e+'"')}var E=d("UnsupportedColorError");function k(e){if("undefined"!=typeof CSS&&CSS.supports&&!CSS.supports("color",e))throw new E('Unsupported color: "'+e+'".');if(null!==i)try{i.clearRect(0,0,1,1),i.fillStyle=e,i.fillRect(0,0,1,1);var t=i.getImageData(0,0,1,1).data;return{red:t[0],green:t[1],blue:t[2],alpha:parseFloat((t[3]/255).toFixed(2))}}catch(e){}var r=document.createElement("div");r.style.position="absolute",r.style.top="-9999px",r.style.left="-9999px",r.style.width="1px",r.style.height="1px",r.style.color=e,document.body.appendChild(r);try{var n=window.getComputedStyle(r).color,o=n.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\s*\)/),a=n.match(/rgba?\(\s*(\d+)\s+(\d+)\s+(\d+)\s*(?:\/\s*([\d.]+%?))?\s*\)/),u=o||a;if(null===u)throw new E('Unsupported color: "'+e+'".');var l=parseInt(u[1],10),s=parseInt(u[2],10),c=parseInt(u[3],10),f=1;if(void 0!==u[4]){var d=u[4];f="%"===d.charAt(d.length-1)?parseFloat((parseFloat(d)/100).toFixed(2)):parseFloat(parseFloat(d).toFixed(2))}if(isNaN(l)||isNaN(s)||isNaN(c)||isNaN(f))throw new E('Failed to parse color values from: "'+e+'".');return{red:l,green:s,blue:c,alpha:f}}finally{document.body.removeChild(r)}}var j,C={},L=null,I=null,F=null,M=null,N={setThemeColor:function(t,r){void 0===r&&(r={duration:0,easingFunction:"linear",appearance:"default"});var n=r.duration,i=x(r.easingFunction),u=r.appearance;null!==L&&(window.cancelAnimationFrame(L),L=null,null!==I&&(I(R()),I=null));var c=R();void 0===c&&(c=void 0!==r.defaultColor?r.defaultColor:P()===e.Dark?"#181818ff":"#dcdcdcff");var f=k(c),d=k(t);return new Promise((function(e){I=e;var t=null;L=window.requestAnimationFrame((function r(c){null===t&&(t=c);var p,m=c-t;p=0===n?1:Math.min(m/n,1);var v=i(p),h={red:Math.round(f.red+(d.red-f.red)*v),green:Math.round(f.green+(d.green-f.green)*v),blue:Math.round(f.blue+(d.blue-f.blue)*v),alpha:+(f.alpha+(d.alpha-f.alpha)*v).toFixed(2)};(function(e){void 0===e&&(e="default");var t;t=!a||!o||l||s?"default":e;var r=C[t];if(void 0!==r)return r;r=document.createElement("meta"),l?r.setAttribute("name","msapplication-navbutton-color"):s?r.setAttribute("name","msapplication-TileColor"):r.setAttribute("name","theme-color");"default"!==e&&r.setAttribute("media","(prefers-color-scheme: "+t+")");return document.head.prepend(r),C[e]=r})(u).setAttribute("content",T(h)),p<1?L=window.requestAnimationFrame(r):(L=null,null!==I&&(e(R()),L=null))}))}))},getThemeColor:R,removeThemeColor:function(e){void 0===e&&(e="default");var t=C[e];void 0!==t&&t.remove();C[e]=void 0},detectAppearance:function(){return u?z():Promise.resolve(P())},onAppearanceChange:function(e,t){void 0===t&&(t=!1);var r={fn:e,capture:!1,once:!1};"boolean"==typeof t&&(t={capture:t});void 0!==t.capture&&(r.capture=t.capture);void 0!==t.once&&(r.once=t.once);void 0!==t.signal&&(r.signal=t.signal);var o=q(r);-1===o?(c.push(r),1===c.length&&(u?(z().then((function(e){F=e})),M=window.setInterval((function(){z().then((function(e){e!==F&&(F=e,U(e))}))}),2e3)):(a=r.capture,F=P(),"function"==typeof n.addEventListener?n.addEventListener("change",D,a):"function"==typeof n.addListener&&n.addListener(D))),this.detectAppearance().then(U)):c[o].once&&!r.once&&(c[o].once=!1);var a;void 0!==r.signal&&(r.signal.aborted?O(r):r.signal.addEventListener("abort",(function e(){void 0!==r.signal&&r.signal.removeEventListener("abort",e),O(r)})));return function(){O(r)}}};function A(e){var t=e.toString(16);switch(t.length){case 0:return"00";case 1:return"0"+t;default:return t}}function T(e){return"#"+A(e.red)+A(e.green)+A(e.blue)+A(Math.round(255*e.alpha))}function z(){return new Promise((function(t){var r=new Image;r.onload=function(){if(null===i)return t(e.Light);i.drawImage(r,0,0);var n=i.getImageData(0,0,1,1).data;(n[0]&n[1]&n[2])<255?t(e.Dark):t(e.Light)},r.onerror=function(){t(e.Unknown)},r.src="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxyZWN0IHdpZHRoPSIxIiBoZWlnaHQ9IjEiIGZpbGw9IndoaXRlIi8+PC9zdmc+"}))}function P(){return o?n.matches?e.Dark:e.Light:e.Unknown}function D(t){var r;(r=t.matches?e.Dark:e.Light)!==F&&U(F=r)}function U(e){for(var t=0;t<c.length;t++){var r=c[t];r.fn(e),r.once&&O(r)}}function O(e){var t,r=q(e);-1!==r&&c.splice(r,1),0===c.length&&(u?(F=null,null!==M&&(clearInterval(M),M=null)):(t=e.capture,F=null,"function"==typeof n.removeEventListener?n.removeEventListener("change",D,t):"function"==typeof n.removeListener&&n.removeListener(D)))}function q(e){for(var t=0;t<c.length;t++)if(c[t].fn===e.fn&&c[t].capture===e.capture)return t;return-1}function H(){var e;C={},e=l?'meta[name="msapplication-navbutton-color"]':s?'meta[name="msapplication-TileColor"]':'meta[name="theme-color"]';var t=document.querySelectorAll(e);if(a&&o&&!l&&!s)for(var r=0;r<t.length;r++){var n=t.item(r),i=n.getAttribute("media");if("(prefers-color-scheme: dark)"===i&&void 0===C.dark?C.dark=n:"(prefers-color-scheme: light)"===i&&void 0===C.light?C.light=n:null===i&&void 0===C.default&&(C.default=n),void 0!==C.dark&&void 0!==C.light&&void 0!==C.default)return}else C.default=t[0]}function R(){var r=function(){if(l)return document.querySelector('meta[name="msapplication-navbutton-color"]');if(s)return document.querySelector('meta[name="msapplication-TileColor"]');if(!a||!o)return document.querySelector('meta[name="theme-color"]');var t,r=document.querySelectorAll('meta[name="theme-color"]');t=P()===e.Dark?"(prefers-color-scheme: dark)":"(prefers-color-scheme: light)";for(var n=0;n<r.length;n++){var i=r.item(n);if(i.hasAttribute("content")){var u=i.getAttribute("media");if(null===u||u===t)return i}}return null}();return null!==r?r.getAttribute("content"):/version\/[\w.,]+ .*safari/i.test(t)?navigator.standalone?P()===e.Dark?"#ffffffff":"#000000ff":T(k(window.getComputedStyle(document.body).backgroundColor)):/\b(?:crmo|crios)\/[\w.]+/i.test(t)||/chrome\/[\w.]+ mobile/i.test(t)?P()===e.Dark?"#28292cff":"#ffffffff":void 0}return j=new MutationObserver((function(e){for(var t=0;t<e.length;t++){for(var r=e[t],n=r.addedNodes,o=r.removedNodes,a=0;a<n.length;a++)if(n[a]instanceof HTMLMetaElement)return H();for(a=0;a<o.length;a++)if(o[a]instanceof HTMLMetaElement)return H()}})),"function"==typeof n.addEventListener?n.addEventListener("change",H):"function"==typeof n.addListener&&n.addListener(H),j.observe(document.head,{childList:!0}),H(),{installed:!1,name:"Theme",module:N,Constants:{Appearances:e},Errors:{EasingError:p,UnsupportedEasingFunctionError:b,StepSyntaxError:h,LinearSyntaxError:v,CubicBezierSyntaxError:m,UnsupportedColorError:E}}}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Theme=t()}(this,(function(){"use strict";var e,t,n,r,o=navigator.userAgent;!function(e){e.Unknown="Unknown",e.Android="Android",e.iOS="iOS",e.Windows="Windows",e.MacOS="MacOS"}(e||(e={})),function(e){e.Unknown="Unknown",e.Mobile="Mobile",e.Desktop="Desktop"}(t||(t={})),function(e){e.Unknown="Unknown",e.EdgeHTML="EdgeHTML",e.ArkWeb="ArkWeb",e.Blink="Blink",e.Presto="Presto",e.WebKit="WebKit",e.Trident="Trident",e.NetFront="NetFront",e.KHTML="KHTML",e.Tasman="Tasman",e.Gecko="Gecko"}(n||(n={})),function(e){e.Unknown="Unknown",e.Chrome="Chrome",e.Safari="Safari",e.Edge="Edge",e.Firefox="Firefox",e.Opera="Opera",e.IE="IE",e.SamsungInternet="SamsungInternet"}(r||(r={}));var i=t.Unknown,a=e.Unknown;n.Unknown;var l=r.Unknown,s="";function u(e){if(void 0===e)return"";var t={"4.90":"ME","NT3.51":"NT 3.11","NT4.0":"NT 4.0","NT 5.0":"2000","NT 5.1":"XP","NT 5.2":"XP","NT 6.0":"Vista","NT 6.1":"7","NT 6.2":"8","NT 6.3":"8.1","NT 6.4":"10","NT 10.0":"10",ARM:"RT"}[e];return void 0!==t?t:e}function c(e){return void 0===e?"":e.replace(/_/g,".")}function d(e,t){return"function"==typeof t?t(e):"string"==typeof t?t:void 0===e?"":e}for(var f=[[/windows nt (6\.[23]); arm/i,e.Windows,u],[/windows (?:phone|mobile|iot)(?: os)?[\/ ]?([\d.]*( se)?)/i,e.Windows,u],[/windows[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i,e.Windows,u],[/windows nt ?([\d.)]*)(?!.+xbox)/i,e.Windows,u],[/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d.;]*)/i,e.Windows,u],[/windows ce\/?([\d.]*)/i,e.Windows,u],[/[adehimnop]{4,7}\b(?:.*os (\w+) like mac|; opera)/i,e.iOS,c],[/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w.]+)/i,e.iOS,c],[/cfnetwork\/.+darwin/i,e.iOS,c],[/mac os x ?([\w. ]*)/i,e.MacOS,c],[/(?:macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i,e.MacOS,c],[/droid ([\w.]+)\b.+(android[- ]x86)/i,e.Android],[/android\w*[-\/.; ]?([\d.]*)/i,e.Android]],p=[[/windows.+ edge\/([\w.]+)/i,n.EdgeHTML],[/arkweb\/([\w.]+)/i,n.ArkWeb],[/webkit\/537\.36.+chrome\/(?!27)([\w.]+)/i,n.Blink],[/presto\/([\w.]+)/i,n.Presto],[/webkit\/([\w.]+)/i,n.WebKit],[/trident\/([\w.]+)/i,n.Trident],[/netfront\/([\w.]+)/i,n.NetFront],[/khtml[\/ ]\(?([\w.]+)/i,n.KHTML],[/tasman[\/ ]\(?([\w.]+)/i,n.Tasman],[/rv:([\w.]{1,9})\b.+gecko/i,n.Gecko]],m=[[/\b(?:crmo|crios)\/([\w.]+)/i,r.Chrome],[/webview.+edge\/([\w.]+)/i,r.Edge],[/edg(?:e|ios|a)?\/([\w.]+)/i,r.Edge],[/opera mini\/([-\w.]+)/i,r.Opera],[/opera [mobileta]{3,6}\b.+version\/([-\w.]+)/i,r.Opera],[/opera(?:.+version\/|[\/ ]+)([\w.]+)/i,r.Opera],[/opios[\/ ]+([\w.]+)/i,r.Opera],[/\bop(?:rg)?x\/([\w.]+)/i,r.Opera],[/\bopr\/([\w.]+)/i,r.Opera],[/iemobile(?:browser|boat|jet)[\/ ]?([\d.]*)/i,r.IE],[/(?:ms|\()ie ([\w.]+)/i,r.IE],[/trident.+rv[: ]([\w.]{1,9})\b.+like gecko/i,r.IE],[/\bfocus\/([\w.]+)/i,r.Firefox],[/\bopt\/([\w.]+)/i,r.Opera],[/coast\/([\w.]+)/i,r.Opera],[/fxios\/([\w.-]+)/i,r.Firefox],[/samsungbrowser\/([\w.]+)/i,r.SamsungInternet],[/headlesschrome(?:\/([\w.]+)| )/i,r.Chrome],[/wv\).+chrome\/([\w.]+).+edgw\//i,r.Edge],[/ wv\).+(chrome)\/([\w.]+)/i,r.Chrome],[/chrome\/([\w.]+) mobile/i,r.Chrome],[/chrome\/v?([\w.]+)/i,r.Chrome],[/version\/([\w.,]+) .*mobile(?:\/\w+ | ?)safari/i,r.Safari],[/iphone .*mobile(?:\/\w+ | ?)safari/i,r.Safari],[/version\/([\w.,]+) .*safari/i,r.Safari],[/webkit.+?(?:mobile ?safari|safari)(\/[\w.]+)/i,r.Safari,"1"],[/(?:mobile|tablet);.*firefox\/([\w.-]+)/i,r.Firefox],[/mobile vr; rv:([\w.]+)\).+firefox/i,r.Firefox],[/firefox\/([\w.]+)/i,r.Firefox]],h=0;h<f.length;h++){var v=(w=f[h])[0],b=w[1],g=w[2];if(null!==(y=o.match(v))){a=b,d(y[1],g),b===e.iOS||b===e.Android?i=t.Mobile:b!==e.Windows&&b!==e.MacOS||(i=t.Desktop);break}}for(h=0;h<p.length;h++){v=(w=p[h])[0];w[1];g=w[2];if(null!==(y=o.match(v))){d(y[1],g);break}}for(h=0;h<m.length;h++){v=(w=m[h])[0];var w,y,S=w[1];g=w[2];if(null!==(y=o.match(v))){l=S,s=d(y[1],g);break}}!function(){var e=globalThis.document.createElement("canvas");if("function"!=typeof e.getContext)return"";var t=e.getContext("webgl2")||e.getContext("experimental-webgl")||e.getContext("webgl");if(null===t)return"";if(t instanceof WebGLRenderingContext||"getParameter"in t&&"function"==typeof t.getParameter){var n=t.getExtension("WEBGL_debug_renderer_info");return null===n?t.getParameter(t.RENDERER):t.getParameter(n.UNMASKED_RENDERER_WEBGL)}}();var k=i===t.Mobile;t.Desktop;var T,x=a===e.iOS?"standalone"in navigator&&!!navigator.standalone:globalThis.matchMedia("(display-mode: standalone)").matches;!function(e){e.Unknown="unknown",e.Light="light",e.Dark="dark"}(T||(T={}));var E=globalThis.matchMedia("(prefers-color-scheme: dark)"),M="not all"!==E.media,C=l!==r.Chrome||k&&function(e,t){for(var n=e.split("."),r=t.split("."),o=Math.max(n.length,r.length),i=0;i<o;i++){var a=void 0,l=void 0;if((a=i<n.length?parseInt(n[i],10):0)>(l=i<r.length?parseInt(r[i],10):0))return 1;if(a<l)return-1}return 0}(s,"92")>=0,I=globalThis.document.createElement("canvas").getContext("2d",{willReadFrequently:!0}),L=/iemobile/i.test(o),F=/windows phone/i.test(o),N=[];function A(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function O(e,t){function n(r){if(!(this instanceof n))return new n(r);var o=new t(r||"");if("function"==typeof Object.setPrototypeOf?Object.setPrototypeOf(o,n.prototype):o.__proto__=n.prototype,o.name=e,void 0!==r&&(o.message=r),"undefined"!=typeof Symbol&&Symbol.toStringTag)try{Object.defineProperty(o,Symbol.toStringTag,{value:e,writable:!1,enumerable:!1,configurable:!0})}catch(e){}if("function"==typeof Error.captureStackTrace)Error.captureStackTrace(o,n);else if(t.captureStackTrace&&"function"==typeof t.captureStackTrace)t.captureStackTrace(o,n);else try{var i=new t;i.stack&&(o.stack=i.stack)}catch(e){}return o}void 0===t&&(t=Error),n.prototype=Object.create(t.prototype,{constructor:{value:n,writable:!0,enumerable:!1,configurable:!0}});try{Object.defineProperty(n.prototype,"name",{value:e,writable:!0,enumerable:!1,configurable:!0})}catch(t){try{n.prototype.name=e}catch(e){}}try{Object.defineProperty(n,"name",{value:e,writable:!1,enumerable:!1,configurable:!0})}catch(e){}return n}"function"==typeof SuppressedError&&SuppressedError;var j=O("EasingError"),P=O("CubicBezierSyntaxError",j),U=O("LinearSyntaxError",j),W=O("StepSyntaxError",j),D=O("UnsupportedEasingFunctionError",j),z={linear:"linear(0, 1)",ease:"cubic-bezier(0.25, 0.1, 0.25, 1)","ease-in":"cubic-bezier(0.42, 0, 1, 1)","ease-out":"cubic-bezier(0, 0, 0.58, 1)","ease-in-out":"cubic-bezier(0.42, 0, 0.58, 1)","step-start":"steps(1, jump-start)","step-end":"steps(1, jump-end)"};function R(e,t,n){return e<t?t:e>n?n:e}function H(e){var t=function(e){var t=e.match(/cubic-bezier\((.*)\)/);if(null===t)throw new P("Invalid cubic-bezier syntax");var n=t[1].trim().split(","),r=[];if(4!==n.length)throw new P("Cubic-bezier must have exactly 4 numeric values");for(var o=0;o<4;o++){var i=parseFloat(n[o]);if(isNaN(i))throw new P("Cubic-bezier must have exactly 4 numeric values");if(o%2==0&&(i<0||i>1))throw new P("x1 and x2 must be between 0 and 1");r.push(i)}return{x1:r[0],y1:r[1],x2:r[2],y2:r[3]}}(e),n=t.x1,r=t.x2,o=t.y1,i=t.y2;return function(e){if(0===(e=R(e,0,1))||1===e)return e;var t=function(e,t,o){if(void 0===t&&(t=1e-6),void 0===o&&(o=50),e<=0)return 0;if(e>=1)return 1;for(var i=e,a=0;a<o;a++){var l=3*(1-i)*(1-i)*i*n+3*(1-i)*i*i*r+i*i*i,s=3*(1-i)*(1-i)*n+6*(1-i)*i*(r-n)+3*i*i*(1-r);if(Math.abs(s)<t)break;var u=i-(l-e)/s;if(Math.abs(u-i)<t){i=u;break}i=Math.max(0,Math.min(1,u))}return i}(e);return 3*(1-t)*(1-t)*t*o+3*(1-t)*t*t*i+t*t*t}}function B(e){var t=function(e){var t,n,r=e.match(/linear\((.*)\)/);if(null===r)throw new U("Invalid linear syntax");var o=r[1].trim();if(""===o)throw new U("Linear function must have at least one point");for(var i=o.split(","),a=[],l=0;l<i.length;l++){var s=i[l].trim(),u=s.match(/^([+-]?\d*\.?\d+)((?:\s+[+-]?\d*\.?\d+%){2,})$/);if(null===u){var c=s.match(/^([+-]?\d*\.?\d+)\s+([+-]?\d*\.?\d+)%$/);if(null===c){var d=s.match(/^([+-]?\d*\.?\d+)$/);if(null===d)throw new U('Invalid linear point format: "'+s+'"');a.push({position:1===i.length?0:l/(i.length-1),value:parseFloat(d[1])})}else a.push({position:parseFloat(c[2])/100,value:parseFloat(c[1])})}else{var f=parseFloat(u[1]),p=u[2].trim().split(/\s+/);try{for(var m=(t=void 0,A(p)),h=m.next();!h.done;h=m.next()){var v=h.value;a.push({value:f,position:parseFloat(v)/100})}}catch(e){t={error:e}}finally{try{h&&!h.done&&(n=m.return)&&n.call(m)}finally{if(t)throw t.error}}}}if(0===a.length)throw new U("No valid points found in linear function");return a.sort((function(e,t){return e.position-t.position})),a[0].position>0&&a.unshift({position:0,value:0}),a[a.length-1].position<1&&a.push({position:1,value:1}),a}(e);return function(e){if((e=R(e,0,1))<=t[0].position)return t[0].value;if(e>=t[t.length-1].position)return t[t.length-1].value;for(var n=0;n<t.length-1;n++){var r=t[n],o=t[n+1];if(e>=r.position&&e<=o.position){if(r.position===o.position)return o.value;var i=(e-r.position)/(o.position-r.position);return r.value+(o.value-r.value)*i}}return t[t.length-1].value}}function _(e){if(function(e){return!/(linear|cubic-bezier|steps)\((.*)\)/.test(e)}(e)&&(e=z[e]),function(e){return/cubic-bezier\(/.test(e)}(e))return H(e);if(function(e){return/linear\(/.test(e)}(e))return B(e);if(function(e){return/steps\(\s*(\d+)\s*(?:,\s*(jump-start|jump-end|jump-none|jump-both|start|end)\s*)?\)$/.test(e)}(e))return function(e){var t=e.match(/steps\(\s*(\d+)\s*(?:,\s*(jump-start|jump-end|jump-none|jump-both|start|end)\s*)?\)$/);if(null===t)throw new W("Invalid steps syntax");var n=parseInt(t[1],10),r=t[2];if(n<=0)throw new W("Steps count must be a positive integer");if("jump-none"===r&&n<2)throw new W("jump-none requires at least 2 steps");return function(e){switch(e=R(e,0,1),r){case"start":case"jump-start":return 0===e?1/n:1===e?1:Math.ceil(e*n)/n;case void 0:case"end":case"jump-end":return 1===e?1:Math.floor(e*n)/n;case"jump-both":return 0===e?0:1===e?1:Math.round(e*(n+1))/(n+1);case"jump-none":return 0===e?0:1===e?1:Math.floor(e*(n-1))/(n-1);default:throw new W('Unsupported step position: "'+r+'"')}}}(e);throw new D('Unsupported easing function: "'+e+'"')}var q=O("UnsupportedColorError");function G(e){if("undefined"!=typeof CSS&&CSS.supports&&!CSS.supports("color",e))throw new q('Unsupported color: "'+e+'".');if(null!==I)try{I.clearRect(0,0,1,1),I.fillStyle=e,I.fillRect(0,0,1,1);var t=I.getImageData(0,0,1,1).data;return{red:t[0],green:t[1],blue:t[2],alpha:parseFloat((t[3]/255).toFixed(2))}}catch(e){}var n=function(e,t){void 0===t&&(t=!0);var n=globalThis.document.createElement(e);return"width"in n&&(n.width="0"),"height"in n&&(n.height="0"),"border"in n&&(n.border="0"),"frameBorder"in n&&(n.frameBorder="0"),"scrolling"in n&&(n.scrolling="no"),"cellPadding"in n&&(n.cellPadding="0"),"cellSpacing"in n&&(n.cellSpacing="0"),"frame"in n&&(n.frame="void"),"rules"in n&&(n.rules="none"),"noWrap"in n&&(n.noWrap=!0),n.tabIndex=-1,n.setAttribute("role","presentation"),t?(n.style.width="1px",n.style.height="1px"):(n.setAttribute("aria-hidden","true"),n.style.width="0",n.style.height="0",n.style.zIndex="-9999",n.style.display="none",n.style.visibility="hidden",n.style.pointerEvents="none"),n.style.position="absolute",n.style.top="0",n.style.left="0",n.style.padding="0",n.style.margin="0",n.style.border="none",n.style.outline="none",n.style.clip="rect(1px, 1px, 1px, 1px)",n.style.clipPath="inset(50%)",n.style.overflow="hidden",n.style.whiteSpace="nowrap",n}("div");n.style.color=e,globalThis.document.body.appendChild(n);try{var r=globalThis.getComputedStyle(n).color,o=r.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\s*\)/),i=r.match(/rgba?\(\s*(\d+)\s+(\d+)\s+(\d+)\s*(?:\/\s*([\d.]+%?))?\s*\)/),a=o||i;if(null===a)throw new q('Unsupported color: "'+e+'".');var l=parseInt(a[1],10),s=parseInt(a[2],10),u=parseInt(a[3],10),c=1;if(void 0!==a[4]){var d=a[4];c="%"===d.charAt(d.length-1)?parseFloat((parseFloat(d)/100).toFixed(2)):parseFloat(parseFloat(d).toFixed(2))}if(isNaN(l)||isNaN(s)||isNaN(u)||isNaN(c))throw new q('Failed to parse color values from: "'+e+'".');return{red:l,green:s,blue:u,alpha:c}}finally{globalThis.document.body.removeChild(n)}}var K,Z={},$=null,X=null,V=null,Q=null,J={setThemeColor:function(e,t){void 0===t&&(t={duration:0,easingFunction:"linear",appearance:"default"});var n=t.duration,r=_(t.easingFunction),o=t.appearance;null!==$&&(globalThis.cancelAnimationFrame($),$=null,null!==X&&(X(se()),X=null));var i=se();void 0===i&&(i=void 0!==t.defaultColor?t.defaultColor:ne()===T.Dark?"#181818ff":"#dcdcdcff");var a=G(i),l=G(e);return new Promise((function(e){X=e;var t=null;$=globalThis.requestAnimationFrame((function i(s){null===t&&(t=s);var u,c=s-t;u=0===n?1:Math.min(c/n,1);var d=r(u),f={red:Math.round(a.red+(l.red-a.red)*d),green:Math.round(a.green+(l.green-a.green)*d),blue:Math.round(a.blue+(l.blue-a.blue)*d),alpha:+(a.alpha+(l.alpha-a.alpha)*d).toFixed(2)};(function(e){void 0===e&&(e="default");var t;t=!C||!M||L||F?"default":e;var n=Z[t];if(void 0!==n)return n;n=globalThis.document.createElement("meta"),L?n.setAttribute("name","msapplication-navbutton-color"):F?n.setAttribute("name","msapplication-TileColor"):n.setAttribute("name","theme-color");"default"!==e&&n.setAttribute("media","(prefers-color-scheme: "+t+")");return globalThis.document.head.prepend(n),Z[e]=n})(o).setAttribute("content",ee(f)),u<1?$=globalThis.requestAnimationFrame(i):($=null,null!==X&&(e(se()),$=null))}))}))},getThemeColor:se,removeThemeColor:function(e){void 0===e&&(e="default");var t=Z[e];void 0!==t&&t.remove();Z[e]=void 0},detectAppearance:function(){return l===r.SamsungInternet?te():Promise.resolve(ne())},onAppearanceChange:function(e,t){void 0===t&&(t=!1);var n={fn:e,capture:!1,once:!1};"boolean"==typeof t&&(t={capture:t});void 0!==t.capture&&(n.capture=t.capture);void 0!==t.once&&(n.once=t.once);void 0!==t.signal&&(n.signal=t.signal);var o=ae(n);-1===o?(N.push(n),1===N.length&&(l===r.SamsungInternet?(te().then((function(e){V=e})),Q=globalThis.setInterval((function(){te().then((function(e){e!==V&&(V=e,oe(e))}))}),2e3)):(i=n.capture,V=ne(),"function"==typeof E.addEventListener?E.addEventListener("change",re,i):"function"==typeof E.addListener&&E.addListener(re))),this.detectAppearance().then(oe)):N[o].once&&!n.once&&(N[o].once=!1);var i;void 0!==n.signal&&(n.signal.aborted?ie(n):n.signal.addEventListener("abort",(function e(){void 0!==n.signal&&n.signal.removeEventListener("abort",e),ie(n)})));return function(){ie(n)}}};function Y(e){var t=e.toString(16);switch(t.length){case 0:return"00";case 1:return"0"+t;default:return t}}function ee(e){return"#"+Y(e.red)+Y(e.green)+Y(e.blue)+Y(Math.round(255*e.alpha))}function te(){return new Promise((function(e){var t=new Image;t.onload=function(){if(null===I)return e(T.Light);I.drawImage(t,0,0);var n=I.getImageData(0,0,1,1).data;(n[0]&n[1]&n[2])<255?e(T.Dark):e(T.Light)},t.onerror=function(){e(T.Unknown)},t.src="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxyZWN0IHdpZHRoPSIxIiBoZWlnaHQ9IjEiIGZpbGw9IndoaXRlIi8+PC9zdmc+"}))}function ne(){return M?E.matches?T.Dark:T.Light:T.Unknown}function re(e){var t;(t=e.matches?T.Dark:T.Light)!==V&&oe(V=t)}function oe(e){for(var t=0;t<N.length;t++){var n=N[t];n.fn(e),n.once&&ie(n)}}function ie(e){var t,n=ae(e);-1!==n&&N.splice(n,1),0===N.length&&(l===r.SamsungInternet?(V=null,null!==Q&&(clearInterval(Q),Q=null)):(t=e.capture,V=null,"function"==typeof E.removeEventListener?E.removeEventListener("change",re,t):"function"==typeof E.removeListener&&E.removeListener(re)))}function ae(e){for(var t=0;t<N.length;t++)if(N[t].fn===e.fn&&N[t].capture===e.capture)return t;return-1}function le(){var e;Z={},e=L?'meta[name="msapplication-navbutton-color"]':F?'meta[name="msapplication-TileColor"]':'meta[name="theme-color"]';var t=globalThis.document.querySelectorAll(e);if(C&&M&&!L&&!F)for(var n=0;n<t.length;n++){var r=t.item(n),o=r.getAttribute("media");if("(prefers-color-scheme: dark)"===o&&void 0===Z.dark?Z.dark=r:"(prefers-color-scheme: light)"===o&&void 0===Z.light?Z.light=r:null===o&&void 0===Z.default&&(Z.default=r),void 0!==Z.dark&&void 0!==Z.light&&void 0!==Z.default)return}else Z.default=t[0]}function se(){var e=function(){if(L)return globalThis.document.querySelector('meta[name="msapplication-navbutton-color"]');if(F)return globalThis.document.querySelector('meta[name="msapplication-TileColor"]');if(!C||!M)return globalThis.document.querySelector('meta[name="theme-color"]');var e,t=globalThis.document.querySelectorAll('meta[name="theme-color"]');e=ne()===T.Dark?"(prefers-color-scheme: dark)":"(prefers-color-scheme: light)";for(var n=0;n<t.length;n++){var r=t.item(n);if(r.hasAttribute("content")){var o=r.getAttribute("media");if(null===o||o===e)return r}}return null}();return null!==e?e.getAttribute("content"):l===r.Safari?x?ne()===T.Dark?"#ffffffff":"#000000ff":ee(G(globalThis.getComputedStyle(globalThis.document.body).backgroundColor)):l===r.Chrome?ne()===T.Dark?"#28292cff":"#ffffffff":void 0}return K=new MutationObserver((function(e){for(var t=0;t<e.length;t++){for(var n=e[t],r=n.addedNodes,o=n.removedNodes,i=0;i<r.length;i++)if(r[i]instanceof HTMLMetaElement)return le();for(i=0;i<o.length;i++)if(o[i]instanceof HTMLMetaElement)return le()}})),"function"==typeof E.addEventListener?E.addEventListener("change",le):"function"==typeof E.addListener&&E.addListener(le),K.observe(globalThis.document.head,{childList:!0}),le(),{installed:!1,name:"Theme",module:J,Constants:{Appearances:T},Errors:{EasingError:j,UnsupportedEasingFunctionError:D,StepSyntaxError:W,LinearSyntaxError:U,CubicBezierSyntaxError:P,UnsupportedColorError:q}}}));
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
declare global {
|
|
2
|
+
const process: unknown;
|
|
3
|
+
}
|
|
1
4
|
export declare enum OS {
|
|
2
5
|
Unknown = "Unknown",
|
|
3
6
|
Android = "Android",
|
|
@@ -23,13 +26,25 @@ export declare enum Engines {
|
|
|
23
26
|
Tasman = "Tasman",
|
|
24
27
|
Gecko = "Gecko"
|
|
25
28
|
}
|
|
29
|
+
export declare enum Browsers {
|
|
30
|
+
Unknown = "Unknown",
|
|
31
|
+
Chrome = "Chrome",
|
|
32
|
+
Safari = "Safari",
|
|
33
|
+
Edge = "Edge",
|
|
34
|
+
Firefox = "Firefox",
|
|
35
|
+
Opera = "Opera",
|
|
36
|
+
IE = "IE",
|
|
37
|
+
SamsungInternet = "SamsungInternet"
|
|
38
|
+
}
|
|
39
|
+
export declare let DEVICE_NAME: Devices;
|
|
26
40
|
export declare let OS_NAME: OS;
|
|
27
41
|
export declare let OS_VERSION: string;
|
|
28
|
-
export declare let DEVICE_NAME: Devices;
|
|
29
42
|
export declare let ENGINE_NAME: Engines;
|
|
30
43
|
export declare let ENGINE_VERSION: string;
|
|
44
|
+
export declare let BROWSER_NAME: Browsers;
|
|
45
|
+
export declare let BROWSER_VERSION: string;
|
|
31
46
|
export declare const RENDERER: string;
|
|
47
|
+
export declare const IS_WEBVIEW: boolean;
|
|
32
48
|
export declare const IS_MOBILE: boolean;
|
|
33
49
|
export declare const IS_DESKTOP: boolean;
|
|
34
50
|
export declare const IS_STANDALONE: boolean;
|
|
35
|
-
export declare const IS_WEBVIEW: boolean;
|
|
@@ -5,9 +5,8 @@ export declare enum AppOpenState {
|
|
|
5
5
|
Fallback = 3,
|
|
6
6
|
Store = 4
|
|
7
7
|
}
|
|
8
|
-
export declare enum
|
|
8
|
+
export declare enum MessengerType {
|
|
9
9
|
Telephone = "telephone",
|
|
10
10
|
Message = "message",
|
|
11
11
|
Mail = "mail"
|
|
12
12
|
}
|
|
13
|
-
export declare const IS_SUPPORT_INTENT: boolean;
|