@microblink/camera-manager 7.2.7 → 7.3.1
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 +1305 -1174
- 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 +3 -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 +18 -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
|
|
5
|
+
import { createComponent as c, use as V, template as w, spread as A, mergeProps as W, 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
12
|
import { Tooltip as Q } from "@ark-ui/solid/tooltip";
|
|
13
|
-
|
|
14
|
-
|
|
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
|
+
], j = (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
|
+
j(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 H = /* @__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), G = M?.get(C), X = Nt(L, G);
|
|
901
|
+
g(X), 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
|
+
H.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 H.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 = H.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 = H.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 = H.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.#d();
|
|
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
|
+
#d() {
|
|
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.#h(s, l), 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.#h(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
|
+
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;
|
|
1150
1151
|
if (this.#h(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
|
-
#h(e,
|
|
1176
|
-
if (this.#
|
|
1177
|
-
this.#e.width = e, this.#e.height =
|
|
1178
|
-
const a = e *
|
|
1176
|
+
#h(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,28 @@ 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();
|
|
1251
|
+
#d = /* @__PURE__ */ new Set();
|
|
1243
1252
|
/**
|
|
1244
1253
|
* Creates a new CameraManager instance.
|
|
1245
1254
|
*
|
|
1246
1255
|
* @param options - The options for the CameraManager.
|
|
1247
1256
|
* @param videoFrameProcessorOptions - The options for the VideoFrameProcessor.
|
|
1248
1257
|
*/
|
|
1249
|
-
constructor(e = {},
|
|
1258
|
+
constructor(e = {}, r) {
|
|
1250
1259
|
const { mirrorFrontCameras: a, preferredResolution: n } = {
|
|
1251
|
-
...
|
|
1260
|
+
...Bt,
|
|
1252
1261
|
...e
|
|
1253
1262
|
};
|
|
1254
|
-
this.#
|
|
1255
|
-
|
|
1256
|
-
), this.#
|
|
1263
|
+
this.#r = n, this.#n = new Vt(
|
|
1264
|
+
r
|
|
1265
|
+
), this.#t = a;
|
|
1257
1266
|
}
|
|
1258
1267
|
/**
|
|
1259
1268
|
* Sets the desired video resolution for camera streams. This is used as the ideal resolution
|
|
@@ -1264,9 +1273,9 @@ class na {
|
|
|
1264
1273
|
* @param resolution - The ideal resolution to set for camera streams.
|
|
1265
1274
|
*/
|
|
1266
1275
|
setResolution = async (e) => {
|
|
1267
|
-
this.#
|
|
1268
|
-
const
|
|
1269
|
-
|
|
1276
|
+
this.#r = e;
|
|
1277
|
+
const r = this.getState().playbackState;
|
|
1278
|
+
r !== "idle" && (this.#e = r, this.stopStream(), await this.startCameraStream());
|
|
1270
1279
|
};
|
|
1271
1280
|
/**
|
|
1272
1281
|
* The desired video resolution for camera streams. This is used as the ideal resolution
|
|
@@ -1276,7 +1285,7 @@ class na {
|
|
|
1276
1285
|
* camera capabilities and system constraints.
|
|
1277
1286
|
*/
|
|
1278
1287
|
get resolution() {
|
|
1279
|
-
return this.#
|
|
1288
|
+
return this.#r;
|
|
1280
1289
|
}
|
|
1281
1290
|
/**
|
|
1282
1291
|
* True if there is a video playing or capturing
|
|
@@ -1284,7 +1293,7 @@ class na {
|
|
|
1284
1293
|
* @see https://developer.mozilla.org/en-US/docs/Web/API/MediaSession/playbackState for more details.
|
|
1285
1294
|
*/
|
|
1286
1295
|
get isActive() {
|
|
1287
|
-
return
|
|
1296
|
+
return f.getState().playbackState !== "idle";
|
|
1288
1297
|
}
|
|
1289
1298
|
/**
|
|
1290
1299
|
* Sets the facing filter.
|
|
@@ -1292,7 +1301,7 @@ class na {
|
|
|
1292
1301
|
* @param facingFilter - The facing filter.
|
|
1293
1302
|
*/
|
|
1294
1303
|
setFacingFilter(e) {
|
|
1295
|
-
|
|
1304
|
+
f.setState({
|
|
1296
1305
|
facingFilter: e
|
|
1297
1306
|
});
|
|
1298
1307
|
}
|
|
@@ -1303,21 +1312,21 @@ class na {
|
|
|
1303
1312
|
* @returns The cameras that are available to the user, filtered by the facing mode.
|
|
1304
1313
|
*/
|
|
1305
1314
|
async getCameraDevices() {
|
|
1306
|
-
let e =
|
|
1307
|
-
const
|
|
1308
|
-
return e.length || await this.refreshCameraDevices(), e =
|
|
1309
|
-
(n) =>
|
|
1315
|
+
let e = f.getState().cameras;
|
|
1316
|
+
const r = f.getState().facingFilter;
|
|
1317
|
+
return e.length || await this.refreshCameraDevices(), e = f.getState().cameras, r ? e.filter(
|
|
1318
|
+
(n) => r.includes(n.facingMode)
|
|
1310
1319
|
) : e;
|
|
1311
1320
|
}
|
|
1312
1321
|
get selectedCamera() {
|
|
1313
|
-
return
|
|
1322
|
+
return f.getState().selectedCamera;
|
|
1314
1323
|
}
|
|
1315
1324
|
/**
|
|
1316
1325
|
* Single-time setup for a video element.
|
|
1317
1326
|
*
|
|
1318
1327
|
* @param videoElement - The video element to initialize.
|
|
1319
1328
|
*/
|
|
1320
|
-
#
|
|
1329
|
+
#f(e) {
|
|
1321
1330
|
if (!(e instanceof HTMLVideoElement))
|
|
1322
1331
|
throw new Error(
|
|
1323
1332
|
`Expected an HTMLVideoElement, got ${typeof e}`,
|
|
@@ -1325,35 +1334,36 @@ class na {
|
|
|
1325
1334
|
cause: e
|
|
1326
1335
|
}
|
|
1327
1336
|
);
|
|
1328
|
-
|
|
1337
|
+
f.setState({
|
|
1329
1338
|
videoElement: e
|
|
1330
1339
|
});
|
|
1331
|
-
const
|
|
1340
|
+
const r = ye(
|
|
1332
1341
|
e,
|
|
1333
1342
|
"resize",
|
|
1334
1343
|
() => {
|
|
1335
|
-
const
|
|
1336
|
-
|
|
1344
|
+
const o = f.getState().videoResolution;
|
|
1345
|
+
o?.width === e.videoWidth && o?.height === e.videoHeight || f.setState({
|
|
1337
1346
|
videoResolution: {
|
|
1338
1347
|
width: e.videoWidth,
|
|
1339
1348
|
height: e.videoHeight
|
|
1340
1349
|
}
|
|
1341
1350
|
});
|
|
1342
1351
|
}
|
|
1343
|
-
), a = new z((
|
|
1344
|
-
|
|
1352
|
+
), a = new z((o) => {
|
|
1353
|
+
o[0].connected || this.releaseVideoElement();
|
|
1345
1354
|
});
|
|
1346
1355
|
a.observe(e), e.setAttribute("playsInline", ""), e.setAttribute("muted", ""), e.controls = !1;
|
|
1347
1356
|
let n = "idle";
|
|
1348
|
-
const
|
|
1357
|
+
const i = ye(
|
|
1349
1358
|
document,
|
|
1350
1359
|
"visibilitychange",
|
|
1351
1360
|
async () => {
|
|
1352
1361
|
if (document.hidden) {
|
|
1353
|
-
n =
|
|
1362
|
+
n = f.getState().playbackState, this.stopStream();
|
|
1354
1363
|
return;
|
|
1355
1364
|
}
|
|
1356
|
-
|
|
1365
|
+
const s = this.#o ?? n;
|
|
1366
|
+
switch (this.#o = void 0, s) {
|
|
1357
1367
|
case "playback":
|
|
1358
1368
|
await this.startCameraStream(), await this.startPlayback();
|
|
1359
1369
|
break;
|
|
@@ -1363,8 +1373,8 @@ class na {
|
|
|
1363
1373
|
}
|
|
1364
1374
|
}
|
|
1365
1375
|
);
|
|
1366
|
-
this.#
|
|
1367
|
-
|
|
1376
|
+
this.#l = () => {
|
|
1377
|
+
i(), r(), a.disconnect();
|
|
1368
1378
|
};
|
|
1369
1379
|
}
|
|
1370
1380
|
/**
|
|
@@ -1374,12 +1384,12 @@ class na {
|
|
|
1374
1384
|
*/
|
|
1375
1385
|
initVideoElement(e) {
|
|
1376
1386
|
try {
|
|
1377
|
-
this.#
|
|
1378
|
-
} catch (
|
|
1387
|
+
this.#f(e);
|
|
1388
|
+
} catch (r) {
|
|
1379
1389
|
if (this.userInitiatedAbort)
|
|
1380
1390
|
this.reset();
|
|
1381
1391
|
else
|
|
1382
|
-
throw
|
|
1392
|
+
throw r;
|
|
1383
1393
|
}
|
|
1384
1394
|
}
|
|
1385
1395
|
/**
|
|
@@ -1390,13 +1400,16 @@ class na {
|
|
|
1390
1400
|
* @returns a cleanup function to remove the callback
|
|
1391
1401
|
*/
|
|
1392
1402
|
addFrameCaptureCallback(e) {
|
|
1393
|
-
return this.#
|
|
1403
|
+
return this.#s.add(e), () => this.#s.delete(e);
|
|
1404
|
+
}
|
|
1405
|
+
addErrorCallback(e) {
|
|
1406
|
+
return this.#d.add(e), () => this.#d.delete(e);
|
|
1394
1407
|
}
|
|
1395
1408
|
/**
|
|
1396
1409
|
* Cleans up the video element, and stops the stream.
|
|
1397
1410
|
*/
|
|
1398
1411
|
releaseVideoElement() {
|
|
1399
|
-
this.#
|
|
1412
|
+
this.#l?.(), f.setState({
|
|
1400
1413
|
videoElement: void 0
|
|
1401
1414
|
}), this.stopStream();
|
|
1402
1415
|
}
|
|
@@ -1407,9 +1420,9 @@ class na {
|
|
|
1407
1420
|
* @param camera - The camera to select.
|
|
1408
1421
|
*/
|
|
1409
1422
|
async selectCamera(e) {
|
|
1410
|
-
const
|
|
1411
|
-
|
|
1412
|
-
const a =
|
|
1423
|
+
const r = f.getState().playbackState;
|
|
1424
|
+
r !== "idle" && (this.#e = r);
|
|
1425
|
+
const a = f.getState();
|
|
1413
1426
|
if (a.selectedCamera === e) {
|
|
1414
1427
|
console.debug("Already selected");
|
|
1415
1428
|
return;
|
|
@@ -1418,9 +1431,9 @@ class na {
|
|
|
1418
1431
|
console.debug("Already swapping");
|
|
1419
1432
|
return;
|
|
1420
1433
|
}
|
|
1421
|
-
|
|
1434
|
+
f.setState({
|
|
1422
1435
|
isSwappingCamera: !0
|
|
1423
|
-
}), a.selectedCamera?.activeStream && (console.debug("Stopping previous stream"), a.selectedCamera.stopStream()), a.videoElement && (a.videoElement.srcObject = null),
|
|
1436
|
+
}), a.selectedCamera?.activeStream && (console.debug("Stopping previous stream"), a.selectedCamera.stopStream()), a.videoElement && (a.videoElement.srcObject = null), f.setState({
|
|
1424
1437
|
selectedCamera: e,
|
|
1425
1438
|
isSwappingCamera: !1
|
|
1426
1439
|
}), 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 +1444,47 @@ class na {
|
|
|
1431
1444
|
* @returns resolves when the camera devices are refreshed
|
|
1432
1445
|
*/
|
|
1433
1446
|
async refreshCameraDevices() {
|
|
1434
|
-
if (
|
|
1447
|
+
if (f.getState().isQueryingCameras || f.getState().isSwappingCamera) {
|
|
1435
1448
|
console.debug("Already querying cameras");
|
|
1436
1449
|
return;
|
|
1437
1450
|
}
|
|
1438
|
-
if (
|
|
1451
|
+
if (f.getState().cameraPermission === "prompt") {
|
|
1439
1452
|
console.debug("Still waiting for user to respond");
|
|
1440
1453
|
return;
|
|
1441
1454
|
}
|
|
1442
|
-
|
|
1455
|
+
f.setState({
|
|
1443
1456
|
isQueryingCameras: !0
|
|
1444
1457
|
}), window.setTimeout(() => {
|
|
1445
|
-
const a =
|
|
1446
|
-
a.isQueryingCameras &&
|
|
1458
|
+
const a = f.getState();
|
|
1459
|
+
a.isQueryingCameras && f.setState({
|
|
1447
1460
|
cameraPermission: "prompt"
|
|
1448
|
-
}), !a.isQueryingCameras && a.cameraPermission === "denied" &&
|
|
1461
|
+
}), !a.isQueryingCameras && a.cameraPermission === "denied" && f.setState({
|
|
1449
1462
|
cameraPermission: "blocked"
|
|
1450
1463
|
});
|
|
1451
1464
|
}, 100);
|
|
1452
|
-
const e = await
|
|
1453
|
-
throw a instanceof
|
|
1454
|
-
errorState:
|
|
1465
|
+
const e = await pt().catch((a) => {
|
|
1466
|
+
throw a instanceof B && a.code === "PERMISSION_DENIED" && f.setState({
|
|
1467
|
+
errorState: j(a),
|
|
1455
1468
|
cameraPermission: "denied",
|
|
1456
1469
|
isQueryingCameras: !1
|
|
1457
1470
|
}), a;
|
|
1458
1471
|
});
|
|
1459
|
-
|
|
1472
|
+
f.setState({
|
|
1460
1473
|
cameraPermission: "granted"
|
|
1461
1474
|
});
|
|
1462
|
-
const
|
|
1463
|
-
|
|
1475
|
+
const r = Ct(e);
|
|
1476
|
+
r.forEach((a) => {
|
|
1464
1477
|
a.unsubscribeAll(), a.subscribe((n) => {
|
|
1465
1478
|
window.queueMicrotask(() => {
|
|
1466
|
-
const
|
|
1467
|
-
a ===
|
|
1479
|
+
const o = f.getState().selectedCamera;
|
|
1480
|
+
a === o && f.setState({
|
|
1468
1481
|
selectedCamera: a
|
|
1469
1482
|
});
|
|
1470
1483
|
let s = !1, l;
|
|
1471
|
-
n.error?.code === "STREAM_ENDED_UNEXPECTEDLY" &&
|
|
1472
|
-
|
|
1484
|
+
n.error?.code === "STREAM_ENDED_UNEXPECTEDLY" && ze().catch((d) => {
|
|
1485
|
+
d instanceof B && d.code === "PERMISSION_DENIED" && (s = !0, l = d);
|
|
1473
1486
|
}).finally(() => {
|
|
1474
|
-
|
|
1487
|
+
f.setState({
|
|
1475
1488
|
errorState: l,
|
|
1476
1489
|
playbackState: "idle",
|
|
1477
1490
|
cameraPermission: s ? "denied" : "granted"
|
|
@@ -1483,25 +1496,25 @@ class na {
|
|
|
1483
1496
|
(n) => n,
|
|
1484
1497
|
() => {
|
|
1485
1498
|
window.queueMicrotask(() => {
|
|
1486
|
-
|
|
1487
|
-
cameras: [...
|
|
1499
|
+
f.setState({
|
|
1500
|
+
cameras: [...f.getState().cameras]
|
|
1488
1501
|
});
|
|
1489
1502
|
});
|
|
1490
1503
|
},
|
|
1491
1504
|
// Use a custom equality function to prevent updating all cameras list for
|
|
1492
1505
|
// every minor change in camera state
|
|
1493
1506
|
{
|
|
1494
|
-
equalityFn: (n,
|
|
1507
|
+
equalityFn: (n, i) => [
|
|
1495
1508
|
"torchSupported",
|
|
1496
1509
|
"singleShotSupported",
|
|
1497
1510
|
"facingMode",
|
|
1498
1511
|
"maxSupportedResolution",
|
|
1499
1512
|
"name"
|
|
1500
|
-
].every((s) => n[s] ===
|
|
1513
|
+
].every((s) => n[s] === i[s])
|
|
1501
1514
|
}
|
|
1502
1515
|
);
|
|
1503
|
-
}),
|
|
1504
|
-
cameras:
|
|
1516
|
+
}), f.setState({
|
|
1517
|
+
cameras: r,
|
|
1505
1518
|
isQueryingCameras: !1
|
|
1506
1519
|
});
|
|
1507
1520
|
}
|
|
@@ -1511,7 +1524,11 @@ class na {
|
|
|
1511
1524
|
* @returns resolves when playback starts
|
|
1512
1525
|
*/
|
|
1513
1526
|
async startPlayback() {
|
|
1514
|
-
|
|
1527
|
+
if (this.#i()) {
|
|
1528
|
+
this.#c("playback"), console.warn("Can't start playback while document is hidden");
|
|
1529
|
+
return;
|
|
1530
|
+
}
|
|
1531
|
+
const e = f.getState();
|
|
1515
1532
|
if (!(this.isActive && !this.#e)) {
|
|
1516
1533
|
if (!e.videoElement) {
|
|
1517
1534
|
console.warn("Starting playback - no video element present.");
|
|
@@ -1522,17 +1539,17 @@ class na {
|
|
|
1522
1539
|
return;
|
|
1523
1540
|
}
|
|
1524
1541
|
if (!e.selectedCamera.activeStream) {
|
|
1525
|
-
const
|
|
1526
|
-
e.videoElement.srcObject =
|
|
1542
|
+
const r = await e.selectedCamera.startStream(this.resolution);
|
|
1543
|
+
e.videoElement.srcObject = r;
|
|
1527
1544
|
}
|
|
1528
1545
|
try {
|
|
1529
|
-
this.#
|
|
1546
|
+
this.#w(), await e.videoElement.play(), f.setState({
|
|
1530
1547
|
playbackState: "playback"
|
|
1531
1548
|
});
|
|
1532
|
-
} catch (
|
|
1533
|
-
throw console.error("Failed to start playback",
|
|
1534
|
-
errorState:
|
|
1535
|
-
}),
|
|
1549
|
+
} catch (r) {
|
|
1550
|
+
throw console.error("Failed to start playback", r), f.setState({
|
|
1551
|
+
errorState: j(r)
|
|
1552
|
+
}), r;
|
|
1536
1553
|
}
|
|
1537
1554
|
}
|
|
1538
1555
|
}
|
|
@@ -1541,24 +1558,30 @@ class na {
|
|
|
1541
1558
|
*
|
|
1542
1559
|
* @returns resolves when frame capture starts
|
|
1543
1560
|
*/
|
|
1544
|
-
async #
|
|
1545
|
-
const e =
|
|
1546
|
-
if (!this.userInitiatedAbort
|
|
1547
|
-
if (
|
|
1548
|
-
|
|
1549
|
-
"Missing video element. Setup a video element first using `initVideoElement`"
|
|
1550
|
-
);
|
|
1561
|
+
async #m() {
|
|
1562
|
+
const e = f.getState();
|
|
1563
|
+
if (!this.userInitiatedAbort) {
|
|
1564
|
+
if (this.#i()) {
|
|
1565
|
+
this.#c("capturing");
|
|
1551
1566
|
return;
|
|
1552
1567
|
}
|
|
1553
|
-
if (!e.
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1568
|
+
if (!(e.playbackState === "capturing" && this.#e !== "capturing")) {
|
|
1569
|
+
if (!e.videoElement) {
|
|
1570
|
+
console.warn(
|
|
1571
|
+
"Missing video element. Setup a video element first using `initVideoElement`"
|
|
1572
|
+
);
|
|
1573
|
+
return;
|
|
1574
|
+
}
|
|
1575
|
+
if (!e.selectedCamera) {
|
|
1576
|
+
console.warn(
|
|
1577
|
+
"No active camera! Select a camera first, or use `startCameraStream`"
|
|
1578
|
+
);
|
|
1579
|
+
return;
|
|
1580
|
+
}
|
|
1581
|
+
await this.startPlayback(), f.getState().playbackState === "playback" && (f.setState({
|
|
1582
|
+
playbackState: "capturing"
|
|
1583
|
+
}), this.#g(), this.#e = void 0);
|
|
1558
1584
|
}
|
|
1559
|
-
await this.startPlayback(), u.setState({
|
|
1560
|
-
playbackState: "capturing"
|
|
1561
|
-
}), this.#u(), this.#e = void 0;
|
|
1562
1585
|
}
|
|
1563
1586
|
}
|
|
1564
1587
|
/**
|
|
@@ -1568,7 +1591,7 @@ class na {
|
|
|
1568
1591
|
*/
|
|
1569
1592
|
startFrameCapture = async () => {
|
|
1570
1593
|
try {
|
|
1571
|
-
await this.#
|
|
1594
|
+
await this.#m();
|
|
1572
1595
|
} catch (e) {
|
|
1573
1596
|
if (this.userInitiatedAbort)
|
|
1574
1597
|
this.reset();
|
|
@@ -1582,12 +1605,16 @@ class na {
|
|
|
1582
1605
|
* @param params - The parameters for the camera stream.
|
|
1583
1606
|
* @returns resolves when the camera stream starts
|
|
1584
1607
|
*/
|
|
1585
|
-
async #
|
|
1608
|
+
async #h({
|
|
1586
1609
|
autoplay: e = !0,
|
|
1587
|
-
preferredCamera:
|
|
1610
|
+
preferredCamera: r,
|
|
1588
1611
|
preferredFacing: a = "back"
|
|
1589
1612
|
} = {}) {
|
|
1590
|
-
|
|
1613
|
+
if (this.#i()) {
|
|
1614
|
+
e && this.#c("playback"), console.warn("Can't start stream while document is hidden");
|
|
1615
|
+
return;
|
|
1616
|
+
}
|
|
1617
|
+
const n = f.getState().videoElement;
|
|
1591
1618
|
if (!n) {
|
|
1592
1619
|
console.warn("Can't start stream without a video element");
|
|
1593
1620
|
return;
|
|
@@ -1596,7 +1623,7 @@ class na {
|
|
|
1596
1623
|
console.warn("Already streaming");
|
|
1597
1624
|
return;
|
|
1598
1625
|
}
|
|
1599
|
-
if (
|
|
1626
|
+
if (r instanceof $e && await this.selectCamera(r), !f.getState().selectedCamera)
|
|
1600
1627
|
try {
|
|
1601
1628
|
const s = await this.getCameraDevices();
|
|
1602
1629
|
let l;
|
|
@@ -1604,9 +1631,9 @@ class na {
|
|
|
1604
1631
|
throw console.warn("Camera list is empty"), new Error(
|
|
1605
1632
|
`No cameras found matching the filter ${a}`
|
|
1606
1633
|
);
|
|
1607
|
-
if (typeof
|
|
1634
|
+
if (typeof r == "function" && (l = r(s), l || console.warn(
|
|
1608
1635
|
"No camera found matching the preferred camera function, falling back to facing mode"
|
|
1609
|
-
)), l || (l = await
|
|
1636
|
+
)), l || (l = await St(
|
|
1610
1637
|
s,
|
|
1611
1638
|
this.resolution,
|
|
1612
1639
|
a
|
|
@@ -1614,21 +1641,25 @@ class na {
|
|
|
1614
1641
|
throw new Error(
|
|
1615
1642
|
`No cameras found matching the filter ${a}`
|
|
1616
1643
|
);
|
|
1617
|
-
await this.selectCamera(l), this.#
|
|
1644
|
+
await this.selectCamera(l), this.#p() && f.setState({
|
|
1618
1645
|
errorState: void 0
|
|
1619
1646
|
});
|
|
1620
1647
|
} catch (s) {
|
|
1621
|
-
throw
|
|
1622
|
-
errorState:
|
|
1648
|
+
throw f.setState({
|
|
1649
|
+
errorState: j(s)
|
|
1623
1650
|
}), s;
|
|
1624
1651
|
}
|
|
1625
|
-
const
|
|
1626
|
-
if (!
|
|
1652
|
+
const i = f.getState().selectedCamera;
|
|
1653
|
+
if (!i)
|
|
1627
1654
|
throw console.warn("No selected camera!"), new Error("No selected camera");
|
|
1628
|
-
|
|
1655
|
+
if (this.#i()) {
|
|
1656
|
+
console.warn("Can't start stream while document is hidden");
|
|
1657
|
+
return;
|
|
1658
|
+
}
|
|
1659
|
+
const o = await i.startStream(this.#r);
|
|
1629
1660
|
if (!n.isConnected)
|
|
1630
1661
|
throw new Error("Video element needs to be in the document!");
|
|
1631
|
-
n.srcObject =
|
|
1662
|
+
n.srcObject = o, f.setState({
|
|
1632
1663
|
videoElement: n
|
|
1633
1664
|
}), 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
1665
|
}
|
|
@@ -1641,12 +1672,12 @@ class na {
|
|
|
1641
1672
|
*/
|
|
1642
1673
|
async startCameraStream(e = {}) {
|
|
1643
1674
|
try {
|
|
1644
|
-
await this.#
|
|
1645
|
-
} catch (
|
|
1675
|
+
await this.#h(e);
|
|
1676
|
+
} catch (r) {
|
|
1646
1677
|
if (this.userInitiatedAbort)
|
|
1647
1678
|
this.reset();
|
|
1648
1679
|
else
|
|
1649
|
-
throw
|
|
1680
|
+
throw r;
|
|
1650
1681
|
}
|
|
1651
1682
|
}
|
|
1652
1683
|
/**
|
|
@@ -1654,15 +1685,15 @@ class na {
|
|
|
1654
1685
|
*
|
|
1655
1686
|
* @returns true if the error state is a permission error
|
|
1656
1687
|
*/
|
|
1657
|
-
#
|
|
1658
|
-
const e =
|
|
1659
|
-
return e instanceof
|
|
1688
|
+
#p = () => {
|
|
1689
|
+
const e = f.getState().errorState;
|
|
1690
|
+
return e instanceof B && e.code === "PERMISSION_DENIED";
|
|
1660
1691
|
};
|
|
1661
1692
|
/**
|
|
1662
1693
|
* Pauses capturing frames, without stopping playback.
|
|
1663
1694
|
*/
|
|
1664
1695
|
stopFrameCapture() {
|
|
1665
|
-
|
|
1696
|
+
this.#b(), f.setState({
|
|
1666
1697
|
playbackState: "playback"
|
|
1667
1698
|
});
|
|
1668
1699
|
}
|
|
@@ -1671,7 +1702,7 @@ class na {
|
|
|
1671
1702
|
*/
|
|
1672
1703
|
stopStream() {
|
|
1673
1704
|
console.debug("stopStream called");
|
|
1674
|
-
const e =
|
|
1705
|
+
const e = f.getState();
|
|
1675
1706
|
this.pausePlayback(), e.selectedCamera?.stopStream(), e.videoElement && (e.videoElement.srcObject = null);
|
|
1676
1707
|
}
|
|
1677
1708
|
/**
|
|
@@ -1679,65 +1710,72 @@ class na {
|
|
|
1679
1710
|
*/
|
|
1680
1711
|
pausePlayback() {
|
|
1681
1712
|
console.debug("pausePlayback called");
|
|
1682
|
-
const e =
|
|
1683
|
-
|
|
1713
|
+
const e = f.getState();
|
|
1714
|
+
this.#b(), f.setState({
|
|
1684
1715
|
playbackState: "idle"
|
|
1685
|
-
}), e
|
|
1716
|
+
}), e.videoElement?.pause();
|
|
1686
1717
|
}
|
|
1687
1718
|
/**
|
|
1688
1719
|
* The main recognition loop. Do not call this method directly, use `#queueFrame` instead.
|
|
1689
1720
|
*/
|
|
1690
|
-
async #
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
const
|
|
1715
|
-
|
|
1716
|
-
if (
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1721
|
+
async #v() {
|
|
1722
|
+
try {
|
|
1723
|
+
const e = f.getState();
|
|
1724
|
+
if (this.#a === void 0) {
|
|
1725
|
+
console.error("Missing request ID");
|
|
1726
|
+
return;
|
|
1727
|
+
}
|
|
1728
|
+
if (!e.videoElement) {
|
|
1729
|
+
console.warn("Missing video element, should not happen");
|
|
1730
|
+
return;
|
|
1731
|
+
}
|
|
1732
|
+
if (!e.extractionArea) {
|
|
1733
|
+
console.warn(
|
|
1734
|
+
"Stream started before extraction area was set, skipping frame."
|
|
1735
|
+
);
|
|
1736
|
+
return;
|
|
1737
|
+
}
|
|
1738
|
+
if (!(e.videoElement.videoHeight >= e.videoElement.videoWidth == e.extractionArea.height >= e.extractionArea.width))
|
|
1739
|
+
return this.#g();
|
|
1740
|
+
if (this.#s.size !== 0) {
|
|
1741
|
+
const a = this.#n.getImageData(
|
|
1742
|
+
e.videoElement,
|
|
1743
|
+
e.extractionArea
|
|
1744
|
+
);
|
|
1745
|
+
for (const n of this.#s) {
|
|
1746
|
+
const i = le(a.data.buffer) ? this.#n.getCurrentImageData() : a, o = await n(i);
|
|
1747
|
+
if (o) {
|
|
1748
|
+
if (!(o instanceof ArrayBuffer))
|
|
1749
|
+
throw ArrayBuffer.isView(o) && this.#n.reattachArrayBuffer(
|
|
1750
|
+
o.buffer
|
|
1751
|
+
), new Error(
|
|
1752
|
+
Ne`
|
|
1753
|
+
Frame capture callback did not return an ArrayBuffer.
|
|
1754
|
+
Make sure to return the underlying buffer, not the view.
|
|
1755
|
+
`
|
|
1756
|
+
);
|
|
1757
|
+
this.#n.reattachArrayBuffer(o);
|
|
1758
|
+
}
|
|
1724
1759
|
}
|
|
1725
1760
|
}
|
|
1761
|
+
this.#g();
|
|
1762
|
+
} catch (e) {
|
|
1763
|
+
const r = j(e);
|
|
1764
|
+
throw this.#y(r), r;
|
|
1726
1765
|
}
|
|
1727
|
-
this.#u();
|
|
1728
1766
|
}
|
|
1729
1767
|
/**
|
|
1730
1768
|
* Queues the next frame to be processed.
|
|
1731
1769
|
*/
|
|
1732
|
-
#
|
|
1733
|
-
const e =
|
|
1770
|
+
#g() {
|
|
1771
|
+
const e = f.getState();
|
|
1734
1772
|
if (e.playbackState === "capturing") {
|
|
1735
1773
|
if (!e.videoElement) {
|
|
1736
1774
|
console.warn("Missing video element, should not happen");
|
|
1737
1775
|
return;
|
|
1738
1776
|
}
|
|
1739
|
-
this.#
|
|
1740
|
-
() => void this.#
|
|
1777
|
+
this.#b(), this.#a = e.videoElement.requestVideoFrameCallback(
|
|
1778
|
+
() => void this.#v()
|
|
1741
1779
|
);
|
|
1742
1780
|
}
|
|
1743
1781
|
}
|
|
@@ -1745,13 +1783,22 @@ class na {
|
|
|
1745
1783
|
* Applies a mirror effect to the video if the camera is front-facing.
|
|
1746
1784
|
* Assumes that desktop devices don't return a facing mode and that they are front-facing.
|
|
1747
1785
|
*/
|
|
1748
|
-
#
|
|
1749
|
-
const e =
|
|
1786
|
+
#w() {
|
|
1787
|
+
const e = f.getState().selectedCamera;
|
|
1750
1788
|
if (!e) {
|
|
1751
1789
|
console.warn("No camera selected");
|
|
1752
1790
|
return;
|
|
1753
1791
|
}
|
|
1754
|
-
this.#
|
|
1792
|
+
this.#t && (e.facingMode !== "back" ? this.setCameraMirrorX(!0) : this.setCameraMirrorX(!1));
|
|
1793
|
+
}
|
|
1794
|
+
/**
|
|
1795
|
+
* Cancels any pending video frame callback and optionally clears the request ID.
|
|
1796
|
+
*
|
|
1797
|
+
* @param clearRequestId - Whether to clear the request ID after canceling
|
|
1798
|
+
*/
|
|
1799
|
+
#b() {
|
|
1800
|
+
const e = f.getState();
|
|
1801
|
+
this.#a && e.videoElement && (e.videoElement.cancelVideoFrameCallback(this.#a), this.#a = void 0);
|
|
1755
1802
|
}
|
|
1756
1803
|
/**
|
|
1757
1804
|
* If true, the video and captured frames will be mirrored horizontally.
|
|
@@ -1759,12 +1806,12 @@ class na {
|
|
|
1759
1806
|
* @param mirrorX - If true, the video and captured frames will be mirrored horizontally.
|
|
1760
1807
|
*/
|
|
1761
1808
|
setCameraMirrorX(e) {
|
|
1762
|
-
const
|
|
1809
|
+
const r = f.getState(), a = r.videoElement;
|
|
1763
1810
|
if (!a) {
|
|
1764
1811
|
console.warn("Mirror video - no video element present.");
|
|
1765
1812
|
return;
|
|
1766
1813
|
}
|
|
1767
|
-
|
|
1814
|
+
r.mirrorX !== e && (e ? a.style.scale = "-1 1" : a.style.removeProperty("scale"), f.setState({ mirrorX: e }));
|
|
1768
1815
|
}
|
|
1769
1816
|
// The "typeof" is necessary to avoid a circular dependency when resolving types
|
|
1770
1817
|
/**
|
|
@@ -1774,217 +1821,227 @@ class na {
|
|
|
1774
1821
|
*
|
|
1775
1822
|
* @returns a cleanup function to remove the subscription
|
|
1776
1823
|
*/
|
|
1777
|
-
subscribe =
|
|
1824
|
+
subscribe = f.subscribe;
|
|
1778
1825
|
/**
|
|
1779
1826
|
* Gets the current internal state of the CameraManager.
|
|
1780
1827
|
*
|
|
1781
1828
|
* @returns the current state of the CameraManager
|
|
1782
1829
|
*/
|
|
1783
|
-
getState =
|
|
1830
|
+
getState = f.getState;
|
|
1784
1831
|
/**
|
|
1785
1832
|
* Resets the CameraManager and stops all streams.
|
|
1786
1833
|
*/
|
|
1787
1834
|
reset() {
|
|
1788
|
-
console.debug("Resetting camera manager"), this.#
|
|
1835
|
+
console.debug("Resetting camera manager"), this.#s.clear(), this.#d.clear(), this.userInitiatedAbort = !1, this.stopStream(), Rt();
|
|
1836
|
+
}
|
|
1837
|
+
#y(e) {
|
|
1838
|
+
for (const r of this.#d)
|
|
1839
|
+
try {
|
|
1840
|
+
r(e);
|
|
1841
|
+
} catch (a) {
|
|
1842
|
+
console.error("Error in error callback", a);
|
|
1843
|
+
}
|
|
1789
1844
|
}
|
|
1790
1845
|
}
|
|
1791
|
-
const
|
|
1846
|
+
const Bt = {
|
|
1792
1847
|
mirrorFrontCameras: !0,
|
|
1793
1848
|
preferredResolution: "1080p"
|
|
1794
|
-
},
|
|
1795
|
-
function
|
|
1796
|
-
return
|
|
1849
|
+
}, qe = xe();
|
|
1850
|
+
function Ut() {
|
|
1851
|
+
return Ae(f);
|
|
1797
1852
|
}
|
|
1798
|
-
const
|
|
1853
|
+
const qt = (t) => {
|
|
1799
1854
|
const e = {
|
|
1800
|
-
cameraManagerSolidStore:
|
|
1855
|
+
cameraManagerSolidStore: Ut(),
|
|
1801
1856
|
// eslint-disable-next-line solid/reactivity
|
|
1802
|
-
cameraManager:
|
|
1857
|
+
cameraManager: t.cameraManager,
|
|
1803
1858
|
// eslint-disable-next-line solid/reactivity
|
|
1804
1859
|
dismountCameraUi: () => {
|
|
1805
|
-
|
|
1860
|
+
t.cameraManager.userInitiatedAbort = !0, t.dismountCameraUi();
|
|
1806
1861
|
},
|
|
1807
1862
|
// eslint-disable-next-line solid/reactivity
|
|
1808
|
-
addOnDismountCallback:
|
|
1863
|
+
addOnDismountCallback: t.addOnDismountCallback,
|
|
1864
|
+
// eslint-disable-next-line solid/reactivity
|
|
1865
|
+
mountTarget: t.mountTarget,
|
|
1809
1866
|
// eslint-disable-next-line solid/reactivity
|
|
1810
|
-
|
|
1867
|
+
showMirrorCameraButton: t.showMirrorCameraButton,
|
|
1811
1868
|
// eslint-disable-next-line solid/reactivity
|
|
1812
|
-
|
|
1869
|
+
showTorchButton: t.showTorchButton,
|
|
1813
1870
|
// eslint-disable-next-line solid/reactivity
|
|
1814
|
-
|
|
1871
|
+
showCloseButton: t.showCloseButton,
|
|
1815
1872
|
// eslint-disable-next-line solid/reactivity
|
|
1816
|
-
|
|
1873
|
+
showCameraErrorModal: t.showCameraErrorModal,
|
|
1817
1874
|
// eslint-disable-next-line solid/reactivity
|
|
1818
|
-
|
|
1875
|
+
zIndex: t.zIndex
|
|
1819
1876
|
};
|
|
1820
|
-
return
|
|
1877
|
+
return J(() => {
|
|
1821
1878
|
console.debug("CameraUiStoreProvider cleanup");
|
|
1822
|
-
}), c(
|
|
1879
|
+
}), c(qe.Provider, {
|
|
1823
1880
|
value: e,
|
|
1824
1881
|
get children() {
|
|
1825
|
-
return
|
|
1882
|
+
return t.children;
|
|
1826
1883
|
}
|
|
1827
1884
|
});
|
|
1828
1885
|
};
|
|
1829
|
-
function
|
|
1830
|
-
const
|
|
1831
|
-
if (!
|
|
1886
|
+
function q() {
|
|
1887
|
+
const t = Me(qe);
|
|
1888
|
+
if (!t)
|
|
1832
1889
|
throw new Error("StoreContext.Provider not in scope");
|
|
1833
|
-
return
|
|
1890
|
+
return t;
|
|
1834
1891
|
}
|
|
1835
|
-
const
|
|
1892
|
+
const jt = {
|
|
1836
1893
|
camera_error_cancel_btn: "Cancel",
|
|
1837
1894
|
camera_error_details: "Please allow camera access in your browser and try again.",
|
|
1838
1895
|
camera_error_primary_btn: "Retry",
|
|
1839
1896
|
camera_error_title: "Camera permission required",
|
|
1840
1897
|
close: "Close",
|
|
1898
|
+
dialog_title: "Scan a document",
|
|
1841
1899
|
loading_cameras: "Loading cameras...",
|
|
1842
1900
|
mirror_camera: "Mirror camera",
|
|
1843
|
-
scan_document: "Scan a document",
|
|
1844
1901
|
select_a_camera: "Select a camera",
|
|
1845
1902
|
select_camera: "Select camera",
|
|
1846
1903
|
selected_camera: "Selected camera",
|
|
1847
1904
|
torch: "Torch"
|
|
1848
|
-
},
|
|
1849
|
-
const [e,
|
|
1905
|
+
}, je = xe(), Ht = (t) => {
|
|
1906
|
+
const [e, r] = at(
|
|
1850
1907
|
// we structure clone to avoid proxying to the original object
|
|
1851
1908
|
structuredClone({
|
|
1852
|
-
...
|
|
1909
|
+
...jt,
|
|
1853
1910
|
// we don't care on init
|
|
1854
1911
|
// eslint-disable-next-line solid/reactivity
|
|
1855
|
-
...
|
|
1912
|
+
...t.userStrings
|
|
1856
1913
|
})
|
|
1857
1914
|
);
|
|
1858
|
-
|
|
1859
|
-
|
|
1915
|
+
K(() => {
|
|
1916
|
+
t.setLocalizationRef(r);
|
|
1860
1917
|
});
|
|
1861
1918
|
const a = {
|
|
1862
1919
|
t: e,
|
|
1863
|
-
updateLocalization:
|
|
1920
|
+
updateLocalization: r
|
|
1864
1921
|
};
|
|
1865
|
-
return c(
|
|
1922
|
+
return c(je.Provider, {
|
|
1866
1923
|
value: a,
|
|
1867
1924
|
get children() {
|
|
1868
|
-
return
|
|
1925
|
+
return t.children;
|
|
1869
1926
|
}
|
|
1870
1927
|
});
|
|
1871
1928
|
};
|
|
1872
|
-
function
|
|
1873
|
-
const
|
|
1874
|
-
if (!
|
|
1929
|
+
function Z() {
|
|
1930
|
+
const t = Me(je);
|
|
1931
|
+
if (!t)
|
|
1875
1932
|
throw new Error("LocalizationContext.Provider not in scope.");
|
|
1876
|
-
return
|
|
1933
|
+
return t;
|
|
1877
1934
|
}
|
|
1878
|
-
var
|
|
1879
|
-
const
|
|
1880
|
-
const [e,
|
|
1881
|
-
return
|
|
1882
|
-
const
|
|
1883
|
-
|
|
1884
|
-
}), c(
|
|
1935
|
+
var Wt = /* @__PURE__ */ w("<span>");
|
|
1936
|
+
const ee = (t) => {
|
|
1937
|
+
const [e, r] = I(), [a, n] = I();
|
|
1938
|
+
return K(() => {
|
|
1939
|
+
const i = a();
|
|
1940
|
+
i && r(i.getRootNode());
|
|
1941
|
+
}), c(x, {
|
|
1885
1942
|
get when() {
|
|
1886
1943
|
return e();
|
|
1887
1944
|
},
|
|
1888
1945
|
get fallback() {
|
|
1889
1946
|
return (() => {
|
|
1890
|
-
var
|
|
1891
|
-
return V(n,
|
|
1947
|
+
var i = Wt();
|
|
1948
|
+
return V(n, i), i;
|
|
1892
1949
|
})();
|
|
1893
1950
|
},
|
|
1894
|
-
children: (
|
|
1895
|
-
value: () =>
|
|
1951
|
+
children: (i) => c(nt, {
|
|
1952
|
+
value: () => i(),
|
|
1896
1953
|
get children() {
|
|
1897
|
-
return
|
|
1954
|
+
return t.children(i());
|
|
1898
1955
|
}
|
|
1899
1956
|
})
|
|
1900
1957
|
});
|
|
1901
1958
|
};
|
|
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 = {}) => (() => {
|
|
1959
|
+
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">');
|
|
1960
|
+
const Xt = (t = {}) => (() => {
|
|
1914
1961
|
var e = Gt();
|
|
1915
|
-
return
|
|
1962
|
+
return A(e, t, !0, !0), e;
|
|
1916
1963
|
})();
|
|
1917
|
-
var Qt = /* @__PURE__ */
|
|
1918
|
-
const Kt = (
|
|
1964
|
+
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">');
|
|
1965
|
+
const Kt = (t = {}) => (() => {
|
|
1919
1966
|
var e = Qt();
|
|
1920
|
-
return
|
|
1967
|
+
return A(e, t, !0, !0), e;
|
|
1968
|
+
})();
|
|
1969
|
+
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">');
|
|
1970
|
+
const Jt = (t = {}) => (() => {
|
|
1971
|
+
var e = Yt();
|
|
1972
|
+
return A(e, t, !0, !0), e;
|
|
1973
|
+
})();
|
|
1974
|
+
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">');
|
|
1975
|
+
const er = (t = {}) => (() => {
|
|
1976
|
+
var e = Zt();
|
|
1977
|
+
return A(e, t, !0, !0), e;
|
|
1921
1978
|
})();
|
|
1922
|
-
function
|
|
1979
|
+
function He(t) {
|
|
1923
1980
|
const e = {};
|
|
1924
|
-
return Object.entries(
|
|
1925
|
-
const n =
|
|
1926
|
-
let
|
|
1981
|
+
return Object.entries(t).forEach(([r, a]) => {
|
|
1982
|
+
const n = r.toLowerCase();
|
|
1983
|
+
let i = n;
|
|
1927
1984
|
if (n.startsWith("on")) {
|
|
1928
|
-
|
|
1929
|
-
const
|
|
1930
|
-
e[i] = a;
|
|
1931
|
-
} else
|
|
1985
|
+
i = n.slice(2);
|
|
1986
|
+
const o = `on:${i}`;
|
|
1932
1987
|
e[o] = a;
|
|
1988
|
+
} else
|
|
1989
|
+
e[i] = a;
|
|
1933
1990
|
}), e;
|
|
1934
1991
|
}
|
|
1935
|
-
var
|
|
1936
|
-
const
|
|
1937
|
-
var e =
|
|
1938
|
-
return
|
|
1992
|
+
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">');
|
|
1993
|
+
const rr = (t = {}) => (() => {
|
|
1994
|
+
var e = tr();
|
|
1995
|
+
return A(e, t, !0, !0), e;
|
|
1939
1996
|
})();
|
|
1940
|
-
var
|
|
1941
|
-
const
|
|
1942
|
-
var e =
|
|
1943
|
-
return
|
|
1997
|
+
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">');
|
|
1998
|
+
const nr = (t = {}) => (() => {
|
|
1999
|
+
var e = ar();
|
|
2000
|
+
return A(e, t, !0, !0), e;
|
|
1944
2001
|
})();
|
|
1945
|
-
var
|
|
1946
|
-
const
|
|
1947
|
-
var e =
|
|
1948
|
-
return
|
|
2002
|
+
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>');
|
|
2003
|
+
const ir = (t = {}) => (() => {
|
|
2004
|
+
var e = or();
|
|
2005
|
+
return A(e, t, !0, !0), e;
|
|
1949
2006
|
})();
|
|
1950
|
-
var
|
|
1951
|
-
const
|
|
2007
|
+
var sr = /* @__PURE__ */ w("<button>");
|
|
2008
|
+
const lr = () => {
|
|
1952
2009
|
const {
|
|
1953
|
-
cameraManagerSolidStore:
|
|
2010
|
+
cameraManagerSolidStore: t,
|
|
1954
2011
|
cameraManager: e
|
|
1955
|
-
} =
|
|
1956
|
-
t
|
|
1957
|
-
} =
|
|
1958
|
-
const
|
|
1959
|
-
return
|
|
1960
|
-
},
|
|
1961
|
-
value:
|
|
1962
|
-
label:
|
|
1963
|
-
}))],
|
|
1964
|
-
items: [...
|
|
1965
|
-
}),
|
|
1966
|
-
const
|
|
1967
|
-
if (!
|
|
2012
|
+
} = q(), {
|
|
2013
|
+
t: r
|
|
2014
|
+
} = 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 = () => {
|
|
2015
|
+
const m = i();
|
|
2016
|
+
return m ? a().filter((g) => m.includes(g.facingMode)) : a();
|
|
2017
|
+
}, u = () => [...d().map((m) => ({
|
|
2018
|
+
value: m.deviceInfo.deviceId,
|
|
2019
|
+
label: m.name
|
|
2020
|
+
}))], b = () => ot({
|
|
2021
|
+
items: [...u()]
|
|
2022
|
+
}), p = () => {
|
|
2023
|
+
const m = n();
|
|
2024
|
+
if (!m)
|
|
1968
2025
|
return;
|
|
1969
|
-
const
|
|
1970
|
-
if (
|
|
1971
|
-
return [
|
|
1972
|
-
},
|
|
1973
|
-
const
|
|
1974
|
-
if (!
|
|
2026
|
+
const g = b().find(m.deviceInfo.deviceId);
|
|
2027
|
+
if (g)
|
|
2028
|
+
return [g.value];
|
|
2029
|
+
}, h = async (m) => {
|
|
2030
|
+
const g = a().find((S) => S.deviceInfo.deviceId === m);
|
|
2031
|
+
if (!g) {
|
|
1975
2032
|
console.warn("No camera");
|
|
1976
2033
|
return;
|
|
1977
2034
|
}
|
|
1978
|
-
await e.selectCamera(
|
|
2035
|
+
await e.selectCamera(g);
|
|
1979
2036
|
};
|
|
1980
|
-
return c(
|
|
1981
|
-
children: () => c(
|
|
2037
|
+
return c(ee, {
|
|
2038
|
+
children: () => c(_.Root, {
|
|
1982
2039
|
part: "camera-select-part",
|
|
1983
2040
|
get collection() {
|
|
1984
|
-
return
|
|
2041
|
+
return b();
|
|
1985
2042
|
},
|
|
1986
2043
|
get value() {
|
|
1987
|
-
return
|
|
2044
|
+
return p();
|
|
1988
2045
|
},
|
|
1989
2046
|
positioning: {
|
|
1990
2047
|
placement: "top"
|
|
@@ -1993,85 +2050,70 @@ const nr = () => {
|
|
|
1993
2050
|
get disabled() {
|
|
1994
2051
|
return l();
|
|
1995
2052
|
},
|
|
1996
|
-
onValueChange: (
|
|
1997
|
-
m
|
|
2053
|
+
onValueChange: (m) => {
|
|
2054
|
+
h(m.value[0]);
|
|
1998
2055
|
},
|
|
1999
2056
|
get children() {
|
|
2000
|
-
return [c(
|
|
2057
|
+
return [c(_.Label, {
|
|
2001
2058
|
class: "sr-only",
|
|
2002
2059
|
get children() {
|
|
2003
|
-
return
|
|
2060
|
+
return r.selected_camera;
|
|
2004
2061
|
}
|
|
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, {
|
|
2062
|
+
}), c(_.Trigger, {
|
|
2063
|
+
asChild: (m) => (() => {
|
|
2064
|
+
var g = sr();
|
|
2065
|
+
return A(g, W(() => He(m()), {
|
|
2066
|
+
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"
|
|
2067
|
+
}), !1, !0), y(g, c(rr, {
|
|
2015
2068
|
class: "size-6 shrink-0",
|
|
2016
|
-
"aria-hidden":
|
|
2017
|
-
}), null),
|
|
2069
|
+
"aria-hidden": "true"
|
|
2070
|
+
}), null), y(g, c(_.ValueText, {
|
|
2018
2071
|
class: "truncate",
|
|
2019
2072
|
get placeholder() {
|
|
2020
|
-
return
|
|
2073
|
+
return o() ? r.loading_cameras : r.select_a_camera;
|
|
2021
2074
|
}
|
|
2022
|
-
}), null),
|
|
2075
|
+
}), null), y(g, c(_.Indicator, {
|
|
2023
2076
|
class: "shrink-0 data-[state=open]:scale-y-[-1]",
|
|
2024
2077
|
get children() {
|
|
2025
|
-
return c(
|
|
2078
|
+
return c(ir, {
|
|
2026
2079
|
class: "size-6 shrink-0"
|
|
2027
2080
|
});
|
|
2028
2081
|
}
|
|
2029
|
-
}), null),
|
|
2082
|
+
}), null), g;
|
|
2030
2083
|
})()
|
|
2031
|
-
}), c(
|
|
2032
|
-
class: "focus-visible:outline-none",
|
|
2084
|
+
}), c(_.Positioner, {
|
|
2033
2085
|
get children() {
|
|
2034
|
-
return c(
|
|
2035
|
-
class: "focus-visible:outline-
|
|
2086
|
+
return c(_.Content, {
|
|
2087
|
+
class: "dropdown-content focus-visible:outline focus-visible:outline-2px focus-visible:outline-solid focus-visible:outline-primary focus-visible:outline-offset-4px",
|
|
2036
2088
|
get children() {
|
|
2037
|
-
return c(
|
|
2038
|
-
class:
|
|
2039
|
-
focus-visible:outline-none flex flex-col gap-[1px]`,
|
|
2089
|
+
return c(_.ItemGroup, {
|
|
2090
|
+
class: "rounded-4 overflow-hidden text-base color-white flex flex-col",
|
|
2040
2091
|
get children() {
|
|
2041
|
-
return c(
|
|
2092
|
+
return c(Ze, {
|
|
2042
2093
|
get each() {
|
|
2043
|
-
return
|
|
2094
|
+
return b().items;
|
|
2044
2095
|
},
|
|
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
|
-
}
|
|
2096
|
+
children: (m) => c(_.Item, {
|
|
2097
|
+
get item() {
|
|
2098
|
+
return m();
|
|
2099
|
+
},
|
|
2100
|
+
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",
|
|
2101
|
+
get children() {
|
|
2102
|
+
return [c(_.ItemText, {
|
|
2103
|
+
class: "truncate",
|
|
2104
|
+
get children() {
|
|
2105
|
+
return m().label;
|
|
2106
|
+
}
|
|
2107
|
+
}), c(_.ItemIndicator, {
|
|
2108
|
+
class: "absolute right-4",
|
|
2109
|
+
get children() {
|
|
2110
|
+
return c(nr, {
|
|
2111
|
+
class: "size-6 shrink-0"
|
|
2112
|
+
});
|
|
2113
|
+
}
|
|
2114
|
+
})];
|
|
2115
|
+
}
|
|
2116
|
+
})
|
|
2075
2117
|
});
|
|
2076
2118
|
}
|
|
2077
2119
|
});
|
|
@@ -2083,83 +2125,85 @@ const nr = () => {
|
|
|
2083
2125
|
})
|
|
2084
2126
|
});
|
|
2085
2127
|
};
|
|
2086
|
-
var
|
|
2087
|
-
const
|
|
2128
|
+
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>");
|
|
2129
|
+
const hr = () => {
|
|
2088
2130
|
const {
|
|
2089
|
-
dismountCameraUi:
|
|
2131
|
+
dismountCameraUi: t,
|
|
2090
2132
|
cameraManagerSolidStore: e,
|
|
2091
|
-
cameraManager:
|
|
2133
|
+
cameraManager: r,
|
|
2092
2134
|
showMirrorCameraButton: a,
|
|
2093
2135
|
showTorchButton: n,
|
|
2094
|
-
showCloseButton:
|
|
2095
|
-
} =
|
|
2096
|
-
t:
|
|
2097
|
-
} =
|
|
2098
|
-
const
|
|
2099
|
-
|
|
2100
|
-
},
|
|
2101
|
-
|
|
2136
|
+
showCloseButton: i
|
|
2137
|
+
} = q(), {
|
|
2138
|
+
t: o
|
|
2139
|
+
} = 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 = () => {
|
|
2140
|
+
const g = l();
|
|
2141
|
+
g && g.toggleTorch();
|
|
2142
|
+
}, m = () => {
|
|
2143
|
+
r.setCameraMirrorX(!e.getState().mirrorX);
|
|
2102
2144
|
};
|
|
2103
|
-
return c(
|
|
2145
|
+
return c(ee, {
|
|
2104
2146
|
children: () => (() => {
|
|
2105
|
-
var
|
|
2106
|
-
return
|
|
2147
|
+
var g = ur(), S = g.firstChild, T = S.nextSibling;
|
|
2148
|
+
return y(S, c(x, {
|
|
2107
2149
|
get when() {
|
|
2108
|
-
return a &&
|
|
2150
|
+
return a && u();
|
|
2109
2151
|
},
|
|
2110
2152
|
get children() {
|
|
2111
|
-
return c(
|
|
2153
|
+
return c(re, {
|
|
2112
2154
|
part: "mirror-camera-button-part",
|
|
2113
2155
|
get tooltipLabel() {
|
|
2114
|
-
return
|
|
2156
|
+
return o.mirror_camera;
|
|
2157
|
+
},
|
|
2158
|
+
onClick: () => m(),
|
|
2159
|
+
get "aria-pressed"() {
|
|
2160
|
+
return s() ? "true" : "false";
|
|
2115
2161
|
},
|
|
2116
|
-
onClick: () => d(),
|
|
2117
2162
|
get children() {
|
|
2118
|
-
return
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
})(), c(Kt, {
|
|
2122
|
-
class: `size-6 shrink-0 transition-transform duration-300
|
|
2123
|
-
ease-in-out`,
|
|
2163
|
+
return c(er, {
|
|
2164
|
+
"aria-hidden": "true",
|
|
2165
|
+
class: "size-6 shrink-0 transition-transform duration-300 ease-in-out",
|
|
2124
2166
|
get style() {
|
|
2125
2167
|
return {
|
|
2126
2168
|
transform: s() ? "scaleX(-1)" : "scaleX(1)"
|
|
2127
2169
|
};
|
|
2128
2170
|
}
|
|
2129
|
-
})
|
|
2171
|
+
});
|
|
2130
2172
|
}
|
|
2131
2173
|
});
|
|
2132
2174
|
}
|
|
2133
|
-
}), null),
|
|
2175
|
+
}), null), y(S, c(x, {
|
|
2134
2176
|
get when() {
|
|
2135
|
-
return
|
|
2177
|
+
return Ee(() => !!(n && p()))() && u();
|
|
2136
2178
|
},
|
|
2137
2179
|
get children() {
|
|
2138
|
-
return c(
|
|
2180
|
+
return c(re, {
|
|
2139
2181
|
part: "torch-button-part",
|
|
2140
|
-
onClick: () =>
|
|
2182
|
+
onClick: () => h(),
|
|
2141
2183
|
get tooltipLabel() {
|
|
2142
|
-
return
|
|
2184
|
+
return o.torch;
|
|
2185
|
+
},
|
|
2186
|
+
get "aria-pressed"() {
|
|
2187
|
+
return b() ? "true" : "false";
|
|
2143
2188
|
},
|
|
2144
2189
|
get children() {
|
|
2145
|
-
return [c(
|
|
2190
|
+
return [c(x, {
|
|
2146
2191
|
get when() {
|
|
2147
|
-
return !
|
|
2192
|
+
return !b();
|
|
2148
2193
|
},
|
|
2149
2194
|
get children() {
|
|
2150
|
-
return
|
|
2151
|
-
|
|
2152
|
-
return w(b, () => i.torch), b;
|
|
2153
|
-
})(), c(Xt, {
|
|
2195
|
+
return c(Jt, {
|
|
2196
|
+
"aria-hidden": "true",
|
|
2154
2197
|
class: "size-6 shrink-0"
|
|
2155
|
-
})
|
|
2198
|
+
});
|
|
2156
2199
|
}
|
|
2157
|
-
}), c(
|
|
2200
|
+
}), c(x, {
|
|
2158
2201
|
get when() {
|
|
2159
|
-
return
|
|
2202
|
+
return b();
|
|
2160
2203
|
},
|
|
2161
2204
|
get children() {
|
|
2162
|
-
return c(
|
|
2205
|
+
return c(Kt, {
|
|
2206
|
+
"aria-hidden": "true",
|
|
2163
2207
|
class: "size-6 shrink-0"
|
|
2164
2208
|
});
|
|
2165
2209
|
}
|
|
@@ -2167,468 +2211,553 @@ const lr = () => {
|
|
|
2167
2211
|
}
|
|
2168
2212
|
});
|
|
2169
2213
|
}
|
|
2170
|
-
}), null),
|
|
2214
|
+
}), null), y(T, c(x, {
|
|
2171
2215
|
get when() {
|
|
2172
|
-
return
|
|
2216
|
+
return d().length > 1;
|
|
2173
2217
|
},
|
|
2174
2218
|
get children() {
|
|
2175
|
-
return c(
|
|
2219
|
+
return c(lr, {});
|
|
2176
2220
|
}
|
|
2177
|
-
})),
|
|
2178
|
-
when:
|
|
2221
|
+
})), y(g, c(x, {
|
|
2222
|
+
when: i,
|
|
2179
2223
|
get children() {
|
|
2180
|
-
var
|
|
2181
|
-
return
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
return
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2224
|
+
var v = cr();
|
|
2225
|
+
return y(v, c(
|
|
2226
|
+
re,
|
|
2227
|
+
{
|
|
2228
|
+
part: "close-button-part",
|
|
2229
|
+
onClick: () => t(),
|
|
2230
|
+
get tooltipLabel() {
|
|
2231
|
+
return o.close;
|
|
2232
|
+
},
|
|
2233
|
+
get children() {
|
|
2234
|
+
return c(Xt, {
|
|
2235
|
+
class: "size-6 shrink-0",
|
|
2236
|
+
"aria-hidden": "true"
|
|
2237
|
+
});
|
|
2238
|
+
}
|
|
2194
2239
|
}
|
|
2195
|
-
|
|
2240
|
+
)), v;
|
|
2196
2241
|
}
|
|
2197
|
-
}), null),
|
|
2242
|
+
}), null), g;
|
|
2198
2243
|
})()
|
|
2199
2244
|
});
|
|
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
|
-
|
|
2245
|
+
}, re = (t) => {
|
|
2246
|
+
const [e, r] = Y(t, ["tooltipLabel", "children"]);
|
|
2247
|
+
return c(Q.Root, {
|
|
2248
|
+
get children() {
|
|
2249
|
+
return [c(Q.Trigger, {
|
|
2250
|
+
asChild: (a) => {
|
|
2251
|
+
const [, n] = Y(a(), ["aria-describedby"]);
|
|
2252
|
+
return (() => {
|
|
2253
|
+
var i = dr();
|
|
2254
|
+
return A(i, W({
|
|
2255
|
+
get "aria-label"() {
|
|
2256
|
+
return e.tooltipLabel;
|
|
2257
|
+
}
|
|
2258
|
+
}, r, () => He(n), {
|
|
2259
|
+
class: "btn-focus rounded-full bg-gray-550/70 backdrop-blur grid place-items-center size-12 appearance-none border-none cursor-pointer"
|
|
2260
|
+
}), !1, !0), y(i, () => e.children), i;
|
|
2261
|
+
})();
|
|
2262
|
+
}
|
|
2263
|
+
}), c(Q.Positioner, {
|
|
2264
|
+
get children() {
|
|
2265
|
+
return c(Q.Content, {
|
|
2266
|
+
class: "bg-gray-550/70 backdrop-blur color-white text-align-center p-2 rounded-md text-sm drop-shadow-md",
|
|
2267
|
+
"aria-hidden": "true",
|
|
2268
|
+
get children() {
|
|
2269
|
+
return e.tooltipLabel;
|
|
2270
|
+
}
|
|
2271
|
+
});
|
|
2272
|
+
}
|
|
2273
|
+
})];
|
|
2274
|
+
}
|
|
2275
|
+
});
|
|
2276
|
+
}, fr = (t, e, r) => oe((a) => (y(e, t(), e.firstChild ? null : void 0), () => {
|
|
2277
|
+
a(), e instanceof Document || (e.textContent = "");
|
|
2278
|
+
}), r);
|
|
2279
|
+
var mr = /* @__PURE__ */ w("<div>");
|
|
2280
|
+
const gr = (t) => {
|
|
2281
|
+
const e = Re(), [r, a] = Y(t, ["children", "disableShadowRoot", "getRef"]);
|
|
2229
2282
|
return (() => {
|
|
2230
|
-
var n =
|
|
2231
|
-
return V((
|
|
2232
|
-
if (
|
|
2283
|
+
var n = mr();
|
|
2284
|
+
return V((i) => {
|
|
2285
|
+
if (r.disableShadowRoot)
|
|
2233
2286
|
return;
|
|
2234
|
-
const
|
|
2287
|
+
const o = i.attachShadow({
|
|
2235
2288
|
mode: "open"
|
|
2236
2289
|
});
|
|
2237
|
-
|
|
2238
|
-
}, n),
|
|
2290
|
+
fr(() => Ee(() => r.children), o, e);
|
|
2291
|
+
}, n), A(n, a, !1, !0), y(n, c(x, {
|
|
2239
2292
|
get when() {
|
|
2240
|
-
return
|
|
2293
|
+
return r.disableShadowRoot;
|
|
2241
2294
|
},
|
|
2242
2295
|
get children() {
|
|
2243
|
-
return
|
|
2296
|
+
return r.children;
|
|
2244
2297
|
}
|
|
2245
2298
|
})), n;
|
|
2246
2299
|
})();
|
|
2247
|
-
},
|
|
2300
|
+
}, 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
2301
|
feedbackLayer: null,
|
|
2249
2302
|
overlayLayer: null,
|
|
2250
2303
|
owner: null
|
|
2251
|
-
},
|
|
2304
|
+
}, O = de()(
|
|
2252
2305
|
// 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
|
-
|
|
2306
|
+
ue(() => structuredClone(wr))
|
|
2307
|
+
), ce = Ae(O), Se = () => {
|
|
2308
|
+
}, 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] : [];
|
|
2309
|
+
function kr(t, e, r, a) {
|
|
2310
|
+
const n = t.length, i = e.length;
|
|
2311
|
+
let o = 0;
|
|
2312
|
+
if (!i) {
|
|
2313
|
+
for (; o < n; o++)
|
|
2314
|
+
r(t[o]);
|
|
2315
|
+
return;
|
|
2316
|
+
}
|
|
2317
|
+
if (!n) {
|
|
2318
|
+
for (; o < i; o++)
|
|
2319
|
+
a(e[o]);
|
|
2320
|
+
return;
|
|
2321
|
+
}
|
|
2322
|
+
for (; o < i && e[o] === t[o]; o++)
|
|
2323
|
+
;
|
|
2324
|
+
let s, l;
|
|
2325
|
+
e = e.slice(o), t = t.slice(o);
|
|
2326
|
+
for (s of e)
|
|
2327
|
+
t.includes(s) || a(s);
|
|
2328
|
+
for (l of t)
|
|
2329
|
+
e.includes(l) || r(l);
|
|
2330
|
+
}
|
|
2331
|
+
function We(t, e) {
|
|
2332
|
+
if (he)
|
|
2333
|
+
return { observe: Se, unobserve: Se };
|
|
2334
|
+
const r = new ResizeObserver(t);
|
|
2335
|
+
return J(r.disconnect.bind(r)), {
|
|
2336
|
+
observe: (a) => r.observe(a, e),
|
|
2337
|
+
unobserve: r.unobserve.bind(r)
|
|
2263
2338
|
};
|
|
2264
2339
|
}
|
|
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;
|
|
2340
|
+
function Tr(t, e, r) {
|
|
2341
|
+
if (he)
|
|
2342
|
+
return;
|
|
2343
|
+
const a = /* @__PURE__ */ new WeakMap(), { observe: n, unobserve: i } = We((o) => {
|
|
2344
|
+
for (const s of o) {
|
|
2345
|
+
const { contentRect: l, target: d } = s, u = Math.round(l.width), b = Math.round(l.height), p = a.get(d);
|
|
2346
|
+
(!p || p.width !== u || p.height !== b) && (e(l, d, s), a.set(d, { width: u, height: b }));
|
|
2296
2347
|
}
|
|
2348
|
+
}, r);
|
|
2349
|
+
_e((o) => {
|
|
2350
|
+
const s = Sr(Er(Cr(t)));
|
|
2351
|
+
return kr(s, o, n, i), s;
|
|
2352
|
+
}, []);
|
|
2353
|
+
}
|
|
2354
|
+
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>');
|
|
2355
|
+
const Mr = (t = {}) => (() => {
|
|
2356
|
+
var e = xr();
|
|
2357
|
+
return A(e, t, !0, !0), e;
|
|
2358
|
+
})(), ae = Symbol("fallback");
|
|
2359
|
+
function Ce(t) {
|
|
2360
|
+
for (const e of t)
|
|
2361
|
+
e.dispose();
|
|
2362
|
+
}
|
|
2363
|
+
function Rr(t, e, r, a = {}) {
|
|
2364
|
+
if (he) {
|
|
2365
|
+
const o = t();
|
|
2366
|
+
let s = [];
|
|
2367
|
+
if (o && o.length)
|
|
2368
|
+
for (let l = 0, d = o.length; l < d; l++)
|
|
2369
|
+
s.push(r(() => o[l], () => l));
|
|
2370
|
+
else a.fallback && (s = [a.fallback()]);
|
|
2371
|
+
return () => s;
|
|
2372
|
+
}
|
|
2373
|
+
const n = /* @__PURE__ */ new Map();
|
|
2374
|
+
return J(() => Ce(n.values())), () => {
|
|
2375
|
+
const o = t() || [];
|
|
2376
|
+
return o[tt], rt(() => {
|
|
2377
|
+
if (!o.length)
|
|
2378
|
+
return Ce(n.values()), n.clear(), a.fallback ? [oe((b) => (n.set(ae, { dispose: b }), a.fallback()))] : [];
|
|
2379
|
+
const s = new Array(o.length), l = n.get(ae);
|
|
2380
|
+
if (!n.size || l) {
|
|
2381
|
+
l?.dispose(), n.delete(ae);
|
|
2382
|
+
for (let u = 0; u < o.length; u++) {
|
|
2383
|
+
const b = o[u], p = e(b, u);
|
|
2384
|
+
i(s, b, u, p);
|
|
2385
|
+
}
|
|
2386
|
+
return s;
|
|
2387
|
+
}
|
|
2388
|
+
const d = new Set(n.keys());
|
|
2389
|
+
for (let u = 0; u < o.length; u++) {
|
|
2390
|
+
const b = o[u], p = e(b, u);
|
|
2391
|
+
d.delete(p);
|
|
2392
|
+
const h = n.get(p);
|
|
2393
|
+
h ? (s[u] = h.mapped, h.setIndex?.(u), h.setItem(() => b)) : i(s, b, u, p);
|
|
2394
|
+
}
|
|
2395
|
+
for (const u of d)
|
|
2396
|
+
n.get(u)?.dispose(), n.delete(u);
|
|
2397
|
+
return s;
|
|
2398
|
+
});
|
|
2297
2399
|
};
|
|
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;
|
|
2400
|
+
function i(o, s, l, d) {
|
|
2401
|
+
oe((u) => {
|
|
2402
|
+
const [b, p] = I(s), h = { setItem: p, dispose: u };
|
|
2403
|
+
if (r.length > 1) {
|
|
2404
|
+
const [m, g] = I(l);
|
|
2405
|
+
h.setIndex = g, h.mapped = r(b, m);
|
|
2406
|
+
} else
|
|
2407
|
+
h.mapped = r(b);
|
|
2408
|
+
n.set(d, h), o[l] = h.mapped;
|
|
2409
|
+
});
|
|
2410
|
+
}
|
|
2411
|
+
}
|
|
2412
|
+
function _r(t) {
|
|
2413
|
+
const { by: e } = t;
|
|
2414
|
+
return et(Rr(() => t.each, typeof e == "function" ? e : (r) => r[e], t.children, "fallback" in t ? { fallback: () => t.fallback } : void 0));
|
|
2415
|
+
}
|
|
2416
|
+
var Ar = /* @__PURE__ */ w('<div class="grid min-h-0">'), Dr = /* @__PURE__ */ w('<div class="flex justify-center gap-2 w-full shrink-0">');
|
|
2417
|
+
const Ir = (t) => {
|
|
2418
|
+
const [e, r] = Y(t, ["initialFocusEl", "role"]), [a, n] = I();
|
|
2419
|
+
Tr(a, (o, s) => {
|
|
2420
|
+
const l = Math.min(s.clientWidth, s.clientHeight), d = Math.min(1, Math.max(0, (l - 300) / 240));
|
|
2421
|
+
s.style.setProperty("--modal-t", d.toFixed(4));
|
|
2422
|
+
});
|
|
2423
|
+
const i = () => {
|
|
2424
|
+
const o = [];
|
|
2425
|
+
return t.actions?.secondary && o.push({
|
|
2426
|
+
type: "secondary",
|
|
2427
|
+
action: t.actions.secondary
|
|
2428
|
+
}), t.actions?.primary && o.push({
|
|
2429
|
+
type: "primary",
|
|
2430
|
+
action: t.actions.primary
|
|
2431
|
+
}), o;
|
|
2432
|
+
};
|
|
2433
|
+
return c(ee, {
|
|
2434
|
+
children: (o) => {
|
|
2435
|
+
const s = t.initialFocusEl ? {
|
|
2436
|
+
initialFocusEl: () => t.initialFocusEl(o)
|
|
2437
|
+
} : {};
|
|
2438
|
+
return c(D.Root, W({
|
|
2439
|
+
onFocusOutside: (l) => l.preventDefault(),
|
|
2440
|
+
onInteractOutside: (l) => l.preventDefault()
|
|
2441
|
+
}, s, r, {
|
|
2442
|
+
get children() {
|
|
2443
|
+
return c(x, {
|
|
2444
|
+
get when() {
|
|
2445
|
+
return t.open;
|
|
2446
|
+
},
|
|
2447
|
+
get children() {
|
|
2448
|
+
return c(ke, {
|
|
2449
|
+
get mount() {
|
|
2450
|
+
return t.mountTarget;
|
|
2451
|
+
},
|
|
2452
|
+
get children() {
|
|
2453
|
+
return c(D.Positioner, {
|
|
2454
|
+
class: "h-100dvh w-100dvw top-0 left-0 fixed grid place-items-center p-[clamp(1.5rem,6dvmin,3rem)]",
|
|
2455
|
+
get children() {
|
|
2456
|
+
return [c(D.Backdrop, {
|
|
2457
|
+
class: "absolute top-0 left-0 w-full h-full bg-black bg-opacity-50 backdrop-blur-sm"
|
|
2458
|
+
}), c(D.Content, {
|
|
2459
|
+
ref: n,
|
|
2460
|
+
get role() {
|
|
2461
|
+
return e.role;
|
|
2462
|
+
},
|
|
2463
|
+
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",
|
|
2464
|
+
get children() {
|
|
2465
|
+
return [c(x, {
|
|
2466
|
+
get when() {
|
|
2467
|
+
return t.showCloseButton;
|
|
2368
2468
|
},
|
|
2369
2469
|
get children() {
|
|
2370
|
-
return
|
|
2470
|
+
return c(D.CloseTrigger, {
|
|
2471
|
+
"aria-label": "Close",
|
|
2472
|
+
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",
|
|
2473
|
+
get onClick() {
|
|
2474
|
+
return t.onCloseClicked;
|
|
2475
|
+
},
|
|
2476
|
+
get children() {
|
|
2477
|
+
return c(Mr, {
|
|
2478
|
+
class: "w-3.5 h-3.5"
|
|
2479
|
+
});
|
|
2480
|
+
}
|
|
2481
|
+
});
|
|
2371
2482
|
}
|
|
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
|
-
|
|
2483
|
+
}), (() => {
|
|
2484
|
+
var l = Ar();
|
|
2485
|
+
return y(l, () => t.children), Te((d) => {
|
|
2486
|
+
var u = t.scrollable !== !1, b = t.scrollable === !1;
|
|
2487
|
+
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;
|
|
2488
|
+
}, {
|
|
2489
|
+
e: void 0,
|
|
2490
|
+
t: void 0
|
|
2491
|
+
}), l;
|
|
2492
|
+
})(), c(x, {
|
|
2493
|
+
get when() {
|
|
2494
|
+
return t.actions;
|
|
2495
|
+
},
|
|
2496
|
+
get children() {
|
|
2497
|
+
var l = Dr();
|
|
2498
|
+
return y(l, c(_r, {
|
|
2499
|
+
get each() {
|
|
2500
|
+
return i();
|
|
2501
|
+
},
|
|
2502
|
+
by: "type",
|
|
2503
|
+
children: (d) => {
|
|
2504
|
+
const u = () => {
|
|
2505
|
+
const {
|
|
2506
|
+
label: p,
|
|
2507
|
+
...h
|
|
2508
|
+
} = d().action;
|
|
2509
|
+
return h;
|
|
2510
|
+
}, b = d().type === "primary" ? "btn-primary" : "btn-secondary";
|
|
2511
|
+
return c(D.CloseTrigger, W({
|
|
2512
|
+
class: `btn ${b} max-w-[30ch] flex-1 min-w-0`
|
|
2513
|
+
}, u, {
|
|
2514
|
+
get children() {
|
|
2515
|
+
return d().action.label;
|
|
2516
|
+
}
|
|
2517
|
+
}));
|
|
2518
|
+
}
|
|
2519
|
+
})), l;
|
|
2520
|
+
}
|
|
2521
|
+
})];
|
|
2522
|
+
}
|
|
2523
|
+
})];
|
|
2524
|
+
}
|
|
2525
|
+
});
|
|
2526
|
+
}
|
|
2527
|
+
});
|
|
2528
|
+
}
|
|
2529
|
+
});
|
|
2530
|
+
}
|
|
2531
|
+
}));
|
|
2532
|
+
}
|
|
2399
2533
|
});
|
|
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 = () => {
|
|
2534
|
+
}, Fr = (t) => c(Ir, W({
|
|
2535
|
+
role: "alertdialog"
|
|
2536
|
+
}, t));
|
|
2537
|
+
var Lr = /* @__PURE__ */ w("<p>");
|
|
2538
|
+
const Nr = () => {
|
|
2439
2539
|
const {
|
|
2440
|
-
t
|
|
2441
|
-
} =
|
|
2540
|
+
t
|
|
2541
|
+
} = Z(), {
|
|
2442
2542
|
cameraManagerSolidStore: e,
|
|
2443
|
-
cameraManager:
|
|
2543
|
+
cameraManager: r,
|
|
2444
2544
|
dismountCameraUi: a
|
|
2445
|
-
} =
|
|
2446
|
-
const
|
|
2447
|
-
return
|
|
2448
|
-
}, s = () =>
|
|
2449
|
-
return c(
|
|
2450
|
-
get
|
|
2545
|
+
} = q(), n = e((d) => d.errorState), i = ce((d) => d.overlayLayer), o = () => {
|
|
2546
|
+
const d = n();
|
|
2547
|
+
return d instanceof B && d.code === "PERMISSION_DENIED";
|
|
2548
|
+
}, s = () => o() ? t.camera_error_title : n() ? n().name : "", l = () => o() ? t.camera_error_details : n() ? n().name : "";
|
|
2549
|
+
return c(Fr, {
|
|
2550
|
+
get mountTarget() {
|
|
2451
2551
|
return i();
|
|
2452
2552
|
},
|
|
2453
|
-
get
|
|
2454
|
-
return
|
|
2455
|
-
|
|
2456
|
-
|
|
2553
|
+
get open() {
|
|
2554
|
+
return o();
|
|
2555
|
+
},
|
|
2556
|
+
get actions() {
|
|
2557
|
+
return {
|
|
2558
|
+
primary: {
|
|
2559
|
+
label: t.camera_error_primary_btn,
|
|
2560
|
+
onclick: () => void r.startCameraStream()
|
|
2457
2561
|
},
|
|
2458
|
-
|
|
2562
|
+
secondary: {
|
|
2563
|
+
label: t.camera_error_cancel_btn,
|
|
2564
|
+
onclick: () => a()
|
|
2565
|
+
}
|
|
2566
|
+
};
|
|
2567
|
+
},
|
|
2568
|
+
get children() {
|
|
2569
|
+
return [c(be.Title, {
|
|
2570
|
+
class: "dialog-title",
|
|
2571
|
+
get children() {
|
|
2459
2572
|
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
2573
|
}
|
|
2473
|
-
})
|
|
2574
|
+
}), c(be.Description, {
|
|
2575
|
+
class: "dialog-description",
|
|
2576
|
+
get children() {
|
|
2577
|
+
var d = Lr();
|
|
2578
|
+
return y(d, l), d;
|
|
2579
|
+
}
|
|
2580
|
+
})];
|
|
2474
2581
|
}
|
|
2475
2582
|
});
|
|
2476
|
-
};
|
|
2477
|
-
function
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2583
|
+
}, zr = { trailing: !0 };
|
|
2584
|
+
function Pr(t, e = 25, r = {}) {
|
|
2585
|
+
if (r = {
|
|
2586
|
+
...zr,
|
|
2587
|
+
...r
|
|
2588
|
+
}, !Number.isFinite(e)) throw new TypeError("Expected `wait` to be a finite number");
|
|
2589
|
+
let a, n, i = [], o, s;
|
|
2590
|
+
const l = (b, p) => (o = $r(t, b, p), o.finally(() => {
|
|
2591
|
+
if (o = null, r.trailing && s && !n) {
|
|
2592
|
+
const h = l(b, s);
|
|
2593
|
+
return s = null, h;
|
|
2594
|
+
}
|
|
2595
|
+
}), o), d = function(...b) {
|
|
2596
|
+
return r.trailing && (s = b), o || new Promise((p) => {
|
|
2597
|
+
const h = !n && r.leading;
|
|
2598
|
+
clearTimeout(n), n = setTimeout(() => {
|
|
2599
|
+
n = null;
|
|
2600
|
+
const m = r.leading ? a : l(this, b);
|
|
2601
|
+
s = null;
|
|
2602
|
+
for (const g of i) g(m);
|
|
2603
|
+
i = [];
|
|
2604
|
+
}, e), h ? (a = l(this, b), p(a)) : i.push(p);
|
|
2605
|
+
});
|
|
2606
|
+
}, u = (b) => {
|
|
2607
|
+
b && (clearTimeout(b), n = null);
|
|
2484
2608
|
};
|
|
2609
|
+
return d.isPending = () => !!n, d.cancel = () => {
|
|
2610
|
+
u(n), i = [], s = null;
|
|
2611
|
+
}, d.flush = () => {
|
|
2612
|
+
if (u(n), !s || o) return;
|
|
2613
|
+
const b = s;
|
|
2614
|
+
return s = null, l(this, b);
|
|
2615
|
+
}, d;
|
|
2485
2616
|
}
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2617
|
+
async function $r(t, e, r) {
|
|
2618
|
+
return await t.apply(e, r);
|
|
2619
|
+
}
|
|
2620
|
+
const Or = (t, e, r, a) => {
|
|
2621
|
+
const n = Math.max(t / r, e / a);
|
|
2622
|
+
let i = 0;
|
|
2623
|
+
if (t / r > e / a) {
|
|
2624
|
+
const o = n * a;
|
|
2625
|
+
i = 1 - e / o;
|
|
2492
2626
|
} else {
|
|
2493
|
-
const
|
|
2494
|
-
|
|
2627
|
+
const o = n * r;
|
|
2628
|
+
i = 1 - t / o;
|
|
2495
2629
|
}
|
|
2496
|
-
return
|
|
2630
|
+
return i < 0.1 ? "cover" : "contain";
|
|
2497
2631
|
};
|
|
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:
|
|
2632
|
+
function Vr(t, e, r, a) {
|
|
2633
|
+
const n = t / r, i = e / a, o = Math.max(n, i);
|
|
2634
|
+
if (n >= i) {
|
|
2635
|
+
const s = Math.round(e / o);
|
|
2636
|
+
return { x: 0, y: Math.round((a - s) / 2), width: r, height: s };
|
|
2503
2637
|
} else {
|
|
2504
|
-
const s = Math.round(
|
|
2505
|
-
return { x: Math.round((
|
|
2638
|
+
const s = Math.round(t / o);
|
|
2639
|
+
return { x: Math.round((r - s) / 2), y: 0, width: s, height: a };
|
|
2506
2640
|
}
|
|
2507
2641
|
}
|
|
2508
|
-
var
|
|
2509
|
-
const
|
|
2642
|
+
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>');
|
|
2643
|
+
const Ge = "capture-screen-host", Xe = () => {
|
|
2510
2644
|
const {
|
|
2511
|
-
cameraManager:
|
|
2645
|
+
cameraManager: t,
|
|
2512
2646
|
mountTarget: e,
|
|
2513
|
-
showCameraErrorModal:
|
|
2514
|
-
} =
|
|
2515
|
-
function
|
|
2516
|
-
const
|
|
2517
|
-
if (!
|
|
2647
|
+
showCameraErrorModal: r
|
|
2648
|
+
} = q(), [a, n] = I(), [i, o] = I(), [s, l] = I(), d = () => e.parentNode === document.body, [u, b] = I("contain");
|
|
2649
|
+
function p() {
|
|
2650
|
+
const h = a();
|
|
2651
|
+
if (!h)
|
|
2518
2652
|
return;
|
|
2519
|
-
const
|
|
2520
|
-
if (
|
|
2653
|
+
const m = h.clientWidth, g = h.clientHeight, S = h.videoWidth, T = h.videoHeight;
|
|
2654
|
+
if (S === 0 || T === 0)
|
|
2521
2655
|
return;
|
|
2522
|
-
const
|
|
2523
|
-
if (
|
|
2524
|
-
const
|
|
2525
|
-
|
|
2656
|
+
const v = Or(m, g, S, T);
|
|
2657
|
+
if (b(v), v === "cover") {
|
|
2658
|
+
const C = Vr(m, g, S, T);
|
|
2659
|
+
t.setExtractionArea(C);
|
|
2526
2660
|
} else
|
|
2527
|
-
|
|
2661
|
+
t.setExtractionArea({
|
|
2528
2662
|
x: 0,
|
|
2529
2663
|
y: 0,
|
|
2530
|
-
width:
|
|
2531
|
-
height:
|
|
2664
|
+
width: S,
|
|
2665
|
+
height: T
|
|
2532
2666
|
});
|
|
2533
2667
|
}
|
|
2534
|
-
return
|
|
2535
|
-
const
|
|
2536
|
-
if (!
|
|
2668
|
+
return K(() => {
|
|
2669
|
+
const h = a();
|
|
2670
|
+
if (!h)
|
|
2537
2671
|
return;
|
|
2538
|
-
const
|
|
2539
|
-
observe:
|
|
2540
|
-
unobserve:
|
|
2541
|
-
} =
|
|
2542
|
-
h
|
|
2543
|
-
|
|
2672
|
+
const m = Pr(p, 100), {
|
|
2673
|
+
observe: g,
|
|
2674
|
+
unobserve: S
|
|
2675
|
+
} = We(() => void m());
|
|
2676
|
+
g(h), h.addEventListener("resize", p), h.addEventListener("loadedmetadata", p), J(() => {
|
|
2677
|
+
m.cancel(), S(h), h.removeEventListener("resize", p), h.removeEventListener("loadedmetadata", p);
|
|
2544
2678
|
});
|
|
2545
|
-
}),
|
|
2546
|
-
const
|
|
2547
|
-
|
|
2548
|
-
owner:
|
|
2679
|
+
}), K(() => {
|
|
2680
|
+
const h = Re();
|
|
2681
|
+
h && ce.setState({
|
|
2682
|
+
owner: h
|
|
2549
2683
|
});
|
|
2550
|
-
}),
|
|
2551
|
-
const
|
|
2552
|
-
!
|
|
2553
|
-
feedbackLayer:
|
|
2554
|
-
overlayLayer:
|
|
2555
|
-
}),
|
|
2556
|
-
}), c(
|
|
2684
|
+
}), _e(() => {
|
|
2685
|
+
const h = a(), m = i(), g = s();
|
|
2686
|
+
!h || !m || !g || (ce.setState({
|
|
2687
|
+
feedbackLayer: m,
|
|
2688
|
+
overlayLayer: g
|
|
2689
|
+
}), t.initVideoElement(h));
|
|
2690
|
+
}), c(gr, {
|
|
2557
2691
|
get id() {
|
|
2558
|
-
return
|
|
2692
|
+
return d() ? void 0 : Ge;
|
|
2559
2693
|
},
|
|
2560
2694
|
get disableShadowRoot() {
|
|
2561
|
-
return
|
|
2695
|
+
return d();
|
|
2562
2696
|
},
|
|
2563
2697
|
get style() {
|
|
2564
|
-
return
|
|
2698
|
+
return d() ? {
|
|
2565
2699
|
height: "100%"
|
|
2566
2700
|
} : void 0;
|
|
2567
2701
|
},
|
|
2568
2702
|
get children() {
|
|
2569
2703
|
return [(() => {
|
|
2570
|
-
var
|
|
2571
|
-
return
|
|
2704
|
+
var h = ne();
|
|
2705
|
+
return y(h, vr), h;
|
|
2572
2706
|
})(), (() => {
|
|
2573
|
-
var
|
|
2574
|
-
return
|
|
2707
|
+
var h = ne();
|
|
2708
|
+
return y(h, br), h;
|
|
2575
2709
|
})(), (() => {
|
|
2576
|
-
var
|
|
2577
|
-
return
|
|
2710
|
+
var h = ne();
|
|
2711
|
+
return y(h, pr), h;
|
|
2578
2712
|
})(), (() => {
|
|
2579
|
-
var
|
|
2580
|
-
return V((
|
|
2581
|
-
window.__mbCameraManagerCssCode && (
|
|
2582
|
-
},
|
|
2713
|
+
var h = Br();
|
|
2714
|
+
return V((m) => {
|
|
2715
|
+
window.__mbCameraManagerCssCode && (m.innerHTML = window.__mbCameraManagerCssCode);
|
|
2716
|
+
}, h), h;
|
|
2583
2717
|
})(), (() => {
|
|
2584
|
-
var
|
|
2585
|
-
return
|
|
2586
|
-
when:
|
|
2718
|
+
var h = Ur(), m = h.firstChild, g = m.nextSibling, S = g.nextSibling;
|
|
2719
|
+
return y(h, c(hr, {}), m), V(n, m), V(o, g), V(l, S), y(h, c(x, {
|
|
2720
|
+
when: r,
|
|
2587
2721
|
get children() {
|
|
2588
|
-
return c(
|
|
2722
|
+
return c(Nr, {});
|
|
2589
2723
|
}
|
|
2590
|
-
}), null),
|
|
2724
|
+
}), null), Te((T) => (T = u()) != null ? m.style.setProperty("object-fit", T) : m.style.removeProperty("object-fit")), h;
|
|
2591
2725
|
})()];
|
|
2592
2726
|
}
|
|
2593
2727
|
});
|
|
2594
|
-
},
|
|
2728
|
+
}, qr = () => {
|
|
2595
2729
|
const {
|
|
2596
|
-
t
|
|
2597
|
-
} =
|
|
2598
|
-
addOnDismountCallback: a
|
|
2599
|
-
|
|
2730
|
+
t
|
|
2731
|
+
} = Z(), [e, r] = I(!0), {
|
|
2732
|
+
addOnDismountCallback: a,
|
|
2733
|
+
zIndex: n
|
|
2734
|
+
} = q();
|
|
2600
2735
|
return a(() => {
|
|
2601
|
-
|
|
2602
|
-
}), c(
|
|
2736
|
+
r(!1);
|
|
2737
|
+
}), c(ke, {
|
|
2603
2738
|
useShadow: !0,
|
|
2604
2739
|
get mount() {
|
|
2605
|
-
return document.getElementById(
|
|
2740
|
+
return document.getElementById(Qe);
|
|
2606
2741
|
},
|
|
2607
|
-
ref: (
|
|
2742
|
+
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
2743
|
get children() {
|
|
2609
|
-
return c(
|
|
2610
|
-
children: (
|
|
2744
|
+
return c(ee, {
|
|
2745
|
+
children: () => c(D.Root, {
|
|
2611
2746
|
get open() {
|
|
2612
2747
|
return e();
|
|
2613
2748
|
},
|
|
2614
|
-
lazyMount: !0,
|
|
2615
|
-
unmountOnExit: !0,
|
|
2616
|
-
initialFocusEl: () => n.querySelector('[role="dialog"]'),
|
|
2617
2749
|
get children() {
|
|
2618
|
-
return c(
|
|
2750
|
+
return c(D.Positioner, {
|
|
2619
2751
|
get children() {
|
|
2620
|
-
return c(
|
|
2621
|
-
"
|
|
2622
|
-
class: `h-vh supports-[(height:100dvh)]:h-dvh top-0 left-0 w-full
|
|
2623
|
-
fixed`,
|
|
2752
|
+
return c(D.Content, {
|
|
2753
|
+
class: "h-vh supports-[(height:100dvh)]:h-dvh top-0 left-0 w-full fixed",
|
|
2624
2754
|
get children() {
|
|
2625
|
-
return [c(
|
|
2755
|
+
return [c(D.Title, {
|
|
2626
2756
|
class: "sr-only",
|
|
2627
|
-
id: "dialog-title",
|
|
2628
2757
|
get children() {
|
|
2629
|
-
return
|
|
2758
|
+
return t.dialog_title;
|
|
2630
2759
|
}
|
|
2631
|
-
}), c(
|
|
2760
|
+
}), c(Xe, {})];
|
|
2632
2761
|
}
|
|
2633
2762
|
});
|
|
2634
2763
|
}
|
|
@@ -2638,71 +2767,73 @@ const Ve = "capture-screen-host", Ue = () => {
|
|
|
2638
2767
|
});
|
|
2639
2768
|
}
|
|
2640
2769
|
});
|
|
2641
|
-
},
|
|
2770
|
+
}, jr = () => {
|
|
2642
2771
|
const {
|
|
2643
|
-
mountTarget:
|
|
2644
|
-
} =
|
|
2645
|
-
return c(
|
|
2772
|
+
mountTarget: t
|
|
2773
|
+
} = q();
|
|
2774
|
+
return c(Ye, {
|
|
2646
2775
|
get component() {
|
|
2647
|
-
return
|
|
2776
|
+
return t.parentNode === document.body ? qr : Xe;
|
|
2648
2777
|
}
|
|
2649
2778
|
});
|
|
2650
|
-
},
|
|
2651
|
-
function
|
|
2652
|
-
localizationStrings:
|
|
2779
|
+
}, Qe = "camera-manager-mount-point";
|
|
2780
|
+
function na(t, e, {
|
|
2781
|
+
localizationStrings: r,
|
|
2653
2782
|
showMirrorCameraButton: a = !1,
|
|
2654
2783
|
showTorchButton: n = !0,
|
|
2655
|
-
showCloseButton:
|
|
2656
|
-
showCameraErrorModal:
|
|
2784
|
+
showCloseButton: i = !0,
|
|
2785
|
+
showCameraErrorModal: o = !0,
|
|
2786
|
+
zIndex: s
|
|
2657
2787
|
} = {}) {
|
|
2658
|
-
let
|
|
2659
|
-
const
|
|
2660
|
-
let
|
|
2661
|
-
const
|
|
2662
|
-
|
|
2788
|
+
let l;
|
|
2789
|
+
const d = /* @__PURE__ */ new Set();
|
|
2790
|
+
let u;
|
|
2791
|
+
const b = (v) => {
|
|
2792
|
+
u = v;
|
|
2663
2793
|
}, p = () => {
|
|
2664
|
-
|
|
2794
|
+
t.reset();
|
|
2665
2795
|
};
|
|
2666
|
-
let
|
|
2796
|
+
let h;
|
|
2667
2797
|
const m = () => {
|
|
2668
2798
|
try {
|
|
2669
2799
|
console.debug("🧱 Dismounting camera manager UI");
|
|
2670
|
-
for (const v of
|
|
2800
|
+
for (const v of d)
|
|
2671
2801
|
v();
|
|
2672
|
-
|
|
2802
|
+
d.clear(), p(), requestAnimationFrame(() => {
|
|
2673
2803
|
requestAnimationFrame(() => {
|
|
2674
|
-
|
|
2804
|
+
h && h(), l.remove(), p();
|
|
2675
2805
|
});
|
|
2676
2806
|
});
|
|
2677
2807
|
} catch (v) {
|
|
2678
2808
|
console.warn("Error while dismounting camera manager UI", v);
|
|
2679
2809
|
}
|
|
2680
|
-
},
|
|
2681
|
-
|
|
2682
|
-
const
|
|
2683
|
-
|
|
2810
|
+
}, g = document.createElement("div");
|
|
2811
|
+
g.id = Qe, l = g, e ? e.appendChild(g) : document.body.appendChild(g);
|
|
2812
|
+
const S = (v) => (d.add(v), () => {
|
|
2813
|
+
d.delete(v);
|
|
2684
2814
|
});
|
|
2685
|
-
|
|
2686
|
-
userStrings:
|
|
2687
|
-
setLocalizationRef:
|
|
2815
|
+
h = Je(() => c(Ht, {
|
|
2816
|
+
userStrings: r,
|
|
2817
|
+
setLocalizationRef: b,
|
|
2688
2818
|
get children() {
|
|
2689
|
-
return c(
|
|
2690
|
-
addOnDismountCallback:
|
|
2819
|
+
return c(qt, {
|
|
2820
|
+
addOnDismountCallback: S,
|
|
2691
2821
|
dismountCameraUi: m,
|
|
2692
|
-
cameraManager:
|
|
2822
|
+
cameraManager: t,
|
|
2693
2823
|
showMirrorCameraButton: a,
|
|
2694
2824
|
showTorchButton: n,
|
|
2695
|
-
showCloseButton:
|
|
2696
|
-
showCameraErrorModal:
|
|
2697
|
-
|
|
2825
|
+
showCloseButton: i,
|
|
2826
|
+
showCameraErrorModal: o,
|
|
2827
|
+
zIndex: s,
|
|
2828
|
+
mountTarget: l,
|
|
2698
2829
|
get children() {
|
|
2699
|
-
return c(
|
|
2830
|
+
return c(jr, {});
|
|
2700
2831
|
}
|
|
2701
2832
|
});
|
|
2702
2833
|
}
|
|
2703
|
-
}),
|
|
2704
|
-
const
|
|
2705
|
-
updateLocalization:
|
|
2834
|
+
}), l);
|
|
2835
|
+
const T = {
|
|
2836
|
+
updateLocalization: u,
|
|
2706
2837
|
/**
|
|
2707
2838
|
* Adds a callback to be called when the component is unmounted.
|
|
2708
2839
|
* Returns a cleanup function that removes the callback when called.
|
|
@@ -2710,65 +2841,65 @@ function oa(r, e, {
|
|
|
2710
2841
|
* @param fn - The callback function to be called when the component is unmounted
|
|
2711
2842
|
* @returns A cleanup function that removes the callback when called
|
|
2712
2843
|
*/
|
|
2713
|
-
addOnDismountCallback:
|
|
2714
|
-
cameraManager:
|
|
2844
|
+
addOnDismountCallback: S,
|
|
2845
|
+
cameraManager: t,
|
|
2715
2846
|
// we know these are defined because `createCameraManagerUi` resolves when they are defined
|
|
2716
2847
|
// TODO: maybe don't use getters but make sure they are defined
|
|
2717
2848
|
get feedbackLayerNode() {
|
|
2718
|
-
return
|
|
2849
|
+
return O.getState().feedbackLayer;
|
|
2719
2850
|
},
|
|
2720
2851
|
get overlayLayerNode() {
|
|
2721
|
-
return
|
|
2852
|
+
return O.getState().overlayLayer;
|
|
2722
2853
|
},
|
|
2723
2854
|
get owner() {
|
|
2724
|
-
return
|
|
2855
|
+
return O.getState().owner;
|
|
2725
2856
|
},
|
|
2726
2857
|
dismount: m
|
|
2727
2858
|
};
|
|
2728
2859
|
return new Promise((v) => {
|
|
2729
|
-
let
|
|
2730
|
-
}, G = () => {
|
|
2860
|
+
let C = !1, M = !1, L = !1, G = () => {
|
|
2731
2861
|
}, X = () => {
|
|
2862
|
+
}, me = () => {
|
|
2732
2863
|
};
|
|
2733
|
-
const
|
|
2734
|
-
|
|
2864
|
+
const te = () => {
|
|
2865
|
+
C && M && L && (G(), X(), me(), v(T));
|
|
2735
2866
|
};
|
|
2736
|
-
|
|
2737
|
-
R && (
|
|
2867
|
+
G = O.subscribe((R) => R.feedbackLayer, (R) => {
|
|
2868
|
+
R && (M = !0), te();
|
|
2738
2869
|
}, {
|
|
2739
2870
|
fireImmediately: !0
|
|
2740
|
-
}),
|
|
2741
|
-
R && (
|
|
2871
|
+
}), X = O.subscribe((R) => R.overlayLayer, (R) => {
|
|
2872
|
+
R && (L = !0), te();
|
|
2742
2873
|
}, {
|
|
2743
2874
|
fireImmediately: !0
|
|
2744
|
-
}),
|
|
2745
|
-
R && (
|
|
2875
|
+
}), me = t.subscribe((R) => R.videoElement, (R) => {
|
|
2876
|
+
R && (C = !0, te());
|
|
2746
2877
|
}, {
|
|
2747
2878
|
fireImmediately: !0
|
|
2748
2879
|
});
|
|
2749
2880
|
});
|
|
2750
2881
|
}
|
|
2751
|
-
const
|
|
2752
|
-
globalThis.__CAMERA_MANAGER__ ||=
|
|
2753
|
-
globalThis.__CAMERA_MANAGER__ !==
|
|
2882
|
+
const Ke = Symbol();
|
|
2883
|
+
globalThis.__CAMERA_MANAGER__ ||= Ke;
|
|
2884
|
+
globalThis.__CAMERA_MANAGER__ !== Ke && console.warn(
|
|
2754
2885
|
"Detected multiple instances of @microblink/camera-manager. This can lead to unexpected behavior."
|
|
2755
2886
|
);
|
|
2756
2887
|
export {
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2888
|
+
$e as Camera,
|
|
2889
|
+
B as CameraError,
|
|
2890
|
+
aa as CameraManager,
|
|
2891
|
+
Qe as MOUNT_POINT_ID,
|
|
2892
|
+
Vt as VideoFrameProcessor,
|
|
2893
|
+
f as cameraManagerStore,
|
|
2894
|
+
O as cameraUiRefStore,
|
|
2895
|
+
na as createCameraManagerUi,
|
|
2896
|
+
Bt as defaultCameraManagerOptions,
|
|
2897
|
+
Mt as findResolutionKey,
|
|
2898
|
+
Ue as getBuffer,
|
|
2899
|
+
Tt as getNormalizedResolution,
|
|
2769
2900
|
le as isBufferDetached,
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
|
|
2901
|
+
xt as matchClosestResolution,
|
|
2902
|
+
Rt as resetCameraManagerStore,
|
|
2903
|
+
kt as returnLongerSide,
|
|
2773
2904
|
P as videoResolutions
|
|
2774
2905
|
};
|