@camstack/addon-pipeline 1.0.5 → 1.0.6

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.
Files changed (31) hide show
  1. package/dist/audio-analyzer/index.js +1 -1
  2. package/dist/audio-analyzer/index.mjs +1 -1
  3. package/dist/audio-codec-nodeav/index.js +1 -1
  4. package/dist/audio-codec-nodeav/index.mjs +1 -1
  5. package/dist/decoder-nodeav/index.js +1 -1
  6. package/dist/decoder-nodeav/index.mjs +1 -1
  7. package/dist/detection-pipeline/index.js +704 -398
  8. package/dist/detection-pipeline/index.mjs +705 -398
  9. package/dist/{dist-v0PZCoV-.js → dist-BiUtYscO.js} +201 -2
  10. package/dist/{dist-CP2uP-D8.mjs → dist-DsDFrG0I.mjs} +201 -2
  11. package/dist/motion-wasm/index.js +1 -1
  12. package/dist/motion-wasm/index.mjs +1 -1
  13. package/dist/pipeline-runner/index.js +1 -1
  14. package/dist/pipeline-runner/index.mjs +1 -1
  15. package/dist/recorder/index.js +1 -1
  16. package/dist/recorder/index.mjs +1 -1
  17. package/dist/stream-broker/_stub.js +2 -2
  18. package/dist/stream-broker/{_virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-Hzarxdhd.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-CbTGCEnd.mjs} +3 -3
  19. package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-3STWM0yI.mjs +26 -0
  20. package/dist/stream-broker/{_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-SlpG44Ip.mjs → _virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-Dsz9DmNr.mjs} +1 -1
  21. package/dist/stream-broker/{hostInit-BXhCtKAA.mjs → hostInit-BJ3QDdFs.mjs} +3 -3
  22. package/dist/stream-broker/index.js +1 -1
  23. package/dist/stream-broker/index.mjs +1 -1
  24. package/dist/stream-broker/remoteEntry.js +1 -1
  25. package/embed-dist/assets/{MaskShapeCanvas-DI4BY7W2-CQxn6ukH.js → MaskShapeCanvas-DI4BY7W2-B4oJIlgF.js} +1 -1
  26. package/embed-dist/assets/{MotionZonesSettings-C1EEbk2V-BziDLK12.js → MotionZonesSettings-C1EEbk2V-CUopGB1R.js} +1 -1
  27. package/embed-dist/assets/{PrivacyMaskSettings-APgPLF7p-D3KDk03_.js → PrivacyMaskSettings-APgPLF7p-CyTsHaor.js} +1 -1
  28. package/embed-dist/assets/{index-CvgJINQE.js → index-hwJEVIPM.js} +9 -9
  29. package/embed-dist/index.html +1 -1
  30. package/package.json +1 -1
  31. package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-c9YxHYlI.mjs +0 -26
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./MotionZonesSettings-C1EEbk2V-BziDLK12.js","./MaskShapeCanvas-DI4BY7W2-CQxn6ukH.js","./PrivacyMaskSettings-APgPLF7p-D3KDk03_.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./MotionZonesSettings-C1EEbk2V-CUopGB1R.js","./MaskShapeCanvas-DI4BY7W2-B4oJIlgF.js","./PrivacyMaskSettings-APgPLF7p-CyTsHaor.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 fe(e){return{current:e}}function pe(e){0>de||(e.current=ue[de],ue[de]=null,de--)}function me(e,t){de++,ue[de]=e.current,e.current=t}var he=fe(null),ge=fe(null),_e=fe(null),ve=fe(null);function ye(e,t){switch(me(_e,t),me(ge,e),me(he,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}}pe(he),me(he,e)}function be(){pe(he),pe(ge),pe(_e)}function xe(e){e.memoizedState!==null&&me(ve,e);var t=he.current,n=Zd(t,e.type);t!==n&&(me(ge,e),me(he,n))}function Se(e){ge.current===e&&(pe(he),pe(ge)),ve.current===e&&(pe(ve),ip._currentValue=le)}var Ce,we;function Te(e){if(Ce===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Ce=t&&t[1]||``,we=-1<e.stack.indexOf(`
3
3
  at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
4
4
  `+Ce+e+we}var Ee=!1;function De(e,t){if(!e||Ee)return``;Ee=!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(`
@@ -70,11 +70,11 @@ Error generating stack: `+e.message+`
70
70
 
71
71
  `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let c=t.compile();return(t,n)=>c(e,t,n)},o,s=Ki,c=!Mi.jitless,l=c&&qi.value,u=t.catchall,d;e._zod.parse=(f,p)=>{d??=r.value;let m=f.value;return s(m)?c&&l&&p?.async===!1&&p.jitless!==!0?(o||=a(t.shape),f=o(f,p),u?bs([],m,f,p,d,e):f):n(f,p):(f.issues.push({expected:`object`,code:`invalid_type`,input:m,inst:e}),f)}});function Cs(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let a=e.filter(e=>!ca(e));return a.length===1?(t.value=a[0].value,a[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>fa(e,r,Ni())))}),t)}var ws=j(`$ZodUnion`,(e,t)=>{Mo.init(e,t),M(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),M(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),M(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),M(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>Ri(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,a)=>{if(n)return n(r,a);let o=!1,s=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},a);if(t instanceof Promise)s.push(t),o=!0;else{if(t.issues.length===0)return t;s.push(t)}}return o?Promise.all(s).then(t=>Cs(t,r,e,a)):Cs(s,r,e,a)}}),Ts=j(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,ws.init(e,t);let n=e._zod.parse;M(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=Ii(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(a,o)=>{let s=a.value;if(!Ki(s))return a.issues.push({code:`invalid_type`,expected:`object`,input:s,inst:e}),a;let c=r.value.get(s?.[t.discriminator]);return c?c._zod.run(a,o):t.unionFallback||o.direction===`backward`?n(a,o):(a.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()),input:s,path:[t.discriminator],inst:e}),a)}}),Es=j(`$ZodIntersection`,(e,t)=>{Mo.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,a=t.left._zod.run({value:r,issues:[]},n),o=t.right._zod.run({value:r,issues:[]},n);return a instanceof Promise||o instanceof Promise?Promise.all([a,o]).then(([t,n])=>Os(e,t,n)):Os(e,a,o)}});function Ds(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Ji(e)&&Ji(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),a={...e,...t};for(let n of r){let r=Ds(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};a[n]=r.data}return{valid:!0,data:a}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let a=e[r],o=t[r],s=Ds(a,o);if(!s.valid)return{valid:!1,mergeErrorPath:[r,...s.mergeErrorPath]};n.push(s.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Os(e,t,n){let r=new Map,a;for(let n of t.issues)if(n.code===`unrecognized_keys`){a??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let o=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(o.length&&a&&e.issues.push({...a,keys:o}),ca(e))return e;let s=Ds(t.value,n.value);if(!s.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}var ks=j(`$ZodTuple`,(e,t)=>{Mo.init(e,t);let n=t.items;e._zod.parse=(r,a)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({input:o,inst:e,expected:`tuple`,code:`invalid_type`}),r;r.value=[];let s=[],c=As(n,`optin`),l=As(n,`optout`);if(!t.rest){if(o.length<c)return r.issues.push({code:`too_small`,minimum:c,inclusive:!0,input:o,inst:e,origin:`array`}),r;o.length>n.length&&r.issues.push({code:`too_big`,maximum:n.length,inclusive:!0,input:o,inst:e,origin:`array`})}let u=Array(n.length);for(let e=0;e<n.length;e++){let t=n[e]._zod.run({value:o[e],issues:[]},a);t instanceof Promise?s.push(t.then(t=>{u[e]=t})):u[e]=t}if(t.rest){let e=n.length-1,c=o.slice(n.length);for(let n of c){e++;let o=t.rest._zod.run({value:n,issues:[]},a);o instanceof Promise?s.push(o.then(t=>js(t,r,e))):js(o,r,e)}}return s.length?Promise.all(s).then(()=>Ms(u,r,n,o,l)):Ms(u,r,n,o,l)}});function As(e,t){for(let n=e.length-1;n>=0;n--)if(e[n]._zod[t]!==`optional`)return n+1;return 0}function js(e,t,n){e.issues.length&&t.issues.push(...ua(n,e.issues)),t.value[n]=e.value}function Ms(e,t,n,r,a){for(let o=0;o<n.length;o++){let n=e[o],s=o<r.length;if(n.issues.length){if(!s&&o>=a){t.value.length=o;break}t.issues.push(...ua(o,n.issues))}t.value[o]=n.value}for(let e=t.value.length-1;e>=r.length&&n[e]._zod.optout===`optional`&&t.value[e]===void 0;e--)t.value.length=e;return t}var Ns=j(`$ZodRecord`,(e,t)=>{Mo.init(e,t),e._zod.parse=(n,r)=>{let a=n.value;if(!Ji(a))return n.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),n;let o=[],s=t.keyType._zod.values;if(s){n.value={};let c=new Set;for(let l of s)if(typeof l==`string`||typeof l==`number`||typeof l==`symbol`){c.add(typeof l==`number`?l.toString():l);let s=t.keyType._zod.run({value:l,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>fa(e,r,Ni())),input:l,path:[l],inst:e});continue}let u=s.value,d=t.valueType._zod.run({value:a[l],issues:[]},r);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&n.issues.push(...ua(l,e.issues)),n.value[u]=e.value})):(d.issues.length&&n.issues.push(...ua(l,d.issues)),n.value[u]=d.value)}let l;for(let e in a)c.has(e)||(l??=[],l.push(e));l&&l.length>0&&n.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:l})}else{n.value={};for(let s of Reflect.ownKeys(a)){if(s===`__proto__`||!Object.prototype.propertyIsEnumerable.call(a,s))continue;let c=t.keyType._zod.run({value:s,issues:[]},r);if(c instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof s==`string`&&so.test(s)&&c.issues.length){let e=t.keyType._zod.run({value:Number(s),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(c=e)}if(c.issues.length){t.mode===`loose`?n.value[s]=a[s]:n.issues.push({code:`invalid_key`,origin:`record`,issues:c.issues.map(e=>fa(e,r,Ni())),input:s,path:[s],inst:e});continue}let l=t.valueType._zod.run({value:a[s],issues:[]},r);l instanceof Promise?o.push(l.then(e=>{e.issues.length&&n.issues.push(...ua(s,e.issues)),n.value[c.value]=e.value})):(l.issues.length&&n.issues.push(...ua(s,l.issues)),n.value[c.value]=l.value)}}return o.length?Promise.all(o).then(()=>n):n}}),Ps=j(`$ZodEnum`,(e,t)=>{Mo.init(e,t);let n=Pi(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>Xi.has(typeof e)).map(e=>typeof e==`string`?Zi(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,a)=>{let o=t.value;return r.has(o)||t.issues.push({code:`invalid_value`,values:n,input:o,inst:e}),t}}),Fs=j(`$ZodLiteral`,(e,t)=>{if(Mo.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?Zi(e):e?Zi(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,a)=>{let o=r.value;return n.has(o)||r.issues.push({code:`invalid_value`,values:t.values,input:o,inst:e}),r}}),Is=j(`$ZodTransform`,(e,t)=>{Mo.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new ji(e.constructor.name);let a=t.transform(n.value,n);if(r.async)return(a instanceof Promise?a:Promise.resolve(a)).then(e=>(n.value=e,n.fallback=!0,n));if(a instanceof Promise)throw new Ai;return n.value=a,n.fallback=!0,n}});function Ls(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var Rs=j(`$ZodOptional`,(e,t)=>{Mo.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,M(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),M(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Ri(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,a=t.innerType._zod.run(e,n);return a instanceof Promise?a.then(e=>Ls(e,r)):Ls(a,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),zs=j(`$ZodExactOptional`,(e,t)=>{Rs.init(e,t),M(e._zod,`values`,()=>t.innerType._zod.values),M(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Bs=j(`$ZodNullable`,(e,t)=>{Mo.init(e,t),M(e._zod,`optin`,()=>t.innerType._zod.optin),M(e._zod,`optout`,()=>t.innerType._zod.optout),M(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Ri(e.source)}|null)$`):void 0}),M(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Vs=j(`$ZodDefault`,(e,t)=>{Mo.init(e,t),e._zod.optin=`optional`,M(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Hs(e,t)):Hs(r,t)}});function Hs(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Us=j(`$ZodPrefault`,(e,t)=>{Mo.init(e,t),e._zod.optin=`optional`,M(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Ws=j(`$ZodNonOptional`,(e,t)=>{Mo.init(e,t),M(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let a=t.innerType._zod.run(n,r);return a instanceof Promise?a.then(t=>Gs(t,e)):Gs(a,e)}});function Gs(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var Ks=j(`$ZodCatch`,(e,t)=>{Mo.init(e,t),e._zod.optin=`optional`,M(e._zod,`optout`,()=>t.innerType._zod.optout),M(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>fa(e,n,Ni()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>fa(e,n,Ni()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),qs=j(`$ZodPipe`,(e,t)=>{Mo.init(e,t),M(e._zod,`values`,()=>t.in._zod.values),M(e._zod,`optin`,()=>t.in._zod.optin),M(e._zod,`optout`,()=>t.out._zod.optout),M(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Js(e,t.in,n)):Js(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Js(e,t.out,n)):Js(r,t.out,n)}});function Js(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}var Ys=j(`$ZodReadonly`,(e,t)=>{Mo.init(e,t),M(e._zod,`propValues`,()=>t.innerType._zod.propValues),M(e._zod,`values`,()=>t.innerType._zod.values),M(e._zod,`optin`,()=>t.innerType?._zod?.optin),M(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Xs):Xs(r)}});function Xs(e){return e.value=Object.freeze(e.value),e}var Zs=j(`$ZodLazy`,(e,t)=>{Mo.init(e,t),M(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),M(e._zod,`pattern`,()=>e._zod.innerType?._zod?.pattern),M(e._zod,`propValues`,()=>e._zod.innerType?._zod?.propValues),M(e._zod,`optin`,()=>e._zod.innerType?._zod?.optin??void 0),M(e._zod,`optout`,()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),Qs=j(`$ZodCustom`,(e,t)=>{po.init(e,t),Mo.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,a=t.fn(r);if(a instanceof Promise)return a.then(t=>$s(t,n,r,e));$s(a,n,r,e)}});function $s(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(ma(e))}}var ec,tc=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function nc(){return new tc}(ec=globalThis).__zod_globalRegistry??(ec.__zod_globalRegistry=nc());var rc=globalThis.__zod_globalRegistry;function ic(e,t){return new e({type:`string`,...N(t)})}function ac(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...N(t)})}function oc(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...N(t)})}function sc(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...N(t)})}function cc(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...N(t)})}function lc(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...N(t)})}function uc(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...N(t)})}function dc(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...N(t)})}function fc(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...N(t)})}function pc(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...N(t)})}function mc(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...N(t)})}function hc(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...N(t)})}function gc(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...N(t)})}function _c(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...N(t)})}function vc(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...N(t)})}function yc(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...N(t)})}function bc(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...N(t)})}function xc(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...N(t)})}function Sc(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...N(t)})}function Cc(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...N(t)})}function wc(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...N(t)})}function Tc(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...N(t)})}function Ec(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...N(t)})}function Dc(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...N(t)})}function Oc(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...N(t)})}function kc(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...N(t)})}function Ac(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...N(t)})}function jc(e,t){return new e({type:`number`,checks:[],...N(t)})}function Mc(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...N(t)})}function Nc(e,t){return new e({type:`boolean`,...N(t)})}function Pc(e,t){return new e({type:`null`,...N(t)})}function Fc(e){return new e({type:`any`})}function Ic(e){return new e({type:`unknown`})}function Lc(e,t){return new e({type:`never`,...N(t)})}function Rc(e,t){return new e({type:`void`,...N(t)})}function zc(e,t){return new e({type:`date`,...N(t)})}function Bc(e,t){return new ho({check:`less_than`,...N(t),value:e,inclusive:!1})}function Vc(e,t){return new ho({check:`less_than`,...N(t),value:e,inclusive:!0})}function Hc(e,t){return new go({check:`greater_than`,...N(t),value:e,inclusive:!1})}function Uc(e,t){return new go({check:`greater_than`,...N(t),value:e,inclusive:!0})}function Wc(e,t){return new _o({check:`multiple_of`,...N(t),value:e})}function Gc(e,t){return new yo({check:`max_length`,...N(t),maximum:e})}function Kc(e,t){return new bo({check:`min_length`,...N(t),minimum:e})}function qc(e,t){return new xo({check:`length_equals`,...N(t),length:e})}function Jc(e,t){return new Co({check:`string_format`,format:`regex`,...N(t),pattern:e})}function Yc(e){return new wo({check:`string_format`,format:`lowercase`,...N(e)})}function Xc(e){return new To({check:`string_format`,format:`uppercase`,...N(e)})}function Zc(e,t){return new Eo({check:`string_format`,format:`includes`,...N(t),includes:e})}function Qc(e,t){return new Do({check:`string_format`,format:`starts_with`,...N(t),prefix:e})}function $c(e,t){return new Oo({check:`string_format`,format:`ends_with`,...N(t),suffix:e})}function el(e){return new ko({check:`overwrite`,tx:e})}function tl(e){return el(t=>t.normalize(e))}function nl(){return el(e=>e.trim())}function rl(){return el(e=>e.toLowerCase())}function il(){return el(e=>e.toUpperCase())}function al(){return el(e=>Wi(e))}function ol(e,t,n){return new e({type:`array`,element:t,...N(n)})}function sl(e,t,n){let r=N(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function cl(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...N(n)})}function ll(e,t){let n=ul(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(ma(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(ma(r))}},e(t.value,t)),t);return n}function ul(e,t){let n=new po({check:`custom`,...N(t)});return n._zod.check=e,n}function dl(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??rc,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function fl(e,t,n={path:[],schemaPath:[]}){var r;let a=e._zod.def,o=t.seen.get(e);if(o)return o.count++,n.schemaPath.includes(e)&&(o.cycle=n.path),o.schema;let s={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,s);let c=e._zod.toJSONSchema?.();if(c)s.schema=c;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,r);else{let n=s.schema,o=t.processors[a.type];if(!o)throw Error(`[toJSONSchema]: Non-representable type encountered: ${a.type}`);o(e,t,n,r)}let o=e._zod.parent;o&&(s.ref||=o,fl(o,t,r),t.seen.get(o).isParent=!0)}let l=t.metadataRegistry.get(e);return l&&Object.assign(s.schema,l),t.io===`input`&&hl(e)&&(delete s.schema.examples,delete s.schema.default),t.io===`input`&&`_prefault`in s.schema&&((r=s.schema).default??(r.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function pl(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let a=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,a=e.external.uri??(e=>e);if(n)return{ref:a(n)};let o=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=o,{defId:o,ref:`${a(`__shared`)}#/${r}/${o}`}}if(t[1]===n)return{ref:`#`};let a=`#/${r}/`,o=t[1].schema.id??`__schema${e.counter++}`;return{defId:o,ref:a+o}},o=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=a(e);t.def={...t.schema},r&&(t.defId=r);let o=t.schema;for(let e in o)delete o[e];o.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
72
72
 
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 ml(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:_l(t,`input`,e.processors),output:_l(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function hl(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 hl(r.element,n);if(r.type===`set`)return hl(r.valueType,n);if(r.type===`lazy`)return hl(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 hl(r.innerType,n);if(r.type===`intersection`)return hl(r.left,n)||hl(r.right,n);if(r.type===`record`||r.type===`map`)return hl(r.keyType,n)||hl(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:hl(r.in,n)||hl(r.out,n);if(r.type===`object`){for(let e in r.shape)if(hl(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(hl(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(hl(e,n))return!0;return!!(r.rest&&hl(r.rest,n))}return!1}var gl=(e,t={})=>n=>{let r=dl({...n,processors:t});return fl(e,r),pl(r,e),ml(r,e)},_l=(e,t,n={})=>r=>{let{libraryOptions:a,target:o}=r??{},s=dl({...a??{},target:o,io:t,processors:n});return fl(e,s),pl(s,e),ml(s,e)},vl={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},yl=(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=vl[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}))])}},bl=(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)},xl=(e,t,n,r)=>{n.type=`boolean`},Sl=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},Cl=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`)},wl=(e,t,n,r)=>{n.not={}},Tl=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Date cannot be represented in JSON Schema`)},El=(e,t,n,r)=>{let a=e._zod.def,o=Pi(a.entries);o.every(e=>typeof e==`number`)&&(n.type=`number`),o.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=o},Dl=(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},Ol=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},kl=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},Al=(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=fl(o.element,t,{...r,path:[...r.path,`items`]})},jl=(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]=fl(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=fl(o.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(a.additionalProperties=!1)},Ml=(e,t,n,r)=>{let a=e._zod.def,o=a.inclusive===!1,s=a.options.map((e,n)=>fl(e,t,{...r,path:[...r.path,o?`oneOf`:`anyOf`,n]}));o?n.oneOf=s:n.anyOf=s},Nl=(e,t,n,r)=>{let a=e._zod.def,o=fl(a.left,t,{...r,path:[...r.path,`allOf`,0]}),s=fl(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]]},Pl=(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)=>fl(e,t,{...r,path:[...r.path,s,n]})),u=o.rest?fl(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)},Fl=(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=fl(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=fl(o.keyType,t,{...r,path:[...r.path,`propertyNames`]})),a.additionalProperties=fl(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)}},Il=(e,t,n,r)=>{let a=e._zod.def,o=fl(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`}]},Ll=(e,t,n,r)=>{let a=e._zod.def;fl(a.innerType,t,r);let o=t.seen.get(e);o.ref=a.innerType},Rl=(e,t,n,r)=>{let a=e._zod.def;fl(a.innerType,t,r);let o=t.seen.get(e);o.ref=a.innerType,n.default=JSON.parse(JSON.stringify(a.defaultValue))},zl=(e,t,n,r)=>{let a=e._zod.def;fl(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)))},Bl=(e,t,n,r)=>{let a=e._zod.def;fl(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},Vl=(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;fl(s,t,r);let c=t.seen.get(e);c.ref=s},Hl=(e,t,n,r)=>{let a=e._zod.def;fl(a.innerType,t,r);let o=t.seen.get(e);o.ref=a.innerType,n.readOnly=!0},Ul=(e,t,n,r)=>{let a=e._zod.def;fl(a.innerType,t,r);let o=t.seen.get(e);o.ref=a.innerType},Wl=(e,t,n,r)=>{let a=e._zod.innerType;fl(a,t,r);let o=t.seen.get(e);o.ref=a},Gl=j(`ZodISODateTime`,(e,t)=>{Ko.init(e,t),_u.init(e,t)});function Kl(e){return Dc(Gl,e)}var ql=j(`ZodISODate`,(e,t)=>{qo.init(e,t),_u.init(e,t)});function Jl(e){return Oc(ql,e)}var Yl=j(`ZodISOTime`,(e,t)=>{Jo.init(e,t),_u.init(e,t)});function Xl(e){return kc(Yl,e)}var Zl=j(`ZodISODuration`,(e,t)=>{Yo.init(e,t),_u.init(e,t)});function Ql(e){return Ac(Zl,e)}var $l=j(`ZodError`,(e,t)=>{ga.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>ya(e,t)},flatten:{value:t=>va(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Fi,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Fi,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),eu=ba($l),tu=xa($l),nu=Sa($l),ru=wa($l),iu=Ea($l),au=Da($l),ou=Oa($l),su=ka($l),cu=Aa($l),lu=ja($l),uu=Ma($l),du=Na($l),fu=new WeakMap;function pu(e,t,n){let r=Object.getPrototypeOf(e),a=fu.get(r);if(a||(a=new Set,fu.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 mu=j(`ZodType`,(e,t)=>(Mo.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:_l(e,`input`),output:_l(e,`output`)}}),e.toJSONSchema=gl(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>eu(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>nu(e,t,n),e.parseAsync=async(t,n)=>tu(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>ru(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>iu(e,t,n),e.decode=(t,n)=>au(e,t,n),e.encodeAsync=async(t,n)=>ou(e,t,n),e.decodeAsync=async(t,n)=>su(e,t,n),e.safeEncode=(t,n)=>cu(e,t,n),e.safeDecode=(t,n)=>lu(e,t,n),e.safeEncodeAsync=async(t,n)=>uu(e,t,n),e.safeDecodeAsync=async(t,n)=>du(e,t,n),pu(e,`ZodType`,{check(...e){let t=this.def;return this.clone(Hi(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 Qi(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Id(e,t))},superRefine(e,t){return this.check(Ld(e,t))},overwrite(e){return this.check(el(e))},optional(){return hd(this)},exactOptional(){return _d(this)},nullable(){return yd(this)},nullish(){return hd(yd(this))},nonoptional(e){return Td(this,e)},array(){return z(this)},or(e){return V([this,e])},and(e){return ad(this,e)},transform(e){return kd(this,pd(e))},default(e){return xd(this,e)},prefault(e){return Cd(this,e)},catch(e){return Dd(this,e)},pipe(e){return kd(this,e)},readonly(){return jd(this)},describe(e){let t=this.clone();return rc.add(t,{description:e}),t},meta(...e){if(e.length===0)return rc.get(this);let t=this.clone();return rc.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 rc.get(e)?.description},configurable:!0}),e)),hu=j(`_ZodString`,(e,t)=>{No.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yl(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,pu(e,`_ZodString`,{regex(...e){return this.check(Jc(...e))},includes(...e){return this.check(Zc(...e))},startsWith(...e){return this.check(Qc(...e))},endsWith(...e){return this.check($c(...e))},min(...e){return this.check(Kc(...e))},max(...e){return this.check(Gc(...e))},length(...e){return this.check(qc(...e))},nonempty(...e){return this.check(Kc(1,...e))},lowercase(e){return this.check(Yc(e))},uppercase(e){return this.check(Xc(e))},trim(){return this.check(nl())},normalize(...e){return this.check(tl(...e))},toLowerCase(){return this.check(rl())},toUpperCase(){return this.check(il())},slugify(){return this.check(al())}})}),gu=j(`ZodString`,(e,t)=>{No.init(e,t),hu.init(e,t),e.email=t=>e.check(ac(vu,t)),e.url=t=>e.check(dc(Su,t)),e.jwt=t=>e.check(Ec(Ru,t)),e.emoji=t=>e.check(fc(wu,t)),e.guid=t=>e.check(oc(bu,t)),e.uuid=t=>e.check(sc(xu,t)),e.uuidv4=t=>e.check(cc(xu,t)),e.uuidv6=t=>e.check(lc(xu,t)),e.uuidv7=t=>e.check(uc(xu,t)),e.nanoid=t=>e.check(pc(Tu,t)),e.guid=t=>e.check(oc(bu,t)),e.cuid=t=>e.check(mc(Eu,t)),e.cuid2=t=>e.check(hc(Du,t)),e.ulid=t=>e.check(gc(Ou,t)),e.base64=t=>e.check(Cc(Fu,t)),e.base64url=t=>e.check(wc(Iu,t)),e.xid=t=>e.check(_c(ku,t)),e.ksuid=t=>e.check(vc(Au,t)),e.ipv4=t=>e.check(yc(ju,t)),e.ipv6=t=>e.check(bc(Mu,t)),e.cidrv4=t=>e.check(xc(Nu,t)),e.cidrv6=t=>e.check(Sc(Pu,t)),e.e164=t=>e.check(Tc(Lu,t)),e.datetime=t=>e.check(Kl(t)),e.date=t=>e.check(Jl(t)),e.time=t=>e.check(Xl(t)),e.duration=t=>e.check(Ql(t))});function P(e){return ic(gu,e)}var _u=j(`ZodStringFormat`,(e,t)=>{Po.init(e,t),hu.init(e,t)}),vu=j(`ZodEmail`,(e,t)=>{Lo.init(e,t),_u.init(e,t)});function yu(e){return ac(vu,e)}var bu=j(`ZodGUID`,(e,t)=>{Fo.init(e,t),_u.init(e,t)}),xu=j(`ZodUUID`,(e,t)=>{Io.init(e,t),_u.init(e,t)}),Su=j(`ZodURL`,(e,t)=>{Ro.init(e,t),_u.init(e,t)});function Cu(e){return dc(Su,e)}var wu=j(`ZodEmoji`,(e,t)=>{zo.init(e,t),_u.init(e,t)}),Tu=j(`ZodNanoID`,(e,t)=>{Bo.init(e,t),_u.init(e,t)}),Eu=j(`ZodCUID`,(e,t)=>{Vo.init(e,t),_u.init(e,t)}),Du=j(`ZodCUID2`,(e,t)=>{Ho.init(e,t),_u.init(e,t)}),Ou=j(`ZodULID`,(e,t)=>{Uo.init(e,t),_u.init(e,t)}),ku=j(`ZodXID`,(e,t)=>{Wo.init(e,t),_u.init(e,t)}),Au=j(`ZodKSUID`,(e,t)=>{Go.init(e,t),_u.init(e,t)}),ju=j(`ZodIPv4`,(e,t)=>{Xo.init(e,t),_u.init(e,t)}),Mu=j(`ZodIPv6`,(e,t)=>{Zo.init(e,t),_u.init(e,t)}),Nu=j(`ZodCIDRv4`,(e,t)=>{Qo.init(e,t),_u.init(e,t)}),Pu=j(`ZodCIDRv6`,(e,t)=>{$o.init(e,t),_u.init(e,t)}),Fu=j(`ZodBase64`,(e,t)=>{ts.init(e,t),_u.init(e,t)}),Iu=j(`ZodBase64URL`,(e,t)=>{rs.init(e,t),_u.init(e,t)}),Lu=j(`ZodE164`,(e,t)=>{is.init(e,t),_u.init(e,t)}),Ru=j(`ZodJWT`,(e,t)=>{os.init(e,t),_u.init(e,t)}),zu=j(`ZodNumber`,(e,t)=>{ss.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bl(e,t,n,r),pu(e,`ZodNumber`,{gt(e,t){return this.check(Hc(e,t))},gte(e,t){return this.check(Uc(e,t))},min(e,t){return this.check(Uc(e,t))},lt(e,t){return this.check(Bc(e,t))},lte(e,t){return this.check(Vc(e,t))},max(e,t){return this.check(Vc(e,t))},int(e){return this.check(Vu(e))},safe(e){return this.check(Vu(e))},positive(e){return this.check(Hc(0,e))},nonnegative(e){return this.check(Uc(0,e))},negative(e){return this.check(Bc(0,e))},nonpositive(e){return this.check(Vc(0,e))},multipleOf(e,t){return this.check(Wc(e,t))},step(e,t){return this.check(Wc(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 F(e){return jc(zu,e)}var Bu=j(`ZodNumberFormat`,(e,t)=>{cs.init(e,t),zu.init(e,t)});function Vu(e){return Mc(Bu,e)}var Hu=j(`ZodBoolean`,(e,t)=>{ls.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xl(e,t,n,r)});function I(e){return Nc(Hu,e)}var Uu=j(`ZodNull`,(e,t)=>{us.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Sl(e,t,n,r)});function Wu(e){return Pc(Uu,e)}var Gu=j(`ZodAny`,(e,t)=>{ds.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Ku(){return Fc(Gu)}var qu=j(`ZodUnknown`,(e,t)=>{fs.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function L(){return Ic(qu)}var Ju=j(`ZodNever`,(e,t)=>{ps.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wl(e,t,n,r)});function Yu(e){return Lc(Ju,e)}var Xu=j(`ZodVoid`,(e,t)=>{ms.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Cl(e,t,n,r)});function R(e){return Rc(Xu,e)}var Zu=j(`ZodDate`,(e,t)=>{hs.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Tl(e,t,n,r),e.min=(t,n)=>e.check(Uc(t,n)),e.max=(t,n)=>e.check(Vc(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 Qu(e){return zc(Zu,e)}var $u=j(`ZodArray`,(e,t)=>{_s.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Al(e,t,n,r),e.element=t.element,pu(e,`ZodArray`,{min(e,t){return this.check(Kc(e,t))},nonempty(e){return this.check(Kc(1,e))},max(e,t){return this.check(Gc(e,t))},length(e,t){return this.check(qc(e,t))},unwrap(){return this.element}})});function z(e,t){return ol($u,e,t)}var ed=j(`ZodObject`,(e,t)=>{Ss.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jl(e,t,n,r),M(e,`shape`,()=>t.shape),pu(e,`ZodObject`,{keyof(){return U(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:L()})},loose(){return this.clone({...this._zod.def,catchall:L()})},strict(){return this.clone({...this._zod.def,catchall:Yu()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return ra(this,e)},safeExtend(e){return ia(this,e)},merge(e){return aa(this,e)},pick(e){return ta(this,e)},omit(e){return na(this,e)},partial(...e){return oa(md,this,e[0])},required(...e){return sa(wd,this,e[0])}})});function B(e,t){return new ed({type:`object`,shape:e??{},...N(t)})}var td=j(`ZodUnion`,(e,t)=>{ws.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ml(e,t,n,r),e.options=t.options});function V(e,t){return new td({type:`union`,options:e,...N(t)})}var nd=j(`ZodDiscriminatedUnion`,(e,t)=>{td.init(e,t),Ts.init(e,t)});function rd(e,t,n){return new nd({type:`union`,options:t,discriminator:e,...N(n)})}var id=j(`ZodIntersection`,(e,t)=>{Es.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Nl(e,t,n,r)});function ad(e,t){return new id({type:`intersection`,left:e,right:t})}var od=j(`ZodTuple`,(e,t)=>{ks.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pl(e,t,n,r),e.rest=t=>e.clone({...e._zod.def,rest:t})});function sd(e,t,n){let r=t instanceof Mo;return new od({type:`tuple`,items:e,rest:r?t:null,...N(r?n:t)})}var cd=j(`ZodRecord`,(e,t)=>{Ns.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fl(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function H(e,t,n){return!t||!t._zod?new cd({type:`record`,keyType:P(),valueType:e,...N(t)}):new cd({type:`record`,keyType:e,valueType:t,...N(n)})}function ld(e,t,n){let r=Qi(e);return r._zod.values=void 0,new cd({type:`record`,keyType:r,valueType:t,...N(n)})}var ud=j(`ZodEnum`,(e,t)=>{Ps.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>El(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 ud({...t,checks:[],...N(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 ud({...t,checks:[],...N(r),entries:a})}});function U(e,t){return new ud({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...N(t)})}var dd=j(`ZodLiteral`,(e,t)=>{Fs.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Dl(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 W(e,t){return new dd({type:`literal`,values:Array.isArray(e)?e:[e],...N(t)})}var fd=j(`ZodTransform`,(e,t)=>{Is.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>kl(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new ji(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(ma(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(ma(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 pd(e){return new fd({type:`transform`,transform:e})}var md=j(`ZodOptional`,(e,t)=>{Rs.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ul(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function hd(e){return new md({type:`optional`,innerType:e})}var gd=j(`ZodExactOptional`,(e,t)=>{zs.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ul(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function _d(e){return new gd({type:`optional`,innerType:e})}var vd=j(`ZodNullable`,(e,t)=>{Bs.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Il(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function yd(e){return new vd({type:`nullable`,innerType:e})}var bd=j(`ZodDefault`,(e,t)=>{Vs.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Rl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function xd(e,t){return new bd({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Yi(t)}})}var Sd=j(`ZodPrefault`,(e,t)=>{Us.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Cd(e,t){return new Sd({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Yi(t)}})}var wd=j(`ZodNonOptional`,(e,t)=>{Ws.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ll(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Td(e,t){return new wd({type:`nonoptional`,innerType:e,...N(t)})}var Ed=j(`ZodCatch`,(e,t)=>{Ks.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Dd(e,t){return new Ed({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var Od=j(`ZodPipe`,(e,t)=>{qs.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vl(e,t,n,r),e.in=t.in,e.out=t.out});function kd(e,t){return new Od({type:`pipe`,in:e,out:t})}var Ad=j(`ZodReadonly`,(e,t)=>{Ys.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function jd(e){return new Ad({type:`readonly`,innerType:e})}var Md=j(`ZodLazy`,(e,t)=>{Zs.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wl(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function Nd(e){return new Md({type:`lazy`,getter:e})}var Pd=j(`ZodCustom`,(e,t)=>{Qs.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ol(e,t,n,r)});function Fd(e,t){return sl(Pd,e??(()=>!0),t)}function Id(e,t={}){return cl(Pd,e,t)}function Ld(e,t){return ll(e,t)}function Rd(e,t={}){let n=new Pd({type:`custom`,check:`custom`,fn:t=>t instanceof e,abort:!0,...N(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 zd=U([`singleton`,`device`,`widget`]),Bd=B({capName:P(),kind:zd,deviceId:F().optional(),reachable:I(),latencyMs:F(),error:P().optional()}),Vd=B({addonId:P(),caps:z(Bd).readonly(),widgets:z(Bd).readonly()}),Hd=B({nodeId:P(),addons:z(Vd).readonly()});B({ok:I(),degraded:I(),checkedAt:P(),nodes:z(Hd).readonly(),summary:B({total:F(),reachable:F(),unreachable:F()})});var Ud=[`onnx`,`coreml`,`openvino`,`tflite`,`pt`],G=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.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 Wd=U([`high`,`mid`,`low`]),Gd=U([`pull-rtsp`,`pull-rtmp`,`pull-http`,`pull-rfc4571`,`push-annexb`,`derived`]),Kd=B({width:F().int().positive(),height:F().int().positive()}),qd=B({camStreamId:P().min(1),deviceId:F().int().nonnegative(),kind:Gd,url:P().optional(),codec:P().optional(),resolution:Kd.optional(),fps:F().positive().optional(),label:P().optional(),deviceFeatures:z(P()).optional(),autoEligible:I().optional(),metadata:H(P(),L()).optional()}),Jd=U([`unassigned`,`idle`,`connecting`,`streaming`,`error`]),Yd=B({deviceId:F().int().nonnegative(),profile:Wd,brokerId:P(),sourceCamStreamId:P().nullable(),status:Jd,resolution:Kd.optional(),codec:P().optional(),preBufferSec:F().nonnegative().optional(),errorMessage:P().optional()}),Xd=B({id:P(),label:P(),protocol:U([`rtsp`,`rtmp`,`annexb`,`http-mjpeg`,`webrtc`,`custom`]),url:P().optional(),resolution:B({width:F(),height:F()}).readonly().optional(),fps:F().optional(),bitrate:F().optional(),codec:P().optional(),profileHint:Wd.optional()});B({type:P(),url:P(),videoCodec:P().optional(),audioCodec:P().optional(),metadata:H(P(),L()).readonly().optional()});var Zd=B({type:U([`video`,`audio`]),data:Rd(Uint8Array),pts:F(),dts:F(),keyframe:I(),codec:P()}),Qd=B({data:Rd(Uint8Array),width:F(),height:F(),format:U([`jpeg`,`rgb`,`bgr`,`yuv420`,`gray`]),timestamp:F()}),$d=B({shmId:P(),slot:F().int().nonnegative(),seq:F().int().nonnegative(),width:F().int().positive(),height:F().int().positive(),format:U([`jpeg`,`rgb`,`bgr`,`yuv420`,`gray`]),pts:F(),byteLength:F().int().nonnegative(),nodeId:P(),slotCount:F().int().positive()}),ef=U([`rgb`,`bgr`,`yuv420`,`gray`]),tf=B({brokerId:P(),format:ef,maxFps:F().positive().optional(),tag:P().optional()}),nf=B({subscriptionId:P(),maxFps:F().nonnegative()}),rf=B({data:Rd(Uint8Array),sampleRate:F().int().positive(),channels:F().int().positive(),timestamp:F()}),af=B({brokerId:P(),tag:P().optional()}),of=B({subscriptionId:P()}),sf=B({status:U([`idle`,`connecting`,`streaming`,`error`,`stopped`]),inputFps:F(),decodeFps:F(),encodedSubscribers:F(),decodedSubscribers:F(),uptimeMs:F(),bitrateKbps:F(),idrIntervalMs:F(),codec:P().optional(),totalBytes:F(),packetCount:F(),rtspClients:F(),pipeClients:F(),preBufferSec:F(),preBufferMs:F(),preBufferPackets:F(),decoderNodeId:P().nullable(),audio:B({codec:P(),sampleRate:F(),channels:F(),supported:I()}).nullable().optional()}),cf=B({profile:Wd,brokerId:P(),url:P(),mutedUrl:P(),enabled:I(),codec:P().optional(),resolution:Kd.optional()}),lf=F().int().min(0).max(6),uf=/^([01]\d|2[0-3]):[0-5]\d$/,df=rd(`kind`,[B({kind:W(`always`)}),B({kind:W(`timeOfDay`),start:P().regex(uf),end:P().regex(uf),days:z(lf).optional()})]),ff=U([`continuous`,`onMotion`,`onAudioThreshold`]),pf=U([`off`,`events`,`continuous`]),mf=B({motion:I().optional(),audioThresholdDbfs:F().optional()}),hf=U([`continuous`,`events`]),gf=mf,_f=B({days:z(lf),start:P().regex(uf),end:P().regex(uf),mode:hf,triggers:gf.optional(),preBufferSec:F().min(0).optional(),postBufferSec:F().min(0).optional()}),vf=B({schedule:df,mode:ff,preBufferSec:F().min(0).default(0),postBufferSec:F().min(0).default(0),resetTimeoutOnNewEvent:I().default(!0),thresholdDbfs:F().optional()}),yf=B({maxAgeDays:F().min(0).optional(),maxSizeGb:F().min(0).optional()}),bf=B({enabled:I(),mode:pf.optional(),profiles:z(Wd).optional(),segmentSeconds:F().int().positive().optional(),schedules:z(df).optional(),schedule:df.optional(),triggers:mf.optional(),preBufferSec:F().min(0).optional(),postBufferSec:F().min(0).optional(),rules:z(vf).optional(),bands:z(_f).optional(),retention:yf.optional()}),xf=P().regex(/^[a-z][a-zA-Z0-9-]*$/),Sf=B({id:P().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/),type:P(),displayName:P().min(1),providerId:P().min(1),config:H(P(),L()),nodeId:P().optional(),isDefault:I().default(!1),isSystem:I().default(!1),createdAt:F(),updatedAt:F()}),Cf=V([xf,P().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/)]),wf=B({id:P().regex(/^[a-z][a-zA-Z0-9-]*$/,{message:`id must start with a lowercase letter and contain only letters, digits, or hyphens`}),displayName:P().min(1,{message:`displayName must not be empty`}),description:P().optional(),cardinality:U([`single`,`multi`]),defaultsTo:P().optional()}),Tf=B({inputFps:F(),outputFps:F(),avgDecodeTimeMs:F(),droppedFrames:F()}),Ef=B({codec:P(),maxFps:F().default(0),outputFormat:U([`jpeg`,`rgb`,`bgr`,`yuv420`,`gray`]).default(`jpeg`),scale:F().default(1),width:F().optional(),height:F().optional(),deviceId:F().int().nonnegative().optional(),tag:P().optional(),frameSink:U([`callback`,`shm`]).default(`callback`)}),Df=B({video:B({codec:U([`h264`,`h265`,`copy`]),profile:U([`baseline`,`main`,`high`]).optional(),width:F().int().positive().optional(),height:F().int().positive().optional(),fps:F().positive().optional(),bitrateKbps:F().int().positive().optional(),gopFrames:F().int().positive().optional(),bf:F().int().min(0).optional(),preset:U([`ultrafast`,`superfast`,`veryfast`,`faster`,`fast`,`medium`]).optional(),tune:U([`zerolatency`,`film`,`animation`]).optional()}),audio:V([W(`passthrough`),B({codec:U([`opus`,`aac`,`pcmu`,`pcma`,`copy`]),bitrateKbps:F().int().positive().optional(),sampleRateHz:F().int().positive().optional(),channels:V([W(1),W(2)]).optional()})]),inputArgs:z(P()).optional(),outputArgs:z(P()).optional()}),Of={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},kf={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},Af=new Map;for(let[e,t]of Object.entries(Of.mapping))Af.set(e.toLowerCase(),t);for(let[e,t]of Object.entries(kf.mapping))Af.set(e.toLowerCase(),t);var 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}({}),jf=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}({}),Mf={Siren:q.Siren,Floodlight:q.Floodlight,Spotlight:q.Spotlight,PirSensor:q.PirSensor,Chime:q.Chime,Autotrack:q.Autotrack,Nightvision:q.Nightvision,PrivacyMask:q.PrivacyMask};Mf.Siren,Mf.Floodlight,Mf.Spotlight,Mf.PirSensor,Mf.Chime,Mf.Autotrack,Mf.Nightvision,Mf.PrivacyMask,jf.BatteryOperated;var Nf=B({online:I(),lastChangedAt:F()}),Pf={name:`device-status`,scope:`device`,deviceNative:!0,mode:`singleton`,methods:{},events:{onStatusChanged:{data:B({deviceId:F(),status:Nf})}},status:{schema:Nf,kind:`push`},runtimeState:Nf},Ff=B({flags:H(P(),L()),deviceType:P().nullable(),model:P().nullable(),channelCount:F().nullable(),lastProbedAt:F(),lastFetchedAt:F()}),If={name:`feature-probe`,scope:`device`,deviceNative:!0,mode:`singleton`,methods:{},events:{onProbeChanged:{data:B({deviceId:F(),status:Ff})}},status:{schema:Ff,kind:`push`},runtimeState:Ff},Lf=B({co2Ppm:F().min(0).optional(),vocPpb:F().min(0).optional(),pm25:F().min(0).optional(),pm10:F().min(0).optional(),aqi:F().optional(),lastFetchedAt:F(),unit:P().optional(),precision:F().int().min(0).max(10).optional()}),Rf={name:`air-quality-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Sensor],methods:{},status:{schema:Lf,kind:`push`},runtimeState:Lf},zf=B({id:P(),title:P(),description:P().optional(),style:U([`card`,`accordion`]).optional(),defaultCollapsed:I().optional(),columns:V([W(1),W(2),W(3),W(4)]).optional(),tab:P().optional(),location:U([`settings`,`top-tab`]).optional(),order:F().optional(),fields:z(Ku())});B({tabs:z(B({id:P(),label:P(),icon:P(),order:F().optional()})).optional(),sections:z(zf)}).nullable(),B({deviceId:F()}),B({deviceId:F()}),B({deviceId:F(),patch:H(P(),L())}),B({success:W(!0)}),B({deviceId:F()}),L().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 Bf(e){return{data:e}}var Vf=U([`disarmed`,`armed_home`,`armed_away`,`armed_night`,`armed_vacation`,`armed_custom_bypass`,`arming`,`disarming`,`pending`,`triggered`]),Hf=U([`home`,`away`,`night`,`vacation`,`custom_bypass`]),Uf=B({state:Vf,availableModes:z(Hf),requiresCode:I(),lastChangedAt:F()}),Wf={name:`alarm-panel`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.AlarmPanel],methods:{arm:J(B({deviceId:F().int().nonnegative(),mode:Hf,code:P().min(1).optional()}),R(),{kind:`mutation`,auth:`admin`}),disarm:J(B({deviceId:F().int().nonnegative(),code:P().min(1).optional()}),R(),{kind:`mutation`,auth:`admin`}),trigger:J(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:Uf,kind:`push`},runtimeState:Uf},Gf=B({lux:F().min(0),lastFetchedAt:F(),unit:P().optional(),precision:F().int().min(0).max(10).optional()}),Kf={name:`ambient-light-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Sensor],methods:{},status:{schema:Gf,kind:`push`},runtimeState:Gf},qf=B({className:P(),hits:F().int().nonnegative(),avgScore:F().min(0).max(1),peakScore:F().min(0).max(1)}),Jf=B({ts:F().int(),windowSec:F().int().positive(),level:B({rms:F(),dbfs:F()}),peakDbfs:F(),avgDbfs:F(),current:B({className:P(),score:F().min(0).max(1),timestamp:F().int()}).nullable(),byClass:z(qf).readonly()}),Yf=B({points:z(B({ts:F().int(),dbfs:F().nullable(),peakDbfs:F(),avgDbfs:F(),topClass:P().nullable(),topScore:F().min(0).max(1).nullable()})).readonly(),effectiveSampleEveryMs:F().int().positive(),windowMsActual:F().int().nonnegative()}),Xf={name:`audio-metrics`,scope:`device`,mode:`singleton`,deviceTypes:[K.Camera],methods:{getCurrentSnapshot:J(B({deviceId:F()}),Jf.nullable()),getHistory:J(B({deviceId:F(),windowSec:F().int().positive().optional(),sampleEveryMs:F().int().positive().optional()}),Yf)},runtimeState:Jf},Zf=B({enabled:I(),isRunning:I(),lastTriggeredAt:F(),lastError:P().nullable(),lastChangedAt:F()}),Qf={name:`automation-control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Automation],methods:{enable:J(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),disable:J(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),trigger:J(B({deviceId:F().int().nonnegative(),skipCondition:I().optional()}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:Zf,kind:`push`},runtimeState:Zf},$f=B({percentage:F().min(0).max(100),charging:U([`dc`,`solar`,`none`]),sleeping:I(),lastUpdated:F(),binary:I().optional()}),ep={name:`battery`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Camera,K.Sensor,K.Button,K.Switch],methods:{wakeForStream:J(B({deviceId:F(),timeoutMs:F().int().min(500).max(3e4).default(8e3)}),B({awoke:I(),durationMs:F()}),{kind:`mutation`})},events:{onStatusChanged:{data:B({deviceId:F(),status:$f})}},status:{schema:$f,kind:`push`},runtimeState:$f},tp=B({on:I(),lastChangedAt:F()}),np={name:`binary`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Sensor],methods:{},status:{schema:tp,kind:`push`},runtimeState:tp},rp=B({percentage:F().min(0).max(100),lastChangedAt:F()}),ip={name:`brightness`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Light],methods:{setBrightness:J(B({deviceId:F().int().nonnegative(),percentage:F().min(0).max(100)}),R(),{kind:`mutation`,auth:`admin`})},events:{onBrightnessChanged:{data:B({deviceId:F(),percentage:F().min(0).max(100),lastChangedAt:F()})}},status:{schema:rp,kind:`command-driven`},runtimeState:rp},ap=U([`webrtc`,`hls`,`mjpeg`,`rtsp`]),op=B({streamId:P(),format:ap,url:P().nullable(),active:I()}),sp={name:`streaming-engine`,scope:`system`,mode:`singleton`,internal:!0,methods:{registerStream:J(B({streamId:P(),sourceUrl:P(),codec:P().optional()}),R(),{kind:`mutation`}),unregisterStream:J(B({streamId:P()}),R(),{kind:`mutation`}),getStreamUrl:J(B({streamId:P(),format:ap}),P().nullable()),listStreams:J(R(),z(op))}},cp=B({brokerId:P(),url:P(),mutedUrl:P(),enabled:I(),codec:P().optional(),resolution:B({width:F().int().positive(),height:F().int().positive()}).optional()}),lp=B({sessionId:P(),remoteAddr:P(),playing:I(),muted:I(),connectedAt:F(),lastRtpAt:F(),bytesSent:F()}),up=B({tag:P(),subscribedAt:F(),maxFps:F(),framesDelivered:F(),framesDropped:F()}),dp=B({tag:P(),subscribedAt:F(),chunksDelivered:F()}),fp=B({kind:U([`alexa`,`homekit`,`webrtc-browser`,`webrtc-mobile`,`webrtc-whep`,`rtsp-listen`,`derived-broker`,`recording`,`pipeline`,`snapshot`,`warmup`,`unknown`]),label:P().optional(),media:U([`audio`,`video`,`both`]).optional(),targetCodec:P().optional(),transport:U([`passthrough`,`repacketize`,`transcode`]).optional(),remoteAddr:P().optional(),userAgent:P().optional(),userId:P().optional(),sessionId:P().optional(),extra:H(P(),P()).optional()}).readonly(),pp=B({id:P(),channel:U([`annexb`,`rtp`]),attribution:fp,subscribedAt:F(),packetsDelivered:F()}),mp=B({rtsp:z(lp).readonly(),decoded:z(up).readonly(),audio:z(dp).readonly(),encoded:z(pp).readonly(),pipeClients:F(),encodedSubscribers:F()});U([`reconnecting`,`sleeping`,`offline`,`disabled`,`waking`]);var hp=U([`h264`,`h265`,`copy`]),gp=U([`aac`,`opus`,`pcmu`,`copy`,`none`]),_p=B({deviceId:F().int().nonnegative(),video:hp,audio:gp.optional(),profile:Wd.optional(),targetResolution:B({width:F().int().positive(),height:F().int().positive()}).optional(),outputArgs:z(P()).optional(),audioEgress:I().optional(),hostname:P().optional(),tag:P().optional()}),vp=B({url:P(),videoCodec:U([`H264`,`H265`]),audioCodec:P(),resolution:B({width:F().int().positive(),height:F().int().positive()}),transcoded:I(),encoder:P(),pipelineKey:P()}),yp={name:`stream-broker`,scope:`system`,mode:`singleton`,exposesDeviceSettings:!0,methods:{publishCameraStream:J(B({deviceId:F().int().nonnegative(),camStreamId:P().min(1),kind:Gd,url:P().optional(),codec:P().optional(),resolution:Kd.optional(),fps:F().positive().optional(),label:P().optional(),deviceFeatures:z(P()).optional(),autoEligible:I().optional(),metadata:H(P(),L()).optional(),sourceCamStreamId:P().min(1).optional(),encodeProfile:Df.optional()}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`}),retractCameraStream:J(B({deviceId:F().int().nonnegative(),camStreamId:P().min(1)}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`}),assignProfile:J(B({deviceId:F().int().nonnegative(),profile:Wd,camStreamId:P().min(1)}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`}),unassignProfile:J(B({deviceId:F().int().nonnegative(),profile:Wd}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`}),listAllCameraStreams:J(R(),z(qd).readonly()),listAllProfileSlots:J(R(),z(Yd).readonly()),getBrokerStats:J(B({brokerId:P()}),sf),probeStream:J(B({brokerId:P()}),B({probed:I(),summary:P()}),{kind:`mutation`,auth:`admin`}),listClients:J(B({brokerId:P()}),mp),killClient:J(B({brokerId:P(),channel:U([`rtsp`,`decoded`,`audio`]),handle:P()}),B({killed:I()}),{kind:`mutation`,auth:`admin`}),restartProfile:J(B({deviceId:F().int().nonnegative(),profile:Wd}),B({success:I()}),{kind:`mutation`,auth:`admin`}),getStreamUrl:J(B({streamId:P(),format:ap}),B({url:P()})),getStreamWithCodec:J(_p,vp,{kind:`mutation`,auth:`admin`}),releaseStreamWithCodec:J(B({pipelineKey:P()}),B({released:I(),refcount:F().int().nonnegative()}),{kind:`mutation`,auth:`admin`}),subscribeAudioChunks:J(af,of,{kind:`mutation`}),pullAudioChunks:J(B({subscriptionId:P(),maxCount:F().int().positive().default(8)}),z(rf).readonly()),unsubscribeAudioChunks:J(B({subscriptionId:P()}),B({released:I()}),{kind:`mutation`}),subscribeFrames:J(tf,nf,{kind:`mutation`}),pullFrameHandles:J(B({subscriptionId:P(),maxCount:F().int().positive().default(4)}),z($d).readonly()),unsubscribeFrames:J(B({subscriptionId:P()}),B({released:I()}),{kind:`mutation`}),setPreBufferDuration:J(B({brokerId:P(),seconds:F().min(0).max(30)}),R(),{kind:`mutation`,auth:`admin`}),getPreBufferInfo:J(B({brokerId:P()}),B({configuredSec:F(),bufferedMs:F(),packetCount:F()})),getRtspPort:J(R(),F()),getAllRtspEntries:J(B({hostname:P().optional()}),z(cp).readonly()),getRtspEntry:J(B({brokerId:P(),hostname:P().optional()}),cp.nullable()),regenerateRtspToken:J(B({brokerId:P()}),P().nullable(),{kind:`mutation`,auth:`admin`}),setRtspEnabled:J(B({brokerId:P(),enabled:I()}),R(),{kind:`mutation`,auth:`admin`}),isRtspEnabled:J(B({brokerId:P()}),I())},events:{onCamStreamDemand:Bf(B({deviceId:F().int().nonnegative(),camStreamId:P(),profile:Wd})),onCamStreamIdle:Bf(B({deviceId:F().int().nonnegative(),camStreamId:P()})),onRequestStreamSourceRefresh:Bf(B({deviceId:F().int().nonnegative(),camStreamId:P(),brokerId:P()}))}},bp=U([`h264`,`h265`,`hevc`,`av1`,`mjpeg`,`vp8`,`vp9`]),xp=B({acceptCodecs:z(bp).readonly().optional(),minHeight:F().int().positive().optional(),minWidth:F().int().positive().optional(),excludeDerived:I().optional(),requireSiblingCodec:z(bp).readonly().optional()}).readonly(),Sp=B({preferredProviders:z(P()).readonly().optional(),resolutionPreference:U([`highest`,`lowest`]).optional()}).readonly(),Cp=B({camStreamId:P(),codec:P().optional(),resolution:Kd.optional(),reason:P()}),wp={name:`camera-streams`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[K.Camera],methods:{getCameraStreams:J(B({deviceId:F().int().nonnegative()}),z(qd).readonly()),getBrokerStreams:J(B({deviceId:F().int().nonnegative()}),z(Yd).readonly()),getRtspEntries:J(B({deviceId:F().int().nonnegative(),hostname:P().optional()}),z(cp).readonly()),getProfileRtspEntries:J(B({deviceId:F().int().nonnegative(),hostname:P().optional()}),z(cf).readonly()),pickStream:J(B({deviceId:F().int().nonnegative(),requirements:xp,preferences:Sp.optional()}),Cp.nullable())},events:{onCamStreamsChanged:Bf(B({deviceId:F().int().nonnegative(),camStreams:z(qd).readonly()})),onProfileSlotsChanged:Bf(B({deviceId:F().int().nonnegative(),profileSlots:z(Yd).readonly()}))},runtimeState:B({online:I(),slotStatuses:B({high:Jd.optional(),mid:Jd.optional(),low:Jd.optional()}),slotErrors:B({high:P().optional(),mid:P().optional(),low:P().optional()}),lastChangedAt:F()})},Tp=B({detected:I(),lastChangedAt:F()}),Ep={name:`carbon-monoxide`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Sensor],methods:{},status:{schema:Tp,kind:`push`},runtimeState:Tp},Dp=U([`off`,`heat`,`cool`,`auto`,`heat_cool`,`fan_only`,`dry`]),Op=B({mode:Dp,availableModes:z(Dp),fanMode:P(),availableFanModes:z(P()),preset:P(),availablePresets:z(P()),target:F().nullable(),targetHigh:F().nullable(),targetLow:F().nullable(),targetHumidity:F().min(0).max(100).nullable(),currentTemp:F().nullable(),currentHumidity:F().min(0).max(100).nullable(),lastFetchedAt:F()}),kp={name:`climate-control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Thermostat],methods:{setMode:J(B({deviceId:F().int().nonnegative(),mode:Dp}),R(),{kind:`mutation`,auth:`admin`}),setFanMode:J(B({deviceId:F().int().nonnegative(),fanMode:P().min(1)}),R(),{kind:`mutation`,auth:`admin`}),setPreset:J(B({deviceId:F().int().nonnegative(),preset:P().min(1)}),R(),{kind:`mutation`,auth:`admin`}),setTarget:J(B({deviceId:F().int().nonnegative(),target:F()}),R(),{kind:`mutation`,auth:`admin`}),setTargetRange:J(B({deviceId:F().int().nonnegative(),targetLow:F(),targetHigh:F()}),R(),{kind:`mutation`,auth:`admin`}),setTargetHumidity:J(B({deviceId:F().int().nonnegative(),targetHumidity:F().min(0).max(100)}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:Op,kind:`push`},runtimeState:Op},Ap=B({r:F().int().min(0).max(255),g:F().int().min(0).max(255),b:F().int().min(0).max(255)}),jp=B({h:F().min(0).max(360),s:F().min(0).max(100),v:F().min(0).max(100)}),Mp=rd(`mode`,[B({mode:W(`rgb`),rgb:Ap}),B({mode:W(`hsv`),hsv:jp}),B({mode:W(`mired`),mireds:F().int().min(50).max(1e3)})]),Np=B({mode:U([`rgb`,`hsv`,`mired`]),rgb:Ap.optional(),hsv:jp.optional(),mireds:F().int().optional(),lastChangedAt:F()}),Pp={name:`color`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Light],methods:{setColor:J(B({deviceId:F().int().nonnegative(),color:Mp}),R(),{kind:`mutation`,auth:`admin`})},events:{onColorChanged:{data:B({deviceId:F(),mode:U([`rgb`,`hsv`,`mired`]),rgb:Ap.optional(),hsv:jp.optional(),mireds:F().int().optional(),lastChangedAt:F()})}},status:{schema:Np,kind:`command-driven`},runtimeState:Np},Fp=B({connected:I(),lastChangedAt:F()}),Ip={name:`connectivity`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Sensor],methods:{},status:{schema:Fp,kind:`push`},runtimeState:Fp},Lp=B({items:z(B({key:P().min(1),label:P().min(1),level:F().min(0).max(100).nullable(),status:U([`ok`,`replace`]).nullable(),lastResetAt:F().nullable(),resettable:I()})),lastChangedAt:F()}),Rp={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(B({deviceId:F().int().nonnegative(),key:P().min(1)}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:Lp,kind:`push`},runtimeState:Lp.extend({lastFetchedAt:F()})},zp=B({entryOpen:I(),lastChangedAt:F()}),Bp={name:`contact`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Sensor],methods:{},status:{schema:zp,kind:`push`},runtimeState:zp},Vp=B({kind:U([`numeric`,`select`,`text`,`datetime`]),value:V([F(),P()]),options:z(P()),lastChangedAt:F(),unit:P().optional(),min:F().optional(),max:F().optional(),step:F().optional(),precision:F().int().min(0).max(10).optional(),format:U([`date`,`time`,`datetime`]).optional()}),Hp=rd(`kind`,[B({kind:W(`numeric`),value:F()}),B({kind:W(`select`),value:P().min(1)}),B({kind:W(`text`),value:P()}),B({kind:W(`datetime`),value:P().min(1)})]),Up={name:`control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Control],methods:{setValue:J(B({deviceId:F().int().nonnegative(),control:Hp}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:Vp,kind:`push`},runtimeState:Vp},Wp=B({state:U([`open`,`opening`,`closing`,`closed`,`stopped`]),position:F().min(0).max(100).nullable(),tiltPosition:F().min(0).max(100).nullable(),lastChangedAt:F()}),Gp={name:`cover`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Cover],methods:{open:J(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),close:J(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),stop:J(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),setPosition:J(B({deviceId:F().int().nonnegative(),position:F().min(0).max(100)}),R(),{kind:`mutation`,auth:`admin`}),setTiltPosition:J(B({deviceId:F().int().nonnegative(),tiltPosition:F().min(0).max(100)}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:Wp,kind:`push`},runtimeState:Wp},Kp=B({id:P(),system:P(),uniqueId:P().optional(),raw:H(P(),L()).optional()}),qp=U([`online`,`sleeping`,`offline`,`unknown`]),Jp=Nd(()=>B({childNativeId:P(),name:P(),type:U(K),status:qp,metadata:B({model:P().optional(),serialNumber:P().optional(),uid:P().optional(),rtspChannel:F().int().nonnegative().optional(),isBattery:I().optional(),isDoorbell:I().optional(),isMultifocal:I().optional(),externalLocation:P().optional(),manufacturer:P().optional(),integration:P().optional()}).default({}),alreadyAdopted:I(),adoptedDeviceId:F().int().nonnegative().nullable(),capabilities:z(P()).readonly().optional(),features:z(P()).readonly().optional(),sourceInfo:Kp.optional(),children:z(Jp).readonly().optional()})),Yp=B({discovered:z(Jp),lastDiscoveryAt:F().int().nonnegative().nullable(),lastError:P().nullable()}),Xp={name:`device-discovery`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Hub],status:{schema:Yp,kind:`poll`},runtimeState:Yp.extend({lastFetchedAt:F().int().nonnegative()}),methods:{listDiscovered:J(B({deviceId:F().int().nonnegative()}),z(Jp).readonly()),refreshDiscovery:J(B({deviceId:F().int().nonnegative()}),z(Jp).readonly(),{kind:`mutation`,auth:`admin`}),adoptDevice:J(B({deviceId:F().int().nonnegative(),childNativeId:P(),name:P().optional()}),B({deviceId:F().int().nonnegative(),stableId:P()}),{kind:`mutation`,auth:`admin`}),releaseDevice:J(B({deviceId:F().int().nonnegative(),childDeviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`})}},Zp=B({lastPressedAt:F().nullable(),pressCountSinceStart:F()}),Qp=B({deviceId:F(),timestamp:F()}),$p={name:`doorbell`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Button],methods:{},events:{onPressed:{data:Qp}},status:{schema:Zp,kind:`push`},runtimeState:Zp},em=U([`date`,`time`,`datetime`]),tm=B({value:P(),format:em.optional(),lastFetchedAt:F()}),nm={name:`enum-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Sensor],methods:{},status:{schema:tm,kind:`push`},runtimeState:tm},rm=B({deviceId:F(),eventType:P(),data:H(P(),L()).nullable(),timestamp:F(),seq:F()}),im=B({eventTypes:z(P()),lastEvent:rm.nullable(),eventCountSinceStart:F()}),am={name:`event-emitter`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.EventEmitter],methods:{},events:{onEvent:{data:rm}},status:{schema:im,kind:`push`},runtimeState:im},om=U([`forward`,`reverse`]),sm=B({percentage:F().min(0).max(100).nullable(),percentageStep:F().positive().optional(),preset:P(),availablePresets:z(P()),direction:om.nullable(),oscillating:I().nullable(),lastChangedAt:F()}),cm={name:`fan-control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Fan],methods:{setPercentage:J(B({deviceId:F().int().nonnegative(),percentage:F().min(0).max(100)}),R(),{kind:`mutation`,auth:`admin`}),setPreset:J(B({deviceId:F().int().nonnegative(),preset:P().min(1)}),R(),{kind:`mutation`,auth:`admin`}),setDirection:J(B({deviceId:F().int().nonnegative(),direction:om}),R(),{kind:`mutation`,auth:`admin`}),setOscillating:J(B({deviceId:F().int().nonnegative(),oscillating:I()}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:sm,kind:`push`},runtimeState:sm},lm=B({flooded:I(),lastChangedAt:F()}),um={name:`flood`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Sensor],methods:{},status:{schema:lm,kind:`push`},runtimeState:lm},dm=B({detected:I(),lastChangedAt:F()}),fm={name:`gas`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Sensor],methods:{},status:{schema:dm,kind:`push`},runtimeState:dm},pm=B({on:I(),currentHumidity:F().min(0).max(100).nullable(),targetHumidity:F().min(0).max(100).nullable(),mode:P().nullable(),availableModes:z(P()),action:P().nullable(),minHumidity:F().nullable(),maxHumidity:F().nullable(),lastChangedAt:F()}),mm={name:`humidifier`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Humidifier],methods:{setOn:J(B({deviceId:F().int().nonnegative(),on:I()}),R(),{kind:`mutation`,auth:`admin`}),setTargetHumidity:J(B({deviceId:F().int().nonnegative(),humidity:F().min(0).max(100)}),R(),{kind:`mutation`,auth:`admin`}),setMode:J(B({deviceId:F().int().nonnegative(),mode:P().min(1)}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:pm,kind:`push`},runtimeState:pm},hm=B({percent:F().min(0).max(100),lastFetchedAt:F(),unit:P().optional(),precision:F().int().min(0).max(10).optional()}),gm={name:`humidity-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Sensor,K.Thermostat],methods:{},status:{schema:hm,kind:`push`},runtimeState:hm},_m=B({url:P().nullable(),lastUpdated:F().nullable()}),vm={name:`image`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Image],methods:{},status:{schema:_m,kind:`push`},runtimeState:_m},ym=B({activity:U([`idle`,`mowing`,`paused`,`docked`,`error`]),batteryLevel:F().min(0).max(100).nullable(),lastChangedAt:F()}),bm={name:`lawn-mower-control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.LawnMower],methods:{startMowing:J(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),pause:J(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),dock:J(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:ym,kind:`push`},runtimeState:ym},xm=B({state:U([`locked`,`unlocked`,`locking`,`unlocking`,`jammed`]),lastChangedAt:F()}),Sm={name:`lock-control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Lock],methods:{lock:J(B({deviceId:F().int().nonnegative(),code:P().min(1).optional()}),R(),{kind:`mutation`,auth:`admin`}),unlock:J(B({deviceId:F().int().nonnegative(),code:P().min(1).optional()}),R(),{kind:`mutation`,auth:`admin`}),open:J(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:xm,kind:`push`},runtimeState:xm},Cm=U([`off`,`on`,`idle`,`playing`,`paused`,`buffering`,`standby`]),wm=U([`off`,`all`,`one`]),Tm=B({type:P(),title:P(),artist:P().optional(),album:P().optional(),imageUrl:P().optional()}),Em=B({state:Cm,volumeLevel:F().min(0).max(100).nullable(),isMuted:I().nullable(),source:P(),availableSources:z(P()),currentMedia:Tm.nullable(),positionMs:F().int().nonnegative().nullable(),durationMs:F().int().nonnegative().nullable(),shuffle:I().nullable(),repeat:wm.nullable(),lastChangedAt:F()}),Dm={name:`media-player`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.MediaPlayer],methods:{play:J(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),pause:J(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),stop:J(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),next:J(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),previous:J(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),seek:J(B({deviceId:F().int().nonnegative(),positionMs:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),setVolume:J(B({deviceId:F().int().nonnegative(),volumeLevel:F().min(0).max(100)}),R(),{kind:`mutation`,auth:`admin`}),setMute:J(B({deviceId:F().int().nonnegative(),muted:I()}),R(),{kind:`mutation`,auth:`admin`}),setShuffle:J(B({deviceId:F().int().nonnegative(),shuffle:I()}),R(),{kind:`mutation`,auth:`admin`}),setRepeat:J(B({deviceId:F().int().nonnegative(),repeat:wm}),R(),{kind:`mutation`,auth:`admin`}),selectSource:J(B({deviceId:F().int().nonnegative(),source:P().min(1)}),R(),{kind:`mutation`,auth:`admin`}),playMedia:J(B({deviceId:F().int().nonnegative(),mediaId:P().min(1),mediaType:P().min(1)}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:Em,kind:`push`},runtimeState:Em},Om=U([`jpeg`,`rgb`,`bgr`,`yuv420`,`gray`]),km=B({data:Fd(),format:Om,width:F(),height:F(),timestamp:F()}),Am=B({x:F(),y:F(),w:F(),h:F()}),jm=B({class:P(),originalClass:P(),score:F(),bbox:Am}),Mm=B({data:Rd(Uint8Array),sampleRate:F(),channels:F(),timestamp:F(),deviceId:F().optional()}),Nm=B({rms:F(),dbfs:F()}),Pm=B({className:P(),originalClass:P().optional(),score:F()}),Fm=B({bbox:Am,pixelCount:F(),intensity:F()}),Im=B({detected:I(),regionCount:F(),regions:z(Fm).readonly(),rawRegions:z(Fm).readonly(),frameWidth:F(),frameHeight:F(),analysisMs:F()}),Lm={name:`motion-detection`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,exposesDeviceSettings:!0,methods:{analyze:J(B({deviceId:F(),frame:km}),Im,{kind:`mutation`}),removeCamera:J(B({deviceId:F()}),R(),{kind:`mutation`}),reset:J(R(),R(),{kind:`mutation`})},events:{onMotion:{data:B({deviceId:F(),detected:I(),regionCount:F()})}}};B({activeCameras:F(),throttledCameras:F(),avgInferenceTimeMs:F(),queueDepth:F()});var Rm=B({detectionMode:U([`disabled`,`always-on`,`on-motion`]),configuredFps:F(),actualFps:F(),queueDepth:F(),avgInferenceTimeMs:F(),droppedFrames:F(),phase:U([`idle`,`watching`,`active`])}),zm=Rm.extend({deviceId:F()}),Bm=U([`onnx`,`coreml`,`openvino`,`tflite`,`pt`]),Vm=U([`detector`,`cropper`,`classifier`,`refiner`,`audio-classifier`]),Hm=B({runtime:U([`node`,`python`]),backend:P(),format:Bm,device:P().optional()}),Um=B({engine:Hm,devices:z(B({id:P(),label:P(),description:P().optional()})).readonly(),defaultDevice:P()}),Wm=Nd(()=>B({addonId:P(),addonName:P(),slot:Vm,inputClasses:z(P()).readonly(),outputClasses:z(P()).readonly(),enabled:I(),modelId:P(),children:z(Wm).readonly(),engine:Hm.optional(),group:P().optional(),settings:H(P(),L()).optional()})),Gm=Nd(()=>B({addonId:P(),enabled:I(),modelId:P(),children:z(Gm).readonly(),settings:H(P(),L()).optional()})),Km=B({id:P(),name:P(),createdAt:P(),updatedAt:P(),engine:Hm,steps:z(Gm).readonly()}),qm=B({id:P(),name:P(),formats:H(P(),B({downloaded:I(),sizeMB:F()}))}),Jm=Fd(),Ym=B({id:P(),name:P(),slot:Vm,inputClasses:z(P()).readonly(),outputClasses:z(P()).readonly(),childSlots:z(Vm).readonly(),models:z(qm).readonly(),defaultModelId:P(),defaultModelIdByFormat:H(P(),P()).optional(),enabledByDefault:I().optional(),defaultConfidence:F(),group:P().optional(),configSchema:z(Jm).readonly().optional()}),Xm=B({id:Vm,label:P(),priority:F(),parentSlot:Vm.nullable(),addons:z(Ym).readonly()}),Zm=B({availableEngines:z(Um).readonly(),selectedEngine:Hm,slots:z(Xm).readonly()}),Qm=B({detections:z(jm).readonly(),inferenceMs:F(),modelId:P()}),$m=Nd(()=>B({addonId:P(),modelId:P(),enabled:I().default(!0),children:z($m).optional(),settings:H(P(),L()).optional()})),eh=B({filename:P(),stepIds:z(P()).readonly().optional()}),th=B({base64:P(),filename:P()}),nh=B({filename:P(),sizeKb:F()}),rh=B({base64:P()}),ih=B({id:P(),name:P(),description:P(),available:I(),rawLabels:z(P()).readonly().optional()}),ah=B({activeBackend:P(),availableBackends:z(ih).readonly(),sampleRate:F(),chunkDurationMs:F()}),oh=B({filePath:P(),sizeMB:F(),durationMs:F()}),sh=B({success:I(),error:P().optional(),frame:Fd().optional()}),ch=Fd(),lh=Fd(),uh=Fd(),dh=Fd(),fh=Fd(),ph=Fd(),mh={name:`pipeline-executor`,scope:`system`,mode:`singleton`,methods:{getAvailableEngines:J(R(),z(Hm)),getSelectedEngine:J(R(),Hm),getDefaultSteps:J(Hm,z(Wm)),reprobeEngine:J(R(),Hm,{kind:`mutation`,auth:`admin`}),getVideoPipelineSteps:J(R(),H(P(),B({modelId:P(),settings:H(P(),L()).readonly()}))),setVideoPipelineSteps:J(B({steps:H(P(),B({modelId:P(),settings:H(P(),L()).readonly()}))}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`}),getSchema:J(R(),Zm),getGlobalSteps:J(R(),z(Wm).readonly().nullable()),getGlobalPipelineConfig:J(R(),ch),getOrchestratorConfigSchema:J(R(),lh),listTemplates:J(R(),z(Km).readonly()),saveTemplate:J(B({name:P(),steps:z(Gm).readonly(),engine:Hm}),Km,{kind:`mutation`}),updateTemplate:J(B({id:P(),name:P().optional(),steps:z(Gm).readonly().optional()}),Km,{kind:`mutation`}),deleteTemplate:J(B({id:P()}),R(),{kind:`mutation`}),getCapabilities:J(R(),dh),getAddonModels:J(B({addonId:P()}),fh),downloadModel:J(B({addonId:P(),modelId:P(),format:Bm}),oh,{kind:`mutation`}),deleteModel:J(B({addonId:P(),modelId:P(),format:Bm}),B({success:W(!0)}),{kind:`mutation`}),detect:J(B({addonId:P(),frame:km,config:H(P(),L()).optional()}),Qm),runPipeline:J(B({engine:Hm.optional(),steps:z($m).min(1),frame:km.optional(),imageBase64:P().optional(),image:Rd(Uint8Array).optional(),referenceImage:P().optional(),deviceId:F().optional(),sessionId:P().optional()}),ph,{kind:`mutation`}),runPipelineBatch:J(B({engine:Hm.optional(),steps:z($m).min(1),frames:z(km).min(1).max(255),deviceId:F().optional(),sessionId:P().optional()}),B({results:z(ph).readonly()}),{kind:`mutation`}),cacheFrameInPool:J(B({data:Rd(Uint8Array),width:F().int().positive(),height:F().int().positive(),format:U([`rgb`,`bgr`,`gray`])}),B({frameId:F(),width:F(),height:F()}),{kind:`mutation`}),inferCached:J(B({stepId:P(),frameId:F().int()}),H(P(),L()),{kind:`mutation`}),uncacheFrame:J(B({frameId:F().int()}),R(),{kind:`mutation`}),getEffectiveTuning:J(R(),B({batchMode:P(),windowMs:F(),maxBatchSize:F(),concurrency:F()})),listLoadedEngines:J(R(),z(B({engineKey:P(),engine:Hm,modelsLoaded:z(P()).readonly(),inUseByCameras:z(F()).readonly(),kind:U([`runtime`,`warm-override`]),poolPid:F().nullable(),idleMs:F().nullable(),idleTtlMs:F().nullable()})).readonly()),spinEngine:J(B({engine:Hm}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`}),killEngine:J(B({engine:Hm,force:I().optional()}),B({success:I(),reason:P().optional()}),{kind:`mutation`,auth:`admin`}),listReferenceImages:J(R(),z(eh).readonly()),getReferenceImage:J(B({filename:P()}),th.nullable()),getReferenceAudioFiles:J(R(),z(nh).readonly()),getReferenceAudio:J(B({filename:P()}),rh.nullable()),getAudioCapabilities:J(R(),ah),runAudioTest:J(B({addonId:P(),modelId:P(),filename:P().optional(),settings:H(P(),L()).optional()}),sh,{kind:`mutation`}),getDetectionConfigSchema:J(R(),uh)}},hh=U([`polygon`,`tripwire`]),gh=B({x:F(),y:F()}),_h=B({id:P(),name:P(),kind:hh.default(`polygon`),polygon:z(gh).readonly(),color:P().default(`#3b82f6`)}),vh={name:`zones`,scope:`device`,mode:`singleton`,deviceTypes:[K.Camera],methods:{listZones:J(B({deviceId:F()}),z(_h).readonly()),addZone:J(B({deviceId:F(),zone:_h}),R(),{kind:`mutation`,auth:`admin`}),removeZone:J(B({deviceId:F(),zoneId:P()}),R(),{kind:`mutation`,auth:`admin`}),updateZone:J(B({deviceId:F(),zone:_h}),R(),{kind:`mutation`,auth:`admin`})},runtimeState:B({zones:z(_h).readonly()})},yh={min:0,max:6e4,default:3e4,step:500},bh={min:1,max:30,default:4,step:1},xh={min:1,max:30,default:10,step:1},Sh={min:0,max:300,default:30,step:5},Ch={min:1,max:10,default:4,step:1},wh=U([`onboard`,`analyzer`]),Th=z(wh),Eh=B({deviceId:F(),detected:I(),source:wh.default(`analyzer`),regions:z(Fm).readonly().optional()}),Dh=B({deviceId:F(),detectionMode:U([`disabled`,`always-on`,`on-motion`]).default(`on-motion`),audioMode:U([`disabled`,`always-on`,`on-motion`]).default(`always-on`),motionCooldownMs:F().min(yh.min).default(yh.default),motionFps:F().min(bh.min).max(bh.max).default(bh.default),detectionFps:F().min(xh.min).max(xh.max).default(xh.default),motionStreamId:P(),detectionStreamId:P(),motionSources:Th.default([`analyzer`]),pipelineEnabled:I().default(!0),engine:Hm.optional(),steps:z($m).readonly().optional(),audio:B({engine:Hm,modelId:P(),enabled:I()}).nullable().optional(),zones:z(_h).readonly().default([]),onboardMotionDrivesAnalyzer:I().default(!0),occupancyRecheckSec:F().min(Sh.min).max(Sh.max).default(Sh.default),occupancyRecheckFrames:F().min(Ch.min).max(Ch.max).default(Ch.default)});bh.min,bh.max,bh.step,bh.default,xh.min,xh.max,xh.step,xh.default,yh.min,yh.max,yh.step,yh.default,Sh.min,Sh.max,Sh.step,Sh.default,Ch.min,Ch.max,Ch.step,Ch.default;var Oh=B({nodeId:P(),attachedCameras:F(),activeCameras:F(),avgInferenceFps:F(),avgInferenceTimeMs:F(),queueDepthTotal:F(),hardware:B({hasGpu:I(),inferenceBackend:P().optional(),cpuCores:F().optional()})}),kh=B({nodeId:P(),activeCameras:F(),throttledCameras:F(),avgInferenceTimeMs:F(),queueDepth:F()}),Ah={name:`pipeline-runner`,scope:`system`,mode:`singleton`,methods:{attachCamera:J(Dh,B({success:W(!0)}),{kind:`mutation`}),detachCamera:J(B({deviceId:F()}),B({success:W(!0)}),{kind:`mutation`}),reportMotion:J(Eh,B({success:W(!0)}),{kind:`mutation`}),getLocalLoad:J(R(),Oh),getLocalMetrics:J(R(),kh),getCameraMetrics:J(B({deviceId:F()}),Rm.nullable()),getAllCameraMetrics:J(R(),z(zm).readonly()),getLocalCameras:J(R(),z(F()).readonly())}},jh=B({detected:I(),lastDetectedAt:F().nullable(),autoClearAfterMs:F().nullable()}),Mh=B({deviceId:F(),detected:I(),timestamp:F(),source:wh,regions:z(Fm).readonly().optional()}),Nh={name:`motion`,scope:`device`,mode:`singleton`,deviceTypes:[K.Camera,K.Sensor],methods:{isDetected:J(B({deviceId:F()}),I())},events:{onMotionChanged:{data:Mh}},status:{schema:jh,kind:`push`},runtimeState:jh},Ph=B({enabled:I(),lastChangedAt:F()}),Fh=Ph.extend({lastFetchedAt:F()}),Ih={name:`motion-trigger`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Light,K.Siren,K.Switch],methods:{setMotionTrigger:J(B({deviceId:F().int().nonnegative(),enabled:I()}),R(),{kind:`mutation`,auth:`admin`})},events:{onMotionTriggerChanged:{data:B({deviceId:F(),enabled:I(),lastChangedAt:F()})}},status:{schema:Ph,kind:`command-driven`},runtimeState:Fh},Lh=B({x:F(),y:F()}),Rh=B({kind:W(`rect`),x:F(),y:F(),width:F(),height:F()}),zh=B({kind:W(`polygon`),points:z(Lh)}),Bh=B({kind:W(`grid`),gridWidth:F(),gridHeight:F(),cells:z(I())});rd(`kind`,[Rh,zh,Bh,B({kind:W(`line`),points:z(Lh)})]);var Vh=U([`rect`,`polygon`,`grid`,`line`]),Hh=B({min:F(),max:F()}),Uh=B({width:F(),height:F()}),Wh=B({id:F(),enabled:I(),shape:Bh}),Gh=B({enabled:I(),sensitivity:F(),regions:z(Wh),lastFetchedAt:F()}),Kh=B({maxRegions:F(),supportedShapes:z(Vh),grid:Uh,sensitivity:B({min:F(),max:F(),step:F()})}),qh=B({enabled:I().optional(),sensitivity:F().optional(),regions:z(Wh).optional()}),Jh={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(B({deviceId:F()}),Kh),setZone:J(B({deviceId:F(),patch:qh}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:Gh,kind:`poll`},runtimeState:Gh},Yh=U([`person`,`vehicle`,`animal`,`face`,`package`,`other`]),Xh=B({class:Yh,timestamp:F(),confidence:F().min(0).max(1).optional()}),Zh=B({lastByClass:ld(Yh,Xh.nullable()),supportedClasses:z(Yh).readonly(),enabled:I()}),Qh=Zh.extend({lastFetchedAt:F()}),$h={name:`native-object-detection`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Camera],methods:{setEnabled:J(B({deviceId:F(),enabled:I()}),R(),{kind:`mutation`,auth:`admin`})},events:{onDetected:{data:B({deviceId:F(),detection:Xh})}},status:{schema:Zh,kind:`push`},runtimeState:Qh},eg=U([`min`,`low`,`normal`,`high`]),tg=B({id:P().min(1),title:P().min(1),uri:Cu().optional(),destructive:I().optional()}),ng=B({image:I(),priority:I(),data:I(),actions:I(),recipients:I()}),rg=B({lastSentAt:F(),lastError:P().nullable(),queueDepth:F().int().nonnegative(),supports:ng}),ig=B({deviceId:F().int().nonnegative(),title:P().optional(),body:P().min(1),image:P().optional(),priority:eg.optional(),channel:P().optional(),recipients:z(P()).optional(),actions:z(tg).optional(),data:H(P(),L()).optional()}),ag=B({notificationId:P(),acceptedAt:F()}),og={name:`notifier`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Notifier],methods:{send:J(ig,ag,{kind:`mutation`,auth:`admin`}),cancel:J(B({deviceId:F().int().nonnegative(),notificationId:P().min(1)}),R(),{kind:`mutation`,auth:`admin`})},events:{onSent:{data:B({deviceId:F(),notificationId:P(),success:I(),error:P().nullable(),acceptedAt:F()})}},status:{schema:rg,kind:`command-driven`},runtimeState:rg},sg=B({value:F(),unit:P().optional(),precision:F().int().min(0).max(10).optional(),lastFetchedAt:F()}),cg={name:`numeric-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Sensor],methods:{},status:{schema:sg,kind:`push`},runtimeState:sg},lg=B({watts:F().optional(),kwhTotal:F().optional(),volts:F().optional(),amps:F().optional(),va:F().optional(),powerFactor:F().min(0).max(1).optional(),lastFetchedAt:F(),unit:P().optional(),precision:F().int().min(0).max(10).optional()}),ug={name:`power-meter`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Sensor],methods:{},status:{schema:lg,kind:`push`},runtimeState:lg},dg=B({latitude:F().min(-90).max(90),longitude:F().min(-180).max(180),accuracyMeters:F().nonnegative()}),fg=B({state:P(),location:P().nullable(),gps:dg.nullable(),batteryPercent:F().min(0).max(100).nullable(),lastChangedAt:F()}),pg={name:`presence`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Presence],methods:{},status:{schema:fg,kind:`push`},runtimeState:fg},mg=B({hpa:F(),lastFetchedAt:F(),unit:P().optional(),precision:F().int().min(0).max(10).optional()}),hg={name:`pressure-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Sensor],methods:{},status:{schema:mg,kind:`push`},runtimeState:mg},gg=rd(`kind`,[Rh,zh]),_g=B({id:F(),enabled:I(),shape:gg}),vg=B({enabled:I(),regions:z(_g),lastFetchedAt:F()}),yg=B({maxRegions:F(),supportedShapes:z(Vh),polygonVertices:Hh.optional()}),bg=B({enabled:I().optional(),regions:z(_g).optional()}),xg={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(B({deviceId:F()}),yg),setMask:J(B({deviceId:F(),patch:bg}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:vg,kind:`poll`},runtimeState:vg},Sg=B({targetType:P().describe(`Vendor target string (people/vehicle/pet); empty = camera default`),stopDelaySeconds:F().int().min(0).max(300),disappearDelaySeconds:F().int().min(0).max(300)}),Cg=B({value:P(),label:P()}),wg=B({enabled:I(),lastChangedAt:F(),currentSettings:Sg.nullable(),supportedTargetTypes:z(Cg)}),Tg=wg.extend({lastFetchedAt:F()}),Eg={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(B({deviceId:F()}),wg),setEnabled:J(B({deviceId:F(),enabled:I()}),R(),{kind:`mutation`}),getSettings:J(B({deviceId:F()}),Sg.nullable()),setSettings:J(B({deviceId:F(),settings:Sg.partial()}),R(),{kind:`mutation`})},events:{onStatusChanged:{data:B({deviceId:F(),status:wg})}},status:{schema:wg,kind:`command-driven`},runtimeState:Tg},Dg=B({isRunning:I(),lastRunAt:F(),lastRunSuccess:I().nullable(),lastError:P().nullable(),lastChangedAt:F()}),Og={name:`script-runner`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Script],methods:{run:J(B({deviceId:F().int().nonnegative(),variables:H(P(),L()).optional()}),R(),{kind:`mutation`,auth:`admin`}),stop:J(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:Dg,kind:`push`},runtimeState:Dg},kg=B({detected:I(),lastChangedAt:F()}),Ag={name:`smoke`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Sensor],methods:{},status:{schema:kg,kind:`push`},runtimeState:kg},jg=U([`main`,`sub`,`ext`]),Mg=B({width:F(),height:F(),codec:U([`h264`,`h265`]),framerate:F(),bitrate:F(),bitrateMode:U([`vbr`,`cbr`]).optional(),encoderProfile:U([`high`,`main`,`baseline`]).optional(),gop:F().optional(),audio:I().optional()}),Ng=B({main:Mg.optional(),sub:Mg.optional(),ext:Mg.optional(),lastFetchedAt:F()}),Pg=B({resolutions:z(B({width:F(),height:F()})),codecs:z(U([`h264`,`h265`])),framerates:z(F()),bitrates:z(F()),bitrateRange:sd([F(),F()]).optional(),supportsBitrateMode:I(),supportsEncoderProfile:I(),supportsGop:I(),gop:B({min:F(),max:F(),step:F()}).optional()}),Fg=B({main:Pg.optional(),sub:Pg.optional(),ext:Pg.optional()}),Ig=B({width:F().optional(),height:F().optional(),codec:U([`h264`,`h265`]).optional(),framerate:F().optional(),bitrate:F().optional(),bitrateMode:U([`vbr`,`cbr`]).optional(),encoderProfile:U([`high`,`main`,`baseline`]).optional(),gop:F().optional(),audio:I().optional()}),Lg={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(B({deviceId:F()}),Fg),setProfile:J(B({deviceId:F(),profile:jg,patch:Ig}),R(),{kind:`mutation`,auth:`admin`}),getConfigSchema:J(B({deviceId:F()}),L().nullable())},status:{schema:Ng,kind:`poll`},runtimeState:Ng},Rg=B({on:I(),lastChangedAt:F()}),zg={name:`switch`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Switch,K.Siren,K.Light],methods:{setState:J(B({deviceId:F(),on:I()}),R(),{kind:`mutation`,auth:`admin`})},events:{onStateChanged:{data:B({deviceId:F(),on:I(),lastChangedAt:F()})}},status:{schema:Rg,kind:`command-driven`},runtimeState:Rg,settings:{bindings:[{kind:`scalar`,statusPath:`on`,method:`setState`,valueArg:`on`,field:{label:`On`,kind:`boolean`}}]}},Bg=B({tampered:I(),lastChangedAt:F()}),Vg={name:`tamper`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Sensor],methods:{},status:{schema:Bg,kind:`push`},runtimeState:Bg},Hg=B({celsius:F(),lastFetchedAt:F(),unit:P().optional(),precision:F().int().min(0).max(10).optional()}),Ug={name:`temperature-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Sensor,K.Thermostat],methods:{},status:{schema:Hg,kind:`push`},runtimeState:Hg},Wg=B({currentVersion:P().nullable(),availableVersion:P().nullable(),updatable:I(),state:P().nullable(),inProgress:I()}),Gg={name:`update`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Update],methods:{installUpdate:J(R(),R(),{kind:`mutation`,auth:`admin`})},status:{schema:Wg,kind:`poll`},runtimeState:Wg},Kg=U([`idle`,`cleaning`,`paused`,`returning`,`docked`,`error`]),qg=B({level:F().min(0).max(100).nullable(),status:U([`ok`,`low`,`full`]).nullable()}),Jg=B({state:Kg,batteryLevel:F().min(0).max(100).nullable(),fanSpeed:P().nullable(),availableFanSpeeds:z(P()),cleanWater:qg.nullable(),dirtyWater:qg.nullable(),detergent:qg.nullable(),dustBin:qg.nullable(),lastChangedAt:F()}),Yg={name:`vacuum-control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Vacuum],methods:{start:J(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),pause:J(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),stop:J(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),returnToBase:J(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),locate:J(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),setFanSpeed:J(B({deviceId:F().int().nonnegative(),speed:P().min(1)}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:Jg,kind:`push`},runtimeState:Jg},Xg=B({state:U([`open`,`opening`,`closing`,`closed`,`stopped`]),position:F().min(0).max(100).nullable(),lastChangedAt:F()}),Zg={name:`valve`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Valve],methods:{open:J(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),close:J(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),stop:J(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),setPosition:J(B({deviceId:F().int().nonnegative(),position:F().min(0).max(100)}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:Xg,kind:`push`},runtimeState:Xg},Qg=B({detected:I(),lastChangedAt:F()}),$g={name:`vibration`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Sensor],methods:{},status:{schema:Qg,kind:`push`},runtimeState:Qg},e_=B({currentTemp:F().nullable(),targetTemp:F().nullable(),operationMode:P().nullable(),availableModes:z(P()),away:I().nullable(),minTemp:F().nullable(),maxTemp:F().nullable(),lastChangedAt:F()}),t_={name:`water-heater`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.WaterHeater],methods:{setTargetTemp:J(B({deviceId:F().int().nonnegative(),temp:F().finite()}),R(),{kind:`mutation`,auth:`admin`}),setOperationMode:J(B({deviceId:F().int().nonnegative(),mode:P().min(1)}),R(),{kind:`mutation`,auth:`admin`}),setAway:J(B({deviceId:F().int().nonnegative(),on:I()}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:e_,kind:`push`},runtimeState:e_},n_=B({condition:P().nullable(),temperature:F().nullable(),temperatureUnit:P().nullable(),humidity:F().min(0).max(100).nullable(),pressure:F().nullable(),pressureUnit:P().nullable(),windSpeed:F().nullable(),windSpeedUnit:P().nullable(),windBearing:F().nullable(),lastFetchedAt:F()}),r_={name:`weather`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Weather],methods:{},status:{schema:n_,kind:`push`},runtimeState:n_},i_=B({totalObjects:F().int().nonnegative(),byClass:H(P(),F().int().nonnegative())}),a_=i_.extend({zoneId:P(),zoneName:P(),trackIds:z(P()).readonly()}),o_=B({ts:F().int(),frameWidth:F().int().nonnegative(),frameHeight:F().int().nonnegative(),zones:z(a_).readonly(),frame:i_,unzoned:i_}),s_=U([`minute`,`5min`,`hour`]),c_=B({from:F().int(),to:F().int(),resolution:s_}),l_=B({ts:F().int(),count:F().int().nonnegative()}),u_={name:`zone-analytics`,scope:`device`,mode:`singleton`,deviceTypes:[K.Camera],methods:{getCurrentSnapshot:J(B({deviceId:F()}),o_.nullable()),getZoneHistory:J(B({deviceId:F(),zoneId:P(),className:P().optional()}).extend(c_.shape),z(l_).readonly()),getCameraHistory:J(B({deviceId:F(),className:P().optional()}).extend(c_.shape),z(l_).readonly()),getUnzonedHistory:J(B({deviceId:F(),className:P().optional()}).extend(c_.shape),z(l_).readonly())},runtimeState:o_},d_=U([`include`,`exclude`]),f_=B({id:P(),name:P().optional(),zoneIds:z(P()).min(1).readonly(),mode:d_,classFilter:z(P()).readonly().optional(),overlapThreshold:F().min(0).max(1).optional(),bboxInclusionPct:F().min(0).max(100).optional(),preferMask:I().optional(),enabled:I().default(!0)});z(f_).readonly();var p_=U([`motion`,`detection`]),m_={name:`zone-rules`,scope:`device`,mode:`singleton`,deviceTypes:[K.Camera],methods:{listRules:J(B({deviceId:F(),stage:p_}),z(f_).readonly()),setRules:J(B({deviceId:F(),stage:p_,rules:z(f_).readonly()}),R(),{kind:`mutation`,auth:`admin`})},runtimeState:B({motion:z(f_).readonly(),detection:z(f_).readonly()})},h_=B({connected:I(),deviceCount:F(),error:P().optional()});B({externalId:P(),name:P(),type:P(),metadata:H(P(),L()).optional()});var g_=B({stableId:P(),type:U(K),suggestedName:P(),prefilledConfig:H(P(),L()),sourceInfo:Kp.optional()}),__=B({id:F(),stableId:P(),addonId:P(),type:P(),name:P(),parentDeviceId:F().nullable(),online:I(),features:z(P()),config:H(P(),L()),sourceInfo:Kp.optional()}),v_=B({status:U([`ok`,`error`]),labels:z(P()).optional(),error:P().optional()}),y_=L(),b_={name:`device-provider`,scope:`system`,mode:`collection`,methods:{start:J(R(),R(),{kind:`mutation`}),stop:J(R(),R(),{kind:`mutation`}),getStatus:J(R(),h_),getDevices:J(R(),z(B({id:P(),name:P(),type:P()}))),supportsDiscovery:J(B({}),I()),discoverDevices:J(B({}),z(g_),{kind:`mutation`,auth:`admin`}),adoptDiscoveredDevice:J(B({candidate:g_}),__,{kind:`mutation`,auth:`admin`}),supportsManualCreation:J(B({}),I()),getChildCreationSchema:J(B({type:U(K)}),y_),createDevice:J(B({type:U(K),config:H(P(),L())}),__,{kind:`mutation`,auth:`admin`}),testCreationField:J(B({type:U(K),key:P(),value:L(),formValues:H(P(),L()).optional()}),v_,{kind:`mutation`,auth:`admin`})}},x_=`device.state-changed`;function S_(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:x_},{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 C_(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=w_(e)?e:S_(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 w_(e){return typeof e.read==`function`&&typeof e.watch==`function`}function T_(e,t,n){let r=e,a=n?.stateSource??S_(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),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)}}}function E_(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)},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),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),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 D_=`device.state-changed`,O_=`capability.binding-changed`,k_=`device.registered`,A_=`device.unregistered`,j_=`device.updated`,M_=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=C_(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?T_(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&&!N_(n,e.id)||e.stableId!==void 0&&(!a||!N_(a.stableId,e.stableId))||e.addonId!==void 0&&(!a||!N_(a.addonId,e.addonId))||e.type!==void 0&&(!a||!N_(a.type,e.type)))continue;if(e.caps!==void 0){let t=P_(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=P_(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||!F_(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||!P_(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:D_},{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:O_},{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:k_},{onData:e=>{let t=e.data;typeof t?.deviceId==`number`&&this.refreshDeviceMetadata(t.deviceId,`added`)}})),this.bridges.push(e.subscribe({category:A_},{onData:e=>{let t=e.data;typeof t?.deviceId==`number`&&this.applyDeviceRemoval(t.deviceId)}})),this.bridges.push(e.subscribe({category:j_},{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 N_(e,t){return Array.isArray(t)?t.includes(e):e===t}function P_(e){return Array.isArray(e)?e:[e]}function F_(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 I_=B({id:P(),label:P(),icon:P(),order:F().optional()}),L_=B({id:P(),title:P(),description:P().optional(),style:U([`card`,`accordion`]).optional(),defaultCollapsed:I().optional(),columns:V([W(1),W(2),W(3),W(4)]).optional(),tab:P().optional(),location:U([`settings`,`top-tab`]).optional(),order:F().optional(),fields:z(Ku())}),R_=B({tabs:z(I_).optional(),sections:z(L_)}),z_=H(P(),L()),B_=B({success:W(!0)}),V_={name:`addon-settings`,scope:`system`,mode:`singleton`,nodeIdMode:`data`,methods:{getGlobalSettings:J(B({addonId:P(),nodeId:P().optional(),overlay:H(P(),L()).optional(),cap:P().optional()}),R_.nullable()),updateGlobalSettings:J(B({addonId:P(),nodeId:P().optional(),patch:z_}),B_,{kind:`mutation`,auth:`admin`}),getDeviceSettings:J(B({addonId:P(),deviceId:F(),nodeId:P().optional()}),R_.nullable()),updateDeviceSettings:J(B({addonId:P(),deviceId:F(),nodeId:P().optional(),patch:z_}),B_,{kind:`mutation`,auth:`admin`})}},H_=U([`info`,`success`,`warning`,`error`]),U_=U([`active`,`in-progress`,`completed`,`failed`,`dismissed`]),W_=B({type:P(),id:P()}),G_=B({id:P(),category:P(),severity:H_,title:P(),message:P(),status:U_,progress:F().optional(),read:I(),createdAt:F(),updatedAt:F(),source:W_.optional(),metadata:H(P(),L()).optional()}),K_={name:`alerts`,scope:`system`,mode:`singleton`,methods:{emit:J(G_,R(),{kind:`mutation`}),update:J(B({alertId:P(),patch:G_.partial()}),R(),{kind:`mutation`}),list:J(B({unreadOnly:I().optional(),limit:F().optional()}).optional(),z(G_).readonly()),getUnreadCount:J(R(),F()),markRead:J(B({alertId:P()}),R(),{kind:`mutation`}),markAllRead:J(R(),R(),{kind:`mutation`}),dismiss:J(B({alertId:P()}),R(),{kind:`mutation`})}},q_=rd(`shouldSaveDiskSpace`,[B({providerId:P().min(1),displayName:P().min(1),configSchema:L(),nodeLocal:I(),shouldSaveDiskSpace:W(!0),minFreePercent:F().min(0).max(100)}),B({providerId:P().min(1),displayName:P().min(1),configSchema:L(),nodeLocal:I(),shouldSaveDiskSpace:W(!1),minFreePercent:W(null)})]),J_={name:`storage`,scope:`system`,mode:`singleton`,methods:{resolve:J(B({location:Cf,relativePath:P()}),P()),write:J(B({location:Cf,relativePath:P(),data:Rd(Uint8Array)}),R(),{kind:`mutation`}),read:J(B({location:Cf,relativePath:P()}),Rd(Uint8Array)),exists:J(B({location:Cf,relativePath:P()}),I()),list:J(B({location:Cf,prefix:P().optional()}),z(P()).readonly()),delete:J(B({location:Cf,relativePath:P()}),R(),{kind:`mutation`}),getAvailableSpace:J(B({location:Cf}),F().nullable()),beginUpload:J(B({location:Cf,relativePath:P(),sizeBytes:F().optional()}),B({uploadId:P()}),{kind:`mutation`}),writeChunk:J(B({uploadId:P(),offset:F(),data:Rd(Uint8Array)}),R(),{kind:`mutation`}),finalizeUpload:J(B({uploadId:P()}),R(),{kind:`mutation`}),abortUpload:J(B({uploadId:P()}),R(),{kind:`mutation`}),beginDownload:J(B({location:Cf,relativePath:P()}),B({downloadId:P(),sizeBytes:F()}),{kind:`mutation`}),readChunk:J(B({downloadId:P(),offset:F(),length:F()}),Rd(Uint8Array)),endDownload:J(B({downloadId:P()}),R(),{kind:`mutation`}),listLocations:J(B({type:xf.optional()}),z(Sf).readonly()),getDefaultLocation:J(B({type:xf}),Sf.nullable()),listLocationDeclarations:J(R(),z(wf).readonly()),upsertLocation:J(Sf.omit({createdAt:!0,updatedAt:!0}),Sf,{kind:`mutation`,auth:`admin`}),deleteLocation:J(B({id:P()}),R(),{kind:`mutation`,auth:`admin`}),testLocation:J(B({id:P()}),B({ok:I(),error:P().optional()}),{auth:`admin`}),listProviders:J(R(),z(q_).readonly()),testConfig:J(B({providerId:P(),config:H(P(),L())}),B({ok:I(),error:P().optional()}),{auth:`admin`})}},Y_=rd(`shouldSaveDiskSpace`,[B({providerId:P().min(1),displayName:P().min(1),configSchema:L(),nodeLocal:I(),shouldSaveDiskSpace:W(!0),minFreePercent:F().min(0).max(100)}),B({providerId:P().min(1),displayName:P().min(1),configSchema:L(),nodeLocal:I(),shouldSaveDiskSpace:W(!1),minFreePercent:W(null)})]),X_=B({ok:I(),error:P().optional()}),Z_=B({location:Sf,relativePath:P(),sizeBytes:F().optional()}),Q_=B({uploadId:P()}),$_=B({uploadId:P(),offset:F(),data:Rd(Uint8Array)}),ev=B({uploadId:P()}),tv=B({uploadId:P()}),nv=B({location:Sf,relativePath:P()}),rv=B({downloadId:P(),sizeBytes:F()}),iv=B({downloadId:P(),offset:F(),length:F()}),av=B({downloadId:P()}),ov={name:`storage-provider`,scope:`system`,mode:`collection`,internal:!0,methods:{getProviderInfo:J(R(),Y_),testLocation:J(B({config:H(P(),L())}),X_,{auth:`admin`}),resolve:J(B({location:Sf,relativePath:P()}),P()),write:J(B({location:Sf,relativePath:P(),data:Rd(Uint8Array)}),R(),{kind:`mutation`}),read:J(B({location:Sf,relativePath:P()}),Rd(Uint8Array)),exists:J(B({location:Sf,relativePath:P()}),I()),list:J(B({location:Sf,prefix:P().optional()}),z(P()).readonly()),delete:J(B({location:Sf,relativePath:P()}),R(),{kind:`mutation`}),getAvailableSpace:J(B({location:Sf}),F().nullable()),beginUpload:J(Z_,Q_,{kind:`mutation`}),writeChunk:J($_,R(),{kind:`mutation`}),finalizeUpload:J(ev,R(),{kind:`mutation`}),abortUpload:J(tv,R(),{kind:`mutation`}),beginDownload:J(nv,rv,{kind:`mutation`}),readChunk:J(iv,Rd(Uint8Array)),endDownload:J(av,R(),{kind:`mutation`})}},sv=B({bytes:F().int().nonnegative()}),cv=B({reclaimedBytes:F().int().nonnegative(),exhausted:I()}),lv={name:`storage-evictable`,scope:`system`,mode:`collection`,internal:!0,methods:{getEvictableUsage:J(B({locationId:P()}),sv),evict:J(B({locationId:P(),targetBytes:F().int().positive()}),cv,{kind:`mutation`})}},uv=B({name:P(),path:P()}),dv=B({path:P(),entries:z(uv).readonly(),freeBytes:F(),totalBytes:F()}),fv={name:`filesystem-browse`,scope:`system`,mode:`singleton`,internal:!0,methods:{listAllowedRoots:J(R(),z(P()).readonly(),{auth:`admin`}),browse:J(B({path:P()}),dv,{auth:`admin`}),createDir:J(B({path:P()}),B({path:P()}),{kind:`mutation`,auth:`admin`})}},pv=B({subId:P(),displayName:P(),description:P().optional(),kind:P(),triggerSupported:I(),restoreSupported:I()}).extend({id:P(),addonId:P(),enabled:I(),retentionCount:F(),label:P().optional(),lastSuccessAt:F().optional(),lastSuccessSizeBytes:F().optional(),cron:P().optional(),nextRunAt:F().optional(),lastRunAt:F().optional()}),mv=B({id:P(),filename:P(),createdAt:F(),sizeBytes:F(),label:P().optional(),locations:z(P()).readonly()}),hv=B({id:P(),destinationId:P().optional(),label:P().optional(),createdAt:F(),sizeBytes:F(),locations:z(P()).optional()}),gv=B({path:P(),kind:U([`file`,`dir`,`symlink`]),sizeBytes:F(),mtime:F()}),_v=B({archiveVersion:W(1),createdAt:F(),dataDir:P(),locations:z(P()),entries:z(gv),totalBytes:F(),totalFiles:F()}),vv=B({name:P(),sizeBytes:F(),fileCount:F(),present:I()}),yv={name:`backup`,scope:`system`,mode:`singleton`,methods:{listDestinations:J(R(),z(pv).readonly(),{auth:`admin`}),trigger:J(B({destinations:z(P()).optional(),locations:z(P()).optional(),label:P().optional()}).optional(),z(hv).readonly(),{kind:`mutation`,auth:`admin`}),list:J(R(),z(hv).readonly(),{auth:`admin`}),listLocations:J(R(),z(vv).readonly(),{auth:`admin`}),getEntries:J(B({destinationId:P(),backupId:P()}),_v.nullable(),{auth:`admin`}),restore:J(B({destinationId:P(),backupId:P(),locations:z(P()).optional()}),R(),{kind:`mutation`,auth:`admin`}),delete:J(B({destinationId:P(),backupId:P()}),R(),{kind:`mutation`,auth:`admin`}),listArchives:J(B({destinationId:P()}),z(mv).readonly(),{auth:`admin`}),upsertDestinationPolicy:J(B({locationId:P(),enabled:I(),retentionCount:F().int().min(1).max(1e3),label:P().optional(),cron:P().optional()}),R(),{kind:`mutation`,auth:`admin`}),previewSchedule:J(B({cron:P(),count:F().int().min(1).max(20).optional()}),B({ok:I(),error:P().optional(),nextRuns:z(F()).readonly()}))}},bv=B({where:H(P(),L()).optional(),whereIn:H(P(),z(L())).optional(),whereBetween:H(P(),sd([L(),L()])).optional(),orderBy:B({field:P(),direction:U([`asc`,`desc`])}).optional(),limit:F().optional(),offset:F().optional()}),xv=B({id:P(),data:H(P(),L())}),Sv=B({name:P(),type:U([`TEXT`,`INTEGER`,`REAL`,`JSON`,`BOOLEAN`]),primaryKey:I().optional(),notNull:I().optional(),unique:I().optional()}),Cv=B({name:P(),columns:z(P()).readonly(),unique:I().optional()}),wv={name:`settings-store`,scope:`system`,mode:`singleton`,methods:{get:J(B({namespace:P().optional(),collection:P(),key:P()}),L()),set:J(B({namespace:P().optional(),collection:P(),key:P(),value:L()}),R(),{kind:`mutation`}),query:J(B({namespace:P().optional(),collection:P(),filter:bv.optional()}),z(xv).readonly()),insert:J(B({namespace:P().optional(),collection:P(),record:xv}),R(),{kind:`mutation`}),update:J(B({namespace:P().optional(),collection:P(),id:P(),data:H(P(),L())}),R(),{kind:`mutation`}),delete:J(B({namespace:P().optional(),collection:P(),key:P()}),R(),{kind:`mutation`}),count:J(B({namespace:P().optional(),collection:P(),filter:bv.optional()}),F()),histogram:J(B({namespace:P().optional(),collection:P(),field:P(),bucketSize:F().int().positive(),origin:F().int(),filter:bv.optional()}),z(B({bucket:F().int(),count:F().int()})).readonly()),isEmpty:J(B({namespace:P().optional(),collection:P()}),I()),declareCollection:J(B({namespace:P().optional(),collection:P(),columns:z(Sv).readonly(),indexes:z(Cv).readonly().optional()}),R(),{kind:`mutation`})}},Tv=U([`debug`,`info`,`warn`,`error`]),Ev=B({timestamp:Qu(),level:Tv,scope:z(P()),message:P(),meta:H(P(),L()).optional(),tags:H(P(),P()).optional()}),Dv={name:`log-destination`,scope:`system`,mode:`collection`,internal:!0,methods:{write:J(Ev,R(),{kind:`mutation`}),query:J(B({scope:z(P()).optional(),level:Tv.optional(),since:Qu().optional(),until:Qu().optional(),limit:F().optional(),tags:H(P(),P()).optional()}),z(Ev).readonly())}},Ov=B({staticDir:P()}),kv=B({version:P()}),Av={name:`admin-ui`,scope:`system`,mode:`singleton`,internal:!0,methods:{getStaticDir:J(R(),Ov),getVersion:J(R(),kv)}},jv=U([`view`,`create`,`delete`]),Mv=V([W(`*`),z(P())]),Nv=H(P(),V([W(`*`),z(P())])),Pv=U([`device`,`system`]),Fv=rd(`type`,[B({type:W(`category`),target:Pv,access:z(jv).min(1)}),B({type:W(`capability`),target:P(),access:z(jv).min(1)}),B({type:W(`addon`),target:P(),access:z(jv).min(1)}),B({type:W(`device`),targets:z(P()).min(1),access:z(jv).min(1)})]);B({id:P(),username:P(),passwordHash:P(),isAdmin:I().default(!1),allowedProviders:Mv,allowedDevices:Nv,scopes:z(Fv).default([]),createdAt:F(),updatedAt:F()}),B({id:P(),label:P(),isAdmin:I().default(!1),allowedProviders:Mv,allowedDevices:Nv,tokenHash:P(),tokenPrefix:P(),createdAt:F(),lastUsedAt:F().optional()}),B({id:P(),userId:P(),name:P(),tokenHash:P(),tokenPrefix:P(),scopes:z(Fv),expiresAt:F().nullish(),lastUsedAt:F().nullish(),createdAt:F()});var Iv=B({userId:P(),username:P(),isAdmin:I(),provider:P(),email:P().optional(),displayName:P().optional(),hubUrl:P().optional(),scopes:z(Fv).optional(),redirectUri:P().optional(),integrationId:P().optional(),jti:P().optional(),sessionId:P().optional()}),Lv={name:`sso-bridge`,scope:`system`,mode:`singleton`,internal:!0,methods:{signBridgeToken:J(B({claims:Iv,ttlSec:F().int().positive().optional()}),B({token:P()})),verifyBridgeToken:J(B({token:P()}),Iv.nullable())}},Rv=B({integrationId:P(),displayName:P(),requestedScopes:z(Fv),allowedRedirectPrefixes:z(P()).min(1),hubUrl:P().optional()}),zv={name:`oauth-integration`,scope:`system`,mode:`collection`,internal:!0,methods:{getDescriptor:J(R(),Rv)}},Bv=B({credentialId:P(),label:P(),createdAt:F(),lastUsedAt:F().nullable(),transports:z(P()).default([])}),Vv={name:`user-passkeys`,scope:`system`,mode:`collection`,internal:!0,methods:{beginRegistration:J(B({userId:P(),username:P()}),B({optionsJSON:H(P(),L())}),{kind:`mutation`,auth:`admin`,access:`create`}),finishRegistration:J(B({userId:P(),response:H(P(),L()),label:P()}),B({success:W(!0),credentialId:P()}),{kind:`mutation`,auth:`admin`,access:`create`}),beginAuthentication:J(B({userId:P().optional()}),B({optionsJSON:H(P(),L())}),{kind:`mutation`,access:`view`}),finishAuthentication:J(B({userId:P(),response:H(P(),L())}),B({verified:I()}),{kind:`mutation`,access:`view`}),listPasskeys:J(B({userId:P()}),z(Bv),{auth:`admin`}),removePasskey:J(B({userId:P(),credentialId:P()}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`,access:`delete`})}},Hv=yu(),Uv=B({to:V([Hv,z(Hv).min(1)]),cc:z(Hv).optional(),bcc:z(Hv).optional(),from:P().optional(),replyTo:P().optional(),subject:P(),text:P(),html:P().optional()}),Wv=B({messageId:P(),accepted:z(Hv).default([]),rejected:z(Hv).default([])}),Gv=B({ready:I(),host:P(),error:P().optional(),lastVerifiedAt:F().optional()}),Kv={name:`smtp-provider`,scope:`system`,mode:`collection`,internal:!0,providerKind:`email`,methods:{sendEmail:J(Uv,Wv,{kind:`mutation`,auth:`admin`,access:`create`}),verify:J(R(),Gv,{kind:`mutation`,auth:`admin`,access:`view`}),getStatus:J(R(),Gv,{auth:`admin`})}},qv=B({id:P(),label:P(),isDefault:I().optional()}),Jv=B({search:P().optional(),area:P().optional(),manufacturer:P().optional(),adoptedOnly:I().optional(),unadoptedOnly:I().optional()}),Yv=B({integrationId:P(),page:F().int().positive().default(1),pageSize:F().int().positive().max(2e4).default(50),filter:P().optional(),filterText:Jv.optional()}),Xv=B({candidates:z(Jp).readonly(),totalCount:F().int().nonnegative(),page:F().int().positive(),pageSize:F().int().positive()}),Zv=B({integrationId:P(),childNativeId:P()}),Qv=B({lastDiscoveryAt:F().int().nonnegative().nullable(),candidateCount:F().int().nonnegative(),adoptedCount:F().int().nonnegative(),lastError:P().nullable()}),$v=B({name:P().min(1).optional(),hiddenChildIds:z(P()).optional()}),ey=B({integrationId:P(),childNativeIds:z(P()).min(1),filter:P().optional(),importLocations:I().optional(),perCandidate:H(P(),$v).optional()}),ty=B({adopted:z(B({childNativeId:P(),parentDeviceId:F().int().nonnegative(),accessoryDeviceIds:z(F().int().nonnegative()).readonly()})).readonly()}),ny=B({integrationId:P(),camDeviceId:F().int().nonnegative()}),ry=B({camDeviceId:F().int().nonnegative()}),iy=B({changed:I(),rebuiltChildren:F().int().nonnegative()}),ay={name:`device-adoption`,scope:`system`,mode:`singleton`,status:{schema:Qv,kind:`poll`},methods:{listCandidateFilters:J(B({integrationId:P()}),B({filters:z(qv)}),{auth:`admin`}),listCandidates:J(Yv,Xv,{auth:`admin`}),getCandidate:J(Zv,Jp.nullable(),{auth:`admin`}),refresh:J(B({integrationId:P()}),Qv,{kind:`mutation`,auth:`admin`}),adopt:J(ey,ty,{kind:`mutation`,auth:`admin`}),release:J(ny,R(),{kind:`mutation`,auth:`admin`}),resync:J(ry,iy,{kind:`mutation`,auth:`admin`})}},oy=U([`connected`,`disconnected`,`connecting`,`auth-failed`,`unreachable`,`error`]),sy=B({id:P(),addonId:P(),name:P(),kind:P(),status:oy,info:H(P(),L()),lastCheckedAt:F().nullable(),error:P().nullable()}),cy=B({brokerCount:F().int().nonnegative(),connectedCount:F().int().nonnegative()}),ly=B({addonId:P(),kinds:z(B({kind:P(),label:P()}))}),uy=B({kind:P().optional()}),dy=B({id:P()}),fy=B({kind:P().min(1),name:P().min(1),settings:H(P(),L())}),py=B({id:P()}),my=B({id:P()}),hy=rd(`ok`,[B({ok:W(!0),latencyMs:F().nonnegative()}),B({ok:W(!1),error:P()})]),gy=H(P(),L()),_y=B({kind:P()}),vy=B({kind:P(),settings:gy}),yy=rd(`ok`,[B({ok:W(!0),latencyMs:F().nonnegative().optional()}).strict(),B({ok:W(!1),error:P()})]),by=L().nullable(),xy=B({brokerId:P(),target:H(P(),L()),payload:L().optional()}),Sy=B({brokerId:P(),filter:H(P(),L())}),Cy=B({subscriptionId:P()}),wy=B({brokerId:P(),subscriptionId:P()}),Ty=B({brokerId:P(),key:P()}),Ey={name:`broker`,scope:`system`,mode:`collection`,providerKind:`broker`,status:{schema:cy,kind:`poll`},methods:{list:J(uy,z(sy)),get:J(dy,sy.nullable()),listProviders:J(R(),z(ly),{auth:`admin`}),add:J(fy,py,{kind:`mutation`,auth:`admin`}),remove:J(my,R(),{kind:`mutation`,auth:`admin`}),testConnection:J(dy,hy,{kind:`mutation`,auth:`admin`}),getSettings:J(dy,gy.nullable(),{auth:`admin`}),setSettings:J(B({id:P(),settings:gy}),R(),{kind:`mutation`,auth:`admin`}),getBrokerConfig:J(dy,gy.nullable(),{auth:`admin`}),getSettingsSchema:J(_y,by,{auth:`admin`}),testSettings:J(vy,yy,{kind:`mutation`,auth:`admin`}),publish:J(xy,L(),{kind:`mutation`,auth:`admin`}),subscribe:J(Sy,Cy,{kind:`mutation`,auth:`admin`}),unsubscribe:J(wy,R(),{kind:`mutation`,auth:`admin`}),getState:J(Ty,L().nullable()),getStatus:J(R(),cy)}},Dy=U([`external`,`embedded`]),Oy=U([`connected`,`disconnected`,`auth-failed`,`unreachable`,`tls-error`]),ky=B({id:P(),name:P(),url:P(),kind:Dy,status:Oy,latencyMs:F().nullable(),error:P().optional(),connectedClients:F().int().nonnegative().optional(),lastCheckedAt:F().optional()}),Ay=B({url:P(),username:P().optional(),password:P().optional(),clientIdPrefix:P().optional()}),jy=B({name:P().min(1),url:P().regex(/^(mqtt|mqtts|ws|wss):\/\//,`URL must start with mqtt(s):// or ws(s)://`),username:P().optional(),password:P().optional(),clientIdPrefix:P().optional()}),My=B({id:P()}),Ny=B({id:P()}),Py=rd(`ok`,[B({ok:W(!0),latencyMs:F()}),B({ok:W(!1),error:P()})]),Fy=B({port:F().int().min(1).max(65535).default(1883),allowAnonymous:I().default(!1),username:P().optional(),password:P().optional()}),Iy=B({id:P(),url:P()}),Ly=B({brokerCount:F(),embeddedRunning:I()}),Ry={name:`mqtt-broker`,scope:`system`,mode:`collection`,providerKind:`broker`,status:{schema:Ly,kind:`poll`},methods:{listBrokers:J(R(),z(ky)),getBrokerConfig:J(Ny,Ay),addBroker:J(jy,My,{kind:`mutation`}),removeBroker:J(Ny,R(),{kind:`mutation`}),testConnection:J(Ny,Py,{kind:`mutation`}),startEmbeddedBroker:J(Fy,Iy,{kind:`mutation`}),stopEmbeddedBroker:J(Ny,R(),{kind:`mutation`}),getStatus:J(R(),Ly)}},zy=U([`unlinked`,`linked`,`error`]),By=B({label:P(),value:P(),secret:I().optional()}),Vy=B({qr:P().optional(),fields:z(By).readonly().optional(),note:P().optional()}),Hy=B({linkState:zy,exposedDeviceCount:F(),error:P().optional(),setup:Vy.optional()}),Uy=P(),Wy=B({deviceId:P(),exposedAs:P().optional(),capabilities:z(P()).optional()}),Gy=B({deviceId:P(),capabilities:z(P()).optional()}),Ky=B({deviceId:P()}),qy={name:`device-export`,scope:`system`,mode:`collection`,providerKind:`device-export`,status:{schema:Hy,kind:`poll`},exposesDeviceSettings:!0,methods:{getStatus:J(R(),Hy),listSupportedDeviceKinds:J(R(),z(Uy)),listExposedDevices:J(R(),z(Wy)),exposeDevice:J(Gy,R(),{kind:`mutation`}),unexposeDevice:J(Ky,R(),{kind:`mutation`})}},Jy=B({id:P(),label:P(),icon:P(),path:P(),remoteName:P(),bundle:P()}),Yy=B({addonId:P(),page:Jy,bundleUrl:P()}),Xy={name:`addon-pages`,scope:`system`,mode:`singleton`,methods:{listPages:J(R(),z(Yy).readonly())}},Zy=B({id:P(),label:P(),icon:P(),path:P(),remoteName:P(),bundle:P()}),Qy={name:`addon-pages-source`,scope:`system`,mode:`collection`,internal:!0,methods:{listPages:J(R(),z(Zy).readonly())}},$y=U([`device-tab`,`dashboard`,`integration-detail`]),eb=U([`xs`,`sm`,`md`,`lg`,`xl`]),tb=B({remoteName:P(),exposedModule:P(),componentKey:P().optional()}),nb=B({tab:P(),subTab:P().optional(),label:P(),order:F().optional(),kind:W(`remote`),remote:tb,stableId:P(),description:P().optional(),icon:P().optional(),bundle:P(),hosts:z($y).readonly(),requires:B({deviceContext:I().default(!1),integrationContext:I().default(!1)}),defaultSize:eb.default(`md`),allowedSizes:z(eb).readonly().default([`sm`,`md`,`lg`]),defaultColumns:F().int().min(1).max(12).default(6),defaultRows:F().int().min(1).max(12).default(1)}),rb={name:`addon-widgets-source`,scope:`system`,mode:`collection`,internal:!0,methods:{listWidgets:J(R(),z(nb).readonly())}},ib=nb.extend({addonId:P(),bundleUrl:P()}),ab={name:`addon-widgets`,scope:`system`,mode:`singleton`,methods:{listWidgets:J(R(),z(ib).readonly())}},ob=B({method:U([`GET`,`POST`,`PUT`,`DELETE`,`PATCH`]),path:P(),access:U([`public`,`authenticated`,`admin`]).optional(),description:P().optional()}),sb=B({method:P(),path:P(),params:H(P(),P()),query:H(P(),P()),body:L(),headers:H(P(),P()),user:B({id:P(),username:P(),isAdmin:I()}).optional(),scopedToken:L().optional()}),cb=B({status:F().int(),headers:H(P(),P()),redirectUrl:P().nullable(),body:L().optional(),contentType:P().optional()}),lb={name:`addon-routes`,scope:`system`,mode:`collection`,internal:!0,methods:{getRoutes:J(R(),z(ob)),invoke:J(sb,cb,{kind:`mutation`})}},ub=B({sessionId:P(),slotCount:F().int(),slotByteLength:F().int(),segmentBytes:F().int(),budgetMb:F().int(),framesWritten:F().int(),getFrameHits:F().int(),getFrameMisses:F().int()}),db={name:`decoder`,scope:`system`,mode:`singleton`,methods:{supportsCodec:J(B({codec:P()}),I()),getInfo:J(R(),B({id:P(),name:P(),isPullMode:I().optional(),priority:F().optional()})),createSession:J(Ef,B({sessionId:P(),nodeId:P()})),destroySession:J(B({sessionId:P()}),R()),pushPacket:J(B({sessionId:P(),packet:Zd}),R()),openStream:J(B({sessionId:P(),url:P()}),R()),pullFrames:J(B({sessionId:P(),maxCount:F().default(1)}),z(Qd)),pullHandles:J(B({sessionId:P(),maxCount:F().default(1)}),z($d)),getFrame:J(B({handle:$d}),Qd.nullable()),getShmStats:J(B({sessionId:P()}),ub.nullable()),updateConfig:J(B({sessionId:P(),config:Ef.partial()}),R()),getStats:J(B({sessionId:P()}),Tf),listActiveSessions:J(R(),z(B({sessionId:P(),codec:P(),outputFormat:P(),createdAtMs:F()})).readonly()),reprobeHwaccel:J(R(),B({backend:P()}),{kind:`mutation`,auth:`admin`})}},fb=B({streamId:P(),label:P().optional(),codec:P(),type:U([`video`,`audio`]),sourceUrl:P()}),pb=B({streamId:P(),format:P(),value:P()}),mb={name:`restreamer`,scope:`system`,mode:`collection`,internal:!0,methods:{registerDevice:J(B({deviceId:F(),streams:z(fb).readonly()}),R(),{kind:`mutation`}),unregisterDevice:J(B({deviceId:F()}),R(),{kind:`mutation`}),getExposedResources:J(B({deviceId:F()}),z(pb).readonly())}},hb=B({viewportWidth:F().int().positive().optional(),viewportHeight:F().int().positive().optional(),devicePixelRatio:F().positive().optional(),downlinkMbps:F().nonnegative().optional(),prefersTier:P().optional()}).partial(),gb={name:`webrtc`,scope:`system`,mode:`collection`,internal:!0,methods:{handleOffer:J(B({streamId:P(),sdpOffer:P()}),P(),{kind:`mutation`}),supportsStream:J(B({streamId:P()}),I()),registerStream:J(B({streamId:P(),codec:P()}),R(),{kind:`mutation`}),unregisterStream:J(B({streamId:P()}),R(),{kind:`mutation`}),createSession:J(B({streamId:P(),hints:hb.optional()}),B({sessionId:P(),sdpOffer:P()}),{kind:`mutation`}),handleAnswer:J(B({sessionId:P(),sdpAnswer:P()}),R(),{kind:`mutation`}),closeSession:J(B({sessionId:P()}),R(),{kind:`mutation`}),hasAdaptiveBitrate:J(B({streamId:P()}),I())}},_b=rd(`kind`,[B({kind:W(`adaptive`)}),B({kind:W(`profile`),profile:Wd}),B({kind:W(`cam-stream`),camStreamId:P().min(1)})]),vb=B({id:P(),label:P(),target:_b,codec:P().nullable(),resolution:B({width:F(),height:F()}).nullable(),status:U([`idle`,`connecting`,`streaming`,`error`,`stopped`]).nullable(),inputFps:F().nullable(),decodeFps:F().nullable(),bitrateKbps:F().nullable()}),yb={name:`webrtc-session`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,preferredProvider:`stream-broker`,deviceTypes:[K.Camera],methods:{listStreams:J(B({deviceId:F().int().nonnegative()}),z(vb)),createSession:J(B({deviceId:F().int().nonnegative(),target:_b,hints:hb.optional(),relayOnly:I().optional(),consumerAttribution:fp.optional()}),B({sessionId:P(),sdpOffer:P()}),{kind:`mutation`}),handleOffer:J(B({deviceId:F().int().nonnegative(),target:_b.optional(),sdpOffer:P(),sessionId:P().optional(),relayOnly:I().optional(),nonTrickle:I().optional(),disableTurn:I().optional(),disableIpv6:I().optional(),consumerAttribution:fp.optional()}),B({sessionId:P(),sdpAnswer:P()}),{kind:`mutation`}),handleAnswer:J(B({deviceId:F().int().nonnegative(),sessionId:P(),sdpAnswer:P()}),R(),{kind:`mutation`}),addIceCandidate:J(B({deviceId:F().int().nonnegative(),sessionId:P(),candidate:P(),sdpMid:P().nullable().optional(),sdpMLineIndex:F().int().nullable().optional()}),R(),{kind:`mutation`}),getIceCandidates:J(B({deviceId:F().int().nonnegative(),sessionId:P()}),B({candidates:z(B({candidate:P(),sdpMid:P().nullable(),sdpMLineIndex:F().int().nullable()})),done:I()}),{kind:`query`}),closeSession:J(B({deviceId:F().int().nonnegative(),sessionId:P()}),R(),{kind:`mutation`}),hasAdaptiveBitrate:J(B({deviceId:F().int().nonnegative(),profile:Wd}),I()),getSessionState:J(B({deviceId:F().int().nonnegative(),sessionId:P()}),B({pendingRenegotiation:B({target:_b,epoch:F()}).nullable()}))}},bb=B({id:P(),source:P(),kind:U([`motion`,`object`,`audio`,`native`]),timeRange:B({startMs:F(),endMs:F()}),thumbnail:P().optional()}),xb=B({playbackUrl:P(),playbackEndpoints:z(P()).optional(),token:P().optional()}),Sb={name:`videoclips`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,methods:{listClips:J(B({deviceId:F(),since:F(),until:F(),limit:F().int().positive().optional()}),z(bb).readonly(),{kind:`query`,auth:`admin`}),getClipPlayback:J(B({deviceId:F(),clipId:P()}),xb,{kind:`query`,auth:`admin`})}},Cb=B({engine:Hm,steps:z($m).readonly(),audio:B({engine:Hm,modelId:P(),enabled:I(),settings:H(P(),L()).readonly().optional()}).nullable().optional()}),wb=B({id:P(),name:P(),description:P().optional(),config:Cb,createdAt:P(),updatedAt:P()}),Tb=B({enabled:I(),modelId:P(),settings:H(P(),L()).readonly()}),Eb=B({addonDefaults:H(P(),Tb).readonly()}),Db=B({steps:z($m).readonly(),audio:B({modelId:P(),enabled:I()}).nullable()}),Ob=B({enabled:I().optional(),modelId:P().optional(),settings:H(P(),L()).readonly().optional()}),kb=B({pinnedAgentNodeId:P().optional(),stepToggles:H(P(),I()).optional(),stepOverridesByAgent:H(P(),H(P(),Ob)).optional(),pipelineByAgent:H(P(),Db).optional()}),Ab=B({deviceId:F(),agentNodeId:P(),pinned:I(),reason:U([`manual`,`capacity`,`hardware-affinity`,`failover`,`rebalance`]),assignedAt:F()}),jb=B({deviceId:F(),decoderNodeId:P(),pinned:I(),reason:U([`manual`,`co-located`,`capacity`,`hardware-affinity`])}),Mb=B({nodeId:P(),online:I(),load:Oh,score:F()}),Nb=B({totalAgents:F(),onlineAgents:F(),totalCameras:F(),attachedCameras:F(),activeCameras:F(),avgInferenceTimeMs:F(),queueDepth:F()}),Pb=H(P(),P()),Fb={name:`pipeline-orchestrator`,scope:`system`,mode:`singleton`,exposesDeviceSettings:!0,methods:{assignPipeline:J(B({deviceId:F(),agentNodeId:P()}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`}),unassignPipeline:J(B({deviceId:F()}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`}),rebalance:J(R(),B({migrated:F()}),{kind:`mutation`,auth:`admin`}),getPipelineAssignments:J(R(),z(Ab).readonly()),getPipelineAssignment:J(B({deviceId:F()}),Ab.nullable()),getAgentLoad:J(R(),z(Mb).readonly()),getGlobalMetrics:J(R(),Nb),getCameraMetrics:J(B({deviceId:F()}),Rm.nullable()),getCapabilityBindings:J(B({nodeId:P()}),Pb),setCapabilityBinding:J(B({nodeId:P(),capName:P(),addonId:P()}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`}),assignDecoder:J(B({deviceId:F(),nodeId:P()}),R(),{kind:`mutation`,auth:`admin`}),unassignDecoder:J(B({deviceId:F()}),R(),{kind:`mutation`,auth:`admin`}),getDecoderAssignments:J(R(),z(jb).readonly()),assignAudio:J(B({deviceId:F(),nodeId:P()}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`}),unassignAudio:J(B({deviceId:F()}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`}),getAudioAssignment:J(B({deviceId:F()}),B({nodeId:P(),pinned:I(),assignedAt:F()}).nullable()),getAudioNodeLoad:J(R(),z(B({nodeId:P(),deviceCount:F()}))),getAudioAssignments:J(R(),z(B({deviceId:F(),nodeId:P(),pinned:I(),assignedAt:F()}))),getDecoderAssignment:J(B({deviceId:F(),pipelineNodeId:P().optional()}),jb),getAgentSettings:J(B({agentNodeId:P()}),Eb.nullable()),listAgentSettings:J(R(),z(B({nodeId:P(),settings:Eb})).readonly()),setAgentAddonDefaults:J(B({agentNodeId:P(),defaults:H(P(),Tb)}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`}),removeAgentSettings:J(B({agentNodeId:P()}),B({success:I(),removed:I()}),{kind:`mutation`,auth:`admin`}),getCameraSettings:J(B({deviceId:F()}),kb.nullable()),setCameraStepToggle:J(B({deviceId:F(),addonId:P(),enabled:I().nullable()}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`}),getCameraStepOverrides:J(B({deviceId:F()}),H(P(),H(P(),Ob)).nullable()),setCameraStepOverride:J(B({deviceId:F(),agentNodeId:P(),addonId:P(),patch:Ob.nullable()}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`}),setCameraPipelineForAgent:J(B({deviceId:F(),agentNodeId:P(),pipeline:Db.nullable()}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`}),resolvePipeline:J(B({deviceId:F(),agentNodeId:P().optional()}),Cb),listTemplates:J(R(),z(wb).readonly()),saveTemplate:J(B({name:P(),description:P().optional(),config:Cb}),wb,{kind:`mutation`,auth:`admin`}),updateTemplate:J(B({id:P(),name:P().optional(),description:P().optional(),config:Cb.optional()}),wb,{kind:`mutation`,auth:`admin`}),deleteTemplate:J(B({id:P()}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`})}},Ib=B({level:Nm,classification:B({labels:z(Pm).readonly(),inferenceMs:F()}).optional(),timestamp:F()}),Lb=B({minConfidence:F().min(0).max(1).default(.3),allowedClasses:z(P()).default([])}),Rb=B({labels:z(Pm).readonly(),rawLabels:z(Pm).readonly().optional(),inferenceMs:F()}),zb={name:`audio-analyzer`,scope:`system`,mode:`singleton`,methods:{analyseChunk:J(B({chunk:Mm,settings:Lb}),Ib.nullable(),{kind:`mutation`}),classify:J(Mm,Rb,{timeoutMs:3e4}),isReady:J(R(),I()),dispose:J(R(),R(),{kind:`mutation`}),reprobeAudioEngine:J(R(),B({backend:P()}),{kind:`mutation`,auth:`admin`})}},Bb={name:`audio-analysis`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[K.Camera],exposesDeviceSettings:!0,methods:{resolveDeviceSettings:J(B({deviceId:F()}),Fd())},events:{onAudioLevel:Bf(B({deviceId:F(),rms:F(),dbfs:F()}))}},Vb=U([`f32le`,`s16le`]),Hb=B({codec:P(),canDecode:I(),canEncode:I(),label:P().optional()}),Ub=B({codec:P(),sourceSampleRate:F().int().positive(),sourceChannels:F().int().positive(),extraData:Rd(Uint8Array).optional(),targetSampleRate:F().int().positive(),targetChannels:F().int().positive(),targetFormat:Vb.optional(),idleMs:F().int().positive().optional(),tag:P().optional()}),Wb=B({codec:P(),sourceSampleRate:F().int().positive(),sourceChannels:F().int().positive(),sourceFormat:Vb.optional(),targetSampleRate:F().int().positive(),targetChannels:F().int().positive(),bitrateKbps:F().int().positive().optional(),idleMs:F().int().positive().optional(),tag:P().optional()}),Gb=B({data:Rd(Uint8Array),sampleRate:F().int().positive(),channels:F().int().positive(),format:Vb,pts:F()}),Kb=B({data:Rd(Uint8Array),codec:P(),pts:F(),frameComplete:I()}),qb=B({sessionId:P(),kind:U([`decode`,`encode`]),codec:P(),sourceSampleRate:F(),sourceChannels:F(),targetSampleRate:F(),targetChannels:F(),format:Vb,tag:P().optional(),createdAtMs:F(),lastActivityMs:F(),framesIn:F(),framesOut:F()}),Jb={name:`audio-codec`,scope:`system`,mode:`singleton`,methods:{listSupportedCodecs:J(R(),z(Hb).readonly()),canHandle:J(B({codec:P(),kind:U([`decode`,`encode`])}),I()),createDecodeSession:J(Ub,B({sessionId:P(),nodeId:P()}),{kind:`mutation`}),createEncodeSession:J(Wb,B({sessionId:P(),nodeId:P()}),{kind:`mutation`}),closeSession:J(B({sessionId:P(),nodeId:P().optional()}),R(),{kind:`mutation`}),pushEncodedFrame:J(B({sessionId:P(),nodeId:P().optional(),data:Rd(Uint8Array),pts:F().optional()}),R(),{kind:`mutation`}),pullPcm:J(B({sessionId:P(),nodeId:P().optional(),maxCount:F().int().positive().default(8)}),z(Gb)),pushPcm:J(B({sessionId:P(),nodeId:P().optional(),data:Rd(Uint8Array),pts:F().optional()}),R(),{kind:`mutation`}),pullEncoded:J(B({sessionId:P(),nodeId:P().optional(),maxCount:F().int().positive().default(8)}),z(Kb)),flushEncode:J(B({sessionId:P(),nodeId:P().optional()}),z(Kb),{kind:`mutation`}),listActiveSessions:J(R(),z(qb).readonly())}},Yb=B({embedding:z(F()),inferenceMs:F()}),Xb=B({modelId:P(),embeddingDim:F(),ready:I()}),Zb={name:`embedding-encoder`,scope:`system`,mode:`collection`,internal:!0,methods:{encode:J(B({crop:Rd(Uint8Array),width:F(),height:F()}),Yb),encodeText:J(B({text:P()}),Yb),getInfo:J(R(),Xb)}},Qb=B({childKey:P(),section:P(),order:F().optional(),collapsed:I().optional()}),$b=B({id:P(),source:B({sourceKey:P(),cap:P(),fieldPath:P()}),target:B({cap:P(),fieldPath:P(),itemKey:P().optional()}),transform:rd(`kind`,[B({kind:W(`identity`)}),B({kind:W(`enum-map`),mapping:H(P(),V([P(),F(),I()])),fallback:V([P(),F(),I()]).optional()}),B({kind:W(`linear`),scale:F(),offset:F(),clamp:sd([F(),F()]).readonly().optional()})]).optional()}),ex=B({id:F(),stableId:P(),addonId:P(),type:U(K),name:P(),location:P().nullable(),disabled:I(),parentDeviceId:F().nullable(),role:P().nullable().optional(),online:I(),probed:I().optional(),features:z(P()),isCamera:I(),config:H(P(),L()),metadata:H(P(),L()).nullable().optional(),sourceInfo:Kp.optional(),integrationId:P().optional(),linkDeviceId:F().nullable().optional(),primaryChildEntityId:P().nullable().optional(),childLayout:z(Qb).readonly().optional(),deviceLinks:z($b).readonly().optional()}),tx=B({key:P(),value:L(),description:P().optional()}),nx=B({id:F(),stableId:P(),type:P(),name:P(),location:P().nullable(),disabled:I(),parentDeviceId:F().nullable(),role:P().nullable().optional()}),rx=B({id:F(),stableId:P(),addonId:P(),type:P(),name:P(),location:P().nullable(),disabled:I(),parentDeviceId:F().nullable(),metadata:H(P(),L()).nullable().optional(),sourceInfo:Kp.optional(),integrationId:P().optional(),linkDeviceId:F().nullable().optional(),primaryChildEntityId:P().nullable().optional(),childLayout:z(Qb).readonly().optional(),deviceLinks:z($b).readonly().optional(),role:P().nullable().optional()}),ix=L().nullable(),ax=B({streamId:P(),width:F().optional(),height:F().optional(),codec:P().optional(),fps:F().optional(),bitrateKbps:F().optional()}),ox=B({addonId:P(),stableId:P(),id:F(),type:P(),name:P(),location:P().nullable().optional(),disabled:I().optional(),parentDeviceId:F().nullable(),role:P().nullable().optional(),features:z(P()).optional(),config:H(P(),L())}),sx=B({deviceId:F()}),cx=B({deviceId:F(),data:H(P(),L())}),lx={name:`device-manager`,scope:`system`,mode:`singleton`,methods:{allocateDeviceId:J(B({addonId:P(),stableId:P()}),B({id:F()}),{kind:`mutation`}),registerDevice:J(ox,R(),{kind:`mutation`}),removeDevice:J(sx,R(),{kind:`mutation`}),persistConfig:J(cx,R(),{kind:`mutation`}),loadConfig:J(B({deviceId:F()}),H(P(),L())),loadRuntimeState:J(B({deviceId:F()}),H(P(),L())),loadMeta:J(B({deviceId:F()}),rx.nullable()),setName:J(B({deviceId:F(),name:P()}),R(),{kind:`mutation`,auth:`admin`}),setLocation:J(B({deviceId:F(),location:P().nullable()}),R(),{kind:`mutation`,auth:`admin`}),setType:J(B({deviceId:F(),type:U(K)}),R(),{kind:`mutation`,auth:`admin`}),setIntegrationId:J(B({deviceId:F(),integrationId:P()}),R(),{kind:`mutation`,auth:`admin`}),setLinkDeviceId:J(B({deviceId:F(),linkDeviceId:F().nullable()}),R(),{kind:`mutation`,auth:`admin`}),setPrimaryChildEntityId:J(B({deviceId:F(),primaryChildEntityId:P().nullable()}),R(),{kind:`mutation`,auth:`admin`}),setChildLayout:J(B({deviceId:F(),childLayout:z(Qb).readonly()}),R(),{kind:`mutation`,auth:`admin`}),setDeviceLinks:J(B({deviceId:F(),deviceLinks:z($b).readonly()}),R(),{kind:`mutation`,auth:`admin`}),getWireableFields:J(B({deviceId:F()}),B({caps:z(B({cap:P(),fields:z(B({path:P(),kind:U([`string`,`number`,`boolean`,`enum`]),enumValues:z(P()).optional()})).readonly()})).readonly()}),{kind:`query`}),setRole:J(B({deviceId:F(),role:P().nullable()}),R(),{kind:`mutation`,auth:`admin`}),applyInitialMeta:J(B({deviceId:F(),name:P().optional(),location:P().nullable().optional(),type:U(K).optional(),integrationId:P().optional(),linkDeviceId:F().nullable().optional(),role:P().nullable().optional()}),R(),{kind:`mutation`,auth:`admin`}),setMetadata:J(B({deviceId:F(),patch:H(P(),L())}),R(),{kind:`mutation`,auth:`admin`}),listLocations:J(R(),z(P())),addLocation:J(B({name:P()}),R(),{kind:`mutation`,auth:`admin`}),removeLocation:J(B({name:P(),cascade:I().optional()}),R(),{kind:`mutation`,auth:`admin`}),setDisabled:J(B({deviceId:F(),disabled:I()}),R(),{kind:`mutation`,auth:`admin`}),listPersistedByAddon:J(B({addonId:P()}),z(nx)),listAll:J(B({addonId:P().optional()}),z(ex)),getDevice:J(B({deviceId:F()}),ex.nullable()),getChildren:J(B({parentDeviceId:F()}),z(ex)),getStreamSources:J(B({deviceId:F()}),z(Xd)),getConfigSchema:J(B({deviceId:F()}),z(tx)),getSettingsSchema:J(B({deviceId:F()}),ix),updateConfig:J(B({deviceId:F(),values:H(P(),L())}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`}),enable:J(B({deviceId:F()}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`}),disable:J(B({deviceId:F()}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`}),remove:J(B({deviceId:F()}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`}),removeByIntegration:J(B({integrationId:P()}),B({removed:F()}),{kind:`mutation`,auth:`admin`}),getStreamProfileMap:J(B({deviceId:F()}),H(P(),P().nullable())),setStreamProfileMap:J(B({deviceId:F(),profileMap:H(P(),P().nullable())}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`}),probeStreams:J(B({deviceId:F()}),z(ax),{kind:`mutation`,auth:`admin`}),getBindings:J(B({deviceId:F()}),B({deviceId:F(),entries:z(B({capName:P(),kind:U([`native`,`wrapped`]),providerAddonId:P(),providerNodeId:P(),nativeAddonId:P()}))})),getAllBindings:J(B({}),z(B({deviceId:F(),entries:z(B({capName:P(),kind:U([`native`,`wrapped`]),providerAddonId:P(),providerNodeId:P(),nativeAddonId:P()}))}))),setWrapperActive:J(B({deviceId:F(),capName:P(),wrapperAddonId:P(),active:I()}),R(),{kind:`mutation`,auth:`admin`}),listWrappersForCap:J(B({capName:P()}),z(P())),listBindableCapsForDeviceType:J(B({deviceType:P()}),z(B({capName:P(),wrappers:z(P())}))),getDeviceSettingsAggregate:J(B({deviceId:F()}),R_.nullable()),getDeviceLiveInfoAggregate:J(B({deviceId:F()}),R_.nullable()),getDeviceAggregate:J(B({deviceId:F()}),B({settings:R_.nullable(),live:R_.nullable()})),runDeviceAction:J(B({deviceId:F().int().nonnegative(),action:P().min(1),input:L()}),L(),{kind:`mutation`}),updateDeviceField:J(B({deviceId:F(),writerCapName:P(),writerAddonId:P(),key:P(),value:L()}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`}),updateDeviceFieldsBatch:J(B({deviceId:F(),changes:z(B({writerCapName:P(),writerAddonId:P(),key:P(),value:L()}))}),B({success:W(!0),failures:z(B({writerCapName:P(),writerAddonId:P(),error:P()}))}),{kind:`mutation`,auth:`admin`}),discoverDevices:J(B({addonId:P()}),z(g_),{kind:`mutation`,auth:`admin`}),adoptDevice:J(B({addonId:P(),candidate:g_,integrationId:P().optional()}),__,{kind:`mutation`,auth:`admin`}),getCreationSchema:J(B({addonId:P(),type:U(K)}),L().nullable()),createDevice:J(B({addonId:P(),type:U(K),config:H(P(),L()),integrationId:P().optional()}),__,{kind:`mutation`,auth:`admin`}),testCreationField:J(B({addonId:P(),type:U(K),key:P(),value:L(),formValues:H(P(),L()).optional()}),v_,{kind:`mutation`,auth:`admin`}),adoptionListCandidates:J(Yv.extend({addonId:P()}),Xv,{auth:`admin`}),adoptionRefresh:J(B({addonId:P(),integrationId:P()}),Qv,{kind:`mutation`,auth:`admin`}),adoptionAdopt:J(ey.extend({addonId:P()}),ty,{kind:`mutation`,auth:`admin`}),adoptionRelease:J(ny.extend({addonId:P()}),R(),{kind:`mutation`,auth:`admin`}),testField:J(B({deviceId:F(),key:P(),value:L()}),v_,{kind:`mutation`,auth:`admin`}),getDeviceStatusAggregate:J(B({deviceId:F(),caps:z(P()).readonly().optional()}),H(P(),L().nullable()))}},ux={name:`device-state`,scope:`system`,mode:`singleton`,methods:{getSnapshot:J(B({deviceId:F()}),H(P(),H(P(),L()))),getCapSlice:J(B({deviceId:F(),capName:P()}),H(P(),L()).nullable()),getAllSnapshots:J(B({}),H(P(),H(P(),H(P(),L())))),setCapSlice:J(B({deviceId:F(),capName:P(),slice:H(P(),L())}),R(),{kind:`mutation`})},events:{onChanged:Bf(B({deviceId:F(),capName:P(),slice:H(P(),L())}))}},dx=B({userId:P(),username:P(),email:P().optional(),displayName:P().optional(),isAdmin:I().default(!1)}),fx={name:`auth-provider`,scope:`system`,mode:`collection`,internal:!0,methods:{validateCredentials:J(B({username:P(),password:P()}),dx.nullable(),{kind:`mutation`}),getLoginUrl:J(B({state:P()}),P()),handleCallback:J(H(P(),P()),dx,{kind:`mutation`}),validateToken:J(B({token:P()}),dx.nullable())}},px=B({url:P(),hostname:P(),port:F(),protocol:U([`http`,`https`])}),mx=B({connected:I(),endpoint:px.nullable(),error:P().optional()}),hx=px.extend({id:P(),label:P(),mode:P().optional(),sourcePort:F().optional()}),gx={name:`network-access`,scope:`system`,mode:`collection`,providerKind:`ingress`,methods:{start:J(R(),px,{kind:`mutation`}),stop:J(R(),R(),{kind:`mutation`}),getEndpoint:J(R(),px.nullable()),getStatus:J(R(),mx),listEndpoints:J(R(),z(hx).readonly())}},_x=B({urls:V([P(),z(P())]),username:P().optional(),credential:P().optional()}),vx={name:`turn-provider`,scope:`system`,mode:`collection`,methods:{getTurnServers:J(R(),z(_x).readonly())}},yx=B({base64:P(),contentType:P()}),bx=B({lastCapturedAt:F().nullable(),cacheAgeMs:F().nullable(),lastBytes:F().nullable(),lastStreamId:P().nullable()}),xx={name:`snapshot`,scope:`device`,deviceNative:!0,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[K.Camera],exposesDeviceSettings:!0,methods:{getSnapshot:J(B({deviceId:F(),streamId:P().optional(),force:I().optional()}),yx.nullable()),invalidateCache:J(B({deviceId:F()}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:bx,kind:`poll`}},Sx={name:`snapshot-provider`,scope:`system`,mode:`collection`,methods:{supportsDevice:J(B({deviceId:F()}),I()),getSnapshot:J(B({deviceId:F(),streamId:P().optional()}),yx.nullable())}},Cx={name:`notification-output`,scope:`system`,mode:`collection`,methods:{send:J(B({title:P(),body:P(),imageUrl:P().optional(),deviceId:F().optional(),eventId:P().optional(),priority:U([`low`,`normal`,`high`,`critical`]).default(`normal`),metadata:H(P(),L()).optional()}),R(),{kind:`mutation`}),sendTest:J(R(),B({success:I(),error:P().optional()}),{kind:`mutation`})}},wx=B({deviceIds:z(F()).readonly().optional(),classNames:z(P()).readonly().optional(),zoneIds:z(P()).readonly().optional(),minConfidence:F().optional(),source:U([`pipeline`,`onboard`,`any`]).optional(),schedule:B({days:z(F()).readonly(),startHour:F(),endHour:F()}).optional(),cooldownSeconds:F().optional(),minDwellSeconds:F().optional(),eventTypeTokens:z(P()).readonly().optional()}),Tx=B({title:P(),body:P(),imageMode:U([`crop`,`annotated`,`full`,`none`])}),Ex=B({id:P(),name:P(),enabled:I(),eventTypes:z(P()).readonly(),conditions:wx,outputs:z(P()).readonly(),template:Tx.optional(),priority:U([`low`,`normal`,`high`,`critical`])}),Dx=B({ruleId:P(),eventId:P(),timestamp:F(),wouldFire:I(),reason:P().optional()}),Ox=B({id:P(),ruleId:P(),ruleName:P(),eventId:P(),timestamp:F(),outputs:z(P()).readonly(),success:I(),error:P().optional(),deviceId:F().optional()}),kx=B({ruleId:P().optional(),deviceId:F().optional(),from:F().optional(),to:F().optional(),limit:F().optional()}),Ax={name:`advanced-notifier`,scope:`system`,mode:`singleton`,internal:!0,methods:{getRules:J(R(),B({rules:z(Ex).readonly()})),upsertRule:J(B({rule:Ex}),B({success:W(!0)}),{kind:`mutation`}),deleteRule:J(B({ruleId:P()}),B({success:W(!0)}),{kind:`mutation`}),testRule:J(B({ruleId:P(),lookbackMinutes:F()}),B({results:z(Dx).readonly()}),{kind:`mutation`}),getHistory:J(B({filter:kx.optional()}),B({entries:z(Ox).readonly()}))}},jx={name:`detection-pipeline`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[K.Camera],exposesDeviceSettings:!0,methods:{}},Mx={name:`camera-pipeline-config`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[K.Camera],exposesDeviceSettings:!0,methods:{}},Nx=U([`new`,`entered`,`left`,`moving`,`idle`]),Px=U([`motion`,`object`,`audio`]),Fx=B({x:F(),y:F(),timestamp:F(),bbox:Am}),Ix=B({timestamp:F(),position:Fx,mediaKey:P()}),Lx=B({trackId:P(),deviceId:F(),className:P(),label:P().optional(),firstSeen:F(),lastSeen:F(),positions:z(Fx).readonly(),snapshots:z(Ix).readonly(),zonesVisited:z(P()).readonly(),totalDistance:F(),state:Nx,active:I()}),Rx={id:P(),deviceId:F(),timestamp:F()},zx=B({...Rx,kind:W(`motion`),regionCount:F(),regions:z(B({bbox:Am,pixelCount:F(),intensity:F()})).readonly().optional(),frameWidth:F().optional(),frameHeight:F().optional(),mediaUrl:P().optional()}),Bx=U([`pipeline`,`onboard`]),Vx=B({...Rx,kind:W(`object`),source:Bx.optional(),frameId:P().optional(),trackId:P().optional(),className:P(),label:P().optional(),confidence:F().optional(),bbox:Am.optional(),zones:z(P()).readonly().optional(),state:Nx.optional(),frameWidth:F().optional(),frameHeight:F().optional(),mediaKey:P().optional(),mediaUrl:P().optional()}),Hx=B({...Rx,kind:W(`audio`),rms:F(),dbfs:F(),classification:B({className:P(),originalClass:P().optional(),score:F()}).optional(),mediaUrl:P().optional()}),Ux=U([`crop`,`thumbnail`,`snapshot`,`firstFrame`,`lastFrame`,`fullFrame`,`fullFrameBoxed`,`faceCrop`,`plateCrop`]),Wx=B({key:P(),kind:Ux,base64:P(),sizeBytes:F(),timestamp:F()}),Gx=B({deviceId:F(),since:F().optional(),until:F().optional(),limit:F().int().min(1).max(5e3).default(1e3),projection:U([`full`,`slim`]).optional()}),Kx=Gx.extend({classFilter:P().optional()}),qx=B({trackId:P(),className:P(),confidence:F(),bbox:Am,zones:z(P()).readonly(),state:Nx}),Jx={name:`pipeline-analytics`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[K.Camera],exposesDeviceSettings:!0,methods:{getActiveTracks:J(B({deviceId:F()}),z(Lx).readonly()),getTrack:J(B({deviceId:F(),trackId:P()}),Lx.nullable()),listTracks:J(B({deviceId:F(),since:F().optional(),until:F().optional(),limit:F().optional()}),z(Lx).readonly()),clearTracks:J(B({deviceId:F()}),R(),{kind:`mutation`,auth:`admin`}),getMotionEvents:J(Gx,z(zx).readonly()),getObjectEvents:J(Kx,z(Vx).readonly()),getAudioEvents:J(Gx,z(Hx).readonly()),getEventDensity:J(B({deviceId:F(),since:F(),until:F(),bucketMs:F().int().positive()}),z(B({bucketStart:F(),motion:F().int(),object:F().int(),audio:F().int()})).readonly()),pruneEventsBefore:J(B({deviceId:F(),cutoffMs:F()}),B({motion:F().int(),object:F().int(),audio:F().int()}),{kind:`mutation`,auth:`admin`}),getEventMedia:J(B({eventId:P(),kind:Ux.optional()}),z(Wx).readonly()),getTrackMedia:J(B({trackId:P()}),z(Wx).readonly())},events:{onFrameTracked:{data:B({deviceId:F(),timestamp:F(),frameWidth:F(),frameHeight:F(),detections:z(qx).readonly()})},onTrackStarted:{data:B({deviceId:F(),trackId:P(),className:P()})},onTrackEnded:{data:B({deviceId:F(),trackId:P(),className:P(),durationMs:F()})},onDetectionEvent:{data:B({deviceId:F(),kind:Px,eventId:P(),timestamp:F()})}}},Yx=B({total:F(),user:F(),system:F(),irq:F(),nice:F(),loadAvg:sd([F(),F(),F()]),cores:F()}),Xx=B({percent:F(),totalBytes:F(),usedBytes:F(),availableBytes:F(),swapUsedBytes:F(),swapTotalBytes:F()}),Zx=B({readBytes:F(),writeBytes:F(),readOps:F(),writeOps:F(),timestampMs:F()}),Qx=B({rxBytes:F(),txBytes:F(),rxPackets:F(),txPackets:F(),rxErrors:F(),txErrors:F(),timestampMs:F()}),$x=B({utilization:F(),model:P(),memoryUsedBytes:F(),memoryTotalBytes:F(),temperature:F().nullable()}),eS=B({openFds:F(),threadCount:F(),activeHandles:F(),activeRequests:F()}),tS=B({avg10:F(),avg60:F(),avg300:F()}),nS=B({some:tS,full:tS.nullable()}),rS=B({cpu:Yx,memory:Xx,gpu:$x.nullable(),network:Qx,disk:Zx,pressure:B({cpu:nS.nullable(),memory:nS.nullable(),io:nS.nullable()}),process:eS,cpuTemperature:F().nullable(),timestampMs:F()}),iS=B({path:P(),totalBytes:F(),usedBytes:F(),availableBytes:F(),percent:F()}),aS=B({pid:F(),cpu:F(),memory:F()}),oS=B({addonId:P(),nodeId:P(),role:U([`hub`,`worker`]),pid:F(),state:U([`starting`,`running`,`stopping`,`stopped`,`crashed`]),uptimeSec:F()}),sS=B({pid:F(),ppid:F(),pgid:F(),classification:U([`root`,`managed`,`system`,`ghost`]),addonId:P().nullable(),nodeId:P().nullable(),command:P(),cpuPercent:F(),memoryRssBytes:F(),uptimeSec:F(),orphaned:I()}),cS=B({pid:F(),force:I().optional()}),lS=B({success:I(),reason:P().optional(),signal:U([`SIGTERM`,`SIGKILL`]).optional()}),uS=B({cpuPercent:F(),memoryPercent:F(),memoryUsedMB:F(),memoryTotalMB:F(),diskPercent:F().optional(),temperature:F().optional(),gpuPercent:F().optional(),gpuMemoryPercent:F().optional()}),dS={name:`metrics-provider`,scope:`system`,mode:`singleton`,methods:{collectSnapshot:J(R(),rS),getCached:J(R(),rS.nullable()),getCurrent:J(R(),uS),getDiskSpace:J(B({dirPath:P()}),iS),getGpuInfo:J(R(),$x.nullable()),getCpuTemperature:J(R(),F().nullable()),getProcessStats:J(B({pids:z(F())}),z(aS)),listAddonInstances:J(R(),z(oS).readonly()),getAddonStats:J(B({addonId:P()}),aS.nullable()),listNodeProcesses:J(R(),z(sS).readonly()),killProcess:J(cS,lS,{kind:`mutation`,auth:`admin`})}},fS=B({id:P(),name:P()}),pS=B({pan:F(),tilt:F(),zoom:F()}),mS=B({pan:F().optional(),tilt:F().optional(),zoom:F().optional(),speed:F().optional()}),hS=pS.extend({autofocus:I()}),gS=B({hasPan:I(),hasTilt:I(),hasZoom:I(),supportsPresets:I(),maxPresets:F().optional(),hasAutofocus:I()}),_S={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(mS.extend({deviceId:F()}),R(),{kind:`mutation`}),continuousMove:J(mS.extend({deviceId:F()}),R(),{kind:`mutation`}),stop:J(B({deviceId:F()}),R(),{kind:`mutation`}),getPresets:J(B({deviceId:F()}),z(fS)),goToPreset:J(B({deviceId:F(),presetId:P()}),R(),{kind:`mutation`}),savePreset:J(B({deviceId:F(),presetId:P(),name:P()}),R(),{kind:`mutation`,auth:`admin`}),deletePreset:J(B({deviceId:F(),presetId:P()}),R(),{kind:`mutation`,auth:`admin`}),getOptions:J(B({deviceId:F()}),gS),goHome:J(B({deviceId:F()}),R(),{kind:`mutation`}),getPosition:J(B({deviceId:F()}),pS),setAutofocus:J(B({deviceId:F(),enabled:I()}),R(),{kind:`mutation`})},status:{schema:hS,kind:`command-driven`}},vS=B({id:P(),type:P(),timestamp:F(),label:P().optional(),thumbnailUrl:P().optional(),clipUrl:P().optional(),metadata:H(P(),L()).optional()}),yS={name:`events`,scope:`device`,mode:`singleton`,deviceTypes:[K.Camera],methods:{getEvents:J(B({deviceId:F(),from:F().optional(),to:F().optional(),limit:F().optional()}),z(vS)),getEventThumbnail:J(B({deviceId:F(),eventId:P()}),B({base64:P(),contentType:P()}).nullable()),getEventClipUrl:J(B({deviceId:F(),eventId:P()}),P().nullable())}},bS=B({id:P(),name:P(),sampleCount:F().int().nonnegative(),coverMediaKey:P().optional(),coverBase64:P().optional()}),xS=B({id:P(),source:U([`detected`,`photo`]),addedAt:F().int(),deviceId:F().int().optional(),base64:P().optional()}),SS=B({faceId:P(),deviceId:F().int(),trackId:P(),timestamp:F().int(),recognizedIdentityId:P().optional(),identityName:P().optional(),assigned:I(),base64:P().optional()}),CS=U([`unassigned`,`recognized`,`all`]),wS=B({key:P(),kind:P(),base64:P(),sizeBytes:F(),timestamp:F()}),TS={name:`face-gallery`,scope:`system`,mode:`singleton`,methods:{listIdentities:J(R(),z(bS).readonly()),createIdentity:J(B({name:P().min(1)}),bS,{kind:`mutation`,auth:`admin`}),renameIdentity:J(B({id:P(),name:P().min(1)}),R(),{kind:`mutation`,auth:`admin`}),deleteIdentity:J(B({id:P()}),R(),{kind:`mutation`,auth:`admin`}),listIdentitySamples:J(B({identityId:P()}),z(xS).readonly()),removeSample:J(B({identityId:P(),sampleId:P()}),R(),{kind:`mutation`,auth:`admin`}),listRecentFaces:J(B({limit:F().int().positive().optional(),filter:CS.optional()}).optional(),z(SS).readonly()),getFaceByTrack:J(B({deviceId:F().int(),trackId:P()}),SS.nullable()),getFaceMedia:J(B({faceId:P()}),z(wS).readonly()),assignFace:J(B({faceId:P(),identityId:P()}),R(),{kind:`mutation`,auth:`admin`}),unassignFace:J(B({faceId:P()}),R(),{kind:`mutation`,auth:`admin`}),deleteFace:J(B({faceId:P()}),R(),{kind:`mutation`,auth:`admin`}),assignFaces:J(B({faceIds:z(P()).min(1),identityId:P()}),B({assigned:F().int(),failed:z(P()).readonly()}),{kind:`mutation`,auth:`admin`}),unassignFaces:J(B({faceIds:z(P()).min(1)}),B({unassigned:F().int(),failed:z(P()).readonly()}),{kind:`mutation`,auth:`admin`}),suggestFaceClusters:J(B({threshold:F().min(0).max(1).optional(),minClusterSize:F().int().min(2).optional(),limit:F().int().positive().optional()}).optional(),z(B({faceIds:z(P()).readonly(),representativeFaceId:P(),size:F().int(),cohesion:F()})).readonly())}},ES=B({plateId:P(),deviceId:F().int(),trackId:P(),timestamp:F().int(),text:P(),score:F(),corrected:I(),base64:P().optional()}),DS=B({key:P(),kind:P(),base64:P(),sizeBytes:F(),timestamp:F()}),OS=B({plateIds:z(P()).readonly(),representativePlateId:P(),representativeText:P(),size:F().int(),cohesion:F()}),kS={name:`plate-gallery`,scope:`system`,mode:`singleton`,methods:{listPlates:J(B({deviceId:F().int().optional(),limit:F().int().positive().optional()}).optional(),z(ES).readonly()),getPlateByTrack:J(B({deviceId:F().int(),trackId:P()}),ES.nullable()),getPlateMedia:J(B({plateId:P()}),z(DS).readonly()),searchPlates:J(B({text:P().min(1),maxDistance:F().int().min(0).optional(),limit:F().int().positive().optional()}),z(ES).readonly()),suggestPlateClusters:J(B({maxDistance:F().int().min(0).optional(),minClusterSize:F().int().min(2).optional(),limit:F().int().positive().optional()}).optional(),z(OS).readonly()),correctPlateText:J(B({plateId:P(),text:P().min(1)}),R(),{kind:`mutation`,auth:`admin`}),deletePlate:J(B({plateId:P()}),R(),{kind:`mutation`,auth:`admin`})}},AS=B({deviceId:F(),enabled:I(),activeMode:U([`off`,`continuous`,`events`]),nodeId:P(),storageBytes:F()}),jS=B({profile:P(),startMs:F(),endMs:F()}),MS=B({deviceId:F(),ranges:z(jS)}),NS=B({deviceId:F(),days:z(F())}),PS=B({deviceId:F(),localMasterPath:P().nullable(),playbackUrl:P().nullable(),playbackEndpoints:z(P())}),FS=B({deviceId:F(),usedBytes:F()}),IS=B({locationId:P().nullable(),usedBytes:F(),availableBytes:F().nullable(),totalBytes:F().nullable()}),LS=B({nodeId:P(),totalUsedBytes:F(),devices:z(FS),locations:z(IS)}),RS=rd(`kind`,[B({kind:W(`segment`),startMs:F(),durMs:F(),bytes:F()}),B({kind:W(`gap`),nearestEdgeMs:F().nullable()})]),zS=B({data:Rd(Uint8Array)}),BS={name:`recording`,scope:`system`,mode:`singleton`,exposesDeviceSettings:!0,status:{schema:AS,kind:`command-driven`},methods:{getAvailability:J(B({deviceId:F(),fromMs:F(),toMs:F()}),MS,{kind:`query`,auth:`admin`}),getDaysWithRecordings:J(B({deviceId:F(),fromMs:F(),toMs:F(),tzOffsetMinutes:F()}),NS,{kind:`query`,auth:`admin`}),getPlaybackManifest:J(B({deviceId:F(),fromMs:F(),toMs:F()}),PS,{kind:`query`,auth:`admin`}),getStorageUsage:J(B({}),LS,{kind:`query`,auth:`admin`}),getDeviceConfig:J(B({deviceId:F()}),bf,{kind:`query`,auth:`admin`}),locateSegment:J(B({deviceId:F(),profile:P(),epochMs:F()}),RS,{kind:`query`,auth:`admin`}),readSegmentBytes:J(B({deviceId:F(),profile:P(),startMs:F()}),zS,{kind:`query`,auth:`admin`}),setDeviceConfig:J(B({deviceId:F(),config:bf}),bf,{kind:`mutation`,auth:`admin`}),rescanStorage:J(B({deviceId:F()}),AS,{kind:`mutation`,auth:`admin`}),pruneFootage:J(B({deviceId:F()}),B({floorMs:F().nullable(),deletedBuckets:F().int(),reclaimedBytes:F().int()}),{kind:`mutation`,auth:`admin`})}},VS=B({id:P(),label:P(),protocol:U([`rtsp`,`rtmp`,`annexb`,`http-mjpeg`,`webrtc`,`custom`]),url:P().optional(),resolution:B({width:F(),height:F()}).optional(),fps:F().optional(),bitrate:F().optional(),codec:P().optional(),profileHint:Wd.optional(),sdp:P().optional()}),HS=B({key:P(),value:L()}),US=B({source:P(),data:H(P(),L())}),WS={name:`device-ops`,scope:`device`,deviceNative:!0,mode:`singleton`,methods:{getStreamSources:J(B({deviceId:F()}),z(VS)),getConfigEntries:J(B({deviceId:F()}),z(HS)),setConfig:J(B({deviceId:F(),values:H(P(),L())}),R(),{kind:`mutation`}),runAction:J(B({deviceId:F(),action:P().min(1),input:L()}),L(),{kind:`mutation`}),removeDevice:J(B({deviceId:F()}),R(),{kind:`mutation`}),getSettingsSchema:J(B({deviceId:F()}),L().nullable()),getRawState:J(B({deviceId:F()}),US.nullable(),{auth:`protected`})}},GS=B({host:P(),port:F().int().positive().optional(),onvifPort:F().int().positive().optional(),rtspPort:F().int().positive().optional(),https:I().optional(),username:P().optional(),password:P().optional(),onvifProfile:P().optional()}),KS=B({host:P(),port:F().int().positive().nullable(),onvifPort:F().int().positive().nullable(),rtspPort:F().int().positive().nullable(),https:I().nullable(),hasUsername:I(),hasPassword:I(),onvifProfile:P().nullable()}),qS={name:`camera-credentials`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Camera],methods:{getCredentials:J(B({deviceId:F()}),GS.nullable(),{kind:`query`,auth:`admin`})},status:{schema:KS,kind:`command-driven`}},JS={name:`reboot`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Camera,K.Sensor,K.Switch],methods:{reboot:J(B({deviceId:F().int().nonnegative()}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`})}},YS={name:`button`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Button],methods:{press:J(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`})}},XS=U([`text`,`timestamp`,`watermark`]),ZS=U([`top-left`,`top-center`,`top-right`,`bottom-left`,`bottom-center`,`bottom-right`,`custom`]),QS=B({overlays:z(B({id:P(),kind:XS,enabled:I(),text:P().optional(),position:ZS.optional(),availablePositions:z(ZS).readonly(),readOnly:I().optional()})).readonly()}),$S=B({enabled:I().optional(),text:P().optional(),position:ZS.optional()}).partial(),eC={name:`osd`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Camera],methods:{setOverlay:J(B({deviceId:F(),overlayId:P(),patch:$S}),R(),{kind:`mutation`,auth:`admin`})},events:{onStatusChanged:{data:B({deviceId:F(),status:QS})}},status:{schema:QS,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}}}]}},tC=B({childDeviceIds:z(F()).readonly(),hiddenChildIds:z(F()).readonly()}),nC={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(B({deviceId:F().int().nonnegative(),childDeviceId:F().int().nonnegative(),hidden:I()}),R(),{kind:`mutation`,auth:`admin`})},events:{onAccessoriesChanged:{data:B({deviceId:F(),childDeviceIds:z(F()).readonly(),hiddenChildIds:z(F()).readonly()})},onChildVisibilityChanged:{data:B({deviceId:F(),childDeviceId:F(),hidden:I()})}},status:{schema:tC,kind:`command-driven`}},rC=B({codecs:z(P()),sampleRate:F(),duplex:U([`half`,`full`]),maxBacklogMs:F()}),iC=B({talking:I(),lastSessionAt:F().nullable(),ability:rC.nullable()}),aC=U([`opus`,`s16le`,`g711ulaw`,`g711alaw`]),oC={name:`intercom`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Camera],methods:{startSession:J(B({deviceId:F()}),B({sessionId:P(),sdpOffer:P()}),{kind:`mutation`,auth:`admin`}),handleAnswer:J(B({deviceId:F(),sessionId:P(),sdpAnswer:P()}),R(),{kind:`mutation`,auth:`admin`}),stopSession:J(B({deviceId:F(),sessionId:P()}),R(),{kind:`mutation`,auth:`admin`}),startTalkSession:J(B({deviceId:F()}),B({sessionId:P()}),{kind:`mutation`,auth:`admin`}),pushTalkAudio:J(B({deviceId:F(),audioBase64:P(),codec:aC.optional(),sampleRate:F().int().positive().optional(),channels:F().int().positive().optional(),sequenceNumber:F().int()}),B({accepted:I()}),{kind:`mutation`,auth:`admin`}),endTalkSession:J(B({deviceId:F()}),R(),{kind:`mutation`,auth:`admin`})},events:{onStatusChanged:{data:B({deviceId:F(),status:iC})}},status:{schema:iC,kind:`command-driven`}},sC=B({camStreamId:P().min(1),kind:Gd,url:P().optional(),codec:P().optional(),resolution:Kd.optional(),fps:F().positive().optional(),label:P().optional(),deviceFeatures:z(P()).optional(),autoEligible:I().optional(),metadata:H(P(),L()).optional()}),cC={name:`stream-catalog`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Camera],methods:{getCatalog:J(B({deviceId:F().int().nonnegative()}),z(sC).readonly())}},lC=U(Ud),uC=U([`videotoolbox`,`cuda`,`nvdec`,`vaapi`,`qsv`,`d3d11va`,`dxva2`,`amf`,`vdpau`,`drm`,`coreml`,`tensorrt`,`openvino`,`directml`,`webgpu`,`none`]).nullable().optional(),dC=B({preferred:z(P()).readonly()}),fC=U([`h264_videotoolbox`,`hevc_videotoolbox`,`h264_vaapi`,`hevc_vaapi`,`h264_nvenc`,`hevc_nvenc`,`h264_qsv`,`hevc_qsv`,`h264_amf`,`hevc_amf`,`libx264`,`libx265`]),pC=B({encoders:z(B({encoder:fC,codec:U([`H264`,`H265`]),family:U([`videotoolbox`,`vaapi`,`nvenc`,`qsv`,`amf`,`software`]),available:I(),reason:P().optional()})).readonly(),defaultH264:fC,defaultH265:fC,probedAt:F()}),mC=B({methods:z(P()).readonly(),probedAt:F()}),hC=U([`darwin`,`linux`,`win32`]),gC=U([`arm64`,`x64`]),_C=B({type:U([`nvidia`,`amd`,`intel`,`apple`]),name:P(),memoryMB:F().optional()}),vC=B({type:U([`apple-ane`,`intel-npu`])}),yC=B({platform:hC,arch:gC,cpuModel:P(),cpuCores:F(),totalRAM_MB:F(),availableRAM_MB:F(),gpu:_C.nullable(),npu:vC.nullable()}),bC=B({runtime:U([`node`,`python`]),backend:P(),format:U([`onnx`,`coreml`,`openvino`]),score:F(),reason:P(),available:I()}),xC=B({hardware:yC,scores:z(bC).readonly(),bestScore:bC,pythonPath:P().nullable()}),SC=B({modelId:P(),name:P(),minRAM_MB:F(),accuracyScore:F(),formats:z(P()).readonly()}),CC=B({modelId:P(),runtime:U([`node`,`python`]),backend:P(),format:lC,reason:P()}),wC={name:`platform-probe`,scope:`system`,mode:`singleton`,methods:{getCapabilities:J(R(),xC),getHardware:J(R(),yC),resolveInferenceConfig:J(B({requirements:z(SC).readonly()}),CC),resolveHwAccel:J(B({prefer:uC,nodeId:P().optional()}),dC),getHardwareEncoders:J(R(),pC),refreshHardwareEncoders:J(R(),pC,{kind:`mutation`,auth:`admin`}),getHardwareDecodeAccels:J(R(),mC),refreshHardwareDecodeAccels:J(R(),mC,{kind:`mutation`,auth:`admin`})}},TC=U([`lan`,`wifi`,`docker`,`vpn`,`loopback`,`other`]),EC=B({name:P(),family:U([`IPv4`,`IPv6`]),address:P(),cidr:P(),netmask:P(),internal:I(),mac:P(),kind:TC,preferred:I(),plausible:I(),plausibleReason:P()}),DC=B({interfaces:z(EC).readonly(),probedAt:F()}),OC=EC.nullable(),kC=B({endpoints:z(B({label:P(),baseUrl:P(),kind:U([`lan-ipv4`,`lan-ipv6`,`public`,`loopback`]),interfaceKind:U([`lan`,`wifi`,`docker`,`vpn`,`other`,`loopback`,`public`]),plausible:I(),plausibleReason:P(),priority:F()})).readonly()}),AC=B({addresses:z(P()).readonly()}),jC={name:`local-network`,scope:`system`,mode:`singleton`,methods:{list:J(R(),DC),getPreferred:J(R(),OC),getConnectionEndpoints:J(B({port:F().int().min(1).max(65535),includeLoopback:I().optional(),ipv4Only:I().optional(),scheme:U([`http`,`https`]).optional()}),kC),getAllowedAddresses:J(R(),AC),setAllowedAddresses:J(AC,B({success:W(!0)}),{kind:`mutation`}),resetAllowlistToBestMatch:J(R(),AC,{kind:`mutation`})}},MC=B({id:P(),label:P(),scope:U([`mesh`,`public`]),url:P(),hostname:P(),port:F(),protocol:U([`http`,`https`])}),NC=B({id:P(),hostname:P(),magicDns:P(),addresses:z(P()).readonly(),os:P().optional(),online:I(),lastSeenMs:F(),isSelf:I(),connection:U([`direct`,`relay`,`idle`]),relay:P().nullable(),lastHandshakeMs:F(),rxBytes:F(),txBytes:F(),tags:z(P()).readonly(),exitNodeOption:I(),advertisedRoutes:z(P()).readonly(),userLogin:P().nullable(),keyExpiry:F().nullable()}),PC=B({joined:I(),meshIp:P(),magicDnsHostname:P(),peerCount:F(),endpoints:z(MC).readonly(),error:P().optional(),tenantName:P(),magicDnsSuffix:P(),userLogin:P().nullable(),controlPlaneUrl:P(),keyExpiry:F().nullable(),daemonSocket:P().optional(),daemonCliPath:P().optional()}),FC={name:`mesh-network`,scope:`system`,mode:`collection`,providerKind:`mesh`,methods:{getStatus:J(R(),PC),join:J(B({authKey:P().min(8),hostname:P().optional()}),B({joined:W(!0)}),{kind:`mutation`}),startLogin:J(B({hostname:P().optional()}),B({loginUrl:P()}),{kind:`mutation`}),leave:J(R(),B({left:W(!0)}),{kind:`mutation`}),logout:J(R(),B({loggedOut:W(!0)}),{kind:`mutation`}),listPeers:J(R(),B({peers:z(NC).readonly()})),testConnection:J(B({authKey:P().optional()}),B({ok:I(),tenant:P().optional(),daemonVersion:P().optional(),error:P().optional()}),{kind:`mutation`})}},IC=B({id:P(),username:P(),isAdmin:I().default(!1),allowedProviders:V([z(P()),W(`*`)]),allowedDevices:H(P(),V([z(P()),W(`*`)])),scopes:z(Fv).default([]),totpEnabled:I().default(!1),createdAt:F(),updatedAt:F()}),LC=B({username:P(),password:P().min(6),isAdmin:I().default(!1),allowedProviders:V([z(P()),W(`*`)]).optional(),allowedDevices:H(P(),V([z(P()),W(`*`)])).optional(),scopes:z(Fv).optional()}),RC=B({id:P(),isAdmin:I().optional(),allowedProviders:V([z(P()),W(`*`)]).optional(),allowedDevices:H(P(),V([z(P()),W(`*`)])).optional(),scopes:z(Fv).optional()}),zC=B({id:P(),label:P(),isAdmin:I().default(!1),allowedProviders:V([z(P()),W(`*`)]).optional(),allowedDevices:H(P(),V([z(P()),W(`*`)])).optional(),tokenPrefix:P(),createdAt:F(),lastUsedAt:F().optional()}),BC=B({label:P(),isAdmin:I().default(!1),allowedProviders:V([z(P()),W(`*`)]).optional(),allowedDevices:H(P(),V([z(P()),W(`*`)])).optional()}),VC=B({token:P(),record:zC}),HC=B({id:P(),userId:P(),name:P(),tokenPrefix:P(),scopes:z(Fv),expiresAt:F().nullish(),lastUsedAt:F().nullish(),createdAt:F()}),UC=B({userId:P(),name:P(),scopes:z(Fv),expiresAt:F().optional()}),WC=B({token:P(),record:HC}),GC=B({id:P(),userId:P(),username:P(),integrationId:P(),scopes:z(Fv),createdAt:F(),lastUsedAt:F(),revokedAt:F().nullable()}),KC=B({secret:P(),otpauthUrl:P()}),qC=B({enabled:I(),confirmedAt:F().nullable()}),JC={name:`user-management`,scope:`system`,mode:`singleton`,methods:{listUsers:J(R(),z(IC),{auth:`admin`}),createUser:J(LC,IC,{kind:`mutation`,auth:`admin`,access:`create`}),updateUser:J(RC,B({success:W(!0)}),{kind:`mutation`,auth:`admin`,access:`create`}),deleteUser:J(B({id:P()}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`,access:`delete`}),resetPassword:J(B({id:P(),newPassword:P().min(6)}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`,access:`create`}),setUserScopes:J(B({userId:P(),scopes:z(Fv)}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`,access:`create`}),validateCredentials:J(B({username:P(),password:P()}),IC.extend({passwordHash:P()}).nullable(),{kind:`mutation`,access:`view`}),listApiKeys:J(R(),z(zC),{auth:`admin`}),createApiKey:J(BC,VC,{kind:`mutation`,auth:`admin`,access:`create`}),revokeApiKey:J(B({id:P()}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`,access:`delete`}),validateApiKey:J(B({token:P()}),zC.nullable(),{kind:`mutation`,access:`view`}),createScopedToken:J(UC,WC,{kind:`mutation`,auth:`admin`,access:`create`}),revokeScopedToken:J(B({id:P()}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`,access:`delete`}),validateScopedToken:J(B({token:P()}),HC.nullable(),{access:`view`}),listScopedTokens:J(B({userId:P()}),z(HC),{auth:`admin`}),setupTotp:J(B({userId:P()}),KC,{kind:`mutation`,auth:`admin`,access:`create`}),confirmTotp:J(B({userId:P(),code:P()}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`,access:`create`}),disableTotp:J(B({userId:P()}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`,access:`delete`}),getTotpStatus:J(B({userId:P()}),qC,{auth:`admin`}),verifyTotp:J(B({userId:P(),code:P()}),B({valid:I()}),{kind:`mutation`,access:`view`}),oauthIssueCode:J(B({integrationId:P(),userId:P(),username:P(),scopes:z(Fv),redirectUri:P(),hubUrl:P()}),B({code:P()}),{kind:`mutation`,access:`create`}),oauthExchangeCode:J(B({code:P(),redirectUri:P()}),B({accessToken:P(),refreshToken:P(),expiresIn:F()}).nullable(),{kind:`mutation`,access:`view`}),oauthRefresh:J(B({refreshToken:P()}),B({accessToken:P(),refreshToken:P(),expiresIn:F()}).nullable(),{kind:`mutation`,access:`view`}),oauthVerifyAccessToken:J(B({token:P()}),B({userId:P(),username:P(),scopes:z(Fv)}).nullable(),{access:`view`}),listOauthSessions:J(R(),z(GC),{auth:`admin`}),revokeOauthSession:J(B({id:P()}),B({success:I()}),{kind:`mutation`,auth:`admin`,access:`delete`})}},YC=B({streaming:I(),notifications:I(),objectDetection:I(),remoteAccess:I(),agentCluster:I(),smartHome:I(),recordings:I(),backup:I(),repl:I()}),XC=B({status:W(`ok`),uptime:F()}),ZC=B({name:P(),address:P(),family:P(),internal:I()}),QC={name:`system`,scope:`system`,mode:`singleton`,methods:{info:J(R(),YC),health:J(R(),XC),featureFlags:J(R(),YC),networkAddresses:J(R(),z(ZC).readonly()),getRetentionConfig:J(R(),L().nullable(),{auth:`admin`}),setRetentionConfig:J(H(P(),L()),Wu(),{kind:`mutation`,auth:`admin`}),forceRetentionCleanup:J(R(),R(),{kind:`mutation`,auth:`admin`})}},$C=B({nominalBitrateKbps:F(),observedBitrateKbps:F(),peakBitrateKbps:F(),packetLossPercent:F(),lastUpdated:F()}),ew=B({rttMs:F(),jitterMs:F(),estimatedBandwidthKbps:F(),packetLossPercent:F().min(0).max(100),lastUpdated:F()}),tw=B({deviceId:F(),streams:H(P(),$C),client:ew.optional()}),nw={name:`network-quality`,scope:`system`,mode:`singleton`,methods:{getDeviceStats:J(B({deviceId:F()}),tw.nullable()),getAllStats:J(R(),z(tw).readonly()),reportClientStats:J(B({deviceId:F(),rttMs:F().min(0).max(6e4),jitterMs:F().min(0).max(1e4),estimatedBandwidthKbps:F().min(0).max(1e6),packetLossPercent:F().min(0).max(100)}),R(),{kind:`mutation`})}},rw=B({title:P(),message:P(),severity:U([`info`,`warning`,`critical`]),duration:F().optional(),action:B({label:P(),url:P()}).optional()}),iw={name:`toast`,scope:`system`,mode:`singleton`,methods:{onToast:J(R(),rw,{kind:`subscription`})}},aw=B({addonId:P(),capabilities:z(P()).readonly(),status:P()}),ow=B({pid:F(),name:P(),state:P(),cpuPercent:F(),memoryRss:F(),uptimeSeconds:F(),services:z(aw).readonly(),groupId:P().optional()}),sw=B({id:P(),status:P(),cpuPercent:F(),memoryRss:F()}),cw=B({category:P(),total:F(),healthy:F(),addons:z(sw).readonly()}),lw=B({id:P(),name:P(),hostname:P(),platform:P(),arch:P(),cpuModel:P().nullable(),cpuCores:F(),memoryMB:F(),engines:z(P()).readonly(),isHub:I(),isOnline:I(),cpuPercent:F(),memoryPercent:F(),uptime:F(),lastSeen:P(),localIps:z(P()).readonly(),addons:z(B({id:P(),capabilities:z(P()).readonly(),status:P()})).readonly(),processes:z(ow).readonly(),categories:z(cw).readonly()}),uw=B({callerAddonId:P(),providerAddonId:P(),capName:P(),callsPerMin:F(),lastCallAtMs:F()}),dw=B({nodeId:P(),name:P(),version:P(),status:P(),synced:I()}),fw=B({hubVersion:P(),nodes:z(dw)}),pw=B({nodeId:P(),addonId:P()}),mw=B({id:P(),status:P(),version:P().optional(),packageName:P().optional()}),hw=B({success:I()}),gw=B({success:I(),reason:P().optional()}),_w=B({restarted:z(P()).readonly(),failed:z(P()).readonly()}),vw=B({nodeId:P(),name:P()}),yw={name:`nodes`,scope:`system`,mode:`singleton`,nodeIdMode:`data`,methods:{topology:J(R(),z(lw).readonly(),{auth:`admin`}),deployAddon:J(pw,hw,{kind:`mutation`,auth:`admin`}),undeployAddon:J(pw,hw,{kind:`mutation`,auth:`admin`}),restartAddon:J(pw,hw,{kind:`mutation`,auth:`admin`}),restartProcess:J(B({nodeId:P(),processName:P()}),gw,{kind:`mutation`,auth:`admin`}),restartNode:J(B({nodeId:P()}),_w,{kind:`mutation`,auth:`admin`}),shutdownNode:J(B({nodeId:P()}),hw,{kind:`mutation`,auth:`admin`}),renameNode:J(B({nodeId:P(),name:P().min(1).max(64)}),vw,{kind:`mutation`,auth:`admin`}),clusterAddonStatus:J(R(),H(P(),fw),{auth:`admin`}),getCapUsageGraph:J(B({windowSeconds:F().int().positive().max(300).default(60)}),z(uw).readonly(),{auth:`admin`}),getNodeAddons:J(B({nodeId:P()}),z(mw).readonly(),{auth:`admin`}),setProcessLogLevel:J(B({nodeId:P(),level:P()}),hw,{kind:`mutation`,auth:`admin`}),executeQuery:J(B({nodeId:P(),addonId:P(),queryName:P(),params:H(P(),L()).optional()}),L(),{kind:`mutation`,auth:`admin`})}},bw=B({id:P(),addonId:P(),name:P(),enabled:I(),info:H(P(),L()).readonly(),createdAt:F(),updatedAt:F(),processState:P()}),xw=B({id:P(),addonId:P(),name:P(),enabled:I(),info:H(P(),L()).readonly(),createdAt:F(),updatedAt:F()}),Sw=B({addonId:P(),name:P(),description:P(),iconUrl:P().nullable(),color:P(),instanceMode:P(),discoveryMode:P(),kind:U([`device-adoption`,`device-provider`]),brokerKind:P().nullable(),supportsLocationImport:I(),existingInstances:z(B({id:P(),name:P()})),canAdd:I()}),Cw=B({success:I(),error:P().optional()}),ww=B({addonId:P(),name:P(),enabled:I().optional(),info:H(P(),L()).optional(),settings:H(P(),L()).optional(),skipRestart:I().optional()}),Tw=B({id:P(),name:P().optional(),enabled:I().optional(),info:H(P(),L()).optional()}),Ew=B({success:I(),deletedId:P()}),Dw={name:`integrations`,scope:`system`,mode:`singleton`,methods:{list:J(R(),z(bw)),get:J(B({id:P()}),bw),getByAddonId:J(B({addonId:P()}),xw.nullable()),create:J(ww,xw,{kind:`mutation`,auth:`admin`}),update:J(Tw,xw,{kind:`mutation`,auth:`admin`}),delete:J(B({id:P()}),Ew,{kind:`mutation`,auth:`admin`}),getSettings:J(B({id:P()}),H(P(),L()),{auth:`admin`}),setSettings:J(B({id:P(),settings:H(P(),L())}),B({success:I()}),{kind:`mutation`,auth:`admin`}),getAvailableTypes:J(R(),z(Sw),{auth:`admin`}),testConnection:J(B({addonId:P(),settings:H(P(),L())}),Cw,{kind:`mutation`,auth:`admin`})}},Ow=U([`install`,`update`,`uninstall`,`restart`]),kw=U([`queued`,`fetching`,`staged`,`validating`,`applying`,`restarting`,`applied`,`done`,`failed`,`skipped`]),Aw=U([`framework`,`addon`]),jw=B({tsMs:F(),nodeId:P(),packageName:P(),phase:kw,message:P()}),Mw=B({taskId:P(),nodeId:P(),packageName:P(),fromVersion:P().nullable(),toVersion:P(),target:Aw,phase:kw,stagedPath:P().nullable(),attempts:F(),steps:z(jw),error:P().nullable(),startedAtMs:F().nullable(),finishedAtMs:F().nullable()}),Nw=U([`running`,`completed`,`failed`,`partially-failed`,`cancelled`]),Pw=U([`single`,`bulk`,`cluster`]),Fw=B({jobId:P(),kind:Ow,createdAtMs:F(),createdBy:P(),scope:Pw,tasks:z(Mw),state:Nw,schemaVersion:W(1)}),Iw=U([`debug`,`info`,`warn`,`error`]),Lw=U([`off`,`latest`,`beta`]),Rw=U([`off`,`latest`,`beta`,`inherit`]),zw=B({id:P(),name:P().optional(),version:P().optional(),description:P().optional(),icon:P().optional(),color:P().optional(),capabilities:z(L()).readonly().optional(),packageName:P(),packageVersion:P(),packageDisplayName:P().optional(),bundle:B({displayName:P(),description:P().optional(),icon:P().optional()}).optional(),protected:I().optional(),removable:I().optional()}),Bw=B({pid:F().optional(),mode:P(),state:P()}),Vw=B({phase:U([`pending`,`healthy`,`failed`]),retryCount:F(),firstFailureAt:F().nullable(),lastAttemptAt:F().nullable(),lastError:B({message:P(),stack:P().optional()}).nullable(),nextRetryAt:F().nullable(),alertEmitted:I(),retrying:I(),inGracePeriod:I()}),Hw=B({manifest:zw,declaration:L().optional(),source:P(),installSource:P().optional(),process:Bw.optional(),hasBackup:I().optional(),health:Vw.nullable().optional()}),Uw=B({name:P(),version:P(),dir:P(),installSource:P().optional()}),Ww=B({name:P(),currentVersion:P(),latestVersion:P(),category:U([`addon`,`core`]),requiresRestart:I(),isSystem:I()}),Gw=B({version:P(),publishedAt:P(),deprecated:P().optional(),distTags:z(P()).readonly()}),Kw=B({name:P(),version:P(),description:P(),keywords:z(P()).readonly(),publishedAt:P(),author:P(),installed:I(),installedVersion:P().optional()}),qw=B({channel:Lw,intervalSeconds:F()}),Jw=Rw,Yw=L(),Xw=L(),Zw=L(),Qw=B({packageName:P(),fromVersion:P(),toVersion:P(),restartingAt:F()}),$w=U([`queued`,`updating`,`done`,`done-pending-restart`,`failed`]),eT=B({name:P(),isSystem:I(),fromVersion:P(),toVersion:P(),status:$w,error:P().optional(),startedAtMs:F().optional(),completedAtMs:F().optional()}),tT=U([`regular`,`system`,`restarting`,`finalizing`]);B({id:P(),nodeId:P(),startedAtMs:F(),completedAtMs:F().optional(),total:F(),completed:F(),failed:F(),current:P().nullable(),phase:tT,cancelled:I(),items:z(eT).readonly()});var nT=B({packageName:P(),currentVersion:P(),latestVersion:P().nullable(),hasUpdate:I(),description:P().optional()}),rT=B({timestamp:P(),level:P(),message:P(),scope:P().optional()}),iT=L(),aT=B({addonId:P().min(1),action:P().min(1),input:L()}),oT=[nC,Xy,Qy,lb,V_,ab,rb,{name:`addons`,scope:`system`,mode:`singleton`,nodeIdMode:`data`,methods:{list:J(R(),z(Hw).readonly()),getLogs:J(B({addonId:P(),limit:F().min(1).max(500).default(100),level:Iw.optional()}),z(iT)),listPackages:J(R(),z(Uw).readonly()),installPackage:J(B({packageName:P(),version:P().optional()}),Xw,{kind:`mutation`,auth:`admin`}),installFromWorkspace:J(B({packageName:P()}),Xw,{kind:`mutation`,auth:`admin`}),isWorkspaceAvailable:J(R(),I()),listWorkspacePackages:J(R(),z(L()).readonly()),uninstallPackage:J(B({packageName:P()}),L(),{kind:`mutation`,auth:`admin`}),reloadPackages:J(R(),Zw,{kind:`mutation`,auth:`admin`}),searchAvailable:J(B({query:P().optional()}),z(Kw)),listUpdates:J(B({nodeId:P().optional()}),z(Ww).readonly(),{auth:`admin`}),updatePackage:J(B({name:P().min(1),version:P().optional(),nodeId:P().optional()}),L(),{kind:`mutation`,auth:`admin`}),rollbackPackage:J(B({name:P().min(1)}),B({rolledBackTo:P().nullable()}),{kind:`mutation`,auth:`admin`}),forceRefresh:J(B({nodeId:P().optional()}),L(),{kind:`mutation`,auth:`admin`}),restartServer:J(B({confirm:W(!0)}),L(),{kind:`mutation`,auth:`admin`}),getLastRestart:J(R(),B({kind:U([`framework-update`,`manual`,`system`,`framework-bulk-update`]),packageName:P().optional(),fromVersion:P().optional(),toVersion:P().optional(),requestedBy:P().optional(),requestedAt:F()}).nullable(),{auth:`admin`}),listFrameworkPackages:J(R(),z(nT).readonly(),{auth:`admin`}),listCapabilityProviders:J(B({capName:P().min(1)}),z(B({addonId:P(),mode:U([`singleton`,`collection`]),isActive:I()})).readonly()),setCapabilityProviderEnabled:J(B({capName:P().min(1),addonId:P().min(1),enabled:I()}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`}),updateFrameworkPackage:J(B({packageName:P().min(1),version:P().optional(),deferRestart:I().optional()}),Qw,{kind:`mutation`,auth:`admin`}),getVersions:J(B({name:P()}),z(Gw).readonly()),restartAddon:J(B({addonId:P()}),Yw,{kind:`mutation`,auth:`admin`}),retryLoad:J(B({packageName:P()}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`}),getAutoUpdateSettings:J(R(),qw,{auth:`admin`}),setAutoUpdateSettings:J(B({channel:Lw,intervalSeconds:F().min(300).max(86400).optional()}),L(),{kind:`mutation`,auth:`admin`}),getAddonAutoUpdate:J(B({addonId:P()}),Jw,{auth:`admin`}),setAddonAutoUpdate:J(B({addonId:P(),channel:Rw}),L(),{kind:`mutation`,auth:`admin`}),applyAutoUpdateToAll:J(B({channel:Lw}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`}),custom:J(aT,L(),{kind:`mutation`}),startJob:J(B({kind:U([`install`,`update`,`uninstall`,`restart`]),targets:z(B({name:P().min(1),version:P().min(1)})).min(1),nodeIds:z(P()).optional()}),B({jobId:P()}),{kind:`mutation`,auth:`admin`}),getJob:J(B({jobId:P()}),Fw.nullable(),{auth:`admin`}),listJobs:J(B({activeOnly:I().optional()}),z(Fw),{auth:`admin`}),cancelJob:J(B({jobId:P()}),B({cancelled:I()}),{kind:`mutation`,auth:`admin`}),onAddonLogs:J(B({addonId:P(),level:Iw.optional()}),rT,{kind:`subscription`})}},Av,Ax,Rf,Wf,K_,Kf,Bb,zb,Jb,Xf,fx,Qf,yv,ep,np,ip,Ey,YS,qS,Mx,wp,Ep,kp,Pp,Ip,Rp,Bp,Up,Gp,db,jx,ay,Xp,qy,lx,WS,b_,ux,Pf,$p,Zb,nm,am,yS,TS,cm,If,fv,um,fm,mm,gm,vm,Dw,oC,bm,jC,Sm,Dv,Dm,FC,dS,Nh,Lm,Ih,Jh,Ry,$h,gx,nw,yw,Cx,og,cg,zv,eC,Jx,mh,Fb,Ah,kS,wC,ug,pg,hg,xg,_S,Eg,JS,BS,mb,Og,wv,Ag,Kv,xx,Sx,Lv,J_,lv,ov,yp,cC,Lg,sp,zg,QC,Vg,Ug,iw,vx,Gg,JC,Vv,Yg,Zg,$g,Sb,t_,r_,gb,yb,u_,m_,vh];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.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.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.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.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=B({name:P(),stagedPath:P(),backupPath:P(),toVersion:P(),fromVersion:P().nullable()});B({jobId:P(),taskId:P(),packages:z(sT),requestedAtMs:F(),schemaVersion:W(1)}),B({jobId:P(),taskId:P(),backups:z(B({name:P(),backupPath:P(),livePath:P()})),appliedAtMs:F(),bootAttempts:F(),schemaVersion:W(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()}},lT=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)}},uT=class extends lT{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 dT(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 fT(e,t){let n=dT(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 pT(e,t){Object.entries(e).forEach(([e,n])=>t(n,e))}function mT(e,t){return e.indexOf(t)!==-1}function hT(e,t){for(let n=0;n<e.length;n++){let r=e[n];if(t(r))return r}}var gT=class{constructor(){this.transfomers={}}register(e){this.transfomers[e.name]=e}findApplicable(e){return fT(this.transfomers,t=>t.isApplicable(e))}findByName(e){return this.transfomers[e]}},_T=e=>Object.prototype.toString.call(e).slice(8,-1),vT=e=>e===void 0,yT=e=>e===null,bT=e=>typeof e!=`object`||!e||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype,xT=e=>bT(e)&&Object.keys(e).length===0,ST=e=>Array.isArray(e),CT=e=>typeof e==`string`,wT=e=>typeof e==`number`&&!isNaN(e),TT=e=>typeof e==`boolean`,ET=e=>e instanceof RegExp,DT=e=>e instanceof Map,OT=e=>e instanceof Set,kT=e=>_T(e)===`Symbol`,AT=e=>e instanceof Date&&!isNaN(e.valueOf()),jT=e=>e instanceof Error,MT=e=>typeof e==`number`&&isNaN(e),NT=e=>TT(e)||yT(e)||vT(e)||wT(e)||CT(e)||kT(e),PT=e=>typeof e==`bigint`,FT=e=>e===1/0||e===-1/0,IT=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),LT=e=>e instanceof URL,RT=e=>e.replace(/\\/g,`\\\\`).replace(/\./g,`\\.`),zT=e=>e.map(String).map(RT).join(`.`),BT=(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 VT(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var HT=[VT(vT,`undefined`,()=>null,()=>void 0),VT(PT,`bigint`,e=>e.toString(),e=>typeof BigInt<`u`?BigInt(e):(console.error(`Please add a BigInt polyfill.`),e)),VT(AT,`Date`,e=>e.toISOString(),e=>new Date(e)),VT(jT,`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}),VT(ET,`regexp`,e=>``+e,e=>{let t=e.slice(1,e.lastIndexOf(`/`)),n=e.slice(e.lastIndexOf(`/`)+1);return new RegExp(t,n)}),VT(OT,`set`,e=>[...e.values()],e=>new Set(e)),VT(DT,`map`,e=>[...e.entries()],e=>new Map(e)),VT(e=>MT(e)||FT(e),`number`,e=>MT(e)?`NaN`:e>0?`Infinity`:`-Infinity`,Number),VT(e=>e===0&&1/e==-1/0,`number`,()=>`-0`,Number),VT(LT,`URL`,e=>e.toString(),e=>new URL(e))];function UT(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var WT=UT((e,t)=>kT(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}),GT=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),KT=UT(IT,e=>[`typed-array`,e.constructor.name],e=>[...e],(e,t)=>{let n=GT[t[1]];if(!n)throw Error(`Trying to deserialize unknown typed array`);return new n(e)});function qT(e,t){return e?.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}var JT=UT(qT,(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)}),YT=UT((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)}),XT=[JT,WT,YT,KT],ZT=(e,t)=>{let n=hT(XT,n=>n.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};let r=hT(HT,n=>n.isApplicable(e,t));if(r)return{value:r.transform(e,t),type:r.annotation}},QT={};HT.forEach(e=>{QT[e.annotation]=e});var $T=(e,t,n)=>{if(ST(t))switch(t[0]){case`symbol`:return WT.untransform(e,t,n);case`class`:return JT.untransform(e,t,n);case`custom`:return YT.untransform(e,t,n);case`typed-array`:return KT.untransform(e,t,n);default:throw Error(`Unknown transformation: `+t)}else{let r=QT[t];if(!r)throw Error(`Unknown transformation: `+t);return r.untransform(e,n)}},eE=(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 tE(e){if(mT(e,`__proto__`))throw Error(`__proto__ is not allowed as a property`);if(mT(e,`prototype`))throw Error(`prototype is not allowed as a property`);if(mT(e,`constructor`))throw Error(`constructor is not allowed as a property`)}var nE=(e,t)=>{tE(t);for(let n=0;n<t.length;n++){let r=t[n];if(OT(e))e=eE(e,+r);else if(DT(e)){let a=+r,o=+t[++n]==0?`key`:`value`,s=eE(e,a);switch(o){case`key`:e=s;break;case`value`:e=e.get(s);break}}else e=e[r]}return e},rE=(e,t,n)=>{if(tE(t),t.length===0)return n(e);let r=e;for(let e=0;e<t.length-1;e++){let n=t[e];if(ST(r)){let e=+n;r=r[e]}else if(bT(r))r=r[n];else if(OT(r)){let e=+n;r=eE(r,e)}else if(DT(r)){if(e===t.length-2)break;let a=+n,o=+t[++e]==0?`key`:`value`,s=eE(r,a);switch(o){case`key`:r=s;break;case`value`:r=r.get(s);break}}}let a=t[t.length-1];if(ST(r)?r[+a]=n(r[+a]):bT(r)&&(r[a]=n(r[a])),OT(r)){let e=eE(r,+a),t=n(e);e!==t&&(r.delete(e),r.add(t))}if(DT(r)){let e=+t[t.length-2],o=eE(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},iE=e=>e<1;function aE(e,t,n,r=[]){if(!e)return;let a=iE(n);if(!ST(e)){pT(e,(e,o)=>aE(e,t,n,[...r,...BT(o,a)]));return}let[o,s]=e;s&&pT(s,(e,o)=>{aE(e,t,n,[...r,...BT(o,a)])}),t(o,r)}function oE(e,t,n,r){return aE(t,(t,n)=>{e=rE(e,n,e=>$T(e,t,r))},n),e}function sE(e,t,n){let r=iE(n);function a(t,n){let a=nE(e,BT(n,r));t.map(e=>BT(e,r)).forEach(t=>{e=rE(e,t,()=>a)})}if(ST(t)){let[n,o]=t;n.forEach(t=>{e=rE(e,BT(t,r),()=>e)}),o&&pT(o,a)}else pT(t,a);return e}var cE=(e,t)=>bT(e)||ST(e)||DT(e)||OT(e)||jT(e)||qT(e,t);function lE(e,t,n){let r=n.get(e);r?r.push(t):n.set(e,[t])}function uE(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(zT):n[zT(a)]=o.map(zT)}),r?xT(n)?[r]:[r,n]:xT(n)?void 0:n}var dE=(e,t,n,r,a=[],o=[],s=new Map)=>{let c=NT(e);if(!c){lE(e,a,t);let n=s.get(e);if(n)return r?{transformedValue:null}:n}if(!cE(e,n)){let t=ZT(e,n),r=t?{transformedValue:t.value,annotations:[t.type]}:{transformedValue:e};return c||s.set(e,r),r}if(mT(o,e))return{transformedValue:null};let l=ZT(e,n),u=l?.value??e,d=ST(u)?[]:{},f={};pT(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=dE(c,t,n,r,[...a,l],[...o,e],s);d[l]=u.transformedValue,ST(u.annotations)?f[RT(l)]=u.annotations:bT(u.annotations)&&pT(u.annotations,(e,t)=>{f[RT(l)+`.`+t]=e})});let p=xT(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 fE(e){return Object.prototype.toString.call(e).slice(8,-1)}function pE(e){return fE(e)===`Array`}function mE(e){if(fE(e)!==`Object`)return!1;let t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function hE(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 gE(e,t={}){if(pE(e))return e.map(e=>gE(e,t));if(!mE(e))return e;let n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertySymbols(e);return[...n,...r].reduce((n,r)=>{if(r===`__proto__`||pE(t.props)&&!t.props.includes(r))return n;let a=e[r];return hE(n,r,gE(a,t),e,t.nonenumerable),n},{})}var _E=class{constructor({dedupe:e=!1}={}){this.classRegistry=new uT,this.symbolRegistry=new lT(e=>e.description??``),this.customTransformerRegistry=new gT,this.allowedErrorProps=[],this.dedupe=e}serialize(e){let t=new Map,n=dE(e,t,this,this.dedupe),r={json:n.transformedValue};n.annotations&&(r.meta={...r.meta,values:n.annotations});let a=uE(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:gE(n);return r?.values&&(a=oE(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)}};_E.defaultInstance=new _E,_E.serialize=_E.defaultInstance.serialize.bind(_E.defaultInstance),_E.deserialize=_E.defaultInstance.deserialize.bind(_E.defaultInstance),_E.stringify=_E.defaultInstance.stringify.bind(_E.defaultInstance),_E.parse=_E.defaultInstance.parse.bind(_E.defaultInstance),_E.registerClass=_E.defaultInstance.registerClass.bind(_E.defaultInstance),_E.registerSymbol=_E.defaultInstance.registerSymbol.bind(_E.defaultInstance),_E.registerCustom=_E.defaultInstance.registerCustom.bind(_E.defaultInstance),_E.allowErrorProps=_E.defaultInstance.allowErrorProps.bind(_E.defaultInstance),_E.serialize,_E.deserialize,_E.stringify,_E.parse,_E.registerClass,_E.registerCustom,_E.registerSymbol,_E.allowErrorProps;var vE=1e4,yE=6e3,bE=2e3,xE=3e4,SE=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??bE,this.maxRetryMs=e.maxRetryDelayMs??xE,this._trpcClient=this.buildTrpcClient(),this._systemProxy=E_(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 M_(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=E_(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 wE(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=Dr({url:e,connectionParams:()=>({token:this.token}),retryDelayMs:e=>Math.min(t*2**e,n),keepAlive:{enabled:!0,intervalMs:vE,pongTimeoutMs:yE},onOpen:()=>{this._connectionVersion+=1,this.emitConnectionEvent(`connected`)},onClose:()=>{this.emitConnectionEvent(`disconnected`)}}),Ir({links:[Or({client:this._wsClient,transformer:_E})]})}return this._wsClient=null,Ir({links:[ar({url:`${this._serverUrl}/trpc`,headers:e,transformer:_E})]})}};function CE(e){return new SE(e)}async function wE(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 TE=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}({}),EE=`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(`.`),DE=[`person`,`people`,`pedestrian`,`rider`,`driver`,`cyclist`,`skier`,`skateboarder`,`face`,`hand`,`head`,`body`],OE=[`vehicle`,`car`,`truck`,`bus`,`motorcycle`,`bicycle`,`van`,`ambulance`,`police_car`,`fire_truck`,`train`,`subway`,`tram`,`airplane`,`boat`,`ship`,`helicopter`],kE=`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(`.`),AE=[`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`],jE=[`motion`,`movement`,`other`],ME=[`package`,`packet`],NE=[`audio`],PE=`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(`.`),FE=[`doorbell`,`ring`],IE=[`lock`,`binary`,`flood`,`entry`,`door`,`leak`,`door_open`,`flooded`,`entry_open`];({...EE.reduce((e,t)=>({...e,[t]:`animal`}),{}),...DE.reduce((e,t)=>({...e,[t]:`person`}),{}),...OE.reduce((e,t)=>({...e,[t]:`vehicle`}),{}),...jE.reduce((e,t)=>({...e,[t]:`motion`}),{}),...ME.reduce((e,t)=>({...e,[t]:`package`}),{}),...kE.reduce((e,t)=>({...e,[t]:`face`}),{}),...AE.reduce((e,t)=>({...e,[t]:`plate`}),{}),...NE.reduce((e,t)=>({...e,[t]:`audio`}),{}),...PE.reduce((e,t)=>({...e,[t]:`audio`}),{}),...FE.reduce((e,t)=>({...e,[t]:`doorbell`}),{}),...IE.reduce((e,t)=>({...e,[t]:`sensor`}),{})}),[...Object.values(TE).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 LE=`modulepreload`,RE=function(e,t){return new URL(e,t).href},zE={},BE=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=RE(t,n),t in zE)return;zE[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`:LE,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 VE(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=VE(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function HE(){for(var e,t,n=0,r=``,a=arguments.length;n<a;n++)(e=arguments[n])&&(t=VE(e))&&(r&&(r+=` `),r+=t);return r}var UE=(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},WE=(e,t)=>({classGroupId:e,validator:t}),GE=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),KE=`-`,qE=[],JE=`arbitrary..`,YE=e=>{let t=QE(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return ZE(e);let n=e.split(KE);return XE(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],a=n[e];return t?a?UE(a,t):t:a||qE}return n[e]||qE}}},XE=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],a=n.nextPart.get(r);if(a){let n=XE(e,t+1,a);if(n)return n}let o=n.validators;if(o===null)return;let s=t===0?e.join(KE):e.slice(t).join(KE),c=o.length;for(let e=0;e<c;e++){let t=o[e];if(t.validator(s))return t.classGroupId}},ZE=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?JE+r:void 0})(),QE=e=>{let{theme:t,classGroups:n}=e;return $E(n,t)},$E=(e,t)=>{let n=GE();for(let r in e){let a=e[r];eD(a,n,r,t)}return n},eD=(e,t,n,r)=>{let a=e.length;for(let o=0;o<a;o++){let a=e[o];tD(a,t,n,r)}},tD=(e,t,n,r)=>{if(typeof e==`string`){nD(e,t,n);return}if(typeof e==`function`){rD(e,t,n,r);return}iD(e,t,n,r)},nD=(e,t,n)=>{let r=e===``?t:aD(t,e);r.classGroupId=n},rD=(e,t,n,r)=>{if(oD(e)){eD(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(WE(n,e))},iD=(e,t,n,r)=>{let a=Object.entries(e),o=a.length;for(let e=0;e<o;e++){let[o,s]=a[e];eD(s,aD(t,o),n,r)}},aD=(e,t)=>{let n=e,r=t.split(KE),a=r.length;for(let e=0;e<a;e++){let t=r[e],a=n.nextPart.get(t);a||(a=GE(),n.nextPart.set(t,a)),n=a}return n},oD=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=`!`,lD=`:`,uD=[],dD=(e,t,n,r,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:a}),fD=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===lD){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 dD(t,u,l,d)};if(t){let e=t+lD,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):dD(uD,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},pD=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}},mD=e=>({cache:sD(e.cacheSize),parseClassName:fD(e),sortModifiers:pD(e),postfixLookupClassGroupIds:hD(e),...YE(e)}),hD=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},gD=/\s+/,_D=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:o,postfixLookupClassGroupIds:s}=t,c=[],l=e.trim().split(gD),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},vD=(...e)=>{let t=0,n,r,a=``;for(;t<e.length;)(n=e[t++])&&(r=yD(n))&&(a&&(a+=` `),a+=r);return a},yD=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=yD(e[r]))&&(n&&(n+=` `),n+=t);return n},bD=(e,...t)=>{let n,r,a,o,s=s=>(n=mD(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=_D(e,n);return a(e,o),o};return o=s,(...e)=>o(vD(...e))},xD=[],SD=e=>{let t=t=>t[e]||xD;return t.isThemeGetter=!0,t},CD=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,wD=/^\((?:(\w[\w-]*):)?(.+)\)$/i,TD=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,ED=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,DD=/\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$/,OD=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,kD=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,AD=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,jD=e=>TD.test(e),MD=e=>!!e&&!Number.isNaN(Number(e)),ND=e=>!!e&&Number.isInteger(Number(e)),PD=e=>e.endsWith(`%`)&&MD(e.slice(0,-1)),FD=e=>ED.test(e),ID=()=>!0,LD=e=>DD.test(e)&&!OD.test(e),RD=()=>!1,zD=e=>kD.test(e),BD=e=>AD.test(e),VD=e=>!X(e)&&!Z(e),HD=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)),UD=e=>iO(e,cO,RD),X=e=>CD.test(e),WD=e=>iO(e,lO,LD),GD=e=>iO(e,uO,MD),KD=e=>iO(e,fO,ID),qD=e=>iO(e,dO,RD),JD=e=>iO(e,oO,RD),YD=e=>iO(e,sO,BD),XD=e=>iO(e,pO,zD),Z=e=>wD.test(e),ZD=e=>aO(e,lO),QD=e=>aO(e,dO),$D=e=>aO(e,oO),eO=e=>aO(e,cO),tO=e=>aO(e,sO),nO=e=>aO(e,pO,!0),rO=e=>aO(e,fO,!0),iO=(e,t,n)=>{let r=CD.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},aO=(e,t,n=!1)=>{let r=wD.exec(e);return r?r[1]?t(r[1]):n:!1},oO=e=>e===`position`||e===`percentage`,sO=e=>e===`image`||e===`url`,cO=e=>e===`length`||e===`size`||e===`bg-size`,lO=e=>e===`length`,uO=e=>e===`number`,dO=e=>e===`family-name`,fO=e=>e===`number`||e===`weight`,pO=e=>e===`shadow`,mO=bD(()=>{let e=SD(`color`),t=SD(`font`),n=SD(`text`),r=SD(`font-weight`),a=SD(`tracking`),o=SD(`leading`),s=SD(`breakpoint`),c=SD(`container`),l=SD(`spacing`),u=SD(`radius`),d=SD(`shadow`),f=SD(`inset-shadow`),p=SD(`text-shadow`),m=SD(`drop-shadow`),h=SD(`blur`),g=SD(`perspective`),_=SD(`aspect`),v=SD(`ease`),y=SD(`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=()=>[jD,`full`,`auto`,...w()],T=()=>[ND,`none`,`subgrid`,Z,X],E=()=>[`auto`,{span:[`full`,ND,Z,X]},ND,Z,X],ne=()=>[ND,`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=()=>[jD,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],D=()=>[jD,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],ce=()=>[jD,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],O=()=>[e,Z,X],k=()=>[...ee(),$D,JD,{position:[Z,X]}],le=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ue=()=>[`auto`,`cover`,`contain`,eO,UD,{size:[Z,X]}],de=()=>[PD,ZD,WD],fe=()=>[``,`none`,`full`,u,Z,X],pe=()=>[``,MD,ZD,WD],me=()=>[`solid`,`dashed`,`dotted`,`double`],he=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],ge=()=>[MD,PD,$D,JD],_e=()=>[``,`none`,h,Z,X],ve=()=>[`none`,MD,Z,X],ye=()=>[`none`,MD,Z,X],be=()=>[MD,Z,X],xe=()=>[jD,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[FD],breakpoint:[FD],color:[ID],container:[FD],"drop-shadow":[FD],ease:[`in`,`out`,`in-out`],font:[VD],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[FD],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[FD],shadow:[FD],spacing:[`px`,MD],text:[FD],"text-shadow":[FD],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,jD,X,Z,_]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,Z,X]}],"container-named":[HD],columns:[{columns:[MD,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:[ND,`auto`,Z,X]}],basis:[{basis:[jD,`full`,`auto`,c,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[MD,jD,`auto`,`initial`,`none`,X]}],grow:[{grow:[``,MD,Z,X]}],shrink:[{shrink:[``,MD,Z,X]}],order:[{order:[ND,`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,ZD,WD]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,rO,KD]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,PD,X]}],"font-family":[{font:[QD,qD,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":[MD,`none`,Z,GD]}],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:[...me(),`wavy`]}],"text-decoration-thickness":[{decoration:[MD,`from-font`,`auto`,Z,WD]}],"text-decoration-color":[{decoration:O()}],"underline-offset":[{"underline-offset":[MD,`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:[ND,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`]},ND,Z,X],radial:[``,Z,X],conic:[ND,Z,X]},tO,YD]}],"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:fe()}],"rounded-s":[{"rounded-s":fe()}],"rounded-e":[{"rounded-e":fe()}],"rounded-t":[{"rounded-t":fe()}],"rounded-r":[{"rounded-r":fe()}],"rounded-b":[{"rounded-b":fe()}],"rounded-l":[{"rounded-l":fe()}],"rounded-ss":[{"rounded-ss":fe()}],"rounded-se":[{"rounded-se":fe()}],"rounded-ee":[{"rounded-ee":fe()}],"rounded-es":[{"rounded-es":fe()}],"rounded-tl":[{"rounded-tl":fe()}],"rounded-tr":[{"rounded-tr":fe()}],"rounded-br":[{"rounded-br":fe()}],"rounded-bl":[{"rounded-bl":fe()}],"border-w":[{border:pe()}],"border-w-x":[{"border-x":pe()}],"border-w-y":[{"border-y":pe()}],"border-w-s":[{"border-s":pe()}],"border-w-e":[{"border-e":pe()}],"border-w-bs":[{"border-bs":pe()}],"border-w-be":[{"border-be":pe()}],"border-w-t":[{"border-t":pe()}],"border-w-r":[{"border-r":pe()}],"border-w-b":[{"border-b":pe()}],"border-w-l":[{"border-l":pe()}],"divide-x":[{"divide-x":pe()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":pe()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...me(),`hidden`,`none`]}],"divide-style":[{divide:[...me(),`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:[...me(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[MD,Z,X]}],"outline-w":[{outline:[``,MD,ZD,WD]}],"outline-color":[{outline:O()}],shadow:[{shadow:[``,`none`,d,nO,XD]}],"shadow-color":[{shadow:O()}],"inset-shadow":[{"inset-shadow":[`none`,f,nO,XD]}],"inset-shadow-color":[{"inset-shadow":O()}],"ring-w":[{ring:pe()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:O()}],"ring-offset-w":[{"ring-offset":[MD,WD]}],"ring-offset-color":[{"ring-offset":O()}],"inset-ring-w":[{"inset-ring":pe()}],"inset-ring-color":[{"inset-ring":O()}],"text-shadow":[{"text-shadow":[`none`,p,nO,XD]}],"text-shadow-color":[{"text-shadow":O()}],opacity:[{opacity:[MD,Z,X]}],"mix-blend":[{"mix-blend":[...he(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":he()}],"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":[MD]}],"mask-image-linear-from-pos":[{"mask-linear-from":ge()}],"mask-image-linear-to-pos":[{"mask-linear-to":ge()}],"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":ge()}],"mask-image-t-to-pos":[{"mask-t-to":ge()}],"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":ge()}],"mask-image-r-to-pos":[{"mask-r-to":ge()}],"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":ge()}],"mask-image-b-to-pos":[{"mask-b-to":ge()}],"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":ge()}],"mask-image-l-to-pos":[{"mask-l-to":ge()}],"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":ge()}],"mask-image-x-to-pos":[{"mask-x-to":ge()}],"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":ge()}],"mask-image-y-to-pos":[{"mask-y-to":ge()}],"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":ge()}],"mask-image-radial-to-pos":[{"mask-radial-to":ge()}],"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":[MD]}],"mask-image-conic-from-pos":[{"mask-conic-from":ge()}],"mask-image-conic-to-pos":[{"mask-conic-to":ge()}],"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:_e()}],brightness:[{brightness:[MD,Z,X]}],contrast:[{contrast:[MD,Z,X]}],"drop-shadow":[{"drop-shadow":[``,`none`,m,nO,XD]}],"drop-shadow-color":[{"drop-shadow":O()}],grayscale:[{grayscale:[``,MD,Z,X]}],"hue-rotate":[{"hue-rotate":[MD,Z,X]}],invert:[{invert:[``,MD,Z,X]}],saturate:[{saturate:[MD,Z,X]}],sepia:[{sepia:[``,MD,Z,X]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Z,X]}],"backdrop-blur":[{"backdrop-blur":_e()}],"backdrop-brightness":[{"backdrop-brightness":[MD,Z,X]}],"backdrop-contrast":[{"backdrop-contrast":[MD,Z,X]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,MD,Z,X]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[MD,Z,X]}],"backdrop-invert":[{"backdrop-invert":[``,MD,Z,X]}],"backdrop-opacity":[{"backdrop-opacity":[MD,Z,X]}],"backdrop-saturate":[{"backdrop-saturate":[MD,Z,X]}],"backdrop-sepia":[{"backdrop-sepia":[``,MD,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:[MD,`initial`,Z,X]}],ease:[{ease:[`linear`,`initial`,v,Z,X]}],delay:[{delay:[MD,Z,X]}],animate:[{animate:[`none`,y,Z,X]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[g,Z,X]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ve()}],"rotate-x":[{"rotate-x":ve()}],"rotate-y":[{"rotate-y":ve()}],"rotate-z":[{"rotate-z":ve()}],scale:[{scale:ye()}],"scale-x":[{"scale-x":ye()}],"scale-y":[{"scale-y":ye()}],"scale-z":[{"scale-z":ye()}],"scale-3d":[`scale-3d`],skew:[{skew:be()}],"skew-x":[{"skew-x":be()}],"skew-y":[{"skew-y":be()}],transform:[{transform:[Z,X,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:xe()}],"translate-x":[{"translate-x":xe()}],"translate-y":[{"translate-y":xe()}],"translate-z":[{"translate-z":xe()}],"translate-none":[`translate-none`],zoom:[{zoom:[ND,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:[MD,ZD,WD,GD]}],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 hO(...e){return mO(HE(e))}var gO=1e3;24*(60*gO*60),30*gO;function _O(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 vO(e){let t=_O(e);return t===null?(e instanceof Error?e.message:String(e)).includes(`provider not available`):t===`no-provider`||t===`node-offline`}var yO=`text-[10px] text-foreground-subtle`;function bO(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 xO=`FEDERATION_DEBUG`,SO={AT:`@`,HYPHEN:`-`,SLASH:`/`},CO={[SO.AT]:`scope_`,[SO.HYPHEN]:`_`,[SO.SLASH]:`__`};CO[SO.AT],SO.AT,CO[SO.HYPHEN],SO.HYPHEN,CO[SO.SLASH],SO.SLASH;var wO=function(e){return e[e.UNKNOWN=1]=`UNKNOWN`,e[e.CALCULATED=2]=`CALCULATED`,e[e.NO_USE=0]=`NO_USE`,e}({}),TO=typeof ENV_TARGET<`u`?ENV_TARGET===`web`:typeof window<`u`&&window.document!==void 0;function EO(){return TO}function DO(){return typeof navigator<`u`&&navigator?.product===`ReactNative`}function OO(){try{if(EO()&&window.localStorage)return!!localStorage.getItem(xO)}catch{return!1}return!1}function kO(){return typeof process<`u`&&{}.FEDERATION_DEBUG?!!{}.FEDERATION_DEBUG:typeof FEDERATION_DEBUG<`u`&&FEDERATION_DEBUG?!0:OO()}var AO=`[ Federation Runtime ]`,jO=function(...e){return e.length?e.reduce((e,t)=>t?e?`${e}:${t}`:t:e,``):``},MO=(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!EO()&&!DO()&&`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),``},NO=e=>{console.warn(`${AO}: ${e}`)};function PO(e){try{return JSON.stringify(e,null,2)}catch{return``}}var FO=(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 IO(e){return e.replace(/#.*$/,``).replace(/\?.*$/,``).replace(/\/[^\/]+$/,`/`)}function LO(e,t={}){let{remotes:n={},overrides:r={},version:a}=t,o,s=()=>`publicPath`in e.metaData?(e.metaData.publicPath===`auto`||e.metaData.publicPath===``)&&a?IO(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:FO(u,d),remoteEntryType:f,remoteTypes:FO(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=FO(g.path,g.name);o.ssrRemoteEntry=e,o.ssrRemoteEntryType=g.type||`commonjs-module`}return o}function RO(e){return!!(`remoteEntry`in e&&e.remoteEntry.includes(`.json`))}var zO=`[ Module Federation ]`,BO=console,VO=[`logger.ts`,`logger.js`,`captureStackTrace`,`Logger.emit`,`Logger.log`,`Logger.info`,`Logger.warn`,`Logger.error`,`Logger.debug`];function HO(){try{let e=Error().stack;if(!e)return;let[,...t]=e.split(`
74
- `),n=t.filter(e=>!VO.some(t=>e.includes(t)));return n.length?`Stack trace:\n${n.slice(0,5).join(`
75
- `)}`:void 0}catch{return}}var UO=class{constructor(e,t=BO){this.prefix=e,this.delegate=t??BO}setPrefix(e){this.prefix=e}setDelegate(e){this.delegate=e??BO}emit(e,t){let n=this.delegate,r=kO()?HO():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=BO[e];if(typeof t==`function`){t.call(BO,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){kO()&&this.emit(`debug`,e)}};function WO(e){return new UO(e)}function GO(e){let t=new UO(e);return Object.defineProperty(t,"__mf_infrastructure_logger__",{value:!0,enumerable:!1,configurable:!1}),t}WO(zO),GO(zO);async function KO(e,t){try{return await e()}catch(e){!t&&NO(e);return}}function qO(e,t){let n=/^(https?:)?\/\//i;return e.replace(n,``).replace(/\/$/,``)===t.replace(n,``).replace(/\/$/,``)}function JO(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&&qO(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&&qO(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,KO(()=>{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 YO(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&&qO(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,KO(()=>{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 XO(e,t){let{attrs:n={},createScriptHook:r}=t;return new Promise((t,a)=>{let{script:o,needAttach:s}=JO({url:e,cb:t,onErrorCallback:a,attrs:{fetchpriority:`high`,...n},createScriptHook:r,needDeleteScript:!0});s&&document.head.appendChild(o)})}var ZO=new Map;function QO(e){if(!e)throw Error(`import specifier is required`);if(ZO.has(e))return ZO.get(e);let t=Function(`name`,`return import(name)`)(e).then(e=>e).catch(t=>{throw console.error(`Error importing module ${e}:`,t),ZO.delete(e),t});return ZO.set(e,t),t}var $O=async()=>{let e=await QO(`node-fetch`);return e.default||e},ek=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 $O():fetch)(e,t||{}):r},tk=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)=>ek(e,t,r):typeof fetch>`u`?$O():fetch,s=async(e,r)=>{try{let a=await(await e(r.href)).text(),[o,s]=await Promise.all([QO(`path`),QO(`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??QO}),f;f=(await QO(`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 ik(a.href,{fetch:e,vm:await QO(`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`))},nk=typeof ENV_TARGET>`u`||ENV_TARGET!==`web`?(e,t)=>new Promise((n,r)=>{tk(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`)},rk=new Map;async function ik(e,t){if(rk.has(e))return rk.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 ik(a,t)}});return rk.set(e,o),await o.link(async n=>{let r=new URL(n,e).href;return await ik(r,t)}),o}var ak=e=>`View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${e.split(`-`)[0].toLowerCase()}#${e.toLowerCase()}`,ok=(e,t,n,r)=>{let a=[`${[t[e]]} #${e}`];return n&&a.push(`args: ${JSON.stringify(n)}`),a.push(ak(e)),r&&a.push(`Original Error Message:\n ${r}`),a.join(`
76
- `)};function sk(e,t,n,r,a,o){return r(ok(e,t,n,a))}var ck=`[ Federation Runtime ]`,lk=WO(ck);function uk(e,t,n,r,a){e||(n===void 0?dk(t):dk(t,n,r,void 0,a))}function dk(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 fk(e){e instanceof Error&&(e.message.startsWith(ck)||(e.message=`${ck}: ${e.message}`)),lk.warn(e)}function pk(e,t){return e.findIndex(e=>e===t)===-1&&e.push(t),e}function mk(e){return`version`in e&&e.version?`${e.name}:${e.version}`:`entry`in e&&e.entry?`${e.name}:${e.entry}`:`${e.name}`}function hk(e){return e.entry!==void 0}function gk(e){return!e.entry.includes(`.json`)}function _k(e){return e&&typeof e==`object`}var vk=Object.prototype.toString;function yk(e){return vk.call(e)===`[object Object]`}function bk(e){return Array.isArray(e)?e:[e]}function xk(e){let t={url:``,type:`global`,globalName:``};return TO||DO()||!(`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 Sk=(e,t)=>{let n;return n=e.endsWith(`/`)?e.slice(0,-1):e,t.startsWith(`.`)&&(t=t.slice(1)),n+=t,n},Ck=typeof globalThis==`object`?globalThis:window,wk=(()=>{try{return document.defaultView}catch{return Ck}})(),Tk=wk;function Ek(e,t,n){Object.defineProperty(e,t,{value:n,configurable:!1,writable:!0})}function Dk(e,t){return Object.hasOwnProperty.call(e,t)}Dk(Ck,`__GLOBAL_LOADING_REMOTE_ENTRY__`)||Ek(Ck,`__GLOBAL_LOADING_REMOTE_ENTRY__`,{});var Ok=Ck.__GLOBAL_LOADING_REMOTE_ENTRY__;function kk(e){Dk(e,`__VMOK__`)&&!Dk(e,`__FEDERATION__`)&&Ek(e,`__FEDERATION__`,e.__VMOK__),Dk(e,`__FEDERATION__`)||(Ek(e,`__FEDERATION__`,{__GLOBAL_PLUGIN__:[],__INSTANCES__:[],moduleInfo:{},__SHARE__:{},__MANIFEST_LOADING__:{},__PRELOADED_MAP__:new Map}),Ek(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}kk(Ck),kk(wk);function Ak(e,t=kO()){t&&(Ck.__FEDERATION__.__DEBUG_CONSTRUCTOR__=e,Ck.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__=`2.5.1`)}function jk(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 dk(`getInfoWithoutType: "key" must be a string, got ${typeof t} (${JSON.stringify(t)}).`)}var Mk=()=>wk.__FEDERATION__.moduleInfo,Nk=(e,t)=>{let n=jk(t,mk(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=mk(n),a=jk(wk.__FEDERATION__.moduleInfo,r).value;if(a?.version===t)return a}},Pk=e=>Nk(e,wk.__FEDERATION__.moduleInfo),Fk=(e,t)=>{let n=mk(e);return wk.__FEDERATION__.moduleInfo[n]=t,wk.__FEDERATION__.moduleInfo},Ik=e=>(wk.__FEDERATION__.moduleInfo={...wk.__FEDERATION__.moduleInfo,...e},()=>{let t=Object.keys(e);for(let e of t)delete wk.__FEDERATION__.moduleInfo[e]}),Lk=(e,t)=>{let n=t||`__FEDERATION_${e}:custom__`;return{remoteEntryKey:n,entryExports:Ck[n]}},Rk=()=>wk.__FEDERATION__.__GLOBAL_PLUGIN__,zk=e=>Ck.__FEDERATION__.__PRELOADED_MAP__.get(e),Bk=e=>Ck.__FEDERATION__.__PRELOADED_MAP__.set(e,!0),Vk=`[0-9A-Za-z-]+`,Hk=`(?:\\+(${Vk}(?:\\.${Vk})*))`,Uk=`0|[1-9]\\d*`,Wk=`[0-9]+`,Gk=`\\d*[a-zA-Z-][a-zA-Z0-9-]*`,Kk=`(?:${Wk}|${Gk})`,qk=`(?:-?(${Kk}(?:\\.${Kk})*))`,Jk=`(?:${Uk}|${Gk})`,Yk=`(?:-(${Jk}(?:\\.${Jk})*))`,Xk=`${Uk}|x|X|\\*`,Zk=`[v=\\s]*(${Xk})(?:\\.(${Xk})(?:\\.(${Xk})(?:${Yk})?${Hk}?)?)?`,Qk=`^\\s*(${Zk})\\s+-\\s+(${Zk})\\s*$`,$k=`[v=\\s]*${`(${Wk})\\.(${Wk})\\.(${Wk})`}${qk}?${Hk}?`,eA=`((?:<|>)?=?)`,tA=`(\\s*)${eA}\\s*(${$k}|${Zk})`,nA=`(?:~>?)`,rA=`(\\s*)${nA}\\s+`,iA=`(?:\\^)`,aA=`(\\s*)${iA}\\s+`,oA=`(<|>)?=?\\s*\\*`,sA=`^${iA}${Zk}$`,cA=`v?${`(${Uk})\\.(${Uk})\\.(${Uk})`}${Yk}?${Hk}?`,lA=`^${nA}${Zk}$`,uA=`^${eA}\\s*${Zk}$`,dA=`^${eA}\\s*(${cA})$|^$`,fA=`^\\s*>=\\s*0.0.0\\s*$`;function pA(e){return new RegExp(e)}function mA(e){return!e||e.toLowerCase()===`x`||e===`*`}function hA(...e){return t=>e.reduce((e,t)=>t(e),t)}function gA(e){return e.match(pA(dA))}function _A(e,t,n,r){let a=`${e}.${t}.${n}`;return r?`${a}-${r}`:a}function vA(e){return e.replace(pA(Qk),(e,t,n,r,a,o,s,c,l,u,d,f)=>(t=mA(n)?``:mA(r)?`>=${n}.0.0`:mA(a)?`>=${n}.${r}.0`:`>=${t}`,c=mA(l)?``:mA(u)?`<${Number(l)+1}.0.0-0`:mA(d)?`<${l}.${Number(u)+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:`<=${c}`,`${t} ${c}`.trim()))}function yA(e){return e.replace(pA(tA),`$1$2$3`)}function bA(e){return e.replace(pA(rA),`$1~`)}function xA(e){return e.replace(pA(aA),`$1^`)}function SA(e){return e.trim().split(/\s+/).map(e=>e.replace(pA(sA),(e,t,n,r,a)=>mA(t)?``:mA(n)?`>=${t}.0.0 <${Number(t)+1}.0.0-0`:mA(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 CA(e){return e.trim().split(/\s+/).map(e=>e.replace(pA(lA),(e,t,n,r,a)=>mA(t)?``:mA(n)?`>=${t}.0.0 <${Number(t)+1}.0.0-0`:mA(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 wA(e){return e.split(/\s+/).map(e=>e.trim().replace(pA(uA),(e,t,n,r,a,o)=>{let s=mA(n),c=s||mA(r),l=c||mA(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 TA(e){return e.trim().replace(pA(oA),``)}function EA(e){return e.trim().replace(pA(fA),``)}function DA(e,t){return e=Number(e)||e,t=Number(t)||t,e>t?1:e===t?0:-1}function OA(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?DA(t,a):-1:1}return 0}function kA(e,t){return DA(e.major,t.major)||DA(e.minor,t.minor)||DA(e.patch,t.patch)||OA(e,t)}function AA(e,t){return e.version===t.version}function jA(e,t){switch(e.operator){case``:case`=`:return AA(e,t);case`>`:return kA(e,t)<0;case`>=`:return AA(e,t)||kA(e,t)<0;case`<`:return kA(e,t)>0;case`<=`:return AA(e,t)||kA(e,t)>0;case void 0:return!0;default:return!1}}function MA(e){return hA(SA,CA,wA,TA)(e)}function NA(e){return hA(vA,yA,bA,xA)(e.trim()).split(/\s+/).join(` `)}function PA(e,t){if(!e)return!1;let n=gA(e);if(!n)return!1;let[,r,,a,o,s,c]=n,l={operator:r,version:_A(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=NA(t);if(!e.trim())return!0;let n=e.split(` `).map(e=>MA(e)).join(` `);if(!n.trim())return!0;let r=n.split(/\s+/).map(e=>EA(e)).filter(Boolean);if(r.length===0)continue;let a=!0;for(let e of r){let t=gA(e);if(!t){a=!1;break}let[,n,,r,o,s,c]=t;if(!jA({operator:n,version:_A(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 FA=`default`,IA=`global`;function LA(e,t,n,r){let a;return a=`get`in e?e.get:`lib`in e?()=>Promise.resolve(e.lib):()=>Promise.resolve(()=>{dk(`Cannot get shared "${n}" from "${t}": neither "get" nor "lib" is provided in the share config.`)}),e.shareConfig?.eager&&e.treeShaking?.mode&&dk(`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??wO.UNKNOWN,useIn:[]}:void 0}}function RA(e,t){let n=t.shared||{},r=t.name,a=Object.keys(n).reduce((e,a)=>{let o=bk(n[a]);return e[a]=e[a]||[],o.forEach(n=>{e[a].push(LA(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 zA(e,t){if(!e)return!1;let{status:n,mode:r}=e;return n===wO.NO_USE?!1:n===wO.CALCULATED?!0:r===`runtime-infer`?t?WA(e,t):!0:!1}function BA(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!!PA(n(e),`<=${n(t)}`)}var VA=(e,t)=>{let n=t||function(e,t){return BA(e,t)};return Object.keys(e).reduce((e,t)=>!e||n(e,t)||e===`0`?t:e,0)},HA=e=>!!e.loaded||typeof e.lib==`function`,UA=e=>!!e.loading,WA=(e,t)=>{if(!e||!t)return!1;let{usedExports:n}=e;return n?!!t.every(e=>n.includes(e)):!1};function GA(e,t,n,r){let a=e[t][n],o=``,s=zA(r),c=function(e,t){return s?a[e].treeShaking?a[t].treeShaking?!HA(a[e].treeShaking)&&BA(e,t):!1:!0:!HA(a[e])&&BA(e,t)};if(s){if(o=VA(e[t][n],c),o)return{version:o,useTreesShaking:s};s=!1}return{version:VA(e[t][n],c),useTreesShaking:s}}var KA=e=>HA(e)||UA(e);function qA(e,t,n,r){let a=e[t][n],o=``,s=zA(r),c=function(e,t){if(s){if(!a[e].treeShaking)return!0;if(!a[t].treeShaking)return!1;if(KA(a[t].treeShaking))return KA(a[e].treeShaking)?!!BA(e,t):!0;if(KA(a[e].treeShaking))return!1}return KA(a[t])?KA(a[e])?!!BA(e,t):!0:KA(a[e])?!1:BA(e,t)};if(s){if(o=VA(e[t][n],c),o)return{version:o,useTreesShaking:s};s=!1}return{version:VA(e[t][n],c),useTreesShaking:s}}function JA(e){return e===`loaded-first`?qA:GA}function YA(e,t,n,r){if(!e)return;let{shareConfig:a,scope:o=FA,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}=JA(s)(e,o,t,c),f={shareScopeMap:e,scope:o,pkgName:t,version:u,GlobalFederation:Tk.__FEDERATION__,shareInfo:n,resolver:()=>{let r=e[o][t][u];if(a.singleton){if(typeof l==`string`&&!PA(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?dk(e):fk(e)}return{shared:r,useTreesShaking:d}}else{if(l===!1||l===`*`||PA(u,l))return{shared:r,useTreesShaking:d};let n=zA(c);if(n){for(let[r,a]of Object.entries(e[o][t]))if(zA(a.treeShaking,c?.usedExports)&&PA(r,l))return{shared:a,useTreesShaking:n}}for(let[n,r]of Object.entries(e[o][t]))if(PA(n,l))return{shared:r,useTreesShaking:!1}}}};return(r.emit(f)||f).resolver()}}function XA(){return Tk.__FEDERATION__.__SHARE__}function ZA(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[VA(t,function(e,n){return!HA(t[e])&&BA(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 QA=(e,t)=>{e.useIn||=[],pk(e.useIn,t)};function $A(e,t){return t&&e.treeShaking?e.treeShaking:e}function ej(e,t){return!t||t===`.`?e:`${e}/${t.replace(/^\.\//,``)}`}function tj(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 nj(e,t){for(let n of e)if(t===n.name||n.alias&&t===n.alias)return n}var rj=`RUNTIME-001`,ij=`RUNTIME-002`,aj=`RUNTIME-003`,oj=`RUNTIME-004`,sj=`RUNTIME-005`,cj=`RUNTIME-006`,lj=`RUNTIME-007`,uj=`RUNTIME-008`,dj=`RUNTIME-009`,fj=`RUNTIME-010`,pj=`RUNTIME-011`,mj=`RUNTIME-012`,hj=`RUNTIME-013`,gj=`RUNTIME-014`,_j=`RUNTIME-015`,vj=`TYPE-001`,yj=`BUILD-001`,bj=`BUILD-002`,xj={[rj]:`Failed to get remoteEntry exports.`,[ij]:`The remote entry interface does not contain "init"`,[aj]:`Failed to get manifest.`,[oj]:`Failed to locate remote.`,[sj]:`Invalid loadShareSync function call from bundler runtime`,[cj]:`Invalid loadShareSync function call from runtime`,[lj]:`Failed to get remote snapshot.`,[uj]:`Failed to load script resources.`,[dj]:`Please call createInstance first.`,[fj]:`The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use "createInstance" api.`,[pj]:`The remoteEntry URL is missing from the remote snapshot.`,[mj]:`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.`,[hj]:`The manifest is not a valid Module Federation manifest.`,[gj]:`The remote does not expose the requested module.`,[_j]:`Remote container initialization failed.`},Sj={[vj]:`Failed to generate type declaration. Execute the below cmd to reproduce and fix the error.`},Cj={[yj]:`Failed to find expose module.`,[bj]:`PublicPath is required in prod mode.`};({...xj,...Sj,...Cj});var wj=`.then(callbacks[0]).catch(callbacks[1])`;async function Tj({entry:e,remoteEntryExports:t}){return new Promise((n,r)=>{try{t?n(t):typeof FEDERATION_ALLOW_NEW_FUNCTION<`u`?Function(`callbacks`,`import("${e}")${wj}`)([n,r]):BE(()=>import(e).then(n),[],import.meta.url).catch(r)}catch(t){dk(`Failed to load ESM entry from "${e}". ${t instanceof Error?t.message:String(t)}`)}})}async function Ej({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}")${wj}`)([n,r])}catch(t){dk(`Failed to load SystemJS entry from "${e}". ${t instanceof Error?t.message:String(t)}`)}})}function Dj(e,t,n){let{remoteEntryKey:r,entryExports:a}=Lk(e,t);return a||dk(rj,xj,{remoteName:e,remoteEntryUrl:n,remoteEntryKey:r}),a}async function Oj({name:e,globalName:t,entry:n,remoteInfo:r,loaderHook:a,getEntryUrl:o,resourceContext:s}){let{entryExports:c}=Lk(e,t);if(c)return c;let l=o?o(n):n;return XO(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(()=>Dj(e,t,n),t=>{let n=t instanceof Error?t.message:String(t);dk(uj,xj,{remoteName:e,resourceUrl:l},n)})}async function kj({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 Tj({entry:o,remoteEntryExports:t});case`system`:return Ej({entry:o,remoteEntryExports:t});default:return Oj({entry:o,globalName:s,name:c,remoteInfo:e,loaderHook:n,getEntryUrl:r,resourceContext:a})}}async function Aj({remoteInfo:e,loaderHook:t,resourceContext:n}){let{entry:r,entryGlobalName:a,name:o,type:s}=e,{entryExports:c}=Lk(o,a);return c||nk(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(()=>Dj(o,a,r)).catch(e=>{dk(`Failed to load Node.js entry for remote "${o}" from "${r}". ${e instanceof Error?e.message:String(e)}`)})}function jj(e){let{entry:t,name:n}=e;return jO(n,t)}async function Mj(e){let{origin:t,remoteEntryExports:n,remoteInfo:r,getEntryUrl:a,resourceContext:o,_inErrorHandling:s=!1}=e,c=jj(r);if(n)return n;if(!Ok[c]){let e=t.remoteHandler.hooks.lifecycle.loadEntry,l=t.loaderHook;Ok[c]=e.emit({origin:t,loaderHook:l,remoteInfo:r,remoteEntryExports:n}).then(e=>e||((typeof ENV_TARGET<`u`?ENV_TARGET===`web`:TO)?kj({remoteInfo:r,remoteEntryExports:n,loaderHook:l,getEntryUrl:a,resourceContext:o}):Aj({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=jj(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=>Mj({...e,_inErrorHandling:!0}),origin:t,remoteInfo:r,remoteEntryExports:n,globalLoading:Ok,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 Ok[c]}function Nj(e){return{...e,entry:`entry`in e?e.entry:``,type:e.type||`global`,entryGlobalName:e.entryGlobalName||e.name,shareScope:e.shareScope||`default`}}function Pj(){return typeof FEDERATION_BUILD_IDENTIFIER<`u`?FEDERATION_BUILD_IDENTIFIER:``}function Fj(e,t){let n=Rk(),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 Ij(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 Lj(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(Ij)??[],shared:t}}}function Rj(e){return{resourceCategory:`sync`,share:!0,depsRemote:!0,...e}}function zj(e,t){return t.map(t=>{let n=nj(e,t.nameOrAlias);return uk(n,`Unable to preload ${t.nameOrAlias} as it is not included in ${!n&&PO({remoteInfo:n,remotes:e})}`),{remote:n,preloadConfig:Rj(t)}})}function Bj(e){return e?e.map(e=>e===`.`?e:e.startsWith(`./`)?e.replace(`./`,``):e):[]}function Vj(e){return e instanceof Error?e.message.includes(`timed out`)||e.name.includes(`Timeout`):!1}function Hj(e,t,n,r){return{url:t,status:n,resourceType:e.resourceType,initiator:e.initiator,id:e.id,error:r}}async function Uj(e,t,n,r){let a=e.moduleCache.get(n.name),o=n.entry;if(a?.remoteEntryExports)return Hj(r,o,`cached`);try{if(!await Mj({origin:e,remoteInfo:n,remoteEntryExports:a?.remoteEntryExports,resourceContext:{...r,url:o}}))throw Error(`Failed to load remoteEntry "${o}".`);return Hj(r,o,`success`)}catch(e){return Hj(r,o,Vj(e)?`timeout`:`error`,e)}}function Wj({host:e,remoteInfo:t,url:n,attrs:r,context:a,needDeleteLink:o}){return new Promise(s=>{let{link:c,needAttach:l}=YO({url:n,cb:()=>{s(Hj(a,n,l?`success`:`cached`))},onErrorCallback:e=>{s(Hj(a,n,Vj(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 Gj({host:e,remoteInfo:t,url:n,attrs:r,context:a}){return new Promise(o=>{let{script:s,needAttach:c}=JO({url:n,cb:()=>{o(Hj(a,n,c?`success`:`cached`))},onErrorCallback:e=>{o(Hj(a,n,Vj(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 Kj(e,t){return{...e,resourceType:t}}function qj(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(Uj(t,e,r,Kj(a,`remoteEntry`)))}),r){let n={rel:`preload`,as:`style`};o.forEach(r=>{l.push(Wj({host:t,remoteInfo:e,url:r,attrs:n,context:Kj(a,`css`)}))})}else{let n={rel:`stylesheet`,type:`text/css`};o.forEach(r=>{l.push(Wj({host:t,remoteInfo:e,url:r,attrs:n,needDeleteLink:!1,context:Kj(a,`css`)}))})}if(r){let n={rel:`preload`,as:`script`};s.forEach(r=>{l.push(Wj({host:t,remoteInfo:e,url:r,attrs:n,context:Kj(a,`js`)}))})}else{let n={fetchpriority:`high`,type:e?.type===`module`?`module`:`text/javascript`};s.forEach(r=>{l.push(Gj({host:t,remoteInfo:e,url:r,attrs:n,context:Kj(a,`js`)}))})}}return Promise.all(l)}function Jj(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 Yj(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 Xj=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 Mj({origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports,resourceContext:{initiator:`loadRemote`,id:ej(this.remoteInfo.name,e),resourceType:`remoteEntry`}});return uk(t,`remoteEntryExports is undefined \n ${PO(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}=Yj(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&&dk(ij,xj,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName},void 0,Lj(this.host.options));try{await a.init(c.shareScope,c.initScope,c.remoteEntryInitOptions)}catch(e){dk(_j,xj,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName,shareScope:this.remoteInfo.shareScope},`${e}`,Lj(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||dk(gj,xj,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,expose:t,requestId:e,availableExposes:Jj(r)},void 0,Lj(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=Sk(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)}}},Zj=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()}},Qj=class extends Zj{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 $j(e,t){if(!_k(t))return!1;if(e!==t){for(let n in e)if(!(n in t))return!1}return!0}var eM=class extends Zj{constructor(e){super(),this.onerror=dk,this.type=e}emit(e){_k(e)||dk(`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($j(e,n))e=n;else{this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);break}}catch(e){fk(e),this.onerror(e)}return e}},tM=class extends Zj{constructor(e){super(),this.onerror=dk,this.type=e}emit(e){_k(e)||dk(`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=>(fk(t),this.onerror(t),e),a=o=>{if(o!==void 0&&$j(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)}},nM=class{constructor(e){this.registerPlugins={},this.lifecycle=e,this.lifecycleKeys=Object.keys(e)}applyPlugin(e,t){uk(yk(e),`Plugin configuration is invalid.`);let n=e.name;uk(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){uk(e,`A name is required.`);let t=this.registerPlugins[e];uk(t,`The plugin "${e}" is not registered.`),Object.keys(t).forEach(e=>{e!==`name`&&this.lifecycle[e].remove(t[e])})}};function rM(e,t){let n=xk(t);n.url||dk(pj,xj,{remoteName:e.name});let r=MO(t,n.url);!TO&&!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 iM(){return{name:`snapshot-plugin`,async afterResolve(e){let{remote:t,pkgNameOrAlias:n,expose:r,origin:a,remoteInfo:o,id:s}=e;if(!hk(t)||!gk(t)){let{remoteSnapshot:c,globalSnapshot:l}=await a.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:t,id:ej(t.name,r)});rM(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&&qj(o,a,d,!1,{initiator:`loadRemote`,id:s}).catch(()=>void 0),{...e,remoteSnapshot:c}}return e}}}function aM(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 oM(e,t,n,r,a={},o){let{value:s}=jk(e,mk(t)),c=o||s;if(c&&!RO(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=aM(r),o=c.remotesInfo[r];oM(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(oM(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=Rj(e)}else if(p===!0)a=f;else return;let l=MO(t,xk(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=Bj(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=>MO(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}),!zk(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))),Bk(l))}}},!0,{},a),a.shared&&a.shared.length>0){let t=(t,n)=>{let{shared:r}=YA(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&&bk(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 lM=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 TO?hk(a)&&gk(a)?{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[{name:a.name,url:a.entry,moduleInfo:{name:r.name,entry:a.entry,type:r.type||`global`,entryGlobalName:``,shareScope:``}}]}:(rM(r,s),cM(t,n,r,o,s)):{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[]}}}};function uM(e,t){let n=Pk({name:t.name,version:t.options.version}),r=n&&`remotesInfo`in n&&n.remotesInfo&&jk(n.remotesInfo,e.name).value;return r&&r.matchedVersion?{hostGlobalSnapshot:n,globalSnapshot:Mk(),remoteSnapshot:Pk({name:e.name,version:r.matchedVersion})}:{hostGlobalSnapshot:void 0,globalSnapshot:Mk(),remoteSnapshot:Pk({name:e.name,version:`version`in e?e.version:void 0})}}var dM=class{constructor(e){this.loadingHostSnapshot=null,this.manifestCache=new Map,this.hooks=new nM({beforeLoadRemoteSnapshot:new Qj(`beforeLoadRemoteSnapshot`),loadSnapshot:new tM(`loadGlobalSnapshot`),loadRemoteSnapshot:new tM(`loadRemoteSnapshot`),afterLoadSnapshot:new tM(`afterLoadSnapshot`)}),this.manifestLoading=Tk.__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=Pk({name:this.HostInstance.options.name,version:this.HostInstance.options.version});a||(a={version:this.HostInstance.options.version||``,remoteEntry:``,remotesInfo:{}},Ik({[this.HostInstance.options.name]:a})),a&&`remotesInfo`in a&&!jk(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(RO(l)){let r=TO?l.remoteEntry:l.ssrRemoteEntry||l.remoteEntry||``,a=await this.loadManifestSnapshot(r,e,{},{initiator:n,id:t||e.name}),o=Fk({...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(hk(e)){let r=await this.loadManifestSnapshot(e.entry,e,{},{initiator:n,id:t||e.name}),a=Fk(e,r);d=r,f=a}else dk(lj,xj,{remoteName:e.name,remoteVersion:e.version,hostName:this.HostInstance.options.name,globalSnapshot:JSON.stringify(u)},void 0,Lj(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 uM(e,this.HostInstance)}async getManifestJson(e,t,n,r){return(async()=>{let n=Nj(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],dk(aj,xj,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name},`${r}`,Lj(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&&dk(hj,xj,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name,missingFields:o.join(`,`)},void 0,Lj(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=LO(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]}},fM=class{constructor(e){this.hooks=new nM({beforeRegisterShare:new eM(`beforeRegisterShare`),afterResolve:new tM(`afterResolve`),beforeLoadShare:new tM(`beforeLoadShare`),loadShare:new Qj,afterLoadShare:new Zj(`afterLoadShare`),errorLoadShare:new Zj(`errorLoadShare`),resolveShare:new eM(`resolveShare`),initContainerShareScopeMap:new eM(`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){fk(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){fk(e)}}registerShared(e,t){let{newShareInfos:n,allShareInfos:r}=RA(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=ZA({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,uk(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}=YA(this.shareScopeMap,e,a,this.hooks.lifecycle.resolveShare)||{};if(s){let t=$A(s,c);if(t.lib)return QA(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,QA(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 QA(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=zA(o.treeShaking),a=$A(o,r),s=(async()=>{let t=await a.get();a.lib=t,a.loaded=!0,QA(a,n.options.name);let{shared:r,useTreesShaking:s}=YA(this.shareScopeMap,e,o,this.hooks.lifecycle.resolveShare)||{};if(r){let e=$A(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=FA,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]&&$A(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=ZA({pkgName:e,extraOptions:t,shareInfos:n.options.shared});try{r?.scope&&r.scope.forEach(e=>{this.initializeSharing(e,{strategy:r.strategy})});let{shared:a}=YA(this.shareScopeMap,e,r,this.hooks.lifecycle.resolveShare)||{};if(a){if(typeof a.lib==`function`)return QA(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 QA(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&&dk(t?.from===`build`?sj:cj,xj,{hostName:n.options.name,sharedPkgName:e},void 0,Lj(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}dk(cj,xj,{hostName:n.options.name,sharedPkgName:e},void 0,Lj(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=XA(),n=e.id||e.name;n&&!t[n]&&(t[n]=this.shareScopeMap)}},pM=class{constructor(e){this.hooks=new nM({beforeRegisterRemote:new eM(`beforeRegisterRemote`),registerRemote:new eM(`registerRemote`),beforeRequest:new tM(`beforeRequest`),afterMatchRemote:new Qj(`afterMatchRemote`),onLoad:new Qj(`onLoad`),afterLoadRemote:new Qj(`afterLoadRemote`),handlePreloadModule:new Zj(`handlePreloadModule`),errorLoadRemote:new Qj(`errorLoadRemote`),beforePreloadRemote:new Qj(`beforePreloadRemote`),generatePreloadAssets:new Qj(`generatePreloadAssets`),afterPreloadRemote:new Qj(`afterPreloadRemote`),loadEntry:new Qj}),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=tj(n.options.remotes,e),a=e,o=r?.expose,s=r?Nj(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=Nj(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=zj(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:ej(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=Nj(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 qj(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=tj(t.options.remotes,a);if(!o)try{dk(oj,xj,{hostName:t.options.name,requestId:a},void 0,Lj(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=Nj(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;uk(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 Xj(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)));uk(!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&&TO&&typeof window<`u`&&!e.entry.startsWith(`http`)&&(e.entry=new URL(e.entry,window.location.origin).href),e.shareScope||=FA,e.type||=IA};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}),NO(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;Ck[r]&&(Object.getOwnPropertyDescriptor(Ck,r)?.configurable?delete Ck[r]:Ck[r]=void 0);let o=jj(a.remoteInfo);Ok[o]&&delete Ok[o],t.snapshotHandler.manifestCache.delete(n.entry);let s=n.buildVersion?jO(n.name,n.buildVersion):n.name,c=Ck.__FEDERATION__.__INSTANCES__.findIndex(e=>n.buildVersion?e.options.id===s:e.name===s);if(c!==-1){let e=Ck.__FEDERATION__.__INSTANCES__[c];s=e.options.id||s;let t=XA(),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]}),Ck.__FEDERATION__.__INSTANCES__.splice(c,1)}let{hostGlobalSnapshot:l}=uM(e,t);if(l){let t=l&&`remotesInfo`in l&&l.remotesInfo&&jk(l.remotesInfo,e.name).key;t&&(delete l.remotesInfo[t],Tk.__FEDERATION__.__MANIFEST_LOADING__[t]&&delete Tk.__FEDERATION__.__MANIFEST_LOADING__[t])}t.moduleCache.delete(e.name)}}catch(e){lk.error(`removeRemote failed: ${e instanceof Error?e.message:String(e)}`)}}},mM=typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN==`boolean`?!FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN:!0;Ak(class{constructor(e){this.hooks=new nM({beforeInit:new eM(`beforeInit`),init:new Zj,beforeInitContainer:new tM(`beforeInitContainer`),initContainer:new tM(`initContainer`)}),this.version=`2.5.1`,this.moduleCache=new Map,this.loaderHook=new nM({getModuleInfo:new Zj,createScript:new Zj,createLink:new Zj,fetch:new Qj,loadEntryError:new Qj,afterLoadEntry:new Qj(`afterLoadEntry`),beforeInitRemote:new Qj(`beforeInitRemote`),afterInitRemote:new Qj(`afterInitRemote`),beforeGetExpose:new Qj(`beforeGetExpose`),afterGetExpose:new Qj(`afterGetExpose`),beforeExecuteFactory:new Qj(`beforeExecuteFactory`),afterExecuteFactory:new Qj(`afterExecuteFactory`),getModuleFactory:new Qj}),this.bridgeHook=new nM({beforeBridgeRender:new Zj,afterBridgeRender:new Zj,beforeBridgeDestroy:new Zj,afterBridgeDestroy:new Zj});let t=mM?[iM(),lM()]:[],n={id:Pj(),name:e.name,plugins:t,remotes:[],shared:{},inBrowser:TO};this.name=e.name,this.options=n,this.snapshotHandler=new dM(this),this.sharedHandler=new fM(this),this.remoteHandler=new pM(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&&dk(ok(fj,xj)),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=FA,t){return this.sharedHandler.initializeSharing(e,t)}initRawContainer(e,t,n){let r=Nj({name:e,entry:t}),a=new Xj({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}=RA(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=Fj(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 hM=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),gM=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),_M=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),vM=e=>{let t=_M(e);return t.charAt(0).toUpperCase()+t.slice(1)},yM={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`},bM=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},xM=(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,...yM,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:hM(`lucide`,a),...!o&&!bM(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)(xM,{ref:a,iconNode:t,className:hM(`lucide-${gM(vM(e))}`,`lucide-${e}`,n),...r}));return n.displayName=vM(e),n},SM=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 CM=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 wM=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`}]]),TM=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`}]]),EM=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`}]]),DM=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 OM=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 kM=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 AM=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 jM=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 MM=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 NM=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 PM=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 FM=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 IM=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 LM=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 RM=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 zM=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 BM=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 VM=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 HM=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 UM=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 WM=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 GM=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 KM=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 qM=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 JM=Q(`thermometer`,[[`path`,{d:`M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z`,key:`17jzev`}]]),YM=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`}]]),XM=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`}]]),ZM=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 QM=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 $M=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 eN=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 tN=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,nN=HE,rN=(e,t)=>n=>{if(t?.variants==null)return nN(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=tN(t)||tN(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 nN(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)},iN=rN(`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`}}),aN=(0,x.forwardRef)(({className:e,variant:t,size:n,...r},a)=>(0,S.jsx)(`button`,{ref:a,className:hO(iN({variant:t,size:n}),e),...r}));aN.displayName=`Button`;var oN=rN(`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:hO(oN({variant:t,size:n}),e),...a,children:(0,S.jsx)(r,{className:`h-4 w-4`})}));sN.displayName=`IconButton`;var cN=rN(`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`}}),lN=(0,x.forwardRef)(({className:e,variant:t,style:n,...r},a)=>(0,S.jsx)(`span`,{ref:a,className:hO(cN({variant:t,styleVariant:n}),e),...r}));lN.displayName=`Badge`;var uN=rN(`rounded-lg p-3`,{variants:{variant:{flat:`bg-surface`,bordered:`bg-surface border border-border`}},defaultVariants:{variant:`bordered`}}),dN=(0,x.forwardRef)(({className:e,variant:t,...n},r)=>(0,S.jsx)(`div`,{ref:r,className:hO(uN({variant:t}),e),...n}));dN.displayName=`Card`;var fN=(0,x.forwardRef)(({className:e,...t},n)=>(0,S.jsx)(`label`,{ref:n,className:hO(`text-[10px] uppercase tracking-wider text-foreground-muted font-medium`,e),...t}));fN.displayName=`Label`;var pN=rN(``,{variants:{orientation:{horizontal:`h-px w-full bg-border-subtle`,vertical:`w-px h-full bg-border-subtle`}},defaultVariants:{orientation:`horizontal`}}),mN=(0,x.forwardRef)(({className:e,orientation:t,...n},r)=>(0,S.jsx)(`div`,{ref:r,role:`separator`,className:hO(pN({orientation:t}),e),...n}));mN.displayName=`Separator`;var hN=(0,x.forwardRef)(({className:e,...t},n)=>(0,S.jsx)(`div`,{ref:n,className:hO(`animate-pulse bg-surface-hover rounded-md h-4 w-full`,e),...t}));hN.displayName=`Skeleton`;var gN=rN(`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`}}),_N=(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:hO(gN({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:hO(gN({state:t}),e),...a}));_N.displayName=`Input`;var vN=(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:hO(`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)(kM,{className:`h-3.5 w-3.5`})})]}));vN.displayName=`Select`;var yN=(0,x.forwardRef)(({className:e,...t},n)=>(0,S.jsx)(`input`,{ref:n,type:`checkbox`,className:hO(`w-3.5 h-3.5 rounded-sm border border-border accent-primary`,e),...t}));yN.displayName=`Checkbox`;var bN=(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:hO(`inline-flex items-center gap-2`,e),...a,children:[(0,S.jsx)(`span`,{className:hO(`w-8 h-4 rounded-full transition-colors`,t?`bg-primary`:`bg-surface-hover`),children:(0,S.jsx)(`span`,{className:hO(`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})]}));bN.displayName=`Switch`;var xN=(0,x.createContext)(null);function SN(){let e=(0,x.useContext)(xN);if(!e)throw Error(`Dialog compound components must be used within <Dialog>`);return e}var CN=rN(`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`}}),wN=(0,x.forwardRef)(({className:e,width:t,children:n,...r},a)=>{let{open:o,setOpen:s,contentId:c}=SN(),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:hO(CN({width:t}),e),onClick:e=>{e.target===e.currentTarget&&s(!1)},onClose:()=>s(!1),...r,children:n})});wN.displayName=`DialogContent`,(0,x.createContext)(null),(0,x.createContext)(null),(0,x.createContext)(null),(0,x.createContext)(null);var TN=(0,x.forwardRef)(({className:e,...t},n)=>(0,S.jsx)(`div`,{ref:n,className:hO(`overflow-auto [&::-webkit-scrollbar]:w-1 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:bg-surface-hover [&::-webkit-scrollbar-thumb]:rounded-full`,e),...t}));TN.displayName=`ScrollArea`;var EN=typeof globalThis<`u`?globalThis.__camstackTrpcReact:void 0,$=EN??Oi();typeof globalThis<`u`&&!EN&&(globalThis.__camstackTrpcReact=$);var DN=bO(`camstack:system`,null);function ON({system:e,children:t}){return(0,S.jsx)(DN.Provider,{value:e,children:t})}function kN(){let e=(0,x.useContext)(DN);if(!e)throw Error(`useSystem(): no <SystemProvider> in tree`);return e}function AN(e,t){let n=kN(),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])}bO(`camstack:confirm-dialog`,null);var jN=`capability.binding-changed`;function MN(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:jN},{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?T_(e,n):null,[e,n])}var NN={[K.Camera]:{icon:OM,label:`Camera`},[K.Hub]:{icon:BM,label:`Hub`},[K.Light]:{icon:IM,label:`Light`},[K.Siren]:{icon:GM,label:`Siren`},[K.Switch]:{icon:YM,label:`Switch`},[K.Sensor]:{icon:SM,label:`Sensor`},[K.Thermostat]:{icon:JM,label:`Thermostat`},[K.Button]:{icon:jM,label:`Button`},[K.EventEmitter]:{icon:eN,label:`Event Emitter`},[K.Update]:{icon:HM,label:`Update`},[K.Generic]:{icon:DM,label:`Generic`},[K.Notifier]:{icon:wM,label:`Notifier`},[K.Script]:{icon:UM,label:`Script`},[K.Automation]:{icon:$M,label:`Automation`},[K.Lock]:{icon:LM,label:`Lock`},[K.Cover]:{icon:TM,label:`Cover`},[K.Valve]:{icon:VM,label:`Valve`},[K.Humidifier]:{icon:QM,label:`Humidifier`},[K.WaterHeater]:{icon:CM,label:`Water heater`},[K.Fan]:{icon:PM,label:`Fan`},[K.MediaPlayer]:{icon:zM,label:`Media player`},[K.AlarmPanel]:{icon:WM,label:`Alarm panel`},[K.Control]:{icon:KM,label:`Control`},[K.Presence]:{icon:RM,label:`Presence`},[K.Weather]:{icon:MM,label:`Weather`},[K.Vacuum]:{icon:EM,label:`Vacuum`},[K.LawnMower]:{icon:XM,label:`Lawn mower`},[K.Container]:{icon:DM,label:`Container`},[K.Image]:{icon:FM,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:NN[e].label,icon:NN[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 PN=$.intercom.startSession.useMutation,FN=$.intercom.handleAnswer.useMutation,IN=$.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,$.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.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.getCameraSettings.useQuery,$.pipelineOrchestrator.setCameraStepToggle.useMutation,$.pipelineOrchestrator.getCameraStepOverrides.useQuery,$.pipelineOrchestrator.setCameraStepOverride.useMutation,$.pipelineOrchestrator.setCameraPipelineForAgent.useMutation,$.pipelineOrchestrator.resolvePipeline.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 LN=176,RN=76;270/360*(2*Math.PI*RN),LN/2-RN-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 zN=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()}},BN=class{constructor(e){this.generateIdentifier=e,this.kv=new zN}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)}},VN=class extends BN{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 HN(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 UN(e,t){let n=HN(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 WN(e,t){Object.entries(e).forEach(([e,n])=>t(n,e))}function GN(e,t){return e.indexOf(t)!==-1}function KN(e,t){for(let n=0;n<e.length;n++){let r=e[n];if(t(r))return r}}var qN=class{constructor(){this.transfomers={}}register(e){this.transfomers[e.name]=e}findApplicable(e){return UN(this.transfomers,t=>t.isApplicable(e))}findByName(e){return this.transfomers[e]}},JN=e=>Object.prototype.toString.call(e).slice(8,-1),YN=e=>e===void 0,XN=e=>e===null,ZN=e=>typeof e!=`object`||!e||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype,QN=e=>ZN(e)&&Object.keys(e).length===0,$N=e=>Array.isArray(e),eP=e=>typeof e==`string`,tP=e=>typeof e==`number`&&!isNaN(e),nP=e=>typeof e==`boolean`,rP=e=>e instanceof RegExp,iP=e=>e instanceof Map,aP=e=>e instanceof Set,oP=e=>JN(e)===`Symbol`,sP=e=>e instanceof Date&&!isNaN(e.valueOf()),cP=e=>e instanceof Error,lP=e=>typeof e==`number`&&isNaN(e),uP=e=>nP(e)||XN(e)||YN(e)||tP(e)||eP(e)||oP(e),dP=e=>typeof e==`bigint`,fP=e=>e===1/0||e===-1/0,pP=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),mP=e=>e instanceof URL,hP=e=>e.replace(/\\/g,`\\\\`).replace(/\./g,`\\.`),gP=e=>e.map(String).map(hP).join(`.`),_P=(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 vP(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var yP=[vP(YN,`undefined`,()=>null,()=>void 0),vP(dP,`bigint`,e=>e.toString(),e=>typeof BigInt<`u`?BigInt(e):(console.error(`Please add a BigInt polyfill.`),e)),vP(sP,`Date`,e=>e.toISOString(),e=>new Date(e)),vP(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}),vP(rP,`regexp`,e=>``+e,e=>{let t=e.slice(1,e.lastIndexOf(`/`)),n=e.slice(e.lastIndexOf(`/`)+1);return new RegExp(t,n)}),vP(aP,`set`,e=>[...e.values()],e=>new Set(e)),vP(iP,`map`,e=>[...e.entries()],e=>new Map(e)),vP(e=>lP(e)||fP(e),`number`,e=>lP(e)?`NaN`:e>0?`Infinity`:`-Infinity`,Number),vP(e=>e===0&&1/e==-1/0,`number`,()=>`-0`,Number),vP(mP,`URL`,e=>e.toString(),e=>new URL(e))];function bP(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var xP=bP((e,t)=>oP(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}),SP=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),CP=bP(pP,e=>[`typed-array`,e.constructor.name],e=>[...e],(e,t)=>{let n=SP[t[1]];if(!n)throw Error(`Trying to deserialize unknown typed array`);return new n(e)});function wP(e,t){return e?.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}var TP=bP(wP,(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)}),EP=bP((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)}),DP=[TP,xP,EP,CP],OP=(e,t)=>{let n=KN(DP,n=>n.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};let r=KN(yP,n=>n.isApplicable(e,t));if(r)return{value:r.transform(e,t),type:r.annotation}},kP={};yP.forEach(e=>{kP[e.annotation]=e});var AP=(e,t,n)=>{if($N(t))switch(t[0]){case`symbol`:return xP.untransform(e,t,n);case`class`:return TP.untransform(e,t,n);case`custom`:return EP.untransform(e,t,n);case`typed-array`:return CP.untransform(e,t,n);default:throw Error(`Unknown transformation: `+t)}else{let r=kP[t];if(!r)throw Error(`Unknown transformation: `+t);return r.untransform(e,n)}},jP=(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 MP(e){if(GN(e,`__proto__`))throw Error(`__proto__ is not allowed as a property`);if(GN(e,`prototype`))throw Error(`prototype is not allowed as a property`);if(GN(e,`constructor`))throw Error(`constructor is not allowed as a property`)}var NP=(e,t)=>{MP(t);for(let n=0;n<t.length;n++){let r=t[n];if(aP(e))e=jP(e,+r);else if(iP(e)){let a=+r,o=+t[++n]==0?`key`:`value`,s=jP(e,a);switch(o){case`key`:e=s;break;case`value`:e=e.get(s);break}}else e=e[r]}return e},PP=(e,t,n)=>{if(MP(t),t.length===0)return n(e);let r=e;for(let e=0;e<t.length-1;e++){let n=t[e];if($N(r)){let e=+n;r=r[e]}else if(ZN(r))r=r[n];else if(aP(r)){let e=+n;r=jP(r,e)}else if(iP(r)){if(e===t.length-2)break;let a=+n,o=+t[++e]==0?`key`:`value`,s=jP(r,a);switch(o){case`key`:r=s;break;case`value`:r=r.get(s);break}}}let a=t[t.length-1];if($N(r)?r[+a]=n(r[+a]):ZN(r)&&(r[a]=n(r[a])),aP(r)){let e=jP(r,+a),t=n(e);e!==t&&(r.delete(e),r.add(t))}if(iP(r)){let e=+t[t.length-2],o=jP(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},FP=e=>e<1;function IP(e,t,n,r=[]){if(!e)return;let a=FP(n);if(!$N(e)){WN(e,(e,o)=>IP(e,t,n,[...r,..._P(o,a)]));return}let[o,s]=e;s&&WN(s,(e,o)=>{IP(e,t,n,[...r,..._P(o,a)])}),t(o,r)}function LP(e,t,n,r){return IP(t,(t,n)=>{e=PP(e,n,e=>AP(e,t,r))},n),e}function RP(e,t,n){let r=FP(n);function a(t,n){let a=NP(e,_P(n,r));t.map(e=>_P(e,r)).forEach(t=>{e=PP(e,t,()=>a)})}if($N(t)){let[n,o]=t;n.forEach(t=>{e=PP(e,_P(t,r),()=>e)}),o&&WN(o,a)}else WN(t,a);return e}var zP=(e,t)=>ZN(e)||$N(e)||iP(e)||aP(e)||cP(e)||wP(e,t);function BP(e,t,n){let r=n.get(e);r?r.push(t):n.set(e,[t])}function VP(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(gP):n[gP(a)]=o.map(gP)}),r?QN(n)?[r]:[r,n]:QN(n)?void 0:n}var HP=(e,t,n,r,a=[],o=[],s=new Map)=>{let c=uP(e);if(!c){BP(e,a,t);let n=s.get(e);if(n)return r?{transformedValue:null}:n}if(!zP(e,n)){let t=OP(e,n),r=t?{transformedValue:t.value,annotations:[t.type]}:{transformedValue:e};return c||s.set(e,r),r}if(GN(o,e))return{transformedValue:null};let l=OP(e,n),u=l?.value??e,d=$N(u)?[]:{},f={};WN(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=HP(c,t,n,r,[...a,l],[...o,e],s);d[l]=u.transformedValue,$N(u.annotations)?f[hP(l)]=u.annotations:ZN(u.annotations)&&WN(u.annotations,(e,t)=>{f[hP(l)+`.`+t]=e})});let p=QN(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 UP(e){return Object.prototype.toString.call(e).slice(8,-1)}function WP(e){return UP(e)===`Array`}function GP(e){if(UP(e)!==`Object`)return!1;let t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function KP(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 qP(e,t={}){if(WP(e))return e.map(e=>qP(e,t));if(!GP(e))return e;let n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertySymbols(e);return[...n,...r].reduce((n,r)=>{if(r===`__proto__`||WP(t.props)&&!t.props.includes(r))return n;let a=e[r];return KP(n,r,qP(a,t),e,t.nonenumerable),n},{})}var JP=class{constructor({dedupe:e=!1}={}){this.classRegistry=new VN,this.symbolRegistry=new BN(e=>e.description??``),this.customTransformerRegistry=new qN,this.allowedErrorProps=[],this.dedupe=e}serialize(e){let t=new Map,n=HP(e,t,this,this.dedupe),r={json:n.transformedValue};n.annotations&&(r.meta={...r.meta,values:n.annotations});let a=VP(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:qP(n);return r?.values&&(a=LP(a,r.values,r.v??0,this)),r?.referentialEqualities&&(a=RP(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)}};JP.defaultInstance=new JP,JP.serialize=JP.defaultInstance.serialize.bind(JP.defaultInstance),JP.deserialize=JP.defaultInstance.deserialize.bind(JP.defaultInstance),JP.stringify=JP.defaultInstance.stringify.bind(JP.defaultInstance),JP.parse=JP.defaultInstance.parse.bind(JP.defaultInstance),JP.registerClass=JP.defaultInstance.registerClass.bind(JP.defaultInstance),JP.registerSymbol=JP.defaultInstance.registerSymbol.bind(JP.defaultInstance),JP.registerCustom=JP.defaultInstance.registerCustom.bind(JP.defaultInstance),JP.allowErrorProps=JP.defaultInstance.allowErrorProps.bind(JP.defaultInstance),JP.serialize,JP.deserialize,JP.stringify,JP.parse,JP.registerClass,JP.registerCustom,JP.registerSymbol,JP.allowErrorProps,(0,x.createContext)(null),bO(`camstack:custom-field-renderers`,{}),bO(`camstack:device-context`,null),bO(`camstack:widget-registry`,null);function YP({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)(kM,{className:`h-3.5 w-3.5 text-foreground-subtle`}):(0,S.jsx)(AM,{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]})}bO(`camstack:vod-playback`,{request:null,play:()=>{},clear:()=>{}}),(0,x.lazy)(()=>BE(()=>import(`./MotionZonesSettings-C1EEbk2V-BziDLK12.js`).then(e=>({default:e.MotionZonesSettings})),__vite__mapDeps([0,1]),import.meta.url)),(0,x.lazy)(()=>BE(()=>import(`./PrivacyMaskSettings-APgPLF7p-D3KDk03_.js`).then(e=>({default:e.PrivacyMaskSettings})),__vite__mapDeps([2,1]),import.meta.url));var XP=Object.defineProperty,ZP=Object.getOwnPropertySymbols,QP=Object.prototype.hasOwnProperty,$P=Object.prototype.propertyIsEnumerable,eF=(e,t,n)=>t in e?XP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,tF=(e,t)=>{for(var n in t||={})QP.call(t,n)&&eF(e,n,t[n]);if(ZP)for(var n of ZP(t))$P.call(t,n)&&eF(e,n,t[n]);return e},nF=(e,t)=>{var n={};for(var r in e)QP.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&ZP)for(var r of ZP(e))t.indexOf(r)<0&&$P.call(e,r)&&(n[r]=e[r]);return n},rF;(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})(rF||={}),(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||={})})(rF||={}),(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||={})})(rF||={});var iF=rF,aF={L:iF.QrCode.Ecc.LOW,M:iF.QrCode.Ecc.MEDIUM,Q:iF.QrCode.Ecc.QUARTILE,H:iF.QrCode.Ecc.HIGH},oF=128,sF=`L`,cF=`#FFFFFF`,lF=`#000000`,uF=!1,dF=1,fF=4,pF=0,mF=.1;function hF(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 gF(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 _F(e,t,n,r){if(r==null)return null;let a=e.length+n*2,o=Math.floor(t*mF),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 vF(e,t){return t==null?e?fF:pF:Math.max(Math.floor(t),0)}function yF({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(...iF.QrSegment.makeSegments(t)),e),[]);return iF.QrCode.encodeSegments(r,aF[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=vF(r,a);return{cells:e,margin:t,numCells:e.length+t*2,calculatedImageSettings:_F(e,s,t,o)}},[l,s,o,r,a]);return{qrcode:l,margin:d,cells:u,numCells:f,calculatedImageSettings:p}}var bF=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),xF=x.forwardRef(function(e,t){let n=e,{value:r,size:a=oF,level:o=sF,bgColor:s=cF,fgColor:c=lF,includeMargin:l=uF,minVersion:u=dF,boostLevel:d,marginSize:f,imageSettings:p}=n,m=nF(n,[`value`,`size`,`level`,`bgColor`,`fgColor`,`includeMargin`,`minVersion`,`boostLevel`,`marginSize`,`imageSettings`]),{style:h}=m,g=nF(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}=yF({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=gF(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,bF?t.fill(new Path2D(hF(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=tF({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`,tF({style:E,height:a,width:a,ref:b,role:`img`},g)),ne)});xF.displayName=`QRCodeCanvas`;var SF=x.forwardRef(function(e,t){let n=e,{value:r,size:a=oF,level:o=sF,bgColor:s=cF,fgColor:c=lF,includeMargin:l=uF,minVersion:u=dF,boostLevel:d,title:f,marginSize:p,imageSettings:m}=n,h=nF(n,[`value`,`size`,`level`,`bgColor`,`fgColor`,`includeMargin`,`minVersion`,`boostLevel`,`title`,`marginSize`,`imageSettings`]),{margin:g,cells:_,numCells:v,calculatedImageSettings:y}=yF({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=gF(_,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=hF(b,g);return x.createElement(`svg`,tF({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)});SF.displayName=`QRCodeSVG`;function CF(){return typeof window>`u`?!1:window.matchMedia(`(hover: none) and (pointer: coarse)`).matches||typeof navigator<`u`&&navigator.maxTouchPoints>0||`ontouchstart`in window}function wF(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 TF(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 EF=1500,DF=15e3,OF=40;function kF({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()=>{}),[fe,pe]=(0,x.useState)(`idle`),[me,he]=(0,x.useState)(``),[ge,_e]=(0,x.useState)(a),[ve,ye]=(0,x.useState)(!1),[be,xe]=(0,x.useState)(!1),Se=CF(),[Ce,we]=(0,x.useState)(!0),Te=(0,x.useRef)(null),Ee=(0,x.useRef)(!1);(m||p)&&(Ee.current=!0);let De=Ee.current,Oe=(0,x.useRef)(!1);h&&(Oe.current=!0);let ke=Oe.current,[Ae,je]=(0,x.useState)(!1),Me=(0,x.useRef)(null),[Ne,Pe]=(0,x.useState)(null),[Fe,Ie]=(0,x.useState)(!1),Le=(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),wF(n,t.width,t.height)))return;Me.current=t.toDataURL(`image/jpeg`,.6)}catch{}},[]),Re=(0,x.useCallback)(e=>{pe(e),e===`playing`&&je(!0),u?.(e)},[u]),ze=(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]),Be=(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},[]),Ve=1e3,He=(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()},Ve))}};k.current=setTimeout(()=>{t()},Ve)},[b,ee]),Ue=(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?Be():ze(),Re(`connecting`);let r=new AbortController;ae.current=r;try{let{sessionId:a,sdpOffer:o,iceServers:s}=await p({...TF(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(),Re(`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{}Re(`disconnected`),Je()}},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 jF(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);he(t),Re(`error`),d?.(t),Je()}},[e,t,p,m,ze,Be,y,Re,d,w]),We=(0,x.useCallback)(async()=>{if(D.current){ze(),Re(`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,Re(`playing`),E.current?.paused&&E.current.play().catch(()=>{})):(e===`failed`||e===`disconnected`||e===`closed`)&&(Re(`disconnected`),Je())};let a=await n.createOffer();if(await n.setLocalDescription(a),await jF(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);he(t),Re(`error`),d?.(t),Je()}}},[e,t,ze,Re,d]),Ge=(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?Be():ze(),Re(`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(),Re(`playing`),E.current?.paused&&E.current.play().catch(()=>{});else if(t===`failed`||t===`disconnected`||t===`closed`){if(e&&!c)try{o.close()}catch{}Re(`disconnected`),Je()}};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()}He(p)}catch(e){if(!D.current)return;let t=e instanceof Error?e.message:String(e);he(t),Re(`error`),d?.(t),Je()}},[h,g,_,v,y,ze,Be,Re,d,He]);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(),Re(`playing`),E.current?.paused&&E.current.play().catch(()=>{})):(e===`failed`||e===`closed`)&&(!c&&e===`failed`&&o.close(),Re(`disconnected`),Je())};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()}He(p)}catch(t){console.debug(`[WebRTC] reoffer failed; keeping last frame, re-arming poll`,t instanceof Error?t.message:String(t)),He(e)}finally{ue.current=!1}},[ee,g,_,v,Re,He]);let Ke=ke?Ge:De?Ue:We,qe=(0,x.useRef)(()=>{});qe.current=Ke;let Je=(0,x.useCallback)(()=>{if(!D.current||se.current>=OF)return;let e=se.current;se.current+=1;let t=Math.min(DF,EF*2**e),n=Math.round(t*(.8+Math.random()*.4));oe.current=setTimeout(()=>{D.current&&qe.current()},n)},[]);(0,x.useEffect)(()=>(D.current=!0,se.current=0,r&&Ke(),()=>{D.current=!1,ze()}),[e,t]);let Ye=(0,x.useRef)(!1);(0,x.useEffect)(()=>{if(r){if(ke){if(!h)return}else if(De){if(!p||!m)return}else return;Ye.current||re.current||(Ye.current=!0,Ke())}},[r,ke,De,h,p,m,Ke]);let Xe=()=>{se.current=0,Ke()},Ze=()=>{if(se.current=0,re.current&&ke){Ge(!0);return}if(re.current&&De){Ue(!0);return}Ke()},Qe=(0,x.useRef)(te);(0,x.useEffect)(()=>{Qe.current!==te&&(Qe.current=te,D.current&&Ze())},[te]);let $e=()=>{E.current&&(E.current.muted=!E.current.muted,_e(E.current.muted))},et=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}`)}},tt=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)}`)}},nt=()=>{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=()=>ye(!!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`;xe(t||n)},[]);let[rt,it]=(0,x.useState)(``),at=(0,x.useRef)(null);(0,x.useEffect)(()=>{if(!s){it(``),at.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;at.current&&r>at.current.ts&&(l=Math.round((n-at.current.bytes)*8/(r-at.current.ts))),at.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`),it(u.join(` · `))}catch{}};e();let t=setInterval(()=>{e()},1e3);return()=>clearInterval(t)},[s]);let ot=(0,x.useRef)(null);(0,x.useEffect)(()=>{if(!c){ot.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=ot.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}),ot.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)(()=>{_e(a);let e=E.current;e&&(e.muted=a,a||e.play().catch(()=>{}))},[a]);let st=()=>{Se||(we(!0),Te.current&&clearTimeout(Te.current),Te.current=setTimeout(()=>we(!1),3e3))},ct=()=>{we(e=>!e),Te.current&&clearTimeout(Te.current)};(0,x.useEffect)(()=>{if(fe===`playing`){Le();let e=setInterval(Le,2e3);return()=>clearInterval(e)}Ae&&Me.current&&Pe(Me.current)},[fe,Ae,Le]),(0,x.useEffect)(()=>{if(fe!==`playing`){Ie(!1);return}let e=E.current;if(!e)return;let t=!1,n=()=>{t||Ie(!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)}},[fe]);let lt=Ae&&Ne?Ne:C??null,ut=!Fe&&lt!==null;return(0,S.jsxs)(`div`,{ref:ne,className:`relative isolate bg-black overflow-hidden group ${l}`,onMouseMove:st,onMouseEnter:st,onTouchStart:ct,children:[(0,S.jsx)(`video`,{ref:E,autoPlay:r,muted:ge,playsInline:!0,className:`w-full h-full object-contain relative z-0`}),ut&&lt&&(0,S.jsx)(`img`,{src:lt,alt:``,className:`absolute inset-0 w-full h-full object-contain z-[5] transform-gpu pointer-events-none`}),n&&fe===`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&&rt&&(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:rt}),f,!lt&&fe===`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…`})]}),!lt&&(fe===`error`||fe===`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:fe===`error`?me||`Connection failed`:`Disconnected`}),(0,S.jsx)(`button`,{onClick:Xe,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`})]}),lt&&(fe===`connecting`||fe===`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]`})})}),lt&&fe===`error`&&(0,S.jsx)(`button`,{onClick:Xe,title:me||`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&&fe!==`idle`&&fe!==`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 ${Se||Ce?`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)(AF,{onClick:$e,title:ge?`Unmute`:`Mute`,children:ge?(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)(AF,{onClick:nt,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`})]})}),be&&(0,S.jsx)(AF,{onClick:tt,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)(AF,{onClick:et,title:ve?`Exit fullscreen`:`Fullscreen`,children:ve?(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 AF({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 jF(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)})}bO(`camstack:player-overlays-state`,null);var MF=bO(`camstack:player-overlays-actions`,null);function NF(e){let t=(0,x.useContext)(MF);(0,x.useEffect)(()=>{if(!(!t||!e))return t.setLayer(e),()=>t.removeLayer(e.id)},[t,e])}B({id:F(),stableId:P(),addonId:P(),type:P(),name:P(),online:I(),disabled:I(),parentDeviceId:F().nullable(),role:P().nullable().optional(),features:z(P()).optional(),isCamera:I().optional(),sourceInfo:Kp.optional()}),G.AddonStarted,G.AddonInstalled,G.AddonRestarted,G.AddonUpdated,G.AddonStopped,G.AddonUninstalled,G.AddonCrashed,G.AddonError,G.DetectionPhaseTransition,G.DetectionResult,G.DetectionEvent,G.DetectionCameraNative,G.ProviderMotion,G.MotionOnMotionChanged,G.MotionAnalysis,G.MotionZonesRaw,G.ProviderDetection,G.PipelineAudioInferenceResult,G.AgentOnline,G.AgentOffline,G.DeviceRegistered,G.DeviceUnregistered,G.DeviceStateChanged,G.EventEmitted;var PF=Object.freeze([...new Set(Object.values(G))].toSorted()),FF=Object.freeze([G.PipelineCameraMetricsSnapshot,G.PipelineRunnerLoadSnapshot,G.PipelineEngineMetricsSnapshot,G.PipelineInferenceResult,G.PipelineTrace,G.PipelineProgress,G.StreamBrokerMetricsSnapshot,G.MetricsNodeResourcesSnapshot,G.MetricsNodeProcessesSnapshot,G.ClusterTopologySnapshot,G.MotionAnalysis,G.MotionZonesRaw,G.DetectionResult,G.PipelineAudioInferenceResult,G.PlatformProbePhase,G.BenchmarkProgress,G.ModelDownloadProgress]),IF=new Set(FF);Object.freeze(PF.filter(e=>!IF.has(e))),Object.freeze([...new Set(oT.filter(e=>e.scope===`device`).map(e=>e.name))].toSorted()),bO(`camstack:zone-editing`,null);var LF=500,RF=800;function zF(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 BF(e,t){return e?.id===t}function VF(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=zF(e,`detection.motion-analysis`,e=>{let n=e;if(!BF(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),LF))});return()=>{n?.unsubscribe(),d.current&&clearTimeout(d.current)}},[e,t]),(0,x.useEffect)(()=>{if(t===null)return;let n=zF(e,`detection.motion-zones-raw`,e=>{let n=e;if(!BF(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),LF))});return()=>{n?.unsubscribe(),f.current&&clearTimeout(f.current)}},[e,t]),(0,x.useEffect)(()=>{if(t===null)return;let n=zF(e,`detection.result`,e=>{let n=e;if(!BF(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),RF))});return()=>{n?.unsubscribe(),p.current&&clearTimeout(p.current)}},[e,t]),(0,x.useEffect)(()=>{if(t===null)return;let n=zF(e,`detection.phase-transition`,e=>{let n=e;BF(n?.source,t)&&n.data?.to&&u(n.data.to)});return()=>{n?.unsubscribe()}},[e,t]),{motion:n,motionRaw:a,detection:s,phase:l}}function HF(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]),AN(`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)(()=>BE(()=>import(`./MaskShapeCanvas-DI4BY7W2-CQxn6ukH.js`).then(e=>({default:e.MaskShapeCanvas})),[],import.meta.url)),(0,x.lazy)(()=>BE(()=>import(`./MotionZonesSettings-C1EEbk2V-BziDLK12.js`).then(e=>({default:e.MotionZonesSettings})),__vite__mapDeps([0,1]),import.meta.url)),(0,x.lazy)(()=>BE(()=>import(`./PrivacyMaskSettings-APgPLF7p-D3KDk03_.js`).then(e=>({default:e.PrivacyMaskSettings})),__vite__mapDeps([2,1]),import.meta.url));var UF=U([`auto`,`high`,`medium`,`low`]),WF=V([W(`auto`),F().int().min(1)]),GF=B({enabled:I(),motion:I(),audio:U([`off`,`sensor`,`level`]),audioDb:F(),audioHoldSec:F(),detection:I(),detectionHoldSec:F(),detectionClasses:z(P()).optional(),appearance:B({motionColor:P(),audioColor:P(),detectionColor:P(),thickness:F()}).optional()}),KF=B({serverUrl:P().min(1),token:P().min(1),devices:z(F().int().nonnegative()).min(1),layout:WF,quality:UF,showName:I(),showBadges:I(),muted:I(),paused:I(),highlight:GF.optional(),activeOnly:I().optional(),audioOnIds:z(F().int().nonnegative()).optional(),pausedIds:z(F().int().nonnegative()).optional(),snapshots:H(P(),P()).optional(),ptzIds:z(F().int().nonnegative()).optional()});function qF(e){if(e==null)return{ok:!1,error:`config is required`};let t=KF.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 JF=1e4;function YF(){try{return window.parent!==window}catch{return!0}}function XF(e){let t=window.ReactNativeWebView;if(t){t.postMessage(JSON.stringify(e));return}YF()&&window.parent.postMessage(e,`*`)}function ZF(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 QF(e,t,n){let r=t();return r==null?YF()?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`})},JF),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 $F(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 QF(e,()=>o.current(),e=>s.current(e)).then(e=>{t&&a(e)}),()=>{t=!1}},[e]),r}var eI=16/9;function tI(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*eI);return{cols:a,rows:o,cellW:s,cellH:s/eI}}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*eI),l=c/eI,u=c*l;u>o&&(o=u,a={cols:r,rows:s,cellW:c,cellH:l})}return a}function nI(){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=PN(),d=FN(),f=IN(),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 rI=6e3,iI=500;function aI(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)};AN(G.MotionOnMotionChanged,e=>{if(!a)return;let t=e.data;t&&t.detected&&f(t.deviceId,rI)}),AN(G.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)}),AN(G.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),iI);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 oI(e){return{type:`tileOpen`,deviceId:e}}function sI(e){return{type:`audioToggle`,deviceId:e}}function cI(e){return{type:`pauseToggle`,deviceId:e}}function lI(e){return{type:`ptzOpen`,deviceId:e}}function uI(e,t){return t===void 0?{type:`state`,state:e}:{type:`state`,state:e,message:t}}function dI(e){return{type:`layout`,tiles:e}}function fI(e){XF(e)}var pI=4,mI=8,hI=300;function gI(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function _I({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:gI(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=gI(t,n);l.current.dist>0&&(o.current=Math.max(1,Math.min(pI,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)>mI||Math.abs(r)>mI)&&(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<hI?(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 vI=500;function yI(e,t,n){let{motion:r,detection:a}=VF(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(AN(G.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),vI);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 bI={motion:`#DC2626`,audio:`#3B82F6`,detection:`#22C55E`},xI=3500;function SI(e){return e===`auto`?{kind:`adaptive`}:{kind:`profile`,profile:e===`medium`?`mid`:e}}function CI({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}=HF(e.trpcClient,t),E=yI(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)(()=>SI(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),xI)},ue=()=>{O(!0),le()},de=()=>{O(e=>{let t=!e;return t&&le(),t})},fe=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)(_I,{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)(EI,{size:28})}):(0,S.jsx)(kF,{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??bI.motion:E===`audio`?e?.audioColor??bI.audio:e?.detectionColor??bI.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)(wI,{label:s?`Play`:`Pause`,big:!0,enabled:ce,onClick:e=>{fe(e),d(t)},children:s?(0,S.jsx)(EI,{size:22}):(0,S.jsx)(DI,{size:22})})}),(0,S.jsxs)(`div`,{style:{position:`absolute`,left:8,bottom:8,display:`flex`,gap:8,pointerEvents:`none`},children:[(0,S.jsx)(wI,{label:l?`Mute`:`Listen`,active:l,enabled:ce,onClick:e=>{fe(e),f(t)},children:l?(0,S.jsx)(OI,{size:18}):(0,S.jsx)(kI,{size:18})}),(0,S.jsx)(wI,{label:u?`Stop talk`:`Talk`,active:u,enabled:ce,onClick:e=>{fe(e),p(t)},children:(0,S.jsx)(AI,{size:18,muted:!u})}),h&&g?(0,S.jsx)(wI,{label:`PTZ`,enabled:ce,onClick:e=>{fe(e),g(t)},children:(0,S.jsx)(MI,{size:18})}):null]}),(0,S.jsx)(`div`,{style:{position:`absolute`,right:8,bottom:8,pointerEvents:`none`},children:(0,S.jsx)(wI,{label:`Open`,enabled:ce,onClick:e=>{fe(e),m(t)},children:(0,S.jsx)(jI,{size:18})})})]})]})}function wI({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 TI={fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`};function EI({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 DI({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 OI({size:e}){return(0,S.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,...TI,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 kI({size:e}){return(0,S.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,...TI,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 AI({size:e,muted:t}){return(0,S.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,...TI,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 jI({size:e}){return(0,S.jsx)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,...TI,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 MI({size:e}){return(0,S.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,...TI,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 NI({message:e}){return(0,x.useEffect)(()=>fI(uI(`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 PI({system:e,config:t}){let[n,r]=(0,x.useState)(()=>new Set(t.audioOnIds??[])),a=nI(),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=aI(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)},fI(uI(`ready`)),()=>{window.__camstackGrid&&delete window.__camstackGrid}),[]),(0,x.useEffect)(()=>ZF(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)(()=>tI(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&&fI(dI(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)(CI,{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=>fI(cI(e)),onToggleAudio:e=>fI(sI(e)),onToggleMic:a.toggleMic,onOpen:e=>fI(oI(e)),ptzSupported:T.has(t),onPtz:e=>fI(lI(e)),highlight:l,reconnectSignal:ee,posterUrl:w[String(t)]})},t))]})}function FI(){let e=$F(`grid`,()=>window.__CAMSTACK_GRID__,qF),t=(0,x.useMemo)(()=>e===null||!e.ok?null:{system:CE({serverUrl:e.config.serverUrl,token:e.config.token}),queryClient:new ct({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)(ON,{system:t.system,children:(0,S.jsx)(dt,{client:t.queryClient,children:(0,S.jsx)($.Provider,{client:t.system.trpcClient,queryClient:t.queryClient,children:(0,S.jsx)(PI,{system:t.system,config:e.config})})})}):(0,S.jsx)(NI,{message:`Failed to initialise the grid embed`}):(0,S.jsx)(NI,{message:e.error})}function II(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 LI=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 RI(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 zI(e,t){return new URL(t,e).toString()}function BI(e){let t=(e.split(`/`).pop()??``).match(/^(\d+)-(\d+)(?:-\d+)?\.m4s$/);return t?{startMs:Number(t[1]),durMs:Number(t[2])}:null}function VI(e,t){let n=e.split(`
78
- `).map(e=>e.trim());for(let e of n)if(/low\.m3u8/i.test(e))return zI(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=zI(t,o))}return r}async function HI(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 UI(e,t){let n=RI(e),r=VI(await HI(n,t),n);if(!r)return[];let a=await HI(r,t),o=[];for(let e of a.split(`
79
- `).map(e=>e.trim())){if(!e||e.startsWith(`#`))continue;let t=zI(r,e),n=BI(t);n&&o.push({uri:t,startMs:n.startMs,durMs:n.durMs})}return o.sort((e,t)=>e.startMs-t.startMs),o}function WI(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 GI(e,t){return e.length===0?null:e[WI(e,t)]??null}function KI(e,t,n,r){if(e.length===0||r<=0)return[];let a=WI(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 qI=class{deps;generation=0;inflight=null;lastEpoch=0;lastSegStart=null;bytes;frames;prefetchCount;prefetching=new Map;constructor(e){this.deps=e,this.bytes=new LI(e.byteCacheSize??24),this.frames=new LI(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=GI(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=KI(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)})}}},JI=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,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#039;`)}),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
- `,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 YI(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 JI.DataStream(void 0,0,JI.DataStream.BIG_ENDIAN);return t.write(e),new Uint8Array(e.buffer,8)}}}async function XI(e){let t=JI.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=YI(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 ZI=class{decoder=null;async decodeSegment(e){let{config:t,chunk:n}=await XI(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 QI({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 $I=V([B({kind:W(`adaptive`)}),B({kind:W(`profile`),profile:Wd})]),eL=B({serverUrl:P().min(1),token:P().min(1),deviceId:F().int().nonnegative(),target:$I,muted:I(),stats:I().optional(),highlight:GF.optional(),snapshot:P().optional(),hlsRecordedPlayback:I().optional()}),tL=300*1e3;function nL(e,t){try{return new URL(t,e).toString()}catch{return t}}var rL=[`live`,`loading`,`playing`,`paused`,`gap`,`ended`,`error`];function iL(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`&&rL.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 aL(e,t){XF(t===void 0?{type:`state`,state:e}:{type:`state`,state:e,message:t})}function oL(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 lL(e){let t=eL.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 uL({message:e}){return(0,x.useEffect)(()=>{aL(`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 dL({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=yI(e,t,g),re=nI(),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=iL(t);n&&(n.kind===`position`?(oe.current&&se.current(),XF({type:`position`,positionMs:n.epochMs})):(n.state===`playing`&&oe.current&&se.current(),XF({type:`recState`,state:n.state})))},e.onclose=()=>{ae.current===e&&(ae.current=null)}}).current,ce=(0,x.useRef)(e=>{let t=II(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:fe}=HF(e.trpcClient,t),pe=(0,x.useMemo)(()=>sL(u),[u]),me=(0,x.useMemo)(()=>(e,t)=>O(pe,e,t),[O,pe]),he=(0,x.useMemo)(()=>(e,t,n)=>O(n,t,e),[O]),ge=(0,x.useRef)(null),[_e,ve]=(0,x.useState)(!1),[ye,be]=(0,x.useState)(!1),xe=(0,x.useRef)(!1);xe.current=ye;let Se=(0,x.useRef)(null);se.current=(0,x.useCallback)(()=>{oe.current=!1,Se.current&&=(clearTimeout(Se.current),null),ve(!1)},[]);let Ce=(0,x.useCallback)(()=>{xe.current?(oe.current=!0,Se.current&&clearTimeout(Se.current),Se.current=setTimeout(()=>se.current(),4e3)):ve(!1)},[]),we=(0,x.useRef)(Ce);we.current=Ce;let Te=(0,x.useRef)(null),Ee=(0,x.useRef)(null),De=(0,x.useRef)([]),Oe=(0,x.useRef)(null),ke=(0,x.useMemo)(()=>({Authorization:`Bearer ${n}`}),[n]),Ae=(0,x.useMemo)(()=>async n=>{let r=Oe.current;if(r&&n>=r.fromMs&&n<r.toMs&&De.current.length>0)return De.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?(De.current=await UI(c.playbackUrl,ke),Oe.current={fromMs:o,toMs:s},De.current):De.current},[e,t,ke]),je=(0,x.useMemo)(()=>e=>{let t=ge.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),be(!0)},[C.w,C.h]),Me=(0,x.useRef)(je);Me.current=je;let Ne=(0,x.useMemo)(()=>async e=>{Te.current||=new ZI,Ee.current||=new qI({ensureIndex:e=>Ae(e),fetchBytes:async(e,t)=>{let n=await fetch(e,{signal:t,headers:ke});if(!n.ok)throw Error(`segment fetch failed: ${n.status}`);return n.arrayBuffer()},decode:e=>{let t=Te.current;if(!t)throw Error(`decoder not initialised`);return t.decodeSegment(e)},draw:e=>Me.current(e)});try{await Ee.current.scrubTo(e)}catch{}},[Ae,ke]),Pe=(0,x.useRef)(Ne);Pe.current=Ne,(0,x.useEffect)(()=>()=>{Ee.current?.dispose()},[]);let Fe=(0,x.useMemo)(()=>async n=>{let r=n-tL,a=n+tL;XF({type:`recState`,state:`loading`});try{let o=await e.trpcClient.recording.getPlaybackManifest.query({deviceId:t,fromMs:r,toMs:a});if(!o?.playbackUrl){XF({type:`recState`,state:`gap`});return}T({url:nL(e.serverUrl,o.playbackUrl),windowStartMs:r,windowEndMs:a,targetMs:n}),XF({type:`recState`,state:`playing`}),XF({type:`position`,positionMs:n})}catch{XF({type:`recState`,state:`error`})}},[e,t]),Ie=(0,x.useRef)(Fe);Ie.current=Fe;let Le=(0,x.useMemo)(()=>e=>{let t=E.current;if(!t){Ie.current(e);return}if(e>=t.windowStartMs&&e<=t.windowEndMs){let n=Be.current;if(n){n.currentTime=Math.max(0,(e-t.windowStartMs)/1e3),XF({type:`position`,positionMs:e});return}}Ie.current(e)},[]),Re=(0,x.useRef)(Le);Re.current=Le;let ze=(0,x.useRef)(null),Be=(0,x.useRef)(null);(0,x.useEffect)(()=>{Be.current=te?ze.current?.querySelector(`video`)??null:null},[te]),(0,x.useEffect)(()=>(window.__camstackEmbed={setMuted:e=>p(e),setTarget:e=>{let t=$I.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?Ie.current(t):ce({kind:`playRecorded`,deviceId:e,epochMs:t,profile:n})},seek:e=>{l&&E.current?Re.current(e):ce({kind:`seekTo`,epochMs:e})},scrubCommit:e=>{if(l&&E.current){Re.current(e);return}ce({kind:`scrubEnd`,epochMs:e}),we.current()},scrubStart:()=>{l&&E.current||(be(!1),ve(!0),ce({kind:`scrubStart`}))},scrubTo:e=>{l&&E.current||Pe.current(e)},scrubEnd:e=>{if(l&&E.current){Re.current(e);return}ce({kind:`scrubEnd`,epochMs:e}),we.current()},setRate:e=>{if(l&&E.current){let t=Be.current;t&&(e===0?t.pause():t.play().catch(()=>{}));return}ce({kind:e===0?`pause`:`play`})},goLive:()=>{if(l&&E.current){T(null),XF({type:`recState`,state:`live`});return}ce({kind:`goLive`})}},()=>{window.__camstackEmbed&&delete window.__camstackEmbed}),[t,l]),(0,x.useEffect)(()=>{XF({type:`micState`,state:re.micState})},[re.micState]),(0,x.useEffect)(()=>ZF(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 Ve=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)(kF,{serverUrl:e.serverUrl,streamKey:Ve,autoPlay:!0,muted:f,showControls:!1,showStats:m,onPlaybackStats:e=>XF({type:`log`,scope:`playback`,msg:`stats`,data:e}),className:`w-full h-full`,handleOffer:me,reoffer:he,getSessionState:fe,getIceServers:k,addIceCandidate:le,getIceCandidates:ue,closeSession:de,reconnectSignal:b,posterUrl:v,onControlChannel:D,onStateChange:e=>aL(oL(e)),onError:e=>aL(`error`,e)},Ve),te?(0,S.jsx)(`div`,{ref:ze,style:{position:`absolute`,inset:0,zIndex:1,background:`#000`},children:(0,S.jsx)(QI,{url:te.url,muted:f,autoPlay:!0},te.url)}):null,(0,S.jsx)(`canvas`,{ref:ge,style:{position:`absolute`,inset:0,width:`100%`,height:`100%`,background:`#000`,pointerEvents:`none`,transform:`translateZ(0)`,zIndex:2,display:_e&&ye?`block`:`none`}}),ne&&(()=>{let e=g?.appearance,t=ne===`motion`?e?.motionColor??bI.motion:ne===`audio`?e?.audioColor??bI.audio:e?.detectionColor??bI.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 fL(){let e=$F(`player`,()=>window.__CAMSTACK_EMBED__,lL),t=(0,x.useMemo)(()=>e===null||!e.ok?null:{system:CE({serverUrl:e.config.serverUrl,token:e.config.token}),queryClient:new ct({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)(ON,{system:t.system,children:(0,S.jsx)(dt,{client:t.queryClient,children:(0,S.jsx)($.Provider,{client:t.system.trpcClient,queryClient:t.queryClient,children:(0,S.jsx)(dL,{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)(uL,{message:`Failed to initialise the embed player`}):(0,S.jsx)(uL,{message:e.error})}var pL=B({serverUrl:P().min(1),token:P().min(1),deviceId:F().int().nonnegative(),startMs:F().int().nonnegative().optional()});function mL(e){if(e==null)return{ok:!1,error:`config is required`};let t=pL.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 hL=360*60*1e3;function gL(e){XF(e)}function _L(e,t,n){try{XF({type:`log`,scope:e,msg:t,data:n})}catch{}try{console.debug(`[rec-embed:${e}] ${t}`,n??``)}catch{}}function vL({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(),_L(`loadAt`,`start`,{epochMs:r,window:hL}),gL({type:`state`,state:`loading`});try{let n=await e.trpcClient.recording.getPlaybackManifest.query({deviceId:t.deviceId,fromMs:r,toMs:r+hL});if(_L(`loadAt`,`manifest`,{playbackUrl:n?.playbackUrl??null,endpoints:n?.playbackEndpoints?.length??0,localMaster:!!n?.localMasterPath}),!n?.playbackUrl){gL({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=>{_L(`loadAt`,`play-rejected`,{msg:String(e)})}),_L(`loadAt`,`src-set`,{src:n.playbackUrl})}catch(e){_L(`loadAt`,`error`,{msg:e instanceof Error?e.message:String(e)}),gL({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 _L(`scrub`,`dayIndex-manifest`,{playbackUrl:c?.playbackUrl??null,fromMs:o,toMs:s}),c?.playbackUrl?(m.current=await UI(c.playbackUrl),h.current={fromMs:o,toMs:s},_L(`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 ZI,p.current||=new qI({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=>_L(`scrub`,`timing`,e)});let t=p.current;if(t)try{await t.scrubTo(e),_L(`scrub`,`drawn`,{epochMs:e})}catch(e){_L(`scrub`,`error`,{msg:e instanceof Error?e.message:String(e)}),d.current||(d.current=!0,gL({type:`state`,state:`error`,message:`scrub: ${e instanceof Error?e.message:String(e)}`}))}},[_]);return(0,x.useEffect)(()=>(_L(`init`,`mounted`,{deviceId:t.deviceId,startMs:t.startMs??null,hasWebCodecs:window.VideoDecoder!==void 0,ua:navigator.userAgent}),window.__camstackRecording={seekTo:e=>{_L(`cmd`,`seekTo`,{epochMs:e}),g(e)},play:()=>{_L(`cmd`,`play`),n.current?.play().catch(()=>{})},pause:()=>{_L(`cmd`,`pause`),n.current?.pause()},setRate:e=>{_L(`cmd`,`setRate`,{rate:e}),n.current&&(n.current.playbackRate=e)},fit:(e,t)=>{_L(`cmd`,`fit`,{w:e,h:t}),c({w:e,h:t})},scrubStart:()=>{_L(`cmd`,`scrubStart`),d.current=!1,u(!0)},scrubTo:e=>{_L(`cmd`,`scrubTo`,{epochMs:e}),b(e)},scrubEnd:e=>{_L(`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)(()=>ZF(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=>_L(`video`,`loadedmetadata`,{w:e.currentTarget.videoWidth,h:e.currentTarget.videoHeight,dur:e.currentTarget.duration}),onPlaying:()=>{_L(`video`,`playing`,{vodStartMs:Math.round(performance.now()-o.current)}),gL({type:`state`,state:`playing`}),u(!1)},onPause:()=>gL({type:`state`,state:`paused`}),onEnded:()=>gL({type:`state`,state:`ended`}),onError:e=>{let t=e.currentTarget.error;_L(`video`,`error`,{code:t?.code??null,message:t?.message??null}),gL({type:`state`,state:`error`,message:t?.message||`video error`}),u(!1)},onTimeUpdate:e=>gL({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 yL(){let e=$F(`recording`,()=>window.__CAMSTACK_RECORDING__,mL),t=(0,x.useMemo)(()=>e===null||!e.ok?null:(document.cookie=`camstack_session=${e.config.token}; path=/; SameSite=Lax`,CE({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)(vL,{system:t,config:e.config}):(gL({type:`state`,state:`error`,message:`init failed`}),null):(gL({type:`state`,state:`error`,message:e.error}),null)}function bL(){let e=new URLSearchParams(location.search).get(`mode`)??`grid`;return e===`player`?(0,S.jsx)(fL,{}):e===`recording`?(0,S.jsx)(yL,{}):(0,S.jsx)(FI,{})}var xL=document.getElementById(`root`);xL&&(0,ee.createRoot)(xL).render((0,S.jsx)(bL,{}));export{YP as a,MN as c,b as d,m as f,u as g,c as h,ZM as i,NF as l,s as m,qM as n,Q as o,f as p,yO as r,vO as s,NM as t,kN as u};
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 ml(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:_l(t,`input`,e.processors),output:_l(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function hl(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 hl(r.element,n);if(r.type===`set`)return hl(r.valueType,n);if(r.type===`lazy`)return hl(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 hl(r.innerType,n);if(r.type===`intersection`)return hl(r.left,n)||hl(r.right,n);if(r.type===`record`||r.type===`map`)return hl(r.keyType,n)||hl(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:hl(r.in,n)||hl(r.out,n);if(r.type===`object`){for(let e in r.shape)if(hl(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(hl(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(hl(e,n))return!0;return!!(r.rest&&hl(r.rest,n))}return!1}var gl=(e,t={})=>n=>{let r=dl({...n,processors:t});return fl(e,r),pl(r,e),ml(r,e)},_l=(e,t,n={})=>r=>{let{libraryOptions:a,target:o}=r??{},s=dl({...a??{},target:o,io:t,processors:n});return fl(e,s),pl(s,e),ml(s,e)},vl={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},yl=(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=vl[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}))])}},bl=(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)},xl=(e,t,n,r)=>{n.type=`boolean`},Sl=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},Cl=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`)},wl=(e,t,n,r)=>{n.not={}},Tl=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Date cannot be represented in JSON Schema`)},El=(e,t,n,r)=>{let a=e._zod.def,o=Pi(a.entries);o.every(e=>typeof e==`number`)&&(n.type=`number`),o.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=o},Dl=(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},Ol=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},kl=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},Al=(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=fl(o.element,t,{...r,path:[...r.path,`items`]})},jl=(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]=fl(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=fl(o.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(a.additionalProperties=!1)},Ml=(e,t,n,r)=>{let a=e._zod.def,o=a.inclusive===!1,s=a.options.map((e,n)=>fl(e,t,{...r,path:[...r.path,o?`oneOf`:`anyOf`,n]}));o?n.oneOf=s:n.anyOf=s},Nl=(e,t,n,r)=>{let a=e._zod.def,o=fl(a.left,t,{...r,path:[...r.path,`allOf`,0]}),s=fl(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]]},Pl=(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)=>fl(e,t,{...r,path:[...r.path,s,n]})),u=o.rest?fl(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)},Fl=(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=fl(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=fl(o.keyType,t,{...r,path:[...r.path,`propertyNames`]})),a.additionalProperties=fl(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)}},Il=(e,t,n,r)=>{let a=e._zod.def,o=fl(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`}]},Ll=(e,t,n,r)=>{let a=e._zod.def;fl(a.innerType,t,r);let o=t.seen.get(e);o.ref=a.innerType},Rl=(e,t,n,r)=>{let a=e._zod.def;fl(a.innerType,t,r);let o=t.seen.get(e);o.ref=a.innerType,n.default=JSON.parse(JSON.stringify(a.defaultValue))},zl=(e,t,n,r)=>{let a=e._zod.def;fl(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)))},Bl=(e,t,n,r)=>{let a=e._zod.def;fl(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},Vl=(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;fl(s,t,r);let c=t.seen.get(e);c.ref=s},Hl=(e,t,n,r)=>{let a=e._zod.def;fl(a.innerType,t,r);let o=t.seen.get(e);o.ref=a.innerType,n.readOnly=!0},Ul=(e,t,n,r)=>{let a=e._zod.def;fl(a.innerType,t,r);let o=t.seen.get(e);o.ref=a.innerType},Wl=(e,t,n,r)=>{let a=e._zod.innerType;fl(a,t,r);let o=t.seen.get(e);o.ref=a},Gl=j(`ZodISODateTime`,(e,t)=>{Ko.init(e,t),_u.init(e,t)});function Kl(e){return Dc(Gl,e)}var ql=j(`ZodISODate`,(e,t)=>{qo.init(e,t),_u.init(e,t)});function Jl(e){return Oc(ql,e)}var Yl=j(`ZodISOTime`,(e,t)=>{Jo.init(e,t),_u.init(e,t)});function Xl(e){return kc(Yl,e)}var Zl=j(`ZodISODuration`,(e,t)=>{Yo.init(e,t),_u.init(e,t)});function Ql(e){return Ac(Zl,e)}var $l=j(`ZodError`,(e,t)=>{ga.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>ya(e,t)},flatten:{value:t=>va(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Fi,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Fi,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),eu=ba($l),tu=xa($l),nu=Sa($l),ru=wa($l),iu=Ea($l),au=Da($l),ou=Oa($l),su=ka($l),cu=Aa($l),lu=ja($l),uu=Ma($l),du=Na($l),fu=new WeakMap;function pu(e,t,n){let r=Object.getPrototypeOf(e),a=fu.get(r);if(a||(a=new Set,fu.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 mu=j(`ZodType`,(e,t)=>(Mo.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:_l(e,`input`),output:_l(e,`output`)}}),e.toJSONSchema=gl(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>eu(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>nu(e,t,n),e.parseAsync=async(t,n)=>tu(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>ru(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>iu(e,t,n),e.decode=(t,n)=>au(e,t,n),e.encodeAsync=async(t,n)=>ou(e,t,n),e.decodeAsync=async(t,n)=>su(e,t,n),e.safeEncode=(t,n)=>cu(e,t,n),e.safeDecode=(t,n)=>lu(e,t,n),e.safeEncodeAsync=async(t,n)=>uu(e,t,n),e.safeDecodeAsync=async(t,n)=>du(e,t,n),pu(e,`ZodType`,{check(...e){let t=this.def;return this.clone(Hi(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 Qi(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Id(e,t))},superRefine(e,t){return this.check(Ld(e,t))},overwrite(e){return this.check(el(e))},optional(){return hd(this)},exactOptional(){return _d(this)},nullable(){return yd(this)},nullish(){return hd(yd(this))},nonoptional(e){return Td(this,e)},array(){return z(this)},or(e){return V([this,e])},and(e){return ad(this,e)},transform(e){return kd(this,pd(e))},default(e){return xd(this,e)},prefault(e){return Cd(this,e)},catch(e){return Dd(this,e)},pipe(e){return kd(this,e)},readonly(){return jd(this)},describe(e){let t=this.clone();return rc.add(t,{description:e}),t},meta(...e){if(e.length===0)return rc.get(this);let t=this.clone();return rc.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 rc.get(e)?.description},configurable:!0}),e)),hu=j(`_ZodString`,(e,t)=>{No.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yl(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,pu(e,`_ZodString`,{regex(...e){return this.check(Jc(...e))},includes(...e){return this.check(Zc(...e))},startsWith(...e){return this.check(Qc(...e))},endsWith(...e){return this.check($c(...e))},min(...e){return this.check(Kc(...e))},max(...e){return this.check(Gc(...e))},length(...e){return this.check(qc(...e))},nonempty(...e){return this.check(Kc(1,...e))},lowercase(e){return this.check(Yc(e))},uppercase(e){return this.check(Xc(e))},trim(){return this.check(nl())},normalize(...e){return this.check(tl(...e))},toLowerCase(){return this.check(rl())},toUpperCase(){return this.check(il())},slugify(){return this.check(al())}})}),gu=j(`ZodString`,(e,t)=>{No.init(e,t),hu.init(e,t),e.email=t=>e.check(ac(vu,t)),e.url=t=>e.check(dc(Su,t)),e.jwt=t=>e.check(Ec(Ru,t)),e.emoji=t=>e.check(fc(wu,t)),e.guid=t=>e.check(oc(bu,t)),e.uuid=t=>e.check(sc(xu,t)),e.uuidv4=t=>e.check(cc(xu,t)),e.uuidv6=t=>e.check(lc(xu,t)),e.uuidv7=t=>e.check(uc(xu,t)),e.nanoid=t=>e.check(pc(Tu,t)),e.guid=t=>e.check(oc(bu,t)),e.cuid=t=>e.check(mc(Eu,t)),e.cuid2=t=>e.check(hc(Du,t)),e.ulid=t=>e.check(gc(Ou,t)),e.base64=t=>e.check(Cc(Fu,t)),e.base64url=t=>e.check(wc(Iu,t)),e.xid=t=>e.check(_c(ku,t)),e.ksuid=t=>e.check(vc(Au,t)),e.ipv4=t=>e.check(yc(ju,t)),e.ipv6=t=>e.check(bc(Mu,t)),e.cidrv4=t=>e.check(xc(Nu,t)),e.cidrv6=t=>e.check(Sc(Pu,t)),e.e164=t=>e.check(Tc(Lu,t)),e.datetime=t=>e.check(Kl(t)),e.date=t=>e.check(Jl(t)),e.time=t=>e.check(Xl(t)),e.duration=t=>e.check(Ql(t))});function P(e){return ic(gu,e)}var _u=j(`ZodStringFormat`,(e,t)=>{Po.init(e,t),hu.init(e,t)}),vu=j(`ZodEmail`,(e,t)=>{Lo.init(e,t),_u.init(e,t)});function yu(e){return ac(vu,e)}var bu=j(`ZodGUID`,(e,t)=>{Fo.init(e,t),_u.init(e,t)}),xu=j(`ZodUUID`,(e,t)=>{Io.init(e,t),_u.init(e,t)}),Su=j(`ZodURL`,(e,t)=>{Ro.init(e,t),_u.init(e,t)});function Cu(e){return dc(Su,e)}var wu=j(`ZodEmoji`,(e,t)=>{zo.init(e,t),_u.init(e,t)}),Tu=j(`ZodNanoID`,(e,t)=>{Bo.init(e,t),_u.init(e,t)}),Eu=j(`ZodCUID`,(e,t)=>{Vo.init(e,t),_u.init(e,t)}),Du=j(`ZodCUID2`,(e,t)=>{Ho.init(e,t),_u.init(e,t)}),Ou=j(`ZodULID`,(e,t)=>{Uo.init(e,t),_u.init(e,t)}),ku=j(`ZodXID`,(e,t)=>{Wo.init(e,t),_u.init(e,t)}),Au=j(`ZodKSUID`,(e,t)=>{Go.init(e,t),_u.init(e,t)}),ju=j(`ZodIPv4`,(e,t)=>{Xo.init(e,t),_u.init(e,t)}),Mu=j(`ZodIPv6`,(e,t)=>{Zo.init(e,t),_u.init(e,t)}),Nu=j(`ZodCIDRv4`,(e,t)=>{Qo.init(e,t),_u.init(e,t)}),Pu=j(`ZodCIDRv6`,(e,t)=>{$o.init(e,t),_u.init(e,t)}),Fu=j(`ZodBase64`,(e,t)=>{ts.init(e,t),_u.init(e,t)}),Iu=j(`ZodBase64URL`,(e,t)=>{rs.init(e,t),_u.init(e,t)}),Lu=j(`ZodE164`,(e,t)=>{is.init(e,t),_u.init(e,t)}),Ru=j(`ZodJWT`,(e,t)=>{os.init(e,t),_u.init(e,t)}),zu=j(`ZodNumber`,(e,t)=>{ss.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bl(e,t,n,r),pu(e,`ZodNumber`,{gt(e,t){return this.check(Hc(e,t))},gte(e,t){return this.check(Uc(e,t))},min(e,t){return this.check(Uc(e,t))},lt(e,t){return this.check(Bc(e,t))},lte(e,t){return this.check(Vc(e,t))},max(e,t){return this.check(Vc(e,t))},int(e){return this.check(Vu(e))},safe(e){return this.check(Vu(e))},positive(e){return this.check(Hc(0,e))},nonnegative(e){return this.check(Uc(0,e))},negative(e){return this.check(Bc(0,e))},nonpositive(e){return this.check(Vc(0,e))},multipleOf(e,t){return this.check(Wc(e,t))},step(e,t){return this.check(Wc(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 F(e){return jc(zu,e)}var Bu=j(`ZodNumberFormat`,(e,t)=>{cs.init(e,t),zu.init(e,t)});function Vu(e){return Mc(Bu,e)}var Hu=j(`ZodBoolean`,(e,t)=>{ls.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xl(e,t,n,r)});function I(e){return Nc(Hu,e)}var Uu=j(`ZodNull`,(e,t)=>{us.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Sl(e,t,n,r)});function Wu(e){return Pc(Uu,e)}var Gu=j(`ZodAny`,(e,t)=>{ds.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Ku(){return Fc(Gu)}var qu=j(`ZodUnknown`,(e,t)=>{fs.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function L(){return Ic(qu)}var Ju=j(`ZodNever`,(e,t)=>{ps.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wl(e,t,n,r)});function Yu(e){return Lc(Ju,e)}var Xu=j(`ZodVoid`,(e,t)=>{ms.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Cl(e,t,n,r)});function R(e){return Rc(Xu,e)}var Zu=j(`ZodDate`,(e,t)=>{hs.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Tl(e,t,n,r),e.min=(t,n)=>e.check(Uc(t,n)),e.max=(t,n)=>e.check(Vc(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 Qu(e){return zc(Zu,e)}var $u=j(`ZodArray`,(e,t)=>{_s.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Al(e,t,n,r),e.element=t.element,pu(e,`ZodArray`,{min(e,t){return this.check(Kc(e,t))},nonempty(e){return this.check(Kc(1,e))},max(e,t){return this.check(Gc(e,t))},length(e,t){return this.check(qc(e,t))},unwrap(){return this.element}})});function z(e,t){return ol($u,e,t)}var ed=j(`ZodObject`,(e,t)=>{Ss.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jl(e,t,n,r),M(e,`shape`,()=>t.shape),pu(e,`ZodObject`,{keyof(){return U(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:L()})},loose(){return this.clone({...this._zod.def,catchall:L()})},strict(){return this.clone({...this._zod.def,catchall:Yu()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return ra(this,e)},safeExtend(e){return ia(this,e)},merge(e){return aa(this,e)},pick(e){return ta(this,e)},omit(e){return na(this,e)},partial(...e){return oa(md,this,e[0])},required(...e){return sa(wd,this,e[0])}})});function B(e,t){return new ed({type:`object`,shape:e??{},...N(t)})}var td=j(`ZodUnion`,(e,t)=>{ws.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ml(e,t,n,r),e.options=t.options});function V(e,t){return new td({type:`union`,options:e,...N(t)})}var nd=j(`ZodDiscriminatedUnion`,(e,t)=>{td.init(e,t),Ts.init(e,t)});function rd(e,t,n){return new nd({type:`union`,options:t,discriminator:e,...N(n)})}var id=j(`ZodIntersection`,(e,t)=>{Es.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Nl(e,t,n,r)});function ad(e,t){return new id({type:`intersection`,left:e,right:t})}var od=j(`ZodTuple`,(e,t)=>{ks.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pl(e,t,n,r),e.rest=t=>e.clone({...e._zod.def,rest:t})});function sd(e,t,n){let r=t instanceof Mo;return new od({type:`tuple`,items:e,rest:r?t:null,...N(r?n:t)})}var cd=j(`ZodRecord`,(e,t)=>{Ns.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fl(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function H(e,t,n){return!t||!t._zod?new cd({type:`record`,keyType:P(),valueType:e,...N(t)}):new cd({type:`record`,keyType:e,valueType:t,...N(n)})}function ld(e,t,n){let r=Qi(e);return r._zod.values=void 0,new cd({type:`record`,keyType:r,valueType:t,...N(n)})}var ud=j(`ZodEnum`,(e,t)=>{Ps.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>El(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 ud({...t,checks:[],...N(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 ud({...t,checks:[],...N(r),entries:a})}});function U(e,t){return new ud({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...N(t)})}var dd=j(`ZodLiteral`,(e,t)=>{Fs.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Dl(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 W(e,t){return new dd({type:`literal`,values:Array.isArray(e)?e:[e],...N(t)})}var fd=j(`ZodTransform`,(e,t)=>{Is.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>kl(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new ji(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(ma(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(ma(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 pd(e){return new fd({type:`transform`,transform:e})}var md=j(`ZodOptional`,(e,t)=>{Rs.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ul(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function hd(e){return new md({type:`optional`,innerType:e})}var gd=j(`ZodExactOptional`,(e,t)=>{zs.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ul(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function _d(e){return new gd({type:`optional`,innerType:e})}var vd=j(`ZodNullable`,(e,t)=>{Bs.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Il(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function yd(e){return new vd({type:`nullable`,innerType:e})}var bd=j(`ZodDefault`,(e,t)=>{Vs.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Rl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function xd(e,t){return new bd({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Yi(t)}})}var Sd=j(`ZodPrefault`,(e,t)=>{Us.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Cd(e,t){return new Sd({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Yi(t)}})}var wd=j(`ZodNonOptional`,(e,t)=>{Ws.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ll(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Td(e,t){return new wd({type:`nonoptional`,innerType:e,...N(t)})}var Ed=j(`ZodCatch`,(e,t)=>{Ks.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Dd(e,t){return new Ed({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var Od=j(`ZodPipe`,(e,t)=>{qs.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vl(e,t,n,r),e.in=t.in,e.out=t.out});function kd(e,t){return new Od({type:`pipe`,in:e,out:t})}var Ad=j(`ZodReadonly`,(e,t)=>{Ys.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hl(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function jd(e){return new Ad({type:`readonly`,innerType:e})}var Md=j(`ZodLazy`,(e,t)=>{Zs.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wl(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function Nd(e){return new Md({type:`lazy`,getter:e})}var Pd=j(`ZodCustom`,(e,t)=>{Qs.init(e,t),mu.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ol(e,t,n,r)});function Fd(e,t){return sl(Pd,e??(()=>!0),t)}function Id(e,t={}){return cl(Pd,e,t)}function Ld(e,t){return ll(e,t)}function Rd(e,t={}){let n=new Pd({type:`custom`,check:`custom`,fn:t=>t instanceof e,abort:!0,...N(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 zd=U([`singleton`,`device`,`widget`]),Bd=B({capName:P(),kind:zd,deviceId:F().optional(),reachable:I(),latencyMs:F(),error:P().optional()}),Vd=B({addonId:P(),caps:z(Bd).readonly(),widgets:z(Bd).readonly()}),Hd=B({nodeId:P(),addons:z(Vd).readonly()});B({ok:I(),degraded:I(),checkedAt:P(),nodes:z(Hd).readonly(),summary:B({total:F(),reachable:F(),unreachable:F()})});var Ud=[`onnx`,`coreml`,`openvino`,`tflite`,`pt`],G=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 Wd=U([`high`,`mid`,`low`]),Gd=U([`pull-rtsp`,`pull-rtmp`,`pull-http`,`pull-rfc4571`,`push-annexb`,`derived`]),Kd=B({width:F().int().positive(),height:F().int().positive()}),qd=B({camStreamId:P().min(1),deviceId:F().int().nonnegative(),kind:Gd,url:P().optional(),codec:P().optional(),resolution:Kd.optional(),fps:F().positive().optional(),label:P().optional(),deviceFeatures:z(P()).optional(),autoEligible:I().optional(),metadata:H(P(),L()).optional()}),Jd=U([`unassigned`,`idle`,`connecting`,`streaming`,`error`]),Yd=B({deviceId:F().int().nonnegative(),profile:Wd,brokerId:P(),sourceCamStreamId:P().nullable(),status:Jd,resolution:Kd.optional(),codec:P().optional(),preBufferSec:F().nonnegative().optional(),errorMessage:P().optional()}),Xd=B({id:P(),label:P(),protocol:U([`rtsp`,`rtmp`,`annexb`,`http-mjpeg`,`webrtc`,`custom`]),url:P().optional(),resolution:B({width:F(),height:F()}).readonly().optional(),fps:F().optional(),bitrate:F().optional(),codec:P().optional(),profileHint:Wd.optional()});B({type:P(),url:P(),videoCodec:P().optional(),audioCodec:P().optional(),metadata:H(P(),L()).readonly().optional()});var Zd=B({type:U([`video`,`audio`]),data:Rd(Uint8Array),pts:F(),dts:F(),keyframe:I(),codec:P()}),Qd=B({data:Rd(Uint8Array),width:F(),height:F(),format:U([`jpeg`,`rgb`,`bgr`,`yuv420`,`gray`]),timestamp:F()}),$d=B({shmId:P(),slot:F().int().nonnegative(),seq:F().int().nonnegative(),width:F().int().positive(),height:F().int().positive(),format:U([`jpeg`,`rgb`,`bgr`,`yuv420`,`gray`]),pts:F(),byteLength:F().int().nonnegative(),nodeId:P(),slotCount:F().int().positive()}),ef=U([`rgb`,`bgr`,`yuv420`,`gray`]),tf=B({brokerId:P(),format:ef,maxFps:F().positive().optional(),tag:P().optional()}),nf=B({subscriptionId:P(),maxFps:F().nonnegative()}),rf=B({data:Rd(Uint8Array),sampleRate:F().int().positive(),channels:F().int().positive(),timestamp:F()}),af=B({brokerId:P(),tag:P().optional()}),of=B({subscriptionId:P()}),sf=B({status:U([`idle`,`connecting`,`streaming`,`error`,`stopped`]),inputFps:F(),decodeFps:F(),encodedSubscribers:F(),decodedSubscribers:F(),uptimeMs:F(),bitrateKbps:F(),idrIntervalMs:F(),codec:P().optional(),totalBytes:F(),packetCount:F(),rtspClients:F(),pipeClients:F(),preBufferSec:F(),preBufferMs:F(),preBufferPackets:F(),decoderNodeId:P().nullable(),audio:B({codec:P(),sampleRate:F(),channels:F(),supported:I()}).nullable().optional()}),cf=B({profile:Wd,brokerId:P(),url:P(),mutedUrl:P(),enabled:I(),codec:P().optional(),resolution:Kd.optional()}),lf=F().int().min(0).max(6),uf=/^([01]\d|2[0-3]):[0-5]\d$/,df=rd(`kind`,[B({kind:W(`always`)}),B({kind:W(`timeOfDay`),start:P().regex(uf),end:P().regex(uf),days:z(lf).optional()})]),ff=U([`continuous`,`onMotion`,`onAudioThreshold`]),pf=U([`off`,`events`,`continuous`]),mf=B({motion:I().optional(),audioThresholdDbfs:F().optional()}),hf=U([`continuous`,`events`]),gf=mf,_f=B({days:z(lf),start:P().regex(uf),end:P().regex(uf),mode:hf,triggers:gf.optional(),preBufferSec:F().min(0).optional(),postBufferSec:F().min(0).optional()}),vf=B({schedule:df,mode:ff,preBufferSec:F().min(0).default(0),postBufferSec:F().min(0).default(0),resetTimeoutOnNewEvent:I().default(!0),thresholdDbfs:F().optional()}),yf=B({maxAgeDays:F().min(0).optional(),maxSizeGb:F().min(0).optional()}),bf=B({enabled:I(),mode:pf.optional(),profiles:z(Wd).optional(),segmentSeconds:F().int().positive().optional(),schedules:z(df).optional(),schedule:df.optional(),triggers:mf.optional(),preBufferSec:F().min(0).optional(),postBufferSec:F().min(0).optional(),rules:z(vf).optional(),bands:z(_f).optional(),retention:yf.optional()}),xf=P().regex(/^[a-z][a-zA-Z0-9-]*$/),Sf=B({id:P().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/),type:P(),displayName:P().min(1),providerId:P().min(1),config:H(P(),L()),nodeId:P().optional(),isDefault:I().default(!1),isSystem:I().default(!1),createdAt:F(),updatedAt:F()}),Cf=V([xf,P().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/)]),wf=B({id:P().regex(/^[a-z][a-zA-Z0-9-]*$/,{message:`id must start with a lowercase letter and contain only letters, digits, or hyphens`}),displayName:P().min(1,{message:`displayName must not be empty`}),description:P().optional(),cardinality:U([`single`,`multi`]),defaultsTo:P().optional()}),Tf=B({inputFps:F(),outputFps:F(),avgDecodeTimeMs:F(),droppedFrames:F()}),Ef=B({codec:P(),maxFps:F().default(0),outputFormat:U([`jpeg`,`rgb`,`bgr`,`yuv420`,`gray`]).default(`jpeg`),scale:F().default(1),width:F().optional(),height:F().optional(),deviceId:F().int().nonnegative().optional(),tag:P().optional(),frameSink:U([`callback`,`shm`]).default(`callback`)}),Df=B({video:B({codec:U([`h264`,`h265`,`copy`]),profile:U([`baseline`,`main`,`high`]).optional(),width:F().int().positive().optional(),height:F().int().positive().optional(),fps:F().positive().optional(),bitrateKbps:F().int().positive().optional(),gopFrames:F().int().positive().optional(),bf:F().int().min(0).optional(),preset:U([`ultrafast`,`superfast`,`veryfast`,`faster`,`fast`,`medium`]).optional(),tune:U([`zerolatency`,`film`,`animation`]).optional()}),audio:V([W(`passthrough`),B({codec:U([`opus`,`aac`,`pcmu`,`pcma`,`copy`]),bitrateKbps:F().int().positive().optional(),sampleRateHz:F().int().positive().optional(),channels:V([W(1),W(2)]).optional()})]),inputArgs:z(P()).optional(),outputArgs:z(P()).optional()}),Of={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},kf={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},Af=new Map;for(let[e,t]of Object.entries(Of.mapping))Af.set(e.toLowerCase(),t);for(let[e,t]of Object.entries(kf.mapping))Af.set(e.toLowerCase(),t);var 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}({}),jf=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}({}),Mf={Siren:q.Siren,Floodlight:q.Floodlight,Spotlight:q.Spotlight,PirSensor:q.PirSensor,Chime:q.Chime,Autotrack:q.Autotrack,Nightvision:q.Nightvision,PrivacyMask:q.PrivacyMask};Mf.Siren,Mf.Floodlight,Mf.Spotlight,Mf.PirSensor,Mf.Chime,Mf.Autotrack,Mf.Nightvision,Mf.PrivacyMask,jf.BatteryOperated;var Nf=B({online:I(),lastChangedAt:F()}),Pf={name:`device-status`,scope:`device`,deviceNative:!0,mode:`singleton`,methods:{},events:{onStatusChanged:{data:B({deviceId:F(),status:Nf})}},status:{schema:Nf,kind:`push`},runtimeState:Nf},Ff=B({flags:H(P(),L()),deviceType:P().nullable(),model:P().nullable(),channelCount:F().nullable(),lastProbedAt:F(),lastFetchedAt:F()}),If={name:`feature-probe`,scope:`device`,deviceNative:!0,mode:`singleton`,methods:{},events:{onProbeChanged:{data:B({deviceId:F(),status:Ff})}},status:{schema:Ff,kind:`push`},runtimeState:Ff},Lf=B({co2Ppm:F().min(0).optional(),vocPpb:F().min(0).optional(),pm25:F().min(0).optional(),pm10:F().min(0).optional(),aqi:F().optional(),lastFetchedAt:F(),unit:P().optional(),precision:F().int().min(0).max(10).optional()}),Rf={name:`air-quality-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Sensor],methods:{},status:{schema:Lf,kind:`push`},runtimeState:Lf},zf=B({id:P(),title:P(),description:P().optional(),style:U([`card`,`accordion`]).optional(),defaultCollapsed:I().optional(),columns:V([W(1),W(2),W(3),W(4)]).optional(),tab:P().optional(),location:U([`settings`,`top-tab`]).optional(),order:F().optional(),fields:z(Ku())});B({tabs:z(B({id:P(),label:P(),icon:P(),order:F().optional()})).optional(),sections:z(zf)}).nullable(),B({deviceId:F()}),B({deviceId:F()}),B({deviceId:F(),patch:H(P(),L())}),B({success:W(!0)}),B({deviceId:F()}),L().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 Bf(e){return{data:e}}var Vf=U([`disarmed`,`armed_home`,`armed_away`,`armed_night`,`armed_vacation`,`armed_custom_bypass`,`arming`,`disarming`,`pending`,`triggered`]),Hf=U([`home`,`away`,`night`,`vacation`,`custom_bypass`]),Uf=B({state:Vf,availableModes:z(Hf),requiresCode:I(),lastChangedAt:F()}),Wf={name:`alarm-panel`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.AlarmPanel],methods:{arm:J(B({deviceId:F().int().nonnegative(),mode:Hf,code:P().min(1).optional()}),R(),{kind:`mutation`,auth:`admin`}),disarm:J(B({deviceId:F().int().nonnegative(),code:P().min(1).optional()}),R(),{kind:`mutation`,auth:`admin`}),trigger:J(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:Uf,kind:`push`},runtimeState:Uf},Gf=B({lux:F().min(0),lastFetchedAt:F(),unit:P().optional(),precision:F().int().min(0).max(10).optional()}),Kf={name:`ambient-light-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Sensor],methods:{},status:{schema:Gf,kind:`push`},runtimeState:Gf},qf=B({className:P(),hits:F().int().nonnegative(),avgScore:F().min(0).max(1),peakScore:F().min(0).max(1)}),Jf=B({ts:F().int(),windowSec:F().int().positive(),level:B({rms:F(),dbfs:F()}),peakDbfs:F(),avgDbfs:F(),current:B({className:P(),score:F().min(0).max(1),timestamp:F().int()}).nullable(),byClass:z(qf).readonly()}),Yf=B({points:z(B({ts:F().int(),dbfs:F().nullable(),peakDbfs:F(),avgDbfs:F(),topClass:P().nullable(),topScore:F().min(0).max(1).nullable()})).readonly(),effectiveSampleEveryMs:F().int().positive(),windowMsActual:F().int().nonnegative()}),Xf={name:`audio-metrics`,scope:`device`,mode:`singleton`,deviceTypes:[K.Camera],methods:{getCurrentSnapshot:J(B({deviceId:F()}),Jf.nullable()),getHistory:J(B({deviceId:F(),windowSec:F().int().positive().optional(),sampleEveryMs:F().int().positive().optional()}),Yf)},runtimeState:Jf},Zf=B({enabled:I(),isRunning:I(),lastTriggeredAt:F(),lastError:P().nullable(),lastChangedAt:F()}),Qf={name:`automation-control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Automation],methods:{enable:J(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),disable:J(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),trigger:J(B({deviceId:F().int().nonnegative(),skipCondition:I().optional()}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:Zf,kind:`push`},runtimeState:Zf},$f=B({percentage:F().min(0).max(100),charging:U([`dc`,`solar`,`none`]),sleeping:I(),lastUpdated:F(),binary:I().optional()}),ep={name:`battery`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Camera,K.Sensor,K.Button,K.Switch],methods:{wakeForStream:J(B({deviceId:F(),timeoutMs:F().int().min(500).max(3e4).default(8e3)}),B({awoke:I(),durationMs:F()}),{kind:`mutation`})},events:{onStatusChanged:{data:B({deviceId:F(),status:$f})}},status:{schema:$f,kind:`push`},runtimeState:$f},tp=B({on:I(),lastChangedAt:F()}),np={name:`binary`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Sensor],methods:{},status:{schema:tp,kind:`push`},runtimeState:tp},rp=B({percentage:F().min(0).max(100),lastChangedAt:F()}),ip={name:`brightness`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Light],methods:{setBrightness:J(B({deviceId:F().int().nonnegative(),percentage:F().min(0).max(100)}),R(),{kind:`mutation`,auth:`admin`})},events:{onBrightnessChanged:{data:B({deviceId:F(),percentage:F().min(0).max(100),lastChangedAt:F()})}},status:{schema:rp,kind:`command-driven`},runtimeState:rp},ap=U([`webrtc`,`hls`,`mjpeg`,`rtsp`]),op=B({streamId:P(),format:ap,url:P().nullable(),active:I()}),sp={name:`streaming-engine`,scope:`system`,mode:`singleton`,internal:!0,methods:{registerStream:J(B({streamId:P(),sourceUrl:P(),codec:P().optional()}),R(),{kind:`mutation`}),unregisterStream:J(B({streamId:P()}),R(),{kind:`mutation`}),getStreamUrl:J(B({streamId:P(),format:ap}),P().nullable()),listStreams:J(R(),z(op))}},cp=B({brokerId:P(),url:P(),mutedUrl:P(),enabled:I(),codec:P().optional(),resolution:B({width:F().int().positive(),height:F().int().positive()}).optional()}),lp=B({sessionId:P(),remoteAddr:P(),playing:I(),muted:I(),connectedAt:F(),lastRtpAt:F(),bytesSent:F()}),up=B({tag:P(),subscribedAt:F(),maxFps:F(),framesDelivered:F(),framesDropped:F()}),dp=B({tag:P(),subscribedAt:F(),chunksDelivered:F()}),fp=B({kind:U([`alexa`,`homekit`,`webrtc-browser`,`webrtc-mobile`,`webrtc-whep`,`rtsp-listen`,`derived-broker`,`recording`,`pipeline`,`snapshot`,`warmup`,`unknown`]),label:P().optional(),media:U([`audio`,`video`,`both`]).optional(),targetCodec:P().optional(),transport:U([`passthrough`,`repacketize`,`transcode`]).optional(),remoteAddr:P().optional(),userAgent:P().optional(),userId:P().optional(),sessionId:P().optional(),extra:H(P(),P()).optional()}).readonly(),pp=B({id:P(),channel:U([`annexb`,`rtp`]),attribution:fp,subscribedAt:F(),packetsDelivered:F()}),mp=B({rtsp:z(lp).readonly(),decoded:z(up).readonly(),audio:z(dp).readonly(),encoded:z(pp).readonly(),pipeClients:F(),encodedSubscribers:F()});U([`reconnecting`,`sleeping`,`offline`,`disabled`,`waking`]);var hp=U([`h264`,`h265`,`copy`]),gp=U([`aac`,`opus`,`pcmu`,`copy`,`none`]),_p=B({deviceId:F().int().nonnegative(),video:hp,audio:gp.optional(),profile:Wd.optional(),targetResolution:B({width:F().int().positive(),height:F().int().positive()}).optional(),outputArgs:z(P()).optional(),audioEgress:I().optional(),hostname:P().optional(),tag:P().optional()}),vp=B({url:P(),videoCodec:U([`H264`,`H265`]),audioCodec:P(),resolution:B({width:F().int().positive(),height:F().int().positive()}),transcoded:I(),encoder:P(),pipelineKey:P()}),yp={name:`stream-broker`,scope:`system`,mode:`singleton`,exposesDeviceSettings:!0,methods:{publishCameraStream:J(B({deviceId:F().int().nonnegative(),camStreamId:P().min(1),kind:Gd,url:P().optional(),codec:P().optional(),resolution:Kd.optional(),fps:F().positive().optional(),label:P().optional(),deviceFeatures:z(P()).optional(),autoEligible:I().optional(),metadata:H(P(),L()).optional(),sourceCamStreamId:P().min(1).optional(),encodeProfile:Df.optional()}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`}),retractCameraStream:J(B({deviceId:F().int().nonnegative(),camStreamId:P().min(1)}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`}),assignProfile:J(B({deviceId:F().int().nonnegative(),profile:Wd,camStreamId:P().min(1)}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`}),unassignProfile:J(B({deviceId:F().int().nonnegative(),profile:Wd}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`}),listAllCameraStreams:J(R(),z(qd).readonly()),listAllProfileSlots:J(R(),z(Yd).readonly()),getBrokerStats:J(B({brokerId:P()}),sf),probeStream:J(B({brokerId:P()}),B({probed:I(),summary:P()}),{kind:`mutation`,auth:`admin`}),listClients:J(B({brokerId:P()}),mp),killClient:J(B({brokerId:P(),channel:U([`rtsp`,`decoded`,`audio`]),handle:P()}),B({killed:I()}),{kind:`mutation`,auth:`admin`}),restartProfile:J(B({deviceId:F().int().nonnegative(),profile:Wd}),B({success:I()}),{kind:`mutation`,auth:`admin`}),getStreamUrl:J(B({streamId:P(),format:ap}),B({url:P()})),getStreamWithCodec:J(_p,vp,{kind:`mutation`,auth:`admin`}),releaseStreamWithCodec:J(B({pipelineKey:P()}),B({released:I(),refcount:F().int().nonnegative()}),{kind:`mutation`,auth:`admin`}),subscribeAudioChunks:J(af,of,{kind:`mutation`}),pullAudioChunks:J(B({subscriptionId:P(),maxCount:F().int().positive().default(8)}),z(rf).readonly()),unsubscribeAudioChunks:J(B({subscriptionId:P()}),B({released:I()}),{kind:`mutation`}),subscribeFrames:J(tf,nf,{kind:`mutation`}),pullFrameHandles:J(B({subscriptionId:P(),maxCount:F().int().positive().default(4)}),z($d).readonly()),unsubscribeFrames:J(B({subscriptionId:P()}),B({released:I()}),{kind:`mutation`}),setPreBufferDuration:J(B({brokerId:P(),seconds:F().min(0).max(30)}),R(),{kind:`mutation`,auth:`admin`}),getPreBufferInfo:J(B({brokerId:P()}),B({configuredSec:F(),bufferedMs:F(),packetCount:F()})),getRtspPort:J(R(),F()),getAllRtspEntries:J(B({hostname:P().optional()}),z(cp).readonly()),getRtspEntry:J(B({brokerId:P(),hostname:P().optional()}),cp.nullable()),regenerateRtspToken:J(B({brokerId:P()}),P().nullable(),{kind:`mutation`,auth:`admin`}),setRtspEnabled:J(B({brokerId:P(),enabled:I()}),R(),{kind:`mutation`,auth:`admin`}),isRtspEnabled:J(B({brokerId:P()}),I())},events:{onCamStreamDemand:Bf(B({deviceId:F().int().nonnegative(),camStreamId:P(),profile:Wd})),onCamStreamIdle:Bf(B({deviceId:F().int().nonnegative(),camStreamId:P()})),onRequestStreamSourceRefresh:Bf(B({deviceId:F().int().nonnegative(),camStreamId:P(),brokerId:P()}))}},bp=U([`h264`,`h265`,`hevc`,`av1`,`mjpeg`,`vp8`,`vp9`]),xp=B({acceptCodecs:z(bp).readonly().optional(),minHeight:F().int().positive().optional(),minWidth:F().int().positive().optional(),excludeDerived:I().optional(),requireSiblingCodec:z(bp).readonly().optional()}).readonly(),Sp=B({preferredProviders:z(P()).readonly().optional(),resolutionPreference:U([`highest`,`lowest`]).optional()}).readonly(),Cp=B({camStreamId:P(),codec:P().optional(),resolution:Kd.optional(),reason:P()}),wp={name:`camera-streams`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[K.Camera],methods:{getCameraStreams:J(B({deviceId:F().int().nonnegative()}),z(qd).readonly()),getBrokerStreams:J(B({deviceId:F().int().nonnegative()}),z(Yd).readonly()),getRtspEntries:J(B({deviceId:F().int().nonnegative(),hostname:P().optional()}),z(cp).readonly()),getProfileRtspEntries:J(B({deviceId:F().int().nonnegative(),hostname:P().optional()}),z(cf).readonly()),pickStream:J(B({deviceId:F().int().nonnegative(),requirements:xp,preferences:Sp.optional()}),Cp.nullable())},events:{onCamStreamsChanged:Bf(B({deviceId:F().int().nonnegative(),camStreams:z(qd).readonly()})),onProfileSlotsChanged:Bf(B({deviceId:F().int().nonnegative(),profileSlots:z(Yd).readonly()}))},runtimeState:B({online:I(),slotStatuses:B({high:Jd.optional(),mid:Jd.optional(),low:Jd.optional()}),slotErrors:B({high:P().optional(),mid:P().optional(),low:P().optional()}),lastChangedAt:F()})},Tp=B({detected:I(),lastChangedAt:F()}),Ep={name:`carbon-monoxide`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Sensor],methods:{},status:{schema:Tp,kind:`push`},runtimeState:Tp},Dp=U([`off`,`heat`,`cool`,`auto`,`heat_cool`,`fan_only`,`dry`]),Op=B({mode:Dp,availableModes:z(Dp),fanMode:P(),availableFanModes:z(P()),preset:P(),availablePresets:z(P()),target:F().nullable(),targetHigh:F().nullable(),targetLow:F().nullable(),targetHumidity:F().min(0).max(100).nullable(),currentTemp:F().nullable(),currentHumidity:F().min(0).max(100).nullable(),lastFetchedAt:F()}),kp={name:`climate-control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Thermostat],methods:{setMode:J(B({deviceId:F().int().nonnegative(),mode:Dp}),R(),{kind:`mutation`,auth:`admin`}),setFanMode:J(B({deviceId:F().int().nonnegative(),fanMode:P().min(1)}),R(),{kind:`mutation`,auth:`admin`}),setPreset:J(B({deviceId:F().int().nonnegative(),preset:P().min(1)}),R(),{kind:`mutation`,auth:`admin`}),setTarget:J(B({deviceId:F().int().nonnegative(),target:F()}),R(),{kind:`mutation`,auth:`admin`}),setTargetRange:J(B({deviceId:F().int().nonnegative(),targetLow:F(),targetHigh:F()}),R(),{kind:`mutation`,auth:`admin`}),setTargetHumidity:J(B({deviceId:F().int().nonnegative(),targetHumidity:F().min(0).max(100)}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:Op,kind:`push`},runtimeState:Op},Ap=B({r:F().int().min(0).max(255),g:F().int().min(0).max(255),b:F().int().min(0).max(255)}),jp=B({h:F().min(0).max(360),s:F().min(0).max(100),v:F().min(0).max(100)}),Mp=rd(`mode`,[B({mode:W(`rgb`),rgb:Ap}),B({mode:W(`hsv`),hsv:jp}),B({mode:W(`mired`),mireds:F().int().min(50).max(1e3)})]),Np=B({mode:U([`rgb`,`hsv`,`mired`]),rgb:Ap.optional(),hsv:jp.optional(),mireds:F().int().optional(),lastChangedAt:F()}),Pp={name:`color`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Light],methods:{setColor:J(B({deviceId:F().int().nonnegative(),color:Mp}),R(),{kind:`mutation`,auth:`admin`})},events:{onColorChanged:{data:B({deviceId:F(),mode:U([`rgb`,`hsv`,`mired`]),rgb:Ap.optional(),hsv:jp.optional(),mireds:F().int().optional(),lastChangedAt:F()})}},status:{schema:Np,kind:`command-driven`},runtimeState:Np},Fp=B({connected:I(),lastChangedAt:F()}),Ip={name:`connectivity`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Sensor],methods:{},status:{schema:Fp,kind:`push`},runtimeState:Fp},Lp=B({items:z(B({key:P().min(1),label:P().min(1),level:F().min(0).max(100).nullable(),status:U([`ok`,`replace`]).nullable(),lastResetAt:F().nullable(),resettable:I()})),lastChangedAt:F()}),Rp={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(B({deviceId:F().int().nonnegative(),key:P().min(1)}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:Lp,kind:`push`},runtimeState:Lp.extend({lastFetchedAt:F()})},zp=B({entryOpen:I(),lastChangedAt:F()}),Bp={name:`contact`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Sensor],methods:{},status:{schema:zp,kind:`push`},runtimeState:zp},Vp=B({kind:U([`numeric`,`select`,`text`,`datetime`]),value:V([F(),P()]),options:z(P()),lastChangedAt:F(),unit:P().optional(),min:F().optional(),max:F().optional(),step:F().optional(),precision:F().int().min(0).max(10).optional(),format:U([`date`,`time`,`datetime`]).optional()}),Hp=rd(`kind`,[B({kind:W(`numeric`),value:F()}),B({kind:W(`select`),value:P().min(1)}),B({kind:W(`text`),value:P()}),B({kind:W(`datetime`),value:P().min(1)})]),Up={name:`control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Control],methods:{setValue:J(B({deviceId:F().int().nonnegative(),control:Hp}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:Vp,kind:`push`},runtimeState:Vp},Wp=B({state:U([`open`,`opening`,`closing`,`closed`,`stopped`]),position:F().min(0).max(100).nullable(),tiltPosition:F().min(0).max(100).nullable(),lastChangedAt:F()}),Gp={name:`cover`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Cover],methods:{open:J(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),close:J(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),stop:J(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),setPosition:J(B({deviceId:F().int().nonnegative(),position:F().min(0).max(100)}),R(),{kind:`mutation`,auth:`admin`}),setTiltPosition:J(B({deviceId:F().int().nonnegative(),tiltPosition:F().min(0).max(100)}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:Wp,kind:`push`},runtimeState:Wp},Kp=B({id:P(),system:P(),uniqueId:P().optional(),raw:H(P(),L()).optional()}),qp=U([`online`,`sleeping`,`offline`,`unknown`]),Jp=Nd(()=>B({childNativeId:P(),name:P(),type:U(K),status:qp,metadata:B({model:P().optional(),serialNumber:P().optional(),uid:P().optional(),rtspChannel:F().int().nonnegative().optional(),isBattery:I().optional(),isDoorbell:I().optional(),isMultifocal:I().optional(),externalLocation:P().optional(),manufacturer:P().optional(),integration:P().optional()}).default({}),alreadyAdopted:I(),adoptedDeviceId:F().int().nonnegative().nullable(),capabilities:z(P()).readonly().optional(),features:z(P()).readonly().optional(),sourceInfo:Kp.optional(),children:z(Jp).readonly().optional()})),Yp=B({discovered:z(Jp),lastDiscoveryAt:F().int().nonnegative().nullable(),lastError:P().nullable()}),Xp={name:`device-discovery`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Hub],status:{schema:Yp,kind:`poll`},runtimeState:Yp.extend({lastFetchedAt:F().int().nonnegative()}),methods:{listDiscovered:J(B({deviceId:F().int().nonnegative()}),z(Jp).readonly()),refreshDiscovery:J(B({deviceId:F().int().nonnegative()}),z(Jp).readonly(),{kind:`mutation`,auth:`admin`}),adoptDevice:J(B({deviceId:F().int().nonnegative(),childNativeId:P(),name:P().optional()}),B({deviceId:F().int().nonnegative(),stableId:P()}),{kind:`mutation`,auth:`admin`}),releaseDevice:J(B({deviceId:F().int().nonnegative(),childDeviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`})}},Zp=B({lastPressedAt:F().nullable(),pressCountSinceStart:F()}),Qp=B({deviceId:F(),timestamp:F()}),$p={name:`doorbell`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Button],methods:{},events:{onPressed:{data:Qp}},status:{schema:Zp,kind:`push`},runtimeState:Zp},em=U([`date`,`time`,`datetime`]),tm=B({value:P(),format:em.optional(),lastFetchedAt:F()}),nm={name:`enum-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Sensor],methods:{},status:{schema:tm,kind:`push`},runtimeState:tm},rm=B({deviceId:F(),eventType:P(),data:H(P(),L()).nullable(),timestamp:F(),seq:F()}),im=B({eventTypes:z(P()),lastEvent:rm.nullable(),eventCountSinceStart:F()}),am={name:`event-emitter`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.EventEmitter],methods:{},events:{onEvent:{data:rm}},status:{schema:im,kind:`push`},runtimeState:im},om=U([`forward`,`reverse`]),sm=B({percentage:F().min(0).max(100).nullable(),percentageStep:F().positive().optional(),preset:P(),availablePresets:z(P()),direction:om.nullable(),oscillating:I().nullable(),lastChangedAt:F()}),cm={name:`fan-control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Fan],methods:{setPercentage:J(B({deviceId:F().int().nonnegative(),percentage:F().min(0).max(100)}),R(),{kind:`mutation`,auth:`admin`}),setPreset:J(B({deviceId:F().int().nonnegative(),preset:P().min(1)}),R(),{kind:`mutation`,auth:`admin`}),setDirection:J(B({deviceId:F().int().nonnegative(),direction:om}),R(),{kind:`mutation`,auth:`admin`}),setOscillating:J(B({deviceId:F().int().nonnegative(),oscillating:I()}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:sm,kind:`push`},runtimeState:sm},lm=B({flooded:I(),lastChangedAt:F()}),um={name:`flood`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Sensor],methods:{},status:{schema:lm,kind:`push`},runtimeState:lm},dm=B({detected:I(),lastChangedAt:F()}),fm={name:`gas`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Sensor],methods:{},status:{schema:dm,kind:`push`},runtimeState:dm},pm=B({on:I(),currentHumidity:F().min(0).max(100).nullable(),targetHumidity:F().min(0).max(100).nullable(),mode:P().nullable(),availableModes:z(P()),action:P().nullable(),minHumidity:F().nullable(),maxHumidity:F().nullable(),lastChangedAt:F()}),mm={name:`humidifier`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Humidifier],methods:{setOn:J(B({deviceId:F().int().nonnegative(),on:I()}),R(),{kind:`mutation`,auth:`admin`}),setTargetHumidity:J(B({deviceId:F().int().nonnegative(),humidity:F().min(0).max(100)}),R(),{kind:`mutation`,auth:`admin`}),setMode:J(B({deviceId:F().int().nonnegative(),mode:P().min(1)}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:pm,kind:`push`},runtimeState:pm},hm=B({percent:F().min(0).max(100),lastFetchedAt:F(),unit:P().optional(),precision:F().int().min(0).max(10).optional()}),gm={name:`humidity-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Sensor,K.Thermostat],methods:{},status:{schema:hm,kind:`push`},runtimeState:hm},_m=B({url:P().nullable(),lastUpdated:F().nullable()}),vm={name:`image`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Image],methods:{},status:{schema:_m,kind:`push`},runtimeState:_m},ym=B({activity:U([`idle`,`mowing`,`paused`,`docked`,`error`]),batteryLevel:F().min(0).max(100).nullable(),lastChangedAt:F()}),bm={name:`lawn-mower-control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.LawnMower],methods:{startMowing:J(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),pause:J(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),dock:J(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:ym,kind:`push`},runtimeState:ym},xm=B({state:U([`locked`,`unlocked`,`locking`,`unlocking`,`jammed`]),lastChangedAt:F()}),Sm={name:`lock-control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Lock],methods:{lock:J(B({deviceId:F().int().nonnegative(),code:P().min(1).optional()}),R(),{kind:`mutation`,auth:`admin`}),unlock:J(B({deviceId:F().int().nonnegative(),code:P().min(1).optional()}),R(),{kind:`mutation`,auth:`admin`}),open:J(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:xm,kind:`push`},runtimeState:xm},Cm=U([`off`,`on`,`idle`,`playing`,`paused`,`buffering`,`standby`]),wm=U([`off`,`all`,`one`]),Tm=B({type:P(),title:P(),artist:P().optional(),album:P().optional(),imageUrl:P().optional()}),Em=B({state:Cm,volumeLevel:F().min(0).max(100).nullable(),isMuted:I().nullable(),source:P(),availableSources:z(P()),currentMedia:Tm.nullable(),positionMs:F().int().nonnegative().nullable(),durationMs:F().int().nonnegative().nullable(),shuffle:I().nullable(),repeat:wm.nullable(),lastChangedAt:F()}),Dm={name:`media-player`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.MediaPlayer],methods:{play:J(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),pause:J(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),stop:J(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),next:J(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),previous:J(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),seek:J(B({deviceId:F().int().nonnegative(),positionMs:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),setVolume:J(B({deviceId:F().int().nonnegative(),volumeLevel:F().min(0).max(100)}),R(),{kind:`mutation`,auth:`admin`}),setMute:J(B({deviceId:F().int().nonnegative(),muted:I()}),R(),{kind:`mutation`,auth:`admin`}),setShuffle:J(B({deviceId:F().int().nonnegative(),shuffle:I()}),R(),{kind:`mutation`,auth:`admin`}),setRepeat:J(B({deviceId:F().int().nonnegative(),repeat:wm}),R(),{kind:`mutation`,auth:`admin`}),selectSource:J(B({deviceId:F().int().nonnegative(),source:P().min(1)}),R(),{kind:`mutation`,auth:`admin`}),playMedia:J(B({deviceId:F().int().nonnegative(),mediaId:P().min(1),mediaType:P().min(1)}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:Em,kind:`push`},runtimeState:Em},Om=U([`jpeg`,`rgb`,`bgr`,`yuv420`,`gray`]),km=B({data:Fd(),format:Om,width:F(),height:F(),timestamp:F()}),Am=B({x:F(),y:F(),w:F(),h:F()}),jm=B({class:P(),originalClass:P(),score:F(),bbox:Am}),Mm=B({data:Rd(Uint8Array),sampleRate:F(),channels:F(),timestamp:F(),deviceId:F().optional()}),Nm=B({rms:F(),dbfs:F()}),Pm=B({className:P(),originalClass:P().optional(),score:F()}),Fm=B({bbox:Am,pixelCount:F(),intensity:F()}),Im=B({detected:I(),regionCount:F(),regions:z(Fm).readonly(),rawRegions:z(Fm).readonly(),frameWidth:F(),frameHeight:F(),analysisMs:F()}),Lm={name:`motion-detection`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,exposesDeviceSettings:!0,methods:{analyze:J(B({deviceId:F(),frame:km}),Im,{kind:`mutation`}),removeCamera:J(B({deviceId:F()}),R(),{kind:`mutation`}),reset:J(R(),R(),{kind:`mutation`})},events:{onMotion:{data:B({deviceId:F(),detected:I(),regionCount:F()})}}};B({activeCameras:F(),throttledCameras:F(),avgInferenceTimeMs:F(),queueDepth:F()});var Rm=B({detectionMode:U([`disabled`,`always-on`,`on-motion`]),configuredFps:F(),actualFps:F(),queueDepth:F(),avgInferenceTimeMs:F(),droppedFrames:F(),phase:U([`idle`,`watching`,`active`])}),zm=Rm.extend({deviceId:F()}),Bm=U([`onnx`,`coreml`,`openvino`,`tflite`,`pt`]),Vm=U([`detector`,`cropper`,`classifier`,`refiner`,`audio-classifier`]),Hm=B({runtime:U([`node`,`python`]),backend:P(),format:Bm,device:P().optional()}),Um=B({engine:Hm,devices:z(B({id:P(),label:P(),description:P().optional()})).readonly(),defaultDevice:P()}),Wm=Nd(()=>B({addonId:P(),addonName:P(),slot:Vm,inputClasses:z(P()).readonly(),outputClasses:z(P()).readonly(),enabled:I(),modelId:P(),children:z(Wm).readonly(),engine:Hm.optional(),group:P().optional(),settings:H(P(),L()).optional()})),Gm=Nd(()=>B({addonId:P(),enabled:I(),modelId:P(),children:z(Gm).readonly(),settings:H(P(),L()).optional()})),Km=B({id:P(),name:P(),createdAt:P(),updatedAt:P(),engine:Hm,steps:z(Gm).readonly()}),qm=B({id:P(),name:P(),formats:H(P(),B({downloaded:I(),sizeMB:F()}))}),Jm=Fd(),Ym=B({id:P(),name:P(),slot:Vm,inputClasses:z(P()).readonly(),outputClasses:z(P()).readonly(),childSlots:z(Vm).readonly(),models:z(qm).readonly(),defaultModelId:P(),defaultModelIdByFormat:H(P(),P()).optional(),enabledByDefault:I().optional(),defaultConfidence:F(),group:P().optional(),configSchema:z(Jm).readonly().optional()}),Xm=B({id:Vm,label:P(),priority:F(),parentSlot:Vm.nullable(),addons:z(Ym).readonly()}),Zm=B({availableEngines:z(Um).readonly(),selectedEngine:Hm,slots:z(Xm).readonly()}),Qm=B({detections:z(jm).readonly(),inferenceMs:F(),modelId:P()}),$m=B({runtimeId:U([`onnx`,`openvino`,`coreml`]).nullable(),device:P().nullable(),state:U([`idle`,`installing`,`verifying`,`ready`,`failed`]),progress:F().optional(),error:P().optional(),nextRetryAt:F().optional()}),eh=Nd(()=>B({addonId:P(),modelId:P(),enabled:I().default(!0),children:z(eh).optional(),settings:H(P(),L()).optional()})),th=B({filename:P(),stepIds:z(P()).readonly().optional()}),nh=B({base64:P(),filename:P()}),rh=B({filename:P(),sizeKb:F()}),ih=B({base64:P()}),ah=B({id:P(),name:P(),description:P(),available:I(),rawLabels:z(P()).readonly().optional()}),oh=B({activeBackend:P(),availableBackends:z(ah).readonly(),sampleRate:F(),chunkDurationMs:F()}),sh=B({filePath:P(),sizeMB:F(),durationMs:F()}),ch=B({success:I(),error:P().optional(),frame:Fd().optional()}),lh=Fd(),uh=Fd(),dh=Fd(),fh=Fd(),ph=Fd(),mh=Fd(),hh={name:`pipeline-executor`,scope:`system`,mode:`singleton`,methods:{getAvailableEngines:J(R(),z(Hm)),getSelectedEngine:J(R(),Hm),getDefaultSteps:J(Hm,z(Wm)),reprobeEngine:J(R(),Hm,{kind:`mutation`,auth:`admin`}),getEngineProvisioning:J(B({nodeId:P()}),$m),getVideoPipelineSteps:J(R(),H(P(),B({modelId:P(),settings:H(P(),L()).readonly()}))),setVideoPipelineSteps:J(B({steps:H(P(),B({modelId:P(),settings:H(P(),L()).readonly()}))}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`}),getSchema:J(R(),Zm),getGlobalSteps:J(R(),z(Wm).readonly().nullable()),getGlobalPipelineConfig:J(R(),lh),getOrchestratorConfigSchema:J(R(),uh),listTemplates:J(R(),z(Km).readonly()),saveTemplate:J(B({name:P(),steps:z(Gm).readonly(),engine:Hm}),Km,{kind:`mutation`}),updateTemplate:J(B({id:P(),name:P().optional(),steps:z(Gm).readonly().optional()}),Km,{kind:`mutation`}),deleteTemplate:J(B({id:P()}),R(),{kind:`mutation`}),getCapabilities:J(R(),fh),getAddonModels:J(B({addonId:P()}),ph),downloadModel:J(B({addonId:P(),modelId:P(),format:Bm}),sh,{kind:`mutation`}),deleteModel:J(B({addonId:P(),modelId:P(),format:Bm}),B({success:W(!0)}),{kind:`mutation`}),detect:J(B({addonId:P(),frame:km,config:H(P(),L()).optional()}),Qm),runPipeline:J(B({engine:Hm.optional(),steps:z(eh).min(1),frame:km.optional(),imageBase64:P().optional(),image:Rd(Uint8Array).optional(),referenceImage:P().optional(),deviceId:F().optional(),sessionId:P().optional()}),mh,{kind:`mutation`}),runPipelineBatch:J(B({engine:Hm.optional(),steps:z(eh).min(1),frames:z(km).min(1).max(255),deviceId:F().optional(),sessionId:P().optional()}),B({results:z(mh).readonly()}),{kind:`mutation`}),cacheFrameInPool:J(B({data:Rd(Uint8Array),width:F().int().positive(),height:F().int().positive(),format:U([`rgb`,`bgr`,`gray`])}),B({frameId:F(),width:F(),height:F()}),{kind:`mutation`}),inferCached:J(B({stepId:P(),frameId:F().int()}),H(P(),L()),{kind:`mutation`}),uncacheFrame:J(B({frameId:F().int()}),R(),{kind:`mutation`}),getEffectiveTuning:J(R(),B({batchMode:P(),windowMs:F(),maxBatchSize:F(),concurrency:F()})),listLoadedEngines:J(R(),z(B({engineKey:P(),engine:Hm,modelsLoaded:z(P()).readonly(),inUseByCameras:z(F()).readonly(),kind:U([`runtime`,`warm-override`]),poolPid:F().nullable(),idleMs:F().nullable(),idleTtlMs:F().nullable()})).readonly()),spinEngine:J(B({engine:Hm}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`}),killEngine:J(B({engine:Hm,force:I().optional()}),B({success:I(),reason:P().optional()}),{kind:`mutation`,auth:`admin`}),listReferenceImages:J(R(),z(th).readonly()),getReferenceImage:J(B({filename:P()}),nh.nullable()),getReferenceAudioFiles:J(R(),z(rh).readonly()),getReferenceAudio:J(B({filename:P()}),ih.nullable()),getAudioCapabilities:J(R(),oh),runAudioTest:J(B({addonId:P(),modelId:P(),filename:P().optional(),settings:H(P(),L()).optional()}),ch,{kind:`mutation`}),getDetectionConfigSchema:J(R(),dh)}},gh=U([`polygon`,`tripwire`]),_h=B({x:F(),y:F()}),vh=B({id:P(),name:P(),kind:gh.default(`polygon`),polygon:z(_h).readonly(),color:P().default(`#3b82f6`)}),yh={name:`zones`,scope:`device`,mode:`singleton`,deviceTypes:[K.Camera],methods:{listZones:J(B({deviceId:F()}),z(vh).readonly()),addZone:J(B({deviceId:F(),zone:vh}),R(),{kind:`mutation`,auth:`admin`}),removeZone:J(B({deviceId:F(),zoneId:P()}),R(),{kind:`mutation`,auth:`admin`}),updateZone:J(B({deviceId:F(),zone:vh}),R(),{kind:`mutation`,auth:`admin`})},runtimeState:B({zones:z(vh).readonly()})},bh={min:0,max:6e4,default:3e4,step:500},xh={min:1,max:30,default:4,step:1},Sh={min:1,max:30,default:10,step:1},Ch={min:0,max:300,default:30,step:5},wh={min:1,max:10,default:4,step:1},Th=U([`onboard`,`analyzer`]),Eh=z(Th),Dh=B({deviceId:F(),detected:I(),source:Th.default(`analyzer`),regions:z(Fm).readonly().optional()}),Oh=B({deviceId:F(),detectionMode:U([`disabled`,`always-on`,`on-motion`]).default(`on-motion`),audioMode:U([`disabled`,`always-on`,`on-motion`]).default(`always-on`),motionCooldownMs:F().min(bh.min).default(bh.default),motionFps:F().min(xh.min).max(xh.max).default(xh.default),detectionFps:F().min(Sh.min).max(Sh.max).default(Sh.default),motionStreamId:P(),detectionStreamId:P(),motionSources:Eh.default([`analyzer`]),pipelineEnabled:I().default(!0),engine:Hm.optional(),steps:z(eh).readonly().optional(),audio:B({engine:Hm,modelId:P(),enabled:I()}).nullable().optional(),zones:z(vh).readonly().default([]),onboardMotionDrivesAnalyzer:I().default(!0),occupancyRecheckSec:F().min(Ch.min).max(Ch.max).default(Ch.default),occupancyRecheckFrames:F().min(wh.min).max(wh.max).default(wh.default)});xh.min,xh.max,xh.step,xh.default,Sh.min,Sh.max,Sh.step,Sh.default,bh.min,bh.max,bh.step,bh.default,Ch.min,Ch.max,Ch.step,Ch.default,wh.min,wh.max,wh.step,wh.default;var kh=B({nodeId:P(),attachedCameras:F(),activeCameras:F(),avgInferenceFps:F(),avgInferenceTimeMs:F(),queueDepthTotal:F(),hardware:B({hasGpu:I(),inferenceBackend:P().optional(),cpuCores:F().optional()})}),Ah=B({nodeId:P(),activeCameras:F(),throttledCameras:F(),avgInferenceTimeMs:F(),queueDepth:F()}),jh={name:`pipeline-runner`,scope:`system`,mode:`singleton`,methods:{attachCamera:J(Oh,B({success:W(!0)}),{kind:`mutation`}),detachCamera:J(B({deviceId:F()}),B({success:W(!0)}),{kind:`mutation`}),reportMotion:J(Dh,B({success:W(!0)}),{kind:`mutation`}),getLocalLoad:J(R(),kh),getLocalMetrics:J(R(),Ah),getCameraMetrics:J(B({deviceId:F()}),Rm.nullable()),getAllCameraMetrics:J(R(),z(zm).readonly()),getLocalCameras:J(R(),z(F()).readonly())}},Mh=B({detected:I(),lastDetectedAt:F().nullable(),autoClearAfterMs:F().nullable()}),Nh=B({deviceId:F(),detected:I(),timestamp:F(),source:Th,regions:z(Fm).readonly().optional()}),Ph={name:`motion`,scope:`device`,mode:`singleton`,deviceTypes:[K.Camera,K.Sensor],methods:{isDetected:J(B({deviceId:F()}),I())},events:{onMotionChanged:{data:Nh}},status:{schema:Mh,kind:`push`},runtimeState:Mh},Fh=B({enabled:I(),lastChangedAt:F()}),Ih=Fh.extend({lastFetchedAt:F()}),Lh={name:`motion-trigger`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Light,K.Siren,K.Switch],methods:{setMotionTrigger:J(B({deviceId:F().int().nonnegative(),enabled:I()}),R(),{kind:`mutation`,auth:`admin`})},events:{onMotionTriggerChanged:{data:B({deviceId:F(),enabled:I(),lastChangedAt:F()})}},status:{schema:Fh,kind:`command-driven`},runtimeState:Ih},Rh=B({x:F(),y:F()}),zh=B({kind:W(`rect`),x:F(),y:F(),width:F(),height:F()}),Bh=B({kind:W(`polygon`),points:z(Rh)}),Vh=B({kind:W(`grid`),gridWidth:F(),gridHeight:F(),cells:z(I())});rd(`kind`,[zh,Bh,Vh,B({kind:W(`line`),points:z(Rh)})]);var Hh=U([`rect`,`polygon`,`grid`,`line`]),Uh=B({min:F(),max:F()}),Wh=B({width:F(),height:F()}),Gh=B({id:F(),enabled:I(),shape:Vh}),Kh=B({enabled:I(),sensitivity:F(),regions:z(Gh),lastFetchedAt:F()}),qh=B({maxRegions:F(),supportedShapes:z(Hh),grid:Wh,sensitivity:B({min:F(),max:F(),step:F()})}),Jh=B({enabled:I().optional(),sensitivity:F().optional(),regions:z(Gh).optional()}),Yh={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(B({deviceId:F()}),qh),setZone:J(B({deviceId:F(),patch:Jh}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:Kh,kind:`poll`},runtimeState:Kh},Xh=U([`person`,`vehicle`,`animal`,`face`,`package`,`other`]),Zh=B({class:Xh,timestamp:F(),confidence:F().min(0).max(1).optional()}),Qh=B({lastByClass:ld(Xh,Zh.nullable()),supportedClasses:z(Xh).readonly(),enabled:I()}),$h=Qh.extend({lastFetchedAt:F()}),eg={name:`native-object-detection`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Camera],methods:{setEnabled:J(B({deviceId:F(),enabled:I()}),R(),{kind:`mutation`,auth:`admin`})},events:{onDetected:{data:B({deviceId:F(),detection:Zh})}},status:{schema:Qh,kind:`push`},runtimeState:$h},tg=U([`min`,`low`,`normal`,`high`]),ng=B({id:P().min(1),title:P().min(1),uri:Cu().optional(),destructive:I().optional()}),rg=B({image:I(),priority:I(),data:I(),actions:I(),recipients:I()}),ig=B({lastSentAt:F(),lastError:P().nullable(),queueDepth:F().int().nonnegative(),supports:rg}),ag=B({deviceId:F().int().nonnegative(),title:P().optional(),body:P().min(1),image:P().optional(),priority:tg.optional(),channel:P().optional(),recipients:z(P()).optional(),actions:z(ng).optional(),data:H(P(),L()).optional()}),og=B({notificationId:P(),acceptedAt:F()}),sg={name:`notifier`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Notifier],methods:{send:J(ag,og,{kind:`mutation`,auth:`admin`}),cancel:J(B({deviceId:F().int().nonnegative(),notificationId:P().min(1)}),R(),{kind:`mutation`,auth:`admin`})},events:{onSent:{data:B({deviceId:F(),notificationId:P(),success:I(),error:P().nullable(),acceptedAt:F()})}},status:{schema:ig,kind:`command-driven`},runtimeState:ig},cg=B({value:F(),unit:P().optional(),precision:F().int().min(0).max(10).optional(),lastFetchedAt:F()}),lg={name:`numeric-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Sensor],methods:{},status:{schema:cg,kind:`push`},runtimeState:cg},ug=B({watts:F().optional(),kwhTotal:F().optional(),volts:F().optional(),amps:F().optional(),va:F().optional(),powerFactor:F().min(0).max(1).optional(),lastFetchedAt:F(),unit:P().optional(),precision:F().int().min(0).max(10).optional()}),dg={name:`power-meter`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Sensor],methods:{},status:{schema:ug,kind:`push`},runtimeState:ug},fg=B({latitude:F().min(-90).max(90),longitude:F().min(-180).max(180),accuracyMeters:F().nonnegative()}),pg=B({state:P(),location:P().nullable(),gps:fg.nullable(),batteryPercent:F().min(0).max(100).nullable(),lastChangedAt:F()}),mg={name:`presence`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Presence],methods:{},status:{schema:pg,kind:`push`},runtimeState:pg},hg=B({hpa:F(),lastFetchedAt:F(),unit:P().optional(),precision:F().int().min(0).max(10).optional()}),gg={name:`pressure-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Sensor],methods:{},status:{schema:hg,kind:`push`},runtimeState:hg},_g=rd(`kind`,[zh,Bh]),vg=B({id:F(),enabled:I(),shape:_g}),yg=B({enabled:I(),regions:z(vg),lastFetchedAt:F()}),bg=B({maxRegions:F(),supportedShapes:z(Hh),polygonVertices:Uh.optional()}),xg=B({enabled:I().optional(),regions:z(vg).optional()}),Sg={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(B({deviceId:F()}),bg),setMask:J(B({deviceId:F(),patch:xg}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:yg,kind:`poll`},runtimeState:yg},Cg=B({targetType:P().describe(`Vendor target string (people/vehicle/pet); empty = camera default`),stopDelaySeconds:F().int().min(0).max(300),disappearDelaySeconds:F().int().min(0).max(300)}),wg=B({value:P(),label:P()}),Tg=B({enabled:I(),lastChangedAt:F(),currentSettings:Cg.nullable(),supportedTargetTypes:z(wg)}),Eg=Tg.extend({lastFetchedAt:F()}),Dg={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(B({deviceId:F()}),Tg),setEnabled:J(B({deviceId:F(),enabled:I()}),R(),{kind:`mutation`}),getSettings:J(B({deviceId:F()}),Cg.nullable()),setSettings:J(B({deviceId:F(),settings:Cg.partial()}),R(),{kind:`mutation`})},events:{onStatusChanged:{data:B({deviceId:F(),status:Tg})}},status:{schema:Tg,kind:`command-driven`},runtimeState:Eg},Og=B({isRunning:I(),lastRunAt:F(),lastRunSuccess:I().nullable(),lastError:P().nullable(),lastChangedAt:F()}),kg={name:`script-runner`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Script],methods:{run:J(B({deviceId:F().int().nonnegative(),variables:H(P(),L()).optional()}),R(),{kind:`mutation`,auth:`admin`}),stop:J(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:Og,kind:`push`},runtimeState:Og},Ag=B({detected:I(),lastChangedAt:F()}),jg={name:`smoke`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Sensor],methods:{},status:{schema:Ag,kind:`push`},runtimeState:Ag},Mg=U([`main`,`sub`,`ext`]),Ng=B({width:F(),height:F(),codec:U([`h264`,`h265`]),framerate:F(),bitrate:F(),bitrateMode:U([`vbr`,`cbr`]).optional(),encoderProfile:U([`high`,`main`,`baseline`]).optional(),gop:F().optional(),audio:I().optional()}),Pg=B({main:Ng.optional(),sub:Ng.optional(),ext:Ng.optional(),lastFetchedAt:F()}),Fg=B({resolutions:z(B({width:F(),height:F()})),codecs:z(U([`h264`,`h265`])),framerates:z(F()),bitrates:z(F()),bitrateRange:sd([F(),F()]).optional(),supportsBitrateMode:I(),supportsEncoderProfile:I(),supportsGop:I(),gop:B({min:F(),max:F(),step:F()}).optional()}),Ig=B({main:Fg.optional(),sub:Fg.optional(),ext:Fg.optional()}),Lg=B({width:F().optional(),height:F().optional(),codec:U([`h264`,`h265`]).optional(),framerate:F().optional(),bitrate:F().optional(),bitrateMode:U([`vbr`,`cbr`]).optional(),encoderProfile:U([`high`,`main`,`baseline`]).optional(),gop:F().optional(),audio:I().optional()}),Rg={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(B({deviceId:F()}),Ig),setProfile:J(B({deviceId:F(),profile:Mg,patch:Lg}),R(),{kind:`mutation`,auth:`admin`}),getConfigSchema:J(B({deviceId:F()}),L().nullable())},status:{schema:Pg,kind:`poll`},runtimeState:Pg},zg=B({on:I(),lastChangedAt:F()}),Bg={name:`switch`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Switch,K.Siren,K.Light],methods:{setState:J(B({deviceId:F(),on:I()}),R(),{kind:`mutation`,auth:`admin`})},events:{onStateChanged:{data:B({deviceId:F(),on:I(),lastChangedAt:F()})}},status:{schema:zg,kind:`command-driven`},runtimeState:zg,settings:{bindings:[{kind:`scalar`,statusPath:`on`,method:`setState`,valueArg:`on`,field:{label:`On`,kind:`boolean`}}]}},Vg=B({tampered:I(),lastChangedAt:F()}),Hg={name:`tamper`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Sensor],methods:{},status:{schema:Vg,kind:`push`},runtimeState:Vg},Ug=B({celsius:F(),lastFetchedAt:F(),unit:P().optional(),precision:F().int().min(0).max(10).optional()}),Wg={name:`temperature-sensor`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Sensor,K.Thermostat],methods:{},status:{schema:Ug,kind:`push`},runtimeState:Ug},Gg=B({currentVersion:P().nullable(),availableVersion:P().nullable(),updatable:I(),state:P().nullable(),inProgress:I()}),Kg={name:`update`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Update],methods:{installUpdate:J(R(),R(),{kind:`mutation`,auth:`admin`})},status:{schema:Gg,kind:`poll`},runtimeState:Gg},qg=U([`idle`,`cleaning`,`paused`,`returning`,`docked`,`error`]),Jg=B({level:F().min(0).max(100).nullable(),status:U([`ok`,`low`,`full`]).nullable()}),Yg=B({state:qg,batteryLevel:F().min(0).max(100).nullable(),fanSpeed:P().nullable(),availableFanSpeeds:z(P()),cleanWater:Jg.nullable(),dirtyWater:Jg.nullable(),detergent:Jg.nullable(),dustBin:Jg.nullable(),lastChangedAt:F()}),Xg={name:`vacuum-control`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Vacuum],methods:{start:J(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),pause:J(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),stop:J(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),returnToBase:J(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),locate:J(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),setFanSpeed:J(B({deviceId:F().int().nonnegative(),speed:P().min(1)}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:Yg,kind:`push`},runtimeState:Yg},Zg=B({state:U([`open`,`opening`,`closing`,`closed`,`stopped`]),position:F().min(0).max(100).nullable(),lastChangedAt:F()}),Qg={name:`valve`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Valve],methods:{open:J(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),close:J(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),stop:J(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`}),setPosition:J(B({deviceId:F().int().nonnegative(),position:F().min(0).max(100)}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:Zg,kind:`push`},runtimeState:Zg},$g=B({detected:I(),lastChangedAt:F()}),e_={name:`vibration`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Sensor],methods:{},status:{schema:$g,kind:`push`},runtimeState:$g},t_=B({currentTemp:F().nullable(),targetTemp:F().nullable(),operationMode:P().nullable(),availableModes:z(P()),away:I().nullable(),minTemp:F().nullable(),maxTemp:F().nullable(),lastChangedAt:F()}),n_={name:`water-heater`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.WaterHeater],methods:{setTargetTemp:J(B({deviceId:F().int().nonnegative(),temp:F().finite()}),R(),{kind:`mutation`,auth:`admin`}),setOperationMode:J(B({deviceId:F().int().nonnegative(),mode:P().min(1)}),R(),{kind:`mutation`,auth:`admin`}),setAway:J(B({deviceId:F().int().nonnegative(),on:I()}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:t_,kind:`push`},runtimeState:t_},r_=B({condition:P().nullable(),temperature:F().nullable(),temperatureUnit:P().nullable(),humidity:F().min(0).max(100).nullable(),pressure:F().nullable(),pressureUnit:P().nullable(),windSpeed:F().nullable(),windSpeedUnit:P().nullable(),windBearing:F().nullable(),lastFetchedAt:F()}),i_={name:`weather`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Weather],methods:{},status:{schema:r_,kind:`push`},runtimeState:r_},a_=B({totalObjects:F().int().nonnegative(),byClass:H(P(),F().int().nonnegative())}),o_=a_.extend({zoneId:P(),zoneName:P(),trackIds:z(P()).readonly()}),s_=B({ts:F().int(),frameWidth:F().int().nonnegative(),frameHeight:F().int().nonnegative(),zones:z(o_).readonly(),frame:a_,unzoned:a_}),c_=U([`minute`,`5min`,`hour`]),l_=B({from:F().int(),to:F().int(),resolution:c_}),u_=B({ts:F().int(),count:F().int().nonnegative()}),d_={name:`zone-analytics`,scope:`device`,mode:`singleton`,deviceTypes:[K.Camera],methods:{getCurrentSnapshot:J(B({deviceId:F()}),s_.nullable()),getZoneHistory:J(B({deviceId:F(),zoneId:P(),className:P().optional()}).extend(l_.shape),z(u_).readonly()),getCameraHistory:J(B({deviceId:F(),className:P().optional()}).extend(l_.shape),z(u_).readonly()),getUnzonedHistory:J(B({deviceId:F(),className:P().optional()}).extend(l_.shape),z(u_).readonly())},runtimeState:s_},f_=U([`include`,`exclude`]),p_=B({id:P(),name:P().optional(),zoneIds:z(P()).min(1).readonly(),mode:f_,classFilter:z(P()).readonly().optional(),overlapThreshold:F().min(0).max(1).optional(),bboxInclusionPct:F().min(0).max(100).optional(),preferMask:I().optional(),enabled:I().default(!0)});z(p_).readonly();var m_=U([`motion`,`detection`]),h_={name:`zone-rules`,scope:`device`,mode:`singleton`,deviceTypes:[K.Camera],methods:{listRules:J(B({deviceId:F(),stage:m_}),z(p_).readonly()),setRules:J(B({deviceId:F(),stage:m_,rules:z(p_).readonly()}),R(),{kind:`mutation`,auth:`admin`})},runtimeState:B({motion:z(p_).readonly(),detection:z(p_).readonly()})},g_=B({connected:I(),deviceCount:F(),error:P().optional()});B({externalId:P(),name:P(),type:P(),metadata:H(P(),L()).optional()});var __=B({stableId:P(),type:U(K),suggestedName:P(),prefilledConfig:H(P(),L()),sourceInfo:Kp.optional()}),v_=B({id:F(),stableId:P(),addonId:P(),type:P(),name:P(),parentDeviceId:F().nullable(),online:I(),features:z(P()),config:H(P(),L()),sourceInfo:Kp.optional()}),y_=B({status:U([`ok`,`error`]),labels:z(P()).optional(),error:P().optional()}),b_=L(),x_={name:`device-provider`,scope:`system`,mode:`collection`,methods:{start:J(R(),R(),{kind:`mutation`}),stop:J(R(),R(),{kind:`mutation`}),getStatus:J(R(),g_),getDevices:J(R(),z(B({id:P(),name:P(),type:P()}))),supportsDiscovery:J(B({}),I()),discoverDevices:J(B({}),z(__),{kind:`mutation`,auth:`admin`}),adoptDiscoveredDevice:J(B({candidate:__}),v_,{kind:`mutation`,auth:`admin`}),supportsManualCreation:J(B({}),I()),getChildCreationSchema:J(B({type:U(K)}),b_),createDevice:J(B({type:U(K),config:H(P(),L())}),v_,{kind:`mutation`,auth:`admin`}),testCreationField:J(B({type:U(K),key:P(),value:L(),formValues:H(P(),L()).optional()}),y_,{kind:`mutation`,auth:`admin`})}},S_=`device.state-changed`;function C_(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:S_},{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 w_(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=T_(e)?e:C_(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 T_(e){return typeof e.read==`function`&&typeof e.watch==`function`}function E_(e,t,n){let r=e,a=n?.stateSource??C_(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)}}}function D_(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)},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 O_=`device.state-changed`,k_=`capability.binding-changed`,A_=`device.registered`,j_=`device.unregistered`,M_=`device.updated`,N_=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=w_(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?E_(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&&!P_(n,e.id)||e.stableId!==void 0&&(!a||!P_(a.stableId,e.stableId))||e.addonId!==void 0&&(!a||!P_(a.addonId,e.addonId))||e.type!==void 0&&(!a||!P_(a.type,e.type)))continue;if(e.caps!==void 0){let t=F_(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=F_(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||!I_(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||!F_(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:O_},{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:k_},{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:A_},{onData:e=>{let t=e.data;typeof t?.deviceId==`number`&&this.refreshDeviceMetadata(t.deviceId,`added`)}})),this.bridges.push(e.subscribe({category:j_},{onData:e=>{let t=e.data;typeof t?.deviceId==`number`&&this.applyDeviceRemoval(t.deviceId)}})),this.bridges.push(e.subscribe({category:M_},{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 P_(e,t){return Array.isArray(t)?t.includes(e):e===t}function F_(e){return Array.isArray(e)?e:[e]}function I_(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 L_=B({id:P(),label:P(),icon:P(),order:F().optional()}),R_=B({id:P(),title:P(),description:P().optional(),style:U([`card`,`accordion`]).optional(),defaultCollapsed:I().optional(),columns:V([W(1),W(2),W(3),W(4)]).optional(),tab:P().optional(),location:U([`settings`,`top-tab`]).optional(),order:F().optional(),fields:z(Ku())}),z_=B({tabs:z(L_).optional(),sections:z(R_)}),B_=H(P(),L()),V_=B({success:W(!0)}),H_={name:`addon-settings`,scope:`system`,mode:`singleton`,nodeIdMode:`data`,methods:{getGlobalSettings:J(B({addonId:P(),nodeId:P().optional(),overlay:H(P(),L()).optional(),cap:P().optional()}),z_.nullable()),updateGlobalSettings:J(B({addonId:P(),nodeId:P().optional(),patch:B_}),V_,{kind:`mutation`,auth:`admin`}),getDeviceSettings:J(B({addonId:P(),deviceId:F(),nodeId:P().optional()}),z_.nullable()),updateDeviceSettings:J(B({addonId:P(),deviceId:F(),nodeId:P().optional(),patch:B_}),V_,{kind:`mutation`,auth:`admin`})}},U_=U([`info`,`success`,`warning`,`error`]),W_=U([`active`,`in-progress`,`completed`,`failed`,`dismissed`]),G_=B({type:P(),id:P()}),K_=B({id:P(),category:P(),severity:U_,title:P(),message:P(),status:W_,progress:F().optional(),read:I(),createdAt:F(),updatedAt:F(),source:G_.optional(),metadata:H(P(),L()).optional()}),q_={name:`alerts`,scope:`system`,mode:`singleton`,methods:{emit:J(K_,R(),{kind:`mutation`}),update:J(B({alertId:P(),patch:K_.partial()}),R(),{kind:`mutation`}),list:J(B({unreadOnly:I().optional(),limit:F().optional()}).optional(),z(K_).readonly()),getUnreadCount:J(R(),F()),markRead:J(B({alertId:P()}),R(),{kind:`mutation`}),markAllRead:J(R(),R(),{kind:`mutation`}),dismiss:J(B({alertId:P()}),R(),{kind:`mutation`})}},J_=rd(`shouldSaveDiskSpace`,[B({providerId:P().min(1),displayName:P().min(1),configSchema:L(),nodeLocal:I(),shouldSaveDiskSpace:W(!0),minFreePercent:F().min(0).max(100)}),B({providerId:P().min(1),displayName:P().min(1),configSchema:L(),nodeLocal:I(),shouldSaveDiskSpace:W(!1),minFreePercent:W(null)})]),Y_={name:`storage`,scope:`system`,mode:`singleton`,methods:{resolve:J(B({location:Cf,relativePath:P()}),P()),write:J(B({location:Cf,relativePath:P(),data:Rd(Uint8Array)}),R(),{kind:`mutation`}),read:J(B({location:Cf,relativePath:P()}),Rd(Uint8Array)),exists:J(B({location:Cf,relativePath:P()}),I()),list:J(B({location:Cf,prefix:P().optional()}),z(P()).readonly()),delete:J(B({location:Cf,relativePath:P()}),R(),{kind:`mutation`}),getAvailableSpace:J(B({location:Cf}),F().nullable()),beginUpload:J(B({location:Cf,relativePath:P(),sizeBytes:F().optional()}),B({uploadId:P()}),{kind:`mutation`}),writeChunk:J(B({uploadId:P(),offset:F(),data:Rd(Uint8Array)}),R(),{kind:`mutation`}),finalizeUpload:J(B({uploadId:P()}),R(),{kind:`mutation`}),abortUpload:J(B({uploadId:P()}),R(),{kind:`mutation`}),beginDownload:J(B({location:Cf,relativePath:P()}),B({downloadId:P(),sizeBytes:F()}),{kind:`mutation`}),readChunk:J(B({downloadId:P(),offset:F(),length:F()}),Rd(Uint8Array)),endDownload:J(B({downloadId:P()}),R(),{kind:`mutation`}),listLocations:J(B({type:xf.optional()}),z(Sf).readonly()),getDefaultLocation:J(B({type:xf}),Sf.nullable()),listLocationDeclarations:J(R(),z(wf).readonly()),upsertLocation:J(Sf.omit({createdAt:!0,updatedAt:!0}),Sf,{kind:`mutation`,auth:`admin`}),deleteLocation:J(B({id:P()}),R(),{kind:`mutation`,auth:`admin`}),testLocation:J(B({id:P()}),B({ok:I(),error:P().optional()}),{auth:`admin`}),listProviders:J(R(),z(J_).readonly()),testConfig:J(B({providerId:P(),config:H(P(),L())}),B({ok:I(),error:P().optional()}),{auth:`admin`})}},X_=rd(`shouldSaveDiskSpace`,[B({providerId:P().min(1),displayName:P().min(1),configSchema:L(),nodeLocal:I(),shouldSaveDiskSpace:W(!0),minFreePercent:F().min(0).max(100)}),B({providerId:P().min(1),displayName:P().min(1),configSchema:L(),nodeLocal:I(),shouldSaveDiskSpace:W(!1),minFreePercent:W(null)})]),Z_=B({ok:I(),error:P().optional()}),Q_=B({location:Sf,relativePath:P(),sizeBytes:F().optional()}),$_=B({uploadId:P()}),ev=B({uploadId:P(),offset:F(),data:Rd(Uint8Array)}),tv=B({uploadId:P()}),nv=B({uploadId:P()}),rv=B({location:Sf,relativePath:P()}),iv=B({downloadId:P(),sizeBytes:F()}),av=B({downloadId:P(),offset:F(),length:F()}),ov=B({downloadId:P()}),sv={name:`storage-provider`,scope:`system`,mode:`collection`,internal:!0,methods:{getProviderInfo:J(R(),X_),testLocation:J(B({config:H(P(),L())}),Z_,{auth:`admin`}),resolve:J(B({location:Sf,relativePath:P()}),P()),write:J(B({location:Sf,relativePath:P(),data:Rd(Uint8Array)}),R(),{kind:`mutation`}),read:J(B({location:Sf,relativePath:P()}),Rd(Uint8Array)),exists:J(B({location:Sf,relativePath:P()}),I()),list:J(B({location:Sf,prefix:P().optional()}),z(P()).readonly()),delete:J(B({location:Sf,relativePath:P()}),R(),{kind:`mutation`}),getAvailableSpace:J(B({location:Sf}),F().nullable()),beginUpload:J(Q_,$_,{kind:`mutation`}),writeChunk:J(ev,R(),{kind:`mutation`}),finalizeUpload:J(tv,R(),{kind:`mutation`}),abortUpload:J(nv,R(),{kind:`mutation`}),beginDownload:J(rv,iv,{kind:`mutation`}),readChunk:J(av,Rd(Uint8Array)),endDownload:J(ov,R(),{kind:`mutation`})}},cv=B({bytes:F().int().nonnegative()}),lv=B({reclaimedBytes:F().int().nonnegative(),exhausted:I()}),uv={name:`storage-evictable`,scope:`system`,mode:`collection`,internal:!0,methods:{getEvictableUsage:J(B({locationId:P()}),cv),evict:J(B({locationId:P(),targetBytes:F().int().positive()}),lv,{kind:`mutation`})}},dv=B({name:P(),path:P()}),fv=B({path:P(),entries:z(dv).readonly(),freeBytes:F(),totalBytes:F()}),pv={name:`filesystem-browse`,scope:`system`,mode:`singleton`,internal:!0,methods:{listAllowedRoots:J(R(),z(P()).readonly(),{auth:`admin`}),browse:J(B({path:P()}),fv,{auth:`admin`}),createDir:J(B({path:P()}),B({path:P()}),{kind:`mutation`,auth:`admin`})}},mv=B({subId:P(),displayName:P(),description:P().optional(),kind:P(),triggerSupported:I(),restoreSupported:I()}).extend({id:P(),addonId:P(),enabled:I(),retentionCount:F(),label:P().optional(),lastSuccessAt:F().optional(),lastSuccessSizeBytes:F().optional(),cron:P().optional(),nextRunAt:F().optional(),lastRunAt:F().optional()}),hv=B({id:P(),filename:P(),createdAt:F(),sizeBytes:F(),label:P().optional(),locations:z(P()).readonly()}),gv=B({id:P(),destinationId:P().optional(),label:P().optional(),createdAt:F(),sizeBytes:F(),locations:z(P()).optional()}),_v=B({path:P(),kind:U([`file`,`dir`,`symlink`]),sizeBytes:F(),mtime:F()}),vv=B({archiveVersion:W(1),createdAt:F(),dataDir:P(),locations:z(P()),entries:z(_v),totalBytes:F(),totalFiles:F()}),yv=B({name:P(),sizeBytes:F(),fileCount:F(),present:I()}),bv={name:`backup`,scope:`system`,mode:`singleton`,methods:{listDestinations:J(R(),z(mv).readonly(),{auth:`admin`}),trigger:J(B({destinations:z(P()).optional(),locations:z(P()).optional(),label:P().optional()}).optional(),z(gv).readonly(),{kind:`mutation`,auth:`admin`}),list:J(R(),z(gv).readonly(),{auth:`admin`}),listLocations:J(R(),z(yv).readonly(),{auth:`admin`}),getEntries:J(B({destinationId:P(),backupId:P()}),vv.nullable(),{auth:`admin`}),restore:J(B({destinationId:P(),backupId:P(),locations:z(P()).optional()}),R(),{kind:`mutation`,auth:`admin`}),delete:J(B({destinationId:P(),backupId:P()}),R(),{kind:`mutation`,auth:`admin`}),listArchives:J(B({destinationId:P()}),z(hv).readonly(),{auth:`admin`}),upsertDestinationPolicy:J(B({locationId:P(),enabled:I(),retentionCount:F().int().min(1).max(1e3),label:P().optional(),cron:P().optional()}),R(),{kind:`mutation`,auth:`admin`}),previewSchedule:J(B({cron:P(),count:F().int().min(1).max(20).optional()}),B({ok:I(),error:P().optional(),nextRuns:z(F()).readonly()}))}},xv=B({where:H(P(),L()).optional(),whereIn:H(P(),z(L())).optional(),whereBetween:H(P(),sd([L(),L()])).optional(),orderBy:B({field:P(),direction:U([`asc`,`desc`])}).optional(),limit:F().optional(),offset:F().optional()}),Sv=B({id:P(),data:H(P(),L())}),Cv=B({name:P(),type:U([`TEXT`,`INTEGER`,`REAL`,`JSON`,`BOOLEAN`]),primaryKey:I().optional(),notNull:I().optional(),unique:I().optional()}),wv=B({name:P(),columns:z(P()).readonly(),unique:I().optional()}),Tv={name:`settings-store`,scope:`system`,mode:`singleton`,methods:{get:J(B({namespace:P().optional(),collection:P(),key:P()}),L()),set:J(B({namespace:P().optional(),collection:P(),key:P(),value:L()}),R(),{kind:`mutation`}),query:J(B({namespace:P().optional(),collection:P(),filter:xv.optional()}),z(Sv).readonly()),insert:J(B({namespace:P().optional(),collection:P(),record:Sv}),R(),{kind:`mutation`}),update:J(B({namespace:P().optional(),collection:P(),id:P(),data:H(P(),L())}),R(),{kind:`mutation`}),delete:J(B({namespace:P().optional(),collection:P(),key:P()}),R(),{kind:`mutation`}),count:J(B({namespace:P().optional(),collection:P(),filter:xv.optional()}),F()),histogram:J(B({namespace:P().optional(),collection:P(),field:P(),bucketSize:F().int().positive(),origin:F().int(),filter:xv.optional()}),z(B({bucket:F().int(),count:F().int()})).readonly()),isEmpty:J(B({namespace:P().optional(),collection:P()}),I()),declareCollection:J(B({namespace:P().optional(),collection:P(),columns:z(Cv).readonly(),indexes:z(wv).readonly().optional()}),R(),{kind:`mutation`})}},Ev=U([`debug`,`info`,`warn`,`error`]),Dv=B({timestamp:Qu(),level:Ev,scope:z(P()),message:P(),meta:H(P(),L()).optional(),tags:H(P(),P()).optional()}),Ov={name:`log-destination`,scope:`system`,mode:`collection`,internal:!0,methods:{write:J(Dv,R(),{kind:`mutation`}),query:J(B({scope:z(P()).optional(),level:Ev.optional(),since:Qu().optional(),until:Qu().optional(),limit:F().optional(),tags:H(P(),P()).optional()}),z(Dv).readonly())}},kv=B({staticDir:P()}),Av=B({version:P()}),jv={name:`admin-ui`,scope:`system`,mode:`singleton`,internal:!0,methods:{getStaticDir:J(R(),kv),getVersion:J(R(),Av)}},Mv=U([`view`,`create`,`delete`]),Nv=V([W(`*`),z(P())]),Pv=H(P(),V([W(`*`),z(P())])),Fv=U([`device`,`system`]),Iv=rd(`type`,[B({type:W(`category`),target:Fv,access:z(Mv).min(1)}),B({type:W(`capability`),target:P(),access:z(Mv).min(1)}),B({type:W(`addon`),target:P(),access:z(Mv).min(1)}),B({type:W(`device`),targets:z(P()).min(1),access:z(Mv).min(1)})]);B({id:P(),username:P(),passwordHash:P(),isAdmin:I().default(!1),allowedProviders:Nv,allowedDevices:Pv,scopes:z(Iv).default([]),createdAt:F(),updatedAt:F()}),B({id:P(),label:P(),isAdmin:I().default(!1),allowedProviders:Nv,allowedDevices:Pv,tokenHash:P(),tokenPrefix:P(),createdAt:F(),lastUsedAt:F().optional()}),B({id:P(),userId:P(),name:P(),tokenHash:P(),tokenPrefix:P(),scopes:z(Iv),expiresAt:F().nullish(),lastUsedAt:F().nullish(),createdAt:F()});var Lv=B({userId:P(),username:P(),isAdmin:I(),provider:P(),email:P().optional(),displayName:P().optional(),hubUrl:P().optional(),scopes:z(Iv).optional(),redirectUri:P().optional(),integrationId:P().optional(),jti:P().optional(),sessionId:P().optional()}),Rv={name:`sso-bridge`,scope:`system`,mode:`singleton`,internal:!0,methods:{signBridgeToken:J(B({claims:Lv,ttlSec:F().int().positive().optional()}),B({token:P()})),verifyBridgeToken:J(B({token:P()}),Lv.nullable())}},zv=B({integrationId:P(),displayName:P(),requestedScopes:z(Iv),allowedRedirectPrefixes:z(P()).min(1),hubUrl:P().optional()}),Bv={name:`oauth-integration`,scope:`system`,mode:`collection`,internal:!0,methods:{getDescriptor:J(R(),zv)}},Vv=B({credentialId:P(),label:P(),createdAt:F(),lastUsedAt:F().nullable(),transports:z(P()).default([])}),Hv={name:`user-passkeys`,scope:`system`,mode:`collection`,internal:!0,methods:{beginRegistration:J(B({userId:P(),username:P()}),B({optionsJSON:H(P(),L())}),{kind:`mutation`,auth:`admin`,access:`create`}),finishRegistration:J(B({userId:P(),response:H(P(),L()),label:P()}),B({success:W(!0),credentialId:P()}),{kind:`mutation`,auth:`admin`,access:`create`}),beginAuthentication:J(B({userId:P().optional()}),B({optionsJSON:H(P(),L())}),{kind:`mutation`,access:`view`}),finishAuthentication:J(B({userId:P(),response:H(P(),L())}),B({verified:I()}),{kind:`mutation`,access:`view`}),listPasskeys:J(B({userId:P()}),z(Vv),{auth:`admin`}),removePasskey:J(B({userId:P(),credentialId:P()}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`,access:`delete`})}},Uv=yu(),Wv=B({to:V([Uv,z(Uv).min(1)]),cc:z(Uv).optional(),bcc:z(Uv).optional(),from:P().optional(),replyTo:P().optional(),subject:P(),text:P(),html:P().optional()}),Gv=B({messageId:P(),accepted:z(Uv).default([]),rejected:z(Uv).default([])}),Kv=B({ready:I(),host:P(),error:P().optional(),lastVerifiedAt:F().optional()}),qv={name:`smtp-provider`,scope:`system`,mode:`collection`,internal:!0,providerKind:`email`,methods:{sendEmail:J(Wv,Gv,{kind:`mutation`,auth:`admin`,access:`create`}),verify:J(R(),Kv,{kind:`mutation`,auth:`admin`,access:`view`}),getStatus:J(R(),Kv,{auth:`admin`})}},Jv=B({id:P(),label:P(),isDefault:I().optional()}),Yv=B({search:P().optional(),area:P().optional(),manufacturer:P().optional(),adoptedOnly:I().optional(),unadoptedOnly:I().optional()}),Xv=B({integrationId:P(),page:F().int().positive().default(1),pageSize:F().int().positive().max(2e4).default(50),filter:P().optional(),filterText:Yv.optional()}),Zv=B({candidates:z(Jp).readonly(),totalCount:F().int().nonnegative(),page:F().int().positive(),pageSize:F().int().positive()}),Qv=B({integrationId:P(),childNativeId:P()}),$v=B({lastDiscoveryAt:F().int().nonnegative().nullable(),candidateCount:F().int().nonnegative(),adoptedCount:F().int().nonnegative(),lastError:P().nullable()}),ey=B({name:P().min(1).optional(),hiddenChildIds:z(P()).optional()}),ty=B({integrationId:P(),childNativeIds:z(P()).min(1),filter:P().optional(),importLocations:I().optional(),perCandidate:H(P(),ey).optional()}),ny=B({adopted:z(B({childNativeId:P(),parentDeviceId:F().int().nonnegative(),accessoryDeviceIds:z(F().int().nonnegative()).readonly()})).readonly()}),ry=B({integrationId:P(),camDeviceId:F().int().nonnegative()}),iy=B({camDeviceId:F().int().nonnegative()}),ay=B({changed:I(),rebuiltChildren:F().int().nonnegative()}),oy={name:`device-adoption`,scope:`system`,mode:`singleton`,status:{schema:$v,kind:`poll`},methods:{listCandidateFilters:J(B({integrationId:P()}),B({filters:z(Jv)}),{auth:`admin`}),listCandidates:J(Xv,Zv,{auth:`admin`}),getCandidate:J(Qv,Jp.nullable(),{auth:`admin`}),refresh:J(B({integrationId:P()}),$v,{kind:`mutation`,auth:`admin`}),adopt:J(ty,ny,{kind:`mutation`,auth:`admin`}),release:J(ry,R(),{kind:`mutation`,auth:`admin`}),resync:J(iy,ay,{kind:`mutation`,auth:`admin`})}},sy=U([`connected`,`disconnected`,`connecting`,`auth-failed`,`unreachable`,`error`]),cy=B({id:P(),addonId:P(),name:P(),kind:P(),status:sy,info:H(P(),L()),lastCheckedAt:F().nullable(),error:P().nullable()}),ly=B({brokerCount:F().int().nonnegative(),connectedCount:F().int().nonnegative()}),uy=B({addonId:P(),kinds:z(B({kind:P(),label:P()}))}),dy=B({kind:P().optional()}),fy=B({id:P()}),py=B({kind:P().min(1),name:P().min(1),settings:H(P(),L())}),my=B({id:P()}),hy=B({id:P()}),gy=rd(`ok`,[B({ok:W(!0),latencyMs:F().nonnegative()}),B({ok:W(!1),error:P()})]),_y=H(P(),L()),vy=B({kind:P()}),yy=B({kind:P(),settings:_y}),by=rd(`ok`,[B({ok:W(!0),latencyMs:F().nonnegative().optional()}).strict(),B({ok:W(!1),error:P()})]),xy=L().nullable(),Sy=B({brokerId:P(),target:H(P(),L()),payload:L().optional()}),Cy=B({brokerId:P(),filter:H(P(),L())}),wy=B({subscriptionId:P()}),Ty=B({brokerId:P(),subscriptionId:P()}),Ey=B({brokerId:P(),key:P()}),Dy={name:`broker`,scope:`system`,mode:`collection`,providerKind:`broker`,status:{schema:ly,kind:`poll`},methods:{list:J(dy,z(cy)),get:J(fy,cy.nullable()),listProviders:J(R(),z(uy),{auth:`admin`}),add:J(py,my,{kind:`mutation`,auth:`admin`}),remove:J(hy,R(),{kind:`mutation`,auth:`admin`}),testConnection:J(fy,gy,{kind:`mutation`,auth:`admin`}),getSettings:J(fy,_y.nullable(),{auth:`admin`}),setSettings:J(B({id:P(),settings:_y}),R(),{kind:`mutation`,auth:`admin`}),getBrokerConfig:J(fy,_y.nullable(),{auth:`admin`}),getSettingsSchema:J(vy,xy,{auth:`admin`}),testSettings:J(yy,by,{kind:`mutation`,auth:`admin`}),publish:J(Sy,L(),{kind:`mutation`,auth:`admin`}),subscribe:J(Cy,wy,{kind:`mutation`,auth:`admin`}),unsubscribe:J(Ty,R(),{kind:`mutation`,auth:`admin`}),getState:J(Ey,L().nullable()),getStatus:J(R(),ly)}},Oy=U([`external`,`embedded`]),ky=U([`connected`,`disconnected`,`auth-failed`,`unreachable`,`tls-error`]),Ay=B({id:P(),name:P(),url:P(),kind:Oy,status:ky,latencyMs:F().nullable(),error:P().optional(),connectedClients:F().int().nonnegative().optional(),lastCheckedAt:F().optional()}),jy=B({url:P(),username:P().optional(),password:P().optional(),clientIdPrefix:P().optional()}),My=B({name:P().min(1),url:P().regex(/^(mqtt|mqtts|ws|wss):\/\//,`URL must start with mqtt(s):// or ws(s)://`),username:P().optional(),password:P().optional(),clientIdPrefix:P().optional()}),Ny=B({id:P()}),Py=B({id:P()}),Fy=rd(`ok`,[B({ok:W(!0),latencyMs:F()}),B({ok:W(!1),error:P()})]),Iy=B({port:F().int().min(1).max(65535).default(1883),allowAnonymous:I().default(!1),username:P().optional(),password:P().optional()}),Ly=B({id:P(),url:P()}),Ry=B({brokerCount:F(),embeddedRunning:I()}),zy={name:`mqtt-broker`,scope:`system`,mode:`collection`,providerKind:`broker`,status:{schema:Ry,kind:`poll`},methods:{listBrokers:J(R(),z(Ay)),getBrokerConfig:J(Py,jy),addBroker:J(My,Ny,{kind:`mutation`}),removeBroker:J(Py,R(),{kind:`mutation`}),testConnection:J(Py,Fy,{kind:`mutation`}),startEmbeddedBroker:J(Iy,Ly,{kind:`mutation`}),stopEmbeddedBroker:J(Py,R(),{kind:`mutation`}),getStatus:J(R(),Ry)}},By=U([`unlinked`,`linked`,`error`]),Vy=B({label:P(),value:P(),secret:I().optional()}),Hy=B({qr:P().optional(),fields:z(Vy).readonly().optional(),note:P().optional()}),Uy=B({linkState:By,exposedDeviceCount:F(),error:P().optional(),setup:Hy.optional()}),Wy=P(),Gy=B({deviceId:P(),exposedAs:P().optional(),capabilities:z(P()).optional()}),Ky=B({deviceId:P(),capabilities:z(P()).optional()}),qy=B({deviceId:P()}),Jy={name:`device-export`,scope:`system`,mode:`collection`,providerKind:`device-export`,status:{schema:Uy,kind:`poll`},exposesDeviceSettings:!0,methods:{getStatus:J(R(),Uy),listSupportedDeviceKinds:J(R(),z(Wy)),listExposedDevices:J(R(),z(Gy)),exposeDevice:J(Ky,R(),{kind:`mutation`}),unexposeDevice:J(qy,R(),{kind:`mutation`})}},Yy=B({id:P(),label:P(),icon:P(),path:P(),remoteName:P(),bundle:P()}),Xy=B({addonId:P(),page:Yy,bundleUrl:P()}),Zy={name:`addon-pages`,scope:`system`,mode:`singleton`,methods:{listPages:J(R(),z(Xy).readonly())}},Qy=B({id:P(),label:P(),icon:P(),path:P(),remoteName:P(),bundle:P()}),$y={name:`addon-pages-source`,scope:`system`,mode:`collection`,internal:!0,methods:{listPages:J(R(),z(Qy).readonly())}},eb=U([`device-tab`,`dashboard`,`integration-detail`]),tb=U([`xs`,`sm`,`md`,`lg`,`xl`]),nb=B({remoteName:P(),exposedModule:P(),componentKey:P().optional()}),rb=B({tab:P(),subTab:P().optional(),label:P(),order:F().optional(),kind:W(`remote`),remote:nb,stableId:P(),description:P().optional(),icon:P().optional(),bundle:P(),hosts:z(eb).readonly(),requires:B({deviceContext:I().default(!1),integrationContext:I().default(!1)}),defaultSize:tb.default(`md`),allowedSizes:z(tb).readonly().default([`sm`,`md`,`lg`]),defaultColumns:F().int().min(1).max(12).default(6),defaultRows:F().int().min(1).max(12).default(1)}),ib={name:`addon-widgets-source`,scope:`system`,mode:`collection`,internal:!0,methods:{listWidgets:J(R(),z(rb).readonly())}},ab=rb.extend({addonId:P(),bundleUrl:P()}),ob={name:`addon-widgets`,scope:`system`,mode:`singleton`,methods:{listWidgets:J(R(),z(ab).readonly())}},sb=B({method:U([`GET`,`POST`,`PUT`,`DELETE`,`PATCH`]),path:P(),access:U([`public`,`authenticated`,`admin`]).optional(),description:P().optional()}),cb=B({method:P(),path:P(),params:H(P(),P()),query:H(P(),P()),body:L(),headers:H(P(),P()),user:B({id:P(),username:P(),isAdmin:I()}).optional(),scopedToken:L().optional()}),lb=B({status:F().int(),headers:H(P(),P()),redirectUrl:P().nullable(),body:L().optional(),contentType:P().optional()}),ub={name:`addon-routes`,scope:`system`,mode:`collection`,internal:!0,methods:{getRoutes:J(R(),z(sb)),invoke:J(cb,lb,{kind:`mutation`})}},db=B({sessionId:P(),slotCount:F().int(),slotByteLength:F().int(),segmentBytes:F().int(),budgetMb:F().int(),framesWritten:F().int(),getFrameHits:F().int(),getFrameMisses:F().int()}),fb={name:`decoder`,scope:`system`,mode:`singleton`,methods:{supportsCodec:J(B({codec:P()}),I()),getInfo:J(R(),B({id:P(),name:P(),isPullMode:I().optional(),priority:F().optional()})),createSession:J(Ef,B({sessionId:P(),nodeId:P()})),destroySession:J(B({sessionId:P()}),R()),pushPacket:J(B({sessionId:P(),packet:Zd}),R()),openStream:J(B({sessionId:P(),url:P()}),R()),pullFrames:J(B({sessionId:P(),maxCount:F().default(1)}),z(Qd)),pullHandles:J(B({sessionId:P(),maxCount:F().default(1)}),z($d)),getFrame:J(B({handle:$d}),Qd.nullable()),getShmStats:J(B({sessionId:P()}),db.nullable()),updateConfig:J(B({sessionId:P(),config:Ef.partial()}),R()),getStats:J(B({sessionId:P()}),Tf),listActiveSessions:J(R(),z(B({sessionId:P(),codec:P(),outputFormat:P(),createdAtMs:F()})).readonly()),reprobeHwaccel:J(R(),B({backend:P()}),{kind:`mutation`,auth:`admin`})}},pb=B({streamId:P(),label:P().optional(),codec:P(),type:U([`video`,`audio`]),sourceUrl:P()}),mb=B({streamId:P(),format:P(),value:P()}),hb={name:`restreamer`,scope:`system`,mode:`collection`,internal:!0,methods:{registerDevice:J(B({deviceId:F(),streams:z(pb).readonly()}),R(),{kind:`mutation`}),unregisterDevice:J(B({deviceId:F()}),R(),{kind:`mutation`}),getExposedResources:J(B({deviceId:F()}),z(mb).readonly())}},gb=B({viewportWidth:F().int().positive().optional(),viewportHeight:F().int().positive().optional(),devicePixelRatio:F().positive().optional(),downlinkMbps:F().nonnegative().optional(),prefersTier:P().optional()}).partial(),_b={name:`webrtc`,scope:`system`,mode:`collection`,internal:!0,methods:{handleOffer:J(B({streamId:P(),sdpOffer:P()}),P(),{kind:`mutation`}),supportsStream:J(B({streamId:P()}),I()),registerStream:J(B({streamId:P(),codec:P()}),R(),{kind:`mutation`}),unregisterStream:J(B({streamId:P()}),R(),{kind:`mutation`}),createSession:J(B({streamId:P(),hints:gb.optional()}),B({sessionId:P(),sdpOffer:P()}),{kind:`mutation`}),handleAnswer:J(B({sessionId:P(),sdpAnswer:P()}),R(),{kind:`mutation`}),closeSession:J(B({sessionId:P()}),R(),{kind:`mutation`}),hasAdaptiveBitrate:J(B({streamId:P()}),I())}},vb=rd(`kind`,[B({kind:W(`adaptive`)}),B({kind:W(`profile`),profile:Wd}),B({kind:W(`cam-stream`),camStreamId:P().min(1)})]),yb=B({id:P(),label:P(),target:vb,codec:P().nullable(),resolution:B({width:F(),height:F()}).nullable(),status:U([`idle`,`connecting`,`streaming`,`error`,`stopped`]).nullable(),inputFps:F().nullable(),decodeFps:F().nullable(),bitrateKbps:F().nullable()}),bb={name:`webrtc-session`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,preferredProvider:`stream-broker`,deviceTypes:[K.Camera],methods:{listStreams:J(B({deviceId:F().int().nonnegative()}),z(yb)),createSession:J(B({deviceId:F().int().nonnegative(),target:vb,hints:gb.optional(),relayOnly:I().optional(),consumerAttribution:fp.optional()}),B({sessionId:P(),sdpOffer:P()}),{kind:`mutation`}),handleOffer:J(B({deviceId:F().int().nonnegative(),target:vb.optional(),sdpOffer:P(),sessionId:P().optional(),relayOnly:I().optional(),nonTrickle:I().optional(),disableTurn:I().optional(),disableIpv6:I().optional(),consumerAttribution:fp.optional()}),B({sessionId:P(),sdpAnswer:P()}),{kind:`mutation`}),handleAnswer:J(B({deviceId:F().int().nonnegative(),sessionId:P(),sdpAnswer:P()}),R(),{kind:`mutation`}),addIceCandidate:J(B({deviceId:F().int().nonnegative(),sessionId:P(),candidate:P(),sdpMid:P().nullable().optional(),sdpMLineIndex:F().int().nullable().optional()}),R(),{kind:`mutation`}),getIceCandidates:J(B({deviceId:F().int().nonnegative(),sessionId:P()}),B({candidates:z(B({candidate:P(),sdpMid:P().nullable(),sdpMLineIndex:F().int().nullable()})),done:I()}),{kind:`query`}),closeSession:J(B({deviceId:F().int().nonnegative(),sessionId:P()}),R(),{kind:`mutation`}),hasAdaptiveBitrate:J(B({deviceId:F().int().nonnegative(),profile:Wd}),I()),getSessionState:J(B({deviceId:F().int().nonnegative(),sessionId:P()}),B({pendingRenegotiation:B({target:vb,epoch:F()}).nullable()}))}},xb=B({id:P(),source:P(),kind:U([`motion`,`object`,`audio`,`native`]),timeRange:B({startMs:F(),endMs:F()}),thumbnail:P().optional()}),Sb=B({playbackUrl:P(),playbackEndpoints:z(P()).optional(),token:P().optional()}),Cb={name:`videoclips`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,methods:{listClips:J(B({deviceId:F(),since:F(),until:F(),limit:F().int().positive().optional()}),z(xb).readonly(),{kind:`query`,auth:`admin`}),getClipPlayback:J(B({deviceId:F(),clipId:P()}),Sb,{kind:`query`,auth:`admin`})}},wb=B({engine:Hm,steps:z(eh).readonly(),audio:B({engine:Hm,modelId:P(),enabled:I(),settings:H(P(),L()).readonly().optional()}).nullable().optional()}),Tb=B({id:P(),name:P(),description:P().optional(),config:wb,createdAt:P(),updatedAt:P()}),Eb=B({enabled:I(),modelId:P(),settings:H(P(),L()).readonly()}),Db=B({addonDefaults:H(P(),Eb).readonly(),maxCameras:F().int().nonnegative().nullable().default(null)}),Ob=B({steps:z(eh).readonly(),audio:B({modelId:P(),enabled:I()}).nullable()}),kb=B({enabled:I().optional(),modelId:P().optional(),settings:H(P(),L()).readonly().optional()}),Ab=B({pinnedAgentNodeId:P().optional(),stepToggles:H(P(),I()).optional(),stepOverridesByAgent:H(P(),H(P(),kb)).optional(),pipelineByAgent:H(P(),Ob).optional()}),jb=B({deviceId:F(),agentNodeId:P(),pinned:I(),reason:U([`manual`,`capacity`,`hardware-affinity`,`failover`,`rebalance`]),assignedAt:F()}),Mb=B({deviceId:F(),decoderNodeId:P(),pinned:I(),reason:U([`manual`,`co-located`,`capacity`,`hardware-affinity`])}),Nb=B({nodeId:P(),online:I(),load:kh,score:F()}),Pb=B({totalAgents:F(),onlineAgents:F(),totalCameras:F(),attachedCameras:F(),activeCameras:F(),avgInferenceTimeMs:F(),queueDepth:F()}),Fb=H(P(),P()),Ib=B({streams:z(B({camStreamId:P(),codec:P(),width:F(),height:F(),fps:F(),kind:P()})).readonly()}),Lb=B({detectionNodeId:P().nullable(),decoderNodeId:P().nullable(),audioNodeId:P().nullable(),pinned:B({detection:I(),decoder:I(),audio:I()}),reasons:B({detection:P().optional(),decoder:P().optional(),audio:P().optional()})}),Rb=B({profiles:z(B({profile:P(),status:P(),codec:P(),width:F(),height:F(),subscribers:F(),inFps:F(),outFps:F()})).readonly(),webrtcSessions:F(),rtspRestream:I()}),zb=B({framesWritten:F(),getFrameHits:F(),getFrameMisses:F(),budgetMb:F()}),Bb=B({nodeId:P(),formats:z(P()).readonly(),sessionCount:F(),shm:zb}),Vb=B({enabled:I(),fps:F()}),Hb=B({state:U([`idle`,`installing`,`verifying`,`ready`,`failed`]),error:P().optional()}),Ub=U([`idle`,`watching`,`active`]),Wb=B({nodeId:P(),engine:B({backend:P(),device:P()}),phase:Ub,configuredFps:F(),actualFps:F(),queueDepth:F(),avgInferenceMs:F(),provisioning:Hb}),Gb=B({nodeId:P(),enabled:I()}),Kb=B({mode:U([`off`,`continuous`,`events`]),active:I(),storageBytes:F()}),qb=B({deviceId:F(),assignment:Lb,source:Ib,broker:Rb.nullable(),decoder:Bb.nullable(),motion:Vb.nullable(),detection:Wb.nullable(),audio:Gb.nullable(),recording:Kb.nullable(),fetchedAt:F()}),Jb={name:`pipeline-orchestrator`,scope:`system`,mode:`singleton`,exposesDeviceSettings:!0,methods:{assignPipeline:J(B({deviceId:F(),agentNodeId:P()}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`}),unassignPipeline:J(B({deviceId:F()}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`}),rebalance:J(R(),B({migrated:F()}),{kind:`mutation`,auth:`admin`}),getPipelineAssignments:J(R(),z(jb).readonly()),getPipelineAssignment:J(B({deviceId:F()}),jb.nullable()),getAgentLoad:J(R(),z(Nb).readonly()),getGlobalMetrics:J(R(),Pb),getCameraMetrics:J(B({deviceId:F()}),Rm.nullable()),getCapabilityBindings:J(B({nodeId:P()}),Fb),setCapabilityBinding:J(B({nodeId:P(),capName:P(),addonId:P()}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`}),assignDecoder:J(B({deviceId:F(),nodeId:P()}),R(),{kind:`mutation`,auth:`admin`}),unassignDecoder:J(B({deviceId:F()}),R(),{kind:`mutation`,auth:`admin`}),getDecoderAssignments:J(R(),z(Mb).readonly()),assignAudio:J(B({deviceId:F(),nodeId:P()}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`}),unassignAudio:J(B({deviceId:F()}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`}),getAudioAssignment:J(B({deviceId:F()}),B({nodeId:P(),pinned:I(),assignedAt:F()}).nullable()),getAudioNodeLoad:J(R(),z(B({nodeId:P(),deviceCount:F()}))),getAudioAssignments:J(R(),z(B({deviceId:F(),nodeId:P(),pinned:I(),assignedAt:F()}))),getDecoderAssignment:J(B({deviceId:F(),pipelineNodeId:P().optional()}),Mb),getAgentSettings:J(B({agentNodeId:P()}),Db.nullable()),listAgentSettings:J(R(),z(B({nodeId:P(),settings:Db})).readonly()),setAgentAddonDefaults:J(B({agentNodeId:P(),defaults:H(P(),Eb)}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`}),removeAgentSettings:J(B({agentNodeId:P()}),B({success:I(),removed:I()}),{kind:`mutation`,auth:`admin`}),setAgentMaxCameras:J(B({agentNodeId:P(),maxCameras:F().int().nonnegative().nullable()}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`}),getCameraSettings:J(B({deviceId:F()}),Ab.nullable()),setCameraStepToggle:J(B({deviceId:F(),addonId:P(),enabled:I().nullable()}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`}),getCameraStepOverrides:J(B({deviceId:F()}),H(P(),H(P(),kb)).nullable()),setCameraStepOverride:J(B({deviceId:F(),agentNodeId:P(),addonId:P(),patch:kb.nullable()}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`}),setCameraPipelineForAgent:J(B({deviceId:F(),agentNodeId:P(),pipeline:Ob.nullable()}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`}),resolvePipeline:J(B({deviceId:F(),agentNodeId:P().optional()}),wb),getCameraStatus:J(B({deviceId:F()}),qb),getCameraStatuses:J(B({deviceIds:z(F()).optional()}),z(qb).readonly()),listTemplates:J(R(),z(Tb).readonly()),saveTemplate:J(B({name:P(),description:P().optional(),config:wb}),Tb,{kind:`mutation`,auth:`admin`}),updateTemplate:J(B({id:P(),name:P().optional(),description:P().optional(),config:wb.optional()}),Tb,{kind:`mutation`,auth:`admin`}),deleteTemplate:J(B({id:P()}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`})}},Yb=B({level:Nm,classification:B({labels:z(Pm).readonly(),inferenceMs:F()}).optional(),timestamp:F()}),Xb=B({minConfidence:F().min(0).max(1).default(.3),allowedClasses:z(P()).default([])}),Zb=B({labels:z(Pm).readonly(),rawLabels:z(Pm).readonly().optional(),inferenceMs:F()}),Qb={name:`audio-analyzer`,scope:`system`,mode:`singleton`,methods:{analyseChunk:J(B({chunk:Mm,settings:Xb}),Yb.nullable(),{kind:`mutation`}),classify:J(Mm,Zb,{timeoutMs:3e4}),isReady:J(R(),I()),dispose:J(R(),R(),{kind:`mutation`}),reprobeAudioEngine:J(R(),B({backend:P()}),{kind:`mutation`,auth:`admin`})}},$b={name:`audio-analysis`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[K.Camera],exposesDeviceSettings:!0,methods:{resolveDeviceSettings:J(B({deviceId:F()}),Fd())},events:{onAudioLevel:Bf(B({deviceId:F(),rms:F(),dbfs:F()}))}},ex=U([`f32le`,`s16le`]),tx=B({codec:P(),canDecode:I(),canEncode:I(),label:P().optional()}),nx=B({codec:P(),sourceSampleRate:F().int().positive(),sourceChannels:F().int().positive(),extraData:Rd(Uint8Array).optional(),targetSampleRate:F().int().positive(),targetChannels:F().int().positive(),targetFormat:ex.optional(),idleMs:F().int().positive().optional(),tag:P().optional()}),rx=B({codec:P(),sourceSampleRate:F().int().positive(),sourceChannels:F().int().positive(),sourceFormat:ex.optional(),targetSampleRate:F().int().positive(),targetChannels:F().int().positive(),bitrateKbps:F().int().positive().optional(),idleMs:F().int().positive().optional(),tag:P().optional()}),ix=B({data:Rd(Uint8Array),sampleRate:F().int().positive(),channels:F().int().positive(),format:ex,pts:F()}),ax=B({data:Rd(Uint8Array),codec:P(),pts:F(),frameComplete:I()}),ox=B({sessionId:P(),kind:U([`decode`,`encode`]),codec:P(),sourceSampleRate:F(),sourceChannels:F(),targetSampleRate:F(),targetChannels:F(),format:ex,tag:P().optional(),createdAtMs:F(),lastActivityMs:F(),framesIn:F(),framesOut:F()}),sx={name:`audio-codec`,scope:`system`,mode:`singleton`,methods:{listSupportedCodecs:J(R(),z(tx).readonly()),canHandle:J(B({codec:P(),kind:U([`decode`,`encode`])}),I()),createDecodeSession:J(nx,B({sessionId:P(),nodeId:P()}),{kind:`mutation`}),createEncodeSession:J(rx,B({sessionId:P(),nodeId:P()}),{kind:`mutation`}),closeSession:J(B({sessionId:P(),nodeId:P().optional()}),R(),{kind:`mutation`}),pushEncodedFrame:J(B({sessionId:P(),nodeId:P().optional(),data:Rd(Uint8Array),pts:F().optional()}),R(),{kind:`mutation`}),pullPcm:J(B({sessionId:P(),nodeId:P().optional(),maxCount:F().int().positive().default(8)}),z(ix)),pushPcm:J(B({sessionId:P(),nodeId:P().optional(),data:Rd(Uint8Array),pts:F().optional()}),R(),{kind:`mutation`}),pullEncoded:J(B({sessionId:P(),nodeId:P().optional(),maxCount:F().int().positive().default(8)}),z(ax)),flushEncode:J(B({sessionId:P(),nodeId:P().optional()}),z(ax),{kind:`mutation`}),listActiveSessions:J(R(),z(ox).readonly())}},cx=B({embedding:z(F()),inferenceMs:F()}),lx=B({modelId:P(),embeddingDim:F(),ready:I()}),ux={name:`embedding-encoder`,scope:`system`,mode:`collection`,internal:!0,methods:{encode:J(B({crop:Rd(Uint8Array),width:F(),height:F()}),cx),encodeText:J(B({text:P()}),cx),getInfo:J(R(),lx)}},dx=B({childKey:P(),section:P(),order:F().optional(),collapsed:I().optional()}),fx=B({id:P(),source:B({sourceKey:P(),cap:P(),fieldPath:P()}),target:B({cap:P(),fieldPath:P(),itemKey:P().optional()}),transform:rd(`kind`,[B({kind:W(`identity`)}),B({kind:W(`enum-map`),mapping:H(P(),V([P(),F(),I()])),fallback:V([P(),F(),I()]).optional()}),B({kind:W(`linear`),scale:F(),offset:F(),clamp:sd([F(),F()]).readonly().optional()})]).optional()}),px=B({id:F(),stableId:P(),addonId:P(),type:U(K),name:P(),location:P().nullable(),disabled:I(),parentDeviceId:F().nullable(),role:P().nullable().optional(),online:I(),probed:I().optional(),features:z(P()),isCamera:I(),config:H(P(),L()),metadata:H(P(),L()).nullable().optional(),sourceInfo:Kp.optional(),integrationId:P().optional(),linkDeviceId:F().nullable().optional(),primaryChildEntityId:P().nullable().optional(),childLayout:z(dx).readonly().optional(),deviceLinks:z(fx).readonly().optional()}),mx=B({key:P(),value:L(),description:P().optional()}),hx=B({id:F(),stableId:P(),type:P(),name:P(),location:P().nullable(),disabled:I(),parentDeviceId:F().nullable(),role:P().nullable().optional()}),gx=B({id:F(),stableId:P(),addonId:P(),type:P(),name:P(),location:P().nullable(),disabled:I(),parentDeviceId:F().nullable(),metadata:H(P(),L()).nullable().optional(),sourceInfo:Kp.optional(),integrationId:P().optional(),linkDeviceId:F().nullable().optional(),primaryChildEntityId:P().nullable().optional(),childLayout:z(dx).readonly().optional(),deviceLinks:z(fx).readonly().optional(),role:P().nullable().optional()}),_x=L().nullable(),vx=B({streamId:P(),width:F().optional(),height:F().optional(),codec:P().optional(),fps:F().optional(),bitrateKbps:F().optional()}),yx=B({addonId:P(),stableId:P(),id:F(),type:P(),name:P(),location:P().nullable().optional(),disabled:I().optional(),parentDeviceId:F().nullable(),role:P().nullable().optional(),features:z(P()).optional(),config:H(P(),L())}),bx=B({deviceId:F()}),xx=B({deviceId:F(),data:H(P(),L())}),Sx={name:`device-manager`,scope:`system`,mode:`singleton`,methods:{allocateDeviceId:J(B({addonId:P(),stableId:P()}),B({id:F()}),{kind:`mutation`}),registerDevice:J(yx,R(),{kind:`mutation`}),removeDevice:J(bx,R(),{kind:`mutation`}),persistConfig:J(xx,R(),{kind:`mutation`}),loadConfig:J(B({deviceId:F()}),H(P(),L())),loadRuntimeState:J(B({deviceId:F()}),H(P(),L())),loadMeta:J(B({deviceId:F()}),gx.nullable()),setName:J(B({deviceId:F(),name:P()}),R(),{kind:`mutation`,auth:`admin`}),setLocation:J(B({deviceId:F(),location:P().nullable()}),R(),{kind:`mutation`,auth:`admin`}),setType:J(B({deviceId:F(),type:U(K)}),R(),{kind:`mutation`,auth:`admin`}),setIntegrationId:J(B({deviceId:F(),integrationId:P()}),R(),{kind:`mutation`,auth:`admin`}),setLinkDeviceId:J(B({deviceId:F(),linkDeviceId:F().nullable()}),R(),{kind:`mutation`,auth:`admin`}),setPrimaryChildEntityId:J(B({deviceId:F(),primaryChildEntityId:P().nullable()}),R(),{kind:`mutation`,auth:`admin`}),setChildLayout:J(B({deviceId:F(),childLayout:z(dx).readonly()}),R(),{kind:`mutation`,auth:`admin`}),setDeviceLinks:J(B({deviceId:F(),deviceLinks:z(fx).readonly()}),R(),{kind:`mutation`,auth:`admin`}),getWireableFields:J(B({deviceId:F()}),B({caps:z(B({cap:P(),fields:z(B({path:P(),kind:U([`string`,`number`,`boolean`,`enum`]),enumValues:z(P()).optional()})).readonly()})).readonly()}),{kind:`query`}),setRole:J(B({deviceId:F(),role:P().nullable()}),R(),{kind:`mutation`,auth:`admin`}),applyInitialMeta:J(B({deviceId:F(),name:P().optional(),location:P().nullable().optional(),type:U(K).optional(),integrationId:P().optional(),linkDeviceId:F().nullable().optional(),role:P().nullable().optional()}),R(),{kind:`mutation`,auth:`admin`}),setMetadata:J(B({deviceId:F(),patch:H(P(),L())}),R(),{kind:`mutation`,auth:`admin`}),listLocations:J(R(),z(P())),addLocation:J(B({name:P()}),R(),{kind:`mutation`,auth:`admin`}),removeLocation:J(B({name:P(),cascade:I().optional()}),R(),{kind:`mutation`,auth:`admin`}),setDisabled:J(B({deviceId:F(),disabled:I()}),R(),{kind:`mutation`,auth:`admin`}),listPersistedByAddon:J(B({addonId:P()}),z(hx)),listAll:J(B({addonId:P().optional()}),z(px)),getDevice:J(B({deviceId:F()}),px.nullable()),getChildren:J(B({parentDeviceId:F()}),z(px)),getStreamSources:J(B({deviceId:F()}),z(Xd)),getConfigSchema:J(B({deviceId:F()}),z(mx)),getSettingsSchema:J(B({deviceId:F()}),_x),updateConfig:J(B({deviceId:F(),values:H(P(),L())}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`}),enable:J(B({deviceId:F()}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`}),disable:J(B({deviceId:F()}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`}),remove:J(B({deviceId:F()}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`}),removeByIntegration:J(B({integrationId:P()}),B({removed:F()}),{kind:`mutation`,auth:`admin`}),getStreamProfileMap:J(B({deviceId:F()}),H(P(),P().nullable())),setStreamProfileMap:J(B({deviceId:F(),profileMap:H(P(),P().nullable())}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`}),probeStreams:J(B({deviceId:F()}),z(vx),{kind:`mutation`,auth:`admin`}),getBindings:J(B({deviceId:F()}),B({deviceId:F(),entries:z(B({capName:P(),kind:U([`native`,`wrapped`]),providerAddonId:P(),providerNodeId:P(),nativeAddonId:P()}))})),getAllBindings:J(B({}),z(B({deviceId:F(),entries:z(B({capName:P(),kind:U([`native`,`wrapped`]),providerAddonId:P(),providerNodeId:P(),nativeAddonId:P()}))}))),setWrapperActive:J(B({deviceId:F(),capName:P(),wrapperAddonId:P(),active:I()}),R(),{kind:`mutation`,auth:`admin`}),listWrappersForCap:J(B({capName:P()}),z(P())),listBindableCapsForDeviceType:J(B({deviceType:P()}),z(B({capName:P(),wrappers:z(P())}))),getDeviceSettingsAggregate:J(B({deviceId:F()}),z_.nullable()),getDeviceLiveInfoAggregate:J(B({deviceId:F()}),z_.nullable()),getDeviceAggregate:J(B({deviceId:F()}),B({settings:z_.nullable(),live:z_.nullable()})),runDeviceAction:J(B({deviceId:F().int().nonnegative(),action:P().min(1),input:L()}),L(),{kind:`mutation`}),updateDeviceField:J(B({deviceId:F(),writerCapName:P(),writerAddonId:P(),key:P(),value:L()}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`}),updateDeviceFieldsBatch:J(B({deviceId:F(),changes:z(B({writerCapName:P(),writerAddonId:P(),key:P(),value:L()}))}),B({success:W(!0),failures:z(B({writerCapName:P(),writerAddonId:P(),error:P()}))}),{kind:`mutation`,auth:`admin`}),discoverDevices:J(B({addonId:P()}),z(__),{kind:`mutation`,auth:`admin`}),adoptDevice:J(B({addonId:P(),candidate:__,integrationId:P().optional()}),v_,{kind:`mutation`,auth:`admin`}),getCreationSchema:J(B({addonId:P(),type:U(K)}),L().nullable()),createDevice:J(B({addonId:P(),type:U(K),config:H(P(),L()),integrationId:P().optional()}),v_,{kind:`mutation`,auth:`admin`}),testCreationField:J(B({addonId:P(),type:U(K),key:P(),value:L(),formValues:H(P(),L()).optional()}),y_,{kind:`mutation`,auth:`admin`}),adoptionListCandidates:J(Xv.extend({addonId:P()}),Zv,{auth:`admin`}),adoptionRefresh:J(B({addonId:P(),integrationId:P()}),$v,{kind:`mutation`,auth:`admin`}),adoptionAdopt:J(ty.extend({addonId:P()}),ny,{kind:`mutation`,auth:`admin`}),adoptionRelease:J(ry.extend({addonId:P()}),R(),{kind:`mutation`,auth:`admin`}),testField:J(B({deviceId:F(),key:P(),value:L()}),y_,{kind:`mutation`,auth:`admin`}),getDeviceStatusAggregate:J(B({deviceId:F(),caps:z(P()).readonly().optional()}),H(P(),L().nullable()))}},Cx={name:`device-state`,scope:`system`,mode:`singleton`,methods:{getSnapshot:J(B({deviceId:F()}),H(P(),H(P(),L()))),getCapSlice:J(B({deviceId:F(),capName:P()}),H(P(),L()).nullable()),getAllSnapshots:J(B({}),H(P(),H(P(),H(P(),L())))),setCapSlice:J(B({deviceId:F(),capName:P(),slice:H(P(),L())}),R(),{kind:`mutation`})},events:{onChanged:Bf(B({deviceId:F(),capName:P(),slice:H(P(),L())}))}},wx=B({userId:P(),username:P(),email:P().optional(),displayName:P().optional(),isAdmin:I().default(!1)}),Tx={name:`auth-provider`,scope:`system`,mode:`collection`,internal:!0,methods:{validateCredentials:J(B({username:P(),password:P()}),wx.nullable(),{kind:`mutation`}),getLoginUrl:J(B({state:P()}),P()),handleCallback:J(H(P(),P()),wx,{kind:`mutation`}),validateToken:J(B({token:P()}),wx.nullable())}},Ex=B({url:P(),hostname:P(),port:F(),protocol:U([`http`,`https`])}),Dx=B({connected:I(),endpoint:Ex.nullable(),error:P().optional()}),Ox=Ex.extend({id:P(),label:P(),mode:P().optional(),sourcePort:F().optional()}),kx={name:`network-access`,scope:`system`,mode:`collection`,providerKind:`ingress`,methods:{start:J(R(),Ex,{kind:`mutation`}),stop:J(R(),R(),{kind:`mutation`}),getEndpoint:J(R(),Ex.nullable()),getStatus:J(R(),Dx),listEndpoints:J(R(),z(Ox).readonly())}},Ax=B({urls:V([P(),z(P())]),username:P().optional(),credential:P().optional()}),jx={name:`turn-provider`,scope:`system`,mode:`collection`,methods:{getTurnServers:J(R(),z(Ax).readonly())}},Mx=B({base64:P(),contentType:P()}),Nx=B({lastCapturedAt:F().nullable(),cacheAgeMs:F().nullable(),lastBytes:F().nullable(),lastStreamId:P().nullable()}),Px={name:`snapshot`,scope:`device`,deviceNative:!0,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[K.Camera],exposesDeviceSettings:!0,methods:{getSnapshot:J(B({deviceId:F(),streamId:P().optional(),force:I().optional()}),Mx.nullable()),invalidateCache:J(B({deviceId:F()}),R(),{kind:`mutation`,auth:`admin`})},status:{schema:Nx,kind:`poll`}},Fx={name:`snapshot-provider`,scope:`system`,mode:`collection`,methods:{supportsDevice:J(B({deviceId:F()}),I()),getSnapshot:J(B({deviceId:F(),streamId:P().optional()}),Mx.nullable())}},Ix={name:`notification-output`,scope:`system`,mode:`collection`,methods:{send:J(B({title:P(),body:P(),imageUrl:P().optional(),deviceId:F().optional(),eventId:P().optional(),priority:U([`low`,`normal`,`high`,`critical`]).default(`normal`),metadata:H(P(),L()).optional()}),R(),{kind:`mutation`}),sendTest:J(R(),B({success:I(),error:P().optional()}),{kind:`mutation`})}},Lx=B({deviceIds:z(F()).readonly().optional(),classNames:z(P()).readonly().optional(),zoneIds:z(P()).readonly().optional(),minConfidence:F().optional(),source:U([`pipeline`,`onboard`,`any`]).optional(),schedule:B({days:z(F()).readonly(),startHour:F(),endHour:F()}).optional(),cooldownSeconds:F().optional(),minDwellSeconds:F().optional(),eventTypeTokens:z(P()).readonly().optional()}),Rx=B({title:P(),body:P(),imageMode:U([`crop`,`annotated`,`full`,`none`])}),zx=B({id:P(),name:P(),enabled:I(),eventTypes:z(P()).readonly(),conditions:Lx,outputs:z(P()).readonly(),template:Rx.optional(),priority:U([`low`,`normal`,`high`,`critical`])}),Bx=B({ruleId:P(),eventId:P(),timestamp:F(),wouldFire:I(),reason:P().optional()}),Vx=B({id:P(),ruleId:P(),ruleName:P(),eventId:P(),timestamp:F(),outputs:z(P()).readonly(),success:I(),error:P().optional(),deviceId:F().optional()}),Hx=B({ruleId:P().optional(),deviceId:F().optional(),from:F().optional(),to:F().optional(),limit:F().optional()}),Ux={name:`advanced-notifier`,scope:`system`,mode:`singleton`,internal:!0,methods:{getRules:J(R(),B({rules:z(zx).readonly()})),upsertRule:J(B({rule:zx}),B({success:W(!0)}),{kind:`mutation`}),deleteRule:J(B({ruleId:P()}),B({success:W(!0)}),{kind:`mutation`}),testRule:J(B({ruleId:P(),lookbackMinutes:F()}),B({results:z(Bx).readonly()}),{kind:`mutation`}),getHistory:J(B({filter:Hx.optional()}),B({entries:z(Vx).readonly()}))}},Wx={name:`detection-pipeline`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[K.Camera],exposesDeviceSettings:!0,methods:{}},Gx={name:`camera-pipeline-config`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[K.Camera],exposesDeviceSettings:!0,methods:{}},Kx=U([`new`,`entered`,`left`,`moving`,`idle`]),qx=U([`motion`,`object`,`audio`]),Jx=B({x:F(),y:F(),timestamp:F(),bbox:Am}),Yx=B({timestamp:F(),position:Jx,mediaKey:P()}),Xx=B({trackId:P(),deviceId:F(),className:P(),label:P().optional(),firstSeen:F(),lastSeen:F(),positions:z(Jx).readonly(),snapshots:z(Yx).readonly(),zonesVisited:z(P()).readonly(),totalDistance:F(),state:Kx,active:I()}),Zx={id:P(),deviceId:F(),timestamp:F()},Qx=B({...Zx,kind:W(`motion`),regionCount:F(),regions:z(B({bbox:Am,pixelCount:F(),intensity:F()})).readonly().optional(),frameWidth:F().optional(),frameHeight:F().optional(),mediaUrl:P().optional()}),$x=U([`pipeline`,`onboard`]),eS=B({...Zx,kind:W(`object`),source:$x.optional(),frameId:P().optional(),trackId:P().optional(),className:P(),label:P().optional(),confidence:F().optional(),bbox:Am.optional(),zones:z(P()).readonly().optional(),state:Kx.optional(),frameWidth:F().optional(),frameHeight:F().optional(),mediaKey:P().optional(),mediaUrl:P().optional()}),tS=B({...Zx,kind:W(`audio`),rms:F(),dbfs:F(),classification:B({className:P(),originalClass:P().optional(),score:F()}).optional(),mediaUrl:P().optional()}),nS=U([`crop`,`thumbnail`,`snapshot`,`firstFrame`,`lastFrame`,`fullFrame`,`fullFrameBoxed`,`faceCrop`,`plateCrop`]),rS=B({key:P(),kind:nS,base64:P(),sizeBytes:F(),timestamp:F()}),iS=B({deviceId:F(),since:F().optional(),until:F().optional(),limit:F().int().min(1).max(5e3).default(1e3),projection:U([`full`,`slim`]).optional()}),aS=iS.extend({classFilter:P().optional()}),oS=B({trackId:P(),className:P(),confidence:F(),bbox:Am,zones:z(P()).readonly(),state:Kx}),sS={name:`pipeline-analytics`,scope:`device`,mode:`singleton`,kind:`wrapper`,defaultActive:!0,deviceTypes:[K.Camera],exposesDeviceSettings:!0,methods:{getActiveTracks:J(B({deviceId:F()}),z(Xx).readonly()),getTrack:J(B({deviceId:F(),trackId:P()}),Xx.nullable()),listTracks:J(B({deviceId:F(),since:F().optional(),until:F().optional(),limit:F().optional()}),z(Xx).readonly()),clearTracks:J(B({deviceId:F()}),R(),{kind:`mutation`,auth:`admin`}),getMotionEvents:J(iS,z(Qx).readonly()),getObjectEvents:J(aS,z(eS).readonly()),getAudioEvents:J(iS,z(tS).readonly()),getEventDensity:J(B({deviceId:F(),since:F(),until:F(),bucketMs:F().int().positive()}),z(B({bucketStart:F(),motion:F().int(),object:F().int(),audio:F().int()})).readonly()),pruneEventsBefore:J(B({deviceId:F(),cutoffMs:F()}),B({motion:F().int(),object:F().int(),audio:F().int()}),{kind:`mutation`,auth:`admin`}),getEventMedia:J(B({eventId:P(),kind:nS.optional()}),z(rS).readonly()),getTrackMedia:J(B({trackId:P()}),z(rS).readonly())},events:{onFrameTracked:{data:B({deviceId:F(),timestamp:F(),frameWidth:F(),frameHeight:F(),detections:z(oS).readonly()})},onTrackStarted:{data:B({deviceId:F(),trackId:P(),className:P()})},onTrackEnded:{data:B({deviceId:F(),trackId:P(),className:P(),durationMs:F()})},onDetectionEvent:{data:B({deviceId:F(),kind:qx,eventId:P(),timestamp:F()})}}},cS=B({total:F(),user:F(),system:F(),irq:F(),nice:F(),loadAvg:sd([F(),F(),F()]),cores:F()}),lS=B({percent:F(),totalBytes:F(),usedBytes:F(),availableBytes:F(),swapUsedBytes:F(),swapTotalBytes:F()}),uS=B({readBytes:F(),writeBytes:F(),readOps:F(),writeOps:F(),timestampMs:F()}),dS=B({rxBytes:F(),txBytes:F(),rxPackets:F(),txPackets:F(),rxErrors:F(),txErrors:F(),timestampMs:F()}),fS=B({utilization:F(),model:P(),memoryUsedBytes:F(),memoryTotalBytes:F(),temperature:F().nullable()}),pS=B({openFds:F(),threadCount:F(),activeHandles:F(),activeRequests:F()}),mS=B({avg10:F(),avg60:F(),avg300:F()}),hS=B({some:mS,full:mS.nullable()}),gS=B({cpu:cS,memory:lS,gpu:fS.nullable(),network:dS,disk:uS,pressure:B({cpu:hS.nullable(),memory:hS.nullable(),io:hS.nullable()}),process:pS,cpuTemperature:F().nullable(),timestampMs:F()}),_S=B({path:P(),totalBytes:F(),usedBytes:F(),availableBytes:F(),percent:F()}),vS=B({pid:F(),cpu:F(),memory:F()}),yS=B({addonId:P(),nodeId:P(),role:U([`hub`,`worker`]),pid:F(),state:U([`starting`,`running`,`stopping`,`stopped`,`crashed`]),uptimeSec:F()}),bS=B({pid:F(),ppid:F(),pgid:F(),classification:U([`root`,`managed`,`system`,`ghost`]),addonId:P().nullable(),nodeId:P().nullable(),command:P(),cpuPercent:F(),memoryRssBytes:F(),uptimeSec:F(),orphaned:I()}),xS=B({pid:F(),force:I().optional()}),SS=B({success:I(),reason:P().optional(),signal:U([`SIGTERM`,`SIGKILL`]).optional()}),CS=B({cpuPercent:F(),memoryPercent:F(),memoryUsedMB:F(),memoryTotalMB:F(),diskPercent:F().optional(),temperature:F().optional(),gpuPercent:F().optional(),gpuMemoryPercent:F().optional()}),wS={name:`metrics-provider`,scope:`system`,mode:`singleton`,methods:{collectSnapshot:J(R(),gS),getCached:J(R(),gS.nullable()),getCurrent:J(R(),CS),getDiskSpace:J(B({dirPath:P()}),_S),getGpuInfo:J(R(),fS.nullable()),getCpuTemperature:J(R(),F().nullable()),getProcessStats:J(B({pids:z(F())}),z(vS)),listAddonInstances:J(R(),z(yS).readonly()),getAddonStats:J(B({addonId:P()}),vS.nullable()),listNodeProcesses:J(R(),z(bS).readonly()),killProcess:J(xS,SS,{kind:`mutation`,auth:`admin`})}},TS=B({id:P(),name:P()}),ES=B({pan:F(),tilt:F(),zoom:F()}),DS=B({pan:F().optional(),tilt:F().optional(),zoom:F().optional(),speed:F().optional()}),OS=ES.extend({autofocus:I()}),kS=B({hasPan:I(),hasTilt:I(),hasZoom:I(),supportsPresets:I(),maxPresets:F().optional(),hasAutofocus:I()}),AS={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(DS.extend({deviceId:F()}),R(),{kind:`mutation`}),continuousMove:J(DS.extend({deviceId:F()}),R(),{kind:`mutation`}),stop:J(B({deviceId:F()}),R(),{kind:`mutation`}),getPresets:J(B({deviceId:F()}),z(TS)),goToPreset:J(B({deviceId:F(),presetId:P()}),R(),{kind:`mutation`}),savePreset:J(B({deviceId:F(),presetId:P(),name:P()}),R(),{kind:`mutation`,auth:`admin`}),deletePreset:J(B({deviceId:F(),presetId:P()}),R(),{kind:`mutation`,auth:`admin`}),getOptions:J(B({deviceId:F()}),kS),goHome:J(B({deviceId:F()}),R(),{kind:`mutation`}),getPosition:J(B({deviceId:F()}),ES),setAutofocus:J(B({deviceId:F(),enabled:I()}),R(),{kind:`mutation`})},status:{schema:OS,kind:`command-driven`}},jS=B({id:P(),type:P(),timestamp:F(),label:P().optional(),thumbnailUrl:P().optional(),clipUrl:P().optional(),metadata:H(P(),L()).optional()}),MS={name:`events`,scope:`device`,mode:`singleton`,deviceTypes:[K.Camera],methods:{getEvents:J(B({deviceId:F(),from:F().optional(),to:F().optional(),limit:F().optional()}),z(jS)),getEventThumbnail:J(B({deviceId:F(),eventId:P()}),B({base64:P(),contentType:P()}).nullable()),getEventClipUrl:J(B({deviceId:F(),eventId:P()}),P().nullable())}},NS=B({id:P(),name:P(),sampleCount:F().int().nonnegative(),coverMediaKey:P().optional(),coverBase64:P().optional()}),PS=B({id:P(),source:U([`detected`,`photo`]),addedAt:F().int(),deviceId:F().int().optional(),base64:P().optional()}),FS=B({faceId:P(),deviceId:F().int(),trackId:P(),timestamp:F().int(),recognizedIdentityId:P().optional(),identityName:P().optional(),assigned:I(),base64:P().optional()}),IS=U([`unassigned`,`recognized`,`all`]),LS=B({key:P(),kind:P(),base64:P(),sizeBytes:F(),timestamp:F()}),RS={name:`face-gallery`,scope:`system`,mode:`singleton`,methods:{listIdentities:J(R(),z(NS).readonly()),createIdentity:J(B({name:P().min(1)}),NS,{kind:`mutation`,auth:`admin`}),renameIdentity:J(B({id:P(),name:P().min(1)}),R(),{kind:`mutation`,auth:`admin`}),deleteIdentity:J(B({id:P()}),R(),{kind:`mutation`,auth:`admin`}),listIdentitySamples:J(B({identityId:P()}),z(PS).readonly()),removeSample:J(B({identityId:P(),sampleId:P()}),R(),{kind:`mutation`,auth:`admin`}),listRecentFaces:J(B({limit:F().int().positive().optional(),filter:IS.optional()}).optional(),z(FS).readonly()),getFaceByTrack:J(B({deviceId:F().int(),trackId:P()}),FS.nullable()),getFaceMedia:J(B({faceId:P()}),z(LS).readonly()),assignFace:J(B({faceId:P(),identityId:P()}),R(),{kind:`mutation`,auth:`admin`}),unassignFace:J(B({faceId:P()}),R(),{kind:`mutation`,auth:`admin`}),deleteFace:J(B({faceId:P()}),R(),{kind:`mutation`,auth:`admin`}),assignFaces:J(B({faceIds:z(P()).min(1),identityId:P()}),B({assigned:F().int(),failed:z(P()).readonly()}),{kind:`mutation`,auth:`admin`}),unassignFaces:J(B({faceIds:z(P()).min(1)}),B({unassigned:F().int(),failed:z(P()).readonly()}),{kind:`mutation`,auth:`admin`}),suggestFaceClusters:J(B({threshold:F().min(0).max(1).optional(),minClusterSize:F().int().min(2).optional(),limit:F().int().positive().optional()}).optional(),z(B({faceIds:z(P()).readonly(),representativeFaceId:P(),size:F().int(),cohesion:F()})).readonly())}},zS=B({plateId:P(),deviceId:F().int(),trackId:P(),timestamp:F().int(),text:P(),score:F(),corrected:I(),base64:P().optional()}),BS=B({key:P(),kind:P(),base64:P(),sizeBytes:F(),timestamp:F()}),VS=B({plateIds:z(P()).readonly(),representativePlateId:P(),representativeText:P(),size:F().int(),cohesion:F()}),HS={name:`plate-gallery`,scope:`system`,mode:`singleton`,methods:{listPlates:J(B({deviceId:F().int().optional(),limit:F().int().positive().optional()}).optional(),z(zS).readonly()),getPlateByTrack:J(B({deviceId:F().int(),trackId:P()}),zS.nullable()),getPlateMedia:J(B({plateId:P()}),z(BS).readonly()),searchPlates:J(B({text:P().min(1),maxDistance:F().int().min(0).optional(),limit:F().int().positive().optional()}),z(zS).readonly()),suggestPlateClusters:J(B({maxDistance:F().int().min(0).optional(),minClusterSize:F().int().min(2).optional(),limit:F().int().positive().optional()}).optional(),z(VS).readonly()),correctPlateText:J(B({plateId:P(),text:P().min(1)}),R(),{kind:`mutation`,auth:`admin`}),deletePlate:J(B({plateId:P()}),R(),{kind:`mutation`,auth:`admin`})}},US=B({deviceId:F(),enabled:I(),activeMode:U([`off`,`continuous`,`events`]),nodeId:P(),storageBytes:F()}),WS=B({profile:P(),startMs:F(),endMs:F()}),GS=B({deviceId:F(),ranges:z(WS)}),KS=B({deviceId:F(),days:z(F())}),qS=B({deviceId:F(),localMasterPath:P().nullable(),playbackUrl:P().nullable(),playbackEndpoints:z(P())}),JS=B({deviceId:F(),usedBytes:F()}),YS=B({locationId:P().nullable(),usedBytes:F(),availableBytes:F().nullable(),totalBytes:F().nullable()}),XS=B({nodeId:P(),totalUsedBytes:F(),devices:z(JS),locations:z(YS)}),ZS=rd(`kind`,[B({kind:W(`segment`),startMs:F(),durMs:F(),bytes:F()}),B({kind:W(`gap`),nearestEdgeMs:F().nullable()})]),QS=B({data:Rd(Uint8Array)}),$S={name:`recording`,scope:`system`,mode:`singleton`,exposesDeviceSettings:!0,status:{schema:US,kind:`command-driven`},methods:{getAvailability:J(B({deviceId:F(),fromMs:F(),toMs:F()}),GS,{kind:`query`,auth:`admin`}),getDaysWithRecordings:J(B({deviceId:F(),fromMs:F(),toMs:F(),tzOffsetMinutes:F()}),KS,{kind:`query`,auth:`admin`}),getPlaybackManifest:J(B({deviceId:F(),fromMs:F(),toMs:F()}),qS,{kind:`query`,auth:`admin`}),getStorageUsage:J(B({}),XS,{kind:`query`,auth:`admin`}),getDeviceConfig:J(B({deviceId:F()}),bf,{kind:`query`,auth:`admin`}),locateSegment:J(B({deviceId:F(),profile:P(),epochMs:F()}),ZS,{kind:`query`,auth:`admin`}),readSegmentBytes:J(B({deviceId:F(),profile:P(),startMs:F()}),QS,{kind:`query`,auth:`admin`}),setDeviceConfig:J(B({deviceId:F(),config:bf}),bf,{kind:`mutation`,auth:`admin`}),rescanStorage:J(B({deviceId:F()}),US,{kind:`mutation`,auth:`admin`}),pruneFootage:J(B({deviceId:F()}),B({floorMs:F().nullable(),deletedBuckets:F().int(),reclaimedBytes:F().int()}),{kind:`mutation`,auth:`admin`})}},eC=B({id:P(),label:P(),protocol:U([`rtsp`,`rtmp`,`annexb`,`http-mjpeg`,`webrtc`,`custom`]),url:P().optional(),resolution:B({width:F(),height:F()}).optional(),fps:F().optional(),bitrate:F().optional(),codec:P().optional(),profileHint:Wd.optional(),sdp:P().optional()}),tC=B({key:P(),value:L()}),nC=B({source:P(),data:H(P(),L())}),rC={name:`device-ops`,scope:`device`,deviceNative:!0,mode:`singleton`,methods:{getStreamSources:J(B({deviceId:F()}),z(eC)),getConfigEntries:J(B({deviceId:F()}),z(tC)),setConfig:J(B({deviceId:F(),values:H(P(),L())}),R(),{kind:`mutation`}),runAction:J(B({deviceId:F(),action:P().min(1),input:L()}),L(),{kind:`mutation`}),removeDevice:J(B({deviceId:F()}),R(),{kind:`mutation`}),getSettingsSchema:J(B({deviceId:F()}),L().nullable()),getRawState:J(B({deviceId:F()}),nC.nullable(),{auth:`protected`})}},iC=B({host:P(),port:F().int().positive().optional(),onvifPort:F().int().positive().optional(),rtspPort:F().int().positive().optional(),https:I().optional(),username:P().optional(),password:P().optional(),onvifProfile:P().optional()}),aC=B({host:P(),port:F().int().positive().nullable(),onvifPort:F().int().positive().nullable(),rtspPort:F().int().positive().nullable(),https:I().nullable(),hasUsername:I(),hasPassword:I(),onvifProfile:P().nullable()}),oC={name:`camera-credentials`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Camera],methods:{getCredentials:J(B({deviceId:F()}),iC.nullable(),{kind:`query`,auth:`admin`})},status:{schema:aC,kind:`command-driven`}},sC={name:`reboot`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Camera,K.Sensor,K.Switch],methods:{reboot:J(B({deviceId:F().int().nonnegative()}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`})}},cC={name:`button`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Button],methods:{press:J(B({deviceId:F().int().nonnegative()}),R(),{kind:`mutation`,auth:`admin`})}},lC=U([`text`,`timestamp`,`watermark`]),uC=U([`top-left`,`top-center`,`top-right`,`bottom-left`,`bottom-center`,`bottom-right`,`custom`]),dC=B({overlays:z(B({id:P(),kind:lC,enabled:I(),text:P().optional(),position:uC.optional(),availablePositions:z(uC).readonly(),readOnly:I().optional()})).readonly()}),fC=B({enabled:I().optional(),text:P().optional(),position:uC.optional()}).partial(),pC={name:`osd`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Camera],methods:{setOverlay:J(B({deviceId:F(),overlayId:P(),patch:fC}),R(),{kind:`mutation`,auth:`admin`})},events:{onStatusChanged:{data:B({deviceId:F(),status:dC})}},status:{schema:dC,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}}}]}},mC=B({childDeviceIds:z(F()).readonly(),hiddenChildIds:z(F()).readonly()}),hC={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(B({deviceId:F().int().nonnegative(),childDeviceId:F().int().nonnegative(),hidden:I()}),R(),{kind:`mutation`,auth:`admin`})},events:{onAccessoriesChanged:{data:B({deviceId:F(),childDeviceIds:z(F()).readonly(),hiddenChildIds:z(F()).readonly()})},onChildVisibilityChanged:{data:B({deviceId:F(),childDeviceId:F(),hidden:I()})}},status:{schema:mC,kind:`command-driven`}},gC=B({codecs:z(P()),sampleRate:F(),duplex:U([`half`,`full`]),maxBacklogMs:F()}),_C=B({talking:I(),lastSessionAt:F().nullable(),ability:gC.nullable()}),vC=U([`opus`,`s16le`,`g711ulaw`,`g711alaw`]),yC={name:`intercom`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Camera],methods:{startSession:J(B({deviceId:F()}),B({sessionId:P(),sdpOffer:P()}),{kind:`mutation`,auth:`admin`}),handleAnswer:J(B({deviceId:F(),sessionId:P(),sdpAnswer:P()}),R(),{kind:`mutation`,auth:`admin`}),stopSession:J(B({deviceId:F(),sessionId:P()}),R(),{kind:`mutation`,auth:`admin`}),startTalkSession:J(B({deviceId:F()}),B({sessionId:P()}),{kind:`mutation`,auth:`admin`}),pushTalkAudio:J(B({deviceId:F(),audioBase64:P(),codec:vC.optional(),sampleRate:F().int().positive().optional(),channels:F().int().positive().optional(),sequenceNumber:F().int()}),B({accepted:I()}),{kind:`mutation`,auth:`admin`}),endTalkSession:J(B({deviceId:F()}),R(),{kind:`mutation`,auth:`admin`})},events:{onStatusChanged:{data:B({deviceId:F(),status:_C})}},status:{schema:_C,kind:`command-driven`}},bC=B({camStreamId:P().min(1),kind:Gd,url:P().optional(),codec:P().optional(),resolution:Kd.optional(),fps:F().positive().optional(),label:P().optional(),deviceFeatures:z(P()).optional(),autoEligible:I().optional(),metadata:H(P(),L()).optional()}),xC={name:`stream-catalog`,scope:`device`,deviceNative:!0,mode:`singleton`,deviceTypes:[K.Camera],methods:{getCatalog:J(B({deviceId:F().int().nonnegative()}),z(bC).readonly())}},SC=U(Ud),CC=U([`videotoolbox`,`cuda`,`nvdec`,`vaapi`,`qsv`,`d3d11va`,`dxva2`,`amf`,`vdpau`,`drm`,`coreml`,`tensorrt`,`openvino`,`directml`,`webgpu`,`none`]).nullable().optional(),wC=B({preferred:z(P()).readonly()}),TC=U([`h264_videotoolbox`,`hevc_videotoolbox`,`h264_vaapi`,`hevc_vaapi`,`h264_nvenc`,`hevc_nvenc`,`h264_qsv`,`hevc_qsv`,`h264_amf`,`hevc_amf`,`libx264`,`libx265`]),EC=B({encoders:z(B({encoder:TC,codec:U([`H264`,`H265`]),family:U([`videotoolbox`,`vaapi`,`nvenc`,`qsv`,`amf`,`software`]),available:I(),reason:P().optional()})).readonly(),defaultH264:TC,defaultH265:TC,probedAt:F()}),DC=B({methods:z(P()).readonly(),probedAt:F()}),OC=U([`darwin`,`linux`,`win32`]),kC=U([`arm64`,`x64`]),AC=B({type:U([`nvidia`,`amd`,`intel`,`apple`]),name:P(),memoryMB:F().optional()}),jC=B({type:U([`apple-ane`,`intel-npu`])}),MC=B({platform:OC,arch:kC,cpuModel:P(),cpuCores:F(),totalRAM_MB:F(),availableRAM_MB:F(),gpu:AC.nullable(),npu:jC.nullable()}),NC=B({runtime:U([`node`,`python`]),backend:P(),format:U([`onnx`,`coreml`,`openvino`]),score:F(),reason:P(),available:I()}),PC=B({hardware:MC,scores:z(NC).readonly(),bestScore:NC,pythonPath:P().nullable()}),FC=B({modelId:P(),name:P(),minRAM_MB:F(),accuracyScore:F(),formats:z(P()).readonly()}),IC=B({modelId:P(),runtime:U([`node`,`python`]),backend:P(),format:SC,reason:P()}),LC={name:`platform-probe`,scope:`system`,mode:`singleton`,methods:{getCapabilities:J(R(),PC),getHardware:J(R(),MC),resolveInferenceConfig:J(B({requirements:z(FC).readonly()}),IC),resolveHwAccel:J(B({prefer:CC,nodeId:P().optional()}),wC),getHardwareEncoders:J(R(),EC),refreshHardwareEncoders:J(R(),EC,{kind:`mutation`,auth:`admin`}),getHardwareDecodeAccels:J(R(),DC),refreshHardwareDecodeAccels:J(R(),DC,{kind:`mutation`,auth:`admin`})}},RC=U([`lan`,`wifi`,`docker`,`vpn`,`loopback`,`other`]),zC=B({name:P(),family:U([`IPv4`,`IPv6`]),address:P(),cidr:P(),netmask:P(),internal:I(),mac:P(),kind:RC,preferred:I(),plausible:I(),plausibleReason:P()}),BC=B({interfaces:z(zC).readonly(),probedAt:F()}),VC=zC.nullable(),HC=B({endpoints:z(B({label:P(),baseUrl:P(),kind:U([`lan-ipv4`,`lan-ipv6`,`public`,`loopback`]),interfaceKind:U([`lan`,`wifi`,`docker`,`vpn`,`other`,`loopback`,`public`]),plausible:I(),plausibleReason:P(),priority:F()})).readonly()}),UC=B({addresses:z(P()).readonly()}),WC={name:`local-network`,scope:`system`,mode:`singleton`,methods:{list:J(R(),BC),getPreferred:J(R(),VC),getConnectionEndpoints:J(B({port:F().int().min(1).max(65535),includeLoopback:I().optional(),ipv4Only:I().optional(),scheme:U([`http`,`https`]).optional()}),HC),getAllowedAddresses:J(R(),UC),setAllowedAddresses:J(UC,B({success:W(!0)}),{kind:`mutation`}),resetAllowlistToBestMatch:J(R(),UC,{kind:`mutation`})}},GC=B({id:P(),label:P(),scope:U([`mesh`,`public`]),url:P(),hostname:P(),port:F(),protocol:U([`http`,`https`])}),KC=B({id:P(),hostname:P(),magicDns:P(),addresses:z(P()).readonly(),os:P().optional(),online:I(),lastSeenMs:F(),isSelf:I(),connection:U([`direct`,`relay`,`idle`]),relay:P().nullable(),lastHandshakeMs:F(),rxBytes:F(),txBytes:F(),tags:z(P()).readonly(),exitNodeOption:I(),advertisedRoutes:z(P()).readonly(),userLogin:P().nullable(),keyExpiry:F().nullable()}),qC=B({joined:I(),meshIp:P(),magicDnsHostname:P(),peerCount:F(),endpoints:z(GC).readonly(),error:P().optional(),tenantName:P(),magicDnsSuffix:P(),userLogin:P().nullable(),controlPlaneUrl:P(),keyExpiry:F().nullable(),daemonSocket:P().optional(),daemonCliPath:P().optional()}),JC={name:`mesh-network`,scope:`system`,mode:`collection`,providerKind:`mesh`,methods:{getStatus:J(R(),qC),join:J(B({authKey:P().min(8),hostname:P().optional()}),B({joined:W(!0)}),{kind:`mutation`}),startLogin:J(B({hostname:P().optional()}),B({loginUrl:P()}),{kind:`mutation`}),leave:J(R(),B({left:W(!0)}),{kind:`mutation`}),logout:J(R(),B({loggedOut:W(!0)}),{kind:`mutation`}),listPeers:J(R(),B({peers:z(KC).readonly()})),testConnection:J(B({authKey:P().optional()}),B({ok:I(),tenant:P().optional(),daemonVersion:P().optional(),error:P().optional()}),{kind:`mutation`})}},YC=B({id:P(),username:P(),isAdmin:I().default(!1),allowedProviders:V([z(P()),W(`*`)]),allowedDevices:H(P(),V([z(P()),W(`*`)])),scopes:z(Iv).default([]),totpEnabled:I().default(!1),createdAt:F(),updatedAt:F()}),XC=B({username:P(),password:P().min(6),isAdmin:I().default(!1),allowedProviders:V([z(P()),W(`*`)]).optional(),allowedDevices:H(P(),V([z(P()),W(`*`)])).optional(),scopes:z(Iv).optional()}),ZC=B({id:P(),isAdmin:I().optional(),allowedProviders:V([z(P()),W(`*`)]).optional(),allowedDevices:H(P(),V([z(P()),W(`*`)])).optional(),scopes:z(Iv).optional()}),QC=B({id:P(),label:P(),isAdmin:I().default(!1),allowedProviders:V([z(P()),W(`*`)]).optional(),allowedDevices:H(P(),V([z(P()),W(`*`)])).optional(),tokenPrefix:P(),createdAt:F(),lastUsedAt:F().optional()}),$C=B({label:P(),isAdmin:I().default(!1),allowedProviders:V([z(P()),W(`*`)]).optional(),allowedDevices:H(P(),V([z(P()),W(`*`)])).optional()}),ew=B({token:P(),record:QC}),tw=B({id:P(),userId:P(),name:P(),tokenPrefix:P(),scopes:z(Iv),expiresAt:F().nullish(),lastUsedAt:F().nullish(),createdAt:F()}),nw=B({userId:P(),name:P(),scopes:z(Iv),expiresAt:F().optional()}),rw=B({token:P(),record:tw}),iw=B({id:P(),userId:P(),username:P(),integrationId:P(),scopes:z(Iv),createdAt:F(),lastUsedAt:F(),revokedAt:F().nullable()}),aw=B({secret:P(),otpauthUrl:P()}),ow=B({enabled:I(),confirmedAt:F().nullable()}),sw={name:`user-management`,scope:`system`,mode:`singleton`,methods:{listUsers:J(R(),z(YC),{auth:`admin`}),createUser:J(XC,YC,{kind:`mutation`,auth:`admin`,access:`create`}),updateUser:J(ZC,B({success:W(!0)}),{kind:`mutation`,auth:`admin`,access:`create`}),deleteUser:J(B({id:P()}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`,access:`delete`}),resetPassword:J(B({id:P(),newPassword:P().min(6)}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`,access:`create`}),setUserScopes:J(B({userId:P(),scopes:z(Iv)}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`,access:`create`}),validateCredentials:J(B({username:P(),password:P()}),YC.extend({passwordHash:P()}).nullable(),{kind:`mutation`,access:`view`}),listApiKeys:J(R(),z(QC),{auth:`admin`}),createApiKey:J($C,ew,{kind:`mutation`,auth:`admin`,access:`create`}),revokeApiKey:J(B({id:P()}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`,access:`delete`}),validateApiKey:J(B({token:P()}),QC.nullable(),{kind:`mutation`,access:`view`}),createScopedToken:J(nw,rw,{kind:`mutation`,auth:`admin`,access:`create`}),revokeScopedToken:J(B({id:P()}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`,access:`delete`}),validateScopedToken:J(B({token:P()}),tw.nullable(),{access:`view`}),listScopedTokens:J(B({userId:P()}),z(tw),{auth:`admin`}),setupTotp:J(B({userId:P()}),aw,{kind:`mutation`,auth:`admin`,access:`create`}),confirmTotp:J(B({userId:P(),code:P()}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`,access:`create`}),disableTotp:J(B({userId:P()}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`,access:`delete`}),getTotpStatus:J(B({userId:P()}),ow,{auth:`admin`}),verifyTotp:J(B({userId:P(),code:P()}),B({valid:I()}),{kind:`mutation`,access:`view`}),oauthIssueCode:J(B({integrationId:P(),userId:P(),username:P(),scopes:z(Iv),redirectUri:P(),hubUrl:P()}),B({code:P()}),{kind:`mutation`,access:`create`}),oauthExchangeCode:J(B({code:P(),redirectUri:P()}),B({accessToken:P(),refreshToken:P(),expiresIn:F()}).nullable(),{kind:`mutation`,access:`view`}),oauthRefresh:J(B({refreshToken:P()}),B({accessToken:P(),refreshToken:P(),expiresIn:F()}).nullable(),{kind:`mutation`,access:`view`}),oauthVerifyAccessToken:J(B({token:P()}),B({userId:P(),username:P(),scopes:z(Iv)}).nullable(),{access:`view`}),listOauthSessions:J(R(),z(iw),{auth:`admin`}),revokeOauthSession:J(B({id:P()}),B({success:I()}),{kind:`mutation`,auth:`admin`,access:`delete`})}},cw=B({streaming:I(),notifications:I(),objectDetection:I(),remoteAccess:I(),agentCluster:I(),smartHome:I(),recordings:I(),backup:I(),repl:I()}),lw=B({status:W(`ok`),uptime:F()}),uw=B({name:P(),address:P(),family:P(),internal:I()}),dw={name:`system`,scope:`system`,mode:`singleton`,methods:{info:J(R(),cw),health:J(R(),lw),featureFlags:J(R(),cw),networkAddresses:J(R(),z(uw).readonly()),getRetentionConfig:J(R(),L().nullable(),{auth:`admin`}),setRetentionConfig:J(H(P(),L()),Wu(),{kind:`mutation`,auth:`admin`}),forceRetentionCleanup:J(R(),R(),{kind:`mutation`,auth:`admin`})}},fw=B({nominalBitrateKbps:F(),observedBitrateKbps:F(),peakBitrateKbps:F(),packetLossPercent:F(),lastUpdated:F()}),pw=B({rttMs:F(),jitterMs:F(),estimatedBandwidthKbps:F(),packetLossPercent:F().min(0).max(100),lastUpdated:F()}),mw=B({deviceId:F(),streams:H(P(),fw),client:pw.optional()}),hw={name:`network-quality`,scope:`system`,mode:`singleton`,methods:{getDeviceStats:J(B({deviceId:F()}),mw.nullable()),getAllStats:J(R(),z(mw).readonly()),reportClientStats:J(B({deviceId:F(),rttMs:F().min(0).max(6e4),jitterMs:F().min(0).max(1e4),estimatedBandwidthKbps:F().min(0).max(1e6),packetLossPercent:F().min(0).max(100)}),R(),{kind:`mutation`})}},gw=B({title:P(),message:P(),severity:U([`info`,`warning`,`critical`]),duration:F().optional(),action:B({label:P(),url:P()}).optional()}),_w={name:`toast`,scope:`system`,mode:`singleton`,methods:{onToast:J(R(),gw,{kind:`subscription`})}},vw=B({addonId:P(),capabilities:z(P()).readonly(),status:P()}),yw=B({pid:F(),name:P(),state:P(),cpuPercent:F(),memoryRss:F(),uptimeSeconds:F(),services:z(vw).readonly(),groupId:P().optional()}),bw=B({id:P(),status:P(),cpuPercent:F(),memoryRss:F()}),xw=B({category:P(),total:F(),healthy:F(),addons:z(bw).readonly()}),Sw=B({id:P(),name:P(),hostname:P(),platform:P(),arch:P(),cpuModel:P().nullable(),cpuCores:F(),memoryMB:F(),engines:z(P()).readonly(),isHub:I(),isOnline:I(),cpuPercent:F(),memoryPercent:F(),uptime:F(),lastSeen:P(),localIps:z(P()).readonly(),addons:z(B({id:P(),capabilities:z(P()).readonly(),status:P()})).readonly(),processes:z(yw).readonly(),categories:z(xw).readonly()}),Cw=B({callerAddonId:P(),providerAddonId:P(),capName:P(),callsPerMin:F(),lastCallAtMs:F()}),ww=B({nodeId:P(),name:P(),version:P(),status:P(),synced:I()}),Tw=B({hubVersion:P(),nodes:z(ww)}),Ew=B({nodeId:P(),addonId:P()}),Dw=B({id:P(),status:P(),version:P().optional(),packageName:P().optional()}),Ow=B({success:I()}),kw=B({success:I(),reason:P().optional()}),Aw=B({restarted:z(P()).readonly(),failed:z(P()).readonly()}),jw=B({nodeId:P(),name:P()}),Mw={name:`nodes`,scope:`system`,mode:`singleton`,nodeIdMode:`data`,methods:{topology:J(R(),z(Sw).readonly(),{auth:`admin`}),deployAddon:J(Ew,Ow,{kind:`mutation`,auth:`admin`}),undeployAddon:J(Ew,Ow,{kind:`mutation`,auth:`admin`}),restartAddon:J(Ew,Ow,{kind:`mutation`,auth:`admin`}),restartProcess:J(B({nodeId:P(),processName:P()}),kw,{kind:`mutation`,auth:`admin`}),restartNode:J(B({nodeId:P()}),Aw,{kind:`mutation`,auth:`admin`}),shutdownNode:J(B({nodeId:P()}),Ow,{kind:`mutation`,auth:`admin`}),renameNode:J(B({nodeId:P(),name:P().min(1).max(64)}),jw,{kind:`mutation`,auth:`admin`}),clusterAddonStatus:J(R(),H(P(),Tw),{auth:`admin`}),getCapUsageGraph:J(B({windowSeconds:F().int().positive().max(300).default(60)}),z(Cw).readonly(),{auth:`admin`}),getNodeAddons:J(B({nodeId:P()}),z(Dw).readonly(),{auth:`admin`}),setProcessLogLevel:J(B({nodeId:P(),level:P()}),Ow,{kind:`mutation`,auth:`admin`}),executeQuery:J(B({nodeId:P(),addonId:P(),queryName:P(),params:H(P(),L()).optional()}),L(),{kind:`mutation`,auth:`admin`})}},Nw=B({id:P(),addonId:P(),name:P(),enabled:I(),info:H(P(),L()).readonly(),createdAt:F(),updatedAt:F(),processState:P()}),Pw=B({id:P(),addonId:P(),name:P(),enabled:I(),info:H(P(),L()).readonly(),createdAt:F(),updatedAt:F()}),Fw=B({addonId:P(),name:P(),description:P(),iconUrl:P().nullable(),color:P(),instanceMode:P(),discoveryMode:P(),kind:U([`device-adoption`,`device-provider`]),brokerKind:P().nullable(),supportsLocationImport:I(),existingInstances:z(B({id:P(),name:P()})),canAdd:I()}),Iw=B({success:I(),error:P().optional()}),Lw=B({addonId:P(),name:P(),enabled:I().optional(),info:H(P(),L()).optional(),settings:H(P(),L()).optional(),skipRestart:I().optional()}),Rw=B({id:P(),name:P().optional(),enabled:I().optional(),info:H(P(),L()).optional()}),zw=B({success:I(),deletedId:P()}),Bw={name:`integrations`,scope:`system`,mode:`singleton`,methods:{list:J(R(),z(Nw)),get:J(B({id:P()}),Nw),getByAddonId:J(B({addonId:P()}),Pw.nullable()),create:J(Lw,Pw,{kind:`mutation`,auth:`admin`}),update:J(Rw,Pw,{kind:`mutation`,auth:`admin`}),delete:J(B({id:P()}),zw,{kind:`mutation`,auth:`admin`}),getSettings:J(B({id:P()}),H(P(),L()),{auth:`admin`}),setSettings:J(B({id:P(),settings:H(P(),L())}),B({success:I()}),{kind:`mutation`,auth:`admin`}),getAvailableTypes:J(R(),z(Fw),{auth:`admin`}),testConnection:J(B({addonId:P(),settings:H(P(),L())}),Iw,{kind:`mutation`,auth:`admin`})}},Vw=U([`install`,`update`,`uninstall`,`restart`]),Hw=U([`queued`,`fetching`,`staged`,`validating`,`applying`,`restarting`,`applied`,`done`,`failed`,`skipped`]),Uw=U([`framework`,`addon`]),Ww=B({tsMs:F(),nodeId:P(),packageName:P(),phase:Hw,message:P()}),Gw=B({taskId:P(),nodeId:P(),packageName:P(),fromVersion:P().nullable(),toVersion:P(),target:Uw,phase:Hw,stagedPath:P().nullable(),attempts:F(),steps:z(Ww),error:P().nullable(),startedAtMs:F().nullable(),finishedAtMs:F().nullable()}),Kw=U([`running`,`completed`,`failed`,`partially-failed`,`cancelled`]),qw=U([`single`,`bulk`,`cluster`]),Jw=B({jobId:P(),kind:Vw,createdAtMs:F(),createdBy:P(),scope:qw,tasks:z(Gw),state:Kw,schemaVersion:W(1)}),Yw=U([`debug`,`info`,`warn`,`error`]),Xw=U([`off`,`latest`,`beta`]),Zw=U([`off`,`latest`,`beta`,`inherit`]),Qw=B({id:P(),name:P().optional(),version:P().optional(),description:P().optional(),icon:P().optional(),color:P().optional(),capabilities:z(L()).readonly().optional(),packageName:P(),packageVersion:P(),packageDisplayName:P().optional(),bundle:B({displayName:P(),description:P().optional(),icon:P().optional()}).optional(),protected:I().optional(),removable:I().optional()}),$w=B({pid:F().optional(),mode:P(),state:P()}),eT=B({phase:U([`pending`,`healthy`,`failed`]),retryCount:F(),firstFailureAt:F().nullable(),lastAttemptAt:F().nullable(),lastError:B({message:P(),stack:P().optional()}).nullable(),nextRetryAt:F().nullable(),alertEmitted:I(),retrying:I(),inGracePeriod:I()}),tT=B({manifest:Qw,declaration:L().optional(),source:P(),installSource:P().optional(),process:$w.optional(),hasBackup:I().optional(),health:eT.nullable().optional()}),nT=B({name:P(),version:P(),dir:P(),installSource:P().optional()}),rT=B({name:P(),currentVersion:P(),latestVersion:P(),category:U([`addon`,`core`]),requiresRestart:I(),isSystem:I()}),iT=B({version:P(),publishedAt:P(),deprecated:P().optional(),distTags:z(P()).readonly()}),aT=B({name:P(),version:P(),description:P(),keywords:z(P()).readonly(),publishedAt:P(),author:P(),installed:I(),installedVersion:P().optional()}),oT=B({channel:Xw,intervalSeconds:F()}),sT=Zw,cT=L(),lT=L(),uT=L(),dT=B({packageName:P(),fromVersion:P(),toVersion:P(),restartingAt:F()}),fT=U([`queued`,`updating`,`done`,`done-pending-restart`,`failed`]),pT=B({name:P(),isSystem:I(),fromVersion:P(),toVersion:P(),status:fT,error:P().optional(),startedAtMs:F().optional(),completedAtMs:F().optional()}),mT=U([`regular`,`system`,`restarting`,`finalizing`]);B({id:P(),nodeId:P(),startedAtMs:F(),completedAtMs:F().optional(),total:F(),completed:F(),failed:F(),current:P().nullable(),phase:mT,cancelled:I(),items:z(pT).readonly()});var hT=B({packageName:P(),currentVersion:P(),latestVersion:P().nullable(),hasUpdate:I(),description:P().optional()}),gT=B({timestamp:P(),level:P(),message:P(),scope:P().optional()}),_T=L(),vT=B({addonId:P().min(1),action:P().min(1),input:L()}),yT=[hC,Zy,$y,ub,H_,ob,ib,{name:`addons`,scope:`system`,mode:`singleton`,nodeIdMode:`data`,methods:{list:J(R(),z(tT).readonly()),getLogs:J(B({addonId:P(),limit:F().min(1).max(500).default(100),level:Yw.optional()}),z(_T)),listPackages:J(R(),z(nT).readonly()),installPackage:J(B({packageName:P(),version:P().optional()}),lT,{kind:`mutation`,auth:`admin`}),installFromWorkspace:J(B({packageName:P()}),lT,{kind:`mutation`,auth:`admin`}),isWorkspaceAvailable:J(R(),I()),listWorkspacePackages:J(R(),z(L()).readonly()),uninstallPackage:J(B({packageName:P()}),L(),{kind:`mutation`,auth:`admin`}),reloadPackages:J(R(),uT,{kind:`mutation`,auth:`admin`}),searchAvailable:J(B({query:P().optional()}),z(aT)),listUpdates:J(B({nodeId:P().optional()}),z(rT).readonly(),{auth:`admin`}),updatePackage:J(B({name:P().min(1),version:P().optional(),nodeId:P().optional()}),L(),{kind:`mutation`,auth:`admin`}),rollbackPackage:J(B({name:P().min(1)}),B({rolledBackTo:P().nullable()}),{kind:`mutation`,auth:`admin`}),forceRefresh:J(B({nodeId:P().optional()}),L(),{kind:`mutation`,auth:`admin`}),restartServer:J(B({confirm:W(!0)}),L(),{kind:`mutation`,auth:`admin`}),getLastRestart:J(R(),B({kind:U([`framework-update`,`manual`,`system`,`framework-bulk-update`]),packageName:P().optional(),fromVersion:P().optional(),toVersion:P().optional(),requestedBy:P().optional(),requestedAt:F()}).nullable(),{auth:`admin`}),listFrameworkPackages:J(R(),z(hT).readonly(),{auth:`admin`}),listCapabilityProviders:J(B({capName:P().min(1)}),z(B({addonId:P(),mode:U([`singleton`,`collection`]),isActive:I()})).readonly()),setCapabilityProviderEnabled:J(B({capName:P().min(1),addonId:P().min(1),enabled:I()}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`}),updateFrameworkPackage:J(B({packageName:P().min(1),version:P().optional(),deferRestart:I().optional()}),dT,{kind:`mutation`,auth:`admin`}),getVersions:J(B({name:P()}),z(iT).readonly()),restartAddon:J(B({addonId:P()}),cT,{kind:`mutation`,auth:`admin`}),retryLoad:J(B({packageName:P()}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`}),getAutoUpdateSettings:J(R(),oT,{auth:`admin`}),setAutoUpdateSettings:J(B({channel:Xw,intervalSeconds:F().min(300).max(86400).optional()}),L(),{kind:`mutation`,auth:`admin`}),getAddonAutoUpdate:J(B({addonId:P()}),sT,{auth:`admin`}),setAddonAutoUpdate:J(B({addonId:P(),channel:Zw}),L(),{kind:`mutation`,auth:`admin`}),applyAutoUpdateToAll:J(B({channel:Xw}),B({success:W(!0)}),{kind:`mutation`,auth:`admin`}),custom:J(vT,L(),{kind:`mutation`}),startJob:J(B({kind:U([`install`,`update`,`uninstall`,`restart`]),targets:z(B({name:P().min(1),version:P().min(1)})).min(1),nodeIds:z(P()).optional()}),B({jobId:P()}),{kind:`mutation`,auth:`admin`}),getJob:J(B({jobId:P()}),Jw.nullable(),{auth:`admin`}),listJobs:J(B({activeOnly:I().optional()}),z(Jw),{auth:`admin`}),cancelJob:J(B({jobId:P()}),B({cancelled:I()}),{kind:`mutation`,auth:`admin`}),onAddonLogs:J(B({addonId:P(),level:Yw.optional()}),gT,{kind:`subscription`})}},jv,Ux,Rf,Wf,q_,Kf,$b,Qb,sx,Xf,Tx,Qf,bv,ep,np,ip,Dy,cC,oC,Gx,wp,Ep,kp,Pp,Ip,Rp,Bp,Up,Gp,fb,Wx,oy,Xp,Jy,Sx,rC,x_,Cx,Pf,$p,ux,nm,am,MS,RS,cm,If,pv,um,fm,mm,gm,vm,Bw,yC,bm,WC,Sm,Ov,Dm,JC,wS,Ph,Lm,Lh,Yh,zy,eg,kx,hw,Mw,Ix,sg,lg,Bv,pC,sS,hh,Jb,jh,HS,LC,dg,mg,gg,Sg,AS,Dg,sC,$S,hb,kg,Tv,jg,qv,Px,Fx,Rv,Y_,uv,sv,yp,xC,Rg,sp,Bg,dw,Hg,Wg,_w,jx,Kg,sw,Hv,Xg,Qg,e_,Cb,n_,i_,_b,bb,d_,h_,yh];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.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 bT=B({name:P(),stagedPath:P(),backupPath:P(),toVersion:P(),fromVersion:P().nullable()});B({jobId:P(),taskId:P(),packages:z(bT),requestedAtMs:F(),schemaVersion:W(1)}),B({jobId:P(),taskId:P(),backups:z(B({name:P(),backupPath:P(),livePath:P()})),appliedAtMs:F(),bootAttempts:F(),schemaVersion:W(1)});var xT=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()}},ST=class{constructor(e){this.generateIdentifier=e,this.kv=new xT}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)}},CT=class extends ST{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 wT(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 TT(e,t){let n=wT(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 ET(e,t){Object.entries(e).forEach(([e,n])=>t(n,e))}function DT(e,t){return e.indexOf(t)!==-1}function OT(e,t){for(let n=0;n<e.length;n++){let r=e[n];if(t(r))return r}}var kT=class{constructor(){this.transfomers={}}register(e){this.transfomers[e.name]=e}findApplicable(e){return TT(this.transfomers,t=>t.isApplicable(e))}findByName(e){return this.transfomers[e]}},AT=e=>Object.prototype.toString.call(e).slice(8,-1),jT=e=>e===void 0,MT=e=>e===null,NT=e=>typeof e!=`object`||!e||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype,PT=e=>NT(e)&&Object.keys(e).length===0,FT=e=>Array.isArray(e),IT=e=>typeof e==`string`,LT=e=>typeof e==`number`&&!isNaN(e),RT=e=>typeof e==`boolean`,zT=e=>e instanceof RegExp,BT=e=>e instanceof Map,VT=e=>e instanceof Set,HT=e=>AT(e)===`Symbol`,UT=e=>e instanceof Date&&!isNaN(e.valueOf()),WT=e=>e instanceof Error,GT=e=>typeof e==`number`&&isNaN(e),KT=e=>RT(e)||MT(e)||jT(e)||LT(e)||IT(e)||HT(e),qT=e=>typeof e==`bigint`,JT=e=>e===1/0||e===-1/0,YT=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),XT=e=>e instanceof URL,ZT=e=>e.replace(/\\/g,`\\\\`).replace(/\./g,`\\.`),QT=e=>e.map(String).map(ZT).join(`.`),$T=(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 eE(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var tE=[eE(jT,`undefined`,()=>null,()=>void 0),eE(qT,`bigint`,e=>e.toString(),e=>typeof BigInt<`u`?BigInt(e):(console.error(`Please add a BigInt polyfill.`),e)),eE(UT,`Date`,e=>e.toISOString(),e=>new Date(e)),eE(WT,`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}),eE(zT,`regexp`,e=>``+e,e=>{let t=e.slice(1,e.lastIndexOf(`/`)),n=e.slice(e.lastIndexOf(`/`)+1);return new RegExp(t,n)}),eE(VT,`set`,e=>[...e.values()],e=>new Set(e)),eE(BT,`map`,e=>[...e.entries()],e=>new Map(e)),eE(e=>GT(e)||JT(e),`number`,e=>GT(e)?`NaN`:e>0?`Infinity`:`-Infinity`,Number),eE(e=>e===0&&1/e==-1/0,`number`,()=>`-0`,Number),eE(XT,`URL`,e=>e.toString(),e=>new URL(e))];function nE(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var rE=nE((e,t)=>HT(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}),iE=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),aE=nE(YT,e=>[`typed-array`,e.constructor.name],e=>[...e],(e,t)=>{let n=iE[t[1]];if(!n)throw Error(`Trying to deserialize unknown typed array`);return new n(e)});function oE(e,t){return e?.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}var sE=nE(oE,(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)}),cE=nE((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)}),lE=[sE,rE,cE,aE],uE=(e,t)=>{let n=OT(lE,n=>n.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};let r=OT(tE,n=>n.isApplicable(e,t));if(r)return{value:r.transform(e,t),type:r.annotation}},dE={};tE.forEach(e=>{dE[e.annotation]=e});var fE=(e,t,n)=>{if(FT(t))switch(t[0]){case`symbol`:return rE.untransform(e,t,n);case`class`:return sE.untransform(e,t,n);case`custom`:return cE.untransform(e,t,n);case`typed-array`:return aE.untransform(e,t,n);default:throw Error(`Unknown transformation: `+t)}else{let r=dE[t];if(!r)throw Error(`Unknown transformation: `+t);return r.untransform(e,n)}},pE=(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 mE(e){if(DT(e,`__proto__`))throw Error(`__proto__ is not allowed as a property`);if(DT(e,`prototype`))throw Error(`prototype is not allowed as a property`);if(DT(e,`constructor`))throw Error(`constructor is not allowed as a property`)}var hE=(e,t)=>{mE(t);for(let n=0;n<t.length;n++){let r=t[n];if(VT(e))e=pE(e,+r);else if(BT(e)){let a=+r,o=+t[++n]==0?`key`:`value`,s=pE(e,a);switch(o){case`key`:e=s;break;case`value`:e=e.get(s);break}}else e=e[r]}return e},gE=(e,t,n)=>{if(mE(t),t.length===0)return n(e);let r=e;for(let e=0;e<t.length-1;e++){let n=t[e];if(FT(r)){let e=+n;r=r[e]}else if(NT(r))r=r[n];else if(VT(r)){let e=+n;r=pE(r,e)}else if(BT(r)){if(e===t.length-2)break;let a=+n,o=+t[++e]==0?`key`:`value`,s=pE(r,a);switch(o){case`key`:r=s;break;case`value`:r=r.get(s);break}}}let a=t[t.length-1];if(FT(r)?r[+a]=n(r[+a]):NT(r)&&(r[a]=n(r[a])),VT(r)){let e=pE(r,+a),t=n(e);e!==t&&(r.delete(e),r.add(t))}if(BT(r)){let e=+t[t.length-2],o=pE(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},_E=e=>e<1;function vE(e,t,n,r=[]){if(!e)return;let a=_E(n);if(!FT(e)){ET(e,(e,o)=>vE(e,t,n,[...r,...$T(o,a)]));return}let[o,s]=e;s&&ET(s,(e,o)=>{vE(e,t,n,[...r,...$T(o,a)])}),t(o,r)}function yE(e,t,n,r){return vE(t,(t,n)=>{e=gE(e,n,e=>fE(e,t,r))},n),e}function bE(e,t,n){let r=_E(n);function a(t,n){let a=hE(e,$T(n,r));t.map(e=>$T(e,r)).forEach(t=>{e=gE(e,t,()=>a)})}if(FT(t)){let[n,o]=t;n.forEach(t=>{e=gE(e,$T(t,r),()=>e)}),o&&ET(o,a)}else ET(t,a);return e}var xE=(e,t)=>NT(e)||FT(e)||BT(e)||VT(e)||WT(e)||oE(e,t);function SE(e,t,n){let r=n.get(e);r?r.push(t):n.set(e,[t])}function CE(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(QT):n[QT(a)]=o.map(QT)}),r?PT(n)?[r]:[r,n]:PT(n)?void 0:n}var wE=(e,t,n,r,a=[],o=[],s=new Map)=>{let c=KT(e);if(!c){SE(e,a,t);let n=s.get(e);if(n)return r?{transformedValue:null}:n}if(!xE(e,n)){let t=uE(e,n),r=t?{transformedValue:t.value,annotations:[t.type]}:{transformedValue:e};return c||s.set(e,r),r}if(DT(o,e))return{transformedValue:null};let l=uE(e,n),u=l?.value??e,d=FT(u)?[]:{},f={};ET(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=wE(c,t,n,r,[...a,l],[...o,e],s);d[l]=u.transformedValue,FT(u.annotations)?f[ZT(l)]=u.annotations:NT(u.annotations)&&ET(u.annotations,(e,t)=>{f[ZT(l)+`.`+t]=e})});let p=PT(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 TE(e){return Object.prototype.toString.call(e).slice(8,-1)}function EE(e){return TE(e)===`Array`}function DE(e){if(TE(e)!==`Object`)return!1;let t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function OE(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 kE(e,t={}){if(EE(e))return e.map(e=>kE(e,t));if(!DE(e))return e;let n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertySymbols(e);return[...n,...r].reduce((n,r)=>{if(r===`__proto__`||EE(t.props)&&!t.props.includes(r))return n;let a=e[r];return OE(n,r,kE(a,t),e,t.nonenumerable),n},{})}var AE=class{constructor({dedupe:e=!1}={}){this.classRegistry=new CT,this.symbolRegistry=new ST(e=>e.description??``),this.customTransformerRegistry=new kT,this.allowedErrorProps=[],this.dedupe=e}serialize(e){let t=new Map,n=wE(e,t,this,this.dedupe),r={json:n.transformedValue};n.annotations&&(r.meta={...r.meta,values:n.annotations});let a=CE(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:kE(n);return r?.values&&(a=yE(a,r.values,r.v??0,this)),r?.referentialEqualities&&(a=bE(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)}};AE.defaultInstance=new AE,AE.serialize=AE.defaultInstance.serialize.bind(AE.defaultInstance),AE.deserialize=AE.defaultInstance.deserialize.bind(AE.defaultInstance),AE.stringify=AE.defaultInstance.stringify.bind(AE.defaultInstance),AE.parse=AE.defaultInstance.parse.bind(AE.defaultInstance),AE.registerClass=AE.defaultInstance.registerClass.bind(AE.defaultInstance),AE.registerSymbol=AE.defaultInstance.registerSymbol.bind(AE.defaultInstance),AE.registerCustom=AE.defaultInstance.registerCustom.bind(AE.defaultInstance),AE.allowErrorProps=AE.defaultInstance.allowErrorProps.bind(AE.defaultInstance),AE.serialize,AE.deserialize,AE.stringify,AE.parse,AE.registerClass,AE.registerCustom,AE.registerSymbol,AE.allowErrorProps;var jE=1e4,ME=6e3,NE=2e3,PE=3e4,FE=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??NE,this.maxRetryMs=e.maxRetryDelayMs??PE,this._trpcClient=this.buildTrpcClient(),this._systemProxy=D_(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 N_(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=D_(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 LE(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=Dr({url:e,connectionParams:()=>({token:this.token}),retryDelayMs:e=>Math.min(t*2**e,n),keepAlive:{enabled:!0,intervalMs:jE,pongTimeoutMs:ME},onOpen:()=>{this._connectionVersion+=1,this.emitConnectionEvent(`connected`)},onClose:()=>{this.emitConnectionEvent(`disconnected`)}}),Ir({links:[Or({client:this._wsClient,transformer:AE})]})}return this._wsClient=null,Ir({links:[ar({url:`${this._serverUrl}/trpc`,headers:e,transformer:AE})]})}};function IE(e){return new FE(e)}async function LE(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 RE=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}({}),zE=`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(`.`),BE=[`person`,`people`,`pedestrian`,`rider`,`driver`,`cyclist`,`skier`,`skateboarder`,`face`,`hand`,`head`,`body`],VE=[`vehicle`,`car`,`truck`,`bus`,`motorcycle`,`bicycle`,`van`,`ambulance`,`police_car`,`fire_truck`,`train`,`subway`,`tram`,`airplane`,`boat`,`ship`,`helicopter`],HE=`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(`.`),UE=[`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`],WE=[`motion`,`movement`,`other`],GE=[`package`,`packet`],KE=[`audio`],qE=`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(`.`),JE=[`doorbell`,`ring`],YE=[`lock`,`binary`,`flood`,`entry`,`door`,`leak`,`door_open`,`flooded`,`entry_open`];({...zE.reduce((e,t)=>({...e,[t]:`animal`}),{}),...BE.reduce((e,t)=>({...e,[t]:`person`}),{}),...VE.reduce((e,t)=>({...e,[t]:`vehicle`}),{}),...WE.reduce((e,t)=>({...e,[t]:`motion`}),{}),...GE.reduce((e,t)=>({...e,[t]:`package`}),{}),...HE.reduce((e,t)=>({...e,[t]:`face`}),{}),...UE.reduce((e,t)=>({...e,[t]:`plate`}),{}),...KE.reduce((e,t)=>({...e,[t]:`audio`}),{}),...qE.reduce((e,t)=>({...e,[t]:`audio`}),{}),...JE.reduce((e,t)=>({...e,[t]:`doorbell`}),{}),...YE.reduce((e,t)=>({...e,[t]:`sensor`}),{})}),[...Object.values(RE).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 XE=`modulepreload`,ZE=function(e,t){return new URL(e,t).href},QE={},$E=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=ZE(t,n),t in QE)return;QE[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`:XE,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 eD(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=eD(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function tD(){for(var e,t,n=0,r=``,a=arguments.length;n<a;n++)(e=arguments[n])&&(t=eD(e))&&(r&&(r+=` `),r+=t);return r}var nD=(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},rD=(e,t)=>({classGroupId:e,validator:t}),iD=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),aD=`-`,oD=[],sD=`arbitrary..`,cD=e=>{let t=dD(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return uD(e);let n=e.split(aD);return lD(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],a=n[e];return t?a?nD(a,t):t:a||oD}return n[e]||oD}}},lD=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],a=n.nextPart.get(r);if(a){let n=lD(e,t+1,a);if(n)return n}let o=n.validators;if(o===null)return;let s=t===0?e.join(aD):e.slice(t).join(aD),c=o.length;for(let e=0;e<c;e++){let t=o[e];if(t.validator(s))return t.classGroupId}},uD=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?sD+r:void 0})(),dD=e=>{let{theme:t,classGroups:n}=e;return fD(n,t)},fD=(e,t)=>{let n=iD();for(let r in e){let a=e[r];pD(a,n,r,t)}return n},pD=(e,t,n,r)=>{let a=e.length;for(let o=0;o<a;o++){let a=e[o];mD(a,t,n,r)}},mD=(e,t,n,r)=>{if(typeof e==`string`){hD(e,t,n);return}if(typeof e==`function`){gD(e,t,n,r);return}_D(e,t,n,r)},hD=(e,t,n)=>{let r=e===``?t:vD(t,e);r.classGroupId=n},gD=(e,t,n,r)=>{if(yD(e)){pD(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(rD(n,e))},_D=(e,t,n,r)=>{let a=Object.entries(e),o=a.length;for(let e=0;e<o;e++){let[o,s]=a[e];pD(s,vD(t,o),n,r)}},vD=(e,t)=>{let n=e,r=t.split(aD),a=r.length;for(let e=0;e<a;e++){let t=r[e],a=n.nextPart.get(t);a||(a=iD(),n.nextPart.set(t,a)),n=a}return n},yD=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,bD=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)}}},xD=`!`,SD=`:`,CD=[],wD=(e,t,n,r,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:a}),TD=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===SD){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(xD)?(l=c.slice(0,-1),u=!0):c.startsWith(xD)&&(l=c.slice(1),u=!0);let d=o&&o>a?o-a:void 0;return wD(t,u,l,d)};if(t){let e=t+SD,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):wD(CD,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},ED=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}},DD=e=>({cache:bD(e.cacheSize),parseClassName:TD(e),sortModifiers:ED(e),postfixLookupClassGroupIds:OD(e),...cD(e)}),OD=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},kD=/\s+/,AD=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:o,postfixLookupClassGroupIds:s}=t,c=[],l=e.trim().split(kD),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+xD: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},jD=(...e)=>{let t=0,n,r,a=``;for(;t<e.length;)(n=e[t++])&&(r=MD(n))&&(a&&(a+=` `),a+=r);return a},MD=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=MD(e[r]))&&(n&&(n+=` `),n+=t);return n},ND=(e,...t)=>{let n,r,a,o,s=s=>(n=DD(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=AD(e,n);return a(e,o),o};return o=s,(...e)=>o(jD(...e))},PD=[],FD=e=>{let t=t=>t[e]||PD;return t.isThemeGetter=!0,t},ID=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,LD=/^\((?:(\w[\w-]*):)?(.+)\)$/i,RD=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,zD=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,BD=/\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$/,VD=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,HD=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,UD=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,WD=e=>RD.test(e),GD=e=>!!e&&!Number.isNaN(Number(e)),KD=e=>!!e&&Number.isInteger(Number(e)),qD=e=>e.endsWith(`%`)&&GD(e.slice(0,-1)),JD=e=>zD.test(e),YD=()=>!0,XD=e=>BD.test(e)&&!VD.test(e),ZD=()=>!1,QD=e=>HD.test(e),$D=e=>UD.test(e),eO=e=>!X(e)&&!Z(e),tO=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)),nO=e=>_O(e,xO,ZD),X=e=>ID.test(e),rO=e=>_O(e,SO,XD),iO=e=>_O(e,CO,GD),aO=e=>_O(e,TO,YD),oO=e=>_O(e,wO,ZD),sO=e=>_O(e,yO,ZD),cO=e=>_O(e,bO,$D),lO=e=>_O(e,EO,QD),Z=e=>LD.test(e),uO=e=>vO(e,SO),dO=e=>vO(e,wO),fO=e=>vO(e,yO),pO=e=>vO(e,xO),mO=e=>vO(e,bO),hO=e=>vO(e,EO,!0),gO=e=>vO(e,TO,!0),_O=(e,t,n)=>{let r=ID.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},vO=(e,t,n=!1)=>{let r=LD.exec(e);return r?r[1]?t(r[1]):n:!1},yO=e=>e===`position`||e===`percentage`,bO=e=>e===`image`||e===`url`,xO=e=>e===`length`||e===`size`||e===`bg-size`,SO=e=>e===`length`,CO=e=>e===`number`,wO=e=>e===`family-name`,TO=e=>e===`number`||e===`weight`,EO=e=>e===`shadow`,DO=ND(()=>{let e=FD(`color`),t=FD(`font`),n=FD(`text`),r=FD(`font-weight`),a=FD(`tracking`),o=FD(`leading`),s=FD(`breakpoint`),c=FD(`container`),l=FD(`spacing`),u=FD(`radius`),d=FD(`shadow`),f=FD(`inset-shadow`),p=FD(`text-shadow`),m=FD(`drop-shadow`),h=FD(`blur`),g=FD(`perspective`),_=FD(`aspect`),v=FD(`ease`),y=FD(`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=()=>[WD,`full`,`auto`,...w()],T=()=>[KD,`none`,`subgrid`,Z,X],E=()=>[`auto`,{span:[`full`,KD,Z,X]},KD,Z,X],ne=()=>[KD,`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=()=>[WD,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],D=()=>[WD,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],ce=()=>[WD,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],O=()=>[e,Z,X],k=()=>[...ee(),fO,sO,{position:[Z,X]}],le=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ue=()=>[`auto`,`cover`,`contain`,pO,nO,{size:[Z,X]}],de=()=>[qD,uO,rO],fe=()=>[``,`none`,`full`,u,Z,X],pe=()=>[``,GD,uO,rO],me=()=>[`solid`,`dashed`,`dotted`,`double`],he=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],ge=()=>[GD,qD,fO,sO],_e=()=>[``,`none`,h,Z,X],ve=()=>[`none`,GD,Z,X],ye=()=>[`none`,GD,Z,X],be=()=>[GD,Z,X],xe=()=>[WD,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[JD],breakpoint:[JD],color:[YD],container:[JD],"drop-shadow":[JD],ease:[`in`,`out`,`in-out`],font:[eO],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[JD],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[JD],shadow:[JD],spacing:[`px`,GD],text:[JD],"text-shadow":[JD],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,WD,X,Z,_]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,Z,X]}],"container-named":[tO],columns:[{columns:[GD,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:[KD,`auto`,Z,X]}],basis:[{basis:[WD,`full`,`auto`,c,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[GD,WD,`auto`,`initial`,`none`,X]}],grow:[{grow:[``,GD,Z,X]}],shrink:[{shrink:[``,GD,Z,X]}],order:[{order:[KD,`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,uO,rO]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,gO,aO]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,qD,X]}],"font-family":[{font:[dO,oO,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":[GD,`none`,Z,iO]}],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:[...me(),`wavy`]}],"text-decoration-thickness":[{decoration:[GD,`from-font`,`auto`,Z,rO]}],"text-decoration-color":[{decoration:O()}],"underline-offset":[{"underline-offset":[GD,`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:[KD,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`]},KD,Z,X],radial:[``,Z,X],conic:[KD,Z,X]},mO,cO]}],"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:fe()}],"rounded-s":[{"rounded-s":fe()}],"rounded-e":[{"rounded-e":fe()}],"rounded-t":[{"rounded-t":fe()}],"rounded-r":[{"rounded-r":fe()}],"rounded-b":[{"rounded-b":fe()}],"rounded-l":[{"rounded-l":fe()}],"rounded-ss":[{"rounded-ss":fe()}],"rounded-se":[{"rounded-se":fe()}],"rounded-ee":[{"rounded-ee":fe()}],"rounded-es":[{"rounded-es":fe()}],"rounded-tl":[{"rounded-tl":fe()}],"rounded-tr":[{"rounded-tr":fe()}],"rounded-br":[{"rounded-br":fe()}],"rounded-bl":[{"rounded-bl":fe()}],"border-w":[{border:pe()}],"border-w-x":[{"border-x":pe()}],"border-w-y":[{"border-y":pe()}],"border-w-s":[{"border-s":pe()}],"border-w-e":[{"border-e":pe()}],"border-w-bs":[{"border-bs":pe()}],"border-w-be":[{"border-be":pe()}],"border-w-t":[{"border-t":pe()}],"border-w-r":[{"border-r":pe()}],"border-w-b":[{"border-b":pe()}],"border-w-l":[{"border-l":pe()}],"divide-x":[{"divide-x":pe()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":pe()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...me(),`hidden`,`none`]}],"divide-style":[{divide:[...me(),`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:[...me(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[GD,Z,X]}],"outline-w":[{outline:[``,GD,uO,rO]}],"outline-color":[{outline:O()}],shadow:[{shadow:[``,`none`,d,hO,lO]}],"shadow-color":[{shadow:O()}],"inset-shadow":[{"inset-shadow":[`none`,f,hO,lO]}],"inset-shadow-color":[{"inset-shadow":O()}],"ring-w":[{ring:pe()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:O()}],"ring-offset-w":[{"ring-offset":[GD,rO]}],"ring-offset-color":[{"ring-offset":O()}],"inset-ring-w":[{"inset-ring":pe()}],"inset-ring-color":[{"inset-ring":O()}],"text-shadow":[{"text-shadow":[`none`,p,hO,lO]}],"text-shadow-color":[{"text-shadow":O()}],opacity:[{opacity:[GD,Z,X]}],"mix-blend":[{"mix-blend":[...he(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":he()}],"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":[GD]}],"mask-image-linear-from-pos":[{"mask-linear-from":ge()}],"mask-image-linear-to-pos":[{"mask-linear-to":ge()}],"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":ge()}],"mask-image-t-to-pos":[{"mask-t-to":ge()}],"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":ge()}],"mask-image-r-to-pos":[{"mask-r-to":ge()}],"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":ge()}],"mask-image-b-to-pos":[{"mask-b-to":ge()}],"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":ge()}],"mask-image-l-to-pos":[{"mask-l-to":ge()}],"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":ge()}],"mask-image-x-to-pos":[{"mask-x-to":ge()}],"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":ge()}],"mask-image-y-to-pos":[{"mask-y-to":ge()}],"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":ge()}],"mask-image-radial-to-pos":[{"mask-radial-to":ge()}],"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":[GD]}],"mask-image-conic-from-pos":[{"mask-conic-from":ge()}],"mask-image-conic-to-pos":[{"mask-conic-to":ge()}],"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:_e()}],brightness:[{brightness:[GD,Z,X]}],contrast:[{contrast:[GD,Z,X]}],"drop-shadow":[{"drop-shadow":[``,`none`,m,hO,lO]}],"drop-shadow-color":[{"drop-shadow":O()}],grayscale:[{grayscale:[``,GD,Z,X]}],"hue-rotate":[{"hue-rotate":[GD,Z,X]}],invert:[{invert:[``,GD,Z,X]}],saturate:[{saturate:[GD,Z,X]}],sepia:[{sepia:[``,GD,Z,X]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,Z,X]}],"backdrop-blur":[{"backdrop-blur":_e()}],"backdrop-brightness":[{"backdrop-brightness":[GD,Z,X]}],"backdrop-contrast":[{"backdrop-contrast":[GD,Z,X]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,GD,Z,X]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[GD,Z,X]}],"backdrop-invert":[{"backdrop-invert":[``,GD,Z,X]}],"backdrop-opacity":[{"backdrop-opacity":[GD,Z,X]}],"backdrop-saturate":[{"backdrop-saturate":[GD,Z,X]}],"backdrop-sepia":[{"backdrop-sepia":[``,GD,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:[GD,`initial`,Z,X]}],ease:[{ease:[`linear`,`initial`,v,Z,X]}],delay:[{delay:[GD,Z,X]}],animate:[{animate:[`none`,y,Z,X]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[g,Z,X]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ve()}],"rotate-x":[{"rotate-x":ve()}],"rotate-y":[{"rotate-y":ve()}],"rotate-z":[{"rotate-z":ve()}],scale:[{scale:ye()}],"scale-x":[{"scale-x":ye()}],"scale-y":[{"scale-y":ye()}],"scale-z":[{"scale-z":ye()}],"scale-3d":[`scale-3d`],skew:[{skew:be()}],"skew-x":[{"skew-x":be()}],"skew-y":[{"skew-y":be()}],transform:[{transform:[Z,X,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:xe()}],"translate-x":[{"translate-x":xe()}],"translate-y":[{"translate-y":xe()}],"translate-z":[{"translate-z":xe()}],"translate-none":[`translate-none`],zoom:[{zoom:[KD,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:[GD,uO,rO,iO]}],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 OO(...e){return DO(tD(e))}var kO=1e3;24*(60*kO*60),30*kO;function AO(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 jO(e){let t=AO(e);return t===null?(e instanceof Error?e.message:String(e)).includes(`provider not available`):t===`no-provider`||t===`node-offline`}var MO=`text-[10px] text-foreground-subtle`;function NO(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 PO=`FEDERATION_DEBUG`,FO={AT:`@`,HYPHEN:`-`,SLASH:`/`},IO={[FO.AT]:`scope_`,[FO.HYPHEN]:`_`,[FO.SLASH]:`__`};IO[FO.AT],FO.AT,IO[FO.HYPHEN],FO.HYPHEN,IO[FO.SLASH],FO.SLASH;var LO=function(e){return e[e.UNKNOWN=1]=`UNKNOWN`,e[e.CALCULATED=2]=`CALCULATED`,e[e.NO_USE=0]=`NO_USE`,e}({}),RO=typeof ENV_TARGET<`u`?ENV_TARGET===`web`:typeof window<`u`&&window.document!==void 0;function zO(){return RO}function BO(){return typeof navigator<`u`&&navigator?.product===`ReactNative`}function VO(){try{if(zO()&&window.localStorage)return!!localStorage.getItem(PO)}catch{return!1}return!1}function HO(){return typeof process<`u`&&{}.FEDERATION_DEBUG?!!{}.FEDERATION_DEBUG:typeof FEDERATION_DEBUG<`u`&&FEDERATION_DEBUG?!0:VO()}var UO=`[ Federation Runtime ]`,WO=function(...e){return e.length?e.reduce((e,t)=>t?e?`${e}:${t}`:t:e,``):``},GO=(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!zO()&&!BO()&&`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),``},KO=e=>{console.warn(`${UO}: ${e}`)};function qO(e){try{return JSON.stringify(e,null,2)}catch{return``}}var JO=(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 YO(e){return e.replace(/#.*$/,``).replace(/\?.*$/,``).replace(/\/[^\/]+$/,`/`)}function XO(e,t={}){let{remotes:n={},overrides:r={},version:a}=t,o,s=()=>`publicPath`in e.metaData?(e.metaData.publicPath===`auto`||e.metaData.publicPath===``)&&a?YO(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:JO(u,d),remoteEntryType:f,remoteTypes:JO(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=JO(g.path,g.name);o.ssrRemoteEntry=e,o.ssrRemoteEntryType=g.type||`commonjs-module`}return o}function ZO(e){return!!(`remoteEntry`in e&&e.remoteEntry.includes(`.json`))}var QO=`[ Module Federation ]`,$O=console,ek=[`logger.ts`,`logger.js`,`captureStackTrace`,`Logger.emit`,`Logger.log`,`Logger.info`,`Logger.warn`,`Logger.error`,`Logger.debug`];function tk(){try{let e=Error().stack;if(!e)return;let[,...t]=e.split(`
74
+ `),n=t.filter(e=>!ek.some(t=>e.includes(t)));return n.length?`Stack trace:\n${n.slice(0,5).join(`
75
+ `)}`:void 0}catch{return}}var nk=class{constructor(e,t=$O){this.prefix=e,this.delegate=t??$O}setPrefix(e){this.prefix=e}setDelegate(e){this.delegate=e??$O}emit(e,t){let n=this.delegate,r=HO()?tk():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=$O[e];if(typeof t==`function`){t.call($O,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){HO()&&this.emit(`debug`,e)}};function rk(e){return new nk(e)}function ik(e){let t=new nk(e);return Object.defineProperty(t,"__mf_infrastructure_logger__",{value:!0,enumerable:!1,configurable:!1}),t}rk(QO),ik(QO);async function ak(e,t){try{return await e()}catch(e){!t&&KO(e);return}}function ok(e,t){let n=/^(https?:)?\/\//i;return e.replace(n,``).replace(/\/$/,``)===t.replace(n,``).replace(/\/$/,``)}function sk(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&&ok(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&&ok(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,ak(()=>{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 ck(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&&ok(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,ak(()=>{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 lk(e,t){let{attrs:n={},createScriptHook:r}=t;return new Promise((t,a)=>{let{script:o,needAttach:s}=sk({url:e,cb:t,onErrorCallback:a,attrs:{fetchpriority:`high`,...n},createScriptHook:r,needDeleteScript:!0});s&&document.head.appendChild(o)})}var uk=new Map;function dk(e){if(!e)throw Error(`import specifier is required`);if(uk.has(e))return uk.get(e);let t=Function(`name`,`return import(name)`)(e).then(e=>e).catch(t=>{throw console.error(`Error importing module ${e}:`,t),uk.delete(e),t});return uk.set(e,t),t}var fk=async()=>{let e=await dk(`node-fetch`);return e.default||e},pk=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 fk():fetch)(e,t||{}):r},mk=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)=>pk(e,t,r):typeof fetch>`u`?fk():fetch,s=async(e,r)=>{try{let a=await(await e(r.href)).text(),[o,s]=await Promise.all([dk(`path`),dk(`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??dk}),f;f=(await dk(`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 _k(a.href,{fetch:e,vm:await dk(`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`))},hk=typeof ENV_TARGET>`u`||ENV_TARGET!==`web`?(e,t)=>new Promise((n,r)=>{mk(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`)},gk=new Map;async function _k(e,t){if(gk.has(e))return gk.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 _k(a,t)}});return gk.set(e,o),await o.link(async n=>{let r=new URL(n,e).href;return await _k(r,t)}),o}var vk=e=>`View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${e.split(`-`)[0].toLowerCase()}#${e.toLowerCase()}`,yk=(e,t,n,r)=>{let a=[`${[t[e]]} #${e}`];return n&&a.push(`args: ${JSON.stringify(n)}`),a.push(vk(e)),r&&a.push(`Original Error Message:\n ${r}`),a.join(`
76
+ `)};function bk(e,t,n,r,a,o){return r(yk(e,t,n,a))}var xk=`[ Federation Runtime ]`,Sk=rk(xk);function Ck(e,t,n,r,a){e||(n===void 0?wk(t):wk(t,n,r,void 0,a))}function wk(e,t,n,r,a){if(t!==void 0)return bk(e,t,n??{},e=>{throw Error(`${xk}: ${e}`)},r,a);let o=e;throw o instanceof Error?(o.message.startsWith(xk)||(o.message=`${xk}: ${o.message}`),o):Error(`${xk}: ${o}`)}function Tk(e){e instanceof Error&&(e.message.startsWith(xk)||(e.message=`${xk}: ${e.message}`)),Sk.warn(e)}function Ek(e,t){return e.findIndex(e=>e===t)===-1&&e.push(t),e}function Dk(e){return`version`in e&&e.version?`${e.name}:${e.version}`:`entry`in e&&e.entry?`${e.name}:${e.entry}`:`${e.name}`}function Ok(e){return e.entry!==void 0}function kk(e){return!e.entry.includes(`.json`)}function Ak(e){return e&&typeof e==`object`}var jk=Object.prototype.toString;function Mk(e){return jk.call(e)===`[object Object]`}function Nk(e){return Array.isArray(e)?e:[e]}function Pk(e){let t={url:``,type:`global`,globalName:``};return RO||BO()||!(`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 Fk=(e,t)=>{let n;return n=e.endsWith(`/`)?e.slice(0,-1):e,t.startsWith(`.`)&&(t=t.slice(1)),n+=t,n},Ik=typeof globalThis==`object`?globalThis:window,Lk=(()=>{try{return document.defaultView}catch{return Ik}})(),Rk=Lk;function zk(e,t,n){Object.defineProperty(e,t,{value:n,configurable:!1,writable:!0})}function Bk(e,t){return Object.hasOwnProperty.call(e,t)}Bk(Ik,`__GLOBAL_LOADING_REMOTE_ENTRY__`)||zk(Ik,`__GLOBAL_LOADING_REMOTE_ENTRY__`,{});var Vk=Ik.__GLOBAL_LOADING_REMOTE_ENTRY__;function Hk(e){Bk(e,`__VMOK__`)&&!Bk(e,`__FEDERATION__`)&&zk(e,`__FEDERATION__`,e.__VMOK__),Bk(e,`__FEDERATION__`)||(zk(e,`__FEDERATION__`,{__GLOBAL_PLUGIN__:[],__INSTANCES__:[],moduleInfo:{},__SHARE__:{},__MANIFEST_LOADING__:{},__PRELOADED_MAP__:new Map}),zk(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}Hk(Ik),Hk(Lk);function Uk(e,t=HO()){t&&(Ik.__FEDERATION__.__DEBUG_CONSTRUCTOR__=e,Ik.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__=`2.5.1`)}function Wk(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 wk(`getInfoWithoutType: "key" must be a string, got ${typeof t} (${JSON.stringify(t)}).`)}var Gk=()=>Lk.__FEDERATION__.moduleInfo,Kk=(e,t)=>{let n=Wk(t,Dk(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=Dk(n),a=Wk(Lk.__FEDERATION__.moduleInfo,r).value;if(a?.version===t)return a}},qk=e=>Kk(e,Lk.__FEDERATION__.moduleInfo),Jk=(e,t)=>{let n=Dk(e);return Lk.__FEDERATION__.moduleInfo[n]=t,Lk.__FEDERATION__.moduleInfo},Yk=e=>(Lk.__FEDERATION__.moduleInfo={...Lk.__FEDERATION__.moduleInfo,...e},()=>{let t=Object.keys(e);for(let e of t)delete Lk.__FEDERATION__.moduleInfo[e]}),Xk=(e,t)=>{let n=t||`__FEDERATION_${e}:custom__`;return{remoteEntryKey:n,entryExports:Ik[n]}},Zk=()=>Lk.__FEDERATION__.__GLOBAL_PLUGIN__,Qk=e=>Ik.__FEDERATION__.__PRELOADED_MAP__.get(e),$k=e=>Ik.__FEDERATION__.__PRELOADED_MAP__.set(e,!0),eA=`[0-9A-Za-z-]+`,tA=`(?:\\+(${eA}(?:\\.${eA})*))`,nA=`0|[1-9]\\d*`,rA=`[0-9]+`,iA=`\\d*[a-zA-Z-][a-zA-Z0-9-]*`,aA=`(?:${rA}|${iA})`,oA=`(?:-?(${aA}(?:\\.${aA})*))`,sA=`(?:${nA}|${iA})`,cA=`(?:-(${sA}(?:\\.${sA})*))`,lA=`${nA}|x|X|\\*`,uA=`[v=\\s]*(${lA})(?:\\.(${lA})(?:\\.(${lA})(?:${cA})?${tA}?)?)?`,dA=`^\\s*(${uA})\\s+-\\s+(${uA})\\s*$`,fA=`[v=\\s]*${`(${rA})\\.(${rA})\\.(${rA})`}${oA}?${tA}?`,pA=`((?:<|>)?=?)`,mA=`(\\s*)${pA}\\s*(${fA}|${uA})`,hA=`(?:~>?)`,gA=`(\\s*)${hA}\\s+`,_A=`(?:\\^)`,vA=`(\\s*)${_A}\\s+`,yA=`(<|>)?=?\\s*\\*`,bA=`^${_A}${uA}$`,xA=`v?${`(${nA})\\.(${nA})\\.(${nA})`}${cA}?${tA}?`,SA=`^${hA}${uA}$`,CA=`^${pA}\\s*${uA}$`,wA=`^${pA}\\s*(${xA})$|^$`,TA=`^\\s*>=\\s*0.0.0\\s*$`;function EA(e){return new RegExp(e)}function DA(e){return!e||e.toLowerCase()===`x`||e===`*`}function OA(...e){return t=>e.reduce((e,t)=>t(e),t)}function kA(e){return e.match(EA(wA))}function AA(e,t,n,r){let a=`${e}.${t}.${n}`;return r?`${a}-${r}`:a}function jA(e){return e.replace(EA(dA),(e,t,n,r,a,o,s,c,l,u,d,f)=>(t=DA(n)?``:DA(r)?`>=${n}.0.0`:DA(a)?`>=${n}.${r}.0`:`>=${t}`,c=DA(l)?``:DA(u)?`<${Number(l)+1}.0.0-0`:DA(d)?`<${l}.${Number(u)+1}.0-0`:f?`<=${l}.${u}.${d}-${f}`:`<=${c}`,`${t} ${c}`.trim()))}function MA(e){return e.replace(EA(mA),`$1$2$3`)}function NA(e){return e.replace(EA(gA),`$1~`)}function PA(e){return e.replace(EA(vA),`$1^`)}function FA(e){return e.trim().split(/\s+/).map(e=>e.replace(EA(bA),(e,t,n,r,a)=>DA(t)?``:DA(n)?`>=${t}.0.0 <${Number(t)+1}.0.0-0`:DA(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 IA(e){return e.trim().split(/\s+/).map(e=>e.replace(EA(SA),(e,t,n,r,a)=>DA(t)?``:DA(n)?`>=${t}.0.0 <${Number(t)+1}.0.0-0`:DA(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 LA(e){return e.split(/\s+/).map(e=>e.trim().replace(EA(CA),(e,t,n,r,a,o)=>{let s=DA(n),c=s||DA(r),l=c||DA(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 RA(e){return e.trim().replace(EA(yA),``)}function zA(e){return e.trim().replace(EA(TA),``)}function BA(e,t){return e=Number(e)||e,t=Number(t)||t,e>t?1:e===t?0:-1}function VA(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?BA(t,a):-1:1}return 0}function HA(e,t){return BA(e.major,t.major)||BA(e.minor,t.minor)||BA(e.patch,t.patch)||VA(e,t)}function UA(e,t){return e.version===t.version}function WA(e,t){switch(e.operator){case``:case`=`:return UA(e,t);case`>`:return HA(e,t)<0;case`>=`:return UA(e,t)||HA(e,t)<0;case`<`:return HA(e,t)>0;case`<=`:return UA(e,t)||HA(e,t)>0;case void 0:return!0;default:return!1}}function GA(e){return OA(FA,IA,LA,RA)(e)}function KA(e){return OA(jA,MA,NA,PA)(e.trim()).split(/\s+/).join(` `)}function qA(e,t){if(!e)return!1;let n=kA(e);if(!n)return!1;let[,r,,a,o,s,c]=n,l={operator:r,version:AA(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=KA(t);if(!e.trim())return!0;let n=e.split(` `).map(e=>GA(e)).join(` `);if(!n.trim())return!0;let r=n.split(/\s+/).map(e=>zA(e)).filter(Boolean);if(r.length===0)continue;let a=!0;for(let e of r){let t=kA(e);if(!t){a=!1;break}let[,n,,r,o,s,c]=t;if(!WA({operator:n,version:AA(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 JA=`default`,YA=`global`;function XA(e,t,n,r){let a;return a=`get`in e?e.get:`lib`in e?()=>Promise.resolve(e.lib):()=>Promise.resolve(()=>{wk(`Cannot get shared "${n}" from "${t}": neither "get" nor "lib" is provided in the share config.`)}),e.shareConfig?.eager&&e.treeShaking?.mode&&wk(`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??LO.UNKNOWN,useIn:[]}:void 0}}function ZA(e,t){let n=t.shared||{},r=t.name,a=Object.keys(n).reduce((e,a)=>{let o=Nk(n[a]);return e[a]=e[a]||[],o.forEach(n=>{e[a].push(XA(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 QA(e,t){if(!e)return!1;let{status:n,mode:r}=e;return n===LO.NO_USE?!1:n===LO.CALCULATED?!0:r===`runtime-infer`?t?rj(e,t):!0:!1}function $A(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!!qA(n(e),`<=${n(t)}`)}var ej=(e,t)=>{let n=t||function(e,t){return $A(e,t)};return Object.keys(e).reduce((e,t)=>!e||n(e,t)||e===`0`?t:e,0)},tj=e=>!!e.loaded||typeof e.lib==`function`,nj=e=>!!e.loading,rj=(e,t)=>{if(!e||!t)return!1;let{usedExports:n}=e;return n?!!t.every(e=>n.includes(e)):!1};function ij(e,t,n,r){let a=e[t][n],o=``,s=QA(r),c=function(e,t){return s?a[e].treeShaking?a[t].treeShaking?!tj(a[e].treeShaking)&&$A(e,t):!1:!0:!tj(a[e])&&$A(e,t)};if(s){if(o=ej(e[t][n],c),o)return{version:o,useTreesShaking:s};s=!1}return{version:ej(e[t][n],c),useTreesShaking:s}}var aj=e=>tj(e)||nj(e);function oj(e,t,n,r){let a=e[t][n],o=``,s=QA(r),c=function(e,t){if(s){if(!a[e].treeShaking)return!0;if(!a[t].treeShaking)return!1;if(aj(a[t].treeShaking))return aj(a[e].treeShaking)?!!$A(e,t):!0;if(aj(a[e].treeShaking))return!1}return aj(a[t])?aj(a[e])?!!$A(e,t):!0:aj(a[e])?!1:$A(e,t)};if(s){if(o=ej(e[t][n],c),o)return{version:o,useTreesShaking:s};s=!1}return{version:ej(e[t][n],c),useTreesShaking:s}}function sj(e){return e===`loaded-first`?oj:ij}function cj(e,t,n,r){if(!e)return;let{shareConfig:a,scope:o=JA,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}=sj(s)(e,o,t,c),f={shareScopeMap:e,scope:o,pkgName:t,version:u,GlobalFederation:Rk.__FEDERATION__,shareInfo:n,resolver:()=>{let r=e[o][t][u];if(a.singleton){if(typeof l==`string`&&!qA(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?wk(e):Tk(e)}return{shared:r,useTreesShaking:d}}else{if(l===!1||l===`*`||qA(u,l))return{shared:r,useTreesShaking:d};let n=QA(c);if(n){for(let[r,a]of Object.entries(e[o][t]))if(QA(a.treeShaking,c?.usedExports)&&qA(r,l))return{shared:a,useTreesShaking:n}}for(let[n,r]of Object.entries(e[o][t]))if(qA(n,l))return{shared:r,useTreesShaking:!1}}}};return(r.emit(f)||f).resolver()}}function lj(){return Rk.__FEDERATION__.__SHARE__}function uj(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[ej(t,function(e,n){return!tj(t[e])&&$A(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 dj=(e,t)=>{e.useIn||=[],Ek(e.useIn,t)};function fj(e,t){return t&&e.treeShaking?e.treeShaking:e}function pj(e,t){return!t||t===`.`?e:`${e}/${t.replace(/^\.\//,``)}`}function mj(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 hj(e,t){for(let n of e)if(t===n.name||n.alias&&t===n.alias)return n}var gj=`RUNTIME-001`,_j=`RUNTIME-002`,vj=`RUNTIME-003`,yj=`RUNTIME-004`,bj=`RUNTIME-005`,xj=`RUNTIME-006`,Sj=`RUNTIME-007`,Cj=`RUNTIME-008`,wj=`RUNTIME-009`,Tj=`RUNTIME-010`,Ej=`RUNTIME-011`,Dj=`RUNTIME-012`,Oj=`RUNTIME-013`,kj=`RUNTIME-014`,Aj=`RUNTIME-015`,jj=`TYPE-001`,Mj=`BUILD-001`,Nj=`BUILD-002`,Pj={[gj]:`Failed to get remoteEntry exports.`,[_j]:`The remote entry interface does not contain "init"`,[vj]:`Failed to get manifest.`,[yj]:`Failed to locate remote.`,[bj]:`Invalid loadShareSync function call from bundler runtime`,[xj]:`Invalid loadShareSync function call from runtime`,[Sj]:`Failed to get remote snapshot.`,[Cj]:`Failed to load script resources.`,[wj]:`Please call createInstance first.`,[Tj]:`The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use "createInstance" api.`,[Ej]:`The remoteEntry URL is missing from the remote snapshot.`,[Dj]:`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.`,[Oj]:`The manifest is not a valid Module Federation manifest.`,[kj]:`The remote does not expose the requested module.`,[Aj]:`Remote container initialization failed.`},Fj={[jj]:`Failed to generate type declaration. Execute the below cmd to reproduce and fix the error.`},Ij={[Mj]:`Failed to find expose module.`,[Nj]:`PublicPath is required in prod mode.`};({...Pj,...Fj,...Ij});var Lj=`.then(callbacks[0]).catch(callbacks[1])`;async function Rj({entry:e,remoteEntryExports:t}){return new Promise((n,r)=>{try{t?n(t):typeof FEDERATION_ALLOW_NEW_FUNCTION<`u`?Function(`callbacks`,`import("${e}")${Lj}`)([n,r]):$E(()=>import(e).then(n),[],import.meta.url).catch(r)}catch(t){wk(`Failed to load ESM entry from "${e}". ${t instanceof Error?t.message:String(t)}`)}})}async function zj({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}")${Lj}`)([n,r])}catch(t){wk(`Failed to load SystemJS entry from "${e}". ${t instanceof Error?t.message:String(t)}`)}})}function Bj(e,t,n){let{remoteEntryKey:r,entryExports:a}=Xk(e,t);return a||wk(gj,Pj,{remoteName:e,remoteEntryUrl:n,remoteEntryKey:r}),a}async function Vj({name:e,globalName:t,entry:n,remoteInfo:r,loaderHook:a,getEntryUrl:o,resourceContext:s}){let{entryExports:c}=Xk(e,t);if(c)return c;let l=o?o(n):n;return lk(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(()=>Bj(e,t,n),t=>{let n=t instanceof Error?t.message:String(t);wk(Cj,Pj,{remoteName:e,resourceUrl:l},n)})}async function Hj({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 Rj({entry:o,remoteEntryExports:t});case`system`:return zj({entry:o,remoteEntryExports:t});default:return Vj({entry:o,globalName:s,name:c,remoteInfo:e,loaderHook:n,getEntryUrl:r,resourceContext:a})}}async function Uj({remoteInfo:e,loaderHook:t,resourceContext:n}){let{entry:r,entryGlobalName:a,name:o,type:s}=e,{entryExports:c}=Xk(o,a);return c||hk(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(()=>Bj(o,a,r)).catch(e=>{wk(`Failed to load Node.js entry for remote "${o}" from "${r}". ${e instanceof Error?e.message:String(e)}`)})}function Wj(e){let{entry:t,name:n}=e;return WO(n,t)}async function Gj(e){let{origin:t,remoteEntryExports:n,remoteInfo:r,getEntryUrl:a,resourceContext:o,_inErrorHandling:s=!1}=e,c=Wj(r);if(n)return n;if(!Vk[c]){let e=t.remoteHandler.hooks.lifecycle.loadEntry,l=t.loaderHook;Vk[c]=e.emit({origin:t,loaderHook:l,remoteInfo:r,remoteEntryExports:n}).then(e=>e||((typeof ENV_TARGET<`u`?ENV_TARGET===`web`:RO)?Hj({remoteInfo:r,remoteEntryExports:n,loaderHook:l,getEntryUrl:a,resourceContext:o}):Uj({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=Wj(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=>Gj({...e,_inErrorHandling:!0}),origin:t,remoteInfo:r,remoteEntryExports:n,globalLoading:Vk,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 Vk[c]}function Kj(e){return{...e,entry:`entry`in e?e.entry:``,type:e.type||`global`,entryGlobalName:e.entryGlobalName||e.name,shareScope:e.shareScope||`default`}}function qj(){return typeof FEDERATION_BUILD_IDENTIFIER<`u`?FEDERATION_BUILD_IDENTIFIER:``}function Jj(e,t){let n=Zk(),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 Yj(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 Xj(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(Yj)??[],shared:t}}}function Zj(e){return{resourceCategory:`sync`,share:!0,depsRemote:!0,...e}}function Qj(e,t){return t.map(t=>{let n=hj(e,t.nameOrAlias);return Ck(n,`Unable to preload ${t.nameOrAlias} as it is not included in ${!n&&qO({remoteInfo:n,remotes:e})}`),{remote:n,preloadConfig:Zj(t)}})}function $j(e){return e?e.map(e=>e===`.`?e:e.startsWith(`./`)?e.replace(`./`,``):e):[]}function eM(e){return e instanceof Error?e.message.includes(`timed out`)||e.name.includes(`Timeout`):!1}function tM(e,t,n,r){return{url:t,status:n,resourceType:e.resourceType,initiator:e.initiator,id:e.id,error:r}}async function nM(e,t,n,r){let a=e.moduleCache.get(n.name),o=n.entry;if(a?.remoteEntryExports)return tM(r,o,`cached`);try{if(!await Gj({origin:e,remoteInfo:n,remoteEntryExports:a?.remoteEntryExports,resourceContext:{...r,url:o}}))throw Error(`Failed to load remoteEntry "${o}".`);return tM(r,o,`success`)}catch(e){return tM(r,o,eM(e)?`timeout`:`error`,e)}}function rM({host:e,remoteInfo:t,url:n,attrs:r,context:a,needDeleteLink:o}){return new Promise(s=>{let{link:c,needAttach:l}=ck({url:n,cb:()=>{s(tM(a,n,l?`success`:`cached`))},onErrorCallback:e=>{s(tM(a,n,eM(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 iM({host:e,remoteInfo:t,url:n,attrs:r,context:a}){return new Promise(o=>{let{script:s,needAttach:c}=sk({url:n,cb:()=>{o(tM(a,n,c?`success`:`cached`))},onErrorCallback:e=>{o(tM(a,n,eM(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 aM(e,t){return{...e,resourceType:t}}function oM(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(nM(t,e,r,aM(a,`remoteEntry`)))}),r){let n={rel:`preload`,as:`style`};o.forEach(r=>{l.push(rM({host:t,remoteInfo:e,url:r,attrs:n,context:aM(a,`css`)}))})}else{let n={rel:`stylesheet`,type:`text/css`};o.forEach(r=>{l.push(rM({host:t,remoteInfo:e,url:r,attrs:n,needDeleteLink:!1,context:aM(a,`css`)}))})}if(r){let n={rel:`preload`,as:`script`};s.forEach(r=>{l.push(rM({host:t,remoteInfo:e,url:r,attrs:n,context:aM(a,`js`)}))})}else{let n={fetchpriority:`high`,type:e?.type===`module`?`module`:`text/javascript`};s.forEach(r=>{l.push(iM({host:t,remoteInfo:e,url:r,attrs:n,context:aM(a,`js`)}))})}}return Promise.all(l)}function sM(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 cM(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 lM=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 Gj({origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports,resourceContext:{initiator:`loadRemote`,id:pj(this.remoteInfo.name,e),resourceType:`remoteEntry`}});return Ck(t,`remoteEntryExports is undefined \n ${qO(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}=cM(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&&wk(_j,Pj,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName},void 0,Xj(this.host.options));try{await a.init(c.shareScope,c.initScope,c.remoteEntryInitOptions)}catch(e){wk(Aj,Pj,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName,shareScope:this.remoteInfo.shareScope},`${e}`,Xj(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||wk(kj,Pj,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,expose:t,requestId:e,availableExposes:sM(r)},void 0,Xj(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=Fk(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)}}},uM=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()}},dM=class extends uM{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 fM(e,t){if(!Ak(t))return!1;if(e!==t){for(let n in e)if(!(n in t))return!1}return!0}var pM=class extends uM{constructor(e){super(),this.onerror=wk,this.type=e}emit(e){Ak(e)||wk(`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(fM(e,n))e=n;else{this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);break}}catch(e){Tk(e),this.onerror(e)}return e}},mM=class extends uM{constructor(e){super(),this.onerror=wk,this.type=e}emit(e){Ak(e)||wk(`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=>(Tk(t),this.onerror(t),e),a=o=>{if(o!==void 0&&fM(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)}},hM=class{constructor(e){this.registerPlugins={},this.lifecycle=e,this.lifecycleKeys=Object.keys(e)}applyPlugin(e,t){Ck(Mk(e),`Plugin configuration is invalid.`);let n=e.name;Ck(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){Ck(e,`A name is required.`);let t=this.registerPlugins[e];Ck(t,`The plugin "${e}" is not registered.`),Object.keys(t).forEach(e=>{e!==`name`&&this.lifecycle[e].remove(t[e])})}};function gM(e,t){let n=Pk(t);n.url||wk(Ej,Pj,{remoteName:e.name});let r=GO(t,n.url);!RO&&!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 _M(){return{name:`snapshot-plugin`,async afterResolve(e){let{remote:t,pkgNameOrAlias:n,expose:r,origin:a,remoteInfo:o,id:s}=e;if(!Ok(t)||!kk(t)){let{remoteSnapshot:c,globalSnapshot:l}=await a.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:t,id:pj(t.name,r)});gM(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&&oM(o,a,d,!1,{initiator:`loadRemote`,id:s}).catch(()=>void 0),{...e,remoteSnapshot:c}}return e}}}function vM(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 yM(e,t,n,r,a={},o){let{value:s}=Wk(e,Dk(t)),c=o||s;if(c&&!ZO(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=vM(r),o=c.remotesInfo[r];yM(e,{name:t.name,version:o.matchedVersion},n,!1,a,void 0)}}}var bM=(e,t)=>document.querySelector(`${e}[${e===`link`?`href`:`src`}="${t}"]`);function xM(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(yM(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=Zj(e)}else if(p===!0)a=f;else return;let l=GO(t,Pk(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=$j(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=>GO(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}),!Qk(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))),$k(l))}}},!0,{},a),a.shared&&a.shared.length>0){let t=(t,n)=>{let{shared:r}=cj(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&&Nk(r).forEach(n=>{t(n,e)})})}let m=s.filter(e=>!l.has(e)&&!bM(`script`,e));return{cssAssets:o.filter(e=>!u.has(e)&&!bM(`link`,e)),jsAssetsWithoutEntry:m,entryAssets:c.filter(e=>!bM(`script`,e.url))}}var SM=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 RO?Ok(a)&&kk(a)?{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[{name:a.name,url:a.entry,moduleInfo:{name:r.name,entry:a.entry,type:r.type||`global`,entryGlobalName:``,shareScope:``}}]}:(gM(r,s),xM(t,n,r,o,s)):{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[]}}}};function CM(e,t){let n=qk({name:t.name,version:t.options.version}),r=n&&`remotesInfo`in n&&n.remotesInfo&&Wk(n.remotesInfo,e.name).value;return r&&r.matchedVersion?{hostGlobalSnapshot:n,globalSnapshot:Gk(),remoteSnapshot:qk({name:e.name,version:r.matchedVersion})}:{hostGlobalSnapshot:void 0,globalSnapshot:Gk(),remoteSnapshot:qk({name:e.name,version:`version`in e?e.version:void 0})}}var wM=class{constructor(e){this.loadingHostSnapshot=null,this.manifestCache=new Map,this.hooks=new hM({beforeLoadRemoteSnapshot:new dM(`beforeLoadRemoteSnapshot`),loadSnapshot:new mM(`loadGlobalSnapshot`),loadRemoteSnapshot:new mM(`loadRemoteSnapshot`),afterLoadSnapshot:new mM(`afterLoadSnapshot`)}),this.manifestLoading=Rk.__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=qk({name:this.HostInstance.options.name,version:this.HostInstance.options.version});a||(a={version:this.HostInstance.options.version||``,remoteEntry:``,remotesInfo:{}},Yk({[this.HostInstance.options.name]:a})),a&&`remotesInfo`in a&&!Wk(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(ZO(l)){let r=RO?l.remoteEntry:l.ssrRemoteEntry||l.remoteEntry||``,a=await this.loadManifestSnapshot(r,e,{},{initiator:n,id:t||e.name}),o=Jk({...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(Ok(e)){let r=await this.loadManifestSnapshot(e.entry,e,{},{initiator:n,id:t||e.name}),a=Jk(e,r);d=r,f=a}else wk(Sj,Pj,{remoteName:e.name,remoteVersion:e.version,hostName:this.HostInstance.options.name,globalSnapshot:JSON.stringify(u)},void 0,Xj(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 CM(e,this.HostInstance)}async getManifestJson(e,t,n,r){return(async()=>{let n=Kj(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],wk(vj,Pj,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name},`${r}`,Xj(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&&wk(Oj,Pj,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name,missingFields:o.join(`,`)},void 0,Xj(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=XO(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]}},TM=class{constructor(e){this.hooks=new hM({beforeRegisterShare:new pM(`beforeRegisterShare`),afterResolve:new mM(`afterResolve`),beforeLoadShare:new mM(`beforeLoadShare`),loadShare:new dM,afterLoadShare:new uM(`afterLoadShare`),errorLoadShare:new uM(`errorLoadShare`),resolveShare:new pM(`resolveShare`),initContainerShareScopeMap:new pM(`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){Tk(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){Tk(e)}}registerShared(e,t){let{newShareInfos:n,allShareInfos:r}=ZA(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=uj({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,Ck(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}=cj(this.shareScopeMap,e,a,this.hooks.lifecycle.resolveShare)||{};if(s){let t=fj(s,c);if(t.lib)return dj(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,dj(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 dj(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=QA(o.treeShaking),a=fj(o,r),s=(async()=>{let t=await a.get();a.lib=t,a.loaded=!0,dj(a,n.options.name);let{shared:r,useTreesShaking:s}=cj(this.shareScopeMap,e,o,this.hooks.lifecycle.resolveShare)||{};if(r){let e=fj(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=JA,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]&&fj(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=uj({pkgName:e,extraOptions:t,shareInfos:n.options.shared});try{r?.scope&&r.scope.forEach(e=>{this.initializeSharing(e,{strategy:r.strategy})});let{shared:a}=cj(this.shareScopeMap,e,r,this.hooks.lifecycle.resolveShare)||{};if(a){if(typeof a.lib==`function`)return dj(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 dj(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&&wk(t?.from===`build`?bj:xj,Pj,{hostName:n.options.name,sharedPkgName:e},void 0,Xj(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}wk(xj,Pj,{hostName:n.options.name,sharedPkgName:e},void 0,Xj(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=lj(),n=e.id||e.name;n&&!t[n]&&(t[n]=this.shareScopeMap)}},EM=class{constructor(e){this.hooks=new hM({beforeRegisterRemote:new pM(`beforeRegisterRemote`),registerRemote:new pM(`registerRemote`),beforeRequest:new mM(`beforeRequest`),afterMatchRemote:new dM(`afterMatchRemote`),onLoad:new dM(`onLoad`),afterLoadRemote:new dM(`afterLoadRemote`),handlePreloadModule:new uM(`handlePreloadModule`),errorLoadRemote:new dM(`errorLoadRemote`),beforePreloadRemote:new dM(`beforePreloadRemote`),generatePreloadAssets:new dM(`generatePreloadAssets`),afterPreloadRemote:new dM(`afterPreloadRemote`),loadEntry:new dM}),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=mj(n.options.remotes,e),a=e,o=r?.expose,s=r?Kj(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=Kj(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=Qj(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:pj(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=Kj(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 oM(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=mj(t.options.remotes,a);if(!o)try{wk(yj,Pj,{hostName:t.options.name,requestId:a},void 0,Xj(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=Kj(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;Ck(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 lM(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)));Ck(!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&&RO&&typeof window<`u`&&!e.entry.startsWith(`http`)&&(e.entry=new URL(e.entry,window.location.origin).href),e.shareScope||=JA,e.type||=YA};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}),KO(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;Ik[r]&&(Object.getOwnPropertyDescriptor(Ik,r)?.configurable?delete Ik[r]:Ik[r]=void 0);let o=Wj(a.remoteInfo);Vk[o]&&delete Vk[o],t.snapshotHandler.manifestCache.delete(n.entry);let s=n.buildVersion?WO(n.name,n.buildVersion):n.name,c=Ik.__FEDERATION__.__INSTANCES__.findIndex(e=>n.buildVersion?e.options.id===s:e.name===s);if(c!==-1){let e=Ik.__FEDERATION__.__INSTANCES__[c];s=e.options.id||s;let t=lj(),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]}),Ik.__FEDERATION__.__INSTANCES__.splice(c,1)}let{hostGlobalSnapshot:l}=CM(e,t);if(l){let t=l&&`remotesInfo`in l&&l.remotesInfo&&Wk(l.remotesInfo,e.name).key;t&&(delete l.remotesInfo[t],Rk.__FEDERATION__.__MANIFEST_LOADING__[t]&&delete Rk.__FEDERATION__.__MANIFEST_LOADING__[t])}t.moduleCache.delete(e.name)}}catch(e){Sk.error(`removeRemote failed: ${e instanceof Error?e.message:String(e)}`)}}},DM=typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN==`boolean`?!FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN:!0;Uk(class{constructor(e){this.hooks=new hM({beforeInit:new pM(`beforeInit`),init:new uM,beforeInitContainer:new mM(`beforeInitContainer`),initContainer:new mM(`initContainer`)}),this.version=`2.5.1`,this.moduleCache=new Map,this.loaderHook=new hM({getModuleInfo:new uM,createScript:new uM,createLink:new uM,fetch:new dM,loadEntryError:new dM,afterLoadEntry:new dM(`afterLoadEntry`),beforeInitRemote:new dM(`beforeInitRemote`),afterInitRemote:new dM(`afterInitRemote`),beforeGetExpose:new dM(`beforeGetExpose`),afterGetExpose:new dM(`afterGetExpose`),beforeExecuteFactory:new dM(`beforeExecuteFactory`),afterExecuteFactory:new dM(`afterExecuteFactory`),getModuleFactory:new dM}),this.bridgeHook=new hM({beforeBridgeRender:new uM,afterBridgeRender:new uM,beforeBridgeDestroy:new uM,afterBridgeDestroy:new uM});let t=DM?[_M(),SM()]:[],n={id:qj(),name:e.name,plugins:t,remotes:[],shared:{},inBrowser:RO};this.name=e.name,this.options=n,this.snapshotHandler=new wM(this),this.sharedHandler=new TM(this),this.remoteHandler=new EM(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&&wk(yk(Tj,Pj)),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=JA,t){return this.sharedHandler.initializeSharing(e,t)}initRawContainer(e,t,n){let r=Kj({name:e,entry:t}),a=new lM({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}=ZA(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=Jj(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 OM=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),kM=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),AM=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),jM=e=>{let t=AM(e);return t.charAt(0).toUpperCase()+t.slice(1)},MM={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`},NM=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},PM=(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,...MM,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:OM(`lucide`,a),...!o&&!NM(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)(PM,{ref:a,iconNode:t,className:OM(`lucide-${kM(jM(e))}`,`lucide-${e}`,n),...r}));return n.displayName=jM(e),n},FM=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 IM=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 LM=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`}]]),RM=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`}]]),zM=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`}]]),BM=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 VM=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 HM=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 UM=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 WM=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 GM=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 KM=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 qM=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 JM=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 YM=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 XM=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 ZM=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 QM=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 $M=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 eN=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 tN=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 nN=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 rN=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 iN=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 aN=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 oN=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 sN=Q(`thermometer`,[[`path`,{d:`M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z`,key:`17jzev`}]]),cN=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`}]]),lN=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`}]]),uN=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 dN=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 fN=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 pN=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 mN=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,hN=tD,gN=(e,t)=>n=>{if(t?.variants==null)return hN(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=mN(t)||mN(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 hN(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)},_N=gN(`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`}}),vN=(0,x.forwardRef)(({className:e,variant:t,size:n,...r},a)=>(0,S.jsx)(`button`,{ref:a,className:OO(_N({variant:t,size:n}),e),...r}));vN.displayName=`Button`;var yN=gN(`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`}}),bN=(0,x.forwardRef)(({className:e,variant:t,size:n,icon:r,...a},o)=>(0,S.jsx)(`button`,{ref:o,className:OO(yN({variant:t,size:n}),e),...a,children:(0,S.jsx)(r,{className:`h-4 w-4`})}));bN.displayName=`IconButton`;var xN=gN(`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`}}),SN=(0,x.forwardRef)(({className:e,variant:t,style:n,...r},a)=>(0,S.jsx)(`span`,{ref:a,className:OO(xN({variant:t,styleVariant:n}),e),...r}));SN.displayName=`Badge`;var CN=gN(`rounded-lg p-3`,{variants:{variant:{flat:`bg-surface`,bordered:`bg-surface border border-border`}},defaultVariants:{variant:`bordered`}}),wN=(0,x.forwardRef)(({className:e,variant:t,...n},r)=>(0,S.jsx)(`div`,{ref:r,className:OO(CN({variant:t}),e),...n}));wN.displayName=`Card`;var TN=(0,x.forwardRef)(({className:e,...t},n)=>(0,S.jsx)(`label`,{ref:n,className:OO(`text-[10px] uppercase tracking-wider text-foreground-muted font-medium`,e),...t}));TN.displayName=`Label`;var EN=gN(``,{variants:{orientation:{horizontal:`h-px w-full bg-border-subtle`,vertical:`w-px h-full bg-border-subtle`}},defaultVariants:{orientation:`horizontal`}}),DN=(0,x.forwardRef)(({className:e,orientation:t,...n},r)=>(0,S.jsx)(`div`,{ref:r,role:`separator`,className:OO(EN({orientation:t}),e),...n}));DN.displayName=`Separator`;var ON=(0,x.forwardRef)(({className:e,...t},n)=>(0,S.jsx)(`div`,{ref:n,className:OO(`animate-pulse bg-surface-hover rounded-md h-4 w-full`,e),...t}));ON.displayName=`Skeleton`;var kN=gN(`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`}}),AN=(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:OO(kN({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:OO(kN({state:t}),e),...a}));AN.displayName=`Input`;var jN=(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:OO(`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)(HM,{className:`h-3.5 w-3.5`})})]}));jN.displayName=`Select`;var MN=(0,x.forwardRef)(({className:e,...t},n)=>(0,S.jsx)(`input`,{ref:n,type:`checkbox`,className:OO(`w-3.5 h-3.5 rounded-sm border border-border accent-primary`,e),...t}));MN.displayName=`Checkbox`;var NN=(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:OO(`inline-flex items-center gap-2`,e),...a,children:[(0,S.jsx)(`span`,{className:OO(`w-8 h-4 rounded-full transition-colors`,t?`bg-primary`:`bg-surface-hover`),children:(0,S.jsx)(`span`,{className:OO(`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})]}));NN.displayName=`Switch`;var PN=(0,x.createContext)(null);function FN(){let e=(0,x.useContext)(PN);if(!e)throw Error(`Dialog compound components must be used within <Dialog>`);return e}var IN=gN(`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`}}),LN=(0,x.forwardRef)(({className:e,width:t,children:n,...r},a)=>{let{open:o,setOpen:s,contentId:c}=FN(),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:OO(IN({width:t}),e),onClick:e=>{e.target===e.currentTarget&&s(!1)},onClose:()=>s(!1),...r,children:n})});LN.displayName=`DialogContent`,(0,x.createContext)(null),(0,x.createContext)(null),(0,x.createContext)(null),(0,x.createContext)(null);var RN=(0,x.forwardRef)(({className:e,...t},n)=>(0,S.jsx)(`div`,{ref:n,className:OO(`overflow-auto [&::-webkit-scrollbar]:w-1 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:bg-surface-hover [&::-webkit-scrollbar-thumb]:rounded-full`,e),...t}));RN.displayName=`ScrollArea`;var zN=typeof globalThis<`u`?globalThis.__camstackTrpcReact:void 0,$=zN??Oi();typeof globalThis<`u`&&!zN&&(globalThis.__camstackTrpcReact=$);var BN=NO(`camstack:system`,null);function VN({system:e,children:t}){return(0,S.jsx)(BN.Provider,{value:e,children:t})}function HN(){let e=(0,x.useContext)(BN);if(!e)throw Error(`useSystem(): no <SystemProvider> in tree`);return e}function UN(e,t){let n=HN(),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])}NO(`camstack:confirm-dialog`,null);var WN=`capability.binding-changed`;function GN(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:WN},{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?E_(e,n):null,[e,n])}var KN={[K.Camera]:{icon:VM,label:`Camera`},[K.Hub]:{icon:$M,label:`Hub`},[K.Light]:{icon:YM,label:`Light`},[K.Siren]:{icon:iN,label:`Siren`},[K.Switch]:{icon:cN,label:`Switch`},[K.Sensor]:{icon:FM,label:`Sensor`},[K.Thermostat]:{icon:sN,label:`Thermostat`},[K.Button]:{icon:WM,label:`Button`},[K.EventEmitter]:{icon:pN,label:`Event Emitter`},[K.Update]:{icon:tN,label:`Update`},[K.Generic]:{icon:BM,label:`Generic`},[K.Notifier]:{icon:LM,label:`Notifier`},[K.Script]:{icon:nN,label:`Script`},[K.Automation]:{icon:fN,label:`Automation`},[K.Lock]:{icon:XM,label:`Lock`},[K.Cover]:{icon:RM,label:`Cover`},[K.Valve]:{icon:eN,label:`Valve`},[K.Humidifier]:{icon:dN,label:`Humidifier`},[K.WaterHeater]:{icon:IM,label:`Water heater`},[K.Fan]:{icon:qM,label:`Fan`},[K.MediaPlayer]:{icon:QM,label:`Media player`},[K.AlarmPanel]:{icon:rN,label:`Alarm panel`},[K.Control]:{icon:aN,label:`Control`},[K.Presence]:{icon:ZM,label:`Presence`},[K.Weather]:{icon:GM,label:`Weather`},[K.Vacuum]:{icon:zM,label:`Vacuum`},[K.LawnMower]:{icon:lN,label:`Lawn mower`},[K.Container]:{icon:BM,label:`Container`},[K.Image]:{icon:JM,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:KN[e].label,icon:KN[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 qN=$.intercom.startSession.useMutation,JN=$.intercom.handleAnswer.useMutation,YN=$.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,$.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 XN=176,ZN=76;270/360*(2*Math.PI*ZN),XN/2-ZN-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 QN=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()}},$N=class{constructor(e){this.generateIdentifier=e,this.kv=new QN}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)}},eP=class extends $N{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 tP(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 nP(e,t){let n=tP(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 rP(e,t){Object.entries(e).forEach(([e,n])=>t(n,e))}function iP(e,t){return e.indexOf(t)!==-1}function aP(e,t){for(let n=0;n<e.length;n++){let r=e[n];if(t(r))return r}}var oP=class{constructor(){this.transfomers={}}register(e){this.transfomers[e.name]=e}findApplicable(e){return nP(this.transfomers,t=>t.isApplicable(e))}findByName(e){return this.transfomers[e]}},sP=e=>Object.prototype.toString.call(e).slice(8,-1),cP=e=>e===void 0,lP=e=>e===null,uP=e=>typeof e!=`object`||!e||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype,dP=e=>uP(e)&&Object.keys(e).length===0,fP=e=>Array.isArray(e),pP=e=>typeof e==`string`,mP=e=>typeof e==`number`&&!isNaN(e),hP=e=>typeof e==`boolean`,gP=e=>e instanceof RegExp,_P=e=>e instanceof Map,vP=e=>e instanceof Set,yP=e=>sP(e)===`Symbol`,bP=e=>e instanceof Date&&!isNaN(e.valueOf()),xP=e=>e instanceof Error,SP=e=>typeof e==`number`&&isNaN(e),CP=e=>hP(e)||lP(e)||cP(e)||mP(e)||pP(e)||yP(e),wP=e=>typeof e==`bigint`,TP=e=>e===1/0||e===-1/0,EP=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),DP=e=>e instanceof URL,OP=e=>e.replace(/\\/g,`\\\\`).replace(/\./g,`\\.`),kP=e=>e.map(String).map(OP).join(`.`),AP=(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 jP(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var MP=[jP(cP,`undefined`,()=>null,()=>void 0),jP(wP,`bigint`,e=>e.toString(),e=>typeof BigInt<`u`?BigInt(e):(console.error(`Please add a BigInt polyfill.`),e)),jP(bP,`Date`,e=>e.toISOString(),e=>new Date(e)),jP(xP,`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}),jP(gP,`regexp`,e=>``+e,e=>{let t=e.slice(1,e.lastIndexOf(`/`)),n=e.slice(e.lastIndexOf(`/`)+1);return new RegExp(t,n)}),jP(vP,`set`,e=>[...e.values()],e=>new Set(e)),jP(_P,`map`,e=>[...e.entries()],e=>new Map(e)),jP(e=>SP(e)||TP(e),`number`,e=>SP(e)?`NaN`:e>0?`Infinity`:`-Infinity`,Number),jP(e=>e===0&&1/e==-1/0,`number`,()=>`-0`,Number),jP(DP,`URL`,e=>e.toString(),e=>new URL(e))];function NP(e,t,n,r){return{isApplicable:e,annotation:t,transform:n,untransform:r}}var PP=NP((e,t)=>yP(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}),FP=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),IP=NP(EP,e=>[`typed-array`,e.constructor.name],e=>[...e],(e,t)=>{let n=FP[t[1]];if(!n)throw Error(`Trying to deserialize unknown typed array`);return new n(e)});function LP(e,t){return e?.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}var RP=NP(LP,(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)}),zP=NP((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)}),BP=[RP,PP,zP,IP],VP=(e,t)=>{let n=aP(BP,n=>n.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};let r=aP(MP,n=>n.isApplicable(e,t));if(r)return{value:r.transform(e,t),type:r.annotation}},HP={};MP.forEach(e=>{HP[e.annotation]=e});var UP=(e,t,n)=>{if(fP(t))switch(t[0]){case`symbol`:return PP.untransform(e,t,n);case`class`:return RP.untransform(e,t,n);case`custom`:return zP.untransform(e,t,n);case`typed-array`:return IP.untransform(e,t,n);default:throw Error(`Unknown transformation: `+t)}else{let r=HP[t];if(!r)throw Error(`Unknown transformation: `+t);return r.untransform(e,n)}},WP=(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 GP(e){if(iP(e,`__proto__`))throw Error(`__proto__ is not allowed as a property`);if(iP(e,`prototype`))throw Error(`prototype is not allowed as a property`);if(iP(e,`constructor`))throw Error(`constructor is not allowed as a property`)}var KP=(e,t)=>{GP(t);for(let n=0;n<t.length;n++){let r=t[n];if(vP(e))e=WP(e,+r);else if(_P(e)){let a=+r,o=+t[++n]==0?`key`:`value`,s=WP(e,a);switch(o){case`key`:e=s;break;case`value`:e=e.get(s);break}}else e=e[r]}return e},qP=(e,t,n)=>{if(GP(t),t.length===0)return n(e);let r=e;for(let e=0;e<t.length-1;e++){let n=t[e];if(fP(r)){let e=+n;r=r[e]}else if(uP(r))r=r[n];else if(vP(r)){let e=+n;r=WP(r,e)}else if(_P(r)){if(e===t.length-2)break;let a=+n,o=+t[++e]==0?`key`:`value`,s=WP(r,a);switch(o){case`key`:r=s;break;case`value`:r=r.get(s);break}}}let a=t[t.length-1];if(fP(r)?r[+a]=n(r[+a]):uP(r)&&(r[a]=n(r[a])),vP(r)){let e=WP(r,+a),t=n(e);e!==t&&(r.delete(e),r.add(t))}if(_P(r)){let e=+t[t.length-2],o=WP(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},JP=e=>e<1;function YP(e,t,n,r=[]){if(!e)return;let a=JP(n);if(!fP(e)){rP(e,(e,o)=>YP(e,t,n,[...r,...AP(o,a)]));return}let[o,s]=e;s&&rP(s,(e,o)=>{YP(e,t,n,[...r,...AP(o,a)])}),t(o,r)}function XP(e,t,n,r){return YP(t,(t,n)=>{e=qP(e,n,e=>UP(e,t,r))},n),e}function ZP(e,t,n){let r=JP(n);function a(t,n){let a=KP(e,AP(n,r));t.map(e=>AP(e,r)).forEach(t=>{e=qP(e,t,()=>a)})}if(fP(t)){let[n,o]=t;n.forEach(t=>{e=qP(e,AP(t,r),()=>e)}),o&&rP(o,a)}else rP(t,a);return e}var QP=(e,t)=>uP(e)||fP(e)||_P(e)||vP(e)||xP(e)||LP(e,t);function $P(e,t,n){let r=n.get(e);r?r.push(t):n.set(e,[t])}function eF(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(kP):n[kP(a)]=o.map(kP)}),r?dP(n)?[r]:[r,n]:dP(n)?void 0:n}var tF=(e,t,n,r,a=[],o=[],s=new Map)=>{let c=CP(e);if(!c){$P(e,a,t);let n=s.get(e);if(n)return r?{transformedValue:null}:n}if(!QP(e,n)){let t=VP(e,n),r=t?{transformedValue:t.value,annotations:[t.type]}:{transformedValue:e};return c||s.set(e,r),r}if(iP(o,e))return{transformedValue:null};let l=VP(e,n),u=l?.value??e,d=fP(u)?[]:{},f={};rP(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=tF(c,t,n,r,[...a,l],[...o,e],s);d[l]=u.transformedValue,fP(u.annotations)?f[OP(l)]=u.annotations:uP(u.annotations)&&rP(u.annotations,(e,t)=>{f[OP(l)+`.`+t]=e})});let p=dP(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 nF(e){return Object.prototype.toString.call(e).slice(8,-1)}function rF(e){return nF(e)===`Array`}function iF(e){if(nF(e)!==`Object`)return!1;let t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function aF(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 oF(e,t={}){if(rF(e))return e.map(e=>oF(e,t));if(!iF(e))return e;let n=Object.getOwnPropertyNames(e),r=Object.getOwnPropertySymbols(e);return[...n,...r].reduce((n,r)=>{if(r===`__proto__`||rF(t.props)&&!t.props.includes(r))return n;let a=e[r];return aF(n,r,oF(a,t),e,t.nonenumerable),n},{})}var sF=class{constructor({dedupe:e=!1}={}){this.classRegistry=new eP,this.symbolRegistry=new $N(e=>e.description??``),this.customTransformerRegistry=new oP,this.allowedErrorProps=[],this.dedupe=e}serialize(e){let t=new Map,n=tF(e,t,this,this.dedupe),r={json:n.transformedValue};n.annotations&&(r.meta={...r.meta,values:n.annotations});let a=eF(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:oF(n);return r?.values&&(a=XP(a,r.values,r.v??0,this)),r?.referentialEqualities&&(a=ZP(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)}};sF.defaultInstance=new sF,sF.serialize=sF.defaultInstance.serialize.bind(sF.defaultInstance),sF.deserialize=sF.defaultInstance.deserialize.bind(sF.defaultInstance),sF.stringify=sF.defaultInstance.stringify.bind(sF.defaultInstance),sF.parse=sF.defaultInstance.parse.bind(sF.defaultInstance),sF.registerClass=sF.defaultInstance.registerClass.bind(sF.defaultInstance),sF.registerSymbol=sF.defaultInstance.registerSymbol.bind(sF.defaultInstance),sF.registerCustom=sF.defaultInstance.registerCustom.bind(sF.defaultInstance),sF.allowErrorProps=sF.defaultInstance.allowErrorProps.bind(sF.defaultInstance),sF.serialize,sF.deserialize,sF.stringify,sF.parse,sF.registerClass,sF.registerCustom,sF.registerSymbol,sF.allowErrorProps,(0,x.createContext)(null),NO(`camstack:custom-field-renderers`,{}),NO(`camstack:device-context`,null),NO(`camstack:widget-registry`,null);function cF({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)(HM,{className:`h-3.5 w-3.5 text-foreground-subtle`}):(0,S.jsx)(UM,{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]})}NO(`camstack:vod-playback`,{request:null,play:()=>{},clear:()=>{}}),(0,x.lazy)(()=>$E(()=>import(`./MotionZonesSettings-C1EEbk2V-CUopGB1R.js`).then(e=>({default:e.MotionZonesSettings})),__vite__mapDeps([0,1]),import.meta.url)),(0,x.lazy)(()=>$E(()=>import(`./PrivacyMaskSettings-APgPLF7p-CyTsHaor.js`).then(e=>({default:e.PrivacyMaskSettings})),__vite__mapDeps([2,1]),import.meta.url));var lF=Object.defineProperty,uF=Object.getOwnPropertySymbols,dF=Object.prototype.hasOwnProperty,fF=Object.prototype.propertyIsEnumerable,pF=(e,t,n)=>t in e?lF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,mF=(e,t)=>{for(var n in t||={})dF.call(t,n)&&pF(e,n,t[n]);if(uF)for(var n of uF(t))fF.call(t,n)&&pF(e,n,t[n]);return e},hF=(e,t)=>{var n={};for(var r in e)dF.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&uF)for(var r of uF(e))t.indexOf(r)<0&&fF.call(e,r)&&(n[r]=e[r]);return n},gF;(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})(gF||={}),(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||={})})(gF||={}),(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||={})})(gF||={});var _F=gF,vF={L:_F.QrCode.Ecc.LOW,M:_F.QrCode.Ecc.MEDIUM,Q:_F.QrCode.Ecc.QUARTILE,H:_F.QrCode.Ecc.HIGH},yF=128,bF=`L`,xF=`#FFFFFF`,SF=`#000000`,CF=!1,wF=1,TF=4,EF=0,DF=.1;function OF(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 kF(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 AF(e,t,n,r){if(r==null)return null;let a=e.length+n*2,o=Math.floor(t*DF),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 jF(e,t){return t==null?e?TF:EF:Math.max(Math.floor(t),0)}function MF({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(..._F.QrSegment.makeSegments(t)),e),[]);return _F.QrCode.encodeSegments(r,vF[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=jF(r,a);return{cells:e,margin:t,numCells:e.length+t*2,calculatedImageSettings:AF(e,s,t,o)}},[l,s,o,r,a]);return{qrcode:l,margin:d,cells:u,numCells:f,calculatedImageSettings:p}}var NF=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),PF=x.forwardRef(function(e,t){let n=e,{value:r,size:a=yF,level:o=bF,bgColor:s=xF,fgColor:c=SF,includeMargin:l=CF,minVersion:u=wF,boostLevel:d,marginSize:f,imageSettings:p}=n,m=hF(n,[`value`,`size`,`level`,`bgColor`,`fgColor`,`includeMargin`,`minVersion`,`boostLevel`,`marginSize`,`imageSettings`]),{style:h}=m,g=hF(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}=MF({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=kF(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,NF?t.fill(new Path2D(OF(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=mF({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`,mF({style:E,height:a,width:a,ref:b,role:`img`},g)),ne)});PF.displayName=`QRCodeCanvas`;var FF=x.forwardRef(function(e,t){let n=e,{value:r,size:a=yF,level:o=bF,bgColor:s=xF,fgColor:c=SF,includeMargin:l=CF,minVersion:u=wF,boostLevel:d,title:f,marginSize:p,imageSettings:m}=n,h=hF(n,[`value`,`size`,`level`,`bgColor`,`fgColor`,`includeMargin`,`minVersion`,`boostLevel`,`title`,`marginSize`,`imageSettings`]),{margin:g,cells:_,numCells:v,calculatedImageSettings:y}=MF({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=kF(_,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=OF(b,g);return x.createElement(`svg`,mF({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)});FF.displayName=`QRCodeSVG`;function IF(){return typeof window>`u`?!1:window.matchMedia(`(hover: none) and (pointer: coarse)`).matches||typeof navigator<`u`&&navigator.maxTouchPoints>0||`ontouchstart`in window}function LF(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 RF(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 zF=1500,BF=15e3,VF=40;function HF({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()=>{}),[fe,pe]=(0,x.useState)(`idle`),[me,he]=(0,x.useState)(``),[ge,_e]=(0,x.useState)(a),[ve,ye]=(0,x.useState)(!1),[be,xe]=(0,x.useState)(!1),Se=IF(),[Ce,we]=(0,x.useState)(!0),Te=(0,x.useRef)(null),Ee=(0,x.useRef)(!1);(m||p)&&(Ee.current=!0);let De=Ee.current,Oe=(0,x.useRef)(!1);h&&(Oe.current=!0);let ke=Oe.current,[Ae,je]=(0,x.useState)(!1),Me=(0,x.useRef)(null),[Ne,Pe]=(0,x.useState)(null),[Fe,Ie]=(0,x.useState)(!1),Le=(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),LF(n,t.width,t.height)))return;Me.current=t.toDataURL(`image/jpeg`,.6)}catch{}},[]),Re=(0,x.useCallback)(e=>{pe(e),e===`playing`&&je(!0),u?.(e)},[u]),ze=(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]),Be=(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},[]),Ve=1e3,He=(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()},Ve))}};k.current=setTimeout(()=>{t()},Ve)},[b,ee]),Ue=(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?Be():ze(),Re(`connecting`);let r=new AbortController;ae.current=r;try{let{sessionId:a,sdpOffer:o,iceServers:s}=await p({...RF(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(),Re(`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{}Re(`disconnected`),Je()}},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 WF(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);he(t),Re(`error`),d?.(t),Je()}},[e,t,p,m,ze,Be,y,Re,d,w]),We=(0,x.useCallback)(async()=>{if(D.current){ze(),Re(`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,Re(`playing`),E.current?.paused&&E.current.play().catch(()=>{})):(e===`failed`||e===`disconnected`||e===`closed`)&&(Re(`disconnected`),Je())};let a=await n.createOffer();if(await n.setLocalDescription(a),await WF(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);he(t),Re(`error`),d?.(t),Je()}}},[e,t,ze,Re,d]),Ge=(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?Be():ze(),Re(`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(),Re(`playing`),E.current?.paused&&E.current.play().catch(()=>{});else if(t===`failed`||t===`disconnected`||t===`closed`){if(e&&!c)try{o.close()}catch{}Re(`disconnected`),Je()}};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()}He(p)}catch(e){if(!D.current)return;let t=e instanceof Error?e.message:String(e);he(t),Re(`error`),d?.(t),Je()}},[h,g,_,v,y,ze,Be,Re,d,He]);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(),Re(`playing`),E.current?.paused&&E.current.play().catch(()=>{})):(e===`failed`||e===`closed`)&&(!c&&e===`failed`&&o.close(),Re(`disconnected`),Je())};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()}He(p)}catch(t){console.debug(`[WebRTC] reoffer failed; keeping last frame, re-arming poll`,t instanceof Error?t.message:String(t)),He(e)}finally{ue.current=!1}},[ee,g,_,v,Re,He]);let Ke=ke?Ge:De?Ue:We,qe=(0,x.useRef)(()=>{});qe.current=Ke;let Je=(0,x.useCallback)(()=>{if(!D.current||se.current>=VF)return;let e=se.current;se.current+=1;let t=Math.min(BF,zF*2**e),n=Math.round(t*(.8+Math.random()*.4));oe.current=setTimeout(()=>{D.current&&qe.current()},n)},[]);(0,x.useEffect)(()=>(D.current=!0,se.current=0,r&&Ke(),()=>{D.current=!1,ze()}),[e,t]);let Ye=(0,x.useRef)(!1);(0,x.useEffect)(()=>{if(r){if(ke){if(!h)return}else if(De){if(!p||!m)return}else return;Ye.current||re.current||(Ye.current=!0,Ke())}},[r,ke,De,h,p,m,Ke]);let Xe=()=>{se.current=0,Ke()},Ze=()=>{if(se.current=0,re.current&&ke){Ge(!0);return}if(re.current&&De){Ue(!0);return}Ke()},Qe=(0,x.useRef)(te);(0,x.useEffect)(()=>{Qe.current!==te&&(Qe.current=te,D.current&&Ze())},[te]);let $e=()=>{E.current&&(E.current.muted=!E.current.muted,_e(E.current.muted))},et=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}`)}},tt=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)}`)}},nt=()=>{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=()=>ye(!!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`;xe(t||n)},[]);let[rt,it]=(0,x.useState)(``),at=(0,x.useRef)(null);(0,x.useEffect)(()=>{if(!s){it(``),at.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;at.current&&r>at.current.ts&&(l=Math.round((n-at.current.bytes)*8/(r-at.current.ts))),at.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`),it(u.join(` · `))}catch{}};e();let t=setInterval(()=>{e()},1e3);return()=>clearInterval(t)},[s]);let ot=(0,x.useRef)(null);(0,x.useEffect)(()=>{if(!c){ot.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=ot.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}),ot.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)(()=>{_e(a);let e=E.current;e&&(e.muted=a,a||e.play().catch(()=>{}))},[a]);let st=()=>{Se||(we(!0),Te.current&&clearTimeout(Te.current),Te.current=setTimeout(()=>we(!1),3e3))},ct=()=>{we(e=>!e),Te.current&&clearTimeout(Te.current)};(0,x.useEffect)(()=>{if(fe===`playing`){Le();let e=setInterval(Le,2e3);return()=>clearInterval(e)}Ae&&Me.current&&Pe(Me.current)},[fe,Ae,Le]),(0,x.useEffect)(()=>{if(fe!==`playing`){Ie(!1);return}let e=E.current;if(!e)return;let t=!1,n=()=>{t||Ie(!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)}},[fe]);let lt=Ae&&Ne?Ne:C??null,ut=!Fe&&lt!==null;return(0,S.jsxs)(`div`,{ref:ne,className:`relative isolate bg-black overflow-hidden group ${l}`,onMouseMove:st,onMouseEnter:st,onTouchStart:ct,children:[(0,S.jsx)(`video`,{ref:E,autoPlay:r,muted:ge,playsInline:!0,className:`w-full h-full object-contain relative z-0`}),ut&&lt&&(0,S.jsx)(`img`,{src:lt,alt:``,className:`absolute inset-0 w-full h-full object-contain z-[5] transform-gpu pointer-events-none`}),n&&fe===`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&&rt&&(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:rt}),f,!lt&&fe===`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…`})]}),!lt&&(fe===`error`||fe===`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:fe===`error`?me||`Connection failed`:`Disconnected`}),(0,S.jsx)(`button`,{onClick:Xe,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`})]}),lt&&(fe===`connecting`||fe===`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]`})})}),lt&&fe===`error`&&(0,S.jsx)(`button`,{onClick:Xe,title:me||`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&&fe!==`idle`&&fe!==`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 ${Se||Ce?`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)(UF,{onClick:$e,title:ge?`Unmute`:`Mute`,children:ge?(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)(UF,{onClick:nt,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`})]})}),be&&(0,S.jsx)(UF,{onClick:tt,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)(UF,{onClick:et,title:ve?`Exit fullscreen`:`Fullscreen`,children:ve?(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 UF({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 WF(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)})}NO(`camstack:player-overlays-state`,null);var GF=NO(`camstack:player-overlays-actions`,null);function KF(e){let t=(0,x.useContext)(GF);(0,x.useEffect)(()=>{if(!(!t||!e))return t.setLayer(e),()=>t.removeLayer(e.id)},[t,e])}B({id:F(),stableId:P(),addonId:P(),type:P(),name:P(),online:I(),disabled:I(),parentDeviceId:F().nullable(),role:P().nullable().optional(),features:z(P()).optional(),isCamera:I().optional(),sourceInfo:Kp.optional()}),G.AddonStarted,G.AddonInstalled,G.AddonRestarted,G.AddonUpdated,G.AddonStopped,G.AddonUninstalled,G.AddonCrashed,G.AddonError,G.DetectionPhaseTransition,G.DetectionResult,G.DetectionEvent,G.DetectionCameraNative,G.ProviderMotion,G.MotionOnMotionChanged,G.MotionAnalysis,G.MotionZonesRaw,G.ProviderDetection,G.PipelineAudioInferenceResult,G.AgentOnline,G.AgentOffline,G.DeviceRegistered,G.DeviceUnregistered,G.DeviceStateChanged,G.EventEmitted;var qF=Object.freeze([...new Set(Object.values(G))].toSorted()),JF=Object.freeze([G.PipelineCameraMetricsSnapshot,G.PipelineRunnerLoadSnapshot,G.PipelineEngineMetricsSnapshot,G.PipelineInferenceResult,G.PipelineTrace,G.PipelineProgress,G.StreamBrokerMetricsSnapshot,G.MetricsNodeResourcesSnapshot,G.MetricsNodeProcessesSnapshot,G.ClusterTopologySnapshot,G.MotionAnalysis,G.MotionZonesRaw,G.DetectionResult,G.PipelineAudioInferenceResult,G.PlatformProbePhase,G.BenchmarkProgress,G.ModelDownloadProgress]),YF=new Set(JF);Object.freeze(qF.filter(e=>!YF.has(e))),Object.freeze([...new Set(yT.filter(e=>e.scope===`device`).map(e=>e.name))].toSorted()),NO(`camstack:zone-editing`,null);var XF=500,ZF=800;function QF(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 $F(e,t){return e?.id===t}function eI(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=QF(e,`detection.motion-analysis`,e=>{let n=e;if(!$F(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),XF))});return()=>{n?.unsubscribe(),d.current&&clearTimeout(d.current)}},[e,t]),(0,x.useEffect)(()=>{if(t===null)return;let n=QF(e,`detection.motion-zones-raw`,e=>{let n=e;if(!$F(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),XF))});return()=>{n?.unsubscribe(),f.current&&clearTimeout(f.current)}},[e,t]),(0,x.useEffect)(()=>{if(t===null)return;let n=QF(e,`detection.result`,e=>{let n=e;if(!$F(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),ZF))});return()=>{n?.unsubscribe(),p.current&&clearTimeout(p.current)}},[e,t]),(0,x.useEffect)(()=>{if(t===null)return;let n=QF(e,`detection.phase-transition`,e=>{let n=e;$F(n?.source,t)&&n.data?.to&&u(n.data.to)});return()=>{n?.unsubscribe()}},[e,t]),{motion:n,motionRaw:a,detection:s,phase:l}}function tI(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]),UN(`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)(()=>$E(()=>import(`./MaskShapeCanvas-DI4BY7W2-B4oJIlgF.js`).then(e=>({default:e.MaskShapeCanvas})),[],import.meta.url)),(0,x.lazy)(()=>$E(()=>import(`./MotionZonesSettings-C1EEbk2V-CUopGB1R.js`).then(e=>({default:e.MotionZonesSettings})),__vite__mapDeps([0,1]),import.meta.url)),(0,x.lazy)(()=>$E(()=>import(`./PrivacyMaskSettings-APgPLF7p-CyTsHaor.js`).then(e=>({default:e.PrivacyMaskSettings})),__vite__mapDeps([2,1]),import.meta.url));var nI=U([`auto`,`high`,`medium`,`low`]),rI=V([W(`auto`),F().int().min(1)]),iI=B({enabled:I(),motion:I(),audio:U([`off`,`sensor`,`level`]),audioDb:F(),audioHoldSec:F(),detection:I(),detectionHoldSec:F(),detectionClasses:z(P()).optional(),appearance:B({motionColor:P(),audioColor:P(),detectionColor:P(),thickness:F()}).optional()}),aI=B({serverUrl:P().min(1),token:P().min(1),devices:z(F().int().nonnegative()).min(1),layout:rI,quality:nI,showName:I(),showBadges:I(),muted:I(),paused:I(),highlight:iI.optional(),activeOnly:I().optional(),audioOnIds:z(F().int().nonnegative()).optional(),pausedIds:z(F().int().nonnegative()).optional(),snapshots:H(P(),P()).optional(),ptzIds:z(F().int().nonnegative()).optional()});function oI(e){if(e==null)return{ok:!1,error:`config is required`};let t=aI.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 sI=1e4;function cI(){try{return window.parent!==window}catch{return!0}}function lI(e){let t=window.ReactNativeWebView;if(t){t.postMessage(JSON.stringify(e));return}cI()&&window.parent.postMessage(e,`*`)}function uI(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 dI(e,t,n){let r=t();return r==null?cI()?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`})},sI),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 fI(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 dI(e,()=>o.current(),e=>s.current(e)).then(e=>{t&&a(e)}),()=>{t=!1}},[e]),r}var pI=16/9;function mI(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*pI);return{cols:a,rows:o,cellW:s,cellH:s/pI}}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*pI),l=c/pI,u=c*l;u>o&&(o=u,a={cols:r,rows:s,cellW:c,cellH:l})}return a}function hI(){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=qN(),d=JN(),f=YN(),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 gI=6e3,_I=500;function vI(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)};UN(G.MotionOnMotionChanged,e=>{if(!a)return;let t=e.data;t&&t.detected&&f(t.deviceId,gI)}),UN(G.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)}),UN(G.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),_I);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 yI(e){return{type:`tileOpen`,deviceId:e}}function bI(e){return{type:`audioToggle`,deviceId:e}}function xI(e){return{type:`pauseToggle`,deviceId:e}}function SI(e){return{type:`ptzOpen`,deviceId:e}}function CI(e,t){return t===void 0?{type:`state`,state:e}:{type:`state`,state:e,message:t}}function wI(e){return{type:`layout`,tiles:e}}function TI(e){lI(e)}var EI=4,DI=8,OI=300;function kI(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function AI({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:kI(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=kI(t,n);l.current.dist>0&&(o.current=Math.max(1,Math.min(EI,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)>DI||Math.abs(r)>DI)&&(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<OI?(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 jI=500;function MI(e,t,n){let{motion:r,detection:a}=eI(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(UN(G.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),jI);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 NI={motion:`#DC2626`,audio:`#3B82F6`,detection:`#22C55E`},PI=3500;function FI(e){return e===`auto`?{kind:`adaptive`}:{kind:`profile`,profile:e===`medium`?`mid`:e}}function II({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}=tI(e.trpcClient,t),E=MI(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)(()=>FI(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),PI)},ue=()=>{O(!0),le()},de=()=>{O(e=>{let t=!e;return t&&le(),t})},fe=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)(AI,{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)(zI,{size:28})}):(0,S.jsx)(HF,{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??NI.motion:E===`audio`?e?.audioColor??NI.audio:e?.detectionColor??NI.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)(LI,{label:s?`Play`:`Pause`,big:!0,enabled:ce,onClick:e=>{fe(e),d(t)},children:s?(0,S.jsx)(zI,{size:22}):(0,S.jsx)(BI,{size:22})})}),(0,S.jsxs)(`div`,{style:{position:`absolute`,left:8,bottom:8,display:`flex`,gap:8,pointerEvents:`none`},children:[(0,S.jsx)(LI,{label:l?`Mute`:`Listen`,active:l,enabled:ce,onClick:e=>{fe(e),f(t)},children:l?(0,S.jsx)(VI,{size:18}):(0,S.jsx)(HI,{size:18})}),(0,S.jsx)(LI,{label:u?`Stop talk`:`Talk`,active:u,enabled:ce,onClick:e=>{fe(e),p(t)},children:(0,S.jsx)(UI,{size:18,muted:!u})}),h&&g?(0,S.jsx)(LI,{label:`PTZ`,enabled:ce,onClick:e=>{fe(e),g(t)},children:(0,S.jsx)(GI,{size:18})}):null]}),(0,S.jsx)(`div`,{style:{position:`absolute`,right:8,bottom:8,pointerEvents:`none`},children:(0,S.jsx)(LI,{label:`Open`,enabled:ce,onClick:e=>{fe(e),m(t)},children:(0,S.jsx)(WI,{size:18})})})]})]})}function LI({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 RI={fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`};function zI({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 BI({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 VI({size:e}){return(0,S.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,...RI,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 HI({size:e}){return(0,S.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,...RI,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 UI({size:e,muted:t}){return(0,S.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,...RI,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 WI({size:e}){return(0,S.jsx)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,...RI,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 GI({size:e}){return(0,S.jsxs)(`svg`,{width:e,height:e,viewBox:`0 0 24 24`,...RI,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 KI({message:e}){return(0,x.useEffect)(()=>TI(CI(`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 qI({system:e,config:t}){let[n,r]=(0,x.useState)(()=>new Set(t.audioOnIds??[])),a=hI(),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=vI(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)},TI(CI(`ready`)),()=>{window.__camstackGrid&&delete window.__camstackGrid}),[]),(0,x.useEffect)(()=>uI(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)(()=>mI(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&&TI(wI(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)(II,{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=>TI(xI(e)),onToggleAudio:e=>TI(bI(e)),onToggleMic:a.toggleMic,onOpen:e=>TI(yI(e)),ptzSupported:T.has(t),onPtz:e=>TI(SI(e)),highlight:l,reconnectSignal:ee,posterUrl:w[String(t)]})},t))]})}function JI(){let e=fI(`grid`,()=>window.__CAMSTACK_GRID__,oI),t=(0,x.useMemo)(()=>e===null||!e.ok?null:{system:IE({serverUrl:e.config.serverUrl,token:e.config.token}),queryClient:new ct({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)(VN,{system:t.system,children:(0,S.jsx)(dt,{client:t.queryClient,children:(0,S.jsx)($.Provider,{client:t.system.trpcClient,queryClient:t.queryClient,children:(0,S.jsx)(qI,{system:t.system,config:e.config})})})}):(0,S.jsx)(KI,{message:`Failed to initialise the grid embed`}):(0,S.jsx)(KI,{message:e.error})}function YI(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 XI=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 ZI(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 QI(e,t){return new URL(t,e).toString()}function $I(e){let t=(e.split(`/`).pop()??``).match(/^(\d+)-(\d+)(?:-\d+)?\.m4s$/);return t?{startMs:Number(t[1]),durMs:Number(t[2])}:null}function eL(e,t){let n=e.split(`
78
+ `).map(e=>e.trim());for(let e of n)if(/low\.m3u8/i.test(e))return QI(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=QI(t,o))}return r}async function tL(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 nL(e,t){let n=ZI(e),r=eL(await tL(n,t),n);if(!r)return[];let a=await tL(r,t),o=[];for(let e of a.split(`
79
+ `).map(e=>e.trim())){if(!e||e.startsWith(`#`))continue;let t=QI(r,e),n=$I(t);n&&o.push({uri:t,startMs:n.startMs,durMs:n.durMs})}return o.sort((e,t)=>e.startMs-t.startMs),o}function rL(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 iL(e,t){return e.length===0?null:e[rL(e,t)]??null}function aL(e,t,n,r){if(e.length===0||r<=0)return[];let a=rL(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 oL=class{deps;generation=0;inflight=null;lastEpoch=0;lastSegStart=null;bytes;frames;prefetchCount;prefetching=new Map;constructor(e){this.deps=e,this.bytes=new XI(e.byteCacheSize??24),this.frames=new XI(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=iL(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=aL(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)})}}},sL=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,`&amp;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`).replace(/"/g,`&quot;`).replace(/'/g,`&#039;`)}),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
+ `,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 cL(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 sL.DataStream(void 0,0,sL.DataStream.BIG_ENDIAN);return t.write(e),new Uint8Array(e.buffer,8)}}}async function lL(e){let t=sL.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=cL(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 uL=class{decoder=null;async decodeSegment(e){let{config:t,chunk:n}=await lL(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 dL({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 fL=V([B({kind:W(`adaptive`)}),B({kind:W(`profile`),profile:Wd})]),pL=B({serverUrl:P().min(1),token:P().min(1),deviceId:F().int().nonnegative(),target:fL,muted:I(),stats:I().optional(),highlight:iI.optional(),snapshot:P().optional(),hlsRecordedPlayback:I().optional()}),mL=300*1e3;function hL(e,t){try{return new URL(t,e).toString()}catch{return t}}var gL=[`live`,`loading`,`playing`,`paused`,`gap`,`ended`,`error`];function _L(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`&&gL.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 vL(e,t){lI(t===void 0?{type:`state`,state:e}:{type:`state`,state:e,message:t})}function yL(e){switch(e){case`playing`:return`playing`;case`error`:return`error`;case`connecting`:case`disconnected`:case`idle`:return`connecting`}}function bL(e){return e.kind===`adaptive`?{kind:`adaptive`}:{kind:`profile`,profile:e.profile}}function xL(e){return e.kind===`adaptive`?`embed:adaptive`:`embed:profile:${e.profile}`}function SL(e){let t=pL.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 CL({message:e}){return(0,x.useEffect)(()=>{vL(`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 wL({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=MI(e,t,g),re=hI(),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=_L(t);n&&(n.kind===`position`?(oe.current&&se.current(),lI({type:`position`,positionMs:n.epochMs})):(n.state===`playing`&&oe.current&&se.current(),lI({type:`recState`,state:n.state})))},e.onclose=()=>{ae.current===e&&(ae.current=null)}}).current,ce=(0,x.useRef)(e=>{let t=YI(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:fe}=tI(e.trpcClient,t),pe=(0,x.useMemo)(()=>bL(u),[u]),me=(0,x.useMemo)(()=>(e,t)=>O(pe,e,t),[O,pe]),he=(0,x.useMemo)(()=>(e,t,n)=>O(n,t,e),[O]),ge=(0,x.useRef)(null),[_e,ve]=(0,x.useState)(!1),[ye,be]=(0,x.useState)(!1),xe=(0,x.useRef)(!1);xe.current=ye;let Se=(0,x.useRef)(null);se.current=(0,x.useCallback)(()=>{oe.current=!1,Se.current&&=(clearTimeout(Se.current),null),ve(!1)},[]);let Ce=(0,x.useCallback)(()=>{xe.current?(oe.current=!0,Se.current&&clearTimeout(Se.current),Se.current=setTimeout(()=>se.current(),4e3)):ve(!1)},[]),we=(0,x.useRef)(Ce);we.current=Ce;let Te=(0,x.useRef)(null),Ee=(0,x.useRef)(null),De=(0,x.useRef)([]),Oe=(0,x.useRef)(null),ke=(0,x.useMemo)(()=>({Authorization:`Bearer ${n}`}),[n]),Ae=(0,x.useMemo)(()=>async n=>{let r=Oe.current;if(r&&n>=r.fromMs&&n<r.toMs&&De.current.length>0)return De.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?(De.current=await nL(c.playbackUrl,ke),Oe.current={fromMs:o,toMs:s},De.current):De.current},[e,t,ke]),je=(0,x.useMemo)(()=>e=>{let t=ge.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),be(!0)},[C.w,C.h]),Me=(0,x.useRef)(je);Me.current=je;let Ne=(0,x.useMemo)(()=>async e=>{Te.current||=new uL,Ee.current||=new oL({ensureIndex:e=>Ae(e),fetchBytes:async(e,t)=>{let n=await fetch(e,{signal:t,headers:ke});if(!n.ok)throw Error(`segment fetch failed: ${n.status}`);return n.arrayBuffer()},decode:e=>{let t=Te.current;if(!t)throw Error(`decoder not initialised`);return t.decodeSegment(e)},draw:e=>Me.current(e)});try{await Ee.current.scrubTo(e)}catch{}},[Ae,ke]),Pe=(0,x.useRef)(Ne);Pe.current=Ne,(0,x.useEffect)(()=>()=>{Ee.current?.dispose()},[]);let Fe=(0,x.useMemo)(()=>async n=>{let r=n-mL,a=n+mL;lI({type:`recState`,state:`loading`});try{let o=await e.trpcClient.recording.getPlaybackManifest.query({deviceId:t,fromMs:r,toMs:a});if(!o?.playbackUrl){lI({type:`recState`,state:`gap`});return}T({url:hL(e.serverUrl,o.playbackUrl),windowStartMs:r,windowEndMs:a,targetMs:n}),lI({type:`recState`,state:`playing`}),lI({type:`position`,positionMs:n})}catch{lI({type:`recState`,state:`error`})}},[e,t]),Ie=(0,x.useRef)(Fe);Ie.current=Fe;let Le=(0,x.useMemo)(()=>e=>{let t=E.current;if(!t){Ie.current(e);return}if(e>=t.windowStartMs&&e<=t.windowEndMs){let n=Be.current;if(n){n.currentTime=Math.max(0,(e-t.windowStartMs)/1e3),lI({type:`position`,positionMs:e});return}}Ie.current(e)},[]),Re=(0,x.useRef)(Le);Re.current=Le;let ze=(0,x.useRef)(null),Be=(0,x.useRef)(null);(0,x.useEffect)(()=>{Be.current=te?ze.current?.querySelector(`video`)??null:null},[te]),(0,x.useEffect)(()=>(window.__camstackEmbed={setMuted:e=>p(e),setTarget:e=>{let t=fL.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?Ie.current(t):ce({kind:`playRecorded`,deviceId:e,epochMs:t,profile:n})},seek:e=>{l&&E.current?Re.current(e):ce({kind:`seekTo`,epochMs:e})},scrubCommit:e=>{if(l&&E.current){Re.current(e);return}ce({kind:`scrubEnd`,epochMs:e}),we.current()},scrubStart:()=>{l&&E.current||(be(!1),ve(!0),ce({kind:`scrubStart`}))},scrubTo:e=>{l&&E.current||Pe.current(e)},scrubEnd:e=>{if(l&&E.current){Re.current(e);return}ce({kind:`scrubEnd`,epochMs:e}),we.current()},setRate:e=>{if(l&&E.current){let t=Be.current;t&&(e===0?t.pause():t.play().catch(()=>{}));return}ce({kind:e===0?`pause`:`play`})},goLive:()=>{if(l&&E.current){T(null),lI({type:`recState`,state:`live`});return}ce({kind:`goLive`})}},()=>{window.__camstackEmbed&&delete window.__camstackEmbed}),[t,l]),(0,x.useEffect)(()=>{lI({type:`micState`,state:re.micState})},[re.micState]),(0,x.useEffect)(()=>uI(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 Ve=xL(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)(HF,{serverUrl:e.serverUrl,streamKey:Ve,autoPlay:!0,muted:f,showControls:!1,showStats:m,onPlaybackStats:e=>lI({type:`log`,scope:`playback`,msg:`stats`,data:e}),className:`w-full h-full`,handleOffer:me,reoffer:he,getSessionState:fe,getIceServers:k,addIceCandidate:le,getIceCandidates:ue,closeSession:de,reconnectSignal:b,posterUrl:v,onControlChannel:D,onStateChange:e=>vL(yL(e)),onError:e=>vL(`error`,e)},Ve),te?(0,S.jsx)(`div`,{ref:ze,style:{position:`absolute`,inset:0,zIndex:1,background:`#000`},children:(0,S.jsx)(dL,{url:te.url,muted:f,autoPlay:!0},te.url)}):null,(0,S.jsx)(`canvas`,{ref:ge,style:{position:`absolute`,inset:0,width:`100%`,height:`100%`,background:`#000`,pointerEvents:`none`,transform:`translateZ(0)`,zIndex:2,display:_e&&ye?`block`:`none`}}),ne&&(()=>{let e=g?.appearance,t=ne===`motion`?e?.motionColor??NI.motion:ne===`audio`?e?.audioColor??NI.audio:e?.detectionColor??NI.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 TL(){let e=fI(`player`,()=>window.__CAMSTACK_EMBED__,SL),t=(0,x.useMemo)(()=>e===null||!e.ok?null:{system:IE({serverUrl:e.config.serverUrl,token:e.config.token}),queryClient:new ct({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)(VN,{system:t.system,children:(0,S.jsx)(dt,{client:t.queryClient,children:(0,S.jsx)($.Provider,{client:t.system.trpcClient,queryClient:t.queryClient,children:(0,S.jsx)(wL,{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)(CL,{message:`Failed to initialise the embed player`}):(0,S.jsx)(CL,{message:e.error})}var EL=B({serverUrl:P().min(1),token:P().min(1),deviceId:F().int().nonnegative(),startMs:F().int().nonnegative().optional()});function DL(e){if(e==null)return{ok:!1,error:`config is required`};let t=EL.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 OL=360*60*1e3;function kL(e){lI(e)}function AL(e,t,n){try{lI({type:`log`,scope:e,msg:t,data:n})}catch{}try{console.debug(`[rec-embed:${e}] ${t}`,n??``)}catch{}}function jL({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(),AL(`loadAt`,`start`,{epochMs:r,window:OL}),kL({type:`state`,state:`loading`});try{let n=await e.trpcClient.recording.getPlaybackManifest.query({deviceId:t.deviceId,fromMs:r,toMs:r+OL});if(AL(`loadAt`,`manifest`,{playbackUrl:n?.playbackUrl??null,endpoints:n?.playbackEndpoints?.length??0,localMaster:!!n?.localMasterPath}),!n?.playbackUrl){kL({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=>{AL(`loadAt`,`play-rejected`,{msg:String(e)})}),AL(`loadAt`,`src-set`,{src:n.playbackUrl})}catch(e){AL(`loadAt`,`error`,{msg:e instanceof Error?e.message:String(e)}),kL({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 AL(`scrub`,`dayIndex-manifest`,{playbackUrl:c?.playbackUrl??null,fromMs:o,toMs:s}),c?.playbackUrl?(m.current=await nL(c.playbackUrl),h.current={fromMs:o,toMs:s},AL(`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 uL,p.current||=new oL({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=>AL(`scrub`,`timing`,e)});let t=p.current;if(t)try{await t.scrubTo(e),AL(`scrub`,`drawn`,{epochMs:e})}catch(e){AL(`scrub`,`error`,{msg:e instanceof Error?e.message:String(e)}),d.current||(d.current=!0,kL({type:`state`,state:`error`,message:`scrub: ${e instanceof Error?e.message:String(e)}`}))}},[_]);return(0,x.useEffect)(()=>(AL(`init`,`mounted`,{deviceId:t.deviceId,startMs:t.startMs??null,hasWebCodecs:window.VideoDecoder!==void 0,ua:navigator.userAgent}),window.__camstackRecording={seekTo:e=>{AL(`cmd`,`seekTo`,{epochMs:e}),g(e)},play:()=>{AL(`cmd`,`play`),n.current?.play().catch(()=>{})},pause:()=>{AL(`cmd`,`pause`),n.current?.pause()},setRate:e=>{AL(`cmd`,`setRate`,{rate:e}),n.current&&(n.current.playbackRate=e)},fit:(e,t)=>{AL(`cmd`,`fit`,{w:e,h:t}),c({w:e,h:t})},scrubStart:()=>{AL(`cmd`,`scrubStart`),d.current=!1,u(!0)},scrubTo:e=>{AL(`cmd`,`scrubTo`,{epochMs:e}),b(e)},scrubEnd:e=>{AL(`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)(()=>uI(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=>AL(`video`,`loadedmetadata`,{w:e.currentTarget.videoWidth,h:e.currentTarget.videoHeight,dur:e.currentTarget.duration}),onPlaying:()=>{AL(`video`,`playing`,{vodStartMs:Math.round(performance.now()-o.current)}),kL({type:`state`,state:`playing`}),u(!1)},onPause:()=>kL({type:`state`,state:`paused`}),onEnded:()=>kL({type:`state`,state:`ended`}),onError:e=>{let t=e.currentTarget.error;AL(`video`,`error`,{code:t?.code??null,message:t?.message??null}),kL({type:`state`,state:`error`,message:t?.message||`video error`}),u(!1)},onTimeUpdate:e=>kL({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 ML(){let e=fI(`recording`,()=>window.__CAMSTACK_RECORDING__,DL),t=(0,x.useMemo)(()=>e===null||!e.ok?null:(document.cookie=`camstack_session=${e.config.token}; path=/; SameSite=Lax`,IE({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)(jL,{system:t,config:e.config}):(kL({type:`state`,state:`error`,message:`init failed`}),null):(kL({type:`state`,state:`error`,message:e.error}),null)}function NL(){let e=new URLSearchParams(location.search).get(`mode`)??`grid`;return e===`player`?(0,S.jsx)(TL,{}):e===`recording`?(0,S.jsx)(ML,{}):(0,S.jsx)(JI,{})}var PL=document.getElementById(`root`);PL&&(0,ee.createRoot)(PL).render((0,S.jsx)(NL,{}));export{cF as a,GN as c,b as d,m as f,u as g,c as h,uN as i,KF as l,s as m,oN as n,Q as o,f as p,MO as r,jO as s,KM as t,HN as u};