@microblink/camera-manager 7.2.7 → 7.3.0
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/README.md +1 -0
- package/dist/camera-manager.js +1266 -1154
- package/package.json +5 -5
- package/types/core/Camera.d.ts +1 -1
- package/types/core/Camera.test.d.ts +1 -1
- package/types/core/CameraManager.d.ts +1 -1
- package/types/core/CameraManager.d.ts.map +1 -1
- package/types/core/CameraManager.test.d.ts +1 -1
- package/types/core/VideoFrameProcessor.d.ts +1 -1
- package/types/core/cameraError.d.ts +1 -1
- package/types/core/cameraManagerStore.d.ts +1 -1
- package/types/core/cameraNames.d.ts +1 -25
- package/types/core/cameraNames.d.ts.map +1 -1
- package/types/core/cameraUtils.d.ts +1 -1
- package/types/core/cameraUtils.test.d.ts +1 -1
- package/types/core/iosCameraNames.d.ts +1 -1
- package/types/core/utils.d.ts +1 -15
- package/types/core/utils.d.ts.map +1 -1
- package/types/index.d.ts +1 -1
- package/types/index.rollup.d.ts +14 -5
- package/types/media-mock/MediaMocker.d.ts +2 -2
- package/types/media-mock/MediaMocker.d.ts.map +1 -1
- package/types/media-mock/createInputDeviceInfo.d.ts +1 -1
- package/types/media-mock/defineProperty.d.ts +1 -1
- package/types/media-mock/fake-devices.d.ts +1 -1
- package/types/media-mock/fakeDevices/DesktopSingleFrontFacing.d.ts +1 -1
- package/types/media-mock/fakeDevices/SamsungS21FE.d.ts +1 -1
- package/types/media-mock/fakeDevices/iPhone15.d.ts +1 -1
- package/types/media-mock/fakeDevices/iPhoneSE.d.ts +1 -1
- package/types/media-mock/fakeDevices/iPhoneX.d.ts +1 -1
- package/types/media-mock/utils.d.ts +1 -2
- package/types/media-mock/utils.d.ts.map +1 -1
- package/types/tests/camera-picking.test.d.ts +1 -1
- package/types/ui/CameraErrorModal.d.ts +1 -1
- package/types/ui/CameraErrorModal.d.ts.map +1 -1
- package/types/ui/CameraSelector.d.ts +2 -1
- package/types/ui/CameraSelector.d.ts.map +1 -1
- package/types/ui/CameraUiStoreContext.d.ts +5 -2
- package/types/ui/CameraUiStoreContext.d.ts.map +1 -1
- package/types/ui/CaptureScreen.d.ts +1 -5
- package/types/ui/CaptureScreen.d.ts.map +1 -1
- package/types/ui/Header.d.ts +1 -1
- package/types/ui/Header.d.ts.map +1 -1
- package/types/ui/LocalizationContext.d.ts +1 -1
- package/types/ui/RootComponent.d.ts +1 -1
- package/types/ui/SolidShadowRoot.d.ts +1 -1
- package/types/ui/createCameraManagerUi.d.ts +11 -2
- package/types/ui/createCameraManagerUi.d.ts.map +1 -1
- package/types/ui/determineFitMode.d.ts +1 -1
- package/types/ui/determineFitMode.test.d.ts +1 -1
- package/types/ui/getVisibleVideoArea.d.ts +1 -1
- package/types/ui/getVisibleVideoArea.test.d.ts +1 -1
- package/types/ui/locales/ak.d.ts +16 -13
- package/types/ui/locales/ak.d.ts.map +1 -1
- package/types/ui/locales/am.d.ts +5 -2
- package/types/ui/locales/am.d.ts.map +1 -1
- package/types/ui/locales/ar.d.ts +5 -2
- package/types/ui/locales/ar.d.ts.map +1 -1
- package/types/ui/locales/bn.d.ts +5 -2
- package/types/ui/locales/bn.d.ts.map +1 -1
- package/types/ui/locales/cs.d.ts +5 -2
- package/types/ui/locales/cs.d.ts.map +1 -1
- package/types/ui/locales/da.d.ts +5 -2
- package/types/ui/locales/da.d.ts.map +1 -1
- package/types/ui/locales/de.d.ts +5 -2
- package/types/ui/locales/de.d.ts.map +1 -1
- package/types/ui/locales/el.d.ts +6 -3
- package/types/ui/locales/el.d.ts.map +1 -1
- package/types/ui/locales/en.d.ts +3 -3
- package/types/ui/locales/en_GB.d.ts +5 -2
- package/types/ui/locales/en_GB.d.ts.map +1 -1
- package/types/ui/locales/es.d.ts +5 -2
- package/types/ui/locales/es.d.ts.map +1 -1
- package/types/ui/locales/es_MX.d.ts +5 -2
- package/types/ui/locales/es_MX.d.ts.map +1 -1
- package/types/ui/locales/fa-latn.d.ts +5 -2
- package/types/ui/locales/fa-latn.d.ts.map +1 -1
- package/types/ui/locales/fi.d.ts +5 -2
- package/types/ui/locales/fi.d.ts.map +1 -1
- package/types/ui/locales/fil.d.ts +5 -2
- package/types/ui/locales/fil.d.ts.map +1 -1
- package/types/ui/locales/fr.d.ts +5 -2
- package/types/ui/locales/fr.d.ts.map +1 -1
- package/types/ui/locales/fr_CA.d.ts +5 -2
- package/types/ui/locales/fr_CA.d.ts.map +1 -1
- package/types/ui/locales/ha.d.ts +5 -2
- package/types/ui/locales/ha.d.ts.map +1 -1
- package/types/ui/locales/he.d.ts +5 -2
- package/types/ui/locales/he.d.ts.map +1 -1
- package/types/ui/locales/hi.d.ts +5 -2
- package/types/ui/locales/hi.d.ts.map +1 -1
- package/types/ui/locales/hr.d.ts +6 -3
- package/types/ui/locales/hr.d.ts.map +1 -1
- package/types/ui/locales/hu.d.ts +5 -2
- package/types/ui/locales/hu.d.ts.map +1 -1
- package/types/ui/locales/id.d.ts +5 -2
- package/types/ui/locales/id.d.ts.map +1 -1
- package/types/ui/locales/index.d.ts +1 -1
- package/types/ui/locales/is.d.ts +5 -2
- package/types/ui/locales/is.d.ts.map +1 -1
- package/types/ui/locales/it.d.ts +5 -2
- package/types/ui/locales/it.d.ts.map +1 -1
- package/types/ui/locales/ja.d.ts +5 -2
- package/types/ui/locales/ja.d.ts.map +1 -1
- package/types/ui/locales/ka_GE.d.ts +5 -2
- package/types/ui/locales/ka_GE.d.ts.map +1 -1
- package/types/ui/locales/kk.d.ts +5 -2
- package/types/ui/locales/kk.d.ts.map +1 -1
- package/types/ui/locales/km_KH.d.ts +5 -2
- package/types/ui/locales/km_KH.d.ts.map +1 -1
- package/types/ui/locales/ko.d.ts +5 -2
- package/types/ui/locales/ko.d.ts.map +1 -1
- package/types/ui/locales/lv.d.ts +5 -2
- package/types/ui/locales/lv.d.ts.map +1 -1
- package/types/ui/locales/ms.d.ts +5 -2
- package/types/ui/locales/ms.d.ts.map +1 -1
- package/types/ui/locales/ne.d.ts +5 -2
- package/types/ui/locales/ne.d.ts.map +1 -1
- package/types/ui/locales/nl.d.ts +5 -2
- package/types/ui/locales/nl.d.ts.map +1 -1
- package/types/ui/locales/no.d.ts +5 -2
- package/types/ui/locales/no.d.ts.map +1 -1
- package/types/ui/locales/pl.d.ts +5 -2
- package/types/ui/locales/pl.d.ts.map +1 -1
- package/types/ui/locales/ps_AF.d.ts +5 -2
- package/types/ui/locales/ps_AF.d.ts.map +1 -1
- package/types/ui/locales/pt.d.ts +5 -2
- package/types/ui/locales/pt.d.ts.map +1 -1
- package/types/ui/locales/pt_BR.d.ts +5 -2
- package/types/ui/locales/pt_BR.d.ts.map +1 -1
- package/types/ui/locales/ro.d.ts +5 -2
- package/types/ui/locales/ro.d.ts.map +1 -1
- package/types/ui/locales/ru.d.ts +5 -2
- package/types/ui/locales/ru.d.ts.map +1 -1
- package/types/ui/locales/si.d.ts +5 -2
- package/types/ui/locales/si.d.ts.map +1 -1
- package/types/ui/locales/sk.d.ts +5 -2
- package/types/ui/locales/sk.d.ts.map +1 -1
- package/types/ui/locales/sl.d.ts +5 -2
- package/types/ui/locales/sl.d.ts.map +1 -1
- package/types/ui/locales/sr.d.ts +5 -2
- package/types/ui/locales/sr.d.ts.map +1 -1
- package/types/ui/locales/sv.d.ts +5 -2
- package/types/ui/locales/sv.d.ts.map +1 -1
- package/types/ui/locales/sw.d.ts +5 -2
- package/types/ui/locales/sw.d.ts.map +1 -1
- package/types/ui/locales/th.d.ts +5 -2
- package/types/ui/locales/th.d.ts.map +1 -1
- package/types/ui/locales/tr.d.ts +5 -2
- package/types/ui/locales/tr.d.ts.map +1 -1
- package/types/ui/locales/uk.d.ts +5 -2
- package/types/ui/locales/uk.d.ts.map +1 -1
- package/types/ui/locales/ur.d.ts +5 -2
- package/types/ui/locales/ur.d.ts.map +1 -1
- package/types/ui/locales/uz.d.ts +5 -2
- package/types/ui/locales/uz.d.ts.map +1 -1
- package/types/ui/locales/vi.d.ts +5 -2
- package/types/ui/locales/vi.d.ts.map +1 -1
- package/types/ui/locales/yo.d.ts +5 -2
- package/types/ui/locales/yo.d.ts.map +1 -1
- package/types/ui/locales/zh_CN.d.ts +5 -2
- package/types/ui/locales/zh_CN.d.ts.map +1 -1
- package/types/ui/locales/zh_TW.d.ts +5 -2
- package/types/ui/locales/zh_TW.d.ts.map +1 -1
- package/types/ui/zustandRefStore.d.ts +1 -1
- package/types/ui/debounce.d.ts +0 -14
- package/types/ui/debounce.d.ts.map +0 -1
package/dist/camera-manager.js
CHANGED
|
@@ -1,37 +1,38 @@
|
|
|
1
|
-
(function(){"use strict";(r=>{window.__mbCameraManagerCssCode=r})("._dialogPositioner_15i6c_1{position:fixed;top:calc(var(--mb-size)*0rem);left:calc(var(--mb-size)*0rem);display:grid;height:100vh;width:100%;padding:calc(var(--mb-size)*2rem)}@supports (height:100dvh){._dialogPositioner_15i6c_1{height:100dvh}}@media (max-width: 379.9px){._dialogPositioner_15i6c_1{padding:calc(var(--mb-size)*1rem)}}._dialogBackdrop_15i6c_10{position:absolute;top:calc(var(--mb-size)*0rem);left:calc(var(--mb-size)*0rem);width:100%;height:100%;--un-bg-opacity:1;background-color:rgb(var(--color-black-rgb-value) / var(--un-bg-opacity));--un-bg-opacity:.5;--un-backdrop-blur:blur(4px);-webkit-backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia);backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia)}._dialogContent_15i6c_14{position:relative;max-height:calc(100dvh - 4rem);max-width:28rem;display:flex;flex-direction:column;place-self:center;border-radius:.5rem;--un-bg-opacity:1;background-color:rgb(var(--color-white-rgb-value) / var(--un-bg-opacity));padding-left:min(8%,3rem);padding-right:min(8%,3rem);padding-top:min(8%,1.5rem);padding-bottom:min(8%,1.5rem);--un-text-opacity:1;color:rgb(15 15 15 / var(--un-text-opacity));--un-shadow:var(--un-shadow-inset) 0 10px 15px -3px var(--un-shadow-color, rgb(0 0 0 / .1)),var(--un-shadow-inset) 0 4px 6px -4px var(--un-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}._dialogContent_15i6c_14._large_15i6c_18{padding-left:min(8%,4rem);padding-right:min(8%,4rem);padding-top:min(8%,3rem);padding-bottom:min(8%,3rem)}._dialogContent_15i6c_14._compact_15i6c_21{padding:min(8%,1.5rem)}@media screen and (max-height: 500px){._dialogContent_15i6c_14._compact_15i6c_21{height:auto}}@media screen and (max-height: 500px){._dialogContent_15i6c_14{height:100%;max-height:calc(100dvh - 2rem);overflow:hidden;padding-left:min(8%,1.5rem);padding-right:min(8%,1.5rem);padding-top:min(8%,.5rem);padding-bottom:min(8%,.5rem)}}@media (min-width: 640px){._dialogContent_15i6c_14{max-width:36rem}}@media (min-width: 1024px){._dialogContent_15i6c_14{max-width:28rem}}._dialogTitle_15i6c_45{text-align:center;font-size:calc(var(--mb-size)*1.5rem);line-height:calc(var(--mb-size)*2rem);font-weight:700}._contentOut_15i6c_49{height:100%}._closeButton_15i6c_53{position:absolute;top:.625rem;right:.625rem;width:calc(var(--mb-size)*2rem);height:calc(var(--mb-size)*2rem);display:flex;align-items:center;justify-content:center;border-style:none;background-color:transparent;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s;transition-duration:.1s}._closeButton_15i6c_53:hover{--un-bg-opacity:1;background-color:rgb(var(--color-gray-100-rgb-value) / var(--un-bg-opacity))}._closeButton_15i6c_53:active{--un-bg-opacity:1;background-color:rgb(var(--color-gray-200-rgb-value) / var(--un-bg-opacity))}._closeButtonInner_15i6c_59{width:.875rem;height:.875rem}._primaryActionButton_15i6c_63{height:2.5rem;-webkit-appearance:none;appearance:none;border-radius:calc(var(--mb-size)*2.5rem);border-style:none;--un-bg-opacity:1;background-color:rgb(var(--color-primary) / var(--un-bg-opacity));padding-left:calc(var(--mb-size)*1.25rem);padding-right:calc(var(--mb-size)*1.25rem);padding-top:calc(var(--mb-size)*.25rem);padding-bottom:calc(var(--mb-size)*.25rem);text-wrap:nowrap;font-size:calc(var(--mb-size)*.875rem);line-height:calc(var(--mb-size)*1.25rem);--un-text-opacity:1;color:rgb(var(--color-white-rgb-value) / var(--un-text-opacity));transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s;transition-duration:.1s}._primaryActionButton_15i6c_63[disabled]{cursor:not-allowed;--un-bg-opacity:1;background-color:rgb(var(--color-gray-200-rgb-value) / var(--un-bg-opacity));--un-text-opacity:1;color:rgb(var(--color-gray-500-rgb-value) / var(--un-text-opacity));--un-ring-width:0px;--un-ring-offset-shadow:var(--un-ring-inset) 0 0 0 var(--un-ring-offset-width) var(--un-ring-offset-color);--un-ring-shadow:var(--un-ring-inset) 0 0 0 calc(var(--un-ring-width) + var(--un-ring-offset-width)) var(--un-ring-color);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}._primaryActionButton_15i6c_63[disabled]:hover{--un-bg-opacity:1;background-color:rgb(var(--color-gray-200-rgb-value) / var(--un-bg-opacity));--un-text-opacity:1;color:rgb(var(--color-gray-500-rgb-value) / var(--un-text-opacity))}._primaryActionButton_15i6c_63:hover{--un-bg-opacity:1;background-color:rgb(var(--color-accent-700-rgb-value) / var(--un-bg-opacity))}._primaryActionButton_15i6c_63:active{--un-bg-opacity:1;background-color:rgb(var(--color-accent-800-rgb-value) / var(--un-bg-opacity))}._primaryActionButton_15i6c_63:focus-visible{outline-width:2px;--un-outline-color-opacity:1;outline-color:rgb(var(--color-primary) / var(--un-outline-color-opacity));outline-offset:4px;outline-style:solid}._secondaryActionButton_15i6c_67{height:2.5rem;-webkit-appearance:none;appearance:none;border-radius:calc(var(--mb-size)*2.5rem);border-style:none;background-color:transparent;padding-left:calc(var(--mb-size)*1.25rem);padding-right:calc(var(--mb-size)*1.25rem);padding-top:calc(var(--mb-size)*.25rem);padding-bottom:calc(var(--mb-size)*.25rem);text-wrap:nowrap;font-size:calc(var(--mb-size)*.875rem);line-height:calc(var(--mb-size)*1.25rem);--un-text-opacity:1;color:rgb(var(--color-primary) / var(--un-text-opacity));--un-ring-width:1px;--un-ring-offset-shadow:var(--un-ring-inset) 0 0 0 var(--un-ring-offset-width) var(--un-ring-offset-color);--un-ring-shadow:var(--un-ring-inset) 0 0 0 calc(var(--un-ring-width) + var(--un-ring-offset-width)) var(--un-ring-color);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow);--un-ring-opacity:1;--un-ring-color:rgb(var(--color-primary) / var(--un-ring-opacity)) ;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s;transition-duration:.1s}._secondaryActionButton_15i6c_67[disabled]{cursor:not-allowed;--un-bg-opacity:1;background-color:rgb(var(--color-gray-200-rgb-value) / var(--un-bg-opacity));--un-text-opacity:1;color:rgb(var(--color-gray-500-rgb-value) / var(--un-text-opacity));--un-ring-width:0px;--un-ring-offset-shadow:var(--un-ring-inset) 0 0 0 var(--un-ring-offset-width) var(--un-ring-offset-color);--un-ring-shadow:var(--un-ring-inset) 0 0 0 calc(var(--un-ring-width) + var(--un-ring-offset-width)) var(--un-ring-color);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}._secondaryActionButton_15i6c_67[disabled]:hover{--un-bg-opacity:1;background-color:rgb(var(--color-gray-200-rgb-value) / var(--un-bg-opacity));--un-text-opacity:1;color:rgb(var(--color-gray-500-rgb-value) / var(--un-text-opacity))}._secondaryActionButton_15i6c_67:hover{--un-bg-opacity:1;background-color:rgb(var(--color-accent-25-rgb-value) / var(--un-bg-opacity));--un-text-opacity:1;color:rgb(var(--color-accent-700-rgb-value) / var(--un-text-opacity));--un-ring-opacity:1;--un-ring-color:rgb(var(--color-accent-700-rgb-value) / var(--un-ring-opacity)) }._secondaryActionButton_15i6c_67:active{--un-bg-opacity:1;background-color:rgb(var(--color-accent-50-rgb-value) / var(--un-bg-opacity));--un-text-opacity:1;color:rgb(var(--color-accent-800-rgb-value) / var(--un-text-opacity));--un-ring-opacity:1;--un-ring-color:rgb(var(--color-accent-800-rgb-value) / var(--un-ring-opacity)) }._secondaryActionButton_15i6c_67:focus-visible{outline-width:2px;--un-outline-color-opacity:1;outline-color:rgb(var(--color-primary) / var(--un-outline-color-opacity));outline-offset:4px;outline-style:solid}._actions_15i6c_71{display:flex;gap:calc(var(--mb-size)*1rem)}._actions_15i6c_71 ._primaryActionButton_15i6c_63,._actions_15i6c_71 ._secondaryActionButton_15i6c_67{width:50%}._alertTitle_15i6c_79{font-size:calc(var(--mb-size)*1.125rem);line-height:calc(var(--mb-size)*1.75rem);--un-text-opacity:1;color:rgb(var(--color-gray-700-rgb-value) / var(--un-text-opacity));font-weight:400}._alertText_15i6c_83{margin-top:calc(var(--mb-size)*1rem);margin-bottom:calc(var(--mb-size)*2rem);padding-left:calc(var(--mb-size)*.5rem);padding-right:calc(var(--mb-size)*.5rem);text-align:center;text-wrap:pretty;--un-text-opacity:1;color:rgb(var(--color-gray-500-rgb-value) / var(--un-text-opacity));font-weight:300;line-height:1.5}*,:before,:after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }::backdrop{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }.btn-focus:focus-visible{outline-width:2px;--un-outline-color-opacity:1;outline-color:rgb(var(--color-primary) / var(--un-outline-color-opacity));outline-offset:4px;outline-style:solid}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.left-0{left:calc(var(--mb-size)*0rem)}.right-4{right:calc(var(--mb-size)*1rem)}.top-0{top:calc(var(--mb-size)*0rem)}.has-\\[\\[data-scope\\]\\]\\:z-2:has([data-scope]),.z-2{z-index:2}.z-1{z-index:1}.grid{display:grid}.auto-cols-auto{grid-auto-columns:auto}.grid-cols-\\[1fr_auto_1fr\\]{grid-template-columns:1fr auto 1fr}.block{display:block}.size-12{width:calc(var(--mb-size)*3rem);height:calc(var(--mb-size)*3rem)}.size-6{width:calc(var(--mb-size)*1.5rem);height:calc(var(--mb-size)*1.5rem)}.size-full{width:100%;height:100%}.h-full{height:100%}.h-vh{height:100vh}.max-w-\\[100\\%\\]{max-width:100%}.min-h-\\[300px\\]{min-height:300px}.min-w-0{min-width:calc(var(--mb-size)*0rem)}.w-full{width:100%}.flex{display:flex}.shrink-0{flex-shrink:0}.flex-col{flex-direction:column}.flex-nowrap{flex-wrap:nowrap}.data-\\[state\\=open\\]\\:scale-y-\\[-1\\][data-state=open]{--un-scale-y:-1;transform:translate(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotate(var(--un-rotate-z)) skew(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}.transform{transform:translate(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotate(var(--un-rotate-z)) skew(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}.cursor-pointer{cursor:pointer}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.select-none{-webkit-user-select:none;user-select:none}.resize{resize:both}.appearance-none{-webkit-appearance:none;appearance:none}.place-items-center{place-items:center}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-self-start{justify-self:start}.justify-self-end{justify-self:end}.justify-self-center{justify-self:center}.gap-\\[1px\\]{gap:1px}.gap-2{gap:calc(var(--mb-size)*.5rem)}.gap-4{gap:calc(var(--mb-size)*1rem)}.overflow-hidden{overflow:hidden}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.border-2{border-width:2px}.border-transparent{border-color:transparent}.data-\\[highlighted\\]\\:border-primary[data-highlighted]{--un-border-opacity:1;border-color:rgb(var(--color-primary) / var(--un-border-opacity))}.rounded-4{border-radius:calc(var(--mb-size)*1rem)}.rounded-full{border-radius:9999px}.rounded-md{border-radius:.375rem}.rounded-b-6{border-bottom-left-radius:calc(var(--mb-size)*1.5rem);border-bottom-right-radius:calc(var(--mb-size)*1.5rem)}.rounded-t-6{border-top-left-radius:calc(var(--mb-size)*1.5rem);border-top-right-radius:calc(var(--mb-size)*1.5rem)}.border-none{border-style:none}.border-solid{border-style:solid}.bg-dark-500{--un-bg-opacity:1;background-color:rgb(31 31 31 / var(--un-bg-opacity))}.bg-gray-550\\/50{background-color:rgb(var(--color-gray-550-rgb-value) / .5)}.bg-gray-550\\/70{background-color:rgb(var(--color-gray-550-rgb-value) / .7)}.bg-gray-550\\/90{background-color:rgb(var(--color-gray-550-rgb-value) / .9)}.p-2{padding:calc(var(--mb-size)*.5rem)}.px-4{padding-left:calc(var(--mb-size)*1rem);padding-right:calc(var(--mb-size)*1rem)}.py-2{padding-top:calc(var(--mb-size)*.5rem);padding-bottom:calc(var(--mb-size)*.5rem)}.py-3{padding-top:calc(var(--mb-size)*.75rem);padding-bottom:calc(var(--mb-size)*.75rem)}.py-4{padding-top:calc(var(--mb-size)*1rem);padding-bottom:calc(var(--mb-size)*1rem)}.pl-4{padding-left:calc(var(--mb-size)*1rem)}.pr-12{padding-right:calc(var(--mb-size)*3rem)}.text-align-center{text-align:center}.text-base{font-size:calc(var(--mb-size)*1rem);line-height:calc(var(--mb-size)*1.5rem)}.text-sm{font-size:calc(var(--mb-size)*.875rem);line-height:calc(var(--mb-size)*1.25rem)}.color-white{--un-text-opacity:1;color:rgb(var(--color-white-rgb-value) / var(--un-text-opacity))}.font-500{font-weight:500}.disabled\\:opacity-50:disabled{opacity:.5}.shadow{--un-shadow:var(--un-shadow-inset) 0 1px 3px 0 var(--un-shadow-color, rgb(0 0 0 / .1)),var(--un-shadow-inset) 0 1px 2px -1px var(--un-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.backdrop-blur{--un-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia);backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia)}.backdrop-blur-xl{--un-backdrop-blur:blur(24px);-webkit-backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia);backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia)}.drop-shadow-md{--un-drop-shadow:drop-shadow(0 4px 3px var(--un-drop-shadow-color, rgb(0 0 0 / .07))) drop-shadow(0 2px 2px var(--un-drop-shadow-color, rgb(0 0 0 / .06)));filter:var(--un-blur) var(--un-brightness) var(--un-contrast) var(--un-drop-shadow) var(--un-grayscale) var(--un-hue-rotate) var(--un-invert) var(--un-saturate) var(--un-sepia)}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.lerp\\:px-3\\@xs\\,8\\@lg{padding-inline:clamp(calc(var(--mb-size)*.75rem),calc(var(--mb-size)*.75rem) + (100vw - 380px) * .031055900621118012,calc(var(--mb-size)*2rem))}@supports (height:100dvh){.supports-\\[\\(height\\:100dvh\\)\\]\\:h-dvh{height:100dvh}}")})();
|
|
1
|
+
(function(){"use strict";(r=>{window.__mbCameraManagerCssCode=r})(".dropdown-content{border-radius:calc(var(--mb-size) * 1rem + 8px);max-height:calc(var(--available-height) - 1rem);overflow:auto}*,:before,:after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }::backdrop{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgb(0 0 0 / 0);--un-ring-shadow:0 0 rgb(0 0 0 / 0);--un-shadow-inset: ;--un-shadow:0 0 rgb(0 0 0 / 0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgb(147 197 253 / .5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }.dialog-description{margin-top:1em;text-align:center;text-wrap:pretty;font-size:1em;--un-text-opacity:1;color:rgb(var(--color-gray-500-rgb-value) / var(--un-text-opacity));line-height:calc(1em + .5rem)}.btn{height:2.5rem;-webkit-appearance:none;appearance:none;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-radius:calc(var(--mb-size)*2.5rem);border-style:none;padding-left:calc(var(--mb-size)*1.5rem);padding-right:calc(var(--mb-size)*1.5rem);padding-top:calc(var(--mb-size)*.25rem);padding-bottom:calc(var(--mb-size)*.25rem);text-wrap:nowrap;font-size:calc(var(--mb-size)*.875rem);line-height:calc(var(--mb-size)*1.25rem);transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s;transition-duration:.1s}.btn:disabled{cursor:not-allowed}.btn-primary{--un-bg-opacity:1;background-color:rgb(var(--color-primary) / var(--un-bg-opacity));--un-text-opacity:1;color:rgb(var(--color-white-rgb-value) / var(--un-text-opacity))}.btn-secondary{background-color:transparent;--un-text-opacity:1;color:rgb(var(--color-primary) / var(--un-text-opacity));--un-ring-width:1px;--un-ring-offset-shadow:var(--un-ring-inset) 0 0 0 var(--un-ring-offset-width) var(--un-ring-offset-color);--un-ring-shadow:var(--un-ring-inset) 0 0 0 calc(var(--un-ring-width) + var(--un-ring-offset-width)) var(--un-ring-color);box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow);--un-ring-opacity:1;--un-ring-color:rgb(var(--color-primary) / var(--un-ring-opacity)) }.btn-primary:enabled:hover{--un-bg-opacity:1;background-color:rgb(var(--color-accent-700-rgb-value) / var(--un-bg-opacity))}.btn-secondary:enabled:hover{--un-bg-opacity:1;background-color:rgb(var(--color-accent-25-rgb-value) / var(--un-bg-opacity));--un-text-opacity:1;color:rgb(var(--color-accent-700-rgb-value) / var(--un-text-opacity));--un-ring-opacity:1;--un-ring-color:rgb(var(--color-accent-700-rgb-value) / var(--un-ring-opacity)) }.btn-primary:enabled:active{--un-bg-opacity:1;background-color:rgb(var(--color-accent-800-rgb-value) / var(--un-bg-opacity))}.btn-secondary:enabled:active{--un-bg-opacity:1;background-color:rgb(var(--color-accent-50-rgb-value) / var(--un-bg-opacity));--un-text-opacity:1;color:rgb(var(--color-accent-800-rgb-value) / var(--un-text-opacity));--un-ring-opacity:1;--un-ring-color:rgb(var(--color-accent-800-rgb-value) / var(--un-ring-opacity)) }.btn-primary:disabled{--un-bg-opacity:1;background-color:rgb(var(--color-gray-300-rgb-value) / var(--un-bg-opacity));--un-text-opacity:1;color:rgb(var(--color-gray-500-rgb-value) / var(--un-text-opacity))}.dialog-title{text-align:center;text-wrap:pretty;font-size:1.5em;--un-text-opacity:1;color:rgb(var(--color-gray-700-rgb-value) / var(--un-text-opacity));font-weight:700;line-height:calc(1em + .5rem)}.btn-secondary:disabled{--un-text-opacity:1;color:rgb(var(--color-gray-400-rgb-value) / var(--un-text-opacity));--un-ring-opacity:1;--un-ring-color:rgb(var(--color-gray-400-rgb-value) / var(--un-ring-opacity)) }.btn:enabled:focus-visible{outline-width:2px;--un-outline-color-opacity:1;outline-color:rgb(var(--color-primary) / var(--un-outline-color-opacity));outline-offset:4px;outline-style:solid}.btn-focus:enabled:focus-visible{outline-width:2px;--un-outline-color-opacity:1;outline-color:rgb(var(--color-primary) / var(--un-outline-color-opacity));outline-offset:4px;outline-style:solid}.\\[--modal-t\\:0\\]{--modal-t:0}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.left-0{left:calc(var(--mb-size)*0rem)}.right-2\\.5{right:.625rem}.right-4{right:calc(var(--mb-size)*1rem)}.top-0{top:calc(var(--mb-size)*0rem)}.top-2\\.5{top:.625rem}.has-\\[\\[data-scope\\]\\]\\:z-2:has([data-scope]),.z-2{z-index:2}.z-1{z-index:1}.grid{display:grid}.auto-cols-auto{grid-auto-columns:auto}.grid-cols-\\[1fr_auto_1fr\\]{grid-template-columns:1fr auto 1fr}.block{display:block}.size-12{width:calc(var(--mb-size)*3rem);height:calc(var(--mb-size)*3rem)}.size-6{width:calc(var(--mb-size)*1.5rem);height:calc(var(--mb-size)*1.5rem)}.size-full{width:100%;height:100%}.h-3\\.5{height:.875rem}.h-8{height:calc(var(--mb-size)*2rem)}.h-full{height:100%}.h-vh{height:100vh}.max-h-full{max-height:100%}.max-w-\\[100\\%\\]{max-width:100%}.max-w-\\[30ch\\]{max-width:30ch}.min-h-\\[300px\\]{min-height:300px}.min-h-0{min-height:calc(var(--mb-size)*0rem)}.min-w-0{min-width:calc(var(--mb-size)*0rem)}.w-\\[min\\(540px\\,100\\%\\)\\]{width:min(540px,100%)}.w-100dvw{width:100dvw}.w-3\\.5{width:.875rem}.w-8{width:calc(var(--mb-size)*2rem)}.w-full{width:100%}.flex{display:flex}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.flex-col{flex-direction:column}.flex-nowrap{flex-wrap:nowrap}.data-\\[state\\=open\\]\\:scale-y-\\[-1\\][data-state=open]{--un-scale-y:-1;transform:translate(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotate(var(--un-rotate-z)) skew(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}.transform{transform:translate(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotate(var(--un-rotate-z)) skew(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z))}.cursor-pointer{cursor:pointer}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.select-none{-webkit-user-select:none;user-select:none}.resize{resize:both}.appearance-none{-webkit-appearance:none;appearance:none}.place-items-center{place-items:center}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.justify-self-start{justify-self:start}.justify-self-end{justify-self:end}.justify-self-center{justify-self:center}.gap-2{gap:calc(var(--mb-size)*.5rem)}.gap-4{gap:calc(var(--mb-size)*1rem)}.gap-6{gap:calc(var(--mb-size)*1.5rem)}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.not-first-of-type-b-t-1:not(:first-of-type){border-top-width:1px}.not-first-of-type-b-t-gray-300\\/50:not(:first-of-type){border-top-color:rgb(var(--color-gray-300-rgb-value) / .5)}.rounded-2{border-radius:calc(var(--mb-size)*.5rem)}.rounded-4{border-radius:calc(var(--mb-size)*1rem)}.rounded-full{border-radius:9999px}.rounded-md{border-radius:.375rem}.first-of-type-rounded-t-6:first-of-type{border-top-left-radius:calc(var(--mb-size)*1.5rem);border-top-right-radius:calc(var(--mb-size)*1.5rem)}.last-of-type-rounded-b-6:last-of-type{border-bottom-left-radius:calc(var(--mb-size)*1.5rem);border-bottom-right-radius:calc(var(--mb-size)*1.5rem)}.border-none{border-style:none}.not-first-of-type-b-t-solid:not(:first-of-type){border-top-style:solid}.bg-black{--un-bg-opacity:1;background-color:rgb(var(--color-black-rgb-value) / var(--un-bg-opacity))}.bg-dark-500{--un-bg-opacity:1;background-color:rgb(31 31 31 / var(--un-bg-opacity))}.bg-gray-550\\/50{background-color:rgb(var(--color-gray-550-rgb-value) / .5)}.bg-gray-550\\/70{background-color:rgb(var(--color-gray-550-rgb-value) / .7)}.bg-gray-550\\/90{background-color:rgb(var(--color-gray-550-rgb-value) / .9)}.bg-transparent{background-color:transparent}.bg-white{--un-bg-opacity:1;background-color:rgb(var(--color-white-rgb-value) / var(--un-bg-opacity))}.data-\\[highlighted\\]\\:bg-gray-550\\/100[data-highlighted]{background-color:rgb(var(--color-gray-550-rgb-value) / 1)}.hover\\:bg-gray-100:hover{--un-bg-opacity:1;background-color:rgb(var(--color-gray-100-rgb-value) / var(--un-bg-opacity))}.active\\:bg-gray-200:active{--un-bg-opacity:1;background-color:rgb(var(--color-gray-200-rgb-value) / var(--un-bg-opacity))}.bg-opacity-50{--un-bg-opacity:.5}.p-\\[clamp\\(1\\.5rem\\,6dvmin\\,3rem\\)\\]{padding:clamp(1.5rem,6dvmin,3rem)}.p-2{padding:calc(var(--mb-size)*.5rem)}.px-4{padding-left:calc(var(--mb-size)*1rem);padding-right:calc(var(--mb-size)*1rem)}.py-2{padding-top:calc(var(--mb-size)*.5rem);padding-bottom:calc(var(--mb-size)*.5rem)}.py-3{padding-top:calc(var(--mb-size)*.75rem);padding-bottom:calc(var(--mb-size)*.75rem)}.py-4{padding-top:calc(var(--mb-size)*1rem);padding-bottom:calc(var(--mb-size)*1rem)}.pl-4{padding-left:calc(var(--mb-size)*1rem)}.pr-12{padding-right:calc(var(--mb-size)*3rem)}.text-align-center{text-align:center}.text-base{font-size:calc(var(--mb-size)*1rem);line-height:calc(var(--mb-size)*1.5rem)}.text-sm{font-size:calc(var(--mb-size)*.875rem);line-height:calc(var(--mb-size)*1.25rem)}.text-\\[calc\\(0\\.875rem\\+0\\.125rem\\*var\\(--modal-t\\)\\)\\]{font-size:calc(.875rem + .125rem * var(--modal-t))}.color-dark-900{--un-text-opacity:1;color:rgb(15 15 15 / var(--un-text-opacity))}.color-white{--un-text-opacity:1;color:rgb(var(--color-white-rgb-value) / var(--un-text-opacity))}.font-500{font-weight:500}.disabled\\:opacity-50:disabled{opacity:.5}.shadow{--un-shadow:var(--un-shadow-inset) 0 1px 3px 0 var(--un-shadow-color, rgb(0 0 0 / .1)),var(--un-shadow-inset) 0 1px 2px -1px var(--un-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.shadow-lg{--un-shadow:var(--un-shadow-inset) 0 10px 15px -3px var(--un-shadow-color, rgb(0 0 0 / .1)),var(--un-shadow-inset) 0 4px 6px -4px var(--un-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--un-ring-offset-shadow),var(--un-ring-shadow),var(--un-shadow)}.focus-visible\\:outline-2px:focus-visible{outline-width:2px}.focus-visible\\:outline-primary:focus-visible{--un-outline-color-opacity:1;outline-color:rgb(var(--color-primary) / var(--un-outline-color-opacity))}.focus-visible\\:outline-offset-4px:focus-visible{outline-offset:4px}.focus-visible\\:outline:focus-visible{outline-style:solid}.focus-visible\\:outline-solid:focus-visible{outline-style:solid}.backdrop-blur{--un-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia);backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia)}.backdrop-blur-sm{--un-backdrop-blur:blur(4px);-webkit-backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia);backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia)}.backdrop-blur-xl{--un-backdrop-blur:blur(24px);-webkit-backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia);backdrop-filter:var(--un-backdrop-blur) var(--un-backdrop-brightness) var(--un-backdrop-contrast) var(--un-backdrop-grayscale) var(--un-backdrop-hue-rotate) var(--un-backdrop-invert) var(--un-backdrop-opacity) var(--un-backdrop-saturate) var(--un-backdrop-sepia)}.drop-shadow-md{--un-drop-shadow:drop-shadow(0 4px 3px var(--un-drop-shadow-color, rgb(0 0 0 / .07))) drop-shadow(0 2px 2px var(--un-drop-shadow-color, rgb(0 0 0 / .06)));filter:var(--un-blur) var(--un-brightness) var(--un-contrast) var(--un-drop-shadow) var(--un-grayscale) var(--un-hue-rotate) var(--un-invert) var(--un-saturate) var(--un-sepia)}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-300{transition-duration:.3s}.transition-duration-100{transition-duration:.1s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.lerp\\:px-3\\@xs\\,8\\@lg{padding-inline:clamp(calc(var(--mb-size)*.75rem),calc(var(--mb-size)*.75rem) + (100vw - 380px) * .031055900621118012,calc(var(--mb-size)*2rem))}.h-100dvh{height:100dvh}@media (max-height: 639.9px){.lt-h-sm\\:gap-4{gap:calc(var(--mb-size)*1rem)}}@supports (height:100dvh){.supports-\\[\\(height\\:100dvh\\)\\]\\:h-dvh{height:100dvh}}")})();
|
|
2
2
|
import { subscribeWithSelector as ue } from "zustand/middleware";
|
|
3
3
|
import { shallow as ge } from "zustand/shallow";
|
|
4
4
|
import { createStore as de } from "zustand/vanilla";
|
|
5
|
-
import { createComponent as c, use as V, template as
|
|
6
|
-
import { createContext as
|
|
7
|
-
import { createWithSignal as
|
|
8
|
-
import { createStore as
|
|
9
|
-
import { EnvironmentProvider as
|
|
10
|
-
import { Dialog as
|
|
11
|
-
import { Select as
|
|
12
|
-
import { Tooltip as
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
import { createComponent as c, use as V, template as w, spread as A, mergeProps as H, insert as y, memo as Ee, isServer as he, Portal as ke, effect as Te, Dynamic as Ye, render as Je } from "solid-js/web";
|
|
6
|
+
import { createContext as xe, onCleanup as J, useContext as Me, onMount as K, createSignal as I, Show as x, Index as Ze, splitProps as Y, createRoot as oe, getOwner as Re, createEffect as _e, createMemo as et, $TRACK as tt, untrack as rt } from "solid-js";
|
|
7
|
+
import { createWithSignal as Ae } from "solid-zustand";
|
|
8
|
+
import { createStore as at } from "solid-js/store";
|
|
9
|
+
import { EnvironmentProvider as nt } from "@ark-ui/solid/environment";
|
|
10
|
+
import { Dialog as D } from "@ark-ui/solid/dialog";
|
|
11
|
+
import { Select as _, createListCollection as ot } from "@ark-ui/solid/select";
|
|
12
|
+
import { Tooltip as X } from "@ark-ui/solid/tooltip";
|
|
13
|
+
import { Dialog as be } from "@ark-ui/solid";
|
|
14
|
+
typeof HTMLVideoElement < "u" && !("requestVideoFrameCallback" in HTMLVideoElement.prototype) && "getVideoPlaybackQuality" in HTMLVideoElement.prototype && (HTMLVideoElement.prototype._rvfcpolyfillmap = {}, HTMLVideoElement.prototype.requestVideoFrameCallback = function(t) {
|
|
15
|
+
const e = performance.now(), r = this.getVideoPlaybackQuality(), a = this.mozPresentedFrames || this.mozPaintedFrames || r.totalVideoFrames - r.droppedVideoFrames, n = (i, o) => {
|
|
15
16
|
const s = this.getVideoPlaybackQuality(), l = this.mozPresentedFrames || this.mozPaintedFrames || s.totalVideoFrames - s.droppedVideoFrames;
|
|
16
17
|
if (l > a) {
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
presentationTime:
|
|
20
|
-
expectedDisplayTime:
|
|
18
|
+
const d = this.mozFrameDelay || s.totalFrameDelay - r.totalFrameDelay || 0, u = o - i;
|
|
19
|
+
t(o, {
|
|
20
|
+
presentationTime: o + d * 1e3,
|
|
21
|
+
expectedDisplayTime: o + u,
|
|
21
22
|
width: this.videoWidth,
|
|
22
23
|
height: this.videoHeight,
|
|
23
|
-
mediaTime: Math.max(0, this.currentTime || 0) +
|
|
24
|
+
mediaTime: Math.max(0, this.currentTime || 0) + u / 1e3,
|
|
24
25
|
presentedFrames: l,
|
|
25
|
-
processingDuration:
|
|
26
|
+
processingDuration: d
|
|
26
27
|
}), delete this._rvfcpolyfillmap[e];
|
|
27
28
|
} else
|
|
28
|
-
this._rvfcpolyfillmap[e] = requestAnimationFrame((
|
|
29
|
+
this._rvfcpolyfillmap[e] = requestAnimationFrame((d) => n(o, d));
|
|
29
30
|
};
|
|
30
|
-
return this._rvfcpolyfillmap[e] = requestAnimationFrame((
|
|
31
|
-
}, HTMLVideoElement.prototype.cancelVideoFrameCallback = function(
|
|
32
|
-
cancelAnimationFrame(this._rvfcpolyfillmap[
|
|
31
|
+
return this._rvfcpolyfillmap[e] = requestAnimationFrame((i) => n(e, i)), e;
|
|
32
|
+
}, HTMLVideoElement.prototype.cancelVideoFrameCallback = function(t) {
|
|
33
|
+
cancelAnimationFrame(this._rvfcpolyfillmap[t]), delete this._rvfcpolyfillmap[t];
|
|
33
34
|
});
|
|
34
|
-
class
|
|
35
|
+
class B extends Error {
|
|
35
36
|
code;
|
|
36
37
|
/**
|
|
37
38
|
* Creates a new camera error.
|
|
@@ -40,11 +41,11 @@ class U extends Error {
|
|
|
40
41
|
* @param code - The error code.
|
|
41
42
|
* @param cause - The cause of the error.
|
|
42
43
|
*/
|
|
43
|
-
constructor(e,
|
|
44
|
-
super(e), this.code =
|
|
44
|
+
constructor(e, r, a) {
|
|
45
|
+
super(e), this.code = r, this.cause = a;
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
|
-
const
|
|
48
|
+
const it = [
|
|
48
49
|
// English
|
|
49
50
|
"back",
|
|
50
51
|
"rear",
|
|
@@ -115,7 +116,7 @@ const rt = [
|
|
|
115
116
|
"बैक",
|
|
116
117
|
// Latin American Spanish
|
|
117
118
|
"posterior"
|
|
118
|
-
],
|
|
119
|
+
], st = [
|
|
119
120
|
// English
|
|
120
121
|
"front",
|
|
121
122
|
// German
|
|
@@ -182,38 +183,38 @@ const rt = [
|
|
|
182
183
|
"फ्रंट",
|
|
183
184
|
// Latin American Spanish
|
|
184
185
|
"frontal"
|
|
185
|
-
],
|
|
186
|
-
var
|
|
187
|
-
function
|
|
188
|
-
for (var a = 0; a <
|
|
189
|
-
var n =
|
|
186
|
+
], De = (t, e) => e.some((r) => t.toLowerCase().includes(r)), Ie = (t) => De(t, it), Fe = (t) => De(t, st);
|
|
187
|
+
var lt = /* @__PURE__ */ function() {
|
|
188
|
+
function t(e, r) {
|
|
189
|
+
for (var a = 0; a < r.length; a++) {
|
|
190
|
+
var n = r[a];
|
|
190
191
|
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, n.key, n);
|
|
191
192
|
}
|
|
192
193
|
}
|
|
193
|
-
return function(e,
|
|
194
|
-
return
|
|
194
|
+
return function(e, r, a) {
|
|
195
|
+
return r && t(e.prototype, r), a && t(e, a), e;
|
|
195
196
|
};
|
|
196
|
-
}(),
|
|
197
|
-
function
|
|
198
|
-
return Object.freeze(Object.defineProperties(
|
|
197
|
+
}(), ct = ut(["", ""], ["", ""]);
|
|
198
|
+
function ut(t, e) {
|
|
199
|
+
return Object.freeze(Object.defineProperties(t, { raw: { value: Object.freeze(e) } }));
|
|
199
200
|
}
|
|
200
|
-
function
|
|
201
|
-
if (!(
|
|
201
|
+
function dt(t, e) {
|
|
202
|
+
if (!(t instanceof e))
|
|
202
203
|
throw new TypeError("Cannot call a class as a function");
|
|
203
204
|
}
|
|
204
|
-
var
|
|
205
|
-
function
|
|
206
|
-
for (var e = this,
|
|
205
|
+
var E = function() {
|
|
206
|
+
function t() {
|
|
207
|
+
for (var e = this, r = arguments.length, a = Array(r), n = 0; n < r; n++)
|
|
207
208
|
a[n] = arguments[n];
|
|
208
|
-
return
|
|
209
|
-
for (var
|
|
209
|
+
return dt(this, t), this.tag = function(i) {
|
|
210
|
+
for (var o = arguments.length, s = Array(o > 1 ? o - 1 : 0), l = 1; l < o; l++)
|
|
210
211
|
s[l - 1] = arguments[l];
|
|
211
|
-
return typeof
|
|
212
|
-
}, a.length > 0 && Array.isArray(a[0]) && (a = a[0]), this.transformers = a.map(function(
|
|
213
|
-
return typeof
|
|
212
|
+
return typeof i == "function" ? e.interimTag.bind(e, i) : typeof i == "string" ? e.transformEndResult(i) : (i = i.map(e.transformString.bind(e)), e.transformEndResult(i.reduce(e.processSubstitutions.bind(e, s))));
|
|
213
|
+
}, a.length > 0 && Array.isArray(a[0]) && (a = a[0]), this.transformers = a.map(function(i) {
|
|
214
|
+
return typeof i == "function" ? i() : i;
|
|
214
215
|
}), this.tag;
|
|
215
216
|
}
|
|
216
|
-
return
|
|
217
|
+
return lt(t, [{
|
|
217
218
|
key: "interimTag",
|
|
218
219
|
/**
|
|
219
220
|
* An intermediary template tag that receives a template tag and passes the result of calling the template with the received
|
|
@@ -223,10 +224,10 @@ var _ = function() {
|
|
|
223
224
|
* @param {...*} ...substitutions - `substitutions` is an array of all substitutions in the template
|
|
224
225
|
* @return {*} - the final processed value
|
|
225
226
|
*/
|
|
226
|
-
value: function(
|
|
227
|
-
for (var n = arguments.length,
|
|
228
|
-
o
|
|
229
|
-
return this.tag(
|
|
227
|
+
value: function(r, a) {
|
|
228
|
+
for (var n = arguments.length, i = Array(n > 2 ? n - 2 : 0), o = 2; o < n; o++)
|
|
229
|
+
i[o - 2] = arguments[o];
|
|
230
|
+
return this.tag(ct, r.apply(void 0, [a].concat(i)));
|
|
230
231
|
}
|
|
231
232
|
/**
|
|
232
233
|
* Performs bulk processing on the tagged template, transforming each substitution and then
|
|
@@ -238,9 +239,9 @@ var _ = function() {
|
|
|
238
239
|
*/
|
|
239
240
|
}, {
|
|
240
241
|
key: "processSubstitutions",
|
|
241
|
-
value: function(
|
|
242
|
-
var
|
|
243
|
-
return "".concat(a,
|
|
242
|
+
value: function(r, a, n) {
|
|
243
|
+
var i = this.transformSubstitution(r.shift(), a);
|
|
244
|
+
return "".concat(a, i, n);
|
|
244
245
|
}
|
|
245
246
|
/**
|
|
246
247
|
* Iterate through each transformer, applying the transformer's `onString` method to the template
|
|
@@ -250,11 +251,11 @@ var _ = function() {
|
|
|
250
251
|
*/
|
|
251
252
|
}, {
|
|
252
253
|
key: "transformString",
|
|
253
|
-
value: function(
|
|
254
|
-
var a = function(
|
|
255
|
-
return
|
|
254
|
+
value: function(r) {
|
|
255
|
+
var a = function(i, o) {
|
|
256
|
+
return o.onString ? o.onString(i) : i;
|
|
256
257
|
};
|
|
257
|
-
return this.transformers.reduce(a,
|
|
258
|
+
return this.transformers.reduce(a, r);
|
|
258
259
|
}
|
|
259
260
|
/**
|
|
260
261
|
* When a substitution is encountered, iterates through each transformer and applies the transformer's
|
|
@@ -265,11 +266,11 @@ var _ = function() {
|
|
|
265
266
|
*/
|
|
266
267
|
}, {
|
|
267
268
|
key: "transformSubstitution",
|
|
268
|
-
value: function(
|
|
269
|
-
var n = function(
|
|
270
|
-
return s.onSubstitution ? s.onSubstitution(
|
|
269
|
+
value: function(r, a) {
|
|
270
|
+
var n = function(o, s) {
|
|
271
|
+
return s.onSubstitution ? s.onSubstitution(o, a) : o;
|
|
271
272
|
};
|
|
272
|
-
return this.transformers.reduce(n,
|
|
273
|
+
return this.transformers.reduce(n, r);
|
|
273
274
|
}
|
|
274
275
|
/**
|
|
275
276
|
* Iterates through each transformer, applying the transformer's `onEndResult` method to the
|
|
@@ -279,14 +280,14 @@ var _ = function() {
|
|
|
279
280
|
*/
|
|
280
281
|
}, {
|
|
281
282
|
key: "transformEndResult",
|
|
282
|
-
value: function(
|
|
283
|
-
var a = function(
|
|
284
|
-
return
|
|
283
|
+
value: function(r) {
|
|
284
|
+
var a = function(i, o) {
|
|
285
|
+
return o.onEndResult ? o.onEndResult(i) : i;
|
|
285
286
|
};
|
|
286
|
-
return this.transformers.reduce(a,
|
|
287
|
+
return this.transformers.reduce(a, r);
|
|
287
288
|
}
|
|
288
|
-
}]),
|
|
289
|
-
}(),
|
|
289
|
+
}]), t;
|
|
290
|
+
}(), k = function() {
|
|
290
291
|
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
|
|
291
292
|
return {
|
|
292
293
|
onEndResult: function(a) {
|
|
@@ -300,25 +301,25 @@ var _ = function() {
|
|
|
300
301
|
}
|
|
301
302
|
};
|
|
302
303
|
};
|
|
303
|
-
function
|
|
304
|
-
if (Array.isArray(
|
|
305
|
-
for (var e = 0,
|
|
306
|
-
|
|
307
|
-
return
|
|
304
|
+
function ht(t) {
|
|
305
|
+
if (Array.isArray(t)) {
|
|
306
|
+
for (var e = 0, r = Array(t.length); e < t.length; e++)
|
|
307
|
+
r[e] = t[e];
|
|
308
|
+
return r;
|
|
308
309
|
} else
|
|
309
|
-
return Array.from(
|
|
310
|
+
return Array.from(t);
|
|
310
311
|
}
|
|
311
|
-
var
|
|
312
|
+
var N = function() {
|
|
312
313
|
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "initial";
|
|
313
314
|
return {
|
|
314
315
|
onEndResult: function(a) {
|
|
315
316
|
if (e === "initial") {
|
|
316
|
-
var n = a.match(/^[^\S\n]*(?=\S)/gm),
|
|
317
|
+
var n = a.match(/^[^\S\n]*(?=\S)/gm), i = n && Math.min.apply(Math, ht(n.map(function(s) {
|
|
317
318
|
return s.length;
|
|
318
319
|
})));
|
|
319
|
-
if (
|
|
320
|
-
var
|
|
321
|
-
return a.replace(
|
|
320
|
+
if (i) {
|
|
321
|
+
var o = new RegExp("^.{" + i + "}", "gm");
|
|
322
|
+
return a.replace(o, "");
|
|
322
323
|
}
|
|
323
324
|
return a;
|
|
324
325
|
}
|
|
@@ -327,72 +328,72 @@ var L = function() {
|
|
|
327
328
|
throw new Error("Unknown type: " + e);
|
|
328
329
|
}
|
|
329
330
|
};
|
|
330
|
-
},
|
|
331
|
+
}, U = function(e, r) {
|
|
331
332
|
return {
|
|
332
333
|
onEndResult: function(n) {
|
|
333
|
-
if (e == null ||
|
|
334
|
+
if (e == null || r == null)
|
|
334
335
|
throw new Error("replaceResultTransformer requires at least 2 arguments.");
|
|
335
|
-
return n.replace(e,
|
|
336
|
+
return n.replace(e, r);
|
|
336
337
|
}
|
|
337
338
|
};
|
|
338
|
-
},
|
|
339
|
+
}, $ = function(e, r) {
|
|
339
340
|
return {
|
|
340
|
-
onSubstitution: function(n,
|
|
341
|
-
if (e == null ||
|
|
341
|
+
onSubstitution: function(n, i) {
|
|
342
|
+
if (e == null || r == null)
|
|
342
343
|
throw new Error("replaceSubstitutionTransformer requires at least 2 arguments.");
|
|
343
|
-
return n == null ? n : n.toString().replace(e,
|
|
344
|
+
return n == null ? n : n.toString().replace(e, r);
|
|
344
345
|
}
|
|
345
346
|
};
|
|
346
|
-
},
|
|
347
|
+
}, ft = {
|
|
347
348
|
separator: "",
|
|
348
349
|
conjunction: "",
|
|
349
350
|
serial: !1
|
|
350
|
-
},
|
|
351
|
-
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] :
|
|
351
|
+
}, F = function() {
|
|
352
|
+
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ft;
|
|
352
353
|
return {
|
|
353
354
|
onSubstitution: function(a, n) {
|
|
354
355
|
if (Array.isArray(a)) {
|
|
355
|
-
var
|
|
356
|
-
if (
|
|
357
|
-
var
|
|
358
|
-
a = a.slice(0,
|
|
356
|
+
var i = a.length, o = e.separator, s = e.conjunction, l = e.serial, d = n.match(/(\n?[^\S\n]+)$/);
|
|
357
|
+
if (d ? a = a.join(o + d[1]) : a = a.join(o + " "), s && i > 1) {
|
|
358
|
+
var u = a.lastIndexOf(o);
|
|
359
|
+
a = a.slice(0, u) + (l ? o : "") + " " + s + a.slice(u + 1);
|
|
359
360
|
}
|
|
360
361
|
}
|
|
361
362
|
return a;
|
|
362
363
|
}
|
|
363
364
|
};
|
|
364
|
-
},
|
|
365
|
+
}, Le = function(e) {
|
|
365
366
|
return {
|
|
366
367
|
onSubstitution: function(a, n) {
|
|
367
368
|
return typeof a == "string" && a.includes(e) && (a = a.split(e)), a;
|
|
368
369
|
}
|
|
369
370
|
};
|
|
370
|
-
},
|
|
371
|
+
}, pe = function(e) {
|
|
371
372
|
return e != null && !Number.isNaN(e) && typeof e != "boolean";
|
|
372
|
-
},
|
|
373
|
+
}, mt = function() {
|
|
373
374
|
return {
|
|
374
|
-
onSubstitution: function(
|
|
375
|
-
return Array.isArray(
|
|
375
|
+
onSubstitution: function(r) {
|
|
376
|
+
return Array.isArray(r) ? r.filter(pe) : pe(r) ? r : "";
|
|
376
377
|
}
|
|
377
378
|
};
|
|
378
379
|
};
|
|
379
|
-
new
|
|
380
|
-
new
|
|
381
|
-
new
|
|
382
|
-
new
|
|
383
|
-
`),
|
|
384
|
-
new
|
|
385
|
-
`),
|
|
386
|
-
new
|
|
387
|
-
new
|
|
388
|
-
new
|
|
389
|
-
new
|
|
390
|
-
new
|
|
391
|
-
new
|
|
392
|
-
new
|
|
393
|
-
new
|
|
394
|
-
var
|
|
395
|
-
const
|
|
380
|
+
new E(F({ separator: "," }), N, k);
|
|
381
|
+
new E(F({ separator: ",", conjunction: "and" }), N, k);
|
|
382
|
+
new E(F({ separator: ",", conjunction: "or" }), N, k);
|
|
383
|
+
new E(Le(`
|
|
384
|
+
`), mt, F, N, k);
|
|
385
|
+
new E(Le(`
|
|
386
|
+
`), F, N, k, $(/&/g, "&"), $(/</g, "<"), $(/>/g, ">"), $(/"/g, """), $(/'/g, "'"), $(/`/g, "`"));
|
|
387
|
+
new E(U(/(?:\n(?:\s*))+/g, " "), k);
|
|
388
|
+
new E(U(/(?:\n\s*)/g, ""), k);
|
|
389
|
+
new E(F({ separator: "," }), U(/(?:\s+)/g, " "), k);
|
|
390
|
+
new E(F({ separator: ",", conjunction: "or" }), U(/(?:\s+)/g, " "), k);
|
|
391
|
+
new E(F({ separator: ",", conjunction: "and" }), U(/(?:\s+)/g, " "), k);
|
|
392
|
+
new E(F, N, k);
|
|
393
|
+
new E(F, U(/(?:\s+)/g, " "), k);
|
|
394
|
+
new E(N, k);
|
|
395
|
+
var Ne = new E(N("all"), k);
|
|
396
|
+
const gt = [
|
|
396
397
|
"Cameră dublă cu obiectiv superangular spate",
|
|
397
398
|
"מצלמה כפולה רחבה אחורית",
|
|
398
399
|
"Артқы қос кең бұрышты камера",
|
|
@@ -430,94 +431,94 @@ const dt = [
|
|
|
430
431
|
"Cámara trasera dual con gran angular",
|
|
431
432
|
"背面デュアル広角カメラ",
|
|
432
433
|
"Stražnja dvostruka široka kamera"
|
|
433
|
-
],
|
|
434
|
-
if (
|
|
434
|
+
], Q = (t) => {
|
|
435
|
+
if (t instanceof Error) return t;
|
|
435
436
|
try {
|
|
436
|
-
return new Error(JSON.stringify(
|
|
437
|
+
return new Error(JSON.stringify(t));
|
|
437
438
|
} catch {
|
|
438
|
-
return new Error(String(
|
|
439
|
+
return new Error(String(t));
|
|
439
440
|
}
|
|
440
441
|
};
|
|
441
|
-
function
|
|
442
|
-
const
|
|
443
|
-
return /iphone|ipad|ipod/.test(
|
|
442
|
+
function bt() {
|
|
443
|
+
const t = self.navigator.userAgent.toLowerCase();
|
|
444
|
+
return /iphone|ipad|ipod/.test(t);
|
|
444
445
|
}
|
|
445
|
-
const
|
|
446
|
+
const ze = async () => {
|
|
446
447
|
try {
|
|
447
|
-
const
|
|
448
|
+
const t = await navigator.mediaDevices.getUserMedia({
|
|
448
449
|
video: !0
|
|
449
450
|
});
|
|
450
|
-
|
|
451
|
-
} catch (
|
|
452
|
-
throw new
|
|
451
|
+
Pe(t);
|
|
452
|
+
} catch (t) {
|
|
453
|
+
throw new B(
|
|
453
454
|
"Camera permission not given",
|
|
454
455
|
"PERMISSION_DENIED",
|
|
455
|
-
|
|
456
|
+
Q(t)
|
|
456
457
|
);
|
|
457
458
|
}
|
|
458
|
-
},
|
|
459
|
+
}, pt = async () => {
|
|
459
460
|
if (!isSecureContext)
|
|
460
|
-
throw new Error(
|
|
461
|
+
throw new Error(Ne`
|
|
461
462
|
Cameras can only be used in a secure context:
|
|
462
463
|
https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts
|
|
463
464
|
`);
|
|
464
|
-
return await
|
|
465
|
-
},
|
|
466
|
-
const e =
|
|
467
|
-
for (const
|
|
468
|
-
|
|
469
|
-
},
|
|
465
|
+
return await ze(), (await navigator.mediaDevices.enumerateDevices()).filter((r) => r.kind === "videoinput");
|
|
466
|
+
}, Pe = (t) => {
|
|
467
|
+
const e = t.getTracks();
|
|
468
|
+
for (const r of e)
|
|
469
|
+
r.stop();
|
|
470
|
+
}, vt = (t, e, r) => ({
|
|
470
471
|
video: {
|
|
471
|
-
deviceId:
|
|
472
|
+
deviceId: r ? { exact: r } : void 0,
|
|
472
473
|
frameRate: 30,
|
|
473
474
|
aspectRatio: {
|
|
474
|
-
exact: P[
|
|
475
|
+
exact: P[t].width / P[t].height
|
|
475
476
|
},
|
|
476
477
|
width: {
|
|
477
|
-
ideal: P[
|
|
478
|
+
ideal: P[t].width
|
|
478
479
|
},
|
|
479
480
|
height: {
|
|
480
|
-
ideal: P[
|
|
481
|
+
ideal: P[t].height
|
|
481
482
|
},
|
|
482
483
|
facingMode: e
|
|
483
484
|
},
|
|
484
485
|
audio: !1
|
|
485
486
|
});
|
|
486
|
-
function
|
|
487
|
+
function wt(t) {
|
|
487
488
|
let e = 0;
|
|
488
|
-
return
|
|
489
|
+
return t.torchSupported && (e += 1), t.singleShotSupported && (e += 1), e;
|
|
489
490
|
}
|
|
490
|
-
function
|
|
491
|
-
return
|
|
491
|
+
function yt(t, e) {
|
|
492
|
+
return t.filter((r) => e === "back" ? Ie(r.name) : e === "front" ? Fe(r.name) : !0);
|
|
492
493
|
}
|
|
493
|
-
const
|
|
494
|
-
if (
|
|
494
|
+
const St = async (t, e, r) => {
|
|
495
|
+
if (t.length === 0)
|
|
495
496
|
throw new Error("No cameras found on device");
|
|
496
|
-
if (
|
|
497
|
-
return await
|
|
498
|
-
let a =
|
|
497
|
+
if (t.length === 1)
|
|
498
|
+
return await t[0].startStream(e), t[0];
|
|
499
|
+
let a = yt(t, r);
|
|
499
500
|
if (a.length === 1)
|
|
500
501
|
return await a[0].startStream(e), a[0];
|
|
501
|
-
if (a.length === 0 && (console.debug("No camera found with requested facing, using all cameras"), a =
|
|
502
|
+
if (a.length === 0 && (console.debug("No camera found with requested facing, using all cameras"), a = t), r === "back") {
|
|
502
503
|
const s = a.find(
|
|
503
|
-
(l) =>
|
|
504
|
+
(l) => gt.includes(l.name)
|
|
504
505
|
);
|
|
505
506
|
if (s)
|
|
506
507
|
return await s.startStream(e), s;
|
|
507
508
|
}
|
|
508
|
-
if (
|
|
509
|
+
if (r === "front") {
|
|
509
510
|
const s = a[a.length - 1];
|
|
510
511
|
return await s.startStream(e), s;
|
|
511
512
|
}
|
|
512
513
|
const n = /* @__PURE__ */ new Map();
|
|
513
|
-
let
|
|
514
|
-
|
|
514
|
+
let i, o = -1 / 0;
|
|
515
|
+
bt() || a.reverse();
|
|
515
516
|
for (const s of a)
|
|
516
517
|
try {
|
|
517
518
|
await s.startStream(e);
|
|
518
|
-
const l =
|
|
519
|
-
if (n.set(s, l), l >
|
|
520
|
-
|
|
519
|
+
const l = wt(s);
|
|
520
|
+
if (n.set(s, l), l > o)
|
|
521
|
+
o = l, i = s;
|
|
521
522
|
else {
|
|
522
523
|
s.stopStream();
|
|
523
524
|
continue;
|
|
@@ -528,19 +529,19 @@ const pt = async (r, e, t) => {
|
|
|
528
529
|
} catch (l) {
|
|
529
530
|
console.warn(`Failed to test camera ${s.name}:`, l), s.stopStream();
|
|
530
531
|
}
|
|
531
|
-
if (!
|
|
532
|
+
if (!i)
|
|
532
533
|
throw new Error("No suitable camera found, should not happen!");
|
|
533
|
-
return
|
|
534
|
+
return i;
|
|
534
535
|
};
|
|
535
|
-
function
|
|
536
|
+
function Ct(t) {
|
|
536
537
|
const e = [];
|
|
537
|
-
for (const
|
|
538
|
-
const a = new
|
|
538
|
+
for (const r of t) {
|
|
539
|
+
const a = new $e(r);
|
|
539
540
|
a !== null && e.push(a);
|
|
540
541
|
}
|
|
541
542
|
return e;
|
|
542
543
|
}
|
|
543
|
-
const
|
|
544
|
+
const Et = {
|
|
544
545
|
deviceInfo: {},
|
|
545
546
|
name: "",
|
|
546
547
|
facingMode: void 0,
|
|
@@ -553,12 +554,12 @@ const wt = {
|
|
|
553
554
|
deviceCapabilities: void 0,
|
|
554
555
|
error: void 0
|
|
555
556
|
};
|
|
556
|
-
class
|
|
557
|
+
class $e {
|
|
557
558
|
/**
|
|
558
559
|
* The internal state of the camera, implemented as a Zustand store.
|
|
559
560
|
*/
|
|
560
561
|
store = de()(
|
|
561
|
-
ue(() =>
|
|
562
|
+
ue(() => Et)
|
|
562
563
|
);
|
|
563
564
|
#e = /* @__PURE__ */ new Set();
|
|
564
565
|
/**
|
|
@@ -611,18 +612,18 @@ class De {
|
|
|
611
612
|
constructor(e) {
|
|
612
613
|
if (e.kind !== "videoinput")
|
|
613
614
|
throw new Error("Device is not a video input device");
|
|
614
|
-
let
|
|
615
|
-
|
|
615
|
+
let r;
|
|
616
|
+
Fe(e.label) && (r = "front"), Ie(e.label) && (r = "back"), this.store.setState({
|
|
616
617
|
deviceInfo: e,
|
|
617
618
|
name: e.label || "Unknown Camera",
|
|
618
|
-
facingMode:
|
|
619
|
+
facingMode: r
|
|
619
620
|
});
|
|
620
621
|
}
|
|
621
|
-
subscribe(e,
|
|
622
|
+
subscribe(e, r, a) {
|
|
622
623
|
let n;
|
|
623
|
-
return
|
|
624
|
+
return r ? n = this.store.subscribe(
|
|
624
625
|
e,
|
|
625
|
-
|
|
626
|
+
r,
|
|
626
627
|
a
|
|
627
628
|
) : n = this.store.subscribe(
|
|
628
629
|
e
|
|
@@ -641,18 +642,18 @@ class De {
|
|
|
641
642
|
if (this.activeStream)
|
|
642
643
|
return this.activeStream;
|
|
643
644
|
this.maxSupportedResolution && (e = this.maxSupportedResolution);
|
|
644
|
-
const
|
|
645
|
-
this.populateCapabilities(
|
|
646
|
-
const a =
|
|
645
|
+
const r = await this.acquireStreamWithFallback(e);
|
|
646
|
+
this.populateCapabilities(r), this.store.setState({ activeStream: r });
|
|
647
|
+
const a = r.getVideoTracks()[0];
|
|
647
648
|
return a.onended = () => {
|
|
648
|
-
const n = new
|
|
649
|
+
const n = new B(
|
|
649
650
|
"Camera stream ended unexpectedly",
|
|
650
651
|
"STREAM_ENDED_UNEXPECTEDLY"
|
|
651
652
|
);
|
|
652
653
|
throw this.store.setState({
|
|
653
654
|
error: n
|
|
654
655
|
}), this.stopStream(), n;
|
|
655
|
-
},
|
|
656
|
+
}, r;
|
|
656
657
|
}
|
|
657
658
|
/**
|
|
658
659
|
* Acquires a camera stream with the specified resolution.
|
|
@@ -663,16 +664,16 @@ class De {
|
|
|
663
664
|
*/
|
|
664
665
|
async acquireStreamWithFallback(e) {
|
|
665
666
|
try {
|
|
666
|
-
const
|
|
667
|
+
const r = vt(
|
|
667
668
|
e,
|
|
668
669
|
this.facingMode,
|
|
669
670
|
this.deviceInfo.deviceId
|
|
670
671
|
);
|
|
671
|
-
return await navigator.mediaDevices.getUserMedia(
|
|
672
|
-
} catch (
|
|
672
|
+
return await navigator.mediaDevices.getUserMedia(r);
|
|
673
|
+
} catch (r) {
|
|
673
674
|
console.warn(
|
|
674
675
|
`Can't get camera stream for ${this.name} at ${e}`,
|
|
675
|
-
|
|
676
|
+
r
|
|
676
677
|
);
|
|
677
678
|
const a = Object.keys(P).indexOf(e);
|
|
678
679
|
if (a === 0)
|
|
@@ -687,22 +688,22 @@ class De {
|
|
|
687
688
|
* @param stream - The stream to populate the capabilities from.
|
|
688
689
|
*/
|
|
689
690
|
populateCapabilities(e) {
|
|
690
|
-
const
|
|
691
|
+
const r = e.getVideoTracks()[0].getCapabilities();
|
|
691
692
|
if ("getCapabilities" in this.deviceInfo) {
|
|
692
|
-
const
|
|
693
|
-
this.store.setState({ deviceCapabilities:
|
|
693
|
+
const u = this.deviceInfo.getCapabilities();
|
|
694
|
+
this.store.setState({ deviceCapabilities: u });
|
|
694
695
|
}
|
|
695
|
-
ge(
|
|
696
|
-
const
|
|
697
|
-
if (!
|
|
696
|
+
ge(r, this.streamCapabilities) || this.store.setState({ streamCapabilities: r });
|
|
697
|
+
const i = e.getVideoTracks()[0].getSettings();
|
|
698
|
+
if (!i.width || !i.height)
|
|
698
699
|
throw new Error(
|
|
699
700
|
"Video track resolution not available. Should not happen."
|
|
700
701
|
);
|
|
701
|
-
const
|
|
702
|
-
width:
|
|
703
|
-
height:
|
|
704
|
-
}, s =
|
|
705
|
-
!this.maxSupportedResolution && s && (l.maxSupportedResolution = s), "torch" in
|
|
702
|
+
const o = {
|
|
703
|
+
width: i.width,
|
|
704
|
+
height: i.height
|
|
705
|
+
}, s = Mt(o), l = {};
|
|
706
|
+
!this.maxSupportedResolution && s && (l.maxSupportedResolution = s), "torch" in r && (l.torchSupported = !0), "focusMode" in r && r.focusMode?.includes("single-shot") && (l.singleShotSupported = !0), this.facingMode === "front" && r.facingMode?.includes("environment") && (l.facingMode = "back", console.warn("Front camera selected, but facingMode is environment")), this.facingMode === "back" && r.facingMode?.includes("user") && (l.facingMode = "front", console.warn("Back camera selected, but facingMode is user")), this.facingMode || (r.facingMode?.includes("environment") && (l.facingMode = "back"), r.facingMode?.includes("user") && (l.facingMode = "front")), ge(l, this.store.getState()) || this.store.setState(l);
|
|
706
707
|
}
|
|
707
708
|
/**
|
|
708
709
|
* Toggles the torch on the camera.
|
|
@@ -723,8 +724,8 @@ class De {
|
|
|
723
724
|
}
|
|
724
725
|
]
|
|
725
726
|
}), this.store.setState({ torchEnabled: !this.torchEnabled });
|
|
726
|
-
} catch (
|
|
727
|
-
throw console.error("Failed to toggle torch",
|
|
727
|
+
} catch (r) {
|
|
728
|
+
throw console.error("Failed to toggle torch", r), this.store.setState({ torchEnabled: !1, torchSupported: !1 }), new Error("Failed to toggle torch", { cause: r });
|
|
728
729
|
}
|
|
729
730
|
return this.torchEnabled;
|
|
730
731
|
}
|
|
@@ -732,7 +733,7 @@ class De {
|
|
|
732
733
|
* Stops the stream on the camera.
|
|
733
734
|
*/
|
|
734
735
|
stopStream() {
|
|
735
|
-
this.activeStream && (console.debug(`Stopping active stream on ${this.name}`),
|
|
736
|
+
this.activeStream && (console.debug(`Stopping active stream on ${this.name}`), Pe(this.activeStream), this.store.setState({
|
|
736
737
|
activeStream: void 0,
|
|
737
738
|
streamCapabilities: void 0,
|
|
738
739
|
torchEnabled: !1
|
|
@@ -756,37 +757,37 @@ const P = {
|
|
|
756
757
|
"1080p": { width: 1920, height: 1080 },
|
|
757
758
|
"4k": { width: 3840, height: 2160 }
|
|
758
759
|
};
|
|
759
|
-
function
|
|
760
|
-
return Math.max(
|
|
760
|
+
function kt(t) {
|
|
761
|
+
return Math.max(t.width, t.height);
|
|
761
762
|
}
|
|
762
|
-
function
|
|
763
|
+
function Tt(t) {
|
|
763
764
|
const e = {
|
|
764
|
-
width: Math.max(
|
|
765
|
-
height: Math.min(
|
|
765
|
+
width: Math.max(t.width, t.height),
|
|
766
|
+
height: Math.min(t.width, t.height)
|
|
766
767
|
};
|
|
767
768
|
return Math.abs(e.width / e.height - 16 / 9) > 1e-4 && console.warn(
|
|
768
769
|
`Resolution ${JSON.stringify(
|
|
769
|
-
|
|
770
|
+
t
|
|
770
771
|
)} is not 16:9, may cause issues with some video players.`
|
|
771
772
|
), e;
|
|
772
773
|
}
|
|
773
|
-
function
|
|
774
|
-
const e =
|
|
774
|
+
function xt(t) {
|
|
775
|
+
const e = kt(t);
|
|
775
776
|
return e > 1920 ? "4k" : e > 1280 ? "1080p" : "720p";
|
|
776
777
|
}
|
|
777
|
-
function
|
|
778
|
-
const e =
|
|
779
|
-
([n,
|
|
778
|
+
function Mt(t) {
|
|
779
|
+
const e = Tt(t), r = Object.entries(P).find(
|
|
780
|
+
([n, i]) => i.width === e.width && i.height === e.height
|
|
780
781
|
);
|
|
781
|
-
if (!
|
|
782
|
-
const n =
|
|
782
|
+
if (!r) {
|
|
783
|
+
const n = xt(t);
|
|
783
784
|
return console.warn(
|
|
784
|
-
`No exact resolution match found for ${JSON.stringify(
|
|
785
|
+
`No exact resolution match found for ${JSON.stringify(t)}, categorizing as ${n}`
|
|
785
786
|
), n;
|
|
786
787
|
}
|
|
787
|
-
return
|
|
788
|
+
return r[0];
|
|
788
789
|
}
|
|
789
|
-
const
|
|
790
|
+
const Oe = {
|
|
790
791
|
cameras: [],
|
|
791
792
|
facingFilter: void 0,
|
|
792
793
|
videoElement: void 0,
|
|
@@ -799,40 +800,40 @@ const Fe = {
|
|
|
799
800
|
cameraPermission: void 0,
|
|
800
801
|
mirrorX: !1,
|
|
801
802
|
errorState: void 0
|
|
802
|
-
},
|
|
803
|
+
}, f = de()(
|
|
803
804
|
// this is important! Otherwise solid-zustand will start mutating the initial state
|
|
804
|
-
ue(() => structuredClone(
|
|
805
|
-
),
|
|
806
|
-
console.debug("Stopping all cameras and resetting the `cameraManagerStore`."),
|
|
807
|
-
|
|
808
|
-
}),
|
|
809
|
-
},
|
|
810
|
-
function
|
|
805
|
+
ue(() => structuredClone(Oe))
|
|
806
|
+
), Rt = () => {
|
|
807
|
+
console.debug("Stopping all cameras and resetting the `cameraManagerStore`."), f.getState().cameras.forEach((t) => {
|
|
808
|
+
t.stopStream();
|
|
809
|
+
}), f.setState(structuredClone(Oe));
|
|
810
|
+
}, ve = Element.prototype.attachShadow;
|
|
811
|
+
function fe() {
|
|
811
812
|
return typeof window.ShadyDOM < "u" && typeof ShadowRoot < "u";
|
|
812
813
|
}
|
|
813
|
-
function
|
|
814
|
+
function _t() {
|
|
814
815
|
return typeof ShadowRoot < "u";
|
|
815
816
|
}
|
|
816
|
-
function
|
|
817
|
-
|
|
818
|
-
const
|
|
819
|
-
return r
|
|
817
|
+
function At(t) {
|
|
818
|
+
ve == null || fe() || (Element.prototype.attachShadow = function(e) {
|
|
819
|
+
const r = ve.call(this, e);
|
|
820
|
+
return t(r), r;
|
|
820
821
|
});
|
|
821
822
|
}
|
|
822
|
-
function
|
|
823
|
-
const
|
|
823
|
+
function Dt(t, ...e) {
|
|
824
|
+
const r = new Set(e);
|
|
824
825
|
let a = !1;
|
|
825
826
|
const n = () => {
|
|
826
|
-
for (const
|
|
827
|
-
|
|
828
|
-
|
|
827
|
+
for (const i of r)
|
|
828
|
+
t(i);
|
|
829
|
+
r.clear();
|
|
829
830
|
};
|
|
830
831
|
return {
|
|
831
832
|
isRunning() {
|
|
832
833
|
return a;
|
|
833
834
|
},
|
|
834
|
-
schedule(
|
|
835
|
-
|
|
835
|
+
schedule(i) {
|
|
836
|
+
r.add(i), a && n();
|
|
836
837
|
},
|
|
837
838
|
stop() {
|
|
838
839
|
a = !1;
|
|
@@ -842,98 +843,98 @@ function Mt(r, ...e) {
|
|
|
842
843
|
}
|
|
843
844
|
};
|
|
844
845
|
}
|
|
845
|
-
const
|
|
846
|
+
const It = {
|
|
846
847
|
childList: !0,
|
|
847
848
|
subtree: !0
|
|
848
|
-
},
|
|
849
|
-
typeof queueMicrotask < "u" ? queueMicrotask(
|
|
849
|
+
}, Ft = (t) => {
|
|
850
|
+
typeof queueMicrotask < "u" ? queueMicrotask(t) : typeof Promise < "u" ? Promise.resolve().then(() => t()) : setTimeout(() => t(), 0);
|
|
850
851
|
};
|
|
851
|
-
function
|
|
852
|
-
if (typeof Symbol < "u" &&
|
|
853
|
-
return [...
|
|
852
|
+
function we(t) {
|
|
853
|
+
if (typeof Symbol < "u" && t[Symbol.iterator] != null)
|
|
854
|
+
return [...t];
|
|
854
855
|
{
|
|
855
856
|
const e = [];
|
|
856
|
-
for (let
|
|
857
|
-
e[
|
|
857
|
+
for (let r = 0; r < t.length; r++)
|
|
858
|
+
e[r] = t[r];
|
|
858
859
|
return e;
|
|
859
860
|
}
|
|
860
861
|
}
|
|
861
|
-
function
|
|
862
|
-
return
|
|
862
|
+
function Lt(t, e) {
|
|
863
|
+
return fe() ? new Set(we(window.ShadyDOM.nativeMethods.querySelectorAll.call(document.documentElement, e))) : new Set("querySelectorAll" in t ? we(t.querySelectorAll(e)) : []);
|
|
863
864
|
}
|
|
864
|
-
function
|
|
865
|
-
return /* @__PURE__ */ new Set([...
|
|
865
|
+
function Nt(t, e) {
|
|
866
|
+
return /* @__PURE__ */ new Set([...t ?? [], ...e ?? []]);
|
|
866
867
|
}
|
|
867
|
-
function
|
|
868
|
-
return "activeElement" in
|
|
868
|
+
function zt(t) {
|
|
869
|
+
return "activeElement" in t;
|
|
869
870
|
}
|
|
870
|
-
function
|
|
871
|
-
if (
|
|
871
|
+
function Ve(t = document.documentElement) {
|
|
872
|
+
if (zt(t) && Be(t), fe() && t instanceof ShadowRoot || !_t())
|
|
872
873
|
return;
|
|
873
|
-
const e =
|
|
874
|
-
for (const a of [...e, ...
|
|
875
|
-
|
|
874
|
+
const e = t.childNodes, r = "shadowRoot" in t && t.shadowRoot != null ? [t.shadowRoot] : [];
|
|
875
|
+
for (const a of [...e, ...r])
|
|
876
|
+
Ve(a);
|
|
876
877
|
}
|
|
877
|
-
function
|
|
878
|
-
return "isConnected" in Node.prototype ?
|
|
878
|
+
function Pt(t) {
|
|
879
|
+
return "isConnected" in Node.prototype ? t.isConnected : t.ownerDocument == null || !(t.ownerDocument.compareDocumentPosition(t) & t.DOCUMENT_POSITION_DISCONNECTED);
|
|
879
880
|
}
|
|
880
|
-
const
|
|
881
|
-
function
|
|
882
|
-
const
|
|
883
|
-
let
|
|
884
|
-
const
|
|
881
|
+
const j = /* @__PURE__ */ new Map();
|
|
882
|
+
function $t(t, e) {
|
|
883
|
+
const r = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new WeakMap();
|
|
884
|
+
let o = !1, s = !1, l = !1;
|
|
885
|
+
const d = () => {
|
|
885
886
|
s = !0;
|
|
886
|
-
const
|
|
887
|
-
|
|
888
|
-
},
|
|
889
|
-
|
|
890
|
-
},
|
|
891
|
-
|
|
892
|
-
},
|
|
893
|
-
const
|
|
894
|
-
return
|
|
895
|
-
},
|
|
887
|
+
const v = [...r];
|
|
888
|
+
v.length > 0 && e(v, t), r.clear(), o = !1, s = !1;
|
|
889
|
+
}, u = () => {
|
|
890
|
+
o || (o = !0, Ft(d));
|
|
891
|
+
}, b = (v) => {
|
|
892
|
+
r.add(v), s || u();
|
|
893
|
+
}, p = () => {
|
|
894
|
+
const v = [...r];
|
|
895
|
+
return r.clear(), v;
|
|
896
|
+
}, h = () => {
|
|
896
897
|
a.clear();
|
|
897
|
-
},
|
|
898
|
-
let
|
|
899
|
-
const
|
|
900
|
-
|
|
901
|
-
},
|
|
902
|
-
for (const
|
|
903
|
-
const
|
|
904
|
-
|
|
905
|
-
connected:
|
|
906
|
-
target:
|
|
898
|
+
}, m = (v, C) => {
|
|
899
|
+
let M = n.get(v);
|
|
900
|
+
const L = Lt(v, C), W = M?.get(C), G = Nt(L, W);
|
|
901
|
+
g(G), M == null && (M = /* @__PURE__ */ new Map(), n.set(v, M)), M.set(C, L);
|
|
902
|
+
}, g = (v) => {
|
|
903
|
+
for (const C of v) {
|
|
904
|
+
const M = i.get(C), L = Pt(C);
|
|
905
|
+
M !== L && (i.set(C, L), b({
|
|
906
|
+
connected: L,
|
|
907
|
+
target: C
|
|
907
908
|
}));
|
|
908
909
|
}
|
|
909
|
-
},
|
|
910
|
+
}, T = {
|
|
910
911
|
observedTargets: a,
|
|
911
|
-
queryRootAndHandleMutationChanges:
|
|
912
|
-
handleMutationChange:
|
|
913
|
-
addObservedTarget: (
|
|
914
|
-
if (se.run(), l || (l = !0,
|
|
915
|
-
|
|
912
|
+
queryRootAndHandleMutationChanges: m,
|
|
913
|
+
handleMutationChange: g,
|
|
914
|
+
addObservedTarget: (v) => {
|
|
915
|
+
if (se.run(), l || (l = !0, Ve()), a.add(v), typeof v != "string")
|
|
916
|
+
g([v]);
|
|
916
917
|
else
|
|
917
|
-
for (const
|
|
918
|
-
|
|
918
|
+
for (const C of ie)
|
|
919
|
+
m(C, v);
|
|
919
920
|
},
|
|
920
|
-
clearObservedTargets:
|
|
921
|
-
clearQueue:
|
|
921
|
+
clearObservedTargets: h,
|
|
922
|
+
clearQueue: p
|
|
922
923
|
};
|
|
923
|
-
|
|
924
|
+
j.set(t, T);
|
|
924
925
|
}
|
|
925
|
-
const
|
|
926
|
-
for (const e of
|
|
926
|
+
const Ot = (t) => {
|
|
927
|
+
for (const e of t)
|
|
927
928
|
if (e.type === "childList")
|
|
928
|
-
for (const
|
|
929
|
-
for (const a of
|
|
930
|
-
typeof a == "string" ?
|
|
931
|
-
}, ie = /* @__PURE__ */ new Set(),
|
|
932
|
-
let
|
|
929
|
+
for (const r of j.values())
|
|
930
|
+
for (const a of r.observedTargets)
|
|
931
|
+
typeof a == "string" ? r.queryRootAndHandleMutationChanges(e.target, a) : r.handleMutationChange([a]);
|
|
932
|
+
}, ie = /* @__PURE__ */ new Set(), Be = /* @__PURE__ */ (() => {
|
|
933
|
+
let t;
|
|
933
934
|
return function(e) {
|
|
934
|
-
ie.has(e) || (ie.add(e),
|
|
935
|
+
ie.has(e) || (ie.add(e), t == null && (t = new MutationObserver(Ot)), t.observe(e, It));
|
|
935
936
|
};
|
|
936
|
-
})(), se =
|
|
937
|
+
})(), se = Dt(Be, document.documentElement);
|
|
937
938
|
class z {
|
|
938
939
|
constructor(e) {
|
|
939
940
|
if (new.target === void 0)
|
|
@@ -942,7 +943,7 @@ class z {
|
|
|
942
943
|
throw new ReferenceError(`Failed to construct '${z.name}': 1 argument required, but only 0 present.`);
|
|
943
944
|
if (typeof e != "function")
|
|
944
945
|
throw new TypeError(`Failed to construct '${z.name}': The callback provided as parameter 1 is not a function.`);
|
|
945
|
-
|
|
946
|
+
$t(this, e);
|
|
946
947
|
}
|
|
947
948
|
/**
|
|
948
949
|
* The Symbol.@@toStringTag value
|
|
@@ -961,32 +962,32 @@ class z {
|
|
|
961
962
|
throw new ReferenceError(`Failed to execute '${this.observe.name}' on '${z.name}': 1 argument required, but only 0 present.`);
|
|
962
963
|
if (typeof e != "string" && !(e instanceof Node))
|
|
963
964
|
throw new TypeError(`Failed to execute '${this.observe.name}' on '${z.name}': parameter 1 is not of type 'Node' or a DOMString.`);
|
|
964
|
-
const
|
|
965
|
-
|
|
965
|
+
const r = j.get(this);
|
|
966
|
+
r?.addObservedTarget(e);
|
|
966
967
|
}
|
|
967
968
|
/**
|
|
968
969
|
* Takes the records immediately (instead of waiting for the next flush)
|
|
969
970
|
*/
|
|
970
971
|
takeRecords() {
|
|
971
|
-
const e =
|
|
972
|
+
const e = j.get(this);
|
|
972
973
|
return e == null ? [] : e.clearQueue();
|
|
973
974
|
}
|
|
974
975
|
/**
|
|
975
976
|
* Disconnects the ConnectionObserver such that none of its callbacks will be invoked any longer
|
|
976
977
|
*/
|
|
977
978
|
disconnect() {
|
|
978
|
-
const e =
|
|
979
|
+
const e = j.get(this);
|
|
979
980
|
e?.clearObservedTargets();
|
|
980
981
|
}
|
|
981
982
|
}
|
|
982
|
-
|
|
983
|
-
function
|
|
984
|
-
return
|
|
985
|
-
|
|
983
|
+
At(se.schedule.bind(se));
|
|
984
|
+
function ye(t, ...e) {
|
|
985
|
+
return t.addEventListener(...e), () => {
|
|
986
|
+
t.removeEventListener(...e);
|
|
986
987
|
};
|
|
987
988
|
}
|
|
988
|
-
function le(
|
|
989
|
-
const e =
|
|
989
|
+
function le(t) {
|
|
990
|
+
const e = Ue(t);
|
|
990
991
|
if ("detached" in e)
|
|
991
992
|
return e.detached;
|
|
992
993
|
try {
|
|
@@ -995,57 +996,57 @@ function le(r) {
|
|
|
995
996
|
return !0;
|
|
996
997
|
}
|
|
997
998
|
}
|
|
998
|
-
class
|
|
999
|
+
class Vt {
|
|
999
1000
|
#e;
|
|
1000
|
-
#
|
|
1001
|
+
#o = null;
|
|
1001
1002
|
#r = null;
|
|
1002
1003
|
#a = null;
|
|
1003
|
-
#
|
|
1004
|
+
#n = null;
|
|
1004
1005
|
#t = null;
|
|
1005
|
-
#
|
|
1006
|
-
#
|
|
1007
|
-
#
|
|
1008
|
-
#
|
|
1006
|
+
#l = 0;
|
|
1007
|
+
#i = 0;
|
|
1008
|
+
#c;
|
|
1009
|
+
#u = 4;
|
|
1009
1010
|
/**
|
|
1010
1011
|
* Creates a new VideoFrameProcessor.
|
|
1011
1012
|
*
|
|
1012
1013
|
* @param options - The options for the VideoFrameProcessor.
|
|
1013
1014
|
*/
|
|
1014
1015
|
constructor(e = {}) {
|
|
1015
|
-
const { canvasRenderingMode:
|
|
1016
|
-
if (this.#
|
|
1017
|
-
this.#
|
|
1018
|
-
else if (
|
|
1016
|
+
const { canvasRenderingMode: r = "webgl2", fallbackWebGlTo2d: a = !0 } = e;
|
|
1017
|
+
if (this.#c = r, this.#e = document.createElement("canvas"), r === "2d")
|
|
1018
|
+
this.#s();
|
|
1019
|
+
else if (r === "webgl2")
|
|
1019
1020
|
try {
|
|
1020
|
-
this.#
|
|
1021
|
+
this.#h();
|
|
1021
1022
|
} catch (n) {
|
|
1022
1023
|
if (a)
|
|
1023
1024
|
console.warn(
|
|
1024
1025
|
"Failed to create WebGL2 context, falling back to 2D canvas"
|
|
1025
|
-
), this.#
|
|
1026
|
+
), this.#c = "2d", this.#s();
|
|
1026
1027
|
else
|
|
1027
1028
|
throw n;
|
|
1028
1029
|
}
|
|
1029
1030
|
else
|
|
1030
1031
|
throw new Error(
|
|
1031
|
-
`Unsupported rendering context: ${
|
|
1032
|
+
`Unsupported rendering context: ${r}`
|
|
1032
1033
|
);
|
|
1033
1034
|
}
|
|
1034
1035
|
/**
|
|
1035
1036
|
* Initializes the 2D canvas context.
|
|
1036
1037
|
*/
|
|
1037
|
-
#
|
|
1038
|
+
#s() {
|
|
1038
1039
|
const e = this.#e.getContext("2d", {
|
|
1039
1040
|
alpha: !1,
|
|
1040
1041
|
willReadFrequently: !0
|
|
1041
1042
|
});
|
|
1042
1043
|
if (!e) throw new Error("CanvasRenderingContext2D is missing!");
|
|
1043
|
-
this.#
|
|
1044
|
+
this.#o = e;
|
|
1044
1045
|
}
|
|
1045
1046
|
/**
|
|
1046
1047
|
* Initializes the WebGL2 context and resources.
|
|
1047
1048
|
*/
|
|
1048
|
-
#
|
|
1049
|
+
#h() {
|
|
1049
1050
|
const e = this.#e.getContext("webgl2", {
|
|
1050
1051
|
alpha: !1,
|
|
1051
1052
|
depth: !1,
|
|
@@ -1058,16 +1059,16 @@ class zt {
|
|
|
1058
1059
|
});
|
|
1059
1060
|
if (!e) throw new Error("WebGL2RenderingContext is missing!");
|
|
1060
1061
|
this.#r = e;
|
|
1061
|
-
const
|
|
1062
|
-
if (!
|
|
1063
|
-
this.#a =
|
|
1062
|
+
const r = e.createTexture();
|
|
1063
|
+
if (!r) throw new Error("Failed to create WebGL texture");
|
|
1064
|
+
this.#a = r, e.bindTexture(e.TEXTURE_2D, r), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_S, e.CLAMP_TO_EDGE), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_WRAP_T, e.CLAMP_TO_EDGE), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MIN_FILTER, e.NEAREST), e.texParameteri(e.TEXTURE_2D, e.TEXTURE_MAG_FILTER, e.NEAREST);
|
|
1064
1065
|
const a = e.createFramebuffer();
|
|
1065
1066
|
if (!a) throw new Error("Failed to create framebuffer");
|
|
1066
|
-
this.#
|
|
1067
|
+
this.#n = a, e.bindFramebuffer(e.FRAMEBUFFER, a), e.framebufferTexture2D(
|
|
1067
1068
|
e.FRAMEBUFFER,
|
|
1068
1069
|
e.COLOR_ATTACHMENT0,
|
|
1069
1070
|
e.TEXTURE_2D,
|
|
1070
|
-
|
|
1071
|
+
r,
|
|
1071
1072
|
0
|
|
1072
1073
|
);
|
|
1073
1074
|
}
|
|
@@ -1080,15 +1081,15 @@ class zt {
|
|
|
1080
1081
|
* @param arrayBuffer - The array buffer to reattach.
|
|
1081
1082
|
*/
|
|
1082
1083
|
reattachArrayBuffer(e) {
|
|
1083
|
-
const
|
|
1084
|
-
if (le(
|
|
1084
|
+
const r = Ue(e);
|
|
1085
|
+
if (le(r))
|
|
1085
1086
|
throw new Error("Can't use a detached array buffer!");
|
|
1086
|
-
const a = this.#
|
|
1087
|
-
if (
|
|
1088
|
-
this.#t = new Uint8ClampedArray(
|
|
1087
|
+
const a = this.#l * this.#i * 4;
|
|
1088
|
+
if (r.byteLength === a)
|
|
1089
|
+
this.#t = new Uint8ClampedArray(r);
|
|
1089
1090
|
else
|
|
1090
1091
|
throw new Error(
|
|
1091
|
-
`ArrayBuffer size mismatch: expected ${a}, got ${
|
|
1092
|
+
`ArrayBuffer size mismatch: expected ${a}, got ${r.byteLength}`
|
|
1092
1093
|
);
|
|
1093
1094
|
}
|
|
1094
1095
|
/**
|
|
@@ -1108,8 +1109,8 @@ class zt {
|
|
|
1108
1109
|
* @param area - The extraction area.
|
|
1109
1110
|
* @returns The image data.
|
|
1110
1111
|
*/
|
|
1111
|
-
getImageData(e,
|
|
1112
|
-
return this.#
|
|
1112
|
+
getImageData(e, r) {
|
|
1113
|
+
return this.#c === "2d" ? this.#f(e, r) : this.#m(e, r);
|
|
1113
1114
|
}
|
|
1114
1115
|
/**
|
|
1115
1116
|
* Used to get the current ImageData object with the current buffer. Useful
|
|
@@ -1121,7 +1122,7 @@ class zt {
|
|
|
1121
1122
|
getCurrentImageData() {
|
|
1122
1123
|
if (!this.#t)
|
|
1123
1124
|
throw new Error("Buffer is missing!");
|
|
1124
|
-
return new ImageData(this.#t, this.#
|
|
1125
|
+
return new ImageData(this.#t, this.#l, this.#i);
|
|
1125
1126
|
}
|
|
1126
1127
|
/**
|
|
1127
1128
|
* Extract image data using 2D canvas.
|
|
@@ -1130,11 +1131,11 @@ class zt {
|
|
|
1130
1131
|
* @param area - The extraction area.
|
|
1131
1132
|
* @returns The image data.
|
|
1132
1133
|
*/
|
|
1133
|
-
#
|
|
1134
|
-
if (!this.#
|
|
1134
|
+
#f(e, r) {
|
|
1135
|
+
if (!this.#o)
|
|
1135
1136
|
throw new Error("CanvasRenderingContext2D is missing!");
|
|
1136
|
-
const a = "videoWidth" in e ? e.videoWidth : e.width, n = "videoHeight" in e ? e.videoHeight : e.height,
|
|
1137
|
-
return this.#
|
|
1137
|
+
const a = "videoWidth" in e ? e.videoWidth : e.width, n = "videoHeight" in e ? e.videoHeight : e.height, i = r?.x ?? 0, o = r?.y ?? 0, s = r?.width ?? a, l = r?.height ?? n;
|
|
1138
|
+
return this.#d(s, l), this.#o.drawImage(e, i, o, s, l), this.#o.getImageData(0, 0, s, l);
|
|
1138
1139
|
}
|
|
1139
1140
|
/**
|
|
1140
1141
|
* Extract image data using WebGL2.
|
|
@@ -1143,24 +1144,24 @@ class zt {
|
|
|
1143
1144
|
* @param area - The extraction area.
|
|
1144
1145
|
* @returns The image data.
|
|
1145
1146
|
*/
|
|
1146
|
-
#
|
|
1147
|
-
if (!this.#r || !this.#a || !this.#
|
|
1147
|
+
#m(e, r) {
|
|
1148
|
+
if (!this.#r || !this.#a || !this.#n)
|
|
1148
1149
|
throw new Error("WebGL2 context or resources are missing!");
|
|
1149
|
-
const a = "videoWidth" in e ? e.videoWidth : e.width, n = "videoHeight" in e ? e.videoHeight : e.height,
|
|
1150
|
-
if (this.#
|
|
1150
|
+
const a = "videoWidth" in e ? e.videoWidth : e.width, n = "videoHeight" in e ? e.videoHeight : e.height, i = r?.x ?? 0, o = r?.y ?? 0, s = r?.width ?? a, l = r?.height ?? n, d = s * l * 4;
|
|
1151
|
+
if (this.#d(s, l), this.isBufferDetached())
|
|
1151
1152
|
throw new Error("Buffer is detached!");
|
|
1152
|
-
(!this.#t || this.#t.length !==
|
|
1153
|
-
const
|
|
1154
|
-
|
|
1153
|
+
(!this.#t || this.#t.length !== d) && (this.#t = new Uint8ClampedArray(d));
|
|
1154
|
+
const u = this.#r;
|
|
1155
|
+
u.bindTexture(u.TEXTURE_2D, this.#a), u.texImage2D(u.TEXTURE_2D, 0, u.RGBA, u.RGBA, u.UNSIGNED_BYTE, e), u.bindFramebuffer(u.FRAMEBUFFER, this.#n);
|
|
1155
1156
|
try {
|
|
1156
|
-
|
|
1157
|
-
} catch (
|
|
1158
|
-
if (this.#
|
|
1159
|
-
this.#
|
|
1160
|
-
const
|
|
1161
|
-
return
|
|
1157
|
+
u.pixelStorei(u.PACK_ALIGNMENT, this.#u), u.readPixels(i, o, s, l, u.RGBA, u.UNSIGNED_BYTE, this.#t);
|
|
1158
|
+
} catch (b) {
|
|
1159
|
+
if (this.#u !== 1) {
|
|
1160
|
+
this.#u = 1, u.pixelStorei(u.PACK_ALIGNMENT, 1);
|
|
1161
|
+
const p = new Uint8ClampedArray(d);
|
|
1162
|
+
return u.readPixels(0, 0, s, l, u.RGBA, u.UNSIGNED_BYTE, p), this.#t = p, new ImageData(p, s, l);
|
|
1162
1163
|
}
|
|
1163
|
-
throw
|
|
1164
|
+
throw b;
|
|
1164
1165
|
}
|
|
1165
1166
|
return new ImageData(this.#t, s, l);
|
|
1166
1167
|
}
|
|
@@ -1172,10 +1173,10 @@ class zt {
|
|
|
1172
1173
|
* @param width - The width of the canvas.
|
|
1173
1174
|
* @param height - The height of the canvas.
|
|
1174
1175
|
*/
|
|
1175
|
-
#
|
|
1176
|
-
if (this.#
|
|
1177
|
-
this.#e.width = e, this.#e.height =
|
|
1178
|
-
const a = e *
|
|
1176
|
+
#d(e, r) {
|
|
1177
|
+
if (this.#l !== e || this.#i !== r) {
|
|
1178
|
+
this.#e.width = e, this.#e.height = r, this.#l = e, this.#i = r;
|
|
1179
|
+
const a = e * r * 4;
|
|
1179
1180
|
this.#t = new Uint8ClampedArray(a);
|
|
1180
1181
|
}
|
|
1181
1182
|
}
|
|
@@ -1183,12 +1184,13 @@ class zt {
|
|
|
1183
1184
|
* Clean up resources.
|
|
1184
1185
|
*/
|
|
1185
1186
|
dispose() {
|
|
1186
|
-
this.#r && (this.#a && (this.#r.deleteTexture(this.#a), this.#a = null), this.#
|
|
1187
|
+
this.#r && (this.#a && (this.#r.deleteTexture(this.#a), this.#a = null), this.#n && (this.#r.deleteFramebuffer(this.#n), this.#n = null)), this.#o = null, this.#r = null, this.#t = null;
|
|
1187
1188
|
}
|
|
1188
1189
|
}
|
|
1189
|
-
const
|
|
1190
|
-
class
|
|
1190
|
+
const Ue = (t) => ArrayBuffer.isView(t) ? t.buffer : t;
|
|
1191
|
+
class aa {
|
|
1191
1192
|
#e;
|
|
1193
|
+
#o;
|
|
1192
1194
|
/**
|
|
1193
1195
|
* The desired video resolution for camera streams. This is used as the ideal resolution
|
|
1194
1196
|
* when starting camera streams. If a camera doesn't support the specified resolution,
|
|
@@ -1196,25 +1198,31 @@ class na {
|
|
|
1196
1198
|
* 4k → 1080p → 720p. The actual resolution used may differ from this setting based on
|
|
1197
1199
|
* camera capabilities and system constraints.
|
|
1198
1200
|
*/
|
|
1199
|
-
#n;
|
|
1200
1201
|
#r;
|
|
1201
1202
|
#a;
|
|
1202
|
-
#
|
|
1203
|
+
#n;
|
|
1203
1204
|
#t;
|
|
1205
|
+
#l;
|
|
1206
|
+
#i() {
|
|
1207
|
+
return typeof document > "u" ? !1 : document.visibilityState === "hidden";
|
|
1208
|
+
}
|
|
1209
|
+
#c(e) {
|
|
1210
|
+
this.#o !== "capturing" && (this.#o = e);
|
|
1211
|
+
}
|
|
1204
1212
|
/**
|
|
1205
1213
|
* If true, the user has initiated an abort. This will prevent the
|
|
1206
1214
|
* CameraManager from throwing errors when the user interrupts the process.
|
|
1207
1215
|
*/
|
|
1208
|
-
#
|
|
1216
|
+
#u = !1;
|
|
1209
1217
|
/**
|
|
1210
1218
|
* If true, the user has initiated an abort. This will prevent the
|
|
1211
1219
|
* CameraManager from throwing errors when the user interrupts the process.
|
|
1212
1220
|
*/
|
|
1213
1221
|
get userInitiatedAbort() {
|
|
1214
|
-
return this.#
|
|
1222
|
+
return this.#u;
|
|
1215
1223
|
}
|
|
1216
1224
|
set userInitiatedAbort(e) {
|
|
1217
|
-
this.#
|
|
1225
|
+
this.#u = e;
|
|
1218
1226
|
}
|
|
1219
1227
|
/**
|
|
1220
1228
|
* Sets the area of the video frame that will be extracted.
|
|
@@ -1222,8 +1230,8 @@ class na {
|
|
|
1222
1230
|
* @param extractionArea The area of the video frame that will be extracted.
|
|
1223
1231
|
*/
|
|
1224
1232
|
setExtractionArea(e) {
|
|
1225
|
-
const
|
|
1226
|
-
|
|
1233
|
+
const r = f.getState().extractionArea;
|
|
1234
|
+
r && r.x === e.x && r.y === e.y && r.width === e.width && r.height === e.height || f.setState({
|
|
1227
1235
|
extractionArea: e
|
|
1228
1236
|
});
|
|
1229
1237
|
}
|
|
@@ -1233,27 +1241,27 @@ class na {
|
|
|
1233
1241
|
* @returns The area of the video frame that will be extracted.
|
|
1234
1242
|
*/
|
|
1235
1243
|
get extractionArea() {
|
|
1236
|
-
return
|
|
1244
|
+
return f.getState().extractionArea;
|
|
1237
1245
|
}
|
|
1238
1246
|
/**
|
|
1239
1247
|
* Callbacks that will be triggered on each frame when the playback state is
|
|
1240
1248
|
* "capturing".
|
|
1241
1249
|
*/
|
|
1242
|
-
#
|
|
1250
|
+
#s = /* @__PURE__ */ new Set();
|
|
1243
1251
|
/**
|
|
1244
1252
|
* Creates a new CameraManager instance.
|
|
1245
1253
|
*
|
|
1246
1254
|
* @param options - The options for the CameraManager.
|
|
1247
1255
|
* @param videoFrameProcessorOptions - The options for the VideoFrameProcessor.
|
|
1248
1256
|
*/
|
|
1249
|
-
constructor(e = {},
|
|
1257
|
+
constructor(e = {}, r) {
|
|
1250
1258
|
const { mirrorFrontCameras: a, preferredResolution: n } = {
|
|
1251
|
-
...
|
|
1259
|
+
...Bt,
|
|
1252
1260
|
...e
|
|
1253
1261
|
};
|
|
1254
|
-
this.#
|
|
1255
|
-
|
|
1256
|
-
), this.#
|
|
1262
|
+
this.#r = n, this.#n = new Vt(
|
|
1263
|
+
r
|
|
1264
|
+
), this.#t = a;
|
|
1257
1265
|
}
|
|
1258
1266
|
/**
|
|
1259
1267
|
* Sets the desired video resolution for camera streams. This is used as the ideal resolution
|
|
@@ -1264,9 +1272,9 @@ class na {
|
|
|
1264
1272
|
* @param resolution - The ideal resolution to set for camera streams.
|
|
1265
1273
|
*/
|
|
1266
1274
|
setResolution = async (e) => {
|
|
1267
|
-
this.#
|
|
1268
|
-
const
|
|
1269
|
-
|
|
1275
|
+
this.#r = e;
|
|
1276
|
+
const r = this.getState().playbackState;
|
|
1277
|
+
r !== "idle" && (this.#e = r, this.stopStream(), await this.startCameraStream());
|
|
1270
1278
|
};
|
|
1271
1279
|
/**
|
|
1272
1280
|
* The desired video resolution for camera streams. This is used as the ideal resolution
|
|
@@ -1276,7 +1284,7 @@ class na {
|
|
|
1276
1284
|
* camera capabilities and system constraints.
|
|
1277
1285
|
*/
|
|
1278
1286
|
get resolution() {
|
|
1279
|
-
return this.#
|
|
1287
|
+
return this.#r;
|
|
1280
1288
|
}
|
|
1281
1289
|
/**
|
|
1282
1290
|
* True if there is a video playing or capturing
|
|
@@ -1284,7 +1292,7 @@ class na {
|
|
|
1284
1292
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/MediaSession/playbackState for more details.
|
|
1285
1293
|
*/
|
|
1286
1294
|
get isActive() {
|
|
1287
|
-
return
|
|
1295
|
+
return f.getState().playbackState !== "idle";
|
|
1288
1296
|
}
|
|
1289
1297
|
/**
|
|
1290
1298
|
* Sets the facing filter.
|
|
@@ -1292,7 +1300,7 @@ class na {
|
|
|
1292
1300
|
* @param facingFilter - The facing filter.
|
|
1293
1301
|
*/
|
|
1294
1302
|
setFacingFilter(e) {
|
|
1295
|
-
|
|
1303
|
+
f.setState({
|
|
1296
1304
|
facingFilter: e
|
|
1297
1305
|
});
|
|
1298
1306
|
}
|
|
@@ -1303,21 +1311,21 @@ class na {
|
|
|
1303
1311
|
* @returns The cameras that are available to the user, filtered by the facing mode.
|
|
1304
1312
|
*/
|
|
1305
1313
|
async getCameraDevices() {
|
|
1306
|
-
let e =
|
|
1307
|
-
const
|
|
1308
|
-
return e.length || await this.refreshCameraDevices(), e =
|
|
1309
|
-
(n) =>
|
|
1314
|
+
let e = f.getState().cameras;
|
|
1315
|
+
const r = f.getState().facingFilter;
|
|
1316
|
+
return e.length || await this.refreshCameraDevices(), e = f.getState().cameras, r ? e.filter(
|
|
1317
|
+
(n) => r.includes(n.facingMode)
|
|
1310
1318
|
) : e;
|
|
1311
1319
|
}
|
|
1312
1320
|
get selectedCamera() {
|
|
1313
|
-
return
|
|
1321
|
+
return f.getState().selectedCamera;
|
|
1314
1322
|
}
|
|
1315
1323
|
/**
|
|
1316
1324
|
* Single-time setup for a video element.
|
|
1317
1325
|
*
|
|
1318
1326
|
* @param videoElement - The video element to initialize.
|
|
1319
1327
|
*/
|
|
1320
|
-
#
|
|
1328
|
+
#h(e) {
|
|
1321
1329
|
if (!(e instanceof HTMLVideoElement))
|
|
1322
1330
|
throw new Error(
|
|
1323
1331
|
`Expected an HTMLVideoElement, got ${typeof e}`,
|
|
@@ -1325,35 +1333,36 @@ class na {
|
|
|
1325
1333
|
cause: e
|
|
1326
1334
|
}
|
|
1327
1335
|
);
|
|
1328
|
-
|
|
1336
|
+
f.setState({
|
|
1329
1337
|
videoElement: e
|
|
1330
1338
|
});
|
|
1331
|
-
const
|
|
1339
|
+
const r = ye(
|
|
1332
1340
|
e,
|
|
1333
1341
|
"resize",
|
|
1334
1342
|
() => {
|
|
1335
|
-
const
|
|
1336
|
-
|
|
1343
|
+
const o = f.getState().videoResolution;
|
|
1344
|
+
o?.width === e.videoWidth && o?.height === e.videoHeight || f.setState({
|
|
1337
1345
|
videoResolution: {
|
|
1338
1346
|
width: e.videoWidth,
|
|
1339
1347
|
height: e.videoHeight
|
|
1340
1348
|
}
|
|
1341
1349
|
});
|
|
1342
1350
|
}
|
|
1343
|
-
), a = new z((
|
|
1344
|
-
|
|
1351
|
+
), a = new z((o) => {
|
|
1352
|
+
o[0].connected || this.releaseVideoElement();
|
|
1345
1353
|
});
|
|
1346
1354
|
a.observe(e), e.setAttribute("playsInline", ""), e.setAttribute("muted", ""), e.controls = !1;
|
|
1347
1355
|
let n = "idle";
|
|
1348
|
-
const
|
|
1356
|
+
const i = ye(
|
|
1349
1357
|
document,
|
|
1350
1358
|
"visibilitychange",
|
|
1351
1359
|
async () => {
|
|
1352
1360
|
if (document.hidden) {
|
|
1353
|
-
n =
|
|
1361
|
+
n = f.getState().playbackState, this.stopStream();
|
|
1354
1362
|
return;
|
|
1355
1363
|
}
|
|
1356
|
-
|
|
1364
|
+
const s = this.#o ?? n;
|
|
1365
|
+
switch (this.#o = void 0, s) {
|
|
1357
1366
|
case "playback":
|
|
1358
1367
|
await this.startCameraStream(), await this.startPlayback();
|
|
1359
1368
|
break;
|
|
@@ -1363,8 +1372,8 @@ class na {
|
|
|
1363
1372
|
}
|
|
1364
1373
|
}
|
|
1365
1374
|
);
|
|
1366
|
-
this.#
|
|
1367
|
-
|
|
1375
|
+
this.#l = () => {
|
|
1376
|
+
i(), r(), a.disconnect();
|
|
1368
1377
|
};
|
|
1369
1378
|
}
|
|
1370
1379
|
/**
|
|
@@ -1374,12 +1383,12 @@ class na {
|
|
|
1374
1383
|
*/
|
|
1375
1384
|
initVideoElement(e) {
|
|
1376
1385
|
try {
|
|
1377
|
-
this.#
|
|
1378
|
-
} catch (
|
|
1386
|
+
this.#h(e);
|
|
1387
|
+
} catch (r) {
|
|
1379
1388
|
if (this.userInitiatedAbort)
|
|
1380
1389
|
this.reset();
|
|
1381
1390
|
else
|
|
1382
|
-
throw
|
|
1391
|
+
throw r;
|
|
1383
1392
|
}
|
|
1384
1393
|
}
|
|
1385
1394
|
/**
|
|
@@ -1390,13 +1399,13 @@ class na {
|
|
|
1390
1399
|
* @returns a cleanup function to remove the callback
|
|
1391
1400
|
*/
|
|
1392
1401
|
addFrameCaptureCallback(e) {
|
|
1393
|
-
return this.#
|
|
1402
|
+
return this.#s.add(e), () => this.#s.delete(e);
|
|
1394
1403
|
}
|
|
1395
1404
|
/**
|
|
1396
1405
|
* Cleans up the video element, and stops the stream.
|
|
1397
1406
|
*/
|
|
1398
1407
|
releaseVideoElement() {
|
|
1399
|
-
this.#
|
|
1408
|
+
this.#l?.(), f.setState({
|
|
1400
1409
|
videoElement: void 0
|
|
1401
1410
|
}), this.stopStream();
|
|
1402
1411
|
}
|
|
@@ -1407,9 +1416,9 @@ class na {
|
|
|
1407
1416
|
* @param camera - The camera to select.
|
|
1408
1417
|
*/
|
|
1409
1418
|
async selectCamera(e) {
|
|
1410
|
-
const
|
|
1411
|
-
|
|
1412
|
-
const a =
|
|
1419
|
+
const r = f.getState().playbackState;
|
|
1420
|
+
r !== "idle" && (this.#e = r);
|
|
1421
|
+
const a = f.getState();
|
|
1413
1422
|
if (a.selectedCamera === e) {
|
|
1414
1423
|
console.debug("Already selected");
|
|
1415
1424
|
return;
|
|
@@ -1418,9 +1427,9 @@ class na {
|
|
|
1418
1427
|
console.debug("Already swapping");
|
|
1419
1428
|
return;
|
|
1420
1429
|
}
|
|
1421
|
-
|
|
1430
|
+
f.setState({
|
|
1422
1431
|
isSwappingCamera: !0
|
|
1423
|
-
}), a.selectedCamera?.activeStream && (console.debug("Stopping previous stream"), a.selectedCamera.stopStream()), a.videoElement && (a.videoElement.srcObject = null),
|
|
1432
|
+
}), a.selectedCamera?.activeStream && (console.debug("Stopping previous stream"), a.selectedCamera.stopStream()), a.videoElement && (a.videoElement.srcObject = null), f.setState({
|
|
1424
1433
|
selectedCamera: e,
|
|
1425
1434
|
isSwappingCamera: !1
|
|
1426
1435
|
}), this.#e === "playback" && (console.debug("Starting new stream"), await this.startPlayback()), this.#e === "capturing" && (console.debug("Resuming frame capture"), await this.startFrameCapture()), this.#e = void 0;
|
|
@@ -1431,47 +1440,47 @@ class na {
|
|
|
1431
1440
|
* @returns resolves when the camera devices are refreshed
|
|
1432
1441
|
*/
|
|
1433
1442
|
async refreshCameraDevices() {
|
|
1434
|
-
if (
|
|
1443
|
+
if (f.getState().isQueryingCameras || f.getState().isSwappingCamera) {
|
|
1435
1444
|
console.debug("Already querying cameras");
|
|
1436
1445
|
return;
|
|
1437
1446
|
}
|
|
1438
|
-
if (
|
|
1447
|
+
if (f.getState().cameraPermission === "prompt") {
|
|
1439
1448
|
console.debug("Still waiting for user to respond");
|
|
1440
1449
|
return;
|
|
1441
1450
|
}
|
|
1442
|
-
|
|
1451
|
+
f.setState({
|
|
1443
1452
|
isQueryingCameras: !0
|
|
1444
1453
|
}), window.setTimeout(() => {
|
|
1445
|
-
const a =
|
|
1446
|
-
a.isQueryingCameras &&
|
|
1454
|
+
const a = f.getState();
|
|
1455
|
+
a.isQueryingCameras && f.setState({
|
|
1447
1456
|
cameraPermission: "prompt"
|
|
1448
|
-
}), !a.isQueryingCameras && a.cameraPermission === "denied" &&
|
|
1457
|
+
}), !a.isQueryingCameras && a.cameraPermission === "denied" && f.setState({
|
|
1449
1458
|
cameraPermission: "blocked"
|
|
1450
1459
|
});
|
|
1451
1460
|
}, 100);
|
|
1452
|
-
const e = await
|
|
1453
|
-
throw a instanceof
|
|
1454
|
-
errorState:
|
|
1461
|
+
const e = await pt().catch((a) => {
|
|
1462
|
+
throw a instanceof B && a.code === "PERMISSION_DENIED" && f.setState({
|
|
1463
|
+
errorState: Q(a),
|
|
1455
1464
|
cameraPermission: "denied",
|
|
1456
1465
|
isQueryingCameras: !1
|
|
1457
1466
|
}), a;
|
|
1458
1467
|
});
|
|
1459
|
-
|
|
1468
|
+
f.setState({
|
|
1460
1469
|
cameraPermission: "granted"
|
|
1461
1470
|
});
|
|
1462
|
-
const
|
|
1463
|
-
|
|
1471
|
+
const r = Ct(e);
|
|
1472
|
+
r.forEach((a) => {
|
|
1464
1473
|
a.unsubscribeAll(), a.subscribe((n) => {
|
|
1465
1474
|
window.queueMicrotask(() => {
|
|
1466
|
-
const
|
|
1467
|
-
a ===
|
|
1475
|
+
const o = f.getState().selectedCamera;
|
|
1476
|
+
a === o && f.setState({
|
|
1468
1477
|
selectedCamera: a
|
|
1469
1478
|
});
|
|
1470
1479
|
let s = !1, l;
|
|
1471
|
-
n.error?.code === "STREAM_ENDED_UNEXPECTEDLY" &&
|
|
1472
|
-
|
|
1480
|
+
n.error?.code === "STREAM_ENDED_UNEXPECTEDLY" && ze().catch((d) => {
|
|
1481
|
+
d instanceof B && d.code === "PERMISSION_DENIED" && (s = !0, l = d);
|
|
1473
1482
|
}).finally(() => {
|
|
1474
|
-
|
|
1483
|
+
f.setState({
|
|
1475
1484
|
errorState: l,
|
|
1476
1485
|
playbackState: "idle",
|
|
1477
1486
|
cameraPermission: s ? "denied" : "granted"
|
|
@@ -1483,25 +1492,25 @@ class na {
|
|
|
1483
1492
|
(n) => n,
|
|
1484
1493
|
() => {
|
|
1485
1494
|
window.queueMicrotask(() => {
|
|
1486
|
-
|
|
1487
|
-
cameras: [...
|
|
1495
|
+
f.setState({
|
|
1496
|
+
cameras: [...f.getState().cameras]
|
|
1488
1497
|
});
|
|
1489
1498
|
});
|
|
1490
1499
|
},
|
|
1491
1500
|
// Use a custom equality function to prevent updating all cameras list for
|
|
1492
1501
|
// every minor change in camera state
|
|
1493
1502
|
{
|
|
1494
|
-
equalityFn: (n,
|
|
1503
|
+
equalityFn: (n, i) => [
|
|
1495
1504
|
"torchSupported",
|
|
1496
1505
|
"singleShotSupported",
|
|
1497
1506
|
"facingMode",
|
|
1498
1507
|
"maxSupportedResolution",
|
|
1499
1508
|
"name"
|
|
1500
|
-
].every((s) => n[s] ===
|
|
1509
|
+
].every((s) => n[s] === i[s])
|
|
1501
1510
|
}
|
|
1502
1511
|
);
|
|
1503
|
-
}),
|
|
1504
|
-
cameras:
|
|
1512
|
+
}), f.setState({
|
|
1513
|
+
cameras: r,
|
|
1505
1514
|
isQueryingCameras: !1
|
|
1506
1515
|
});
|
|
1507
1516
|
}
|
|
@@ -1511,7 +1520,11 @@ class na {
|
|
|
1511
1520
|
* @returns resolves when playback starts
|
|
1512
1521
|
*/
|
|
1513
1522
|
async startPlayback() {
|
|
1514
|
-
|
|
1523
|
+
if (this.#i()) {
|
|
1524
|
+
this.#c("playback"), console.warn("Can't start playback while document is hidden");
|
|
1525
|
+
return;
|
|
1526
|
+
}
|
|
1527
|
+
const e = f.getState();
|
|
1515
1528
|
if (!(this.isActive && !this.#e)) {
|
|
1516
1529
|
if (!e.videoElement) {
|
|
1517
1530
|
console.warn("Starting playback - no video element present.");
|
|
@@ -1522,17 +1535,17 @@ class na {
|
|
|
1522
1535
|
return;
|
|
1523
1536
|
}
|
|
1524
1537
|
if (!e.selectedCamera.activeStream) {
|
|
1525
|
-
const
|
|
1526
|
-
e.videoElement.srcObject =
|
|
1538
|
+
const r = await e.selectedCamera.startStream(this.resolution);
|
|
1539
|
+
e.videoElement.srcObject = r;
|
|
1527
1540
|
}
|
|
1528
1541
|
try {
|
|
1529
|
-
this.#
|
|
1542
|
+
this.#v(), await e.videoElement.play(), f.setState({
|
|
1530
1543
|
playbackState: "playback"
|
|
1531
1544
|
});
|
|
1532
|
-
} catch (
|
|
1533
|
-
throw console.error("Failed to start playback",
|
|
1534
|
-
errorState:
|
|
1535
|
-
}),
|
|
1545
|
+
} catch (r) {
|
|
1546
|
+
throw console.error("Failed to start playback", r), f.setState({
|
|
1547
|
+
errorState: Q(r)
|
|
1548
|
+
}), r;
|
|
1536
1549
|
}
|
|
1537
1550
|
}
|
|
1538
1551
|
}
|
|
@@ -1541,24 +1554,30 @@ class na {
|
|
|
1541
1554
|
*
|
|
1542
1555
|
* @returns resolves when frame capture starts
|
|
1543
1556
|
*/
|
|
1544
|
-
async #
|
|
1545
|
-
const e =
|
|
1546
|
-
if (!this.userInitiatedAbort
|
|
1547
|
-
if (
|
|
1548
|
-
|
|
1549
|
-
"Missing video element. Setup a video element first using `initVideoElement`"
|
|
1550
|
-
);
|
|
1557
|
+
async #f() {
|
|
1558
|
+
const e = f.getState();
|
|
1559
|
+
if (!this.userInitiatedAbort) {
|
|
1560
|
+
if (this.#i()) {
|
|
1561
|
+
this.#c("capturing");
|
|
1551
1562
|
return;
|
|
1552
1563
|
}
|
|
1553
|
-
if (!e.
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1564
|
+
if (!(e.playbackState === "capturing" && this.#e !== "capturing")) {
|
|
1565
|
+
if (!e.videoElement) {
|
|
1566
|
+
console.warn(
|
|
1567
|
+
"Missing video element. Setup a video element first using `initVideoElement`"
|
|
1568
|
+
);
|
|
1569
|
+
return;
|
|
1570
|
+
}
|
|
1571
|
+
if (!e.selectedCamera) {
|
|
1572
|
+
console.warn(
|
|
1573
|
+
"No active camera! Select a camera first, or use `startCameraStream`"
|
|
1574
|
+
);
|
|
1575
|
+
return;
|
|
1576
|
+
}
|
|
1577
|
+
await this.startPlayback(), f.getState().playbackState === "playback" && (f.setState({
|
|
1578
|
+
playbackState: "capturing"
|
|
1579
|
+
}), this.#g(), this.#e = void 0);
|
|
1558
1580
|
}
|
|
1559
|
-
await this.startPlayback(), u.setState({
|
|
1560
|
-
playbackState: "capturing"
|
|
1561
|
-
}), this.#u(), this.#e = void 0;
|
|
1562
1581
|
}
|
|
1563
1582
|
}
|
|
1564
1583
|
/**
|
|
@@ -1568,7 +1587,7 @@ class na {
|
|
|
1568
1587
|
*/
|
|
1569
1588
|
startFrameCapture = async () => {
|
|
1570
1589
|
try {
|
|
1571
|
-
await this.#
|
|
1590
|
+
await this.#f();
|
|
1572
1591
|
} catch (e) {
|
|
1573
1592
|
if (this.userInitiatedAbort)
|
|
1574
1593
|
this.reset();
|
|
@@ -1582,12 +1601,16 @@ class na {
|
|
|
1582
1601
|
* @param params - The parameters for the camera stream.
|
|
1583
1602
|
* @returns resolves when the camera stream starts
|
|
1584
1603
|
*/
|
|
1585
|
-
async #
|
|
1604
|
+
async #m({
|
|
1586
1605
|
autoplay: e = !0,
|
|
1587
|
-
preferredCamera:
|
|
1606
|
+
preferredCamera: r,
|
|
1588
1607
|
preferredFacing: a = "back"
|
|
1589
1608
|
} = {}) {
|
|
1590
|
-
|
|
1609
|
+
if (this.#i()) {
|
|
1610
|
+
e && this.#c("playback"), console.warn("Can't start stream while document is hidden");
|
|
1611
|
+
return;
|
|
1612
|
+
}
|
|
1613
|
+
const n = f.getState().videoElement;
|
|
1591
1614
|
if (!n) {
|
|
1592
1615
|
console.warn("Can't start stream without a video element");
|
|
1593
1616
|
return;
|
|
@@ -1596,7 +1619,7 @@ class na {
|
|
|
1596
1619
|
console.warn("Already streaming");
|
|
1597
1620
|
return;
|
|
1598
1621
|
}
|
|
1599
|
-
if (
|
|
1622
|
+
if (r instanceof $e && await this.selectCamera(r), !f.getState().selectedCamera)
|
|
1600
1623
|
try {
|
|
1601
1624
|
const s = await this.getCameraDevices();
|
|
1602
1625
|
let l;
|
|
@@ -1604,9 +1627,9 @@ class na {
|
|
|
1604
1627
|
throw console.warn("Camera list is empty"), new Error(
|
|
1605
1628
|
`No cameras found matching the filter ${a}`
|
|
1606
1629
|
);
|
|
1607
|
-
if (typeof
|
|
1630
|
+
if (typeof r == "function" && (l = r(s), l || console.warn(
|
|
1608
1631
|
"No camera found matching the preferred camera function, falling back to facing mode"
|
|
1609
|
-
)), l || (l = await
|
|
1632
|
+
)), l || (l = await St(
|
|
1610
1633
|
s,
|
|
1611
1634
|
this.resolution,
|
|
1612
1635
|
a
|
|
@@ -1614,21 +1637,25 @@ class na {
|
|
|
1614
1637
|
throw new Error(
|
|
1615
1638
|
`No cameras found matching the filter ${a}`
|
|
1616
1639
|
);
|
|
1617
|
-
await this.selectCamera(l), this.#
|
|
1640
|
+
await this.selectCamera(l), this.#d() && f.setState({
|
|
1618
1641
|
errorState: void 0
|
|
1619
1642
|
});
|
|
1620
1643
|
} catch (s) {
|
|
1621
|
-
throw
|
|
1622
|
-
errorState:
|
|
1644
|
+
throw f.setState({
|
|
1645
|
+
errorState: Q(s)
|
|
1623
1646
|
}), s;
|
|
1624
1647
|
}
|
|
1625
|
-
const
|
|
1626
|
-
if (!
|
|
1648
|
+
const i = f.getState().selectedCamera;
|
|
1649
|
+
if (!i)
|
|
1627
1650
|
throw console.warn("No selected camera!"), new Error("No selected camera");
|
|
1628
|
-
|
|
1651
|
+
if (this.#i()) {
|
|
1652
|
+
console.warn("Can't start stream while document is hidden");
|
|
1653
|
+
return;
|
|
1654
|
+
}
|
|
1655
|
+
const o = await i.startStream(this.#r);
|
|
1629
1656
|
if (!n.isConnected)
|
|
1630
1657
|
throw new Error("Video element needs to be in the document!");
|
|
1631
|
-
n.srcObject =
|
|
1658
|
+
n.srcObject = o, f.setState({
|
|
1632
1659
|
videoElement: n
|
|
1633
1660
|
}), e && await this.startPlayback(), this.#e === "capturing" && (console.debug("Resuming frame capture"), await this.startFrameCapture()), this.#e === "playback" && (console.debug("Resuming playback"), await this.startPlayback());
|
|
1634
1661
|
}
|
|
@@ -1641,12 +1668,12 @@ class na {
|
|
|
1641
1668
|
*/
|
|
1642
1669
|
async startCameraStream(e = {}) {
|
|
1643
1670
|
try {
|
|
1644
|
-
await this.#
|
|
1645
|
-
} catch (
|
|
1671
|
+
await this.#m(e);
|
|
1672
|
+
} catch (r) {
|
|
1646
1673
|
if (this.userInitiatedAbort)
|
|
1647
1674
|
this.reset();
|
|
1648
1675
|
else
|
|
1649
|
-
throw
|
|
1676
|
+
throw r;
|
|
1650
1677
|
}
|
|
1651
1678
|
}
|
|
1652
1679
|
/**
|
|
@@ -1654,15 +1681,15 @@ class na {
|
|
|
1654
1681
|
*
|
|
1655
1682
|
* @returns true if the error state is a permission error
|
|
1656
1683
|
*/
|
|
1657
|
-
#
|
|
1658
|
-
const e =
|
|
1659
|
-
return e instanceof
|
|
1684
|
+
#d = () => {
|
|
1685
|
+
const e = f.getState().errorState;
|
|
1686
|
+
return e instanceof B && e.code === "PERMISSION_DENIED";
|
|
1660
1687
|
};
|
|
1661
1688
|
/**
|
|
1662
1689
|
* Pauses capturing frames, without stopping playback.
|
|
1663
1690
|
*/
|
|
1664
1691
|
stopFrameCapture() {
|
|
1665
|
-
|
|
1692
|
+
this.#b(), f.setState({
|
|
1666
1693
|
playbackState: "playback"
|
|
1667
1694
|
});
|
|
1668
1695
|
}
|
|
@@ -1671,7 +1698,7 @@ class na {
|
|
|
1671
1698
|
*/
|
|
1672
1699
|
stopStream() {
|
|
1673
1700
|
console.debug("stopStream called");
|
|
1674
|
-
const e =
|
|
1701
|
+
const e = f.getState();
|
|
1675
1702
|
this.pausePlayback(), e.selectedCamera?.stopStream(), e.videoElement && (e.videoElement.srcObject = null);
|
|
1676
1703
|
}
|
|
1677
1704
|
/**
|
|
@@ -1679,17 +1706,17 @@ class na {
|
|
|
1679
1706
|
*/
|
|
1680
1707
|
pausePlayback() {
|
|
1681
1708
|
console.debug("pausePlayback called");
|
|
1682
|
-
const e =
|
|
1683
|
-
|
|
1709
|
+
const e = f.getState();
|
|
1710
|
+
this.#b(), f.setState({
|
|
1684
1711
|
playbackState: "idle"
|
|
1685
|
-
}), e
|
|
1712
|
+
}), e.videoElement?.pause();
|
|
1686
1713
|
}
|
|
1687
1714
|
/**
|
|
1688
1715
|
* The main recognition loop. Do not call this method directly, use `#queueFrame` instead.
|
|
1689
1716
|
*/
|
|
1690
|
-
async #
|
|
1691
|
-
const e =
|
|
1692
|
-
if (this.#
|
|
1717
|
+
async #p() {
|
|
1718
|
+
const e = f.getState();
|
|
1719
|
+
if (this.#a === void 0) {
|
|
1693
1720
|
console.error("Missing request ID");
|
|
1694
1721
|
return;
|
|
1695
1722
|
}
|
|
@@ -1704,40 +1731,40 @@ class na {
|
|
|
1704
1731
|
return;
|
|
1705
1732
|
}
|
|
1706
1733
|
if (!(e.videoElement.videoHeight >= e.videoElement.videoWidth == e.extractionArea.height >= e.extractionArea.width))
|
|
1707
|
-
return this.#
|
|
1708
|
-
if (this.#
|
|
1709
|
-
const a = this.#
|
|
1734
|
+
return this.#g();
|
|
1735
|
+
if (this.#s.size !== 0) {
|
|
1736
|
+
const a = this.#n.getImageData(
|
|
1710
1737
|
e.videoElement,
|
|
1711
1738
|
e.extractionArea
|
|
1712
1739
|
);
|
|
1713
|
-
for (const n of this.#
|
|
1714
|
-
const
|
|
1715
|
-
if (
|
|
1716
|
-
if (!(
|
|
1740
|
+
for (const n of this.#s) {
|
|
1741
|
+
const i = le(a.data.buffer) ? this.#n.getCurrentImageData() : a, o = await n(i);
|
|
1742
|
+
if (o) {
|
|
1743
|
+
if (!(o instanceof ArrayBuffer))
|
|
1717
1744
|
throw new Error(
|
|
1718
|
-
|
|
1745
|
+
Ne`
|
|
1719
1746
|
Frame capture callback did not return an ArrayBuffer.
|
|
1720
1747
|
Make sure to return the underlying buffer, not the view.
|
|
1721
1748
|
`
|
|
1722
1749
|
);
|
|
1723
|
-
this.#
|
|
1750
|
+
this.#n.reattachArrayBuffer(o);
|
|
1724
1751
|
}
|
|
1725
1752
|
}
|
|
1726
1753
|
}
|
|
1727
|
-
this.#
|
|
1754
|
+
this.#g();
|
|
1728
1755
|
}
|
|
1729
1756
|
/**
|
|
1730
1757
|
* Queues the next frame to be processed.
|
|
1731
1758
|
*/
|
|
1732
|
-
#
|
|
1733
|
-
const e =
|
|
1759
|
+
#g() {
|
|
1760
|
+
const e = f.getState();
|
|
1734
1761
|
if (e.playbackState === "capturing") {
|
|
1735
1762
|
if (!e.videoElement) {
|
|
1736
1763
|
console.warn("Missing video element, should not happen");
|
|
1737
1764
|
return;
|
|
1738
1765
|
}
|
|
1739
|
-
this.#
|
|
1740
|
-
() => void this.#
|
|
1766
|
+
this.#b(), this.#a = e.videoElement.requestVideoFrameCallback(
|
|
1767
|
+
() => void this.#p()
|
|
1741
1768
|
);
|
|
1742
1769
|
}
|
|
1743
1770
|
}
|
|
@@ -1745,13 +1772,22 @@ class na {
|
|
|
1745
1772
|
* Applies a mirror effect to the video if the camera is front-facing.
|
|
1746
1773
|
* Assumes that desktop devices don't return a facing mode and that they are front-facing.
|
|
1747
1774
|
*/
|
|
1748
|
-
#
|
|
1749
|
-
const e =
|
|
1775
|
+
#v() {
|
|
1776
|
+
const e = f.getState().selectedCamera;
|
|
1750
1777
|
if (!e) {
|
|
1751
1778
|
console.warn("No camera selected");
|
|
1752
1779
|
return;
|
|
1753
1780
|
}
|
|
1754
|
-
this.#
|
|
1781
|
+
this.#t && (e.facingMode !== "back" ? this.setCameraMirrorX(!0) : this.setCameraMirrorX(!1));
|
|
1782
|
+
}
|
|
1783
|
+
/**
|
|
1784
|
+
* Cancels any pending video frame callback and optionally clears the request ID.
|
|
1785
|
+
*
|
|
1786
|
+
* @param clearRequestId - Whether to clear the request ID after canceling
|
|
1787
|
+
*/
|
|
1788
|
+
#b() {
|
|
1789
|
+
const e = f.getState();
|
|
1790
|
+
this.#a && e.videoElement && (e.videoElement.cancelVideoFrameCallback(this.#a), this.#a = void 0);
|
|
1755
1791
|
}
|
|
1756
1792
|
/**
|
|
1757
1793
|
* If true, the video and captured frames will be mirrored horizontally.
|
|
@@ -1759,12 +1795,12 @@ class na {
|
|
|
1759
1795
|
* @param mirrorX - If true, the video and captured frames will be mirrored horizontally.
|
|
1760
1796
|
*/
|
|
1761
1797
|
setCameraMirrorX(e) {
|
|
1762
|
-
const
|
|
1798
|
+
const r = f.getState(), a = r.videoElement;
|
|
1763
1799
|
if (!a) {
|
|
1764
1800
|
console.warn("Mirror video - no video element present.");
|
|
1765
1801
|
return;
|
|
1766
1802
|
}
|
|
1767
|
-
|
|
1803
|
+
r.mirrorX !== e && (e ? a.style.scale = "-1 1" : a.style.removeProperty("scale"), f.setState({ mirrorX: e }));
|
|
1768
1804
|
}
|
|
1769
1805
|
// The "typeof" is necessary to avoid a circular dependency when resolving types
|
|
1770
1806
|
/**
|
|
@@ -1774,217 +1810,219 @@ class na {
|
|
|
1774
1810
|
*
|
|
1775
1811
|
* @returns a cleanup function to remove the subscription
|
|
1776
1812
|
*/
|
|
1777
|
-
subscribe =
|
|
1813
|
+
subscribe = f.subscribe;
|
|
1778
1814
|
/**
|
|
1779
1815
|
* Gets the current internal state of the CameraManager.
|
|
1780
1816
|
*
|
|
1781
1817
|
* @returns the current state of the CameraManager
|
|
1782
1818
|
*/
|
|
1783
|
-
getState =
|
|
1819
|
+
getState = f.getState;
|
|
1784
1820
|
/**
|
|
1785
1821
|
* Resets the CameraManager and stops all streams.
|
|
1786
1822
|
*/
|
|
1787
1823
|
reset() {
|
|
1788
|
-
console.debug("Resetting camera manager"), this.#
|
|
1824
|
+
console.debug("Resetting camera manager"), this.#s.clear(), this.userInitiatedAbort = !1, this.stopStream(), Rt();
|
|
1789
1825
|
}
|
|
1790
1826
|
}
|
|
1791
|
-
const
|
|
1827
|
+
const Bt = {
|
|
1792
1828
|
mirrorFrontCameras: !0,
|
|
1793
1829
|
preferredResolution: "1080p"
|
|
1794
|
-
},
|
|
1795
|
-
function
|
|
1796
|
-
return
|
|
1830
|
+
}, qe = xe();
|
|
1831
|
+
function Ut() {
|
|
1832
|
+
return Ae(f);
|
|
1797
1833
|
}
|
|
1798
|
-
const
|
|
1834
|
+
const qt = (t) => {
|
|
1799
1835
|
const e = {
|
|
1800
|
-
cameraManagerSolidStore:
|
|
1836
|
+
cameraManagerSolidStore: Ut(),
|
|
1801
1837
|
// eslint-disable-next-line solid/reactivity
|
|
1802
|
-
cameraManager:
|
|
1838
|
+
cameraManager: t.cameraManager,
|
|
1803
1839
|
// eslint-disable-next-line solid/reactivity
|
|
1804
1840
|
dismountCameraUi: () => {
|
|
1805
|
-
|
|
1841
|
+
t.cameraManager.userInitiatedAbort = !0, t.dismountCameraUi();
|
|
1806
1842
|
},
|
|
1807
1843
|
// eslint-disable-next-line solid/reactivity
|
|
1808
|
-
addOnDismountCallback:
|
|
1844
|
+
addOnDismountCallback: t.addOnDismountCallback,
|
|
1809
1845
|
// eslint-disable-next-line solid/reactivity
|
|
1810
|
-
mountTarget:
|
|
1846
|
+
mountTarget: t.mountTarget,
|
|
1811
1847
|
// eslint-disable-next-line solid/reactivity
|
|
1812
|
-
showMirrorCameraButton:
|
|
1848
|
+
showMirrorCameraButton: t.showMirrorCameraButton,
|
|
1813
1849
|
// eslint-disable-next-line solid/reactivity
|
|
1814
|
-
showTorchButton:
|
|
1850
|
+
showTorchButton: t.showTorchButton,
|
|
1815
1851
|
// eslint-disable-next-line solid/reactivity
|
|
1816
|
-
showCloseButton:
|
|
1852
|
+
showCloseButton: t.showCloseButton,
|
|
1817
1853
|
// eslint-disable-next-line solid/reactivity
|
|
1818
|
-
showCameraErrorModal:
|
|
1854
|
+
showCameraErrorModal: t.showCameraErrorModal,
|
|
1855
|
+
// eslint-disable-next-line solid/reactivity
|
|
1856
|
+
zIndex: t.zIndex
|
|
1819
1857
|
};
|
|
1820
|
-
return
|
|
1858
|
+
return J(() => {
|
|
1821
1859
|
console.debug("CameraUiStoreProvider cleanup");
|
|
1822
|
-
}), c(
|
|
1860
|
+
}), c(qe.Provider, {
|
|
1823
1861
|
value: e,
|
|
1824
1862
|
get children() {
|
|
1825
|
-
return
|
|
1863
|
+
return t.children;
|
|
1826
1864
|
}
|
|
1827
1865
|
});
|
|
1828
1866
|
};
|
|
1829
|
-
function
|
|
1830
|
-
const
|
|
1831
|
-
if (!
|
|
1867
|
+
function q() {
|
|
1868
|
+
const t = Me(qe);
|
|
1869
|
+
if (!t)
|
|
1832
1870
|
throw new Error("StoreContext.Provider not in scope");
|
|
1833
|
-
return
|
|
1871
|
+
return t;
|
|
1834
1872
|
}
|
|
1835
|
-
const
|
|
1873
|
+
const jt = {
|
|
1836
1874
|
camera_error_cancel_btn: "Cancel",
|
|
1837
1875
|
camera_error_details: "Please allow camera access in your browser and try again.",
|
|
1838
1876
|
camera_error_primary_btn: "Retry",
|
|
1839
1877
|
camera_error_title: "Camera permission required",
|
|
1840
1878
|
close: "Close",
|
|
1879
|
+
dialog_title: "Scan a document",
|
|
1841
1880
|
loading_cameras: "Loading cameras...",
|
|
1842
1881
|
mirror_camera: "Mirror camera",
|
|
1843
|
-
scan_document: "Scan a document",
|
|
1844
1882
|
select_a_camera: "Select a camera",
|
|
1845
1883
|
select_camera: "Select camera",
|
|
1846
1884
|
selected_camera: "Selected camera",
|
|
1847
1885
|
torch: "Torch"
|
|
1848
|
-
},
|
|
1849
|
-
const [e,
|
|
1886
|
+
}, je = xe(), Ht = (t) => {
|
|
1887
|
+
const [e, r] = at(
|
|
1850
1888
|
// we structure clone to avoid proxying to the original object
|
|
1851
1889
|
structuredClone({
|
|
1852
|
-
...
|
|
1890
|
+
...jt,
|
|
1853
1891
|
// we don't care on init
|
|
1854
1892
|
// eslint-disable-next-line solid/reactivity
|
|
1855
|
-
...
|
|
1893
|
+
...t.userStrings
|
|
1856
1894
|
})
|
|
1857
1895
|
);
|
|
1858
|
-
|
|
1859
|
-
|
|
1896
|
+
K(() => {
|
|
1897
|
+
t.setLocalizationRef(r);
|
|
1860
1898
|
});
|
|
1861
1899
|
const a = {
|
|
1862
1900
|
t: e,
|
|
1863
|
-
updateLocalization:
|
|
1901
|
+
updateLocalization: r
|
|
1864
1902
|
};
|
|
1865
|
-
return c(
|
|
1903
|
+
return c(je.Provider, {
|
|
1866
1904
|
value: a,
|
|
1867
1905
|
get children() {
|
|
1868
|
-
return
|
|
1906
|
+
return t.children;
|
|
1869
1907
|
}
|
|
1870
1908
|
});
|
|
1871
1909
|
};
|
|
1872
|
-
function
|
|
1873
|
-
const
|
|
1874
|
-
if (!
|
|
1910
|
+
function Z() {
|
|
1911
|
+
const t = Me(je);
|
|
1912
|
+
if (!t)
|
|
1875
1913
|
throw new Error("LocalizationContext.Provider not in scope.");
|
|
1876
|
-
return
|
|
1914
|
+
return t;
|
|
1877
1915
|
}
|
|
1878
|
-
var
|
|
1879
|
-
const
|
|
1880
|
-
const [e,
|
|
1881
|
-
return
|
|
1882
|
-
const
|
|
1883
|
-
|
|
1884
|
-
}), c(
|
|
1916
|
+
var Wt = /* @__PURE__ */ w("<span>");
|
|
1917
|
+
const ee = (t) => {
|
|
1918
|
+
const [e, r] = I(), [a, n] = I();
|
|
1919
|
+
return K(() => {
|
|
1920
|
+
const i = a();
|
|
1921
|
+
i && r(i.getRootNode());
|
|
1922
|
+
}), c(x, {
|
|
1885
1923
|
get when() {
|
|
1886
1924
|
return e();
|
|
1887
1925
|
},
|
|
1888
1926
|
get fallback() {
|
|
1889
1927
|
return (() => {
|
|
1890
|
-
var
|
|
1891
|
-
return V(n,
|
|
1928
|
+
var i = Wt();
|
|
1929
|
+
return V(n, i), i;
|
|
1892
1930
|
})();
|
|
1893
1931
|
},
|
|
1894
|
-
children: (
|
|
1895
|
-
value: () =>
|
|
1932
|
+
children: (i) => c(nt, {
|
|
1933
|
+
value: () => i(),
|
|
1896
1934
|
get children() {
|
|
1897
|
-
return
|
|
1935
|
+
return t.children(i());
|
|
1898
1936
|
}
|
|
1899
1937
|
})
|
|
1900
1938
|
});
|
|
1901
1939
|
};
|
|
1902
|
-
var
|
|
1903
|
-
const
|
|
1904
|
-
var e = qt();
|
|
1905
|
-
return $(e, r, !0, !0), e;
|
|
1906
|
-
})();
|
|
1907
|
-
var Ht = /* @__PURE__ */ y('<svg viewBox="0 0 24 24"width=1.2em height=1.2em><path fill=currentColor d="M7 2h10l-2 7h4l-2.925 4.225L7 4.15zm3 20v-8H7V9.85L1.375 4.225L2.8 2.8l18.4 18.4l-1.425 1.425L13.75 16.6z">');
|
|
1908
|
-
const Wt = (r = {}) => (() => {
|
|
1909
|
-
var e = Ht();
|
|
1910
|
-
return $(e, r, !0, !0), e;
|
|
1911
|
-
})();
|
|
1912
|
-
var Gt = /* @__PURE__ */ y('<svg viewBox="0 0 24 24"width=1.2em height=1.2em><path fill=currentColor d="M10 22v-8H7V2h10l-2 7h4z">');
|
|
1913
|
-
const Xt = (r = {}) => (() => {
|
|
1940
|
+
var Gt = /* @__PURE__ */ w('<svg viewBox="0 0 24 24"width=1.2em height=1.2em><path fill=currentColor d="M6.4 19L5 17.6l5.6-5.6L5 6.4L6.4 5l5.6 5.6L17.6 5L19 6.4L13.4 12l5.6 5.6l-1.4 1.4l-5.6-5.6z">');
|
|
1941
|
+
const Xt = (t = {}) => (() => {
|
|
1914
1942
|
var e = Gt();
|
|
1915
|
-
return
|
|
1943
|
+
return A(e, t, !0, !0), e;
|
|
1916
1944
|
})();
|
|
1917
|
-
var Qt = /* @__PURE__ */
|
|
1918
|
-
const Kt = (
|
|
1945
|
+
var Qt = /* @__PURE__ */ w('<svg viewBox="0 0 24 24"width=1.2em height=1.2em><path fill=currentColor d="M7 2h10l-2 7h4l-2.925 4.225L7 4.15zm3 20v-8H7V9.85L1.375 4.225L2.8 2.8l18.4 18.4l-1.425 1.425L13.75 16.6z">');
|
|
1946
|
+
const Kt = (t = {}) => (() => {
|
|
1919
1947
|
var e = Qt();
|
|
1920
|
-
return
|
|
1948
|
+
return A(e, t, !0, !0), e;
|
|
1921
1949
|
})();
|
|
1922
|
-
|
|
1950
|
+
var Yt = /* @__PURE__ */ w('<svg viewBox="0 0 24 24"width=1.2em height=1.2em><path fill=currentColor d="M10 22v-8H7V2h10l-2 7h4z">');
|
|
1951
|
+
const Jt = (t = {}) => (() => {
|
|
1952
|
+
var e = Yt();
|
|
1953
|
+
return A(e, t, !0, !0), e;
|
|
1954
|
+
})();
|
|
1955
|
+
var Zt = /* @__PURE__ */ w('<svg viewBox="0 0 24 24"width=1.2em height=1.2em><path fill=currentColor d="M9 21H5q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h4v2H5v14h4zm2 2V1h2v22zm4-2v-2h2v2zm0-16V3h2v2zm4 16v-2h2q0 .825-.587 1.413T19 21m0-4v-2h2v2zm0-4v-2h2v2zm0-4V7h2v2zm0-4V3q.825 0 1.413.588T21 5z">');
|
|
1956
|
+
const er = (t = {}) => (() => {
|
|
1957
|
+
var e = Zt();
|
|
1958
|
+
return A(e, t, !0, !0), e;
|
|
1959
|
+
})();
|
|
1960
|
+
function He(t) {
|
|
1923
1961
|
const e = {};
|
|
1924
|
-
return Object.entries(
|
|
1925
|
-
const n =
|
|
1926
|
-
let
|
|
1962
|
+
return Object.entries(t).forEach(([r, a]) => {
|
|
1963
|
+
const n = r.toLowerCase();
|
|
1964
|
+
let i = n;
|
|
1927
1965
|
if (n.startsWith("on")) {
|
|
1928
|
-
|
|
1929
|
-
const
|
|
1930
|
-
e[i] = a;
|
|
1931
|
-
} else
|
|
1966
|
+
i = n.slice(2);
|
|
1967
|
+
const o = `on:${i}`;
|
|
1932
1968
|
e[o] = a;
|
|
1969
|
+
} else
|
|
1970
|
+
e[i] = a;
|
|
1933
1971
|
}), e;
|
|
1934
1972
|
}
|
|
1935
|
-
var
|
|
1936
|
-
const
|
|
1937
|
-
var e =
|
|
1938
|
-
return
|
|
1973
|
+
var tr = /* @__PURE__ */ w('<svg xmlns=http://www.w3.org/2000/svg fill=none viewBox="0 0 20 20"><g fill=#fff fill-rule=evenodd clip-rule=evenodd><path d="M6.322 2.988A1.67 1.67 0 0 1 7.5 2.5h5a1.667 1.667 0 0 1 1.667 1.667A.833.833 0 0 0 15 5h.833a2.5 2.5 0 0 1 2.5 2.5V15a2.5 2.5 0 0 1-2.5 2.5H4.167a2.5 2.5 0 0 1-2.5-2.5V7.5a2.5 2.5 0 0 1 2.5-2.5H5a.833.833 0 0 0 .833-.833c0-.442.176-.866.489-1.179M4.167 6.667a.833.833 0 0 0-.834.833V15a.833.833 0 0 0 .834.833h11.666a.834.834 0 0 0 .834-.833V7.5a.833.833 0 0 0-.834-.833H15a2.5 2.5 0 0 1-2.5-2.5h-5a2.5 2.5 0 0 1-2.5 2.5z"></path><path d="M10 9.167a1.667 1.667 0 1 0 0 3.333 1.667 1.667 0 0 0 0-3.333m-3.333 1.666a3.333 3.333 0 1 1 6.666 0 3.333 3.333 0 0 1-6.666 0">');
|
|
1974
|
+
const rr = (t = {}) => (() => {
|
|
1975
|
+
var e = tr();
|
|
1976
|
+
return A(e, t, !0, !0), e;
|
|
1939
1977
|
})();
|
|
1940
|
-
var
|
|
1941
|
-
const
|
|
1942
|
-
var e =
|
|
1943
|
-
return
|
|
1978
|
+
var ar = /* @__PURE__ */ w('<svg xmlns=http://www.w3.org/2000/svg fill=none viewBox="0 0 20 20"><path stroke=#fff stroke-linecap=round stroke-linejoin=round stroke-width=2 d="M4.167 10.833 7.5 14.167l8.333-8.334">');
|
|
1979
|
+
const nr = (t = {}) => (() => {
|
|
1980
|
+
var e = ar();
|
|
1981
|
+
return A(e, t, !0, !0), e;
|
|
1944
1982
|
})();
|
|
1945
|
-
var
|
|
1946
|
-
const
|
|
1947
|
-
var e =
|
|
1948
|
-
return
|
|
1983
|
+
var or = /* @__PURE__ */ w('<svg xmlns=http://www.w3.org/2000/svg fill=none viewBox="0 0 20 20"><path fill=#fff fill-rule=evenodd d="M4.41 6.91a.833.833 0 0 1 1.18 0L10 11.323l4.41-4.411a.833.833 0 1 1 1.18 1.178l-5 5a.833.833 0 0 1-1.18 0l-5-5a.833.833 0 0 1 0-1.178"clip-rule=evenodd>');
|
|
1984
|
+
const ir = (t = {}) => (() => {
|
|
1985
|
+
var e = or();
|
|
1986
|
+
return A(e, t, !0, !0), e;
|
|
1949
1987
|
})();
|
|
1950
|
-
var
|
|
1951
|
-
const
|
|
1988
|
+
var sr = /* @__PURE__ */ w("<button>");
|
|
1989
|
+
const lr = () => {
|
|
1952
1990
|
const {
|
|
1953
|
-
cameraManagerSolidStore:
|
|
1991
|
+
cameraManagerSolidStore: t,
|
|
1954
1992
|
cameraManager: e
|
|
1955
|
-
} =
|
|
1956
|
-
t
|
|
1957
|
-
} =
|
|
1958
|
-
const
|
|
1959
|
-
return
|
|
1960
|
-
},
|
|
1961
|
-
value:
|
|
1962
|
-
label:
|
|
1963
|
-
}))],
|
|
1964
|
-
items: [...
|
|
1965
|
-
}),
|
|
1966
|
-
const
|
|
1967
|
-
if (!
|
|
1993
|
+
} = q(), {
|
|
1994
|
+
t: r
|
|
1995
|
+
} = Z(), a = t((m) => m.cameras), n = t((m) => m.selectedCamera), i = t((m) => m.facingFilter), o = t((m) => m.isQueryingCameras), s = t((m) => m.isSwappingCamera), l = () => o() || s(), d = () => {
|
|
1996
|
+
const m = i();
|
|
1997
|
+
return m ? a().filter((g) => m.includes(g.facingMode)) : a();
|
|
1998
|
+
}, u = () => [...d().map((m) => ({
|
|
1999
|
+
value: m.deviceInfo.deviceId,
|
|
2000
|
+
label: m.name
|
|
2001
|
+
}))], b = () => ot({
|
|
2002
|
+
items: [...u()]
|
|
2003
|
+
}), p = () => {
|
|
2004
|
+
const m = n();
|
|
2005
|
+
if (!m)
|
|
1968
2006
|
return;
|
|
1969
|
-
const
|
|
1970
|
-
if (
|
|
1971
|
-
return [
|
|
1972
|
-
},
|
|
1973
|
-
const
|
|
1974
|
-
if (!
|
|
2007
|
+
const g = b().find(m.deviceInfo.deviceId);
|
|
2008
|
+
if (g)
|
|
2009
|
+
return [g.value];
|
|
2010
|
+
}, h = async (m) => {
|
|
2011
|
+
const g = a().find((S) => S.deviceInfo.deviceId === m);
|
|
2012
|
+
if (!g) {
|
|
1975
2013
|
console.warn("No camera");
|
|
1976
2014
|
return;
|
|
1977
2015
|
}
|
|
1978
|
-
await e.selectCamera(
|
|
2016
|
+
await e.selectCamera(g);
|
|
1979
2017
|
};
|
|
1980
|
-
return c(
|
|
1981
|
-
children: () => c(
|
|
2018
|
+
return c(ee, {
|
|
2019
|
+
children: () => c(_.Root, {
|
|
1982
2020
|
part: "camera-select-part",
|
|
1983
2021
|
get collection() {
|
|
1984
|
-
return
|
|
2022
|
+
return b();
|
|
1985
2023
|
},
|
|
1986
2024
|
get value() {
|
|
1987
|
-
return
|
|
2025
|
+
return p();
|
|
1988
2026
|
},
|
|
1989
2027
|
positioning: {
|
|
1990
2028
|
placement: "top"
|
|
@@ -1993,85 +2031,70 @@ const nr = () => {
|
|
|
1993
2031
|
get disabled() {
|
|
1994
2032
|
return l();
|
|
1995
2033
|
},
|
|
1996
|
-
onValueChange: (
|
|
1997
|
-
m
|
|
2034
|
+
onValueChange: (m) => {
|
|
2035
|
+
h(m.value[0]);
|
|
1998
2036
|
},
|
|
1999
2037
|
get children() {
|
|
2000
|
-
return [c(
|
|
2038
|
+
return [c(_.Label, {
|
|
2001
2039
|
class: "sr-only",
|
|
2002
2040
|
get children() {
|
|
2003
|
-
return
|
|
2041
|
+
return r.selected_camera;
|
|
2004
2042
|
}
|
|
2005
|
-
}), c(
|
|
2006
|
-
asChild: (
|
|
2007
|
-
var
|
|
2008
|
-
return
|
|
2009
|
-
class:
|
|
2010
|
-
|
|
2011
|
-
color-white font-500 cursor-pointer appearance-none
|
|
2012
|
-
border-none disabled:opacity-50 disabled:cursor-not-allowed
|
|
2013
|
-
max-w-[100%] btn-focus`
|
|
2014
|
-
}), !1, !0), w(h, c(Jt, {
|
|
2043
|
+
}), c(_.Trigger, {
|
|
2044
|
+
asChild: (m) => (() => {
|
|
2045
|
+
var g = sr();
|
|
2046
|
+
return A(g, H(() => He(m()), {
|
|
2047
|
+
class: "flex px-4 py-2 items-center gap-2 rounded-full bg-gray-550/90 backdrop-blur-xl whitespace-nowrap text-base color-white font-500 cursor-pointer appearance-none border-none disabled:opacity-50 disabled:cursor-not-allowed max-w-[100%] btn-focus"
|
|
2048
|
+
}), !1, !0), y(g, c(rr, {
|
|
2015
2049
|
class: "size-6 shrink-0",
|
|
2016
|
-
"aria-hidden":
|
|
2017
|
-
}), null),
|
|
2050
|
+
"aria-hidden": "true"
|
|
2051
|
+
}), null), y(g, c(_.ValueText, {
|
|
2018
2052
|
class: "truncate",
|
|
2019
2053
|
get placeholder() {
|
|
2020
|
-
return
|
|
2054
|
+
return o() ? r.loading_cameras : r.select_a_camera;
|
|
2021
2055
|
}
|
|
2022
|
-
}), null),
|
|
2056
|
+
}), null), y(g, c(_.Indicator, {
|
|
2023
2057
|
class: "shrink-0 data-[state=open]:scale-y-[-1]",
|
|
2024
2058
|
get children() {
|
|
2025
|
-
return c(
|
|
2059
|
+
return c(ir, {
|
|
2026
2060
|
class: "size-6 shrink-0"
|
|
2027
2061
|
});
|
|
2028
2062
|
}
|
|
2029
|
-
}), null),
|
|
2063
|
+
}), null), g;
|
|
2030
2064
|
})()
|
|
2031
|
-
}), c(
|
|
2032
|
-
class: "focus-visible:outline-none",
|
|
2065
|
+
}), c(_.Positioner, {
|
|
2033
2066
|
get children() {
|
|
2034
|
-
return c(
|
|
2035
|
-
class: "focus-visible:outline-
|
|
2067
|
+
return c(_.Content, {
|
|
2068
|
+
class: "dropdown-content focus-visible:outline focus-visible:outline-2px focus-visible:outline-solid focus-visible:outline-primary focus-visible:outline-offset-4px",
|
|
2036
2069
|
get children() {
|
|
2037
|
-
return c(
|
|
2038
|
-
class:
|
|
2039
|
-
focus-visible:outline-none flex flex-col gap-[1px]`,
|
|
2070
|
+
return c(_.ItemGroup, {
|
|
2071
|
+
class: "rounded-4 overflow-hidden text-base color-white flex flex-col",
|
|
2040
2072
|
get children() {
|
|
2041
|
-
return c(
|
|
2073
|
+
return c(Ze, {
|
|
2042
2074
|
get each() {
|
|
2043
|
-
return
|
|
2075
|
+
return b().items;
|
|
2044
2076
|
},
|
|
2045
|
-
children: (
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
get children() {
|
|
2067
|
-
return c(er, {
|
|
2068
|
-
class: "size-6 shrink-0"
|
|
2069
|
-
});
|
|
2070
|
-
}
|
|
2071
|
-
})];
|
|
2072
|
-
}
|
|
2073
|
-
});
|
|
2074
|
-
}
|
|
2077
|
+
children: (m) => c(_.Item, {
|
|
2078
|
+
get item() {
|
|
2079
|
+
return m();
|
|
2080
|
+
},
|
|
2081
|
+
class: "flex py-3 pl-4 pr-12 cursor-pointer select-none bg-gray-550/50 backdrop-blur-xl data-[highlighted]:bg-gray-550/100 relative first-of-type-rounded-t-6 last-of-type-rounded-b-6 not-first-of-type-b-t-gray-300/50 not-first-of-type-b-t-1 not-first-of-type-b-t-solid",
|
|
2082
|
+
get children() {
|
|
2083
|
+
return [c(_.ItemText, {
|
|
2084
|
+
class: "truncate",
|
|
2085
|
+
get children() {
|
|
2086
|
+
return m().label;
|
|
2087
|
+
}
|
|
2088
|
+
}), c(_.ItemIndicator, {
|
|
2089
|
+
class: "absolute right-4",
|
|
2090
|
+
get children() {
|
|
2091
|
+
return c(nr, {
|
|
2092
|
+
class: "size-6 shrink-0"
|
|
2093
|
+
});
|
|
2094
|
+
}
|
|
2095
|
+
})];
|
|
2096
|
+
}
|
|
2097
|
+
})
|
|
2075
2098
|
});
|
|
2076
2099
|
}
|
|
2077
2100
|
});
|
|
@@ -2083,83 +2106,85 @@ const nr = () => {
|
|
|
2083
2106
|
})
|
|
2084
2107
|
});
|
|
2085
2108
|
};
|
|
2086
|
-
var
|
|
2087
|
-
const
|
|
2109
|
+
var cr = /* @__PURE__ */ w("<div class=justify-self-end>"), ur = /* @__PURE__ */ w('<div class="z-2 relative gap-2 grid justify-between items-center grid-cols-[1fr_auto_1fr] py-4 color-white lerp:px-3@xs,8@lg"><div class="justify-self-start flex flex-nowrap gap-4 auto-cols-auto"></div><div class="justify-self-center min-w-0 w-full">'), dr = /* @__PURE__ */ w("<button>");
|
|
2110
|
+
const hr = () => {
|
|
2088
2111
|
const {
|
|
2089
|
-
dismountCameraUi:
|
|
2112
|
+
dismountCameraUi: t,
|
|
2090
2113
|
cameraManagerSolidStore: e,
|
|
2091
|
-
cameraManager:
|
|
2114
|
+
cameraManager: r,
|
|
2092
2115
|
showMirrorCameraButton: a,
|
|
2093
2116
|
showTorchButton: n,
|
|
2094
|
-
showCloseButton:
|
|
2095
|
-
} =
|
|
2096
|
-
t:
|
|
2097
|
-
} =
|
|
2098
|
-
const
|
|
2099
|
-
|
|
2100
|
-
},
|
|
2101
|
-
|
|
2117
|
+
showCloseButton: i
|
|
2118
|
+
} = q(), {
|
|
2119
|
+
t: o
|
|
2120
|
+
} = Z(), s = e((g) => g.mirrorX), l = e((g) => g.selectedCamera), d = e((g) => g.cameras), u = e((g) => g.playbackState !== "idle"), b = e((g) => g.selectedCamera?.torchEnabled), p = () => l()?.torchSupported, h = () => {
|
|
2121
|
+
const g = l();
|
|
2122
|
+
g && g.toggleTorch();
|
|
2123
|
+
}, m = () => {
|
|
2124
|
+
r.setCameraMirrorX(!e.getState().mirrorX);
|
|
2102
2125
|
};
|
|
2103
|
-
return c(
|
|
2126
|
+
return c(ee, {
|
|
2104
2127
|
children: () => (() => {
|
|
2105
|
-
var
|
|
2106
|
-
return
|
|
2128
|
+
var g = ur(), S = g.firstChild, T = S.nextSibling;
|
|
2129
|
+
return y(S, c(x, {
|
|
2107
2130
|
get when() {
|
|
2108
|
-
return a &&
|
|
2131
|
+
return a && u();
|
|
2109
2132
|
},
|
|
2110
2133
|
get children() {
|
|
2111
|
-
return c(
|
|
2134
|
+
return c(re, {
|
|
2112
2135
|
part: "mirror-camera-button-part",
|
|
2113
2136
|
get tooltipLabel() {
|
|
2114
|
-
return
|
|
2137
|
+
return o.mirror_camera;
|
|
2138
|
+
},
|
|
2139
|
+
onClick: () => m(),
|
|
2140
|
+
get "aria-pressed"() {
|
|
2141
|
+
return s() ? "true" : "false";
|
|
2115
2142
|
},
|
|
2116
|
-
onClick: () => d(),
|
|
2117
2143
|
get children() {
|
|
2118
|
-
return
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
})(), c(Kt, {
|
|
2122
|
-
class: `size-6 shrink-0 transition-transform duration-300
|
|
2123
|
-
ease-in-out`,
|
|
2144
|
+
return c(er, {
|
|
2145
|
+
"aria-hidden": "true",
|
|
2146
|
+
class: "size-6 shrink-0 transition-transform duration-300 ease-in-out",
|
|
2124
2147
|
get style() {
|
|
2125
2148
|
return {
|
|
2126
2149
|
transform: s() ? "scaleX(-1)" : "scaleX(1)"
|
|
2127
2150
|
};
|
|
2128
2151
|
}
|
|
2129
|
-
})
|
|
2152
|
+
});
|
|
2130
2153
|
}
|
|
2131
2154
|
});
|
|
2132
2155
|
}
|
|
2133
|
-
}), null),
|
|
2156
|
+
}), null), y(S, c(x, {
|
|
2134
2157
|
get when() {
|
|
2135
|
-
return
|
|
2158
|
+
return Ee(() => !!(n && p()))() && u();
|
|
2136
2159
|
},
|
|
2137
2160
|
get children() {
|
|
2138
|
-
return c(
|
|
2161
|
+
return c(re, {
|
|
2139
2162
|
part: "torch-button-part",
|
|
2140
|
-
onClick: () =>
|
|
2163
|
+
onClick: () => h(),
|
|
2141
2164
|
get tooltipLabel() {
|
|
2142
|
-
return
|
|
2165
|
+
return o.torch;
|
|
2166
|
+
},
|
|
2167
|
+
get "aria-pressed"() {
|
|
2168
|
+
return b() ? "true" : "false";
|
|
2143
2169
|
},
|
|
2144
2170
|
get children() {
|
|
2145
|
-
return [c(
|
|
2171
|
+
return [c(x, {
|
|
2146
2172
|
get when() {
|
|
2147
|
-
return !
|
|
2173
|
+
return !b();
|
|
2148
2174
|
},
|
|
2149
2175
|
get children() {
|
|
2150
|
-
return
|
|
2151
|
-
|
|
2152
|
-
return w(b, () => i.torch), b;
|
|
2153
|
-
})(), c(Xt, {
|
|
2176
|
+
return c(Jt, {
|
|
2177
|
+
"aria-hidden": "true",
|
|
2154
2178
|
class: "size-6 shrink-0"
|
|
2155
|
-
})
|
|
2179
|
+
});
|
|
2156
2180
|
}
|
|
2157
|
-
}), c(
|
|
2181
|
+
}), c(x, {
|
|
2158
2182
|
get when() {
|
|
2159
|
-
return
|
|
2183
|
+
return b();
|
|
2160
2184
|
},
|
|
2161
2185
|
get children() {
|
|
2162
|
-
return c(
|
|
2186
|
+
return c(Kt, {
|
|
2187
|
+
"aria-hidden": "true",
|
|
2163
2188
|
class: "size-6 shrink-0"
|
|
2164
2189
|
});
|
|
2165
2190
|
}
|
|
@@ -2167,468 +2192,553 @@ const lr = () => {
|
|
|
2167
2192
|
}
|
|
2168
2193
|
});
|
|
2169
2194
|
}
|
|
2170
|
-
}), null),
|
|
2195
|
+
}), null), y(T, c(x, {
|
|
2171
2196
|
get when() {
|
|
2172
|
-
return
|
|
2197
|
+
return d().length > 1;
|
|
2173
2198
|
},
|
|
2174
2199
|
get children() {
|
|
2175
|
-
return c(
|
|
2200
|
+
return c(lr, {});
|
|
2176
2201
|
}
|
|
2177
|
-
})),
|
|
2178
|
-
when:
|
|
2202
|
+
})), y(g, c(x, {
|
|
2203
|
+
when: i,
|
|
2179
2204
|
get children() {
|
|
2180
|
-
var
|
|
2181
|
-
return
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
return
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2205
|
+
var v = cr();
|
|
2206
|
+
return y(v, c(
|
|
2207
|
+
re,
|
|
2208
|
+
{
|
|
2209
|
+
part: "close-button-part",
|
|
2210
|
+
onClick: () => t(),
|
|
2211
|
+
get tooltipLabel() {
|
|
2212
|
+
return o.close;
|
|
2213
|
+
},
|
|
2214
|
+
get children() {
|
|
2215
|
+
return c(Xt, {
|
|
2216
|
+
class: "size-6 shrink-0",
|
|
2217
|
+
"aria-hidden": "true"
|
|
2218
|
+
});
|
|
2219
|
+
}
|
|
2194
2220
|
}
|
|
2195
|
-
|
|
2221
|
+
)), v;
|
|
2196
2222
|
}
|
|
2197
|
-
}), null),
|
|
2223
|
+
}), null), g;
|
|
2198
2224
|
})()
|
|
2199
2225
|
});
|
|
2200
|
-
},
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
}
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2226
|
+
}, re = (t) => {
|
|
2227
|
+
const [e, r] = Y(t, ["tooltipLabel", "children"]);
|
|
2228
|
+
return c(X.Root, {
|
|
2229
|
+
get children() {
|
|
2230
|
+
return [c(X.Trigger, {
|
|
2231
|
+
asChild: (a) => {
|
|
2232
|
+
const [, n] = Y(a(), ["aria-describedby"]);
|
|
2233
|
+
return (() => {
|
|
2234
|
+
var i = dr();
|
|
2235
|
+
return A(i, H({
|
|
2236
|
+
get "aria-label"() {
|
|
2237
|
+
return e.tooltipLabel;
|
|
2238
|
+
}
|
|
2239
|
+
}, r, () => He(n), {
|
|
2240
|
+
class: "btn-focus rounded-full bg-gray-550/70 backdrop-blur grid place-items-center size-12 appearance-none border-none cursor-pointer"
|
|
2241
|
+
}), !1, !0), y(i, () => e.children), i;
|
|
2242
|
+
})();
|
|
2243
|
+
}
|
|
2244
|
+
}), c(X.Positioner, {
|
|
2245
|
+
get children() {
|
|
2246
|
+
return c(X.Content, {
|
|
2247
|
+
class: "bg-gray-550/70 backdrop-blur color-white text-align-center p-2 rounded-md text-sm drop-shadow-md",
|
|
2248
|
+
"aria-hidden": "true",
|
|
2249
|
+
get children() {
|
|
2250
|
+
return e.tooltipLabel;
|
|
2251
|
+
}
|
|
2252
|
+
});
|
|
2253
|
+
}
|
|
2254
|
+
})];
|
|
2255
|
+
}
|
|
2256
|
+
});
|
|
2257
|
+
}, fr = (t, e, r) => oe((a) => (y(e, t(), e.firstChild ? null : void 0), () => {
|
|
2258
|
+
a(), e instanceof Document || (e.textContent = "");
|
|
2259
|
+
}), r);
|
|
2260
|
+
var mr = /* @__PURE__ */ w("<div>");
|
|
2261
|
+
const gr = (t) => {
|
|
2262
|
+
const e = Re(), [r, a] = Y(t, ["children", "disableShadowRoot", "getRef"]);
|
|
2229
2263
|
return (() => {
|
|
2230
|
-
var n =
|
|
2231
|
-
return V((
|
|
2232
|
-
if (
|
|
2264
|
+
var n = mr();
|
|
2265
|
+
return V((i) => {
|
|
2266
|
+
if (r.disableShadowRoot)
|
|
2233
2267
|
return;
|
|
2234
|
-
const
|
|
2268
|
+
const o = i.attachShadow({
|
|
2235
2269
|
mode: "open"
|
|
2236
2270
|
});
|
|
2237
|
-
|
|
2238
|
-
}, n),
|
|
2271
|
+
fr(() => Ee(() => r.children), o, e);
|
|
2272
|
+
}, n), A(n, a, !1, !0), y(n, c(x, {
|
|
2239
2273
|
get when() {
|
|
2240
|
-
return
|
|
2274
|
+
return r.disableShadowRoot;
|
|
2241
2275
|
},
|
|
2242
2276
|
get children() {
|
|
2243
|
-
return
|
|
2277
|
+
return r.children;
|
|
2244
2278
|
}
|
|
2245
2279
|
})), n;
|
|
2246
2280
|
})();
|
|
2247
|
-
},
|
|
2281
|
+
}, br = ":where(html){line-height:1.15;-webkit-text-size-adjust:100%;text-size-adjust:100%}:where(h1){font-size:2em;margin-block-end:.67em;margin-block-start:.67em}:where(dl,ol,ul) :where(dl,ol,ul){margin-block-end:0;margin-block-start:0}:where(hr){box-sizing:content-box;color:inherit;height:0}:where(abbr[title]){text-decoration:underline;text-decoration:underline dotted}:where(b,strong){font-weight:bolder}:where(code,kbd,pre,samp){font-family:monospace,monospace;font-size:1em}:where(small){font-size:80%}:where(table){border-color:currentColor;text-indent:0}:where(button,input,select){margin:0}:where(button){text-transform:none}:where(button,input:is([type=button i],[type=reset i],[type=submit i])){-webkit-appearance:button}:where(progress){vertical-align:baseline}:where(select){text-transform:none}:where(textarea){margin:0}:where(input[type=search i]){-webkit-appearance:textfield;outline-offset:-2px}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}::-webkit-input-placeholder{color:inherit;opacity:.54}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}:where(button,input:is([type=button i],[type=color i],[type=reset i],[type=submit i]))::-moz-focus-inner{border-style:none;padding:0}:where(button,input:is([type=button i],[type=color i],[type=reset i],[type=submit i]))::-moz-focusring{outline:1px dotted ButtonText}:where(:-moz-ui-invalid){box-shadow:none}:where(dialog){background-color:#fff;border:solid;color:#000;height:-moz-fit-content;height:fit-content;left:0;margin:auto;padding:1em;position:absolute;right:0;width:-moz-fit-content;width:fit-content}:where(dialog:not([open])){display:none}:where(summary){display:list-item}", pr = ":host{font-family:var(--mb-ui-font);line-height:1.15;isolation:isolate;box-sizing:border-box}*,*:before,*:after{box-sizing:border-box;margin:0;padding:0}p,h1,h2,h3,h4,h5,h6{overflow-wrap:break-word}code,pre{font-family:var(--mb-monospace-font-stack)}svg path{pointer-events:none}img,picture,video,canvas,svg{display:block;max-width:100%}img{pointer-events:none;user-select:none}:where(input,button,textarea,select){font:inherit}:where(button,select){cursor:pointer;color:inherit;font:inherit;touch-action:manipulation}:where(p,h1,h2,h3,h4,h5,h6){overflow-wrap:break-word}", vr = ':host{--mb-system-font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;--mb-monospace-font-stack: Menlo, Consolas, "Ubuntu Mono", "Roboto Mono", "DejaVu Sans Mono", monospace;--mb-ui-font: var(--mb-system-font-stack);--mb-size: 1;--color-accent-25-rgb-value: 242 247 255;--color-accent-50-rgb-value: 231 240 255;--color-accent-100-rgb-value: 220 234 255;--color-accent-200-rgb-value: 198 221 255;--color-accent-300-rgb-value: 158 197 255;--color-accent-400-rgb-value: 111 169 255;--color-accent-500-rgb-value: 58 137 253;--color-accent-600-rgb-value: 0 98 242;--color-accent-700-rgb-value: 0 80 197;--color-accent-800-rgb-value: 0 64 157;--color-accent-900-rgb-value: 0 54 133;--color-error-25-rgb-value: 255 248 249;--color-error-50-rgb-value: 255 241 242;--color-error-100-rgb-value: 255 228 230;--color-error-200-rgb-value: 254 205 211;--color-error-300-rgb-value: 253 164 175;--color-error-400-rgb-value: 251 113 133;--color-error-500-rgb-value: 244 63 94;--color-error-600-rgb-value: 225 29 72;--color-error-700-rgb-value: 190 18 60;--color-error-800-rgb-value: 136 19 39;--color-error-900-rgb-value: 89 13 40;--color-success-25-rgb-value: 245 254 250;--color-success-50-rgb-value: 236 253 245;--color-success-100-rgb-value: 209 250 229;--color-success-200-rgb-value: 167 243 208;--color-success-300-rgb-value: 110 231 183;--color-success-400-rgb-value: 52 211 153;--color-success-500-rgb-value: 16 185 144;--color-success-600-rgb-value: 22 163 138;--color-success-700-rgb-value: 39 121 106;--color-success-800-rgb-value: 23 92 79;--color-success-900-rgb-value: 12 59 50;--color-warning-25-rgb-value: 255 253 243;--color-warning-50-rgb-value: 254 252 232;--color-warning-100-rgb-value: 254 249 195;--color-warning-200-rgb-value: 254 240 138;--color-warning-300-rgb-value: 253 229 99;--color-warning-400-rgb-value: 252 218 59;--color-warning-500-rgb-value: 250 204 21;--color-warning-600-rgb-value: 234 179 8;--color-warning-700-rgb-value: 190 142 48;--color-warning-800-rgb-value: 132 83 28;--color-warning-900-rgb-value: 80 29 10;--color-deep-blue-25-rgb-value: 249 252 255;--color-deep-blue-50-rgb-value: 243 249 254;--color-deep-blue-100-rgb-value: 231 242 251;--color-deep-blue-200-rgb-value: 201 218 241;--color-deep-blue-300-rgb-value: 162 185 216;--color-deep-blue-400-rgb-value: 93 128 182;--color-deep-blue-500-rgb-value: 60 100 161;--color-deep-blue-600-rgb-value: 28 68 129;--color-deep-blue-700-rgb-value: 24 53 97;--color-deep-blue-800-rgb-value: 20 38 65;--color-deep-blue-900-rgb-value: 6 23 49;--color-light-blue-25-rgb-value: 248 251 253;--color-light-blue-50-rgb-value: 240 247 251;--color-light-blue-100-rgb-value: 228 238 244;--color-light-blue-200-rgb-value: 215 229 238;--color-light-blue-300-rgb-value: 190 218 237;--color-light-blue-400-rgb-value: 159 202 232;--color-light-blue-500-rgb-value: 135 180 211;--color-light-blue-600-rgb-value: 104 157 193;--color-light-blue-700-rgb-value: 78 129 164;--color-light-blue-800-rgb-value: 67 109 138;--color-light-blue-900-rgb-value: 55 84 104;--color-gray-50-rgb-value: 249 250 251;--color-gray-100-rgb-value: 243 244 246;--color-gray-200-rgb-value: 229 231 235;--color-gray-300-rgb-value: 209 213 219;--color-gray-400-rgb-value: 156 163 175;--color-gray-500-rgb-value: 107 114 128;--color-gray-550-rgb-value: 102 102 102;--color-gray-600-rgb-value: 75 85 99;--color-gray-700-rgb-value: 55 65 81;--color-gray-800-rgb-value: 31 41 55;--color-blue-gray-50-rgb-value: 74 74 74;--color-blue-gray-100-rgb-value: 60 60 60;--color-blue-gray-200-rgb-value: 50 50 50;--color-blue-gray-300-rgb-value: 45 45 45;--color-blue-gray-400-rgb-value: 34 34 34;--color-blue-gray-500-rgb-value: 31 31 31;--color-blue-gray-600-rgb-value: 28 28 30;--color-blue-gray-700-rgb-value: 27 27 27;--color-blue-gray-800-rgb-value: 24 24 24;--color-blue-gray-900-rgb-value: 15 15 15;--color-black-rgb-value: 0 0 0;--color-white-rgb-value: 255 255 255;--color-primary: var(--color-accent-600-rgb-value);--color-error: var(--color-error-500-rgb-value);--color-success: var(--color-success-500-rgb-value);--color-warning: var(--color-warning-500-rgb-value);--color-deep-blue: var(--color-deep-blue-800-rgb-value);--color-light-blue: var(--color-light-blue-200-rgb-value);accent-color:var(--color-primary);caret-color:red}', wr = {
|
|
2248
2282
|
feedbackLayer: null,
|
|
2249
2283
|
overlayLayer: null,
|
|
2250
2284
|
owner: null
|
|
2251
|
-
},
|
|
2285
|
+
}, O = de()(
|
|
2252
2286
|
// this is important! Otherwise, solid-zustand will start mutating the initial state
|
|
2253
|
-
ue(() => structuredClone(
|
|
2254
|
-
), ce =
|
|
2255
|
-
};
|
|
2256
|
-
function
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2287
|
+
ue(() => structuredClone(wr))
|
|
2288
|
+
), ce = Ae(O), Se = () => {
|
|
2289
|
+
}, yr = (t) => t != null, Sr = (t) => t.filter(yr), Cr = (t) => typeof t == "function" && !t.length ? t() : t, Er = (t) => Array.isArray(t) ? t : t ? [t] : [];
|
|
2290
|
+
function kr(t, e, r, a) {
|
|
2291
|
+
const n = t.length, i = e.length;
|
|
2292
|
+
let o = 0;
|
|
2293
|
+
if (!i) {
|
|
2294
|
+
for (; o < n; o++)
|
|
2295
|
+
r(t[o]);
|
|
2296
|
+
return;
|
|
2297
|
+
}
|
|
2298
|
+
if (!n) {
|
|
2299
|
+
for (; o < i; o++)
|
|
2300
|
+
a(e[o]);
|
|
2301
|
+
return;
|
|
2302
|
+
}
|
|
2303
|
+
for (; o < i && e[o] === t[o]; o++)
|
|
2304
|
+
;
|
|
2305
|
+
let s, l;
|
|
2306
|
+
e = e.slice(o), t = t.slice(o);
|
|
2307
|
+
for (s of e)
|
|
2308
|
+
t.includes(s) || a(s);
|
|
2309
|
+
for (l of t)
|
|
2310
|
+
e.includes(l) || r(l);
|
|
2311
|
+
}
|
|
2312
|
+
function We(t, e) {
|
|
2313
|
+
if (he)
|
|
2314
|
+
return { observe: Se, unobserve: Se };
|
|
2315
|
+
const r = new ResizeObserver(t);
|
|
2316
|
+
return J(r.disconnect.bind(r)), {
|
|
2317
|
+
observe: (a) => r.observe(a, e),
|
|
2318
|
+
unobserve: r.unobserve.bind(r)
|
|
2263
2319
|
};
|
|
2264
2320
|
}
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
dialogContent: yr,
|
|
2273
|
-
large: Cr,
|
|
2274
|
-
compact: Er,
|
|
2275
|
-
dialogTitle: kr,
|
|
2276
|
-
contentOut: Tr,
|
|
2277
|
-
closeButton: _r,
|
|
2278
|
-
closeButtonInner: Mr,
|
|
2279
|
-
primaryActionButton: xr,
|
|
2280
|
-
secondaryActionButton: Rr,
|
|
2281
|
-
actions: Ar,
|
|
2282
|
-
alertTitle: Ir,
|
|
2283
|
-
alertText: $r
|
|
2284
|
-
};
|
|
2285
|
-
var Dr = /* @__PURE__ */ y("<div>"), Fr = /* @__PURE__ */ y("<p>"), Lr = /* @__PURE__ */ y("<span>"), zr = /* @__PURE__ */ y("<div><button></button><button>");
|
|
2286
|
-
const Nr = (r) => {
|
|
2287
|
-
const e = () => {
|
|
2288
|
-
switch (r.modalStyle) {
|
|
2289
|
-
case "compact":
|
|
2290
|
-
return T.compact;
|
|
2291
|
-
case "large":
|
|
2292
|
-
return T.compact;
|
|
2293
|
-
case "default":
|
|
2294
|
-
default:
|
|
2295
|
-
return;
|
|
2321
|
+
function Tr(t, e, r) {
|
|
2322
|
+
if (he)
|
|
2323
|
+
return;
|
|
2324
|
+
const a = /* @__PURE__ */ new WeakMap(), { observe: n, unobserve: i } = We((o) => {
|
|
2325
|
+
for (const s of o) {
|
|
2326
|
+
const { contentRect: l, target: d } = s, u = Math.round(l.width), b = Math.round(l.height), p = a.get(d);
|
|
2327
|
+
(!p || p.width !== u || p.height !== b) && (e(l, d, s), a.set(d, { width: u, height: b }));
|
|
2296
2328
|
}
|
|
2329
|
+
}, r);
|
|
2330
|
+
_e((o) => {
|
|
2331
|
+
const s = Sr(Er(Cr(t)));
|
|
2332
|
+
return kr(s, o, n, i), s;
|
|
2333
|
+
}, []);
|
|
2334
|
+
}
|
|
2335
|
+
var xr = /* @__PURE__ */ w('<svg xmlns=http://www.w3.org/2000/svg fill=none viewBox="0 0 14 14"><path fill=#000 fill-rule=evenodd d="M13.707 1.707A1 1 0 0 0 12.293.293L7 5.586 1.707.293A1 1 0 0 0 .293 1.707L5.586 7 .293 12.293a1 1 0 1 0 1.414 1.414L7 8.414l5.293 5.293a1 1 0 0 0 1.414-1.414L8.414 7z"clip-rule=evenodd>');
|
|
2336
|
+
const Mr = (t = {}) => (() => {
|
|
2337
|
+
var e = xr();
|
|
2338
|
+
return A(e, t, !0, !0), e;
|
|
2339
|
+
})(), ae = Symbol("fallback");
|
|
2340
|
+
function Ce(t) {
|
|
2341
|
+
for (const e of t)
|
|
2342
|
+
e.dispose();
|
|
2343
|
+
}
|
|
2344
|
+
function Rr(t, e, r, a = {}) {
|
|
2345
|
+
if (he) {
|
|
2346
|
+
const o = t();
|
|
2347
|
+
let s = [];
|
|
2348
|
+
if (o && o.length)
|
|
2349
|
+
for (let l = 0, d = o.length; l < d; l++)
|
|
2350
|
+
s.push(r(() => o[l], () => l));
|
|
2351
|
+
else a.fallback && (s = [a.fallback()]);
|
|
2352
|
+
return () => s;
|
|
2353
|
+
}
|
|
2354
|
+
const n = /* @__PURE__ */ new Map();
|
|
2355
|
+
return J(() => Ce(n.values())), () => {
|
|
2356
|
+
const o = t() || [];
|
|
2357
|
+
return o[tt], rt(() => {
|
|
2358
|
+
if (!o.length)
|
|
2359
|
+
return Ce(n.values()), n.clear(), a.fallback ? [oe((b) => (n.set(ae, { dispose: b }), a.fallback()))] : [];
|
|
2360
|
+
const s = new Array(o.length), l = n.get(ae);
|
|
2361
|
+
if (!n.size || l) {
|
|
2362
|
+
l?.dispose(), n.delete(ae);
|
|
2363
|
+
for (let u = 0; u < o.length; u++) {
|
|
2364
|
+
const b = o[u], p = e(b, u);
|
|
2365
|
+
i(s, b, u, p);
|
|
2366
|
+
}
|
|
2367
|
+
return s;
|
|
2368
|
+
}
|
|
2369
|
+
const d = new Set(n.keys());
|
|
2370
|
+
for (let u = 0; u < o.length; u++) {
|
|
2371
|
+
const b = o[u], p = e(b, u);
|
|
2372
|
+
d.delete(p);
|
|
2373
|
+
const h = n.get(p);
|
|
2374
|
+
h ? (s[u] = h.mapped, h.setIndex?.(u), h.setItem(() => b)) : i(s, b, u, p);
|
|
2375
|
+
}
|
|
2376
|
+
for (const u of d)
|
|
2377
|
+
n.get(u)?.dispose(), n.delete(u);
|
|
2378
|
+
return s;
|
|
2379
|
+
});
|
|
2297
2380
|
};
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
get class() {
|
|
2367
|
-
return T.dialogTitle;
|
|
2381
|
+
function i(o, s, l, d) {
|
|
2382
|
+
oe((u) => {
|
|
2383
|
+
const [b, p] = I(s), h = { setItem: p, dispose: u };
|
|
2384
|
+
if (r.length > 1) {
|
|
2385
|
+
const [m, g] = I(l);
|
|
2386
|
+
h.setIndex = g, h.mapped = r(b, m);
|
|
2387
|
+
} else
|
|
2388
|
+
h.mapped = r(b);
|
|
2389
|
+
n.set(d, h), o[l] = h.mapped;
|
|
2390
|
+
});
|
|
2391
|
+
}
|
|
2392
|
+
}
|
|
2393
|
+
function _r(t) {
|
|
2394
|
+
const { by: e } = t;
|
|
2395
|
+
return et(Rr(() => t.each, typeof e == "function" ? e : (r) => r[e], t.children, "fallback" in t ? { fallback: () => t.fallback } : void 0));
|
|
2396
|
+
}
|
|
2397
|
+
var Ar = /* @__PURE__ */ w('<div class="grid min-h-0">'), Dr = /* @__PURE__ */ w('<div class="flex justify-center gap-2 w-full shrink-0">');
|
|
2398
|
+
const Ir = (t) => {
|
|
2399
|
+
const [e, r] = Y(t, ["initialFocusEl", "role"]), [a, n] = I();
|
|
2400
|
+
Tr(a, (o, s) => {
|
|
2401
|
+
const l = Math.min(s.clientWidth, s.clientHeight), d = Math.min(1, Math.max(0, (l - 300) / 240));
|
|
2402
|
+
s.style.setProperty("--modal-t", d.toFixed(4));
|
|
2403
|
+
});
|
|
2404
|
+
const i = () => {
|
|
2405
|
+
const o = [];
|
|
2406
|
+
return t.actions?.secondary && o.push({
|
|
2407
|
+
type: "secondary",
|
|
2408
|
+
action: t.actions.secondary
|
|
2409
|
+
}), t.actions?.primary && o.push({
|
|
2410
|
+
type: "primary",
|
|
2411
|
+
action: t.actions.primary
|
|
2412
|
+
}), o;
|
|
2413
|
+
};
|
|
2414
|
+
return c(ee, {
|
|
2415
|
+
children: (o) => {
|
|
2416
|
+
const s = t.initialFocusEl ? {
|
|
2417
|
+
initialFocusEl: () => t.initialFocusEl(o)
|
|
2418
|
+
} : {};
|
|
2419
|
+
return c(D.Root, H({
|
|
2420
|
+
onFocusOutside: (l) => l.preventDefault(),
|
|
2421
|
+
onInteractOutside: (l) => l.preventDefault()
|
|
2422
|
+
}, s, r, {
|
|
2423
|
+
get children() {
|
|
2424
|
+
return c(x, {
|
|
2425
|
+
get when() {
|
|
2426
|
+
return t.open;
|
|
2427
|
+
},
|
|
2428
|
+
get children() {
|
|
2429
|
+
return c(ke, {
|
|
2430
|
+
get mount() {
|
|
2431
|
+
return t.mountTarget;
|
|
2432
|
+
},
|
|
2433
|
+
get children() {
|
|
2434
|
+
return c(D.Positioner, {
|
|
2435
|
+
class: "h-100dvh w-100dvw top-0 left-0 fixed grid place-items-center p-[clamp(1.5rem,6dvmin,3rem)]",
|
|
2436
|
+
get children() {
|
|
2437
|
+
return [c(D.Backdrop, {
|
|
2438
|
+
class: "absolute top-0 left-0 w-full h-full bg-black bg-opacity-50 backdrop-blur-sm"
|
|
2439
|
+
}), c(D.Content, {
|
|
2440
|
+
ref: n,
|
|
2441
|
+
get role() {
|
|
2442
|
+
return e.role;
|
|
2443
|
+
},
|
|
2444
|
+
class: "bg-white color-dark-900 rounded-2 shadow-lg relative flex flex-col min-h-0 [--modal-t:0] text-[calc(0.875rem+0.125rem*var(--modal-t))] max-h-full w-[min(540px,100%)] p-[clamp(1.5rem,6dvmin,3rem)] gap-6 lt-h-sm:gap-4",
|
|
2445
|
+
get children() {
|
|
2446
|
+
return [c(x, {
|
|
2447
|
+
get when() {
|
|
2448
|
+
return t.showCloseButton;
|
|
2368
2449
|
},
|
|
2369
2450
|
get children() {
|
|
2370
|
-
return
|
|
2451
|
+
return c(D.CloseTrigger, {
|
|
2452
|
+
"aria-label": "Close",
|
|
2453
|
+
class: "absolute top-2.5 right-2.5 w-8 h-8 flex items-center justify-center bg-transparent border-none transition-colors transition-duration-100 hover:bg-gray-100 active:bg-gray-200",
|
|
2454
|
+
get onClick() {
|
|
2455
|
+
return t.onCloseClicked;
|
|
2456
|
+
},
|
|
2457
|
+
get children() {
|
|
2458
|
+
return c(Mr, {
|
|
2459
|
+
class: "w-3.5 h-3.5"
|
|
2460
|
+
});
|
|
2461
|
+
}
|
|
2462
|
+
});
|
|
2371
2463
|
}
|
|
2372
|
-
})
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2464
|
+
}), (() => {
|
|
2465
|
+
var l = Ar();
|
|
2466
|
+
return y(l, () => t.children), Te((d) => {
|
|
2467
|
+
var u = t.scrollable !== !1, b = t.scrollable === !1;
|
|
2468
|
+
return u !== d.e && l.classList.toggle("overflow-y-auto", d.e = u), b !== d.t && l.classList.toggle("overflow-hidden", d.t = b), d;
|
|
2469
|
+
}, {
|
|
2470
|
+
e: void 0,
|
|
2471
|
+
t: void 0
|
|
2472
|
+
}), l;
|
|
2473
|
+
})(), c(x, {
|
|
2474
|
+
get when() {
|
|
2475
|
+
return t.actions;
|
|
2476
|
+
},
|
|
2477
|
+
get children() {
|
|
2478
|
+
var l = Dr();
|
|
2479
|
+
return y(l, c(_r, {
|
|
2480
|
+
get each() {
|
|
2481
|
+
return i();
|
|
2482
|
+
},
|
|
2483
|
+
by: "type",
|
|
2484
|
+
children: (d) => {
|
|
2485
|
+
const u = () => {
|
|
2486
|
+
const {
|
|
2487
|
+
label: p,
|
|
2488
|
+
...h
|
|
2489
|
+
} = d().action;
|
|
2490
|
+
return h;
|
|
2491
|
+
}, b = d().type === "primary" ? "btn-primary" : "btn-secondary";
|
|
2492
|
+
return c(D.CloseTrigger, H({
|
|
2493
|
+
class: `btn ${b} max-w-[30ch] flex-1 min-w-0`
|
|
2494
|
+
}, u, {
|
|
2495
|
+
get children() {
|
|
2496
|
+
return d().action.label;
|
|
2497
|
+
}
|
|
2498
|
+
}));
|
|
2499
|
+
}
|
|
2500
|
+
})), l;
|
|
2501
|
+
}
|
|
2502
|
+
})];
|
|
2503
|
+
}
|
|
2504
|
+
})];
|
|
2505
|
+
}
|
|
2506
|
+
});
|
|
2507
|
+
}
|
|
2508
|
+
});
|
|
2509
|
+
}
|
|
2510
|
+
});
|
|
2511
|
+
}
|
|
2512
|
+
}));
|
|
2513
|
+
}
|
|
2399
2514
|
});
|
|
2400
|
-
},
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
onPrimaryClick: n,
|
|
2406
|
-
onSecondaryClick: o,
|
|
2407
|
-
primaryButtonText: i = "Retry",
|
|
2408
|
-
secondaryButtonText: s = "Cancel"
|
|
2409
|
-
}) => c(Nr, {
|
|
2410
|
-
mountTarget: r,
|
|
2411
|
-
get header() {
|
|
2412
|
-
return (() => {
|
|
2413
|
-
var l = Lr();
|
|
2414
|
-
return w(l, e), K(() => H(l, T.alertTitle)), l;
|
|
2415
|
-
})();
|
|
2416
|
-
},
|
|
2417
|
-
open: a,
|
|
2418
|
-
get actions() {
|
|
2419
|
-
return (() => {
|
|
2420
|
-
var l = zr(), f = l.firstChild, g = f.nextSibling;
|
|
2421
|
-
return f.$$click = () => o(), w(f, s), g.$$click = () => n(), w(g, i), K((p) => {
|
|
2422
|
-
var S = T.actions, m = T.secondaryActionButton, d = T.primaryActionButton;
|
|
2423
|
-
return S !== p.e && H(l, p.e = S), m !== p.t && H(f, p.t = m), d !== p.a && H(g, p.a = d), p;
|
|
2424
|
-
}, {
|
|
2425
|
-
e: void 0,
|
|
2426
|
-
t: void 0,
|
|
2427
|
-
a: void 0
|
|
2428
|
-
}), l;
|
|
2429
|
-
})();
|
|
2430
|
-
},
|
|
2431
|
-
modalStyle: "compact",
|
|
2432
|
-
get children() {
|
|
2433
|
-
var l = Fr();
|
|
2434
|
-
return w(l, t), K(() => H(l, T.alertText)), l;
|
|
2435
|
-
}
|
|
2436
|
-
});
|
|
2437
|
-
We(["click"]);
|
|
2438
|
-
const Or = () => {
|
|
2515
|
+
}, Fr = (t) => c(Ir, H({
|
|
2516
|
+
role: "alertdialog"
|
|
2517
|
+
}, t));
|
|
2518
|
+
var Lr = /* @__PURE__ */ w("<p>");
|
|
2519
|
+
const Nr = () => {
|
|
2439
2520
|
const {
|
|
2440
|
-
t
|
|
2441
|
-
} =
|
|
2521
|
+
t
|
|
2522
|
+
} = Z(), {
|
|
2442
2523
|
cameraManagerSolidStore: e,
|
|
2443
|
-
cameraManager:
|
|
2524
|
+
cameraManager: r,
|
|
2444
2525
|
dismountCameraUi: a
|
|
2445
|
-
} =
|
|
2446
|
-
const
|
|
2447
|
-
return
|
|
2448
|
-
}, s = () =>
|
|
2449
|
-
return c(
|
|
2450
|
-
get
|
|
2526
|
+
} = q(), n = e((d) => d.errorState), i = ce((d) => d.overlayLayer), o = () => {
|
|
2527
|
+
const d = n();
|
|
2528
|
+
return d instanceof B && d.code === "PERMISSION_DENIED";
|
|
2529
|
+
}, s = () => o() ? t.camera_error_title : n() ? n().name : "", l = () => o() ? t.camera_error_details : n() ? n().name : "";
|
|
2530
|
+
return c(Fr, {
|
|
2531
|
+
get mountTarget() {
|
|
2451
2532
|
return i();
|
|
2452
2533
|
},
|
|
2453
|
-
get
|
|
2454
|
-
return
|
|
2455
|
-
|
|
2456
|
-
|
|
2534
|
+
get open() {
|
|
2535
|
+
return o();
|
|
2536
|
+
},
|
|
2537
|
+
get actions() {
|
|
2538
|
+
return {
|
|
2539
|
+
primary: {
|
|
2540
|
+
label: t.camera_error_primary_btn,
|
|
2541
|
+
onclick: () => void r.startCameraStream()
|
|
2457
2542
|
},
|
|
2458
|
-
|
|
2543
|
+
secondary: {
|
|
2544
|
+
label: t.camera_error_cancel_btn,
|
|
2545
|
+
onclick: () => a()
|
|
2546
|
+
}
|
|
2547
|
+
};
|
|
2548
|
+
},
|
|
2549
|
+
get children() {
|
|
2550
|
+
return [c(be.Title, {
|
|
2551
|
+
class: "dialog-title",
|
|
2552
|
+
get children() {
|
|
2459
2553
|
return s();
|
|
2460
|
-
},
|
|
2461
|
-
get text() {
|
|
2462
|
-
return l();
|
|
2463
|
-
},
|
|
2464
|
-
open: !0,
|
|
2465
|
-
onPrimaryClick: () => void t.startCameraStream(),
|
|
2466
|
-
onSecondaryClick: () => a(),
|
|
2467
|
-
get primaryButtonText() {
|
|
2468
|
-
return r.camera_error_primary_btn;
|
|
2469
|
-
},
|
|
2470
|
-
get secondaryButtonText() {
|
|
2471
|
-
return r.camera_error_cancel_btn;
|
|
2472
2554
|
}
|
|
2473
|
-
})
|
|
2555
|
+
}), c(be.Description, {
|
|
2556
|
+
class: "dialog-description",
|
|
2557
|
+
get children() {
|
|
2558
|
+
var d = Lr();
|
|
2559
|
+
return y(d, l), d;
|
|
2560
|
+
}
|
|
2561
|
+
})];
|
|
2474
2562
|
}
|
|
2475
2563
|
});
|
|
2476
|
-
};
|
|
2477
|
-
function
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2564
|
+
}, zr = { trailing: !0 };
|
|
2565
|
+
function Pr(t, e = 25, r = {}) {
|
|
2566
|
+
if (r = {
|
|
2567
|
+
...zr,
|
|
2568
|
+
...r
|
|
2569
|
+
}, !Number.isFinite(e)) throw new TypeError("Expected `wait` to be a finite number");
|
|
2570
|
+
let a, n, i = [], o, s;
|
|
2571
|
+
const l = (b, p) => (o = $r(t, b, p), o.finally(() => {
|
|
2572
|
+
if (o = null, r.trailing && s && !n) {
|
|
2573
|
+
const h = l(b, s);
|
|
2574
|
+
return s = null, h;
|
|
2575
|
+
}
|
|
2576
|
+
}), o), d = function(...b) {
|
|
2577
|
+
return r.trailing && (s = b), o || new Promise((p) => {
|
|
2578
|
+
const h = !n && r.leading;
|
|
2579
|
+
clearTimeout(n), n = setTimeout(() => {
|
|
2580
|
+
n = null;
|
|
2581
|
+
const m = r.leading ? a : l(this, b);
|
|
2582
|
+
s = null;
|
|
2583
|
+
for (const g of i) g(m);
|
|
2584
|
+
i = [];
|
|
2585
|
+
}, e), h ? (a = l(this, b), p(a)) : i.push(p);
|
|
2586
|
+
});
|
|
2587
|
+
}, u = (b) => {
|
|
2588
|
+
b && (clearTimeout(b), n = null);
|
|
2484
2589
|
};
|
|
2590
|
+
return d.isPending = () => !!n, d.cancel = () => {
|
|
2591
|
+
u(n), i = [], s = null;
|
|
2592
|
+
}, d.flush = () => {
|
|
2593
|
+
if (u(n), !s || o) return;
|
|
2594
|
+
const b = s;
|
|
2595
|
+
return s = null, l(this, b);
|
|
2596
|
+
}, d;
|
|
2485
2597
|
}
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2598
|
+
async function $r(t, e, r) {
|
|
2599
|
+
return await t.apply(e, r);
|
|
2600
|
+
}
|
|
2601
|
+
const Or = (t, e, r, a) => {
|
|
2602
|
+
const n = Math.max(t / r, e / a);
|
|
2603
|
+
let i = 0;
|
|
2604
|
+
if (t / r > e / a) {
|
|
2605
|
+
const o = n * a;
|
|
2606
|
+
i = 1 - e / o;
|
|
2492
2607
|
} else {
|
|
2493
|
-
const
|
|
2494
|
-
|
|
2608
|
+
const o = n * r;
|
|
2609
|
+
i = 1 - t / o;
|
|
2495
2610
|
}
|
|
2496
|
-
return
|
|
2611
|
+
return i < 0.1 ? "cover" : "contain";
|
|
2497
2612
|
};
|
|
2498
|
-
function
|
|
2499
|
-
const n =
|
|
2500
|
-
if (n >=
|
|
2501
|
-
const s = Math.round(e /
|
|
2502
|
-
return { x: 0, y: Math.round((a - s) / 2), width:
|
|
2613
|
+
function Vr(t, e, r, a) {
|
|
2614
|
+
const n = t / r, i = e / a, o = Math.max(n, i);
|
|
2615
|
+
if (n >= i) {
|
|
2616
|
+
const s = Math.round(e / o);
|
|
2617
|
+
return { x: 0, y: Math.round((a - s) / 2), width: r, height: s };
|
|
2503
2618
|
} else {
|
|
2504
|
-
const s = Math.round(
|
|
2505
|
-
return { x: Math.round((
|
|
2619
|
+
const s = Math.round(t / o);
|
|
2620
|
+
return { x: Math.round((r - s) / 2), y: 0, width: s, height: a };
|
|
2506
2621
|
}
|
|
2507
2622
|
}
|
|
2508
|
-
var
|
|
2509
|
-
const
|
|
2623
|
+
var ne = /* @__PURE__ */ w("<style>"), Br = /* @__PURE__ */ w("<style id=camera-manager-style>"), Ur = /* @__PURE__ */ w('<div class="bg-dark-500 color-white size-full relative min-h-[300px]"part=capture-screen-part><video part=video-element-part class="block absolute top-0 left-0 size-full"aria-hidden=true tabindex=-1></video><div class="absolute top-0 left-0 w-full h-full z-1"id=feedback-layer></div><div class="absolute top-0 left-0 w-full h-full has-[[data-scope]]:z-2"id=overlay-layer>');
|
|
2624
|
+
const Ge = "capture-screen-host", Xe = () => {
|
|
2510
2625
|
const {
|
|
2511
|
-
cameraManager:
|
|
2626
|
+
cameraManager: t,
|
|
2512
2627
|
mountTarget: e,
|
|
2513
|
-
showCameraErrorModal:
|
|
2514
|
-
} =
|
|
2515
|
-
function
|
|
2516
|
-
const
|
|
2517
|
-
if (!
|
|
2628
|
+
showCameraErrorModal: r
|
|
2629
|
+
} = q(), [a, n] = I(), [i, o] = I(), [s, l] = I(), d = () => e.parentNode === document.body, [u, b] = I("contain");
|
|
2630
|
+
function p() {
|
|
2631
|
+
const h = a();
|
|
2632
|
+
if (!h)
|
|
2518
2633
|
return;
|
|
2519
|
-
const
|
|
2520
|
-
if (
|
|
2634
|
+
const m = h.clientWidth, g = h.clientHeight, S = h.videoWidth, T = h.videoHeight;
|
|
2635
|
+
if (S === 0 || T === 0)
|
|
2521
2636
|
return;
|
|
2522
|
-
const
|
|
2523
|
-
if (
|
|
2524
|
-
const
|
|
2525
|
-
|
|
2637
|
+
const v = Or(m, g, S, T);
|
|
2638
|
+
if (b(v), v === "cover") {
|
|
2639
|
+
const C = Vr(m, g, S, T);
|
|
2640
|
+
t.setExtractionArea(C);
|
|
2526
2641
|
} else
|
|
2527
|
-
|
|
2642
|
+
t.setExtractionArea({
|
|
2528
2643
|
x: 0,
|
|
2529
2644
|
y: 0,
|
|
2530
|
-
width:
|
|
2531
|
-
height:
|
|
2645
|
+
width: S,
|
|
2646
|
+
height: T
|
|
2532
2647
|
});
|
|
2533
2648
|
}
|
|
2534
|
-
return
|
|
2535
|
-
const
|
|
2536
|
-
if (!
|
|
2649
|
+
return K(() => {
|
|
2650
|
+
const h = a();
|
|
2651
|
+
if (!h)
|
|
2537
2652
|
return;
|
|
2538
|
-
const
|
|
2539
|
-
observe:
|
|
2540
|
-
unobserve:
|
|
2541
|
-
} =
|
|
2542
|
-
h
|
|
2543
|
-
|
|
2653
|
+
const m = Pr(p, 100), {
|
|
2654
|
+
observe: g,
|
|
2655
|
+
unobserve: S
|
|
2656
|
+
} = We(() => void m());
|
|
2657
|
+
g(h), h.addEventListener("resize", p), h.addEventListener("loadedmetadata", p), J(() => {
|
|
2658
|
+
m.cancel(), S(h), h.removeEventListener("resize", p), h.removeEventListener("loadedmetadata", p);
|
|
2544
2659
|
});
|
|
2545
|
-
}),
|
|
2546
|
-
const
|
|
2547
|
-
|
|
2548
|
-
owner:
|
|
2660
|
+
}), K(() => {
|
|
2661
|
+
const h = Re();
|
|
2662
|
+
h && ce.setState({
|
|
2663
|
+
owner: h
|
|
2549
2664
|
});
|
|
2550
|
-
}),
|
|
2551
|
-
const
|
|
2552
|
-
!
|
|
2553
|
-
feedbackLayer:
|
|
2554
|
-
overlayLayer:
|
|
2555
|
-
}),
|
|
2556
|
-
}), c(
|
|
2665
|
+
}), _e(() => {
|
|
2666
|
+
const h = a(), m = i(), g = s();
|
|
2667
|
+
!h || !m || !g || (ce.setState({
|
|
2668
|
+
feedbackLayer: m,
|
|
2669
|
+
overlayLayer: g
|
|
2670
|
+
}), t.initVideoElement(h));
|
|
2671
|
+
}), c(gr, {
|
|
2557
2672
|
get id() {
|
|
2558
|
-
return
|
|
2673
|
+
return d() ? void 0 : Ge;
|
|
2559
2674
|
},
|
|
2560
2675
|
get disableShadowRoot() {
|
|
2561
|
-
return
|
|
2676
|
+
return d();
|
|
2562
2677
|
},
|
|
2563
2678
|
get style() {
|
|
2564
|
-
return
|
|
2679
|
+
return d() ? {
|
|
2565
2680
|
height: "100%"
|
|
2566
2681
|
} : void 0;
|
|
2567
2682
|
},
|
|
2568
2683
|
get children() {
|
|
2569
2684
|
return [(() => {
|
|
2570
|
-
var
|
|
2571
|
-
return
|
|
2685
|
+
var h = ne();
|
|
2686
|
+
return y(h, vr), h;
|
|
2572
2687
|
})(), (() => {
|
|
2573
|
-
var
|
|
2574
|
-
return
|
|
2688
|
+
var h = ne();
|
|
2689
|
+
return y(h, br), h;
|
|
2575
2690
|
})(), (() => {
|
|
2576
|
-
var
|
|
2577
|
-
return
|
|
2691
|
+
var h = ne();
|
|
2692
|
+
return y(h, pr), h;
|
|
2578
2693
|
})(), (() => {
|
|
2579
|
-
var
|
|
2580
|
-
return V((
|
|
2581
|
-
window.__mbCameraManagerCssCode && (
|
|
2582
|
-
},
|
|
2694
|
+
var h = Br();
|
|
2695
|
+
return V((m) => {
|
|
2696
|
+
window.__mbCameraManagerCssCode && (m.innerHTML = window.__mbCameraManagerCssCode);
|
|
2697
|
+
}, h), h;
|
|
2583
2698
|
})(), (() => {
|
|
2584
|
-
var
|
|
2585
|
-
return
|
|
2586
|
-
when:
|
|
2699
|
+
var h = Ur(), m = h.firstChild, g = m.nextSibling, S = g.nextSibling;
|
|
2700
|
+
return y(h, c(hr, {}), m), V(n, m), V(o, g), V(l, S), y(h, c(x, {
|
|
2701
|
+
when: r,
|
|
2587
2702
|
get children() {
|
|
2588
|
-
return c(
|
|
2703
|
+
return c(Nr, {});
|
|
2589
2704
|
}
|
|
2590
|
-
}), null),
|
|
2705
|
+
}), null), Te((T) => (T = u()) != null ? m.style.setProperty("object-fit", T) : m.style.removeProperty("object-fit")), h;
|
|
2591
2706
|
})()];
|
|
2592
2707
|
}
|
|
2593
2708
|
});
|
|
2594
|
-
},
|
|
2709
|
+
}, qr = () => {
|
|
2595
2710
|
const {
|
|
2596
|
-
t
|
|
2597
|
-
} =
|
|
2598
|
-
addOnDismountCallback: a
|
|
2599
|
-
|
|
2711
|
+
t
|
|
2712
|
+
} = Z(), [e, r] = I(!0), {
|
|
2713
|
+
addOnDismountCallback: a,
|
|
2714
|
+
zIndex: n
|
|
2715
|
+
} = q();
|
|
2600
2716
|
return a(() => {
|
|
2601
|
-
|
|
2602
|
-
}), c(
|
|
2717
|
+
r(!1);
|
|
2718
|
+
}), c(ke, {
|
|
2603
2719
|
useShadow: !0,
|
|
2604
2720
|
get mount() {
|
|
2605
|
-
return document.getElementById(
|
|
2721
|
+
return document.getElementById(Qe);
|
|
2606
2722
|
},
|
|
2607
|
-
ref: (
|
|
2723
|
+
ref: (i) => (i.id = Ge, i.style.zIndex = n !== void 0 ? String(n) : "calc(infinity)", i.style.position = "fixed", i.id = "mb-camera-host", i),
|
|
2608
2724
|
get children() {
|
|
2609
|
-
return c(
|
|
2610
|
-
children: (
|
|
2725
|
+
return c(ee, {
|
|
2726
|
+
children: () => c(D.Root, {
|
|
2611
2727
|
get open() {
|
|
2612
2728
|
return e();
|
|
2613
2729
|
},
|
|
2614
|
-
lazyMount: !0,
|
|
2615
|
-
unmountOnExit: !0,
|
|
2616
|
-
initialFocusEl: () => n.querySelector('[role="dialog"]'),
|
|
2617
2730
|
get children() {
|
|
2618
|
-
return c(
|
|
2731
|
+
return c(D.Positioner, {
|
|
2619
2732
|
get children() {
|
|
2620
|
-
return c(
|
|
2621
|
-
"
|
|
2622
|
-
class: `h-vh supports-[(height:100dvh)]:h-dvh top-0 left-0 w-full
|
|
2623
|
-
fixed`,
|
|
2733
|
+
return c(D.Content, {
|
|
2734
|
+
class: "h-vh supports-[(height:100dvh)]:h-dvh top-0 left-0 w-full fixed",
|
|
2624
2735
|
get children() {
|
|
2625
|
-
return [c(
|
|
2736
|
+
return [c(D.Title, {
|
|
2626
2737
|
class: "sr-only",
|
|
2627
|
-
id: "dialog-title",
|
|
2628
2738
|
get children() {
|
|
2629
|
-
return
|
|
2739
|
+
return t.dialog_title;
|
|
2630
2740
|
}
|
|
2631
|
-
}), c(
|
|
2741
|
+
}), c(Xe, {})];
|
|
2632
2742
|
}
|
|
2633
2743
|
});
|
|
2634
2744
|
}
|
|
@@ -2638,71 +2748,73 @@ const Ve = "capture-screen-host", Ue = () => {
|
|
|
2638
2748
|
});
|
|
2639
2749
|
}
|
|
2640
2750
|
});
|
|
2641
|
-
},
|
|
2751
|
+
}, jr = () => {
|
|
2642
2752
|
const {
|
|
2643
|
-
mountTarget:
|
|
2644
|
-
} =
|
|
2645
|
-
return c(
|
|
2753
|
+
mountTarget: t
|
|
2754
|
+
} = q();
|
|
2755
|
+
return c(Ye, {
|
|
2646
2756
|
get component() {
|
|
2647
|
-
return
|
|
2757
|
+
return t.parentNode === document.body ? qr : Xe;
|
|
2648
2758
|
}
|
|
2649
2759
|
});
|
|
2650
|
-
},
|
|
2651
|
-
function
|
|
2652
|
-
localizationStrings:
|
|
2760
|
+
}, Qe = "camera-manager-mount-point";
|
|
2761
|
+
function na(t, e, {
|
|
2762
|
+
localizationStrings: r,
|
|
2653
2763
|
showMirrorCameraButton: a = !1,
|
|
2654
2764
|
showTorchButton: n = !0,
|
|
2655
|
-
showCloseButton:
|
|
2656
|
-
showCameraErrorModal:
|
|
2765
|
+
showCloseButton: i = !0,
|
|
2766
|
+
showCameraErrorModal: o = !0,
|
|
2767
|
+
zIndex: s
|
|
2657
2768
|
} = {}) {
|
|
2658
|
-
let
|
|
2659
|
-
const
|
|
2660
|
-
let
|
|
2661
|
-
const
|
|
2662
|
-
|
|
2769
|
+
let l;
|
|
2770
|
+
const d = /* @__PURE__ */ new Set();
|
|
2771
|
+
let u;
|
|
2772
|
+
const b = (v) => {
|
|
2773
|
+
u = v;
|
|
2663
2774
|
}, p = () => {
|
|
2664
|
-
|
|
2775
|
+
t.reset();
|
|
2665
2776
|
};
|
|
2666
|
-
let
|
|
2777
|
+
let h;
|
|
2667
2778
|
const m = () => {
|
|
2668
2779
|
try {
|
|
2669
2780
|
console.debug("🧱 Dismounting camera manager UI");
|
|
2670
|
-
for (const v of
|
|
2781
|
+
for (const v of d)
|
|
2671
2782
|
v();
|
|
2672
|
-
|
|
2783
|
+
d.clear(), p(), requestAnimationFrame(() => {
|
|
2673
2784
|
requestAnimationFrame(() => {
|
|
2674
|
-
|
|
2785
|
+
h && h(), l.remove(), p();
|
|
2675
2786
|
});
|
|
2676
2787
|
});
|
|
2677
2788
|
} catch (v) {
|
|
2678
2789
|
console.warn("Error while dismounting camera manager UI", v);
|
|
2679
2790
|
}
|
|
2680
|
-
},
|
|
2681
|
-
|
|
2682
|
-
const
|
|
2683
|
-
|
|
2791
|
+
}, g = document.createElement("div");
|
|
2792
|
+
g.id = Qe, l = g, e ? e.appendChild(g) : document.body.appendChild(g);
|
|
2793
|
+
const S = (v) => (d.add(v), () => {
|
|
2794
|
+
d.delete(v);
|
|
2684
2795
|
});
|
|
2685
|
-
|
|
2686
|
-
userStrings:
|
|
2687
|
-
setLocalizationRef:
|
|
2796
|
+
h = Je(() => c(Ht, {
|
|
2797
|
+
userStrings: r,
|
|
2798
|
+
setLocalizationRef: b,
|
|
2688
2799
|
get children() {
|
|
2689
|
-
return c(
|
|
2690
|
-
addOnDismountCallback:
|
|
2800
|
+
return c(qt, {
|
|
2801
|
+
addOnDismountCallback: S,
|
|
2691
2802
|
dismountCameraUi: m,
|
|
2692
|
-
cameraManager:
|
|
2803
|
+
cameraManager: t,
|
|
2693
2804
|
showMirrorCameraButton: a,
|
|
2694
2805
|
showTorchButton: n,
|
|
2695
|
-
showCloseButton:
|
|
2696
|
-
showCameraErrorModal:
|
|
2697
|
-
|
|
2806
|
+
showCloseButton: i,
|
|
2807
|
+
showCameraErrorModal: o,
|
|
2808
|
+
zIndex: s,
|
|
2809
|
+
mountTarget: l,
|
|
2698
2810
|
get children() {
|
|
2699
|
-
return c(
|
|
2811
|
+
return c(jr, {});
|
|
2700
2812
|
}
|
|
2701
2813
|
});
|
|
2702
2814
|
}
|
|
2703
|
-
}),
|
|
2704
|
-
const
|
|
2705
|
-
updateLocalization:
|
|
2815
|
+
}), l);
|
|
2816
|
+
const T = {
|
|
2817
|
+
updateLocalization: u,
|
|
2706
2818
|
/**
|
|
2707
2819
|
* Adds a callback to be called when the component is unmounted.
|
|
2708
2820
|
* Returns a cleanup function that removes the callback when called.
|
|
@@ -2710,65 +2822,65 @@ function oa(r, e, {
|
|
|
2710
2822
|
* @param fn - The callback function to be called when the component is unmounted
|
|
2711
2823
|
* @returns A cleanup function that removes the callback when called
|
|
2712
2824
|
*/
|
|
2713
|
-
addOnDismountCallback:
|
|
2714
|
-
cameraManager:
|
|
2825
|
+
addOnDismountCallback: S,
|
|
2826
|
+
cameraManager: t,
|
|
2715
2827
|
// we know these are defined because `createCameraManagerUi` resolves when they are defined
|
|
2716
2828
|
// TODO: maybe don't use getters but make sure they are defined
|
|
2717
2829
|
get feedbackLayerNode() {
|
|
2718
|
-
return
|
|
2830
|
+
return O.getState().feedbackLayer;
|
|
2719
2831
|
},
|
|
2720
2832
|
get overlayLayerNode() {
|
|
2721
|
-
return
|
|
2833
|
+
return O.getState().overlayLayer;
|
|
2722
2834
|
},
|
|
2723
2835
|
get owner() {
|
|
2724
|
-
return
|
|
2836
|
+
return O.getState().owner;
|
|
2725
2837
|
},
|
|
2726
2838
|
dismount: m
|
|
2727
2839
|
};
|
|
2728
2840
|
return new Promise((v) => {
|
|
2729
|
-
let
|
|
2841
|
+
let C = !1, M = !1, L = !1, W = () => {
|
|
2730
2842
|
}, G = () => {
|
|
2731
|
-
},
|
|
2843
|
+
}, me = () => {
|
|
2732
2844
|
};
|
|
2733
|
-
const
|
|
2734
|
-
|
|
2845
|
+
const te = () => {
|
|
2846
|
+
C && M && L && (W(), G(), me(), v(T));
|
|
2735
2847
|
};
|
|
2736
|
-
|
|
2737
|
-
R && (
|
|
2848
|
+
W = O.subscribe((R) => R.feedbackLayer, (R) => {
|
|
2849
|
+
R && (M = !0), te();
|
|
2738
2850
|
}, {
|
|
2739
2851
|
fireImmediately: !0
|
|
2740
|
-
}), G =
|
|
2741
|
-
R && (
|
|
2852
|
+
}), G = O.subscribe((R) => R.overlayLayer, (R) => {
|
|
2853
|
+
R && (L = !0), te();
|
|
2742
2854
|
}, {
|
|
2743
2855
|
fireImmediately: !0
|
|
2744
|
-
}),
|
|
2745
|
-
R && (
|
|
2856
|
+
}), me = t.subscribe((R) => R.videoElement, (R) => {
|
|
2857
|
+
R && (C = !0, te());
|
|
2746
2858
|
}, {
|
|
2747
2859
|
fireImmediately: !0
|
|
2748
2860
|
});
|
|
2749
2861
|
});
|
|
2750
2862
|
}
|
|
2751
|
-
const
|
|
2752
|
-
globalThis.__CAMERA_MANAGER__ ||=
|
|
2753
|
-
globalThis.__CAMERA_MANAGER__ !==
|
|
2863
|
+
const Ke = Symbol();
|
|
2864
|
+
globalThis.__CAMERA_MANAGER__ ||= Ke;
|
|
2865
|
+
globalThis.__CAMERA_MANAGER__ !== Ke && console.warn(
|
|
2754
2866
|
"Detected multiple instances of @microblink/camera-manager. This can lead to unexpected behavior."
|
|
2755
2867
|
);
|
|
2756
2868
|
export {
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2869
|
+
$e as Camera,
|
|
2870
|
+
B as CameraError,
|
|
2871
|
+
aa as CameraManager,
|
|
2872
|
+
Qe as MOUNT_POINT_ID,
|
|
2873
|
+
Vt as VideoFrameProcessor,
|
|
2874
|
+
f as cameraManagerStore,
|
|
2875
|
+
O as cameraUiRefStore,
|
|
2876
|
+
na as createCameraManagerUi,
|
|
2877
|
+
Bt as defaultCameraManagerOptions,
|
|
2878
|
+
Mt as findResolutionKey,
|
|
2879
|
+
Ue as getBuffer,
|
|
2880
|
+
Tt as getNormalizedResolution,
|
|
2769
2881
|
le as isBufferDetached,
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2882
|
+
xt as matchClosestResolution,
|
|
2883
|
+
Rt as resetCameraManagerStore,
|
|
2884
|
+
kt as returnLongerSide,
|
|
2773
2885
|
P as videoResolutions
|
|
2774
2886
|
};
|