@microblink/camera-manager 7.2.3 → 7.2.5

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.
@@ -1,54 +1,36 @@
1
- (function() {
2
- "use strict";
3
- ((cssCode) => {
4
- window.__mbCameraManagerCssCode = cssCode;
5
- })("._dialogPositioner_worsp_1 {\n 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);\n}@supports (height:100dvh){._dialogPositioner_worsp_1{height:100dvh;}}\n\n._dialogBackdrop_worsp_5 {\n 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)) /* rgb(var(--color-black-rgb-value) / <alpha-value>) */;--un-bg-opacity:0.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);\n}\n\n._dialogContent_worsp_9 {\n position:relative;max-height:calc(100dvh - 4rem);max-width:28rem;display:flex;flex-direction:column;place-self:center;border-radius:0.5rem;--un-bg-opacity:1;background-color:rgb(var(--color-white-rgb-value) / var(--un-bg-opacity)) /* rgb(var(--color-white-rgb-value) / <alpha-value>) */;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)) /* #0f0f0f */;--un-shadow:var(--un-shadow-inset) 0 10px 15px -3px var(--un-shadow-color, rgb(0 0 0 / 0.1)),var(--un-shadow-inset) 0 4px 6px -4px var(--un-shadow-color, rgb(0 0 0 / 0.1));box-shadow:var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow);\n}\n._dialogContent_worsp_9._large_worsp_13 {\n padding-left:min(8%,4rem);padding-right:min(8%,4rem);padding-top:min(8%,3rem);padding-bottom:min(8%,3rem);\n}\n._dialogContent_worsp_9._compact_worsp_16 {\n padding:min(8%,1.5rem);\n}\n@media (min-width: 640px){\n ._dialogContent_worsp_9 {\n max-width:36rem;\n }\n}\n@media (min-width: 1024px){\n ._dialogContent_worsp_9 {\n max-width:28rem;\n }\n}\n\n._dialogTitle_worsp_30 {\n text-align:center;font-size:calc(var(--mb-size)*1.5rem);line-height:calc(var(--mb-size)*2rem);font-weight:700;\n}\n\n._contentOut_worsp_34 {\n overflow-y:auto;\n}\n\n._closeButton_worsp_38 {\n position:absolute;top:0.625rem;right:0.625rem;width:calc(var(--mb-size)*2rem);height:calc(var(--mb-size)*2rem);display:flex;align-items:center;justify-content:center;border-radius:9999px;border-style:none;background-color:transparent /* transparent */;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;transition-duration:100ms;\n}._closeButton_worsp_38:hover{--un-bg-opacity:1;background-color:rgb(var(--color-gray-100-rgb-value) / var(--un-bg-opacity)) /* rgb(var(--color-gray-100-rgb-value) / <alpha-value>) */;}._closeButton_worsp_38:active{--un-bg-opacity:1;background-color:rgb(var(--color-gray-200-rgb-value) / var(--un-bg-opacity)) /* rgb(var(--color-gray-200-rgb-value) / <alpha-value>) */;}\n\n._closeButtonInner_worsp_44 {\n display:flex;--un-translate-y:-2px;transform:translateX(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)) rotateZ(var(--un-rotate-z)) skewX(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z));align-items:center;justify-content:center;font-size:calc(var(--mb-size)*1.875rem);line-height:calc(var(--mb-size)*2.25rem);--un-text-opacity:1;color:rgb(var(--color-black-rgb-value) / var(--un-text-opacity)) /* rgb(var(--color-black-rgb-value) / <alpha-value>) */;font-weight:200;line-height:1;\n}\n\n._primaryActionButton_worsp_49 {\n 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)) /* rgb(var(--color-primary) / <alpha-value>) */;padding-left:calc(var(--mb-size)*1.25rem);padding-right:calc(var(--mb-size)*1.25rem);padding-top:calc(var(--mb-size)*0.25rem);padding-bottom:calc(var(--mb-size)*0.25rem);text-wrap:nowrap;font-size:calc(var(--mb-size)*0.875rem);line-height:calc(var(--mb-size)*1.25rem);--un-text-opacity:1;color:rgb(var(--color-white-rgb-value) / var(--un-text-opacity)) /* rgb(var(--color-white-rgb-value) / <alpha-value>) */;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;transition-duration:100ms;\n}._primaryActionButton_worsp_49[disabled]{cursor:not-allowed;--un-bg-opacity:1;background-color:rgb(var(--color-gray-200-rgb-value) / var(--un-bg-opacity)) /* rgb(var(--color-gray-200-rgb-value) / <alpha-value>) */;--un-text-opacity:1;color:rgb(var(--color-gray-500-rgb-value) / var(--un-text-opacity)) /* rgb(var(--color-gray-500-rgb-value) / <alpha-value>) */;--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_worsp_49[disabled]:hover{--un-bg-opacity:1;background-color:rgb(var(--color-gray-200-rgb-value) / var(--un-bg-opacity)) /* rgb(var(--color-gray-200-rgb-value) / <alpha-value>) */;--un-text-opacity:1;color:rgb(var(--color-gray-500-rgb-value) / var(--un-text-opacity)) /* rgb(var(--color-gray-500-rgb-value) / <alpha-value>) */;}._primaryActionButton_worsp_49:hover{--un-bg-opacity:1;background-color:rgb(var(--color-accent-700-rgb-value) / var(--un-bg-opacity)) /* rgb(var(--color-accent-700-rgb-value) / <alpha-value>) */;}._primaryActionButton_worsp_49:active{--un-bg-opacity:1;background-color:rgb(var(--color-accent-800-rgb-value) / var(--un-bg-opacity)) /* rgb(var(--color-accent-800-rgb-value) / <alpha-value>) */;}._primaryActionButton_worsp_49:focus{outline-width:2px;--un-outline-color-opacity:1;outline-color:rgb(var(--color-accent-400-rgb-value) / var(--un-outline-color-opacity)) /* rgb(var(--color-accent-400-rgb-value) / <alpha-value>) */;outline-offset:4px;outline-style:solid;}\n\n._secondaryActionButton_worsp_53 {\n height:2.5rem;-webkit-appearance:none;appearance:none;border-radius:calc(var(--mb-size)*2.5rem);border-style:none;background-color:transparent /* transparent */;padding-left:calc(var(--mb-size)*1.25rem);padding-right:calc(var(--mb-size)*1.25rem);padding-top:calc(var(--mb-size)*0.25rem);padding-bottom:calc(var(--mb-size)*0.25rem);text-wrap:nowrap;font-size:calc(var(--mb-size)*0.875rem);line-height:calc(var(--mb-size)*1.25rem);--un-text-opacity:1;color:rgb(var(--color-primary) / var(--un-text-opacity)) /* rgb(var(--color-primary) / <alpha-value>) */;--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)) /* rgb(var(--color-primary) / <alpha-value>) */;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;transition-duration:100ms;\n}._secondaryActionButton_worsp_53[disabled]{cursor:not-allowed;--un-bg-opacity:1;background-color:rgb(var(--color-gray-200-rgb-value) / var(--un-bg-opacity)) /* rgb(var(--color-gray-200-rgb-value) / <alpha-value>) */;--un-text-opacity:1;color:rgb(var(--color-gray-500-rgb-value) / var(--un-text-opacity)) /* rgb(var(--color-gray-500-rgb-value) / <alpha-value>) */;--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_worsp_53[disabled]:hover{--un-bg-opacity:1;background-color:rgb(var(--color-gray-200-rgb-value) / var(--un-bg-opacity)) /* rgb(var(--color-gray-200-rgb-value) / <alpha-value>) */;--un-text-opacity:1;color:rgb(var(--color-gray-500-rgb-value) / var(--un-text-opacity)) /* rgb(var(--color-gray-500-rgb-value) / <alpha-value>) */;}._secondaryActionButton_worsp_53:hover{--un-bg-opacity:1;background-color:rgb(var(--color-accent-25-rgb-value) / var(--un-bg-opacity)) /* rgb(var(--color-accent-25-rgb-value) / <alpha-value>) */;--un-text-opacity:1;color:rgb(var(--color-accent-700-rgb-value) / var(--un-text-opacity)) /* rgb(var(--color-accent-700-rgb-value) / <alpha-value>) */;--un-ring-opacity:1;--un-ring-color:rgb(var(--color-accent-700-rgb-value) / var(--un-ring-opacity)) /* rgb(var(--color-accent-700-rgb-value) / <alpha-value>) */;}._secondaryActionButton_worsp_53:active{--un-bg-opacity:1;background-color:rgb(var(--color-accent-50-rgb-value) / var(--un-bg-opacity)) /* rgb(var(--color-accent-50-rgb-value) / <alpha-value>) */;--un-text-opacity:1;color:rgb(var(--color-accent-800-rgb-value) / var(--un-text-opacity)) /* rgb(var(--color-accent-800-rgb-value) / <alpha-value>) */;--un-ring-opacity:1;--un-ring-color:rgb(var(--color-accent-800-rgb-value) / var(--un-ring-opacity)) /* rgb(var(--color-accent-800-rgb-value) / <alpha-value>) */;}._secondaryActionButton_worsp_53:focus{outline-width:2px;--un-outline-color-opacity:1;outline-color:rgb(var(--color-accent-400-rgb-value) / var(--un-outline-color-opacity)) /* rgb(var(--color-accent-400-rgb-value) / <alpha-value>) */;outline-offset:4px;outline-style:solid;}\n\n._actions_worsp_57 {\n display:flex;gap:calc(var(--mb-size)*1rem);\n}\n._actions_worsp_57 ._primaryActionButton_worsp_49, ._actions_worsp_57 ._secondaryActionButton_worsp_53 {\n width:50%;\n}\n\n._alertTitle_worsp_64 {\n 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)) /* rgb(var(--color-gray-700-rgb-value) / <alpha-value>) */;font-weight:400;\n}\n\n._alertText_worsp_68 {\n margin-top:calc(var(--mb-size)*1rem);margin-bottom:calc(var(--mb-size)*2rem);padding-left:calc(var(--mb-size)*0.5rem);padding-right:calc(var(--mb-size)*0.5rem);text-align:center;text-wrap:pretty;--un-text-opacity:1;color:rgb(var(--color-gray-500-rgb-value) / var(--un-text-opacity)) /* rgb(var(--color-gray-500-rgb-value) / <alpha-value>) */;font-weight:300;line-height:1.5;\n} *,::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 / 0.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 / 0.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: ;}.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;}.pointer-events-none{pointer-events:none;}.absolute{position:absolute;}.fixed{position:fixed;}.relative{position:relative;}.left-0{left:calc(var(--mb-size)*0rem);}.right-0{right:calc(var(--mb-size)*0rem);}.right-4{right:calc(var(--mb-size)*1rem);}.top-\\[-1px\\]{top:-1px;}.top-0{top:calc(var(--mb-size)*0rem);}.z-1{z-index:1;}.has-\\[\\[data-scope\\]\\]\\:z-2:has([data-scope]),.z-2{z-index:2;}.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-\\[1px\\]{height:1px;}.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-nowrap{flex-wrap:nowrap;}.data-\\[state\\=open\\]\\:scale-y-\\[-1\\][data-state=open]{--un-scale-y:-1;transform:translateX(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)) rotateZ(var(--un-rotate-z)) skewX(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:translateX(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)) rotateZ(var(--un-rotate-z)) skewX(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)*0.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;}.rounded-4{border-radius:calc(var(--mb-size)*1rem);}.rounded-full{border-radius:9999px;}.rounded-md{border-radius:0.375rem;}.border-none{border-style:none;}.bg-dark-100\\/50{background-color:rgb(60 60 60 / 0.5) /* #3c3c3c */;}.bg-dark-500{--un-bg-opacity:1;background-color:rgb(31 31 31 / var(--un-bg-opacity)) /* #1f1f1f */;}.data-\\[highlighted\\]\\:bg-gray-500\\/50[data-highlighted]{background-color:rgb(var(--color-gray-500-rgb-value) / 0.5) /* rgb(var(--color-gray-500-rgb-value) / <alpha-value>) */;}.bg-white{--un-bg-opacity:1;background-color:rgb(var(--color-white-rgb-value) / var(--un-bg-opacity)) /* rgb(var(--color-white-rgb-value) / <alpha-value>) */;}.bg-opacity-50{--un-bg-opacity:0.5;}.p-2{padding:calc(var(--mb-size)*0.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)*0.5rem);padding-bottom:calc(var(--mb-size)*0.5rem);}.py-3{padding-top:calc(var(--mb-size)*0.75rem);padding-bottom:calc(var(--mb-size)*0.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)*0.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)) /* rgb(var(--color-white-rgb-value) / <alpha-value>) */;}.font-500{font-weight:500;}.disabled\\:opacity-50:disabled{opacity:0.5;}.shadow{--un-shadow:var(--un-shadow-inset) 0 1px 3px 0 var(--un-shadow-color, rgb(0 0 0 / 0.1)),var(--un-shadow-inset) 0 1px 2px -1px var(--un-shadow-color, rgb(0 0 0 / 0.1));box-shadow:var(--un-ring-offset-shadow), var(--un-ring-shadow), var(--un-shadow);}.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 / 0.07))) drop-shadow(0 2px 2px var(--un-drop-shadow-color, rgb(0 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(0.4, 0, 0.2, 1);transition-duration:150ms;}.duration-300{transition-duration:300ms;}.ease-in-out{transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);}@keyframes __un_qm{0%{box-shadow:inset 4px 4px #ff1e90, inset -4px -4px #ff1e90}100%{box-shadow:inset 8px 8px #3399ff, inset -8px -8px #3399ff}} .\\?{animation:__un_qm 0.5s ease-in-out alternate infinite;}.lerp\\:px-3\\@xs\\,8\\@lg{padding-inline:clamp(calc(var(--mb-size)*0.75rem), calc(var(--mb-size)*0.75rem) + (100vw - 380px) * 0.031055900621118012, calc(var(--mb-size)*2rem));}@supports (height:100dvh){.supports-\\[\\(height\\:100dvh\\)\\]\\:h-dvh{height:100dvh;}}");
6
- })();
7
- import { subscribeWithSelector } from "zustand/middleware";
8
- import { createStore } from "zustand/vanilla";
9
- import { createComponent, use, template, spread, mergeProps, insert, memo, isServer, delegateEvents, effect, className, Portal, Dynamic, render } from "solid-js/web";
10
- import { createContext, onCleanup, useContext, onMount, createSignal, Show, Index, createRoot, getOwner, splitProps, createEffect } from "solid-js";
11
- import { createWithSignal } from "solid-zustand";
12
- import { createStore as createStore$1 } from "solid-js/store";
13
- import { EnvironmentProvider } from "@ark-ui/solid/environment";
14
- import { Dialog } from "@ark-ui/solid/dialog";
15
- import { Select, createListCollection } from "@ark-ui/solid/select";
16
- import { Tooltip } from "@ark-ui/solid/tooltip";
17
- if (typeof HTMLVideoElement !== "undefined" && !("requestVideoFrameCallback" in HTMLVideoElement.prototype) && "getVideoPlaybackQuality" in HTMLVideoElement.prototype) {
18
- HTMLVideoElement.prototype._rvfcpolyfillmap = {};
19
- HTMLVideoElement.prototype.requestVideoFrameCallback = function(callback) {
20
- const handle = performance.now();
21
- const quality = this.getVideoPlaybackQuality();
22
- const baseline = this.mozPresentedFrames || this.mozPaintedFrames || quality.totalVideoFrames - quality.droppedVideoFrames;
23
- const check = (old, now) => {
24
- const newquality = this.getVideoPlaybackQuality();
25
- const presentedFrames = this.mozPresentedFrames || this.mozPaintedFrames || newquality.totalVideoFrames - newquality.droppedVideoFrames;
26
- if (presentedFrames > baseline) {
27
- const processingDuration = this.mozFrameDelay || newquality.totalFrameDelay - quality.totalFrameDelay || 0;
28
- const timediff = now - old;
29
- callback(now, {
30
- presentationTime: now + processingDuration * 1e3,
31
- expectedDisplayTime: now + timediff,
32
- width: this.videoWidth,
33
- height: this.videoHeight,
34
- mediaTime: Math.max(0, this.currentTime || 0) + timediff / 1e3,
35
- presentedFrames,
36
- processingDuration
37
- });
38
- delete this._rvfcpolyfillmap[handle];
39
- } else {
40
- this._rvfcpolyfillmap[handle] = requestAnimationFrame((newer) => check(now, newer));
41
- }
42
- };
43
- this._rvfcpolyfillmap[handle] = requestAnimationFrame((newer) => check(handle, newer));
44
- return handle;
1
+ (function(){"use strict";(r=>{window.__mbCameraManagerCssCode=r})("._dialogPositioner_worsp_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_worsp_1{height:100dvh}}._dialogBackdrop_worsp_5{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_worsp_9{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_worsp_9._large_worsp_13{padding-left:min(8%,4rem);padding-right:min(8%,4rem);padding-top:min(8%,3rem);padding-bottom:min(8%,3rem)}._dialogContent_worsp_9._compact_worsp_16{padding:min(8%,1.5rem)}@media (min-width: 640px){._dialogContent_worsp_9{max-width:36rem}}@media (min-width: 1024px){._dialogContent_worsp_9{max-width:28rem}}._dialogTitle_worsp_30{text-align:center;font-size:calc(var(--mb-size)*1.5rem);line-height:calc(var(--mb-size)*2rem);font-weight:700}._contentOut_worsp_34{overflow-y:auto}._closeButton_worsp_38{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-radius:9999px;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_worsp_38:hover{--un-bg-opacity:1;background-color:rgb(var(--color-gray-100-rgb-value) / var(--un-bg-opacity))}._closeButton_worsp_38:active{--un-bg-opacity:1;background-color:rgb(var(--color-gray-200-rgb-value) / var(--un-bg-opacity))}._closeButtonInner_worsp_44{display:flex;--un-translate-y:-2px;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));align-items:center;justify-content:center;font-size:calc(var(--mb-size)*1.875rem);line-height:calc(var(--mb-size)*2.25rem);--un-text-opacity:1;color:rgb(var(--color-black-rgb-value) / var(--un-text-opacity));font-weight:200;line-height:1}._primaryActionButton_worsp_49{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_worsp_49[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_worsp_49[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_worsp_49:hover{--un-bg-opacity:1;background-color:rgb(var(--color-accent-700-rgb-value) / var(--un-bg-opacity))}._primaryActionButton_worsp_49:active{--un-bg-opacity:1;background-color:rgb(var(--color-accent-800-rgb-value) / var(--un-bg-opacity))}._primaryActionButton_worsp_49:focus{outline-width:2px;--un-outline-color-opacity:1;outline-color:rgb(var(--color-accent-400-rgb-value) / var(--un-outline-color-opacity));outline-offset:4px;outline-style:solid}._secondaryActionButton_worsp_53{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_worsp_53[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_worsp_53[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_worsp_53: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_worsp_53: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_worsp_53:focus{outline-width:2px;--un-outline-color-opacity:1;outline-color:rgb(var(--color-accent-400-rgb-value) / var(--un-outline-color-opacity));outline-offset:4px;outline-style:solid}._actions_worsp_57{display:flex;gap:calc(var(--mb-size)*1rem)}._actions_worsp_57 ._primaryActionButton_worsp_49,._actions_worsp_57 ._secondaryActionButton_worsp_53{width:50%}._alertTitle_worsp_64{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_worsp_68{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: }.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}.pointer-events-none{pointer-events:none}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.left-0{left:calc(var(--mb-size)*0rem)}.right-0{right:calc(var(--mb-size)*0rem)}.right-4{right:calc(var(--mb-size)*1rem)}.top-\\[-1px\\]{top:-1px}.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-\\[1px\\]{height:1px}.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-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}.rounded-4{border-radius:calc(var(--mb-size)*1rem)}.rounded-full{border-radius:9999px}.rounded-md{border-radius:.375rem}.border-none{border-style:none}.bg-dark-100\\/50{background-color:#3c3c3c80}.bg-dark-500{--un-bg-opacity:1;background-color:rgb(31 31 31 / var(--un-bg-opacity))}.bg-white{--un-bg-opacity:1;background-color:rgb(var(--color-white-rgb-value) / var(--un-bg-opacity))}.data-\\[highlighted\\]\\:bg-gray-500\\/50[data-highlighted]{background-color:rgb(var(--color-gray-500-rgb-value) / .5)}.bg-opacity-50{--un-bg-opacity:.5}.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)}.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}}")})();
2
+ import { subscribeWithSelector as ge } from "zustand/middleware";
3
+ import { createStore as be } from "zustand/vanilla";
4
+ import { createComponent as s, use as B, template as S, spread as F, mergeProps as Y, insert as y, memo as pe, isServer as Ue, delegateEvents as qe, effect as H, className as V, Portal as ve, Dynamic as je, render as He } from "solid-js/web";
5
+ import { createContext as we, onCleanup as ce, useContext as ye, onMount as J, createSignal as z, Show as E, Index as We, createRoot as Ge, getOwner as Se, splitProps as Xe, createEffect as Qe } from "solid-js";
6
+ import { createWithSignal as Ce } from "solid-zustand";
7
+ import { createStore as Ke } from "solid-js/store";
8
+ import { EnvironmentProvider as Ye } from "@ark-ui/solid/environment";
9
+ import { Dialog as $ } from "@ark-ui/solid/dialog";
10
+ import { Select as A, createListCollection as Je } from "@ark-ui/solid/select";
11
+ import { Tooltip as Q } from "@ark-ui/solid/tooltip";
12
+ typeof HTMLVideoElement < "u" && !("requestVideoFrameCallback" in HTMLVideoElement.prototype) && "getVideoPlaybackQuality" in HTMLVideoElement.prototype && (HTMLVideoElement.prototype._rvfcpolyfillmap = {}, HTMLVideoElement.prototype.requestVideoFrameCallback = function(t) {
13
+ const e = performance.now(), r = this.getVideoPlaybackQuality(), a = this.mozPresentedFrames || this.mozPaintedFrames || r.totalVideoFrames - r.droppedVideoFrames, n = (o, i) => {
14
+ const l = this.getVideoPlaybackQuality(), c = this.mozPresentedFrames || this.mozPaintedFrames || l.totalVideoFrames - l.droppedVideoFrames;
15
+ if (c > a) {
16
+ const d = this.mozFrameDelay || l.totalFrameDelay - r.totalFrameDelay || 0, h = i - o;
17
+ t(i, {
18
+ presentationTime: i + d * 1e3,
19
+ expectedDisplayTime: i + h,
20
+ width: this.videoWidth,
21
+ height: this.videoHeight,
22
+ mediaTime: Math.max(0, this.currentTime || 0) + h / 1e3,
23
+ presentedFrames: c,
24
+ processingDuration: d
25
+ }), delete this._rvfcpolyfillmap[e];
26
+ } else
27
+ this._rvfcpolyfillmap[e] = requestAnimationFrame((d) => n(i, d));
45
28
  };
46
- HTMLVideoElement.prototype.cancelVideoFrameCallback = function(handle) {
47
- cancelAnimationFrame(this._rvfcpolyfillmap[handle]);
48
- delete this._rvfcpolyfillmap[handle];
49
- };
50
- }
51
- const backCameraKeywords = [
29
+ return this._rvfcpolyfillmap[e] = requestAnimationFrame((o) => n(e, o)), e;
30
+ }, HTMLVideoElement.prototype.cancelVideoFrameCallback = function(t) {
31
+ cancelAnimationFrame(this._rvfcpolyfillmap[t]), delete this._rvfcpolyfillmap[t];
32
+ });
33
+ const Ze = [
52
34
  // English
53
35
  "back",
54
36
  "rear",
@@ -119,8 +101,7 @@ const backCameraKeywords = [
119
101
  "बैक",
120
102
  // Latin American Spanish
121
103
  "posterior"
122
- ];
123
- const frontCameraKeywords = [
104
+ ], et = [
124
105
  // English
125
106
  "front",
126
107
  // German
@@ -187,66 +168,38 @@ const frontCameraKeywords = [
187
168
  "फ्रंट",
188
169
  // Latin American Spanish
189
170
  "frontal"
190
- ];
191
- const containsKeyword = (string, keywords) => {
192
- return keywords.some((keyword) => string.toLowerCase().includes(keyword));
193
- };
194
- const isBackCameraName = (string) => containsKeyword(string, backCameraKeywords);
195
- const isFrontCameraName = (string) => containsKeyword(string, frontCameraKeywords);
196
- var _createClass = /* @__PURE__ */ function() {
197
- function defineProperties(target, props) {
198
- for (var i = 0; i < props.length; i++) {
199
- var descriptor = props[i];
200
- descriptor.enumerable = descriptor.enumerable || false;
201
- descriptor.configurable = true;
202
- if ("value" in descriptor) descriptor.writable = true;
203
- Object.defineProperty(target, descriptor.key, descriptor);
171
+ ], ke = (t, e) => e.some((r) => t.toLowerCase().includes(r)), Ee = (t) => ke(t, Ze), _e = (t) => ke(t, et);
172
+ var tt = /* @__PURE__ */ function() {
173
+ function t(e, r) {
174
+ for (var a = 0; a < r.length; a++) {
175
+ var n = r[a];
176
+ n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, n.key, n);
204
177
  }
205
178
  }
206
- return function(Constructor, protoProps, staticProps) {
207
- if (protoProps) defineProperties(Constructor.prototype, protoProps);
208
- if (staticProps) defineProperties(Constructor, staticProps);
209
- return Constructor;
179
+ return function(e, r, a) {
180
+ return r && t(e.prototype, r), a && t(e, a), e;
210
181
  };
211
- }();
212
- var _templateObject = _taggedTemplateLiteral(["", ""], ["", ""]);
213
- function _taggedTemplateLiteral(strings, raw) {
214
- return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } }));
182
+ }(), rt = at(["", ""], ["", ""]);
183
+ function at(t, e) {
184
+ return Object.freeze(Object.defineProperties(t, { raw: { value: Object.freeze(e) } }));
215
185
  }
216
- function _classCallCheck(instance, Constructor) {
217
- if (!(instance instanceof Constructor)) {
186
+ function nt(t, e) {
187
+ if (!(t instanceof e))
218
188
  throw new TypeError("Cannot call a class as a function");
219
- }
220
189
  }
221
- var TemplateTag = function() {
222
- function TemplateTag2() {
223
- var _this = this;
224
- for (var _len = arguments.length, transformers = Array(_len), _key = 0; _key < _len; _key++) {
225
- transformers[_key] = arguments[_key];
226
- }
227
- _classCallCheck(this, TemplateTag2);
228
- this.tag = function(strings) {
229
- for (var _len2 = arguments.length, expressions = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
230
- expressions[_key2 - 1] = arguments[_key2];
231
- }
232
- if (typeof strings === "function") {
233
- return _this.interimTag.bind(_this, strings);
234
- }
235
- if (typeof strings === "string") {
236
- return _this.transformEndResult(strings);
237
- }
238
- strings = strings.map(_this.transformString.bind(_this));
239
- return _this.transformEndResult(strings.reduce(_this.processSubstitutions.bind(_this, expressions)));
240
- };
241
- if (transformers.length > 0 && Array.isArray(transformers[0])) {
242
- transformers = transformers[0];
243
- }
244
- this.transformers = transformers.map(function(transformer) {
245
- return typeof transformer === "function" ? transformer() : transformer;
246
- });
247
- return this.tag;
248
- }
249
- _createClass(TemplateTag2, [{
190
+ var T = function() {
191
+ function t() {
192
+ for (var e = this, r = arguments.length, a = Array(r), n = 0; n < r; n++)
193
+ a[n] = arguments[n];
194
+ return nt(this, t), this.tag = function(o) {
195
+ for (var i = arguments.length, l = Array(i > 1 ? i - 1 : 0), c = 1; c < i; c++)
196
+ l[c - 1] = arguments[c];
197
+ return typeof o == "function" ? e.interimTag.bind(e, o) : typeof o == "string" ? e.transformEndResult(o) : (o = o.map(e.transformString.bind(e)), e.transformEndResult(o.reduce(e.processSubstitutions.bind(e, l))));
198
+ }, a.length > 0 && Array.isArray(a[0]) && (a = a[0]), this.transformers = a.map(function(o) {
199
+ return typeof o == "function" ? o() : o;
200
+ }), this.tag;
201
+ }
202
+ return tt(t, [{
250
203
  key: "interimTag",
251
204
  /**
252
205
  * An intermediary template tag that receives a template tag and passes the result of calling the template with the received
@@ -256,11 +209,10 @@ var TemplateTag = function() {
256
209
  * @param {...*} ...substitutions - `substitutions` is an array of all substitutions in the template
257
210
  * @return {*} - the final processed value
258
211
  */
259
- value: function interimTag(previousTag, template2) {
260
- for (var _len3 = arguments.length, substitutions = Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {
261
- substitutions[_key3 - 2] = arguments[_key3];
262
- }
263
- return this.tag(_templateObject, previousTag.apply(void 0, [template2].concat(substitutions)));
212
+ value: function(r, a) {
213
+ for (var n = arguments.length, o = Array(n > 2 ? n - 2 : 0), i = 2; i < n; i++)
214
+ o[i - 2] = arguments[i];
215
+ return this.tag(rt, r.apply(void 0, [a].concat(o)));
264
216
  }
265
217
  /**
266
218
  * Performs bulk processing on the tagged template, transforming each substitution and then
@@ -272,9 +224,9 @@ var TemplateTag = function() {
272
224
  */
273
225
  }, {
274
226
  key: "processSubstitutions",
275
- value: function processSubstitutions(substitutions, resultSoFar, remainingPart) {
276
- var substitution = this.transformSubstitution(substitutions.shift(), resultSoFar);
277
- return "".concat(resultSoFar, substitution, remainingPart);
227
+ value: function(r, a, n) {
228
+ var o = this.transformSubstitution(r.shift(), a);
229
+ return "".concat(a, o, n);
278
230
  }
279
231
  /**
280
232
  * Iterate through each transformer, applying the transformer's `onString` method to the template
@@ -284,11 +236,11 @@ var TemplateTag = function() {
284
236
  */
285
237
  }, {
286
238
  key: "transformString",
287
- value: function transformString(str) {
288
- var cb = function cb2(res, transform) {
289
- return transform.onString ? transform.onString(res) : res;
239
+ value: function(r) {
240
+ var a = function(o, i) {
241
+ return i.onString ? i.onString(o) : o;
290
242
  };
291
- return this.transformers.reduce(cb, str);
243
+ return this.transformers.reduce(a, r);
292
244
  }
293
245
  /**
294
246
  * When a substitution is encountered, iterates through each transformer and applies the transformer's
@@ -299,11 +251,11 @@ var TemplateTag = function() {
299
251
  */
300
252
  }, {
301
253
  key: "transformSubstitution",
302
- value: function transformSubstitution(substitution, resultSoFar) {
303
- var cb = function cb2(res, transform) {
304
- return transform.onSubstitution ? transform.onSubstitution(res, resultSoFar) : res;
254
+ value: function(r, a) {
255
+ var n = function(i, l) {
256
+ return l.onSubstitution ? l.onSubstitution(i, a) : i;
305
257
  };
306
- return this.transformers.reduce(cb, substitution);
258
+ return this.transformers.reduce(n, r);
307
259
  }
308
260
  /**
309
261
  * Iterates through each transformer, applying the transformer's `onEndResult` method to the
@@ -313,161 +265,120 @@ var TemplateTag = function() {
313
265
  */
314
266
  }, {
315
267
  key: "transformEndResult",
316
- value: function transformEndResult(endResult) {
317
- var cb = function cb2(res, transform) {
318
- return transform.onEndResult ? transform.onEndResult(res) : res;
268
+ value: function(r) {
269
+ var a = function(o, i) {
270
+ return i.onEndResult ? i.onEndResult(o) : o;
319
271
  };
320
- return this.transformers.reduce(cb, endResult);
272
+ return this.transformers.reduce(a, r);
321
273
  }
322
- }]);
323
- return TemplateTag2;
324
- }();
325
- var trimResultTransformer = function trimResultTransformer2() {
326
- var side = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
274
+ }]), t;
275
+ }(), M = function() {
276
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
327
277
  return {
328
- onEndResult: function onEndResult(endResult) {
329
- if (side === "") {
330
- return endResult.trim();
331
- }
332
- side = side.toLowerCase();
333
- if (side === "start" || side === "left") {
334
- return endResult.replace(/^\s*/, "");
335
- }
336
- if (side === "end" || side === "right") {
337
- return endResult.replace(/\s*$/, "");
338
- }
339
- throw new Error("Side not supported: " + side);
278
+ onEndResult: function(a) {
279
+ if (e === "")
280
+ return a.trim();
281
+ if (e = e.toLowerCase(), e === "start" || e === "left")
282
+ return a.replace(/^\s*/, "");
283
+ if (e === "end" || e === "right")
284
+ return a.replace(/\s*$/, "");
285
+ throw new Error("Side not supported: " + e);
340
286
  }
341
287
  };
342
288
  };
343
- function _toConsumableArray(arr) {
344
- if (Array.isArray(arr)) {
345
- for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) {
346
- arr2[i] = arr[i];
347
- }
348
- return arr2;
349
- } else {
350
- return Array.from(arr);
351
- }
289
+ function ot(t) {
290
+ if (Array.isArray(t)) {
291
+ for (var e = 0, r = Array(t.length); e < t.length; e++)
292
+ r[e] = t[e];
293
+ return r;
294
+ } else
295
+ return Array.from(t);
352
296
  }
353
- var stripIndentTransformer = function stripIndentTransformer2() {
354
- var type = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "initial";
297
+ var L = function() {
298
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "initial";
355
299
  return {
356
- onEndResult: function onEndResult(endResult) {
357
- if (type === "initial") {
358
- var match = endResult.match(/^[^\S\n]*(?=\S)/gm);
359
- var indent = match && Math.min.apply(Math, _toConsumableArray(match.map(function(el) {
360
- return el.length;
300
+ onEndResult: function(a) {
301
+ if (e === "initial") {
302
+ var n = a.match(/^[^\S\n]*(?=\S)/gm), o = n && Math.min.apply(Math, ot(n.map(function(l) {
303
+ return l.length;
361
304
  })));
362
- if (indent) {
363
- var regexp = new RegExp("^.{" + indent + "}", "gm");
364
- return endResult.replace(regexp, "");
305
+ if (o) {
306
+ var i = new RegExp("^.{" + o + "}", "gm");
307
+ return a.replace(i, "");
365
308
  }
366
- return endResult;
367
- }
368
- if (type === "all") {
369
- return endResult.replace(/^[^\S\n]+/gm, "");
309
+ return a;
370
310
  }
371
- throw new Error("Unknown type: " + type);
311
+ if (e === "all")
312
+ return a.replace(/^[^\S\n]+/gm, "");
313
+ throw new Error("Unknown type: " + e);
372
314
  }
373
315
  };
374
- };
375
- var replaceResultTransformer = function replaceResultTransformer2(replaceWhat, replaceWith) {
316
+ }, q = function(e, r) {
376
317
  return {
377
- onEndResult: function onEndResult(endResult) {
378
- if (replaceWhat == null || replaceWith == null) {
318
+ onEndResult: function(n) {
319
+ if (e == null || r == null)
379
320
  throw new Error("replaceResultTransformer requires at least 2 arguments.");
380
- }
381
- return endResult.replace(replaceWhat, replaceWith);
321
+ return n.replace(e, r);
382
322
  }
383
323
  };
384
- };
385
- var replaceSubstitutionTransformer = function replaceSubstitutionTransformer2(replaceWhat, replaceWith) {
324
+ }, P = function(e, r) {
386
325
  return {
387
- onSubstitution: function onSubstitution(substitution, resultSoFar) {
388
- if (replaceWhat == null || replaceWith == null) {
326
+ onSubstitution: function(n, o) {
327
+ if (e == null || r == null)
389
328
  throw new Error("replaceSubstitutionTransformer requires at least 2 arguments.");
390
- }
391
- if (substitution == null) {
392
- return substitution;
393
- } else {
394
- return substitution.toString().replace(replaceWhat, replaceWith);
395
- }
329
+ return n == null ? n : n.toString().replace(e, r);
396
330
  }
397
331
  };
398
- };
399
- var defaults = {
332
+ }, it = {
400
333
  separator: "",
401
334
  conjunction: "",
402
- serial: false
403
- };
404
- var inlineArrayTransformer = function inlineArrayTransformer2() {
405
- var opts = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : defaults;
335
+ serial: !1
336
+ }, D = function() {
337
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : it;
406
338
  return {
407
- onSubstitution: function onSubstitution(substitution, resultSoFar) {
408
- if (Array.isArray(substitution)) {
409
- var arrayLength = substitution.length;
410
- var separator = opts.separator;
411
- var conjunction = opts.conjunction;
412
- var serial = opts.serial;
413
- var indent = resultSoFar.match(/(\n?[^\S\n]+)$/);
414
- if (indent) {
415
- substitution = substitution.join(separator + indent[1]);
416
- } else {
417
- substitution = substitution.join(separator + " ");
418
- }
419
- if (conjunction && arrayLength > 1) {
420
- var separatorIndex = substitution.lastIndexOf(separator);
421
- substitution = substitution.slice(0, separatorIndex) + (serial ? separator : "") + " " + conjunction + substitution.slice(separatorIndex + 1);
339
+ onSubstitution: function(a, n) {
340
+ if (Array.isArray(a)) {
341
+ var o = a.length, i = e.separator, l = e.conjunction, c = e.serial, d = n.match(/(\n?[^\S\n]+)$/);
342
+ if (d ? a = a.join(i + d[1]) : a = a.join(i + " "), l && o > 1) {
343
+ var h = a.lastIndexOf(i);
344
+ a = a.slice(0, h) + (c ? i : "") + " " + l + a.slice(h + 1);
422
345
  }
423
346
  }
424
- return substitution;
347
+ return a;
425
348
  }
426
349
  };
427
- };
428
- var splitStringTransformer = function splitStringTransformer2(splitBy) {
350
+ }, Te = function(e) {
429
351
  return {
430
- onSubstitution: function onSubstitution(substitution, resultSoFar) {
431
- {
432
- if (typeof substitution === "string" && substitution.includes(splitBy)) {
433
- substitution = substitution.split(splitBy);
434
- }
435
- }
436
- return substitution;
352
+ onSubstitution: function(a, n) {
353
+ return typeof a == "string" && a.includes(e) && (a = a.split(e)), a;
437
354
  }
438
355
  };
439
- };
440
- var isValidValue = function isValidValue2(x) {
441
- return x != null && !Number.isNaN(x) && typeof x !== "boolean";
442
- };
443
- var removeNonPrintingValuesTransformer = function removeNonPrintingValuesTransformer2() {
356
+ }, de = function(e) {
357
+ return e != null && !Number.isNaN(e) && typeof e != "boolean";
358
+ }, st = function() {
444
359
  return {
445
- onSubstitution: function onSubstitution(substitution) {
446
- if (Array.isArray(substitution)) {
447
- return substitution.filter(isValidValue);
448
- }
449
- if (isValidValue(substitution)) {
450
- return substitution;
451
- }
452
- return "";
360
+ onSubstitution: function(r) {
361
+ return Array.isArray(r) ? r.filter(de) : de(r) ? r : "";
453
362
  }
454
363
  };
455
364
  };
456
- new TemplateTag(inlineArrayTransformer({ separator: "," }), stripIndentTransformer, trimResultTransformer);
457
- new TemplateTag(inlineArrayTransformer({ separator: ",", conjunction: "and" }), stripIndentTransformer, trimResultTransformer);
458
- new TemplateTag(inlineArrayTransformer({ separator: ",", conjunction: "or" }), stripIndentTransformer, trimResultTransformer);
459
- new TemplateTag(splitStringTransformer("\n"), removeNonPrintingValuesTransformer, inlineArrayTransformer, stripIndentTransformer, trimResultTransformer);
460
- new TemplateTag(splitStringTransformer("\n"), inlineArrayTransformer, stripIndentTransformer, trimResultTransformer, replaceSubstitutionTransformer(/&/g, "&amp;"), replaceSubstitutionTransformer(/</g, "&lt;"), replaceSubstitutionTransformer(/>/g, "&gt;"), replaceSubstitutionTransformer(/"/g, "&quot;"), replaceSubstitutionTransformer(/'/g, "&#x27;"), replaceSubstitutionTransformer(/`/g, "&#x60;"));
461
- new TemplateTag(replaceResultTransformer(/(?:\n(?:\s*))+/g, " "), trimResultTransformer);
462
- new TemplateTag(replaceResultTransformer(/(?:\n\s*)/g, ""), trimResultTransformer);
463
- new TemplateTag(inlineArrayTransformer({ separator: "," }), replaceResultTransformer(/(?:\s+)/g, " "), trimResultTransformer);
464
- new TemplateTag(inlineArrayTransformer({ separator: ",", conjunction: "or" }), replaceResultTransformer(/(?:\s+)/g, " "), trimResultTransformer);
465
- new TemplateTag(inlineArrayTransformer({ separator: ",", conjunction: "and" }), replaceResultTransformer(/(?:\s+)/g, " "), trimResultTransformer);
466
- new TemplateTag(inlineArrayTransformer, stripIndentTransformer, trimResultTransformer);
467
- new TemplateTag(inlineArrayTransformer, replaceResultTransformer(/(?:\s+)/g, " "), trimResultTransformer);
468
- new TemplateTag(stripIndentTransformer, trimResultTransformer);
469
- var stripIndents = new TemplateTag(stripIndentTransformer("all"), trimResultTransformer);
470
- const backDualWideCameraLocalizations = [
365
+ new T(D({ separator: "," }), L, M);
366
+ new T(D({ separator: ",", conjunction: "and" }), L, M);
367
+ new T(D({ separator: ",", conjunction: "or" }), L, M);
368
+ new T(Te(`
369
+ `), st, D, L, M);
370
+ new T(Te(`
371
+ `), D, L, M, P(/&/g, "&amp;"), P(/</g, "&lt;"), P(/>/g, "&gt;"), P(/"/g, "&quot;"), P(/'/g, "&#x27;"), P(/`/g, "&#x60;"));
372
+ new T(q(/(?:\n(?:\s*))+/g, " "), M);
373
+ new T(q(/(?:\n\s*)/g, ""), M);
374
+ new T(D({ separator: "," }), q(/(?:\s+)/g, " "), M);
375
+ new T(D({ separator: ",", conjunction: "or" }), q(/(?:\s+)/g, " "), M);
376
+ new T(D({ separator: ",", conjunction: "and" }), q(/(?:\s+)/g, " "), M);
377
+ new T(D, L, M);
378
+ new T(D, q(/(?:\s+)/g, " "), M);
379
+ new T(L, M);
380
+ var Me = new T(L("all"), M);
381
+ const lt = [
471
382
  "Cameră dublă cu obiectiv superangular spate",
472
383
  "מצלמה כפולה רחבה אחורית",
473
384
  "Артқы қос кең бұрышты камера",
@@ -505,16 +416,15 @@ const backDualWideCameraLocalizations = [
505
416
  "Cámara trasera dual con gran angular",
506
417
  "背面デュアル広角カメラ",
507
418
  "Stražnja dvostruka široka kamera"
508
- ];
509
- const asError = (thrown) => {
510
- if (thrown instanceof Error) return thrown;
419
+ ], K = (t) => {
420
+ if (t instanceof Error) return t;
511
421
  try {
512
- return new Error(JSON.stringify(thrown));
422
+ return new Error(JSON.stringify(t));
513
423
  } catch {
514
- return new Error(String(thrown));
424
+ return new Error(String(t));
515
425
  }
516
426
  };
517
- class CameraError extends Error {
427
+ class xe extends Error {
518
428
  code;
519
429
  /**
520
430
  * Creates a new camera error.
@@ -523,209 +433,139 @@ class CameraError extends Error {
523
433
  * @param code - The error code.
524
434
  * @param cause - The cause of the error.
525
435
  */
526
- constructor(message, code, cause) {
527
- super(message);
528
- this.code = code;
529
- this.cause = cause;
436
+ constructor(e, r, a) {
437
+ super(e), this.code = r, this.cause = a;
530
438
  }
531
439
  }
532
- const askForCameraPermission = async () => {
440
+ const ct = async () => {
533
441
  try {
534
- const mediaStream = await navigator.mediaDevices.getUserMedia({
535
- video: true
442
+ const t = await navigator.mediaDevices.getUserMedia({
443
+ video: !0
536
444
  });
537
- closeStreamTracks(mediaStream);
538
- } catch (error) {
539
- console.log(error);
540
- const newError = new CameraError(
445
+ Re(t);
446
+ } catch (t) {
447
+ throw console.log(t), new xe(
541
448
  "Camera permission not given",
542
449
  "PERMISSION_DENIED",
543
- asError(error)
450
+ K(t)
544
451
  );
545
- throw newError;
546
452
  }
547
- };
548
- const obtainVideoInputDevices = async () => {
549
- if (!isSecureContext) {
550
- throw new Error(stripIndents`
453
+ }, ut = async () => {
454
+ if (!isSecureContext)
455
+ throw new Error(Me`
551
456
  Cameras can only be used in a secure context:
552
457
  https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts
553
458
  `);
554
- }
555
- await askForCameraPermission();
556
- const allDevices = await navigator.mediaDevices.enumerateDevices();
557
- const cameraDevices = allDevices.filter((device) => {
558
- return device.kind === "videoinput";
559
- });
560
- return cameraDevices;
561
- };
562
- const closeStreamTracks = (stream) => {
563
- const tracks = stream.getTracks();
564
- for (const track of tracks) {
565
- track.stop();
566
- }
567
- };
568
- const createConstraints = (resolution, facing, id) => {
569
- const constraints = {
570
- video: {
571
- deviceId: id ? { exact: id } : void 0,
572
- frameRate: 30,
573
- aspectRatio: {
574
- exact: videoResolutions[resolution].width / videoResolutions[resolution].height
575
- },
576
- width: {
577
- ideal: videoResolutions[resolution].width
578
- },
579
- height: {
580
- ideal: videoResolutions[resolution].height
581
- },
582
- facingMode: facing
459
+ return await ct(), (await navigator.mediaDevices.enumerateDevices()).filter((r) => r.kind === "videoinput");
460
+ }, Re = (t) => {
461
+ const e = t.getTracks();
462
+ for (const r of e)
463
+ r.stop();
464
+ }, dt = (t, e, r) => ({
465
+ video: {
466
+ deviceId: r ? { exact: r } : void 0,
467
+ frameRate: 30,
468
+ aspectRatio: {
469
+ exact: O[t].width / O[t].height
583
470
  },
584
- audio: false
585
- };
586
- return constraints;
587
- };
588
- function scoreCameraCapabilities(camera) {
589
- let score = 0;
590
- if (camera.torchSupported) score += 1;
591
- if (camera.singleShotSupported) score += 1;
592
- return score;
471
+ width: {
472
+ ideal: O[t].width
473
+ },
474
+ height: {
475
+ ideal: O[t].height
476
+ },
477
+ facingMode: e
478
+ },
479
+ audio: !1
480
+ });
481
+ function ht(t) {
482
+ let e = 0;
483
+ return t.torchSupported && (e += 1), t.singleShotSupported && (e += 1), e;
593
484
  }
594
- function filterCamerasByFacing(cameras, requestedFacing) {
595
- return cameras.filter((camera) => {
596
- if (requestedFacing === "back" || requestedFacing === void 0) {
597
- return isBackCameraName(camera.name);
598
- } else {
599
- return isFrontCameraName(camera.name);
600
- }
601
- });
485
+ function mt(t, e) {
486
+ return t.filter((r) => e === "back" || e === void 0 ? Ee(r.name) : _e(r.name));
602
487
  }
603
- const findIdealCamera = async (cameras, resolution = "4k", requestedFacing = "back") => {
604
- if (cameras.length === 0) {
488
+ const ft = async (t, e = "4k", r = "back") => {
489
+ if (t.length === 0)
605
490
  throw new Error("No cameras found");
606
- }
607
- if (cameras.length === 1) {
608
- await cameras[0].startStream(resolution);
609
- return cameras[0];
610
- }
611
- let cameraPool = filterCamerasByFacing(cameras, requestedFacing);
612
- if (cameraPool.length === 1) {
613
- await cameraPool[0].startStream(resolution);
614
- return cameraPool[0];
615
- }
616
- if (cameraPool.length === 0) {
617
- console.debug("No camera found with requested facing, using all cameras");
618
- cameraPool = cameras;
619
- }
620
- if (requestedFacing === "back") {
621
- const dualWideCamera = cameraPool.find(
622
- (camera) => backDualWideCameraLocalizations.includes(camera.name)
491
+ if (t.length === 1)
492
+ return await t[0].startStream(e), t[0];
493
+ let a = mt(t, r);
494
+ if (a.length === 1)
495
+ return await a[0].startStream(e), a[0];
496
+ if (a.length === 0 && (console.debug("No camera found with requested facing, using all cameras"), a = t), r === "back") {
497
+ const c = a.find(
498
+ (d) => lt.includes(d.name)
623
499
  );
624
- if (dualWideCamera) {
625
- await dualWideCamera.startStream(resolution);
626
- return dualWideCamera;
627
- }
500
+ if (c)
501
+ return await c.startStream(e), c;
628
502
  }
629
- if (requestedFacing === "front") {
630
- const lastCamera = cameraPool[cameraPool.length - 1];
631
- await lastCamera.startStream(resolution);
632
- return lastCamera;
503
+ if (r === "front") {
504
+ const c = a[a.length - 1];
505
+ return await c.startStream(e), c;
633
506
  }
634
- const cameraScores = /* @__PURE__ */ new Map();
635
- let bestCamera;
636
- let maxScore = -Infinity;
637
- for (let i = cameraPool.length - 1; i >= 0; i--) {
638
- const camera = cameraPool[i];
507
+ const n = /* @__PURE__ */ new Map();
508
+ let o, i = -1 / 0;
509
+ for (let c = a.length - 1; c >= 0; c--) {
510
+ const d = a[c];
639
511
  try {
640
- await camera.startStream(resolution);
641
- const score = scoreCameraCapabilities(camera);
642
- cameraScores.set(camera, score);
643
- if (score > maxScore) {
644
- if (bestCamera && bestCamera !== camera) {
645
- bestCamera.stopStream();
646
- }
647
- maxScore = score;
648
- bestCamera = camera;
649
- } else {
650
- camera.stopStream();
651
- }
652
- if (score === 2) {
653
- console.debug("Found camera with all capabilities, returning early");
654
- return camera;
655
- }
656
- } catch (error) {
657
- console.warn(`Failed to test camera ${camera.name}:`, error);
658
- camera.stopStream();
659
- }
660
- }
661
- if (bestCamera) {
662
- return bestCamera;
663
- }
664
- const firstCamera = cameraPool[0];
665
- await firstCamera.startStream(resolution);
666
- return firstCamera;
512
+ await d.startStream(e);
513
+ const h = ht(d);
514
+ if (n.set(d, h), h > i ? (o && o !== d && o.stopStream(), i = h, o = d) : d.stopStream(), h === 2)
515
+ return console.debug("Found camera with all capabilities, returning early"), d;
516
+ } catch (h) {
517
+ console.warn(`Failed to test camera ${d.name}:`, h), d.stopStream();
518
+ }
519
+ }
520
+ if (o)
521
+ return o;
522
+ const l = a[0];
523
+ return await l.startStream(e), l;
667
524
  };
668
- function createCameras(cameras) {
669
- const camerasWithStream = [];
670
- for (const device of cameras) {
671
- const camera = new Camera(device);
672
- if (camera !== null) {
673
- camerasWithStream.push(camera);
674
- }
525
+ function gt(t) {
526
+ const e = [];
527
+ for (const r of t) {
528
+ const a = new Ae(r);
529
+ a !== null && e.push(a);
675
530
  }
676
- return camerasWithStream;
531
+ return e;
677
532
  }
678
- const videoResolutions = {
533
+ const O = {
679
534
  "720p": { width: 1280, height: 720 },
680
535
  "1080p": { width: 1920, height: 1080 },
681
536
  "4k": { width: 3840, height: 2160 }
682
537
  };
683
- function returnLongerSide(resolution) {
684
- return Math.max(resolution.width, resolution.height);
538
+ function bt(t) {
539
+ return Math.max(t.width, t.height);
685
540
  }
686
- function getNormalizedResolution(resolution) {
687
- const normalized = {
688
- width: Math.max(resolution.width, resolution.height),
689
- height: Math.min(resolution.width, resolution.height)
541
+ function pt(t) {
542
+ const e = {
543
+ width: Math.max(t.width, t.height),
544
+ height: Math.min(t.width, t.height)
690
545
  };
691
- const epsilon = 1e-4;
692
- if (Math.abs(normalized.width / normalized.height - 16 / 9) > epsilon) {
693
- console.warn(
694
- `Resolution ${JSON.stringify(
695
- resolution
696
- )} is not 16:9, may cause issues with some video players.`
697
- );
698
- }
699
- return normalized;
546
+ return Math.abs(e.width / e.height - 16 / 9) > 1e-4 && console.warn(
547
+ `Resolution ${JSON.stringify(
548
+ t
549
+ )} is not 16:9, may cause issues with some video players.`
550
+ ), e;
700
551
  }
701
- function matchClosestResolution(resolution) {
702
- const actualWidth = returnLongerSide(resolution);
703
- if (actualWidth > 1920) {
704
- return "4k";
705
- } else if (actualWidth > 1280) {
706
- return "1080p";
707
- } else {
708
- return "720p";
709
- }
552
+ function vt(t) {
553
+ const e = bt(t);
554
+ return e > 1920 ? "4k" : e > 1280 ? "1080p" : "720p";
710
555
  }
711
- function findResolutionKey(videoTrackResolution) {
712
- const normalizedResolution = getNormalizedResolution(videoTrackResolution);
713
- const resolutionMatch = Object.entries(videoResolutions).find(
714
- ([key, value]) => {
715
- return value.width === normalizedResolution.width && value.height === normalizedResolution.height;
716
- }
556
+ function wt(t) {
557
+ const e = pt(t), r = Object.entries(O).find(
558
+ ([n, o]) => o.width === e.width && o.height === e.height
717
559
  );
718
- if (!resolutionMatch) {
719
- const closestMatch = matchClosestResolution(videoTrackResolution);
720
- console.warn(
721
- `No exact resolution match found for ${JSON.stringify(videoTrackResolution)}, categorizing as ${closestMatch}`
722
- );
723
- return closestMatch;
560
+ if (!r) {
561
+ const n = vt(t);
562
+ return console.warn(
563
+ `No exact resolution match found for ${JSON.stringify(t)}, categorizing as ${n}`
564
+ ), n;
724
565
  }
725
- const resolutionKey = resolutionMatch[0];
726
- return resolutionKey;
566
+ return r[0];
727
567
  }
728
- class Camera {
568
+ class Ae {
729
569
  /**
730
570
  * The device info.
731
571
  */
@@ -742,9 +582,9 @@ class Camera {
742
582
  activeStream;
743
583
  name;
744
584
  facingMode;
745
- torchSupported = false;
746
- torchEnabled = false;
747
- singleShotSupported = false;
585
+ torchSupported = !1;
586
+ torchEnabled = !1;
587
+ singleShotSupported = !1;
748
588
  maxSupportedResolution;
749
589
  /**
750
590
  * Reference to the original instance before it was proxied.
@@ -761,41 +601,29 @@ class Camera {
761
601
  *
762
602
  * @deprecated Not used. Reconsider using once Firefox and Chrome align on this.
763
603
  */
764
- #deviceCapabilities;
604
+ #e;
765
605
  /**
766
606
  * Creates a new Camera instance.
767
607
  *
768
608
  * @param deviceInfo - The device info.
769
609
  */
770
- constructor(deviceInfo) {
771
- if (deviceInfo.kind !== "videoinput") {
610
+ constructor(e) {
611
+ if (e.kind !== "videoinput")
772
612
  throw new Error("Device is not a video input device");
773
- }
774
- this.deviceInfo = deviceInfo;
775
- this.name = deviceInfo.label;
776
- if (isFrontCameraName(deviceInfo.label)) {
777
- this.facingMode = "front";
778
- }
779
- if (isBackCameraName(deviceInfo.label)) {
780
- this.facingMode = "back";
781
- }
782
- const originalRef = this;
783
- const proxy = new Proxy(this, {
784
- set(target, property, value, receiver) {
785
- const oldValue = Reflect.get(target, property, receiver);
786
- const change = {
787
- property,
788
- oldValue,
789
- value
613
+ this.deviceInfo = e, this.name = e.label, _e(e.label) && (this.facingMode = "front"), Ee(e.label) && (this.facingMode = "back");
614
+ const r = this, a = new Proxy(this, {
615
+ set(n, o, i, l) {
616
+ const c = Reflect.get(n, o, l), d = {
617
+ property: o,
618
+ oldValue: c,
619
+ value: i
790
620
  };
791
- originalRef.notify(change);
792
- return Reflect.set(target, property, value, receiver);
621
+ return r.notify(d), Reflect.set(n, o, i, l);
793
622
  }
794
623
  });
795
- this.notify = (reason) => {
796
- this.notifyStateChange?.(proxy, reason);
797
- };
798
- return proxy;
624
+ return this.notify = (n) => {
625
+ this.notifyStateChange?.(a, n);
626
+ }, a;
799
627
  }
800
628
  /**
801
629
  * Starts a stream with the specified resolution.
@@ -803,25 +631,19 @@ class Camera {
803
631
  * @param resolution - The resolution to start the stream with.
804
632
  * @returns The stream.
805
633
  */
806
- async startStream(resolution) {
807
- if (this.activeStream) {
634
+ async startStream(e) {
635
+ if (this.activeStream)
808
636
  return this.activeStream;
809
- }
810
- if (this.maxSupportedResolution) {
811
- resolution = this.maxSupportedResolution;
812
- }
813
- const stream = await this.acquireStreamWithFallback(resolution);
814
- this.populateCapabilities(stream);
815
- this.activeStream = stream;
816
- const videoTrack = stream.getVideoTracks()[0];
817
- videoTrack.onended = (e) => {
818
- this.stopStream();
819
- this.notify({
820
- event: e,
637
+ this.maxSupportedResolution && (e = this.maxSupportedResolution);
638
+ const r = await this.acquireStreamWithFallback(e);
639
+ this.populateCapabilities(r), this.activeStream = r;
640
+ const a = r.getVideoTracks()[0];
641
+ return a.onended = (n) => {
642
+ this.stopStream(), this.notify({
643
+ event: n,
821
644
  payload: "TRACK_END"
822
645
  });
823
- };
824
- return stream;
646
+ }, r;
825
647
  }
826
648
  /**
827
649
  * Acquires a camera stream with the specified resolution.
@@ -830,25 +652,24 @@ class Camera {
830
652
  * @param resolution - The resolution to acquire the stream with.
831
653
  * @returns The stream.
832
654
  */
833
- async acquireStreamWithFallback(resolution) {
655
+ async acquireStreamWithFallback(e) {
834
656
  try {
835
- const constraints = createConstraints(
836
- resolution,
657
+ const r = dt(
658
+ e,
837
659
  this.facingMode,
838
660
  this.deviceInfo.deviceId
839
661
  );
840
- return await navigator.mediaDevices.getUserMedia(constraints);
841
- } catch (error) {
662
+ return await navigator.mediaDevices.getUserMedia(r);
663
+ } catch (r) {
842
664
  console.warn(
843
- `Can't get camera stream for ${this.name} at ${resolution}`,
844
- error
665
+ `Can't get camera stream for ${this.name} at ${e}`,
666
+ r
845
667
  );
846
- let currentResolutionIndex = Object.keys(videoResolutions).indexOf(resolution);
847
- if (currentResolutionIndex === 0) {
668
+ let a = Object.keys(O).indexOf(e);
669
+ if (a === 0)
848
670
  throw new Error("Failed to get camera stream");
849
- }
850
- const fallbackResolution = Object.keys(videoResolutions)[currentResolutionIndex - 1];
851
- return await this.acquireStreamWithFallback(fallbackResolution);
671
+ const n = Object.keys(O)[a - 1];
672
+ return await this.acquireStreamWithFallback(n);
852
673
  }
853
674
  }
854
675
  /**
@@ -856,45 +677,18 @@ class Camera {
856
677
  *
857
678
  * @param stream - The stream to populate the capabilities from.
858
679
  */
859
- populateCapabilities(stream) {
860
- this.streamCapabilities = stream.getVideoTracks()[0].getCapabilities();
861
- const videoTrack = stream.getVideoTracks()[0];
862
- const trackSettings = videoTrack.getSettings();
863
- if (!trackSettings.width || !trackSettings.height) {
680
+ populateCapabilities(e) {
681
+ this.streamCapabilities = e.getVideoTracks()[0].getCapabilities();
682
+ const a = e.getVideoTracks()[0].getSettings();
683
+ if (!a.width || !a.height)
864
684
  throw new Error(
865
685
  "Video track resolution not available. Should not happen."
866
686
  );
867
- }
868
- const videoTrackResolution = {
869
- width: trackSettings.width,
870
- height: trackSettings.height
871
- };
872
- const resolutionKey = findResolutionKey(videoTrackResolution);
873
- if (!this.maxSupportedResolution && resolutionKey) {
874
- this.maxSupportedResolution = resolutionKey;
875
- }
876
- if ("torch" in this.streamCapabilities) {
877
- this.torchSupported = true;
878
- }
879
- if ("focusMode" in this.streamCapabilities && this.streamCapabilities.focusMode?.includes("single-shot")) {
880
- this.singleShotSupported = true;
881
- }
882
- if (this.facingMode === "front" && this.streamCapabilities.facingMode?.includes("environment")) {
883
- this.facingMode = "back";
884
- console.warn("Front camera selected, but facingMode is environment");
885
- }
886
- if (this.facingMode === "back" && this.streamCapabilities.facingMode?.includes("user")) {
887
- this.facingMode = "front";
888
- console.warn("Back camera selected, but facingMode is user");
889
- }
890
- if (!this.facingMode) {
891
- if (this.streamCapabilities.facingMode?.includes("environment")) {
892
- this.facingMode = "back";
893
- }
894
- if (this.streamCapabilities.facingMode?.includes("user")) {
895
- this.facingMode = "front";
896
- }
897
- }
687
+ const n = {
688
+ width: a.width,
689
+ height: a.height
690
+ }, o = wt(n);
691
+ !this.maxSupportedResolution && o && (this.maxSupportedResolution = o), "torch" in this.streamCapabilities && (this.torchSupported = !0), "focusMode" in this.streamCapabilities && this.streamCapabilities.focusMode?.includes("single-shot") && (this.singleShotSupported = !0), this.facingMode === "front" && this.streamCapabilities.facingMode?.includes("environment") && (this.facingMode = "back", console.warn("Front camera selected, but facingMode is environment")), this.facingMode === "back" && this.streamCapabilities.facingMode?.includes("user") && (this.facingMode = "front", console.warn("Back camera selected, but facingMode is user")), this.facingMode || (this.streamCapabilities.facingMode?.includes("environment") && (this.facingMode = "back"), this.streamCapabilities.facingMode?.includes("user") && (this.facingMode = "front"));
898
692
  }
899
693
  /**
900
694
  * Toggles the torch on the camera.
@@ -902,27 +696,21 @@ class Camera {
902
696
  * @returns The torch status.
903
697
  */
904
698
  async toggleTorch() {
905
- const videoTrack = this.getVideoTrack();
906
- if (!videoTrack) {
699
+ const e = this.getVideoTrack();
700
+ if (!e)
907
701
  throw new Error("No active stream on Camera instance.");
908
- }
909
- if (!this.torchSupported) {
702
+ if (!this.torchSupported)
910
703
  throw new Error("Torch not supported on this device.");
911
- }
912
704
  try {
913
- await videoTrack.applyConstraints({
705
+ await e.applyConstraints({
914
706
  advanced: [
915
707
  {
916
708
  torch: !this.torchEnabled
917
709
  }
918
710
  ]
919
- });
920
- this.torchEnabled = !this.torchEnabled;
921
- } catch (error) {
922
- console.error("Failed to toggle torch", error);
923
- this.torchEnabled = false;
924
- this.torchSupported = false;
925
- throw new Error("Failed to toggle torch", { cause: error });
711
+ }), this.torchEnabled = !this.torchEnabled;
712
+ } catch (r) {
713
+ throw console.error("Failed to toggle torch", r), this.torchEnabled = !1, this.torchSupported = !1, new Error("Failed to toggle torch", { cause: r });
926
714
  }
927
715
  return this.torchEnabled;
928
716
  }
@@ -930,13 +718,7 @@ class Camera {
930
718
  * Stops the stream on the camera.
931
719
  */
932
720
  stopStream() {
933
- if (this.activeStream) {
934
- console.debug(`Stopping active stream on ${this.name}`);
935
- closeStreamTracks(this.activeStream);
936
- this.activeStream = void 0;
937
- this.streamCapabilities = void 0;
938
- this.torchEnabled = false;
939
- }
721
+ this.activeStream && (console.debug(`Stopping active stream on ${this.name}`), Re(this.activeStream), this.activeStream = void 0, this.streamCapabilities = void 0, this.torchEnabled = !1);
940
722
  }
941
723
  /**
942
724
  * Gets the video track on the camera.
@@ -951,263 +733,166 @@ class Camera {
951
733
  return this.activeStream.getVideoTracks()[0];
952
734
  }
953
735
  }
954
- const initialState$1 = {
736
+ const $e = {
955
737
  cameras: [],
956
738
  facingFilter: void 0,
957
739
  videoElement: void 0,
958
740
  playbackState: "idle",
959
741
  selectedCamera: void 0,
960
- isSwappingCamera: false,
961
- isQueryingCameras: false,
962
- mirrorX: false,
742
+ isSwappingCamera: !1,
743
+ isQueryingCameras: !1,
744
+ mirrorX: !1,
963
745
  errorState: void 0
964
- };
965
- const cameraManagerStore = createStore()(
746
+ }, m = be()(
966
747
  // this is important! Otherwise solid-zustand will start mutating the initial state
967
- subscribeWithSelector(() => structuredClone(initialState$1))
968
- );
969
- const resetCameraManagerStore = () => {
970
- console.debug("Stopping all cameras and resetting the `cameraManagerStore`.");
971
- cameraManagerStore.getState().cameras.forEach((camera) => {
972
- camera.stopStream();
973
- });
974
- cameraManagerStore.setState(structuredClone(initialState$1));
975
- };
976
- const ORIGINAL_ATTACH_SHADOW = Element.prototype.attachShadow;
977
- function isShady() {
978
- return typeof window.ShadyDOM !== "undefined" && typeof ShadowRoot !== "undefined";
748
+ ge(() => structuredClone($e))
749
+ ), yt = () => {
750
+ console.debug("Stopping all cameras and resetting the `cameraManagerStore`."), m.getState().cameras.forEach((t) => {
751
+ t.stopStream();
752
+ }), m.setState(structuredClone($e));
753
+ }, he = Element.prototype.attachShadow;
754
+ function ue() {
755
+ return typeof window.ShadyDOM < "u" && typeof ShadowRoot < "u";
979
756
  }
980
- function supportsShadowRoots() {
981
- return typeof ShadowRoot !== "undefined";
757
+ function St() {
758
+ return typeof ShadowRoot < "u";
982
759
  }
983
- function patchElementPrototypeAttachShadow(callback) {
984
- if (ORIGINAL_ATTACH_SHADOW == null || isShady())
985
- return;
986
- Element.prototype.attachShadow = function(shadowRootInitDict) {
987
- const shadowRoot = ORIGINAL_ATTACH_SHADOW.call(this, shadowRootInitDict);
988
- callback(shadowRoot);
989
- return shadowRoot;
990
- };
760
+ function Ct(t) {
761
+ he == null || ue() || (Element.prototype.attachShadow = function(e) {
762
+ const r = he.call(this, e);
763
+ return t(r), r;
764
+ });
991
765
  }
992
- function createPausableQueue(job, ...queueItems) {
993
- const queue = new Set(queueItems);
994
- let running = false;
995
- const flush = () => {
996
- for (const queuedNode of queue) {
997
- job(queuedNode);
998
- }
999
- queue.clear();
766
+ function kt(t, ...e) {
767
+ const r = new Set(e);
768
+ let a = !1;
769
+ const n = () => {
770
+ for (const o of r)
771
+ t(o);
772
+ r.clear();
1000
773
  };
1001
774
  return {
1002
775
  isRunning() {
1003
- return running;
776
+ return a;
1004
777
  },
1005
- schedule(node) {
1006
- queue.add(node);
1007
- if (running) {
1008
- flush();
1009
- }
778
+ schedule(o) {
779
+ r.add(o), a && n();
1010
780
  },
1011
781
  stop() {
1012
- running = false;
782
+ a = !1;
1013
783
  },
1014
784
  run() {
1015
- if (running)
1016
- return;
1017
- running = true;
1018
- flush();
785
+ a || (a = !0, n());
1019
786
  }
1020
787
  };
1021
788
  }
1022
- const MUTATION_OBSERVER_INIT = {
1023
- childList: true,
1024
- subtree: true
1025
- };
1026
- const nextMicrotask = (func) => {
1027
- if (typeof queueMicrotask !== "undefined")
1028
- queueMicrotask(func);
1029
- else if (typeof Promise !== "undefined")
1030
- Promise.resolve().then(() => func());
1031
- else
1032
- setTimeout(() => func(), 0);
789
+ const Et = {
790
+ childList: !0,
791
+ subtree: !0
792
+ }, _t = (t) => {
793
+ typeof queueMicrotask < "u" ? queueMicrotask(t) : typeof Promise < "u" ? Promise.resolve().then(() => t()) : setTimeout(() => t(), 0);
1033
794
  };
1034
- function nodeListToArray(nodeList) {
1035
- if (typeof Symbol !== "undefined" && nodeList[Symbol.iterator] != null) {
1036
- return [...nodeList];
1037
- } else {
1038
- const arr = [];
1039
- for (let i = 0; i < nodeList.length; i++) {
1040
- arr[i] = nodeList[i];
1041
- }
1042
- return arr;
795
+ function me(t) {
796
+ if (typeof Symbol < "u" && t[Symbol.iterator] != null)
797
+ return [...t];
798
+ {
799
+ const e = [];
800
+ for (let r = 0; r < t.length; r++)
801
+ e[r] = t[r];
802
+ return e;
1043
803
  }
1044
804
  }
1045
- function queryRoot(root, query) {
1046
- if (isShady()) {
1047
- return new Set(nodeListToArray(window.ShadyDOM.nativeMethods.querySelectorAll.call(document.documentElement, query)));
1048
- }
1049
- return new Set(!("querySelectorAll" in root) ? [] : nodeListToArray(root.querySelectorAll(query)));
805
+ function Tt(t, e) {
806
+ return ue() ? new Set(me(window.ShadyDOM.nativeMethods.querySelectorAll.call(document.documentElement, e))) : new Set("querySelectorAll" in t ? me(t.querySelectorAll(e)) : []);
1050
807
  }
1051
- function mergeNodes(a, b) {
1052
- return /* @__PURE__ */ new Set([...a == null ? [] : a, ...b == null ? [] : b]);
808
+ function Mt(t, e) {
809
+ return /* @__PURE__ */ new Set([...t ?? [], ...e ?? []]);
1053
810
  }
1054
- function isDocumentOrShadowRoot(root) {
1055
- return "activeElement" in root;
811
+ function xt(t) {
812
+ return "activeElement" in t;
1056
813
  }
1057
- function observeMissingRoots(root = document.documentElement) {
1058
- if (isDocumentOrShadowRoot(root)) {
1059
- observeRoot(root);
1060
- }
1061
- if (isShady() && root instanceof ShadowRoot)
814
+ function Fe(t = document.documentElement) {
815
+ if (xt(t) && De(t), ue() && t instanceof ShadowRoot || !St())
1062
816
  return;
1063
- if (!supportsShadowRoots())
1064
- return;
1065
- const childNodes = root.childNodes;
1066
- const shadowRoot = "shadowRoot" in root && root.shadowRoot != null ? [root.shadowRoot] : [];
1067
- for (const node of [...childNodes, ...shadowRoot]) {
1068
- observeMissingRoots(node);
1069
- }
817
+ const e = t.childNodes, r = "shadowRoot" in t && t.shadowRoot != null ? [t.shadowRoot] : [];
818
+ for (const a of [...e, ...r])
819
+ Fe(a);
1070
820
  }
1071
- function isConnected(node) {
1072
- if ("isConnected" in Node.prototype)
1073
- return node.isConnected;
1074
- return node.ownerDocument == null || !(node.ownerDocument.compareDocumentPosition(node) & node.DOCUMENT_POSITION_DISCONNECTED);
821
+ function Rt(t) {
822
+ return "isConnected" in Node.prototype ? t.isConnected : t.ownerDocument == null || !(t.ownerDocument.compareDocumentPosition(t) & t.DOCUMENT_POSITION_DISCONNECTED);
1075
823
  }
1076
- const CONNECTION_OBSERVER_INTERNALS_MAP = /* @__PURE__ */ new Map();
1077
- function initializeConnectionObserver(observer, callback) {
1078
- const queue = /* @__PURE__ */ new Set();
1079
- const observedTargets = /* @__PURE__ */ new Set();
1080
- const rootToQuerySelectorToMatchedNodesMap = /* @__PURE__ */ new Map();
1081
- const nodeToLastConnectionValueMap = /* @__PURE__ */ new WeakMap();
1082
- let scheduled = false;
1083
- let flushing = false;
1084
- let hasFoundMissingRoots = false;
1085
- const flush = () => {
1086
- flushing = true;
1087
- const arr = [...queue];
1088
- if (arr.length > 0) {
1089
- callback(arr, observer);
1090
- }
1091
- queue.clear();
1092
- scheduled = false;
1093
- flushing = false;
1094
- };
1095
- const scheduleFlush = () => {
1096
- if (!scheduled) {
1097
- scheduled = true;
1098
- nextMicrotask(flush);
1099
- }
1100
- };
1101
- const addToQueue = (entry) => {
1102
- queue.add(entry);
1103
- if (!flushing) {
1104
- scheduleFlush();
1105
- }
1106
- };
1107
- const clearQueue = () => {
1108
- const items = [...queue];
1109
- queue.clear();
1110
- return items;
1111
- };
1112
- const clearObservedTargets = () => {
1113
- observedTargets.clear();
1114
- };
1115
- const queryRootAndHandleMutationChanges = (root, query) => {
1116
- let oldQuerySelectorMap = rootToQuerySelectorToMatchedNodesMap.get(root);
1117
- const currentNodes = queryRoot(root, query);
1118
- const oldNodes = oldQuerySelectorMap == null ? void 0 : oldQuerySelectorMap.get(query);
1119
- const mergedNodes = mergeNodes(currentNodes, oldNodes);
1120
- handleMutationChange(mergedNodes);
1121
- if (oldQuerySelectorMap == null) {
1122
- oldQuerySelectorMap = /* @__PURE__ */ new Map();
1123
- rootToQuerySelectorToMatchedNodesMap.set(root, oldQuerySelectorMap);
1124
- }
1125
- oldQuerySelectorMap.set(query, currentNodes);
1126
- };
1127
- const handleMutationChange = (targetNodes) => {
1128
- for (const targetNode of targetNodes) {
1129
- const lastValue = nodeToLastConnectionValueMap.get(targetNode);
1130
- const isTargetNodeConnected = isConnected(targetNode);
1131
- if (lastValue !== isTargetNodeConnected) {
1132
- nodeToLastConnectionValueMap.set(targetNode, isTargetNodeConnected);
1133
- addToQueue({
1134
- connected: isTargetNodeConnected,
1135
- target: targetNode
1136
- });
1137
- }
1138
- }
1139
- };
1140
- const addObservedTarget = (target) => {
1141
- rootObserverQueue.run();
1142
- if (!hasFoundMissingRoots) {
1143
- hasFoundMissingRoots = true;
1144
- observeMissingRoots();
1145
- }
1146
- observedTargets.add(target);
1147
- if (typeof target !== "string") {
1148
- handleMutationChange([target]);
1149
- } else {
1150
- for (const root of OBSERVED_ROOTS) {
1151
- queryRootAndHandleMutationChanges(root, target);
1152
- }
824
+ const W = /* @__PURE__ */ new Map();
825
+ function At(t, e) {
826
+ const r = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new WeakMap();
827
+ let i = !1, l = !1, c = !1;
828
+ const d = () => {
829
+ l = !0;
830
+ const p = [...r];
831
+ p.length > 0 && e(p, t), r.clear(), i = !1, l = !1;
832
+ }, h = () => {
833
+ i || (i = !0, _t(d));
834
+ }, C = (p) => {
835
+ r.add(p), l || h();
836
+ }, w = () => {
837
+ const p = [...r];
838
+ return r.clear(), p;
839
+ }, u = () => {
840
+ a.clear();
841
+ }, v = (p, k) => {
842
+ let x = n.get(p);
843
+ const I = Tt(p, k), G = x?.get(k), X = Mt(I, G);
844
+ b(X), x == null && (x = /* @__PURE__ */ new Map(), n.set(p, x)), x.set(k, I);
845
+ }, b = (p) => {
846
+ for (const k of p) {
847
+ const x = o.get(k), I = Rt(k);
848
+ x !== I && (o.set(k, I), C({
849
+ connected: I,
850
+ target: k
851
+ }));
1153
852
  }
853
+ }, g = {
854
+ observedTargets: a,
855
+ queryRootAndHandleMutationChanges: v,
856
+ handleMutationChange: b,
857
+ addObservedTarget: (p) => {
858
+ if (ie.run(), c || (c = !0, Fe()), a.add(p), typeof p != "string")
859
+ b([p]);
860
+ else
861
+ for (const k of oe)
862
+ v(k, p);
863
+ },
864
+ clearObservedTargets: u,
865
+ clearQueue: w
1154
866
  };
1155
- const internals = {
1156
- observedTargets,
1157
- queryRootAndHandleMutationChanges,
1158
- handleMutationChange,
1159
- addObservedTarget,
1160
- clearObservedTargets,
1161
- clearQueue
1162
- };
1163
- CONNECTION_OBSERVER_INTERNALS_MAP.set(observer, internals);
867
+ W.set(t, g);
1164
868
  }
1165
- const mutationCallback = (mutations) => {
1166
- for (const mutation of mutations) {
1167
- if (mutation.type !== "childList")
1168
- continue;
1169
- for (const observer of CONNECTION_OBSERVER_INTERNALS_MAP.values()) {
1170
- for (const target of observer.observedTargets) {
1171
- if (typeof target === "string") {
1172
- observer.queryRootAndHandleMutationChanges(mutation.target, target);
1173
- } else {
1174
- observer.handleMutationChange([target]);
1175
- }
1176
- }
1177
- }
1178
- }
1179
- };
1180
- const OBSERVED_ROOTS = /* @__PURE__ */ new Set();
1181
- const observeRoot = /* @__PURE__ */ (() => {
1182
- let instance;
1183
- return function(root) {
1184
- if (OBSERVED_ROOTS.has(root))
1185
- return;
1186
- OBSERVED_ROOTS.add(root);
1187
- if (instance == null) {
1188
- instance = new MutationObserver(mutationCallback);
1189
- }
1190
- instance.observe(root, MUTATION_OBSERVER_INIT);
869
+ const $t = (t) => {
870
+ for (const e of t)
871
+ if (e.type === "childList")
872
+ for (const r of W.values())
873
+ for (const a of r.observedTargets)
874
+ typeof a == "string" ? r.queryRootAndHandleMutationChanges(e.target, a) : r.handleMutationChange([a]);
875
+ }, oe = /* @__PURE__ */ new Set(), De = /* @__PURE__ */ (() => {
876
+ let t;
877
+ return function(e) {
878
+ oe.has(e) || (oe.add(e), t == null && (t = new MutationObserver($t)), t.observe(e, Et));
1191
879
  };
1192
- })();
1193
- const rootObserverQueue = createPausableQueue(observeRoot, document.documentElement);
1194
- class ConnectionObserver {
1195
- constructor(callback) {
1196
- if (new.target === void 0) {
1197
- throw new TypeError(`Constructor ${ConnectionObserver.name} requires 'new'`);
1198
- }
1199
- if (callback === void 0) {
1200
- throw new ReferenceError(`Failed to construct '${ConnectionObserver.name}': 1 argument required, but only 0 present.`);
1201
- } else if (typeof callback !== "function") {
1202
- throw new TypeError(`Failed to construct '${ConnectionObserver.name}': The callback provided as parameter 1 is not a function.`);
1203
- }
1204
- initializeConnectionObserver(this, callback);
880
+ })(), ie = kt(De, document.documentElement);
881
+ class N {
882
+ constructor(e) {
883
+ if (new.target === void 0)
884
+ throw new TypeError(`Constructor ${N.name} requires 'new'`);
885
+ if (e === void 0)
886
+ throw new ReferenceError(`Failed to construct '${N.name}': 1 argument required, but only 0 present.`);
887
+ if (typeof e != "function")
888
+ throw new TypeError(`Failed to construct '${N.name}': The callback provided as parameter 1 is not a function.`);
889
+ At(this, e);
1205
890
  }
1206
891
  /**
1207
892
  * The Symbol.@@toStringTag value
1208
893
  */
1209
894
  get [Symbol.toStringTag]() {
1210
- return `ConnectionObserver`;
895
+ return "ConnectionObserver";
1211
896
  }
1212
897
  /**
1213
898
  * Observe the given node or query selector for connections/disconnections.
@@ -1215,153 +900,126 @@ class ConnectionObserver {
1215
900
  * as for example "img[data-some-attr]", for each new MutationRecord, the query selector
1216
901
  * will be executed and the matched nodes will be observed for connections/disconnections
1217
902
  */
1218
- observe(target) {
1219
- if (target === void 0) {
1220
- throw new ReferenceError(`Failed to execute '${this.observe.name}' on '${ConnectionObserver.name}': 1 argument required, but only 0 present.`);
1221
- } else if (typeof target !== "string" && !(target instanceof Node)) {
1222
- throw new TypeError(`Failed to execute '${this.observe.name}' on '${ConnectionObserver.name}': parameter 1 is not of type 'Node' or a DOMString.`);
1223
- }
1224
- const internals = CONNECTION_OBSERVER_INTERNALS_MAP.get(this);
1225
- if (internals == null)
1226
- return;
1227
- internals.addObservedTarget(target);
903
+ observe(e) {
904
+ if (e === void 0)
905
+ throw new ReferenceError(`Failed to execute '${this.observe.name}' on '${N.name}': 1 argument required, but only 0 present.`);
906
+ if (typeof e != "string" && !(e instanceof Node))
907
+ throw new TypeError(`Failed to execute '${this.observe.name}' on '${N.name}': parameter 1 is not of type 'Node' or a DOMString.`);
908
+ const r = W.get(this);
909
+ r?.addObservedTarget(e);
1228
910
  }
1229
911
  /**
1230
912
  * Takes the records immediately (instead of waiting for the next flush)
1231
913
  */
1232
914
  takeRecords() {
1233
- const internals = CONNECTION_OBSERVER_INTERNALS_MAP.get(this);
1234
- if (internals == null)
1235
- return [];
1236
- return internals.clearQueue();
915
+ const e = W.get(this);
916
+ return e == null ? [] : e.clearQueue();
1237
917
  }
1238
918
  /**
1239
919
  * Disconnects the ConnectionObserver such that none of its callbacks will be invoked any longer
1240
920
  */
1241
921
  disconnect() {
1242
- const internals = CONNECTION_OBSERVER_INTERNALS_MAP.get(this);
1243
- if (internals == null)
1244
- return;
1245
- internals.clearObservedTargets();
922
+ const e = W.get(this);
923
+ e?.clearObservedTargets();
1246
924
  }
1247
925
  }
1248
- patchElementPrototypeAttachShadow(rootObserverQueue.schedule.bind(rootObserverQueue));
1249
- function radEventListener(element, ...args) {
1250
- element.addEventListener(...args);
1251
- return () => {
1252
- element.removeEventListener(...args);
926
+ Ct(ie.schedule.bind(ie));
927
+ function Ft(t, ...e) {
928
+ return t.addEventListener(...e), () => {
929
+ t.removeEventListener(...e);
1253
930
  };
1254
931
  }
1255
- function rad(element, gen) {
1256
- let cleanup;
1257
- gen((listener, options) => {
1258
- element.addEventListener(listener, options);
1259
- cleanup = () => element.removeEventListener(listener, options);
1260
- });
1261
- if (!cleanup) {
932
+ function Dt(t, e) {
933
+ let r;
934
+ if (e((a, n) => {
935
+ t.addEventListener(a, n), r = () => t.removeEventListener(a, n);
936
+ }), !r)
1262
937
  throw new Error("you forgot to add event listener");
1263
- }
1264
- return cleanup;
938
+ return r;
1265
939
  }
1266
- function isBufferDetached(buffer) {
1267
- const actualBuffer = getBuffer(buffer);
1268
- if ("detached" in actualBuffer) {
1269
- const detached = actualBuffer.detached;
1270
- return detached;
1271
- }
940
+ function se(t) {
941
+ const e = Ie(t);
942
+ if ("detached" in e)
943
+ return e.detached;
1272
944
  try {
1273
- new Uint8Array(actualBuffer);
1274
- return false;
1275
- } catch (e) {
1276
- return true;
945
+ return new Uint8Array(e), !1;
946
+ } catch {
947
+ return !0;
1277
948
  }
1278
949
  }
1279
- class VideoFrameProcessor {
1280
- #canvas;
1281
- #context2d = null;
1282
- #contextWebGl2 = null;
1283
- #webGl2Texture = null;
1284
- #webGl2Framebuffer = null;
1285
- #buffer = null;
1286
- #cachedWidth = 0;
1287
- #cachedHeight = 0;
1288
- #canvasRenderingMode;
1289
- #requiredPackAlignment = 4;
950
+ class It {
951
+ #e;
952
+ #o = null;
953
+ #a = null;
954
+ #r = null;
955
+ #n = null;
956
+ #t = null;
957
+ #s = 0;
958
+ #l = 0;
959
+ #i;
960
+ #u = 4;
1290
961
  /**
1291
962
  * Creates a new VideoFrameProcessor.
1292
963
  *
1293
964
  * @param options - The options for the VideoFrameProcessor.
1294
965
  */
1295
- constructor(options = {}) {
1296
- const { canvasRenderingMode = "webgl2", fallbackWebGlTo2d = true } = options;
1297
- this.#canvasRenderingMode = canvasRenderingMode;
1298
- this.#canvas = document.createElement("canvas");
1299
- if (canvasRenderingMode === "2d") {
1300
- this.#initialize2dContext();
1301
- } else if (canvasRenderingMode === "webgl2") {
966
+ constructor(e = {}) {
967
+ const { canvasRenderingMode: r = "webgl2", fallbackWebGlTo2d: a = !0 } = e;
968
+ if (this.#i = r, this.#e = document.createElement("canvas"), r === "2d")
969
+ this.#d();
970
+ else if (r === "webgl2")
1302
971
  try {
1303
- this.#initializeWebGl2Context();
1304
- } catch (error) {
1305
- if (fallbackWebGlTo2d) {
972
+ this.#h();
973
+ } catch (n) {
974
+ if (a)
1306
975
  console.warn(
1307
976
  "Failed to create WebGL2 context, falling back to 2D canvas"
1308
- );
1309
- this.#canvasRenderingMode = "2d";
1310
- this.#initialize2dContext();
1311
- } else {
1312
- throw error;
1313
- }
977
+ ), this.#i = "2d", this.#d();
978
+ else
979
+ throw n;
1314
980
  }
1315
- } else {
981
+ else
1316
982
  throw new Error(
1317
- `Unsupported rendering context: ${canvasRenderingMode}`
983
+ `Unsupported rendering context: ${r}`
1318
984
  );
1319
- }
1320
985
  }
1321
986
  /**
1322
987
  * Initializes the 2D canvas context.
1323
988
  */
1324
- #initialize2dContext() {
1325
- const ctx = this.#canvas.getContext("2d", {
1326
- alpha: false,
1327
- willReadFrequently: true
989
+ #d() {
990
+ const e = this.#e.getContext("2d", {
991
+ alpha: !1,
992
+ willReadFrequently: !0
1328
993
  });
1329
- if (!ctx) throw new Error("CanvasRenderingContext2D is missing!");
1330
- this.#context2d = ctx;
994
+ if (!e) throw new Error("CanvasRenderingContext2D is missing!");
995
+ this.#o = e;
1331
996
  }
1332
997
  /**
1333
998
  * Initializes the WebGL2 context and resources.
1334
999
  */
1335
- #initializeWebGl2Context() {
1336
- const ctx = this.#canvas.getContext("webgl2", {
1337
- alpha: false,
1338
- depth: false,
1339
- stencil: false,
1340
- antialias: false,
1341
- premultipliedAlpha: false,
1342
- preserveDrawingBuffer: false,
1343
- desynchronized: false,
1000
+ #h() {
1001
+ const e = this.#e.getContext("webgl2", {
1002
+ alpha: !1,
1003
+ depth: !1,
1004
+ stencil: !1,
1005
+ antialias: !1,
1006
+ premultipliedAlpha: !1,
1007
+ preserveDrawingBuffer: !1,
1008
+ desynchronized: !1,
1344
1009
  powerPreference: "high-performance"
1345
1010
  });
1346
- if (!ctx) throw new Error("WebGL2RenderingContext is missing!");
1347
- this.#contextWebGl2 = ctx;
1348
- const texture = ctx.createTexture();
1349
- if (!texture) throw new Error("Failed to create WebGL texture");
1350
- this.#webGl2Texture = texture;
1351
- ctx.bindTexture(ctx.TEXTURE_2D, texture);
1352
- ctx.texParameteri(ctx.TEXTURE_2D, ctx.TEXTURE_WRAP_S, ctx.CLAMP_TO_EDGE);
1353
- ctx.texParameteri(ctx.TEXTURE_2D, ctx.TEXTURE_WRAP_T, ctx.CLAMP_TO_EDGE);
1354
- ctx.texParameteri(ctx.TEXTURE_2D, ctx.TEXTURE_MIN_FILTER, ctx.NEAREST);
1355
- ctx.texParameteri(ctx.TEXTURE_2D, ctx.TEXTURE_MAG_FILTER, ctx.NEAREST);
1356
- const framebuffer = ctx.createFramebuffer();
1357
- if (!framebuffer) throw new Error("Failed to create framebuffer");
1358
- this.#webGl2Framebuffer = framebuffer;
1359
- ctx.bindFramebuffer(ctx.FRAMEBUFFER, framebuffer);
1360
- ctx.framebufferTexture2D(
1361
- ctx.FRAMEBUFFER,
1362
- ctx.COLOR_ATTACHMENT0,
1363
- ctx.TEXTURE_2D,
1364
- texture,
1011
+ if (!e) throw new Error("WebGL2RenderingContext is missing!");
1012
+ this.#a = e;
1013
+ const r = e.createTexture();
1014
+ if (!r) throw new Error("Failed to create WebGL texture");
1015
+ this.#r = 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);
1016
+ const a = e.createFramebuffer();
1017
+ if (!a) throw new Error("Failed to create framebuffer");
1018
+ this.#n = a, e.bindFramebuffer(e.FRAMEBUFFER, a), e.framebufferTexture2D(
1019
+ e.FRAMEBUFFER,
1020
+ e.COLOR_ATTACHMENT0,
1021
+ e.TEXTURE_2D,
1022
+ r,
1365
1023
  0
1366
1024
  );
1367
1025
  }
@@ -1373,19 +1031,17 @@ class VideoFrameProcessor {
1373
1031
  *
1374
1032
  * @param arrayBuffer - The array buffer to reattach.
1375
1033
  */
1376
- reattachArrayBuffer(arrayBuffer) {
1377
- const actualBuffer = getBuffer(arrayBuffer);
1378
- if (isBufferDetached(actualBuffer)) {
1034
+ reattachArrayBuffer(e) {
1035
+ const r = Ie(e);
1036
+ if (se(r))
1379
1037
  throw new Error("Can't use a detached array buffer!");
1380
- }
1381
- const requiredSize = this.#cachedWidth * this.#cachedHeight * 4;
1382
- if (actualBuffer.byteLength === requiredSize) {
1383
- this.#buffer = new Uint8ClampedArray(actualBuffer);
1384
- } else {
1038
+ const a = this.#s * this.#l * 4;
1039
+ if (r.byteLength === a)
1040
+ this.#t = new Uint8ClampedArray(r);
1041
+ else
1385
1042
  throw new Error(
1386
- `ArrayBuffer size mismatch: expected ${requiredSize}, got ${actualBuffer.byteLength}`
1043
+ `ArrayBuffer size mismatch: expected ${a}, got ${r.byteLength}`
1387
1044
  );
1388
- }
1389
1045
  }
1390
1046
  /**
1391
1047
  * Used to check if the processor owns the buffer.
@@ -1393,10 +1049,9 @@ class VideoFrameProcessor {
1393
1049
  * @returns true if the processor owns the buffer, false otherwise.
1394
1050
  */
1395
1051
  isBufferDetached() {
1396
- if (!this.#buffer) {
1052
+ if (!this.#t)
1397
1053
  throw new Error("Buffer is missing!");
1398
- }
1399
- return isBufferDetached(this.#buffer.buffer);
1054
+ return se(this.#t.buffer);
1400
1055
  }
1401
1056
  /**
1402
1057
  * Extracts image data from a source element.
@@ -1405,8 +1060,8 @@ class VideoFrameProcessor {
1405
1060
  * @param area - The extraction area.
1406
1061
  * @returns The image data.
1407
1062
  */
1408
- getImageData(source, area) {
1409
- return this.#canvasRenderingMode === "2d" ? this.#getImageData2d(source, area) : this.#getImageDataWebGl2(source, area);
1063
+ getImageData(e, r) {
1064
+ return this.#i === "2d" ? this.#m(e, r) : this.#f(e, r);
1410
1065
  }
1411
1066
  /**
1412
1067
  * Used to get the current ImageData object with the current buffer. Useful
@@ -1416,10 +1071,9 @@ class VideoFrameProcessor {
1416
1071
  * @returns ImageData object with the current buffer
1417
1072
  */
1418
1073
  getCurrentImageData() {
1419
- if (!this.#buffer) {
1074
+ if (!this.#t)
1420
1075
  throw new Error("Buffer is missing!");
1421
- }
1422
- return new ImageData(this.#buffer, this.#cachedWidth, this.#cachedHeight);
1076
+ return new ImageData(this.#t, this.#s, this.#l);
1423
1077
  }
1424
1078
  /**
1425
1079
  * Extract image data using 2D canvas.
@@ -1428,18 +1082,11 @@ class VideoFrameProcessor {
1428
1082
  * @param area - The extraction area.
1429
1083
  * @returns The image data.
1430
1084
  */
1431
- #getImageData2d(source, area) {
1432
- if (!this.#context2d)
1085
+ #m(e, r) {
1086
+ if (!this.#o)
1433
1087
  throw new Error("CanvasRenderingContext2D is missing!");
1434
- const fullWidth = "videoWidth" in source ? source.videoWidth : source.width;
1435
- const fullHeight = "videoHeight" in source ? source.videoHeight : source.height;
1436
- const x = area?.x ?? 0;
1437
- const y = area?.y ?? 0;
1438
- const w = area?.width ?? fullWidth;
1439
- const h = area?.height ?? fullHeight;
1440
- this.#updateCanvasSize(w, h);
1441
- this.#context2d.drawImage(source, x, y, w, h);
1442
- return this.#context2d.getImageData(0, 0, w, h);
1088
+ const a = "videoWidth" in e ? e.videoWidth : e.width, n = "videoHeight" in e ? e.videoHeight : e.height, o = r?.x ?? 0, i = r?.y ?? 0, l = r?.width ?? a, c = r?.height ?? n;
1089
+ return this.#c(l, c), this.#o.drawImage(e, o, i, l, c), this.#o.getImageData(0, 0, l, c);
1443
1090
  }
1444
1091
  /**
1445
1092
  * Extract image data using WebGL2.
@@ -1448,43 +1095,26 @@ class VideoFrameProcessor {
1448
1095
  * @param area - The extraction area.
1449
1096
  * @returns The image data.
1450
1097
  */
1451
- #getImageDataWebGl2(source, area) {
1452
- if (!this.#contextWebGl2 || !this.#webGl2Texture || !this.#webGl2Framebuffer) {
1098
+ #f(e, r) {
1099
+ if (!this.#a || !this.#r || !this.#n)
1453
1100
  throw new Error("WebGL2 context or resources are missing!");
1454
- }
1455
- const fullWidth = "videoWidth" in source ? source.videoWidth : source.width;
1456
- const fullHeight = "videoHeight" in source ? source.videoHeight : source.height;
1457
- const x = area?.x ?? 0;
1458
- const y = area?.y ?? 0;
1459
- const w = area?.width ?? fullWidth;
1460
- const h = area?.height ?? fullHeight;
1461
- const requiredSize = w * h * 4;
1462
- this.#updateCanvasSize(w, h);
1463
- if (this.isBufferDetached()) {
1101
+ const a = "videoWidth" in e ? e.videoWidth : e.width, n = "videoHeight" in e ? e.videoHeight : e.height, o = r?.x ?? 0, i = r?.y ?? 0, l = r?.width ?? a, c = r?.height ?? n, d = l * c * 4;
1102
+ if (this.#c(l, c), this.isBufferDetached())
1464
1103
  throw new Error("Buffer is detached!");
1465
- }
1466
- if (!this.#buffer || this.#buffer.length !== requiredSize) {
1467
- this.#buffer = new Uint8ClampedArray(requiredSize);
1468
- }
1469
- const gl = this.#contextWebGl2;
1470
- gl.bindTexture(gl.TEXTURE_2D, this.#webGl2Texture);
1471
- gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, source);
1472
- gl.bindFramebuffer(gl.FRAMEBUFFER, this.#webGl2Framebuffer);
1104
+ (!this.#t || this.#t.length !== d) && (this.#t = new Uint8ClampedArray(d));
1105
+ const h = this.#a;
1106
+ h.bindTexture(h.TEXTURE_2D, this.#r), h.texImage2D(h.TEXTURE_2D, 0, h.RGBA, h.RGBA, h.UNSIGNED_BYTE, e), h.bindFramebuffer(h.FRAMEBUFFER, this.#n);
1473
1107
  try {
1474
- gl.pixelStorei(gl.PACK_ALIGNMENT, this.#requiredPackAlignment);
1475
- gl.readPixels(x, y, w, h, gl.RGBA, gl.UNSIGNED_BYTE, this.#buffer);
1476
- } catch (error) {
1477
- if (this.#requiredPackAlignment !== 1) {
1478
- this.#requiredPackAlignment = 1;
1479
- gl.pixelStorei(gl.PACK_ALIGNMENT, 1);
1480
- const newBuffer = new Uint8ClampedArray(requiredSize);
1481
- gl.readPixels(0, 0, w, h, gl.RGBA, gl.UNSIGNED_BYTE, newBuffer);
1482
- this.#buffer = newBuffer;
1483
- return new ImageData(newBuffer, w, h);
1108
+ h.pixelStorei(h.PACK_ALIGNMENT, this.#u), h.readPixels(o, i, l, c, h.RGBA, h.UNSIGNED_BYTE, this.#t);
1109
+ } catch (C) {
1110
+ if (this.#u !== 1) {
1111
+ this.#u = 1, h.pixelStorei(h.PACK_ALIGNMENT, 1);
1112
+ const w = new Uint8ClampedArray(d);
1113
+ return h.readPixels(0, 0, l, c, h.RGBA, h.UNSIGNED_BYTE, w), this.#t = w, new ImageData(w, l, c);
1484
1114
  }
1485
- throw error;
1115
+ throw C;
1486
1116
  }
1487
- return new ImageData(this.#buffer, w, h);
1117
+ return new ImageData(this.#t, l, c);
1488
1118
  }
1489
1119
  /**
1490
1120
  * Update canvas dimensions if needed.
@@ -1494,116 +1124,104 @@ class VideoFrameProcessor {
1494
1124
  * @param width - The width of the canvas.
1495
1125
  * @param height - The height of the canvas.
1496
1126
  */
1497
- #updateCanvasSize(width, height) {
1498
- if (this.#cachedWidth !== width || this.#cachedHeight !== height) {
1499
- this.#canvas.width = width;
1500
- this.#canvas.height = height;
1501
- this.#cachedWidth = width;
1502
- this.#cachedHeight = height;
1503
- const requiredSize = width * height * 4;
1504
- this.#buffer = new Uint8ClampedArray(requiredSize);
1127
+ #c(e, r) {
1128
+ if (this.#s !== e || this.#l !== r) {
1129
+ this.#e.width = e, this.#e.height = r, this.#s = e, this.#l = r;
1130
+ const a = e * r * 4;
1131
+ this.#t = new Uint8ClampedArray(a);
1505
1132
  }
1506
1133
  }
1507
1134
  /**
1508
1135
  * Clean up resources.
1509
1136
  */
1510
1137
  dispose() {
1511
- if (this.#contextWebGl2) {
1512
- if (this.#webGl2Texture) {
1513
- this.#contextWebGl2.deleteTexture(this.#webGl2Texture);
1514
- this.#webGl2Texture = null;
1515
- }
1516
- if (this.#webGl2Framebuffer) {
1517
- this.#contextWebGl2.deleteFramebuffer(this.#webGl2Framebuffer);
1518
- this.#webGl2Framebuffer = null;
1519
- }
1520
- }
1521
- this.#context2d = null;
1522
- this.#contextWebGl2 = null;
1523
- this.#buffer = null;
1138
+ this.#a && (this.#r && (this.#a.deleteTexture(this.#r), this.#r = null), this.#n && (this.#a.deleteFramebuffer(this.#n), this.#n = null)), this.#o = null, this.#a = null, this.#t = null;
1524
1139
  }
1525
1140
  }
1526
- const getBuffer = (buffer) => {
1527
- if (ArrayBuffer.isView(buffer)) {
1528
- return buffer.buffer;
1529
- } else {
1530
- return buffer;
1531
- }
1532
- };
1533
- const defaultCameraManagerOptions = {
1534
- mirrorFrontCameras: true
1141
+ const Ie = (t) => ArrayBuffer.isView(t) ? t.buffer : t, zt = {
1142
+ mirrorFrontCameras: !0,
1143
+ preferredResolution: "1080p"
1535
1144
  };
1536
- class CameraManager {
1537
- #resumeRequest;
1538
- #resolution = "4k";
1539
- #extractionArea;
1540
- #videoFrameRequestId;
1541
- #videoFrameProcessor;
1542
- #mirrorFrontCameras;
1543
- #eventListenerCleanup;
1145
+ class ta {
1146
+ #e;
1147
+ /**
1148
+ * The desired video resolution for camera streams. This is used as the ideal resolution
1149
+ * when starting camera streams. If a camera doesn't support the specified resolution,
1150
+ * the camera will automatically fall back to the next lower supported resolution in this order:
1151
+ * 4k → 1080p → 720p. The actual resolution used may differ from this setting based on
1152
+ * camera capabilities and system constraints.
1153
+ */
1154
+ #o;
1155
+ #a;
1156
+ #r;
1157
+ #n;
1158
+ #t;
1159
+ #s;
1544
1160
  /**
1545
1161
  * If true, the user has initiated an abort. This will prevent the
1546
1162
  * CameraManager from throwing errors when the user interrupts the process.
1547
1163
  */
1548
- #userInitiatedAbort = false;
1164
+ #l = !1;
1549
1165
  /**
1550
1166
  * If true, the user has initiated an abort. This will prevent the
1551
1167
  * CameraManager from throwing errors when the user interrupts the process.
1552
1168
  */
1553
1169
  get userInitiatedAbort() {
1554
- return this.#userInitiatedAbort;
1170
+ return this.#l;
1555
1171
  }
1556
- set userInitiatedAbort(value) {
1557
- this.#userInitiatedAbort = value;
1172
+ set userInitiatedAbort(e) {
1173
+ this.#l = e;
1558
1174
  }
1559
1175
  /**
1560
1176
  * Sets the area of the video frame that will be extracted.
1561
1177
  *
1562
1178
  * @param extractionArea The area of the video frame that will be extracted.
1563
1179
  */
1564
- setExtractionArea(extractionArea) {
1565
- this.#extractionArea = extractionArea;
1180
+ setExtractionArea(e) {
1181
+ this.#a = e;
1566
1182
  }
1567
1183
  /**
1568
1184
  * Callbacks that will be triggered on each frame when the playback state is
1569
1185
  * "capturing".
1570
1186
  */
1571
- #frameCaptureCallbacks = /* @__PURE__ */ new Set();
1187
+ #i = /* @__PURE__ */ new Set();
1572
1188
  /**
1573
1189
  * Creates a new CameraManager instance.
1574
1190
  *
1575
1191
  * @param options - The options for the CameraManager.
1576
1192
  * @param videoFrameProcessorOptions - The options for the VideoFrameProcessor.
1577
1193
  */
1578
- constructor(options = {}, videoFrameProcessorOptions) {
1579
- const { mirrorFrontCameras } = {
1580
- ...defaultCameraManagerOptions,
1581
- ...options
1194
+ constructor(e = {}, r) {
1195
+ const { mirrorFrontCameras: a, preferredResolution: n } = {
1196
+ ...zt,
1197
+ ...e
1582
1198
  };
1583
- this.#videoFrameProcessor = new VideoFrameProcessor(
1584
- videoFrameProcessorOptions
1585
- );
1586
- this.#mirrorFrontCameras = mirrorFrontCameras;
1199
+ this.#o = n, this.#n = new It(
1200
+ r
1201
+ ), this.#t = a;
1587
1202
  }
1588
1203
  /**
1589
- * Sets the resolution of the camera stream.
1204
+ * Sets the desired video resolution for camera streams. This is used as the ideal resolution
1205
+ * when starting camera streams. If a camera doesn't support the specified resolution,
1206
+ * the camera will automatically fall back to the next lower supported resolution in this order:
1207
+ * 4k → 1080p → 720p. If there's an active stream, it will be restarted with the new resolution.
1590
1208
  *
1591
- * @param resolution - The resolution to set.
1209
+ * @param resolution - The ideal resolution to set for camera streams.
1592
1210
  */
1593
- setResolution = async (resolution) => {
1594
- this.#resolution = resolution;
1595
- const playbackState = this.getState().playbackState;
1596
- if (playbackState !== "idle") {
1597
- this.#resumeRequest = playbackState;
1598
- this.stopStream();
1599
- await this.startCameraStream();
1600
- }
1211
+ setResolution = async (e) => {
1212
+ this.#o = e;
1213
+ const r = this.getState().playbackState;
1214
+ r !== "idle" && (this.#e = r, this.stopStream(), await this.startCameraStream());
1601
1215
  };
1602
1216
  /**
1603
- * The resolution of the camera stream.
1217
+ * The desired video resolution for camera streams. This is used as the ideal resolution
1218
+ * when starting camera streams. If a camera doesn't support the specified resolution,
1219
+ * the camera will automatically fall back to the next lower supported resolution in this order:
1220
+ * 4k → 1080p → 720p. The actual resolution used may differ from this setting based on
1221
+ * camera capabilities and system constraints.
1604
1222
  */
1605
1223
  get resolution() {
1606
- return this.#resolution;
1224
+ return this.#o;
1607
1225
  }
1608
1226
  /**
1609
1227
  * True if there is a video playing or capturing
@@ -1611,16 +1229,16 @@ class CameraManager {
1611
1229
  * @see https://developer.mozilla.org/en-US/docs/Web/API/MediaSession/playbackState for more details.
1612
1230
  */
1613
1231
  get isActive() {
1614
- return cameraManagerStore.getState().playbackState !== "idle";
1232
+ return m.getState().playbackState !== "idle";
1615
1233
  }
1616
1234
  /**
1617
1235
  * Sets the facing filter.
1618
1236
  *
1619
1237
  * @param facingFilter - The facing filter.
1620
1238
  */
1621
- setFacingFilter(facingFilter) {
1622
- cameraManagerStore.setState({
1623
- facingFilter
1239
+ setFacingFilter(e) {
1240
+ m.setState({
1241
+ facingFilter: e
1624
1242
  });
1625
1243
  }
1626
1244
  /**
@@ -1630,39 +1248,30 @@ class CameraManager {
1630
1248
  * @returns The cameras that are available to the user, filtered by the facing mode.
1631
1249
  */
1632
1250
  async getCameraDevices() {
1633
- let allCameras = cameraManagerStore.getState().cameras;
1634
- const facingFilter = cameraManagerStore.getState().facingFilter;
1635
- if (!allCameras.length) {
1636
- await this.refreshCameraDevices();
1637
- }
1638
- allCameras = cameraManagerStore.getState().cameras;
1639
- if (!facingFilter) {
1640
- return allCameras;
1641
- }
1642
- const filteredCameras = allCameras.filter(
1643
- (camera) => facingFilter.includes(camera.facingMode)
1644
- );
1645
- return filteredCameras;
1251
+ let e = m.getState().cameras;
1252
+ const r = m.getState().facingFilter;
1253
+ return e.length || await this.refreshCameraDevices(), e = m.getState().cameras, r ? e.filter(
1254
+ (n) => r.includes(n.facingMode)
1255
+ ) : e;
1646
1256
  }
1647
1257
  /**
1648
1258
  * Single-time setup for a video element.
1649
1259
  *
1650
1260
  * @param videoElement - The video element to initialize.
1651
1261
  */
1652
- #initVideoElement(videoElement) {
1653
- if (!(videoElement instanceof HTMLVideoElement)) {
1262
+ #u(e) {
1263
+ if (!(e instanceof HTMLVideoElement))
1654
1264
  throw new Error(
1655
- `Expected an HTMLVideoElement, got ${typeof videoElement}`,
1265
+ `Expected an HTMLVideoElement, got ${typeof e}`,
1656
1266
  {
1657
- cause: videoElement
1267
+ cause: e
1658
1268
  }
1659
1269
  );
1660
- }
1661
- cameraManagerStore.setState({
1662
- videoElement
1270
+ m.setState({
1271
+ videoElement: e
1663
1272
  });
1664
- const videoEventCleanup = rad(videoElement, (add) => {
1665
- const events = [
1273
+ const r = Dt(e, (i) => {
1274
+ [
1666
1275
  "abort"
1667
1276
  // "error",
1668
1277
  // "canplay",
@@ -1681,48 +1290,36 @@ class CameraManager {
1681
1290
  // "timeupdate",
1682
1291
  // "ratechange",
1683
1292
  // "durationchange",
1684
- ];
1685
- events.forEach((event) => {
1686
- add(event, () => {
1687
- console.debug(`Video event: ${event}`);
1293
+ ].forEach((c) => {
1294
+ i(c, () => {
1295
+ console.debug(`Video event: ${c}`);
1688
1296
  });
1689
1297
  });
1690
1298
  });
1691
- const connectionObserver = new ConnectionObserver((entries) => {
1692
- if (!entries[0].connected) {
1693
- this.releaseVideoElement();
1694
- }
1695
- });
1696
- connectionObserver.observe(videoElement);
1697
- videoElement.setAttribute("playsInline", "");
1698
- videoElement.setAttribute("muted", "");
1699
- videoElement.controls = false;
1700
- let previousPlaybackState = "idle";
1701
- const cleanupVisibilityListener = radEventListener(
1299
+ new N((i) => {
1300
+ i[0].connected || this.releaseVideoElement();
1301
+ }).observe(e), e.setAttribute("playsInline", ""), e.setAttribute("muted", ""), e.controls = !1;
1302
+ let n = "idle";
1303
+ const o = Ft(
1702
1304
  document,
1703
1305
  "visibilitychange",
1704
1306
  async () => {
1705
- const isHidden = document.hidden;
1706
- if (isHidden) {
1707
- previousPlaybackState = cameraManagerStore.getState().playbackState;
1708
- this.stopStream();
1307
+ if (document.hidden) {
1308
+ n = m.getState().playbackState, this.stopStream();
1709
1309
  return;
1710
1310
  }
1711
- switch (previousPlaybackState) {
1311
+ switch (n) {
1712
1312
  case "playback":
1713
- await this.startCameraStream();
1714
- await this.startPlayback();
1313
+ await this.startCameraStream(), await this.startPlayback();
1715
1314
  break;
1716
1315
  case "capturing":
1717
- await this.startCameraStream();
1718
- await this.startFrameCapture();
1316
+ await this.startCameraStream(), await this.startFrameCapture();
1719
1317
  break;
1720
1318
  }
1721
1319
  }
1722
1320
  );
1723
- this.#eventListenerCleanup = () => {
1724
- cleanupVisibilityListener();
1725
- videoEventCleanup();
1321
+ this.#s = () => {
1322
+ o(), r();
1726
1323
  };
1727
1324
  }
1728
1325
  /**
@@ -1730,15 +1327,14 @@ class CameraManager {
1730
1327
  *
1731
1328
  * @param videoElement - The video element to initialize.
1732
1329
  */
1733
- initVideoElement(videoElement) {
1330
+ initVideoElement(e) {
1734
1331
  try {
1735
- this.#initVideoElement(videoElement);
1736
- } catch (error) {
1737
- if (this.userInitiatedAbort) {
1332
+ this.#u(e);
1333
+ } catch (r) {
1334
+ if (this.userInitiatedAbort)
1738
1335
  this.reset();
1739
- } else {
1740
- throw error;
1741
- }
1336
+ else
1337
+ throw r;
1742
1338
  }
1743
1339
  }
1744
1340
  /**
@@ -1748,19 +1344,16 @@ class CameraManager {
1748
1344
  * @param frameCaptureCallback - The callback to add.
1749
1345
  * @returns a cleanup function to remove the callback
1750
1346
  */
1751
- addFrameCaptureCallback(frameCaptureCallback) {
1752
- this.#frameCaptureCallbacks.add(frameCaptureCallback);
1753
- return () => this.#frameCaptureCallbacks.delete(frameCaptureCallback);
1347
+ addFrameCaptureCallback(e) {
1348
+ return this.#i.add(e), () => this.#i.delete(e);
1754
1349
  }
1755
1350
  /**
1756
1351
  * Cleans up the video element, and stops the stream.
1757
1352
  */
1758
1353
  releaseVideoElement() {
1759
- this.#eventListenerCleanup?.();
1760
- cameraManagerStore.setState({
1354
+ this.#s?.(), m.setState({
1761
1355
  videoElement: void 0
1762
- });
1763
- this.stopStream();
1356
+ }), this.stopStream();
1764
1357
  }
1765
1358
  // TODO: might become a private method in the future as an implementation detail of `startStream`
1766
1359
  /**
@@ -1768,43 +1361,24 @@ class CameraManager {
1768
1361
  *
1769
1362
  * @param camera - The camera to select.
1770
1363
  */
1771
- async selectCamera(camera) {
1772
- const playbackState = cameraManagerStore.getState().playbackState;
1773
- if (playbackState !== "idle") {
1774
- this.#resumeRequest = playbackState;
1775
- }
1776
- const state = cameraManagerStore.getState();
1777
- if (state.selectedCamera === camera) {
1364
+ async selectCamera(e) {
1365
+ const r = m.getState().playbackState;
1366
+ r !== "idle" && (this.#e = r);
1367
+ const a = m.getState();
1368
+ if (a.selectedCamera === e) {
1778
1369
  console.debug("Already selected");
1779
1370
  return;
1780
1371
  }
1781
- if (state.isSwappingCamera) {
1372
+ if (a.isSwappingCamera) {
1782
1373
  console.debug("Already swapping");
1783
1374
  return;
1784
1375
  }
1785
- cameraManagerStore.setState({
1786
- isSwappingCamera: true
1787
- });
1788
- if (state.selectedCamera?.activeStream) {
1789
- console.debug("Stopping previous stream");
1790
- state.selectedCamera.stopStream();
1791
- }
1792
- if (state.videoElement) {
1793
- state.videoElement.srcObject = null;
1794
- }
1795
- cameraManagerStore.setState({
1796
- selectedCamera: camera,
1797
- isSwappingCamera: false
1798
- });
1799
- if (this.#resumeRequest === "playback") {
1800
- console.debug("Starting new stream");
1801
- await this.startPlayback();
1802
- }
1803
- if (this.#resumeRequest === "capturing") {
1804
- console.debug("Resuming frame capture");
1805
- await this.startFrameCapture();
1806
- }
1807
- this.#resumeRequest = void 0;
1376
+ m.setState({
1377
+ isSwappingCamera: !0
1378
+ }), a.selectedCamera?.activeStream && (console.debug("Stopping previous stream"), a.selectedCamera.stopStream()), a.videoElement && (a.videoElement.srcObject = null), m.setState({
1379
+ selectedCamera: e,
1380
+ isSwappingCamera: !1
1381
+ }), 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;
1808
1382
  }
1809
1383
  /**
1810
1384
  * Refreshes available devices on the system and updates the state.
@@ -1812,50 +1386,38 @@ class CameraManager {
1812
1386
  * @returns resolves when the camera devices are refreshed
1813
1387
  */
1814
1388
  async refreshCameraDevices() {
1815
- if (cameraManagerStore.getState().isQueryingCameras || cameraManagerStore.getState().isSwappingCamera) {
1389
+ if (m.getState().isQueryingCameras || m.getState().isSwappingCamera) {
1816
1390
  console.debug("Already querying cameras");
1817
1391
  return;
1818
1392
  }
1819
- cameraManagerStore.setState({
1820
- isQueryingCameras: true
1393
+ m.setState({
1394
+ isQueryingCameras: !0
1821
1395
  });
1822
- const availableCameras = await obtainVideoInputDevices().catch((err) => {
1823
- cameraManagerStore.setState({
1824
- errorState: asError(err),
1825
- isQueryingCameras: false
1826
- });
1827
- throw err;
1828
- });
1829
- const cameras = createCameras(availableCameras);
1830
- cameras.forEach((camera) => {
1831
- if (camera.notifyStateChange) {
1832
- return;
1833
- }
1834
- camera.notifyStateChange = (camInstance, reason) => {
1396
+ const e = await ut().catch((a) => {
1397
+ throw m.setState({
1398
+ errorState: K(a),
1399
+ isQueryingCameras: !1
1400
+ }), a;
1401
+ }), r = gt(e);
1402
+ r.forEach((a) => {
1403
+ a.notifyStateChange || (a.notifyStateChange = (n, o) => {
1835
1404
  window.queueMicrotask(() => {
1836
- cameraManagerStore.setState({
1837
- cameras: [...cameraManagerStore.getState().cameras]
1405
+ m.setState({
1406
+ cameras: [...m.getState().cameras]
1838
1407
  });
1839
- const selectedCamera = cameraManagerStore.getState().selectedCamera;
1840
- if (!selectedCamera) {
1408
+ const i = m.getState().selectedCamera;
1409
+ if (!i)
1841
1410
  return;
1842
- }
1843
- let streamError;
1844
- if (typeof reason === "object" && reason !== null && "payload" in reason && reason.payload === "TRACK_END") {
1845
- streamError = new Error("Camera stream ended unexpectedly");
1846
- }
1847
- if (camInstance === selectedCamera) {
1848
- cameraManagerStore.setState({
1849
- selectedCamera,
1850
- errorState: streamError
1851
- });
1852
- }
1411
+ let l;
1412
+ typeof o == "object" && o !== null && "payload" in o && o.payload === "TRACK_END" && (l = new Error("Camera stream ended unexpectedly")), n === i && m.setState({
1413
+ selectedCamera: i,
1414
+ errorState: l
1415
+ });
1853
1416
  });
1854
- };
1855
- });
1856
- cameraManagerStore.setState({
1857
- cameras,
1858
- isQueryingCameras: false
1417
+ });
1418
+ }), m.setState({
1419
+ cameras: r,
1420
+ isQueryingCameras: !1
1859
1421
  });
1860
1422
  }
1861
1423
  /**
@@ -1864,34 +1426,29 @@ class CameraManager {
1864
1426
  * @returns resolves when playback starts
1865
1427
  */
1866
1428
  async startPlayback() {
1867
- const state = cameraManagerStore.getState();
1868
- if (this.isActive && !this.#resumeRequest) {
1869
- return;
1870
- }
1871
- if (!state.videoElement) {
1872
- console.warn("Starting playback - no video element present.");
1873
- return;
1874
- }
1875
- if (!state.selectedCamera) {
1876
- console.warn("Select a camera first.");
1877
- return;
1878
- }
1879
- if (!state.selectedCamera.activeStream) {
1880
- const stream = await state.selectedCamera.startStream(this.resolution);
1881
- state.videoElement.srcObject = stream;
1882
- }
1883
- try {
1884
- this.#applyMirrorIfNeeded();
1885
- await state.videoElement.play();
1886
- cameraManagerStore.setState({
1887
- playbackState: "playback"
1888
- });
1889
- } catch (error) {
1890
- console.error("Failed to start playback", error);
1891
- cameraManagerStore.setState({
1892
- errorState: asError(error)
1893
- });
1894
- throw error;
1429
+ const e = m.getState();
1430
+ if (!(this.isActive && !this.#e)) {
1431
+ if (!e.videoElement) {
1432
+ console.warn("Starting playback - no video element present.");
1433
+ return;
1434
+ }
1435
+ if (!e.selectedCamera) {
1436
+ console.warn("Select a camera first.");
1437
+ return;
1438
+ }
1439
+ if (!e.selectedCamera.activeStream) {
1440
+ const r = await e.selectedCamera.startStream(this.resolution);
1441
+ e.videoElement.srcObject = r;
1442
+ }
1443
+ try {
1444
+ this.#g(), await e.videoElement.play(), m.setState({
1445
+ playbackState: "playback"
1446
+ });
1447
+ } catch (r) {
1448
+ throw console.error("Failed to start playback", r), m.setState({
1449
+ errorState: K(r)
1450
+ }), r;
1451
+ }
1895
1452
  }
1896
1453
  }
1897
1454
  /**
@@ -1899,32 +1456,25 @@ class CameraManager {
1899
1456
  *
1900
1457
  * @returns resolves when frame capture starts
1901
1458
  */
1902
- async #startFrameCapture() {
1903
- const state = cameraManagerStore.getState();
1904
- if (this.userInitiatedAbort) {
1905
- return;
1906
- }
1907
- if (state.playbackState === "capturing" && this.#resumeRequest !== "capturing") {
1908
- return;
1909
- }
1910
- if (!state.videoElement) {
1911
- console.warn(
1912
- "Missing video element. Setup a video element first using `initVideoElement`"
1913
- );
1914
- return;
1915
- }
1916
- if (!state.selectedCamera) {
1917
- console.warn(
1918
- "No active camera! Select a camera first, or use `startCameraStream`"
1919
- );
1920
- return;
1459
+ async #d() {
1460
+ const e = m.getState();
1461
+ if (!this.userInitiatedAbort && !(e.playbackState === "capturing" && this.#e !== "capturing")) {
1462
+ if (!e.videoElement) {
1463
+ console.warn(
1464
+ "Missing video element. Setup a video element first using `initVideoElement`"
1465
+ );
1466
+ return;
1467
+ }
1468
+ if (!e.selectedCamera) {
1469
+ console.warn(
1470
+ "No active camera! Select a camera first, or use `startCameraStream`"
1471
+ );
1472
+ return;
1473
+ }
1474
+ await this.startPlayback(), m.setState({
1475
+ playbackState: "capturing"
1476
+ }), this.#c(), this.#e = void 0;
1921
1477
  }
1922
- await this.startPlayback();
1923
- cameraManagerStore.setState({
1924
- playbackState: "capturing"
1925
- });
1926
- this.#queueFrame();
1927
- this.#resumeRequest = void 0;
1928
1478
  }
1929
1479
  /**
1930
1480
  * Starts capturing frames from the video element.
@@ -1933,13 +1483,12 @@ class CameraManager {
1933
1483
  */
1934
1484
  startFrameCapture = async () => {
1935
1485
  try {
1936
- await this.#startFrameCapture();
1937
- } catch (error) {
1938
- if (this.userInitiatedAbort) {
1486
+ await this.#d();
1487
+ } catch (e) {
1488
+ if (this.userInitiatedAbort)
1939
1489
  this.reset();
1940
- } else {
1941
- throw error;
1942
- }
1490
+ else
1491
+ throw e;
1943
1492
  }
1944
1493
  };
1945
1494
  /**
@@ -1948,82 +1497,55 @@ class CameraManager {
1948
1497
  * @param params - The parameters for the camera stream.
1949
1498
  * @returns resolves when the camera stream starts
1950
1499
  */
1951
- async #startCameraStream({
1952
- autoplay = true,
1953
- preferredCamera,
1954
- preferredFacing
1500
+ async #h({
1501
+ autoplay: e = !0,
1502
+ preferredCamera: r,
1503
+ preferredFacing: a
1955
1504
  } = {}) {
1956
- const videoElement = cameraManagerStore.getState().videoElement;
1957
- if (!videoElement) {
1505
+ const n = m.getState().videoElement;
1506
+ if (!n) {
1958
1507
  console.warn("Can't start stream without a video element");
1959
1508
  return;
1960
1509
  }
1961
- if (this.isActive && !this.#resumeRequest) {
1510
+ if (this.isActive && !this.#e) {
1962
1511
  console.warn("Already streaming");
1963
1512
  return;
1964
1513
  }
1965
- if (preferredCamera instanceof Camera) {
1966
- await this.selectCamera(preferredCamera);
1967
- }
1968
- if (!cameraManagerStore.getState().selectedCamera) {
1514
+ if (r instanceof Ae && await this.selectCamera(r), !m.getState().selectedCamera)
1969
1515
  try {
1970
- const cameras = await this.getCameraDevices();
1971
- let selectedCamera2;
1972
- if (!cameras.length) {
1973
- console.log("Camera list is empty");
1974
- throw new Error(
1975
- `No cameras found matching the filter ${preferredFacing}`
1976
- );
1977
- }
1978
- if (typeof preferredCamera === "function") {
1979
- selectedCamera2 = preferredCamera(cameras);
1980
- if (!selectedCamera2) {
1981
- console.warn(
1982
- `No camera found matching the preferred camera function, falling back to facing mode`
1983
- );
1984
- }
1985
- }
1986
- if (!selectedCamera2) {
1987
- selectedCamera2 = await findIdealCamera(
1988
- cameras,
1989
- this.resolution,
1990
- preferredFacing
1516
+ const l = await this.getCameraDevices();
1517
+ let c;
1518
+ if (!l.length)
1519
+ throw console.log("Camera list is empty"), new Error(
1520
+ `No cameras found matching the filter ${a}`
1991
1521
  );
1992
- }
1993
- if (!selectedCamera2) {
1522
+ if (typeof r == "function" && (c = r(l), c || console.warn(
1523
+ "No camera found matching the preferred camera function, falling back to facing mode"
1524
+ )), c || (c = await ft(
1525
+ l,
1526
+ this.resolution,
1527
+ a
1528
+ )), !c)
1994
1529
  throw new Error(
1995
- `No cameras found matching the filter ${preferredFacing}`
1530
+ `No cameras found matching the filter ${a}`
1996
1531
  );
1997
- }
1998
- await this.selectCamera(selectedCamera2);
1999
- if (this.#hasPermissionError()) {
2000
- cameraManagerStore.setState({
2001
- errorState: void 0
2002
- });
2003
- }
2004
- } catch (error) {
2005
- cameraManagerStore.setState({
2006
- errorState: asError(error)
1532
+ await this.selectCamera(c), this.#m() && m.setState({
1533
+ errorState: void 0
2007
1534
  });
2008
- throw error;
1535
+ } catch (l) {
1536
+ throw m.setState({
1537
+ errorState: K(l)
1538
+ }), l;
2009
1539
  }
2010
- }
2011
- const selectedCamera = cameraManagerStore.getState().selectedCamera;
2012
- if (!selectedCamera) {
2013
- console.warn("No selected camera!");
2014
- throw new Error("No selected camera");
2015
- }
2016
- const stream = await selectedCamera.startStream(this.#resolution);
2017
- if (!videoElement.isConnected) {
1540
+ const o = m.getState().selectedCamera;
1541
+ if (!o)
1542
+ throw console.warn("No selected camera!"), new Error("No selected camera");
1543
+ const i = await o.startStream(this.#o);
1544
+ if (!n.isConnected)
2018
1545
  throw new Error("Video element needs to be in the document!");
2019
- }
2020
- videoElement.srcObject = stream;
2021
- cameraManagerStore.setState({
2022
- videoElement
2023
- });
2024
- if (autoplay) {
2025
- await this.startPlayback();
2026
- }
1546
+ n.srcObject = i, m.setState({
1547
+ videoElement: n
1548
+ }), e && await this.startPlayback();
2027
1549
  }
2028
1550
  /**
2029
1551
  * Starts a best-effort camera stream. Will pick a camera automatically if
@@ -2032,15 +1554,14 @@ class CameraManager {
2032
1554
  * @param params - The parameters for the camera stream.
2033
1555
  * @returns resolves when the camera stream starts
2034
1556
  */
2035
- async startCameraStream(params = {}) {
1557
+ async startCameraStream(e = {}) {
2036
1558
  try {
2037
- await this.#startCameraStream(params);
2038
- } catch (error) {
2039
- if (this.userInitiatedAbort) {
1559
+ await this.#h(e);
1560
+ } catch (r) {
1561
+ if (this.userInitiatedAbort)
2040
1562
  this.reset();
2041
- } else {
2042
- throw error;
2043
- }
1563
+ else
1564
+ throw r;
2044
1565
  }
2045
1566
  }
2046
1567
  /**
@@ -2048,15 +1569,15 @@ class CameraManager {
2048
1569
  *
2049
1570
  * @returns true if the error state is a permission error
2050
1571
  */
2051
- #hasPermissionError = () => {
2052
- const errorState = cameraManagerStore.getState().errorState;
2053
- return errorState instanceof CameraError && errorState.code === "PERMISSION_DENIED";
1572
+ #m = () => {
1573
+ const e = m.getState().errorState;
1574
+ return e instanceof xe && e.code === "PERMISSION_DENIED";
2054
1575
  };
2055
1576
  /**
2056
1577
  * Pauses capturing frames, without stopping playback.
2057
1578
  */
2058
1579
  stopFrameCapture() {
2059
- cameraManagerStore.setState({
1580
+ m.setState({
2060
1581
  playbackState: "playback"
2061
1582
  });
2062
1583
  }
@@ -2065,130 +1586,94 @@ class CameraManager {
2065
1586
  */
2066
1587
  stopStream() {
2067
1588
  console.debug("stopStream called");
2068
- const state = cameraManagerStore.getState();
2069
- this.pausePlayback();
2070
- state.selectedCamera?.stopStream();
2071
- if (state.videoElement) {
2072
- state.videoElement.srcObject = null;
2073
- }
1589
+ const e = m.getState();
1590
+ this.pausePlayback(), e.selectedCamera?.stopStream(), e.videoElement && (e.videoElement.srcObject = null);
2074
1591
  }
2075
1592
  /**
2076
1593
  * Pauses the video playback. This will also stop the capturing process.
2077
1594
  */
2078
1595
  pausePlayback() {
2079
1596
  console.debug("pausePlayback called");
2080
- const video = cameraManagerStore.getState().videoElement;
2081
- cameraManagerStore.setState({
1597
+ const e = m.getState().videoElement;
1598
+ m.setState({
2082
1599
  playbackState: "idle"
2083
- });
2084
- if (!video) {
2085
- return;
2086
- }
2087
- if (this.#videoFrameRequestId) {
2088
- video.cancelVideoFrameCallback(this.#videoFrameRequestId);
2089
- }
2090
- video.pause();
1600
+ }), e && (this.#r && e.cancelVideoFrameCallback(this.#r), e.pause());
2091
1601
  }
2092
1602
  /**
2093
1603
  * The main recognition loop. Do not call this method directly, use `#queueFrame` instead.
2094
1604
  */
2095
- async #loop() {
2096
- const state = cameraManagerStore.getState();
2097
- if (this.#videoFrameRequestId === void 0) {
1605
+ async #f() {
1606
+ const e = m.getState();
1607
+ if (this.#r === void 0) {
2098
1608
  console.error("Missing request ID");
2099
1609
  return;
2100
1610
  }
2101
- if (!state.videoElement) {
1611
+ if (!e.videoElement) {
2102
1612
  console.warn("Missing video element, should not happen");
2103
1613
  return;
2104
1614
  }
2105
- const isSameOrientation = state.videoElement.videoHeight >= state.videoElement.videoWidth === this.#extractionArea.height >= this.#extractionArea.width;
2106
- if (!isSameOrientation) {
2107
- return this.#queueFrame();
2108
- }
2109
- if (this.#frameCaptureCallbacks.size !== 0) {
2110
- const capturedFrame = this.#videoFrameProcessor.getImageData(
2111
- state.videoElement,
2112
- this.#extractionArea
1615
+ if (!(e.videoElement.videoHeight >= e.videoElement.videoWidth == this.#a.height >= this.#a.width))
1616
+ return this.#c();
1617
+ if (this.#i.size !== 0) {
1618
+ const a = this.#n.getImageData(
1619
+ e.videoElement,
1620
+ this.#a
2113
1621
  );
2114
- for (const callback of this.#frameCaptureCallbacks) {
2115
- const workingFrame = isBufferDetached(capturedFrame.data) ? this.#videoFrameProcessor.getCurrentImageData() : capturedFrame;
2116
- const returnedBuffer = await callback(workingFrame);
2117
- if (!returnedBuffer) {
2118
- continue;
2119
- }
2120
- if (!(returnedBuffer instanceof ArrayBuffer)) {
2121
- throw new Error(
2122
- stripIndents`
1622
+ for (const n of this.#i) {
1623
+ const o = se(a.data) ? this.#n.getCurrentImageData() : a, i = await n(o);
1624
+ if (i) {
1625
+ if (!(i instanceof ArrayBuffer))
1626
+ throw new Error(
1627
+ Me`
2123
1628
  Frame capture callback did not return an ArrayBuffer.
2124
1629
  Make sure to return the underlying buffer, not the view.
2125
1630
  `
2126
- );
1631
+ );
1632
+ this.#n.reattachArrayBuffer(i);
2127
1633
  }
2128
- this.#videoFrameProcessor.reattachArrayBuffer(returnedBuffer);
2129
1634
  }
2130
1635
  }
2131
- this.#queueFrame();
1636
+ this.#c();
2132
1637
  }
2133
1638
  /**
2134
1639
  * Queues the next frame to be processed.
2135
1640
  */
2136
- #queueFrame() {
2137
- const state = cameraManagerStore.getState();
2138
- if (state.playbackState !== "capturing") {
2139
- return;
2140
- }
2141
- if (!state.videoElement) {
2142
- console.warn("Missing video element, should not happen");
2143
- return;
2144
- }
2145
- if (this.#videoFrameRequestId) {
2146
- state.videoElement.cancelVideoFrameCallback(this.#videoFrameRequestId);
1641
+ #c() {
1642
+ const e = m.getState();
1643
+ if (e.playbackState === "capturing") {
1644
+ if (!e.videoElement) {
1645
+ console.warn("Missing video element, should not happen");
1646
+ return;
1647
+ }
1648
+ this.#r && e.videoElement.cancelVideoFrameCallback(this.#r), this.#r = e.videoElement.requestVideoFrameCallback(
1649
+ () => void this.#f()
1650
+ );
2147
1651
  }
2148
- this.#videoFrameRequestId = state.videoElement.requestVideoFrameCallback(
2149
- () => void this.#loop()
2150
- );
2151
1652
  }
2152
1653
  /**
2153
1654
  * Applies a mirror effect to the video if the camera is front-facing.
2154
1655
  * Assumes that desktop devices don't return a facing mode and that they are front-facing.
2155
1656
  */
2156
- #applyMirrorIfNeeded() {
2157
- const camera = cameraManagerStore.getState().selectedCamera;
2158
- if (!camera) {
1657
+ #g() {
1658
+ const e = m.getState().selectedCamera;
1659
+ if (!e) {
2159
1660
  console.warn("No camera selected");
2160
1661
  return;
2161
1662
  }
2162
- if (!this.#mirrorFrontCameras) {
2163
- return;
2164
- }
2165
- if (camera.facingMode !== "back") {
2166
- this.setCameraMirrorX(true);
2167
- } else {
2168
- this.setCameraMirrorX(false);
2169
- }
1663
+ this.#t && (e.facingMode !== "back" ? this.setCameraMirrorX(!0) : this.setCameraMirrorX(!1));
2170
1664
  }
2171
1665
  /**
2172
1666
  * If true, the video and captured frames will be mirrored horizontally.
2173
1667
  *
2174
1668
  * @param mirrorX - If true, the video and captured frames will be mirrored horizontally.
2175
1669
  */
2176
- setCameraMirrorX(mirrorX) {
2177
- const currentState = cameraManagerStore.getState();
2178
- const videoElement = currentState.videoElement;
2179
- if (!videoElement) {
1670
+ setCameraMirrorX(e) {
1671
+ const r = m.getState(), a = r.videoElement;
1672
+ if (!a) {
2180
1673
  console.warn("Mirror video - no video element present.");
2181
1674
  return;
2182
1675
  }
2183
- if (currentState.mirrorX === mirrorX) {
2184
- return;
2185
- }
2186
- if (mirrorX) {
2187
- videoElement.style.scale = "-1 1";
2188
- } else {
2189
- videoElement.style.removeProperty("scale");
2190
- }
2191
- cameraManagerStore.setState({ mirrorX });
1676
+ r.mirrorX !== e && (e ? a.style.scale = "-1 1" : a.style.removeProperty("scale"), m.setState({ mirrorX: e }));
2192
1677
  }
2193
1678
  // The "typeof" is necessary to avoid a circular dependency when resolving types
2194
1679
  /**
@@ -2198,68 +1683,62 @@ class CameraManager {
2198
1683
  *
2199
1684
  * @returns a cleanup function to remove the subscription
2200
1685
  */
2201
- subscribe = cameraManagerStore.subscribe;
1686
+ subscribe = m.subscribe;
2202
1687
  /**
2203
1688
  * Gets the current internal state of the CameraManager.
2204
1689
  *
2205
1690
  * @returns the current state of the CameraManager
2206
1691
  */
2207
- getState = cameraManagerStore.getState;
1692
+ getState = m.getState;
2208
1693
  /**
2209
1694
  * Resets the CameraManager and stops all streams.
2210
1695
  */
2211
1696
  reset() {
2212
- console.debug("Resetting camera manager");
2213
- this.#frameCaptureCallbacks.clear();
2214
- this.stopStream();
2215
- resetCameraManagerStore();
1697
+ console.debug("Resetting camera manager"), this.#i.clear(), this.stopStream(), yt();
2216
1698
  }
2217
1699
  }
2218
- const CameraUiStoreContext = createContext();
2219
- function createCameraManagerSolidStore() {
2220
- return createWithSignal(cameraManagerStore);
1700
+ const ze = we();
1701
+ function Lt() {
1702
+ return Ce(m);
2221
1703
  }
2222
- const CameraUiStoreProvider = (props) => {
2223
- const contextValue = {
2224
- cameraManagerSolidStore: createCameraManagerSolidStore(),
1704
+ const Nt = (t) => {
1705
+ const e = {
1706
+ cameraManagerSolidStore: Lt(),
2225
1707
  // eslint-disable-next-line solid/reactivity
2226
- cameraManager: props.cameraManager,
1708
+ cameraManager: t.cameraManager,
2227
1709
  // eslint-disable-next-line solid/reactivity
2228
1710
  dismountCameraUi: () => {
2229
- props.cameraManager.userInitiatedAbort = true;
2230
- props.dismountCameraUi();
1711
+ t.cameraManager.userInitiatedAbort = !0, t.dismountCameraUi();
2231
1712
  },
2232
1713
  // eslint-disable-next-line solid/reactivity
2233
- addOnDismountCallback: props.addOnDismountCallback,
1714
+ addOnDismountCallback: t.addOnDismountCallback,
2234
1715
  // eslint-disable-next-line solid/reactivity
2235
- mountTarget: props.mountTarget,
1716
+ mountTarget: t.mountTarget,
2236
1717
  // eslint-disable-next-line solid/reactivity
2237
- showMirrorCameraButton: props.showMirrorCameraButton,
1718
+ showMirrorCameraButton: t.showMirrorCameraButton,
2238
1719
  // eslint-disable-next-line solid/reactivity
2239
- showTorchButton: props.showTorchButton,
1720
+ showTorchButton: t.showTorchButton,
2240
1721
  // eslint-disable-next-line solid/reactivity
2241
- showCloseButton: props.showCloseButton,
1722
+ showCloseButton: t.showCloseButton,
2242
1723
  // eslint-disable-next-line solid/reactivity
2243
- showCameraErrorModal: props.showCameraErrorModal
1724
+ showCameraErrorModal: t.showCameraErrorModal
2244
1725
  };
2245
- onCleanup(() => {
1726
+ return ce(() => {
2246
1727
  console.debug("CameraUiStoreProvider cleanup");
2247
- });
2248
- return createComponent(CameraUiStoreContext.Provider, {
2249
- value: contextValue,
1728
+ }), s(ze.Provider, {
1729
+ value: e,
2250
1730
  get children() {
2251
- return props.children;
1731
+ return t.children;
2252
1732
  }
2253
1733
  });
2254
1734
  };
2255
- function useCameraUiStore() {
2256
- const ctx = useContext(CameraUiStoreContext);
2257
- if (!ctx) {
1735
+ function j() {
1736
+ const t = ye(ze);
1737
+ if (!t)
2258
1738
  throw new Error("StoreContext.Provider not in scope");
2259
- }
2260
- return ctx;
1739
+ return t;
2261
1740
  }
2262
- const enLocaleStrings = {
1741
+ const Bt = {
2263
1742
  selected_camera: "Selected camera",
2264
1743
  loading_cameras: "Loading cameras...",
2265
1744
  select_a_camera: "Select a camera",
@@ -2272,277 +1751,230 @@ const enLocaleStrings = {
2272
1751
  camera_error_details: "Please allow camera access in your browser and try again.",
2273
1752
  camera_error_cancel_btn: "Cancel",
2274
1753
  camera_error_primary_btn: "Retry"
2275
- };
2276
- const LocalizationContext = createContext();
2277
- const LocalizationProvider = (props) => {
2278
- const [localizationStore, updateLocalizationStore] = createStore$1(
1754
+ }, Le = we(), Ot = (t) => {
1755
+ const [e, r] = Ke(
2279
1756
  // we structure clone to avoid proxying to the original object
2280
1757
  structuredClone({
2281
- ...enLocaleStrings,
1758
+ ...Bt,
2282
1759
  // we don't care on init
2283
1760
  // eslint-disable-next-line solid/reactivity
2284
- ...props.userStrings
1761
+ ...t.userStrings
2285
1762
  })
2286
1763
  );
2287
- onMount(() => {
2288
- props.setLocalizationRef(updateLocalizationStore);
1764
+ J(() => {
1765
+ t.setLocalizationRef(r);
2289
1766
  });
2290
- const contextValue = {
2291
- t: localizationStore,
2292
- updateLocalization: updateLocalizationStore
1767
+ const a = {
1768
+ t: e,
1769
+ updateLocalization: r
2293
1770
  };
2294
- return createComponent(LocalizationContext.Provider, {
2295
- value: contextValue,
1771
+ return s(Le.Provider, {
1772
+ value: a,
2296
1773
  get children() {
2297
- return props.children;
1774
+ return t.children;
2298
1775
  }
2299
1776
  });
2300
1777
  };
2301
- function useLocalization() {
2302
- const ctx = useContext(LocalizationContext);
2303
- if (!ctx) {
1778
+ function Z() {
1779
+ const t = ye(Le);
1780
+ if (!t)
2304
1781
  throw new Error("LocalizationContext.Provider not in scope.");
2305
- }
2306
- return ctx;
1782
+ return t;
2307
1783
  }
2308
- var _tmpl$$c = /* @__PURE__ */ template(`<span>`);
2309
- const SmartEnvironmentProvider = (props) => {
2310
- const [rootNode, setRootNode] = createSignal();
2311
- const [ref, setRef] = createSignal();
2312
- onMount(() => {
2313
- const spanRef = ref();
2314
- if (!spanRef) {
2315
- return;
2316
- }
2317
- setRootNode(spanRef.getRootNode());
2318
- });
2319
- return createComponent(Show, {
1784
+ var Pt = /* @__PURE__ */ S("<span>");
1785
+ const ee = (t) => {
1786
+ const [e, r] = z(), [a, n] = z();
1787
+ return J(() => {
1788
+ const o = a();
1789
+ o && r(o.getRootNode());
1790
+ }), s(E, {
2320
1791
  get when() {
2321
- return rootNode();
1792
+ return e();
2322
1793
  },
2323
1794
  get fallback() {
2324
1795
  return (() => {
2325
- var _el$ = _tmpl$$c();
2326
- use(setRef, _el$);
2327
- return _el$;
1796
+ var o = Pt();
1797
+ return B(n, o), o;
2328
1798
  })();
2329
1799
  },
2330
- children: (rootNode2) => createComponent(EnvironmentProvider, {
2331
- value: () => rootNode2(),
1800
+ children: (o) => s(Ye, {
1801
+ value: () => o(),
2332
1802
  get children() {
2333
- return props.children(rootNode2());
1803
+ return t.children(o());
2334
1804
  }
2335
1805
  })
2336
1806
  });
2337
1807
  };
2338
- var _tmpl$$b = /* @__PURE__ */ template(`<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">`);
2339
- const CloseIcon = (props = {}) => (() => {
2340
- var _el$ = _tmpl$$b();
2341
- spread(_el$, props, true, true);
2342
- return _el$;
1808
+ var Vt = /* @__PURE__ */ S('<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">');
1809
+ const Ut = (t = {}) => (() => {
1810
+ var e = Vt();
1811
+ return F(e, t, !0, !0), e;
2343
1812
  })();
2344
- var _tmpl$$a = /* @__PURE__ */ template(`<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">`);
2345
- const FlashOff = (props = {}) => (() => {
2346
- var _el$ = _tmpl$$a();
2347
- spread(_el$, props, true, true);
2348
- return _el$;
1813
+ var qt = /* @__PURE__ */ S('<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">');
1814
+ const jt = (t = {}) => (() => {
1815
+ var e = qt();
1816
+ return F(e, t, !0, !0), e;
2349
1817
  })();
2350
- var _tmpl$$9 = /* @__PURE__ */ template(`<svg viewBox="0 0 24 24"width=1.2em height=1.2em><path fill=currentColor d="M10 22v-8H7V2h10l-2 7h4z">`);
2351
- const FlashOn = (props = {}) => (() => {
2352
- var _el$ = _tmpl$$9();
2353
- spread(_el$, props, true, true);
2354
- return _el$;
1818
+ var Ht = /* @__PURE__ */ S('<svg viewBox="0 0 24 24"width=1.2em height=1.2em><path fill=currentColor d="M10 22v-8H7V2h10l-2 7h4z">');
1819
+ const Wt = (t = {}) => (() => {
1820
+ var e = Ht();
1821
+ return F(e, t, !0, !0), e;
2355
1822
  })();
2356
- var _tmpl$$8 = /* @__PURE__ */ template(`<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">`);
2357
- const MirrorIcon = (props = {}) => (() => {
2358
- var _el$ = _tmpl$$8();
2359
- spread(_el$, props, true, true);
2360
- return _el$;
1823
+ var Gt = /* @__PURE__ */ S('<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">');
1824
+ const Xt = (t = {}) => (() => {
1825
+ var e = Gt();
1826
+ return F(e, t, !0, !0), e;
2361
1827
  })();
2362
- function eventFixer(props) {
2363
- const newObj = {};
2364
- Object.entries(props).forEach(([key, value]) => {
2365
- const lowerCaseKey = key.toLowerCase();
2366
- let trimmedKey = lowerCaseKey;
2367
- if (lowerCaseKey.startsWith("on")) {
2368
- trimmedKey = lowerCaseKey.slice(2);
2369
- const newKey = `on:${trimmedKey}`;
2370
- newObj[newKey] = value;
2371
- } else {
2372
- newObj[trimmedKey] = value;
2373
- }
2374
- });
2375
- return newObj;
1828
+ function Ne(t) {
1829
+ const e = {};
1830
+ return Object.entries(t).forEach(([r, a]) => {
1831
+ const n = r.toLowerCase();
1832
+ let o = n;
1833
+ if (n.startsWith("on")) {
1834
+ o = n.slice(2);
1835
+ const i = `on:${o}`;
1836
+ e[i] = a;
1837
+ } else
1838
+ e[o] = a;
1839
+ }), e;
2376
1840
  }
2377
- var _tmpl$$7 = /* @__PURE__ */ template(`<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">`);
2378
- const IconCamera = (props = {}) => (() => {
2379
- var _el$ = _tmpl$$7();
2380
- spread(_el$, props, true, true);
2381
- return _el$;
1841
+ var Qt = /* @__PURE__ */ S('<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">');
1842
+ const Kt = (t = {}) => (() => {
1843
+ var e = Qt();
1844
+ return F(e, t, !0, !0), e;
2382
1845
  })();
2383
- var _tmpl$$6 = /* @__PURE__ */ template(`<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">`);
2384
- const IconCheck = (props = {}) => (() => {
2385
- var _el$ = _tmpl$$6();
2386
- spread(_el$, props, true, true);
2387
- return _el$;
1846
+ var Yt = /* @__PURE__ */ S('<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">');
1847
+ const Jt = (t = {}) => (() => {
1848
+ var e = Yt();
1849
+ return F(e, t, !0, !0), e;
2388
1850
  })();
2389
- var _tmpl$$5 = /* @__PURE__ */ template(`<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>`);
2390
- const IconChevronDown = (props = {}) => (() => {
2391
- var _el$ = _tmpl$$5();
2392
- spread(_el$, props, true, true);
2393
- return _el$;
1851
+ var Zt = /* @__PURE__ */ S('<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>');
1852
+ const er = (t = {}) => (() => {
1853
+ var e = Zt();
1854
+ return F(e, t, !0, !0), e;
2394
1855
  })();
2395
- var _tmpl$$4 = /* @__PURE__ */ template(`<button>`), _tmpl$2$3 = /* @__PURE__ */ template(`<div class="h-[1px] absolute left-0 right-0 top-[-1px] bg-white pointer-events-none">`);
2396
- const CameraSelector = () => {
2397
- const {
2398
- cameraManagerSolidStore,
2399
- cameraManager
2400
- } = useCameraUiStore();
1856
+ var tr = /* @__PURE__ */ S("<button>"), rr = /* @__PURE__ */ S('<div class="h-[1px] absolute left-0 right-0 top-[-1px] bg-white pointer-events-none">');
1857
+ const ar = () => {
2401
1858
  const {
2402
- t
2403
- } = useLocalization();
2404
- const cameras = cameraManagerSolidStore((x) => x.cameras);
2405
- const selectedCamera = cameraManagerSolidStore((x) => x.selectedCamera);
2406
- const isQueryingCameras = cameraManagerSolidStore((x) => x.isQueryingCameras);
2407
- const facingFilter = cameraManagerSolidStore((x) => x.facingFilter);
2408
- const [isSwapping, setIsSwapping] = createSignal(false);
2409
- const isDisabled = () => isQueryingCameras() || isSwapping();
2410
- const camerasWithFacingFilter = () => {
2411
- const $facingFilter = facingFilter();
2412
- if (!$facingFilter) {
2413
- return cameras();
2414
- }
2415
- return cameras().filter((camera) => $facingFilter.includes(camera.facingMode));
2416
- };
2417
- const createCameraOptions = () => [...camerasWithFacingFilter().map((camera) => ({
2418
- value: camera.deviceInfo.deviceId,
2419
- label: camera.name
2420
- }))];
2421
- const cameraCollection = () => createListCollection({
2422
- items: [...createCameraOptions()]
2423
- });
2424
- const selectedCameraInCollection = () => {
2425
- const $selectedCamera = selectedCamera();
2426
- if (!$selectedCamera) {
1859
+ cameraManagerSolidStore: t,
1860
+ cameraManager: e
1861
+ } = j(), {
1862
+ t: r
1863
+ } = Z(), a = t((f) => f.cameras), n = t((f) => f.selectedCamera), o = t((f) => f.isQueryingCameras), i = t((f) => f.facingFilter), [l, c] = z(!1), d = () => o() || l(), h = () => {
1864
+ const f = i();
1865
+ return f ? a().filter((g) => f.includes(g.facingMode)) : a();
1866
+ }, C = () => [...h().map((f) => ({
1867
+ value: f.deviceInfo.deviceId,
1868
+ label: f.name
1869
+ }))], w = () => Je({
1870
+ items: [...C()]
1871
+ }), u = () => {
1872
+ const f = n();
1873
+ if (!f)
2427
1874
  return;
2428
- }
2429
- const foundCamera = cameraCollection().find($selectedCamera.deviceInfo.deviceId);
2430
- if (!foundCamera) {
2431
- return;
2432
- }
2433
- return [foundCamera.value];
2434
- };
2435
- const isFakeCamera = (value) => {
2436
- return fakeCameras.some((fakeCamera) => fakeCamera.value === value);
2437
- };
2438
- const selectCameraById = async (id) => {
2439
- setIsSwapping(true);
2440
- const camera = cameras().find((camera2) => camera2.deviceInfo.deviceId === id);
2441
- if (!camera) {
1875
+ const g = w().find(f.deviceInfo.deviceId);
1876
+ if (g)
1877
+ return [g.value];
1878
+ }, v = (f) => nr.some((g) => g.value === f), b = async (f) => {
1879
+ c(!0);
1880
+ const g = a().find((p) => p.deviceInfo.deviceId === f);
1881
+ if (!g) {
2442
1882
  console.warn("No camera");
2443
1883
  return;
2444
1884
  }
2445
- await cameraManager.selectCamera(camera);
2446
- setIsSwapping(false);
1885
+ await e.selectCamera(g), c(!1);
2447
1886
  };
2448
- return createComponent(SmartEnvironmentProvider, {
2449
- children: () => createComponent(Select.Root, {
1887
+ return s(ee, {
1888
+ children: () => s(A.Root, {
2450
1889
  part: "camera-select-part",
2451
1890
  get collection() {
2452
- return cameraCollection();
1891
+ return w();
2453
1892
  },
2454
1893
  get value() {
2455
- return selectedCameraInCollection();
1894
+ return u();
2456
1895
  },
2457
1896
  positioning: {
2458
1897
  placement: "top"
2459
1898
  },
2460
- lazyMount: true,
1899
+ lazyMount: !0,
2461
1900
  get disabled() {
2462
- return isDisabled();
1901
+ return d();
2463
1902
  },
2464
- onValueChange: (details) => {
2465
- if (isFakeCamera(details.value[0])) {
1903
+ onValueChange: (f) => {
1904
+ if (v(f.value[0])) {
2466
1905
  console.warn("Fake camera, skipping");
2467
1906
  return;
2468
1907
  }
2469
- void selectCameraById(details.value[0]);
1908
+ b(f.value[0]);
2470
1909
  },
2471
1910
  get children() {
2472
- return [createComponent(Select.Label, {
2473
- "class": "sr-only",
1911
+ return [s(A.Label, {
1912
+ class: "sr-only",
2474
1913
  get children() {
2475
- return t.selected_camera;
1914
+ return r.selected_camera;
2476
1915
  }
2477
- }), createComponent(Select.Trigger, {
2478
- asChild: (selectProps) => {
2479
- return (() => {
2480
- var _el$ = _tmpl$$4();
2481
- spread(_el$, mergeProps(() => eventFixer(selectProps()), {
2482
- "class": `flex px-4 py-2 items-center gap-2 rounded-full bg-dark-100/50 backdrop-blur-xl
1916
+ }), s(A.Trigger, {
1917
+ asChild: (f) => (() => {
1918
+ var g = tr();
1919
+ return F(g, Y(() => Ne(f()), {
1920
+ class: `flex px-4 py-2 items-center gap-2 rounded-full bg-dark-100/50 backdrop-blur-xl
2483
1921
  whitespace-nowrap text-base color-white font-500 cursor-pointer appearance-none
2484
1922
  border-none disabled:opacity-50 disabled:cursor-not-allowed max-w-[100%]`
2485
- }), false, true);
2486
- insert(_el$, createComponent(IconCamera, {
2487
- "class": "size-6 shrink-0",
2488
- "aria-hidden": true
2489
- }), null);
2490
- insert(_el$, createComponent(Select.ValueText, {
2491
- "class": "truncate",
2492
- get placeholder() {
2493
- return isQueryingCameras() ? t.loading_cameras : t.select_a_camera;
2494
- }
2495
- }), null);
2496
- insert(_el$, createComponent(Select.Indicator, {
2497
- "class": "shrink-0 data-[state=open]:scale-y-[-1]",
2498
- get children() {
2499
- return createComponent(IconChevronDown, {
2500
- "class": "size-6 shrink-0"
2501
- });
2502
- }
2503
- }), null);
2504
- return _el$;
2505
- })();
2506
- }
2507
- }), createComponent(Select.Positioner, {
1923
+ }), !1, !0), y(g, s(Kt, {
1924
+ class: "size-6 shrink-0",
1925
+ "aria-hidden": !0
1926
+ }), null), y(g, s(A.ValueText, {
1927
+ class: "truncate",
1928
+ get placeholder() {
1929
+ return o() ? r.loading_cameras : r.select_a_camera;
1930
+ }
1931
+ }), null), y(g, s(A.Indicator, {
1932
+ class: "shrink-0 data-[state=open]:scale-y-[-1]",
1933
+ get children() {
1934
+ return s(er, {
1935
+ class: "size-6 shrink-0"
1936
+ });
1937
+ }
1938
+ }), null), g;
1939
+ })()
1940
+ }), s(A.Positioner, {
2508
1941
  get children() {
2509
- return createComponent(Select.Content, {
1942
+ return s(A.Content, {
2510
1943
  get children() {
2511
- return createComponent(Select.ItemGroup, {
2512
- "class": "rounded-4 overflow-hidden text-base color-white",
1944
+ return s(A.ItemGroup, {
1945
+ class: "rounded-4 overflow-hidden text-base color-white",
2513
1946
  get children() {
2514
- return createComponent(Index, {
1947
+ return s(We, {
2515
1948
  get each() {
2516
- return cameraCollection().items;
1949
+ return w().items;
2517
1950
  },
2518
- children: (camera, index) => {
2519
- return createComponent(Select.Item, {
2520
- get item() {
2521
- return camera();
2522
- },
2523
- "class": "flex py-3 pl-4 pr-12 cursor-pointer select-none relative gap-[1px]\n bg-dark-100/50 backdrop-blur-xl data-[highlighted]:bg-gray-500/50",
2524
- get children() {
2525
- return [createComponent(Select.ItemText, {
2526
- "class": "truncate",
2527
- get children() {
2528
- return camera().label;
2529
- }
2530
- }), createComponent(Select.ItemIndicator, {
2531
- "class": "absolute right-4",
2532
- get children() {
2533
- return createComponent(IconCheck, {
2534
- "class": "size-6 shrink-0"
2535
- });
2536
- }
2537
- }), createComponent(Show, {
2538
- when: index !== 0,
2539
- get children() {
2540
- return _tmpl$2$3();
2541
- }
2542
- })];
2543
- }
2544
- });
2545
- }
1951
+ children: (f, g) => s(A.Item, {
1952
+ get item() {
1953
+ return f();
1954
+ },
1955
+ class: `flex py-3 pl-4 pr-12 cursor-pointer select-none relative gap-[1px]
1956
+ bg-dark-100/50 backdrop-blur-xl data-[highlighted]:bg-gray-500/50`,
1957
+ get children() {
1958
+ return [s(A.ItemText, {
1959
+ class: "truncate",
1960
+ get children() {
1961
+ return f().label;
1962
+ }
1963
+ }), s(A.ItemIndicator, {
1964
+ class: "absolute right-4",
1965
+ get children() {
1966
+ return s(Jt, {
1967
+ class: "size-6 shrink-0"
1968
+ });
1969
+ }
1970
+ }), s(E, {
1971
+ when: g !== 0,
1972
+ get children() {
1973
+ return rr();
1974
+ }
1975
+ })];
1976
+ }
1977
+ })
2546
1978
  });
2547
1979
  }
2548
1980
  });
@@ -2553,8 +1985,7 @@ const CameraSelector = () => {
2553
1985
  }
2554
1986
  })
2555
1987
  });
2556
- };
2557
- const fakeCameras = [{
1988
+ }, nr = [{
2558
1989
  value: "5",
2559
1990
  label: "Back Camera 2"
2560
1991
  }, {
@@ -2570,389 +2001,318 @@ const fakeCameras = [{
2570
2001
  value: "4",
2571
2002
  label: "Some random desktop camera"
2572
2003
  }];
2573
- var _tmpl$$3 = /* @__PURE__ */ template(`<span class=sr-only>`), _tmpl$2$2 = /* @__PURE__ */ template(`<div class=justify-self-end>`), _tmpl$3$2 = /* @__PURE__ */ template(`<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">`), _tmpl$4$1 = /* @__PURE__ */ template(`<button>`);
2574
- const Header = () => {
2004
+ var re = /* @__PURE__ */ S("<span class=sr-only>"), or = /* @__PURE__ */ S("<div class=justify-self-end>"), ir = /* @__PURE__ */ S('<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">'), sr = /* @__PURE__ */ S("<button>");
2005
+ const lr = () => {
2575
2006
  const {
2576
- dismountCameraUi,
2577
- cameraManagerSolidStore,
2578
- cameraManager,
2579
- showMirrorCameraButton,
2580
- showTorchButton,
2581
- showCloseButton
2582
- } = useCameraUiStore();
2583
- const {
2584
- t
2585
- } = useLocalization();
2586
- const isMirrored = cameraManagerSolidStore((s) => s.mirrorX);
2587
- const selectedCamera = cameraManagerSolidStore((s) => s.selectedCamera);
2588
- const cameras = cameraManagerSolidStore((s) => s.cameras);
2589
- const isActive = cameraManagerSolidStore((s) => s.playbackState !== "idle");
2590
- const torchEnabled = cameraManagerSolidStore((s) => s.selectedCamera?.torchEnabled);
2591
- const hasTorch = () => selectedCamera()?.torchSupported;
2592
- const toggleTorch = () => {
2593
- const camera = selectedCamera();
2594
- if (!camera) {
2595
- return;
2596
- }
2597
- void camera.toggleTorch();
2598
- };
2599
- const toggleMirrorX = () => {
2600
- cameraManager.setCameraMirrorX(!cameraManagerSolidStore.getState().mirrorX);
2007
+ dismountCameraUi: t,
2008
+ cameraManagerSolidStore: e,
2009
+ cameraManager: r,
2010
+ showMirrorCameraButton: a,
2011
+ showTorchButton: n,
2012
+ showCloseButton: o
2013
+ } = j(), {
2014
+ t: i
2015
+ } = Z(), l = e((b) => b.mirrorX), c = e((b) => b.selectedCamera), d = e((b) => b.cameras), h = e((b) => b.playbackState !== "idle"), C = e((b) => b.selectedCamera?.torchEnabled), w = () => c()?.torchSupported, u = () => {
2016
+ const b = c();
2017
+ b && b.toggleTorch();
2018
+ }, v = () => {
2019
+ r.setCameraMirrorX(!e.getState().mirrorX);
2601
2020
  };
2602
- return createComponent(SmartEnvironmentProvider, {
2021
+ return s(ee, {
2603
2022
  children: () => (() => {
2604
- var _el$ = _tmpl$3$2(), _el$2 = _el$.firstChild, _el$5 = _el$2.nextSibling;
2605
- insert(_el$2, createComponent(Show, {
2023
+ var b = ir(), f = b.firstChild, g = f.nextSibling;
2024
+ return y(f, s(E, {
2606
2025
  get when() {
2607
- return showMirrorCameraButton && isActive();
2026
+ return a && h();
2608
2027
  },
2609
2028
  get children() {
2610
- return createComponent(ToolbarButton, {
2029
+ return s(ae, {
2611
2030
  part: "mirror-camera-button-part",
2612
2031
  get tooltipLabel() {
2613
- return t.mirror_camera;
2032
+ return i.mirror_camera;
2614
2033
  },
2615
- onClick: () => toggleMirrorX(),
2034
+ onClick: () => v(),
2616
2035
  get children() {
2617
2036
  return [(() => {
2618
- var _el$3 = _tmpl$$3();
2619
- insert(_el$3, () => t.mirror_camera);
2620
- return _el$3;
2621
- })(), createComponent(MirrorIcon, {
2622
- "class": "size-6 shrink-0 transition-transform duration-300 ease-in-out",
2037
+ var p = re();
2038
+ return y(p, () => i.mirror_camera), p;
2039
+ })(), s(Xt, {
2040
+ class: "size-6 shrink-0 transition-transform duration-300 ease-in-out",
2623
2041
  get style() {
2624
2042
  return {
2625
- transform: isMirrored() ? "scaleX(-1)" : "scaleX(1)"
2043
+ transform: l() ? "scaleX(-1)" : "scaleX(1)"
2626
2044
  };
2627
2045
  }
2628
2046
  })];
2629
2047
  }
2630
2048
  });
2631
2049
  }
2632
- }), null);
2633
- insert(_el$2, createComponent(Show, {
2050
+ }), null), y(f, s(E, {
2634
2051
  get when() {
2635
- return memo(() => !!(showTorchButton && hasTorch()))() && isActive();
2052
+ return pe(() => !!(n && w()))() && h();
2636
2053
  },
2637
2054
  get children() {
2638
- return createComponent(ToolbarButton, {
2055
+ return s(ae, {
2639
2056
  part: "torch-button-part",
2640
- onClick: () => toggleTorch(),
2057
+ onClick: () => u(),
2641
2058
  get tooltipLabel() {
2642
- return t.torch;
2059
+ return i.torch;
2643
2060
  },
2644
2061
  get children() {
2645
- return [createComponent(Show, {
2062
+ return [s(E, {
2646
2063
  get when() {
2647
- return !torchEnabled();
2064
+ return !C();
2648
2065
  },
2649
2066
  get children() {
2650
2067
  return [(() => {
2651
- var _el$4 = _tmpl$$3();
2652
- insert(_el$4, () => t.torch);
2653
- return _el$4;
2654
- })(), createComponent(FlashOn, {
2655
- "class": "size-6 shrink-0"
2068
+ var p = re();
2069
+ return y(p, () => i.torch), p;
2070
+ })(), s(Wt, {
2071
+ class: "size-6 shrink-0"
2656
2072
  })];
2657
2073
  }
2658
- }), createComponent(Show, {
2074
+ }), s(E, {
2659
2075
  get when() {
2660
- return torchEnabled();
2076
+ return C();
2661
2077
  },
2662
2078
  get children() {
2663
- return createComponent(FlashOff, {
2664
- "class": "size-6 shrink-0"
2079
+ return s(jt, {
2080
+ class: "size-6 shrink-0"
2665
2081
  });
2666
2082
  }
2667
2083
  })];
2668
2084
  }
2669
2085
  });
2670
2086
  }
2671
- }), null);
2672
- insert(_el$5, createComponent(Show, {
2087
+ }), null), y(g, s(E, {
2673
2088
  get when() {
2674
- return cameras().length > 1;
2089
+ return d().length > 1;
2675
2090
  },
2676
2091
  get children() {
2677
- return createComponent(CameraSelector, {});
2092
+ return s(ar, {});
2678
2093
  }
2679
- }));
2680
- insert(_el$, createComponent(Show, {
2681
- when: showCloseButton,
2094
+ })), y(b, s(E, {
2095
+ when: o,
2682
2096
  get children() {
2683
- var _el$6 = _tmpl$2$2();
2684
- insert(_el$6, createComponent(ToolbarButton, {
2097
+ var p = or();
2098
+ return y(p, s(ae, {
2685
2099
  part: "close-button-part",
2686
- onClick: () => dismountCameraUi(),
2100
+ onClick: () => t(),
2687
2101
  get tooltipLabel() {
2688
- return t.close;
2102
+ return i.close;
2689
2103
  },
2690
2104
  get children() {
2691
2105
  return [(() => {
2692
- var _el$7 = _tmpl$$3();
2693
- insert(_el$7, () => t.close);
2694
- return _el$7;
2695
- })(), createComponent(CloseIcon, {
2696
- "class": "size-6 shrink-0"
2106
+ var k = re();
2107
+ return y(k, () => i.close), k;
2108
+ })(), s(Ut, {
2109
+ class: "size-6 shrink-0"
2697
2110
  })];
2698
2111
  }
2699
- }));
2700
- return _el$6;
2112
+ })), p;
2701
2113
  }
2702
- }), null);
2703
- return _el$;
2114
+ }), null), b;
2704
2115
  })()
2705
2116
  });
2706
- };
2707
- const ToolbarButton = (props) => {
2708
- return createComponent(Tooltip.Root, {
2709
- get children() {
2710
- return [createComponent(Tooltip.Trigger, mergeProps(props, {
2711
- asChild: (tooltipProps) => {
2712
- return (() => {
2713
- var _el$8 = _tmpl$4$1();
2714
- spread(_el$8, mergeProps(() => eventFixer(tooltipProps()), {
2715
- "class": `rounded-full bg-dark-500 bg-opacity-50 backdrop-blur grid place-items-center
2117
+ }, ae = (t) => s(Q.Root, {
2118
+ get children() {
2119
+ return [s(Q.Trigger, Y(t, {
2120
+ asChild: (e) => (() => {
2121
+ var r = sr();
2122
+ return F(r, Y(() => Ne(e()), {
2123
+ class: `rounded-full bg-dark-500 bg-opacity-50 backdrop-blur grid place-items-center
2716
2124
  size-12 appearance-none border-none cursor-pointer`
2717
- }), false, true);
2718
- insert(_el$8, () => props.children);
2719
- return _el$8;
2720
- })();
2721
- }
2722
- })), createComponent(Tooltip.Positioner, {
2723
- get children() {
2724
- return createComponent(Tooltip.Content, {
2725
- "class": `bg-dark-500 bg-opacity-50 backdrop-blur color-white text-align-center p-2
2125
+ }), !1, !0), y(r, () => t.children), r;
2126
+ })()
2127
+ })), s(Q.Positioner, {
2128
+ get children() {
2129
+ return s(Q.Content, {
2130
+ class: `bg-dark-500 bg-opacity-50 backdrop-blur color-white text-align-center p-2
2726
2131
  rounded-md text-sm drop-shadow-md`,
2727
- get children() {
2728
- return props.tooltipLabel;
2729
- }
2730
- });
2731
- }
2732
- })];
2733
- }
2734
- });
2735
- };
2736
- const renderWithOwner = (code, element, owner) => {
2737
- return createRoot((dispose) => {
2738
- insert(element, code(), element.firstChild ? null : void 0);
2739
- return () => {
2740
- dispose();
2741
- element.textContent = "";
2742
- };
2743
- }, owner);
2744
- };
2745
- var _tmpl$$2 = /* @__PURE__ */ template(`<div>`);
2746
- const SolidShadowRoot = (props) => {
2747
- const owner = getOwner();
2748
- const [local, others] = splitProps(props, ["children", "disableShadowRoot", "getRef"]);
2132
+ get children() {
2133
+ return t.tooltipLabel;
2134
+ }
2135
+ });
2136
+ }
2137
+ })];
2138
+ }
2139
+ }), cr = (t, e, r) => Ge((a) => (y(e, t(), e.firstChild ? null : void 0), () => {
2140
+ a(), e.textContent = "";
2141
+ }), r);
2142
+ var ur = /* @__PURE__ */ S("<div>");
2143
+ const dr = (t) => {
2144
+ const e = Se(), [r, a] = Xe(t, ["children", "disableShadowRoot", "getRef"]);
2749
2145
  return (() => {
2750
- var _el$ = _tmpl$$2();
2751
- use((ref) => {
2752
- if (local.disableShadowRoot) {
2146
+ var n = ur();
2147
+ return B((o) => {
2148
+ if (r.disableShadowRoot)
2753
2149
  return;
2754
- }
2755
- const shadowRoot = ref.attachShadow({
2150
+ const i = o.attachShadow({
2756
2151
  mode: "open"
2757
2152
  });
2758
- renderWithOwner(() => memo(() => local.children), shadowRoot, owner);
2759
- }, _el$);
2760
- spread(_el$, others, false, true);
2761
- insert(_el$, createComponent(Show, {
2153
+ cr(() => pe(() => r.children), i, e);
2154
+ }, n), F(n, a, !1, !0), y(n, s(E, {
2762
2155
  get when() {
2763
- return local.disableShadowRoot;
2156
+ return r.disableShadowRoot;
2764
2157
  },
2765
2158
  get children() {
2766
- return local.children;
2159
+ return r.children;
2767
2160
  }
2768
- }));
2769
- return _el$;
2161
+ })), n;
2770
2162
  })();
2771
- };
2772
- const normalize = '/* Document\n * ========================================================================== */\n\n/**\n * 1. Correct the line height in all browsers.\n * 2. Prevent adjustments of font size after orientation changes in iOS.\n */\n\n:where(html) {\n line-height: 1.15; /* 1 */\n -webkit-text-size-adjust: 100%; /* 2 */\n text-size-adjust: 100%; /* 2 */\n}\n\n/* Sections\n * ========================================================================== */\n\n/**\n * Correct the font size and margin on `h1` elements within `section` and\n * `article` contexts in Chrome, Edge, Firefox, and Safari.\n */\n\n:where(h1) {\n font-size: 2em;\n margin-block-end: 0.67em;\n margin-block-start: 0.67em;\n}\n\n/* Grouping content\n * ========================================================================== */\n\n/**\n * Remove the margin on nested lists in Chrome, Edge, and Safari.\n */\n\n:where(dl, ol, ul) :where(dl, ol, ul) {\n margin-block-end: 0;\n margin-block-start: 0;\n}\n\n/**\n * 1. Add the correct box sizing in Firefox.\n * 2. Correct the inheritance of border color in Firefox.\n */\n\n:where(hr) {\n box-sizing: content-box; /* 1 */\n color: inherit; /* 2 */\n height: 0; /* 1 */\n}\n\n/* Text-level semantics\n * ========================================================================== */\n\n/**\n * Add the correct text decoration in Safari.\n */\n\n:where(abbr[title]) {\n text-decoration: underline;\n text-decoration: underline dotted;\n}\n\n/**\n * Add the correct font weight in Chrome, Edge, and Safari.\n */\n\n:where(b, strong) {\n font-weight: bolder;\n}\n\n/**\n * 1. Correct the inheritance and scaling of font size in all browsers.\n * 2. Correct the odd `em` font sizing in all browsers.\n */\n\n:where(code, kbd, pre, samp) {\n font-family: monospace, monospace; /* 1 */\n font-size: 1em; /* 2 */\n}\n\n/**\n * Add the correct font size in all browsers.\n */\n\n:where(small) {\n font-size: 80%;\n}\n\n/* Tabular data\n * ========================================================================== */\n\n/**\n * 1. Correct table border color in Chrome, Edge, and Safari.\n * 2. Remove text indentation from table contents in Chrome, Edge, and Safari.\n */\n\n:where(table) {\n border-color: currentColor; /* 1 */\n text-indent: 0; /* 2 */\n}\n\n/* Forms\n * ========================================================================== */\n\n/**\n * Remove the margin on controls in Safari.\n */\n\n:where(button, input, select) {\n margin: 0;\n}\n\n/**\n * Remove the inheritance of text transform in Firefox.\n */\n\n:where(button) {\n text-transform: none;\n}\n\n/**\n * Correct the inability to style buttons in iOS and Safari.\n */\n\n:where(button, input:is([type="button" i], [type="reset" i], [type="submit" i])) {\n -webkit-appearance: button;\n}\n\n/**\n * Add the correct vertical alignment in Chrome, Edge, and Firefox.\n */\n\n:where(progress) {\n vertical-align: baseline;\n}\n\n/**\n * Remove the inheritance of text transform in Firefox.\n */\n\n:where(select) {\n text-transform: none;\n}\n\n/**\n * Remove the margin in Firefox and Safari.\n */\n\n:where(textarea) {\n margin: 0;\n}\n\n/**\n * 1. Correct the odd appearance in Chrome, Edge, and Safari.\n * 2. Correct the outline style in Safari.\n */\n\n:where(input[type="search" i]) {\n -webkit-appearance: textfield; /* 1 */\n outline-offset: -2px; /* 2 */\n}\n\n/**\n * Correct the cursor style of increment and decrement buttons in Safari.\n */\n\n::-webkit-inner-spin-button,\n::-webkit-outer-spin-button {\n height: auto;\n}\n\n/**\n * Correct the text style of placeholders in Chrome, Edge, and Safari.\n */\n\n::-webkit-input-placeholder {\n color: inherit;\n opacity: 0.54;\n}\n\n/**\n * Remove the inner padding in Chrome, Edge, and Safari on macOS.\n */\n\n::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n/**\n * 1. Correct the inability to style upload buttons in iOS and Safari.\n * 2. Change font properties to `inherit` in Safari.\n */\n\n::-webkit-file-upload-button {\n -webkit-appearance: button; /* 1 */\n font: inherit; /* 2 */\n}\n\n/**\n * Remove the inner border and padding of focus outlines in Firefox.\n */\n\n:where(button, input:is([type="button" i], [type="color" i], [type="reset" i], [type="submit" i]))::-moz-focus-inner {\n border-style: none;\n padding: 0;\n}\n\n/**\n * Restore the focus outline styles unset by the previous rule in Firefox.\n */\n\n:where(button, input:is([type="button" i], [type="color" i], [type="reset" i], [type="submit" i]))::-moz-focusring {\n outline: 1px dotted ButtonText;\n}\n\n/**\n * Remove the additional :invalid styles in Firefox.\n */\n\n:where(:-moz-ui-invalid) {\n box-shadow: none;\n}\n\n/* Interactive\n * ========================================================================== */\n\n/*\n * Add the correct styles in Safari.\n */\n\n:where(dialog) {\n background-color: white;\n border: solid;\n color: black;\n height: -moz-fit-content;\n height: fit-content;\n left: 0;\n margin: auto;\n padding: 1em;\n position: absolute;\n right: 0;\n width: -moz-fit-content;\n width: fit-content;\n}\n\n:where(dialog:not([open])) {\n display: none;\n}\n\n/*\n * Add the correct display in all browsers.\n */\n\n:where(summary) {\n display: list-item;\n}\n';
2773
- const rootStyles = ":host {\n font-family: var(--mb-ui-font);\n line-height: 1.15;\n isolation: isolate;\n box-sizing: border-box;\n}\n\n*,\n*::before,\n*::after {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n}\n\np,\nh1,\nh2,\nh3,\nh4,\nh5,\nh6 {\n overflow-wrap: break-word;\n}\n\ncode {\n font-family: var(--mb-monospace-font-stack);\n}\n\npre {\n font-family: var(--mb-monospace-font-stack);\n}\n\nsvg path {\n pointer-events: none;\n}\n\nimg,\npicture,\nvideo,\ncanvas,\nsvg {\n display: block;\n max-width: 100%;\n}\n\nimg {\n pointer-events: none;\n user-select: none;\n}\n\n:where(input, button, textarea, select) {\n font: inherit;\n}\n\n:where(button, select) {\n cursor: pointer;\n color: inherit;\n font: inherit;\n}\n\n:where(p, h1, h2, h3, h4, h5, h6) {\n overflow-wrap: break-word;\n}";
2774
- const variables = ':host {\n --mb-system-font-stack:\n -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu",\n "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;\n --mb-monospace-font-stack:\n Menlo, Consolas, "Ubuntu Mono", "Roboto Mono", "DejaVu Sans Mono", monospace;\n --mb-ui-font: var(--mb-system-font-stack);\n --mb-size: 1;\n /***************************************/\n /* MB COLORS */\n /***************************************/\n --color-accent-25-rgb-value: 242 247 255; /* #F2F7FF */\n --color-accent-50-rgb-value: 231 240 255; /* #E7F0FF */\n --color-accent-100-rgb-value: 220 234 255; /* #DCEAFF */\n --color-accent-200-rgb-value: 198 221 255; /* #C6DDFF */\n --color-accent-300-rgb-value: 158 197 255; /* #9EC5FF */\n --color-accent-400-rgb-value: 111 169 255; /* #6FA9FF */\n --color-accent-500-rgb-value: 58 137 253; /* #3A89FD */\n --color-accent-600-rgb-value: 0 98 242; /* #0062F2 */\n --color-accent-700-rgb-value: 0 80 197; /* #0050C5 */\n --color-accent-800-rgb-value: 0 64 157; /* #00409D */\n --color-accent-900-rgb-value: 0 54 133; /* #003685 */\n --color-error-25-rgb-value: 255 248 249; /* #FFF8F9 */\n --color-error-50-rgb-value: 255 241 242; /* #FFF1F2 */\n --color-error-100-rgb-value: 255 228 230; /* #FFE4E6 */\n --color-error-200-rgb-value: 254 205 211; /* #FECDD3 */\n --color-error-300-rgb-value: 253 164 175; /* #FDA4AF */\n --color-error-400-rgb-value: 251 113 133; /* #FB7185 */\n --color-error-500-rgb-value: 244 63 94; /* #F43F5E */\n --color-error-600-rgb-value: 225 29 72; /* #E11D48 */\n --color-error-700-rgb-value: 190 18 60; /* #BE123C */\n --color-error-800-rgb-value: 136 19 39; /* #881337 */\n --color-error-900-rgb-value: 89 13 40; /* #590D28 */\n --color-success-25-rgb-value: 245 254 250; /* #F5FEFA */\n --color-success-50-rgb-value: 236 253 245; /* #ECFDF5 */\n --color-success-100-rgb-value: 209 250 229; /* #D1FAE5 */\n --color-success-200-rgb-value: 167 243 208; /* #A7F3D0 */\n --color-success-300-rgb-value: 110 231 183; /* #6EE7B7 */\n --color-success-400-rgb-value: 52 211 153; /* #34D399 */\n --color-success-500-rgb-value: 16 185 144; /* #10B990 */\n --color-success-600-rgb-value: 22 163 138; /* #16A38A */\n --color-success-700-rgb-value: 39 121 106; /* #27796A */\n --color-success-800-rgb-value: 23 92 79; /* #175C4F */\n --color-success-900-rgb-value: 12 59 50; /* #0C3B32 */\n --color-warning-25-rgb-value: 255 253 243; /* #FFFDF3 */\n --color-warning-50-rgb-value: 254 252 232; /* #FEFCE8 */\n --color-warning-100-rgb-value: 254 249 195; /* #FEF9C3 */\n --color-warning-200-rgb-value: 254 240 138; /* #FEF08A */\n --color-warning-300-rgb-value: 253 229 99; /* #FDE563 */\n --color-warning-400-rgb-value: 252 218 59; /* #FCDA3B */\n --color-warning-500-rgb-value: 250 204 21; /* #FACC15 */\n --color-warning-600-rgb-value: 234 179 8; /* #EAB308 */\n --color-warning-700-rgb-value: 190 142 48; /* #BE8E30 */\n --color-warning-800-rgb-value: 132 83 28; /* #84531C */\n --color-warning-900-rgb-value: 80 29 10; /* #501D0A */\n --color-deep-blue-25-rgb-value: 249 252 255; /* #F9FCFF */\n --color-deep-blue-50-rgb-value: 243 249 254; /* #F3F9FE */\n --color-deep-blue-100-rgb-value: 231 242 251; /* #E7F2FB */\n --color-deep-blue-200-rgb-value: 201 218 241; /* #C9DAF1 */\n --color-deep-blue-300-rgb-value: 162 185 216; /* #A2B9D8 */\n --color-deep-blue-400-rgb-value: 93 128 182; /* #5D80B6 */\n --color-deep-blue-500-rgb-value: 60 100 161; /* #3C64A1 */\n --color-deep-blue-600-rgb-value: 28 68 129; /* #1C4481 */\n --color-deep-blue-700-rgb-value: 24 53 97; /* #183561 */\n --color-deep-blue-800-rgb-value: 20 38 65; /* #142641 */\n --color-deep-blue-900-rgb-value: 6 23 49; /* #061731 */\n --color-light-blue-25-rgb-value: 248 251 253; /* #F8FBFD */\n --color-light-blue-50-rgb-value: 240 247 251; /* #F0F7FB */\n --color-light-blue-100-rgb-value: 228 238 244; /* #E4EEF4 */\n --color-light-blue-200-rgb-value: 215 229 238; /* #D7E5EE */\n --color-light-blue-300-rgb-value: 190 218 237; /* #BEDAED */\n --color-light-blue-400-rgb-value: 159 202 232; /* #9FCAE8 */\n --color-light-blue-500-rgb-value: 135 180 211; /* #87B4D3 */\n --color-light-blue-600-rgb-value: 104 157 193; /* #689DC1 */\n --color-light-blue-700-rgb-value: 78 129 164; /* #4E81A4 */\n --color-light-blue-800-rgb-value: 67 109 138; /* #436D8A */\n --color-light-blue-900-rgb-value: 55 84 104; /* #375468 */\n --color-gray-50-rgb-value: 249 250 251; /* #FAFAFA */\n --color-gray-100-rgb-value: 243 244 246; /* #F5F5F5 */\n --color-gray-200-rgb-value: 229 231 235; /* #F0F0F0 */\n --color-gray-300-rgb-value: 209 213 219; /* #D9D9D9 */\n --color-gray-400-rgb-value: 156 163 175; /* #BFBFBF */\n --color-gray-500-rgb-value: 107 114 128; /* #8C8C8C */\n --color-gray-600-rgb-value: 75 85 99; /* #595959 */\n --color-gray-700-rgb-value: 55 65 81; /* #434343 */\n --color-gray-800-rgb-value: 31 41 55; /* #262626 */\n --color-blue-gray-50-rgb-value: 74 74 74; /* #F9FAFB */\n --color-blue-gray-100-rgb-value: 60 60 60; /* #F3F4F6 */\n --color-blue-gray-200-rgb-value: 50 50 50; /* #E5E7EB */\n --color-blue-gray-300-rgb-value: 45 45 45; /* #D1D5DB */\n --color-blue-gray-400-rgb-value: 34 34 34; /* #9CA3AF */\n --color-blue-gray-500-rgb-value: 31 31 31; /* #6B7280 */\n --color-blue-gray-600-rgb-value: 28 28 30; /* #4B5563 */\n --color-blue-gray-700-rgb-value: 27 27 27; /* #374151 */\n --color-blue-gray-800-rgb-value: 24 24 24; /* #1F2937 */\n --color-blue-gray-900-rgb-value: 15 15 15; /* #111827 */\n --color-black-rgb-value: 0 0 0; /* #000000 */\n --color-white-rgb-value: 255 255 255; /* #FFFFFF */\n --color-primary: var(--color-accent-600-rgb-value);\n --color-error: var(--color-error-500-rgb-value);\n --color-success: var(--color-success-500-rgb-value);\n --color-warning: var(--color-warning-500-rgb-value);\n --color-deep-blue: var(--color-deep-blue-800-rgb-value);\n --color-light-blue: var(--color-light-blue-200-rgb-value);\n accent-color: var(--color-primary);\n caret-color: red;\n}';
2775
- const initialState = {
2163
+ }, hr = ":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}", mr = ":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}:where(p,h1,h2,h3,h4,h5,h6){overflow-wrap:break-word}", fr = ':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-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}', gr = {
2776
2164
  feedbackLayer: null,
2777
2165
  overlayLayer: null,
2778
2166
  owner: null
2779
- };
2780
- const cameraUiRefStore = createStore()(
2167
+ }, U = be()(
2781
2168
  // this is important! Otherwise, solid-zustand will start mutating the initial state
2782
- subscribeWithSelector(() => structuredClone(initialState))
2783
- );
2784
- const cameraUiRefSignalStore = createWithSignal(cameraUiRefStore);
2785
- const noop = () => void 0;
2786
- function makeResizeObserver(callback, options) {
2787
- if (isServer) {
2788
- return { observe: noop, unobserve: noop };
2789
- }
2790
- const observer = new ResizeObserver(callback);
2791
- onCleanup(observer.disconnect.bind(observer));
2792
- return {
2793
- observe: (ref) => observer.observe(ref, options),
2794
- unobserve: observer.unobserve.bind(observer)
2169
+ ge(() => structuredClone(gr))
2170
+ ), le = Ce(U), fe = () => {
2171
+ };
2172
+ function br(t, e) {
2173
+ if (Ue)
2174
+ return { observe: fe, unobserve: fe };
2175
+ const r = new ResizeObserver(t);
2176
+ return ce(r.disconnect.bind(r)), {
2177
+ observe: (a) => r.observe(a, e),
2178
+ unobserve: r.unobserve.bind(r)
2795
2179
  };
2796
2180
  }
2797
- const determineFitMode = (Cw, Ch, Vw, Vh) => {
2798
- const scaleCover = Math.max(Cw / Vw, Ch / Vh);
2799
- let croppedFraction = 0;
2800
- if (Cw / Vw > Ch / Vh) {
2801
- const visible = scaleCover * Vh;
2802
- croppedFraction = 1 - Ch / visible;
2181
+ const pr = (t, e, r, a) => {
2182
+ const n = Math.max(t / r, e / a);
2183
+ let o = 0;
2184
+ if (t / r > e / a) {
2185
+ const i = n * a;
2186
+ o = 1 - e / i;
2803
2187
  } else {
2804
- const visible = scaleCover * Vw;
2805
- croppedFraction = 1 - Cw / visible;
2806
- }
2807
- if (croppedFraction < 0.1) {
2808
- return "cover";
2809
- } else {
2810
- return "contain";
2188
+ const i = n * r;
2189
+ o = 1 - t / i;
2811
2190
  }
2191
+ return o < 0.1 ? "cover" : "contain";
2812
2192
  };
2813
- function getVisibleVideoArea(containerWidth, containerHeight, videoWidth, videoHeight) {
2814
- const scaleX = containerWidth / videoWidth;
2815
- const scaleY = containerHeight / videoHeight;
2816
- const s = Math.max(scaleX, scaleY);
2817
- if (scaleX >= scaleY) {
2818
- const visibleNaturalHeight = Math.round(containerHeight / s);
2819
- const y = Math.round((videoHeight - visibleNaturalHeight) / 2);
2820
- return { x: 0, y, width: videoWidth, height: visibleNaturalHeight };
2193
+ function vr(t, e, r, a) {
2194
+ const n = t / r, o = e / a, i = Math.max(n, o);
2195
+ if (n >= o) {
2196
+ const l = Math.round(e / i);
2197
+ return { x: 0, y: Math.round((a - l) / 2), width: r, height: l };
2821
2198
  } else {
2822
- const visibleNaturalWidth = Math.round(containerWidth / s);
2823
- const x = Math.round((videoWidth - visibleNaturalWidth) / 2);
2824
- return { x, y: 0, width: visibleNaturalWidth, height: videoHeight };
2199
+ const l = Math.round(t / i);
2200
+ return { x: Math.round((r - l) / 2), y: 0, width: l, height: a };
2825
2201
  }
2826
2202
  }
2827
- const dialogPositioner = "_dialogPositioner_worsp_1";
2828
- const dialogBackdrop = "_dialogBackdrop_worsp_5";
2829
- const dialogContent = "_dialogContent_worsp_9";
2830
- const large = "_large_worsp_13";
2831
- const compact = "_compact_worsp_16";
2832
- const dialogTitle = "_dialogTitle_worsp_30";
2833
- const contentOut = "_contentOut_worsp_34";
2834
- const closeButton = "_closeButton_worsp_38";
2835
- const closeButtonInner = "_closeButtonInner_worsp_44";
2836
- const primaryActionButton = "_primaryActionButton_worsp_49";
2837
- const secondaryActionButton = "_secondaryActionButton_worsp_53";
2838
- const actions = "_actions_worsp_57";
2839
- const alertTitle = "_alertTitle_worsp_64";
2840
- const alertText = "_alertText_worsp_68";
2841
- const styles = {
2842
- dialogPositioner,
2843
- dialogBackdrop,
2844
- dialogContent,
2845
- large,
2846
- compact,
2847
- dialogTitle,
2848
- contentOut,
2849
- closeButton,
2850
- closeButtonInner,
2851
- primaryActionButton,
2852
- secondaryActionButton,
2853
- actions,
2854
- alertTitle,
2855
- alertText
2203
+ const wr = "_dialogPositioner_worsp_1", yr = "_dialogBackdrop_worsp_5", Sr = "_dialogContent_worsp_9", Cr = "_large_worsp_13", kr = "_compact_worsp_16", Er = "_dialogTitle_worsp_30", _r = "_contentOut_worsp_34", Tr = "_closeButton_worsp_38", Mr = "_closeButtonInner_worsp_44", xr = "_primaryActionButton_worsp_49", Rr = "_secondaryActionButton_worsp_53", Ar = "_actions_worsp_57", $r = "_alertTitle_worsp_64", Fr = "_alertText_worsp_68", _ = {
2204
+ dialogPositioner: wr,
2205
+ dialogBackdrop: yr,
2206
+ dialogContent: Sr,
2207
+ large: Cr,
2208
+ compact: kr,
2209
+ dialogTitle: Er,
2210
+ contentOut: _r,
2211
+ closeButton: Tr,
2212
+ closeButtonInner: Mr,
2213
+ primaryActionButton: xr,
2214
+ secondaryActionButton: Rr,
2215
+ actions: Ar,
2216
+ alertTitle: $r,
2217
+ alertText: Fr
2856
2218
  };
2857
- var _tmpl$$1 = /* @__PURE__ */ template(`<span>&times;`), _tmpl$2$1 = /* @__PURE__ */ template(`<div>`), _tmpl$3$1 = /* @__PURE__ */ template(`<p>`), _tmpl$4 = /* @__PURE__ */ template(`<span>`), _tmpl$5 = /* @__PURE__ */ template(`<div><button></button><button>`);
2858
- const Modal = (props) => {
2859
- const getPaddingClass = () => {
2860
- switch (props.modalStyle) {
2219
+ var Dr = /* @__PURE__ */ S("<span>&times;"), Ir = /* @__PURE__ */ S("<div>"), zr = /* @__PURE__ */ S("<p>"), Lr = /* @__PURE__ */ S("<span>"), Nr = /* @__PURE__ */ S("<div><button></button><button>");
2220
+ const Br = (t) => {
2221
+ const e = () => {
2222
+ switch (t.modalStyle) {
2861
2223
  case "compact":
2862
- return styles.compact;
2224
+ return _.compact;
2863
2225
  case "large":
2864
- return styles.compact;
2226
+ return _.compact;
2865
2227
  case "default":
2866
2228
  default:
2867
- return void 0;
2229
+ return;
2868
2230
  }
2869
2231
  };
2870
- return createComponent(SmartEnvironmentProvider, {
2871
- children: () => createComponent(Dialog.Root, mergeProps({
2872
- onFocusOutside: (e) => e.preventDefault(),
2873
- onInteractOutside: (e) => e.preventDefault(),
2874
- restoreFocus: true,
2875
- unmountOnExit: true,
2876
- lazyMount: true
2877
- }, props, {
2232
+ return s(ee, {
2233
+ children: () => s($.Root, Y({
2234
+ onFocusOutside: (r) => r.preventDefault(),
2235
+ onInteractOutside: (r) => r.preventDefault(),
2236
+ restoreFocus: !0,
2237
+ unmountOnExit: !0,
2238
+ lazyMount: !0
2239
+ }, t, {
2878
2240
  get children() {
2879
- return createComponent(Show, {
2241
+ return s(E, {
2880
2242
  get when() {
2881
- return props.open;
2243
+ return t.open;
2882
2244
  },
2883
2245
  get children() {
2884
- return createComponent(Portal, {
2246
+ return s(ve, {
2885
2247
  get mount() {
2886
- return props.mountTarget;
2248
+ return t.mountTarget;
2887
2249
  },
2888
2250
  get children() {
2889
- return createComponent(Dialog.Positioner, {
2890
- get ["class"]() {
2891
- return styles.dialogPositioner;
2251
+ return s($.Positioner, {
2252
+ get class() {
2253
+ return _.dialogPositioner;
2892
2254
  },
2893
2255
  get children() {
2894
- return [createComponent(Dialog.Backdrop, {
2895
- get ["class"]() {
2896
- return styles.dialogBackdrop;
2256
+ return [s($.Backdrop, {
2257
+ get class() {
2258
+ return _.dialogBackdrop;
2897
2259
  }
2898
- }), createComponent(Dialog.Content, {
2899
- get ["class"]() {
2900
- return `${styles.dialogContent} ${getPaddingClass()}`;
2260
+ }), s($.Content, {
2261
+ get class() {
2262
+ return `${_.dialogContent} ${e()}`;
2901
2263
  },
2902
2264
  get children() {
2903
- return [createComponent(Show, {
2265
+ return [s(E, {
2904
2266
  get when() {
2905
- return props.showCloseButton;
2267
+ return t.showCloseButton;
2906
2268
  },
2907
2269
  get children() {
2908
- return createComponent(Dialog.CloseTrigger, {
2909
- get ["class"]() {
2910
- return styles.closeButton;
2270
+ return s($.CloseTrigger, {
2271
+ get class() {
2272
+ return _.closeButton;
2911
2273
  },
2912
2274
  get onClick() {
2913
- return props.onCloseClicked;
2275
+ return t.onCloseClicked;
2914
2276
  },
2915
2277
  get children() {
2916
- var _el$ = _tmpl$$1();
2917
- effect(() => className(_el$, styles.closeButtonInner));
2918
- return _el$;
2278
+ var r = Dr();
2279
+ return H(() => V(r, _.closeButtonInner)), r;
2919
2280
  }
2920
2281
  });
2921
2282
  }
2922
- }), createComponent(Show, {
2283
+ }), s(E, {
2923
2284
  get when() {
2924
- return props.headerImage;
2285
+ return t.headerImage;
2925
2286
  },
2926
2287
  get children() {
2927
- return props.headerImage;
2288
+ return t.headerImage;
2928
2289
  }
2929
- }), createComponent(Show, {
2290
+ }), s(E, {
2930
2291
  get when() {
2931
- return props.header;
2292
+ return t.header;
2932
2293
  },
2933
- children: (header) => createComponent(Dialog.Title, {
2934
- get ["class"]() {
2935
- return styles.dialogTitle;
2294
+ children: (r) => s($.Title, {
2295
+ get class() {
2296
+ return _.dialogTitle;
2936
2297
  },
2937
2298
  get children() {
2938
- return header();
2299
+ return r();
2939
2300
  }
2940
2301
  })
2941
- }), createComponent(Dialog.Description, {
2942
- get ["class"]() {
2943
- return styles.contentOut;
2302
+ }), s($.Description, {
2303
+ get class() {
2304
+ return _.contentOut;
2944
2305
  },
2945
2306
  get children() {
2946
- return props.children;
2307
+ return t.children;
2947
2308
  }
2948
- }), createComponent(Show, {
2309
+ }), s(E, {
2949
2310
  get when() {
2950
- return props.actions;
2311
+ return t.actions;
2951
2312
  },
2952
2313
  get children() {
2953
- var _el$2 = _tmpl$2$1();
2954
- insert(_el$2, () => props.actions);
2955
- return _el$2;
2314
+ var r = Ir();
2315
+ return y(r, () => t.actions), r;
2956
2316
  }
2957
2317
  })];
2958
2318
  }
@@ -2966,89 +2326,73 @@ const Modal = (props) => {
2966
2326
  }
2967
2327
  }))
2968
2328
  });
2969
- };
2970
- const AlertModal = ({
2971
- mountTarget,
2972
- header,
2973
- text,
2974
- open,
2975
- onPrimaryClick,
2976
- onSecondaryClick,
2977
- primaryButtonText = "Retry",
2978
- secondaryButtonText = "Cancel"
2329
+ }, Or = ({
2330
+ mountTarget: t,
2331
+ header: e,
2332
+ text: r,
2333
+ open: a,
2334
+ onPrimaryClick: n,
2335
+ onSecondaryClick: o,
2336
+ primaryButtonText: i = "Retry",
2337
+ secondaryButtonText: l = "Cancel"
2979
2338
  }) => {
2980
- let primaryButtonEl;
2981
- return createComponent(Modal, {
2982
- mountTarget,
2339
+ let c;
2340
+ return s(Br, {
2341
+ mountTarget: t,
2983
2342
  get header() {
2984
2343
  return (() => {
2985
- var _el$4 = _tmpl$4();
2986
- insert(_el$4, header);
2987
- effect(() => className(_el$4, styles.alertTitle));
2988
- return _el$4;
2344
+ var d = Lr();
2345
+ return y(d, e), H(() => V(d, _.alertTitle)), d;
2989
2346
  })();
2990
2347
  },
2991
- initialFocusEl: () => primaryButtonEl,
2992
- open,
2348
+ initialFocusEl: () => c,
2349
+ open: a,
2993
2350
  get actions() {
2994
2351
  return (() => {
2995
- var _el$5 = _tmpl$5(), _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling;
2996
- _el$6.$$click = () => onSecondaryClick();
2997
- insert(_el$6, secondaryButtonText);
2998
- _el$7.$$click = () => onPrimaryClick();
2999
- var _ref$ = primaryButtonEl;
3000
- typeof _ref$ === "function" ? use(_ref$, _el$7) : primaryButtonEl = _el$7;
3001
- insert(_el$7, primaryButtonText);
3002
- effect((_p$) => {
3003
- var _v$ = styles.actions, _v$2 = styles.secondaryActionButton, _v$3 = styles.primaryActionButton;
3004
- _v$ !== _p$.e && className(_el$5, _p$.e = _v$);
3005
- _v$2 !== _p$.t && className(_el$6, _p$.t = _v$2);
3006
- _v$3 !== _p$.a && className(_el$7, _p$.a = _v$3);
3007
- return _p$;
2352
+ var d = Nr(), h = d.firstChild, C = h.nextSibling;
2353
+ h.$$click = () => o(), y(h, l), C.$$click = () => n();
2354
+ var w = c;
2355
+ return typeof w == "function" ? B(w, C) : c = C, y(C, i), H((u) => {
2356
+ var v = _.actions, b = _.secondaryActionButton, f = _.primaryActionButton;
2357
+ return v !== u.e && V(d, u.e = v), b !== u.t && V(h, u.t = b), f !== u.a && V(C, u.a = f), u;
3008
2358
  }, {
3009
2359
  e: void 0,
3010
2360
  t: void 0,
3011
2361
  a: void 0
3012
- });
3013
- return _el$5;
2362
+ }), d;
3014
2363
  })();
3015
2364
  },
3016
2365
  modalStyle: "compact",
3017
2366
  get children() {
3018
- var _el$3 = _tmpl$3$1();
3019
- insert(_el$3, text);
3020
- effect(() => className(_el$3, styles.alertText));
3021
- return _el$3;
2367
+ var d = zr();
2368
+ return y(d, r), H(() => V(d, _.alertText)), d;
3022
2369
  }
3023
2370
  });
3024
2371
  };
3025
- delegateEvents(["click"]);
3026
- const CameraErrorModal = () => {
2372
+ qe(["click"]);
2373
+ const Pr = () => {
3027
2374
  const {
3028
2375
  t
3029
- } = useLocalization();
3030
- const {
3031
- cameraManagerSolidStore,
3032
- cameraManager,
3033
- dismountCameraUi
3034
- } = useCameraUiStore();
3035
- const errorState = cameraManagerSolidStore((x) => x.errorState);
3036
- const overlayLayer = cameraUiRefSignalStore((x) => x.overlayLayer);
3037
- return createComponent(Show, {
2376
+ } = Z(), {
2377
+ cameraManagerSolidStore: e,
2378
+ cameraManager: r,
2379
+ dismountCameraUi: a
2380
+ } = j(), n = e((i) => i.errorState), o = le((i) => i.overlayLayer);
2381
+ return s(E, {
3038
2382
  get when() {
3039
- return errorState();
2383
+ return n();
3040
2384
  },
3041
2385
  get children() {
3042
- return createComponent(AlertModal, {
2386
+ return s(Or, {
3043
2387
  get mountTarget() {
3044
- return overlayLayer();
2388
+ return o();
3045
2389
  },
3046
2390
  get header() {
3047
2391
  return t.camera_error_title;
3048
2392
  },
3049
- open: true,
3050
- onPrimaryClick: () => void cameraManager.startCameraStream(),
3051
- onSecondaryClick: () => dismountCameraUi(),
2393
+ open: !0,
2394
+ onPrimaryClick: () => void r.startCameraStream(),
2395
+ onSecondaryClick: () => a(),
3052
2396
  get primaryButtonText() {
3053
2397
  return t.camera_error_primary_btn;
3054
2398
  },
@@ -3062,185 +2406,134 @@ const CameraErrorModal = () => {
3062
2406
  }
3063
2407
  });
3064
2408
  };
3065
- var _tmpl$ = /* @__PURE__ */ template(`<style>`), _tmpl$2 = /* @__PURE__ */ template(`<style id=camera-manager-style>`), _tmpl$3 = /* @__PURE__ */ template(`<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"></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>`);
3066
- const CAPTURE_SCREEN_SHADOW_ROOT_HOST_ID = "capture-screen-host";
3067
- const CaptureScreen = () => {
2409
+ var ne = /* @__PURE__ */ S("<style>"), Vr = /* @__PURE__ */ S("<style id=camera-manager-style>"), Ur = /* @__PURE__ */ S('<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"></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>');
2410
+ const Be = "capture-screen-host", Oe = () => {
3068
2411
  const {
3069
- cameraManager,
3070
- mountTarget,
3071
- showCameraErrorModal
3072
- } = useCameraUiStore();
3073
- const [videoRef, setVideoRef] = createSignal();
3074
- const [feedbackRef, setFeedbackRef] = createSignal();
3075
- const [overlayLayerRef, setOverlayLayerRef] = createSignal();
3076
- const isPortalled = () => mountTarget.parentNode === document.body;
3077
- const [fitMode, setFitMode] = createSignal("contain");
3078
- function adjustVideoFit() {
3079
- const video = videoRef();
3080
- if (!video) {
2412
+ cameraManager: t,
2413
+ mountTarget: e,
2414
+ showCameraErrorModal: r
2415
+ } = j(), [a, n] = z(), [o, i] = z(), [l, c] = z(), d = () => e.parentNode === document.body, [h, C] = z("contain");
2416
+ function w() {
2417
+ const u = a();
2418
+ if (!u)
3081
2419
  return;
3082
- }
3083
- const Cw = video.clientWidth;
3084
- const Ch = video.clientHeight;
3085
- const Vw = video.videoWidth;
3086
- const Vh = video.videoHeight;
3087
- const newFitMode = determineFitMode(Cw, Ch, Vw, Vh);
3088
- setFitMode(newFitMode);
3089
- if (newFitMode === "cover") {
3090
- const visibleArea = getVisibleVideoArea(Cw, Ch, Vw, Vh);
3091
- cameraManager.setExtractionArea(visibleArea);
3092
- } else {
3093
- cameraManager.setExtractionArea({
2420
+ const v = u.clientWidth, b = u.clientHeight, f = u.videoWidth, g = u.videoHeight;
2421
+ if (f === 0 || g === 0)
2422
+ return;
2423
+ const p = pr(v, b, f, g);
2424
+ if (C(p), p === "cover") {
2425
+ const k = vr(v, b, f, g);
2426
+ t.setExtractionArea(k);
2427
+ } else
2428
+ t.setExtractionArea({
3094
2429
  x: 0,
3095
2430
  y: 0,
3096
- width: Vw,
3097
- height: Vh
2431
+ width: f,
2432
+ height: g
3098
2433
  });
3099
- }
3100
2434
  }
3101
- onMount(() => {
3102
- const video = videoRef();
3103
- if (!video) {
2435
+ return J(() => {
2436
+ const u = a();
2437
+ if (!u)
3104
2438
  return;
3105
- }
3106
2439
  const {
3107
- observe,
3108
- unobserve
3109
- } = makeResizeObserver(adjustVideoFit);
3110
- observe(video);
3111
- video.addEventListener("loadedmetadata", adjustVideoFit);
3112
- onCleanup(() => {
3113
- unobserve(video);
3114
- video.removeEventListener("loadedmetadata", adjustVideoFit);
2440
+ observe: v,
2441
+ unobserve: b
2442
+ } = br(w);
2443
+ v(u), u.addEventListener("resize", w), u.addEventListener("loadedmetadata", w), ce(() => {
2444
+ b(u), u.removeEventListener("resize", w), u.removeEventListener("loadedmetadata", w);
3115
2445
  });
3116
- });
3117
- onMount(() => {
3118
- const owner = getOwner();
3119
- if (!owner) {
3120
- return;
3121
- }
3122
- cameraUiRefSignalStore.setState({
3123
- owner
3124
- });
3125
- });
3126
- createEffect(() => {
3127
- const $videoRef = videoRef();
3128
- const $feedbackRef = feedbackRef();
3129
- const $overlayLayerRef = overlayLayerRef();
3130
- if (!$videoRef || !$feedbackRef || !$overlayLayerRef) {
3131
- return;
3132
- }
3133
- cameraUiRefSignalStore.setState({
3134
- feedbackLayer: $feedbackRef,
3135
- overlayLayer: $overlayLayerRef
2446
+ }), J(() => {
2447
+ const u = Se();
2448
+ u && le.setState({
2449
+ owner: u
3136
2450
  });
3137
- cameraManager.initVideoElement($videoRef);
3138
- });
3139
- return createComponent(SolidShadowRoot, {
2451
+ }), Qe(() => {
2452
+ const u = a(), v = o(), b = l();
2453
+ !u || !v || !b || (le.setState({
2454
+ feedbackLayer: v,
2455
+ overlayLayer: b
2456
+ }), t.initVideoElement(u));
2457
+ }), s(dr, {
3140
2458
  get id() {
3141
- return !isPortalled() ? CAPTURE_SCREEN_SHADOW_ROOT_HOST_ID : void 0;
2459
+ return d() ? void 0 : Be;
3142
2460
  },
3143
2461
  get disableShadowRoot() {
3144
- return isPortalled();
2462
+ return d();
3145
2463
  },
3146
2464
  get style() {
3147
- return isPortalled() ? {
2465
+ return d() ? {
3148
2466
  height: "100%"
3149
2467
  } : void 0;
3150
2468
  },
3151
2469
  get children() {
3152
2470
  return [(() => {
3153
- var _el$ = _tmpl$();
3154
- insert(_el$, variables);
3155
- return _el$;
2471
+ var u = ne();
2472
+ return y(u, fr), u;
3156
2473
  })(), (() => {
3157
- var _el$2 = _tmpl$();
3158
- insert(_el$2, normalize);
3159
- return _el$2;
2474
+ var u = ne();
2475
+ return y(u, hr), u;
3160
2476
  })(), (() => {
3161
- var _el$3 = _tmpl$();
3162
- insert(_el$3, rootStyles);
3163
- return _el$3;
2477
+ var u = ne();
2478
+ return y(u, mr), u;
3164
2479
  })(), (() => {
3165
- var _el$4 = _tmpl$2();
3166
- use((ref) => {
3167
- if (window.__mbCameraManagerCssCode) {
3168
- ref.innerHTML = window.__mbCameraManagerCssCode;
3169
- }
3170
- }, _el$4);
3171
- return _el$4;
2480
+ var u = Vr();
2481
+ return B((v) => {
2482
+ window.__mbCameraManagerCssCode && (v.innerHTML = window.__mbCameraManagerCssCode);
2483
+ }, u), u;
3172
2484
  })(), (() => {
3173
- var _el$5 = _tmpl$3(), _el$6 = _el$5.firstChild, _el$7 = _el$6.nextSibling, _el$8 = _el$7.nextSibling;
3174
- insert(_el$5, createComponent(Header, {}), _el$6);
3175
- use(setVideoRef, _el$6);
3176
- use(setFeedbackRef, _el$7);
3177
- use(setOverlayLayerRef, _el$8);
3178
- insert(_el$5, createComponent(Show, {
3179
- when: showCameraErrorModal,
2485
+ var u = Ur(), v = u.firstChild, b = v.nextSibling, f = b.nextSibling;
2486
+ return y(u, s(lr, {}), v), B(n, v), B(i, b), B(c, f), y(u, s(E, {
2487
+ when: r,
3180
2488
  get children() {
3181
- return createComponent(CameraErrorModal, {});
2489
+ return s(Pr, {});
3182
2490
  }
3183
- }), null);
3184
- effect((_$p) => (_$p = fitMode()) != null ? _el$6.style.setProperty("object-fit", _$p) : _el$6.style.removeProperty("object-fit"));
3185
- return _el$5;
2491
+ }), null), H((g) => (g = h()) != null ? v.style.setProperty("object-fit", g) : v.style.removeProperty("object-fit")), u;
3186
2492
  })()];
3187
2493
  }
3188
2494
  });
3189
- };
3190
- const CaptureScreenPortalled = () => {
2495
+ }, qr = () => {
3191
2496
  const {
3192
2497
  t
3193
- } = useLocalization();
3194
- const [isOpen, setIsOpen] = createSignal(true);
3195
- const {
3196
- addOnDismountCallback
3197
- } = useCameraUiStore();
3198
- addOnDismountCallback(() => {
3199
- setIsOpen(false);
3200
- });
3201
- return createComponent(Portal, {
3202
- useShadow: true,
2498
+ } = Z(), [e, r] = z(!0), {
2499
+ addOnDismountCallback: a
2500
+ } = j();
2501
+ return a(() => {
2502
+ r(!1);
2503
+ }), s(ve, {
2504
+ useShadow: !0,
3203
2505
  get mount() {
3204
- return document.getElementById(MOUNT_POINT_ID);
3205
- },
3206
- ref: (ref) => {
3207
- ref.id = CAPTURE_SCREEN_SHADOW_ROOT_HOST_ID;
3208
- ref.style.zIndex = "1000";
3209
- ref.style.position = "fixed";
3210
- ref.id = "mb-camera-host";
3211
- return ref;
2506
+ return document.getElementById(Pe);
3212
2507
  },
2508
+ ref: (n) => (n.id = Be, n.style.zIndex = "1000", n.style.position = "fixed", n.id = "mb-camera-host", n),
3213
2509
  get children() {
3214
- return createComponent(SmartEnvironmentProvider, {
3215
- children: (rootNode) => createComponent(Dialog.Root, {
2510
+ return s(ee, {
2511
+ children: (n) => s($.Root, {
3216
2512
  get open() {
3217
- return isOpen();
2513
+ return e();
3218
2514
  },
3219
- lazyMount: true,
3220
- unmountOnExit: true,
2515
+ lazyMount: !0,
2516
+ unmountOnExit: !0,
3221
2517
  initialFocusEl: () => {
3222
- const dummyNode = document.createElement("div");
3223
- dummyNode.tabIndex = -1;
3224
- rootNode.appendChild(dummyNode);
3225
- setTimeout(() => {
3226
- dummyNode.remove();
3227
- }, 0);
3228
- return dummyNode;
2518
+ const o = document.createElement("div");
2519
+ return o.tabIndex = -1, n.appendChild(o), setTimeout(() => {
2520
+ o.remove();
2521
+ }, 0), o;
3229
2522
  },
3230
2523
  get children() {
3231
- return createComponent(Dialog.Positioner, {
2524
+ return s($.Positioner, {
3232
2525
  get children() {
3233
- return createComponent(Dialog.Content, {
2526
+ return s($.Content, {
3234
2527
  "aria-labelledby": "dialog-title",
3235
- "class": "h-vh supports-[(height:100dvh)]:h-dvh top-0 left-0 w-full fixed",
2528
+ class: "h-vh supports-[(height:100dvh)]:h-dvh top-0 left-0 w-full fixed",
3236
2529
  get children() {
3237
- return [createComponent(Dialog.Title, {
3238
- "class": "sr-only",
2530
+ return [s($.Title, {
2531
+ class: "sr-only",
3239
2532
  id: "dialog-title",
3240
2533
  get children() {
3241
2534
  return t.scan_document;
3242
2535
  }
3243
- }), createComponent(CaptureScreen, {})];
2536
+ }), s(Oe, {})];
3244
2537
  }
3245
2538
  });
3246
2539
  }
@@ -3250,91 +2543,71 @@ const CaptureScreenPortalled = () => {
3250
2543
  });
3251
2544
  }
3252
2545
  });
3253
- };
3254
- const RootComponent = () => {
2546
+ }, jr = () => {
3255
2547
  const {
3256
- mountTarget
3257
- } = useCameraUiStore();
3258
- return createComponent(Dynamic, {
2548
+ mountTarget: t
2549
+ } = j();
2550
+ return s(je, {
3259
2551
  get component() {
3260
- return mountTarget.parentNode === document.body ? CaptureScreenPortalled : CaptureScreen;
2552
+ return t.parentNode === document.body ? qr : Oe;
3261
2553
  }
3262
2554
  });
3263
- };
3264
- const MOUNT_POINT_ID = "camera-manager-mount-point";
3265
- function createCameraManagerUi(cameraManager, target, {
3266
- localizationStrings,
3267
- showMirrorCameraButton = false,
3268
- showTorchButton = true,
3269
- showCloseButton = true,
3270
- showCameraErrorModal = true
2555
+ }, Pe = "camera-manager-mount-point";
2556
+ function ra(t, e, {
2557
+ localizationStrings: r,
2558
+ showMirrorCameraButton: a = !1,
2559
+ showTorchButton: n = !0,
2560
+ showCloseButton: o = !0,
2561
+ showCameraErrorModal: i = !0
3271
2562
  } = {}) {
3272
- let mountTarget;
3273
- const dismountCallbacks = /* @__PURE__ */ new Set();
3274
- let updateLocalizationRef;
3275
- const setLocalizationRef = (setter) => {
3276
- updateLocalizationRef = setter;
2563
+ let l;
2564
+ const c = /* @__PURE__ */ new Set();
2565
+ let d;
2566
+ const h = (g) => {
2567
+ d = g;
2568
+ }, C = () => {
2569
+ t.reset();
3277
2570
  };
3278
- const cleanupCameraManager = () => {
3279
- cameraManager.reset();
3280
- };
3281
- let dismountRef;
3282
- const dismountCameraManagerUi = () => {
2571
+ let w;
2572
+ const u = () => {
3283
2573
  try {
3284
2574
  console.debug("🧱 Dismounting camera manager UI");
3285
- for (const callback of dismountCallbacks) {
3286
- callback();
3287
- }
3288
- dismountCallbacks.clear();
3289
- cleanupCameraManager();
3290
- requestAnimationFrame(() => {
2575
+ for (const g of c)
2576
+ g();
2577
+ c.clear(), C(), requestAnimationFrame(() => {
3291
2578
  requestAnimationFrame(() => {
3292
- if (dismountRef) {
3293
- dismountRef();
3294
- }
3295
- mountTarget.remove();
3296
- cleanupCameraManager();
2579
+ w && w(), l.remove(), C();
3297
2580
  });
3298
2581
  });
3299
- } catch (e) {
3300
- console.warn("Error while dismounting camera manager UI", e);
2582
+ } catch (g) {
2583
+ console.warn("Error while dismounting camera manager UI", g);
3301
2584
  }
3302
- };
3303
- const newMountTarget = document.createElement("div");
3304
- newMountTarget.id = MOUNT_POINT_ID;
3305
- mountTarget = newMountTarget;
3306
- if (target) {
3307
- target.appendChild(newMountTarget);
3308
- } else {
3309
- document.body.appendChild(newMountTarget);
3310
- }
3311
- const addOnDismountCallback = (fn) => {
3312
- dismountCallbacks.add(fn);
3313
- return () => {
3314
- dismountCallbacks.delete(fn);
3315
- };
3316
- };
3317
- dismountRef = render(() => createComponent(LocalizationProvider, {
3318
- userStrings: localizationStrings,
3319
- setLocalizationRef,
2585
+ }, v = document.createElement("div");
2586
+ v.id = Pe, l = v, e ? e.appendChild(v) : document.body.appendChild(v);
2587
+ const b = (g) => (c.add(g), () => {
2588
+ c.delete(g);
2589
+ });
2590
+ w = He(() => s(Ot, {
2591
+ userStrings: r,
2592
+ setLocalizationRef: h,
3320
2593
  get children() {
3321
- return createComponent(CameraUiStoreProvider, {
3322
- addOnDismountCallback,
3323
- dismountCameraUi: dismountCameraManagerUi,
3324
- cameraManager,
3325
- showMirrorCameraButton,
3326
- showTorchButton,
3327
- showCloseButton,
3328
- showCameraErrorModal,
3329
- mountTarget,
2594
+ return s(Nt, {
2595
+ addOnDismountCallback: b,
2596
+ dismountCameraUi: u,
2597
+ cameraManager: t,
2598
+ showMirrorCameraButton: a,
2599
+ showTorchButton: n,
2600
+ showCloseButton: o,
2601
+ showCameraErrorModal: i,
2602
+ mountTarget: l,
3330
2603
  get children() {
3331
- return createComponent(RootComponent, {});
2604
+ return s(jr, {});
3332
2605
  }
3333
2606
  });
3334
2607
  }
3335
- }), mountTarget);
3336
- const exposedComponentApi = {
3337
- updateLocalization: updateLocalizationRef,
2608
+ }), l);
2609
+ const f = {
2610
+ updateLocalization: d,
3338
2611
  /**
3339
2612
  * Adds a callback to be called when the component is unmounted.
3340
2613
  * Returns a cleanup function that removes the callback when called.
@@ -3342,89 +2615,65 @@ function createCameraManagerUi(cameraManager, target, {
3342
2615
  * @param fn - The callback function to be called when the component is unmounted
3343
2616
  * @returns A cleanup function that removes the callback when called
3344
2617
  */
3345
- addOnDismountCallback,
3346
- cameraManager,
2618
+ addOnDismountCallback: b,
2619
+ cameraManager: t,
3347
2620
  // we know these are defined because `createCameraManagerUi` resolves when they are defined
3348
2621
  // TODO: maybe don't use getters but make sure they are defined
3349
2622
  get feedbackLayerNode() {
3350
- return cameraUiRefStore.getState().feedbackLayer;
2623
+ return U.getState().feedbackLayer;
3351
2624
  },
3352
2625
  get overlayLayerNode() {
3353
- return cameraUiRefStore.getState().overlayLayer;
2626
+ return U.getState().overlayLayer;
3354
2627
  },
3355
2628
  get owner() {
3356
- return cameraUiRefStore.getState().owner;
2629
+ return U.getState().owner;
3357
2630
  },
3358
- dismount: dismountCameraManagerUi
2631
+ dismount: u
3359
2632
  };
3360
- return new Promise((resolve) => {
3361
- let videoExists = false;
3362
- let feedbackExists = false;
3363
- let overlayExists = false;
3364
- let unsubscribeFeedbackLayer = () => {
3365
- };
3366
- let unsubscribeOverlayLayer = () => {
3367
- };
3368
- let unsubscribeVideo = () => {
2633
+ return new Promise((g) => {
2634
+ let p = !1, k = !1, x = !1, I = () => {
2635
+ }, G = () => {
2636
+ }, X = () => {
3369
2637
  };
3370
- const checkReady = () => {
3371
- if (videoExists && feedbackExists && overlayExists) {
3372
- unsubscribeFeedbackLayer();
3373
- unsubscribeOverlayLayer();
3374
- unsubscribeVideo();
3375
- resolve(exposedComponentApi);
3376
- }
2638
+ const te = () => {
2639
+ p && k && x && (I(), G(), X(), g(f));
3377
2640
  };
3378
- unsubscribeFeedbackLayer = cameraUiRefStore.subscribe((x) => x.feedbackLayer, (feedbackLayer) => {
3379
- if (feedbackLayer) {
3380
- feedbackExists = true;
3381
- }
3382
- checkReady();
2641
+ I = U.subscribe((R) => R.feedbackLayer, (R) => {
2642
+ R && (k = !0), te();
3383
2643
  }, {
3384
- fireImmediately: true
3385
- });
3386
- unsubscribeOverlayLayer = cameraUiRefStore.subscribe((x) => x.overlayLayer, (overlayLayer) => {
3387
- if (overlayLayer) {
3388
- overlayExists = true;
3389
- }
3390
- checkReady();
2644
+ fireImmediately: !0
2645
+ }), G = U.subscribe((R) => R.overlayLayer, (R) => {
2646
+ R && (x = !0), te();
3391
2647
  }, {
3392
- fireImmediately: true
3393
- });
3394
- unsubscribeVideo = cameraManager.subscribe((state) => state.videoElement, (videoElement) => {
3395
- if (videoElement) {
3396
- videoExists = true;
3397
- checkReady();
3398
- }
2648
+ fireImmediately: !0
2649
+ }), X = t.subscribe((R) => R.videoElement, (R) => {
2650
+ R && (p = !0, te());
3399
2651
  }, {
3400
- fireImmediately: true
2652
+ fireImmediately: !0
3401
2653
  });
3402
2654
  });
3403
2655
  }
3404
- const testSymbol = Symbol();
3405
- globalThis.__CAMERA_MANAGER__ ||= testSymbol;
3406
- if (globalThis.__CAMERA_MANAGER__ !== testSymbol) {
3407
- console.warn(
3408
- "Detected multiple instances of @microblink/camera-manager. This can lead to unexpected behavior."
3409
- );
3410
- }
2656
+ const Ve = Symbol();
2657
+ globalThis.__CAMERA_MANAGER__ ||= Ve;
2658
+ globalThis.__CAMERA_MANAGER__ !== Ve && console.warn(
2659
+ "Detected multiple instances of @microblink/camera-manager. This can lead to unexpected behavior."
2660
+ );
3411
2661
  export {
3412
- Camera,
3413
- CameraError,
3414
- CameraManager,
3415
- MOUNT_POINT_ID,
3416
- VideoFrameProcessor,
3417
- cameraManagerStore,
3418
- cameraUiRefStore,
3419
- createCameraManagerUi,
3420
- defaultCameraManagerOptions,
3421
- findResolutionKey,
3422
- getBuffer,
3423
- getNormalizedResolution,
3424
- isBufferDetached,
3425
- matchClosestResolution,
3426
- resetCameraManagerStore,
3427
- returnLongerSide,
3428
- videoResolutions
2662
+ Ae as Camera,
2663
+ xe as CameraError,
2664
+ ta as CameraManager,
2665
+ Pe as MOUNT_POINT_ID,
2666
+ It as VideoFrameProcessor,
2667
+ m as cameraManagerStore,
2668
+ U as cameraUiRefStore,
2669
+ ra as createCameraManagerUi,
2670
+ zt as defaultCameraManagerOptions,
2671
+ wt as findResolutionKey,
2672
+ Ie as getBuffer,
2673
+ pt as getNormalizedResolution,
2674
+ se as isBufferDetached,
2675
+ vt as matchClosestResolution,
2676
+ yt as resetCameraManagerStore,
2677
+ bt as returnLongerSide,
2678
+ O as videoResolutions
3429
2679
  };
3430
- //# sourceMappingURL=camera-manager.js.map