@camstack/addon-pipeline 1.0.7 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/audio-analyzer/index.js +7 -8
- package/dist/audio-analyzer/index.mjs +3 -4
- package/dist/audio-codec-nodeav/index.js +2 -2
- package/dist/audio-codec-nodeav/index.mjs +2 -2
- package/dist/decoder-nodeav/index.js +1 -1
- package/dist/decoder-nodeav/index.mjs +1 -1
- package/dist/detection-pipeline/index.js +862 -696
- package/dist/detection-pipeline/index.mjs +850 -684
- package/dist/{dist-CjrjeaDd.mjs → dist-BA6DR_jV.mjs} +128 -5
- package/dist/{dist-G45MVm6i.js → dist-BLcTVvol.js} +151 -4
- package/dist/{model-download-service-C7AjBsX9-rXY-VFDk.js → model-download-service-RxAOiYvX-C8rTRJy_.js} +36 -6
- package/dist/{model-download-service-C7AjBsX9-B0ekM6dF.mjs → model-download-service-RxAOiYvX-CMAvhgO7.mjs} +36 -6
- package/dist/motion-wasm/index.js +1 -1
- package/dist/motion-wasm/index.mjs +1 -1
- package/dist/pipeline-runner/index.js +1 -1
- package/dist/pipeline-runner/index.mjs +1 -1
- package/dist/recorder/index.js +6 -6
- package/dist/recorder/index.mjs +4 -4
- package/dist/stream-broker/_stub.js +1 -1
- package/dist/stream-broker/{_virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-Tbqpu0v3.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-DrohyZ5L.mjs} +3 -3
- package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-COa17XL2.mjs +26 -0
- package/dist/stream-broker/{hostInit-tIev5Gd9.mjs → hostInit-zLZbYJcg.mjs} +3 -3
- package/dist/stream-broker/index.js +26 -26
- package/dist/stream-broker/index.mjs +20 -20
- package/dist/stream-broker/remoteEntry.js +1 -1
- package/embed-dist/assets/{MaskShapeCanvas-DI4BY7W2-C0kKwNX_.js → MaskShapeCanvas-DI4BY7W2-DJ7ztnFv.js} +1 -1
- package/embed-dist/assets/MotionZonesSettings-NcxxQN8r-CQzEnQoq.js +1 -0
- package/embed-dist/assets/{PrivacyMaskSettings-APgPLF7p-C2SRtNe6.js → PrivacyMaskSettings-APgPLF7p-Cl0eOy_U.js} +1 -1
- package/embed-dist/assets/{index-B2LRyXWh.js → index-CSuLwWK-.js} +3 -3
- package/embed-dist/index.html +1 -1
- package/package.json +1 -1
- package/python/inference_pool.py +65 -6
- package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-DCsgcqTa.mjs +0 -26
- package/embed-dist/assets/MotionZonesSettings-C1EEbk2V-CYtJc892.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./MotionZonesSettings-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./MotionZonesSettings-NcxxQN8r-CQzEnQoq.js","./MaskShapeCanvas-DI4BY7W2-DJ7ztnFv.js","./PrivacyMaskSettings-APgPLF7p-Cl0eOy_U.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),c=(e,n)=>{let r={};for(var a in e)t(r,a,{get:e[a],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},l=(e,a,s,c)=>{if(a&&typeof a==`object`||typeof a==`function`)for(var l=r(a),u=0,d=l.length,f;u<d;u++)f=l[u],!o.call(e,f)&&f!==s&&t(e,f,{get:(e=>a[e]).bind(null,f),enumerable:!(c=n(a,f))||c.enumerable});return e},u=(n,r,o)=>(o=n==null?{}:e(a(n)),l(r||!n||!n.__esModule?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var d=s((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,o=e[r];if(0<a(o,t))e[r]=t,e[n]=o,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,o=e.length,s=o>>>1;r<s;){var c=2*(r+1)-1,l=e[c],u=c+1,d=e[u];if(0>a(l,n))u<o&&0>a(d,l)?(e[r]=d,e[u]=n,r=u):(e[r]=l,e[c]=n,r=c);else if(u<o&&0>a(d,n))e[r]=d,e[u]=n,r=u;else break a}}return t}function a(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,c=s.now();e.unstable_now=function(){return s.now()-c}}var l=[],u=[],d=1,f=null,p=3,m=!1,h=!1,g=!1,_=!1,v=typeof setTimeout==`function`?setTimeout:null,y=typeof clearTimeout==`function`?clearTimeout:null,b=typeof setImmediate<`u`?setImmediate:null;function ee(e){for(var a=n(u);a!==null;){if(a.callback===null)r(u);else if(a.startTime<=e)r(u),a.sortIndex=a.expirationTime,t(l,a);else break;a=n(u)}}function x(e){if(g=!1,ee(e),!h)if(n(l)!==null)h=!0,S||(S=!0,ne());else{var t=n(u);t!==null&&ae(x,t.startTime-e)}}var S=!1,C=-1,w=5,te=-1;function T(){return _?!0:!(e.unstable_now()-te<w)}function E(){if(_=!1,S){var t=e.unstable_now();te=t;var a=!0;try{a:{h=!1,g&&(g=!1,y(C),C=-1),m=!0;var o=p;try{b:{for(ee(t),f=n(l);f!==null&&!(f.expirationTime>t&&T());){var s=f.callback;if(typeof s==`function`){f.callback=null,p=f.priorityLevel;var c=s(f.expirationTime<=t);if(t=e.unstable_now(),typeof c==`function`){f.callback=c,ee(t),a=!0;break b}f===n(l)&&r(l),ee(t)}else r(l);f=n(l)}if(f!==null)a=!0;else{var d=n(u);d!==null&&ae(x,d.startTime-t),a=!1}}break a}finally{f=null,p=o,m=!1}a=void 0}}finally{a?ne():S=!1}}}var ne;if(typeof b==`function`)ne=function(){b(E)};else if(typeof MessageChannel<`u`){var re=new MessageChannel,ie=re.port2;re.port1.onmessage=E,ne=function(){ie.postMessage(null)}}else ne=function(){v(E,0)};function ae(t,n){C=v(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_next=function(e){switch(p){case 1:case 2:case 3:var t=3;break;default:t=p}var n=p;p=t;try{return e()}finally{p=n}},e.unstable_requestPaint=function(){_=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=p;p=e;try{return t()}finally{p=n}},e.unstable_scheduleCallback=function(r,a,o){var s=e.unstable_now();switch(typeof o==`object`&&o?(o=o.delay,o=typeof o==`number`&&0<o?s+o:s):o=s,r){case 1:var c=-1;break;case 2:c=250;break;case 5:c=1073741823;break;case 4:c=1e4;break;default:c=5e3}return c=o+c,r={id:d++,callback:a,priorityLevel:r,startTime:o,expirationTime:c,sortIndex:-1},o>s?(r.sortIndex=o,t(u,r),n(l)===null&&r===n(u)&&(g?(y(C),C=-1):g=!0,ae(x,o-s))):(r.sortIndex=c,t(l,r),h||m||(h=!0,S||(S=!0,ne()))),r},e.unstable_shouldYield=T,e.unstable_wrapCallback=function(e){var t=p;return function(){var n=p;p=t;try{return e.apply(this,arguments)}finally{p=n}}}})),f=s(((e,t)=>{t.exports=d()})),p=s((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),a=Symbol.for(`react.strict_mode`),o=Symbol.for(`react.profiler`),s=Symbol.for(`react.consumer`),c=Symbol.for(`react.context`),l=Symbol.for(`react.forward_ref`),u=Symbol.for(`react.suspense`),d=Symbol.for(`react.memo`),f=Symbol.for(`react.lazy`),p=Symbol.for(`react.activity`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function ee(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var x=ee.prototype=new b;x.constructor=ee,_(x,y.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},te=Object.prototype.hasOwnProperty;function T(e,n,r){var a=r.ref;return{$$typeof:t,type:e,key:n,ref:a===void 0?null:a,props:r}}function E(e,t){return T(e.type,t,e.props)}function ne(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function re(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ie=/\/+/g;function ae(e,t){return typeof e==`object`&&e&&e.key!=null?re(``+e.key):t.toString(36)}function oe(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function se(e,r,a,o,s){var c=typeof e;(c===`undefined`||c===`boolean`)&&(e=null);var l=!1;if(e===null)l=!0;else switch(c){case`bigint`:case`string`:case`number`:l=!0;break;case`object`:switch(e.$$typeof){case t:case n:l=!0;break;case f:return l=e._init,se(l(e._payload),r,a,o,s)}}if(l)return s=s(e),l=o===``?`.`+ae(e,0):o,S(s)?(a=``,l!=null&&(a=l.replace(ie,`$&/`)+`/`),se(s,r,a,``,function(e){return e})):s!=null&&(ne(s)&&(s=E(s,a+(s.key==null||e&&e.key===s.key?``:(``+s.key).replace(ie,`$&/`)+`/`)+l)),r.push(s)),1;l=0;var u=o===``?`.`:o+`:`;if(S(e))for(var d=0;d<e.length;d++)o=e[d],c=u+ae(o,d),l+=se(o,r,a,c,s);else if(d=h(e),typeof d==`function`)for(e=d.call(e),d=0;!(o=e.next()).done;)o=o.value,c=u+ae(o,d++),l+=se(o,r,a,c,s);else if(c===`object`){if(typeof e.then==`function`)return se(oe(e),r,a,o,s);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return l}function D(e,t,n){if(e==null)return e;var r=[],a=0;return se(e,r,``,``,function(e){return t.call(n,e,a++)}),r}function ce(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var O=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},k={map:D,forEach:function(e,t,n){D(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return D(e,function(){t++}),t},toArray:function(e){return D(e,function(e){return e})||[]},only:function(e){if(!ne(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=p,e.Children=k,e.Component=y,e.Fragment=r,e.Profiler=o,e.PureComponent=ee,e.StrictMode=a,e.Suspense=u,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),a=e.key;if(t!=null)for(o in t.key!==void 0&&(a=``+t.key),t)!te.call(t,o)||o===`key`||o===`__self`||o===`__source`||o===`ref`&&t.ref===void 0||(r[o]=t[o]);var o=arguments.length-2;if(o===1)r.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];r.children=s}return T(e.type,a,r)},e.createContext=function(e){return e={$$typeof:c,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:s,_context:e},e},e.createElement=function(e,t,n){var r,a={},o=null;if(t!=null)for(r in t.key!==void 0&&(o=``+t.key),t)te.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(a[r]=t[r]);var s=arguments.length-2;if(s===1)a.children=n;else if(1<s){for(var c=Array(s),l=0;l<s;l++)c[l]=arguments[l+2];a.children=c}if(e&&e.defaultProps)for(r in s=e.defaultProps,s)a[r]===void 0&&(a[r]=s[r]);return T(e,o,a)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:l,render:e}},e.isValidElement=ne,e.lazy=function(e){return{$$typeof:f,_payload:{_status:-1,_result:e},_init:ce}},e.memo=function(e,t){return{$$typeof:d,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),a=w.S;a!==null&&a(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,O)}catch(e){O(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.7`})),m=s(((e,t)=>{t.exports=p()})),h=s((e=>{var t=m();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var a={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for(`react.portal`);function s(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return s(e,t,null,r)},e.flushSync=function(e){var t=c.T,n=a.p;try{if(c.T=null,a.p=2,e)return e()}finally{c.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),o=typeof t.integrity==`string`?t.integrity:void 0,s=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:o,fetchPriority:s}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:o,fetchPriority:s,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??a.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=l(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else a.d.m(e)},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},e.useFormStatus=function(){return c.H.useHostTransitionStatus()},e.version=`19.2.7`})),g=s(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=h()})),_=s((e=>{var t=f(),n=m(),r=g();function a(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function s(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function c(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(s(e)!==e)throw Error(a(188))}function d(e){var t=e.alternate;if(!t){if(t=s(e),t===null)throw Error(a(188));return t===e?e:null}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var c=o.alternate;if(c===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===c.child){for(c=o.child;c;){if(c===n)return u(o),e;if(c===r)return u(o),t;c=c.sibling}throw Error(a(188))}if(n.return!==r.return)n=o,r=c;else{for(var l=!1,d=o.child;d;){if(d===n){l=!0,n=o,r=c;break}if(d===r){l=!0,r=o,n=c;break}d=d.sibling}if(!l){for(d=c.child;d;){if(d===n){l=!0,n=c,r=o;break}if(d===r){l=!0,r=c,n=o;break}d=d.sibling}if(!l)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(n.tag!==3)throw Error(a(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,_=Symbol.for(`react.element`),v=Symbol.for(`react.transitional.element`),y=Symbol.for(`react.portal`),b=Symbol.for(`react.fragment`),ee=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),te=Symbol.for(`react.suspense`),T=Symbol.for(`react.suspense_list`),E=Symbol.for(`react.memo`),ne=Symbol.for(`react.lazy`),re=Symbol.for(`react.activity`),ie=Symbol.for(`react.memo_cache_sentinel`),ae=Symbol.iterator;function oe(e){return typeof e!=`object`||!e?null:(e=ae&&e[ae]||e[`@@iterator`],typeof e==`function`?e:null)}var se=Symbol.for(`react.client.reference`);function D(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===se?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case b:return`Fragment`;case x:return`Profiler`;case ee:return`StrictMode`;case te:return`Suspense`;case T:return`SuspenseList`;case re:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case y:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case E:return t=e.displayName||null,t===null?D(e.type)||`Memo`:t;case ne:t=e._payload,e=e._init;try{return D(e(t))}catch{}}return null}var ce=Array.isArray,O=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,k=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,le={pending:!1,data:null,method:null,action:null},ue=[],de=-1;function A(e){return{current:e}}function fe(e){0>de||(e.current=ue[de],ue[de]=null,de--)}function pe(e,t){de++,ue[de]=e.current,e.current=t}var me=A(null),he=A(null),ge=A(null),_e=A(null);function ve(e,t){switch(pe(ge,t),pe(he,e),pe(me,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Xd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Xd(t),e=Zd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}fe(me),pe(me,e)}function ye(){fe(me),fe(he),fe(ge)}function be(e){e.memoizedState!==null&&pe(_e,e);var t=me.current,n=Zd(t,e.type);t!==n&&(pe(he,e),pe(me,n))}function xe(e){he.current===e&&(fe(me),fe(he)),_e.current===e&&(fe(_e),rp._currentValue=le)}var Se,Ce;function we(e){if(Se===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Se=t&&t[1]||``,Ce=-1<e.stack.indexOf(`
|
|
3
3
|
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
4
|
`+Se+e+Ce}var Te=!1;function Ee(e,t){if(!e||Te)return``;Te=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var a=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);a&&a.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var o=r.DetermineComponentFrameRoot(),s=o[0],c=o[1];if(s&&c){var l=s.split(`
|
|
@@ -73,8 +73,8 @@ Error generating stack: `+e.message+`
|
|
|
73
73
|
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){o(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){o(n);continue}}if(e.metadataRegistry.get(n[0])?.id){o(n);continue}if(r.cycle){o(n);continue}if(r.count>1&&e.reused===`ref`){o(n);continue}}}function pl(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let a=n.def??n.schema,o={...a},s=n.ref;if(n.ref=null,s){r(s);let n=e.seen.get(s),c=n.schema;if(c.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(a.allOf=a.allOf??[],a.allOf.push(c)):Object.assign(a,c),Object.assign(a,o),t._zod.parent===s)for(let e in a)e===`$ref`||e===`allOf`||e in o||delete a[e];if(c.$ref&&n.def)for(let e in a)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(a[e])===JSON.stringify(n.def[e])&&delete a[e]}let c=t._zod.parent;if(c&&c!==s){r(c);let t=e.seen.get(c);if(t?.schema.$ref&&(a.$ref=t.schema.$ref,t.def))for(let e in a)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(a[e])===JSON.stringify(t.def[e])&&delete a[e]}e.override({zodSchema:t,jsonSchema:a,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let a={};if(e.target===`draft-2020-12`?a.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?a.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?a.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");a.$id=e.external.uri(n)}Object.assign(a,n.def??n.schema);let o=e.metadataRegistry.get(t)?.id;o!==void 0&&a.id===o&&delete a.id;let s=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,s[e.defId]=e.def)}e.external||Object.keys(s).length>0&&(e.target===`draft-2020-12`?a.$defs=s:a.definitions=s);try{let n=JSON.parse(JSON.stringify(a));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:gl(t,`input`,e.processors),output:gl(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function ml(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return ml(r.element,n);if(r.type===`set`)return ml(r.valueType,n);if(r.type===`lazy`)return ml(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return ml(r.innerType,n);if(r.type===`intersection`)return ml(r.left,n)||ml(r.right,n);if(r.type===`record`||r.type===`map`)return ml(r.keyType,n)||ml(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:ml(r.in,n)||ml(r.out,n);if(r.type===`object`){for(let e in r.shape)if(ml(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(ml(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(ml(e,n))return!0;return!!(r.rest&&ml(r.rest,n))}return!1}var hl=(e,t={})=>n=>{let r=ul({...n,processors:t});return dl(e,r),fl(r,e),pl(r,e)},gl=(e,t,n={})=>r=>{let{libraryOptions:a,target:o}=r??{},s=ul({...a??{},target:o,io:t,processors:n});return dl(e,s),fl(s,e),pl(s,e)},_l={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},vl=(e,t,n,r)=>{let a=n;a.type=`string`;let{minimum:o,maximum:s,format:c,patterns:l,contentEncoding:u}=e._zod.bag;if(typeof o==`number`&&(a.minLength=o),typeof s==`number`&&(a.maxLength=s),c&&(a.format=_l[c]??c,a.format===``&&delete a.format,c===`time`&&delete a.format),u&&(a.contentEncoding=u),l&&l.size>0){let e=[...l];e.length===1?a.pattern=e[0].source:e.length>1&&(a.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},yl=(e,t,n,r)=>{let a=n,{minimum:o,maximum:s,format:c,multipleOf:l,exclusiveMaximum:u,exclusiveMinimum:d}=e._zod.bag;typeof c==`string`&&c.includes(`int`)?a.type=`integer`:a.type=`number`;let f=typeof d==`number`&&d>=(o??-1/0),p=typeof u==`number`&&u<=(s??1/0),m=t.target===`draft-04`||t.target===`openapi-3.0`;f?m?(a.minimum=d,a.exclusiveMinimum=!0):a.exclusiveMinimum=d:typeof o==`number`&&(a.minimum=o),p?m?(a.maximum=u,a.exclusiveMaximum=!0):a.exclusiveMaximum=u:typeof s==`number`&&(a.maximum=s),typeof l==`number`&&(a.multipleOf=l)},bl=(e,t,n,r)=>{n.type=`boolean`},xl=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},Sl=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`)},Cl=(e,t,n,r)=>{n.not={}},wl=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Date cannot be represented in JSON Schema`)},Tl=(e,t,n,r)=>{let a=e._zod.def,o=Ni(a.entries);o.every(e=>typeof e==`number`)&&(n.type=`number`),o.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=o},El=(e,t,n,r)=>{let a=e._zod.def,o=[];for(let e of a.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);o.push(Number(e))}else o.push(e);if(o.length!==0)if(o.length===1){let e=o[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else o.every(e=>typeof e==`number`)&&(n.type=`number`),o.every(e=>typeof e==`string`)&&(n.type=`string`),o.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),o.every(e=>e===null)&&(n.type=`null`),n.enum=o},Dl=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},Ol=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},kl=(e,t,n,r)=>{let a=n,o=e._zod.def,{minimum:s,maximum:c}=e._zod.bag;typeof s==`number`&&(a.minItems=s),typeof c==`number`&&(a.maxItems=c),a.type=`array`,a.items=dl(o.element,t,{...r,path:[...r.path,`items`]})},Al=(e,t,n,r)=>{let a=n,o=e._zod.def;a.type=`object`,a.properties={};let s=o.shape;for(let e in s)a.properties[e]=dl(s[e],t,{...r,path:[...r.path,`properties`,e]});let c=new Set(Object.keys(s)),l=new Set([...c].filter(e=>{let n=o.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));l.size>0&&(a.required=Array.from(l)),o.catchall?._zod.def.type===`never`?a.additionalProperties=!1:o.catchall?o.catchall&&(a.additionalProperties=dl(o.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(a.additionalProperties=!1)},jl=(e,t,n,r)=>{let a=e._zod.def,o=a.inclusive===!1,s=a.options.map((e,n)=>dl(e,t,{...r,path:[...r.path,o?`oneOf`:`anyOf`,n]}));o?n.oneOf=s:n.anyOf=s},Ml=(e,t,n,r)=>{let a=e._zod.def,o=dl(a.left,t,{...r,path:[...r.path,`allOf`,0]}),s=dl(a.right,t,{...r,path:[...r.path,`allOf`,1]}),c=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...c(o)?o.allOf:[o],...c(s)?s.allOf:[s]]},Nl=(e,t,n,r)=>{let a=n,o=e._zod.def;a.type=`array`;let s=t.target===`draft-2020-12`?`prefixItems`:`items`,c=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,l=o.items.map((e,n)=>dl(e,t,{...r,path:[...r.path,s,n]})),u=o.rest?dl(o.rest,t,{...r,path:[...r.path,c,...t.target===`openapi-3.0`?[o.items.length]:[]]}):null;t.target===`draft-2020-12`?(a.prefixItems=l,u&&(a.items=u)):t.target===`openapi-3.0`?(a.items={anyOf:l},u&&a.items.anyOf.push(u),a.minItems=l.length,u||(a.maxItems=l.length)):(a.items=l,u&&(a.additionalItems=u));let{minimum:d,maximum:f}=e._zod.bag;typeof d==`number`&&(a.minItems=d),typeof f==`number`&&(a.maxItems=f)},Pl=(e,t,n,r)=>{let a=n,o=e._zod.def;a.type=`object`;let s=o.keyType,c=s._zod.bag?.patterns;if(o.mode===`loose`&&c&&c.size>0){let e=dl(o.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});a.patternProperties={};for(let t of c)a.patternProperties[t.source]=e}else (t.target===`draft-07`||t.target===`draft-2020-12`)&&(a.propertyNames=dl(o.keyType,t,{...r,path:[...r.path,`propertyNames`]})),a.additionalProperties=dl(o.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let l=s._zod.values;if(l){let e=[...l].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(a.required=e)}},Fl=(e,t,n,r)=>{let a=e._zod.def,o=dl(a.innerType,t,r),s=t.seen.get(e);t.target===`openapi-3.0`?(s.ref=a.innerType,n.nullable=!0):n.anyOf=[o,{type:`null`}]},Il=(e,t,n,r)=>{let a=e._zod.def;dl(a.innerType,t,r);let o=t.seen.get(e);o.ref=a.innerType},Ll=(e,t,n,r)=>{let a=e._zod.def;dl(a.innerType,t,r);let o=t.seen.get(e);o.ref=a.innerType,n.default=JSON.parse(JSON.stringify(a.defaultValue))},Rl=(e,t,n,r)=>{let a=e._zod.def;dl(a.innerType,t,r);let o=t.seen.get(e);o.ref=a.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(a.defaultValue)))},zl=(e,t,n,r)=>{let a=e._zod.def;dl(a.innerType,t,r);let o=t.seen.get(e);o.ref=a.innerType;let s;try{s=a.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=s},Bl=(e,t,n,r)=>{let a=e._zod.def,o=a.in._zod.traits.has(`$ZodTransform`),s=t.io===`input`?o?a.out:a.in:a.out;dl(s,t,r);let c=t.seen.get(e);c.ref=s},Vl=(e,t,n,r)=>{let a=e._zod.def;dl(a.innerType,t,r);let o=t.seen.get(e);o.ref=a.innerType,n.readOnly=!0},Hl=(e,t,n,r)=>{let a=e._zod.def;dl(a.innerType,t,r);let o=t.seen.get(e);o.ref=a.innerType},Ul=(e,t,n,r)=>{let a=e._zod.innerType;dl(a,t,r);let o=t.seen.get(e);o.ref=a},Wl=M(`ZodISODateTime`,(e,t)=>{Go.init(e,t),gu.init(e,t)});function Gl(e){return Ec(Wl,e)}var Kl=M(`ZodISODate`,(e,t)=>{Ko.init(e,t),gu.init(e,t)});function ql(e){return Dc(Kl,e)}var Jl=M(`ZodISOTime`,(e,t)=>{qo.init(e,t),gu.init(e,t)});function Yl(e){return Oc(Jl,e)}var Xl=M(`ZodISODuration`,(e,t)=>{Jo.init(e,t),gu.init(e,t)});function Zl(e){return kc(Xl,e)}var Ql=M(`ZodError`,(e,t)=>{ha.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>va(e,t)},flatten:{value:t=>_a(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Pi,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Pi,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),$l=ya(Ql),eu=ba(Ql),tu=xa(Ql),nu=Ca(Ql),ru=Ta(Ql),iu=Ea(Ql),au=Da(Ql),ou=Oa(Ql),su=ka(Ql),cu=Aa(Ql),lu=ja(Ql),uu=Ma(Ql),du=new WeakMap;function fu(e,t,n){let r=Object.getPrototypeOf(e),a=du.get(r);if(a||(a=new Set,du.set(r,a)),!a.has(t)){a.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var pu=M(`ZodType`,(e,t)=>(jo.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:gl(e,`input`),output:gl(e,`output`)}}),e.toJSONSchema=hl(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>$l(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>tu(e,t,n),e.parseAsync=async(t,n)=>eu(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>nu(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>ru(e,t,n),e.decode=(t,n)=>iu(e,t,n),e.encodeAsync=async(t,n)=>au(e,t,n),e.decodeAsync=async(t,n)=>ou(e,t,n),e.safeEncode=(t,n)=>su(e,t,n),e.safeDecode=(t,n)=>cu(e,t,n),e.safeEncodeAsync=async(t,n)=>lu(e,t,n),e.safeDecodeAsync=async(t,n)=>uu(e,t,n),fu(e,`ZodType`,{check(...e){let t=this.def;return this.clone(Vi(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Zi(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Fd(e,t))},superRefine(e,t){return this.check(Id(e,t))},overwrite(e){return this.check($c(e))},optional(){return md(this)},exactOptional(){return gd(this)},nullable(){return vd(this)},nullish(){return md(vd(this))},nonoptional(e){return wd(this,e)},array(){return B(this)},or(e){return H([this,e])},and(e){return id(this,e)},transform(e){return Od(this,fd(e))},default(e){return bd(this,e)},prefault(e){return Sd(this,e)},catch(e){return Ed(this,e)},pipe(e){return Od(this,e)},readonly(){return Ad(this)},describe(e){let t=this.clone();return nc.add(t,{description:e}),t},meta(...e){if(e.length===0)return nc.get(this);let t=this.clone();return nc.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return nc.get(e)?.description},configurable:!0}),e)),mu=M(`_ZodString`,(e,t)=>{Mo.init(e,t),pu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vl(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,fu(e,`_ZodString`,{regex(...e){return this.check(qc(...e))},includes(...e){return this.check(Xc(...e))},startsWith(...e){return this.check(Zc(...e))},endsWith(...e){return this.check(Qc(...e))},min(...e){return this.check(Gc(...e))},max(...e){return this.check(Wc(...e))},length(...e){return this.check(Kc(...e))},nonempty(...e){return this.check(Gc(1,...e))},lowercase(e){return this.check(Jc(e))},uppercase(e){return this.check(Yc(e))},trim(){return this.check(tl())},normalize(...e){return this.check(el(...e))},toLowerCase(){return this.check(nl())},toUpperCase(){return this.check(rl())},slugify(){return this.check(il())}})}),hu=M(`ZodString`,(e,t)=>{Mo.init(e,t),mu.init(e,t),e.email=t=>e.check(ic(_u,t)),e.url=t=>e.check(uc(xu,t)),e.jwt=t=>e.check(Tc(Lu,t)),e.emoji=t=>e.check(dc(Cu,t)),e.guid=t=>e.check(ac(yu,t)),e.uuid=t=>e.check(oc(bu,t)),e.uuidv4=t=>e.check(sc(bu,t)),e.uuidv6=t=>e.check(cc(bu,t)),e.uuidv7=t=>e.check(lc(bu,t)),e.nanoid=t=>e.check(fc(wu,t)),e.guid=t=>e.check(ac(yu,t)),e.cuid=t=>e.check(pc(Tu,t)),e.cuid2=t=>e.check(mc(Eu,t)),e.ulid=t=>e.check(hc(Du,t)),e.base64=t=>e.check(Sc(Pu,t)),e.base64url=t=>e.check(Cc(Fu,t)),e.xid=t=>e.check(gc(Ou,t)),e.ksuid=t=>e.check(_c(ku,t)),e.ipv4=t=>e.check(vc(Au,t)),e.ipv6=t=>e.check(yc(ju,t)),e.cidrv4=t=>e.check(bc(Mu,t)),e.cidrv6=t=>e.check(xc(Nu,t)),e.e164=t=>e.check(wc(Iu,t)),e.datetime=t=>e.check(Gl(t)),e.date=t=>e.check(ql(t)),e.time=t=>e.check(Yl(t)),e.duration=t=>e.check(Zl(t))});function F(e){return rc(hu,e)}var gu=M(`ZodStringFormat`,(e,t)=>{No.init(e,t),mu.init(e,t)}),_u=M(`ZodEmail`,(e,t)=>{Io.init(e,t),gu.init(e,t)});function vu(e){return ic(_u,e)}var yu=M(`ZodGUID`,(e,t)=>{Po.init(e,t),gu.init(e,t)}),bu=M(`ZodUUID`,(e,t)=>{Fo.init(e,t),gu.init(e,t)}),xu=M(`ZodURL`,(e,t)=>{Lo.init(e,t),gu.init(e,t)});function Su(e){return uc(xu,e)}var Cu=M(`ZodEmoji`,(e,t)=>{Ro.init(e,t),gu.init(e,t)}),wu=M(`ZodNanoID`,(e,t)=>{zo.init(e,t),gu.init(e,t)}),Tu=M(`ZodCUID`,(e,t)=>{Bo.init(e,t),gu.init(e,t)}),Eu=M(`ZodCUID2`,(e,t)=>{Vo.init(e,t),gu.init(e,t)}),Du=M(`ZodULID`,(e,t)=>{Ho.init(e,t),gu.init(e,t)}),Ou=M(`ZodXID`,(e,t)=>{Uo.init(e,t),gu.init(e,t)}),ku=M(`ZodKSUID`,(e,t)=>{Wo.init(e,t),gu.init(e,t)}),Au=M(`ZodIPv4`,(e,t)=>{Yo.init(e,t),gu.init(e,t)}),ju=M(`ZodIPv6`,(e,t)=>{Xo.init(e,t),gu.init(e,t)}),Mu=M(`ZodCIDRv4`,(e,t)=>{Zo.init(e,t),gu.init(e,t)}),Nu=M(`ZodCIDRv6`,(e,t)=>{Qo.init(e,t),gu.init(e,t)}),Pu=M(`ZodBase64`,(e,t)=>{es.init(e,t),gu.init(e,t)}),Fu=M(`ZodBase64URL`,(e,t)=>{ns.init(e,t),gu.init(e,t)}),Iu=M(`ZodE164`,(e,t)=>{rs.init(e,t),gu.init(e,t)}),Lu=M(`ZodJWT`,(e,t)=>{as.init(e,t),gu.init(e,t)}),Ru=M(`ZodNumber`,(e,t)=>{os.init(e,t),pu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yl(e,t,n,r),fu(e,`ZodNumber`,{gt(e,t){return this.check(Vc(e,t))},gte(e,t){return this.check(Hc(e,t))},min(e,t){return this.check(Hc(e,t))},lt(e,t){return this.check(zc(e,t))},lte(e,t){return this.check(Bc(e,t))},max(e,t){return this.check(Bc(e,t))},int(e){return this.check(Bu(e))},safe(e){return this.check(Bu(e))},positive(e){return this.check(Vc(0,e))},nonnegative(e){return this.check(Hc(0,e))},negative(e){return this.check(zc(0,e))},nonpositive(e){return this.check(Bc(0,e))},multipleOf(e,t){return this.check(Uc(e,t))},step(e,t){return this.check(Uc(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function I(e){return Ac(Ru,e)}var zu=M(`ZodNumberFormat`,(e,t)=>{ss.init(e,t),Ru.init(e,t)});function Bu(e){return jc(zu,e)}var Vu=M(`ZodBoolean`,(e,t)=>{cs.init(e,t),pu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bl(e,t,n,r)});function L(e){return Mc(Vu,e)}var Hu=M(`ZodNull`,(e,t)=>{ls.init(e,t),pu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xl(e,t,n,r)});function Uu(e){return Nc(Hu,e)}var Wu=M(`ZodAny`,(e,t)=>{us.init(e,t),pu.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Gu(){return Pc(Wu)}var Ku=M(`ZodUnknown`,(e,t)=>{ds.init(e,t),pu.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function R(){return Fc(Ku)}var qu=M(`ZodNever`,(e,t)=>{fs.init(e,t),pu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Cl(e,t,n,r)});function Ju(e){return Ic(qu,e)}var Yu=M(`ZodVoid`,(e,t)=>{ps.init(e,t),pu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Sl(e,t,n,r)});function z(e){return Lc(Yu,e)}var Xu=M(`ZodDate`,(e,t)=>{ms.init(e,t),pu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wl(e,t,n,r),e.min=(t,n)=>e.check(Hc(t,n)),e.max=(t,n)=>e.check(Bc(t,n));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function Zu(e){return Rc(Xu,e)}var Qu=M(`ZodArray`,(e,t)=>{gs.init(e,t),pu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>kl(e,t,n,r),e.element=t.element,fu(e,`ZodArray`,{min(e,t){return this.check(Gc(e,t))},nonempty(e){return this.check(Gc(1,e))},max(e,t){return this.check(Wc(e,t))},length(e,t){return this.check(Kc(e,t))},unwrap(){return this.element}})});function B(e,t){return al(Qu,e,t)}var $u=M(`ZodObject`,(e,t)=>{xs.init(e,t),pu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Al(e,t,n,r),N(e,`shape`,()=>t.shape),fu(e,`ZodObject`,{keyof(){return W(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:R()})},loose(){return this.clone({...this._zod.def,catchall:R()})},strict(){return this.clone({...this._zod.def,catchall:Ju()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return na(this,e)},safeExtend(e){return ra(this,e)},merge(e){return ia(this,e)},pick(e){return ea(this,e)},omit(e){return ta(this,e)},partial(...e){return aa(pd,this,e[0])},required(...e){return oa(Cd,this,e[0])}})});function V(e,t){return new $u({type:`object`,shape:e??{},...P(t)})}var ed=M(`ZodUnion`,(e,t)=>{Cs.init(e,t),pu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jl(e,t,n,r),e.options=t.options});function H(e,t){return new ed({type:`union`,options:e,...P(t)})}var td=M(`ZodDiscriminatedUnion`,(e,t)=>{ed.init(e,t),ws.init(e,t)});function nd(e,t,n){return new td({type:`union`,options:t,discriminator:e,...P(n)})}var rd=M(`ZodIntersection`,(e,t)=>{Ts.init(e,t),pu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ml(e,t,n,r)});function id(e,t){return new rd({type:`intersection`,left:e,right:t})}var ad=M(`ZodTuple`,(e,t)=>{Os.init(e,t),pu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Nl(e,t,n,r),e.rest=t=>e.clone({...e._zod.def,rest:t})});function od(e,t,n){let r=t instanceof jo;return new ad({type:`tuple`,items:e,rest:r?t:null,...P(r?n:t)})}var sd=M(`ZodRecord`,(e,t)=>{Ms.init(e,t),pu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pl(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function U(e,t,n){return!t||!t._zod?new sd({type:`record`,keyType:F(),valueType:e,...P(t)}):new sd({type:`record`,keyType:e,valueType:t,...P(n)})}function cd(e,t,n){let r=Zi(e);return r._zod.values=void 0,new sd({type:`record`,keyType:r,valueType:t,...P(n)})}var ld=M(`ZodEnum`,(e,t)=>{Ns.init(e,t),pu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Tl(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let a={};for(let r of e)if(n.has(r))a[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new ld({...t,checks:[],...P(r),entries:a})},e.exclude=(e,r)=>{let a={...t.entries};for(let t of e)if(n.has(t))delete a[t];else throw Error(`Key ${t} not found in enum`);return new ld({...t,checks:[],...P(r),entries:a})}});function W(e,t){return new ld({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...P(t)})}var ud=M(`ZodLiteral`,(e,t)=>{Ps.init(e,t),pu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>El(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function G(e,t){return new ud({type:`literal`,values:Array.isArray(e)?e:[e],...P(t)})}var dd=M(`ZodTransform`,(e,t)=>{Fs.init(e,t),pu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ol(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Ai(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(pa(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(pa(t))}};let a=t.transform(n.value,n);return a instanceof Promise?a.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=a,n.fallback=!0,n)}});function fd(e){return new dd({type:`transform`,transform:e})}var pd=M(`ZodOptional`,(e,t)=>{Ls.init(e,t),pu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function md(e){return new pd({type:`optional`,innerType:e})}var hd=M(`ZodExactOptional`,(e,t)=>{Rs.init(e,t),pu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function gd(e){return new hd({type:`optional`,innerType:e})}var _d=M(`ZodNullable`,(e,t)=>{zs.init(e,t),pu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function vd(e){return new _d({type:`nullable`,innerType:e})}var yd=M(`ZodDefault`,(e,t)=>{Bs.init(e,t),pu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ll(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function bd(e,t){return new yd({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Ji(t)}})}var xd=M(`ZodPrefault`,(e,t)=>{Hs.init(e,t),pu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Rl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Sd(e,t){return new xd({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Ji(t)}})}var Cd=M(`ZodNonOptional`,(e,t)=>{Us.init(e,t),pu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Il(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function wd(e,t){return new Cd({type:`nonoptional`,innerType:e,...P(t)})}var Td=M(`ZodCatch`,(e,t)=>{Gs.init(e,t),pu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Ed(e,t){return new Td({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var Dd=M(`ZodPipe`,(e,t)=>{Ks.init(e,t),pu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bl(e,t,n,r),e.in=t.in,e.out=t.out});function Od(e,t){return new Dd({type:`pipe`,in:e,out:t})}var kd=M(`ZodReadonly`,(e,t)=>{Js.init(e,t),pu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ad(e){return new kd({type:`readonly`,innerType:e})}var jd=M(`ZodLazy`,(e,t)=>{Xs.init(e,t),pu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ul(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function Md(e){return new jd({type:`lazy`,getter:e})}var Nd=M(`ZodCustom`,(e,t)=>{Zs.init(e,t),pu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Dl(e,t,n,r)});function Pd(e,t){return ol(Nd,e??(()=>!0),t)}function Fd(e,t={}){return sl(Nd,e,t)}function Id(e,t){return cl(e,t)}function Ld(e,t={}){let n=new Nd({type:`custom`,check:`custom`,fn:t=>t instanceof e,abort:!0,...P(t)});return n._zod.bag.Class=e,n._zod.check=t=>{t.value instanceof e||t.issues.push({code:`invalid_type`,expected:e.name,input:t.value,inst:n,path:[...n._zod.def.path??[]]})},n}var Rd=function(e){return e.SystemBoot=`system.boot`,e.SystemAddonsReady=`system.addons-ready`,e.SystemRestarting=`system.restarting`,e.SystemRestartCompleted=`system.restart-completed`,e.SystemReadyState=`system.ready-state`,e.AddonStarted=`addon.started`,e.AddonStopped=`addon.stopped`,e.AddonRestarted=`addon.restarted`,e.AddonUpdated=`addon.updated`,e.AddonInstalled=`addon.installed`,e.AddonUninstalled=`addon.uninstalled`,e.AddonCrashed=`addon.crashed`,e.AddonError=`addon.error`,e.AddonPageReady=`addon.page-ready`,e.AddonWidgetReady=`addon.widget-ready`,e.AddonLoadFailed=`addon.load-failed`,e.AddonLoadRecovered=`addon.load-recovered`,e.AddonRetryScheduled=`addon.retry-scheduled`,e.AddonRetryAttempting=`addon.retry-attempting`,e.DeviceRegistered=`device.registered`,e.DeviceUnregistered=`device.unregistered`,e.DeviceEnabled=`device.enabled`,e.DeviceDisabled=`device.disabled`,e.DeviceSettingsUpdated=`device.settings-updated`,e.DeviceBindingsChanged=`device.bindings-changed`,e.DeviceMetaChanged=`device.meta-changed`,e.DeviceSourceInfoChanged=`device.source-info-changed`,e.DeviceStreamsRegistered=`device.streams-registered`,e.DeviceProvisioned=`device.provisioned`,e.DeviceReady=`device.ready`,e.IntegrationEnabled=`integration.enabled`,e.IntegrationDisabled=`integration.disabled`,e.IntegrationDeleted=`integration.deleted`,e.BrokerStatusChanged=`broker.status-changed`,e.BrokerMessage=`broker.message`,e.ProviderStarted=`provider.started`,e.ProviderStopped=`provider.stopped`,e.ProcessCrashed=`process.crashed`,e.ProcessRestartScheduled=`process.restart_scheduled`,e.ProcessRestarted=`process.restarted`,e.RecordingStarted=`recording.started`,e.RecordingStopped=`recording.stopped`,e.RecordingError=`recording.error`,e.RecordingHealthDegraded=`recording.health.degraded`,e.RecordingStorageCritical=`recording.storage.critical`,e.RecordingSegmentWritten=`recording.segment.written`,e.RecordingPolicyFallback=`recording.policy.fallback`,e.RecordingRetentionCompleted=`recording.retention.completed`,e.DetectionEvent=`detection.event`,e.SessionTrackNew=`session.track.new`,e.SessionTrackExpired=`session.track.expired`,e.BenchmarkProgress=`benchmark.progress`,e.PlatformProbePhase=`platform-probe.phase`,e.PipelineProgress=`pipeline.progress`,e.PipelineTrace=`pipeline.trace`,e.PipelineInferenceResult=`pipeline.inference-result`,e.PipelineCameraAssigned=`pipeline.camera-assigned`,e.PipelineCameraUnassigned=`pipeline.camera-unassigned`,e.PipelineCameraUpdated=`pipeline.camera-updated`,e.PipelineRunnerLoadSnapshot=`pipeline.runner-load-snapshot`,e.PipelineCameraMetricsSnapshot=`pipeline.camera-metrics-snapshot`,e.StreamBrokerMetricsSnapshot=`stream-broker.metrics-snapshot`,e.StreamBrokerOnCamStreamDemand=`stream-broker.onCamStreamDemand`,e.StreamBrokerOnCamStreamIdle=`stream-broker.onCamStreamIdle`,e.StreamBrokerOnRequestStreamSourceRefresh=`stream-broker.onRequestStreamSourceRefresh`,e.StreamParamsChanged=`stream-params.changed`,e.DeviceStateChanged=`device.state-changed`,e.BatteryOnStatusChanged=`battery.onStatusChanged`,e.BatteryOnWakeStarted=`battery.onWakeStarted`,e.DoorbellOnPressed=`doorbell.onPressed`,e.EventEmitted=`event-emitter.event`,e.PipelineEngineMetricsSnapshot=`pipeline.engine-metrics-snapshot`,e.PipelineEngineProvisioning=`pipeline.engine-provisioning`,e.ClusterTopologySnapshot=`cluster.topology-snapshot`,e.MetricsNodeResourcesSnapshot=`metrics.node-resources-snapshot`,e.MetricsNodeProcessesSnapshot=`metrics.node-processes-snapshot`,e.CapabilityBindingChanged=`capability.binding-changed`,e.ModelDownloadProgress=`model.download.progress`,e.AgentRegistered=`agent.registered`,e.AgentUnregistered=`agent.unregistered`,e.AgentOnline=`agent.online`,e.AgentOffline=`agent.offline`,e.WorkerOnline=`worker.online`,e.WorkerOffline=`worker.offline`,e.AgentTaskDispatched=`agent.task.dispatched`,e.AgentTaskAssigned=`agent.task.assigned`,e.AgentTrpcConnected=`agent.trpc.connected`,e.AgentWsConnected=`agent.ws.connected`,e.AgentWsDisconnected=`agent.ws.disconnected`,e.AgentBackupActivated=`agent.backup.activated`,e.OrchestrationSettingsUpdated=`orchestration.settings-updated`,e.PipelineAgentHwaccelChanged=`pipeline.agent-hwaccel-changed`,e.MotionAnalysis=`detection.motion-analysis`,e.MotionZonesRaw=`detection.motion-zones-raw`,e.MotionOnMotionChanged=`motion.on-motion-changed`,e.DetectionResult=`detection.result`,e.DetectionRaw=`detection.raw`,e.DetectionCameraNative=`detection.camera-native`,e.PipelineAudioInferenceResult=`pipeline.audio-inference-result`,e.DetectionPhaseTransition=`detection.phase-transition`,e.ProviderMotion=`provider.motion`,e.ProviderDetection=`provider.detection`,e.EnrichmentEmbeddingStored=`enrichment.embedding.stored`,e.EnrichmentSceneStateChanged=`enrichment.scene.state-changed`,e.EnrichmentActivitySummary=`enrichment.activity.summary`,e.PipelineAnalyticsTrackStarted=`pipeline-analytics.track-started`,e.PipelineAnalyticsTrackEnded=`pipeline-analytics.track-ended`,e.PipelineAnalyticsDetectionEvent=`pipeline-analytics.detection-event`,e.PipelineAnalyticsFrameTracked=`pipeline-analytics.frame-tracked`,e.FrigateLiveEvent=`frigate.live-event`,e.CameraStreamsProfileSlotsChanged=`camera-streams.onProfileSlotsChanged`,e.StreamOnline=`stream.online`,e.StreamOffline=`stream.offline`,e.NetworkTunnelStarted=`network.tunnel.started`,e.NetworkTunnelStopped=`network.tunnel.stopped`,e.LocalNetworkChanged=`network.local.changed`,e.MeshNetworkChanged=`network.mesh.changed`,e.BackupCompleted=`backup.completed`,e.BackupRestored=`backup.restored`,e.NotificationDispatched=`notification.dispatched`,e.NotificationFailed=`notification.failed`,e.DeviceUpdated=`device.updated`,e.DeviceOnline=`device.online`,e.DeviceOffline=`device.offline`,e.DeviceAwake=`device.awake`,e.DeviceSleeping=`device.sleeping`,e.RetentionCleanup=`retention.cleanup`,e.AddonsBulkUpdateProgress=`addons.bulk-update-progress`,e.AddonsJobProgress=`addons.job-progress`,e.AddonsJobLog=`addons.job-log`,e.AccessoriesChildVisibilityChanged=`accessories.onChildVisibilityChanged`,e.AccessoriesChanged=`accessories.onAccessoriesChanged`,e}({});Object.fromEntries([{id:`overview`,label:`Overview`,icon:`layout-dashboard`,order:-10},{id:`general`,label:`General`,icon:`settings`,order:0},{id:`image`,label:`Image`,icon:`image`,order:5},{id:`light`,label:`Light`,icon:`lightbulb`,order:7},{id:`motion`,label:`Motion`,icon:`activity`,order:10},{id:`audio`,label:`Audio`,icon:`mic`,order:12},{id:`alarms`,label:`Alarms`,icon:`bell-ring`,order:13},{id:`snapshot`,label:`Snapshot`,icon:`camera`,order:15},{id:`osd`,label:`OSD`,icon:`type`,order:18},{id:`stream-broker`,label:`Stream Broker`,icon:`radio`,order:20},{id:`streaming`,label:`Streaming`,icon:`video`,order:35},{id:`ptz`,label:`PTZ`,icon:`move`,order:40},{id:`consumables`,label:`Consumables`,icon:`recycle`,order:44},{id:`pipeline`,label:`Detection Pipeline`,icon:`cpu`,order:39},{id:`detection-pipeline`,label:`Detection pipeline`,icon:`cpu`,order:39},{id:`zones`,label:`Detection`,icon:`shapes`,order:38},{id:`analytics`,label:`Analytics`,icon:`activity`,order:37},{id:`live-stats`,label:`Live Stats`,icon:`activity`,order:39},{id:`recording`,label:`Recording`,icon:`circle-dot`,order:40},{id:`engine`,label:`Inference Engine`,icon:`zap`,order:41},{id:`scheduler`,label:`Scheduler`,icon:`list-checks`,order:42},{id:`decoder`,label:`Decoder`,icon:`film`,order:43},{id:`notifications`,label:`Notifications`,icon:`bell`,order:50},{id:`network`,label:`Network`,icon:`globe`,order:60},{id:`storage`,label:`Storage`,icon:`hard-drive`,order:70},{id:`advanced`,label:`Advanced`,icon:`wrench`,order:100}].map(e=>[e.id,e]));var zd=W([`high`,`mid`,`low`]),Bd=W([`pull-rtsp`,`pull-rtmp`,`pull-http`,`pull-rfc4571`,`push-annexb`,`derived`]),Vd=V({width:I().int().positive(),height:I().int().positive()}),Hd=V({camStreamId:F().min(1),deviceId:I().int().nonnegative(),kind:Bd,url:F().optional(),codec:F().optional(),resolution:Vd.optional(),fps:I().positive().optional(),label:F().optional(),deviceFeatures:B(F()).optional(),autoEligible:L().optional(),metadata:U(F(),R()).optional()}),Ud=W([`unassigned`,`idle`,`connecting`,`streaming`,`error`]),Wd=V({deviceId:I().int().nonnegative(),profile:zd,brokerId:F(),sourceCamStreamId:F().nullable(),status:Ud,resolution:Vd.optional(),codec:F().optional(),preBufferSec:I().nonnegative().optional(),errorMessage:F().optional()}),Gd=V({id:F(),label:F(),protocol:W([`rtsp`,`rtmp`,`annexb`,`http-mjpeg`,`webrtc`,`custom`]),url:F().optional(),resolution:V({width:I(),height:I()}).readonly().optional(),fps:I().optional(),bitrate:I().optional(),codec:F().optional(),profileHint:zd.optional()});V({type:F(),url:F(),videoCodec:F().optional(),audioCodec:F().optional(),metadata:U(F(),R()).readonly().optional()});var Kd=V({type:W([`video`,`audio`]),data:Ld(Uint8Array),pts:I(),dts:I(),keyframe:L(),codec:F()}),qd=V({data:Ld(Uint8Array),width:I(),height:I(),format:W([`jpeg`,`rgb`,`bgr`,`yuv420`,`gray`]),timestamp:I()}),Jd=V({shmId:F(),slot:I().int().nonnegative(),seq:I().int().nonnegative(),width:I().int().positive(),height:I().int().positive(),format:W([`jpeg`,`rgb`,`bgr`,`yuv420`,`gray`]),pts:I(),byteLength:I().int().nonnegative(),nodeId:F(),slotCount:I().int().positive()}),Yd=W([`rgb`,`bgr`,`yuv420`,`gray`]),Xd=V({brokerId:F(),format:Yd,maxFps:I().positive().optional(),tag:F().optional()}),Zd=V({subscriptionId:F(),maxFps:I().nonnegative()}),Qd=V({data:Ld(Uint8Array),sampleRate:I().int().positive(),channels:I().int().positive(),timestamp:I()}),$d=V({brokerId:F(),tag:F().optional()}),ef=V({subscriptionId:F()}),tf=V({status:W([`idle`,`connecting`,`streaming`,`error`,`stopped`]),inputFps:I(),decodeFps:I(),encodedSubscribers:I(),decodedSubscribers:I(),uptimeMs:I(),bitrateKbps:I(),idrIntervalMs:I(),codec:F().optional(),totalBytes:I(),packetCount:I(),rtspClients:I(),pipeClients:I(),preBufferSec:I(),preBufferMs:I(),preBufferPackets:I(),decoderNodeId:F().nullable(),audio:V({codec:F(),sampleRate:I(),channels:I(),supported:L()}).nullable().optional()}),nf=V({profile:zd,brokerId:F(),url:F(),mutedUrl:F(),enabled:L(),codec:F().optional(),resolution:Vd.optional()}),K=function(e){return e.Camera=`camera`,e.Hub=`hub`,e.Light=`light`,e.Siren=`siren`,e.Switch=`switch`,e.Sensor=`sensor`,e.Thermostat=`thermostat`,e.Button=`button`,e.EventEmitter=`event-emitter`,e.Update=`update`,e.Generic=`generic`,e.Notifier=`notifier`,e.Script=`script`,e.Automation=`automation`,e.Lock=`lock`,e.Cover=`cover`,e.Valve=`valve`,e.Humidifier=`humidifier`,e.WaterHeater=`water-heater`,e.Fan=`fan`,e.MediaPlayer=`media-player`,e.AlarmPanel=`alarm-panel`,e.Control=`control`,e.Presence=`presence`,e.Weather=`weather`,e.Vacuum=`vacuum`,e.LawnMower=`lawn-mower`,e.Container=`container`,e.Image=`image`,e}({}),rf=function(e){return e.BatteryOperated=`battery-operated`,e.Rebootable=`rebootable`,e.Resyncable=`resyncable`,e.NativeSnapshot=`native-snapshot`,e.DoorbellButton=`doorbell-button`,e.TwoWayAudio=`two-way-audio`,e.PanTiltZoom=`pan-tilt-zoom`,e.PtzAutotrack=`ptz-autotrack`,e.MotionTrigger=`motion-trigger`,e.LightColorRgb=`light-color-rgb`,e.LightColorHsv=`light-color-hsv`,e.LightColorMired=`light-color-mired`,e.ClimateDualSetpoint=`climate-dual-setpoint`,e.ClimateHumidity=`climate-humidity`,e.ClimateFanMode=`climate-fan-mode`,e.ClimatePreset=`climate-preset`,e.CoverPositionable=`cover-positionable`,e.CoverTilt=`cover-tilt`,e.ValvePositionable=`valve-positionable`,e.FanSpeed=`fan-speed`,e.FanPreset=`fan-preset`,e.FanDirection=`fan-direction`,e.FanOscillating=`fan-oscillating`,e.LockPinRequired=`lock-pin-required`,e.LockOpen=`lock-open`,e.MediaPlayerSeek=`media-player-seek`,e.MediaPlayerVolume=`media-player-volume`,e.MediaPlayerMute=`media-player-mute`,e.MediaPlayerShuffle=`media-player-shuffle`,e.MediaPlayerRepeat=`media-player-repeat`,e.MediaPlayerSelectSource=`media-player-select-source`,e.MediaPlayerPlayMedia=`media-player-play-media`,e.MediaPlayerNext=`media-player-next`,e.MediaPlayerPrevious=`media-player-previous`,e.MediaPlayerStop=`media-player-stop`,e.AlarmPinRequired=`alarm-pin-required`,e.PresenceGps=`presence-gps`,e.NotifierImage=`notifier-image`,e.NotifierPriority=`notifier-priority`,e.NotifierData=`notifier-data`,e.NotifierActions=`notifier-actions`,e.NotifierRecipients=`notifier-recipients`,e.ScriptVariables=`script-variables`,e.AutomationSkipCondition=`automation-skip-condition`,e}({}),q=function(e){return e.Siren=`siren`,e.Floodlight=`floodlight`,e.Spotlight=`spotlight`,e.PirSensor=`pir-sensor`,e.Chime=`chime`,e.Autotrack=`autotrack`,e.Nightvision=`nightvision`,e.PrivacyMask=`privacy-mask`,e.Doorbell=`doorbell`,e.BinaryHelper=`binary-helper`,e.MotionSensor=`motion-sensor`,e.ContactSensor=`contact-sensor`,e.LeakSensor=`leak-sensor`,e.SmokeSensor=`smoke-sensor`,e.COSensor=`co-sensor`,e.GasSensor=`gas-sensor`,e.TamperSensor=`tamper-sensor`,e.VibrationSensor=`vibration-sensor`,e.ConnectivitySensor=`connectivity-sensor`,e.SoundSensor=`sound-sensor`,e.BinarySensor=`binary-sensor`,e.TemperatureSensor=`temperature-sensor`,e.HumiditySensor=`humidity-sensor`,e.AmbientLightSensor=`ambient-light-sensor`,e.PressureSensor=`pressure-sensor`,e.PowerSensor=`power-sensor`,e.EnergySensor=`energy-sensor`,e.VoltageSensor=`voltage-sensor`,e.CurrentSensor=`current-sensor`,e.AirQualitySensor=`air-quality-sensor`,e.BatterySensor=`battery-sensor`,e.NumericSensor=`numeric-sensor`,e.EnumSensor=`enum-sensor`,e.DateTimeSensor=`datetime-sensor`,e.GenericSensor=`generic-sensor`,e.NumericControl=`numeric-control`,e.SelectControl=`select-control`,e.TextControl=`text-control`,e.DateTimeControl=`datetime-control`,e.MobilePushNotifier=`mobile-push-notifier`,e.MessagingNotifier=`messaging-notifier`,e.EmailNotifier=`email-notifier`,e.GenericNotifier=`generic-notifier`,e}({}),af=V({id:F(),title:F(),description:F().optional(),style:W([`card`,`accordion`]).optional(),defaultCollapsed:L().optional(),columns:H([G(1),G(2),G(3),G(4)]).optional(),tab:F().optional(),location:W([`settings`,`top-tab`]).optional(),order:I().optional(),fields:B(Gu())});V({tabs:B(V({id:F(),label:F(),icon:F(),order:I().optional()})).optional(),sections:B(af)}).nullable(),V({deviceId:I()}),V({deviceId:I()}),V({deviceId:I(),patch:U(F(),R())}),V({success:G(!0)}),V({deviceId:I()}),R().nullable();function J(e,t,n){return{input:e,output:t,kind:n?.kind??`query`,auth:n?.auth??`protected`,...n?.access===void 0?{}:{access:n.access},timeoutMs:n?.timeoutMs}}function of(e){return{data:e}}var sf=`device.state-changed`;function cf(e){let t=new Map,n=new Map,r=null,a=(e,t)=>`${e}:${t}`,o=()=>{r||e.live?.onEvent&&(r=e.live.onEvent.subscribe({category:sf},{onData:e=>{let r=e.data;if(!r||typeof r.deviceId!=`number`||typeof r.capName!=`string`)return;let o=a(r.deviceId,r.capName);t.set(o,r.slice);let s=n.get(o);if(s)for(let e of s)try{e(r.slice)}catch{}}}))},s=()=>{r&&(n.size>0||(r.unsubscribe(),r=null))};return{read(e,n){return t.get(a(e,n))},async refresh(r,o){let s=await e.deviceState.getCapSlice.query({deviceId:r,capName:o}),c=a(r,o);t.set(c,s??void 0);let l=n.get(c);if(l)for(let e of l)try{e(s??void 0)}catch{}},watch(e,t,r){let c=a(e,t),l=n.get(c);return l||(l=new Set,n.set(c,l)),l.add(r),o(),()=>{l.delete(r),l.size===0&&n.delete(c),s()}},async write(t,n,r){await e.deviceState.setCapSlice.mutate({deviceId:t,capName:n,slice:r})}}}function lf(e,t,n){let r=(e,t)=>`${e}:${t}`;return{read(t,n){return e.get(t)?.get(n)},async refresh(){},watch(e,n,a){let o=r(e,n),s=t.get(o);return s||(s=new Set,t.set(o,s)),s.add(a),()=>{s.delete(a),s.size===0&&t.delete(o)}},async write(e,t,r){if(!n)throw Error(`createMirrorSource: write requires an api reference — pass it as the third argument when constructing the source`);await n.deviceState.setCapSlice.mutate({deviceId:e,capName:t,slice:r})}}}function Y(e,t,n){let r=uf(e)?e:cf(e);return{get value(){return r.read(t,n)},refresh(){return r.refresh(t,n)},subscribe(e){let a=r.watch(t,n,t=>{try{e(t)}catch{}});try{e(r.read(t,n))}catch{}return r.read(t,n)===void 0&&r.refresh(t,n).catch(()=>void 0),a},async set(e){await r.write(t,n,e)},async patch(e){let a={...r.read(t,n),...e};await r.write(t,n,a)}}}function uf(e){return typeof e.read==`function`&&typeof e.watch==`function`}function df(e,t,n){let r=e,a=n?.stateSource??cf(e);function o(e,n){let r=typeof e==`object`&&e?e:{};return n===void 0?{...r,deviceId:t.deviceId}:{...r,deviceId:t.deviceId,nodeId:n}}function s(e,t,n,a,o){let s=r[e]?.[t];if(!s)throw Error(`DeviceProxy: api has no '${e}.${t}'`);let c=s;return n===`mutation`?c.mutate(a):n===`subscription`?c.subscribe(a,o):c.query(a)}function c(e,n,r,a,c,l){return s(n,r,a,o(c,t.entries.find(t=>t.capName===e)?.providerNodeId),l)}function l(e,t,n,r,a){return s(e,t,n,o(r,void 0),a)}return{deviceId:t.deviceId,binding:t,state:{airQualitySensor:Y(a,t.deviceId,`air-quality-sensor`),alarmPanel:Y(a,t.deviceId,`alarm-panel`),ambientLightSensor:Y(a,t.deviceId,`ambient-light-sensor`),audioMetrics:Y(a,t.deviceId,`audio-metrics`),automationControl:Y(a,t.deviceId,`automation-control`),battery:Y(a,t.deviceId,`battery`),binary:Y(a,t.deviceId,`binary`),brightness:Y(a,t.deviceId,`brightness`),cameraStreams:Y(a,t.deviceId,`camera-streams`),carbonMonoxide:Y(a,t.deviceId,`carbon-monoxide`),climateControl:Y(a,t.deviceId,`climate-control`),color:Y(a,t.deviceId,`color`),connectivity:Y(a,t.deviceId,`connectivity`),consumables:Y(a,t.deviceId,`consumables`),contact:Y(a,t.deviceId,`contact`),control:Y(a,t.deviceId,`control`),cover:Y(a,t.deviceId,`cover`),deviceDiscovery:Y(a,t.deviceId,`device-discovery`),deviceStatus:Y(a,t.deviceId,`device-status`),doorbell:Y(a,t.deviceId,`doorbell`),enumSensor:Y(a,t.deviceId,`enum-sensor`),eventEmitter:Y(a,t.deviceId,`event-emitter`),fanControl:Y(a,t.deviceId,`fan-control`),featureProbe:Y(a,t.deviceId,`feature-probe`),flood:Y(a,t.deviceId,`flood`),gas:Y(a,t.deviceId,`gas`),humidifier:Y(a,t.deviceId,`humidifier`),humiditySensor:Y(a,t.deviceId,`humidity-sensor`),image:Y(a,t.deviceId,`image`),lawnMowerControl:Y(a,t.deviceId,`lawn-mower-control`),lockControl:Y(a,t.deviceId,`lock-control`),mediaPlayer:Y(a,t.deviceId,`media-player`),motion:Y(a,t.deviceId,`motion`),motionTrigger:Y(a,t.deviceId,`motion-trigger`),motionZones:Y(a,t.deviceId,`motion-zones`),nativeObjectDetection:Y(a,t.deviceId,`native-object-detection`),notifier:Y(a,t.deviceId,`notifier`),numericSensor:Y(a,t.deviceId,`numeric-sensor`),powerMeter:Y(a,t.deviceId,`power-meter`),presence:Y(a,t.deviceId,`presence`),pressureSensor:Y(a,t.deviceId,`pressure-sensor`),privacyMask:Y(a,t.deviceId,`privacy-mask`),ptzAutotrack:Y(a,t.deviceId,`ptz-autotrack`),scriptRunner:Y(a,t.deviceId,`script-runner`),smoke:Y(a,t.deviceId,`smoke`),streamParams:Y(a,t.deviceId,`stream-params`),switch:Y(a,t.deviceId,`switch`),tamper:Y(a,t.deviceId,`tamper`),temperatureSensor:Y(a,t.deviceId,`temperature-sensor`),update:Y(a,t.deviceId,`update`),vacuumControl:Y(a,t.deviceId,`vacuum-control`),valve:Y(a,t.deviceId,`valve`),vibration:Y(a,t.deviceId,`vibration`),waterHeater:Y(a,t.deviceId,`water-heater`),weather:Y(a,t.deviceId,`weather`),zoneAnalytics:Y(a,t.deviceId,`zone-analytics`),zoneRules:Y(a,t.deviceId,`zone-rules`),zones:Y(a,t.deviceId,`zones`)},accessories:{setChildHidden:e=>c(`accessories`,`accessories`,`setChildHidden`,`mutation`,e),getStatus:e=>c(`accessories`,`accessories`,`getStatus`,`query`,e)},airQualitySensor:{getStatus:e=>c(`air-quality-sensor`,`airQualitySensor`,`getStatus`,`query`,e)},alarmPanel:{arm:e=>c(`alarm-panel`,`alarmPanel`,`arm`,`mutation`,e),disarm:e=>c(`alarm-panel`,`alarmPanel`,`disarm`,`mutation`,e),trigger:e=>c(`alarm-panel`,`alarmPanel`,`trigger`,`mutation`,e),getStatus:e=>c(`alarm-panel`,`alarmPanel`,`getStatus`,`query`,e)},ambientLightSensor:{getStatus:e=>c(`ambient-light-sensor`,`ambientLightSensor`,`getStatus`,`query`,e)},audioAnalysis:{resolveDeviceSettings:e=>c(`audio-analysis`,`audioAnalysis`,`resolveDeviceSettings`,`query`,e),getDeviceSettingsContribution:e=>c(`audio-analysis`,`audioAnalysis`,`getDeviceSettingsContribution`,`query`,e),getDeviceLiveContribution:e=>c(`audio-analysis`,`audioAnalysis`,`getDeviceLiveContribution`,`query`,e),applyDeviceSettingsPatch:e=>c(`audio-analysis`,`audioAnalysis`,`applyDeviceSettingsPatch`,`mutation`,e)},audioMetrics:{getCurrentSnapshot:e=>c(`audio-metrics`,`audioMetrics`,`getCurrentSnapshot`,`query`,e),getHistory:e=>c(`audio-metrics`,`audioMetrics`,`getHistory`,`query`,e)},automationControl:{enable:e=>c(`automation-control`,`automationControl`,`enable`,`mutation`,e),disable:e=>c(`automation-control`,`automationControl`,`disable`,`mutation`,e),trigger:e=>c(`automation-control`,`automationControl`,`trigger`,`mutation`,e),getStatus:e=>c(`automation-control`,`automationControl`,`getStatus`,`query`,e)},battery:{wakeForStream:e=>c(`battery`,`battery`,`wakeForStream`,`mutation`,e),getStatus:e=>c(`battery`,`battery`,`getStatus`,`query`,e)},binary:{getStatus:e=>c(`binary`,`binary`,`getStatus`,`query`,e)},brightness:{setBrightness:e=>c(`brightness`,`brightness`,`setBrightness`,`mutation`,e),getStatus:e=>c(`brightness`,`brightness`,`getStatus`,`query`,e)},button:{press:e=>c(`button`,`button`,`press`,`mutation`,e)},cameraCredentials:{getCredentials:e=>c(`camera-credentials`,`cameraCredentials`,`getCredentials`,`query`,e),getStatus:e=>c(`camera-credentials`,`cameraCredentials`,`getStatus`,`query`,e)},cameraStreams:{getCameraStreams:e=>c(`camera-streams`,`cameraStreams`,`getCameraStreams`,`query`,e),getBrokerStreams:e=>c(`camera-streams`,`cameraStreams`,`getBrokerStreams`,`query`,e),getRtspEntries:e=>c(`camera-streams`,`cameraStreams`,`getRtspEntries`,`query`,e),getProfileRtspEntries:e=>c(`camera-streams`,`cameraStreams`,`getProfileRtspEntries`,`query`,e),pickStream:e=>c(`camera-streams`,`cameraStreams`,`pickStream`,`query`,e)},carbonMonoxide:{getStatus:e=>c(`carbon-monoxide`,`carbonMonoxide`,`getStatus`,`query`,e)},climateControl:{setMode:e=>c(`climate-control`,`climateControl`,`setMode`,`mutation`,e),setFanMode:e=>c(`climate-control`,`climateControl`,`setFanMode`,`mutation`,e),setPreset:e=>c(`climate-control`,`climateControl`,`setPreset`,`mutation`,e),setTarget:e=>c(`climate-control`,`climateControl`,`setTarget`,`mutation`,e),setTargetRange:e=>c(`climate-control`,`climateControl`,`setTargetRange`,`mutation`,e),setTargetHumidity:e=>c(`climate-control`,`climateControl`,`setTargetHumidity`,`mutation`,e),getStatus:e=>c(`climate-control`,`climateControl`,`getStatus`,`query`,e)},color:{setColor:e=>c(`color`,`color`,`setColor`,`mutation`,e),getStatus:e=>c(`color`,`color`,`getStatus`,`query`,e)},connectivity:{getStatus:e=>c(`connectivity`,`connectivity`,`getStatus`,`query`,e)},consumables:{reset:e=>c(`consumables`,`consumables`,`reset`,`mutation`,e),getStatus:e=>c(`consumables`,`consumables`,`getStatus`,`query`,e)},contact:{getStatus:e=>c(`contact`,`contact`,`getStatus`,`query`,e)},control:{setValue:e=>c(`control`,`control`,`setValue`,`mutation`,e),getStatus:e=>c(`control`,`control`,`getStatus`,`query`,e)},cover:{open:e=>c(`cover`,`cover`,`open`,`mutation`,e),close:e=>c(`cover`,`cover`,`close`,`mutation`,e),stop:e=>c(`cover`,`cover`,`stop`,`mutation`,e),setPosition:e=>c(`cover`,`cover`,`setPosition`,`mutation`,e),setTiltPosition:e=>c(`cover`,`cover`,`setTiltPosition`,`mutation`,e),getStatus:e=>c(`cover`,`cover`,`getStatus`,`query`,e)},detectionPipeline:{getDeviceSettingsContribution:e=>c(`detection-pipeline`,`detectionPipeline`,`getDeviceSettingsContribution`,`query`,e),getDeviceLiveContribution:e=>c(`detection-pipeline`,`detectionPipeline`,`getDeviceLiveContribution`,`query`,e),applyDeviceSettingsPatch:e=>c(`detection-pipeline`,`detectionPipeline`,`applyDeviceSettingsPatch`,`mutation`,e)},deviceDiscovery:{listDiscovered:e=>c(`device-discovery`,`deviceDiscovery`,`listDiscovered`,`query`,e),refreshDiscovery:e=>c(`device-discovery`,`deviceDiscovery`,`refreshDiscovery`,`mutation`,e),adoptDevice:e=>c(`device-discovery`,`deviceDiscovery`,`adoptDevice`,`mutation`,e),releaseDevice:e=>c(`device-discovery`,`deviceDiscovery`,`releaseDevice`,`mutation`,e),getStatus:e=>c(`device-discovery`,`deviceDiscovery`,`getStatus`,`query`,e)},deviceOps:{getStreamSources:e=>c(`device-ops`,`deviceOps`,`getStreamSources`,`query`,e),getConfigEntries:e=>c(`device-ops`,`deviceOps`,`getConfigEntries`,`query`,e),setConfig:e=>c(`device-ops`,`deviceOps`,`setConfig`,`mutation`,e),runAction:e=>c(`device-ops`,`deviceOps`,`runAction`,`mutation`,e),removeDevice:e=>c(`device-ops`,`deviceOps`,`removeDevice`,`mutation`,e),getSettingsSchema:e=>c(`device-ops`,`deviceOps`,`getSettingsSchema`,`query`,e),getRawState:e=>c(`device-ops`,`deviceOps`,`getRawState`,`query`,e)},deviceStatus:{getStatus:e=>c(`device-status`,`deviceStatus`,`getStatus`,`query`,e)},doorbell:{getStatus:e=>c(`doorbell`,`doorbell`,`getStatus`,`query`,e)},enumSensor:{getStatus:e=>c(`enum-sensor`,`enumSensor`,`getStatus`,`query`,e)},eventEmitter:{getStatus:e=>c(`event-emitter`,`eventEmitter`,`getStatus`,`query`,e)},events:{getEvents:e=>c(`events`,`events`,`getEvents`,`query`,e),getEventThumbnail:e=>c(`events`,`events`,`getEventThumbnail`,`query`,e),getEventClipUrl:e=>c(`events`,`events`,`getEventClipUrl`,`query`,e)},fanControl:{setPercentage:e=>c(`fan-control`,`fanControl`,`setPercentage`,`mutation`,e),setPreset:e=>c(`fan-control`,`fanControl`,`setPreset`,`mutation`,e),setDirection:e=>c(`fan-control`,`fanControl`,`setDirection`,`mutation`,e),setOscillating:e=>c(`fan-control`,`fanControl`,`setOscillating`,`mutation`,e),getStatus:e=>c(`fan-control`,`fanControl`,`getStatus`,`query`,e)},featureProbe:{getStatus:e=>c(`feature-probe`,`featureProbe`,`getStatus`,`query`,e)},flood:{getStatus:e=>c(`flood`,`flood`,`getStatus`,`query`,e)},gas:{getStatus:e=>c(`gas`,`gas`,`getStatus`,`query`,e)},humidifier:{setOn:e=>c(`humidifier`,`humidifier`,`setOn`,`mutation`,e),setTargetHumidity:e=>c(`humidifier`,`humidifier`,`setTargetHumidity`,`mutation`,e),setMode:e=>c(`humidifier`,`humidifier`,`setMode`,`mutation`,e),getStatus:e=>c(`humidifier`,`humidifier`,`getStatus`,`query`,e)},humiditySensor:{getStatus:e=>c(`humidity-sensor`,`humiditySensor`,`getStatus`,`query`,e)},image:{getStatus:e=>c(`image`,`image`,`getStatus`,`query`,e)},intercom:{startSession:e=>c(`intercom`,`intercom`,`startSession`,`mutation`,e),handleAnswer:e=>c(`intercom`,`intercom`,`handleAnswer`,`mutation`,e),stopSession:e=>c(`intercom`,`intercom`,`stopSession`,`mutation`,e),startTalkSession:e=>c(`intercom`,`intercom`,`startTalkSession`,`mutation`,e),pushTalkAudio:e=>c(`intercom`,`intercom`,`pushTalkAudio`,`mutation`,e),endTalkSession:e=>c(`intercom`,`intercom`,`endTalkSession`,`mutation`,e),getStatus:e=>c(`intercom`,`intercom`,`getStatus`,`query`,e)},lawnMowerControl:{startMowing:e=>c(`lawn-mower-control`,`lawnMowerControl`,`startMowing`,`mutation`,e),pause:e=>c(`lawn-mower-control`,`lawnMowerControl`,`pause`,`mutation`,e),dock:e=>c(`lawn-mower-control`,`lawnMowerControl`,`dock`,`mutation`,e),getStatus:e=>c(`lawn-mower-control`,`lawnMowerControl`,`getStatus`,`query`,e)},lockControl:{lock:e=>c(`lock-control`,`lockControl`,`lock`,`mutation`,e),unlock:e=>c(`lock-control`,`lockControl`,`unlock`,`mutation`,e),open:e=>c(`lock-control`,`lockControl`,`open`,`mutation`,e),getStatus:e=>c(`lock-control`,`lockControl`,`getStatus`,`query`,e)},mediaPlayer:{play:e=>c(`media-player`,`mediaPlayer`,`play`,`mutation`,e),pause:e=>c(`media-player`,`mediaPlayer`,`pause`,`mutation`,e),stop:e=>c(`media-player`,`mediaPlayer`,`stop`,`mutation`,e),next:e=>c(`media-player`,`mediaPlayer`,`next`,`mutation`,e),previous:e=>c(`media-player`,`mediaPlayer`,`previous`,`mutation`,e),seek:e=>c(`media-player`,`mediaPlayer`,`seek`,`mutation`,e),setVolume:e=>c(`media-player`,`mediaPlayer`,`setVolume`,`mutation`,e),setMute:e=>c(`media-player`,`mediaPlayer`,`setMute`,`mutation`,e),setShuffle:e=>c(`media-player`,`mediaPlayer`,`setShuffle`,`mutation`,e),setRepeat:e=>c(`media-player`,`mediaPlayer`,`setRepeat`,`mutation`,e),selectSource:e=>c(`media-player`,`mediaPlayer`,`selectSource`,`mutation`,e),playMedia:e=>c(`media-player`,`mediaPlayer`,`playMedia`,`mutation`,e),getStatus:e=>c(`media-player`,`mediaPlayer`,`getStatus`,`query`,e)},motion:{isDetected:e=>c(`motion`,`motion`,`isDetected`,`query`,e),getStatus:e=>c(`motion`,`motion`,`getStatus`,`query`,e)},motionDetection:{analyze:e=>c(`motion-detection`,`motionDetection`,`analyze`,`mutation`,e),removeCamera:e=>c(`motion-detection`,`motionDetection`,`removeCamera`,`mutation`,e),reset:e=>c(`motion-detection`,`motionDetection`,`reset`,`mutation`,e),getDeviceSettingsContribution:e=>c(`motion-detection`,`motionDetection`,`getDeviceSettingsContribution`,`query`,e),getDeviceLiveContribution:e=>c(`motion-detection`,`motionDetection`,`getDeviceLiveContribution`,`query`,e),applyDeviceSettingsPatch:e=>c(`motion-detection`,`motionDetection`,`applyDeviceSettingsPatch`,`mutation`,e)},motionTrigger:{setMotionTrigger:e=>c(`motion-trigger`,`motionTrigger`,`setMotionTrigger`,`mutation`,e),getStatus:e=>c(`motion-trigger`,`motionTrigger`,`getStatus`,`query`,e)},motionZones:{getOptions:e=>c(`motion-zones`,`motionZones`,`getOptions`,`query`,e),setZone:e=>c(`motion-zones`,`motionZones`,`setZone`,`mutation`,e),getStatus:e=>c(`motion-zones`,`motionZones`,`getStatus`,`query`,e)},nativeObjectDetection:{setEnabled:e=>c(`native-object-detection`,`nativeObjectDetection`,`setEnabled`,`mutation`,e),getStatus:e=>c(`native-object-detection`,`nativeObjectDetection`,`getStatus`,`query`,e)},notifier:{send:e=>c(`notifier`,`notifier`,`send`,`mutation`,e),cancel:e=>c(`notifier`,`notifier`,`cancel`,`mutation`,e),getStatus:e=>c(`notifier`,`notifier`,`getStatus`,`query`,e)},numericSensor:{getStatus:e=>c(`numeric-sensor`,`numericSensor`,`getStatus`,`query`,e)},osd:{setOverlay:e=>c(`osd`,`osd`,`setOverlay`,`mutation`,e),getStatus:e=>c(`osd`,`osd`,`getStatus`,`query`,e)},pipelineAnalytics:{getActiveTracks:e=>c(`pipeline-analytics`,`pipelineAnalytics`,`getActiveTracks`,`query`,e),getTrack:e=>c(`pipeline-analytics`,`pipelineAnalytics`,`getTrack`,`query`,e),listTracks:e=>c(`pipeline-analytics`,`pipelineAnalytics`,`listTracks`,`query`,e),clearTracks:e=>c(`pipeline-analytics`,`pipelineAnalytics`,`clearTracks`,`mutation`,e),getMotionEvents:e=>c(`pipeline-analytics`,`pipelineAnalytics`,`getMotionEvents`,`query`,e),getObjectEvents:e=>c(`pipeline-analytics`,`pipelineAnalytics`,`getObjectEvents`,`query`,e),getAudioEvents:e=>c(`pipeline-analytics`,`pipelineAnalytics`,`getAudioEvents`,`query`,e),getEventDensity:e=>c(`pipeline-analytics`,`pipelineAnalytics`,`getEventDensity`,`query`,e),pruneEventsBefore:e=>c(`pipeline-analytics`,`pipelineAnalytics`,`pruneEventsBefore`,`mutation`,e),getEventMedia:e=>c(`pipeline-analytics`,`pipelineAnalytics`,`getEventMedia`,`query`,e),getTrackMedia:e=>c(`pipeline-analytics`,`pipelineAnalytics`,`getTrackMedia`,`query`,e),getDeviceSettingsContribution:e=>c(`pipeline-analytics`,`pipelineAnalytics`,`getDeviceSettingsContribution`,`query`,e),getDeviceLiveContribution:e=>c(`pipeline-analytics`,`pipelineAnalytics`,`getDeviceLiveContribution`,`query`,e),applyDeviceSettingsPatch:e=>c(`pipeline-analytics`,`pipelineAnalytics`,`applyDeviceSettingsPatch`,`mutation`,e)},powerMeter:{getStatus:e=>c(`power-meter`,`powerMeter`,`getStatus`,`query`,e)},presence:{getStatus:e=>c(`presence`,`presence`,`getStatus`,`query`,e)},pressureSensor:{getStatus:e=>c(`pressure-sensor`,`pressureSensor`,`getStatus`,`query`,e)},privacyMask:{getOptions:e=>c(`privacy-mask`,`privacyMask`,`getOptions`,`query`,e),setMask:e=>c(`privacy-mask`,`privacyMask`,`setMask`,`mutation`,e),getStatus:e=>c(`privacy-mask`,`privacyMask`,`getStatus`,`query`,e)},ptz:{move:e=>c(`ptz`,`ptz`,`move`,`mutation`,e),continuousMove:e=>c(`ptz`,`ptz`,`continuousMove`,`mutation`,e),stop:e=>c(`ptz`,`ptz`,`stop`,`mutation`,e),getPresets:e=>c(`ptz`,`ptz`,`getPresets`,`query`,e),goToPreset:e=>c(`ptz`,`ptz`,`goToPreset`,`mutation`,e),savePreset:e=>c(`ptz`,`ptz`,`savePreset`,`mutation`,e),deletePreset:e=>c(`ptz`,`ptz`,`deletePreset`,`mutation`,e),getOptions:e=>c(`ptz`,`ptz`,`getOptions`,`query`,e),goHome:e=>c(`ptz`,`ptz`,`goHome`,`mutation`,e),getPosition:e=>c(`ptz`,`ptz`,`getPosition`,`query`,e),setAutofocus:e=>c(`ptz`,`ptz`,`setAutofocus`,`mutation`,e),getStatus:e=>c(`ptz`,`ptz`,`getStatus`,`query`,e)},ptzAutotrack:{getStatus:e=>c(`ptz-autotrack`,`ptzAutotrack`,`getStatus`,`query`,e),setEnabled:e=>c(`ptz-autotrack`,`ptzAutotrack`,`setEnabled`,`mutation`,e),getSettings:e=>c(`ptz-autotrack`,`ptzAutotrack`,`getSettings`,`query`,e),setSettings:e=>c(`ptz-autotrack`,`ptzAutotrack`,`setSettings`,`mutation`,e)},reboot:{reboot:e=>c(`reboot`,`reboot`,`reboot`,`mutation`,e)},scriptRunner:{run:e=>c(`script-runner`,`scriptRunner`,`run`,`mutation`,e),stop:e=>c(`script-runner`,`scriptRunner`,`stop`,`mutation`,e),getStatus:e=>c(`script-runner`,`scriptRunner`,`getStatus`,`query`,e)},smoke:{getStatus:e=>c(`smoke`,`smoke`,`getStatus`,`query`,e)},snapshot:{getSnapshot:e=>c(`snapshot`,`snapshot`,`getSnapshot`,`query`,e),invalidateCache:e=>c(`snapshot`,`snapshot`,`invalidateCache`,`mutation`,e),getStatus:e=>c(`snapshot`,`snapshot`,`getStatus`,`query`,e),getDeviceSettingsContribution:e=>c(`snapshot`,`snapshot`,`getDeviceSettingsContribution`,`query`,e),getDeviceLiveContribution:e=>c(`snapshot`,`snapshot`,`getDeviceLiveContribution`,`query`,e),applyDeviceSettingsPatch:e=>c(`snapshot`,`snapshot`,`applyDeviceSettingsPatch`,`mutation`,e)},streamCatalog:{getCatalog:e=>c(`stream-catalog`,`streamCatalog`,`getCatalog`,`query`,e)},streamParams:{getOptions:e=>c(`stream-params`,`streamParams`,`getOptions`,`query`,e),setProfile:e=>c(`stream-params`,`streamParams`,`setProfile`,`mutation`,e),getConfigSchema:e=>c(`stream-params`,`streamParams`,`getConfigSchema`,`query`,e),getStatus:e=>c(`stream-params`,`streamParams`,`getStatus`,`query`,e)},switch:{setState:e=>c(`switch`,`switch`,`setState`,`mutation`,e),getStatus:e=>c(`switch`,`switch`,`getStatus`,`query`,e)},tamper:{getStatus:e=>c(`tamper`,`tamper`,`getStatus`,`query`,e)},temperatureSensor:{getStatus:e=>c(`temperature-sensor`,`temperatureSensor`,`getStatus`,`query`,e)},update:{installUpdate:e=>c(`update`,`update`,`installUpdate`,`mutation`,e),getStatus:e=>c(`update`,`update`,`getStatus`,`query`,e)},vacuumControl:{start:e=>c(`vacuum-control`,`vacuumControl`,`start`,`mutation`,e),pause:e=>c(`vacuum-control`,`vacuumControl`,`pause`,`mutation`,e),stop:e=>c(`vacuum-control`,`vacuumControl`,`stop`,`mutation`,e),returnToBase:e=>c(`vacuum-control`,`vacuumControl`,`returnToBase`,`mutation`,e),locate:e=>c(`vacuum-control`,`vacuumControl`,`locate`,`mutation`,e),setFanSpeed:e=>c(`vacuum-control`,`vacuumControl`,`setFanSpeed`,`mutation`,e),getStatus:e=>c(`vacuum-control`,`vacuumControl`,`getStatus`,`query`,e)},valve:{open:e=>c(`valve`,`valve`,`open`,`mutation`,e),close:e=>c(`valve`,`valve`,`close`,`mutation`,e),stop:e=>c(`valve`,`valve`,`stop`,`mutation`,e),setPosition:e=>c(`valve`,`valve`,`setPosition`,`mutation`,e),getStatus:e=>c(`valve`,`valve`,`getStatus`,`query`,e)},vibration:{getStatus:e=>c(`vibration`,`vibration`,`getStatus`,`query`,e)},videoclips:{listClips:e=>c(`videoclips`,`videoclips`,`listClips`,`query`,e),getClipPlayback:e=>c(`videoclips`,`videoclips`,`getClipPlayback`,`query`,e)},waterHeater:{setTargetTemp:e=>c(`water-heater`,`waterHeater`,`setTargetTemp`,`mutation`,e),setOperationMode:e=>c(`water-heater`,`waterHeater`,`setOperationMode`,`mutation`,e),setAway:e=>c(`water-heater`,`waterHeater`,`setAway`,`mutation`,e),getStatus:e=>c(`water-heater`,`waterHeater`,`getStatus`,`query`,e)},weather:{getStatus:e=>c(`weather`,`weather`,`getStatus`,`query`,e)},webrtcSession:{listStreams:e=>c(`webrtc-session`,`webrtcSession`,`listStreams`,`query`,e),createSession:e=>c(`webrtc-session`,`webrtcSession`,`createSession`,`mutation`,e),handleOffer:e=>c(`webrtc-session`,`webrtcSession`,`handleOffer`,`mutation`,e),handleAnswer:e=>c(`webrtc-session`,`webrtcSession`,`handleAnswer`,`mutation`,e),addIceCandidate:e=>c(`webrtc-session`,`webrtcSession`,`addIceCandidate`,`mutation`,e),getIceCandidates:e=>c(`webrtc-session`,`webrtcSession`,`getIceCandidates`,`query`,e),closeSession:e=>c(`webrtc-session`,`webrtcSession`,`closeSession`,`mutation`,e),hasAdaptiveBitrate:e=>c(`webrtc-session`,`webrtcSession`,`hasAdaptiveBitrate`,`query`,e),getSessionState:e=>c(`webrtc-session`,`webrtcSession`,`getSessionState`,`query`,e)},zoneAnalytics:{getCurrentSnapshot:e=>c(`zone-analytics`,`zoneAnalytics`,`getCurrentSnapshot`,`query`,e),getZoneHistory:e=>c(`zone-analytics`,`zoneAnalytics`,`getZoneHistory`,`query`,e),getCameraHistory:e=>c(`zone-analytics`,`zoneAnalytics`,`getCameraHistory`,`query`,e),getUnzonedHistory:e=>c(`zone-analytics`,`zoneAnalytics`,`getUnzonedHistory`,`query`,e)},zoneRules:{listRules:e=>c(`zone-rules`,`zoneRules`,`listRules`,`query`,e),setRules:e=>c(`zone-rules`,`zoneRules`,`setRules`,`mutation`,e)},zones:{listZones:e=>c(`zones`,`zones`,`listZones`,`query`,e),addZone:e=>c(`zones`,`zones`,`addZone`,`mutation`,e),removeZone:e=>c(`zones`,`zones`,`removeZone`,`mutation`,e),updateZone:e=>c(`zones`,`zones`,`updateZone`,`mutation`,e)},addonSettings:{getDeviceSettings:e=>l(`addonSettings`,`getDeviceSettings`,`query`,e),updateDeviceSettings:e=>l(`addonSettings`,`updateDeviceSettings`,`mutation`,e)},cameraPipelineConfig:{getDeviceSettingsContribution:e=>l(`cameraPipelineConfig`,`getDeviceSettingsContribution`,`query`,e),getDeviceLiveContribution:e=>l(`cameraPipelineConfig`,`getDeviceLiveContribution`,`query`,e),applyDeviceSettingsPatch:e=>l(`cameraPipelineConfig`,`applyDeviceSettingsPatch`,`mutation`,e)},deviceAdoption:{getStatus:e=>l(`deviceAdoption`,`getStatus`,`query`,e)},deviceExport:{getDeviceSettingsContribution:e=>l(`deviceExport`,`getDeviceSettingsContribution`,`query`,e),getDeviceLiveContribution:e=>l(`deviceExport`,`getDeviceLiveContribution`,`query`,e),applyDeviceSettingsPatch:e=>l(`deviceExport`,`applyDeviceSettingsPatch`,`mutation`,e)},deviceManager:{loadConfig:e=>l(`deviceManager`,`loadConfig`,`query`,e),loadRuntimeState:e=>l(`deviceManager`,`loadRuntimeState`,`query`,e),loadMeta:e=>l(`deviceManager`,`loadMeta`,`query`,e),setName:e=>l(`deviceManager`,`setName`,`mutation`,e),setLocation:e=>l(`deviceManager`,`setLocation`,`mutation`,e),setType:e=>l(`deviceManager`,`setType`,`mutation`,e),setIntegrationId:e=>l(`deviceManager`,`setIntegrationId`,`mutation`,e),setLinkDeviceId:e=>l(`deviceManager`,`setLinkDeviceId`,`mutation`,e),setPrimaryChildEntityId:e=>l(`deviceManager`,`setPrimaryChildEntityId`,`mutation`,e),setChildLayout:e=>l(`deviceManager`,`setChildLayout`,`mutation`,e),setDeviceLinks:e=>l(`deviceManager`,`setDeviceLinks`,`mutation`,e),getWireableFields:e=>l(`deviceManager`,`getWireableFields`,`query`,e),setRole:e=>l(`deviceManager`,`setRole`,`mutation`,e),applyInitialMeta:e=>l(`deviceManager`,`applyInitialMeta`,`mutation`,e),setMetadata:e=>l(`deviceManager`,`setMetadata`,`mutation`,e),setDisabled:e=>l(`deviceManager`,`setDisabled`,`mutation`,e),getDevice:e=>l(`deviceManager`,`getDevice`,`query`,e),getStreamSources:e=>l(`deviceManager`,`getStreamSources`,`query`,e),getConfigSchema:e=>l(`deviceManager`,`getConfigSchema`,`query`,e),getSettingsSchema:e=>l(`deviceManager`,`getSettingsSchema`,`query`,e),updateConfig:e=>l(`deviceManager`,`updateConfig`,`mutation`,e),enable:e=>l(`deviceManager`,`enable`,`mutation`,e),disable:e=>l(`deviceManager`,`disable`,`mutation`,e),remove:e=>l(`deviceManager`,`remove`,`mutation`,e),getStreamProfileMap:e=>l(`deviceManager`,`getStreamProfileMap`,`query`,e),setStreamProfileMap:e=>l(`deviceManager`,`setStreamProfileMap`,`mutation`,e),probeStreams:e=>l(`deviceManager`,`probeStreams`,`mutation`,e),getBindings:e=>l(`deviceManager`,`getBindings`,`query`,e),getAllBindings:e=>l(`deviceManager`,`getAllBindings`,`query`,e),setWrapperActive:e=>l(`deviceManager`,`setWrapperActive`,`mutation`,e),getDeviceSettingsAggregate:e=>l(`deviceManager`,`getDeviceSettingsAggregate`,`query`,e),getDeviceLiveInfoAggregate:e=>l(`deviceManager`,`getDeviceLiveInfoAggregate`,`query`,e),getDeviceAggregate:e=>l(`deviceManager`,`getDeviceAggregate`,`query`,e),runDeviceAction:e=>l(`deviceManager`,`runDeviceAction`,`mutation`,e),updateDeviceField:e=>l(`deviceManager`,`updateDeviceField`,`mutation`,e),updateDeviceFieldsBatch:e=>l(`deviceManager`,`updateDeviceFieldsBatch`,`mutation`,e),testField:e=>l(`deviceManager`,`testField`,`mutation`,e),getDeviceStatusAggregate:e=>l(`deviceManager`,`getDeviceStatusAggregate`,`query`,e)},deviceState:{getSnapshot:e=>l(`deviceState`,`getSnapshot`,`query`,e),getCapSlice:e=>l(`deviceState`,`getCapSlice`,`query`,e),setCapSlice:e=>l(`deviceState`,`setCapSlice`,`mutation`,e)},faceGallery:{getFaceByTrack:e=>l(`faceGallery`,`getFaceByTrack`,`query`,e)},networkQuality:{getDeviceStats:e=>l(`networkQuality`,`getDeviceStats`,`query`,e),reportClientStats:e=>l(`networkQuality`,`reportClientStats`,`mutation`,e)},pipelineExecutor:{runPipeline:e=>l(`pipelineExecutor`,`runPipeline`,`mutation`,e),runPipelineBatch:e=>l(`pipelineExecutor`,`runPipelineBatch`,`mutation`,e)},pipelineOrchestrator:{assignPipeline:e=>l(`pipelineOrchestrator`,`assignPipeline`,`mutation`,e),unassignPipeline:e=>l(`pipelineOrchestrator`,`unassignPipeline`,`mutation`,e),getPipelineAssignment:e=>l(`pipelineOrchestrator`,`getPipelineAssignment`,`query`,e),getCameraMetrics:e=>l(`pipelineOrchestrator`,`getCameraMetrics`,`query`,e),assignDecoder:e=>l(`pipelineOrchestrator`,`assignDecoder`,`mutation`,e),unassignDecoder:e=>l(`pipelineOrchestrator`,`unassignDecoder`,`mutation`,e),assignAudio:e=>l(`pipelineOrchestrator`,`assignAudio`,`mutation`,e),unassignAudio:e=>l(`pipelineOrchestrator`,`unassignAudio`,`mutation`,e),getAudioAssignment:e=>l(`pipelineOrchestrator`,`getAudioAssignment`,`query`,e),getAudioAssignments:e=>l(`pipelineOrchestrator`,`getAudioAssignments`,`query`,e),getDecoderAssignment:e=>l(`pipelineOrchestrator`,`getDecoderAssignment`,`query`,e),getCameraSettings:e=>l(`pipelineOrchestrator`,`getCameraSettings`,`query`,e),setCameraStepToggle:e=>l(`pipelineOrchestrator`,`setCameraStepToggle`,`mutation`,e),getCameraStepOverrides:e=>l(`pipelineOrchestrator`,`getCameraStepOverrides`,`query`,e),setCameraStepOverride:e=>l(`pipelineOrchestrator`,`setCameraStepOverride`,`mutation`,e),setCameraPipelineForAgent:e=>l(`pipelineOrchestrator`,`setCameraPipelineForAgent`,`mutation`,e),resolvePipeline:e=>l(`pipelineOrchestrator`,`resolvePipeline`,`query`,e),getCameraStatus:e=>l(`pipelineOrchestrator`,`getCameraStatus`,`query`,e),getDeviceSettingsContribution:e=>l(`pipelineOrchestrator`,`getDeviceSettingsContribution`,`query`,e),getDeviceLiveContribution:e=>l(`pipelineOrchestrator`,`getDeviceLiveContribution`,`query`,e),applyDeviceSettingsPatch:e=>l(`pipelineOrchestrator`,`applyDeviceSettingsPatch`,`mutation`,e)},pipelineRunner:{detachCamera:e=>l(`pipelineRunner`,`detachCamera`,`mutation`,e),getCameraMetrics:e=>l(`pipelineRunner`,`getCameraMetrics`,`query`,e)},plateGallery:{listPlates:e=>l(`plateGallery`,`listPlates`,`query`,e),getPlateByTrack:e=>l(`plateGallery`,`getPlateByTrack`,`query`,e)},recording:{getAvailability:e=>l(`recording`,`getAvailability`,`query`,e),getDaysWithRecordings:e=>l(`recording`,`getDaysWithRecordings`,`query`,e),getPlaybackManifest:e=>l(`recording`,`getPlaybackManifest`,`query`,e),getDeviceConfig:e=>l(`recording`,`getDeviceConfig`,`query`,e),locateSegment:e=>l(`recording`,`locateSegment`,`query`,e),readSegmentBytes:e=>l(`recording`,`readSegmentBytes`,`query`,e),setDeviceConfig:e=>l(`recording`,`setDeviceConfig`,`mutation`,e),rescanStorage:e=>l(`recording`,`rescanStorage`,`mutation`,e),pruneFootage:e=>l(`recording`,`pruneFootage`,`mutation`,e),getStatus:e=>l(`recording`,`getStatus`,`query`,e),getDeviceSettingsContribution:e=>l(`recording`,`getDeviceSettingsContribution`,`query`,e),getDeviceLiveContribution:e=>l(`recording`,`getDeviceLiveContribution`,`query`,e),applyDeviceSettingsPatch:e=>l(`recording`,`applyDeviceSettingsPatch`,`mutation`,e)},snapshotProvider:{supportsDevice:e=>l(`snapshotProvider`,`supportsDevice`,`query`,e),getSnapshot:e=>l(`snapshotProvider`,`getSnapshot`,`query`,e)},streamBroker:{publishCameraStream:e=>l(`streamBroker`,`publishCameraStream`,`mutation`,e),retractCameraStream:e=>l(`streamBroker`,`retractCameraStream`,`mutation`,e),assignProfile:e=>l(`streamBroker`,`assignProfile`,`mutation`,e),unassignProfile:e=>l(`streamBroker`,`unassignProfile`,`mutation`,e),restartProfile:e=>l(`streamBroker`,`restartProfile`,`mutation`,e),getDeviceSettingsContribution:e=>l(`streamBroker`,`getDeviceSettingsContribution`,`query`,e),getDeviceLiveContribution:e=>l(`streamBroker`,`getDeviceLiveContribution`,`query`,e),applyDeviceSettingsPatch:e=>l(`streamBroker`,`applyDeviceSettingsPatch`,`mutation`,e)}}}var ff=V({staticDir:F()}),pf=V({version:F()}),mf={name:`admin-ui`,scope:`system`,mode:`singleton`,internal:!0,methods:{getStaticDir:J(z(),ff),getVersion:J(z(),pf)}},hf=V({id:F(),label:F(),protocol:W([`rtsp`,`rtmp`,`annexb`,`http-mjpeg`,`webrtc`,`custom`]),url:F().optional(),resolution:V({width:I(),height:I()}).optional(),fps:I().optional(),bitrate:I().optional(),codec:F().optional(),profileHint:zd.optional(),sdp:F().optional()}),gf=V({key:F(),value:R()}),_f=V({source:F(),data:U(F(),R())}),vf={name:`device-ops`,scope:`device`,deviceNative:!0,mode:`singleton`,methods:{getStreamSources:J(V({deviceId:I()}),B(hf)),getConfigEntries:J(V({deviceId:I()}),B(gf)),setConfig:J(V({deviceId:I(),values:U(F(),R())}),z(),{kind:`mutation`}),runAction:J(V({deviceId:I(),action:F().min(1),input:R()}),R(),{kind:`mutation`}),removeDevice:J(V({deviceId:I()}),z(),{kind:`mutation`}),getSettingsSchema:J(V({deviceId:I()}),R().nullable()),getRawState:J(V({deviceId:I()}),_f.nullable(),{auth:`protected`})}},yf=W([`singleton`,`device`,`widget`]),bf=V({capName:F(),kind:yf,deviceId:I().optional(),reachable:L(),latencyMs:I(),error:F().optional()}),xf=V({addonId:F(),caps:B(bf).readonly(),widgets:B(bf).readonly()}),Sf=V({nodeId:F(),addons:B(xf).readonly()});V({ok:L(),degraded:L(),checkedAt:F(),nodes:B(Sf).readonly(),summary:V({total:I(),reachable:I(),unreachable:I()})});var Cf=[`onnx`,`coreml`,`openvino`,`tflite`,`pt`],wf=I().int().min(0).max(6),Tf=/^([01]\d|2[0-3]):[0-5]\d$/,Ef=nd(`kind`,[V({kind:G(`always`)}),V({kind:G(`timeOfDay`),start:F().regex(Tf),end:F().regex(Tf),days:B(wf).optional()})]),Df=W([`continuous`,`onMotion`,`onAudioThreshold`]),Of=W([`off`,`events`,`continuous`]),kf=V({motion:L().optional(),audioThresholdDbfs:I().optional()}),Af=W([`continuous`,`events`]),jf=kf,Mf=V({days:B(wf),start:F().regex(Tf),end:F().regex(Tf),mode:Af,triggers:jf.optional(),preBufferSec:I().min(0).optional(),postBufferSec:I().min(0).optional()}),Nf=V({schedule:Ef,mode:Df,preBufferSec:I().min(0).default(0),postBufferSec:I().min(0).default(0),resetTimeoutOnNewEvent:L().default(!0),thresholdDbfs:I().optional()}),Pf=V({maxAgeDays:I().min(0).optional(),maxSizeGb:I().min(0).optional()}),Ff=V({enabled:L(),mode:Of.optional(),profiles:B(zd).optional(),segmentSeconds:I().int().positive().optional(),schedules:B(Ef).optional(),schedule:Ef.optional(),triggers:kf.optional(),preBufferSec:I().min(0).optional(),postBufferSec:I().min(0).optional(),rules:B(Nf).optional(),bands:B(Mf).optional(),retention:Pf.optional()}),If=F().regex(/^[a-z][a-zA-Z0-9-]*$/),Lf=V({id:F().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/),type:F(),displayName:F().min(1),providerId:F().min(1),config:U(F(),R()),nodeId:F().optional(),isDefault:L().default(!1),isSystem:L().default(!1),createdAt:I(),updatedAt:I()}),Rf=H([If,F().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/)]),zf=V({id:F().regex(/^[a-z][a-zA-Z0-9-]*$/,{message:`id must start with a lowercase letter and contain only letters, digits, or hyphens`}),displayName:F().min(1,{message:`displayName must not be empty`}),description:F().optional(),cardinality:W([`single`,`multi`]),defaultsTo:F().optional()}),Bf=V({inputFps:I(),outputFps:I(),avgDecodeTimeMs:I(),droppedFrames:I()}),Vf=V({codec:F(),maxFps:I().default(0),outputFormat:W([`jpeg`,`rgb`,`bgr`,`yuv420`,`gray`]).default(`jpeg`),scale:I().default(1),width:I().optional(),height:I().optional(),deviceId:I().int().nonnegative().optional(),tag:F().optional(),frameSink:W([`callback`,`shm`]).default(`callback`)}),Hf=V({video:V({codec:W([`h264`,`h265`,`copy`]),profile:W([`baseline`,`main`,`high`]).optional(),width:I().int().positive().optional(),height:I().int().positive().optional(),fps:I().positive().optional(),bitrateKbps:I().int().positive().optional(),gopFrames:I().int().positive().optional(),bf:I().int().min(0).optional(),preset:W([`ultrafast`,`superfast`,`veryfast`,`faster`,`fast`,`medium`]).optional(),tune:W([`zerolatency`,`film`,`animation`]).optional()}),audio:H([G(`passthrough`),V({codec:W([`opus`,`aac`,`pcmu`,`pcma`,`copy`]),bitrateKbps:I().int().positive().optional(),sampleRateHz:I().int().positive().optional(),channels:H([G(1),G(2)]).optional()})]),inputArgs:B(F()).optional(),outputArgs:B(F()).optional()}),Uf={mapping:{Speech:`speech`,"Child speech, kid speaking":`speech`,Conversation:`speech`,"Narration, monologue":`speech`,Babbling:`speech`,Whispering:`speech`,"Speech synthesizer":`speech`,Humming:`speech`,Rapping:`speech`,Singing:`speech`,Choir:`speech`,"Child singing":`speech`,Shout:`scream`,Bellow:`scream`,Yell:`scream`,Screaming:`scream`,"Children shouting":`scream`,Whoop:`scream`,"Crying, sobbing":`crying`,"Baby cry, infant cry":`crying`,Whimper:`crying`,"Wail, moan":`crying`,Groan:`crying`,Laughter:`laughter`,"Baby laughter":`laughter`,Giggle:`laughter`,Snicker:`laughter`,"Belly laugh":`laughter`,"Chuckle, chortle":`laughter`,Music:`music`,"Musical instrument":`music`,Guitar:`music`,Piano:`music`,Drum:`music`,"Drum kit":`music`,"Violin, fiddle":`music`,Flute:`music`,Saxophone:`music`,Trumpet:`music`,Synthesizer:`music`,"Pop music":`music`,"Rock music":`music`,"Hip hop music":`music`,"Classical music":`music`,Jazz:`music`,"Electronic music":`music`,"Background music":`music`,Dog:`dog`,Bark:`dog`,Yip:`dog`,Howl:`dog`,"Bow-wow":`dog`,Growling:`dog`,"Whimper (dog)":`dog`,Cat:`cat`,Purr:`cat`,Meow:`cat`,Hiss:`cat`,Caterwaul:`cat`,Bird:`bird`,"Bird vocalization, bird call, bird song":`bird`,"Chirp, tweet":`bird`,Squawk:`bird`,Crow:`bird`,Owl:`bird`,"Pigeon, dove":`bird`,Animal:`animal`,"Domestic animals, pets":`animal`,"Livestock, farm animals, working animals":`animal`,Horse:`animal`,"Cattle, bovinae":`animal`,Pig:`animal`,Sheep:`animal`,Goat:`animal`,Frog:`animal`,Insect:`animal`,Cricket:`animal`,Alarm:`alarm`,"Alarm clock":`alarm`,"Smoke detector, smoke alarm":`alarm`,"Fire alarm":`alarm`,Buzzer:`alarm`,"Civil defense siren":`alarm`,"Car alarm":`alarm`,Siren:`siren`,"Police car (siren)":`siren`,"Ambulance (siren)":`siren`,"Fire engine, fire truck (siren)":`siren`,"Emergency vehicle":`siren`,Foghorn:`siren`,Doorbell:`doorbell`,"Ding-dong":`doorbell`,Knock:`doorbell`,Tap:`doorbell`,Glass:`glass_breaking`,Shatter:`glass_breaking`,"Chink, clink":`glass_breaking`,"Gunshot, gunfire":`gunshot`,"Machine gun":`gunshot`,Explosion:`gunshot`,Fireworks:`gunshot`,Firecracker:`gunshot`,"Artillery fire":`gunshot`,"Cap gun":`gunshot`,Boom:`gunshot`,Vehicle:`vehicle`,Car:`vehicle`,Truck:`vehicle`,Bus:`vehicle`,Motorcycle:`vehicle`,"Car passing by":`vehicle`,"Vehicle horn, car horn, honking":`vehicle`,"Traffic noise, roadway noise":`vehicle`,Train:`vehicle`,Aircraft:`vehicle`,Helicopter:`vehicle`,Bicycle:`vehicle`,Skateboard:`vehicle`,Fire:`fire`,Crackle:`fire`,Water:`water`,Rain:`water`,Raindrop:`water`,"Rain on surface":`water`,Stream:`water`,Waterfall:`water`,Ocean:`water`,"Waves, surf":`water`,"Splash, splatter":`water`,Wind:`wind`,Thunderstorm:`wind`,Thunder:`wind`,"Wind noise (microphone)":`wind`,"Rustling leaves":`wind`,Door:`door`,"Sliding door":`door`,Slam:`door`,"Cupboard open or close":`door`,"Walk, footsteps":`footsteps`,Run:`footsteps`,Shuffle:`footsteps`,Crowd:`crowd`,Chatter:`crowd`,Cheering:`crowd`,Applause:`crowd`,"Children playing":`crowd`,"Hubbub, speech noise, speech babble":`crowd`,Telephone:`telephone`,"Telephone bell ringing":`telephone`,Ringtone:`telephone`,"Telephone dialing, DTMF":`telephone`,"Busy signal":`telephone`,Engine:`engine`,"Engine starting":`engine`,Idling:`engine`,"Accelerating, revving, vroom":`engine`,"Light engine (high frequency)":`engine`,"Medium engine (mid frequency)":`engine`,"Heavy engine (low frequency)":`engine`,"Lawn mower":`engine`,Chainsaw:`engine`,Hammer:`tools`,Jackhammer:`tools`,Sawing:`tools`,"Power tool":`tools`,Drill:`tools`,Sanding:`tools`,Silence:`silence`},preserveOriginal:!1},Wf={mapping:{speech:`speech`,child_speech:`speech`,conversation:`speech`,whispering:`speech`,singing:`speech`,humming:`speech`,shout:`scream`,yell:`scream`,screaming:`scream`,crying:`crying`,baby_crying:`crying`,sobbing:`crying`,laughter:`laughter`,baby_laughter:`laughter`,giggling:`laughter`,music:`music`,guitar:`music`,piano:`music`,drums:`music`,dog_bark:`dog`,dog_bow_wow:`dog`,dog_growling:`dog`,dog_howl:`dog`,cat_meow:`cat`,cat_purr:`cat`,cat_hiss:`cat`,bird:`bird`,bird_chirp:`bird`,bird_squawk:`bird`,animal:`animal`,horse:`animal`,cow_moo:`animal`,insect:`animal`,alarm:`alarm`,smoke_alarm:`alarm`,fire_alarm:`alarm`,car_alarm:`alarm`,siren:`siren`,police_siren:`siren`,ambulance_siren:`siren`,doorbell:`doorbell`,door_knock:`doorbell`,knocking:`doorbell`,glass_breaking:`glass_breaking`,glass_shatter:`glass_breaking`,gunshot:`gunshot`,explosion:`gunshot`,fireworks:`gunshot`,car:`vehicle`,truck:`vehicle`,motorcycle:`vehicle`,car_horn:`vehicle`,vehicle_horn:`vehicle`,traffic:`vehicle`,fire:`fire`,fire_crackle:`fire`,water:`water`,rain:`water`,ocean:`water`,splash:`water`,wind:`wind`,thunder:`wind`,thunderstorm:`wind`,door:`door`,door_slam:`door`,sliding_door:`door`,footsteps:`footsteps`,walking:`footsteps`,running:`footsteps`,crowd:`crowd`,chatter:`crowd`,cheering:`crowd`,applause:`crowd`,telephone_ring:`telephone`,ringtone:`telephone`,engine:`engine`,engine_starting:`engine`,lawn_mower:`engine`,chainsaw:`engine`,hammer:`tools`,jackhammer:`tools`,drill:`tools`,power_tool:`tools`,silence:`silence`},preserveOriginal:!1},Gf=new Map;for(let[e,t]of Object.entries(Uf.mapping))Gf.set(e.toLowerCase(),t);for(let[e,t]of Object.entries(Wf.mapping))Gf.set(e.toLowerCase(),t);var Kf={Siren:q.Siren,Floodlight:q.Floodlight,Spotlight:q.Spotlight,PirSensor:q.PirSensor,Chime:q.Chime,Autotrack:q.Autotrack,Nightvision:q.Nightvision,PrivacyMask:q.PrivacyMask};Kf.Siren,Kf.Floodlight,Kf.Spotlight,Kf.PirSensor,Kf.Chime,Kf.Autotrack,Kf.Nightvision,Kf.PrivacyMask,rf.BatteryOperated;var qf=V({online:L(),lastChangedAt:I()}),Jf={name:`device-status`,scope:`device`,deviceNative:!0,mode:`singleton`,methods:{},events:{onStatusChanged:{data:V({deviceId:I(),status:qf})}},status:{schema:qf,kind:`push`},runtimeState:qf},Yf=V({flags:U(F(),R()),deviceType:F().nullable(),model:F().nullable(),channelCount:I().nullable(),lastProbedAt:I(),lastFetchedAt:I()}),Xf={name:`feature-probe`,scope:`device`,deviceNative:!0,mode:`singleton`,methods:{},events:{onProbeChanged:{data:V({deviceId:I(),status:Yf})}},status:{schema:Yf,kind:`push`},runtimeState:Yf},Zf=V({co2Ppm:I().min(0).optional(),vocPpb:I().min(0).optional(),pm25:I().min(0).optional(),pm10:I().min(0).optional(),aqi:I().optional(),lastFetchedAt:I(),unit:F().optional(),precision:I().int().min(0).max(10).optional()}),Qf={name:`air-quality-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Sensor],methods:{},status:{schema:Zf,kind:`push`},runtimeState:Zf},$f=W([`disarmed`,`armed_home`,`armed_away`,`armed_night`,`armed_vacation`,`armed_custom_bypass`,`arming`,`disarming`,`pending`,`triggered`]),ep=W([`home`,`away`,`night`,`vacation`,`custom_bypass`]),tp=V({state:$f,availableModes:B(ep),requiresCode:L(),lastChangedAt:I()}),np={name:`alarm-panel`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.AlarmPanel],methods:{arm:J(V({deviceId:I().int().nonnegative(),mode:ep,code:F().min(1).optional()}),z(),{kind:`mutation`,auth:`admin`}),disarm:J(V({deviceId:I().int().nonnegative(),code:F().min(1).optional()}),z(),{kind:`mutation`,auth:`admin`}),trigger:J(V({deviceId:I().int().nonnegative()}),z(),{kind:`mutation`,auth:`admin`})},status:{schema:tp,kind:`push`},runtimeState:tp},rp=V({lux:I().min(0),lastFetchedAt:I(),unit:F().optional(),precision:I().int().min(0).max(10).optional()}),ip={name:`ambient-light-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Sensor],methods:{},status:{schema:rp,kind:`push`},runtimeState:rp},ap=V({className:F(),hits:I().int().nonnegative(),avgScore:I().min(0).max(1),peakScore:I().min(0).max(1)}),op=V({ts:I().int(),windowSec:I().int().positive(),level:V({rms:I(),dbfs:I()}),peakDbfs:I(),avgDbfs:I(),current:V({className:F(),score:I().min(0).max(1),timestamp:I().int()}).nullable(),byClass:B(ap).readonly()}),sp=V({points:B(V({ts:I().int(),dbfs:I().nullable(),peakDbfs:I(),avgDbfs:I(),topClass:F().nullable(),topScore:I().min(0).max(1).nullable()})).readonly(),effectiveSampleEveryMs:I().int().positive(),windowMsActual:I().int().nonnegative()}),cp={name:`audio-metrics`,scope:`device`,mode:`singleton`,deviceTypes:[K.Camera],methods:{getCurrentSnapshot:J(V({deviceId:I()}),op.nullable()),getHistory:J(V({deviceId:I(),windowSec:I().int().positive().optional(),sampleEveryMs:I().int().positive().optional()}),sp)},runtimeState:op},lp=V({enabled:L(),isRunning:L(),lastTriggeredAt:I(),lastError:F().nullable(),lastChangedAt:I()}),up={name:`automation-control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Automation],methods:{enable:J(V({deviceId:I().int().nonnegative()}),z(),{kind:`mutation`,auth:`admin`}),disable:J(V({deviceId:I().int().nonnegative()}),z(),{kind:`mutation`,auth:`admin`}),trigger:J(V({deviceId:I().int().nonnegative(),skipCondition:L().optional()}),z(),{kind:`mutation`,auth:`admin`})},status:{schema:lp,kind:`push`},runtimeState:lp},dp=V({percentage:I().min(0).max(100),charging:W([`dc`,`solar`,`none`]),sleeping:L(),lastUpdated:I(),binary:L().optional()}),fp={name:`battery`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Camera,K.Sensor,K.Button,K.Switch],methods:{wakeForStream:J(V({deviceId:I(),timeoutMs:I().int().min(500).max(3e4).default(8e3)}),V({awoke:L(),durationMs:I()}),{kind:`mutation`})},events:{onStatusChanged:{data:V({deviceId:I(),status:dp})}},status:{schema:dp,kind:`push`},runtimeState:dp},pp=V({on:L(),lastChangedAt:I()}),mp={name:`binary`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Sensor],methods:{},status:{schema:pp,kind:`push`},runtimeState:pp},hp=V({percentage:I().min(0).max(100),lastChangedAt:I()}),gp={name:`brightness`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Light],methods:{setBrightness:J(V({deviceId:I().int().nonnegative(),percentage:I().min(0).max(100)}),z(),{kind:`mutation`,auth:`admin`})},events:{onBrightnessChanged:{data:V({deviceId:I(),percentage:I().min(0).max(100),lastChangedAt:I()})}},status:{schema:hp,kind:`command-driven`},runtimeState:hp},_p=W([`webrtc`,`hls`,`mjpeg`,`rtsp`]),vp=V({streamId:F(),format:_p,url:F().nullable(),active:L()}),yp={name:`streaming-engine`,scope:`system`,mode:`singleton`,internal:!0,methods:{registerStream:J(V({streamId:F(),sourceUrl:F(),codec:F().optional()}),z(),{kind:`mutation`}),unregisterStream:J(V({streamId:F()}),z(),{kind:`mutation`}),getStreamUrl:J(V({streamId:F(),format:_p}),F().nullable()),listStreams:J(z(),B(vp))}},bp=V({brokerId:F(),url:F(),mutedUrl:F(),enabled:L(),codec:F().optional(),resolution:V({width:I().int().positive(),height:I().int().positive()}).optional()}),xp=V({sessionId:F(),remoteAddr:F(),playing:L(),muted:L(),connectedAt:I(),lastRtpAt:I(),bytesSent:I()}),Sp=V({tag:F(),subscribedAt:I(),maxFps:I(),framesDelivered:I(),framesDropped:I()}),Cp=V({tag:F(),subscribedAt:I(),chunksDelivered:I()}),wp=V({kind:W([`alexa`,`homekit`,`webrtc-browser`,`webrtc-mobile`,`webrtc-whep`,`rtsp-listen`,`derived-broker`,`recording`,`pipeline`,`snapshot`,`warmup`,`unknown`]),label:F().optional(),media:W([`audio`,`video`,`both`]).optional(),targetCodec:F().optional(),transport:W([`passthrough`,`repacketize`,`transcode`]).optional(),remoteAddr:F().optional(),userAgent:F().optional(),userId:F().optional(),sessionId:F().optional(),extra:U(F(),F()).optional()}).readonly(),Tp=V({id:F(),channel:W([`annexb`,`rtp`]),attribution:wp,subscribedAt:I(),packetsDelivered:I()}),Ep=V({rtsp:B(xp).readonly(),decoded:B(Sp).readonly(),audio:B(Cp).readonly(),encoded:B(Tp).readonly(),pipeClients:I(),encodedSubscribers:I()});W([`reconnecting`,`sleeping`,`offline`,`disabled`,`waking`]);var Dp=W([`h264`,`h265`,`copy`]),Op=W([`aac`,`opus`,`pcmu`,`copy`,`none`]),kp=V({deviceId:I().int().nonnegative(),video:Dp,audio:Op.optional(),profile:zd.optional(),targetResolution:V({width:I().int().positive(),height:I().int().positive()}).optional(),outputArgs:B(F()).optional(),audioEgress:L().optional(),hostname:F().optional(),tag:F().optional()}),Ap=V({url:F(),videoCodec:W([`H264`,`H265`]),audioCodec:F(),resolution:V({width:I().int().positive(),height:I().int().positive()}),transcoded:L(),encoder:F(),pipelineKey:F()}),jp={name:`stream-broker`,scope:`system`,mode:`singleton`,exposesDeviceSettings:!0,methods:{publishCameraStream:J(V({deviceId:I().int().nonnegative(),camStreamId:F().min(1),kind:Bd,url:F().optional(),codec:F().optional(),resolution:Vd.optional(),fps:I().positive().optional(),label:F().optional(),deviceFeatures:B(F()).optional(),autoEligible:L().optional(),metadata:U(F(),R()).optional(),sourceCamStreamId:F().min(1).optional(),encodeProfile:Hf.optional()}),V({success:G(!0)}),{kind:`mutation`,auth:`admin`}),retractCameraStream:J(V({deviceId:I().int().nonnegative(),camStreamId:F().min(1)}),V({success:G(!0)}),{kind:`mutation`,auth:`admin`}),assignProfile:J(V({deviceId:I().int().nonnegative(),profile:zd,camStreamId:F().min(1)}),V({success:G(!0)}),{kind:`mutation`,auth:`admin`}),unassignProfile:J(V({deviceId:I().int().nonnegative(),profile:zd}),V({success:G(!0)}),{kind:`mutation`,auth:`admin`}),listAllCameraStreams:J(z(),B(Hd).readonly()),listAllProfileSlots:J(z(),B(Wd).readonly()),getBrokerStats:J(V({brokerId:F()}),tf),probeStream:J(V({brokerId:F()}),V({probed:L(),summary:F()}),{kind:`mutation`,auth:`admin`}),listClients:J(V({brokerId:F()}),Ep),killClient:J(V({brokerId:F(),channel:W([`rtsp`,`decoded`,`audio`]),handle:F()}),V({killed:L()}),{kind:`mutation`,auth:`admin`}),restartProfile:J(V({deviceId:I().int().nonnegative(),profile:zd}),V({success:L()}),{kind:`mutation`,auth:`admin`}),getStreamUrl:J(V({streamId:F(),format:_p}),V({url:F()})),getStreamWithCodec:J(kp,Ap,{kind:`mutation`,auth:`admin`}),releaseStreamWithCodec:J(V({pipelineKey:F()}),V({released:L(),refcount:I().int().nonnegative()}),{kind:`mutation`,auth:`admin`}),subscribeAudioChunks:J($d,ef,{kind:`mutation`}),pullAudioChunks:J(V({subscriptionId:F(),maxCount:I().int().positive().default(8)}),B(Qd).readonly()),unsubscribeAudioChunks:J(V({subscriptionId:F()}),V({released:L()}),{kind:`mutation`}),subscribeFrames:J(Xd,Zd,{kind:`mutation`}),pullFrameHandles:J(V({subscriptionId:F(),maxCount:I().int().positive().default(4)}),B(Jd).readonly()),unsubscribeFrames:J(V({subscriptionId:F()}),V({released:L()}),{kind:`mutation`}),setPreBufferDuration:J(V({brokerId:F(),seconds:I().min(0).max(30)}),z(),{kind:`mutation`,auth:`admin`}),getPreBufferInfo:J(V({brokerId:F()}),V({configuredSec:I(),bufferedMs:I(),packetCount:I()})),getRtspPort:J(z(),I()),getAllRtspEntries:J(V({hostname:F().optional()}),B(bp).readonly()),getRtspEntry:J(V({brokerId:F(),hostname:F().optional()}),bp.nullable()),regenerateRtspToken:J(V({brokerId:F()}),F().nullable(),{kind:`mutation`,auth:`admin`}),setRtspEnabled:J(V({brokerId:F(),enabled:L()}),z(),{kind:`mutation`,auth:`admin`}),isRtspEnabled:J(V({brokerId:F()}),L())},events:{onCamStreamDemand:of(V({deviceId:I().int().nonnegative(),camStreamId:F(),profile:zd})),onCamStreamIdle:of(V({deviceId:I().int().nonnegative(),camStreamId:F()})),onRequestStreamSourceRefresh:of(V({deviceId:I().int().nonnegative(),camStreamId:F(),brokerId:F()}))}},Mp=W([`h264`,`h265`,`hevc`,`av1`,`mjpeg`,`vp8`,`vp9`]),Np=V({acceptCodecs:B(Mp).readonly().optional(),minHeight:I().int().positive().optional(),minWidth:I().int().positive().optional(),excludeDerived:L().optional(),requireSiblingCodec:B(Mp).readonly().optional()}).readonly(),Pp=V({preferredProviders:B(F()).readonly().optional(),resolutionPreference:W([`highest`,`lowest`]).optional()}).readonly(),Fp=V({camStreamId:F(),codec:F().optional(),resolution:Vd.optional(),reason:F()}),Ip={name:`camera-streams`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[K.Camera],methods:{getCameraStreams:J(V({deviceId:I().int().nonnegative()}),B(Hd).readonly()),getBrokerStreams:J(V({deviceId:I().int().nonnegative()}),B(Wd).readonly()),getRtspEntries:J(V({deviceId:I().int().nonnegative(),hostname:F().optional()}),B(bp).readonly()),getProfileRtspEntries:J(V({deviceId:I().int().nonnegative(),hostname:F().optional()}),B(nf).readonly()),pickStream:J(V({deviceId:I().int().nonnegative(),requirements:Np,preferences:Pp.optional()}),Fp.nullable())},events:{onCamStreamsChanged:of(V({deviceId:I().int().nonnegative(),camStreams:B(Hd).readonly()})),onProfileSlotsChanged:of(V({deviceId:I().int().nonnegative(),profileSlots:B(Wd).readonly()}))},runtimeState:V({online:L(),slotStatuses:V({high:Ud.optional(),mid:Ud.optional(),low:Ud.optional()}),slotErrors:V({high:F().optional(),mid:F().optional(),low:F().optional()}),lastChangedAt:I()})},Lp=V({detected:L(),lastChangedAt:I()}),Rp={name:`carbon-monoxide`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Sensor],methods:{},status:{schema:Lp,kind:`push`},runtimeState:Lp},zp=W([`off`,`heat`,`cool`,`auto`,`heat_cool`,`fan_only`,`dry`]),Bp=V({mode:zp,availableModes:B(zp),fanMode:F(),availableFanModes:B(F()),preset:F(),availablePresets:B(F()),target:I().nullable(),targetHigh:I().nullable(),targetLow:I().nullable(),targetHumidity:I().min(0).max(100).nullable(),currentTemp:I().nullable(),currentHumidity:I().min(0).max(100).nullable(),lastFetchedAt:I()}),Vp={name:`climate-control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Thermostat],methods:{setMode:J(V({deviceId:I().int().nonnegative(),mode:zp}),z(),{kind:`mutation`,auth:`admin`}),setFanMode:J(V({deviceId:I().int().nonnegative(),fanMode:F().min(1)}),z(),{kind:`mutation`,auth:`admin`}),setPreset:J(V({deviceId:I().int().nonnegative(),preset:F().min(1)}),z(),{kind:`mutation`,auth:`admin`}),setTarget:J(V({deviceId:I().int().nonnegative(),target:I()}),z(),{kind:`mutation`,auth:`admin`}),setTargetRange:J(V({deviceId:I().int().nonnegative(),targetLow:I(),targetHigh:I()}),z(),{kind:`mutation`,auth:`admin`}),setTargetHumidity:J(V({deviceId:I().int().nonnegative(),targetHumidity:I().min(0).max(100)}),z(),{kind:`mutation`,auth:`admin`})},status:{schema:Bp,kind:`push`},runtimeState:Bp},Hp=V({r:I().int().min(0).max(255),g:I().int().min(0).max(255),b:I().int().min(0).max(255)}),Up=V({h:I().min(0).max(360),s:I().min(0).max(100),v:I().min(0).max(100)}),Wp=nd(`mode`,[V({mode:G(`rgb`),rgb:Hp}),V({mode:G(`hsv`),hsv:Up}),V({mode:G(`mired`),mireds:I().int().min(50).max(1e3)})]),Gp=V({mode:W([`rgb`,`hsv`,`mired`]),rgb:Hp.optional(),hsv:Up.optional(),mireds:I().int().optional(),lastChangedAt:I()}),Kp={name:`color`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Light],methods:{setColor:J(V({deviceId:I().int().nonnegative(),color:Wp}),z(),{kind:`mutation`,auth:`admin`})},events:{onColorChanged:{data:V({deviceId:I(),mode:W([`rgb`,`hsv`,`mired`]),rgb:Hp.optional(),hsv:Up.optional(),mireds:I().int().optional(),lastChangedAt:I()})}},status:{schema:Gp,kind:`command-driven`},runtimeState:Gp},qp=V({connected:L(),lastChangedAt:I()}),Jp={name:`connectivity`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Sensor],methods:{},status:{schema:qp,kind:`push`},runtimeState:qp},Yp=V({items:B(V({key:F().min(1),label:F().min(1),level:I().min(0).max(100).nullable(),status:W([`ok`,`replace`]).nullable(),lastResetAt:I().nullable(),resettable:L()})),lastChangedAt:I()}),Xp={name:`consumables`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Camera,K.Hub,K.Light,K.Siren,K.Switch,K.Sensor,K.Thermostat,K.Button,K.EventEmitter,K.Update,K.Generic,K.Notifier,K.Script,K.Automation,K.Lock,K.Cover,K.Valve,K.Humidifier,K.WaterHeater,K.Fan,K.MediaPlayer,K.AlarmPanel,K.Control,K.Presence,K.Weather,K.Vacuum,K.LawnMower,K.Container,K.Image],deviceConfig:{ui:{kind:`widget`,widgetId:`host/consumables-panel`,tab:`consumables`,topTab:!0,label:`Consumables`,order:5}},methods:{reset:J(V({deviceId:I().int().nonnegative(),key:F().min(1)}),z(),{kind:`mutation`,auth:`admin`})},status:{schema:Yp,kind:`push`},runtimeState:Yp.extend({lastFetchedAt:I()})},Zp=V({entryOpen:L(),lastChangedAt:I()}),Qp={name:`contact`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Sensor],methods:{},status:{schema:Zp,kind:`push`},runtimeState:Zp},$p=V({kind:W([`numeric`,`select`,`text`,`datetime`]),value:H([I(),F()]),options:B(F()),lastChangedAt:I(),unit:F().optional(),min:I().optional(),max:I().optional(),step:I().optional(),precision:I().int().min(0).max(10).optional(),format:W([`date`,`time`,`datetime`]).optional()}),em=nd(`kind`,[V({kind:G(`numeric`),value:I()}),V({kind:G(`select`),value:F().min(1)}),V({kind:G(`text`),value:F()}),V({kind:G(`datetime`),value:F().min(1)})]),tm={name:`control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Control],methods:{setValue:J(V({deviceId:I().int().nonnegative(),control:em}),z(),{kind:`mutation`,auth:`admin`})},status:{schema:$p,kind:`push`},runtimeState:$p},nm=V({state:W([`open`,`opening`,`closing`,`closed`,`stopped`]),position:I().min(0).max(100).nullable(),tiltPosition:I().min(0).max(100).nullable(),lastChangedAt:I()}),rm={name:`cover`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Cover],methods:{open:J(V({deviceId:I().int().nonnegative()}),z(),{kind:`mutation`,auth:`admin`}),close:J(V({deviceId:I().int().nonnegative()}),z(),{kind:`mutation`,auth:`admin`}),stop:J(V({deviceId:I().int().nonnegative()}),z(),{kind:`mutation`,auth:`admin`}),setPosition:J(V({deviceId:I().int().nonnegative(),position:I().min(0).max(100)}),z(),{kind:`mutation`,auth:`admin`}),setTiltPosition:J(V({deviceId:I().int().nonnegative(),tiltPosition:I().min(0).max(100)}),z(),{kind:`mutation`,auth:`admin`})},status:{schema:nm,kind:`push`},runtimeState:nm},im=V({id:F(),system:F(),uniqueId:F().optional(),raw:U(F(),R()).optional()}),am=W([`online`,`sleeping`,`offline`,`unknown`]),om=Md(()=>V({childNativeId:F(),name:F(),type:W(K),status:am,metadata:V({model:F().optional(),serialNumber:F().optional(),uid:F().optional(),rtspChannel:I().int().nonnegative().optional(),isBattery:L().optional(),isDoorbell:L().optional(),isMultifocal:L().optional(),externalLocation:F().optional(),manufacturer:F().optional(),integration:F().optional()}).default({}),alreadyAdopted:L(),adoptedDeviceId:I().int().nonnegative().nullable(),capabilities:B(F()).readonly().optional(),features:B(F()).readonly().optional(),sourceInfo:im.optional(),children:B(om).readonly().optional()})),sm=V({discovered:B(om),lastDiscoveryAt:I().int().nonnegative().nullable(),lastError:F().nullable()}),cm={name:`device-discovery`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Hub],status:{schema:sm,kind:`poll`},runtimeState:sm.extend({lastFetchedAt:I().int().nonnegative()}),methods:{listDiscovered:J(V({deviceId:I().int().nonnegative()}),B(om).readonly()),refreshDiscovery:J(V({deviceId:I().int().nonnegative()}),B(om).readonly(),{kind:`mutation`,auth:`admin`}),adoptDevice:J(V({deviceId:I().int().nonnegative(),childNativeId:F(),name:F().optional()}),V({deviceId:I().int().nonnegative(),stableId:F()}),{kind:`mutation`,auth:`admin`}),releaseDevice:J(V({deviceId:I().int().nonnegative(),childDeviceId:I().int().nonnegative()}),z(),{kind:`mutation`,auth:`admin`})}},lm=V({lastPressedAt:I().nullable(),pressCountSinceStart:I()}),um=V({deviceId:I(),timestamp:I()}),dm={name:`doorbell`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Button],methods:{},events:{onPressed:{data:um}},status:{schema:lm,kind:`push`},runtimeState:lm},fm=W([`date`,`time`,`datetime`]),pm=V({value:F(),format:fm.optional(),lastFetchedAt:I()}),mm={name:`enum-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Sensor],methods:{},status:{schema:pm,kind:`push`},runtimeState:pm},hm=V({deviceId:I(),eventType:F(),data:U(F(),R()).nullable(),timestamp:I(),seq:I()}),gm=V({eventTypes:B(F()),lastEvent:hm.nullable(),eventCountSinceStart:I()}),_m={name:`event-emitter`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.EventEmitter],methods:{},events:{onEvent:{data:hm}},status:{schema:gm,kind:`push`},runtimeState:gm},vm=W([`forward`,`reverse`]),ym=V({percentage:I().min(0).max(100).nullable(),percentageStep:I().positive().optional(),preset:F(),availablePresets:B(F()),direction:vm.nullable(),oscillating:L().nullable(),lastChangedAt:I()}),bm={name:`fan-control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Fan],methods:{setPercentage:J(V({deviceId:I().int().nonnegative(),percentage:I().min(0).max(100)}),z(),{kind:`mutation`,auth:`admin`}),setPreset:J(V({deviceId:I().int().nonnegative(),preset:F().min(1)}),z(),{kind:`mutation`,auth:`admin`}),setDirection:J(V({deviceId:I().int().nonnegative(),direction:vm}),z(),{kind:`mutation`,auth:`admin`}),setOscillating:J(V({deviceId:I().int().nonnegative(),oscillating:L()}),z(),{kind:`mutation`,auth:`admin`})},status:{schema:ym,kind:`push`},runtimeState:ym},xm=V({flooded:L(),lastChangedAt:I()}),Sm={name:`flood`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Sensor],methods:{},status:{schema:xm,kind:`push`},runtimeState:xm},Cm=V({detected:L(),lastChangedAt:I()}),wm={name:`gas`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Sensor],methods:{},status:{schema:Cm,kind:`push`},runtimeState:Cm},Tm=V({on:L(),currentHumidity:I().min(0).max(100).nullable(),targetHumidity:I().min(0).max(100).nullable(),mode:F().nullable(),availableModes:B(F()),action:F().nullable(),minHumidity:I().nullable(),maxHumidity:I().nullable(),lastChangedAt:I()}),Em={name:`humidifier`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Humidifier],methods:{setOn:J(V({deviceId:I().int().nonnegative(),on:L()}),z(),{kind:`mutation`,auth:`admin`}),setTargetHumidity:J(V({deviceId:I().int().nonnegative(),humidity:I().min(0).max(100)}),z(),{kind:`mutation`,auth:`admin`}),setMode:J(V({deviceId:I().int().nonnegative(),mode:F().min(1)}),z(),{kind:`mutation`,auth:`admin`})},status:{schema:Tm,kind:`push`},runtimeState:Tm},Dm=V({percent:I().min(0).max(100),lastFetchedAt:I(),unit:F().optional(),precision:I().int().min(0).max(10).optional()}),Om={name:`humidity-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Sensor,K.Thermostat],methods:{},status:{schema:Dm,kind:`push`},runtimeState:Dm},km=V({url:F().nullable(),lastUpdated:I().nullable()}),Am={name:`image`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Image],methods:{},status:{schema:km,kind:`push`},runtimeState:km},jm=V({activity:W([`idle`,`mowing`,`paused`,`docked`,`error`]),batteryLevel:I().min(0).max(100).nullable(),lastChangedAt:I()}),Mm={name:`lawn-mower-control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.LawnMower],methods:{startMowing:J(V({deviceId:I().int().nonnegative()}),z(),{kind:`mutation`,auth:`admin`}),pause:J(V({deviceId:I().int().nonnegative()}),z(),{kind:`mutation`,auth:`admin`}),dock:J(V({deviceId:I().int().nonnegative()}),z(),{kind:`mutation`,auth:`admin`})},status:{schema:jm,kind:`push`},runtimeState:jm},Nm=V({state:W([`locked`,`unlocked`,`locking`,`unlocking`,`jammed`]),lastChangedAt:I()}),Pm={name:`lock-control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Lock],methods:{lock:J(V({deviceId:I().int().nonnegative(),code:F().min(1).optional()}),z(),{kind:`mutation`,auth:`admin`}),unlock:J(V({deviceId:I().int().nonnegative(),code:F().min(1).optional()}),z(),{kind:`mutation`,auth:`admin`}),open:J(V({deviceId:I().int().nonnegative()}),z(),{kind:`mutation`,auth:`admin`})},status:{schema:Nm,kind:`push`},runtimeState:Nm},Fm=W([`off`,`on`,`idle`,`playing`,`paused`,`buffering`,`standby`]),Im=W([`off`,`all`,`one`]),Lm=V({type:F(),title:F(),artist:F().optional(),album:F().optional(),imageUrl:F().optional()}),Rm=V({state:Fm,volumeLevel:I().min(0).max(100).nullable(),isMuted:L().nullable(),source:F(),availableSources:B(F()),currentMedia:Lm.nullable(),positionMs:I().int().nonnegative().nullable(),durationMs:I().int().nonnegative().nullable(),shuffle:L().nullable(),repeat:Im.nullable(),lastChangedAt:I()}),zm={name:`media-player`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.MediaPlayer],methods:{play:J(V({deviceId:I().int().nonnegative()}),z(),{kind:`mutation`,auth:`admin`}),pause:J(V({deviceId:I().int().nonnegative()}),z(),{kind:`mutation`,auth:`admin`}),stop:J(V({deviceId:I().int().nonnegative()}),z(),{kind:`mutation`,auth:`admin`}),next:J(V({deviceId:I().int().nonnegative()}),z(),{kind:`mutation`,auth:`admin`}),previous:J(V({deviceId:I().int().nonnegative()}),z(),{kind:`mutation`,auth:`admin`}),seek:J(V({deviceId:I().int().nonnegative(),positionMs:I().int().nonnegative()}),z(),{kind:`mutation`,auth:`admin`}),setVolume:J(V({deviceId:I().int().nonnegative(),volumeLevel:I().min(0).max(100)}),z(),{kind:`mutation`,auth:`admin`}),setMute:J(V({deviceId:I().int().nonnegative(),muted:L()}),z(),{kind:`mutation`,auth:`admin`}),setShuffle:J(V({deviceId:I().int().nonnegative(),shuffle:L()}),z(),{kind:`mutation`,auth:`admin`}),setRepeat:J(V({deviceId:I().int().nonnegative(),repeat:Im}),z(),{kind:`mutation`,auth:`admin`}),selectSource:J(V({deviceId:I().int().nonnegative(),source:F().min(1)}),z(),{kind:`mutation`,auth:`admin`}),playMedia:J(V({deviceId:I().int().nonnegative(),mediaId:F().min(1),mediaType:F().min(1)}),z(),{kind:`mutation`,auth:`admin`})},status:{schema:Rm,kind:`push`},runtimeState:Rm},Bm=W([`jpeg`,`rgb`,`bgr`,`yuv420`,`gray`]),Vm=V({data:Pd(),format:Bm,width:I(),height:I(),timestamp:I()}),Hm=V({x:I(),y:I(),w:I(),h:I()}),Um=V({class:F(),originalClass:F(),score:I(),bbox:Hm}),Wm=V({data:Ld(Uint8Array),sampleRate:I(),channels:I(),timestamp:I(),deviceId:I().optional()}),Gm=V({rms:I(),dbfs:I()}),Km=V({className:F(),originalClass:F().optional(),score:I()}),qm=V({bbox:Hm,pixelCount:I(),intensity:I()}),Jm=V({detected:L(),regionCount:I(),regions:B(qm).readonly(),rawRegions:B(qm).readonly(),frameWidth:I(),frameHeight:I(),analysisMs:I()}),Ym={name:`motion-detection`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,exposesDeviceSettings:!0,methods:{analyze:J(V({deviceId:I(),frame:Vm}),Jm,{kind:`mutation`}),removeCamera:J(V({deviceId:I()}),z(),{kind:`mutation`}),reset:J(z(),z(),{kind:`mutation`})},events:{onMotion:{data:V({deviceId:I(),detected:L(),regionCount:I()})}}};V({activeCameras:I(),throttledCameras:I(),avgInferenceTimeMs:I(),queueDepth:I()});var Xm=V({detectionMode:W([`disabled`,`always-on`,`on-motion`]),configuredFps:I(),actualFps:I(),queueDepth:I(),avgInferenceTimeMs:I(),droppedFrames:I(),phase:W([`idle`,`watching`,`active`])}),Zm=Xm.extend({deviceId:I()}),Qm=W([`onnx`,`coreml`,`openvino`,`tflite`,`pt`]),$m=W([`detector`,`cropper`,`classifier`,`refiner`,`audio-classifier`]),eh=V({runtime:W([`node`,`python`]),backend:F(),format:Qm,device:F().optional()}),th=V({engine:eh,devices:B(V({id:F(),label:F(),description:F().optional()})).readonly(),defaultDevice:F()}),nh=Md(()=>V({addonId:F(),addonName:F(),slot:$m,inputClasses:B(F()).readonly(),outputClasses:B(F()).readonly(),enabled:L(),modelId:F(),children:B(nh).readonly(),engine:eh.optional(),group:F().optional(),settings:U(F(),R()).optional()})),rh=Md(()=>V({addonId:F(),enabled:L(),modelId:F(),children:B(rh).readonly(),settings:U(F(),R()).optional()})),ih=V({id:F(),name:F(),createdAt:F(),updatedAt:F(),engine:eh,steps:B(rh).readonly()}),ah=V({id:F(),name:F(),formats:U(F(),V({downloaded:L(),sizeMB:I()}))}),oh=Pd(),sh=V({id:F(),name:F(),slot:$m,inputClasses:B(F()).readonly(),outputClasses:B(F()).readonly(),childSlots:B($m).readonly(),models:B(ah).readonly(),defaultModelId:F(),defaultModelIdByFormat:U(F(),F()).optional(),enabledByDefault:L().optional(),defaultConfidence:I(),group:F().optional(),configSchema:B(oh).readonly().optional()}),ch=V({id:$m,label:F(),priority:I(),parentSlot:$m.nullable(),addons:B(sh).readonly()}),lh=V({availableEngines:B(th).readonly(),selectedEngine:eh,slots:B(ch).readonly()}),uh=V({detections:B(Um).readonly(),inferenceMs:I(),modelId:F()}),dh=V({runtimeId:W([`onnx`,`openvino`,`coreml`]).nullable(),device:F().nullable(),state:W([`idle`,`installing`,`verifying`,`ready`,`failed`]),progress:I().optional(),error:F().optional(),nextRetryAt:I().optional()}),fh=Md(()=>V({addonId:F(),modelId:F(),enabled:L().default(!0),children:B(fh).optional(),settings:U(F(),R()).optional()})),ph=V({filename:F(),stepIds:B(F()).readonly().optional()}),mh=V({base64:F(),filename:F()}),hh=V({filename:F(),sizeKb:I()}),gh=V({base64:F()}),_h=V({id:F(),name:F(),description:F(),available:L(),rawLabels:B(F()).readonly().optional()}),vh=V({activeBackend:F(),availableBackends:B(_h).readonly(),sampleRate:I(),chunkDurationMs:I()}),yh=V({filePath:F(),sizeMB:I(),durationMs:I()}),bh=V({success:L(),error:F().optional(),frame:Pd().optional()}),xh=Pd(),Sh=Pd(),Ch=Pd(),wh=Pd(),Th=Pd(),Eh=Pd(),Dh={name:`pipeline-executor`,scope:`system`,mode:`singleton`,methods:{getAvailableEngines:J(z(),B(eh)),getSelectedEngine:J(z(),eh),getDefaultSteps:J(eh,B(nh)),reprobeEngine:J(z(),eh,{kind:`mutation`,auth:`admin`}),getEngineProvisioning:J(V({nodeId:F()}),dh),getVideoPipelineSteps:J(z(),U(F(),V({modelId:F(),settings:U(F(),R()).readonly()}))),setVideoPipelineSteps:J(V({steps:U(F(),V({modelId:F(),settings:U(F(),R()).readonly()}))}),V({success:G(!0)}),{kind:`mutation`,auth:`admin`}),getSchema:J(z(),lh),getGlobalSteps:J(z(),B(nh).readonly().nullable()),getGlobalPipelineConfig:J(z(),xh),getOrchestratorConfigSchema:J(z(),Sh),listTemplates:J(z(),B(ih).readonly()),saveTemplate:J(V({name:F(),steps:B(rh).readonly(),engine:eh}),ih,{kind:`mutation`}),updateTemplate:J(V({id:F(),name:F().optional(),steps:B(rh).readonly().optional()}),ih,{kind:`mutation`}),deleteTemplate:J(V({id:F()}),z(),{kind:`mutation`}),getCapabilities:J(z(),wh),getAddonModels:J(V({addonId:F()}),Th),downloadModel:J(V({addonId:F(),modelId:F(),format:Qm}),yh,{kind:`mutation`}),deleteModel:J(V({addonId:F(),modelId:F(),format:Qm}),V({success:G(!0)}),{kind:`mutation`}),detect:J(V({addonId:F(),frame:Vm,config:U(F(),R()).optional()}),uh),runPipeline:J(V({engine:eh.optional(),steps:B(fh).min(1),frame:Vm.optional(),imageBase64:F().optional(),image:Ld(Uint8Array).optional(),referenceImage:F().optional(),deviceId:I().optional(),sessionId:F().optional()}),Eh,{kind:`mutation`}),runPipelineBatch:J(V({engine:eh.optional(),steps:B(fh).min(1),frames:B(Vm).min(1).max(255),deviceId:I().optional(),sessionId:F().optional()}),V({results:B(Eh).readonly()}),{kind:`mutation`}),cacheFrameInPool:J(V({data:Ld(Uint8Array),width:I().int().positive(),height:I().int().positive(),format:W([`rgb`,`bgr`,`gray`])}),V({frameId:I(),width:I(),height:I()}),{kind:`mutation`}),inferCached:J(V({stepId:F(),frameId:I().int()}),U(F(),R()),{kind:`mutation`}),uncacheFrame:J(V({frameId:I().int()}),z(),{kind:`mutation`}),getEffectiveTuning:J(z(),V({batchMode:F(),windowMs:I(),maxBatchSize:I(),concurrency:I()})),listLoadedEngines:J(z(),B(V({engineKey:F(),engine:eh,modelsLoaded:B(F()).readonly(),inUseByCameras:B(I()).readonly(),kind:W([`runtime`,`warm-override`]),poolPid:I().nullable(),idleMs:I().nullable(),idleTtlMs:I().nullable()})).readonly()),spinEngine:J(V({engine:eh}),V({success:G(!0)}),{kind:`mutation`,auth:`admin`}),killEngine:J(V({engine:eh,force:L().optional()}),V({success:L(),reason:F().optional()}),{kind:`mutation`,auth:`admin`}),listReferenceImages:J(z(),B(ph).readonly()),getReferenceImage:J(V({filename:F()}),mh.nullable()),getReferenceAudioFiles:J(z(),B(hh).readonly()),getReferenceAudio:J(V({filename:F()}),gh.nullable()),getAudioCapabilities:J(z(),vh),runAudioTest:J(V({addonId:F(),modelId:F(),filename:F().optional(),settings:U(F(),R()).optional()}),bh,{kind:`mutation`}),getDetectionConfigSchema:J(z(),Ch)}},Oh=W([`polygon`,`tripwire`]),kh=V({x:I(),y:I()}),Ah=V({id:F(),name:F(),kind:Oh.default(`polygon`),polygon:B(kh).readonly(),color:F().default(`#3b82f6`)}),jh={name:`zones`,scope:`device`,mode:`singleton`,deviceTypes:[K.Camera],methods:{listZones:J(V({deviceId:I()}),B(Ah).readonly()),addZone:J(V({deviceId:I(),zone:Ah}),z(),{kind:`mutation`,auth:`admin`}),removeZone:J(V({deviceId:I(),zoneId:F()}),z(),{kind:`mutation`,auth:`admin`}),updateZone:J(V({deviceId:I(),zone:Ah}),z(),{kind:`mutation`,auth:`admin`})},runtimeState:V({zones:B(Ah).readonly()})},Mh={min:0,max:6e4,default:3e4,step:500},Nh={min:1,max:30,default:4,step:1},Ph={min:1,max:30,default:10,step:1},Fh={min:0,max:300,default:30,step:5},Ih={min:1,max:10,default:4,step:1},Lh=W([`onboard`,`analyzer`]),Rh=B(Lh),zh=V({deviceId:I(),detected:L(),source:Lh.default(`analyzer`),regions:B(qm).readonly().optional()}),Bh=V({deviceId:I(),detectionMode:W([`disabled`,`always-on`,`on-motion`]).default(`on-motion`),audioMode:W([`disabled`,`always-on`,`on-motion`]).default(`always-on`),motionCooldownMs:I().min(Mh.min).default(Mh.default),motionFps:I().min(Nh.min).max(Nh.max).default(Nh.default),detectionFps:I().min(Ph.min).max(Ph.max).default(Ph.default),motionStreamId:F(),detectionStreamId:F(),motionSources:Rh.default([`analyzer`]),pipelineEnabled:L().default(!0),engine:eh.optional(),steps:B(fh).readonly().optional(),audio:V({engine:eh,modelId:F(),enabled:L()}).nullable().optional(),zones:B(Ah).readonly().default([]),onboardMotionDrivesAnalyzer:L().default(!0),occupancyRecheckSec:I().min(Fh.min).max(Fh.max).default(Fh.default),occupancyRecheckFrames:I().min(Ih.min).max(Ih.max).default(Ih.default)});Nh.min,Nh.max,Nh.step,Nh.default,Ph.min,Ph.max,Ph.step,Ph.default,Mh.min,Mh.max,Mh.step,Mh.default,Fh.min,Fh.max,Fh.step,Fh.default,Ih.min,Ih.max,Ih.step,Ih.default;var Vh=V({nodeId:F(),attachedCameras:I(),activeCameras:I(),avgInferenceFps:I(),avgInferenceTimeMs:I(),queueDepthTotal:I(),hardware:V({hasGpu:L(),inferenceBackend:F().optional(),cpuCores:I().optional()})}),Hh=V({nodeId:F(),activeCameras:I(),throttledCameras:I(),avgInferenceTimeMs:I(),queueDepth:I()}),Uh={name:`pipeline-runner`,scope:`system`,mode:`singleton`,methods:{attachCamera:J(Bh,V({success:G(!0)}),{kind:`mutation`}),detachCamera:J(V({deviceId:I()}),V({success:G(!0)}),{kind:`mutation`}),reportMotion:J(zh,V({success:G(!0)}),{kind:`mutation`}),getLocalLoad:J(z(),Vh),getLocalMetrics:J(z(),Hh),getCameraMetrics:J(V({deviceId:I()}),Xm.nullable()),getAllCameraMetrics:J(z(),B(Zm).readonly()),getLocalCameras:J(z(),B(I()).readonly())}},Wh=V({detected:L(),lastDetectedAt:I().nullable(),autoClearAfterMs:I().nullable()}),Gh=V({deviceId:I(),detected:L(),timestamp:I(),source:Lh,regions:B(qm).readonly().optional()}),Kh={name:`motion`,scope:`device`,mode:`singleton`,deviceTypes:[K.Camera,K.Sensor],methods:{isDetected:J(V({deviceId:I()}),L())},events:{onMotionChanged:{data:Gh}},status:{schema:Wh,kind:`push`},runtimeState:Wh},qh=V({enabled:L(),lastChangedAt:I()}),Jh=qh.extend({lastFetchedAt:I()}),Yh={name:`motion-trigger`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Light,K.Siren,K.Switch],methods:{setMotionTrigger:J(V({deviceId:I().int().nonnegative(),enabled:L()}),z(),{kind:`mutation`,auth:`admin`})},events:{onMotionTriggerChanged:{data:V({deviceId:I(),enabled:L(),lastChangedAt:I()})}},status:{schema:qh,kind:`command-driven`},runtimeState:Jh},Xh=V({x:I(),y:I()}),Zh=V({kind:G(`rect`),x:I(),y:I(),width:I(),height:I()}),Qh=V({kind:G(`polygon`),points:B(Xh)}),$h=V({kind:G(`grid`),gridWidth:I(),gridHeight:I(),cells:B(L())});nd(`kind`,[Zh,Qh,$h,V({kind:G(`line`),points:B(Xh)})]);var eg=W([`rect`,`polygon`,`grid`,`line`]),tg=V({min:I(),max:I()}),ng=V({width:I(),height:I()}),rg=V({id:I(),enabled:L(),shape:$h}),ig=V({enabled:L(),sensitivity:I(),regions:B(rg),lastFetchedAt:I()}),ag=V({maxRegions:I(),supportedShapes:B(eg),grid:ng,sensitivity:V({min:I(),max:I(),step:I()})}),og=V({enabled:L().optional(),sensitivity:I().optional(),regions:B(rg).optional()}),sg={name:`motion-zones`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Camera],deviceConfig:{ui:{kind:`widget`,widgetId:`host/motion-zones-grid`,tab:`motion`,label:`Motion Zones`}},methods:{getOptions:J(V({deviceId:I()}),ag),setZone:J(V({deviceId:I(),patch:og}),z(),{kind:`mutation`,auth:`admin`})},status:{schema:ig,kind:`poll`},runtimeState:ig},cg=W([`person`,`vehicle`,`animal`,`face`,`package`,`other`]),lg=V({class:cg,timestamp:I(),confidence:I().min(0).max(1).optional()}),ug=V({lastByClass:cd(cg,lg.nullable()),supportedClasses:B(cg).readonly(),enabled:L()}),dg=ug.extend({lastFetchedAt:I()}),fg={name:`native-object-detection`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Camera],methods:{setEnabled:J(V({deviceId:I(),enabled:L()}),z(),{kind:`mutation`,auth:`admin`})},events:{onDetected:{data:V({deviceId:I(),detection:lg})}},status:{schema:ug,kind:`push`},runtimeState:dg},pg=W([`min`,`low`,`normal`,`high`]),mg=V({id:F().min(1),title:F().min(1),uri:Su().optional(),destructive:L().optional()}),hg=V({image:L(),priority:L(),data:L(),actions:L(),recipients:L()}),gg=V({lastSentAt:I(),lastError:F().nullable(),queueDepth:I().int().nonnegative(),supports:hg}),_g=V({deviceId:I().int().nonnegative(),title:F().optional(),body:F().min(1),image:F().optional(),priority:pg.optional(),channel:F().optional(),recipients:B(F()).optional(),actions:B(mg).optional(),data:U(F(),R()).optional()}),vg=V({notificationId:F(),acceptedAt:I()}),yg={name:`notifier`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Notifier],methods:{send:J(_g,vg,{kind:`mutation`,auth:`admin`}),cancel:J(V({deviceId:I().int().nonnegative(),notificationId:F().min(1)}),z(),{kind:`mutation`,auth:`admin`})},events:{onSent:{data:V({deviceId:I(),notificationId:F(),success:L(),error:F().nullable(),acceptedAt:I()})}},status:{schema:gg,kind:`command-driven`},runtimeState:gg},bg=V({value:I(),unit:F().optional(),precision:I().int().min(0).max(10).optional(),lastFetchedAt:I()}),xg={name:`numeric-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Sensor],methods:{},status:{schema:bg,kind:`push`},runtimeState:bg},Sg=V({watts:I().optional(),kwhTotal:I().optional(),volts:I().optional(),amps:I().optional(),va:I().optional(),powerFactor:I().min(0).max(1).optional(),lastFetchedAt:I(),unit:F().optional(),precision:I().int().min(0).max(10).optional()}),Cg={name:`power-meter`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Sensor],methods:{},status:{schema:Sg,kind:`push`},runtimeState:Sg},wg=V({latitude:I().min(-90).max(90),longitude:I().min(-180).max(180),accuracyMeters:I().nonnegative()}),Tg=V({state:F(),location:F().nullable(),gps:wg.nullable(),batteryPercent:I().min(0).max(100).nullable(),lastChangedAt:I()}),Eg={name:`presence`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Presence],methods:{},status:{schema:Tg,kind:`push`},runtimeState:Tg},Dg=V({hpa:I(),lastFetchedAt:I(),unit:F().optional(),precision:I().int().min(0).max(10).optional()}),Og={name:`pressure-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Sensor],methods:{},status:{schema:Dg,kind:`push`},runtimeState:Dg},kg=nd(`kind`,[Zh,Qh]),Ag=V({id:I(),enabled:L(),shape:kg}),jg=V({enabled:L(),regions:B(Ag),lastFetchedAt:I()}),Mg=V({maxRegions:I(),supportedShapes:B(eg),polygonVertices:tg.optional()}),Ng=V({enabled:L().optional(),regions:B(Ag).optional()}),Pg={name:`privacy-mask`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Camera],deviceConfig:{ui:{kind:`widget`,widgetId:`host/privacy-mask-grid`,tab:`image`,label:`Privacy Mask`}},methods:{getOptions:J(V({deviceId:I()}),Mg),setMask:J(V({deviceId:I(),patch:Ng}),z(),{kind:`mutation`,auth:`admin`})},status:{schema:jg,kind:`poll`},runtimeState:jg},Fg=V({targetType:F().describe(`Vendor target string (people/vehicle/pet); empty = camera default`),stopDelaySeconds:I().int().min(0).max(300),disappearDelaySeconds:I().int().min(0).max(300)}),Ig=V({value:F(),label:F()}),Lg=V({enabled:L(),lastChangedAt:I(),currentSettings:Fg.nullable(),supportedTargetTypes:B(Ig)}),Rg=Lg.extend({lastFetchedAt:I()}),zg={name:`ptz-autotrack`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Camera],deviceConfig:{ui:{kind:`widget`,widgetId:`host/ptz-autotrack`,tab:`ptz`,topTab:!0,label:`Auto-Tracking`,order:5}},methods:{getStatus:J(V({deviceId:I()}),Lg),setEnabled:J(V({deviceId:I(),enabled:L()}),z(),{kind:`mutation`}),getSettings:J(V({deviceId:I()}),Fg.nullable()),setSettings:J(V({deviceId:I(),settings:Fg.partial()}),z(),{kind:`mutation`})},events:{onStatusChanged:{data:V({deviceId:I(),status:Lg})}},status:{schema:Lg,kind:`command-driven`},runtimeState:Rg},Bg=V({isRunning:L(),lastRunAt:I(),lastRunSuccess:L().nullable(),lastError:F().nullable(),lastChangedAt:I()}),Vg={name:`script-runner`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Script],methods:{run:J(V({deviceId:I().int().nonnegative(),variables:U(F(),R()).optional()}),z(),{kind:`mutation`,auth:`admin`}),stop:J(V({deviceId:I().int().nonnegative()}),z(),{kind:`mutation`,auth:`admin`})},status:{schema:Bg,kind:`push`},runtimeState:Bg},Hg=V({detected:L(),lastChangedAt:I()}),Ug={name:`smoke`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Sensor],methods:{},status:{schema:Hg,kind:`push`},runtimeState:Hg},Wg=W([`main`,`sub`,`ext`]),Gg=V({width:I(),height:I(),codec:W([`h264`,`h265`]),framerate:I(),bitrate:I(),bitrateMode:W([`vbr`,`cbr`]).optional(),encoderProfile:W([`high`,`main`,`baseline`]).optional(),gop:I().optional(),audio:L().optional()}),Kg=V({main:Gg.optional(),sub:Gg.optional(),ext:Gg.optional(),lastFetchedAt:I()}),qg=V({resolutions:B(V({width:I(),height:I()})),codecs:B(W([`h264`,`h265`])),framerates:B(I()),bitrates:B(I()),bitrateRange:od([I(),I()]).optional(),supportsBitrateMode:L(),supportsEncoderProfile:L(),supportsGop:L(),gop:V({min:I(),max:I(),step:I()}).optional()}),Jg=V({main:qg.optional(),sub:qg.optional(),ext:qg.optional()}),Yg=V({width:I().optional(),height:I().optional(),codec:W([`h264`,`h265`]).optional(),framerate:I().optional(),bitrate:I().optional(),bitrateMode:W([`vbr`,`cbr`]).optional(),encoderProfile:W([`high`,`main`,`baseline`]).optional(),gop:I().optional(),audio:L().optional()}),Xg={name:`stream-params`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Camera],deviceConfig:{ui:{kind:`derived-form`,builderId:`stream-params`,tab:`streaming`}},methods:{getOptions:J(V({deviceId:I()}),Jg),setProfile:J(V({deviceId:I(),profile:Wg,patch:Yg}),z(),{kind:`mutation`,auth:`admin`}),getConfigSchema:J(V({deviceId:I()}),R().nullable())},status:{schema:Kg,kind:`poll`},runtimeState:Kg},Zg=V({on:L(),lastChangedAt:I()}),Qg={name:`switch`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Switch,K.Siren,K.Light],methods:{setState:J(V({deviceId:I(),on:L()}),z(),{kind:`mutation`,auth:`admin`})},events:{onStateChanged:{data:V({deviceId:I(),on:L(),lastChangedAt:I()})}},status:{schema:Zg,kind:`command-driven`},runtimeState:Zg,settings:{bindings:[{kind:`scalar`,statusPath:`on`,method:`setState`,valueArg:`on`,field:{label:`On`,kind:`boolean`}}]}},$g=V({tampered:L(),lastChangedAt:I()}),e_={name:`tamper`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Sensor],methods:{},status:{schema:$g,kind:`push`},runtimeState:$g},t_=V({celsius:I(),lastFetchedAt:I(),unit:F().optional(),precision:I().int().min(0).max(10).optional()}),n_={name:`temperature-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Sensor,K.Thermostat],methods:{},status:{schema:t_,kind:`push`},runtimeState:t_},r_=V({currentVersion:F().nullable(),availableVersion:F().nullable(),updatable:L(),state:F().nullable(),inProgress:L()}),i_={name:`update`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Update],methods:{installUpdate:J(z(),z(),{kind:`mutation`,auth:`admin`})},status:{schema:r_,kind:`poll`},runtimeState:r_},a_=W([`idle`,`cleaning`,`paused`,`returning`,`docked`,`error`]),o_=V({level:I().min(0).max(100).nullable(),status:W([`ok`,`low`,`full`]).nullable()}),s_=V({state:a_,batteryLevel:I().min(0).max(100).nullable(),fanSpeed:F().nullable(),availableFanSpeeds:B(F()),cleanWater:o_.nullable(),dirtyWater:o_.nullable(),detergent:o_.nullable(),dustBin:o_.nullable(),lastChangedAt:I()}),c_={name:`vacuum-control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Vacuum],methods:{start:J(V({deviceId:I().int().nonnegative()}),z(),{kind:`mutation`,auth:`admin`}),pause:J(V({deviceId:I().int().nonnegative()}),z(),{kind:`mutation`,auth:`admin`}),stop:J(V({deviceId:I().int().nonnegative()}),z(),{kind:`mutation`,auth:`admin`}),returnToBase:J(V({deviceId:I().int().nonnegative()}),z(),{kind:`mutation`,auth:`admin`}),locate:J(V({deviceId:I().int().nonnegative()}),z(),{kind:`mutation`,auth:`admin`}),setFanSpeed:J(V({deviceId:I().int().nonnegative(),speed:F().min(1)}),z(),{kind:`mutation`,auth:`admin`})},status:{schema:s_,kind:`push`},runtimeState:s_},l_=V({state:W([`open`,`opening`,`closing`,`closed`,`stopped`]),position:I().min(0).max(100).nullable(),lastChangedAt:I()}),u_={name:`valve`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Valve],methods:{open:J(V({deviceId:I().int().nonnegative()}),z(),{kind:`mutation`,auth:`admin`}),close:J(V({deviceId:I().int().nonnegative()}),z(),{kind:`mutation`,auth:`admin`}),stop:J(V({deviceId:I().int().nonnegative()}),z(),{kind:`mutation`,auth:`admin`}),setPosition:J(V({deviceId:I().int().nonnegative(),position:I().min(0).max(100)}),z(),{kind:`mutation`,auth:`admin`})},status:{schema:l_,kind:`push`},runtimeState:l_},d_=V({detected:L(),lastChangedAt:I()}),f_={name:`vibration`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Sensor],methods:{},status:{schema:d_,kind:`push`},runtimeState:d_},p_=V({currentTemp:I().nullable(),targetTemp:I().nullable(),operationMode:F().nullable(),availableModes:B(F()),away:L().nullable(),minTemp:I().nullable(),maxTemp:I().nullable(),lastChangedAt:I()}),m_={name:`water-heater`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.WaterHeater],methods:{setTargetTemp:J(V({deviceId:I().int().nonnegative(),temp:I().finite()}),z(),{kind:`mutation`,auth:`admin`}),setOperationMode:J(V({deviceId:I().int().nonnegative(),mode:F().min(1)}),z(),{kind:`mutation`,auth:`admin`}),setAway:J(V({deviceId:I().int().nonnegative(),on:L()}),z(),{kind:`mutation`,auth:`admin`})},status:{schema:p_,kind:`push`},runtimeState:p_},h_=V({condition:F().nullable(),temperature:I().nullable(),temperatureUnit:F().nullable(),humidity:I().min(0).max(100).nullable(),pressure:I().nullable(),pressureUnit:F().nullable(),windSpeed:I().nullable(),windSpeedUnit:F().nullable(),windBearing:I().nullable(),lastFetchedAt:I()}),g_={name:`weather`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Weather],methods:{},status:{schema:h_,kind:`push`},runtimeState:h_},__=V({totalObjects:I().int().nonnegative(),byClass:U(F(),I().int().nonnegative())}),v_=__.extend({zoneId:F(),zoneName:F(),trackIds:B(F()).readonly()}),y_=V({ts:I().int(),frameWidth:I().int().nonnegative(),frameHeight:I().int().nonnegative(),zones:B(v_).readonly(),frame:__,unzoned:__}),b_=W([`minute`,`5min`,`hour`]),x_=V({from:I().int(),to:I().int(),resolution:b_}),S_=V({ts:I().int(),count:I().int().nonnegative()}),C_={name:`zone-analytics`,scope:`device`,mode:`singleton`,deviceTypes:[K.Camera],methods:{getCurrentSnapshot:J(V({deviceId:I()}),y_.nullable()),getZoneHistory:J(V({deviceId:I(),zoneId:F(),className:F().optional()}).extend(x_.shape),B(S_).readonly()),getCameraHistory:J(V({deviceId:I(),className:F().optional()}).extend(x_.shape),B(S_).readonly()),getUnzonedHistory:J(V({deviceId:I(),className:F().optional()}).extend(x_.shape),B(S_).readonly())},runtimeState:y_},w_=W([`include`,`exclude`]),T_=V({id:F(),name:F().optional(),zoneIds:B(F()).min(1).readonly(),mode:w_,classFilter:B(F()).readonly().optional(),overlapThreshold:I().min(0).max(1).optional(),bboxInclusionPct:I().min(0).max(100).optional(),preferMask:L().optional(),enabled:L().default(!0)});B(T_).readonly();var E_=W([`motion`,`detection`]),D_={name:`zone-rules`,scope:`device`,mode:`singleton`,deviceTypes:[K.Camera],methods:{listRules:J(V({deviceId:I(),stage:E_}),B(T_).readonly()),setRules:J(V({deviceId:I(),stage:E_,rules:B(T_).readonly()}),z(),{kind:`mutation`,auth:`admin`})},runtimeState:V({motion:B(T_).readonly(),detection:B(T_).readonly()})},O_=V({connected:L(),deviceCount:I(),error:F().optional()});V({externalId:F(),name:F(),type:F(),metadata:U(F(),R()).optional()});var k_=V({stableId:F(),type:W(K),suggestedName:F(),prefilledConfig:U(F(),R()),sourceInfo:im.optional()}),A_=V({id:I(),stableId:F(),addonId:F(),type:F(),name:F(),parentDeviceId:I().nullable(),online:L(),features:B(F()),config:U(F(),R()),sourceInfo:im.optional()}),j_=V({status:W([`ok`,`error`]),labels:B(F()).optional(),error:F().optional()}),M_=R(),N_={name:`device-provider`,scope:`system`,mode:`collection`,methods:{start:J(z(),z(),{kind:`mutation`}),stop:J(z(),z(),{kind:`mutation`}),getStatus:J(z(),O_),getDevices:J(z(),B(V({id:F(),name:F(),type:F()}))),supportsDiscovery:J(V({}),L()),discoverDevices:J(V({}),B(k_),{kind:`mutation`,auth:`admin`}),adoptDiscoveredDevice:J(V({candidate:k_}),A_,{kind:`mutation`,auth:`admin`}),supportsManualCreation:J(V({}),L()),getChildCreationSchema:J(V({type:W(K)}),M_),createDevice:J(V({type:W(K),config:U(F(),R())}),A_,{kind:`mutation`,auth:`admin`}),testCreationField:J(V({type:W(K),key:F(),value:R(),formValues:U(F(),R()).optional()}),j_,{kind:`mutation`,auth:`admin`})}};function P_(e){let t=e;function n(e,n,r,a,o){let s=t[e]?.[n];if(!s)throw Error(`SystemProxy: api has no '${e}.${n}'`);let c=s;return r===`mutation`?c.mutate(a):r===`subscription`?c.subscribe(a,o):c.query(a)}return{addonPages:{listPages:e=>n(`addonPages`,`listPages`,`query`,e)},addons:{list:e=>n(`addons`,`list`,`query`,e),getLogs:e=>n(`addons`,`getLogs`,`query`,e),listPackages:e=>n(`addons`,`listPackages`,`query`,e),installPackage:e=>n(`addons`,`installPackage`,`mutation`,e),installFromWorkspace:e=>n(`addons`,`installFromWorkspace`,`mutation`,e),isWorkspaceAvailable:e=>n(`addons`,`isWorkspaceAvailable`,`query`,e),listWorkspacePackages:e=>n(`addons`,`listWorkspacePackages`,`query`,e),uninstallPackage:e=>n(`addons`,`uninstallPackage`,`mutation`,e),reloadPackages:e=>n(`addons`,`reloadPackages`,`mutation`,e),searchAvailable:e=>n(`addons`,`searchAvailable`,`query`,e),listUpdates:e=>n(`addons`,`listUpdates`,`query`,e),updatePackage:e=>n(`addons`,`updatePackage`,`mutation`,e),rollbackPackage:e=>n(`addons`,`rollbackPackage`,`mutation`,e),forceRefresh:e=>n(`addons`,`forceRefresh`,`mutation`,e),restartServer:e=>n(`addons`,`restartServer`,`mutation`,e),getLastRestart:e=>n(`addons`,`getLastRestart`,`query`,e),listFrameworkPackages:e=>n(`addons`,`listFrameworkPackages`,`query`,e),listCapabilityProviders:e=>n(`addons`,`listCapabilityProviders`,`query`,e),setCapabilityProviderEnabled:e=>n(`addons`,`setCapabilityProviderEnabled`,`mutation`,e),updateFrameworkPackage:e=>n(`addons`,`updateFrameworkPackage`,`mutation`,e),getVersions:e=>n(`addons`,`getVersions`,`query`,e),restartAddon:e=>n(`addons`,`restartAddon`,`mutation`,e),retryLoad:e=>n(`addons`,`retryLoad`,`mutation`,e),getAutoUpdateSettings:e=>n(`addons`,`getAutoUpdateSettings`,`query`,e),setAutoUpdateSettings:e=>n(`addons`,`setAutoUpdateSettings`,`mutation`,e),getAddonAutoUpdate:e=>n(`addons`,`getAddonAutoUpdate`,`query`,e),setAddonAutoUpdate:e=>n(`addons`,`setAddonAutoUpdate`,`mutation`,e),applyAutoUpdateToAll:e=>n(`addons`,`applyAutoUpdateToAll`,`mutation`,e),custom:e=>n(`addons`,`custom`,`mutation`,e),startJob:e=>n(`addons`,`startJob`,`mutation`,e),getJob:e=>n(`addons`,`getJob`,`query`,e),listJobs:e=>n(`addons`,`listJobs`,`query`,e),cancelJob:e=>n(`addons`,`cancelJob`,`mutation`,e),onAddonLogs:(e,t)=>n(`addons`,`onAddonLogs`,`subscription`,e,t)},addonSettings:{getGlobalSettings:e=>n(`addonSettings`,`getGlobalSettings`,`query`,e),updateGlobalSettings:e=>n(`addonSettings`,`updateGlobalSettings`,`mutation`,e)},addonWidgets:{listWidgets:e=>n(`addonWidgets`,`listWidgets`,`query`,e)},alerts:{emit:e=>n(`alerts`,`emit`,`mutation`,e),update:e=>n(`alerts`,`update`,`mutation`,e),list:e=>n(`alerts`,`list`,`query`,e),getUnreadCount:e=>n(`alerts`,`getUnreadCount`,`query`,e),markRead:e=>n(`alerts`,`markRead`,`mutation`,e),markAllRead:e=>n(`alerts`,`markAllRead`,`mutation`,e),dismiss:e=>n(`alerts`,`dismiss`,`mutation`,e)},audioAnalyzer:{analyseChunk:e=>n(`audioAnalyzer`,`analyseChunk`,`mutation`,e),classify:e=>n(`audioAnalyzer`,`classify`,`query`,e),isReady:e=>n(`audioAnalyzer`,`isReady`,`query`,e),dispose:e=>n(`audioAnalyzer`,`dispose`,`mutation`,e),reprobeAudioEngine:e=>n(`audioAnalyzer`,`reprobeAudioEngine`,`mutation`,e)},audioCodec:{listSupportedCodecs:e=>n(`audioCodec`,`listSupportedCodecs`,`query`,e),canHandle:e=>n(`audioCodec`,`canHandle`,`query`,e),createDecodeSession:e=>n(`audioCodec`,`createDecodeSession`,`mutation`,e),createEncodeSession:e=>n(`audioCodec`,`createEncodeSession`,`mutation`,e),closeSession:e=>n(`audioCodec`,`closeSession`,`mutation`,e),pushEncodedFrame:e=>n(`audioCodec`,`pushEncodedFrame`,`mutation`,e),pullPcm:e=>n(`audioCodec`,`pullPcm`,`query`,e),pushPcm:e=>n(`audioCodec`,`pushPcm`,`mutation`,e),pullEncoded:e=>n(`audioCodec`,`pullEncoded`,`query`,e),flushEncode:e=>n(`audioCodec`,`flushEncode`,`mutation`,e),listActiveSessions:e=>n(`audioCodec`,`listActiveSessions`,`query`,e)},backup:{listDestinations:e=>n(`backup`,`listDestinations`,`query`,e),trigger:e=>n(`backup`,`trigger`,`mutation`,e),list:e=>n(`backup`,`list`,`query`,e),listLocations:e=>n(`backup`,`listLocations`,`query`,e),getEntries:e=>n(`backup`,`getEntries`,`query`,e),restore:e=>n(`backup`,`restore`,`mutation`,e),delete:e=>n(`backup`,`delete`,`mutation`,e),listArchives:e=>n(`backup`,`listArchives`,`query`,e),upsertDestinationPolicy:e=>n(`backup`,`upsertDestinationPolicy`,`mutation`,e),previewSchedule:e=>n(`backup`,`previewSchedule`,`query`,e)},broker:{list:e=>n(`broker`,`list`,`query`,e),get:e=>n(`broker`,`get`,`query`,e),listProviders:e=>n(`broker`,`listProviders`,`query`,e),add:e=>n(`broker`,`add`,`mutation`,e),remove:e=>n(`broker`,`remove`,`mutation`,e),testConnection:e=>n(`broker`,`testConnection`,`mutation`,e),getSettings:e=>n(`broker`,`getSettings`,`query`,e),setSettings:e=>n(`broker`,`setSettings`,`mutation`,e),getBrokerConfig:e=>n(`broker`,`getBrokerConfig`,`query`,e),getSettingsSchema:e=>n(`broker`,`getSettingsSchema`,`query`,e),testSettings:e=>n(`broker`,`testSettings`,`mutation`,e),publish:e=>n(`broker`,`publish`,`mutation`,e),subscribe:e=>n(`broker`,`subscribe`,`mutation`,e),unsubscribe:e=>n(`broker`,`unsubscribe`,`mutation`,e),getState:e=>n(`broker`,`getState`,`query`,e),getStatus:e=>n(`broker`,`getStatus`,`query`,e)},decoder:{supportsCodec:e=>n(`decoder`,`supportsCodec`,`query`,e),getInfo:e=>n(`decoder`,`getInfo`,`query`,e),createSession:e=>n(`decoder`,`createSession`,`query`,e),destroySession:e=>n(`decoder`,`destroySession`,`query`,e),pushPacket:e=>n(`decoder`,`pushPacket`,`query`,e),openStream:e=>n(`decoder`,`openStream`,`query`,e),pullFrames:e=>n(`decoder`,`pullFrames`,`query`,e),pullHandles:e=>n(`decoder`,`pullHandles`,`query`,e),getFrame:e=>n(`decoder`,`getFrame`,`query`,e),getShmStats:e=>n(`decoder`,`getShmStats`,`query`,e),updateConfig:e=>n(`decoder`,`updateConfig`,`query`,e),getStats:e=>n(`decoder`,`getStats`,`query`,e),listActiveSessions:e=>n(`decoder`,`listActiveSessions`,`query`,e),reprobeHwaccel:e=>n(`decoder`,`reprobeHwaccel`,`mutation`,e)},deviceAdoption:{listCandidateFilters:e=>n(`deviceAdoption`,`listCandidateFilters`,`query`,e),listCandidates:e=>n(`deviceAdoption`,`listCandidates`,`query`,e),getCandidate:e=>n(`deviceAdoption`,`getCandidate`,`query`,e),refresh:e=>n(`deviceAdoption`,`refresh`,`mutation`,e),adopt:e=>n(`deviceAdoption`,`adopt`,`mutation`,e),release:e=>n(`deviceAdoption`,`release`,`mutation`,e),resync:e=>n(`deviceAdoption`,`resync`,`mutation`,e)},deviceExport:{getStatus:e=>n(`deviceExport`,`getStatus`,`query`,e),listSupportedDeviceKinds:e=>n(`deviceExport`,`listSupportedDeviceKinds`,`query`,e),listExposedDevices:e=>n(`deviceExport`,`listExposedDevices`,`query`,e),exposeDevice:e=>n(`deviceExport`,`exposeDevice`,`mutation`,e),unexposeDevice:e=>n(`deviceExport`,`unexposeDevice`,`mutation`,e)},deviceManager:{allocateDeviceId:e=>n(`deviceManager`,`allocateDeviceId`,`mutation`,e),registerDevice:e=>n(`deviceManager`,`registerDevice`,`mutation`,e),removeDevice:e=>n(`deviceManager`,`removeDevice`,`mutation`,e),persistConfig:e=>n(`deviceManager`,`persistConfig`,`mutation`,e),listLocations:e=>n(`deviceManager`,`listLocations`,`query`,e),addLocation:e=>n(`deviceManager`,`addLocation`,`mutation`,e),removeLocation:e=>n(`deviceManager`,`removeLocation`,`mutation`,e),listPersistedByAddon:e=>n(`deviceManager`,`listPersistedByAddon`,`query`,e),listAll:e=>n(`deviceManager`,`listAll`,`query`,e),getChildren:e=>n(`deviceManager`,`getChildren`,`query`,e),removeByIntegration:e=>n(`deviceManager`,`removeByIntegration`,`mutation`,e),listWrappersForCap:e=>n(`deviceManager`,`listWrappersForCap`,`query`,e),listBindableCapsForDeviceType:e=>n(`deviceManager`,`listBindableCapsForDeviceType`,`query`,e),discoverDevices:e=>n(`deviceManager`,`discoverDevices`,`mutation`,e),adoptDevice:e=>n(`deviceManager`,`adoptDevice`,`mutation`,e),getCreationSchema:e=>n(`deviceManager`,`getCreationSchema`,`query`,e),createDevice:e=>n(`deviceManager`,`createDevice`,`mutation`,e),testCreationField:e=>n(`deviceManager`,`testCreationField`,`mutation`,e),adoptionListCandidates:e=>n(`deviceManager`,`adoptionListCandidates`,`query`,e),adoptionRefresh:e=>n(`deviceManager`,`adoptionRefresh`,`mutation`,e),adoptionAdopt:e=>n(`deviceManager`,`adoptionAdopt`,`mutation`,e),adoptionRelease:e=>n(`deviceManager`,`adoptionRelease`,`mutation`,e)},deviceProvider:{start:e=>n(`deviceProvider`,`start`,`mutation`,e),stop:e=>n(`deviceProvider`,`stop`,`mutation`,e),getStatus:e=>n(`deviceProvider`,`getStatus`,`query`,e),getDevices:e=>n(`deviceProvider`,`getDevices`,`query`,e),supportsDiscovery:e=>n(`deviceProvider`,`supportsDiscovery`,`query`,e),discoverDevices:e=>n(`deviceProvider`,`discoverDevices`,`mutation`,e),adoptDiscoveredDevice:e=>n(`deviceProvider`,`adoptDiscoveredDevice`,`mutation`,e),supportsManualCreation:e=>n(`deviceProvider`,`supportsManualCreation`,`query`,e),getChildCreationSchema:e=>n(`deviceProvider`,`getChildCreationSchema`,`query`,e),createDevice:e=>n(`deviceProvider`,`createDevice`,`mutation`,e),testCreationField:e=>n(`deviceProvider`,`testCreationField`,`mutation`,e)},deviceState:{getAllSnapshots:e=>n(`deviceState`,`getAllSnapshots`,`query`,e)},faceGallery:{listIdentities:e=>n(`faceGallery`,`listIdentities`,`query`,e),createIdentity:e=>n(`faceGallery`,`createIdentity`,`mutation`,e),renameIdentity:e=>n(`faceGallery`,`renameIdentity`,`mutation`,e),deleteIdentity:e=>n(`faceGallery`,`deleteIdentity`,`mutation`,e),listIdentitySamples:e=>n(`faceGallery`,`listIdentitySamples`,`query`,e),removeSample:e=>n(`faceGallery`,`removeSample`,`mutation`,e),listRecentFaces:e=>n(`faceGallery`,`listRecentFaces`,`query`,e),getFaceMedia:e=>n(`faceGallery`,`getFaceMedia`,`query`,e),assignFace:e=>n(`faceGallery`,`assignFace`,`mutation`,e),unassignFace:e=>n(`faceGallery`,`unassignFace`,`mutation`,e),deleteFace:e=>n(`faceGallery`,`deleteFace`,`mutation`,e),assignFaces:e=>n(`faceGallery`,`assignFaces`,`mutation`,e),unassignFaces:e=>n(`faceGallery`,`unassignFaces`,`mutation`,e),suggestFaceClusters:e=>n(`faceGallery`,`suggestFaceClusters`,`query`,e)},integrations:{list:e=>n(`integrations`,`list`,`query`,e),get:e=>n(`integrations`,`get`,`query`,e),getByAddonId:e=>n(`integrations`,`getByAddonId`,`query`,e),create:e=>n(`integrations`,`create`,`mutation`,e),update:e=>n(`integrations`,`update`,`mutation`,e),delete:e=>n(`integrations`,`delete`,`mutation`,e),getSettings:e=>n(`integrations`,`getSettings`,`query`,e),setSettings:e=>n(`integrations`,`setSettings`,`mutation`,e),getAvailableTypes:e=>n(`integrations`,`getAvailableTypes`,`query`,e),testConnection:e=>n(`integrations`,`testConnection`,`mutation`,e)},localNetwork:{list:e=>n(`localNetwork`,`list`,`query`,e),getPreferred:e=>n(`localNetwork`,`getPreferred`,`query`,e),getConnectionEndpoints:e=>n(`localNetwork`,`getConnectionEndpoints`,`query`,e),getAllowedAddresses:e=>n(`localNetwork`,`getAllowedAddresses`,`query`,e),setAllowedAddresses:e=>n(`localNetwork`,`setAllowedAddresses`,`mutation`,e),resetAllowlistToBestMatch:e=>n(`localNetwork`,`resetAllowlistToBestMatch`,`mutation`,e)},meshNetwork:{getStatus:e=>n(`meshNetwork`,`getStatus`,`query`,e),join:e=>n(`meshNetwork`,`join`,`mutation`,e),startLogin:e=>n(`meshNetwork`,`startLogin`,`mutation`,e),leave:e=>n(`meshNetwork`,`leave`,`mutation`,e),logout:e=>n(`meshNetwork`,`logout`,`mutation`,e),listPeers:e=>n(`meshNetwork`,`listPeers`,`query`,e),testConnection:e=>n(`meshNetwork`,`testConnection`,`mutation`,e)},metricsProvider:{collectSnapshot:e=>n(`metricsProvider`,`collectSnapshot`,`query`,e),getCached:e=>n(`metricsProvider`,`getCached`,`query`,e),getCurrent:e=>n(`metricsProvider`,`getCurrent`,`query`,e),getDiskSpace:e=>n(`metricsProvider`,`getDiskSpace`,`query`,e),getGpuInfo:e=>n(`metricsProvider`,`getGpuInfo`,`query`,e),getCpuTemperature:e=>n(`metricsProvider`,`getCpuTemperature`,`query`,e),getProcessStats:e=>n(`metricsProvider`,`getProcessStats`,`query`,e),listAddonInstances:e=>n(`metricsProvider`,`listAddonInstances`,`query`,e),getAddonStats:e=>n(`metricsProvider`,`getAddonStats`,`query`,e),listNodeProcesses:e=>n(`metricsProvider`,`listNodeProcesses`,`query`,e),killProcess:e=>n(`metricsProvider`,`killProcess`,`mutation`,e),dumpHeapSnapshot:e=>n(`metricsProvider`,`dumpHeapSnapshot`,`mutation`,e)},mqttBroker:{listBrokers:e=>n(`mqttBroker`,`listBrokers`,`query`,e),getBrokerConfig:e=>n(`mqttBroker`,`getBrokerConfig`,`query`,e),addBroker:e=>n(`mqttBroker`,`addBroker`,`mutation`,e),removeBroker:e=>n(`mqttBroker`,`removeBroker`,`mutation`,e),testConnection:e=>n(`mqttBroker`,`testConnection`,`mutation`,e),startEmbeddedBroker:e=>n(`mqttBroker`,`startEmbeddedBroker`,`mutation`,e),stopEmbeddedBroker:e=>n(`mqttBroker`,`stopEmbeddedBroker`,`mutation`,e),getStatus:e=>n(`mqttBroker`,`getStatus`,`query`,e)},networkAccess:{start:e=>n(`networkAccess`,`start`,`mutation`,e),stop:e=>n(`networkAccess`,`stop`,`mutation`,e),getEndpoint:e=>n(`networkAccess`,`getEndpoint`,`query`,e),getStatus:e=>n(`networkAccess`,`getStatus`,`query`,e),listEndpoints:e=>n(`networkAccess`,`listEndpoints`,`query`,e)},networkQuality:{getAllStats:e=>n(`networkQuality`,`getAllStats`,`query`,e)},nodes:{topology:e=>n(`nodes`,`topology`,`query`,e),deployAddon:e=>n(`nodes`,`deployAddon`,`mutation`,e),undeployAddon:e=>n(`nodes`,`undeployAddon`,`mutation`,e),restartAddon:e=>n(`nodes`,`restartAddon`,`mutation`,e),restartProcess:e=>n(`nodes`,`restartProcess`,`mutation`,e),restartNode:e=>n(`nodes`,`restartNode`,`mutation`,e),shutdownNode:e=>n(`nodes`,`shutdownNode`,`mutation`,e),renameNode:e=>n(`nodes`,`renameNode`,`mutation`,e),clusterAddonStatus:e=>n(`nodes`,`clusterAddonStatus`,`query`,e),getCapUsageGraph:e=>n(`nodes`,`getCapUsageGraph`,`query`,e),getNodeAddons:e=>n(`nodes`,`getNodeAddons`,`query`,e),setProcessLogLevel:e=>n(`nodes`,`setProcessLogLevel`,`mutation`,e),executeQuery:e=>n(`nodes`,`executeQuery`,`mutation`,e)},notificationOutput:{send:e=>n(`notificationOutput`,`send`,`mutation`,e),sendTest:e=>n(`notificationOutput`,`sendTest`,`mutation`,e)},pipelineExecutor:{getAvailableEngines:e=>n(`pipelineExecutor`,`getAvailableEngines`,`query`,e),getSelectedEngine:e=>n(`pipelineExecutor`,`getSelectedEngine`,`query`,e),getDefaultSteps:e=>n(`pipelineExecutor`,`getDefaultSteps`,`query`,e),reprobeEngine:e=>n(`pipelineExecutor`,`reprobeEngine`,`mutation`,e),getEngineProvisioning:e=>n(`pipelineExecutor`,`getEngineProvisioning`,`query`,e),getVideoPipelineSteps:e=>n(`pipelineExecutor`,`getVideoPipelineSteps`,`query`,e),setVideoPipelineSteps:e=>n(`pipelineExecutor`,`setVideoPipelineSteps`,`mutation`,e),getSchema:e=>n(`pipelineExecutor`,`getSchema`,`query`,e),getGlobalSteps:e=>n(`pipelineExecutor`,`getGlobalSteps`,`query`,e),getGlobalPipelineConfig:e=>n(`pipelineExecutor`,`getGlobalPipelineConfig`,`query`,e),getOrchestratorConfigSchema:e=>n(`pipelineExecutor`,`getOrchestratorConfigSchema`,`query`,e),listTemplates:e=>n(`pipelineExecutor`,`listTemplates`,`query`,e),saveTemplate:e=>n(`pipelineExecutor`,`saveTemplate`,`mutation`,e),updateTemplate:e=>n(`pipelineExecutor`,`updateTemplate`,`mutation`,e),deleteTemplate:e=>n(`pipelineExecutor`,`deleteTemplate`,`mutation`,e),getCapabilities:e=>n(`pipelineExecutor`,`getCapabilities`,`query`,e),getAddonModels:e=>n(`pipelineExecutor`,`getAddonModels`,`query`,e),downloadModel:e=>n(`pipelineExecutor`,`downloadModel`,`mutation`,e),deleteModel:e=>n(`pipelineExecutor`,`deleteModel`,`mutation`,e),detect:e=>n(`pipelineExecutor`,`detect`,`query`,e),cacheFrameInPool:e=>n(`pipelineExecutor`,`cacheFrameInPool`,`mutation`,e),inferCached:e=>n(`pipelineExecutor`,`inferCached`,`mutation`,e),uncacheFrame:e=>n(`pipelineExecutor`,`uncacheFrame`,`mutation`,e),getEffectiveTuning:e=>n(`pipelineExecutor`,`getEffectiveTuning`,`query`,e),listLoadedEngines:e=>n(`pipelineExecutor`,`listLoadedEngines`,`query`,e),spinEngine:e=>n(`pipelineExecutor`,`spinEngine`,`mutation`,e),killEngine:e=>n(`pipelineExecutor`,`killEngine`,`mutation`,e),listReferenceImages:e=>n(`pipelineExecutor`,`listReferenceImages`,`query`,e),getReferenceImage:e=>n(`pipelineExecutor`,`getReferenceImage`,`query`,e),getReferenceAudioFiles:e=>n(`pipelineExecutor`,`getReferenceAudioFiles`,`query`,e),getReferenceAudio:e=>n(`pipelineExecutor`,`getReferenceAudio`,`query`,e),getAudioCapabilities:e=>n(`pipelineExecutor`,`getAudioCapabilities`,`query`,e),runAudioTest:e=>n(`pipelineExecutor`,`runAudioTest`,`mutation`,e),getDetectionConfigSchema:e=>n(`pipelineExecutor`,`getDetectionConfigSchema`,`query`,e)},pipelineOrchestrator:{rebalance:e=>n(`pipelineOrchestrator`,`rebalance`,`mutation`,e),getPipelineAssignments:e=>n(`pipelineOrchestrator`,`getPipelineAssignments`,`query`,e),getAgentLoad:e=>n(`pipelineOrchestrator`,`getAgentLoad`,`query`,e),getGlobalMetrics:e=>n(`pipelineOrchestrator`,`getGlobalMetrics`,`query`,e),getCapabilityBindings:e=>n(`pipelineOrchestrator`,`getCapabilityBindings`,`query`,e),setCapabilityBinding:e=>n(`pipelineOrchestrator`,`setCapabilityBinding`,`mutation`,e),getDecoderAssignments:e=>n(`pipelineOrchestrator`,`getDecoderAssignments`,`query`,e),getAudioNodeLoad:e=>n(`pipelineOrchestrator`,`getAudioNodeLoad`,`query`,e),getAgentSettings:e=>n(`pipelineOrchestrator`,`getAgentSettings`,`query`,e),listAgentSettings:e=>n(`pipelineOrchestrator`,`listAgentSettings`,`query`,e),setAgentAddonDefaults:e=>n(`pipelineOrchestrator`,`setAgentAddonDefaults`,`mutation`,e),removeAgentSettings:e=>n(`pipelineOrchestrator`,`removeAgentSettings`,`mutation`,e),setAgentMaxCameras:e=>n(`pipelineOrchestrator`,`setAgentMaxCameras`,`mutation`,e),getCameraStatuses:e=>n(`pipelineOrchestrator`,`getCameraStatuses`,`query`,e),listTemplates:e=>n(`pipelineOrchestrator`,`listTemplates`,`query`,e),saveTemplate:e=>n(`pipelineOrchestrator`,`saveTemplate`,`mutation`,e),updateTemplate:e=>n(`pipelineOrchestrator`,`updateTemplate`,`mutation`,e),deleteTemplate:e=>n(`pipelineOrchestrator`,`deleteTemplate`,`mutation`,e)},pipelineRunner:{attachCamera:e=>n(`pipelineRunner`,`attachCamera`,`mutation`,e),reportMotion:e=>n(`pipelineRunner`,`reportMotion`,`mutation`,e),getLocalLoad:e=>n(`pipelineRunner`,`getLocalLoad`,`query`,e),getLocalMetrics:e=>n(`pipelineRunner`,`getLocalMetrics`,`query`,e),getAllCameraMetrics:e=>n(`pipelineRunner`,`getAllCameraMetrics`,`query`,e),getLocalCameras:e=>n(`pipelineRunner`,`getLocalCameras`,`query`,e)},plateGallery:{getPlateMedia:e=>n(`plateGallery`,`getPlateMedia`,`query`,e),searchPlates:e=>n(`plateGallery`,`searchPlates`,`query`,e),suggestPlateClusters:e=>n(`plateGallery`,`suggestPlateClusters`,`query`,e),correctPlateText:e=>n(`plateGallery`,`correctPlateText`,`mutation`,e),deletePlate:e=>n(`plateGallery`,`deletePlate`,`mutation`,e)},recording:{getStorageUsage:e=>n(`recording`,`getStorageUsage`,`query`,e)},settingsStore:{get:e=>n(`settingsStore`,`get`,`query`,e),set:e=>n(`settingsStore`,`set`,`mutation`,e),query:e=>n(`settingsStore`,`query`,`query`,e),insert:e=>n(`settingsStore`,`insert`,`mutation`,e),update:e=>n(`settingsStore`,`update`,`mutation`,e),delete:e=>n(`settingsStore`,`delete`,`mutation`,e),count:e=>n(`settingsStore`,`count`,`query`,e),histogram:e=>n(`settingsStore`,`histogram`,`query`,e),isEmpty:e=>n(`settingsStore`,`isEmpty`,`query`,e),declareCollection:e=>n(`settingsStore`,`declareCollection`,`mutation`,e)},storage:{resolve:e=>n(`storage`,`resolve`,`query`,e),write:e=>n(`storage`,`write`,`mutation`,e),read:e=>n(`storage`,`read`,`query`,e),exists:e=>n(`storage`,`exists`,`query`,e),list:e=>n(`storage`,`list`,`query`,e),delete:e=>n(`storage`,`delete`,`mutation`,e),getAvailableSpace:e=>n(`storage`,`getAvailableSpace`,`query`,e),beginUpload:e=>n(`storage`,`beginUpload`,`mutation`,e),writeChunk:e=>n(`storage`,`writeChunk`,`mutation`,e),finalizeUpload:e=>n(`storage`,`finalizeUpload`,`mutation`,e),abortUpload:e=>n(`storage`,`abortUpload`,`mutation`,e),beginDownload:e=>n(`storage`,`beginDownload`,`mutation`,e),readChunk:e=>n(`storage`,`readChunk`,`query`,e),endDownload:e=>n(`storage`,`endDownload`,`mutation`,e),listLocations:e=>n(`storage`,`listLocations`,`query`,e),getDefaultLocation:e=>n(`storage`,`getDefaultLocation`,`query`,e),listLocationDeclarations:e=>n(`storage`,`listLocationDeclarations`,`query`,e),upsertLocation:e=>n(`storage`,`upsertLocation`,`mutation`,e),deleteLocation:e=>n(`storage`,`deleteLocation`,`mutation`,e),testLocation:e=>n(`storage`,`testLocation`,`query`,e),listProviders:e=>n(`storage`,`listProviders`,`query`,e),testConfig:e=>n(`storage`,`testConfig`,`query`,e)},streamBroker:{listAllCameraStreams:e=>n(`streamBroker`,`listAllCameraStreams`,`query`,e),listAllProfileSlots:e=>n(`streamBroker`,`listAllProfileSlots`,`query`,e),getBrokerStats:e=>n(`streamBroker`,`getBrokerStats`,`query`,e),probeStream:e=>n(`streamBroker`,`probeStream`,`mutation`,e),listClients:e=>n(`streamBroker`,`listClients`,`query`,e),killClient:e=>n(`streamBroker`,`killClient`,`mutation`,e),getStreamUrl:e=>n(`streamBroker`,`getStreamUrl`,`query`,e),getStreamWithCodec:e=>n(`streamBroker`,`getStreamWithCodec`,`mutation`,e),releaseStreamWithCodec:e=>n(`streamBroker`,`releaseStreamWithCodec`,`mutation`,e),subscribeAudioChunks:e=>n(`streamBroker`,`subscribeAudioChunks`,`mutation`,e),pullAudioChunks:e=>n(`streamBroker`,`pullAudioChunks`,`query`,e),unsubscribeAudioChunks:e=>n(`streamBroker`,`unsubscribeAudioChunks`,`mutation`,e),subscribeFrames:e=>n(`streamBroker`,`subscribeFrames`,`mutation`,e),pullFrameHandles:e=>n(`streamBroker`,`pullFrameHandles`,`query`,e),unsubscribeFrames:e=>n(`streamBroker`,`unsubscribeFrames`,`mutation`,e),setPreBufferDuration:e=>n(`streamBroker`,`setPreBufferDuration`,`mutation`,e),getPreBufferInfo:e=>n(`streamBroker`,`getPreBufferInfo`,`query`,e),getRtspPort:e=>n(`streamBroker`,`getRtspPort`,`query`,e),getAllRtspEntries:e=>n(`streamBroker`,`getAllRtspEntries`,`query`,e),getRtspEntry:e=>n(`streamBroker`,`getRtspEntry`,`query`,e),regenerateRtspToken:e=>n(`streamBroker`,`regenerateRtspToken`,`mutation`,e),setRtspEnabled:e=>n(`streamBroker`,`setRtspEnabled`,`mutation`,e),isRtspEnabled:e=>n(`streamBroker`,`isRtspEnabled`,`query`,e)},system:{info:e=>n(`system`,`info`,`query`,e),health:e=>n(`system`,`health`,`query`,e),featureFlags:e=>n(`system`,`featureFlags`,`query`,e),networkAddresses:e=>n(`system`,`networkAddresses`,`query`,e),getRetentionConfig:e=>n(`system`,`getRetentionConfig`,`query`,e),setRetentionConfig:e=>n(`system`,`setRetentionConfig`,`mutation`,e),forceRetentionCleanup:e=>n(`system`,`forceRetentionCleanup`,`mutation`,e)},toast:{onToast:(e,t)=>n(`toast`,`onToast`,`subscription`,e,t)},turnProvider:{getTurnServers:e=>n(`turnProvider`,`getTurnServers`,`query`,e)},userManagement:{listUsers:e=>n(`userManagement`,`listUsers`,`query`,e),createUser:e=>n(`userManagement`,`createUser`,`mutation`,e),updateUser:e=>n(`userManagement`,`updateUser`,`mutation`,e),deleteUser:e=>n(`userManagement`,`deleteUser`,`mutation`,e),resetPassword:e=>n(`userManagement`,`resetPassword`,`mutation`,e),setUserScopes:e=>n(`userManagement`,`setUserScopes`,`mutation`,e),validateCredentials:e=>n(`userManagement`,`validateCredentials`,`mutation`,e),listApiKeys:e=>n(`userManagement`,`listApiKeys`,`query`,e),createApiKey:e=>n(`userManagement`,`createApiKey`,`mutation`,e),revokeApiKey:e=>n(`userManagement`,`revokeApiKey`,`mutation`,e),validateApiKey:e=>n(`userManagement`,`validateApiKey`,`mutation`,e),createScopedToken:e=>n(`userManagement`,`createScopedToken`,`mutation`,e),revokeScopedToken:e=>n(`userManagement`,`revokeScopedToken`,`mutation`,e),validateScopedToken:e=>n(`userManagement`,`validateScopedToken`,`query`,e),listScopedTokens:e=>n(`userManagement`,`listScopedTokens`,`query`,e),setupTotp:e=>n(`userManagement`,`setupTotp`,`mutation`,e),confirmTotp:e=>n(`userManagement`,`confirmTotp`,`mutation`,e),disableTotp:e=>n(`userManagement`,`disableTotp`,`mutation`,e),getTotpStatus:e=>n(`userManagement`,`getTotpStatus`,`query`,e),verifyTotp:e=>n(`userManagement`,`verifyTotp`,`mutation`,e),oauthIssueCode:e=>n(`userManagement`,`oauthIssueCode`,`mutation`,e),oauthExchangeCode:e=>n(`userManagement`,`oauthExchangeCode`,`mutation`,e),oauthRefresh:e=>n(`userManagement`,`oauthRefresh`,`mutation`,e),oauthVerifyAccessToken:e=>n(`userManagement`,`oauthVerifyAccessToken`,`query`,e),listOauthSessions:e=>n(`userManagement`,`listOauthSessions`,`query`,e),revokeOauthSession:e=>n(`userManagement`,`revokeOauthSession`,`mutation`,e)}}}var F_=`device.state-changed`,I_=`capability.binding-changed`,L_=`device.registered`,R_=`device.unregistered`,z_=`device.updated`,B_=class{api;stateMirror=new Map;bindings=new Map;devices=new Map;handleListeners=new Map;globalStateListeners=new Set;capListeners=new Map;deviceListeners=new Map;addedListeners=new Set;removedListeners=new Set;pendingWaits=new Set;stateSource;bridges=[];initialized=!1;initPromise=null;constructor(e){this.api=e,this.stateSource=lf(this.stateMirror,this.handleListeners,this.api)}async init(e=15e3){if(!this.initialized){if(this.initPromise)return this.initPromise;this.initPromise=(async()=>{let t=(t,n)=>Number.isFinite(e)?new Promise((r,a)=>{let o=setTimeout(()=>a(Error(`SystemMirror.init: '${n}' timed out after ${e}ms`)),e);t.then(e=>{clearTimeout(o),r(e)},e=>{clearTimeout(o),a(e)})}):t,[n,r,a]=await Promise.all([t(this.api.deviceManager.getAllBindings.query({}),`deviceManager.getAllBindings`),t(this.api.deviceState.getAllSnapshots.query({}),`deviceState.getAllSnapshots`),t(this.api.deviceManager.listAll.query({}),`deviceManager.listAll`)]);for(let e of n)this.bindings.set(e.deviceId,e);for(let[e,t]of Object.entries(r)){let n=Number(e);if(!Number.isFinite(n))continue;let r=new Map;for(let[e,n]of Object.entries(t))r.set(e,n);this.stateMirror.set(n,r)}for(let e of a)this.devices.set(e.id,e);try{this.subscribeBus()}catch{}this.initialized=!0})();try{await this.initPromise}finally{this.initPromise=null}}}isReady(){return this.initialized}async awaitReady(){if(!this.initialized)return this.initPromise?this.initPromise:this.init()}dispose(){for(let e of this.bridges)try{e.unsubscribe()}catch{}this.bridges=[],this.handleListeners.clear(),this.globalStateListeners.clear(),this.capListeners.clear(),this.deviceListeners.clear(),this.addedListeners.clear(),this.removedListeners.clear(),this.pendingWaits.clear(),this.initialized=!1}getDeviceById(e){let t=this.bindings.get(e);return t?df(this.api,t,{stateSource:this.stateSource}):null}getDeviceByName(e){for(let t of this.devices.values())if(t.name===e)return this.getDeviceById(t.id);return null}getDeviceByStableId(e){for(let t of this.devices.values())if(t.stableId===e)return this.getDeviceById(t.id);return null}getDevicesByAddon(e){return this.query({addonId:e})}getDevicesByType(e){return this.query({type:e})}getDeviceInfo(e){return this.devices.get(e)??null}getAllDevices(){let e=[];for(let t of this.bindings.keys()){let n=this.getDeviceById(t);n&&e.push(n)}return e}filterByCap(e){return this.query({caps:e})}query(e={}){let t=[];for(let[n,r]of this.bindings){let a=this.devices.get(n);if(e.id!==void 0&&!V_(n,e.id)||e.stableId!==void 0&&(!a||!V_(a.stableId,e.stableId))||e.addonId!==void 0&&(!a||!V_(a.addonId,e.addonId))||e.type!==void 0&&(!a||!V_(a.type,e.type)))continue;if(e.caps!==void 0){let t=H_(e.caps),n=new Set(r.entries.map(e=>e.capName));if(!t.every(e=>n.has(e)))continue}if(e.anyCap!==void 0){let t=H_(e.anyCap),n=new Set(r.entries.map(e=>e.capName));if(!t.some(e=>n.has(e)))continue}if(e.name!==void 0&&(!a||!U_(a.name,e.name))||e.online!==void 0&&(!a||a.online!==e.online))continue;if(e.parentDeviceId!==void 0){if(!a)continue;let t=e.parentDeviceId;if((a.parentDeviceId??null)!==t)continue}if(e.feature!==void 0&&(!a||!H_(e.feature).every(e=>a.features.includes(e)))||e.isCamera!==void 0&&(!a||a.isCamera!==e.isCamera))continue;let o=this.getDeviceById(n);if(o){if(e.where&&a){if(!e.where(a,o))continue}else if(e.where&&!a)continue;t.push(o)}}return t}whereState(e,t){let n=[];for(let[r,a]of this.stateMirror){let o=a.get(e);if(!o||!t(o,r))continue;let s=this.getDeviceById(r);s&&n.push(s)}return n}mapState(e,t){let n=[];for(let[r,a]of this.stateMirror){let o=a.get(e);o&&n.push(t(o,r))}return n}findState(e,t){for(let[n,r]of this.stateMirror){let a=r.get(e);if(a&&t(a,n))return this.getDeviceById(n)}return null}countByCap(e){let t=0;for(let n of this.bindings.values())n.entries.some(t=>t.capName===e)&&t++;return t}countByState(e,t){let n=0;for(let[r,a]of this.stateMirror){let o=a.get(e);o&&t(o,r)&&n++}return n}listen(e){return this.globalStateListeners.add(e),()=>{this.globalStateListeners.delete(e)}}listenCap(e,t){let n=this.capListeners.get(e);return n||(n=new Set,this.capListeners.set(e,n)),n.add(t),()=>{n.delete(t),n.size===0&&this.capListeners.delete(e)}}listenDevice(e,t){let n=this.deviceListeners.get(e);return n||(n=new Set,this.deviceListeners.set(e,n)),n.add(t),()=>{n.delete(t),n.size===0&&this.deviceListeners.delete(e)}}onDeviceAdded(e){return this.addedListeners.add(e),()=>{this.addedListeners.delete(e)}}onDeviceRemoved(e){return this.removedListeners.add(e),()=>{this.removedListeners.delete(e)}}waitForState(e,t,n,r=3e4){return new Promise((a,o)=>{let s=(()=>{let r=this.stateMirror.get(e)?.get(t);return r&&n(r)?r:null})();if(s){a(s);return}let c=null,l=this.listenDevice(e,(e,r,o)=>{r===t&&o&&n(o)&&(c&&clearTimeout(c),l(),a(o))});Number.isFinite(r)&&(c=setTimeout(()=>{l(),o(Error(`waitForState timed out after ${r}ms (deviceId=${e}, capName=${t})`))},r))})}waitForDevice(e,t=3e4){return new Promise((n,r)=>{let a=this.getDeviceById(e);if(a){n(a);return}let o=null,s=this.onDeviceAdded(t=>{if(t!==e)return;let r=this.getDeviceById(t);r&&(o&&clearTimeout(o),s(),n(r))});Number.isFinite(t)&&(o=setTimeout(()=>{s(),r(Error(`waitForDevice timed out after ${t}ms (deviceId=${e})`))},t))})}async forEachCap(e,t){for(let n of this.filterByCap(e))await t(n)}async invokeCap(e,t,n,r={}){let a=this.filterByCap(e),o=Math.max(1,r.parallelism??a.length),s=[];for(let r=0;r<a.length;r+=o){let c=a.slice(r,r+o),l=await Promise.allSettled(c.map(async r=>{let a=r[e];if(!a||typeof a[t]!=`function`)throw Error(`device '${r.deviceId}' does not expose '${e}.${t}'`);return await a[t](n)}));for(let e=0;e<l.length;e++){let t=c[e],n=l[e];n.status===`fulfilled`?s.push({deviceId:t.deviceId,ok:!0,result:n.value}):s.push({deviceId:t.deviceId,ok:!1,error:n.reason})}}return s}summary(){let e={},t={},n={},r=0,a=0;for(let t of this.bindings.values())for(let n of t.entries)e[n.capName]=(e[n.capName]??0)+1;for(let e of this.devices.values())t[e.addonId]=(t[e.addonId]??0)+1,n[e.type]=(n[e.type]??0)+1,e.online?r++:a++;return{totalDevices:this.bindings.size,online:r,offline:a,byCap:e,byAddon:t,byType:n,statedDevices:this.stateMirror.size}}dump(e){let t=e=>{let t=this.devices.get(e)??null,n=this.bindings.get(e)??null,r={},a=this.stateMirror.get(e);if(a)for(let[e,t]of a)r[e]={...t};return{deviceId:e,info:t,binding:n?{...n,entries:n.entries.map(e=>({...e}))}:null,state:r}};if(e!==void 0)return t(e);let n=[];for(let e of this.bindings.keys())n.push(t(e));return n}getRawMirror(){return this.stateMirror}getSystemState(){let e=new Map;for(let[t,n]of this.stateMirror){let r=new Map;for(let[e,t]of n)r.set(e,{...t});e.set(t,r)}return e}subscribeBus(){if(!this.api.live?.onEvent)return;let e=this.api.live.onEvent;this.bridges.push(e.subscribe({category:F_},{onData:e=>{let t=e.data;!t||typeof t.deviceId!=`number`||typeof t.capName!=`string`||this.applyStateUpdate(t.deviceId,t.capName,t.slice)}})),this.bridges.push(e.subscribe({category:I_},{onData:e=>{let t=e.data,n=typeof t?.deviceId==`number`?t.deviceId:t?.source?.type===`device`&&typeof t.source.id==`number`?t.source.id:null;n!==null&&this.refreshBinding(n)}})),this.bridges.push(e.subscribe({category:L_},{onData:e=>{let t=e.data;typeof t?.deviceId==`number`&&this.refreshDeviceMetadata(t.deviceId,`added`)}})),this.bridges.push(e.subscribe({category:R_},{onData:e=>{let t=e.data;typeof t?.deviceId==`number`&&this.applyDeviceRemoval(t.deviceId)}})),this.bridges.push(e.subscribe({category:z_},{onData:e=>{let t=e.data;typeof t?.deviceId==`number`&&this.refreshDeviceMetadata(t.deviceId,`updated`)}}))}applyStateUpdate(e,t,n){let r=this.stateMirror.get(e);r||(r=new Map,this.stateMirror.set(e,r)),n===void 0?r.delete(t):r.set(t,n);let a=`${e}:${t}`,o=this.handleListeners.get(a);if(o)for(let e of o)try{e(n)}catch{}for(let r of this.globalStateListeners)try{r(e,t,n)}catch{}let s=this.capListeners.get(t);if(s)for(let t of s)try{t(e,n)}catch{}let c=this.deviceListeners.get(e);if(c)for(let r of c)try{r(e,t,n)}catch{}}applyDeviceRemoval(e){let t=this.devices.get(e)??null;this.bindings.delete(e),this.devices.delete(e),this.stateMirror.delete(e);for(let n of this.removedListeners)try{n(e,t)}catch{}}async refreshBinding(e){try{let t=(await this.api.deviceManager.getAllBindings.query({})).find(t=>t.deviceId===e);t?this.bindings.set(e,t):this.applyDeviceRemoval(e)}catch{}}async refreshDeviceMetadata(e,t){try{let n=(await this.api.deviceManager.listAll.query({})).find(t=>t.id===e);if(!n)return;let r=!this.devices.has(e);if(this.devices.set(e,n),t===`added`&&r){await this.refreshBinding(e);for(let t of this.addedListeners)try{t(e,n)}catch{}}}catch{}}};function V_(e,t){return Array.isArray(t)?t.includes(e):e===t}function H_(e){return Array.isArray(e)?e:[e]}function U_(e,t){return typeof t==`string`?e===t:t instanceof RegExp?t.test(e):`exact`in t?e===t.exact:`contains`in t?e.toLowerCase().includes(t.contains.toLowerCase()):!1}var W_=V({id:F(),label:F(),icon:F(),order:I().optional()}),G_=V({id:F(),title:F(),description:F().optional(),style:W([`card`,`accordion`]).optional(),defaultCollapsed:L().optional(),columns:H([G(1),G(2),G(3),G(4)]).optional(),tab:F().optional(),location:W([`settings`,`top-tab`]).optional(),order:I().optional(),fields:B(Gu())}),K_=V({tabs:B(W_).optional(),sections:B(G_)}),q_=U(F(),R()),J_=V({success:G(!0)}),Y_={name:`addon-settings`,scope:`system`,mode:`singleton`,nodeIdMode:`data`,methods:{getGlobalSettings:J(V({addonId:F(),nodeId:F().optional(),overlay:U(F(),R()).optional(),cap:F().optional()}),K_.nullable()),updateGlobalSettings:J(V({addonId:F(),nodeId:F().optional(),patch:q_}),J_,{kind:`mutation`,auth:`admin`}),getDeviceSettings:J(V({addonId:F(),deviceId:I(),nodeId:F().optional()}),K_.nullable()),updateDeviceSettings:J(V({addonId:F(),deviceId:I(),nodeId:F().optional(),patch:q_}),J_,{kind:`mutation`,auth:`admin`})}},X_=W([`info`,`success`,`warning`,`error`]),Z_=W([`active`,`in-progress`,`completed`,`failed`,`dismissed`]),Q_=V({type:F(),id:F()}),$_=V({id:F(),category:F(),severity:X_,title:F(),message:F(),status:Z_,progress:I().optional(),read:L(),createdAt:I(),updatedAt:I(),source:Q_.optional(),metadata:U(F(),R()).optional()}),ev={name:`alerts`,scope:`system`,mode:`singleton`,methods:{emit:J($_,z(),{kind:`mutation`}),update:J(V({alertId:F(),patch:$_.partial()}),z(),{kind:`mutation`}),list:J(V({unreadOnly:L().optional(),limit:I().optional()}).optional(),B($_).readonly()),getUnreadCount:J(z(),I()),markRead:J(V({alertId:F()}),z(),{kind:`mutation`}),markAllRead:J(z(),z(),{kind:`mutation`}),dismiss:J(V({alertId:F()}),z(),{kind:`mutation`})}},tv=nd(`shouldSaveDiskSpace`,[V({providerId:F().min(1),displayName:F().min(1),configSchema:R(),nodeLocal:L(),shouldSaveDiskSpace:G(!0),minFreePercent:I().min(0).max(100)}),V({providerId:F().min(1),displayName:F().min(1),configSchema:R(),nodeLocal:L(),shouldSaveDiskSpace:G(!1),minFreePercent:G(null)})]),nv={name:`storage`,scope:`system`,mode:`singleton`,methods:{resolve:J(V({location:Rf,relativePath:F()}),F()),write:J(V({location:Rf,relativePath:F(),data:Ld(Uint8Array)}),z(),{kind:`mutation`}),read:J(V({location:Rf,relativePath:F()}),Ld(Uint8Array)),exists:J(V({location:Rf,relativePath:F()}),L()),list:J(V({location:Rf,prefix:F().optional()}),B(F()).readonly()),delete:J(V({location:Rf,relativePath:F()}),z(),{kind:`mutation`}),getAvailableSpace:J(V({location:Rf}),I().nullable()),beginUpload:J(V({location:Rf,relativePath:F(),sizeBytes:I().optional()}),V({uploadId:F()}),{kind:`mutation`}),writeChunk:J(V({uploadId:F(),offset:I(),data:Ld(Uint8Array)}),z(),{kind:`mutation`}),finalizeUpload:J(V({uploadId:F()}),z(),{kind:`mutation`}),abortUpload:J(V({uploadId:F()}),z(),{kind:`mutation`}),beginDownload:J(V({location:Rf,relativePath:F()}),V({downloadId:F(),sizeBytes:I()}),{kind:`mutation`}),readChunk:J(V({downloadId:F(),offset:I(),length:I()}),Ld(Uint8Array)),endDownload:J(V({downloadId:F()}),z(),{kind:`mutation`}),listLocations:J(V({type:If.optional()}),B(Lf).readonly()),getDefaultLocation:J(V({type:If}),Lf.nullable()),listLocationDeclarations:J(z(),B(zf).readonly()),upsertLocation:J(Lf.omit({createdAt:!0,updatedAt:!0}),Lf,{kind:`mutation`,auth:`admin`}),deleteLocation:J(V({id:F()}),z(),{kind:`mutation`,auth:`admin`}),testLocation:J(V({id:F()}),V({ok:L(),error:F().optional()}),{auth:`admin`}),listProviders:J(z(),B(tv).readonly()),testConfig:J(V({providerId:F(),config:U(F(),R())}),V({ok:L(),error:F().optional()}),{auth:`admin`})}},rv=nd(`shouldSaveDiskSpace`,[V({providerId:F().min(1),displayName:F().min(1),configSchema:R(),nodeLocal:L(),shouldSaveDiskSpace:G(!0),minFreePercent:I().min(0).max(100)}),V({providerId:F().min(1),displayName:F().min(1),configSchema:R(),nodeLocal:L(),shouldSaveDiskSpace:G(!1),minFreePercent:G(null)})]),iv=V({ok:L(),error:F().optional()}),av=V({location:Lf,relativePath:F(),sizeBytes:I().optional()}),ov=V({uploadId:F()}),sv=V({uploadId:F(),offset:I(),data:Ld(Uint8Array)}),cv=V({uploadId:F()}),lv=V({uploadId:F()}),uv=V({location:Lf,relativePath:F()}),dv=V({downloadId:F(),sizeBytes:I()}),fv=V({downloadId:F(),offset:I(),length:I()}),pv=V({downloadId:F()}),mv={name:`storage-provider`,scope:`system`,mode:`collection`,internal:!0,methods:{getProviderInfo:J(z(),rv),testLocation:J(V({config:U(F(),R())}),iv,{auth:`admin`}),resolve:J(V({location:Lf,relativePath:F()}),F()),write:J(V({location:Lf,relativePath:F(),data:Ld(Uint8Array)}),z(),{kind:`mutation`}),read:J(V({location:Lf,relativePath:F()}),Ld(Uint8Array)),exists:J(V({location:Lf,relativePath:F()}),L()),list:J(V({location:Lf,prefix:F().optional()}),B(F()).readonly()),delete:J(V({location:Lf,relativePath:F()}),z(),{kind:`mutation`}),getAvailableSpace:J(V({location:Lf}),I().nullable()),beginUpload:J(av,ov,{kind:`mutation`}),writeChunk:J(sv,z(),{kind:`mutation`}),finalizeUpload:J(cv,z(),{kind:`mutation`}),abortUpload:J(lv,z(),{kind:`mutation`}),beginDownload:J(uv,dv,{kind:`mutation`}),readChunk:J(fv,Ld(Uint8Array)),endDownload:J(pv,z(),{kind:`mutation`})}},hv=V({bytes:I().int().nonnegative()}),gv=V({reclaimedBytes:I().int().nonnegative(),exhausted:L()}),_v={name:`storage-evictable`,scope:`system`,mode:`collection`,internal:!0,methods:{getEvictableUsage:J(V({locationId:F()}),hv),evict:J(V({locationId:F(),targetBytes:I().int().positive()}),gv,{kind:`mutation`})}},vv=V({name:F(),path:F()}),yv=V({path:F(),entries:B(vv).readonly(),freeBytes:I(),totalBytes:I()}),bv={name:`filesystem-browse`,scope:`system`,mode:`singleton`,internal:!0,methods:{listAllowedRoots:J(z(),B(F()).readonly(),{auth:`admin`}),browse:J(V({path:F()}),yv,{auth:`admin`}),createDir:J(V({path:F()}),V({path:F()}),{kind:`mutation`,auth:`admin`})}},xv=V({subId:F(),displayName:F(),description:F().optional(),kind:F(),triggerSupported:L(),restoreSupported:L()}).extend({id:F(),addonId:F(),enabled:L(),retentionCount:I(),label:F().optional(),lastSuccessAt:I().optional(),lastSuccessSizeBytes:I().optional(),cron:F().optional(),nextRunAt:I().optional(),lastRunAt:I().optional()}),Sv=V({id:F(),filename:F(),createdAt:I(),sizeBytes:I(),label:F().optional(),locations:B(F()).readonly()}),Cv=V({id:F(),destinationId:F().optional(),label:F().optional(),createdAt:I(),sizeBytes:I(),locations:B(F()).optional()}),wv=V({path:F(),kind:W([`file`,`dir`,`symlink`]),sizeBytes:I(),mtime:I()}),Tv=V({archiveVersion:G(1),createdAt:I(),dataDir:F(),locations:B(F()),entries:B(wv),totalBytes:I(),totalFiles:I()}),Ev=V({name:F(),sizeBytes:I(),fileCount:I(),present:L()}),Dv={name:`backup`,scope:`system`,mode:`singleton`,methods:{listDestinations:J(z(),B(xv).readonly(),{auth:`admin`}),trigger:J(V({destinations:B(F()).optional(),locations:B(F()).optional(),label:F().optional()}).optional(),B(Cv).readonly(),{kind:`mutation`,auth:`admin`}),list:J(z(),B(Cv).readonly(),{auth:`admin`}),listLocations:J(z(),B(Ev).readonly(),{auth:`admin`}),getEntries:J(V({destinationId:F(),backupId:F()}),Tv.nullable(),{auth:`admin`}),restore:J(V({destinationId:F(),backupId:F(),locations:B(F()).optional()}),z(),{kind:`mutation`,auth:`admin`}),delete:J(V({destinationId:F(),backupId:F()}),z(),{kind:`mutation`,auth:`admin`}),listArchives:J(V({destinationId:F()}),B(Sv).readonly(),{auth:`admin`}),upsertDestinationPolicy:J(V({locationId:F(),enabled:L(),retentionCount:I().int().min(1).max(1e3),label:F().optional(),cron:F().optional()}),z(),{kind:`mutation`,auth:`admin`}),previewSchedule:J(V({cron:F(),count:I().int().min(1).max(20).optional()}),V({ok:L(),error:F().optional(),nextRuns:B(I()).readonly()}))}},Ov=V({where:U(F(),R()).optional(),whereIn:U(F(),B(R())).optional(),whereBetween:U(F(),od([R(),R()])).optional(),orderBy:V({field:F(),direction:W([`asc`,`desc`])}).optional(),limit:I().optional(),offset:I().optional()}),kv=V({id:F(),data:U(F(),R())}),Av=V({name:F(),type:W([`TEXT`,`INTEGER`,`REAL`,`JSON`,`BOOLEAN`]),primaryKey:L().optional(),notNull:L().optional(),unique:L().optional()}),jv=V({name:F(),columns:B(F()).readonly(),unique:L().optional()}),Mv={name:`settings-store`,scope:`system`,mode:`singleton`,methods:{get:J(V({namespace:F().optional(),collection:F(),key:F()}),R()),set:J(V({namespace:F().optional(),collection:F(),key:F(),value:R()}),z(),{kind:`mutation`}),query:J(V({namespace:F().optional(),collection:F(),filter:Ov.optional()}),B(kv).readonly()),insert:J(V({namespace:F().optional(),collection:F(),record:kv}),z(),{kind:`mutation`}),update:J(V({namespace:F().optional(),collection:F(),id:F(),data:U(F(),R())}),z(),{kind:`mutation`}),delete:J(V({namespace:F().optional(),collection:F(),key:F()}),z(),{kind:`mutation`}),count:J(V({namespace:F().optional(),collection:F(),filter:Ov.optional()}),I()),histogram:J(V({namespace:F().optional(),collection:F(),field:F(),bucketSize:I().int().positive(),origin:I().int(),filter:Ov.optional()}),B(V({bucket:I().int(),count:I().int()})).readonly()),isEmpty:J(V({namespace:F().optional(),collection:F()}),L()),declareCollection:J(V({namespace:F().optional(),collection:F(),columns:B(Av).readonly(),indexes:B(jv).readonly().optional()}),z(),{kind:`mutation`})}},Nv=W([`debug`,`info`,`warn`,`error`]),Pv=V({timestamp:Zu(),level:Nv,scope:B(F()),message:F(),meta:U(F(),R()).optional(),tags:U(F(),F()).optional()}),Fv={name:`log-destination`,scope:`system`,mode:`collection`,internal:!0,methods:{write:J(Pv,z(),{kind:`mutation`}),query:J(V({scope:B(F()).optional(),level:Nv.optional(),since:Zu().optional(),until:Zu().optional(),limit:I().optional(),tags:U(F(),F()).optional()}),B(Pv).readonly())}},Iv=W([`view`,`create`,`delete`]),Lv=H([G(`*`),B(F())]),Rv=U(F(),H([G(`*`),B(F())])),zv=W([`device`,`system`]),Bv=nd(`type`,[V({type:G(`category`),target:zv,access:B(Iv).min(1)}),V({type:G(`capability`),target:F(),access:B(Iv).min(1)}),V({type:G(`addon`),target:F(),access:B(Iv).min(1)}),V({type:G(`device`),targets:B(F()).min(1),access:B(Iv).min(1)})]);V({id:F(),username:F(),passwordHash:F(),isAdmin:L().default(!1),allowedProviders:Lv,allowedDevices:Rv,scopes:B(Bv).default([]),createdAt:I(),updatedAt:I()}),V({id:F(),label:F(),isAdmin:L().default(!1),allowedProviders:Lv,allowedDevices:Rv,tokenHash:F(),tokenPrefix:F(),createdAt:I(),lastUsedAt:I().optional()}),V({id:F(),userId:F(),name:F(),tokenHash:F(),tokenPrefix:F(),scopes:B(Bv),expiresAt:I().nullish(),lastUsedAt:I().nullish(),createdAt:I()});var Vv=V({userId:F(),username:F(),isAdmin:L(),provider:F(),email:F().optional(),displayName:F().optional(),hubUrl:F().optional(),scopes:B(Bv).optional(),redirectUri:F().optional(),integrationId:F().optional(),jti:F().optional(),sessionId:F().optional()}),Hv={name:`sso-bridge`,scope:`system`,mode:`singleton`,internal:!0,methods:{signBridgeToken:J(V({claims:Vv,ttlSec:I().int().positive().optional()}),V({token:F()})),verifyBridgeToken:J(V({token:F()}),Vv.nullable())}},Uv=V({integrationId:F(),displayName:F(),requestedScopes:B(Bv),allowedRedirectPrefixes:B(F()).min(1),hubUrl:F().optional()}),Wv={name:`oauth-integration`,scope:`system`,mode:`collection`,internal:!0,methods:{getDescriptor:J(z(),Uv)}},Gv=V({credentialId:F(),label:F(),createdAt:I(),lastUsedAt:I().nullable(),transports:B(F()).default([])}),Kv={name:`user-passkeys`,scope:`system`,mode:`collection`,internal:!0,methods:{beginRegistration:J(V({userId:F(),username:F()}),V({optionsJSON:U(F(),R())}),{kind:`mutation`,auth:`admin`,access:`create`}),finishRegistration:J(V({userId:F(),response:U(F(),R()),label:F()}),V({success:G(!0),credentialId:F()}),{kind:`mutation`,auth:`admin`,access:`create`}),beginAuthentication:J(V({userId:F().optional()}),V({optionsJSON:U(F(),R())}),{kind:`mutation`,access:`view`}),finishAuthentication:J(V({userId:F(),response:U(F(),R())}),V({verified:L()}),{kind:`mutation`,access:`view`}),listPasskeys:J(V({userId:F()}),B(Gv),{auth:`admin`}),removePasskey:J(V({userId:F(),credentialId:F()}),V({success:G(!0)}),{kind:`mutation`,auth:`admin`,access:`delete`})}},qv=vu(),Jv=V({to:H([qv,B(qv).min(1)]),cc:B(qv).optional(),bcc:B(qv).optional(),from:F().optional(),replyTo:F().optional(),subject:F(),text:F(),html:F().optional()}),Yv=V({messageId:F(),accepted:B(qv).default([]),rejected:B(qv).default([])}),Xv=V({ready:L(),host:F(),error:F().optional(),lastVerifiedAt:I().optional()}),Zv={name:`smtp-provider`,scope:`system`,mode:`collection`,internal:!0,providerKind:`email`,methods:{sendEmail:J(Jv,Yv,{kind:`mutation`,auth:`admin`,access:`create`}),verify:J(z(),Xv,{kind:`mutation`,auth:`admin`,access:`view`}),getStatus:J(z(),Xv,{auth:`admin`})}},Qv=V({id:F(),label:F(),isDefault:L().optional()}),$v=V({search:F().optional(),area:F().optional(),manufacturer:F().optional(),adoptedOnly:L().optional(),unadoptedOnly:L().optional()}),ey=V({integrationId:F(),page:I().int().positive().default(1),pageSize:I().int().positive().max(2e4).default(50),filter:F().optional(),filterText:$v.optional()}),ty=V({candidates:B(om).readonly(),totalCount:I().int().nonnegative(),page:I().int().positive(),pageSize:I().int().positive()}),ny=V({integrationId:F(),childNativeId:F()}),ry=V({lastDiscoveryAt:I().int().nonnegative().nullable(),candidateCount:I().int().nonnegative(),adoptedCount:I().int().nonnegative(),lastError:F().nullable()}),iy=V({name:F().min(1).optional(),hiddenChildIds:B(F()).optional()}),ay=V({integrationId:F(),childNativeIds:B(F()).min(1),filter:F().optional(),importLocations:L().optional(),perCandidate:U(F(),iy).optional()}),oy=V({adopted:B(V({childNativeId:F(),parentDeviceId:I().int().nonnegative(),accessoryDeviceIds:B(I().int().nonnegative()).readonly()})).readonly()}),sy=V({integrationId:F(),camDeviceId:I().int().nonnegative()}),cy=V({camDeviceId:I().int().nonnegative()}),ly=V({changed:L(),rebuiltChildren:I().int().nonnegative()}),uy={name:`device-adoption`,scope:`system`,mode:`singleton`,status:{schema:ry,kind:`poll`},methods:{listCandidateFilters:J(V({integrationId:F()}),V({filters:B(Qv)}),{auth:`admin`}),listCandidates:J(ey,ty,{auth:`admin`}),getCandidate:J(ny,om.nullable(),{auth:`admin`}),refresh:J(V({integrationId:F()}),ry,{kind:`mutation`,auth:`admin`}),adopt:J(ay,oy,{kind:`mutation`,auth:`admin`}),release:J(sy,z(),{kind:`mutation`,auth:`admin`}),resync:J(cy,ly,{kind:`mutation`,auth:`admin`})}},dy=W([`connected`,`disconnected`,`connecting`,`auth-failed`,`unreachable`,`error`]),fy=V({id:F(),addonId:F(),name:F(),kind:F(),status:dy,info:U(F(),R()),lastCheckedAt:I().nullable(),error:F().nullable()}),py=V({brokerCount:I().int().nonnegative(),connectedCount:I().int().nonnegative()}),my=V({addonId:F(),kinds:B(V({kind:F(),label:F()}))}),hy=V({kind:F().optional()}),gy=V({id:F()}),_y=V({kind:F().min(1),name:F().min(1),settings:U(F(),R())}),vy=V({id:F()}),yy=V({id:F()}),by=nd(`ok`,[V({ok:G(!0),latencyMs:I().nonnegative()}),V({ok:G(!1),error:F()})]),xy=U(F(),R()),Sy=V({kind:F()}),Cy=V({kind:F(),settings:xy}),wy=nd(`ok`,[V({ok:G(!0),latencyMs:I().nonnegative().optional()}).strict(),V({ok:G(!1),error:F()})]),Ty=R().nullable(),Ey=V({brokerId:F(),target:U(F(),R()),payload:R().optional()}),Dy=V({brokerId:F(),filter:U(F(),R())}),Oy=V({subscriptionId:F()}),ky=V({brokerId:F(),subscriptionId:F()}),Ay=V({brokerId:F(),key:F()}),jy={name:`broker`,scope:`system`,mode:`collection`,providerKind:`broker`,status:{schema:py,kind:`poll`},methods:{list:J(hy,B(fy)),get:J(gy,fy.nullable()),listProviders:J(z(),B(my),{auth:`admin`}),add:J(_y,vy,{kind:`mutation`,auth:`admin`}),remove:J(yy,z(),{kind:`mutation`,auth:`admin`}),testConnection:J(gy,by,{kind:`mutation`,auth:`admin`}),getSettings:J(gy,xy.nullable(),{auth:`admin`}),setSettings:J(V({id:F(),settings:xy}),z(),{kind:`mutation`,auth:`admin`}),getBrokerConfig:J(gy,xy.nullable(),{auth:`admin`}),getSettingsSchema:J(Sy,Ty,{auth:`admin`}),testSettings:J(Cy,wy,{kind:`mutation`,auth:`admin`}),publish:J(Ey,R(),{kind:`mutation`,auth:`admin`}),subscribe:J(Dy,Oy,{kind:`mutation`,auth:`admin`}),unsubscribe:J(ky,z(),{kind:`mutation`,auth:`admin`}),getState:J(Ay,R().nullable()),getStatus:J(z(),py)}},My=W([`external`,`embedded`]),Ny=W([`connected`,`disconnected`,`auth-failed`,`unreachable`,`tls-error`]),Py=V({id:F(),name:F(),url:F(),kind:My,status:Ny,latencyMs:I().nullable(),error:F().optional(),connectedClients:I().int().nonnegative().optional(),lastCheckedAt:I().optional()}),Fy=V({url:F(),username:F().optional(),password:F().optional(),clientIdPrefix:F().optional()}),Iy=V({name:F().min(1),url:F().regex(/^(mqtt|mqtts|ws|wss):\/\//,`URL must start with mqtt(s):// or ws(s)://`),username:F().optional(),password:F().optional(),clientIdPrefix:F().optional()}),Ly=V({id:F()}),Ry=V({id:F()}),zy=nd(`ok`,[V({ok:G(!0),latencyMs:I()}),V({ok:G(!1),error:F()})]),By=V({port:I().int().min(1).max(65535).default(1883),allowAnonymous:L().default(!1),username:F().optional(),password:F().optional()}),Vy=V({id:F(),url:F()}),Hy=V({brokerCount:I(),embeddedRunning:L()}),Uy={name:`mqtt-broker`,scope:`system`,mode:`collection`,providerKind:`broker`,status:{schema:Hy,kind:`poll`},methods:{listBrokers:J(z(),B(Py)),getBrokerConfig:J(Ry,Fy),addBroker:J(Iy,Ly,{kind:`mutation`}),removeBroker:J(Ry,z(),{kind:`mutation`}),testConnection:J(Ry,zy,{kind:`mutation`}),startEmbeddedBroker:J(By,Vy,{kind:`mutation`}),stopEmbeddedBroker:J(Ry,z(),{kind:`mutation`}),getStatus:J(z(),Hy)}},Wy=W([`unlinked`,`linked`,`error`]),Gy=V({label:F(),value:F(),secret:L().optional()}),Ky=V({qr:F().optional(),fields:B(Gy).readonly().optional(),note:F().optional()}),qy=V({linkState:Wy,exposedDeviceCount:I(),error:F().optional(),setup:Ky.optional()}),Jy=F(),Yy=V({deviceId:F(),exposedAs:F().optional(),capabilities:B(F()).optional()}),Xy=V({deviceId:F(),capabilities:B(F()).optional()}),Zy=V({deviceId:F()}),Qy={name:`device-export`,scope:`system`,mode:`collection`,providerKind:`device-export`,status:{schema:qy,kind:`poll`},exposesDeviceSettings:!0,methods:{getStatus:J(z(),qy),listSupportedDeviceKinds:J(z(),B(Jy)),listExposedDevices:J(z(),B(Yy)),exposeDevice:J(Xy,z(),{kind:`mutation`}),unexposeDevice:J(Zy,z(),{kind:`mutation`})}},$y=V({id:F(),label:F(),icon:F(),path:F(),remoteName:F(),bundle:F()}),eb=V({addonId:F(),page:$y,bundleUrl:F()}),tb={name:`addon-pages`,scope:`system`,mode:`singleton`,methods:{listPages:J(z(),B(eb).readonly())}},nb=V({id:F(),label:F(),icon:F(),path:F(),remoteName:F(),bundle:F()}),rb={name:`addon-pages-source`,scope:`system`,mode:`collection`,internal:!0,methods:{listPages:J(z(),B(nb).readonly())}},ib=W([`device-tab`,`dashboard`,`integration-detail`]),ab=W([`xs`,`sm`,`md`,`lg`,`xl`]),ob=V({remoteName:F(),exposedModule:F(),componentKey:F().optional()}),sb=V({tab:F(),subTab:F().optional(),label:F(),order:I().optional(),kind:G(`remote`),remote:ob,stableId:F(),description:F().optional(),icon:F().optional(),bundle:F(),hosts:B(ib).readonly(),requires:V({deviceContext:L().default(!1),integrationContext:L().default(!1)}),defaultSize:ab.default(`md`),allowedSizes:B(ab).readonly().default([`sm`,`md`,`lg`]),defaultColumns:I().int().min(1).max(12).default(6),defaultRows:I().int().min(1).max(12).default(1)}),cb={name:`addon-widgets-source`,scope:`system`,mode:`collection`,internal:!0,methods:{listWidgets:J(z(),B(sb).readonly())}},lb=sb.extend({addonId:F(),bundleUrl:F()}),ub={name:`addon-widgets`,scope:`system`,mode:`singleton`,methods:{listWidgets:J(z(),B(lb).readonly())}},db=V({method:W([`GET`,`POST`,`PUT`,`DELETE`,`PATCH`]),path:F(),access:W([`public`,`authenticated`,`admin`]).optional(),description:F().optional()}),fb=V({method:F(),path:F(),params:U(F(),F()),query:U(F(),F()),body:R(),headers:U(F(),F()),user:V({id:F(),username:F(),isAdmin:L()}).optional(),scopedToken:R().optional()}),pb=V({status:I().int(),headers:U(F(),F()),redirectUrl:F().nullable(),body:R().optional(),contentType:F().optional()}),mb={name:`addon-routes`,scope:`system`,mode:`collection`,internal:!0,methods:{getRoutes:J(z(),B(db)),invoke:J(fb,pb,{kind:`mutation`})}},hb=V({sessionId:F(),slotCount:I().int(),slotByteLength:I().int(),segmentBytes:I().int(),budgetMb:I().int(),framesWritten:I().int(),getFrameHits:I().int(),getFrameMisses:I().int()}),gb={name:`decoder`,scope:`system`,mode:`singleton`,methods:{supportsCodec:J(V({codec:F()}),L()),getInfo:J(z(),V({id:F(),name:F(),isPullMode:L().optional(),priority:I().optional()})),createSession:J(Vf,V({sessionId:F(),nodeId:F()})),destroySession:J(V({sessionId:F()}),z()),pushPacket:J(V({sessionId:F(),packet:Kd}),z()),openStream:J(V({sessionId:F(),url:F()}),z()),pullFrames:J(V({sessionId:F(),maxCount:I().default(1)}),B(qd)),pullHandles:J(V({sessionId:F(),maxCount:I().default(1)}),B(Jd)),getFrame:J(V({handle:Jd}),qd.nullable()),getShmStats:J(V({sessionId:F()}),hb.nullable()),updateConfig:J(V({sessionId:F(),config:Vf.partial()}),z()),getStats:J(V({sessionId:F()}),Bf),listActiveSessions:J(z(),B(V({sessionId:F(),codec:F(),outputFormat:F(),createdAtMs:I()})).readonly()),reprobeHwaccel:J(z(),V({backend:F()}),{kind:`mutation`,auth:`admin`})}},_b=V({streamId:F(),label:F().optional(),codec:F(),type:W([`video`,`audio`]),sourceUrl:F()}),vb=V({streamId:F(),format:F(),value:F()}),yb={name:`restreamer`,scope:`system`,mode:`collection`,internal:!0,methods:{registerDevice:J(V({deviceId:I(),streams:B(_b).readonly()}),z(),{kind:`mutation`}),unregisterDevice:J(V({deviceId:I()}),z(),{kind:`mutation`}),getExposedResources:J(V({deviceId:I()}),B(vb).readonly())}},bb=V({viewportWidth:I().int().positive().optional(),viewportHeight:I().int().positive().optional(),devicePixelRatio:I().positive().optional(),downlinkMbps:I().nonnegative().optional(),prefersTier:F().optional()}).partial(),xb={name:`webrtc`,scope:`system`,mode:`collection`,internal:!0,methods:{handleOffer:J(V({streamId:F(),sdpOffer:F()}),F(),{kind:`mutation`}),supportsStream:J(V({streamId:F()}),L()),registerStream:J(V({streamId:F(),codec:F()}),z(),{kind:`mutation`}),unregisterStream:J(V({streamId:F()}),z(),{kind:`mutation`}),createSession:J(V({streamId:F(),hints:bb.optional()}),V({sessionId:F(),sdpOffer:F()}),{kind:`mutation`}),handleAnswer:J(V({sessionId:F(),sdpAnswer:F()}),z(),{kind:`mutation`}),closeSession:J(V({sessionId:F()}),z(),{kind:`mutation`}),hasAdaptiveBitrate:J(V({streamId:F()}),L())}},Sb=nd(`kind`,[V({kind:G(`adaptive`)}),V({kind:G(`profile`),profile:zd}),V({kind:G(`cam-stream`),camStreamId:F().min(1)})]),Cb=V({id:F(),label:F(),target:Sb,codec:F().nullable(),resolution:V({width:I(),height:I()}).nullable(),status:W([`idle`,`connecting`,`streaming`,`error`,`stopped`]).nullable(),inputFps:I().nullable(),decodeFps:I().nullable(),bitrateKbps:I().nullable()}),wb={name:`webrtc-session`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,preferredProvider:`stream-broker`,deviceTypes:[K.Camera],methods:{listStreams:J(V({deviceId:I().int().nonnegative()}),B(Cb)),createSession:J(V({deviceId:I().int().nonnegative(),target:Sb,hints:bb.optional(),relayOnly:L().optional(),consumerAttribution:wp.optional()}),V({sessionId:F(),sdpOffer:F()}),{kind:`mutation`}),handleOffer:J(V({deviceId:I().int().nonnegative(),target:Sb.optional(),sdpOffer:F(),sessionId:F().optional(),relayOnly:L().optional(),nonTrickle:L().optional(),disableTurn:L().optional(),disableIpv6:L().optional(),consumerAttribution:wp.optional()}),V({sessionId:F(),sdpAnswer:F()}),{kind:`mutation`}),handleAnswer:J(V({deviceId:I().int().nonnegative(),sessionId:F(),sdpAnswer:F()}),z(),{kind:`mutation`}),addIceCandidate:J(V({deviceId:I().int().nonnegative(),sessionId:F(),candidate:F(),sdpMid:F().nullable().optional(),sdpMLineIndex:I().int().nullable().optional()}),z(),{kind:`mutation`}),getIceCandidates:J(V({deviceId:I().int().nonnegative(),sessionId:F()}),V({candidates:B(V({candidate:F(),sdpMid:F().nullable(),sdpMLineIndex:I().int().nullable()})),done:L()}),{kind:`query`}),closeSession:J(V({deviceId:I().int().nonnegative(),sessionId:F()}),z(),{kind:`mutation`}),hasAdaptiveBitrate:J(V({deviceId:I().int().nonnegative(),profile:zd}),L()),getSessionState:J(V({deviceId:I().int().nonnegative(),sessionId:F()}),V({pendingRenegotiation:V({target:Sb,epoch:I()}).nullable()}))}},Tb=V({id:F(),source:F(),kind:W([`motion`,`object`,`audio`,`native`]),timeRange:V({startMs:I(),endMs:I()}),thumbnail:F().optional()}),Eb=V({playbackUrl:F(),playbackEndpoints:B(F()).optional(),token:F().optional()}),Db={name:`videoclips`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,methods:{listClips:J(V({deviceId:I(),since:I(),until:I(),limit:I().int().positive().optional()}),B(Tb).readonly(),{kind:`query`,auth:`admin`}),getClipPlayback:J(V({deviceId:I(),clipId:F()}),Eb,{kind:`query`,auth:`admin`})}},Ob=V({engine:eh,steps:B(fh).readonly(),audio:V({engine:eh,modelId:F(),enabled:L(),settings:U(F(),R()).readonly().optional()}).nullable().optional()}),kb=V({id:F(),name:F(),description:F().optional(),config:Ob,createdAt:F(),updatedAt:F()}),Ab=V({enabled:L(),modelId:F(),settings:U(F(),R()).readonly()}),jb=V({addonDefaults:U(F(),Ab).readonly(),maxCameras:I().int().nonnegative().nullable().default(null)}),Mb=V({steps:B(fh).readonly(),audio:V({modelId:F(),enabled:L()}).nullable()}),Nb=V({enabled:L().optional(),modelId:F().optional(),settings:U(F(),R()).readonly().optional()}),Pb=V({pinnedAgentNodeId:F().optional(),stepToggles:U(F(),L()).optional(),stepOverridesByAgent:U(F(),U(F(),Nb)).optional(),pipelineByAgent:U(F(),Mb).optional()}),Fb=V({deviceId:I(),agentNodeId:F(),pinned:L(),reason:W([`manual`,`capacity`,`hardware-affinity`,`failover`,`rebalance`]),assignedAt:I()}),Ib=V({deviceId:I(),decoderNodeId:F(),pinned:L(),reason:W([`manual`,`co-located`,`capacity`,`hardware-affinity`])}),Lb=V({nodeId:F(),online:L(),load:Vh,score:I()}),Rb=V({totalAgents:I(),onlineAgents:I(),totalCameras:I(),attachedCameras:I(),activeCameras:I(),avgInferenceTimeMs:I(),queueDepth:I()}),zb=U(F(),F()),Bb=V({streams:B(V({camStreamId:F(),codec:F(),width:I(),height:I(),fps:I(),kind:F()})).readonly()}),Vb=V({detectionNodeId:F().nullable(),decoderNodeId:F().nullable(),audioNodeId:F().nullable(),pinned:V({detection:L(),decoder:L(),audio:L()}),reasons:V({detection:F().optional(),decoder:F().optional(),audio:F().optional()})}),Hb=V({profiles:B(V({profile:F(),status:F(),codec:F(),width:I(),height:I(),subscribers:I(),inFps:I(),outFps:I()})).readonly(),webrtcSessions:I(),rtspRestream:L()}),Ub=V({framesWritten:I(),getFrameHits:I(),getFrameMisses:I(),budgetMb:I()}),Wb=V({nodeId:F(),formats:B(F()).readonly(),sessionCount:I(),shm:Ub}),Gb=V({enabled:L(),fps:I()}),Kb=V({state:W([`idle`,`installing`,`verifying`,`ready`,`failed`]),error:F().optional()}),qb=W([`idle`,`watching`,`active`]),Jb=V({nodeId:F(),engine:V({backend:F(),device:F()}),phase:qb,configuredFps:I(),actualFps:I(),queueDepth:I(),avgInferenceMs:I(),provisioning:Kb}),Yb=V({nodeId:F(),enabled:L()}),Xb=V({mode:W([`off`,`continuous`,`events`]),active:L(),storageBytes:I()}),Zb=V({deviceId:I(),assignment:Vb,source:Bb,broker:Hb.nullable(),decoder:Wb.nullable(),motion:Gb.nullable(),detection:Jb.nullable(),audio:Yb.nullable(),recording:Xb.nullable(),fetchedAt:I()}),Qb={name:`pipeline-orchestrator`,scope:`system`,mode:`singleton`,exposesDeviceSettings:!0,methods:{assignPipeline:J(V({deviceId:I(),agentNodeId:F()}),V({success:G(!0)}),{kind:`mutation`,auth:`admin`}),unassignPipeline:J(V({deviceId:I()}),V({success:G(!0)}),{kind:`mutation`,auth:`admin`}),rebalance:J(z(),V({migrated:I()}),{kind:`mutation`,auth:`admin`}),getPipelineAssignments:J(z(),B(Fb).readonly()),getPipelineAssignment:J(V({deviceId:I()}),Fb.nullable()),getAgentLoad:J(z(),B(Lb).readonly()),getGlobalMetrics:J(z(),Rb),getCameraMetrics:J(V({deviceId:I()}),Xm.nullable()),getCapabilityBindings:J(V({nodeId:F()}),zb),setCapabilityBinding:J(V({nodeId:F(),capName:F(),addonId:F()}),V({success:G(!0)}),{kind:`mutation`,auth:`admin`}),assignDecoder:J(V({deviceId:I(),nodeId:F()}),z(),{kind:`mutation`,auth:`admin`}),unassignDecoder:J(V({deviceId:I()}),z(),{kind:`mutation`,auth:`admin`}),getDecoderAssignments:J(z(),B(Ib).readonly()),assignAudio:J(V({deviceId:I(),nodeId:F()}),V({success:G(!0)}),{kind:`mutation`,auth:`admin`}),unassignAudio:J(V({deviceId:I()}),V({success:G(!0)}),{kind:`mutation`,auth:`admin`}),getAudioAssignment:J(V({deviceId:I()}),V({nodeId:F(),pinned:L(),assignedAt:I()}).nullable()),getAudioNodeLoad:J(z(),B(V({nodeId:F(),deviceCount:I()}))),getAudioAssignments:J(z(),B(V({deviceId:I(),nodeId:F(),pinned:L(),assignedAt:I()}))),getDecoderAssignment:J(V({deviceId:I(),pipelineNodeId:F().optional()}),Ib),getAgentSettings:J(V({agentNodeId:F()}),jb.nullable()),listAgentSettings:J(z(),B(V({nodeId:F(),settings:jb})).readonly()),setAgentAddonDefaults:J(V({agentNodeId:F(),defaults:U(F(),Ab)}),V({success:G(!0)}),{kind:`mutation`,auth:`admin`}),removeAgentSettings:J(V({agentNodeId:F()}),V({success:L(),removed:L()}),{kind:`mutation`,auth:`admin`}),setAgentMaxCameras:J(V({agentNodeId:F(),maxCameras:I().int().nonnegative().nullable()}),V({success:G(!0)}),{kind:`mutation`,auth:`admin`}),getCameraSettings:J(V({deviceId:I()}),Pb.nullable()),setCameraStepToggle:J(V({deviceId:I(),addonId:F(),enabled:L().nullable()}),V({success:G(!0)}),{kind:`mutation`,auth:`admin`}),getCameraStepOverrides:J(V({deviceId:I()}),U(F(),U(F(),Nb)).nullable()),setCameraStepOverride:J(V({deviceId:I(),agentNodeId:F(),addonId:F(),patch:Nb.nullable()}),V({success:G(!0)}),{kind:`mutation`,auth:`admin`}),setCameraPipelineForAgent:J(V({deviceId:I(),agentNodeId:F(),pipeline:Mb.nullable()}),V({success:G(!0)}),{kind:`mutation`,auth:`admin`}),resolvePipeline:J(V({deviceId:I(),agentNodeId:F().optional()}),Ob),getCameraStatus:J(V({deviceId:I()}),Zb),getCameraStatuses:J(V({deviceIds:B(I()).optional()}),B(Zb).readonly()),listTemplates:J(z(),B(kb).readonly()),saveTemplate:J(V({name:F(),description:F().optional(),config:Ob}),kb,{kind:`mutation`,auth:`admin`}),updateTemplate:J(V({id:F(),name:F().optional(),description:F().optional(),config:Ob.optional()}),kb,{kind:`mutation`,auth:`admin`}),deleteTemplate:J(V({id:F()}),V({success:G(!0)}),{kind:`mutation`,auth:`admin`})}},$b=V({level:Gm,classification:V({labels:B(Km).readonly(),inferenceMs:I()}).optional(),timestamp:I()}),ex=V({minConfidence:I().min(0).max(1).default(.3),allowedClasses:B(F()).default([])}),tx=V({labels:B(Km).readonly(),rawLabels:B(Km).readonly().optional(),inferenceMs:I()}),nx={name:`audio-analyzer`,scope:`system`,mode:`singleton`,methods:{analyseChunk:J(V({chunk:Wm,settings:ex}),$b.nullable(),{kind:`mutation`}),classify:J(Wm,tx,{timeoutMs:3e4}),isReady:J(z(),L()),dispose:J(z(),z(),{kind:`mutation`}),reprobeAudioEngine:J(z(),V({backend:F()}),{kind:`mutation`,auth:`admin`})}},rx={name:`audio-analysis`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[K.Camera],exposesDeviceSettings:!0,methods:{resolveDeviceSettings:J(V({deviceId:I()}),Pd())},events:{onAudioLevel:of(V({deviceId:I(),rms:I(),dbfs:I()}))}},ix=W([`f32le`,`s16le`]),ax=V({codec:F(),canDecode:L(),canEncode:L(),label:F().optional()}),ox=V({codec:F(),sourceSampleRate:I().int().positive(),sourceChannels:I().int().positive(),extraData:Ld(Uint8Array).optional(),targetSampleRate:I().int().positive(),targetChannels:I().int().positive(),targetFormat:ix.optional(),idleMs:I().int().positive().optional(),tag:F().optional()}),sx=V({codec:F(),sourceSampleRate:I().int().positive(),sourceChannels:I().int().positive(),sourceFormat:ix.optional(),targetSampleRate:I().int().positive(),targetChannels:I().int().positive(),bitrateKbps:I().int().positive().optional(),idleMs:I().int().positive().optional(),tag:F().optional()}),cx=V({data:Ld(Uint8Array),sampleRate:I().int().positive(),channels:I().int().positive(),format:ix,pts:I()}),lx=V({data:Ld(Uint8Array),codec:F(),pts:I(),frameComplete:L()}),ux=V({sessionId:F(),kind:W([`decode`,`encode`]),codec:F(),sourceSampleRate:I(),sourceChannels:I(),targetSampleRate:I(),targetChannels:I(),format:ix,tag:F().optional(),createdAtMs:I(),lastActivityMs:I(),framesIn:I(),framesOut:I()}),dx={name:`audio-codec`,scope:`system`,mode:`singleton`,methods:{listSupportedCodecs:J(z(),B(ax).readonly()),canHandle:J(V({codec:F(),kind:W([`decode`,`encode`])}),L()),createDecodeSession:J(ox,V({sessionId:F(),nodeId:F()}),{kind:`mutation`}),createEncodeSession:J(sx,V({sessionId:F(),nodeId:F()}),{kind:`mutation`}),closeSession:J(V({sessionId:F(),nodeId:F().optional()}),z(),{kind:`mutation`}),pushEncodedFrame:J(V({sessionId:F(),nodeId:F().optional(),data:Ld(Uint8Array),pts:I().optional()}),z(),{kind:`mutation`}),pullPcm:J(V({sessionId:F(),nodeId:F().optional(),maxCount:I().int().positive().default(8)}),B(cx)),pushPcm:J(V({sessionId:F(),nodeId:F().optional(),data:Ld(Uint8Array),pts:I().optional()}),z(),{kind:`mutation`}),pullEncoded:J(V({sessionId:F(),nodeId:F().optional(),maxCount:I().int().positive().default(8)}),B(lx)),flushEncode:J(V({sessionId:F(),nodeId:F().optional()}),B(lx),{kind:`mutation`}),listActiveSessions:J(z(),B(ux).readonly())}},fx=V({embedding:B(I()),inferenceMs:I()}),px=V({modelId:F(),embeddingDim:I(),ready:L()}),mx={name:`embedding-encoder`,scope:`system`,mode:`collection`,internal:!0,methods:{encode:J(V({crop:Ld(Uint8Array),width:I(),height:I()}),fx),encodeText:J(V({text:F()}),fx),getInfo:J(z(),px)}},hx=V({childKey:F(),section:F(),order:I().optional(),collapsed:L().optional()}),gx=V({id:F(),source:V({sourceKey:F(),cap:F(),fieldPath:F()}),target:V({cap:F(),fieldPath:F(),itemKey:F().optional()}),transform:nd(`kind`,[V({kind:G(`identity`)}),V({kind:G(`enum-map`),mapping:U(F(),H([F(),I(),L()])),fallback:H([F(),I(),L()]).optional()}),V({kind:G(`linear`),scale:I(),offset:I(),clamp:od([I(),I()]).readonly().optional()})]).optional()}),_x=V({id:I(),stableId:F(),addonId:F(),type:W(K),name:F(),location:F().nullable(),disabled:L(),parentDeviceId:I().nullable(),role:F().nullable().optional(),online:L(),probed:L().optional(),features:B(F()),isCamera:L(),config:U(F(),R()),metadata:U(F(),R()).nullable().optional(),sourceInfo:im.optional(),integrationId:F().optional(),linkDeviceId:I().nullable().optional(),primaryChildEntityId:F().nullable().optional(),childLayout:B(hx).readonly().optional(),deviceLinks:B(gx).readonly().optional()}),vx=V({key:F(),value:R(),description:F().optional()}),yx=V({id:I(),stableId:F(),type:F(),name:F(),location:F().nullable(),disabled:L(),parentDeviceId:I().nullable(),role:F().nullable().optional()}),bx=V({id:I(),stableId:F(),addonId:F(),type:F(),name:F(),location:F().nullable(),disabled:L(),parentDeviceId:I().nullable(),metadata:U(F(),R()).nullable().optional(),sourceInfo:im.optional(),integrationId:F().optional(),linkDeviceId:I().nullable().optional(),primaryChildEntityId:F().nullable().optional(),childLayout:B(hx).readonly().optional(),deviceLinks:B(gx).readonly().optional(),role:F().nullable().optional()}),xx=R().nullable(),Sx=V({streamId:F(),width:I().optional(),height:I().optional(),codec:F().optional(),fps:I().optional(),bitrateKbps:I().optional()}),Cx=V({addonId:F(),stableId:F(),id:I(),type:F(),name:F(),location:F().nullable().optional(),disabled:L().optional(),parentDeviceId:I().nullable(),role:F().nullable().optional(),features:B(F()).optional(),config:U(F(),R())}),wx=V({deviceId:I()}),Tx=V({deviceId:I(),data:U(F(),R())}),Ex={name:`device-manager`,scope:`system`,mode:`singleton`,methods:{allocateDeviceId:J(V({addonId:F(),stableId:F()}),V({id:I()}),{kind:`mutation`}),registerDevice:J(Cx,z(),{kind:`mutation`}),removeDevice:J(wx,z(),{kind:`mutation`}),persistConfig:J(Tx,z(),{kind:`mutation`}),loadConfig:J(V({deviceId:I()}),U(F(),R())),loadRuntimeState:J(V({deviceId:I()}),U(F(),R())),loadMeta:J(V({deviceId:I()}),bx.nullable()),setName:J(V({deviceId:I(),name:F()}),z(),{kind:`mutation`,auth:`admin`}),setLocation:J(V({deviceId:I(),location:F().nullable()}),z(),{kind:`mutation`,auth:`admin`}),setType:J(V({deviceId:I(),type:W(K)}),z(),{kind:`mutation`,auth:`admin`}),setIntegrationId:J(V({deviceId:I(),integrationId:F()}),z(),{kind:`mutation`,auth:`admin`}),setLinkDeviceId:J(V({deviceId:I(),linkDeviceId:I().nullable()}),z(),{kind:`mutation`,auth:`admin`}),setPrimaryChildEntityId:J(V({deviceId:I(),primaryChildEntityId:F().nullable()}),z(),{kind:`mutation`,auth:`admin`}),setChildLayout:J(V({deviceId:I(),childLayout:B(hx).readonly()}),z(),{kind:`mutation`,auth:`admin`}),setDeviceLinks:J(V({deviceId:I(),deviceLinks:B(gx).readonly()}),z(),{kind:`mutation`,auth:`admin`}),getWireableFields:J(V({deviceId:I()}),V({caps:B(V({cap:F(),fields:B(V({path:F(),kind:W([`string`,`number`,`boolean`,`enum`]),enumValues:B(F()).optional()})).readonly()})).readonly()}),{kind:`query`}),setRole:J(V({deviceId:I(),role:F().nullable()}),z(),{kind:`mutation`,auth:`admin`}),applyInitialMeta:J(V({deviceId:I(),name:F().optional(),location:F().nullable().optional(),type:W(K).optional(),integrationId:F().optional(),linkDeviceId:I().nullable().optional(),role:F().nullable().optional()}),z(),{kind:`mutation`,auth:`admin`}),setMetadata:J(V({deviceId:I(),patch:U(F(),R())}),z(),{kind:`mutation`,auth:`admin`}),listLocations:J(z(),B(F())),addLocation:J(V({name:F()}),z(),{kind:`mutation`,auth:`admin`}),removeLocation:J(V({name:F(),cascade:L().optional()}),z(),{kind:`mutation`,auth:`admin`}),setDisabled:J(V({deviceId:I(),disabled:L()}),z(),{kind:`mutation`,auth:`admin`}),listPersistedByAddon:J(V({addonId:F()}),B(yx)),listAll:J(V({addonId:F().optional()}),B(_x)),getDevice:J(V({deviceId:I()}),_x.nullable()),getChildren:J(V({parentDeviceId:I()}),B(_x)),getStreamSources:J(V({deviceId:I()}),B(Gd)),getConfigSchema:J(V({deviceId:I()}),B(vx)),getSettingsSchema:J(V({deviceId:I()}),xx),updateConfig:J(V({deviceId:I(),values:U(F(),R())}),V({success:G(!0)}),{kind:`mutation`,auth:`admin`}),enable:J(V({deviceId:I()}),V({success:G(!0)}),{kind:`mutation`,auth:`admin`}),disable:J(V({deviceId:I()}),V({success:G(!0)}),{kind:`mutation`,auth:`admin`}),remove:J(V({deviceId:I()}),V({success:G(!0)}),{kind:`mutation`,auth:`admin`}),removeByIntegration:J(V({integrationId:F()}),V({removed:I()}),{kind:`mutation`,auth:`admin`}),getStreamProfileMap:J(V({deviceId:I()}),U(F(),F().nullable())),setStreamProfileMap:J(V({deviceId:I(),profileMap:U(F(),F().nullable())}),V({success:G(!0)}),{kind:`mutation`,auth:`admin`}),probeStreams:J(V({deviceId:I()}),B(Sx),{kind:`mutation`,auth:`admin`}),getBindings:J(V({deviceId:I()}),V({deviceId:I(),entries:B(V({capName:F(),kind:W([`native`,`wrapped`]),providerAddonId:F(),providerNodeId:F(),nativeAddonId:F()}))})),getAllBindings:J(V({}),B(V({deviceId:I(),entries:B(V({capName:F(),kind:W([`native`,`wrapped`]),providerAddonId:F(),providerNodeId:F(),nativeAddonId:F()}))}))),setWrapperActive:J(V({deviceId:I(),capName:F(),wrapperAddonId:F(),active:L()}),z(),{kind:`mutation`,auth:`admin`}),listWrappersForCap:J(V({capName:F()}),B(F())),listBindableCapsForDeviceType:J(V({deviceType:F()}),B(V({capName:F(),wrappers:B(F())}))),getDeviceSettingsAggregate:J(V({deviceId:I()}),K_.nullable()),getDeviceLiveInfoAggregate:J(V({deviceId:I()}),K_.nullable()),getDeviceAggregate:J(V({deviceId:I()}),V({settings:K_.nullable(),live:K_.nullable()})),runDeviceAction:J(V({deviceId:I().int().nonnegative(),action:F().min(1),input:R()}),R(),{kind:`mutation`}),updateDeviceField:J(V({deviceId:I(),writerCapName:F(),writerAddonId:F(),key:F(),value:R()}),V({success:G(!0)}),{kind:`mutation`,auth:`admin`}),updateDeviceFieldsBatch:J(V({deviceId:I(),changes:B(V({writerCapName:F(),writerAddonId:F(),key:F(),value:R()}))}),V({success:G(!0),failures:B(V({writerCapName:F(),writerAddonId:F(),error:F()}))}),{kind:`mutation`,auth:`admin`}),discoverDevices:J(V({addonId:F()}),B(k_),{kind:`mutation`,auth:`admin`}),adoptDevice:J(V({addonId:F(),candidate:k_,integrationId:F().optional()}),A_,{kind:`mutation`,auth:`admin`}),getCreationSchema:J(V({addonId:F(),type:W(K)}),R().nullable()),createDevice:J(V({addonId:F(),type:W(K),config:U(F(),R()),integrationId:F().optional()}),A_,{kind:`mutation`,auth:`admin`}),testCreationField:J(V({addonId:F(),type:W(K),key:F(),value:R(),formValues:U(F(),R()).optional()}),j_,{kind:`mutation`,auth:`admin`}),adoptionListCandidates:J(ey.extend({addonId:F()}),ty,{auth:`admin`}),adoptionRefresh:J(V({addonId:F(),integrationId:F()}),ry,{kind:`mutation`,auth:`admin`}),adoptionAdopt:J(ay.extend({addonId:F()}),oy,{kind:`mutation`,auth:`admin`}),adoptionRelease:J(sy.extend({addonId:F()}),z(),{kind:`mutation`,auth:`admin`}),testField:J(V({deviceId:I(),key:F(),value:R()}),j_,{kind:`mutation`,auth:`admin`}),getDeviceStatusAggregate:J(V({deviceId:I(),caps:B(F()).readonly().optional()}),U(F(),R().nullable()))}},Dx={name:`device-state`,scope:`system`,mode:`singleton`,methods:{getSnapshot:J(V({deviceId:I()}),U(F(),U(F(),R()))),getCapSlice:J(V({deviceId:I(),capName:F()}),U(F(),R()).nullable()),getAllSnapshots:J(V({}),U(F(),U(F(),U(F(),R())))),setCapSlice:J(V({deviceId:I(),capName:F(),slice:U(F(),R())}),z(),{kind:`mutation`})},events:{onChanged:of(V({deviceId:I(),capName:F(),slice:U(F(),R())}))}},Ox=V({userId:F(),username:F(),email:F().optional(),displayName:F().optional(),isAdmin:L().default(!1)}),kx={name:`auth-provider`,scope:`system`,mode:`collection`,internal:!0,methods:{validateCredentials:J(V({username:F(),password:F()}),Ox.nullable(),{kind:`mutation`}),getLoginUrl:J(V({state:F()}),F()),handleCallback:J(U(F(),F()),Ox,{kind:`mutation`}),validateToken:J(V({token:F()}),Ox.nullable())}},Ax=V({url:F(),hostname:F(),port:I(),protocol:W([`http`,`https`])}),jx=V({connected:L(),endpoint:Ax.nullable(),error:F().optional()}),Mx=Ax.extend({id:F(),label:F(),mode:F().optional(),sourcePort:I().optional()}),Nx={name:`network-access`,scope:`system`,mode:`collection`,providerKind:`ingress`,methods:{start:J(z(),Ax,{kind:`mutation`}),stop:J(z(),z(),{kind:`mutation`}),getEndpoint:J(z(),Ax.nullable()),getStatus:J(z(),jx),listEndpoints:J(z(),B(Mx).readonly())}},Px=V({urls:H([F(),B(F())]),username:F().optional(),credential:F().optional()}),Fx={name:`turn-provider`,scope:`system`,mode:`collection`,methods:{getTurnServers:J(z(),B(Px).readonly())}},Ix=V({base64:F(),contentType:F()}),Lx=V({lastCapturedAt:I().nullable(),cacheAgeMs:I().nullable(),lastBytes:I().nullable(),lastStreamId:F().nullable()}),Rx={name:`snapshot`,scope:`device`,deviceNative:!0,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[K.Camera],exposesDeviceSettings:!0,methods:{getSnapshot:J(V({deviceId:I(),streamId:F().optional(),force:L().optional()}),Ix.nullable()),invalidateCache:J(V({deviceId:I()}),z(),{kind:`mutation`,auth:`admin`})},status:{schema:Lx,kind:`poll`}},zx={name:`snapshot-provider`,scope:`system`,mode:`collection`,methods:{supportsDevice:J(V({deviceId:I()}),L()),getSnapshot:J(V({deviceId:I(),streamId:F().optional()}),Ix.nullable())}},Bx={name:`notification-output`,scope:`system`,mode:`collection`,methods:{send:J(V({title:F(),body:F(),imageUrl:F().optional(),deviceId:I().optional(),eventId:F().optional(),priority:W([`low`,`normal`,`high`,`critical`]).default(`normal`),metadata:U(F(),R()).optional()}),z(),{kind:`mutation`}),sendTest:J(z(),V({success:L(),error:F().optional()}),{kind:`mutation`})}},Vx=V({deviceIds:B(I()).readonly().optional(),classNames:B(F()).readonly().optional(),zoneIds:B(F()).readonly().optional(),minConfidence:I().optional(),source:W([`pipeline`,`onboard`,`any`]).optional(),schedule:V({days:B(I()).readonly(),startHour:I(),endHour:I()}).optional(),cooldownSeconds:I().optional(),minDwellSeconds:I().optional(),eventTypeTokens:B(F()).readonly().optional()}),Hx=V({title:F(),body:F(),imageMode:W([`crop`,`annotated`,`full`,`none`])}),Ux=V({id:F(),name:F(),enabled:L(),eventTypes:B(F()).readonly(),conditions:Vx,outputs:B(F()).readonly(),template:Hx.optional(),priority:W([`low`,`normal`,`high`,`critical`])}),Wx=V({ruleId:F(),eventId:F(),timestamp:I(),wouldFire:L(),reason:F().optional()}),Gx=V({id:F(),ruleId:F(),ruleName:F(),eventId:F(),timestamp:I(),outputs:B(F()).readonly(),success:L(),error:F().optional(),deviceId:I().optional()}),Kx=V({ruleId:F().optional(),deviceId:I().optional(),from:I().optional(),to:I().optional(),limit:I().optional()}),qx={name:`advanced-notifier`,scope:`system`,mode:`singleton`,internal:!0,methods:{getRules:J(z(),V({rules:B(Ux).readonly()})),upsertRule:J(V({rule:Ux}),V({success:G(!0)}),{kind:`mutation`}),deleteRule:J(V({ruleId:F()}),V({success:G(!0)}),{kind:`mutation`}),testRule:J(V({ruleId:F(),lookbackMinutes:I()}),V({results:B(Wx).readonly()}),{kind:`mutation`}),getHistory:J(V({filter:Kx.optional()}),V({entries:B(Gx).readonly()}))}},Jx={name:`detection-pipeline`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[K.Camera],exposesDeviceSettings:!0,methods:{}},Yx={name:`camera-pipeline-config`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[K.Camera],exposesDeviceSettings:!0,methods:{}},Xx=W([`new`,`entered`,`left`,`moving`,`idle`]),Zx=W([`motion`,`object`,`audio`]),Qx=V({x:I(),y:I(),timestamp:I(),bbox:Hm}),$x=V({timestamp:I(),position:Qx,mediaKey:F()}),eS=V({trackId:F(),deviceId:I(),className:F(),label:F().optional(),firstSeen:I(),lastSeen:I(),positions:B(Qx).readonly(),snapshots:B($x).readonly(),zonesVisited:B(F()).readonly(),totalDistance:I(),state:Xx,active:L()}),tS={id:F(),deviceId:I(),timestamp:I()},nS=V({...tS,kind:G(`motion`),regionCount:I(),regions:B(V({bbox:Hm,pixelCount:I(),intensity:I()})).readonly().optional(),frameWidth:I().optional(),frameHeight:I().optional(),mediaUrl:F().optional()}),rS=W([`pipeline`,`onboard`]),iS=V({...tS,kind:G(`object`),source:rS.optional(),frameId:F().optional(),trackId:F().optional(),className:F(),label:F().optional(),confidence:I().optional(),bbox:Hm.optional(),zones:B(F()).readonly().optional(),state:Xx.optional(),frameWidth:I().optional(),frameHeight:I().optional(),mediaKey:F().optional(),mediaUrl:F().optional()}),aS=V({...tS,kind:G(`audio`),rms:I(),dbfs:I(),classification:V({className:F(),originalClass:F().optional(),score:I()}).optional(),mediaUrl:F().optional()}),oS=W([`crop`,`thumbnail`,`snapshot`,`firstFrame`,`lastFrame`,`fullFrame`,`fullFrameBoxed`,`faceCrop`,`plateCrop`]),sS=V({key:F(),kind:oS,base64:F(),sizeBytes:I(),timestamp:I()}),cS=V({deviceId:I(),since:I().optional(),until:I().optional(),limit:I().int().min(1).max(5e3).default(1e3),projection:W([`full`,`slim`]).optional()}),lS=cS.extend({classFilter:F().optional()}),uS=V({trackId:F(),className:F(),confidence:I(),bbox:Hm,zones:B(F()).readonly(),state:Xx}),dS={name:`pipeline-analytics`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[K.Camera],exposesDeviceSettings:!0,methods:{getActiveTracks:J(V({deviceId:I()}),B(eS).readonly()),getTrack:J(V({deviceId:I(),trackId:F()}),eS.nullable()),listTracks:J(V({deviceId:I(),since:I().optional(),until:I().optional(),limit:I().optional()}),B(eS).readonly()),clearTracks:J(V({deviceId:I()}),z(),{kind:`mutation`,auth:`admin`}),getMotionEvents:J(cS,B(nS).readonly()),getObjectEvents:J(lS,B(iS).readonly()),getAudioEvents:J(cS,B(aS).readonly()),getEventDensity:J(V({deviceId:I(),since:I(),until:I(),bucketMs:I().int().positive()}),B(V({bucketStart:I(),motion:I().int(),object:I().int(),audio:I().int()})).readonly()),pruneEventsBefore:J(V({deviceId:I(),cutoffMs:I()}),V({motion:I().int(),object:I().int(),audio:I().int()}),{kind:`mutation`,auth:`admin`}),getEventMedia:J(V({eventId:F(),kind:oS.optional()}),B(sS).readonly()),getTrackMedia:J(V({trackId:F()}),B(sS).readonly())},events:{onFrameTracked:{data:V({deviceId:I(),timestamp:I(),frameWidth:I(),frameHeight:I(),detections:B(uS).readonly()})},onTrackStarted:{data:V({deviceId:I(),trackId:F(),className:F()})},onTrackEnded:{data:V({deviceId:I(),trackId:F(),className:F(),durationMs:I()})},onDetectionEvent:{data:V({deviceId:I(),kind:Zx,eventId:F(),timestamp:I()})}}},fS=V({total:I(),user:I(),system:I(),irq:I(),nice:I(),loadAvg:od([I(),I(),I()]),cores:I()}),pS=V({percent:I(),totalBytes:I(),usedBytes:I(),availableBytes:I(),swapUsedBytes:I(),swapTotalBytes:I()}),mS=V({readBytes:I(),writeBytes:I(),readOps:I(),writeOps:I(),timestampMs:I()}),hS=V({rxBytes:I(),txBytes:I(),rxPackets:I(),txPackets:I(),rxErrors:I(),txErrors:I(),timestampMs:I()}),gS=V({utilization:I(),model:F(),memoryUsedBytes:I(),memoryTotalBytes:I(),temperature:I().nullable()}),_S=V({openFds:I(),threadCount:I(),activeHandles:I(),activeRequests:I()}),vS=V({avg10:I(),avg60:I(),avg300:I()}),yS=V({some:vS,full:vS.nullable()}),bS=V({cpu:fS,memory:pS,gpu:gS.nullable(),network:hS,disk:mS,pressure:V({cpu:yS.nullable(),memory:yS.nullable(),io:yS.nullable()}),process:_S,cpuTemperature:I().nullable(),timestampMs:I()}),xS=V({path:F(),totalBytes:I(),usedBytes:I(),availableBytes:I(),percent:I()}),SS=V({pid:I(),cpu:I(),memory:I(),privateBytes:I().optional(),sharedBytes:I().optional()}),CS=V({addonId:F(),nodeId:F(),role:W([`hub`,`worker`]),pid:I(),state:W([`starting`,`running`,`stopping`,`stopped`,`crashed`]),uptimeSec:I()}),wS=V({pid:I(),ppid:I(),pgid:I(),classification:W([`root`,`managed`,`system`,`ghost`]),addonId:F().nullable(),nodeId:F().nullable(),command:F(),cpuPercent:I(),memoryRssBytes:I(),uptimeSec:I(),orphaned:L()}),TS=V({pid:I(),force:L().optional()}),ES=V({success:L(),reason:F().optional(),signal:W([`SIGTERM`,`SIGKILL`]).optional()}),DS=V({addonId:F()}),OS=V({success:L(),path:F().optional(),pid:I().optional(),reason:F().optional()}),kS=V({cpuPercent:I(),memoryPercent:I(),memoryUsedMB:I(),memoryTotalMB:I(),diskPercent:I().optional(),temperature:I().optional(),gpuPercent:I().optional(),gpuMemoryPercent:I().optional()}),AS={name:`metrics-provider`,scope:`system`,mode:`singleton`,methods:{collectSnapshot:J(z(),bS),getCached:J(z(),bS.nullable()),getCurrent:J(z(),kS),getDiskSpace:J(V({dirPath:F()}),xS),getGpuInfo:J(z(),gS.nullable()),getCpuTemperature:J(z(),I().nullable()),getProcessStats:J(V({pids:B(I())}),B(SS)),listAddonInstances:J(z(),B(CS).readonly()),getAddonStats:J(V({addonId:F()}),SS.nullable()),listNodeProcesses:J(z(),B(wS).readonly()),killProcess:J(TS,ES,{kind:`mutation`,auth:`admin`}),dumpHeapSnapshot:J(DS,OS,{kind:`mutation`,auth:`admin`})}},jS=V({id:F(),name:F()}),MS=V({pan:I(),tilt:I(),zoom:I()}),NS=V({pan:I().optional(),tilt:I().optional(),zoom:I().optional(),speed:I().optional()}),PS=MS.extend({autofocus:L()}),FS=V({hasPan:L(),hasTilt:L(),hasZoom:L(),supportsPresets:L(),maxPresets:I().optional(),hasAutofocus:L()}),IS={name:`ptz`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Camera],deviceConfig:{ui:{kind:`widget`,widgetId:`host/ptz-panel`,tab:`ptz`,topTab:!0,label:`PTZ`,order:0}},methods:{move:J(NS.extend({deviceId:I()}),z(),{kind:`mutation`}),continuousMove:J(NS.extend({deviceId:I()}),z(),{kind:`mutation`}),stop:J(V({deviceId:I()}),z(),{kind:`mutation`}),getPresets:J(V({deviceId:I()}),B(jS)),goToPreset:J(V({deviceId:I(),presetId:F()}),z(),{kind:`mutation`}),savePreset:J(V({deviceId:I(),presetId:F(),name:F()}),z(),{kind:`mutation`,auth:`admin`}),deletePreset:J(V({deviceId:I(),presetId:F()}),z(),{kind:`mutation`,auth:`admin`}),getOptions:J(V({deviceId:I()}),FS),goHome:J(V({deviceId:I()}),z(),{kind:`mutation`}),getPosition:J(V({deviceId:I()}),MS),setAutofocus:J(V({deviceId:I(),enabled:L()}),z(),{kind:`mutation`})},status:{schema:PS,kind:`command-driven`}},LS=V({id:F(),type:F(),timestamp:I(),label:F().optional(),thumbnailUrl:F().optional(),clipUrl:F().optional(),metadata:U(F(),R()).optional()}),RS={name:`events`,scope:`device`,mode:`singleton`,deviceTypes:[K.Camera],methods:{getEvents:J(V({deviceId:I(),from:I().optional(),to:I().optional(),limit:I().optional()}),B(LS)),getEventThumbnail:J(V({deviceId:I(),eventId:F()}),V({base64:F(),contentType:F()}).nullable()),getEventClipUrl:J(V({deviceId:I(),eventId:F()}),F().nullable())}},zS=V({id:F(),name:F(),sampleCount:I().int().nonnegative(),coverMediaKey:F().optional(),coverBase64:F().optional()}),BS=V({id:F(),source:W([`detected`,`photo`]),addedAt:I().int(),deviceId:I().int().optional(),base64:F().optional()}),VS=V({faceId:F(),deviceId:I().int(),trackId:F(),timestamp:I().int(),recognizedIdentityId:F().optional(),identityName:F().optional(),assigned:L(),base64:F().optional()}),HS=W([`unassigned`,`recognized`,`all`]),US=V({key:F(),kind:F(),base64:F(),sizeBytes:I(),timestamp:I()}),WS={name:`face-gallery`,scope:`system`,mode:`singleton`,methods:{listIdentities:J(z(),B(zS).readonly()),createIdentity:J(V({name:F().min(1)}),zS,{kind:`mutation`,auth:`admin`}),renameIdentity:J(V({id:F(),name:F().min(1)}),z(),{kind:`mutation`,auth:`admin`}),deleteIdentity:J(V({id:F()}),z(),{kind:`mutation`,auth:`admin`}),listIdentitySamples:J(V({identityId:F()}),B(BS).readonly()),removeSample:J(V({identityId:F(),sampleId:F()}),z(),{kind:`mutation`,auth:`admin`}),listRecentFaces:J(V({limit:I().int().positive().optional(),filter:HS.optional()}).optional(),B(VS).readonly()),getFaceByTrack:J(V({deviceId:I().int(),trackId:F()}),VS.nullable()),getFaceMedia:J(V({faceId:F()}),B(US).readonly()),assignFace:J(V({faceId:F(),identityId:F()}),z(),{kind:`mutation`,auth:`admin`}),unassignFace:J(V({faceId:F()}),z(),{kind:`mutation`,auth:`admin`}),deleteFace:J(V({faceId:F()}),z(),{kind:`mutation`,auth:`admin`}),assignFaces:J(V({faceIds:B(F()).min(1),identityId:F()}),V({assigned:I().int(),failed:B(F()).readonly()}),{kind:`mutation`,auth:`admin`}),unassignFaces:J(V({faceIds:B(F()).min(1)}),V({unassigned:I().int(),failed:B(F()).readonly()}),{kind:`mutation`,auth:`admin`}),suggestFaceClusters:J(V({threshold:I().min(0).max(1).optional(),minClusterSize:I().int().min(2).optional(),limit:I().int().positive().optional()}).optional(),B(V({faceIds:B(F()).readonly(),representativeFaceId:F(),size:I().int(),cohesion:I()})).readonly())}},GS=V({plateId:F(),deviceId:I().int(),trackId:F(),timestamp:I().int(),text:F(),score:I(),corrected:L(),base64:F().optional()}),KS=V({key:F(),kind:F(),base64:F(),sizeBytes:I(),timestamp:I()}),qS=V({plateIds:B(F()).readonly(),representativePlateId:F(),representativeText:F(),size:I().int(),cohesion:I()}),JS={name:`plate-gallery`,scope:`system`,mode:`singleton`,methods:{listPlates:J(V({deviceId:I().int().optional(),limit:I().int().positive().optional()}).optional(),B(GS).readonly()),getPlateByTrack:J(V({deviceId:I().int(),trackId:F()}),GS.nullable()),getPlateMedia:J(V({plateId:F()}),B(KS).readonly()),searchPlates:J(V({text:F().min(1),maxDistance:I().int().min(0).optional(),limit:I().int().positive().optional()}),B(GS).readonly()),suggestPlateClusters:J(V({maxDistance:I().int().min(0).optional(),minClusterSize:I().int().min(2).optional(),limit:I().int().positive().optional()}).optional(),B(qS).readonly()),correctPlateText:J(V({plateId:F(),text:F().min(1)}),z(),{kind:`mutation`,auth:`admin`}),deletePlate:J(V({plateId:F()}),z(),{kind:`mutation`,auth:`admin`})}},YS=V({deviceId:I(),enabled:L(),activeMode:W([`off`,`continuous`,`events`]),nodeId:F(),storageBytes:I()}),XS=V({profile:F(),startMs:I(),endMs:I()}),ZS=V({deviceId:I(),ranges:B(XS)}),QS=V({deviceId:I(),days:B(I())}),$S=V({deviceId:I(),localMasterPath:F().nullable(),playbackUrl:F().nullable(),playbackEndpoints:B(F())}),eC=V({deviceId:I(),usedBytes:I()}),tC=V({locationId:F().nullable(),usedBytes:I(),availableBytes:I().nullable(),totalBytes:I().nullable()}),nC=V({nodeId:F(),totalUsedBytes:I(),devices:B(eC),locations:B(tC)}),rC=nd(`kind`,[V({kind:G(`segment`),startMs:I(),durMs:I(),bytes:I()}),V({kind:G(`gap`),nearestEdgeMs:I().nullable()})]),iC=V({data:Ld(Uint8Array)}),aC={name:`recording`,scope:`system`,mode:`singleton`,exposesDeviceSettings:!0,status:{schema:YS,kind:`command-driven`},methods:{getAvailability:J(V({deviceId:I(),fromMs:I(),toMs:I()}),ZS,{kind:`query`,auth:`admin`}),getDaysWithRecordings:J(V({deviceId:I(),fromMs:I(),toMs:I(),tzOffsetMinutes:I()}),QS,{kind:`query`,auth:`admin`}),getPlaybackManifest:J(V({deviceId:I(),fromMs:I(),toMs:I()}),$S,{kind:`query`,auth:`admin`}),getStorageUsage:J(V({}),nC,{kind:`query`,auth:`admin`}),getDeviceConfig:J(V({deviceId:I()}),Ff,{kind:`query`,auth:`admin`}),locateSegment:J(V({deviceId:I(),profile:F(),epochMs:I()}),rC,{kind:`query`,auth:`admin`}),readSegmentBytes:J(V({deviceId:I(),profile:F(),startMs:I()}),iC,{kind:`query`,auth:`admin`}),setDeviceConfig:J(V({deviceId:I(),config:Ff}),Ff,{kind:`mutation`,auth:`admin`}),rescanStorage:J(V({deviceId:I()}),YS,{kind:`mutation`,auth:`admin`}),pruneFootage:J(V({deviceId:I()}),V({floorMs:I().nullable(),deletedBuckets:I().int(),reclaimedBytes:I().int()}),{kind:`mutation`,auth:`admin`})}},oC=V({host:F(),port:I().int().positive().optional(),onvifPort:I().int().positive().optional(),rtspPort:I().int().positive().optional(),https:L().optional(),username:F().optional(),password:F().optional(),onvifProfile:F().optional()}),sC=V({host:F(),port:I().int().positive().nullable(),onvifPort:I().int().positive().nullable(),rtspPort:I().int().positive().nullable(),https:L().nullable(),hasUsername:L(),hasPassword:L(),onvifProfile:F().nullable()}),cC={name:`camera-credentials`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Camera],methods:{getCredentials:J(V({deviceId:I()}),oC.nullable(),{kind:`query`,auth:`admin`})},status:{schema:sC,kind:`command-driven`}},lC={name:`reboot`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Camera,K.Sensor,K.Switch],methods:{reboot:J(V({deviceId:I().int().nonnegative()}),V({success:G(!0)}),{kind:`mutation`,auth:`admin`})}},uC={name:`button`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Button],methods:{press:J(V({deviceId:I().int().nonnegative()}),z(),{kind:`mutation`,auth:`admin`})}},dC=W([`text`,`timestamp`,`watermark`]),fC=W([`top-left`,`top-center`,`top-right`,`bottom-left`,`bottom-center`,`bottom-right`,`custom`]),pC=V({overlays:B(V({id:F(),kind:dC,enabled:L(),text:F().optional(),position:fC.optional(),availablePositions:B(fC).readonly(),readOnly:L().optional()})).readonly()}),mC=V({enabled:L().optional(),text:F().optional(),position:fC.optional()}).partial(),hC={name:`osd`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Camera],methods:{setOverlay:J(V({deviceId:I(),overlayId:F(),patch:mC}),z(),{kind:`mutation`,auth:`admin`})},events:{onStatusChanged:{data:V({deviceId:I(),status:pC})}},status:{schema:pC,kind:`command-driven`},settings:{bindings:[{kind:`array`,statusPath:`overlays`,idField:`id`,method:`setOverlay`,idArg:`overlayId`,patchArg:`patch`,sectionId:`osd`,sectionTitle:`Video overlays`,itemFields:{enabled:{label:e=>`${String(e.id)} enabled`,kind:`boolean`},text:{label:e=>`${String(e.id)} text`,kind:`text`,when:e=>e.kind!==`timestamp`&&!e.readOnly},position:{label:e=>`${String(e.id)} position`,kind:`select`,options:e=>e.availablePositions??[],when:e=>Array.isArray(e.availablePositions)&&e.availablePositions.length>0}}}]}},gC=V({childDeviceIds:B(I()).readonly(),hiddenChildIds:B(I()).readonly()}),_C={name:`accessories`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Camera,K.Hub,K.Switch,K.Light,K.Sensor,K.Thermostat,K.Cover,K.Lock,K.Fan,K.MediaPlayer,K.AlarmPanel,K.Generic],methods:{setChildHidden:J(V({deviceId:I().int().nonnegative(),childDeviceId:I().int().nonnegative(),hidden:L()}),z(),{kind:`mutation`,auth:`admin`})},events:{onAccessoriesChanged:{data:V({deviceId:I(),childDeviceIds:B(I()).readonly(),hiddenChildIds:B(I()).readonly()})},onChildVisibilityChanged:{data:V({deviceId:I(),childDeviceId:I(),hidden:L()})}},status:{schema:gC,kind:`command-driven`}},vC=V({codecs:B(F()),sampleRate:I(),duplex:W([`half`,`full`]),maxBacklogMs:I()}),yC=V({talking:L(),lastSessionAt:I().nullable(),ability:vC.nullable()}),bC=W([`opus`,`s16le`,`g711ulaw`,`g711alaw`]),xC={name:`intercom`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Camera],methods:{startSession:J(V({deviceId:I()}),V({sessionId:F(),sdpOffer:F()}),{kind:`mutation`,auth:`admin`}),handleAnswer:J(V({deviceId:I(),sessionId:F(),sdpAnswer:F()}),z(),{kind:`mutation`,auth:`admin`}),stopSession:J(V({deviceId:I(),sessionId:F()}),z(),{kind:`mutation`,auth:`admin`}),startTalkSession:J(V({deviceId:I()}),V({sessionId:F()}),{kind:`mutation`,auth:`admin`}),pushTalkAudio:J(V({deviceId:I(),audioBase64:F(),codec:bC.optional(),sampleRate:I().int().positive().optional(),channels:I().int().positive().optional(),sequenceNumber:I().int()}),V({accepted:L()}),{kind:`mutation`,auth:`admin`}),endTalkSession:J(V({deviceId:I()}),z(),{kind:`mutation`,auth:`admin`})},events:{onStatusChanged:{data:V({deviceId:I(),status:yC})}},status:{schema:yC,kind:`command-driven`}},SC=V({camStreamId:F().min(1),kind:Bd,url:F().optional(),codec:F().optional(),resolution:Vd.optional(),fps:I().positive().optional(),label:F().optional(),deviceFeatures:B(F()).optional(),autoEligible:L().optional(),metadata:U(F(),R()).optional()}),CC={name:`stream-catalog`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Camera],methods:{getCatalog:J(V({deviceId:I().int().nonnegative()}),B(SC).readonly())}},wC=W(Cf),TC=W([`videotoolbox`,`cuda`,`nvdec`,`vaapi`,`qsv`,`d3d11va`,`dxva2`,`amf`,`vdpau`,`drm`,`coreml`,`tensorrt`,`openvino`,`directml`,`webgpu`,`none`]).nullable().optional(),EC=V({preferred:B(F()).readonly()}),DC=W([`h264_videotoolbox`,`hevc_videotoolbox`,`h264_vaapi`,`hevc_vaapi`,`h264_nvenc`,`hevc_nvenc`,`h264_qsv`,`hevc_qsv`,`h264_amf`,`hevc_amf`,`libx264`,`libx265`]),OC=V({encoders:B(V({encoder:DC,codec:W([`H264`,`H265`]),family:W([`videotoolbox`,`vaapi`,`nvenc`,`qsv`,`amf`,`software`]),available:L(),reason:F().optional()})).readonly(),defaultH264:DC,defaultH265:DC,probedAt:I()}),kC=V({methods:B(F()).readonly(),probedAt:I()}),AC=W([`darwin`,`linux`,`win32`]),jC=W([`arm64`,`x64`]),MC=V({type:W([`nvidia`,`amd`,`intel`,`apple`]),name:F(),memoryMB:I().optional()}),NC=V({type:W([`apple-ane`,`intel-npu`])}),PC=V({platform:AC,arch:jC,cpuModel:F(),cpuCores:I(),totalRAM_MB:I(),availableRAM_MB:I(),gpu:MC.nullable(),npu:NC.nullable()}),FC=V({runtime:W([`node`,`python`]),backend:F(),format:W([`onnx`,`coreml`,`openvino`]),score:I(),reason:F(),available:L()}),IC=V({hardware:PC,scores:B(FC).readonly(),bestScore:FC,pythonPath:F().nullable()}),LC=V({modelId:F(),name:F(),minRAM_MB:I(),accuracyScore:I(),formats:B(F()).readonly()}),RC=V({modelId:F(),runtime:W([`node`,`python`]),backend:F(),format:wC,reason:F()}),zC={name:`platform-probe`,scope:`system`,mode:`singleton`,methods:{getCapabilities:J(z(),IC),getHardware:J(z(),PC),resolveInferenceConfig:J(V({requirements:B(LC).readonly()}),RC),resolveHwAccel:J(V({prefer:TC,nodeId:F().optional()}),EC),getHardwareEncoders:J(z(),OC),refreshHardwareEncoders:J(z(),OC,{kind:`mutation`,auth:`admin`}),getHardwareDecodeAccels:J(z(),kC),refreshHardwareDecodeAccels:J(z(),kC,{kind:`mutation`,auth:`admin`})}},BC=W([`lan`,`wifi`,`docker`,`vpn`,`loopback`,`other`]),VC=V({name:F(),family:W([`IPv4`,`IPv6`]),address:F(),cidr:F(),netmask:F(),internal:L(),mac:F(),kind:BC,preferred:L(),plausible:L(),plausibleReason:F()}),HC=V({interfaces:B(VC).readonly(),probedAt:I()}),UC=VC.nullable(),WC=V({endpoints:B(V({label:F(),baseUrl:F(),kind:W([`lan-ipv4`,`lan-ipv6`,`public`,`loopback`]),interfaceKind:W([`lan`,`wifi`,`docker`,`vpn`,`other`,`loopback`,`public`]),plausible:L(),plausibleReason:F(),priority:I()})).readonly()}),GC=V({addresses:B(F()).readonly()}),KC={name:`local-network`,scope:`system`,mode:`singleton`,methods:{list:J(z(),HC),getPreferred:J(z(),UC),getConnectionEndpoints:J(V({port:I().int().min(1).max(65535),includeLoopback:L().optional(),ipv4Only:L().optional(),scheme:W([`http`,`https`]).optional()}),WC),getAllowedAddresses:J(z(),GC),setAllowedAddresses:J(GC,V({success:G(!0)}),{kind:`mutation`}),resetAllowlistToBestMatch:J(z(),GC,{kind:`mutation`})}},qC=V({id:F(),label:F(),scope:W([`mesh`,`public`]),url:F(),hostname:F(),port:I(),protocol:W([`http`,`https`])}),JC=V({id:F(),hostname:F(),magicDns:F(),addresses:B(F()).readonly(),os:F().optional(),online:L(),lastSeenMs:I(),isSelf:L(),connection:W([`direct`,`relay`,`idle`]),relay:F().nullable(),lastHandshakeMs:I(),rxBytes:I(),txBytes:I(),tags:B(F()).readonly(),exitNodeOption:L(),advertisedRoutes:B(F()).readonly(),userLogin:F().nullable(),keyExpiry:I().nullable()}),YC=V({joined:L(),meshIp:F(),magicDnsHostname:F(),peerCount:I(),endpoints:B(qC).readonly(),error:F().optional(),tenantName:F(),magicDnsSuffix:F(),userLogin:F().nullable(),controlPlaneUrl:F(),keyExpiry:I().nullable(),daemonSocket:F().optional(),daemonCliPath:F().optional()}),XC={name:`mesh-network`,scope:`system`,mode:`collection`,providerKind:`mesh`,methods:{getStatus:J(z(),YC),join:J(V({authKey:F().min(8),hostname:F().optional()}),V({joined:G(!0)}),{kind:`mutation`}),startLogin:J(V({hostname:F().optional()}),V({loginUrl:F()}),{kind:`mutation`}),leave:J(z(),V({left:G(!0)}),{kind:`mutation`}),logout:J(z(),V({loggedOut:G(!0)}),{kind:`mutation`}),listPeers:J(z(),V({peers:B(JC).readonly()})),testConnection:J(V({authKey:F().optional()}),V({ok:L(),tenant:F().optional(),daemonVersion:F().optional(),error:F().optional()}),{kind:`mutation`})}},ZC=V({id:F(),username:F(),isAdmin:L().default(!1),allowedProviders:H([B(F()),G(`*`)]),allowedDevices:U(F(),H([B(F()),G(`*`)])),scopes:B(Bv).default([]),totpEnabled:L().default(!1),createdAt:I(),updatedAt:I()}),QC=V({username:F(),password:F().min(6),isAdmin:L().default(!1),allowedProviders:H([B(F()),G(`*`)]).optional(),allowedDevices:U(F(),H([B(F()),G(`*`)])).optional(),scopes:B(Bv).optional()}),$C=V({id:F(),isAdmin:L().optional(),allowedProviders:H([B(F()),G(`*`)]).optional(),allowedDevices:U(F(),H([B(F()),G(`*`)])).optional(),scopes:B(Bv).optional()}),ew=V({id:F(),label:F(),isAdmin:L().default(!1),allowedProviders:H([B(F()),G(`*`)]).optional(),allowedDevices:U(F(),H([B(F()),G(`*`)])).optional(),tokenPrefix:F(),createdAt:I(),lastUsedAt:I().optional()}),tw=V({label:F(),isAdmin:L().default(!1),allowedProviders:H([B(F()),G(`*`)]).optional(),allowedDevices:U(F(),H([B(F()),G(`*`)])).optional()}),nw=V({token:F(),record:ew}),rw=V({id:F(),userId:F(),name:F(),tokenPrefix:F(),scopes:B(Bv),expiresAt:I().nullish(),lastUsedAt:I().nullish(),createdAt:I()}),iw=V({userId:F(),name:F(),scopes:B(Bv),expiresAt:I().optional()}),aw=V({token:F(),record:rw}),ow=V({id:F(),userId:F(),username:F(),integrationId:F(),scopes:B(Bv),createdAt:I(),lastUsedAt:I(),revokedAt:I().nullable()}),sw=V({secret:F(),otpauthUrl:F()}),cw=V({enabled:L(),confirmedAt:I().nullable()}),lw={name:`user-management`,scope:`system`,mode:`singleton`,methods:{listUsers:J(z(),B(ZC),{auth:`admin`}),createUser:J(QC,ZC,{kind:`mutation`,auth:`admin`,access:`create`}),updateUser:J($C,V({success:G(!0)}),{kind:`mutation`,auth:`admin`,access:`create`}),deleteUser:J(V({id:F()}),V({success:G(!0)}),{kind:`mutation`,auth:`admin`,access:`delete`}),resetPassword:J(V({id:F(),newPassword:F().min(6)}),V({success:G(!0)}),{kind:`mutation`,auth:`admin`,access:`create`}),setUserScopes:J(V({userId:F(),scopes:B(Bv)}),V({success:G(!0)}),{kind:`mutation`,auth:`admin`,access:`create`}),validateCredentials:J(V({username:F(),password:F()}),ZC.extend({passwordHash:F()}).nullable(),{kind:`mutation`,access:`view`}),listApiKeys:J(z(),B(ew),{auth:`admin`}),createApiKey:J(tw,nw,{kind:`mutation`,auth:`admin`,access:`create`}),revokeApiKey:J(V({id:F()}),V({success:G(!0)}),{kind:`mutation`,auth:`admin`,access:`delete`}),validateApiKey:J(V({token:F()}),ew.nullable(),{kind:`mutation`,access:`view`}),createScopedToken:J(iw,aw,{kind:`mutation`,auth:`admin`,access:`create`}),revokeScopedToken:J(V({id:F()}),V({success:G(!0)}),{kind:`mutation`,auth:`admin`,access:`delete`}),validateScopedToken:J(V({token:F()}),rw.nullable(),{access:`view`}),listScopedTokens:J(V({userId:F()}),B(rw),{auth:`admin`}),setupTotp:J(V({userId:F()}),sw,{kind:`mutation`,auth:`admin`,access:`create`}),confirmTotp:J(V({userId:F(),code:F()}),V({success:G(!0)}),{kind:`mutation`,auth:`admin`,access:`create`}),disableTotp:J(V({userId:F()}),V({success:G(!0)}),{kind:`mutation`,auth:`admin`,access:`delete`}),getTotpStatus:J(V({userId:F()}),cw,{auth:`admin`}),verifyTotp:J(V({userId:F(),code:F()}),V({valid:L()}),{kind:`mutation`,access:`view`}),oauthIssueCode:J(V({integrationId:F(),userId:F(),username:F(),scopes:B(Bv),redirectUri:F(),hubUrl:F()}),V({code:F()}),{kind:`mutation`,access:`create`}),oauthExchangeCode:J(V({code:F(),redirectUri:F()}),V({accessToken:F(),refreshToken:F(),expiresIn:I()}).nullable(),{kind:`mutation`,access:`view`}),oauthRefresh:J(V({refreshToken:F()}),V({accessToken:F(),refreshToken:F(),expiresIn:I()}).nullable(),{kind:`mutation`,access:`view`}),oauthVerifyAccessToken:J(V({token:F()}),V({userId:F(),username:F(),scopes:B(Bv)}).nullable(),{access:`view`}),listOauthSessions:J(z(),B(ow),{auth:`admin`}),revokeOauthSession:J(V({id:F()}),V({success:L()}),{kind:`mutation`,auth:`admin`,access:`delete`})}},uw=V({streaming:L(),notifications:L(),objectDetection:L(),remoteAccess:L(),agentCluster:L(),smartHome:L(),recordings:L(),backup:L(),repl:L()}),dw=V({status:G(`ok`),uptime:I()}),fw=V({name:F(),address:F(),family:F(),internal:L()}),pw={name:`system`,scope:`system`,mode:`singleton`,methods:{info:J(z(),uw),health:J(z(),dw),featureFlags:J(z(),uw),networkAddresses:J(z(),B(fw).readonly()),getRetentionConfig:J(z(),R().nullable(),{auth:`admin`}),setRetentionConfig:J(U(F(),R()),Uu(),{kind:`mutation`,auth:`admin`}),forceRetentionCleanup:J(z(),z(),{kind:`mutation`,auth:`admin`})}},mw=V({nominalBitrateKbps:I(),observedBitrateKbps:I(),peakBitrateKbps:I(),packetLossPercent:I(),lastUpdated:I()}),hw=V({rttMs:I(),jitterMs:I(),estimatedBandwidthKbps:I(),packetLossPercent:I().min(0).max(100),lastUpdated:I()}),gw=V({deviceId:I(),streams:U(F(),mw),client:hw.optional()}),_w={name:`network-quality`,scope:`system`,mode:`singleton`,methods:{getDeviceStats:J(V({deviceId:I()}),gw.nullable()),getAllStats:J(z(),B(gw).readonly()),reportClientStats:J(V({deviceId:I(),rttMs:I().min(0).max(6e4),jitterMs:I().min(0).max(1e4),estimatedBandwidthKbps:I().min(0).max(1e6),packetLossPercent:I().min(0).max(100)}),z(),{kind:`mutation`})}},vw=V({title:F(),message:F(),severity:W([`info`,`warning`,`critical`]),duration:I().optional(),action:V({label:F(),url:F()}).optional()}),yw={name:`toast`,scope:`system`,mode:`singleton`,methods:{onToast:J(z(),vw,{kind:`subscription`})}},bw=V({addonId:F(),capabilities:B(F()).readonly(),status:F()}),xw=V({pid:I(),name:F(),state:F(),cpuPercent:I(),memoryRss:I(),uptimeSeconds:I(),services:B(bw).readonly(),groupId:F().optional()}),Sw=V({id:F(),status:F(),cpuPercent:I(),memoryRss:I()}),Cw=V({category:F(),total:I(),healthy:I(),addons:B(Sw).readonly()}),ww=V({id:F(),name:F(),hostname:F(),platform:F(),arch:F(),cpuModel:F().nullable(),cpuCores:I(),memoryMB:I(),engines:B(F()).readonly(),isHub:L(),isOnline:L(),cpuPercent:I(),memoryPercent:I(),uptime:I(),lastSeen:F(),localIps:B(F()).readonly(),addons:B(V({id:F(),capabilities:B(F()).readonly(),status:F()})).readonly(),processes:B(xw).readonly(),categories:B(Cw).readonly()}),Tw=V({callerAddonId:F(),providerAddonId:F(),capName:F(),callsPerMin:I(),lastCallAtMs:I()}),Ew=V({nodeId:F(),name:F(),version:F(),status:F(),synced:L()}),Dw=V({hubVersion:F(),nodes:B(Ew)}),Ow=V({nodeId:F(),addonId:F()}),kw=V({id:F(),status:F(),version:F().optional(),packageName:F().optional()}),Aw=V({success:L()}),jw=V({success:L(),reason:F().optional()}),Mw=V({restarted:B(F()).readonly(),failed:B(F()).readonly()}),Nw=V({nodeId:F(),name:F()}),Pw={name:`nodes`,scope:`system`,mode:`singleton`,nodeIdMode:`data`,methods:{topology:J(z(),B(ww).readonly(),{auth:`admin`}),deployAddon:J(Ow,Aw,{kind:`mutation`,auth:`admin`}),undeployAddon:J(Ow,Aw,{kind:`mutation`,auth:`admin`}),restartAddon:J(Ow,Aw,{kind:`mutation`,auth:`admin`}),restartProcess:J(V({nodeId:F(),processName:F()}),jw,{kind:`mutation`,auth:`admin`}),restartNode:J(V({nodeId:F()}),Mw,{kind:`mutation`,auth:`admin`}),shutdownNode:J(V({nodeId:F()}),Aw,{kind:`mutation`,auth:`admin`}),renameNode:J(V({nodeId:F(),name:F().min(1).max(64)}),Nw,{kind:`mutation`,auth:`admin`}),clusterAddonStatus:J(z(),U(F(),Dw),{auth:`admin`}),getCapUsageGraph:J(V({windowSeconds:I().int().positive().max(300).default(60)}),B(Tw).readonly(),{auth:`admin`}),getNodeAddons:J(V({nodeId:F()}),B(kw).readonly(),{auth:`admin`}),setProcessLogLevel:J(V({nodeId:F(),level:F()}),Aw,{kind:`mutation`,auth:`admin`}),executeQuery:J(V({nodeId:F(),addonId:F(),queryName:F(),params:U(F(),R()).optional()}),R(),{kind:`mutation`,auth:`admin`})}},Fw=V({id:F(),addonId:F(),name:F(),enabled:L(),info:U(F(),R()).readonly(),createdAt:I(),updatedAt:I(),processState:F()}),Iw=V({id:F(),addonId:F(),name:F(),enabled:L(),info:U(F(),R()).readonly(),createdAt:I(),updatedAt:I()}),Lw=V({addonId:F(),name:F(),description:F(),iconUrl:F().nullable(),color:F(),instanceMode:F(),discoveryMode:F(),kind:W([`device-adoption`,`device-provider`]),brokerKind:F().nullable(),supportsLocationImport:L(),existingInstances:B(V({id:F(),name:F()})),canAdd:L()}),Rw=V({success:L(),error:F().optional()}),zw=V({addonId:F(),name:F(),enabled:L().optional(),info:U(F(),R()).optional(),settings:U(F(),R()).optional(),skipRestart:L().optional()}),Bw=V({id:F(),name:F().optional(),enabled:L().optional(),info:U(F(),R()).optional()}),Vw=V({success:L(),deletedId:F()}),Hw={name:`integrations`,scope:`system`,mode:`singleton`,methods:{list:J(z(),B(Fw)),get:J(V({id:F()}),Fw),getByAddonId:J(V({addonId:F()}),Iw.nullable()),create:J(zw,Iw,{kind:`mutation`,auth:`admin`}),update:J(Bw,Iw,{kind:`mutation`,auth:`admin`}),delete:J(V({id:F()}),Vw,{kind:`mutation`,auth:`admin`}),getSettings:J(V({id:F()}),U(F(),R()),{auth:`admin`}),setSettings:J(V({id:F(),settings:U(F(),R())}),V({success:L()}),{kind:`mutation`,auth:`admin`}),getAvailableTypes:J(z(),B(Lw),{auth:`admin`}),testConnection:J(V({addonId:F(),settings:U(F(),R())}),Rw,{kind:`mutation`,auth:`admin`})}},Uw=W([`install`,`update`,`uninstall`,`restart`]),Ww=W([`queued`,`fetching`,`staged`,`validating`,`applying`,`restarting`,`applied`,`done`,`failed`,`skipped`]),Gw=W([`framework`,`addon`]),Kw=V({tsMs:I(),nodeId:F(),packageName:F(),phase:Ww,message:F()}),qw=V({taskId:F(),nodeId:F(),packageName:F(),fromVersion:F().nullable(),toVersion:F(),target:Gw,phase:Ww,stagedPath:F().nullable(),attempts:I(),steps:B(Kw),error:F().nullable(),startedAtMs:I().nullable(),finishedAtMs:I().nullable()}),Jw=W([`running`,`completed`,`failed`,`partially-failed`,`cancelled`]),Yw=W([`single`,`bulk`,`cluster`]),Xw=V({jobId:F(),kind:Uw,createdAtMs:I(),createdBy:F(),scope:Yw,tasks:B(qw),state:Jw,schemaVersion:G(1)}),Zw=W([`debug`,`info`,`warn`,`error`]),Qw=W([`off`,`latest`,`beta`]),$w=W([`off`,`latest`,`beta`,`inherit`]),eT=V({id:F(),name:F().optional(),version:F().optional(),description:F().optional(),icon:F().optional(),color:F().optional(),capabilities:B(R()).readonly().optional(),packageName:F(),packageVersion:F(),packageDisplayName:F().optional(),bundle:V({displayName:F(),description:F().optional(),icon:F().optional()}).optional(),protected:L().optional(),removable:L().optional()}),tT=V({pid:I().optional(),mode:F(),state:F()}),nT=V({phase:W([`pending`,`healthy`,`failed`]),retryCount:I(),firstFailureAt:I().nullable(),lastAttemptAt:I().nullable(),lastError:V({message:F(),stack:F().optional()}).nullable(),nextRetryAt:I().nullable(),alertEmitted:L(),retrying:L(),inGracePeriod:L()}),rT=V({manifest:eT,declaration:R().optional(),source:F(),installSource:F().optional(),process:tT.optional(),hasBackup:L().optional(),health:nT.nullable().optional()}),iT=V({name:F(),version:F(),dir:F(),installSource:F().optional()}),aT=V({name:F(),currentVersion:F(),latestVersion:F(),category:W([`addon`,`core`]),requiresRestart:L(),isSystem:L()}),oT=V({version:F(),publishedAt:F(),deprecated:F().optional(),distTags:B(F()).readonly()}),sT=V({name:F(),version:F(),description:F(),keywords:B(F()).readonly(),publishedAt:F(),author:F(),installed:L(),installedVersion:F().optional()}),cT=V({channel:Qw,intervalSeconds:I()}),lT=$w,uT=R(),dT=R(),fT=R(),pT=V({packageName:F(),fromVersion:F(),toVersion:F(),restartingAt:I()}),mT=W([`queued`,`updating`,`done`,`done-pending-restart`,`failed`]),hT=V({name:F(),isSystem:L(),fromVersion:F(),toVersion:F(),status:mT,error:F().optional(),startedAtMs:I().optional(),completedAtMs:I().optional()}),gT=W([`regular`,`system`,`restarting`,`finalizing`]);V({id:F(),nodeId:F(),startedAtMs:I(),completedAtMs:I().optional(),total:I(),completed:I(),failed:I(),current:F().nullable(),phase:gT,cancelled:L(),items:B(hT).readonly()});var _T=V({packageName:F(),currentVersion:F(),latestVersion:F().nullable(),hasUpdate:L(),description:F().optional()}),vT=V({timestamp:F(),level:F(),message:F(),scope:F().optional()}),yT=R(),bT=V({addonId:F().min(1),action:F().min(1),input:R()}),xT=[_C,tb,rb,mb,Y_,ub,cb,{name:`addons`,scope:`system`,mode:`singleton`,nodeIdMode:`data`,methods:{list:J(z(),B(rT).readonly()),getLogs:J(V({addonId:F(),limit:I().min(1).max(500).default(100),level:Zw.optional()}),B(yT)),listPackages:J(z(),B(iT).readonly()),installPackage:J(V({packageName:F(),version:F().optional()}),dT,{kind:`mutation`,auth:`admin`}),installFromWorkspace:J(V({packageName:F()}),dT,{kind:`mutation`,auth:`admin`}),isWorkspaceAvailable:J(z(),L()),listWorkspacePackages:J(z(),B(R()).readonly()),uninstallPackage:J(V({packageName:F()}),R(),{kind:`mutation`,auth:`admin`}),reloadPackages:J(z(),fT,{kind:`mutation`,auth:`admin`}),searchAvailable:J(V({query:F().optional()}),B(sT)),listUpdates:J(V({nodeId:F().optional()}),B(aT).readonly(),{auth:`admin`}),updatePackage:J(V({name:F().min(1),version:F().optional(),nodeId:F().optional()}),R(),{kind:`mutation`,auth:`admin`}),rollbackPackage:J(V({name:F().min(1)}),V({rolledBackTo:F().nullable()}),{kind:`mutation`,auth:`admin`}),forceRefresh:J(V({nodeId:F().optional()}),R(),{kind:`mutation`,auth:`admin`}),restartServer:J(V({confirm:G(!0)}),R(),{kind:`mutation`,auth:`admin`}),getLastRestart:J(z(),V({kind:W([`framework-update`,`manual`,`system`,`framework-bulk-update`]),packageName:F().optional(),fromVersion:F().optional(),toVersion:F().optional(),requestedBy:F().optional(),requestedAt:I()}).nullable(),{auth:`admin`}),listFrameworkPackages:J(z(),B(_T).readonly(),{auth:`admin`}),listCapabilityProviders:J(V({capName:F().min(1)}),B(V({addonId:F(),mode:W([`singleton`,`collection`]),isActive:L()})).readonly()),setCapabilityProviderEnabled:J(V({capName:F().min(1),addonId:F().min(1),enabled:L()}),V({success:G(!0)}),{kind:`mutation`,auth:`admin`}),updateFrameworkPackage:J(V({packageName:F().min(1),version:F().optional(),deferRestart:L().optional()}),pT,{kind:`mutation`,auth:`admin`}),getVersions:J(V({name:F()}),B(oT).readonly()),restartAddon:J(V({addonId:F()}),uT,{kind:`mutation`,auth:`admin`}),retryLoad:J(V({packageName:F()}),V({success:G(!0)}),{kind:`mutation`,auth:`admin`}),getAutoUpdateSettings:J(z(),cT,{auth:`admin`}),setAutoUpdateSettings:J(V({channel:Qw,intervalSeconds:I().min(300).max(86400).optional()}),R(),{kind:`mutation`,auth:`admin`}),getAddonAutoUpdate:J(V({addonId:F()}),lT,{auth:`admin`}),setAddonAutoUpdate:J(V({addonId:F(),channel:$w}),R(),{kind:`mutation`,auth:`admin`}),applyAutoUpdateToAll:J(V({channel:Qw}),V({success:G(!0)}),{kind:`mutation`,auth:`admin`}),custom:J(bT,R(),{kind:`mutation`}),startJob:J(V({kind:W([`install`,`update`,`uninstall`,`restart`]),targets:B(V({name:F().min(1),version:F().min(1)})).min(1),nodeIds:B(F()).optional()}),V({jobId:F()}),{kind:`mutation`,auth:`admin`}),getJob:J(V({jobId:F()}),Xw.nullable(),{auth:`admin`}),listJobs:J(V({activeOnly:L().optional()}),B(Xw),{auth:`admin`}),cancelJob:J(V({jobId:F()}),V({cancelled:L()}),{kind:`mutation`,auth:`admin`}),onAddonLogs:J(V({addonId:F(),level:Zw.optional()}),vT,{kind:`subscription`})}},mf,qx,Qf,np,ev,ip,rx,nx,dx,cp,kx,up,Dv,fp,mp,gp,jy,uC,cC,Yx,Ip,Rp,Vp,Kp,Jp,Xp,Qp,tm,rm,gb,Jx,uy,cm,Qy,Ex,vf,N_,Dx,Jf,dm,mx,mm,_m,RS,WS,bm,Xf,bv,Sm,wm,Em,Om,Am,Hw,xC,Mm,KC,Pm,Fv,zm,XC,AS,Kh,Ym,Yh,sg,Uy,fg,Nx,_w,Pw,Bx,yg,xg,Wv,hC,dS,Dh,Qb,Uh,JS,zC,Cg,Eg,Og,Pg,IS,zg,lC,aC,yb,Vg,Mv,Ug,Zv,Rx,zx,Hv,nv,_v,mv,jp,CC,Xg,yp,Qg,pw,e_,n_,yw,Fx,i_,lw,Kv,c_,u_,f_,Db,m_,g_,xb,wb,C_,D_,jh];Object.freeze({"accessories.setChildHidden":{capName:`accessories`,capScope:`device`,addonId:null,access:`create`},"addonPages.listPages":{capName:`addon-pages`,capScope:`system`,addonId:null,access:`view`},"addonPagesSource.listPages":{capName:`addon-pages-source`,capScope:`system`,addonId:null,access:`view`},"addonRoutes.getRoutes":{capName:`addon-routes`,capScope:`system`,addonId:null,access:`view`},"addonRoutes.invoke":{capName:`addon-routes`,capScope:`system`,addonId:null,access:`create`},"addons.applyAutoUpdateToAll":{capName:`addons`,capScope:`system`,addonId:null,access:`create`},"addons.cancelJob":{capName:`addons`,capScope:`system`,addonId:null,access:`create`},"addons.custom":{capName:`addons`,capScope:`system`,addonId:null,access:`create`},"addons.forceRefresh":{capName:`addons`,capScope:`system`,addonId:null,access:`create`},"addons.getAddonAutoUpdate":{capName:`addons`,capScope:`system`,addonId:null,access:`view`},"addons.getAutoUpdateSettings":{capName:`addons`,capScope:`system`,addonId:null,access:`view`},"addons.getJob":{capName:`addons`,capScope:`system`,addonId:null,access:`view`},"addons.getLastRestart":{capName:`addons`,capScope:`system`,addonId:null,access:`view`},"addons.getLogs":{capName:`addons`,capScope:`system`,addonId:null,access:`view`},"addons.getVersions":{capName:`addons`,capScope:`system`,addonId:null,access:`view`},"addons.installFromWorkspace":{capName:`addons`,capScope:`system`,addonId:null,access:`create`},"addons.installPackage":{capName:`addons`,capScope:`system`,addonId:null,access:`create`},"addons.isWorkspaceAvailable":{capName:`addons`,capScope:`system`,addonId:null,access:`view`},"addons.list":{capName:`addons`,capScope:`system`,addonId:null,access:`view`},"addons.listCapabilityProviders":{capName:`addons`,capScope:`system`,addonId:null,access:`view`},"addons.listFrameworkPackages":{capName:`addons`,capScope:`system`,addonId:null,access:`view`},"addons.listJobs":{capName:`addons`,capScope:`system`,addonId:null,access:`view`},"addons.listPackages":{capName:`addons`,capScope:`system`,addonId:null,access:`view`},"addons.listUpdates":{capName:`addons`,capScope:`system`,addonId:null,access:`view`},"addons.listWorkspacePackages":{capName:`addons`,capScope:`system`,addonId:null,access:`view`},"addons.onAddonLogs":{capName:`addons`,capScope:`system`,addonId:null,access:`view`},"addons.reloadPackages":{capName:`addons`,capScope:`system`,addonId:null,access:`create`},"addons.restartAddon":{capName:`addons`,capScope:`system`,addonId:null,access:`create`},"addons.restartServer":{capName:`addons`,capScope:`system`,addonId:null,access:`create`},"addons.retryLoad":{capName:`addons`,capScope:`system`,addonId:null,access:`create`},"addons.rollbackPackage":{capName:`addons`,capScope:`system`,addonId:null,access:`create`},"addons.searchAvailable":{capName:`addons`,capScope:`system`,addonId:null,access:`view`},"addons.setAddonAutoUpdate":{capName:`addons`,capScope:`system`,addonId:null,access:`create`},"addons.setAutoUpdateSettings":{capName:`addons`,capScope:`system`,addonId:null,access:`create`},"addons.setCapabilityProviderEnabled":{capName:`addons`,capScope:`system`,addonId:null,access:`create`},"addons.startJob":{capName:`addons`,capScope:`system`,addonId:null,access:`create`},"addons.uninstallPackage":{capName:`addons`,capScope:`system`,addonId:null,access:`delete`},"addons.updateFrameworkPackage":{capName:`addons`,capScope:`system`,addonId:null,access:`create`},"addons.updatePackage":{capName:`addons`,capScope:`system`,addonId:null,access:`create`},"addonSettings.getDeviceSettings":{capName:`addon-settings`,capScope:`system`,addonId:null,access:`view`},"addonSettings.getGlobalSettings":{capName:`addon-settings`,capScope:`system`,addonId:null,access:`view`},"addonSettings.updateDeviceSettings":{capName:`addon-settings`,capScope:`system`,addonId:null,access:`create`},"addonSettings.updateGlobalSettings":{capName:`addon-settings`,capScope:`system`,addonId:null,access:`create`},"addonWidgets.listWidgets":{capName:`addon-widgets`,capScope:`system`,addonId:null,access:`view`},"addonWidgetsSource.listWidgets":{capName:`addon-widgets-source`,capScope:`system`,addonId:null,access:`view`},"adminUi.getStaticDir":{capName:`admin-ui`,capScope:`system`,addonId:null,access:`view`},"adminUi.getVersion":{capName:`admin-ui`,capScope:`system`,addonId:null,access:`view`},"advancedNotifier.deleteRule":{capName:`advanced-notifier`,capScope:`system`,addonId:null,access:`delete`},"advancedNotifier.getHistory":{capName:`advanced-notifier`,capScope:`system`,addonId:null,access:`view`},"advancedNotifier.getRules":{capName:`advanced-notifier`,capScope:`system`,addonId:null,access:`view`},"advancedNotifier.testRule":{capName:`advanced-notifier`,capScope:`system`,addonId:null,access:`create`},"advancedNotifier.upsertRule":{capName:`advanced-notifier`,capScope:`system`,addonId:null,access:`create`},"alarmPanel.arm":{capName:`alarm-panel`,capScope:`device`,addonId:null,access:`create`},"alarmPanel.disarm":{capName:`alarm-panel`,capScope:`device`,addonId:null,access:`create`},"alarmPanel.trigger":{capName:`alarm-panel`,capScope:`device`,addonId:null,access:`create`},"alerts.dismiss":{capName:`alerts`,capScope:`system`,addonId:null,access:`create`},"alerts.emit":{capName:`alerts`,capScope:`system`,addonId:null,access:`create`},"alerts.getUnreadCount":{capName:`alerts`,capScope:`system`,addonId:null,access:`view`},"alerts.list":{capName:`alerts`,capScope:`system`,addonId:null,access:`view`},"alerts.markAllRead":{capName:`alerts`,capScope:`system`,addonId:null,access:`create`},"alerts.markRead":{capName:`alerts`,capScope:`system`,addonId:null,access:`create`},"alerts.update":{capName:`alerts`,capScope:`system`,addonId:null,access:`create`},"audioAnalysis.resolveDeviceSettings":{capName:`audio-analysis`,capScope:`device`,addonId:null,access:`view`},"audioAnalyzer.analyseChunk":{capName:`audio-analyzer`,capScope:`system`,addonId:null,access:`create`},"audioAnalyzer.classify":{capName:`audio-analyzer`,capScope:`system`,addonId:null,access:`view`},"audioAnalyzer.dispose":{capName:`audio-analyzer`,capScope:`system`,addonId:null,access:`create`},"audioAnalyzer.isReady":{capName:`audio-analyzer`,capScope:`system`,addonId:null,access:`view`},"audioAnalyzer.reprobeAudioEngine":{capName:`audio-analyzer`,capScope:`system`,addonId:null,access:`create`},"audioCodec.canHandle":{capName:`audio-codec`,capScope:`system`,addonId:null,access:`view`},"audioCodec.closeSession":{capName:`audio-codec`,capScope:`system`,addonId:null,access:`create`},"audioCodec.createDecodeSession":{capName:`audio-codec`,capScope:`system`,addonId:null,access:`create`},"audioCodec.createEncodeSession":{capName:`audio-codec`,capScope:`system`,addonId:null,access:`create`},"audioCodec.flushEncode":{capName:`audio-codec`,capScope:`system`,addonId:null,access:`create`},"audioCodec.listActiveSessions":{capName:`audio-codec`,capScope:`system`,addonId:null,access:`view`},"audioCodec.listSupportedCodecs":{capName:`audio-codec`,capScope:`system`,addonId:null,access:`view`},"audioCodec.pullEncoded":{capName:`audio-codec`,capScope:`system`,addonId:null,access:`view`},"audioCodec.pullPcm":{capName:`audio-codec`,capScope:`system`,addonId:null,access:`view`},"audioCodec.pushEncodedFrame":{capName:`audio-codec`,capScope:`system`,addonId:null,access:`create`},"audioCodec.pushPcm":{capName:`audio-codec`,capScope:`system`,addonId:null,access:`create`},"audioMetrics.getCurrentSnapshot":{capName:`audio-metrics`,capScope:`device`,addonId:null,access:`view`},"audioMetrics.getHistory":{capName:`audio-metrics`,capScope:`device`,addonId:null,access:`view`},"authProvider.getLoginUrl":{capName:`auth-provider`,capScope:`system`,addonId:null,access:`view`},"authProvider.handleCallback":{capName:`auth-provider`,capScope:`system`,addonId:null,access:`create`},"authProvider.validateCredentials":{capName:`auth-provider`,capScope:`system`,addonId:null,access:`create`},"authProvider.validateToken":{capName:`auth-provider`,capScope:`system`,addonId:null,access:`view`},"automationControl.disable":{capName:`automation-control`,capScope:`device`,addonId:null,access:`create`},"automationControl.enable":{capName:`automation-control`,capScope:`device`,addonId:null,access:`create`},"automationControl.trigger":{capName:`automation-control`,capScope:`device`,addonId:null,access:`create`},"backup.delete":{capName:`backup`,capScope:`system`,addonId:null,access:`delete`},"backup.getEntries":{capName:`backup`,capScope:`system`,addonId:null,access:`view`},"backup.list":{capName:`backup`,capScope:`system`,addonId:null,access:`view`},"backup.listArchives":{capName:`backup`,capScope:`system`,addonId:null,access:`view`},"backup.listDestinations":{capName:`backup`,capScope:`system`,addonId:null,access:`view`},"backup.listLocations":{capName:`backup`,capScope:`system`,addonId:null,access:`view`},"backup.previewSchedule":{capName:`backup`,capScope:`system`,addonId:null,access:`view`},"backup.restore":{capName:`backup`,capScope:`system`,addonId:null,access:`create`},"backup.trigger":{capName:`backup`,capScope:`system`,addonId:null,access:`create`},"backup.upsertDestinationPolicy":{capName:`backup`,capScope:`system`,addonId:null,access:`create`},"battery.wakeForStream":{capName:`battery`,capScope:`device`,addonId:null,access:`create`},"brightness.setBrightness":{capName:`brightness`,capScope:`device`,addonId:null,access:`create`},"broker.add":{capName:`broker`,capScope:`system`,addonId:null,access:`create`},"broker.get":{capName:`broker`,capScope:`system`,addonId:null,access:`view`},"broker.getBrokerConfig":{capName:`broker`,capScope:`system`,addonId:null,access:`view`},"broker.getSettings":{capName:`broker`,capScope:`system`,addonId:null,access:`view`},"broker.getSettingsSchema":{capName:`broker`,capScope:`system`,addonId:null,access:`view`},"broker.getState":{capName:`broker`,capScope:`system`,addonId:null,access:`view`},"broker.getStatus":{capName:`broker`,capScope:`system`,addonId:null,access:`view`},"broker.list":{capName:`broker`,capScope:`system`,addonId:null,access:`view`},"broker.listProviders":{capName:`broker`,capScope:`system`,addonId:null,access:`view`},"broker.publish":{capName:`broker`,capScope:`system`,addonId:null,access:`create`},"broker.remove":{capName:`broker`,capScope:`system`,addonId:null,access:`delete`},"broker.setSettings":{capName:`broker`,capScope:`system`,addonId:null,access:`create`},"broker.subscribe":{capName:`broker`,capScope:`system`,addonId:null,access:`create`},"broker.testConnection":{capName:`broker`,capScope:`system`,addonId:null,access:`create`},"broker.testSettings":{capName:`broker`,capScope:`system`,addonId:null,access:`create`},"broker.unsubscribe":{capName:`broker`,capScope:`system`,addonId:null,access:`create`},"button.press":{capName:`button`,capScope:`device`,addonId:null,access:`create`},"cameraCredentials.getCredentials":{capName:`camera-credentials`,capScope:`device`,addonId:null,access:`view`},"cameraStreams.getBrokerStreams":{capName:`camera-streams`,capScope:`device`,addonId:null,access:`view`},"cameraStreams.getCameraStreams":{capName:`camera-streams`,capScope:`device`,addonId:null,access:`view`},"cameraStreams.getProfileRtspEntries":{capName:`camera-streams`,capScope:`device`,addonId:null,access:`view`},"cameraStreams.getRtspEntries":{capName:`camera-streams`,capScope:`device`,addonId:null,access:`view`},"cameraStreams.pickStream":{capName:`camera-streams`,capScope:`device`,addonId:null,access:`view`},"climateControl.setFanMode":{capName:`climate-control`,capScope:`device`,addonId:null,access:`create`},"climateControl.setMode":{capName:`climate-control`,capScope:`device`,addonId:null,access:`create`},"climateControl.setPreset":{capName:`climate-control`,capScope:`device`,addonId:null,access:`create`},"climateControl.setTarget":{capName:`climate-control`,capScope:`device`,addonId:null,access:`create`},"climateControl.setTargetHumidity":{capName:`climate-control`,capScope:`device`,addonId:null,access:`create`},"climateControl.setTargetRange":{capName:`climate-control`,capScope:`device`,addonId:null,access:`create`},"color.setColor":{capName:`color`,capScope:`device`,addonId:null,access:`create`},"consumables.reset":{capName:`consumables`,capScope:`device`,addonId:null,access:`delete`},"control.setValue":{capName:`control`,capScope:`device`,addonId:null,access:`create`},"cover.close":{capName:`cover`,capScope:`device`,addonId:null,access:`create`},"cover.open":{capName:`cover`,capScope:`device`,addonId:null,access:`create`},"cover.setPosition":{capName:`cover`,capScope:`device`,addonId:null,access:`create`},"cover.setTiltPosition":{capName:`cover`,capScope:`device`,addonId:null,access:`create`},"cover.stop":{capName:`cover`,capScope:`device`,addonId:null,access:`create`},"decoder.createSession":{capName:`decoder`,capScope:`system`,addonId:null,access:`view`},"decoder.destroySession":{capName:`decoder`,capScope:`system`,addonId:null,access:`delete`},"decoder.getFrame":{capName:`decoder`,capScope:`system`,addonId:null,access:`view`},"decoder.getInfo":{capName:`decoder`,capScope:`system`,addonId:null,access:`view`},"decoder.getShmStats":{capName:`decoder`,capScope:`system`,addonId:null,access:`view`},"decoder.getStats":{capName:`decoder`,capScope:`system`,addonId:null,access:`view`},"decoder.listActiveSessions":{capName:`decoder`,capScope:`system`,addonId:null,access:`view`},"decoder.openStream":{capName:`decoder`,capScope:`system`,addonId:null,access:`view`},"decoder.pullFrames":{capName:`decoder`,capScope:`system`,addonId:null,access:`view`},"decoder.pullHandles":{capName:`decoder`,capScope:`system`,addonId:null,access:`view`},"decoder.pushPacket":{capName:`decoder`,capScope:`system`,addonId:null,access:`view`},"decoder.reprobeHwaccel":{capName:`decoder`,capScope:`system`,addonId:null,access:`create`},"decoder.supportsCodec":{capName:`decoder`,capScope:`system`,addonId:null,access:`view`},"decoder.updateConfig":{capName:`decoder`,capScope:`system`,addonId:null,access:`view`},"deviceAdoption.adopt":{capName:`device-adoption`,capScope:`system`,addonId:null,access:`create`},"deviceAdoption.getCandidate":{capName:`device-adoption`,capScope:`system`,addonId:null,access:`view`},"deviceAdoption.listCandidateFilters":{capName:`device-adoption`,capScope:`system`,addonId:null,access:`view`},"deviceAdoption.listCandidates":{capName:`device-adoption`,capScope:`system`,addonId:null,access:`view`},"deviceAdoption.refresh":{capName:`device-adoption`,capScope:`system`,addonId:null,access:`create`},"deviceAdoption.release":{capName:`device-adoption`,capScope:`system`,addonId:null,access:`create`},"deviceAdoption.resync":{capName:`device-adoption`,capScope:`system`,addonId:null,access:`create`},"deviceDiscovery.adoptDevice":{capName:`device-discovery`,capScope:`device`,addonId:null,access:`create`},"deviceDiscovery.listDiscovered":{capName:`device-discovery`,capScope:`device`,addonId:null,access:`view`},"deviceDiscovery.refreshDiscovery":{capName:`device-discovery`,capScope:`device`,addonId:null,access:`create`},"deviceDiscovery.releaseDevice":{capName:`device-discovery`,capScope:`device`,addonId:null,access:`create`},"deviceExport.exposeDevice":{capName:`device-export`,capScope:`system`,addonId:null,access:`create`},"deviceExport.getStatus":{capName:`device-export`,capScope:`system`,addonId:null,access:`view`},"deviceExport.listExposedDevices":{capName:`device-export`,capScope:`system`,addonId:null,access:`view`},"deviceExport.listSupportedDeviceKinds":{capName:`device-export`,capScope:`system`,addonId:null,access:`view`},"deviceExport.unexposeDevice":{capName:`device-export`,capScope:`system`,addonId:null,access:`create`},"deviceManager.addLocation":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.adoptDevice":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.adoptionAdopt":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.adoptionListCandidates":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.adoptionRefresh":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.adoptionRelease":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.allocateDeviceId":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.applyInitialMeta":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.createDevice":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.disable":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.discoverDevices":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.enable":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.getAllBindings":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getBindings":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getChildren":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getConfigSchema":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getCreationSchema":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getDevice":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getDeviceAggregate":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getDeviceLiveInfoAggregate":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getDeviceSettingsAggregate":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getDeviceStatusAggregate":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getSettingsSchema":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getStreamProfileMap":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getStreamSources":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.getWireableFields":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.listAll":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.listBindableCapsForDeviceType":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.listLocations":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.listPersistedByAddon":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.listWrappersForCap":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.loadConfig":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.loadMeta":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.loadRuntimeState":{capName:`device-manager`,capScope:`system`,addonId:null,access:`view`},"deviceManager.persistConfig":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.probeStreams":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.registerDevice":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.remove":{capName:`device-manager`,capScope:`system`,addonId:null,access:`delete`},"deviceManager.removeByIntegration":{capName:`device-manager`,capScope:`system`,addonId:null,access:`delete`},"deviceManager.removeDevice":{capName:`device-manager`,capScope:`system`,addonId:null,access:`delete`},"deviceManager.removeLocation":{capName:`device-manager`,capScope:`system`,addonId:null,access:`delete`},"deviceManager.runDeviceAction":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setChildLayout":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setDeviceLinks":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setDisabled":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setIntegrationId":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setLinkDeviceId":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setLocation":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setMetadata":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setName":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setPrimaryChildEntityId":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setRole":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setStreamProfileMap":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setType":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.setWrapperActive":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.testCreationField":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.testField":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.updateConfig":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.updateDeviceField":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceManager.updateDeviceFieldsBatch":{capName:`device-manager`,capScope:`system`,addonId:null,access:`create`},"deviceOps.getConfigEntries":{capName:`device-ops`,capScope:`device`,addonId:null,access:`view`},"deviceOps.getRawState":{capName:`device-ops`,capScope:`device`,addonId:null,access:`view`},"deviceOps.getSettingsSchema":{capName:`device-ops`,capScope:`device`,addonId:null,access:`view`},"deviceOps.getStreamSources":{capName:`device-ops`,capScope:`device`,addonId:null,access:`view`},"deviceOps.removeDevice":{capName:`device-ops`,capScope:`device`,addonId:null,access:`delete`},"deviceOps.runAction":{capName:`device-ops`,capScope:`device`,addonId:null,access:`create`},"deviceOps.setConfig":{capName:`device-ops`,capScope:`device`,addonId:null,access:`create`},"deviceProvider.adoptDiscoveredDevice":{capName:`device-provider`,capScope:`system`,addonId:null,access:`create`},"deviceProvider.createDevice":{capName:`device-provider`,capScope:`system`,addonId:null,access:`create`},"deviceProvider.discoverDevices":{capName:`device-provider`,capScope:`system`,addonId:null,access:`create`},"deviceProvider.getChildCreationSchema":{capName:`device-provider`,capScope:`system`,addonId:null,access:`view`},"deviceProvider.getDevices":{capName:`device-provider`,capScope:`system`,addonId:null,access:`view`},"deviceProvider.getStatus":{capName:`device-provider`,capScope:`system`,addonId:null,access:`view`},"deviceProvider.start":{capName:`device-provider`,capScope:`system`,addonId:null,access:`create`},"deviceProvider.stop":{capName:`device-provider`,capScope:`system`,addonId:null,access:`create`},"deviceProvider.supportsDiscovery":{capName:`device-provider`,capScope:`system`,addonId:null,access:`view`},"deviceProvider.supportsManualCreation":{capName:`device-provider`,capScope:`system`,addonId:null,access:`view`},"deviceProvider.testCreationField":{capName:`device-provider`,capScope:`system`,addonId:null,access:`create`},"deviceState.getAllSnapshots":{capName:`device-state`,capScope:`system`,addonId:null,access:`view`},"deviceState.getCapSlice":{capName:`device-state`,capScope:`system`,addonId:null,access:`view`},"deviceState.getSnapshot":{capName:`device-state`,capScope:`system`,addonId:null,access:`view`},"deviceState.setCapSlice":{capName:`device-state`,capScope:`system`,addonId:null,access:`create`},"embeddingEncoder.encode":{capName:`embedding-encoder`,capScope:`system`,addonId:null,access:`view`},"embeddingEncoder.encodeText":{capName:`embedding-encoder`,capScope:`system`,addonId:null,access:`view`},"embeddingEncoder.getInfo":{capName:`embedding-encoder`,capScope:`system`,addonId:null,access:`view`},"events.getEventClipUrl":{capName:`events`,capScope:`device`,addonId:null,access:`view`},"events.getEvents":{capName:`events`,capScope:`device`,addonId:null,access:`view`},"events.getEventThumbnail":{capName:`events`,capScope:`device`,addonId:null,access:`view`},"faceGallery.assignFace":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`create`},"faceGallery.assignFaces":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`create`},"faceGallery.createIdentity":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`create`},"faceGallery.deleteFace":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`delete`},"faceGallery.deleteIdentity":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`delete`},"faceGallery.getFaceByTrack":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`view`},"faceGallery.getFaceMedia":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`view`},"faceGallery.listIdentities":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`view`},"faceGallery.listIdentitySamples":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`view`},"faceGallery.listRecentFaces":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`view`},"faceGallery.removeSample":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`delete`},"faceGallery.renameIdentity":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`create`},"faceGallery.suggestFaceClusters":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`view`},"faceGallery.unassignFace":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`create`},"faceGallery.unassignFaces":{capName:`face-gallery`,capScope:`system`,addonId:null,access:`create`},"fanControl.setDirection":{capName:`fan-control`,capScope:`device`,addonId:null,access:`create`},"fanControl.setOscillating":{capName:`fan-control`,capScope:`device`,addonId:null,access:`create`},"fanControl.setPercentage":{capName:`fan-control`,capScope:`device`,addonId:null,access:`create`},"fanControl.setPreset":{capName:`fan-control`,capScope:`device`,addonId:null,access:`create`},"filesystemBrowse.browse":{capName:`filesystem-browse`,capScope:`system`,addonId:null,access:`view`},"filesystemBrowse.createDir":{capName:`filesystem-browse`,capScope:`system`,addonId:null,access:`create`},"filesystemBrowse.listAllowedRoots":{capName:`filesystem-browse`,capScope:`system`,addonId:null,access:`view`},"humidifier.setMode":{capName:`humidifier`,capScope:`device`,addonId:null,access:`create`},"humidifier.setOn":{capName:`humidifier`,capScope:`device`,addonId:null,access:`create`},"humidifier.setTargetHumidity":{capName:`humidifier`,capScope:`device`,addonId:null,access:`create`},"integrations.create":{capName:`integrations`,capScope:`system`,addonId:null,access:`create`},"integrations.delete":{capName:`integrations`,capScope:`system`,addonId:null,access:`delete`},"integrations.get":{capName:`integrations`,capScope:`system`,addonId:null,access:`view`},"integrations.getAvailableTypes":{capName:`integrations`,capScope:`system`,addonId:null,access:`view`},"integrations.getByAddonId":{capName:`integrations`,capScope:`system`,addonId:null,access:`view`},"integrations.getSettings":{capName:`integrations`,capScope:`system`,addonId:null,access:`view`},"integrations.list":{capName:`integrations`,capScope:`system`,addonId:null,access:`view`},"integrations.setSettings":{capName:`integrations`,capScope:`system`,addonId:null,access:`create`},"integrations.testConnection":{capName:`integrations`,capScope:`system`,addonId:null,access:`create`},"integrations.update":{capName:`integrations`,capScope:`system`,addonId:null,access:`create`},"intercom.endTalkSession":{capName:`intercom`,capScope:`device`,addonId:null,access:`create`},"intercom.handleAnswer":{capName:`intercom`,capScope:`device`,addonId:null,access:`create`},"intercom.pushTalkAudio":{capName:`intercom`,capScope:`device`,addonId:null,access:`create`},"intercom.startSession":{capName:`intercom`,capScope:`device`,addonId:null,access:`create`},"intercom.startTalkSession":{capName:`intercom`,capScope:`device`,addonId:null,access:`create`},"intercom.stopSession":{capName:`intercom`,capScope:`device`,addonId:null,access:`create`},"lawnMowerControl.dock":{capName:`lawn-mower-control`,capScope:`device`,addonId:null,access:`create`},"lawnMowerControl.pause":{capName:`lawn-mower-control`,capScope:`device`,addonId:null,access:`create`},"lawnMowerControl.startMowing":{capName:`lawn-mower-control`,capScope:`device`,addonId:null,access:`create`},"localNetwork.getAllowedAddresses":{capName:`local-network`,capScope:`system`,addonId:null,access:`view`},"localNetwork.getConnectionEndpoints":{capName:`local-network`,capScope:`system`,addonId:null,access:`view`},"localNetwork.getPreferred":{capName:`local-network`,capScope:`system`,addonId:null,access:`view`},"localNetwork.list":{capName:`local-network`,capScope:`system`,addonId:null,access:`view`},"localNetwork.resetAllowlistToBestMatch":{capName:`local-network`,capScope:`system`,addonId:null,access:`delete`},"localNetwork.setAllowedAddresses":{capName:`local-network`,capScope:`system`,addonId:null,access:`create`},"lockControl.lock":{capName:`lock-control`,capScope:`device`,addonId:null,access:`create`},"lockControl.open":{capName:`lock-control`,capScope:`device`,addonId:null,access:`create`},"lockControl.unlock":{capName:`lock-control`,capScope:`device`,addonId:null,access:`create`},"logDestination.query":{capName:`log-destination`,capScope:`system`,addonId:null,access:`view`},"logDestination.write":{capName:`log-destination`,capScope:`system`,addonId:null,access:`create`},"mediaPlayer.next":{capName:`media-player`,capScope:`device`,addonId:null,access:`create`},"mediaPlayer.pause":{capName:`media-player`,capScope:`device`,addonId:null,access:`create`},"mediaPlayer.play":{capName:`media-player`,capScope:`device`,addonId:null,access:`create`},"mediaPlayer.playMedia":{capName:`media-player`,capScope:`device`,addonId:null,access:`create`},"mediaPlayer.previous":{capName:`media-player`,capScope:`device`,addonId:null,access:`create`},"mediaPlayer.seek":{capName:`media-player`,capScope:`device`,addonId:null,access:`create`},"mediaPlayer.selectSource":{capName:`media-player`,capScope:`device`,addonId:null,access:`create`},"mediaPlayer.setMute":{capName:`media-player`,capScope:`device`,addonId:null,access:`create`},"mediaPlayer.setRepeat":{capName:`media-player`,capScope:`device`,addonId:null,access:`create`},"mediaPlayer.setShuffle":{capName:`media-player`,capScope:`device`,addonId:null,access:`create`},"mediaPlayer.setVolume":{capName:`media-player`,capScope:`device`,addonId:null,access:`create`},"mediaPlayer.stop":{capName:`media-player`,capScope:`device`,addonId:null,access:`create`},"meshNetwork.getStatus":{capName:`mesh-network`,capScope:`system`,addonId:null,access:`view`},"meshNetwork.join":{capName:`mesh-network`,capScope:`system`,addonId:null,access:`create`},"meshNetwork.leave":{capName:`mesh-network`,capScope:`system`,addonId:null,access:`create`},"meshNetwork.listPeers":{capName:`mesh-network`,capScope:`system`,addonId:null,access:`view`},"meshNetwork.logout":{capName:`mesh-network`,capScope:`system`,addonId:null,access:`create`},"meshNetwork.startLogin":{capName:`mesh-network`,capScope:`system`,addonId:null,access:`create`},"meshNetwork.testConnection":{capName:`mesh-network`,capScope:`system`,addonId:null,access:`create`},"metricsProvider.collectSnapshot":{capName:`metrics-provider`,capScope:`system`,addonId:null,access:`view`},"metricsProvider.dumpHeapSnapshot":{capName:`metrics-provider`,capScope:`system`,addonId:null,access:`create`},"metricsProvider.getAddonStats":{capName:`metrics-provider`,capScope:`system`,addonId:null,access:`view`},"metricsProvider.getCached":{capName:`metrics-provider`,capScope:`system`,addonId:null,access:`view`},"metricsProvider.getCpuTemperature":{capName:`metrics-provider`,capScope:`system`,addonId:null,access:`view`},"metricsProvider.getCurrent":{capName:`metrics-provider`,capScope:`system`,addonId:null,access:`view`},"metricsProvider.getDiskSpace":{capName:`metrics-provider`,capScope:`system`,addonId:null,access:`view`},"metricsProvider.getGpuInfo":{capName:`metrics-provider`,capScope:`system`,addonId:null,access:`view`},"metricsProvider.getProcessStats":{capName:`metrics-provider`,capScope:`system`,addonId:null,access:`view`},"metricsProvider.killProcess":{capName:`metrics-provider`,capScope:`system`,addonId:null,access:`create`},"metricsProvider.listAddonInstances":{capName:`metrics-provider`,capScope:`system`,addonId:null,access:`view`},"metricsProvider.listNodeProcesses":{capName:`metrics-provider`,capScope:`system`,addonId:null,access:`view`},"motion.isDetected":{capName:`motion`,capScope:`device`,addonId:null,access:`view`},"motionDetection.analyze":{capName:`motion-detection`,capScope:`device`,addonId:null,access:`create`},"motionDetection.removeCamera":{capName:`motion-detection`,capScope:`device`,addonId:null,access:`delete`},"motionDetection.reset":{capName:`motion-detection`,capScope:`device`,addonId:null,access:`delete`},"motionTrigger.setMotionTrigger":{capName:`motion-trigger`,capScope:`device`,addonId:null,access:`create`},"motionZones.getOptions":{capName:`motion-zones`,capScope:`device`,addonId:null,access:`view`},"motionZones.setZone":{capName:`motion-zones`,capScope:`device`,addonId:null,access:`create`},"mqttBroker.addBroker":{capName:`mqtt-broker`,capScope:`system`,addonId:null,access:`create`},"mqttBroker.getBrokerConfig":{capName:`mqtt-broker`,capScope:`system`,addonId:null,access:`view`},"mqttBroker.getStatus":{capName:`mqtt-broker`,capScope:`system`,addonId:null,access:`view`},"mqttBroker.listBrokers":{capName:`mqtt-broker`,capScope:`system`,addonId:null,access:`view`},"mqttBroker.removeBroker":{capName:`mqtt-broker`,capScope:`system`,addonId:null,access:`delete`},"mqttBroker.startEmbeddedBroker":{capName:`mqtt-broker`,capScope:`system`,addonId:null,access:`create`},"mqttBroker.stopEmbeddedBroker":{capName:`mqtt-broker`,capScope:`system`,addonId:null,access:`create`},"mqttBroker.testConnection":{capName:`mqtt-broker`,capScope:`system`,addonId:null,access:`create`},"nativeObjectDetection.setEnabled":{capName:`native-object-detection`,capScope:`device`,addonId:null,access:`create`},"networkAccess.getEndpoint":{capName:`network-access`,capScope:`system`,addonId:null,access:`view`},"networkAccess.getStatus":{capName:`network-access`,capScope:`system`,addonId:null,access:`view`},"networkAccess.listEndpoints":{capName:`network-access`,capScope:`system`,addonId:null,access:`view`},"networkAccess.start":{capName:`network-access`,capScope:`system`,addonId:null,access:`create`},"networkAccess.stop":{capName:`network-access`,capScope:`system`,addonId:null,access:`create`},"networkQuality.getAllStats":{capName:`network-quality`,capScope:`system`,addonId:null,access:`view`},"networkQuality.getDeviceStats":{capName:`network-quality`,capScope:`system`,addonId:null,access:`view`},"networkQuality.reportClientStats":{capName:`network-quality`,capScope:`system`,addonId:null,access:`create`},"nodes.clusterAddonStatus":{capName:`nodes`,capScope:`system`,addonId:null,access:`view`},"nodes.deployAddon":{capName:`nodes`,capScope:`system`,addonId:null,access:`create`},"nodes.executeQuery":{capName:`nodes`,capScope:`system`,addonId:null,access:`create`},"nodes.getCapUsageGraph":{capName:`nodes`,capScope:`system`,addonId:null,access:`view`},"nodes.getNodeAddons":{capName:`nodes`,capScope:`system`,addonId:null,access:`view`},"nodes.renameNode":{capName:`nodes`,capScope:`system`,addonId:null,access:`create`},"nodes.restartAddon":{capName:`nodes`,capScope:`system`,addonId:null,access:`create`},"nodes.restartNode":{capName:`nodes`,capScope:`system`,addonId:null,access:`create`},"nodes.restartProcess":{capName:`nodes`,capScope:`system`,addonId:null,access:`create`},"nodes.setProcessLogLevel":{capName:`nodes`,capScope:`system`,addonId:null,access:`create`},"nodes.shutdownNode":{capName:`nodes`,capScope:`system`,addonId:null,access:`create`},"nodes.topology":{capName:`nodes`,capScope:`system`,addonId:null,access:`view`},"nodes.undeployAddon":{capName:`nodes`,capScope:`system`,addonId:null,access:`create`},"notificationOutput.send":{capName:`notification-output`,capScope:`system`,addonId:null,access:`create`},"notificationOutput.sendTest":{capName:`notification-output`,capScope:`system`,addonId:null,access:`create`},"notifier.cancel":{capName:`notifier`,capScope:`device`,addonId:null,access:`create`},"notifier.send":{capName:`notifier`,capScope:`device`,addonId:null,access:`create`},"oauthIntegration.getDescriptor":{capName:`oauth-integration`,capScope:`system`,addonId:null,access:`view`},"osd.setOverlay":{capName:`osd`,capScope:`device`,addonId:null,access:`create`},"pipelineAnalytics.clearTracks":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`delete`},"pipelineAnalytics.getActiveTracks":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getAudioEvents":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getEventDensity":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getEventMedia":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getMotionEvents":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getObjectEvents":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getTrack":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.getTrackMedia":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.listTracks":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`view`},"pipelineAnalytics.pruneEventsBefore":{capName:`pipeline-analytics`,capScope:`device`,addonId:null,access:`create`},"pipelineExecutor.cacheFrameInPool":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`create`},"pipelineExecutor.deleteModel":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`delete`},"pipelineExecutor.deleteTemplate":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`delete`},"pipelineExecutor.detect":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.downloadModel":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`create`},"pipelineExecutor.getAddonModels":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.getAudioCapabilities":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.getAvailableEngines":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.getCapabilities":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.getDefaultSteps":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.getDetectionConfigSchema":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.getEffectiveTuning":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.getEngineProvisioning":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.getGlobalPipelineConfig":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.getGlobalSteps":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.getOrchestratorConfigSchema":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.getReferenceAudio":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.getReferenceAudioFiles":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.getReferenceImage":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.getSchema":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.getSelectedEngine":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.getVideoPipelineSteps":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.inferCached":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`create`},"pipelineExecutor.killEngine":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`create`},"pipelineExecutor.listLoadedEngines":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.listReferenceImages":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.listTemplates":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`view`},"pipelineExecutor.reprobeEngine":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`create`},"pipelineExecutor.runAudioTest":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`create`},"pipelineExecutor.runPipeline":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`create`},"pipelineExecutor.runPipelineBatch":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`create`},"pipelineExecutor.saveTemplate":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`create`},"pipelineExecutor.setVideoPipelineSteps":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`create`},"pipelineExecutor.spinEngine":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`create`},"pipelineExecutor.uncacheFrame":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`create`},"pipelineExecutor.updateTemplate":{capName:`pipeline-executor`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.assignAudio":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.assignDecoder":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.assignPipeline":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.deleteTemplate":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`delete`},"pipelineOrchestrator.getAgentLoad":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getAgentSettings":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getAudioAssignment":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getAudioAssignments":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getAudioNodeLoad":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getCameraMetrics":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getCameraSettings":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getCameraStatus":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getCameraStatuses":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getCameraStepOverrides":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getCapabilityBindings":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getDecoderAssignment":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getDecoderAssignments":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getGlobalMetrics":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getPipelineAssignment":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.getPipelineAssignments":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.listAgentSettings":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.listTemplates":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.rebalance":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.removeAgentSettings":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`delete`},"pipelineOrchestrator.resolvePipeline":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`view`},"pipelineOrchestrator.saveTemplate":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.setAgentAddonDefaults":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.setAgentMaxCameras":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.setCameraPipelineForAgent":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.setCameraStepOverride":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.setCameraStepToggle":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.setCapabilityBinding":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.unassignAudio":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.unassignDecoder":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.unassignPipeline":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineOrchestrator.updateTemplate":{capName:`pipeline-orchestrator`,capScope:`system`,addonId:null,access:`create`},"pipelineRunner.attachCamera":{capName:`pipeline-runner`,capScope:`system`,addonId:null,access:`create`},"pipelineRunner.detachCamera":{capName:`pipeline-runner`,capScope:`system`,addonId:null,access:`create`},"pipelineRunner.getAllCameraMetrics":{capName:`pipeline-runner`,capScope:`system`,addonId:null,access:`view`},"pipelineRunner.getCameraMetrics":{capName:`pipeline-runner`,capScope:`system`,addonId:null,access:`view`},"pipelineRunner.getLocalCameras":{capName:`pipeline-runner`,capScope:`system`,addonId:null,access:`view`},"pipelineRunner.getLocalLoad":{capName:`pipeline-runner`,capScope:`system`,addonId:null,access:`view`},"pipelineRunner.getLocalMetrics":{capName:`pipeline-runner`,capScope:`system`,addonId:null,access:`view`},"pipelineRunner.reportMotion":{capName:`pipeline-runner`,capScope:`system`,addonId:null,access:`create`},"plateGallery.correctPlateText":{capName:`plate-gallery`,capScope:`system`,addonId:null,access:`create`},"plateGallery.deletePlate":{capName:`plate-gallery`,capScope:`system`,addonId:null,access:`delete`},"plateGallery.getPlateByTrack":{capName:`plate-gallery`,capScope:`system`,addonId:null,access:`view`},"plateGallery.getPlateMedia":{capName:`plate-gallery`,capScope:`system`,addonId:null,access:`view`},"plateGallery.listPlates":{capName:`plate-gallery`,capScope:`system`,addonId:null,access:`view`},"plateGallery.searchPlates":{capName:`plate-gallery`,capScope:`system`,addonId:null,access:`view`},"plateGallery.suggestPlateClusters":{capName:`plate-gallery`,capScope:`system`,addonId:null,access:`view`},"platformProbe.getCapabilities":{capName:`platform-probe`,capScope:`system`,addonId:null,access:`view`},"platformProbe.getHardware":{capName:`platform-probe`,capScope:`system`,addonId:null,access:`view`},"platformProbe.getHardwareDecodeAccels":{capName:`platform-probe`,capScope:`system`,addonId:null,access:`view`},"platformProbe.getHardwareEncoders":{capName:`platform-probe`,capScope:`system`,addonId:null,access:`view`},"platformProbe.refreshHardwareDecodeAccels":{capName:`platform-probe`,capScope:`system`,addonId:null,access:`create`},"platformProbe.refreshHardwareEncoders":{capName:`platform-probe`,capScope:`system`,addonId:null,access:`create`},"platformProbe.resolveHwAccel":{capName:`platform-probe`,capScope:`system`,addonId:null,access:`view`},"platformProbe.resolveInferenceConfig":{capName:`platform-probe`,capScope:`system`,addonId:null,access:`view`},"privacyMask.getOptions":{capName:`privacy-mask`,capScope:`device`,addonId:null,access:`view`},"privacyMask.setMask":{capName:`privacy-mask`,capScope:`device`,addonId:null,access:`create`},"ptz.continuousMove":{capName:`ptz`,capScope:`device`,addonId:null,access:`create`},"ptz.deletePreset":{capName:`ptz`,capScope:`device`,addonId:null,access:`delete`},"ptz.getOptions":{capName:`ptz`,capScope:`device`,addonId:null,access:`view`},"ptz.getPosition":{capName:`ptz`,capScope:`device`,addonId:null,access:`view`},"ptz.getPresets":{capName:`ptz`,capScope:`device`,addonId:null,access:`view`},"ptz.goHome":{capName:`ptz`,capScope:`device`,addonId:null,access:`create`},"ptz.goToPreset":{capName:`ptz`,capScope:`device`,addonId:null,access:`create`},"ptz.move":{capName:`ptz`,capScope:`device`,addonId:null,access:`create`},"ptz.savePreset":{capName:`ptz`,capScope:`device`,addonId:null,access:`create`},"ptz.setAutofocus":{capName:`ptz`,capScope:`device`,addonId:null,access:`create`},"ptz.stop":{capName:`ptz`,capScope:`device`,addonId:null,access:`create`},"ptzAutotrack.getSettings":{capName:`ptz-autotrack`,capScope:`device`,addonId:null,access:`view`},"ptzAutotrack.getStatus":{capName:`ptz-autotrack`,capScope:`device`,addonId:null,access:`view`},"ptzAutotrack.setEnabled":{capName:`ptz-autotrack`,capScope:`device`,addonId:null,access:`create`},"ptzAutotrack.setSettings":{capName:`ptz-autotrack`,capScope:`device`,addonId:null,access:`create`},"reboot.reboot":{capName:`reboot`,capScope:`device`,addonId:null,access:`create`},"recording.getAvailability":{capName:`recording`,capScope:`system`,addonId:null,access:`view`},"recording.getDaysWithRecordings":{capName:`recording`,capScope:`system`,addonId:null,access:`view`},"recording.getDeviceConfig":{capName:`recording`,capScope:`system`,addonId:null,access:`view`},"recording.getPlaybackManifest":{capName:`recording`,capScope:`system`,addonId:null,access:`view`},"recording.getStorageUsage":{capName:`recording`,capScope:`system`,addonId:null,access:`view`},"recording.locateSegment":{capName:`recording`,capScope:`system`,addonId:null,access:`view`},"recording.pruneFootage":{capName:`recording`,capScope:`system`,addonId:null,access:`create`},"recording.readSegmentBytes":{capName:`recording`,capScope:`system`,addonId:null,access:`view`},"recording.rescanStorage":{capName:`recording`,capScope:`system`,addonId:null,access:`create`},"recording.setDeviceConfig":{capName:`recording`,capScope:`system`,addonId:null,access:`create`},"restreamer.getExposedResources":{capName:`restreamer`,capScope:`system`,addonId:null,access:`view`},"restreamer.registerDevice":{capName:`restreamer`,capScope:`system`,addonId:null,access:`create`},"restreamer.unregisterDevice":{capName:`restreamer`,capScope:`system`,addonId:null,access:`delete`},"scriptRunner.run":{capName:`script-runner`,capScope:`device`,addonId:null,access:`create`},"scriptRunner.stop":{capName:`script-runner`,capScope:`device`,addonId:null,access:`create`},"settingsStore.count":{capName:`settings-store`,capScope:`system`,addonId:null,access:`view`},"settingsStore.declareCollection":{capName:`settings-store`,capScope:`system`,addonId:null,access:`create`},"settingsStore.delete":{capName:`settings-store`,capScope:`system`,addonId:null,access:`delete`},"settingsStore.get":{capName:`settings-store`,capScope:`system`,addonId:null,access:`view`},"settingsStore.histogram":{capName:`settings-store`,capScope:`system`,addonId:null,access:`view`},"settingsStore.insert":{capName:`settings-store`,capScope:`system`,addonId:null,access:`create`},"settingsStore.isEmpty":{capName:`settings-store`,capScope:`system`,addonId:null,access:`view`},"settingsStore.query":{capName:`settings-store`,capScope:`system`,addonId:null,access:`view`},"settingsStore.set":{capName:`settings-store`,capScope:`system`,addonId:null,access:`create`},"settingsStore.update":{capName:`settings-store`,capScope:`system`,addonId:null,access:`create`},"smtpProvider.getStatus":{capName:`smtp-provider`,capScope:`system`,addonId:null,access:`view`},"smtpProvider.sendEmail":{capName:`smtp-provider`,capScope:`system`,addonId:null,access:`create`},"smtpProvider.verify":{capName:`smtp-provider`,capScope:`system`,addonId:null,access:`view`},"snapshot.getSnapshot":{capName:`snapshot`,capScope:`device`,addonId:null,access:`view`},"snapshot.invalidateCache":{capName:`snapshot`,capScope:`device`,addonId:null,access:`create`},"snapshotProvider.getSnapshot":{capName:`snapshot-provider`,capScope:`system`,addonId:null,access:`view`},"snapshotProvider.supportsDevice":{capName:`snapshot-provider`,capScope:`system`,addonId:null,access:`view`},"ssoBridge.signBridgeToken":{capName:`sso-bridge`,capScope:`system`,addonId:null,access:`view`},"ssoBridge.verifyBridgeToken":{capName:`sso-bridge`,capScope:`system`,addonId:null,access:`view`},"storage.abortUpload":{capName:`storage`,capScope:`system`,addonId:null,access:`create`},"storage.beginDownload":{capName:`storage`,capScope:`system`,addonId:null,access:`create`},"storage.beginUpload":{capName:`storage`,capScope:`system`,addonId:null,access:`create`},"storage.delete":{capName:`storage`,capScope:`system`,addonId:null,access:`delete`},"storage.deleteLocation":{capName:`storage`,capScope:`system`,addonId:null,access:`delete`},"storage.endDownload":{capName:`storage`,capScope:`system`,addonId:null,access:`create`},"storage.exists":{capName:`storage`,capScope:`system`,addonId:null,access:`view`},"storage.finalizeUpload":{capName:`storage`,capScope:`system`,addonId:null,access:`create`},"storage.getAvailableSpace":{capName:`storage`,capScope:`system`,addonId:null,access:`view`},"storage.getDefaultLocation":{capName:`storage`,capScope:`system`,addonId:null,access:`view`},"storage.list":{capName:`storage`,capScope:`system`,addonId:null,access:`view`},"storage.listLocationDeclarations":{capName:`storage`,capScope:`system`,addonId:null,access:`view`},"storage.listLocations":{capName:`storage`,capScope:`system`,addonId:null,access:`view`},"storage.listProviders":{capName:`storage`,capScope:`system`,addonId:null,access:`view`},"storage.read":{capName:`storage`,capScope:`system`,addonId:null,access:`view`},"storage.readChunk":{capName:`storage`,capScope:`system`,addonId:null,access:`view`},"storage.resolve":{capName:`storage`,capScope:`system`,addonId:null,access:`view`},"storage.testConfig":{capName:`storage`,capScope:`system`,addonId:null,access:`view`},"storage.testLocation":{capName:`storage`,capScope:`system`,addonId:null,access:`view`},"storage.upsertLocation":{capName:`storage`,capScope:`system`,addonId:null,access:`create`},"storage.write":{capName:`storage`,capScope:`system`,addonId:null,access:`create`},"storage.writeChunk":{capName:`storage`,capScope:`system`,addonId:null,access:`create`},"storageEvictable.evict":{capName:`storage-evictable`,capScope:`system`,addonId:null,access:`create`},"storageEvictable.getEvictableUsage":{capName:`storage-evictable`,capScope:`system`,addonId:null,access:`view`},"storageProvider.abortUpload":{capName:`storage-provider`,capScope:`system`,addonId:null,access:`create`},"storageProvider.beginDownload":{capName:`storage-provider`,capScope:`system`,addonId:null,access:`create`},"storageProvider.beginUpload":{capName:`storage-provider`,capScope:`system`,addonId:null,access:`create`},"storageProvider.delete":{capName:`storage-provider`,capScope:`system`,addonId:null,access:`delete`},"storageProvider.endDownload":{capName:`storage-provider`,capScope:`system`,addonId:null,access:`create`},"storageProvider.exists":{capName:`storage-provider`,capScope:`system`,addonId:null,access:`view`},"storageProvider.finalizeUpload":{capName:`storage-provider`,capScope:`system`,addonId:null,access:`create`},"storageProvider.getAvailableSpace":{capName:`storage-provider`,capScope:`system`,addonId:null,access:`view`},"storageProvider.getProviderInfo":{capName:`storage-provider`,capScope:`system`,addonId:null,access:`view`},"storageProvider.list":{capName:`storage-provider`,capScope:`system`,addonId:null,access:`view`},"storageProvider.read":{capName:`storage-provider`,capScope:`system`,addonId:null,access:`view`},"storageProvider.readChunk":{capName:`storage-provider`,capScope:`system`,addonId:null,access:`view`},"storageProvider.resolve":{capName:`storage-provider`,capScope:`system`,addonId:null,access:`view`},"storageProvider.testLocation":{capName:`storage-provider`,capScope:`system`,addonId:null,access:`view`},"storageProvider.write":{capName:`storage-provider`,capScope:`system`,addonId:null,access:`create`},"storageProvider.writeChunk":{capName:`storage-provider`,capScope:`system`,addonId:null,access:`create`},"streamBroker.assignProfile":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.getAllRtspEntries":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`view`},"streamBroker.getBrokerStats":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`view`},"streamBroker.getPreBufferInfo":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`view`},"streamBroker.getRtspEntry":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`view`},"streamBroker.getRtspPort":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`view`},"streamBroker.getStreamUrl":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`view`},"streamBroker.getStreamWithCodec":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.isRtspEnabled":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`view`},"streamBroker.killClient":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.listAllCameraStreams":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`view`},"streamBroker.listAllProfileSlots":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`view`},"streamBroker.listClients":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`view`},"streamBroker.probeStream":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.publishCameraStream":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.pullAudioChunks":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`view`},"streamBroker.pullFrameHandles":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`view`},"streamBroker.regenerateRtspToken":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.releaseStreamWithCodec":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.restartProfile":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.retractCameraStream":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.setPreBufferDuration":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.setRtspEnabled":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.subscribeAudioChunks":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.subscribeFrames":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.unassignProfile":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.unsubscribeAudioChunks":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamBroker.unsubscribeFrames":{capName:`stream-broker`,capScope:`system`,addonId:null,access:`create`},"streamCatalog.getCatalog":{capName:`stream-catalog`,capScope:`device`,addonId:null,access:`view`},"streamingEngine.getStreamUrl":{capName:`streaming-engine`,capScope:`system`,addonId:null,access:`view`},"streamingEngine.listStreams":{capName:`streaming-engine`,capScope:`system`,addonId:null,access:`view`},"streamingEngine.registerStream":{capName:`streaming-engine`,capScope:`system`,addonId:null,access:`create`},"streamingEngine.unregisterStream":{capName:`streaming-engine`,capScope:`system`,addonId:null,access:`delete`},"streamParams.getConfigSchema":{capName:`stream-params`,capScope:`device`,addonId:null,access:`view`},"streamParams.getOptions":{capName:`stream-params`,capScope:`device`,addonId:null,access:`view`},"streamParams.setProfile":{capName:`stream-params`,capScope:`device`,addonId:null,access:`create`},"switch.setState":{capName:`switch`,capScope:`device`,addonId:null,access:`create`},"system.featureFlags":{capName:`system`,capScope:`system`,addonId:null,access:`view`},"system.forceRetentionCleanup":{capName:`system`,capScope:`system`,addonId:null,access:`create`},"system.getRetentionConfig":{capName:`system`,capScope:`system`,addonId:null,access:`view`},"system.health":{capName:`system`,capScope:`system`,addonId:null,access:`view`},"system.info":{capName:`system`,capScope:`system`,addonId:null,access:`view`},"system.networkAddresses":{capName:`system`,capScope:`system`,addonId:null,access:`view`},"system.setRetentionConfig":{capName:`system`,capScope:`system`,addonId:null,access:`create`},"toast.onToast":{capName:`toast`,capScope:`system`,addonId:null,access:`view`},"turnProvider.getTurnServers":{capName:`turn-provider`,capScope:`system`,addonId:null,access:`view`},"update.installUpdate":{capName:`update`,capScope:`device`,addonId:null,access:`create`},"userManagement.confirmTotp":{capName:`user-management`,capScope:`system`,addonId:null,access:`create`},"userManagement.createApiKey":{capName:`user-management`,capScope:`system`,addonId:null,access:`create`},"userManagement.createScopedToken":{capName:`user-management`,capScope:`system`,addonId:null,access:`create`},"userManagement.createUser":{capName:`user-management`,capScope:`system`,addonId:null,access:`create`},"userManagement.deleteUser":{capName:`user-management`,capScope:`system`,addonId:null,access:`delete`},"userManagement.disableTotp":{capName:`user-management`,capScope:`system`,addonId:null,access:`delete`},"userManagement.getTotpStatus":{capName:`user-management`,capScope:`system`,addonId:null,access:`view`},"userManagement.listApiKeys":{capName:`user-management`,capScope:`system`,addonId:null,access:`view`},"userManagement.listOauthSessions":{capName:`user-management`,capScope:`system`,addonId:null,access:`view`},"userManagement.listScopedTokens":{capName:`user-management`,capScope:`system`,addonId:null,access:`view`},"userManagement.listUsers":{capName:`user-management`,capScope:`system`,addonId:null,access:`view`},"userManagement.oauthExchangeCode":{capName:`user-management`,capScope:`system`,addonId:null,access:`view`},"userManagement.oauthIssueCode":{capName:`user-management`,capScope:`system`,addonId:null,access:`create`},"userManagement.oauthRefresh":{capName:`user-management`,capScope:`system`,addonId:null,access:`view`},"userManagement.oauthVerifyAccessToken":{capName:`user-management`,capScope:`system`,addonId:null,access:`view`},"userManagement.resetPassword":{capName:`user-management`,capScope:`system`,addonId:null,access:`create`},"userManagement.revokeApiKey":{capName:`user-management`,capScope:`system`,addonId:null,access:`delete`},"userManagement.revokeOauthSession":{capName:`user-management`,capScope:`system`,addonId:null,access:`delete`},"userManagement.revokeScopedToken":{capName:`user-management`,capScope:`system`,addonId:null,access:`delete`},"userManagement.setupTotp":{capName:`user-management`,capScope:`system`,addonId:null,access:`create`},"userManagement.setUserScopes":{capName:`user-management`,capScope:`system`,addonId:null,access:`create`},"userManagement.updateUser":{capName:`user-management`,capScope:`system`,addonId:null,access:`create`},"userManagement.validateApiKey":{capName:`user-management`,capScope:`system`,addonId:null,access:`view`},"userManagement.validateCredentials":{capName:`user-management`,capScope:`system`,addonId:null,access:`view`},"userManagement.validateScopedToken":{capName:`user-management`,capScope:`system`,addonId:null,access:`view`},"userManagement.verifyTotp":{capName:`user-management`,capScope:`system`,addonId:null,access:`view`},"userPasskeys.beginAuthentication":{capName:`user-passkeys`,capScope:`system`,addonId:null,access:`view`},"userPasskeys.beginRegistration":{capName:`user-passkeys`,capScope:`system`,addonId:null,access:`create`},"userPasskeys.finishAuthentication":{capName:`user-passkeys`,capScope:`system`,addonId:null,access:`view`},"userPasskeys.finishRegistration":{capName:`user-passkeys`,capScope:`system`,addonId:null,access:`create`},"userPasskeys.listPasskeys":{capName:`user-passkeys`,capScope:`system`,addonId:null,access:`view`},"userPasskeys.removePasskey":{capName:`user-passkeys`,capScope:`system`,addonId:null,access:`delete`},"vacuumControl.locate":{capName:`vacuum-control`,capScope:`device`,addonId:null,access:`create`},"vacuumControl.pause":{capName:`vacuum-control`,capScope:`device`,addonId:null,access:`create`},"vacuumControl.returnToBase":{capName:`vacuum-control`,capScope:`device`,addonId:null,access:`create`},"vacuumControl.setFanSpeed":{capName:`vacuum-control`,capScope:`device`,addonId:null,access:`create`},"vacuumControl.start":{capName:`vacuum-control`,capScope:`device`,addonId:null,access:`create`},"vacuumControl.stop":{capName:`vacuum-control`,capScope:`device`,addonId:null,access:`create`},"valve.close":{capName:`valve`,capScope:`device`,addonId:null,access:`create`},"valve.open":{capName:`valve`,capScope:`device`,addonId:null,access:`create`},"valve.setPosition":{capName:`valve`,capScope:`device`,addonId:null,access:`create`},"valve.stop":{capName:`valve`,capScope:`device`,addonId:null,access:`create`},"videoclips.getClipPlayback":{capName:`videoclips`,capScope:`device`,addonId:null,access:`view`},"videoclips.listClips":{capName:`videoclips`,capScope:`device`,addonId:null,access:`view`},"waterHeater.setAway":{capName:`water-heater`,capScope:`device`,addonId:null,access:`create`},"waterHeater.setOperationMode":{capName:`water-heater`,capScope:`device`,addonId:null,access:`create`},"waterHeater.setTargetTemp":{capName:`water-heater`,capScope:`device`,addonId:null,access:`create`},"webrtc.closeSession":{capName:`webrtc`,capScope:`system`,addonId:null,access:`create`},"webrtc.createSession":{capName:`webrtc`,capScope:`system`,addonId:null,access:`create`},"webrtc.handleAnswer":{capName:`webrtc`,capScope:`system`,addonId:null,access:`create`},"webrtc.handleOffer":{capName:`webrtc`,capScope:`system`,addonId:null,access:`create`},"webrtc.hasAdaptiveBitrate":{capName:`webrtc`,capScope:`system`,addonId:null,access:`view`},"webrtc.registerStream":{capName:`webrtc`,capScope:`system`,addonId:null,access:`create`},"webrtc.supportsStream":{capName:`webrtc`,capScope:`system`,addonId:null,access:`view`},"webrtc.unregisterStream":{capName:`webrtc`,capScope:`system`,addonId:null,access:`delete`},"webrtcSession.addIceCandidate":{capName:`webrtc-session`,capScope:`device`,addonId:null,access:`create`},"webrtcSession.closeSession":{capName:`webrtc-session`,capScope:`device`,addonId:null,access:`create`},"webrtcSession.createSession":{capName:`webrtc-session`,capScope:`device`,addonId:null,access:`create`},"webrtcSession.getIceCandidates":{capName:`webrtc-session`,capScope:`device`,addonId:null,access:`view`},"webrtcSession.getSessionState":{capName:`webrtc-session`,capScope:`device`,addonId:null,access:`view`},"webrtcSession.handleAnswer":{capName:`webrtc-session`,capScope:`device`,addonId:null,access:`create`},"webrtcSession.handleOffer":{capName:`webrtc-session`,capScope:`device`,addonId:null,access:`create`},"webrtcSession.hasAdaptiveBitrate":{capName:`webrtc-session`,capScope:`device`,addonId:null,access:`view`},"webrtcSession.listStreams":{capName:`webrtc-session`,capScope:`device`,addonId:null,access:`view`},"zoneAnalytics.getCameraHistory":{capName:`zone-analytics`,capScope:`device`,addonId:null,access:`view`},"zoneAnalytics.getCurrentSnapshot":{capName:`zone-analytics`,capScope:`device`,addonId:null,access:`view`},"zoneAnalytics.getUnzonedHistory":{capName:`zone-analytics`,capScope:`device`,addonId:null,access:`view`},"zoneAnalytics.getZoneHistory":{capName:`zone-analytics`,capScope:`device`,addonId:null,access:`view`},"zoneRules.listRules":{capName:`zone-rules`,capScope:`device`,addonId:null,access:`view`},"zoneRules.setRules":{capName:`zone-rules`,capScope:`device`,addonId:null,access:`create`},"zones.addZone":{capName:`zones`,capScope:`device`,addonId:null,access:`create`},"zones.listZones":{capName:`zones`,capScope:`device`,addonId:null,access:`view`},"zones.removeZone":{capName:`zones`,capScope:`device`,addonId:null,access:`delete`},"zones.updateZone":{capName:`zones`,capScope:`device`,addonId:null,access:`create`}}),Object.freeze({broker:`broker`,"device-export":`device-export`,"mesh-network":`mesh`,"mqtt-broker":`broker`,"network-access":`ingress`,"smtp-provider":`email`});var ST=V({name:F(),stagedPath:F(),backupPath:F(),toVersion:F(),fromVersion:F().nullable()});V({jobId:F(),taskId:F(),packages:B(ST),requestedAtMs:I(),schemaVersion:G(1)}),V({jobId:F(),taskId:F(),backups:B(V({name:F(),backupPath:F(),livePath:F()})),appliedAtMs:I(),bootAttempts:I(),schemaVersion:G(1)});var CT=class{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set(e,t){this.keyToValue.set(e,t),this.valueToKey.set(t,e)}getByKey(e){return this.keyToValue.get(e)}getByValue(e){return this.valueToKey.get(e)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}},wT=class{constructor(e){this.generateIdentifier=e,this.kv=new CT}register(e,t){this.kv.getByValue(e)||(t||=this.generateIdentifier(e),this.kv.set(t,e))}clear(){this.kv.clear()}getIdentifier(e){return this.kv.getByValue(e)}getValue(e){return this.kv.getByKey(e)}},TT=class extends wT{constructor(){super(e=>e.name),this.classToAllowedProps=new Map}register(e,t){typeof t==`object`?(t.allowProps&&this.classToAllowedProps.set(e,t.allowProps),super.register(e,t.identifier)):super.register(e,t)}getAllowedProps(e){return this.classToAllowedProps.get(e)}};function ET(e){if(`values`in Object)return Object.values(e);let t=[];for(let n in e)e.hasOwnProperty(n)&&t.push(e[n]);return t}function DT(e,t){let n=ET(e);if(`find`in n)return n.find(t);let r=n;for(let e=0;e<r.length;e++){let n=r[e];if(t(n))return n}}function OT(e,t){Object.entries(e).forEach(([e,n])=>t(n,e))}function kT(e,t){return e.indexOf(t)!==-1}function AT(e,t){for(let n=0;n<e.length;n++){let r=e[n];if(t(r))return r}}var jT=class{constructor(){this.transfomers={}}register(e){this.transfomers[e.name]=e}findApplicable(e){return DT(this.transfomers,t=>t.isApplicable(e))}findByName(e){return this.transfomers[e]}},MT=e=>Object.prototype.toString.call(e).slice(8,-1),NT=e=>e===void 0,PT=e=>e===null,FT=e=>typeof e!=`object`||!e||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype,IT=e=>FT(e)&&Object.keys(e).length===0,LT=e=>Array.isArray(e),RT=e=>typeof e==`string`,zT=e=>typeof e==`number`&&!isNaN(e),BT=e=>typeof e==`boolean`,VT=e=>e instanceof RegExp,HT=e=>e instanceof Map,UT=e=>e instanceof Set,WT=e=>MT(e)===`Symbol`,GT=e=>e instanceof Date&&!isNaN(e.valueOf()),KT=e=>e instanceof Error,qT=e=>typeof e==`number`&&isNaN(e),JT=e=>BT(e)||PT(e)||NT(e)||zT(e)||RT(e)||WT(e),YT=e=>typeof e==`bigint`,XT=e=>e===1/0||e===-1/0,ZT=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),QT=e=>e instanceof URL,$T=e=>e.replace(/\\/g,`\\\\`).replace(/\./g,`\\.`),eE=e=>e.map(String).map($T).join(`.`),tE=(e,t)=>{let n=[],r=``;for(let a=0;a<e.length;a++){let o=e.charAt(a);if(!t&&o===`\\`){let t=e.charAt(a+1);if(t===`\\`){r+=`\\`,a++;continue}else if(t!==`.`)throw Error(`invalid path`)}if(o===`\\`&&e.charAt(a+1)===`.`){r+=`.`,a++;continue}if(o===`.`){n.push(r),r=``;continue}r+=o}let a=r;return n.push(a),n};function nE(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var rE=[nE(NT,`undefined`,()=>null,()=>void 0),nE(YT,`bigint`,e=>e.toString(),e=>typeof BigInt<`u`?BigInt(e):(console.error(`Please add a BigInt polyfill.`),e)),nE(GT,`Date`,e=>e.toISOString(),e=>new Date(e)),nE(KT,`Error`,(e,t)=>{let n={name:e.name,message:e.message};return`cause`in e&&(n.cause=e.cause),t.allowedErrorProps.forEach(t=>{n[t]=e[t]}),n},(e,t)=>{let n=Error(e.message,{cause:e.cause});return n.name=e.name,n.stack=e.stack,t.allowedErrorProps.forEach(t=>{n[t]=e[t]}),n}),nE(VT,`regexp`,e=>``+e,e=>{let t=e.slice(1,e.lastIndexOf(`/`)),n=e.slice(e.lastIndexOf(`/`)+1);return new RegExp(t,n)}),nE(UT,`set`,e=>[...e.values()],e=>new Set(e)),nE(HT,`map`,e=>[...e.entries()],e=>new Map(e)),nE(e=>qT(e)||XT(e),`number`,e=>qT(e)?`NaN`:e>0?`Infinity`:`-Infinity`,Number),nE(e=>e===0&&1/e==-1/0,`number`,()=>`-0`,Number),nE(QT,`URL`,e=>e.toString(),e=>new URL(e))];function iE(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var aE=iE((e,t)=>WT(e)?!!t.symbolRegistry.getIdentifier(e):!1,(e,t)=>[`symbol`,t.symbolRegistry.getIdentifier(e)],e=>e.description,(e,t,n)=>{let r=n.symbolRegistry.getValue(t[1]);if(!r)throw Error(`Trying to deserialize unknown symbol`);return r}),oE=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),sE=iE(ZT,e=>[`typed-array`,e.constructor.name],e=>[...e],(e,t)=>{let n=oE[t[1]];if(!n)throw Error(`Trying to deserialize unknown typed array`);return new n(e)});function cE(e,t){return e?.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}var lE=iE(cE,(e,t)=>[`class`,t.classRegistry.getIdentifier(e.constructor)],(e,t)=>{let n=t.classRegistry.getAllowedProps(e.constructor);if(!n)return{...e};let r={};return n.forEach(t=>{r[t]=e[t]}),r},(e,t,n)=>{let r=n.classRegistry.getValue(t[1]);if(!r)throw Error(`Trying to deserialize unknown class '${t[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);return Object.assign(Object.create(r.prototype),e)}),uE=iE((e,t)=>!!t.customTransformerRegistry.findApplicable(e),(e,t)=>[`custom`,t.customTransformerRegistry.findApplicable(e).name],(e,t)=>t.customTransformerRegistry.findApplicable(e).serialize(e),(e,t,n)=>{let r=n.customTransformerRegistry.findByName(t[1]);if(!r)throw Error(`Trying to deserialize unknown custom value`);return r.deserialize(e)}),dE=[lE,aE,uE,sE],fE=(e,t)=>{let n=AT(dE,n=>n.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};let r=AT(rE,n=>n.isApplicable(e,t));if(r)return{value:r.transform(e,t),type:r.annotation}},pE={};rE.forEach(e=>{pE[e.annotation]=e});var mE=(e,t,n)=>{if(LT(t))switch(t[0]){case`symbol`:return aE.untransform(e,t,n);case`class`:return lE.untransform(e,t,n);case`custom`:return uE.untransform(e,t,n);case`typed-array`:return sE.untransform(e,t,n);default:throw Error(`Unknown transformation: `+t)}else{let r=pE[t];if(!r)throw Error(`Unknown transformation: `+t);return r.untransform(e,n)}},hE=(e,t)=>{if(t>e.size)throw Error(`index out of bounds`);let n=e.keys();for(;t>0;)n.next(),t--;return n.next().value};function gE(e){if(kT(e,`__proto__`))throw Error(`__proto__ is not allowed as a property`);if(kT(e,`prototype`))throw Error(`prototype is not allowed as a property`);if(kT(e,`constructor`))throw Error(`constructor is not allowed as a property`)}var _E=(e,t)=>{gE(t);for(let n=0;n<t.length;n++){let r=t[n];if(UT(e))e=hE(e,+r);else if(HT(e)){let a=+r,o=+t[++n]==0?`key`:`value`,s=hE(e,a);switch(o){case`key`:e=s;break;case`value`:e=e.get(s);break}}else e=e[r]}return e},vE=(e,t,n)=>{if(gE(t),t.length===0)return n(e);let r=e;for(let e=0;e<t.length-1;e++){let n=t[e];if(LT(r)){let e=+n;r=r[e]}else if(FT(r))r=r[n];else if(UT(r)){let e=+n;r=hE(r,e)}else if(HT(r)){if(e===t.length-2)break;let a=+n,o=+t[++e]==0?`key`:`value`,s=hE(r,a);switch(o){case`key`:r=s;break;case`value`:r=r.get(s);break}}}let a=t[t.length-1];if(LT(r)?r[+a]=n(r[+a]):FT(r)&&(r[a]=n(r[a])),UT(r)){let e=hE(r,+a),t=n(e);e!==t&&(r.delete(e),r.add(t))}if(HT(r)){let e=+t[t.length-2],o=hE(r,e);switch(+a==0?`key`:`value`){case`key`:{let e=n(o);r.set(e,r.get(o)),e!==o&&r.delete(o);break}case`value`:r.set(o,n(r.get(o)));break}}return e},yE=e=>e<1;function bE(e,t,n,r=[]){if(!e)return;let a=yE(n);if(!LT(e)){OT(e,(e,o)=>bE(e,t,n,[...r,...tE(o,a)]));return}let[o,s]=e;s&&OT(s,(e,o)=>{bE(e,t,n,[...r,...tE(o,a)])}),t(o,r)}function xE(e,t,n,r){return bE(t,(t,n)=>{e=vE(e,n,e=>mE(e,t,r))},n),e}function SE(e,t,n){let r=yE(n);function a(t,n){let a=_E(e,tE(n,r));t.map(e=>tE(e,r)).forEach(t=>{e=vE(e,t,()=>a)})}if(LT(t)){let[n,o]=t;n.forEach(t=>{e=vE(e,tE(t,r),()=>e)}),o&&OT(o,a)}else OT(t,a);return e}var CE=(e,t)=>FT(e)||LT(e)||HT(e)||UT(e)||KT(e)||cE(e,t);function wE(e,t,n){let r=n.get(e);r?r.push(t):n.set(e,[t])}function TE(e,t){let n={},r;return e.forEach(e=>{if(e.length<=1)return;t||(e=e.map(e=>e.map(String)).sort((e,t)=>e.length-t.length));let[a,...o]=e;a.length===0?r=o.map(eE):n[eE(a)]=o.map(eE)}),r?IT(n)?[r]:[r,n]:IT(n)?void 0:n}var EE=(e,t,n,r,a=[],o=[],s=new Map)=>{let c=JT(e);if(!c){wE(e,a,t);let n=s.get(e);if(n)return r?{transformedValue:null}:n}if(!CE(e,n)){let t=fE(e,n),r=t?{transformedValue:t.value,annotations:[t.type]}:{transformedValue:e};return c||s.set(e,r),r}if(kT(o,e))return{transformedValue:null};let l=fE(e,n),u=l?.value??e,d=LT(u)?[]:{},f={};OT(u,(c,l)=>{if(l===`__proto__`||l===`constructor`||l===`prototype`)throw Error(`Detected property ${l}. This is a prototype pollution risk, please remove it from your object.`);let u=EE(c,t,n,r,[...a,l],[...o,e],s);d[l]=u.transformedValue,LT(u.annotations)?f[$T(l)]=u.annotations:FT(u.annotations)&&OT(u.annotations,(e,t)=>{f[$T(l)+`.`+t]=e})});let p=IT(f)?{transformedValue:d,annotations:l?[l.type]:void 0}:{transformedValue:d,annotations:l?[l.type,f]:f};return c||s.set(e,p),p};function DE(e){return Object.prototype.toString.call(e).slice(8,-1)}function OE(e){return DE(e)===`Array`}function kE(e){if(DE(e)!==`Object`)return!1;let t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function AE(e,t,n,r,a){let o={}.propertyIsEnumerable.call(r,t)?`enumerable`:`nonenumerable`;o===`enumerable`&&(e[t]=n),a&&o===`nonenumerable`&&Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}function jE(e,t={}){if(OE(e))return e.map(e=>jE(e,t));if(!kE(e))return e;let n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertySymbols(e);return[...n,...r].reduce((n,r)=>{if(r===`__proto__`||OE(t.props)&&!t.props.includes(r))return n;let a=e[r];return AE(n,r,jE(a,t),e,t.nonenumerable),n},{})}var ME=class{constructor({dedupe:e=!1}={}){this.classRegistry=new TT,this.symbolRegistry=new wT(e=>e.description??``),this.customTransformerRegistry=new jT,this.allowedErrorProps=[],this.dedupe=e}serialize(e){let t=new Map,n=EE(e,t,this,this.dedupe),r={json:n.transformedValue};n.annotations&&(r.meta={...r.meta,values:n.annotations});let a=TE(t,this.dedupe);return a&&(r.meta={...r.meta,referentialEqualities:a}),r.meta&&(r.meta.v=1),r}deserialize(e,t){let{json:n,meta:r}=e,a=t?.inPlace?n:jE(n);return r?.values&&(a=xE(a,r.values,r.v??0,this)),r?.referentialEqualities&&(a=SE(a,r.referentialEqualities,r.v??0)),a}stringify(e){return JSON.stringify(this.serialize(e))}parse(e){return this.deserialize(JSON.parse(e),{inPlace:!0})}registerClass(e,t){this.classRegistry.register(e,t)}registerSymbol(e,t){this.symbolRegistry.register(e,t)}registerCustom(e,t){this.customTransformerRegistry.register({name:t,...e})}allowErrorProps(...e){this.allowedErrorProps.push(...e)}};ME.defaultInstance=new ME,ME.serialize=ME.defaultInstance.serialize.bind(ME.defaultInstance),ME.deserialize=ME.defaultInstance.deserialize.bind(ME.defaultInstance),ME.stringify=ME.defaultInstance.stringify.bind(ME.defaultInstance),ME.parse=ME.defaultInstance.parse.bind(ME.defaultInstance),ME.registerClass=ME.defaultInstance.registerClass.bind(ME.defaultInstance),ME.registerSymbol=ME.defaultInstance.registerSymbol.bind(ME.defaultInstance),ME.registerCustom=ME.defaultInstance.registerCustom.bind(ME.defaultInstance),ME.allowErrorProps=ME.defaultInstance.allowErrorProps.bind(ME.defaultInstance),ME.serialize,ME.deserialize,ME.stringify,ME.parse,ME.registerClass,ME.registerCustom,ME.registerSymbol,ME.allowErrorProps;var NE=1e4,PE=6e3,FE=2e3,IE=3e4,LE=class{_serverUrl;useWs;baseRetryMs;maxRetryMs;onConnectionChange;token;_trpcClient;_wsClient=null;mirror=null;mirrorInit=null;connected=!1;connectedPromise=null;_systemProxy;_connectionVersion=0;connectionListeners=new Set;constructor(e){this._serverUrl=e.serverUrl.replace(/\/+$/,``),this.token=e.token;let t=typeof window<`u`;this.useWs=e.useWebSocket??t,this.onConnectionChange=e.onConnectionChange,this.baseRetryMs=e.retryDelayMs??FE,this.maxRetryMs=e.maxRetryDelayMs??IE,this._trpcClient=this.buildTrpcClient(),this._systemProxy=P_(this._trpcClient)}get serverUrl(){return this._serverUrl}get connectionVersion(){return this._connectionVersion}subscribeConnectionEvents(e){return this.connectionListeners.add(e),()=>{this.connectionListeners.delete(e)}}emitConnectionEvent(e){try{this.onConnectionChange?.(e)}catch{}for(let t of this.connectionListeners)try{t(e,this._connectionVersion)}catch{}}async awaitConnected(e){if(this.connected)return;if(this.connectedPromise)return this.connectedPromise;let t=e??15e3;this.connectedPromise=(async()=>{let e=this._trpcClient.auth.me.query();Number.isFinite(t)?await new Promise((n,r)=>{let a=setTimeout(()=>r(Error(`System.awaitConnected: probe timed out after ${t}ms`)),t);e.then(()=>{clearTimeout(a),n()},e=>{clearTimeout(a),r(e instanceof Error?e:Error(String(e)))})}):await e,this.connected=!0})();try{await this.connectedPromise}finally{this.connectedPromise=null}}async init(e){if(this.mirror?.isReady())return;if(this.mirrorInit)return this.mirrorInit;let t=new B_(this._trpcClient);return this.mirror=t,this.mirrorInit=(async()=>{await this.awaitConnected(e),await t.init(e)})().finally(()=>{this.mirrorInit=null}),this.mirrorInit}async awaitReady(){if(!this.mirror?.isReady())return this.mirrorInit?this.mirrorInit:this.init()}isReady(){return this.mirror?.isReady()??!1}isConnected(){return this.connected}reconnect(){this.useWs&&(this.emitConnectionEvent(`connecting`),this._wsClient?.close(),this.disposeMirror(),this.connected=!1,this.connectedPromise=null,this._trpcClient=this.buildTrpcClient(),this._systemProxy=P_(this._trpcClient))}switchServerUrl(e){let t=e.replace(/\/+$/,``);t!==this._serverUrl&&(this._serverUrl=t,this.reconnect())}async raceConnectionEndpoints(e){let t=e?.perCandidateTimeoutMs??1500,n=(()=>{try{return new URL(this._serverUrl)}catch{return null}})(),r=n?.port?Number(n.port):n?.protocol===`https:`?443:80,a=n?.protocol===`https:`?`https`:`http`,o=this._trpcClient.localNetwork?.getConnectionEndpoints;if(!o)return{winner:this._serverUrl,switched:!1};let s;try{s=(await o.query({port:r,ipv4Only:e?.ipv4Only,scheme:a})).endpoints}catch{return{winner:this._serverUrl,switched:!1}}if(s.length===0)return{winner:this._serverUrl,switched:!1};let c=await zE(s.map(e=>e.baseUrl),t);return!c||c===this._serverUrl?{winner:c??this._serverUrl,switched:!1}:(this.switchServerUrl(c),{winner:c,switched:!0})}close(){this.disposeMirror(),this.connected=!1,this.connectedPromise=null,this._wsClient?.close()}disposeMirror(){this.mirror?.dispose(),this.mirror=null,this.mirrorInit=null}async login(e,t){let n=await this._trpcClient.auth.login.mutate({username:e,password:t});if(typeof n==`object`&&n&&`token`in n){let e=n,t=e.token;typeof t==`string`&&e.requiresTotp!==!0&&this.setToken(t)}return n}async loginVerifyTotp(e,t){let n=await this._trpcClient.auth.loginVerifyTotp.mutate({challengeToken:e,code:t});if(typeof n==`object`&&n&&`token`in n){let e=n.token;typeof e==`string`&&this.setToken(e)}return n}async logout(){await this._trpcClient.auth.logout.mutate()}async getMe(){return await this._trpcClient.auth.me.query()}async changeOwnPassword(e){return await this._trpcClient.auth.changeOwnPassword.mutate(e)}async setupOwnTotp(){return await this._trpcClient.auth.setupOwnTotp.mutate()}async confirmOwnTotp(e){return await this._trpcClient.auth.confirmOwnTotp.mutate(e)}async disableOwnTotp(){return await this._trpcClient.auth.disableOwnTotp.mutate()}async getOwnTotpStatus(){return await this._trpcClient.auth.getOwnTotpStatus.query()}setToken(e){this.token=e}listDevices(e){return this.mirror?(e?this.mirror.query(e):this.mirror.getAllDevices()).map(e=>this.attachBinding(e)):[]}getDeviceInfo(e){return this.mirror?.getDeviceInfo(e)??null}listDeviceInfos(e){let t=this.mirror;if(!t)return[];let n=e?t.query(e):t.getAllDevices(),r=[];for(let e of n){let n=t.getDeviceInfo(e.deviceId);n&&r.push(n)}return r}getDevice(e){let t=this.mirror?.getDeviceById(e)??null;return t?this.attachBinding(t):null}getDeviceByName(e){let t=this.mirror?.getDeviceByName(e)??null;return t?this.attachBinding(t):null}getDeviceByStableId(e){let t=this.mirror?.getDeviceByStableId(e)??null;return t?this.attachBinding(t):null}async waitForDevice(e,t){this.mirror||await this.init();let n=await this.mirror.waitForDevice(e,t??3e4);return this.attachBinding(n)}onDeviceAdded(e){if(!this.mirror)throw Error(`System.onDeviceAdded: call init() before subscribing`);return this.mirror.onDeviceAdded(e)}onDeviceRemoved(e){if(!this.mirror)throw Error(`System.onDeviceRemoved: call init() before subscribing`);return this.mirror.onDeviceRemoved(e)}attachBinding(e){let t=this.lookupBinding(e.deviceId);if(t===e.binding)return e;let n=e;return n.binding=t,e}lookupBinding(e){return this.mirror?this.mirror.getDeviceById(e)?.binding??null:null}get addonPages(){return this._systemProxy.addonPages}get addonSettings(){return this._systemProxy.addonSettings}get alerts(){return this._systemProxy.alerts}get audioAnalyzer(){return this._systemProxy.audioAnalyzer}get audioCodec(){return this._systemProxy.audioCodec}get backup(){return this._systemProxy.backup}get decoder(){return this._systemProxy.decoder}get deviceManager(){return this._systemProxy.deviceManager}get deviceProvider(){return this._systemProxy.deviceProvider}get deviceState(){return this._systemProxy.deviceState}get metricsProvider(){return this._systemProxy.metricsProvider}get notificationOutput(){return this._systemProxy.notificationOutput}get pipelineExecutor(){return this._systemProxy.pipelineExecutor}get pipelineOrchestrator(){return this._systemProxy.pipelineOrchestrator}get pipelineRunner(){return this._systemProxy.pipelineRunner}get settingsStore(){return this._systemProxy.settingsStore}get storage(){return this._systemProxy.storage}get streamBroker(){return this._systemProxy.streamBroker}get turnProvider(){return this._systemProxy.turnProvider}get userManagement(){return this._systemProxy.userManagement}subscribeEvent(e,t){let n=this._trpcClient.live.onEvent.subscribe({category:e},{onData:e=>{try{t(e)}catch{}}});return()=>{try{n.unsubscribe()}catch{}}}get trpcClient(){return this._trpcClient}get wsClient(){return this._wsClient}buildTrpcClient(){let e=()=>{let e={};return this.token&&(e.Authorization=`Bearer ${this.token}`),e};if(this.useWs){let e=this._serverUrl.replace(/^http/,`ws`)+`/trpc`,t=this.baseRetryMs,n=this.maxRetryMs;return this._wsClient=Er({url:e,connectionParams:()=>({token:this.token}),retryDelayMs:e=>Math.min(t*2**e,n),keepAlive:{enabled:!0,intervalMs:NE,pongTimeoutMs:PE},onOpen:()=>{this._connectionVersion+=1,this.emitConnectionEvent(`connected`)},onClose:()=>{this.emitConnectionEvent(`disconnected`)}}),Fr({links:[Dr({client:this._wsClient,transformer:ME})]})}return this._wsClient=null,Fr({links:[ir({url:`${this._serverUrl}/trpc`,headers:e,transformer:ME})]})}};function RE(e){return new LE(e)}async function zE(e,t){if(e.length===0)return null;if(typeof fetch!=`function`)return e[0]??null;let n=typeof window<`u`&&window.location!==void 0&&window.location.protocol===`https:`?e.filter(e=>e.toLowerCase().startsWith(`https://`)):e;if(n.length===0)return null;let r=n.map(()=>new AbortController),a=n.map(async(e,n)=>{let a=r[n],o=setTimeout(()=>a.abort(),t);try{let t=await fetch(`${e.replace(/\/+$/,``)}/trpc/health`,{method:`GET`,signal:a.signal,credentials:`omit`});if(!t.ok)throw Error(`${t.status}`);return e}finally{clearTimeout(o)}});try{let e=await Promise.any(a);for(let e of r)try{e.abort()}catch{}return e}catch{return null}}var BE=function(e){return e.Motion=`motion`,e.Person=`person`,e.Vehicle=`vehicle`,e.Animal=`animal`,e.Audio=`audio`,e.Face=`face`,e.Plate=`plate`,e.Package=`package`,e.Doorbell=`doorbell`,e.Sensor=`sensor`,e}({}),VE=`animal.dog_cat.dog.cat.horse.sheep.cow.elephant.bear.zebra.giraffe.mouse.rabbit.deer.lion.tiger.bird.eagle.owl.pigeon.fish.whale.dolphin.snake.turtle.lizard`.split(`.`),HE=[`person`,`people`,`pedestrian`,`rider`,`driver`,`cyclist`,`skier`,`skateboarder`,`face`,`hand`,`head`,`body`],UE=[`vehicle`,`car`,`truck`,`bus`,`motorcycle`,`bicycle`,`van`,`ambulance`,`police_car`,`fire_truck`,`train`,`subway`,`tram`,`airplane`,`boat`,`ship`,`helicopter`],WE=`face.eyes.nose.mouth.ears.eyebrows.left_eye.right_eye.pupil.iris.eyelid.eye_corner.upper_lip.lower_lip.teeth.chin.cheek.forehead.jaw.glasses.sunglasses.facial_hair.beard.mustache.facial_landmark.facial_keypoint`.split(`.`),GE=[`plate`,`license_plate`,`front_plate`,`rear_plate`,`motorcycle_plate`,`temporary_plate`,`dealer_plate`,`licensePlate`,`plate_number`,`plate_character`,`plate_digit`,`plate_letter`,`plate_symbol`,`plate_region`,`plate_country_identifier`,`plate_frame`,`plate_bolt`,`plate_sticker`,`plate_validation_tag`,`damaged_plate`,`obscured_plate`,`dirty_plate`],KE=[`motion`,`movement`,`other`],qE=[`package`,`packet`],JE=[`audio`],YE=`speech.scream.babbling.yell.bellow.whoop.whispering.laughter.snicker.crying.cry.sigh.singing.choir.chant.mantra.child_singing.rapping.humming.groan.grunt.whistling.breathing.wheeze.snoring.gasp.pant.snort.cough.throat_clearing.sneeze.sniff.cheering.applause.chatter.crowd.children_playing.bark.yip.howl.bow-wow.growling.whimper_dog.purr.meow.hiss.caterwaul.pets.livestock.doorbell.ding-dong.door.slam.knock.alarm.telephone.music.dog.dogs`.split(`.`),XE=[`doorbell`,`ring`],ZE=[`lock`,`binary`,`flood`,`entry`,`door`,`leak`,`door_open`,`flooded`,`entry_open`];({...VE.reduce((e,t)=>({...e,[t]:`animal`}),{}),...HE.reduce((e,t)=>({...e,[t]:`person`}),{}),...UE.reduce((e,t)=>({...e,[t]:`vehicle`}),{}),...KE.reduce((e,t)=>({...e,[t]:`motion`}),{}),...qE.reduce((e,t)=>({...e,[t]:`package`}),{}),...WE.reduce((e,t)=>({...e,[t]:`face`}),{}),...GE.reduce((e,t)=>({...e,[t]:`plate`}),{}),...JE.reduce((e,t)=>({...e,[t]:`audio`}),{}),...YE.reduce((e,t)=>({...e,[t]:`audio`}),{}),...XE.reduce((e,t)=>({...e,[t]:`doorbell`}),{}),...ZE.reduce((e,t)=>({...e,[t]:`sensor`}),{})}),[...Object.values(BE).filter(e=>e!==`motion`)],new Set([`Entry`,`Light`,`Switch`,`Lock`,`SecuritySystem`,`Buttons`,`WindowCovering`,`Siren`,`Sensor`,`Select`,`Program`]),new Set([`light`,`switch`,`input_boolean`,`cover`,`lock`,`alarm_control_panel`,`input_button`,`button`,`input_select`,`select`,`siren`,`media_player`,`script`]);var QE=`modulepreload`,$E=function(e,t){return new URL(e,t).href},eD={},tD=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),a=document.querySelector(`meta[property=csp-nonce]`),o=a?.nonce||a?.getAttribute(`nonce`);function s(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=s(t.map(t=>{if(t=$E(t,n),t in eD)return;eD[t]=!0;let r=t.endsWith(`.css`),a=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let a=e[n];if(a.href===t&&(!r||a.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${a}`))return;let s=document.createElement(`link`);if(s.rel=r?`stylesheet`:QE,r||(s.as=`script`),s.crossOrigin=``,s.href=t,o&&s.setAttribute(`nonce`,o),document.head.appendChild(s),r)return new Promise((e,n)=>{s.addEventListener(`load`,e),s.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function a(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&a(e.reason);return e().catch(a)})};function nD(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=nD(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function rD(){for(var e,t,n=0,r=``,a=arguments.length;n<a;n++)(e=arguments[n])&&(t=nD(e))&&(r&&(r+=` `),r+=t);return r}var iD=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},aD=(e,t)=>({classGroupId:e,validator:t}),oD=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),sD=`-`,cD=[],lD=`arbitrary..`,uD=e=>{let t=pD(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return fD(e);let n=e.split(sD);return dD(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],a=n[e];return t?a?iD(a,t):t:a||cD}return n[e]||cD}}},dD=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],a=n.nextPart.get(r);if(a){let n=dD(e,t+1,a);if(n)return n}let o=n.validators;if(o===null)return;let s=t===0?e.join(sD):e.slice(t).join(sD),c=o.length;for(let e=0;e<c;e++){let t=o[e];if(t.validator(s))return t.classGroupId}},fD=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?lD+r:void 0})(),pD=e=>{let{theme:t,classGroups:n}=e;return mD(n,t)},mD=(e,t)=>{let n=oD();for(let r in e){let a=e[r];hD(a,n,r,t)}return n},hD=(e,t,n,r)=>{let a=e.length;for(let o=0;o<a;o++){let a=e[o];gD(a,t,n,r)}},gD=(e,t,n,r)=>{if(typeof e==`string`){_D(e,t,n);return}if(typeof e==`function`){vD(e,t,n,r);return}yD(e,t,n,r)},_D=(e,t,n)=>{let r=e===``?t:bD(t,e);r.classGroupId=n},vD=(e,t,n,r)=>{if(xD(e)){hD(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(aD(n,e))},yD=(e,t,n,r)=>{let a=Object.entries(e),o=a.length;for(let e=0;e<o;e++){let[o,s]=a[e];hD(s,bD(t,o),n,r)}},bD=(e,t)=>{let n=e,r=t.split(sD),a=r.length;for(let e=0;e<a;e++){let t=r[e],a=n.nextPart.get(t);a||(a=oD(),n.nextPart.set(t,a)),n=a}return n},xD=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,SD=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),a=(a,o)=>{n[a]=o,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return a(e,t),t},set(e,t){e in n?n[e]=t:a(e,t)}}},CD=`!`,wD=`:`,TD=[],ED=(e,t,n,r,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:a}),DD=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,a=0,o,s=e.length;for(let c=0;c<s;c++){let s=e[c];if(n===0&&r===0){if(s===wD){t.push(e.slice(a,c)),a=c+1;continue}if(s===`/`){o=c;continue}}s===`[`?n++:s===`]`?n--:s===`(`?r++:s===`)`&&r--}let c=t.length===0?e:e.slice(a),l=c,u=!1;c.endsWith(CD)?(l=c.slice(0,-1),u=!0):c.startsWith(CD)&&(l=c.slice(1),u=!0);let d=o&&o>a?o-a:void 0;return ED(t,u,l,d)};if(t){let e=t+wD,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):ED(TD,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},OD=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let a=0;a<e.length;a++){let o=e[a],s=o[0]===`[`,c=t.has(o);s||c?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(o)):r.push(o)}return r.length>0&&(r.sort(),n.push(...r)),n}},kD=e=>({cache:SD(e.cacheSize),parseClassName:DD(e),sortModifiers:OD(e),postfixLookupClassGroupIds:AD(e),...uD(e)}),AD=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},jD=/\s+/,MD=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:o,postfixLookupClassGroupIds:s}=t,c=[],l=e.trim().split(jD),u=``;for(let e=l.length-1;e>=0;--e){let t=l[e],{isExternal:d,modifiers:f,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:h}=n(t);if(d){u=t+(u.length>0?` `+u:u);continue}let g=!!h,_;if(g){_=r(m.substring(0,h));let e=_&&s[_]?r(m):void 0;e&&e!==_&&(_=e,g=!1)}else _=r(m);if(!_){if(!g){u=t+(u.length>0?` `+u:u);continue}if(_=r(m),!_){u=t+(u.length>0?` `+u:u);continue}g=!1}let v=f.length===0?``:f.length===1?f[0]:o(f).join(`:`),y=p?v+CD:v,b=y+_;if(c.indexOf(b)>-1)continue;c.push(b);let ee=a(_,g);for(let e=0;e<ee.length;++e){let t=ee[e];c.push(y+t)}u=t+(u.length>0?` `+u:u)}return u},ND=(...e)=>{let t=0,n,r,a=``;for(;t<e.length;)(n=e[t++])&&(r=PD(n))&&(a&&(a+=` `),a+=r);return a},PD=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=PD(e[r]))&&(n&&(n+=` `),n+=t);return n},FD=(e,...t)=>{let n,r,a,o,s=s=>(n=kD(t.reduce((e,t)=>t(e),e())),r=n.cache.get,a=n.cache.set,o=c,c(s)),c=e=>{let t=r(e);if(t)return t;let o=MD(e,n);return a(e,o),o};return o=s,(...e)=>o(ND(...e))},ID=[],LD=e=>{let t=t=>t[e]||ID;return t.isThemeGetter=!0,t},RD=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,zD=/^\((?:(\w[\w-]*):)?(.+)\)$/i,BD=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,VD=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,HD=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,UD=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,WD=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,GD=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,KD=e=>BD.test(e),qD=e=>!!e&&!Number.isNaN(Number(e)),JD=e=>!!e&&Number.isInteger(Number(e)),YD=e=>e.endsWith(`%`)&&qD(e.slice(0,-1)),XD=e=>VD.test(e),ZD=()=>!0,QD=e=>HD.test(e)&&!UD.test(e),$D=()=>!1,eO=e=>WD.test(e),tO=e=>GD.test(e),nO=e=>!X(e)&&!Z(e),rO=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),iO=e=>yO(e,CO,$D),X=e=>RD.test(e),aO=e=>yO(e,wO,QD),oO=e=>yO(e,TO,qD),sO=e=>yO(e,DO,ZD),cO=e=>yO(e,EO,$D),lO=e=>yO(e,xO,$D),uO=e=>yO(e,SO,tO),dO=e=>yO(e,OO,eO),Z=e=>zD.test(e),fO=e=>bO(e,wO),pO=e=>bO(e,EO),mO=e=>bO(e,xO),hO=e=>bO(e,CO),gO=e=>bO(e,SO),_O=e=>bO(e,OO,!0),vO=e=>bO(e,DO,!0),yO=(e,t,n)=>{let r=RD.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},bO=(e,t,n=!1)=>{let r=zD.exec(e);return r?r[1]?t(r[1]):n:!1},xO=e=>e===`position`||e===`percentage`,SO=e=>e===`image`||e===`url`,CO=e=>e===`length`||e===`size`||e===`bg-size`,wO=e=>e===`length`,TO=e=>e===`number`,EO=e=>e===`family-name`,DO=e=>e===`number`||e===`weight`,OO=e=>e===`shadow`,kO=FD(()=>{let e=LD(`color`),t=LD(`font`),n=LD(`text`),r=LD(`font-weight`),a=LD(`tracking`),o=LD(`leading`),s=LD(`breakpoint`),c=LD(`container`),l=LD(`spacing`),u=LD(`radius`),d=LD(`shadow`),f=LD(`inset-shadow`),p=LD(`text-shadow`),m=LD(`drop-shadow`),h=LD(`blur`),g=LD(`perspective`),_=LD(`aspect`),v=LD(`ease`),y=LD(`animate`),b=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],ee=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...ee(),Z,X],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[Z,X,l],te=()=>[KD,`full`,`auto`,...w()],T=()=>[JD,`none`,`subgrid`,Z,X],E=()=>[`auto`,{span:[`full`,JD,Z,X]},JD,Z,X],ne=()=>[JD,`auto`,Z,X],re=()=>[`auto`,`min`,`max`,`fr`,Z,X],ie=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],ae=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],oe=()=>[`auto`,...w()],se=()=>[KD,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],D=()=>[KD,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],ce=()=>[KD,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],O=()=>[e,Z,X],k=()=>[...ee(),mO,lO,{position:[Z,X]}],le=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ue=()=>[`auto`,`cover`,`contain`,hO,iO,{size:[Z,X]}],de=()=>[YD,fO,aO],A=()=>[``,`none`,`full`,u,Z,X],fe=()=>[``,qD,fO,aO],pe=()=>[`solid`,`dashed`,`dotted`,`double`],me=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],he=()=>[qD,YD,mO,lO],ge=()=>[``,`none`,h,Z,X],_e=()=>[`none`,qD,Z,X],ve=()=>[`none`,qD,Z,X],ye=()=>[qD,Z,X],be=()=>[KD,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[XD],breakpoint:[XD],color:[ZD],container:[XD],"drop-shadow":[XD],ease:[`in`,`out`,`in-out`],font:[nO],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[XD],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[XD],shadow:[XD],spacing:[`px`,qD],text:[XD],"text-shadow":[XD],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,KD,X,Z,_]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,Z,X]}],"container-named":[rO],columns:[{columns:[qD,X,Z,c]}],"break-after":[{"break-after":b()}],"break-before":[{"break-before":b()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:te()}],"inset-x":[{"inset-x":te()}],"inset-y":[{"inset-y":te()}],start:[{"inset-s":te(),start:te()}],end:[{"inset-e":te(),end:te()}],"inset-bs":[{"inset-bs":te()}],"inset-be":[{"inset-be":te()}],top:[{top:te()}],right:[{right:te()}],bottom:[{bottom:te()}],left:[{left:te()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[JD,`auto`,Z,X]}],basis:[{basis:[KD,`full`,`auto`,c,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[qD,KD,`auto`,`initial`,`none`,X]}],grow:[{grow:[``,qD,Z,X]}],shrink:[{shrink:[``,qD,Z,X]}],order:[{order:[JD,`first`,`last`,`none`,Z,X]}],"grid-cols":[{"grid-cols":T()}],"col-start-end":[{col:E()}],"col-start":[{"col-start":ne()}],"col-end":[{"col-end":ne()}],"grid-rows":[{"grid-rows":T()}],"row-start-end":[{row:E()}],"row-start":[{"row-start":ne()}],"row-end":[{"row-end":ne()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":re()}],"auto-rows":[{"auto-rows":re()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...ie(),`normal`]}],"justify-items":[{"justify-items":[...ae(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...ae()]}],"align-content":[{content:[`normal`,...ie()]}],"align-items":[{items:[...ae(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...ae(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":ie()}],"place-items":[{"place-items":[...ae(),`baseline`]}],"place-self":[{"place-self":[`auto`,...ae()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:oe()}],mx:[{mx:oe()}],my:[{my:oe()}],ms:[{ms:oe()}],me:[{me:oe()}],mbs:[{mbs:oe()}],mbe:[{mbe:oe()}],mt:[{mt:oe()}],mr:[{mr:oe()}],mb:[{mb:oe()}],ml:[{ml:oe()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:se()}],"inline-size":[{inline:[`auto`,...D()]}],"min-inline-size":[{"min-inline":[`auto`,...D()]}],"max-inline-size":[{"max-inline":[`none`,...D()]}],"block-size":[{block:[`auto`,...ce()]}],"min-block-size":[{"min-block":[`auto`,...ce()]}],"max-block-size":[{"max-block":[`none`,...ce()]}],w:[{w:[c,`screen`,...se()]}],"min-w":[{"min-w":[c,`screen`,`none`,...se()]}],"max-w":[{"max-w":[c,`screen`,`none`,`prose`,{screen:[s]},...se()]}],h:[{h:[`screen`,`lh`,...se()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...se()]}],"max-h":[{"max-h":[`screen`,`lh`,...se()]}],"font-size":[{text:[`base`,n,fO,aO]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,vO,sO]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,YD,X]}],"font-family":[{font:[pO,cO,t]}],"font-features":[{"font-features":[X]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[a,Z,X]}],"line-clamp":[{"line-clamp":[qD,`none`,Z,oO]}],leading:[{leading:[o,...w()]}],"list-image":[{"list-image":[`none`,Z,X]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,Z,X]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:O()}],"text-color":[{text:O()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...pe(),`wavy`]}],"text-decoration-thickness":[{decoration:[qD,`from-font`,`auto`,Z,aO]}],"text-decoration-color":[{decoration:O()}],"underline-offset":[{"underline-offset":[qD,`auto`,Z,X]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[JD,Z,X]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,Z,X]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,Z,X]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:k()}],"bg-repeat":[{bg:le()}],"bg-size":[{bg:ue()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},JD,Z,X],radial:[``,Z,X],conic:[JD,Z,X]},gO,uO]}],"bg-color":[{bg:O()}],"gradient-from-pos":[{from:de()}],"gradient-via-pos":[{via:de()}],"gradient-to-pos":[{to:de()}],"gradient-from":[{from:O()}],"gradient-via":[{via:O()}],"gradient-to":[{to:O()}],rounded:[{rounded:A()}],"rounded-s":[{"rounded-s":A()}],"rounded-e":[{"rounded-e":A()}],"rounded-t":[{"rounded-t":A()}],"rounded-r":[{"rounded-r":A()}],"rounded-b":[{"rounded-b":A()}],"rounded-l":[{"rounded-l":A()}],"rounded-ss":[{"rounded-ss":A()}],"rounded-se":[{"rounded-se":A()}],"rounded-ee":[{"rounded-ee":A()}],"rounded-es":[{"rounded-es":A()}],"rounded-tl":[{"rounded-tl":A()}],"rounded-tr":[{"rounded-tr":A()}],"rounded-br":[{"rounded-br":A()}],"rounded-bl":[{"rounded-bl":A()}],"border-w":[{border:fe()}],"border-w-x":[{"border-x":fe()}],"border-w-y":[{"border-y":fe()}],"border-w-s":[{"border-s":fe()}],"border-w-e":[{"border-e":fe()}],"border-w-bs":[{"border-bs":fe()}],"border-w-be":[{"border-be":fe()}],"border-w-t":[{"border-t":fe()}],"border-w-r":[{"border-r":fe()}],"border-w-b":[{"border-b":fe()}],"border-w-l":[{"border-l":fe()}],"divide-x":[{"divide-x":fe()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":fe()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...pe(),`hidden`,`none`]}],"divide-style":[{divide:[...pe(),`hidden`,`none`]}],"border-color":[{border:O()}],"border-color-x":[{"border-x":O()}],"border-color-y":[{"border-y":O()}],"border-color-s":[{"border-s":O()}],"border-color-e":[{"border-e":O()}],"border-color-bs":[{"border-bs":O()}],"border-color-be":[{"border-be":O()}],"border-color-t":[{"border-t":O()}],"border-color-r":[{"border-r":O()}],"border-color-b":[{"border-b":O()}],"border-color-l":[{"border-l":O()}],"divide-color":[{divide:O()}],"outline-style":[{outline:[...pe(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[qD,Z,X]}],"outline-w":[{outline:[``,qD,fO,aO]}],"outline-color":[{outline:O()}],shadow:[{shadow:[``,`none`,d,_O,dO]}],"shadow-color":[{shadow:O()}],"inset-shadow":[{"inset-shadow":[`none`,f,_O,dO]}],"inset-shadow-color":[{"inset-shadow":O()}],"ring-w":[{ring:fe()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:O()}],"ring-offset-w":[{"ring-offset":[qD,aO]}],"ring-offset-color":[{"ring-offset":O()}],"inset-ring-w":[{"inset-ring":fe()}],"inset-ring-color":[{"inset-ring":O()}],"text-shadow":[{"text-shadow":[`none`,p,_O,dO]}],"text-shadow-color":[{"text-shadow":O()}],opacity:[{opacity:[qD,Z,X]}],"mix-blend":[{"mix-blend":[...me(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":me()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[qD]}],"mask-image-linear-from-pos":[{"mask-linear-from":he()}],"mask-image-linear-to-pos":[{"mask-linear-to":he()}],"mask-image-linear-from-color":[{"mask-linear-from":O()}],"mask-image-linear-to-color":[{"mask-linear-to":O()}],"mask-image-t-from-pos":[{"mask-t-from":he()}],"mask-image-t-to-pos":[{"mask-t-to":he()}],"mask-image-t-from-color":[{"mask-t-from":O()}],"mask-image-t-to-color":[{"mask-t-to":O()}],"mask-image-r-from-pos":[{"mask-r-from":he()}],"mask-image-r-to-pos":[{"mask-r-to":he()}],"mask-image-r-from-color":[{"mask-r-from":O()}],"mask-image-r-to-color":[{"mask-r-to":O()}],"mask-image-b-from-pos":[{"mask-b-from":he()}],"mask-image-b-to-pos":[{"mask-b-to":he()}],"mask-image-b-from-color":[{"mask-b-from":O()}],"mask-image-b-to-color":[{"mask-b-to":O()}],"mask-image-l-from-pos":[{"mask-l-from":he()}],"mask-image-l-to-pos":[{"mask-l-to":he()}],"mask-image-l-from-color":[{"mask-l-from":O()}],"mask-image-l-to-color":[{"mask-l-to":O()}],"mask-image-x-from-pos":[{"mask-x-from":he()}],"mask-image-x-to-pos":[{"mask-x-to":he()}],"mask-image-x-from-color":[{"mask-x-from":O()}],"mask-image-x-to-color":[{"mask-x-to":O()}],"mask-image-y-from-pos":[{"mask-y-from":he()}],"mask-image-y-to-pos":[{"mask-y-to":he()}],"mask-image-y-from-color":[{"mask-y-from":O()}],"mask-image-y-to-color":[{"mask-y-to":O()}],"mask-image-radial":[{"mask-radial":[Z,X]}],"mask-image-radial-from-pos":[{"mask-radial-from":he()}],"mask-image-radial-to-pos":[{"mask-radial-to":he()}],"mask-image-radial-from-color":[{"mask-radial-from":O()}],"mask-image-radial-to-color":[{"mask-radial-to":O()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":ee()}],"mask-image-conic-pos":[{"mask-conic":[qD]}],"mask-image-conic-from-pos":[{"mask-conic-from":he()}],"mask-image-conic-to-pos":[{"mask-conic-to":he()}],"mask-image-conic-from-color":[{"mask-conic-from":O()}],"mask-image-conic-to-color":[{"mask-conic-to":O()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:k()}],"mask-repeat":[{mask:le()}],"mask-size":[{mask:ue()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,Z,X]}],filter:[{filter:[``,`none`,Z,X]}],blur:[{blur:ge()}],brightness:[{brightness:[qD,Z,X]}],contrast:[{contrast:[qD,Z,X]}],"drop-shadow":[{"drop-shadow":[``,`none`,m,_O,dO]}],"drop-shadow-color":[{"drop-shadow":O()}],grayscale:[{grayscale:[``,qD,Z,X]}],"hue-rotate":[{"hue-rotate":[qD,Z,X]}],invert:[{invert:[``,qD,Z,X]}],saturate:[{saturate:[qD,Z,X]}],sepia:[{sepia:[``,qD,Z,X]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Z,X]}],"backdrop-blur":[{"backdrop-blur":ge()}],"backdrop-brightness":[{"backdrop-brightness":[qD,Z,X]}],"backdrop-contrast":[{"backdrop-contrast":[qD,Z,X]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,qD,Z,X]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[qD,Z,X]}],"backdrop-invert":[{"backdrop-invert":[``,qD,Z,X]}],"backdrop-opacity":[{"backdrop-opacity":[qD,Z,X]}],"backdrop-saturate":[{"backdrop-saturate":[qD,Z,X]}],"backdrop-sepia":[{"backdrop-sepia":[``,qD,Z,X]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,Z,X]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[qD,`initial`,Z,X]}],ease:[{ease:[`linear`,`initial`,v,Z,X]}],delay:[{delay:[qD,Z,X]}],animate:[{animate:[`none`,y,Z,X]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[g,Z,X]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:_e()}],"rotate-x":[{"rotate-x":_e()}],"rotate-y":[{"rotate-y":_e()}],"rotate-z":[{"rotate-z":_e()}],scale:[{scale:ve()}],"scale-x":[{"scale-x":ve()}],"scale-y":[{"scale-y":ve()}],"scale-z":[{"scale-z":ve()}],"scale-3d":[`scale-3d`],skew:[{skew:ye()}],"skew-x":[{"skew-x":ye()}],"skew-y":[{"skew-y":ye()}],transform:[{transform:[Z,X,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:be()}],"translate-x":[{"translate-x":be()}],"translate-y":[{"translate-y":be()}],"translate-z":[{"translate-z":be()}],"translate-none":[`translate-none`],zoom:[{zoom:[JD,Z,X]}],accent:[{accent:O()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:O()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,Z,X]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":O()}],"scrollbar-track-color":[{"scrollbar-track":O()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,Z,X]}],fill:[{fill:[`none`,...O()]}],"stroke-w":[{stroke:[qD,fO,aO,oO]}],stroke:[{stroke:[`none`,...O()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function AO(...e){return kO(rD(e))}var jO=1e3;24*(60*jO*60),30*jO;function MO(e){if(typeof e!=`object`||!e)return null;let t=Reflect.get(e,`data`);if(typeof t==`object`&&t){let e=Reflect.get(t,`capRouteReason`);if(typeof e==`string`)return e}return null}function NO(e){let t=MO(e);return t===null?(e instanceof Error?e.message:String(e)).includes(`provider not available`):t===`no-provider`||t===`node-offline`}var PO=`text-[10px] text-foreground-subtle`;function FO(e,t){if(typeof globalThis>`u`)return(0,x.createContext)(t);let n=globalThis.__camstackSharedContexts,r=n??new Map;n||(globalThis.__camstackSharedContexts=r);let a=r.get(e);if(a)return a;let o=(0,x.createContext)(t);return r.set(e,o),o}var IO=`FEDERATION_DEBUG`,LO={AT:`@`,HYPHEN:`-`,SLASH:`/`},RO={[LO.AT]:`scope_`,[LO.HYPHEN]:`_`,[LO.SLASH]:`__`};RO[LO.AT],LO.AT,RO[LO.HYPHEN],LO.HYPHEN,RO[LO.SLASH],LO.SLASH;var zO=function(e){return e[e.UNKNOWN=1]=`UNKNOWN`,e[e.CALCULATED=2]=`CALCULATED`,e[e.NO_USE=0]=`NO_USE`,e}({}),BO=typeof ENV_TARGET<`u`?ENV_TARGET===`web`:typeof window<`u`&&window.document!==void 0;function VO(){return BO}function HO(){return typeof navigator<`u`&&navigator?.product===`ReactNative`}function UO(){try{if(VO()&&window.localStorage)return!!localStorage.getItem(IO)}catch{return!1}return!1}function WO(){return typeof process<`u`&&{}.FEDERATION_DEBUG?!!{}.FEDERATION_DEBUG:typeof FEDERATION_DEBUG<`u`&&FEDERATION_DEBUG?!0:UO()}var GO=`[ Federation Runtime ]`,KO=function(...e){return e.length?e.reduce((e,t)=>t?e?`${e}:${t}`:t:e,``):``},qO=(e,t)=>{if(`getPublicPath`in e){let n;return n=e.getPublicPath.startsWith(`function`)?Function(`return `+e.getPublicPath)()():Function(e.getPublicPath)(),`${n}${t}`}else if(`publicPath`in e)return!VO()&&!HO()&&`ssrPublicPath`in e&&typeof e.ssrPublicPath==`string`?`${e.ssrPublicPath}${t}`:`${e.publicPath}${t}`;else return console.warn(`Cannot get resource URL. If in debug mode, please ignore.`,e,t),``},JO=e=>{console.warn(`${GO}: ${e}`)};function YO(e){try{return JSON.stringify(e,null,2)}catch{return``}}var XO=(e,t)=>{if(!e)return t;let n=(e=>{if(e===`.`)return``;if(e.startsWith(`./`))return e.replace(`./`,``);if(e.startsWith(`/`)){let t=e.slice(1);return t.endsWith(`/`)?t.slice(0,-1):t}return e})(e);return n?n.endsWith(`/`)?`${n}${t}`:`${n}/${t}`:t};function ZO(e){return e.replace(/#.*$/,``).replace(/\?.*$/,``).replace(/\/[^\/]+$/,`/`)}function QO(e,t={}){let{remotes:n={},overrides:r={},version:a}=t,o,s=()=>`publicPath`in e.metaData?(e.metaData.publicPath===`auto`||e.metaData.publicPath===``)&&a?ZO(a):e.metaData.publicPath:e.metaData.getPublicPath,c=Object.keys(r),l={};Object.keys(n).length||(l=e.remotes?.reduce((e,t)=>{let n,a=t.federationContainerName;return n=c.includes(a)?r[a]:`version`in t?t.version:t.entry,e[a]={matchedVersion:n},e},{})||{}),Object.keys(n).forEach(e=>l[e]={matchedVersion:c.includes(e)?r[e]:n[e]});let{remoteEntry:{path:u,name:d,type:f},types:p={path:``,name:``,zip:``,api:``},buildInfo:{buildVersion:m},globalName:h,ssrRemoteEntry:g}=e.metaData,{exposes:_}=e,v={version:a||``,buildVersion:m,globalName:h,remoteEntry:XO(u,d),remoteEntryType:f,remoteTypes:XO(p.path,p.name),remoteTypesZip:p.zip||``,remoteTypesAPI:p.api||``,remotesInfo:l,shared:e?.shared.map(e=>({assets:e.assets,sharedName:e.name,version:e.version,usedExports:e.referenceExports||[]})),modules:_?.map(e=>({moduleName:e.name,modulePath:e.path,assets:e.assets}))};if(`publicPath`in e.metaData?(o={...v,publicPath:s()},typeof e.metaData.ssrPublicPath==`string`&&(o.ssrPublicPath=e.metaData.ssrPublicPath)):o={...v,getPublicPath:s()},g){let e=XO(g.path,g.name);o.ssrRemoteEntry=e,o.ssrRemoteEntryType=g.type||`commonjs-module`}return o}function $O(e){return!!(`remoteEntry`in e&&e.remoteEntry.includes(`.json`))}var ek=`[ Module Federation ]`,tk=console,nk=[`logger.ts`,`logger.js`,`captureStackTrace`,`Logger.emit`,`Logger.log`,`Logger.info`,`Logger.warn`,`Logger.error`,`Logger.debug`];function rk(){try{let e=Error().stack;if(!e)return;let[,...t]=e.split(`
|
|
74
74
|
`),n=t.filter(e=>!nk.some(t=>e.includes(t)));return n.length?`Stack trace:\n${n.slice(0,5).join(`
|
|
75
75
|
`)}`:void 0}catch{return}}var ik=class{constructor(e,t=tk){this.prefix=e,this.delegate=t??tk}setPrefix(e){this.prefix=e}setDelegate(e){this.delegate=e??tk}emit(e,t){let n=this.delegate,r=WO()?rk():void 0,a=r?[...t,r]:t,o=(()=>{switch(e){case`log`:return[`log`,`info`];case`info`:return[`info`,`log`];case`warn`:return[`warn`,`info`,`log`];case`error`:return[`error`,`warn`,`log`];default:return[`debug`,`log`]}})();for(let e of o){let t=n[e];if(typeof t==`function`){t.call(n,this.prefix,...a);return}}for(let e of o){let t=tk[e];if(typeof t==`function`){t.call(tk,this.prefix,...a);return}}}log(...e){this.emit(`log`,e)}warn(...e){this.emit(`warn`,e)}error(...e){this.emit(`error`,e)}success(...e){this.emit(`info`,e)}info(...e){this.emit(`info`,e)}ready(...e){this.emit(`info`,e)}debug(...e){WO()&&this.emit(`debug`,e)}};function ak(e){return new ik(e)}function ok(e){let t=new ik(e);return Object.defineProperty(t,"__mf_infrastructure_logger__",{value:!0,enumerable:!1,configurable:!1}),t}ak(ek),ok(ek);async function sk(e,t){try{return await e()}catch(e){!t&&JO(e);return}}function ck(e,t){let n=/^(https?:)?\/\//i;return e.replace(n,``).replace(/\/$/,``)===t.replace(n,``).replace(/\/$/,``)}function lk(e){let t=null,n=!0,r=2e4,a,o=document.getElementsByTagName(`script`);for(let r=0;r<o.length;r++){let a=o[r],s=a.getAttribute(`src`);if(s&&ck(s,e.url)){t=a,n=!1;break}}if(!t){let n=e.attrs;t=document.createElement(`script`),t.type=n?.type===`module`?`module`:`text/javascript`;let a;e.createScriptHook&&(a=e.createScriptHook(e.url,e.attrs),a instanceof HTMLScriptElement?t=a:typeof a==`object`&&(`script`in a&&a.script&&(t=a.script),`timeout`in a&&a.timeout&&(r=a.timeout))),t.src||=e.url,n&&!a&&Object.keys(n).forEach(e=>{t&&(e===`async`||e===`defer`?t[e]=n[e]:t.getAttribute(e)||t.setAttribute(e,n[e]))})}let s=null,c=typeof window<`u`?t=>{if(t.filename&&ck(t.filename,e.url)){let n=Error(`ScriptExecutionError: Script "${e.url}" loaded but threw a runtime error during execution: ${t.message} (${t.filename}:${t.lineno}:${t.colno})`);n.name=`ScriptExecutionError`,s=n}}:null;c&&window.addEventListener(`error`,c);let l=async(n,r)=>{clearTimeout(a),c&&window.removeEventListener(`error`,c);let o=()=>{if(r?.type===`error`){let t=Error(r?.isTimeout?`ScriptNetworkError: Script "${e.url}" timed out.`:`ScriptNetworkError: Failed to load script "${e.url}" - the script URL is unreachable or the server returned an error (network failure, 404, CORS, etc.)`);t.name=`ScriptNetworkError`,e?.onErrorCallback&&e?.onErrorCallback(t)}else s?e?.onErrorCallback&&e?.onErrorCallback(s):e?.cb&&e?.cb()};if(t&&(t.onerror=null,t.onload=null,sk(()=>{let{needDeleteScript:n=!0}=e;n&&t?.parentNode&&t.parentNode.removeChild(t)}),n&&typeof n==`function`)){let e=n(r);if(e instanceof Promise){let t=await e;return o(),t}return o(),e}o()};return t.onerror=l.bind(null,t.onerror),t.onload=l.bind(null,t.onload),a=setTimeout(()=>{l(null,{type:`error`,isTimeout:!0})},r),{script:t,needAttach:n}}function uk(e){let t=null,n=!0,r=2e4,a,o=document.getElementsByTagName(`link`);for(let r=0;r<o.length;r++){let a=o[r],s=a.getAttribute(`href`),c=a.getAttribute(`rel`);if(s&&ck(s,e.url)&&c===e.attrs.rel){t=a,n=!1;break}}if(!t){t=document.createElement(`link`),t.setAttribute(`href`,e.url);let n,a=!0,o=e.attrs;e.createLinkHook&&(n=e.createLinkHook(e.url,o),n instanceof HTMLLinkElement?(t=n,a=!1):typeof n==`object`&&(`link`in n&&n.link&&(t=n.link,a=!1),`timeout`in n&&n.timeout&&(r=n.timeout))),o&&a&&Object.keys(o).forEach(e=>{t&&!t.getAttribute(e)&&t.setAttribute(e,o[e])})}if(!n)return Promise.resolve().then(()=>{e?.cb&&e?.cb()}),{link:t,needAttach:n};let s=(n,r)=>{a&&clearTimeout(a);let o=()=>{if(r?.type===`error`){let t=Error(r?.isTimeout?`LinkNetworkError: Link "${e.url}" timed out.`:`LinkNetworkError: Failed to load link "${e.url}" - the URL is unreachable or the server returned an error.`);t.name=`LinkNetworkError`,e?.onErrorCallback&&e?.onErrorCallback(t)}else e?.cb&&e?.cb()};if(t&&(t.onerror=null,t.onload=null,sk(()=>{let{needDeleteLink:n=!0}=e;n&&t?.parentNode&&t.parentNode.removeChild(t)}),n)){let e=n(r);return o(),e}o()};return t.onerror=s.bind(null,t.onerror),t.onload=s.bind(null,t.onload),a=setTimeout(()=>{s(null,{type:`error`,isTimeout:!0})},r),{link:t,needAttach:n}}function dk(e,t){let{attrs:n={},createScriptHook:r}=t;return new Promise((t,a)=>{let{script:o,needAttach:s}=lk({url:e,cb:t,onErrorCallback:a,attrs:{fetchpriority:`high`,...n},createScriptHook:r,needDeleteScript:!0});s&&document.head.appendChild(o)})}var fk=new Map;function pk(e){if(!e)throw Error(`import specifier is required`);if(fk.has(e))return fk.get(e);let t=Function(`name`,`return import(name)`)(e).then(e=>e).catch(t=>{throw console.error(`Error importing module ${e}:`,t),fk.delete(e),t});return fk.set(e,t),t}var mk=async()=>{let e=await pk(`node-fetch`);return e.default||e},hk=async(e,t,n)=>{let r=await((e,t)=>n.lifecycle.fetch.emit(e,t))(e,t||{});return!r||!(r instanceof Response)?(typeof fetch>`u`?await mk():fetch)(e,t||{}):r},gk=typeof ENV_TARGET>`u`||ENV_TARGET!==`web`?(e,t,n,r)=>{if(r?.createScriptHook){let t=r.createScriptHook(e);t&&typeof t==`object`&&`url`in t&&(e=t.url)}let a;try{a=new URL(e)}catch(e){console.error(`Error constructing URL:`,e),t(Error(`Invalid URL: ${e}`));return}let o=async()=>r?.fetch?(e,t)=>hk(e,t,r):typeof fetch>`u`?mk():fetch,s=async(e,r)=>{try{let a=await(await e(r.href)).text(),[o,s]=await Promise.all([pk(`path`),pk(`vm`)]),c={exports:{},module:{exports:{}}},l=r.pathname.split(`/`).slice(0,-1).join(`/`),u=o.basename(r.pathname),d=new s.Script(`(function(exports, module, require, __dirname, __filename) {${a}\n})`,{filename:u,importModuleDynamically:s.constants?.USE_MAIN_CONTEXT_DEFAULT_LOADER??pk}),f;f=(await pk(`node:module`)).createRequire(r.protocol===`file:`||r.protocol===`node:`?r.href:o.join(process.cwd(),`__mf_require_base__.js`)),d.runInThisContext()(c.exports,c.module,f,l,u);let p=c.module.exports||c.exports;if(n&&p&&n.globalName){t(void 0,p[n.globalName]||p);return}t(void 0,p)}catch(e){t(e instanceof Error?e:Error(`Script execution error: ${e}`))}};o().then(async e=>{if(n?.type===`esm`||n?.type===`module`)return yk(a.href,{fetch:e,vm:await pk(`vm`)}).then(async e=>{await e.evaluate(),t(void 0,e.namespace)}).catch(e=>{t(e instanceof Error?e:Error(`Script execution error: ${e}`))});s(e,a)}).catch(e=>{t(e)})}:(e,t,n,r)=>{t(Error(`createScriptNode is disabled in non-Node.js environment`))},_k=typeof ENV_TARGET>`u`||ENV_TARGET!==`web`?(e,t)=>new Promise((n,r)=>{gk(e,(e,a)=>{if(e)r(e);else{let e=t?.attrs?.globalName||`__FEDERATION_${t?.attrs?.name}:custom__`;n(globalThis[e]=a)}},t.attrs,t.loaderHook)}):(e,t)=>{throw Error(`loadScriptNode is disabled in non-Node.js environment`)},vk=new Map;async function yk(e,t){if(vk.has(e))return vk.get(e);let{fetch:n,vm:r}=t,a=await(await n(e)).text(),o=new r.SourceTextModule(a,{importModuleDynamically:async(n,r)=>{let a=new URL(n,e).href;return yk(a,t)}});return vk.set(e,o),await o.link(async n=>{let r=new URL(n,e).href;return await yk(r,t)}),o}var bk=e=>`View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${e.split(`-`)[0].toLowerCase()}#${e.toLowerCase()}`,xk=(e,t,n,r)=>{let a=[`${[t[e]]} #${e}`];return n&&a.push(`args: ${JSON.stringify(n)}`),a.push(bk(e)),r&&a.push(`Original Error Message:\n ${r}`),a.join(`
|
|
76
|
-
`)};function Sk(e,t,n,r,a,o){return r(xk(e,t,n,a))}var Ck=`[ Federation Runtime ]`,wk=ak(Ck);function Tk(e,t,n,r,a){e||(n===void 0?Ek(t):Ek(t,n,r,void 0,a))}function Ek(e,t,n,r,a){if(t!==void 0)return Sk(e,t,n??{},e=>{throw Error(`${Ck}: ${e}`)},r,a);let o=e;throw o instanceof Error?(o.message.startsWith(Ck)||(o.message=`${Ck}: ${o.message}`),o):Error(`${Ck}: ${o}`)}function Dk(e){e instanceof Error&&(e.message.startsWith(Ck)||(e.message=`${Ck}: ${e.message}`)),wk.warn(e)}function Ok(e,t){return e.findIndex(e=>e===t)===-1&&e.push(t),e}function kk(e){return`version`in e&&e.version?`${e.name}:${e.version}`:`entry`in e&&e.entry?`${e.name}:${e.entry}`:`${e.name}`}function Ak(e){return e.entry!==void 0}function jk(e){return!e.entry.includes(`.json`)}function Mk(e){return e&&typeof e==`object`}var Nk=Object.prototype.toString;function Pk(e){return Nk.call(e)===`[object Object]`}function Fk(e){return Array.isArray(e)?e:[e]}function Ik(e){let t={url:``,type:`global`,globalName:``};return BO||HO()||!(`ssrRemoteEntry`in e)?`remoteEntry`in e?{url:e.remoteEntry,type:e.remoteEntryType,globalName:e.globalName}:t:`ssrRemoteEntry`in e?{url:e.ssrRemoteEntry||t.url,type:e.ssrRemoteEntryType||t.type,globalName:e.globalName}:t}var Lk=(e,t)=>{let n;return n=e.endsWith(`/`)?e.slice(0,-1):e,t.startsWith(`.`)&&(t=t.slice(1)),n+=t,n},Rk=typeof globalThis==`object`?globalThis:window,zk=(()=>{try{return document.defaultView}catch{return Rk}})(),Bk=zk;function Vk(e,t,n){Object.defineProperty(e,t,{value:n,configurable:!1,writable:!0})}function Hk(e,t){return Object.hasOwnProperty.call(e,t)}Hk(Rk,`__GLOBAL_LOADING_REMOTE_ENTRY__`)||Vk(Rk,`__GLOBAL_LOADING_REMOTE_ENTRY__`,{});var Uk=Rk.__GLOBAL_LOADING_REMOTE_ENTRY__;function Wk(e){Hk(e,`__VMOK__`)&&!Hk(e,`__FEDERATION__`)&&Vk(e,`__FEDERATION__`,e.__VMOK__),Hk(e,`__FEDERATION__`)||(Vk(e,`__FEDERATION__`,{__GLOBAL_PLUGIN__:[],__INSTANCES__:[],moduleInfo:{},__SHARE__:{},__MANIFEST_LOADING__:{},__PRELOADED_MAP__:new Map}),Vk(e,`__VMOK__`,e.__FEDERATION__)),e.__FEDERATION__.__GLOBAL_PLUGIN__??=[],e.__FEDERATION__.__INSTANCES__??=[],e.__FEDERATION__.moduleInfo??={},e.__FEDERATION__.__SHARE__??={},e.__FEDERATION__.__MANIFEST_LOADING__??={},e.__FEDERATION__.__PRELOADED_MAP__??=new Map}Wk(Rk),Wk(zk);function Gk(e,t=WO()){t&&(Rk.__FEDERATION__.__DEBUG_CONSTRUCTOR__=e,Rk.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__=`2.5.1`)}function Kk(e,t){if(typeof t==`string`){if(e[t])return{value:e[t],key:t};{let n=Object.keys(e);for(let r of n){let[n,a]=r.split(`:`),o=`${n}:${t}`,s=e[o];if(s)return{value:s,key:o}}return{value:void 0,key:t}}}else Ek(`getInfoWithoutType: "key" must be a string, got ${typeof t} (${JSON.stringify(t)}).`)}var qk=()=>zk.__FEDERATION__.moduleInfo,Jk=(e,t)=>{let n=Kk(t,kk(e)).value;if(n&&!n.version&&`version`in e&&e.version&&(n.version=e.version),n)return n;if(`version`in e&&e.version){let{version:t,...n}=e,r=kk(n),a=Kk(zk.__FEDERATION__.moduleInfo,r).value;if(a?.version===t)return a}},Yk=e=>Jk(e,zk.__FEDERATION__.moduleInfo),Xk=(e,t)=>{let n=kk(e);return zk.__FEDERATION__.moduleInfo[n]=t,zk.__FEDERATION__.moduleInfo},Zk=e=>(zk.__FEDERATION__.moduleInfo={...zk.__FEDERATION__.moduleInfo,...e},()=>{let t=Object.keys(e);for(let e of t)delete zk.__FEDERATION__.moduleInfo[e]}),Qk=(e,t)=>{let n=t||`__FEDERATION_${e}:custom__`;return{remoteEntryKey:n,entryExports:Rk[n]}},$k=()=>zk.__FEDERATION__.__GLOBAL_PLUGIN__,eA=e=>Rk.__FEDERATION__.__PRELOADED_MAP__.get(e),tA=e=>Rk.__FEDERATION__.__PRELOADED_MAP__.set(e,!0),nA=`[0-9A-Za-z-]+`,rA=`(?:\\+(${nA}(?:\\.${nA})*))`,iA=`0|[1-9]\\d*`,aA=`[0-9]+`,oA=`\\d*[a-zA-Z-][a-zA-Z0-9-]*`,sA=`(?:${aA}|${oA})`,cA=`(?:-?(${sA}(?:\\.${sA})*))`,lA=`(?:${iA}|${oA})`,uA=`(?:-(${lA}(?:\\.${lA})*))`,dA=`${iA}|x|X|\\*`,fA=`[v=\\s]*(${dA})(?:\\.(${dA})(?:\\.(${dA})(?:${uA})?${rA}?)?)?`,pA=`^\\s*(${fA})\\s+-\\s+(${fA})\\s*$`,mA=`[v=\\s]*${`(${aA})\\.(${aA})\\.(${aA})`}${cA}?${rA}?`,hA=`((?:<|>)?=?)`,gA=`(\\s*)${hA}\\s*(${mA}|${fA})`,_A=`(?:~>?)`,vA=`(\\s*)${_A}\\s+`,yA=`(?:\\^)`,bA=`(\\s*)${yA}\\s+`,xA=`(<|>)?=?\\s*\\*`,SA=`^${yA}${fA}$`,CA=`v?${`(${iA})\\.(${iA})\\.(${iA})`}${uA}?${rA}?`,wA=`^${_A}${fA}$`,TA=`^${hA}\\s*${fA}$`,EA=`^${hA}\\s*(${CA})$|^$`,DA=`^\\s*>=\\s*0.0.0\\s*$`;function OA(e){return new RegExp(e)}function kA(e){return!e||e.toLowerCase()===`x`||e===`*`}function AA(...e){return t=>e.reduce((e,t)=>t(e),t)}function jA(e){return e.match(OA(EA))}function MA(e,t,n,r){let a=`${e}.${t}.${n}`;return r?`${a}-${r}`:a}function NA(e){return e.replace(OA(pA),(e,t,n,r,a,o,s,c,l,u,d,f)=>(t=kA(n)?``:kA(r)?`>=${n}.0.0`:kA(a)?`>=${n}.${r}.0`:`>=${t}`,c=kA(l)?``:kA(u)?`<${Number(l)+1}.0.0-0`:kA(d)?`<${l}.${Number(u)+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:`<=${c}`,`${t} ${c}`.trim()))}function PA(e){return e.replace(OA(gA),`$1$2$3`)}function FA(e){return e.replace(OA(vA),`$1~`)}function IA(e){return e.replace(OA(bA),`$1^`)}function LA(e){return e.trim().split(/\s+/).map(e=>e.replace(OA(SA),(e,t,n,r,a)=>kA(t)?``:kA(n)?`>=${t}.0.0 <${Number(t)+1}.0.0-0`:kA(r)?t===`0`?`>=${t}.${n}.0 <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.0 <${Number(t)+1}.0.0-0`:a?t===`0`?n===`0`?`>=${t}.${n}.${r}-${a} <${t}.${n}.${Number(r)+1}-0`:`>=${t}.${n}.${r}-${a} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.${r}-${a} <${Number(t)+1}.0.0-0`:t===`0`?n===`0`?`>=${t}.${n}.${r} <${t}.${n}.${Number(r)+1}-0`:`>=${t}.${n}.${r} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.${r} <${Number(t)+1}.0.0-0`)).join(` `)}function RA(e){return e.trim().split(/\s+/).map(e=>e.replace(OA(wA),(e,t,n,r,a)=>kA(t)?``:kA(n)?`>=${t}.0.0 <${Number(t)+1}.0.0-0`:kA(r)?`>=${t}.${n}.0 <${t}.${Number(n)+1}.0-0`:a?`>=${t}.${n}.${r}-${a} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.${r} <${t}.${Number(n)+1}.0-0`)).join(` `)}function zA(e){return e.split(/\s+/).map(e=>e.trim().replace(OA(TA),(e,t,n,r,a,o)=>{let s=kA(n),c=s||kA(r),l=c||kA(a);return t===`=`&&l&&(t=``),o=``,s?t===`>`||t===`<`?`<0.0.0-0`:`*`:t&&l?(c&&(r=0),a=0,t===`>`?(t=`>=`,c?(n=Number(n)+1,r=0,a=0):(r=Number(r)+1,a=0)):t===`<=`&&(t=`<`,c?n=Number(n)+1:r=Number(r)+1),t===`<`&&(o=`-0`),`${t+n}.${r}.${a}${o}`):c?`>=${n}.0.0${o} <${Number(n)+1}.0.0-0`:l?`>=${n}.${r}.0${o} <${n}.${Number(r)+1}.0-0`:e})).join(` `)}function BA(e){return e.trim().replace(OA(xA),``)}function VA(e){return e.trim().replace(OA(DA),``)}function HA(e,t){return e=Number(e)||e,t=Number(t)||t,e>t?1:e===t?0:-1}function UA(e,t){let{preRelease:n}=e,{preRelease:r}=t;if(n===void 0&&r)return 1;if(n&&r===void 0)return-1;if(n===void 0&&r===void 0)return 0;for(let e=0,t=n.length;e<=t;e++){let t=n[e],a=r[e];if(t!==a)return t===void 0&&a===void 0?0:t?a?HA(t,a):-1:1}return 0}function WA(e,t){return HA(e.major,t.major)||HA(e.minor,t.minor)||HA(e.patch,t.patch)||UA(e,t)}function GA(e,t){return e.version===t.version}function KA(e,t){switch(e.operator){case``:case`=`:return GA(e,t);case`>`:return WA(e,t)<0;case`>=`:return GA(e,t)||WA(e,t)<0;case`<`:return WA(e,t)>0;case`<=`:return GA(e,t)||WA(e,t)>0;case void 0:return!0;default:return!1}}function qA(e){return AA(LA,RA,zA,BA)(e)}function JA(e){return AA(NA,PA,FA,IA)(e.trim()).split(/\s+/).join(` `)}function YA(e,t){if(!e)return!1;let n=jA(e);if(!n)return!1;let[,r,,a,o,s,c]=n,l={operator:r,version:MA(a,o,s,c),major:a,minor:o,patch:s,preRelease:c?.split(`.`)},u=t.split(`||`);for(let e of u){let t=e.trim();if(!t||t===`*`||t===`x`)return!0;try{let e=JA(t);if(!e.trim())return!0;let n=e.split(` `).map(e=>qA(e)).join(` `);if(!n.trim())return!0;let r=n.split(/\s+/).map(e=>VA(e)).filter(Boolean);if(r.length===0)continue;let a=!0;for(let e of r){let t=jA(e);if(!t){a=!1;break}let[,n,,r,o,s,c]=t;if(!KA({operator:n,version:MA(r,o,s,c),major:r,minor:o,patch:s,preRelease:c?.split(`.`)},l)){a=!1;break}}if(a)return!0}catch(e){console.error(`[semver] Error processing range part "${t}":`,e);continue}}return!1}var XA=`default`,ZA=`global`;function QA(e,t,n,r){let a;return a=`get`in e?e.get:`lib`in e?()=>Promise.resolve(e.lib):()=>Promise.resolve(()=>{Ek(`Cannot get shared "${n}" from "${t}": neither "get" nor "lib" is provided in the share config.`)}),e.shareConfig?.eager&&e.treeShaking?.mode&&Ek(`Invalid shared config for "${n}" from "${t}": cannot use both "eager: true" and "treeShaking.mode" simultaneously. Choose one strategy.`),{deps:[],useIn:[],from:t,loading:null,...e,shareConfig:{requiredVersion:`^${e.version}`,singleton:!1,eager:!1,strictVersion:!1,...e.shareConfig},get:a,loaded:e?.loaded||`lib`in e?!0:void 0,version:e.version??`0`,scope:Array.isArray(e.scope)?e.scope:[e.scope??`default`],strategy:(e.strategy??r)||`version-first`,treeShaking:e.treeShaking?{...e.treeShaking,mode:e.treeShaking.mode??`server-calc`,status:e.treeShaking.status??zO.UNKNOWN,useIn:[]}:void 0}}function $A(e,t){let n=t.shared||{},r=t.name,a=Object.keys(n).reduce((e,a)=>{let o=Fk(n[a]);return e[a]=e[a]||[],o.forEach(n=>{e[a].push(QA(n,r,a,t.shareStrategy))}),e},{}),o={...e.shared};return Object.keys(a).forEach(e=>{o[e]?a[e].forEach(t=>{o[e].find(e=>e.version===t.version)||o[e].push(t)}):o[e]=a[e]}),{allShareInfos:o,newShareInfos:a}}function ej(e,t){if(!e)return!1;let{status:n,mode:r}=e;return n===zO.NO_USE?!1:n===zO.CALCULATED?!0:r===`runtime-infer`?t?aj(e,t):!0:!1}function tj(e,t){let n=e=>{if(!Number.isNaN(Number(e))){let t=e.split(`.`),n=e;for(let e=0;e<3-t.length;e++)n+=`.0`;return n}return e};return!!YA(n(e),`<=${n(t)}`)}var nj=(e,t)=>{let n=t||function(e,t){return tj(e,t)};return Object.keys(e).reduce((e,t)=>!e||n(e,t)||e===`0`?t:e,0)},rj=e=>!!e.loaded||typeof e.lib==`function`,ij=e=>!!e.loading,aj=(e,t)=>{if(!e||!t)return!1;let{usedExports:n}=e;return n?!!t.every(e=>n.includes(e)):!1};function oj(e,t,n,r){let a=e[t][n],o=``,s=ej(r),c=function(e,t){return s?a[e].treeShaking?a[t].treeShaking?!rj(a[e].treeShaking)&&tj(e,t):!1:!0:!rj(a[e])&&tj(e,t)};if(s){if(o=nj(e[t][n],c),o)return{version:o,useTreesShaking:s};s=!1}return{version:nj(e[t][n],c),useTreesShaking:s}}var sj=e=>rj(e)||ij(e);function cj(e,t,n,r){let a=e[t][n],o=``,s=ej(r),c=function(e,t){if(s){if(!a[e].treeShaking)return!0;if(!a[t].treeShaking)return!1;if(sj(a[t].treeShaking))return sj(a[e].treeShaking)?!!tj(e,t):!0;if(sj(a[e].treeShaking))return!1}return sj(a[t])?sj(a[e])?!!tj(e,t):!0:sj(a[e])?!1:tj(e,t)};if(s){if(o=nj(e[t][n],c),o)return{version:o,useTreesShaking:s};s=!1}return{version:nj(e[t][n],c),useTreesShaking:s}}function lj(e){return e===`loaded-first`?cj:oj}function uj(e,t,n,r){if(!e)return;let{shareConfig:a,scope:o=XA,strategy:s,treeShaking:c}=n,l=Array.isArray(o)?o:[o];for(let o of l)if(a&&e[o]&&e[o][t]){let{requiredVersion:l}=a,{version:u,useTreesShaking:d}=lj(s)(e,o,t,c),f={shareScopeMap:e,scope:o,pkgName:t,version:u,GlobalFederation:Bk.__FEDERATION__,shareInfo:n,resolver:()=>{let r=e[o][t][u];if(a.singleton){if(typeof l==`string`&&!YA(u,l)){let e=`Version ${u} from ${u&&r.from} of shared singleton module ${t} does not satisfy the requirement of ${n.from} which needs ${l})`;a.strictVersion?Ek(e):Dk(e)}return{shared:r,useTreesShaking:d}}else{if(l===!1||l===`*`||YA(u,l))return{shared:r,useTreesShaking:d};let n=ej(c);if(n){for(let[r,a]of Object.entries(e[o][t]))if(ej(a.treeShaking,c?.usedExports)&&YA(r,l))return{shared:a,useTreesShaking:n}}for(let[n,r]of Object.entries(e[o][t]))if(YA(n,l))return{shared:r,useTreesShaking:!1}}}};return(r.emit(f)||f).resolver()}}function dj(){return Bk.__FEDERATION__.__SHARE__}function fj(e){let{pkgName:t,extraOptions:n,shareInfos:r}=e,a=n?.resolver??(e=>{if(!e)return;let t={};return e.forEach(e=>{t[e.version]=e}),t[nj(t,function(e,n){return!rj(t[e])&&tj(e,n)})]}),o=e=>typeof e==`object`&&!!e&&!Array.isArray(e),s=(...e)=>{let t={};for(let n of e)if(n)for(let[e,r]of Object.entries(n)){let n=t[e];o(n)&&o(r)?t[e]=s(n,r):r!==void 0&&(t[e]=r)}return t};return s(a(r[t]),n?.customShareInfo)}var pj=(e,t)=>{e.useIn||=[],Ok(e.useIn,t)};function mj(e,t){return t&&e.treeShaking?e.treeShaking:e}function hj(e,t){return!t||t===`.`?e:`${e}/${t.replace(/^\.\//,``)}`}function gj(e,t){for(let n of e){let e=t.startsWith(n.name),r=t.replace(n.name,``);if(e){if(r.startsWith(`/`)){let e=n.name;return r=`.${r}`,{pkgNameOrAlias:e,expose:r,remote:n}}else if(r===``)return{pkgNameOrAlias:n.name,expose:`.`,remote:n}}let a=n.alias&&t.startsWith(n.alias),o=n.alias&&t.replace(n.alias,``);if(n.alias&&a){if(o&&o.startsWith(`/`)){let e=n.alias;return o=`.${o}`,{pkgNameOrAlias:e,expose:o,remote:n}}else if(o===``)return{pkgNameOrAlias:n.alias,expose:`.`,remote:n}}}}function _j(e,t){for(let n of e)if(t===n.name||n.alias&&t===n.alias)return n}var vj=`RUNTIME-001`,yj=`RUNTIME-002`,bj=`RUNTIME-003`,xj=`RUNTIME-004`,Sj=`RUNTIME-005`,Cj=`RUNTIME-006`,wj=`RUNTIME-007`,Tj=`RUNTIME-008`,Ej=`RUNTIME-009`,Dj=`RUNTIME-010`,Oj=`RUNTIME-011`,kj=`RUNTIME-012`,Aj=`RUNTIME-013`,jj=`RUNTIME-014`,Mj=`RUNTIME-015`,Nj=`TYPE-001`,Pj=`BUILD-001`,Fj=`BUILD-002`,Ij={[vj]:`Failed to get remoteEntry exports.`,[yj]:`The remote entry interface does not contain "init"`,[bj]:`Failed to get manifest.`,[xj]:`Failed to locate remote.`,[Sj]:`Invalid loadShareSync function call from bundler runtime`,[Cj]:`Invalid loadShareSync function call from runtime`,[wj]:`Failed to get remote snapshot.`,[Tj]:`Failed to load script resources.`,[Ej]:`Please call createInstance first.`,[Dj]:`The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use "createInstance" api.`,[Oj]:`The remoteEntry URL is missing from the remote snapshot.`,[kj]:`The getter for the shared module is not a function. This may be caused by setting "shared.import: false" without the host providing the corresponding lib.`,[Aj]:`The manifest is not a valid Module Federation manifest.`,[jj]:`The remote does not expose the requested module.`,[Mj]:`Remote container initialization failed.`},Lj={[Nj]:`Failed to generate type declaration. Execute the below cmd to reproduce and fix the error.`},Rj={[Pj]:`Failed to find expose module.`,[Fj]:`PublicPath is required in prod mode.`};({...Ij,...Lj,...Rj});var zj=`.then(callbacks[0]).catch(callbacks[1])`;async function Bj({entry:e,remoteEntryExports:t}){return new Promise((n,r)=>{try{t?n(t):typeof FEDERATION_ALLOW_NEW_FUNCTION<`u`?Function(`callbacks`,`import("${e}")${zj}`)([n,r]):tD(()=>import(e).then(n),[],import.meta.url).catch(r)}catch(t){Ek(`Failed to load ESM entry from "${e}". ${t instanceof Error?t.message:String(t)}`)}})}async function Vj({entry:e,remoteEntryExports:t}){return new Promise((n,r)=>{try{t?n(t):typeof __system_context__>`u`?System.import(e).then(n).catch(r):Function(`callbacks`,`System.import("${e}")${zj}`)([n,r])}catch(t){Ek(`Failed to load SystemJS entry from "${e}". ${t instanceof Error?t.message:String(t)}`)}})}function Hj(e,t,n){let{remoteEntryKey:r,entryExports:a}=Qk(e,t);return a||Ek(vj,Ij,{remoteName:e,remoteEntryUrl:n,remoteEntryKey:r}),a}async function Uj({name:e,globalName:t,entry:n,remoteInfo:r,loaderHook:a,getEntryUrl:o,resourceContext:s}){let{entryExports:c}=Qk(e,t);if(c)return c;let l=o?o(n):n;return dk(l,{attrs:{},createScriptHook:(e,t)=>{let n=a.lifecycle.createScript.emit({url:e,attrs:t,remoteInfo:r,resourceContext:s?{...s,url:e}:void 0});if(n&&(n instanceof HTMLScriptElement||`script`in n||`timeout`in n))return n}}).then(()=>Hj(e,t,n),t=>{let n=t instanceof Error?t.message:String(t);Ek(Tj,Ij,{remoteName:e,resourceUrl:l},n)})}async function Wj({remoteInfo:e,remoteEntryExports:t,loaderHook:n,getEntryUrl:r,resourceContext:a}){let{entry:o,entryGlobalName:s,name:c,type:l}=e;switch(l){case`esm`:case`module`:return Bj({entry:o,remoteEntryExports:t});case`system`:return Vj({entry:o,remoteEntryExports:t});default:return Uj({entry:o,globalName:s,name:c,remoteInfo:e,loaderHook:n,getEntryUrl:r,resourceContext:a})}}async function Gj({remoteInfo:e,loaderHook:t,resourceContext:n}){let{entry:r,entryGlobalName:a,name:o,type:s}=e,{entryExports:c}=Qk(o,a);return c||_k(r,{attrs:{name:o,globalName:a,type:s},loaderHook:{createScriptHook:(r,a={})=>{let o=t.lifecycle.createScript.emit({url:r,attrs:a,remoteInfo:e,resourceContext:n?{...n,url:r}:void 0});if(o&&`url`in o)return o}}}).then(()=>Hj(o,a,r)).catch(e=>{Ek(`Failed to load Node.js entry for remote "${o}" from "${r}". ${e instanceof Error?e.message:String(e)}`)})}function Kj(e){let{entry:t,name:n}=e;return KO(n,t)}async function qj(e){let{origin:t,remoteEntryExports:n,remoteInfo:r,getEntryUrl:a,resourceContext:o,_inErrorHandling:s=!1}=e,c=Kj(r);if(n)return n;if(!Uk[c]){let e=t.remoteHandler.hooks.lifecycle.loadEntry,l=t.loaderHook;Uk[c]=e.emit({origin:t,loaderHook:l,remoteInfo:r,remoteEntryExports:n}).then(e=>e||((typeof ENV_TARGET<`u`?ENV_TARGET===`web`:BO)?Wj({remoteInfo:r,remoteEntryExports:n,loaderHook:l,getEntryUrl:a,resourceContext:o}):Gj({remoteInfo:r,loaderHook:l,resourceContext:o}))).then(async e=>(await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:r,remoteEntryExports:e}),e)).catch(async e=>{let a=Kj(r),o=e instanceof Error&&e.message.includes(`ScriptExecutionError`);if(e instanceof Error&&e.message.includes(`RUNTIME-008`)&&!o&&!s){let e=await t.loaderHook.lifecycle.loadEntryError.emit({getRemoteEntry:e=>qj({...e,_inErrorHandling:!0}),origin:t,remoteInfo:r,remoteEntryExports:n,globalLoading:Uk,uniqueKey:a});if(e)return await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:r,remoteEntryExports:e,recovered:!0}),e}throw await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:r,error:e}),e})}return Uk[c]}function Jj(e){return{...e,entry:`entry`in e?e.entry:``,type:e.type||`global`,entryGlobalName:e.entryGlobalName||e.name,shareScope:e.shareScope||`default`}}function Yj(){return typeof FEDERATION_BUILD_IDENTIFIER<`u`?FEDERATION_BUILD_IDENTIFIER:``}function Xj(e,t){let n=$k(),r=[t.hooks,t.remoteHandler.hooks,t.sharedHandler.hooks,t.snapshotHandler.hooks,t.loaderHook,t.bridgeHook];return n.length>0&&n.forEach(t=>{e?.find(e=>e.name!==t.name)&&e.push(t)}),e&&e.length>0&&e.forEach(e=>{r.forEach(n=>{n.applyPlugin(e,t)})}),e}function Zj(e){return{name:e.name,alias:e.alias,entry:`entry`in e?e.entry:void 0,version:`version`in e?e.version:void 0,type:e.type,entryGlobalName:e.entryGlobalName,shareScope:e.shareScope}}function Qj(e){let t={};for(let[n,r]of Object.entries(e.shared)){let e=r[0];e&&(t[n]={version:e.version,singleton:e.shareConfig?.singleton,requiredVersion:e.shareConfig?.requiredVersion===!1?!1:e.shareConfig?.requiredVersion,eager:e.eager,strictVersion:e.shareConfig?.strictVersion})}return{project:{name:e.name,mfRole:e.remotes?.length>0?`host`:`unknown`},mfConfig:{name:e.name,remotes:e.remotes?.map(Zj)??[],shared:t}}}function $j(e){return{resourceCategory:`sync`,share:!0,depsRemote:!0,...e}}function eM(e,t){return t.map(t=>{let n=_j(e,t.nameOrAlias);return Tk(n,`Unable to preload ${t.nameOrAlias} as it is not included in ${!n&&YO({remoteInfo:n,remotes:e})}`),{remote:n,preloadConfig:$j(t)}})}function tM(e){return e?e.map(e=>e===`.`?e:e.startsWith(`./`)?e.replace(`./`,``):e):[]}function nM(e){return e instanceof Error?e.message.includes(`timed out`)||e.name.includes(`Timeout`):!1}function rM(e,t,n,r){return{url:t,status:n,resourceType:e.resourceType,initiator:e.initiator,id:e.id,error:r}}async function iM(e,t,n,r){let a=e.moduleCache.get(n.name),o=n.entry;if(a?.remoteEntryExports)return rM(r,o,`cached`);try{if(!await qj({origin:e,remoteInfo:n,remoteEntryExports:a?.remoteEntryExports,resourceContext:{...r,url:o}}))throw Error(`Failed to load remoteEntry "${o}".`);return rM(r,o,`success`)}catch(e){return rM(r,o,nM(e)?`timeout`:`error`,e)}}function aM({host:e,remoteInfo:t,url:n,attrs:r,context:a,needDeleteLink:o}){return new Promise(s=>{let{link:c,needAttach:l}=uk({url:n,cb:()=>{s(rM(a,n,l?`success`:`cached`))},onErrorCallback:e=>{s(rM(a,n,nM(e)?`timeout`:`error`,e))},attrs:r,createLinkHook:(n,r)=>{let o=e.loaderHook.lifecycle.createLink.emit({url:n,attrs:r,remoteInfo:t,resourceContext:{...a,url:n}});return o instanceof HTMLLinkElement,o},needDeleteLink:o});l&&document.head.appendChild(c)})}function oM({host:e,remoteInfo:t,url:n,attrs:r,context:a}){return new Promise(o=>{let{script:s,needAttach:c}=lk({url:n,cb:()=>{o(rM(a,n,c?`success`:`cached`))},onErrorCallback:e=>{o(rM(a,n,nM(e)?`timeout`:`error`,e))},attrs:r,createScriptHook:(n,r)=>{let o=e.loaderHook.lifecycle.createScript.emit({url:n,attrs:r,remoteInfo:t,resourceContext:{...a,url:n}});return o instanceof HTMLScriptElement,o},needDeleteScript:!0});c&&document.head.appendChild(s)})}function sM(e,t){return{...e,resourceType:t}}function cM(e,t,n,r=!0,a={initiator:`preloadRemote`,id:e.name}){let{cssAssets:o,jsAssetsWithoutEntry:s,entryAssets:c}=n,l=[];if(t.options.inBrowser){if(c.forEach(n=>{let{moduleInfo:r}=n;l.push(iM(t,e,r,sM(a,`remoteEntry`)))}),r){let n={rel:`preload`,as:`style`};o.forEach(r=>{l.push(aM({host:t,remoteInfo:e,url:r,attrs:n,context:sM(a,`css`)}))})}else{let n={rel:`stylesheet`,type:`text/css`};o.forEach(r=>{l.push(aM({host:t,remoteInfo:e,url:r,attrs:n,needDeleteLink:!1,context:sM(a,`css`)}))})}if(r){let n={rel:`preload`,as:`script`};s.forEach(r=>{l.push(aM({host:t,remoteInfo:e,url:r,attrs:n,context:sM(a,`js`)}))})}else{let n={fetchpriority:`high`,type:e?.type===`module`?`module`:`text/javascript`};s.forEach(r=>{l.push(oM({host:t,remoteInfo:e,url:r,attrs:n,context:sM(a,`js`)}))})}}return Promise.all(l)}function lM(e){if(!e||!(`modules`in e)||!Array.isArray(e.modules))return;let t=e.modules.map(e=>e.moduleName).filter(Boolean);return t.length?t.join(`,`):void 0}function uM(e,t,n){let r=t,a=Array.isArray(e.shareScope)?e.shareScope:[e.shareScope];a.length||a.push(`default`),a.forEach(e=>{r[e]||(r[e]={})});let o={version:e.version||``,shareScopeKeys:Array.isArray(e.shareScope)?a:e.shareScope||`default`};return Object.defineProperty(o,"shareScopeMap",{value:r,enumerable:!1}),{remoteEntryInitOptions:o,shareScope:r[a[0]],initScope:n??[]}}var dM=class{constructor({remoteInfo:e,host:t}){this.inited=!1,this.initing=!1,this.lib=void 0,this.remoteInfo=e,this.host=t}async getEntry(e){if(this.remoteEntryExports)return this.remoteEntryExports;let t=await qj({origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports,resourceContext:{initiator:`loadRemote`,id:hj(this.remoteInfo.name,e),resourceType:`remoteEntry`}});return Tk(t,`remoteEntryExports is undefined \n ${YO(this.remoteInfo)}`),this.remoteEntryExports=t,this.remoteEntryExports}async init(e,t,n,r){let a=await this.getEntry(r);if(this.inited)return await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:a,cached:!0,origin:this.host}),a;if(this.initPromise){try{await this.initPromise,await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:a,cached:!0,origin:this.host})}catch(n){throw await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:a,error:n,cached:!0,origin:this.host}),n}return a}this.initing=!0,this.initPromise=(async()=>{await this.host.loaderHook.lifecycle.beforeInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,origin:this.host});let{remoteEntryInitOptions:r,shareScope:o,initScope:s}=uM(this.remoteInfo,this.host.shareScopeMap,n),c=await this.host.hooks.lifecycle.beforeInitContainer.emit({shareScope:o,remoteEntryInitOptions:r,initScope:s,remoteInfo:this.remoteInfo,origin:this.host});a?.init===void 0&&Ek(yj,Ij,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName},void 0,Qj(this.host.options));try{await a.init(c.shareScope,c.initScope,c.remoteEntryInitOptions)}catch(e){Ek(Mj,Ij,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName,shareScope:this.remoteInfo.shareScope},`${e}`,Qj(this.host.options))}await this.host.hooks.lifecycle.initContainer.emit({...c,id:e,remoteSnapshot:t,remoteEntryExports:a}),this.inited=!0})();try{await this.initPromise,await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:a,origin:this.host})}catch(n){throw await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:a,error:n,origin:this.host}),n}finally{this.initing=!1,this.initPromise=void 0}return a}async get(e,t,n,r){let{loadFactory:a=!0}=n||{loadFactory:!0},o=await this.init(e,r,void 0,t);this.lib=o,await this.host.loaderHook.lifecycle.beforeGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:o,origin:this.host});let s;try{let n=await this.host.loaderHook.lifecycle.getModuleFactory.emit({remoteEntryExports:o,expose:t,moduleInfo:this.remoteInfo});s=typeof n==`function`?n:void 0,s||=await o.get(t),s||Ek(jj,Ij,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,expose:t,requestId:e,availableExposes:lM(r)},void 0,Qj(this.host.options)),await this.host.loaderHook.lifecycle.afterGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:o,moduleFactory:s,origin:this.host})}catch(n){throw await this.host.loaderHook.lifecycle.afterGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:o,error:n,origin:this.host}),n}let c=Lk(this.remoteInfo.name,t),l=this.wraperFactory(s,c);if(!a)return l;await this.host.loaderHook.lifecycle.beforeExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:a,origin:this.host});try{let n=await l();return await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:a,exposeModule:n,origin:this.host}),n}catch(n){throw await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:a,error:n,origin:this.host}),n}}wraperFactory(e,t){function n(e,t){e&&typeof e==`object`&&Object.isExtensible(e)&&!Object.getOwnPropertyDescriptor(e,Symbol.for(`mf_module_id`))&&Object.defineProperty(e,Symbol.for(`mf_module_id`),{value:t,enumerable:!1})}return()=>{let r=e();return r instanceof Promise?r.then(e=>(n(e,t),e)):(n(r,t),r)}}},fM=class{constructor(e){this.type=``,this.listeners=new Set,e&&(this.type=e)}on(e){typeof e==`function`&&this.listeners.add(e)}once(e){let t=this;this.on(function n(...r){return t.remove(n),e.apply(null,r)})}emit(...e){let t;return this.listeners.size>0&&this.listeners.forEach(n=>{let r=n(...e);r!==void 0&&(t=r)}),t}remove(e){this.listeners.delete(e)}removeAll(){this.listeners.clear()}},pM=class extends fM{emit(...e){let t,n=Array.from(this.listeners);if(n.length>0){let r=0,a=t=>t===!1?!1:r<n.length?Promise.resolve(n[r++].apply(null,e)).then(n=>n===void 0||e.length===1&&n===e[0]?a(t):a(n)):t;t=a()}return Promise.resolve(t)}};function mM(e,t){if(!Mk(t))return!1;if(e!==t){for(let n in e)if(!(n in t))return!1}return!0}var hM=class extends fM{constructor(e){super(),this.onerror=Ek,this.type=e}emit(e){Mk(e)||Ek(`The data for the "${this.type}" hook should be an object.`);for(let t of this.listeners)try{let n=t(e);if(n===void 0)continue;if(mM(e,n))e=n;else{this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);break}}catch(e){Dk(e),this.onerror(e)}return e}},gM=class extends fM{constructor(e){super(),this.onerror=Ek,this.type=e}emit(e){Mk(e)||Ek(`The response data for the "${this.type}" hook must be an object.`);let t=Array.from(this.listeners);if(t.length>0){let n=0,r=t=>(Dk(t),this.onerror(t),e),a=o=>{if(o!==void 0&&mM(e,o))e=o;else if(o!==void 0)return this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`),e;if(n<t.length)try{return Promise.resolve(t[n++](e)).then(a,r)}catch(e){return r(e)}return e};return Promise.resolve(a(e))}return Promise.resolve(e)}},_M=class{constructor(e){this.registerPlugins={},this.lifecycle=e,this.lifecycleKeys=Object.keys(e)}applyPlugin(e,t){Tk(Pk(e),`Plugin configuration is invalid.`);let n=e.name;Tk(n,`A name must be provided by the plugin.`),this.registerPlugins[n]||(this.registerPlugins[n]=e,e.apply?.(t),Object.keys(this.lifecycle).forEach(t=>{let n=e[t];n&&this.lifecycle[t].on(n)}))}removePlugin(e){Tk(e,`A name is required.`);let t=this.registerPlugins[e];Tk(t,`The plugin "${e}" is not registered.`),Object.keys(t).forEach(e=>{e!==`name`&&this.lifecycle[e].remove(t[e])})}};function vM(e,t){let n=Ik(t);n.url||Ek(Oj,Ij,{remoteName:e.name});let r=qO(t,n.url);!BO&&!r.startsWith(`http`)&&(r=`https:${r}`),e.type=n.type,e.entryGlobalName=n.globalName,e.entry=r,e.version=t.version,e.buildVersion=t.buildVersion}function yM(){return{name:`snapshot-plugin`,async afterResolve(e){let{remote:t,pkgNameOrAlias:n,expose:r,origin:a,remoteInfo:o,id:s}=e;if(!Ak(t)||!jk(t)){let{remoteSnapshot:c,globalSnapshot:l}=await a.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:t,id:hj(t.name,r)});vM(o,c);let u={remote:t,preloadConfig:{nameOrAlias:n,exposes:[r],resourceCategory:`sync`,share:!1,depsRemote:!1}},d=await a.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({origin:a,preloadOptions:u,remoteInfo:o,remote:t,remoteSnapshot:c,globalSnapshot:l});return d&&cM(o,a,d,!1,{initiator:`loadRemote`,id:s}).catch(()=>void 0),{...e,remoteSnapshot:c}}return e}}}function bM(e){let t=e.split(`:`);return t.length===1?{name:t[0],version:void 0}:t.length===2?{name:t[0],version:t[1]}:{name:t[1],version:t[2]}}function xM(e,t,n,r,a={},o){let{value:s}=Kk(e,kk(t)),c=o||s;if(c&&!$O(c)&&(n(c,t,r),c.remotesInfo)){let t=Object.keys(c.remotesInfo);for(let r of t){if(a[r])continue;a[r]=!0;let t=bM(r),o=c.remotesInfo[r];xM(e,{name:t.name,version:o.matchedVersion},n,!1,a,void 0)}}}var SM=(e,t)=>document.querySelector(`${e}[${e===`link`?`href`:`src`}="${t}"]`);function CM(e,t,n,r,a){let o=[],s=[],c=[],l=new Set,u=new Set,{options:d}=e,{preloadConfig:f}=t,{depsRemote:p}=f;if(xM(r,n,(t,n,r)=>{let a;if(r)a=f;else if(Array.isArray(p)){let e=p.find(e=>e.nameOrAlias===n.name||e.nameOrAlias===n.alias);if(!e)return;a=$j(e)}else if(p===!0)a=f;else return;let l=qO(t,Ik(t).url);l&&c.push({name:n.name,moduleInfo:{name:n.name,entry:l,type:`remoteEntryType`in t?t.remoteEntryType:`global`,entryGlobalName:`globalName`in t?t.globalName:n.name,shareScope:``,version:`version`in t?t.version:void 0},url:l});let u=`modules`in t?t.modules:[],d=tM(a.exposes);d.length&&`modules`in t&&(u=t?.modules?.reduce((e,t)=>(d?.indexOf(t.moduleName)!==-1&&e.push(t),e),[]));function m(e){let n=e.map(e=>qO(t,e));return a.filter?n.filter(a.filter):n}if(u){let r=u.length;for(let c=0;c<r;c++){let r=u[c],l=`${n.name}/${r.moduleName}`;e.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({id:r.moduleName===`.`?n.name:l,name:n.name,remoteSnapshot:t,preloadConfig:a,remote:n,origin:e}),!eA(l)&&(a.resourceCategory===`all`?(o.push(...m(r.assets.css.async)),o.push(...m(r.assets.css.sync)),s.push(...m(r.assets.js.async)),s.push(...m(r.assets.js.sync))):a.resourceCategory===`sync`&&(o.push(...m(r.assets.css.sync)),s.push(...m(r.assets.js.sync))),tA(l))}}},!0,{},a),a.shared&&a.shared.length>0){let t=(t,n)=>{let{shared:r}=uj(e.shareScopeMap,n.sharedName,t,e.sharedHandler.hooks.lifecycle.resolveShare)||{};r&&typeof r.lib==`function`&&(n.assets.js.sync.forEach(e=>{l.add(e)}),n.assets.css.sync.forEach(e=>{u.add(e)}))};a.shared.forEach(e=>{let n=d.shared?.[e.sharedName];if(!n)return;let r=e.version?n.find(t=>t.version===e.version):n;r&&Fk(r).forEach(n=>{t(n,e)})})}let m=s.filter(e=>!l.has(e)&&!SM(`script`,e));return{cssAssets:o.filter(e=>!u.has(e)&&!SM(`link`,e)),jsAssetsWithoutEntry:m,entryAssets:c.filter(e=>!SM(`script`,e.url))}}var wM=function(){return{name:`generate-preload-assets-plugin`,async generatePreloadAssets(e){let{origin:t,preloadOptions:n,remoteInfo:r,remote:a,globalSnapshot:o,remoteSnapshot:s}=e;return BO?Ak(a)&&jk(a)?{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[{name:a.name,url:a.entry,moduleInfo:{name:r.name,entry:a.entry,type:r.type||`global`,entryGlobalName:``,shareScope:``}}]}:(vM(r,s),CM(t,n,r,o,s)):{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[]}}}};function TM(e,t){let n=Yk({name:t.name,version:t.options.version}),r=n&&`remotesInfo`in n&&n.remotesInfo&&Kk(n.remotesInfo,e.name).value;return r&&r.matchedVersion?{hostGlobalSnapshot:n,globalSnapshot:qk(),remoteSnapshot:Yk({name:e.name,version:r.matchedVersion})}:{hostGlobalSnapshot:void 0,globalSnapshot:qk(),remoteSnapshot:Yk({name:e.name,version:`version`in e?e.version:void 0})}}var EM=class{constructor(e){this.loadingHostSnapshot=null,this.manifestCache=new Map,this.hooks=new _M({beforeLoadRemoteSnapshot:new pM(`beforeLoadRemoteSnapshot`),loadSnapshot:new gM(`loadGlobalSnapshot`),loadRemoteSnapshot:new gM(`loadRemoteSnapshot`),afterLoadSnapshot:new gM(`afterLoadSnapshot`)}),this.manifestLoading=Bk.__FEDERATION__.__MANIFEST_LOADING__,this.HostInstance=e,this.loaderHook=e.loaderHook}async loadRemoteSnapshotInfo({moduleInfo:e,id:t,initiator:n=`loadRemote`}){let{options:r}=this.HostInstance;await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({options:r,moduleInfo:e,origin:this.HostInstance});let a=Yk({name:this.HostInstance.options.name,version:this.HostInstance.options.version});a||(a={version:this.HostInstance.options.version||``,remoteEntry:``,remotesInfo:{}},Zk({[this.HostInstance.options.name]:a})),a&&`remotesInfo`in a&&!Kk(a.remotesInfo,e.name).value&&(`version`in e||`entry`in e)&&(a.remotesInfo={...a?.remotesInfo,[e.name]:{matchedVersion:`version`in e?e.version:e.entry}});let{hostGlobalSnapshot:o,remoteSnapshot:s,globalSnapshot:c}=this.getGlobalRemoteInfo(e),{remoteSnapshot:l,globalSnapshot:u}=await this.hooks.lifecycle.loadSnapshot.emit({options:r,moduleInfo:e,hostGlobalSnapshot:o,remoteSnapshot:s,globalSnapshot:c}),d,f;if(l)if($O(l)){let r=BO?l.remoteEntry:l.ssrRemoteEntry||l.remoteEntry||``,a=await this.loadManifestSnapshot(r,e,{},{initiator:n,id:t||e.name}),o=Xk({...e,entry:r},a);d=a,f=o}else{let{remoteSnapshot:t}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:l,from:`global`});d=t,f=u}else if(Ak(e)){let r=await this.loadManifestSnapshot(e.entry,e,{},{initiator:n,id:t||e.name}),a=Xk(e,r);d=r,f=a}else Ek(wj,Ij,{remoteName:e.name,remoteVersion:e.version,hostName:this.HostInstance.options.name,globalSnapshot:JSON.stringify(u)},void 0,Qj(this.HostInstance.options));return await this.hooks.lifecycle.afterLoadSnapshot.emit({id:t,host:this.HostInstance,options:r,moduleInfo:e,remoteSnapshot:d}),{remoteSnapshot:d,globalSnapshot:f}}getGlobalRemoteInfo(e){return TM(e,this.HostInstance)}async getManifestJson(e,t,n,r){return(async()=>{let n=Jj(t),a=this.manifestCache.get(e);if(a)return a;try{let t=await this.loaderHook.lifecycle.fetch.emit(e,{},n,r?{...r,url:e,resourceType:`manifest`}:void 0);(!t||!(t instanceof Response))&&(t=await fetch(e,{})),a=await t.json()}catch(r){a=await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:r,from:`runtime`,lifecycle:`afterResolve`,remote:n,origin:this.HostInstance}),a||(delete this.manifestLoading[e],Ek(bj,Ij,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name},`${r}`,Qj(this.HostInstance.options)))}let o=[!a.metaData&&`metaData`,!a.exposes&&`exposes`,!a.shared&&`shared`].filter(Boolean);return o.length>0&&await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:Error(`"${e}" is not a valid federation manifest for remote "${t.name}". Missing required fields: ${o.join(`, `)}.`),from:`runtime`,lifecycle:`afterResolve`,remote:n,origin:this.HostInstance}),o.length>0&&Ek(Aj,Ij,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name,missingFields:o.join(`,`)},void 0,Qj(this.HostInstance.options)),this.manifestCache.set(e,a),a})()}async loadManifestSnapshot(e,t,n,r){let a=async()=>{let a=await this.getManifestJson(e,t,n,r),o=QO(a,{version:e}),{remoteSnapshot:s}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:t,manifestJson:a,remoteSnapshot:o,manifestUrl:e,from:`manifest`});return s};return this.manifestLoading[e]||(this.manifestLoading[e]=a().then(e=>e)),this.manifestLoading[e]}},DM=class{constructor(e){this.hooks=new _M({beforeRegisterShare:new hM(`beforeRegisterShare`),afterResolve:new gM(`afterResolve`),beforeLoadShare:new gM(`beforeLoadShare`),loadShare:new pM,afterLoadShare:new fM(`afterLoadShare`),errorLoadShare:new fM(`errorLoadShare`),resolveShare:new hM(`resolveShare`),initContainerShareScopeMap:new hM(`initContainerShareScopeMap`)}),this.host=e,this.shareScopeMap={},this.initTokens={},this._setGlobalShareScopeMap(e.options)}emitAfterLoadShare({lifecycle:e,pkgName:t,shareInfo:n,selectedShared:r}){try{this.hooks.lifecycle.afterLoadShare.emit({pkgName:t,shareInfo:n,selectedShared:r,shared:this.host.options.shared,shareScopeMap:this.shareScopeMap,lifecycle:e,origin:this.host})}catch(e){Dk(e)}}emitErrorLoadShare({lifecycle:e,pkgName:t,shareInfo:n,error:r,recovered:a}){try{this.hooks.lifecycle.errorLoadShare.emit({pkgName:t,shareInfo:n,shared:this.host.options.shared,shareScopeMap:this.shareScopeMap,lifecycle:e,origin:this.host,error:r,recovered:a})}catch(e){Dk(e)}}registerShared(e,t){let{newShareInfos:n,allShareInfos:r}=$A(e,t);return Object.keys(n).forEach(e=>{n[e].forEach(n=>{n.scope.forEach(r=>{this.hooks.lifecycle.beforeRegisterShare.emit({origin:this.host,pkgName:e,shared:n}),this.shareScopeMap[r]?.[e]||this.setShared({pkgName:e,lib:n.lib,get:n.get,loaded:n.loaded||!!n.lib,shared:n,from:t.name})})})}),{newShareInfos:n,allShareInfos:r}}async loadShare(e,t){let{host:n}=this,r=fj({pkgName:e,extraOptions:t,shareInfos:n.options.shared}),a=r;try{r?.scope&&await Promise.all(r.scope.map(async e=>{await Promise.all(this.initializeSharing(e,{strategy:r.strategy}))})),a=(await this.hooks.lifecycle.beforeLoadShare.emit({pkgName:e,shareInfo:r,shared:n.options.shared,origin:n})).shareInfo,Tk(a,`Cannot find shared "${e}" in host "${n.options.name}". Ensure the shared config for "${e}" is declared in the federation plugin options and the host has been initialized before loading shares.`);let o=a,{shared:s,useTreesShaking:c}=uj(this.shareScopeMap,e,a,this.hooks.lifecycle.resolveShare)||{};if(s){let t=mj(s,c);if(t.lib)return pj(t,n.options.name),this.emitAfterLoadShare({lifecycle:`loadShare`,pkgName:e,shareInfo:o,selectedShared:s}),t.lib;if(t.loading&&!t.loaded){let r=await t.loading;return t.loaded=!0,t.lib||=r,pj(t,n.options.name),this.emitAfterLoadShare({lifecycle:`loadShare`,pkgName:e,shareInfo:o,selectedShared:s}),r}else{let r=(async()=>{let e=await t.get();return pj(t,n.options.name),t.loaded=!0,t.lib=e,e})();this.setShared({pkgName:e,loaded:!1,shared:s,from:n.options.name,lib:null,loading:r,treeShaking:c?t:void 0});let a=await r;return this.emitAfterLoadShare({lifecycle:`loadShare`,pkgName:e,shareInfo:o,selectedShared:s}),a}}else{if(t?.customShareInfo)return this.emitErrorLoadShare({lifecycle:`loadShare`,pkgName:e,shareInfo:o,recovered:!0}),!1;let r=ej(o.treeShaking),a=mj(o,r),s=(async()=>{let t=await a.get();a.lib=t,a.loaded=!0,pj(a,n.options.name);let{shared:r,useTreesShaking:s}=uj(this.shareScopeMap,e,o,this.hooks.lifecycle.resolveShare)||{};if(r){let e=mj(r,s);e.lib=t,e.loaded=!0,r.from=o.from}return t})();this.setShared({pkgName:e,loaded:!1,shared:o,from:n.options.name,lib:null,loading:s,treeShaking:r?a:void 0});let c=await s;return this.emitAfterLoadShare({lifecycle:`loadShare`,pkgName:e,shareInfo:o,selectedShared:o}),c}}catch(t){throw this.emitErrorLoadShare({lifecycle:`loadShare`,pkgName:e,shareInfo:a,error:t}),t}}initializeSharing(e=XA,t){let{host:n}=this,r=t?.from,a=t?.strategy,o=t?.initScope,s=[];if(r!==`build`){let{initTokens:t}=this;o||=[];let n=t[e];if(n||=t[e]={from:this.host.name},o.indexOf(n)>=0)return s;o.push(n)}let c=this.shareScopeMap,l=n.options.name;c[e]||(c[e]={});let u=c[e],d=(e,t)=>{let{version:n,eager:r}=t;u[e]=u[e]||{};let a=u[e],o=a[n]&&mj(a[n]),s=!!(o&&(`eager`in o&&o.eager||`shareConfig`in o&&o.shareConfig?.eager));(!o||o.strategy!==`loaded-first`&&!o.loaded&&(!r==!s?l>a[n].from:r))&&(a[n]=t)},f=async e=>{let{module:t}=await n.remoteHandler.getRemoteModuleAndOptions({id:e}),r;try{r=await t.getEntry()}catch(a){if(r=await n.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:a,from:`runtime`,lifecycle:`beforeLoadShare`,remote:t.remoteInfo,origin:n}),!r)return}finally{r?.init&&!t.initing&&(t.remoteEntryExports=r,await t.init(void 0,void 0,o))}};return Object.keys(n.options.shared).forEach(t=>{n.options.shared[t].forEach(n=>{n.scope.includes(e)&&d(t,n)})}),(n.options.shareStrategy===`version-first`||a===`version-first`)&&n.options.remotes.forEach(t=>{t.shareScope===e&&s.push(f(t.name))}),s}loadShareSync(e,t){let{host:n}=this,r=fj({pkgName:e,extraOptions:t,shareInfos:n.options.shared});try{r?.scope&&r.scope.forEach(e=>{this.initializeSharing(e,{strategy:r.strategy})});let{shared:a}=uj(this.shareScopeMap,e,r,this.hooks.lifecycle.resolveShare)||{};if(a){if(typeof a.lib==`function`)return pj(a,n.options.name),a.loaded||(a.loaded=!0,a.from===n.options.name&&(r.loaded=!0)),this.emitAfterLoadShare({lifecycle:`loadShareSync`,pkgName:e,shareInfo:r,selectedShared:a}),a.lib;if(typeof a.get==`function`){let t=a.get();if(!(t instanceof Promise))return pj(a,n.options.name),this.setShared({pkgName:e,loaded:!0,from:n.options.name,lib:t,shared:a}),this.emitAfterLoadShare({lifecycle:`loadShareSync`,pkgName:e,shareInfo:r,selectedShared:a}),t}}if(r.lib)return r.loaded||=!0,this.emitAfterLoadShare({lifecycle:`loadShareSync`,pkgName:e,shareInfo:r,selectedShared:r}),r.lib;if(r.get){let a=r.get();return a instanceof Promise&&Ek(t?.from===`build`?Sj:Cj,Ij,{hostName:n.options.name,sharedPkgName:e},void 0,Qj(n.options)),r.lib=a,this.setShared({pkgName:e,loaded:!0,from:n.options.name,lib:r.lib,shared:r}),this.emitAfterLoadShare({lifecycle:`loadShareSync`,pkgName:e,shareInfo:r,selectedShared:r}),r.lib}Ek(Cj,Ij,{hostName:n.options.name,sharedPkgName:e},void 0,Qj(n.options))}catch(t){throw this.emitErrorLoadShare({lifecycle:`loadShareSync`,pkgName:e,shareInfo:r,error:t}),t}}initShareScopeMap(e,t,n={}){let{host:r}=this;this.shareScopeMap[e]=t,this.hooks.lifecycle.initContainerShareScopeMap.emit({shareScope:t,options:r.options,origin:r,scopeName:e,hostShareScopeMap:n.hostShareScopeMap})}setShared({pkgName:e,shared:t,from:n,lib:r,loading:a,loaded:o,get:s,treeShaking:c}){let{version:l,scope:u=`default`,...d}=t,f=Array.isArray(u)?u:[u],p=e=>{let t=(e,t,n)=>{n&&!e[t]&&(e[t]=n)},n=c?e.treeShaking:e;t(n,`loaded`,o),t(n,`loading`,a),t(n,`get`,s)};f.forEach(t=>{this.shareScopeMap[t]||(this.shareScopeMap[t]={}),this.shareScopeMap[t][e]||(this.shareScopeMap[t][e]={}),this.shareScopeMap[t][e][l]||(this.shareScopeMap[t][e][l]={version:l,scope:[t],...d,lib:r});let a=this.shareScopeMap[t][e][l];p(a),n&&a.from!==n&&(a.from=n)})}_setGlobalShareScopeMap(e){let t=dj(),n=e.id||e.name;n&&!t[n]&&(t[n]=this.shareScopeMap)}},OM=class{constructor(e){this.hooks=new _M({beforeRegisterRemote:new hM(`beforeRegisterRemote`),registerRemote:new hM(`registerRemote`),beforeRequest:new gM(`beforeRequest`),afterMatchRemote:new pM(`afterMatchRemote`),onLoad:new pM(`onLoad`),afterLoadRemote:new pM(`afterLoadRemote`),handlePreloadModule:new fM(`handlePreloadModule`),errorLoadRemote:new pM(`errorLoadRemote`),beforePreloadRemote:new pM(`beforePreloadRemote`),generatePreloadAssets:new pM(`generatePreloadAssets`),afterPreloadRemote:new pM(`afterPreloadRemote`),loadEntry:new pM}),this.host=e,this.idToRemoteMap={}}formatAndRegisterRemote(e,t){return(t.remotes||[]).reduce((e,t)=>(this.registerRemote(t,e,{force:!1}),e),e.remotes)}setIdToRemoteMap(e,t){let{remote:n,expose:r}=t,{name:a,alias:o}=n;if(this.idToRemoteMap[e]={name:n.name,expose:r},o&&e.startsWith(a)){let t=e.replace(a,o);this.idToRemoteMap[t]={name:n.name,expose:r};return}if(o&&e.startsWith(o)){let t=e.replace(o,a);this.idToRemoteMap[t]={name:n.name,expose:r}}}async loadRemote(e,t){let{host:n}=this,r=gj(n.options.remotes,e),a=e,o=r?.expose,s=r?Jj(r.remote):void 0,c;try{let{loadFactory:r=!0}=t||{loadFactory:!0},{module:l,moduleOptions:u,remoteMatchInfo:d}=await this.getRemoteModuleAndOptions({id:e}),{pkgNameOrAlias:f,remote:p,expose:m,id:h,remoteSnapshot:g}=d;a=h,o=m,s=Jj(p);let _=await l.get(h,m,t,g),v=await this.hooks.lifecycle.onLoad.emit({id:h,pkgNameOrAlias:f,expose:m,exposeModule:r?_:void 0,exposeModuleFactory:r?void 0:_,remote:p,options:u,moduleInstance:l,origin:n});return this.setIdToRemoteMap(e,d),c={id:a,expose:o,remote:s,options:t,origin:n},typeof v==`function`?v:_}catch(r){let{from:l=`runtime`}=t||{from:`runtime`},u;try{u=await this.hooks.lifecycle.errorLoadRemote.emit({id:e,error:r,from:l,lifecycle:`onLoad`,expose:o,remote:s,origin:n})}catch(e){throw c={id:a,expose:o,remote:s,options:t,error:e,origin:n},e}if(!u)throw c={id:a,expose:o,remote:s,options:t,error:r,origin:n},r;return c={id:a,expose:o,remote:s,options:t,error:r,origin:n,recovered:!0},u}finally{c&&await this.hooks.lifecycle.afterLoadRemote.emit(c)}}async preloadRemote(e){let{host:t}=this,n=[];await this.hooks.lifecycle.beforePreloadRemote.emit({preloadOps:e,options:t.options,origin:t});let r=eM(t.options.remotes,e),a=e=>{let{preloadConfig:t,remote:n}=e,r=t.exposes||[];return r.length?r.map(r=>({ops:{...e,preloadConfig:{...t,exposes:[r]}},id:hj(n.name,r)})):[{ops:e,id:`${n.name}/*`}]},o;await Promise.all(r.flatMap(a).map(async e=>{let{ops:r,id:a}=e,{remote:o,preloadConfig:s}=r,c=Jj(o);try{let{globalSnapshot:e,remoteSnapshot:l}=await t.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:o,id:a,initiator:`preloadRemote`}),u=await this.hooks.lifecycle.generatePreloadAssets.emit({origin:t,preloadOptions:r,remote:o,remoteInfo:c,globalSnapshot:e,remoteSnapshot:l});if(!u)return;let d=await cM(c,t,u,!0,{initiator:`preloadRemote`,id:a});n.push({remote:o,remoteInfo:c,preloadConfig:s,id:a,results:d})}catch(e){n.push({remote:o,remoteInfo:c,preloadConfig:s,id:a,results:[{url:c.entry,status:`error`,resourceType:/\.json(?:$|[?#])/i.test(c.entry)?`manifest`:`remoteEntry`,initiator:`preloadRemote`,id:a,error:e}]})}}));let s=n.flatMap(e=>e.results.filter(e=>e.status===`error`||e.status===`timeout`));if(s.length>0&&(o=Error(`preloadRemote failed to load ${s.length} resource(s).`),Object.assign(o,{results:n,failedResults:s})),await this.hooks.lifecycle.afterPreloadRemote.emit({preloadOps:e,options:t.options,origin:t,results:n,error:o}),o)throw o}registerRemotes(e,t){let{host:n}=this;e.forEach(e=>{this.registerRemote(e,n.options.remotes,{force:t?.force})})}async getRemoteModuleAndOptions(e){let{host:t}=this,{id:n}=e,r;try{r=await this.hooks.lifecycle.beforeRequest.emit({id:n,options:t.options,origin:t})}catch(e){if(r=await this.hooks.lifecycle.errorLoadRemote.emit({id:n,options:t.options,origin:t,from:`runtime`,error:e,lifecycle:`beforeRequest`}),!r)throw e}let{id:a}=r,o=gj(t.options.remotes,a);if(!o)try{Ek(xj,Ij,{hostName:t.options.name,requestId:a},void 0,Qj(t.options))}catch(e){throw await this.hooks.lifecycle.afterMatchRemote.emit({id:a,options:t.options,error:e,origin:t}),e}let{remote:s}=o,c=Jj(s);await this.hooks.lifecycle.afterMatchRemote.emit({id:a,...o,options:t.options,remoteInfo:c,origin:t});let l=await t.sharedHandler.hooks.lifecycle.afterResolve.emit({id:a,...o,options:t.options,origin:t,remoteInfo:c}),{remote:u,expose:d}=l;Tk(u&&d,`The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${a}.`);let f=t.moduleCache.get(u.name),p={host:t,remoteInfo:c};return f||(f=new dM(p),t.moduleCache.set(u.name,f)),{module:f,moduleOptions:p,remoteMatchInfo:l}}registerRemote(e,t,n){let{host:r}=this,a=()=>{if(e.alias){let n=t.find(t=>e.alias&&(t.name.startsWith(e.alias)||t.alias?.startsWith(e.alias)));Tk(!n,`The alias ${e.alias} of remote ${e.name} is not allowed to be the prefix of ${n&&n.name} name or alias`)}`entry`in e&&BO&&typeof window<`u`&&!e.entry.startsWith(`http`)&&(e.entry=new URL(e.entry,window.location.origin).href),e.shareScope||=XA,e.type||=ZA};this.hooks.lifecycle.beforeRegisterRemote.emit({remote:e,origin:r});let o=t.find(t=>t.name===e.name);if(!o)a(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:r});else{let s=[`The remote "${e.name}" is already registered.`,`Please note that overriding it may cause unexpected errors.`];n?.force&&(this.removeRemote(o),a(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:r}),JO(s.join(` `)))}}removeRemote(e){try{let{host:t}=this,{name:n}=e,r=t.options.remotes.findIndex(e=>e.name===n);r!==-1&&t.options.remotes.splice(r,1);let a=t.moduleCache.get(e.name);if(a){let n=a.remoteInfo,r=n.entryGlobalName;Rk[r]&&(Object.getOwnPropertyDescriptor(Rk,r)?.configurable?delete Rk[r]:Rk[r]=void 0);let o=Kj(a.remoteInfo);Uk[o]&&delete Uk[o],t.snapshotHandler.manifestCache.delete(n.entry);let s=n.buildVersion?KO(n.name,n.buildVersion):n.name,c=Rk.__FEDERATION__.__INSTANCES__.findIndex(e=>n.buildVersion?e.options.id===s:e.name===s);if(c!==-1){let e=Rk.__FEDERATION__.__INSTANCES__[c];s=e.options.id||s;let t=dj(),r=!0,a=[];Object.keys(t).forEach(e=>{let o=t[e];o&&Object.keys(o).forEach(t=>{let s=o[t];s&&Object.keys(s).forEach(o=>{let c=s[o];c&&Object.keys(c).forEach(s=>{let l=c[s];l&&typeof l==`object`&&l.from===n.name&&(l.loaded||l.loading?(l.useIn=l.useIn.filter(e=>e!==n.name),l.useIn.length?r=!1:a.push([e,t,o,s])):a.push([e,t,o,s]))})})})}),r&&(e.shareScopeMap={},delete t[s]),a.forEach(([e,n,r,a])=>{delete t[e]?.[n]?.[r]?.[a]}),Rk.__FEDERATION__.__INSTANCES__.splice(c,1)}let{hostGlobalSnapshot:l}=TM(e,t);if(l){let t=l&&`remotesInfo`in l&&l.remotesInfo&&Kk(l.remotesInfo,e.name).key;t&&(delete l.remotesInfo[t],Bk.__FEDERATION__.__MANIFEST_LOADING__[t]&&delete Bk.__FEDERATION__.__MANIFEST_LOADING__[t])}t.moduleCache.delete(e.name)}}catch(e){wk.error(`removeRemote failed: ${e instanceof Error?e.message:String(e)}`)}}},kM=typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN==`boolean`?!FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN:!0;Gk(class{constructor(e){this.hooks=new _M({beforeInit:new hM(`beforeInit`),init:new fM,beforeInitContainer:new gM(`beforeInitContainer`),initContainer:new gM(`initContainer`)}),this.version=`2.5.1`,this.moduleCache=new Map,this.loaderHook=new _M({getModuleInfo:new fM,createScript:new fM,createLink:new fM,fetch:new pM,loadEntryError:new pM,afterLoadEntry:new pM(`afterLoadEntry`),beforeInitRemote:new pM(`beforeInitRemote`),afterInitRemote:new pM(`afterInitRemote`),beforeGetExpose:new pM(`beforeGetExpose`),afterGetExpose:new pM(`afterGetExpose`),beforeExecuteFactory:new pM(`beforeExecuteFactory`),afterExecuteFactory:new pM(`afterExecuteFactory`),getModuleFactory:new pM}),this.bridgeHook=new _M({beforeBridgeRender:new fM,afterBridgeRender:new fM,beforeBridgeDestroy:new fM,afterBridgeDestroy:new fM});let t=kM?[yM(),wM()]:[],n={id:Yj(),name:e.name,plugins:t,remotes:[],shared:{},inBrowser:BO};this.name=e.name,this.options=n,this.snapshotHandler=new EM(this),this.sharedHandler=new DM(this),this.remoteHandler=new OM(this),this.shareScopeMap=this.sharedHandler.shareScopeMap,this.registerPlugins([...n.plugins,...e.plugins||[]]),this.options=this.formatOptions(n,e)}initOptions(e){e.name&&e.name!==this.options.name&&Ek(xk(Dj,Ij)),this.registerPlugins(e.plugins);let t=this.formatOptions(this.options,e);return this.options=t,t}async loadShare(e,t){return this.sharedHandler.loadShare(e,t)}loadShareSync(e,t){return this.sharedHandler.loadShareSync(e,t)}initializeSharing(e=XA,t){return this.sharedHandler.initializeSharing(e,t)}initRawContainer(e,t,n){let r=Jj({name:e,entry:t}),a=new dM({host:this,remoteInfo:r});return a.remoteEntryExports=n,this.moduleCache.set(e,a),a}async loadRemote(e,t){return this.remoteHandler.loadRemote(e,t)}async preloadRemote(e){return this.remoteHandler.preloadRemote(e)}initShareScopeMap(e,t,n={}){this.sharedHandler.initShareScopeMap(e,t,n)}formatOptions(e,t){let{allShareInfos:n}=$A(e,t),{userOptions:r,options:a}=this.hooks.lifecycle.beforeInit.emit({origin:this,userOptions:t,options:e,shareInfo:n}),o=this.remoteHandler.formatAndRegisterRemote(a,r),{allShareInfos:s}=this.sharedHandler.registerShared(a,r),c=[...a.plugins];r.plugins&&r.plugins.forEach(e=>{c.includes(e)||c.push(e)});let l={...e,...t,plugins:c,remotes:o,shared:s,id:r.id||e.id};return this.hooks.lifecycle.init.emit({origin:this,options:l}),l}registerPlugins(e){let t=Xj(e,this);this.options.plugins=this.options.plugins.reduce((e,t)=>(t&&e&&!e.find(e=>e.name===t.name)&&e.push(t),e),t||[])}registerRemotes(e,t){return this.remoteHandler.registerRemotes(e,t)}registerShared(e){this.sharedHandler.registerShared(this.options,{...this.options,shared:e})}});var AM=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),jM=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),MM=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),NM=e=>{let t=MM(e);return t.charAt(0).toUpperCase()+t.slice(1)},PM={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},FM=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},IM=(0,x.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a=``,children:o,iconNode:s,...c},l)=>(0,x.createElement)(`svg`,{ref:l,...PM,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:AM(`lucide`,a),...!o&&!FM(c)&&{"aria-hidden":`true`},...c},[...s.map(([e,t])=>(0,x.createElement)(e,t)),...Array.isArray(o)?o:[o]])),Q=(e,t)=>{let n=(0,x.forwardRef)(({className:n,...r},a)=>(0,x.createElement)(IM,{ref:a,iconNode:t,className:AM(`lucide-${jM(NM(e))}`,`lucide-${e}`,n),...r}));return n.displayName=NM(e),n},LM=Q(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]);Q(`alarm-smoke`,[[`path`,{d:`M11 21c0-2.5 2-2.5 2-5`,key:`1sicvv`}],[`path`,{d:`M16 21c0-2.5 2-2.5 2-5`,key:`1o3eny`}],[`path`,{d:`m19 8-.8 3a1.25 1.25 0 0 1-1.2 1H7a1.25 1.25 0 0 1-1.2-1L5 8`,key:`1bvca4`}],[`path`,{d:`M21 3a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V4a1 1 0 0 1 1-1z`,key:`x3qr1j`}],[`path`,{d:`M6 21c0-2.5 2-2.5 2-5`,key:`i3w1gp`}]]),Q(`arrow-down-to-line`,[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]]),Q(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),Q(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),Q(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),Q(`arrow-up-to-line`,[[`path`,{d:`M5 3h14`,key:`7usisc`}],[`path`,{d:`m18 13-6-6-6 6`,key:`1kf1n9`}],[`path`,{d:`M12 7v14`,key:`1akyts`}]]),Q(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]);var RM=Q(`bath`,[[`path`,{d:`M10 4 8 6`,key:`1rru8s`}],[`path`,{d:`M17 19v2`,key:`ts1sot`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}],[`path`,{d:`M7 19v2`,key:`12npes`}],[`path`,{d:`M9 5 7.621 3.621A2.121 2.121 0 0 0 4 5v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5`,key:`14ym8i`}]]);Q(`battery-full`,[[`path`,{d:`M10 10v4`,key:`1mb2ec`}],[`path`,{d:`M14 10v4`,key:`1nt88p`}],[`path`,{d:`M22 14v-4`,key:`14q9d5`}],[`path`,{d:`M6 10v4`,key:`1n77qd`}],[`rect`,{x:`2`,y:`6`,width:`16`,height:`12`,rx:`2`,key:`13zb55`}]]),Q(`battery-low`,[[`path`,{d:`M22 14v-4`,key:`14q9d5`}],[`path`,{d:`M6 14v-4`,key:`14a6bd`}],[`rect`,{x:`2`,y:`6`,width:`16`,height:`12`,rx:`2`,key:`13zb55`}]]),Q(`battery-medium`,[[`path`,{d:`M10 14v-4`,key:`suye4c`}],[`path`,{d:`M22 14v-4`,key:`14q9d5`}],[`path`,{d:`M6 14v-4`,key:`14a6bd`}],[`rect`,{x:`2`,y:`6`,width:`16`,height:`12`,rx:`2`,key:`13zb55`}]]),Q(`battery-warning`,[[`path`,{d:`M10 17h.01`,key:`nbq80n`}],[`path`,{d:`M10 7v6`,key:`nne03l`}],[`path`,{d:`M14 6h2a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2`,key:`1m83kb`}],[`path`,{d:`M22 14v-4`,key:`14q9d5`}],[`path`,{d:`M6 18H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h2`,key:`h8lgfh`}]]),Q(`battery`,[[`path`,{d:`M 22 14 L 22 10`,key:`nqc4tb`}],[`rect`,{x:`2`,y:`6`,width:`16`,height:`12`,rx:`2`,key:`13zb55`}]]),Q(`bell-ring`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M22 8c0-2.3-.8-4.3-2-6`,key:`5bb3ad`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}],[`path`,{d:`M4 2C2.8 3.7 2 5.7 2 8`,key:`tap9e0`}]]);var zM=Q(`bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),BM=Q(`blinds`,[[`path`,{d:`M3 3h18`,key:`o7r712`}],[`path`,{d:`M20 7H8`,key:`gd2fo2`}],[`path`,{d:`M20 11H8`,key:`1ynp89`}],[`path`,{d:`M10 19h10`,key:`19hjk5`}],[`path`,{d:`M8 15h12`,key:`1yqzne`}],[`path`,{d:`M4 3v14`,key:`fggqzn`}],[`circle`,{cx:`4`,cy:`19`,r:`2`,key:`p3m9r0`}]]),VM=Q(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),HM=Q(`box`,[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]);Q(`bug`,[[`path`,{d:`M12 20v-9`,key:`1qisl0`}],[`path`,{d:`M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z`,key:`uouzyp`}],[`path`,{d:`M14.12 3.88 16 2`,key:`qol33r`}],[`path`,{d:`M21 21a4 4 0 0 0-3.81-4`,key:`1b0z45`}],[`path`,{d:`M21 5a4 4 0 0 1-3.55 3.97`,key:`5cxbf6`}],[`path`,{d:`M22 13h-4`,key:`1jl80f`}],[`path`,{d:`M3 21a4 4 0 0 1 3.81-4`,key:`1fjd4g`}],[`path`,{d:`M3 5a4 4 0 0 0 3.55 3.97`,key:`1d7oge`}],[`path`,{d:`M6 13H2`,key:`82j7cp`}],[`path`,{d:`m8 2 1.88 1.88`,key:`fmnt4t`}],[`path`,{d:`M9 7.13V6a3 3 0 1 1 6 0v1.13`,key:`1vgav8`}]]);var UM=Q(`camera`,[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]);Q(`cast`,[[`path`,{d:`M2 8V6a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-6`,key:`3zrzxg`}],[`path`,{d:`M2 12a9 9 0 0 1 8 8`,key:`g6cvee`}],[`path`,{d:`M2 16a5 5 0 0 1 4 4`,key:`1y1dii`}],[`line`,{x1:`2`,x2:`2.01`,y1:`20`,y2:`20`,key:`xu2jvo`}]]),Q(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]);var WM=Q(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]);Q(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]);var GM=Q(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]);Q(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),Q(`chevrons-down-up`,[[`path`,{d:`m7 20 5-5 5 5`,key:`13a0gw`}],[`path`,{d:`m7 4 5 5 5-5`,key:`1kwcof`}]]),Q(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),Q(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),Q(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),Q(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]);var KM=Q(`circle-dot`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]);Q(`circle-pause`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`10`,x2:`10`,y1:`15`,y2:`9`,key:`c1nkhi`}],[`line`,{x1:`14`,x2:`14`,y1:`15`,y2:`9`,key:`h65svq`}]]),Q(`circle-plus`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}],[`path`,{d:`M12 8v8`,key:`napkw2`}]]),Q(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Q(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),Q(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),Q(`cloud-fog`,[[`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`,key:`1pljnt`}],[`path`,{d:`M16 17H7`,key:`pygtm1`}],[`path`,{d:`M17 21H9`,key:`1u2q02`}]]),Q(`cloud-lightning`,[[`path`,{d:`M6 16.326A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 .5 8.973`,key:`1cez44`}],[`path`,{d:`m13 12-3 5h4l-3 5`,key:`1t22er`}]]),Q(`cloud-rain`,[[`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`,key:`1pljnt`}],[`path`,{d:`M16 14v6`,key:`1j4efv`}],[`path`,{d:`M8 14v6`,key:`17c4r9`}],[`path`,{d:`M12 16v6`,key:`c8a4gj`}]]),Q(`cloud-snow`,[[`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`,key:`1pljnt`}],[`path`,{d:`M8 15h.01`,key:`a7atzg`}],[`path`,{d:`M8 19h.01`,key:`puxtts`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M12 21h.01`,key:`h35vbk`}],[`path`,{d:`M16 15h.01`,key:`rnfrdf`}],[`path`,{d:`M16 19h.01`,key:`1vcnzz`}]]);var qM=Q(`cloud-sun`,[[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}],[`path`,{d:`M15.947 12.65a4 4 0 0 0-5.925-4.128`,key:`dpwdj0`}],[`path`,{d:`M13 22H7a5 5 0 1 1 4.9-6H13a3 3 0 0 1 0 6Z`,key:`s09mg5`}]]);Q(`cloud`,[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]),Q(`copy-plus`,[[`line`,{x1:`15`,x2:`15`,y1:`12`,y2:`18`,key:`1p7wdc`}],[`line`,{x1:`12`,x2:`18`,y1:`15`,y2:`15`,key:`1nscbv`}],[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Q(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Q(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),Q(`crosshair`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`22`,x2:`18`,y1:`12`,y2:`12`,key:`l9bcsi`}],[`line`,{x1:`6`,x2:`2`,y1:`12`,y2:`12`,key:`13hhkx`}],[`line`,{x1:`12`,x2:`12`,y1:`6`,y2:`2`,key:`10w3f3`}],[`line`,{x1:`12`,x2:`12`,y1:`22`,y2:`18`,key:`15g9kq`}]]),Q(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),Q(`door-closed`,[[`path`,{d:`M10 12h.01`,key:`1kxr2c`}],[`path`,{d:`M18 20V6a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v14`,key:`36qu9e`}],[`path`,{d:`M2 20h20`,key:`owomy5`}]]),Q(`door-open`,[[`path`,{d:`M11 20H2`,key:`nlcfvz`}],[`path`,{d:`M11 4.562v16.157a1 1 0 0 0 1.242.97L19 20V5.562a2 2 0 0 0-1.515-1.94l-4-1A2 2 0 0 0 11 4.561z`,key:`au4z13`}],[`path`,{d:`M11 4H8a2 2 0 0 0-2 2v14`,key:`74r1mk`}],[`path`,{d:`M14 12h.01`,key:`1jfl7z`}],[`path`,{d:`M22 20h-3`,key:`vhrsz`}]]),Q(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),Q(`droplet`,[[`path`,{d:`M12 22a7 7 0 0 0 7-7c0-2-1-3.9-3-5.5s-3.5-4-4-6.5c-.5 2.5-2 4.9-4 6.5C6 11.1 5 13 5 15a7 7 0 0 0 7 7z`,key:`c7niix`}]]),Q(`droplets`,[[`path`,{d:`M7 16.3c2.2 0 4-1.83 4-4.05 0-1.16-.57-2.26-1.71-3.19S7.29 6.75 7 5.3c-.29 1.45-1.14 2.84-2.29 3.76S3 11.1 3 12.25c0 2.22 1.8 4.05 4 4.05z`,key:`1ptgy4`}],[`path`,{d:`M12.56 6.6A10.97 10.97 0 0 0 14 3.02c.5 2.5 2 4.9 4 6.5s3 3.5 3 5.5a6.98 6.98 0 0 1-11.91 4.97`,key:`1sl1rz`}]]),Q(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),Q(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]);var JM=Q(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]);Q(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]);var YM=Q(`fan`,[[`path`,{d:`M10.827 16.379a6.082 6.082 0 0 1-8.618-7.002l5.412 1.45a6.082 6.082 0 0 1 7.002-8.618l-1.45 5.412a6.082 6.082 0 0 1 8.618 7.002l-5.412-1.45a6.082 6.082 0 0 1-7.002 8.618l1.45-5.412Z`,key:`484a7f`}],[`path`,{d:`M12 12v.01`,key:`u5ubse`}]]);Q(`film`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M7 3v18`,key:`bbkbws`}],[`path`,{d:`M3 7.5h4`,key:`zfgn84`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`path`,{d:`M3 16.5h4`,key:`1230mu`}],[`path`,{d:`M17 3v18`,key:`in4fa5`}],[`path`,{d:`M17 7.5h4`,key:`myr1c1`}],[`path`,{d:`M17 16.5h4`,key:`go4c1d`}]]),Q(`flame`,[[`path`,{d:`M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4`,key:`1slcih`}]]),Q(`flashlight`,[[`path`,{d:`M12 13v1`,key:`176q98`}],[`path`,{d:`M17 2a1 1 0 0 1 1 1v4a3 3 0 0 1-.6 1.8l-.6.8A4 4 0 0 0 16 12v8a2 2 0 0 1-2 2H10a2 2 0 0 1-2-2v-8a4 4 0 0 0-.8-2.4l-.6-.8A3 3 0 0 1 6 7V3a1 1 0 0 1 1-1z`,key:`17vh7j`}],[`path`,{d:`M6 6h12`,key:`n6hhss`}]]),Q(`flask-conical`,[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]),Q(`footprints`,[[`path`,{d:`M4 16v-2.38C4 11.5 2.97 10.5 3 8c.03-2.72 1.49-6 4.5-6C9.37 2 10 3.8 10 5.5c0 3.11-2 5.66-2 8.68V16a2 2 0 1 1-4 0Z`,key:`1dudjm`}],[`path`,{d:`M20 20v-2.38c0-2.12 1.03-3.12 1-5.62-.03-2.72-1.49-6-4.5-6C14.63 6 14 7.8 14 9.5c0 3.11 2 5.66 2 8.68V20a2 2 0 1 0 4 0Z`,key:`l2t8xc`}],[`path`,{d:`M16 17h4`,key:`1dejxt`}],[`path`,{d:`M4 13h4`,key:`1bwh8b`}]]),Q(`funnel`,[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]]),Q(`gamepad-2`,[[`line`,{x1:`6`,x2:`10`,y1:`11`,y2:`11`,key:`1gktln`}],[`line`,{x1:`8`,x2:`8`,y1:`9`,y2:`13`,key:`qnk9ow`}],[`line`,{x1:`15`,x2:`15.01`,y1:`12`,y2:`12`,key:`krot7o`}],[`line`,{x1:`18`,x2:`18.01`,y1:`10`,y2:`10`,key:`1lcuu1`}],[`path`,{d:`M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z`,key:`mfqc10`}]]),Q(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),Q(`grip-horizontal`,[[`circle`,{cx:`12`,cy:`9`,r:`1`,key:`124mty`}],[`circle`,{cx:`19`,cy:`9`,r:`1`,key:`1ruzo2`}],[`circle`,{cx:`5`,cy:`9`,r:`1`,key:`1a8b28`}],[`circle`,{cx:`12`,cy:`15`,r:`1`,key:`1e56xg`}],[`circle`,{cx:`19`,cy:`15`,r:`1`,key:`1a92ep`}],[`circle`,{cx:`5`,cy:`15`,r:`1`,key:`5r1jwy`}]]),Q(`hard-drive`,[[`path`,{d:`M10 16h.01`,key:`1bzywj`}],[`path`,{d:`M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`18tbho`}],[`path`,{d:`M21.946 12.013H2.054`,key:`zqlbp7`}],[`path`,{d:`M6 16h.01`,key:`1pmjb7`}]]),Q(`hash`,[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]),Q(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]]),Q(`image-off`,[[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}],[`path`,{d:`M10.41 10.41a2 2 0 1 1-2.83-2.83`,key:`1bzlo9`}],[`line`,{x1:`13.5`,x2:`6`,y1:`13.5`,y2:`21`,key:`1q0aeu`}],[`line`,{x1:`18`,x2:`21`,y1:`12`,y2:`15`,key:`5mozeu`}],[`path`,{d:`M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59`,key:`mmje98`}],[`path`,{d:`M21 15V5a2 2 0 0 0-2-2H9`,key:`43el77`}]]);var XM=Q(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]);Q(`inbox`,[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]),Q(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),Q(`layout-grid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]);var ZM=Q(`lightbulb`,[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]);Q(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),Q(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),Q(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Q(`locate-fixed`,[[`line`,{x1:`2`,x2:`5`,y1:`12`,y2:`12`,key:`bvdh0s`}],[`line`,{x1:`19`,x2:`22`,y1:`12`,y2:`12`,key:`1tbv5k`}],[`line`,{x1:`12`,x2:`12`,y1:`2`,y2:`5`,key:`11lu5j`}],[`line`,{x1:`12`,x2:`12`,y1:`19`,y2:`22`,key:`x3vr5v`}],[`circle`,{cx:`12`,cy:`12`,r:`7`,key:`fim9np`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Q(`lock-open`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 9.9-1`,key:`1mm8w8`}]]);var QM=Q(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]);Q(`mail`,[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]);var $M=Q(`map-pin`,[[`path`,{d:`M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0`,key:`1r0f0z`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}]]);Q(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),Q(`megaphone`,[[`path`,{d:`M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z`,key:`q8bfy3`}],[`path`,{d:`M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14`,key:`1853fq`}],[`path`,{d:`M8 6v8`,key:`15ugcq`}]]),Q(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),Q(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),Q(`mic`,[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`13`,rx:`3`,key:`s6n7sd`}]]),Q(`minimize-2`,[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]),Q(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]);var eN=Q(`monitor-play`,[[`path`,{d:`M15.033 9.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56V7.648a.645.645 0 0 1 .967-.56z`,key:`vbtd3f`}],[`path`,{d:`M12 17v4`,key:`1riwvh`}],[`path`,{d:`M8 21h8`,key:`1ev6f3`}],[`rect`,{x:`2`,y:`3`,width:`20`,height:`14`,rx:`2`,key:`x3v2xh`}]]);Q(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),Q(`mouse-pointer-click`,[[`path`,{d:`M14 4.1 12 6`,key:`ita8i4`}],[`path`,{d:`m5.1 8-2.9-.8`,key:`1go3kf`}],[`path`,{d:`m6 12-1.9 2`,key:`mnht97`}],[`path`,{d:`M7.2 2.2 8 5.1`,key:`1cfko1`}],[`path`,{d:`M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z`,key:`s0h3yz`}]]),Q(`move`,[[`path`,{d:`M12 2v20`,key:`t6zp3m`}],[`path`,{d:`m15 19-3 3-3-3`,key:`11eu04`}],[`path`,{d:`m19 9 3 3-3 3`,key:`1mg7y2`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}],[`path`,{d:`m5 9-3 3 3 3`,key:`j64kie`}],[`path`,{d:`m9 5 3-3 3 3`,key:`l8vdw6`}]]),Q(`music`,[[`path`,{d:`M9 18V5l12-2v13`,key:`1jmyc2`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`circle`,{cx:`18`,cy:`16`,r:`3`,key:`1hluhg`}]]),Q(`navigation`,[[`polygon`,{points:`3 11 22 2 13 21 11 13 3 11`,key:`1ltx0t`}]]);var tN=Q(`network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]);Q(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),Q(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]);var nN=Q(`pipette`,[[`path`,{d:`m12 9-8.414 8.414A2 2 0 0 0 3 18.828v1.344a2 2 0 0 1-.586 1.414A2 2 0 0 1 3.828 21h1.344a2 2 0 0 0 1.414-.586L15 12`,key:`1y3wsu`}],[`path`,{d:`m18 9 .4.4a1 1 0 1 1-3 3l-3.8-3.8a1 1 0 1 1 3-3l.4.4 3.4-3.4a1 1 0 1 1 3 3z`,key:`110lr1`}],[`path`,{d:`m2 22 .414-.414`,key:`jhxm08`}]]);Q(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),Q(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Q(`plug`,[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]),Q(`power-off`,[[`path`,{d:`M18.36 6.64A9 9 0 0 1 20.77 15`,key:`dxknvb`}],[`path`,{d:`M6.16 6.16a9 9 0 1 0 12.68 12.68`,key:`1x7qb5`}],[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Q(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),Q(`qr-code`,[[`rect`,{width:`5`,height:`5`,x:`3`,y:`3`,rx:`1`,key:`1tu5fj`}],[`rect`,{width:`5`,height:`5`,x:`16`,y:`3`,rx:`1`,key:`1v8r4q`}],[`rect`,{width:`5`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`1x03jg`}],[`path`,{d:`M21 16h-3a2 2 0 0 0-2 2v3`,key:`177gqh`}],[`path`,{d:`M21 21v.01`,key:`ents32`}],[`path`,{d:`M12 7v3a2 2 0 0 1-2 2H7`,key:`8crl2c`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M12 3h.01`,key:`n36tog`}],[`path`,{d:`M12 16v.01`,key:`133mhm`}],[`path`,{d:`M16 12h1`,key:`1slzba`}],[`path`,{d:`M21 12v.01`,key:`1lwtk9`}],[`path`,{d:`M12 21v-1`,key:`1880an`}]]),Q(`radar`,[[`path`,{d:`M19.07 4.93A10 10 0 0 0 6.99 3.34`,key:`z3du51`}],[`path`,{d:`M4 6h.01`,key:`oypzma`}],[`path`,{d:`M2.29 9.62A10 10 0 1 0 21.31 8.35`,key:`qzzz0`}],[`path`,{d:`M16.24 7.76A6 6 0 1 0 8.23 16.67`,key:`1yjesh`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}],[`path`,{d:`M17.99 11.66A6 6 0 0 1 15.77 16.67`,key:`1u2y91`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`path`,{d:`m13.41 10.59 5.66-5.66`,key:`mhq4k0`}]]),Q(`radio`,[[`path`,{d:`M16.247 7.761a6 6 0 0 1 0 8.478`,key:`1fwjs5`}],[`path`,{d:`M19.075 4.933a10 10 0 0 1 0 14.134`,key:`ehdyv1`}],[`path`,{d:`M4.925 19.067a10 10 0 0 1 0-14.134`,key:`1q22gi`}],[`path`,{d:`M7.753 16.239a6 6 0 0 1 0-8.478`,key:`r2q7qm`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]);var rN=Q(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]);Q(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),Q(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),Q(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),Q(`scan`,[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}]]);var iN=Q(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]);Q(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Q(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),Q(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Q(`share-2`,[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]);var aN=Q(`shield-alert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]);Q(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Q(`shield-off`,[[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71`,key:`1jlk70`}],[`path`,{d:`M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264`,key:`18rp1v`}]]),Q(`shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),Q(`ship`,[[`path`,{d:`M12 10.189V14`,key:`1p8cqu`}],[`path`,{d:`M12 2v3`,key:`qbqxhf`}],[`path`,{d:`M19 13V7a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2v6`,key:`qpkstq`}],[`path`,{d:`M19.38 20A11.6 11.6 0 0 0 21 14l-8.188-3.639a2 2 0 0 0-1.624 0L3 14a11.6 11.6 0 0 0 2.81 7.76`,key:`7tigtc`}],[`path`,{d:`M2 21c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1s1.2 1 2.5 1c2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1`,key:`1924j5`}]]);var oN=Q(`siren`,[[`path`,{d:`M7 18v-6a5 5 0 1 1 10 0v6`,key:`pcx96s`}],[`path`,{d:`M5 21a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-1a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2z`,key:`1b4s83`}],[`path`,{d:`M21 12h1`,key:`jtio3y`}],[`path`,{d:`M18.5 4.5 18 5`,key:`g5sp9y`}],[`path`,{d:`M2 12h1`,key:`1uaihz`}],[`path`,{d:`M12 2v1`,key:`11qlp1`}],[`path`,{d:`m4.929 4.929.707.707`,key:`1i51kw`}],[`path`,{d:`M12 12v6`,key:`3ahymv`}]]);Q(`skip-back`,[[`path`,{d:`M17.971 4.285A2 2 0 0 1 21 6v12a2 2 0 0 1-3.029 1.715l-9.997-5.998a2 2 0 0 1-.003-3.432z`,key:`15892j`}],[`path`,{d:`M3 20V4`,key:`1ptbpl`}]]),Q(`skip-forward`,[[`path`,{d:`M21 4v16`,key:`7j8fe9`}],[`path`,{d:`M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z`,key:`zs4d6`}]]);var sN=Q(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]);Q(`smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]);var cN=Q(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]);Q(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),Q(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),Q(`table-2`,[[`path`,{d:`M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18`,key:`gugj83`}]]),Q(`target`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`6`,key:`1vlfrh`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]);var lN=Q(`thermometer`,[[`path`,{d:`M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z`,key:`17jzev`}]]),uN=Q(`toggle-left`,[[`circle`,{cx:`9`,cy:`12`,r:`3`,key:`u3jwor`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`5`,rx:`7`,key:`g7kal2`}]]),dN=Q(`tractor`,[[`path`,{d:`m10 11 11 .9a1 1 0 0 1 .8 1.1l-.665 4.158a1 1 0 0 1-.988.842H20`,key:`she1j9`}],[`path`,{d:`M16 18h-5`,key:`bq60fd`}],[`path`,{d:`M18 5a1 1 0 0 0-1 1v5.573`,key:`1kv8ia`}],[`path`,{d:`M3 4h8.129a1 1 0 0 1 .99.863L13 11.246`,key:`1q1ert`}],[`path`,{d:`M4 11V4`,key:`9ft8pt`}],[`path`,{d:`M7 15h.01`,key:`k5ht0j`}],[`path`,{d:`M8 10.1V4`,key:`1jgyzo`}],[`circle`,{cx:`18`,cy:`18`,r:`2`,key:`1emm8v`}],[`circle`,{cx:`7`,cy:`15`,r:`5`,key:`ddtuc`}]]),fN=Q(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]);Q(`trending-up`,[[`path`,{d:`M16 7h6v6`,key:`box55l`}],[`path`,{d:`m22 7-8.5 8.5-5-5L2 17`,key:`1t1m79`}]]),Q(`trending-down`,[[`path`,{d:`M16 17h6v-6`,key:`t6n2it`}],[`path`,{d:`m22 17-8.5-8.5-5 5L2 7`,key:`x473p`}]]),Q(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Q(`type`,[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]),Q(`unlink-2`,[[`path`,{d:`M15 7h2a5 5 0 0 1 0 10h-2m-6 0H7A5 5 0 0 1 7 7h2`,key:`1re2ne`}]]),Q(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),Q(`vibrate`,[[`path`,{d:`m2 8 2 2-2 2 2 2-2 2`,key:`sv1b1`}],[`path`,{d:`m22 8-2 2 2 2-2 2 2 2`,key:`101i4y`}],[`rect`,{width:`8`,height:`14`,x:`8`,y:`5`,rx:`1`,key:`1oyrl4`}]]),Q(`volume-2`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`,key:`ijwkga`}]]),Q(`volume-x`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`line`,{x1:`22`,x2:`16`,y1:`9`,y2:`15`,key:`1ewh16`}],[`line`,{x1:`16`,x2:`22`,y1:`9`,y2:`15`,key:`5ykzw1`}]]);var pN=Q(`waves`,[[`path`,{d:`M2 6c.6.5 1.2 1 2.5 1C7 7 7 5 9.5 5c2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1`,key:`knzxuh`}],[`path`,{d:`M2 12c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1`,key:`2jd2cc`}],[`path`,{d:`M2 18c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1`,key:`rd2r6e`}]]);Q(`wifi-off`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Q(`wifi`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M2 8.82a15 15 0 0 1 20 0`,key:`dnpr2z`}],[`path`,{d:`M5 12.859a10 10 0 0 1 14 0`,key:`1x1e6c`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}]]),Q(`wind`,[[`path`,{d:`M12.8 19.6A2 2 0 1 0 14 16H2`,key:`148xed`}],[`path`,{d:`M17.5 8a2.5 2.5 0 1 1 2 4H2`,key:`1u4tom`}],[`path`,{d:`M9.8 4.4A2 2 0 1 1 11 8H2`,key:`75valh`}]]);var mN=Q(`workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]);Q(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),Q(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);var hN=Q(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]);Q(`zoom-in`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`11`,x2:`11`,y1:`8`,y2:`14`,key:`1vmskp`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),Q(`zoom-out`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]);var gN=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,_N=rD,vN=(e,t)=>n=>{if(t?.variants==null)return _N(e,n?.class,n?.className);let{variants:r,defaultVariants:a}=t,o=Object.keys(r).map(e=>{let t=n?.[e],o=a?.[e];if(t===null)return null;let s=gN(t)||gN(o);return r[e][s]}),s=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return _N(e,o,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...o}=t;return Object.entries(o).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...a,...s}[t]):{...a,...s}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},yN=vN(`inline-flex items-center justify-center rounded-md font-medium transition-colors cursor-pointer disabled:opacity-50 disabled:pointer-events-none`,{variants:{variant:{primary:`bg-primary text-primary-foreground hover:bg-primary/90`,secondary:`bg-surface text-foreground hover:bg-surface-hover`,ghost:`hover:bg-surface-hover text-foreground-muted`,danger:`bg-danger text-white hover:bg-danger/90`,outline:`border border-border bg-transparent hover:bg-surface-hover`},size:{sm:`h-7 px-2.5 text-xs gap-1.5`,md:`h-8 px-3 text-sm gap-2`,lg:`h-9 px-4 text-sm gap-2`}},defaultVariants:{variant:`primary`,size:`sm`}}),bN=(0,x.forwardRef)(({className:e,variant:t,size:n,...r},a)=>(0,S.jsx)(`button`,{ref:a,className:AO(yN({variant:t,size:n}),e),...r}));bN.displayName=`Button`;var xN=vN(`inline-flex items-center justify-center rounded-md font-medium transition-colors cursor-pointer disabled:opacity-50 disabled:pointer-events-none`,{variants:{variant:{primary:`bg-primary text-primary-foreground hover:bg-primary/90`,secondary:`bg-surface text-foreground hover:bg-surface-hover`,ghost:`hover:bg-surface-hover text-foreground-muted`,danger:`bg-danger text-white hover:bg-danger/90`,outline:`border border-border bg-transparent hover:bg-surface-hover`},size:{sm:`h-7 w-7`,md:`h-8 w-8`,lg:`h-9 w-9`}},defaultVariants:{variant:`primary`,size:`sm`}}),SN=(0,x.forwardRef)(({className:e,variant:t,size:n,icon:r,...a},o)=>(0,S.jsx)(`button`,{ref:o,className:AO(xN({variant:t,size:n}),e),...a,children:(0,S.jsx)(r,{className:`h-4 w-4`})}));SN.displayName=`IconButton`;var CN=vN(`inline-flex items-center rounded-full text-xs font-medium px-2 py-0.5`,{variants:{variant:{default:`bg-surface-hover text-foreground`,success:`bg-success/15 text-success`,warning:`bg-warning/15 text-warning`,danger:`bg-danger/15 text-danger`,info:`bg-info/15 text-info`},styleVariant:{solid:``,outline:`border bg-transparent`}},defaultVariants:{variant:`default`,styleVariant:`solid`}}),wN=(0,x.forwardRef)(({className:e,variant:t,style:n,...r},a)=>(0,S.jsx)(`span`,{ref:a,className:AO(CN({variant:t,styleVariant:n}),e),...r}));wN.displayName=`Badge`;var TN=vN(`rounded-lg p-3`,{variants:{variant:{flat:`bg-surface`,bordered:`bg-surface border border-border`}},defaultVariants:{variant:`bordered`}}),EN=(0,x.forwardRef)(({className:e,variant:t,...n},r)=>(0,S.jsx)(`div`,{ref:r,className:AO(TN({variant:t}),e),...n}));EN.displayName=`Card`;var DN=(0,x.forwardRef)(({className:e,...t},n)=>(0,S.jsx)(`label`,{ref:n,className:AO(`text-[10px] uppercase tracking-wider text-foreground-muted font-medium`,e),...t}));DN.displayName=`Label`;var ON=vN(``,{variants:{orientation:{horizontal:`h-px w-full bg-border-subtle`,vertical:`w-px h-full bg-border-subtle`}},defaultVariants:{orientation:`horizontal`}}),kN=(0,x.forwardRef)(({className:e,orientation:t,...n},r)=>(0,S.jsx)(`div`,{ref:r,role:`separator`,className:AO(ON({orientation:t}),e),...n}));kN.displayName=`Separator`;var AN=(0,x.forwardRef)(({className:e,...t},n)=>(0,S.jsx)(`div`,{ref:n,className:AO(`animate-pulse bg-surface-hover rounded-md h-4 w-full`,e),...t}));AN.displayName=`Skeleton`;var jN=vN(`h-7 w-full px-2.5 text-xs bg-surface border rounded-md text-foreground placeholder:text-foreground-subtle focus:outline-none focus:ring-1 focus:ring-primary transition-colors`,{variants:{state:{default:`border-border`,error:`border-danger`}},defaultVariants:{state:`default`}}),MN=(0,x.forwardRef)(({className:e,state:t,leftSlot:n,rightSlot:r,...a},o)=>n||r?(0,S.jsxs)(`div`,{className:`relative flex items-center w-full`,children:[n&&(0,S.jsx)(`div`,{className:`absolute left-2.5 flex items-center pointer-events-none`,children:n}),(0,S.jsx)(`input`,{ref:o,className:AO(jN({state:t}),n?`pl-7`:``,r?`pr-7`:``,e),...a}),r&&(0,S.jsx)(`div`,{className:`absolute right-2.5 flex items-center pointer-events-none`,children:r})]}):(0,S.jsx)(`input`,{ref:o,className:AO(jN({state:t}),e),...a}));MN.displayName=`Input`;var NN=(0,x.forwardRef)(({className:e,options:t,...n},r)=>(0,S.jsxs)(`div`,{className:`relative w-full`,children:[(0,S.jsx)(`select`,{ref:r,className:AO(`h-7 w-full px-2.5 text-xs bg-surface border border-border rounded-md text-foreground appearance-none pr-7 focus:outline-none focus:ring-1 focus:ring-primary`,e),...n,children:t.map(e=>(0,S.jsx)(`option`,{value:e.value,children:e.label},e.value))}),(0,S.jsx)(`div`,{className:`absolute right-2 top-1/2 -translate-y-1/2 pointer-events-none text-foreground-muted`,children:(0,S.jsx)(WM,{className:`h-3.5 w-3.5`})})]}));NN.displayName=`Select`;var PN=(0,x.forwardRef)(({className:e,...t},n)=>(0,S.jsx)(`input`,{ref:n,type:`checkbox`,className:AO(`w-3.5 h-3.5 rounded-sm border border-border accent-primary`,e),...t}));PN.displayName=`Checkbox`;var FN=(0,x.forwardRef)(({className:e,checked:t,onCheckedChange:n,label:r,...a},o)=>(0,S.jsxs)(`button`,{ref:o,role:`switch`,"aria-checked":t,type:`button`,onClick:()=>n(!t),className:AO(`inline-flex items-center gap-2`,e),...a,children:[(0,S.jsx)(`span`,{className:AO(`w-8 h-4 rounded-full transition-colors`,t?`bg-primary`:`bg-surface-hover`),children:(0,S.jsx)(`span`,{className:AO(`block w-3.5 h-3.5 rounded-full bg-white transition-transform`,t?`translate-x-4`:`translate-x-0.5`)})}),r&&(0,S.jsx)(`span`,{className:`text-xs text-foreground`,children:r})]}));FN.displayName=`Switch`;var IN=(0,x.createContext)(null);function LN(){let e=(0,x.useContext)(IN);if(!e)throw Error(`Dialog compound components must be used within <Dialog>`);return e}var RN=vN(`fixed left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 m-0 w-[calc(100vw-2rem)] bg-background-elevated border border-border rounded-lg p-4 backdrop:bg-black/50 backdrop:backdrop-blur-sm max-h-[calc(100dvh-2rem)] overflow-y-auto`,{variants:{width:{sm:`max-w-sm`,md:`max-w-md`,lg:`max-w-lg`}},defaultVariants:{width:`md`}}),zN=(0,x.forwardRef)(({className:e,width:t,children:n,...r},a)=>{let{open:o,setOpen:s,contentId:c}=LN(),l=(0,x.useRef)(null),u=a??l;return(0,x.useEffect)(()=>{let e=u.current;e&&(o&&!e.open&&e.showModal(),!o&&e.open&&e.close())},[o,u]),(0,S.jsx)(`dialog`,{ref:u,id:c,className:AO(RN({width:t}),e),onClick:e=>{e.target===e.currentTarget&&s(!1)},onClose:()=>s(!1),...r,children:n})});zN.displayName=`DialogContent`,(0,x.createContext)(null),(0,x.createContext)(null),(0,x.createContext)(null),(0,x.createContext)(null);var BN=(0,x.forwardRef)(({className:e,...t},n)=>(0,S.jsx)(`div`,{ref:n,className:AO(`overflow-auto [&::-webkit-scrollbar]:w-1 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:bg-surface-hover [&::-webkit-scrollbar-thumb]:rounded-full`,e),...t}));BN.displayName=`ScrollArea`;var VN=typeof globalThis<`u`?globalThis.__camstackTrpcReact:void 0,$=VN??Di();typeof globalThis<`u`&&!VN&&(globalThis.__camstackTrpcReact=$);var HN=FO(`camstack:system`,null);function UN({system:e,children:t}){return(0,S.jsx)(HN.Provider,{value:e,children:t})}function WN(){let e=(0,x.useContext)(HN);if(!e)throw Error(`useSystem(): no <SystemProvider> in tree`);return e}function GN(e,t){let n=WN(),r=(0,x.useRef)(t);r.current=t;let[a,o]=(0,x.useState)(n.connectionVersion);(0,x.useEffect)(()=>n.subscribeConnectionEvents((e,t)=>{e===`connected`&&o(t)}),[n]),(0,x.useEffect)(()=>n.subscribeEvent(e,e=>{r.current(e)}),[n,e,a])}FO(`camstack:confirm-dialog`,null);var KN=`capability.binding-changed`;function qN(e,t){let[n,r]=(0,x.useState)(null);return(0,x.useEffect)(()=>{if(t===null){r(null);return}let n=!1,a=async()=>{try{let a=await e.deviceManager.getBindings.query({deviceId:t});n||r(a)}catch{n||r(e=>e)}};a();let o=e.live?.onEvent.subscribe({category:KN},{onData:e=>{let n=e.data?.source;if(!n){a();return}n.type===`device`&&n.id===t&&a()}});return()=>{n=!0,o?.unsubscribe()}},[e,t]),(0,x.useMemo)(()=>n?df(e,n):null,[e,n])}var JN={[K.Camera]:{icon:UM,label:`Camera`},[K.Hub]:{icon:tN,label:`Hub`},[K.Light]:{icon:ZM,label:`Light`},[K.Siren]:{icon:oN,label:`Siren`},[K.Switch]:{icon:uN,label:`Switch`},[K.Sensor]:{icon:LM,label:`Sensor`},[K.Thermostat]:{icon:lN,label:`Thermostat`},[K.Button]:{icon:KM,label:`Button`},[K.EventEmitter]:{icon:hN,label:`Event Emitter`},[K.Update]:{icon:rN,label:`Update`},[K.Generic]:{icon:HM,label:`Generic`},[K.Notifier]:{icon:zM,label:`Notifier`},[K.Script]:{icon:iN,label:`Script`},[K.Automation]:{icon:mN,label:`Automation`},[K.Lock]:{icon:QM,label:`Lock`},[K.Cover]:{icon:BM,label:`Cover`},[K.Valve]:{icon:nN,label:`Valve`},[K.Humidifier]:{icon:pN,label:`Humidifier`},[K.WaterHeater]:{icon:RM,label:`Water heater`},[K.Fan]:{icon:YM,label:`Fan`},[K.MediaPlayer]:{icon:eN,label:`Media player`},[K.AlarmPanel]:{icon:aN,label:`Alarm panel`},[K.Control]:{icon:sN,label:`Control`},[K.Presence]:{icon:$M,label:`Presence`},[K.Weather]:{icon:qM,label:`Weather`},[K.Vacuum]:{icon:VM,label:`Vacuum`},[K.LawnMower]:{icon:dN,label:`Lawn mower`},[K.Container]:{icon:HM,label:`Container`},[K.Image]:{icon:XM,label:`Image`}};q.Siren,q.Floodlight,q.Spotlight,q.PirSensor,q.Chime,q.Autotrack,q.Nightvision,q.PrivacyMask,q.Doorbell,q.BinaryHelper,q.MotionSensor,q.ContactSensor,q.LeakSensor,q.SmokeSensor,q.COSensor,q.GasSensor,q.TamperSensor,q.VibrationSensor,q.ConnectivitySensor,q.SoundSensor,q.BinarySensor,q.TemperatureSensor,q.HumiditySensor,q.AmbientLightSensor,q.PressureSensor,q.PowerSensor,q.EnergySensor,q.VoltageSensor,q.CurrentSensor,q.AirQualitySensor,q.BatterySensor,q.NumericSensor,q.EnumSensor,q.DateTimeSensor,q.GenericSensor,q.NumericControl,q.SelectControl,q.TextControl,q.DateTimeControl,q.MobilePushNotifier,q.MessagingNotifier,q.EmailNotifier,q.GenericNotifier,new Set(Object.values(K)),new Set(Object.values(q)),Object.values(K).map(e=>({id:e,label:JN[e].label,icon:JN[e].icon})),(0,x.createContext)(null),$.accessories.setChildHidden.useMutation,$.accessories.getStatus.useQuery,$.addonPages.listPages.useQuery,$.addons.list.useQuery,$.addons.getLogs.useQuery,$.addons.listPackages.useQuery,$.addons.installPackage.useMutation,$.addons.installFromWorkspace.useMutation,$.addons.isWorkspaceAvailable.useQuery,$.addons.listWorkspacePackages.useQuery,$.addons.uninstallPackage.useMutation,$.addons.reloadPackages.useMutation,$.addons.searchAvailable.useQuery,$.addons.listUpdates.useQuery,$.addons.updatePackage.useMutation,$.addons.rollbackPackage.useMutation,$.addons.forceRefresh.useMutation,$.addons.restartServer.useMutation,$.addons.getLastRestart.useQuery,$.addons.listFrameworkPackages.useQuery,$.addons.listCapabilityProviders.useQuery,$.addons.setCapabilityProviderEnabled.useMutation,$.addons.updateFrameworkPackage.useMutation,$.addons.getVersions.useQuery,$.addons.restartAddon.useMutation,$.addons.retryLoad.useMutation,$.addons.getAutoUpdateSettings.useQuery,$.addons.setAutoUpdateSettings.useMutation,$.addons.getAddonAutoUpdate.useQuery,$.addons.setAddonAutoUpdate.useMutation,$.addons.applyAutoUpdateToAll.useMutation,$.addons.custom.useMutation,$.addons.startJob.useMutation,$.addons.getJob.useQuery,$.addons.listJobs.useQuery,$.addons.cancelJob.useMutation,$.addons.onAddonLogs.useSubscription,$.addonSettings.getGlobalSettings.useQuery,$.addonSettings.updateGlobalSettings.useMutation,$.addonSettings.getDeviceSettings.useQuery,$.addonSettings.updateDeviceSettings.useMutation,$.addonWidgets.listWidgets.useQuery,$.airQualitySensor.getStatus.useQuery,$.alarmPanel.arm.useMutation,$.alarmPanel.disarm.useMutation,$.alarmPanel.trigger.useMutation,$.alarmPanel.getStatus.useQuery,$.alerts.emit.useMutation,$.alerts.update.useMutation,$.alerts.list.useQuery,$.alerts.getUnreadCount.useQuery,$.alerts.markRead.useMutation,$.alerts.markAllRead.useMutation,$.alerts.dismiss.useMutation,$.ambientLightSensor.getStatus.useQuery,$.audioAnalysis.resolveDeviceSettings.useQuery,$.audioAnalysis.getDeviceSettingsContribution.useQuery,$.audioAnalysis.getDeviceLiveContribution.useQuery,$.audioAnalysis.applyDeviceSettingsPatch.useMutation,$.audioAnalyzer.analyseChunk.useMutation,$.audioAnalyzer.classify.useQuery,$.audioAnalyzer.isReady.useQuery,$.audioAnalyzer.dispose.useMutation,$.audioAnalyzer.reprobeAudioEngine.useMutation,$.audioCodec.listSupportedCodecs.useQuery,$.audioCodec.canHandle.useQuery,$.audioCodec.createDecodeSession.useMutation,$.audioCodec.createEncodeSession.useMutation,$.audioCodec.closeSession.useMutation,$.audioCodec.pushEncodedFrame.useMutation,$.audioCodec.pullPcm.useQuery,$.audioCodec.pushPcm.useMutation,$.audioCodec.pullEncoded.useQuery,$.audioCodec.flushEncode.useMutation,$.audioCodec.listActiveSessions.useQuery,$.audioMetrics.getCurrentSnapshot.useQuery,$.audioMetrics.getHistory.useQuery,$.automationControl.enable.useMutation,$.automationControl.disable.useMutation,$.automationControl.trigger.useMutation,$.automationControl.getStatus.useQuery,$.backup.listDestinations.useQuery,$.backup.trigger.useMutation,$.backup.list.useQuery,$.backup.listLocations.useQuery,$.backup.getEntries.useQuery,$.backup.restore.useMutation,$.backup.delete.useMutation,$.backup.listArchives.useQuery,$.backup.upsertDestinationPolicy.useMutation,$.backup.previewSchedule.useQuery,$.battery.wakeForStream.useMutation,$.battery.getStatus.useQuery,$.binary.getStatus.useQuery,$.brightness.setBrightness.useMutation,$.brightness.getStatus.useQuery,$.broker.list.useQuery,$.broker.get.useQuery,$.broker.listProviders.useQuery,$.broker.add.useMutation,$.broker.remove.useMutation,$.broker.testConnection.useMutation,$.broker.getSettings.useQuery,$.broker.setSettings.useMutation,$.broker.getBrokerConfig.useQuery,$.broker.getSettingsSchema.useQuery,$.broker.testSettings.useMutation,$.broker.publish.useMutation,$.broker.subscribe.useMutation,$.broker.unsubscribe.useMutation,$.broker.getState.useQuery,$.broker.getStatus.useQuery,$.button.press.useMutation,$.cameraCredentials.getCredentials.useQuery,$.cameraCredentials.getStatus.useQuery,$.cameraPipelineConfig.getDeviceSettingsContribution.useQuery,$.cameraPipelineConfig.getDeviceLiveContribution.useQuery,$.cameraPipelineConfig.applyDeviceSettingsPatch.useMutation,$.cameraStreams.getCameraStreams.useQuery,$.cameraStreams.getBrokerStreams.useQuery,$.cameraStreams.getRtspEntries.useQuery,$.cameraStreams.getProfileRtspEntries.useQuery,$.cameraStreams.pickStream.useQuery,$.carbonMonoxide.getStatus.useQuery,$.climateControl.setMode.useMutation,$.climateControl.setFanMode.useMutation,$.climateControl.setPreset.useMutation,$.climateControl.setTarget.useMutation,$.climateControl.setTargetRange.useMutation,$.climateControl.setTargetHumidity.useMutation,$.climateControl.getStatus.useQuery,$.color.setColor.useMutation,$.color.getStatus.useQuery,$.connectivity.getStatus.useQuery,$.consumables.reset.useMutation,$.consumables.getStatus.useQuery,$.contact.getStatus.useQuery,$.control.setValue.useMutation,$.control.getStatus.useQuery,$.cover.open.useMutation,$.cover.close.useMutation,$.cover.stop.useMutation,$.cover.setPosition.useMutation,$.cover.setTiltPosition.useMutation,$.cover.getStatus.useQuery,$.decoder.supportsCodec.useQuery,$.decoder.getInfo.useQuery,$.decoder.createSession.useQuery,$.decoder.destroySession.useQuery,$.decoder.pushPacket.useQuery,$.decoder.openStream.useQuery,$.decoder.pullFrames.useQuery,$.decoder.pullHandles.useQuery,$.decoder.getFrame.useQuery,$.decoder.getShmStats.useQuery,$.decoder.updateConfig.useQuery,$.decoder.getStats.useQuery,$.decoder.listActiveSessions.useQuery,$.decoder.reprobeHwaccel.useMutation,$.detectionPipeline.getDeviceSettingsContribution.useQuery,$.detectionPipeline.getDeviceLiveContribution.useQuery,$.detectionPipeline.applyDeviceSettingsPatch.useMutation,$.deviceAdoption.listCandidateFilters.useQuery,$.deviceAdoption.listCandidates.useQuery,$.deviceAdoption.getCandidate.useQuery,$.deviceAdoption.refresh.useMutation,$.deviceAdoption.adopt.useMutation,$.deviceAdoption.release.useMutation,$.deviceAdoption.resync.useMutation,$.deviceAdoption.getStatus.useQuery,$.deviceDiscovery.listDiscovered.useQuery,$.deviceDiscovery.refreshDiscovery.useMutation,$.deviceDiscovery.adoptDevice.useMutation,$.deviceDiscovery.releaseDevice.useMutation,$.deviceDiscovery.getStatus.useQuery,$.deviceExport.getStatus.useQuery,$.deviceExport.listSupportedDeviceKinds.useQuery,$.deviceExport.listExposedDevices.useQuery,$.deviceExport.exposeDevice.useMutation,$.deviceExport.unexposeDevice.useMutation,$.deviceExport.getDeviceSettingsContribution.useQuery,$.deviceExport.getDeviceLiveContribution.useQuery,$.deviceExport.applyDeviceSettingsPatch.useMutation,$.deviceManager.allocateDeviceId.useMutation,$.deviceManager.registerDevice.useMutation,$.deviceManager.removeDevice.useMutation,$.deviceManager.persistConfig.useMutation,$.deviceManager.loadConfig.useQuery,$.deviceManager.loadRuntimeState.useQuery,$.deviceManager.loadMeta.useQuery,$.deviceManager.setName.useMutation,$.deviceManager.setLocation.useMutation,$.deviceManager.setType.useMutation,$.deviceManager.setIntegrationId.useMutation,$.deviceManager.setLinkDeviceId.useMutation,$.deviceManager.setPrimaryChildEntityId.useMutation,$.deviceManager.setChildLayout.useMutation,$.deviceManager.setDeviceLinks.useMutation,$.deviceManager.getWireableFields.useQuery,$.deviceManager.setRole.useMutation,$.deviceManager.applyInitialMeta.useMutation,$.deviceManager.setMetadata.useMutation,$.deviceManager.listLocations.useQuery,$.deviceManager.addLocation.useMutation,$.deviceManager.removeLocation.useMutation,$.deviceManager.setDisabled.useMutation,$.deviceManager.listPersistedByAddon.useQuery,$.deviceManager.listAll.useQuery,$.deviceManager.getDevice.useQuery,$.deviceManager.getChildren.useQuery,$.deviceManager.getStreamSources.useQuery,$.deviceManager.getConfigSchema.useQuery,$.deviceManager.getSettingsSchema.useQuery,$.deviceManager.updateConfig.useMutation,$.deviceManager.enable.useMutation,$.deviceManager.disable.useMutation,$.deviceManager.remove.useMutation,$.deviceManager.removeByIntegration.useMutation,$.deviceManager.getStreamProfileMap.useQuery,$.deviceManager.setStreamProfileMap.useMutation,$.deviceManager.probeStreams.useMutation,$.deviceManager.getBindings.useQuery,$.deviceManager.getAllBindings.useQuery,$.deviceManager.setWrapperActive.useMutation,$.deviceManager.listWrappersForCap.useQuery,$.deviceManager.listBindableCapsForDeviceType.useQuery,$.deviceManager.getDeviceSettingsAggregate.useQuery,$.deviceManager.getDeviceLiveInfoAggregate.useQuery,$.deviceManager.getDeviceAggregate.useQuery,$.deviceManager.runDeviceAction.useMutation,$.deviceManager.updateDeviceField.useMutation,$.deviceManager.updateDeviceFieldsBatch.useMutation,$.deviceManager.discoverDevices.useMutation,$.deviceManager.adoptDevice.useMutation,$.deviceManager.getCreationSchema.useQuery,$.deviceManager.createDevice.useMutation,$.deviceManager.testCreationField.useMutation,$.deviceManager.adoptionListCandidates.useQuery,$.deviceManager.adoptionRefresh.useMutation,$.deviceManager.adoptionAdopt.useMutation,$.deviceManager.adoptionRelease.useMutation,$.deviceManager.testField.useMutation,$.deviceManager.getDeviceStatusAggregate.useQuery,$.deviceOps.getStreamSources.useQuery,$.deviceOps.getConfigEntries.useQuery,$.deviceOps.setConfig.useMutation,$.deviceOps.runAction.useMutation,$.deviceOps.removeDevice.useMutation,$.deviceOps.getSettingsSchema.useQuery,$.deviceOps.getRawState.useQuery,$.deviceProvider.start.useMutation,$.deviceProvider.stop.useMutation,$.deviceProvider.getStatus.useQuery,$.deviceProvider.getDevices.useQuery,$.deviceProvider.supportsDiscovery.useQuery,$.deviceProvider.discoverDevices.useMutation,$.deviceProvider.adoptDiscoveredDevice.useMutation,$.deviceProvider.supportsManualCreation.useQuery,$.deviceProvider.getChildCreationSchema.useQuery,$.deviceProvider.createDevice.useMutation,$.deviceProvider.testCreationField.useMutation,$.deviceState.getSnapshot.useQuery,$.deviceState.getCapSlice.useQuery,$.deviceState.getAllSnapshots.useQuery,$.deviceState.setCapSlice.useMutation,$.deviceStatus.getStatus.useQuery,$.doorbell.getStatus.useQuery,$.enumSensor.getStatus.useQuery,$.eventEmitter.getStatus.useQuery,$.events.getEvents.useQuery,$.events.getEventThumbnail.useQuery,$.events.getEventClipUrl.useQuery,$.faceGallery.listIdentities.useQuery,$.faceGallery.createIdentity.useMutation,$.faceGallery.renameIdentity.useMutation,$.faceGallery.deleteIdentity.useMutation,$.faceGallery.listIdentitySamples.useQuery,$.faceGallery.removeSample.useMutation,$.faceGallery.listRecentFaces.useQuery,$.faceGallery.getFaceByTrack.useQuery,$.faceGallery.getFaceMedia.useQuery,$.faceGallery.assignFace.useMutation,$.faceGallery.unassignFace.useMutation,$.faceGallery.deleteFace.useMutation,$.faceGallery.assignFaces.useMutation,$.faceGallery.unassignFaces.useMutation,$.faceGallery.suggestFaceClusters.useQuery,$.fanControl.setPercentage.useMutation,$.fanControl.setPreset.useMutation,$.fanControl.setDirection.useMutation,$.fanControl.setOscillating.useMutation,$.fanControl.getStatus.useQuery,$.featureProbe.getStatus.useQuery,$.flood.getStatus.useQuery,$.gas.getStatus.useQuery,$.humidifier.setOn.useMutation,$.humidifier.setTargetHumidity.useMutation,$.humidifier.setMode.useMutation,$.humidifier.getStatus.useQuery,$.humiditySensor.getStatus.useQuery,$.image.getStatus.useQuery,$.integrations.list.useQuery,$.integrations.get.useQuery,$.integrations.getByAddonId.useQuery,$.integrations.create.useMutation,$.integrations.update.useMutation,$.integrations.delete.useMutation,$.integrations.getSettings.useQuery,$.integrations.setSettings.useMutation,$.integrations.getAvailableTypes.useQuery,$.integrations.testConnection.useMutation;var YN=$.intercom.startSession.useMutation,XN=$.intercom.handleAnswer.useMutation,ZN=$.intercom.stopSession.useMutation;$.intercom.startTalkSession.useMutation,$.intercom.pushTalkAudio.useMutation,$.intercom.endTalkSession.useMutation,$.intercom.getStatus.useQuery,$.lawnMowerControl.startMowing.useMutation,$.lawnMowerControl.pause.useMutation,$.lawnMowerControl.dock.useMutation,$.lawnMowerControl.getStatus.useQuery,$.localNetwork.list.useQuery,$.localNetwork.getPreferred.useQuery,$.localNetwork.getConnectionEndpoints.useQuery,$.localNetwork.getAllowedAddresses.useQuery,$.localNetwork.setAllowedAddresses.useMutation,$.localNetwork.resetAllowlistToBestMatch.useMutation,$.lockControl.lock.useMutation,$.lockControl.unlock.useMutation,$.lockControl.open.useMutation,$.lockControl.getStatus.useQuery,$.mediaPlayer.play.useMutation,$.mediaPlayer.pause.useMutation,$.mediaPlayer.stop.useMutation,$.mediaPlayer.next.useMutation,$.mediaPlayer.previous.useMutation,$.mediaPlayer.seek.useMutation,$.mediaPlayer.setVolume.useMutation,$.mediaPlayer.setMute.useMutation,$.mediaPlayer.setShuffle.useMutation,$.mediaPlayer.setRepeat.useMutation,$.mediaPlayer.selectSource.useMutation,$.mediaPlayer.playMedia.useMutation,$.mediaPlayer.getStatus.useQuery,$.meshNetwork.getStatus.useQuery,$.meshNetwork.join.useMutation,$.meshNetwork.startLogin.useMutation,$.meshNetwork.leave.useMutation,$.meshNetwork.logout.useMutation,$.meshNetwork.listPeers.useQuery,$.meshNetwork.testConnection.useMutation,$.metricsProvider.collectSnapshot.useQuery,$.metricsProvider.getCached.useQuery,$.metricsProvider.getCurrent.useQuery,$.metricsProvider.getDiskSpace.useQuery,$.metricsProvider.getGpuInfo.useQuery,$.metricsProvider.getCpuTemperature.useQuery,$.metricsProvider.getProcessStats.useQuery,$.metricsProvider.listAddonInstances.useQuery,$.metricsProvider.getAddonStats.useQuery,$.metricsProvider.listNodeProcesses.useQuery,$.metricsProvider.killProcess.useMutation,$.metricsProvider.dumpHeapSnapshot.useMutation,$.motion.isDetected.useQuery,$.motion.getStatus.useQuery,$.motionDetection.analyze.useMutation,$.motionDetection.removeCamera.useMutation,$.motionDetection.reset.useMutation,$.motionDetection.getDeviceSettingsContribution.useQuery,$.motionDetection.getDeviceLiveContribution.useQuery,$.motionDetection.applyDeviceSettingsPatch.useMutation,$.motionTrigger.setMotionTrigger.useMutation,$.motionTrigger.getStatus.useQuery,$.motionZones.getOptions.useQuery,$.motionZones.setZone.useMutation,$.motionZones.getStatus.useQuery,$.mqttBroker.listBrokers.useQuery,$.mqttBroker.getBrokerConfig.useQuery,$.mqttBroker.addBroker.useMutation,$.mqttBroker.removeBroker.useMutation,$.mqttBroker.testConnection.useMutation,$.mqttBroker.startEmbeddedBroker.useMutation,$.mqttBroker.stopEmbeddedBroker.useMutation,$.mqttBroker.getStatus.useQuery,$.nativeObjectDetection.setEnabled.useMutation,$.nativeObjectDetection.getStatus.useQuery,$.networkAccess.start.useMutation,$.networkAccess.stop.useMutation,$.networkAccess.getEndpoint.useQuery,$.networkAccess.getStatus.useQuery,$.networkAccess.listEndpoints.useQuery,$.networkQuality.getDeviceStats.useQuery,$.networkQuality.getAllStats.useQuery,$.networkQuality.reportClientStats.useMutation,$.nodes.topology.useQuery,$.nodes.deployAddon.useMutation,$.nodes.undeployAddon.useMutation,$.nodes.restartAddon.useMutation,$.nodes.restartProcess.useMutation,$.nodes.restartNode.useMutation,$.nodes.shutdownNode.useMutation,$.nodes.renameNode.useMutation,$.nodes.clusterAddonStatus.useQuery,$.nodes.getCapUsageGraph.useQuery,$.nodes.getNodeAddons.useQuery,$.nodes.setProcessLogLevel.useMutation,$.nodes.executeQuery.useMutation,$.notificationOutput.send.useMutation,$.notificationOutput.sendTest.useMutation,$.notifier.send.useMutation,$.notifier.cancel.useMutation,$.notifier.getStatus.useQuery,$.numericSensor.getStatus.useQuery,$.osd.setOverlay.useMutation,$.osd.getStatus.useQuery,$.pipelineAnalytics.getActiveTracks.useQuery,$.pipelineAnalytics.getTrack.useQuery,$.pipelineAnalytics.listTracks.useQuery,$.pipelineAnalytics.clearTracks.useMutation,$.pipelineAnalytics.getMotionEvents.useQuery,$.pipelineAnalytics.getObjectEvents.useQuery,$.pipelineAnalytics.getAudioEvents.useQuery,$.pipelineAnalytics.getEventDensity.useQuery,$.pipelineAnalytics.pruneEventsBefore.useMutation,$.pipelineAnalytics.getEventMedia.useQuery,$.pipelineAnalytics.getTrackMedia.useQuery,$.pipelineAnalytics.getDeviceSettingsContribution.useQuery,$.pipelineAnalytics.getDeviceLiveContribution.useQuery,$.pipelineAnalytics.applyDeviceSettingsPatch.useMutation,$.pipelineExecutor.getAvailableEngines.useQuery,$.pipelineExecutor.getSelectedEngine.useQuery,$.pipelineExecutor.getDefaultSteps.useQuery,$.pipelineExecutor.reprobeEngine.useMutation,$.pipelineExecutor.getEngineProvisioning.useQuery,$.pipelineExecutor.getVideoPipelineSteps.useQuery,$.pipelineExecutor.setVideoPipelineSteps.useMutation,$.pipelineExecutor.getSchema.useQuery,$.pipelineExecutor.getGlobalSteps.useQuery,$.pipelineExecutor.getGlobalPipelineConfig.useQuery,$.pipelineExecutor.getOrchestratorConfigSchema.useQuery,$.pipelineExecutor.listTemplates.useQuery,$.pipelineExecutor.saveTemplate.useMutation,$.pipelineExecutor.updateTemplate.useMutation,$.pipelineExecutor.deleteTemplate.useMutation,$.pipelineExecutor.getCapabilities.useQuery,$.pipelineExecutor.getAddonModels.useQuery,$.pipelineExecutor.downloadModel.useMutation,$.pipelineExecutor.deleteModel.useMutation,$.pipelineExecutor.detect.useQuery,$.pipelineExecutor.runPipeline.useMutation,$.pipelineExecutor.runPipelineBatch.useMutation,$.pipelineExecutor.cacheFrameInPool.useMutation,$.pipelineExecutor.inferCached.useMutation,$.pipelineExecutor.uncacheFrame.useMutation,$.pipelineExecutor.getEffectiveTuning.useQuery,$.pipelineExecutor.listLoadedEngines.useQuery,$.pipelineExecutor.spinEngine.useMutation,$.pipelineExecutor.killEngine.useMutation,$.pipelineExecutor.listReferenceImages.useQuery,$.pipelineExecutor.getReferenceImage.useQuery,$.pipelineExecutor.getReferenceAudioFiles.useQuery,$.pipelineExecutor.getReferenceAudio.useQuery,$.pipelineExecutor.getAudioCapabilities.useQuery,$.pipelineExecutor.runAudioTest.useMutation,$.pipelineExecutor.getDetectionConfigSchema.useQuery,$.pipelineOrchestrator.assignPipeline.useMutation,$.pipelineOrchestrator.unassignPipeline.useMutation,$.pipelineOrchestrator.rebalance.useMutation,$.pipelineOrchestrator.getPipelineAssignments.useQuery,$.pipelineOrchestrator.getPipelineAssignment.useQuery,$.pipelineOrchestrator.getAgentLoad.useQuery,$.pipelineOrchestrator.getGlobalMetrics.useQuery,$.pipelineOrchestrator.getCameraMetrics.useQuery,$.pipelineOrchestrator.getCapabilityBindings.useQuery,$.pipelineOrchestrator.setCapabilityBinding.useMutation,$.pipelineOrchestrator.assignDecoder.useMutation,$.pipelineOrchestrator.unassignDecoder.useMutation,$.pipelineOrchestrator.getDecoderAssignments.useQuery,$.pipelineOrchestrator.assignAudio.useMutation,$.pipelineOrchestrator.unassignAudio.useMutation,$.pipelineOrchestrator.getAudioAssignment.useQuery,$.pipelineOrchestrator.getAudioNodeLoad.useQuery,$.pipelineOrchestrator.getAudioAssignments.useQuery,$.pipelineOrchestrator.getDecoderAssignment.useQuery,$.pipelineOrchestrator.getAgentSettings.useQuery,$.pipelineOrchestrator.listAgentSettings.useQuery,$.pipelineOrchestrator.setAgentAddonDefaults.useMutation,$.pipelineOrchestrator.removeAgentSettings.useMutation,$.pipelineOrchestrator.setAgentMaxCameras.useMutation,$.pipelineOrchestrator.getCameraSettings.useQuery,$.pipelineOrchestrator.setCameraStepToggle.useMutation,$.pipelineOrchestrator.getCameraStepOverrides.useQuery,$.pipelineOrchestrator.setCameraStepOverride.useMutation,$.pipelineOrchestrator.setCameraPipelineForAgent.useMutation,$.pipelineOrchestrator.resolvePipeline.useQuery,$.pipelineOrchestrator.getCameraStatus.useQuery,$.pipelineOrchestrator.getCameraStatuses.useQuery,$.pipelineOrchestrator.listTemplates.useQuery,$.pipelineOrchestrator.saveTemplate.useMutation,$.pipelineOrchestrator.updateTemplate.useMutation,$.pipelineOrchestrator.deleteTemplate.useMutation,$.pipelineOrchestrator.getDeviceSettingsContribution.useQuery,$.pipelineOrchestrator.getDeviceLiveContribution.useQuery,$.pipelineOrchestrator.applyDeviceSettingsPatch.useMutation,$.pipelineRunner.attachCamera.useMutation,$.pipelineRunner.detachCamera.useMutation,$.pipelineRunner.reportMotion.useMutation,$.pipelineRunner.getLocalLoad.useQuery,$.pipelineRunner.getLocalMetrics.useQuery,$.pipelineRunner.getCameraMetrics.useQuery,$.pipelineRunner.getAllCameraMetrics.useQuery,$.pipelineRunner.getLocalCameras.useQuery,$.plateGallery.listPlates.useQuery,$.plateGallery.getPlateByTrack.useQuery,$.plateGallery.getPlateMedia.useQuery,$.plateGallery.searchPlates.useQuery,$.plateGallery.suggestPlateClusters.useQuery,$.plateGallery.correctPlateText.useMutation,$.plateGallery.deletePlate.useMutation,$.powerMeter.getStatus.useQuery,$.presence.getStatus.useQuery,$.pressureSensor.getStatus.useQuery,$.privacyMask.getOptions.useQuery,$.privacyMask.setMask.useMutation,$.privacyMask.getStatus.useQuery,$.ptz.move.useMutation,$.ptz.continuousMove.useMutation,$.ptz.stop.useMutation,$.ptz.getPresets.useQuery,$.ptz.goToPreset.useMutation,$.ptz.savePreset.useMutation,$.ptz.deletePreset.useMutation,$.ptz.getOptions.useQuery,$.ptz.goHome.useMutation,$.ptz.getPosition.useQuery,$.ptz.setAutofocus.useMutation,$.ptz.getStatus.useQuery,$.ptzAutotrack.getStatus.useQuery,$.ptzAutotrack.setEnabled.useMutation,$.ptzAutotrack.getSettings.useQuery,$.ptzAutotrack.setSettings.useMutation,$.reboot.reboot.useMutation,$.recording.getAvailability.useQuery,$.recording.getDaysWithRecordings.useQuery,$.recording.getPlaybackManifest.useQuery,$.recording.getStorageUsage.useQuery,$.recording.getDeviceConfig.useQuery,$.recording.locateSegment.useQuery,$.recording.readSegmentBytes.useQuery,$.recording.setDeviceConfig.useMutation,$.recording.rescanStorage.useMutation,$.recording.pruneFootage.useMutation,$.recording.getStatus.useQuery,$.recording.getDeviceSettingsContribution.useQuery,$.recording.getDeviceLiveContribution.useQuery,$.recording.applyDeviceSettingsPatch.useMutation,$.scriptRunner.run.useMutation,$.scriptRunner.stop.useMutation,$.scriptRunner.getStatus.useQuery,$.settingsStore.get.useQuery,$.settingsStore.set.useMutation,$.settingsStore.query.useQuery,$.settingsStore.insert.useMutation,$.settingsStore.update.useMutation,$.settingsStore.delete.useMutation,$.settingsStore.count.useQuery,$.settingsStore.histogram.useQuery,$.settingsStore.isEmpty.useQuery,$.settingsStore.declareCollection.useMutation,$.smoke.getStatus.useQuery,$.snapshot.getSnapshot.useQuery,$.snapshot.invalidateCache.useMutation,$.snapshot.getStatus.useQuery,$.snapshot.getDeviceSettingsContribution.useQuery,$.snapshot.getDeviceLiveContribution.useQuery,$.snapshot.applyDeviceSettingsPatch.useMutation,$.snapshotProvider.supportsDevice.useQuery,$.snapshotProvider.getSnapshot.useQuery,$.storage.resolve.useQuery,$.storage.write.useMutation,$.storage.read.useQuery,$.storage.exists.useQuery,$.storage.list.useQuery,$.storage.delete.useMutation,$.storage.getAvailableSpace.useQuery,$.storage.beginUpload.useMutation,$.storage.writeChunk.useMutation,$.storage.finalizeUpload.useMutation,$.storage.abortUpload.useMutation,$.storage.beginDownload.useMutation,$.storage.readChunk.useQuery,$.storage.endDownload.useMutation,$.storage.listLocations.useQuery,$.storage.getDefaultLocation.useQuery,$.storage.listLocationDeclarations.useQuery,$.storage.upsertLocation.useMutation,$.storage.deleteLocation.useMutation,$.storage.testLocation.useQuery,$.storage.listProviders.useQuery,$.storage.testConfig.useQuery,$.streamBroker.publishCameraStream.useMutation,$.streamBroker.retractCameraStream.useMutation,$.streamBroker.assignProfile.useMutation,$.streamBroker.unassignProfile.useMutation,$.streamBroker.listAllCameraStreams.useQuery,$.streamBroker.listAllProfileSlots.useQuery,$.streamBroker.getBrokerStats.useQuery,$.streamBroker.probeStream.useMutation,$.streamBroker.listClients.useQuery,$.streamBroker.killClient.useMutation,$.streamBroker.restartProfile.useMutation,$.streamBroker.getStreamUrl.useQuery,$.streamBroker.getStreamWithCodec.useMutation,$.streamBroker.releaseStreamWithCodec.useMutation,$.streamBroker.subscribeAudioChunks.useMutation,$.streamBroker.pullAudioChunks.useQuery,$.streamBroker.unsubscribeAudioChunks.useMutation,$.streamBroker.subscribeFrames.useMutation,$.streamBroker.pullFrameHandles.useQuery,$.streamBroker.unsubscribeFrames.useMutation,$.streamBroker.setPreBufferDuration.useMutation,$.streamBroker.getPreBufferInfo.useQuery,$.streamBroker.getRtspPort.useQuery,$.streamBroker.getAllRtspEntries.useQuery,$.streamBroker.getRtspEntry.useQuery,$.streamBroker.regenerateRtspToken.useMutation,$.streamBroker.setRtspEnabled.useMutation,$.streamBroker.isRtspEnabled.useQuery,$.streamBroker.getDeviceSettingsContribution.useQuery,$.streamBroker.getDeviceLiveContribution.useQuery,$.streamBroker.applyDeviceSettingsPatch.useMutation,$.streamCatalog.getCatalog.useQuery,$.streamParams.getOptions.useQuery,$.streamParams.setProfile.useMutation,$.streamParams.getConfigSchema.useQuery,$.streamParams.getStatus.useQuery,$.switch.setState.useMutation,$.switch.getStatus.useQuery,$.system.info.useQuery,$.system.health.useQuery,$.system.featureFlags.useQuery,$.system.networkAddresses.useQuery,$.system.getRetentionConfig.useQuery,$.system.setRetentionConfig.useMutation,$.system.forceRetentionCleanup.useMutation,$.tamper.getStatus.useQuery,$.temperatureSensor.getStatus.useQuery,$.toast.onToast.useSubscription,$.turnProvider.getTurnServers.useQuery,$.update.installUpdate.useMutation,$.update.getStatus.useQuery,$.userManagement.listUsers.useQuery,$.userManagement.createUser.useMutation,$.userManagement.updateUser.useMutation,$.userManagement.deleteUser.useMutation,$.userManagement.resetPassword.useMutation,$.userManagement.setUserScopes.useMutation,$.userManagement.validateCredentials.useMutation,$.userManagement.listApiKeys.useQuery,$.userManagement.createApiKey.useMutation,$.userManagement.revokeApiKey.useMutation,$.userManagement.validateApiKey.useMutation,$.userManagement.createScopedToken.useMutation,$.userManagement.revokeScopedToken.useMutation,$.userManagement.validateScopedToken.useQuery,$.userManagement.listScopedTokens.useQuery,$.userManagement.setupTotp.useMutation,$.userManagement.confirmTotp.useMutation,$.userManagement.disableTotp.useMutation,$.userManagement.getTotpStatus.useQuery,$.userManagement.verifyTotp.useMutation,$.userManagement.oauthIssueCode.useMutation,$.userManagement.oauthExchangeCode.useMutation,$.userManagement.oauthRefresh.useMutation,$.userManagement.oauthVerifyAccessToken.useQuery,$.userManagement.listOauthSessions.useQuery,$.userManagement.revokeOauthSession.useMutation,$.vacuumControl.start.useMutation,$.vacuumControl.pause.useMutation,$.vacuumControl.stop.useMutation,$.vacuumControl.returnToBase.useMutation,$.vacuumControl.locate.useMutation,$.vacuumControl.setFanSpeed.useMutation,$.vacuumControl.getStatus.useQuery,$.valve.open.useMutation,$.valve.close.useMutation,$.valve.stop.useMutation,$.valve.setPosition.useMutation,$.valve.getStatus.useQuery,$.vibration.getStatus.useQuery,$.videoclips.listClips.useQuery,$.videoclips.getClipPlayback.useQuery,$.waterHeater.setTargetTemp.useMutation,$.waterHeater.setOperationMode.useMutation,$.waterHeater.setAway.useMutation,$.waterHeater.getStatus.useQuery,$.weather.getStatus.useQuery,$.webrtcSession.listStreams.useQuery,$.webrtcSession.createSession.useMutation,$.webrtcSession.handleOffer.useMutation,$.webrtcSession.handleAnswer.useMutation,$.webrtcSession.addIceCandidate.useMutation,$.webrtcSession.getIceCandidates.useQuery,$.webrtcSession.closeSession.useMutation,$.webrtcSession.hasAdaptiveBitrate.useQuery,$.webrtcSession.getSessionState.useQuery,$.zoneAnalytics.getCurrentSnapshot.useQuery,$.zoneAnalytics.getZoneHistory.useQuery,$.zoneAnalytics.getCameraHistory.useQuery,$.zoneAnalytics.getUnzonedHistory.useQuery,$.zoneRules.listRules.useQuery,$.zoneRules.setRules.useMutation,$.zones.listZones.useQuery,$.zones.addZone.useMutation,$.zones.removeZone.useMutation,$.zones.updateZone.useMutation;var QN=176,$N=76;270/360*(2*Math.PI*$N),QN/2-$N-10,270/360*(2*Math.PI*64),K.Cover,K.Valve,K.Humidifier,K.WaterHeater,K.Camera,K.Hub,K.Switch,K.Siren,K.Light,K.Fan,K.Sensor,K.Thermostat,K.Button,K.EventEmitter,K.Update,K.Generic,K.Notifier,K.Script,K.Automation,K.Lock,K.MediaPlayer,K.AlarmPanel,K.Control,K.Presence,K.Weather,K.Vacuum,K.LawnMower,K.Container,K.Image,K.Cover,K.Valve,K.Thermostat,K.Control,K.Button,K.MediaPlayer,K.AlarmPanel,K.Lock,K.Vacuum,K.LawnMower,K.Humidifier,K.Switch,K.Siren,K.Light,K.Fan,K.WaterHeater,K.Sensor,K.Presence,K.EventEmitter,K.Notifier,K.Script,K.Automation,K.Camera,K.Hub,K.Update,K.Generic,K.Weather,K.Container,K.Image,new Set(Object.values(K)),new Set([K.Sensor,K.Presence]),Object.freeze([]);var eP=class{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set(e,t){this.keyToValue.set(e,t),this.valueToKey.set(t,e)}getByKey(e){return this.keyToValue.get(e)}getByValue(e){return this.valueToKey.get(e)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}},tP=class{constructor(e){this.generateIdentifier=e,this.kv=new eP}register(e,t){this.kv.getByValue(e)||(t||=this.generateIdentifier(e),this.kv.set(t,e))}clear(){this.kv.clear()}getIdentifier(e){return this.kv.getByValue(e)}getValue(e){return this.kv.getByKey(e)}},nP=class extends tP{constructor(){super(e=>e.name),this.classToAllowedProps=new Map}register(e,t){typeof t==`object`?(t.allowProps&&this.classToAllowedProps.set(e,t.allowProps),super.register(e,t.identifier)):super.register(e,t)}getAllowedProps(e){return this.classToAllowedProps.get(e)}};function rP(e){if(`values`in Object)return Object.values(e);let t=[];for(let n in e)e.hasOwnProperty(n)&&t.push(e[n]);return t}function iP(e,t){let n=rP(e);if(`find`in n)return n.find(t);let r=n;for(let e=0;e<r.length;e++){let n=r[e];if(t(n))return n}}function aP(e,t){Object.entries(e).forEach(([e,n])=>t(n,e))}function oP(e,t){return e.indexOf(t)!==-1}function sP(e,t){for(let n=0;n<e.length;n++){let r=e[n];if(t(r))return r}}var cP=class{constructor(){this.transfomers={}}register(e){this.transfomers[e.name]=e}findApplicable(e){return iP(this.transfomers,t=>t.isApplicable(e))}findByName(e){return this.transfomers[e]}},lP=e=>Object.prototype.toString.call(e).slice(8,-1),uP=e=>e===void 0,dP=e=>e===null,fP=e=>typeof e!=`object`||!e||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype,pP=e=>fP(e)&&Object.keys(e).length===0,mP=e=>Array.isArray(e),hP=e=>typeof e==`string`,gP=e=>typeof e==`number`&&!isNaN(e),_P=e=>typeof e==`boolean`,vP=e=>e instanceof RegExp,yP=e=>e instanceof Map,bP=e=>e instanceof Set,xP=e=>lP(e)===`Symbol`,SP=e=>e instanceof Date&&!isNaN(e.valueOf()),CP=e=>e instanceof Error,wP=e=>typeof e==`number`&&isNaN(e),TP=e=>_P(e)||dP(e)||uP(e)||gP(e)||hP(e)||xP(e),EP=e=>typeof e==`bigint`,DP=e=>e===1/0||e===-1/0,OP=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),kP=e=>e instanceof URL,AP=e=>e.replace(/\\/g,`\\\\`).replace(/\./g,`\\.`),jP=e=>e.map(String).map(AP).join(`.`),MP=(e,t)=>{let n=[],r=``;for(let a=0;a<e.length;a++){let o=e.charAt(a);if(!t&&o===`\\`){let t=e.charAt(a+1);if(t===`\\`){r+=`\\`,a++;continue}else if(t!==`.`)throw Error(`invalid path`)}if(o===`\\`&&e.charAt(a+1)===`.`){r+=`.`,a++;continue}if(o===`.`){n.push(r),r=``;continue}r+=o}let a=r;return n.push(a),n};function NP(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var PP=[NP(uP,`undefined`,()=>null,()=>void 0),NP(EP,`bigint`,e=>e.toString(),e=>typeof BigInt<`u`?BigInt(e):(console.error(`Please add a BigInt polyfill.`),e)),NP(SP,`Date`,e=>e.toISOString(),e=>new Date(e)),NP(CP,`Error`,(e,t)=>{let n={name:e.name,message:e.message};return`cause`in e&&(n.cause=e.cause),t.allowedErrorProps.forEach(t=>{n[t]=e[t]}),n},(e,t)=>{let n=Error(e.message,{cause:e.cause});return n.name=e.name,n.stack=e.stack,t.allowedErrorProps.forEach(t=>{n[t]=e[t]}),n}),NP(vP,`regexp`,e=>``+e,e=>{let t=e.slice(1,e.lastIndexOf(`/`)),n=e.slice(e.lastIndexOf(`/`)+1);return new RegExp(t,n)}),NP(bP,`set`,e=>[...e.values()],e=>new Set(e)),NP(yP,`map`,e=>[...e.entries()],e=>new Map(e)),NP(e=>wP(e)||DP(e),`number`,e=>wP(e)?`NaN`:e>0?`Infinity`:`-Infinity`,Number),NP(e=>e===0&&1/e==-1/0,`number`,()=>`-0`,Number),NP(kP,`URL`,e=>e.toString(),e=>new URL(e))];function FP(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var IP=FP((e,t)=>xP(e)?!!t.symbolRegistry.getIdentifier(e):!1,(e,t)=>[`symbol`,t.symbolRegistry.getIdentifier(e)],e=>e.description,(e,t,n)=>{let r=n.symbolRegistry.getValue(t[1]);if(!r)throw Error(`Trying to deserialize unknown symbol`);return r}),LP=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),RP=FP(OP,e=>[`typed-array`,e.constructor.name],e=>[...e],(e,t)=>{let n=LP[t[1]];if(!n)throw Error(`Trying to deserialize unknown typed array`);return new n(e)});function zP(e,t){return e?.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}var BP=FP(zP,(e,t)=>[`class`,t.classRegistry.getIdentifier(e.constructor)],(e,t)=>{let n=t.classRegistry.getAllowedProps(e.constructor);if(!n)return{...e};let r={};return n.forEach(t=>{r[t]=e[t]}),r},(e,t,n)=>{let r=n.classRegistry.getValue(t[1]);if(!r)throw Error(`Trying to deserialize unknown class '${t[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);return Object.assign(Object.create(r.prototype),e)}),VP=FP((e,t)=>!!t.customTransformerRegistry.findApplicable(e),(e,t)=>[`custom`,t.customTransformerRegistry.findApplicable(e).name],(e,t)=>t.customTransformerRegistry.findApplicable(e).serialize(e),(e,t,n)=>{let r=n.customTransformerRegistry.findByName(t[1]);if(!r)throw Error(`Trying to deserialize unknown custom value`);return r.deserialize(e)}),HP=[BP,IP,VP,RP],UP=(e,t)=>{let n=sP(HP,n=>n.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};let r=sP(PP,n=>n.isApplicable(e,t));if(r)return{value:r.transform(e,t),type:r.annotation}},WP={};PP.forEach(e=>{WP[e.annotation]=e});var GP=(e,t,n)=>{if(mP(t))switch(t[0]){case`symbol`:return IP.untransform(e,t,n);case`class`:return BP.untransform(e,t,n);case`custom`:return VP.untransform(e,t,n);case`typed-array`:return RP.untransform(e,t,n);default:throw Error(`Unknown transformation: `+t)}else{let r=WP[t];if(!r)throw Error(`Unknown transformation: `+t);return r.untransform(e,n)}},KP=(e,t)=>{if(t>e.size)throw Error(`index out of bounds`);let n=e.keys();for(;t>0;)n.next(),t--;return n.next().value};function qP(e){if(oP(e,`__proto__`))throw Error(`__proto__ is not allowed as a property`);if(oP(e,`prototype`))throw Error(`prototype is not allowed as a property`);if(oP(e,`constructor`))throw Error(`constructor is not allowed as a property`)}var JP=(e,t)=>{qP(t);for(let n=0;n<t.length;n++){let r=t[n];if(bP(e))e=KP(e,+r);else if(yP(e)){let a=+r,o=+t[++n]==0?`key`:`value`,s=KP(e,a);switch(o){case`key`:e=s;break;case`value`:e=e.get(s);break}}else e=e[r]}return e},YP=(e,t,n)=>{if(qP(t),t.length===0)return n(e);let r=e;for(let e=0;e<t.length-1;e++){let n=t[e];if(mP(r)){let e=+n;r=r[e]}else if(fP(r))r=r[n];else if(bP(r)){let e=+n;r=KP(r,e)}else if(yP(r)){if(e===t.length-2)break;let a=+n,o=+t[++e]==0?`key`:`value`,s=KP(r,a);switch(o){case`key`:r=s;break;case`value`:r=r.get(s);break}}}let a=t[t.length-1];if(mP(r)?r[+a]=n(r[+a]):fP(r)&&(r[a]=n(r[a])),bP(r)){let e=KP(r,+a),t=n(e);e!==t&&(r.delete(e),r.add(t))}if(yP(r)){let e=+t[t.length-2],o=KP(r,e);switch(+a==0?`key`:`value`){case`key`:{let e=n(o);r.set(e,r.get(o)),e!==o&&r.delete(o);break}case`value`:r.set(o,n(r.get(o)));break}}return e},XP=e=>e<1;function ZP(e,t,n,r=[]){if(!e)return;let a=XP(n);if(!mP(e)){aP(e,(e,o)=>ZP(e,t,n,[...r,...MP(o,a)]));return}let[o,s]=e;s&&aP(s,(e,o)=>{ZP(e,t,n,[...r,...MP(o,a)])}),t(o,r)}function QP(e,t,n,r){return ZP(t,(t,n)=>{e=YP(e,n,e=>GP(e,t,r))},n),e}function $P(e,t,n){let r=XP(n);function a(t,n){let a=JP(e,MP(n,r));t.map(e=>MP(e,r)).forEach(t=>{e=YP(e,t,()=>a)})}if(mP(t)){let[n,o]=t;n.forEach(t=>{e=YP(e,MP(t,r),()=>e)}),o&&aP(o,a)}else aP(t,a);return e}var eF=(e,t)=>fP(e)||mP(e)||yP(e)||bP(e)||CP(e)||zP(e,t);function tF(e,t,n){let r=n.get(e);r?r.push(t):n.set(e,[t])}function nF(e,t){let n={},r;return e.forEach(e=>{if(e.length<=1)return;t||(e=e.map(e=>e.map(String)).sort((e,t)=>e.length-t.length));let[a,...o]=e;a.length===0?r=o.map(jP):n[jP(a)]=o.map(jP)}),r?pP(n)?[r]:[r,n]:pP(n)?void 0:n}var rF=(e,t,n,r,a=[],o=[],s=new Map)=>{let c=TP(e);if(!c){tF(e,a,t);let n=s.get(e);if(n)return r?{transformedValue:null}:n}if(!eF(e,n)){let t=UP(e,n),r=t?{transformedValue:t.value,annotations:[t.type]}:{transformedValue:e};return c||s.set(e,r),r}if(oP(o,e))return{transformedValue:null};let l=UP(e,n),u=l?.value??e,d=mP(u)?[]:{},f={};aP(u,(c,l)=>{if(l===`__proto__`||l===`constructor`||l===`prototype`)throw Error(`Detected property ${l}. This is a prototype pollution risk, please remove it from your object.`);let u=rF(c,t,n,r,[...a,l],[...o,e],s);d[l]=u.transformedValue,mP(u.annotations)?f[AP(l)]=u.annotations:fP(u.annotations)&&aP(u.annotations,(e,t)=>{f[AP(l)+`.`+t]=e})});let p=pP(f)?{transformedValue:d,annotations:l?[l.type]:void 0}:{transformedValue:d,annotations:l?[l.type,f]:f};return c||s.set(e,p),p};function iF(e){return Object.prototype.toString.call(e).slice(8,-1)}function aF(e){return iF(e)===`Array`}function oF(e){if(iF(e)!==`Object`)return!1;let t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function sF(e,t,n,r,a){let o={}.propertyIsEnumerable.call(r,t)?`enumerable`:`nonenumerable`;o===`enumerable`&&(e[t]=n),a&&o===`nonenumerable`&&Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}function cF(e,t={}){if(aF(e))return e.map(e=>cF(e,t));if(!oF(e))return e;let n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertySymbols(e);return[...n,...r].reduce((n,r)=>{if(r===`__proto__`||aF(t.props)&&!t.props.includes(r))return n;let a=e[r];return sF(n,r,cF(a,t),e,t.nonenumerable),n},{})}var lF=class{constructor({dedupe:e=!1}={}){this.classRegistry=new nP,this.symbolRegistry=new tP(e=>e.description??``),this.customTransformerRegistry=new cP,this.allowedErrorProps=[],this.dedupe=e}serialize(e){let t=new Map,n=rF(e,t,this,this.dedupe),r={json:n.transformedValue};n.annotations&&(r.meta={...r.meta,values:n.annotations});let a=nF(t,this.dedupe);return a&&(r.meta={...r.meta,referentialEqualities:a}),r.meta&&(r.meta.v=1),r}deserialize(e,t){let{json:n,meta:r}=e,a=t?.inPlace?n:cF(n);return r?.values&&(a=QP(a,r.values,r.v??0,this)),r?.referentialEqualities&&(a=$P(a,r.referentialEqualities,r.v??0)),a}stringify(e){return JSON.stringify(this.serialize(e))}parse(e){return this.deserialize(JSON.parse(e),{inPlace:!0})}registerClass(e,t){this.classRegistry.register(e,t)}registerSymbol(e,t){this.symbolRegistry.register(e,t)}registerCustom(e,t){this.customTransformerRegistry.register({name:t,...e})}allowErrorProps(...e){this.allowedErrorProps.push(...e)}};lF.defaultInstance=new lF,lF.serialize=lF.defaultInstance.serialize.bind(lF.defaultInstance),lF.deserialize=lF.defaultInstance.deserialize.bind(lF.defaultInstance),lF.stringify=lF.defaultInstance.stringify.bind(lF.defaultInstance),lF.parse=lF.defaultInstance.parse.bind(lF.defaultInstance),lF.registerClass=lF.defaultInstance.registerClass.bind(lF.defaultInstance),lF.registerSymbol=lF.defaultInstance.registerSymbol.bind(lF.defaultInstance),lF.registerCustom=lF.defaultInstance.registerCustom.bind(lF.defaultInstance),lF.allowErrorProps=lF.defaultInstance.allowErrorProps.bind(lF.defaultInstance),lF.serialize,lF.deserialize,lF.stringify,lF.parse,lF.registerClass,lF.registerCustom,lF.registerSymbol,lF.allowErrorProps,(0,x.createContext)(null),FO(`camstack:custom-field-renderers`,{}),FO(`camstack:device-context`,null),FO(`camstack:widget-registry`,null);function uF({title:e,icon:t,headerRight:n,collapsible:r=!1,defaultOpen:a=!0,bodyClassName:o=`p-3`,children:s}){let[c,l]=(0,x.useState)(a),u=!r||c,d=(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`span`,{className:`flex items-center gap-2 text-xs font-semibold uppercase tracking-wider text-foreground`,children:[t,e]}),r?c?(0,S.jsx)(WM,{className:`h-3.5 w-3.5 text-foreground-subtle`}):(0,S.jsx)(GM,{className:`h-3.5 w-3.5 text-foreground-subtle`}):n]}),f=`px-4 py-2 flex items-center justify-between ${u?`border-b border-border`:``}`;return(0,S.jsxs)(`div`,{className:`rounded-lg border border-border bg-surface overflow-hidden`,children:[r?(0,S.jsx)(`button`,{type:`button`,onClick:()=>l(e=>!e),className:`w-full text-left ${f}`,children:d}):(0,S.jsx)(`div`,{className:f,children:d}),u?(0,S.jsx)(`div`,{className:o,children:s}):null]})}FO(`camstack:vod-playback`,{request:null,play:()=>{},clear:()=>{}}),(0,x.lazy)(()=>tD(()=>import(`./MotionZonesSettings-C1EEbk2V-CYtJc892.js`).then(e=>({default:e.MotionZonesSettings})),__vite__mapDeps([0,1]),import.meta.url)),(0,x.lazy)(()=>tD(()=>import(`./PrivacyMaskSettings-APgPLF7p-C2SRtNe6.js`).then(e=>({default:e.PrivacyMaskSettings})),__vite__mapDeps([2,1]),import.meta.url));var dF=Object.defineProperty,fF=Object.getOwnPropertySymbols,pF=Object.prototype.hasOwnProperty,mF=Object.prototype.propertyIsEnumerable,hF=(e,t,n)=>t in e?dF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gF=(e,t)=>{for(var n in t||={})pF.call(t,n)&&hF(e,n,t[n]);if(fF)for(var n of fF(t))mF.call(t,n)&&hF(e,n,t[n]);return e},_F=(e,t)=>{var n={};for(var r in e)pF.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&fF)for(var r of fF(e))t.indexOf(r)<0&&mF.call(e,r)&&(n[r]=e[r]);return n},vF;(e=>{let t=class t{constructor(e,n,r,o){if(this.version=e,this.errorCorrectionLevel=n,this.modules=[],this.isFunction=[],e<t.MIN_VERSION||e>t.MAX_VERSION)throw RangeError(`Version value out of range`);if(o<-1||o>7)throw RangeError(`Mask value out of range`);this.size=e*4+17;let s=[];for(let e=0;e<this.size;e++)s.push(!1);for(let e=0;e<this.size;e++)this.modules.push(s.slice()),this.isFunction.push(s.slice());this.drawFunctionPatterns();let c=this.addEccAndInterleave(r);if(this.drawCodewords(c),o==-1){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);let n=this.getPenaltyScore();n<e&&(o=t,e=n),this.applyMask(t)}}a(0<=o&&o<=7),this.mask=o,this.applyMask(o),this.drawFormatBits(o),this.isFunction=[]}static encodeText(n,r){let a=e.QrSegment.makeSegments(n);return t.encodeSegments(a,r)}static encodeBinary(n,r){let a=e.QrSegment.makeBytes(n);return t.encodeSegments([a],r)}static encodeSegments(e,r,o=1,c=40,l=-1,u=!0){if(!(t.MIN_VERSION<=o&&o<=c&&c<=t.MAX_VERSION)||l<-1||l>7)throw RangeError(`Invalid value`);let d,f;for(d=o;;d++){let n=t.getNumDataCodewords(d,r)*8,a=s.getTotalBits(e,d);if(a<=n){f=a;break}if(d>=c)throw RangeError(`Data too long`)}for(let e of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])u&&f<=t.getNumDataCodewords(d,e)*8&&(r=e);let p=[];for(let t of e){n(t.mode.modeBits,4,p),n(t.numChars,t.mode.numCharCountBits(d),p);for(let e of t.getData())p.push(e)}a(p.length==f);let m=t.getNumDataCodewords(d,r)*8;a(p.length<=m),n(0,Math.min(4,m-p.length),p),n(0,(8-p.length%8)%8,p),a(p.length%8==0);for(let e=236;p.length<m;e^=253)n(e,8,p);let h=[];for(;h.length*8<p.length;)h.push(0);return p.forEach((e,t)=>h[t>>>3]|=e<<7-(t&7)),new t(d,r,h,l)}getModule(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]}getModules(){return this.modules}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let e=this.getAlignmentPatternPositions(),t=e.length;for(let n=0;n<t;n++)for(let r=0;r<t;r++)n==0&&r==0||n==0&&r==t-1||n==t-1&&r==0||this.drawAlignmentPattern(e[n],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){let t=this.errorCorrectionLevel.formatBits<<3|e,n=t;for(let e=0;e<10;e++)n=n<<1^(n>>>9)*1335;let o=(t<<10|n)^21522;a(o>>>15==0);for(let e=0;e<=5;e++)this.setFunctionModule(8,e,r(o,e));this.setFunctionModule(8,7,r(o,6)),this.setFunctionModule(8,8,r(o,7)),this.setFunctionModule(7,8,r(o,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,r(o,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,r(o,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,r(o,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^(e>>>11)*7973;let t=this.version<<12|e;a(t>>>18==0);for(let e=0;e<18;e++){let n=r(t,e),a=this.size-11+e%3,o=Math.floor(e/3);this.setFunctionModule(a,o,n),this.setFunctionModule(o,a,n)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let r=-4;r<=4;r++){let a=Math.max(Math.abs(r),Math.abs(n)),o=e+r,s=t+n;0<=o&&o<this.size&&0<=s&&s<this.size&&this.setFunctionModule(o,s,a!=2&&a!=4)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,t+n,Math.max(Math.abs(r),Math.abs(n))!=1)}setFunctionModule(e,t,n){this.modules[t][e]=n,this.isFunction[t][e]=!0}addEccAndInterleave(e){let n=this.version,r=this.errorCorrectionLevel;if(e.length!=t.getNumDataCodewords(n,r))throw RangeError(`Invalid argument`);let o=t.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][n],s=t.ECC_CODEWORDS_PER_BLOCK[r.ordinal][n],c=Math.floor(t.getNumRawDataModules(n)/8),l=o-c%o,u=Math.floor(c/o),d=[],f=t.reedSolomonComputeDivisor(s);for(let n=0,r=0;n<o;n++){let a=e.slice(r,r+u-s+(n<l?0:1));r+=a.length;let o=t.reedSolomonComputeRemainder(a,f);n<l&&a.push(0),d.push(a.concat(o))}let p=[];for(let e=0;e<d[0].length;e++)d.forEach((t,n)=>{(e!=u-s||n>=l)&&p.push(t[e])});return a(p.length==c),p}drawCodewords(e){if(e.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw RangeError(`Invalid argument`);let n=0;for(let t=this.size-1;t>=1;t-=2){t==6&&(t=5);for(let a=0;a<this.size;a++)for(let o=0;o<2;o++){let s=t-o,c=t+1&2?a:this.size-1-a;!this.isFunction[c][s]&&n<e.length*8&&(this.modules[c][s]=r(e[n>>>3],7-(n&7)),n++)}}a(n==e.length*8)}applyMask(e){if(e<0||e>7)throw RangeError(`Mask value out of range`);for(let t=0;t<this.size;t++)for(let n=0;n<this.size;n++){let r;switch(e){case 0:r=(n+t)%2==0;break;case 1:r=t%2==0;break;case 2:r=n%3==0;break;case 3:r=(n+t)%3==0;break;case 4:r=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:r=n*t%2+n*t%3==0;break;case 6:r=(n*t%2+n*t%3)%2==0;break;case 7:r=((n+t)%2+n*t%3)%2==0;break;default:throw Error(`Unreachable`)}!this.isFunction[t][n]&&r&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let n=0;n<this.size;n++){let r=!1,a=0,o=[0,0,0,0,0,0,0];for(let s=0;s<this.size;s++)this.modules[n][s]==r?(a++,a==5?e+=t.PENALTY_N1:a>5&&e++):(this.finderPenaltyAddHistory(a,o),r||(e+=this.finderPenaltyCountPatterns(o)*t.PENALTY_N3),r=this.modules[n][s],a=1);e+=this.finderPenaltyTerminateAndCount(r,a,o)*t.PENALTY_N3}for(let n=0;n<this.size;n++){let r=!1,a=0,o=[0,0,0,0,0,0,0];for(let s=0;s<this.size;s++)this.modules[s][n]==r?(a++,a==5?e+=t.PENALTY_N1:a>5&&e++):(this.finderPenaltyAddHistory(a,o),r||(e+=this.finderPenaltyCountPatterns(o)*t.PENALTY_N3),r=this.modules[s][n],a=1);e+=this.finderPenaltyTerminateAndCount(r,a,o)*t.PENALTY_N3}for(let n=0;n<this.size-1;n++)for(let r=0;r<this.size-1;r++){let a=this.modules[n][r];a==this.modules[n][r+1]&&a==this.modules[n+1][r]&&a==this.modules[n+1][r+1]&&(e+=t.PENALTY_N2)}let n=0;for(let e of this.modules)n=e.reduce((e,t)=>e+ +!!t,n);let r=this.size*this.size,o=Math.ceil(Math.abs(n*20-r*10)/r)-1;return a(0<=o&&o<=9),e+=o*t.PENALTY_N4,a(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(this.version==1)return[];{let e=Math.floor(this.version/7)+2,t=this.version==32?26:Math.ceil((this.version*4+4)/(e*2-2))*2,n=[6];for(let r=this.size-7;n.length<e;r-=t)n.splice(1,0,r);return n}}static getNumRawDataModules(e){if(e<t.MIN_VERSION||e>t.MAX_VERSION)throw RangeError(`Version number out of range`);let n=(16*e+128)*e+64;if(e>=2){let t=Math.floor(e/7)+2;n-=(25*t-10)*t-55,e>=7&&(n-=36)}return a(208<=n&&n<=29648),n}static getNumDataCodewords(e,n){return Math.floor(t.getNumRawDataModules(e)/8)-t.ECC_CODEWORDS_PER_BLOCK[n.ordinal][e]*t.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw RangeError(`Degree out of range`);let n=[];for(let t=0;t<e-1;t++)n.push(0);n.push(1);let r=1;for(let a=0;a<e;a++){for(let e=0;e<n.length;e++)n[e]=t.reedSolomonMultiply(n[e],r),e+1<n.length&&(n[e]^=n[e+1]);r=t.reedSolomonMultiply(r,2)}return n}static reedSolomonComputeRemainder(e,n){let r=n.map(e=>0);for(let a of e){let e=a^r.shift();r.push(0),n.forEach((n,a)=>r[a]^=t.reedSolomonMultiply(n,e))}return r}static reedSolomonMultiply(e,t){if(e>>>8||t>>>8)throw RangeError(`Byte out of range`);let n=0;for(let r=7;r>=0;r--)n=n<<1^(n>>>7)*285,n^=(t>>>r&1)*e;return a(n>>>8==0),n}finderPenaltyCountPatterns(e){let t=e[1];a(t<=this.size*3);let n=t>0&&e[2]==t&&e[3]==t*3&&e[4]==t&&e[5]==t;return(n&&e[0]>=t*4&&e[6]>=t?1:0)+(n&&e[6]>=t*4&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){t[0]==0&&(e+=this.size),t.pop(),t.unshift(e)}};t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;function n(e,t,n){if(t<0||t>31||e>>>t)throw RangeError(`Value out of range`);for(let r=t-1;r>=0;r--)n.push(e>>>r&1)}function r(e,t){return(e>>>t&1)!=0}function a(e){if(!e)throw Error(`Assertion error`)}let o=class e{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw RangeError(`Invalid argument`);this.bitData=n.slice()}static makeBytes(t){let r=[];for(let e of t)n(e,8,r);return new e(e.Mode.BYTE,t.length,r)}static makeNumeric(t){if(!e.isNumeric(t))throw RangeError(`String contains non-numeric characters`);let r=[];for(let e=0;e<t.length;){let a=Math.min(t.length-e,3);n(parseInt(t.substring(e,e+a),10),a*3+1,r),e+=a}return new e(e.Mode.NUMERIC,t.length,r)}static makeAlphanumeric(t){if(!e.isAlphanumeric(t))throw RangeError(`String contains unencodable characters in alphanumeric mode`);let r=[],a;for(a=0;a+2<=t.length;a+=2){let o=e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(a))*45;o+=e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(a+1)),n(o,11,r)}return a<t.length&&n(e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(a)),6,r),new e(e.Mode.ALPHANUMERIC,t.length,r)}static makeSegments(t){return t==``?[]:e.isNumeric(t)?[e.makeNumeric(t)]:e.isAlphanumeric(t)?[e.makeAlphanumeric(t)]:[e.makeBytes(e.toUtf8ByteArray(t))]}static makeEci(t){let r=[];if(t<0)throw RangeError(`ECI assignment value out of range`);if(t<128)n(t,8,r);else if(t<16384)n(2,2,r),n(t,14,r);else if(t<1e6)n(6,3,r),n(t,21,r);else throw RangeError(`ECI assignment value out of range`);return new e(e.Mode.ECI,0,r)}static isNumeric(t){return e.NUMERIC_REGEX.test(t)}static isAlphanumeric(t){return e.ALPHANUMERIC_REGEX.test(t)}getData(){return this.bitData.slice()}static getTotalBits(e,t){let n=0;for(let r of e){let e=r.mode.numCharCountBits(t);if(r.numChars>=1<<e)return 1/0;n+=4+e+r.bitData.length}return n}static toUtf8ByteArray(e){e=encodeURI(e);let t=[];for(let n=0;n<e.length;n++)e.charAt(n)==`%`?(t.push(parseInt(e.substring(n+1,n+3),16)),n+=2):t.push(e.charCodeAt(n));return t}};o.NUMERIC_REGEX=/^[0-9]*$/,o.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,o.ALPHANUMERIC_CHARSET=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`;let s=o;e.QrSegment=o})(vF||={}),(e=>{(e=>{let t=class{constructor(e,t){this.ordinal=e,this.formatBits=t}};t.LOW=new t(0,1),t.MEDIUM=new t(1,0),t.QUARTILE=new t(2,3),t.HIGH=new t(3,2),e.Ecc=t})(e.QrCode||={})})(vF||={}),(e=>{(e=>{let t=class{constructor(e,t){this.modeBits=e,this.numBitsCharCount=t}numCharCountBits(e){return this.numBitsCharCount[Math.floor((e+7)/17)]}};t.NUMERIC=new t(1,[10,12,14]),t.ALPHANUMERIC=new t(2,[9,11,13]),t.BYTE=new t(4,[8,16,16]),t.KANJI=new t(8,[8,10,12]),t.ECI=new t(7,[0,0,0]),e.Mode=t})(e.QrSegment||={})})(vF||={});var yF=vF,bF={L:yF.QrCode.Ecc.LOW,M:yF.QrCode.Ecc.MEDIUM,Q:yF.QrCode.Ecc.QUARTILE,H:yF.QrCode.Ecc.HIGH},xF=128,SF=`L`,CF=`#FFFFFF`,wF=`#000000`,TF=!1,EF=1,DF=4,OF=0,kF=.1;function AF(e,t=0){let n=[];return e.forEach(function(e,r){let a=null;e.forEach(function(o,s){if(!o&&a!==null){n.push(`M${a+t} ${r+t}h${s-a}v1H${a+t}z`),a=null;return}if(s===e.length-1){if(!o)return;a===null?n.push(`M${s+t},${r+t} h1v1H${s+t}z`):n.push(`M${a+t},${r+t} h${s+1-a}v1H${a+t}z`);return}o&&a===null&&(a=s)})}),n.join(``)}function jF(e,t){return e.slice().map((e,n)=>n<t.y||n>=t.y+t.h?e:e.map((e,n)=>n<t.x||n>=t.x+t.w?e:!1))}function MF(e,t,n,r){if(r==null)return null;let a=e.length+n*2,o=Math.floor(t*kF),s=a/t,c=(r.width||o)*s,l=(r.height||o)*s,u=r.x==null?e.length/2-c/2:r.x*s,d=r.y==null?e.length/2-l/2:r.y*s,f=r.opacity==null?1:r.opacity,p=null;if(r.excavate){let e=Math.floor(u),t=Math.floor(d);p={x:e,y:t,w:Math.ceil(c+u-e),h:Math.ceil(l+d-t)}}let m=r.crossOrigin;return{x:u,y:d,h:l,w:c,excavation:p,opacity:f,crossOrigin:m}}function NF(e,t){return t==null?e?DF:OF:Math.max(Math.floor(t),0)}function PF({value:e,level:t,minVersion:n,includeMargin:r,marginSize:a,imageSettings:o,size:s,boostLevel:c}){let l=x.useMemo(()=>{let r=(Array.isArray(e)?e:[e]).reduce((e,t)=>(e.push(...yF.QrSegment.makeSegments(t)),e),[]);return yF.QrCode.encodeSegments(r,bF[t],n,void 0,void 0,c)},[e,t,n,c]),{cells:u,margin:d,numCells:f,calculatedImageSettings:p}=x.useMemo(()=>{let e=l.getModules(),t=NF(r,a);return{cells:e,margin:t,numCells:e.length+t*2,calculatedImageSettings:MF(e,s,t,o)}},[l,s,o,r,a]);return{qrcode:l,margin:d,cells:u,numCells:f,calculatedImageSettings:p}}var FF=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),IF=x.forwardRef(function(e,t){let n=e,{value:r,size:a=xF,level:o=SF,bgColor:s=CF,fgColor:c=wF,includeMargin:l=TF,minVersion:u=EF,boostLevel:d,marginSize:f,imageSettings:p}=n,m=_F(n,[`value`,`size`,`level`,`bgColor`,`fgColor`,`includeMargin`,`minVersion`,`boostLevel`,`marginSize`,`imageSettings`]),{style:h}=m,g=_F(m,[`style`]),_=p?.src,v=x.useRef(null),y=x.useRef(null),b=x.useCallback(e=>{v.current=e,typeof t==`function`?t(e):t&&(t.current=e)},[t]),[ee,S]=x.useState(!1),{margin:C,cells:w,numCells:te,calculatedImageSettings:T}=PF({value:r,level:o,minVersion:u,boostLevel:d,includeMargin:l,marginSize:f,imageSettings:p,size:a});x.useEffect(()=>{if(v.current!=null){let e=v.current,t=e.getContext(`2d`);if(!t)return;let n=w,r=y.current,o=T!=null&&r!==null&&r.complete&&r.naturalHeight!==0&&r.naturalWidth!==0;o&&T.excavation!=null&&(n=jF(w,T.excavation));let l=window.devicePixelRatio||1;e.height=e.width=a*l;let u=a/te*l;t.scale(u,u),t.fillStyle=s,t.fillRect(0,0,te,te),t.fillStyle=c,FF?t.fill(new Path2D(AF(n,C))):w.forEach(function(e,n){e.forEach(function(e,r){e&&t.fillRect(r+C,n+C,1,1)})}),T&&(t.globalAlpha=T.opacity),o&&t.drawImage(r,T.x+C,T.y+C,T.w,T.h)}}),x.useEffect(()=>{S(!1)},[_]);let E=gF({height:a,width:a},h),ne=null;return _!=null&&(ne=x.createElement(`img`,{src:_,key:_,style:{display:`none`},onLoad:()=>{S(!0)},ref:y,crossOrigin:T?.crossOrigin})),x.createElement(x.Fragment,null,x.createElement(`canvas`,gF({style:E,height:a,width:a,ref:b,role:`img`},g)),ne)});IF.displayName=`QRCodeCanvas`;var LF=x.forwardRef(function(e,t){let n=e,{value:r,size:a=xF,level:o=SF,bgColor:s=CF,fgColor:c=wF,includeMargin:l=TF,minVersion:u=EF,boostLevel:d,title:f,marginSize:p,imageSettings:m}=n,h=_F(n,[`value`,`size`,`level`,`bgColor`,`fgColor`,`includeMargin`,`minVersion`,`boostLevel`,`title`,`marginSize`,`imageSettings`]),{margin:g,cells:_,numCells:v,calculatedImageSettings:y}=PF({value:r,level:o,minVersion:u,boostLevel:d,includeMargin:l,marginSize:p,imageSettings:m,size:a}),b=_,ee=null;m!=null&&y!=null&&(y.excavation!=null&&(b=jF(_,y.excavation)),ee=x.createElement(`image`,{href:m.src,height:y.h,width:y.w,x:y.x+g,y:y.y+g,preserveAspectRatio:`none`,opacity:y.opacity,crossOrigin:y.crossOrigin}));let S=AF(b,g);return x.createElement(`svg`,gF({height:a,width:a,viewBox:`0 0 ${v} ${v}`,ref:t,role:`img`},h),!!f&&x.createElement(`title`,null,f),x.createElement(`path`,{fill:s,d:`M0,0 h${v}v${v}H0z`,shapeRendering:`crispEdges`}),x.createElement(`path`,{fill:c,d:S,shapeRendering:`crispEdges`}),ee)});LF.displayName=`QRCodeSVG`;function RF(){return typeof window>`u`?!1:window.matchMedia(`(hover: none) and (pointer: coarse)`).matches||typeof navigator<`u`&&navigator.maxTouchPoints>0||`ontouchstart`in window}function zF(e,t,n){let r=0;for(let a=0;a<8;a++)for(let o=0;o<8;o++){let s=Math.min(t-1,Math.floor((o+.5)/8*t)),c=Math.min(n-1,Math.floor((a+.5)/8*n)),{data:l}=e.getImageData(s,c,1,1);.2126*(l[0]??0)+.7152*(l[1]??0)+.0722*(l[2]??0)>12&&r++}return r<=1}function BF(e){let t={};if(typeof window<`u`){if(e){let n=e.getBoundingClientRect();n.width>0&&n.height>0&&(t.viewportWidth=Math.round(n.width),t.viewportHeight=Math.round(n.height))}t.viewportWidth===void 0&&(t.viewportWidth=window.innerWidth,t.viewportHeight=window.innerHeight),t.devicePixelRatio=window.devicePixelRatio||1;let n=navigator.connection;n?.downlink&&n.downlink>0&&(t.downlinkMbps=n.downlink)}return t}var VF=1500,HF=15e3,UF=40;function WF({serverUrl:e,streamKey:t,label:n,autoPlay:r=!0,muted:a=!0,showControls:o=!0,showStats:s=!1,onPlaybackStats:c,className:l=``,onStateChange:u,onError:d,overlay:f,createSession:p,sendAnswer:m,handleOffer:h,getIceServers:g,addIceCandidate:_,getIceCandidates:v,closeSession:y,getSessionState:b,reoffer:ee,posterUrl:C,hintsOverride:w,reconnectSignal:te,onControlChannel:T}){let E=(0,x.useRef)(null),ne=(0,x.useRef)(null),re=(0,x.useRef)(null),ie=(0,x.useRef)(new Set),ae=(0,x.useRef)(null),oe=(0,x.useRef)(null),se=(0,x.useRef)(0),D=(0,x.useRef)(!0),ce=(0,x.useRef)(T);ce.current=T;let O=(0,x.useRef)(null),k=(0,x.useRef)(null),le=(0,x.useRef)(0),ue=(0,x.useRef)(!1),de=(0,x.useRef)(async()=>{}),[A,fe]=(0,x.useState)(`idle`),[pe,me]=(0,x.useState)(``),[he,ge]=(0,x.useState)(a),[_e,ve]=(0,x.useState)(!1),[ye,be]=(0,x.useState)(!1),xe=RF(),[Se,Ce]=(0,x.useState)(!0),we=(0,x.useRef)(null),Te=(0,x.useRef)(!1);(m||p)&&(Te.current=!0);let Ee=Te.current,De=(0,x.useRef)(!1);h&&(De.current=!0);let Oe=De.current,[ke,Ae]=(0,x.useState)(!1),je=(0,x.useRef)(null),[Me,Ne]=(0,x.useState)(null),[Pe,Fe]=(0,x.useState)(!1),Ie=(0,x.useCallback)(()=>{let e=E.current;if(!(!e||e.readyState<2||!e.videoWidth||!e.videoHeight))try{let t=document.createElement(`canvas`);t.width=e.videoWidth,t.height=e.videoHeight;let n=t.getContext(`2d`);if(!n||(n.drawImage(e,0,0),zF(n,t.width,t.height)))return;je.current=t.toDataURL(`image/jpeg`,.6)}catch{}},[]),Le=(0,x.useCallback)(e=>{fe(e),e===`playing`&&Ae(!0),u?.(e)},[u]),Re=(0,x.useCallback)(()=>{if(ae.current?.abort(),ae.current=null,oe.current&&=(clearTimeout(oe.current),null),k.current&&=(clearTimeout(k.current),null),O.current=null,ue.current=!1,le.current=0,re.current&&=(re.current.close(),null),y&&ie.current.size>0){for(let e of ie.current)y(e).catch(()=>{});ie.current.clear()}},[y]),ze=(0,x.useCallback)(()=>{ae.current?.abort(),ae.current=null,oe.current&&=(clearTimeout(oe.current),null),k.current&&=(clearTimeout(k.current),null),O.current=null,ue.current=!1,le.current=0},[]),Be=1e3,Ve=(0,x.useCallback)(e=>{if(!b||!ee)return;k.current&&=(clearTimeout(k.current),null);let t=async()=>{if(D.current&&O.current===e){if(!ue.current)try{let{pendingRenegotiation:t}=await b(e);if(D.current&&O.current===e&&t&&t.epoch>le.current&&!ue.current){le.current=t.epoch,await de.current(e,t.target);return}}catch{}!D.current||O.current!==e||(k.current=setTimeout(()=>{t()},Be))}};k.current=setTimeout(()=>{t()},Be)},[b,ee]),He=(0,x.useCallback)(async(e=!1)=>{if(!D.current||!p||!m)return;let t=e?re.current:null,n=e?new Set(ie.current):null;e?ze():Re(),Le(`connecting`);let r=new AbortController;ae.current=r;try{let{sessionId:a,sdpOffer:o,iceServers:s}=await p({...BF(ne.current),...w});if(ie.current.add(a),!D.current||r.signal.aborted){y?.(a).catch(()=>{}),ie.current.delete(a);return}let c=new RTCPeerConnection({iceServers:[...s??[],{urls:`stun:stun.l.google.com:19302`}]});e||(re.current=c);let l=new MediaStream,u=!1,d=()=>{if(!(u||!D.current)){if(u=!0,re.current=c,E.current&&(E.current.srcObject=l,E.current.play().catch(()=>{})),t&&t!==c)try{t.close()}catch{}if(n)for(let e of n)ie.current.delete(e),y?.(e).catch(()=>{})}};c.ontrack=t=>{if(console.debug(`[WebRTC] ontrack`,t.track.kind,t.track.readyState),l.addTrack(t.track),e){d();return}E.current&&(E.current.srcObject=l,E.current.play().catch(()=>{}))},c.oniceconnectionstatechange=()=>{if(!D.current)return;let t=c.iceConnectionState;if(console.debug(`[WebRTC] ICE state:`,t),t===`connected`||t===`completed`)se.current=0,e&&d(),Le(`playing`),E.current?.paused&&(console.debug(`[WebRTC] video was paused at ICE connected — calling play()`),E.current.play().catch(()=>{}));else if(t===`failed`||t===`disconnected`||t===`closed`){if(e&&!u)try{c.close()}catch{}Le(`disconnected`),qe()}},c.onicecandidateerror=e=>{console.debug(`[WebRTC] ICE candidate error:`,e)},console.debug(`[WebRTC] Setting remote description (server offer)...`),await c.setRemoteDescription({type:`offer`,sdp:o});let f=await c.createAnswer();if(await c.setLocalDescription(f),console.debug(`[WebRTC] Local description set, waiting for ICE gathering...`),await KF(c),!D.current)return;let h=(c.localDescription?.sdp??``).split(`
|
|
77
|
-
`).filter(e=>e.startsWith(`a=candidate:`)).length;console.debug(`[WebRTC] Sending answer to server`,{localCandidates:h,sessionId:a.slice(0,8)}),await m(a,c.localDescription?.sdp??``),console.debug(`[WebRTC] Answer sent successfully`);let g=c,_=()=>{let e=g.connectionState;if(e===`closed`||e===`failed`)return;let t=E.current;t&&t.readyState===0&&console.log(`[WebRTC] no video data yet (ice=${g.iceConnectionState})`)};setTimeout(_,3e3),setTimeout(_,8e3)}catch(e){if(!D.current)return;let t=e instanceof Error?e.message:String(e);me(t),Le(`error`),d?.(t),qe()}},[e,t,p,m,Re,ze,y,Le,d,w]),Ue=(0,x.useCallback)(async()=>{if(D.current){Re(),Le(`connecting`);try{let n=new RTCPeerConnection({iceServers:[{urls:`stun:stun.l.google.com:19302`}]});re.current=n,n.addTransceiver(`video`,{direction:`recvonly`}),n.addTransceiver(`audio`,{direction:`recvonly`});let r=new MediaStream;n.ontrack=e=>{r.addTrack(e.track),E.current&&(E.current.srcObject=r,E.current.play().catch(()=>{}))},n.oniceconnectionstatechange=()=>{if(!D.current)return;let e=n.iceConnectionState;e===`connected`||e===`completed`?(se.current=0,Le(`playing`),E.current?.paused&&E.current.play().catch(()=>{})):(e===`failed`||e===`disconnected`||e===`closed`)&&(Le(`disconnected`),qe())};let a=await n.createOffer();if(await n.setLocalDescription(a),await KF(n),!D.current)return;let o=`${e}/api/webrtc?src=${encodeURIComponent(t)}`,s=await fetch(o,{method:`POST`,headers:{"Content-Type":`application/sdp`},body:n.localDescription?.sdp??``});if(!s.ok)throw Error(`WHEP ${s.status}: ${s.statusText}`);let c=await s.text();await n.setRemoteDescription({type:`answer`,sdp:c})}catch(e){if(!D.current)return;let t=e instanceof Error?e.message:String(e);me(t),Le(`error`),d?.(t),qe()}}},[e,t,Re,Le,d]),We=(0,x.useCallback)(async(e=!1)=>{if(!D.current||!h)return;let t=e?re.current:null,n=e?new Set(ie.current):null;e?ze():Re(),Le(`connecting`);let r=new AbortController;ae.current=r;try{let a=await g?.();if(!D.current||r.signal.aborted)return;let o=new RTCPeerConnection({iceServers:[...a??[],{urls:`stun:stun.l.google.com:19302`}]});e||(re.current=o);let s=new MediaStream,c=!1,l=()=>{if(!(c||!D.current)){if(c=!0,re.current=o,E.current&&(E.current.srcObject=s,E.current.play().catch(()=>{})),t&&t!==o)try{t.close()}catch{}if(n)for(let e of n)ie.current.delete(e),y?.(e).catch(()=>{})}};o.ontrack=t=>{if(console.debug(`[WebRTC] ontrack (client-offer)`,t.track.kind,t.track.readyState),s.addTrack(t.track),e){l();return}E.current&&(E.current.srcObject=s,E.current.play().catch(()=>{}))},o.oniceconnectionstatechange=()=>{if(!D.current)return;let t=o.iceConnectionState;if(console.debug(`[WebRTC] ICE state (client-offer):`,t),t===`connected`||t===`completed`)se.current=0,e&&l(),Le(`playing`),E.current?.paused&&E.current.play().catch(()=>{});else if(t===`failed`||t===`disconnected`||t===`closed`){if(e&&!c)try{o.close()}catch{}Le(`disconnected`),qe()}};let u=null,d=[];if(o.onicecandidate=e=>{if(!e.candidate)return;let t=e.candidate.toJSON();u&&_?_(u,t).catch(()=>{}):d.push(t)},o.addTransceiver(`video`,{direction:`recvonly`}),o.addTransceiver(`audio`,{direction:`recvonly`}),ce.current){let e=o.createDataChannel(`camstack-control`);ce.current(e)}let f=await o.createOffer();if(await o.setLocalDescription(f),!D.current||r.signal.aborted)return;let{sessionId:p,sdpAnswer:m}=await h(o.localDescription?.sdp??f.sdp??``);if(u=p,ie.current.add(p),O.current=p,!D.current||r.signal.aborted){y?.(p).catch(()=>{}),ie.current.delete(p);return}if(_)for(let e of d)_(p,e).catch(()=>{});if(d.length=0,await o.setRemoteDescription({type:`answer`,sdp:m}),console.debug(`[WebRTC] Client-offer answer set (trickle)`,{sessionId:p.slice(0,8)}),v){let e=new Set,t=Date.now(),n=async()=>{if(!(!D.current||r.signal.aborted)&&!(o.connectionState===`closed`||o.signalingState===`closed`)){try{let{candidates:n,done:r}=await v(p);for(let t of n){let n=t.candidate??``;n&&!e.has(n)&&(e.add(n),o.addIceCandidate(new RTCIceCandidate(t)).catch(()=>{}))}let a=o.iceConnectionState;if(r||Date.now()-t>1e4||a===`connected`||a===`completed`)return}catch{}setTimeout(()=>{n()},200)}};n()}Ve(p)}catch(e){if(!D.current)return;let t=e instanceof Error?e.message:String(e);me(t),Le(`error`),d?.(t),qe()}},[h,g,_,v,y,Re,ze,Le,d,Ve]);de.current=(0,x.useCallback)(async(e,t)=>{let n=ee;if(!D.current||!n)return;let r=re.current;ue.current=!0;try{let a=await g?.();if(!D.current)return;let o=new RTCPeerConnection({iceServers:[...a??[],{urls:`stun:stun.l.google.com:19302`}]}),s=new MediaStream,c=!1,l=()=>{c||!D.current||(c=!0,re.current=o,E.current&&(E.current.srcObject=s,E.current.play().catch(()=>{})),r&&r!==o&&r.close())};o.ontrack=e=>{console.debug(`[WebRTC] ontrack (reoffer)`,e.track.kind,e.track.readyState),s.addTrack(e.track),l()},o.oniceconnectionstatechange=()=>{if(!D.current)return;let e=o.iceConnectionState;console.debug(`[WebRTC] ICE state (reoffer):`,e),e===`connected`||e===`completed`?(se.current=0,l(),Le(`playing`),E.current?.paused&&E.current.play().catch(()=>{})):(e===`failed`||e===`closed`)&&(!c&&e===`failed`&&o.close(),Le(`disconnected`),qe())};let u=null,d=[];if(o.onicecandidate=e=>{if(!e.candidate)return;let t=e.candidate.toJSON();u&&_?_(u,t).catch(()=>{}):d.push(t)},o.addTransceiver(`video`,{direction:`recvonly`}),o.addTransceiver(`audio`,{direction:`recvonly`}),ce.current){let e=o.createDataChannel(`camstack-control`);ce.current(e)}let f=await o.createOffer();if(await o.setLocalDescription(f),!D.current){o.close();return}let{sessionId:p,sdpAnswer:m}=await n(e,o.localDescription?.sdp??f.sdp??``,t);if(!D.current){o.close();return}if(u=p,ie.current.add(p),O.current=p,_)for(let e of d)_(p,e).catch(()=>{});if(d.length=0,await o.setRemoteDescription({type:`answer`,sdp:m}),v){let e=new Set,t=Date.now(),n=async()=>{if(D.current&&!(o.connectionState===`closed`||o.signalingState===`closed`)){try{let{candidates:n,done:r}=await v(p);for(let t of n){let n=t.candidate??``;n&&!e.has(n)&&(e.add(n),o.addIceCandidate(new RTCIceCandidate(t)).catch(()=>{}))}let a=o.iceConnectionState;if(r||Date.now()-t>1e4||a===`connected`||a===`completed`)return}catch{}setTimeout(()=>{n()},200)}};n()}Ve(p)}catch(t){console.debug(`[WebRTC] reoffer failed; keeping last frame, re-arming poll`,t instanceof Error?t.message:String(t)),Ve(e)}finally{ue.current=!1}},[ee,g,_,v,Le,Ve]);let Ge=Oe?We:Ee?He:Ue,Ke=(0,x.useRef)(()=>{});Ke.current=Ge;let qe=(0,x.useCallback)(()=>{if(!D.current||se.current>=UF)return;let e=se.current;se.current+=1;let t=Math.min(HF,VF*2**e),n=Math.round(t*(.8+Math.random()*.4));oe.current=setTimeout(()=>{D.current&&Ke.current()},n)},[]);(0,x.useEffect)(()=>(D.current=!0,se.current=0,r&&Ge(),()=>{D.current=!1,Re()}),[e,t]);let Je=(0,x.useRef)(!1);(0,x.useEffect)(()=>{if(r){if(Oe){if(!h)return}else if(Ee){if(!p||!m)return}else return;Je.current||re.current||(Je.current=!0,Ge())}},[r,Oe,Ee,h,p,m,Ge]);let Ye=()=>{se.current=0,Ge()},Xe=()=>{if(se.current=0,re.current&&Oe){We(!0);return}if(re.current&&Ee){He(!0);return}Ge()},Ze=(0,x.useRef)(te);(0,x.useEffect)(()=>{Ze.current!==te&&(Ze.current=te,D.current&&Xe())},[te]);let Qe=()=>{E.current&&(E.current.muted=!E.current.muted,ge(E.current.muted))},$e=async()=>{if(ne.current)try{if(document.fullscreenElement){await document.exitFullscreen();return}if(ne.current.requestFullscreen){await ne.current.requestFullscreen();return}let e=E.current;e?.webkitEnterFullscreen&&e.webkitEnterFullscreen()}catch(e){console.warn(`Fullscreen toggle failed: ${e instanceof Error?e.message:e}`)}},et=async()=>{let e=E.current;if(e)try{if(typeof e.webkitSetPresentationMode==`function`){e.webkitSetPresentationMode(e.webkitPresentationMode===`picture-in-picture`?`inline`:`picture-in-picture`);return}document.pictureInPictureElement?await document.exitPictureInPicture():await e.requestPictureInPicture()}catch(e){console.warn(`PiP toggle failed: ${e instanceof Error?e.message:String(e)}`)}},tt=()=>{if(!E.current)return;let e=document.createElement(`canvas`);e.width=E.current.videoWidth||1280,e.height=E.current.videoHeight||720;let n=e.getContext(`2d`);if(!n)return;n.drawImage(E.current,0,0);let r=document.createElement(`a`);r.download=`${t.replace(/[/:]/g,`-`)}-${Date.now()}.jpg`,r.href=e.toDataURL(`image/jpeg`,.92),r.click()};(0,x.useEffect)(()=>{let e=()=>ve(!!document.fullscreenElement);document.addEventListener(`fullscreenchange`,e);let t=E.current;return t?.addEventListener(`webkitbeginfullscreen`,e),t?.addEventListener(`webkitendfullscreen`,e),()=>{document.removeEventListener(`fullscreenchange`,e),t?.removeEventListener(`webkitbeginfullscreen`,e),t?.removeEventListener(`webkitendfullscreen`,e)}},[]),(0,x.useEffect)(()=>{let e=E.current,t=typeof document<`u`&&document.pictureInPictureEnabled===!0,n=e!==null&&typeof e.webkitSetPresentationMode==`function`;be(t||n)},[]);let[nt,rt]=(0,x.useState)(``),it=(0,x.useRef)(null);(0,x.useEffect)(()=>{if(!s){rt(``),it.current=null;return}let e=async()=>{let e=re.current;if(e)try{let t=await e.getStats(),n=0,r=0,a=0,o=0,s=0,c=0;t.forEach(e=>{let t=e;t.type===`inbound-rtp`&&(t.kind??t.mediaType)===`video`?(n=t.bytesReceived??0,r=t.timestamp,a=t.framesPerSecond??0,o=t.frameWidth??0,s=t.frameHeight??0):t.type===`candidate-pair`&&t.nominated&&typeof t.currentRoundTripTime==`number`&&(c=t.currentRoundTripTime)});let l=0;it.current&&r>it.current.ts&&(l=Math.round((n-it.current.bytes)*8/(r-it.current.ts))),it.current={bytes:n,ts:r};let u=[];o&&s&&u.push(`${o}×${s}`),a&&u.push(`${Math.round(a)}fps`),l>0&&u.push(`${l} kbps`),c&&u.push(`${Math.round(c*1e3)}ms`),rt(u.join(` · `))}catch{}};e();let t=setInterval(()=>{e()},1e3);return()=>clearInterval(t)},[s]);let at=(0,x.useRef)(null);(0,x.useEffect)(()=>{if(!c){at.current=null;return}let e=async()=>{let e=re.current,t=E.current;if(e)try{let n=await e.getStats(),r=0,a=0,o=0,s=0,l=0,u=0,d=0,f=0;n.forEach(e=>{let t=e;t.type===`inbound-rtp`&&(t.kind??t.mediaType)===`video`&&(r=t.framesReceived??0,a=t.framesDecoded??0,o=t.framesDropped??0,s=t.framesPerSecond??0,l=t.freezeCount??0,u=t.totalFreezesDuration??0,d=t.jitterBufferDelay??0,f=t.jitterBufferEmittedCount??0)});let p=t?.currentTime??0,m=Date.now(),h=at.current,g=f>0?Math.round(d/f*1e3):0;h&&c({dRecv:r-h.recv,dDec:a-h.dec,dDrop:o-h.drop,fps:Math.round(s),dFreeze:l-h.freeze,freezeTotalMs:Math.round(u*1e3),avgJitterMs:g,dCtMs:Math.round((p-h.ct)*1e3),dtMs:m-h.ts,readyState:t?.readyState??-1}),at.current={recv:r,dec:a,drop:o,freeze:l,ct:p,ts:m}}catch{}};e();let t=setInterval(()=>{e()},1e3);return()=>clearInterval(t)},[c]),(0,x.useEffect)(()=>{ge(a);let e=E.current;e&&(e.muted=a,a||e.play().catch(()=>{}))},[a]);let ot=()=>{xe||(Ce(!0),we.current&&clearTimeout(we.current),we.current=setTimeout(()=>Ce(!1),3e3))},st=()=>{Ce(e=>!e),we.current&&clearTimeout(we.current)};(0,x.useEffect)(()=>{if(A===`playing`){Ie();let e=setInterval(Ie,2e3);return()=>clearInterval(e)}ke&&je.current&&Ne(je.current)},[A,ke,Ie]),(0,x.useEffect)(()=>{if(A!==`playing`){Fe(!1);return}let e=E.current;if(!e)return;let t=!1,n=()=>{t||Fe(!0)},r;typeof e.requestVideoFrameCallback==`function`&&(r=e.requestVideoFrameCallback(()=>n())),e.addEventListener(`loadeddata`,n,{once:!0});let a=setTimeout(n,12e3);return()=>{t=!0,clearTimeout(a),r!==void 0&&typeof e.cancelVideoFrameCallback==`function`&&e.cancelVideoFrameCallback(r),e.removeEventListener(`loadeddata`,n)}},[A]);let ct=ke&&Me?Me:C??null,lt=!Pe&&ct!==null;return(0,S.jsxs)(`div`,{ref:ne,className:`relative isolate bg-black overflow-hidden group ${l}`,onMouseMove:ot,onMouseEnter:ot,onTouchStart:st,children:[(0,S.jsx)(`video`,{ref:E,autoPlay:r,muted:he,playsInline:!0,className:`w-full h-full object-contain relative z-0`}),lt&&ct&&(0,S.jsx)(`img`,{src:ct,alt:``,className:`absolute inset-0 w-full h-full object-contain z-[5] transform-gpu pointer-events-none`}),n&&A===`playing`&&(0,S.jsx)(`div`,{className:`absolute top-2 left-2 z-10 transform-gpu px-2 py-0.5 rounded bg-black/60 text-[10px] text-white font-medium`,children:n}),s&&nt&&(0,S.jsx)(`div`,{className:`absolute top-2 right-2 z-10 transform-gpu px-2 py-0.5 rounded bg-black/60 text-[10px] text-white font-mono`,children:nt}),f,!ct&&A===`connecting`&&(0,S.jsxs)(`div`,{className:`absolute inset-0 z-10 transform-gpu flex flex-col items-center justify-center bg-black/70 gap-2`,children:[(0,S.jsx)(`svg`,{className:`h-6 w-6 text-white/60 animate-spin`,viewBox:`0 0 24 24`,fill:`none`,children:(0,S.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`,strokeDasharray:`32`,strokeDashoffset:`32`,className:`animate-[dash_1.5s_ease-in-out_infinite]`})}),(0,S.jsx)(`span`,{className:`text-xs text-white/60`,children:`Connecting…`})]}),!ct&&(A===`error`||A===`disconnected`)&&(0,S.jsxs)(`div`,{className:`absolute inset-0 z-10 transform-gpu flex flex-col items-center justify-center bg-black/70 gap-2`,children:[(0,S.jsx)(`svg`,{className:`h-6 w-6 text-red-400`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,children:(0,S.jsx)(`path`,{d:`M1 1l5.5 5.5M23 23l-5.5-5.5M8.11 15.89a8 8 0 0110.78-10.78M3.64 3.64A12 12 0 0020.36 20.36`,strokeLinecap:`round`})}),(0,S.jsx)(`span`,{className:`text-xs text-red-400 text-center px-4`,children:A===`error`?pe||`Connection failed`:`Disconnected`}),(0,S.jsx)(`button`,{onClick:Ye,className:`mt-1 inline-flex items-center gap-1.5 rounded px-3 py-1 text-xs bg-white/10 text-white hover:bg-white/20 transition-colors`,children:`Reconnect`})]}),ct&&(A===`connecting`||A===`disconnected`)&&(0,S.jsx)(`div`,{className:`absolute top-2 left-2 z-10 transform-gpu flex h-6 w-6 items-center justify-center rounded-full bg-black/55`,children:(0,S.jsx)(`svg`,{className:`h-3.5 w-3.5 text-white/90 animate-spin`,viewBox:`0 0 24 24`,fill:`none`,children:(0,S.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`,strokeDasharray:`32`,strokeDashoffset:`32`,className:`animate-[dash_1.5s_ease-in-out_infinite]`})})}),ct&&A===`error`&&(0,S.jsx)(`button`,{onClick:Ye,title:pe||`Reconnect`,className:`absolute top-2 left-2 z-10 transform-gpu flex h-6 w-6 items-center justify-center rounded-full bg-black/55 text-white/90 hover:bg-black/75 transition-colors`,children:(0,S.jsxs)(`svg`,{className:`h-3.5 w-3.5`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,S.jsx)(`path`,{d:`M23 4v6h-6M1 20v-6h6`}),(0,S.jsx)(`path`,{d:`M3.51 9a9 9 0 0114.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0020.49 15`})]})}),o&&A!==`idle`&&A!==`error`&&(0,S.jsxs)(`div`,{className:`absolute bottom-0 inset-x-0 z-20 transform-gpu flex items-center justify-between px-3 py-1.5 bg-gradient-to-t from-black/80 to-transparent transition-opacity duration-200 ${xe||Se?`opacity-100 pointer-events-auto`:`opacity-0 pointer-events-none`}`,children:[(0,S.jsx)(`div`,{className:`flex items-center gap-1`,children:(0,S.jsx)(GF,{onClick:Qe,title:he?`Unmute`:`Mute`,children:he?(0,S.jsxs)(`svg`,{className:`h-3.5 w-3.5`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,children:[(0,S.jsx)(`polygon`,{points:`11 5 6 9 2 9 2 15 6 15 11 19 11 5`}),(0,S.jsx)(`line`,{x1:`23`,y1:`9`,x2:`17`,y2:`15`}),(0,S.jsx)(`line`,{x1:`17`,y1:`9`,x2:`23`,y2:`15`})]}):(0,S.jsxs)(`svg`,{className:`h-3.5 w-3.5`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,children:[(0,S.jsx)(`polygon`,{points:`11 5 6 9 2 9 2 15 6 15 11 19 11 5`}),(0,S.jsx)(`path`,{d:`M19.07 4.93a10 10 0 010 14.14M15.54 8.46a5 5 0 010 7.07`})]})})}),(0,S.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,S.jsx)(GF,{onClick:tt,title:`Take snapshot`,children:(0,S.jsxs)(`svg`,{className:`h-3.5 w-3.5`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,children:[(0,S.jsx)(`path`,{d:`M23 19a2 2 0 01-2 2H3a2 2 0 01-2-2V8a2 2 0 012-2h4l2-3h6l2 3h4a2 2 0 012 2z`}),(0,S.jsx)(`circle`,{cx:`12`,cy:`13`,r:`4`})]})}),ye&&(0,S.jsx)(GF,{onClick:et,title:`Picture-in-Picture`,children:(0,S.jsxs)(`svg`,{className:`h-3.5 w-3.5`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,S.jsx)(`path`,{d:`M21 9V6a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2h4`}),(0,S.jsx)(`rect`,{width:`10`,height:`7`,x:`12`,y:`13`,rx:`2`})]})}),(0,S.jsx)(GF,{onClick:$e,title:_e?`Exit fullscreen`:`Fullscreen`,children:_e?(0,S.jsx)(`svg`,{className:`h-3.5 w-3.5`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,children:(0,S.jsx)(`path`,{d:`M8 3v3a2 2 0 01-2 2H3m18 0h-3a2 2 0 01-2-2V3m0 18v-3a2 2 0 012-2h3M3 16h3a2 2 0 012 2v3`})}):(0,S.jsx)(`svg`,{className:`h-3.5 w-3.5`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,children:(0,S.jsx)(`path`,{d:`M8 3H5a2 2 0 00-2 2v3m18 0V5a2 2 0 00-2-2h-3m0 18h3a2 2 0 002-2v-3M3 16v3a2 2 0 002 2h3`})})})]})]})]})}function GF({onClick:e,title:t,children:n}){return(0,S.jsx)(`button`,{onClick:e,title:t,className:`rounded-full p-1.5 min-w-[44px] min-h-[44px] flex items-center justify-center text-white/80 hover:text-white hover:bg-white/20 active:bg-white/30 transition-colors`,children:n})}async function KF(e){if(e.iceGatheringState!==`complete`)return new Promise(t=>{let n=!1,r,a=()=>{n||(n=!0,r&&clearInterval(r),e.removeEventListener(`icegatheringstatechange`,o),t())},o=()=>{e.iceGatheringState===`complete`&&a()};e.addEventListener(`icegatheringstatechange`,o);let s=Date.now();r=setInterval(()=>{let t=e.localDescription?.sdp??``;/ typ host/.test(t)&&Date.now()-s>=600&&a()},100),setTimeout(a,2500)})}FO(`camstack:player-overlays-state`,null);var qF=FO(`camstack:player-overlays-actions`,null);function JF(e){let t=(0,x.useContext)(qF);(0,x.useEffect)(()=>{if(!(!t||!e))return t.setLayer(e),()=>t.removeLayer(e.id)},[t,e])}V({id:I(),stableId:F(),addonId:F(),type:F(),name:F(),online:L(),disabled:L(),parentDeviceId:I().nullable(),role:F().nullable().optional(),features:B(F()).optional(),isCamera:L().optional(),sourceInfo:im.optional()}),Rd.AddonStarted,Rd.AddonInstalled,Rd.AddonRestarted,Rd.AddonUpdated,Rd.AddonStopped,Rd.AddonUninstalled,Rd.AddonCrashed,Rd.AddonError,Rd.DetectionPhaseTransition,Rd.DetectionResult,Rd.DetectionEvent,Rd.DetectionCameraNative,Rd.ProviderMotion,Rd.MotionOnMotionChanged,Rd.MotionAnalysis,Rd.MotionZonesRaw,Rd.ProviderDetection,Rd.PipelineAudioInferenceResult,Rd.AgentOnline,Rd.AgentOffline,Rd.DeviceRegistered,Rd.DeviceUnregistered,Rd.DeviceStateChanged,Rd.EventEmitted;var YF=Object.freeze([...new Set(Object.values(Rd))].toSorted()),XF=Object.freeze([Rd.PipelineCameraMetricsSnapshot,Rd.PipelineRunnerLoadSnapshot,Rd.PipelineEngineMetricsSnapshot,Rd.PipelineInferenceResult,Rd.PipelineTrace,Rd.PipelineProgress,Rd.StreamBrokerMetricsSnapshot,Rd.MetricsNodeResourcesSnapshot,Rd.MetricsNodeProcessesSnapshot,Rd.ClusterTopologySnapshot,Rd.MotionAnalysis,Rd.MotionZonesRaw,Rd.DetectionResult,Rd.PipelineAudioInferenceResult,Rd.PlatformProbePhase,Rd.BenchmarkProgress,Rd.ModelDownloadProgress]),ZF=new Set(XF);Object.freeze(YF.filter(e=>!ZF.has(e))),Object.freeze([...new Set(xT.filter(e=>e.scope===`device`).map(e=>e.name))].toSorted()),FO(`camstack:zone-editing`,null);var QF=500,$F=800;function eI(e,t,n){try{let r=e.live;if(!r)return null;let a=r.onEvent;return!a||typeof a.subscribe!=`function`?null:a.subscribe({category:t},{onData:n})}catch{return null}}function tI(e,t){return e?.id===t}function nI(e,t){let[n,r]=(0,x.useState)(null),[a,o]=(0,x.useState)(null),[s,c]=(0,x.useState)(null),[l,u]=(0,x.useState)(`watching`),d=(0,x.useRef)(void 0),f=(0,x.useRef)(void 0),p=(0,x.useRef)(void 0);return(0,x.useEffect)(()=>{if(t===null)return;let n=eI(e,`detection.motion-analysis`,e=>{let n=e;if(!tI(n?.source,t))return;let a=n.data;!a?.regions||a.regions.length===0||(r({zones:a.regions.map(e=>({...e.bbox,intensity:e.intensity})),frameWidth:a.frameWidth,frameHeight:a.frameHeight}),d.current&&clearTimeout(d.current),d.current=setTimeout(()=>r(null),QF))});return()=>{n?.unsubscribe(),d.current&&clearTimeout(d.current)}},[e,t]),(0,x.useEffect)(()=>{if(t===null)return;let n=eI(e,`detection.motion-zones-raw`,e=>{let n=e;if(!tI(n?.source,t))return;let r=n.data;r?.zones&&(o({boxes:r.zones.map(e=>({bbox:e.bbox,changeScore:e.changeScore})),frameWidth:r.frameSize?.width??0,frameHeight:r.frameSize?.height??0,motionScore:r.zones.length>0?r.zones.reduce((e,t)=>e+t.changeScore,0)/r.zones.length:0}),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>o(null),QF))});return()=>{n?.unsubscribe(),f.current&&clearTimeout(f.current)}},[e,t]),(0,x.useEffect)(()=>{if(t===null)return;let n=eI(e,`detection.result`,e=>{let n=e;if(!tI(n?.source,t))return;let r=n.data?.frame;r?.detections?.length&&(c({detections:r.detections,frameWidth:r.width,frameHeight:r.height}),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>c(null),$F))});return()=>{n?.unsubscribe(),p.current&&clearTimeout(p.current)}},[e,t]),(0,x.useEffect)(()=>{if(t===null)return;let n=eI(e,`detection.phase-transition`,e=>{let n=e;tI(n?.source,t)&&n.data?.to&&u(n.data.to)});return()=>{n?.unsubscribe()}},[e,t]),{motion:n,motionRaw:a,detection:s,phase:l}}function rI(e,t,n=5e3){let[r,a]=(0,x.useState)([]);(0,x.useEffect)(()=>{if(t===null)return;let r=!1,o=()=>{e.webrtcSession.listStreams.query({deviceId:t}).then(e=>{r||a(e)}).catch(()=>{})};o();let s=setInterval(o,n);return()=>{r=!0,clearInterval(s)}},[e,t,n]);let[o,s]=(0,x.useState)(null);(0,x.useEffect)(()=>{if(t===null)return;let n=!1;return e.pipelineOrchestrator&&e.pipelineOrchestrator.getCameraMetrics.query({deviceId:t}).then(e=>{n||!e||s({phase:e.phase,detectionFps:e.actualFps,avgInferenceMs:e.avgInferenceTimeMs,droppedFrames:e.droppedFrames})}).catch(()=>{}),()=>{n=!0}},[e,t]),GN(`pipeline.camera-metrics-snapshot`,e=>{if(t===null)return;let n=e.data;n.deviceId!==t||!n.metrics||s({phase:n.metrics.phase,detectionFps:n.metrics.actualFps,avgInferenceMs:n.metrics.avgInferenceTimeMs,droppedFrames:n.metrics.droppedFrames})});let{streams:c,hasWebrtc:l}=(0,x.useMemo)(()=>t===null||r.length===0?{streams:[],hasWebrtc:!1}:{streams:r.map(e=>({id:e.id,label:e.label,target:e.target,status:e.status,inputFps:e.inputFps,decodeFps:e.decodeFps,bitrateKbps:e.bitrateKbps})),hasWebrtc:!0},[t,r]),u=(0,x.useCallback)(async()=>{if(e.turnProvider)try{return(await e.turnProvider.getTurnServers.query()).map(e=>({urls:typeof e.urls==`string`?e.urls:[...e.urls],...e.username===void 0?{}:{username:e.username},...e.credential===void 0?{}:{credential:e.credential}}))}catch{return}},[e]),d=(0,x.useCallback)(async(n,r)=>{if(t===null)throw Error(`No device selected`);let a=await e.webrtcSession.createSession.mutate({deviceId:t,target:n,hints:r}),o=await u();return{sessionId:a.sessionId,sdpOffer:a.sdpOffer,...o?{iceServers:o}:{}}},[e,t,u]),f=(0,x.useCallback)(async(n,r,a)=>{if(t===null)throw Error(`No device selected`);return e.webrtcSession.handleOffer.mutate({deviceId:t,target:n,sdpOffer:r,...a===void 0?{}:{sessionId:a}})},[e,t]),p=(0,x.useCallback)(async(n,r)=>{if(t===null)throw Error(`No device selected`);await e.webrtcSession.handleAnswer.mutate({deviceId:t,sessionId:n,sdpAnswer:r})},[e,t]);return{streams:c,hasWebrtc:l,pipelineMetrics:o,createSession:d,handleOffer:f,getIceServers:u,addIceCandidate:(0,x.useCallback)(async(n,r)=>{t!==null&&await e.webrtcSession.addIceCandidate.mutate({deviceId:t,sessionId:n,candidate:r.candidate??``,sdpMid:r.sdpMid??null,sdpMLineIndex:r.sdpMLineIndex??null}).catch(()=>{})},[e,t]),getIceCandidates:(0,x.useCallback)(async n=>t===null?{candidates:[],done:!0}:e.webrtcSession.getIceCandidates.query({deviceId:t,sessionId:n}),[e,t]),sendAnswer:p,closeSession:(0,x.useCallback)(async n=>{t!==null&&await e.webrtcSession.closeSession.mutate({deviceId:t,sessionId:n}).catch(()=>{})},[e,t]),getSessionState:(0,x.useCallback)(async n=>{if(t===null)return{pendingRenegotiation:null};try{return await e.webrtcSession.getSessionState.query({deviceId:t,sessionId:n})}catch{return{pendingRenegotiation:null}}},[e,t])}}(0,x.lazy)(()=>tD(()=>import(`./MaskShapeCanvas-DI4BY7W2-C0kKwNX_.js`).then(e=>({default:e.MaskShapeCanvas})),[],import.meta.url)),(0,x.lazy)(()=>tD(()=>import(`./MotionZonesSettings-C1EEbk2V-CYtJc892.js`).then(e=>({default:e.MotionZonesSettings})),__vite__mapDeps([0,1]),import.meta.url)),(0,x.lazy)(()=>tD(()=>import(`./PrivacyMaskSettings-APgPLF7p-C2SRtNe6.js`).then(e=>({default:e.PrivacyMaskSettings})),__vite__mapDeps([2,1]),import.meta.url));var iI=W([`auto`,`high`,`medium`,`low`]),aI=H([G(`auto`),I().int().min(1)]),oI=V({enabled:L(),motion:L(),audio:W([`off`,`sensor`,`level`]),audioDb:I(),audioHoldSec:I(),detection:L(),detectionHoldSec:I(),detectionClasses:B(F()).optional(),appearance:V({motionColor:F(),audioColor:F(),detectionColor:F(),thickness:I()}).optional()}),sI=V({serverUrl:F().min(1),token:F().min(1),devices:B(I().int().nonnegative()).min(1),layout:aI,quality:iI,showName:L(),showBadges:L(),muted:L(),paused:L(),highlight:oI.optional(),activeOnly:L().optional(),audioOnIds:B(I().int().nonnegative()).optional(),pausedIds:B(I().int().nonnegative()).optional(),snapshots:U(F(),F()).optional(),ptzIds:B(I().int().nonnegative()).optional()});function cI(e){if(e==null)return{ok:!1,error:`config is required`};let t=sI.safeParse(e);return t.success?{ok:!0,config:t.data}:{ok:!1,error:t.error.issues.map(e=>`${e.path.join(`.`)||`(root)`}: ${e.message}`).join(`; `)}}var lI=1e4;function uI(){try{return window.parent!==window}catch{return!0}}function dI(e){let t=window.ReactNativeWebView;if(t){t.postMessage(JSON.stringify(e));return}uI()&&window.parent.postMessage(e,`*`)}function fI(e){let t=t=>{let n=t.data;if(typeof n!=`object`||!n)return;let r=n;r.type!==`embed-command`||typeof r.command!=`object`||r.command===null||e(r.command)};return window.addEventListener(`message`,t),()=>window.removeEventListener(`message`,t)}function pI(e,t,n){let r=t();return r==null?uI()?new Promise(t=>{let r,a=e=>{let o=e.data;if(typeof o!=`object`||!o)return;let s=o;s.type===`embed-config`&&(clearTimeout(r),window.removeEventListener(`message`,a),t(n(s.config)))};window.addEventListener(`message`,a),r=setTimeout(()=>{window.removeEventListener(`message`,a),t({ok:!1,error:`config handshake timed out`})},lI),window.parent.postMessage({type:`embed-ready`,mode:e},`*`)}):Promise.resolve({ok:!1,error:`config global for mode "${e}" is not set`}):Promise.resolve(n(r))}function mI(e,t,n){let[r,a]=(0,x.useState)(null),o=(0,x.useRef)(t);o.current=t;let s=(0,x.useRef)(n);return s.current=n,(0,x.useEffect)(()=>{let t=!0;return pI(e,()=>o.current(),e=>s.current(e)).then(e=>{t&&a(e)}),()=>{t=!1}},[e]),r}var hI=16/9;function gI(e,t,n,r){if(e<=0||t<=0||n<=0)return{cols:0,rows:0,cellW:0,cellH:0};if(typeof r==`number`&&r>=1){let a=Math.floor(r),o=Math.ceil(e/a),s=Math.min(t/a,n/o*hI);return{cols:a,rows:o,cellW:s,cellH:s/hI}}let a={cols:1,rows:e,cellW:0,cellH:0},o=-1;for(let r=1;r<=e;r++){let s=Math.ceil(e/r),c=Math.min(t/r,n/s*hI),l=c/hI,u=c*l;u>o&&(o=u,a={cols:r,rows:s,cellW:c,cellH:l})}return a}function _I(){let[e,t]=(0,x.useState)(null),[n,r]=(0,x.useState)(`idle`),a=(0,x.useRef)(null),o=(0,x.useRef)(null),s=(0,x.useRef)(null),c=(0,x.useRef)(0),l=(0,x.useRef)(null),u=YN(),d=XN(),f=ZN(),p=(0,x.useRef)({start:u.mutateAsync,answer:d.mutateAsync,stop:f.mutateAsync});p.current={start:u.mutateAsync,answer:d.mutateAsync,stop:f.mutateAsync};let m=(0,x.useCallback)(()=>{if(a.current){try{a.current.close()}catch{}a.current=null}if(o.current){for(let e of o.current.getTracks())try{e.stop()}catch{}o.current=null}},[]),h=(0,x.useCallback)(async()=>{let e=s.current;if(s.current=null,m(),e)try{await p.current.stop({deviceId:e.deviceId,sessionId:e.sessionId})}catch{}},[m]),g=(0,x.useCallback)(async e=>{if(l.current===e){c.current+=1,l.current=null,t(null),r(`idle`),await h();return}c.current+=1;let n=c.current;l.current=e,t(e),r(`starting`);let u;try{u=await navigator.mediaDevices.getUserMedia({audio:!0,video:!1})}catch{n===c.current&&(l.current=null,t(null),r(`error`));return}if(n!==c.current){for(let e of u.getTracks())e.stop();return}if(await h(),n!==c.current){for(let e of u.getTracks())e.stop();return}let d=null;try{o.current=u;let f=await p.current.start({deviceId:e});if(n!==c.current){try{await p.current.stop({deviceId:e,sessionId:f.sessionId})}catch{}m();return}s.current={deviceId:e,sessionId:f.sessionId},d=new RTCPeerConnection,a.current=d,d.oniceconnectionstatechange=()=>{if(n!==c.current||!d)return;let e=d.iceConnectionState;e===`connected`||e===`completed`?r(`talking`):(e===`failed`||e===`closed`||e===`disconnected`)&&(l.current=null,t(null),r(`idle`),h())};for(let e of u.getAudioTracks())d.addTrack(e,u);await d.setRemoteDescription({type:`offer`,sdp:f.sdpOffer});let g=await d.createAnswer();if(await d.setLocalDescription(g),n!==c.current)return;await p.current.answer({deviceId:e,sessionId:f.sessionId,sdpAnswer:d.localDescription?.sdp??g.sdp??``})}catch{if(d)try{d.close()}catch{}m();let e=s.current;if(s.current=null,e)try{await p.current.stop({deviceId:e.deviceId,sessionId:e.sessionId})}catch{}n===c.current&&(l.current=null,t(null),r(`error`))}},[h,m]),_=(0,x.useCallback)(e=>{if(e===null){c.current+=1,l.current=null,t(null),r(`idle`),h();return}l.current!==e&&g(e)},[h,g]);return(0,x.useEffect)(()=>()=>{c.current+=1,h()},[h]),{activeMicId:e,micState:n,toggleMic:e=>{g(e)},setActiveMic:_}}var vI=6e3,yI=500;function bI(e,t){let n=(0,x.useRef)(new Map),[,r]=(0,x.useState)(0),a=t?.motion??!1,o=t?.audio??`off`,s=t?.audioDb??-30,c=t?.audioHoldSec??3,l=t?.detection??!1,u=t?.detectionHoldSec??3,d=t?.detectionClasses??[],f=(e,t)=>{n.current.set(e,Date.now()+t),r(e=>e+1)};GN(Rd.MotionOnMotionChanged,e=>{if(!a)return;let t=e.data;t&&t.detected&&f(t.deviceId,vI)}),GN(Rd.PipelineAudioInferenceResult,e=>{if(o===`off`)return;let t=e.data;t&&(o===`sensor`?t.frame.detections.length>0:(t.frame.level?.dbfs??-1/0)>=s)&&f(t.deviceId,c*1e3)}),GN(Rd.DetectionResult,e=>{if(!l)return;let t=e.data;t&&t.frame.detections.some(e=>d.length===0||d.includes(e.macroClass))&&f(t.frame.deviceId,u*1e3)}),(0,x.useEffect)(()=>{let e=setInterval(()=>r(e=>e+1),yI);return()=>clearInterval(e)},[]);let p=Date.now(),m=new Set;for(let t of e){let e=n.current.get(t);e!==void 0&&p<e&&m.add(t)}return m}function xI(e){return{type:`tileOpen`,deviceId:e}}function SI(e){return{type:`audioToggle`,deviceId:e}}function CI(e){return{type:`pauseToggle`,deviceId:e}}function wI(e){return{type:`ptzOpen`,deviceId:e}}function TI(e,t){return t===void 0?{type:`state`,state:e}:{type:`state`,state:e,message:t}}function EI(e){return{type:`layout`,tiles:e}}function DI(e){dI(e)}var OI=4,kI=8,AI=300;function jI(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function MI({children:e,onTap:t}){let n=(0,x.useRef)(null),r=(0,x.useRef)(null),a=(0,x.useRef)(new Map),o=(0,x.useRef)(1),s=(0,x.useRef)(0),c=(0,x.useRef)(0),l=(0,x.useRef)(null),u=(0,x.useRef)(null),d=(0,x.useRef)(0),f=()=>{let e=r.current;e&&(e.style.transform=`translate(${s.current}px, ${c.current}px) scale(${o.current})`)},p=()=>{let e=n.current?.getBoundingClientRect();if(!e)return;let t=(o.current-1)*e.width/2,r=(o.current-1)*e.height/2;s.current=Math.max(-t,Math.min(t,s.current)),c.current=Math.max(-r,Math.min(r,c.current))},m=()=>{o.current=1,s.current=0,c.current=0,f()},h=e=>{try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}if(a.current.set(e.pointerId,{x:e.clientX,y:e.clientY}),a.current.size===2){let e=[...a.current.values()],t=e[0],n=e[1];t&&n&&(l.current={dist:jI(t,n),scale:o.current,cx:(t.x+n.x)/2,cy:(t.y+n.y)/2,tx:s.current,ty:c.current}),u.current=null}else a.current.size===1&&(u.current={x:e.clientX,y:e.clientY,tx:s.current,ty:c.current,moved:!1})},g=e=>{if(!a.current.has(e.pointerId))return;if(a.current.set(e.pointerId,{x:e.clientX,y:e.clientY}),a.current.size>=2&&l.current){let e=[...a.current.values()],t=e[0],n=e[1];if(!t||!n)return;let r=jI(t,n);l.current.dist>0&&(o.current=Math.max(1,Math.min(OI,l.current.scale*(r/l.current.dist))));let u=(t.x+n.x)/2,d=(t.y+n.y)/2;s.current=l.current.tx+(u-l.current.cx),c.current=l.current.ty+(d-l.current.cy),p(),f();return}let t=u.current;if(a.current.size===1&&t){let n=e.clientX-t.x,r=e.clientY-t.y;(Math.abs(n)>kI||Math.abs(r)>kI)&&(t.moved=!0),o.current>1&&(s.current=t.tx+n,c.current=t.ty+r,p(),f())}},_=e=>{let n=a.current.size===1,r=u.current;if(a.current.delete(e.pointerId),a.current.size<2&&(l.current=null),a.current.size===0&&(u.current=null,n&&r&&!r.moved)){let e=Date.now();e-d.current<AI?(d.current=0,m()):(d.current=e,t())}};return(0,S.jsx)(`div`,{ref:n,style:{position:`absolute`,inset:0,overflow:`hidden`,touchAction:`none`},onPointerDown:h,onPointerMove:g,onPointerUp:_,onPointerCancel:_,children:(0,S.jsx)(`div`,{ref:r,style:{width:`100%`,height:`100%`,transformOrigin:`center center`,willChange:`transform`},children:e})})}var NI=500;function PI(e,t,n){let{motion:r,detection:a}=nI(e.trpcClient,t),o=(0,x.useRef)(0),s=(0,x.useRef)(0),[,c]=(0,x.useState)(0),l=n?.audio??`off`,u=n?.audioDb??-30,d=n?.audioHoldSec??3,f=n?.detectionHoldSec??3,p=n?.detectionClasses??[],m=p.join(`,`);if(GN(Rd.PipelineAudioInferenceResult,e=>{let n=e.data;!n||n.deviceId!==t||l===`off`||(l===`sensor`?n.frame.detections.length>0:(n.frame.level?.dbfs??-1/0)>=u)&&(o.current=Date.now()+d*1e3,c(e=>e+1))}),(0,x.useEffect)(()=>{a&&a.detections.some(e=>p.length===0||p.includes(e.macroClass))&&(s.current=Date.now()+f*1e3,c(e=>e+1))},[a,f,m]),(0,x.useEffect)(()=>{let e=setInterval(()=>c(e=>e+1),NI);return()=>clearInterval(e)},[]),!n?.enabled)return null;let h=Date.now();return n.detection&&h<s.current?`detection`:l!==`off`&&h<o.current?`audio`:n.motion&&r!==null?`motion`:null}var FI={motion:`#DC2626`,audio:`#3B82F6`,detection:`#22C55E`},II=3500;function LI(e){return e===`auto`?{kind:`adaptive`}:{kind:`profile`,profile:e===`medium`?`mid`:e}}function RI({system:e,deviceId:t,name:n,online:r,quality:a,muted:o,paused:s,showName:c,audioActive:l,micActive:u,onTogglePause:d,onToggleAudio:f,onToggleMic:p,onOpen:m,ptzSupported:h,onPtz:g,highlight:_,reconnectSignal:v,posterUrl:y}){let{handleOffer:b,getIceServers:ee,addIceCandidate:C,getIceCandidates:w,closeSession:te,getSessionState:T}=rI(e.trpcClient,t),E=PI(e,t,_),[ne,re]=(0,x.useState)(void 0);(0,x.useEffect)(()=>{if(y||s)return;let n=!1;return e.trpcClient.snapshot.getSnapshot.query({deviceId:t}).then(e=>{!n&&e?.base64&&re(`data:${e.contentType??`image/jpeg`};base64,${e.base64}`)}).catch(()=>{}),()=>{n=!0}},[y,s,e,t]);let ie=y??ne,ae=(0,x.useMemo)(()=>LI(a),[a]),oe=`grid:${t}:${a}`,se=(0,x.useMemo)(()=>(e,t)=>b(ae,e,t),[b,ae]),D=(0,x.useMemo)(()=>(e,t,n)=>b(n,t,e),[b]),[ce,O]=(0,x.useState)(!1),k=(0,x.useRef)(null),le=()=>{k.current&&clearTimeout(k.current),k.current=setTimeout(()=>O(!1),II)},ue=()=>{O(!0),le()},de=()=>{O(e=>{let t=!e;return t&&le(),t})},A=e=>{e.stopPropagation(),ue()};return(0,x.useEffect)(()=>()=>{k.current&&clearTimeout(k.current)},[]),(0,S.jsxs)(`div`,{style:{position:`relative`,width:`100%`,height:`100%`,background:`#000`},children:[(0,S.jsx)(MI,{onTap:de,children:s?(0,S.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#fafaf9`},children:(0,S.jsx)(VI,{size:28})}):(0,S.jsx)(WF,{serverUrl:e.serverUrl,streamKey:oe,autoPlay:!0,muted:o,showControls:!1,className:`w-full h-full`,handleOffer:se,reoffer:D,getSessionState:T,getIceServers:ee,addIceCandidate:C,getIceCandidates:w,closeSession:te,reconnectSignal:v,posterUrl:ie},oe)}),E&&(()=>{let e=_?.appearance,t=E===`motion`?e?.motionColor??FI.motion:E===`audio`?e?.audioColor??FI.audio:e?.detectionColor??FI.detection;return(0,S.jsx)(`div`,{style:{position:`absolute`,inset:0,border:`${e?.thickness??3}px solid ${t}`,boxShadow:`inset 0 0 12px ${t}`,pointerEvents:`none`}})})(),(c||ce)&&(0,S.jsxs)(`div`,{style:{position:`absolute`,left:0,right:0,top:0,display:`flex`,alignItems:`center`,gap:6,padding:`4px 8px`,background:`rgba(0,0,0,0.6)`,color:`#fafaf9`,fontSize:12,fontWeight:600,fontFamily:`system-ui, sans-serif`,pointerEvents:`none`,opacity:c||ce?1:0,transition:`opacity 150ms ease`},children:[(0,S.jsx)(`span`,{style:{width:8,height:8,borderRadius:4,background:r?`#34d399`:`#71717a`}}),(0,S.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:n})]}),(0,S.jsxs)(`div`,{style:{position:`absolute`,inset:0,opacity:+!!ce,transition:`opacity 150ms ease`,pointerEvents:`none`},children:[(0,S.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`,pointerEvents:`none`},children:(0,S.jsx)(zI,{label:s?`Play`:`Pause`,big:!0,enabled:ce,onClick:e=>{A(e),d(t)},children:s?(0,S.jsx)(VI,{size:22}):(0,S.jsx)(HI,{size:22})})}),(0,S.jsxs)(`div`,{style:{position:`absolute`,left:8,bottom:8,display:`flex`,gap:8,pointerEvents:`none`},children:[(0,S.jsx)(zI,{label:l?`Mute`:`Listen`,active:l,enabled:ce,onClick:e=>{A(e),f(t)},children:l?(0,S.jsx)(UI,{size:18}):(0,S.jsx)(WI,{size:18})}),(0,S.jsx)(zI,{label:u?`Stop talk`:`Talk`,active:u,enabled:ce,onClick:e=>{A(e),p(t)},children:(0,S.jsx)(GI,{size:18,muted:!u})}),h&&g?(0,S.jsx)(zI,{label:`PTZ`,enabled:ce,onClick:e=>{A(e),g(t)},children:(0,S.jsx)(qI,{size:18})}):null]}),(0,S.jsx)(`div`,{style:{position:`absolute`,right:8,bottom:8,pointerEvents:`none`},children:(0,S.jsx)(zI,{label:`Open`,enabled:ce,onClick:e=>{A(e),m(t)},children:(0,S.jsx)(KI,{size:18})})})]})]})}function zI({children:e,label:t,onClick:n,big:r=!1,active:a=!1,enabled:o=!0}){let s=r?52:40;return(0,S.jsx)(`button`,{type:`button`,"aria-label":t,onClick:n,style:{width:s,height:s,borderRadius:s/2,border:`none`,display:`flex`,alignItems:`center`,justifyContent:`center`,background:a?`rgba(59,130,246,0.85)`:`rgba(0,0,0,0.55)`,color:`#fafaf9`,cursor:`pointer`,padding:0,WebkitTapHighlightColor:`transparent`,pointerEvents:o?`auto`:`none`},children:e})}var BI={fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`};function VI({size:e}){return(0,S.jsx)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,children:(0,S.jsx)(`polygon`,{points:`6 4 20 12 6 20 6 4`,fill:`currentColor`})})}function HI({size:e}){return(0,S.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,children:[(0,S.jsx)(`rect`,{x:`6`,y:`4`,width:`4`,height:`16`,fill:`currentColor`}),(0,S.jsx)(`rect`,{x:`14`,y:`4`,width:`4`,height:`16`,fill:`currentColor`})]})}function UI({size:e}){return(0,S.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,...BI,children:[(0,S.jsx)(`polygon`,{points:`11 5 6 9 2 9 2 15 6 15 11 19 11 5`}),(0,S.jsx)(`path`,{d:`M19.07 4.93a10 10 0 010 14.14M15.54 8.46a5 5 0 010 7.07`})]})}function WI({size:e}){return(0,S.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,...BI,children:[(0,S.jsx)(`polygon`,{points:`11 5 6 9 2 9 2 15 6 15 11 19 11 5`}),(0,S.jsx)(`line`,{x1:`23`,y1:`9`,x2:`17`,y2:`15`}),(0,S.jsx)(`line`,{x1:`17`,y1:`9`,x2:`23`,y2:`15`})]})}function GI({size:e,muted:t}){return(0,S.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,...BI,children:[(0,S.jsx)(`path`,{d:`M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z`}),(0,S.jsx)(`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2M12 19v4`}),t&&(0,S.jsx)(`line`,{x1:`3`,y1:`3`,x2:`21`,y2:`21`})]})}function KI({size:e}){return(0,S.jsx)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,...BI,children:(0,S.jsx)(`path`,{d:`M15 3h6v6M21 3l-9 9M21 14v5a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5`})})}function qI({size:e}){return(0,S.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,...BI,children:[(0,S.jsx)(`path`,{d:`M12 2v20M2 12h20`}),(0,S.jsx)(`path`,{d:`M12 2l-3 3M12 2l3 3M12 22l-3-3M12 22l3-3M2 12l3-3M2 12l3 3M22 12l-3-3M22 12l-3 3`})]})}function JI({message:e}){return(0,x.useEffect)(()=>DI(TI(`error`,e)),[e]),(0,S.jsxs)(`div`,{style:{position:`fixed`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`#000`,color:`#f87171`,fontFamily:`system-ui, sans-serif`,fontSize:13,padding:16,textAlign:`center`},children:[`Grid embed config error: `,e]})}function YI({system:e,config:t}){let[n,r]=(0,x.useState)(()=>new Set(t.audioOnIds??[])),a=_I(),o=(0,x.useRef)(a.setActiveMic);o.current=a.setActiveMic;let[s,c]=(0,x.useState)(()=>new Set(t.pausedIds??[])),[l,u]=(0,x.useState)(t.highlight),[d,f]=(0,x.useState)(t.activeOnly??!1),p=bI(t.devices,l),m=(0,x.useMemo)(()=>d?t.devices.filter(e=>p.has(e)):t.devices,[d,t.devices,p]),[h,g]=(0,x.useState)(t.quality),[_,v]=(0,x.useState)(t.layout),[y,b]=(0,x.useState)(t.showName),[ee,C]=(0,x.useState)(0),[w,te]=(0,x.useState)(()=>t.snapshots??{}),T=(0,x.useMemo)(()=>new Set(t.ptzIds??[]),[t.ptzIds]),[E,ne]=(0,x.useState)({w:window.innerWidth,h:window.innerHeight}),[re,ie]=(0,x.useState)({});(0,x.useEffect)(()=>{let t=!1;return e.trpcClient.deviceManager.listAll.query({}).then(e=>{if(t)return;let n={};for(let t of e)n[t.id]={name:t.name??`Camera ${t.id}`,online:t.online??!1};ie(n)}).catch(()=>{}),()=>{t=!0}},[e]),(0,x.useEffect)(()=>(window.__camstackGrid={setAudioOn:e=>r(new Set(e)),setMutedAll:e=>{e&&r(new Set)},setActiveMic:e=>o.current(e),setHighlight:e=>u(e),setActiveOnly:e=>f(e),setPaused:e=>c(new Set(e)),setQuality:e=>g(e),setLayout:e=>v(e),setShowName:b,setShowBadges:()=>{},setSnapshots:e=>te(e),fit:(e,t)=>ne({w:e,h:t}),reconnect:()=>C(e=>e+1)},DI(TI(`ready`)),()=>{window.__camstackGrid&&delete window.__camstackGrid}),[]),(0,x.useEffect)(()=>fI(e=>{let t=window.__camstackGrid;if(t)switch(e.kind){case`setAudioOn`:t.setAudioOn(e.value);break;case`setMutedAll`:t.setMutedAll(e.value);break;case`setActiveMic`:t.setActiveMic(e.value);break;case`setHighlight`:t.setHighlight(e.value);break;case`setActiveOnly`:t.setActiveOnly(e.value);break;case`setPaused`:t.setPaused(e.value);break;case`setQuality`:t.setQuality(e.value);break;case`setLayout`:t.setLayout(e.value);break;case`setShowName`:t.setShowName(e.value);break;case`setShowBadges`:t.setShowBadges(e.value);break;case`setSnapshots`:t.setSnapshots(e.value);break;case`fit`:t.fit(e.w,e.h);break;case`reconnect`:t.reconnect();break;default:break}}),[]);let ae=(0,x.useMemo)(()=>gI(m.length,E.w,E.h,_),[m.length,E.w,E.h,_]),oe=(0,x.useRef)(null);return(0,x.useEffect)(()=>{let e=oe.current;if(!e)return;let t=[];e.querySelectorAll(`[data-device-id]`).forEach(e=>{let n=Number(e.dataset.deviceId),r=e.getBoundingClientRect();t.push({deviceId:n,rect:{x:r.x,y:r.y,w:r.width,h:r.height}})}),t.length&&DI(EI(t))},[ae,m]),(0,S.jsxs)(`div`,{ref:oe,style:{position:`fixed`,inset:0,background:`#000`,display:`flex`,flexWrap:`wrap`,alignItems:`center`,justifyContent:`center`},children:[d&&m.length===0&&(0,S.jsx)(`div`,{style:{color:`#a1a1aa`,fontFamily:`system-ui, sans-serif`,fontSize:14,padding:24,textAlign:`center`},children:`No active cameras`}),m.map(t=>(0,S.jsx)(`div`,{"data-device-id":t,style:{width:ae.cellW,height:ae.cellH},children:(0,S.jsx)(RI,{system:e,deviceId:t,name:re[t]?.name??`Camera ${t}`,online:re[t]?.online??!1,quality:h,muted:!n.has(t),paused:s.has(t),showName:y,audioActive:n.has(t),micActive:a.activeMicId===t,onTogglePause:e=>DI(CI(e)),onToggleAudio:e=>DI(SI(e)),onToggleMic:a.toggleMic,onOpen:e=>DI(xI(e)),ptzSupported:T.has(t),onPtz:e=>DI(wI(e)),highlight:l,reconnectSignal:ee,posterUrl:w[String(t)]})},t))]})}function XI(){let e=mI(`grid`,()=>window.__CAMSTACK_GRID__,cI),t=(0,x.useMemo)(()=>e===null||!e.ok?null:{system:RE({serverUrl:e.config.serverUrl,token:e.config.token}),queryClient:new st({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}})},[e]);return(0,x.useEffect)(()=>{if(t)return()=>t.system.close()},[t]),e===null?null:e.ok?t?(0,S.jsx)(UN,{system:t.system,children:(0,S.jsx)(ut,{client:t.queryClient,children:(0,S.jsx)($.Provider,{client:t.system.trpcClient,queryClient:t.queryClient,children:(0,S.jsx)(YI,{system:t.system,config:e.config})})})}):(0,S.jsx)(JI,{message:`Failed to initialise the grid embed`}):(0,S.jsx)(JI,{message:e.error})}function ZI(e){switch(e.kind){case`seekTo`:return{t:`seek`,epoch:e.epochMs};case`scrubEnd`:return{t:`scrubCommit`,epoch:e.epochMs};case`play`:return{t:`setRate`,rate:1};case`pause`:return{t:`setRate`,rate:0};case`goLive`:return{t:`goLive`};case`playRecorded`:return{t:`playRecorded`,deviceId:e.deviceId,epoch:e.epochMs,profile:e.profile};case`scrubStart`:case`scrubTo`:return null}}var QI=class{capacity;dispose;map=new Map;constructor(e,t){this.capacity=e,this.dispose=t}has(e){return this.map.has(e)}get(e){if(!this.map.has(e))return;let t=this.map.get(e);return this.map.delete(e),t!==void 0&&this.map.set(e,t),t}set(e,t){if(this.map.has(e)){let t=this.map.get(e);this.map.delete(e),t!==void 0&&this.dispose?.(t)}for(this.map.set(e,t);this.map.size>this.capacity;){let e=this.map.keys().next().value;if(e===void 0)break;let t=this.map.get(e);this.map.delete(e),t!==void 0&&this.dispose?.(t)}}clear(){this.map.forEach(e=>this.dispose?.(e)),this.map.clear()}};function $I(e){try{return new URL(e).toString()}catch{let t=typeof window<`u`&&window.location?.origin?window.location.origin:`http://localhost`;return new URL(e,t).toString()}}function eL(e,t){return new URL(t,e).toString()}function tL(e){let t=(e.split(`/`).pop()??``).match(/^(\d+)-(\d+)(?:-\d+)?\.m4s$/);return t?{startMs:Number(t[1]),durMs:Number(t[2])}:null}function nL(e,t){let n=e.split(`
|
|
76
|
+
`)};function Sk(e,t,n,r,a,o){return r(xk(e,t,n,a))}var Ck=`[ Federation Runtime ]`,wk=ak(Ck);function Tk(e,t,n,r,a){e||(n===void 0?Ek(t):Ek(t,n,r,void 0,a))}function Ek(e,t,n,r,a){if(t!==void 0)return Sk(e,t,n??{},e=>{throw Error(`${Ck}: ${e}`)},r,a);let o=e;throw o instanceof Error?(o.message.startsWith(Ck)||(o.message=`${Ck}: ${o.message}`),o):Error(`${Ck}: ${o}`)}function Dk(e){e instanceof Error&&(e.message.startsWith(Ck)||(e.message=`${Ck}: ${e.message}`)),wk.warn(e)}function Ok(e,t){return e.findIndex(e=>e===t)===-1&&e.push(t),e}function kk(e){return`version`in e&&e.version?`${e.name}:${e.version}`:`entry`in e&&e.entry?`${e.name}:${e.entry}`:`${e.name}`}function Ak(e){return e.entry!==void 0}function jk(e){return!e.entry.includes(`.json`)}function Mk(e){return e&&typeof e==`object`}var Nk=Object.prototype.toString;function Pk(e){return Nk.call(e)===`[object Object]`}function Fk(e){return Array.isArray(e)?e:[e]}function Ik(e){let t={url:``,type:`global`,globalName:``};return BO||HO()||!(`ssrRemoteEntry`in e)?`remoteEntry`in e?{url:e.remoteEntry,type:e.remoteEntryType,globalName:e.globalName}:t:`ssrRemoteEntry`in e?{url:e.ssrRemoteEntry||t.url,type:e.ssrRemoteEntryType||t.type,globalName:e.globalName}:t}var Lk=(e,t)=>{let n;return n=e.endsWith(`/`)?e.slice(0,-1):e,t.startsWith(`.`)&&(t=t.slice(1)),n+=t,n},Rk=typeof globalThis==`object`?globalThis:window,zk=(()=>{try{return document.defaultView}catch{return Rk}})(),Bk=zk;function Vk(e,t,n){Object.defineProperty(e,t,{value:n,configurable:!1,writable:!0})}function Hk(e,t){return Object.hasOwnProperty.call(e,t)}Hk(Rk,`__GLOBAL_LOADING_REMOTE_ENTRY__`)||Vk(Rk,`__GLOBAL_LOADING_REMOTE_ENTRY__`,{});var Uk=Rk.__GLOBAL_LOADING_REMOTE_ENTRY__;function Wk(e){Hk(e,`__VMOK__`)&&!Hk(e,`__FEDERATION__`)&&Vk(e,`__FEDERATION__`,e.__VMOK__),Hk(e,`__FEDERATION__`)||(Vk(e,`__FEDERATION__`,{__GLOBAL_PLUGIN__:[],__INSTANCES__:[],moduleInfo:{},__SHARE__:{},__MANIFEST_LOADING__:{},__PRELOADED_MAP__:new Map}),Vk(e,`__VMOK__`,e.__FEDERATION__)),e.__FEDERATION__.__GLOBAL_PLUGIN__??=[],e.__FEDERATION__.__INSTANCES__??=[],e.__FEDERATION__.moduleInfo??={},e.__FEDERATION__.__SHARE__??={},e.__FEDERATION__.__MANIFEST_LOADING__??={},e.__FEDERATION__.__PRELOADED_MAP__??=new Map}Wk(Rk),Wk(zk);function Gk(e,t=WO()){t&&(Rk.__FEDERATION__.__DEBUG_CONSTRUCTOR__=e,Rk.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__=`2.5.1`)}function Kk(e,t){if(typeof t==`string`){if(e[t])return{value:e[t],key:t};{let n=Object.keys(e);for(let r of n){let[n,a]=r.split(`:`),o=`${n}:${t}`,s=e[o];if(s)return{value:s,key:o}}return{value:void 0,key:t}}}else Ek(`getInfoWithoutType: "key" must be a string, got ${typeof t} (${JSON.stringify(t)}).`)}var qk=()=>zk.__FEDERATION__.moduleInfo,Jk=(e,t)=>{let n=Kk(t,kk(e)).value;if(n&&!n.version&&`version`in e&&e.version&&(n.version=e.version),n)return n;if(`version`in e&&e.version){let{version:t,...n}=e,r=kk(n),a=Kk(zk.__FEDERATION__.moduleInfo,r).value;if(a?.version===t)return a}},Yk=e=>Jk(e,zk.__FEDERATION__.moduleInfo),Xk=(e,t)=>{let n=kk(e);return zk.__FEDERATION__.moduleInfo[n]=t,zk.__FEDERATION__.moduleInfo},Zk=e=>(zk.__FEDERATION__.moduleInfo={...zk.__FEDERATION__.moduleInfo,...e},()=>{let t=Object.keys(e);for(let e of t)delete zk.__FEDERATION__.moduleInfo[e]}),Qk=(e,t)=>{let n=t||`__FEDERATION_${e}:custom__`;return{remoteEntryKey:n,entryExports:Rk[n]}},$k=()=>zk.__FEDERATION__.__GLOBAL_PLUGIN__,eA=e=>Rk.__FEDERATION__.__PRELOADED_MAP__.get(e),tA=e=>Rk.__FEDERATION__.__PRELOADED_MAP__.set(e,!0),nA=`[0-9A-Za-z-]+`,rA=`(?:\\+(${nA}(?:\\.${nA})*))`,iA=`0|[1-9]\\d*`,aA=`[0-9]+`,oA=`\\d*[a-zA-Z-][a-zA-Z0-9-]*`,sA=`(?:${aA}|${oA})`,cA=`(?:-?(${sA}(?:\\.${sA})*))`,lA=`(?:${iA}|${oA})`,uA=`(?:-(${lA}(?:\\.${lA})*))`,dA=`${iA}|x|X|\\*`,fA=`[v=\\s]*(${dA})(?:\\.(${dA})(?:\\.(${dA})(?:${uA})?${rA}?)?)?`,pA=`^\\s*(${fA})\\s+-\\s+(${fA})\\s*$`,mA=`[v=\\s]*${`(${aA})\\.(${aA})\\.(${aA})`}${cA}?${rA}?`,hA=`((?:<|>)?=?)`,gA=`(\\s*)${hA}\\s*(${mA}|${fA})`,_A=`(?:~>?)`,vA=`(\\s*)${_A}\\s+`,yA=`(?:\\^)`,bA=`(\\s*)${yA}\\s+`,xA=`(<|>)?=?\\s*\\*`,SA=`^${yA}${fA}$`,CA=`v?${`(${iA})\\.(${iA})\\.(${iA})`}${uA}?${rA}?`,wA=`^${_A}${fA}$`,TA=`^${hA}\\s*${fA}$`,EA=`^${hA}\\s*(${CA})$|^$`,DA=`^\\s*>=\\s*0.0.0\\s*$`;function OA(e){return new RegExp(e)}function kA(e){return!e||e.toLowerCase()===`x`||e===`*`}function AA(...e){return t=>e.reduce((e,t)=>t(e),t)}function jA(e){return e.match(OA(EA))}function MA(e,t,n,r){let a=`${e}.${t}.${n}`;return r?`${a}-${r}`:a}function NA(e){return e.replace(OA(pA),(e,t,n,r,a,o,s,c,l,u,d,f)=>(t=kA(n)?``:kA(r)?`>=${n}.0.0`:kA(a)?`>=${n}.${r}.0`:`>=${t}`,c=kA(l)?``:kA(u)?`<${Number(l)+1}.0.0-0`:kA(d)?`<${l}.${Number(u)+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:`<=${c}`,`${t} ${c}`.trim()))}function PA(e){return e.replace(OA(gA),`$1$2$3`)}function FA(e){return e.replace(OA(vA),`$1~`)}function IA(e){return e.replace(OA(bA),`$1^`)}function LA(e){return e.trim().split(/\s+/).map(e=>e.replace(OA(SA),(e,t,n,r,a)=>kA(t)?``:kA(n)?`>=${t}.0.0 <${Number(t)+1}.0.0-0`:kA(r)?t===`0`?`>=${t}.${n}.0 <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.0 <${Number(t)+1}.0.0-0`:a?t===`0`?n===`0`?`>=${t}.${n}.${r}-${a} <${t}.${n}.${Number(r)+1}-0`:`>=${t}.${n}.${r}-${a} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.${r}-${a} <${Number(t)+1}.0.0-0`:t===`0`?n===`0`?`>=${t}.${n}.${r} <${t}.${n}.${Number(r)+1}-0`:`>=${t}.${n}.${r} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.${r} <${Number(t)+1}.0.0-0`)).join(` `)}function RA(e){return e.trim().split(/\s+/).map(e=>e.replace(OA(wA),(e,t,n,r,a)=>kA(t)?``:kA(n)?`>=${t}.0.0 <${Number(t)+1}.0.0-0`:kA(r)?`>=${t}.${n}.0 <${t}.${Number(n)+1}.0-0`:a?`>=${t}.${n}.${r}-${a} <${t}.${Number(n)+1}.0-0`:`>=${t}.${n}.${r} <${t}.${Number(n)+1}.0-0`)).join(` `)}function zA(e){return e.split(/\s+/).map(e=>e.trim().replace(OA(TA),(e,t,n,r,a,o)=>{let s=kA(n),c=s||kA(r),l=c||kA(a);return t===`=`&&l&&(t=``),o=``,s?t===`>`||t===`<`?`<0.0.0-0`:`*`:t&&l?(c&&(r=0),a=0,t===`>`?(t=`>=`,c?(n=Number(n)+1,r=0,a=0):(r=Number(r)+1,a=0)):t===`<=`&&(t=`<`,c?n=Number(n)+1:r=Number(r)+1),t===`<`&&(o=`-0`),`${t+n}.${r}.${a}${o}`):c?`>=${n}.0.0${o} <${Number(n)+1}.0.0-0`:l?`>=${n}.${r}.0${o} <${n}.${Number(r)+1}.0-0`:e})).join(` `)}function BA(e){return e.trim().replace(OA(xA),``)}function VA(e){return e.trim().replace(OA(DA),``)}function HA(e,t){return e=Number(e)||e,t=Number(t)||t,e>t?1:e===t?0:-1}function UA(e,t){let{preRelease:n}=e,{preRelease:r}=t;if(n===void 0&&r)return 1;if(n&&r===void 0)return-1;if(n===void 0&&r===void 0)return 0;for(let e=0,t=n.length;e<=t;e++){let t=n[e],a=r[e];if(t!==a)return t===void 0&&a===void 0?0:t?a?HA(t,a):-1:1}return 0}function WA(e,t){return HA(e.major,t.major)||HA(e.minor,t.minor)||HA(e.patch,t.patch)||UA(e,t)}function GA(e,t){return e.version===t.version}function KA(e,t){switch(e.operator){case``:case`=`:return GA(e,t);case`>`:return WA(e,t)<0;case`>=`:return GA(e,t)||WA(e,t)<0;case`<`:return WA(e,t)>0;case`<=`:return GA(e,t)||WA(e,t)>0;case void 0:return!0;default:return!1}}function qA(e){return AA(LA,RA,zA,BA)(e)}function JA(e){return AA(NA,PA,FA,IA)(e.trim()).split(/\s+/).join(` `)}function YA(e,t){if(!e)return!1;let n=jA(e);if(!n)return!1;let[,r,,a,o,s,c]=n,l={operator:r,version:MA(a,o,s,c),major:a,minor:o,patch:s,preRelease:c?.split(`.`)},u=t.split(`||`);for(let e of u){let t=e.trim();if(!t||t===`*`||t===`x`)return!0;try{let e=JA(t);if(!e.trim())return!0;let n=e.split(` `).map(e=>qA(e)).join(` `);if(!n.trim())return!0;let r=n.split(/\s+/).map(e=>VA(e)).filter(Boolean);if(r.length===0)continue;let a=!0;for(let e of r){let t=jA(e);if(!t){a=!1;break}let[,n,,r,o,s,c]=t;if(!KA({operator:n,version:MA(r,o,s,c),major:r,minor:o,patch:s,preRelease:c?.split(`.`)},l)){a=!1;break}}if(a)return!0}catch(e){console.error(`[semver] Error processing range part "${t}":`,e);continue}}return!1}var XA=`default`,ZA=`global`;function QA(e,t,n,r){let a;return a=`get`in e?e.get:`lib`in e?()=>Promise.resolve(e.lib):()=>Promise.resolve(()=>{Ek(`Cannot get shared "${n}" from "${t}": neither "get" nor "lib" is provided in the share config.`)}),e.shareConfig?.eager&&e.treeShaking?.mode&&Ek(`Invalid shared config for "${n}" from "${t}": cannot use both "eager: true" and "treeShaking.mode" simultaneously. Choose one strategy.`),{deps:[],useIn:[],from:t,loading:null,...e,shareConfig:{requiredVersion:`^${e.version}`,singleton:!1,eager:!1,strictVersion:!1,...e.shareConfig},get:a,loaded:e?.loaded||`lib`in e?!0:void 0,version:e.version??`0`,scope:Array.isArray(e.scope)?e.scope:[e.scope??`default`],strategy:(e.strategy??r)||`version-first`,treeShaking:e.treeShaking?{...e.treeShaking,mode:e.treeShaking.mode??`server-calc`,status:e.treeShaking.status??zO.UNKNOWN,useIn:[]}:void 0}}function $A(e,t){let n=t.shared||{},r=t.name,a=Object.keys(n).reduce((e,a)=>{let o=Fk(n[a]);return e[a]=e[a]||[],o.forEach(n=>{e[a].push(QA(n,r,a,t.shareStrategy))}),e},{}),o={...e.shared};return Object.keys(a).forEach(e=>{o[e]?a[e].forEach(t=>{o[e].find(e=>e.version===t.version)||o[e].push(t)}):o[e]=a[e]}),{allShareInfos:o,newShareInfos:a}}function ej(e,t){if(!e)return!1;let{status:n,mode:r}=e;return n===zO.NO_USE?!1:n===zO.CALCULATED?!0:r===`runtime-infer`?t?aj(e,t):!0:!1}function tj(e,t){let n=e=>{if(!Number.isNaN(Number(e))){let t=e.split(`.`),n=e;for(let e=0;e<3-t.length;e++)n+=`.0`;return n}return e};return!!YA(n(e),`<=${n(t)}`)}var nj=(e,t)=>{let n=t||function(e,t){return tj(e,t)};return Object.keys(e).reduce((e,t)=>!e||n(e,t)||e===`0`?t:e,0)},rj=e=>!!e.loaded||typeof e.lib==`function`,ij=e=>!!e.loading,aj=(e,t)=>{if(!e||!t)return!1;let{usedExports:n}=e;return n?!!t.every(e=>n.includes(e)):!1};function oj(e,t,n,r){let a=e[t][n],o=``,s=ej(r),c=function(e,t){return s?a[e].treeShaking?a[t].treeShaking?!rj(a[e].treeShaking)&&tj(e,t):!1:!0:!rj(a[e])&&tj(e,t)};if(s){if(o=nj(e[t][n],c),o)return{version:o,useTreesShaking:s};s=!1}return{version:nj(e[t][n],c),useTreesShaking:s}}var sj=e=>rj(e)||ij(e);function cj(e,t,n,r){let a=e[t][n],o=``,s=ej(r),c=function(e,t){if(s){if(!a[e].treeShaking)return!0;if(!a[t].treeShaking)return!1;if(sj(a[t].treeShaking))return sj(a[e].treeShaking)?!!tj(e,t):!0;if(sj(a[e].treeShaking))return!1}return sj(a[t])?sj(a[e])?!!tj(e,t):!0:sj(a[e])?!1:tj(e,t)};if(s){if(o=nj(e[t][n],c),o)return{version:o,useTreesShaking:s};s=!1}return{version:nj(e[t][n],c),useTreesShaking:s}}function lj(e){return e===`loaded-first`?cj:oj}function uj(e,t,n,r){if(!e)return;let{shareConfig:a,scope:o=XA,strategy:s,treeShaking:c}=n,l=Array.isArray(o)?o:[o];for(let o of l)if(a&&e[o]&&e[o][t]){let{requiredVersion:l}=a,{version:u,useTreesShaking:d}=lj(s)(e,o,t,c),f={shareScopeMap:e,scope:o,pkgName:t,version:u,GlobalFederation:Bk.__FEDERATION__,shareInfo:n,resolver:()=>{let r=e[o][t][u];if(a.singleton){if(typeof l==`string`&&!YA(u,l)){let e=`Version ${u} from ${u&&r.from} of shared singleton module ${t} does not satisfy the requirement of ${n.from} which needs ${l})`;a.strictVersion?Ek(e):Dk(e)}return{shared:r,useTreesShaking:d}}else{if(l===!1||l===`*`||YA(u,l))return{shared:r,useTreesShaking:d};let n=ej(c);if(n){for(let[r,a]of Object.entries(e[o][t]))if(ej(a.treeShaking,c?.usedExports)&&YA(r,l))return{shared:a,useTreesShaking:n}}for(let[n,r]of Object.entries(e[o][t]))if(YA(n,l))return{shared:r,useTreesShaking:!1}}}};return(r.emit(f)||f).resolver()}}function dj(){return Bk.__FEDERATION__.__SHARE__}function fj(e){let{pkgName:t,extraOptions:n,shareInfos:r}=e,a=n?.resolver??(e=>{if(!e)return;let t={};return e.forEach(e=>{t[e.version]=e}),t[nj(t,function(e,n){return!rj(t[e])&&tj(e,n)})]}),o=e=>typeof e==`object`&&!!e&&!Array.isArray(e),s=(...e)=>{let t={};for(let n of e)if(n)for(let[e,r]of Object.entries(n)){let n=t[e];o(n)&&o(r)?t[e]=s(n,r):r!==void 0&&(t[e]=r)}return t};return s(a(r[t]),n?.customShareInfo)}var pj=(e,t)=>{e.useIn||=[],Ok(e.useIn,t)};function mj(e,t){return t&&e.treeShaking?e.treeShaking:e}function hj(e,t){return!t||t===`.`?e:`${e}/${t.replace(/^\.\//,``)}`}function gj(e,t){for(let n of e){let e=t.startsWith(n.name),r=t.replace(n.name,``);if(e){if(r.startsWith(`/`)){let e=n.name;return r=`.${r}`,{pkgNameOrAlias:e,expose:r,remote:n}}else if(r===``)return{pkgNameOrAlias:n.name,expose:`.`,remote:n}}let a=n.alias&&t.startsWith(n.alias),o=n.alias&&t.replace(n.alias,``);if(n.alias&&a){if(o&&o.startsWith(`/`)){let e=n.alias;return o=`.${o}`,{pkgNameOrAlias:e,expose:o,remote:n}}else if(o===``)return{pkgNameOrAlias:n.alias,expose:`.`,remote:n}}}}function _j(e,t){for(let n of e)if(t===n.name||n.alias&&t===n.alias)return n}var vj=`RUNTIME-001`,yj=`RUNTIME-002`,bj=`RUNTIME-003`,xj=`RUNTIME-004`,Sj=`RUNTIME-005`,Cj=`RUNTIME-006`,wj=`RUNTIME-007`,Tj=`RUNTIME-008`,Ej=`RUNTIME-009`,Dj=`RUNTIME-010`,Oj=`RUNTIME-011`,kj=`RUNTIME-012`,Aj=`RUNTIME-013`,jj=`RUNTIME-014`,Mj=`RUNTIME-015`,Nj=`TYPE-001`,Pj=`BUILD-001`,Fj=`BUILD-002`,Ij={[vj]:`Failed to get remoteEntry exports.`,[yj]:`The remote entry interface does not contain "init"`,[bj]:`Failed to get manifest.`,[xj]:`Failed to locate remote.`,[Sj]:`Invalid loadShareSync function call from bundler runtime`,[Cj]:`Invalid loadShareSync function call from runtime`,[wj]:`Failed to get remote snapshot.`,[Tj]:`Failed to load script resources.`,[Ej]:`Please call createInstance first.`,[Dj]:`The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use "createInstance" api.`,[Oj]:`The remoteEntry URL is missing from the remote snapshot.`,[kj]:`The getter for the shared module is not a function. This may be caused by setting "shared.import: false" without the host providing the corresponding lib.`,[Aj]:`The manifest is not a valid Module Federation manifest.`,[jj]:`The remote does not expose the requested module.`,[Mj]:`Remote container initialization failed.`},Lj={[Nj]:`Failed to generate type declaration. Execute the below cmd to reproduce and fix the error.`},Rj={[Pj]:`Failed to find expose module.`,[Fj]:`PublicPath is required in prod mode.`};({...Ij,...Lj,...Rj});var zj=`.then(callbacks[0]).catch(callbacks[1])`;async function Bj({entry:e,remoteEntryExports:t}){return new Promise((n,r)=>{try{t?n(t):typeof FEDERATION_ALLOW_NEW_FUNCTION<`u`?Function(`callbacks`,`import("${e}")${zj}`)([n,r]):tD(()=>import(e).then(n),[],import.meta.url).catch(r)}catch(t){Ek(`Failed to load ESM entry from "${e}". ${t instanceof Error?t.message:String(t)}`)}})}async function Vj({entry:e,remoteEntryExports:t}){return new Promise((n,r)=>{try{t?n(t):typeof __system_context__>`u`?System.import(e).then(n).catch(r):Function(`callbacks`,`System.import("${e}")${zj}`)([n,r])}catch(t){Ek(`Failed to load SystemJS entry from "${e}". ${t instanceof Error?t.message:String(t)}`)}})}function Hj(e,t,n){let{remoteEntryKey:r,entryExports:a}=Qk(e,t);return a||Ek(vj,Ij,{remoteName:e,remoteEntryUrl:n,remoteEntryKey:r}),a}async function Uj({name:e,globalName:t,entry:n,remoteInfo:r,loaderHook:a,getEntryUrl:o,resourceContext:s}){let{entryExports:c}=Qk(e,t);if(c)return c;let l=o?o(n):n;return dk(l,{attrs:{},createScriptHook:(e,t)=>{let n=a.lifecycle.createScript.emit({url:e,attrs:t,remoteInfo:r,resourceContext:s?{...s,url:e}:void 0});if(n&&(n instanceof HTMLScriptElement||`script`in n||`timeout`in n))return n}}).then(()=>Hj(e,t,n),t=>{let n=t instanceof Error?t.message:String(t);Ek(Tj,Ij,{remoteName:e,resourceUrl:l},n)})}async function Wj({remoteInfo:e,remoteEntryExports:t,loaderHook:n,getEntryUrl:r,resourceContext:a}){let{entry:o,entryGlobalName:s,name:c,type:l}=e;switch(l){case`esm`:case`module`:return Bj({entry:o,remoteEntryExports:t});case`system`:return Vj({entry:o,remoteEntryExports:t});default:return Uj({entry:o,globalName:s,name:c,remoteInfo:e,loaderHook:n,getEntryUrl:r,resourceContext:a})}}async function Gj({remoteInfo:e,loaderHook:t,resourceContext:n}){let{entry:r,entryGlobalName:a,name:o,type:s}=e,{entryExports:c}=Qk(o,a);return c||_k(r,{attrs:{name:o,globalName:a,type:s},loaderHook:{createScriptHook:(r,a={})=>{let o=t.lifecycle.createScript.emit({url:r,attrs:a,remoteInfo:e,resourceContext:n?{...n,url:r}:void 0});if(o&&`url`in o)return o}}}).then(()=>Hj(o,a,r)).catch(e=>{Ek(`Failed to load Node.js entry for remote "${o}" from "${r}". ${e instanceof Error?e.message:String(e)}`)})}function Kj(e){let{entry:t,name:n}=e;return KO(n,t)}async function qj(e){let{origin:t,remoteEntryExports:n,remoteInfo:r,getEntryUrl:a,resourceContext:o,_inErrorHandling:s=!1}=e,c=Kj(r);if(n)return n;if(!Uk[c]){let e=t.remoteHandler.hooks.lifecycle.loadEntry,l=t.loaderHook;Uk[c]=e.emit({origin:t,loaderHook:l,remoteInfo:r,remoteEntryExports:n}).then(e=>e||((typeof ENV_TARGET<`u`?ENV_TARGET===`web`:BO)?Wj({remoteInfo:r,remoteEntryExports:n,loaderHook:l,getEntryUrl:a,resourceContext:o}):Gj({remoteInfo:r,loaderHook:l,resourceContext:o}))).then(async e=>(await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:r,remoteEntryExports:e}),e)).catch(async e=>{let a=Kj(r),o=e instanceof Error&&e.message.includes(`ScriptExecutionError`);if(e instanceof Error&&e.message.includes(`RUNTIME-008`)&&!o&&!s){let e=await t.loaderHook.lifecycle.loadEntryError.emit({getRemoteEntry:e=>qj({...e,_inErrorHandling:!0}),origin:t,remoteInfo:r,remoteEntryExports:n,globalLoading:Uk,uniqueKey:a});if(e)return await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:r,remoteEntryExports:e,recovered:!0}),e}throw await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:r,error:e}),e})}return Uk[c]}function Jj(e){return{...e,entry:`entry`in e?e.entry:``,type:e.type||`global`,entryGlobalName:e.entryGlobalName||e.name,shareScope:e.shareScope||`default`}}function Yj(){return typeof FEDERATION_BUILD_IDENTIFIER<`u`?FEDERATION_BUILD_IDENTIFIER:``}function Xj(e,t){let n=$k(),r=[t.hooks,t.remoteHandler.hooks,t.sharedHandler.hooks,t.snapshotHandler.hooks,t.loaderHook,t.bridgeHook];return n.length>0&&n.forEach(t=>{e?.find(e=>e.name!==t.name)&&e.push(t)}),e&&e.length>0&&e.forEach(e=>{r.forEach(n=>{n.applyPlugin(e,t)})}),e}function Zj(e){return{name:e.name,alias:e.alias,entry:`entry`in e?e.entry:void 0,version:`version`in e?e.version:void 0,type:e.type,entryGlobalName:e.entryGlobalName,shareScope:e.shareScope}}function Qj(e){let t={};for(let[n,r]of Object.entries(e.shared)){let e=r[0];e&&(t[n]={version:e.version,singleton:e.shareConfig?.singleton,requiredVersion:e.shareConfig?.requiredVersion===!1?!1:e.shareConfig?.requiredVersion,eager:e.eager,strictVersion:e.shareConfig?.strictVersion})}return{project:{name:e.name,mfRole:e.remotes?.length>0?`host`:`unknown`},mfConfig:{name:e.name,remotes:e.remotes?.map(Zj)??[],shared:t}}}function $j(e){return{resourceCategory:`sync`,share:!0,depsRemote:!0,...e}}function eM(e,t){return t.map(t=>{let n=_j(e,t.nameOrAlias);return Tk(n,`Unable to preload ${t.nameOrAlias} as it is not included in ${!n&&YO({remoteInfo:n,remotes:e})}`),{remote:n,preloadConfig:$j(t)}})}function tM(e){return e?e.map(e=>e===`.`?e:e.startsWith(`./`)?e.replace(`./`,``):e):[]}function nM(e){return e instanceof Error?e.message.includes(`timed out`)||e.name.includes(`Timeout`):!1}function rM(e,t,n,r){return{url:t,status:n,resourceType:e.resourceType,initiator:e.initiator,id:e.id,error:r}}async function iM(e,t,n,r){let a=e.moduleCache.get(n.name),o=n.entry;if(a?.remoteEntryExports)return rM(r,o,`cached`);try{if(!await qj({origin:e,remoteInfo:n,remoteEntryExports:a?.remoteEntryExports,resourceContext:{...r,url:o}}))throw Error(`Failed to load remoteEntry "${o}".`);return rM(r,o,`success`)}catch(e){return rM(r,o,nM(e)?`timeout`:`error`,e)}}function aM({host:e,remoteInfo:t,url:n,attrs:r,context:a,needDeleteLink:o}){return new Promise(s=>{let{link:c,needAttach:l}=uk({url:n,cb:()=>{s(rM(a,n,l?`success`:`cached`))},onErrorCallback:e=>{s(rM(a,n,nM(e)?`timeout`:`error`,e))},attrs:r,createLinkHook:(n,r)=>{let o=e.loaderHook.lifecycle.createLink.emit({url:n,attrs:r,remoteInfo:t,resourceContext:{...a,url:n}});return o instanceof HTMLLinkElement,o},needDeleteLink:o});l&&document.head.appendChild(c)})}function oM({host:e,remoteInfo:t,url:n,attrs:r,context:a}){return new Promise(o=>{let{script:s,needAttach:c}=lk({url:n,cb:()=>{o(rM(a,n,c?`success`:`cached`))},onErrorCallback:e=>{o(rM(a,n,nM(e)?`timeout`:`error`,e))},attrs:r,createScriptHook:(n,r)=>{let o=e.loaderHook.lifecycle.createScript.emit({url:n,attrs:r,remoteInfo:t,resourceContext:{...a,url:n}});return o instanceof HTMLScriptElement,o},needDeleteScript:!0});c&&document.head.appendChild(s)})}function sM(e,t){return{...e,resourceType:t}}function cM(e,t,n,r=!0,a={initiator:`preloadRemote`,id:e.name}){let{cssAssets:o,jsAssetsWithoutEntry:s,entryAssets:c}=n,l=[];if(t.options.inBrowser){if(c.forEach(n=>{let{moduleInfo:r}=n;l.push(iM(t,e,r,sM(a,`remoteEntry`)))}),r){let n={rel:`preload`,as:`style`};o.forEach(r=>{l.push(aM({host:t,remoteInfo:e,url:r,attrs:n,context:sM(a,`css`)}))})}else{let n={rel:`stylesheet`,type:`text/css`};o.forEach(r=>{l.push(aM({host:t,remoteInfo:e,url:r,attrs:n,needDeleteLink:!1,context:sM(a,`css`)}))})}if(r){let n={rel:`preload`,as:`script`};s.forEach(r=>{l.push(aM({host:t,remoteInfo:e,url:r,attrs:n,context:sM(a,`js`)}))})}else{let n={fetchpriority:`high`,type:e?.type===`module`?`module`:`text/javascript`};s.forEach(r=>{l.push(oM({host:t,remoteInfo:e,url:r,attrs:n,context:sM(a,`js`)}))})}}return Promise.all(l)}function lM(e){if(!e||!(`modules`in e)||!Array.isArray(e.modules))return;let t=e.modules.map(e=>e.moduleName).filter(Boolean);return t.length?t.join(`,`):void 0}function uM(e,t,n){let r=t,a=Array.isArray(e.shareScope)?e.shareScope:[e.shareScope];a.length||a.push(`default`),a.forEach(e=>{r[e]||(r[e]={})});let o={version:e.version||``,shareScopeKeys:Array.isArray(e.shareScope)?a:e.shareScope||`default`};return Object.defineProperty(o,"shareScopeMap",{value:r,enumerable:!1}),{remoteEntryInitOptions:o,shareScope:r[a[0]],initScope:n??[]}}var dM=class{constructor({remoteInfo:e,host:t}){this.inited=!1,this.initing=!1,this.lib=void 0,this.remoteInfo=e,this.host=t}async getEntry(e){if(this.remoteEntryExports)return this.remoteEntryExports;let t=await qj({origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports,resourceContext:{initiator:`loadRemote`,id:hj(this.remoteInfo.name,e),resourceType:`remoteEntry`}});return Tk(t,`remoteEntryExports is undefined \n ${YO(this.remoteInfo)}`),this.remoteEntryExports=t,this.remoteEntryExports}async init(e,t,n,r){let a=await this.getEntry(r);if(this.inited)return await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:a,cached:!0,origin:this.host}),a;if(this.initPromise){try{await this.initPromise,await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:a,cached:!0,origin:this.host})}catch(n){throw await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:a,error:n,cached:!0,origin:this.host}),n}return a}this.initing=!0,this.initPromise=(async()=>{await this.host.loaderHook.lifecycle.beforeInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,origin:this.host});let{remoteEntryInitOptions:r,shareScope:o,initScope:s}=uM(this.remoteInfo,this.host.shareScopeMap,n),c=await this.host.hooks.lifecycle.beforeInitContainer.emit({shareScope:o,remoteEntryInitOptions:r,initScope:s,remoteInfo:this.remoteInfo,origin:this.host});a?.init===void 0&&Ek(yj,Ij,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName},void 0,Qj(this.host.options));try{await a.init(c.shareScope,c.initScope,c.remoteEntryInitOptions)}catch(e){Ek(Mj,Ij,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName,shareScope:this.remoteInfo.shareScope},`${e}`,Qj(this.host.options))}await this.host.hooks.lifecycle.initContainer.emit({...c,id:e,remoteSnapshot:t,remoteEntryExports:a}),this.inited=!0})();try{await this.initPromise,await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:a,origin:this.host})}catch(n){throw await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:a,error:n,origin:this.host}),n}finally{this.initing=!1,this.initPromise=void 0}return a}async get(e,t,n,r){let{loadFactory:a=!0}=n||{loadFactory:!0},o=await this.init(e,r,void 0,t);this.lib=o,await this.host.loaderHook.lifecycle.beforeGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:o,origin:this.host});let s;try{let n=await this.host.loaderHook.lifecycle.getModuleFactory.emit({remoteEntryExports:o,expose:t,moduleInfo:this.remoteInfo});s=typeof n==`function`?n:void 0,s||=await o.get(t),s||Ek(jj,Ij,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,expose:t,requestId:e,availableExposes:lM(r)},void 0,Qj(this.host.options)),await this.host.loaderHook.lifecycle.afterGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:o,moduleFactory:s,origin:this.host})}catch(n){throw await this.host.loaderHook.lifecycle.afterGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:o,error:n,origin:this.host}),n}let c=Lk(this.remoteInfo.name,t),l=this.wraperFactory(s,c);if(!a)return l;await this.host.loaderHook.lifecycle.beforeExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:a,origin:this.host});try{let n=await l();return await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:a,exposeModule:n,origin:this.host}),n}catch(n){throw await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:a,error:n,origin:this.host}),n}}wraperFactory(e,t){function n(e,t){e&&typeof e==`object`&&Object.isExtensible(e)&&!Object.getOwnPropertyDescriptor(e,Symbol.for(`mf_module_id`))&&Object.defineProperty(e,Symbol.for(`mf_module_id`),{value:t,enumerable:!1})}return()=>{let r=e();return r instanceof Promise?r.then(e=>(n(e,t),e)):(n(r,t),r)}}},fM=class{constructor(e){this.type=``,this.listeners=new Set,e&&(this.type=e)}on(e){typeof e==`function`&&this.listeners.add(e)}once(e){let t=this;this.on(function n(...r){return t.remove(n),e.apply(null,r)})}emit(...e){let t;return this.listeners.size>0&&this.listeners.forEach(n=>{let r=n(...e);r!==void 0&&(t=r)}),t}remove(e){this.listeners.delete(e)}removeAll(){this.listeners.clear()}},pM=class extends fM{emit(...e){let t,n=Array.from(this.listeners);if(n.length>0){let r=0,a=t=>t===!1?!1:r<n.length?Promise.resolve(n[r++].apply(null,e)).then(n=>n===void 0||e.length===1&&n===e[0]?a(t):a(n)):t;t=a()}return Promise.resolve(t)}};function mM(e,t){if(!Mk(t))return!1;if(e!==t){for(let n in e)if(!(n in t))return!1}return!0}var hM=class extends fM{constructor(e){super(),this.onerror=Ek,this.type=e}emit(e){Mk(e)||Ek(`The data for the "${this.type}" hook should be an object.`);for(let t of this.listeners)try{let n=t(e);if(n===void 0)continue;if(mM(e,n))e=n;else{this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);break}}catch(e){Dk(e),this.onerror(e)}return e}},gM=class extends fM{constructor(e){super(),this.onerror=Ek,this.type=e}emit(e){Mk(e)||Ek(`The response data for the "${this.type}" hook must be an object.`);let t=Array.from(this.listeners);if(t.length>0){let n=0,r=t=>(Dk(t),this.onerror(t),e),a=o=>{if(o!==void 0&&mM(e,o))e=o;else if(o!==void 0)return this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`),e;if(n<t.length)try{return Promise.resolve(t[n++](e)).then(a,r)}catch(e){return r(e)}return e};return Promise.resolve(a(e))}return Promise.resolve(e)}},_M=class{constructor(e){this.registerPlugins={},this.lifecycle=e,this.lifecycleKeys=Object.keys(e)}applyPlugin(e,t){Tk(Pk(e),`Plugin configuration is invalid.`);let n=e.name;Tk(n,`A name must be provided by the plugin.`),this.registerPlugins[n]||(this.registerPlugins[n]=e,e.apply?.(t),Object.keys(this.lifecycle).forEach(t=>{let n=e[t];n&&this.lifecycle[t].on(n)}))}removePlugin(e){Tk(e,`A name is required.`);let t=this.registerPlugins[e];Tk(t,`The plugin "${e}" is not registered.`),Object.keys(t).forEach(e=>{e!==`name`&&this.lifecycle[e].remove(t[e])})}};function vM(e,t){let n=Ik(t);n.url||Ek(Oj,Ij,{remoteName:e.name});let r=qO(t,n.url);!BO&&!r.startsWith(`http`)&&(r=`https:${r}`),e.type=n.type,e.entryGlobalName=n.globalName,e.entry=r,e.version=t.version,e.buildVersion=t.buildVersion}function yM(){return{name:`snapshot-plugin`,async afterResolve(e){let{remote:t,pkgNameOrAlias:n,expose:r,origin:a,remoteInfo:o,id:s}=e;if(!Ak(t)||!jk(t)){let{remoteSnapshot:c,globalSnapshot:l}=await a.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:t,id:hj(t.name,r)});vM(o,c);let u={remote:t,preloadConfig:{nameOrAlias:n,exposes:[r],resourceCategory:`sync`,share:!1,depsRemote:!1}},d=await a.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({origin:a,preloadOptions:u,remoteInfo:o,remote:t,remoteSnapshot:c,globalSnapshot:l});return d&&cM(o,a,d,!1,{initiator:`loadRemote`,id:s}).catch(()=>void 0),{...e,remoteSnapshot:c}}return e}}}function bM(e){let t=e.split(`:`);return t.length===1?{name:t[0],version:void 0}:t.length===2?{name:t[0],version:t[1]}:{name:t[1],version:t[2]}}function xM(e,t,n,r,a={},o){let{value:s}=Kk(e,kk(t)),c=o||s;if(c&&!$O(c)&&(n(c,t,r),c.remotesInfo)){let t=Object.keys(c.remotesInfo);for(let r of t){if(a[r])continue;a[r]=!0;let t=bM(r),o=c.remotesInfo[r];xM(e,{name:t.name,version:o.matchedVersion},n,!1,a,void 0)}}}var SM=(e,t)=>document.querySelector(`${e}[${e===`link`?`href`:`src`}="${t}"]`);function CM(e,t,n,r,a){let o=[],s=[],c=[],l=new Set,u=new Set,{options:d}=e,{preloadConfig:f}=t,{depsRemote:p}=f;if(xM(r,n,(t,n,r)=>{let a;if(r)a=f;else if(Array.isArray(p)){let e=p.find(e=>e.nameOrAlias===n.name||e.nameOrAlias===n.alias);if(!e)return;a=$j(e)}else if(p===!0)a=f;else return;let l=qO(t,Ik(t).url);l&&c.push({name:n.name,moduleInfo:{name:n.name,entry:l,type:`remoteEntryType`in t?t.remoteEntryType:`global`,entryGlobalName:`globalName`in t?t.globalName:n.name,shareScope:``,version:`version`in t?t.version:void 0},url:l});let u=`modules`in t?t.modules:[],d=tM(a.exposes);d.length&&`modules`in t&&(u=t?.modules?.reduce((e,t)=>(d?.indexOf(t.moduleName)!==-1&&e.push(t),e),[]));function m(e){let n=e.map(e=>qO(t,e));return a.filter?n.filter(a.filter):n}if(u){let r=u.length;for(let c=0;c<r;c++){let r=u[c],l=`${n.name}/${r.moduleName}`;e.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({id:r.moduleName===`.`?n.name:l,name:n.name,remoteSnapshot:t,preloadConfig:a,remote:n,origin:e}),!eA(l)&&(a.resourceCategory===`all`?(o.push(...m(r.assets.css.async)),o.push(...m(r.assets.css.sync)),s.push(...m(r.assets.js.async)),s.push(...m(r.assets.js.sync))):a.resourceCategory===`sync`&&(o.push(...m(r.assets.css.sync)),s.push(...m(r.assets.js.sync))),tA(l))}}},!0,{},a),a.shared&&a.shared.length>0){let t=(t,n)=>{let{shared:r}=uj(e.shareScopeMap,n.sharedName,t,e.sharedHandler.hooks.lifecycle.resolveShare)||{};r&&typeof r.lib==`function`&&(n.assets.js.sync.forEach(e=>{l.add(e)}),n.assets.css.sync.forEach(e=>{u.add(e)}))};a.shared.forEach(e=>{let n=d.shared?.[e.sharedName];if(!n)return;let r=e.version?n.find(t=>t.version===e.version):n;r&&Fk(r).forEach(n=>{t(n,e)})})}let m=s.filter(e=>!l.has(e)&&!SM(`script`,e));return{cssAssets:o.filter(e=>!u.has(e)&&!SM(`link`,e)),jsAssetsWithoutEntry:m,entryAssets:c.filter(e=>!SM(`script`,e.url))}}var wM=function(){return{name:`generate-preload-assets-plugin`,async generatePreloadAssets(e){let{origin:t,preloadOptions:n,remoteInfo:r,remote:a,globalSnapshot:o,remoteSnapshot:s}=e;return BO?Ak(a)&&jk(a)?{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[{name:a.name,url:a.entry,moduleInfo:{name:r.name,entry:a.entry,type:r.type||`global`,entryGlobalName:``,shareScope:``}}]}:(vM(r,s),CM(t,n,r,o,s)):{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[]}}}};function TM(e,t){let n=Yk({name:t.name,version:t.options.version}),r=n&&`remotesInfo`in n&&n.remotesInfo&&Kk(n.remotesInfo,e.name).value;return r&&r.matchedVersion?{hostGlobalSnapshot:n,globalSnapshot:qk(),remoteSnapshot:Yk({name:e.name,version:r.matchedVersion})}:{hostGlobalSnapshot:void 0,globalSnapshot:qk(),remoteSnapshot:Yk({name:e.name,version:`version`in e?e.version:void 0})}}var EM=class{constructor(e){this.loadingHostSnapshot=null,this.manifestCache=new Map,this.hooks=new _M({beforeLoadRemoteSnapshot:new pM(`beforeLoadRemoteSnapshot`),loadSnapshot:new gM(`loadGlobalSnapshot`),loadRemoteSnapshot:new gM(`loadRemoteSnapshot`),afterLoadSnapshot:new gM(`afterLoadSnapshot`)}),this.manifestLoading=Bk.__FEDERATION__.__MANIFEST_LOADING__,this.HostInstance=e,this.loaderHook=e.loaderHook}async loadRemoteSnapshotInfo({moduleInfo:e,id:t,initiator:n=`loadRemote`}){let{options:r}=this.HostInstance;await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({options:r,moduleInfo:e,origin:this.HostInstance});let a=Yk({name:this.HostInstance.options.name,version:this.HostInstance.options.version});a||(a={version:this.HostInstance.options.version||``,remoteEntry:``,remotesInfo:{}},Zk({[this.HostInstance.options.name]:a})),a&&`remotesInfo`in a&&!Kk(a.remotesInfo,e.name).value&&(`version`in e||`entry`in e)&&(a.remotesInfo={...a?.remotesInfo,[e.name]:{matchedVersion:`version`in e?e.version:e.entry}});let{hostGlobalSnapshot:o,remoteSnapshot:s,globalSnapshot:c}=this.getGlobalRemoteInfo(e),{remoteSnapshot:l,globalSnapshot:u}=await this.hooks.lifecycle.loadSnapshot.emit({options:r,moduleInfo:e,hostGlobalSnapshot:o,remoteSnapshot:s,globalSnapshot:c}),d,f;if(l)if($O(l)){let r=BO?l.remoteEntry:l.ssrRemoteEntry||l.remoteEntry||``,a=await this.loadManifestSnapshot(r,e,{},{initiator:n,id:t||e.name}),o=Xk({...e,entry:r},a);d=a,f=o}else{let{remoteSnapshot:t}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:l,from:`global`});d=t,f=u}else if(Ak(e)){let r=await this.loadManifestSnapshot(e.entry,e,{},{initiator:n,id:t||e.name}),a=Xk(e,r);d=r,f=a}else Ek(wj,Ij,{remoteName:e.name,remoteVersion:e.version,hostName:this.HostInstance.options.name,globalSnapshot:JSON.stringify(u)},void 0,Qj(this.HostInstance.options));return await this.hooks.lifecycle.afterLoadSnapshot.emit({id:t,host:this.HostInstance,options:r,moduleInfo:e,remoteSnapshot:d}),{remoteSnapshot:d,globalSnapshot:f}}getGlobalRemoteInfo(e){return TM(e,this.HostInstance)}async getManifestJson(e,t,n,r){return(async()=>{let n=Jj(t),a=this.manifestCache.get(e);if(a)return a;try{let t=await this.loaderHook.lifecycle.fetch.emit(e,{},n,r?{...r,url:e,resourceType:`manifest`}:void 0);(!t||!(t instanceof Response))&&(t=await fetch(e,{})),a=await t.json()}catch(r){a=await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:r,from:`runtime`,lifecycle:`afterResolve`,remote:n,origin:this.HostInstance}),a||(delete this.manifestLoading[e],Ek(bj,Ij,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name},`${r}`,Qj(this.HostInstance.options)))}let o=[!a.metaData&&`metaData`,!a.exposes&&`exposes`,!a.shared&&`shared`].filter(Boolean);return o.length>0&&await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:Error(`"${e}" is not a valid federation manifest for remote "${t.name}". Missing required fields: ${o.join(`, `)}.`),from:`runtime`,lifecycle:`afterResolve`,remote:n,origin:this.HostInstance}),o.length>0&&Ek(Aj,Ij,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name,missingFields:o.join(`,`)},void 0,Qj(this.HostInstance.options)),this.manifestCache.set(e,a),a})()}async loadManifestSnapshot(e,t,n,r){let a=async()=>{let a=await this.getManifestJson(e,t,n,r),o=QO(a,{version:e}),{remoteSnapshot:s}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:t,manifestJson:a,remoteSnapshot:o,manifestUrl:e,from:`manifest`});return s};return this.manifestLoading[e]||(this.manifestLoading[e]=a().then(e=>e)),this.manifestLoading[e]}},DM=class{constructor(e){this.hooks=new _M({beforeRegisterShare:new hM(`beforeRegisterShare`),afterResolve:new gM(`afterResolve`),beforeLoadShare:new gM(`beforeLoadShare`),loadShare:new pM,afterLoadShare:new fM(`afterLoadShare`),errorLoadShare:new fM(`errorLoadShare`),resolveShare:new hM(`resolveShare`),initContainerShareScopeMap:new hM(`initContainerShareScopeMap`)}),this.host=e,this.shareScopeMap={},this.initTokens={},this._setGlobalShareScopeMap(e.options)}emitAfterLoadShare({lifecycle:e,pkgName:t,shareInfo:n,selectedShared:r}){try{this.hooks.lifecycle.afterLoadShare.emit({pkgName:t,shareInfo:n,selectedShared:r,shared:this.host.options.shared,shareScopeMap:this.shareScopeMap,lifecycle:e,origin:this.host})}catch(e){Dk(e)}}emitErrorLoadShare({lifecycle:e,pkgName:t,shareInfo:n,error:r,recovered:a}){try{this.hooks.lifecycle.errorLoadShare.emit({pkgName:t,shareInfo:n,shared:this.host.options.shared,shareScopeMap:this.shareScopeMap,lifecycle:e,origin:this.host,error:r,recovered:a})}catch(e){Dk(e)}}registerShared(e,t){let{newShareInfos:n,allShareInfos:r}=$A(e,t);return Object.keys(n).forEach(e=>{n[e].forEach(n=>{n.scope.forEach(r=>{this.hooks.lifecycle.beforeRegisterShare.emit({origin:this.host,pkgName:e,shared:n}),this.shareScopeMap[r]?.[e]||this.setShared({pkgName:e,lib:n.lib,get:n.get,loaded:n.loaded||!!n.lib,shared:n,from:t.name})})})}),{newShareInfos:n,allShareInfos:r}}async loadShare(e,t){let{host:n}=this,r=fj({pkgName:e,extraOptions:t,shareInfos:n.options.shared}),a=r;try{r?.scope&&await Promise.all(r.scope.map(async e=>{await Promise.all(this.initializeSharing(e,{strategy:r.strategy}))})),a=(await this.hooks.lifecycle.beforeLoadShare.emit({pkgName:e,shareInfo:r,shared:n.options.shared,origin:n})).shareInfo,Tk(a,`Cannot find shared "${e}" in host "${n.options.name}". Ensure the shared config for "${e}" is declared in the federation plugin options and the host has been initialized before loading shares.`);let o=a,{shared:s,useTreesShaking:c}=uj(this.shareScopeMap,e,a,this.hooks.lifecycle.resolveShare)||{};if(s){let t=mj(s,c);if(t.lib)return pj(t,n.options.name),this.emitAfterLoadShare({lifecycle:`loadShare`,pkgName:e,shareInfo:o,selectedShared:s}),t.lib;if(t.loading&&!t.loaded){let r=await t.loading;return t.loaded=!0,t.lib||=r,pj(t,n.options.name),this.emitAfterLoadShare({lifecycle:`loadShare`,pkgName:e,shareInfo:o,selectedShared:s}),r}else{let r=(async()=>{let e=await t.get();return pj(t,n.options.name),t.loaded=!0,t.lib=e,e})();this.setShared({pkgName:e,loaded:!1,shared:s,from:n.options.name,lib:null,loading:r,treeShaking:c?t:void 0});let a=await r;return this.emitAfterLoadShare({lifecycle:`loadShare`,pkgName:e,shareInfo:o,selectedShared:s}),a}}else{if(t?.customShareInfo)return this.emitErrorLoadShare({lifecycle:`loadShare`,pkgName:e,shareInfo:o,recovered:!0}),!1;let r=ej(o.treeShaking),a=mj(o,r),s=(async()=>{let t=await a.get();a.lib=t,a.loaded=!0,pj(a,n.options.name);let{shared:r,useTreesShaking:s}=uj(this.shareScopeMap,e,o,this.hooks.lifecycle.resolveShare)||{};if(r){let e=mj(r,s);e.lib=t,e.loaded=!0,r.from=o.from}return t})();this.setShared({pkgName:e,loaded:!1,shared:o,from:n.options.name,lib:null,loading:s,treeShaking:r?a:void 0});let c=await s;return this.emitAfterLoadShare({lifecycle:`loadShare`,pkgName:e,shareInfo:o,selectedShared:o}),c}}catch(t){throw this.emitErrorLoadShare({lifecycle:`loadShare`,pkgName:e,shareInfo:a,error:t}),t}}initializeSharing(e=XA,t){let{host:n}=this,r=t?.from,a=t?.strategy,o=t?.initScope,s=[];if(r!==`build`){let{initTokens:t}=this;o||=[];let n=t[e];if(n||=t[e]={from:this.host.name},o.indexOf(n)>=0)return s;o.push(n)}let c=this.shareScopeMap,l=n.options.name;c[e]||(c[e]={});let u=c[e],d=(e,t)=>{let{version:n,eager:r}=t;u[e]=u[e]||{};let a=u[e],o=a[n]&&mj(a[n]),s=!!(o&&(`eager`in o&&o.eager||`shareConfig`in o&&o.shareConfig?.eager));(!o||o.strategy!==`loaded-first`&&!o.loaded&&(!r==!s?l>a[n].from:r))&&(a[n]=t)},f=async e=>{let{module:t}=await n.remoteHandler.getRemoteModuleAndOptions({id:e}),r;try{r=await t.getEntry()}catch(a){if(r=await n.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:a,from:`runtime`,lifecycle:`beforeLoadShare`,remote:t.remoteInfo,origin:n}),!r)return}finally{r?.init&&!t.initing&&(t.remoteEntryExports=r,await t.init(void 0,void 0,o))}};return Object.keys(n.options.shared).forEach(t=>{n.options.shared[t].forEach(n=>{n.scope.includes(e)&&d(t,n)})}),(n.options.shareStrategy===`version-first`||a===`version-first`)&&n.options.remotes.forEach(t=>{t.shareScope===e&&s.push(f(t.name))}),s}loadShareSync(e,t){let{host:n}=this,r=fj({pkgName:e,extraOptions:t,shareInfos:n.options.shared});try{r?.scope&&r.scope.forEach(e=>{this.initializeSharing(e,{strategy:r.strategy})});let{shared:a}=uj(this.shareScopeMap,e,r,this.hooks.lifecycle.resolveShare)||{};if(a){if(typeof a.lib==`function`)return pj(a,n.options.name),a.loaded||(a.loaded=!0,a.from===n.options.name&&(r.loaded=!0)),this.emitAfterLoadShare({lifecycle:`loadShareSync`,pkgName:e,shareInfo:r,selectedShared:a}),a.lib;if(typeof a.get==`function`){let t=a.get();if(!(t instanceof Promise))return pj(a,n.options.name),this.setShared({pkgName:e,loaded:!0,from:n.options.name,lib:t,shared:a}),this.emitAfterLoadShare({lifecycle:`loadShareSync`,pkgName:e,shareInfo:r,selectedShared:a}),t}}if(r.lib)return r.loaded||=!0,this.emitAfterLoadShare({lifecycle:`loadShareSync`,pkgName:e,shareInfo:r,selectedShared:r}),r.lib;if(r.get){let a=r.get();return a instanceof Promise&&Ek(t?.from===`build`?Sj:Cj,Ij,{hostName:n.options.name,sharedPkgName:e},void 0,Qj(n.options)),r.lib=a,this.setShared({pkgName:e,loaded:!0,from:n.options.name,lib:r.lib,shared:r}),this.emitAfterLoadShare({lifecycle:`loadShareSync`,pkgName:e,shareInfo:r,selectedShared:r}),r.lib}Ek(Cj,Ij,{hostName:n.options.name,sharedPkgName:e},void 0,Qj(n.options))}catch(t){throw this.emitErrorLoadShare({lifecycle:`loadShareSync`,pkgName:e,shareInfo:r,error:t}),t}}initShareScopeMap(e,t,n={}){let{host:r}=this;this.shareScopeMap[e]=t,this.hooks.lifecycle.initContainerShareScopeMap.emit({shareScope:t,options:r.options,origin:r,scopeName:e,hostShareScopeMap:n.hostShareScopeMap})}setShared({pkgName:e,shared:t,from:n,lib:r,loading:a,loaded:o,get:s,treeShaking:c}){let{version:l,scope:u=`default`,...d}=t,f=Array.isArray(u)?u:[u],p=e=>{let t=(e,t,n)=>{n&&!e[t]&&(e[t]=n)},n=c?e.treeShaking:e;t(n,`loaded`,o),t(n,`loading`,a),t(n,`get`,s)};f.forEach(t=>{this.shareScopeMap[t]||(this.shareScopeMap[t]={}),this.shareScopeMap[t][e]||(this.shareScopeMap[t][e]={}),this.shareScopeMap[t][e][l]||(this.shareScopeMap[t][e][l]={version:l,scope:[t],...d,lib:r});let a=this.shareScopeMap[t][e][l];p(a),n&&a.from!==n&&(a.from=n)})}_setGlobalShareScopeMap(e){let t=dj(),n=e.id||e.name;n&&!t[n]&&(t[n]=this.shareScopeMap)}},OM=class{constructor(e){this.hooks=new _M({beforeRegisterRemote:new hM(`beforeRegisterRemote`),registerRemote:new hM(`registerRemote`),beforeRequest:new gM(`beforeRequest`),afterMatchRemote:new pM(`afterMatchRemote`),onLoad:new pM(`onLoad`),afterLoadRemote:new pM(`afterLoadRemote`),handlePreloadModule:new fM(`handlePreloadModule`),errorLoadRemote:new pM(`errorLoadRemote`),beforePreloadRemote:new pM(`beforePreloadRemote`),generatePreloadAssets:new pM(`generatePreloadAssets`),afterPreloadRemote:new pM(`afterPreloadRemote`),loadEntry:new pM}),this.host=e,this.idToRemoteMap={}}formatAndRegisterRemote(e,t){return(t.remotes||[]).reduce((e,t)=>(this.registerRemote(t,e,{force:!1}),e),e.remotes)}setIdToRemoteMap(e,t){let{remote:n,expose:r}=t,{name:a,alias:o}=n;if(this.idToRemoteMap[e]={name:n.name,expose:r},o&&e.startsWith(a)){let t=e.replace(a,o);this.idToRemoteMap[t]={name:n.name,expose:r};return}if(o&&e.startsWith(o)){let t=e.replace(o,a);this.idToRemoteMap[t]={name:n.name,expose:r}}}async loadRemote(e,t){let{host:n}=this,r=gj(n.options.remotes,e),a=e,o=r?.expose,s=r?Jj(r.remote):void 0,c;try{let{loadFactory:r=!0}=t||{loadFactory:!0},{module:l,moduleOptions:u,remoteMatchInfo:d}=await this.getRemoteModuleAndOptions({id:e}),{pkgNameOrAlias:f,remote:p,expose:m,id:h,remoteSnapshot:g}=d;a=h,o=m,s=Jj(p);let _=await l.get(h,m,t,g),v=await this.hooks.lifecycle.onLoad.emit({id:h,pkgNameOrAlias:f,expose:m,exposeModule:r?_:void 0,exposeModuleFactory:r?void 0:_,remote:p,options:u,moduleInstance:l,origin:n});return this.setIdToRemoteMap(e,d),c={id:a,expose:o,remote:s,options:t,origin:n},typeof v==`function`?v:_}catch(r){let{from:l=`runtime`}=t||{from:`runtime`},u;try{u=await this.hooks.lifecycle.errorLoadRemote.emit({id:e,error:r,from:l,lifecycle:`onLoad`,expose:o,remote:s,origin:n})}catch(e){throw c={id:a,expose:o,remote:s,options:t,error:e,origin:n},e}if(!u)throw c={id:a,expose:o,remote:s,options:t,error:r,origin:n},r;return c={id:a,expose:o,remote:s,options:t,error:r,origin:n,recovered:!0},u}finally{c&&await this.hooks.lifecycle.afterLoadRemote.emit(c)}}async preloadRemote(e){let{host:t}=this,n=[];await this.hooks.lifecycle.beforePreloadRemote.emit({preloadOps:e,options:t.options,origin:t});let r=eM(t.options.remotes,e),a=e=>{let{preloadConfig:t,remote:n}=e,r=t.exposes||[];return r.length?r.map(r=>({ops:{...e,preloadConfig:{...t,exposes:[r]}},id:hj(n.name,r)})):[{ops:e,id:`${n.name}/*`}]},o;await Promise.all(r.flatMap(a).map(async e=>{let{ops:r,id:a}=e,{remote:o,preloadConfig:s}=r,c=Jj(o);try{let{globalSnapshot:e,remoteSnapshot:l}=await t.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:o,id:a,initiator:`preloadRemote`}),u=await this.hooks.lifecycle.generatePreloadAssets.emit({origin:t,preloadOptions:r,remote:o,remoteInfo:c,globalSnapshot:e,remoteSnapshot:l});if(!u)return;let d=await cM(c,t,u,!0,{initiator:`preloadRemote`,id:a});n.push({remote:o,remoteInfo:c,preloadConfig:s,id:a,results:d})}catch(e){n.push({remote:o,remoteInfo:c,preloadConfig:s,id:a,results:[{url:c.entry,status:`error`,resourceType:/\.json(?:$|[?#])/i.test(c.entry)?`manifest`:`remoteEntry`,initiator:`preloadRemote`,id:a,error:e}]})}}));let s=n.flatMap(e=>e.results.filter(e=>e.status===`error`||e.status===`timeout`));if(s.length>0&&(o=Error(`preloadRemote failed to load ${s.length} resource(s).`),Object.assign(o,{results:n,failedResults:s})),await this.hooks.lifecycle.afterPreloadRemote.emit({preloadOps:e,options:t.options,origin:t,results:n,error:o}),o)throw o}registerRemotes(e,t){let{host:n}=this;e.forEach(e=>{this.registerRemote(e,n.options.remotes,{force:t?.force})})}async getRemoteModuleAndOptions(e){let{host:t}=this,{id:n}=e,r;try{r=await this.hooks.lifecycle.beforeRequest.emit({id:n,options:t.options,origin:t})}catch(e){if(r=await this.hooks.lifecycle.errorLoadRemote.emit({id:n,options:t.options,origin:t,from:`runtime`,error:e,lifecycle:`beforeRequest`}),!r)throw e}let{id:a}=r,o=gj(t.options.remotes,a);if(!o)try{Ek(xj,Ij,{hostName:t.options.name,requestId:a},void 0,Qj(t.options))}catch(e){throw await this.hooks.lifecycle.afterMatchRemote.emit({id:a,options:t.options,error:e,origin:t}),e}let{remote:s}=o,c=Jj(s);await this.hooks.lifecycle.afterMatchRemote.emit({id:a,...o,options:t.options,remoteInfo:c,origin:t});let l=await t.sharedHandler.hooks.lifecycle.afterResolve.emit({id:a,...o,options:t.options,origin:t,remoteInfo:c}),{remote:u,expose:d}=l;Tk(u&&d,`The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${a}.`);let f=t.moduleCache.get(u.name),p={host:t,remoteInfo:c};return f||(f=new dM(p),t.moduleCache.set(u.name,f)),{module:f,moduleOptions:p,remoteMatchInfo:l}}registerRemote(e,t,n){let{host:r}=this,a=()=>{if(e.alias){let n=t.find(t=>e.alias&&(t.name.startsWith(e.alias)||t.alias?.startsWith(e.alias)));Tk(!n,`The alias ${e.alias} of remote ${e.name} is not allowed to be the prefix of ${n&&n.name} name or alias`)}`entry`in e&&BO&&typeof window<`u`&&!e.entry.startsWith(`http`)&&(e.entry=new URL(e.entry,window.location.origin).href),e.shareScope||=XA,e.type||=ZA};this.hooks.lifecycle.beforeRegisterRemote.emit({remote:e,origin:r});let o=t.find(t=>t.name===e.name);if(!o)a(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:r});else{let s=[`The remote "${e.name}" is already registered.`,`Please note that overriding it may cause unexpected errors.`];n?.force&&(this.removeRemote(o),a(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:r}),JO(s.join(` `)))}}removeRemote(e){try{let{host:t}=this,{name:n}=e,r=t.options.remotes.findIndex(e=>e.name===n);r!==-1&&t.options.remotes.splice(r,1);let a=t.moduleCache.get(e.name);if(a){let n=a.remoteInfo,r=n.entryGlobalName;Rk[r]&&(Object.getOwnPropertyDescriptor(Rk,r)?.configurable?delete Rk[r]:Rk[r]=void 0);let o=Kj(a.remoteInfo);Uk[o]&&delete Uk[o],t.snapshotHandler.manifestCache.delete(n.entry);let s=n.buildVersion?KO(n.name,n.buildVersion):n.name,c=Rk.__FEDERATION__.__INSTANCES__.findIndex(e=>n.buildVersion?e.options.id===s:e.name===s);if(c!==-1){let e=Rk.__FEDERATION__.__INSTANCES__[c];s=e.options.id||s;let t=dj(),r=!0,a=[];Object.keys(t).forEach(e=>{let o=t[e];o&&Object.keys(o).forEach(t=>{let s=o[t];s&&Object.keys(s).forEach(o=>{let c=s[o];c&&Object.keys(c).forEach(s=>{let l=c[s];l&&typeof l==`object`&&l.from===n.name&&(l.loaded||l.loading?(l.useIn=l.useIn.filter(e=>e!==n.name),l.useIn.length?r=!1:a.push([e,t,o,s])):a.push([e,t,o,s]))})})})}),r&&(e.shareScopeMap={},delete t[s]),a.forEach(([e,n,r,a])=>{delete t[e]?.[n]?.[r]?.[a]}),Rk.__FEDERATION__.__INSTANCES__.splice(c,1)}let{hostGlobalSnapshot:l}=TM(e,t);if(l){let t=l&&`remotesInfo`in l&&l.remotesInfo&&Kk(l.remotesInfo,e.name).key;t&&(delete l.remotesInfo[t],Bk.__FEDERATION__.__MANIFEST_LOADING__[t]&&delete Bk.__FEDERATION__.__MANIFEST_LOADING__[t])}t.moduleCache.delete(e.name)}}catch(e){wk.error(`removeRemote failed: ${e instanceof Error?e.message:String(e)}`)}}},kM=typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN==`boolean`?!FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN:!0;Gk(class{constructor(e){this.hooks=new _M({beforeInit:new hM(`beforeInit`),init:new fM,beforeInitContainer:new gM(`beforeInitContainer`),initContainer:new gM(`initContainer`)}),this.version=`2.5.1`,this.moduleCache=new Map,this.loaderHook=new _M({getModuleInfo:new fM,createScript:new fM,createLink:new fM,fetch:new pM,loadEntryError:new pM,afterLoadEntry:new pM(`afterLoadEntry`),beforeInitRemote:new pM(`beforeInitRemote`),afterInitRemote:new pM(`afterInitRemote`),beforeGetExpose:new pM(`beforeGetExpose`),afterGetExpose:new pM(`afterGetExpose`),beforeExecuteFactory:new pM(`beforeExecuteFactory`),afterExecuteFactory:new pM(`afterExecuteFactory`),getModuleFactory:new pM}),this.bridgeHook=new _M({beforeBridgeRender:new fM,afterBridgeRender:new fM,beforeBridgeDestroy:new fM,afterBridgeDestroy:new fM});let t=kM?[yM(),wM()]:[],n={id:Yj(),name:e.name,plugins:t,remotes:[],shared:{},inBrowser:BO};this.name=e.name,this.options=n,this.snapshotHandler=new EM(this),this.sharedHandler=new DM(this),this.remoteHandler=new OM(this),this.shareScopeMap=this.sharedHandler.shareScopeMap,this.registerPlugins([...n.plugins,...e.plugins||[]]),this.options=this.formatOptions(n,e)}initOptions(e){e.name&&e.name!==this.options.name&&Ek(xk(Dj,Ij)),this.registerPlugins(e.plugins);let t=this.formatOptions(this.options,e);return this.options=t,t}async loadShare(e,t){return this.sharedHandler.loadShare(e,t)}loadShareSync(e,t){return this.sharedHandler.loadShareSync(e,t)}initializeSharing(e=XA,t){return this.sharedHandler.initializeSharing(e,t)}initRawContainer(e,t,n){let r=Jj({name:e,entry:t}),a=new dM({host:this,remoteInfo:r});return a.remoteEntryExports=n,this.moduleCache.set(e,a),a}async loadRemote(e,t){return this.remoteHandler.loadRemote(e,t)}async preloadRemote(e){return this.remoteHandler.preloadRemote(e)}initShareScopeMap(e,t,n={}){this.sharedHandler.initShareScopeMap(e,t,n)}formatOptions(e,t){let{allShareInfos:n}=$A(e,t),{userOptions:r,options:a}=this.hooks.lifecycle.beforeInit.emit({origin:this,userOptions:t,options:e,shareInfo:n}),o=this.remoteHandler.formatAndRegisterRemote(a,r),{allShareInfos:s}=this.sharedHandler.registerShared(a,r),c=[...a.plugins];r.plugins&&r.plugins.forEach(e=>{c.includes(e)||c.push(e)});let l={...e,...t,plugins:c,remotes:o,shared:s,id:r.id||e.id};return this.hooks.lifecycle.init.emit({origin:this,options:l}),l}registerPlugins(e){let t=Xj(e,this);this.options.plugins=this.options.plugins.reduce((e,t)=>(t&&e&&!e.find(e=>e.name===t.name)&&e.push(t),e),t||[])}registerRemotes(e,t){return this.remoteHandler.registerRemotes(e,t)}registerShared(e){this.sharedHandler.registerShared(this.options,{...this.options,shared:e})}});var AM=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),jM=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),MM=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),NM=e=>{let t=MM(e);return t.charAt(0).toUpperCase()+t.slice(1)},PM={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},FM=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},IM=(0,x.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a=``,children:o,iconNode:s,...c},l)=>(0,x.createElement)(`svg`,{ref:l,...PM,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:AM(`lucide`,a),...!o&&!FM(c)&&{"aria-hidden":`true`},...c},[...s.map(([e,t])=>(0,x.createElement)(e,t)),...Array.isArray(o)?o:[o]])),Q=(e,t)=>{let n=(0,x.forwardRef)(({className:n,...r},a)=>(0,x.createElement)(IM,{ref:a,iconNode:t,className:AM(`lucide-${jM(NM(e))}`,`lucide-${e}`,n),...r}));return n.displayName=NM(e),n},LM=Q(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]);Q(`alarm-smoke`,[[`path`,{d:`M11 21c0-2.5 2-2.5 2-5`,key:`1sicvv`}],[`path`,{d:`M16 21c0-2.5 2-2.5 2-5`,key:`1o3eny`}],[`path`,{d:`m19 8-.8 3a1.25 1.25 0 0 1-1.2 1H7a1.25 1.25 0 0 1-1.2-1L5 8`,key:`1bvca4`}],[`path`,{d:`M21 3a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V4a1 1 0 0 1 1-1z`,key:`x3qr1j`}],[`path`,{d:`M6 21c0-2.5 2-2.5 2-5`,key:`i3w1gp`}]]),Q(`arrow-down-to-line`,[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]]),Q(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),Q(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),Q(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),Q(`arrow-up-to-line`,[[`path`,{d:`M5 3h14`,key:`7usisc`}],[`path`,{d:`m18 13-6-6-6 6`,key:`1kf1n9`}],[`path`,{d:`M12 7v14`,key:`1akyts`}]]),Q(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]);var RM=Q(`bath`,[[`path`,{d:`M10 4 8 6`,key:`1rru8s`}],[`path`,{d:`M17 19v2`,key:`ts1sot`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}],[`path`,{d:`M7 19v2`,key:`12npes`}],[`path`,{d:`M9 5 7.621 3.621A2.121 2.121 0 0 0 4 5v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5`,key:`14ym8i`}]]);Q(`battery-full`,[[`path`,{d:`M10 10v4`,key:`1mb2ec`}],[`path`,{d:`M14 10v4`,key:`1nt88p`}],[`path`,{d:`M22 14v-4`,key:`14q9d5`}],[`path`,{d:`M6 10v4`,key:`1n77qd`}],[`rect`,{x:`2`,y:`6`,width:`16`,height:`12`,rx:`2`,key:`13zb55`}]]),Q(`battery-low`,[[`path`,{d:`M22 14v-4`,key:`14q9d5`}],[`path`,{d:`M6 14v-4`,key:`14a6bd`}],[`rect`,{x:`2`,y:`6`,width:`16`,height:`12`,rx:`2`,key:`13zb55`}]]),Q(`battery-medium`,[[`path`,{d:`M10 14v-4`,key:`suye4c`}],[`path`,{d:`M22 14v-4`,key:`14q9d5`}],[`path`,{d:`M6 14v-4`,key:`14a6bd`}],[`rect`,{x:`2`,y:`6`,width:`16`,height:`12`,rx:`2`,key:`13zb55`}]]),Q(`battery-warning`,[[`path`,{d:`M10 17h.01`,key:`nbq80n`}],[`path`,{d:`M10 7v6`,key:`nne03l`}],[`path`,{d:`M14 6h2a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2`,key:`1m83kb`}],[`path`,{d:`M22 14v-4`,key:`14q9d5`}],[`path`,{d:`M6 18H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h2`,key:`h8lgfh`}]]),Q(`battery`,[[`path`,{d:`M 22 14 L 22 10`,key:`nqc4tb`}],[`rect`,{x:`2`,y:`6`,width:`16`,height:`12`,rx:`2`,key:`13zb55`}]]),Q(`bell-ring`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M22 8c0-2.3-.8-4.3-2-6`,key:`5bb3ad`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}],[`path`,{d:`M4 2C2.8 3.7 2 5.7 2 8`,key:`tap9e0`}]]);var zM=Q(`bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),BM=Q(`blinds`,[[`path`,{d:`M3 3h18`,key:`o7r712`}],[`path`,{d:`M20 7H8`,key:`gd2fo2`}],[`path`,{d:`M20 11H8`,key:`1ynp89`}],[`path`,{d:`M10 19h10`,key:`19hjk5`}],[`path`,{d:`M8 15h12`,key:`1yqzne`}],[`path`,{d:`M4 3v14`,key:`fggqzn`}],[`circle`,{cx:`4`,cy:`19`,r:`2`,key:`p3m9r0`}]]),VM=Q(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),HM=Q(`box`,[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`,key:`hh9hay`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`,key:`g66t2b`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}]]);Q(`bug`,[[`path`,{d:`M12 20v-9`,key:`1qisl0`}],[`path`,{d:`M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z`,key:`uouzyp`}],[`path`,{d:`M14.12 3.88 16 2`,key:`qol33r`}],[`path`,{d:`M21 21a4 4 0 0 0-3.81-4`,key:`1b0z45`}],[`path`,{d:`M21 5a4 4 0 0 1-3.55 3.97`,key:`5cxbf6`}],[`path`,{d:`M22 13h-4`,key:`1jl80f`}],[`path`,{d:`M3 21a4 4 0 0 1 3.81-4`,key:`1fjd4g`}],[`path`,{d:`M3 5a4 4 0 0 0 3.55 3.97`,key:`1d7oge`}],[`path`,{d:`M6 13H2`,key:`82j7cp`}],[`path`,{d:`m8 2 1.88 1.88`,key:`fmnt4t`}],[`path`,{d:`M9 7.13V6a3 3 0 1 1 6 0v1.13`,key:`1vgav8`}]]);var UM=Q(`camera`,[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]);Q(`cast`,[[`path`,{d:`M2 8V6a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-6`,key:`3zrzxg`}],[`path`,{d:`M2 12a9 9 0 0 1 8 8`,key:`g6cvee`}],[`path`,{d:`M2 16a5 5 0 0 1 4 4`,key:`1y1dii`}],[`line`,{x1:`2`,x2:`2.01`,y1:`20`,y2:`20`,key:`xu2jvo`}]]),Q(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]);var WM=Q(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]);Q(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]);var GM=Q(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]);Q(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),Q(`chevrons-down-up`,[[`path`,{d:`m7 20 5-5 5 5`,key:`13a0gw`}],[`path`,{d:`m7 4 5 5 5-5`,key:`1kwcof`}]]),Q(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),Q(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),Q(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),Q(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]);var KM=Q(`circle-dot`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}]]);Q(`circle-pause`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`10`,x2:`10`,y1:`15`,y2:`9`,key:`c1nkhi`}],[`line`,{x1:`14`,x2:`14`,y1:`15`,y2:`9`,key:`h65svq`}]]),Q(`circle-plus`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}],[`path`,{d:`M12 8v8`,key:`napkw2`}]]),Q(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Q(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),Q(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),Q(`cloud-fog`,[[`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`,key:`1pljnt`}],[`path`,{d:`M16 17H7`,key:`pygtm1`}],[`path`,{d:`M17 21H9`,key:`1u2q02`}]]),Q(`cloud-lightning`,[[`path`,{d:`M6 16.326A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 .5 8.973`,key:`1cez44`}],[`path`,{d:`m13 12-3 5h4l-3 5`,key:`1t22er`}]]),Q(`cloud-rain`,[[`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`,key:`1pljnt`}],[`path`,{d:`M16 14v6`,key:`1j4efv`}],[`path`,{d:`M8 14v6`,key:`17c4r9`}],[`path`,{d:`M12 16v6`,key:`c8a4gj`}]]),Q(`cloud-snow`,[[`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`,key:`1pljnt`}],[`path`,{d:`M8 15h.01`,key:`a7atzg`}],[`path`,{d:`M8 19h.01`,key:`puxtts`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M12 21h.01`,key:`h35vbk`}],[`path`,{d:`M16 15h.01`,key:`rnfrdf`}],[`path`,{d:`M16 19h.01`,key:`1vcnzz`}]]);var qM=Q(`cloud-sun`,[[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}],[`path`,{d:`M15.947 12.65a4 4 0 0 0-5.925-4.128`,key:`dpwdj0`}],[`path`,{d:`M13 22H7a5 5 0 1 1 4.9-6H13a3 3 0 0 1 0 6Z`,key:`s09mg5`}]]);Q(`cloud`,[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]),Q(`copy-plus`,[[`line`,{x1:`15`,x2:`15`,y1:`12`,y2:`18`,key:`1p7wdc`}],[`line`,{x1:`12`,x2:`18`,y1:`15`,y2:`15`,key:`1nscbv`}],[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Q(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Q(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),Q(`crosshair`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`22`,x2:`18`,y1:`12`,y2:`12`,key:`l9bcsi`}],[`line`,{x1:`6`,x2:`2`,y1:`12`,y2:`12`,key:`13hhkx`}],[`line`,{x1:`12`,x2:`12`,y1:`6`,y2:`2`,key:`10w3f3`}],[`line`,{x1:`12`,x2:`12`,y1:`22`,y2:`18`,key:`15g9kq`}]]),Q(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),Q(`door-closed`,[[`path`,{d:`M10 12h.01`,key:`1kxr2c`}],[`path`,{d:`M18 20V6a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v14`,key:`36qu9e`}],[`path`,{d:`M2 20h20`,key:`owomy5`}]]),Q(`door-open`,[[`path`,{d:`M11 20H2`,key:`nlcfvz`}],[`path`,{d:`M11 4.562v16.157a1 1 0 0 0 1.242.97L19 20V5.562a2 2 0 0 0-1.515-1.94l-4-1A2 2 0 0 0 11 4.561z`,key:`au4z13`}],[`path`,{d:`M11 4H8a2 2 0 0 0-2 2v14`,key:`74r1mk`}],[`path`,{d:`M14 12h.01`,key:`1jfl7z`}],[`path`,{d:`M22 20h-3`,key:`vhrsz`}]]),Q(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),Q(`droplet`,[[`path`,{d:`M12 22a7 7 0 0 0 7-7c0-2-1-3.9-3-5.5s-3.5-4-4-6.5c-.5 2.5-2 4.9-4 6.5C6 11.1 5 13 5 15a7 7 0 0 0 7 7z`,key:`c7niix`}]]),Q(`droplets`,[[`path`,{d:`M7 16.3c2.2 0 4-1.83 4-4.05 0-1.16-.57-2.26-1.71-3.19S7.29 6.75 7 5.3c-.29 1.45-1.14 2.84-2.29 3.76S3 11.1 3 12.25c0 2.22 1.8 4.05 4 4.05z`,key:`1ptgy4`}],[`path`,{d:`M12.56 6.6A10.97 10.97 0 0 0 14 3.02c.5 2.5 2 4.9 4 6.5s3 3.5 3 5.5a6.98 6.98 0 0 1-11.91 4.97`,key:`1sl1rz`}]]),Q(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),Q(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]);var JM=Q(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]);Q(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]);var YM=Q(`fan`,[[`path`,{d:`M10.827 16.379a6.082 6.082 0 0 1-8.618-7.002l5.412 1.45a6.082 6.082 0 0 1 7.002-8.618l-1.45 5.412a6.082 6.082 0 0 1 8.618 7.002l-5.412-1.45a6.082 6.082 0 0 1-7.002 8.618l1.45-5.412Z`,key:`484a7f`}],[`path`,{d:`M12 12v.01`,key:`u5ubse`}]]);Q(`film`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M7 3v18`,key:`bbkbws`}],[`path`,{d:`M3 7.5h4`,key:`zfgn84`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`path`,{d:`M3 16.5h4`,key:`1230mu`}],[`path`,{d:`M17 3v18`,key:`in4fa5`}],[`path`,{d:`M17 7.5h4`,key:`myr1c1`}],[`path`,{d:`M17 16.5h4`,key:`go4c1d`}]]),Q(`flame`,[[`path`,{d:`M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4`,key:`1slcih`}]]),Q(`flashlight`,[[`path`,{d:`M12 13v1`,key:`176q98`}],[`path`,{d:`M17 2a1 1 0 0 1 1 1v4a3 3 0 0 1-.6 1.8l-.6.8A4 4 0 0 0 16 12v8a2 2 0 0 1-2 2H10a2 2 0 0 1-2-2v-8a4 4 0 0 0-.8-2.4l-.6-.8A3 3 0 0 1 6 7V3a1 1 0 0 1 1-1z`,key:`17vh7j`}],[`path`,{d:`M6 6h12`,key:`n6hhss`}]]),Q(`flask-conical`,[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]),Q(`footprints`,[[`path`,{d:`M4 16v-2.38C4 11.5 2.97 10.5 3 8c.03-2.72 1.49-6 4.5-6C9.37 2 10 3.8 10 5.5c0 3.11-2 5.66-2 8.68V16a2 2 0 1 1-4 0Z`,key:`1dudjm`}],[`path`,{d:`M20 20v-2.38c0-2.12 1.03-3.12 1-5.62-.03-2.72-1.49-6-4.5-6C14.63 6 14 7.8 14 9.5c0 3.11 2 5.66 2 8.68V20a2 2 0 1 0 4 0Z`,key:`l2t8xc`}],[`path`,{d:`M16 17h4`,key:`1dejxt`}],[`path`,{d:`M4 13h4`,key:`1bwh8b`}]]),Q(`funnel`,[[`path`,{d:`M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z`,key:`sc7q7i`}]]),Q(`gamepad-2`,[[`line`,{x1:`6`,x2:`10`,y1:`11`,y2:`11`,key:`1gktln`}],[`line`,{x1:`8`,x2:`8`,y1:`9`,y2:`13`,key:`qnk9ow`}],[`line`,{x1:`15`,x2:`15.01`,y1:`12`,y2:`12`,key:`krot7o`}],[`line`,{x1:`18`,x2:`18.01`,y1:`10`,y2:`10`,key:`1lcuu1`}],[`path`,{d:`M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z`,key:`mfqc10`}]]),Q(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),Q(`grip-horizontal`,[[`circle`,{cx:`12`,cy:`9`,r:`1`,key:`124mty`}],[`circle`,{cx:`19`,cy:`9`,r:`1`,key:`1ruzo2`}],[`circle`,{cx:`5`,cy:`9`,r:`1`,key:`1a8b28`}],[`circle`,{cx:`12`,cy:`15`,r:`1`,key:`1e56xg`}],[`circle`,{cx:`19`,cy:`15`,r:`1`,key:`1a92ep`}],[`circle`,{cx:`5`,cy:`15`,r:`1`,key:`5r1jwy`}]]),Q(`hard-drive`,[[`path`,{d:`M10 16h.01`,key:`1bzywj`}],[`path`,{d:`M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`18tbho`}],[`path`,{d:`M21.946 12.013H2.054`,key:`zqlbp7`}],[`path`,{d:`M6 16h.01`,key:`1pmjb7`}]]),Q(`hash`,[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]),Q(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]]),Q(`image-off`,[[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}],[`path`,{d:`M10.41 10.41a2 2 0 1 1-2.83-2.83`,key:`1bzlo9`}],[`line`,{x1:`13.5`,x2:`6`,y1:`13.5`,y2:`21`,key:`1q0aeu`}],[`line`,{x1:`18`,x2:`21`,y1:`12`,y2:`15`,key:`5mozeu`}],[`path`,{d:`M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59`,key:`mmje98`}],[`path`,{d:`M21 15V5a2 2 0 0 0-2-2H9`,key:`43el77`}]]);var XM=Q(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]);Q(`inbox`,[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]),Q(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),Q(`layout-grid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]);var ZM=Q(`lightbulb`,[[`path`,{d:`M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5`,key:`1gvzjb`}],[`path`,{d:`M9 18h6`,key:`x1upvd`}],[`path`,{d:`M10 22h4`,key:`ceow96`}]]);Q(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),Q(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),Q(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Q(`locate-fixed`,[[`line`,{x1:`2`,x2:`5`,y1:`12`,y2:`12`,key:`bvdh0s`}],[`line`,{x1:`19`,x2:`22`,y1:`12`,y2:`12`,key:`1tbv5k`}],[`line`,{x1:`12`,x2:`12`,y1:`2`,y2:`5`,key:`11lu5j`}],[`line`,{x1:`12`,x2:`12`,y1:`19`,y2:`22`,key:`x3vr5v`}],[`circle`,{cx:`12`,cy:`12`,r:`7`,key:`fim9np`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Q(`lock-open`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 9.9-1`,key:`1mm8w8`}]]);var QM=Q(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]);Q(`mail`,[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]);var $M=Q(`map-pin`,[[`path`,{d:`M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0`,key:`1r0f0z`}],[`circle`,{cx:`12`,cy:`10`,r:`3`,key:`ilqhr7`}]]);Q(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),Q(`megaphone`,[[`path`,{d:`M11 6a13 13 0 0 0 8.4-2.8A1 1 0 0 1 21 4v12a1 1 0 0 1-1.6.8A13 13 0 0 0 11 14H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2z`,key:`q8bfy3`}],[`path`,{d:`M6 14a12 12 0 0 0 2.4 7.2 2 2 0 0 0 3.2-2.4A8 8 0 0 1 10 14`,key:`1853fq`}],[`path`,{d:`M8 6v8`,key:`15ugcq`}]]),Q(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),Q(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),Q(`mic`,[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`13`,rx:`3`,key:`s6n7sd`}]]),Q(`minimize-2`,[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]),Q(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]);var eN=Q(`monitor-play`,[[`path`,{d:`M15.033 9.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56V7.648a.645.645 0 0 1 .967-.56z`,key:`vbtd3f`}],[`path`,{d:`M12 17v4`,key:`1riwvh`}],[`path`,{d:`M8 21h8`,key:`1ev6f3`}],[`rect`,{x:`2`,y:`3`,width:`20`,height:`14`,rx:`2`,key:`x3v2xh`}]]);Q(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),Q(`mouse-pointer-click`,[[`path`,{d:`M14 4.1 12 6`,key:`ita8i4`}],[`path`,{d:`m5.1 8-2.9-.8`,key:`1go3kf`}],[`path`,{d:`m6 12-1.9 2`,key:`mnht97`}],[`path`,{d:`M7.2 2.2 8 5.1`,key:`1cfko1`}],[`path`,{d:`M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z`,key:`s0h3yz`}]]),Q(`move`,[[`path`,{d:`M12 2v20`,key:`t6zp3m`}],[`path`,{d:`m15 19-3 3-3-3`,key:`11eu04`}],[`path`,{d:`m19 9 3 3-3 3`,key:`1mg7y2`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}],[`path`,{d:`m5 9-3 3 3 3`,key:`j64kie`}],[`path`,{d:`m9 5 3-3 3 3`,key:`l8vdw6`}]]),Q(`music`,[[`path`,{d:`M9 18V5l12-2v13`,key:`1jmyc2`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`circle`,{cx:`18`,cy:`16`,r:`3`,key:`1hluhg`}]]),Q(`navigation`,[[`polygon`,{points:`3 11 22 2 13 21 11 13 3 11`,key:`1ltx0t`}]]);var tN=Q(`network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]);Q(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),Q(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]);var nN=Q(`pipette`,[[`path`,{d:`m12 9-8.414 8.414A2 2 0 0 0 3 18.828v1.344a2 2 0 0 1-.586 1.414A2 2 0 0 1 3.828 21h1.344a2 2 0 0 0 1.414-.586L15 12`,key:`1y3wsu`}],[`path`,{d:`m18 9 .4.4a1 1 0 1 1-3 3l-3.8-3.8a1 1 0 1 1 3-3l.4.4 3.4-3.4a1 1 0 1 1 3 3z`,key:`110lr1`}],[`path`,{d:`m2 22 .414-.414`,key:`jhxm08`}]]);Q(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),Q(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Q(`plug`,[[`path`,{d:`M12 22v-5`,key:`1ega77`}],[`path`,{d:`M15 8V2`,key:`18g5xt`}],[`path`,{d:`M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z`,key:`1xoxul`}],[`path`,{d:`M9 8V2`,key:`14iosj`}]]),Q(`power-off`,[[`path`,{d:`M18.36 6.64A9 9 0 0 1 20.77 15`,key:`dxknvb`}],[`path`,{d:`M6.16 6.16a9 9 0 1 0 12.68 12.68`,key:`1x7qb5`}],[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Q(`power`,[[`path`,{d:`M12 2v10`,key:`mnfbl`}],[`path`,{d:`M18.4 6.6a9 9 0 1 1-12.77.04`,key:`obofu9`}]]),Q(`qr-code`,[[`rect`,{width:`5`,height:`5`,x:`3`,y:`3`,rx:`1`,key:`1tu5fj`}],[`rect`,{width:`5`,height:`5`,x:`16`,y:`3`,rx:`1`,key:`1v8r4q`}],[`rect`,{width:`5`,height:`5`,x:`3`,y:`16`,rx:`1`,key:`1x03jg`}],[`path`,{d:`M21 16h-3a2 2 0 0 0-2 2v3`,key:`177gqh`}],[`path`,{d:`M21 21v.01`,key:`ents32`}],[`path`,{d:`M12 7v3a2 2 0 0 1-2 2H7`,key:`8crl2c`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M12 3h.01`,key:`n36tog`}],[`path`,{d:`M12 16v.01`,key:`133mhm`}],[`path`,{d:`M16 12h1`,key:`1slzba`}],[`path`,{d:`M21 12v.01`,key:`1lwtk9`}],[`path`,{d:`M12 21v-1`,key:`1880an`}]]),Q(`radar`,[[`path`,{d:`M19.07 4.93A10 10 0 0 0 6.99 3.34`,key:`z3du51`}],[`path`,{d:`M4 6h.01`,key:`oypzma`}],[`path`,{d:`M2.29 9.62A10 10 0 1 0 21.31 8.35`,key:`qzzz0`}],[`path`,{d:`M16.24 7.76A6 6 0 1 0 8.23 16.67`,key:`1yjesh`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}],[`path`,{d:`M17.99 11.66A6 6 0 0 1 15.77 16.67`,key:`1u2y91`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}],[`path`,{d:`m13.41 10.59 5.66-5.66`,key:`mhq4k0`}]]),Q(`radio`,[[`path`,{d:`M16.247 7.761a6 6 0 0 1 0 8.478`,key:`1fwjs5`}],[`path`,{d:`M19.075 4.933a10 10 0 0 1 0 14.134`,key:`ehdyv1`}],[`path`,{d:`M4.925 19.067a10 10 0 0 1 0-14.134`,key:`1q22gi`}],[`path`,{d:`M7.753 16.239a6 6 0 0 1 0-8.478`,key:`r2q7qm`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]);var rN=Q(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]);Q(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),Q(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),Q(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),Q(`scan`,[[`path`,{d:`M3 7V5a2 2 0 0 1 2-2h2`,key:`aa7l1z`}],[`path`,{d:`M17 3h2a2 2 0 0 1 2 2v2`,key:`4qcy5o`}],[`path`,{d:`M21 17v2a2 2 0 0 1-2 2h-2`,key:`6vwrx8`}],[`path`,{d:`M7 21H5a2 2 0 0 1-2-2v-2`,key:`ioqczr`}]]);var iN=Q(`scroll-text`,[[`path`,{d:`M15 12h-5`,key:`r7krc0`}],[`path`,{d:`M15 8h-5`,key:`1khuty`}],[`path`,{d:`M19 17V5a2 2 0 0 0-2-2H4`,key:`zz82l3`}],[`path`,{d:`M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3`,key:`1ph1d7`}]]);Q(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Q(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),Q(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Q(`share-2`,[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]);var aN=Q(`shield-alert`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]);Q(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Q(`shield-off`,[[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71`,key:`1jlk70`}],[`path`,{d:`M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264`,key:`18rp1v`}]]),Q(`shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),Q(`ship`,[[`path`,{d:`M12 10.189V14`,key:`1p8cqu`}],[`path`,{d:`M12 2v3`,key:`qbqxhf`}],[`path`,{d:`M19 13V7a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2v6`,key:`qpkstq`}],[`path`,{d:`M19.38 20A11.6 11.6 0 0 0 21 14l-8.188-3.639a2 2 0 0 0-1.624 0L3 14a11.6 11.6 0 0 0 2.81 7.76`,key:`7tigtc`}],[`path`,{d:`M2 21c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1s1.2 1 2.5 1c2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1`,key:`1924j5`}]]);var oN=Q(`siren`,[[`path`,{d:`M7 18v-6a5 5 0 1 1 10 0v6`,key:`pcx96s`}],[`path`,{d:`M5 21a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-1a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2z`,key:`1b4s83`}],[`path`,{d:`M21 12h1`,key:`jtio3y`}],[`path`,{d:`M18.5 4.5 18 5`,key:`g5sp9y`}],[`path`,{d:`M2 12h1`,key:`1uaihz`}],[`path`,{d:`M12 2v1`,key:`11qlp1`}],[`path`,{d:`m4.929 4.929.707.707`,key:`1i51kw`}],[`path`,{d:`M12 12v6`,key:`3ahymv`}]]);Q(`skip-back`,[[`path`,{d:`M17.971 4.285A2 2 0 0 1 21 6v12a2 2 0 0 1-3.029 1.715l-9.997-5.998a2 2 0 0 1-.003-3.432z`,key:`15892j`}],[`path`,{d:`M3 20V4`,key:`1ptbpl`}]]),Q(`skip-forward`,[[`path`,{d:`M21 4v16`,key:`7j8fe9`}],[`path`,{d:`M6.029 4.285A2 2 0 0 0 3 6v12a2 2 0 0 0 3.029 1.715l9.997-5.998a2 2 0 0 0 .003-3.432z`,key:`zs4d6`}]]);var sN=Q(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]);Q(`smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]);var cN=Q(`square`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]]);Q(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),Q(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),Q(`table-2`,[[`path`,{d:`M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18`,key:`gugj83`}]]),Q(`target`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`6`,key:`1vlfrh`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]);var lN=Q(`thermometer`,[[`path`,{d:`M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z`,key:`17jzev`}]]),uN=Q(`toggle-left`,[[`circle`,{cx:`9`,cy:`12`,r:`3`,key:`u3jwor`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`5`,rx:`7`,key:`g7kal2`}]]),dN=Q(`tractor`,[[`path`,{d:`m10 11 11 .9a1 1 0 0 1 .8 1.1l-.665 4.158a1 1 0 0 1-.988.842H20`,key:`she1j9`}],[`path`,{d:`M16 18h-5`,key:`bq60fd`}],[`path`,{d:`M18 5a1 1 0 0 0-1 1v5.573`,key:`1kv8ia`}],[`path`,{d:`M3 4h8.129a1 1 0 0 1 .99.863L13 11.246`,key:`1q1ert`}],[`path`,{d:`M4 11V4`,key:`9ft8pt`}],[`path`,{d:`M7 15h.01`,key:`k5ht0j`}],[`path`,{d:`M8 10.1V4`,key:`1jgyzo`}],[`circle`,{cx:`18`,cy:`18`,r:`2`,key:`1emm8v`}],[`circle`,{cx:`7`,cy:`15`,r:`5`,key:`ddtuc`}]]),fN=Q(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]);Q(`trending-up`,[[`path`,{d:`M16 7h6v6`,key:`box55l`}],[`path`,{d:`m22 7-8.5 8.5-5-5L2 17`,key:`1t1m79`}]]),Q(`trending-down`,[[`path`,{d:`M16 17h6v-6`,key:`t6n2it`}],[`path`,{d:`m22 17-8.5-8.5-5 5L2 7`,key:`x473p`}]]),Q(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Q(`type`,[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]),Q(`unlink-2`,[[`path`,{d:`M15 7h2a5 5 0 0 1 0 10h-2m-6 0H7A5 5 0 0 1 7 7h2`,key:`1re2ne`}]]),Q(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),Q(`vibrate`,[[`path`,{d:`m2 8 2 2-2 2 2 2-2 2`,key:`sv1b1`}],[`path`,{d:`m22 8-2 2 2 2-2 2 2 2`,key:`101i4y`}],[`rect`,{width:`8`,height:`14`,x:`8`,y:`5`,rx:`1`,key:`1oyrl4`}]]),Q(`volume-2`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`,key:`ijwkga`}]]),Q(`volume-x`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`line`,{x1:`22`,x2:`16`,y1:`9`,y2:`15`,key:`1ewh16`}],[`line`,{x1:`16`,x2:`22`,y1:`9`,y2:`15`,key:`5ykzw1`}]]);var pN=Q(`waves`,[[`path`,{d:`M2 6c.6.5 1.2 1 2.5 1C7 7 7 5 9.5 5c2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1`,key:`knzxuh`}],[`path`,{d:`M2 12c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1`,key:`2jd2cc`}],[`path`,{d:`M2 18c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1`,key:`rd2r6e`}]]);Q(`wifi-off`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Q(`wifi`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M2 8.82a15 15 0 0 1 20 0`,key:`dnpr2z`}],[`path`,{d:`M5 12.859a10 10 0 0 1 14 0`,key:`1x1e6c`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}]]),Q(`wind`,[[`path`,{d:`M12.8 19.6A2 2 0 1 0 14 16H2`,key:`148xed`}],[`path`,{d:`M17.5 8a2.5 2.5 0 1 1 2 4H2`,key:`1u4tom`}],[`path`,{d:`M9.8 4.4A2 2 0 1 1 11 8H2`,key:`75valh`}]]);var mN=Q(`workflow`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]);Q(`wrench`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]),Q(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);var hN=Q(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]);Q(`zoom-in`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`11`,x2:`11`,y1:`8`,y2:`14`,key:`1vmskp`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]),Q(`zoom-out`,[[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}],[`line`,{x1:`21`,x2:`16.65`,y1:`21`,y2:`16.65`,key:`13gj7c`}],[`line`,{x1:`8`,x2:`14`,y1:`11`,y2:`11`,key:`durymu`}]]);var gN=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,_N=rD,vN=(e,t)=>n=>{if(t?.variants==null)return _N(e,n?.class,n?.className);let{variants:r,defaultVariants:a}=t,o=Object.keys(r).map(e=>{let t=n?.[e],o=a?.[e];if(t===null)return null;let s=gN(t)||gN(o);return r[e][s]}),s=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return _N(e,o,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...o}=t;return Object.entries(o).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...a,...s}[t]):{...a,...s}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},yN=vN(`inline-flex items-center justify-center rounded-md font-medium transition-colors cursor-pointer disabled:opacity-50 disabled:pointer-events-none`,{variants:{variant:{primary:`bg-primary text-primary-foreground hover:bg-primary/90`,secondary:`bg-surface text-foreground hover:bg-surface-hover`,ghost:`hover:bg-surface-hover text-foreground-muted`,danger:`bg-danger text-white hover:bg-danger/90`,outline:`border border-border bg-transparent hover:bg-surface-hover`},size:{sm:`h-7 px-2.5 text-xs gap-1.5`,md:`h-8 px-3 text-sm gap-2`,lg:`h-9 px-4 text-sm gap-2`}},defaultVariants:{variant:`primary`,size:`sm`}}),bN=(0,x.forwardRef)(({className:e,variant:t,size:n,...r},a)=>(0,S.jsx)(`button`,{ref:a,className:AO(yN({variant:t,size:n}),e),...r}));bN.displayName=`Button`;var xN=vN(`inline-flex items-center justify-center rounded-md font-medium transition-colors cursor-pointer disabled:opacity-50 disabled:pointer-events-none`,{variants:{variant:{primary:`bg-primary text-primary-foreground hover:bg-primary/90`,secondary:`bg-surface text-foreground hover:bg-surface-hover`,ghost:`hover:bg-surface-hover text-foreground-muted`,danger:`bg-danger text-white hover:bg-danger/90`,outline:`border border-border bg-transparent hover:bg-surface-hover`},size:{sm:`h-7 w-7`,md:`h-8 w-8`,lg:`h-9 w-9`}},defaultVariants:{variant:`primary`,size:`sm`}}),SN=(0,x.forwardRef)(({className:e,variant:t,size:n,icon:r,...a},o)=>(0,S.jsx)(`button`,{ref:o,className:AO(xN({variant:t,size:n}),e),...a,children:(0,S.jsx)(r,{className:`h-4 w-4`})}));SN.displayName=`IconButton`;var CN=vN(`inline-flex items-center rounded-full text-xs font-medium px-2 py-0.5`,{variants:{variant:{default:`bg-surface-hover text-foreground`,success:`bg-success/15 text-success`,warning:`bg-warning/15 text-warning`,danger:`bg-danger/15 text-danger`,info:`bg-info/15 text-info`},styleVariant:{solid:``,outline:`border bg-transparent`}},defaultVariants:{variant:`default`,styleVariant:`solid`}}),wN=(0,x.forwardRef)(({className:e,variant:t,style:n,...r},a)=>(0,S.jsx)(`span`,{ref:a,className:AO(CN({variant:t,styleVariant:n}),e),...r}));wN.displayName=`Badge`;var TN=vN(`rounded-lg p-3`,{variants:{variant:{flat:`bg-surface`,bordered:`bg-surface border border-border`}},defaultVariants:{variant:`bordered`}}),EN=(0,x.forwardRef)(({className:e,variant:t,...n},r)=>(0,S.jsx)(`div`,{ref:r,className:AO(TN({variant:t}),e),...n}));EN.displayName=`Card`;var DN=(0,x.forwardRef)(({className:e,...t},n)=>(0,S.jsx)(`label`,{ref:n,className:AO(`text-[10px] uppercase tracking-wider text-foreground-muted font-medium`,e),...t}));DN.displayName=`Label`;var ON=vN(``,{variants:{orientation:{horizontal:`h-px w-full bg-border-subtle`,vertical:`w-px h-full bg-border-subtle`}},defaultVariants:{orientation:`horizontal`}}),kN=(0,x.forwardRef)(({className:e,orientation:t,...n},r)=>(0,S.jsx)(`div`,{ref:r,role:`separator`,className:AO(ON({orientation:t}),e),...n}));kN.displayName=`Separator`;var AN=(0,x.forwardRef)(({className:e,...t},n)=>(0,S.jsx)(`div`,{ref:n,className:AO(`animate-pulse bg-surface-hover rounded-md h-4 w-full`,e),...t}));AN.displayName=`Skeleton`;var jN=vN(`h-7 w-full px-2.5 text-xs bg-surface border rounded-md text-foreground placeholder:text-foreground-subtle focus:outline-none focus:ring-1 focus:ring-primary transition-colors`,{variants:{state:{default:`border-border`,error:`border-danger`}},defaultVariants:{state:`default`}}),MN=(0,x.forwardRef)(({className:e,state:t,leftSlot:n,rightSlot:r,...a},o)=>n||r?(0,S.jsxs)(`div`,{className:`relative flex items-center w-full`,children:[n&&(0,S.jsx)(`div`,{className:`absolute left-2.5 flex items-center pointer-events-none`,children:n}),(0,S.jsx)(`input`,{ref:o,className:AO(jN({state:t}),n?`pl-7`:``,r?`pr-7`:``,e),...a}),r&&(0,S.jsx)(`div`,{className:`absolute right-2.5 flex items-center pointer-events-none`,children:r})]}):(0,S.jsx)(`input`,{ref:o,className:AO(jN({state:t}),e),...a}));MN.displayName=`Input`;var NN=(0,x.forwardRef)(({className:e,options:t,...n},r)=>(0,S.jsxs)(`div`,{className:`relative w-full`,children:[(0,S.jsx)(`select`,{ref:r,className:AO(`h-7 w-full px-2.5 text-xs bg-surface border border-border rounded-md text-foreground appearance-none pr-7 focus:outline-none focus:ring-1 focus:ring-primary`,e),...n,children:t.map(e=>(0,S.jsx)(`option`,{value:e.value,children:e.label},e.value))}),(0,S.jsx)(`div`,{className:`absolute right-2 top-1/2 -translate-y-1/2 pointer-events-none text-foreground-muted`,children:(0,S.jsx)(WM,{className:`h-3.5 w-3.5`})})]}));NN.displayName=`Select`;var PN=(0,x.forwardRef)(({className:e,...t},n)=>(0,S.jsx)(`input`,{ref:n,type:`checkbox`,className:AO(`w-3.5 h-3.5 rounded-sm border border-border accent-primary`,e),...t}));PN.displayName=`Checkbox`;var FN=(0,x.forwardRef)(({className:e,checked:t,onCheckedChange:n,label:r,...a},o)=>(0,S.jsxs)(`button`,{ref:o,role:`switch`,"aria-checked":t,type:`button`,onClick:()=>n(!t),className:AO(`inline-flex items-center gap-2`,e),...a,children:[(0,S.jsx)(`span`,{className:AO(`w-8 h-4 rounded-full transition-colors`,t?`bg-primary`:`bg-surface-hover`),children:(0,S.jsx)(`span`,{className:AO(`block w-3.5 h-3.5 rounded-full bg-white transition-transform`,t?`translate-x-4`:`translate-x-0.5`)})}),r&&(0,S.jsx)(`span`,{className:`text-xs text-foreground`,children:r})]}));FN.displayName=`Switch`;var IN=(0,x.createContext)(null);function LN(){let e=(0,x.useContext)(IN);if(!e)throw Error(`Dialog compound components must be used within <Dialog>`);return e}var RN=vN(`fixed left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 m-0 w-[calc(100vw-2rem)] bg-background-elevated border border-border rounded-lg p-4 backdrop:bg-black/50 backdrop:backdrop-blur-sm max-h-[calc(100dvh-2rem)] overflow-y-auto`,{variants:{width:{sm:`max-w-sm`,md:`max-w-md`,lg:`max-w-lg`}},defaultVariants:{width:`md`}}),zN=(0,x.forwardRef)(({className:e,width:t,children:n,...r},a)=>{let{open:o,setOpen:s,contentId:c}=LN(),l=(0,x.useRef)(null),u=a??l;return(0,x.useEffect)(()=>{let e=u.current;e&&(o&&!e.open&&e.showModal(),!o&&e.open&&e.close())},[o,u]),(0,S.jsx)(`dialog`,{ref:u,id:c,className:AO(RN({width:t}),e),onClick:e=>{e.target===e.currentTarget&&s(!1)},onClose:()=>s(!1),...r,children:n})});zN.displayName=`DialogContent`,(0,x.createContext)(null),(0,x.createContext)(null),(0,x.createContext)(null),(0,x.createContext)(null);var BN=(0,x.forwardRef)(({className:e,...t},n)=>(0,S.jsx)(`div`,{ref:n,className:AO(`overflow-auto [&::-webkit-scrollbar]:w-1 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:bg-surface-hover [&::-webkit-scrollbar-thumb]:rounded-full`,e),...t}));BN.displayName=`ScrollArea`;var VN=typeof globalThis<`u`?globalThis.__camstackTrpcReact:void 0,$=VN??Di();typeof globalThis<`u`&&!VN&&(globalThis.__camstackTrpcReact=$);var HN=FO(`camstack:system`,null);function UN({system:e,children:t}){return(0,S.jsx)(HN.Provider,{value:e,children:t})}function WN(){let e=(0,x.useContext)(HN);if(!e)throw Error(`useSystem(): no <SystemProvider> in tree`);return e}function GN(e,t){let n=WN(),r=(0,x.useRef)(t);r.current=t;let[a,o]=(0,x.useState)(n.connectionVersion);(0,x.useEffect)(()=>n.subscribeConnectionEvents((e,t)=>{e===`connected`&&o(t)}),[n]),(0,x.useEffect)(()=>n.subscribeEvent(e,e=>{r.current(e)}),[n,e,a])}FO(`camstack:confirm-dialog`,null);var KN=`capability.binding-changed`;function qN(e,t){let[n,r]=(0,x.useState)(null);return(0,x.useEffect)(()=>{if(t===null){r(null);return}let n=!1,a=async()=>{try{let a=await e.deviceManager.getBindings.query({deviceId:t});n||r(a)}catch{n||r(e=>e)}};a();let o=e.live?.onEvent.subscribe({category:KN},{onData:e=>{let n=e.data?.source;if(!n){a();return}n.type===`device`&&n.id===t&&a()}});return()=>{n=!0,o?.unsubscribe()}},[e,t]),(0,x.useMemo)(()=>n?df(e,n):null,[e,n])}var JN={[K.Camera]:{icon:UM,label:`Camera`},[K.Hub]:{icon:tN,label:`Hub`},[K.Light]:{icon:ZM,label:`Light`},[K.Siren]:{icon:oN,label:`Siren`},[K.Switch]:{icon:uN,label:`Switch`},[K.Sensor]:{icon:LM,label:`Sensor`},[K.Thermostat]:{icon:lN,label:`Thermostat`},[K.Button]:{icon:KM,label:`Button`},[K.EventEmitter]:{icon:hN,label:`Event Emitter`},[K.Update]:{icon:rN,label:`Update`},[K.Generic]:{icon:HM,label:`Generic`},[K.Notifier]:{icon:zM,label:`Notifier`},[K.Script]:{icon:iN,label:`Script`},[K.Automation]:{icon:mN,label:`Automation`},[K.Lock]:{icon:QM,label:`Lock`},[K.Cover]:{icon:BM,label:`Cover`},[K.Valve]:{icon:nN,label:`Valve`},[K.Humidifier]:{icon:pN,label:`Humidifier`},[K.WaterHeater]:{icon:RM,label:`Water heater`},[K.Fan]:{icon:YM,label:`Fan`},[K.MediaPlayer]:{icon:eN,label:`Media player`},[K.AlarmPanel]:{icon:aN,label:`Alarm panel`},[K.Control]:{icon:sN,label:`Control`},[K.Presence]:{icon:$M,label:`Presence`},[K.Weather]:{icon:qM,label:`Weather`},[K.Vacuum]:{icon:VM,label:`Vacuum`},[K.LawnMower]:{icon:dN,label:`Lawn mower`},[K.Container]:{icon:HM,label:`Container`},[K.Image]:{icon:XM,label:`Image`}};q.Siren,q.Floodlight,q.Spotlight,q.PirSensor,q.Chime,q.Autotrack,q.Nightvision,q.PrivacyMask,q.Doorbell,q.BinaryHelper,q.MotionSensor,q.ContactSensor,q.LeakSensor,q.SmokeSensor,q.COSensor,q.GasSensor,q.TamperSensor,q.VibrationSensor,q.ConnectivitySensor,q.SoundSensor,q.BinarySensor,q.TemperatureSensor,q.HumiditySensor,q.AmbientLightSensor,q.PressureSensor,q.PowerSensor,q.EnergySensor,q.VoltageSensor,q.CurrentSensor,q.AirQualitySensor,q.BatterySensor,q.NumericSensor,q.EnumSensor,q.DateTimeSensor,q.GenericSensor,q.NumericControl,q.SelectControl,q.TextControl,q.DateTimeControl,q.MobilePushNotifier,q.MessagingNotifier,q.EmailNotifier,q.GenericNotifier,new Set(Object.values(K)),new Set(Object.values(q)),Object.values(K).map(e=>({id:e,label:JN[e].label,icon:JN[e].icon})),(0,x.createContext)(null),$.accessories.setChildHidden.useMutation,$.accessories.getStatus.useQuery,$.addonPages.listPages.useQuery,$.addons.list.useQuery,$.addons.getLogs.useQuery,$.addons.listPackages.useQuery,$.addons.installPackage.useMutation,$.addons.installFromWorkspace.useMutation,$.addons.isWorkspaceAvailable.useQuery,$.addons.listWorkspacePackages.useQuery,$.addons.uninstallPackage.useMutation,$.addons.reloadPackages.useMutation,$.addons.searchAvailable.useQuery,$.addons.listUpdates.useQuery,$.addons.updatePackage.useMutation,$.addons.rollbackPackage.useMutation,$.addons.forceRefresh.useMutation,$.addons.restartServer.useMutation,$.addons.getLastRestart.useQuery,$.addons.listFrameworkPackages.useQuery,$.addons.listCapabilityProviders.useQuery,$.addons.setCapabilityProviderEnabled.useMutation,$.addons.updateFrameworkPackage.useMutation,$.addons.getVersions.useQuery,$.addons.restartAddon.useMutation,$.addons.retryLoad.useMutation,$.addons.getAutoUpdateSettings.useQuery,$.addons.setAutoUpdateSettings.useMutation,$.addons.getAddonAutoUpdate.useQuery,$.addons.setAddonAutoUpdate.useMutation,$.addons.applyAutoUpdateToAll.useMutation,$.addons.custom.useMutation,$.addons.startJob.useMutation,$.addons.getJob.useQuery,$.addons.listJobs.useQuery,$.addons.cancelJob.useMutation,$.addons.onAddonLogs.useSubscription,$.addonSettings.getGlobalSettings.useQuery,$.addonSettings.updateGlobalSettings.useMutation,$.addonSettings.getDeviceSettings.useQuery,$.addonSettings.updateDeviceSettings.useMutation,$.addonWidgets.listWidgets.useQuery,$.airQualitySensor.getStatus.useQuery,$.alarmPanel.arm.useMutation,$.alarmPanel.disarm.useMutation,$.alarmPanel.trigger.useMutation,$.alarmPanel.getStatus.useQuery,$.alerts.emit.useMutation,$.alerts.update.useMutation,$.alerts.list.useQuery,$.alerts.getUnreadCount.useQuery,$.alerts.markRead.useMutation,$.alerts.markAllRead.useMutation,$.alerts.dismiss.useMutation,$.ambientLightSensor.getStatus.useQuery,$.audioAnalysis.resolveDeviceSettings.useQuery,$.audioAnalysis.getDeviceSettingsContribution.useQuery,$.audioAnalysis.getDeviceLiveContribution.useQuery,$.audioAnalysis.applyDeviceSettingsPatch.useMutation,$.audioAnalyzer.analyseChunk.useMutation,$.audioAnalyzer.classify.useQuery,$.audioAnalyzer.isReady.useQuery,$.audioAnalyzer.dispose.useMutation,$.audioAnalyzer.reprobeAudioEngine.useMutation,$.audioCodec.listSupportedCodecs.useQuery,$.audioCodec.canHandle.useQuery,$.audioCodec.createDecodeSession.useMutation,$.audioCodec.createEncodeSession.useMutation,$.audioCodec.closeSession.useMutation,$.audioCodec.pushEncodedFrame.useMutation,$.audioCodec.pullPcm.useQuery,$.audioCodec.pushPcm.useMutation,$.audioCodec.pullEncoded.useQuery,$.audioCodec.flushEncode.useMutation,$.audioCodec.listActiveSessions.useQuery,$.audioMetrics.getCurrentSnapshot.useQuery,$.audioMetrics.getHistory.useQuery,$.automationControl.enable.useMutation,$.automationControl.disable.useMutation,$.automationControl.trigger.useMutation,$.automationControl.getStatus.useQuery,$.backup.listDestinations.useQuery,$.backup.trigger.useMutation,$.backup.list.useQuery,$.backup.listLocations.useQuery,$.backup.getEntries.useQuery,$.backup.restore.useMutation,$.backup.delete.useMutation,$.backup.listArchives.useQuery,$.backup.upsertDestinationPolicy.useMutation,$.backup.previewSchedule.useQuery,$.battery.wakeForStream.useMutation,$.battery.getStatus.useQuery,$.binary.getStatus.useQuery,$.brightness.setBrightness.useMutation,$.brightness.getStatus.useQuery,$.broker.list.useQuery,$.broker.get.useQuery,$.broker.listProviders.useQuery,$.broker.add.useMutation,$.broker.remove.useMutation,$.broker.testConnection.useMutation,$.broker.getSettings.useQuery,$.broker.setSettings.useMutation,$.broker.getBrokerConfig.useQuery,$.broker.getSettingsSchema.useQuery,$.broker.testSettings.useMutation,$.broker.publish.useMutation,$.broker.subscribe.useMutation,$.broker.unsubscribe.useMutation,$.broker.getState.useQuery,$.broker.getStatus.useQuery,$.button.press.useMutation,$.cameraCredentials.getCredentials.useQuery,$.cameraCredentials.getStatus.useQuery,$.cameraPipelineConfig.getDeviceSettingsContribution.useQuery,$.cameraPipelineConfig.getDeviceLiveContribution.useQuery,$.cameraPipelineConfig.applyDeviceSettingsPatch.useMutation,$.cameraStreams.getCameraStreams.useQuery,$.cameraStreams.getBrokerStreams.useQuery,$.cameraStreams.getRtspEntries.useQuery,$.cameraStreams.getProfileRtspEntries.useQuery,$.cameraStreams.pickStream.useQuery,$.carbonMonoxide.getStatus.useQuery,$.climateControl.setMode.useMutation,$.climateControl.setFanMode.useMutation,$.climateControl.setPreset.useMutation,$.climateControl.setTarget.useMutation,$.climateControl.setTargetRange.useMutation,$.climateControl.setTargetHumidity.useMutation,$.climateControl.getStatus.useQuery,$.color.setColor.useMutation,$.color.getStatus.useQuery,$.connectivity.getStatus.useQuery,$.consumables.reset.useMutation,$.consumables.getStatus.useQuery,$.contact.getStatus.useQuery,$.control.setValue.useMutation,$.control.getStatus.useQuery,$.cover.open.useMutation,$.cover.close.useMutation,$.cover.stop.useMutation,$.cover.setPosition.useMutation,$.cover.setTiltPosition.useMutation,$.cover.getStatus.useQuery,$.decoder.supportsCodec.useQuery,$.decoder.getInfo.useQuery,$.decoder.createSession.useQuery,$.decoder.destroySession.useQuery,$.decoder.pushPacket.useQuery,$.decoder.openStream.useQuery,$.decoder.pullFrames.useQuery,$.decoder.pullHandles.useQuery,$.decoder.getFrame.useQuery,$.decoder.getShmStats.useQuery,$.decoder.updateConfig.useQuery,$.decoder.getStats.useQuery,$.decoder.listActiveSessions.useQuery,$.decoder.reprobeHwaccel.useMutation,$.detectionPipeline.getDeviceSettingsContribution.useQuery,$.detectionPipeline.getDeviceLiveContribution.useQuery,$.detectionPipeline.applyDeviceSettingsPatch.useMutation,$.deviceAdoption.listCandidateFilters.useQuery,$.deviceAdoption.listCandidates.useQuery,$.deviceAdoption.getCandidate.useQuery,$.deviceAdoption.refresh.useMutation,$.deviceAdoption.adopt.useMutation,$.deviceAdoption.release.useMutation,$.deviceAdoption.resync.useMutation,$.deviceAdoption.getStatus.useQuery,$.deviceDiscovery.listDiscovered.useQuery,$.deviceDiscovery.refreshDiscovery.useMutation,$.deviceDiscovery.adoptDevice.useMutation,$.deviceDiscovery.releaseDevice.useMutation,$.deviceDiscovery.getStatus.useQuery,$.deviceExport.getStatus.useQuery,$.deviceExport.listSupportedDeviceKinds.useQuery,$.deviceExport.listExposedDevices.useQuery,$.deviceExport.exposeDevice.useMutation,$.deviceExport.unexposeDevice.useMutation,$.deviceExport.getDeviceSettingsContribution.useQuery,$.deviceExport.getDeviceLiveContribution.useQuery,$.deviceExport.applyDeviceSettingsPatch.useMutation,$.deviceManager.allocateDeviceId.useMutation,$.deviceManager.registerDevice.useMutation,$.deviceManager.removeDevice.useMutation,$.deviceManager.persistConfig.useMutation,$.deviceManager.loadConfig.useQuery,$.deviceManager.loadRuntimeState.useQuery,$.deviceManager.loadMeta.useQuery,$.deviceManager.setName.useMutation,$.deviceManager.setLocation.useMutation,$.deviceManager.setType.useMutation,$.deviceManager.setIntegrationId.useMutation,$.deviceManager.setLinkDeviceId.useMutation,$.deviceManager.setPrimaryChildEntityId.useMutation,$.deviceManager.setChildLayout.useMutation,$.deviceManager.setDeviceLinks.useMutation,$.deviceManager.getWireableFields.useQuery,$.deviceManager.setRole.useMutation,$.deviceManager.applyInitialMeta.useMutation,$.deviceManager.setMetadata.useMutation,$.deviceManager.listLocations.useQuery,$.deviceManager.addLocation.useMutation,$.deviceManager.removeLocation.useMutation,$.deviceManager.setDisabled.useMutation,$.deviceManager.listPersistedByAddon.useQuery,$.deviceManager.listAll.useQuery,$.deviceManager.getDevice.useQuery,$.deviceManager.getChildren.useQuery,$.deviceManager.getStreamSources.useQuery,$.deviceManager.getConfigSchema.useQuery,$.deviceManager.getSettingsSchema.useQuery,$.deviceManager.updateConfig.useMutation,$.deviceManager.enable.useMutation,$.deviceManager.disable.useMutation,$.deviceManager.remove.useMutation,$.deviceManager.removeByIntegration.useMutation,$.deviceManager.getStreamProfileMap.useQuery,$.deviceManager.setStreamProfileMap.useMutation,$.deviceManager.probeStreams.useMutation,$.deviceManager.getBindings.useQuery,$.deviceManager.getAllBindings.useQuery,$.deviceManager.setWrapperActive.useMutation,$.deviceManager.listWrappersForCap.useQuery,$.deviceManager.listBindableCapsForDeviceType.useQuery,$.deviceManager.getDeviceSettingsAggregate.useQuery,$.deviceManager.getDeviceLiveInfoAggregate.useQuery,$.deviceManager.getDeviceAggregate.useQuery,$.deviceManager.runDeviceAction.useMutation,$.deviceManager.updateDeviceField.useMutation,$.deviceManager.updateDeviceFieldsBatch.useMutation,$.deviceManager.discoverDevices.useMutation,$.deviceManager.adoptDevice.useMutation,$.deviceManager.getCreationSchema.useQuery,$.deviceManager.createDevice.useMutation,$.deviceManager.testCreationField.useMutation,$.deviceManager.adoptionListCandidates.useQuery,$.deviceManager.adoptionRefresh.useMutation,$.deviceManager.adoptionAdopt.useMutation,$.deviceManager.adoptionRelease.useMutation,$.deviceManager.testField.useMutation,$.deviceManager.getDeviceStatusAggregate.useQuery,$.deviceOps.getStreamSources.useQuery,$.deviceOps.getConfigEntries.useQuery,$.deviceOps.setConfig.useMutation,$.deviceOps.runAction.useMutation,$.deviceOps.removeDevice.useMutation,$.deviceOps.getSettingsSchema.useQuery,$.deviceOps.getRawState.useQuery,$.deviceProvider.start.useMutation,$.deviceProvider.stop.useMutation,$.deviceProvider.getStatus.useQuery,$.deviceProvider.getDevices.useQuery,$.deviceProvider.supportsDiscovery.useQuery,$.deviceProvider.discoverDevices.useMutation,$.deviceProvider.adoptDiscoveredDevice.useMutation,$.deviceProvider.supportsManualCreation.useQuery,$.deviceProvider.getChildCreationSchema.useQuery,$.deviceProvider.createDevice.useMutation,$.deviceProvider.testCreationField.useMutation,$.deviceState.getSnapshot.useQuery,$.deviceState.getCapSlice.useQuery,$.deviceState.getAllSnapshots.useQuery,$.deviceState.setCapSlice.useMutation,$.deviceStatus.getStatus.useQuery,$.doorbell.getStatus.useQuery,$.enumSensor.getStatus.useQuery,$.eventEmitter.getStatus.useQuery,$.events.getEvents.useQuery,$.events.getEventThumbnail.useQuery,$.events.getEventClipUrl.useQuery,$.faceGallery.listIdentities.useQuery,$.faceGallery.createIdentity.useMutation,$.faceGallery.renameIdentity.useMutation,$.faceGallery.deleteIdentity.useMutation,$.faceGallery.listIdentitySamples.useQuery,$.faceGallery.removeSample.useMutation,$.faceGallery.listRecentFaces.useQuery,$.faceGallery.getFaceByTrack.useQuery,$.faceGallery.getFaceMedia.useQuery,$.faceGallery.assignFace.useMutation,$.faceGallery.unassignFace.useMutation,$.faceGallery.deleteFace.useMutation,$.faceGallery.assignFaces.useMutation,$.faceGallery.unassignFaces.useMutation,$.faceGallery.suggestFaceClusters.useQuery,$.fanControl.setPercentage.useMutation,$.fanControl.setPreset.useMutation,$.fanControl.setDirection.useMutation,$.fanControl.setOscillating.useMutation,$.fanControl.getStatus.useQuery,$.featureProbe.getStatus.useQuery,$.flood.getStatus.useQuery,$.gas.getStatus.useQuery,$.humidifier.setOn.useMutation,$.humidifier.setTargetHumidity.useMutation,$.humidifier.setMode.useMutation,$.humidifier.getStatus.useQuery,$.humiditySensor.getStatus.useQuery,$.image.getStatus.useQuery,$.integrations.list.useQuery,$.integrations.get.useQuery,$.integrations.getByAddonId.useQuery,$.integrations.create.useMutation,$.integrations.update.useMutation,$.integrations.delete.useMutation,$.integrations.getSettings.useQuery,$.integrations.setSettings.useMutation,$.integrations.getAvailableTypes.useQuery,$.integrations.testConnection.useMutation;var YN=$.intercom.startSession.useMutation,XN=$.intercom.handleAnswer.useMutation,ZN=$.intercom.stopSession.useMutation;$.intercom.startTalkSession.useMutation,$.intercom.pushTalkAudio.useMutation,$.intercom.endTalkSession.useMutation,$.intercom.getStatus.useQuery,$.lawnMowerControl.startMowing.useMutation,$.lawnMowerControl.pause.useMutation,$.lawnMowerControl.dock.useMutation,$.lawnMowerControl.getStatus.useQuery,$.localNetwork.list.useQuery,$.localNetwork.getPreferred.useQuery,$.localNetwork.getConnectionEndpoints.useQuery,$.localNetwork.getAllowedAddresses.useQuery,$.localNetwork.setAllowedAddresses.useMutation,$.localNetwork.resetAllowlistToBestMatch.useMutation,$.lockControl.lock.useMutation,$.lockControl.unlock.useMutation,$.lockControl.open.useMutation,$.lockControl.getStatus.useQuery,$.mediaPlayer.play.useMutation,$.mediaPlayer.pause.useMutation,$.mediaPlayer.stop.useMutation,$.mediaPlayer.next.useMutation,$.mediaPlayer.previous.useMutation,$.mediaPlayer.seek.useMutation,$.mediaPlayer.setVolume.useMutation,$.mediaPlayer.setMute.useMutation,$.mediaPlayer.setShuffle.useMutation,$.mediaPlayer.setRepeat.useMutation,$.mediaPlayer.selectSource.useMutation,$.mediaPlayer.playMedia.useMutation,$.mediaPlayer.getStatus.useQuery,$.meshNetwork.getStatus.useQuery,$.meshNetwork.join.useMutation,$.meshNetwork.startLogin.useMutation,$.meshNetwork.leave.useMutation,$.meshNetwork.logout.useMutation,$.meshNetwork.listPeers.useQuery,$.meshNetwork.testConnection.useMutation,$.metricsProvider.collectSnapshot.useQuery,$.metricsProvider.getCached.useQuery,$.metricsProvider.getCurrent.useQuery,$.metricsProvider.getDiskSpace.useQuery,$.metricsProvider.getGpuInfo.useQuery,$.metricsProvider.getCpuTemperature.useQuery,$.metricsProvider.getProcessStats.useQuery,$.metricsProvider.listAddonInstances.useQuery,$.metricsProvider.getAddonStats.useQuery,$.metricsProvider.listNodeProcesses.useQuery,$.metricsProvider.killProcess.useMutation,$.metricsProvider.dumpHeapSnapshot.useMutation,$.motion.isDetected.useQuery,$.motion.getStatus.useQuery,$.motionDetection.analyze.useMutation,$.motionDetection.removeCamera.useMutation,$.motionDetection.reset.useMutation,$.motionDetection.getDeviceSettingsContribution.useQuery,$.motionDetection.getDeviceLiveContribution.useQuery,$.motionDetection.applyDeviceSettingsPatch.useMutation,$.motionTrigger.setMotionTrigger.useMutation,$.motionTrigger.getStatus.useQuery,$.motionZones.getOptions.useQuery,$.motionZones.setZone.useMutation,$.motionZones.getStatus.useQuery,$.mqttBroker.listBrokers.useQuery,$.mqttBroker.getBrokerConfig.useQuery,$.mqttBroker.addBroker.useMutation,$.mqttBroker.removeBroker.useMutation,$.mqttBroker.testConnection.useMutation,$.mqttBroker.startEmbeddedBroker.useMutation,$.mqttBroker.stopEmbeddedBroker.useMutation,$.mqttBroker.getStatus.useQuery,$.nativeObjectDetection.setEnabled.useMutation,$.nativeObjectDetection.getStatus.useQuery,$.networkAccess.start.useMutation,$.networkAccess.stop.useMutation,$.networkAccess.getEndpoint.useQuery,$.networkAccess.getStatus.useQuery,$.networkAccess.listEndpoints.useQuery,$.networkQuality.getDeviceStats.useQuery,$.networkQuality.getAllStats.useQuery,$.networkQuality.reportClientStats.useMutation,$.nodes.topology.useQuery,$.nodes.deployAddon.useMutation,$.nodes.undeployAddon.useMutation,$.nodes.restartAddon.useMutation,$.nodes.restartProcess.useMutation,$.nodes.restartNode.useMutation,$.nodes.shutdownNode.useMutation,$.nodes.renameNode.useMutation,$.nodes.clusterAddonStatus.useQuery,$.nodes.getCapUsageGraph.useQuery,$.nodes.getNodeAddons.useQuery,$.nodes.setProcessLogLevel.useMutation,$.nodes.executeQuery.useMutation,$.notificationOutput.send.useMutation,$.notificationOutput.sendTest.useMutation,$.notifier.send.useMutation,$.notifier.cancel.useMutation,$.notifier.getStatus.useQuery,$.numericSensor.getStatus.useQuery,$.osd.setOverlay.useMutation,$.osd.getStatus.useQuery,$.pipelineAnalytics.getActiveTracks.useQuery,$.pipelineAnalytics.getTrack.useQuery,$.pipelineAnalytics.listTracks.useQuery,$.pipelineAnalytics.clearTracks.useMutation,$.pipelineAnalytics.getMotionEvents.useQuery,$.pipelineAnalytics.getObjectEvents.useQuery,$.pipelineAnalytics.getAudioEvents.useQuery,$.pipelineAnalytics.getEventDensity.useQuery,$.pipelineAnalytics.pruneEventsBefore.useMutation,$.pipelineAnalytics.getEventMedia.useQuery,$.pipelineAnalytics.getTrackMedia.useQuery,$.pipelineAnalytics.getDeviceSettingsContribution.useQuery,$.pipelineAnalytics.getDeviceLiveContribution.useQuery,$.pipelineAnalytics.applyDeviceSettingsPatch.useMutation,$.pipelineExecutor.getAvailableEngines.useQuery,$.pipelineExecutor.getSelectedEngine.useQuery,$.pipelineExecutor.getDefaultSteps.useQuery,$.pipelineExecutor.reprobeEngine.useMutation,$.pipelineExecutor.getEngineProvisioning.useQuery,$.pipelineExecutor.getVideoPipelineSteps.useQuery,$.pipelineExecutor.setVideoPipelineSteps.useMutation,$.pipelineExecutor.getSchema.useQuery,$.pipelineExecutor.getGlobalSteps.useQuery,$.pipelineExecutor.getGlobalPipelineConfig.useQuery,$.pipelineExecutor.getOrchestratorConfigSchema.useQuery,$.pipelineExecutor.listTemplates.useQuery,$.pipelineExecutor.saveTemplate.useMutation,$.pipelineExecutor.updateTemplate.useMutation,$.pipelineExecutor.deleteTemplate.useMutation,$.pipelineExecutor.getCapabilities.useQuery,$.pipelineExecutor.getAddonModels.useQuery,$.pipelineExecutor.downloadModel.useMutation,$.pipelineExecutor.deleteModel.useMutation,$.pipelineExecutor.detect.useQuery,$.pipelineExecutor.runPipeline.useMutation,$.pipelineExecutor.runPipelineBatch.useMutation,$.pipelineExecutor.cacheFrameInPool.useMutation,$.pipelineExecutor.inferCached.useMutation,$.pipelineExecutor.uncacheFrame.useMutation,$.pipelineExecutor.getEffectiveTuning.useQuery,$.pipelineExecutor.listLoadedEngines.useQuery,$.pipelineExecutor.spinEngine.useMutation,$.pipelineExecutor.killEngine.useMutation,$.pipelineExecutor.listReferenceImages.useQuery,$.pipelineExecutor.getReferenceImage.useQuery,$.pipelineExecutor.getReferenceAudioFiles.useQuery,$.pipelineExecutor.getReferenceAudio.useQuery,$.pipelineExecutor.getAudioCapabilities.useQuery,$.pipelineExecutor.runAudioTest.useMutation,$.pipelineExecutor.getDetectionConfigSchema.useQuery,$.pipelineOrchestrator.assignPipeline.useMutation,$.pipelineOrchestrator.unassignPipeline.useMutation,$.pipelineOrchestrator.rebalance.useMutation,$.pipelineOrchestrator.getPipelineAssignments.useQuery,$.pipelineOrchestrator.getPipelineAssignment.useQuery,$.pipelineOrchestrator.getAgentLoad.useQuery,$.pipelineOrchestrator.getGlobalMetrics.useQuery,$.pipelineOrchestrator.getCameraMetrics.useQuery,$.pipelineOrchestrator.getCapabilityBindings.useQuery,$.pipelineOrchestrator.setCapabilityBinding.useMutation,$.pipelineOrchestrator.assignDecoder.useMutation,$.pipelineOrchestrator.unassignDecoder.useMutation,$.pipelineOrchestrator.getDecoderAssignments.useQuery,$.pipelineOrchestrator.assignAudio.useMutation,$.pipelineOrchestrator.unassignAudio.useMutation,$.pipelineOrchestrator.getAudioAssignment.useQuery,$.pipelineOrchestrator.getAudioNodeLoad.useQuery,$.pipelineOrchestrator.getAudioAssignments.useQuery,$.pipelineOrchestrator.getDecoderAssignment.useQuery,$.pipelineOrchestrator.getAgentSettings.useQuery,$.pipelineOrchestrator.listAgentSettings.useQuery,$.pipelineOrchestrator.setAgentAddonDefaults.useMutation,$.pipelineOrchestrator.removeAgentSettings.useMutation,$.pipelineOrchestrator.setAgentMaxCameras.useMutation,$.pipelineOrchestrator.getCameraSettings.useQuery,$.pipelineOrchestrator.setCameraStepToggle.useMutation,$.pipelineOrchestrator.getCameraStepOverrides.useQuery,$.pipelineOrchestrator.setCameraStepOverride.useMutation,$.pipelineOrchestrator.setCameraPipelineForAgent.useMutation,$.pipelineOrchestrator.resolvePipeline.useQuery,$.pipelineOrchestrator.getCameraStatus.useQuery,$.pipelineOrchestrator.getCameraStatuses.useQuery,$.pipelineOrchestrator.listTemplates.useQuery,$.pipelineOrchestrator.saveTemplate.useMutation,$.pipelineOrchestrator.updateTemplate.useMutation,$.pipelineOrchestrator.deleteTemplate.useMutation,$.pipelineOrchestrator.getDeviceSettingsContribution.useQuery,$.pipelineOrchestrator.getDeviceLiveContribution.useQuery,$.pipelineOrchestrator.applyDeviceSettingsPatch.useMutation,$.pipelineRunner.attachCamera.useMutation,$.pipelineRunner.detachCamera.useMutation,$.pipelineRunner.reportMotion.useMutation,$.pipelineRunner.getLocalLoad.useQuery,$.pipelineRunner.getLocalMetrics.useQuery,$.pipelineRunner.getCameraMetrics.useQuery,$.pipelineRunner.getAllCameraMetrics.useQuery,$.pipelineRunner.getLocalCameras.useQuery,$.plateGallery.listPlates.useQuery,$.plateGallery.getPlateByTrack.useQuery,$.plateGallery.getPlateMedia.useQuery,$.plateGallery.searchPlates.useQuery,$.plateGallery.suggestPlateClusters.useQuery,$.plateGallery.correctPlateText.useMutation,$.plateGallery.deletePlate.useMutation,$.powerMeter.getStatus.useQuery,$.presence.getStatus.useQuery,$.pressureSensor.getStatus.useQuery,$.privacyMask.getOptions.useQuery,$.privacyMask.setMask.useMutation,$.privacyMask.getStatus.useQuery,$.ptz.move.useMutation,$.ptz.continuousMove.useMutation,$.ptz.stop.useMutation,$.ptz.getPresets.useQuery,$.ptz.goToPreset.useMutation,$.ptz.savePreset.useMutation,$.ptz.deletePreset.useMutation,$.ptz.getOptions.useQuery,$.ptz.goHome.useMutation,$.ptz.getPosition.useQuery,$.ptz.setAutofocus.useMutation,$.ptz.getStatus.useQuery,$.ptzAutotrack.getStatus.useQuery,$.ptzAutotrack.setEnabled.useMutation,$.ptzAutotrack.getSettings.useQuery,$.ptzAutotrack.setSettings.useMutation,$.reboot.reboot.useMutation,$.recording.getAvailability.useQuery,$.recording.getDaysWithRecordings.useQuery,$.recording.getPlaybackManifest.useQuery,$.recording.getStorageUsage.useQuery,$.recording.getDeviceConfig.useQuery,$.recording.locateSegment.useQuery,$.recording.readSegmentBytes.useQuery,$.recording.setDeviceConfig.useMutation,$.recording.rescanStorage.useMutation,$.recording.pruneFootage.useMutation,$.recording.getStatus.useQuery,$.recording.getDeviceSettingsContribution.useQuery,$.recording.getDeviceLiveContribution.useQuery,$.recording.applyDeviceSettingsPatch.useMutation,$.scriptRunner.run.useMutation,$.scriptRunner.stop.useMutation,$.scriptRunner.getStatus.useQuery,$.settingsStore.get.useQuery,$.settingsStore.set.useMutation,$.settingsStore.query.useQuery,$.settingsStore.insert.useMutation,$.settingsStore.update.useMutation,$.settingsStore.delete.useMutation,$.settingsStore.count.useQuery,$.settingsStore.histogram.useQuery,$.settingsStore.isEmpty.useQuery,$.settingsStore.declareCollection.useMutation,$.smoke.getStatus.useQuery,$.snapshot.getSnapshot.useQuery,$.snapshot.invalidateCache.useMutation,$.snapshot.getStatus.useQuery,$.snapshot.getDeviceSettingsContribution.useQuery,$.snapshot.getDeviceLiveContribution.useQuery,$.snapshot.applyDeviceSettingsPatch.useMutation,$.snapshotProvider.supportsDevice.useQuery,$.snapshotProvider.getSnapshot.useQuery,$.storage.resolve.useQuery,$.storage.write.useMutation,$.storage.read.useQuery,$.storage.exists.useQuery,$.storage.list.useQuery,$.storage.delete.useMutation,$.storage.getAvailableSpace.useQuery,$.storage.beginUpload.useMutation,$.storage.writeChunk.useMutation,$.storage.finalizeUpload.useMutation,$.storage.abortUpload.useMutation,$.storage.beginDownload.useMutation,$.storage.readChunk.useQuery,$.storage.endDownload.useMutation,$.storage.listLocations.useQuery,$.storage.getDefaultLocation.useQuery,$.storage.listLocationDeclarations.useQuery,$.storage.upsertLocation.useMutation,$.storage.deleteLocation.useMutation,$.storage.testLocation.useQuery,$.storage.listProviders.useQuery,$.storage.testConfig.useQuery,$.streamBroker.publishCameraStream.useMutation,$.streamBroker.retractCameraStream.useMutation,$.streamBroker.assignProfile.useMutation,$.streamBroker.unassignProfile.useMutation,$.streamBroker.listAllCameraStreams.useQuery,$.streamBroker.listAllProfileSlots.useQuery,$.streamBroker.getBrokerStats.useQuery,$.streamBroker.probeStream.useMutation,$.streamBroker.listClients.useQuery,$.streamBroker.killClient.useMutation,$.streamBroker.restartProfile.useMutation,$.streamBroker.getStreamUrl.useQuery,$.streamBroker.getStreamWithCodec.useMutation,$.streamBroker.releaseStreamWithCodec.useMutation,$.streamBroker.subscribeAudioChunks.useMutation,$.streamBroker.pullAudioChunks.useQuery,$.streamBroker.unsubscribeAudioChunks.useMutation,$.streamBroker.subscribeFrames.useMutation,$.streamBroker.pullFrameHandles.useQuery,$.streamBroker.unsubscribeFrames.useMutation,$.streamBroker.setPreBufferDuration.useMutation,$.streamBroker.getPreBufferInfo.useQuery,$.streamBroker.getRtspPort.useQuery,$.streamBroker.getAllRtspEntries.useQuery,$.streamBroker.getRtspEntry.useQuery,$.streamBroker.regenerateRtspToken.useMutation,$.streamBroker.setRtspEnabled.useMutation,$.streamBroker.isRtspEnabled.useQuery,$.streamBroker.getDeviceSettingsContribution.useQuery,$.streamBroker.getDeviceLiveContribution.useQuery,$.streamBroker.applyDeviceSettingsPatch.useMutation,$.streamCatalog.getCatalog.useQuery,$.streamParams.getOptions.useQuery,$.streamParams.setProfile.useMutation,$.streamParams.getConfigSchema.useQuery,$.streamParams.getStatus.useQuery,$.switch.setState.useMutation,$.switch.getStatus.useQuery,$.system.info.useQuery,$.system.health.useQuery,$.system.featureFlags.useQuery,$.system.networkAddresses.useQuery,$.system.getRetentionConfig.useQuery,$.system.setRetentionConfig.useMutation,$.system.forceRetentionCleanup.useMutation,$.tamper.getStatus.useQuery,$.temperatureSensor.getStatus.useQuery,$.toast.onToast.useSubscription,$.turnProvider.getTurnServers.useQuery,$.update.installUpdate.useMutation,$.update.getStatus.useQuery,$.userManagement.listUsers.useQuery,$.userManagement.createUser.useMutation,$.userManagement.updateUser.useMutation,$.userManagement.deleteUser.useMutation,$.userManagement.resetPassword.useMutation,$.userManagement.setUserScopes.useMutation,$.userManagement.validateCredentials.useMutation,$.userManagement.listApiKeys.useQuery,$.userManagement.createApiKey.useMutation,$.userManagement.revokeApiKey.useMutation,$.userManagement.validateApiKey.useMutation,$.userManagement.createScopedToken.useMutation,$.userManagement.revokeScopedToken.useMutation,$.userManagement.validateScopedToken.useQuery,$.userManagement.listScopedTokens.useQuery,$.userManagement.setupTotp.useMutation,$.userManagement.confirmTotp.useMutation,$.userManagement.disableTotp.useMutation,$.userManagement.getTotpStatus.useQuery,$.userManagement.verifyTotp.useMutation,$.userManagement.oauthIssueCode.useMutation,$.userManagement.oauthExchangeCode.useMutation,$.userManagement.oauthRefresh.useMutation,$.userManagement.oauthVerifyAccessToken.useQuery,$.userManagement.listOauthSessions.useQuery,$.userManagement.revokeOauthSession.useMutation,$.vacuumControl.start.useMutation,$.vacuumControl.pause.useMutation,$.vacuumControl.stop.useMutation,$.vacuumControl.returnToBase.useMutation,$.vacuumControl.locate.useMutation,$.vacuumControl.setFanSpeed.useMutation,$.vacuumControl.getStatus.useQuery,$.valve.open.useMutation,$.valve.close.useMutation,$.valve.stop.useMutation,$.valve.setPosition.useMutation,$.valve.getStatus.useQuery,$.vibration.getStatus.useQuery,$.videoclips.listClips.useQuery,$.videoclips.getClipPlayback.useQuery,$.waterHeater.setTargetTemp.useMutation,$.waterHeater.setOperationMode.useMutation,$.waterHeater.setAway.useMutation,$.waterHeater.getStatus.useQuery,$.weather.getStatus.useQuery,$.webrtcSession.listStreams.useQuery,$.webrtcSession.createSession.useMutation,$.webrtcSession.handleOffer.useMutation,$.webrtcSession.handleAnswer.useMutation,$.webrtcSession.addIceCandidate.useMutation,$.webrtcSession.getIceCandidates.useQuery,$.webrtcSession.closeSession.useMutation,$.webrtcSession.hasAdaptiveBitrate.useQuery,$.webrtcSession.getSessionState.useQuery,$.zoneAnalytics.getCurrentSnapshot.useQuery,$.zoneAnalytics.getZoneHistory.useQuery,$.zoneAnalytics.getCameraHistory.useQuery,$.zoneAnalytics.getUnzonedHistory.useQuery,$.zoneRules.listRules.useQuery,$.zoneRules.setRules.useMutation,$.zones.listZones.useQuery,$.zones.addZone.useMutation,$.zones.removeZone.useMutation,$.zones.updateZone.useMutation;var QN=176,$N=76;270/360*(2*Math.PI*$N),QN/2-$N-10,270/360*(2*Math.PI*64),K.Cover,K.Valve,K.Humidifier,K.WaterHeater,K.Camera,K.Hub,K.Switch,K.Siren,K.Light,K.Fan,K.Sensor,K.Thermostat,K.Button,K.EventEmitter,K.Update,K.Generic,K.Notifier,K.Script,K.Automation,K.Lock,K.MediaPlayer,K.AlarmPanel,K.Control,K.Presence,K.Weather,K.Vacuum,K.LawnMower,K.Container,K.Image,K.Cover,K.Valve,K.Thermostat,K.Control,K.Button,K.MediaPlayer,K.AlarmPanel,K.Lock,K.Vacuum,K.LawnMower,K.Humidifier,K.Switch,K.Siren,K.Light,K.Fan,K.WaterHeater,K.Sensor,K.Presence,K.EventEmitter,K.Notifier,K.Script,K.Automation,K.Camera,K.Hub,K.Update,K.Generic,K.Weather,K.Container,K.Image,new Set(Object.values(K)),new Set([K.Sensor,K.Presence]),Object.freeze([]);var eP=class{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set(e,t){this.keyToValue.set(e,t),this.valueToKey.set(t,e)}getByKey(e){return this.keyToValue.get(e)}getByValue(e){return this.valueToKey.get(e)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}},tP=class{constructor(e){this.generateIdentifier=e,this.kv=new eP}register(e,t){this.kv.getByValue(e)||(t||=this.generateIdentifier(e),this.kv.set(t,e))}clear(){this.kv.clear()}getIdentifier(e){return this.kv.getByValue(e)}getValue(e){return this.kv.getByKey(e)}},nP=class extends tP{constructor(){super(e=>e.name),this.classToAllowedProps=new Map}register(e,t){typeof t==`object`?(t.allowProps&&this.classToAllowedProps.set(e,t.allowProps),super.register(e,t.identifier)):super.register(e,t)}getAllowedProps(e){return this.classToAllowedProps.get(e)}};function rP(e){if(`values`in Object)return Object.values(e);let t=[];for(let n in e)e.hasOwnProperty(n)&&t.push(e[n]);return t}function iP(e,t){let n=rP(e);if(`find`in n)return n.find(t);let r=n;for(let e=0;e<r.length;e++){let n=r[e];if(t(n))return n}}function aP(e,t){Object.entries(e).forEach(([e,n])=>t(n,e))}function oP(e,t){return e.indexOf(t)!==-1}function sP(e,t){for(let n=0;n<e.length;n++){let r=e[n];if(t(r))return r}}var cP=class{constructor(){this.transfomers={}}register(e){this.transfomers[e.name]=e}findApplicable(e){return iP(this.transfomers,t=>t.isApplicable(e))}findByName(e){return this.transfomers[e]}},lP=e=>Object.prototype.toString.call(e).slice(8,-1),uP=e=>e===void 0,dP=e=>e===null,fP=e=>typeof e!=`object`||!e||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype,pP=e=>fP(e)&&Object.keys(e).length===0,mP=e=>Array.isArray(e),hP=e=>typeof e==`string`,gP=e=>typeof e==`number`&&!isNaN(e),_P=e=>typeof e==`boolean`,vP=e=>e instanceof RegExp,yP=e=>e instanceof Map,bP=e=>e instanceof Set,xP=e=>lP(e)===`Symbol`,SP=e=>e instanceof Date&&!isNaN(e.valueOf()),CP=e=>e instanceof Error,wP=e=>typeof e==`number`&&isNaN(e),TP=e=>_P(e)||dP(e)||uP(e)||gP(e)||hP(e)||xP(e),EP=e=>typeof e==`bigint`,DP=e=>e===1/0||e===-1/0,OP=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),kP=e=>e instanceof URL,AP=e=>e.replace(/\\/g,`\\\\`).replace(/\./g,`\\.`),jP=e=>e.map(String).map(AP).join(`.`),MP=(e,t)=>{let n=[],r=``;for(let a=0;a<e.length;a++){let o=e.charAt(a);if(!t&&o===`\\`){let t=e.charAt(a+1);if(t===`\\`){r+=`\\`,a++;continue}else if(t!==`.`)throw Error(`invalid path`)}if(o===`\\`&&e.charAt(a+1)===`.`){r+=`.`,a++;continue}if(o===`.`){n.push(r),r=``;continue}r+=o}let a=r;return n.push(a),n};function NP(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var PP=[NP(uP,`undefined`,()=>null,()=>void 0),NP(EP,`bigint`,e=>e.toString(),e=>typeof BigInt<`u`?BigInt(e):(console.error(`Please add a BigInt polyfill.`),e)),NP(SP,`Date`,e=>e.toISOString(),e=>new Date(e)),NP(CP,`Error`,(e,t)=>{let n={name:e.name,message:e.message};return`cause`in e&&(n.cause=e.cause),t.allowedErrorProps.forEach(t=>{n[t]=e[t]}),n},(e,t)=>{let n=Error(e.message,{cause:e.cause});return n.name=e.name,n.stack=e.stack,t.allowedErrorProps.forEach(t=>{n[t]=e[t]}),n}),NP(vP,`regexp`,e=>``+e,e=>{let t=e.slice(1,e.lastIndexOf(`/`)),n=e.slice(e.lastIndexOf(`/`)+1);return new RegExp(t,n)}),NP(bP,`set`,e=>[...e.values()],e=>new Set(e)),NP(yP,`map`,e=>[...e.entries()],e=>new Map(e)),NP(e=>wP(e)||DP(e),`number`,e=>wP(e)?`NaN`:e>0?`Infinity`:`-Infinity`,Number),NP(e=>e===0&&1/e==-1/0,`number`,()=>`-0`,Number),NP(kP,`URL`,e=>e.toString(),e=>new URL(e))];function FP(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var IP=FP((e,t)=>xP(e)?!!t.symbolRegistry.getIdentifier(e):!1,(e,t)=>[`symbol`,t.symbolRegistry.getIdentifier(e)],e=>e.description,(e,t,n)=>{let r=n.symbolRegistry.getValue(t[1]);if(!r)throw Error(`Trying to deserialize unknown symbol`);return r}),LP=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),RP=FP(OP,e=>[`typed-array`,e.constructor.name],e=>[...e],(e,t)=>{let n=LP[t[1]];if(!n)throw Error(`Trying to deserialize unknown typed array`);return new n(e)});function zP(e,t){return e?.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}var BP=FP(zP,(e,t)=>[`class`,t.classRegistry.getIdentifier(e.constructor)],(e,t)=>{let n=t.classRegistry.getAllowedProps(e.constructor);if(!n)return{...e};let r={};return n.forEach(t=>{r[t]=e[t]}),r},(e,t,n)=>{let r=n.classRegistry.getValue(t[1]);if(!r)throw Error(`Trying to deserialize unknown class '${t[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);return Object.assign(Object.create(r.prototype),e)}),VP=FP((e,t)=>!!t.customTransformerRegistry.findApplicable(e),(e,t)=>[`custom`,t.customTransformerRegistry.findApplicable(e).name],(e,t)=>t.customTransformerRegistry.findApplicable(e).serialize(e),(e,t,n)=>{let r=n.customTransformerRegistry.findByName(t[1]);if(!r)throw Error(`Trying to deserialize unknown custom value`);return r.deserialize(e)}),HP=[BP,IP,VP,RP],UP=(e,t)=>{let n=sP(HP,n=>n.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};let r=sP(PP,n=>n.isApplicable(e,t));if(r)return{value:r.transform(e,t),type:r.annotation}},WP={};PP.forEach(e=>{WP[e.annotation]=e});var GP=(e,t,n)=>{if(mP(t))switch(t[0]){case`symbol`:return IP.untransform(e,t,n);case`class`:return BP.untransform(e,t,n);case`custom`:return VP.untransform(e,t,n);case`typed-array`:return RP.untransform(e,t,n);default:throw Error(`Unknown transformation: `+t)}else{let r=WP[t];if(!r)throw Error(`Unknown transformation: `+t);return r.untransform(e,n)}},KP=(e,t)=>{if(t>e.size)throw Error(`index out of bounds`);let n=e.keys();for(;t>0;)n.next(),t--;return n.next().value};function qP(e){if(oP(e,`__proto__`))throw Error(`__proto__ is not allowed as a property`);if(oP(e,`prototype`))throw Error(`prototype is not allowed as a property`);if(oP(e,`constructor`))throw Error(`constructor is not allowed as a property`)}var JP=(e,t)=>{qP(t);for(let n=0;n<t.length;n++){let r=t[n];if(bP(e))e=KP(e,+r);else if(yP(e)){let a=+r,o=+t[++n]==0?`key`:`value`,s=KP(e,a);switch(o){case`key`:e=s;break;case`value`:e=e.get(s);break}}else e=e[r]}return e},YP=(e,t,n)=>{if(qP(t),t.length===0)return n(e);let r=e;for(let e=0;e<t.length-1;e++){let n=t[e];if(mP(r)){let e=+n;r=r[e]}else if(fP(r))r=r[n];else if(bP(r)){let e=+n;r=KP(r,e)}else if(yP(r)){if(e===t.length-2)break;let a=+n,o=+t[++e]==0?`key`:`value`,s=KP(r,a);switch(o){case`key`:r=s;break;case`value`:r=r.get(s);break}}}let a=t[t.length-1];if(mP(r)?r[+a]=n(r[+a]):fP(r)&&(r[a]=n(r[a])),bP(r)){let e=KP(r,+a),t=n(e);e!==t&&(r.delete(e),r.add(t))}if(yP(r)){let e=+t[t.length-2],o=KP(r,e);switch(+a==0?`key`:`value`){case`key`:{let e=n(o);r.set(e,r.get(o)),e!==o&&r.delete(o);break}case`value`:r.set(o,n(r.get(o)));break}}return e},XP=e=>e<1;function ZP(e,t,n,r=[]){if(!e)return;let a=XP(n);if(!mP(e)){aP(e,(e,o)=>ZP(e,t,n,[...r,...MP(o,a)]));return}let[o,s]=e;s&&aP(s,(e,o)=>{ZP(e,t,n,[...r,...MP(o,a)])}),t(o,r)}function QP(e,t,n,r){return ZP(t,(t,n)=>{e=YP(e,n,e=>GP(e,t,r))},n),e}function $P(e,t,n){let r=XP(n);function a(t,n){let a=JP(e,MP(n,r));t.map(e=>MP(e,r)).forEach(t=>{e=YP(e,t,()=>a)})}if(mP(t)){let[n,o]=t;n.forEach(t=>{e=YP(e,MP(t,r),()=>e)}),o&&aP(o,a)}else aP(t,a);return e}var eF=(e,t)=>fP(e)||mP(e)||yP(e)||bP(e)||CP(e)||zP(e,t);function tF(e,t,n){let r=n.get(e);r?r.push(t):n.set(e,[t])}function nF(e,t){let n={},r;return e.forEach(e=>{if(e.length<=1)return;t||(e=e.map(e=>e.map(String)).sort((e,t)=>e.length-t.length));let[a,...o]=e;a.length===0?r=o.map(jP):n[jP(a)]=o.map(jP)}),r?pP(n)?[r]:[r,n]:pP(n)?void 0:n}var rF=(e,t,n,r,a=[],o=[],s=new Map)=>{let c=TP(e);if(!c){tF(e,a,t);let n=s.get(e);if(n)return r?{transformedValue:null}:n}if(!eF(e,n)){let t=UP(e,n),r=t?{transformedValue:t.value,annotations:[t.type]}:{transformedValue:e};return c||s.set(e,r),r}if(oP(o,e))return{transformedValue:null};let l=UP(e,n),u=l?.value??e,d=mP(u)?[]:{},f={};aP(u,(c,l)=>{if(l===`__proto__`||l===`constructor`||l===`prototype`)throw Error(`Detected property ${l}. This is a prototype pollution risk, please remove it from your object.`);let u=rF(c,t,n,r,[...a,l],[...o,e],s);d[l]=u.transformedValue,mP(u.annotations)?f[AP(l)]=u.annotations:fP(u.annotations)&&aP(u.annotations,(e,t)=>{f[AP(l)+`.`+t]=e})});let p=pP(f)?{transformedValue:d,annotations:l?[l.type]:void 0}:{transformedValue:d,annotations:l?[l.type,f]:f};return c||s.set(e,p),p};function iF(e){return Object.prototype.toString.call(e).slice(8,-1)}function aF(e){return iF(e)===`Array`}function oF(e){if(iF(e)!==`Object`)return!1;let t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function sF(e,t,n,r,a){let o={}.propertyIsEnumerable.call(r,t)?`enumerable`:`nonenumerable`;o===`enumerable`&&(e[t]=n),a&&o===`nonenumerable`&&Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}function cF(e,t={}){if(aF(e))return e.map(e=>cF(e,t));if(!oF(e))return e;let n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertySymbols(e);return[...n,...r].reduce((n,r)=>{if(r===`__proto__`||aF(t.props)&&!t.props.includes(r))return n;let a=e[r];return sF(n,r,cF(a,t),e,t.nonenumerable),n},{})}var lF=class{constructor({dedupe:e=!1}={}){this.classRegistry=new nP,this.symbolRegistry=new tP(e=>e.description??``),this.customTransformerRegistry=new cP,this.allowedErrorProps=[],this.dedupe=e}serialize(e){let t=new Map,n=rF(e,t,this,this.dedupe),r={json:n.transformedValue};n.annotations&&(r.meta={...r.meta,values:n.annotations});let a=nF(t,this.dedupe);return a&&(r.meta={...r.meta,referentialEqualities:a}),r.meta&&(r.meta.v=1),r}deserialize(e,t){let{json:n,meta:r}=e,a=t?.inPlace?n:cF(n);return r?.values&&(a=QP(a,r.values,r.v??0,this)),r?.referentialEqualities&&(a=$P(a,r.referentialEqualities,r.v??0)),a}stringify(e){return JSON.stringify(this.serialize(e))}parse(e){return this.deserialize(JSON.parse(e),{inPlace:!0})}registerClass(e,t){this.classRegistry.register(e,t)}registerSymbol(e,t){this.symbolRegistry.register(e,t)}registerCustom(e,t){this.customTransformerRegistry.register({name:t,...e})}allowErrorProps(...e){this.allowedErrorProps.push(...e)}};lF.defaultInstance=new lF,lF.serialize=lF.defaultInstance.serialize.bind(lF.defaultInstance),lF.deserialize=lF.defaultInstance.deserialize.bind(lF.defaultInstance),lF.stringify=lF.defaultInstance.stringify.bind(lF.defaultInstance),lF.parse=lF.defaultInstance.parse.bind(lF.defaultInstance),lF.registerClass=lF.defaultInstance.registerClass.bind(lF.defaultInstance),lF.registerSymbol=lF.defaultInstance.registerSymbol.bind(lF.defaultInstance),lF.registerCustom=lF.defaultInstance.registerCustom.bind(lF.defaultInstance),lF.allowErrorProps=lF.defaultInstance.allowErrorProps.bind(lF.defaultInstance),lF.serialize,lF.deserialize,lF.stringify,lF.parse,lF.registerClass,lF.registerCustom,lF.registerSymbol,lF.allowErrorProps,(0,x.createContext)(null),FO(`camstack:custom-field-renderers`,{}),FO(`camstack:device-context`,null),FO(`camstack:widget-registry`,null);function uF({title:e,icon:t,headerRight:n,collapsible:r=!1,defaultOpen:a=!0,bodyClassName:o=`p-3`,children:s}){let[c,l]=(0,x.useState)(a),u=!r||c,d=(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`span`,{className:`flex items-center gap-2 text-xs font-semibold uppercase tracking-wider text-foreground`,children:[t,e]}),r?c?(0,S.jsx)(WM,{className:`h-3.5 w-3.5 text-foreground-subtle`}):(0,S.jsx)(GM,{className:`h-3.5 w-3.5 text-foreground-subtle`}):n]}),f=`px-4 py-2 flex items-center justify-between ${u?`border-b border-border`:``}`;return(0,S.jsxs)(`div`,{className:`rounded-lg border border-border bg-surface overflow-hidden`,children:[r?(0,S.jsx)(`button`,{type:`button`,onClick:()=>l(e=>!e),className:`w-full text-left ${f}`,children:d}):(0,S.jsx)(`div`,{className:f,children:d}),u?(0,S.jsx)(`div`,{className:o,children:s}):null]})}FO(`camstack:vod-playback`,{request:null,play:()=>{},clear:()=>{}}),(0,x.lazy)(()=>tD(()=>import(`./MotionZonesSettings-NcxxQN8r-CQzEnQoq.js`).then(e=>({default:e.MotionZonesSettings})),__vite__mapDeps([0,1]),import.meta.url)),(0,x.lazy)(()=>tD(()=>import(`./PrivacyMaskSettings-APgPLF7p-Cl0eOy_U.js`).then(e=>({default:e.PrivacyMaskSettings})),__vite__mapDeps([2,1]),import.meta.url));var dF=Object.defineProperty,fF=Object.getOwnPropertySymbols,pF=Object.prototype.hasOwnProperty,mF=Object.prototype.propertyIsEnumerable,hF=(e,t,n)=>t in e?dF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gF=(e,t)=>{for(var n in t||={})pF.call(t,n)&&hF(e,n,t[n]);if(fF)for(var n of fF(t))mF.call(t,n)&&hF(e,n,t[n]);return e},_F=(e,t)=>{var n={};for(var r in e)pF.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&fF)for(var r of fF(e))t.indexOf(r)<0&&mF.call(e,r)&&(n[r]=e[r]);return n},vF;(e=>{let t=class t{constructor(e,n,r,o){if(this.version=e,this.errorCorrectionLevel=n,this.modules=[],this.isFunction=[],e<t.MIN_VERSION||e>t.MAX_VERSION)throw RangeError(`Version value out of range`);if(o<-1||o>7)throw RangeError(`Mask value out of range`);this.size=e*4+17;let s=[];for(let e=0;e<this.size;e++)s.push(!1);for(let e=0;e<this.size;e++)this.modules.push(s.slice()),this.isFunction.push(s.slice());this.drawFunctionPatterns();let c=this.addEccAndInterleave(r);if(this.drawCodewords(c),o==-1){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);let n=this.getPenaltyScore();n<e&&(o=t,e=n),this.applyMask(t)}}a(0<=o&&o<=7),this.mask=o,this.applyMask(o),this.drawFormatBits(o),this.isFunction=[]}static encodeText(n,r){let a=e.QrSegment.makeSegments(n);return t.encodeSegments(a,r)}static encodeBinary(n,r){let a=e.QrSegment.makeBytes(n);return t.encodeSegments([a],r)}static encodeSegments(e,r,o=1,c=40,l=-1,u=!0){if(!(t.MIN_VERSION<=o&&o<=c&&c<=t.MAX_VERSION)||l<-1||l>7)throw RangeError(`Invalid value`);let d,f;for(d=o;;d++){let n=t.getNumDataCodewords(d,r)*8,a=s.getTotalBits(e,d);if(a<=n){f=a;break}if(d>=c)throw RangeError(`Data too long`)}for(let e of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])u&&f<=t.getNumDataCodewords(d,e)*8&&(r=e);let p=[];for(let t of e){n(t.mode.modeBits,4,p),n(t.numChars,t.mode.numCharCountBits(d),p);for(let e of t.getData())p.push(e)}a(p.length==f);let m=t.getNumDataCodewords(d,r)*8;a(p.length<=m),n(0,Math.min(4,m-p.length),p),n(0,(8-p.length%8)%8,p),a(p.length%8==0);for(let e=236;p.length<m;e^=253)n(e,8,p);let h=[];for(;h.length*8<p.length;)h.push(0);return p.forEach((e,t)=>h[t>>>3]|=e<<7-(t&7)),new t(d,r,h,l)}getModule(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]}getModules(){return this.modules}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let e=this.getAlignmentPatternPositions(),t=e.length;for(let n=0;n<t;n++)for(let r=0;r<t;r++)n==0&&r==0||n==0&&r==t-1||n==t-1&&r==0||this.drawAlignmentPattern(e[n],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){let t=this.errorCorrectionLevel.formatBits<<3|e,n=t;for(let e=0;e<10;e++)n=n<<1^(n>>>9)*1335;let o=(t<<10|n)^21522;a(o>>>15==0);for(let e=0;e<=5;e++)this.setFunctionModule(8,e,r(o,e));this.setFunctionModule(8,7,r(o,6)),this.setFunctionModule(8,8,r(o,7)),this.setFunctionModule(7,8,r(o,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,r(o,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,r(o,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,r(o,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^(e>>>11)*7973;let t=this.version<<12|e;a(t>>>18==0);for(let e=0;e<18;e++){let n=r(t,e),a=this.size-11+e%3,o=Math.floor(e/3);this.setFunctionModule(a,o,n),this.setFunctionModule(o,a,n)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let r=-4;r<=4;r++){let a=Math.max(Math.abs(r),Math.abs(n)),o=e+r,s=t+n;0<=o&&o<this.size&&0<=s&&s<this.size&&this.setFunctionModule(o,s,a!=2&&a!=4)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,t+n,Math.max(Math.abs(r),Math.abs(n))!=1)}setFunctionModule(e,t,n){this.modules[t][e]=n,this.isFunction[t][e]=!0}addEccAndInterleave(e){let n=this.version,r=this.errorCorrectionLevel;if(e.length!=t.getNumDataCodewords(n,r))throw RangeError(`Invalid argument`);let o=t.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][n],s=t.ECC_CODEWORDS_PER_BLOCK[r.ordinal][n],c=Math.floor(t.getNumRawDataModules(n)/8),l=o-c%o,u=Math.floor(c/o),d=[],f=t.reedSolomonComputeDivisor(s);for(let n=0,r=0;n<o;n++){let a=e.slice(r,r+u-s+(n<l?0:1));r+=a.length;let o=t.reedSolomonComputeRemainder(a,f);n<l&&a.push(0),d.push(a.concat(o))}let p=[];for(let e=0;e<d[0].length;e++)d.forEach((t,n)=>{(e!=u-s||n>=l)&&p.push(t[e])});return a(p.length==c),p}drawCodewords(e){if(e.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw RangeError(`Invalid argument`);let n=0;for(let t=this.size-1;t>=1;t-=2){t==6&&(t=5);for(let a=0;a<this.size;a++)for(let o=0;o<2;o++){let s=t-o,c=t+1&2?a:this.size-1-a;!this.isFunction[c][s]&&n<e.length*8&&(this.modules[c][s]=r(e[n>>>3],7-(n&7)),n++)}}a(n==e.length*8)}applyMask(e){if(e<0||e>7)throw RangeError(`Mask value out of range`);for(let t=0;t<this.size;t++)for(let n=0;n<this.size;n++){let r;switch(e){case 0:r=(n+t)%2==0;break;case 1:r=t%2==0;break;case 2:r=n%3==0;break;case 3:r=(n+t)%3==0;break;case 4:r=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:r=n*t%2+n*t%3==0;break;case 6:r=(n*t%2+n*t%3)%2==0;break;case 7:r=((n+t)%2+n*t%3)%2==0;break;default:throw Error(`Unreachable`)}!this.isFunction[t][n]&&r&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let n=0;n<this.size;n++){let r=!1,a=0,o=[0,0,0,0,0,0,0];for(let s=0;s<this.size;s++)this.modules[n][s]==r?(a++,a==5?e+=t.PENALTY_N1:a>5&&e++):(this.finderPenaltyAddHistory(a,o),r||(e+=this.finderPenaltyCountPatterns(o)*t.PENALTY_N3),r=this.modules[n][s],a=1);e+=this.finderPenaltyTerminateAndCount(r,a,o)*t.PENALTY_N3}for(let n=0;n<this.size;n++){let r=!1,a=0,o=[0,0,0,0,0,0,0];for(let s=0;s<this.size;s++)this.modules[s][n]==r?(a++,a==5?e+=t.PENALTY_N1:a>5&&e++):(this.finderPenaltyAddHistory(a,o),r||(e+=this.finderPenaltyCountPatterns(o)*t.PENALTY_N3),r=this.modules[s][n],a=1);e+=this.finderPenaltyTerminateAndCount(r,a,o)*t.PENALTY_N3}for(let n=0;n<this.size-1;n++)for(let r=0;r<this.size-1;r++){let a=this.modules[n][r];a==this.modules[n][r+1]&&a==this.modules[n+1][r]&&a==this.modules[n+1][r+1]&&(e+=t.PENALTY_N2)}let n=0;for(let e of this.modules)n=e.reduce((e,t)=>e+ +!!t,n);let r=this.size*this.size,o=Math.ceil(Math.abs(n*20-r*10)/r)-1;return a(0<=o&&o<=9),e+=o*t.PENALTY_N4,a(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(this.version==1)return[];{let e=Math.floor(this.version/7)+2,t=this.version==32?26:Math.ceil((this.version*4+4)/(e*2-2))*2,n=[6];for(let r=this.size-7;n.length<e;r-=t)n.splice(1,0,r);return n}}static getNumRawDataModules(e){if(e<t.MIN_VERSION||e>t.MAX_VERSION)throw RangeError(`Version number out of range`);let n=(16*e+128)*e+64;if(e>=2){let t=Math.floor(e/7)+2;n-=(25*t-10)*t-55,e>=7&&(n-=36)}return a(208<=n&&n<=29648),n}static getNumDataCodewords(e,n){return Math.floor(t.getNumRawDataModules(e)/8)-t.ECC_CODEWORDS_PER_BLOCK[n.ordinal][e]*t.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw RangeError(`Degree out of range`);let n=[];for(let t=0;t<e-1;t++)n.push(0);n.push(1);let r=1;for(let a=0;a<e;a++){for(let e=0;e<n.length;e++)n[e]=t.reedSolomonMultiply(n[e],r),e+1<n.length&&(n[e]^=n[e+1]);r=t.reedSolomonMultiply(r,2)}return n}static reedSolomonComputeRemainder(e,n){let r=n.map(e=>0);for(let a of e){let e=a^r.shift();r.push(0),n.forEach((n,a)=>r[a]^=t.reedSolomonMultiply(n,e))}return r}static reedSolomonMultiply(e,t){if(e>>>8||t>>>8)throw RangeError(`Byte out of range`);let n=0;for(let r=7;r>=0;r--)n=n<<1^(n>>>7)*285,n^=(t>>>r&1)*e;return a(n>>>8==0),n}finderPenaltyCountPatterns(e){let t=e[1];a(t<=this.size*3);let n=t>0&&e[2]==t&&e[3]==t*3&&e[4]==t&&e[5]==t;return(n&&e[0]>=t*4&&e[6]>=t?1:0)+(n&&e[6]>=t*4&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){t[0]==0&&(e+=this.size),t.pop(),t.unshift(e)}};t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;function n(e,t,n){if(t<0||t>31||e>>>t)throw RangeError(`Value out of range`);for(let r=t-1;r>=0;r--)n.push(e>>>r&1)}function r(e,t){return(e>>>t&1)!=0}function a(e){if(!e)throw Error(`Assertion error`)}let o=class e{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw RangeError(`Invalid argument`);this.bitData=n.slice()}static makeBytes(t){let r=[];for(let e of t)n(e,8,r);return new e(e.Mode.BYTE,t.length,r)}static makeNumeric(t){if(!e.isNumeric(t))throw RangeError(`String contains non-numeric characters`);let r=[];for(let e=0;e<t.length;){let a=Math.min(t.length-e,3);n(parseInt(t.substring(e,e+a),10),a*3+1,r),e+=a}return new e(e.Mode.NUMERIC,t.length,r)}static makeAlphanumeric(t){if(!e.isAlphanumeric(t))throw RangeError(`String contains unencodable characters in alphanumeric mode`);let r=[],a;for(a=0;a+2<=t.length;a+=2){let o=e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(a))*45;o+=e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(a+1)),n(o,11,r)}return a<t.length&&n(e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(a)),6,r),new e(e.Mode.ALPHANUMERIC,t.length,r)}static makeSegments(t){return t==``?[]:e.isNumeric(t)?[e.makeNumeric(t)]:e.isAlphanumeric(t)?[e.makeAlphanumeric(t)]:[e.makeBytes(e.toUtf8ByteArray(t))]}static makeEci(t){let r=[];if(t<0)throw RangeError(`ECI assignment value out of range`);if(t<128)n(t,8,r);else if(t<16384)n(2,2,r),n(t,14,r);else if(t<1e6)n(6,3,r),n(t,21,r);else throw RangeError(`ECI assignment value out of range`);return new e(e.Mode.ECI,0,r)}static isNumeric(t){return e.NUMERIC_REGEX.test(t)}static isAlphanumeric(t){return e.ALPHANUMERIC_REGEX.test(t)}getData(){return this.bitData.slice()}static getTotalBits(e,t){let n=0;for(let r of e){let e=r.mode.numCharCountBits(t);if(r.numChars>=1<<e)return 1/0;n+=4+e+r.bitData.length}return n}static toUtf8ByteArray(e){e=encodeURI(e);let t=[];for(let n=0;n<e.length;n++)e.charAt(n)==`%`?(t.push(parseInt(e.substring(n+1,n+3),16)),n+=2):t.push(e.charCodeAt(n));return t}};o.NUMERIC_REGEX=/^[0-9]*$/,o.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,o.ALPHANUMERIC_CHARSET=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`;let s=o;e.QrSegment=o})(vF||={}),(e=>{(e=>{let t=class{constructor(e,t){this.ordinal=e,this.formatBits=t}};t.LOW=new t(0,1),t.MEDIUM=new t(1,0),t.QUARTILE=new t(2,3),t.HIGH=new t(3,2),e.Ecc=t})(e.QrCode||={})})(vF||={}),(e=>{(e=>{let t=class{constructor(e,t){this.modeBits=e,this.numBitsCharCount=t}numCharCountBits(e){return this.numBitsCharCount[Math.floor((e+7)/17)]}};t.NUMERIC=new t(1,[10,12,14]),t.ALPHANUMERIC=new t(2,[9,11,13]),t.BYTE=new t(4,[8,16,16]),t.KANJI=new t(8,[8,10,12]),t.ECI=new t(7,[0,0,0]),e.Mode=t})(e.QrSegment||={})})(vF||={});var yF=vF,bF={L:yF.QrCode.Ecc.LOW,M:yF.QrCode.Ecc.MEDIUM,Q:yF.QrCode.Ecc.QUARTILE,H:yF.QrCode.Ecc.HIGH},xF=128,SF=`L`,CF=`#FFFFFF`,wF=`#000000`,TF=!1,EF=1,DF=4,OF=0,kF=.1;function AF(e,t=0){let n=[];return e.forEach(function(e,r){let a=null;e.forEach(function(o,s){if(!o&&a!==null){n.push(`M${a+t} ${r+t}h${s-a}v1H${a+t}z`),a=null;return}if(s===e.length-1){if(!o)return;a===null?n.push(`M${s+t},${r+t} h1v1H${s+t}z`):n.push(`M${a+t},${r+t} h${s+1-a}v1H${a+t}z`);return}o&&a===null&&(a=s)})}),n.join(``)}function jF(e,t){return e.slice().map((e,n)=>n<t.y||n>=t.y+t.h?e:e.map((e,n)=>n<t.x||n>=t.x+t.w?e:!1))}function MF(e,t,n,r){if(r==null)return null;let a=e.length+n*2,o=Math.floor(t*kF),s=a/t,c=(r.width||o)*s,l=(r.height||o)*s,u=r.x==null?e.length/2-c/2:r.x*s,d=r.y==null?e.length/2-l/2:r.y*s,f=r.opacity==null?1:r.opacity,p=null;if(r.excavate){let e=Math.floor(u),t=Math.floor(d);p={x:e,y:t,w:Math.ceil(c+u-e),h:Math.ceil(l+d-t)}}let m=r.crossOrigin;return{x:u,y:d,h:l,w:c,excavation:p,opacity:f,crossOrigin:m}}function NF(e,t){return t==null?e?DF:OF:Math.max(Math.floor(t),0)}function PF({value:e,level:t,minVersion:n,includeMargin:r,marginSize:a,imageSettings:o,size:s,boostLevel:c}){let l=x.useMemo(()=>{let r=(Array.isArray(e)?e:[e]).reduce((e,t)=>(e.push(...yF.QrSegment.makeSegments(t)),e),[]);return yF.QrCode.encodeSegments(r,bF[t],n,void 0,void 0,c)},[e,t,n,c]),{cells:u,margin:d,numCells:f,calculatedImageSettings:p}=x.useMemo(()=>{let e=l.getModules(),t=NF(r,a);return{cells:e,margin:t,numCells:e.length+t*2,calculatedImageSettings:MF(e,s,t,o)}},[l,s,o,r,a]);return{qrcode:l,margin:d,cells:u,numCells:f,calculatedImageSettings:p}}var FF=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),IF=x.forwardRef(function(e,t){let n=e,{value:r,size:a=xF,level:o=SF,bgColor:s=CF,fgColor:c=wF,includeMargin:l=TF,minVersion:u=EF,boostLevel:d,marginSize:f,imageSettings:p}=n,m=_F(n,[`value`,`size`,`level`,`bgColor`,`fgColor`,`includeMargin`,`minVersion`,`boostLevel`,`marginSize`,`imageSettings`]),{style:h}=m,g=_F(m,[`style`]),_=p?.src,v=x.useRef(null),y=x.useRef(null),b=x.useCallback(e=>{v.current=e,typeof t==`function`?t(e):t&&(t.current=e)},[t]),[ee,S]=x.useState(!1),{margin:C,cells:w,numCells:te,calculatedImageSettings:T}=PF({value:r,level:o,minVersion:u,boostLevel:d,includeMargin:l,marginSize:f,imageSettings:p,size:a});x.useEffect(()=>{if(v.current!=null){let e=v.current,t=e.getContext(`2d`);if(!t)return;let n=w,r=y.current,o=T!=null&&r!==null&&r.complete&&r.naturalHeight!==0&&r.naturalWidth!==0;o&&T.excavation!=null&&(n=jF(w,T.excavation));let l=window.devicePixelRatio||1;e.height=e.width=a*l;let u=a/te*l;t.scale(u,u),t.fillStyle=s,t.fillRect(0,0,te,te),t.fillStyle=c,FF?t.fill(new Path2D(AF(n,C))):w.forEach(function(e,n){e.forEach(function(e,r){e&&t.fillRect(r+C,n+C,1,1)})}),T&&(t.globalAlpha=T.opacity),o&&t.drawImage(r,T.x+C,T.y+C,T.w,T.h)}}),x.useEffect(()=>{S(!1)},[_]);let E=gF({height:a,width:a},h),ne=null;return _!=null&&(ne=x.createElement(`img`,{src:_,key:_,style:{display:`none`},onLoad:()=>{S(!0)},ref:y,crossOrigin:T?.crossOrigin})),x.createElement(x.Fragment,null,x.createElement(`canvas`,gF({style:E,height:a,width:a,ref:b,role:`img`},g)),ne)});IF.displayName=`QRCodeCanvas`;var LF=x.forwardRef(function(e,t){let n=e,{value:r,size:a=xF,level:o=SF,bgColor:s=CF,fgColor:c=wF,includeMargin:l=TF,minVersion:u=EF,boostLevel:d,title:f,marginSize:p,imageSettings:m}=n,h=_F(n,[`value`,`size`,`level`,`bgColor`,`fgColor`,`includeMargin`,`minVersion`,`boostLevel`,`title`,`marginSize`,`imageSettings`]),{margin:g,cells:_,numCells:v,calculatedImageSettings:y}=PF({value:r,level:o,minVersion:u,boostLevel:d,includeMargin:l,marginSize:p,imageSettings:m,size:a}),b=_,ee=null;m!=null&&y!=null&&(y.excavation!=null&&(b=jF(_,y.excavation)),ee=x.createElement(`image`,{href:m.src,height:y.h,width:y.w,x:y.x+g,y:y.y+g,preserveAspectRatio:`none`,opacity:y.opacity,crossOrigin:y.crossOrigin}));let S=AF(b,g);return x.createElement(`svg`,gF({height:a,width:a,viewBox:`0 0 ${v} ${v}`,ref:t,role:`img`},h),!!f&&x.createElement(`title`,null,f),x.createElement(`path`,{fill:s,d:`M0,0 h${v}v${v}H0z`,shapeRendering:`crispEdges`}),x.createElement(`path`,{fill:c,d:S,shapeRendering:`crispEdges`}),ee)});LF.displayName=`QRCodeSVG`;function RF(){return typeof window>`u`?!1:window.matchMedia(`(hover: none) and (pointer: coarse)`).matches||typeof navigator<`u`&&navigator.maxTouchPoints>0||`ontouchstart`in window}function zF(e,t,n){let r=0;for(let a=0;a<8;a++)for(let o=0;o<8;o++){let s=Math.min(t-1,Math.floor((o+.5)/8*t)),c=Math.min(n-1,Math.floor((a+.5)/8*n)),{data:l}=e.getImageData(s,c,1,1);.2126*(l[0]??0)+.7152*(l[1]??0)+.0722*(l[2]??0)>12&&r++}return r<=1}function BF(e){let t={};if(typeof window<`u`){if(e){let n=e.getBoundingClientRect();n.width>0&&n.height>0&&(t.viewportWidth=Math.round(n.width),t.viewportHeight=Math.round(n.height))}t.viewportWidth===void 0&&(t.viewportWidth=window.innerWidth,t.viewportHeight=window.innerHeight),t.devicePixelRatio=window.devicePixelRatio||1;let n=navigator.connection;n?.downlink&&n.downlink>0&&(t.downlinkMbps=n.downlink)}return t}var VF=1500,HF=15e3,UF=40;function WF({serverUrl:e,streamKey:t,label:n,autoPlay:r=!0,muted:a=!0,showControls:o=!0,showStats:s=!1,onPlaybackStats:c,className:l=``,onStateChange:u,onError:d,overlay:f,createSession:p,sendAnswer:m,handleOffer:h,getIceServers:g,addIceCandidate:_,getIceCandidates:v,closeSession:y,getSessionState:b,reoffer:ee,posterUrl:C,hintsOverride:w,reconnectSignal:te,onControlChannel:T}){let E=(0,x.useRef)(null),ne=(0,x.useRef)(null),re=(0,x.useRef)(null),ie=(0,x.useRef)(new Set),ae=(0,x.useRef)(null),oe=(0,x.useRef)(null),se=(0,x.useRef)(0),D=(0,x.useRef)(!0),ce=(0,x.useRef)(T);ce.current=T;let O=(0,x.useRef)(null),k=(0,x.useRef)(null),le=(0,x.useRef)(0),ue=(0,x.useRef)(!1),de=(0,x.useRef)(async()=>{}),[A,fe]=(0,x.useState)(`idle`),[pe,me]=(0,x.useState)(``),[he,ge]=(0,x.useState)(a),[_e,ve]=(0,x.useState)(!1),[ye,be]=(0,x.useState)(!1),xe=RF(),[Se,Ce]=(0,x.useState)(!0),we=(0,x.useRef)(null),Te=(0,x.useRef)(!1);(m||p)&&(Te.current=!0);let Ee=Te.current,De=(0,x.useRef)(!1);h&&(De.current=!0);let Oe=De.current,[ke,Ae]=(0,x.useState)(!1),je=(0,x.useRef)(null),[Me,Ne]=(0,x.useState)(null),[Pe,Fe]=(0,x.useState)(!1),Ie=(0,x.useCallback)(()=>{let e=E.current;if(!(!e||e.readyState<2||!e.videoWidth||!e.videoHeight))try{let t=document.createElement(`canvas`);t.width=e.videoWidth,t.height=e.videoHeight;let n=t.getContext(`2d`);if(!n||(n.drawImage(e,0,0),zF(n,t.width,t.height)))return;je.current=t.toDataURL(`image/jpeg`,.6)}catch{}},[]),Le=(0,x.useCallback)(e=>{fe(e),e===`playing`&&Ae(!0),u?.(e)},[u]),Re=(0,x.useCallback)(()=>{if(ae.current?.abort(),ae.current=null,oe.current&&=(clearTimeout(oe.current),null),k.current&&=(clearTimeout(k.current),null),O.current=null,ue.current=!1,le.current=0,re.current&&=(re.current.close(),null),y&&ie.current.size>0){for(let e of ie.current)y(e).catch(()=>{});ie.current.clear()}},[y]),ze=(0,x.useCallback)(()=>{ae.current?.abort(),ae.current=null,oe.current&&=(clearTimeout(oe.current),null),k.current&&=(clearTimeout(k.current),null),O.current=null,ue.current=!1,le.current=0},[]),Be=1e3,Ve=(0,x.useCallback)(e=>{if(!b||!ee)return;k.current&&=(clearTimeout(k.current),null);let t=async()=>{if(D.current&&O.current===e){if(!ue.current)try{let{pendingRenegotiation:t}=await b(e);if(D.current&&O.current===e&&t&&t.epoch>le.current&&!ue.current){le.current=t.epoch,await de.current(e,t.target);return}}catch{}!D.current||O.current!==e||(k.current=setTimeout(()=>{t()},Be))}};k.current=setTimeout(()=>{t()},Be)},[b,ee]),He=(0,x.useCallback)(async(e=!1)=>{if(!D.current||!p||!m)return;let t=e?re.current:null,n=e?new Set(ie.current):null;e?ze():Re(),Le(`connecting`);let r=new AbortController;ae.current=r;try{let{sessionId:a,sdpOffer:o,iceServers:s}=await p({...BF(ne.current),...w});if(ie.current.add(a),!D.current||r.signal.aborted){y?.(a).catch(()=>{}),ie.current.delete(a);return}let c=new RTCPeerConnection({iceServers:[...s??[],{urls:`stun:stun.l.google.com:19302`}]});e||(re.current=c);let l=new MediaStream,u=!1,d=()=>{if(!(u||!D.current)){if(u=!0,re.current=c,E.current&&(E.current.srcObject=l,E.current.play().catch(()=>{})),t&&t!==c)try{t.close()}catch{}if(n)for(let e of n)ie.current.delete(e),y?.(e).catch(()=>{})}};c.ontrack=t=>{if(console.debug(`[WebRTC] ontrack`,t.track.kind,t.track.readyState),l.addTrack(t.track),e){d();return}E.current&&(E.current.srcObject=l,E.current.play().catch(()=>{}))},c.oniceconnectionstatechange=()=>{if(!D.current)return;let t=c.iceConnectionState;if(console.debug(`[WebRTC] ICE state:`,t),t===`connected`||t===`completed`)se.current=0,e&&d(),Le(`playing`),E.current?.paused&&(console.debug(`[WebRTC] video was paused at ICE connected — calling play()`),E.current.play().catch(()=>{}));else if(t===`failed`||t===`disconnected`||t===`closed`){if(e&&!u)try{c.close()}catch{}Le(`disconnected`),qe()}},c.onicecandidateerror=e=>{console.debug(`[WebRTC] ICE candidate error:`,e)},console.debug(`[WebRTC] Setting remote description (server offer)...`),await c.setRemoteDescription({type:`offer`,sdp:o});let f=await c.createAnswer();if(await c.setLocalDescription(f),console.debug(`[WebRTC] Local description set, waiting for ICE gathering...`),await KF(c),!D.current)return;let h=(c.localDescription?.sdp??``).split(`
|
|
77
|
+
`).filter(e=>e.startsWith(`a=candidate:`)).length;console.debug(`[WebRTC] Sending answer to server`,{localCandidates:h,sessionId:a.slice(0,8)}),await m(a,c.localDescription?.sdp??``),console.debug(`[WebRTC] Answer sent successfully`);let g=c,_=()=>{let e=g.connectionState;if(e===`closed`||e===`failed`)return;let t=E.current;t&&t.readyState===0&&console.log(`[WebRTC] no video data yet (ice=${g.iceConnectionState})`)};setTimeout(_,3e3),setTimeout(_,8e3)}catch(e){if(!D.current)return;let t=e instanceof Error?e.message:String(e);me(t),Le(`error`),d?.(t),qe()}},[e,t,p,m,Re,ze,y,Le,d,w]),Ue=(0,x.useCallback)(async()=>{if(D.current){Re(),Le(`connecting`);try{let n=new RTCPeerConnection({iceServers:[{urls:`stun:stun.l.google.com:19302`}]});re.current=n,n.addTransceiver(`video`,{direction:`recvonly`}),n.addTransceiver(`audio`,{direction:`recvonly`});let r=new MediaStream;n.ontrack=e=>{r.addTrack(e.track),E.current&&(E.current.srcObject=r,E.current.play().catch(()=>{}))},n.oniceconnectionstatechange=()=>{if(!D.current)return;let e=n.iceConnectionState;e===`connected`||e===`completed`?(se.current=0,Le(`playing`),E.current?.paused&&E.current.play().catch(()=>{})):(e===`failed`||e===`disconnected`||e===`closed`)&&(Le(`disconnected`),qe())};let a=await n.createOffer();if(await n.setLocalDescription(a),await KF(n),!D.current)return;let o=`${e}/api/webrtc?src=${encodeURIComponent(t)}`,s=await fetch(o,{method:`POST`,headers:{"Content-Type":`application/sdp`},body:n.localDescription?.sdp??``});if(!s.ok)throw Error(`WHEP ${s.status}: ${s.statusText}`);let c=await s.text();await n.setRemoteDescription({type:`answer`,sdp:c})}catch(e){if(!D.current)return;let t=e instanceof Error?e.message:String(e);me(t),Le(`error`),d?.(t),qe()}}},[e,t,Re,Le,d]),We=(0,x.useCallback)(async(e=!1)=>{if(!D.current||!h)return;let t=e?re.current:null,n=e?new Set(ie.current):null;e?ze():Re(),Le(`connecting`);let r=new AbortController;ae.current=r;try{let a=await g?.();if(!D.current||r.signal.aborted)return;let o=new RTCPeerConnection({iceServers:[...a??[],{urls:`stun:stun.l.google.com:19302`}]});e||(re.current=o);let s=new MediaStream,c=!1,l=()=>{if(!(c||!D.current)){if(c=!0,re.current=o,E.current&&(E.current.srcObject=s,E.current.play().catch(()=>{})),t&&t!==o)try{t.close()}catch{}if(n)for(let e of n)ie.current.delete(e),y?.(e).catch(()=>{})}};o.ontrack=t=>{if(console.debug(`[WebRTC] ontrack (client-offer)`,t.track.kind,t.track.readyState),s.addTrack(t.track),e){l();return}E.current&&(E.current.srcObject=s,E.current.play().catch(()=>{}))},o.oniceconnectionstatechange=()=>{if(!D.current)return;let t=o.iceConnectionState;if(console.debug(`[WebRTC] ICE state (client-offer):`,t),t===`connected`||t===`completed`)se.current=0,e&&l(),Le(`playing`),E.current?.paused&&E.current.play().catch(()=>{});else if(t===`failed`||t===`disconnected`||t===`closed`){if(e&&!c)try{o.close()}catch{}Le(`disconnected`),qe()}};let u=null,d=[];if(o.onicecandidate=e=>{if(!e.candidate)return;let t=e.candidate.toJSON();u&&_?_(u,t).catch(()=>{}):d.push(t)},o.addTransceiver(`video`,{direction:`recvonly`}),o.addTransceiver(`audio`,{direction:`recvonly`}),ce.current){let e=o.createDataChannel(`camstack-control`);ce.current(e)}let f=await o.createOffer();if(await o.setLocalDescription(f),!D.current||r.signal.aborted)return;let{sessionId:p,sdpAnswer:m}=await h(o.localDescription?.sdp??f.sdp??``);if(u=p,ie.current.add(p),O.current=p,!D.current||r.signal.aborted){y?.(p).catch(()=>{}),ie.current.delete(p);return}if(_)for(let e of d)_(p,e).catch(()=>{});if(d.length=0,await o.setRemoteDescription({type:`answer`,sdp:m}),console.debug(`[WebRTC] Client-offer answer set (trickle)`,{sessionId:p.slice(0,8)}),v){let e=new Set,t=Date.now(),n=async()=>{if(!(!D.current||r.signal.aborted)&&!(o.connectionState===`closed`||o.signalingState===`closed`)){try{let{candidates:n,done:r}=await v(p);for(let t of n){let n=t.candidate??``;n&&!e.has(n)&&(e.add(n),o.addIceCandidate(new RTCIceCandidate(t)).catch(()=>{}))}let a=o.iceConnectionState;if(r||Date.now()-t>1e4||a===`connected`||a===`completed`)return}catch{}setTimeout(()=>{n()},200)}};n()}Ve(p)}catch(e){if(!D.current)return;let t=e instanceof Error?e.message:String(e);me(t),Le(`error`),d?.(t),qe()}},[h,g,_,v,y,Re,ze,Le,d,Ve]);de.current=(0,x.useCallback)(async(e,t)=>{let n=ee;if(!D.current||!n)return;let r=re.current;ue.current=!0;try{let a=await g?.();if(!D.current)return;let o=new RTCPeerConnection({iceServers:[...a??[],{urls:`stun:stun.l.google.com:19302`}]}),s=new MediaStream,c=!1,l=()=>{c||!D.current||(c=!0,re.current=o,E.current&&(E.current.srcObject=s,E.current.play().catch(()=>{})),r&&r!==o&&r.close())};o.ontrack=e=>{console.debug(`[WebRTC] ontrack (reoffer)`,e.track.kind,e.track.readyState),s.addTrack(e.track),l()},o.oniceconnectionstatechange=()=>{if(!D.current)return;let e=o.iceConnectionState;console.debug(`[WebRTC] ICE state (reoffer):`,e),e===`connected`||e===`completed`?(se.current=0,l(),Le(`playing`),E.current?.paused&&E.current.play().catch(()=>{})):(e===`failed`||e===`closed`)&&(!c&&e===`failed`&&o.close(),Le(`disconnected`),qe())};let u=null,d=[];if(o.onicecandidate=e=>{if(!e.candidate)return;let t=e.candidate.toJSON();u&&_?_(u,t).catch(()=>{}):d.push(t)},o.addTransceiver(`video`,{direction:`recvonly`}),o.addTransceiver(`audio`,{direction:`recvonly`}),ce.current){let e=o.createDataChannel(`camstack-control`);ce.current(e)}let f=await o.createOffer();if(await o.setLocalDescription(f),!D.current){o.close();return}let{sessionId:p,sdpAnswer:m}=await n(e,o.localDescription?.sdp??f.sdp??``,t);if(!D.current){o.close();return}if(u=p,ie.current.add(p),O.current=p,_)for(let e of d)_(p,e).catch(()=>{});if(d.length=0,await o.setRemoteDescription({type:`answer`,sdp:m}),v){let e=new Set,t=Date.now(),n=async()=>{if(D.current&&!(o.connectionState===`closed`||o.signalingState===`closed`)){try{let{candidates:n,done:r}=await v(p);for(let t of n){let n=t.candidate??``;n&&!e.has(n)&&(e.add(n),o.addIceCandidate(new RTCIceCandidate(t)).catch(()=>{}))}let a=o.iceConnectionState;if(r||Date.now()-t>1e4||a===`connected`||a===`completed`)return}catch{}setTimeout(()=>{n()},200)}};n()}Ve(p)}catch(t){console.debug(`[WebRTC] reoffer failed; keeping last frame, re-arming poll`,t instanceof Error?t.message:String(t)),Ve(e)}finally{ue.current=!1}},[ee,g,_,v,Le,Ve]);let Ge=Oe?We:Ee?He:Ue,Ke=(0,x.useRef)(()=>{});Ke.current=Ge;let qe=(0,x.useCallback)(()=>{if(!D.current||se.current>=UF)return;let e=se.current;se.current+=1;let t=Math.min(HF,VF*2**e),n=Math.round(t*(.8+Math.random()*.4));oe.current=setTimeout(()=>{D.current&&Ke.current()},n)},[]);(0,x.useEffect)(()=>(D.current=!0,se.current=0,r&&Ge(),()=>{D.current=!1,Re()}),[e,t]);let Je=(0,x.useRef)(!1);(0,x.useEffect)(()=>{if(r){if(Oe){if(!h)return}else if(Ee){if(!p||!m)return}else return;Je.current||re.current||(Je.current=!0,Ge())}},[r,Oe,Ee,h,p,m,Ge]);let Ye=()=>{se.current=0,Ge()},Xe=()=>{if(se.current=0,re.current&&Oe){We(!0);return}if(re.current&&Ee){He(!0);return}Ge()},Ze=(0,x.useRef)(te);(0,x.useEffect)(()=>{Ze.current!==te&&(Ze.current=te,D.current&&Xe())},[te]);let Qe=()=>{E.current&&(E.current.muted=!E.current.muted,ge(E.current.muted))},$e=async()=>{if(ne.current)try{if(document.fullscreenElement){await document.exitFullscreen();return}if(ne.current.requestFullscreen){await ne.current.requestFullscreen();return}let e=E.current;e?.webkitEnterFullscreen&&e.webkitEnterFullscreen()}catch(e){console.warn(`Fullscreen toggle failed: ${e instanceof Error?e.message:e}`)}},et=async()=>{let e=E.current;if(e)try{if(typeof e.webkitSetPresentationMode==`function`){e.webkitSetPresentationMode(e.webkitPresentationMode===`picture-in-picture`?`inline`:`picture-in-picture`);return}document.pictureInPictureElement?await document.exitPictureInPicture():await e.requestPictureInPicture()}catch(e){console.warn(`PiP toggle failed: ${e instanceof Error?e.message:String(e)}`)}},tt=()=>{if(!E.current)return;let e=document.createElement(`canvas`);e.width=E.current.videoWidth||1280,e.height=E.current.videoHeight||720;let n=e.getContext(`2d`);if(!n)return;n.drawImage(E.current,0,0);let r=document.createElement(`a`);r.download=`${t.replace(/[/:]/g,`-`)}-${Date.now()}.jpg`,r.href=e.toDataURL(`image/jpeg`,.92),r.click()};(0,x.useEffect)(()=>{let e=()=>ve(!!document.fullscreenElement);document.addEventListener(`fullscreenchange`,e);let t=E.current;return t?.addEventListener(`webkitbeginfullscreen`,e),t?.addEventListener(`webkitendfullscreen`,e),()=>{document.removeEventListener(`fullscreenchange`,e),t?.removeEventListener(`webkitbeginfullscreen`,e),t?.removeEventListener(`webkitendfullscreen`,e)}},[]),(0,x.useEffect)(()=>{let e=E.current,t=typeof document<`u`&&document.pictureInPictureEnabled===!0,n=e!==null&&typeof e.webkitSetPresentationMode==`function`;be(t||n)},[]);let[nt,rt]=(0,x.useState)(``),it=(0,x.useRef)(null);(0,x.useEffect)(()=>{if(!s){rt(``),it.current=null;return}let e=async()=>{let e=re.current;if(e)try{let t=await e.getStats(),n=0,r=0,a=0,o=0,s=0,c=0;t.forEach(e=>{let t=e;t.type===`inbound-rtp`&&(t.kind??t.mediaType)===`video`?(n=t.bytesReceived??0,r=t.timestamp,a=t.framesPerSecond??0,o=t.frameWidth??0,s=t.frameHeight??0):t.type===`candidate-pair`&&t.nominated&&typeof t.currentRoundTripTime==`number`&&(c=t.currentRoundTripTime)});let l=0;it.current&&r>it.current.ts&&(l=Math.round((n-it.current.bytes)*8/(r-it.current.ts))),it.current={bytes:n,ts:r};let u=[];o&&s&&u.push(`${o}×${s}`),a&&u.push(`${Math.round(a)}fps`),l>0&&u.push(`${l} kbps`),c&&u.push(`${Math.round(c*1e3)}ms`),rt(u.join(` · `))}catch{}};e();let t=setInterval(()=>{e()},1e3);return()=>clearInterval(t)},[s]);let at=(0,x.useRef)(null);(0,x.useEffect)(()=>{if(!c){at.current=null;return}let e=async()=>{let e=re.current,t=E.current;if(e)try{let n=await e.getStats(),r=0,a=0,o=0,s=0,l=0,u=0,d=0,f=0;n.forEach(e=>{let t=e;t.type===`inbound-rtp`&&(t.kind??t.mediaType)===`video`&&(r=t.framesReceived??0,a=t.framesDecoded??0,o=t.framesDropped??0,s=t.framesPerSecond??0,l=t.freezeCount??0,u=t.totalFreezesDuration??0,d=t.jitterBufferDelay??0,f=t.jitterBufferEmittedCount??0)});let p=t?.currentTime??0,m=Date.now(),h=at.current,g=f>0?Math.round(d/f*1e3):0;h&&c({dRecv:r-h.recv,dDec:a-h.dec,dDrop:o-h.drop,fps:Math.round(s),dFreeze:l-h.freeze,freezeTotalMs:Math.round(u*1e3),avgJitterMs:g,dCtMs:Math.round((p-h.ct)*1e3),dtMs:m-h.ts,readyState:t?.readyState??-1}),at.current={recv:r,dec:a,drop:o,freeze:l,ct:p,ts:m}}catch{}};e();let t=setInterval(()=>{e()},1e3);return()=>clearInterval(t)},[c]),(0,x.useEffect)(()=>{ge(a);let e=E.current;e&&(e.muted=a,a||e.play().catch(()=>{}))},[a]);let ot=()=>{xe||(Ce(!0),we.current&&clearTimeout(we.current),we.current=setTimeout(()=>Ce(!1),3e3))},st=()=>{Ce(e=>!e),we.current&&clearTimeout(we.current)};(0,x.useEffect)(()=>{if(A===`playing`){Ie();let e=setInterval(Ie,2e3);return()=>clearInterval(e)}ke&&je.current&&Ne(je.current)},[A,ke,Ie]),(0,x.useEffect)(()=>{if(A!==`playing`){Fe(!1);return}let e=E.current;if(!e)return;let t=!1,n=()=>{t||Fe(!0)},r;typeof e.requestVideoFrameCallback==`function`&&(r=e.requestVideoFrameCallback(()=>n())),e.addEventListener(`loadeddata`,n,{once:!0});let a=setTimeout(n,12e3);return()=>{t=!0,clearTimeout(a),r!==void 0&&typeof e.cancelVideoFrameCallback==`function`&&e.cancelVideoFrameCallback(r),e.removeEventListener(`loadeddata`,n)}},[A]);let ct=ke&&Me?Me:C??null,lt=!Pe&&ct!==null;return(0,S.jsxs)(`div`,{ref:ne,className:`relative isolate bg-black overflow-hidden group ${l}`,onMouseMove:ot,onMouseEnter:ot,onTouchStart:st,children:[(0,S.jsx)(`video`,{ref:E,autoPlay:r,muted:he,playsInline:!0,className:`w-full h-full object-contain relative z-0`}),lt&&ct&&(0,S.jsx)(`img`,{src:ct,alt:``,className:`absolute inset-0 w-full h-full object-contain z-[5] transform-gpu pointer-events-none`}),n&&A===`playing`&&(0,S.jsx)(`div`,{className:`absolute top-2 left-2 z-10 transform-gpu px-2 py-0.5 rounded bg-black/60 text-[10px] text-white font-medium`,children:n}),s&&nt&&(0,S.jsx)(`div`,{className:`absolute top-2 right-2 z-10 transform-gpu px-2 py-0.5 rounded bg-black/60 text-[10px] text-white font-mono`,children:nt}),f,!ct&&A===`connecting`&&(0,S.jsxs)(`div`,{className:`absolute inset-0 z-10 transform-gpu flex flex-col items-center justify-center bg-black/70 gap-2`,children:[(0,S.jsx)(`svg`,{className:`h-6 w-6 text-white/60 animate-spin`,viewBox:`0 0 24 24`,fill:`none`,children:(0,S.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`,strokeDasharray:`32`,strokeDashoffset:`32`,className:`animate-[dash_1.5s_ease-in-out_infinite]`})}),(0,S.jsx)(`span`,{className:`text-xs text-white/60`,children:`Connecting…`})]}),!ct&&(A===`error`||A===`disconnected`)&&(0,S.jsxs)(`div`,{className:`absolute inset-0 z-10 transform-gpu flex flex-col items-center justify-center bg-black/70 gap-2`,children:[(0,S.jsx)(`svg`,{className:`h-6 w-6 text-red-400`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,children:(0,S.jsx)(`path`,{d:`M1 1l5.5 5.5M23 23l-5.5-5.5M8.11 15.89a8 8 0 0110.78-10.78M3.64 3.64A12 12 0 0020.36 20.36`,strokeLinecap:`round`})}),(0,S.jsx)(`span`,{className:`text-xs text-red-400 text-center px-4`,children:A===`error`?pe||`Connection failed`:`Disconnected`}),(0,S.jsx)(`button`,{onClick:Ye,className:`mt-1 inline-flex items-center gap-1.5 rounded px-3 py-1 text-xs bg-white/10 text-white hover:bg-white/20 transition-colors`,children:`Reconnect`})]}),ct&&(A===`connecting`||A===`disconnected`)&&(0,S.jsx)(`div`,{className:`absolute top-2 left-2 z-10 transform-gpu flex h-6 w-6 items-center justify-center rounded-full bg-black/55`,children:(0,S.jsx)(`svg`,{className:`h-3.5 w-3.5 text-white/90 animate-spin`,viewBox:`0 0 24 24`,fill:`none`,children:(0,S.jsx)(`circle`,{cx:`12`,cy:`12`,r:`10`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`,strokeDasharray:`32`,strokeDashoffset:`32`,className:`animate-[dash_1.5s_ease-in-out_infinite]`})})}),ct&&A===`error`&&(0,S.jsx)(`button`,{onClick:Ye,title:pe||`Reconnect`,className:`absolute top-2 left-2 z-10 transform-gpu flex h-6 w-6 items-center justify-center rounded-full bg-black/55 text-white/90 hover:bg-black/75 transition-colors`,children:(0,S.jsxs)(`svg`,{className:`h-3.5 w-3.5`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,S.jsx)(`path`,{d:`M23 4v6h-6M1 20v-6h6`}),(0,S.jsx)(`path`,{d:`M3.51 9a9 9 0 0114.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0020.49 15`})]})}),o&&A!==`idle`&&A!==`error`&&(0,S.jsxs)(`div`,{className:`absolute bottom-0 inset-x-0 z-20 transform-gpu flex items-center justify-between px-3 py-1.5 bg-gradient-to-t from-black/80 to-transparent transition-opacity duration-200 ${xe||Se?`opacity-100 pointer-events-auto`:`opacity-0 pointer-events-none`}`,children:[(0,S.jsx)(`div`,{className:`flex items-center gap-1`,children:(0,S.jsx)(GF,{onClick:Qe,title:he?`Unmute`:`Mute`,children:he?(0,S.jsxs)(`svg`,{className:`h-3.5 w-3.5`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,children:[(0,S.jsx)(`polygon`,{points:`11 5 6 9 2 9 2 15 6 15 11 19 11 5`}),(0,S.jsx)(`line`,{x1:`23`,y1:`9`,x2:`17`,y2:`15`}),(0,S.jsx)(`line`,{x1:`17`,y1:`9`,x2:`23`,y2:`15`})]}):(0,S.jsxs)(`svg`,{className:`h-3.5 w-3.5`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,children:[(0,S.jsx)(`polygon`,{points:`11 5 6 9 2 9 2 15 6 15 11 19 11 5`}),(0,S.jsx)(`path`,{d:`M19.07 4.93a10 10 0 010 14.14M15.54 8.46a5 5 0 010 7.07`})]})})}),(0,S.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,S.jsx)(GF,{onClick:tt,title:`Take snapshot`,children:(0,S.jsxs)(`svg`,{className:`h-3.5 w-3.5`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,children:[(0,S.jsx)(`path`,{d:`M23 19a2 2 0 01-2 2H3a2 2 0 01-2-2V8a2 2 0 012-2h4l2-3h6l2 3h4a2 2 0 012 2z`}),(0,S.jsx)(`circle`,{cx:`12`,cy:`13`,r:`4`})]})}),ye&&(0,S.jsx)(GF,{onClick:et,title:`Picture-in-Picture`,children:(0,S.jsxs)(`svg`,{className:`h-3.5 w-3.5`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,S.jsx)(`path`,{d:`M21 9V6a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2h4`}),(0,S.jsx)(`rect`,{width:`10`,height:`7`,x:`12`,y:`13`,rx:`2`})]})}),(0,S.jsx)(GF,{onClick:$e,title:_e?`Exit fullscreen`:`Fullscreen`,children:_e?(0,S.jsx)(`svg`,{className:`h-3.5 w-3.5`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,children:(0,S.jsx)(`path`,{d:`M8 3v3a2 2 0 01-2 2H3m18 0h-3a2 2 0 01-2-2V3m0 18v-3a2 2 0 012-2h3M3 16h3a2 2 0 012 2v3`})}):(0,S.jsx)(`svg`,{className:`h-3.5 w-3.5`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,children:(0,S.jsx)(`path`,{d:`M8 3H5a2 2 0 00-2 2v3m18 0V5a2 2 0 00-2-2h-3m0 18h3a2 2 0 002-2v-3M3 16v3a2 2 0 002 2h3`})})})]})]})]})}function GF({onClick:e,title:t,children:n}){return(0,S.jsx)(`button`,{onClick:e,title:t,className:`rounded-full p-1.5 min-w-[44px] min-h-[44px] flex items-center justify-center text-white/80 hover:text-white hover:bg-white/20 active:bg-white/30 transition-colors`,children:n})}async function KF(e){if(e.iceGatheringState!==`complete`)return new Promise(t=>{let n=!1,r,a=()=>{n||(n=!0,r&&clearInterval(r),e.removeEventListener(`icegatheringstatechange`,o),t())},o=()=>{e.iceGatheringState===`complete`&&a()};e.addEventListener(`icegatheringstatechange`,o);let s=Date.now();r=setInterval(()=>{let t=e.localDescription?.sdp??``;/ typ host/.test(t)&&Date.now()-s>=600&&a()},100),setTimeout(a,2500)})}FO(`camstack:player-overlays-state`,null);var qF=FO(`camstack:player-overlays-actions`,null);function JF(e){let t=(0,x.useContext)(qF);(0,x.useEffect)(()=>{if(!(!t||!e))return t.setLayer(e),()=>t.removeLayer(e.id)},[t,e])}V({id:I(),stableId:F(),addonId:F(),type:F(),name:F(),online:L(),disabled:L(),parentDeviceId:I().nullable(),role:F().nullable().optional(),features:B(F()).optional(),isCamera:L().optional(),sourceInfo:im.optional()}),Rd.AddonStarted,Rd.AddonInstalled,Rd.AddonRestarted,Rd.AddonUpdated,Rd.AddonStopped,Rd.AddonUninstalled,Rd.AddonCrashed,Rd.AddonError,Rd.DetectionPhaseTransition,Rd.DetectionResult,Rd.DetectionEvent,Rd.DetectionCameraNative,Rd.ProviderMotion,Rd.MotionOnMotionChanged,Rd.MotionAnalysis,Rd.MotionZonesRaw,Rd.ProviderDetection,Rd.PipelineAudioInferenceResult,Rd.AgentOnline,Rd.AgentOffline,Rd.DeviceRegistered,Rd.DeviceUnregistered,Rd.DeviceStateChanged,Rd.EventEmitted;var YF=Object.freeze([...new Set(Object.values(Rd))].toSorted()),XF=Object.freeze([Rd.PipelineCameraMetricsSnapshot,Rd.PipelineRunnerLoadSnapshot,Rd.PipelineEngineMetricsSnapshot,Rd.PipelineInferenceResult,Rd.PipelineTrace,Rd.PipelineProgress,Rd.StreamBrokerMetricsSnapshot,Rd.MetricsNodeResourcesSnapshot,Rd.MetricsNodeProcessesSnapshot,Rd.ClusterTopologySnapshot,Rd.MotionAnalysis,Rd.MotionZonesRaw,Rd.DetectionResult,Rd.PipelineAudioInferenceResult,Rd.PlatformProbePhase,Rd.BenchmarkProgress,Rd.ModelDownloadProgress]),ZF=new Set(XF);Object.freeze(YF.filter(e=>!ZF.has(e))),Object.freeze([...new Set(xT.filter(e=>e.scope===`device`).map(e=>e.name))].toSorted()),FO(`camstack:zone-editing`,null);var QF=500,$F=800;function eI(e,t,n){try{let r=e.live;if(!r)return null;let a=r.onEvent;return!a||typeof a.subscribe!=`function`?null:a.subscribe({category:t},{onData:n})}catch{return null}}function tI(e,t){return e?.id===t}function nI(e,t){let[n,r]=(0,x.useState)(null),[a,o]=(0,x.useState)(null),[s,c]=(0,x.useState)(null),[l,u]=(0,x.useState)(`watching`),d=(0,x.useRef)(void 0),f=(0,x.useRef)(void 0),p=(0,x.useRef)(void 0);return(0,x.useEffect)(()=>{if(t===null)return;let n=eI(e,`detection.motion-analysis`,e=>{let n=e;if(!tI(n?.source,t))return;let a=n.data;!a?.regions||a.regions.length===0||(r({zones:a.regions.map(e=>({...e.bbox,intensity:e.intensity})),frameWidth:a.frameWidth,frameHeight:a.frameHeight}),d.current&&clearTimeout(d.current),d.current=setTimeout(()=>r(null),QF))});return()=>{n?.unsubscribe(),d.current&&clearTimeout(d.current)}},[e,t]),(0,x.useEffect)(()=>{if(t===null)return;let n=eI(e,`detection.motion-zones-raw`,e=>{let n=e;if(!tI(n?.source,t))return;let r=n.data;r?.zones&&(o({boxes:r.zones.map(e=>({bbox:e.bbox,changeScore:e.changeScore})),frameWidth:r.frameSize?.width??0,frameHeight:r.frameSize?.height??0,motionScore:r.zones.length>0?r.zones.reduce((e,t)=>e+t.changeScore,0)/r.zones.length:0}),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>o(null),QF))});return()=>{n?.unsubscribe(),f.current&&clearTimeout(f.current)}},[e,t]),(0,x.useEffect)(()=>{if(t===null)return;let n=eI(e,`detection.result`,e=>{let n=e;if(!tI(n?.source,t))return;let r=n.data?.frame;r?.detections?.length&&(c({detections:r.detections,frameWidth:r.width,frameHeight:r.height}),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>c(null),$F))});return()=>{n?.unsubscribe(),p.current&&clearTimeout(p.current)}},[e,t]),(0,x.useEffect)(()=>{if(t===null)return;let n=eI(e,`detection.phase-transition`,e=>{let n=e;tI(n?.source,t)&&n.data?.to&&u(n.data.to)});return()=>{n?.unsubscribe()}},[e,t]),{motion:n,motionRaw:a,detection:s,phase:l}}function rI(e,t,n=5e3){let[r,a]=(0,x.useState)([]);(0,x.useEffect)(()=>{if(t===null)return;let r=!1,o=()=>{e.webrtcSession.listStreams.query({deviceId:t}).then(e=>{r||a(e)}).catch(()=>{})};o();let s=setInterval(o,n);return()=>{r=!0,clearInterval(s)}},[e,t,n]);let[o,s]=(0,x.useState)(null);(0,x.useEffect)(()=>{if(t===null)return;let n=!1;return e.pipelineOrchestrator&&e.pipelineOrchestrator.getCameraMetrics.query({deviceId:t}).then(e=>{n||!e||s({phase:e.phase,detectionFps:e.actualFps,avgInferenceMs:e.avgInferenceTimeMs,droppedFrames:e.droppedFrames})}).catch(()=>{}),()=>{n=!0}},[e,t]),GN(`pipeline.camera-metrics-snapshot`,e=>{if(t===null)return;let n=e.data;n.deviceId!==t||!n.metrics||s({phase:n.metrics.phase,detectionFps:n.metrics.actualFps,avgInferenceMs:n.metrics.avgInferenceTimeMs,droppedFrames:n.metrics.droppedFrames})});let{streams:c,hasWebrtc:l}=(0,x.useMemo)(()=>t===null||r.length===0?{streams:[],hasWebrtc:!1}:{streams:r.map(e=>({id:e.id,label:e.label,target:e.target,status:e.status,inputFps:e.inputFps,decodeFps:e.decodeFps,bitrateKbps:e.bitrateKbps})),hasWebrtc:!0},[t,r]),u=(0,x.useCallback)(async()=>{if(e.turnProvider)try{return(await e.turnProvider.getTurnServers.query()).map(e=>({urls:typeof e.urls==`string`?e.urls:[...e.urls],...e.username===void 0?{}:{username:e.username},...e.credential===void 0?{}:{credential:e.credential}}))}catch{return}},[e]),d=(0,x.useCallback)(async(n,r)=>{if(t===null)throw Error(`No device selected`);let a=await e.webrtcSession.createSession.mutate({deviceId:t,target:n,hints:r}),o=await u();return{sessionId:a.sessionId,sdpOffer:a.sdpOffer,...o?{iceServers:o}:{}}},[e,t,u]),f=(0,x.useCallback)(async(n,r,a)=>{if(t===null)throw Error(`No device selected`);return e.webrtcSession.handleOffer.mutate({deviceId:t,target:n,sdpOffer:r,...a===void 0?{}:{sessionId:a}})},[e,t]),p=(0,x.useCallback)(async(n,r)=>{if(t===null)throw Error(`No device selected`);await e.webrtcSession.handleAnswer.mutate({deviceId:t,sessionId:n,sdpAnswer:r})},[e,t]);return{streams:c,hasWebrtc:l,pipelineMetrics:o,createSession:d,handleOffer:f,getIceServers:u,addIceCandidate:(0,x.useCallback)(async(n,r)=>{t!==null&&await e.webrtcSession.addIceCandidate.mutate({deviceId:t,sessionId:n,candidate:r.candidate??``,sdpMid:r.sdpMid??null,sdpMLineIndex:r.sdpMLineIndex??null}).catch(()=>{})},[e,t]),getIceCandidates:(0,x.useCallback)(async n=>t===null?{candidates:[],done:!0}:e.webrtcSession.getIceCandidates.query({deviceId:t,sessionId:n}),[e,t]),sendAnswer:p,closeSession:(0,x.useCallback)(async n=>{t!==null&&await e.webrtcSession.closeSession.mutate({deviceId:t,sessionId:n}).catch(()=>{})},[e,t]),getSessionState:(0,x.useCallback)(async n=>{if(t===null)return{pendingRenegotiation:null};try{return await e.webrtcSession.getSessionState.query({deviceId:t,sessionId:n})}catch{return{pendingRenegotiation:null}}},[e,t])}}(0,x.lazy)(()=>tD(()=>import(`./MaskShapeCanvas-DI4BY7W2-DJ7ztnFv.js`).then(e=>({default:e.MaskShapeCanvas})),[],import.meta.url)),(0,x.lazy)(()=>tD(()=>import(`./MotionZonesSettings-NcxxQN8r-CQzEnQoq.js`).then(e=>({default:e.MotionZonesSettings})),__vite__mapDeps([0,1]),import.meta.url)),(0,x.lazy)(()=>tD(()=>import(`./PrivacyMaskSettings-APgPLF7p-Cl0eOy_U.js`).then(e=>({default:e.PrivacyMaskSettings})),__vite__mapDeps([2,1]),import.meta.url));var iI=W([`auto`,`high`,`medium`,`low`]),aI=H([G(`auto`),I().int().min(1)]),oI=V({enabled:L(),motion:L(),audio:W([`off`,`sensor`,`level`]),audioDb:I(),audioHoldSec:I(),detection:L(),detectionHoldSec:I(),detectionClasses:B(F()).optional(),appearance:V({motionColor:F(),audioColor:F(),detectionColor:F(),thickness:I()}).optional()}),sI=V({serverUrl:F().min(1),token:F().min(1),devices:B(I().int().nonnegative()).min(1),layout:aI,quality:iI,showName:L(),showBadges:L(),muted:L(),paused:L(),highlight:oI.optional(),activeOnly:L().optional(),audioOnIds:B(I().int().nonnegative()).optional(),pausedIds:B(I().int().nonnegative()).optional(),snapshots:U(F(),F()).optional(),ptzIds:B(I().int().nonnegative()).optional()});function cI(e){if(e==null)return{ok:!1,error:`config is required`};let t=sI.safeParse(e);return t.success?{ok:!0,config:t.data}:{ok:!1,error:t.error.issues.map(e=>`${e.path.join(`.`)||`(root)`}: ${e.message}`).join(`; `)}}var lI=1e4;function uI(){try{return window.parent!==window}catch{return!0}}function dI(e){let t=window.ReactNativeWebView;if(t){t.postMessage(JSON.stringify(e));return}uI()&&window.parent.postMessage(e,`*`)}function fI(e){let t=t=>{let n=t.data;if(typeof n!=`object`||!n)return;let r=n;r.type!==`embed-command`||typeof r.command!=`object`||r.command===null||e(r.command)};return window.addEventListener(`message`,t),()=>window.removeEventListener(`message`,t)}function pI(e,t,n){let r=t();return r==null?uI()?new Promise(t=>{let r,a=e=>{let o=e.data;if(typeof o!=`object`||!o)return;let s=o;s.type===`embed-config`&&(clearTimeout(r),window.removeEventListener(`message`,a),t(n(s.config)))};window.addEventListener(`message`,a),r=setTimeout(()=>{window.removeEventListener(`message`,a),t({ok:!1,error:`config handshake timed out`})},lI),window.parent.postMessage({type:`embed-ready`,mode:e},`*`)}):Promise.resolve({ok:!1,error:`config global for mode "${e}" is not set`}):Promise.resolve(n(r))}function mI(e,t,n){let[r,a]=(0,x.useState)(null),o=(0,x.useRef)(t);o.current=t;let s=(0,x.useRef)(n);return s.current=n,(0,x.useEffect)(()=>{let t=!0;return pI(e,()=>o.current(),e=>s.current(e)).then(e=>{t&&a(e)}),()=>{t=!1}},[e]),r}var hI=16/9;function gI(e,t,n,r){if(e<=0||t<=0||n<=0)return{cols:0,rows:0,cellW:0,cellH:0};if(typeof r==`number`&&r>=1){let a=Math.floor(r),o=Math.ceil(e/a),s=Math.min(t/a,n/o*hI);return{cols:a,rows:o,cellW:s,cellH:s/hI}}let a={cols:1,rows:e,cellW:0,cellH:0},o=-1;for(let r=1;r<=e;r++){let s=Math.ceil(e/r),c=Math.min(t/r,n/s*hI),l=c/hI,u=c*l;u>o&&(o=u,a={cols:r,rows:s,cellW:c,cellH:l})}return a}function _I(){let[e,t]=(0,x.useState)(null),[n,r]=(0,x.useState)(`idle`),a=(0,x.useRef)(null),o=(0,x.useRef)(null),s=(0,x.useRef)(null),c=(0,x.useRef)(0),l=(0,x.useRef)(null),u=YN(),d=XN(),f=ZN(),p=(0,x.useRef)({start:u.mutateAsync,answer:d.mutateAsync,stop:f.mutateAsync});p.current={start:u.mutateAsync,answer:d.mutateAsync,stop:f.mutateAsync};let m=(0,x.useCallback)(()=>{if(a.current){try{a.current.close()}catch{}a.current=null}if(o.current){for(let e of o.current.getTracks())try{e.stop()}catch{}o.current=null}},[]),h=(0,x.useCallback)(async()=>{let e=s.current;if(s.current=null,m(),e)try{await p.current.stop({deviceId:e.deviceId,sessionId:e.sessionId})}catch{}},[m]),g=(0,x.useCallback)(async e=>{if(l.current===e){c.current+=1,l.current=null,t(null),r(`idle`),await h();return}c.current+=1;let n=c.current;l.current=e,t(e),r(`starting`);let u;try{u=await navigator.mediaDevices.getUserMedia({audio:!0,video:!1})}catch{n===c.current&&(l.current=null,t(null),r(`error`));return}if(n!==c.current){for(let e of u.getTracks())e.stop();return}if(await h(),n!==c.current){for(let e of u.getTracks())e.stop();return}let d=null;try{o.current=u;let f=await p.current.start({deviceId:e});if(n!==c.current){try{await p.current.stop({deviceId:e,sessionId:f.sessionId})}catch{}m();return}s.current={deviceId:e,sessionId:f.sessionId},d=new RTCPeerConnection,a.current=d,d.oniceconnectionstatechange=()=>{if(n!==c.current||!d)return;let e=d.iceConnectionState;e===`connected`||e===`completed`?r(`talking`):(e===`failed`||e===`closed`||e===`disconnected`)&&(l.current=null,t(null),r(`idle`),h())};for(let e of u.getAudioTracks())d.addTrack(e,u);await d.setRemoteDescription({type:`offer`,sdp:f.sdpOffer});let g=await d.createAnswer();if(await d.setLocalDescription(g),n!==c.current)return;await p.current.answer({deviceId:e,sessionId:f.sessionId,sdpAnswer:d.localDescription?.sdp??g.sdp??``})}catch{if(d)try{d.close()}catch{}m();let e=s.current;if(s.current=null,e)try{await p.current.stop({deviceId:e.deviceId,sessionId:e.sessionId})}catch{}n===c.current&&(l.current=null,t(null),r(`error`))}},[h,m]),_=(0,x.useCallback)(e=>{if(e===null){c.current+=1,l.current=null,t(null),r(`idle`),h();return}l.current!==e&&g(e)},[h,g]);return(0,x.useEffect)(()=>()=>{c.current+=1,h()},[h]),{activeMicId:e,micState:n,toggleMic:e=>{g(e)},setActiveMic:_}}var vI=6e3,yI=500;function bI(e,t){let n=(0,x.useRef)(new Map),[,r]=(0,x.useState)(0),a=t?.motion??!1,o=t?.audio??`off`,s=t?.audioDb??-30,c=t?.audioHoldSec??3,l=t?.detection??!1,u=t?.detectionHoldSec??3,d=t?.detectionClasses??[],f=(e,t)=>{n.current.set(e,Date.now()+t),r(e=>e+1)};GN(Rd.MotionOnMotionChanged,e=>{if(!a)return;let t=e.data;t&&t.detected&&f(t.deviceId,vI)}),GN(Rd.PipelineAudioInferenceResult,e=>{if(o===`off`)return;let t=e.data;t&&(o===`sensor`?t.frame.detections.length>0:(t.frame.level?.dbfs??-1/0)>=s)&&f(t.deviceId,c*1e3)}),GN(Rd.DetectionResult,e=>{if(!l)return;let t=e.data;t&&t.frame.detections.some(e=>d.length===0||d.includes(e.macroClass))&&f(t.frame.deviceId,u*1e3)}),(0,x.useEffect)(()=>{let e=setInterval(()=>r(e=>e+1),yI);return()=>clearInterval(e)},[]);let p=Date.now(),m=new Set;for(let t of e){let e=n.current.get(t);e!==void 0&&p<e&&m.add(t)}return m}function xI(e){return{type:`tileOpen`,deviceId:e}}function SI(e){return{type:`audioToggle`,deviceId:e}}function CI(e){return{type:`pauseToggle`,deviceId:e}}function wI(e){return{type:`ptzOpen`,deviceId:e}}function TI(e,t){return t===void 0?{type:`state`,state:e}:{type:`state`,state:e,message:t}}function EI(e){return{type:`layout`,tiles:e}}function DI(e){dI(e)}var OI=4,kI=8,AI=300;function jI(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function MI({children:e,onTap:t}){let n=(0,x.useRef)(null),r=(0,x.useRef)(null),a=(0,x.useRef)(new Map),o=(0,x.useRef)(1),s=(0,x.useRef)(0),c=(0,x.useRef)(0),l=(0,x.useRef)(null),u=(0,x.useRef)(null),d=(0,x.useRef)(0),f=()=>{let e=r.current;e&&(e.style.transform=`translate(${s.current}px, ${c.current}px) scale(${o.current})`)},p=()=>{let e=n.current?.getBoundingClientRect();if(!e)return;let t=(o.current-1)*e.width/2,r=(o.current-1)*e.height/2;s.current=Math.max(-t,Math.min(t,s.current)),c.current=Math.max(-r,Math.min(r,c.current))},m=()=>{o.current=1,s.current=0,c.current=0,f()},h=e=>{try{e.currentTarget.setPointerCapture(e.pointerId)}catch{}if(a.current.set(e.pointerId,{x:e.clientX,y:e.clientY}),a.current.size===2){let e=[...a.current.values()],t=e[0],n=e[1];t&&n&&(l.current={dist:jI(t,n),scale:o.current,cx:(t.x+n.x)/2,cy:(t.y+n.y)/2,tx:s.current,ty:c.current}),u.current=null}else a.current.size===1&&(u.current={x:e.clientX,y:e.clientY,tx:s.current,ty:c.current,moved:!1})},g=e=>{if(!a.current.has(e.pointerId))return;if(a.current.set(e.pointerId,{x:e.clientX,y:e.clientY}),a.current.size>=2&&l.current){let e=[...a.current.values()],t=e[0],n=e[1];if(!t||!n)return;let r=jI(t,n);l.current.dist>0&&(o.current=Math.max(1,Math.min(OI,l.current.scale*(r/l.current.dist))));let u=(t.x+n.x)/2,d=(t.y+n.y)/2;s.current=l.current.tx+(u-l.current.cx),c.current=l.current.ty+(d-l.current.cy),p(),f();return}let t=u.current;if(a.current.size===1&&t){let n=e.clientX-t.x,r=e.clientY-t.y;(Math.abs(n)>kI||Math.abs(r)>kI)&&(t.moved=!0),o.current>1&&(s.current=t.tx+n,c.current=t.ty+r,p(),f())}},_=e=>{let n=a.current.size===1,r=u.current;if(a.current.delete(e.pointerId),a.current.size<2&&(l.current=null),a.current.size===0&&(u.current=null,n&&r&&!r.moved)){let e=Date.now();e-d.current<AI?(d.current=0,m()):(d.current=e,t())}};return(0,S.jsx)(`div`,{ref:n,style:{position:`absolute`,inset:0,overflow:`hidden`,touchAction:`none`},onPointerDown:h,onPointerMove:g,onPointerUp:_,onPointerCancel:_,children:(0,S.jsx)(`div`,{ref:r,style:{width:`100%`,height:`100%`,transformOrigin:`center center`,willChange:`transform`},children:e})})}var NI=500;function PI(e,t,n){let{motion:r,detection:a}=nI(e.trpcClient,t),o=(0,x.useRef)(0),s=(0,x.useRef)(0),[,c]=(0,x.useState)(0),l=n?.audio??`off`,u=n?.audioDb??-30,d=n?.audioHoldSec??3,f=n?.detectionHoldSec??3,p=n?.detectionClasses??[],m=p.join(`,`);if(GN(Rd.PipelineAudioInferenceResult,e=>{let n=e.data;!n||n.deviceId!==t||l===`off`||(l===`sensor`?n.frame.detections.length>0:(n.frame.level?.dbfs??-1/0)>=u)&&(o.current=Date.now()+d*1e3,c(e=>e+1))}),(0,x.useEffect)(()=>{a&&a.detections.some(e=>p.length===0||p.includes(e.macroClass))&&(s.current=Date.now()+f*1e3,c(e=>e+1))},[a,f,m]),(0,x.useEffect)(()=>{let e=setInterval(()=>c(e=>e+1),NI);return()=>clearInterval(e)},[]),!n?.enabled)return null;let h=Date.now();return n.detection&&h<s.current?`detection`:l!==`off`&&h<o.current?`audio`:n.motion&&r!==null?`motion`:null}var FI={motion:`#DC2626`,audio:`#3B82F6`,detection:`#22C55E`},II=3500;function LI(e){return e===`auto`?{kind:`adaptive`}:{kind:`profile`,profile:e===`medium`?`mid`:e}}function RI({system:e,deviceId:t,name:n,online:r,quality:a,muted:o,paused:s,showName:c,audioActive:l,micActive:u,onTogglePause:d,onToggleAudio:f,onToggleMic:p,onOpen:m,ptzSupported:h,onPtz:g,highlight:_,reconnectSignal:v,posterUrl:y}){let{handleOffer:b,getIceServers:ee,addIceCandidate:C,getIceCandidates:w,closeSession:te,getSessionState:T}=rI(e.trpcClient,t),E=PI(e,t,_),[ne,re]=(0,x.useState)(void 0);(0,x.useEffect)(()=>{if(y||s)return;let n=!1;return e.trpcClient.snapshot.getSnapshot.query({deviceId:t}).then(e=>{!n&&e?.base64&&re(`data:${e.contentType??`image/jpeg`};base64,${e.base64}`)}).catch(()=>{}),()=>{n=!0}},[y,s,e,t]);let ie=y??ne,ae=(0,x.useMemo)(()=>LI(a),[a]),oe=`grid:${t}:${a}`,se=(0,x.useMemo)(()=>(e,t)=>b(ae,e,t),[b,ae]),D=(0,x.useMemo)(()=>(e,t,n)=>b(n,t,e),[b]),[ce,O]=(0,x.useState)(!1),k=(0,x.useRef)(null),le=()=>{k.current&&clearTimeout(k.current),k.current=setTimeout(()=>O(!1),II)},ue=()=>{O(!0),le()},de=()=>{O(e=>{let t=!e;return t&&le(),t})},A=e=>{e.stopPropagation(),ue()};return(0,x.useEffect)(()=>()=>{k.current&&clearTimeout(k.current)},[]),(0,S.jsxs)(`div`,{style:{position:`relative`,width:`100%`,height:`100%`,background:`#000`},children:[(0,S.jsx)(MI,{onTap:de,children:s?(0,S.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`,color:`#fafaf9`},children:(0,S.jsx)(VI,{size:28})}):(0,S.jsx)(WF,{serverUrl:e.serverUrl,streamKey:oe,autoPlay:!0,muted:o,showControls:!1,className:`w-full h-full`,handleOffer:se,reoffer:D,getSessionState:T,getIceServers:ee,addIceCandidate:C,getIceCandidates:w,closeSession:te,reconnectSignal:v,posterUrl:ie},oe)}),E&&(()=>{let e=_?.appearance,t=E===`motion`?e?.motionColor??FI.motion:E===`audio`?e?.audioColor??FI.audio:e?.detectionColor??FI.detection;return(0,S.jsx)(`div`,{style:{position:`absolute`,inset:0,border:`${e?.thickness??3}px solid ${t}`,boxShadow:`inset 0 0 12px ${t}`,pointerEvents:`none`}})})(),(c||ce)&&(0,S.jsxs)(`div`,{style:{position:`absolute`,left:0,right:0,top:0,display:`flex`,alignItems:`center`,gap:6,padding:`4px 8px`,background:`rgba(0,0,0,0.6)`,color:`#fafaf9`,fontSize:12,fontWeight:600,fontFamily:`system-ui, sans-serif`,pointerEvents:`none`,opacity:c||ce?1:0,transition:`opacity 150ms ease`},children:[(0,S.jsx)(`span`,{style:{width:8,height:8,borderRadius:4,background:r?`#34d399`:`#71717a`}}),(0,S.jsx)(`span`,{style:{overflow:`hidden`,textOverflow:`ellipsis`,whiteSpace:`nowrap`},children:n})]}),(0,S.jsxs)(`div`,{style:{position:`absolute`,inset:0,opacity:+!!ce,transition:`opacity 150ms ease`,pointerEvents:`none`},children:[(0,S.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`,pointerEvents:`none`},children:(0,S.jsx)(zI,{label:s?`Play`:`Pause`,big:!0,enabled:ce,onClick:e=>{A(e),d(t)},children:s?(0,S.jsx)(VI,{size:22}):(0,S.jsx)(HI,{size:22})})}),(0,S.jsxs)(`div`,{style:{position:`absolute`,left:8,bottom:8,display:`flex`,gap:8,pointerEvents:`none`},children:[(0,S.jsx)(zI,{label:l?`Mute`:`Listen`,active:l,enabled:ce,onClick:e=>{A(e),f(t)},children:l?(0,S.jsx)(UI,{size:18}):(0,S.jsx)(WI,{size:18})}),(0,S.jsx)(zI,{label:u?`Stop talk`:`Talk`,active:u,enabled:ce,onClick:e=>{A(e),p(t)},children:(0,S.jsx)(GI,{size:18,muted:!u})}),h&&g?(0,S.jsx)(zI,{label:`PTZ`,enabled:ce,onClick:e=>{A(e),g(t)},children:(0,S.jsx)(qI,{size:18})}):null]}),(0,S.jsx)(`div`,{style:{position:`absolute`,right:8,bottom:8,pointerEvents:`none`},children:(0,S.jsx)(zI,{label:`Open`,enabled:ce,onClick:e=>{A(e),m(t)},children:(0,S.jsx)(KI,{size:18})})})]})]})}function zI({children:e,label:t,onClick:n,big:r=!1,active:a=!1,enabled:o=!0}){let s=r?52:40;return(0,S.jsx)(`button`,{type:`button`,"aria-label":t,onClick:n,style:{width:s,height:s,borderRadius:s/2,border:`none`,display:`flex`,alignItems:`center`,justifyContent:`center`,background:a?`rgba(59,130,246,0.85)`:`rgba(0,0,0,0.55)`,color:`#fafaf9`,cursor:`pointer`,padding:0,WebkitTapHighlightColor:`transparent`,pointerEvents:o?`auto`:`none`},children:e})}var BI={fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`};function VI({size:e}){return(0,S.jsx)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,children:(0,S.jsx)(`polygon`,{points:`6 4 20 12 6 20 6 4`,fill:`currentColor`})})}function HI({size:e}){return(0,S.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,children:[(0,S.jsx)(`rect`,{x:`6`,y:`4`,width:`4`,height:`16`,fill:`currentColor`}),(0,S.jsx)(`rect`,{x:`14`,y:`4`,width:`4`,height:`16`,fill:`currentColor`})]})}function UI({size:e}){return(0,S.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,...BI,children:[(0,S.jsx)(`polygon`,{points:`11 5 6 9 2 9 2 15 6 15 11 19 11 5`}),(0,S.jsx)(`path`,{d:`M19.07 4.93a10 10 0 010 14.14M15.54 8.46a5 5 0 010 7.07`})]})}function WI({size:e}){return(0,S.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,...BI,children:[(0,S.jsx)(`polygon`,{points:`11 5 6 9 2 9 2 15 6 15 11 19 11 5`}),(0,S.jsx)(`line`,{x1:`23`,y1:`9`,x2:`17`,y2:`15`}),(0,S.jsx)(`line`,{x1:`17`,y1:`9`,x2:`23`,y2:`15`})]})}function GI({size:e,muted:t}){return(0,S.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,...BI,children:[(0,S.jsx)(`path`,{d:`M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z`}),(0,S.jsx)(`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2M12 19v4`}),t&&(0,S.jsx)(`line`,{x1:`3`,y1:`3`,x2:`21`,y2:`21`})]})}function KI({size:e}){return(0,S.jsx)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,...BI,children:(0,S.jsx)(`path`,{d:`M15 3h6v6M21 3l-9 9M21 14v5a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5`})})}function qI({size:e}){return(0,S.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,...BI,children:[(0,S.jsx)(`path`,{d:`M12 2v20M2 12h20`}),(0,S.jsx)(`path`,{d:`M12 2l-3 3M12 2l3 3M12 22l-3-3M12 22l3-3M2 12l3-3M2 12l3 3M22 12l-3-3M22 12l-3 3`})]})}function JI({message:e}){return(0,x.useEffect)(()=>DI(TI(`error`,e)),[e]),(0,S.jsxs)(`div`,{style:{position:`fixed`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`#000`,color:`#f87171`,fontFamily:`system-ui, sans-serif`,fontSize:13,padding:16,textAlign:`center`},children:[`Grid embed config error: `,e]})}function YI({system:e,config:t}){let[n,r]=(0,x.useState)(()=>new Set(t.audioOnIds??[])),a=_I(),o=(0,x.useRef)(a.setActiveMic);o.current=a.setActiveMic;let[s,c]=(0,x.useState)(()=>new Set(t.pausedIds??[])),[l,u]=(0,x.useState)(t.highlight),[d,f]=(0,x.useState)(t.activeOnly??!1),p=bI(t.devices,l),m=(0,x.useMemo)(()=>d?t.devices.filter(e=>p.has(e)):t.devices,[d,t.devices,p]),[h,g]=(0,x.useState)(t.quality),[_,v]=(0,x.useState)(t.layout),[y,b]=(0,x.useState)(t.showName),[ee,C]=(0,x.useState)(0),[w,te]=(0,x.useState)(()=>t.snapshots??{}),T=(0,x.useMemo)(()=>new Set(t.ptzIds??[]),[t.ptzIds]),[E,ne]=(0,x.useState)({w:window.innerWidth,h:window.innerHeight}),[re,ie]=(0,x.useState)({});(0,x.useEffect)(()=>{let t=!1;return e.trpcClient.deviceManager.listAll.query({}).then(e=>{if(t)return;let n={};for(let t of e)n[t.id]={name:t.name??`Camera ${t.id}`,online:t.online??!1};ie(n)}).catch(()=>{}),()=>{t=!0}},[e]),(0,x.useEffect)(()=>(window.__camstackGrid={setAudioOn:e=>r(new Set(e)),setMutedAll:e=>{e&&r(new Set)},setActiveMic:e=>o.current(e),setHighlight:e=>u(e),setActiveOnly:e=>f(e),setPaused:e=>c(new Set(e)),setQuality:e=>g(e),setLayout:e=>v(e),setShowName:b,setShowBadges:()=>{},setSnapshots:e=>te(e),fit:(e,t)=>ne({w:e,h:t}),reconnect:()=>C(e=>e+1)},DI(TI(`ready`)),()=>{window.__camstackGrid&&delete window.__camstackGrid}),[]),(0,x.useEffect)(()=>fI(e=>{let t=window.__camstackGrid;if(t)switch(e.kind){case`setAudioOn`:t.setAudioOn(e.value);break;case`setMutedAll`:t.setMutedAll(e.value);break;case`setActiveMic`:t.setActiveMic(e.value);break;case`setHighlight`:t.setHighlight(e.value);break;case`setActiveOnly`:t.setActiveOnly(e.value);break;case`setPaused`:t.setPaused(e.value);break;case`setQuality`:t.setQuality(e.value);break;case`setLayout`:t.setLayout(e.value);break;case`setShowName`:t.setShowName(e.value);break;case`setShowBadges`:t.setShowBadges(e.value);break;case`setSnapshots`:t.setSnapshots(e.value);break;case`fit`:t.fit(e.w,e.h);break;case`reconnect`:t.reconnect();break;default:break}}),[]);let ae=(0,x.useMemo)(()=>gI(m.length,E.w,E.h,_),[m.length,E.w,E.h,_]),oe=(0,x.useRef)(null);return(0,x.useEffect)(()=>{let e=oe.current;if(!e)return;let t=[];e.querySelectorAll(`[data-device-id]`).forEach(e=>{let n=Number(e.dataset.deviceId),r=e.getBoundingClientRect();t.push({deviceId:n,rect:{x:r.x,y:r.y,w:r.width,h:r.height}})}),t.length&&DI(EI(t))},[ae,m]),(0,S.jsxs)(`div`,{ref:oe,style:{position:`fixed`,inset:0,background:`#000`,display:`flex`,flexWrap:`wrap`,alignItems:`center`,justifyContent:`center`},children:[d&&m.length===0&&(0,S.jsx)(`div`,{style:{color:`#a1a1aa`,fontFamily:`system-ui, sans-serif`,fontSize:14,padding:24,textAlign:`center`},children:`No active cameras`}),m.map(t=>(0,S.jsx)(`div`,{"data-device-id":t,style:{width:ae.cellW,height:ae.cellH},children:(0,S.jsx)(RI,{system:e,deviceId:t,name:re[t]?.name??`Camera ${t}`,online:re[t]?.online??!1,quality:h,muted:!n.has(t),paused:s.has(t),showName:y,audioActive:n.has(t),micActive:a.activeMicId===t,onTogglePause:e=>DI(CI(e)),onToggleAudio:e=>DI(SI(e)),onToggleMic:a.toggleMic,onOpen:e=>DI(xI(e)),ptzSupported:T.has(t),onPtz:e=>DI(wI(e)),highlight:l,reconnectSignal:ee,posterUrl:w[String(t)]})},t))]})}function XI(){let e=mI(`grid`,()=>window.__CAMSTACK_GRID__,cI),t=(0,x.useMemo)(()=>e===null||!e.ok?null:{system:RE({serverUrl:e.config.serverUrl,token:e.config.token}),queryClient:new st({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}})},[e]);return(0,x.useEffect)(()=>{if(t)return()=>t.system.close()},[t]),e===null?null:e.ok?t?(0,S.jsx)(UN,{system:t.system,children:(0,S.jsx)(ut,{client:t.queryClient,children:(0,S.jsx)($.Provider,{client:t.system.trpcClient,queryClient:t.queryClient,children:(0,S.jsx)(YI,{system:t.system,config:e.config})})})}):(0,S.jsx)(JI,{message:`Failed to initialise the grid embed`}):(0,S.jsx)(JI,{message:e.error})}function ZI(e){switch(e.kind){case`seekTo`:return{t:`seek`,epoch:e.epochMs};case`scrubEnd`:return{t:`scrubCommit`,epoch:e.epochMs};case`play`:return{t:`setRate`,rate:1};case`pause`:return{t:`setRate`,rate:0};case`goLive`:return{t:`goLive`};case`playRecorded`:return{t:`playRecorded`,deviceId:e.deviceId,epoch:e.epochMs,profile:e.profile};case`scrubStart`:case`scrubTo`:return null}}var QI=class{capacity;dispose;map=new Map;constructor(e,t){this.capacity=e,this.dispose=t}has(e){return this.map.has(e)}get(e){if(!this.map.has(e))return;let t=this.map.get(e);return this.map.delete(e),t!==void 0&&this.map.set(e,t),t}set(e,t){if(this.map.has(e)){let t=this.map.get(e);this.map.delete(e),t!==void 0&&this.dispose?.(t)}for(this.map.set(e,t);this.map.size>this.capacity;){let e=this.map.keys().next().value;if(e===void 0)break;let t=this.map.get(e);this.map.delete(e),t!==void 0&&this.dispose?.(t)}}clear(){this.map.forEach(e=>this.dispose?.(e)),this.map.clear()}};function $I(e){try{return new URL(e).toString()}catch{let t=typeof window<`u`&&window.location?.origin?window.location.origin:`http://localhost`;return new URL(e,t).toString()}}function eL(e,t){return new URL(t,e).toString()}function tL(e){let t=(e.split(`/`).pop()??``).match(/^(\d+)-(\d+)(?:-\d+)?\.m4s$/);return t?{startMs:Number(t[1]),durMs:Number(t[2])}:null}function nL(e,t){let n=e.split(`
|
|
78
78
|
`).map(e=>e.trim());for(let e of n)if(/low\.m3u8/i.test(e))return eL(t,e);let r=null;for(let e=0;e<n.length;e++){let a=n[e],o=n[e+1];a&&a.startsWith(`#EXT-X-STREAM-INF`)&&o&&!o.startsWith(`#`)&&(r=eL(t,o))}return r}async function rL(e,t){let n=await fetch(e,t?{headers:t}:void 0);if(!n.ok)throw Error(`playlist fetch ${n.status} for ${e}`);return n.text()}async function iL(e,t){let n=$I(e),r=nL(await rL(n,t),n);if(!r)return[];let a=await rL(r,t),o=[];for(let e of a.split(`
|
|
79
79
|
`).map(e=>e.trim())){if(!e||e.startsWith(`#`))continue;let t=eL(r,e),n=tL(t);n&&o.push({uri:t,startMs:n.startMs,durMs:n.durMs})}return o.sort((e,t)=>e.startMs-t.startMs),o}function aL(e,t){let n=e.length;if(n===0)return 0;let r=0,a=n-1,o=-1;for(;r<=a;){let n=r+a>>1,s=e[n];if(!s)break;s.startMs<=t?(o=n,r=n+1):a=n-1}if(o===-1)return 0;let s=e[o];if(s&&t<s.startMs+s.durMs)return o;let c=e[o+1];return s&&c?Math.abs(s.startMs-t)<=Math.abs(c.startMs-t)?o:o+1:o}function oL(e,t){return e.length===0?null:e[aL(e,t)]??null}function sL(e,t,n,r){if(e.length===0||r<=0)return[];let a=aL(e,t),o=[];if(n===`forward`)for(let t=a+1;t<=a+r&&t<e.length;t++){let n=e[t];n&&o.push(n)}else for(let t=a-1;t>=a-r&&t>=0;t--){let n=e[t];n&&o.push(n)}return o}var cL=class{deps;generation=0;inflight=null;lastEpoch=0;lastSegStart=null;bytes;frames;prefetchCount;prefetching=new Map;constructor(e){this.deps=e,this.bytes=new QI(e.byteCacheSize??24),this.frames=new QI(e.frameCacheSize??16,e=>e.close()),this.prefetchCount=e.prefetchCount??3}clearFrames(){this.frames.clear()}dispose(){this.inflight?.abort();for(let e of this.prefetching.values())e.abort();this.prefetching.clear(),this.frames.clear(),this.bytes.clear()}async scrubTo(e){let t=e>=this.lastEpoch?`forward`:`backward`;this.lastEpoch=e;let n=++this.generation;this.inflight?.abort();let r=new AbortController;this.inflight=r;let a=performance.now(),o=await this.deps.ensureIndex(e),s=oL(o,e);if(!s)return;let c=this.frames.get(s.startMs);if(c){n===this.generation&&(this.deps.draw(c),this.deps.onTiming?.({epochMs:e,cached:!0,fetchMs:0,decodeMs:0,totalMs:performance.now()-a}),this.maybePrefetch(o,e,t,s.startMs));return}try{let c=performance.now(),l=await this.getBytes(s.uri,r.signal),u=performance.now()-c,d=performance.now(),f=await this.deps.decode(l),p=performance.now()-d;if(n!==this.generation){f.close();return}this.frames.set(s.startMs,f),this.deps.draw(f),this.deps.onTiming?.({epochMs:e,cached:!1,fetchMs:u,decodeMs:p,totalMs:performance.now()-a}),this.maybePrefetch(o,e,t,s.startMs)}catch(e){if(r.signal.aborted)return;throw e}}async getBytes(e,t){let n=this.bytes.get(e);if(n)return n;let r=await this.deps.fetchBytes(e,t);return this.bytes.set(e,r),r}maybePrefetch(e,t,n,r){let a=this.lastSegStart;this.lastSegStart=r,!(a===null||r===a)&&this.schedulePrefetch(e,t,n)}schedulePrefetch(e,t,n){let r=sL(e,t,n,this.prefetchCount);for(let e of r){if(this.bytes.has(e.uri)||this.prefetching.has(e.uri))continue;let t=new AbortController;this.prefetching.set(e.uri,t),this.deps.fetchBytes(e.uri,t.signal).then(t=>{this.bytes.set(e.uri,t),this.prefetching.delete(e.uri)}).catch(()=>{this.prefetching.delete(e.uri)})}}},lL=u(s((e=>{var t=(function(){var e=new Date,n=4,r=3,a=2,o=1,s=n;return{setLogLevel:function(e){s=e==this.debug?o:e==this.info?a:e==this.warn?r:(this.error,n)},debug:function(n,r){console.debug===void 0&&(console.debug=console.log),o>=s&&console.debug(`[`+t.getDurationString(new Date-e,1e3)+`]`,`[`+n+`]`,r)},log:function(e,t){this.debug(e.msg)},info:function(n,r){a>=s&&console.info(`[`+t.getDurationString(new Date-e,1e3)+`]`,`[`+n+`]`,r)},warn:function(n,a){r>=s&&console.warn(`[`+t.getDurationString(new Date-e,1e3)+`]`,`[`+n+`]`,a)},error:function(r,a){n>=s&&console.error(`[`+t.getDurationString(new Date-e,1e3)+`]`,`[`+r+`]`,a)}}})();t.getDurationString=function(e,t){var n;function r(e,t){for(var n=(``+e).split(`.`);n[0].length<t;)n[0]=`0`+n[0];return n.join(`.`)}e<0?(n=!0,e=-e):n=!1;var a=e/(t||1),o=Math.floor(a/3600);a-=o*3600;var s=Math.floor(a/60);a-=s*60;var c=a*1e3;return a=Math.floor(a),c-=a*1e3,c=Math.floor(c),(n?`-`:``)+o+`:`+r(s,2)+`:`+r(a,2)+`.`+r(c,3)},t.printRanges=function(e){var n=e.length;if(n>0){for(var r=``,a=0;a<n;a++)a>0&&(r+=`,`),r+=`[`+t.getDurationString(e.start(a))+`,`+t.getDurationString(e.end(a))+`]`;return r}else return`(empty)`},e!==void 0&&(e.Log=t);var n=function(e){if(e instanceof ArrayBuffer)this.buffer=e,this.dataview=new DataView(e);else throw`Needs an array buffer`;this.position=0};n.prototype.getPosition=function(){return this.position},n.prototype.getEndPosition=function(){return this.buffer.byteLength},n.prototype.getLength=function(){return this.buffer.byteLength},n.prototype.seek=function(e){var t=Math.max(0,Math.min(this.buffer.byteLength,e));return this.position=isNaN(t)||!isFinite(t)?0:t,!0},n.prototype.isEos=function(){return this.getPosition()>=this.getEndPosition()},n.prototype.readAnyInt=function(e,t){var n=0;if(this.position+e<=this.buffer.byteLength){switch(e){case 1:n=t?this.dataview.getInt8(this.position):this.dataview.getUint8(this.position);break;case 2:n=t?this.dataview.getInt16(this.position):this.dataview.getUint16(this.position);break;case 3:if(t)throw`No method for reading signed 24 bits values`;n=this.dataview.getUint8(this.position)<<16,n|=this.dataview.getUint8(this.position+1)<<8,n|=this.dataview.getUint8(this.position+2);break;case 4:n=t?this.dataview.getInt32(this.position):this.dataview.getUint32(this.position);break;case 8:if(t)throw`No method for reading signed 64 bits values`;n=this.dataview.getUint32(this.position)<<32,n|=this.dataview.getUint32(this.position+4);break;default:throw`readInt method not implemented for size: `+e}return this.position+=e,n}else throw`Not enough bytes in buffer`},n.prototype.readUint8=function(){return this.readAnyInt(1,!1)},n.prototype.readUint16=function(){return this.readAnyInt(2,!1)},n.prototype.readUint24=function(){return this.readAnyInt(3,!1)},n.prototype.readUint32=function(){return this.readAnyInt(4,!1)},n.prototype.readUint64=function(){return this.readAnyInt(8,!1)},n.prototype.readString=function(e){if(this.position+e<=this.buffer.byteLength){for(var t=``,n=0;n<e;n++)t+=String.fromCharCode(this.readUint8());return t}else throw`Not enough bytes in buffer`},n.prototype.readCString=function(){for(var e=[];;){var t=this.readUint8();if(t!==0)e.push(t);else break}return String.fromCharCode.apply(null,e)},n.prototype.readInt8=function(){return this.readAnyInt(1,!0)},n.prototype.readInt16=function(){return this.readAnyInt(2,!0)},n.prototype.readInt32=function(){return this.readAnyInt(4,!0)},n.prototype.readInt64=function(){return this.readAnyInt(8,!1)},n.prototype.readUint8Array=function(e){for(var t=new Uint8Array(e),n=0;n<e;n++)t[n]=this.readUint8();return t},n.prototype.readInt16Array=function(e){for(var t=new Int16Array(e),n=0;n<e;n++)t[n]=this.readInt16();return t},n.prototype.readUint16Array=function(e){for(var t=new Int16Array(e),n=0;n<e;n++)t[n]=this.readUint16();return t},n.prototype.readUint32Array=function(e){for(var t=new Uint32Array(e),n=0;n<e;n++)t[n]=this.readUint32();return t},n.prototype.readInt32Array=function(e){for(var t=new Int32Array(e),n=0;n<e;n++)t[n]=this.readInt32();return t},e!==void 0&&(e.MP4BoxStream=n);var r=function(e,t,n){this._byteOffset=t||0,e instanceof ArrayBuffer?this.buffer=e:typeof e==`object`?(this.dataView=e,t&&(this._byteOffset+=t)):this.buffer=new ArrayBuffer(e||0),this.position=0,this.endianness=n??r.LITTLE_ENDIAN};r.prototype={},r.prototype.getPosition=function(){return this.position},r.prototype._realloc=function(e){if(this._dynamicSize){var t=this._byteOffset+this.position+e,n=this._buffer.byteLength;if(t<=n){t>this._byteLength&&(this._byteLength=t);return}for(n<1&&(n=1);t>n;)n*=2;var r=new ArrayBuffer(n),a=new Uint8Array(this._buffer);new Uint8Array(r,0,a.length).set(a),this.buffer=r,this._byteLength=t}},r.prototype._trimAlloc=function(){if(this._byteLength!=this._buffer.byteLength){var e=new ArrayBuffer(this._byteLength),t=new Uint8Array(e),n=new Uint8Array(this._buffer,0,t.length);t.set(n),this.buffer=e}},r.BIG_ENDIAN=!1,r.LITTLE_ENDIAN=!0,r.prototype._byteLength=0,Object.defineProperty(r.prototype,"byteLength",{get:function(){return this._byteLength-this._byteOffset}}),Object.defineProperty(r.prototype,"buffer",{get:function(){return this._trimAlloc(),this._buffer},set:function(e){this._buffer=e,this._dataView=new DataView(this._buffer,this._byteOffset),this._byteLength=this._buffer.byteLength}}),Object.defineProperty(r.prototype,"byteOffset",{get:function(){return this._byteOffset},set:function(e){this._byteOffset=e,this._dataView=new DataView(this._buffer,this._byteOffset),this._byteLength=this._buffer.byteLength}}),Object.defineProperty(r.prototype,"dataView",{get:function(){return this._dataView},set:function(e){this._byteOffset=e.byteOffset,this._buffer=e.buffer,this._dataView=new DataView(this._buffer,this._byteOffset),this._byteLength=this._byteOffset+e.byteLength}}),r.prototype.seek=function(e){var t=Math.max(0,Math.min(this.byteLength,e));this.position=isNaN(t)||!isFinite(t)?0:t},r.prototype.isEof=function(){return this.position>=this._byteLength},r.prototype.mapUint8Array=function(e){this._realloc(e*1);var t=new Uint8Array(this._buffer,this.byteOffset+this.position,e);return this.position+=e*1,t},r.prototype.readInt32Array=function(e,t){e??=this.byteLength-this.position/4;var n=new Int32Array(e);return r.memcpy(n.buffer,0,this.buffer,this.byteOffset+this.position,e*n.BYTES_PER_ELEMENT),r.arrayToNative(n,t??this.endianness),this.position+=n.byteLength,n},r.prototype.readInt16Array=function(e,t){e??=this.byteLength-this.position/2;var n=new Int16Array(e);return r.memcpy(n.buffer,0,this.buffer,this.byteOffset+this.position,e*n.BYTES_PER_ELEMENT),r.arrayToNative(n,t??this.endianness),this.position+=n.byteLength,n},r.prototype.readInt8Array=function(e){e??=this.byteLength-this.position;var t=new Int8Array(e);return r.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT),this.position+=t.byteLength,t},r.prototype.readUint32Array=function(e,t){e??=this.byteLength-this.position/4;var n=new Uint32Array(e);return r.memcpy(n.buffer,0,this.buffer,this.byteOffset+this.position,e*n.BYTES_PER_ELEMENT),r.arrayToNative(n,t??this.endianness),this.position+=n.byteLength,n},r.prototype.readUint16Array=function(e,t){e??=this.byteLength-this.position/2;var n=new Uint16Array(e);return r.memcpy(n.buffer,0,this.buffer,this.byteOffset+this.position,e*n.BYTES_PER_ELEMENT),r.arrayToNative(n,t??this.endianness),this.position+=n.byteLength,n},r.prototype.readUint8Array=function(e){e??=this.byteLength-this.position;var t=new Uint8Array(e);return r.memcpy(t.buffer,0,this.buffer,this.byteOffset+this.position,e*t.BYTES_PER_ELEMENT),this.position+=t.byteLength,t},r.prototype.readFloat64Array=function(e,t){e??=this.byteLength-this.position/8;var n=new Float64Array(e);return r.memcpy(n.buffer,0,this.buffer,this.byteOffset+this.position,e*n.BYTES_PER_ELEMENT),r.arrayToNative(n,t??this.endianness),this.position+=n.byteLength,n},r.prototype.readFloat32Array=function(e,t){e??=this.byteLength-this.position/4;var n=new Float32Array(e);return r.memcpy(n.buffer,0,this.buffer,this.byteOffset+this.position,e*n.BYTES_PER_ELEMENT),r.arrayToNative(n,t??this.endianness),this.position+=n.byteLength,n},r.prototype.readInt32=function(e){var t=this._dataView.getInt32(this.position,e??this.endianness);return this.position+=4,t},r.prototype.readInt16=function(e){var t=this._dataView.getInt16(this.position,e??this.endianness);return this.position+=2,t},r.prototype.readInt8=function(){var e=this._dataView.getInt8(this.position);return this.position+=1,e},r.prototype.readUint32=function(e){var t=this._dataView.getUint32(this.position,e??this.endianness);return this.position+=4,t},r.prototype.readUint16=function(e){var t=this._dataView.getUint16(this.position,e??this.endianness);return this.position+=2,t},r.prototype.readUint8=function(){var e=this._dataView.getUint8(this.position);return this.position+=1,e},r.prototype.readFloat32=function(e){var t=this._dataView.getFloat32(this.position,e??this.endianness);return this.position+=4,t},r.prototype.readFloat64=function(e){var t=this._dataView.getFloat64(this.position,e??this.endianness);return this.position+=8,t},r.endianness=new Int8Array(new Int16Array([1]).buffer)[0]>0,r.memcpy=function(e,t,n,r,a){var o=new Uint8Array(e,t,a),s=new Uint8Array(n,r,a);o.set(s)},r.arrayToNative=function(e,t){return t==this.endianness?e:this.flipArrayEndianness(e)},r.nativeToEndian=function(e,t){return this.endianness==t?e:this.flipArrayEndianness(e)},r.flipArrayEndianness=function(e){for(var t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength),n=0;n<e.byteLength;n+=e.BYTES_PER_ELEMENT)for(var r=n+e.BYTES_PER_ELEMENT-1,a=n;r>a;r--,a++){var o=t[a];t[a]=t[r],t[r]=o}return e},r.prototype.failurePosition=0,String.fromCharCodeUint8=function(e){for(var t=[],n=0;n<e.length;n++)t[n]=e[n];return String.fromCharCode.apply(null,t)},r.prototype.readString=function(e,t){return t==null||t==`ASCII`?String.fromCharCodeUint8.apply(null,[this.mapUint8Array(e??this.byteLength-this.position)]):new TextDecoder(t).decode(this.mapUint8Array(e))},r.prototype.readCString=function(e){var t=this.byteLength-this.position,n=new Uint8Array(this._buffer,this._byteOffset+this.position),r=t;e!=null&&(r=Math.min(e,t));for(var a=0;a<r&&n[a]!==0;a++);var o=String.fromCharCodeUint8.apply(null,[this.mapUint8Array(a)]);return e==null?a!=t&&(this.position+=1):this.position+=r-a,o};var a=2**32;r.prototype.readInt64=function(){return this.readInt32()*a+this.readUint32()},r.prototype.readUint64=function(){return this.readUint32()*a+this.readUint32()},r.prototype.readInt64=function(){return this.readUint32()*a+this.readUint32()},r.prototype.readUint24=function(){return(this.readUint8()<<16)+(this.readUint8()<<8)+this.readUint8()},e!==void 0&&(e.DataStream=r),r.prototype.save=function(e){var t=new Blob([this.buffer]);if(window.URL&&URL.createObjectURL){var n=window.URL.createObjectURL(t),r=document.createElement(`a`);document.body.appendChild(r),r.setAttribute(`href`,n),r.setAttribute(`download`,e),r.setAttribute(`target`,`_self`),r.click(),window.URL.revokeObjectURL(n)}else throw`DataStream.save: Can't create object URL.`},r.prototype._dynamicSize=!0,Object.defineProperty(r.prototype,"dynamicSize",{get:function(){return this._dynamicSize},set:function(e){e||this._trimAlloc(),this._dynamicSize=e}}),r.prototype.shift=function(e){var t=new ArrayBuffer(this._byteLength-e),n=new Uint8Array(t),r=new Uint8Array(this._buffer,e,n.length);n.set(r),this.buffer=t,this.position-=e},r.prototype.writeInt32Array=function(e,t){if(this._realloc(e.length*4),e instanceof Int32Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0)r.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength),this.mapInt32Array(e.length,t);else for(var n=0;n<e.length;n++)this.writeInt32(e[n],t)},r.prototype.writeInt16Array=function(e,t){if(this._realloc(e.length*2),e instanceof Int16Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0)r.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength),this.mapInt16Array(e.length,t);else for(var n=0;n<e.length;n++)this.writeInt16(e[n],t)},r.prototype.writeInt8Array=function(e){if(this._realloc(e.length*1),e instanceof Int8Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0)r.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength),this.mapInt8Array(e.length);else for(var t=0;t<e.length;t++)this.writeInt8(e[t])},r.prototype.writeUint32Array=function(e,t){if(this._realloc(e.length*4),e instanceof Uint32Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0)r.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength),this.mapUint32Array(e.length,t);else for(var n=0;n<e.length;n++)this.writeUint32(e[n],t)},r.prototype.writeUint16Array=function(e,t){if(this._realloc(e.length*2),e instanceof Uint16Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0)r.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength),this.mapUint16Array(e.length,t);else for(var n=0;n<e.length;n++)this.writeUint16(e[n],t)},r.prototype.writeUint8Array=function(e){if(this._realloc(e.length*1),e instanceof Uint8Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0)r.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength),this.mapUint8Array(e.length);else for(var t=0;t<e.length;t++)this.writeUint8(e[t])},r.prototype.writeFloat64Array=function(e,t){if(this._realloc(e.length*8),e instanceof Float64Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0)r.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength),this.mapFloat64Array(e.length,t);else for(var n=0;n<e.length;n++)this.writeFloat64(e[n],t)},r.prototype.writeFloat32Array=function(e,t){if(this._realloc(e.length*4),e instanceof Float32Array&&this.byteOffset+this.position%e.BYTES_PER_ELEMENT===0)r.memcpy(this._buffer,this.byteOffset+this.position,e.buffer,0,e.byteLength),this.mapFloat32Array(e.length,t);else for(var n=0;n<e.length;n++)this.writeFloat32(e[n],t)},r.prototype.writeInt32=function(e,t){this._realloc(4),this._dataView.setInt32(this.position,e,t??this.endianness),this.position+=4},r.prototype.writeInt16=function(e,t){this._realloc(2),this._dataView.setInt16(this.position,e,t??this.endianness),this.position+=2},r.prototype.writeInt8=function(e){this._realloc(1),this._dataView.setInt8(this.position,e),this.position+=1},r.prototype.writeUint32=function(e,t){this._realloc(4),this._dataView.setUint32(this.position,e,t??this.endianness),this.position+=4},r.prototype.writeUint16=function(e,t){this._realloc(2),this._dataView.setUint16(this.position,e,t??this.endianness),this.position+=2},r.prototype.writeUint8=function(e){this._realloc(1),this._dataView.setUint8(this.position,e),this.position+=1},r.prototype.writeFloat32=function(e,t){this._realloc(4),this._dataView.setFloat32(this.position,e,t??this.endianness),this.position+=4},r.prototype.writeFloat64=function(e,t){this._realloc(8),this._dataView.setFloat64(this.position,e,t??this.endianness),this.position+=8},r.prototype.writeUCS2String=function(e,t,n){n??=e.length;for(var r=0;r<e.length&&r<n;r++)this.writeUint16(e.charCodeAt(r),t);for(;r<n;r++)this.writeUint16(0)},r.prototype.writeString=function(e,t,n){var r=0;if(t==null||t==`ASCII`)if(n!=null){var a=Math.min(e.length,n);for(r=0;r<a;r++)this.writeUint8(e.charCodeAt(r));for(;r<n;r++)this.writeUint8(0)}else for(r=0;r<e.length;r++)this.writeUint8(e.charCodeAt(r));else this.writeUint8Array(new TextEncoder(t).encode(e.substring(0,n)))},r.prototype.writeCString=function(e,t){var n=0;if(t!=null){var r=Math.min(e.length,t);for(n=0;n<r;n++)this.writeUint8(e.charCodeAt(n));for(;n<t;n++)this.writeUint8(0)}else{for(n=0;n<e.length;n++)this.writeUint8(e.charCodeAt(n));this.writeUint8(0)}},r.prototype.writeStruct=function(e,t){for(var n=0;n<e.length;n+=2){var r=e[n+1];this.writeType(r,t[e[n]],t)}},r.prototype.writeType=function(e,t,n){var a;if(typeof e==`function`)return e(this,t);if(typeof e==`object`&&!(e instanceof Array))return e.set(this,t,n);var o=null,s=`ASCII`,c=this.position;switch(typeof e==`string`&&/:/.test(e)&&(a=e.split(`:`),e=a[0],o=parseInt(a[1])),typeof e==`string`&&/,/.test(e)&&(a=e.split(`,`),e=a[0],s=parseInt(a[1])),e){case`uint8`:this.writeUint8(t);break;case`int8`:this.writeInt8(t);break;case`uint16`:this.writeUint16(t,this.endianness);break;case`int16`:this.writeInt16(t,this.endianness);break;case`uint32`:this.writeUint32(t,this.endianness);break;case`int32`:this.writeInt32(t,this.endianness);break;case`float32`:this.writeFloat32(t,this.endianness);break;case`float64`:this.writeFloat64(t,this.endianness);break;case`uint16be`:this.writeUint16(t,r.BIG_ENDIAN);break;case`int16be`:this.writeInt16(t,r.BIG_ENDIAN);break;case`uint32be`:this.writeUint32(t,r.BIG_ENDIAN);break;case`int32be`:this.writeInt32(t,r.BIG_ENDIAN);break;case`float32be`:this.writeFloat32(t,r.BIG_ENDIAN);break;case`float64be`:this.writeFloat64(t,r.BIG_ENDIAN);break;case`uint16le`:this.writeUint16(t,r.LITTLE_ENDIAN);break;case`int16le`:this.writeInt16(t,r.LITTLE_ENDIAN);break;case`uint32le`:this.writeUint32(t,r.LITTLE_ENDIAN);break;case`int32le`:this.writeInt32(t,r.LITTLE_ENDIAN);break;case`float32le`:this.writeFloat32(t,r.LITTLE_ENDIAN);break;case`float64le`:this.writeFloat64(t,r.LITTLE_ENDIAN);break;case`cstring`:this.writeCString(t,o);break;case`string`:this.writeString(t,s,o);break;case`u16string`:this.writeUCS2String(t,this.endianness,o);break;case`u16stringle`:this.writeUCS2String(t,r.LITTLE_ENDIAN,o);break;case`u16stringbe`:this.writeUCS2String(t,r.BIG_ENDIAN,o);break;default:if(e.length==3){for(var l=e[1],u=0;u<t.length;u++)this.writeType(l,t[u]);break}else{this.writeStruct(e,t);break}}o!=null&&(this.position=c,this._realloc(o),this.position=c+o)},r.prototype.writeUint64=function(e){var t=Math.floor(e/a);this.writeUint32(t),this.writeUint32(e&4294967295)},r.prototype.writeUint24=function(e){this.writeUint8((e&16711680)>>16),this.writeUint8((e&65280)>>8),this.writeUint8(e&255)},r.prototype.adjustUint32=function(e,t){var n=this.position;this.seek(e),this.writeUint32(t),this.seek(n)},r.prototype.mapInt32Array=function(e,t){this._realloc(e*4);var n=new Int32Array(this._buffer,this.byteOffset+this.position,e);return r.arrayToNative(n,t??this.endianness),this.position+=e*4,n},r.prototype.mapInt16Array=function(e,t){this._realloc(e*2);var n=new Int16Array(this._buffer,this.byteOffset+this.position,e);return r.arrayToNative(n,t??this.endianness),this.position+=e*2,n},r.prototype.mapInt8Array=function(e){this._realloc(e*1);var t=new Int8Array(this._buffer,this.byteOffset+this.position,e);return this.position+=e*1,t},r.prototype.mapUint32Array=function(e,t){this._realloc(e*4);var n=new Uint32Array(this._buffer,this.byteOffset+this.position,e);return r.arrayToNative(n,t??this.endianness),this.position+=e*4,n},r.prototype.mapUint16Array=function(e,t){this._realloc(e*2);var n=new Uint16Array(this._buffer,this.byteOffset+this.position,e);return r.arrayToNative(n,t??this.endianness),this.position+=e*2,n},r.prototype.mapFloat64Array=function(e,t){this._realloc(e*8);var n=new Float64Array(this._buffer,this.byteOffset+this.position,e);return r.arrayToNative(n,t??this.endianness),this.position+=e*8,n},r.prototype.mapFloat32Array=function(e,t){this._realloc(e*4);var n=new Float32Array(this._buffer,this.byteOffset+this.position,e);return r.arrayToNative(n,t??this.endianness),this.position+=e*4,n};var o=function(e){this.buffers=[],this.bufferIndex=-1,e&&(this.insertBuffer(e),this.bufferIndex=0)};o.prototype=new r(new ArrayBuffer,0,r.BIG_ENDIAN),o.prototype.initialized=function(){var e;return this.bufferIndex>-1?!0:this.buffers.length>0?(e=this.buffers[0],e.fileStart===0?(this.buffer=e,this.bufferIndex=0,t.debug(`MultiBufferStream`,`Stream ready for parsing`),!0):(t.warn(`MultiBufferStream`,`The first buffer should have a fileStart of 0`),this.logBufferLevel(),!1)):(t.warn(`MultiBufferStream`,`No buffer to start parsing from`),this.logBufferLevel(),!1)},ArrayBuffer.concat=function(e,n){t.debug(`ArrayBuffer`,`Trying to create a new buffer of size: `+(e.byteLength+n.byteLength));var r=new Uint8Array(e.byteLength+n.byteLength);return r.set(new Uint8Array(e),0),r.set(new Uint8Array(n),e.byteLength),r.buffer},o.prototype.reduceBuffer=function(e,t,n){var r=new Uint8Array(n);return r.set(new Uint8Array(e,t,n)),r.buffer.fileStart=e.fileStart+t,r.buffer.usedBytes=0,r.buffer},o.prototype.insertBuffer=function(e){for(var n=!0,r=0;r<this.buffers.length;r++){var a=this.buffers[r];if(e.fileStart<=a.fileStart){if(e.fileStart===a.fileStart)if(e.byteLength>a.byteLength){this.buffers.splice(r,1),r--;continue}else t.warn(`MultiBufferStream`,`Buffer (fileStart: `+e.fileStart+` - Length: `+e.byteLength+`) already appended, ignoring`);else e.fileStart+e.byteLength<=a.fileStart||(e=this.reduceBuffer(e,0,a.fileStart-e.fileStart)),t.debug(`MultiBufferStream`,`Appending new buffer (fileStart: `+e.fileStart+` - Length: `+e.byteLength+`)`),this.buffers.splice(r,0,e),r===0&&(this.buffer=e);n=!1;break}else if(e.fileStart<a.fileStart+a.byteLength){var o=a.fileStart+a.byteLength-e.fileStart,s=e.byteLength-o;if(s>0)e=this.reduceBuffer(e,o,s);else{n=!1;break}}}n&&(t.debug(`MultiBufferStream`,`Appending new buffer (fileStart: `+e.fileStart+` - Length: `+e.byteLength+`)`),this.buffers.push(e),r===0&&(this.buffer=e))},o.prototype.logBufferLevel=function(e){var n,r,a,o,s=[],c,l=``;for(a=0,o=0,n=0;n<this.buffers.length;n++)r=this.buffers[n],n===0?(c={},s.push(c),c.start=r.fileStart,c.end=r.fileStart+r.byteLength,l+=`[`+c.start+`-`):c.end===r.fileStart?c.end=r.fileStart+r.byteLength:(c={},c.start=r.fileStart,l+=s[s.length-1].end-1+`], [`+c.start+`-`,c.end=r.fileStart+r.byteLength,s.push(c)),a+=r.usedBytes,o+=r.byteLength;s.length>0&&(l+=c.end-1+`]`);var u=e?t.info:t.debug;this.buffers.length===0?u(`MultiBufferStream`,`No more buffer in memory`):u(`MultiBufferStream`,``+this.buffers.length+` stored buffer(s) (`+a+`/`+o+` bytes), continuous ranges: `+l)},o.prototype.cleanBuffers=function(){var e,n;for(e=0;e<this.buffers.length;e++)n=this.buffers[e],n.usedBytes===n.byteLength&&(t.debug(`MultiBufferStream`,`Removing buffer #`+e),this.buffers.splice(e,1),e--)},o.prototype.mergeNextBuffer=function(){var e;if(this.bufferIndex+1<this.buffers.length)if(e=this.buffers[this.bufferIndex+1],e.fileStart===this.buffer.fileStart+this.buffer.byteLength){var n=this.buffer.byteLength,r=this.buffer.usedBytes,a=this.buffer.fileStart;return this.buffers[this.bufferIndex]=ArrayBuffer.concat(this.buffer,e),this.buffer=this.buffers[this.bufferIndex],this.buffers.splice(this.bufferIndex+1,1),this.buffer.usedBytes=r,this.buffer.fileStart=a,t.debug(`ISOFile`,`Concatenating buffer for box parsing (length: `+n+`->`+this.buffer.byteLength+`)`),!0}else return!1;else return!1},o.prototype.findPosition=function(e,n,r){var a,o=null,s=-1;for(a=e===!0?0:this.bufferIndex;a<this.buffers.length&&(o=this.buffers[a],o.fileStart<=n);)s=a,r&&(o.fileStart+o.byteLength<=n?o.usedBytes=o.byteLength:o.usedBytes=n-o.fileStart,this.logBufferLevel()),a++;return s===-1?-1:(o=this.buffers[s],o.fileStart+o.byteLength>=n?(t.debug(`MultiBufferStream`,`Found position in existing buffer #`+s),s):-1)},o.prototype.findEndContiguousBuf=function(e){var t,n,r,a=e===void 0?this.bufferIndex:e;if(n=this.buffers[a],this.buffers.length>a+1)for(t=a+1;t<this.buffers.length&&(r=this.buffers[t],r.fileStart===n.fileStart+n.byteLength);t++)n=r;return n.fileStart+n.byteLength},o.prototype.getEndFilePositionAfter=function(e){var t=this.findPosition(!0,e,!1);return t===-1?e:this.findEndContiguousBuf(t)},o.prototype.addUsedBytes=function(e){this.buffer.usedBytes+=e,this.logBufferLevel()},o.prototype.setAllUsedBytes=function(){this.buffer.usedBytes=this.buffer.byteLength,this.logBufferLevel()},o.prototype.seek=function(e,n,r){var a=this.findPosition(n,e,r);return a===-1?(t.debug(`MultiBufferStream`,`Position `+e+` not found in buffered data`),!1):(this.buffer=this.buffers[a],this.bufferIndex=a,this.position=e-this.buffer.fileStart,t.debug(`MultiBufferStream`,`Repositioning parser at buffer position: `+this.position),!0)},o.prototype.getPosition=function(){if(this.bufferIndex===-1||this.buffers[this.bufferIndex]===null)throw`Error accessing position in the MultiBufferStream`;return this.buffers[this.bufferIndex].fileStart+this.position},o.prototype.getLength=function(){return this.byteLength},o.prototype.getEndPosition=function(){if(this.bufferIndex===-1||this.buffers[this.bufferIndex]===null)throw`Error accessing position in the MultiBufferStream`;return this.buffers[this.bufferIndex].fileStart+this.byteLength},e!==void 0&&(e.MultiBufferStream=o);var s=function(){var e=3,n=4,r=5,a=6,o=[];o[e]=`ES_Descriptor`,o[n]=`DecoderConfigDescriptor`,o[r]=`DecoderSpecificInfo`,o[a]=`SLConfigDescriptor`,this.getDescriptorName=function(e){return o[e]};var s=this,c={};return this.parseOneDescriptor=function(e){var n=0,r=0,a=e.readUint8(),s,l;for(n++,l=e.readUint8(),n++;l&128;)r=(r<<7)+(l&127),l=e.readUint8(),n++;return r=(r<<7)+(l&127),t.debug(`MPEG4DescriptorParser`,`Found `+(o[a]||`Descriptor `+a)+`, size `+r+` at position `+e.getPosition()),s=o[a]?new c[o[a]](r):new c.Descriptor(r),s.parse(e),s},c.Descriptor=function(e,t){this.tag=e,this.size=t,this.descs=[]},c.Descriptor.prototype.parse=function(e){this.data=e.readUint8Array(this.size)},c.Descriptor.prototype.findDescriptor=function(e){for(var t=0;t<this.descs.length;t++)if(this.descs[t].tag==e)return this.descs[t];return null},c.Descriptor.prototype.parseRemainingDescriptors=function(e){for(var t=e.position;e.position<t+this.size;){var n=s.parseOneDescriptor(e);this.descs.push(n)}},c.ES_Descriptor=function(t){c.Descriptor.call(this,e,t)},c.ES_Descriptor.prototype=new c.Descriptor,c.ES_Descriptor.prototype.parse=function(e){if(this.ES_ID=e.readUint16(),this.flags=e.readUint8(),this.size-=3,this.flags&128?(this.dependsOn_ES_ID=e.readUint16(),this.size-=2):this.dependsOn_ES_ID=0,this.flags&64){var t=e.readUint8();this.URL=e.readString(t),this.size-=t+1}else this.URL=``;this.flags&32?(this.OCR_ES_ID=e.readUint16(),this.size-=2):this.OCR_ES_ID=0,this.parseRemainingDescriptors(e)},c.ES_Descriptor.prototype.getOTI=function(e){var t=this.findDescriptor(n);return t?t.oti:0},c.ES_Descriptor.prototype.getAudioConfig=function(e){var t=this.findDescriptor(n);if(!t)return null;var a=t.findDescriptor(r);if(a&&a.data){var o=(a.data[0]&248)>>3;return o===31&&a.data.length>=2&&(o=32+((a.data[0]&7)<<3)+((a.data[1]&224)>>5)),o}else return null},c.DecoderConfigDescriptor=function(e){c.Descriptor.call(this,n,e)},c.DecoderConfigDescriptor.prototype=new c.Descriptor,c.DecoderConfigDescriptor.prototype.parse=function(e){this.oti=e.readUint8(),this.streamType=e.readUint8(),this.upStream=(this.streamType>>1&1)!=0,this.streamType>>>=2,this.bufferSize=e.readUint24(),this.maxBitrate=e.readUint32(),this.avgBitrate=e.readUint32(),this.size-=13,this.parseRemainingDescriptors(e)},c.DecoderSpecificInfo=function(e){c.Descriptor.call(this,r,e)},c.DecoderSpecificInfo.prototype=new c.Descriptor,c.SLConfigDescriptor=function(e){c.Descriptor.call(this,a,e)},c.SLConfigDescriptor.prototype=new c.Descriptor,this};e!==void 0&&(e.MPEG4DescriptorParser=s);var c={ERR_INVALID_DATA:-1,ERR_NOT_ENOUGH_DATA:0,OK:1,BASIC_BOXES:[{type:`mdat`,name:`MediaDataBox`},{type:`idat`,name:`ItemDataBox`},{type:`free`,name:`FreeSpaceBox`},{type:`skip`,name:`FreeSpaceBox`},{type:`meco`,name:`AdditionalMetadataContainerBox`},{type:`strk`,name:`SubTrackBox`}],FULL_BOXES:[{type:`hmhd`,name:`HintMediaHeaderBox`},{type:`nmhd`,name:`NullMediaHeaderBox`},{type:`iods`,name:`ObjectDescriptorBox`},{type:`xml `,name:`XMLBox`},{type:`bxml`,name:`BinaryXMLBox`},{type:`ipro`,name:`ItemProtectionBox`},{type:`mere`,name:`MetaboxRelationBox`}],CONTAINER_BOXES:[[{type:`moov`,name:`CompressedMovieBox`},[`trak`,`pssh`]],[{type:`trak`,name:`TrackBox`}],[{type:`edts`,name:`EditBox`}],[{type:`mdia`,name:`MediaBox`}],[{type:`minf`,name:`MediaInformationBox`}],[{type:`dinf`,name:`DataInformationBox`}],[{type:`stbl`,name:`SampleTableBox`},[`sgpd`,`sbgp`]],[{type:`mvex`,name:`MovieExtendsBox`},[`trex`]],[{type:`moof`,name:`CompressedMovieFragmentBox`},[`traf`]],[{type:`traf`,name:`TrackFragmentBox`},[`trun`,`sgpd`,`sbgp`]],[{type:`vttc`,name:`VTTCueBox`}],[{type:`tref`,name:`TrackReferenceBox`}],[{type:`iref`,name:`ItemReferenceBox`}],[{type:`mfra`,name:`MovieFragmentRandomAccessBox`},[`tfra`]],[{type:`meco`,name:`AdditionalMetadataContainerBox`}],[{type:`hnti`,name:`trackhintinformation`}],[{type:`hinf`,name:`hintstatisticsbox`}],[{type:`strk`,name:`SubTrackBox`}],[{type:`strd`,name:`SubTrackDefinitionBox`}],[{type:`sinf`,name:`ProtectionSchemeInfoBox`}],[{type:`rinf`,name:`RestrictedSchemeInfoBox`}],[{type:`schi`,name:`SchemeInformationBox`}],[{type:`trgr`,name:`TrackGroupBox`}],[{type:`udta`,name:`UserDataBox`},[`kind`]],[{type:`iprp`,name:`ItemPropertiesBox`},[`ipma`]],[{type:`ipco`,name:`ItemPropertyContainerBox`}],[{type:`grpl`,name:`GroupsListBox`}],[{type:`j2kH`,name:`J2KHeaderInfoBox`}],[{type:`etyp`,name:`ExtendedTypeBox`},[`tyco`]]],boxCodes:[],fullBoxCodes:[],containerBoxCodes:[],sampleEntryCodes:{},sampleGroupEntryCodes:[],trackGroupTypes:[],UUIDBoxes:{},UUIDs:[],initialize:function(){c.FullBox.prototype=new c.Box,c.ContainerBox.prototype=new c.Box,c.SampleEntry.prototype=new c.Box,c.TrackGroupTypeBox.prototype=new c.FullBox,c.BASIC_BOXES.forEach(function(e){c.createBoxCtor(e.type,e.name)}),c.FULL_BOXES.forEach(function(e){c.createFullBoxCtor(e.type,e.name)}),c.CONTAINER_BOXES.forEach(function(e){c.createContainerBoxCtor(e[0].type,e[0].name,null,e[1])})},Box:function(e,t,n,r){this.type=e,this.box_name=n,this.size=t,this.uuid=r},FullBox:function(e,t,n,r){c.Box.call(this,e,t,n,r),this.flags=0,this.version=0},ContainerBox:function(e,t,n,r){c.Box.call(this,e,t,n,r),this.boxes=[]},SampleEntry:function(e,t,n,r){c.ContainerBox.call(this,e,t),this.hdr_size=n,this.start=r},SampleGroupEntry:function(e){this.grouping_type=e},TrackGroupTypeBox:function(e,t){c.FullBox.call(this,e,t)},createBoxCtor:function(e,t,n){c.boxCodes.push(e),c[e+`Box`]=function(n){c.Box.call(this,e,n,t)},c[e+`Box`].prototype=new c.Box,n&&(c[e+`Box`].prototype.parse=n)},createFullBoxCtor:function(e,t,n){c[e+`Box`]=function(n){c.FullBox.call(this,e,n,t)},c[e+`Box`].prototype=new c.FullBox,c[e+`Box`].prototype.parse=function(e){this.parseFullHeader(e),n&&n.call(this,e)}},addSubBoxArrays:function(e){if(e){this.subBoxNames=e;for(var t=e.length,n=0;n<t;n++)this[e[n]+`s`]=[]}},createContainerBoxCtor:function(e,t,n,r){c[e+`Box`]=function(n){c.ContainerBox.call(this,e,n,t),c.addSubBoxArrays.call(this,r)},c[e+`Box`].prototype=new c.ContainerBox,n&&(c[e+`Box`].prototype.parse=n)},createMediaSampleEntryCtor:function(e,t,n){c.sampleEntryCodes[e]=[],c[e+`SampleEntry`]=function(e,t){c.SampleEntry.call(this,e,t),c.addSubBoxArrays.call(this,n)},c[e+`SampleEntry`].prototype=new c.SampleEntry,t&&(c[e+`SampleEntry`].prototype.parse=t)},createSampleEntryCtor:function(e,t,n,r){c.sampleEntryCodes[e].push(t),c[t+`SampleEntry`]=function(n){c[e+`SampleEntry`].call(this,t,n),c.addSubBoxArrays.call(this,r)},c[t+`SampleEntry`].prototype=new c[e+`SampleEntry`],n&&(c[t+`SampleEntry`].prototype.parse=n)},createEncryptedSampleEntryCtor:function(e,t,n){c.createSampleEntryCtor.call(this,e,t,n,[`sinf`])},createSampleGroupCtor:function(e,t){c[e+`SampleGroupEntry`]=function(t){c.SampleGroupEntry.call(this,e,t)},c[e+`SampleGroupEntry`].prototype=new c.SampleGroupEntry,t&&(c[e+`SampleGroupEntry`].prototype.parse=t)},createTrackGroupCtor:function(e,t){c[e+`TrackGroupTypeBox`]=function(t){c.TrackGroupTypeBox.call(this,e,t)},c[e+`TrackGroupTypeBox`].prototype=new c.TrackGroupTypeBox,t&&(c[e+`TrackGroupTypeBox`].prototype.parse=t)},createUUIDBox:function(e,t,n,r,a){c.UUIDs.push(e),c.UUIDBoxes[e]=function(a){n?c.FullBox.call(this,`uuid`,a,t,e):r?c.ContainerBox.call(this,`uuid`,a,t,e):c.Box.call(this,`uuid`,a,t,e)},c.UUIDBoxes[e].prototype=n?new c.FullBox:r?new c.ContainerBox:new c.Box,a&&(n?c.UUIDBoxes[e].prototype.parse=function(e){this.parseFullHeader(e),a&&a.call(this,e)}:c.UUIDBoxes[e].prototype.parse=a)}};c.initialize(),c.TKHD_FLAG_ENABLED=1,c.TKHD_FLAG_IN_MOVIE=2,c.TKHD_FLAG_IN_PREVIEW=4,c.TFHD_FLAG_BASE_DATA_OFFSET=1,c.TFHD_FLAG_SAMPLE_DESC=2,c.TFHD_FLAG_SAMPLE_DUR=8,c.TFHD_FLAG_SAMPLE_SIZE=16,c.TFHD_FLAG_SAMPLE_FLAGS=32,c.TFHD_FLAG_DUR_EMPTY=65536,c.TFHD_FLAG_DEFAULT_BASE_IS_MOOF=131072,c.TRUN_FLAGS_DATA_OFFSET=1,c.TRUN_FLAGS_FIRST_FLAG=4,c.TRUN_FLAGS_DURATION=256,c.TRUN_FLAGS_SIZE=512,c.TRUN_FLAGS_FLAGS=1024,c.TRUN_FLAGS_CTS_OFFSET=2048,c.Box.prototype.add=function(e){return this.addBox(new c[e+`Box`])},c.Box.prototype.addBox=function(e){return this.boxes.push(e),this[e.type+`s`]?this[e.type+`s`].push(e):this[e.type]=e,e},c.Box.prototype.set=function(e,t){return this[e]=t,this},c.Box.prototype.addEntry=function(e,t){var n=t||`entries`;return this[n]||(this[n]=[]),this[n].push(e),this},e!==void 0&&(e.BoxParser=c),c.parseUUID=function(e){return c.parseHex16(e)},c.parseHex16=function(e){for(var t=``,n=0;n<16;n++){var r=e.readUint8().toString(16);t+=r.length===1?`0`+r:r}return t},c.parseOneBox=function(e,n,r){var a,o=e.getPosition(),s=0,l,u;if(e.getEndPosition()-o<8)return t.debug(`BoxParser`,`Not enough data in stream to parse the type and size of the box`),{code:c.ERR_NOT_ENOUGH_DATA};if(r&&r<8)return t.debug(`BoxParser`,`Not enough bytes left in the parent box to parse a new box`),{code:c.ERR_NOT_ENOUGH_DATA};var d=e.readUint32(),f=e.readString(4),p=f;if(t.debug(`BoxParser`,`Found box of type '`+f+`' and size `+d+` at position `+o),s=8,f==`uuid`){if(e.getEndPosition()-e.getPosition()<16||r-s<16)return e.seek(o),t.debug(`BoxParser`,`Not enough bytes left in the parent box to parse a UUID box`),{code:c.ERR_NOT_ENOUGH_DATA};u=c.parseUUID(e),s+=16,p=u}if(d==1){if(e.getEndPosition()-e.getPosition()<8||r&&r-s<8)return e.seek(o),t.warn(`BoxParser`,`Not enough data in stream to parse the extended size of the "`+f+`" box`),{code:c.ERR_NOT_ENOUGH_DATA};d=e.readUint64(),s+=8}else if(d===0){if(r)d=r;else if(f!==`mdat`)return t.error(`BoxParser`,`Unlimited box size not supported for type: '`+f+`'`),a=new c.Box(f,d),{code:c.OK,box:a,size:a.size}}return d!==0&&d<s?(t.error(`BoxParser`,`Box of type `+f+` has an invalid size `+d+` (too small to be a box)`),{code:c.ERR_NOT_ENOUGH_DATA,type:f,size:d,hdr_size:s,start:o}):d!==0&&r&&d>r?(t.error(`BoxParser`,`Box of type '`+f+`' has a size `+d+` greater than its container size `+r),{code:c.ERR_NOT_ENOUGH_DATA,type:f,size:d,hdr_size:s,start:o}):d!==0&&o+d>e.getEndPosition()?(e.seek(o),t.info(`BoxParser`,`Not enough data in stream to parse the entire '`+f+`' box`),{code:c.ERR_NOT_ENOUGH_DATA,type:f,size:d,hdr_size:s,start:o}):n?{code:c.OK,type:f,size:d,hdr_size:s,start:o}:(c[f+`Box`]?a=new c[f+`Box`](d):f===`uuid`?c.UUIDBoxes[u]?a=new c.UUIDBoxes[u](d):(t.warn(`BoxParser`,`Unknown uuid type: '`+u+`'`),a=new c.Box(f,d),a.uuid=u,a.has_unparsed_data=!0):(t.warn(`BoxParser`,`Unknown box type: '`+f+`'`),a=new c.Box(f,d),a.has_unparsed_data=!0),a.hdr_size=s,a.start=o,a.write===c.Box.prototype.write&&a.type!==`mdat`&&(t.info(`BoxParser`,`'`+p+`' box writing not yet implemented, keeping unparsed data in memory for later write`),a.parseDataAndRewind(e)),a.parse(e),l=e.getPosition()-(a.start+a.size),l<0?(t.warn(`BoxParser`,`Parsing of box '`+p+`' did not read the entire indicated box data size (missing `+-l+` bytes), seeking forward`),e.seek(a.start+a.size)):l>0&&(t.error(`BoxParser`,`Parsing of box '`+p+`' read `+l+` more bytes than the indicated box data size, seeking backwards`),a.size!==0&&e.seek(a.start+a.size)),{code:c.OK,box:a,size:a.size})},c.Box.prototype.parse=function(e){this.type==`mdat`?this.size===0?e.seek(e.getEndPosition()):e.seek(this.start+this.size):this.data=e.readUint8Array(this.size-this.hdr_size)},c.Box.prototype.parseDataAndRewind=function(e){this.data=e.readUint8Array(this.size-this.hdr_size),e.position-=this.size-this.hdr_size},c.FullBox.prototype.parseDataAndRewind=function(e){this.parseFullHeader(e),this.data=e.readUint8Array(this.size-this.hdr_size),this.hdr_size-=4,e.position-=this.size-this.hdr_size},c.FullBox.prototype.parseFullHeader=function(e){this.version=e.readUint8(),this.flags=e.readUint24(),this.hdr_size+=4},c.FullBox.prototype.parse=function(e){this.parseFullHeader(e),this.data=e.readUint8Array(this.size-this.hdr_size)},c.ContainerBox.prototype.parse=function(e){for(var n,r;e.getPosition()<this.start+this.size;)if(n=c.parseOneBox(e,!1,this.size-(e.getPosition()-this.start)),n.code===c.OK)if(r=n.box,this.boxes.push(r),this.subBoxNames&&this.subBoxNames.indexOf(r.type)!=-1)this[this.subBoxNames[this.subBoxNames.indexOf(r.type)]+`s`].push(r);else{var a=r.type===`uuid`?r.uuid:r.type;this[a]?t.warn(`Box of type `+a+` already stored in field of this type`):this[a]=r}else return},c.Box.prototype.parseLanguage=function(e){this.language=e.readUint16();var t=[];t[0]=this.language>>10&31,t[1]=this.language>>5&31,t[2]=this.language&31,this.languageString=String.fromCharCode(t[0]+96,t[1]+96,t[2]+96)},c.SAMPLE_ENTRY_TYPE_VISUAL=`Visual`,c.SAMPLE_ENTRY_TYPE_AUDIO=`Audio`,c.SAMPLE_ENTRY_TYPE_HINT=`Hint`,c.SAMPLE_ENTRY_TYPE_METADATA=`Metadata`,c.SAMPLE_ENTRY_TYPE_SUBTITLE=`Subtitle`,c.SAMPLE_ENTRY_TYPE_SYSTEM=`System`,c.SAMPLE_ENTRY_TYPE_TEXT=`Text`,c.SampleEntry.prototype.parseHeader=function(e){e.readUint8Array(6),this.data_reference_index=e.readUint16(),this.hdr_size+=8},c.SampleEntry.prototype.parse=function(e){this.parseHeader(e),this.data=e.readUint8Array(this.size-this.hdr_size)},c.SampleEntry.prototype.parseDataAndRewind=function(e){this.parseHeader(e),this.data=e.readUint8Array(this.size-this.hdr_size),this.hdr_size-=8,e.position-=this.size-this.hdr_size},c.SampleEntry.prototype.parseFooter=function(e){c.ContainerBox.prototype.parse.call(this,e)},c.createMediaSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_HINT),c.createMediaSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_METADATA),c.createMediaSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_SUBTITLE),c.createMediaSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_SYSTEM),c.createMediaSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_TEXT),c.createMediaSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_VISUAL,function(e){var t;this.parseHeader(e),e.readUint16(),e.readUint16(),e.readUint32Array(3),this.width=e.readUint16(),this.height=e.readUint16(),this.horizresolution=e.readUint32(),this.vertresolution=e.readUint32(),e.readUint32(),this.frame_count=e.readUint16(),t=Math.min(31,e.readUint8()),this.compressorname=e.readString(t),t<31&&e.readString(31-t),this.depth=e.readUint16(),e.readUint16(),this.parseFooter(e)}),c.createMediaSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_AUDIO,function(e){this.parseHeader(e),e.readUint32Array(2),this.channel_count=e.readUint16(),this.samplesize=e.readUint16(),e.readUint16(),e.readUint16(),this.samplerate=e.readUint32()/65536,this.parseFooter(e)}),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_VISUAL,`avc1`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_VISUAL,`avc2`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_VISUAL,`avc3`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_VISUAL,`avc4`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_VISUAL,`av01`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_VISUAL,`dav1`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_VISUAL,`hvc1`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_VISUAL,`hev1`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_VISUAL,`hvt1`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_VISUAL,`lhe1`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_VISUAL,`dvh1`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_VISUAL,`dvhe`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_VISUAL,`vvc1`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_VISUAL,`vvi1`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_VISUAL,`vvs1`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_VISUAL,`vvcN`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_VISUAL,`vp08`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_VISUAL,`vp09`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_VISUAL,`avs3`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_VISUAL,`j2ki`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_VISUAL,`mjp2`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_VISUAL,`mjpg`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_VISUAL,`uncv`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_AUDIO,`mp4a`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_AUDIO,`ac-3`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_AUDIO,`ac-4`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_AUDIO,`ec-3`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_AUDIO,`Opus`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_AUDIO,`mha1`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_AUDIO,`mha2`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_AUDIO,`mhm1`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_AUDIO,`mhm2`),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_AUDIO,`fLaC`),c.createEncryptedSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_VISUAL,`encv`),c.createEncryptedSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_AUDIO,`enca`),c.createEncryptedSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_SUBTITLE,`encu`),c.createEncryptedSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_SYSTEM,`encs`),c.createEncryptedSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_TEXT,`enct`),c.createEncryptedSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_METADATA,`encm`),c.createBoxCtor(`a1lx`,`AV1LayeredImageIndexingProperty`,function(e){var t=((e.readUint8()&1)+1)*16;this.layer_size=[];for(var n=0;n<3;n++)t==16?this.layer_size[n]=e.readUint16():this.layer_size[n]=e.readUint32()}),c.createBoxCtor(`a1op`,`OperatingPointSelectorProperty`,function(e){this.op_index=e.readUint8()}),c.createFullBoxCtor(`auxC`,`AuxiliaryTypeProperty`,function(e){this.aux_type=e.readCString();var t=this.size-this.hdr_size-(this.aux_type.length+1);this.aux_subtype=e.readUint8Array(t)}),c.createBoxCtor(`av1C`,`AV1CodecConfigurationBox`,function(e){var n=e.readUint8();if((n>>7&1)!=1){t.error(`av1C marker problem`);return}if(this.version=n&127,this.version!==1){t.error(`av1C version `+this.version+` not supported`);return}if(n=e.readUint8(),this.seq_profile=n>>5&7,this.seq_level_idx_0=n&31,n=e.readUint8(),this.seq_tier_0=n>>7&1,this.high_bitdepth=n>>6&1,this.twelve_bit=n>>5&1,this.monochrome=n>>4&1,this.chroma_subsampling_x=n>>3&1,this.chroma_subsampling_y=n>>2&1,this.chroma_sample_position=n&3,n=e.readUint8(),this.reserved_1=n>>5&7,this.reserved_1!==0){t.error(`av1C reserved_1 parsing problem`);return}if(this.initial_presentation_delay_present=n>>4&1,this.initial_presentation_delay_present===1)this.initial_presentation_delay_minus_one=n&15;else if(this.reserved_2=n&15,this.reserved_2!==0){t.error(`av1C reserved_2 parsing problem`);return}var r=this.size-this.hdr_size-4;this.configOBUs=e.readUint8Array(r)});function l(e){var t=`<table class='inner-table'>`;t+=`<thead><tr><th>length</th><th>nalu_data</th></tr></thead>`,t+=`<tbody>`;for(var n=0;n<e.length;n++){var r=e[n];t+=`<tr>`,t+=`<td>`+r.length+`</td>`,t+=`<td>`,t+=r.nalu.reduce(function(e,t){return e+t.toString(16).padStart(2,`0`)},`0x`),t+=`</td></tr>`}return t+=`</tbody></table>`,t}c.createBoxCtor(`avcC`,`AVCConfigurationBox`,function(e){var t,n;for(this.configurationVersion=e.readUint8(),this.AVCProfileIndication=e.readUint8(),this.profile_compatibility=e.readUint8(),this.AVCLevelIndication=e.readUint8(),this.lengthSizeMinusOne=e.readUint8()&3,this.nb_SPS_nalus=e.readUint8()&31,n=this.size-this.hdr_size-6,this.SPS=[],this.SPS.toString=function(){return l(this)},t=0;t<this.nb_SPS_nalus;t++)this.SPS[t]={},this.SPS[t].length=e.readUint16(),this.SPS[t].nalu=e.readUint8Array(this.SPS[t].length),n-=2+this.SPS[t].length;for(this.nb_PPS_nalus=e.readUint8(),n--,this.PPS=[],this.PPS.toString=function(){return l(this)},t=0;t<this.nb_PPS_nalus;t++)this.PPS[t]={},this.PPS[t].length=e.readUint16(),this.PPS[t].nalu=e.readUint8Array(this.PPS[t].length),n-=2+this.PPS[t].length;n>0&&(this.ext=e.readUint8Array(n))}),c.createBoxCtor(`btrt`,`BitRateBox`,function(e){this.bufferSizeDB=e.readUint32(),this.maxBitrate=e.readUint32(),this.avgBitrate=e.readUint32()}),c.createFullBoxCtor(`ccst`,`CodingConstraintsBox`,function(e){var t=e.readUint8();this.all_ref_pics_intra=(t&128)==128,this.intra_pred_used=(t&64)==64,this.max_ref_per_pic=(t&63)>>2,e.readUint24()}),c.createBoxCtor(`cdef`,`ComponentDefinitionBox`,function(e){var t;for(this.channel_count=e.readUint16(),this.channel_indexes=[],this.channel_types=[],this.channel_associations=[],t=0;t<this.channel_count;t++)this.channel_indexes.push(e.readUint16()),this.channel_types.push(e.readUint16()),this.channel_associations.push(e.readUint16())}),c.createBoxCtor(`clap`,`CleanApertureBox`,function(e){this.cleanApertureWidthN=e.readUint32(),this.cleanApertureWidthD=e.readUint32(),this.cleanApertureHeightN=e.readUint32(),this.cleanApertureHeightD=e.readUint32(),this.horizOffN=e.readUint32(),this.horizOffD=e.readUint32(),this.vertOffN=e.readUint32(),this.vertOffD=e.readUint32()}),c.createBoxCtor(`clli`,`ContentLightLevelBox`,function(e){this.max_content_light_level=e.readUint16(),this.max_pic_average_light_level=e.readUint16()}),c.createFullBoxCtor(`cmex`,`CameraExtrinsicMatrixProperty`,function(e){this.flags&1&&(this.pos_x=e.readInt32()),this.flags&2&&(this.pos_y=e.readInt32()),this.flags&4&&(this.pos_z=e.readInt32()),this.flags&8&&(this.version==0?this.flags&16?(this.quat_x=e.readInt32(),this.quat_y=e.readInt32(),this.quat_z=e.readInt32()):(this.quat_x=e.readInt16(),this.quat_y=e.readInt16(),this.quat_z=e.readInt16()):this.version),this.flags&32&&(this.id=e.readUint32())}),c.createFullBoxCtor(`cmin`,`CameraIntrinsicMatrixProperty`,function(e){this.focal_length_x=e.readInt32(),this.principal_point_x=e.readInt32(),this.principal_point_y=e.readInt32(),this.flags&1&&(this.focal_length_y=e.readInt32(),this.skew_factor=e.readInt32())}),c.createBoxCtor(`cmpd`,`ComponentDefinitionBox`,function(e){for(this.component_count=e.readUint32(),this.component_types=[],this.component_type_urls=[],i=0;i<this.component_count;i++){var t=e.readUint16();this.component_types.push(t),t>=32768&&this.component_type_urls.push(e.readCString())}}),c.createFullBoxCtor(`co64`,`ChunkLargeOffsetBox`,function(e){var t=e.readUint32(),n;if(this.chunk_offsets=[],this.version===0)for(n=0;n<t;n++)this.chunk_offsets.push(e.readUint64())}),c.createFullBoxCtor(`CoLL`,`ContentLightLevelBox`,function(e){this.maxCLL=e.readUint16(),this.maxFALL=e.readUint16()}),c.createBoxCtor(`colr`,`ColourInformationBox`,function(e){if(this.colour_type=e.readString(4),this.colour_type===`nclx`){this.colour_primaries=e.readUint16(),this.transfer_characteristics=e.readUint16(),this.matrix_coefficients=e.readUint16();var t=e.readUint8();this.full_range_flag=t>>7}else (this.colour_type===`rICC`||this.colour_type===`prof`)&&(this.ICC_profile=e.readUint8Array(this.size-4))}),c.createFullBoxCtor(`cprt`,`CopyrightBox`,function(e){this.parseLanguage(e),this.notice=e.readCString()}),c.createFullBoxCtor(`cslg`,`CompositionToDecodeBox`,function(e){this.version===0&&(this.compositionToDTSShift=e.readInt32(),this.leastDecodeToDisplayDelta=e.readInt32(),this.greatestDecodeToDisplayDelta=e.readInt32(),this.compositionStartTime=e.readInt32(),this.compositionEndTime=e.readInt32())}),c.createFullBoxCtor(`ctts`,`CompositionOffsetBox`,function(e){var n=e.readUint32(),r;if(this.sample_counts=[],this.sample_offsets=[],this.version===0)for(r=0;r<n;r++){this.sample_counts.push(e.readUint32());var a=e.readInt32();a<0&&t.warn(`BoxParser`,`ctts box uses negative values without using version 1`),this.sample_offsets.push(a)}else if(this.version==1)for(r=0;r<n;r++)this.sample_counts.push(e.readUint32()),this.sample_offsets.push(e.readInt32())}),c.createBoxCtor(`dac3`,`AC3SpecificBox`,function(e){var t=e.readUint8(),n=e.readUint8(),r=e.readUint8();this.fscod=t>>6,this.bsid=t>>1&31,this.bsmod=(t&1)<<2|n>>6&3,this.acmod=n>>3&7,this.lfeon=n>>2&1,this.bit_rate_code=n&3|r>>5&7}),c.createBoxCtor(`dec3`,`EC3SpecificBox`,function(e){var t=e.readUint16();this.data_rate=t>>3,this.num_ind_sub=t&7,this.ind_subs=[];for(var n=0;n<this.num_ind_sub+1;n++){var r={};this.ind_subs.push(r);var a=e.readUint8(),o=e.readUint8(),s=e.readUint8();r.fscod=a>>6,r.bsid=a>>1&31,r.bsmod=(a&1)<<4|o>>4&15,r.acmod=o>>1&7,r.lfeon=o&1,r.num_dep_sub=s>>1&15,r.num_dep_sub>0&&(r.chan_loc=(s&1)<<8|e.readUint8())}}),c.createFullBoxCtor(`dfLa`,`FLACSpecificBox`,function(e){var t=127,n=128,r=[],a=[`STREAMINFO`,`PADDING`,`APPLICATION`,`SEEKTABLE`,`VORBIS_COMMENT`,`CUESHEET`,`PICTURE`,`RESERVED`];do{var o=e.readUint8(),s=Math.min(o&t,a.length-1);if(s?e.readUint8Array(e.readUint24()):(e.readUint8Array(13),this.samplerate=e.readUint32()>>12,e.readUint8Array(20)),r.push(a[s]),o&n)break}while(!0);this.numMetadataBlocks=r.length+` (`+r.join(`, `)+`)`}),c.createBoxCtor(`dimm`,`hintimmediateBytesSent`,function(e){this.bytessent=e.readUint64()}),c.createBoxCtor(`dmax`,`hintlongestpacket`,function(e){this.time=e.readUint32()}),c.createBoxCtor(`dmed`,`hintmediaBytesSent`,function(e){this.bytessent=e.readUint64()}),c.createBoxCtor(`dOps`,`OpusSpecificBox`,function(e){if(this.Version=e.readUint8(),this.OutputChannelCount=e.readUint8(),this.PreSkip=e.readUint16(),this.InputSampleRate=e.readUint32(),this.OutputGain=e.readInt16(),this.ChannelMappingFamily=e.readUint8(),this.ChannelMappingFamily!==0){this.StreamCount=e.readUint8(),this.CoupledCount=e.readUint8(),this.ChannelMapping=[];for(var t=0;t<this.OutputChannelCount;t++)this.ChannelMapping[t]=e.readUint8()}}),c.createFullBoxCtor(`dref`,`DataReferenceBox`,function(e){var t,n;this.entries=[];for(var r=e.readUint32(),a=0;a<r;a++)if(t=c.parseOneBox(e,!1,this.size-(e.getPosition()-this.start)),t.code===c.OK)n=t.box,this.entries.push(n);else return}),c.createBoxCtor(`drep`,`hintrepeatedBytesSent`,function(e){this.bytessent=e.readUint64()}),c.createFullBoxCtor(`elng`,`ExtendedLanguageBox`,function(e){this.extended_language=e.readString(this.size-this.hdr_size)}),c.createFullBoxCtor(`elst`,`EditListBox`,function(e){this.entries=[];for(var t=e.readUint32(),n=0;n<t;n++){var r={};this.entries.push(r),this.version===1?(r.segment_duration=e.readUint64(),r.media_time=e.readInt64()):(r.segment_duration=e.readUint32(),r.media_time=e.readInt32()),r.media_rate_integer=e.readInt16(),r.media_rate_fraction=e.readInt16()}}),c.createFullBoxCtor(`emsg`,`EventMessageBox`,function(e){this.version==1?(this.timescale=e.readUint32(),this.presentation_time=e.readUint64(),this.event_duration=e.readUint32(),this.id=e.readUint32(),this.scheme_id_uri=e.readCString(),this.value=e.readCString()):(this.scheme_id_uri=e.readCString(),this.value=e.readCString(),this.timescale=e.readUint32(),this.presentation_time_delta=e.readUint32(),this.event_duration=e.readUint32(),this.id=e.readUint32());var t=this.size-this.hdr_size-(16+(this.scheme_id_uri.length+1)+(this.value.length+1));this.version==1&&(t-=4),this.message_data=e.readUint8Array(t)}),c.createEntityToGroupCtor=function(e,t){c[e+`Box`]=function(t){c.FullBox.call(this,e,t)},c[e+`Box`].prototype=new c.FullBox,c[e+`Box`].prototype.parse=function(e){if(this.parseFullHeader(e),t)t.call(this,e);else for(this.group_id=e.readUint32(),this.num_entities_in_group=e.readUint32(),this.entity_ids=[],i=0;i<this.num_entities_in_group;i++){var n=e.readUint32();this.entity_ids.push(n)}}},c.createEntityToGroupCtor(`aebr`),c.createEntityToGroupCtor(`afbr`),c.createEntityToGroupCtor(`albc`),c.createEntityToGroupCtor(`altr`),c.createEntityToGroupCtor(`brst`),c.createEntityToGroupCtor(`dobr`),c.createEntityToGroupCtor(`eqiv`),c.createEntityToGroupCtor(`favc`),c.createEntityToGroupCtor(`fobr`),c.createEntityToGroupCtor(`iaug`),c.createEntityToGroupCtor(`pano`),c.createEntityToGroupCtor(`slid`),c.createEntityToGroupCtor(`ster`),c.createEntityToGroupCtor(`tsyn`),c.createEntityToGroupCtor(`wbbr`),c.createEntityToGroupCtor(`prgr`),c.createEntityToGroupCtor(`pymd`,function(e){this.group_id=e.readUint32(),this.num_entities_in_group=e.readUint32(),this.entity_ids=[];for(var t=0;t<this.num_entities_in_group;t++){var n=e.readUint32();this.entity_ids.push(n)}for(this.tile_size_x=e.readUint16(),this.tile_size_y=e.readUint16(),this.layer_binning=[],this.tiles_in_layer_column_minus1=[],this.tiles_in_layer_row_minus1=[],t=0;t<this.num_entities_in_group;t++)this.layer_binning[t]=e.readUint16(),this.tiles_in_layer_row_minus1[t]=e.readUint16(),this.tiles_in_layer_column_minus1[t]=e.readUint16()}),c.createFullBoxCtor(`esds`,`ElementaryStreamDescriptorBox`,function(e){var t=e.readUint8Array(this.size-this.hdr_size);if(s!==void 0){var n=new s;this.esd=n.parseOneDescriptor(new r(t.buffer,0,r.BIG_ENDIAN))}}),c.createBoxCtor(`fiel`,`FieldHandlingBox`,function(e){this.fieldCount=e.readUint8(),this.fieldOrdering=e.readUint8()}),c.createBoxCtor(`frma`,`OriginalFormatBox`,function(e){this.data_format=e.readString(4)}),c.createBoxCtor(`ftyp`,`FileTypeBox`,function(e){var t=this.size-this.hdr_size;this.major_brand=e.readString(4),this.minor_version=e.readUint32(),t-=8,this.compatible_brands=[];for(var n=0;t>=4;)this.compatible_brands[n]=e.readString(4),t-=4,n++}),c.createFullBoxCtor(`hdlr`,`HandlerBox`,function(e){this.version===0&&(e.readUint32(),this.handler=e.readString(4),e.readUint32Array(3),this.name=e.readString(this.size-this.hdr_size-20),this.name[this.name.length-1]===`\0`&&(this.name=this.name.slice(0,-1)))}),c.createBoxCtor(`hvcC`,`HEVCConfigurationBox`,function(e){var t,n,r,a;this.configurationVersion=e.readUint8(),a=e.readUint8(),this.general_profile_space=a>>6,this.general_tier_flag=(a&32)>>5,this.general_profile_idc=a&31,this.general_profile_compatibility=e.readUint32(),this.general_constraint_indicator=e.readUint8Array(6),this.general_level_idc=e.readUint8(),this.min_spatial_segmentation_idc=e.readUint16()&4095,this.parallelismType=e.readUint8()&3,this.chroma_format_idc=e.readUint8()&3,this.bit_depth_luma_minus8=e.readUint8()&7,this.bit_depth_chroma_minus8=e.readUint8()&7,this.avgFrameRate=e.readUint16(),a=e.readUint8(),this.constantFrameRate=a>>6,this.numTemporalLayers=(a&13)>>3,this.temporalIdNested=(a&4)>>2,this.lengthSizeMinusOne=a&3,this.nalu_arrays=[],this.nalu_arrays.toString=function(){var e=`<table class='inner-table'>`;e+=`<thead><tr><th>completeness</th><th>nalu_type</th><th>nalu_data</th></tr></thead>`,e+=`<tbody>`;for(var t=0;t<this.length;t++){var n=this[t];e+=`<tr>`,e+=`<td rowspan='`+n.length+`'>`+n.completeness+`</td>`,e+=`<td rowspan='`+n.length+`'>`+n.nalu_type+`</td>`;for(var r=0;r<n.length;r++){var a=n[r];r!==0&&(e+=`<tr>`),e+=`<td>`,e+=a.data.reduce(function(e,t){return e+t.toString(16).padStart(2,`0`)},`0x`),e+=`</td></tr>`}}return e+=`</tbody></table>`,e};var o=e.readUint8();for(t=0;t<o;t++){var s=[];this.nalu_arrays.push(s),a=e.readUint8(),s.completeness=(a&128)>>7,s.nalu_type=a&63;var c=e.readUint16();for(n=0;n<c;n++){var l={};s.push(l),r=e.readUint16(),l.data=e.readUint8Array(r)}}}),c.createFullBoxCtor(`iinf`,`ItemInfoBox`,function(e){var n;this.version===0?this.entry_count=e.readUint16():this.entry_count=e.readUint32(),this.item_infos=[];for(var r=0;r<this.entry_count;r++)if(n=c.parseOneBox(e,!1,this.size-(e.getPosition()-this.start)),n.code===c.OK)n.box.type!==`infe`&&t.error(`BoxParser`,`Expected 'infe' box, got `+n.box.type),this.item_infos[r]=n.box;else return}),c.createFullBoxCtor(`iloc`,`ItemLocationBox`,function(e){var t=e.readUint8();this.offset_size=t>>4&15,this.length_size=t&15,t=e.readUint8(),this.base_offset_size=t>>4&15,this.version===1||this.version===2?this.index_size=t&15:this.index_size=0,this.items=[];var n=0;if(this.version<2)n=e.readUint16();else if(this.version===2)n=e.readUint32();else throw`version of iloc box not supported`;for(var r=0;r<n;r++){var a={};if(this.items.push(a),this.version<2)a.item_ID=e.readUint16();else if(this.version===2)a.item_ID=e.readUint32();else throw`version of iloc box not supported`;switch(this.version===1||this.version===2?a.construction_method=e.readUint16()&15:a.construction_method=0,a.data_reference_index=e.readUint16(),this.base_offset_size){case 0:a.base_offset=0;break;case 4:a.base_offset=e.readUint32();break;case 8:a.base_offset=e.readUint64();break;default:throw`Error reading base offset size`}var o=e.readUint16();a.extents=[];for(var s=0;s<o;s++){var c={};if(a.extents.push(c),this.version===1||this.version===2)switch(this.index_size){case 0:c.extent_index=0;break;case 4:c.extent_index=e.readUint32();break;case 8:c.extent_index=e.readUint64();break;default:throw`Error reading extent index`}switch(this.offset_size){case 0:c.extent_offset=0;break;case 4:c.extent_offset=e.readUint32();break;case 8:c.extent_offset=e.readUint64();break;default:throw`Error reading extent index`}switch(this.length_size){case 0:c.extent_length=0;break;case 4:c.extent_length=e.readUint32();break;case 8:c.extent_length=e.readUint64();break;default:throw`Error reading extent index`}}}}),c.createBoxCtor(`imir`,`ImageMirror`,function(e){var t=e.readUint8();this.reserved=t>>7,this.axis=t&1}),c.createFullBoxCtor(`infe`,`ItemInfoEntry`,function(e){if((this.version===0||this.version===1)&&(this.item_ID=e.readUint16(),this.item_protection_index=e.readUint16(),this.item_name=e.readCString(),this.content_type=e.readCString(),this.content_encoding=e.readCString()),this.version===1){this.extension_type=e.readString(4),t.warn(`BoxParser`,`Cannot parse extension type`),e.seek(this.start+this.size);return}this.version>=2&&(this.version===2?this.item_ID=e.readUint16():this.version===3&&(this.item_ID=e.readUint32()),this.item_protection_index=e.readUint16(),this.item_type=e.readString(4),this.item_name=e.readCString(),this.item_type===`mime`?(this.content_type=e.readCString(),this.content_encoding=e.readCString()):this.item_type===`uri `&&(this.item_uri_type=e.readCString()))}),c.createFullBoxCtor(`ipma`,`ItemPropertyAssociationBox`,function(e){var t,n;for(entry_count=e.readUint32(),this.associations=[],t=0;t<entry_count;t++){var r={};this.associations.push(r),this.version<1?r.id=e.readUint16():r.id=e.readUint32();var a=e.readUint8();for(r.props=[],n=0;n<a;n++){var o=e.readUint8(),s={};r.props.push(s),s.essential=(o&128)>>7==1,this.flags&1?s.property_index=(o&127)<<8|e.readUint8():s.property_index=o&127}}}),c.createFullBoxCtor(`iref`,`ItemReferenceBox`,function(e){var n,r;for(this.references=[];e.getPosition()<this.start+this.size;)if(n=c.parseOneBox(e,!0,this.size-(e.getPosition()-this.start)),n.code===c.OK)r=this.version===0?new c.SingleItemTypeReferenceBox(n.type,n.size,n.hdr_size,n.start):new c.SingleItemTypeReferenceBoxLarge(n.type,n.size,n.hdr_size,n.start),r.write===c.Box.prototype.write&&r.type!==`mdat`&&(t.warn(`BoxParser`,r.type+` box writing not yet implemented, keeping unparsed data in memory for later write`),r.parseDataAndRewind(e)),r.parse(e),this.references.push(r);else return}),c.createBoxCtor(`irot`,`ImageRotation`,function(e){this.angle=e.readUint8()&3}),c.createFullBoxCtor(`ispe`,`ImageSpatialExtentsProperty`,function(e){this.image_width=e.readUint32(),this.image_height=e.readUint32()}),c.createFullBoxCtor(`kind`,`KindBox`,function(e){this.schemeURI=e.readCString(),this.value=e.readCString()}),c.createFullBoxCtor(`leva`,`LevelAssignmentBox`,function(e){var n=e.readUint8();this.levels=[];for(var r=0;r<n;r++){var a={};this.levels[r]=a,a.track_ID=e.readUint32();var o=e.readUint8();switch(a.padding_flag=o>>7,a.assignment_type=o&127,a.assignment_type){case 0:a.grouping_type=e.readString(4);break;case 1:a.grouping_type=e.readString(4),a.grouping_type_parameter=e.readUint32();break;case 2:break;case 3:break;case 4:a.sub_track_id=e.readUint32();break;default:t.warn(`BoxParser`,`Unknown leva assignement type`)}}}),c.createBoxCtor(`lhvC`,`LHEVCConfigurationBox`,function(e){var t,n,r;this.configurationVersion=e.readUint8(),this.min_spatial_segmentation_idc=e.readUint16()&4095,this.parallelismType=e.readUint8()&3,r=e.readUint8(),this.numTemporalLayers=(r&13)>>3,this.temporalIdNested=(r&4)>>2,this.lengthSizeMinusOne=r&3,this.nalu_arrays=[],this.nalu_arrays.toString=function(){var e=`<table class='inner-table'>`;e+=`<thead><tr><th>completeness</th><th>nalu_type</th><th>nalu_data</th></tr></thead>`,e+=`<tbody>`;for(var t=0;t<this.length;t++){var n=this[t];e+=`<tr>`,e+=`<td rowspan='`+n.length+`'>`+n.completeness+`</td>`,e+=`<td rowspan='`+n.length+`'>`+n.nalu_type+`</td>`;for(var r=0;r<n.length;r++){var a=n[r];r!==0&&(e+=`<tr>`),e+=`<td>`,e+=a.data.reduce(function(e,t){return e+t.toString(16).padStart(2,`0`)},`0x`),e+=`</td></tr>`}}return e+=`</tbody></table>`,e};var a=e.readUint8();for(t=0;t<a;t++){var o=[];this.nalu_arrays.push(o),r=e.readUint8(),o.completeness=(r&128)>>7,o.nalu_type=r&63;var s=e.readUint16();for(n=0;n<s;n++){var c={};o.push(c);var l=e.readUint16();c.data=e.readUint8Array(l)}}}),c.createBoxCtor(`lsel`,`LayerSelectorProperty`,function(e){this.layer_id=e.readUint16()}),c.createBoxCtor(`maxr`,`hintmaxrate`,function(e){this.period=e.readUint32(),this.bytes=e.readUint32()});function u(e,t){this.x=e,this.y=t}u.prototype.toString=function(){return`(`+this.x+`,`+this.y+`)`},c.createBoxCtor(`mdcv`,`MasteringDisplayColourVolumeBox`,function(e){this.display_primaries=[],this.display_primaries[0]=new u(e.readUint16(),e.readUint16()),this.display_primaries[1]=new u(e.readUint16(),e.readUint16()),this.display_primaries[2]=new u(e.readUint16(),e.readUint16()),this.white_point=new u(e.readUint16(),e.readUint16()),this.max_display_mastering_luminance=e.readUint32(),this.min_display_mastering_luminance=e.readUint32()}),c.createFullBoxCtor(`mdhd`,`MediaHeaderBox`,function(e){this.version==1?(this.creation_time=e.readUint64(),this.modification_time=e.readUint64(),this.timescale=e.readUint32(),this.duration=e.readUint64()):(this.creation_time=e.readUint32(),this.modification_time=e.readUint32(),this.timescale=e.readUint32(),this.duration=e.readUint32()),this.parseLanguage(e),e.readUint16()}),c.createFullBoxCtor(`mehd`,`MovieExtendsHeaderBox`,function(e){this.flags&1&&(t.warn(`BoxParser`,`mehd box incorrectly uses flags set to 1, converting version to 1`),this.version=1),this.version==1?this.fragment_duration=e.readUint64():this.fragment_duration=e.readUint32()}),c.createFullBoxCtor(`meta`,`MetaBox`,function(e){this.boxes=[],c.ContainerBox.prototype.parse.call(this,e)}),c.createFullBoxCtor(`mfhd`,`MovieFragmentHeaderBox`,function(e){this.sequence_number=e.readUint32()}),c.createFullBoxCtor(`mfro`,`MovieFragmentRandomAccessOffsetBox`,function(e){this._size=e.readUint32()}),c.createFullBoxCtor(`mskC`,`MaskConfigurationProperty`,function(e){this.bits_per_pixel=e.readUint8()}),c.createFullBoxCtor(`mvhd`,`MovieHeaderBox`,function(e){this.version==1?(this.creation_time=e.readUint64(),this.modification_time=e.readUint64(),this.timescale=e.readUint32(),this.duration=e.readUint64()):(this.creation_time=e.readUint32(),this.modification_time=e.readUint32(),this.timescale=e.readUint32(),this.duration=e.readUint32()),this.rate=e.readUint32(),this.volume=e.readUint16()>>8,e.readUint16(),e.readUint32Array(2),this.matrix=e.readUint32Array(9),e.readUint32Array(6),this.next_track_id=e.readUint32()}),c.createBoxCtor(`npck`,`hintPacketsSent`,function(e){this.packetssent=e.readUint32()}),c.createBoxCtor(`nump`,`hintPacketsSent`,function(e){this.packetssent=e.readUint64()}),c.createFullBoxCtor(`padb`,`PaddingBitsBox`,function(e){var t=e.readUint32();this.padbits=[];for(var n=0;n<Math.floor((t+1)/2);n++)this.padbits=e.readUint8()}),c.createBoxCtor(`pasp`,`PixelAspectRatioBox`,function(e){this.hSpacing=e.readUint32(),this.vSpacing=e.readUint32()}),c.createBoxCtor(`payl`,`CuePayloadBox`,function(e){this.text=e.readString(this.size-this.hdr_size)}),c.createBoxCtor(`payt`,`hintpayloadID`,function(e){this.payloadID=e.readUint32();var t=e.readUint8();this.rtpmap_string=e.readString(t)}),c.createFullBoxCtor(`pdin`,`ProgressiveDownloadInfoBox`,function(e){var t=(this.size-this.hdr_size)/8;this.rate=[],this.initial_delay=[];for(var n=0;n<t;n++)this.rate[n]=e.readUint32(),this.initial_delay[n]=e.readUint32()}),c.createFullBoxCtor(`pitm`,`PrimaryItemBox`,function(e){this.version===0?this.item_id=e.readUint16():this.item_id=e.readUint32()}),c.createFullBoxCtor(`pixi`,`PixelInformationProperty`,function(e){var t;for(this.num_channels=e.readUint8(),this.bits_per_channels=[],t=0;t<this.num_channels;t++)this.bits_per_channels[t]=e.readUint8()}),c.createBoxCtor(`pmax`,`hintlargestpacket`,function(e){this.bytes=e.readUint32()}),c.createFullBoxCtor(`prdi`,`ProgressiveDerivedImageItemInformationProperty`,function(e){if(this.step_count=e.readUint16(),this.item_count=[],this.flags&2)for(var t=0;t<this.step_count;t++)this.item_count[t]=e.readUint16()}),c.createFullBoxCtor(`prft`,`ProducerReferenceTimeBox`,function(e){this.ref_track_id=e.readUint32(),this.ntp_timestamp=e.readUint64(),this.version===0?this.media_time=e.readUint32():this.media_time=e.readUint64()}),c.createFullBoxCtor(`pssh`,`ProtectionSystemSpecificHeaderBox`,function(e){if(this.system_id=c.parseHex16(e),this.version>0){var t=e.readUint32();this.kid=[];for(var n=0;n<t;n++)this.kid[n]=c.parseHex16(e)}var r=e.readUint32();r>0&&(this.data=e.readUint8Array(r))}),c.createFullBoxCtor(`clef`,`TrackCleanApertureDimensionsBox`,function(e){this.width=e.readUint32(),this.height=e.readUint32()}),c.createFullBoxCtor(`enof`,`TrackEncodedPixelsDimensionsBox`,function(e){this.width=e.readUint32(),this.height=e.readUint32()}),c.createFullBoxCtor(`prof`,`TrackProductionApertureDimensionsBox`,function(e){this.width=e.readUint32(),this.height=e.readUint32()}),c.createContainerBoxCtor(`tapt`,`TrackApertureModeDimensionsBox`,null,[`clef`,`prof`,`enof`]),c.createBoxCtor(`rtp `,`rtpmoviehintinformation`,function(e){this.descriptionformat=e.readString(4),this.sdptext=e.readString(this.size-this.hdr_size-4)}),c.createFullBoxCtor(`saio`,`SampleAuxiliaryInformationOffsetsBox`,function(e){this.flags&1&&(this.aux_info_type=e.readString(4),this.aux_info_type_parameter=e.readUint32());var t=e.readUint32();this.offset=[];for(var n=0;n<t;n++)this.version===0?this.offset[n]=e.readUint32():this.offset[n]=e.readUint64()}),c.createFullBoxCtor(`saiz`,`SampleAuxiliaryInformationSizesBox`,function(e){if(this.flags&1&&(this.aux_info_type=e.readString(4),this.aux_info_type_parameter=e.readUint32()),this.default_sample_info_size=e.readUint8(),this.sample_count=e.readUint32(),this.sample_info_size=[],this.default_sample_info_size===0)for(var t=0;t<this.sample_count;t++)this.sample_info_size[t]=e.readUint8()}),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_METADATA,`mett`,function(e){this.parseHeader(e),this.content_encoding=e.readCString(),this.mime_format=e.readCString(),this.parseFooter(e)}),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_METADATA,`metx`,function(e){this.parseHeader(e),this.content_encoding=e.readCString(),this.namespace=e.readCString(),this.schema_location=e.readCString(),this.parseFooter(e)}),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_SUBTITLE,`sbtt`,function(e){this.parseHeader(e),this.content_encoding=e.readCString(),this.mime_format=e.readCString(),this.parseFooter(e)}),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_SUBTITLE,`stpp`,function(e){this.parseHeader(e),this.namespace=e.readCString(),this.schema_location=e.readCString(),this.auxiliary_mime_types=e.readCString(),this.parseFooter(e)}),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_SUBTITLE,`stxt`,function(e){this.parseHeader(e),this.content_encoding=e.readCString(),this.mime_format=e.readCString(),this.parseFooter(e)}),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_SUBTITLE,`tx3g`,function(e){this.parseHeader(e),this.displayFlags=e.readUint32(),this.horizontal_justification=e.readInt8(),this.vertical_justification=e.readInt8(),this.bg_color_rgba=e.readUint8Array(4),this.box_record=e.readInt16Array(4),this.style_record=e.readUint8Array(12),this.parseFooter(e)}),c.createSampleEntryCtor(c.SAMPLE_ENTRY_TYPE_METADATA,`wvtt`,function(e){this.parseHeader(e),this.parseFooter(e)}),c.createSampleGroupCtor(`alst`,function(e){var t,n=e.readUint16();for(this.first_output_sample=e.readUint16(),this.sample_offset=[],t=0;t<n;t++)this.sample_offset[t]=e.readUint32();var r=this.description_length-4-4*n;for(this.num_output_samples=[],this.num_total_samples=[],t=0;t<r/4;t++)this.num_output_samples[t]=e.readUint16(),this.num_total_samples[t]=e.readUint16()}),c.createSampleGroupCtor(`avll`,function(e){this.layerNumber=e.readUint8(),this.accurateStatisticsFlag=e.readUint8(),this.avgBitRate=e.readUint16(),this.avgFrameRate=e.readUint16()}),c.createSampleGroupCtor(`avss`,function(e){this.subSequenceIdentifier=e.readUint16(),this.layerNumber=e.readUint8();var t=e.readUint8();this.durationFlag=t>>7,this.avgRateFlag=t>>6&1,this.durationFlag&&(this.duration=e.readUint32()),this.avgRateFlag&&(this.accurateStatisticsFlag=e.readUint8(),this.avgBitRate=e.readUint16(),this.avgFrameRate=e.readUint16()),this.dependency=[];for(var n=e.readUint8(),r=0;r<n;r++){var a={};this.dependency.push(a),a.subSeqDirectionFlag=e.readUint8(),a.layerNumber=e.readUint8(),a.subSequenceIdentifier=e.readUint16()}}),c.createSampleGroupCtor(`dtrt`,function(e){t.warn(`BoxParser`,`Sample Group type: `+this.grouping_type+` not fully parsed`)}),c.createSampleGroupCtor(`mvif`,function(e){t.warn(`BoxParser`,`Sample Group type: `+this.grouping_type+` not fully parsed`)}),c.createSampleGroupCtor(`prol`,function(e){this.roll_distance=e.readInt16()}),c.createSampleGroupCtor(`rap `,function(e){var t=e.readUint8();this.num_leading_samples_known=t>>7,this.num_leading_samples=t&127}),c.createSampleGroupCtor(`rash`,function(e){if(this.operation_point_count=e.readUint16(),this.description_length!==2+(this.operation_point_count===1?2:this.operation_point_count*6)+9)t.warn(`BoxParser`,`Mismatch in `+this.grouping_type+` sample group length`),this.data=e.readUint8Array(this.description_length-2);else{if(this.operation_point_count===1)this.target_rate_share=e.readUint16();else{this.target_rate_share=[],this.available_bitrate=[];for(var n=0;n<this.operation_point_count;n++)this.available_bitrate[n]=e.readUint32(),this.target_rate_share[n]=e.readUint16()}this.maximum_bitrate=e.readUint32(),this.minimum_bitrate=e.readUint32(),this.discard_priority=e.readUint8()}}),c.createSampleGroupCtor(`roll`,function(e){this.roll_distance=e.readInt16()}),c.SampleGroupEntry.prototype.parse=function(e){t.warn(`BoxParser`,`Unknown Sample Group type: `+this.grouping_type),this.data=e.readUint8Array(this.description_length)},c.createSampleGroupCtor(`scif`,function(e){t.warn(`BoxParser`,`Sample Group type: `+this.grouping_type+` not fully parsed`)}),c.createSampleGroupCtor(`scnm`,function(e){t.warn(`BoxParser`,`Sample Group type: `+this.grouping_type+` not fully parsed`)}),c.createSampleGroupCtor(`seig`,function(e){this.reserved=e.readUint8();var t=e.readUint8();this.crypt_byte_block=t>>4,this.skip_byte_block=t&15,this.isProtected=e.readUint8(),this.Per_Sample_IV_Size=e.readUint8(),this.KID=c.parseHex16(e),this.constant_IV_size=0,this.constant_IV=0,this.isProtected===1&&this.Per_Sample_IV_Size===0&&(this.constant_IV_size=e.readUint8(),this.constant_IV=e.readUint8Array(this.constant_IV_size))}),c.createSampleGroupCtor(`stsa`,function(e){t.warn(`BoxParser`,`Sample Group type: `+this.grouping_type+` not fully parsed`)}),c.createSampleGroupCtor(`sync`,function(e){var t=e.readUint8();this.NAL_unit_type=t&63}),c.createSampleGroupCtor(`tele`,function(e){var t=e.readUint8();this.level_independently_decodable=t>>7}),c.createSampleGroupCtor(`tsas`,function(e){t.warn(`BoxParser`,`Sample Group type: `+this.grouping_type+` not fully parsed`)}),c.createSampleGroupCtor(`tscl`,function(e){t.warn(`BoxParser`,`Sample Group type: `+this.grouping_type+` not fully parsed`)}),c.createSampleGroupCtor(`vipr`,function(e){t.warn(`BoxParser`,`Sample Group type: `+this.grouping_type+` not fully parsed`)}),c.createFullBoxCtor(`sbgp`,`SampleToGroupBox`,function(e){this.grouping_type=e.readString(4),this.version===1?this.grouping_type_parameter=e.readUint32():this.grouping_type_parameter=0,this.entries=[];for(var t=e.readUint32(),n=0;n<t;n++){var r={};this.entries.push(r),r.sample_count=e.readInt32(),r.group_description_index=e.readInt32()}});function d(e,t){this.bad_pixel_row=e,this.bad_pixel_column=t}d.prototype.toString=function(){return`[row: `+this.bad_pixel_row+`, column: `+this.bad_pixel_column+`]`},c.createFullBoxCtor(`sbpm`,`SensorBadPixelsMapBox`,function(e){var t;for(this.component_count=e.readUint16(),this.component_index=[],t=0;t<this.component_count;t++)this.component_index.push(e.readUint16());var n=e.readUint8();for(this.correction_applied=(n&128)==128,this.num_bad_rows=e.readUint32(),this.num_bad_cols=e.readUint32(),this.num_bad_pixels=e.readUint32(),this.bad_rows=[],this.bad_columns=[],this.bad_pixels=[],t=0;t<this.num_bad_rows;t++)this.bad_rows.push(e.readUint32());for(t=0;t<this.num_bad_cols;t++)this.bad_columns.push(e.readUint32());for(t=0;t<this.num_bad_pixels;t++){var r=e.readUint32(),a=e.readUint32();this.bad_pixels.push(new d(r,a))}}),c.createFullBoxCtor(`schm`,`SchemeTypeBox`,function(e){this.scheme_type=e.readString(4),this.scheme_version=e.readUint32(),this.flags&1&&(this.scheme_uri=e.readString(this.size-this.hdr_size-8))}),c.createBoxCtor(`sdp `,`rtptracksdphintinformation`,function(e){this.sdptext=e.readString(this.size-this.hdr_size)}),c.createFullBoxCtor(`sdtp`,`SampleDependencyTypeBox`,function(e){var t,n=this.size-this.hdr_size;this.is_leading=[],this.sample_depends_on=[],this.sample_is_depended_on=[],this.sample_has_redundancy=[];for(var r=0;r<n;r++)t=e.readUint8(),this.is_leading[r]=t>>6,this.sample_depends_on[r]=t>>4&3,this.sample_is_depended_on[r]=t>>2&3,this.sample_has_redundancy[r]=t&3}),c.createFullBoxCtor(`senc`,`SampleEncryptionBox`),c.createFullBoxCtor(`sgpd`,`SampleGroupDescriptionBox`,function(e){this.grouping_type=e.readString(4),t.debug(`BoxParser`,`Found Sample Groups of type `+this.grouping_type),this.version===1?this.default_length=e.readUint32():this.default_length=0,this.version>=2&&(this.default_group_description_index=e.readUint32()),this.entries=[];for(var n=e.readUint32(),r=0;r<n;r++){var a=c[this.grouping_type+`SampleGroupEntry`]?new c[this.grouping_type+`SampleGroupEntry`](this.grouping_type):new c.SampleGroupEntry(this.grouping_type);this.entries.push(a),this.version===1&&this.default_length===0?a.description_length=e.readUint32():a.description_length=this.default_length,a.write===c.SampleGroupEntry.prototype.write&&(t.info(`BoxParser`,`SampleGroup for type `+this.grouping_type+` writing not yet implemented, keeping unparsed data in memory for later write`),a.data=e.readUint8Array(a.description_length),e.position-=a.description_length),a.parse(e)}}),c.createFullBoxCtor(`sidx`,`CompressedSegmentIndexBox`,function(e){this.reference_ID=e.readUint32(),this.timescale=e.readUint32(),this.version===0?(this.earliest_presentation_time=e.readUint32(),this.first_offset=e.readUint32()):(this.earliest_presentation_time=e.readUint64(),this.first_offset=e.readUint64()),e.readUint16(),this.references=[];for(var t=e.readUint16(),n=0;n<t;n++){var r={};this.references.push(r);var a=e.readUint32();r.reference_type=a>>31&1,r.referenced_size=a&2147483647,r.subsegment_duration=e.readUint32(),a=e.readUint32(),r.starts_with_SAP=a>>31&1,r.SAP_type=a>>28&7,r.SAP_delta_time=a&268435455}}),c.SingleItemTypeReferenceBox=function(e,t,n,r){c.Box.call(this,e,t),this.hdr_size=n,this.start=r},c.SingleItemTypeReferenceBox.prototype=new c.Box,c.SingleItemTypeReferenceBox.prototype.parse=function(e){this.from_item_ID=e.readUint16();var t=e.readUint16();this.references=[];for(var n=0;n<t;n++)this.references[n]={},this.references[n].to_item_ID=e.readUint16()},c.SingleItemTypeReferenceBoxLarge=function(e,t,n,r){c.Box.call(this,e,t),this.hdr_size=n,this.start=r},c.SingleItemTypeReferenceBoxLarge.prototype=new c.Box,c.SingleItemTypeReferenceBoxLarge.prototype.parse=function(e){this.from_item_ID=e.readUint32();var t=e.readUint16();this.references=[];for(var n=0;n<t;n++)this.references[n]={},this.references[n].to_item_ID=e.readUint32()},c.createFullBoxCtor(`SmDm`,`SMPTE2086MasteringDisplayMetadataBox`,function(e){this.primaryRChromaticity_x=e.readUint16(),this.primaryRChromaticity_y=e.readUint16(),this.primaryGChromaticity_x=e.readUint16(),this.primaryGChromaticity_y=e.readUint16(),this.primaryBChromaticity_x=e.readUint16(),this.primaryBChromaticity_y=e.readUint16(),this.whitePointChromaticity_x=e.readUint16(),this.whitePointChromaticity_y=e.readUint16(),this.luminanceMax=e.readUint32(),this.luminanceMin=e.readUint32()}),c.createFullBoxCtor(`smhd`,`SoundMediaHeaderBox`,function(e){this.balance=e.readUint16(),e.readUint16()}),c.createFullBoxCtor(`ssix`,`CompressedSubsegmentIndexBox`,function(e){this.subsegments=[];for(var t=e.readUint32(),n=0;n<t;n++){var r={};this.subsegments.push(r),r.ranges=[];for(var a=e.readUint32(),o=0;o<a;o++){var s={};r.ranges.push(s),s.level=e.readUint8(),s.range_size=e.readUint24()}}}),c.createFullBoxCtor(`stco`,`ChunkOffsetBox`,function(e){var t=e.readUint32();if(this.chunk_offsets=[],this.version===0)for(var n=0;n<t;n++)this.chunk_offsets.push(e.readUint32())}),c.createFullBoxCtor(`stdp`,`DegradationPriorityBox`,function(e){var t=(this.size-this.hdr_size)/2;this.priority=[];for(var n=0;n<t;n++)this.priority[n]=e.readUint16()}),c.createFullBoxCtor(`sthd`,`SubtitleMediaHeaderBox`),c.createFullBoxCtor(`stri`,`SubTrackInformationBox`,function(e){this.switch_group=e.readUint16(),this.alternate_group=e.readUint16(),this.sub_track_id=e.readUint32();var t=(this.size-this.hdr_size-8)/4;this.attribute_list=[];for(var n=0;n<t;n++)this.attribute_list[n]=e.readUint32()}),c.createFullBoxCtor(`stsc`,`SampleToChunkBox`,function(e){var t=e.readUint32(),n;if(this.first_chunk=[],this.samples_per_chunk=[],this.sample_description_index=[],this.version===0)for(n=0;n<t;n++)this.first_chunk.push(e.readUint32()),this.samples_per_chunk.push(e.readUint32()),this.sample_description_index.push(e.readUint32())}),c.createFullBoxCtor(`stsd`,`SampleDescriptionBox`,function(e){var n,r,a,o;for(this.entries=[],a=e.readUint32(),n=1;n<=a;n++)if(r=c.parseOneBox(e,!0,this.size-(e.getPosition()-this.start)),r.code===c.OK)c[r.type+`SampleEntry`]?(o=new c[r.type+`SampleEntry`](r.size),o.hdr_size=r.hdr_size,o.start=r.start):(t.warn(`BoxParser`,`Unknown sample entry type: `+r.type),o=new c.SampleEntry(r.type,r.size,r.hdr_size,r.start)),o.write===c.SampleEntry.prototype.write&&(t.info(`BoxParser`,`SampleEntry `+o.type+` box writing not yet implemented, keeping unparsed data in memory for later write`),o.parseDataAndRewind(e)),o.parse(e),this.entries.push(o);else return}),c.createFullBoxCtor(`stsg`,`SubTrackSampleGroupBox`,function(e){this.grouping_type=e.readUint32();var t=e.readUint16();this.group_description_index=[];for(var n=0;n<t;n++)this.group_description_index[n]=e.readUint32()}),c.createFullBoxCtor(`stsh`,`ShadowSyncSampleBox`,function(e){var t=e.readUint32(),n;if(this.shadowed_sample_numbers=[],this.sync_sample_numbers=[],this.version===0)for(n=0;n<t;n++)this.shadowed_sample_numbers.push(e.readUint32()),this.sync_sample_numbers.push(e.readUint32())}),c.createFullBoxCtor(`stss`,`SyncSampleBox`,function(e){var t,n=e.readUint32();if(this.version===0)for(this.sample_numbers=[],t=0;t<n;t++)this.sample_numbers.push(e.readUint32())}),c.createFullBoxCtor(`stsz`,`SampleSizeBox`,function(e){var t;if(this.sample_sizes=[],this.version===0)for(this.sample_size=e.readUint32(),this.sample_count=e.readUint32(),t=0;t<this.sample_count;t++)this.sample_size===0?this.sample_sizes.push(e.readUint32()):this.sample_sizes[t]=this.sample_size}),c.createFullBoxCtor(`stts`,`TimeToSampleBox`,function(e){var n=e.readUint32(),r,a;if(this.sample_counts=[],this.sample_deltas=[],this.version===0)for(r=0;r<n;r++)this.sample_counts.push(e.readUint32()),a=e.readInt32(),a<0&&(t.warn(`BoxParser`,`File uses negative stts sample delta, using value 1 instead, sync may be lost!`),a=1),this.sample_deltas.push(a)}),c.createFullBoxCtor(`stvi`,`StereoVideoBox`,function(e){var t=e.readUint32();this.single_view_allowed=t&3,this.stereo_scheme=e.readUint32();var n=e.readUint32();this.stereo_indication_type=e.readString(n);var r,a;for(this.boxes=[];e.getPosition()<this.start+this.size;)if(r=c.parseOneBox(e,!1,this.size-(e.getPosition()-this.start)),r.code===c.OK)a=r.box,this.boxes.push(a),this[a.type]=a;else return}),c.createBoxCtor(`styp`,`SegmentTypeBox`,function(e){c.ftypBox.prototype.parse.call(this,e)}),c.createFullBoxCtor(`stz2`,`CompactSampleSizeBox`,function(e){var n,r;if(this.sample_sizes=[],this.version===0)if(this.reserved=e.readUint24(),this.field_size=e.readUint8(),r=e.readUint32(),this.field_size===4)for(n=0;n<r;n+=2){var a=e.readUint8();this.sample_sizes[n]=a>>4&15,this.sample_sizes[n+1]=a&15}else if(this.field_size===8)for(n=0;n<r;n++)this.sample_sizes[n]=e.readUint8();else if(this.field_size===16)for(n=0;n<r;n++)this.sample_sizes[n]=e.readUint16();else t.error(`BoxParser`,`Error in length field in stz2 box`)}),c.createFullBoxCtor(`subs`,`SubSampleInformationBox`,function(e){var t,n,r=e.readUint32(),a;for(this.entries=[],t=0;t<r;t++){var o={};if(this.entries[t]=o,o.sample_delta=e.readUint32(),o.subsamples=[],a=e.readUint16(),a>0)for(n=0;n<a;n++){var s={};o.subsamples.push(s),this.version==1?s.size=e.readUint32():s.size=e.readUint16(),s.priority=e.readUint8(),s.discardable=e.readUint8(),s.codec_specific_parameters=e.readUint32()}}}),c.createFullBoxCtor(`tenc`,`TrackEncryptionBox`,function(e){if(e.readUint8(),this.version===0)e.readUint8();else{var t=e.readUint8();this.default_crypt_byte_block=t>>4&15,this.default_skip_byte_block=t&15}this.default_isProtected=e.readUint8(),this.default_Per_Sample_IV_Size=e.readUint8(),this.default_KID=c.parseHex16(e),this.default_isProtected===1&&this.default_Per_Sample_IV_Size===0&&(this.default_constant_IV_size=e.readUint8(),this.default_constant_IV=e.readUint8Array(this.default_constant_IV_size))}),c.createFullBoxCtor(`tfdt`,`TrackFragmentBaseMediaDecodeTimeBox`,function(e){this.version==1?this.baseMediaDecodeTime=e.readUint64():this.baseMediaDecodeTime=e.readUint32()}),c.createFullBoxCtor(`tfhd`,`TrackFragmentHeaderBox`,function(e){var t=0;this.track_id=e.readUint32(),this.size-this.hdr_size>t&&this.flags&c.TFHD_FLAG_BASE_DATA_OFFSET?(this.base_data_offset=e.readUint64(),t+=8):this.base_data_offset=0,this.size-this.hdr_size>t&&this.flags&c.TFHD_FLAG_SAMPLE_DESC?(this.default_sample_description_index=e.readUint32(),t+=4):this.default_sample_description_index=0,this.size-this.hdr_size>t&&this.flags&c.TFHD_FLAG_SAMPLE_DUR?(this.default_sample_duration=e.readUint32(),t+=4):this.default_sample_duration=0,this.size-this.hdr_size>t&&this.flags&c.TFHD_FLAG_SAMPLE_SIZE?(this.default_sample_size=e.readUint32(),t+=4):this.default_sample_size=0,this.size-this.hdr_size>t&&this.flags&c.TFHD_FLAG_SAMPLE_FLAGS?(this.default_sample_flags=e.readUint32(),t+=4):this.default_sample_flags=0}),c.createFullBoxCtor(`tfra`,`TrackFragmentRandomAccessBox`,function(e){this.track_ID=e.readUint32(),e.readUint24();var t=e.readUint8();this.length_size_of_traf_num=t>>4&3,this.length_size_of_trun_num=t>>2&3,this.length_size_of_sample_num=t&3,this.entries=[];for(var n=e.readUint32(),r=0;r<n;r++)this.version===1?(this.time=e.readUint64(),this.moof_offset=e.readUint64()):(this.time=e.readUint32(),this.moof_offset=e.readUint32()),this.traf_number=e[`readUint`+8*(this.length_size_of_traf_num+1)](),this.trun_number=e[`readUint`+8*(this.length_size_of_trun_num+1)](),this.sample_number=e[`readUint`+8*(this.length_size_of_sample_num+1)]()}),c.createFullBoxCtor(`tkhd`,`TrackHeaderBox`,function(e){this.version==1?(this.creation_time=e.readUint64(),this.modification_time=e.readUint64(),this.track_id=e.readUint32(),e.readUint32(),this.duration=e.readUint64()):(this.creation_time=e.readUint32(),this.modification_time=e.readUint32(),this.track_id=e.readUint32(),e.readUint32(),this.duration=e.readUint32()),e.readUint32Array(2),this.layer=e.readInt16(),this.alternate_group=e.readInt16(),this.volume=e.readInt16()>>8,e.readUint16(),this.matrix=e.readInt32Array(9),this.width=e.readUint32(),this.height=e.readUint32()}),c.createBoxCtor(`tmax`,`hintmaxrelativetime`,function(e){this.time=e.readUint32()}),c.createBoxCtor(`tmin`,`hintminrelativetime`,function(e){this.time=e.readUint32()}),c.createBoxCtor(`totl`,`hintBytesSent`,function(e){this.bytessent=e.readUint32()}),c.createBoxCtor(`tpay`,`hintBytesSent`,function(e){this.bytessent=e.readUint32()}),c.createBoxCtor(`tpyl`,`hintBytesSent`,function(e){this.bytessent=e.readUint64()}),c.TrackGroupTypeBox.prototype.parse=function(e){this.parseFullHeader(e),this.track_group_id=e.readUint32()},c.createTrackGroupCtor(`msrc`),c.TrackReferenceTypeBox=function(e,t,n,r){c.Box.call(this,e,t),this.hdr_size=n,this.start=r},c.TrackReferenceTypeBox.prototype=new c.Box,c.TrackReferenceTypeBox.prototype.parse=function(e){this.track_ids=e.readUint32Array((this.size-this.hdr_size)/4)},c.trefBox.prototype.parse=function(e){for(var n,r;e.getPosition()<this.start+this.size;)if(n=c.parseOneBox(e,!0,this.size-(e.getPosition()-this.start)),n.code===c.OK)r=new c.TrackReferenceTypeBox(n.type,n.size,n.hdr_size,n.start),r.write===c.Box.prototype.write&&r.type!==`mdat`&&(t.info(`BoxParser`,`TrackReference `+r.type+` box writing not yet implemented, keeping unparsed data in memory for later write`),r.parseDataAndRewind(e)),r.parse(e),this.boxes.push(r);else return},c.createFullBoxCtor(`trep`,`TrackExtensionPropertiesBox`,function(e){for(this.track_ID=e.readUint32(),this.boxes=[];e.getPosition()<this.start+this.size;)if(ret=c.parseOneBox(e,!1,this.size-(e.getPosition()-this.start)),ret.code===c.OK)box=ret.box,this.boxes.push(box);else return}),c.createFullBoxCtor(`trex`,`TrackExtendsBox`,function(e){this.track_id=e.readUint32(),this.default_sample_description_index=e.readUint32(),this.default_sample_duration=e.readUint32(),this.default_sample_size=e.readUint32(),this.default_sample_flags=e.readUint32()}),c.createBoxCtor(`trpy`,`hintBytesSent`,function(e){this.bytessent=e.readUint64()}),c.createFullBoxCtor(`trun`,`TrackRunBox`,function(e){var t=0;if(this.sample_count=e.readUint32(),t+=4,this.size-this.hdr_size>t&&this.flags&c.TRUN_FLAGS_DATA_OFFSET?(this.data_offset=e.readInt32(),t+=4):this.data_offset=0,this.size-this.hdr_size>t&&this.flags&c.TRUN_FLAGS_FIRST_FLAG?(this.first_sample_flags=e.readUint32(),t+=4):this.first_sample_flags=0,this.sample_duration=[],this.sample_size=[],this.sample_flags=[],this.sample_composition_time_offset=[],this.size-this.hdr_size>t)for(var n=0;n<this.sample_count;n++)this.flags&c.TRUN_FLAGS_DURATION&&(this.sample_duration[n]=e.readUint32()),this.flags&c.TRUN_FLAGS_SIZE&&(this.sample_size[n]=e.readUint32()),this.flags&c.TRUN_FLAGS_FLAGS&&(this.sample_flags[n]=e.readUint32()),this.flags&c.TRUN_FLAGS_CTS_OFFSET&&(this.version===0?this.sample_composition_time_offset[n]=e.readUint32():this.sample_composition_time_offset[n]=e.readInt32())}),c.createFullBoxCtor(`tsel`,`TrackSelectionBox`,function(e){this.switch_group=e.readUint32();var t=(this.size-this.hdr_size-4)/4;this.attribute_list=[];for(var n=0;n<t;n++)this.attribute_list[n]=e.readUint32()}),c.createFullBoxCtor(`txtC`,`TextConfigBox`,function(e){this.config=e.readCString()}),c.createBoxCtor(`tyco`,`TypeCombinationBox`,function(e){var t=(this.size-this.hdr_size)/4;this.compatible_brands=[];for(var n=0;n<t;n++)this.compatible_brands[n]=e.readString(4)}),c.createFullBoxCtor(`udes`,`UserDescriptionProperty`,function(e){this.lang=e.readCString(),this.name=e.readCString(),this.description=e.readCString(),this.tags=e.readCString()}),c.createFullBoxCtor(`uncC`,`UncompressedFrameConfigBox`,function(e){var t;if(this.profile=e.readString(4),this.version!=1&&this.version==0){for(this.component_count=e.readUint32(),this.component_index=[],this.component_bit_depth_minus_one=[],this.component_format=[],this.component_align_size=[],t=0;t<this.component_count;t++)this.component_index.push(e.readUint16()),this.component_bit_depth_minus_one.push(e.readUint8()),this.component_format.push(e.readUint8()),this.component_align_size.push(e.readUint8());this.sampling_type=e.readUint8(),this.interleave_type=e.readUint8(),this.block_size=e.readUint8();var n=e.readUint8();this.component_little_endian=n>>7&1,this.block_pad_lsb=n>>6&1,this.block_little_endian=n>>5&1,this.block_reversed=n>>4&1,this.pad_unknown=n>>3&1,this.pixel_size=e.readUint32(),this.row_align_size=e.readUint32(),this.tile_align_size=e.readUint32(),this.num_tile_cols_minus_one=e.readUint32(),this.num_tile_rows_minus_one=e.readUint32()}}),c.createFullBoxCtor(`url `,`DataEntryUrlBox`,function(e){this.flags!==1&&(this.location=e.readCString())}),c.createFullBoxCtor(`urn `,`DataEntryUrnBox`,function(e){this.name=e.readCString(),this.size-this.hdr_size-this.name.length-1>0&&(this.location=e.readCString())}),c.createUUIDBox(`a5d40b30e81411ddba2f0800200c9a66`,`LiveServerManifestBox`,!0,!1,function(e){this.LiveServerManifest=e.readString(this.size-this.hdr_size).replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`).replace(/'/g,`'`)}),c.createUUIDBox(`d08a4f1810f34a82b6c832d8aba183d3`,`PiffProtectionSystemSpecificHeaderBox`,!0,!1,function(e){this.system_id=c.parseHex16(e);var t=e.readUint32();t>0&&(this.data=e.readUint8Array(t))}),c.createUUIDBox(`a2394f525a9b4f14a2446c427c648df4`,`PiffSampleEncryptionBox`,!0,!1),c.createUUIDBox(`8974dbce7be74c5184f97148f9882554`,`PiffTrackEncryptionBox`,!0,!1,function(e){this.default_AlgorithmID=e.readUint24(),this.default_IV_size=e.readUint8(),this.default_KID=c.parseHex16(e)}),c.createUUIDBox(`d4807ef2ca3946958e5426cb9e46a79f`,`TfrfBox`,!0,!1,function(e){this.fragment_count=e.readUint8(),this.entries=[];for(var t=0;t<this.fragment_count;t++){var n={},r=0,a=0;this.version===1?(r=e.readUint64(),a=e.readUint64()):(r=e.readUint32(),a=e.readUint32()),n.absolute_time=r,n.absolute_duration=a,this.entries.push(n)}}),c.createUUIDBox(`6d1d9b0542d544e680e2141daff757b2`,`TfxdBox`,!0,!1,function(e){this.version===1?(this.absolute_time=e.readUint64(),this.duration=e.readUint64()):(this.absolute_time=e.readUint32(),this.duration=e.readUint32())}),c.createFullBoxCtor(`vmhd`,`VideoMediaHeaderBox`,function(e){this.graphicsmode=e.readUint16(),this.opcolor=e.readUint16Array(3)}),c.createFullBoxCtor(`vpcC`,`VPCodecConfigurationRecord`,function(e){var t;this.version===1?(this.profile=e.readUint8(),this.level=e.readUint8(),t=e.readUint8(),this.bitDepth=t>>4,this.chromaSubsampling=t>>1&7,this.videoFullRangeFlag=t&1,this.colourPrimaries=e.readUint8(),this.transferCharacteristics=e.readUint8(),this.matrixCoefficients=e.readUint8(),this.codecIntializationDataSize=e.readUint16(),this.codecIntializationData=e.readUint8Array(this.codecIntializationDataSize)):(this.profile=e.readUint8(),this.level=e.readUint8(),t=e.readUint8(),this.bitDepth=t>>4&15,this.colorSpace=t&15,t=e.readUint8(),this.chromaSubsampling=t>>4&15,this.transferFunction=t>>1&7,this.videoFullRangeFlag=t&1,this.codecIntializationDataSize=e.readUint16(),this.codecIntializationData=e.readUint8Array(this.codecIntializationDataSize))}),c.createBoxCtor(`vttC`,`WebVTTConfigurationBox`,function(e){this.text=e.readString(this.size-this.hdr_size)}),c.createFullBoxCtor(`vvcC`,`VvcConfigurationBox`,function(e){var t,n,r={held_bits:void 0,num_held_bits:0,stream_read_1_bytes:function(e){this.held_bits=e.readUint8(),this.num_held_bits=8},stream_read_2_bytes:function(e){this.held_bits=e.readUint16(),this.num_held_bits=16},extract_bits:function(e){var t=this.held_bits>>this.num_held_bits-e&(1<<e)-1;return this.num_held_bits-=e,t}};if(r.stream_read_1_bytes(e),r.extract_bits(5),this.lengthSizeMinusOne=r.extract_bits(2),this.ptl_present_flag=r.extract_bits(1),this.ptl_present_flag){if(r.stream_read_2_bytes(e),this.ols_idx=r.extract_bits(9),this.num_sublayers=r.extract_bits(3),this.constant_frame_rate=r.extract_bits(2),this.chroma_format_idc=r.extract_bits(2),r.stream_read_1_bytes(e),this.bit_depth_minus8=r.extract_bits(3),r.extract_bits(5),r.stream_read_2_bytes(e),r.extract_bits(2),this.num_bytes_constraint_info=r.extract_bits(6),this.general_profile_idc=r.extract_bits(7),this.general_tier_flag=r.extract_bits(1),this.general_level_idc=e.readUint8(),r.stream_read_1_bytes(e),this.ptl_frame_only_constraint_flag=r.extract_bits(1),this.ptl_multilayer_enabled_flag=r.extract_bits(1),this.general_constraint_info=new Uint8Array(this.num_bytes_constraint_info),this.num_bytes_constraint_info){for(t=0;t<this.num_bytes_constraint_info-1;t++){var a=r.extract_bits(6);r.stream_read_1_bytes(e);var o=r.extract_bits(2);this.general_constraint_info[t]=a<<2|o}this.general_constraint_info[this.num_bytes_constraint_info-1]=r.extract_bits(6)}else r.extract_bits(6);if(this.num_sublayers>1){for(r.stream_read_1_bytes(e),this.ptl_sublayer_present_mask=0,n=this.num_sublayers-2;n>=0;--n){var s=r.extract_bits(1);this.ptl_sublayer_present_mask|=s<<n}for(n=this.num_sublayers;n<=8&&this.num_sublayers>1;++n)r.extract_bits(1);for(this.sublayer_level_idc=[],n=this.num_sublayers-2;n>=0;--n)this.ptl_sublayer_present_mask&1<<n&&(this.sublayer_level_idc[n]=e.readUint8())}if(this.ptl_num_sub_profiles=e.readUint8(),this.general_sub_profile_idc=[],this.ptl_num_sub_profiles)for(t=0;t<this.ptl_num_sub_profiles;t++)this.general_sub_profile_idc.push(e.readUint32());this.max_picture_width=e.readUint16(),this.max_picture_height=e.readUint16(),this.avg_frame_rate=e.readUint16()}var c=12,l=13;this.nalu_arrays=[];var u=e.readUint8();for(t=0;t<u;t++){var d=[];this.nalu_arrays.push(d),r.stream_read_1_bytes(e),d.completeness=r.extract_bits(1),r.extract_bits(2),d.nalu_type=r.extract_bits(5);var f=1;for(d.nalu_type!=l&&d.nalu_type!=c&&(f=e.readUint16()),n=0;n<f;n++){var p=e.readUint16();d.push({data:e.readUint8Array(p),length:p})}}}),c.createFullBoxCtor(`vvnC`,`VvcNALUConfigBox`,function(e){var t=strm.readUint8();this.lengthSizeMinusOne=t&3}),c.SampleEntry.prototype.isVideo=function(){return!1},c.SampleEntry.prototype.isAudio=function(){return!1},c.SampleEntry.prototype.isSubtitle=function(){return!1},c.SampleEntry.prototype.isMetadata=function(){return!1},c.SampleEntry.prototype.isHint=function(){return!1},c.SampleEntry.prototype.getCodec=function(){return this.type.replace(`.`,``)},c.SampleEntry.prototype.getWidth=function(){return``},c.SampleEntry.prototype.getHeight=function(){return``},c.SampleEntry.prototype.getChannelCount=function(){return``},c.SampleEntry.prototype.getSampleRate=function(){return``},c.SampleEntry.prototype.getSampleSize=function(){return``},c.VisualSampleEntry.prototype.isVideo=function(){return!0},c.VisualSampleEntry.prototype.getWidth=function(){return this.width},c.VisualSampleEntry.prototype.getHeight=function(){return this.height},c.AudioSampleEntry.prototype.isAudio=function(){return!0},c.AudioSampleEntry.prototype.getChannelCount=function(){return this.channel_count},c.AudioSampleEntry.prototype.getSampleRate=function(){return this.samplerate},c.AudioSampleEntry.prototype.getSampleSize=function(){return this.samplesize},c.SubtitleSampleEntry.prototype.isSubtitle=function(){return!0},c.MetadataSampleEntry.prototype.isMetadata=function(){return!0},c.decimalToHex=function(e,t){var n=Number(e).toString(16);for(t??=t=2;n.length<t;)n=`0`+n;return n},c.avc1SampleEntry.prototype.getCodec=c.avc2SampleEntry.prototype.getCodec=c.avc3SampleEntry.prototype.getCodec=c.avc4SampleEntry.prototype.getCodec=function(){var e=c.SampleEntry.prototype.getCodec.call(this);return this.avcC?e+`.`+c.decimalToHex(this.avcC.AVCProfileIndication)+c.decimalToHex(this.avcC.profile_compatibility)+c.decimalToHex(this.avcC.AVCLevelIndication):e},c.hev1SampleEntry.prototype.getCodec=c.hvc1SampleEntry.prototype.getCodec=function(){var e,t=c.SampleEntry.prototype.getCodec.call(this);if(this.hvcC){switch(t+=`.`,this.hvcC.general_profile_space){case 0:t+=``;break;case 1:t+=`A`;break;case 2:t+=`B`;break;case 3:t+=`C`;break}t+=this.hvcC.general_profile_idc,t+=`.`;var n=this.hvcC.general_profile_compatibility,r=0;for(e=0;e<32&&(r|=n&1,e!=31);e++)r<<=1,n>>=1;t+=c.decimalToHex(r,0),t+=`.`,this.hvcC.general_tier_flag===0?t+=`L`:t+=`H`,t+=this.hvcC.general_level_idc;var a=!1,o=``;for(e=5;e>=0;e--)(this.hvcC.general_constraint_indicator[e]||a)&&(o=`.`+c.decimalToHex(this.hvcC.general_constraint_indicator[e],0)+o,a=!0);t+=o}return t},c.vvc1SampleEntry.prototype.getCodec=c.vvi1SampleEntry.prototype.getCodec=function(){var e,t=c.SampleEntry.prototype.getCodec.call(this);if(this.vvcC){t+=`.`+this.vvcC.general_profile_idc,this.vvcC.general_tier_flag?t+=`.H`:t+=`.L`,t+=this.vvcC.general_level_idc;var n=``;if(this.vvcC.general_constraint_info){var r=[],a=0;a|=this.vvcC.ptl_frame_only_constraint<<7,a|=this.vvcC.ptl_multilayer_enabled<<6;var o;for(e=0;e<this.vvcC.general_constraint_info.length;++e)a|=this.vvcC.general_constraint_info[e]>>2&63,r.push(a),a&&(o=e),a=this.vvcC.general_constraint_info[e]>>2&3;if(o===void 0)n=`.CA`;else{n=`.C`;var s=`ABCDEFGHIJKLMNOPQRSTUVWXYZ234567`,l=0,u=0;for(e=0;e<=o;++e)for(l=l<<8|r[e],u+=8;u>=5;){var d=l>>u-5&31;n+=s[d],u-=5,l&=(1<<u)-1}u&&(l<<=5-u,n+=s[l&31])}}t+=n}return t},c.mp4aSampleEntry.prototype.getCodec=function(){var e=c.SampleEntry.prototype.getCodec.call(this);if(this.esds&&this.esds.esd){var t=this.esds.esd.getOTI(),n=this.esds.esd.getAudioConfig();return e+`.`+c.decimalToHex(t)+(n?`.`+n:``)}else return e},c.stxtSampleEntry.prototype.getCodec=function(){var e=c.SampleEntry.prototype.getCodec.call(this);return this.mime_format?e+`.`+this.mime_format:e},c.vp08SampleEntry.prototype.getCodec=c.vp09SampleEntry.prototype.getCodec=function(){var e=c.SampleEntry.prototype.getCodec.call(this),t=this.vpcC.level;t==0&&(t=`00`);var n=this.vpcC.bitDepth;return n==8&&(n=`08`),e+`.0`+this.vpcC.profile+`.`+t+`.`+n},c.av01SampleEntry.prototype.getCodec=function(){var e=c.SampleEntry.prototype.getCodec.call(this),t=this.av1C.seq_level_idx_0;t<10&&(t=`0`+t);var n;return this.av1C.seq_profile===2&&this.av1C.high_bitdepth===1?n=this.av1C.twelve_bit===1?`12`:`10`:this.av1C.seq_profile<=2&&(n=this.av1C.high_bitdepth===1?`10`:`08`),e+`.`+this.av1C.seq_profile+`.`+t+(this.av1C.seq_tier_0?`H`:`M`)+`.`+n},c.Box.prototype.writeHeader=function(e,n){this.size+=8,this.size>a&&(this.size+=8),this.type===`uuid`&&(this.size+=16),t.debug(`BoxWriter`,`Writing box `+this.type+` of size: `+this.size+` at position `+e.getPosition()+(n||``)),this.size>a?e.writeUint32(1):(this.sizePosition=e.getPosition(),e.writeUint32(this.size)),e.writeString(this.type,null,4),this.type===`uuid`&&e.writeUint8Array(this.uuid),this.size>a&&e.writeUint64(this.size)},c.FullBox.prototype.writeHeader=function(e){this.size+=4,c.Box.prototype.writeHeader.call(this,e,` v=`+this.version+` f=`+this.flags),e.writeUint8(this.version),e.writeUint24(this.flags)},c.Box.prototype.write=function(e){this.type===`mdat`?this.data&&(this.size=this.data.length,this.writeHeader(e),e.writeUint8Array(this.data)):(this.size=this.data?this.data.length:0,this.writeHeader(e),this.data&&e.writeUint8Array(this.data))},c.ContainerBox.prototype.write=function(e){this.size=0,this.writeHeader(e);for(var n=0;n<this.boxes.length;n++)this.boxes[n]&&(this.boxes[n].write(e),this.size+=this.boxes[n].size);t.debug(`BoxWriter`,`Adjusting box `+this.type+` with new size `+this.size),e.adjustUint32(this.sizePosition,this.size)},c.TrackReferenceTypeBox.prototype.write=function(e){this.size=this.track_ids.length*4,this.writeHeader(e),e.writeUint32Array(this.track_ids)},c.avcCBox.prototype.write=function(e){var t;for(this.size=7,t=0;t<this.SPS.length;t++)this.size+=2+this.SPS[t].length;for(t=0;t<this.PPS.length;t++)this.size+=2+this.PPS[t].length;for(this.ext&&(this.size+=this.ext.length),this.writeHeader(e),e.writeUint8(this.configurationVersion),e.writeUint8(this.AVCProfileIndication),e.writeUint8(this.profile_compatibility),e.writeUint8(this.AVCLevelIndication),e.writeUint8(this.lengthSizeMinusOne+252),e.writeUint8(this.SPS.length+224),t=0;t<this.SPS.length;t++)e.writeUint16(this.SPS[t].length),e.writeUint8Array(this.SPS[t].nalu);for(e.writeUint8(this.PPS.length),t=0;t<this.PPS.length;t++)e.writeUint16(this.PPS[t].length),e.writeUint8Array(this.PPS[t].nalu);this.ext&&e.writeUint8Array(this.ext)},c.co64Box.prototype.write=function(e){var t;for(this.version=0,this.flags=0,this.size=4+8*this.chunk_offsets.length,this.writeHeader(e),e.writeUint32(this.chunk_offsets.length),t=0;t<this.chunk_offsets.length;t++)e.writeUint64(this.chunk_offsets[t])},c.cslgBox.prototype.write=function(e){this.version=0,this.flags=0,this.size=20,this.writeHeader(e),e.writeInt32(this.compositionToDTSShift),e.writeInt32(this.leastDecodeToDisplayDelta),e.writeInt32(this.greatestDecodeToDisplayDelta),e.writeInt32(this.compositionStartTime),e.writeInt32(this.compositionEndTime)},c.cttsBox.prototype.write=function(e){var t;for(this.version=0,this.flags=0,this.size=4+8*this.sample_counts.length,this.writeHeader(e),e.writeUint32(this.sample_counts.length),t=0;t<this.sample_counts.length;t++)e.writeUint32(this.sample_counts[t]),this.version===1?e.writeInt32(this.sample_offsets[t]):e.writeUint32(this.sample_offsets[t])},c.drefBox.prototype.write=function(e){this.version=0,this.flags=0,this.size=4,this.writeHeader(e),e.writeUint32(this.entries.length);for(var n=0;n<this.entries.length;n++)this.entries[n].write(e),this.size+=this.entries[n].size;t.debug(`BoxWriter`,`Adjusting box `+this.type+` with new size `+this.size),e.adjustUint32(this.sizePosition,this.size)},c.elngBox.prototype.write=function(e){this.version=0,this.flags=0,this.size=this.extended_language.length,this.writeHeader(e),e.writeString(this.extended_language)},c.elstBox.prototype.write=function(e){this.version=0,this.flags=0,this.size=4+12*this.entries.length,this.writeHeader(e),e.writeUint32(this.entries.length);for(var t=0;t<this.entries.length;t++){var n=this.entries[t];e.writeUint32(n.segment_duration),e.writeInt32(n.media_time),e.writeInt16(n.media_rate_integer),e.writeInt16(n.media_rate_fraction)}},c.emsgBox.prototype.write=function(e){this.version=0,this.flags=0,this.size=16+this.message_data.length+(this.scheme_id_uri.length+1)+(this.value.length+1),this.writeHeader(e),e.writeCString(this.scheme_id_uri),e.writeCString(this.value),e.writeUint32(this.timescale),e.writeUint32(this.presentation_time_delta),e.writeUint32(this.event_duration),e.writeUint32(this.id),e.writeUint8Array(this.message_data)},c.ftypBox.prototype.write=function(e){this.size=8+4*this.compatible_brands.length,this.writeHeader(e),e.writeString(this.major_brand,null,4),e.writeUint32(this.minor_version);for(var t=0;t<this.compatible_brands.length;t++)e.writeString(this.compatible_brands[t],null,4)},c.hdlrBox.prototype.write=function(e){this.size=20+this.name.length+1,this.version=0,this.flags=0,this.writeHeader(e),e.writeUint32(0),e.writeString(this.handler,null,4),e.writeUint32(0),e.writeUint32(0),e.writeUint32(0),e.writeCString(this.name)},c.hvcCBox.prototype.write=function(e){var t,n;for(this.size=23,t=0;t<this.nalu_arrays.length;t++)for(this.size+=3,n=0;n<this.nalu_arrays[t].length;n++)this.size+=2+this.nalu_arrays[t][n].data.length;for(this.writeHeader(e),e.writeUint8(this.configurationVersion),e.writeUint8((this.general_profile_space<<6)+(this.general_tier_flag<<5)+this.general_profile_idc),e.writeUint32(this.general_profile_compatibility),e.writeUint8Array(this.general_constraint_indicator),e.writeUint8(this.general_level_idc),e.writeUint16(this.min_spatial_segmentation_idc+(15<<24)),e.writeUint8(this.parallelismType+252),e.writeUint8(this.chroma_format_idc+252),e.writeUint8(this.bit_depth_luma_minus8+248),e.writeUint8(this.bit_depth_chroma_minus8+248),e.writeUint16(this.avgFrameRate),e.writeUint8((this.constantFrameRate<<6)+(this.numTemporalLayers<<3)+(this.temporalIdNested<<2)+this.lengthSizeMinusOne),e.writeUint8(this.nalu_arrays.length),t=0;t<this.nalu_arrays.length;t++)for(e.writeUint8((this.nalu_arrays[t].completeness<<7)+this.nalu_arrays[t].nalu_type),e.writeUint16(this.nalu_arrays[t].length),n=0;n<this.nalu_arrays[t].length;n++)e.writeUint16(this.nalu_arrays[t][n].data.length),e.writeUint8Array(this.nalu_arrays[t][n].data)},c.kindBox.prototype.write=function(e){this.version=0,this.flags=0,this.size=this.schemeURI.length+1+(this.value.length+1),this.writeHeader(e),e.writeCString(this.schemeURI),e.writeCString(this.value)},c.mdhdBox.prototype.write=function(e){this.size=20,this.flags=0,this.version=0,this.writeHeader(e),e.writeUint32(this.creation_time),e.writeUint32(this.modification_time),e.writeUint32(this.timescale),e.writeUint32(this.duration),e.writeUint16(this.language),e.writeUint16(0)},c.mehdBox.prototype.write=function(e){this.version=0,this.flags=0,this.size=4,this.writeHeader(e),e.writeUint32(this.fragment_duration)},c.mfhdBox.prototype.write=function(e){this.version=0,this.flags=0,this.size=4,this.writeHeader(e),e.writeUint32(this.sequence_number)},c.mvhdBox.prototype.write=function(e){this.version=0,this.flags=0,this.size=96,this.writeHeader(e),e.writeUint32(this.creation_time),e.writeUint32(this.modification_time),e.writeUint32(this.timescale),e.writeUint32(this.duration),e.writeUint32(this.rate),e.writeUint16(this.volume<<8),e.writeUint16(0),e.writeUint32(0),e.writeUint32(0),e.writeUint32Array(this.matrix),e.writeUint32(0),e.writeUint32(0),e.writeUint32(0),e.writeUint32(0),e.writeUint32(0),e.writeUint32(0),e.writeUint32(this.next_track_id)},c.SampleEntry.prototype.writeHeader=function(e){this.size=8,c.Box.prototype.writeHeader.call(this,e),e.writeUint8(0),e.writeUint8(0),e.writeUint8(0),e.writeUint8(0),e.writeUint8(0),e.writeUint8(0),e.writeUint16(this.data_reference_index)},c.SampleEntry.prototype.writeFooter=function(e){for(var n=0;n<this.boxes.length;n++)this.boxes[n].write(e),this.size+=this.boxes[n].size;t.debug(`BoxWriter`,`Adjusting box `+this.type+` with new size `+this.size),e.adjustUint32(this.sizePosition,this.size)},c.SampleEntry.prototype.write=function(e){this.writeHeader(e),e.writeUint8Array(this.data),this.size+=this.data.length,t.debug(`BoxWriter`,`Adjusting box `+this.type+` with new size `+this.size),e.adjustUint32(this.sizePosition,this.size)},c.VisualSampleEntry.prototype.write=function(e){this.writeHeader(e),this.size+=70,e.writeUint16(0),e.writeUint16(0),e.writeUint32(0),e.writeUint32(0),e.writeUint32(0),e.writeUint16(this.width),e.writeUint16(this.height),e.writeUint32(this.horizresolution),e.writeUint32(this.vertresolution),e.writeUint32(0),e.writeUint16(this.frame_count),e.writeUint8(Math.min(31,this.compressorname.length)),e.writeString(this.compressorname,null,31),e.writeUint16(this.depth),e.writeInt16(-1),this.writeFooter(e)},c.AudioSampleEntry.prototype.write=function(e){this.writeHeader(e),this.size+=20,e.writeUint32(0),e.writeUint32(0),e.writeUint16(this.channel_count),e.writeUint16(this.samplesize),e.writeUint16(0),e.writeUint16(0),e.writeUint32(this.samplerate<<16),this.writeFooter(e)},c.stppSampleEntry.prototype.write=function(e){this.writeHeader(e),this.size+=this.namespace.length+1+this.schema_location.length+1+this.auxiliary_mime_types.length+1,e.writeCString(this.namespace),e.writeCString(this.schema_location),e.writeCString(this.auxiliary_mime_types),this.writeFooter(e)},c.SampleGroupEntry.prototype.write=function(e){e.writeUint8Array(this.data)},c.sbgpBox.prototype.write=function(e){this.version=1,this.flags=0,this.size=12+8*this.entries.length,this.writeHeader(e),e.writeString(this.grouping_type,null,4),e.writeUint32(this.grouping_type_parameter),e.writeUint32(this.entries.length);for(var t=0;t<this.entries.length;t++){var n=this.entries[t];e.writeInt32(n.sample_count),e.writeInt32(n.group_description_index)}},c.sgpdBox.prototype.write=function(e){var t,n;for(this.flags=0,this.size=12,t=0;t<this.entries.length;t++)n=this.entries[t],this.version===1&&(this.default_length===0&&(this.size+=4),this.size+=n.data.length);for(this.writeHeader(e),e.writeString(this.grouping_type,null,4),this.version===1&&e.writeUint32(this.default_length),this.version>=2&&e.writeUint32(this.default_sample_description_index),e.writeUint32(this.entries.length),t=0;t<this.entries.length;t++)n=this.entries[t],this.version===1&&this.default_length===0&&e.writeUint32(n.description_length),n.write(e)},c.sidxBox.prototype.write=function(e){this.version=0,this.flags=0,this.size=20+12*this.references.length,this.writeHeader(e),e.writeUint32(this.reference_ID),e.writeUint32(this.timescale),e.writeUint32(this.earliest_presentation_time),e.writeUint32(this.first_offset),e.writeUint16(0),e.writeUint16(this.references.length);for(var t=0;t<this.references.length;t++){var n=this.references[t];e.writeUint32(n.reference_type<<31|n.referenced_size),e.writeUint32(n.subsegment_duration),e.writeUint32(n.starts_with_SAP<<31|n.SAP_type<<28|n.SAP_delta_time)}},c.smhdBox.prototype.write=function(e){this.version=0,this.flags=1,this.size=4,this.writeHeader(e),e.writeUint16(this.balance),e.writeUint16(0)},c.stcoBox.prototype.write=function(e){this.version=0,this.flags=0,this.size=4+4*this.chunk_offsets.length,this.writeHeader(e),e.writeUint32(this.chunk_offsets.length),e.writeUint32Array(this.chunk_offsets)},c.stscBox.prototype.write=function(e){var t;for(this.version=0,this.flags=0,this.size=4+12*this.first_chunk.length,this.writeHeader(e),e.writeUint32(this.first_chunk.length),t=0;t<this.first_chunk.length;t++)e.writeUint32(this.first_chunk[t]),e.writeUint32(this.samples_per_chunk[t]),e.writeUint32(this.sample_description_index[t])},c.stsdBox.prototype.write=function(e){var n;for(this.version=0,this.flags=0,this.size=0,this.writeHeader(e),e.writeUint32(this.entries.length),this.size+=4,n=0;n<this.entries.length;n++)this.entries[n].write(e),this.size+=this.entries[n].size;t.debug(`BoxWriter`,`Adjusting box `+this.type+` with new size `+this.size),e.adjustUint32(this.sizePosition,this.size)},c.stshBox.prototype.write=function(e){var t;for(this.version=0,this.flags=0,this.size=4+8*this.shadowed_sample_numbers.length,this.writeHeader(e),e.writeUint32(this.shadowed_sample_numbers.length),t=0;t<this.shadowed_sample_numbers.length;t++)e.writeUint32(this.shadowed_sample_numbers[t]),e.writeUint32(this.sync_sample_numbers[t])},c.stssBox.prototype.write=function(e){this.version=0,this.flags=0,this.size=4+4*this.sample_numbers.length,this.writeHeader(e),e.writeUint32(this.sample_numbers.length),e.writeUint32Array(this.sample_numbers)},c.stszBox.prototype.write=function(e){var t,n=!0;if(this.version=0,this.flags=0,this.sample_sizes.length>0)for(t=0;t+1<this.sample_sizes.length;)if(this.sample_sizes[t+1]!==this.sample_sizes[0]){n=!1;break}else t++;else n=!1;this.size=8,n||(this.size+=4*this.sample_sizes.length),this.writeHeader(e),n?e.writeUint32(this.sample_sizes[0]):e.writeUint32(0),e.writeUint32(this.sample_sizes.length),n||e.writeUint32Array(this.sample_sizes)},c.sttsBox.prototype.write=function(e){var t;for(this.version=0,this.flags=0,this.size=4+8*this.sample_counts.length,this.writeHeader(e),e.writeUint32(this.sample_counts.length),t=0;t<this.sample_counts.length;t++)e.writeUint32(this.sample_counts[t]),e.writeUint32(this.sample_deltas[t])},c.tfdtBox.prototype.write=function(e){var t=2**32-1;this.version=+(this.baseMediaDecodeTime>t),this.flags=0,this.size=4,this.version===1&&(this.size+=4),this.writeHeader(e),this.version===1?e.writeUint64(this.baseMediaDecodeTime):e.writeUint32(this.baseMediaDecodeTime)},c.tfhdBox.prototype.write=function(e){this.version=0,this.size=4,this.flags&c.TFHD_FLAG_BASE_DATA_OFFSET&&(this.size+=8),this.flags&c.TFHD_FLAG_SAMPLE_DESC&&(this.size+=4),this.flags&c.TFHD_FLAG_SAMPLE_DUR&&(this.size+=4),this.flags&c.TFHD_FLAG_SAMPLE_SIZE&&(this.size+=4),this.flags&c.TFHD_FLAG_SAMPLE_FLAGS&&(this.size+=4),this.writeHeader(e),e.writeUint32(this.track_id),this.flags&c.TFHD_FLAG_BASE_DATA_OFFSET&&e.writeUint64(this.base_data_offset),this.flags&c.TFHD_FLAG_SAMPLE_DESC&&e.writeUint32(this.default_sample_description_index),this.flags&c.TFHD_FLAG_SAMPLE_DUR&&e.writeUint32(this.default_sample_duration),this.flags&c.TFHD_FLAG_SAMPLE_SIZE&&e.writeUint32(this.default_sample_size),this.flags&c.TFHD_FLAG_SAMPLE_FLAGS&&e.writeUint32(this.default_sample_flags)},c.tkhdBox.prototype.write=function(e){this.version=0,this.size=80,this.writeHeader(e),e.writeUint32(this.creation_time),e.writeUint32(this.modification_time),e.writeUint32(this.track_id),e.writeUint32(0),e.writeUint32(this.duration),e.writeUint32(0),e.writeUint32(0),e.writeInt16(this.layer),e.writeInt16(this.alternate_group),e.writeInt16(this.volume<<8),e.writeUint16(0),e.writeInt32Array(this.matrix),e.writeUint32(this.width),e.writeUint32(this.height)},c.trexBox.prototype.write=function(e){this.version=0,this.flags=0,this.size=20,this.writeHeader(e),e.writeUint32(this.track_id),e.writeUint32(this.default_sample_description_index),e.writeUint32(this.default_sample_duration),e.writeUint32(this.default_sample_size),e.writeUint32(this.default_sample_flags)},c.trunBox.prototype.write=function(e){this.version=0,this.size=4,this.flags&c.TRUN_FLAGS_DATA_OFFSET&&(this.size+=4),this.flags&c.TRUN_FLAGS_FIRST_FLAG&&(this.size+=4),this.flags&c.TRUN_FLAGS_DURATION&&(this.size+=4*this.sample_duration.length),this.flags&c.TRUN_FLAGS_SIZE&&(this.size+=4*this.sample_size.length),this.flags&c.TRUN_FLAGS_FLAGS&&(this.size+=4*this.sample_flags.length),this.flags&c.TRUN_FLAGS_CTS_OFFSET&&(this.size+=4*this.sample_composition_time_offset.length),this.writeHeader(e),e.writeUint32(this.sample_count),this.flags&c.TRUN_FLAGS_DATA_OFFSET&&(this.data_offset_position=e.getPosition(),e.writeInt32(this.data_offset)),this.flags&c.TRUN_FLAGS_FIRST_FLAG&&e.writeUint32(this.first_sample_flags);for(var t=0;t<this.sample_count;t++)this.flags&c.TRUN_FLAGS_DURATION&&e.writeUint32(this.sample_duration[t]),this.flags&c.TRUN_FLAGS_SIZE&&e.writeUint32(this.sample_size[t]),this.flags&c.TRUN_FLAGS_FLAGS&&e.writeUint32(this.sample_flags[t]),this.flags&c.TRUN_FLAGS_CTS_OFFSET&&(this.version===0?e.writeUint32(this.sample_composition_time_offset[t]):e.writeInt32(this.sample_composition_time_offset[t]))},c[`url Box`].prototype.write=function(e){this.version=0,this.location?(this.flags=0,this.size=this.location.length+1):(this.flags=1,this.size=0),this.writeHeader(e),this.location&&e.writeCString(this.location)},c[`urn Box`].prototype.write=function(e){this.version=0,this.flags=0,this.size=this.name.length+1+(this.location?this.location.length+1:0),this.writeHeader(e),e.writeCString(this.name),this.location&&e.writeCString(this.location)},c.vmhdBox.prototype.write=function(e){this.version=0,this.flags=1,this.size=8,this.writeHeader(e),e.writeUint16(this.graphicsmode),e.writeUint16Array(this.opcolor)},c.cttsBox.prototype.unpack=function(e){var t,n,r=0;for(t=0;t<this.sample_counts.length;t++)for(n=0;n<this.sample_counts[t];n++)e[r].pts=e[r].dts+this.sample_offsets[t],r++},c.sttsBox.prototype.unpack=function(e){var t,n,r=0;for(t=0;t<this.sample_counts.length;t++)for(n=0;n<this.sample_counts[t];n++)r===0?e[r].dts=0:e[r].dts=e[r-1].dts+this.sample_deltas[t],r++},c.stcoBox.prototype.unpack=function(e){var t;for(t=0;t<this.chunk_offsets.length;t++)e[t].offset=this.chunk_offsets[t]},c.stscBox.prototype.unpack=function(e){var t,n,r,a=0,o=0;for(t=0;t<this.first_chunk.length;t++)for(n=0;n<(t+1<this.first_chunk.length?this.first_chunk[t+1]:1/0);n++)for(o++,r=0;r<this.samples_per_chunk[t];r++){if(e[a])e[a].description_index=this.sample_description_index[t],e[a].chunk_index=o;else return;a++}},c.stszBox.prototype.unpack=function(e){var t;for(t=0;t<this.sample_sizes.length;t++)e[t].size=this.sample_sizes[t]},c.DIFF_BOXES_PROP_NAMES=[`boxes`,`entries`,`references`,`subsamples`,`items`,`item_infos`,`extents`,`associations`,`subsegments`,`ranges`,`seekLists`,`seekPoints`,`esd`,`levels`],c.DIFF_PRIMITIVE_ARRAY_PROP_NAMES=[`compatible_brands`,`matrix`,`opcolor`,`sample_counts`,`sample_deltas`,`first_chunk`,`samples_per_chunk`,`sample_sizes`,`chunk_offsets`,`sample_offsets`,`sample_description_index`,`sample_duration`],c.boxEqualFields=function(e,t){if(e&&!t)return!1;for(var n in e)if(c.DIFF_BOXES_PROP_NAMES.indexOf(n)>-1)continue;else if(e[n]instanceof c.Box||t[n]instanceof c.Box)continue;else if(e[n]===void 0||t[n]===void 0)continue;else if(typeof e[n]==`function`||typeof t[n]==`function`)continue;else if(e.subBoxNames&&e.subBoxNames.indexOf(n.slice(0,4))>-1||t.subBoxNames&&t.subBoxNames.indexOf(n.slice(0,4))>-1)continue;else if(n===`data`||n===`start`||n===`size`||n===`creation_time`||n===`modification_time`)continue;else if(c.DIFF_PRIMITIVE_ARRAY_PROP_NAMES.indexOf(n)>-1)continue;else if(e[n]!==t[n])return!1;return!0},c.boxEqual=function(e,t){if(!c.boxEqualFields(e,t))return!1;for(var n=0;n<c.DIFF_BOXES_PROP_NAMES.length;n++){var r=c.DIFF_BOXES_PROP_NAMES[n];if(e[r]&&t[r]&&!c.boxEqual(e[r],t[r]))return!1}return!0};var f=function(){};f.prototype.parseSample=function(e){var t,r,a=new n(e.buffer);for(t=[];!a.isEos();)r=c.parseOneBox(a,!1),r.code===c.OK&&r.box.type===`vttc`&&t.push(r.box);return t},f.prototype.getText=function(e,t,n){function r(e,t,n){return n||=`0`,e+=``,e.length>=t?e:Array(t-e.length+1).join(n)+e}function a(e){var t=Math.floor(e/3600),n=Math.floor((e-t*3600)/60),a=Math.floor(e-t*3600-n*60),o=Math.floor((e-t*3600-n*60-a)*1e3);return``+r(t,2)+`:`+r(n,2)+`:`+r(a,2)+`.`+r(o,3)}for(var o=this.parseSample(n),s=``,c=0;c<o.length;c++){var l=o[c];s+=a(e)+` --> `+a(t)+`\r
|
|
80
80
|
`,s+=l.payl.text}return s};var p=function(){};p.prototype.parseSample=function(e){var t={},r;t.resources=[];var a=new n(e.data.buffer);if(!e.subsamples||e.subsamples.length===0)t.documentString=a.readString(e.data.length);else if(t.documentString=a.readString(e.subsamples[0].size),e.subsamples.length>1)for(r=1;r<e.subsamples.length;r++)t.resources[r]=a.readUint8Array(e.subsamples[r].size);return typeof DOMParser<`u`&&(t.document=new DOMParser().parseFromString(t.documentString,`application/xml`)),t};var m=function(){};m.prototype.parseSample=function(e){return new n(e.data.buffer).readString(e.data.length)},m.prototype.parseConfig=function(e){var t,r=new n(e.buffer);return r.readUint32(),t=r.readCString(),t},e!==void 0&&(e.VTTin4Parser=f,e.XMLSubtitlein4Parser=p,e.Textin4Parser=m);var h=function(e){this.stream=e||new o,this.boxes=[],this.mdats=[],this.moofs=[],this.isProgressive=!1,this.moovStartFound=!1,this.onMoovStart=null,this.moovStartSent=!1,this.onReady=null,this.readySent=!1,this.onSegment=null,this.onSamples=null,this.onError=null,this.sampleListBuilt=!1,this.fragmentedTracks=[],this.extractedTracks=[],this.isFragmentationInitialized=!1,this.sampleProcessingStarted=!1,this.nextMoofNumber=0,this.itemListBuilt=!1,this.items=[],this.entity_groups=[],this.onSidx=null,this.sidxSent=!1};h.prototype.setSegmentOptions=function(e,t,n){var r=this.getTrackById(e);if(r){var a={};this.fragmentedTracks.push(a),a.id=e,a.user=t,a.trak=r,r.nextSample=0,a.segmentStream=null,a.nb_samples=1e3,a.rapAlignement=!0,n&&(n.nbSamples&&(a.nb_samples=n.nbSamples),n.rapAlignement&&(a.rapAlignement=n.rapAlignement))}},h.prototype.unsetSegmentOptions=function(e){for(var t=-1,n=0;n<this.fragmentedTracks.length;n++)this.fragmentedTracks[n].id==e&&(t=n);t>-1&&this.fragmentedTracks.splice(t,1)},h.prototype.setExtractionOptions=function(e,t,n){var r=this.getTrackById(e);if(r){var a={};this.extractedTracks.push(a),a.id=e,a.user=t,a.trak=r,r.nextSample=0,a.nb_samples=1e3,a.samples=[],n&&n.nbSamples&&(a.nb_samples=n.nbSamples)}},h.prototype.unsetExtractionOptions=function(e){for(var t=-1,n=0;n<this.extractedTracks.length;n++)this.extractedTracks[n].id==e&&(t=n);t>-1&&this.extractedTracks.splice(t,1)},h.prototype.parse=function(){var e,n,r=!1;if(!(this.restoreParsePosition&&!this.restoreParsePosition()))for(;;)if(this.hasIncompleteMdat&&this.hasIncompleteMdat()){if(this.processIncompleteMdat())continue;return}else if(this.saveParsePosition&&this.saveParsePosition(),e=c.parseOneBox(this.stream,r),e.code===c.ERR_NOT_ENOUGH_DATA)if(this.processIncompleteBox){if(this.processIncompleteBox(e))continue;return}else return;else{var a;switch(n=e.box,a=n.type===`uuid`?n.uuid:n.type,this.boxes.push(n),a){case`mdat`:this.mdats.push(n);break;case`moof`:this.moofs.push(n);break;case`moov`:this.moovStartFound=!0,this.mdats.length===0&&(this.isProgressive=!0);default:this[a]!==void 0&&t.warn(`ISOFile`,`Duplicate Box of type: `+a+`, overriding previous occurrence`),this[a]=n;break}this.updateUsedBytes&&this.updateUsedBytes(n,e)}},h.prototype.checkBuffer=function(e){if(e==null)throw`Buffer must be defined and non empty`;if(e.fileStart===void 0)throw`Buffer must have a fileStart property`;return e.byteLength===0?(t.warn(`ISOFile`,`Ignoring empty buffer (fileStart: `+e.fileStart+`)`),this.stream.logBufferLevel(),!1):(t.info(`ISOFile`,`Processing buffer (fileStart: `+e.fileStart+`)`),e.usedBytes=0,this.stream.insertBuffer(e),this.stream.logBufferLevel(),this.stream.initialized()?!0:(t.warn(`ISOFile`,`Not ready to start parsing`),!1))},h.prototype.appendBuffer=function(e,n){var r;if(this.checkBuffer(e))return this.parse(),this.moovStartFound&&!this.moovStartSent&&(this.moovStartSent=!0,this.onMoovStart&&this.onMoovStart()),this.moov?(this.sampleListBuilt||=(this.buildSampleLists(),!0),this.updateSampleLists(),this.onReady&&!this.readySent&&(this.readySent=!0,this.onReady(this.getInfo())),this.processSamples(n),this.nextSeekPosition?(r=this.nextSeekPosition,this.nextSeekPosition=void 0):r=this.nextParsePosition,this.stream.getEndFilePositionAfter&&(r=this.stream.getEndFilePositionAfter(r))):r=this.nextParsePosition?this.nextParsePosition:0,this.sidx&&this.onSidx&&!this.sidxSent&&(this.onSidx(this.sidx),this.sidxSent=!0),this.meta&&(this.flattenItemInfo&&!this.itemListBuilt&&(this.flattenItemInfo(),this.itemListBuilt=!0),this.processItems&&this.processItems(this.onItem)),this.stream.cleanBuffers&&(t.info(`ISOFile`,`Done processing buffer (fileStart: `+e.fileStart+`) - next buffer to fetch should have a fileStart position of `+r),this.stream.logBufferLevel(),this.stream.cleanBuffers(),this.stream.logBufferLevel(!0),t.info(`ISOFile`,`Sample data size in memory: `+this.getAllocatedSampleDataSize())),r},h.prototype.getInfo=function(){var e,t,n={},r,a,o,s,c=new Date(`1904-01-01T00:00:00Z`).getTime();if(this.moov)for(n.hasMoov=!0,n.duration=this.moov.mvhd.duration,n.timescale=this.moov.mvhd.timescale,n.isFragmented=this.moov.mvex!=null,n.isFragmented&&this.moov.mvex.mehd&&(n.fragment_duration=this.moov.mvex.mehd.fragment_duration),n.isProgressive=this.isProgressive,n.hasIOD=this.moov.iods!=null,n.brands=[],n.brands.push(this.ftyp.major_brand),n.brands=n.brands.concat(this.ftyp.compatible_brands),n.created=new Date(c+this.moov.mvhd.creation_time*1e3),n.modified=new Date(c+this.moov.mvhd.modification_time*1e3),n.tracks=[],n.audioTracks=[],n.videoTracks=[],n.subtitleTracks=[],n.metadataTracks=[],n.hintTracks=[],n.otherTracks=[],e=0;e<this.moov.traks.length;e++){if(r=this.moov.traks[e],s=r.mdia.minf.stbl.stsd.entries[0],a={},n.tracks.push(a),a.id=r.tkhd.track_id,a.name=r.mdia.hdlr.name,a.references=[],r.tref)for(t=0;t<r.tref.boxes.length;t++)o={},a.references.push(o),o.type=r.tref.boxes[t].type,o.track_ids=r.tref.boxes[t].track_ids;r.edts&&(a.edits=r.edts.elst.entries),a.created=new Date(c+r.tkhd.creation_time*1e3),a.modified=new Date(c+r.tkhd.modification_time*1e3),a.movie_duration=r.tkhd.duration,a.movie_timescale=n.timescale,a.layer=r.tkhd.layer,a.alternate_group=r.tkhd.alternate_group,a.volume=r.tkhd.volume,a.matrix=r.tkhd.matrix,a.track_width=r.tkhd.width/65536,a.track_height=r.tkhd.height/65536,a.timescale=r.mdia.mdhd.timescale,a.cts_shift=r.mdia.minf.stbl.cslg,a.duration=r.mdia.mdhd.duration,a.samples_duration=r.samples_duration,a.codec=s.getCodec(),a.kind=r.udta&&r.udta.kinds.length?r.udta.kinds[0]:{schemeURI:``,value:``},a.language=r.mdia.elng?r.mdia.elng.extended_language:r.mdia.mdhd.languageString,a.nb_samples=r.samples.length,a.size=r.samples_size,a.bitrate=a.size*8*a.timescale/a.samples_duration,s.isAudio()?(a.type=`audio`,n.audioTracks.push(a),a.audio={},a.audio.sample_rate=s.getSampleRate(),a.audio.channel_count=s.getChannelCount(),a.audio.sample_size=s.getSampleSize()):s.isVideo()?(a.type=`video`,n.videoTracks.push(a),a.video={},a.video.width=s.getWidth(),a.video.height=s.getHeight()):s.isSubtitle()?(a.type=`subtitles`,n.subtitleTracks.push(a)):s.isHint()?(a.type=`metadata`,n.hintTracks.push(a)):s.isMetadata()?(a.type=`metadata`,n.metadataTracks.push(a)):(a.type=`metadata`,n.otherTracks.push(a))}else n.hasMoov=!1;if(n.mime=``,n.hasMoov&&n.tracks){for(n.videoTracks&&n.videoTracks.length>0?n.mime+=`video/mp4; codecs="`:n.audioTracks&&n.audioTracks.length>0?n.mime+=`audio/mp4; codecs="`:n.mime+=`application/mp4; codecs="`,e=0;e<n.tracks.length;e++)e!==0&&(n.mime+=`,`),n.mime+=n.tracks[e].codec;n.mime+=`"; profiles="`,n.mime+=this.ftyp.compatible_brands.join(),n.mime+=`"`}return n},h.prototype.setNextSeekPositionFromSample=function(e){e&&(this.nextSeekPosition?this.nextSeekPosition=Math.min(e.offset+e.alreadyRead,this.nextSeekPosition):this.nextSeekPosition=e.offset+e.alreadyRead)},h.prototype.processSamples=function(e){var n,r;if(this.sampleProcessingStarted){if(this.isFragmentationInitialized&&this.onSegment!==null)for(n=0;n<this.fragmentedTracks.length;n++){var a=this.fragmentedTracks[n];for(r=a.trak;r.nextSample<r.samples.length&&this.sampleProcessingStarted;){t.debug(`ISOFile`,`Creating media fragment on track #`+a.id+` for sample `+r.nextSample);var o=this.createFragment(a.id,r.nextSample,a.segmentStream);if(o)a.segmentStream=o,r.nextSample++;else break;if((r.nextSample%a.nb_samples===0||e||r.nextSample>=r.samples.length)&&(t.info(`ISOFile`,`Sending fragmented data on track #`+a.id+` for samples [`+Math.max(0,r.nextSample-a.nb_samples)+`,`+(r.nextSample-1)+`]`),t.info(`ISOFile`,`Sample data size in memory: `+this.getAllocatedSampleDataSize()),this.onSegment&&this.onSegment(a.id,a.user,a.segmentStream.buffer,r.nextSample,e||r.nextSample>=r.samples.length),a.segmentStream=null,a!==this.fragmentedTracks[n]))break}}if(this.onSamples!==null)for(n=0;n<this.extractedTracks.length;n++){var s=this.extractedTracks[n];for(r=s.trak;r.nextSample<r.samples.length&&this.sampleProcessingStarted;){t.debug(`ISOFile`,`Exporting on track #`+s.id+` sample #`+r.nextSample);var c=this.getSample(r,r.nextSample);if(c)r.nextSample++,s.samples.push(c);else{this.setNextSeekPositionFromSample(r.samples[r.nextSample]);break}if((r.nextSample%s.nb_samples===0||r.nextSample>=r.samples.length)&&(t.debug(`ISOFile`,`Sending samples on track #`+s.id+` for sample `+r.nextSample),this.onSamples&&this.onSamples(s.id,s.user,s.samples),s.samples=[],s!==this.extractedTracks[n]))break}}}},h.prototype.getBox=function(e){var t=this.getBoxes(e,!0);return t.length?t[0]:null},h.prototype.getBoxes=function(e,t){var n=[];return h._sweep.call(this,e,n,t),n},h._sweep=function(e,t,n){for(var r in this.type&&this.type==e&&t.push(this),this.boxes){if(t.length&&n)return;h._sweep.call(this.boxes[r],e,t,n)}},h.prototype.getTrackSamplesInfo=function(e){var t=this.getTrackById(e);if(t)return t.samples},h.prototype.getTrackSample=function(e,t){var n=this.getTrackById(e);return this.getSample(n,t)},h.prototype.releaseUsedSamples=function(e,n){var r=0,a=this.getTrackById(e);a.lastValidSample||=0;for(var o=a.lastValidSample;o<n;o++)r+=this.releaseSample(a,o);t.info(`ISOFile`,`Track #`+e+` released samples up to `+n+` (released size: `+r+`, remaining: `+this.samplesDataSize+`)`),a.lastValidSample=n},h.prototype.start=function(){this.sampleProcessingStarted=!0,this.processSamples(!1)},h.prototype.stop=function(){this.sampleProcessingStarted=!1},h.prototype.flush=function(){t.info(`ISOFile`,`Flushing remaining samples`),this.updateSampleLists(),this.processSamples(!0),this.stream.cleanBuffers(),this.stream.logBufferLevel(!0)},h.prototype.seekTrack=function(e,n,r){var a,o,s=1/0,c=0,l=0,u;if(r.samples.length===0)return t.info(`ISOFile`,`No sample in track, cannot seek! Using time `+t.getDurationString(0,1)+` and offset: 0`),{offset:0,time:0};for(a=0;a<r.samples.length;a++){if(o=r.samples[a],a===0)l=0,u=o.timescale;else if(o.cts>e*o.timescale){l=a-1;break}n&&o.is_sync&&(c=a)}for(n&&(l=c),e=r.samples[l].cts,r.nextSample=l;r.samples[l].alreadyRead===r.samples[l].size&&r.samples[l+1];)l++;return s=r.samples[l].offset+r.samples[l].alreadyRead,t.info(`ISOFile`,`Seeking to `+(n?`RAP`:``)+` sample #`+r.nextSample+` on track `+r.tkhd.track_id+`, time `+t.getDurationString(e,u)+` and offset: `+s),{offset:s,time:e/u}},h.prototype.getTrackDuration=function(e){var t;return e.samples?(t=e.samples[e.samples.length-1],(t.cts+t.duration)/t.timescale):1/0},h.prototype.seek=function(e,n){var r=this.moov,a,o,s,c={offset:1/0,time:1/0};if(this.moov){for(s=0;s<r.traks.length;s++)a=r.traks[s],!(e>this.getTrackDuration(a))&&(o=this.seekTrack(e,n,a),o.offset<c.offset&&(c.offset=o.offset),o.time<c.time&&(c.time=o.time));return t.info(`ISOFile`,`Seeking at time `+t.getDurationString(c.time,1)+` needs a buffer with a fileStart position of `+c.offset),c.offset===1/0?c={offset:this.nextParsePosition,time:0}:c.offset=this.stream.getEndFilePositionAfter(c.offset),t.info(`ISOFile`,`Adjusted seek position (after checking data already in buffer): `+c.offset),c}else throw`Cannot seek: moov not received!`},h.prototype.equal=function(e){for(var t=0;t<this.boxes.length&&t<e.boxes.length;){var n=this.boxes[t],r=e.boxes[t];if(!c.boxEqual(n,r))return!1;t++}return!0},e!==void 0&&(e.ISOFile=h),h.prototype.lastBoxStartPosition=0,h.prototype.parsingMdat=null,h.prototype.nextParsePosition=0,h.prototype.discardMdatData=!1,h.prototype.processIncompleteBox=function(e){var t,n,r;return e.type===`mdat`?(t=new c[e.type+`Box`](e.size),this.parsingMdat=t,this.boxes.push(t),this.mdats.push(t),t.start=e.start,t.hdr_size=e.hdr_size,this.stream.addUsedBytes(t.hdr_size),this.lastBoxStartPosition=t.start+t.size,r=this.stream.seek(t.start+t.size,!1,this.discardMdatData),r?(this.parsingMdat=null,!0):(this.moovStartFound?this.nextParsePosition=this.stream.findEndContiguousBuf():this.nextParsePosition=t.start+t.size,!1)):(e.type===`moov`&&(this.moovStartFound=!0,this.mdats.length===0&&(this.isProgressive=!0)),n=this.stream.mergeNextBuffer?this.stream.mergeNextBuffer():!1,n?(this.nextParsePosition=this.stream.getEndPosition(),!0):(e.type?this.moovStartFound?this.nextParsePosition=this.stream.getEndPosition():this.nextParsePosition=this.stream.getPosition()+e.size:this.nextParsePosition=this.stream.getEndPosition(),!1))},h.prototype.hasIncompleteMdat=function(){return this.parsingMdat!==null},h.prototype.processIncompleteMdat=function(){var e=this.parsingMdat;return this.stream.seek(e.start+e.size,!1,this.discardMdatData)?(t.debug(`ISOFile`,`Found 'mdat' end in buffered data`),this.parsingMdat=null,!0):(this.nextParsePosition=this.stream.findEndContiguousBuf(),!1)},h.prototype.restoreParsePosition=function(){return this.stream.seek(this.lastBoxStartPosition,!0,this.discardMdatData)},h.prototype.saveParsePosition=function(){this.lastBoxStartPosition=this.stream.getPosition()},h.prototype.updateUsedBytes=function(e,t){this.stream.addUsedBytes&&(e.type===`mdat`?(this.stream.addUsedBytes(e.hdr_size),this.discardMdatData&&this.stream.addUsedBytes(e.size-e.hdr_size)):this.stream.addUsedBytes(e.size))},h.prototype.add=c.Box.prototype.add,h.prototype.addBox=c.Box.prototype.addBox,h.prototype.init=function(e){var t=e||{};this.add(`ftyp`).set(`major_brand`,t.brands&&t.brands[0]||`iso4`).set(`minor_version`,0).set(`compatible_brands`,t.brands||[`iso4`]);var n=this.add(`moov`);return n.add(`mvhd`).set(`timescale`,t.timescale||600).set(`rate`,t.rate||65536).set(`creation_time`,0).set(`modification_time`,0).set(`duration`,t.duration||0).set(`volume`,t.width?0:256).set(`matrix`,[65536,0,0,0,65536,0,0,0,1073741824]).set(`next_track_id`,1),n.add(`mvex`),this},h.prototype.addTrack=function(e){this.moov||this.init(e);var t=e||{};t.width=t.width||320,t.height=t.height||320,t.id=t.id||this.moov.mvhd.next_track_id,t.type=t.type||`avc1`;var r=this.moov.add(`trak`);this.moov.mvhd.next_track_id=t.id+1,r.add(`tkhd`).set(`flags`,c.TKHD_FLAG_ENABLED|c.TKHD_FLAG_IN_MOVIE|c.TKHD_FLAG_IN_PREVIEW).set(`creation_time`,0).set(`modification_time`,0).set(`track_id`,t.id).set(`duration`,t.duration||0).set(`layer`,t.layer||0).set(`alternate_group`,0).set(`volume`,1).set(`matrix`,[65536,0,0,0,65536,0,0,0,1073741824]).set(`width`,t.width<<16).set(`height`,t.height<<16);var a=r.add(`mdia`);a.add(`mdhd`).set(`creation_time`,0).set(`modification_time`,0).set(`timescale`,t.timescale||1).set(`duration`,t.media_duration||0).set(`language`,t.language||`und`),a.add(`hdlr`).set(`handler`,t.hdlr||`vide`).set(`name`,t.name||`Track created with MP4Box.js`),a.add(`elng`).set(`extended_language`,t.language||`fr-FR`);var o=a.add(`minf`);if(c[t.type+`SampleEntry`]!==void 0){var s=new c[t.type+`SampleEntry`];s.data_reference_index=1;var l=``;for(var u in c.sampleEntryCodes)for(var d=c.sampleEntryCodes[u],f=0;f<d.length;f++)if(d.indexOf(t.type)>-1){l=u;break}switch(l){case`Visual`:if(o.add(`vmhd`).set(`graphicsmode`,0).set(`opcolor`,[0,0,0]),s.set(`width`,t.width).set(`height`,t.height).set(`horizresolution`,72<<16).set(`vertresolution`,72<<16).set(`frame_count`,1).set(`compressorname`,t.type+` Compressor`).set(`depth`,24),t.avcDecoderConfigRecord){var p=new c.avcCBox;p.parse(new n(t.avcDecoderConfigRecord)),s.addBox(p)}else if(t.hevcDecoderConfigRecord){var m=new c.hvcCBox;m.parse(new n(t.hevcDecoderConfigRecord)),s.addBox(m)}break;case`Audio`:o.add(`smhd`).set(`balance`,t.balance||0),s.set(`channel_count`,t.channel_count||2).set(`samplesize`,t.samplesize||16).set(`samplerate`,t.samplerate||65536);break;case`Hint`:o.add(`hmhd`);break;case`Subtitle`:switch(o.add(`sthd`),t.type){case`stpp`:s.set(`namespace`,t.namespace||`nonamespace`).set(`schema_location`,t.schema_location||``).set(`auxiliary_mime_types`,t.auxiliary_mime_types||``);break}break;case`Metadata`:o.add(`nmhd`);break;case`System`:o.add(`nmhd`);break;default:o.add(`nmhd`);break}t.description&&s.addBox(t.description),t.description_boxes&&t.description_boxes.forEach(function(e){s.addBox(e)}),o.add(`dinf`).add(`dref`).addEntry(new c[`url Box`]().set(`flags`,1));var h=o.add(`stbl`);return h.add(`stsd`).addEntry(s),h.add(`stts`).set(`sample_counts`,[]).set(`sample_deltas`,[]),h.add(`stsc`).set(`first_chunk`,[]).set(`samples_per_chunk`,[]).set(`sample_description_index`,[]),h.add(`stco`).set(`chunk_offsets`,[]),h.add(`stsz`).set(`sample_sizes`,[]),this.moov.mvex.add(`trex`).set(`track_id`,t.id).set(`default_sample_description_index`,t.default_sample_description_index||1).set(`default_sample_duration`,t.default_sample_duration||0).set(`default_sample_size`,t.default_sample_size||0).set(`default_sample_flags`,t.default_sample_flags||0),this.buildTrakSampleLists(r),t.id}},c.Box.prototype.computeSize=function(e){var t=e||new r;t.endianness=r.BIG_ENDIAN,this.write(t)},h.prototype.addSample=function(e,t,n){var r=n||{},a={},o=this.getTrackById(e);if(o!==null){a.number=o.samples.length,a.track_id=o.tkhd.track_id,a.timescale=o.mdia.mdhd.timescale,a.description_index=r.sample_description_index?r.sample_description_index-1:0,a.description=o.mdia.minf.stbl.stsd.entries[a.description_index],a.data=t,a.size=t.byteLength,a.alreadyRead=a.size,a.duration=r.duration||1,a.cts=r.cts||0,a.dts=r.dts||0,a.is_sync=r.is_sync||!1,a.is_leading=r.is_leading||0,a.depends_on=r.depends_on||0,a.is_depended_on=r.is_depended_on||0,a.has_redundancy=r.has_redundancy||0,a.degradation_priority=r.degradation_priority||0,a.offset=0,a.subsamples=r.subsamples,o.samples.push(a),o.samples_size+=a.size,o.samples_duration+=a.duration,o.first_dts===void 0&&(o.first_dts=r.dts),this.processSamples();var s=this.createSingleSampleMoof(a);return this.addBox(s),s.computeSize(),s.trafs[0].truns[0].data_offset=s.size+8,this.add(`mdat`).data=new Uint8Array(t),a}},h.prototype.createSingleSampleMoof=function(e){var t=0;t=e.is_sync?1<<25:65536;var n=new c.moofBox;n.add(`mfhd`).set(`sequence_number`,this.nextMoofNumber),this.nextMoofNumber++;var r=n.add(`traf`),a=this.getTrackById(e.track_id);return r.add(`tfhd`).set(`track_id`,e.track_id).set(`flags`,c.TFHD_FLAG_DEFAULT_BASE_IS_MOOF),r.add(`tfdt`).set(`baseMediaDecodeTime`,e.dts-(a.first_dts||0)),r.add(`trun`).set(`flags`,c.TRUN_FLAGS_DATA_OFFSET|c.TRUN_FLAGS_DURATION|c.TRUN_FLAGS_SIZE|c.TRUN_FLAGS_FLAGS|c.TRUN_FLAGS_CTS_OFFSET).set(`data_offset`,0).set(`first_sample_flags`,0).set(`sample_count`,1).set(`sample_duration`,[e.duration]).set(`sample_size`,[e.size]).set(`sample_flags`,[t]).set(`sample_composition_time_offset`,[e.cts-e.dts]),n},h.prototype.lastMoofIndex=0,h.prototype.samplesDataSize=0,h.prototype.resetTables=function(){var e,t,n,r,a,o,s,c;for(this.initial_duration=this.moov.mvhd.duration,this.moov.mvhd.duration=0,e=0;e<this.moov.traks.length;e++){t=this.moov.traks[e],t.tkhd.duration=0,t.mdia.mdhd.duration=0,n=t.mdia.minf.stbl.stco||t.mdia.minf.stbl.co64,n.chunk_offsets=[],r=t.mdia.minf.stbl.stsc,r.first_chunk=[],r.samples_per_chunk=[],r.sample_description_index=[],a=t.mdia.minf.stbl.stsz||t.mdia.minf.stbl.stz2,a.sample_sizes=[],o=t.mdia.minf.stbl.stts,o.sample_counts=[],o.sample_deltas=[],s=t.mdia.minf.stbl.ctts,s&&(s.sample_counts=[],s.sample_offsets=[]),c=t.mdia.minf.stbl.stss;var l=t.mdia.minf.stbl.boxes.indexOf(c);l!=-1&&(t.mdia.minf.stbl.boxes[l]=null)}},h.initSampleGroups=function(e,t,n,r,a){var o,s,c,l;function u(e,t,n){this.grouping_type=e,this.grouping_type_parameter=t,this.sbgp=n,this.last_sample_in_run=-1,this.entry_index=-1}for(t&&(t.sample_groups_info=[]),e.sample_groups_info||=[],s=0;s<n.length;s++){for(l=n[s].grouping_type+`/`+n[s].grouping_type_parameter,c=new u(n[s].grouping_type,n[s].grouping_type_parameter,n[s]),t&&(t.sample_groups_info[l]=c),e.sample_groups_info[l]||(e.sample_groups_info[l]=c),o=0;o<r.length;o++)r[o].grouping_type===n[s].grouping_type&&(c.description=r[o],c.description.used=!0);if(a)for(o=0;o<a.length;o++)a[o].grouping_type===n[s].grouping_type&&(c.fragment_description=a[o],c.fragment_description.used=!0,c.is_fragment=!0)}if(!t)for(s=0;s<r.length;s++)!r[s].used&&r[s].version>=2&&(l=r[s].grouping_type+`/0`,c=new u(r[s].grouping_type,0),e.sample_groups_info[l]||(e.sample_groups_info[l]=c));else if(a)for(s=0;s<a.length;s++)!a[s].used&&a[s].version>=2&&(l=a[s].grouping_type+`/0`,c=new u(a[s].grouping_type,0),c.is_fragment=!0,t.sample_groups_info[l]||(t.sample_groups_info[l]=c))},h.setSampleGroupProperties=function(e,t,n,r){var a,o;for(a in t.sample_groups=[],r)if(t.sample_groups[a]={},t.sample_groups[a].grouping_type=r[a].grouping_type,t.sample_groups[a].grouping_type_parameter=r[a].grouping_type_parameter,n>=r[a].last_sample_in_run&&(r[a].last_sample_in_run<0&&(r[a].last_sample_in_run=0),r[a].entry_index++,r[a].entry_index<=r[a].sbgp.entries.length-1&&(r[a].last_sample_in_run+=r[a].sbgp.entries[r[a].entry_index].sample_count)),r[a].entry_index<=r[a].sbgp.entries.length-1?t.sample_groups[a].group_description_index=r[a].sbgp.entries[r[a].entry_index].group_description_index:t.sample_groups[a].group_description_index=-1,t.sample_groups[a].group_description_index!==0){var s=r[a].fragment_description?r[a].fragment_description:r[a].description;t.sample_groups[a].group_description_index>0?(o=t.sample_groups[a].group_description_index>65535?(t.sample_groups[a].group_description_index>>16)-1:t.sample_groups[a].group_description_index-1,s&&o>=0&&(t.sample_groups[a].description=s.entries[o])):s&&s.version>=2&&s.default_group_description_index>0&&(t.sample_groups[a].description=s.entries[s.default_group_description_index-1])}},h.process_sdtp=function(e,t,n){t&&(e?(t.is_leading=e.is_leading[n],t.depends_on=e.sample_depends_on[n],t.is_depended_on=e.sample_is_depended_on[n],t.has_redundancy=e.sample_has_redundancy[n]):(t.is_leading=0,t.depends_on=0,t.is_depended_on=0,t.has_redundancy=0))},h.prototype.buildSampleLists=function(){var e,t;for(e=0;e<this.moov.traks.length;e++)t=this.moov.traks[e],this.buildTrakSampleLists(t)},h.prototype.buildTrakSampleLists=function(e){var t,n,r,a,o,s,c,l,u,d,f,p,m,g,_,v,y,b,ee,x,S,C,w,te;if(e.samples=[],e.samples_duration=0,e.samples_size=0,n=e.mdia.minf.stbl.stco||e.mdia.minf.stbl.co64,r=e.mdia.minf.stbl.stsc,a=e.mdia.minf.stbl.stsz||e.mdia.minf.stbl.stz2,o=e.mdia.minf.stbl.stts,s=e.mdia.minf.stbl.ctts,c=e.mdia.minf.stbl.stss,l=e.mdia.minf.stbl.stsd,u=e.mdia.minf.stbl.subs,p=e.mdia.minf.stbl.stdp,d=e.mdia.minf.stbl.sbgps,f=e.mdia.minf.stbl.sgpds,b=-1,ee=-1,x=-1,S=-1,C=0,w=0,te=0,h.initSampleGroups(e,null,d,f),a!==void 0){for(t=0;t<a.sample_sizes.length;t++){var T={};T.number=t,T.track_id=e.tkhd.track_id,T.timescale=e.mdia.mdhd.timescale,T.alreadyRead=0,e.samples[t]=T,T.size=a.sample_sizes[t],e.samples_size+=T.size,t===0?(g=1,m=0,T.chunk_index=g,T.chunk_run_index=m,y=r.samples_per_chunk[m],v=0,_=m+1<r.first_chunk.length?r.first_chunk[m+1]-1:1/0):t<y?(T.chunk_index=g,T.chunk_run_index=m):(g++,T.chunk_index=g,v=0,g<=_||(m++,_=m+1<r.first_chunk.length?r.first_chunk[m+1]-1:1/0),T.chunk_run_index=m,y+=r.samples_per_chunk[m]),T.description_index=r.sample_description_index[T.chunk_run_index]-1,T.description=l.entries[T.description_index],T.offset=n.chunk_offsets[T.chunk_index-1]+v,v+=T.size,t>b&&(ee++,b<0&&(b=0),b+=o.sample_counts[ee]),t>0?(e.samples[t-1].duration=o.sample_deltas[ee],e.samples_duration+=e.samples[t-1].duration,T.dts=e.samples[t-1].dts+e.samples[t-1].duration):T.dts=0,s?(t>=x&&(S++,x<0&&(x=0),x+=s.sample_counts[S]),T.cts=e.samples[t].dts+s.sample_offsets[S]):T.cts=T.dts,c?(t==c.sample_numbers[C]-1?(T.is_sync=!0,C++):(T.is_sync=!1,T.degradation_priority=0),u&&u.entries[w].sample_delta+te==t+1&&(T.subsamples=u.entries[w].subsamples,te+=u.entries[w].sample_delta,w++)):T.is_sync=!0,h.process_sdtp(e.mdia.minf.stbl.sdtp,T,T.number),p?T.degradation_priority=p.priority[t]:T.degradation_priority=0,u&&u.entries[w].sample_delta+te==t&&(T.subsamples=u.entries[w].subsamples,te+=u.entries[w].sample_delta),(d.length>0||f.length>0)&&h.setSampleGroupProperties(e,T,t,e.sample_groups_info)}t>0&&(e.samples[t-1].duration=Math.max(e.mdia.mdhd.duration-e.samples[t-1].dts,0),e.samples_duration+=e.samples[t-1].duration)}},h.prototype.updateSampleLists=function(){var e,t,n,r,a,o,s,l,u,d,f,p,m,g,_;if(this.moov!==void 0){for(;this.lastMoofIndex<this.moofs.length;)if(u=this.moofs[this.lastMoofIndex],this.lastMoofIndex++,u.type==`moof`)for(d=u,e=0;e<d.trafs.length;e++){for(f=d.trafs[e],p=this.getTrackById(f.tfhd.track_id),m=this.getTrexById(f.tfhd.track_id),r=f.tfhd.flags&c.TFHD_FLAG_SAMPLE_DESC?f.tfhd.default_sample_description_index:m?m.default_sample_description_index:1,a=f.tfhd.flags&c.TFHD_FLAG_SAMPLE_DUR?f.tfhd.default_sample_duration:m?m.default_sample_duration:0,o=f.tfhd.flags&c.TFHD_FLAG_SAMPLE_SIZE?f.tfhd.default_sample_size:m?m.default_sample_size:0,s=f.tfhd.flags&c.TFHD_FLAG_SAMPLE_FLAGS?f.tfhd.default_sample_flags:m?m.default_sample_flags:0,f.sample_number=0,f.sbgps.length>0&&h.initSampleGroups(p,f,f.sbgps,p.mdia.minf.stbl.sgpds,f.sgpds),t=0;t<f.truns.length;t++){var v=f.truns[t];for(n=0;n<v.sample_count;n++){g={},g.moof_number=this.lastMoofIndex,g.number_in_traf=f.sample_number,f.sample_number++,g.number=p.samples.length,f.first_sample_index=p.samples.length,p.samples.push(g),g.track_id=p.tkhd.track_id,g.timescale=p.mdia.mdhd.timescale,g.description_index=r-1,g.description=p.mdia.minf.stbl.stsd.entries[g.description_index],g.size=o,v.flags&c.TRUN_FLAGS_SIZE&&(g.size=v.sample_size[n]),p.samples_size+=g.size,g.duration=a,v.flags&c.TRUN_FLAGS_DURATION&&(g.duration=v.sample_duration[n]),p.samples_duration+=g.duration,p.first_traf_merged||n>0?g.dts=p.samples[p.samples.length-2].dts+p.samples[p.samples.length-2].duration:(f.tfdt?g.dts=f.tfdt.baseMediaDecodeTime:g.dts=0,p.first_traf_merged=!0),g.cts=g.dts,v.flags&c.TRUN_FLAGS_CTS_OFFSET&&(g.cts=g.dts+v.sample_composition_time_offset[n]),_=s,v.flags&c.TRUN_FLAGS_FLAGS?_=v.sample_flags[n]:n===0&&v.flags&c.TRUN_FLAGS_FIRST_FLAG&&(_=v.first_sample_flags),g.is_sync=!(_>>16&1),g.is_leading=_>>26&3,g.depends_on=_>>24&3,g.is_depended_on=_>>22&3,g.has_redundancy=_>>20&3,g.degradation_priority=_&65535;var y=!!(f.tfhd.flags&c.TFHD_FLAG_BASE_DATA_OFFSET),b=!!(f.tfhd.flags&c.TFHD_FLAG_DEFAULT_BASE_IS_MOOF),ee=!!(v.flags&c.TRUN_FLAGS_DATA_OFFSET),x=0;x=y?f.tfhd.base_data_offset:b||t===0?d.start:l,t===0&&n===0?ee?g.offset=x+v.data_offset:g.offset=x:g.offset=l,l=g.offset+g.size,(f.sbgps.length>0||f.sgpds.length>0||p.mdia.minf.stbl.sbgps.length>0||p.mdia.minf.stbl.sgpds.length>0)&&h.setSampleGroupProperties(p,g,g.number_in_traf,f.sample_groups_info)}}if(f.subs){p.has_fragment_subsamples=!0;var S=f.first_sample_index;for(t=0;t<f.subs.entries.length;t++)S+=f.subs.entries[t].sample_delta,g=p.samples[S-1],g.subsamples=f.subs.entries[t].subsamples}}}},h.prototype.getSample=function(e,n){var a,o=e.samples[n];if(!this.moov)return null;if(!o.data)o.data=new Uint8Array(o.size),o.alreadyRead=0,this.samplesDataSize+=o.size,t.debug(`ISOFile`,`Allocating sample #`+n+` on track #`+e.tkhd.track_id+` of size `+o.size+` (total: `+this.samplesDataSize+`)`);else if(o.alreadyRead==o.size)return o;for(;;){var s=this.stream.findPosition(!0,o.offset+o.alreadyRead,!1);if(s>-1){a=this.stream.buffers[s];var c=a.byteLength-(o.offset+o.alreadyRead-a.fileStart);if(o.size-o.alreadyRead<=c)return t.debug(`ISOFile`,`Getting sample #`+n+` data (alreadyRead: `+o.alreadyRead+` offset: `+(o.offset+o.alreadyRead-a.fileStart)+` read size: `+(o.size-o.alreadyRead)+` full size: `+o.size+`)`),r.memcpy(o.data.buffer,o.alreadyRead,a,o.offset+o.alreadyRead-a.fileStart,o.size-o.alreadyRead),a.usedBytes+=o.size-o.alreadyRead,this.stream.logBufferLevel(),o.alreadyRead=o.size,o;if(c===0)return null;t.debug(`ISOFile`,`Getting sample #`+n+` partial data (alreadyRead: `+o.alreadyRead+` offset: `+(o.offset+o.alreadyRead-a.fileStart)+` read size: `+c+` full size: `+o.size+`)`),r.memcpy(o.data.buffer,o.alreadyRead,a,o.offset+o.alreadyRead-a.fileStart,c),o.alreadyRead+=c,a.usedBytes+=c,this.stream.logBufferLevel()}else return null}},h.prototype.releaseSample=function(e,t){var n=e.samples[t];return n.data?(this.samplesDataSize-=n.size,n.data=null,n.alreadyRead=0,n.size):0},h.prototype.getAllocatedSampleDataSize=function(){return this.samplesDataSize},h.prototype.getCodecs=function(){var e,t=``;for(e=0;e<this.moov.traks.length;e++){var n=this.moov.traks[e];e>0&&(t+=`,`),t+=n.mdia.minf.stbl.stsd.entries[0].getCodec()}return t},h.prototype.getTrexById=function(e){var t;if(!this.moov||!this.moov.mvex)return null;for(t=0;t<this.moov.mvex.trexs.length;t++){var n=this.moov.mvex.trexs[t];if(n.track_id==e)return n}return null},h.prototype.getTrackById=function(e){if(this.moov===void 0)return null;for(var t=0;t<this.moov.traks.length;t++){var n=this.moov.traks[t];if(n.tkhd.track_id==e)return n}return null},h.prototype.itemsDataSize=0,h.prototype.flattenItemInfo=function(){var e=this.items,n=this.entity_groups,r,a,o,s=this.meta;if(s!=null&&s.hdlr!==void 0&&s.iinf!==void 0){for(r=0;r<s.iinf.item_infos.length;r++)o={},o.id=s.iinf.item_infos[r].item_ID,e[o.id]=o,o.ref_to=[],o.name=s.iinf.item_infos[r].item_name,s.iinf.item_infos[r].protection_index>0&&(o.protection=s.ipro.protections[s.iinf.item_infos[r].protection_index-1]),s.iinf.item_infos[r].item_type?o.type=s.iinf.item_infos[r].item_type:o.type=`mime`,o.content_type=s.iinf.item_infos[r].content_type,o.content_encoding=s.iinf.item_infos[r].content_encoding,o.item_uri_type=s.iinf.item_infos[r].item_uri_type;if(s.grpl)for(r=0;r<s.grpl.boxes.length;r++)entity_group={},entity_group.id=s.grpl.boxes[r].group_id,entity_group.entity_ids=s.grpl.boxes[r].entity_ids,entity_group.type=s.grpl.boxes[r].type,n[entity_group.id]=entity_group;if(s.iloc)for(r=0;r<s.iloc.items.length;r++){var c=s.iloc.items[r];switch(o=e[c.item_ID],c.data_reference_index!==0&&(t.warn(`Item storage with reference to other files: not supported`),o.source=s.dinf.boxes[c.data_reference_index-1]),c.construction_method){case 0:break;case 1:break;case 2:t.warn(`Item storage with construction_method : not supported`);break}for(o.extents=[],o.size=0,a=0;a<c.extents.length;a++)o.extents[a]={},o.extents[a].offset=c.extents[a].extent_offset+c.base_offset,c.construction_method==1&&(o.extents[a].offset+=s.idat.start+s.idat.hdr_size),o.extents[a].length=c.extents[a].extent_length,o.extents[a].alreadyRead=0,o.size+=o.extents[a].length}if(s.pitm&&(e[s.pitm.item_id].primary=!0),s.iref)for(r=0;r<s.iref.references.length;r++){var l=s.iref.references[r];for(a=0;a<l.references.length;a++)e[l.from_item_ID].ref_to.push({type:l.type,id:l.references[a]})}if(s.iprp)for(var u=0;u<s.iprp.ipmas.length;u++){var d=s.iprp.ipmas[u];for(r=0;r<d.associations.length;r++){var f=d.associations[r];if(o=e[f.id],o||=n[f.id],o)for(o.properties===void 0&&(o.properties={},o.properties.boxes=[]),a=0;a<f.props.length;a++){var p=f.props[a];if(p.property_index>0&&p.property_index-1<s.iprp.ipco.boxes.length){var m=s.iprp.ipco.boxes[p.property_index-1];o.properties[m.type]=m,o.properties.boxes.push(m)}}}}}},h.prototype.getItem=function(e){var n,a;if(!this.meta)return null;if(a=this.items[e],!a.data&&a.size)a.data=new Uint8Array(a.size),a.alreadyRead=0,this.itemsDataSize+=a.size,t.debug(`ISOFile`,`Allocating item #`+e+` of size `+a.size+` (total: `+this.itemsDataSize+`)`);else if(a.alreadyRead===a.size)return a;for(var o=0;o<a.extents.length;o++){var s=a.extents[o];if(s.alreadyRead!==s.length){var c=this.stream.findPosition(!0,s.offset+s.alreadyRead,!1);if(c>-1){n=this.stream.buffers[c];var l=n.byteLength-(s.offset+s.alreadyRead-n.fileStart);if(s.length-s.alreadyRead<=l)t.debug(`ISOFile`,`Getting item #`+e+` extent #`+o+` data (alreadyRead: `+s.alreadyRead+` offset: `+(s.offset+s.alreadyRead-n.fileStart)+` read size: `+(s.length-s.alreadyRead)+` full extent size: `+s.length+` full item size: `+a.size+`)`),r.memcpy(a.data.buffer,a.alreadyRead,n,s.offset+s.alreadyRead-n.fileStart,s.length-s.alreadyRead),n.usedBytes+=s.length-s.alreadyRead,this.stream.logBufferLevel(),a.alreadyRead+=s.length-s.alreadyRead,s.alreadyRead=s.length;else return t.debug(`ISOFile`,`Getting item #`+e+` extent #`+o+` partial data (alreadyRead: `+s.alreadyRead+` offset: `+(s.offset+s.alreadyRead-n.fileStart)+` read size: `+l+` full extent size: `+s.length+` full item size: `+a.size+`)`),r.memcpy(a.data.buffer,a.alreadyRead,n,s.offset+s.alreadyRead-n.fileStart,l),s.alreadyRead+=l,a.alreadyRead+=l,n.usedBytes+=l,this.stream.logBufferLevel(),null}else return null}}return a.alreadyRead===a.size?a:null},h.prototype.releaseItem=function(e){var t=this.items[e];if(t.data){this.itemsDataSize-=t.size,t.data=null,t.alreadyRead=0;for(var n=0;n<t.extents.length;n++){var r=t.extents[n];r.alreadyRead=0}return t.size}else return 0},h.prototype.processItems=function(e){for(var t in this.items){var n=this.items[t];this.getItem(n.id),e&&!n.sent&&(e(n),n.sent=!0,n.data=null)}},h.prototype.hasItem=function(e){for(var t in this.items){var n=this.items[t];if(n.name===e)return n.id}return-1},h.prototype.getMetaHandler=function(){return this.meta?this.meta.hdlr.handler:null},h.prototype.getPrimaryItem=function(){return!this.meta||!this.meta.pitm?null:this.getItem(this.meta.pitm.item_id)},h.prototype.itemToFragmentedTrackFile=function(e){var t=e||{},n=null;if(n=t.itemId?this.getItem(t.itemId):this.getPrimaryItem(),n==null)return null;var r=new h;r.discardMdatData=!1;var a={type:n.type,description_boxes:n.properties.boxes};n.properties.ispe&&(a.width=n.properties.ispe.image_width,a.height=n.properties.ispe.image_height);var o=r.addTrack(a);return o?(r.addSample(o,n.data),r):null},h.prototype.write=function(e){for(var t=0;t<this.boxes.length;t++)this.boxes[t].write(e)},h.prototype.createFragment=function(e,n,a){var o=this.getTrackById(e),s=this.getSample(o,n);if(s==null)return this.setNextSeekPositionFromSample(o.samples[n]),null;var l=a||new r;l.endianness=r.BIG_ENDIAN;var u=this.createSingleSampleMoof(s);u.write(l),u.trafs[0].truns[0].data_offset=u.size+8,t.debug(`MP4Box`,`Adjusting data_offset with new value `+u.trafs[0].truns[0].data_offset),l.adjustUint32(u.trafs[0].truns[0].data_offset_position,u.trafs[0].truns[0].data_offset);var d=new c.mdatBox;return d.data=s.data,d.write(l),l},h.writeInitializationSegment=function(e,n,a,o){var s;t.debug(`ISOFile`,`Generating initialization segment`);var c=new r;c.endianness=r.BIG_ENDIAN,e.write(c);var l=n.add(`mvex`);for(a&&l.add(`mehd`).set(`fragment_duration`,a),s=0;s<n.traks.length;s++)l.add(`trex`).set(`track_id`,n.traks[s].tkhd.track_id).set(`default_sample_description_index`,1).set(`default_sample_duration`,o).set(`default_sample_size`,0).set(`default_sample_flags`,65536);return n.write(c),c.buffer},h.prototype.save=function(e){var t=new r;t.endianness=r.BIG_ENDIAN,this.write(t),t.save(e)},h.prototype.getBuffer=function(){var e=new r;return e.endianness=r.BIG_ENDIAN,this.write(e),e.buffer},h.prototype.initializeSegmentation=function(){var e,n,r,a;for(this.onSegment===null&&t.warn(`MP4Box`,`No segmentation callback set!`),this.isFragmentationInitialized||(this.isFragmentationInitialized=!0,this.nextMoofNumber=0,this.resetTables()),n=[],e=0;e<this.fragmentedTracks.length;e++){var o=new c.moovBox;o.mvhd=this.moov.mvhd,o.boxes.push(o.mvhd),r=this.getTrackById(this.fragmentedTracks[e].id),o.boxes.push(r),o.traks.push(r),a={},a.id=r.tkhd.track_id,a.user=this.fragmentedTracks[e].user,a.buffer=h.writeInitializationSegment(this.ftyp,o,this.moov.mvex&&this.moov.mvex.mehd?this.moov.mvex.mehd.fragment_duration:void 0,this.moov.traks[e].samples.length>0?this.moov.traks[e].samples[0].duration:0),n.push(a)}return n},c.Box.prototype.printHeader=function(e){this.size+=8,this.size>a&&(this.size+=8),this.type===`uuid`&&(this.size+=16),e.log(e.indent+`size:`+this.size),e.log(e.indent+`type:`+this.type)},c.FullBox.prototype.printHeader=function(e){this.size+=4,c.Box.prototype.printHeader.call(this,e),e.log(e.indent+`version:`+this.version),e.log(e.indent+`flags:`+this.flags)},c.Box.prototype.print=function(e){this.printHeader(e)},c.ContainerBox.prototype.print=function(e){this.printHeader(e);for(var t=0;t<this.boxes.length;t++)if(this.boxes[t]){var n=e.indent;e.indent+=` `,this.boxes[t].print(e),e.indent=n}},h.prototype.print=function(e){e.indent=``;for(var t=0;t<this.boxes.length;t++)this.boxes[t]&&this.boxes[t].print(e)},c.mvhdBox.prototype.print=function(e){c.FullBox.prototype.printHeader.call(this,e),e.log(e.indent+`creation_time: `+this.creation_time),e.log(e.indent+`modification_time: `+this.modification_time),e.log(e.indent+`timescale: `+this.timescale),e.log(e.indent+`duration: `+this.duration),e.log(e.indent+`rate: `+this.rate),e.log(e.indent+`volume: `+(this.volume>>8)),e.log(e.indent+`matrix: `+this.matrix.join(`, `)),e.log(e.indent+`next_track_id: `+this.next_track_id)},c.tkhdBox.prototype.print=function(e){c.FullBox.prototype.printHeader.call(this,e),e.log(e.indent+`creation_time: `+this.creation_time),e.log(e.indent+`modification_time: `+this.modification_time),e.log(e.indent+`track_id: `+this.track_id),e.log(e.indent+`duration: `+this.duration),e.log(e.indent+`volume: `+(this.volume>>8)),e.log(e.indent+`matrix: `+this.matrix.join(`, `)),e.log(e.indent+`layer: `+this.layer),e.log(e.indent+`alternate_group: `+this.alternate_group),e.log(e.indent+`width: `+this.width),e.log(e.indent+`height: `+this.height)};var g={};g.createFile=function(e,t){var n=e===void 0?!0:e,r=new h(t);return r.discardMdatData=!n,r},e!==void 0&&(e.createFile=g.createFile)}))());function uL(e,t){let n=e.getTrackById(t)?.mdia?.minf?.stbl?.stsd?.entries??[];for(let e of n){let t=e.hvcC??e.avcC;if(t){let e=new lL.DataStream(void 0,0,lL.DataStream.BIG_ENDIAN);return t.write(e),new Uint8Array(e.buffer,8)}}}async function dL(e){let t=lL.createFile(),{config:n,trackId:r}=await new Promise((n,r)=>{t.onError=e=>r(Error(`mp4box: ${e}`)),t.onReady=e=>{let a=e.videoTracks?.[0];if(!a){r(Error(`no video track`));return}let o=uL(t,a.id);n({config:{codec:a.codec,codedWidth:a.video?.width,codedHeight:a.video?.height,...o?{description:o}:{}},trackId:a.id})};let a=e;a.fileStart=0,t.appendBuffer(a),t.flush()});return{config:n,chunk:await new Promise((e,n)=>{t.onSamples=(t,r,a)=>{let o=a.find(e=>e.is_sync)??a[0];if(!o){n(Error(`no sample`));return}e(new EncodedVideoChunk({type:`key`,timestamp:Math.round(o.cts/o.timescale*1e6),data:o.data}))},t.setExtractionOptions(r,null,{nbSamples:1}),t.start()})}}var fL=class{decoder=null;async decodeSegment(e){let{config:t,chunk:n}=await dL(e);if(!(await VideoDecoder.isConfigSupported(t)).supported)throw Error(`unsupported codec: ${t.codec}`);return await new Promise((e,r)=>{this.decoder&&this.decoder.state!==`closed`&&this.decoder.close();let a=new VideoDecoder({output:t=>e(t),error:e=>r(e)});a.configure(t),this.decoder=a,a.decode(n),a.flush().catch(r)})}close(){this.decoder&&this.decoder.state!==`closed`&&this.decoder.close(),this.decoder=null}};function pL({url:e,autoPlay:t=!0,muted:n=!1,className:r}){let a=(0,x.useRef)(null),[o,s]=(0,x.useState)(null);return(0,x.useEffect)(()=>{let n=a.current;if(!n||!e)return;s(null),n.src=e;let r=()=>{t&&n.play().catch(()=>{})},o=()=>s(`Could not load this recording.`);return n.addEventListener(`loadedmetadata`,r),n.addEventListener(`error`,o),()=>{n.removeEventListener(`loadedmetadata`,r),n.removeEventListener(`error`,o),n.removeAttribute(`src`),n.load()}},[e,t]),(0,x.useEffect)(()=>{let e=a.current;e&&(e.muted=n)},[n]),(0,S.jsxs)(`div`,{className:`relative h-full w-full bg-black ${r??``}`,children:[(0,S.jsx)(`video`,{ref:a,playsInline:!0,muted:n,className:`h-full w-full`}),o?(0,S.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center px-4 text-center text-sm text-amber-400`,children:o}):null]})}var mL=H([V({kind:G(`adaptive`)}),V({kind:G(`profile`),profile:zd})]),hL=V({serverUrl:F().min(1),token:F().min(1),deviceId:I().int().nonnegative(),target:mL,muted:L(),stats:L().optional(),highlight:oI.optional(),snapshot:F().optional(),hlsRecordedPlayback:L().optional()}),gL=300*1e3;function _L(e,t){try{return new URL(t,e).toString()}catch{return t}}var vL=[`live`,`loading`,`playing`,`paused`,`gap`,`ended`,`error`];function yL(e){try{let t=JSON.parse(e);if(typeof t!=`object`||!t)return null;let n=t;return n.t===`state`&&typeof n.state==`string`&&vL.includes(n.state)?{kind:`state`,state:n.state}:n.t===`position`&&typeof n.epochMs==`number`?{kind:`position`,epochMs:n.epochMs}:null}catch{return null}}function bL(e,t){dI(t===void 0?{type:`state`,state:e}:{type:`state`,state:e,message:t})}function xL(e){switch(e){case`playing`:return`playing`;case`error`:return`error`;case`connecting`:case`disconnected`:case`idle`:return`connecting`}}function SL(e){return e.kind===`adaptive`?{kind:`adaptive`}:{kind:`profile`,profile:e.profile}}function CL(e){return e.kind===`adaptive`?`embed:adaptive`:`embed:profile:${e.profile}`}function wL(e){let t=hL.safeParse(e);return t.success?{ok:!0,config:t.data}:{ok:!1,error:t.error.issues.map(e=>`${e.path.join(`.`)||`(root)`}: ${e.message}`).join(`; `)}}function TL({message:e}){return(0,x.useEffect)(()=>{bL(`error`,e)},[e]),(0,S.jsxs)(`div`,{style:{position:`fixed`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`#000`,color:`#f87171`,fontFamily:`system-ui, sans-serif`,fontSize:13,padding:16,textAlign:`center`},children:[`Embed config error: `,e]})}function EL({system:e,deviceId:t,token:n,initialTarget:r,initialMuted:a,initialStats:o,initialHighlight:s,initialSnapshot:c,hlsRecordedPlayback:l}){let[u,d]=(0,x.useState)(r),[f,p]=(0,x.useState)(a),[m,h]=(0,x.useState)(o),[g,_]=(0,x.useState)(s),[v,y]=(0,x.useState)(c),[b,ee]=(0,x.useState)(0),[C,w]=(0,x.useState)({w:window.innerWidth,h:window.innerHeight}),[te,T]=(0,x.useState)(null),E=(0,x.useRef)(null);E.current=te,(0,x.useEffect)(()=>{l&&(document.cookie=`camstack_session=${n}; path=/; SameSite=Lax`)},[l,n]);let ne=PI(e,t,g),re=_I(),ie=(0,x.useRef)(re.setActiveMic);ie.current=re.setActiveMic;let ae=(0,x.useRef)(null),oe=(0,x.useRef)(!1),se=(0,x.useRef)(()=>{}),D=(0,x.useRef)(e=>{ae.current=e,e.onmessage=e=>{let t=e.data;if(typeof t!=`string`)return;let n=yL(t);n&&(n.kind===`position`?(oe.current&&se.current(),dI({type:`position`,positionMs:n.epochMs})):(n.state===`playing`&&oe.current&&se.current(),dI({type:`recState`,state:n.state})))},e.onclose=()=>{ae.current===e&&(ae.current=null)}}).current,ce=(0,x.useRef)(e=>{let t=ZI(e);if(!t)return;let n=ae.current;n&&n.readyState===`open`&&n.send(JSON.stringify(t))}).current,{handleOffer:O,getIceServers:k,addIceCandidate:le,getIceCandidates:ue,closeSession:de,getSessionState:A}=rI(e.trpcClient,t),fe=(0,x.useMemo)(()=>SL(u),[u]),pe=(0,x.useMemo)(()=>(e,t)=>O(fe,e,t),[O,fe]),me=(0,x.useMemo)(()=>(e,t,n)=>O(n,t,e),[O]),he=(0,x.useRef)(null),[ge,_e]=(0,x.useState)(!1),[ve,ye]=(0,x.useState)(!1),be=(0,x.useRef)(!1);be.current=ve;let xe=(0,x.useRef)(null);se.current=(0,x.useCallback)(()=>{oe.current=!1,xe.current&&=(clearTimeout(xe.current),null),_e(!1)},[]);let Se=(0,x.useCallback)(()=>{be.current?(oe.current=!0,xe.current&&clearTimeout(xe.current),xe.current=setTimeout(()=>se.current(),4e3)):_e(!1)},[]),Ce=(0,x.useRef)(Se);Ce.current=Se;let we=(0,x.useRef)(null),Te=(0,x.useRef)(null),Ee=(0,x.useRef)([]),De=(0,x.useRef)(null),Oe=(0,x.useMemo)(()=>({Authorization:`Bearer ${n}`}),[n]),ke=(0,x.useMemo)(()=>async n=>{let r=De.current;if(r&&n>=r.fromMs&&n<r.toMs&&Ee.current.length>0)return Ee.current;let a=new Date(n);a.setHours(0,0,0,0);let o=a.getTime(),s=o+1440*60*1e3,c=await e.trpcClient.recording.getPlaybackManifest.query({deviceId:t,fromMs:o,toMs:s});return c?.playbackUrl?(Ee.current=await iL(c.playbackUrl,Oe),De.current={fromMs:o,toMs:s},Ee.current):Ee.current},[e,t,Oe]),Ae=(0,x.useMemo)(()=>e=>{let t=he.current,n=t?.getContext(`2d`);if(!t||!n)return;t.width=C.w,t.height=C.h;let r=e.displayWidth||e.codedWidth,a=e.displayHeight||e.codedHeight,o=Math.min(C.w/r,C.h/a),s=r*o,c=a*o;n.clearRect(0,0,C.w,C.h),n.drawImage(e,(C.w-s)/2,(C.h-c)/2,s,c),ye(!0)},[C.w,C.h]),je=(0,x.useRef)(Ae);je.current=Ae;let Me=(0,x.useMemo)(()=>async e=>{we.current||=new fL,Te.current||=new cL({ensureIndex:e=>ke(e),fetchBytes:async(e,t)=>{let n=await fetch(e,{signal:t,headers:Oe});if(!n.ok)throw Error(`segment fetch failed: ${n.status}`);return n.arrayBuffer()},decode:e=>{let t=we.current;if(!t)throw Error(`decoder not initialised`);return t.decodeSegment(e)},draw:e=>je.current(e)});try{await Te.current.scrubTo(e)}catch{}},[ke,Oe]),Ne=(0,x.useRef)(Me);Ne.current=Me,(0,x.useEffect)(()=>()=>{Te.current?.dispose()},[]);let Pe=(0,x.useMemo)(()=>async n=>{let r=n-gL,a=n+gL;dI({type:`recState`,state:`loading`});try{let o=await e.trpcClient.recording.getPlaybackManifest.query({deviceId:t,fromMs:r,toMs:a});if(!o?.playbackUrl){dI({type:`recState`,state:`gap`});return}T({url:_L(e.serverUrl,o.playbackUrl),windowStartMs:r,windowEndMs:a,targetMs:n}),dI({type:`recState`,state:`playing`}),dI({type:`position`,positionMs:n})}catch{dI({type:`recState`,state:`error`})}},[e,t]),Fe=(0,x.useRef)(Pe);Fe.current=Pe;let Ie=(0,x.useMemo)(()=>e=>{let t=E.current;if(!t){Fe.current(e);return}if(e>=t.windowStartMs&&e<=t.windowEndMs){let n=ze.current;if(n){n.currentTime=Math.max(0,(e-t.windowStartMs)/1e3),dI({type:`position`,positionMs:e});return}}Fe.current(e)},[]),Le=(0,x.useRef)(Ie);Le.current=Ie;let Re=(0,x.useRef)(null),ze=(0,x.useRef)(null);(0,x.useEffect)(()=>{ze.current=te?Re.current?.querySelector(`video`)??null:null},[te]),(0,x.useEffect)(()=>(window.__camstackEmbed={setMuted:e=>p(e),setTarget:e=>{let t=mL.safeParse(e);t.success&&d(t.data)},setStats:e=>h(e),setHighlight:e=>_(e),setSnapshot:e=>y(e),setMic:e=>ie.current(e?t:null),fit:(e,t)=>w({w:e,h:t}),reconnect:()=>ee(e=>e+1),playRecorded:(e,t,n)=>{l?Fe.current(t):ce({kind:`playRecorded`,deviceId:e,epochMs:t,profile:n})},seek:e=>{l&&E.current?Le.current(e):ce({kind:`seekTo`,epochMs:e})},scrubCommit:e=>{if(l&&E.current){Le.current(e);return}ce({kind:`scrubEnd`,epochMs:e}),Ce.current()},scrubStart:()=>{l&&E.current||(ye(!1),_e(!0),ce({kind:`scrubStart`}))},scrubTo:e=>{l&&E.current||Ne.current(e)},scrubEnd:e=>{if(l&&E.current){Le.current(e);return}ce({kind:`scrubEnd`,epochMs:e}),Ce.current()},setRate:e=>{if(l&&E.current){let t=ze.current;t&&(e===0?t.pause():t.play().catch(()=>{}));return}ce({kind:e===0?`pause`:`play`})},goLive:()=>{if(l&&E.current){T(null),dI({type:`recState`,state:`live`});return}ce({kind:`goLive`})}},()=>{window.__camstackEmbed&&delete window.__camstackEmbed}),[t,l]),(0,x.useEffect)(()=>{dI({type:`micState`,state:re.micState})},[re.micState]),(0,x.useEffect)(()=>fI(e=>{let t=window.__camstackEmbed;if(t)switch(e.kind){case`setMuted`:t.setMuted(e.value);break;case`setTarget`:t.setTarget(e.value);break;case`setStats`:t.setStats(e.value);break;case`setHighlight`:t.setHighlight(e.value);break;case`setSnapshot`:t.setSnapshot(e.value);break;case`setMic`:t.setMic(e.value);break;case`fit`:t.fit(e.w,e.h);break;case`reconnect`:t.reconnect();break;case`playRecorded`:t.playRecorded(e.deviceId,e.epochMs,e.profile);break;case`seek`:t.seek(e.value);break;case`scrubCommit`:t.scrubCommit(e.value);break;case`scrubStart`:t.scrubStart();break;case`scrubTo`:t.scrubTo(e.value);break;case`scrubEnd`:t.scrubEnd(e.value);break;case`setRate`:t.setRate(e.value);break;case`goLive`:t.goLive();break;default:break}}),[]);let Be=CL(u);return(0,S.jsxs)(`div`,{style:{position:`fixed`,left:0,top:0,width:C.w,height:C.h,background:`#000`},children:[(0,S.jsx)(WF,{serverUrl:e.serverUrl,streamKey:Be,autoPlay:!0,muted:f,showControls:!1,showStats:m,onPlaybackStats:e=>dI({type:`log`,scope:`playback`,msg:`stats`,data:e}),className:`w-full h-full`,handleOffer:pe,reoffer:me,getSessionState:A,getIceServers:k,addIceCandidate:le,getIceCandidates:ue,closeSession:de,reconnectSignal:b,posterUrl:v,onControlChannel:D,onStateChange:e=>bL(xL(e)),onError:e=>bL(`error`,e)},Be),te?(0,S.jsx)(`div`,{ref:Re,style:{position:`absolute`,inset:0,zIndex:1,background:`#000`},children:(0,S.jsx)(pL,{url:te.url,muted:f,autoPlay:!0},te.url)}):null,(0,S.jsx)(`canvas`,{ref:he,style:{position:`absolute`,inset:0,width:`100%`,height:`100%`,background:`#000`,pointerEvents:`none`,transform:`translateZ(0)`,zIndex:2,display:ge&&ve?`block`:`none`}}),ne&&(()=>{let e=g?.appearance,t=ne===`motion`?e?.motionColor??FI.motion:ne===`audio`?e?.audioColor??FI.audio:e?.detectionColor??FI.detection;return(0,S.jsx)(`div`,{style:{position:`absolute`,inset:0,border:`${e?.thickness??3}px solid ${t}`,boxShadow:`inset 0 0 12px ${t}`,pointerEvents:`none`,transform:`translateZ(0)`}})})()]})}function DL(){let e=mI(`player`,()=>window.__CAMSTACK_EMBED__,wL),t=(0,x.useMemo)(()=>e===null||!e.ok?null:{system:RE({serverUrl:e.config.serverUrl,token:e.config.token}),queryClient:new st({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}})},[e]);return(0,x.useEffect)(()=>{if(t)return()=>{t.system.close()}},[t]),e===null?null:e.ok?t?(0,S.jsx)(UN,{system:t.system,children:(0,S.jsx)(ut,{client:t.queryClient,children:(0,S.jsx)($.Provider,{client:t.system.trpcClient,queryClient:t.queryClient,children:(0,S.jsx)(EL,{system:t.system,deviceId:e.config.deviceId,token:e.config.token,initialTarget:e.config.target,initialMuted:e.config.muted,initialStats:e.config.stats??!1,initialHighlight:e.config.highlight,initialSnapshot:e.config.snapshot,hlsRecordedPlayback:e.config.hlsRecordedPlayback??!1})})})}):(0,S.jsx)(TL,{message:`Failed to initialise the embed player`}):(0,S.jsx)(TL,{message:e.error})}var OL=V({serverUrl:F().min(1),token:F().min(1),deviceId:I().int().nonnegative(),startMs:I().int().nonnegative().optional()});function kL(e){if(e==null)return{ok:!1,error:`config is required`};let t=OL.safeParse(e);return t.success?{ok:!0,config:t.data}:{ok:!1,error:t.error.issues.map(e=>`${e.path.join(`.`)||`(root)`}: ${e.message}`).join(`; `)}}var AL=360*60*1e3;function jL(e){dI(e)}function ML(e,t,n){try{dI({type:`log`,scope:e,msg:t,data:n})}catch{}try{console.debug(`[rec-embed:${e}] ${t}`,n??``)}catch{}}function NL({system:e,config:t}){let n=(0,x.useRef)(null),r=(0,x.useRef)(null),a=(0,x.useRef)(0),o=(0,x.useRef)(0),[s,c]=(0,x.useState)({w:window.innerWidth,h:window.innerHeight}),[l,u]=(0,x.useState)(!1),d=(0,x.useRef)(!1),f=(0,x.useRef)(null),p=(0,x.useRef)(null),m=(0,x.useRef)([]),h=(0,x.useRef)(null),g=(0,x.useMemo)(()=>async r=>{let s=n.current;if(s){o.current=performance.now(),ML(`loadAt`,`start`,{epochMs:r,window:AL}),jL({type:`state`,state:`loading`});try{let n=await e.trpcClient.recording.getPlaybackManifest.query({deviceId:t.deviceId,fromMs:r,toMs:r+AL});if(ML(`loadAt`,`manifest`,{playbackUrl:n?.playbackUrl??null,endpoints:n?.playbackEndpoints?.length??0,localMaster:!!n?.localMasterPath}),!n?.playbackUrl){jL({type:`state`,state:`error`,message:`no footage`}),u(!1);return}a.current=r,s.src=n.playbackUrl,s.currentTime=0,await s.play().catch(e=>{ML(`loadAt`,`play-rejected`,{msg:String(e)})}),ML(`loadAt`,`src-set`,{src:n.playbackUrl})}catch(e){ML(`loadAt`,`error`,{msg:e instanceof Error?e.message:String(e)}),jL({type:`state`,state:`error`,message:e instanceof Error?e.message:String(e)}),u(!1)}}},[e,t.deviceId]),_=(0,x.useMemo)(()=>async n=>{let r=h.current;if(r&&n>=r.fromMs&&n<r.toMs&&m.current.length>0)return m.current;let a=new Date(n);a.setHours(0,0,0,0);let o=a.getTime(),s=o+1440*60*1e3,c=await e.trpcClient.recording.getPlaybackManifest.query({deviceId:t.deviceId,fromMs:o,toMs:s});return ML(`scrub`,`dayIndex-manifest`,{playbackUrl:c?.playbackUrl??null,fromMs:o,toMs:s}),c?.playbackUrl?(m.current=await iL(c.playbackUrl),h.current={fromMs:o,toMs:s},ML(`scrub`,`dayIndex-built`,{len:m.current.length,fromMs:o,toMs:s}),m.current):m.current},[e,t.deviceId]),v=(0,x.useMemo)(()=>e=>{let t=r.current,n=t?.getContext(`2d`);if(!t||!n)return;t.width=s.w,t.height=s.h;let a=e.displayWidth||e.codedWidth,o=e.displayHeight||e.codedHeight,c=Math.min(s.w/a,s.h/o),l=a*c,u=o*c;n.clearRect(0,0,s.w,s.h),n.drawImage(e,(s.w-l)/2,(s.h-u)/2,l,u)},[s.w,s.h]),y=(0,x.useRef)(v);y.current=v;let b=(0,x.useMemo)(()=>async e=>{f.current||=new fL,p.current||=new cL({ensureIndex:e=>_(e),fetchBytes:async(e,t)=>{let n=await fetch(e,{signal:t});if(!n.ok)throw Error(`segment fetch failed: ${n.status}`);return n.arrayBuffer()},decode:e=>{let t=f.current;if(!t)throw Error(`decoder not initialised`);return t.decodeSegment(e)},draw:e=>y.current(e),onTiming:e=>ML(`scrub`,`timing`,e)});let t=p.current;if(t)try{await t.scrubTo(e),ML(`scrub`,`drawn`,{epochMs:e})}catch(e){ML(`scrub`,`error`,{msg:e instanceof Error?e.message:String(e)}),d.current||(d.current=!0,jL({type:`state`,state:`error`,message:`scrub: ${e instanceof Error?e.message:String(e)}`}))}},[_]);return(0,x.useEffect)(()=>(ML(`init`,`mounted`,{deviceId:t.deviceId,startMs:t.startMs??null,hasWebCodecs:window.VideoDecoder!==void 0,ua:navigator.userAgent}),window.__camstackRecording={seekTo:e=>{ML(`cmd`,`seekTo`,{epochMs:e}),g(e)},play:()=>{ML(`cmd`,`play`),n.current?.play().catch(()=>{})},pause:()=>{ML(`cmd`,`pause`),n.current?.pause()},setRate:e=>{ML(`cmd`,`setRate`,{rate:e}),n.current&&(n.current.playbackRate=e)},fit:(e,t)=>{ML(`cmd`,`fit`,{w:e,h:t}),c({w:e,h:t})},scrubStart:()=>{ML(`cmd`,`scrubStart`),d.current=!1,u(!0)},scrubTo:e=>{ML(`cmd`,`scrubTo`,{epochMs:e}),b(e)},scrubEnd:e=>{ML(`cmd`,`scrubEnd`,{epochMs:e}),p.current?.dispose(),p.current=null,g(e)}},t.startMs&&t.startMs>0&&g(t.startMs),()=>{window.__camstackRecording&&delete window.__camstackRecording,p.current?.dispose(),p.current=null,f.current?.close(),f.current=null}),[g,b,t.startMs,t.deviceId]),(0,x.useEffect)(()=>fI(e=>{let t=window.__camstackRecording;if(t)switch(e.kind){case`seekTo`:t.seekTo(e.value);break;case`play`:t.play();break;case`pause`:t.pause();break;case`setRate`:t.setRate(e.value);break;case`scrubStart`:t.scrubStart();break;case`scrubTo`:t.scrubTo(e.value);break;case`scrubEnd`:t.scrubEnd(e.value);break;case`fit`:t.fit(e.w,e.h);break;default:break}}),[]),(0,S.jsxs)(`div`,{style:{position:`fixed`,left:0,top:0,width:s.w,height:s.h,background:`#000`},children:[(0,S.jsx)(`video`,{ref:n,playsInline:!0,controls:!1,style:{width:`100%`,height:`100%`,objectFit:`contain`,background:`#000`},onLoadedMetadata:e=>ML(`video`,`loadedmetadata`,{w:e.currentTarget.videoWidth,h:e.currentTarget.videoHeight,dur:e.currentTarget.duration}),onPlaying:()=>{ML(`video`,`playing`,{vodStartMs:Math.round(performance.now()-o.current)}),jL({type:`state`,state:`playing`}),u(!1)},onPause:()=>jL({type:`state`,state:`paused`}),onEnded:()=>jL({type:`state`,state:`ended`}),onError:e=>{let t=e.currentTarget.error;ML(`video`,`error`,{code:t?.code??null,message:t?.message??null}),jL({type:`state`,state:`error`,message:t?.message||`video error`}),u(!1)},onTimeUpdate:e=>jL({type:`position`,positionMs:a.current+e.currentTarget.currentTime*1e3})}),(0,S.jsx)(`canvas`,{ref:r,style:{position:`absolute`,left:0,top:0,width:`100%`,height:`100%`,background:`#000`,display:l?`block`:`none`}})]})}function PL(){let e=mI(`recording`,()=>window.__CAMSTACK_RECORDING__,kL),t=(0,x.useMemo)(()=>e===null||!e.ok?null:(document.cookie=`camstack_session=${e.config.token}; path=/; SameSite=Lax`,RE({serverUrl:e.config.serverUrl,token:e.config.token})),[e]);return(0,x.useEffect)(()=>()=>t?.close(),[t]),e===null?null:e.ok?t?(0,S.jsx)(NL,{system:t,config:e.config}):(jL({type:`state`,state:`error`,message:`init failed`}),null):(jL({type:`state`,state:`error`,message:e.error}),null)}function FL(){let e=new URLSearchParams(location.search).get(`mode`)??`grid`;return e===`player`?(0,S.jsx)(DL,{}):e===`recording`?(0,S.jsx)(PL,{}):(0,S.jsx)(XI,{})}var IL=document.getElementById(`root`);IL&&(0,ee.createRoot)(IL).render((0,S.jsx)(FL,{}));export{uF as a,qN as c,b as d,m as f,u as g,c as h,fN as i,JF as l,s as m,cN as n,Q as o,f as p,PO as r,NO as s,JM as t,WN as u};
|