@camstack/addon-pipeline-orchestrator 1.2.225 → 1.2.226

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 (20) hide show
  1. package/assets/viewer/.viewer-current-files.json +11 -11
  2. package/assets/viewer/.viewer-version +1 -1
  3. package/assets/viewer/_expo/static/js/web/Clipboard-75053b3b6e763e6838d29333f3b8119a.js +8 -0
  4. package/assets/viewer/_expo/static/js/web/Haptics-f6186d079cfa560ae6539f8509170bd7.js +3 -0
  5. package/assets/viewer/_expo/static/js/web/{index-0653df7f859e527ded008e610fdf67d9.js → index-d3aef90ae2a56bb0a84ec49fdf285f91.js} +795 -794
  6. package/assets/viewer/_expo/static/js/web/node-fs-e281fe03bd59b43d130d21108e4766f2.js +1 -0
  7. package/assets/viewer/_expo/static/js/web/node-path-838659d5742f2fa30e13a07c1cda0e7a.js +1 -0
  8. package/assets/viewer/embed/assets/{MaskShapeCanvas-DI4BY7W2-DW9iUovV.js → MaskShapeCanvas-DI4BY7W2-C0fGaeA-.js} +1 -1
  9. package/assets/viewer/embed/assets/{MotionZonesSettings-7c3yiT5E-CzRwhaU6.js → MotionZonesSettings-7c3yiT5E-9PMziv1F.js} +1 -1
  10. package/assets/viewer/embed/assets/{PrivacyMaskSettings-PkYs077O-D_lYJ0Lt.js → PrivacyMaskSettings-PkYs077O-DXkWrrAk.js} +1 -1
  11. package/assets/viewer/embed/assets/{SceneMonitorEditor-BvDy3x3k-zFGikTQ4.js → SceneMonitorEditor-BvDy3x3k-B9lXS5ns.js} +1 -1
  12. package/assets/viewer/embed/assets/{index-BSfCOPKT.css → index-BW6iV1GH.css} +1 -1
  13. package/assets/viewer/embed/assets/index-Btt6Cej-.js +115 -0
  14. package/assets/viewer/embed/index.html +2 -2
  15. package/assets/viewer/index.html +1 -1
  16. package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_orchestrator_widgets-DrxNdhAk.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_orchestrator_widgets-NwKb20QX.mjs} +1 -1
  17. package/dist/{hostInit-BVu4vjZv.mjs → hostInit-C7R9w_ZP.mjs} +1 -1
  18. package/dist/remoteEntry.js +1 -1
  19. package/package.json +1 -1
  20. package/assets/viewer/embed/assets/index-G1DWVOwz.js +0 -115
@@ -1,115 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./MotionZonesSettings-7c3yiT5E-CzRwhaU6.js","./MaskShapeCanvas-DI4BY7W2-DW9iUovV.js","./PrivacyMaskSettings-PkYs077O-D_lYJ0Lt.js","./SceneMonitorEditor-BvDy3x3k-zFGikTQ4.js"])))=>i.map(i=>d[i]);
2
- function xP(e,t){for(var n=0;n<t.length;n++){const a=t[n];if(typeof a!="string"&&!Array.isArray(a)){for(const s in a)if(s!=="default"&&!(s in e)){const p=Object.getOwnPropertyDescriptor(a,s);p&&Object.defineProperty(e,s,p.get?p:{enumerable:!0,get:()=>a[s]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))a(s);new MutationObserver(s=>{for(const p of s)if(p.type==="childList")for(const f of p.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&a(f)}).observe(document,{childList:!0,subtree:!0});function n(s){const p={};return s.integrity&&(p.integrity=s.integrity),s.referrerPolicy&&(p.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?p.credentials="include":s.crossOrigin==="anonymous"?p.credentials="omit":p.credentials="same-origin",p}function a(s){if(s.ep)return;s.ep=!0;const p=n(s);fetch(s.href,p)}})();function kP(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Yh={exports:{}},fc={};var Tk;function wP(){if(Tk)return fc;Tk=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(a,s,p){var f=null;if(p!==void 0&&(f=""+p),s.key!==void 0&&(f=""+s.key),"key"in s){p={};for(var m in s)m!=="key"&&(p[m]=s[m])}else p=s;return s=p.ref,{$$typeof:e,type:a,key:f,ref:s!==void 0?s:null,props:p}}return fc.Fragment=t,fc.jsx=n,fc.jsxs=n,fc}var _k;function MP(){return _k||(_k=1,Yh.exports=wP()),Yh.exports}var v=MP(),Xh={exports:{}},hc={},Jh={exports:{}},eg={};var Nk;function CP(){return Nk||(Nk=1,(function(e){function t(Q,oe){var xe=Q.length;Q.push(oe);e:for(;0<xe;){var Ie=xe-1>>>1,he=Q[Ie];if(0<s(he,oe))Q[Ie]=oe,Q[xe]=he,xe=Ie;else break e}}function n(Q){return Q.length===0?null:Q[0]}function a(Q){if(Q.length===0)return null;var oe=Q[0],xe=Q.pop();if(xe!==oe){Q[0]=xe;e:for(var Ie=0,he=Q.length,q=he>>>1;Ie<q;){var W=2*(Ie+1)-1,le=Q[W],be=W+1,ee=Q[be];if(0>s(le,xe))be<he&&0>s(ee,le)?(Q[Ie]=ee,Q[be]=xe,Ie=be):(Q[Ie]=le,Q[W]=xe,Ie=W);else if(be<he&&0>s(ee,xe))Q[Ie]=ee,Q[be]=xe,Ie=be;else break e}}return oe}function s(Q,oe){var xe=Q.sortIndex-oe.sortIndex;return xe!==0?xe:Q.id-oe.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var p=performance;e.unstable_now=function(){return p.now()}}else{var f=Date,m=f.now();e.unstable_now=function(){return f.now()-m}}var h=[],c=[],x=1,M=null,C=3,E=!1,R=!1,_=!1,j=!1,D=typeof setTimeout=="function"?setTimeout:null,z=typeof clearTimeout=="function"?clearTimeout:null,B=typeof setImmediate<"u"?setImmediate:null;function L(Q){for(var oe=n(c);oe!==null;){if(oe.callback===null)a(c);else if(oe.startTime<=Q)a(c),oe.sortIndex=oe.expirationTime,t(h,oe);else break;oe=n(c)}}function G(Q){if(_=!1,L(Q),!R)if(n(h)!==null)R=!0,ae||(ae=!0,Ae());else{var oe=n(c);oe!==null&&ge(G,oe.startTime-Q)}}var ae=!1,V=-1,F=5,fe=-1;function ke(){return j?!0:!(e.unstable_now()-fe<F)}function Me(){if(j=!1,ae){var Q=e.unstable_now();fe=Q;var oe=!0;try{e:{R=!1,_&&(_=!1,z(V),V=-1),E=!0;var xe=C;try{t:{for(L(Q),M=n(h);M!==null&&!(M.expirationTime>Q&&ke());){var Ie=M.callback;if(typeof Ie=="function"){M.callback=null,C=M.priorityLevel;var he=Ie(M.expirationTime<=Q);if(Q=e.unstable_now(),typeof he=="function"){M.callback=he,L(Q),oe=!0;break t}M===n(h)&&a(h),L(Q)}else a(h);M=n(h)}if(M!==null)oe=!0;else{var q=n(c);q!==null&&ge(G,q.startTime-Q),oe=!1}}break e}finally{M=null,C=xe,E=!1}oe=void 0}}finally{oe?Ae():ae=!1}}}var Ae;if(typeof B=="function")Ae=function(){B(Me)};else if(typeof MessageChannel<"u"){var Ee=new MessageChannel,we=Ee.port2;Ee.port1.onmessage=Me,Ae=function(){we.postMessage(null)}}else Ae=function(){D(Me,0)};function ge(Q,oe){V=D(function(){Q(e.unstable_now())},oe)}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(Q){Q.callback=null},e.unstable_forceFrameRate=function(Q){0>Q||125<Q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<Q?Math.floor(1e3/Q):5},e.unstable_getCurrentPriorityLevel=function(){return C},e.unstable_next=function(Q){switch(C){case 1:case 2:case 3:var oe=3;break;default:oe=C}var xe=C;C=oe;try{return Q()}finally{C=xe}},e.unstable_requestPaint=function(){j=!0},e.unstable_runWithPriority=function(Q,oe){switch(Q){case 1:case 2:case 3:case 4:case 5:break;default:Q=3}var xe=C;C=Q;try{return oe()}finally{C=xe}},e.unstable_scheduleCallback=function(Q,oe,xe){var Ie=e.unstable_now();switch(typeof xe=="object"&&xe!==null?(xe=xe.delay,xe=typeof xe=="number"&&0<xe?Ie+xe:Ie):xe=Ie,Q){case 1:var he=-1;break;case 2:he=250;break;case 5:he=1073741823;break;case 4:he=1e4;break;default:he=5e3}return he=xe+he,Q={id:x++,callback:oe,priorityLevel:Q,startTime:xe,expirationTime:he,sortIndex:-1},xe>Ie?(Q.sortIndex=xe,t(c,Q),n(h)===null&&Q===n(c)&&(_?(z(V),V=-1):_=!0,ge(G,xe-Ie))):(Q.sortIndex=he,t(h,Q),R||E||(R=!0,ae||(ae=!0,Ae()))),Q},e.unstable_shouldYield=ke,e.unstable_wrapCallback=function(Q){var oe=C;return function(){var xe=C;C=oe;try{return Q.apply(this,arguments)}finally{C=xe}}}})(eg)),eg}var Ok;function AP(){return Ok||(Ok=1,Jh.exports=CP()),Jh.exports}var tg={exports:{}},it={};var jk;function EP(){if(jk)return it;jk=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),p=Symbol.for("react.consumer"),f=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),c=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),M=Symbol.for("react.activity"),C=Symbol.iterator;function E(q){return q===null||typeof q!="object"?null:(q=C&&q[C]||q["@@iterator"],typeof q=="function"?q:null)}var R={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,j={};function D(q,W,le){this.props=q,this.context=W,this.refs=j,this.updater=le||R}D.prototype.isReactComponent={},D.prototype.setState=function(q,W){if(typeof q!="object"&&typeof q!="function"&&q!=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,q,W,"setState")},D.prototype.forceUpdate=function(q){this.updater.enqueueForceUpdate(this,q,"forceUpdate")};function z(){}z.prototype=D.prototype;function B(q,W,le){this.props=q,this.context=W,this.refs=j,this.updater=le||R}var L=B.prototype=new z;L.constructor=B,_(L,D.prototype),L.isPureReactComponent=!0;var G=Array.isArray;function ae(){}var V={H:null,A:null,T:null,S:null},F=Object.prototype.hasOwnProperty;function fe(q,W,le){var be=le.ref;return{$$typeof:e,type:q,key:W,ref:be!==void 0?be:null,props:le}}function ke(q,W){return fe(q.type,W,q.props)}function Me(q){return typeof q=="object"&&q!==null&&q.$$typeof===e}function Ae(q){var W={"=":"=0",":":"=2"};return"$"+q.replace(/[=:]/g,function(le){return W[le]})}var Ee=/\/+/g;function we(q,W){return typeof q=="object"&&q!==null&&q.key!=null?Ae(""+q.key):W.toString(36)}function ge(q){switch(q.status){case"fulfilled":return q.value;case"rejected":throw q.reason;default:switch(typeof q.status=="string"?q.then(ae,ae):(q.status="pending",q.then(function(W){q.status==="pending"&&(q.status="fulfilled",q.value=W)},function(W){q.status==="pending"&&(q.status="rejected",q.reason=W)})),q.status){case"fulfilled":return q.value;case"rejected":throw q.reason}}throw q}function Q(q,W,le,be,ee){var ve=typeof q;(ve==="undefined"||ve==="boolean")&&(q=null);var De=!1;if(q===null)De=!0;else switch(ve){case"bigint":case"string":case"number":De=!0;break;case"object":switch(q.$$typeof){case e:case t:De=!0;break;case x:return De=q._init,Q(De(q._payload),W,le,be,ee)}}if(De)return ee=ee(q),De=be===""?"."+we(q,0):be,G(ee)?(le="",De!=null&&(le=De.replace(Ee,"$&/")+"/"),Q(ee,W,le,"",function(Te){return Te})):ee!=null&&(Me(ee)&&(ee=ke(ee,le+(ee.key==null||q&&q.key===ee.key?"":(""+ee.key).replace(Ee,"$&/")+"/")+De)),W.push(ee)),1;De=0;var Fe=be===""?".":be+":";if(G(q))for(var re=0;re<q.length;re++)be=q[re],ve=Fe+we(be,re),De+=Q(be,W,le,ve,ee);else if(re=E(q),typeof re=="function")for(q=re.call(q),re=0;!(be=q.next()).done;)be=be.value,ve=Fe+we(be,re++),De+=Q(be,W,le,ve,ee);else if(ve==="object"){if(typeof q.then=="function")return Q(ge(q),W,le,be,ee);throw W=String(q),Error("Objects are not valid as a React child (found: "+(W==="[object Object]"?"object with keys {"+Object.keys(q).join(", ")+"}":W)+"). If you meant to render a collection of children, use an array instead.")}return De}function oe(q,W,le){if(q==null)return q;var be=[],ee=0;return Q(q,be,"","",function(ve){return W.call(le,ve,ee++)}),be}function xe(q){if(q._status===-1){var W=q._result;W=W(),W.then(function(le){(q._status===0||q._status===-1)&&(q._status=1,q._result=le)},function(le){(q._status===0||q._status===-1)&&(q._status=2,q._result=le)}),q._status===-1&&(q._status=0,q._result=W)}if(q._status===1)return q._result.default;throw q._result}var Ie=typeof reportError=="function"?reportError:function(q){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var W=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof q=="object"&&q!==null&&typeof q.message=="string"?String(q.message):String(q),error:q});if(!window.dispatchEvent(W))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",q);return}console.error(q)},he={map:oe,forEach:function(q,W,le){oe(q,function(){W.apply(this,arguments)},le)},count:function(q){var W=0;return oe(q,function(){W++}),W},toArray:function(q){return oe(q,function(W){return W})||[]},only:function(q){if(!Me(q))throw Error("React.Children.only expected to receive a single React element child.");return q}};return it.Activity=M,it.Children=he,it.Component=D,it.Fragment=n,it.Profiler=s,it.PureComponent=B,it.StrictMode=a,it.Suspense=h,it.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=V,it.__COMPILER_RUNTIME={__proto__:null,c:function(q){return V.H.useMemoCache(q)}},it.cache=function(q){return function(){return q.apply(null,arguments)}},it.cacheSignal=function(){return null},it.cloneElement=function(q,W,le){if(q==null)throw Error("The argument must be a React element, but you passed "+q+".");var be=_({},q.props),ee=q.key;if(W!=null)for(ve in W.key!==void 0&&(ee=""+W.key),W)!F.call(W,ve)||ve==="key"||ve==="__self"||ve==="__source"||ve==="ref"&&W.ref===void 0||(be[ve]=W[ve]);var ve=arguments.length-2;if(ve===1)be.children=le;else if(1<ve){for(var De=Array(ve),Fe=0;Fe<ve;Fe++)De[Fe]=arguments[Fe+2];be.children=De}return fe(q.type,ee,be)},it.createContext=function(q){return q={$$typeof:f,_currentValue:q,_currentValue2:q,_threadCount:0,Provider:null,Consumer:null},q.Provider=q,q.Consumer={$$typeof:p,_context:q},q},it.createElement=function(q,W,le){var be,ee={},ve=null;if(W!=null)for(be in W.key!==void 0&&(ve=""+W.key),W)F.call(W,be)&&be!=="key"&&be!=="__self"&&be!=="__source"&&(ee[be]=W[be]);var De=arguments.length-2;if(De===1)ee.children=le;else if(1<De){for(var Fe=Array(De),re=0;re<De;re++)Fe[re]=arguments[re+2];ee.children=Fe}if(q&&q.defaultProps)for(be in De=q.defaultProps,De)ee[be]===void 0&&(ee[be]=De[be]);return fe(q,ve,ee)},it.createRef=function(){return{current:null}},it.forwardRef=function(q){return{$$typeof:m,render:q}},it.isValidElement=Me,it.lazy=function(q){return{$$typeof:x,_payload:{_status:-1,_result:q},_init:xe}},it.memo=function(q,W){return{$$typeof:c,type:q,compare:W===void 0?null:W}},it.startTransition=function(q){var W=V.T,le={};V.T=le;try{var be=q(),ee=V.S;ee!==null&&ee(le,be),typeof be=="object"&&be!==null&&typeof be.then=="function"&&be.then(ae,Ie)}catch(ve){Ie(ve)}finally{W!==null&&le.types!==null&&(W.types=le.types),V.T=W}},it.unstable_useCacheRefresh=function(){return V.H.useCacheRefresh()},it.use=function(q){return V.H.use(q)},it.useActionState=function(q,W,le){return V.H.useActionState(q,W,le)},it.useCallback=function(q,W){return V.H.useCallback(q,W)},it.useContext=function(q){return V.H.useContext(q)},it.useDebugValue=function(){},it.useDeferredValue=function(q,W){return V.H.useDeferredValue(q,W)},it.useEffect=function(q,W){return V.H.useEffect(q,W)},it.useEffectEvent=function(q){return V.H.useEffectEvent(q)},it.useId=function(){return V.H.useId()},it.useImperativeHandle=function(q,W,le){return V.H.useImperativeHandle(q,W,le)},it.useInsertionEffect=function(q,W){return V.H.useInsertionEffect(q,W)},it.useLayoutEffect=function(q,W){return V.H.useLayoutEffect(q,W)},it.useMemo=function(q,W){return V.H.useMemo(q,W)},it.useOptimistic=function(q,W){return V.H.useOptimistic(q,W)},it.useReducer=function(q,W,le){return V.H.useReducer(q,W,le)},it.useRef=function(q){return V.H.useRef(q)},it.useState=function(q){return V.H.useState(q)},it.useSyncExternalStore=function(q,W,le){return V.H.useSyncExternalStore(q,W,le)},it.useTransition=function(){return V.H.useTransition()},it.version="19.2.3",it}var Pk;function gb(){return Pk||(Pk=1,tg.exports=EP()),tg.exports}var ng={exports:{}},Gn={};var Dk;function RP(){if(Dk)return Gn;Dk=1;var e=gb();function t(h){var c="https://react.dev/errors/"+h;if(1<arguments.length){c+="?args[]="+encodeURIComponent(arguments[1]);for(var x=2;x<arguments.length;x++)c+="&args[]="+encodeURIComponent(arguments[x])}return"Minified React error #"+h+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var a={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},s=Symbol.for("react.portal");function p(h,c,x){var M=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:M==null?null:""+M,children:h,containerInfo:c,implementation:x}}var f=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(h,c){if(h==="font")return"";if(typeof c=="string")return c==="use-credentials"?c:""}return Gn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Gn.createPortal=function(h,c){var x=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!c||c.nodeType!==1&&c.nodeType!==9&&c.nodeType!==11)throw Error(t(299));return p(h,c,null,x)},Gn.flushSync=function(h){var c=f.T,x=a.p;try{if(f.T=null,a.p=2,h)return h()}finally{f.T=c,a.p=x,a.d.f()}},Gn.preconnect=function(h,c){typeof h=="string"&&(c?(c=c.crossOrigin,c=typeof c=="string"?c==="use-credentials"?c:"":void 0):c=null,a.d.C(h,c))},Gn.prefetchDNS=function(h){typeof h=="string"&&a.d.D(h)},Gn.preinit=function(h,c){if(typeof h=="string"&&c&&typeof c.as=="string"){var x=c.as,M=m(x,c.crossOrigin),C=typeof c.integrity=="string"?c.integrity:void 0,E=typeof c.fetchPriority=="string"?c.fetchPriority:void 0;x==="style"?a.d.S(h,typeof c.precedence=="string"?c.precedence:void 0,{crossOrigin:M,integrity:C,fetchPriority:E}):x==="script"&&a.d.X(h,{crossOrigin:M,integrity:C,fetchPriority:E,nonce:typeof c.nonce=="string"?c.nonce:void 0})}},Gn.preinitModule=function(h,c){if(typeof h=="string")if(typeof c=="object"&&c!==null){if(c.as==null||c.as==="script"){var x=m(c.as,c.crossOrigin);a.d.M(h,{crossOrigin:x,integrity:typeof c.integrity=="string"?c.integrity:void 0,nonce:typeof c.nonce=="string"?c.nonce:void 0})}}else c==null&&a.d.M(h)},Gn.preload=function(h,c){if(typeof h=="string"&&typeof c=="object"&&c!==null&&typeof c.as=="string"){var x=c.as,M=m(x,c.crossOrigin);a.d.L(h,x,{crossOrigin:M,integrity:typeof c.integrity=="string"?c.integrity:void 0,nonce:typeof c.nonce=="string"?c.nonce:void 0,type:typeof c.type=="string"?c.type:void 0,fetchPriority:typeof c.fetchPriority=="string"?c.fetchPriority:void 0,referrerPolicy:typeof c.referrerPolicy=="string"?c.referrerPolicy:void 0,imageSrcSet:typeof c.imageSrcSet=="string"?c.imageSrcSet:void 0,imageSizes:typeof c.imageSizes=="string"?c.imageSizes:void 0,media:typeof c.media=="string"?c.media:void 0})}},Gn.preloadModule=function(h,c){if(typeof h=="string")if(c){var x=m(c.as,c.crossOrigin);a.d.m(h,{as:typeof c.as=="string"&&c.as!=="script"?c.as:void 0,crossOrigin:x,integrity:typeof c.integrity=="string"?c.integrity:void 0})}else a.d.m(h)},Gn.requestFormReset=function(h){a.d.r(h)},Gn.unstable_batchedUpdates=function(h,c){return h(c)},Gn.useFormState=function(h,c,x){return f.H.useFormState(h,c,x)},Gn.useFormStatus=function(){return f.H.useHostTransitionStatus()},Gn.version="19.2.3",Gn}var zk;function cE(){if(zk)return ng.exports;zk=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),ng.exports=RP(),ng.exports}var Lk;function IP(){if(Lk)return hc;Lk=1;var e=AP(),t=gb(),n=cE();function a(i){var r="https://react.dev/errors/"+i;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)r+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+i+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function p(i){var r=i,u=i;if(i.alternate)for(;r.return;)r=r.return;else{i=r;do r=i,(r.flags&4098)!==0&&(u=r.return),i=r.return;while(i)}return r.tag===3?u:null}function f(i){if(i.tag===13){var r=i.memoizedState;if(r===null&&(i=i.alternate,i!==null&&(r=i.memoizedState)),r!==null)return r.dehydrated}return null}function m(i){if(i.tag===31){var r=i.memoizedState;if(r===null&&(i=i.alternate,i!==null&&(r=i.memoizedState)),r!==null)return r.dehydrated}return null}function h(i){if(p(i)!==i)throw Error(a(188))}function c(i){var r=i.alternate;if(!r){if(r=p(i),r===null)throw Error(a(188));return r!==i?null:i}for(var u=i,g=r;;){var S=u.return;if(S===null)break;var k=S.alternate;if(k===null){if(g=S.return,g!==null){u=g;continue}break}if(S.child===k.child){for(k=S.child;k;){if(k===u)return h(S),i;if(k===g)return h(S),r;k=k.sibling}throw Error(a(188))}if(u.return!==g.return)u=S,g=k;else{for(var I=!1,P=S.child;P;){if(P===u){I=!0,u=S,g=k;break}if(P===g){I=!0,g=S,u=k;break}P=P.sibling}if(!I){for(P=k.child;P;){if(P===u){I=!0,u=k,g=S;break}if(P===g){I=!0,g=k,u=S;break}P=P.sibling}if(!I)throw Error(a(189))}}if(u.alternate!==g)throw Error(a(190))}if(u.tag!==3)throw Error(a(188));return u.stateNode.current===u?i:r}function x(i){var r=i.tag;if(r===5||r===26||r===27||r===6)return i;for(i=i.child;i!==null;){if(r=x(i),r!==null)return r;i=i.sibling}return null}var M=Object.assign,C=Symbol.for("react.element"),E=Symbol.for("react.transitional.element"),R=Symbol.for("react.portal"),_=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),z=Symbol.for("react.consumer"),B=Symbol.for("react.context"),L=Symbol.for("react.forward_ref"),G=Symbol.for("react.suspense"),ae=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),fe=Symbol.for("react.activity"),ke=Symbol.for("react.memo_cache_sentinel"),Me=Symbol.iterator;function Ae(i){return i===null||typeof i!="object"?null:(i=Me&&i[Me]||i["@@iterator"],typeof i=="function"?i:null)}var Ee=Symbol.for("react.client.reference");function we(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===Ee?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case _:return"Fragment";case D:return"Profiler";case j:return"StrictMode";case G:return"Suspense";case ae:return"SuspenseList";case fe:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case R:return"Portal";case B:return i.displayName||"Context";case z:return(i._context.displayName||"Context")+".Consumer";case L:var r=i.render;return i=i.displayName,i||(i=r.displayName||r.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case V:return r=i.displayName||null,r!==null?r:we(i.type)||"Memo";case F:r=i._payload,i=i._init;try{return we(i(r))}catch{}}return null}var ge=Array.isArray,Q=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,xe={pending:!1,data:null,method:null,action:null},Ie=[],he=-1;function q(i){return{current:i}}function W(i){0>he||(i.current=Ie[he],Ie[he]=null,he--)}function le(i,r){he++,Ie[he]=i.current,i.current=r}var be=q(null),ee=q(null),ve=q(null),De=q(null);function Fe(i,r){switch(le(ve,r),le(ee,i),le(be,null),r.nodeType){case 9:case 11:i=(i=r.documentElement)&&(i=i.namespaceURI)?Jx(i):0;break;default:if(i=r.tagName,r=r.namespaceURI)r=Jx(r),i=ek(r,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}W(be),le(be,i)}function re(){W(be),W(ee),W(ve)}function Te(i){i.memoizedState!==null&&le(De,i);var r=be.current,u=ek(r,i.type);r!==u&&(le(ee,i),le(be,u))}function Je(i){ee.current===i&&(W(be),W(ee)),De.current===i&&(W(De),uc._currentValue=xe)}var Ze,It;function _e(i){if(Ze===void 0)try{throw Error()}catch(u){var r=u.stack.trim().match(/\n( *(at )?)/);Ze=r&&r[1]||"",It=-1<u.stack.indexOf(`
3
- at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
4
- `+Ze+i+It}var Ye=!1;function Re(i,r){if(!i||Ye)return"";Ye=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={DetermineComponentFrameRoot:function(){try{if(r){var Se=function(){throw Error()};if(Object.defineProperty(Se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Se,[])}catch(ce){var ie=ce}Reflect.construct(i,[],Se)}else{try{Se.call()}catch(ce){ie=ce}i.call(Se.prototype)}}else{try{throw Error()}catch(ce){ie=ce}(Se=i())&&typeof Se.catch=="function"&&Se.catch(function(){})}}catch(ce){if(ce&&ie&&typeof ce.stack=="string")return[ce.stack,ie.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var S=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");S&&S.configurable&&Object.defineProperty(g.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var k=g.DetermineComponentFrameRoot(),I=k[0],P=k[1];if(I&&P){var H=I.split(`
5
- `),ne=P.split(`
6
- `);for(S=g=0;g<H.length&&!H[g].includes("DetermineComponentFrameRoot");)g++;for(;S<ne.length&&!ne[S].includes("DetermineComponentFrameRoot");)S++;if(g===H.length||S===ne.length)for(g=H.length-1,S=ne.length-1;1<=g&&0<=S&&H[g]!==ne[S];)S--;for(;1<=g&&0<=S;g--,S--)if(H[g]!==ne[S]){if(g!==1||S!==1)do if(g--,S--,0>S||H[g]!==ne[S]){var me=`
7
- `+H[g].replace(" at new "," at ");return i.displayName&&me.includes("<anonymous>")&&(me=me.replace("<anonymous>",i.displayName)),me}while(1<=g&&0<=S);break}}}finally{Ye=!1,Error.prepareStackTrace=u}return(u=i?i.displayName||i.name:"")?_e(u):""}function Qe(i,r){switch(i.tag){case 26:case 27:case 5:return _e(i.type);case 16:return _e("Lazy");case 13:return i.child!==r&&r!==null?_e("Suspense Fallback"):_e("Suspense");case 19:return _e("SuspenseList");case 0:case 15:return Re(i.type,!1);case 11:return Re(i.type.render,!1);case 1:return Re(i.type,!0);case 31:return _e("Activity");default:return""}}function Xe(i){try{var r="",u=null;do r+=Qe(i,u),u=i,i=i.return;while(i);return r}catch(g){return`
8
- Error generating stack: `+g.message+`
9
- `+g.stack}}var Nt=Object.prototype.hasOwnProperty,rt=e.unstable_scheduleCallback,$t=e.unstable_cancelCallback,en=e.unstable_shouldYield,In=e.unstable_requestPaint,pn=e.unstable_now,Hn=e.unstable_getCurrentPriorityLevel,Sa=e.unstable_ImmediatePriority,li=e.unstable_UserBlockingPriority,$n=e.unstable_NormalPriority,ci=e.unstable_LowPriority,et=e.unstable_IdlePriority,mn=e.log,ra=e.unstable_setDisableYieldValue,oa=null,Pn=null;function sa(i){if(typeof mn=="function"&&ra(i),Pn&&typeof Pn.setStrictMode=="function")try{Pn.setStrictMode(oa,i)}catch{}}var Nn=Math.clz32?Math.clz32:Yr,Vo=Math.log,Go=Math.LN2;function Yr(i){return i>>>=0,i===0?32:31-(Vo(i)/Go|0)|0}var Va=256,de=262144,Ce=4194304;function ut(i){var r=i&42;if(r!==0)return r;switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function Zt(i,r,u){var g=i.pendingLanes;if(g===0)return 0;var S=0,k=i.suspendedLanes,I=i.pingedLanes;i=i.warmLanes;var P=g&134217727;return P!==0?(g=P&~k,g!==0?S=ut(g):(I&=P,I!==0?S=ut(I):u||(u=P&~i,u!==0&&(S=ut(u))))):(P=g&~k,P!==0?S=ut(P):I!==0?S=ut(I):u||(u=g&~i,u!==0&&(S=ut(u)))),S===0?0:r!==0&&r!==S&&(r&k)===0&&(k=S&-S,u=r&-r,k>=u||k===32&&(u&4194048)!==0)?r:S}function On(i,r){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&r)===0}function Ei(i,r){switch(i){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Tu(){var i=Ce;return Ce<<=1,(Ce&62914560)===0&&(Ce=4194304),i}function Xr(i){for(var r=[],u=0;31>u;u++)r.push(i);return r}function xa(i,r){i.pendingLanes|=r,r!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function _u(i,r,u,g,S,k){var I=i.pendingLanes;i.pendingLanes=u,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=u,i.entangledLanes&=u,i.errorRecoveryDisabledLanes&=u,i.shellSuspendCounter=0;var P=i.entanglements,H=i.expirationTimes,ne=i.hiddenUpdates;for(u=I&~u;0<u;){var me=31-Nn(u),Se=1<<me;P[me]=0,H[me]=-1;var ie=ne[me];if(ie!==null)for(ne[me]=null,me=0;me<ie.length;me++){var ce=ie[me];ce!==null&&(ce.lane&=-536870913)}u&=~Se}g!==0&&Sl(i,g,0),k!==0&&S===0&&i.tag!==0&&(i.suspendedLanes|=k&~(I&~r))}function Sl(i,r,u){i.pendingLanes|=r,i.suspendedLanes&=~r;var g=31-Nn(r);i.entangledLanes|=r,i.entanglements[g]=i.entanglements[g]|1073741824|u&261930}function Zo(i,r){var u=i.entangledLanes|=r;for(i=i.entanglements;u;){var g=31-Nn(u),S=1<<g;S&r|i[g]&r&&(i[g]|=r),u&=~S}}function Ga(i,r){var u=r&-r;return u=(u&42)!==0?1:Ko(u),(u&(i.suspendedLanes|r))!==0?0:u}function Ko(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function Wo(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function xl(){var i=oe.p;return i!==0?i:(i=window.event,i===void 0?32:wk(i.type))}function kl(i,r){var u=oe.p;try{return oe.p=i,r()}finally{oe.p=u}}var Za=Math.random().toString(36).slice(2),Sn="__reactFiber$"+Za,Qn="__reactProps$"+Za,or="__reactContainer$"+Za,wl="__reactEvents$"+Za,Vm="__reactListeners$"+Za,Gm="__reactHandles$"+Za,Ml="__reactResources$"+Za,Jr="__reactMarker$"+Za;function Yo(i){delete i[Sn],delete i[Qn],delete i[wl],delete i[Vm],delete i[Gm]}function sr(i){var r=i[Sn];if(r)return r;for(var u=i.parentNode;u;){if(r=u[or]||u[Sn]){if(u=r.alternate,r.child!==null||u!==null&&u.child!==null)for(i=sk(i);i!==null;){if(u=i[Sn])return u;i=sk(i)}return r}i=u,u=i.parentNode}return null}function ui(i){if(i=i[Sn]||i[or]){var r=i.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return i}return null}function eo(i){var r=i.tag;if(r===5||r===26||r===27||r===6)return i.stateNode;throw Error(a(33))}function lr(i){var r=i[Ml];return r||(r=i[Ml]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function rn(i){i[Jr]=!0}var Xo=new Set,Cl={};function Ri(i,r){la(i,r),la(i+"Capture",r)}function la(i,r){for(Cl[i]=r,i=0;i<r.length;i++)Xo.add(r[i])}var Zm=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),pe={},ze={};function nt(i){return Nt.call(ze,i)?!0:Nt.call(pe,i)?!1:Zm.test(i)?ze[i]=!0:(pe[i]=!0,!1)}function Ct(i,r,u){if(nt(r))if(u===null)i.removeAttribute(r);else{switch(typeof u){case"undefined":case"function":case"symbol":i.removeAttribute(r);return;case"boolean":var g=r.toLowerCase().slice(0,5);if(g!=="data-"&&g!=="aria-"){i.removeAttribute(r);return}}i.setAttribute(r,""+u)}}function Ve(i,r,u){if(u===null)i.removeAttribute(r);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(r);return}i.setAttribute(r,""+u)}}function St(i,r,u,g){if(g===null)i.removeAttribute(u);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(u);return}i.setAttributeNS(r,u,""+g)}}function Oe(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function dt(i){var r=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function fn(i,r,u){var g=Object.getOwnPropertyDescriptor(i.constructor.prototype,r);if(!i.hasOwnProperty(r)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var S=g.get,k=g.set;return Object.defineProperty(i,r,{configurable:!0,get:function(){return S.call(this)},set:function(I){u=""+I,k.call(this,I)}}),Object.defineProperty(i,r,{enumerable:g.enumerable}),{getValue:function(){return u},setValue:function(I){u=""+I},stopTracking:function(){i._valueTracker=null,delete i[r]}}}}function xn(i){if(!i._valueTracker){var r=dt(i)?"checked":"value";i._valueTracker=fn(i,r,""+i[r])}}function Ge(i){if(!i)return!1;var r=i._valueTracker;if(!r)return!0;var u=r.getValue(),g="";return i&&(g=dt(i)?i.checked?"true":"false":i.value),i=g,i!==u?(r.setValue(i),!0):!1}function on(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var hn=/[\n"\\]/g;function Qt(i){return i.replace(hn,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function Vn(i,r,u,g,S,k,I,P){i.name="",I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"?i.type=I:i.removeAttribute("type"),r!=null?I==="number"?(r===0&&i.value===""||i.value!=r)&&(i.value=""+Oe(r)):i.value!==""+Oe(r)&&(i.value=""+Oe(r)):I!=="submit"&&I!=="reset"||i.removeAttribute("value"),r!=null?Ot(i,I,Oe(r)):u!=null?Ot(i,I,Oe(u)):g!=null&&i.removeAttribute("value"),S==null&&k!=null&&(i.defaultChecked=!!k),S!=null&&(i.checked=S&&typeof S!="function"&&typeof S!="symbol"),P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?i.name=""+Oe(P):i.removeAttribute("name")}function sn(i,r,u,g,S,k,I,P){if(k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(i.type=k),r!=null||u!=null){if(!(k!=="submit"&&k!=="reset"||r!=null)){xn(i);return}u=u!=null?""+Oe(u):"",r=r!=null?""+Oe(r):u,P||r===i.value||(i.value=r),i.defaultValue=r}g=g??S,g=typeof g!="function"&&typeof g!="symbol"&&!!g,i.checked=P?i.checked:!!g,i.defaultChecked=!!g,I!=null&&typeof I!="function"&&typeof I!="symbol"&&typeof I!="boolean"&&(i.name=I),xn(i)}function Ot(i,r,u){r==="number"&&on(i.ownerDocument)===i||i.defaultValue===""+u||(i.defaultValue=""+u)}function Dn(i,r,u,g){if(i=i.options,r){r={};for(var S=0;S<u.length;S++)r["$"+u[S]]=!0;for(u=0;u<i.length;u++)S=r.hasOwnProperty("$"+i[u].value),i[u].selected!==S&&(i[u].selected=S),S&&g&&(i[u].defaultSelected=!0)}else{for(u=""+Oe(u),r=null,S=0;S<i.length;S++){if(i[S].value===u){i[S].selected=!0,g&&(i[S].defaultSelected=!0);return}r!==null||i[S].disabled||(r=i[S])}r!==null&&(r.selected=!0)}}function ot(i,r,u){if(r!=null&&(r=""+Oe(r),r!==i.value&&(i.value=r),u==null)){i.defaultValue!==r&&(i.defaultValue=r);return}i.defaultValue=u!=null?""+Oe(u):""}function Ka(i,r,u,g){if(r==null){if(g!=null){if(u!=null)throw Error(a(92));if(ge(g)){if(1<g.length)throw Error(a(93));g=g[0]}u=g}u==null&&(u=""),r=u}u=Oe(r),i.defaultValue=u,g=i.textContent,g===u&&g!==""&&g!==null&&(i.value=g),xn(i)}function Kn(i,r){if(r){var u=i.firstChild;if(u&&u===i.lastChild&&u.nodeType===3){u.nodeValue=r;return}}i.textContent=r}var ka=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function at(i,r,u){var g=r.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?g?i.setProperty(r,""):r==="float"?i.cssFloat="":i[r]="":g?i.setProperty(r,u):typeof u!="number"||u===0||ka.has(r)?r==="float"?i.cssFloat=u:i[r]=(""+u).trim():i[r]=u+"px"}function wt(i,r,u){if(r!=null&&typeof r!="object")throw Error(a(62));if(i=i.style,u!=null){for(var g in u)!u.hasOwnProperty(g)||r!=null&&r.hasOwnProperty(g)||(g.indexOf("--")===0?i.setProperty(g,""):g==="float"?i.cssFloat="":i[g]="");for(var S in r)g=r[S],r.hasOwnProperty(S)&&u[S]!==g&&at(i,S,g)}else for(var k in r)r.hasOwnProperty(k)&&at(i,k,r[k])}function Wn(i){if(i.indexOf("-")===-1)return!1;switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Jo=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Al=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Ii(i){return Al.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function Yn(){}var di=null;function to(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var es=null,ts=null;function X0(i){var r=ui(i);if(r&&(i=r.stateNode)){var u=i[Qn]||null;e:switch(i=r.stateNode,r.type){case"input":if(Vn(i,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),r=u.name,u.type==="radio"&&r!=null){for(u=i;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+Qt(""+r)+'"][type="radio"]'),r=0;r<u.length;r++){var g=u[r];if(g!==i&&g.form===i.form){var S=g[Qn]||null;if(!S)throw Error(a(90));Vn(g,S.value,S.defaultValue,S.defaultValue,S.checked,S.defaultChecked,S.type,S.name)}}for(r=0;r<u.length;r++)g=u[r],g.form===i.form&&Ge(g)}break e;case"textarea":ot(i,u.value,u.defaultValue);break e;case"select":r=u.value,r!=null&&Dn(i,!!u.multiple,r,!1)}}}var Km=!1;function J0(i,r,u){if(Km)return i(r,u);Km=!0;try{var g=i(r);return g}finally{if(Km=!1,(es!==null||ts!==null)&&(yd(),es&&(r=es,i=ts,ts=es=null,X0(r),i)))for(r=0;r<i.length;r++)X0(i[r])}}function El(i,r){var u=i.stateNode;if(u===null)return null;var g=u[Qn]||null;if(g===null)return null;u=g[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(i=i.type,g=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!g;break e;default:i=!1}if(i)return null;if(u&&typeof u!="function")throw Error(a(231,r,typeof u));return u}var Ti=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Wm=!1;if(Ti)try{var Rl={};Object.defineProperty(Rl,"passive",{get:function(){Wm=!0}}),window.addEventListener("test",Rl,Rl),window.removeEventListener("test",Rl,Rl)}catch{Wm=!1}var cr=null,Ym=null,Nu=null;function e1(){if(Nu)return Nu;var i,r=Ym,u=r.length,g,S="value"in cr?cr.value:cr.textContent,k=S.length;for(i=0;i<u&&r[i]===S[i];i++);var I=u-i;for(g=1;g<=I&&r[u-g]===S[k-g];g++);return Nu=S.slice(i,1<g?1-g:void 0)}function Ou(i){var r=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&r===13&&(i=13)):i=r,i===10&&(i=13),32<=i||i===13?i:0}function ju(){return!0}function t1(){return!1}function ca(i){function r(u,g,S,k,I){this._reactName=u,this._targetInst=S,this.type=g,this.nativeEvent=k,this.target=I,this.currentTarget=null;for(var P in i)i.hasOwnProperty(P)&&(u=i[P],this[P]=u?u(k):k[P]);return this.isDefaultPrevented=(k.defaultPrevented!=null?k.defaultPrevented:k.returnValue===!1)?ju:t1,this.isPropagationStopped=t1,this}return M(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=ju)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=ju)},persist:function(){},isPersistent:ju}),r}var no={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Pu=ca(no),Il=M({},no,{view:0,detail:0}),bO=ca(Il),Xm,Jm,Tl,Du=M({},Il,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:tf,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==Tl&&(Tl&&i.type==="mousemove"?(Xm=i.screenX-Tl.screenX,Jm=i.screenY-Tl.screenY):Jm=Xm=0,Tl=i),Xm)},movementY:function(i){return"movementY"in i?i.movementY:Jm}}),n1=ca(Du),SO=M({},Du,{dataTransfer:0}),xO=ca(SO),kO=M({},Il,{relatedTarget:0}),ef=ca(kO),wO=M({},no,{animationName:0,elapsedTime:0,pseudoElement:0}),MO=ca(wO),CO=M({},no,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),AO=ca(CO),EO=M({},no,{data:0}),a1=ca(EO),RO={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},IO={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},TO={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function _O(i){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(i):(i=TO[i])?!!r[i]:!1}function tf(){return _O}var NO=M({},Il,{key:function(i){if(i.key){var r=RO[i.key]||i.key;if(r!=="Unidentified")return r}return i.type==="keypress"?(i=Ou(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?IO[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:tf,charCode:function(i){return i.type==="keypress"?Ou(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Ou(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),OO=ca(NO),jO=M({},Du,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),i1=ca(jO),PO=M({},Il,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:tf}),DO=ca(PO),zO=M({},no,{propertyName:0,elapsedTime:0,pseudoElement:0}),LO=ca(zO),qO=M({},Du,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),BO=ca(qO),FO=M({},no,{newState:0,oldState:0}),UO=ca(FO),HO=[9,13,27,32],nf=Ti&&"CompositionEvent"in window,_l=null;Ti&&"documentMode"in document&&(_l=document.documentMode);var $O=Ti&&"TextEvent"in window&&!_l,r1=Ti&&(!nf||_l&&8<_l&&11>=_l),o1=" ",s1=!1;function l1(i,r){switch(i){case"keyup":return HO.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function c1(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var ns=!1;function QO(i,r){switch(i){case"compositionend":return c1(r);case"keypress":return r.which!==32?null:(s1=!0,o1);case"textInput":return i=r.data,i===o1&&s1?null:i;default:return null}}function VO(i,r){if(ns)return i==="compositionend"||!nf&&l1(i,r)?(i=e1(),Nu=Ym=cr=null,ns=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return r1&&r.locale!=="ko"?null:r.data;default:return null}}var GO={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function u1(i){var r=i&&i.nodeName&&i.nodeName.toLowerCase();return r==="input"?!!GO[i.type]:r==="textarea"}function d1(i,r,u,g){es?ts?ts.push(g):ts=[g]:es=g,r=Cd(r,"onChange"),0<r.length&&(u=new Pu("onChange","change",null,u,g),i.push({event:u,listeners:r}))}var Nl=null,Ol=null;function ZO(i){Gx(i,0)}function zu(i){var r=eo(i);if(Ge(r))return i}function p1(i,r){if(i==="change")return r}var m1=!1;if(Ti){var af;if(Ti){var rf="oninput"in document;if(!rf){var f1=document.createElement("div");f1.setAttribute("oninput","return;"),rf=typeof f1.oninput=="function"}af=rf}else af=!1;m1=af&&(!document.documentMode||9<document.documentMode)}function h1(){Nl&&(Nl.detachEvent("onpropertychange",g1),Ol=Nl=null)}function g1(i){if(i.propertyName==="value"&&zu(Ol)){var r=[];d1(r,Ol,i,to(i)),J0(ZO,r)}}function KO(i,r,u){i==="focusin"?(h1(),Nl=r,Ol=u,Nl.attachEvent("onpropertychange",g1)):i==="focusout"&&h1()}function WO(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return zu(Ol)}function YO(i,r){if(i==="click")return zu(r)}function XO(i,r){if(i==="input"||i==="change")return zu(r)}function JO(i,r){return i===r&&(i!==0||1/i===1/r)||i!==i&&r!==r}var wa=typeof Object.is=="function"?Object.is:JO;function jl(i,r){if(wa(i,r))return!0;if(typeof i!="object"||i===null||typeof r!="object"||r===null)return!1;var u=Object.keys(i),g=Object.keys(r);if(u.length!==g.length)return!1;for(g=0;g<u.length;g++){var S=u[g];if(!Nt.call(r,S)||!wa(i[S],r[S]))return!1}return!0}function v1(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function y1(i,r){var u=v1(i);i=0;for(var g;u;){if(u.nodeType===3){if(g=i+u.textContent.length,i<=r&&g>=r)return{node:u,offset:r-i};i=g}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=v1(u)}}function b1(i,r){return i&&r?i===r?!0:i&&i.nodeType===3?!1:r&&r.nodeType===3?b1(i,r.parentNode):"contains"in i?i.contains(r):i.compareDocumentPosition?!!(i.compareDocumentPosition(r)&16):!1:!1}function S1(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var r=on(i.document);r instanceof i.HTMLIFrameElement;){try{var u=typeof r.contentWindow.location.href=="string"}catch{u=!1}if(u)i=r.contentWindow;else break;r=on(i.document)}return r}function of(i){var r=i&&i.nodeName&&i.nodeName.toLowerCase();return r&&(r==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||r==="textarea"||i.contentEditable==="true")}var ej=Ti&&"documentMode"in document&&11>=document.documentMode,as=null,sf=null,Pl=null,lf=!1;function x1(i,r,u){var g=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;lf||as==null||as!==on(g)||(g=as,"selectionStart"in g&&of(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),Pl&&jl(Pl,g)||(Pl=g,g=Cd(sf,"onSelect"),0<g.length&&(r=new Pu("onSelect","select",null,r,u),i.push({event:r,listeners:g}),r.target=as)))}function ao(i,r){var u={};return u[i.toLowerCase()]=r.toLowerCase(),u["Webkit"+i]="webkit"+r,u["Moz"+i]="moz"+r,u}var is={animationend:ao("Animation","AnimationEnd"),animationiteration:ao("Animation","AnimationIteration"),animationstart:ao("Animation","AnimationStart"),transitionrun:ao("Transition","TransitionRun"),transitionstart:ao("Transition","TransitionStart"),transitioncancel:ao("Transition","TransitionCancel"),transitionend:ao("Transition","TransitionEnd")},cf={},k1={};Ti&&(k1=document.createElement("div").style,"AnimationEvent"in window||(delete is.animationend.animation,delete is.animationiteration.animation,delete is.animationstart.animation),"TransitionEvent"in window||delete is.transitionend.transition);function io(i){if(cf[i])return cf[i];if(!is[i])return i;var r=is[i],u;for(u in r)if(r.hasOwnProperty(u)&&u in k1)return cf[i]=r[u];return i}var w1=io("animationend"),M1=io("animationiteration"),C1=io("animationstart"),tj=io("transitionrun"),nj=io("transitionstart"),aj=io("transitioncancel"),A1=io("transitionend"),E1=new Map,uf="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");uf.push("scrollEnd");function Wa(i,r){E1.set(i,r),Ri(r,[i])}var Lu=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},Pa=[],rs=0,df=0;function qu(){for(var i=rs,r=df=rs=0;r<i;){var u=Pa[r];Pa[r++]=null;var g=Pa[r];Pa[r++]=null;var S=Pa[r];Pa[r++]=null;var k=Pa[r];if(Pa[r++]=null,g!==null&&S!==null){var I=g.pending;I===null?S.next=S:(S.next=I.next,I.next=S),g.pending=S}k!==0&&R1(u,S,k)}}function Bu(i,r,u,g){Pa[rs++]=i,Pa[rs++]=r,Pa[rs++]=u,Pa[rs++]=g,df|=g,i.lanes|=g,i=i.alternate,i!==null&&(i.lanes|=g)}function pf(i,r,u,g){return Bu(i,r,u,g),Fu(i)}function ro(i,r){return Bu(i,null,null,r),Fu(i)}function R1(i,r,u){i.lanes|=u;var g=i.alternate;g!==null&&(g.lanes|=u);for(var S=!1,k=i.return;k!==null;)k.childLanes|=u,g=k.alternate,g!==null&&(g.childLanes|=u),k.tag===22&&(i=k.stateNode,i===null||i._visibility&1||(S=!0)),i=k,k=k.return;return i.tag===3?(k=i.stateNode,S&&r!==null&&(S=31-Nn(u),i=k.hiddenUpdates,g=i[S],g===null?i[S]=[r]:g.push(r),r.lane=u|536870912),k):null}function Fu(i){if(50<ac)throw ac=0,xh=null,Error(a(185));for(var r=i.return;r!==null;)i=r,r=i.return;return i.tag===3?i.stateNode:null}var os={};function ij(i,r,u,g){this.tag=i,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ma(i,r,u,g){return new ij(i,r,u,g)}function mf(i){return i=i.prototype,!(!i||!i.isReactComponent)}function _i(i,r){var u=i.alternate;return u===null?(u=Ma(i.tag,r,i.key,i.mode),u.elementType=i.elementType,u.type=i.type,u.stateNode=i.stateNode,u.alternate=i,i.alternate=u):(u.pendingProps=r,u.type=i.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=i.flags&65011712,u.childLanes=i.childLanes,u.lanes=i.lanes,u.child=i.child,u.memoizedProps=i.memoizedProps,u.memoizedState=i.memoizedState,u.updateQueue=i.updateQueue,r=i.dependencies,u.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},u.sibling=i.sibling,u.index=i.index,u.ref=i.ref,u.refCleanup=i.refCleanup,u}function I1(i,r){i.flags&=65011714;var u=i.alternate;return u===null?(i.childLanes=0,i.lanes=r,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=u.childLanes,i.lanes=u.lanes,i.child=u.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=u.memoizedProps,i.memoizedState=u.memoizedState,i.updateQueue=u.updateQueue,i.type=u.type,r=u.dependencies,i.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),i}function Uu(i,r,u,g,S,k){var I=0;if(g=i,typeof i=="function")mf(i)&&(I=1);else if(typeof i=="string")I=cP(i,u,be.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case fe:return i=Ma(31,u,r,S),i.elementType=fe,i.lanes=k,i;case _:return oo(u.children,S,k,r);case j:I=8,S|=24;break;case D:return i=Ma(12,u,r,S|2),i.elementType=D,i.lanes=k,i;case G:return i=Ma(13,u,r,S),i.elementType=G,i.lanes=k,i;case ae:return i=Ma(19,u,r,S),i.elementType=ae,i.lanes=k,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case B:I=10;break e;case z:I=9;break e;case L:I=11;break e;case V:I=14;break e;case F:I=16,g=null;break e}I=29,u=Error(a(130,i===null?"null":typeof i,"")),g=null}return r=Ma(I,u,r,S),r.elementType=i,r.type=g,r.lanes=k,r}function oo(i,r,u,g){return i=Ma(7,i,g,r),i.lanes=u,i}function ff(i,r,u){return i=Ma(6,i,null,r),i.lanes=u,i}function T1(i){var r=Ma(18,null,null,0);return r.stateNode=i,r}function hf(i,r,u){return r=Ma(4,i.children!==null?i.children:[],i.key,r),r.lanes=u,r.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},r}var _1=new WeakMap;function Da(i,r){if(typeof i=="object"&&i!==null){var u=_1.get(i);return u!==void 0?u:(r={value:i,source:r,stack:Xe(r)},_1.set(i,r),r)}return{value:i,source:r,stack:Xe(r)}}var ss=[],ls=0,Hu=null,Dl=0,za=[],La=0,ur=null,pi=1,mi="";function Ni(i,r){ss[ls++]=Dl,ss[ls++]=Hu,Hu=i,Dl=r}function N1(i,r,u){za[La++]=pi,za[La++]=mi,za[La++]=ur,ur=i;var g=pi;i=mi;var S=32-Nn(g)-1;g&=~(1<<S),u+=1;var k=32-Nn(r)+S;if(30<k){var I=S-S%5;k=(g&(1<<I)-1).toString(32),g>>=I,S-=I,pi=1<<32-Nn(r)+S|u<<S|g,mi=k+i}else pi=1<<k|u<<S|g,mi=i}function gf(i){i.return!==null&&(Ni(i,1),N1(i,1,0))}function vf(i){for(;i===Hu;)Hu=ss[--ls],ss[ls]=null,Dl=ss[--ls],ss[ls]=null;for(;i===ur;)ur=za[--La],za[La]=null,mi=za[--La],za[La]=null,pi=za[--La],za[La]=null}function O1(i,r){za[La++]=pi,za[La++]=mi,za[La++]=ur,pi=r.id,mi=r.overflow,ur=i}var zn=null,Kt=null,xt=!1,dr=null,qa=!1,yf=Error(a(519));function pr(i){var r=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw zl(Da(r,i)),yf}function j1(i){var r=i.stateNode,u=i.type,g=i.memoizedProps;switch(r[Sn]=i,r[Qn]=g,u){case"dialog":ft("cancel",r),ft("close",r);break;case"iframe":case"object":case"embed":ft("load",r);break;case"video":case"audio":for(u=0;u<rc.length;u++)ft(rc[u],r);break;case"source":ft("error",r);break;case"img":case"image":case"link":ft("error",r),ft("load",r);break;case"details":ft("toggle",r);break;case"input":ft("invalid",r),sn(r,g.value,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name,!0);break;case"select":ft("invalid",r);break;case"textarea":ft("invalid",r),Ka(r,g.value,g.defaultValue,g.children)}u=g.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||r.textContent===""+u||g.suppressHydrationWarning===!0||Yx(r.textContent,u)?(g.popover!=null&&(ft("beforetoggle",r),ft("toggle",r)),g.onScroll!=null&&ft("scroll",r),g.onScrollEnd!=null&&ft("scrollend",r),g.onClick!=null&&(r.onclick=Yn),r=!0):r=!1,r||pr(i,!0)}function P1(i){for(zn=i.return;zn;)switch(zn.tag){case 5:case 31:case 13:qa=!1;return;case 27:case 3:qa=!0;return;default:zn=zn.return}}function cs(i){if(i!==zn)return!1;if(!xt)return P1(i),xt=!0,!1;var r=i.tag,u;if((u=r!==3&&r!==27)&&((u=r===5)&&(u=i.type,u=!(u!=="form"&&u!=="button")||Dh(i.type,i.memoizedProps)),u=!u),u&&Kt&&pr(i),P1(i),r===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(a(317));Kt=ok(i)}else if(r===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(a(317));Kt=ok(i)}else r===27?(r=Kt,Ar(i.type)?(i=Fh,Fh=null,Kt=i):Kt=r):Kt=zn?Fa(i.stateNode.nextSibling):null;return!0}function so(){Kt=zn=null,xt=!1}function bf(){var i=dr;return i!==null&&(ma===null?ma=i:ma.push.apply(ma,i),dr=null),i}function zl(i){dr===null?dr=[i]:dr.push(i)}var Sf=q(null),lo=null,Oi=null;function mr(i,r,u){le(Sf,r._currentValue),r._currentValue=u}function ji(i){i._currentValue=Sf.current,W(Sf)}function xf(i,r,u){for(;i!==null;){var g=i.alternate;if((i.childLanes&r)!==r?(i.childLanes|=r,g!==null&&(g.childLanes|=r)):g!==null&&(g.childLanes&r)!==r&&(g.childLanes|=r),i===u)break;i=i.return}}function kf(i,r,u,g){var S=i.child;for(S!==null&&(S.return=i);S!==null;){var k=S.dependencies;if(k!==null){var I=S.child;k=k.firstContext;e:for(;k!==null;){var P=k;k=S;for(var H=0;H<r.length;H++)if(P.context===r[H]){k.lanes|=u,P=k.alternate,P!==null&&(P.lanes|=u),xf(k.return,u,i),g||(I=null);break e}k=P.next}}else if(S.tag===18){if(I=S.return,I===null)throw Error(a(341));I.lanes|=u,k=I.alternate,k!==null&&(k.lanes|=u),xf(I,u,i),I=null}else I=S.child;if(I!==null)I.return=S;else for(I=S;I!==null;){if(I===i){I=null;break}if(S=I.sibling,S!==null){S.return=I.return,I=S;break}I=I.return}S=I}}function us(i,r,u,g){i=null;for(var S=r,k=!1;S!==null;){if(!k){if((S.flags&524288)!==0)k=!0;else if((S.flags&262144)!==0)break}if(S.tag===10){var I=S.alternate;if(I===null)throw Error(a(387));if(I=I.memoizedProps,I!==null){var P=S.type;wa(S.pendingProps.value,I.value)||(i!==null?i.push(P):i=[P])}}else if(S===De.current){if(I=S.alternate,I===null)throw Error(a(387));I.memoizedState.memoizedState!==S.memoizedState.memoizedState&&(i!==null?i.push(uc):i=[uc])}S=S.return}i!==null&&kf(r,i,u,g),r.flags|=262144}function $u(i){for(i=i.firstContext;i!==null;){if(!wa(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function co(i){lo=i,Oi=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function Ln(i){return D1(lo,i)}function Qu(i,r){return lo===null&&co(i),D1(i,r)}function D1(i,r){var u=r._currentValue;if(r={context:r,memoizedValue:u,next:null},Oi===null){if(i===null)throw Error(a(308));Oi=r,i.dependencies={lanes:0,firstContext:r},i.flags|=524288}else Oi=Oi.next=r;return u}var rj=typeof AbortController<"u"?AbortController:function(){var i=[],r=this.signal={aborted:!1,addEventListener:function(u,g){i.push(g)}};this.abort=function(){r.aborted=!0,i.forEach(function(u){return u()})}},oj=e.unstable_scheduleCallback,sj=e.unstable_NormalPriority,kn={$$typeof:B,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function wf(){return{controller:new rj,data:new Map,refCount:0}}function Ll(i){i.refCount--,i.refCount===0&&oj(sj,function(){i.controller.abort()})}var ql=null,Mf=0,ds=0,ps=null;function lj(i,r){if(ql===null){var u=ql=[];Mf=0,ds=Eh(),ps={status:"pending",value:void 0,then:function(g){u.push(g)}}}return Mf++,r.then(z1,z1),r}function z1(){if(--Mf===0&&ql!==null){ps!==null&&(ps.status="fulfilled");var i=ql;ql=null,ds=0,ps=null;for(var r=0;r<i.length;r++)(0,i[r])()}}function cj(i,r){var u=[],g={status:"pending",value:null,reason:null,then:function(S){u.push(S)}};return i.then(function(){g.status="fulfilled",g.value=r;for(var S=0;S<u.length;S++)(0,u[S])(r)},function(S){for(g.status="rejected",g.reason=S,S=0;S<u.length;S++)(0,u[S])(void 0)}),g}var L1=Q.S;Q.S=function(i,r){xx=pn(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&lj(i,r),L1!==null&&L1(i,r)};var uo=q(null);function Cf(){var i=uo.current;return i!==null?i:Vt.pooledCache}function Vu(i,r){r===null?le(uo,uo.current):le(uo,r.pool)}function q1(){var i=Cf();return i===null?null:{parent:kn._currentValue,pool:i}}var ms=Error(a(460)),Af=Error(a(474)),Gu=Error(a(542)),Zu={then:function(){}};function B1(i){return i=i.status,i==="fulfilled"||i==="rejected"}function F1(i,r,u){switch(u=i[u],u===void 0?i.push(r):u!==r&&(r.then(Yn,Yn),r=u),r.status){case"fulfilled":return r.value;case"rejected":throw i=r.reason,H1(i),i;default:if(typeof r.status=="string")r.then(Yn,Yn);else{if(i=Vt,i!==null&&100<i.shellSuspendCounter)throw Error(a(482));i=r,i.status="pending",i.then(function(g){if(r.status==="pending"){var S=r;S.status="fulfilled",S.value=g}},function(g){if(r.status==="pending"){var S=r;S.status="rejected",S.reason=g}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw i=r.reason,H1(i),i}throw mo=r,ms}}function po(i){try{var r=i._init;return r(i._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(mo=u,ms):u}}var mo=null;function U1(){if(mo===null)throw Error(a(459));var i=mo;return mo=null,i}function H1(i){if(i===ms||i===Gu)throw Error(a(483))}var fs=null,Bl=0;function Ku(i){var r=Bl;return Bl+=1,fs===null&&(fs=[]),F1(fs,i,r)}function Fl(i,r){r=r.props.ref,i.ref=r!==void 0?r:null}function Wu(i,r){throw r.$$typeof===C?Error(a(525)):(i=Object.prototype.toString.call(r),Error(a(31,i==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":i)))}function $1(i){function r(Y,K){if(i){var te=Y.deletions;te===null?(Y.deletions=[K],Y.flags|=16):te.push(K)}}function u(Y,K){if(!i)return null;for(;K!==null;)r(Y,K),K=K.sibling;return null}function g(Y){for(var K=new Map;Y!==null;)Y.key!==null?K.set(Y.key,Y):K.set(Y.index,Y),Y=Y.sibling;return K}function S(Y,K){return Y=_i(Y,K),Y.index=0,Y.sibling=null,Y}function k(Y,K,te){return Y.index=te,i?(te=Y.alternate,te!==null?(te=te.index,te<K?(Y.flags|=67108866,K):te):(Y.flags|=67108866,K)):(Y.flags|=1048576,K)}function I(Y){return i&&Y.alternate===null&&(Y.flags|=67108866),Y}function P(Y,K,te,ye){return K===null||K.tag!==6?(K=ff(te,Y.mode,ye),K.return=Y,K):(K=S(K,te),K.return=Y,K)}function H(Y,K,te,ye){var $e=te.type;return $e===_?me(Y,K,te.props.children,ye,te.key):K!==null&&(K.elementType===$e||typeof $e=="object"&&$e!==null&&$e.$$typeof===F&&po($e)===K.type)?(K=S(K,te.props),Fl(K,te),K.return=Y,K):(K=Uu(te.type,te.key,te.props,null,Y.mode,ye),Fl(K,te),K.return=Y,K)}function ne(Y,K,te,ye){return K===null||K.tag!==4||K.stateNode.containerInfo!==te.containerInfo||K.stateNode.implementation!==te.implementation?(K=hf(te,Y.mode,ye),K.return=Y,K):(K=S(K,te.children||[]),K.return=Y,K)}function me(Y,K,te,ye,$e){return K===null||K.tag!==7?(K=oo(te,Y.mode,ye,$e),K.return=Y,K):(K=S(K,te),K.return=Y,K)}function Se(Y,K,te){if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return K=ff(""+K,Y.mode,te),K.return=Y,K;if(typeof K=="object"&&K!==null){switch(K.$$typeof){case E:return te=Uu(K.type,K.key,K.props,null,Y.mode,te),Fl(te,K),te.return=Y,te;case R:return K=hf(K,Y.mode,te),K.return=Y,K;case F:return K=po(K),Se(Y,K,te)}if(ge(K)||Ae(K))return K=oo(K,Y.mode,te,null),K.return=Y,K;if(typeof K.then=="function")return Se(Y,Ku(K),te);if(K.$$typeof===B)return Se(Y,Qu(Y,K),te);Wu(Y,K)}return null}function ie(Y,K,te,ye){var $e=K!==null?K.key:null;if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return $e!==null?null:P(Y,K,""+te,ye);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case E:return te.key===$e?H(Y,K,te,ye):null;case R:return te.key===$e?ne(Y,K,te,ye):null;case F:return te=po(te),ie(Y,K,te,ye)}if(ge(te)||Ae(te))return $e!==null?null:me(Y,K,te,ye,null);if(typeof te.then=="function")return ie(Y,K,Ku(te),ye);if(te.$$typeof===B)return ie(Y,K,Qu(Y,te),ye);Wu(Y,te)}return null}function ce(Y,K,te,ye,$e){if(typeof ye=="string"&&ye!==""||typeof ye=="number"||typeof ye=="bigint")return Y=Y.get(te)||null,P(K,Y,""+ye,$e);if(typeof ye=="object"&&ye!==null){switch(ye.$$typeof){case E:return Y=Y.get(ye.key===null?te:ye.key)||null,H(K,Y,ye,$e);case R:return Y=Y.get(ye.key===null?te:ye.key)||null,ne(K,Y,ye,$e);case F:return ye=po(ye),ce(Y,K,te,ye,$e)}if(ge(ye)||Ae(ye))return Y=Y.get(te)||null,me(K,Y,ye,$e,null);if(typeof ye.then=="function")return ce(Y,K,te,Ku(ye),$e);if(ye.$$typeof===B)return ce(Y,K,te,Qu(K,ye),$e);Wu(K,ye)}return null}function Be(Y,K,te,ye){for(var $e=null,At=null,Ue=K,ct=K=0,yt=null;Ue!==null&&ct<te.length;ct++){Ue.index>ct?(yt=Ue,Ue=null):yt=Ue.sibling;var Et=ie(Y,Ue,te[ct],ye);if(Et===null){Ue===null&&(Ue=yt);break}i&&Ue&&Et.alternate===null&&r(Y,Ue),K=k(Et,K,ct),At===null?$e=Et:At.sibling=Et,At=Et,Ue=yt}if(ct===te.length)return u(Y,Ue),xt&&Ni(Y,ct),$e;if(Ue===null){for(;ct<te.length;ct++)Ue=Se(Y,te[ct],ye),Ue!==null&&(K=k(Ue,K,ct),At===null?$e=Ue:At.sibling=Ue,At=Ue);return xt&&Ni(Y,ct),$e}for(Ue=g(Ue);ct<te.length;ct++)yt=ce(Ue,Y,ct,te[ct],ye),yt!==null&&(i&&yt.alternate!==null&&Ue.delete(yt.key===null?ct:yt.key),K=k(yt,K,ct),At===null?$e=yt:At.sibling=yt,At=yt);return i&&Ue.forEach(function(_r){return r(Y,_r)}),xt&&Ni(Y,ct),$e}function Ke(Y,K,te,ye){if(te==null)throw Error(a(151));for(var $e=null,At=null,Ue=K,ct=K=0,yt=null,Et=te.next();Ue!==null&&!Et.done;ct++,Et=te.next()){Ue.index>ct?(yt=Ue,Ue=null):yt=Ue.sibling;var _r=ie(Y,Ue,Et.value,ye);if(_r===null){Ue===null&&(Ue=yt);break}i&&Ue&&_r.alternate===null&&r(Y,Ue),K=k(_r,K,ct),At===null?$e=_r:At.sibling=_r,At=_r,Ue=yt}if(Et.done)return u(Y,Ue),xt&&Ni(Y,ct),$e;if(Ue===null){for(;!Et.done;ct++,Et=te.next())Et=Se(Y,Et.value,ye),Et!==null&&(K=k(Et,K,ct),At===null?$e=Et:At.sibling=Et,At=Et);return xt&&Ni(Y,ct),$e}for(Ue=g(Ue);!Et.done;ct++,Et=te.next())Et=ce(Ue,Y,ct,Et.value,ye),Et!==null&&(i&&Et.alternate!==null&&Ue.delete(Et.key===null?ct:Et.key),K=k(Et,K,ct),At===null?$e=Et:At.sibling=Et,At=Et);return i&&Ue.forEach(function(SP){return r(Y,SP)}),xt&&Ni(Y,ct),$e}function Ft(Y,K,te,ye){if(typeof te=="object"&&te!==null&&te.type===_&&te.key===null&&(te=te.props.children),typeof te=="object"&&te!==null){switch(te.$$typeof){case E:e:{for(var $e=te.key;K!==null;){if(K.key===$e){if($e=te.type,$e===_){if(K.tag===7){u(Y,K.sibling),ye=S(K,te.props.children),ye.return=Y,Y=ye;break e}}else if(K.elementType===$e||typeof $e=="object"&&$e!==null&&$e.$$typeof===F&&po($e)===K.type){u(Y,K.sibling),ye=S(K,te.props),Fl(ye,te),ye.return=Y,Y=ye;break e}u(Y,K);break}else r(Y,K);K=K.sibling}te.type===_?(ye=oo(te.props.children,Y.mode,ye,te.key),ye.return=Y,Y=ye):(ye=Uu(te.type,te.key,te.props,null,Y.mode,ye),Fl(ye,te),ye.return=Y,Y=ye)}return I(Y);case R:e:{for($e=te.key;K!==null;){if(K.key===$e)if(K.tag===4&&K.stateNode.containerInfo===te.containerInfo&&K.stateNode.implementation===te.implementation){u(Y,K.sibling),ye=S(K,te.children||[]),ye.return=Y,Y=ye;break e}else{u(Y,K);break}else r(Y,K);K=K.sibling}ye=hf(te,Y.mode,ye),ye.return=Y,Y=ye}return I(Y);case F:return te=po(te),Ft(Y,K,te,ye)}if(ge(te))return Be(Y,K,te,ye);if(Ae(te)){if($e=Ae(te),typeof $e!="function")throw Error(a(150));return te=$e.call(te),Ke(Y,K,te,ye)}if(typeof te.then=="function")return Ft(Y,K,Ku(te),ye);if(te.$$typeof===B)return Ft(Y,K,Qu(Y,te),ye);Wu(Y,te)}return typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint"?(te=""+te,K!==null&&K.tag===6?(u(Y,K.sibling),ye=S(K,te),ye.return=Y,Y=ye):(u(Y,K),ye=ff(te,Y.mode,ye),ye.return=Y,Y=ye),I(Y)):u(Y,K)}return function(Y,K,te,ye){try{Bl=0;var $e=Ft(Y,K,te,ye);return fs=null,$e}catch(Ue){if(Ue===ms||Ue===Gu)throw Ue;var At=Ma(29,Ue,null,Y.mode);return At.lanes=ye,At.return=Y,At}}}var fo=$1(!0),Q1=$1(!1),fr=!1;function Ef(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Rf(i,r){i=i.updateQueue,r.updateQueue===i&&(r.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function hr(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function gr(i,r,u){var g=i.updateQueue;if(g===null)return null;if(g=g.shared,(Tt&2)!==0){var S=g.pending;return S===null?r.next=r:(r.next=S.next,S.next=r),g.pending=r,r=Fu(i),R1(i,null,u),r}return Bu(i,g,r,u),Fu(i)}function Ul(i,r,u){if(r=r.updateQueue,r!==null&&(r=r.shared,(u&4194048)!==0)){var g=r.lanes;g&=i.pendingLanes,u|=g,r.lanes=u,Zo(i,u)}}function If(i,r){var u=i.updateQueue,g=i.alternate;if(g!==null&&(g=g.updateQueue,u===g)){var S=null,k=null;if(u=u.firstBaseUpdate,u!==null){do{var I={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};k===null?S=k=I:k=k.next=I,u=u.next}while(u!==null);k===null?S=k=r:k=k.next=r}else S=k=r;u={baseState:g.baseState,firstBaseUpdate:S,lastBaseUpdate:k,shared:g.shared,callbacks:g.callbacks},i.updateQueue=u;return}i=u.lastBaseUpdate,i===null?u.firstBaseUpdate=r:i.next=r,u.lastBaseUpdate=r}var Tf=!1;function Hl(){if(Tf){var i=ps;if(i!==null)throw i}}function $l(i,r,u,g){Tf=!1;var S=i.updateQueue;fr=!1;var k=S.firstBaseUpdate,I=S.lastBaseUpdate,P=S.shared.pending;if(P!==null){S.shared.pending=null;var H=P,ne=H.next;H.next=null,I===null?k=ne:I.next=ne,I=H;var me=i.alternate;me!==null&&(me=me.updateQueue,P=me.lastBaseUpdate,P!==I&&(P===null?me.firstBaseUpdate=ne:P.next=ne,me.lastBaseUpdate=H))}if(k!==null){var Se=S.baseState;I=0,me=ne=H=null,P=k;do{var ie=P.lane&-536870913,ce=ie!==P.lane;if(ce?(vt&ie)===ie:(g&ie)===ie){ie!==0&&ie===ds&&(Tf=!0),me!==null&&(me=me.next={lane:0,tag:P.tag,payload:P.payload,callback:null,next:null});e:{var Be=i,Ke=P;ie=r;var Ft=u;switch(Ke.tag){case 1:if(Be=Ke.payload,typeof Be=="function"){Se=Be.call(Ft,Se,ie);break e}Se=Be;break e;case 3:Be.flags=Be.flags&-65537|128;case 0:if(Be=Ke.payload,ie=typeof Be=="function"?Be.call(Ft,Se,ie):Be,ie==null)break e;Se=M({},Se,ie);break e;case 2:fr=!0}}ie=P.callback,ie!==null&&(i.flags|=64,ce&&(i.flags|=8192),ce=S.callbacks,ce===null?S.callbacks=[ie]:ce.push(ie))}else ce={lane:ie,tag:P.tag,payload:P.payload,callback:P.callback,next:null},me===null?(ne=me=ce,H=Se):me=me.next=ce,I|=ie;if(P=P.next,P===null){if(P=S.shared.pending,P===null)break;ce=P,P=ce.next,ce.next=null,S.lastBaseUpdate=ce,S.shared.pending=null}}while(!0);me===null&&(H=Se),S.baseState=H,S.firstBaseUpdate=ne,S.lastBaseUpdate=me,k===null&&(S.shared.lanes=0),xr|=I,i.lanes=I,i.memoizedState=Se}}function V1(i,r){if(typeof i!="function")throw Error(a(191,i));i.call(r)}function G1(i,r){var u=i.callbacks;if(u!==null)for(i.callbacks=null,i=0;i<u.length;i++)V1(u[i],r)}var hs=q(null),Yu=q(0);function Z1(i,r){i=Hi,le(Yu,i),le(hs,r),Hi=i|r.baseLanes}function _f(){le(Yu,Hi),le(hs,hs.current)}function Nf(){Hi=Yu.current,W(hs),W(Yu)}var Ca=q(null),Ba=null;function vr(i){var r=i.alternate;le(gn,gn.current&1),le(Ca,i),Ba===null&&(r===null||hs.current!==null||r.memoizedState!==null)&&(Ba=i)}function Of(i){le(gn,gn.current),le(Ca,i),Ba===null&&(Ba=i)}function K1(i){i.tag===22?(le(gn,gn.current),le(Ca,i),Ba===null&&(Ba=i)):yr()}function yr(){le(gn,gn.current),le(Ca,Ca.current)}function Aa(i){W(Ca),Ba===i&&(Ba=null),W(gn)}var gn=q(0);function Xu(i){for(var r=i;r!==null;){if(r.tag===13){var u=r.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||qh(u)||Bh(u)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break;for(;r.sibling===null;){if(r.return===null||r.return===i)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var Pi=0,st=null,qt=null,wn=null,Ju=!1,gs=!1,ho=!1,ed=0,Ql=0,vs=null,uj=0;function ln(){throw Error(a(321))}function jf(i,r){if(r===null)return!1;for(var u=0;u<r.length&&u<i.length;u++)if(!wa(i[u],r[u]))return!1;return!0}function Pf(i,r,u,g,S,k){return Pi=k,st=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,Q.H=i===null||i.memoizedState===null?NS:Wf,ho=!1,k=u(g,S),ho=!1,gs&&(k=Y1(r,u,g,S)),W1(i),k}function W1(i){Q.H=Zl;var r=qt!==null&&qt.next!==null;if(Pi=0,wn=qt=st=null,Ju=!1,Ql=0,vs=null,r)throw Error(a(300));i===null||Mn||(i=i.dependencies,i!==null&&$u(i)&&(Mn=!0))}function Y1(i,r,u,g){st=i;var S=0;do{if(gs&&(vs=null),Ql=0,gs=!1,25<=S)throw Error(a(301));if(S+=1,wn=qt=null,i.updateQueue!=null){var k=i.updateQueue;k.lastEffect=null,k.events=null,k.stores=null,k.memoCache!=null&&(k.memoCache.index=0)}Q.H=OS,k=r(u,g)}while(gs);return k}function dj(){var i=Q.H,r=i.useState()[0];return r=typeof r.then=="function"?Vl(r):r,i=i.useState()[0],(qt!==null?qt.memoizedState:null)!==i&&(st.flags|=1024),r}function Df(){var i=ed!==0;return ed=0,i}function zf(i,r,u){r.updateQueue=i.updateQueue,r.flags&=-2053,i.lanes&=~u}function Lf(i){if(Ju){for(i=i.memoizedState;i!==null;){var r=i.queue;r!==null&&(r.pending=null),i=i.next}Ju=!1}Pi=0,wn=qt=st=null,gs=!1,Ql=ed=0,vs=null}function Xn(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return wn===null?st.memoizedState=wn=i:wn=wn.next=i,wn}function vn(){if(qt===null){var i=st.alternate;i=i!==null?i.memoizedState:null}else i=qt.next;var r=wn===null?st.memoizedState:wn.next;if(r!==null)wn=r,qt=i;else{if(i===null)throw st.alternate===null?Error(a(467)):Error(a(310));qt=i,i={memoizedState:qt.memoizedState,baseState:qt.baseState,baseQueue:qt.baseQueue,queue:qt.queue,next:null},wn===null?st.memoizedState=wn=i:wn=wn.next=i}return wn}function td(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Vl(i){var r=Ql;return Ql+=1,vs===null&&(vs=[]),i=F1(vs,i,r),r=st,(wn===null?r.memoizedState:wn.next)===null&&(r=r.alternate,Q.H=r===null||r.memoizedState===null?NS:Wf),i}function nd(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return Vl(i);if(i.$$typeof===B)return Ln(i)}throw Error(a(438,String(i)))}function qf(i){var r=null,u=st.updateQueue;if(u!==null&&(r=u.memoCache),r==null){var g=st.alternate;g!==null&&(g=g.updateQueue,g!==null&&(g=g.memoCache,g!=null&&(r={data:g.data.map(function(S){return S.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),u===null&&(u=td(),st.updateQueue=u),u.memoCache=r,u=r.data[r.index],u===void 0)for(u=r.data[r.index]=Array(i),g=0;g<i;g++)u[g]=ke;return r.index++,u}function Di(i,r){return typeof r=="function"?r(i):r}function ad(i){var r=vn();return Bf(r,qt,i)}function Bf(i,r,u){var g=i.queue;if(g===null)throw Error(a(311));g.lastRenderedReducer=u;var S=i.baseQueue,k=g.pending;if(k!==null){if(S!==null){var I=S.next;S.next=k.next,k.next=I}r.baseQueue=S=k,g.pending=null}if(k=i.baseState,S===null)i.memoizedState=k;else{r=S.next;var P=I=null,H=null,ne=r,me=!1;do{var Se=ne.lane&-536870913;if(Se!==ne.lane?(vt&Se)===Se:(Pi&Se)===Se){var ie=ne.revertLane;if(ie===0)H!==null&&(H=H.next={lane:0,revertLane:0,gesture:null,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null}),Se===ds&&(me=!0);else if((Pi&ie)===ie){ne=ne.next,ie===ds&&(me=!0);continue}else Se={lane:0,revertLane:ne.revertLane,gesture:null,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},H===null?(P=H=Se,I=k):H=H.next=Se,st.lanes|=ie,xr|=ie;Se=ne.action,ho&&u(k,Se),k=ne.hasEagerState?ne.eagerState:u(k,Se)}else ie={lane:Se,revertLane:ne.revertLane,gesture:ne.gesture,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},H===null?(P=H=ie,I=k):H=H.next=ie,st.lanes|=Se,xr|=Se;ne=ne.next}while(ne!==null&&ne!==r);if(H===null?I=k:H.next=P,!wa(k,i.memoizedState)&&(Mn=!0,me&&(u=ps,u!==null)))throw u;i.memoizedState=k,i.baseState=I,i.baseQueue=H,g.lastRenderedState=k}return S===null&&(g.lanes=0),[i.memoizedState,g.dispatch]}function Ff(i){var r=vn(),u=r.queue;if(u===null)throw Error(a(311));u.lastRenderedReducer=i;var g=u.dispatch,S=u.pending,k=r.memoizedState;if(S!==null){u.pending=null;var I=S=S.next;do k=i(k,I.action),I=I.next;while(I!==S);wa(k,r.memoizedState)||(Mn=!0),r.memoizedState=k,r.baseQueue===null&&(r.baseState=k),u.lastRenderedState=k}return[k,g]}function X1(i,r,u){var g=st,S=vn(),k=xt;if(k){if(u===void 0)throw Error(a(407));u=u()}else u=r();var I=!wa((qt||S).memoizedState,u);if(I&&(S.memoizedState=u,Mn=!0),S=S.queue,$f(tS.bind(null,g,S,i),[i]),S.getSnapshot!==r||I||wn!==null&&wn.memoizedState.tag&1){if(g.flags|=2048,ys(9,{destroy:void 0},eS.bind(null,g,S,u,r),null),Vt===null)throw Error(a(349));k||(Pi&127)!==0||J1(g,r,u)}return u}function J1(i,r,u){i.flags|=16384,i={getSnapshot:r,value:u},r=st.updateQueue,r===null?(r=td(),st.updateQueue=r,r.stores=[i]):(u=r.stores,u===null?r.stores=[i]:u.push(i))}function eS(i,r,u,g){r.value=u,r.getSnapshot=g,nS(r)&&aS(i)}function tS(i,r,u){return u(function(){nS(r)&&aS(i)})}function nS(i){var r=i.getSnapshot;i=i.value;try{var u=r();return!wa(i,u)}catch{return!0}}function aS(i){var r=ro(i,2);r!==null&&fa(r,i,2)}function Uf(i){var r=Xn();if(typeof i=="function"){var u=i;if(i=u(),ho){sa(!0);try{u()}finally{sa(!1)}}}return r.memoizedState=r.baseState=i,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Di,lastRenderedState:i},r}function iS(i,r,u,g){return i.baseState=u,Bf(i,qt,typeof g=="function"?g:Di)}function pj(i,r,u,g,S){if(od(i))throw Error(a(485));if(i=r.action,i!==null){var k={payload:S,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(I){k.listeners.push(I)}};Q.T!==null?u(!0):k.isTransition=!1,g(k),u=r.pending,u===null?(k.next=r.pending=k,rS(r,k)):(k.next=u.next,r.pending=u.next=k)}}function rS(i,r){var u=r.action,g=r.payload,S=i.state;if(r.isTransition){var k=Q.T,I={};Q.T=I;try{var P=u(S,g),H=Q.S;H!==null&&H(I,P),oS(i,r,P)}catch(ne){Hf(i,r,ne)}finally{k!==null&&I.types!==null&&(k.types=I.types),Q.T=k}}else try{k=u(S,g),oS(i,r,k)}catch(ne){Hf(i,r,ne)}}function oS(i,r,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(g){sS(i,r,g)},function(g){return Hf(i,r,g)}):sS(i,r,u)}function sS(i,r,u){r.status="fulfilled",r.value=u,lS(r),i.state=u,r=i.pending,r!==null&&(u=r.next,u===r?i.pending=null:(u=u.next,r.next=u,rS(i,u)))}function Hf(i,r,u){var g=i.pending;if(i.pending=null,g!==null){g=g.next;do r.status="rejected",r.reason=u,lS(r),r=r.next;while(r!==g)}i.action=null}function lS(i){i=i.listeners;for(var r=0;r<i.length;r++)(0,i[r])()}function cS(i,r){return r}function uS(i,r){if(xt){var u=Vt.formState;if(u!==null){e:{var g=st;if(xt){if(Kt){t:{for(var S=Kt,k=qa;S.nodeType!==8;){if(!k){S=null;break t}if(S=Fa(S.nextSibling),S===null){S=null;break t}}k=S.data,S=k==="F!"||k==="F"?S:null}if(S){Kt=Fa(S.nextSibling),g=S.data==="F!";break e}}pr(g)}g=!1}g&&(r=u[0])}}return u=Xn(),u.memoizedState=u.baseState=r,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cS,lastRenderedState:r},u.queue=g,u=IS.bind(null,st,g),g.dispatch=u,g=Uf(!1),k=Kf.bind(null,st,!1,g.queue),g=Xn(),S={state:r,dispatch:null,action:i,pending:null},g.queue=S,u=pj.bind(null,st,S,k,u),S.dispatch=u,g.memoizedState=i,[r,u,!1]}function dS(i){var r=vn();return pS(r,qt,i)}function pS(i,r,u){if(r=Bf(i,r,cS)[0],i=ad(Di)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var g=Vl(r)}catch(I){throw I===ms?Gu:I}else g=r;r=vn();var S=r.queue,k=S.dispatch;return u!==r.memoizedState&&(st.flags|=2048,ys(9,{destroy:void 0},mj.bind(null,S,u),null)),[g,k,i]}function mj(i,r){i.action=r}function mS(i){var r=vn(),u=qt;if(u!==null)return pS(r,u,i);vn(),r=r.memoizedState,u=vn();var g=u.queue.dispatch;return u.memoizedState=i,[r,g,!1]}function ys(i,r,u,g){return i={tag:i,create:u,deps:g,inst:r,next:null},r=st.updateQueue,r===null&&(r=td(),st.updateQueue=r),u=r.lastEffect,u===null?r.lastEffect=i.next=i:(g=u.next,u.next=i,i.next=g,r.lastEffect=i),i}function fS(){return vn().memoizedState}function id(i,r,u,g){var S=Xn();st.flags|=i,S.memoizedState=ys(1|r,{destroy:void 0},u,g===void 0?null:g)}function rd(i,r,u,g){var S=vn();g=g===void 0?null:g;var k=S.memoizedState.inst;qt!==null&&g!==null&&jf(g,qt.memoizedState.deps)?S.memoizedState=ys(r,k,u,g):(st.flags|=i,S.memoizedState=ys(1|r,k,u,g))}function hS(i,r){id(8390656,8,i,r)}function $f(i,r){rd(2048,8,i,r)}function fj(i){st.flags|=4;var r=st.updateQueue;if(r===null)r=td(),st.updateQueue=r,r.events=[i];else{var u=r.events;u===null?r.events=[i]:u.push(i)}}function gS(i){var r=vn().memoizedState;return fj({ref:r,nextImpl:i}),function(){if((Tt&2)!==0)throw Error(a(440));return r.impl.apply(void 0,arguments)}}function vS(i,r){return rd(4,2,i,r)}function yS(i,r){return rd(4,4,i,r)}function bS(i,r){if(typeof r=="function"){i=i();var u=r(i);return function(){typeof u=="function"?u():r(null)}}if(r!=null)return i=i(),r.current=i,function(){r.current=null}}function SS(i,r,u){u=u!=null?u.concat([i]):null,rd(4,4,bS.bind(null,r,i),u)}function Qf(){}function xS(i,r){var u=vn();r=r===void 0?null:r;var g=u.memoizedState;return r!==null&&jf(r,g[1])?g[0]:(u.memoizedState=[i,r],i)}function kS(i,r){var u=vn();r=r===void 0?null:r;var g=u.memoizedState;if(r!==null&&jf(r,g[1]))return g[0];if(g=i(),ho){sa(!0);try{i()}finally{sa(!1)}}return u.memoizedState=[g,r],g}function Vf(i,r,u){return u===void 0||(Pi&1073741824)!==0&&(vt&261930)===0?i.memoizedState=r:(i.memoizedState=u,i=wx(),st.lanes|=i,xr|=i,u)}function wS(i,r,u,g){return wa(u,r)?u:hs.current!==null?(i=Vf(i,u,g),wa(i,r)||(Mn=!0),i):(Pi&42)===0||(Pi&1073741824)!==0&&(vt&261930)===0?(Mn=!0,i.memoizedState=u):(i=wx(),st.lanes|=i,xr|=i,r)}function MS(i,r,u,g,S){var k=oe.p;oe.p=k!==0&&8>k?k:8;var I=Q.T,P={};Q.T=P,Kf(i,!1,r,u);try{var H=S(),ne=Q.S;if(ne!==null&&ne(P,H),H!==null&&typeof H=="object"&&typeof H.then=="function"){var me=cj(H,g);Gl(i,r,me,Ia(i))}else Gl(i,r,g,Ia(i))}catch(Se){Gl(i,r,{then:function(){},status:"rejected",reason:Se},Ia())}finally{oe.p=k,I!==null&&P.types!==null&&(I.types=P.types),Q.T=I}}function hj(){}function Gf(i,r,u,g){if(i.tag!==5)throw Error(a(476));var S=CS(i).queue;MS(i,S,r,xe,u===null?hj:function(){return AS(i),u(g)})}function CS(i){var r=i.memoizedState;if(r!==null)return r;r={memoizedState:xe,baseState:xe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Di,lastRenderedState:xe},next:null};var u={};return r.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Di,lastRenderedState:u},next:null},i.memoizedState=r,i=i.alternate,i!==null&&(i.memoizedState=r),r}function AS(i){var r=CS(i);r.next===null&&(r=i.alternate.memoizedState),Gl(i,r.next.queue,{},Ia())}function Zf(){return Ln(uc)}function ES(){return vn().memoizedState}function RS(){return vn().memoizedState}function gj(i){for(var r=i.return;r!==null;){switch(r.tag){case 24:case 3:var u=Ia();i=hr(u);var g=gr(r,i,u);g!==null&&(fa(g,r,u),Ul(g,r,u)),r={cache:wf()},i.payload=r;return}r=r.return}}function vj(i,r,u){var g=Ia();u={lane:g,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},od(i)?TS(r,u):(u=pf(i,r,u,g),u!==null&&(fa(u,i,g),_S(u,r,g)))}function IS(i,r,u){var g=Ia();Gl(i,r,u,g)}function Gl(i,r,u,g){var S={lane:g,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(od(i))TS(r,S);else{var k=i.alternate;if(i.lanes===0&&(k===null||k.lanes===0)&&(k=r.lastRenderedReducer,k!==null))try{var I=r.lastRenderedState,P=k(I,u);if(S.hasEagerState=!0,S.eagerState=P,wa(P,I))return Bu(i,r,S,0),Vt===null&&qu(),!1}catch{}if(u=pf(i,r,S,g),u!==null)return fa(u,i,g),_S(u,r,g),!0}return!1}function Kf(i,r,u,g){if(g={lane:2,revertLane:Eh(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},od(i)){if(r)throw Error(a(479))}else r=pf(i,u,g,2),r!==null&&fa(r,i,2)}function od(i){var r=i.alternate;return i===st||r!==null&&r===st}function TS(i,r){gs=Ju=!0;var u=i.pending;u===null?r.next=r:(r.next=u.next,u.next=r),i.pending=r}function _S(i,r,u){if((u&4194048)!==0){var g=r.lanes;g&=i.pendingLanes,u|=g,r.lanes=u,Zo(i,u)}}var Zl={readContext:Ln,use:nd,useCallback:ln,useContext:ln,useEffect:ln,useImperativeHandle:ln,useLayoutEffect:ln,useInsertionEffect:ln,useMemo:ln,useReducer:ln,useRef:ln,useState:ln,useDebugValue:ln,useDeferredValue:ln,useTransition:ln,useSyncExternalStore:ln,useId:ln,useHostTransitionStatus:ln,useFormState:ln,useActionState:ln,useOptimistic:ln,useMemoCache:ln,useCacheRefresh:ln};Zl.useEffectEvent=ln;var NS={readContext:Ln,use:nd,useCallback:function(i,r){return Xn().memoizedState=[i,r===void 0?null:r],i},useContext:Ln,useEffect:hS,useImperativeHandle:function(i,r,u){u=u!=null?u.concat([i]):null,id(4194308,4,bS.bind(null,r,i),u)},useLayoutEffect:function(i,r){return id(4194308,4,i,r)},useInsertionEffect:function(i,r){id(4,2,i,r)},useMemo:function(i,r){var u=Xn();r=r===void 0?null:r;var g=i();if(ho){sa(!0);try{i()}finally{sa(!1)}}return u.memoizedState=[g,r],g},useReducer:function(i,r,u){var g=Xn();if(u!==void 0){var S=u(r);if(ho){sa(!0);try{u(r)}finally{sa(!1)}}}else S=r;return g.memoizedState=g.baseState=S,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:S},g.queue=i,i=i.dispatch=vj.bind(null,st,i),[g.memoizedState,i]},useRef:function(i){var r=Xn();return i={current:i},r.memoizedState=i},useState:function(i){i=Uf(i);var r=i.queue,u=IS.bind(null,st,r);return r.dispatch=u,[i.memoizedState,u]},useDebugValue:Qf,useDeferredValue:function(i,r){var u=Xn();return Vf(u,i,r)},useTransition:function(){var i=Uf(!1);return i=MS.bind(null,st,i.queue,!0,!1),Xn().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,r,u){var g=st,S=Xn();if(xt){if(u===void 0)throw Error(a(407));u=u()}else{if(u=r(),Vt===null)throw Error(a(349));(vt&127)!==0||J1(g,r,u)}S.memoizedState=u;var k={value:u,getSnapshot:r};return S.queue=k,hS(tS.bind(null,g,k,i),[i]),g.flags|=2048,ys(9,{destroy:void 0},eS.bind(null,g,k,u,r),null),u},useId:function(){var i=Xn(),r=Vt.identifierPrefix;if(xt){var u=mi,g=pi;u=(g&~(1<<32-Nn(g)-1)).toString(32)+u,r="_"+r+"R_"+u,u=ed++,0<u&&(r+="H"+u.toString(32)),r+="_"}else u=uj++,r="_"+r+"r_"+u.toString(32)+"_";return i.memoizedState=r},useHostTransitionStatus:Zf,useFormState:uS,useActionState:uS,useOptimistic:function(i){var r=Xn();r.memoizedState=r.baseState=i;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=u,r=Kf.bind(null,st,!0,u),u.dispatch=r,[i,r]},useMemoCache:qf,useCacheRefresh:function(){return Xn().memoizedState=gj.bind(null,st)},useEffectEvent:function(i){var r=Xn(),u={impl:i};return r.memoizedState=u,function(){if((Tt&2)!==0)throw Error(a(440));return u.impl.apply(void 0,arguments)}}},Wf={readContext:Ln,use:nd,useCallback:xS,useContext:Ln,useEffect:$f,useImperativeHandle:SS,useInsertionEffect:vS,useLayoutEffect:yS,useMemo:kS,useReducer:ad,useRef:fS,useState:function(){return ad(Di)},useDebugValue:Qf,useDeferredValue:function(i,r){var u=vn();return wS(u,qt.memoizedState,i,r)},useTransition:function(){var i=ad(Di)[0],r=vn().memoizedState;return[typeof i=="boolean"?i:Vl(i),r]},useSyncExternalStore:X1,useId:ES,useHostTransitionStatus:Zf,useFormState:dS,useActionState:dS,useOptimistic:function(i,r){var u=vn();return iS(u,qt,i,r)},useMemoCache:qf,useCacheRefresh:RS};Wf.useEffectEvent=gS;var OS={readContext:Ln,use:nd,useCallback:xS,useContext:Ln,useEffect:$f,useImperativeHandle:SS,useInsertionEffect:vS,useLayoutEffect:yS,useMemo:kS,useReducer:Ff,useRef:fS,useState:function(){return Ff(Di)},useDebugValue:Qf,useDeferredValue:function(i,r){var u=vn();return qt===null?Vf(u,i,r):wS(u,qt.memoizedState,i,r)},useTransition:function(){var i=Ff(Di)[0],r=vn().memoizedState;return[typeof i=="boolean"?i:Vl(i),r]},useSyncExternalStore:X1,useId:ES,useHostTransitionStatus:Zf,useFormState:mS,useActionState:mS,useOptimistic:function(i,r){var u=vn();return qt!==null?iS(u,qt,i,r):(u.baseState=i,[i,u.queue.dispatch])},useMemoCache:qf,useCacheRefresh:RS};OS.useEffectEvent=gS;function Yf(i,r,u,g){r=i.memoizedState,u=u(g,r),u=u==null?r:M({},r,u),i.memoizedState=u,i.lanes===0&&(i.updateQueue.baseState=u)}var Xf={enqueueSetState:function(i,r,u){i=i._reactInternals;var g=Ia(),S=hr(g);S.payload=r,u!=null&&(S.callback=u),r=gr(i,S,g),r!==null&&(fa(r,i,g),Ul(r,i,g))},enqueueReplaceState:function(i,r,u){i=i._reactInternals;var g=Ia(),S=hr(g);S.tag=1,S.payload=r,u!=null&&(S.callback=u),r=gr(i,S,g),r!==null&&(fa(r,i,g),Ul(r,i,g))},enqueueForceUpdate:function(i,r){i=i._reactInternals;var u=Ia(),g=hr(u);g.tag=2,r!=null&&(g.callback=r),r=gr(i,g,u),r!==null&&(fa(r,i,u),Ul(r,i,u))}};function jS(i,r,u,g,S,k,I){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(g,k,I):r.prototype&&r.prototype.isPureReactComponent?!jl(u,g)||!jl(S,k):!0}function PS(i,r,u,g){i=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(u,g),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(u,g),r.state!==i&&Xf.enqueueReplaceState(r,r.state,null)}function go(i,r){var u=r;if("ref"in r){u={};for(var g in r)g!=="ref"&&(u[g]=r[g])}if(i=i.defaultProps){u===r&&(u=M({},u));for(var S in i)u[S]===void 0&&(u[S]=i[S])}return u}function DS(i){Lu(i)}function zS(i){console.error(i)}function LS(i){Lu(i)}function sd(i,r){try{var u=i.onUncaughtError;u(r.value,{componentStack:r.stack})}catch(g){setTimeout(function(){throw g})}}function qS(i,r,u){try{var g=i.onCaughtError;g(u.value,{componentStack:u.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(S){setTimeout(function(){throw S})}}function Jf(i,r,u){return u=hr(u),u.tag=3,u.payload={element:null},u.callback=function(){sd(i,r)},u}function BS(i){return i=hr(i),i.tag=3,i}function FS(i,r,u,g){var S=u.type.getDerivedStateFromError;if(typeof S=="function"){var k=g.value;i.payload=function(){return S(k)},i.callback=function(){qS(r,u,g)}}var I=u.stateNode;I!==null&&typeof I.componentDidCatch=="function"&&(i.callback=function(){qS(r,u,g),typeof S!="function"&&(kr===null?kr=new Set([this]):kr.add(this));var P=g.stack;this.componentDidCatch(g.value,{componentStack:P!==null?P:""})})}function yj(i,r,u,g,S){if(u.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(r=u.alternate,r!==null&&us(r,u,S,!0),u=Ca.current,u!==null){switch(u.tag){case 31:case 13:return Ba===null?bd():u.alternate===null&&cn===0&&(cn=3),u.flags&=-257,u.flags|=65536,u.lanes=S,g===Zu?u.flags|=16384:(r=u.updateQueue,r===null?u.updateQueue=new Set([g]):r.add(g),Mh(i,g,S)),!1;case 22:return u.flags|=65536,g===Zu?u.flags|=16384:(r=u.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([g])},u.updateQueue=r):(u=r.retryQueue,u===null?r.retryQueue=new Set([g]):u.add(g)),Mh(i,g,S)),!1}throw Error(a(435,u.tag))}return Mh(i,g,S),bd(),!1}if(xt)return r=Ca.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=S,g!==yf&&(i=Error(a(422),{cause:g}),zl(Da(i,u)))):(g!==yf&&(r=Error(a(423),{cause:g}),zl(Da(r,u))),i=i.current.alternate,i.flags|=65536,S&=-S,i.lanes|=S,g=Da(g,u),S=Jf(i.stateNode,g,S),If(i,S),cn!==4&&(cn=2)),!1;var k=Error(a(520),{cause:g});if(k=Da(k,u),nc===null?nc=[k]:nc.push(k),cn!==4&&(cn=2),r===null)return!0;g=Da(g,u),u=r;do{switch(u.tag){case 3:return u.flags|=65536,i=S&-S,u.lanes|=i,i=Jf(u.stateNode,g,i),If(u,i),!1;case 1:if(r=u.type,k=u.stateNode,(u.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||k!==null&&typeof k.componentDidCatch=="function"&&(kr===null||!kr.has(k))))return u.flags|=65536,S&=-S,u.lanes|=S,S=BS(S),FS(S,i,u,g),If(u,S),!1}u=u.return}while(u!==null);return!1}var eh=Error(a(461)),Mn=!1;function qn(i,r,u,g){r.child=i===null?Q1(r,null,u,g):fo(r,i.child,u,g)}function US(i,r,u,g,S){u=u.render;var k=r.ref;if("ref"in g){var I={};for(var P in g)P!=="ref"&&(I[P]=g[P])}else I=g;return co(r),g=Pf(i,r,u,I,k,S),P=Df(),i!==null&&!Mn?(zf(i,r,S),zi(i,r,S)):(xt&&P&&gf(r),r.flags|=1,qn(i,r,g,S),r.child)}function HS(i,r,u,g,S){if(i===null){var k=u.type;return typeof k=="function"&&!mf(k)&&k.defaultProps===void 0&&u.compare===null?(r.tag=15,r.type=k,$S(i,r,k,g,S)):(i=Uu(u.type,null,g,r,r.mode,S),i.ref=r.ref,i.return=r,r.child=i)}if(k=i.child,!lh(i,S)){var I=k.memoizedProps;if(u=u.compare,u=u!==null?u:jl,u(I,g)&&i.ref===r.ref)return zi(i,r,S)}return r.flags|=1,i=_i(k,g),i.ref=r.ref,i.return=r,r.child=i}function $S(i,r,u,g,S){if(i!==null){var k=i.memoizedProps;if(jl(k,g)&&i.ref===r.ref)if(Mn=!1,r.pendingProps=g=k,lh(i,S))(i.flags&131072)!==0&&(Mn=!0);else return r.lanes=i.lanes,zi(i,r,S)}return th(i,r,u,g,S)}function QS(i,r,u,g){var S=g.children,k=i!==null?i.memoizedState:null;if(i===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),g.mode==="hidden"){if((r.flags&128)!==0){if(k=k!==null?k.baseLanes|u:u,i!==null){for(g=r.child=i.child,S=0;g!==null;)S=S|g.lanes|g.childLanes,g=g.sibling;g=S&~k}else g=0,r.child=null;return VS(i,r,k,u,g)}if((u&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},i!==null&&Vu(r,k!==null?k.cachePool:null),k!==null?Z1(r,k):_f(),K1(r);else return g=r.lanes=536870912,VS(i,r,k!==null?k.baseLanes|u:u,u,g)}else k!==null?(Vu(r,k.cachePool),Z1(r,k),yr(),r.memoizedState=null):(i!==null&&Vu(r,null),_f(),yr());return qn(i,r,S,u),r.child}function Kl(i,r){return i!==null&&i.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function VS(i,r,u,g,S){var k=Cf();return k=k===null?null:{parent:kn._currentValue,pool:k},r.memoizedState={baseLanes:u,cachePool:k},i!==null&&Vu(r,null),_f(),K1(r),i!==null&&us(i,r,g,!0),r.childLanes=S,null}function ld(i,r){return r=ud({mode:r.mode,children:r.children},i.mode),r.ref=i.ref,i.child=r,r.return=i,r}function GS(i,r,u){return fo(r,i.child,null,u),i=ld(r,r.pendingProps),i.flags|=2,Aa(r),r.memoizedState=null,i}function bj(i,r,u){var g=r.pendingProps,S=(r.flags&128)!==0;if(r.flags&=-129,i===null){if(xt){if(g.mode==="hidden")return i=ld(r,g),r.lanes=536870912,Kl(null,i);if(Of(r),(i=Kt)?(i=rk(i,qa),i=i!==null&&i.data==="&"?i:null,i!==null&&(r.memoizedState={dehydrated:i,treeContext:ur!==null?{id:pi,overflow:mi}:null,retryLane:536870912,hydrationErrors:null},u=T1(i),u.return=r,r.child=u,zn=r,Kt=null)):i=null,i===null)throw pr(r);return r.lanes=536870912,null}return ld(r,g)}var k=i.memoizedState;if(k!==null){var I=k.dehydrated;if(Of(r),S)if(r.flags&256)r.flags&=-257,r=GS(i,r,u);else if(r.memoizedState!==null)r.child=i.child,r.flags|=128,r=null;else throw Error(a(558));else if(Mn||us(i,r,u,!1),S=(u&i.childLanes)!==0,Mn||S){if(g=Vt,g!==null&&(I=Ga(g,u),I!==0&&I!==k.retryLane))throw k.retryLane=I,ro(i,I),fa(g,i,I),eh;bd(),r=GS(i,r,u)}else i=k.treeContext,Kt=Fa(I.nextSibling),zn=r,xt=!0,dr=null,qa=!1,i!==null&&O1(r,i),r=ld(r,g),r.flags|=4096;return r}return i=_i(i.child,{mode:g.mode,children:g.children}),i.ref=r.ref,r.child=i,i.return=r,i}function cd(i,r){var u=r.ref;if(u===null)i!==null&&i.ref!==null&&(r.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(a(284));(i===null||i.ref!==u)&&(r.flags|=4194816)}}function th(i,r,u,g,S){return co(r),u=Pf(i,r,u,g,void 0,S),g=Df(),i!==null&&!Mn?(zf(i,r,S),zi(i,r,S)):(xt&&g&&gf(r),r.flags|=1,qn(i,r,u,S),r.child)}function ZS(i,r,u,g,S,k){return co(r),r.updateQueue=null,u=Y1(r,g,u,S),W1(i),g=Df(),i!==null&&!Mn?(zf(i,r,k),zi(i,r,k)):(xt&&g&&gf(r),r.flags|=1,qn(i,r,u,k),r.child)}function KS(i,r,u,g,S){if(co(r),r.stateNode===null){var k=os,I=u.contextType;typeof I=="object"&&I!==null&&(k=Ln(I)),k=new u(g,k),r.memoizedState=k.state!==null&&k.state!==void 0?k.state:null,k.updater=Xf,r.stateNode=k,k._reactInternals=r,k=r.stateNode,k.props=g,k.state=r.memoizedState,k.refs={},Ef(r),I=u.contextType,k.context=typeof I=="object"&&I!==null?Ln(I):os,k.state=r.memoizedState,I=u.getDerivedStateFromProps,typeof I=="function"&&(Yf(r,u,I,g),k.state=r.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof k.getSnapshotBeforeUpdate=="function"||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(I=k.state,typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount(),I!==k.state&&Xf.enqueueReplaceState(k,k.state,null),$l(r,g,k,S),Hl(),k.state=r.memoizedState),typeof k.componentDidMount=="function"&&(r.flags|=4194308),g=!0}else if(i===null){k=r.stateNode;var P=r.memoizedProps,H=go(u,P);k.props=H;var ne=k.context,me=u.contextType;I=os,typeof me=="object"&&me!==null&&(I=Ln(me));var Se=u.getDerivedStateFromProps;me=typeof Se=="function"||typeof k.getSnapshotBeforeUpdate=="function",P=r.pendingProps!==P,me||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(P||ne!==I)&&PS(r,k,g,I),fr=!1;var ie=r.memoizedState;k.state=ie,$l(r,g,k,S),Hl(),ne=r.memoizedState,P||ie!==ne||fr?(typeof Se=="function"&&(Yf(r,u,Se,g),ne=r.memoizedState),(H=fr||jS(r,u,H,g,ie,ne,I))?(me||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount()),typeof k.componentDidMount=="function"&&(r.flags|=4194308)):(typeof k.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=g,r.memoizedState=ne),k.props=g,k.state=ne,k.context=I,g=H):(typeof k.componentDidMount=="function"&&(r.flags|=4194308),g=!1)}else{k=r.stateNode,Rf(i,r),I=r.memoizedProps,me=go(u,I),k.props=me,Se=r.pendingProps,ie=k.context,ne=u.contextType,H=os,typeof ne=="object"&&ne!==null&&(H=Ln(ne)),P=u.getDerivedStateFromProps,(ne=typeof P=="function"||typeof k.getSnapshotBeforeUpdate=="function")||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(I!==Se||ie!==H)&&PS(r,k,g,H),fr=!1,ie=r.memoizedState,k.state=ie,$l(r,g,k,S),Hl();var ce=r.memoizedState;I!==Se||ie!==ce||fr||i!==null&&i.dependencies!==null&&$u(i.dependencies)?(typeof P=="function"&&(Yf(r,u,P,g),ce=r.memoizedState),(me=fr||jS(r,u,me,g,ie,ce,H)||i!==null&&i.dependencies!==null&&$u(i.dependencies))?(ne||typeof k.UNSAFE_componentWillUpdate!="function"&&typeof k.componentWillUpdate!="function"||(typeof k.componentWillUpdate=="function"&&k.componentWillUpdate(g,ce,H),typeof k.UNSAFE_componentWillUpdate=="function"&&k.UNSAFE_componentWillUpdate(g,ce,H)),typeof k.componentDidUpdate=="function"&&(r.flags|=4),typeof k.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof k.componentDidUpdate!="function"||I===i.memoizedProps&&ie===i.memoizedState||(r.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||I===i.memoizedProps&&ie===i.memoizedState||(r.flags|=1024),r.memoizedProps=g,r.memoizedState=ce),k.props=g,k.state=ce,k.context=H,g=me):(typeof k.componentDidUpdate!="function"||I===i.memoizedProps&&ie===i.memoizedState||(r.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||I===i.memoizedProps&&ie===i.memoizedState||(r.flags|=1024),g=!1)}return k=g,cd(i,r),g=(r.flags&128)!==0,k||g?(k=r.stateNode,u=g&&typeof u.getDerivedStateFromError!="function"?null:k.render(),r.flags|=1,i!==null&&g?(r.child=fo(r,i.child,null,S),r.child=fo(r,null,u,S)):qn(i,r,u,S),r.memoizedState=k.state,i=r.child):i=zi(i,r,S),i}function WS(i,r,u,g){return so(),r.flags|=256,qn(i,r,u,g),r.child}var nh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ah(i){return{baseLanes:i,cachePool:q1()}}function ih(i,r,u){return i=i!==null?i.childLanes&~u:0,r&&(i|=Ra),i}function YS(i,r,u){var g=r.pendingProps,S=!1,k=(r.flags&128)!==0,I;if((I=k)||(I=i!==null&&i.memoizedState===null?!1:(gn.current&2)!==0),I&&(S=!0,r.flags&=-129),I=(r.flags&32)!==0,r.flags&=-33,i===null){if(xt){if(S?vr(r):yr(),(i=Kt)?(i=rk(i,qa),i=i!==null&&i.data!=="&"?i:null,i!==null&&(r.memoizedState={dehydrated:i,treeContext:ur!==null?{id:pi,overflow:mi}:null,retryLane:536870912,hydrationErrors:null},u=T1(i),u.return=r,r.child=u,zn=r,Kt=null)):i=null,i===null)throw pr(r);return Bh(i)?r.lanes=32:r.lanes=536870912,null}var P=g.children;return g=g.fallback,S?(yr(),S=r.mode,P=ud({mode:"hidden",children:P},S),g=oo(g,S,u,null),P.return=r,g.return=r,P.sibling=g,r.child=P,g=r.child,g.memoizedState=ah(u),g.childLanes=ih(i,I,u),r.memoizedState=nh,Kl(null,g)):(vr(r),rh(r,P))}var H=i.memoizedState;if(H!==null&&(P=H.dehydrated,P!==null)){if(k)r.flags&256?(vr(r),r.flags&=-257,r=oh(i,r,u)):r.memoizedState!==null?(yr(),r.child=i.child,r.flags|=128,r=null):(yr(),P=g.fallback,S=r.mode,g=ud({mode:"visible",children:g.children},S),P=oo(P,S,u,null),P.flags|=2,g.return=r,P.return=r,g.sibling=P,r.child=g,fo(r,i.child,null,u),g=r.child,g.memoizedState=ah(u),g.childLanes=ih(i,I,u),r.memoizedState=nh,r=Kl(null,g));else if(vr(r),Bh(P)){if(I=P.nextSibling&&P.nextSibling.dataset,I)var ne=I.dgst;I=ne,g=Error(a(419)),g.stack="",g.digest=I,zl({value:g,source:null,stack:null}),r=oh(i,r,u)}else if(Mn||us(i,r,u,!1),I=(u&i.childLanes)!==0,Mn||I){if(I=Vt,I!==null&&(g=Ga(I,u),g!==0&&g!==H.retryLane))throw H.retryLane=g,ro(i,g),fa(I,i,g),eh;qh(P)||bd(),r=oh(i,r,u)}else qh(P)?(r.flags|=192,r.child=i.child,r=null):(i=H.treeContext,Kt=Fa(P.nextSibling),zn=r,xt=!0,dr=null,qa=!1,i!==null&&O1(r,i),r=rh(r,g.children),r.flags|=4096);return r}return S?(yr(),P=g.fallback,S=r.mode,H=i.child,ne=H.sibling,g=_i(H,{mode:"hidden",children:g.children}),g.subtreeFlags=H.subtreeFlags&65011712,ne!==null?P=_i(ne,P):(P=oo(P,S,u,null),P.flags|=2),P.return=r,g.return=r,g.sibling=P,r.child=g,Kl(null,g),g=r.child,P=i.child.memoizedState,P===null?P=ah(u):(S=P.cachePool,S!==null?(H=kn._currentValue,S=S.parent!==H?{parent:H,pool:H}:S):S=q1(),P={baseLanes:P.baseLanes|u,cachePool:S}),g.memoizedState=P,g.childLanes=ih(i,I,u),r.memoizedState=nh,Kl(i.child,g)):(vr(r),u=i.child,i=u.sibling,u=_i(u,{mode:"visible",children:g.children}),u.return=r,u.sibling=null,i!==null&&(I=r.deletions,I===null?(r.deletions=[i],r.flags|=16):I.push(i)),r.child=u,r.memoizedState=null,u)}function rh(i,r){return r=ud({mode:"visible",children:r},i.mode),r.return=i,i.child=r}function ud(i,r){return i=Ma(22,i,null,r),i.lanes=0,i}function oh(i,r,u){return fo(r,i.child,null,u),i=rh(r,r.pendingProps.children),i.flags|=2,r.memoizedState=null,i}function XS(i,r,u){i.lanes|=r;var g=i.alternate;g!==null&&(g.lanes|=r),xf(i.return,r,u)}function sh(i,r,u,g,S,k){var I=i.memoizedState;I===null?i.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:g,tail:u,tailMode:S,treeForkCount:k}:(I.isBackwards=r,I.rendering=null,I.renderingStartTime=0,I.last=g,I.tail=u,I.tailMode=S,I.treeForkCount=k)}function JS(i,r,u){var g=r.pendingProps,S=g.revealOrder,k=g.tail;g=g.children;var I=gn.current,P=(I&2)!==0;if(P?(I=I&1|2,r.flags|=128):I&=1,le(gn,I),qn(i,r,g,u),g=xt?Dl:0,!P&&i!==null&&(i.flags&128)!==0)e:for(i=r.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&XS(i,u,r);else if(i.tag===19)XS(i,u,r);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break e;for(;i.sibling===null;){if(i.return===null||i.return===r)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(S){case"forwards":for(u=r.child,S=null;u!==null;)i=u.alternate,i!==null&&Xu(i)===null&&(S=u),u=u.sibling;u=S,u===null?(S=r.child,r.child=null):(S=u.sibling,u.sibling=null),sh(r,!1,S,u,k,g);break;case"backwards":case"unstable_legacy-backwards":for(u=null,S=r.child,r.child=null;S!==null;){if(i=S.alternate,i!==null&&Xu(i)===null){r.child=S;break}i=S.sibling,S.sibling=u,u=S,S=i}sh(r,!0,u,null,k,g);break;case"together":sh(r,!1,null,null,void 0,g);break;default:r.memoizedState=null}return r.child}function zi(i,r,u){if(i!==null&&(r.dependencies=i.dependencies),xr|=r.lanes,(u&r.childLanes)===0)if(i!==null){if(us(i,r,u,!1),(u&r.childLanes)===0)return null}else return null;if(i!==null&&r.child!==i.child)throw Error(a(153));if(r.child!==null){for(i=r.child,u=_i(i,i.pendingProps),r.child=u,u.return=r;i.sibling!==null;)i=i.sibling,u=u.sibling=_i(i,i.pendingProps),u.return=r;u.sibling=null}return r.child}function lh(i,r){return(i.lanes&r)!==0?!0:(i=i.dependencies,!!(i!==null&&$u(i)))}function Sj(i,r,u){switch(r.tag){case 3:Fe(r,r.stateNode.containerInfo),mr(r,kn,i.memoizedState.cache),so();break;case 27:case 5:Te(r);break;case 4:Fe(r,r.stateNode.containerInfo);break;case 10:mr(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,Of(r),null;break;case 13:var g=r.memoizedState;if(g!==null)return g.dehydrated!==null?(vr(r),r.flags|=128,null):(u&r.child.childLanes)!==0?YS(i,r,u):(vr(r),i=zi(i,r,u),i!==null?i.sibling:null);vr(r);break;case 19:var S=(i.flags&128)!==0;if(g=(u&r.childLanes)!==0,g||(us(i,r,u,!1),g=(u&r.childLanes)!==0),S){if(g)return JS(i,r,u);r.flags|=128}if(S=r.memoizedState,S!==null&&(S.rendering=null,S.tail=null,S.lastEffect=null),le(gn,gn.current),g)break;return null;case 22:return r.lanes=0,QS(i,r,u,r.pendingProps);case 24:mr(r,kn,i.memoizedState.cache)}return zi(i,r,u)}function ex(i,r,u){if(i!==null)if(i.memoizedProps!==r.pendingProps)Mn=!0;else{if(!lh(i,u)&&(r.flags&128)===0)return Mn=!1,Sj(i,r,u);Mn=(i.flags&131072)!==0}else Mn=!1,xt&&(r.flags&1048576)!==0&&N1(r,Dl,r.index);switch(r.lanes=0,r.tag){case 16:e:{var g=r.pendingProps;if(i=po(r.elementType),r.type=i,typeof i=="function")mf(i)?(g=go(i,g),r.tag=1,r=KS(null,r,i,g,u)):(r.tag=0,r=th(null,r,i,g,u));else{if(i!=null){var S=i.$$typeof;if(S===L){r.tag=11,r=US(null,r,i,g,u);break e}else if(S===V){r.tag=14,r=HS(null,r,i,g,u);break e}}throw r=we(i)||i,Error(a(306,r,""))}}return r;case 0:return th(i,r,r.type,r.pendingProps,u);case 1:return g=r.type,S=go(g,r.pendingProps),KS(i,r,g,S,u);case 3:e:{if(Fe(r,r.stateNode.containerInfo),i===null)throw Error(a(387));g=r.pendingProps;var k=r.memoizedState;S=k.element,Rf(i,r),$l(r,g,null,u);var I=r.memoizedState;if(g=I.cache,mr(r,kn,g),g!==k.cache&&kf(r,[kn],u,!0),Hl(),g=I.element,k.isDehydrated)if(k={element:g,isDehydrated:!1,cache:I.cache},r.updateQueue.baseState=k,r.memoizedState=k,r.flags&256){r=WS(i,r,g,u);break e}else if(g!==S){S=Da(Error(a(424)),r),zl(S),r=WS(i,r,g,u);break e}else for(i=r.stateNode.containerInfo,i.nodeType===9?i=i.body:i=i.nodeName==="HTML"?i.ownerDocument.body:i,Kt=Fa(i.firstChild),zn=r,xt=!0,dr=null,qa=!0,u=Q1(r,null,g,u),r.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling;else{if(so(),g===S){r=zi(i,r,u);break e}qn(i,r,g,u)}r=r.child}return r;case 26:return cd(i,r),i===null?(u=dk(r.type,null,r.pendingProps,null))?r.memoizedState=u:xt||(u=r.type,i=r.pendingProps,g=Ad(ve.current).createElement(u),g[Sn]=r,g[Qn]=i,Bn(g,u,i),rn(g),r.stateNode=g):r.memoizedState=dk(r.type,i.memoizedProps,r.pendingProps,i.memoizedState),null;case 27:return Te(r),i===null&&xt&&(g=r.stateNode=lk(r.type,r.pendingProps,ve.current),zn=r,qa=!0,S=Kt,Ar(r.type)?(Fh=S,Kt=Fa(g.firstChild)):Kt=S),qn(i,r,r.pendingProps.children,u),cd(i,r),i===null&&(r.flags|=4194304),r.child;case 5:return i===null&&xt&&((S=g=Kt)&&(g=Wj(g,r.type,r.pendingProps,qa),g!==null?(r.stateNode=g,zn=r,Kt=Fa(g.firstChild),qa=!1,S=!0):S=!1),S||pr(r)),Te(r),S=r.type,k=r.pendingProps,I=i!==null?i.memoizedProps:null,g=k.children,Dh(S,k)?g=null:I!==null&&Dh(S,I)&&(r.flags|=32),r.memoizedState!==null&&(S=Pf(i,r,dj,null,null,u),uc._currentValue=S),cd(i,r),qn(i,r,g,u),r.child;case 6:return i===null&&xt&&((i=u=Kt)&&(u=Yj(u,r.pendingProps,qa),u!==null?(r.stateNode=u,zn=r,Kt=null,i=!0):i=!1),i||pr(r)),null;case 13:return YS(i,r,u);case 4:return Fe(r,r.stateNode.containerInfo),g=r.pendingProps,i===null?r.child=fo(r,null,g,u):qn(i,r,g,u),r.child;case 11:return US(i,r,r.type,r.pendingProps,u);case 7:return qn(i,r,r.pendingProps,u),r.child;case 8:return qn(i,r,r.pendingProps.children,u),r.child;case 12:return qn(i,r,r.pendingProps.children,u),r.child;case 10:return g=r.pendingProps,mr(r,r.type,g.value),qn(i,r,g.children,u),r.child;case 9:return S=r.type._context,g=r.pendingProps.children,co(r),S=Ln(S),g=g(S),r.flags|=1,qn(i,r,g,u),r.child;case 14:return HS(i,r,r.type,r.pendingProps,u);case 15:return $S(i,r,r.type,r.pendingProps,u);case 19:return JS(i,r,u);case 31:return bj(i,r,u);case 22:return QS(i,r,u,r.pendingProps);case 24:return co(r),g=Ln(kn),i===null?(S=Cf(),S===null&&(S=Vt,k=wf(),S.pooledCache=k,k.refCount++,k!==null&&(S.pooledCacheLanes|=u),S=k),r.memoizedState={parent:g,cache:S},Ef(r),mr(r,kn,S)):((i.lanes&u)!==0&&(Rf(i,r),$l(r,null,null,u),Hl()),S=i.memoizedState,k=r.memoizedState,S.parent!==g?(S={parent:g,cache:g},r.memoizedState=S,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=S),mr(r,kn,g)):(g=k.cache,mr(r,kn,g),g!==S.cache&&kf(r,[kn],u,!0))),qn(i,r,r.pendingProps.children,u),r.child;case 29:throw r.pendingProps}throw Error(a(156,r.tag))}function Li(i){i.flags|=4}function ch(i,r,u,g,S){if((r=(i.mode&32)!==0)&&(r=!1),r){if(i.flags|=16777216,(S&335544128)===S)if(i.stateNode.complete)i.flags|=8192;else if(Ex())i.flags|=8192;else throw mo=Zu,Af}else i.flags&=-16777217}function tx(i,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!gk(r))if(Ex())i.flags|=8192;else throw mo=Zu,Af}function dd(i,r){r!==null&&(i.flags|=4),i.flags&16384&&(r=i.tag!==22?Tu():536870912,i.lanes|=r,ks|=r)}function Wl(i,r){if(!xt)switch(i.tailMode){case"hidden":r=i.tail;for(var u=null;r!==null;)r.alternate!==null&&(u=r),r=r.sibling;u===null?i.tail=null:u.sibling=null;break;case"collapsed":u=i.tail;for(var g=null;u!==null;)u.alternate!==null&&(g=u),u=u.sibling;g===null?r||i.tail===null?i.tail=null:i.tail.sibling=null:g.sibling=null}}function Wt(i){var r=i.alternate!==null&&i.alternate.child===i.child,u=0,g=0;if(r)for(var S=i.child;S!==null;)u|=S.lanes|S.childLanes,g|=S.subtreeFlags&65011712,g|=S.flags&65011712,S.return=i,S=S.sibling;else for(S=i.child;S!==null;)u|=S.lanes|S.childLanes,g|=S.subtreeFlags,g|=S.flags,S.return=i,S=S.sibling;return i.subtreeFlags|=g,i.childLanes=u,r}function xj(i,r,u){var g=r.pendingProps;switch(vf(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Wt(r),null;case 1:return Wt(r),null;case 3:return u=r.stateNode,g=null,i!==null&&(g=i.memoizedState.cache),r.memoizedState.cache!==g&&(r.flags|=2048),ji(kn),re(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(i===null||i.child===null)&&(cs(r)?Li(r):i===null||i.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,bf())),Wt(r),null;case 26:var S=r.type,k=r.memoizedState;return i===null?(Li(r),k!==null?(Wt(r),tx(r,k)):(Wt(r),ch(r,S,null,g,u))):k?k!==i.memoizedState?(Li(r),Wt(r),tx(r,k)):(Wt(r),r.flags&=-16777217):(i=i.memoizedProps,i!==g&&Li(r),Wt(r),ch(r,S,i,g,u)),null;case 27:if(Je(r),u=ve.current,S=r.type,i!==null&&r.stateNode!=null)i.memoizedProps!==g&&Li(r);else{if(!g){if(r.stateNode===null)throw Error(a(166));return Wt(r),null}i=be.current,cs(r)?j1(r):(i=lk(S,g,u),r.stateNode=i,Li(r))}return Wt(r),null;case 5:if(Je(r),S=r.type,i!==null&&r.stateNode!=null)i.memoizedProps!==g&&Li(r);else{if(!g){if(r.stateNode===null)throw Error(a(166));return Wt(r),null}if(k=be.current,cs(r))j1(r);else{var I=Ad(ve.current);switch(k){case 1:k=I.createElementNS("http://www.w3.org/2000/svg",S);break;case 2:k=I.createElementNS("http://www.w3.org/1998/Math/MathML",S);break;default:switch(S){case"svg":k=I.createElementNS("http://www.w3.org/2000/svg",S);break;case"math":k=I.createElementNS("http://www.w3.org/1998/Math/MathML",S);break;case"script":k=I.createElement("div"),k.innerHTML="<script><\/script>",k=k.removeChild(k.firstChild);break;case"select":k=typeof g.is=="string"?I.createElement("select",{is:g.is}):I.createElement("select"),g.multiple?k.multiple=!0:g.size&&(k.size=g.size);break;default:k=typeof g.is=="string"?I.createElement(S,{is:g.is}):I.createElement(S)}}k[Sn]=r,k[Qn]=g;e:for(I=r.child;I!==null;){if(I.tag===5||I.tag===6)k.appendChild(I.stateNode);else if(I.tag!==4&&I.tag!==27&&I.child!==null){I.child.return=I,I=I.child;continue}if(I===r)break e;for(;I.sibling===null;){if(I.return===null||I.return===r)break e;I=I.return}I.sibling.return=I.return,I=I.sibling}r.stateNode=k;e:switch(Bn(k,S,g),S){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}g&&Li(r)}}return Wt(r),ch(r,r.type,i===null?null:i.memoizedProps,r.pendingProps,u),null;case 6:if(i&&r.stateNode!=null)i.memoizedProps!==g&&Li(r);else{if(typeof g!="string"&&r.stateNode===null)throw Error(a(166));if(i=ve.current,cs(r)){if(i=r.stateNode,u=r.memoizedProps,g=null,S=zn,S!==null)switch(S.tag){case 27:case 5:g=S.memoizedProps}i[Sn]=r,i=!!(i.nodeValue===u||g!==null&&g.suppressHydrationWarning===!0||Yx(i.nodeValue,u)),i||pr(r,!0)}else i=Ad(i).createTextNode(g),i[Sn]=r,r.stateNode=i}return Wt(r),null;case 31:if(u=r.memoizedState,i===null||i.memoizedState!==null){if(g=cs(r),u!==null){if(i===null){if(!g)throw Error(a(318));if(i=r.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(a(557));i[Sn]=r}else so(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Wt(r),i=!1}else u=bf(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=u),i=!0;if(!i)return r.flags&256?(Aa(r),r):(Aa(r),null);if((r.flags&128)!==0)throw Error(a(558))}return Wt(r),null;case 13:if(g=r.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(S=cs(r),g!==null&&g.dehydrated!==null){if(i===null){if(!S)throw Error(a(318));if(S=r.memoizedState,S=S!==null?S.dehydrated:null,!S)throw Error(a(317));S[Sn]=r}else so(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;Wt(r),S=!1}else S=bf(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=S),S=!0;if(!S)return r.flags&256?(Aa(r),r):(Aa(r),null)}return Aa(r),(r.flags&128)!==0?(r.lanes=u,r):(u=g!==null,i=i!==null&&i.memoizedState!==null,u&&(g=r.child,S=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(S=g.alternate.memoizedState.cachePool.pool),k=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(k=g.memoizedState.cachePool.pool),k!==S&&(g.flags|=2048)),u!==i&&u&&(r.child.flags|=8192),dd(r,r.updateQueue),Wt(r),null);case 4:return re(),i===null&&_h(r.stateNode.containerInfo),Wt(r),null;case 10:return ji(r.type),Wt(r),null;case 19:if(W(gn),g=r.memoizedState,g===null)return Wt(r),null;if(S=(r.flags&128)!==0,k=g.rendering,k===null)if(S)Wl(g,!1);else{if(cn!==0||i!==null&&(i.flags&128)!==0)for(i=r.child;i!==null;){if(k=Xu(i),k!==null){for(r.flags|=128,Wl(g,!1),i=k.updateQueue,r.updateQueue=i,dd(r,i),r.subtreeFlags=0,i=u,u=r.child;u!==null;)I1(u,i),u=u.sibling;return le(gn,gn.current&1|2),xt&&Ni(r,g.treeForkCount),r.child}i=i.sibling}g.tail!==null&&pn()>gd&&(r.flags|=128,S=!0,Wl(g,!1),r.lanes=4194304)}else{if(!S)if(i=Xu(k),i!==null){if(r.flags|=128,S=!0,i=i.updateQueue,r.updateQueue=i,dd(r,i),Wl(g,!0),g.tail===null&&g.tailMode==="hidden"&&!k.alternate&&!xt)return Wt(r),null}else 2*pn()-g.renderingStartTime>gd&&u!==536870912&&(r.flags|=128,S=!0,Wl(g,!1),r.lanes=4194304);g.isBackwards?(k.sibling=r.child,r.child=k):(i=g.last,i!==null?i.sibling=k:r.child=k,g.last=k)}return g.tail!==null?(i=g.tail,g.rendering=i,g.tail=i.sibling,g.renderingStartTime=pn(),i.sibling=null,u=gn.current,le(gn,S?u&1|2:u&1),xt&&Ni(r,g.treeForkCount),i):(Wt(r),null);case 22:case 23:return Aa(r),Nf(),g=r.memoizedState!==null,i!==null?i.memoizedState!==null!==g&&(r.flags|=8192):g&&(r.flags|=8192),g?(u&536870912)!==0&&(r.flags&128)===0&&(Wt(r),r.subtreeFlags&6&&(r.flags|=8192)):Wt(r),u=r.updateQueue,u!==null&&dd(r,u.retryQueue),u=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),g=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(g=r.memoizedState.cachePool.pool),g!==u&&(r.flags|=2048),i!==null&&W(uo),null;case 24:return u=null,i!==null&&(u=i.memoizedState.cache),r.memoizedState.cache!==u&&(r.flags|=2048),ji(kn),Wt(r),null;case 25:return null;case 30:return null}throw Error(a(156,r.tag))}function kj(i,r){switch(vf(r),r.tag){case 1:return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 3:return ji(kn),re(),i=r.flags,(i&65536)!==0&&(i&128)===0?(r.flags=i&-65537|128,r):null;case 26:case 27:case 5:return Je(r),null;case 31:if(r.memoizedState!==null){if(Aa(r),r.alternate===null)throw Error(a(340));so()}return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 13:if(Aa(r),i=r.memoizedState,i!==null&&i.dehydrated!==null){if(r.alternate===null)throw Error(a(340));so()}return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 19:return W(gn),null;case 4:return re(),null;case 10:return ji(r.type),null;case 22:case 23:return Aa(r),Nf(),i!==null&&W(uo),i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 24:return ji(kn),null;case 25:return null;default:return null}}function nx(i,r){switch(vf(r),r.tag){case 3:ji(kn),re();break;case 26:case 27:case 5:Je(r);break;case 4:re();break;case 31:r.memoizedState!==null&&Aa(r);break;case 13:Aa(r);break;case 19:W(gn);break;case 10:ji(r.type);break;case 22:case 23:Aa(r),Nf(),i!==null&&W(uo);break;case 24:ji(kn)}}function Yl(i,r){try{var u=r.updateQueue,g=u!==null?u.lastEffect:null;if(g!==null){var S=g.next;u=S;do{if((u.tag&i)===i){g=void 0;var k=u.create,I=u.inst;g=k(),I.destroy=g}u=u.next}while(u!==S)}}catch(P){Pt(r,r.return,P)}}function br(i,r,u){try{var g=r.updateQueue,S=g!==null?g.lastEffect:null;if(S!==null){var k=S.next;g=k;do{if((g.tag&i)===i){var I=g.inst,P=I.destroy;if(P!==void 0){I.destroy=void 0,S=r;var H=u,ne=P;try{ne()}catch(me){Pt(S,H,me)}}}g=g.next}while(g!==k)}}catch(me){Pt(r,r.return,me)}}function ax(i){var r=i.updateQueue;if(r!==null){var u=i.stateNode;try{G1(r,u)}catch(g){Pt(i,i.return,g)}}}function ix(i,r,u){u.props=go(i.type,i.memoizedProps),u.state=i.memoizedState;try{u.componentWillUnmount()}catch(g){Pt(i,r,g)}}function Xl(i,r){try{var u=i.ref;if(u!==null){switch(i.tag){case 26:case 27:case 5:var g=i.stateNode;break;case 30:g=i.stateNode;break;default:g=i.stateNode}typeof u=="function"?i.refCleanup=u(g):u.current=g}}catch(S){Pt(i,r,S)}}function fi(i,r){var u=i.ref,g=i.refCleanup;if(u!==null)if(typeof g=="function")try{g()}catch(S){Pt(i,r,S)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(S){Pt(i,r,S)}else u.current=null}function rx(i){var r=i.type,u=i.memoizedProps,g=i.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":u.autoFocus&&g.focus();break e;case"img":u.src?g.src=u.src:u.srcSet&&(g.srcset=u.srcSet)}}catch(S){Pt(i,i.return,S)}}function uh(i,r,u){try{var g=i.stateNode;$j(g,i.type,u,r),g[Qn]=r}catch(S){Pt(i,i.return,S)}}function ox(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&Ar(i.type)||i.tag===4}function dh(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||ox(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&Ar(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function ph(i,r,u){var g=i.tag;if(g===5||g===6)i=i.stateNode,r?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(i,r):(r=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,r.appendChild(i),u=u._reactRootContainer,u!=null||r.onclick!==null||(r.onclick=Yn));else if(g!==4&&(g===27&&Ar(i.type)&&(u=i.stateNode,r=null),i=i.child,i!==null))for(ph(i,r,u),i=i.sibling;i!==null;)ph(i,r,u),i=i.sibling}function pd(i,r,u){var g=i.tag;if(g===5||g===6)i=i.stateNode,r?u.insertBefore(i,r):u.appendChild(i);else if(g!==4&&(g===27&&Ar(i.type)&&(u=i.stateNode),i=i.child,i!==null))for(pd(i,r,u),i=i.sibling;i!==null;)pd(i,r,u),i=i.sibling}function sx(i){var r=i.stateNode,u=i.memoizedProps;try{for(var g=i.type,S=r.attributes;S.length;)r.removeAttributeNode(S[0]);Bn(r,g,u),r[Sn]=i,r[Qn]=u}catch(k){Pt(i,i.return,k)}}var qi=!1,Cn=!1,mh=!1,lx=typeof WeakSet=="function"?WeakSet:Set,jn=null;function wj(i,r){if(i=i.containerInfo,jh=Od,i=S1(i),of(i)){if("selectionStart"in i)var u={start:i.selectionStart,end:i.selectionEnd};else e:{u=(u=i.ownerDocument)&&u.defaultView||window;var g=u.getSelection&&u.getSelection();if(g&&g.rangeCount!==0){u=g.anchorNode;var S=g.anchorOffset,k=g.focusNode;g=g.focusOffset;try{u.nodeType,k.nodeType}catch{u=null;break e}var I=0,P=-1,H=-1,ne=0,me=0,Se=i,ie=null;t:for(;;){for(var ce;Se!==u||S!==0&&Se.nodeType!==3||(P=I+S),Se!==k||g!==0&&Se.nodeType!==3||(H=I+g),Se.nodeType===3&&(I+=Se.nodeValue.length),(ce=Se.firstChild)!==null;)ie=Se,Se=ce;for(;;){if(Se===i)break t;if(ie===u&&++ne===S&&(P=I),ie===k&&++me===g&&(H=I),(ce=Se.nextSibling)!==null)break;Se=ie,ie=Se.parentNode}Se=ce}u=P===-1||H===-1?null:{start:P,end:H}}else u=null}u=u||{start:0,end:0}}else u=null;for(Ph={focusedElem:i,selectionRange:u},Od=!1,jn=r;jn!==null;)if(r=jn,i=r.child,(r.subtreeFlags&1028)!==0&&i!==null)i.return=r,jn=i;else for(;jn!==null;){switch(r=jn,k=r.alternate,i=r.flags,r.tag){case 0:if((i&4)!==0&&(i=r.updateQueue,i=i!==null?i.events:null,i!==null))for(u=0;u<i.length;u++)S=i[u],S.ref.impl=S.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&k!==null){i=void 0,u=r,S=k.memoizedProps,k=k.memoizedState,g=u.stateNode;try{var Be=go(u.type,S);i=g.getSnapshotBeforeUpdate(Be,k),g.__reactInternalSnapshotBeforeUpdate=i}catch(Ke){Pt(u,u.return,Ke)}}break;case 3:if((i&1024)!==0){if(i=r.stateNode.containerInfo,u=i.nodeType,u===9)Lh(i);else if(u===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":Lh(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(a(163))}if(i=r.sibling,i!==null){i.return=r.return,jn=i;break}jn=r.return}}function cx(i,r,u){var g=u.flags;switch(u.tag){case 0:case 11:case 15:Fi(i,u),g&4&&Yl(5,u);break;case 1:if(Fi(i,u),g&4)if(i=u.stateNode,r===null)try{i.componentDidMount()}catch(I){Pt(u,u.return,I)}else{var S=go(u.type,r.memoizedProps);r=r.memoizedState;try{i.componentDidUpdate(S,r,i.__reactInternalSnapshotBeforeUpdate)}catch(I){Pt(u,u.return,I)}}g&64&&ax(u),g&512&&Xl(u,u.return);break;case 3:if(Fi(i,u),g&64&&(i=u.updateQueue,i!==null)){if(r=null,u.child!==null)switch(u.child.tag){case 27:case 5:r=u.child.stateNode;break;case 1:r=u.child.stateNode}try{G1(i,r)}catch(I){Pt(u,u.return,I)}}break;case 27:r===null&&g&4&&sx(u);case 26:case 5:Fi(i,u),r===null&&g&4&&rx(u),g&512&&Xl(u,u.return);break;case 12:Fi(i,u);break;case 31:Fi(i,u),g&4&&px(i,u);break;case 13:Fi(i,u),g&4&&mx(i,u),g&64&&(i=u.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(u=Nj.bind(null,u),Xj(i,u))));break;case 22:if(g=u.memoizedState!==null||qi,!g){r=r!==null&&r.memoizedState!==null||Cn,S=qi;var k=Cn;qi=g,(Cn=r)&&!k?Ui(i,u,(u.subtreeFlags&8772)!==0):Fi(i,u),qi=S,Cn=k}break;case 30:break;default:Fi(i,u)}}function ux(i){var r=i.alternate;r!==null&&(i.alternate=null,ux(r)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(r=i.stateNode,r!==null&&Yo(r)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var Xt=null,ua=!1;function Bi(i,r,u){for(u=u.child;u!==null;)dx(i,r,u),u=u.sibling}function dx(i,r,u){if(Pn&&typeof Pn.onCommitFiberUnmount=="function")try{Pn.onCommitFiberUnmount(oa,u)}catch{}switch(u.tag){case 26:Cn||fi(u,r),Bi(i,r,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:Cn||fi(u,r);var g=Xt,S=ua;Ar(u.type)&&(Xt=u.stateNode,ua=!1),Bi(i,r,u),sc(u.stateNode),Xt=g,ua=S;break;case 5:Cn||fi(u,r);case 6:if(g=Xt,S=ua,Xt=null,Bi(i,r,u),Xt=g,ua=S,Xt!==null)if(ua)try{(Xt.nodeType===9?Xt.body:Xt.nodeName==="HTML"?Xt.ownerDocument.body:Xt).removeChild(u.stateNode)}catch(k){Pt(u,r,k)}else try{Xt.removeChild(u.stateNode)}catch(k){Pt(u,r,k)}break;case 18:Xt!==null&&(ua?(i=Xt,ak(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,u.stateNode),Ts(i)):ak(Xt,u.stateNode));break;case 4:g=Xt,S=ua,Xt=u.stateNode.containerInfo,ua=!0,Bi(i,r,u),Xt=g,ua=S;break;case 0:case 11:case 14:case 15:br(2,u,r),Cn||br(4,u,r),Bi(i,r,u);break;case 1:Cn||(fi(u,r),g=u.stateNode,typeof g.componentWillUnmount=="function"&&ix(u,r,g)),Bi(i,r,u);break;case 21:Bi(i,r,u);break;case 22:Cn=(g=Cn)||u.memoizedState!==null,Bi(i,r,u),Cn=g;break;default:Bi(i,r,u)}}function px(i,r){if(r.memoizedState===null&&(i=r.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{Ts(i)}catch(u){Pt(r,r.return,u)}}}function mx(i,r){if(r.memoizedState===null&&(i=r.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{Ts(i)}catch(u){Pt(r,r.return,u)}}function Mj(i){switch(i.tag){case 31:case 13:case 19:var r=i.stateNode;return r===null&&(r=i.stateNode=new lx),r;case 22:return i=i.stateNode,r=i._retryCache,r===null&&(r=i._retryCache=new lx),r;default:throw Error(a(435,i.tag))}}function md(i,r){var u=Mj(i);r.forEach(function(g){if(!u.has(g)){u.add(g);var S=Oj.bind(null,i,g);g.then(S,S)}})}function da(i,r){var u=r.deletions;if(u!==null)for(var g=0;g<u.length;g++){var S=u[g],k=i,I=r,P=I;e:for(;P!==null;){switch(P.tag){case 27:if(Ar(P.type)){Xt=P.stateNode,ua=!1;break e}break;case 5:Xt=P.stateNode,ua=!1;break e;case 3:case 4:Xt=P.stateNode.containerInfo,ua=!0;break e}P=P.return}if(Xt===null)throw Error(a(160));dx(k,I,S),Xt=null,ua=!1,k=S.alternate,k!==null&&(k.return=null),S.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)fx(r,i),r=r.sibling}var Ya=null;function fx(i,r){var u=i.alternate,g=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:da(r,i),pa(i),g&4&&(br(3,i,i.return),Yl(3,i),br(5,i,i.return));break;case 1:da(r,i),pa(i),g&512&&(Cn||u===null||fi(u,u.return)),g&64&&qi&&(i=i.updateQueue,i!==null&&(g=i.callbacks,g!==null&&(u=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=u===null?g:u.concat(g))));break;case 26:var S=Ya;if(da(r,i),pa(i),g&512&&(Cn||u===null||fi(u,u.return)),g&4){var k=u!==null?u.memoizedState:null;if(g=i.memoizedState,u===null)if(g===null)if(i.stateNode===null){e:{g=i.type,u=i.memoizedProps,S=S.ownerDocument||S;t:switch(g){case"title":k=S.getElementsByTagName("title")[0],(!k||k[Jr]||k[Sn]||k.namespaceURI==="http://www.w3.org/2000/svg"||k.hasAttribute("itemprop"))&&(k=S.createElement(g),S.head.insertBefore(k,S.querySelector("head > title"))),Bn(k,g,u),k[Sn]=i,rn(k),g=k;break e;case"link":var I=fk("link","href",S).get(g+(u.href||""));if(I){for(var P=0;P<I.length;P++)if(k=I[P],k.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&k.getAttribute("rel")===(u.rel==null?null:u.rel)&&k.getAttribute("title")===(u.title==null?null:u.title)&&k.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){I.splice(P,1);break t}}k=S.createElement(g),Bn(k,g,u),S.head.appendChild(k);break;case"meta":if(I=fk("meta","content",S).get(g+(u.content||""))){for(P=0;P<I.length;P++)if(k=I[P],k.getAttribute("content")===(u.content==null?null:""+u.content)&&k.getAttribute("name")===(u.name==null?null:u.name)&&k.getAttribute("property")===(u.property==null?null:u.property)&&k.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&k.getAttribute("charset")===(u.charSet==null?null:u.charSet)){I.splice(P,1);break t}}k=S.createElement(g),Bn(k,g,u),S.head.appendChild(k);break;default:throw Error(a(468,g))}k[Sn]=i,rn(k),g=k}i.stateNode=g}else hk(S,i.type,i.stateNode);else i.stateNode=mk(S,g,i.memoizedProps);else k!==g?(k===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):k.count--,g===null?hk(S,i.type,i.stateNode):mk(S,g,i.memoizedProps)):g===null&&i.stateNode!==null&&uh(i,i.memoizedProps,u.memoizedProps)}break;case 27:da(r,i),pa(i),g&512&&(Cn||u===null||fi(u,u.return)),u!==null&&g&4&&uh(i,i.memoizedProps,u.memoizedProps);break;case 5:if(da(r,i),pa(i),g&512&&(Cn||u===null||fi(u,u.return)),i.flags&32){S=i.stateNode;try{Kn(S,"")}catch(Be){Pt(i,i.return,Be)}}g&4&&i.stateNode!=null&&(S=i.memoizedProps,uh(i,S,u!==null?u.memoizedProps:S)),g&1024&&(mh=!0);break;case 6:if(da(r,i),pa(i),g&4){if(i.stateNode===null)throw Error(a(162));g=i.memoizedProps,u=i.stateNode;try{u.nodeValue=g}catch(Be){Pt(i,i.return,Be)}}break;case 3:if(Id=null,S=Ya,Ya=Ed(r.containerInfo),da(r,i),Ya=S,pa(i),g&4&&u!==null&&u.memoizedState.isDehydrated)try{Ts(r.containerInfo)}catch(Be){Pt(i,i.return,Be)}mh&&(mh=!1,hx(i));break;case 4:g=Ya,Ya=Ed(i.stateNode.containerInfo),da(r,i),pa(i),Ya=g;break;case 12:da(r,i),pa(i);break;case 31:da(r,i),pa(i),g&4&&(g=i.updateQueue,g!==null&&(i.updateQueue=null,md(i,g)));break;case 13:da(r,i),pa(i),i.child.flags&8192&&i.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(hd=pn()),g&4&&(g=i.updateQueue,g!==null&&(i.updateQueue=null,md(i,g)));break;case 22:S=i.memoizedState!==null;var H=u!==null&&u.memoizedState!==null,ne=qi,me=Cn;if(qi=ne||S,Cn=me||H,da(r,i),Cn=me,qi=ne,pa(i),g&8192)e:for(r=i.stateNode,r._visibility=S?r._visibility&-2:r._visibility|1,S&&(u===null||H||qi||Cn||vo(i)),u=null,r=i;;){if(r.tag===5||r.tag===26){if(u===null){H=u=r;try{if(k=H.stateNode,S)I=k.style,typeof I.setProperty=="function"?I.setProperty("display","none","important"):I.display="none";else{P=H.stateNode;var Se=H.memoizedProps.style,ie=Se!=null&&Se.hasOwnProperty("display")?Se.display:null;P.style.display=ie==null||typeof ie=="boolean"?"":(""+ie).trim()}}catch(Be){Pt(H,H.return,Be)}}}else if(r.tag===6){if(u===null){H=r;try{H.stateNode.nodeValue=S?"":H.memoizedProps}catch(Be){Pt(H,H.return,Be)}}}else if(r.tag===18){if(u===null){H=r;try{var ce=H.stateNode;S?ik(ce,!0):ik(H.stateNode,!1)}catch(Be){Pt(H,H.return,Be)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===i)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break e;for(;r.sibling===null;){if(r.return===null||r.return===i)break e;u===r&&(u=null),r=r.return}u===r&&(u=null),r.sibling.return=r.return,r=r.sibling}g&4&&(g=i.updateQueue,g!==null&&(u=g.retryQueue,u!==null&&(g.retryQueue=null,md(i,u))));break;case 19:da(r,i),pa(i),g&4&&(g=i.updateQueue,g!==null&&(i.updateQueue=null,md(i,g)));break;case 30:break;case 21:break;default:da(r,i),pa(i)}}function pa(i){var r=i.flags;if(r&2){try{for(var u,g=i.return;g!==null;){if(ox(g)){u=g;break}g=g.return}if(u==null)throw Error(a(160));switch(u.tag){case 27:var S=u.stateNode,k=dh(i);pd(i,k,S);break;case 5:var I=u.stateNode;u.flags&32&&(Kn(I,""),u.flags&=-33);var P=dh(i);pd(i,P,I);break;case 3:case 4:var H=u.stateNode.containerInfo,ne=dh(i);ph(i,ne,H);break;default:throw Error(a(161))}}catch(me){Pt(i,i.return,me)}i.flags&=-3}r&4096&&(i.flags&=-4097)}function hx(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var r=i;hx(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),i=i.sibling}}function Fi(i,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)cx(i,r.alternate,r),r=r.sibling}function vo(i){for(i=i.child;i!==null;){var r=i;switch(r.tag){case 0:case 11:case 14:case 15:br(4,r,r.return),vo(r);break;case 1:fi(r,r.return);var u=r.stateNode;typeof u.componentWillUnmount=="function"&&ix(r,r.return,u),vo(r);break;case 27:sc(r.stateNode);case 26:case 5:fi(r,r.return),vo(r);break;case 22:r.memoizedState===null&&vo(r);break;case 30:vo(r);break;default:vo(r)}i=i.sibling}}function Ui(i,r,u){for(u=u&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var g=r.alternate,S=i,k=r,I=k.flags;switch(k.tag){case 0:case 11:case 15:Ui(S,k,u),Yl(4,k);break;case 1:if(Ui(S,k,u),g=k,S=g.stateNode,typeof S.componentDidMount=="function")try{S.componentDidMount()}catch(ne){Pt(g,g.return,ne)}if(g=k,S=g.updateQueue,S!==null){var P=g.stateNode;try{var H=S.shared.hiddenCallbacks;if(H!==null)for(S.shared.hiddenCallbacks=null,S=0;S<H.length;S++)V1(H[S],P)}catch(ne){Pt(g,g.return,ne)}}u&&I&64&&ax(k),Xl(k,k.return);break;case 27:sx(k);case 26:case 5:Ui(S,k,u),u&&g===null&&I&4&&rx(k),Xl(k,k.return);break;case 12:Ui(S,k,u);break;case 31:Ui(S,k,u),u&&I&4&&px(S,k);break;case 13:Ui(S,k,u),u&&I&4&&mx(S,k);break;case 22:k.memoizedState===null&&Ui(S,k,u),Xl(k,k.return);break;case 30:break;default:Ui(S,k,u)}r=r.sibling}}function fh(i,r){var u=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),i=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(i=r.memoizedState.cachePool.pool),i!==u&&(i!=null&&i.refCount++,u!=null&&Ll(u))}function hh(i,r){i=null,r.alternate!==null&&(i=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==i&&(r.refCount++,i!=null&&Ll(i))}function Xa(i,r,u,g){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)gx(i,r,u,g),r=r.sibling}function gx(i,r,u,g){var S=r.flags;switch(r.tag){case 0:case 11:case 15:Xa(i,r,u,g),S&2048&&Yl(9,r);break;case 1:Xa(i,r,u,g);break;case 3:Xa(i,r,u,g),S&2048&&(i=null,r.alternate!==null&&(i=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==i&&(r.refCount++,i!=null&&Ll(i)));break;case 12:if(S&2048){Xa(i,r,u,g),i=r.stateNode;try{var k=r.memoizedProps,I=k.id,P=k.onPostCommit;typeof P=="function"&&P(I,r.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(H){Pt(r,r.return,H)}}else Xa(i,r,u,g);break;case 31:Xa(i,r,u,g);break;case 13:Xa(i,r,u,g);break;case 23:break;case 22:k=r.stateNode,I=r.alternate,r.memoizedState!==null?k._visibility&2?Xa(i,r,u,g):Jl(i,r):k._visibility&2?Xa(i,r,u,g):(k._visibility|=2,bs(i,r,u,g,(r.subtreeFlags&10256)!==0||!1)),S&2048&&fh(I,r);break;case 24:Xa(i,r,u,g),S&2048&&hh(r.alternate,r);break;default:Xa(i,r,u,g)}}function bs(i,r,u,g,S){for(S=S&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var k=i,I=r,P=u,H=g,ne=I.flags;switch(I.tag){case 0:case 11:case 15:bs(k,I,P,H,S),Yl(8,I);break;case 23:break;case 22:var me=I.stateNode;I.memoizedState!==null?me._visibility&2?bs(k,I,P,H,S):Jl(k,I):(me._visibility|=2,bs(k,I,P,H,S)),S&&ne&2048&&fh(I.alternate,I);break;case 24:bs(k,I,P,H,S),S&&ne&2048&&hh(I.alternate,I);break;default:bs(k,I,P,H,S)}r=r.sibling}}function Jl(i,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var u=i,g=r,S=g.flags;switch(g.tag){case 22:Jl(u,g),S&2048&&fh(g.alternate,g);break;case 24:Jl(u,g),S&2048&&hh(g.alternate,g);break;default:Jl(u,g)}r=r.sibling}}var ec=8192;function Ss(i,r,u){if(i.subtreeFlags&ec)for(i=i.child;i!==null;)vx(i,r,u),i=i.sibling}function vx(i,r,u){switch(i.tag){case 26:Ss(i,r,u),i.flags&ec&&i.memoizedState!==null&&uP(u,Ya,i.memoizedState,i.memoizedProps);break;case 5:Ss(i,r,u);break;case 3:case 4:var g=Ya;Ya=Ed(i.stateNode.containerInfo),Ss(i,r,u),Ya=g;break;case 22:i.memoizedState===null&&(g=i.alternate,g!==null&&g.memoizedState!==null?(g=ec,ec=16777216,Ss(i,r,u),ec=g):Ss(i,r,u));break;default:Ss(i,r,u)}}function yx(i){var r=i.alternate;if(r!==null&&(i=r.child,i!==null)){r.child=null;do r=i.sibling,i.sibling=null,i=r;while(i!==null)}}function tc(i){var r=i.deletions;if((i.flags&16)!==0){if(r!==null)for(var u=0;u<r.length;u++){var g=r[u];jn=g,Sx(g,i)}yx(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)bx(i),i=i.sibling}function bx(i){switch(i.tag){case 0:case 11:case 15:tc(i),i.flags&2048&&br(9,i,i.return);break;case 3:tc(i);break;case 12:tc(i);break;case 22:var r=i.stateNode;i.memoizedState!==null&&r._visibility&2&&(i.return===null||i.return.tag!==13)?(r._visibility&=-3,fd(i)):tc(i);break;default:tc(i)}}function fd(i){var r=i.deletions;if((i.flags&16)!==0){if(r!==null)for(var u=0;u<r.length;u++){var g=r[u];jn=g,Sx(g,i)}yx(i)}for(i=i.child;i!==null;){switch(r=i,r.tag){case 0:case 11:case 15:br(8,r,r.return),fd(r);break;case 22:u=r.stateNode,u._visibility&2&&(u._visibility&=-3,fd(r));break;default:fd(r)}i=i.sibling}}function Sx(i,r){for(;jn!==null;){var u=jn;switch(u.tag){case 0:case 11:case 15:br(8,u,r);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var g=u.memoizedState.cachePool.pool;g!=null&&g.refCount++}break;case 24:Ll(u.memoizedState.cache)}if(g=u.child,g!==null)g.return=u,jn=g;else e:for(u=i;jn!==null;){g=jn;var S=g.sibling,k=g.return;if(ux(g),g===u){jn=null;break e}if(S!==null){S.return=k,jn=S;break e}jn=k}}}var Cj={getCacheForType:function(i){var r=Ln(kn),u=r.data.get(i);return u===void 0&&(u=i(),r.data.set(i,u)),u},cacheSignal:function(){return Ln(kn).controller.signal}},Aj=typeof WeakMap=="function"?WeakMap:Map,Tt=0,Vt=null,mt=null,vt=0,jt=0,Ea=null,Sr=!1,xs=!1,gh=!1,Hi=0,cn=0,xr=0,yo=0,vh=0,Ra=0,ks=0,nc=null,ma=null,yh=!1,hd=0,xx=0,gd=1/0,vd=null,kr=null,Tn=0,wr=null,ws=null,$i=0,bh=0,Sh=null,kx=null,ac=0,xh=null;function Ia(){return(Tt&2)!==0&&vt!==0?vt&-vt:Q.T!==null?Eh():xl()}function wx(){if(Ra===0)if((vt&536870912)===0||xt){var i=de;de<<=1,(de&3932160)===0&&(de=262144),Ra=i}else Ra=536870912;return i=Ca.current,i!==null&&(i.flags|=32),Ra}function fa(i,r,u){(i===Vt&&(jt===2||jt===9)||i.cancelPendingCommit!==null)&&(Ms(i,0),Mr(i,vt,Ra,!1)),xa(i,u),((Tt&2)===0||i!==Vt)&&(i===Vt&&((Tt&2)===0&&(yo|=u),cn===4&&Mr(i,vt,Ra,!1)),hi(i))}function Mx(i,r,u){if((Tt&6)!==0)throw Error(a(327));var g=!u&&(r&127)===0&&(r&i.expiredLanes)===0||On(i,r),S=g?Ij(i,r):wh(i,r,!0),k=g;do{if(S===0){xs&&!g&&Mr(i,r,0,!1);break}else{if(u=i.current.alternate,k&&!Ej(u)){S=wh(i,r,!1),k=!1;continue}if(S===2){if(k=r,i.errorRecoveryDisabledLanes&k)var I=0;else I=i.pendingLanes&-536870913,I=I!==0?I:I&536870912?536870912:0;if(I!==0){r=I;e:{var P=i;S=nc;var H=P.current.memoizedState.isDehydrated;if(H&&(Ms(P,I).flags|=256),I=wh(P,I,!1),I!==2){if(gh&&!H){P.errorRecoveryDisabledLanes|=k,yo|=k,S=4;break e}k=ma,ma=S,k!==null&&(ma===null?ma=k:ma.push.apply(ma,k))}S=I}if(k=!1,S!==2)continue}}if(S===1){Ms(i,0),Mr(i,r,0,!0);break}e:{switch(g=i,k=S,k){case 0:case 1:throw Error(a(345));case 4:if((r&4194048)!==r)break;case 6:Mr(g,r,Ra,!Sr);break e;case 2:ma=null;break;case 3:case 5:break;default:throw Error(a(329))}if((r&62914560)===r&&(S=hd+300-pn(),10<S)){if(Mr(g,r,Ra,!Sr),Zt(g,0,!0)!==0)break e;$i=r,g.timeoutHandle=tk(Cx.bind(null,g,u,ma,vd,yh,r,Ra,yo,ks,Sr,k,"Throttled",-0,0),S);break e}Cx(g,u,ma,vd,yh,r,Ra,yo,ks,Sr,k,null,-0,0)}}break}while(!0);hi(i)}function Cx(i,r,u,g,S,k,I,P,H,ne,me,Se,ie,ce){if(i.timeoutHandle=-1,Se=r.subtreeFlags,Se&8192||(Se&16785408)===16785408){Se={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Yn},vx(r,k,Se);var Be=(k&62914560)===k?hd-pn():(k&4194048)===k?xx-pn():0;if(Be=dP(Se,Be),Be!==null){$i=k,i.cancelPendingCommit=Be(Ox.bind(null,i,r,k,u,g,S,I,P,H,me,Se,null,ie,ce)),Mr(i,k,I,!ne);return}}Ox(i,r,k,u,g,S,I,P,H)}function Ej(i){for(var r=i;;){var u=r.tag;if((u===0||u===11||u===15)&&r.flags&16384&&(u=r.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var g=0;g<u.length;g++){var S=u[g],k=S.getSnapshot;S=S.value;try{if(!wa(k(),S))return!1}catch{return!1}}if(u=r.child,r.subtreeFlags&16384&&u!==null)u.return=r,r=u;else{if(r===i)break;for(;r.sibling===null;){if(r.return===null||r.return===i)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function Mr(i,r,u,g){r&=~vh,r&=~yo,i.suspendedLanes|=r,i.pingedLanes&=~r,g&&(i.warmLanes|=r),g=i.expirationTimes;for(var S=r;0<S;){var k=31-Nn(S),I=1<<k;g[k]=-1,S&=~I}u!==0&&Sl(i,u,r)}function yd(){return(Tt&6)===0?(ic(0),!1):!0}function kh(){if(mt!==null){if(jt===0)var i=mt.return;else i=mt,Oi=lo=null,Lf(i),fs=null,Bl=0,i=mt;for(;i!==null;)nx(i.alternate,i),i=i.return;mt=null}}function Ms(i,r){var u=i.timeoutHandle;u!==-1&&(i.timeoutHandle=-1,Gj(u)),u=i.cancelPendingCommit,u!==null&&(i.cancelPendingCommit=null,u()),$i=0,kh(),Vt=i,mt=u=_i(i.current,null),vt=r,jt=0,Ea=null,Sr=!1,xs=On(i,r),gh=!1,ks=Ra=vh=yo=xr=cn=0,ma=nc=null,yh=!1,(r&8)!==0&&(r|=r&32);var g=i.entangledLanes;if(g!==0)for(i=i.entanglements,g&=r;0<g;){var S=31-Nn(g),k=1<<S;r|=i[S],g&=~k}return Hi=r,qu(),u}function Ax(i,r){st=null,Q.H=Zl,r===ms||r===Gu?(r=U1(),jt=3):r===Af?(r=U1(),jt=4):jt=r===eh?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,Ea=r,mt===null&&(cn=1,sd(i,Da(r,i.current)))}function Ex(){var i=Ca.current;return i===null?!0:(vt&4194048)===vt?Ba===null:(vt&62914560)===vt||(vt&536870912)!==0?i===Ba:!1}function Rx(){var i=Q.H;return Q.H=Zl,i===null?Zl:i}function Ix(){var i=Q.A;return Q.A=Cj,i}function bd(){cn=4,Sr||(vt&4194048)!==vt&&Ca.current!==null||(xs=!0),(xr&134217727)===0&&(yo&134217727)===0||Vt===null||Mr(Vt,vt,Ra,!1)}function wh(i,r,u){var g=Tt;Tt|=2;var S=Rx(),k=Ix();(Vt!==i||vt!==r)&&(vd=null,Ms(i,r)),r=!1;var I=cn;e:do try{if(jt!==0&&mt!==null){var P=mt,H=Ea;switch(jt){case 8:kh(),I=6;break e;case 3:case 2:case 9:case 6:Ca.current===null&&(r=!0);var ne=jt;if(jt=0,Ea=null,Cs(i,P,H,ne),u&&xs){I=0;break e}break;default:ne=jt,jt=0,Ea=null,Cs(i,P,H,ne)}}Rj(),I=cn;break}catch(me){Ax(i,me)}while(!0);return r&&i.shellSuspendCounter++,Oi=lo=null,Tt=g,Q.H=S,Q.A=k,mt===null&&(Vt=null,vt=0,qu()),I}function Rj(){for(;mt!==null;)Tx(mt)}function Ij(i,r){var u=Tt;Tt|=2;var g=Rx(),S=Ix();Vt!==i||vt!==r?(vd=null,gd=pn()+500,Ms(i,r)):xs=On(i,r);e:do try{if(jt!==0&&mt!==null){r=mt;var k=Ea;t:switch(jt){case 1:jt=0,Ea=null,Cs(i,r,k,1);break;case 2:case 9:if(B1(k)){jt=0,Ea=null,_x(r);break}r=function(){jt!==2&&jt!==9||Vt!==i||(jt=7),hi(i)},k.then(r,r);break e;case 3:jt=7;break e;case 4:jt=5;break e;case 7:B1(k)?(jt=0,Ea=null,_x(r)):(jt=0,Ea=null,Cs(i,r,k,7));break;case 5:var I=null;switch(mt.tag){case 26:I=mt.memoizedState;case 5:case 27:var P=mt;if(I?gk(I):P.stateNode.complete){jt=0,Ea=null;var H=P.sibling;if(H!==null)mt=H;else{var ne=P.return;ne!==null?(mt=ne,Sd(ne)):mt=null}break t}}jt=0,Ea=null,Cs(i,r,k,5);break;case 6:jt=0,Ea=null,Cs(i,r,k,6);break;case 8:kh(),cn=6;break e;default:throw Error(a(462))}}Tj();break}catch(me){Ax(i,me)}while(!0);return Oi=lo=null,Q.H=g,Q.A=S,Tt=u,mt!==null?0:(Vt=null,vt=0,qu(),cn)}function Tj(){for(;mt!==null&&!en();)Tx(mt)}function Tx(i){var r=ex(i.alternate,i,Hi);i.memoizedProps=i.pendingProps,r===null?Sd(i):mt=r}function _x(i){var r=i,u=r.alternate;switch(r.tag){case 15:case 0:r=ZS(u,r,r.pendingProps,r.type,void 0,vt);break;case 11:r=ZS(u,r,r.pendingProps,r.type.render,r.ref,vt);break;case 5:Lf(r);default:nx(u,r),r=mt=I1(r,Hi),r=ex(u,r,Hi)}i.memoizedProps=i.pendingProps,r===null?Sd(i):mt=r}function Cs(i,r,u,g){Oi=lo=null,Lf(r),fs=null,Bl=0;var S=r.return;try{if(yj(i,S,r,u,vt)){cn=1,sd(i,Da(u,i.current)),mt=null;return}}catch(k){if(S!==null)throw mt=S,k;cn=1,sd(i,Da(u,i.current)),mt=null;return}r.flags&32768?(xt||g===1?i=!0:xs||(vt&536870912)!==0?i=!1:(Sr=i=!0,(g===2||g===9||g===3||g===6)&&(g=Ca.current,g!==null&&g.tag===13&&(g.flags|=16384))),Nx(r,i)):Sd(r)}function Sd(i){var r=i;do{if((r.flags&32768)!==0){Nx(r,Sr);return}i=r.return;var u=xj(r.alternate,r,Hi);if(u!==null){mt=u;return}if(r=r.sibling,r!==null){mt=r;return}mt=r=i}while(r!==null);cn===0&&(cn=5)}function Nx(i,r){do{var u=kj(i.alternate,i);if(u!==null){u.flags&=32767,mt=u;return}if(u=i.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!r&&(i=i.sibling,i!==null)){mt=i;return}mt=i=u}while(i!==null);cn=6,mt=null}function Ox(i,r,u,g,S,k,I,P,H){i.cancelPendingCommit=null;do xd();while(Tn!==0);if((Tt&6)!==0)throw Error(a(327));if(r!==null){if(r===i.current)throw Error(a(177));if(k=r.lanes|r.childLanes,k|=df,_u(i,u,k,I,P,H),i===Vt&&(mt=Vt=null,vt=0),ws=r,wr=i,$i=u,bh=k,Sh=S,kx=g,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,jj($n,function(){return Lx(),null})):(i.callbackNode=null,i.callbackPriority=0),g=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||g){g=Q.T,Q.T=null,S=oe.p,oe.p=2,I=Tt,Tt|=4;try{wj(i,r,u)}finally{Tt=I,oe.p=S,Q.T=g}}Tn=1,jx(),Px(),Dx()}}function jx(){if(Tn===1){Tn=0;var i=wr,r=ws,u=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||u){u=Q.T,Q.T=null;var g=oe.p;oe.p=2;var S=Tt;Tt|=4;try{fx(r,i);var k=Ph,I=S1(i.containerInfo),P=k.focusedElem,H=k.selectionRange;if(I!==P&&P&&P.ownerDocument&&b1(P.ownerDocument.documentElement,P)){if(H!==null&&of(P)){var ne=H.start,me=H.end;if(me===void 0&&(me=ne),"selectionStart"in P)P.selectionStart=ne,P.selectionEnd=Math.min(me,P.value.length);else{var Se=P.ownerDocument||document,ie=Se&&Se.defaultView||window;if(ie.getSelection){var ce=ie.getSelection(),Be=P.textContent.length,Ke=Math.min(H.start,Be),Ft=H.end===void 0?Ke:Math.min(H.end,Be);!ce.extend&&Ke>Ft&&(I=Ft,Ft=Ke,Ke=I);var Y=y1(P,Ke),K=y1(P,Ft);if(Y&&K&&(ce.rangeCount!==1||ce.anchorNode!==Y.node||ce.anchorOffset!==Y.offset||ce.focusNode!==K.node||ce.focusOffset!==K.offset)){var te=Se.createRange();te.setStart(Y.node,Y.offset),ce.removeAllRanges(),Ke>Ft?(ce.addRange(te),ce.extend(K.node,K.offset)):(te.setEnd(K.node,K.offset),ce.addRange(te))}}}}for(Se=[],ce=P;ce=ce.parentNode;)ce.nodeType===1&&Se.push({element:ce,left:ce.scrollLeft,top:ce.scrollTop});for(typeof P.focus=="function"&&P.focus(),P=0;P<Se.length;P++){var ye=Se[P];ye.element.scrollLeft=ye.left,ye.element.scrollTop=ye.top}}Od=!!jh,Ph=jh=null}finally{Tt=S,oe.p=g,Q.T=u}}i.current=r,Tn=2}}function Px(){if(Tn===2){Tn=0;var i=wr,r=ws,u=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||u){u=Q.T,Q.T=null;var g=oe.p;oe.p=2;var S=Tt;Tt|=4;try{cx(i,r.alternate,r)}finally{Tt=S,oe.p=g,Q.T=u}}Tn=3}}function Dx(){if(Tn===4||Tn===3){Tn=0,In();var i=wr,r=ws,u=$i,g=kx;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?Tn=5:(Tn=0,ws=wr=null,zx(i,i.pendingLanes));var S=i.pendingLanes;if(S===0&&(kr=null),Wo(u),r=r.stateNode,Pn&&typeof Pn.onCommitFiberRoot=="function")try{Pn.onCommitFiberRoot(oa,r,void 0,(r.current.flags&128)===128)}catch{}if(g!==null){r=Q.T,S=oe.p,oe.p=2,Q.T=null;try{for(var k=i.onRecoverableError,I=0;I<g.length;I++){var P=g[I];k(P.value,{componentStack:P.stack})}}finally{Q.T=r,oe.p=S}}($i&3)!==0&&xd(),hi(i),S=i.pendingLanes,(u&261930)!==0&&(S&42)!==0?i===xh?ac++:(ac=0,xh=i):ac=0,ic(0)}}function zx(i,r){(i.pooledCacheLanes&=r)===0&&(r=i.pooledCache,r!=null&&(i.pooledCache=null,Ll(r)))}function xd(){return jx(),Px(),Dx(),Lx()}function Lx(){if(Tn!==5)return!1;var i=wr,r=bh;bh=0;var u=Wo($i),g=Q.T,S=oe.p;try{oe.p=32>u?32:u,Q.T=null,u=Sh,Sh=null;var k=wr,I=$i;if(Tn=0,ws=wr=null,$i=0,(Tt&6)!==0)throw Error(a(331));var P=Tt;if(Tt|=4,bx(k.current),gx(k,k.current,I,u),Tt=P,ic(0,!1),Pn&&typeof Pn.onPostCommitFiberRoot=="function")try{Pn.onPostCommitFiberRoot(oa,k)}catch{}return!0}finally{oe.p=S,Q.T=g,zx(i,r)}}function qx(i,r,u){r=Da(u,r),r=Jf(i.stateNode,r,2),i=gr(i,r,2),i!==null&&(xa(i,2),hi(i))}function Pt(i,r,u){if(i.tag===3)qx(i,i,u);else for(;r!==null;){if(r.tag===3){qx(r,i,u);break}else if(r.tag===1){var g=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(kr===null||!kr.has(g))){i=Da(u,i),u=BS(2),g=gr(r,u,2),g!==null&&(FS(u,g,r,i),xa(g,2),hi(g));break}}r=r.return}}function Mh(i,r,u){var g=i.pingCache;if(g===null){g=i.pingCache=new Aj;var S=new Set;g.set(r,S)}else S=g.get(r),S===void 0&&(S=new Set,g.set(r,S));S.has(u)||(gh=!0,S.add(u),i=_j.bind(null,i,r,u),r.then(i,i))}function _j(i,r,u){var g=i.pingCache;g!==null&&g.delete(r),i.pingedLanes|=i.suspendedLanes&u,i.warmLanes&=~u,Vt===i&&(vt&u)===u&&(cn===4||cn===3&&(vt&62914560)===vt&&300>pn()-hd?(Tt&2)===0&&Ms(i,0):vh|=u,ks===vt&&(ks=0)),hi(i)}function Bx(i,r){r===0&&(r=Tu()),i=ro(i,r),i!==null&&(xa(i,r),hi(i))}function Nj(i){var r=i.memoizedState,u=0;r!==null&&(u=r.retryLane),Bx(i,u)}function Oj(i,r){var u=0;switch(i.tag){case 31:case 13:var g=i.stateNode,S=i.memoizedState;S!==null&&(u=S.retryLane);break;case 19:g=i.stateNode;break;case 22:g=i.stateNode._retryCache;break;default:throw Error(a(314))}g!==null&&g.delete(r),Bx(i,u)}function jj(i,r){return rt(i,r)}var kd=null,As=null,Ch=!1,wd=!1,Ah=!1,Cr=0;function hi(i){i!==As&&i.next===null&&(As===null?kd=As=i:As=As.next=i),wd=!0,Ch||(Ch=!0,Dj())}function ic(i,r){if(!Ah&&wd){Ah=!0;do for(var u=!1,g=kd;g!==null;){if(i!==0){var S=g.pendingLanes;if(S===0)var k=0;else{var I=g.suspendedLanes,P=g.pingedLanes;k=(1<<31-Nn(42|i)+1)-1,k&=S&~(I&~P),k=k&201326741?k&201326741|1:k?k|2:0}k!==0&&(u=!0,$x(g,k))}else k=vt,k=Zt(g,g===Vt?k:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(k&3)===0||On(g,k)||(u=!0,$x(g,k));g=g.next}while(u);Ah=!1}}function Pj(){Fx()}function Fx(){wd=Ch=!1;var i=0;Cr!==0&&Vj()&&(i=Cr);for(var r=pn(),u=null,g=kd;g!==null;){var S=g.next,k=Ux(g,r);k===0?(g.next=null,u===null?kd=S:u.next=S,S===null&&(As=u)):(u=g,(i!==0||(k&3)!==0)&&(wd=!0)),g=S}Tn!==0&&Tn!==5||ic(i),Cr!==0&&(Cr=0)}function Ux(i,r){for(var u=i.suspendedLanes,g=i.pingedLanes,S=i.expirationTimes,k=i.pendingLanes&-62914561;0<k;){var I=31-Nn(k),P=1<<I,H=S[I];H===-1?((P&u)===0||(P&g)!==0)&&(S[I]=Ei(P,r)):H<=r&&(i.expiredLanes|=P),k&=~P}if(r=Vt,u=vt,u=Zt(i,i===r?u:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),g=i.callbackNode,u===0||i===r&&(jt===2||jt===9)||i.cancelPendingCommit!==null)return g!==null&&g!==null&&$t(g),i.callbackNode=null,i.callbackPriority=0;if((u&3)===0||On(i,u)){if(r=u&-u,r===i.callbackPriority)return r;switch(g!==null&&$t(g),Wo(u)){case 2:case 8:u=li;break;case 32:u=$n;break;case 268435456:u=et;break;default:u=$n}return g=Hx.bind(null,i),u=rt(u,g),i.callbackPriority=r,i.callbackNode=u,r}return g!==null&&g!==null&&$t(g),i.callbackPriority=2,i.callbackNode=null,2}function Hx(i,r){if(Tn!==0&&Tn!==5)return i.callbackNode=null,i.callbackPriority=0,null;var u=i.callbackNode;if(xd()&&i.callbackNode!==u)return null;var g=vt;return g=Zt(i,i===Vt?g:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),g===0?null:(Mx(i,g,r),Ux(i,pn()),i.callbackNode!=null&&i.callbackNode===u?Hx.bind(null,i):null)}function $x(i,r){if(xd())return null;Mx(i,r,!0)}function Dj(){Zj(function(){(Tt&6)!==0?rt(Sa,Pj):Fx()})}function Eh(){if(Cr===0){var i=ds;i===0&&(i=Va,Va<<=1,(Va&261888)===0&&(Va=256)),Cr=i}return Cr}function Qx(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Ii(""+i)}function Vx(i,r){var u=r.ownerDocument.createElement("input");return u.name=r.name,u.value=r.value,i.id&&u.setAttribute("form",i.id),r.parentNode.insertBefore(u,r),i=new FormData(i),u.parentNode.removeChild(u),i}function zj(i,r,u,g,S){if(r==="submit"&&u&&u.stateNode===S){var k=Qx((S[Qn]||null).action),I=g.submitter;I&&(r=(r=I[Qn]||null)?Qx(r.formAction):I.getAttribute("formAction"),r!==null&&(k=r,I=null));var P=new Pu("action","action",null,g,S);i.push({event:P,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(Cr!==0){var H=I?Vx(S,I):new FormData(S);Gf(u,{pending:!0,data:H,method:S.method,action:k},null,H)}}else typeof k=="function"&&(P.preventDefault(),H=I?Vx(S,I):new FormData(S),Gf(u,{pending:!0,data:H,method:S.method,action:k},k,H))},currentTarget:S}]})}}for(var Rh=0;Rh<uf.length;Rh++){var Ih=uf[Rh],Lj=Ih.toLowerCase(),qj=Ih[0].toUpperCase()+Ih.slice(1);Wa(Lj,"on"+qj)}Wa(w1,"onAnimationEnd"),Wa(M1,"onAnimationIteration"),Wa(C1,"onAnimationStart"),Wa("dblclick","onDoubleClick"),Wa("focusin","onFocus"),Wa("focusout","onBlur"),Wa(tj,"onTransitionRun"),Wa(nj,"onTransitionStart"),Wa(aj,"onTransitionCancel"),Wa(A1,"onTransitionEnd"),la("onMouseEnter",["mouseout","mouseover"]),la("onMouseLeave",["mouseout","mouseover"]),la("onPointerEnter",["pointerout","pointerover"]),la("onPointerLeave",["pointerout","pointerover"]),Ri("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ri("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ri("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ri("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ri("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ri("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var rc="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Bj=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(rc));function Gx(i,r){r=(r&4)!==0;for(var u=0;u<i.length;u++){var g=i[u],S=g.event;g=g.listeners;e:{var k=void 0;if(r)for(var I=g.length-1;0<=I;I--){var P=g[I],H=P.instance,ne=P.currentTarget;if(P=P.listener,H!==k&&S.isPropagationStopped())break e;k=P,S.currentTarget=ne;try{k(S)}catch(me){Lu(me)}S.currentTarget=null,k=H}else for(I=0;I<g.length;I++){if(P=g[I],H=P.instance,ne=P.currentTarget,P=P.listener,H!==k&&S.isPropagationStopped())break e;k=P,S.currentTarget=ne;try{k(S)}catch(me){Lu(me)}S.currentTarget=null,k=H}}}}function ft(i,r){var u=r[wl];u===void 0&&(u=r[wl]=new Set);var g=i+"__bubble";u.has(g)||(Zx(r,i,2,!1),u.add(g))}function Th(i,r,u){var g=0;r&&(g|=4),Zx(u,i,g,r)}var Md="_reactListening"+Math.random().toString(36).slice(2);function _h(i){if(!i[Md]){i[Md]=!0,Xo.forEach(function(u){u!=="selectionchange"&&(Bj.has(u)||Th(u,!1,i),Th(u,!0,i))});var r=i.nodeType===9?i:i.ownerDocument;r===null||r[Md]||(r[Md]=!0,Th("selectionchange",!1,r))}}function Zx(i,r,u,g){switch(wk(r)){case 2:var S=fP;break;case 8:S=hP;break;default:S=Vh}u=S.bind(null,r,u,i),S=void 0,!Wm||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(S=!0),g?S!==void 0?i.addEventListener(r,u,{capture:!0,passive:S}):i.addEventListener(r,u,!0):S!==void 0?i.addEventListener(r,u,{passive:S}):i.addEventListener(r,u,!1)}function Nh(i,r,u,g,S){var k=g;if((r&1)===0&&(r&2)===0&&g!==null)e:for(;;){if(g===null)return;var I=g.tag;if(I===3||I===4){var P=g.stateNode.containerInfo;if(P===S)break;if(I===4)for(I=g.return;I!==null;){var H=I.tag;if((H===3||H===4)&&I.stateNode.containerInfo===S)return;I=I.return}for(;P!==null;){if(I=sr(P),I===null)return;if(H=I.tag,H===5||H===6||H===26||H===27){g=k=I;continue e}P=P.parentNode}}g=g.return}J0(function(){var ne=k,me=to(u),Se=[];e:{var ie=E1.get(i);if(ie!==void 0){var ce=Pu,Be=i;switch(i){case"keypress":if(Ou(u)===0)break e;case"keydown":case"keyup":ce=OO;break;case"focusin":Be="focus",ce=ef;break;case"focusout":Be="blur",ce=ef;break;case"beforeblur":case"afterblur":ce=ef;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ce=n1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ce=xO;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ce=DO;break;case w1:case M1:case C1:ce=MO;break;case A1:ce=LO;break;case"scroll":case"scrollend":ce=bO;break;case"wheel":ce=BO;break;case"copy":case"cut":case"paste":ce=AO;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ce=i1;break;case"toggle":case"beforetoggle":ce=UO}var Ke=(r&4)!==0,Ft=!Ke&&(i==="scroll"||i==="scrollend"),Y=Ke?ie!==null?ie+"Capture":null:ie;Ke=[];for(var K=ne,te;K!==null;){var ye=K;if(te=ye.stateNode,ye=ye.tag,ye!==5&&ye!==26&&ye!==27||te===null||Y===null||(ye=El(K,Y),ye!=null&&Ke.push(oc(K,ye,te))),Ft)break;K=K.return}0<Ke.length&&(ie=new ce(ie,Be,null,u,me),Se.push({event:ie,listeners:Ke}))}}if((r&7)===0){e:{if(ie=i==="mouseover"||i==="pointerover",ce=i==="mouseout"||i==="pointerout",ie&&u!==di&&(Be=u.relatedTarget||u.fromElement)&&(sr(Be)||Be[or]))break e;if((ce||ie)&&(ie=me.window===me?me:(ie=me.ownerDocument)?ie.defaultView||ie.parentWindow:window,ce?(Be=u.relatedTarget||u.toElement,ce=ne,Be=Be?sr(Be):null,Be!==null&&(Ft=p(Be),Ke=Be.tag,Be!==Ft||Ke!==5&&Ke!==27&&Ke!==6)&&(Be=null)):(ce=null,Be=ne),ce!==Be)){if(Ke=n1,ye="onMouseLeave",Y="onMouseEnter",K="mouse",(i==="pointerout"||i==="pointerover")&&(Ke=i1,ye="onPointerLeave",Y="onPointerEnter",K="pointer"),Ft=ce==null?ie:eo(ce),te=Be==null?ie:eo(Be),ie=new Ke(ye,K+"leave",ce,u,me),ie.target=Ft,ie.relatedTarget=te,ye=null,sr(me)===ne&&(Ke=new Ke(Y,K+"enter",Be,u,me),Ke.target=te,Ke.relatedTarget=Ft,ye=Ke),Ft=ye,ce&&Be)t:{for(Ke=Fj,Y=ce,K=Be,te=0,ye=Y;ye;ye=Ke(ye))te++;ye=0;for(var $e=K;$e;$e=Ke($e))ye++;for(;0<te-ye;)Y=Ke(Y),te--;for(;0<ye-te;)K=Ke(K),ye--;for(;te--;){if(Y===K||K!==null&&Y===K.alternate){Ke=Y;break t}Y=Ke(Y),K=Ke(K)}Ke=null}else Ke=null;ce!==null&&Kx(Se,ie,ce,Ke,!1),Be!==null&&Ft!==null&&Kx(Se,Ft,Be,Ke,!0)}}e:{if(ie=ne?eo(ne):window,ce=ie.nodeName&&ie.nodeName.toLowerCase(),ce==="select"||ce==="input"&&ie.type==="file")var At=p1;else if(u1(ie))if(m1)At=XO;else{At=WO;var Ue=KO}else ce=ie.nodeName,!ce||ce.toLowerCase()!=="input"||ie.type!=="checkbox"&&ie.type!=="radio"?ne&&Wn(ne.elementType)&&(At=p1):At=YO;if(At&&(At=At(i,ne))){d1(Se,At,u,me);break e}Ue&&Ue(i,ie,ne),i==="focusout"&&ne&&ie.type==="number"&&ne.memoizedProps.value!=null&&Ot(ie,"number",ie.value)}switch(Ue=ne?eo(ne):window,i){case"focusin":(u1(Ue)||Ue.contentEditable==="true")&&(as=Ue,sf=ne,Pl=null);break;case"focusout":Pl=sf=as=null;break;case"mousedown":lf=!0;break;case"contextmenu":case"mouseup":case"dragend":lf=!1,x1(Se,u,me);break;case"selectionchange":if(ej)break;case"keydown":case"keyup":x1(Se,u,me)}var ct;if(nf)e:{switch(i){case"compositionstart":var yt="onCompositionStart";break e;case"compositionend":yt="onCompositionEnd";break e;case"compositionupdate":yt="onCompositionUpdate";break e}yt=void 0}else ns?l1(i,u)&&(yt="onCompositionEnd"):i==="keydown"&&u.keyCode===229&&(yt="onCompositionStart");yt&&(r1&&u.locale!=="ko"&&(ns||yt!=="onCompositionStart"?yt==="onCompositionEnd"&&ns&&(ct=e1()):(cr=me,Ym="value"in cr?cr.value:cr.textContent,ns=!0)),Ue=Cd(ne,yt),0<Ue.length&&(yt=new a1(yt,i,null,u,me),Se.push({event:yt,listeners:Ue}),ct?yt.data=ct:(ct=c1(u),ct!==null&&(yt.data=ct)))),(ct=$O?QO(i,u):VO(i,u))&&(yt=Cd(ne,"onBeforeInput"),0<yt.length&&(Ue=new a1("onBeforeInput","beforeinput",null,u,me),Se.push({event:Ue,listeners:yt}),Ue.data=ct)),zj(Se,i,ne,u,me)}Gx(Se,r)})}function oc(i,r,u){return{instance:i,listener:r,currentTarget:u}}function Cd(i,r){for(var u=r+"Capture",g=[];i!==null;){var S=i,k=S.stateNode;if(S=S.tag,S!==5&&S!==26&&S!==27||k===null||(S=El(i,u),S!=null&&g.unshift(oc(i,S,k)),S=El(i,r),S!=null&&g.push(oc(i,S,k))),i.tag===3)return g;i=i.return}return[]}function Fj(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function Kx(i,r,u,g,S){for(var k=r._reactName,I=[];u!==null&&u!==g;){var P=u,H=P.alternate,ne=P.stateNode;if(P=P.tag,H!==null&&H===g)break;P!==5&&P!==26&&P!==27||ne===null||(H=ne,S?(ne=El(u,k),ne!=null&&I.unshift(oc(u,ne,H))):S||(ne=El(u,k),ne!=null&&I.push(oc(u,ne,H)))),u=u.return}I.length!==0&&i.push({event:r,listeners:I})}var Uj=/\r\n?/g,Hj=/\u0000|\uFFFD/g;function Wx(i){return(typeof i=="string"?i:""+i).replace(Uj,`
10
- `).replace(Hj,"")}function Yx(i,r){return r=Wx(r),Wx(i)===r}function Bt(i,r,u,g,S,k){switch(u){case"children":typeof g=="string"?r==="body"||r==="textarea"&&g===""||Kn(i,g):(typeof g=="number"||typeof g=="bigint")&&r!=="body"&&Kn(i,""+g);break;case"className":Ve(i,"class",g);break;case"tabIndex":Ve(i,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":Ve(i,u,g);break;case"style":wt(i,g,k);break;case"data":if(r!=="object"){Ve(i,"data",g);break}case"src":case"href":if(g===""&&(r!=="a"||u!=="href")){i.removeAttribute(u);break}if(g==null||typeof g=="function"||typeof g=="symbol"||typeof g=="boolean"){i.removeAttribute(u);break}g=Ii(""+g),i.setAttribute(u,g);break;case"action":case"formAction":if(typeof g=="function"){i.setAttribute(u,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof k=="function"&&(u==="formAction"?(r!=="input"&&Bt(i,r,"name",S.name,S,null),Bt(i,r,"formEncType",S.formEncType,S,null),Bt(i,r,"formMethod",S.formMethod,S,null),Bt(i,r,"formTarget",S.formTarget,S,null)):(Bt(i,r,"encType",S.encType,S,null),Bt(i,r,"method",S.method,S,null),Bt(i,r,"target",S.target,S,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){i.removeAttribute(u);break}g=Ii(""+g),i.setAttribute(u,g);break;case"onClick":g!=null&&(i.onclick=Yn);break;case"onScroll":g!=null&&ft("scroll",i);break;case"onScrollEnd":g!=null&&ft("scrollend",i);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(a(61));if(u=g.__html,u!=null){if(S.children!=null)throw Error(a(60));i.innerHTML=u}}break;case"multiple":i.multiple=g&&typeof g!="function"&&typeof g!="symbol";break;case"muted":i.muted=g&&typeof g!="function"&&typeof g!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(g==null||typeof g=="function"||typeof g=="boolean"||typeof g=="symbol"){i.removeAttribute("xlink:href");break}u=Ii(""+g),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":g!=null&&typeof g!="function"&&typeof g!="symbol"?i.setAttribute(u,""+g):i.removeAttribute(u);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":g&&typeof g!="function"&&typeof g!="symbol"?i.setAttribute(u,""):i.removeAttribute(u);break;case"capture":case"download":g===!0?i.setAttribute(u,""):g!==!1&&g!=null&&typeof g!="function"&&typeof g!="symbol"?i.setAttribute(u,g):i.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":g!=null&&typeof g!="function"&&typeof g!="symbol"&&!isNaN(g)&&1<=g?i.setAttribute(u,g):i.removeAttribute(u);break;case"rowSpan":case"start":g==null||typeof g=="function"||typeof g=="symbol"||isNaN(g)?i.removeAttribute(u):i.setAttribute(u,g);break;case"popover":ft("beforetoggle",i),ft("toggle",i),Ct(i,"popover",g);break;case"xlinkActuate":St(i,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":St(i,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":St(i,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":St(i,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":St(i,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":St(i,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":St(i,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":St(i,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":St(i,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":Ct(i,"is",g);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=Jo.get(u)||u,Ct(i,u,g))}}function Oh(i,r,u,g,S,k){switch(u){case"style":wt(i,g,k);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(a(61));if(u=g.__html,u!=null){if(S.children!=null)throw Error(a(60));i.innerHTML=u}}break;case"children":typeof g=="string"?Kn(i,g):(typeof g=="number"||typeof g=="bigint")&&Kn(i,""+g);break;case"onScroll":g!=null&&ft("scroll",i);break;case"onScrollEnd":g!=null&&ft("scrollend",i);break;case"onClick":g!=null&&(i.onclick=Yn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Cl.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(S=u.endsWith("Capture"),r=u.slice(2,S?u.length-7:void 0),k=i[Qn]||null,k=k!=null?k[u]:null,typeof k=="function"&&i.removeEventListener(r,k,S),typeof g=="function")){typeof k!="function"&&k!==null&&(u in i?i[u]=null:i.hasAttribute(u)&&i.removeAttribute(u)),i.addEventListener(r,g,S);break e}u in i?i[u]=g:g===!0?i.setAttribute(u,""):Ct(i,u,g)}}}function Bn(i,r,u){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ft("error",i),ft("load",i);var g=!1,S=!1,k;for(k in u)if(u.hasOwnProperty(k)){var I=u[k];if(I!=null)switch(k){case"src":g=!0;break;case"srcSet":S=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,r));default:Bt(i,r,k,I,u,null)}}S&&Bt(i,r,"srcSet",u.srcSet,u,null),g&&Bt(i,r,"src",u.src,u,null);return;case"input":ft("invalid",i);var P=k=I=S=null,H=null,ne=null;for(g in u)if(u.hasOwnProperty(g)){var me=u[g];if(me!=null)switch(g){case"name":S=me;break;case"type":I=me;break;case"checked":H=me;break;case"defaultChecked":ne=me;break;case"value":k=me;break;case"defaultValue":P=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(a(137,r));break;default:Bt(i,r,g,me,u,null)}}sn(i,k,P,H,ne,I,S,!1);return;case"select":ft("invalid",i),g=I=k=null;for(S in u)if(u.hasOwnProperty(S)&&(P=u[S],P!=null))switch(S){case"value":k=P;break;case"defaultValue":I=P;break;case"multiple":g=P;default:Bt(i,r,S,P,u,null)}r=k,u=I,i.multiple=!!g,r!=null?Dn(i,!!g,r,!1):u!=null&&Dn(i,!!g,u,!0);return;case"textarea":ft("invalid",i),k=S=g=null;for(I in u)if(u.hasOwnProperty(I)&&(P=u[I],P!=null))switch(I){case"value":g=P;break;case"defaultValue":S=P;break;case"children":k=P;break;case"dangerouslySetInnerHTML":if(P!=null)throw Error(a(91));break;default:Bt(i,r,I,P,u,null)}Ka(i,g,S,k);return;case"option":for(H in u)u.hasOwnProperty(H)&&(g=u[H],g!=null)&&(H==="selected"?i.selected=g&&typeof g!="function"&&typeof g!="symbol":Bt(i,r,H,g,u,null));return;case"dialog":ft("beforetoggle",i),ft("toggle",i),ft("cancel",i),ft("close",i);break;case"iframe":case"object":ft("load",i);break;case"video":case"audio":for(g=0;g<rc.length;g++)ft(rc[g],i);break;case"image":ft("error",i),ft("load",i);break;case"details":ft("toggle",i);break;case"embed":case"source":case"link":ft("error",i),ft("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ne in u)if(u.hasOwnProperty(ne)&&(g=u[ne],g!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,r));default:Bt(i,r,ne,g,u,null)}return;default:if(Wn(r)){for(me in u)u.hasOwnProperty(me)&&(g=u[me],g!==void 0&&Oh(i,r,me,g,u,void 0));return}}for(P in u)u.hasOwnProperty(P)&&(g=u[P],g!=null&&Bt(i,r,P,g,u,null))}function $j(i,r,u,g){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var S=null,k=null,I=null,P=null,H=null,ne=null,me=null;for(ce in u){var Se=u[ce];if(u.hasOwnProperty(ce)&&Se!=null)switch(ce){case"checked":break;case"value":break;case"defaultValue":H=Se;default:g.hasOwnProperty(ce)||Bt(i,r,ce,null,g,Se)}}for(var ie in g){var ce=g[ie];if(Se=u[ie],g.hasOwnProperty(ie)&&(ce!=null||Se!=null))switch(ie){case"type":k=ce;break;case"name":S=ce;break;case"checked":ne=ce;break;case"defaultChecked":me=ce;break;case"value":I=ce;break;case"defaultValue":P=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(a(137,r));break;default:ce!==Se&&Bt(i,r,ie,ce,g,Se)}}Vn(i,I,P,H,ne,me,k,S);return;case"select":ce=I=P=ie=null;for(k in u)if(H=u[k],u.hasOwnProperty(k)&&H!=null)switch(k){case"value":break;case"multiple":ce=H;default:g.hasOwnProperty(k)||Bt(i,r,k,null,g,H)}for(S in g)if(k=g[S],H=u[S],g.hasOwnProperty(S)&&(k!=null||H!=null))switch(S){case"value":ie=k;break;case"defaultValue":P=k;break;case"multiple":I=k;default:k!==H&&Bt(i,r,S,k,g,H)}r=P,u=I,g=ce,ie!=null?Dn(i,!!u,ie,!1):!!g!=!!u&&(r!=null?Dn(i,!!u,r,!0):Dn(i,!!u,u?[]:"",!1));return;case"textarea":ce=ie=null;for(P in u)if(S=u[P],u.hasOwnProperty(P)&&S!=null&&!g.hasOwnProperty(P))switch(P){case"value":break;case"children":break;default:Bt(i,r,P,null,g,S)}for(I in g)if(S=g[I],k=u[I],g.hasOwnProperty(I)&&(S!=null||k!=null))switch(I){case"value":ie=S;break;case"defaultValue":ce=S;break;case"children":break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(a(91));break;default:S!==k&&Bt(i,r,I,S,g,k)}ot(i,ie,ce);return;case"option":for(var Be in u)ie=u[Be],u.hasOwnProperty(Be)&&ie!=null&&!g.hasOwnProperty(Be)&&(Be==="selected"?i.selected=!1:Bt(i,r,Be,null,g,ie));for(H in g)ie=g[H],ce=u[H],g.hasOwnProperty(H)&&ie!==ce&&(ie!=null||ce!=null)&&(H==="selected"?i.selected=ie&&typeof ie!="function"&&typeof ie!="symbol":Bt(i,r,H,ie,g,ce));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ke in u)ie=u[Ke],u.hasOwnProperty(Ke)&&ie!=null&&!g.hasOwnProperty(Ke)&&Bt(i,r,Ke,null,g,ie);for(ne in g)if(ie=g[ne],ce=u[ne],g.hasOwnProperty(ne)&&ie!==ce&&(ie!=null||ce!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(a(137,r));break;default:Bt(i,r,ne,ie,g,ce)}return;default:if(Wn(r)){for(var Ft in u)ie=u[Ft],u.hasOwnProperty(Ft)&&ie!==void 0&&!g.hasOwnProperty(Ft)&&Oh(i,r,Ft,void 0,g,ie);for(me in g)ie=g[me],ce=u[me],!g.hasOwnProperty(me)||ie===ce||ie===void 0&&ce===void 0||Oh(i,r,me,ie,g,ce);return}}for(var Y in u)ie=u[Y],u.hasOwnProperty(Y)&&ie!=null&&!g.hasOwnProperty(Y)&&Bt(i,r,Y,null,g,ie);for(Se in g)ie=g[Se],ce=u[Se],!g.hasOwnProperty(Se)||ie===ce||ie==null&&ce==null||Bt(i,r,Se,ie,g,ce)}function Xx(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Qj(){if(typeof performance.getEntriesByType=="function"){for(var i=0,r=0,u=performance.getEntriesByType("resource"),g=0;g<u.length;g++){var S=u[g],k=S.transferSize,I=S.initiatorType,P=S.duration;if(k&&P&&Xx(I)){for(I=0,P=S.responseEnd,g+=1;g<u.length;g++){var H=u[g],ne=H.startTime;if(ne>P)break;var me=H.transferSize,Se=H.initiatorType;me&&Xx(Se)&&(H=H.responseEnd,I+=me*(H<P?1:(P-ne)/(H-ne)))}if(--g,r+=8*(k+I)/(S.duration/1e3),i++,10<i)break}}if(0<i)return r/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var jh=null,Ph=null;function Ad(i){return i.nodeType===9?i:i.ownerDocument}function Jx(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function ek(i,r){if(i===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&r==="foreignObject"?0:i}function Dh(i,r){return i==="textarea"||i==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var zh=null;function Vj(){var i=window.event;return i&&i.type==="popstate"?i===zh?!1:(zh=i,!0):(zh=null,!1)}var tk=typeof setTimeout=="function"?setTimeout:void 0,Gj=typeof clearTimeout=="function"?clearTimeout:void 0,nk=typeof Promise=="function"?Promise:void 0,Zj=typeof queueMicrotask=="function"?queueMicrotask:typeof nk<"u"?function(i){return nk.resolve(null).then(i).catch(Kj)}:tk;function Kj(i){setTimeout(function(){throw i})}function Ar(i){return i==="head"}function ak(i,r){var u=r,g=0;do{var S=u.nextSibling;if(i.removeChild(u),S&&S.nodeType===8)if(u=S.data,u==="/$"||u==="/&"){if(g===0){i.removeChild(S),Ts(r);return}g--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")g++;else if(u==="html")sc(i.ownerDocument.documentElement);else if(u==="head"){u=i.ownerDocument.head,sc(u);for(var k=u.firstChild;k;){var I=k.nextSibling,P=k.nodeName;k[Jr]||P==="SCRIPT"||P==="STYLE"||P==="LINK"&&k.rel.toLowerCase()==="stylesheet"||u.removeChild(k),k=I}}else u==="body"&&sc(i.ownerDocument.body);u=S}while(u);Ts(r)}function ik(i,r){var u=i;i=0;do{var g=u.nextSibling;if(u.nodeType===1?r?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(r?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),g&&g.nodeType===8)if(u=g.data,u==="/$"){if(i===0)break;i--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||i++;u=g}while(u)}function Lh(i){var r=i.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var u=r;switch(r=r.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":Lh(u),Yo(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}i.removeChild(u)}}function Wj(i,r,u,g){for(;i.nodeType===1;){var S=u;if(i.nodeName.toLowerCase()!==r.toLowerCase()){if(!g&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(g){if(!i[Jr])switch(r){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(k=i.getAttribute("rel"),k==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(k!==S.rel||i.getAttribute("href")!==(S.href==null||S.href===""?null:S.href)||i.getAttribute("crossorigin")!==(S.crossOrigin==null?null:S.crossOrigin)||i.getAttribute("title")!==(S.title==null?null:S.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(k=i.getAttribute("src"),(k!==(S.src==null?null:S.src)||i.getAttribute("type")!==(S.type==null?null:S.type)||i.getAttribute("crossorigin")!==(S.crossOrigin==null?null:S.crossOrigin))&&k&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(r==="input"&&i.type==="hidden"){var k=S.name==null?null:""+S.name;if(S.type==="hidden"&&i.getAttribute("name")===k)return i}else return i;if(i=Fa(i.nextSibling),i===null)break}return null}function Yj(i,r,u){if(r==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!u||(i=Fa(i.nextSibling),i===null))return null;return i}function rk(i,r){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!r||(i=Fa(i.nextSibling),i===null))return null;return i}function qh(i){return i.data==="$?"||i.data==="$~"}function Bh(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function Xj(i,r){var u=i.ownerDocument;if(i.data==="$~")i._reactRetry=r;else if(i.data!=="$?"||u.readyState!=="loading")r();else{var g=function(){r(),u.removeEventListener("DOMContentLoaded",g)};u.addEventListener("DOMContentLoaded",g),i._reactRetry=g}}function Fa(i){for(;i!=null;i=i.nextSibling){var r=i.nodeType;if(r===1||r===3)break;if(r===8){if(r=i.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return i}var Fh=null;function ok(i){i=i.nextSibling;for(var r=0;i;){if(i.nodeType===8){var u=i.data;if(u==="/$"||u==="/&"){if(r===0)return Fa(i.nextSibling);r--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||r++}i=i.nextSibling}return null}function sk(i){i=i.previousSibling;for(var r=0;i;){if(i.nodeType===8){var u=i.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(r===0)return i;r--}else u!=="/$"&&u!=="/&"||r++}i=i.previousSibling}return null}function lk(i,r,u){switch(r=Ad(u),i){case"html":if(i=r.documentElement,!i)throw Error(a(452));return i;case"head":if(i=r.head,!i)throw Error(a(453));return i;case"body":if(i=r.body,!i)throw Error(a(454));return i;default:throw Error(a(451))}}function sc(i){for(var r=i.attributes;r.length;)i.removeAttributeNode(r[0]);Yo(i)}var Ua=new Map,ck=new Set;function Ed(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var Qi=oe.d;oe.d={f:Jj,r:eP,D:tP,C:nP,L:aP,m:iP,X:oP,S:rP,M:sP};function Jj(){var i=Qi.f(),r=yd();return i||r}function eP(i){var r=ui(i);r!==null&&r.tag===5&&r.type==="form"?AS(r):Qi.r(i)}var Es=typeof document>"u"?null:document;function uk(i,r,u){var g=Es;if(g&&typeof r=="string"&&r){var S=Qt(r);S='link[rel="'+i+'"][href="'+S+'"]',typeof u=="string"&&(S+='[crossorigin="'+u+'"]'),ck.has(S)||(ck.add(S),i={rel:i,crossOrigin:u,href:r},g.querySelector(S)===null&&(r=g.createElement("link"),Bn(r,"link",i),rn(r),g.head.appendChild(r)))}}function tP(i){Qi.D(i),uk("dns-prefetch",i,null)}function nP(i,r){Qi.C(i,r),uk("preconnect",i,r)}function aP(i,r,u){Qi.L(i,r,u);var g=Es;if(g&&i&&r){var S='link[rel="preload"][as="'+Qt(r)+'"]';r==="image"&&u&&u.imageSrcSet?(S+='[imagesrcset="'+Qt(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(S+='[imagesizes="'+Qt(u.imageSizes)+'"]')):S+='[href="'+Qt(i)+'"]';var k=S;switch(r){case"style":k=Rs(i);break;case"script":k=Is(i)}Ua.has(k)||(i=M({rel:"preload",href:r==="image"&&u&&u.imageSrcSet?void 0:i,as:r},u),Ua.set(k,i),g.querySelector(S)!==null||r==="style"&&g.querySelector(lc(k))||r==="script"&&g.querySelector(cc(k))||(r=g.createElement("link"),Bn(r,"link",i),rn(r),g.head.appendChild(r)))}}function iP(i,r){Qi.m(i,r);var u=Es;if(u&&i){var g=r&&typeof r.as=="string"?r.as:"script",S='link[rel="modulepreload"][as="'+Qt(g)+'"][href="'+Qt(i)+'"]',k=S;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":k=Is(i)}if(!Ua.has(k)&&(i=M({rel:"modulepreload",href:i},r),Ua.set(k,i),u.querySelector(S)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(cc(k)))return}g=u.createElement("link"),Bn(g,"link",i),rn(g),u.head.appendChild(g)}}}function rP(i,r,u){Qi.S(i,r,u);var g=Es;if(g&&i){var S=lr(g).hoistableStyles,k=Rs(i);r=r||"default";var I=S.get(k);if(!I){var P={loading:0,preload:null};if(I=g.querySelector(lc(k)))P.loading=5;else{i=M({rel:"stylesheet",href:i,"data-precedence":r},u),(u=Ua.get(k))&&Uh(i,u);var H=I=g.createElement("link");rn(H),Bn(H,"link",i),H._p=new Promise(function(ne,me){H.onload=ne,H.onerror=me}),H.addEventListener("load",function(){P.loading|=1}),H.addEventListener("error",function(){P.loading|=2}),P.loading|=4,Rd(I,r,g)}I={type:"stylesheet",instance:I,count:1,state:P},S.set(k,I)}}}function oP(i,r){Qi.X(i,r);var u=Es;if(u&&i){var g=lr(u).hoistableScripts,S=Is(i),k=g.get(S);k||(k=u.querySelector(cc(S)),k||(i=M({src:i,async:!0},r),(r=Ua.get(S))&&Hh(i,r),k=u.createElement("script"),rn(k),Bn(k,"link",i),u.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},g.set(S,k))}}function sP(i,r){Qi.M(i,r);var u=Es;if(u&&i){var g=lr(u).hoistableScripts,S=Is(i),k=g.get(S);k||(k=u.querySelector(cc(S)),k||(i=M({src:i,async:!0,type:"module"},r),(r=Ua.get(S))&&Hh(i,r),k=u.createElement("script"),rn(k),Bn(k,"link",i),u.head.appendChild(k)),k={type:"script",instance:k,count:1,state:null},g.set(S,k))}}function dk(i,r,u,g){var S=(S=ve.current)?Ed(S):null;if(!S)throw Error(a(446));switch(i){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(r=Rs(u.href),u=lr(S).hoistableStyles,g=u.get(r),g||(g={type:"style",instance:null,count:0,state:null},u.set(r,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){i=Rs(u.href);var k=lr(S).hoistableStyles,I=k.get(i);if(I||(S=S.ownerDocument||S,I={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},k.set(i,I),(k=S.querySelector(lc(i)))&&!k._p&&(I.instance=k,I.state.loading=5),Ua.has(i)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},Ua.set(i,u),k||lP(S,i,u,I.state))),r&&g===null)throw Error(a(528,""));return I}if(r&&g!==null)throw Error(a(529,""));return null;case"script":return r=u.async,u=u.src,typeof u=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=Is(u),u=lr(S).hoistableScripts,g=u.get(r),g||(g={type:"script",instance:null,count:0,state:null},u.set(r,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,i))}}function Rs(i){return'href="'+Qt(i)+'"'}function lc(i){return'link[rel="stylesheet"]['+i+"]"}function pk(i){return M({},i,{"data-precedence":i.precedence,precedence:null})}function lP(i,r,u,g){i.querySelector('link[rel="preload"][as="style"]['+r+"]")?g.loading=1:(r=i.createElement("link"),g.preload=r,r.addEventListener("load",function(){return g.loading|=1}),r.addEventListener("error",function(){return g.loading|=2}),Bn(r,"link",u),rn(r),i.head.appendChild(r))}function Is(i){return'[src="'+Qt(i)+'"]'}function cc(i){return"script[async]"+i}function mk(i,r,u){if(r.count++,r.instance===null)switch(r.type){case"style":var g=i.querySelector('style[data-href~="'+Qt(u.href)+'"]');if(g)return r.instance=g,rn(g),g;var S=M({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return g=(i.ownerDocument||i).createElement("style"),rn(g),Bn(g,"style",S),Rd(g,u.precedence,i),r.instance=g;case"stylesheet":S=Rs(u.href);var k=i.querySelector(lc(S));if(k)return r.state.loading|=4,r.instance=k,rn(k),k;g=pk(u),(S=Ua.get(S))&&Uh(g,S),k=(i.ownerDocument||i).createElement("link"),rn(k);var I=k;return I._p=new Promise(function(P,H){I.onload=P,I.onerror=H}),Bn(k,"link",g),r.state.loading|=4,Rd(k,u.precedence,i),r.instance=k;case"script":return k=Is(u.src),(S=i.querySelector(cc(k)))?(r.instance=S,rn(S),S):(g=u,(S=Ua.get(k))&&(g=M({},u),Hh(g,S)),i=i.ownerDocument||i,S=i.createElement("script"),rn(S),Bn(S,"link",g),i.head.appendChild(S),r.instance=S);case"void":return null;default:throw Error(a(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(g=r.instance,r.state.loading|=4,Rd(g,u.precedence,i));return r.instance}function Rd(i,r,u){for(var g=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),S=g.length?g[g.length-1]:null,k=S,I=0;I<g.length;I++){var P=g[I];if(P.dataset.precedence===r)k=P;else if(k!==S)break}k?k.parentNode.insertBefore(i,k.nextSibling):(r=u.nodeType===9?u.head:u,r.insertBefore(i,r.firstChild))}function Uh(i,r){i.crossOrigin==null&&(i.crossOrigin=r.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=r.referrerPolicy),i.title==null&&(i.title=r.title)}function Hh(i,r){i.crossOrigin==null&&(i.crossOrigin=r.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=r.referrerPolicy),i.integrity==null&&(i.integrity=r.integrity)}var Id=null;function fk(i,r,u){if(Id===null){var g=new Map,S=Id=new Map;S.set(u,g)}else S=Id,g=S.get(u),g||(g=new Map,S.set(u,g));if(g.has(i))return g;for(g.set(i,null),u=u.getElementsByTagName(i),S=0;S<u.length;S++){var k=u[S];if(!(k[Jr]||k[Sn]||i==="link"&&k.getAttribute("rel")==="stylesheet")&&k.namespaceURI!=="http://www.w3.org/2000/svg"){var I=k.getAttribute(r)||"";I=i+I;var P=g.get(I);P?P.push(k):g.set(I,[k])}}return g}function hk(i,r,u){i=i.ownerDocument||i,i.head.insertBefore(u,r==="title"?i.querySelector("head > title"):null)}function cP(i,r,u){if(u===1||r.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;return r.rel==="stylesheet"?(i=r.disabled,typeof r.precedence=="string"&&i==null):!0;case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function gk(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function uP(i,r,u,g){if(u.type==="stylesheet"&&(typeof g.media!="string"||matchMedia(g.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var S=Rs(g.href),k=r.querySelector(lc(S));if(k){r=k._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(i.count++,i=Td.bind(i),r.then(i,i)),u.state.loading|=4,u.instance=k,rn(k);return}k=r.ownerDocument||r,g=pk(g),(S=Ua.get(S))&&Uh(g,S),k=k.createElement("link"),rn(k);var I=k;I._p=new Promise(function(P,H){I.onload=P,I.onerror=H}),Bn(k,"link",g),u.instance=k}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(u,r),(r=u.state.preload)&&(u.state.loading&3)===0&&(i.count++,u=Td.bind(i),r.addEventListener("load",u),r.addEventListener("error",u))}}var $h=0;function dP(i,r){return i.stylesheets&&i.count===0&&Nd(i,i.stylesheets),0<i.count||0<i.imgCount?function(u){var g=setTimeout(function(){if(i.stylesheets&&Nd(i,i.stylesheets),i.unsuspend){var k=i.unsuspend;i.unsuspend=null,k()}},6e4+r);0<i.imgBytes&&$h===0&&($h=62500*Qj());var S=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&Nd(i,i.stylesheets),i.unsuspend)){var k=i.unsuspend;i.unsuspend=null,k()}},(i.imgBytes>$h?50:800)+r);return i.unsuspend=u,function(){i.unsuspend=null,clearTimeout(g),clearTimeout(S)}}:null}function Td(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Nd(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var _d=null;function Nd(i,r){i.stylesheets=null,i.unsuspend!==null&&(i.count++,_d=new Map,r.forEach(pP,i),_d=null,Td.call(i))}function pP(i,r){if(!(r.state.loading&4)){var u=_d.get(i);if(u)var g=u.get(null);else{u=new Map,_d.set(i,u);for(var S=i.querySelectorAll("link[data-precedence],style[data-precedence]"),k=0;k<S.length;k++){var I=S[k];(I.nodeName==="LINK"||I.getAttribute("media")!=="not all")&&(u.set(I.dataset.precedence,I),g=I)}g&&u.set(null,g)}S=r.instance,I=S.getAttribute("data-precedence"),k=u.get(I)||g,k===g&&u.set(null,S),u.set(I,S),this.count++,g=Td.bind(this),S.addEventListener("load",g),S.addEventListener("error",g),k?k.parentNode.insertBefore(S,k.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(S,i.firstChild)),r.state.loading|=4}}var uc={$$typeof:B,Provider:null,Consumer:null,_currentValue:xe,_currentValue2:xe,_threadCount:0};function mP(i,r,u,g,S,k,I,P,H){this.tag=1,this.containerInfo=i,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Xr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xr(0),this.hiddenUpdates=Xr(null),this.identifierPrefix=g,this.onUncaughtError=S,this.onCaughtError=k,this.onRecoverableError=I,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=H,this.incompleteTransitions=new Map}function vk(i,r,u,g,S,k,I,P,H,ne,me,Se){return i=new mP(i,r,u,I,H,ne,me,Se,P),r=1,k===!0&&(r|=24),k=Ma(3,null,null,r),i.current=k,k.stateNode=i,r=wf(),r.refCount++,i.pooledCache=r,r.refCount++,k.memoizedState={element:g,isDehydrated:u,cache:r},Ef(k),i}function yk(i){return i?(i=os,i):os}function bk(i,r,u,g,S,k){S=yk(S),g.context===null?g.context=S:g.pendingContext=S,g=hr(r),g.payload={element:u},k=k===void 0?null:k,k!==null&&(g.callback=k),u=gr(i,g,r),u!==null&&(fa(u,i,r),Ul(u,i,r))}function Sk(i,r){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var u=i.retryLane;i.retryLane=u!==0&&u<r?u:r}}function Qh(i,r){Sk(i,r),(i=i.alternate)&&Sk(i,r)}function xk(i){if(i.tag===13||i.tag===31){var r=ro(i,67108864);r!==null&&fa(r,i,67108864),Qh(i,67108864)}}function kk(i){if(i.tag===13||i.tag===31){var r=Ia();r=Ko(r);var u=ro(i,r);u!==null&&fa(u,i,r),Qh(i,r)}}var Od=!0;function fP(i,r,u,g){var S=Q.T;Q.T=null;var k=oe.p;try{oe.p=2,Vh(i,r,u,g)}finally{oe.p=k,Q.T=S}}function hP(i,r,u,g){var S=Q.T;Q.T=null;var k=oe.p;try{oe.p=8,Vh(i,r,u,g)}finally{oe.p=k,Q.T=S}}function Vh(i,r,u,g){if(Od){var S=Gh(g);if(S===null)Nh(i,r,g,jd,u),Mk(i,g);else if(vP(S,i,r,u,g))g.stopPropagation();else if(Mk(i,g),r&4&&-1<gP.indexOf(i)){for(;S!==null;){var k=ui(S);if(k!==null)switch(k.tag){case 3:if(k=k.stateNode,k.current.memoizedState.isDehydrated){var I=ut(k.pendingLanes);if(I!==0){var P=k;for(P.pendingLanes|=2,P.entangledLanes|=2;I;){var H=1<<31-Nn(I);P.entanglements[1]|=H,I&=~H}hi(k),(Tt&6)===0&&(gd=pn()+500,ic(0))}}break;case 31:case 13:P=ro(k,2),P!==null&&fa(P,k,2),yd(),Qh(k,2)}if(k=Gh(g),k===null&&Nh(i,r,g,jd,u),k===S)break;S=k}S!==null&&g.stopPropagation()}else Nh(i,r,g,null,u)}}function Gh(i){return i=to(i),Zh(i)}var jd=null;function Zh(i){if(jd=null,i=sr(i),i!==null){var r=p(i);if(r===null)i=null;else{var u=r.tag;if(u===13){if(i=f(r),i!==null)return i;i=null}else if(u===31){if(i=m(r),i!==null)return i;i=null}else if(u===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;i=null}else r!==i&&(i=null)}}return jd=i,null}function wk(i){switch(i){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Hn()){case Sa:return 2;case li:return 8;case $n:case ci:return 32;case et:return 268435456;default:return 32}default:return 32}}var Kh=!1,Er=null,Rr=null,Ir=null,dc=new Map,pc=new Map,Tr=[],gP="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Mk(i,r){switch(i){case"focusin":case"focusout":Er=null;break;case"dragenter":case"dragleave":Rr=null;break;case"mouseover":case"mouseout":Ir=null;break;case"pointerover":case"pointerout":dc.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":pc.delete(r.pointerId)}}function mc(i,r,u,g,S,k){return i===null||i.nativeEvent!==k?(i={blockedOn:r,domEventName:u,eventSystemFlags:g,nativeEvent:k,targetContainers:[S]},r!==null&&(r=ui(r),r!==null&&xk(r)),i):(i.eventSystemFlags|=g,r=i.targetContainers,S!==null&&r.indexOf(S)===-1&&r.push(S),i)}function vP(i,r,u,g,S){switch(r){case"focusin":return Er=mc(Er,i,r,u,g,S),!0;case"dragenter":return Rr=mc(Rr,i,r,u,g,S),!0;case"mouseover":return Ir=mc(Ir,i,r,u,g,S),!0;case"pointerover":var k=S.pointerId;return dc.set(k,mc(dc.get(k)||null,i,r,u,g,S)),!0;case"gotpointercapture":return k=S.pointerId,pc.set(k,mc(pc.get(k)||null,i,r,u,g,S)),!0}return!1}function Ck(i){var r=sr(i.target);if(r!==null){var u=p(r);if(u!==null){if(r=u.tag,r===13){if(r=f(u),r!==null){i.blockedOn=r,kl(i.priority,function(){kk(u)});return}}else if(r===31){if(r=m(u),r!==null){i.blockedOn=r,kl(i.priority,function(){kk(u)});return}}else if(r===3&&u.stateNode.current.memoizedState.isDehydrated){i.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Pd(i){if(i.blockedOn!==null)return!1;for(var r=i.targetContainers;0<r.length;){var u=Gh(i.nativeEvent);if(u===null){u=i.nativeEvent;var g=new u.constructor(u.type,u);di=g,u.target.dispatchEvent(g),di=null}else return r=ui(u),r!==null&&xk(r),i.blockedOn=u,!1;r.shift()}return!0}function Ak(i,r,u){Pd(i)&&u.delete(r)}function yP(){Kh=!1,Er!==null&&Pd(Er)&&(Er=null),Rr!==null&&Pd(Rr)&&(Rr=null),Ir!==null&&Pd(Ir)&&(Ir=null),dc.forEach(Ak),pc.forEach(Ak)}function Dd(i,r){i.blockedOn===r&&(i.blockedOn=null,Kh||(Kh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,yP)))}var zd=null;function Ek(i){zd!==i&&(zd=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){zd===i&&(zd=null);for(var r=0;r<i.length;r+=3){var u=i[r],g=i[r+1],S=i[r+2];if(typeof g!="function"){if(Zh(g||u)===null)continue;break}var k=ui(u);k!==null&&(i.splice(r,3),r-=3,Gf(k,{pending:!0,data:S,method:u.method,action:g},g,S))}}))}function Ts(i){function r(H){return Dd(H,i)}Er!==null&&Dd(Er,i),Rr!==null&&Dd(Rr,i),Ir!==null&&Dd(Ir,i),dc.forEach(r),pc.forEach(r);for(var u=0;u<Tr.length;u++){var g=Tr[u];g.blockedOn===i&&(g.blockedOn=null)}for(;0<Tr.length&&(u=Tr[0],u.blockedOn===null);)Ck(u),u.blockedOn===null&&Tr.shift();if(u=(i.ownerDocument||i).$$reactFormReplay,u!=null)for(g=0;g<u.length;g+=3){var S=u[g],k=u[g+1],I=S[Qn]||null;if(typeof k=="function")I||Ek(u);else if(I){var P=null;if(k&&k.hasAttribute("formAction")){if(S=k,I=k[Qn]||null)P=I.formAction;else if(Zh(S)!==null)continue}else P=I.action;typeof P=="function"?u[g+1]=P:(u.splice(g,3),g-=3),Ek(u)}}}function Rk(){function i(k){k.canIntercept&&k.info==="react-transition"&&k.intercept({handler:function(){return new Promise(function(I){return S=I})},focusReset:"manual",scroll:"manual"})}function r(){S!==null&&(S(),S=null),g||setTimeout(u,20)}function u(){if(!g&&!navigation.transition){var k=navigation.currentEntry;k&&k.url!=null&&navigation.navigate(k.url,{state:k.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var g=!1,S=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(u,100),function(){g=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),S!==null&&(S(),S=null)}}}function Wh(i){this._internalRoot=i}Ld.prototype.render=Wh.prototype.render=function(i){var r=this._internalRoot;if(r===null)throw Error(a(409));var u=r.current,g=Ia();bk(u,g,i,r,null,null)},Ld.prototype.unmount=Wh.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var r=i.containerInfo;bk(i.current,2,null,i,null,null),yd(),r[or]=null}};function Ld(i){this._internalRoot=i}Ld.prototype.unstable_scheduleHydration=function(i){if(i){var r=xl();i={blockedOn:null,target:i,priority:r};for(var u=0;u<Tr.length&&r!==0&&r<Tr[u].priority;u++);Tr.splice(u,0,i),u===0&&Ck(i)}};var Ik=t.version;if(Ik!=="19.2.3")throw Error(a(527,Ik,"19.2.3"));oe.findDOMNode=function(i){var r=i._reactInternals;if(r===void 0)throw typeof i.render=="function"?Error(a(188)):(i=Object.keys(i).join(","),Error(a(268,i)));return i=c(r),i=i!==null?x(i):null,i=i===null?null:i.stateNode,i};var bP={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:Q,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var qd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!qd.isDisabled&&qd.supportsFiber)try{oa=qd.inject(bP),Pn=qd}catch{}}return hc.createRoot=function(i,r){if(!s(i))throw Error(a(299));var u=!1,g="",S=DS,k=zS,I=LS;return r!=null&&(r.unstable_strictMode===!0&&(u=!0),r.identifierPrefix!==void 0&&(g=r.identifierPrefix),r.onUncaughtError!==void 0&&(S=r.onUncaughtError),r.onCaughtError!==void 0&&(k=r.onCaughtError),r.onRecoverableError!==void 0&&(I=r.onRecoverableError)),r=vk(i,1,!1,null,null,u,g,null,S,k,I,Rk),i[or]=r.current,_h(i),new Wh(r)},hc.hydrateRoot=function(i,r,u){if(!s(i))throw Error(a(299));var g=!1,S="",k=DS,I=zS,P=LS,H=null;return u!=null&&(u.unstable_strictMode===!0&&(g=!0),u.identifierPrefix!==void 0&&(S=u.identifierPrefix),u.onUncaughtError!==void 0&&(k=u.onUncaughtError),u.onCaughtError!==void 0&&(I=u.onCaughtError),u.onRecoverableError!==void 0&&(P=u.onRecoverableError),u.formState!==void 0&&(H=u.formState)),r=vk(i,1,!0,r,u??null,g,S,H,k,I,P,Rk),r.context=yk(null),u=r.current,g=Ia(),g=Ko(g),S=hr(g),S.callback=null,gr(u,S,g),u=g,r.current.lanes=u,xa(r,u),hi(r),i[or]=r.current,_h(i),new Ld(r)},hc.version="19.2.3",hc}var qk;function TP(){if(qk)return Xh.exports;qk=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Xh.exports=IP(),Xh.exports}var _P=TP(),NP=Object.create,uE=Object.defineProperty,OP=Object.getOwnPropertyDescriptor,dE=Object.getOwnPropertyNames,jP=Object.getPrototypeOf,PP=Object.prototype.hasOwnProperty,Mi=(e,t)=>function(){return t||(0,e[dE(e)[0]])((t={exports:{}}).exports,t),t.exports},DP=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(var s=dE(t),p=0,f=s.length,m;p<f;p++)m=s[p],!PP.call(e,m)&&m!==n&&uE(e,m,{get:(h=>t[h]).bind(null,m),enumerable:!(a=OP(t,m))||a.enumerable});return e},bn=(e,t,n)=>(n=e!=null?NP(jP(e)):{},DP(t||!e||!e.__esModule?uE(n,"default",{value:e,enumerable:!0}):n,e)),pE=Mi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(e,t){function n(a){"@babel/helpers - typeof";return t.exports=n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},t.exports.__esModule=!0,t.exports.default=t.exports,n(a)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),zP=Mi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,t){var n=pE().default;function a(s,p){if(n(s)!="object"||!s)return s;var f=s[Symbol.toPrimitive];if(f!==void 0){var m=f.call(s,p||"default");if(n(m)!="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return(p==="string"?String:Number)(s)}t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports}}),LP=Mi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,t){var n=pE().default,a=zP();function s(p){var f=a(p,"string");return n(f)=="symbol"?f:f+""}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}}),Lo=Mi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,t){var n=LP();function a(s,p,f){return(p=n(p))in s?Object.defineProperty(s,p,{value:f,enumerable:!0,configurable:!0,writable:!0}):s[p]=f,s}t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports}}),oi=Mi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,t){var n=Lo();function a(p,f){var m=Object.keys(p);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(p);f&&(h=h.filter(function(c){return Object.getOwnPropertyDescriptor(p,c).enumerable})),m.push.apply(m,h)}return m}function s(p){for(var f=1;f<arguments.length;f++){var m=arguments[f]!=null?arguments[f]:{};f%2?a(Object(m),!0).forEach(function(h){n(p,h,m[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(m)):a(Object(m)).forEach(function(h){Object.defineProperty(p,h,Object.getOwnPropertyDescriptor(m,h))})}return p}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}});function gl(e){const t={subscribe(n){let a=null,s=!1,p=!1,f=!1;function m(){if(a===null){f=!0;return}p||(p=!0,typeof a=="function"?a():a&&a.unsubscribe())}return a=e({next(h){var c;s||(c=n.next)===null||c===void 0||c.call(n,h)},error(h){var c;s||(s=!0,(c=n.error)===null||c===void 0||c.call(n,h),m())},complete(){var h;s||(s=!0,(h=n.complete)===null||h===void 0||h.call(n),m())}}),f&&m(),{unsubscribe:m}},pipe(...n){return n.reduce(qP,t)}};return t}function qP(e,t){return t(e)}function BP(e){const t=new AbortController;return new Promise((a,s)=>{let p=!1;function f(){p||(p=!0,m.unsubscribe())}t.signal.addEventListener("abort",()=>{s(t.signal.reason)});const m=e.subscribe({next(h){p=!0,a(h),f()},error(h){s(h)},complete(){t.abort(),f()}})})}function FP(e){return t=>{let n=0,a=null;const s=[];function p(){a||(a=t.subscribe({next(m){for(const c of s){var h;(h=c.next)===null||h===void 0||h.call(c,m)}},error(m){for(const c of s){var h;(h=c.error)===null||h===void 0||h.call(c,m)}},complete(){for(const h of s){var m;(m=h.complete)===null||m===void 0||m.call(h)}}}))}function f(){if(n===0&&a){const m=a;a=null,m.unsubscribe()}}return gl(m=>(n++,s.push(m),p(),{unsubscribe(){n--,f();const h=s.findIndex(c=>c===m);h>-1&&s.splice(h,1)}}))}}function mE(e){let t=e;const n=[],a=f=>{t!==void 0&&f.next(t),n.push(f)},s=f=>{n.splice(n.indexOf(f),1)},p=gl(f=>(a(f),()=>{s(f)}));return p.next=f=>{if(t!==f){t=f;for(const m of n)m.next(f)}},p.get=()=>t,p}function UP(e){return gl(t=>{function n(s=0,p=e.op){const f=e.links[s];if(!f)throw new Error("No more links to execute - did you forget to add an ending link?");return f({op:p,next(h){return n(s+1,h)}})}return n().subscribe(t)})}function Do(e){return!!e&&!Array.isArray(e)&&typeof e=="object"}function HP(){return Object.create(null)}const $P=typeof Symbol=="function"&&!!Symbol.asyncIterator;function fE(e){return $P&&Do(e)&&Symbol.asyncIterator in e}const Bk=e=>e();function Fk(e=0){return new Promise(t=>setTimeout(t,e))}var QP=Object.create,hE=Object.defineProperty,VP=Object.getOwnPropertyDescriptor,gE=Object.getOwnPropertyNames,GP=Object.getPrototypeOf,ZP=Object.prototype.hasOwnProperty,uu=(e,t)=>function(){return t||(0,e[gE(e)[0]])((t={exports:{}}).exports,t),t.exports},KP=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(var s=gE(t),p=0,f=s.length,m;p<f;p++)m=s[p],!ZP.call(e,m)&&m!==n&&hE(e,m,{get:(h=>t[h]).bind(null,m),enumerable:!(a=VP(t,m))||a.enumerable});return e},xm=(e,t,n)=>(n=e!=null?QP(GP(e)):{},KP(hE(n,"default",{value:e,enumerable:!0}),e));const vE=()=>{},Uk=e=>{Object.freeze&&Object.freeze(e)};function yE(e,t,n){var a;const s=t.join(".");return(a=n[s])!==null&&a!==void 0||(n[s]=new Proxy(vE,{get(p,f){if(!(typeof f!="string"||f==="then"))return yE(e,[...t,f],n)},apply(p,f,m){const h=t[t.length-1];if(h==="valueOf"||h==="toString"||h==="toJSON")return`tRPC.proxy(${t.slice(0,-1).join(".")})`;let c={args:m,path:t};return h==="call"?c={args:m.length>=2?[m[1]]:[],path:t.slice(0,-1)}:h==="apply"&&(c={args:m.length>=2?m[1]:[],path:t.slice(0,-1)}),Uk(c.args),Uk(c.path),e(c)}})),n[s]}const km=e=>yE(e,[],HP()),vb=e=>new Proxy(vE,{get(t,n){if(n!=="then")return e(n)}});var bE=uu({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(e,t){function n(a){"@babel/helpers - typeof";return t.exports=n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},t.exports.__esModule=!0,t.exports.default=t.exports,n(a)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),WP=uu({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,t){var n=bE().default;function a(s,p){if(n(s)!="object"||!s)return s;var f=s[Symbol.toPrimitive];if(f!==void 0){var m=f.call(s,p||"default");if(n(m)!="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return(p==="string"?String:Number)(s)}t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports}}),YP=uu({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,t){var n=bE().default,a=WP();function s(p){var f=a(p,"string");return n(f)=="symbol"?f:f+""}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}}),SE=uu({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,t){var n=YP();function a(s,p,f){return(p=n(p))in s?Object.defineProperty(s,p,{value:f,enumerable:!0,configurable:!0,writable:!0}):s[p]=f,s}t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports}}),yb=uu({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,t){var n=SE();function a(p,f){var m=Object.keys(p);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(p);f&&(h=h.filter(function(c){return Object.getOwnPropertyDescriptor(p,c).enumerable})),m.push.apply(m,h)}return m}function s(p){for(var f=1;f<arguments.length;f++){var m=arguments[f]!=null?arguments[f]:{};f%2?a(Object(m),!0).forEach(function(h){n(p,h,m[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(m)):a(Object(m)).forEach(function(h){Object.defineProperty(p,h,Object.getOwnPropertyDescriptor(m,h))})}return p}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}});xm(yb());xm(SE());var Bd=xm(yb());function XP(e,t){if("error"in e){const a=t.deserialize(e.error);return{ok:!1,error:(0,Bd.default)((0,Bd.default)({},e),{},{error:a})}}return{ok:!0,result:(0,Bd.default)((0,Bd.default)({},e.result),(!e.result.type||e.result.type==="data")&&{type:"data",data:t.deserialize(e.result.data)})}}var ag=class extends Error{constructor(){super("Unable to transform response from server")}};function xE(e,t){let n;try{n=XP(e,t)}catch{throw new ag}if(!n.ok&&(!Do(n.error.error)||typeof n.error.error.code!="number"))throw new ag;if(n.ok&&!Do(n.result))throw new ag;return n}xm(yb());var Fd=bn(Lo(),1),_s=bn(oi(),1);function JP(e){return e instanceof Wi}function e3(e){return Do(e)&&Do(e.error)&&typeof e.error.code=="number"&&typeof e.error.message=="string"}function t3(e,t){return typeof e=="string"?e:Do(e)&&typeof e.message=="string"?e.message:t}var Wi=class mp extends Error{constructor(t,n){var a,s;const p=n?.cause;super(t,{cause:p}),(0,Fd.default)(this,"cause",void 0),(0,Fd.default)(this,"shape",void 0),(0,Fd.default)(this,"data",void 0),(0,Fd.default)(this,"meta",void 0),this.meta=n?.meta,this.cause=p,this.shape=n==null||(a=n.result)===null||a===void 0?void 0:a.error,this.data=n==null||(s=n.result)===null||s===void 0?void 0:s.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,mp.prototype)}static from(t,n={}){const a=t;return JP(a)?(n.meta&&(a.meta=(0,_s.default)((0,_s.default)({},a.meta),n.meta)),a):e3(a)?new mp(a.error.message,(0,_s.default)((0,_s.default)({},n),{},{result:a,cause:n.cause})):new mp(t3(a,"Unknown error"),(0,_s.default)((0,_s.default)({},n),{},{cause:a}))}};function kE(e){const t=e;return t?"input"in t?t:{input:t,output:t}:{input:{serialize:n=>n,deserialize:n=>n},output:{serialize:n=>n,deserialize:n=>n}}}const Hk=e=>typeof e=="function";function n3(e){if(e)return e;if(typeof window<"u"&&Hk(window.fetch))return window.fetch;if(typeof globalThis<"u"&&Hk(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}var Dc=bn(oi());function a3(e){return{url:e.url.toString(),fetch:e.fetch,transformer:kE(e.transformer),methodOverride:e.methodOverride}}function i3(e){const t={};for(let n=0;n<e.length;n++){const a=e[n];t[n]=a}return t}const r3={query:"GET",mutation:"POST",subscription:"PATCH"};function wE(e){return"input"in e?e.transformer.input.serialize(e.input):i3(e.inputs.map(t=>e.transformer.input.serialize(t)))}const Ov=e=>{const t=e.url.split("?");let a=t[0].replace(/\/$/,"")+"/"+e.path;const s=[];if(t[1]&&s.push(t[1]),"inputs"in e&&s.push("batch=1"),e.type==="query"||e.type==="subscription"){const p=wE(e);p!==void 0&&e.methodOverride!=="POST"&&s.push(`input=${encodeURIComponent(JSON.stringify(p))}`)}return s.length&&(a+="?"+s.join("&")),a},o3=e=>{if(e.type==="query"&&e.methodOverride!=="POST")return;const t=wE(e);return t!==void 0?JSON.stringify(t):void 0},s3=e=>jv((0,Dc.default)((0,Dc.default)({},e),{},{contentTypeHeader:"application/json",getUrl:Ov,getBody:o3}));var l3=class extends Error{constructor(){const e="AbortError";super(e),this.name=e,this.message=e}};const c3=e=>{var t;if(e?.aborted)throw(t=e.throwIfAborted)===null||t===void 0||t.call(e),typeof DOMException<"u"?new DOMException("AbortError","AbortError"):new l3};async function u3(e){var t,n;c3(e.signal);const a=e.getUrl(e),s=e.getBody(e),p=(t=e.methodOverride)!==null&&t!==void 0?t:r3[e.type],f=await(async()=>{const h=await e.headers();return Symbol.iterator in h?Object.fromEntries(h):h})(),m=(0,Dc.default)((0,Dc.default)((0,Dc.default)({},e.contentTypeHeader&&p!=="GET"?{"content-type":e.contentTypeHeader}:{}),e.trpcAcceptHeader?{[(n=e.trpcAcceptHeaderKey)!==null&&n!==void 0?n:"trpc-accept"]:e.trpcAcceptHeader}:void 0),f);return n3(e.fetch)(a,{method:p,signal:e.signal,body:s,headers:m})}async function jv(e){const t={},n=await u3(e);t.response=n;const a=await n.json();return t.responseJSON=a,{json:a,meta:t}}function d3(e){return e instanceof Uint8Array||e instanceof Blob}function p3(e){return e instanceof FormData}var $s=bn(oi(),1);const m3=e=>{if("input"in e){const{input:t}=e;if(p3(t)){if(e.type!=="mutation"&&e.methodOverride!=="POST")throw new Error("FormData is only supported for mutations");return jv((0,$s.default)((0,$s.default)({},e),{},{contentTypeHeader:void 0,getUrl:Ov,getBody:()=>t}))}if(d3(t)){if(e.type!=="mutation"&&e.methodOverride!=="POST")throw new Error("Octet type input is only supported for mutations");return jv((0,$s.default)((0,$s.default)({},e),{},{contentTypeHeader:"application/octet-stream",getUrl:Ov,getBody:()=>t}))}}return s3(e)};function f3(e){const t=a3(e);return()=>n=>{const{op:a}=n;return gl(s=>{const{path:p,input:f,type:m}=a;if(m==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");const h=m3((0,$s.default)((0,$s.default)({},t),{},{type:m,path:p,input:f,signal:a.signal,headers(){return e.headers?typeof e.headers=="function"?e.headers({op:a}):e.headers:{}}}));let c;return h.then(x=>{c=x.meta;const M=xE(x.json,t.transformer.output);if(!M.ok){s.error(Wi.from(M.error,{meta:c}));return}s.next({context:x.meta,result:M.result}),s.complete()}).catch(x=>{s.error(Wi.from(x,{meta:c}))}),()=>{}})}}bn(oi(),1);bn(oi(),1);const h3={encode:e=>JSON.stringify(e),decode:e=>{if(typeof e!="string")throw new Error("jsonEncoder received binary data. JSON uses text frames. Use a binary encoder for binary data.");return JSON.parse(e)}},g3={enabled:!1,closeMs:0},v3={enabled:!1,pongTimeoutMs:1e3,intervalMs:5e3},y3=e=>e===0?0:Math.min(1e3*2**e,3e4),ME=(e,...t)=>typeof e=="function"?e(...t):e;var b3=bn(Lo(),1),Ns=class CE extends Error{constructor(t){super(t.message,{cause:t.cause}),this.name="TRPCWebSocketClosedError",Object.setPrototypeOf(this,CE.prototype)}},S3=class{constructor(e,t){this.onTimeout=e,this.timeoutMs=t,(0,b3.default)(this,"timeout",void 0)}reset(){this.timeout&&(clearTimeout(this.timeout),this.timeout=setTimeout(this.onTimeout,this.timeoutMs))}start(){clearTimeout(this.timeout),this.timeout=setTimeout(this.onTimeout,this.timeoutMs)}stop(){clearTimeout(this.timeout),this.timeout=void 0}};function AE(){let e,t;return{promise:new Promise((a,s)=>{e=a,t=s}),resolve:e,reject:t}}async function x3(e){const t=await ME(e.url);if(!e.connectionParams)return t;const a=`${t.includes("?")?"&":"?"}connectionParams=1`;return t+a}async function k3(e,t){const n={method:"connectionParams",data:await ME(e)};return t.encode(n)}var $k=bn(Lo(),1),w3=class{constructor(){(0,$k.default)(this,"outgoingRequests",new Array),(0,$k.default)(this,"pendingRequests",{})}register(e,t){const{promise:n,resolve:a}=AE();return this.outgoingRequests.push({id:String(e.id),message:e,end:n,callbacks:{next:t.next,complete:()=>{t.complete(),a()},error:s=>{t.error(s),a()}}}),()=>{this.delete(e.id),t.complete(),a()}}delete(e){e!==null&&(this.outgoingRequests=this.outgoingRequests.filter(({id:t})=>t!==String(e)),delete this.pendingRequests[String(e)])}flush(){const e=this.outgoingRequests;this.outgoingRequests=[];for(const t of e)this.pendingRequests[t.id]=t;return e}getPendingRequests(){return Object.values(this.pendingRequests)}getPendingRequest(e){return e===null?null:this.pendingRequests[String(e)]}getOutgoingRequests(){return this.outgoingRequests}getRequests(){return[...this.getOutgoingRequests().map(e=>({state:"outgoing",message:e.message,end:e.end,callbacks:e.callbacks})),...this.getPendingRequests().map(e=>({state:"pending",message:e.message,end:e.end,callbacks:e.callbacks}))]}hasPendingRequests(){return this.getPendingRequests().length>0}hasPendingSubscriptions(){return this.getPendingRequests().some(e=>e.message.method==="subscription")}hasOutgoingRequests(){return this.outgoingRequests.length>0}},jr=bn(Lo(),1);function M3(e){const{promise:t,resolve:n,reject:a}=AE();return e.addEventListener("open",()=>{e.removeEventListener("error",a),n()}),e.addEventListener("error",a),t}function C3(e,{intervalMs:t,pongTimeoutMs:n}){let a,s;function p(){a=setTimeout(()=>{e.send("PING"),s=setTimeout(()=>{e.close()},n)},t)}function f(){clearTimeout(a),p()}function m(){clearTimeout(s),f()}e.addEventListener("open",p),e.addEventListener("message",({data:h})=>{clearTimeout(a),p(),h==="PONG"&&m()}),e.addEventListener("close",()=>{clearTimeout(a),clearTimeout(s)})}var EE=class Pv{constructor(t){var n;if((0,jr.default)(this,"id",++Pv.connectCount),(0,jr.default)(this,"WebSocketPonyfill",void 0),(0,jr.default)(this,"urlOptions",void 0),(0,jr.default)(this,"keepAliveOpts",void 0),(0,jr.default)(this,"encoder",void 0),(0,jr.default)(this,"wsObservable",mE(null)),(0,jr.default)(this,"openPromise",null),this.WebSocketPonyfill=(n=t.WebSocketPonyfill)!==null&&n!==void 0?n:WebSocket,!this.WebSocketPonyfill)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=t.urlOptions,this.keepAliveOpts=t.keepAlive,this.encoder=t.encoder}get ws(){return this.wsObservable.get()}set ws(t){this.wsObservable.next(t)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){var t=this;if(t.openPromise)return t.openPromise;t.id=++Pv.connectCount;const n=x3(t.urlOptions).then(a=>new t.WebSocketPonyfill(a));t.openPromise=n.then(async a=>{t.ws=a,a.binaryType="arraybuffer",a.addEventListener("message",function({data:s}){s==="PING"&&this.send("PONG")}),t.keepAliveOpts.enabled&&C3(a,t.keepAliveOpts),a.addEventListener("close",()=>{t.ws===a&&(t.ws=null)}),await M3(a),t.urlOptions.connectionParams&&a.send(await k3(t.urlOptions.connectionParams,t.encoder))});try{await t.openPromise}finally{t.openPromise=null}}async close(){var t=this;try{await t.openPromise}finally{var n;(n=t.ws)===null||n===void 0||n.close()}}};(0,jr.default)(EE,"connectCount",0);function A3(e){return e.isOpen()?{id:e.id,state:"open",ws:e.ws}:e.isClosed()?{id:e.id,state:"closed",ws:e.ws}:e.ws?{id:e.id,state:"connecting",ws:e.ws}:null}var gi=bn(Lo(),1),Os=bn(oi(),1),E3=class{constructor(e){var t,n;(0,gi.default)(this,"connectionState",void 0),(0,gi.default)(this,"allowReconnect",!1),(0,gi.default)(this,"requestManager",new w3),(0,gi.default)(this,"activeConnection",void 0),(0,gi.default)(this,"reconnectRetryDelay",void 0),(0,gi.default)(this,"inactivityTimeout",void 0),(0,gi.default)(this,"callbacks",void 0),(0,gi.default)(this,"lazyMode",void 0),(0,gi.default)(this,"encoder",void 0),(0,gi.default)(this,"reconnecting",null),this.encoder=(t=e.experimental_encoder)!==null&&t!==void 0?t:h3,this.callbacks={onOpen:e.onOpen,onClose:e.onClose,onError:e.onError};const a=(0,Os.default)((0,Os.default)({},g3),e.lazy);this.inactivityTimeout=new S3(()=>{if(this.requestManager.hasOutgoingRequests()||this.requestManager.hasPendingRequests()){this.inactivityTimeout.reset();return}this.close().catch(()=>null)},a.closeMs),this.activeConnection=new EE({WebSocketPonyfill:e.WebSocket,urlOptions:e,keepAlive:(0,Os.default)((0,Os.default)({},v3),e.keepAlive),encoder:this.encoder}),this.activeConnection.wsObservable.subscribe({next:s=>{s&&this.setupWebSocketListeners(s)}}),this.reconnectRetryDelay=(n=e.retryDelayMs)!==null&&n!==void 0?n:y3,this.lazyMode=a.enabled,this.connectionState=mE({type:"state",state:a.enabled?"idle":"connecting",error:null}),this.lazyMode||this.open().catch(()=>null)}async open(){var e=this;e.allowReconnect=!0,e.connectionState.get().state==="idle"&&e.connectionState.next({type:"state",state:"connecting",error:null});try{await e.activeConnection.open()}catch(t){return e.reconnect(new Ns({message:"Initialization error",cause:t})),e.reconnecting}}async close(){var e=this;e.allowReconnect=!1,e.inactivityTimeout.stop();const t=[];for(const n of e.requestManager.getRequests())n.message.method==="subscription"?n.callbacks.complete():n.state==="outgoing"?n.callbacks.error(Wi.from(new Ns({message:"Closed before connection was established"}))):t.push(n.end);await Promise.all(t).catch(()=>null),await e.activeConnection.close().catch(()=>null),e.connectionState.next({type:"state",state:"idle",error:null})}request({op:{id:e,type:t,path:n,input:a,signal:s},transformer:p,lastEventId:f}){return gl(m=>{const h=this.batchSend({id:e,method:t,params:{input:p.input.serialize(a),path:n,lastEventId:f}},(0,Os.default)((0,Os.default)({},m),{},{next(c){const x=xE(c,p.output);if(!x.ok){m.error(Wi.from(x.error));return}m.next({result:x.result})}}));return()=>{h(),t==="subscription"&&this.activeConnection.isOpen()&&this.send({id:e,method:"subscription.stop"}),s?.removeEventListener("abort",h)}})}get connection(){return A3(this.activeConnection)}reconnect(e){var t=this;if(this.connectionState.next({type:"state",state:"connecting",error:Wi.from(e)}),this.reconnecting)return;const n=async a=>{try{await Fk(t.reconnectRetryDelay(a)),t.allowReconnect&&(await t.activeConnection.close(),await t.activeConnection.open(),t.requestManager.hasPendingRequests()&&t.send(t.requestManager.getPendingRequests().map(({message:s})=>s))),t.reconnecting=null}catch{await n(a+1)}};this.reconnecting=n(0)}setupWebSocketListeners(e){var t=this;const n=a=>{const s=this.requestManager.getPendingRequests();for(const{message:p,callbacks:f}of s)p.method!=="subscription"&&(f.error(Wi.from(a??new Ns({message:"WebSocket closed",cause:a}))),this.requestManager.delete(p.id))};e.addEventListener("open",()=>{Bk(async()=>{var a,s;t.lazyMode&&t.inactivityTimeout.start(),(a=(s=t.callbacks).onOpen)===null||a===void 0||a.call(s),t.connectionState.next({type:"state",state:"pending",error:null})}).catch(a=>{e.close(3e3),n(a)})}),e.addEventListener("message",({data:a})=>{if(this.inactivityTimeout.reset(),["PING","PONG"].includes(a))return;const s=this.encoder.decode(a);if("method"in s){this.handleIncomingRequest(s);return}this.handleResponseMessage(s)}),e.addEventListener("close",a=>{var s,p;n(a),(s=(p=this.callbacks).onClose)===null||s===void 0||s.call(p,a),(!this.lazyMode||this.requestManager.hasPendingSubscriptions())&&this.reconnect(new Ns({message:"WebSocket closed",cause:a}))}),e.addEventListener("error",a=>{var s,p;n(a),(s=(p=this.callbacks).onError)===null||s===void 0||s.call(p,a),this.reconnect(new Ns({message:"WebSocket closed",cause:a}))})}handleResponseMessage(e){const t=this.requestManager.getPendingRequest(e.id);if(!t)return;t.callbacks.next(e);let n=!0;"result"in e&&t.message.method==="subscription"&&(e.result.type==="data"&&(t.message.params.lastEventId=e.result.id),e.result.type!=="stopped"&&(n=!1)),n&&(t.callbacks.complete(),this.requestManager.delete(e.id))}handleIncomingRequest(e){e.method==="reconnect"&&this.reconnect(new Ns({message:"Server requested reconnect"}))}send(e){if(!this.activeConnection.isOpen())throw new Error("Active connection is not open");const t=e instanceof Array?e:[e];this.activeConnection.ws.send(this.encoder.encode(t.length===1?t[0]:t))}batchSend(e,t){var n=this;return this.inactivityTimeout.reset(),Bk(async()=>{n.activeConnection.isOpen()||await n.open(),await Fk(0),n.requestManager.hasOutgoingRequests()&&n.send(n.requestManager.flush().map(({message:a})=>a))}).catch(a=>{this.requestManager.delete(e.id),t.error(Wi.from(a))}),this.requestManager.register(e,t)}};function R3(e){return new E3(e)}function I3(e){const{client:t}=e,n=kE(e.transformer);return()=>({op:a})=>gl(s=>{const p=a.type==="subscription"?t.connectionState.subscribe({next(m){s.next({result:m,context:a.context})}}):null,f=t.request({op:a,transformer:n}).subscribe(s);return()=>{f.unsubscribe(),p?.unsubscribe()}})}var ig=bn(Lo(),1),Qk=bn(oi(),1),wm=class{constructor(e){(0,ig.default)(this,"links",void 0),(0,ig.default)(this,"runtime",void 0),(0,ig.default)(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=e.links.map(t=>t(this.runtime))}$request(e){var t;return UP({links:this.links,op:(0,Qk.default)((0,Qk.default)({},e),{},{context:(t=e.context)!==null&&t!==void 0?t:{},id:++this.requestId})}).pipe(FP())}async requestAsPromise(e){var t=this;try{const n=t.$request(e);return(await BP(n)).result.data}catch(n){throw Wi.from(n)}}query(e,t,n){return this.requestAsPromise({type:"query",path:e,input:t,context:n?.context,signal:n?.signal})}mutation(e,t,n){return this.requestAsPromise({type:"mutation",path:e,input:t,context:n?.context,signal:n?.signal})}subscription(e,t,n){return this.$request({type:"subscription",path:e,input:t,context:n.context,signal:n.signal}).subscribe({next(s){switch(s.result.type){case"state":{var p;(p=n.onConnectionStateChange)===null||p===void 0||p.call(n,s.result);break}case"started":{var f;(f=n.onStarted)===null||f===void 0||f.call(n,{context:s.context});break}case"stopped":{var m;(m=n.onStopped)===null||m===void 0||m.call(n);break}case"data":case void 0:{var h;(h=n.onData)===null||h===void 0||h.call(n,s.result.data);break}}},error(s){var p;(p=n.onError)===null||p===void 0||p.call(n,s)},complete(){var s;(s=n.onComplete)===null||s===void 0||s.call(n)}})}};const RE=Symbol.for("trpc_untypedClient"),T3={query:"query",mutate:"mutation",subscribe:"subscription"},_3=e=>T3[e];function IE(e){const t=km(({path:n,args:a})=>{const s=[...n],p=_3(s.pop()),f=s.join(".");return e[p](f,...a)});return vb(n=>n===RE?e:t[n])}function Dv(e){const t=new wm(e);return IE(t)}function bb(e){return e[RE]}bn(oi(),1);bn(oi(),1);var N3=Mi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(e,t){function n(s){var p,f,m,h=2;for(typeof Symbol<"u"&&(f=Symbol.asyncIterator,m=Symbol.iterator);h--;){if(f&&(p=s[f])!=null)return p.call(s);if(m&&(p=s[m])!=null)return new a(p.call(s));f="@@asyncIterator",m="@@iterator"}throw new TypeError("Object is not async iterable")}function a(s){function p(f){if(Object(f)!==f)return Promise.reject(new TypeError(f+" is not an object."));var m=f.done;return Promise.resolve(f.value).then(function(h){return{value:h,done:m}})}return a=function(m){this.s=m,this.n=m.next},a.prototype={s:null,n:null,next:function(){return p(this.n.apply(this.s,arguments))},return:function(m){var h=this.s.return;return h===void 0?Promise.resolve({value:m,done:!0}):p(h.apply(this.s,arguments))},throw:function(m){var h=this.s.return;return h===void 0?Promise.reject(m):p(h.apply(this.s,arguments))}},new a(s)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}});bn(N3(),1);bn(oi(),1);var O3=Mi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(e,t){function n(){var a=typeof SuppressedError=="function"?SuppressedError:function(m,h){var c=Error();return c.name="SuppressedError",c.error=m,c.suppressed=h,c},s={},p=[];function f(m,h){if(h!=null){if(Object(h)!==h)throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(m)var c=h[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(c===void 0&&(c=h[Symbol.dispose||Symbol.for("Symbol.dispose")],m))var x=c;if(typeof c!="function")throw new TypeError("Object is not disposable.");x&&(c=function(){try{x.call(h)}catch(C){return Promise.reject(C)}}),p.push({v:h,d:c,a:m})}else m&&p.push({d:h,a:m});return h}return{e:s,u:f.bind(null,!1),a:f.bind(null,!0),d:function(){var h,c=this.e,x=0;function M(){for(;h=p.pop();)try{if(!h.a&&x===1)return x=0,p.push(h),Promise.resolve().then(M);if(h.d){var E=h.d.call(h.v);if(h.a)return x|=2,Promise.resolve(E).then(M,C)}else x|=1}catch(R){return C(R)}if(x===1)return c!==s?Promise.reject(c):Promise.resolve();if(c!==s)throw c}function C(E){return c=c!==s?new a(E,c):E,M()}return M()}}}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),TE=Mi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"(e,t){function n(a,s){this.v=a,this.k=s}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),j3=Mi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"(e,t){var n=TE();function a(s){return new n(s,0)}t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports}}),P3=Mi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"(e,t){var n=TE();function a(p){return function(){return new s(p.apply(this,arguments))}}function s(p){var f,m;function h(x,M){try{var C=p[x](M),E=C.value,R=E instanceof n;Promise.resolve(R?E.v:E).then(function(_){if(R){var j=x==="return"?"return":"next";if(!E.k||_.done)return h(j,_);_=p[j](_).value}c(C.done?"return":"normal",_)},function(_){h("throw",_)})}catch(_){c("throw",_)}}function c(x,M){switch(x){case"return":f.resolve({value:M,done:!0});break;case"throw":f.reject(M);break;default:f.resolve({value:M,done:!1})}(f=f.next)?h(f.key,f.arg):m=null}this._invoke=function(x,M){return new Promise(function(C,E){var R={key:x,arg:M,resolve:C,reject:E,next:null};m?m=m.next=R:(f=m=R,h(x,M))})},typeof p.return!="function"&&(this.return=void 0)}s.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},s.prototype.next=function(p){return this._invoke("next",p)},s.prototype.throw=function(p){return this._invoke("throw",p)},s.prototype.return=function(p){return this._invoke("return",p)},t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports}});bn(O3(),1);bn(j3(),1);bn(P3(),1);bn(oi(),1);const D3="modulepreload",z3=function(e,t){return new URL(e,t).href},Vk={},il=function(t,n,a){let s=Promise.resolve();if(n&&n.length>0){let c=function(x){return Promise.all(x.map(M=>Promise.resolve(M).then(C=>({status:"fulfilled",value:C}),C=>({status:"rejected",reason:C}))))};const f=document.getElementsByTagName("link"),m=document.querySelector("meta[property=csp-nonce]"),h=m?.nonce||m?.getAttribute("nonce");s=c(n.map(x=>{if(x=z3(x,a),x in Vk)return;Vk[x]=!0;const M=x.endsWith(".css"),C=M?'[rel="stylesheet"]':"";if(a)for(let R=f.length-1;R>=0;R--){const _=f[R];if(_.href===x&&(!M||_.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${x}"]${C}`))return;const E=document.createElement("link");if(E.rel=M?"stylesheet":D3,M||(E.as="script"),E.crossOrigin="",E.href=x,h&&E.setAttribute("nonce",h),document.head.appendChild(E),M)return new Promise((R,_)=>{E.addEventListener("load",R),E.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${x}`)))})}))}function p(f){const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=f,window.dispatchEvent(m),!m.defaultPrevented)throw f}return s.then(f=>{for(const m of f||[])m.status==="rejected"&&p(m.reason);return t().catch(p)})};var We=(function(e){return e.SystemBoot="system.boot",e.SystemAddonsReady="system.addons-ready",e.SystemRestarting="system.restarting",e.SystemRestartCompleted="system.restart-completed",e.SystemTlsCertChanged="system.tls-cert-changed",e.UpdateAvailable="update.available",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.AddonRunnerFailed="addon.runner-failed",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.SystemLivenessFailed="system.liveness-failed",e.SystemLivenessRecovered="system.liveness-recovered",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.StorageLocationsChanged="storage.locations-changed",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.RecordingExportProgress="recording.export.progress",e.RecordingExportCompleted="recording.export.completed",e.RecordingExportFailed="recording.export.failed",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.PipelineNodeInferenceUnavailable="pipeline.node-inference-unavailable",e.PipelineDetectionBlind="pipeline.detection-blind",e.PipelineCameraUpdated="pipeline.camera-updated",e.PipelineIngestOwnerChanged="pipeline.ingest-owner-changed",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.ZoneAnalyticsOccupancyChanged="zone-analytics.occupancy-changed",e.BatteryOnStatusChanged="battery.onStatusChanged",e.NetworkLinkOnStatusChanged="network-link.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.PipelineAnalyticsTrackLifecycle="pipeline-analytics.track-lifecycle",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.PipelineAnalyticsStationaryChanged="pipeline-analytics.stationary-changed",e.PipelineAnalyticsPackageDelivered="pipeline-analytics.package-delivered",e.PipelineAnalyticsPackagePickedUp="pipeline-analytics.package-picked-up",e.PipelineAnalyticsFaceGalleryChanged="pipeline-analytics.face-gallery-changed",e.PipelineAnalyticsPlateGalleryChanged="pipeline-analytics.plate-gallery-changed",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.BackupRunCompleted="backup.run-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.ModelConvertProgress="model-convert.progress",e})({}),Gk;function ue(e,t,n){function a(m,h){if(m._zod||Object.defineProperty(m,"_zod",{value:{def:h,constr:f,traits:new Set},enumerable:!1}),m._zod.traits.has(e))return;m._zod.traits.add(e),t(m,h);const c=f.prototype,x=Object.keys(c);for(let M=0;M<x.length;M++){const C=x[M];C in m||(m[C]=c[C].bind(m))}}const s=n?.Parent??Object;class p extends s{}Object.defineProperty(p,"name",{value:e});function f(m){var h;const c=n?.Parent?new p:this;a(c,m),(h=c._zod).deferred??(h.deferred=[]);for(const x of c._zod.deferred)x();return c}return Object.defineProperty(f,"init",{value:a}),Object.defineProperty(f,Symbol.hasInstance,{value:m=>n?.Parent&&m instanceof n.Parent?!0:m?._zod?.traits?.has(e)}),Object.defineProperty(f,"name",{value:e}),f}class el extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class _E extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(Gk=globalThis).__zod_globalConfig??(Gk.__zod_globalConfig={});const Sb=globalThis.__zod_globalConfig;function nr(e){return Sb}function NE(e){const t=Object.values(e).filter(a=>typeof a=="number");return Object.entries(e).filter(([a,s])=>t.indexOf(+a)===-1).map(([a,s])=>s)}function zv(e,t){return typeof t=="bigint"?t.toString():t}function Mm(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function xb(e){return e==null}function kb(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function L3(e,t){const n=e/t,a=Math.round(n),s=Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-a)<s?0:n-a}const Zk=Symbol("evaluating");function Mt(e,t,n){let a;Object.defineProperty(e,t,{get(){if(a!==Zk)return a===void 0&&(a=Zk,a=n()),a},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function qo(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Qr(...e){const t={};for(const n of e){const a=Object.getOwnPropertyDescriptors(n);Object.assign(t,a)}return Object.defineProperties({},t)}function Kk(e){return JSON.stringify(e)}function q3(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const OE="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Vc(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const B3=Mm(()=>{if(Sb.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function rl(e){if(Vc(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(Vc(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function jE(e){return rl(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const F3=new Set(["string","number","symbol"]);function ol(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ir(e,t,n){const a=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(a._zod.parent=e),a}function qe(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function U3(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const H3={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function $3(e,t){const n=e._zod.def,a=n.checks;if(a&&a.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const p=Qr(e._zod.def,{get shape(){const f={};for(const m in t){if(!(m in n.shape))throw new Error(`Unrecognized key: "${m}"`);t[m]&&(f[m]=n.shape[m])}return qo(this,"shape",f),f},checks:[]});return ir(e,p)}function Q3(e,t){const n=e._zod.def,a=n.checks;if(a&&a.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const p=Qr(e._zod.def,{get shape(){const f={...e._zod.def.shape};for(const m in t){if(!(m in n.shape))throw new Error(`Unrecognized key: "${m}"`);t[m]&&delete f[m]}return qo(this,"shape",f),f},checks:[]});return ir(e,p)}function V3(e,t){if(!rl(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const p=e._zod.def.shape;for(const f in t)if(Object.getOwnPropertyDescriptor(p,f)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=Qr(e._zod.def,{get shape(){const p={...e._zod.def.shape,...t};return qo(this,"shape",p),p}});return ir(e,s)}function G3(e,t){if(!rl(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Qr(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return qo(this,"shape",a),a}});return ir(e,n)}function Z3(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const n=Qr(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t._zod.def.shape};return qo(this,"shape",a),a},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return ir(e,n)}function K3(e,t,n){const s=t._zod.def.checks;if(s&&s.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const f=Qr(t._zod.def,{get shape(){const m=t._zod.def.shape,h={...m};if(n)for(const c in n){if(!(c in m))throw new Error(`Unrecognized key: "${c}"`);n[c]&&(h[c]=e?new e({type:"optional",innerType:m[c]}):m[c])}else for(const c in m)h[c]=e?new e({type:"optional",innerType:m[c]}):m[c];return qo(this,"shape",h),h},checks:[]});return ir(t,f)}function W3(e,t,n){const a=Qr(t._zod.def,{get shape(){const s=t._zod.def.shape,p={...s};if(n)for(const f in n){if(!(f in p))throw new Error(`Unrecognized key: "${f}"`);n[f]&&(p[f]=new e({type:"nonoptional",innerType:s[f]}))}else for(const f in s)p[f]=new e({type:"nonoptional",innerType:s[f]});return qo(this,"shape",p),p}});return ir(t,a)}function Qs(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Y3(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Dr(e,t){return t.map(n=>{var a;return(a=n).path??(a.path=[]),n.path.unshift(e),n})}function Ud(e){return typeof e=="string"?e:e?.message}function ar(e,t,n){const a=e.message?e.message:Ud(e.inst?._zod.def?.error?.(e))??Ud(t?.error?.(e))??Ud(n.customError?.(e))??Ud(n.localeError?.(e))??"Invalid input",{inst:s,continue:p,input:f,...m}=e;return m.path??(m.path=[]),m.message=a,t?.reportInput&&(m.input=f),m}function wb(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Gc(...e){const[t,n,a]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:a}:{...t}}const PE=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,zv,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},DE=ue("$ZodError",PE),zE=ue("$ZodError",PE,{Parent:Error});function X3(e,t=n=>n.message){const n={},a=[];for(const s of e.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):a.push(t(s));return{formErrors:a,fieldErrors:n}}function J3(e,t=n=>n.message){const n={_errors:[]},a=(s,p=[])=>{for(const f of s.issues)if(f.code==="invalid_union"&&f.errors.length)f.errors.map(m=>a({issues:m},[...p,...f.path]));else if(f.code==="invalid_key")a({issues:f.issues},[...p,...f.path]);else if(f.code==="invalid_element")a({issues:f.issues},[...p,...f.path]);else{const m=[...p,...f.path];if(m.length===0)n._errors.push(t(f));else{let h=n,c=0;for(;c<m.length;){const x=m[c];c===m.length-1?(h[x]=h[x]||{_errors:[]},h[x]._errors.push(t(f))):h[x]=h[x]||{_errors:[]},h=h[x],c++}}}};return a(e),n}const Mb=e=>(t,n,a,s)=>{const p=a?{...a,async:!1}:{async:!1},f=t._zod.run({value:n,issues:[]},p);if(f instanceof Promise)throw new el;if(f.issues.length){const m=new(s?.Err??e)(f.issues.map(h=>ar(h,p,nr())));throw OE(m,s?.callee),m}return f.value},Cb=e=>async(t,n,a,s)=>{const p=a?{...a,async:!0}:{async:!0};let f=t._zod.run({value:n,issues:[]},p);if(f instanceof Promise&&(f=await f),f.issues.length){const m=new(s?.Err??e)(f.issues.map(h=>ar(h,p,nr())));throw OE(m,s?.callee),m}return f.value},Cm=e=>(t,n,a)=>{const s=a?{...a,async:!1}:{async:!1},p=t._zod.run({value:n,issues:[]},s);if(p instanceof Promise)throw new el;return p.issues.length?{success:!1,error:new(e??DE)(p.issues.map(f=>ar(f,s,nr())))}:{success:!0,data:p.value}},eD=Cm(zE),Am=e=>async(t,n,a)=>{const s=a?{...a,async:!0}:{async:!0};let p=t._zod.run({value:n,issues:[]},s);return p instanceof Promise&&(p=await p),p.issues.length?{success:!1,error:new e(p.issues.map(f=>ar(f,s,nr())))}:{success:!0,data:p.value}},tD=Am(zE),nD=e=>(t,n,a)=>{const s=a?{...a,direction:"backward"}:{direction:"backward"};return Mb(e)(t,n,s)},aD=e=>(t,n,a)=>Mb(e)(t,n,a),iD=e=>async(t,n,a)=>{const s=a?{...a,direction:"backward"}:{direction:"backward"};return Cb(e)(t,n,s)},rD=e=>async(t,n,a)=>Cb(e)(t,n,a),oD=e=>(t,n,a)=>{const s=a?{...a,direction:"backward"}:{direction:"backward"};return Cm(e)(t,n,s)},sD=e=>(t,n,a)=>Cm(e)(t,n,a),lD=e=>async(t,n,a)=>{const s=a?{...a,direction:"backward"}:{direction:"backward"};return Am(e)(t,n,s)},cD=e=>async(t,n,a)=>Am(e)(t,n,a),uD=/^[cC][0-9a-z]{6,}$/,dD=/^[0-9a-z]+$/,pD=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,mD=/^[0-9a-vA-V]{20}$/,fD=/^[A-Za-z0-9]{27}$/,hD=/^[a-zA-Z0-9_-]{21}$/,gD=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,vD=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Wk=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,yD=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,bD="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function SD(){return new RegExp(bD,"u")}const xD=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,kD=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,wD=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,MD=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,CD=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,LE=/^[A-Za-z0-9_-]*$/,AD=/^https?$/,ED=/^\+[1-9]\d{6,14}$/,qE="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",RD=new RegExp(`^${qE}$`);function BE(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function ID(e){return new RegExp(`^${BE(e)}$`)}function TD(e){const t=BE({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const a=`${t}(?:${n.join("|")})`;return new RegExp(`^${qE}T(?:${a})$`)}const _D=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},ND=/^-?\d+$/,FE=/^-?\d+(?:\.\d+)?$/,OD=/^(?:true|false)$/i,jD=/^null$/i,PD=/^[^A-Z]*$/,DD=/^[^a-z]*$/,ba=ue("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),UE={number:"number",bigint:"bigint",object:"date"},HE=ue("$ZodCheckLessThan",(e,t)=>{ba.init(e,t);const n=UE[typeof t.value];e._zod.onattach.push(a=>{const s=a._zod.bag,p=(t.inclusive?s.maximum:s.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<p&&(t.inclusive?s.maximum=t.value:s.exclusiveMaximum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value<=t.value:a.value<t.value)||a.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),$E=ue("$ZodCheckGreaterThan",(e,t)=>{ba.init(e,t);const n=UE[typeof t.value];e._zod.onattach.push(a=>{const s=a._zod.bag,p=(t.inclusive?s.minimum:s.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>p&&(t.inclusive?s.minimum=t.value:s.exclusiveMinimum=t.value)}),e._zod.check=a=>{(t.inclusive?a.value>=t.value:a.value>t.value)||a.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:a.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),zD=ue("$ZodCheckMultipleOf",(e,t)=>{ba.init(e,t),e._zod.onattach.push(n=>{var a;(a=n._zod.bag).multipleOf??(a.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):L3(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),LD=ue("$ZodCheckNumberFormat",(e,t)=>{ba.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),a=n?"int":"number",[s,p]=H3[t.format];e._zod.onattach.push(f=>{const m=f._zod.bag;m.format=t.format,m.minimum=s,m.maximum=p,n&&(m.pattern=ND)}),e._zod.check=f=>{const m=f.value;if(n){if(!Number.isInteger(m)){f.issues.push({expected:a,format:t.format,code:"invalid_type",continue:!1,input:m,inst:e});return}if(!Number.isSafeInteger(m)){m>0?f.issues.push({input:m,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!t.abort}):f.issues.push({input:m,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:a,inclusive:!0,continue:!t.abort});return}}m<s&&f.issues.push({origin:"number",input:m,code:"too_small",minimum:s,inclusive:!0,inst:e,continue:!t.abort}),m>p&&f.issues.push({origin:"number",input:m,code:"too_big",maximum:p,inclusive:!0,inst:e,continue:!t.abort})}}),qD=ue("$ZodCheckMaxLength",(e,t)=>{var n;ba.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!xb(s)&&s.length!==void 0}),e._zod.onattach.push(a=>{const s=a._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<s&&(a._zod.bag.maximum=t.maximum)}),e._zod.check=a=>{const s=a.value;if(s.length<=t.maximum)return;const f=wb(s);a.issues.push({origin:f,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),BD=ue("$ZodCheckMinLength",(e,t)=>{var n;ba.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!xb(s)&&s.length!==void 0}),e._zod.onattach.push(a=>{const s=a._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>s&&(a._zod.bag.minimum=t.minimum)}),e._zod.check=a=>{const s=a.value;if(s.length>=t.minimum)return;const f=wb(s);a.issues.push({origin:f,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),FD=ue("$ZodCheckLengthEquals",(e,t)=>{var n;ba.init(e,t),(n=e._zod.def).when??(n.when=a=>{const s=a.value;return!xb(s)&&s.length!==void 0}),e._zod.onattach.push(a=>{const s=a._zod.bag;s.minimum=t.length,s.maximum=t.length,s.length=t.length}),e._zod.check=a=>{const s=a.value,p=s.length;if(p===t.length)return;const f=wb(s),m=p>t.length;a.issues.push({origin:f,...m?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:a.value,inst:e,continue:!t.abort})}}),Em=ue("$ZodCheckStringFormat",(e,t)=>{var n,a;ba.init(e,t),e._zod.onattach.push(s=>{const p=s._zod.bag;p.format=t.format,t.pattern&&(p.patterns??(p.patterns=new Set),p.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:t.format,input:s.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(a=e._zod).check??(a.check=()=>{})}),UD=ue("$ZodCheckRegex",(e,t)=>{Em.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),HD=ue("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=PD),Em.init(e,t)}),$D=ue("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=DD),Em.init(e,t)}),QD=ue("$ZodCheckIncludes",(e,t)=>{ba.init(e,t);const n=ol(t.includes),a=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=a,e._zod.onattach.push(s=>{const p=s._zod.bag;p.patterns??(p.patterns=new Set),p.patterns.add(a)}),e._zod.check=s=>{s.value.includes(t.includes,t.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:s.value,inst:e,continue:!t.abort})}}),VD=ue("$ZodCheckStartsWith",(e,t)=>{ba.init(e,t);const n=new RegExp(`^${ol(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(a=>{const s=a._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=a=>{a.value.startsWith(t.prefix)||a.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:a.value,inst:e,continue:!t.abort})}}),GD=ue("$ZodCheckEndsWith",(e,t)=>{ba.init(e,t);const n=new RegExp(`.*${ol(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(a=>{const s=a._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=a=>{a.value.endsWith(t.suffix)||a.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:a.value,inst:e,continue:!t.abort})}}),ZD=ue("$ZodCheckOverwrite",(e,t)=>{ba.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class KD{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const a=t.split(`
11
- `).filter(f=>f),s=Math.min(...a.map(f=>f.length-f.trimStart().length)),p=a.map(f=>f.slice(s)).map(f=>" ".repeat(this.indent*2)+f);for(const f of p)this.content.push(f)}compile(){const t=Function,n=this?.args,s=[...(this?.content??[""]).map(p=>` ${p}`)];return new t(...n,s.join(`
12
- `))}}const WD={major:4,minor:4,patch:3},_t=ue("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=WD;const a=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&a.unshift(e);for(const s of a)for(const p of s._zod.onattach)p(e);if(a.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const s=(f,m,h)=>{let c=Qs(f),x;for(const M of m){if(M._zod.def.when){if(Y3(f)||!M._zod.def.when(f))continue}else if(c)continue;const C=f.issues.length,E=M._zod.check(f);if(E instanceof Promise&&h?.async===!1)throw new el;if(x||E instanceof Promise)x=(x??Promise.resolve()).then(async()=>{await E,f.issues.length!==C&&(c||(c=Qs(f,C)))});else{if(f.issues.length===C)continue;c||(c=Qs(f,C))}}return x?x.then(()=>f):f},p=(f,m,h)=>{if(Qs(f))return f.aborted=!0,f;const c=s(m,a,h);if(c instanceof Promise){if(h.async===!1)throw new el;return c.then(x=>e._zod.parse(x,h))}return e._zod.parse(c,h)};e._zod.run=(f,m)=>{if(m.skipChecks)return e._zod.parse(f,m);if(m.direction==="backward"){const c=e._zod.parse({value:f.value,issues:[]},{...m,skipChecks:!0});return c instanceof Promise?c.then(x=>p(x,f,m)):p(c,f,m)}const h=e._zod.parse(f,m);if(h instanceof Promise){if(m.async===!1)throw new el;return h.then(c=>s(c,a,m))}return s(h,a,m)}}Mt(e,"~standard",()=>({validate:s=>{try{const p=eD(e,s);return p.success?{value:p.data}:{issues:p.error?.issues}}catch{return tD(e,s).then(f=>f.success?{value:f.data}:{issues:f.error?.issues})}},vendor:"zod",version:1}))}),Ab=ue("$ZodString",(e,t)=>{_t.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??_D(e._zod.bag),e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Jt=ue("$ZodStringFormat",(e,t)=>{Em.init(e,t),Ab.init(e,t)}),YD=ue("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=vD),Jt.init(e,t)}),XD=ue("$ZodUUID",(e,t)=>{if(t.version){const a={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(a===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Wk(a))}else t.pattern??(t.pattern=Wk());Jt.init(e,t)}),JD=ue("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=yD),Jt.init(e,t)}),e6=ue("$ZodURL",(e,t)=>{Jt.init(e,t),e._zod.check=n=>{try{const a=n.value.trim();if(!t.normalize&&t.protocol?.source===AD.source&&!/^https?:\/\//i.test(a)){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}const s=new URL(a);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(s.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=s.href:n.value=a;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),t6=ue("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=SD()),Jt.init(e,t)}),n6=ue("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=hD),Jt.init(e,t)}),a6=ue("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=uD),Jt.init(e,t)}),i6=ue("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=dD),Jt.init(e,t)}),r6=ue("$ZodULID",(e,t)=>{t.pattern??(t.pattern=pD),Jt.init(e,t)}),o6=ue("$ZodXID",(e,t)=>{t.pattern??(t.pattern=mD),Jt.init(e,t)}),s6=ue("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=fD),Jt.init(e,t)}),l6=ue("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=TD(t)),Jt.init(e,t)}),c6=ue("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=RD),Jt.init(e,t)}),u6=ue("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=ID(t)),Jt.init(e,t)}),d6=ue("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=gD),Jt.init(e,t)}),p6=ue("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=xD),Jt.init(e,t),e._zod.bag.format="ipv4"}),m6=ue("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=kD),Jt.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),f6=ue("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=wD),Jt.init(e,t)}),h6=ue("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=MD),Jt.init(e,t),e._zod.check=n=>{const a=n.value.split("/");try{if(a.length!==2)throw new Error;const[s,p]=a;if(!p)throw new Error;const f=Number(p);if(`${f}`!==p)throw new Error;if(f<0||f>128)throw new Error;new URL(`http://[${s}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function QE(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const g6=ue("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=CD),Jt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{QE(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function v6(e){if(!LE.test(e))return!1;const t=e.replace(/[-_]/g,a=>a==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return QE(n)}const y6=ue("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=LE),Jt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{v6(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),b6=ue("$ZodE164",(e,t)=>{t.pattern??(t.pattern=ED),Jt.init(e,t)});function S6(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[a]=n;if(!a)return!1;const s=JSON.parse(atob(a));return!("typ"in s&&s?.typ!=="JWT"||!s.alg||t&&(!("alg"in s)||s.alg!==t))}catch{return!1}}const x6=ue("$ZodJWT",(e,t)=>{Jt.init(e,t),e._zod.check=n=>{S6(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),VE=ue("$ZodNumber",(e,t)=>{_t.init(e,t),e._zod.pattern=e._zod.bag.pattern??FE,e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const s=n.value;if(typeof s=="number"&&!Number.isNaN(s)&&Number.isFinite(s))return n;const p=typeof s=="number"?Number.isNaN(s)?"NaN":Number.isFinite(s)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:s,inst:e,...p?{received:p}:{}}),n}}),k6=ue("$ZodNumberFormat",(e,t)=>{LD.init(e,t),VE.init(e,t)}),w6=ue("$ZodBoolean",(e,t)=>{_t.init(e,t),e._zod.pattern=OD,e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=!!n.value}catch{}const s=n.value;return typeof s=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:s,inst:e}),n}}),M6=ue("$ZodNull",(e,t)=>{_t.init(e,t),e._zod.pattern=jD,e._zod.values=new Set([null]),e._zod.parse=(n,a)=>{const s=n.value;return s===null||n.issues.push({expected:"null",code:"invalid_type",input:s,inst:e}),n}}),C6=ue("$ZodAny",(e,t)=>{_t.init(e,t),e._zod.parse=n=>n}),A6=ue("$ZodUnknown",(e,t)=>{_t.init(e,t),e._zod.parse=n=>n}),E6=ue("$ZodNever",(e,t)=>{_t.init(e,t),e._zod.parse=(n,a)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)}),R6=ue("$ZodVoid",(e,t)=>{_t.init(e,t),e._zod.parse=(n,a)=>{const s=n.value;return typeof s>"u"||n.issues.push({expected:"void",code:"invalid_type",input:s,inst:e}),n}}),I6=ue("$ZodDate",(e,t)=>{_t.init(e,t),e._zod.parse=(n,a)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}const s=n.value,p=s instanceof Date;return p&&!Number.isNaN(s.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:s,...p?{received:"Invalid Date"}:{},inst:e}),n}});function Yk(e,t,n){e.issues.length&&t.issues.push(...Dr(n,e.issues)),t.value[n]=e.value}const T6=ue("$ZodArray",(e,t)=>{_t.init(e,t),e._zod.parse=(n,a)=>{const s=n.value;if(!Array.isArray(s))return n.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),n;n.value=Array(s.length);const p=[];for(let f=0;f<s.length;f++){const m=s[f],h=t.element._zod.run({value:m,issues:[]},a);h instanceof Promise?p.push(h.then(c=>Yk(c,n,f))):Yk(h,n,f)}return p.length?Promise.all(p).then(()=>n):n}});function Vp(e,t,n,a,s,p){const f=n in a;if(e.issues.length){if(s&&p&&!f)return;t.issues.push(...Dr(n,e.issues))}if(!f&&!s){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}e.value===void 0?f&&(t.value[n]=void 0):t.value[n]=e.value}function GE(e){const t=Object.keys(e.shape);for(const a of t)if(!e.shape?.[a]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${a}": expected a Zod schema`);const n=U3(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function ZE(e,t,n,a,s,p){const f=[],m=s.keySet,h=s.catchall._zod,c=h.def.type,x=h.optin==="optional",M=h.optout==="optional";for(const C in t){if(C==="__proto__"||m.has(C))continue;if(c==="never"){f.push(C);continue}const E=h.run({value:t[C],issues:[]},a);E instanceof Promise?e.push(E.then(R=>Vp(R,n,C,t,x,M))):Vp(E,n,C,t,x,M)}return f.length&&n.issues.push({code:"unrecognized_keys",keys:f,input:t,inst:p}),e.length?Promise.all(e).then(()=>n):n}const _6=ue("$ZodObject",(e,t)=>{if(_t.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const m=t.shape;Object.defineProperty(t,"shape",{get:()=>{const h={...m};return Object.defineProperty(t,"shape",{value:h}),h}})}const a=Mm(()=>GE(t));Mt(e._zod,"propValues",()=>{const m=t.shape,h={};for(const c in m){const x=m[c]._zod;if(x.values){h[c]??(h[c]=new Set);for(const M of x.values)h[c].add(M)}}return h});const s=Vc,p=t.catchall;let f;e._zod.parse=(m,h)=>{f??(f=a.value);const c=m.value;if(!s(c))return m.issues.push({expected:"object",code:"invalid_type",input:c,inst:e}),m;m.value={};const x=[],M=f.shape;for(const C of f.keys){const E=M[C],R=E._zod.optin==="optional",_=E._zod.optout==="optional",j=E._zod.run({value:c[C],issues:[]},h);j instanceof Promise?x.push(j.then(D=>Vp(D,m,C,c,R,_))):Vp(j,m,C,c,R,_)}return p?ZE(x,c,m,h,a.value,e):x.length?Promise.all(x).then(()=>m):m}}),N6=ue("$ZodObjectJIT",(e,t)=>{_6.init(e,t);const n=e._zod.parse,a=Mm(()=>GE(t)),s=C=>{const E=new KD(["shape","payload","ctx"]),R=a.value,_=B=>{const L=Kk(B);return`shape[${L}]._zod.run({ value: input[${L}], issues: [] }, ctx)`};E.write("const input = payload.value;");const j=Object.create(null);let D=0;for(const B of R.keys)j[B]=`key_${D++}`;E.write("const newResult = {};");for(const B of R.keys){const L=j[B],G=Kk(B),ae=C[B],V=ae?._zod?.optin==="optional",F=ae?._zod?.optout==="optional";E.write(`const ${L} = ${_(B)};`),V&&F?E.write(`
13
- if (${L}.issues.length) {
14
- if (${G} in input) {
15
- payload.issues = payload.issues.concat(${L}.issues.map(iss => ({
16
- ...iss,
17
- path: iss.path ? [${G}, ...iss.path] : [${G}]
18
- })));
19
- }
20
- }
21
-
22
- if (${L}.value === undefined) {
23
- if (${G} in input) {
24
- newResult[${G}] = undefined;
25
- }
26
- } else {
27
- newResult[${G}] = ${L}.value;
28
- }
29
-
30
- `):V?E.write(`
31
- if (${L}.issues.length) {
32
- payload.issues = payload.issues.concat(${L}.issues.map(iss => ({
33
- ...iss,
34
- path: iss.path ? [${G}, ...iss.path] : [${G}]
35
- })));
36
- }
37
-
38
- if (${L}.value === undefined) {
39
- if (${G} in input) {
40
- newResult[${G}] = undefined;
41
- }
42
- } else {
43
- newResult[${G}] = ${L}.value;
44
- }
45
-
46
- `):E.write(`
47
- const ${L}_present = ${G} in input;
48
- if (${L}.issues.length) {
49
- payload.issues = payload.issues.concat(${L}.issues.map(iss => ({
50
- ...iss,
51
- path: iss.path ? [${G}, ...iss.path] : [${G}]
52
- })));
53
- }
54
- if (!${L}_present && !${L}.issues.length) {
55
- payload.issues.push({
56
- code: "invalid_type",
57
- expected: "nonoptional",
58
- input: undefined,
59
- path: [${G}]
60
- });
61
- }
62
-
63
- if (${L}_present) {
64
- if (${L}.value === undefined) {
65
- newResult[${G}] = undefined;
66
- } else {
67
- newResult[${G}] = ${L}.value;
68
- }
69
- }
70
-
71
- `)}E.write("payload.value = newResult;"),E.write("return payload;");const z=E.compile();return(B,L)=>z(C,B,L)};let p;const f=Vc,m=!Sb.jitless,c=m&&B3.value,x=t.catchall;let M;e._zod.parse=(C,E)=>{M??(M=a.value);const R=C.value;return f(R)?m&&c&&E?.async===!1&&E.jitless!==!0?(p||(p=s(t.shape)),C=p(C,E),x?ZE([],R,C,E,M,e):C):n(C,E):(C.issues.push({expected:"object",code:"invalid_type",input:R,inst:e}),C)}});function Xk(e,t,n,a){for(const p of e)if(p.issues.length===0)return t.value=p.value,t;const s=e.filter(p=>!Qs(p));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(p=>p.issues.map(f=>ar(f,a,nr())))}),t)}const KE=ue("$ZodUnion",(e,t)=>{_t.init(e,t),Mt(e._zod,"optin",()=>t.options.some(a=>a._zod.optin==="optional")?"optional":void 0),Mt(e._zod,"optout",()=>t.options.some(a=>a._zod.optout==="optional")?"optional":void 0),Mt(e._zod,"values",()=>{if(t.options.every(a=>a._zod.values))return new Set(t.options.flatMap(a=>Array.from(a._zod.values)))}),Mt(e._zod,"pattern",()=>{if(t.options.every(a=>a._zod.pattern)){const a=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${a.map(s=>kb(s.source)).join("|")})$`)}});const n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(a,s)=>{if(n)return n(a,s);let p=!1;const f=[];for(const m of t.options){const h=m._zod.run({value:a.value,issues:[]},s);if(h instanceof Promise)f.push(h),p=!0;else{if(h.issues.length===0)return h;f.push(h)}}return p?Promise.all(f).then(m=>Xk(m,a,e,s)):Xk(f,a,e,s)}}),O6=ue("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,KE.init(e,t);const n=e._zod.parse;Mt(e._zod,"propValues",()=>{const s={};for(const p of t.options){const f=p._zod.propValues;if(!f||Object.keys(f).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(p)}"`);for(const[m,h]of Object.entries(f)){s[m]||(s[m]=new Set);for(const c of h)s[m].add(c)}}return s});const a=Mm(()=>{const s=t.options,p=new Map;for(const f of s){const m=f._zod.propValues?.[t.discriminator];if(!m||m.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(f)}"`);for(const h of m){if(p.has(h))throw new Error(`Duplicate discriminator value "${String(h)}"`);p.set(h,f)}}return p});e._zod.parse=(s,p)=>{const f=s.value;if(!Vc(f))return s.issues.push({code:"invalid_type",expected:"object",input:f,inst:e}),s;const m=a.value.get(f?.[t.discriminator]);return m?m._zod.run(s,p):t.unionFallback||p.direction==="backward"?n(s,p):(s.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(a.value.keys()),input:f,path:[t.discriminator],inst:e}),s)}}),j6=ue("$ZodIntersection",(e,t)=>{_t.init(e,t),e._zod.parse=(n,a)=>{const s=n.value,p=t.left._zod.run({value:s,issues:[]},a),f=t.right._zod.run({value:s,issues:[]},a);return p instanceof Promise||f instanceof Promise?Promise.all([p,f]).then(([h,c])=>Jk(n,h,c)):Jk(n,p,f)}});function Lv(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(rl(e)&&rl(t)){const n=Object.keys(t),a=Object.keys(e).filter(p=>n.indexOf(p)!==-1),s={...e,...t};for(const p of a){const f=Lv(e[p],t[p]);if(!f.valid)return{valid:!1,mergeErrorPath:[p,...f.mergeErrorPath]};s[p]=f.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let a=0;a<e.length;a++){const s=e[a],p=t[a],f=Lv(s,p);if(!f.valid)return{valid:!1,mergeErrorPath:[a,...f.mergeErrorPath]};n.push(f.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Jk(e,t,n){const a=new Map;let s;for(const m of t.issues)if(m.code==="unrecognized_keys"){s??(s=m);for(const h of m.keys)a.has(h)||a.set(h,{}),a.get(h).l=!0}else e.issues.push(m);for(const m of n.issues)if(m.code==="unrecognized_keys")for(const h of m.keys)a.has(h)||a.set(h,{}),a.get(h).r=!0;else e.issues.push(m);const p=[...a].filter(([,m])=>m.l&&m.r).map(([m])=>m);if(p.length&&s&&e.issues.push({...s,keys:p}),Qs(e))return e;const f=Lv(t.value,n.value);if(!f.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(f.mergeErrorPath)}`);return e.value=f.data,e}const P6=ue("$ZodTuple",(e,t)=>{_t.init(e,t);const n=t.items;e._zod.parse=(a,s)=>{const p=a.value;if(!Array.isArray(p))return a.issues.push({input:p,inst:e,expected:"tuple",code:"invalid_type"}),a;a.value=[];const f=[],m=ew(n,"optin"),h=ew(n,"optout");if(!t.rest){if(p.length<m)return a.issues.push({code:"too_small",minimum:m,inclusive:!0,input:p,inst:e,origin:"array"}),a;p.length>n.length&&a.issues.push({code:"too_big",maximum:n.length,inclusive:!0,input:p,inst:e,origin:"array"})}const c=new Array(n.length);for(let x=0;x<n.length;x++){const M=n[x]._zod.run({value:p[x],issues:[]},s);M instanceof Promise?f.push(M.then(C=>{c[x]=C})):c[x]=M}if(t.rest){let x=n.length-1;const M=p.slice(n.length);for(const C of M){x++;const E=t.rest._zod.run({value:C,issues:[]},s);E instanceof Promise?f.push(E.then(R=>tw(R,a,x))):tw(E,a,x)}}return f.length?Promise.all(f).then(()=>nw(c,a,n,p,h)):nw(c,a,n,p,h)}});function ew(e,t){for(let n=e.length-1;n>=0;n--)if(e[n]._zod[t]!=="optional")return n+1;return 0}function tw(e,t,n){e.issues.length&&t.issues.push(...Dr(n,e.issues)),t.value[n]=e.value}function nw(e,t,n,a,s){for(let p=0;p<n.length;p++){const f=e[p],m=p<a.length;if(f.issues.length){if(!m&&p>=s){t.value.length=p;break}t.issues.push(...Dr(p,f.issues))}t.value[p]=f.value}for(let p=t.value.length-1;p>=a.length&&(n[p]._zod.optout==="optional"&&t.value[p]===void 0);p--)t.value.length=p;return t}const D6=ue("$ZodRecord",(e,t)=>{_t.init(e,t),e._zod.parse=(n,a)=>{const s=n.value;if(!rl(s))return n.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),n;const p=[],f=t.keyType._zod.values;if(f){n.value={};const m=new Set;for(const c of f)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){m.add(typeof c=="number"?c.toString():c);const x=t.keyType._zod.run({value:c,issues:[]},a);if(x instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(x.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:x.issues.map(E=>ar(E,a,nr())),input:c,path:[c],inst:e});continue}const M=x.value,C=t.valueType._zod.run({value:s[c],issues:[]},a);C instanceof Promise?p.push(C.then(E=>{E.issues.length&&n.issues.push(...Dr(c,E.issues)),n.value[M]=E.value})):(C.issues.length&&n.issues.push(...Dr(c,C.issues)),n.value[M]=C.value)}let h;for(const c in s)m.has(c)||(h=h??[],h.push(c));h&&h.length>0&&n.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:h})}else{n.value={};for(const m of Reflect.ownKeys(s)){if(m==="__proto__"||!Object.prototype.propertyIsEnumerable.call(s,m))continue;let h=t.keyType._zod.run({value:m,issues:[]},a);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof m=="string"&&FE.test(m)&&h.issues.length){const M=t.keyType._zod.run({value:Number(m),issues:[]},a);if(M instanceof Promise)throw new Error("Async schemas not supported in object keys currently");M.issues.length===0&&(h=M)}if(h.issues.length){t.mode==="loose"?n.value[m]=s[m]:n.issues.push({code:"invalid_key",origin:"record",issues:h.issues.map(M=>ar(M,a,nr())),input:m,path:[m],inst:e});continue}const x=t.valueType._zod.run({value:s[m],issues:[]},a);x instanceof Promise?p.push(x.then(M=>{M.issues.length&&n.issues.push(...Dr(m,M.issues)),n.value[h.value]=M.value})):(x.issues.length&&n.issues.push(...Dr(m,x.issues)),n.value[h.value]=x.value)}}return p.length?Promise.all(p).then(()=>n):n}}),z6=ue("$ZodEnum",(e,t)=>{_t.init(e,t);const n=NE(t.entries),a=new Set(n);e._zod.values=a,e._zod.pattern=new RegExp(`^(${n.filter(s=>F3.has(typeof s)).map(s=>typeof s=="string"?ol(s):s.toString()).join("|")})$`),e._zod.parse=(s,p)=>{const f=s.value;return a.has(f)||s.issues.push({code:"invalid_value",values:n,input:f,inst:e}),s}}),L6=ue("$ZodLiteral",(e,t)=>{if(_t.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(a=>typeof a=="string"?ol(a):a?ol(a.toString()):String(a)).join("|")})$`),e._zod.parse=(a,s)=>{const p=a.value;return n.has(p)||a.issues.push({code:"invalid_value",values:t.values,input:p,inst:e}),a}}),q6=ue("$ZodTransform",(e,t)=>{_t.init(e,t),e._zod.optin="optional",e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new _E(e.constructor.name);const s=t.transform(n.value,n);if(a.async)return(s instanceof Promise?s:Promise.resolve(s)).then(f=>(n.value=f,n.fallback=!0,n));if(s instanceof Promise)throw new el;return n.value=s,n.fallback=!0,n}});function aw(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const WE=ue("$ZodOptional",(e,t)=>{_t.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Mt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Mt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${kb(n.source)})?$`):void 0}),e._zod.parse=(n,a)=>{if(t.innerType._zod.optin==="optional"){const s=n.value,p=t.innerType._zod.run(n,a);return p instanceof Promise?p.then(f=>aw(f,s)):aw(p,s)}return n.value===void 0?n:t.innerType._zod.run(n,a)}}),B6=ue("$ZodExactOptional",(e,t)=>{WE.init(e,t),Mt(e._zod,"values",()=>t.innerType._zod.values),Mt(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,a)=>t.innerType._zod.run(n,a)}),F6=ue("$ZodNullable",(e,t)=>{_t.init(e,t),Mt(e._zod,"optin",()=>t.innerType._zod.optin),Mt(e._zod,"optout",()=>t.innerType._zod.optout),Mt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${kb(n.source)}|null)$`):void 0}),Mt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,a)=>n.value===null?n:t.innerType._zod.run(n,a)}),U6=ue("$ZodDefault",(e,t)=>{_t.init(e,t),e._zod.optin="optional",Mt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);if(n.value===void 0)return n.value=t.defaultValue,n;const s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(p=>iw(p,t)):iw(s,t)}});function iw(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const H6=ue("$ZodPrefault",(e,t)=>{_t.init(e,t),e._zod.optin="optional",Mt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>(a.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,a))}),$6=ue("$ZodNonOptional",(e,t)=>{_t.init(e,t),Mt(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(a=>a!==void 0)):void 0}),e._zod.parse=(n,a)=>{const s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(p=>rw(p,e)):rw(s,e)}});function rw(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Q6=ue("$ZodCatch",(e,t)=>{_t.init(e,t),e._zod.optin="optional",Mt(e._zod,"optout",()=>t.innerType._zod.optout),Mt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);const s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(p=>(n.value=p.value,p.issues.length&&(n.value=t.catchValue({...n,error:{issues:p.issues.map(f=>ar(f,a,nr()))},input:n.value}),n.issues=[],n.fallback=!0),n)):(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(p=>ar(p,a,nr()))},input:n.value}),n.issues=[],n.fallback=!0),n)}}),YE=ue("$ZodPipe",(e,t)=>{_t.init(e,t),Mt(e._zod,"values",()=>t.in._zod.values),Mt(e._zod,"optin",()=>t.in._zod.optin),Mt(e._zod,"optout",()=>t.out._zod.optout),Mt(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,a)=>{if(a.direction==="backward"){const p=t.out._zod.run(n,a);return p instanceof Promise?p.then(f=>Hd(f,t.in,a)):Hd(p,t.in,a)}const s=t.in._zod.run(n,a);return s instanceof Promise?s.then(p=>Hd(p,t.out,a)):Hd(s,t.out,a)}});function Hd(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}const V6=ue("$ZodPreprocess",(e,t)=>{YE.init(e,t)}),G6=ue("$ZodReadonly",(e,t)=>{_t.init(e,t),Mt(e._zod,"propValues",()=>t.innerType._zod.propValues),Mt(e._zod,"values",()=>t.innerType._zod.values),Mt(e._zod,"optin",()=>t.innerType?._zod?.optin),Mt(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,a)=>{if(a.direction==="backward")return t.innerType._zod.run(n,a);const s=t.innerType._zod.run(n,a);return s instanceof Promise?s.then(ow):ow(s)}});function ow(e){return e.value=Object.freeze(e.value),e}const Z6=ue("$ZodLazy",(e,t)=>{_t.init(e,t),Mt(e._zod,"innerType",()=>{const n=t;return n._cachedInner||(n._cachedInner=t.getter()),n._cachedInner}),Mt(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),Mt(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),Mt(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),Mt(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(n,a)=>e._zod.innerType._zod.run(n,a)}),K6=ue("$ZodCustom",(e,t)=>{ba.init(e,t),_t.init(e,t),e._zod.parse=(n,a)=>n,e._zod.check=n=>{const a=n.value,s=t.fn(a);if(s instanceof Promise)return s.then(p=>sw(p,n,a,e));sw(s,n,a,e)}});function sw(e,t,n,a){if(!e){const s={code:"custom",input:n,inst:a,path:[...a._zod.def.path??[]],continue:!a._zod.def.abort};a._zod.def.params&&(s.params=a._zod.def.params),t.issues.push(Gc(s))}}var lw;class W6{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const a=n[0];return this._map.set(t,a),a&&typeof a=="object"&&"id"in a&&this._idmap.set(a.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const a={...this.get(n)??{}};delete a.id;const s={...a,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function Y6(){return new W6}(lw=globalThis).__zod_globalRegistry??(lw.__zod_globalRegistry=Y6());const Nc=globalThis.__zod_globalRegistry;function X6(e,t){return new e({type:"string",...qe(t)})}function XE(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...qe(t)})}function cw(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...qe(t)})}function J6(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...qe(t)})}function ez(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...qe(t)})}function tz(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...qe(t)})}function nz(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...qe(t)})}function JE(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...qe(t)})}function az(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...qe(t)})}function iz(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...qe(t)})}function rz(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...qe(t)})}function oz(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...qe(t)})}function sz(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...qe(t)})}function lz(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...qe(t)})}function cz(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...qe(t)})}function uz(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...qe(t)})}function dz(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...qe(t)})}function pz(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...qe(t)})}function mz(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...qe(t)})}function fz(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...qe(t)})}function hz(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...qe(t)})}function gz(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...qe(t)})}function vz(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...qe(t)})}function yz(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...qe(t)})}function bz(e,t){return new e({type:"string",format:"date",check:"string_format",...qe(t)})}function Sz(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...qe(t)})}function xz(e,t){return new e({type:"string",format:"duration",check:"string_format",...qe(t)})}function kz(e,t){return new e({type:"number",checks:[],...qe(t)})}function wz(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...qe(t)})}function Mz(e,t){return new e({type:"boolean",...qe(t)})}function Cz(e,t){return new e({type:"null",...qe(t)})}function Az(e){return new e({type:"any"})}function Ez(e){return new e({type:"unknown"})}function Rz(e,t){return new e({type:"never",...qe(t)})}function Iz(e,t){return new e({type:"void",...qe(t)})}function Tz(e,t){return new e({type:"date",...qe(t)})}function uw(e,t){return new HE({check:"less_than",...qe(t),value:e,inclusive:!1})}function fp(e,t){return new HE({check:"less_than",...qe(t),value:e,inclusive:!0})}function dw(e,t){return new $E({check:"greater_than",...qe(t),value:e,inclusive:!1})}function hp(e,t){return new $E({check:"greater_than",...qe(t),value:e,inclusive:!0})}function pw(e,t){return new zD({check:"multiple_of",...qe(t),value:e})}function eR(e,t){return new qD({check:"max_length",...qe(t),maximum:e})}function Gp(e,t){return new BD({check:"min_length",...qe(t),minimum:e})}function tR(e,t){return new FD({check:"length_equals",...qe(t),length:e})}function _z(e,t){return new UD({check:"string_format",format:"regex",...qe(t),pattern:e})}function Nz(e){return new HD({check:"string_format",format:"lowercase",...qe(e)})}function Oz(e){return new $D({check:"string_format",format:"uppercase",...qe(e)})}function jz(e,t){return new QD({check:"string_format",format:"includes",...qe(t),includes:e})}function Pz(e,t){return new VD({check:"string_format",format:"starts_with",...qe(t),prefix:e})}function Dz(e,t){return new GD({check:"string_format",format:"ends_with",...qe(t),suffix:e})}function vl(e){return new ZD({check:"overwrite",tx:e})}function zz(e){return vl(t=>t.normalize(e))}function Lz(){return vl(e=>e.trim())}function qz(){return vl(e=>e.toLowerCase())}function Bz(){return vl(e=>e.toUpperCase())}function Fz(){return vl(e=>q3(e))}function Uz(e,t,n){return new e({type:"array",element:t,...qe(n)})}function Hz(e,t,n){const a=qe(n);return a.abort??(a.abort=!0),new e({type:"custom",check:"custom",fn:t,...a})}function $z(e,t,n){return new e({type:"custom",check:"custom",fn:t,...qe(n)})}function Qz(e,t){const n=Vz(a=>(a.addIssue=s=>{if(typeof s=="string")a.issues.push(Gc(s,a.value,n._zod.def));else{const p=s;p.fatal&&(p.continue=!1),p.code??(p.code="custom"),p.input??(p.input=a.value),p.inst??(p.inst=n),p.continue??(p.continue=!n._zod.def.abort),a.issues.push(Gc(p))}},e(a.value,a)),t);return n}function Vz(e,t){const n=new ba({check:"custom",...qe(t)});return n._zod.check=e,n}function nR(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??Nc,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 nn(e,t,n={path:[],schemaPath:[]}){var a;const s=e._zod.def,p=t.seen.get(e);if(p)return p.count++,n.schemaPath.includes(e)&&(p.cycle=n.path),p.schema;const f={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,f);const m=e._zod.toJSONSchema?.();if(m)f.schema=m;else{const x={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,f.schema,x);else{const C=f.schema,E=t.processors[s.type];if(!E)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);E(e,t,C,x)}const M=e._zod.parent;M&&(f.ref||(f.ref=M),nn(M,t,x),t.seen.get(M).isParent=!0)}const h=t.metadataRegistry.get(e);return h&&Object.assign(f.schema,h),t.io==="input"&&Jn(e)&&(delete f.schema.examples,delete f.schema.default),t.io==="input"&&"_prefault"in f.schema&&((a=f.schema).default??(a.default=f.schema._prefault)),delete f.schema._prefault,t.seen.get(e).schema}function aR(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=new Map;for(const f of e.seen.entries()){const m=e.metadataRegistry.get(f[0])?.id;if(m){const h=a.get(m);if(h&&h!==f[0])throw new Error(`Duplicate schema id "${m}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);a.set(m,f[0])}}const s=f=>{const m=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const M=e.external.registry.get(f[0])?.id,C=e.external.uri??(R=>R);if(M)return{ref:C(M)};const E=f[1].defId??f[1].schema.id??`schema${e.counter++}`;return f[1].defId=E,{defId:E,ref:`${C("__shared")}#/${m}/${E}`}}if(f[1]===n)return{ref:"#"};const c=`#/${m}/`,x=f[1].schema.id??`__schema${e.counter++}`;return{defId:x,ref:c+x}},p=f=>{if(f[1].schema.$ref)return;const m=f[1],{ref:h,defId:c}=s(f);m.def={...m.schema},c&&(m.defId=c);const x=m.schema;for(const M in x)delete x[M];x.$ref=h};if(e.cycles==="throw")for(const f of e.seen.entries()){const m=f[1];if(m.cycle)throw new Error(`Cycle detected: #/${m.cycle?.join("/")}/<root>
72
-
73
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const f of e.seen.entries()){const m=f[1];if(t===f[0]){p(f);continue}if(e.external){const c=e.external.registry.get(f[0])?.id;if(t!==f[0]&&c){p(f);continue}}if(e.metadataRegistry.get(f[0])?.id){p(f);continue}if(m.cycle){p(f);continue}if(m.count>1&&e.reused==="ref"){p(f);continue}}}function iR(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const a=m=>{const h=e.seen.get(m);if(h.ref===null)return;const c=h.def??h.schema,x={...c},M=h.ref;if(h.ref=null,M){a(M);const E=e.seen.get(M),R=E.schema;if(R.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(R)):Object.assign(c,R),Object.assign(c,x),m._zod.parent===M)for(const j in c)j==="$ref"||j==="allOf"||j in x||delete c[j];if(R.$ref&&E.def)for(const j in c)j==="$ref"||j==="allOf"||j in E.def&&JSON.stringify(c[j])===JSON.stringify(E.def[j])&&delete c[j]}const C=m._zod.parent;if(C&&C!==M){a(C);const E=e.seen.get(C);if(E?.schema.$ref&&(c.$ref=E.schema.$ref,E.def))for(const R in c)R==="$ref"||R==="allOf"||R in E.def&&JSON.stringify(c[R])===JSON.stringify(E.def[R])&&delete c[R]}e.override({zodSchema:m,jsonSchema:c,path:h.path??[]})};for(const m of[...e.seen.entries()].reverse())a(m[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const m=e.external.registry.get(t)?.id;if(!m)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(m)}Object.assign(s,n.def??n.schema);const p=e.metadataRegistry.get(t)?.id;p!==void 0&&s.id===p&&delete s.id;const f=e.external?.defs??{};for(const m of e.seen.entries()){const h=m[1];h.def&&h.defId&&(h.def.id===h.defId&&delete h.def.id,f[h.defId]=h.def)}e.external||Object.keys(f).length>0&&(e.target==="draft-2020-12"?s.$defs=f:s.definitions=f);try{const m=JSON.parse(JSON.stringify(s));return Object.defineProperty(m,"~standard",{value:{...t["~standard"],jsonSchema:{input:Zp(t,"input",e.processors),output:Zp(t,"output",e.processors)}},enumerable:!1,writable:!1}),m}catch{throw new Error("Error converting schema to JSON.")}}function Jn(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const a=e._zod.def;if(a.type==="transform")return!0;if(a.type==="array")return Jn(a.element,n);if(a.type==="set")return Jn(a.valueType,n);if(a.type==="lazy")return Jn(a.getter(),n);if(a.type==="promise"||a.type==="optional"||a.type==="nonoptional"||a.type==="nullable"||a.type==="readonly"||a.type==="default"||a.type==="prefault")return Jn(a.innerType,n);if(a.type==="intersection")return Jn(a.left,n)||Jn(a.right,n);if(a.type==="record"||a.type==="map")return Jn(a.keyType,n)||Jn(a.valueType,n);if(a.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Jn(a.in,n)||Jn(a.out,n);if(a.type==="object"){for(const s in a.shape)if(Jn(a.shape[s],n))return!0;return!1}if(a.type==="union"){for(const s of a.options)if(Jn(s,n))return!0;return!1}if(a.type==="tuple"){for(const s of a.items)if(Jn(s,n))return!0;return!!(a.rest&&Jn(a.rest,n))}return!1}const Gz=(e,t={})=>n=>{const a=nR({...n,processors:t});return nn(e,a),aR(a,e),iR(a,e)},Zp=(e,t,n={})=>a=>{const{libraryOptions:s,target:p}=a??{},f=nR({...s??{},target:p,io:t,processors:n});return nn(e,f),aR(f,e),iR(f,e)},Zz={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Kz=(e,t,n,a)=>{const s=n;s.type="string";const{minimum:p,maximum:f,format:m,patterns:h,contentEncoding:c}=e._zod.bag;if(typeof p=="number"&&(s.minLength=p),typeof f=="number"&&(s.maxLength=f),m&&(s.format=Zz[m]??m,s.format===""&&delete s.format,m==="time"&&delete s.format),c&&(s.contentEncoding=c),h&&h.size>0){const x=[...h];x.length===1?s.pattern=x[0].source:x.length>1&&(s.allOf=[...x.map(M=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:M.source}))])}},Wz=(e,t,n,a)=>{const s=n,{minimum:p,maximum:f,format:m,multipleOf:h,exclusiveMaximum:c,exclusiveMinimum:x}=e._zod.bag;typeof m=="string"&&m.includes("int")?s.type="integer":s.type="number";const M=typeof x=="number"&&x>=(p??Number.NEGATIVE_INFINITY),C=typeof c=="number"&&c<=(f??Number.POSITIVE_INFINITY),E=t.target==="draft-04"||t.target==="openapi-3.0";M?E?(s.minimum=x,s.exclusiveMinimum=!0):s.exclusiveMinimum=x:typeof p=="number"&&(s.minimum=p),C?E?(s.maximum=c,s.exclusiveMaximum=!0):s.exclusiveMaximum=c:typeof f=="number"&&(s.maximum=f),typeof h=="number"&&(s.multipleOf=h)},Yz=(e,t,n,a)=>{n.type="boolean"},Xz=(e,t,n,a)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},Jz=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},eL=(e,t,n,a)=>{n.not={}},tL=(e,t,n,a)=>{},nL=(e,t,n,a)=>{},aL=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},iL=(e,t,n,a)=>{const s=e._zod.def,p=NE(s.entries);p.every(f=>typeof f=="number")&&(n.type="number"),p.every(f=>typeof f=="string")&&(n.type="string"),n.enum=p},rL=(e,t,n,a)=>{const s=e._zod.def,p=[];for(const f of s.values)if(f===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof f=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");p.push(Number(f))}else p.push(f);if(p.length!==0)if(p.length===1){const f=p[0];n.type=f===null?"null":typeof f,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[f]:n.const=f}else p.every(f=>typeof f=="number")&&(n.type="number"),p.every(f=>typeof f=="string")&&(n.type="string"),p.every(f=>typeof f=="boolean")&&(n.type="boolean"),p.every(f=>f===null)&&(n.type="null"),n.enum=p},oL=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},sL=(e,t,n,a)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},lL=(e,t,n,a)=>{const s=n,p=e._zod.def,{minimum:f,maximum:m}=e._zod.bag;typeof f=="number"&&(s.minItems=f),typeof m=="number"&&(s.maxItems=m),s.type="array",s.items=nn(p.element,t,{...a,path:[...a.path,"items"]})},cL=(e,t,n,a)=>{const s=n,p=e._zod.def;s.type="object",s.properties={};const f=p.shape;for(const c in f)s.properties[c]=nn(f[c],t,{...a,path:[...a.path,"properties",c]});const m=new Set(Object.keys(f)),h=new Set([...m].filter(c=>{const x=p.shape[c]._zod;return t.io==="input"?x.optin===void 0:x.optout===void 0}));h.size>0&&(s.required=Array.from(h)),p.catchall?._zod.def.type==="never"?s.additionalProperties=!1:p.catchall?p.catchall&&(s.additionalProperties=nn(p.catchall,t,{...a,path:[...a.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},uL=(e,t,n,a)=>{const s=e._zod.def,p=s.inclusive===!1,f=s.options.map((m,h)=>nn(m,t,{...a,path:[...a.path,p?"oneOf":"anyOf",h]}));p?n.oneOf=f:n.anyOf=f},dL=(e,t,n,a)=>{const s=e._zod.def,p=nn(s.left,t,{...a,path:[...a.path,"allOf",0]}),f=nn(s.right,t,{...a,path:[...a.path,"allOf",1]}),m=c=>"allOf"in c&&Object.keys(c).length===1,h=[...m(p)?p.allOf:[p],...m(f)?f.allOf:[f]];n.allOf=h},pL=(e,t,n,a)=>{const s=n,p=e._zod.def;s.type="array";const f=t.target==="draft-2020-12"?"prefixItems":"items",m=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",h=p.items.map((C,E)=>nn(C,t,{...a,path:[...a.path,f,E]})),c=p.rest?nn(p.rest,t,{...a,path:[...a.path,m,...t.target==="openapi-3.0"?[p.items.length]:[]]}):null;t.target==="draft-2020-12"?(s.prefixItems=h,c&&(s.items=c)):t.target==="openapi-3.0"?(s.items={anyOf:h},c&&s.items.anyOf.push(c),s.minItems=h.length,c||(s.maxItems=h.length)):(s.items=h,c&&(s.additionalItems=c));const{minimum:x,maximum:M}=e._zod.bag;typeof x=="number"&&(s.minItems=x),typeof M=="number"&&(s.maxItems=M)},mL=(e,t,n,a)=>{const s=n,p=e._zod.def;s.type="object";const f=p.keyType,h=f._zod.bag?.patterns;if(p.mode==="loose"&&h&&h.size>0){const x=nn(p.valueType,t,{...a,path:[...a.path,"patternProperties","*"]});s.patternProperties={};for(const M of h)s.patternProperties[M.source]=x}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(s.propertyNames=nn(p.keyType,t,{...a,path:[...a.path,"propertyNames"]})),s.additionalProperties=nn(p.valueType,t,{...a,path:[...a.path,"additionalProperties"]});const c=f._zod.values;if(c){const x=[...c].filter(M=>typeof M=="string"||typeof M=="number");x.length>0&&(s.required=x)}},fL=(e,t,n,a)=>{const s=e._zod.def,p=nn(s.innerType,t,a),f=t.seen.get(e);t.target==="openapi-3.0"?(f.ref=s.innerType,n.nullable=!0):n.anyOf=[p,{type:"null"}]},hL=(e,t,n,a)=>{const s=e._zod.def;nn(s.innerType,t,a);const p=t.seen.get(e);p.ref=s.innerType},gL=(e,t,n,a)=>{const s=e._zod.def;nn(s.innerType,t,a);const p=t.seen.get(e);p.ref=s.innerType,n.default=JSON.parse(JSON.stringify(s.defaultValue))},vL=(e,t,n,a)=>{const s=e._zod.def;nn(s.innerType,t,a);const p=t.seen.get(e);p.ref=s.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},yL=(e,t,n,a)=>{const s=e._zod.def;nn(s.innerType,t,a);const p=t.seen.get(e);p.ref=s.innerType;let f;try{f=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=f},bL=(e,t,n,a)=>{const s=e._zod.def,p=s.in._zod.traits.has("$ZodTransform"),f=t.io==="input"?p?s.out:s.in:s.out;nn(f,t,a);const m=t.seen.get(e);m.ref=f},SL=(e,t,n,a)=>{const s=e._zod.def;nn(s.innerType,t,a);const p=t.seen.get(e);p.ref=s.innerType,n.readOnly=!0},rR=(e,t,n,a)=>{const s=e._zod.def;nn(s.innerType,t,a);const p=t.seen.get(e);p.ref=s.innerType},xL=(e,t,n,a)=>{const s=e._zod.innerType;nn(s,t,a);const p=t.seen.get(e);p.ref=s},kL=ue("ZodISODateTime",(e,t)=>{l6.init(e,t),an.init(e,t)});function wL(e){return yz(kL,e)}const ML=ue("ZodISODate",(e,t)=>{c6.init(e,t),an.init(e,t)});function CL(e){return bz(ML,e)}const AL=ue("ZodISOTime",(e,t)=>{u6.init(e,t),an.init(e,t)});function EL(e){return Sz(AL,e)}const RL=ue("ZodISODuration",(e,t)=>{d6.init(e,t),an.init(e,t)});function IL(e){return xz(RL,e)}const TL=(e,t)=>{DE.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>J3(e,n)},flatten:{value:n=>X3(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,zv,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,zv,2)}},isEmpty:{get(){return e.issues.length===0}}})},Qa=ue("ZodError",TL,{Parent:Error}),_L=Mb(Qa),NL=Cb(Qa),OL=Cm(Qa),jL=Am(Qa),PL=nD(Qa),DL=aD(Qa),zL=iD(Qa),LL=rD(Qa),qL=oD(Qa),BL=sD(Qa),FL=lD(Qa),UL=cD(Qa),mw=new WeakMap;function du(e,t,n){const a=Object.getPrototypeOf(e);let s=mw.get(a);if(s||(s=new Set,mw.set(a,s)),!s.has(t)){s.add(t);for(const p in n){const f=n[p];Object.defineProperty(a,p,{configurable:!0,enumerable:!1,get(){const m=f.bind(this);return Object.defineProperty(this,p,{configurable:!0,writable:!0,enumerable:!0,value:m}),m},set(m){Object.defineProperty(this,p,{configurable:!0,writable:!0,enumerable:!0,value:m})}})}}}const Lt=ue("ZodType",(e,t)=>(_t.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Zp(e,"input"),output:Zp(e,"output")}}),e.toJSONSchema=Gz(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(n,a)=>_L(e,n,a,{callee:e.parse}),e.safeParse=(n,a)=>OL(e,n,a),e.parseAsync=async(n,a)=>NL(e,n,a,{callee:e.parseAsync}),e.safeParseAsync=async(n,a)=>jL(e,n,a),e.spa=e.safeParseAsync,e.encode=(n,a)=>PL(e,n,a),e.decode=(n,a)=>DL(e,n,a),e.encodeAsync=async(n,a)=>zL(e,n,a),e.decodeAsync=async(n,a)=>LL(e,n,a),e.safeEncode=(n,a)=>qL(e,n,a),e.safeDecode=(n,a)=>BL(e,n,a),e.safeEncodeAsync=async(n,a)=>FL(e,n,a),e.safeDecodeAsync=async(n,a)=>UL(e,n,a),du(e,"ZodType",{check(...n){const a=this.def;return this.clone(Qr(a,{checks:[...a.checks??[],...n.map(s=>typeof s=="function"?{_zod:{check:s,def:{check:"custom"},onattach:[]}}:s)]}),{parent:!0})},with(...n){return this.check(...n)},clone(n,a){return ir(this,n,a)},brand(){return this},register(n,a){return n.add(this,a),this},refine(n,a){return this.check(L8(n,a))},superRefine(n,a){return this.check(q8(n,a))},overwrite(n){return this.check(vl(n))},optional(){return vw(this)},exactOptional(){return C8(this)},nullable(){return yw(this)},nullish(){return vw(yw(this))},nonoptional(n){return _8(this,n)},array(){return w(this)},or(n){return tt([this,n])},and(n){return b8(this,n)},transform(n){return bw(this,fR(n))},default(n){return R8(this,n)},prefault(n){return T8(this,n)},catch(n){return O8(this,n)},pipe(n){return bw(this,n)},readonly(){return D8(this)},describe(n){const a=this.clone();return Nc.add(a,{description:n}),a},meta(...n){if(n.length===0)return Nc.get(this);const a=this.clone();return Nc.add(a,n[0]),a},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(n){return n(this)}}),Object.defineProperty(e,"description",{get(){return Nc.get(e)?.description},configurable:!0}),e)),oR=ue("_ZodString",(e,t)=>{Ab.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(a,s,p)=>Kz(e,a,s);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,du(e,"_ZodString",{regex(...a){return this.check(_z(...a))},includes(...a){return this.check(jz(...a))},startsWith(...a){return this.check(Pz(...a))},endsWith(...a){return this.check(Dz(...a))},min(...a){return this.check(Gp(...a))},max(...a){return this.check(eR(...a))},length(...a){return this.check(tR(...a))},nonempty(...a){return this.check(Gp(1,...a))},lowercase(a){return this.check(Nz(a))},uppercase(a){return this.check(Oz(a))},trim(){return this.check(Lz())},normalize(...a){return this.check(zz(...a))},toLowerCase(){return this.check(qz())},toUpperCase(){return this.check(Bz())},slugify(){return this.check(Fz())}})}),HL=ue("ZodString",(e,t)=>{Ab.init(e,t),oR.init(e,t),e.email=n=>e.check(XE(sR,n)),e.url=n=>e.check(JE(lR,n)),e.jwt=n=>e.check(vz(o8,n)),e.emoji=n=>e.check(az(VL,n)),e.guid=n=>e.check(cw(fw,n)),e.uuid=n=>e.check(J6($d,n)),e.uuidv4=n=>e.check(ez($d,n)),e.uuidv6=n=>e.check(tz($d,n)),e.uuidv7=n=>e.check(nz($d,n)),e.nanoid=n=>e.check(iz(GL,n)),e.guid=n=>e.check(cw(fw,n)),e.cuid=n=>e.check(rz(ZL,n)),e.cuid2=n=>e.check(oz(KL,n)),e.ulid=n=>e.check(sz(WL,n)),e.base64=n=>e.check(fz(a8,n)),e.base64url=n=>e.check(hz(i8,n)),e.xid=n=>e.check(lz(YL,n)),e.ksuid=n=>e.check(cz(XL,n)),e.ipv4=n=>e.check(uz(JL,n)),e.ipv6=n=>e.check(dz(e8,n)),e.cidrv4=n=>e.check(pz(t8,n)),e.cidrv6=n=>e.check(mz(n8,n)),e.e164=n=>e.check(gz(r8,n)),e.datetime=n=>e.check(wL(n)),e.date=n=>e.check(CL(n)),e.time=n=>e.check(EL(n)),e.duration=n=>e.check(IL(n))});function o(e){return X6(HL,e)}const an=ue("ZodStringFormat",(e,t)=>{Jt.init(e,t),oR.init(e,t)}),sR=ue("ZodEmail",(e,t)=>{JD.init(e,t),an.init(e,t)});function $L(e){return XE(sR,e)}const fw=ue("ZodGUID",(e,t)=>{YD.init(e,t),an.init(e,t)}),$d=ue("ZodUUID",(e,t)=>{XD.init(e,t),an.init(e,t)}),lR=ue("ZodURL",(e,t)=>{e6.init(e,t),an.init(e,t)});function QL(e){return JE(lR,e)}const VL=ue("ZodEmoji",(e,t)=>{t6.init(e,t),an.init(e,t)}),GL=ue("ZodNanoID",(e,t)=>{n6.init(e,t),an.init(e,t)}),ZL=ue("ZodCUID",(e,t)=>{a6.init(e,t),an.init(e,t)}),KL=ue("ZodCUID2",(e,t)=>{i6.init(e,t),an.init(e,t)}),WL=ue("ZodULID",(e,t)=>{r6.init(e,t),an.init(e,t)}),YL=ue("ZodXID",(e,t)=>{o6.init(e,t),an.init(e,t)}),XL=ue("ZodKSUID",(e,t)=>{s6.init(e,t),an.init(e,t)}),JL=ue("ZodIPv4",(e,t)=>{p6.init(e,t),an.init(e,t)}),e8=ue("ZodIPv6",(e,t)=>{m6.init(e,t),an.init(e,t)}),t8=ue("ZodCIDRv4",(e,t)=>{f6.init(e,t),an.init(e,t)}),n8=ue("ZodCIDRv6",(e,t)=>{h6.init(e,t),an.init(e,t)}),a8=ue("ZodBase64",(e,t)=>{g6.init(e,t),an.init(e,t)}),i8=ue("ZodBase64URL",(e,t)=>{y6.init(e,t),an.init(e,t)}),r8=ue("ZodE164",(e,t)=>{b6.init(e,t),an.init(e,t)}),o8=ue("ZodJWT",(e,t)=>{x6.init(e,t),an.init(e,t)}),cR=ue("ZodNumber",(e,t)=>{VE.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(a,s,p)=>Wz(e,a,s),du(e,"ZodNumber",{gt(a,s){return this.check(dw(a,s))},gte(a,s){return this.check(hp(a,s))},min(a,s){return this.check(hp(a,s))},lt(a,s){return this.check(uw(a,s))},lte(a,s){return this.check(fp(a,s))},max(a,s){return this.check(fp(a,s))},int(a){return this.check(hw(a))},safe(a){return this.check(hw(a))},positive(a){return this.check(dw(0,a))},nonnegative(a){return this.check(hp(0,a))},negative(a){return this.check(uw(0,a))},nonpositive(a){return this.check(fp(0,a))},multipleOf(a,s){return this.check(pw(a,s))},step(a,s){return this.check(pw(a,s))},finite(){return this}});const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function l(e){return kz(cR,e)}const s8=ue("ZodNumberFormat",(e,t)=>{k6.init(e,t),cR.init(e,t)});function hw(e){return wz(s8,e)}const l8=ue("ZodBoolean",(e,t)=>{w6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>Yz(e,n,a)});function A(e){return Mz(l8,e)}const c8=ue("ZodNull",(e,t)=>{M6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>Xz(e,n,a)});function uR(e){return Cz(c8,e)}const u8=ue("ZodAny",(e,t)=>{C6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>tL()});function dR(){return Az(u8)}const d8=ue("ZodUnknown",(e,t)=>{A6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>nL()});function J(){return Ez(d8)}const p8=ue("ZodNever",(e,t)=>{E6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>eL(e,n,a)});function m8(e){return Rz(p8,e)}const f8=ue("ZodVoid",(e,t)=>{R6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>Jz(e,n)});function O(e){return Iz(f8,e)}const h8=ue("ZodDate",(e,t)=>{I6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(a,s,p)=>aL(e,a),e.min=(a,s)=>e.check(hp(a,s)),e.max=(a,s)=>e.check(fp(a,s));const n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function qv(e){return Tz(h8,e)}const g8=ue("ZodArray",(e,t)=>{T6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>lL(e,n,a,s),e.element=t.element,du(e,"ZodArray",{min(n,a){return this.check(Gp(n,a))},nonempty(n){return this.check(Gp(1,n))},max(n,a){return this.check(eR(n,a))},length(n,a){return this.check(tR(n,a))},unwrap(){return this.element}})});function w(e,t){return Uz(g8,e,t)}const pR=ue("ZodObject",(e,t)=>{N6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>cL(e,n,a,s),Mt(e,"shape",()=>t.shape),du(e,"ZodObject",{keyof(){return N(Object.keys(this._zod.def.shape))},catchall(n){return this.clone({...this._zod.def,catchall:n})},passthrough(){return this.clone({...this._zod.def,catchall:J()})},loose(){return this.clone({...this._zod.def,catchall:J()})},strict(){return this.clone({...this._zod.def,catchall:m8()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(n){return V3(this,n)},safeExtend(n){return G3(this,n)},merge(n){return Z3(this,n)},pick(n){return $3(this,n)},omit(n){return Q3(this,n)},partial(...n){return K3(hR,this,n[0])},required(...n){return W3(gR,this,n[0])}})});function d(e,t){const n={type:"object",shape:e??{},...qe(t)};return new pR(n)}function gw(e,t){return new pR({type:"object",shape:e,catchall:J(),...qe(t)})}const mR=ue("ZodUnion",(e,t)=>{KE.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>uL(e,n,a,s),e.options=t.options});function tt(e,t){return new mR({type:"union",options:e,...qe(t)})}const v8=ue("ZodDiscriminatedUnion",(e,t)=>{mR.init(e,t),O6.init(e,t)});function kt(e,t,n){return new v8({type:"union",options:t,discriminator:e,...qe(n)})}const y8=ue("ZodIntersection",(e,t)=>{j6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>dL(e,n,a,s)});function b8(e,t){return new y8({type:"intersection",left:e,right:t})}const S8=ue("ZodTuple",(e,t)=>{P6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>pL(e,n,a,s),e.rest=n=>e.clone({...e._zod.def,rest:n})});function pu(e,t,n){const a=t instanceof _t,s=a?n:t,p=a?t:null;return new S8({type:"tuple",items:e,rest:p,...qe(s)})}const Bv=ue("ZodRecord",(e,t)=>{D6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>mL(e,n,a,s),e.keyType=t.keyType,e.valueType=t.valueType});function X(e,t,n){return!t||!t._zod?new Bv({type:"record",keyType:o(),valueType:e,...qe(t)}):new Bv({type:"record",keyType:e,valueType:t,...qe(n)})}function x8(e,t,n){const a=ir(e);return a._zod.values=void 0,new Bv({type:"record",keyType:a,valueType:t,...qe(n)})}const Fv=ue("ZodEnum",(e,t)=>{z6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(a,s,p)=>iL(e,a,s),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(a,s)=>{const p={};for(const f of a)if(n.has(f))p[f]=t.entries[f];else throw new Error(`Key ${f} not found in enum`);return new Fv({...t,checks:[],...qe(s),entries:p})},e.exclude=(a,s)=>{const p={...t.entries};for(const f of a)if(n.has(f))delete p[f];else throw new Error(`Key ${f} not found in enum`);return new Fv({...t,checks:[],...qe(s),entries:p})}});function N(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(a=>[a,a])):e;return new Fv({type:"enum",entries:n,...qe(t)})}const k8=ue("ZodLiteral",(e,t)=>{L6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>rL(e,n,a),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function $(e,t){return new k8({type:"literal",values:Array.isArray(e)?e:[e],...qe(t)})}const w8=ue("ZodTransform",(e,t)=>{q6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>sL(e,n),e._zod.parse=(n,a)=>{if(a.direction==="backward")throw new _E(e.constructor.name);n.addIssue=p=>{if(typeof p=="string")n.issues.push(Gc(p,n.value,t));else{const f=p;f.fatal&&(f.continue=!1),f.code??(f.code="custom"),f.input??(f.input=n.value),f.inst??(f.inst=e),n.issues.push(Gc(f))}};const s=t.transform(n.value,n);return s instanceof Promise?s.then(p=>(n.value=p,n.fallback=!0,n)):(n.value=s,n.fallback=!0,n)}});function fR(e){return new w8({type:"transform",transform:e})}const hR=ue("ZodOptional",(e,t)=>{WE.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>rR(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function vw(e){return new hR({type:"optional",innerType:e})}const M8=ue("ZodExactOptional",(e,t)=>{B6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>rR(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function C8(e){return new M8({type:"optional",innerType:e})}const A8=ue("ZodNullable",(e,t)=>{F6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>fL(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function yw(e){return new A8({type:"nullable",innerType:e})}const E8=ue("ZodDefault",(e,t)=>{U6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>gL(e,n,a,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function R8(e,t){return new E8({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():jE(t)}})}const I8=ue("ZodPrefault",(e,t)=>{H6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>vL(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function T8(e,t){return new I8({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():jE(t)}})}const gR=ue("ZodNonOptional",(e,t)=>{$6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>hL(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function _8(e,t){return new gR({type:"nonoptional",innerType:e,...qe(t)})}const N8=ue("ZodCatch",(e,t)=>{Q6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>yL(e,n,a,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function O8(e,t){return new N8({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const vR=ue("ZodPipe",(e,t)=>{YE.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>bL(e,n,a,s),e.in=t.in,e.out=t.out});function bw(e,t){return new vR({type:"pipe",in:e,out:t})}const j8=ue("ZodPreprocess",(e,t)=>{vR.init(e,t),V6.init(e,t)}),P8=ue("ZodReadonly",(e,t)=>{G6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>SL(e,n,a,s),e.unwrap=()=>e._zod.def.innerType});function D8(e){return new P8({type:"readonly",innerType:e})}const z8=ue("ZodLazy",(e,t)=>{Z6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>xL(e,n,a,s),e.unwrap=()=>e._zod.def.getter()});function mu(e){return new z8({type:"lazy",getter:e})}const Eb=ue("ZodCustom",(e,t)=>{K6.init(e,t),Lt.init(e,t),e._zod.processJSONSchema=(n,a,s)=>oL(e,n)});function si(e,t){return Hz(Eb,(()=>!0),t)}function L8(e,t={}){return $z(Eb,e,t)}function q8(e,t){return Qz(e,t)}function Ht(e,t={}){const n=new Eb({type:"custom",check:"custom",fn:a=>a instanceof e,abort:!0,...qe(t)});return n._zod.bag.Class=e,n._zod.check=a=>{a.value instanceof e||a.issues.push({code:"invalid_type",expected:e.name,input:a.value,inst:n,path:[...n._zod.def.path??[]]})},n}function yR(e,t){return new j8({type:"pipe",in:fR(e),out:t})}const Rb={custom:"custom"};var B8=["f32le","pcmu","pcma"];function F8(){const e=new Float32Array(256);for(let t=0;t<256;t++){const n=~t&255,a=(n&128)!==0?-1:1,s=n>>4&7;e[t]=a*((8*(n&15)+132<<s)-132)/32768}return e}function U8(){const e=new Float32Array(256);for(let t=0;t<256;t++){const n=t^85,a=(n&128)!==0?1:-1,s=n>>4&7,p=n&15;e[t]=a*(s===0?16*p+8:16*p+264<<s-1)/32768}return e}F8();U8();var H8=[{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:"navigation",label:"Navigation",icon:"compass",order:41},{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}];Object.fromEntries(H8.map(e=>[e.id,e]));var Ut=N(["high","mid","low"]),$8=tt([Ut,$("auto")]),Ib=N(["pull-rtsp","pull-rtmp","pull-http","pull-flv","pull-rfc4571","push-annexb","derived"]),yl=d({width:l().int().positive(),height:l().int().positive()}),Uv=d({camStreamId:o().min(1),deviceId:l().int().nonnegative(),kind:Ib,url:o().optional(),codec:o().optional(),resolution:yl.optional(),fps:l().positive().optional(),label:o().optional(),deviceFeatures:w(o()).optional(),autoEligible:A().optional(),profileHint:Ut.optional(),metadata:X(o(),J()).optional()}),gp=N(["unassigned","idle","connecting","streaming","error"]),Hv=d({deviceId:l().int().nonnegative(),profile:Ut,brokerId:o(),sourceCamStreamId:o().nullable(),status:gp,resolution:yl.optional(),codec:o().optional(),preBufferSec:l().nonnegative().optional(),errorMessage:o().optional()}),Q8=d({id:o(),label:o(),protocol:N(["rtsp","rtmp","annexb","http-mjpeg","webrtc","custom"]),url:o().optional(),resolution:d({width:l(),height:l()}).readonly().optional(),fps:l().optional(),bitrate:l().optional(),codec:o().optional(),profileHint:Ut.optional()});d({type:o(),url:o(),videoCodec:o().optional(),audioCodec:o().optional(),metadata:X(o(),J()).readonly().optional()});var V8=d({type:N(["video","audio"]),data:Ht(Uint8Array),pts:l(),dts:l(),keyframe:A(),codec:o()}),Sw=d({data:Ht(Uint8Array),width:l(),height:l(),format:N(["jpeg","rgb","bgr","yuv420","gray"]),timestamp:l()}),Ji=d({shmId:o(),slot:l().int().nonnegative(),seq:l().int().nonnegative(),width:l().int().positive(),height:l().int().positive(),format:N(["jpeg","rgb","bgr","yuv420","gray"]),pts:l(),byteLength:l().int().nonnegative(),nodeId:o(),slotCount:l().int().positive()}),G8=N(["rgb","bgr","yuv420","gray"]),Z8=d({brokerId:o(),format:G8,maxFps:l().positive().optional(),tag:o().optional()}),K8=d({subscriptionId:o(),maxFps:l().nonnegative()}),bR=N(B8),W8=d({data:Ht(Uint8Array),sampleRate:l().int().positive(),channels:l().int().positive(),timestamp:l(),format:bR.optional()}),Y8=d({brokerId:o(),tag:o().optional(),accept:w(bR).readonly().optional()}),X8=d({subscriptionId:o()}),J8=N(["idle","connecting","streaming","error","stopped"]),eq=d({status:J8,inputFps:l(),decodeFps:l(),encodedSubscribers:l(),decodedSubscribers:l(),uptimeMs:l(),bitrateKbps:l(),idrIntervalMs:l(),codec:o().optional(),totalBytes:l(),packetCount:l(),rtspClients:l(),pipeClients:l(),preBufferSec:l(),preBufferMs:l(),preBufferPackets:l(),decoderNodeId:o().nullable(),audio:d({codec:o(),sampleRate:l(),channels:l(),supported:A()}).nullable().optional(),audioMuted:A().optional(),audioMutedDropped:l().optional()}),tq=d({profile:Ut,brokerId:o(),url:o(),mutedUrl:o(),enabled:A(),codec:o().optional(),resolution:yl.optional()}),nq=d({id:o(),title:o(),description:o().optional(),style:N(["card","accordion"]).optional(),defaultCollapsed:A().optional(),columns:tt([$(1),$(2),$(3),$(4)]).optional(),tab:o().optional(),location:N(["settings","top-tab"]).optional(),order:l().optional(),fields:w(dR())}),aq=d({id:o(),label:o(),icon:o(),order:l().optional()});d({tabs:w(aq).optional(),sections:w(nq)}).nullable();d({deviceId:l()}),d({deviceId:l()}),d({deviceId:l(),patch:X(o(),J())}),d({success:$(!0)});d({deviceId:l()}),J().nullable();function b(e,t,n){return{input:e,output:t,kind:n?.kind??"query",...n?.auth!==void 0?{auth:n.auth}:{},...n?.access!==void 0?{access:n.access}:{},...n?.caller!==void 0?{caller:n.caller}:{},timeoutMs:n?.timeoutMs}}function rg(e,t,n){return{...b(e,t,n),systemOnly:!0}}function To(e){return{data:e}}var iq=d({staticDir:o()}),rq=d({version:o()}),oq={name:"admin-ui",scope:"system",mode:"singleton",internal:!0,methods:{getStaticDir:b(O(),iq,{auth:"admin"}),getVersion:b(O(),rq,{auth:"admin"})}},U=(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.Climate="climate",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.PetFeeder="pet-feeder",e})({}),va=(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.ClimateSwingVertical="climate-swing-vertical",e.ClimateSwingHorizontal="climate-swing-horizontal",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.VacuumHasMap="vacuum-has-map",e.VacuumHasAi="vacuum-has-ai",e.MowerHasMap="mower-has-map",e.MowerHasTargetedMowing="mower-has-targeted-mowing",e})({}),He=(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.WindSensor="wind-sensor",e.RainSensor="rain-sensor",e.UvSensor="uv-sensor",e.SolarRadiationSensor="solar-radiation-sensor",e.SoilMoistureSensor="soil-moisture-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})({}),sq=d({staticDir:o()}),lq=d({version:o()}),cq={name:"viewer-ui",scope:"system",mode:"singleton",internal:!0,methods:{getStaticDir:b(O(),sq,{auth:"admin"}),getVersion:b(O(),lq,{auth:"admin"})}},uq=d({id:o(),label:o(),protocol:N(["rtsp","rtmp","annexb","http-mjpeg","webrtc","custom"]),url:o().optional(),resolution:d({width:l(),height:l()}).optional(),fps:l().optional(),bitrate:l().optional(),codec:o().optional(),profileHint:Ut.optional(),sdp:o().optional()}),dq=d({key:o(),value:J()}),pq=d({source:o(),data:X(o(),J())}),mq={name:"device-ops",scope:"device",deviceNative:!0,mode:"singleton",methods:{getStreamSources:b(d({deviceId:l()}),w(uq)),getConfigEntries:b(d({deviceId:l()}),w(dq)),setConfig:b(d({deviceId:l(),values:X(o(),J())}),O(),{kind:"mutation"}),runAction:b(d({deviceId:l(),action:o().min(1),input:J()}),J(),{kind:"mutation"}),removeDevice:b(d({deviceId:l()}),O(),{kind:"mutation"}),getSettingsSchema:b(d({deviceId:l()}),J().nullable()),getRawState:b(d({deviceId:l()}),pq.nullable(),{auth:"protected"})}},fq="device.state-changed";function SR(e){const t=new Map,n=new Map;let a=null;const s=(m,h)=>`${m}:${h}`,p=()=>{a||e.live?.onEvent&&(a=e.live.onEvent.subscribe({category:fq},{onData:m=>{const h=m.data;if(!h||typeof h.deviceId!="number"||typeof h.capName!="string")return;const c=s(h.deviceId,h.capName);t.set(c,h.slice);const x=n.get(c);if(x)for(const M of x)try{M(h.slice)}catch{}}}))},f=()=>{a&&(n.size>0||(a.unsubscribe(),a=null))};return{read(m,h){return t.get(s(m,h))},async refresh(m,h){const c=await e.deviceState.getCapSlice.query({deviceId:m,capName:h}),x=s(m,h);t.set(x,c??void 0);const M=n.get(x);if(M)for(const C of M)try{C(c??void 0)}catch{}},watch(m,h,c){const x=s(m,h);let M=n.get(x);return M||(M=new Set,n.set(x,M)),M.add(c),p(),()=>{M.delete(c),M.size===0&&n.delete(x),f()}},async write(m,h,c){await e.deviceState.setCapSlice.mutate({deviceId:m,capName:h,slice:c})}}}function hq(e,t,n){const a=(s,p)=>`${s}:${p}`;return{read(s,p){return e.get(s)?.get(p)},async refresh(){},watch(s,p,f){const m=a(s,p);let h=t.get(m);return h||(h=new Set,t.set(m,h)),h.add(f),()=>{h.delete(f),h.size===0&&t.delete(m)}},async write(s,p,f){if(!n)throw new Error("createMirrorSource: write requires an api reference — pass it as the third argument when constructing the source");await n.deviceState.setCapSlice.mutate({deviceId:s,capName:p,slice:f})}}}function je(e,t,n){const a=gq(e)?e:SR(e);return{get value(){return a.read(t,n)},refresh(){return a.refresh(t,n)},subscribe(s){const p=a.watch(t,n,f=>{try{s(f)}catch{}});try{s(a.read(t,n))}catch{}return a.read(t,n)===void 0&&a.refresh(t,n).catch(()=>{}),p},async set(s){await a.write(t,n,s)},async patch(s){const p={...a.read(t,n),...s};await a.write(t,n,p)}}}function gq(e){return typeof e.read=="function"&&typeof e.watch=="function"}function xR(e,t,n){const a=e,s=n?.stateSource??SR(e);function p(c,x){const M=typeof c=="object"&&c!==null?c:{};return x!==void 0?{...M,deviceId:t.deviceId,nodeId:x}:{...M,deviceId:t.deviceId}}function f(c,x,M,C,E){const R=a[c]?.[x];if(!R)throw new Error(`DeviceProxy: api has no '${c}.${x}'`);const _=R;return M==="mutation"?_.mutate(C):M==="subscription"?_.subscribe(C,E):_.query(C)}function m(c,x,M,C,E,R){return f(x,M,C,p(E,t.entries.find(_=>_.capName===c)?.providerNodeId),R)}function h(c,x,M,C,E){return f(c,x,M,p(C,void 0),E)}return{deviceId:t.deviceId,binding:t,state:{airQualitySensor:je(s,t.deviceId,"air-quality-sensor"),alarmPanel:je(s,t.deviceId,"alarm-panel"),ambientLightSensor:je(s,t.deviceId,"ambient-light-sensor"),audioMetrics:je(s,t.deviceId,"audio-metrics"),automationControl:je(s,t.deviceId,"automation-control"),battery:je(s,t.deviceId,"battery"),binary:je(s,t.deviceId,"binary"),brightness:je(s,t.deviceId,"brightness"),cameraStreams:je(s,t.deviceId,"camera-streams"),carbonMonoxide:je(s,t.deviceId,"carbon-monoxide"),climateControl:je(s,t.deviceId,"climate-control"),color:je(s,t.deviceId,"color"),connectivity:je(s,t.deviceId,"connectivity"),consumables:je(s,t.deviceId,"consumables"),contact:je(s,t.deviceId,"contact"),control:je(s,t.deviceId,"control"),cover:je(s,t.deviceId,"cover"),dayNight:je(s,t.deviceId,"day-night"),deviceDiscovery:je(s,t.deviceId,"device-discovery"),deviceStatus:je(s,t.deviceId,"device-status"),doorbell:je(s,t.deviceId,"doorbell"),enumSensor:je(s,t.deviceId,"enum-sensor"),eventEmitter:je(s,t.deviceId,"event-emitter"),fanControl:je(s,t.deviceId,"fan-control"),featureProbe:je(s,t.deviceId,"feature-probe"),flood:je(s,t.deviceId,"flood"),gas:je(s,t.deviceId,"gas"),humidifier:je(s,t.deviceId,"humidifier"),humiditySensor:je(s,t.deviceId,"humidity-sensor"),image:je(s,t.deviceId,"image"),imageSettings:je(s,t.deviceId,"image-settings"),intercom:je(s,t.deviceId,"intercom"),lawnMowerControl:je(s,t.deviceId,"lawn-mower-control"),lockControl:je(s,t.deviceId,"lock-control"),mediaPlayer:je(s,t.deviceId,"media-player"),motion:je(s,t.deviceId,"motion"),motionTrigger:je(s,t.deviceId,"motion-trigger"),motionZones:je(s,t.deviceId,"motion-zones"),nativeObjectDetection:je(s,t.deviceId,"native-object-detection"),navigation:je(s,t.deviceId,"navigation"),networkLink:je(s,t.deviceId,"network-link"),notifier:je(s,t.deviceId,"notifier"),numericSensor:je(s,t.deviceId,"numeric-sensor"),petFeeder:je(s,t.deviceId,"pet-feeder"),powerMeter:je(s,t.deviceId,"power-meter"),presence:je(s,t.deviceId,"presence"),pressureSensor:je(s,t.deviceId,"pressure-sensor"),privacyMask:je(s,t.deviceId,"privacy-mask"),ptzAutotrack:je(s,t.deviceId,"ptz-autotrack"),recordingSignal:je(s,t.deviceId,"recording-signal"),sceneMonitor:je(s,t.deviceId,"scene-monitor"),scriptRunner:je(s,t.deviceId,"script-runner"),smoke:je(s,t.deviceId,"smoke"),streamCatalog:je(s,t.deviceId,"stream-catalog"),streamParams:je(s,t.deviceId,"stream-params"),streamSignals:je(s,t.deviceId,"stream-signals"),switch:je(s,t.deviceId,"switch"),tamper:je(s,t.deviceId,"tamper"),temperatureSensor:je(s,t.deviceId,"temperature-sensor"),update:je(s,t.deviceId,"update"),vacuumControl:je(s,t.deviceId,"vacuum-control"),valve:je(s,t.deviceId,"valve"),vibration:je(s,t.deviceId,"vibration"),waterHeater:je(s,t.deviceId,"water-heater"),weather:je(s,t.deviceId,"weather"),zoneAnalytics:je(s,t.deviceId,"zone-analytics"),zoneRules:je(s,t.deviceId,"zone-rules"),zones:je(s,t.deviceId,"zones")},accessories:{setChildHidden:c=>m("accessories","accessories","setChildHidden","mutation",c),getStatus:c=>m("accessories","accessories","getStatus","query",c)},airQualitySensor:{getStatus:c=>m("air-quality-sensor","airQualitySensor","getStatus","query",c)},alarmPanel:{arm:c=>m("alarm-panel","alarmPanel","arm","mutation",c),disarm:c=>m("alarm-panel","alarmPanel","disarm","mutation",c),trigger:c=>m("alarm-panel","alarmPanel","trigger","mutation",c),getStatus:c=>m("alarm-panel","alarmPanel","getStatus","query",c)},ambientLightSensor:{getStatus:c=>m("ambient-light-sensor","ambientLightSensor","getStatus","query",c)},audioAnalysis:{resolveDeviceSettings:c=>m("audio-analysis","audioAnalysis","resolveDeviceSettings","query",c),getDeviceSettingsContribution:c=>m("audio-analysis","audioAnalysis","getDeviceSettingsContribution","query",c),getDeviceLiveContribution:c=>m("audio-analysis","audioAnalysis","getDeviceLiveContribution","query",c),applyDeviceSettingsPatch:c=>m("audio-analysis","audioAnalysis","applyDeviceSettingsPatch","mutation",c)},audioMetrics:{getCurrentSnapshot:c=>m("audio-metrics","audioMetrics","getCurrentSnapshot","query",c),getHistory:c=>m("audio-metrics","audioMetrics","getHistory","query",c)},automationControl:{enable:c=>m("automation-control","automationControl","enable","mutation",c),disable:c=>m("automation-control","automationControl","disable","mutation",c),trigger:c=>m("automation-control","automationControl","trigger","mutation",c),getStatus:c=>m("automation-control","automationControl","getStatus","query",c)},battery:{wakeForStream:c=>m("battery","battery","wakeForStream","mutation",c),getStatus:c=>m("battery","battery","getStatus","query",c)},binary:{getStatus:c=>m("binary","binary","getStatus","query",c)},brightness:{setBrightness:c=>m("brightness","brightness","setBrightness","mutation",c),getStatus:c=>m("brightness","brightness","getStatus","query",c)},button:{press:c=>m("button","button","press","mutation",c)},cameraCredentials:{getCredentials:c=>m("camera-credentials","cameraCredentials","getCredentials","query",c),getStatus:c=>m("camera-credentials","cameraCredentials","getStatus","query",c)},cameraGridLayout:{getLayout:c=>m("camera-grid-layout","cameraGridLayout","getLayout","query",c),saveLayout:c=>m("camera-grid-layout","cameraGridLayout","saveLayout","mutation",c),getDeviceSettingsContribution:c=>m("camera-grid-layout","cameraGridLayout","getDeviceSettingsContribution","query",c),getDeviceLiveContribution:c=>m("camera-grid-layout","cameraGridLayout","getDeviceLiveContribution","query",c),applyDeviceSettingsPatch:c=>m("camera-grid-layout","cameraGridLayout","applyDeviceSettingsPatch","mutation",c)},cameraStreams:{getCameraStreams:c=>m("camera-streams","cameraStreams","getCameraStreams","query",c),getBrokerStreams:c=>m("camera-streams","cameraStreams","getBrokerStreams","query",c),getRtspEntries:c=>m("camera-streams","cameraStreams","getRtspEntries","query",c),getProfileRtspEntries:c=>m("camera-streams","cameraStreams","getProfileRtspEntries","query",c),pickStream:c=>m("camera-streams","cameraStreams","pickStream","query",c)},carbonMonoxide:{getStatus:c=>m("carbon-monoxide","carbonMonoxide","getStatus","query",c)},climateControl:{setMode:c=>m("climate-control","climateControl","setMode","mutation",c),setFanMode:c=>m("climate-control","climateControl","setFanMode","mutation",c),setPreset:c=>m("climate-control","climateControl","setPreset","mutation",c),setTarget:c=>m("climate-control","climateControl","setTarget","mutation",c),setTargetRange:c=>m("climate-control","climateControl","setTargetRange","mutation",c),setTargetHumidity:c=>m("climate-control","climateControl","setTargetHumidity","mutation",c),setSwingVertical:c=>m("climate-control","climateControl","setSwingVertical","mutation",c),setSwingHorizontal:c=>m("climate-control","climateControl","setSwingHorizontal","mutation",c),getStatus:c=>m("climate-control","climateControl","getStatus","query",c)},color:{setColor:c=>m("color","color","setColor","mutation",c),getStatus:c=>m("color","color","getStatus","query",c)},connectivity:{getStatus:c=>m("connectivity","connectivity","getStatus","query",c)},consumables:{reset:c=>m("consumables","consumables","reset","mutation",c),getStatus:c=>m("consumables","consumables","getStatus","query",c)},contact:{getStatus:c=>m("contact","contact","getStatus","query",c)},control:{setValue:c=>m("control","control","setValue","mutation",c),getStatus:c=>m("control","control","getStatus","query",c)},cover:{open:c=>m("cover","cover","open","mutation",c),close:c=>m("cover","cover","close","mutation",c),stop:c=>m("cover","cover","stop","mutation",c),setPosition:c=>m("cover","cover","setPosition","mutation",c),setTiltPosition:c=>m("cover","cover","setTiltPosition","mutation",c),getStatus:c=>m("cover","cover","getStatus","query",c)},dayNight:{getOptions:c=>m("day-night","dayNight","getOptions","query",c),setSettings:c=>m("day-night","dayNight","setSettings","mutation",c),getStatus:c=>m("day-night","dayNight","getStatus","query",c)},detectionPipeline:{getDeviceSettingsContribution:c=>m("detection-pipeline","detectionPipeline","getDeviceSettingsContribution","query",c),getDeviceLiveContribution:c=>m("detection-pipeline","detectionPipeline","getDeviceLiveContribution","query",c),applyDeviceSettingsPatch:c=>m("detection-pipeline","detectionPipeline","applyDeviceSettingsPatch","mutation",c)},deviceDiscovery:{listDiscovered:c=>m("device-discovery","deviceDiscovery","listDiscovered","query",c),refreshDiscovery:c=>m("device-discovery","deviceDiscovery","refreshDiscovery","mutation",c),adoptDevice:c=>m("device-discovery","deviceDiscovery","adoptDevice","mutation",c),releaseDevice:c=>m("device-discovery","deviceDiscovery","releaseDevice","mutation",c),getStatus:c=>m("device-discovery","deviceDiscovery","getStatus","query",c)},deviceOps:{getStreamSources:c=>m("device-ops","deviceOps","getStreamSources","query",c),getConfigEntries:c=>m("device-ops","deviceOps","getConfigEntries","query",c),setConfig:c=>m("device-ops","deviceOps","setConfig","mutation",c),runAction:c=>m("device-ops","deviceOps","runAction","mutation",c),removeDevice:c=>m("device-ops","deviceOps","removeDevice","mutation",c),getSettingsSchema:c=>m("device-ops","deviceOps","getSettingsSchema","query",c),getRawState:c=>m("device-ops","deviceOps","getRawState","query",c)},deviceStatus:{getStatus:c=>m("device-status","deviceStatus","getStatus","query",c)},doorbell:{getStatus:c=>m("doorbell","doorbell","getStatus","query",c),getDeviceSettingsContribution:c=>m("doorbell","doorbell","getDeviceSettingsContribution","query",c),getDeviceLiveContribution:c=>m("doorbell","doorbell","getDeviceLiveContribution","query",c),applyDeviceSettingsPatch:c=>m("doorbell","doorbell","applyDeviceSettingsPatch","mutation",c)},enumSensor:{getStatus:c=>m("enum-sensor","enumSensor","getStatus","query",c)},eventEmitter:{getStatus:c=>m("event-emitter","eventEmitter","getStatus","query",c)},events:{getEvents:c=>m("events","events","getEvents","query",c),getEventThumbnail:c=>m("events","events","getEventThumbnail","query",c),getEventClipUrl:c=>m("events","events","getEventClipUrl","query",c)},fanControl:{setPercentage:c=>m("fan-control","fanControl","setPercentage","mutation",c),setPreset:c=>m("fan-control","fanControl","setPreset","mutation",c),setDirection:c=>m("fan-control","fanControl","setDirection","mutation",c),setOscillating:c=>m("fan-control","fanControl","setOscillating","mutation",c),getStatus:c=>m("fan-control","fanControl","getStatus","query",c)},featureProbe:{getStatus:c=>m("feature-probe","featureProbe","getStatus","query",c)},flood:{getStatus:c=>m("flood","flood","getStatus","query",c)},gas:{getStatus:c=>m("gas","gas","getStatus","query",c)},humidifier:{setOn:c=>m("humidifier","humidifier","setOn","mutation",c),setTargetHumidity:c=>m("humidifier","humidifier","setTargetHumidity","mutation",c),setMode:c=>m("humidifier","humidifier","setMode","mutation",c),getStatus:c=>m("humidifier","humidifier","getStatus","query",c)},humiditySensor:{getStatus:c=>m("humidity-sensor","humiditySensor","getStatus","query",c)},image:{getStatus:c=>m("image","image","getStatus","query",c)},imageSettings:{getOptions:c=>m("image-settings","imageSettings","getOptions","query",c),setSettings:c=>m("image-settings","imageSettings","setSettings","mutation",c),getStatus:c=>m("image-settings","imageSettings","getStatus","query",c)},intercom:{startSession:c=>m("intercom","intercom","startSession","mutation",c),handleAnswer:c=>m("intercom","intercom","handleAnswer","mutation",c),stopSession:c=>m("intercom","intercom","stopSession","mutation",c),startTalkSession:c=>m("intercom","intercom","startTalkSession","mutation",c),pushTalkAudio:c=>m("intercom","intercom","pushTalkAudio","mutation",c),endTalkSession:c=>m("intercom","intercom","endTalkSession","mutation",c),getStatus:c=>m("intercom","intercom","getStatus","query",c)},lawnMowerControl:{startMowing:c=>m("lawn-mower-control","lawnMowerControl","startMowing","mutation",c),pause:c=>m("lawn-mower-control","lawnMowerControl","pause","mutation",c),dock:c=>m("lawn-mower-control","lawnMowerControl","dock","mutation",c),getStatus:c=>m("lawn-mower-control","lawnMowerControl","getStatus","query",c)},lockControl:{lock:c=>m("lock-control","lockControl","lock","mutation",c),unlock:c=>m("lock-control","lockControl","unlock","mutation",c),open:c=>m("lock-control","lockControl","open","mutation",c),getStatus:c=>m("lock-control","lockControl","getStatus","query",c)},mediaPlayer:{play:c=>m("media-player","mediaPlayer","play","mutation",c),pause:c=>m("media-player","mediaPlayer","pause","mutation",c),stop:c=>m("media-player","mediaPlayer","stop","mutation",c),next:c=>m("media-player","mediaPlayer","next","mutation",c),previous:c=>m("media-player","mediaPlayer","previous","mutation",c),seek:c=>m("media-player","mediaPlayer","seek","mutation",c),setVolume:c=>m("media-player","mediaPlayer","setVolume","mutation",c),setMute:c=>m("media-player","mediaPlayer","setMute","mutation",c),setShuffle:c=>m("media-player","mediaPlayer","setShuffle","mutation",c),setRepeat:c=>m("media-player","mediaPlayer","setRepeat","mutation",c),selectSource:c=>m("media-player","mediaPlayer","selectSource","mutation",c),playMedia:c=>m("media-player","mediaPlayer","playMedia","mutation",c),getStatus:c=>m("media-player","mediaPlayer","getStatus","query",c)},motion:{isDetected:c=>m("motion","motion","isDetected","query",c),getStatus:c=>m("motion","motion","getStatus","query",c)},motionDetection:{analyze:c=>m("motion-detection","motionDetection","analyze","mutation",c),removeCamera:c=>m("motion-detection","motionDetection","removeCamera","mutation",c),reset:c=>m("motion-detection","motionDetection","reset","mutation",c),getDeviceSettingsContribution:c=>m("motion-detection","motionDetection","getDeviceSettingsContribution","query",c),getDeviceLiveContribution:c=>m("motion-detection","motionDetection","getDeviceLiveContribution","query",c),applyDeviceSettingsPatch:c=>m("motion-detection","motionDetection","applyDeviceSettingsPatch","mutation",c)},motionTrigger:{setMotionTrigger:c=>m("motion-trigger","motionTrigger","setMotionTrigger","mutation",c),getStatus:c=>m("motion-trigger","motionTrigger","getStatus","query",c)},motionZones:{getOptions:c=>m("motion-zones","motionZones","getOptions","query",c),setZone:c=>m("motion-zones","motionZones","setZone","mutation",c),getStatus:c=>m("motion-zones","motionZones","getStatus","query",c)},nativeObjectDetection:{getOptions:c=>m("native-object-detection","nativeObjectDetection","getOptions","query",c),setSettings:c=>m("native-object-detection","nativeObjectDetection","setSettings","mutation",c),setEnabled:c=>m("native-object-detection","nativeObjectDetection","setEnabled","mutation",c),getStatus:c=>m("native-object-detection","nativeObjectDetection","getStatus","query",c)},navigation:{move:c=>m("navigation","navigation","move","mutation",c),stop:c=>m("navigation","navigation","stop","mutation",c),goToPoint:c=>m("navigation","navigation","goToPoint","mutation",c),listActions:c=>m("navigation","navigation","listActions","query",c),runAction:c=>m("navigation","navigation","runAction","mutation",c),playSound:c=>m("navigation","navigation","playSound","mutation",c),setLightOn:c=>m("navigation","navigation","setLightOn","mutation",c),setLightMode:c=>m("navigation","navigation","setLightMode","mutation",c),setLightLevel:c=>m("navigation","navigation","setLightLevel","mutation",c),getFeatures:c=>m("navigation","navigation","getFeatures","query",c),getStatus:c=>m("navigation","navigation","getStatus","query",c)},networkLink:{getStatus:c=>m("network-link","networkLink","getStatus","query",c)},notificationRules:{listRules:c=>m("notification-rules","notificationRules","listRules","query",c),getRule:c=>m("notification-rules","notificationRules","getRule","query",c),createRule:c=>m("notification-rules","notificationRules","createRule","mutation",c),updateRule:c=>m("notification-rules","notificationRules","updateRule","mutation",c),deleteRule:c=>m("notification-rules","notificationRules","deleteRule","mutation",c),setRuleEnabled:c=>m("notification-rules","notificationRules","setRuleEnabled","mutation",c),getClipRetentionAsks:c=>m("notification-rules","notificationRules","getClipRetentionAsks","query",c),listDeviceMutes:c=>m("notification-rules","notificationRules","listDeviceMutes","query",c),setDeviceMuted:c=>m("notification-rules","notificationRules","setDeviceMuted","mutation",c),testRule:c=>m("notification-rules","notificationRules","testRule","mutation",c),getConditionCatalog:c=>m("notification-rules","notificationRules","getConditionCatalog","query",c),getHistory:c=>m("notification-rules","notificationRules","getHistory","query",c),resolveArtifactUrl:c=>m("notification-rules","notificationRules","resolveArtifactUrl","query",c),listSnoozes:c=>m("notification-rules","notificationRules","listSnoozes","query",c),createSnooze:c=>m("notification-rules","notificationRules","createSnooze","mutation",c),cancelSnooze:c=>m("notification-rules","notificationRules","cancelSnooze","mutation",c),getAlarmConfig:c=>m("notification-rules","notificationRules","getAlarmConfig","query",c),setAlarmConfig:c=>m("notification-rules","notificationRules","setAlarmConfig","mutation",c)},notifier:{send:c=>m("notifier","notifier","send","mutation",c),cancel:c=>m("notifier","notifier","cancel","mutation",c),getStatus:c=>m("notifier","notifier","getStatus","query",c)},numericSensor:{getStatus:c=>m("numeric-sensor","numericSensor","getStatus","query",c)},osd:{setOverlay:c=>m("osd","osd","setOverlay","mutation",c),getStatus:c=>m("osd","osd","getStatus","query",c)},petFeeder:{feed:c=>m("pet-feeder","petFeeder","feed","mutation",c),cancelFeed:c=>m("pet-feeder","petFeeder","cancelFeed","mutation",c),resetDesiccant:c=>m("pet-feeder","petFeeder","resetDesiccant","mutation",c),markFoodReplenished:c=>m("pet-feeder","petFeeder","markFoodReplenished","mutation",c),callPet:c=>m("pet-feeder","petFeeder","callPet","mutation",c),playSound:c=>m("pet-feeder","petFeeder","playSound","mutation",c),setChildLock:c=>m("pet-feeder","petFeeder","setChildLock","mutation",c),setIndicatorLight:c=>m("pet-feeder","petFeeder","setIndicatorLight","mutation",c),setFeedSound:c=>m("pet-feeder","petFeeder","setFeedSound","mutation",c),setVolume:c=>m("pet-feeder","petFeeder","setVolume","mutation",c),getStatus:c=>m("pet-feeder","petFeeder","getStatus","query",c)},pipelineAnalytics:{getActiveTracks:c=>m("pipeline-analytics","pipelineAnalytics","getActiveTracks","query",c),getTrack:c=>m("pipeline-analytics","pipelineAnalytics","getTrack","query",c),listTracks:c=>m("pipeline-analytics","pipelineAnalytics","listTracks","query",c),listRecentTracks:c=>m("pipeline-analytics","pipelineAnalytics","listRecentTracks","query",c),listSummaries:c=>m("pipeline-analytics","pipelineAnalytics","listSummaries","query",c),listRecentSummaries:c=>m("pipeline-analytics","pipelineAnalytics","listRecentSummaries","query",c),getSummary:c=>m("pipeline-analytics","pipelineAnalytics","getSummary","query",c),clearTracks:c=>m("pipeline-analytics","pipelineAnalytics","clearTracks","mutation",c),getMotionEvents:c=>m("pipeline-analytics","pipelineAnalytics","getMotionEvents","query",c),getObjectEvents:c=>m("pipeline-analytics","pipelineAnalytics","getObjectEvents","query",c),getAudioEvents:c=>m("pipeline-analytics","pipelineAnalytics","getAudioEvents","query",c),listEventKinds:c=>m("pipeline-analytics","pipelineAnalytics","listEventKinds","query",c),listEventKindsBatch:c=>m("pipeline-analytics","pipelineAnalytics","listEventKindsBatch","query",c),getSensorEvents:c=>m("pipeline-analytics","pipelineAnalytics","getSensorEvents","query",c),getKeyEvents:c=>m("pipeline-analytics","pipelineAnalytics","getKeyEvents","query",c),getKeyEventsBatch:c=>m("pipeline-analytics","pipelineAnalytics","getKeyEventsBatch","query",c),readLongTermSeries:c=>m("pipeline-analytics","pipelineAnalytics","readLongTermSeries","query",c),getEventDensity:c=>m("pipeline-analytics","pipelineAnalytics","getEventDensity","query",c),getEventDensityBatch:c=>m("pipeline-analytics","pipelineAnalytics","getEventDensityBatch","query",c),pruneEventsBefore:c=>m("pipeline-analytics","pipelineAnalytics","pruneEventsBefore","mutation",c),pruneTracksBefore:c=>m("pipeline-analytics","pipelineAnalytics","pruneTracksBefore","mutation",c),wipeAllAnalytics:c=>m("pipeline-analytics","pipelineAnalytics","wipeAllAnalytics","mutation",c),reconcileFromDisk:c=>m("pipeline-analytics","pipelineAnalytics","reconcileFromDisk","mutation",c),deleteTracks:c=>m("pipeline-analytics","pipelineAnalytics","deleteTracks","mutation",c),setTrackFlags:c=>m("pipeline-analytics","pipelineAnalytics","setTrackFlags","mutation",c),listArchivedDebugNotes:c=>m("pipeline-analytics","pipelineAnalytics","listArchivedDebugNotes","query",c),listBirthDecisions:c=>m("pipeline-analytics","pipelineAnalytics","listBirthDecisions","query",c),getEventStoreFootprint:c=>m("pipeline-analytics","pipelineAnalytics","getEventStoreFootprint","query",c),getEventMediaFootprintByKind:c=>m("pipeline-analytics","pipelineAnalytics","getEventMediaFootprintByKind","query",c),pruneEvents:c=>m("pipeline-analytics","pipelineAnalytics","pruneEvents","mutation",c),deleteDeviceEvents:c=>m("pipeline-analytics","pipelineAnalytics","deleteDeviceEvents","mutation",c),pauseForStorageMigration:c=>m("pipeline-analytics","pipelineAnalytics","pauseForStorageMigration","mutation",c),resumeForStorageMigration:c=>m("pipeline-analytics","pipelineAnalytics","resumeForStorageMigration","mutation",c),refreshStorageLocationsForMigration:c=>m("pipeline-analytics","pipelineAnalytics","refreshStorageLocationsForMigration","mutation",c),startStorageMigrationMove:c=>m("pipeline-analytics","pipelineAnalytics","startStorageMigrationMove","mutation",c),getStorageMigrationMoveStatus:c=>m("pipeline-analytics","pipelineAnalytics","getStorageMigrationMoveStatus","query",c),cancelStorageMigrationMove:c=>m("pipeline-analytics","pipelineAnalytics","cancelStorageMigrationMove","mutation",c),relocateMedia:c=>m("pipeline-analytics","pipelineAnalytics","relocateMedia","mutation",c),countUnstampedEventMedia:c=>m("pipeline-analytics","pipelineAnalytics","countUnstampedEventMedia","query",c),countRelocatableMedia:c=>m("pipeline-analytics","pipelineAnalytics","countRelocatableMedia","query",c),listRelocateMediaJobs:c=>m("pipeline-analytics","pipelineAnalytics","listRelocateMediaJobs","query",c),cancelRelocateMedia:c=>m("pipeline-analytics","pipelineAnalytics","cancelRelocateMedia","mutation",c),listOpsLog:c=>m("pipeline-analytics","pipelineAnalytics","listOpsLog","query",c),reclaimDebugMedia:c=>m("pipeline-analytics","pipelineAnalytics","reclaimDebugMedia","mutation",c),getMediaReclaimStatus:c=>m("pipeline-analytics","pipelineAnalytics","getMediaReclaimStatus","query",c),getTrainingExportSummary:c=>m("pipeline-analytics","pipelineAnalytics","getTrainingExportSummary","query",c),getTrainingExportUrl:c=>m("pipeline-analytics","pipelineAnalytics","getTrainingExportUrl","query",c),listRetrainStaging:c=>m("pipeline-analytics","pipelineAnalytics","listRetrainStaging","query",c),listRetrainFrames:c=>m("pipeline-analytics","pipelineAnalytics","listRetrainFrames","query",c),selectRetrainFrames:c=>m("pipeline-analytics","pipelineAnalytics","selectRetrainFrames","mutation",c),deselectRetrainFrame:c=>m("pipeline-analytics","pipelineAnalytics","deselectRetrainFrame","mutation",c),getRetrainFrameImage:c=>m("pipeline-analytics","pipelineAnalytics","getRetrainFrameImage","query",c),proposeRetrainAnnotations:c=>m("pipeline-analytics","pipelineAnalytics","proposeRetrainAnnotations","mutation",c),runReplayFrameProcessor:c=>m("pipeline-analytics","pipelineAnalytics","runReplayFrameProcessor","mutation",c),listRetrainAnnotations:c=>m("pipeline-analytics","pipelineAnalytics","listRetrainAnnotations","query",c),saveRetrainAnnotations:c=>m("pipeline-analytics","pipelineAnalytics","saveRetrainAnnotations","mutation",c),completeRetrainTrack:c=>m("pipeline-analytics","pipelineAnalytics","completeRetrainTrack","mutation",c),restageRetrainTrack:c=>m("pipeline-analytics","pipelineAnalytics","restageRetrainTrack","mutation",c),getRetrainExportUrl:c=>m("pipeline-analytics","pipelineAnalytics","getRetrainExportUrl","query",c),getEventMedia:c=>m("pipeline-analytics","pipelineAnalytics","getEventMedia","query",c),getTrackMedia:c=>m("pipeline-analytics","pipelineAnalytics","getTrackMedia","query",c),listTrackMedia:c=>m("pipeline-analytics","pipelineAnalytics","listTrackMedia","query",c),listEventMedia:c=>m("pipeline-analytics","pipelineAnalytics","listEventMedia","query",c),searchObjectEvents:c=>m("pipeline-analytics","pipelineAnalytics","searchObjectEvents","query",c),wipeObjectEmbeddings:c=>m("pipeline-analytics","pipelineAnalytics","wipeObjectEmbeddings","mutation",c),rebuildObjectEmbeddings:c=>m("pipeline-analytics","pipelineAnalytics","rebuildObjectEmbeddings","mutation",c),getObjectEmbeddingRebuildStatus:c=>m("pipeline-analytics","pipelineAnalytics","getObjectEmbeddingRebuildStatus","query",c),getDeviceSettingsContribution:c=>m("pipeline-analytics","pipelineAnalytics","getDeviceSettingsContribution","query",c),getDeviceLiveContribution:c=>m("pipeline-analytics","pipelineAnalytics","getDeviceLiveContribution","query",c),applyDeviceSettingsPatch:c=>m("pipeline-analytics","pipelineAnalytics","applyDeviceSettingsPatch","mutation",c)},powerMeter:{getStatus:c=>m("power-meter","powerMeter","getStatus","query",c)},presence:{getStatus:c=>m("presence","presence","getStatus","query",c)},pressureSensor:{getStatus:c=>m("pressure-sensor","pressureSensor","getStatus","query",c)},privacyMask:{getOptions:c=>m("privacy-mask","privacyMask","getOptions","query",c),setMask:c=>m("privacy-mask","privacyMask","setMask","mutation",c),setAudioEnabled:c=>m("privacy-mask","privacyMask","setAudioEnabled","mutation",c),getStatus:c=>m("privacy-mask","privacyMask","getStatus","query",c)},ptz:{move:c=>m("ptz","ptz","move","mutation",c),continuousMove:c=>m("ptz","ptz","continuousMove","mutation",c),stop:c=>m("ptz","ptz","stop","mutation",c),getPresets:c=>m("ptz","ptz","getPresets","query",c),goToPreset:c=>m("ptz","ptz","goToPreset","mutation",c),savePreset:c=>m("ptz","ptz","savePreset","mutation",c),deletePreset:c=>m("ptz","ptz","deletePreset","mutation",c),getOptions:c=>m("ptz","ptz","getOptions","query",c),goHome:c=>m("ptz","ptz","goHome","mutation",c),getHomePreset:c=>m("ptz","ptz","getHomePreset","query",c),setHomePreset:c=>m("ptz","ptz","setHomePreset","mutation",c),captureHomeHere:c=>m("ptz","ptz","captureHomeHere","mutation",c),getHomeReturn:c=>m("ptz","ptz","getHomeReturn","query",c),setHomeReturn:c=>m("ptz","ptz","setHomeReturn","mutation",c),getPosition:c=>m("ptz","ptz","getPosition","query",c),setAutofocus:c=>m("ptz","ptz","setAutofocus","mutation",c),getStatus:c=>m("ptz","ptz","getStatus","query",c)},ptzAutotrack:{getStatus:c=>m("ptz-autotrack","ptzAutotrack","getStatus","query",c),setEnabled:c=>m("ptz-autotrack","ptzAutotrack","setEnabled","mutation",c),getSettings:c=>m("ptz-autotrack","ptzAutotrack","getSettings","query",c),setSettings:c=>m("ptz-autotrack","ptzAutotrack","setSettings","mutation",c)},reboot:{reboot:c=>m("reboot","reboot","reboot","mutation",c)},recordingSignal:{getStatus:c=>m("recording-signal","recordingSignal","getStatus","query",c)},sceneMonitor:{listScenes:c=>m("scene-monitor","sceneMonitor","listScenes","query",c),listScenesBatch:c=>m("scene-monitor","sceneMonitor","listScenesBatch","query",c),createScene:c=>m("scene-monitor","sceneMonitor","createScene","mutation",c),updateScene:c=>m("scene-monitor","sceneMonitor","updateScene","mutation",c),deleteScene:c=>m("scene-monitor","sceneMonitor","deleteScene","mutation",c),captureReference:c=>m("scene-monitor","sceneMonitor","captureReference","mutation",c),deleteReference:c=>m("scene-monitor","sceneMonitor","deleteReference","mutation",c),recheckNow:c=>m("scene-monitor","sceneMonitor","recheckNow","mutation",c),resetScene:c=>m("scene-monitor","sceneMonitor","resetScene","mutation",c),getStatus:c=>m("scene-monitor","sceneMonitor","getStatus","query",c)},scriptRunner:{run:c=>m("script-runner","scriptRunner","run","mutation",c),stop:c=>m("script-runner","scriptRunner","stop","mutation",c),getStatus:c=>m("script-runner","scriptRunner","getStatus","query",c)},smoke:{getStatus:c=>m("smoke","smoke","getStatus","query",c)},snapshot:{getSnapshot:c=>m("snapshot","snapshot","getSnapshot","query",c),invalidateCache:c=>m("snapshot","snapshot","invalidateCache","mutation",c),getSnapshotOverview:c=>m("snapshot","snapshot","getSnapshotOverview","query",c),getDebugState:c=>m("snapshot","snapshot","getDebugState","query",c),getSnapshotLinks:c=>m("snapshot","snapshot","getSnapshotLinks","query",c),getStatus:c=>m("snapshot","snapshot","getStatus","query",c),getDeviceSettingsContribution:c=>m("snapshot","snapshot","getDeviceSettingsContribution","query",c),getDeviceLiveContribution:c=>m("snapshot","snapshot","getDeviceLiveContribution","query",c),applyDeviceSettingsPatch:c=>m("snapshot","snapshot","applyDeviceSettingsPatch","mutation",c)},streamCatalog:{getCatalog:c=>m("stream-catalog","streamCatalog","getCatalog","query",c)},streamParams:{getOptions:c=>m("stream-params","streamParams","getOptions","query",c),setProfile:c=>m("stream-params","streamParams","setProfile","mutation",c),getConfigSchema:c=>m("stream-params","streamParams","getConfigSchema","query",c),getStatus:c=>m("stream-params","streamParams","getStatus","query",c)},streamSignals:{listSignals:c=>m("stream-signals","streamSignals","listSignals","query",c)},switch:{setState:c=>m("switch","switch","setState","mutation",c),getStatus:c=>m("switch","switch","getStatus","query",c)},tamper:{getStatus:c=>m("tamper","tamper","getStatus","query",c)},temperatureSensor:{getStatus:c=>m("temperature-sensor","temperatureSensor","getStatus","query",c)},update:{installUpdate:c=>m("update","update","installUpdate","mutation",c),getStatus:c=>m("update","update","getStatus","query",c)},vacuumControl:{start:c=>m("vacuum-control","vacuumControl","start","mutation",c),pause:c=>m("vacuum-control","vacuumControl","pause","mutation",c),stop:c=>m("vacuum-control","vacuumControl","stop","mutation",c),returnToBase:c=>m("vacuum-control","vacuumControl","returnToBase","mutation",c),locate:c=>m("vacuum-control","vacuumControl","locate","mutation",c),setFanSpeed:c=>m("vacuum-control","vacuumControl","setFanSpeed","mutation",c),getStatus:c=>m("vacuum-control","vacuumControl","getStatus","query",c)},valve:{open:c=>m("valve","valve","open","mutation",c),close:c=>m("valve","valve","close","mutation",c),stop:c=>m("valve","valve","stop","mutation",c),setPosition:c=>m("valve","valve","setPosition","mutation",c),getStatus:c=>m("valve","valve","getStatus","query",c)},vibration:{getStatus:c=>m("vibration","vibration","getStatus","query",c)},videoclips:{listClips:c=>m("videoclips","videoclips","listClips","query",c),getClipPlayback:c=>m("videoclips","videoclips","getClipPlayback","query",c)},waterHeater:{setTargetTemp:c=>m("water-heater","waterHeater","setTargetTemp","mutation",c),setOperationMode:c=>m("water-heater","waterHeater","setOperationMode","mutation",c),setAway:c=>m("water-heater","waterHeater","setAway","mutation",c),getStatus:c=>m("water-heater","waterHeater","getStatus","query",c)},weather:{getStatus:c=>m("weather","weather","getStatus","query",c)},webrtcSession:{listStreams:c=>m("webrtc-session","webrtcSession","listStreams","query",c),createSession:c=>m("webrtc-session","webrtcSession","createSession","mutation",c),handleOffer:c=>m("webrtc-session","webrtcSession","handleOffer","mutation",c),handleAnswer:c=>m("webrtc-session","webrtcSession","handleAnswer","mutation",c),addIceCandidate:c=>m("webrtc-session","webrtcSession","addIceCandidate","mutation",c),getIceCandidates:c=>m("webrtc-session","webrtcSession","getIceCandidates","query",c),closeSession:c=>m("webrtc-session","webrtcSession","closeSession","mutation",c),hasAdaptiveBitrate:c=>m("webrtc-session","webrtcSession","hasAdaptiveBitrate","query",c),getSessionState:c=>m("webrtc-session","webrtcSession","getSessionState","query",c),getSessionDebug:c=>m("webrtc-session","webrtcSession","getSessionDebug","query",c)},zoneAnalytics:{getCurrentSnapshot:c=>m("zone-analytics","zoneAnalytics","getCurrentSnapshot","query",c),getCurrentSnapshotBatch:c=>m("zone-analytics","zoneAnalytics","getCurrentSnapshotBatch","query",c),getZoneHistory:c=>m("zone-analytics","zoneAnalytics","getZoneHistory","query",c),getCameraHistory:c=>m("zone-analytics","zoneAnalytics","getCameraHistory","query",c),getUnzonedHistory:c=>m("zone-analytics","zoneAnalytics","getUnzonedHistory","query",c)},zoneRules:{listRules:c=>m("zone-rules","zoneRules","listRules","query",c),setRules:c=>m("zone-rules","zoneRules","setRules","mutation",c)},zones:{listZones:c=>m("zones","zones","listZones","query",c),addZone:c=>m("zones","zones","addZone","mutation",c),removeZone:c=>m("zones","zones","removeZone","mutation",c),updateZone:c=>m("zones","zones","updateZone","mutation",c)},addonSettings:{getDeviceSettings:c=>h("addonSettings","getDeviceSettings","query",c),updateDeviceSettings:c=>h("addonSettings","updateDeviceSettings","mutation",c)},audioAnalyzer:{detachDevice:c=>h("audioAnalyzer","detachDevice","mutation",c)},cameraPipelineConfig:{getDeviceSettingsContribution:c=>h("cameraPipelineConfig","getDeviceSettingsContribution","query",c),getDeviceLiveContribution:c=>h("cameraPipelineConfig","getDeviceLiveContribution","query",c),applyDeviceSettingsPatch:c=>h("cameraPipelineConfig","applyDeviceSettingsPatch","mutation",c)},deviceAdoption:{getStatus:c=>h("deviceAdoption","getStatus","query",c)},deviceExport:{getDeviceSettingsContribution:c=>h("deviceExport","getDeviceSettingsContribution","query",c),getDeviceLiveContribution:c=>h("deviceExport","getDeviceLiveContribution","query",c),applyDeviceSettingsPatch:c=>h("deviceExport","applyDeviceSettingsPatch","mutation",c)},deviceManager:{loadConfig:c=>h("deviceManager","loadConfig","query",c),loadRuntimeState:c=>h("deviceManager","loadRuntimeState","query",c),loadMeta:c=>h("deviceManager","loadMeta","query",c),setName:c=>h("deviceManager","setName","mutation",c),setLocation:c=>h("deviceManager","setLocation","mutation",c),setType:c=>h("deviceManager","setType","mutation",c),setIntegrationId:c=>h("deviceManager","setIntegrationId","mutation",c),setLinkDeviceId:c=>h("deviceManager","setLinkDeviceId","mutation",c),setPrimaryChildEntityId:c=>h("deviceManager","setPrimaryChildEntityId","mutation",c),setChildLayout:c=>h("deviceManager","setChildLayout","mutation",c),setDisplay:c=>h("deviceManager","setDisplay","mutation",c),getWireableFields:c=>h("deviceManager","getWireableFields","query",c),setRole:c=>h("deviceManager","setRole","mutation",c),applyInitialMeta:c=>h("deviceManager","applyInitialMeta","mutation",c),setMetadata:c=>h("deviceManager","setMetadata","mutation",c),setDisabled:c=>h("deviceManager","setDisabled","mutation",c),getDevice:c=>h("deviceManager","getDevice","query",c),getLinkedDevices:c=>h("deviceManager","getLinkedDevices","query",c),getStreamSources:c=>h("deviceManager","getStreamSources","query",c),getConfigSchema:c=>h("deviceManager","getConfigSchema","query",c),getSettingsSchema:c=>h("deviceManager","getSettingsSchema","query",c),updateConfig:c=>h("deviceManager","updateConfig","mutation",c),enable:c=>h("deviceManager","enable","mutation",c),disable:c=>h("deviceManager","disable","mutation",c),remove:c=>h("deviceManager","remove","mutation",c),getStreamProfileMap:c=>h("deviceManager","getStreamProfileMap","query",c),setStreamProfileMap:c=>h("deviceManager","setStreamProfileMap","mutation",c),probeStreams:c=>h("deviceManager","probeStreams","mutation",c),getBindings:c=>h("deviceManager","getBindings","query",c),setWrapperActive:c=>h("deviceManager","setWrapperActive","mutation",c),getDeviceSettingsAggregate:c=>h("deviceManager","getDeviceSettingsAggregate","query",c),getDeviceLiveInfoAggregate:c=>h("deviceManager","getDeviceLiveInfoAggregate","query",c),getDeviceAggregate:c=>h("deviceManager","getDeviceAggregate","query",c),runDeviceAction:c=>h("deviceManager","runDeviceAction","mutation",c),updateDeviceField:c=>h("deviceManager","updateDeviceField","mutation",c),updateDeviceFieldsBatch:c=>h("deviceManager","updateDeviceFieldsBatch","mutation",c),testField:c=>h("deviceManager","testField","mutation",c),getDeviceStatusAggregate:c=>h("deviceManager","getDeviceStatusAggregate","query",c),getDeviceSettingsContribution:c=>h("deviceManager","getDeviceSettingsContribution","query",c),getDeviceLiveContribution:c=>h("deviceManager","getDeviceLiveContribution","query",c),applyDeviceSettingsPatch:c=>h("deviceManager","applyDeviceSettingsPatch","mutation",c)},deviceProvider:{reloadDevice:c=>h("deviceProvider","reloadDevice","mutation",c)},deviceState:{getSnapshot:c=>h("deviceState","getSnapshot","query",c),getCapSlice:c=>h("deviceState","getCapSlice","query",c),setCapSlice:c=>h("deviceState","setCapSlice","mutation",c)},faceGallery:{listRecentFaces:c=>h("faceGallery","listRecentFaces","query",c),getFaceByTrack:c=>h("faceGallery","getFaceByTrack","query",c)},networkQuality:{getDeviceStats:c=>h("networkQuality","getDeviceStats","query",c),reportClientStats:c=>h("networkQuality","reportClientStats","mutation",c)},osdManager:{getDeviceOsd:c=>h("osdManager","getDeviceOsd","query",c),getSourceCatalog:c=>h("osdManager","getSourceCatalog","query",c),setSlotBinding:c=>h("osdManager","setSlotBinding","mutation",c),clearSlotBinding:c=>h("osdManager","clearSlotBinding","mutation",c),previewSlot:c=>h("osdManager","previewSlot","mutation",c),renderDevice:c=>h("osdManager","renderDevice","mutation",c)},pipelineExecutor:{runPipeline:c=>h("pipelineExecutor","runPipeline","mutation",c),runPipelineBatch:c=>h("pipelineExecutor","runPipelineBatch","mutation",c)},pipelineOrchestrator:{assignPipeline:c=>h("pipelineOrchestrator","assignPipeline","mutation",c),unassignPipeline:c=>h("pipelineOrchestrator","unassignPipeline","mutation",c),setPipelineDevicePin:c=>h("pipelineOrchestrator","setPipelineDevicePin","mutation",c),getPipelineDevicePin:c=>h("pipelineOrchestrator","getPipelineDevicePin","query",c),getPipelineAssignment:c=>h("pipelineOrchestrator","getPipelineAssignment","query",c),getCameraMetrics:c=>h("pipelineOrchestrator","getCameraMetrics","query",c),assignAudio:c=>h("pipelineOrchestrator","assignAudio","mutation",c),unassignAudio:c=>h("pipelineOrchestrator","unassignAudio","mutation",c),getAudioAssignment:c=>h("pipelineOrchestrator","getAudioAssignment","query",c),getAudioAssignments:c=>h("pipelineOrchestrator","getAudioAssignments","query",c),getCameraSettings:c=>h("pipelineOrchestrator","getCameraSettings","query",c),setCameraStepToggle:c=>h("pipelineOrchestrator","setCameraStepToggle","mutation",c),getCameraStepOverrides:c=>h("pipelineOrchestrator","getCameraStepOverrides","query",c),setCameraStepOverride:c=>h("pipelineOrchestrator","setCameraStepOverride","mutation",c),setCameraPipelineForAgent:c=>h("pipelineOrchestrator","setCameraPipelineForAgent","mutation",c),resolvePipeline:c=>h("pipelineOrchestrator","resolvePipeline","query",c),getCameraSwitches:c=>h("pipelineOrchestrator","getCameraSwitches","query",c),setCameraSwitch:c=>h("pipelineOrchestrator","setCameraSwitch","mutation",c),getCameraStatus:c=>h("pipelineOrchestrator","getCameraStatus","query",c),getDeviceSettingsContribution:c=>h("pipelineOrchestrator","getDeviceSettingsContribution","query",c),getDeviceLiveContribution:c=>h("pipelineOrchestrator","getDeviceLiveContribution","query",c),applyDeviceSettingsPatch:c=>h("pipelineOrchestrator","applyDeviceSettingsPatch","mutation",c)},pipelineRunner:{detachCamera:c=>h("pipelineRunner","detachCamera","mutation",c),getCameraMetrics:c=>h("pipelineRunner","getCameraMetrics","query",c),requestOccupancyBurst:c=>h("pipelineRunner","requestOccupancyBurst","mutation",c),runDetailSubtree:c=>h("pipelineRunner","runDetailSubtree","mutation",c),parkTrackFrame:c=>h("pipelineRunner","parkTrackFrame","mutation",c),getParkedTrackFrame:c=>h("pipelineRunner","getParkedTrackFrame","query",c),releaseParkedTrackFrames:c=>h("pipelineRunner","releaseParkedTrackFrames","mutation",c)},plateGallery:{listPlates:c=>h("plateGallery","listPlates","query",c),getPlateByTrack:c=>h("plateGallery","getPlateByTrack","query",c)},recording:{getAvailability:c=>h("recording","getAvailability","query",c),getDaysWithRecordings:c=>h("recording","getDaysWithRecordings","query",c),getPlaybackManifest:c=>h("recording","getPlaybackManifest","query",c),getDeviceConfig:c=>h("recording","getDeviceConfig","query",c),locateSegment:c=>h("recording","locateSegment","query",c),readSegmentBytes:c=>h("recording","readSegmentBytes","query",c),readGopBytes:c=>h("recording","readGopBytes","query",c),readWindowBytes:c=>h("recording","readWindowBytes","query",c),setDeviceConfig:c=>h("recording","setDeviceConfig","mutation",c),rescanStorage:c=>h("recording","rescanStorage","mutation",c),pruneFootage:c=>h("recording","pruneFootage","mutation",c),deleteFootprint:c=>h("recording","deleteFootprint","mutation",c),renderGif:c=>h("recording","renderGif","mutation",c),renderClip:c=>h("recording","renderClip","mutation",c),getStatus:c=>h("recording","getStatus","query",c),getDeviceSettingsContribution:c=>h("recording","getDeviceSettingsContribution","query",c),getDeviceLiveContribution:c=>h("recording","getDeviceLiveContribution","query",c),applyDeviceSettingsPatch:c=>h("recording","applyDeviceSettingsPatch","mutation",c)},recordingExport:{listExports:c=>h("recordingExport","listExports","query",c)},streamBroker:{reportStreamSignal:c=>h("streamBroker","reportStreamSignal","mutation",c),publishCameraStream:c=>h("streamBroker","publishCameraStream","mutation",c),retractCameraStream:c=>h("streamBroker","retractCameraStream","mutation",c),assignProfile:c=>h("streamBroker","assignProfile","mutation",c),unassignProfile:c=>h("streamBroker","unassignProfile","mutation",c),forgetDeviceHardware:c=>h("streamBroker","forgetDeviceHardware","mutation",c),renderPreBufferClip:c=>h("streamBroker","renderPreBufferClip","mutation",c),produceEventMedia:c=>h("streamBroker","produceEventMedia","mutation",c),restartProfile:c=>h("streamBroker","restartProfile","mutation",c),getDeviceAudioMute:c=>h("streamBroker","getDeviceAudioMute","query",c),setDeviceAudioMute:c=>h("streamBroker","setDeviceAudioMute","mutation",c),getDeviceSettingsContribution:c=>h("streamBroker","getDeviceSettingsContribution","query",c),getDeviceLiveContribution:c=>h("streamBroker","getDeviceLiveContribution","query",c),applyDeviceSettingsPatch:c=>h("streamBroker","applyDeviceSettingsPatch","mutation",c)}}}var vq=["track","summary","face","identity","plate","vehicle","scene","motion","object","audio","mosaic"];new Set(vq);var kR=["motion","object","audio"],xw=N(kR);new Set(kR);var yq=d({codec:N(["h264","h265","copy"]),profile:N(["baseline","main","high"]).optional(),level:o().optional(),width:l().int().positive().optional(),height:l().int().positive().optional(),fps:l().positive().optional(),bitrateKbps:l().int().positive().optional(),gopFrames:l().int().positive().optional(),bf:l().int().min(0).optional(),preset:N(["ultrafast","superfast","veryfast","faster","fast","medium"]).optional(),tune:N(["zerolatency","film","animation"]).optional(),singleSlicePerFrame:A().optional()}),bq=tt([$("passthrough"),d({codec:N(["opus","aac","pcmu","pcma","copy"]),bitrateKbps:l().int().positive().optional(),sampleRateHz:l().int().positive().optional(),channels:tt([$(1),$(2)]).optional()})]),wR=d({video:yq,audio:bq,inputArgs:w(o()).optional(),outputArgs:w(o()).optional()}),MR={video:{codec:"h264",profile:"baseline",level:"3.1",width:1280,height:720,fps:25,bitrateKbps:2500,gopFrames:25,bf:0,preset:"veryfast",tune:"zerolatency"}};({...MR.video});({...MR.video});var Sq=N(["singleton","device","widget"]),kw=d({capName:o(),kind:Sq,deviceId:l().optional(),reachable:A(),latencyMs:l(),error:o().optional()}),xq=d({addonId:o(),caps:w(kw).readonly(),widgets:w(kw).readonly()}),kq=d({nodeId:o(),addons:w(xq).readonly()});d({ok:A(),degraded:A(),checkedAt:o(),nodes:w(kq).readonly(),summary:d({total:l(),reachable:l(),unreachable:l()})});var wq=N(["running","done","failed","cancelled"]),Mq=N(["adopted","already-adopted","failed","cancelled"]),Cq=d({childNativeId:o(),outcome:Mq,parentDeviceId:l().int().nonnegative().nullable(),accessoryCount:l().int().nonnegative(),error:o().nullable()}),Aq=d({jobId:o(),addonId:o(),integrationId:o(),state:wq,total:l().int().nonnegative(),processed:l().int().nonnegative(),adopted:l().int().nonnegative(),alreadyAdopted:l().int().nonnegative(),failed:l().int().nonnegative(),accessoriesCreated:l().int().nonnegative(),currentChildNativeId:o().nullable(),results:w(Cq).readonly(),startedAt:l(),finishedAt:l().nullable(),error:o().nullable()}),fu=N(["stream-broker","object-detection","privacy-mask","device-audio","broker-audio","audio-analysis","recording","notifications"]),Eq=kt("kind",[d({kind:$("device-disabled")}),d({kind:$("wrapper-binding"),capName:o()}),d({kind:$("recording-config")}),d({kind:$("notification-mute")}),d({kind:$("camera-audio"),capName:o()}),d({kind:$("camera-mask"),capName:o()}),d({kind:$("broker-audio-mute")})]),Rq=N(["no-provider","source-unreachable","not-configured","device-disabled"]),Iq=d({id:fu,label:o(),costWhenOff:o(),available:A(),unavailableReason:Rq.optional(),enabled:A(),authority:Eq}),ww=d({deviceId:l().int(),switches:w(Iq).readonly(),fetchedAt:l()}),CR=N(["confirmed","suppressed","exhausted-fallback"]),Tq=d({id:o(),at:l().int(),deviceId:l().int(),sourceTrackId:o(),className:o(),verdict:CR,reason:o().nullable(),attempts:l().int(),deferredForMs:l().int(),decidedOnCoastedFrame:A(),birthEvidenceAvailable:A(),decidedByBirthEvidence:A(),bestScore:l().nullable(),appliedMinConfidence:l().nullable(),firstSeen:l().int().nullable(),motionOnsetAt:l().int().nullable(),birthLatencyMs:l().int().nullable(),birthIndexInBurst:l().int().nullable()}),_q=d({deviceId:l().int().optional(),since:l().int().optional(),verdict:CR.optional(),limit:l().int().min(1).max(5e3).optional()}),Nq=d({id:o(),note:o(),deviceId:l().int(),sourceTrackId:o(),archivedAt:l().int(),trackStartedAt:l().int().nullable(),trackClass:o().nullable(),trackLabel:o().nullable()}),Oq=d({deviceId:l().int().optional(),limit:l().int().min(1).max(1e3).optional()}),jq=N(["recording","events"]),Pq=N(["prune","manual-delete","rescan","retention-run","relocate","orphan-audit"]),Tb=N(["retention","quota","manual","operator","maintenance","orphaned-device"]),AR=d({id:o(),at:l(),domain:jq,op:Pq,reason:Tb,deviceId:l().nullable(),nodeId:o(),itemsAffected:l(),bytesReclaimed:l(),detail:o().nullable(),actor:o()}),ER=d({deviceId:l().optional(),limit:l().int().min(1).max(1e3).optional()}),RR=d({id:o(),name:o(),category:o().optional(),description:o().optional(),icon:o().optional()}),Dq=["person","vehicle","animal","package"],zq=["person","vehicle","animal"],IR=d({mapping:X(o(),N(Dq)),preserveOriginal:A()}),Lq=l().int().min(0).max(6),Mw=/^([01]\d|2[0-3]):[0-5]\d$/,_b=N(["off","events","continuous","on-device-decision"]),qq=N(zq),Cw=e=>new Set(e).size===e.length,Bq=d({motion:A().optional(),audioThresholdDbfs:l().optional(),objectClasses:w(qq).min(1).refine(Cw,{message:"objectClasses must not repeat a class"}).optional(),sensorDeviceIds:w(l().int().positive()).min(1).max(16).refine(Cw,{message:"sensorDeviceIds must not repeat a device"}).optional()}),Fq=N(["continuous","events"]),Uq=Bq,Hq=d({days:w(Lq),start:o().regex(Mw),end:o().regex(Mw),mode:Fq,triggers:Uq.optional(),preBufferSec:l().min(0).optional(),postBufferSec:l().min(0).optional()}),$q=d({maxAgeDays:l().min(0).optional(),maxSizeGb:l().min(0).optional()}),og=d({enabled:A(),mode:_b.optional(),profiles:w(Ut).optional(),segmentSeconds:l().int().positive().optional(),bands:w(Hq).default([]),deviceDecision:A().optional(),retention:$q.optional()}).strict().refine(e=>e.deviceDecision!==!0||e.bands.length===0,{message:"deviceDecision is a whole-config mode and carries no schedule: it cannot be combined with bands",path:["bands"]}),TR=N(["queued","running","done","failed","cancelled"]),Zc=d({jobId:o(),state:TR,fromLocationId:o(),toLocationId:o(),deviceId:l().nullable(),entities:w(o()),filesMoved:l().int(),bytesMoved:l().int(),filesTotal:l().int().nullable(),rowsReconciled:l().int().nonnegative().optional(),rowsForgotten:l().int().nonnegative().optional(),startedAt:l(),finishedAt:l().nullable(),error:o().nullable()}),_R=N(["recordings","recordingsLow"]),NR=d({fromLocationId:o(),toLocationId:o(),entities:w(N(["segments"])).optional(),footageClass:_R.optional(),deviceId:l().int().optional(),profiles:w(o()).optional(),throttleMbps:l().min(1).max(1e3).optional(),sinceMs:l().int().optional()}),qr=d({leaseId:o().min(1)}),Qq=NR.extend({leaseId:o().min(1)}),OR=N(["move","seal","gallery"]),jR=d({toLocationId:o(),fromLocationId:o().optional(),throttleMbps:l().min(1).max(1e3).optional(),mode:OR.optional()}),Aw=d({present:A(),rows:l().int().nonnegative().nullable()}),Vq=d({media:Aw,retrainFrames:Aw,anyPresent:A(),total:l().int().nonnegative().nullable()}).nullable(),Gq=jR.extend({leaseId:o().min(1)}),hu=N(["recordings","recordingsLow","eventMedia","backups","galleryMedia"]),Nb=d({recordings:o().min(1).optional(),recordingsLow:o().min(1).optional(),eventMedia:o().min(1).optional(),backups:o().min(1).optional(),galleryMedia:o().min(1).optional()}).refine(e=>Object.keys(e).length>0,{message:"select at least one storage class"}),Ob=d({recordings:o().min(1).optional(),recordingsLow:o().min(1).optional(),eventMedia:o().min(1).optional(),backups:o().min(1).optional(),galleryMedia:o().min(1).optional()}).optional(),jb=N(["blocking","nonBlocking"]),Ew=d({destinations:Nb,sources:Ob,throttleMbps:l().min(1).max(1e3).optional(),mode:jb.optional()}),Zq=N(["planning","sealing","pausing","moving","draining","verifying","repointing","refreshing","resuming","done","failed","cancelled"]),Kq=N(["pipeline","recorder","analytics"]),Wq=d({filesMoved:l().int().nonnegative(),filesTotal:l().int().nonnegative().nullable(),bytesMoved:l().int().nonnegative(),rowsReconciled:l().int().nonnegative().optional(),startedAt:l(),observedAt:l()}),Yq=d({storageClass:hu,fromLocationId:o(),toLocationId:o(),freezeSource:A().optional(),moverJobId:o().nullable(),state:TR.nullable(),error:o().nullable(),progress:Wq.nullable()}),Rw=d({jobId:o(),phase:Zq,mode:jb,destinations:Nb,sources:Ob,throttleMbps:l(),moves:w(Yq),pauseLeaseId:o().nullable(),pausedParticipants:w(Kq),repointed:A(),cancelRequested:A(),startedAt:l(),updatedAt:l(),finishedAt:l().nullable(),error:o().nullable()}),Xq=N(["sharesDeviceWithSource","deviceIdentityUnknown","unstampedEventMediaRows","blockingOnly","noMover"]),Jq=d({code:Xq,storageClass:hu,message:o()}),e7=d({destinations:Nb,sources:Ob,mode:jb,moves:w(d({storageClass:hu,fromLocationId:o(),toLocationId:o(),freezeSource:A().optional()})),findings:w(Jq)}),t7=N(["footage","media"]),n7=d({lane:t7,job:Zc,migrationJobId:o().nullable(),observedAt:l()}),a7=d({storageClass:hu,fromLocationId:o(),toLocationId:o(),items:l().int().nonnegative().nullable(),bytes:l().int().nonnegative().nullable()}),i7=d({classes:w(hu).min(1),throttleMbps:l().min(1).max(1e3).optional()}),r7=d({fromLocationId:o().min(1),footageClass:_R.optional()}),o7=d({segments:l().int().nonnegative(),bytes:l().int().nonnegative()}).nullable(),s7=d({locationId:o().min(1),apply:A().optional(),deviceId:l().int().positive().optional(),profiles:w(o().min(1)).optional()}),l7=N(["location-unknown","source-writable","no-ledger","archive-unreadable","anchor-absent","anchor-unreadable","anchor-moved"]);N(["live-tail","listing-error","path-mismatch","durable-refused"]);var c7=d({"live-tail":l().int().nonnegative(),"listing-error":l().int().nonnegative(),"path-mismatch":l().int().nonnegative(),"durable-refused":l().int().nonnegative()}),u7=d({deviceId:l().int(),hoursWalked:l().int().nonnegative(),hoursMissing:l().int().nonnegative(),ghostSegments:l().int().nonnegative(),ghostBytes:l().int().nonnegative(),forgottenSegments:l().int().nonnegative(),orphanFiles:l().int().nonnegative()}),d7=d({locationId:o(),applied:A(),refused:l7.nullable(),archiveSegments:l().int().nonnegative().nullable(),archiveBytes:l().int().nonnegative().nullable(),hoursClaimed:l().int().nonnegative(),hoursWalked:l().int().nonnegative(),hoursMissing:l().int().nonnegative(),listings:l().int().nonnegative(),segmentsClaimed:l().int().nonnegative(),ghostSegments:l().int().nonnegative(),ghostBytes:l().int().nonnegative(),ghostHoursWhole:l().int().nonnegative(),forgottenSegments:l().int().nonnegative(),forgottenBytes:l().int().nonnegative(),orphanFiles:l().int().nonnegative(),orphanSample:w(o()).readonly(),hoursSkipped:l().int().nonnegative(),skippedByReason:c7,bounded:A(),byDevice:w(u7).readonly()}),p7=d({rows:l().int().nonnegative()}).nullable(),m7=d({toLocationId:o().min(1),fromLocationId:o().optional(),mode:OR.optional()}),f7=N(["orphans","debug-media","ghost-ledger","done","failed","cancelled"]),h7=d({includeDebugMedia:A().optional()}),g7=d({jobId:o(),phase:f7,includeDebugMedia:A(),orphansReclaimed:l().int().nonnegative(),orphanBytesReclaimed:l().int().nonnegative(),debugMediaReclaimed:l().int().nonnegative(),debugMediaBytesReclaimed:l().int().nonnegative(),ghostsForgotten:l().int().nonnegative(),ghostBytesForgotten:l().int().nonnegative(),detail:o().nullable(),cancelRequested:A(),startedAt:l(),updatedAt:l(),finishedAt:l().nullable(),error:o().nullable()}),v7=d({jobId:o().optional()}),y7=["active","readonly","drain","disabled"],b7=N(y7);N(["normal","never","drain"]);var PR=o().regex(/^[a-z][a-zA-Z0-9-]*$/),$a=d({id:o().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/),type:o(),displayName:o().min(1),providerId:o().min(1),config:X(o(),J()),nodeId:o().optional(),isSystem:A().default(!1),enabled:A().optional(),mode:b7.optional(),capacity:d({totalBytes:l(),availableBytes:l()}).nullable().optional(),owned:d({bytes:l().int().nonnegative(),measuredAtMs:l().int().nonnegative()}).optional(),createdAt:l(),updatedAt:l()});d({isDefault:A().optional()});var S7=d({locationId:o(),startedAtMs:l(),startBytes:l(),bytesRemaining:l(),drained:A(),estimatedEmptyAtMs:l().nullable()}),Vi=tt([PR,o().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/)]),x7=N(["local-path","cap-mediated"]),k7=d({id:o().regex(/^[a-z][a-zA-Z0-9-]*$/,{message:"id must start with a lowercase letter and contain only letters, digits, or hyphens"}),displayName:o().min(1,{message:"displayName must not be empty"}),description:o().optional(),cardinality:N(["single","multi"]),access:x7.optional(),defaultsTo:o().optional(),defaultRoot:N(["data","media","backup"]).optional()}),w7=d({inputFps:l(),outputFps:l(),avgDecodeTimeMs:l(),droppedFrames:l(),lagMs:l().optional(),effectiveFps:l().optional(),adaptiveFps:l().optional()}),Iw=d({codec:o(),maxFps:l().default(0),outputFormat:N(["jpeg","rgb","bgr","yuv420","gray"]).default("jpeg"),scale:l().default(1),width:l().optional(),height:l().optional(),deviceId:l().int().nonnegative().optional(),tag:o().optional(),frameSink:N(["callback","shm"]).default("callback"),debug:A().optional()}),M7=N(["info","warn","error"]),DR=d({name:o().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/,"a channel name is dotted lower-kebab, e.g. area.thing"),description:o().min(1),defaultLevel:M7,perDevice:A()}),C7=d({channel:o().min(1),armedUntilMs:l(),deviceIds:w(l().int()).readonly().nullable()}),Rm=["onnx","coreml","openvino","tflite","pt","gguf"],js=d({url:o(),sizeMB:l(),isDirectory:A().optional(),files:w(o()).readonly().optional(),runtimes:w(N(["node","python"])).readonly().optional()}),A7=d({url:o(),filename:o(),sizeMB:l()}),E7=d({onnx:js.optional(),coreml:js.optional(),openvino:js.optional(),tflite:js.optional(),pt:js.optional(),gguf:js.optional()}),zR=d({family:o(),tier:o(),precision:N(["fp32","int8"]).optional(),optimization:N(["standard","fast"]).optional(),resolution:l().int().positive().optional()}),R7=["camstack","frigate","scrypted","custom"],LR=N(R7),Pb=d({id:o(),name:o(),description:o(),formats:E7,inputSize:d({width:l(),height:l()}),inputChannels:l().int().positive().optional(),labels:w(RR).readonly(),inputLayout:N(["nchw","nhwc"]).optional(),inputNormalization:N(["zero-one","imagenet","none"]).optional(),outputProbabilities:A().optional(),preprocessMode:N(["letterbox","resize"]).optional(),postprocessor:si().optional(),faceAlignment:A().optional(),extraFiles:w(A7).readonly().optional(),legacy:A().optional(),metrics:d({map50:l().optional(),p95LatencyMs:X(o(),l()).optional()}).optional(),license:o().optional(),group:zR.optional(),provider:LR.optional(),classMap:IR.optional()}),I7=kt("format",[d({format:$("openvino"),precisions:w(N(["fp16","int8"])).min(1).readonly()}),d({format:$("coreml")})]),T7=d({id:o().regex(/^[a-zA-Z0-9._-]+$/),name:o(),labels:w(RR).readonly(),inputSize:d({width:l(),height:l()}),inputLayout:N(["nchw","nhwc"]).optional(),inputNormalization:N(["zero-one","imagenet","none"]).optional(),preprocessMode:N(["letterbox","resize"]).optional(),outputFormat:N(["yolo","ssd","embedding","classification","ocr","segmentation"]),faceAlignment:A().optional(),classMap:IR.optional()}),_7=d({format:N(Rm),precision:N(["fp16","int8"]).optional(),sizeMB:l(),validated:A(),files:w(o()).readonly()}),N7=d({entry:Pb,artifacts:w(_7).readonly()}),ta=class extends Error{position;constructor(e,t){super(e),this.name="ExpressionParseError",this.position=t}},Co=class extends Error{constructor(e){super(e),this.name="ExpressionEvalError"}};function ea(e,t,n){if(typeof e!="number"||!Number.isFinite(e))throw new Co(`${t}: argument ${n+1} must be a finite number`);return e}function Tw(e,t,n){if(typeof e!="string")throw new Co(`${t}: argument ${n+1} must be a string`);return e}function Ta(e,t){if(!Number.isFinite(e))throw new Co(`${t}: produced a non-finite result`);return e}function Qd(e,t){return e.map((n,a)=>ea(n,t,a))}var gc=Number.POSITIVE_INFINITY,qR={min:{minArgs:1,maxArgs:gc,apply:e=>Ta(Math.min(...Qd(e,"min")),"min")},max:{minArgs:1,maxArgs:gc,apply:e=>Ta(Math.max(...Qd(e,"max")),"max")},abs:{minArgs:1,maxArgs:1,apply:e=>Ta(Math.abs(ea(e[0],"abs",0)),"abs")},floor:{minArgs:1,maxArgs:1,apply:e=>Ta(Math.floor(ea(e[0],"floor",0)),"floor")},ceil:{minArgs:1,maxArgs:1,apply:e=>Ta(Math.ceil(ea(e[0],"ceil",0)),"ceil")},sqrt:{minArgs:1,maxArgs:1,apply:e=>Ta(Math.sqrt(ea(e[0],"sqrt",0)),"sqrt")},round:{minArgs:1,maxArgs:2,apply:e=>{const t=ea(e[0],"round",0),n=e.length>1?Math.trunc(ea(e[1],"round",1)):0;if(n<0||n>100)throw new Co("round: digits must be between 0 and 100");const a=10**n;return Ta(Math.round(t*a)/a,"round")}},pow:{minArgs:2,maxArgs:2,apply:e=>Ta(ea(e[0],"pow",0)**ea(e[1],"pow",1),"pow")},clamp:{minArgs:3,maxArgs:3,apply:e=>{const t=ea(e[0],"clamp",0),n=ea(e[1],"clamp",1),a=ea(e[2],"clamp",2);if(n>a)throw new Co("clamp: lower bound is greater than upper bound");return Ta(Math.min(a,Math.max(n,t)),"clamp")}},avg:{minArgs:1,maxArgs:gc,apply:e=>{const t=Qd(e,"avg");return Ta(t.reduce((n,a)=>n+a,0)/t.length,"avg")}},sum:{minArgs:1,maxArgs:gc,apply:e=>Ta(Qd(e,"sum").reduce((t,n)=>t+n,0),"sum")},coalesce:{minArgs:1,maxArgs:gc,apply:e=>{for(const t of e)if(t!==null)return t;return null}},age:{minArgs:2,maxArgs:2,apply:e=>Ta(ea(e[0],"age",0)-ea(e[1],"age",1),"age")},convert:{minArgs:3,maxArgs:3,apply:(e,t)=>{const n=ea(e[0],"convert",0),a=Tw(e[1],"convert",1).trim(),s=Tw(e[2],"convert",2).trim();if(t.convert){const p=t.convert(n,a,s);if(p===null)throw new Co(`convert: cannot convert '${a}' to '${s}'`);return Ta(p,"convert")}if(a===s)return n;throw new Co("convert: unit conversion table not installed")}}};Object.freeze(Object.assign(Object.create(null),qR));var BR=new Set(Object.keys(qR)),Db=2048,zb=/^[A-Za-z_][A-Za-z0-9_]*$/,O7=new Set(["now","true","false","null"]),j7=new Set(["true","false","null"]);function Oc(e){return e>="0"&&e<="9"}function FR(e){return e>="A"&&e<="Z"||e>="a"&&e<="z"||e==="_"}function P7(e){return FR(e)||Oc(e)}function D7(e){return e===" "||e===" "||e===`
74
- `||e==="\r"||e==="\f"||e==="\v"}function z7(e){if(e.length>2048)throw new ta(`expression too long (${e.length} > ${Db} chars)`,0);const t=[];let n=0;const a=e.length;for(;n<a;){const s=e[n];if(D7(s)){n+=1;continue}if(Oc(s)){const f=n;for(;n<a&&Oc(e[n]);)n+=1;if(n<a&&e[n]==="."){if(n+1>=a||!Oc(e[n+1]))throw new ta("malformed number: decimal point needs a digit",n);for(n+=1;n<a&&Oc(e[n]);)n+=1}const m=e.slice(f,n),h=Number(m);if(!Number.isFinite(h))throw new ta(`malformed number: '${m}'`,f);t.push({type:"number",value:h,pos:f});continue}if(s==="'"||s==='"'){const f=s,m=n;n+=1;let h="",c=!1;for(;n<a;){const x=e[n];if(x==="\\"){const M=n+1<a?e[n+1]:"";if(M==="\\"||M==="'"||M==='"'){h+=M,n+=2;continue}throw new ta(`invalid string escape: '\\${M}'`,n)}if(x===f){c=!0,n+=1;break}h+=x,n+=1}if(!c)throw new ta("unterminated string literal",m);t.push({type:"string",value:h,pos:m});continue}if(FR(s)){const f=n;for(;n<a&&P7(e[n]);)n+=1;const m=e.slice(f,n);j7.has(m)?t.push({type:"keyword",keyword:L7(m),pos:f}):t.push({type:"identifier",name:m,pos:f});continue}const p=n+1<a?e.slice(n,n+2):"";if(p==="<="||p===">="||p==="=="||p==="!="||p==="&&"||p==="||"){t.push({type:"punct",punct:p,pos:n}),n+=2;continue}if(q7(s)){t.push({type:"punct",punct:s,pos:n}),n+=1;continue}throw new ta(`unexpected character '${s}'`,n)}return t.push({type:"eof",pos:a}),t}function L7(e){return e==="true"?"true":e==="false"?"false":"null"}function q7(e){return e==="("||e===")"||e===","||e==="?"||e===":"||e==="+"||e==="-"||e==="*"||e==="/"||e==="%"||e==="!"||e==="<"||e===">"}var B7={"||":1,"&&":2,"==":3,"!=":3,"<":4,"<=":4,">":4,">=":4,"+":5,"-":5,"*":6,"/":6,"%":6};function F7(e){return e==="&&"||e==="||"}function U7(e){return e==="+"||e==="-"||e==="*"||e==="/"||e==="%"||e==="=="||e==="!="||e==="<"||e==="<="||e===">"||e===">="}var H7=class{tokens;pos=0;nodeCount=0;identifiers=new Set;callees=new Set;constructor(e){this.tokens=e}parse(){const e=this.parseTernary(),t=this.peek();if(t.type!=="eof")throw new ta("unexpected trailing input",t.pos);return{ast:e,identifiers:this.identifiers,callees:this.callees,nodeCount:this.nodeCount}}peek(){return this.tokens[this.pos]}next(){return this.tokens[this.pos++]}expectPunct(e){const t=this.peek();if(t.type!=="punct"||t.punct!==e)throw new ta(`expected '${e}'`,t.pos);this.pos+=1}matchPunct(e){const t=this.peek();return t.type==="punct"&&t.punct===e?(this.pos+=1,!0):!1}countNode(){if(this.nodeCount+=1,this.nodeCount>256)throw new ta("expression too complex",this.peek().pos)}parseTernary(){const e=this.parseBinary(1);if(this.matchPunct("?")){const t=this.parseTernary();this.expectPunct(":");const n=this.parseTernary();return this.countNode(),{kind:"conditional",test:e,consequent:t,alternate:n}}return e}parseBinary(e){let t=this.parseUnary();for(;;){const n=this.peek();if(n.type!=="punct")break;const a=B7[n.punct];if(a===void 0||a<e)break;const s=n.punct;this.pos+=1;const p=this.parseBinary(a+1);if(this.countNode(),F7(s))t={kind:"logical",op:s,left:t,right:p};else if(U7(s))t={kind:"binary",op:s,left:t,right:p};else throw new ta(`unexpected operator '${s}'`,n.pos)}return t}parseUnary(){const e=this.peek();if(e.type==="punct"&&(e.punct==="!"||e.punct==="-")){const t=e.punct;this.pos+=1;const n=this.parseUnary();return this.countNode(),{kind:"unary",op:t,operand:n}}return this.parsePrimary()}parsePrimary(){const e=this.next();switch(e.type){case"number":return this.countNode(),{kind:"literal",value:e.value};case"string":return this.countNode(),{kind:"literal",value:e.value};case"keyword":return this.countNode(),{kind:"literal",value:e.keyword==="null"?null:e.keyword==="true"};case"identifier":{const t=this.peek();return t.type==="punct"&&t.punct==="("?this.parseCall(e.name,e.pos):(this.identifiers.add(e.name),this.countNode(),{kind:"identifier",name:e.name})}case"punct":if(e.punct==="("){const t=this.parseTernary();return this.expectPunct(")"),t}throw new ta(`unexpected token '${e.punct}'`,e.pos);case"eof":throw new ta("unexpected end of expression",e.pos)}}parseCall(e,t){if(!BR.has(e))throw new ta(`unknown function '${e}'`,t);this.expectPunct("(");const n=[];if(!this.matchPunct(")"))for(;;){if(n.push(this.parseTernary()),n.length>16)throw new ta(`too many arguments to '${e}'`,t);if(!this.matchPunct(",")){this.expectPunct(")");break}}return this.callees.add(e),this.countNode(),{kind:"call",callee:e,args:n}}};function $7(e){return new H7(z7(e)).parse()}var bo=new Map;function Q7(e){const t=bo.get(e);if(t!==void 0)return bo.delete(e),bo.set(e,t),t;let n;try{n={ok:!0,parsed:$7(e)}}catch(a){n={ok:!1,error:a instanceof ta?a.message:String(a)}}if(bo.set(e,n),bo.size>256){const a=bo.keys().next().value;a!==void 0&&bo.delete(a)}return n}function V7(e){return Q7(e)}function UR(e){const t=Object.keys(e.bindings);if(t.length>32)return`too many bindings (${t.length} > 32)`;for(const s of t){if(!zb.test(s))return`invalid binding name '${s}'`;if(O7.has(s))return`binding name '${s}' is reserved`;if(BR.has(s))return`binding name '${s}' shadows a builtin function`}const n=V7(e.expr);if(!n.ok)return n.error;const a=new Set(t);for(const s of n.parsed.identifiers)if(s!=="now"&&!a.has(s))return`expression references unbound identifier '${s}'`;return null}var G7=d({kind:$("field").optional(),sourceKey:o(),cap:o(),fieldPath:o()}),Z7=d({kind:$("literal"),value:tt([o(),l(),A(),uR()])}),K7=d({kind:$("global"),sourceStableId:o(),cap:o(),fieldPath:o()}),HR=tt([G7,Z7,K7]);d({expr:o().min(1).max(Db),bindings:X(o().regex(zb),HR)}).superRefine((e,t)=>{const n=UR(e);n!==null&&t.addIssue({code:"custom",message:n,path:["expr"]})});var W7=N(["eq","ne","gt","gte","lt","lte","contains","in"]),Y7=d({kind:$("condition"),deviceId:l().int().nonnegative(),cap:o().min(1),fieldPath:o().min(1),operator:W7,value:tt([o(),l(),A(),w(tt([o(),l()]))])}),X7=d({kind:$("expression"),expr:o().min(1).max(Db),bindings:X(o().regex(zb),HR)}).superRefine((e,t)=>{const n=UR(e);n!==null&&t.addIssue({code:"custom",message:n,path:["expr"]})}),vp=mu(()=>kt("kind",[d({kind:$("all"),children:w(vp)}),d({kind:$("any"),children:w(vp)}),d({kind:$("not"),child:vp}),Y7,X7])),J7=kt("kind",[d({kind:$("device-state"),deviceId:l().int().nonnegative(),cap:o().min(1),fieldPath:o().min(1),becomes:tt([o(),l(),A()]).optional(),edge:A().optional(),forMs:l().int().min(0).max(864e5).optional(),debounceMs:l().int().min(0).max(6e5).optional()}),d({kind:$("device-event"),category:o().min(1),deviceId:l().int().nonnegative().optional()}),d({kind:$("schedule"),cron:o().min(1).max(120)}),d({kind:$("manual")})]),eB=kt("kind",[d({kind:$("wait"),seconds:l().min(0).max(300)}),d({kind:$("cap"),deviceId:tt([l().int(),d({$var:o().min(1)})]),cap:o().min(1),method:o().min(1),args:X(o(),J()).optional()}),d({kind:$("code"),code:o().min(1).max(2e4)})]);d({triggers:w(J7),conditions:vp.optional(),actions:w(eB)});var tB=d({id:o(),label:o(),icon:o(),path:o(),remoteName:o(),bundle:o(),section:o().optional(),sectionLabel:o().optional()}),nB=d({addonId:o(),page:tB,bundleUrl:o()}),aB={name:"addon-pages",scope:"system",mode:"singleton",methods:{listPages:b(O(),w(nB).readonly())}},iB=d({id:o(),label:o(),icon:o(),path:o(),remoteName:o(),bundle:o(),section:o().optional(),sectionLabel:o().optional()}),rB={name:"addon-pages-source",scope:"system",mode:"collection",internal:!0,methods:{listPages:b(O(),w(iB).readonly(),{auth:"admin"})}},oB=d({method:N(["GET","POST","PUT","DELETE","PATCH"]),path:o(),access:N(["public","authenticated","admin"]).optional(),description:o().optional()}),sB=d({method:o(),path:o(),params:X(o(),o()),query:X(o(),o()),body:J(),headers:X(o(),o()),user:d({id:o(),username:o(),isAdmin:A()}).optional(),scopedToken:J().optional()}),lB=d({status:l().int(),headers:X(o(),o()),redirectUrl:o().nullable(),body:J().optional(),contentType:o().optional()}),cB={name:"addon-routes",scope:"system",mode:"collection",internal:!0,methods:{getRoutes:b(O(),w(oB)),invoke:b(sB,lB,{kind:"mutation"})},mount:{kind:"skip"}},uB=d({id:o(),label:o(),icon:o(),order:l().optional()}),dB=d({id:o(),title:o(),description:o().optional(),style:N(["card","accordion"]).optional(),defaultCollapsed:A().optional(),columns:tt([$(1),$(2),$(3),$(4)]).optional(),tab:o().optional(),location:N(["settings","top-tab"]).optional(),order:l().optional(),fields:w(dR())}),Ao=d({tabs:w(uB).optional(),sections:w(dB)}),_w=X(o(),J()),Nw=d({success:$(!0)}),pB={name:"addon-settings",scope:"system",mode:"singleton",nodeIdMode:"data",methods:{getGlobalSettings:b(d({addonId:o(),nodeId:o().optional(),overlay:X(o(),J()).optional(),cap:o().optional()}),Ao.nullable()),updateGlobalSettings:b(d({addonId:o(),nodeId:o().optional(),patch:_w}),Nw,{kind:"mutation",auth:"admin"}),getIntegrationSettings:b(d({addonId:o(),nodeId:o().optional()}),Ao.nullable()),getDeviceSettings:b(d({addonId:o(),deviceId:l(),nodeId:o().optional()}),Ao.nullable()),updateDeviceSettings:b(d({addonId:o(),deviceId:l(),nodeId:o().optional(),patch:_w}),Nw,{kind:"mutation",auth:"admin"})}},mB=N(["device-tab","dashboard","integration-detail"]),Ow=N(["xs","sm","md","lg","xl"]),$R=d({remoteName:o(),exposedModule:o(),componentKey:o().optional()}),QR=d({tab:o(),subTab:o().optional(),label:o(),order:l().optional(),kind:$("remote"),remote:$R,stableId:o(),description:o().optional(),icon:o().optional(),bundle:o(),hosts:w(mB).readonly(),requires:d({deviceContext:A().default(!1),integrationContext:A().default(!1)}),preAuth:A().optional().default(!1),defaultSize:Ow.default("md"),allowedSizes:w(Ow).readonly().default(["sm","md","lg"]),defaultColumns:l().int().min(1).max(12).default(6),defaultRows:l().int().min(1).max(12).default(1)}),fB={name:"addon-widgets-source",scope:"system",mode:"collection",internal:!0,methods:{listWidgets:b(O(),w(QR).readonly(),{auth:"admin"})}},hB=QR.extend({addonId:o(),bundleUrl:o()}),gB={name:"addon-widgets",scope:"system",mode:"singleton",methods:{listWidgets:b(O(),w(hB).readonly())}},vB=N(["info","success","warning","error"]),yB=N(["active","in-progress","completed","failed","dismissed"]),bB=d({type:o(),id:o()}),sg=d({id:o(),category:o(),severity:vB,title:o(),message:o(),status:yB,progress:l().optional(),read:A(),createdAt:l(),updatedAt:l(),source:bB.optional(),metadata:X(o(),J()).optional()}),SB={name:"alerts",scope:"system",mode:"singleton",methods:{emit:b(sg,O(),{kind:"mutation"}),update:b(d({alertId:o(),patch:sg.partial()}),O(),{kind:"mutation"}),list:b(d({unreadOnly:A().optional(),limit:l().optional()}).optional(),w(sg).readonly()),getUnreadCount:b(O(),l()),markRead:b(d({alertId:o()}),O(),{kind:"mutation"}),markAllRead:b(O(),O(),{kind:"mutation"}),dismiss:b(d({alertId:o()}),O(),{kind:"mutation"})}},xB={name:"audio-analysis",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[U.Camera],exposesDeviceSettings:!0,methods:{resolveDeviceSettings:b(d({deviceId:l()}),si())},events:{onAudioLevel:To(d({deviceId:l(),rms:l(),dbfs:l()}))}},kB=N(["jpeg","rgb","bgr","yuv420","gray"]),$v=d({data:si(),format:kB,width:l(),height:l(),timestamp:l()}),rr=d({x:l(),y:l(),w:l(),h:l()});d({class:o(),originalClass:o(),score:l(),bbox:rr});var jw=d({data:Ht(Uint8Array),sampleRate:l(),channels:l(),timestamp:l(),deviceId:l().optional()}),wB=d({rms:l(),dbfs:l()}),Qv=d({className:o(),originalClass:o().optional(),score:l()}),MB=d({level:wB,classification:d({labels:w(Qv).readonly(),inferenceMs:l()}).optional(),timestamp:l()}),VR=d({minConfidence:l().min(0).max(1).default(.3),allowedClasses:w(o()).default([])}),CB=d({deviceId:l(),brokerId:o(),ingestNodeId:o(),settings:VR}),AB=d({attached:A(),replaced:A()}),EB=d({detached:A()}),RB=d({labels:w(Qv).readonly(),rawLabels:w(Qv).readonly().optional(),inferenceMs:l()}),IB={name:"audio-analyzer",scope:"system",mode:"singleton",methods:{analyseChunk:b(d({chunk:jw,settings:VR}),MB.nullable(),{kind:"mutation"}),classify:b(jw,RB,{timeoutMs:3e4}),attachDevice:b(CB,AB,{kind:"mutation"}),detachDevice:b(d({deviceId:l()}),EB,{kind:"mutation"}),isReady:b(O(),A()),dispose:b(O(),O(),{kind:"mutation"}),reprobeAudioEngine:b(O(),d({backend:o()}),{kind:"mutation",auth:"admin"})}},Im=N(["f32le","s16le"]),TB=d({codec:o(),canDecode:A(),canEncode:A(),label:o().optional()}),_B=d({codec:o(),sourceSampleRate:l().int().positive(),sourceChannels:l().int().positive(),extraData:Ht(Uint8Array).optional(),targetSampleRate:l().int().positive(),targetChannels:l().int().positive(),targetFormat:Im.optional(),idleMs:l().int().positive().optional(),tag:o().optional()}),NB=d({codec:o(),sourceSampleRate:l().int().positive(),sourceChannels:l().int().positive(),sourceFormat:Im.optional(),targetSampleRate:l().int().positive(),targetChannels:l().int().positive(),bitrateKbps:l().int().positive().optional(),idleMs:l().int().positive().optional(),tag:o().optional()}),OB=d({data:Ht(Uint8Array),sampleRate:l().int().positive(),channels:l().int().positive(),format:Im,pts:l()}),Pw=d({data:Ht(Uint8Array),codec:o(),pts:l(),frameComplete:A()}),jB=d({sessionId:o(),kind:N(["decode","encode"]),codec:o(),sourceSampleRate:l(),sourceChannels:l(),targetSampleRate:l(),targetChannels:l(),format:Im,tag:o().optional(),createdAtMs:l(),lastActivityMs:l(),framesIn:l(),framesOut:l()}),PB={name:"audio-codec",scope:"system",mode:"singleton",preferredProvider:"decoder-nodeav",methods:{listSupportedCodecs:b(O(),w(TB).readonly()),canHandle:b(d({codec:o(),kind:N(["decode","encode"])}),A()),createDecodeSession:b(_B,d({sessionId:o(),nodeId:o()}),{kind:"mutation"}),createEncodeSession:b(NB,d({sessionId:o(),nodeId:o()}),{kind:"mutation"}),closeSession:b(d({sessionId:o(),nodeId:o().optional()}),O(),{kind:"mutation"}),pushEncodedFrame:b(d({sessionId:o(),nodeId:o().optional(),data:Ht(Uint8Array),pts:l().optional()}),O(),{kind:"mutation"}),pullPcm:b(d({sessionId:o(),nodeId:o().optional(),maxCount:l().int().positive().default(8)}),w(OB)),pushPcm:b(d({sessionId:o(),nodeId:o().optional(),data:Ht(Uint8Array),pts:l().optional()}),O(),{kind:"mutation"}),pullEncoded:b(d({sessionId:o(),nodeId:o().optional(),maxCount:l().int().positive().default(8)}),w(Pw)),flushEncode:b(d({sessionId:o(),nodeId:o().optional()}),w(Pw),{kind:"mutation"}),listActiveSessions:b(O(),w(jB).readonly())}},lg=d({userId:o(),username:o(),email:o().optional(),displayName:o().optional(),isAdmin:A().default(!1)}),DB={name:"auth-provider",scope:"system",mode:"collection",internal:!0,methods:{validateCredentials:b(d({username:o(),password:o()}),lg.nullable(),{kind:"mutation"}),getLoginUrl:b(d({state:o()}),o()),handleCallback:b(X(o(),o()),lg,{kind:"mutation"}),validateToken:b(d({token:o()}),lg.nullable())},mount:{kind:"skip"}},zB=d({subId:o(),displayName:o(),description:o().optional(),kind:o(),triggerSupported:A(),restoreSupported:A()}).extend({id:o(),addonId:o(),enabled:A(),retentionCount:l(),label:o().optional(),lastSuccessAt:l().optional(),lastSuccessSizeBytes:l().optional(),cron:o().optional(),nextRunAt:l().optional(),lastAttemptAt:l().optional(),lastError:o().optional()}),LB=d({id:o(),filename:o(),createdAt:l(),sizeBytes:l(),label:o().optional(),locations:w(o()).readonly()}),GR=d({id:o(),destinationId:o().optional(),label:o().optional(),createdAt:l(),sizeBytes:l(),locations:w(o()).optional()}),qB=d({path:o(),kind:N(["file","dir","symlink"]),sizeBytes:l(),mtime:l()}),BB=d({archiveVersion:$(1),createdAt:l(),dataDir:o(),locations:w(o()),entries:w(qB),totalBytes:l(),totalFiles:l()}),FB=d({name:o(),sizeBytes:l(),fileCount:l(),present:A()}),UB=N(["queued","running","succeeded","failed","cancelled"]),HB=N(["queued","building","uploading","done"]),$B=d({id:o(),state:UB,phase:HB,destinationIds:w(o()).readonly(),label:o().optional(),requestedAt:l(),startedAt:l().optional(),finishedAt:l().optional(),stagedBytes:l(),archiveSizeBytes:l().optional(),uploadedBytes:l(),completedDestinationIds:w(o()).readonly(),failedDestinationIds:w(o()).readonly(),error:o().optional(),queuePosition:l().int().min(1).optional()}),QB=d({runId:o(),queued:A(),joined:A(),cancelled:A(),entries:w(GR).readonly()}),Dw=d({id:o(),label:o(),cron:o(),enabled:A(),locationIds:w(o()).readonly(),retentionCount:l().int().min(1).max(1e3),dataSources:w(o()).readonly().optional(),lastAttemptAt:l().optional(),lastSuccessAt:l().optional(),lastError:o().optional(),nextRunAt:l().optional()}),VB={name:"backup",scope:"system",mode:"singleton",methods:{listDestinations:b(O(),w(zB).readonly(),{auth:"admin"}),trigger:b(d({destinations:w(o()).optional(),locations:w(o()).optional(),label:o().optional(),retentionCount:l().int().min(1).max(1e3).optional()}).optional(),QB,{kind:"mutation",auth:"admin"}),listRuns:b(O(),w($B).readonly(),{auth:"admin"}),cancel:b(d({runId:o()}),d({cancelled:A()}),{kind:"mutation",auth:"admin"}),list:b(O(),w(GR).readonly(),{auth:"admin"}),listLocations:b(O(),w(FB).readonly(),{auth:"admin"}),getEntries:b(d({destinationId:o(),backupId:o()}),BB.nullable(),{auth:"admin"}),restore:b(d({destinationId:o(),backupId:o(),locations:w(o()).optional()}),O(),{kind:"mutation",auth:"admin"}),delete:b(d({destinationId:o(),backupId:o()}),O(),{kind:"mutation",auth:"admin"}),listArchives:b(d({destinationId:o()}),w(LB).readonly(),{auth:"admin"}),upsertDestinationPolicy:b(d({locationId:o(),enabled:A(),retentionCount:l().int().min(1).max(1e3),label:o().optional()}),O(),{kind:"mutation",auth:"admin"}),previewSchedule:b(d({cron:o(),count:l().int().min(1).max(20).optional()}),d({ok:A(),error:o().optional(),nextRuns:w(l()).readonly()})),listSchedules:b(O(),w(Dw).readonly(),{auth:"admin"}),upsertSchedule:b(d({id:o().optional(),label:o(),cron:o(),enabled:A(),locationIds:w(o()).readonly(),retentionCount:l().int().min(1).max(1e3),dataSources:w(o()).readonly().optional()}),Dw,{kind:"mutation",auth:"admin"}),deleteSchedule:b(d({id:o()}),O(),{kind:"mutation",auth:"admin"})}},GB=N(["connected","disconnected","connecting","auth-failed","unreachable","error"]),zw=d({id:o(),addonId:o(),name:o(),kind:o(),status:GB,info:X(o(),J()),lastCheckedAt:l().nullable(),error:o().nullable()}),Lw=d({brokerCount:l().int().nonnegative(),connectedCount:l().int().nonnegative()}),ZB=d({addonId:o(),kinds:w(d({kind:o(),label:o()}))}),KB=d({kind:o().optional()}),Vd=d({id:o()}),WB=d({kind:o().min(1),name:o().min(1),id:o().min(1).optional(),settings:X(o(),J())}),YB=d({id:o()}),XB=d({id:o()}),JB=kt("ok",[d({ok:$(!0),latencyMs:l().nonnegative()}),d({ok:$(!1),error:o()})]),yp=X(o(),J()),e9=d({kind:o()}),t9=d({kind:o(),settings:yp}),n9=kt("ok",[d({ok:$(!0),latencyMs:l().nonnegative().optional()}).strict(),d({ok:$(!1),error:o()})]),a9=J().nullable(),i9=d({brokerId:o(),target:X(o(),J()),payload:J().optional()}),r9=d({brokerId:o(),filter:X(o(),J())}),o9=d({subscriptionId:o()}),s9=d({brokerId:o(),subscriptionId:o()}),l9=d({brokerId:o(),key:o()}),c9={name:"broker",scope:"system",mode:"collection",providerKind:"broker",status:{schema:Lw,kind:"poll"},methods:{list:b(KB,w(zw)),get:b(Vd,zw.nullable()),listProviders:b(O(),w(ZB),{auth:"admin"}),add:b(WB,YB,{kind:"mutation",auth:"admin"}),remove:b(XB,O(),{kind:"mutation",auth:"admin"}),testConnection:b(Vd,JB,{kind:"mutation",auth:"admin"}),getSettings:b(Vd,yp.nullable(),{auth:"admin"}),setSettings:b(d({id:o(),settings:yp}),O(),{kind:"mutation",auth:"admin"}),getBrokerConfig:b(Vd,yp.nullable(),{auth:"admin"}),getSettingsSchema:b(e9,a9,{auth:"admin"}),testSettings:b(t9,n9,{kind:"mutation",auth:"admin"}),publish:b(i9,J(),{kind:"mutation",auth:"admin"}),subscribe:b(r9,o9,{kind:"mutation",auth:"admin"}),unsubscribe:b(s9,O(),{kind:"mutation",auth:"admin"}),getState:b(l9,J().nullable()),getStatus:b(O(),Lw)}},u9={name:"camera-pipeline-config",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[U.Camera],exposesDeviceSettings:!0,methods:{}},ZR=d({code:o().min(1),label:o().min(1),recommended:A()}),d9=d({signals:w(ZR),lastFetchedAt:l()}),p9={name:"stream-signals",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:Object.values(U),runtimeState:d9,durability:"session",methods:{listSignals:b(O(),w(ZR).readonly())}},m9=N(["webrtc","hls","mjpeg","rtsp"]),KR=N(["mp4","gif"]),f9=d({kind:KR,handle:o(),nodeId:o(),mime:o(),bytes:l().int(),width:l().int(),height:l().int()}),h9=d({fromTs:l(),toTs:l(),packets:l().int()}),g9=d({media:w(f9).readonly(),coverage:h9,profile:Ut,video:N(["copy","encode"])}),Vv=d({brokerId:o(),url:o(),mutedUrl:o(),enabled:A(),codec:o().optional(),resolution:d({width:l().int().positive(),height:l().int().positive()}).optional()}),v9=d({sessionId:o(),remoteAddr:o(),userAgent:o().nullish(),playing:A(),muted:A(),connectedAt:l(),lastRtpAt:l(),bytesSent:l()}),y9=d({tag:o(),subscribedAt:l(),maxFps:l(),framesDelivered:l(),framesDropped:l()}),b9=d({tag:o(),subscribedAt:l(),chunksDelivered:l()}),S9=N(["alexa","homekit","webrtc-browser","webrtc-mobile","webrtc-whep","rtsp-listen","derived-broker","recording","pipeline","snapshot","warmup","unknown"]),Gv=d({kind:S9,label:o().optional(),media:N(["audio","video","both"]).optional(),targetCodec:o().optional(),transport:N(["passthrough","repacketize","transcode"]).optional(),remoteAddr:o().optional(),userAgent:o().optional(),userId:o().optional(),sessionId:o().optional(),extra:X(o(),o()).optional()}).readonly(),x9=d({id:o(),channel:N(["annexb","rtp"]),attribution:Gv,subscribedAt:l(),packetsDelivered:l()}),k9=d({rtsp:w(v9).readonly(),decoded:w(y9).readonly(),audio:w(b9).readonly(),encoded:w(x9).readonly(),pipeClients:l(),encodedSubscribers:l()});N(["reconnecting","sleeping","offline","disabled","waking"]);var w9=N(["h264","h265","copy"]),M9=N(["aac","opus","pcmu","copy","none"]),C9=d({deviceId:l().int().nonnegative(),video:w9,audio:M9.optional(),profile:Ut.optional(),targetResolution:d({width:l().int().positive(),height:l().int().positive()}).optional(),outputArgs:w(o()).optional(),audioEgress:A().optional(),hostname:o().optional(),tag:o().optional()}),A9=d({url:o(),sentryUrl:o().nullable().optional(),videoCodec:N(["H264","H265"]),audioCodec:o(),resolution:d({width:l().int().positive(),height:l().int().positive()}),transcoded:A(),encoder:o(),pipelineKey:o()}),E9=wR.omit({inputArgs:!0,outputArgs:!0}),R9=N(["tight","relaxed"]),I9=d({deviceId:l().int().nonnegative(),source:kt("kind",[d({kind:$("profile"),profile:Ut}),d({kind:$("cam-stream"),camStreamId:o().min(1)})]),encode:E9,rateControl:R9.optional(),bitstreamFilter:N(["dump_extra","h264_mp4toannexb","hevc_mp4toannexb"]).optional(),publishLocally:A().optional(),pixelFormat:N(["yuv420p","nv12"]).optional(),decodeHwAccel:N(["auto","none","videotoolbox","vaapi","qsv","cuda"]).optional(),hostname:o().optional(),tag:o().optional()}),T9=d({url:o(),pipelineKey:o(),videoCodec:N(["H264","H265"]),resolution:d({width:l().int().positive(),height:l().int().positive()}),transcoded:A(),encoder:o(),decodeHwAccel:o().nullable(),camStreamId:o().nullable()}),_9={name:"stream-broker",scope:"system",mode:"singleton",exposesDeviceSettings:!0,methods:{reportStreamSignal:b(d({deviceId:l().int().nonnegative(),code:o().min(1),at:l().optional()}),d({accepted:A(),reason:N(["woke","hold-extended","not-enabled","no-consumer","unknown-code"])}),{kind:"mutation"}),publishCameraStream:b(d({deviceId:l().int().nonnegative(),camStreamId:o().min(1),kind:Ib,url:o().optional(),codec:o().optional(),resolution:yl.optional(),fps:l().positive().optional(),label:o().optional(),deviceFeatures:w(o()).optional(),autoEligible:A().optional(),profileHint:Ut.optional(),metadata:X(o(),J()).optional(),sourceCamStreamId:o().min(1).optional(),encodeProfile:wR.optional()}),d({success:$(!0)}),{kind:"mutation",auth:"admin"}),retractCameraStream:b(d({deviceId:l().int().nonnegative(),camStreamId:o().min(1)}),d({success:$(!0)}),{kind:"mutation",auth:"admin"}),assignProfile:b(d({deviceId:l().int().nonnegative(),profile:Ut,camStreamId:o().min(1)}),d({success:$(!0)}),{kind:"mutation",auth:"admin"}),unassignProfile:b(d({deviceId:l().int().nonnegative(),profile:Ut}),d({success:$(!0)}),{kind:"mutation",auth:"admin"}),forgetDeviceHardware:b(d({deviceId:l().int().nonnegative()}),d({derivedStreamsDeleted:w(o()).readonly(),assignmentsPurged:A(),probeSnapshotsDropped:l().int().nonnegative(),rtspTokenRowsDeleted:l().int().nonnegative()}),{kind:"mutation",auth:"admin"}),renderPreBufferClip:b(d({deviceId:l(),profile:Ut.optional(),aroundMs:l(),preRollSec:l().min(0).max(20).default(3),postRollSec:l().min(0).max(20).default(5),format:N(["gif","mp4"]).default("gif"),maxWidth:l().int().min(120).max(1920).default(480),fps:l().int().min(1).max(15).default(5),speed:l().min(1).max(8).default(2)}),d({base64:o(),mime:o(),bytes:l().int(),profile:Ut,durationMs:l()}),{kind:"mutation",auth:"admin"}),produceEventMedia:b(d({deviceId:l(),profile:Ut.optional(),aroundMs:l(),preSeconds:l().min(0).max(20).default(4),postSeconds:l().min(0).max(20).default(6),kinds:w(KR).min(1).default(["mp4"]),gifMaxWidth:l().int().min(120).max(1280).default(640),gifFps:l().int().min(1).max(15).default(12),gifSpeed:l().min(1).max(8).default(4),speed:l().min(1).max(8).default(4)}),g9,{kind:"mutation",auth:"admin"}),fetchEventMedia:b(d({handle:o()}),d({base64:o(),mime:o(),bytes:l().int()}).nullable(),{kind:"mutation",auth:"admin"}),listAllCameraStreams:b(O(),w(Uv).readonly()),listAllProfileSlots:b(O(),w(Hv).readonly()),getBrokerStats:b(d({brokerId:o()}),eq),probeStream:b(d({brokerId:o()}),d({probed:A(),summary:o()}),{kind:"mutation",auth:"admin"}),listClients:b(d({brokerId:o()}),k9),killClient:b(d({brokerId:o(),channel:N(["rtsp","decoded","audio"]),handle:o()}),d({killed:A()}),{kind:"mutation",auth:"admin"}),restartProfile:b(d({deviceId:l().int().nonnegative(),profile:Ut}),d({success:A()}),{kind:"mutation",auth:"admin"}),getStreamUrl:b(d({streamId:o(),format:m9}),d({url:o()})),getStreamWithCodec:b(C9,A9,{kind:"mutation",auth:"admin"}),releaseStreamWithCodec:b(d({pipelineKey:o()}),d({released:A(),refcount:l().int().nonnegative()}),{kind:"mutation",auth:"admin"}),acquireEgressTranscode:b(I9,T9,{kind:"mutation",auth:"admin"}),releaseEgressTranscode:b(d({pipelineKey:o()}),d({released:A(),refcount:l().int().nonnegative()}),{kind:"mutation",auth:"admin"}),subscribeAudioChunks:b(Y8,X8,{kind:"mutation"}),pullAudioChunks:b(d({subscriptionId:o(),maxCount:l().int().positive().default(8)}),w(W8).readonly()),unsubscribeAudioChunks:b(d({subscriptionId:o()}),d({released:A()}),{kind:"mutation"}),subscribeFrames:b(Z8,K8,{kind:"mutation"}),pullFrameHandles:b(d({subscriptionId:o(),maxCount:l().int().positive().default(4)}),w(Ji).readonly()),unsubscribeFrames:b(d({subscriptionId:o()}),d({released:A()}),{kind:"mutation"}),setPreBufferDuration:b(d({brokerId:o(),seconds:l().min(0).max(30)}),O(),{kind:"mutation",auth:"admin"}),getPreBufferInfo:b(d({brokerId:o()}),d({configuredSec:l(),bufferedMs:l(),packetCount:l()})),getRtspPort:b(O(),l()),getAllRtspEntries:b(d({hostname:o().optional()}),w(Vv).readonly()),getRtspEntry:b(d({brokerId:o(),hostname:o().optional()}),Vv.nullable()),regenerateRtspToken:b(d({brokerId:o()}),o().nullable(),{kind:"mutation",auth:"admin"}),setRtspEnabled:b(d({brokerId:o(),enabled:A()}),O(),{kind:"mutation",auth:"admin"}),isRtspEnabled:b(d({brokerId:o()}),A()),getDeviceAudioMute:b(d({deviceId:l().int()}),d({muted:A(),appliedBrokers:l().int().nonnegative()})),setDeviceAudioMute:b(d({deviceId:l().int(),muted:A()}),d({muted:A(),appliedBrokers:l().int().nonnegative()}),{kind:"mutation",auth:"admin"})},events:{onCamStreamDemand:To(d({deviceId:l().int().nonnegative(),camStreamId:o(),profile:Ut})),onCamStreamIdle:To(d({deviceId:l().int().nonnegative(),camStreamId:o()})),onRequestStreamSourceRefresh:To(d({deviceId:l().int().nonnegative(),camStreamId:o(),brokerId:o()}))}},qw=N(["h264","h265","hevc","av1","mjpeg","vp8","vp9"]),N9=d({acceptCodecs:w(qw).readonly().optional(),minHeight:l().int().positive().optional(),maxHeight:l().int().positive().optional(),minWidth:l().int().positive().optional(),excludeDerived:A().optional(),requireSiblingCodec:w(qw).readonly().optional(),allowTranscode:A().optional(),requireProfileBound:A().optional()}).readonly(),O9=d({preferredProviders:w(o()).readonly().optional(),resolutionPreference:N(["highest","lowest"]).optional(),targetHeight:l().int().positive().optional()}).readonly(),j9=d({camStreamId:o(),codec:o().optional(),resolution:yl.optional(),transcodes:A(),reason:o(),profile:Ut.optional(),brokerId:o().optional(),url:o().optional(),fps:l().positive().optional(),fpsSource:N(["published","measured"]).optional()}),P9={name:"camera-streams",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[U.Camera],methods:{getCameraStreams:b(d({deviceId:l().int().nonnegative()}),w(Uv).readonly()),getBrokerStreams:b(d({deviceId:l().int().nonnegative()}),w(Hv).readonly()),getRtspEntries:b(d({deviceId:l().int().nonnegative(),hostname:o().optional()}),w(Vv).readonly()),getProfileRtspEntries:b(d({deviceId:l().int().nonnegative(),hostname:o().optional()}),w(tq).readonly()),pickStream:b(d({deviceId:l().int().nonnegative(),requirements:N9,preferences:O9.optional()}),j9.nullable())},events:{onCamStreamsChanged:To(d({deviceId:l().int().nonnegative(),camStreams:w(Uv).readonly()})),onProfileSlotsChanged:To(d({deviceId:l().int().nonnegative(),profileSlots:w(Hv).readonly()}))},runtimeState:d({online:A(),slotStatuses:d({high:gp.optional(),mid:gp.optional(),low:gp.optional()}),slotErrors:d({high:o().optional(),mid:o().optional(),low:o().optional()}),lastChangedAt:l()}),durability:"session"},D9=tt([$("hub"),o().min(1)]),z9=N(["stopped","starting","running","failed"]),Zv=d({name:o().min(1).max(120),code:o().max(2e5),enabled:A(),placement:D9,integrationId:o().optional()}),Ps=Zv.extend({id:o(),createdAt:l(),updatedAt:l(),createdBy:o(),status:z9,lastError:o().optional(),lastChangedAt:l()}),L9=d({ok:A(),error:o().optional(),line:l().optional(),column:l().optional()}),q9={name:"core-blocks",scope:"system",mode:"singleton",methods:{list:b(d({}),d({blocks:w(Ps)}),{auth:"admin"}),get:b(d({blockId:o()}),d({block:Ps.nullable()}),{auth:"admin"}),create:b(d({block:Zv}),d({block:Ps}),{kind:"mutation",auth:"admin",caller:"required"}),update:b(d({blockId:o(),block:Zv.partial()}),d({block:Ps}),{kind:"mutation",auth:"admin",caller:"required"}),delete:b(d({blockId:o()}),d({success:$(!0)}),{kind:"mutation",auth:"admin"}),setEnabled:b(d({blockId:o(),enabled:A()}),d({block:Ps}),{kind:"mutation",auth:"admin"}),restart:b(d({blockId:o()}),d({block:Ps}),{kind:"mutation",auth:"admin"}),compile:b(d({code:o()}),L9,{kind:"mutation",auth:"admin"}),getTypeDefs:b(d({}),d({libs:w(d({filePath:o(),content:o()}))}),{auth:"admin"})}},B9=d({stepId:o(),entry:Pb}),F9={name:"custom-model-registry",scope:"system",mode:"collection",internal:!0,methods:{listModels:b(O(),w(B9).readonly(),{auth:"admin"})}},zr=d({where:X(o(),J()).optional(),whereIn:X(o(),w(J())).optional(),whereBetween:X(o(),pu([J(),J()])).optional(),whereNot:X(o(),J()).optional(),whereNotIn:X(o(),w(J())).optional(),orderBy:d({field:o(),direction:N(["asc","desc"])}).optional(),limit:l().optional(),offset:l().optional()}),Kp=d({where:X(o(),J()).optional(),whereIn:X(o(),w(J())).optional(),whereBetween:X(o(),pu([J(),J()])).optional(),whereNot:X(o(),J()).optional(),whereNotIn:X(o(),w(J())).optional()}),WR=d({as:o().min(1),field:o().min(1),op:N(["sum","min","max"])}),YR=d({count:l().int(),values:X(o(),l().nullable())}),XR=d({id:o(),data:X(o(),J())}),Wp=d({id:o().optional(),data:X(o(),J())}),JR=d({name:o(),type:N(["TEXT","INTEGER","REAL","JSON","BOOLEAN"]),primaryKey:A().optional(),notNull:A().optional(),unique:A().optional(),defaultValue:tt([o(),l(),A()]).optional()}),eI=d({name:o(),columns:w(o()).readonly(),unique:A().optional()}),U9={name:"settings-store",scope:"system",mode:"singleton",methods:{get:b(d({namespace:o().optional(),collection:o(),key:o()}),J()),set:b(d({namespace:o().optional(),collection:o(),key:o(),value:J()}),O(),{kind:"mutation"}),query:b(d({namespace:o().optional(),collection:o(),filter:zr.optional(),columns:w(o()).readonly().optional()}),w(XR).readonly()),upsert:b(d({namespace:o().optional(),collection:o(),conflict:w(o()).readonly(),record:Wp}),d({id:tt([o(),l()])}),{kind:"mutation"}),insert:b(d({namespace:o().optional(),collection:o(),record:d({id:o().optional(),data:X(o(),J())})}),d({id:tt([o(),l()])}),{kind:"mutation"}),insertMany:b(d({namespace:o().optional(),collection:o(),records:w(Wp).readonly()}),d({inserted:l().int()}),{kind:"mutation"}),update:b(d({namespace:o().optional(),collection:o(),id:o(),data:X(o(),J())}),O(),{kind:"mutation"}),delete:b(d({namespace:o().optional(),collection:o(),key:o()}),O(),{kind:"mutation"}),deleteWhere:b(d({namespace:o().optional(),collection:o(),filter:Kp}),d({deleted:l().int()}),{kind:"mutation"}),updateWhere:b(d({namespace:o().optional(),collection:o(),filter:Kp,data:X(o(),J())}),d({updated:l().int()}),{kind:"mutation"}),count:b(d({namespace:o().optional(),collection:o(),filter:zr.optional()}),l()),aggregate:b(d({namespace:o().optional(),collection:o(),fields:w(WR).readonly(),filter:zr.optional()}),YR),histogram:b(d({namespace:o().optional(),collection:o(),field:o(),bucketSize:l().int().positive(),origin:l().int(),filter:zr.optional()}),w(d({bucket:l().int(),count:l().int()})).readonly()),isEmpty:b(d({namespace:o().optional(),collection:o()}),A()),declareCollection:b(d({namespace:o().optional(),collection:o(),columns:w(JR).readonly(),indexes:w(eI).readonly().optional()}),O(),{kind:"mutation"})}},H9=d({engineId:o(),kind:N(["relational","vector"]),displayName:o()}),$9={name:"data-store-provider",scope:"system",mode:"collection",internal:!0,methods:{getEngineInfo:b(O(),H9,{auth:"admin"}),get:b(d({namespace:o().optional(),collection:o(),key:o()}),J(),{auth:"admin"}),set:b(d({namespace:o().optional(),collection:o(),key:o(),value:J()}),O(),{kind:"mutation",auth:"admin"}),query:b(d({namespace:o().optional(),collection:o(),filter:zr.optional(),columns:w(o()).readonly().optional()}),w(XR).readonly(),{auth:"admin"}),insert:b(d({namespace:o().optional(),collection:o(),record:d({id:o().optional(),data:X(o(),J())})}),d({id:tt([o(),l()])}),{kind:"mutation",auth:"admin"}),upsert:b(d({namespace:o().optional(),collection:o(),conflict:w(o()).readonly(),record:Wp}),d({id:tt([o(),l()])}),{kind:"mutation",auth:"admin"}),insertMany:b(d({namespace:o().optional(),collection:o(),records:w(Wp).readonly()}),d({inserted:l().int()}),{kind:"mutation",auth:"admin"}),update:b(d({namespace:o().optional(),collection:o(),id:o(),data:X(o(),J())}),O(),{kind:"mutation",auth:"admin"}),delete:b(d({namespace:o().optional(),collection:o(),key:o()}),O(),{kind:"mutation",auth:"admin"}),deleteWhere:b(d({namespace:o().optional(),collection:o(),filter:Kp}),d({deleted:l().int()}),{kind:"mutation",auth:"admin"}),updateWhere:b(d({namespace:o().optional(),collection:o(),filter:Kp,data:X(o(),J())}),d({updated:l().int()}),{kind:"mutation",auth:"admin"}),count:b(d({namespace:o().optional(),collection:o(),filter:zr.optional()}),l(),{auth:"admin"}),aggregate:b(d({namespace:o().optional(),collection:o(),fields:w(WR).readonly(),filter:zr.optional()}),YR,{auth:"admin"}),histogram:b(d({namespace:o().optional(),collection:o(),field:o(),bucketSize:l().int().positive(),origin:l().int(),filter:zr.optional()}),w(d({bucket:l().int(),count:l().int()})).readonly(),{auth:"admin"}),isEmpty:b(d({namespace:o().optional(),collection:o()}),A(),{auth:"admin"}),declareCollection:b(d({namespace:o().optional(),collection:o(),columns:w(JR).readonly(),indexes:w(eI).readonly().optional()}),O(),{kind:"mutation",auth:"admin"})}},Q9=d({sessionId:o(),slotCount:l().int(),slotByteLength:l().int(),segmentBytes:l().int(),budgetMb:l().int(),framesWritten:l().int(),getFrameHits:l().int(),getFrameMisses:l().int()}),V9={name:"decoder",scope:"system",mode:"singleton",preferredProvider:"decoder-nodeav",methods:{supportsCodec:b(d({codec:o()}),A()),getInfo:b(O(),d({id:o(),name:o(),isPullMode:A().optional(),priority:l().optional(),hwaccel:o().optional(),probedBestHwaccel:o().optional()})),createSession:b(Iw,d({sessionId:o(),nodeId:o()})),destroySession:b(d({sessionId:o()}),O()),pushPacket:b(d({sessionId:o(),packet:V8}),O()),openStream:b(d({sessionId:o(),url:o()}),O()),pullFrames:b(d({sessionId:o(),maxCount:l().default(1),waitMs:l().optional()}),w(Sw)),pullHandles:b(d({sessionId:o(),maxCount:l().default(1),waitMs:l().optional()}),w(Ji)),getFrame:b(d({handle:Ji}),Sw.nullable()),getShmStats:b(d({sessionId:o()}),Q9.nullable()),updateConfig:b(d({sessionId:o(),config:Iw.partial()}),O()),getStats:b(d({sessionId:o()}),w7),listActiveSessions:b(O(),w(d({sessionId:o(),codec:o(),outputFormat:o(),createdAtMs:l()})).readonly()),reprobeHwaccel:b(O(),d({backend:o()}),{kind:"mutation",auth:"admin"})}},G9={name:"detection-pipeline",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[U.Camera],exposesDeviceSettings:!0,methods:{}},gu=d({id:o(),system:o(),uniqueId:o().optional(),raw:X(o(),J()).optional()}),Z9=N(["online","sleeping","offline","unknown"]),sl=mu(()=>d({childNativeId:o(),name:o(),type:N(U),status:Z9,metadata:d({model:o().optional(),serialNumber:o().optional(),uid:o().optional(),rtspChannel:l().int().nonnegative().optional(),isBattery:A().optional(),isDoorbell:A().optional(),isMultifocal:A().optional(),externalLocation:o().optional(),manufacturer:o().optional(),integration:o().optional()}).default({}),alreadyAdopted:A(),adoptedDeviceId:l().int().nonnegative().nullable(),capabilities:w(o()).readonly().optional(),features:w(o()).readonly().optional(),sourceInfo:gu.optional(),children:w(sl).readonly().optional()})),Bw=d({discovered:w(sl),lastDiscoveryAt:l().int().nonnegative().nullable(),lastError:o().nullable()}),K9={name:"device-discovery",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Hub],status:{schema:Bw,kind:"poll"},runtimeState:Bw.extend({lastFetchedAt:l().int().nonnegative()}),durability:"session",methods:{listDiscovered:b(d({deviceId:l().int().nonnegative()}),w(sl).readonly()),refreshDiscovery:b(d({deviceId:l().int().nonnegative()}),w(sl).readonly(),{kind:"mutation",auth:"admin"}),adoptDevice:b(d({deviceId:l().int().nonnegative(),childNativeId:o(),name:o().optional()}),d({deviceId:l().int().nonnegative(),stableId:o()}),{kind:"mutation",auth:"admin"}),releaseDevice:b(d({deviceId:l().int().nonnegative(),childDeviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"admin"})}},tI=d({id:o(),label:o(),isDefault:A().optional()}),W9=d({search:o().optional(),area:o().optional(),manufacturer:o().optional(),adoptedOnly:A().optional(),unadoptedOnly:A().optional()}),nI=d({integrationId:o(),page:l().int().positive().default(1),pageSize:l().int().positive().max(2e4).default(50),filter:o().optional(),filterText:W9.optional()}),aI=d({candidates:w(sl).readonly(),totalCount:l().int().nonnegative(),page:l().int().positive(),pageSize:l().int().positive()}),Y9=d({integrationId:o(),childNativeId:o()}),Kv=d({lastDiscoveryAt:l().int().nonnegative().nullable(),candidateCount:l().int().nonnegative(),adoptedCount:l().int().nonnegative(),lastError:o().nullable()}),X9=d({name:o().min(1).optional(),hiddenChildIds:w(o()).optional()}),Wv=d({integrationId:o(),childNativeIds:w(o()).min(1),filter:o().optional(),importLocations:A().optional(),perCandidate:X(o(),X9).optional()}),iI=d({adopted:w(d({childNativeId:o(),parentDeviceId:l().int().nonnegative(),accessoryDeviceIds:w(l().int().nonnegative()).readonly()})).readonly()}),rI=d({integrationId:o(),camDeviceId:l().int().nonnegative()}),oI=d({camDeviceId:l().int().nonnegative(),resetToSource:A().optional()}),sI=d({changed:A(),rebuiltChildren:l().int().nonnegative(),removedChildren:l().int().nonnegative().optional()}),J9={name:"device-adoption",scope:"system",mode:"singleton",status:{schema:Kv,kind:"poll"},methods:{listCandidateFilters:b(d({integrationId:o()}),d({filters:w(tI)}),{auth:"admin"}),listCandidates:b(nI,aI,{auth:"admin"}),getCandidate:b(Y9,sl.nullable(),{auth:"admin"}),refresh:b(d({integrationId:o()}),Kv,{kind:"mutation",auth:"admin"}),adopt:b(Wv,iI,{kind:"mutation",auth:"admin"}),release:b(rI,O(),{kind:"mutation",auth:"admin"}),resync:b(oI,sI,{kind:"mutation",auth:"admin"})}},eF=N(["unlinked","linked","error"]),tF=d({label:o(),value:o(),secret:A().optional()}),nF=d({qr:o().optional(),fields:w(tF).readonly().optional(),note:o().optional()}),Fw=d({linkState:eF,exposedDeviceCount:l(),error:o().optional(),setup:nF.optional()}),aF=o(),iF=d({deviceId:o(),exposedAs:o().optional(),capabilities:w(o()).optional()}),rF=d({deviceId:o(),capabilities:w(o()).optional()}),oF=d({deviceId:o()}),sF={name:"device-export",scope:"system",mode:"collection",providerKind:"device-export",status:{schema:Fw,kind:"poll"},exposesDeviceSettings:!0,methods:{getStatus:b(O(),Fw),listSupportedDeviceKinds:b(O(),w(aF)),listExposedDevices:b(O(),w(iF)),exposeDevice:b(rF,O(),{kind:"mutation"}),unexposeDevice:b(oF,O(),{kind:"mutation"})}},lF=["map-pin","house","door-open","sofa","utensils","bed-double","bath","briefcase","car","circle-parking","route","trees","umbrella","waves-ladder","fence","package","warehouse","store","sun","radar"],Yp=N(lF),cF=d({locationKey:o(),icon:Yp}),uF=d({locationKey:o(),description:o()}),dF=d({zoneKey:o(),label:o(),icon:Yp.nullable(),locationKeys:w(o())}),pF=d({connected:A(),deviceCount:l(),error:o().optional()});d({externalId:o(),name:o(),type:o(),metadata:X(o(),J()).optional()});var Vs=d({stableId:o(),type:N(U),suggestedName:o(),prefilledConfig:X(o(),J()),sourceInfo:gu.optional(),alreadyOnboarded:A().optional(),onboardedDeviceId:l().optional(),onboardedName:o().optional()}),Xp=d({id:l(),stableId:o(),addonId:o(),type:o(),name:o(),parentDeviceId:l().nullable(),online:A(),features:w(o()),config:X(o(),J()),sourceInfo:gu.optional()}),Yv=d({status:N(["ok","error"]),labels:w(o()).optional(),error:o().optional()}),Uw=J(),mF={name:"device-provider",scope:"system",mode:"collection",methods:{start:b(O(),O(),{kind:"mutation"}),stop:b(O(),O(),{kind:"mutation"}),getStatus:b(O(),pF),getDevices:b(O(),w(d({id:o(),name:o(),type:o()}))),reloadDevice:b(d({stableId:o()}),d({deviceId:l()}),{kind:"mutation",timeoutMs:3*6e4}),supportsDiscovery:b(d({}),A()),discoverDevices:b(d({params:X(o(),J()).optional()}),w(Vs),{kind:"mutation",auth:"admin"}),getDiscoveryParamsSchema:b(d({}),Uw),getManualCreationType:b(d({}),d({deviceType:N(U).nullable()})),adoptDiscoveredDevice:b(d({candidate:Vs}),Xp,{kind:"mutation",auth:"admin"}),supportsManualCreation:b(d({}),A()),getChildCreationSchema:b(d({type:N(U)}),Uw),createDevice:b(d({type:N(U),config:X(o(),J())}),Xp,{kind:"mutation",auth:"admin"}),testCreationField:b(d({type:N(U),key:o(),value:J(),formValues:X(o(),J()).optional()}),Yv,{kind:"mutation",auth:"admin"})}},Lb=d({childKey:o(),section:o(),order:l().optional(),collapsed:A().optional()}),fF=d({unit:o().min(1).optional(),precision:l().int().min(0).max(10).optional()}),qb=d({icon:o().min(1).optional(),label:o().min(1).optional(),unit:o().min(1).optional(),precision:l().int().min(0).max(10).optional(),hidden:A().optional(),perCap:X(o(),fF).optional()}),Hw=d({unit:o().min(1).optional(),precision:l().int().min(0).max(10).optional(),icon:o().min(1).optional()}),Gd=d({id:l(),stableId:o(),addonId:o(),type:N(U),name:o(),location:o().nullable(),disabled:A(),parentDeviceId:l().nullable(),role:o().nullable().optional(),online:A(),probed:A().optional(),features:w(o()),isCamera:A(),config:X(o(),J()),metadata:X(o(),J()).nullable().optional(),sourceInfo:gu.optional(),integrationId:o().optional(),linkDeviceId:l().nullable().optional(),primaryChildEntityId:o().nullable().optional(),childLayout:w(Lb).readonly().optional(),display:qb.optional()}),hF=d({key:o(),value:J(),description:o().optional()}),lI=N(["manual"]),cI=d({deviceId:l(),name:o(),location:o().nullable(),features:w(o()),producesTrackedEvents:A().optional()}),gF=d({deviceId:l(),mode:lI,devices:w(cI)}),cg=d({deviceId:l(),entries:w(d({capName:o(),kind:N(["native","wrapped"]),providerAddonId:o(),providerNodeId:o(),nativeAddonId:o()}))}),vF=d({id:l(),stableId:o(),type:o(),name:o(),location:o().nullable(),disabled:A(),parentDeviceId:l().nullable(),role:o().nullable().optional()}),yF=d({id:l(),stableId:o(),addonId:o(),type:o(),name:o(),userNamed:A().optional(),location:o().nullable(),disabled:A(),parentDeviceId:l().nullable(),metadata:X(o(),J()).nullable().optional(),sourceInfo:gu.optional(),integrationId:o().optional(),linkDeviceId:l().nullable().optional(),primaryChildEntityId:o().nullable().optional(),childLayout:w(Lb).readonly().optional(),role:o().nullable().optional(),display:qb.optional()}),bF=J().nullable(),SF=d({streamId:o(),width:l().optional(),height:l().optional(),codec:o().optional(),fps:l().optional(),bitrateKbps:l().optional()}),xF=d({addonId:o(),stableId:o(),id:l(),type:o(),name:o(),location:o().nullable().optional(),disabled:A().optional(),parentDeviceId:l().nullable(),role:o().nullable().optional(),features:w(o()).optional(),config:X(o(),J())}),kF=d({deviceId:l()}),wF=d({deviceId:l(),data:X(o(),J())}),MF=N(["off","on","not-offered","unreachable"]),CF=d({deviceId:l(),switchId:fu,outcome:MF,detail:o().optional()}),AF=d({sourceId:l(),targetId:l(),switches:w(CF).readonly(),sourceStillLive:w(fu).readonly(),swapped:A()}),EF={name:"device-manager",scope:"system",mode:"singleton",exposesDeviceSettings:!0,methods:{allocateDeviceId:b(d({addonId:o(),stableId:o()}),d({id:l()}),{kind:"mutation"}),migrateDevice:b(d({sourceId:l(),targetId:l()}),AF,{kind:"mutation",auth:"admin",timeoutMs:12*6e4}),registerDevice:b(xF,O(),{kind:"mutation"}),removeDevice:b(kF,O(),{kind:"mutation"}),persistConfig:b(wF,O(),{kind:"mutation"}),loadConfig:b(d({deviceId:l()}),X(o(),J())),loadRuntimeState:b(d({deviceId:l()}),X(o(),J())),loadMeta:b(d({deviceId:l()}),yF.nullable()),setName:b(d({deviceId:l(),name:o()}),O(),{kind:"mutation",auth:"admin"}),setLocation:b(d({deviceId:l(),location:o().nullable()}),O(),{kind:"mutation",auth:"admin"}),setType:b(d({deviceId:l(),type:N(U)}),O(),{kind:"mutation",auth:"admin"}),setIntegrationId:b(d({deviceId:l(),integrationId:o()}),O(),{kind:"mutation",auth:"admin"}),setLinkDeviceId:b(d({deviceId:l(),linkDeviceId:l().nullable()}),O(),{kind:"mutation",auth:"admin"}),setPrimaryChildEntityId:b(d({deviceId:l(),primaryChildEntityId:o().nullable()}),O(),{kind:"mutation",auth:"admin"}),setChildLayout:b(d({deviceId:l(),childLayout:w(Lb).readonly()}),O(),{kind:"mutation",auth:"admin"}),setDisplay:b(d({deviceId:l(),display:qb.nullable()}),O(),{kind:"mutation",auth:"admin"}),getRoleDisplayDefaults:b(d({}),d({defaults:X(o(),Hw)}),{kind:"query"}),setRoleDisplayDefaults:b(d({defaults:X(o(),Hw)}),O(),{kind:"mutation",auth:"admin"}),getWireableFields:b(d({deviceId:l(),includeSynthesizable:A().optional()}),d({caps:w(d({cap:o(),fields:w(d({path:o(),kind:N(["string","number","boolean","enum"]),enumValues:w(o()).optional(),item:A().optional()})).readonly(),itemArray:d({path:o(),keyField:o()}).optional()})).readonly()}),{kind:"query"}),setRole:b(d({deviceId:l(),role:o().nullable()}),O(),{kind:"mutation",auth:"admin"}),applyInitialMeta:b(d({deviceId:l(),name:o().optional(),location:o().nullable().optional(),type:N(U).optional(),integrationId:o().optional(),linkDeviceId:l().nullable().optional(),role:o().nullable().optional()}),O(),{kind:"mutation",auth:"admin"}),setMetadata:b(d({deviceId:l(),patch:X(o(),J())}),O(),{kind:"mutation",auth:"admin"}),listLocations:b(O(),w(o())),addLocation:b(d({name:o()}),O(),{kind:"mutation",auth:"admin"}),removeLocation:b(d({name:o(),cascade:A().optional()}),O(),{kind:"mutation",auth:"admin"}),renameLocation:b(d({from:o(),to:o()}),d({moved:l()}),{kind:"mutation",auth:"admin"}),listLocationIcons:b(O(),w(cF)),setLocationIcon:b(d({location:o(),icon:Yp.nullable()}),O(),{kind:"mutation",auth:"admin"}),listLocationDescriptions:b(O(),w(uF)),setLocationDescription:b(d({location:o(),description:o().max(400).nullable()}),O(),{kind:"mutation",auth:"admin"}),listSiteZones:b(O(),w(dF)),setSiteZone:b(d({name:o(),icon:Yp.nullable().optional()}),O(),{kind:"mutation",auth:"admin"}),removeSiteZone:b(d({name:o()}),O(),{kind:"mutation",auth:"admin"}),renameSiteZone:b(d({from:o(),to:o()}),O(),{kind:"mutation",auth:"admin"}),setLocationZone:b(d({location:o(),zone:o().nullable()}),O(),{kind:"mutation",auth:"admin"}),setDisabled:b(d({deviceId:l(),disabled:A()}),O(),{kind:"mutation",auth:"admin"}),listPersistedByAddon:b(d({addonId:o()}),w(vF)),listAll:b(d({addonId:o().optional(),projection:N(["full","slim"]).optional(),isCamera:A().optional(),deviceIds:w(l()).optional()}),w(Gd)),getDevice:b(d({deviceId:l()}),Gd.nullable()),getChildren:b(d({parentDeviceId:l()}),w(Gd)),getChildrenBatch:b(d({parentDeviceIds:w(l()).max(256)}),X(o(),w(Gd))),getLinkedDevices:b(d({deviceId:l()}),d({mode:lI,devices:w(cI)})),getLinkedDevicesBatch:b(d({deviceIds:w(l())}),w(gF)),getStreamSources:b(d({deviceId:l()}),w(Q8)),getConfigSchema:b(d({deviceId:l()}),w(hF)),getSettingsSchema:b(d({deviceId:l()}),bF),updateConfig:b(d({deviceId:l(),values:X(o(),J())}),d({success:$(!0)}),{kind:"mutation",auth:"admin"}),enable:b(d({deviceId:l()}),d({success:$(!0)}),{kind:"mutation",auth:"admin"}),disable:b(d({deviceId:l()}),d({success:$(!0)}),{kind:"mutation",auth:"admin"}),remove:b(d({deviceId:l()}),d({success:$(!0)}),{kind:"mutation",auth:"admin"}),removeByIntegration:b(d({integrationId:o()}),d({removed:l()}),{kind:"mutation",auth:"admin"}),getStreamProfileMap:b(d({deviceId:l()}),X(o(),o().nullable())),setStreamProfileMap:b(d({deviceId:l(),profileMap:X(o(),o().nullable())}),d({success:$(!0)}),{kind:"mutation",auth:"admin"}),probeStreams:b(d({deviceId:l()}),w(SF),{kind:"mutation",auth:"admin"}),getBindings:b(d({deviceId:l()}),cg),getBindingsBatch:b(d({deviceIds:w(l())}),w(cg)),getAllBindings:b(d({}),w(cg)),setWrapperActive:b(d({deviceId:l(),capName:o(),wrapperAddonId:o(),active:A()}),O(),{kind:"mutation",auth:"admin"}),listWrappersForCap:b(d({capName:o()}),w(o())),listBindableCapsForDeviceType:b(d({deviceType:o()}),w(d({capName:o(),wrappers:w(o())}))),getDeviceSettingsAggregate:b(d({deviceId:l()}),Ao.nullable()),getDeviceLiveInfoAggregate:b(d({deviceId:l()}),Ao.nullable()),getDeviceAggregate:b(d({deviceId:l()}),d({settings:Ao.nullable(),live:Ao.nullable()})),runDeviceAction:b(d({deviceId:l().int().nonnegative(),action:o().min(1),input:J()}),J(),{kind:"mutation"}),updateDeviceField:b(d({deviceId:l(),writerCapName:o(),writerAddonId:o(),key:o(),value:J()}),d({success:$(!0)}),{kind:"mutation",auth:"admin"}),updateDeviceFieldsBatch:b(d({deviceId:l(),changes:w(d({writerCapName:o(),writerAddonId:o(),key:o(),value:J()}))}),d({success:$(!0),failures:w(d({writerCapName:o(),writerAddonId:o(),error:o()}))}),{kind:"mutation",auth:"admin"}),discoverDevices:b(d({addonId:o()}),w(Vs),{kind:"mutation",auth:"admin"}),adoptDevice:b(d({addonId:o(),candidate:Vs,integrationId:o().optional()}),Xp,{kind:"mutation",auth:"admin"}),getCreationSchema:b(d({addonId:o(),type:N(U)}),J().nullable()),createDevice:b(d({addonId:o(),type:N(U),config:X(o(),J()),integrationId:o().optional()}),Xp,{kind:"mutation",auth:"admin"}),testCreationField:b(d({addonId:o(),type:N(U),key:o(),value:J(),formValues:X(o(),J()).optional()}),Yv,{kind:"mutation",auth:"admin"}),adoptionListCandidateFilters:b(d({addonId:o(),integrationId:o()}),d({filters:w(tI)}),{auth:"admin"}),adoptionListCandidates:b(nI.extend({addonId:o()}),aI,{auth:"admin"}),adoptionRefresh:b(d({addonId:o(),integrationId:o()}),Kv,{kind:"mutation",auth:"admin"}),adoptionAdopt:b(Wv.extend({addonId:o()}),iI,{kind:"mutation",auth:"admin"}),adoptionRelease:b(rI.extend({addonId:o()}),O(),{kind:"mutation",auth:"admin"}),adoptionStartJob:b(Wv.extend({addonId:o()}),d({jobId:o()}),{kind:"mutation",auth:"admin"}),adoptionListJobs:b(d({addonId:o(),integrationId:o().optional()}),w(Aq).readonly(),{auth:"admin"}),adoptionCancelJob:b(d({jobId:o()}),d({cancelled:A()}),{kind:"mutation",auth:"admin"}),adoptionResync:b(oI,sI,{kind:"mutation",auth:"admin"}),discoveryProviders:b(d({}),d({providers:w(d({addonId:o(),label:o()})).readonly()}),{auth:"admin"}),discoverAllProviders:b(d({}),d({groups:w(d({addonId:o(),label:o(),candidates:w(Vs).readonly(),error:o().nullable()})).readonly()}),{kind:"mutation",auth:"admin"}),discoverProvider:b(d({addonId:o(),params:X(o(),J()).optional()}),d({candidates:w(Vs).readonly()}),{kind:"mutation",auth:"admin"}),providerCreationType:b(d({addonId:o()}),d({deviceType:N(U).nullable()}),{auth:"admin"}),providerDiscoveryParamsSchema:b(d({addonId:o()}),J(),{auth:"admin"}),testField:b(d({deviceId:l(),key:o(),value:J()}),Yv,{kind:"mutation",auth:"admin"}),getDeviceStatusAggregate:b(d({deviceId:l(),caps:w(o()).readonly().optional()}),X(o(),J().nullable())),getDeviceStatusAggregateBatch:b(d({deviceIds:w(l()).readonly(),caps:w(o()).readonly().optional()}),X(o(),X(o(),J().nullable())))}},RF={name:"device-state",scope:"system",mode:"singleton",methods:{getSnapshot:b(d({deviceId:l()}),X(o(),X(o(),J()))),getCapSlice:b(d({deviceId:l(),capName:o()}),X(o(),J()).nullable()),getAllSnapshots:b(d({}),X(o(),X(o(),X(o(),J())))),setCapSlice:b(d({deviceId:l(),capName:o(),slice:X(o(),J())}),O(),{kind:"mutation"})},events:{onChanged:To(d({deviceId:l(),capName:o(),slice:X(o(),J())}))}},$w=d({embedding:w(l()),inferenceMs:l()}),IF=d({modelId:o(),embeddingDim:l(),ready:A()}),TF={name:"embedding-encoder",scope:"system",mode:"collection",internal:!0,methods:{encode:b(d({crop:Ht(Uint8Array),width:l(),height:l()}),$w,{auth:"admin"}),encodeText:b(d({text:o()}),$w,{auth:"admin"}),getInfo:b(O(),IF,{auth:"admin"})}},_F=d({reason:o(),count:l().int().nonnegative()}),uI=d({family:o(),deviceId:l().int().positive(),variant:o().optional(),sinceMs:l(),atMs:l(),attempts:l().int().nonnegative(),succeeded:l().int().nonnegative(),reasons:w(_F).readonly()}),NF={name:"failure-contribution",scope:"system",mode:"collection",internal:!0,methods:{list:b(O(),w(uI).readonly())},mount:{kind:"skip"}},OF=d({name:o(),path:o()}),jF=d({path:o(),entries:w(OF).readonly(),freeBytes:l(),totalBytes:l()}),PF={name:"filesystem-browse",scope:"system",mode:"singleton",internal:!0,methods:{listAllowedRoots:b(O(),w(o()).readonly(),{auth:"admin"}),browse:b(d({path:o()}),jF,{auth:"admin"}),createDir:b(d({path:o()}),d({path:o()}),{kind:"mutation",auth:"admin"})}},zc=6e5,DF=60*6e4,zF=d({inputTokens:l(),outputTokens:l()}),LF=N(["timeout","rate-limited","auth","refusal","bad-request","unavailable","no-profile","budget-exceeded","adapter-error"]),qF=d({ok:$(!0),text:o(),model:o(),usage:zF,truncated:A(),latencyMs:l()}),BF=d({ok:$(!1),code:LF,message:o(),retryAfterMs:l().optional()}),bp=kt("ok",[qF,BF]),dI=d({bytes:Ht(Uint8Array),mimeType:o()}),pI=d({enabled:A().default(!1),maxAttempts:l().int().min(1).max(5).default(1)}),Bb=d({addonId:o().optional(),profileId:o().optional(),consumer:o(),system:o().optional(),prompt:o(),jsonSchema:X(o(),J()).optional(),maxTokens:l().int().positive().optional(),temperature:l().optional(),topP:l().min(0).max(1).optional(),topK:l().int().positive().optional(),timeoutMs:l().int().positive().optional(),retry:pI.optional(),requestId:o().optional()}),FF=d({url:o(),filename:o(),sizeBytes:l(),sha256:o().optional()}),Tm=kt("kind",[d({kind:$("catalog"),catalogId:o()}),d({kind:$("url"),url:o(),sha256:o().optional(),label:o().optional(),sizeBytes:l().optional(),extraFiles:w(FF).optional()}),d({kind:$("path"),path:o()})]),Fb=d({nodeId:o(),engine:N(["llama-cpp"]),model:Tm,contextSize:l().int().default(4096),gpuLayers:l().int().default(0),threads:l().int().optional(),parallel:l().int().default(1),batchSize:l().int().positive().optional(),ubatchSize:l().int().positive().optional(),flashAttention:A().default(!1),mlock:A().default(!1),noMmap:A().default(!1),cacheTypeK:N(["f32","f16","q8_0","q5_1","q5_0","q4_1","q4_0"]).optional(),cacheTypeV:N(["f32","f16","q8_0","q5_1","q5_0","q4_1","q4_0"]).optional(),extraArgs:w(o()).default([]),autoStart:A().default(!1),idleStopMinutes:l().int().default(30)}),UF=d({phase:N(["downloading","verifying"]),file:o(),fileIndex:l().int(),fileCount:l().int(),downloadedBytes:l(),totalBytes:l().optional()}),Kc=d({nodeId:o(),state:N(["stopped","downloading","starting","ready","crashed","failed"]),pid:l().optional(),port:l().optional(),modelPath:o().optional(),modelId:o().optional(),downloadProgress:l().min(0).max(1).optional(),download:UF.optional(),lastError:o().optional(),crashesInWindow:l(),memoryBytes:l().optional(),vramBytes:l().optional()}),mI=d({file:o(),sizeBytes:l(),catalogId:o().optional(),installedAt:l().optional(),path:o().optional()}),fI=d({nodeId:o(),modelsBytes:l(),freeBytes:l().optional()}),HF=Bb.extend({images:w(dI).optional(),runtime:Fb,timeoutMs:l().int().positive().optional()}),$F={name:"llm-runtime",scope:"system",mode:"singleton",internal:!0,methods:{complete:b(HF,bp,{kind:"mutation",auth:"admin",timeoutMs:zc}),ensureStarted:b(d({runtime:Fb}),Kc,{kind:"mutation",auth:"admin",timeoutMs:zc}),stop:b(d({}),O(),{kind:"mutation",auth:"admin"}),status:b(d({}),Kc,{auth:"admin"}),installModel:b(d({model:Tm}),O(),{kind:"mutation",auth:"admin",timeoutMs:DF}),deleteModel:b(d({file:o()}),O(),{kind:"mutation",auth:"admin"}),listLocalModels:b(d({}),w(mI),{auth:"admin"}),getDiskUsage:b(d({}),fI,{auth:"admin"})}},hI=N(["openai-compatible","openai","anthropic","google","managed-local"]),ug=d({id:o(),name:o(),kind:hI,addonId:o(),enabled:A(),model:o(),baseUrl:o().optional(),apiKey:o().optional(),supportsVision:A(),temperature:l().min(0).max(2).optional(),topP:l().min(0).max(1).optional(),topK:l().int().positive().optional(),maxTokens:l().int().positive().optional(),contextLength:l().int().positive().optional(),systemPrompt:o().optional(),timeoutMs:l().int().positive().default(6e4),connectTimeoutMs:l().int().positive().default(1e4),firstTokenTimeoutMs:l().int().positive().default(12e4),idleTimeoutMs:l().int().positive().default(6e4),retry:pI.default({enabled:!1,maxAttempts:1}),toolsEnabled:A().default(!1),extraHeaders:X(o(),o()).optional(),runtime:Fb.optional()}),QF=J(),VF=d({kind:hI,label:o(),icon:o(),addonId:o(),configSchema:QF}),gI=tt([d({consumer:o()}),d({purpose:N(["text","vision"])})]),GF=d({selector:gI,profileId:o()}),ZF=d({day:o(),consumer:o(),profileId:o(),calls:l(),okCalls:l(),errorCalls:l(),inputTokens:l(),outputTokens:l(),avgLatencyMs:l()}),KF=d({id:o(),label:o(),family:o(),purpose:N(["text","vision"]),url:o(),sha256:o(),sizeBytes:l(),quantization:o(),minRamBytes:l(),contextSizeDefault:l().int(),mmprojUrl:o().optional()}),WF=kt("ok",[d({ok:$(!0),model:Tm,label:o(),repo:o(),quantization:o(),purpose:N(["text","vision"]),totalBytes:l(),extraFilenames:w(o())}),d({ok:$(!1),code:o(),message:o(),candidates:w(o()).optional(),requiredBytes:l().optional()})]),YF=d({nodeId:o(),reachable:A(),status:Kc.optional(),disk:fI.optional(),error:o().optional()}),XF=Bb.extend({images:w(dI).min(1)}),Ds=d({addonId:o(),profileId:o()}),JF={name:"llm",scope:"system",mode:"collection",internal:!1,providerKind:"ai",nodeIdMode:"data",methods:{generate:b(Bb,bp,{kind:"mutation",timeoutMs:zc}),generateVision:b(XF,bp,{kind:"mutation",timeoutMs:zc}),cancel:b(d({addonId:o().optional(),requestId:o()}),O(),{kind:"mutation"}),listProfileKinds:b(d({}),w(VF)),listProfiles:b(d({}),w(ug)),upsertProfile:b(d({profile:ug}),ug,{kind:"mutation",auth:"admin"}),deleteProfile:b(Ds,O(),{kind:"mutation",auth:"admin"}),testProfile:b(Ds,bp,{kind:"mutation",auth:"admin",timeoutMs:zc}),listModels:b(Ds,w(o())),getDefaults:b(d({}),w(GF)),setDefault:b(d({selector:gI,profileId:o().nullable()}),O(),{kind:"mutation",auth:"admin"}),getUsage:b(d({since:l().optional(),until:l().optional(),consumer:o().optional(),profileId:o().optional()}),w(ZF)),listModelCatalog:b(d({}),w(KF)),listRuntimeNodes:b(d({}),w(YF)),listNodeModels:b(d({nodeId:o()}),w(mI)),resolveModelRef:b(d({ref:o(),maxBytes:l().positive().optional()}),WF,{kind:"mutation",auth:"admin"}),installModel:b(d({nodeId:o(),model:Tm}),O(),{kind:"mutation",auth:"admin"}),deleteModel:b(d({nodeId:o(),file:o()}),O(),{kind:"mutation",auth:"admin"}),getRuntimeStatus:b(Ds,Kc),startRuntime:b(Ds,Kc,{kind:"mutation",auth:"admin"}),stopRuntime:b(Ds,O(),{kind:"mutation",auth:"admin"})}},eU=["decode","transcode","recording","streaming","detection"],tU=["measured","accounted","unattributable"],vI=d({role:N(eU),deviceId:l().int().positive().nullable(),attribution:N(tU),unit:o(),pid:l().int().positive().optional(),startedAtMs:l().optional(),cpuSeconds:l().optional(),rssBytes:l().optional()}),nU={name:"load-contribution",scope:"system",mode:"collection",internal:!0,methods:{list:b(O(),w(vI).readonly())},mount:{kind:"skip"}},aU=d({armed:l().int().min(0),unknown:w(o()).readonly()}),iU={name:"log-channels",scope:"system",mode:"collection",internal:!0,methods:{list:b(O(),w(DR).readonly()),apply:b(d({windows:w(C7).readonly()}),aU,{kind:"mutation"})},mount:{kind:"skip"}},yI=N(["debug","info","warn","error"]),Qw=d({timestamp:qv(),level:yI,scope:w(o()),message:o(),meta:X(o(),J()).optional(),tags:X(o(),o()).optional()}),rU={name:"log-destination",scope:"system",mode:"collection",internal:!0,methods:{write:b(Qw,O(),{kind:"mutation"}),query:b(d({scope:w(o()).optional(),level:yI.optional(),since:qv().optional(),until:qv().optional(),limit:l().optional(),tags:X(o(),o()).optional()}),w(Qw).readonly())},mount:{kind:"skip"}},Ub=N(["primary","second-factor"]),oU=d({kind:$("redirect"),id:o(),label:o(),icon:o().optional(),startUrl:o(),stage:Ub}),sU=d({kind:$("widget"),id:o(),addonId:o(),bundle:o(),remote:$R,stage:Ub}),lU=d({kind:$("passkey"),id:o(),label:o(),stage:Ub,rpId:o(),origin:o().nullable()}),cU=kt("kind",[oU,sU,lU]),uU={name:"login-method",scope:"system",mode:"collection",internal:!0,methods:{getLoginMethods:b(O(),w(cU).readonly())},mount:{kind:"skip"}},dU=d({total:l(),user:l(),system:l(),irq:l(),nice:l(),loadAvg:pu([l(),l(),l()]),cores:l()}),pU=d({percent:l(),totalBytes:l(),usedBytes:l(),availableBytes:l(),swapUsedBytes:l(),swapTotalBytes:l()}),mU=d({readBytes:l(),writeBytes:l(),readOps:l(),writeOps:l(),timestampMs:l()}),fU=d({rxBytes:l(),txBytes:l(),rxPackets:l(),txPackets:l(),rxErrors:l(),txErrors:l(),timestampMs:l()}),bI=d({utilization:l(),model:o(),memoryUsedBytes:l(),memoryTotalBytes:l(),temperature:l().nullable()}),hU=d({openFds:l(),threadCount:l(),activeHandles:l(),activeRequests:l()}),Vw=d({avg10:l(),avg60:l(),avg300:l()}),dg=d({some:Vw,full:Vw.nullable()}),Gw=d({cpu:dU,memory:pU,gpu:bI.nullable(),network:fU,disk:mU,pressure:d({cpu:dg.nullable(),memory:dg.nullable(),io:dg.nullable()}),process:hU,cpuTemperature:l().nullable(),timestampMs:l()}),gU=d({path:o(),totalBytes:l(),usedBytes:l(),availableBytes:l(),percent:l()}),Zw=d({pid:l(),cpu:l(),memory:l(),privateBytes:l().optional(),sharedBytes:l().optional()}),vU=d({addonId:o(),nodeId:o(),role:N(["hub","worker"]),pid:l(),state:N(["starting","running","stopping","stopped","crashed"]),uptimeSec:l()}),yU=d({pid:l(),ppid:l(),pgid:l(),classification:N(["root","managed","system"]),addonId:o().nullable(),nodeId:o().nullable(),command:o(),cpuPercent:l(),memoryRssBytes:l(),cpuMainPercent:l().nullable(),cpuGcPercent:l().nullable(),threadCount:l().nullable(),uptimeSec:l()}),bU=d({source:N(["cgroup-v2","cgroup-v1"]),currentBytes:l(),limitBytes:l().nullable(),anonBytes:l().nullable(),fileBytes:l().nullable(),shmemBytes:l().nullable(),slabBytes:l().nullable(),gpuShmemBytes:l().nullable()}).extend({atMs:l()}),SU=d({atMs:l(),samples:l().int(),cpuMainPercent:l().nullable(),cpuMainPercentMin:l().nullable(),cpuGcPercent:l().nullable(),cpuGcPercentMin:l().nullable(),cpuLifetimePercent:l(),cpuLifetimePercentMin:l(),memoryRssBytes:l(),memoryRssBytesMin:l(),processCount:l().int(),processCountMin:l().int()}),xU=d({key:o(),kind:N(["addon","root","unattributed"]),points:w(SU).readonly()}),kU=d({nodeId:o(),series:w(xU).readonly(),containerMemory:w(bU).readonly(),bucketMs:l(),retainedSamples:l(),oldestAtMs:l().nullable(),cadenceMs:l(),durable:A()}),wU=d({forNodeId:o(),sinceMs:l().optional(),maxPoints:l().int().positive().optional()}),MU=d({cpuPercent:l(),memoryPercent:l(),memoryUsedMB:l(),memoryTotalMB:l(),diskPercent:l().optional(),temperature:l().optional(),gpuPercent:l().optional(),gpuMemoryPercent:l().optional()}),CU={name:"metrics-provider",scope:"system",mode:"singleton",methods:{collectSnapshot:b(O(),Gw),getCached:b(O(),Gw.nullable()),getCurrent:b(O(),MU),getDiskSpace:b(d({dirPath:o()}),gU),getGpuInfo:b(O(),bI.nullable()),getCpuTemperature:b(O(),l().nullable()),getProcessStats:b(d({pids:w(l())}),w(Zw)),listAddonInstances:b(O(),w(vU).readonly()),getAddonStats:b(d({addonId:o()}),Zw.nullable()),listNodeProcesses:b(O(),w(yU).readonly()),getLoadSeries:b(wU,kU)}},AU=d({sourceUrl:o(),metadata:T7,targets:w(I7).min(1).readonly(),calibrationRef:o().optional(),sessionId:o().optional()}),EU={name:"model-convert",scope:"system",mode:"singleton",internal:!0,methods:{convert:b(AU,N7,{kind:"mutation",auth:"admin",timeoutMs:6e5})}},RU=d({nodeId:o(),modelId:o(),format:N(Rm),entry:Pb}),IU=d({ok:A(),sha256:o(),bytes:l(),path:o()}),TU={name:"model-distributor",scope:"system",mode:"singleton",internal:!0,methods:{distributeModel:b(RU,IU,{kind:"mutation",auth:"admin"})}},Jp=d({bbox:rr,pixelCount:l(),intensity:l()}),_U=d({detected:A(),regionCount:l(),regions:w(Jp).readonly(),rawRegions:w(Jp).readonly(),frameWidth:l(),frameHeight:l(),analysisMs:l()}),NU={name:"motion-detection",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[U.Camera],exposesDeviceSettings:!0,methods:{analyze:b(d({deviceId:l(),frame:$v.optional(),frameHandle:Ji.optional()}),_U,{kind:"mutation"}),removeCamera:b(d({deviceId:l()}),O(),{kind:"mutation"}),reset:b(O(),O(),{kind:"mutation"})},events:{onMotion:{data:d({deviceId:l(),detected:A(),regionCount:l()})}}},OU=N(["external","embedded"]),jU=N(["connected","disconnected","auth-failed","unreachable","tls-error"]),PU=d({id:o(),name:o(),url:o(),kind:OU,status:jU,latencyMs:l().nullable(),error:o().optional(),connectedClients:l().int().nonnegative().optional(),lastCheckedAt:l().optional()}),DU=d({url:o(),username:o().optional(),password:o().optional(),clientIdPrefix:o().optional()}),zU=d({name:o().min(1),url:o().regex(/^(mqtt|mqtts|ws|wss):\/\//,"URL must start with mqtt(s):// or ws(s)://"),username:o().optional(),password:o().optional(),clientIdPrefix:o().optional()}),LU=d({id:o()}),Zd=d({id:o()}),qU=kt("ok",[d({ok:$(!0),latencyMs:l()}),d({ok:$(!1),error:o()})]),BU=d({port:l().int().min(1).max(65535).default(1883),allowAnonymous:A().default(!1),username:o().optional(),password:o().optional()}),FU=d({id:o(),url:o()}),Kw=d({brokerCount:l(),embeddedRunning:A()}),UU={name:"mqtt-broker",scope:"system",mode:"collection",providerKind:"broker",status:{schema:Kw,kind:"poll"},methods:{listBrokers:b(O(),w(PU)),getBrokerConfig:b(Zd,DU),addBroker:b(zU,LU,{kind:"mutation"}),removeBroker:b(Zd,O(),{kind:"mutation"}),testConnection:b(Zd,qU,{kind:"mutation"}),startEmbeddedBroker:b(BU,FU,{kind:"mutation"}),stopEmbeddedBroker:b(Zd,O(),{kind:"mutation"}),getStatus:b(O(),Kw)}},em=d({url:o(),hostname:o(),port:l(),protocol:N(["http","https"])}),HU=d({connected:A(),endpoint:em.nullable(),error:o().optional()}),$U=em.extend({id:o(),label:o(),mode:o().optional(),sourcePort:l().optional()}),QU={name:"network-access",scope:"system",mode:"collection",providerKind:"ingress",methods:{start:b(O(),em,{kind:"mutation"}),stop:b(O(),O(),{kind:"mutation"}),getEndpoint:b(O(),em.nullable()),getStatus:b(O(),HU),listEndpoints:b(O(),w($U).readonly())}},SI=N(["image","video","gif","audio","icon"]),VU=d({mediaType:SI,url:o().optional(),bytes:Ht(Uint8Array).optional(),mime:o().optional(),name:o().optional()}).refine(e=>e.url!==void 0||e.bytes!==void 0,{message:"Attachment requires either `url` or `bytes`"}),Hb=N(["text","markdown","html"]),xI=N(["acknowledge","dismiss","silence","snooze","view","play","open","close","lock","unlock","arm","arm-home","arm-away","arm-night","disarm","light","alert","camera"]),GU=d({id:o(),label:o(),url:o().optional(),icon:xI.optional(),destructive:A().optional(),mode:N(["navigate","background"]).optional()}),Ww=d({body:o(),title:o().optional(),format:Hb.default("text"),priority:l().int().min(1).max(5).default(3),level:o().optional(),attachments:w(VU).optional(),clickUrl:o().optional(),actions:w(GU).optional(),sound:o().optional(),ttl:l().optional(),tag:o().optional(),deviceId:l().optional(),eventId:o().optional(),metadata:X(o(),J()).optional()}),ZU=d({id:o(),label:o(),ordinal:l().int().min(1).max(5).nullable(),flags:d({critical:A().optional(),silent:A().optional(),noPush:A().optional()}).optional(),requires:w(o()).optional(),description:o().optional()}),KU=d({mediaTypes:w(SI),mode:N(["url","bytes","both"]),max:l().int().nonnegative(),maxBytes:l().int().positive().optional()}),WU=d({attachments:KU,actions:l().int().nonnegative(),actionIcons:A().optional(),levels:w(ZU),format:w(Hb),clickUrl:A(),sound:A(),ttl:A(),bodyMaxLen:l().int().positive()}),YU=J(),XU=d({kind:o(),label:o(),icon:o(),addonId:o(),iconUrl:o().optional(),iconMediaType:o().optional(),configSchema:YU,supportsDiscovery:A(),caps:WU}),pg=d({id:o(),name:o(),kind:o(),addonId:o(),enabled:A(),config:X(o(),J())}),JU=d({kind:o(),suggestedName:o(),config:X(o(),J())}),eH=d({level:o(),format:Hb,attachmentsSent:l().int().nonnegative(),actionsSent:l().int().nonnegative(),truncated:A(),dropped:w(o())}),kI=d({success:A(),error:o().optional(),renderedAs:eH.optional()}),tH=kI,nH={name:"notification-output",scope:"system",mode:"collection",methods:{listTargetKinds:b(d({}),w(XU)),listTargets:b(d({}),w(pg)),discoverTargets:b(d({kind:o(),config:X(o(),J()).optional()}),w(JU)),send:b(d({targetId:o(),notification:Ww}),kI,{kind:"mutation"}),testTarget:b(d({targetId:o(),sample:Ww.optional()}),tH,{kind:"mutation"}),upsertTarget:b(d({target:pg}),pg,{kind:"mutation"}),deleteTarget:b(d({targetId:o()}),O(),{kind:"mutation"}),setTargetEnabled:b(d({targetId:o(),enabled:A()}),O(),{kind:"mutation"})}},aH=[{id:"person",name:"Person"},{id:"vehicle",name:"Vehicle"},{id:"animal",name:"Animal"},{id:"package",name:"Package"}];new Set(aH.map(e=>e.id));var iH={mapping:{person:"person",bicycle:"vehicle",car:"vehicle",motorcycle:"vehicle",airplane:"vehicle",bus:"vehicle",train:"vehicle",truck:"vehicle",boat:"vehicle",bird:"animal",cat:"animal",dog:"animal",horse:"animal",sheep:"animal",cow:"animal",elephant:"animal",bear:"animal",zebra:"animal",giraffe:"animal",suitcase:"package",backpack:"package",handbag:"package"}},rH=[{id:"speech",name:"Speech"},{id:"scream",name:"Scream / Shout"},{id:"crying",name:"Crying / Baby"},{id:"laughter",name:"Laughter"},{id:"music",name:"Music"},{id:"dog",name:"Dog"},{id:"cat",name:"Cat"},{id:"bird",name:"Bird"},{id:"animal",name:"Animal (other)"},{id:"alarm",name:"Alarm / Siren"},{id:"doorbell",name:"Doorbell / Knock"},{id:"glass_breaking",name:"Glass Breaking"},{id:"gunshot",name:"Gunshot / Explosion"},{id:"vehicle",name:"Vehicle"},{id:"siren",name:"Emergency Siren"},{id:"fire",name:"Fire / Smoke"},{id:"water",name:"Water"},{id:"wind",name:"Wind / Weather"},{id:"door",name:"Door"},{id:"footsteps",name:"Footsteps"},{id:"crowd",name:"Crowd / Chatter"},{id:"telephone",name:"Telephone"},{id:"engine",name:"Engine / Motor"},{id:"tools",name:"Tools / Construction"},{id:"silence",name:"Silence"}],oH={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"}},sH={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"}},wI=new Map;for(const[e,t]of Object.entries(oH.mapping))wI.set(e.toLowerCase(),t);for(const[e,t]of Object.entries(sH.mapping))wI.set(e.toLowerCase(),t);var ia={motion:"#f59e0b",audio:"#06b6d4",person:"#22c55e",vehicle:"#3b82f6",animal:"#f97316",package:"#a855f7",sensor:"#8b5cf6",control:"#10b981",genericDetection:"#64748b"},lH={car:"#f59e0b",truck:"#d97706",bus:"#b45309",motorcycle:"#eab308",bicycle:"#ca8a04",airplane:"#60a5fa",boat:"#2563eb",train:"#1d4ed8",bird:"#14b8a6",dog:"#84cc16",cat:"#f97316",horse:"#a16207",sheep:"#a3a3a3",cow:"#78716c",elephant:"#6b7280",bear:"#7c2d12",zebra:"#404040",giraffe:"#d4a373"};function cH(e){return e.split(/[-_ ]/).filter(t=>t.length>0).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}var vu=new Map;function Vr(e,t,n,a,s){vu.set(e,{kind:e,parentKind:null,level:"macro",category:t,color:n,iconId:a,labelKey:`eventKind.${e}`,label:s})}function Rn(e,t,n,a,s,p){vu.set(e,{kind:e,parentKind:t,level:"sub",category:n,color:a,iconId:s,labelKey:`eventKind.${e}`,label:p})}Vr("motion","motion",ia.motion,"motion","Motion");Vr("audio","audio",ia.audio,"audio","Audio");Vr("person","detection",ia.person,"person","Person");Vr("vehicle","detection",ia.vehicle,"vehicle","Vehicle");Vr("animal","detection",ia.animal,"animal","Animal");Vr("package","package",ia.package,"package","Package");Vr("sensor","sensor",ia.sensor,"sensor","Sensor");Vr("control","control",ia.control,"control","Control");for(const[e,t]of Object.entries(iH.mapping))t!=="vehicle"&&t!=="animal"||vu.has(e)||Rn(e,t,"detection",lH[e]??ia.genericDetection,e,cH(e));Rn("package-delivered","package","package",ia.package,"package","Package delivered");Rn("package-picked-up","package","package",ia.package,"package","Package picked up");Rn("contact","sensor","sensor","#f59e0b","door","Contact");Rn("motion-sensor","sensor","sensor",ia.sensor,"pir","Motion sensor");Rn("smoke","sensor","sensor","#ef4444","smoke","Smoke");Rn("flood","sensor","sensor","#3b82f6","water","Water leak");Rn("gas","sensor","sensor","#ef4444","gas","Gas");Rn("carbon-monoxide","sensor","sensor","#dc2626","smoke","Carbon monoxide");Rn("vibration","sensor","sensor","#eab308","vibration","Vibration");Rn("tamper","sensor","sensor","#f97316","tamper","Tamper");Rn("presence","sensor","sensor","#22c55e","presence","Presence");Rn("enum-sensor","sensor","sensor",ia.sensor,"generic","Sensor state");Rn("device-event","sensor","sensor","#10b981","button","Device event");Rn("lock","control","control","#0ea5e9","lock","Lock");Rn("switch","control","control",ia.control,"switch","Switch");Rn("siren","control","control","#dc2626","siren","Siren");Rn("button","control","control","#10b981","button","Button");Rn("doorbell","control","control","#a855f7","doorbell","Doorbell");for(const e of rH){const t=`audio-${e.id}`;vu.has(t)||Rn(t,"audio","audio",ia.audio,t,e.name)}var $b=Object.freeze(Object.fromEntries(vu)),mg=d({kind:o(),label:o(),parentKind:o().nullable()}),uH=d({videoClasses:w(mg),audioKinds:w(mg),labels:w(mg)});function fg(e,t,n){return{kind:e,label:t,parentKind:n}}function dH(){const e=Object.values($b);return{videoClasses:e.filter(t=>t.category==="detection").map(t=>fg(t.kind,t.label,t.parentKind)),audioKinds:e.filter(t=>t.category==="audio"&&t.level==="sub").map(t=>fg(t.kind,t.label,t.parentKind)),labels:e.filter(t=>t.category==="sensor"||t.category==="control").map(t=>fg(t.kind,t.label,t.parentKind))}}Object.freeze(dH());var pH=N(["disarmed","armed_home","armed_away","armed_night","armed_vacation","armed_custom_bypass","arming","disarming","pending","triggered"]),Qb=N(["home","away","night","vacation","custom_bypass"]),Yw=d({state:pH,availableModes:w(Qb),requiresCode:A(),lastChangedAt:l()}),mH={name:"alarm-panel",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.AlarmPanel],methods:{arm:b(d({deviceId:l().int().nonnegative(),mode:Qb,code:o().min(1).optional()}),O(),{kind:"mutation",auth:"protected"}),disarm:b(d({deviceId:l().int().nonnegative(),code:o().min(1).optional()}),O(),{kind:"mutation",auth:"protected"}),trigger:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"})},status:{schema:Yw,kind:"push"},runtimeState:Yw,durability:"restored",volatileStateFields:["lastChangedAt"]},MI=d({x:l(),y:l()}),ll=d({kind:$("rect"),x:l(),y:l(),width:l(),height:l()}),_m=d({kind:$("polygon"),points:w(MI)}),CI=d({kind:$("grid"),gridWidth:l(),gridHeight:l(),cells:w(A())}),fH=d({kind:$("line"),points:w(MI)});kt("kind",[ll,_m,CI,fH]);var AI=N(["rect","polygon","grid","line"]),hH=d({min:l(),max:l()}),gH=d({width:l(),height:l()}),Vb=N(["immediate","track-end","device-event","package-event","system-event"]),Gb=N(["device-online","device-offline","device-disabled","device-enabled","device-battery-low","device-battery-normal","device-consumable-low","device-consumable-normal","stream-online","stream-offline","node-online","node-offline","node-inference-unavailable","detection-blind","addon-crash-loop","addon-update-available","server-update-available","wrapper-update-available","alarm-triggered","alarm-armed","alarm-disarmed","alarm-arming","alarm-arm-refused","addon-updated","server-updated","export-completed","backup-completed","camera-online","camera-offline","camera-disabled","camera-enabled"]),vH=new Set(["camera-online","camera-offline","camera-disabled","camera-enabled"]);Gb.options.filter(e=>!vH.has(e));var yH=d({kinds:w(Gb).min(1),deviceIds:w(l().int()).min(1).optional(),deviceTypes:w(o().min(1)).min(1).optional(),nodeIds:w(o().min(1)).min(1).optional(),packageNames:w(o().min(1)).min(1).optional()}),EI=1440,bH=d({days:w(l().int().min(0).max(6)).min(1),startMinute:l().int().min(0).max(1439),endMinute:l().int().min(0).max(1439)}),Nm=d({windows:w(bH).min(1),timezone:o().optional(),invert:A().optional()}),SH=d({values:w(o().min(1)),maxDistance:l().int().min(0).max(3).default(1)}),xH=d({zoneId:o().optional(),className:o().optional(),op:N(["became-occupied","became-free",">=","<="]).default("became-occupied"),count:l().int().min(0).default(1),sustainSeconds:l().int().min(0).max(3600).default(15)}),kH=d({labels:w(o().min(1)).min(1).optional(),dbThreshold:l().min(-96).max(0).optional(),hitPercent:l().int().min(1).max(100).default(60),samplingSeconds:l().int().min(1).max(300).default(10),confirmHits:l().int().min(1).max(20).optional(),confirmWindowSec:l().int().min(1).max(60).optional()}),wH=N(["enter","exit","any"]),MH=d({ids:w(o().min(1)).min(1),match:N(["any","all"]).default("any")}),CH=kt("kind",[d({kind:$("wait"),seconds:l().min(0).max(300)}),d({kind:$("cap"),deviceId:l().int(),cap:o().min(1),method:o().min(1),args:X(o(),J()).optional()})]),AH=d({name:o().min(1).max(120),enabled:A(),minDelaySec:l().int().min(0).max(86400).optional(),actions:w(CH).min(1)}),EH=d({id:o().min(1).max(64),label:o().min(1).max(40),sequence:o().min(1).max(120),icon:xI.optional(),destructive:A().optional()}),RH=d({onTrigger:w(AH).optional(),buttons:w(EH).max(8).optional()}),IH=d({deviceId:l().int(),states:w(o().min(1)).min(1)}),TH=d({sceneId:o().min(1),deviceId:l().int().optional(),requiredState:N(["matched","diverged"]),latched:A().optional()}),Zb=d({deviceState:IH.optional(),scene:TH.optional(),devices:w(l()).optional(),classes:w(o().min(1)).optional(),classesExclude:w(o().min(1)).optional(),minConfidence:l().min(0).max(1).optional(),zones:MH.optional(),zonesExclude:w(o().min(1)).optional(),crossing:wH.optional(),labelEquals:w(o().min(1)).optional(),identities:w(o().min(1)).optional(),plates:SH.optional(),identitiesExclude:w(o().min(1)).optional(),minImportance:l().min(0).max(1).optional(),minDwellSeconds:l().min(0).optional(),source:N(["pipeline","onboard","sensor","audio","any"]).optional(),minLabelConfidence:l().min(0).max(1).optional(),eventTypeTokens:w(o().min(1)).optional(),sensorKinds:w(o().min(1)).optional(),packagePhase:N(["delivered","picked-up","both"]).optional(),systemEvent:yH.optional(),customZones:w(_m).optional(),occupancy:xH.optional(),audio:kH.optional()}),RI=d({targetId:o().min(1),params:X(o(),J()).optional()}),_H=N(["cropped","full","boxed"]),II=d({attach:N(["best","best-matching","keyFrame","none"]).default("best"),frame:_H.optional(),zoneCrop:A().optional(),gif:A().optional(),clip:A().optional(),clipPreRollSec:l().int().min(0).max(30).optional(),clipPostRollSec:l().int().min(0).max(30).optional(),clipSpeed:l().min(1).max(8).optional(),profile:Ut.optional()}),NH=N(["shared","per-class"]),TI=d({cooldownSec:l().int().min(0).max(86400).default(60),scope:N(["rule","rule-device"]).default("rule-device"),granularity:NH.optional()}),OH=1e3,jH=2e4,PH=8e3,DH=d({op:N([">=",">","<=","<","=="]),count:l().int().min(0).max(1e3)}),zH=d({enabled:A().default(!1),profileId:o().optional(),prompt:o().max(1e3).optional(),expect:DH.optional(),timeoutMs:l().int().min(OH).max(jH).default(PH),onTimeout:N(["fire","suppress"]).default("fire"),maxImagePx:l().int().min(64).max(2048).default(448)}),tm=d({name:o().min(1).max(200),enabled:A().default(!0),delivery:Vb,conditions:Zb.default({}),schedule:Nm.optional(),targets:w(RI),targetUsers:w(o()).optional(),media:II.default({attach:"best"}),throttle:TI.default({cooldownSec:60,scope:"rule-device"}),template:d({title:o().max(500).optional(),body:o().max(2e3).optional()}).optional(),priority:l().int().min(1).max(5).default(3),ownerUserId:o().optional(),snoozeAllowGlobal:A().optional(),snoozeOptions:w(l().int().min(1).max(EI)).max(4).optional(),actions:RH.optional(),confirm:zH.optional(),waitForEnhancement:A().optional(),groupIdleSec:l().int().min(0).max(600).optional()}),LH=tm.partial().extend({disabledTargetIds:w(o()).optional(),enabled:A().optional(),conditions:Zb.optional(),media:II.optional(),throttle:TI.optional(),priority:l().int().min(1).max(5).optional()}),Kd=tm.extend({id:o(),createdBy:o(),createdAt:l(),updatedAt:l(),disabledTargetIds:w(o()).default([])}),qH=d({recordId:o(),recordKind:N(["object-event","track","device-event","package-event","system-event"]),deviceId:l(),timestamp:l(),wouldFire:A(),failedCondition:o().optional(),className:o().optional(),label:o().optional()}),_I=d({id:o(),group:N(["scope","class","zones","quality","label","schedule","device","package","occupancy","audio","system"]),label:o(),valueType:N(["deviceIdList","stringList","number01","number","sourceSelect","zoneSelection","zoneIdList","schedule","plateMatcher","packagePhase","crossingSelect","polygonDraw","occupancy","audio","deviceState","scene","systemEvent"]),operator:N(["in","notIn","anyOf","allOf","gte","fuzzyIn","withinSchedule"]),appliesTo:w(Vb),phase:o(),description:o().optional(),options:w(d({value:o(),label:o(),hint:o().optional()})).readonly().optional()}),NI=N(["pending","sent","dead"]),BH=N(["object-event","track-end","device-event","package-event","system-event"]),FH=d({className:o(),label:o().optional(),confidence:l().optional(),zones:w(o()),timestamp:l(),systemEvent:d({kind:Gb,subject:o(),title:o(),body:o(),data:X(o(),J())}).optional()}),UH=d({id:o(),ruleId:o(),ruleName:o(),delivery:Vb,targetId:o(),deviceId:l(),recordKind:BH,recordId:o(),trackId:o().optional(),status:NI,attempts:l().int(),createdAt:l(),updatedAt:l(),error:o().optional(),subject:FH,artifactIds:w(o().min(1)).optional()}),HH=d({ruleId:o().optional(),deviceId:l().optional(),status:NI.optional(),since:l().optional(),until:l().optional(),limit:l().int().min(1).max(500).default(100)}),OI=N(["rule","device","all"]),$H=d({scope:OI,ruleId:o().optional(),deviceId:l().int().optional(),classes:w(o().min(1)).min(1).optional(),durationMinutes:l().int().min(1).max(EI),global:A().optional(),summary:A().optional()}),Xw=d({id:o(),userId:o(),scope:OI,ruleId:o().optional(),deviceId:l().int().optional(),classes:w(o().min(1)).min(1).optional(),startedAt:l(),expiresAt:l(),global:A(),summary:A(),digestSentAt:l().optional()});d({snoozeId:o(),targetId:o(),ruleId:o(),ruleName:o(),deviceId:l().int(),count:l().int(),firstAt:l(),lastAt:l()});var jI=d({exitDelaySec:l().int().min(0).max(600),entryDelaySec:l().int().min(0).max(600),triggeredDurationSec:l().int().min(0).max(3600),announceArm:A(),announceTargets:w(o().min(1)).max(16)}),QH=jI.partial(),VH=N(["muted","detection-off","offline"]),GH=d({deviceId:l().int(),reason:VH}),ZH=d({mode:Qb,ruleCount:l().int().min(0),allDevices:A(),deviceIds:w(l().int()),skippedDevices:w(GH).default([])}),Jw=d({deviceId:l().int().nullable(),settings:jI,coverage:w(ZH)}),KH=d({deviceId:l().int().nonnegative().optional(),seconds:l().min(0).max(60),profile:Ut.optional(),ruleId:o(),ruleName:o(),reason:N(["window","occupancy"])}),WH=d({rulesLoaded:A(),asks:w(KH).readonly()}),YH={name:"notification-rules",scope:"system",mode:"singleton",methods:{listRules:b(d({}),d({rules:w(Kd)}),{auth:"admin"}),getRule:b(d({ruleId:o()}),d({rule:Kd.nullable()}),{auth:"admin"}),createRule:b(d({rule:tm}),d({rule:Kd}),{kind:"mutation",auth:"admin",caller:"required"}),updateRule:b(d({ruleId:o(),patch:LH}),d({rule:Kd}),{kind:"mutation",auth:"admin",caller:"required"}),deleteRule:b(d({ruleId:o()}),d({success:$(!0)}),{kind:"mutation",auth:"admin"}),setRuleEnabled:b(d({ruleId:o(),enabled:A()}),d({success:$(!0)}),{kind:"mutation",auth:"admin"}),getClipRetentionAsks:b(d({}),WH,{auth:"admin"}),listDeviceMutes:b(d({}),d({mutedDeviceIds:w(l().int()).readonly()}),{auth:"admin"}),setDeviceMuted:b(d({deviceId:l().int(),muted:A()}),d({success:$(!0)}),{kind:"mutation",auth:"admin"}),testRule:b(d({rule:tm,lookbackMinutes:l().int().min(1).max(1440).default(60)}),d({results:w(qH)}),{kind:"mutation",auth:"admin"}),getConditionCatalog:b(d({}),d({catalog:w(_I),taxonomy:uH.optional()})),getHistory:b(d({filter:HH.default({limit:100})}),d({entries:w(UH)}),{auth:"admin"}),resolveArtifactUrl:b(d({artifactId:o().min(1)}),d({url:o().nullable()}),{auth:"admin"}),listSnoozes:b(d({}),d({snoozes:w(Xw)}),{caller:"required"}),createSnooze:b(d({snooze:$H}),d({snooze:Xw}),{kind:"mutation",caller:"required"}),cancelSnooze:b(d({snoozeId:o()}),d({success:$(!0)}),{kind:"mutation",caller:"required"}),getAlarmConfig:b(d({}),Jw,{auth:"admin"}),setAlarmConfig:b(d({patch:QH}),Jw,{kind:"mutation",auth:"admin"})}},Sp=N(["view","create","delete"]),PI=tt([$("*"),w(o())]),DI=X(o(),tt([$("*"),w(o())])),XH=N(["device","system"]),JH=kt("kind",[d({kind:$("all")}),d({kind:$("ids"),ids:w(l().int()).min(1)}),d({kind:$("types"),types:w(N(U)).min(1)}),d({kind:$("locations"),locations:w(o().min(1)).min(1)})]),e$=d({type:$("device"),selector:JH,access:w(Sp).min(1),includeLinked:A().optional()});function t$(e){if(e===null||typeof e!="object"||Array.isArray(e)||Reflect.get(e,"type")!=="device"||Reflect.get(e,"selector")!==void 0)return e;const t=Reflect.get(e,"targets");return Array.isArray(t)?{type:"device",selector:{kind:"ids",ids:t.map(n=>typeof n=="string"?Number(n):n).filter(n=>typeof n=="number"&&Number.isInteger(n))},access:Reflect.get(e,"access")}:e}var ja=yR(t$,kt("type",[d({type:$("category"),target:XH,access:w(Sp).min(1)}),d({type:$("capability"),target:o(),access:w(Sp).min(1)}),d({type:$("addon"),target:o(),access:w(Sp).min(1)}),e$]));d({id:o(),username:o(),passwordHash:o(),isAdmin:A().default(!1),allowedProviders:PI,allowedDevices:DI,scopes:w(ja).default([]),createdAt:l(),updatedAt:l()});d({id:o(),label:o(),isAdmin:A().default(!1),allowedProviders:PI,allowedDevices:DI,tokenHash:o(),tokenPrefix:o(),createdAt:l(),lastUsedAt:l().optional()});d({id:o(),userId:o(),name:o(),tokenHash:o(),tokenPrefix:o(),scopes:w(ja),expiresAt:l().nullish(),lastUsedAt:l().nullish(),createdAt:l()});var n$=d({integrationId:o(),displayName:o(),requestedScopes:w(ja),allowedRedirectPrefixes:w(o()).min(1),allowedPrivateHostPaths:w(o()).optional(),requiresPkce:A().optional(),hubUrl:o().optional(),refreshTokenTtlSec:tt([l().int().positive(),$("never")]).optional()}),a$={name:"oauth-integration",scope:"system",mode:"collection",internal:!0,methods:{getDescriptor:b(O(),n$,{auth:"admin"})}},i$=d({handle:Ji,cropFrameSpace:d({x:l(),y:l(),w:l(),h:l()})});d({crop:d({left:l(),top:l(),width:l().positive(),height:l().positive()}).optional(),content:d({width:l().int().positive(),height:l().int().positive()}),fit:N(["stretch","contain"]),format:N(["rgb","gray","jpeg"])});var r$=d({registryId:o().min(1),id:o().min(1),width:l().int().positive(),height:l().int().positive(),format:N(["rgb","gray"]),timestamp:l(),capturedAt:l().optional()}),Xv=N(["onnx","coreml","openvino","tflite","pt","gguf"]),Wc=N(["detector","cropper","classifier","refiner","audio-classifier"]),ha=d({runtime:N(["node","python"]),backend:o(),format:Xv,device:o().optional()}),o$=d({id:o(),label:o(),description:o().optional()}),s$=d({engine:ha,devices:w(o$).readonly(),defaultDevice:o()}),Jv=mu(()=>d({addonId:o(),addonName:o(),slot:Wc,inputClasses:w(o()).readonly(),outputClasses:w(o()).readonly(),enabled:A(),modelId:o(),children:w(Jv).readonly(),group:o().optional(),settings:X(o(),J()).optional()})),nm=mu(()=>d({addonId:o(),enabled:A(),modelId:o(),children:w(nm).readonly(),settings:X(o(),J()).optional()})),hg=d({id:o(),name:o(),createdAt:o(),updatedAt:o(),engine:ha,steps:w(nm).readonly()}),l$=d({id:o(),name:o(),formats:X(o(),d({downloaded:A(),sizeMB:l()})),group:zR.optional(),legacy:A().optional(),provider:LR.optional()}),c$=si(),u$=d({id:o(),name:o(),slot:Wc,inputClasses:w(o()).readonly(),outputClasses:w(o()).readonly(),childSlots:w(Wc).readonly(),models:w(l$).readonly(),defaultModelId:o(),defaultModelIdByFormat:X(o(),o()).optional(),enabledByDefault:A().optional(),backfillIntoExistingOverrides:A().optional(),defaultConfidence:l(),group:o().optional(),configSchema:w(c$).readonly().optional()}),d$=d({id:Wc,label:o(),priority:l(),parentSlot:Wc.nullable(),addons:w(u$).readonly()}),p$=d({availableEngines:w(s$).readonly(),selectedEngine:ha,slots:w(d$).readonly()}),m$=d({runtimeId:N(["onnx","openvino","coreml","edgetpu"]).nullable(),device:o().nullable(),state:N(["idle","installing","verifying","ready","failed"]),progress:l().optional(),error:o().optional(),nextRetryAt:l().optional(),configIssues:w(o()).optional()}),_o=mu(()=>d({addonId:o(),modelId:o().optional(),enabled:A().default(!0),children:w(_o).optional(),settings:X(o(),J()).optional(),jumpDeviceKey:o().optional()})),f$=d({addonId:o(),chosen:o(),running:o(),format:o()}),h$=d({addonId:o(),kind:N(["unknown-addon","no-format-build"]),detail:o()}),g$=d({ok:A(),issues:w(h$).readonly(),substitutions:w(f$).readonly(),format:o()}),v$=d({filename:o(),stepIds:w(o()).readonly().optional()}),y$=d({base64:o(),filename:o()}),b$=d({filename:o(),sizeKb:l()}),S$=d({base64:o()}),x$=d({id:o(),name:o(),description:o(),available:A(),rawLabels:w(o()).readonly().optional()}),k$=d({activeBackend:o(),availableBackends:w(x$).readonly(),sampleRate:l(),chunkDurationMs:l()}),w$=d({filePath:o(),sizeMB:l(),durationMs:l()}),M$=d({success:A(),error:o().optional(),frame:si().optional()}),C$=si(),A$=si(),E$=si(),R$=si(),I$=si(),ey=si(),T$={name:"pipeline-executor",scope:"system",mode:"singleton",methods:{getAvailableEngines:b(O(),w(ha)),getSelectedEngine:b(O(),ha),getDefaultSteps:b(ha,w(Jv)),getEngineProvisioning:b(d({nodeId:o()}),m$),getVideoPipelineSteps:b(O(),X(o(),d({modelId:o(),settings:X(o(),J()).readonly()}))),setVideoPipelineSteps:b(d({steps:X(o(),d({modelId:o(),settings:X(o(),J()).readonly()}))}),d({success:$(!0)}),{kind:"mutation",auth:"admin"}),clearDeviceOverrides:b(d({nodeId:o()}),d({success:$(!0),clearedDevices:l()}),{kind:"mutation",auth:"admin"}),getInferenceDeviceHealth:b(d({nodeId:o()}),d({unhealthy:w(d({deviceKey:o(),state:N(["failed","backoff"]),since:l(),deaths:l(),lastError:o()})).readonly()})),rearmInferenceDevice:b(d({nodeId:o(),deviceKey:o()}),d({rearmed:A()}),{kind:"mutation",auth:"admin"}),getSchema:b(O(),p$),getGlobalSteps:b(O(),w(Jv).readonly().nullable()),getGlobalPipelineConfig:b(O(),C$),getOrchestratorConfigSchema:b(O(),A$),validatePipeline:b(d({steps:w(_o)}),g$),listTemplates:b(O(),w(hg).readonly()),saveTemplate:b(d({name:o(),steps:w(nm).readonly(),engine:ha}),hg,{kind:"mutation"}),updateTemplate:b(d({id:o(),name:o().optional(),steps:w(nm).readonly().optional()}),hg,{kind:"mutation"}),deleteTemplate:b(d({id:o()}),O(),{kind:"mutation"}),getCapabilities:b(O(),R$),getAddonModels:b(d({addonId:o()}),I$),downloadModel:b(d({addonId:o(),modelId:o(),format:Xv}),w$,{kind:"mutation"}),deleteModel:b(d({addonId:o(),modelId:o(),format:Xv}),d({success:$(!0)}),{kind:"mutation"}),runPipeline:b(d({engine:ha.optional(),steps:w(_o).min(1),frame:$v.optional(),frameRef:r$.optional(),frameHandle:Ji.optional(),imageBase64:o().optional(),image:Ht(Uint8Array).optional(),referenceImage:o().optional(),deviceId:l().optional(),sessionId:o().optional(),plane:N(["full","frame"]).optional(),deviceKey:o().optional(),nativeCropRef:i$.optional()}),ey,{kind:"mutation"}),runPipelineBatch:b(d({engine:ha.optional(),steps:w(_o).min(1),frames:w($v).min(1).max(255),deviceId:l().optional(),sessionId:o().optional(),frameId:l().int().nonnegative().optional(),deviceKey:o().optional()}),d({results:w(ey).readonly()}),{kind:"mutation"}),cacheFrameInPool:b(d({data:Ht(Uint8Array),width:l().int().positive(),height:l().int().positive(),format:N(["rgb","bgr","gray"])}),d({frameId:l(),width:l(),height:l()}),{kind:"mutation"}),inferCached:b(d({stepId:o(),frameId:l().int()}),X(o(),J()),{kind:"mutation"}),uncacheFrame:b(d({frameId:l().int()}),O(),{kind:"mutation"}),getEffectiveTuning:b(O(),d({batchMode:o(),windowMs:l(),maxBatchSize:l(),concurrency:l()})),listLoadedEngines:b(O(),w(d({engineKey:o(),engine:ha,modelsLoaded:w(o()).readonly(),inUseByCameras:w(l()).readonly(),kind:N(["runtime","warm-override","device-pool"]),poolPid:l().nullable(),idleMs:l().nullable(),idleTtlMs:l().nullable()})).readonly()),spinEngine:b(d({engine:ha}),d({success:$(!0)}),{kind:"mutation",auth:"admin"}),killEngine:b(d({engine:ha,force:A().optional()}),d({success:A(),reason:o().optional()}),{kind:"mutation",auth:"admin"}),listReferenceImages:b(O(),w(v$).readonly()),getReferenceImage:b(d({filename:o()}),y$.nullable()),getReferenceAudioFiles:b(O(),w(b$).readonly()),getReferenceAudio:b(d({filename:o()}),S$.nullable()),getAudioCapabilities:b(O(),k$),runAudioTest:b(d({addonId:o(),modelId:o(),filename:o().optional(),settings:X(o(),J()).optional()}),M$,{kind:"mutation"}),getDetectionConfigSchema:b(O(),E$)}},_$=N(["include","exclude"]),Mo=d({id:o(),name:o().optional(),zoneIds:w(o()).min(1).readonly(),mode:_$,classFilter:w(o()).readonly().optional(),overlapThreshold:l().min(0).max(1).optional(),bboxInclusionPct:l().min(0).max(100).optional(),preferMask:A().optional(),enabled:A().default(!0)});w(Mo).readonly();var N$=N(["polygon","tripwire"]),O$=d({x:l(),y:l()}),Gs=d({id:o(),name:o(),kind:N$.default("polygon"),polygon:w(O$).readonly(),color:o().default("#3b82f6")}),j$={name:"zones",scope:"device",mode:"singleton",deviceTypes:[U.Camera],methods:{listZones:b(d({deviceId:l()}),w(Gs).readonly()),addZone:b(d({deviceId:l(),zone:Gs}),O(),{kind:"mutation",auth:"admin"}),removeZone:b(d({deviceId:l(),zoneId:o()}),O(),{kind:"mutation",auth:"admin"}),updateZone:b(d({deviceId:l(),zone:Gs}),O(),{kind:"mutation",auth:"admin"})},runtimeState:d({zones:w(Gs).readonly()}),durability:"restored"},Kb=N(["new","entered","left","moving","idle"]),P$=N(["motion","object","audio"]),D$=kt("kind",[ll,_m]),z$=N(["motion","audio","person","vehicle","animal","door","pir","smoke","water","button","package","generic"]),L$=N(["motion","audio","detection","sensor","control","custom","package"]),q$=N(["macro","sub"]),zI=d({kind:o(),labelKey:o(),label:o(),color:o(),iconId:o(),icon:z$,category:L$,parentKind:o().nullable(),level:q$,source:d({capName:o(),deviceId:l()})}),B$=d({deviceId:l(),kinds:w(zI).readonly()}),F$=d({id:o(),deviceId:l(),sourceDeviceId:l(),kind:o(),value:X(o(),J()).nullable(),timestamp:l()}),LI=d({x:l(),y:l(),timestamp:l(),bbox:rr,source:N(["frame","recovery"]).optional(),score:l().optional()}),U$=d({timestamp:l(),position:LI,mediaId:l().int()}),H$=d({minX:l(),minY:l(),maxX:l(),maxY:l()}),qI=N(["full","slim"]),$$=d({label:o(),peakScore:l(),count:l(),firstAt:l(),lastAt:l()}),Wb=N(["pipeline","onboard","sensor","audio"]),Yb=N(["none","staging","trained"]),Xb={markForTrain:A().optional(),debug:A().optional(),debugNote:o().max(500).optional(),favourited:A().optional()},BI={retrainStatus:Yb.optional()},Q$=d(Xb),V$=d({trackId:o(),markForTrain:A(),debug:A(),debugNote:o(),favourited:A(),retrainStatus:Yb});tt([$(1),$(2)]);var eM=d({stepId:o(),modelId:o().optional(),decidedAt:l(),identityId:o().optional()}),Jb={label:o().optional(),labelScore:l().optional(),labelMeta:eM.optional(),subLabel:o().optional(),subLabelScore:l().optional(),subLabelMeta:eM.optional()},G$=d({deviceId:l(),tracks:l().int(),files:l().int(),bytes:l().int()}),Z$=d({generatedAt:l(),trackCount:l().int(),fileCount:l().int(),byteCount:l().int(),truncated:A(),devices:w(G$).readonly()}),xp=d({trackId:o(),deviceId:l(),className:o(),...Jb,producingDeviceName:o().optional(),source:Wb.optional(),firstSeen:l(),lastSeen:l(),positions:w(LI).readonly(),snapshots:w(U$).readonly(),zonesVisited:w(o()).readonly(),zoneNames:w(o()).readonly().optional(),classes:w(o()).readonly().optional(),totalDistance:l(),state:Kb,active:A(),importance:l().optional(),bestEventId:o().optional(),importanceReason:o().optional(),audioLabels:w($$).readonly().optional(),envelope:H$.optional(),hasFace:A().optional(),hasEmbeddedFace:A().optional(),hasRider:A().optional(),previewMissReason:o().optional(),...Xb,...BI}),e0={id:l().int(),deviceId:l(),timestamp:l()},K$=d({...e0,kind:$("motion"),regionCount:l(),regions:w(d({bbox:rr,pixelCount:l(),intensity:l()})).readonly().optional(),frameWidth:l().optional(),frameHeight:l().optional(),mediaUrl:o().optional(),durationMs:l().nullable().optional(),edges:w(l()).readonly().optional()}),t0=N(["pipeline","onboard"]),W$=N(["enter","exit"]),Y$=d({direction:W$,zoneId:o(),zoneName:o().optional()}),X$=d({zoneId:o(),zoneName:o().optional(),overlapPct:l()}),FI=d({...e0,kind:$("object"),source:t0.optional(),frameId:o().optional(),idempotencyKey:o().optional(),trackId:o().optional(),className:o(),...Jb,confidence:l().optional(),bbox:rr.optional(),zones:w(o()).readonly().optional(),zoneOverlaps:w(X$).readonly().optional(),spawnRefused:o().optional(),state:Kb.optional(),zoneCrossing:Y$.optional(),frameWidth:l().optional(),frameHeight:l().optional(),mediaId:l().int().optional(),keyFrameMediaId:l().int().optional(),mediaUrl:o().optional(),importance:l().optional()}),J$=d({...e0,kind:$("audio"),rms:l(),dbfs:l(),classification:d({className:o(),originalClass:o().optional(),score:l()}).optional(),mediaUrl:o().optional()}),cl=N(["crop","thumbnail","snapshot","firstFrame","lastFrame","fullFrame","fullFrameBoxed","faceCrop","plateCrop","keyFrame","keyFrameSmall","thumbnailSmall","confirmationCrop","debugCrop","sceneFrame"]),eQ=d({mediaId:l().int(),kind:cl,sizeBytes:l(),timestamp:l()}),ty=eQ.extend({url:o(),base64:o()}),tM=ty.omit({base64:!0}),tQ=N(["person","vehicle","animal","package","face","plate"]),nQ=N(["subject","model_error"]),aQ=N(["operator","assist"]),UI=d({x:l(),y:l(),w:l(),h:l()}),ny=d({id:o(),trackId:o(),deviceId:l(),mediaKey:o(),bbox:UI,macroClass:tQ,label:o().optional(),subLabel:o().optional(),kind:nQ,source:aQ,assistModelId:o().optional(),assistScore:l().optional(),exportedInBatch:o().optional(),createdAt:l()}),HI=ny.omit({id:!0,trackId:!0,deviceId:!0,mediaKey:!0,createdAt:!0,exportedInBatch:!0}),iQ=d({trackId:o(),deviceId:l(),className:o(),label:o().optional(),firstSeen:l(),lastSeen:l(),frameCount:l().int(),annotationCount:l().int()}),rQ=d({mediaId:l().int(),kind:cl,timestamp:l(),sizeBytes:l().int(),copied:A()}),$I=d({frameId:o(),deviceId:l(),trackId:o(),sourceMediaId:l().int(),sourceKind:cl,sizeBytes:l().int(),width:l().int(),height:l().int(),copiedAt:l()}),oQ=N(["source-missing","unreadable-image","write-failed"]),sQ=d({copied:w($I).readonly(),refused:w(d({sourceMediaId:l().int(),reason:oQ})).readonly()}),lQ=d({candidates:w(rQ).readonly(),copies:w($I).readonly(),autoPickMediaId:l().int().optional()}),cQ=kt("kind",[d({kind:$("package"),zone:UI.optional()}),d({kind:$("objects"),modelId:o(),minScore:l().optional()})]),uQ=kt("kind",[d({kind:$("proposed"),modelId:o(),stepId:o(),minScore:l(),proposals:w(HI).readonly(),belowThreshold:l().int()}),d({kind:$("refused"),reason:o(),detail:o().optional()})]),nM=d({trackId:o(),retrainStatus:Yb,changed:A(),reason:N(["unknown-track","no-frames-copied","not-staging","not-trained","unchanged"]).optional()}),QI=1e3,VI=5e3,ay=d({deviceId:l(),since:l().optional(),until:l().optional(),limit:l().int().min(1).max(VI).default(QI),projection:N(["full","slim"]).optional()}),dQ=ay.extend({classFilter:o().optional()}),pQ=d({deviceIds:w(l()),since:l().optional(),until:l().optional(),limit:l().int().min(1).max(1e3).default(200),cursor:o().optional(),projection:qI.optional(),includeStationary:A().optional(),classes:w(o()).optional(),excludeSources:w(Wb).optional()}),GI=d({id:o(),deviceId:l(),openedAt:l(),lastActiveAt:l(),sealedAt:l().nullable(),memberCount:l().int().nonnegative(),groupShotMediaId:l().int().nullable()}),mQ=d({deviceIds:w(l()).min(1),since:l().optional(),until:l().optional(),limit:l().int().min(1).max(200).default(50),classes:w(o().min(1).max(60)).max(40).optional()}),fQ=d({trackId:o(),className:o().nullable(),role:N(["primary","sibling","child"]).nullable(),joinedAt:l(),label:o().optional(),subLabel:o().optional()}),hQ=d({summary:GI,members:w(fQ).readonly()}),ZI=d({summary:GI,classes:w(d({className:o().nullable(),count:l().int().positive()})).readonly()}),gQ=d({summaries:w(ZI).readonly()}),vQ=d({deviceIds:w(l()),since:l().optional(),until:l().optional(),limit:l().int().min(1).max(500).default(100),cursor:o().optional(),classes:w(o().min(1).max(60)).max(40).optional()}),yQ=d({summaries:w(ZI).readonly(),nextCursor:o().nullable()}),bQ=d({tracks:w(xp).readonly(),nextCursor:o().nullable()}),KI=50,WI=200,SQ=d({deviceId:l(),since:l(),until:l(),limit:l().int().min(1).max(WI).default(KI),minImportance:l().min(0).max(1).optional(),classFilter:o().optional()}),YI=d({id:o(),trackId:o(),timestamp:l(),className:o(),...Jb,importance:l(),bestEventId:o(),windowMs:l().optional(),...Xb,...BI}),xQ=d({deviceIds:w(l()).min(1).max(200),since:l(),until:l(),limit:l().int().min(1).max(WI).default(KI),minImportance:l().min(0).max(1).optional(),classFilter:o().optional()}),kQ=d({deviceId:l(),events:w(YI).readonly()}),XI=d({bucketStart:l(),motion:l().int(),object:l().int(),audio:l().int(),audioDbfs:l().optional()}),wQ=d({deviceId:l(),read:N(["read","unreadable"]),buckets:w(XI).readonly()});d({trackId:o(),className:o(),confidence:l(),bbox:rr,zones:w(o()).readonly(),state:Kb});var MQ=gw({id:o(),kind:N(["first-level","detail"]),macroClass:o(),score:l(),bbox:d({x:l(),y:l(),width:l(),height:l()}),labels:w(gw({label:o(),score:l()})).readonly(),parentId:o().optional()}),CQ=FI.extend({score:l()}),AQ=d({text:o(),deviceId:l().optional(),since:l().optional(),until:l().optional(),classFilter:o().optional(),limit:l().default(50),minScore:l().min(0).max(1).default(.2)}),aM=d({tracks:l().int(),events:l().int(),media:l().int(),faces:l().int(),plates:l().int(),embeddings:l().int()}),EQ=d({mediaDropped:l().int(),tracks:l().int(),events:l().int()}),RQ=d({deviceId:l(),rows:l().int(),bytes:l().int()}),IQ=d({totalRows:l().int(),totalBytes:l().int(),devices:w(RQ).readonly()}),TQ=d({kind:cl,rows:l().int(),bytes:l().int()}),_Q=d({totalRows:l().int(),totalBytes:l().int(),kinds:w(TQ).readonly(),unaccountedRows:l().int(),unaccountedBytes:l().int()}),iM=d({motion:l().int(),object:l().int(),audio:l().int()}),NQ=d({deviceId:l().optional(),since:l().optional(),until:l().optional(),maxTracks:l().int().positive().optional(),executeOnNodeId:o().optional(),pacingMs:l().int().nonnegative().optional()}),OQ=d({deleted:l()}),jQ=d({started:A(),alreadyRunning:A()}),PQ=d({running:A(),scanned:l(),rebuilt:l(),missingKeyFrame:l(),missingBbox:l(),notRunnable:l(),noCapableNode:l(),failed:l(),complete:A().nullable(),startedAtMs:l().nullable(),finishedAtMs:l().nullable(),error:o().nullable()}),DQ=d({started:A(),alreadyRunning:A()}),zQ=d({mode:N(["report","reclaim"]).default("report"),scopes:w(N(["motion-still","track-filmstrip"])).min(1).optional(),deviceIds:w(l().int()).min(1).optional(),restart:A().optional(),pageSize:l().int().min(50).max(5e3).optional(),maxRowsPerDevice:l().int().min(1).max(5e5).optional(),maxReclaimPerDevice:l().int().min(1).max(5e5).optional(),maxBytesPerRun:l().int().min(1).optional(),budgetMinutes:l().int().min(1).max(720).optional(),throttleBytesPerSec:l().int().min(64*1024).optional(),graceMinutes:l().int().min(1).max(10080).optional()}),LQ=d({running:A(),mode:N(["report","reclaim"]).nullable(),totalExamined:l(),totalEligible:l(),totalReclaimed:l(),totalBytesReclaimed:l(),totalRefused:l(),devicesDone:l(),complete:A().nullable(),startedAtMs:l().nullable(),finishedAtMs:l().nullable(),error:o().nullable()}),qQ=d({timestamp:l(),frame:ey}),BQ=d({className:o(),firstSeenMs:l(),lastSeenMs:l(),bbox:rr,framesMatched:l().int()}),FQ=d({tracks:w(BQ).readonly()}),UQ=N(["motion","audio-dbfs","battery","occupancy"]),HQ=d({scope:o(),bucketStart:l().int(),samples:l().int().nonnegative(),sum:l(),min:l(),max:l()}),$Q={name:"pipeline-analytics",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[U.Camera],exposesDeviceSettings:!0,methods:{getActiveTracks:b(d({deviceId:l()}),w(xp).readonly()),getTrack:b(d({deviceId:l(),trackId:o()}),xp.nullable()),listTracks:b(d({deviceId:l(),since:l().optional(),until:l().optional(),limit:l().optional(),zone:D$.optional(),projection:qI.optional(),includeStationary:A().optional(),classes:w(o()).optional(),excludeSources:w(Wb).optional()}),w(xp).readonly()),listRecentTracks:b(pQ,bQ),listSummaries:b(mQ,gQ),listRecentSummaries:b(vQ,yQ),getSummary:b(d({id:o()}),hQ.nullable()),clearTracks:b(d({deviceId:l()}),O(),{kind:"mutation",auth:"admin"}),getMotionEvents:b(ay,w(K$).readonly()),getObjectEvents:b(dQ,w(FI).readonly()),getAudioEvents:b(ay,w(J$).readonly()),listEventKinds:b(d({deviceId:l()}),w(zI).readonly()),listEventKindsBatch:b(d({deviceIds:w(l()).min(1).max(200)}),w(B$).readonly()),getSensorEvents:b(d({deviceId:l(),since:l().optional(),until:l().optional(),kinds:w(o()).optional(),limit:l().int().min(1).max(VI).default(QI)}),w(F$).readonly()),getKeyEvents:b(SQ,w(YI).readonly()),getKeyEventsBatch:b(xQ,w(kQ).readonly()),readLongTermSeries:b(d({deviceId:l(),series:UQ,scope:o().optional(),from:l(),to:l(),limit:l().int().positive().optional()}),w(HQ).readonly()),getEventDensity:b(d({deviceId:l(),since:l(),until:l(),bucketMs:l().int().positive()}),w(XI).readonly()),getEventDensityBatch:b(d({deviceIds:w(l()).min(1).max(200),since:l(),until:l(),bucketMs:l().int().positive()}),w(wQ).readonly()),pruneEventsBefore:b(d({deviceId:l(),cutoffMs:l()}),d({motion:l().int(),object:l().int(),audio:l().int()}),{kind:"mutation",auth:"admin"}),pruneTracksBefore:b(d({deviceId:l(),cutoffMs:l()}),aM,{kind:"mutation",auth:"admin"}),wipeAllAnalytics:b(d({deviceId:l()}),aM,{kind:"mutation",auth:"admin"}),reconcileFromDisk:b(d({deviceId:l()}),EQ,{kind:"mutation",auth:"admin"}),deleteTracks:b(d({deviceId:l(),trackIds:w(o()).min(1)}),d({deleted:l().int(),failed:w(o()).readonly()}),{kind:"mutation",auth:"admin"}),setTrackFlags:b(d({deviceId:l(),trackId:o(),flags:Q$}),V$,{kind:"mutation"}),listArchivedDebugNotes:b(Oq,w(Nq).readonly(),{kind:"query"}),listBirthDecisions:b(_q,w(Tq).readonly(),{kind:"query"}),getEventStoreFootprint:b(d({}),IQ,{kind:"query",auth:"admin"}),getEventMediaFootprintByKind:b(d({deviceId:l().int().optional()}),_Q,{kind:"query",auth:"admin"}),pruneEvents:b(d({olderThanMs:l(),reason:Tb.optional()}),iM,{kind:"mutation",auth:"admin"}),deleteDeviceEvents:b(d({deviceId:l()}),iM,{kind:"mutation",auth:"admin"}),pauseForStorageMigration:b(qr,d({paused:$(!0)}),{kind:"mutation",auth:"admin"}),resumeForStorageMigration:b(qr,d({resumed:$(!0)}),{kind:"mutation",auth:"admin"}),refreshStorageLocationsForMigration:b(qr,d({refreshed:$(!0)}),{kind:"mutation",auth:"admin"}),startStorageMigrationMove:b(Gq,d({jobId:o()}),{kind:"mutation",auth:"admin"}),getStorageMigrationMoveStatus:b(d({jobId:o()}),Zc.nullable(),{auth:"admin"}),cancelStorageMigrationMove:b(d({jobId:o()}),d({cancelled:A()}),{kind:"mutation",auth:"admin"}),relocateMedia:b(jR,d({jobId:o()}),{kind:"mutation",auth:"admin"}),countUnstampedEventMedia:b(d({}),Vq,{auth:"admin"}),countRelocatableMedia:b(m7,p7,{kind:"query",auth:"admin"}),listRelocateMediaJobs:b(d({}),w(Zc).readonly(),{kind:"query",auth:"admin"}),cancelRelocateMedia:b(d({jobId:o()}),d({cancelled:A()}),{kind:"mutation",auth:"admin"}),listOpsLog:b(ER,w(AR).readonly(),{kind:"query",auth:"admin"}),reclaimDebugMedia:b(zQ,DQ,{kind:"mutation",auth:"admin"}),getMediaReclaimStatus:b(d({}),LQ,{kind:"query",auth:"admin"}),getTrainingExportSummary:b(d({deviceIds:w(l()).optional()}),Z$,{kind:"query",auth:"admin"}),getTrainingExportUrl:b(d({deviceIds:w(l()).optional()}),d({url:o()}),{kind:"query",auth:"admin"}),listRetrainStaging:b(d({deviceIds:w(l()).optional(),limit:l().int().min(1).max(500).optional()}),w(iQ).readonly(),{kind:"query",auth:"admin"}),listRetrainFrames:b(d({trackId:o()}),lQ,{kind:"query",auth:"admin"}),selectRetrainFrames:b(d({deviceId:l(),trackId:o(),mediaIds:w(l().int()).min(1)}),sQ,{kind:"mutation",auth:"admin"}),deselectRetrainFrame:b(d({deviceId:l(),trackId:o(),frameId:o()}),d({removed:A(),removedAnnotations:l().int()}),{kind:"mutation",auth:"admin"}),getRetrainFrameImage:b(d({frameId:o()}),d({base64:o(),width:l().int(),height:l().int()}),{kind:"query",auth:"admin"}),proposeRetrainAnnotations:b(d({deviceId:l(),trackId:o(),frameId:o(),subject:cQ,nodeId:o().optional()}),uQ,{kind:"mutation",auth:"admin"}),runReplayFrameProcessor:b(d({deviceId:l(),source:t0,zones:w(Gs).readonly().optional(),detectionRules:w(Mo).readonly().optional(),zoneMembershipMinOverlap:l().min(0).max(1).optional(),frames:w(qQ).min(1)}),FQ,{kind:"mutation",auth:"admin"}),listRetrainAnnotations:b(d({trackId:o()}),w(ny).readonly(),{kind:"query",auth:"admin"}),saveRetrainAnnotations:b(d({deviceId:l(),trackId:o(),frameId:o(),annotations:w(HI)}),w(ny).readonly(),{kind:"mutation",auth:"admin"}),completeRetrainTrack:b(d({deviceId:l(),trackId:o()}),nM,{kind:"mutation",auth:"admin"}),restageRetrainTrack:b(d({deviceId:l(),trackId:o()}),nM,{kind:"mutation",auth:"admin"}),getRetrainExportUrl:b(d({deviceIds:w(l()).optional()}),d({url:o()}),{kind:"query",auth:"admin"}),getEventMedia:b(d({ownerType:xw,eventId:l().int(),kind:cl.optional(),deviceId:l()}),w(ty).readonly()),getTrackMedia:b(d({trackId:o(),kinds:w(cl).optional(),deviceId:l()}),w(ty).readonly()),listTrackMedia:b(d({trackId:o(),deviceId:l()}),w(tM).readonly()),listEventMedia:b(d({ownerType:xw,eventId:l().int(),deviceId:l()}),w(tM).readonly()),searchObjectEvents:b(AQ,w(CQ).readonly()),wipeObjectEmbeddings:b(d({}),OQ,{kind:"mutation",auth:"admin"}),rebuildObjectEmbeddings:b(NQ,jQ,{kind:"mutation",auth:"admin"}),getObjectEmbeddingRebuildStatus:b(d({}),PQ)},events:{onFrameTracked:{data:d({deviceId:l(),timestamp:l(),frameWidth:l(),frameHeight:l(),detections:w(MQ).readonly()})},onTrackStarted:{data:d({deviceId:l(),trackId:o(),className:o()})},onTrackEnded:{data:d({deviceId:l(),trackId:o(),className:o(),durationMs:l()})},onDetectionEvent:{data:d({deviceId:l(),kind:P$,eventId:o(),timestamp:l()})}}};d({activeCameras:l(),throttledCameras:l(),avgInferenceTimeMs:l(),queueDepth:l()});var n0=d({detectionMode:N(["disabled","always-on","on-motion"]),configuredFps:l(),actualFps:l(),queueDepth:l(),avgInferenceTimeMs:l(),droppedFrames:l(),phase:N(["idle","watching","active"])}),QQ=n0.extend({deviceId:l()}),Lc=d({x:l(),y:l(),w:l(),h:l()}),VQ=d({bytes:Ht(Uint8Array).optional(),jpeg:o().optional(),jpegBytes:Ht(Uint8Array).optional(),width:l().int().positive(),height:l().int().positive(),tier:N(["native","ram-fullframe"]).optional()}),rM=N(["keyFrame","thumbnail"]),GQ=N(["handle-gone","encode-failed"]),ZQ=kt("parked",[d({parked:$(!0),nodeId:o(),width:l().int().positive(),height:l().int().positive(),bytes:l().int().nonnegative(),replaced:A()}),d({parked:$(!1),nodeId:o(),reason:GQ,handleAgeMs:l().nullable(),detail:o().optional()})]),KQ=d({jpeg:o().optional(),jpegBytes:Ht(Uint8Array).optional(),width:l().int().positive(),height:l().int().positive(),timestamp:l(),parkedAt:l()}),WQ=d({bbox:Lc,className:o()}),JI=d({stepId:o(),className:o(),score:l(),bbox:Lc.optional(),embedding:o().optional(),embeddingMagnitude:l().optional(),embeddingModelId:o().optional(),label:o().optional(),labelTier:tt([$(1),$(2)]).optional(),labelModelId:o().optional(),alignedCropJpeg:o().optional(),nativeFaceShortSidePx:l().optional()}),YQ=N(["unknown-step","model-not-servable","unreadable-frame","execution-failed"]),XQ=kt("kind",[d({kind:$("ran"),nodeId:o(),modelId:o(),details:w(JI)}),d({kind:$("refused"),nodeId:o(),reason:YQ,detail:o()})]),oM={min:0,default:3e4},sM={min:0,max:6e5},lM={min:5e3,max:6e5},gg={min:1,max:30,default:4},vg={min:1,max:30,default:10},yg={min:0,max:300,default:300},bg={min:1,max:10,default:4},Sg={min:0,max:30,default:12},a0=N(["onboard","analyzer","device-activity"]),JQ=w(a0),eV=yR(e=>Array.isArray(e)&&e.length>1?e.slice(0,1):e,w(t0).max(1)),tV=d({deviceId:l(),detected:A(),source:a0.default("analyzer"),regions:w(Jp).readonly().optional()}),nV=kt("kind",[d({kind:$("local-broker")}),d({kind:$("remote-restream"),ownerNodeId:o(),ownerReachableHost:o().optional(),hubHostnameOverride:o().optional()})]).describe("Per-camera frame-source mode for the runner (P2c)"),aV=d({deviceKey:o(),weight:l().positive().default(1),maxSessions:l().int().positive().nullable().default(null)}),iV=d({deviceId:l(),detectionMode:N(["disabled","always-on","on-motion"]).default("on-motion"),audioMode:N(["disabled","always-on","on-motion"]).default("always-on"),motionCooldownMs:l().min(oM.min).default(oM.default),maxSessionHoldMs:l().min(sM.min).max(sM.max).optional(),audioMotionWindowMs:l().min(lM.min).max(lM.max).optional(),motionFps:l().min(gg.min).max(gg.max).default(gg.default),detectionFps:l().min(vg.min).max(vg.max).default(vg.default),motionStreamId:o(),detectionStreamId:o(),audioStreamPick:$8.optional(),motionSources:JQ.default(["analyzer"]),detectionSources:eV.default(["pipeline"]),pipelineEnabled:A().default(!0),steps:w(_o).readonly().optional(),audio:d({modelId:o().optional(),enabled:A()}).nullable().optional(),zones:w(Gs).readonly().default([]),onboardMotionDrivesAnalyzer:A().default(!0),preRollInferenceEnabled:A().default(!0),preRollInferenceFrames:l().min(Sg.min).max(Sg.max).default(Sg.default),occupancyRecheckEnabled:A().default(!0),occupancyRecheckSec:l().min(yg.min).max(yg.max).default(yg.default),occupancyRecheckFrames:l().min(bg.min).max(bg.max).default(bg.default),frameSource:nV.default({kind:"local-broker"}),deviceKey:o().optional(),inferenceDevices:w(aV).readonly().optional()}),eT=d({nodeId:o(),attachedCameras:l(),activeCameras:l(),avgInferenceFps:l(),avgInferenceTimeMs:l(),queueDepthTotal:l(),devices:w(d({deviceKey:o(),backend:o(),attachedCameras:l(),queueDepthTotal:l()})).default([]),hardware:d({hasGpu:A(),inferenceBackend:o().optional(),cpuCores:l().optional()})}),cM=d({framesDecoded:l(),framesAdmitted:l(),framesDroppedPixelFree:l(),viewsMaterialized:l(),viewsSkipped:l(),workerToRunnerBytes:l(),runnerToPoolRawBytes:l(),runnerToPoolJpegBytes:l(),onDemandFullFrameRequests:l(),onDemandCropRequests:l(),nativeHits:l(),nativeMisses:l(),tileHits:l(),tileMisses:l(),fallbackHits:l(),fallbackMisses:l(),retainedWritesAvoided:l(),residentRefs:l(),residentBytes:l(),releases:l(),evictions:l(),staleMisses:l()}),rV=d({node:cM,cameras:w(cM.extend({deviceId:l()}))}),oV=d({nodeId:o(),activeCameras:l(),throttledCameras:l(),avgInferenceTimeMs:l(),queueDepth:l(),frameLazy:rV.optional()}),sV=N(["not-attached","battery-asleep","not-watching","already-bursting"]),lV={name:"pipeline-runner",scope:"system",mode:"singleton",methods:{attachCamera:b(iV,d({success:$(!0)}),{kind:"mutation"}),detachCamera:b(d({deviceId:l()}),d({success:$(!0)}),{kind:"mutation"}),reportMotion:b(tV,d({success:$(!0)}),{kind:"mutation"}),getLocalLoad:b(O(),eT),getLocalMetrics:b(O(),oV),getCameraMetrics:b(d({deviceId:l()}),n0.nullable()),getAllCameraMetrics:b(O(),w(QQ).readonly()),getLocalCameras:b(O(),w(l()).readonly()),requestOccupancyBurst:b(d({deviceId:l(),frames:l().int().positive().optional(),reason:o()}),d({started:A(),refusedBecause:sV.optional()}),{auth:"admin",kind:"mutation"}),getNativeCrop:b(d({handle:Ji,bbox:Lc,maxWidth:l().int().positive().optional(),acceptJpegBytes:A().optional(),encodeJpeg:A().optional()}),VQ.nullable()),runDetailSubtree:b(d({deviceId:l(),frameHandle:Ji.optional(),frameJpeg:o().optional(),cropJpeg:o().optional(),parent:WQ,steps:w(o()).optional()}),d({details:w(JI)}).nullable(),{kind:"mutation"}),runStatelessStep:b(d({stepId:o(),modelId:o(),frameJpeg:o(),bbox:Lc,className:o(),sourceDeviceId:l()}),XQ,{kind:"mutation"}),parkTrackFrame:b(d({deviceId:l(),trackId:o(),kind:rM,handle:Ji,bbox:Lc,maxWidth:l().int().positive().optional(),timestamp:l()}),ZQ,{kind:"mutation"}),getParkedTrackFrame:b(d({deviceId:l(),trackId:o(),kind:rM,acceptJpegBytes:A().optional()}),KQ.nullable()),releaseParkedTrackFrames:b(d({deviceId:l(),trackId:o()}),d({released:l().int().nonnegative()}),{kind:"mutation"})}},kp=d({engine:ha.optional(),steps:w(_o).readonly(),audio:d({engine:ha.optional(),modelId:o().optional(),enabled:A(),settings:X(o(),J()).readonly().optional()}).nullable().optional()}),xg=d({id:o(),name:o(),description:o().optional(),config:kp,createdAt:o(),updatedAt:o()}),i0=d({modelId:o().optional(),settings:X(o(),J()).optional(),jumpDeviceKey:o().optional()}),uM=d({maxCameras:l().int().nonnegative().nullable().default(null),detectWeight:l().positive().optional(),detect:A().optional(),decode:A().optional(),audio:A().optional(),ingest:A().optional(),decodeBudgetMb:l().int().min(1024).max(65536).optional(),maxLiveDecodeWorkers:l().int().min(1).max(32).optional(),reachableHost:o().optional(),inferenceDevices:X(o(),d({enabled:A(),weight:l().positive().optional(),maxSessions:l().int().positive().optional(),steps:X(o(),i0).optional()})).optional()}),tT=d({steps:w(_o).readonly(),audio:d({modelId:o(),enabled:A()}).nullable()}),iy=d({modelId:o().optional(),settings:X(o(),J()).readonly().optional()}),cV=d({pinnedAgentNodeId:o().optional(),stepToggles:X(o(),A()).optional(),stepOverridesByDevice:X(o(),X(o(),X(o(),iy))).optional(),pipelineByAgent:X(o(),tT).optional()}),dM=d({deviceId:l(),agentNodeId:o(),pinned:A(),reason:N(["manual","capacity","hardware-affinity","failover","rebalance"]),assignedAt:l()}),uV=d({nodeId:o(),online:A(),load:eT,score:l(),decodeHwaccel:o().nullable()}),dV=d({totalAgents:l(),onlineAgents:l(),totalCameras:l(),attachedCameras:l(),activeCameras:l(),avgInferenceTimeMs:l(),queueDepth:l()}),pV=X(o(),o()),mV=d({ownerNodeId:o(),reachableHost:o().optional(),configIssue:o().optional()}),fV=d({camStreamId:o(),codec:o(),width:l(),height:l(),fps:l(),kind:o()}),hV=d({streams:w(fV).readonly()}),gV=d({detectionNodeId:o().nullable(),decoderNodeId:o().nullable(),audioNodeId:o().nullable(),sourceNodeId:o().nullable(),pinned:d({detection:A(),decoder:A(),audio:A()}),reasons:d({detection:o().optional(),decoder:o().optional(),audio:o().optional()})}),vV=d({profile:o(),status:o(),codec:o(),width:l(),height:l(),subscribers:l(),inFps:l(),outFps:l()}),yV=d({profiles:w(vV).readonly(),webrtcSessions:l(),rtspRestream:A()}),bV=d({framesWritten:l(),getFrameHits:l(),getFrameMisses:l(),budgetMb:l()}),SV=d({nodeId:o(),formats:w(o()).readonly(),sessionCount:l(),shm:bV}),xV=d({enabled:A(),fps:l()}),kV=N(["idle","installing","verifying","ready","failed"]),wV=d({state:kV,error:o().optional()}),MV=N(["idle","watching","active"]),CV=d({nodeId:o(),engine:d({backend:o(),device:o()}),phase:MV,configuredFps:l(),actualFps:l(),queueDepth:l(),avgInferenceMs:l(),provisioning:wV}),AV=d({nodeId:o(),enabled:A()}),EV=_b,RV=d({mode:EV,active:A(),storageBytes:l()}),IV=N(["source","broker","detection","recording","switches"]),TV=N(["timeout","error","partial"]),_V=d({stage:IV,reason:TV,elapsedMs:l()}),pM=d({state:N(["idle","running","done","error"]),total:l().int().nonnegative(),completed:l().int().nonnegative(),currentDeviceId:l().int().nullable(),failed:w(l().int()).readonly(),mediaDropped:l().int().nonnegative(),tracks:l().int().nonnegative(),events:l().int().nonnegative(),startedAtMs:l().int().nullable(),finishedAtMs:l().int().nullable(),error:o().nullable()}),mM=d({deviceId:l(),assignment:gV,source:hV,broker:yV.nullable(),decoder:SV.nullable(),motion:xV.nullable(),detection:CV.nullable(),audio:AV.nullable(),recording:RV.nullable(),switchedOff:w(fu).readonly(),degraded:w(_V).readonly(),fetchedAt:l()}),NV=["disabled","unavailable","cannot-host-camera-root","accelerator-preferred"],OV=N(NV),jV=d({key:o(),backend:o(),device:o(),format:N(Rm),available:A(),enabled:A(),weight:l(),maxSessions:l().nullable(),defaultModelId:o(),steps:X(o(),i0).optional(),exclusion:OV.nullable()}),PV=d({nodeId:o(),reachable:A(),devices:w(jV).readonly()}),DV={name:"pipeline-orchestrator",scope:"system",mode:"singleton",nodeIdMode:"data",exposesDeviceSettings:!0,methods:{pauseForStorageMigration:b(qr,d({paused:$(!0)}),{kind:"mutation",auth:"admin"}),resumeForStorageMigration:b(qr,d({resumed:$(!0)}),{kind:"mutation",auth:"admin"}),assignPipeline:b(d({deviceId:l(),agentNodeId:o()}),d({success:$(!0)}),{kind:"mutation",auth:"admin"}),unassignPipeline:b(d({deviceId:l()}),d({success:$(!0)}),{kind:"mutation",auth:"admin"}),setPipelineDevicePin:b(d({deviceId:l(),deviceKey:o()}),d({success:$(!0)}),{kind:"mutation",auth:"admin"}),getPipelineDevicePin:b(d({deviceId:l()}),d({deviceKey:o().nullable()})),rebalance:b(O(),d({migrated:l()}),{kind:"mutation",auth:"admin"}),getPipelineAssignments:b(O(),w(dM).readonly()),getPipelineAssignment:b(d({deviceId:l()}),dM.nullable()),getAgentLoad:b(O(),w(uV).readonly()),getGlobalMetrics:b(O(),dV),getCameraMetrics:b(d({deviceId:l()}),n0.nullable()),getCapabilityBindings:b(d({nodeId:o()}),pV),setCapabilityBinding:b(d({nodeId:o(),capName:o(),addonId:o()}),d({success:$(!0)}),{kind:"mutation",auth:"admin"}),getIngestOwner:b(O(),mV),assignAudio:b(d({deviceId:l(),nodeId:o()}),d({success:$(!0)}),{kind:"mutation",auth:"admin"}),unassignAudio:b(d({deviceId:l()}),d({success:$(!0)}),{kind:"mutation",auth:"admin"}),getAudioAssignment:b(d({deviceId:l()}),d({nodeId:o(),pinned:A(),assignedAt:l()}).nullable()),getAudioNodeLoad:b(O(),w(d({nodeId:o(),deviceCount:l()}))),getAudioAssignments:b(O(),w(d({deviceId:l(),nodeId:o(),pinned:A(),assignedAt:l()}))),getAgentSettings:b(d({agentNodeId:o()}),uM.nullable()),listAgentSettings:b(O(),w(d({nodeId:o(),settings:uM})).readonly()),removeAgentSettings:b(d({agentNodeId:o()}),d({success:A(),removed:A()}),{kind:"mutation",auth:"admin"}),setAgentMaxCameras:b(d({agentNodeId:o(),maxCameras:l().int().nonnegative().nullable()}),d({success:$(!0)}),{kind:"mutation",auth:"admin"}),setAgentDetectWeight:b(d({agentNodeId:o(),detectWeight:l().positive().nullable()}),d({success:$(!0)}),{kind:"mutation",auth:"admin"}),setAgentCapabilities:b(d({agentNodeId:o(),detect:A().nullable().optional(),audio:A().nullable().optional(),ingest:A().nullable().optional()}),d({success:$(!0)}),{kind:"mutation",auth:"admin"}),setAgentDecodeLimits:b(d({agentNodeId:o(),decodeBudgetMb:l().int().min(1024).max(65536).nullable().optional(),maxLiveDecodeWorkers:l().int().min(1).max(32).nullable().optional()}),d({success:$(!0)}),{kind:"mutation",auth:"admin"}),setAgentReachableHost:b(d({agentNodeId:o(),reachableHost:o().nullable()}),d({success:$(!0)}),{kind:"mutation",auth:"admin"}),setAgentInferenceDevices:b(d({agentNodeId:o(),inferenceDevices:X(o(),d({enabled:A(),weight:l().positive().optional(),maxSessions:l().int().positive().optional(),steps:X(o(),i0).optional()}))}),d({success:$(!0)}),{kind:"mutation",auth:"admin"}),getNodeInferenceDevices:b(d({nodeId:o()}),PV),resetNodePipelineDefaults:b(d({agentNodeId:o()}),d({success:$(!0),effectiveModelId:o().nullable(),clearedCameraOverrides:l()}),{kind:"mutation",auth:"admin"}),getCameraSettings:b(d({deviceId:l()}),cV.nullable()),setCameraStepToggle:b(d({deviceId:l(),addonId:o(),enabled:A().nullable()}),d({success:$(!0)}),{kind:"mutation",auth:"admin"}),getCameraStepOverrides:b(d({deviceId:l()}),X(o(),X(o(),X(o(),iy))).nullable()),setCameraStepOverride:b(d({deviceId:l(),agentNodeId:o(),deviceKey:o(),addonId:o(),patch:iy.nullable()}),d({success:$(!0)}),{kind:"mutation",auth:"admin"}),setCameraPipelineForAgent:b(d({deviceId:l(),agentNodeId:o(),pipeline:tT.nullable()}),d({success:$(!0)}),{kind:"mutation",auth:"admin"}),resolvePipeline:b(d({deviceId:l(),agentNodeId:o().optional()}),kp),getCameraSwitches:b(d({deviceId:l()}),ww),setCameraSwitch:b(d({deviceId:l(),switchId:fu,enabled:A()}),ww,{kind:"mutation",auth:"admin"}),getCameraStatus:b(d({deviceId:l()}),mM),getCameraStatuses:b(d({deviceIds:w(l()).optional()}),w(mM).readonly()),reconcileFromDisk:b(O(),pM,{kind:"mutation",auth:"admin"}),getReconcileFromDiskStatus:b(O(),pM,{auth:"admin"}),listTemplates:b(O(),w(xg).readonly()),saveTemplate:b(d({name:o(),description:o().optional(),config:kp}),xg,{kind:"mutation",auth:"admin"}),updateTemplate:b(d({id:o(),name:o().optional(),description:o().optional(),config:kp.optional()}),xg,{kind:"mutation",auth:"admin"}),deleteTemplate:b(d({id:o()}),d({success:$(!0)}),{kind:"mutation",auth:"admin"})}},zV={motion:"motion",audio:"audio",person:"person",vehicle:"vehicle",animal:"animal",package:"package",door:"door",pir:"pir",smoke:"smoke",water:"water",button:"button",generic:"generic",gas:"smoke",vibration:"generic",tamper:"generic",presence:"person",lock:"generic",siren:"generic",switch:"generic",doorbell:"button"};function LV(e){return zV[e]??"generic"}var qV={contact:"contact",motion:"motion-sensor",smoke:"smoke",flood:"flood",gas:"gas","carbon-monoxide":"carbon-monoxide",vibration:"vibration",tamper:"tamper",presence:"presence","enum-sensor":"enum-sensor","event-emitter":"device-event","lock-control":"lock",switch:"switch",button:"button",doorbell:"doorbell"};function BV(e,t){const n=$b[t];if(n===void 0)throw new Error(`EVENT_KIND_BY_CAP: cap '${e}' maps to unknown taxonomy kind '${t}'`);return{...n,icon:LV(n.iconId)}}Object.freeze(Object.fromEntries(Object.entries(qV).map(([e,t])=>[e,BV(e,t)])));var FV=N(["workspace","baked","data-root"]),UV=N(["idle","checking","staging","pending-restart","awaiting-confirmation"]),HV=N(["in-sync","behind-patch","behind-series","ahead","unknown"]),$V=d({state:HV,seedVersion:o().nullable(),contractVersion:o().nullable(),contractSource:N(["registry","running"]).nullable(),message:o()}),QV=N(["docker","electron","native","contradictory","unknown"]),VV=d({fact:N(["dockerenv-file","proc-1-cgroup","platform","electron-app-version-env"]),mode:N(["observed","declared"]),holds:A(),detail:o()}),GV=d({kind:QV,evidence:w(VV),currentVersion:o().nullable()}),ZV=d({fromVersion:o(),toVersion:o().nullable(),atMs:l(),reason:o()}),KV=d({packageName:o(),runningVersion:o().nullable(),nodeRuntimeVersion:o().nullable(),activeVersion:o().nullable(),previousVersion:o().nullable(),seedVersion:o().nullable(),latestVersion:o().nullable(),updateAvailable:A(),bootMode:FV,updateState:UV,pendingVersion:o().nullable(),rolledBack:ZV.nullable(),stateFileCorrupt:A(),lastCheckedAtMs:l().nullable(),imageContract:$V.optional(),wrapper:GV.optional()}),WV=d({packageName:o(),runningVersion:o().nullable(),latestVersion:o().nullable(),updateAvailable:A(),checkedAtMs:l(),error:o().nullable()}),kg=d({accepted:A(),targetVersion:o().nullable(),restarting:A(),message:o()}),YV={name:"server-management",scope:"system",mode:"singleton",methods:{getServerPackageStatus:b(O(),KV,{auth:"admin"}),checkServerUpdate:b(O(),WV,{kind:"mutation",auth:"admin"}),applyServerUpdate:b(d({version:o().optional()}),kg,{kind:"mutation",auth:"admin",timeoutMs:16*6e4}),rollbackServerUpdate:b(O(),kg,{kind:"mutation",auth:"admin"}),restartServer:b(O(),kg,{kind:"mutation",auth:"admin"})},mount:{kind:"server-provided"}},Zs=$L(),XV=d({to:tt([Zs,w(Zs).min(1)]),cc:w(Zs).optional(),bcc:w(Zs).optional(),from:o().optional(),replyTo:o().optional(),subject:o(),text:o(),html:o().optional()}),JV=d({messageId:o(),accepted:w(Zs).default([]),rejected:w(Zs).default([])}),fM=d({ready:A(),host:o(),error:o().optional(),lastVerifiedAt:l().optional()}),eG={name:"smtp-provider",scope:"system",mode:"collection",internal:!0,providerKind:"email",methods:{sendEmail:b(XV,JV,{kind:"mutation",auth:"admin",access:"create"}),verify:b(O(),fM,{kind:"mutation",auth:"admin",access:"view"}),getStatus:b(O(),fM,{auth:"admin"})}},tG=d({base64:o(),contentType:o()}),nG=d({lastCapturedAt:l().nullable(),cacheAgeMs:l().nullable(),lastBytes:l().nullable(),lastStreamId:o().nullable()}),aG={name:"snapshot",scope:"device",deviceNative:!0,mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[U.Camera],exposesDeviceSettings:!0,methods:{getSnapshot:b(d({deviceId:l(),streamId:o().optional(),force:A().optional()}),tG.nullable()),invalidateCache:b(d({deviceId:l()}),O(),{kind:"mutation",auth:"admin"}),getSnapshotOverview:rg(d({deviceIds:w(l()).min(1).max(200)}),w(d({deviceId:l(),lastCapturedAt:l().nullable(),cacheAgeMs:l().nullable(),etag:o().nullable()}))),getDebugState:rg(d({deviceId:l()}),d({battery:d({sleeping:A(),lastUpdated:l(),lastContactAt:l().optional()}).nullable(),state:d({isBattery:A(),reason:N(["disabled","offline","sleeping","unreachable","waking"]).nullable()}),frame:d({capturedAt:l().nullable(),ageMs:l().nullable()}),waking:A()})),getSnapshotLinks:rg(d({targets:w(d({deviceId:l(),width:l().int().positive().optional()})).min(1).max(200)}),w(d({deviceId:l(),url:o().nullable(),capturedAt:l().nullable(),ageMs:l().nullable(),expiresAt:l().nullable(),width:l().nullable(),neverCaptured:A(),sleeping:A(),stateReason:N(["disabled","offline","sleeping","unreachable","waking"]).nullable(),battery:A()})))},status:{schema:nG,kind:"poll"}},hM=d({userId:o(),username:o(),isAdmin:A(),provider:o(),email:o().optional(),displayName:o().optional(),hubUrl:o().optional(),scopes:w(ja).optional(),redirectUri:o().optional(),integrationId:o().optional(),jti:o().optional(),codeChallenge:o().optional(),sessionId:o().optional(),refreshTtl:tt([l().int().positive(),$("never")]).optional()}),iG={name:"sso-bridge",scope:"system",mode:"singleton",internal:!0,methods:{signBridgeToken:b(d({claims:hM,ttlSec:tt([l().int().positive(),$("never")]).optional()}),d({token:o()}),{auth:"admin"}),verifyBridgeToken:b(d({token:o()}),hM.nullable(),{auth:"admin"})}},rG=kt("shouldSaveDiskSpace",[d({providerId:o().min(1),displayName:o().min(1),configSchema:J(),nodeLocal:A(),shouldSaveDiskSpace:$(!0),minFreePercent:l().min(0).max(100)}),d({providerId:o().min(1),displayName:o().min(1),configSchema:J(),nodeLocal:A(),shouldSaveDiskSpace:$(!1),minFreePercent:$(null)})]),oG={name:"storage",scope:"system",mode:"singleton",methods:{resolve:b(d({location:Vi,relativePath:o()}),o()),write:b(d({location:Vi,relativePath:o(),data:Ht(Uint8Array)}),O(),{kind:"mutation"}),read:b(d({location:Vi,relativePath:o()}),Ht(Uint8Array)),exists:b(d({location:Vi,relativePath:o()}),A()),list:b(d({location:Vi,prefix:o().optional()}),w(o()).readonly()),delete:b(d({location:Vi,relativePath:o()}),O(),{kind:"mutation"}),getAvailableSpace:b(d({location:Vi}),l().nullable()),beginUpload:b(d({location:Vi,relativePath:o(),sizeBytes:l().optional()}),d({uploadId:o()}),{kind:"mutation"}),writeChunk:b(d({uploadId:o(),offset:l(),data:Ht(Uint8Array)}),O(),{kind:"mutation"}),finalizeUpload:b(d({uploadId:o()}),O(),{kind:"mutation"}),abortUpload:b(d({uploadId:o()}),O(),{kind:"mutation"}),beginDownload:b(d({location:Vi,relativePath:o()}),d({downloadId:o(),sizeBytes:l()}),{kind:"mutation"}),readChunk:b(d({downloadId:o(),offset:l(),length:l()}),Ht(Uint8Array)),endDownload:b(d({downloadId:o()}),O(),{kind:"mutation"}),listLocations:b(d({type:PR.optional()}),w($a).readonly()),listLocationDeclarations:b(O(),w(k7).readonly()),upsertLocation:b($a.omit({createdAt:!0,updatedAt:!0}),$a,{kind:"mutation",auth:"admin"}),deleteLocation:b(d({id:o(),force:A().optional()}),O(),{kind:"mutation",auth:"admin"}),listDrainProgress:b(O(),w(S7).readonly()),testLocation:b(d({id:o()}),d({ok:A(),error:o().optional()}),{auth:"admin"}),listProviders:b(O(),w(rG).readonly()),testConfig:b(d({providerId:o(),locationId:o().optional(),config:X(o(),J())}),d({ok:A(),error:o().optional()}),{auth:"admin"})}},sG=d({bytes:l().int().nonnegative()}),lG=d({reclaimedBytes:l().int().nonnegative(),exhausted:A()}),cG={name:"storage-evictable",scope:"system",mode:"collection",internal:!0,methods:{getEvictableUsage:b(d({locationId:o()}),sG,{auth:"admin"}),evict:b(d({locationId:o(),targetBytes:l().int().positive()}),lG,{kind:"mutation",auth:"admin"})}},uG={name:"storage-migration",scope:"system",mode:"singleton",methods:{plan:b(Ew,e7,{auth:"admin"}),start:b(Ew,d({jobId:o()}),{kind:"mutation",auth:"admin"}),status:b(d({jobId:o().optional()}),Rw.nullable(),{auth:"admin"}),cancel:b(d({jobId:o()}),d({cancelled:A()}),{kind:"mutation",auth:"admin"}),movers:b(d({}),w(n7).readonly(),{auth:"admin"}),residue:b(d({}),w(a7).readonly(),{auth:"admin"}),drain:b(i7,d({jobId:o()}),{kind:"mutation",auth:"admin"}),cleanupStart:b(h7,d({jobId:o()}),{kind:"mutation",auth:"admin"}),cleanupStatus:b(v7,g7.nullable(),{auth:"admin"}),cleanupCancel:b(d({jobId:o()}),d({cancelled:A()}),{kind:"mutation",auth:"admin"}),history:b(d({}),w(Rw).readonly(),{auth:"admin"})}},dG=d({locationId:o(),ownedBytes:l().int().nonnegative(),measuredAtMs:l().int().nonnegative()}),pG={name:"storage-occupancy",scope:"system",mode:"collection",internal:!0,methods:{getOccupancy:b(d({locationIds:w(o()).readonly()}),w(dG).readonly(),{auth:"admin"})}},mG=kt("shouldSaveDiskSpace",[d({providerId:o().min(1),displayName:o().min(1),configSchema:J(),nodeLocal:A(),shouldSaveDiskSpace:$(!0),minFreePercent:l().min(0).max(100)}),d({providerId:o().min(1),displayName:o().min(1),configSchema:J(),nodeLocal:A(),shouldSaveDiskSpace:$(!1),minFreePercent:$(null)})]),fG=d({ok:A(),error:o().optional()}),hG=d({location:$a,relativePath:o(),sizeBytes:l().optional()}),gG=d({uploadId:o()}),vG=d({uploadId:o(),offset:l(),data:Ht(Uint8Array)}),yG=d({uploadId:o()}),bG=d({uploadId:o()}),SG=d({location:$a,relativePath:o()}),xG=d({downloadId:o(),sizeBytes:l()}),kG=d({downloadId:o(),offset:l(),length:l()}),wG=d({downloadId:o()}),MG={name:"storage-provider",scope:"system",mode:"collection",internal:!0,methods:{getProviderInfo:b(O(),mG,{auth:"admin"}),testLocation:b(d({config:X(o(),J())}),fG,{auth:"admin"}),resolve:b(d({location:$a,relativePath:o()}),o(),{auth:"admin"}),write:b(d({location:$a,relativePath:o(),data:Ht(Uint8Array)}),O(),{kind:"mutation",auth:"admin"}),read:b(d({location:$a,relativePath:o()}),Ht(Uint8Array),{auth:"admin"}),exists:b(d({location:$a,relativePath:o()}),A(),{auth:"admin"}),list:b(d({location:$a,prefix:o().optional()}),w(o()).readonly(),{auth:"admin"}),delete:b(d({location:$a,relativePath:o()}),O(),{kind:"mutation",auth:"admin"}),getAvailableSpace:b(d({location:$a}),l().nullable(),{auth:"admin"}),beginUpload:b(hG,gG,{kind:"mutation",auth:"admin"}),writeChunk:b(vG,O(),{kind:"mutation",auth:"admin"}),finalizeUpload:b(yG,O(),{kind:"mutation",auth:"admin"}),abortUpload:b(bG,O(),{kind:"mutation",auth:"admin"}),beginDownload:b(SG,xG,{kind:"mutation",auth:"admin"}),readChunk:b(kG,Ht(Uint8Array),{auth:"admin"}),endDownload:b(wG,O(),{kind:"mutation",auth:"admin"})}},CG=J().nullable(),ry=X(o(),J()),gM=d({sessionId:o(),profileId:o(),label:o(),cols:l().int().positive(),rows:l().int().positive(),startedAt:l()}),AG=d({profileId:o(),label:o(),description:o().optional(),executable:o().optional(),args:w(o()).readonly().optional(),cwd:o().optional(),environment:w(o()).readonly().optional(),settingsSchema:CG.optional()}),vc=d({instanceId:o(),cameraStableId:o(),nodeId:o(),profileId:o(),profileLabel:o(),name:o(),enabled:A(),executable:o(),args:w(o()).readonly(),cwd:o(),environment:w(o()).readonly(),profileSettings:ry}),EG=d({stableId:o(),nodeId:o(),profileId:o(),profileLabel:o(),name:o(),adoptable:A()}),RG=kt("kind",[d({seq:l().int().positive(),kind:$("data"),data:o()}),d({seq:l().int().positive(),kind:$("exit"),exitCode:l().int(),signal:l().int().optional()})]),IG=d({cursor:l().int().nonnegative(),reset:A(),snapshot:o().optional(),events:w(RG).readonly()}),TG={name:"terminal-session",scope:"system",mode:"singleton",methods:{listProfiles:b(O(),w(AG).readonly(),{auth:"admin"}),listInstances:b(O(),w(vc).readonly(),{auth:"admin"}),createInstance:b(d({targetNodeId:o().min(1),profileId:o().min(1),name:o().trim().min(1).max(160).optional(),executable:o().max(1024).optional(),args:w(o().max(2048)).max(64).optional(),cwd:o().max(1024).optional(),environment:w(o().max(4096)).max(64).optional(),profileSettings:ry.optional()}),vc,{kind:"mutation",auth:"admin"}),updateInstance:b(d({instanceId:o().min(1),name:o().trim().min(1).max(160).optional(),executable:o().max(1024).optional(),args:w(o().max(2048)).max(64).optional(),cwd:o().max(1024).optional(),environment:w(o().max(4096)).max(64).optional(),profileSettings:ry.optional()}),vc,{kind:"mutation",auth:"admin"}),deleteInstance:b(d({instanceId:o().min(1)}),O(),{kind:"mutation",auth:"admin"}),setInstanceEnabled:b(d({instanceId:o().min(1),enabled:A()}),vc,{kind:"mutation",auth:"admin"}),listLegacyCameras:b(O(),w(EG).readonly(),{auth:"admin"}),adoptLegacyMonitor:b(d({stableId:o().min(1),name:o().trim().min(1).max(160).optional()}),vc,{kind:"mutation",auth:"admin"}),listSessions:b(O(),w(gM).readonly(),{auth:"admin"}),openSession:b(d({profileId:o(),cols:l().int().positive(),rows:l().int().positive(),executable:o().max(1024).optional(),args:w(o().max(2048)).max(64).optional(),cwd:o().max(1024).optional(),environment:w(o().max(4096)).max(64).optional()}),gM,{kind:"mutation",auth:"admin"}),resize:b(d({sessionId:o(),cols:l().int().positive(),rows:l().int().positive()}),O(),{kind:"mutation",auth:"admin"}),pullOutput:b(d({sessionId:o(),afterSeq:l().int().nonnegative(),waitMs:l().int().min(0).max(2e3).default(0),waitForOutput:A().optional()}),IG,{kind:"mutation",auth:"admin",timeoutMs:15e3}),writeInput:b(d({sessionId:o(),data:o().max(64*1024)}),O(),{kind:"mutation",auth:"admin"}),close:b(d({sessionId:o()}),O(),{kind:"mutation",auth:"admin"})}},_G=d({urls:tt([o(),w(o())]),username:o().optional(),credential:o().optional()}),NG={name:"turn-provider",scope:"system",mode:"collection",methods:{getTurnServers:b(O(),w(_G).readonly())}},OG=d({credentialId:o(),label:o(),createdAt:l(),lastUsedAt:l().nullable(),transports:w(o()).default([])}),jG={name:"user-passkeys",scope:"system",mode:"collection",internal:!0,methods:{beginRegistration:b(d({userId:o(),username:o()}),d({optionsJSON:X(o(),J())}),{kind:"mutation",auth:"admin",access:"create"}),finishRegistration:b(d({userId:o(),response:X(o(),J()),label:o()}),d({success:$(!0),credentialId:o()}),{kind:"mutation",auth:"admin",access:"create"}),beginAuthentication:b(d({userId:o().optional()}),d({optionsJSON:X(o(),J())}),{kind:"mutation",access:"view",auth:"admin"}),finishAuthentication:b(d({userId:o(),response:X(o(),J())}),d({verified:A()}),{kind:"mutation",access:"view",auth:"admin"}),beginDiscoverableAuthentication:b(d({}),d({optionsJSON:X(o(),J())}),{kind:"mutation",access:"view",auth:"admin"}),finishDiscoverableAuthentication:b(d({response:X(o(),J())}),d({verified:A(),userId:o().nullable()}),{kind:"mutation",access:"view",auth:"admin"}),listPasskeys:b(d({userId:o()}),w(OG),{auth:"admin"}),removePasskey:b(d({userId:o(),credentialId:o()}),d({success:$(!0)}),{kind:"mutation",auth:"admin",access:"delete"}),getSecondFactorPreference:b(d({userId:o()}),d({enabled:A()}),{auth:"admin"}),setSecondFactorPreference:b(d({userId:o(),enabled:A()}),d({success:$(!0)}),{kind:"mutation",auth:"admin",access:"create"})}},nT=N(["cosine","dot","euclidean"]),yu=X(o(),tt([o(),l(),A()])),aT=d({equals:X(o(),tt([o(),l(),A()])).optional(),between:X(o(),pu([l(),l()])).optional()}),PG=d({id:o(),vector:o(),metadata:yu}),DG=d({id:o(),score:l(),metadata:yu}),zG=d({index:o(),dim:l().int().positive(),metric:nT.default("cosine")}),LG=d({index:o(),items:w(PG)}),qG=d({upserted:l(),rejected:l()}),BG=d({index:o(),vector:o(),topK:l().int().positive(),minScore:l().optional(),filter:aT.optional()}),FG=d({matches:w(DG),scanned:l(),truncated:A(),effectiveTopK:l().int().positive()}),UG=d({index:o(),ids:w(o())}),HG=d({index:o(),filter:aT}),vM=d({deleted:l()}),$G=d({index:o(),ids:w(o())}),QG=d({items:w(d({id:o(),metadata:yu}))}),VG=d({index:o(),ids:w(o())}),GG=d({items:w(d({id:o(),vector:o(),metadata:yu}))}),ZG=d({index:o(),cursor:l().int().nonnegative().default(0),limit:l().int().positive()}),KG=d({items:w(d({id:o(),metadata:yu})),nextCursor:l().int().nonnegative().nullable()}),WG=d({index:o()}),YG=d({backend:o(),count:l(),dim:l(),metric:nT,bytes:l().optional(),exact:A()}),XG={name:"vector-store",scope:"system",mode:"singleton",internal:!0,methods:{declareIndex:b(zG,O(),{kind:"mutation",auth:"admin"}),upsert:b(LG,qG,{kind:"mutation",auth:"admin"}),query:b(BG,FG,{auth:"admin"}),getByIds:b($G,QG,{auth:"admin"}),fetchByIds:b(VG,GG,{auth:"admin"}),scan:b(ZG,KG,{auth:"admin"}),deleteByIds:b(UG,vM,{kind:"mutation",auth:"admin"}),deleteByFilter:b(HG,vM,{kind:"mutation",auth:"admin"}),stats:b(WG,YG,{auth:"admin"})}},JG=d({id:o(),source:o(),kind:N(["motion","object","audio","native"]),timeRange:d({startMs:l(),endMs:l()}),labels:w(o()).max(3).optional(),thumbnail:o().optional(),stillAtMs:l().optional(),eventIds:w(o()).optional(),eventCount:l().int().nonnegative().optional(),holes:w(d({startMs:l(),endMs:l()})).optional()}),eZ=d({playbackUrl:o(),playbackEndpoints:w(o()).optional(),token:o().optional()}),tZ={name:"videoclips",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[U.Camera],methods:{listClips:b(d({deviceId:l(),since:l(),until:l(),limit:l().int().positive().optional()}),w(JG).readonly(),{kind:"query",auth:"admin"}),getClipPlayback:b(d({deviceId:l(),clipId:o()}),eZ,{kind:"query",auth:"admin"})}},yM=d({viewportWidth:l().int().positive().optional(),viewportHeight:l().int().positive().optional(),devicePixelRatio:l().positive().optional(),downlinkMbps:l().nonnegative().optional(),prefersTier:o().optional()}).partial(),wp=kt("kind",[d({kind:$("adaptive")}),d({kind:$("profile"),profile:Ut}),d({kind:$("cam-stream"),camStreamId:o().min(1)})]),nZ=d({id:o(),label:o(),target:wp,codec:o().nullable(),resolution:d({width:l(),height:l()}).nullable(),status:N(["idle","connecting","streaming","error","stopped"]).nullable(),inputFps:l().nullable(),decodeFps:l().nullable(),bitrateKbps:l().nullable()}),aZ=d({cause:N(["loss","stall","healthy"]),tier:Ut.nullable(),forcedTranscodeDown:A(),lossRatio:l().nullable(),clientKbps:l().nullable(),stalledForMs:l().nullable(),serverSending:A().nullable(),at:l()}),iZ=d({tier:Ut,failures:l().int().nonnegative()}),rZ=d({sessionId:o(),alive:A(),observedAt:l(),brokerId:o().nullable(),camStreamId:o().nullable(),sourceKind:N(["native","derived","unknown"]),adaptive:A(),servedTier:Ut.nullable(),ingestNodeId:o().nullable(),ingestIsRemote:A().nullable(),sourceCodec:o().nullable(),negotiatedCodec:o().nullable(),egressLeg:N(["copy","transcode","unknown"]),brokerStatus:o().nullable(),brokerCodec:o().nullable(),brokerBitrateKbps:l().nullable(),brokerInputFps:l().nullable(),brokerUptimeMs:l().nullable(),rtpPacketsSent:l().nullable(),trackMode:N(["live","recorded"]).nullable(),lastDecision:aZ.nullable(),tierFailures:w(iZ),upgradeCount:l().nullable()}),oZ={name:"webrtc-session",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,preferredProvider:"stream-broker",deviceTypes:[U.Camera],methods:{listStreams:b(d({deviceId:l().int().nonnegative()}),w(nZ)),createSession:b(d({deviceId:l().int().nonnegative(),target:wp,hints:yM.optional(),relayOnly:A().optional(),consumerAttribution:Gv.optional()}),d({sessionId:o(),sdpOffer:o()}),{kind:"mutation"}),handleOffer:b(d({deviceId:l().int().nonnegative(),target:wp.optional(),sdpOffer:o(),sessionId:o().optional(),relayOnly:A().optional(),nonTrickle:A().optional(),disableTurn:A().optional(),disableIpv6:A().optional(),consumerAttribution:Gv.optional(),hints:yM.optional()}),d({sessionId:o(),sdpAnswer:o()}),{kind:"mutation"}),handleAnswer:b(d({deviceId:l().int().nonnegative(),sessionId:o(),sdpAnswer:o()}),O(),{kind:"mutation"}),addIceCandidate:b(d({deviceId:l().int().nonnegative(),sessionId:o(),candidate:o(),sdpMid:o().nullable().optional(),sdpMLineIndex:l().int().nullable().optional()}),O(),{kind:"mutation"}),getIceCandidates:b(d({deviceId:l().int().nonnegative(),sessionId:o()}),d({candidates:w(d({candidate:o(),sdpMid:o().nullable(),sdpMLineIndex:l().int().nullable()})),done:A()}),{kind:"query"}),closeSession:b(d({deviceId:l().int().nonnegative(),sessionId:o()}),O(),{kind:"mutation"}),hasAdaptiveBitrate:b(d({deviceId:l().int().nonnegative(),profile:Ut}),A()),getSessionState:b(d({deviceId:l().int().nonnegative(),sessionId:o()}),d({pendingRenegotiation:d({target:wp,epoch:l()}).nullable(),alive:A()})),getSessionDebug:b(d({deviceId:l().int().nonnegative(),sessionId:o()}),rZ,{kind:"query"})},mount:{kind:"server-provided"}},sZ=d({childDeviceIds:w(l()).readonly(),hiddenChildIds:w(l()).readonly()}),lZ={name:"accessories",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Camera,U.Hub,U.Switch,U.Light,U.Sensor,U.Thermostat,U.Cover,U.Lock,U.Fan,U.MediaPlayer,U.AlarmPanel,U.Generic],methods:{setChildHidden:b(d({deviceId:l().int().nonnegative(),childDeviceId:l().int().nonnegative(),hidden:A()}),O(),{kind:"mutation",auth:"admin"})},events:{onAccessoriesChanged:{data:d({deviceId:l(),childDeviceIds:w(l()).readonly(),hiddenChildIds:w(l()).readonly()})},onChildVisibilityChanged:{data:d({deviceId:l(),childDeviceId:l(),hidden:A()})}},status:{schema:sZ,kind:"command-driven"}},cZ=N(["install","update","uninstall","restart"]),iT=N(["queued","fetching","staged","validating","applying","restarting","applied","done","failed","skipped"]),uZ=N(["framework","addon"]),dZ=d({tsMs:l(),nodeId:o(),packageName:o(),phase:iT,message:o()}),pZ=d({taskId:o(),nodeId:o(),packageName:o(),fromVersion:o().nullable(),toVersion:o(),target:uZ,phase:iT,stagedPath:o().nullable(),attempts:l(),steps:w(dZ),error:o().nullable(),startedAtMs:l().nullable(),finishedAtMs:l().nullable()}),mZ=N(["running","completed","failed","partially-failed","cancelled"]),fZ=N(["single","bulk","cluster"]),bM=d({jobId:o(),kind:cZ,createdAtMs:l(),createdBy:o(),scope:fZ,tasks:w(pZ),state:mZ,schemaVersion:$(1)}),SM=N(["debug","info","warn","error"]),oy=N(["off","latest","beta"]),rT=N(["off","latest","beta","inherit"]),hZ=d({id:o(),name:o().optional(),version:o().optional(),description:o().optional(),icon:o().optional(),color:o().optional(),capabilities:w(J()).readonly().optional(),packageName:o(),packageVersion:o(),packageDisplayName:o().optional(),bundle:d({displayName:o(),description:o().optional(),icon:o().optional()}).optional(),protected:A().optional(),removable:A().optional()}),gZ=d({pid:l().optional(),mode:o(),state:o()}),vZ=d({phase:N(["pending","healthy","failed"]),retryCount:l(),firstFailureAt:l().nullable(),lastAttemptAt:l().nullable(),lastError:d({message:o(),stack:o().optional()}).nullable(),nextRetryAt:l().nullable(),alertEmitted:A(),retrying:A(),inGracePeriod:A()}),yZ=d({manifest:hZ,declaration:J().optional(),source:o(),installSource:o().optional(),process:gZ.optional(),hasBackup:A().optional(),health:vZ.nullable().optional()}),bZ=d({name:o(),version:o(),dir:o(),installSource:o().optional()}),SZ=d({name:o(),currentVersion:o(),latestVersion:o(),category:N(["addon","core"]),requiresRestart:A(),isSystem:A()}),xZ=d({version:o(),publishedAt:o(),deprecated:o().optional(),distTags:w(o()).readonly()}),kZ=d({name:o(),version:o(),description:o(),keywords:w(o()).readonly(),publishedAt:o(),author:o(),installed:A(),installedVersion:o().optional()}),wZ=d({channel:oy,intervalSeconds:l(),updateCheckIntervalSeconds:l()}),MZ=rT,CZ=J(),xM=J(),AZ=J(),EZ=N(["queued","updating","done","done-pending-restart","failed"]),RZ=d({name:o(),isSystem:A(),fromVersion:o(),toVersion:o(),status:EZ,error:o().optional(),startedAtMs:l().optional(),completedAtMs:l().optional()}),IZ=N(["regular","system","restarting","finalizing"]);d({id:o(),nodeId:o(),startedAtMs:l(),completedAtMs:l().optional(),total:l(),completed:l(),failed:l(),current:o().nullable(),phase:IZ,cancelled:A(),items:w(RZ).readonly()});var TZ=d({packageName:o(),currentVersion:o(),latestVersion:o().nullable(),hasUpdate:A(),description:o().optional(),buildId:o().nullable()}),_Z=d({timestamp:o(),level:o(),message:o(),scope:o().optional()}),NZ=J(),OZ=d({addonId:o().min(1),action:o().min(1),input:J()}),jZ={name:"addons",scope:"system",mode:"singleton",nodeIdMode:"data",methods:{list:b(O(),w(yZ).readonly()),getLogs:b(d({addonId:o(),limit:l().min(1).max(500).default(100),level:SM.optional()}),w(NZ)),listPackages:b(O(),w(bZ).readonly()),installPackage:b(d({packageName:o(),version:o().optional()}),xM,{kind:"mutation",auth:"admin"}),installFromWorkspace:b(d({packageName:o()}),xM,{kind:"mutation",auth:"admin"}),isWorkspaceAvailable:b(O(),A()),listWorkspacePackages:b(O(),w(J()).readonly()),uninstallPackage:b(d({packageName:o()}),J(),{kind:"mutation",auth:"admin"}),reloadPackages:b(O(),AZ,{kind:"mutation",auth:"admin"}),searchAvailable:b(d({query:o().optional()}),w(kZ)),listUpdates:b(d({nodeId:o().optional()}),w(SZ).readonly(),{auth:"admin"}),updatePackage:b(d({name:o().min(1),version:o().optional(),nodeId:o().optional()}),J(),{kind:"mutation",auth:"admin"}),rollbackPackage:b(d({name:o().min(1)}),d({rolledBackTo:o().nullable()}),{kind:"mutation",auth:"admin"}),forceRefresh:b(d({nodeId:o().optional()}),J(),{kind:"mutation",auth:"admin"}),restartServer:b(d({confirm:$(!0)}),J(),{kind:"mutation",auth:"admin"}),getLastRestart:b(O(),d({kind:N(["framework-update","manual","system","framework-bulk-update"]),packageName:o().optional(),fromVersion:o().optional(),toVersion:o().optional(),requestedBy:o().optional(),requestedAt:l()}).nullable(),{auth:"admin"}),listFrameworkPackages:b(O(),w(TZ).readonly(),{auth:"admin"}),listCapabilityProviders:b(d({capName:o().min(1)}),w(d({addonId:o(),mode:N(["singleton","collection"]),isActive:A()})).readonly()),setCapabilityProviderEnabled:b(d({capName:o().min(1),addonId:o().min(1),enabled:A()}),d({success:$(!0)}),{kind:"mutation",auth:"admin"}),getVersions:b(d({name:o()}),w(xZ).readonly()),restartAddon:b(d({addonId:o()}),CZ,{kind:"mutation",auth:"admin"}),retryLoad:b(d({packageName:o()}),d({success:$(!0)}),{kind:"mutation",auth:"admin"}),getAutoUpdateSettings:b(O(),wZ,{auth:"admin"}),setAutoUpdateSettings:b(d({channel:oy,intervalSeconds:l().min(300).max(86400).optional(),updateCheckIntervalSeconds:l().min(900).max(604800).optional()}),J(),{kind:"mutation",auth:"admin"}),getAddonAutoUpdate:b(d({addonId:o()}),MZ,{auth:"admin"}),setAddonAutoUpdate:b(d({addonId:o(),channel:rT}),J(),{kind:"mutation",auth:"admin"}),applyAutoUpdateToAll:b(d({channel:oy}),d({success:$(!0)}),{kind:"mutation",auth:"admin"}),custom:b(OZ,J(),{kind:"mutation"}),startJob:b(d({kind:N(["install","update","uninstall","restart"]),targets:w(d({name:o().min(1),version:o().min(1)})).min(1),nodeIds:w(o()).optional()}),d({jobId:o()}),{kind:"mutation",auth:"admin"}),getJob:b(d({jobId:o()}),bM.nullable(),{auth:"admin"}),listJobs:b(d({activeOnly:A().optional()}),w(bM),{auth:"admin"}),cancelJob:b(d({jobId:o()}),d({cancelled:A()}),{kind:"mutation",auth:"admin"}),onAddonLogs:b(d({addonId:o(),level:SM.optional()}),_Z,{kind:"subscription"})},mount:{kind:"server-provided"}},kM=d({co2Ppm:l().min(0).optional(),vocPpb:l().min(0).optional(),pm25:l().min(0).optional(),pm10:l().min(0).optional(),aqi:l().optional(),lastFetchedAt:l(),unit:o().optional(),precision:l().int().min(0).max(10).optional()}),PZ={name:"air-quality-sensor",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Sensor],methods:{},status:{schema:kM,kind:"push"},runtimeState:kM,durability:"restored",volatileStateFields:["lastFetchedAt"]},wM=d({lux:l().min(0),lastFetchedAt:l(),unit:o().optional(),precision:l().int().min(0).max(10).optional()}),DZ={name:"ambient-light-sensor",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Sensor],methods:{},status:{schema:wM,kind:"push"},runtimeState:wM,durability:"restored",volatileStateFields:["lastFetchedAt"]},zZ=d({className:o(),hits:l().int().nonnegative(),avgScore:l().min(0).max(1),peakScore:l().min(0).max(1)}),MM=d({ts:l().int(),windowSec:l().int().positive(),level:d({rms:l(),dbfs:l()}),peakDbfs:l(),avgDbfs:l(),current:d({className:o(),score:l().min(0).max(1),timestamp:l().int()}).nullable(),byClass:w(zZ).readonly()}),LZ=d({ts:l().int(),dbfs:l().nullable(),peakDbfs:l(),avgDbfs:l(),topClass:o().nullable(),topScore:l().min(0).max(1).nullable()}),qZ=d({points:w(LZ).readonly(),effectiveSampleEveryMs:l().int().positive(),windowMsActual:l().int().nonnegative()}),BZ={name:"audio-metrics",scope:"device",mode:"singleton",deviceTypes:[U.Camera],methods:{getCurrentSnapshot:b(d({deviceId:l()}),MM.nullable()),getHistory:b(d({deviceId:l(),windowSec:l().int().positive().optional(),sampleEveryMs:l().int().positive().optional()}),qZ)},runtimeState:MM,durability:"session"},CM=d({enabled:A(),isRunning:A(),lastTriggeredAt:l(),lastError:o().nullable(),lastChangedAt:l()}),FZ={name:"automation-control",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Automation],methods:{enable:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"admin"}),disable:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"admin"}),trigger:b(d({deviceId:l().int().nonnegative(),skipCondition:A().optional()}),O(),{kind:"mutation",auth:"admin"})},status:{schema:CM,kind:"push"},runtimeState:CM,durability:"session"},wg=d({percentage:l().min(0).max(100).nullable(),charging:N(["dc","solar","none","unknown"]),sleeping:A(),lastUpdated:l(),lastContactAt:l().optional(),binary:A().optional()}),UZ={name:"battery",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Camera,U.Sensor,U.Button,U.Switch],methods:{wakeForStream:b(d({deviceId:l(),timeoutMs:l().int().min(500).max(3e4).default(8e3)}),d({awoke:A(),durationMs:l()}),{kind:"mutation"})},events:{onStatusChanged:{data:d({deviceId:l(),status:wg})}},status:{schema:wg,kind:"push",empty:{percentage:0,charging:"unknown",sleeping:!1,lastUpdated:0}},runtimeState:wg,durability:"restored",volatileStateFields:["lastUpdated"]},AM=d({on:A(),lastChangedAt:l()}),HZ={name:"binary",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Sensor],methods:{},status:{schema:AM,kind:"push"},runtimeState:AM,durability:"restored",volatileStateFields:["lastChangedAt"]},EM=d({percentage:l().min(0).max(100),lastChangedAt:l()}),$Z={name:"brightness",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Light],methods:{setBrightness:b(d({deviceId:l().int().nonnegative(),percentage:l().min(0).max(100)}),O(),{kind:"mutation",auth:"protected"})},events:{onBrightnessChanged:{data:d({deviceId:l(),percentage:l().min(0).max(100),lastChangedAt:l()})}},status:{schema:EM,kind:"command-driven"},runtimeState:EM,durability:"session"},QZ={name:"button",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Button],methods:{press:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"})}},VZ=d({host:o(),port:l().int().positive().optional(),onvifPort:l().int().positive().optional(),rtspPort:l().int().positive().optional(),https:A().optional(),username:o().optional(),password:o().optional(),onvifProfile:o().optional()}),GZ=d({host:o(),port:l().int().positive().nullable(),onvifPort:l().int().positive().nullable(),rtspPort:l().int().positive().nullable(),https:A().nullable(),hasUsername:A(),hasPassword:A(),onvifProfile:o().nullable()}),ZZ={name:"camera-credentials",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Camera],methods:{getCredentials:b(d({deviceId:l()}),VZ.nullable(),{kind:"query",auth:"admin"})},status:{schema:GZ,kind:"command-driven"}},RM=d({detected:A(),lastChangedAt:l()}),KZ={name:"carbon-monoxide",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Sensor],methods:{},status:{schema:RM,kind:"push"},runtimeState:RM,durability:"restored",volatileStateFields:["lastChangedAt"]},sy=N(["off","heat","cool","auto","heat_cool","fan_only","dry"]),IM=d({mode:sy,availableModes:w(sy),fanMode:o(),availableFanModes:w(o()),preset:o(),availablePresets:w(o()),target:l().nullable(),targetHigh:l().nullable(),targetLow:l().nullable(),targetHumidity:l().min(0).max(100).nullable(),currentTemp:l().nullable(),currentHumidity:l().min(0).max(100).nullable(),swingVertical:A().nullable(),swingHorizontal:A().nullable(),lastFetchedAt:l()}),WZ={name:"climate-control",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Thermostat,U.Climate],methods:{setMode:b(d({deviceId:l().int().nonnegative(),mode:sy}),O(),{kind:"mutation",auth:"protected"}),setFanMode:b(d({deviceId:l().int().nonnegative(),fanMode:o().min(1)}),O(),{kind:"mutation",auth:"protected"}),setPreset:b(d({deviceId:l().int().nonnegative(),preset:o().min(1)}),O(),{kind:"mutation",auth:"protected"}),setTarget:b(d({deviceId:l().int().nonnegative(),target:l()}),O(),{kind:"mutation",auth:"protected"}),setTargetRange:b(d({deviceId:l().int().nonnegative(),targetLow:l(),targetHigh:l()}),O(),{kind:"mutation",auth:"protected"}),setTargetHumidity:b(d({deviceId:l().int().nonnegative(),targetHumidity:l().min(0).max(100)}),O(),{kind:"mutation",auth:"protected"}),setSwingVertical:b(d({deviceId:l().int().nonnegative(),on:A()}),O(),{kind:"mutation",auth:"protected"}),setSwingHorizontal:b(d({deviceId:l().int().nonnegative(),on:A()}),O(),{kind:"mutation",auth:"protected"})},status:{schema:IM,kind:"push"},runtimeState:IM,durability:"session"},r0=d({r:l().int().min(0).max(255),g:l().int().min(0).max(255),b:l().int().min(0).max(255)}),o0=d({h:l().min(0).max(360),s:l().min(0).max(100),v:l().min(0).max(100)}),YZ=kt("mode",[d({mode:$("rgb"),rgb:r0}),d({mode:$("hsv"),hsv:o0}),d({mode:$("mired"),mireds:l().int().min(50).max(1e3)})]),TM=d({mode:N(["rgb","hsv","mired"]),rgb:r0.optional(),hsv:o0.optional(),mireds:l().int().optional(),lastChangedAt:l()}),XZ={name:"color",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Light],methods:{setColor:b(d({deviceId:l().int().nonnegative(),color:YZ}),O(),{kind:"mutation",auth:"protected"})},events:{onColorChanged:{data:d({deviceId:l(),mode:N(["rgb","hsv","mired"]),rgb:r0.optional(),hsv:o0.optional(),mireds:l().int().optional(),lastChangedAt:l()})}},status:{schema:TM,kind:"command-driven"},runtimeState:TM,durability:"session"},JZ=kt("outcome",[d({outcome:$("validated"),latencyMs:l().nonnegative().optional(),detail:o().optional()}).strict(),d({outcome:$("rejected"),error:o()}).strict(),d({outcome:$("inconclusive"),error:o()}).strict()]),eK=d({settings:X(o(),J())}),tK=d({label:o()}),nK={name:"connection-test",scope:"system",mode:"collection",methods:{testSettings:b(eK,JZ,{kind:"mutation",auth:"admin"}),describeTest:b(O(),tK,{auth:"admin"})}},_M=d({connected:A(),lastChangedAt:l()}),aK={name:"connectivity",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Sensor],methods:{},status:{schema:_M,kind:"push"},runtimeState:_M,durability:"restored",volatileStateFields:["lastChangedAt"]},oT=d({key:o().min(1),label:o().min(1),level:l().min(0).max(100).nullable(),status:N(["ok","replace"]).nullable(),lastResetAt:l().nullable(),resettable:A()}),NM=d({items:w(oT),lastChangedAt:l()}),iK={name:"consumables",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:Object.values(U),deviceConfig:{ui:{kind:"widget",widgetId:"host/consumables-panel",tab:"consumables",topTab:!0,label:"Consumables",order:5}},methods:{reset:b(d({deviceId:l().int().nonnegative(),key:o().min(1)}),O(),{kind:"mutation",auth:"admin"})},status:{schema:NM,kind:"push",empty:{items:[],lastChangedAt:0},itemArray:{path:"items",keyField:"key",labelField:"label",itemSchema:oT,emptyItem:{key:"",label:"",level:null,status:null,lastResetAt:null,resettable:!1}}},runtimeState:NM.extend({lastFetchedAt:l()}),durability:"session"},OM=d({entryOpen:A(),lastChangedAt:l()}),rK={name:"contact",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Sensor],methods:{},status:{schema:OM,kind:"push"},runtimeState:OM,durability:"restored",volatileStateFields:["lastChangedAt"]},oK=N(["numeric","select","text","datetime"]),jM=d({kind:oK,value:tt([l(),o()]),options:w(o()),lastChangedAt:l(),unit:o().optional(),min:l().optional(),max:l().optional(),step:l().optional(),precision:l().int().min(0).max(10).optional(),format:N(["date","time","datetime"]).optional()}),sK=kt("kind",[d({kind:$("numeric"),value:l()}),d({kind:$("select"),value:o().min(1)}),d({kind:$("text"),value:o()}),d({kind:$("datetime"),value:o().min(1)})]),lK={name:"control",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Control],methods:{setValue:b(d({deviceId:l().int().nonnegative(),control:sK}),O(),{kind:"mutation",auth:"protected"})},status:{schema:jM,kind:"push"},runtimeState:jM,durability:"session"},cK=N(["open","opening","closing","closed","stopped"]),PM=d({state:cK,position:l().min(0).max(100).nullable(),tiltPosition:l().min(0).max(100).nullable(),lastChangedAt:l()}),uK={name:"cover",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Cover],methods:{open:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),close:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),stop:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),setPosition:b(d({deviceId:l().int().nonnegative(),position:l().min(0).max(100)}),O(),{kind:"mutation",auth:"protected"}),setTiltPosition:b(d({deviceId:l().int().nonnegative(),tiltPosition:l().min(0).max(100)}),O(),{kind:"mutation",auth:"protected"})},status:{schema:PM,kind:"push"},runtimeState:PM,durability:"restored",volatileStateFields:["lastChangedAt"]},s0=N(["auto","day","night","schedule"]),DM=d({min:l(),max:l(),step:l()}),zM=d({mode:s0,sensitivity:l().optional(),switchDelaySec:l().optional(),lastFetchedAt:l()}),dK=d({modes:w(s0),supportsSensitivity:A(),sensitivity:DM.optional(),supportsSwitchDelay:A(),switchDelaySec:DM.optional()}),pK=d({mode:s0.optional(),sensitivity:l().optional(),switchDelaySec:l().optional()}),mK={name:"day-night",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Camera],deviceConfig:{ui:{kind:"derived-form",builderId:"day-night",tab:"image"}},methods:{getOptions:b(d({deviceId:l()}),dK),setSettings:b(d({deviceId:l(),settings:pK}),O(),{kind:"mutation",auth:"admin"})},status:{schema:zM,kind:"poll"},runtimeState:zM,durability:"restored",volatileStateFields:["lastFetchedAt"]},Mg=d({online:A(),lastChangedAt:l()}),fK={name:"device-status",scope:"device",deviceNative:!0,mode:"singleton",methods:{},events:{onStatusChanged:{data:d({deviceId:l(),status:Mg})}},status:{schema:Mg,kind:"push"},runtimeState:Mg,durability:"restored",volatileStateFields:["lastChangedAt"]},LM=d({lastPressedAt:l().nullable(),pressCountSinceStart:l()}),hK=d({deviceId:l(),timestamp:l()}),gK={name:"doorbell",scope:"device",deviceNative:!0,mode:"singleton",kind:"wrapper",defaultActive:!1,deviceTypes:[U.Button,U.Camera],exposesDeviceSettings:!0,methods:{},events:{onPressed:{data:hK}},status:{schema:LM,kind:"push"},runtimeState:LM,durability:"restored"},vK=N(["date","time","datetime"]),qM=d({value:o(),format:vK.optional(),lastFetchedAt:l()}),yK={name:"enum-sensor",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Sensor],methods:{},status:{schema:qM,kind:"push"},runtimeState:qM,durability:"restored",volatileStateFields:["lastFetchedAt"]},sT=d({deviceId:l(),eventType:o(),data:X(o(),J()).nullable(),timestamp:l(),seq:l()}),BM=d({eventTypes:w(o()),lastEvent:sT.nullable(),eventCountSinceStart:l()}),bK={name:"event-emitter",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.EventEmitter],methods:{},events:{onEvent:{data:sT}},status:{schema:BM,kind:"push"},runtimeState:BM,durability:"session"},SK=d({id:o(),type:o(),timestamp:l(),label:o().optional(),thumbnailUrl:o().optional(),clipUrl:o().optional(),metadata:X(o(),J()).optional()}),xK={name:"events",scope:"device",mode:"singleton",deviceTypes:[U.Camera],methods:{getEvents:b(d({deviceId:l(),from:l().optional(),to:l().optional(),limit:l().optional()}),w(SK)),getEventThumbnail:b(d({deviceId:l(),eventId:o()}),d({base64:o(),contentType:o()}).nullable()),getEventClipUrl:b(d({deviceId:l(),eventId:o()}),o().nullable())}},FM=d({id:o(),name:o(),sampleCount:l().int().nonnegative(),coverMediaId:l().int().optional(),coverBase64:o().optional()}),kK=d({id:o(),source:N(["detected","photo"]),addedAt:l().int(),deviceId:l().int().optional(),base64:o().optional()}),wK=d({sampleId:o(),enrolledAt:l().int(),deviceId:l().int().optional(),source:N(["detected","photo"]),mediaId:l().int().optional(),comparable:A(),selfMean:l().nullable(),bestForeign:d({identityId:o(),name:o(),score:l()}).optional(),suspicion:l()}),MK=d({identityId:o(),name:o(),modelId:o(),totalSamples:l().int(),comparableSamples:l().int(),flagged:l().int(),flagThreshold:l(),rows:w(wK).readonly()}),UM=d({faceId:o(),deviceId:l().int(),trackId:o(),timestamp:l().int(),recognizedIdentityId:o().optional(),identityName:o().optional(),assigned:A(),base64:o().optional(),cropUrl:o().optional(),faceBbox:rr.optional(),keyFrameMediaId:l().int().optional(),bestMatchScore:l().optional(),nativeFaceShortSidePx:l().optional(),suggestedIdentityId:o().optional(),suggestedMatchScore:l().optional()}),CK=N(["unassigned","recognized","identified","all"]),AK=N(["timestamp","suggestionConfidence"]),EK=N(["asc","desc"]),RK=d({faceIds:w(o()).readonly(),representativeFaceId:o(),size:l().int(),cohesion:l()}),IK=d({mediaId:l().int(),kind:o(),url:o(),sizeBytes:l(),timestamp:l()}),TK={name:"face-gallery",scope:"system",mode:"singleton",methods:{listIdentities:b(d({includeCrops:A().optional()}).optional(),w(FM).readonly()),createIdentity:b(d({name:o().min(1)}),FM,{kind:"mutation",auth:"admin"}),renameIdentity:b(d({id:o(),name:o().min(1)}),O(),{kind:"mutation",auth:"admin"}),deleteIdentity:b(d({id:o()}),O(),{kind:"mutation",auth:"admin"}),listIdentitySamples:b(d({identityId:o()}),w(kK).readonly()),auditIdentitySamples:b(d({identityId:o().min(1)}),MK,{auth:"admin"}),removeSample:b(d({identityId:o(),sampleId:o()}),O(),{kind:"mutation",auth:"admin"}),listRecentFaces:b(d({deviceId:l().int().optional(),deviceIds:w(l().int()).optional(),limit:l().int().positive().optional(),filter:CK.optional(),since:l().int().optional(),until:l().int().optional(),sortBy:AK.optional(),sortDirection:EK.optional(),includeCrops:A().optional()}).optional(),w(UM).readonly()),getFaceByTrack:b(d({deviceId:l().int(),trackId:o()}),UM.nullable()),getFaceMedia:b(d({faceId:o()}),w(IK).readonly()),assignFace:b(d({faceId:o(),identityId:o()}),O(),{kind:"mutation",auth:"admin"}),unassignFace:b(d({faceId:o()}),O(),{kind:"mutation",auth:"admin"}),deleteFace:b(d({faceId:o()}),O(),{kind:"mutation",auth:"admin"}),assignFaces:b(d({faceIds:w(o()).min(1),identityId:o()}),d({assigned:l().int(),failed:w(o()).readonly()}),{kind:"mutation",auth:"admin"}),unassignFaces:b(d({faceIds:w(o()).min(1)}),d({unassigned:l().int(),failed:w(o()).readonly()}),{kind:"mutation",auth:"admin"}),suggestFaceClusters:b(d({threshold:l().min(0).max(1).optional(),minClusterSize:l().int().min(2).optional(),maxClusters:l().int().positive().optional(),limit:l().int().positive().optional(),maxFacesScanned:l().int().positive().optional()}).optional(),w(RK).readonly())}},lT=N(["forward","reverse"]),HM=d({percentage:l().min(0).max(100).nullable(),percentageStep:l().positive().optional(),preset:o(),availablePresets:w(o()),direction:lT.nullable(),oscillating:A().nullable(),lastChangedAt:l()}),_K={name:"fan-control",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Fan],methods:{setPercentage:b(d({deviceId:l().int().nonnegative(),percentage:l().min(0).max(100)}),O(),{kind:"mutation",auth:"protected"}),setPreset:b(d({deviceId:l().int().nonnegative(),preset:o().min(1)}),O(),{kind:"mutation",auth:"protected"}),setDirection:b(d({deviceId:l().int().nonnegative(),direction:lT}),O(),{kind:"mutation",auth:"protected"}),setOscillating:b(d({deviceId:l().int().nonnegative(),oscillating:A()}),O(),{kind:"mutation",auth:"protected"})},status:{schema:HM,kind:"push"},runtimeState:HM,durability:"session"},Cg=d({flags:X(o(),J()),deviceType:o().nullable(),model:o().nullable(),channelCount:l().nullable(),lastProbedAt:l(),lastFetchedAt:l()}),NK={name:"feature-probe",scope:"device",deviceNative:!0,mode:"singleton",methods:{},events:{onProbeChanged:{data:d({deviceId:l(),status:Cg})}},status:{schema:Cg,kind:"push"},runtimeState:Cg,durability:"session"},$M=d({flooded:A(),lastChangedAt:l()}),OK={name:"flood",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Sensor],methods:{},status:{schema:$M,kind:"push"},runtimeState:$M,durability:"restored",volatileStateFields:["lastChangedAt"]},QM=d({detected:A(),lastChangedAt:l()}),jK={name:"gas",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Sensor],methods:{},status:{schema:QM,kind:"push"},runtimeState:QM,durability:"restored",volatileStateFields:["lastChangedAt"]},VM=d({on:A(),currentHumidity:l().min(0).max(100).nullable(),targetHumidity:l().min(0).max(100).nullable(),mode:o().nullable(),availableModes:w(o()),action:o().nullable(),minHumidity:l().nullable(),maxHumidity:l().nullable(),lastChangedAt:l()}),PK={name:"humidifier",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Humidifier],methods:{setOn:b(d({deviceId:l().int().nonnegative(),on:A()}),O(),{kind:"mutation",auth:"protected"}),setTargetHumidity:b(d({deviceId:l().int().nonnegative(),humidity:l().min(0).max(100)}),O(),{kind:"mutation",auth:"protected"}),setMode:b(d({deviceId:l().int().nonnegative(),mode:o().min(1)}),O(),{kind:"mutation",auth:"protected"})},status:{schema:VM,kind:"push"},runtimeState:VM,durability:"session"},GM=d({percent:l().min(0).max(100),lastFetchedAt:l(),unit:o().optional(),precision:l().int().min(0).max(10).optional()}),DK={name:"humidity-sensor",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Sensor,U.Thermostat],methods:{},status:{schema:GM,kind:"push"},runtimeState:GM,durability:"restored",volatileStateFields:["lastFetchedAt"]},ZM=d({url:o().nullable(),lastUpdated:l().nullable()}),zK={name:"image",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Image],methods:{},status:{schema:ZM,kind:"push"},runtimeState:ZM,durability:"session"},l0=N(["0","90","180","270"]),c0=N(["auto","manual"]),u0=N(["auto","manual"]),d0=N(["off","blc","wdr","hlc"]),yc=d({min:l(),max:l(),step:l()}),KM=d({brightness:l().optional(),contrast:l().optional(),saturation:l().optional(),sharpness:l().optional(),mirror:A().optional(),flip:A().optional(),rotate:l0.optional(),whiteBalance:c0.optional(),warmth:l().optional(),exposureMode:u0.optional(),backlightMode:d0.optional(),lastFetchedAt:l()}),LK=d({supportsBrightness:A(),brightness:yc.optional(),supportsContrast:A(),contrast:yc.optional(),supportsSaturation:A(),saturation:yc.optional(),supportsSharpness:A(),sharpness:yc.optional(),supportsMirror:A(),supportsFlip:A(),rotateOptions:w(l0),whiteBalanceModes:w(c0),supportsWarmth:A(),warmth:yc.optional(),exposureModes:w(u0),backlightModes:w(d0)}),qK=d({brightness:l().optional(),contrast:l().optional(),saturation:l().optional(),sharpness:l().optional(),mirror:A().optional(),flip:A().optional(),rotate:l0.optional(),whiteBalance:c0.optional(),warmth:l().optional(),exposureMode:u0.optional(),backlightMode:d0.optional()}),BK={name:"image-settings",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Camera],deviceConfig:{ui:{kind:"derived-form",builderId:"image-settings",tab:"image"}},methods:{getOptions:b(d({deviceId:l()}),LK),setSettings:b(d({deviceId:l(),settings:qK}),O(),{kind:"mutation",auth:"admin"})},status:{schema:KM,kind:"poll"},runtimeState:KM,durability:"restored",volatileStateFields:["lastFetchedAt"]},WM=d({id:o(),addonId:o(),name:o(),enabled:A(),info:X(o(),J()).readonly(),createdAt:l(),updatedAt:l(),processState:o()}),Ag=d({id:o(),addonId:o(),name:o(),enabled:A(),info:X(o(),J()).readonly(),createdAt:l(),updatedAt:l()}),FK=d({addonId:o(),name:o(),description:o(),iconUrl:o().nullable(),color:o(),instanceMode:o(),mode:N(["standalone","account","broker"]),discoveryMode:o(),kind:N(["device-adoption","device-provider"]),brokerKind:o().nullable(),supportsLocationImport:A(),canTest:A(),existingInstances:w(d({id:o(),name:o()})),canAdd:A()}),UK=N(["validated","rejected","inconclusive","unsupported"]),HK=d({success:A(),error:o().optional(),status:UK.optional(),testedBy:o().nullable().optional(),latencyMs:l().nonnegative().optional(),detail:o().optional()}),$K=d({addonId:o(),name:o(),enabled:A().optional(),info:X(o(),J()).optional(),settings:X(o(),J()).optional(),skipRestart:A().optional()}),QK=d({id:o(),name:o().optional(),enabled:A().optional(),info:X(o(),J()).optional()}),VK=d({success:A(),deletedId:o()}),GK={name:"integrations",scope:"system",mode:"singleton",methods:{list:b(O(),w(WM)),get:b(d({id:o()}),WM),getByAddonId:b(d({addonId:o()}),Ag.nullable()),create:b($K,Ag,{kind:"mutation",auth:"admin"}),update:b(QK,Ag,{kind:"mutation",auth:"admin"}),delete:b(d({id:o()}),VK,{kind:"mutation",auth:"admin"}),getSettings:b(d({id:o()}),X(o(),J()),{auth:"admin"}),setSettings:b(d({id:o(),settings:X(o(),J())}),d({success:A()}),{kind:"mutation",auth:"admin"}),getAvailableTypes:b(O(),w(FK),{auth:"admin"}),testConnection:b(d({addonId:o(),settings:X(o(),J())}),HK,{kind:"mutation",auth:"admin"})},mount:{kind:"server-provided"}},ZK=d({codecs:w(o()),sampleRate:l(),duplex:N(["half","full"]),maxBacklogMs:l()}),Eg=d({talking:A(),lastSessionAt:l().nullable(),ability:ZK.nullable()}),KK=N(["opus","s16le","g711ulaw","g711alaw"]),WK={name:"intercom",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Camera],methods:{startSession:b(d({deviceId:l()}),d({sessionId:o(),sdpOffer:o()}),{kind:"mutation",auth:"protected"}),handleAnswer:b(d({deviceId:l(),sessionId:o(),sdpAnswer:o()}),O(),{kind:"mutation",auth:"protected"}),stopSession:b(d({deviceId:l(),sessionId:o()}),O(),{kind:"mutation",auth:"protected"}),startTalkSession:b(d({deviceId:l()}),d({sessionId:o()}),{kind:"mutation",auth:"protected"}),pushTalkAudio:b(d({deviceId:l(),audioBase64:o(),codec:KK.optional(),sampleRate:l().int().positive().optional(),channels:l().int().positive().optional(),sequenceNumber:l().int()}),d({accepted:A()}),{kind:"mutation",auth:"protected"}),endTalkSession:b(d({deviceId:l()}),O(),{kind:"mutation",auth:"protected"})},events:{onStatusChanged:{data:d({deviceId:l(),status:Eg})}},status:{schema:Eg,kind:"command-driven"},runtimeState:Eg,durability:"session"},YK=N(["idle","mowing","paused","docked","error"]),XK=N(["info","warning","error"]),YM=d({activity:YK,batteryLevel:l().min(0).max(100).nullable(),progressPercent:l().min(0).max(100).nullable(),currentCode:l().nullable(),currentCodeLabel:o().nullable(),severity:XK,lastChangedAt:l()}),JK={name:"lawn-mower-control",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.LawnMower],methods:{startMowing:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),pause:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),dock:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"})},status:{schema:YM,kind:"push"},runtimeState:YM,durability:"session"},eW=N(["lan","wifi","docker","vpn","loopback","other"]),cT=d({name:o(),family:N(["IPv4","IPv6"]),address:o(),cidr:o(),netmask:o(),internal:A(),mac:o(),kind:eW,preferred:A(),plausible:A(),plausibleReason:o()}),tW=d({interfaces:w(cT).readonly(),probedAt:l()}),nW=cT.nullable(),aW=d({label:o(),baseUrl:o(),kind:N(["lan-ipv4","lan-ipv6","public","loopback"]),interfaceKind:N(["lan","wifi","docker","vpn","other","loopback","public"]),plausible:A(),plausibleReason:o(),priority:l()}),iW=N(["server-config","server-env","caller-hint","default"]),rW=d({port:l().int().min(1).max(65535),source:iW}),oW=d({endpoints:w(aW).readonly(),localPort:rW}),XM=d({baseUrl:o().nullable(),resolved:o().nullable()}),JM=d({baseUrls:w(o()).readonly(),resolved:w(o()).readonly()}),Rg=d({addresses:w(o()).readonly()}),Wd=d({mode:N(["generated","uploaded","disabled"]),leafFingerprintSha256:o().nullable(),caFingerprintSha256:o().nullable(),validTo:o().nullable(),sans:w(o()),caCertPem:o().nullable(),reissueError:o().nullable(),restartRequired:A()}),sW={name:"local-network",scope:"system",mode:"singleton",methods:{list:b(O(),tW),getPreferred:b(O(),nW),getConnectionEndpoints:b(d({port:l().int().min(1).max(65535).optional(),includeLoopback:A().optional(),ipv4Only:A().optional(),scheme:N(["http","https"]).optional()}),oW),getNotificationEndpoint:b(O(),XM),setNotificationEndpoint:b(d({baseUrl:o().nullable()}),XM,{kind:"mutation"}),getViewerEndpoints:b(O(),JM),setViewerEndpoints:b(d({baseUrls:w(o()).readonly()}),JM,{kind:"mutation"}),getAllowedAddresses:b(O(),Rg),setAllowedAddresses:b(Rg,d({success:$(!0)}),{kind:"mutation"}),resetAllowlistToBestMatch:b(O(),Rg,{kind:"mutation"}),getTlsStatus:b(O(),Wd),regenerateCertificate:b(d({reason:o().optional()}),Wd,{kind:"mutation",auth:"admin"}),uploadCertificate:b(d({certPem:o().min(1),keyPem:o().min(1),caPem:o().optional()}),Wd,{kind:"mutation",auth:"admin"}),downloadCa:b(O(),d({pem:o()})),revertToGeneratedCertificate:b(O(),Wd,{kind:"mutation",auth:"admin"})},mount:{kind:"hub-only"}},lW=N(["locked","unlocked","locking","unlocking","jammed"]),e2=d({state:lW,lastChangedAt:l()}),cW={name:"lock-control",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Lock],methods:{lock:b(d({deviceId:l().int().nonnegative(),code:o().min(1).optional()}),O(),{kind:"mutation",auth:"protected"}),unlock:b(d({deviceId:l().int().nonnegative(),code:o().min(1).optional()}),O(),{kind:"mutation",auth:"protected"}),open:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"})},status:{schema:e2,kind:"push"},runtimeState:e2,durability:"restored",volatileStateFields:["lastChangedAt"]},uW=N(["off","on","idle","playing","paused","buffering","standby"]),uT=N(["off","all","one"]),dW=d({type:o(),title:o(),artist:o().optional(),album:o().optional(),imageUrl:o().optional()}),t2=d({state:uW,volumeLevel:l().min(0).max(100).nullable(),isMuted:A().nullable(),source:o(),availableSources:w(o()),currentMedia:dW.nullable(),positionMs:l().int().nonnegative().nullable(),durationMs:l().int().nonnegative().nullable(),shuffle:A().nullable(),repeat:uT.nullable(),lastChangedAt:l()}),pW={name:"media-player",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.MediaPlayer],methods:{play:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),pause:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),stop:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),next:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),previous:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),seek:b(d({deviceId:l().int().nonnegative(),positionMs:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),setVolume:b(d({deviceId:l().int().nonnegative(),volumeLevel:l().min(0).max(100)}),O(),{kind:"mutation",auth:"protected"}),setMute:b(d({deviceId:l().int().nonnegative(),muted:A()}),O(),{kind:"mutation",auth:"protected"}),setShuffle:b(d({deviceId:l().int().nonnegative(),shuffle:A()}),O(),{kind:"mutation",auth:"protected"}),setRepeat:b(d({deviceId:l().int().nonnegative(),repeat:uT}),O(),{kind:"mutation",auth:"protected"}),selectSource:b(d({deviceId:l().int().nonnegative(),source:o().min(1)}),O(),{kind:"mutation",auth:"protected"}),playMedia:b(d({deviceId:l().int().nonnegative(),mediaId:o().min(1),mediaType:o().min(1)}),O(),{kind:"mutation",auth:"protected"})},status:{schema:t2,kind:"push"},runtimeState:t2,durability:"session"},mW=d({id:o(),label:o(),scope:N(["mesh","public"]),url:o(),hostname:o(),port:l(),protocol:N(["http","https"])}),fW=d({id:o(),hostname:o(),magicDns:o(),addresses:w(o()).readonly(),os:o().optional(),online:A(),lastSeenMs:l(),isSelf:A(),connection:N(["direct","relay","idle"]),relay:o().nullable(),lastHandshakeMs:l(),rxBytes:l(),txBytes:l(),tags:w(o()).readonly(),exitNodeOption:A(),advertisedRoutes:w(o()).readonly(),userLogin:o().nullable(),keyExpiry:l().nullable()}),hW=d({joined:A(),meshIp:o(),magicDnsHostname:o(),peerCount:l(),endpoints:w(mW).readonly(),error:o().optional(),tenantName:o(),magicDnsSuffix:o(),userLogin:o().nullable(),controlPlaneUrl:o(),keyExpiry:l().nullable(),daemonSocket:o().optional(),daemonCliPath:o().optional()}),gW={name:"mesh-network",scope:"system",mode:"collection",providerKind:"mesh",methods:{getStatus:b(O(),hW),join:b(d({authKey:o().min(8),hostname:o().optional()}),d({joined:$(!0)}),{kind:"mutation"}),startLogin:b(d({hostname:o().optional()}),d({loginUrl:o()}),{kind:"mutation"}),leave:b(O(),d({left:$(!0)}),{kind:"mutation"}),logout:b(O(),d({loggedOut:$(!0)}),{kind:"mutation"}),listPeers:b(O(),d({peers:w(fW).readonly()})),testConnection:b(d({authKey:o().optional()}),d({ok:A(),tenant:o().optional(),daemonVersion:o().optional(),error:o().optional()}),{kind:"mutation"})}},n2=d({detected:A(),lastDetectedAt:l().nullable(),autoClearAfterMs:l().nullable()}),vW=d({deviceId:l(),detected:A(),timestamp:l(),source:a0,regions:w(Jp).readonly().optional()}),yW={name:"motion",scope:"device",mode:"singleton",deviceNative:!0,deviceTypes:[U.Camera,U.Sensor],methods:{isDetected:b(d({deviceId:l()}),A())},events:{onMotionChanged:{data:vW}},status:{schema:n2,kind:"push"},runtimeState:n2,durability:"session"},dT=d({enabled:A(),lastChangedAt:l()}),bW=dT.extend({lastFetchedAt:l()}),SW={name:"motion-trigger",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Light,U.Siren,U.Switch],methods:{setMotionTrigger:b(d({deviceId:l().int().nonnegative(),enabled:A()}),O(),{kind:"mutation",auth:"admin"})},events:{onMotionTriggerChanged:{data:d({deviceId:l(),enabled:A(),lastChangedAt:l()})}},status:{schema:dT,kind:"command-driven"},runtimeState:bW,durability:"session"},a2=d({x:l().min(0).max(1),y:l().min(0).max(1),width:l().gt(0).max(1),height:l().gt(0).max(1)}),pT=d({deviceId:l().int().positive(),source:a2,cell:a2}),xW=d({profile:N(["high","mid","low"]),offered:A(),missingSources:w(l().int().positive()),canvas:o(),published:A()}),i2=d({instanceId:o(),deviceId:l().int().nonnegative(),name:o(),fps:l().int(),cells:w(pT),profiles:w(xW)}),kW=d({deviceId:l().int().nonnegative(),name:o().min(1).max(160).optional(),fps:l().int().min(1).max(60).optional(),publishedProfiles:w(N(["high","mid","low"])).max(3).optional(),cells:w(pT).max(16)}),wW={name:"camera-grid-layout",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Camera],exposesDeviceSettings:!0,methods:{getLayout:b(d({deviceId:l().int().nonnegative()}),i2.nullable(),{auth:"admin"}),saveLayout:b(kW,i2,{kind:"mutation",auth:"admin"})}},mT=d({id:l(),enabled:A(),shape:CI}),r2=d({enabled:A(),sensitivity:l(),regions:w(mT),lastFetchedAt:l()}),MW=d({maxRegions:l(),supportedShapes:w(AI),grid:gH,sensitivity:d({min:l(),max:l(),step:l()})}),CW=d({enabled:A().optional(),sensitivity:l().optional(),regions:w(mT).optional()}),AW={name:"motion-zones",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Camera],deviceConfig:{ui:{kind:"widget",widgetId:"host/motion-zones-grid",tab:"motion",label:"Motion Zones"}},methods:{getOptions:b(d({deviceId:l()}),MW),setZone:b(d({deviceId:l(),patch:CW}),O(),{kind:"mutation",auth:"admin"})},status:{schema:r2,kind:"poll"},runtimeState:r2,durability:"restored",volatileStateFields:["lastFetchedAt"]},am=N(["person","vehicle","animal","face","package","other"]),fT=d({class:am,timestamp:l(),confidence:l().min(0).max(1).optional()}),hT=d({lastByClass:x8(am,fT.nullable()),supportedClasses:w(am).readonly(),enabled:A()}),EW=N(["boxed","while-streaming","flag-only"]),RW=d({supportedClasses:w(am).readonly(),geometry:EW}),IW=d({enabled:A().optional()}),TW=hT.extend({lastFetchedAt:l()}),_W={name:"native-object-detection",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Camera],methods:{getOptions:b(d({deviceId:l()}),RW),setSettings:b(d({deviceId:l(),settings:IW}),O(),{kind:"mutation",auth:"admin"}),setEnabled:b(d({deviceId:l(),enabled:A()}),O(),{kind:"mutation",auth:"admin"})},events:{onDetected:{data:d({deviceId:l(),detection:fT})}},status:{schema:hT,kind:"push"},runtimeState:TW,durability:"restored",volatileStateFields:["lastFetchedAt"]},NW=d({pan:l().min(-1).max(1).optional(),tilt:l().min(-1).max(1).optional(),speed:l().min(0).max(1).optional()}),OW=N(["goHome","locate","spotClean","findPet","personFollow","stop","startClean","pauseClean","dockWash","autoEmpty","flashOn","flashOff"]),jW=N(["action","sound"]),PW=d({id:o(),kind:jW,label:o(),icon:o(),soundId:l().int().optional(),enabled:A()}),DW=d({x:l(),y:l()}),zW=d({move:A(),stop:A(),goToPoint:A(),runAction:A(),playSound:A(),light:A(),lightMode:A()}),gT=N(["auto","manual"]),LW=N(["idle","cleaning","spot","following","goto","returning","paused","unknown"]),ly=d({mode:LW,following:A(),flash:A(),lightMode:gT,lightLevel:l().min(40).max(100),lastChangedAt:l()}),qW=ly.extend({lastFetchedAt:l()}),BW={name:"navigation",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Camera],deviceConfig:{ui:{kind:"widget",widgetId:"host/navigation-panel",tab:"navigation",topTab:!0,label:"Navigation",order:0}},methods:{move:b(NW.extend({deviceId:l()}),O(),{kind:"mutation"}),stop:b(d({deviceId:l()}),O(),{kind:"mutation"}),goToPoint:b(DW.extend({deviceId:l()}),O(),{kind:"mutation"}),listActions:b(d({deviceId:l()}),w(PW)),runAction:b(d({deviceId:l(),actionId:OW}),O(),{kind:"mutation"}),playSound:b(d({deviceId:l(),soundId:l().int()}),O(),{kind:"mutation"}),setLightOn:b(d({deviceId:l(),on:A()}),O(),{kind:"mutation"}),setLightMode:b(d({deviceId:l(),mode:gT,level:l().min(40).max(100).optional()}),O(),{kind:"mutation"}),setLightLevel:b(d({deviceId:l(),level:l().min(40).max(100)}),O(),{kind:"mutation"}),getFeatures:b(d({deviceId:l()}),zW)},events:{onStatusChanged:{data:d({deviceId:l(),status:ly})}},status:{schema:ly,kind:"push"},runtimeState:qW,durability:"session"},FW=["wifi","ethernet","cellular","unknown"],Ig=d({type:N(FW),signalPercent:l().min(0).max(100).nullable(),rssiDbm:l().optional(),ssid:o().optional(),lastUpdated:l()}),UW={type:"unknown",signalPercent:null,lastUpdated:0},HW={name:"network-link",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Camera,U.Sensor,U.Button,U.Switch,U.Light,U.Lock,U.Siren],methods:{},events:{onStatusChanged:{data:d({deviceId:l(),status:Ig})}},status:{schema:Ig,kind:"push",empty:UW},runtimeState:Ig,durability:"restored",volatileStateFields:["lastUpdated"]},$W=d({nominalBitrateKbps:l(),observedBitrateKbps:l(),peakBitrateKbps:l(),packetLossPercent:l(),lastUpdated:l()}),QW=d({rttMs:l(),jitterMs:l(),estimatedBandwidthKbps:l(),packetLossPercent:l().min(0).max(100),lastUpdated:l()}),o2=d({deviceId:l(),streams:X(o(),$W),client:QW.optional()}),VW={name:"network-quality",scope:"system",mode:"singleton",methods:{getDeviceStats:b(d({deviceId:l()}),o2.nullable()),getAllStats:b(O(),w(o2).readonly()),reportClientStats:b(d({deviceId:l(),rttMs:l().min(0).max(6e4),jitterMs:l().min(0).max(1e4),estimatedBandwidthKbps:l().min(0).max(1e6),packetLossPercent:l().min(0).max(100)}),O(),{kind:"mutation"})},mount:{kind:"server-provided"}},GW=d({addonId:o(),capabilities:w(o()).readonly(),status:o()}),ZW=d({pid:l(),name:o(),state:o(),cpuPercent:l(),memoryRss:l(),uptimeSeconds:l(),services:w(GW).readonly(),groupId:o().optional()}),KW=d({id:o(),status:o(),cpuPercent:l(),memoryRss:l()}),WW=d({category:o(),total:l(),healthy:l(),addons:w(KW).readonly()}),YW=d({name:o(),version:o()}),XW=d({id:o(),name:o(),hostname:o(),platform:o(),arch:o(),cpuModel:o().nullable(),cpuCores:l(),memoryMB:l(),engines:w(o()).readonly(),isHub:A(),isOnline:A(),cpuPercent:l(),memoryPercent:l(),uptime:l(),lastSeen:o(),localIps:w(o()).readonly(),addons:w(d({id:o(),capabilities:w(o()).readonly(),status:o()})).readonly(),processes:w(ZW).readonly(),categories:w(WW).readonly(),rootPackage:YW.nullable()}),JW=d({callerAddonId:o(),providerAddonId:o(),capName:o(),callsPerMin:l(),lastCallAtMs:l()}),eY=d({nodeId:o(),name:o(),version:o(),status:o(),synced:A()}),tY=d({hubVersion:o(),nodes:w(eY)}),Tg=d({nodeId:o(),addonId:o()}),nY=d({id:o(),status:o(),version:o().optional(),packageName:o().optional()}),bc=d({success:A()}),aY=d({success:A(),reason:o().optional()}),iY=d({restarted:w(o()).readonly(),failed:w(o()).readonly()}),rY=d({nodeId:o(),name:o()}),oY={name:"nodes",scope:"system",mode:"singleton",nodeIdMode:"data",methods:{topology:b(O(),w(XW).readonly(),{auth:"admin"}),deployAddon:b(Tg,bc,{kind:"mutation",auth:"admin"}),undeployAddon:b(Tg,bc,{kind:"mutation",auth:"admin"}),restartAddon:b(Tg,bc,{kind:"mutation",auth:"admin"}),restartProcess:b(d({nodeId:o(),processName:o()}),aY,{kind:"mutation",auth:"admin"}),restartNode:b(d({nodeId:o()}),iY,{kind:"mutation",auth:"admin"}),shutdownNode:b(d({nodeId:o()}),bc,{kind:"mutation",auth:"admin"}),renameNode:b(d({nodeId:o(),name:o().min(1).max(64)}),rY,{kind:"mutation",auth:"admin"}),clusterAddonStatus:b(O(),X(o(),tY),{auth:"admin"}),getCapUsageGraph:b(d({windowSeconds:l().int().positive().max(300).default(60)}),w(JW).readonly(),{auth:"admin"}),getNodeAddons:b(d({nodeId:o()}),w(nY).readonly(),{auth:"admin"}),setProcessLogLevel:b(d({nodeId:o(),level:o()}),bc,{kind:"mutation",auth:"admin"}),executeQuery:b(d({nodeId:o(),addonId:o(),queryName:o(),params:X(o(),J()).optional()}),J(),{kind:"mutation",auth:"admin"})},mount:{kind:"server-provided"}},sY=N(["min","low","normal","high"]),lY=d({id:o().min(1),title:o().min(1),uri:QL().optional(),destructive:A().optional()}),cY=d({image:A(),priority:A(),data:A(),actions:A(),recipients:A()}),s2=d({lastSentAt:l(),lastError:o().nullable(),queueDepth:l().int().nonnegative(),supports:cY}),uY=d({deviceId:l().int().nonnegative(),title:o().optional(),body:o().min(1),image:o().optional(),priority:sY.optional(),channel:o().optional(),recipients:w(o()).optional(),actions:w(lY).optional(),data:X(o(),J()).optional()}),dY=d({notificationId:o(),acceptedAt:l()}),pY={name:"notifier",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Notifier],methods:{send:b(uY,dY,{kind:"mutation",auth:"admin"}),cancel:b(d({deviceId:l().int().nonnegative(),notificationId:o().min(1)}),O(),{kind:"mutation",auth:"admin"})},events:{onSent:{data:d({deviceId:l(),notificationId:o(),success:A(),error:o().nullable(),acceptedAt:l()})}},status:{schema:s2,kind:"command-driven"},runtimeState:s2,durability:"session"},l2=d({value:l(),unit:o().optional(),precision:l().int().min(0).max(10).optional(),lastFetchedAt:l()}),mY={name:"numeric-sensor",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Sensor],methods:{},status:{schema:l2,kind:"push"},runtimeState:l2,durability:"restored",volatileStateFields:["lastFetchedAt"]},vT=N(["text","timestamp","watermark"]),cy=N(["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right","custom"]),fY=d({id:o(),kind:vT,enabled:A(),text:o().optional(),position:cy.optional(),availablePositions:w(cy).readonly(),readOnly:A().optional()}),c2=d({overlays:w(fY).readonly()}),hY=d({enabled:A().optional(),text:o().optional(),position:cy.optional()}).partial(),gY={name:"osd",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Camera],methods:{setOverlay:b(d({deviceId:l(),overlayId:o(),patch:hY}),O(),{kind:"mutation",auth:"admin"})},events:{onStatusChanged:{data:d({deviceId:l(),status:c2})}},status:{schema:c2,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}}}]}},vY=kt("kind",[d({kind:$("static"),text:o().max(64)}),d({kind:$("clock"),pattern:o().min(1).max(32).default("HH:mm"),timezone:o().min(1).max(64).optional()}),d({kind:$("device-state"),deviceId:l().int().optional(),capName:o().min(1).max(64),valuePath:o().min(1).max(64)}),d({kind:$("latest-recognition"),recognition:N(["person","plate"])})]),uy=d({enabled:A().default(!0),source:vY,template:o().max(96).default("${value}"),maxCharacters:l().int().min(4).max(64).optional(),maxDecimals:l().int().min(0).max(4).default(1),unitLabel:o().max(8).optional(),valueMap:X(o(),o()).optional(),schedule:Nm.optional(),conditions:Zb.optional(),fallbackText:o().max(64).default("")}),u2=d({slotId:o(),kind:vT,readOnly:A(),cameraEnabled:A(),cameraText:o().optional(),binding:uy.nullable()}),yY=N(["written","unchanged","gated","unreadable","disabled","unbound","failed"]),_g=d({slotId:o(),outcome:yY,text:o(),reason:o().optional()}),bY=N(["number","boolean","string","enum"]),SY=d({deviceId:l().int(),deviceName:o(),capName:o(),valuePath:o(),label:o(),valueType:bY,enumValues:w(o()).readonly().optional()}),xY={name:"osd-manager",scope:"system",mode:"singleton",methods:{getDeviceOsd:b(d({deviceId:l().int()}),d({supported:A(),slots:w(u2)}),{auth:"admin"}),getSourceCatalog:b(d({deviceId:l().int()}),d({sources:w(SY)}),{auth:"admin"}),getConditionSupport:b(d({}),d({supported:w(o()),catalog:w(_I)}),{auth:"admin"}),setSlotBinding:b(d({deviceId:l().int(),slotId:o().min(1),binding:uy}),d({slot:u2,render:_g}),{kind:"mutation",auth:"admin"}),clearSlotBinding:b(d({deviceId:l().int(),slotId:o().min(1)}),d({success:$(!0)}),{kind:"mutation",auth:"admin"}),copyDeviceConfiguration:b(d({sourceDeviceId:l().int(),targetDeviceId:l().int()}),d({copied:l().int().nonnegative(),skipped:l().int().nonnegative()}),{kind:"mutation",auth:"admin"}),previewSlot:b(d({deviceId:l().int(),slotId:o().min(1),binding:uy.optional()}),_g,{kind:"mutation",auth:"admin"}),renderDevice:b(d({deviceId:l().int()}),d({results:w(_g)}),{kind:"mutation",auth:"admin"})}},yT=4,p0=200,kY=N(["normal","offline","on_batteries"]),Ng=l().int().min(4).max(200),d2=d({foodLevel:l().nullable(),food1:l().nullable(),food2:l().nullable(),lowFood:A(),batteryPower:l().min(0).max(100).nullable(),desiccantLeftDays:l().nullable(),feeding:A(),status:kY.nullable(),error:o().nullable(),errorCode:l().nullable(),isDualHopper:A(),childLock:A(),indicatorLight:A(),feedSound:A(),volume:l(),lastFetchedAt:l()}),wY={name:"pet-feeder",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.PetFeeder],methods:{feed:b(d({deviceId:l().int().nonnegative(),grams:Ng.optional(),hopper1:Ng.optional(),hopper2:Ng.optional()}),O(),{kind:"mutation",auth:"protected"}),cancelFeed:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),resetDesiccant:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),markFoodReplenished:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),callPet:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),playSound:b(d({deviceId:l().int().nonnegative(),soundId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),setChildLock:b(d({deviceId:l().int().nonnegative(),on:A()}),O(),{kind:"mutation",auth:"protected"}),setIndicatorLight:b(d({deviceId:l().int().nonnegative(),on:A()}),O(),{kind:"mutation",auth:"protected"}),setFeedSound:b(d({deviceId:l().int().nonnegative(),on:A()}),O(),{kind:"mutation",auth:"protected"}),setVolume:b(d({deviceId:l().int().nonnegative(),level:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"})},status:{schema:d2,kind:"poll"},runtimeState:d2,durability:"session"},p2=d({id:o(),name:o(),sampleCount:l().int().nonnegative(),coverMediaId:l().int().optional(),coverBase64:o().optional()}),MY=d({id:o(),text:o(),score:l(),addedAt:l().int(),deviceId:l().int().optional(),base64:o().optional()}),Og=d({plateId:o(),deviceId:l().int(),trackId:o(),timestamp:l().int(),text:o(),score:l(),corrected:A(),recognizedVehicleId:o().optional(),vehicleName:o().optional(),assigned:A(),plateBbox:rr.optional(),keyFrameMediaId:l().int().optional(),base64:o().optional(),cropUrl:o().optional()}),CY=d({mediaId:l().int(),kind:o(),url:o(),sizeBytes:l(),timestamp:l()}),AY=d({plateIds:w(o()).readonly(),representativePlateId:o(),representativeText:o(),size:l().int(),cohesion:l()}),EY={name:"plate-gallery",scope:"system",mode:"singleton",methods:{listPlates:b(d({deviceId:l().int().optional(),limit:l().int().positive().optional(),includeCrops:A().optional()}).optional(),w(Og).readonly()),getPlateByTrack:b(d({deviceId:l().int(),trackId:o()}),Og.nullable()),getPlateMedia:b(d({plateId:o()}),w(CY).readonly()),searchPlates:b(d({text:o().min(1),maxDistance:l().int().min(0).optional(),limit:l().int().positive().optional(),includeCrops:A().optional()}),w(Og).readonly()),suggestPlateClusters:b(d({maxDistance:l().int().min(0).optional(),minClusterSize:l().int().min(2).optional(),limit:l().int().positive().optional()}).optional(),w(AY).readonly()),correctPlateText:b(d({plateId:o(),text:o().min(1)}),O(),{kind:"mutation",auth:"admin"}),deletePlate:b(d({plateId:o()}),O(),{kind:"mutation",auth:"admin"}),listVehicles:b(d({includeCrops:A().optional()}).optional(),w(p2).readonly()),createVehicle:b(d({name:o().min(1)}),p2,{kind:"mutation",auth:"admin"}),renameVehicle:b(d({id:o(),name:o().min(1)}),O(),{kind:"mutation",auth:"admin"}),deleteVehicle:b(d({id:o()}),O(),{kind:"mutation",auth:"admin"}),listVehicleSamples:b(d({vehicleId:o()}),w(MY).readonly()),removeVehicleSample:b(d({vehicleId:o(),sampleId:o()}),O(),{kind:"mutation",auth:"admin"}),assignPlate:b(d({plateId:o(),vehicleId:o()}),O(),{kind:"mutation",auth:"admin"}),unassignPlate:b(d({plateId:o()}),O(),{kind:"mutation",auth:"admin"}),assignPlates:b(d({plateIds:w(o()).min(1),vehicleId:o()}),d({assigned:l().int(),failed:w(o()).readonly()}),{kind:"mutation",auth:"admin"}),unassignPlates:b(d({plateIds:w(o()).min(1)}),d({unassigned:l().int(),failed:w(o()).readonly()}),{kind:"mutation",auth:"admin"})}},bT=N(Rm),RY=N(["videotoolbox","cuda","nvdec","vaapi","qsv","d3d11va","dxva2","amf","vdpau","drm","coreml","tensorrt","openvino","directml","webgpu","none"]).nullable().optional(),IY=d({preferred:w(o()).readonly(),rationale:o()}),dy=N(["h264_videotoolbox","hevc_videotoolbox","h264_vaapi","hevc_vaapi","h264_nvenc","hevc_nvenc","h264_qsv","hevc_qsv","h264_amf","hevc_amf","libx264","libx265"]),TY=d({encoder:dy,codec:N(["H264","H265"]),family:N(["videotoolbox","vaapi","nvenc","qsv","amf","software"]),available:A(),reason:o().optional()});d({encoders:w(TY).readonly(),defaultH264:dy,defaultH265:dy,probedAt:l()});d({methods:w(o()).readonly(),probedAt:l()});var _Y=N(["darwin","linux","win32"]),NY=N(["arm64","x64"]),OY=d({type:N(["nvidia","amd","intel","apple"]),name:o(),memoryMB:l().optional()}),jY=d({type:N(["apple-ane","intel-npu"])}),PY=d({type:$("coral-edgetpu"),bus:o().optional()}),ST=d({platform:_Y,arch:NY,cpuModel:o(),cpuCores:l(),totalRAM_MB:l(),availableRAM_MB:l(),gpu:OY.nullable(),npu:jY.nullable(),coral:PY.nullable().optional()}),m2=d({runtime:N(["node","python"]),backend:o(),format:N(["onnx","coreml","openvino","tflite"]),score:l(),reason:o(),available:A()}),DY=d({key:o(),backend:o(),device:o(),format:bT,runtime:$("python"),score:l(),available:A()}),zY=d({hardware:ST,scores:w(m2).readonly(),bestScore:m2,pythonPath:o().nullable(),devices:w(DY).readonly()}),LY=d({modelId:o(),name:o(),minRAM_MB:l(),accuracyScore:l(),formats:w(o()).readonly()}),qY=d({modelId:o(),runtime:N(["node","python"]),backend:o(),format:bT,reason:o()}),BY={name:"platform-probe",scope:"system",mode:"singleton",methods:{getCapabilities:b(O(),zY),getHardware:b(O(),ST),resolveInferenceConfig:b(d({requirements:w(LY).readonly()}),qY),resolveHwAccel:b(d({prefer:RY}),IY)}},f2=d({watts:l().optional(),kwhTotal:l().optional(),volts:l().optional(),amps:l().optional(),va:l().optional(),powerFactor:l().min(0).max(1).optional(),lastFetchedAt:l(),unit:o().optional(),precision:l().int().min(0).max(10).optional()}),FY={name:"power-meter",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Sensor],methods:{},status:{schema:f2,kind:"push"},runtimeState:f2,durability:"restored",volatileStateFields:["lastFetchedAt"]},UY=d({latitude:l().min(-90).max(90),longitude:l().min(-180).max(180),accuracyMeters:l().nonnegative()}),h2=d({state:o(),location:o().nullable(),gps:UY.nullable(),batteryPercent:l().min(0).max(100).nullable(),lastChangedAt:l()}),HY={name:"presence",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Presence],methods:{},status:{schema:h2,kind:"push"},runtimeState:h2,durability:"restored",volatileStateFields:["lastChangedAt"]},g2=d({hpa:l(),lastFetchedAt:l(),unit:o().optional(),precision:l().int().min(0).max(10).optional()}),$Y={name:"pressure-sensor",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Sensor],methods:{},status:{schema:g2,kind:"push"},runtimeState:g2,durability:"restored",volatileStateFields:["lastFetchedAt"]},QY=kt("kind",[ll,_m]),xT=d({id:l(),enabled:A(),shape:QY}),v2=d({enabled:A(),regions:w(xT).nullable(),audioEnabled:A().nullable(),lastFetchedAt:l()}),VY=d({maxRegions:l(),supportedShapes:w(AI),polygonVertices:hH.optional(),supportsAudioMute:A()}),GY=d({enabled:A().optional(),regions:w(xT).optional()}),ZY={name:"privacy-mask",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Camera],deviceConfig:{ui:{kind:"widget",widgetId:"host/privacy-mask-grid",tab:"image",label:"Privacy Mask"}},methods:{getOptions:b(d({deviceId:l()}),VY),setMask:b(d({deviceId:l(),patch:GY}),O(),{kind:"mutation",auth:"admin"}),setAudioEnabled:b(d({deviceId:l(),enabled:A()}),O(),{kind:"mutation",auth:"admin"})},status:{schema:v2,kind:"poll"},runtimeState:v2,durability:"restored",volatileStateFields:["lastFetchedAt"]},KY=N(["home","day-mode","night-mode","day-night-auto","set-limits","save-limits","reboot","osd-menu"]),WY=d({id:o(),name:o(),fn:KY.nullable(),writable:A()}),kT=d({pan:l().nullable(),tilt:l().nullable(),zoom:l().nullable()}),y2=d({pan:l().optional(),tilt:l().optional(),zoom:l().optional(),speed:l().optional()}),YY=kT.extend({autofocus:A()}),XY=d({hasPan:A(),hasTilt:A(),hasZoom:A(),supportsPresets:A(),maxPresets:l().optional(),hasAutofocus:A(),speedSteps:l().int().positive().nullable(),moveImpulseMs:l().int().positive().nullable()}),JY=d({presetId:o().nullable(),source:N(["operator","firmware","native","none"])}),eX=d({enabled:A(),seconds:l().int()}),tX={name:"ptz",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Camera],deviceConfig:{ui:{kind:"widget",widgetId:"host/ptz-panel",tab:"ptz",topTab:!0,label:"PTZ",order:0}},methods:{move:b(y2.extend({deviceId:l()}),O(),{kind:"mutation"}),continuousMove:b(y2.extend({deviceId:l()}),O(),{kind:"mutation"}),stop:b(d({deviceId:l()}),O(),{kind:"mutation"}),getPresets:b(d({deviceId:l()}),w(WY)),goToPreset:b(d({deviceId:l(),presetId:o()}),O(),{kind:"mutation"}),savePreset:b(d({deviceId:l(),presetId:o(),name:o()}),O(),{kind:"mutation",auth:"admin"}),deletePreset:b(d({deviceId:l(),presetId:o()}),O(),{kind:"mutation",auth:"admin"}),getOptions:b(d({deviceId:l()}),XY),goHome:b(d({deviceId:l()}),O(),{kind:"mutation"}),getHomePreset:b(d({deviceId:l()}),JY),setHomePreset:b(d({deviceId:l(),presetId:o().nullable()}),O(),{kind:"mutation",auth:"admin"}),captureHomeHere:b(d({deviceId:l()}),O(),{kind:"mutation",auth:"admin"}),getHomeReturn:b(d({deviceId:l()}),eX.nullable()),setHomeReturn:b(d({deviceId:l(),enabled:A(),seconds:l().int().min(0).max(3600)}),O(),{kind:"mutation",auth:"admin"}),getPosition:b(d({deviceId:l()}),kT),setAutofocus:b(d({deviceId:l(),enabled:A()}),O(),{kind:"mutation"})},status:{schema:YY,kind:"command-driven"}},nX=o().describe("Vendor target string (people/vehicle/pet); empty = camera default"),py=d({targetType:nX,stopDelaySeconds:l().int().min(0).max(300),disappearDelaySeconds:l().int().min(0).max(300)}),aX=d({value:o(),label:o()}),Mp=d({enabled:A(),lastChangedAt:l(),currentSettings:py.nullable(),supportedTargetTypes:w(aX)}),iX=Mp.extend({lastFetchedAt:l()}),rX={name:"ptz-autotrack",scope:"device",deviceNative:!0,mode:"singleton",kind:"wrapper",defaultActive:!1,deviceTypes:[U.Camera],deviceConfig:{ui:{kind:"widget",widgetId:"host/ptz-autotrack",tab:"ptz",topTab:!0,label:"Auto-Tracking",order:5}},methods:{getStatus:b(d({deviceId:l()}),Mp),setEnabled:b(d({deviceId:l(),enabled:A()}),O(),{kind:"mutation"}),getSettings:b(d({deviceId:l()}),py.nullable()),setSettings:b(d({deviceId:l(),settings:py.partial()}),O(),{kind:"mutation"})},events:{onStatusChanged:{data:d({deviceId:l(),status:Mp})}},status:{schema:Mp,kind:"command-driven"},runtimeState:iX,durability:"session"},oX={name:"reboot",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Camera,U.Sensor,U.Switch],methods:{reboot:b(d({deviceId:l().int().nonnegative()}),d({success:$(!0)}),{kind:"mutation",auth:"admin"})}},b2=d({deviceId:l(),enabled:A(),activeMode:_b,nodeId:o(),storageBytes:l()}),wT=d({profile:o(),startMs:l(),endMs:l()}),sX=d({deviceId:l(),ranges:w(wT),profilesWithFootage:w(o())}),lX=d({deviceId:l(),days:w(l())}),cX=d({deviceId:l(),read:N(["read","unreadable"]),ranges:w(wT).readonly(),profilesWithFootage:w(o()).readonly()}),uX=d({deviceId:l(),read:N(["read","unreadable"]),days:w(l()).readonly()}),dX=d({deviceId:l(),localMasterPath:o().nullable(),playbackUrl:o().nullable(),playbackEndpoints:w(o())}),pX=d({deviceId:l(),usedBytes:l(),oldestMs:l().nullable().optional(),segments:l().optional(),residentBytes:l().optional(),residentOldestMs:l().nullable().optional()}),mX=d({locationId:o().nullable(),locationIds:w(o()).optional(),root:o().optional(),usedBytes:l(),availableBytes:l().nullable(),totalBytes:l().nullable()}),fX=d({nodeId:o(),totalUsedBytes:l(),devices:w(pX),devicesRead:N(["archive","unavailable"]).optional(),locations:w(mX).optional()}),hX=d({deviceId:l(),profile:o(),fromLocationId:o(),toLocationId:o(),bytes:l(),files:l().int()}),gX=N(["unassigned","target-not-writable","below-threshold","no-headroom"]),vX=d({deviceId:l(),profile:o(),fromLocationId:o(),toLocationId:o().nullable(),bytes:l(),reason:gX}),S2=d({moves:w(hX),skipped:w(vX),bytesToMove:l(),jobIds:w(o())}),x2=d({throttleMbps:l().min(1).max(1e3).optional(),minMoveGb:l().min(0).optional()}),yX=d({deviceId:l().int(),profile:o(),locationId:o()}),bX=d({deviceId:l().int(),locationId:o()}),SX=d({assignments:w(yX),pins:w(bX),defaultLocations:X(o(),o())}),xX=d({deviceId:l().int(),locationId:o().nullable()}),kX=kt("kind",[d({kind:$("segment"),startMs:l(),durMs:l(),bytes:l()}),d({kind:$("gap"),nearestEdgeMs:l().nullable(),prevEndMs:l().nullable().optional()})]),wX=d({data:Ht(Uint8Array)}),MX=d({data:Ht(Uint8Array),gopStartMs:l(),gopDurMs:l()}),CX=kt("kind",[d({kind:$("ok"),data:Ht(Uint8Array),gopStartMs:l(),gopDurMs:l(),reachesRequestedEnd:A()}),d({kind:$("spans-multiple-segments"),segmentEndMs:l()})]),AX={name:"recording",scope:"system",mode:"singleton",exposesDeviceSettings:!0,status:{schema:b2,kind:"command-driven"},methods:{getAvailability:b(d({deviceId:l(),fromMs:l(),toMs:l(),profile:o().optional()}),sX,{kind:"query",auth:"protected"}),getAvailabilityBatch:b(d({deviceIds:w(l()).min(1).max(200),fromMs:l(),toMs:l()}),w(cX).readonly(),{kind:"query",auth:"protected"}),getDaysWithRecordings:b(d({deviceId:l(),fromMs:l(),toMs:l(),tzOffsetMinutes:l()}),lX,{kind:"query",auth:"protected"}),getDaysWithRecordingsBatch:b(d({deviceIds:w(l()).min(1).max(200),fromMs:l(),toMs:l(),tzOffsetMinutes:l()}),w(uX).readonly(),{kind:"query",auth:"protected"}),getPlaybackManifest:b(d({deviceId:l(),fromMs:l(),toMs:l()}),dX,{kind:"query",auth:"protected"}),getStorageUsage:b(d({}),fX,{kind:"query",auth:"admin"}),getDeviceConfig:b(d({deviceId:l()}),og,{kind:"query",auth:"admin"}),locateSegment:b(d({deviceId:l(),profile:o(),epochMs:l()}),kX,{kind:"query",auth:"admin"}),readSegmentBytes:b(d({deviceId:l(),profile:o(),startMs:l()}),wX,{kind:"query",auth:"admin"}),readGopBytes:b(d({deviceId:l(),profile:o(),startMs:l(),epochMs:l()}),MX,{kind:"query",auth:"admin"}),readWindowBytes:b(d({deviceId:l(),profile:o(),startMs:l(),fromMs:l(),toMs:l()}),CX,{kind:"query",auth:"admin"}),setDeviceConfig:b(d({deviceId:l(),config:og}),og,{kind:"mutation",auth:"admin"}),rescanStorage:b(d({deviceId:l()}),b2,{kind:"mutation",auth:"admin"}),pruneFootage:b(d({deviceId:l(),reason:Tb.optional()}),d({floorMs:l().nullable(),deletedBuckets:l().int(),reclaimedBytes:l().int()}),{kind:"mutation",auth:"admin"}),deleteFootprint:b(d({deviceId:l(),fromMs:l().optional(),toMs:l().optional()}),d({deletedBuckets:l().int(),reclaimedBytes:l().int()}),{kind:"mutation",auth:"admin"}),listOpsLog:b(ER,w(AR).readonly(),{kind:"query",auth:"admin"}),renderGif:b(d({deviceId:l(),aroundMs:l(),preRollSec:l().min(0).max(30).default(2),postRollSec:l().min(0).max(30).default(5),maxWidth:l().int().min(120).max(1280).default(480),fps:l().int().min(1).max(15).default(5)}),d({gifBase64:o(),fromMs:l(),toMs:l()}),{kind:"mutation",auth:"admin"}),renderClip:b(d({deviceId:l(),aroundMs:l(),preRollSec:l().min(0).max(30).default(3),postRollSec:l().min(0).max(30).default(7),maxWidth:l().int().min(160).max(1920).default(640)}),d({clipBase64:o(),mime:o(),fromMs:l(),toMs:l(),bytes:l().int()}),{kind:"mutation",auth:"admin"}),pauseForStorageMigration:b(qr,d({paused:$(!0)}),{kind:"mutation",auth:"admin"}),resumeForStorageMigration:b(qr,d({resumed:$(!0)}),{kind:"mutation",auth:"admin"}),refreshStorageLocationsForMigration:b(qr,d({refreshed:$(!0)}),{kind:"mutation",auth:"admin"}),startStorageMigrationMove:b(Qq,d({jobId:o()}),{kind:"mutation",auth:"admin"}),getStorageMigrationMoveStatus:b(d({jobId:o()}),Zc.nullable(),{auth:"admin"}),cancelStorageMigrationMove:b(d({jobId:o()}),d({cancelled:A()}),{kind:"mutation",auth:"admin"}),relocateFootage:b(NR,d({jobId:o()}),{kind:"mutation",auth:"admin"}),listRelocateJobs:b(d({}),w(Zc).readonly(),{kind:"query",auth:"admin"}),getRelocateResidue:b(r7,o7,{kind:"query",auth:"admin"}),reconcileLedgerAgainstDisk:b(s7,d7,{kind:"mutation",auth:"admin"}),cancelRelocateJob:b(d({jobId:o()}),d({cancelled:A()}),{kind:"mutation",auth:"admin"}),planStorageRebalance:b(x2,S2,{kind:"query",auth:"admin"}),startStorageRebalance:b(x2,S2,{kind:"mutation",auth:"admin"}),getPlacement:b(d({}),SX,{kind:"query",auth:"admin"}),setDevicePlacement:b(xX,d({ok:$(!0)}),{kind:"mutation",auth:"admin"})}},EX=l().min(.25).max(32),RX=d({fromSec:l().nonnegative(),toSec:l().nonnegative()}).refine(e=>e.toSec>e.fromSec,{message:"dense range must have toSec > fromSec"}),IX=d({everyMs:l().int().positive(),ranges:w(RX).min(1).max(200)}),TX=d({everyMs:l().int().positive(),outputFps:l().int().min(1).max(60).optional(),dense:IX.optional()}).superRefine((e,t)=>{e.dense!==void 0&&e.dense.everyMs>=e.everyMs&&t.addIssue({code:Rb.custom,message:"dense.everyMs must be strictly smaller than the base everyMs",path:["dense","everyMs"]})}),MT=d({speed:EX.optional(),timelapse:TX.optional(),includeAudio:A(),maxLifeMs:l().int().positive(),deleteAfterDownload:A(),title:o().max(200).optional(),notifyTargetIds:w(o().min(1)).max(20).optional()}).superRefine((e,t)=>{e.speed!==void 0&&e.timelapse!==void 0&&t.addIssue({code:Rb.custom,message:"speed and timelapse are mutually exclusive",path:["timelapse"]})}),_X=N(["queued","rendering","ready","failed","expired","deleted"]),Sc=d({id:o(),deviceId:l(),profile:o(),fromMs:l(),toMs:l(),options:MT,state:_X,progressPct:l().nullable(),fileBytes:l().nullable(),expiresAt:l(),deleteAfterDownload:A(),downloadedAt:l().nullable(),createdAt:l(),createdBy:o(),error:o().nullable()}),NX=d({url:o(),endpoints:w(o())}),OX=d({base64:o(),contentType:o(),name:o(),bytes:l().int().nonnegative()}),jX={name:"recording-export",scope:"system",mode:"singleton",methods:{createExport:b(d({deviceId:l(),profile:o().optional(),profiles:w(o()).min(1).optional(),fromMs:l(),toMs:l(),options:MT}).superRefine((e,t)=>{(e.profiles!==void 0&&e.profiles.length>0?e.profiles:e.profile!==void 0?[e.profile]:[]).length<1&&t.addIssue({code:Rb.custom,message:"pass profiles[] (min 1) or legacy profile",path:["profiles"]})}),Sc,{kind:"mutation",auth:"protected"}),listExports:b(d({deviceId:l().optional()}),w(Sc),{kind:"query",auth:"protected"}),getExport:b(d({exportId:o()}),Sc,{kind:"query",auth:"protected"}),cancelExport:b(d({exportId:o()}),Sc,{kind:"mutation",auth:"protected"}),deleteExport:b(d({exportId:o()}),Sc,{kind:"mutation",auth:"protected"}),getDownloadUrl:b(d({exportId:o()}),NX,{kind:"query",auth:"protected"}),readExportBytes:b(d({exportId:o()}),OX,{kind:"query",auth:"protected"})}},my=d({active:A(),reason:o(),lastChangedAt:l()}),PX=my.extend({lastFetchedAt:l()}),DX={name:"recording-signal",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Camera],methods:{getStatus:b(d({deviceId:l()}),my)},status:{schema:my,kind:"push",empty:{active:!1,reason:"unknown",lastChangedAt:0}},runtimeState:PX,durability:"session"},qc=o(),CT=N(["skip","judge-anyway"]),zX=N(["matched","diverged","unknown"]),LX=N(["no-reference-for-condition","view-shifted","no-vision-profile","encoder-model-changed","no-snapshot"]),qX=d({embedding:w(l()),modelId:o(),condition:qc,capturedAt:l(),thumbnailMediaId:l().int().optional(),anchorEmbedding:w(l()).optional()}),BX=d({id:o(),label:o(),references:w(qX),textPrompts:w(o()).optional(),referenceCount:l(),currentlyMatched:A()}),fy=kt("mode",[d({mode:$("similarity"),threshold:l().min(0).max(1),hysteresisCount:l().int().positive()}),d({mode:$("llm"),prompt:o(),profileId:o().optional(),hysteresisCount:l().int().positive()})]),FX=.85,UX="skip",HX=8e3,AT=d({enabled:A().default(!1),prompt:o().min(1).max(1e3),profileId:o().optional(),timeoutMs:l().int().min(1e3).max(2e4).default(HX),maxImagePx:l().int().min(64).max(2048).default(448),onTimeout:N(["flip","hold"]).default("hold")}),ET=d({id:o(),label:o(),roi:ll,enabled:A(),triggerMode:N(["periodic","on-motion","both"]),checkIntervalSec:l().optional(),check:fy,states:w(BX),currentStateId:o().nullable(),lastCheckedAt:l().nullable(),lastConfidence:l().nullable(),currentCondition:qc.nullable(),availability:N(["ok","unavailable"]),unavailableReason:o().nullable(),baselineStateId:o().nullable(),emit:N(["latched","live"]).default("latched"),verdict:zX,latched:A(),armedAt:l(),divergedAt:l().nullable(),restoredAt:l().nullable(),quietSeconds:l().int().min(0).max(3600).default(60),minObservationSpacingSec:l().int().min(0).max(3600).default(120),confirm:AT.optional(),anchorThreshold:l().min(0).max(1).default(FX),autoRestore:A().default(!1),onUncoveredCondition:CT.default(UX),suspendedCondition:qc.nullable().default(null),unavailable:LX.nullable(),coveredConditions:w(qc)}),Cp=d({monitors:w(ET),lastFetchedAt:l()}),$X=d({deviceId:l(),status:Cp.nullable()}),QX={name:"scene-monitor",scope:"device",mode:"singleton",kind:"wrapper",defaultActive:!0,deviceTypes:[U.Camera],methods:{listScenes:b(d({deviceId:l()}),Cp),listScenesBatch:b(d({deviceIds:w(l()).min(1).max(200)}),w($X).readonly()),createScene:b(d({deviceId:l(),label:o(),roi:ll,check:fy,triggerMode:N(["periodic","on-motion","both"]).optional(),checkIntervalSec:l().optional()}),ET,{kind:"mutation",auth:"admin"}),updateScene:b(d({deviceId:l(),monitorId:o(),patch:d({label:o().optional(),roi:ll.optional(),enabled:A().optional(),triggerMode:N(["periodic","on-motion","both"]).optional(),checkIntervalSec:l().optional(),check:fy.optional(),emit:N(["latched","live"]).optional(),quietSeconds:l().int().min(0).max(3600).optional(),minObservationSpacingSec:l().int().min(0).max(3600).optional(),anchorThreshold:l().min(0).max(1).optional(),autoRestore:A().optional(),onUncoveredCondition:CT.optional(),confirm:AT.nullable().optional()})}),O(),{kind:"mutation",auth:"admin"}),deleteScene:b(d({deviceId:l(),monitorId:o()}),O(),{kind:"mutation",auth:"admin"}),captureReference:b(d({deviceId:l(),monitorId:o(),stateId:o().optional(),label:o().optional(),condition:qc.optional()}),d({stateId:o(),referenceCount:l()}),{kind:"mutation",auth:"admin"}),deleteReference:b(d({deviceId:l(),monitorId:o(),stateId:o(),index:l()}),O(),{kind:"mutation",auth:"admin"}),recheckNow:b(d({deviceId:l(),monitorId:o()}),O(),{kind:"mutation",auth:"admin"}),resetScene:b(d({deviceId:l(),monitorId:o(),recapture:A().optional()}),O(),{kind:"mutation",auth:"admin"})},status:{schema:Cp,kind:"push"},runtimeState:Cp,durability:"session"},k2=d({isRunning:A(),lastRunAt:l(),lastRunSuccess:A().nullable(),lastError:o().nullable(),lastChangedAt:l()}),VX={name:"script-runner",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Script],methods:{run:b(d({deviceId:l().int().nonnegative(),variables:X(o(),J()).optional()}),O(),{kind:"mutation",auth:"admin"}),stop:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"admin"})},status:{schema:k2,kind:"push"},runtimeState:k2,durability:"session"},w2=d({detected:A(),lastChangedAt:l()}),GX={name:"smoke",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Sensor],methods:{},status:{schema:w2,kind:"push"},runtimeState:w2,durability:"restored",volatileStateFields:["lastChangedAt"]},RT=d({camStreamId:o().min(1),kind:Ib,url:o().optional(),codec:o().optional(),resolution:yl.optional(),fps:l().positive().optional(),label:o().optional(),deviceFeatures:w(o()).optional(),autoEligible:A().optional(),profileHint:Ut.optional(),metadata:X(o(),J()).optional()}),ZX=d({descriptors:w(RT),lastFetchedAt:l()}),KX={name:"stream-catalog",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Camera],methods:{getCatalog:b(d({deviceId:l().int().nonnegative()}),w(RT).readonly())},runtimeState:ZX,durability:"restored",volatileStateFields:["lastFetchedAt"]},WX=N(["main","sub","ext"]),jg=d({width:l(),height:l(),codec:N(["h264","h265"]),framerate:l(),bitrate:l(),bitrateMode:N(["vbr","cbr"]).optional(),encoderProfile:N(["high","main","baseline"]).optional(),gop:l().optional(),audio:A().optional()}),M2=d({main:jg.optional(),sub:jg.optional(),ext:jg.optional(),lastFetchedAt:l()}),Pg=d({resolutions:w(d({width:l(),height:l()})),codecs:w(N(["h264","h265"])),framerates:w(l()),bitrates:w(l()),bitrateRange:pu([l(),l()]).optional(),supportsBitrateMode:A(),supportsEncoderProfile:A(),supportsGop:A(),gop:d({min:l(),max:l(),step:l()}).optional()}),YX=d({main:Pg.optional(),sub:Pg.optional(),ext:Pg.optional()}),XX=d({width:l().optional(),height:l().optional(),codec:N(["h264","h265"]).optional(),framerate:l().optional(),bitrate:l().optional(),bitrateMode:N(["vbr","cbr"]).optional(),encoderProfile:N(["high","main","baseline"]).optional(),gop:l().optional()}),JX={name:"stream-params",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Camera],deviceConfig:{ui:{kind:"derived-form",builderId:"stream-params",tab:"streaming"}},methods:{getOptions:b(d({deviceId:l()}),YX),setProfile:b(d({deviceId:l(),profile:WX,patch:XX}),O(),{kind:"mutation",auth:"admin"}),getConfigSchema:b(d({deviceId:l()}),J().nullable())},status:{schema:M2,kind:"poll"},runtimeState:M2,durability:"restored",volatileStateFields:["lastFetchedAt"]},C2=d({on:A(),lastChangedAt:l()}),eJ={name:"switch",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Switch,U.Siren,U.Light],methods:{setState:b(d({deviceId:l(),on:A()}),O(),{kind:"mutation",auth:"protected"})},events:{onStateChanged:{data:d({deviceId:l(),on:A(),lastChangedAt:l()})}},status:{schema:C2,kind:"command-driven"},runtimeState:C2,durability:"restored",volatileStateFields:["lastChangedAt"],settings:{bindings:[{kind:"scalar",statusPath:"on",method:"setState",valueArg:"on",field:{label:"On",kind:"boolean"}}]}},A2=d({streaming:A(),notifications:A(),objectDetection:A(),remoteAccess:A(),agentCluster:A(),smartHome:A(),recordings:A(),backup:A(),repl:A()}),tJ=d({status:$("ok"),uptime:l()}),nJ=d({name:o(),address:o(),family:o(),internal:A()}),aJ=N(["operator-set","derived-from-ip"]),iJ=d({latitude:l().min(-90).max(90),longitude:l().min(-180).max(180),source:aJ,updatedAt:l(),label:o().optional()}),Dg=d({location:iJ.nullable(),derivationAttemptedAt:l().nullable(),derivationError:o().nullable()}),rJ=d({latitude:l().min(-90).max(90),longitude:l().min(-180).max(180)}).nullable(),oJ=N(["http","ws","mesh","unknown"]),IT=d({http:l(),ws:l(),mesh:l(),unknown:l()}),sJ=d({plane:oJ,procedure:o(),userAgent:o(),ip:o(),principal:o(),calls:l(),subscriptions:l(),perMin:l()}),lJ=d({procedure:o(),calls:l(),planes:IT,subscriptions:l(),perMin:l()}),cJ=d({armed:A(),elapsedMs:l(),windowMs:l(),armedUntilMs:l(),httpRequests:l(),batchedRequests:l(),procedureCalls:l(),planes:IT,planesExplainTotal:A(),wsConnections:l(),wsMessages:l(),subscriptions:l(),subscriptionStops:l(),distinctGroups:l(),unattributedCalls:l(),procedures:w(lJ).readonly(),groups:w(sJ).readonly()}),uJ=cJ.extend({persisted:A()}),m0=N(["debug","info","warn","error"]),TT=N(["request-census"]),dJ=N(["cluster","node","component"]),pJ=N(["default","cluster","node","component"]),mJ=d({scope:dJ,nodeId:o().nullable(),component:o().nullable(),level:m0.nullable()}),fJ=d({level:m0,levelSource:pJ}),hJ=d({layers:w(mJ).readonly()}),gJ=d({id:TT,armed:A(),armedUntilMs:l(),remainingMs:l(),persisted:A()}),vJ=d({id:TT,armMs:l().int().min(0),reportEveryMs:l().int().positive().optional()}),yJ=d({channel:o(),armed:A(),armedUntilMs:l(),remainingMs:l(),deviceIds:w(l().int()).readonly().nullable()}),bJ=d({channel:o().min(1),armMs:l().int().min(0),deviceIds:w(l().int()).readonly().nullable().optional()}),SJ=d({level:m0.nullable().optional(),diagnostics:w(vJ).readonly().optional(),channels:w(bJ).readonly().optional(),opsLogRetentionDays:l().int().min(0).max(3650).optional()}),xJ=vI.extend({addonId:o()}),kJ=uI.extend({addonId:o()}),wJ=d({scopeNodeId:o().optional(),scopeComponent:o().optional()}),MJ=d({scopeNodeId:o().optional(),scopeComponent:o().optional(),patch:SJ}),E2=d({scopeNodeId:o().nullable(),scopeComponent:o().nullable(),effective:fJ,explicit:hJ,activeWindows:w(gJ).readonly(),channels:w(DR).readonly(),activeChannels:w(yJ).readonly(),opsLogRetentionDays:l().int().min(0),persisted:A()}),CJ={name:"system",scope:"system",mode:"singleton",methods:{info:b(O(),A2),health:b(O(),tJ),featureFlags:b(O(),A2),networkAddresses:b(O(),w(nJ).readonly()),getRetentionConfig:b(O(),J().nullable(),{auth:"admin"}),setRetentionConfig:b(X(o(),J()),uR(),{kind:"mutation",auth:"admin"}),forceRetentionCleanup:b(O(),O(),{kind:"mutation",auth:"admin"}),getSiteLocation:b(O(),Dg),setSiteLocation:b(rJ,Dg,{kind:"mutation",auth:"admin"}),detectSiteLocation:b(O(),Dg,{kind:"mutation",auth:"admin"}),getRequestCensus:b(O(),uJ,{auth:"admin"}),getLoadContributions:b(O(),w(xJ).readonly(),{auth:"admin"}),getFailureContributions:b(O(),w(kJ).readonly(),{auth:"admin"}),getLoggingSettings:b(wJ,E2,{auth:"admin"}),setLoggingSettings:b(MJ,E2,{kind:"mutation",auth:"admin"})},mount:{kind:"server-provided"}},R2=d({tampered:A(),lastChangedAt:l()}),AJ={name:"tamper",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Sensor],methods:{},status:{schema:R2,kind:"push"},runtimeState:R2,durability:"restored",volatileStateFields:["lastChangedAt"]},I2=d({celsius:l(),lastFetchedAt:l(),unit:o().optional(),precision:l().int().min(0).max(10).optional()}),EJ={name:"temperature-sensor",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Sensor,U.Thermostat],methods:{},status:{schema:I2,kind:"push"},runtimeState:I2,durability:"restored",volatileStateFields:["lastFetchedAt"]},RJ=d({title:o(),message:o(),severity:N(["info","warning","critical"]),duration:l().optional(),action:d({label:o(),url:o()}).optional()}),IJ={name:"toast",scope:"system",mode:"singleton",methods:{onToast:b(O(),RJ,{kind:"subscription"})},mount:{kind:"server-provided"}},T2=d({currentVersion:o().nullable(),availableVersion:o().nullable(),updatable:A(),state:o().nullable(),inProgress:A()}),TJ={name:"update",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Update],methods:{installUpdate:b(O(),O(),{kind:"mutation",auth:"admin"})},status:{schema:T2,kind:"poll"},runtimeState:T2,durability:"session"},zg=d({id:o(),username:o(),isAdmin:A().default(!1),allowedProviders:tt([w(o()),$("*")]),allowedDevices:X(o(),tt([w(o()),$("*")])),scopes:w(ja).default([]),totpEnabled:A().default(!1),createdAt:l(),updatedAt:l()}),_J=d({username:o(),password:o().min(6),isAdmin:A().default(!1),allowedProviders:tt([w(o()),$("*")]).optional(),allowedDevices:X(o(),tt([w(o()),$("*")])).optional(),scopes:w(ja).optional()}),NJ=d({id:o(),isAdmin:A().optional(),allowedProviders:tt([w(o()),$("*")]).optional(),allowedDevices:X(o(),tt([w(o()),$("*")])).optional(),scopes:w(ja).optional()}),hy=d({id:o(),label:o(),isAdmin:A().default(!1),allowedProviders:tt([w(o()),$("*")]).optional(),allowedDevices:X(o(),tt([w(o()),$("*")])).optional(),tokenPrefix:o(),createdAt:l(),lastUsedAt:l().optional()}),OJ=d({label:o(),isAdmin:A().default(!1),allowedProviders:tt([w(o()),$("*")]).optional(),allowedDevices:X(o(),tt([w(o()),$("*")])).optional()}),jJ=d({token:o(),record:hy}),gy=d({id:o(),userId:o(),name:o(),tokenPrefix:o(),scopes:w(ja),expiresAt:l().nullish(),lastUsedAt:l().nullish(),createdAt:l()}),PJ=d({userId:o(),name:o(),scopes:w(ja),expiresAt:l().optional()}),DJ=d({token:o(),record:gy}),zJ=d({id:o(),userId:o(),username:o(),integrationId:o(),scopes:w(ja),createdAt:l(),lastUsedAt:l(),revokedAt:l().nullable()}),LJ=d({secret:o(),otpauthUrl:o()}),qJ=d({enabled:A(),confirmedAt:l().nullable()}),BJ={name:"user-management",scope:"system",mode:"singleton",methods:{listUsers:b(O(),w(zg),{auth:"admin"}),createUser:b(_J,zg,{kind:"mutation",auth:"admin",access:"create"}),updateUser:b(NJ,d({success:$(!0)}),{kind:"mutation",auth:"admin",access:"create"}),deleteUser:b(d({id:o()}),d({success:$(!0)}),{kind:"mutation",auth:"admin",access:"delete"}),resetPassword:b(d({id:o(),newPassword:o().min(6)}),d({success:$(!0)}),{kind:"mutation",auth:"admin",access:"create"}),setUserScopes:b(d({userId:o(),scopes:w(ja)}),d({success:$(!0)}),{kind:"mutation",auth:"admin",access:"create"}),validateCredentials:b(d({username:o(),password:o()}),zg.extend({passwordHash:o()}).nullable(),{kind:"mutation",access:"view"}),listApiKeys:b(O(),w(hy),{auth:"admin"}),createApiKey:b(OJ,jJ,{kind:"mutation",auth:"admin",access:"create"}),revokeApiKey:b(d({id:o()}),d({success:$(!0)}),{kind:"mutation",auth:"admin",access:"delete"}),validateApiKey:b(d({token:o()}),hy.nullable(),{kind:"mutation",access:"view"}),createScopedToken:b(PJ,DJ,{kind:"mutation",auth:"admin",access:"create"}),revokeScopedToken:b(d({id:o()}),d({success:$(!0)}),{kind:"mutation",auth:"admin",access:"delete"}),validateScopedToken:b(d({token:o()}),gy.nullable(),{access:"view"}),listScopedTokens:b(d({userId:o()}),w(gy),{auth:"admin"}),setupTotp:b(d({userId:o()}),LJ,{kind:"mutation",auth:"admin",access:"create"}),confirmTotp:b(d({userId:o(),code:o()}),d({success:$(!0)}),{kind:"mutation",auth:"admin",access:"create"}),disableTotp:b(d({userId:o()}),d({success:$(!0)}),{kind:"mutation",auth:"admin",access:"delete"}),getTotpStatus:b(d({userId:o()}),qJ,{auth:"admin"}),verifyTotp:b(d({userId:o(),code:o()}),d({valid:A()}),{kind:"mutation",access:"view"}),oauthIssueCode:b(d({integrationId:o(),userId:o(),username:o(),scopes:w(ja),redirectUri:o(),hubUrl:o(),codeChallenge:o().optional(),refreshTtlSec:tt([l().int().positive(),$("never")]).optional()}),d({code:o()}),{kind:"mutation",access:"create"}),oauthExchangeCode:b(d({code:o(),redirectUri:o(),codeVerifier:o().optional()}),d({accessToken:o(),refreshToken:o(),expiresIn:l()}).nullable(),{kind:"mutation",access:"view"}),oauthRefresh:b(d({refreshToken:o()}),d({accessToken:o(),refreshToken:o(),expiresIn:l()}).nullable(),{kind:"mutation",access:"view"}),oauthVerifyAccessToken:b(d({token:o()}),d({userId:o(),username:o(),scopes:w(ja)}).nullable(),{access:"view"}),listOauthSessions:b(O(),w(zJ),{auth:"admin"}),revokeOauthSession:b(d({id:o()}),d({success:A()}),{kind:"mutation",auth:"admin",access:"delete"})}},FJ=N(["idle","cleaning","paused","returning","docked","drying","error"]),Yd=d({level:l().min(0).max(100).nullable(),status:N(["ok","low","full"]).nullable()}),_2=d({state:FJ,batteryLevel:l().min(0).max(100).nullable(),fanSpeed:o().nullable(),availableFanSpeeds:w(o()),cleanWater:Yd.nullable(),dirtyWater:Yd.nullable(),detergent:Yd.nullable(),dustBin:Yd.nullable(),progressPercent:l().min(0).max(100).nullable(),errorCode:l().nullable(),errorLabel:o().nullable(),lastChangedAt:l()}),UJ={name:"vacuum-control",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Vacuum],methods:{start:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),pause:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),stop:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),returnToBase:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),locate:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),setFanSpeed:b(d({deviceId:l().int().nonnegative(),speed:o().min(1)}),O(),{kind:"mutation",auth:"protected"})},status:{schema:_2,kind:"push"},runtimeState:_2,durability:"session"},HJ=N(["open","opening","closing","closed","stopped"]),N2=d({state:HJ,position:l().min(0).max(100).nullable(),lastChangedAt:l()}),$J={name:"valve",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Valve],methods:{open:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),close:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),stop:b(d({deviceId:l().int().nonnegative()}),O(),{kind:"mutation",auth:"protected"}),setPosition:b(d({deviceId:l().int().nonnegative(),position:l().min(0).max(100)}),O(),{kind:"mutation",auth:"protected"})},status:{schema:N2,kind:"push"},runtimeState:N2,durability:"session"},O2=d({detected:A(),lastChangedAt:l()}),QJ={name:"vibration",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Sensor],methods:{},status:{schema:O2,kind:"push"},runtimeState:O2,durability:"restored",volatileStateFields:["lastChangedAt"]},j2=d({currentTemp:l().nullable(),targetTemp:l().nullable(),operationMode:o().nullable(),availableModes:w(o()),away:A().nullable(),minTemp:l().nullable(),maxTemp:l().nullable(),lastChangedAt:l()}),VJ={name:"water-heater",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.WaterHeater],methods:{setTargetTemp:b(d({deviceId:l().int().nonnegative(),temp:l().finite()}),O(),{kind:"mutation",auth:"protected"}),setOperationMode:b(d({deviceId:l().int().nonnegative(),mode:o().min(1)}),O(),{kind:"mutation",auth:"protected"}),setAway:b(d({deviceId:l().int().nonnegative(),on:A()}),O(),{kind:"mutation",auth:"protected"})},status:{schema:j2,kind:"push"},runtimeState:j2,durability:"session"},P2=d({condition:o().nullable(),temperature:l().nullable(),temperatureUnit:o().nullable(),humidity:l().min(0).max(100).nullable(),pressure:l().nullable(),pressureUnit:o().nullable(),windSpeed:l().nullable(),windSpeedUnit:o().nullable(),windBearing:l().nullable(),lastFetchedAt:l()}),GJ={name:"weather",scope:"device",deviceNative:!0,mode:"singleton",deviceTypes:[U.Weather],methods:{},status:{schema:P2,kind:"push"},runtimeState:P2,durability:"session"},vy=d({totalObjects:l().int().nonnegative(),byClass:X(o(),l().int().nonnegative()),standingObjects:l().int().nonnegative().optional(),transientObjects:l().int().nonnegative().optional()}),ZJ=vy.extend({zoneId:o(),zoneName:o(),trackIds:w(o()).readonly()}),KJ=d({id:o(),className:o(),bbox:d({x:l(),y:l(),w:l(),h:l()}),frameWidth:l().int().nonnegative(),frameHeight:l().int().nonnegative(),firstSeenAt:l().int(),becameStationaryAt:l().int(),lastConfirmedAt:l().int(),label:o().optional(),keyFrameMediaId:l().int().optional()}),yy=d({ts:l().int(),frameWidth:l().int().nonnegative(),frameHeight:l().int().nonnegative(),zones:w(ZJ).readonly(),frame:vy,unzoned:vy,stationaryObjects:w(KJ).readonly().optional()}),WJ=d({deviceId:l(),read:N(["read","unreadable"]),snapshot:yy.nullable()}),YJ=N(["minute","5min","hour"]),Lg=d({from:l().int(),to:l().int(),resolution:YJ}),qg=d({ts:l().int(),count:l().int().nonnegative()}),XJ={name:"zone-analytics",scope:"device",mode:"singleton",deviceTypes:[U.Camera],methods:{getCurrentSnapshot:b(d({deviceId:l()}),yy.nullable()),getCurrentSnapshotBatch:b(d({deviceIds:w(l()).min(1).max(200)}),w(WJ).readonly()),getZoneHistory:b(d({deviceId:l(),zoneId:o(),className:o().optional()}).extend(Lg.shape),w(qg).readonly()),getCameraHistory:b(d({deviceId:l(),className:o().optional()}).extend(Lg.shape),w(qg).readonly()),getUnzonedHistory:b(d({deviceId:l(),className:o().optional()}).extend(Lg.shape),w(qg).readonly())},runtimeState:yy,durability:"session"},D2=N(["motion","detection","package"]),JJ={name:"zone-rules",scope:"device",mode:"singleton",deviceTypes:[U.Camera],methods:{listRules:b(d({deviceId:l(),stage:D2}),w(Mo).readonly()),setRules:b(d({deviceId:l(),stage:D2,rules:w(Mo).readonly()}),O(),{kind:"mutation",auth:"admin"})},runtimeState:d({motion:w(Mo).readonly(),detection:w(Mo).readonly(),package:w(Mo).readonly()}),durability:"restored"};He.Siren,He.Floodlight,He.Spotlight,He.PirSensor,He.Chime,He.Autotrack,He.Nightvision,He.PrivacyMask;var eee={[U.Cover]:"cover",[U.Valve]:"valve",[U.Humidifier]:"humidifier",[U.WaterHeater]:"water-heater",[U.Camera]:"dummy",[U.Hub]:"dummy",[U.Switch]:"switch",[U.Siren]:"switch",[U.Light]:"light",[U.Fan]:"fan",[U.Sensor]:"sensor",[U.Thermostat]:"thermostat",[U.Climate]:"climate",[U.Button]:"button",[U.EventEmitter]:"dummy",[U.Update]:"update",[U.Generic]:"dummy",[U.Notifier]:"dummy",[U.Script]:"script",[U.Automation]:"automation",[U.Lock]:"lock",[U.MediaPlayer]:"media-player",[U.AlarmPanel]:"alarm",[U.Control]:"control",[U.Presence]:"sensor",[U.Weather]:"weather",[U.Vacuum]:"vacuum",[U.LawnMower]:"lawn-mower",[U.Container]:"dummy",[U.Image]:"image",[U.PetFeeder]:"pet-feeder"};new Set(Object.values(U));va.BatteryOperated;var tee="device.state-changed",nee="capability.binding-changed",aee="device.registered",iee="device.unregistered",ree="device.updated",oee=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=hq(this.stateMirror,this.handleListeners,this.api)}async init(e=15e3){if(!this.initialized){if(this.initPromise)return this.initPromise;this.initPromise=(async()=>{const t=(p,f)=>Number.isFinite(e)?new Promise((m,h)=>{const c=setTimeout(()=>h(new Error(`SystemMirror.init: '${f}' timed out after ${e}ms`)),e);p.then(x=>{clearTimeout(c),m(x)},x=>{clearTimeout(c),h(x)})}):p,[n,a,s]=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(const p of n)this.bindings.set(p.deviceId,p);for(const[p,f]of Object.entries(a)){const m=Number(p);if(!Number.isFinite(m))continue;const h=new Map;for(const[c,x]of Object.entries(f))h.set(c,x);this.stateMirror.set(m,h)}for(const p of s)this.devices.set(p.id,p);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(const 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){const t=this.bindings.get(e);return t?xR(this.api,t,{stateSource:this.stateSource}):null}getDeviceByName(e){for(const t of this.devices.values())if(t.name===e)return this.getDeviceById(t.id);return null}getDeviceByStableId(e){for(const 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(){const e=[];for(const t of this.bindings.keys()){const n=this.getDeviceById(t);n&&e.push(n)}return e}filterByCap(e){return this.query({caps:e})}query(e={}){const t=[];for(const[n,a]of this.bindings){const s=this.devices.get(n);if(e.id!==void 0&&!Xd(n,e.id)||e.stableId!==void 0&&(!s||!Xd(s.stableId,e.stableId))||e.addonId!==void 0&&(!s||!Xd(s.addonId,e.addonId))||e.type!==void 0&&(!s||!Xd(s.type,e.type)))continue;if(e.caps!==void 0){const f=Bg(e.caps),m=new Set(a.entries.map(h=>h.capName));if(!f.every(h=>m.has(h)))continue}if(e.anyCap!==void 0){const f=Bg(e.anyCap),m=new Set(a.entries.map(h=>h.capName));if(!f.some(h=>m.has(h)))continue}if(e.name!==void 0&&(!s||!see(s.name,e.name))||e.online!==void 0&&(!s||s.online!==e.online))continue;if(e.parentDeviceId!==void 0){if(!s)continue;const f=e.parentDeviceId;if((s.parentDeviceId??null)!==f)continue}if(e.feature!==void 0&&(!s||!Bg(e.feature).every(f=>s.features.includes(f)))||e.isCamera!==void 0&&(!s||s.isCamera!==e.isCamera))continue;const p=this.getDeviceById(n);if(p){if(e.where&&s){if(!e.where(s,p))continue}else if(e.where&&!s)continue;t.push(p)}}return t}whereState(e,t){const n=[];for(const[a,s]of this.stateMirror){const p=s.get(e);if(!p||!t(p,a))continue;const f=this.getDeviceById(a);f&&n.push(f)}return n}mapState(e,t){const n=[];for(const[a,s]of this.stateMirror){const p=s.get(e);p&&n.push(t(p,a))}return n}findState(e,t){for(const[n,a]of this.stateMirror){const s=a.get(e);if(s&&t(s,n))return this.getDeviceById(n)}return null}countByCap(e){let t=0;for(const n of this.bindings.values())n.entries.some(a=>a.capName===e)&&t++;return t}countByState(e,t){let n=0;for(const[a,s]of this.stateMirror){const p=s.get(e);p&&t(p,a)&&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,a=3e4){return new Promise((s,p)=>{const m=(()=>{const x=this.stateMirror.get(e)?.get(t);return x&&n(x)?x:null})();if(m){s(m);return}let h=null;const c=this.listenDevice(e,(x,M,C)=>{M===t&&C&&n(C)&&(h&&clearTimeout(h),c(),s(C))});Number.isFinite(a)&&(h=setTimeout(()=>{c(),p(new Error(`waitForState timed out after ${a}ms (deviceId=${e}, capName=${t})`))},a))})}waitForDevice(e,t=3e4){return new Promise((n,a)=>{const s=this.getDeviceById(e);if(s){n(s);return}let p=null;const f=this.onDeviceAdded(m=>{if(m!==e)return;const h=this.getDeviceById(m);h&&(p&&clearTimeout(p),f(),n(h))});Number.isFinite(t)&&(p=setTimeout(()=>{f(),a(new Error(`waitForDevice timed out after ${t}ms (deviceId=${e})`))},t))})}async forEachCap(e,t){for(const n of this.filterByCap(e))await t(n)}async invokeCap(e,t,n,a={}){const s=this.filterByCap(e),p=Math.max(1,a.parallelism??s.length),f=[];for(let m=0;m<s.length;m+=p){const h=s.slice(m,m+p),c=await Promise.allSettled(h.map(async x=>{const M=x[e];if(!M||typeof M[t]!="function")throw new Error(`device '${x.deviceId}' does not expose '${e}.${t}'`);return await M[t](n)}));for(let x=0;x<c.length;x++){const M=h[x],C=c[x];C.status==="fulfilled"?f.push({deviceId:M.deviceId,ok:!0,result:C.value}):f.push({deviceId:M.deviceId,ok:!1,error:C.reason})}}return f}summary(){const e={},t={},n={};let a=0,s=0;for(const p of this.bindings.values())for(const f of p.entries)e[f.capName]=(e[f.capName]??0)+1;for(const p of this.devices.values())t[p.addonId]=(t[p.addonId]??0)+1,n[p.type]=(n[p.type]??0)+1,p.online?a++:s++;return{totalDevices:this.bindings.size,online:a,offline:s,byCap:e,byAddon:t,byType:n,statedDevices:this.stateMirror.size}}dump(e){const t=a=>{const s=this.devices.get(a)??null,p=this.bindings.get(a)??null,f={},m=this.stateMirror.get(a);if(m)for(const[h,c]of m)f[h]={...c};return{deviceId:a,info:s,binding:p?{...p,entries:p.entries.map(h=>({...h}))}:null,state:f}};if(e!==void 0)return t(e);const n=[];for(const a of this.bindings.keys())n.push(t(a));return n}getRawMirror(){return this.stateMirror}getSystemState(){const e=new Map;for(const[t,n]of this.stateMirror){const a=new Map;for(const[s,p]of n)a.set(s,{...p});e.set(t,a)}return e}subscribeBus(){if(!this.api.live?.onEvent)return;const e=this.api.live.onEvent;this.bridges.push(e.subscribe({category:tee},{onData:t=>{const n=t.data;!n||typeof n.deviceId!="number"||typeof n.capName!="string"||this.applyStateUpdate(n.deviceId,n.capName,n.slice)}})),this.bridges.push(e.subscribe({category:nee},{onData:t=>{const n=t.data,a=typeof n?.deviceId=="number"?n.deviceId:n?.source?.type==="device"&&typeof n.source.id=="number"?n.source.id:null;a!==null&&this.refreshBinding(a)}})),this.bridges.push(e.subscribe({category:aee},{onData:t=>{const n=t.data;typeof n?.deviceId=="number"&&this.refreshDeviceMetadata(n.deviceId,"added")}})),this.bridges.push(e.subscribe({category:iee},{onData:t=>{const n=t.data;typeof n?.deviceId=="number"&&this.applyDeviceRemoval(n.deviceId)}})),this.bridges.push(e.subscribe({category:ree},{onData:t=>{const n=t.data;typeof n?.deviceId=="number"&&this.refreshDeviceMetadata(n.deviceId,"updated")}}))}applyStateUpdate(e,t,n){let a=this.stateMirror.get(e);a||(a=new Map,this.stateMirror.set(e,a)),n===void 0?a.delete(t):a.set(t,n);const s=`${e}:${t}`,p=this.handleListeners.get(s);if(p)for(const h of p)try{h(n)}catch{}for(const h of this.globalStateListeners)try{h(e,t,n)}catch{}const f=this.capListeners.get(t);if(f)for(const h of f)try{h(e,n)}catch{}const m=this.deviceListeners.get(e);if(m)for(const h of m)try{h(e,t,n)}catch{}}applyDeviceRemoval(e){const t=this.devices.get(e)??null;this.bindings.delete(e),this.devices.delete(e),this.stateMirror.delete(e);for(const n of this.removedListeners)try{n(e,t)}catch{}}async refreshBinding(e){try{const t=await this.api.deviceManager.getBindings.query({deviceId:e});if(t.entries.length>0){this.bindings.set(e,t);return}if(await this.api.deviceManager.getDevice.query({deviceId:e})===null){this.applyDeviceRemoval(e);return}this.bindings.set(e,t)}catch{}}async refreshDeviceMetadata(e,t){try{const n=await this.api.deviceManager.getDevice.query({deviceId:e});if(!n)return;const a=!this.devices.has(e);if(this.devices.set(e,n),t==="added"&&a){await this.refreshBinding(e);for(const s of this.addedListeners)try{s(e,n)}catch{}}}catch{}}};function Xd(e,t){return Array.isArray(t)?t.includes(e):e===t}function Bg(e){return Array.isArray(e)?e:[e]}function see(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 lee=[lZ,aB,rB,cB,pB,gB,fB,jZ,oq,PZ,mH,SB,DZ,xB,IB,PB,BZ,DB,FZ,VB,UZ,HZ,$Z,c9,QZ,ZZ,wW,u9,P9,KZ,WZ,XZ,nK,aK,iK,rK,lK,q9,uK,F9,$9,mK,V9,G9,J9,K9,sF,EF,mq,mF,RF,fK,gK,TF,yK,bK,xK,TK,NF,_K,NK,PF,OK,jK,PK,DK,zK,BK,GK,WK,JK,JF,$F,nU,sW,cW,iU,rU,uU,pW,gW,CU,EU,TU,yW,NU,SW,AW,UU,_W,BW,QU,HW,VW,oY,nH,YH,pY,mY,a$,gY,xY,wY,$Q,T$,DV,lV,EY,BY,FY,HY,$Y,ZY,tX,rX,oX,AX,jX,DX,QX,VX,YV,U9,GX,eG,aG,iG,oG,cG,uG,pG,MG,_9,KX,JX,p9,eJ,CJ,AJ,EJ,TG,IJ,NG,TJ,BJ,jG,UJ,$J,XG,QJ,tZ,cq,VJ,GJ,oZ,XJ,JJ,j$];function z2(e){const t=e;function n(a,s,p,f,m){const h=t[a]?.[s];if(!h)throw new Error(`SystemProxy: api has no '${a}.${s}'`);const c=h;return p==="mutation"?c.mutate(f):p==="subscription"?c.subscribe(f,m):c.query(f)}return{addonPages:{listPages:a=>n("addonPages","listPages","query",a)},addons:{list:a=>n("addons","list","query",a),getLogs:a=>n("addons","getLogs","query",a),listPackages:a=>n("addons","listPackages","query",a),installPackage:a=>n("addons","installPackage","mutation",a),installFromWorkspace:a=>n("addons","installFromWorkspace","mutation",a),isWorkspaceAvailable:a=>n("addons","isWorkspaceAvailable","query",a),listWorkspacePackages:a=>n("addons","listWorkspacePackages","query",a),uninstallPackage:a=>n("addons","uninstallPackage","mutation",a),reloadPackages:a=>n("addons","reloadPackages","mutation",a),searchAvailable:a=>n("addons","searchAvailable","query",a),listUpdates:a=>n("addons","listUpdates","query",a),updatePackage:a=>n("addons","updatePackage","mutation",a),rollbackPackage:a=>n("addons","rollbackPackage","mutation",a),forceRefresh:a=>n("addons","forceRefresh","mutation",a),restartServer:a=>n("addons","restartServer","mutation",a),getLastRestart:a=>n("addons","getLastRestart","query",a),listFrameworkPackages:a=>n("addons","listFrameworkPackages","query",a),listCapabilityProviders:a=>n("addons","listCapabilityProviders","query",a),setCapabilityProviderEnabled:a=>n("addons","setCapabilityProviderEnabled","mutation",a),getVersions:a=>n("addons","getVersions","query",a),restartAddon:a=>n("addons","restartAddon","mutation",a),retryLoad:a=>n("addons","retryLoad","mutation",a),getAutoUpdateSettings:a=>n("addons","getAutoUpdateSettings","query",a),setAutoUpdateSettings:a=>n("addons","setAutoUpdateSettings","mutation",a),getAddonAutoUpdate:a=>n("addons","getAddonAutoUpdate","query",a),setAddonAutoUpdate:a=>n("addons","setAddonAutoUpdate","mutation",a),applyAutoUpdateToAll:a=>n("addons","applyAutoUpdateToAll","mutation",a),custom:a=>n("addons","custom","mutation",a),startJob:a=>n("addons","startJob","mutation",a),getJob:a=>n("addons","getJob","query",a),listJobs:a=>n("addons","listJobs","query",a),cancelJob:a=>n("addons","cancelJob","mutation",a),onAddonLogs:(a,s)=>n("addons","onAddonLogs","subscription",a,s)},addonSettings:{getGlobalSettings:a=>n("addonSettings","getGlobalSettings","query",a),updateGlobalSettings:a=>n("addonSettings","updateGlobalSettings","mutation",a),getIntegrationSettings:a=>n("addonSettings","getIntegrationSettings","query",a)},addonWidgets:{listWidgets:a=>n("addonWidgets","listWidgets","query",a)},alerts:{emit:a=>n("alerts","emit","mutation",a),update:a=>n("alerts","update","mutation",a),list:a=>n("alerts","list","query",a),getUnreadCount:a=>n("alerts","getUnreadCount","query",a),markRead:a=>n("alerts","markRead","mutation",a),markAllRead:a=>n("alerts","markAllRead","mutation",a),dismiss:a=>n("alerts","dismiss","mutation",a)},audioAnalyzer:{analyseChunk:a=>n("audioAnalyzer","analyseChunk","mutation",a),classify:a=>n("audioAnalyzer","classify","query",a),attachDevice:a=>n("audioAnalyzer","attachDevice","mutation",a),isReady:a=>n("audioAnalyzer","isReady","query",a),dispose:a=>n("audioAnalyzer","dispose","mutation",a),reprobeAudioEngine:a=>n("audioAnalyzer","reprobeAudioEngine","mutation",a)},audioCodec:{listSupportedCodecs:a=>n("audioCodec","listSupportedCodecs","query",a),canHandle:a=>n("audioCodec","canHandle","query",a),createDecodeSession:a=>n("audioCodec","createDecodeSession","mutation",a),createEncodeSession:a=>n("audioCodec","createEncodeSession","mutation",a),closeSession:a=>n("audioCodec","closeSession","mutation",a),pushEncodedFrame:a=>n("audioCodec","pushEncodedFrame","mutation",a),pullPcm:a=>n("audioCodec","pullPcm","query",a),pushPcm:a=>n("audioCodec","pushPcm","mutation",a),pullEncoded:a=>n("audioCodec","pullEncoded","query",a),flushEncode:a=>n("audioCodec","flushEncode","mutation",a),listActiveSessions:a=>n("audioCodec","listActiveSessions","query",a)},backup:{listDestinations:a=>n("backup","listDestinations","query",a),trigger:a=>n("backup","trigger","mutation",a),listRuns:a=>n("backup","listRuns","query",a),cancel:a=>n("backup","cancel","mutation",a),list:a=>n("backup","list","query",a),listLocations:a=>n("backup","listLocations","query",a),getEntries:a=>n("backup","getEntries","query",a),restore:a=>n("backup","restore","mutation",a),delete:a=>n("backup","delete","mutation",a),listArchives:a=>n("backup","listArchives","query",a),upsertDestinationPolicy:a=>n("backup","upsertDestinationPolicy","mutation",a),previewSchedule:a=>n("backup","previewSchedule","query",a),listSchedules:a=>n("backup","listSchedules","query",a),upsertSchedule:a=>n("backup","upsertSchedule","mutation",a),deleteSchedule:a=>n("backup","deleteSchedule","mutation",a)},broker:{list:a=>n("broker","list","query",a),get:a=>n("broker","get","query",a),listProviders:a=>n("broker","listProviders","query",a),add:a=>n("broker","add","mutation",a),remove:a=>n("broker","remove","mutation",a),testConnection:a=>n("broker","testConnection","mutation",a),getSettings:a=>n("broker","getSettings","query",a),setSettings:a=>n("broker","setSettings","mutation",a),getBrokerConfig:a=>n("broker","getBrokerConfig","query",a),getSettingsSchema:a=>n("broker","getSettingsSchema","query",a),testSettings:a=>n("broker","testSettings","mutation",a),publish:a=>n("broker","publish","mutation",a),subscribe:a=>n("broker","subscribe","mutation",a),unsubscribe:a=>n("broker","unsubscribe","mutation",a),getState:a=>n("broker","getState","query",a),getStatus:a=>n("broker","getStatus","query",a)},connectionTest:{testSettings:a=>n("connectionTest","testSettings","mutation",a),describeTest:a=>n("connectionTest","describeTest","query",a)},coreBlocks:{list:a=>n("coreBlocks","list","query",a),get:a=>n("coreBlocks","get","query",a),create:a=>n("coreBlocks","create","mutation",a),update:a=>n("coreBlocks","update","mutation",a),delete:a=>n("coreBlocks","delete","mutation",a),setEnabled:a=>n("coreBlocks","setEnabled","mutation",a),restart:a=>n("coreBlocks","restart","mutation",a),compile:a=>n("coreBlocks","compile","mutation",a),getTypeDefs:a=>n("coreBlocks","getTypeDefs","query",a)},decoder:{supportsCodec:a=>n("decoder","supportsCodec","query",a),getInfo:a=>n("decoder","getInfo","query",a),createSession:a=>n("decoder","createSession","query",a),destroySession:a=>n("decoder","destroySession","query",a),pushPacket:a=>n("decoder","pushPacket","query",a),openStream:a=>n("decoder","openStream","query",a),pullFrames:a=>n("decoder","pullFrames","query",a),pullHandles:a=>n("decoder","pullHandles","query",a),getFrame:a=>n("decoder","getFrame","query",a),getShmStats:a=>n("decoder","getShmStats","query",a),updateConfig:a=>n("decoder","updateConfig","query",a),getStats:a=>n("decoder","getStats","query",a),listActiveSessions:a=>n("decoder","listActiveSessions","query",a),reprobeHwaccel:a=>n("decoder","reprobeHwaccel","mutation",a)},deviceAdoption:{listCandidateFilters:a=>n("deviceAdoption","listCandidateFilters","query",a),listCandidates:a=>n("deviceAdoption","listCandidates","query",a),getCandidate:a=>n("deviceAdoption","getCandidate","query",a),refresh:a=>n("deviceAdoption","refresh","mutation",a),adopt:a=>n("deviceAdoption","adopt","mutation",a),release:a=>n("deviceAdoption","release","mutation",a),resync:a=>n("deviceAdoption","resync","mutation",a)},deviceExport:{getStatus:a=>n("deviceExport","getStatus","query",a),listSupportedDeviceKinds:a=>n("deviceExport","listSupportedDeviceKinds","query",a),listExposedDevices:a=>n("deviceExport","listExposedDevices","query",a),exposeDevice:a=>n("deviceExport","exposeDevice","mutation",a),unexposeDevice:a=>n("deviceExport","unexposeDevice","mutation",a)},deviceManager:{allocateDeviceId:a=>n("deviceManager","allocateDeviceId","mutation",a),migrateDevice:a=>n("deviceManager","migrateDevice","mutation",a),registerDevice:a=>n("deviceManager","registerDevice","mutation",a),removeDevice:a=>n("deviceManager","removeDevice","mutation",a),persistConfig:a=>n("deviceManager","persistConfig","mutation",a),getRoleDisplayDefaults:a=>n("deviceManager","getRoleDisplayDefaults","query",a),setRoleDisplayDefaults:a=>n("deviceManager","setRoleDisplayDefaults","mutation",a),listLocations:a=>n("deviceManager","listLocations","query",a),addLocation:a=>n("deviceManager","addLocation","mutation",a),removeLocation:a=>n("deviceManager","removeLocation","mutation",a),renameLocation:a=>n("deviceManager","renameLocation","mutation",a),listLocationIcons:a=>n("deviceManager","listLocationIcons","query",a),setLocationIcon:a=>n("deviceManager","setLocationIcon","mutation",a),listLocationDescriptions:a=>n("deviceManager","listLocationDescriptions","query",a),setLocationDescription:a=>n("deviceManager","setLocationDescription","mutation",a),listSiteZones:a=>n("deviceManager","listSiteZones","query",a),setSiteZone:a=>n("deviceManager","setSiteZone","mutation",a),removeSiteZone:a=>n("deviceManager","removeSiteZone","mutation",a),renameSiteZone:a=>n("deviceManager","renameSiteZone","mutation",a),setLocationZone:a=>n("deviceManager","setLocationZone","mutation",a),listPersistedByAddon:a=>n("deviceManager","listPersistedByAddon","query",a),listAll:a=>n("deviceManager","listAll","query",a),getChildren:a=>n("deviceManager","getChildren","query",a),getChildrenBatch:a=>n("deviceManager","getChildrenBatch","query",a),getLinkedDevicesBatch:a=>n("deviceManager","getLinkedDevicesBatch","query",a),removeByIntegration:a=>n("deviceManager","removeByIntegration","mutation",a),getBindingsBatch:a=>n("deviceManager","getBindingsBatch","query",a),getAllBindings:a=>n("deviceManager","getAllBindings","query",a),listWrappersForCap:a=>n("deviceManager","listWrappersForCap","query",a),listBindableCapsForDeviceType:a=>n("deviceManager","listBindableCapsForDeviceType","query",a),discoverDevices:a=>n("deviceManager","discoverDevices","mutation",a),adoptDevice:a=>n("deviceManager","adoptDevice","mutation",a),getCreationSchema:a=>n("deviceManager","getCreationSchema","query",a),createDevice:a=>n("deviceManager","createDevice","mutation",a),testCreationField:a=>n("deviceManager","testCreationField","mutation",a),adoptionListCandidateFilters:a=>n("deviceManager","adoptionListCandidateFilters","query",a),adoptionListCandidates:a=>n("deviceManager","adoptionListCandidates","query",a),adoptionRefresh:a=>n("deviceManager","adoptionRefresh","mutation",a),adoptionAdopt:a=>n("deviceManager","adoptionAdopt","mutation",a),adoptionRelease:a=>n("deviceManager","adoptionRelease","mutation",a),adoptionStartJob:a=>n("deviceManager","adoptionStartJob","mutation",a),adoptionListJobs:a=>n("deviceManager","adoptionListJobs","query",a),adoptionCancelJob:a=>n("deviceManager","adoptionCancelJob","mutation",a),adoptionResync:a=>n("deviceManager","adoptionResync","mutation",a),discoveryProviders:a=>n("deviceManager","discoveryProviders","query",a),discoverAllProviders:a=>n("deviceManager","discoverAllProviders","mutation",a),discoverProvider:a=>n("deviceManager","discoverProvider","mutation",a),providerCreationType:a=>n("deviceManager","providerCreationType","query",a),providerDiscoveryParamsSchema:a=>n("deviceManager","providerDiscoveryParamsSchema","query",a),getDeviceStatusAggregateBatch:a=>n("deviceManager","getDeviceStatusAggregateBatch","query",a)},deviceProvider:{start:a=>n("deviceProvider","start","mutation",a),stop:a=>n("deviceProvider","stop","mutation",a),getStatus:a=>n("deviceProvider","getStatus","query",a),getDevices:a=>n("deviceProvider","getDevices","query",a),supportsDiscovery:a=>n("deviceProvider","supportsDiscovery","query",a),discoverDevices:a=>n("deviceProvider","discoverDevices","mutation",a),getDiscoveryParamsSchema:a=>n("deviceProvider","getDiscoveryParamsSchema","query",a),getManualCreationType:a=>n("deviceProvider","getManualCreationType","query",a),adoptDiscoveredDevice:a=>n("deviceProvider","adoptDiscoveredDevice","mutation",a),supportsManualCreation:a=>n("deviceProvider","supportsManualCreation","query",a),getChildCreationSchema:a=>n("deviceProvider","getChildCreationSchema","query",a),createDevice:a=>n("deviceProvider","createDevice","mutation",a),testCreationField:a=>n("deviceProvider","testCreationField","mutation",a)},deviceState:{getAllSnapshots:a=>n("deviceState","getAllSnapshots","query",a)},faceGallery:{listIdentities:a=>n("faceGallery","listIdentities","query",a),createIdentity:a=>n("faceGallery","createIdentity","mutation",a),renameIdentity:a=>n("faceGallery","renameIdentity","mutation",a),deleteIdentity:a=>n("faceGallery","deleteIdentity","mutation",a),listIdentitySamples:a=>n("faceGallery","listIdentitySamples","query",a),auditIdentitySamples:a=>n("faceGallery","auditIdentitySamples","query",a),removeSample:a=>n("faceGallery","removeSample","mutation",a),getFaceMedia:a=>n("faceGallery","getFaceMedia","query",a),assignFace:a=>n("faceGallery","assignFace","mutation",a),unassignFace:a=>n("faceGallery","unassignFace","mutation",a),deleteFace:a=>n("faceGallery","deleteFace","mutation",a),assignFaces:a=>n("faceGallery","assignFaces","mutation",a),unassignFaces:a=>n("faceGallery","unassignFaces","mutation",a),suggestFaceClusters:a=>n("faceGallery","suggestFaceClusters","query",a)},integrations:{list:a=>n("integrations","list","query",a),get:a=>n("integrations","get","query",a),getByAddonId:a=>n("integrations","getByAddonId","query",a),create:a=>n("integrations","create","mutation",a),update:a=>n("integrations","update","mutation",a),delete:a=>n("integrations","delete","mutation",a),getSettings:a=>n("integrations","getSettings","query",a),setSettings:a=>n("integrations","setSettings","mutation",a),getAvailableTypes:a=>n("integrations","getAvailableTypes","query",a),testConnection:a=>n("integrations","testConnection","mutation",a)},llm:{generate:a=>n("llm","generate","mutation",a),generateVision:a=>n("llm","generateVision","mutation",a),cancel:a=>n("llm","cancel","mutation",a),listProfileKinds:a=>n("llm","listProfileKinds","query",a),listProfiles:a=>n("llm","listProfiles","query",a),upsertProfile:a=>n("llm","upsertProfile","mutation",a),deleteProfile:a=>n("llm","deleteProfile","mutation",a),testProfile:a=>n("llm","testProfile","mutation",a),listModels:a=>n("llm","listModels","query",a),getDefaults:a=>n("llm","getDefaults","query",a),setDefault:a=>n("llm","setDefault","mutation",a),getUsage:a=>n("llm","getUsage","query",a),listModelCatalog:a=>n("llm","listModelCatalog","query",a),listRuntimeNodes:a=>n("llm","listRuntimeNodes","query",a),listNodeModels:a=>n("llm","listNodeModels","query",a),resolveModelRef:a=>n("llm","resolveModelRef","mutation",a),installModel:a=>n("llm","installModel","mutation",a),deleteModel:a=>n("llm","deleteModel","mutation",a),getRuntimeStatus:a=>n("llm","getRuntimeStatus","query",a),startRuntime:a=>n("llm","startRuntime","mutation",a),stopRuntime:a=>n("llm","stopRuntime","mutation",a)},localNetwork:{list:a=>n("localNetwork","list","query",a),getPreferred:a=>n("localNetwork","getPreferred","query",a),getConnectionEndpoints:a=>n("localNetwork","getConnectionEndpoints","query",a),getNotificationEndpoint:a=>n("localNetwork","getNotificationEndpoint","query",a),setNotificationEndpoint:a=>n("localNetwork","setNotificationEndpoint","mutation",a),getViewerEndpoints:a=>n("localNetwork","getViewerEndpoints","query",a),setViewerEndpoints:a=>n("localNetwork","setViewerEndpoints","mutation",a),getAllowedAddresses:a=>n("localNetwork","getAllowedAddresses","query",a),setAllowedAddresses:a=>n("localNetwork","setAllowedAddresses","mutation",a),resetAllowlistToBestMatch:a=>n("localNetwork","resetAllowlistToBestMatch","mutation",a),getTlsStatus:a=>n("localNetwork","getTlsStatus","query",a),regenerateCertificate:a=>n("localNetwork","regenerateCertificate","mutation",a),uploadCertificate:a=>n("localNetwork","uploadCertificate","mutation",a),downloadCa:a=>n("localNetwork","downloadCa","query",a),revertToGeneratedCertificate:a=>n("localNetwork","revertToGeneratedCertificate","mutation",a)},meshNetwork:{getStatus:a=>n("meshNetwork","getStatus","query",a),join:a=>n("meshNetwork","join","mutation",a),startLogin:a=>n("meshNetwork","startLogin","mutation",a),leave:a=>n("meshNetwork","leave","mutation",a),logout:a=>n("meshNetwork","logout","mutation",a),listPeers:a=>n("meshNetwork","listPeers","query",a),testConnection:a=>n("meshNetwork","testConnection","mutation",a)},metricsProvider:{collectSnapshot:a=>n("metricsProvider","collectSnapshot","query",a),getCached:a=>n("metricsProvider","getCached","query",a),getCurrent:a=>n("metricsProvider","getCurrent","query",a),getDiskSpace:a=>n("metricsProvider","getDiskSpace","query",a),getGpuInfo:a=>n("metricsProvider","getGpuInfo","query",a),getCpuTemperature:a=>n("metricsProvider","getCpuTemperature","query",a),getProcessStats:a=>n("metricsProvider","getProcessStats","query",a),listAddonInstances:a=>n("metricsProvider","listAddonInstances","query",a),getAddonStats:a=>n("metricsProvider","getAddonStats","query",a),listNodeProcesses:a=>n("metricsProvider","listNodeProcesses","query",a),getLoadSeries:a=>n("metricsProvider","getLoadSeries","query",a)},mqttBroker:{listBrokers:a=>n("mqttBroker","listBrokers","query",a),getBrokerConfig:a=>n("mqttBroker","getBrokerConfig","query",a),addBroker:a=>n("mqttBroker","addBroker","mutation",a),removeBroker:a=>n("mqttBroker","removeBroker","mutation",a),testConnection:a=>n("mqttBroker","testConnection","mutation",a),startEmbeddedBroker:a=>n("mqttBroker","startEmbeddedBroker","mutation",a),stopEmbeddedBroker:a=>n("mqttBroker","stopEmbeddedBroker","mutation",a),getStatus:a=>n("mqttBroker","getStatus","query",a)},networkAccess:{start:a=>n("networkAccess","start","mutation",a),stop:a=>n("networkAccess","stop","mutation",a),getEndpoint:a=>n("networkAccess","getEndpoint","query",a),getStatus:a=>n("networkAccess","getStatus","query",a),listEndpoints:a=>n("networkAccess","listEndpoints","query",a)},networkQuality:{getAllStats:a=>n("networkQuality","getAllStats","query",a)},nodes:{topology:a=>n("nodes","topology","query",a),deployAddon:a=>n("nodes","deployAddon","mutation",a),undeployAddon:a=>n("nodes","undeployAddon","mutation",a),restartAddon:a=>n("nodes","restartAddon","mutation",a),restartProcess:a=>n("nodes","restartProcess","mutation",a),restartNode:a=>n("nodes","restartNode","mutation",a),shutdownNode:a=>n("nodes","shutdownNode","mutation",a),renameNode:a=>n("nodes","renameNode","mutation",a),clusterAddonStatus:a=>n("nodes","clusterAddonStatus","query",a),getCapUsageGraph:a=>n("nodes","getCapUsageGraph","query",a),getNodeAddons:a=>n("nodes","getNodeAddons","query",a),setProcessLogLevel:a=>n("nodes","setProcessLogLevel","mutation",a),executeQuery:a=>n("nodes","executeQuery","mutation",a)},notificationOutput:{listTargetKinds:a=>n("notificationOutput","listTargetKinds","query",a),listTargets:a=>n("notificationOutput","listTargets","query",a),discoverTargets:a=>n("notificationOutput","discoverTargets","query",a),send:a=>n("notificationOutput","send","mutation",a),testTarget:a=>n("notificationOutput","testTarget","mutation",a),upsertTarget:a=>n("notificationOutput","upsertTarget","mutation",a),deleteTarget:a=>n("notificationOutput","deleteTarget","mutation",a),setTargetEnabled:a=>n("notificationOutput","setTargetEnabled","mutation",a)},osdManager:{getConditionSupport:a=>n("osdManager","getConditionSupport","query",a),copyDeviceConfiguration:a=>n("osdManager","copyDeviceConfiguration","mutation",a)},pipelineExecutor:{getAvailableEngines:a=>n("pipelineExecutor","getAvailableEngines","query",a),getSelectedEngine:a=>n("pipelineExecutor","getSelectedEngine","query",a),getDefaultSteps:a=>n("pipelineExecutor","getDefaultSteps","query",a),getEngineProvisioning:a=>n("pipelineExecutor","getEngineProvisioning","query",a),getVideoPipelineSteps:a=>n("pipelineExecutor","getVideoPipelineSteps","query",a),setVideoPipelineSteps:a=>n("pipelineExecutor","setVideoPipelineSteps","mutation",a),clearDeviceOverrides:a=>n("pipelineExecutor","clearDeviceOverrides","mutation",a),getInferenceDeviceHealth:a=>n("pipelineExecutor","getInferenceDeviceHealth","query",a),rearmInferenceDevice:a=>n("pipelineExecutor","rearmInferenceDevice","mutation",a),getSchema:a=>n("pipelineExecutor","getSchema","query",a),getGlobalSteps:a=>n("pipelineExecutor","getGlobalSteps","query",a),getGlobalPipelineConfig:a=>n("pipelineExecutor","getGlobalPipelineConfig","query",a),getOrchestratorConfigSchema:a=>n("pipelineExecutor","getOrchestratorConfigSchema","query",a),validatePipeline:a=>n("pipelineExecutor","validatePipeline","query",a),listTemplates:a=>n("pipelineExecutor","listTemplates","query",a),saveTemplate:a=>n("pipelineExecutor","saveTemplate","mutation",a),updateTemplate:a=>n("pipelineExecutor","updateTemplate","mutation",a),deleteTemplate:a=>n("pipelineExecutor","deleteTemplate","mutation",a),getCapabilities:a=>n("pipelineExecutor","getCapabilities","query",a),getAddonModels:a=>n("pipelineExecutor","getAddonModels","query",a),downloadModel:a=>n("pipelineExecutor","downloadModel","mutation",a),deleteModel:a=>n("pipelineExecutor","deleteModel","mutation",a),cacheFrameInPool:a=>n("pipelineExecutor","cacheFrameInPool","mutation",a),inferCached:a=>n("pipelineExecutor","inferCached","mutation",a),uncacheFrame:a=>n("pipelineExecutor","uncacheFrame","mutation",a),getEffectiveTuning:a=>n("pipelineExecutor","getEffectiveTuning","query",a),listLoadedEngines:a=>n("pipelineExecutor","listLoadedEngines","query",a),spinEngine:a=>n("pipelineExecutor","spinEngine","mutation",a),killEngine:a=>n("pipelineExecutor","killEngine","mutation",a),listReferenceImages:a=>n("pipelineExecutor","listReferenceImages","query",a),getReferenceImage:a=>n("pipelineExecutor","getReferenceImage","query",a),getReferenceAudioFiles:a=>n("pipelineExecutor","getReferenceAudioFiles","query",a),getReferenceAudio:a=>n("pipelineExecutor","getReferenceAudio","query",a),getAudioCapabilities:a=>n("pipelineExecutor","getAudioCapabilities","query",a),runAudioTest:a=>n("pipelineExecutor","runAudioTest","mutation",a),getDetectionConfigSchema:a=>n("pipelineExecutor","getDetectionConfigSchema","query",a)},pipelineOrchestrator:{pauseForStorageMigration:a=>n("pipelineOrchestrator","pauseForStorageMigration","mutation",a),resumeForStorageMigration:a=>n("pipelineOrchestrator","resumeForStorageMigration","mutation",a),rebalance:a=>n("pipelineOrchestrator","rebalance","mutation",a),getPipelineAssignments:a=>n("pipelineOrchestrator","getPipelineAssignments","query",a),getAgentLoad:a=>n("pipelineOrchestrator","getAgentLoad","query",a),getGlobalMetrics:a=>n("pipelineOrchestrator","getGlobalMetrics","query",a),getCapabilityBindings:a=>n("pipelineOrchestrator","getCapabilityBindings","query",a),setCapabilityBinding:a=>n("pipelineOrchestrator","setCapabilityBinding","mutation",a),getIngestOwner:a=>n("pipelineOrchestrator","getIngestOwner","query",a),getAudioNodeLoad:a=>n("pipelineOrchestrator","getAudioNodeLoad","query",a),getAgentSettings:a=>n("pipelineOrchestrator","getAgentSettings","query",a),listAgentSettings:a=>n("pipelineOrchestrator","listAgentSettings","query",a),removeAgentSettings:a=>n("pipelineOrchestrator","removeAgentSettings","mutation",a),setAgentMaxCameras:a=>n("pipelineOrchestrator","setAgentMaxCameras","mutation",a),setAgentDetectWeight:a=>n("pipelineOrchestrator","setAgentDetectWeight","mutation",a),setAgentCapabilities:a=>n("pipelineOrchestrator","setAgentCapabilities","mutation",a),setAgentDecodeLimits:a=>n("pipelineOrchestrator","setAgentDecodeLimits","mutation",a),setAgentReachableHost:a=>n("pipelineOrchestrator","setAgentReachableHost","mutation",a),setAgentInferenceDevices:a=>n("pipelineOrchestrator","setAgentInferenceDevices","mutation",a),getNodeInferenceDevices:a=>n("pipelineOrchestrator","getNodeInferenceDevices","query",a),resetNodePipelineDefaults:a=>n("pipelineOrchestrator","resetNodePipelineDefaults","mutation",a),getCameraStatuses:a=>n("pipelineOrchestrator","getCameraStatuses","query",a),reconcileFromDisk:a=>n("pipelineOrchestrator","reconcileFromDisk","mutation",a),getReconcileFromDiskStatus:a=>n("pipelineOrchestrator","getReconcileFromDiskStatus","query",a),listTemplates:a=>n("pipelineOrchestrator","listTemplates","query",a),saveTemplate:a=>n("pipelineOrchestrator","saveTemplate","mutation",a),updateTemplate:a=>n("pipelineOrchestrator","updateTemplate","mutation",a),deleteTemplate:a=>n("pipelineOrchestrator","deleteTemplate","mutation",a)},pipelineRunner:{attachCamera:a=>n("pipelineRunner","attachCamera","mutation",a),reportMotion:a=>n("pipelineRunner","reportMotion","mutation",a),getLocalLoad:a=>n("pipelineRunner","getLocalLoad","query",a),getLocalMetrics:a=>n("pipelineRunner","getLocalMetrics","query",a),getAllCameraMetrics:a=>n("pipelineRunner","getAllCameraMetrics","query",a),getLocalCameras:a=>n("pipelineRunner","getLocalCameras","query",a),getNativeCrop:a=>n("pipelineRunner","getNativeCrop","query",a),runStatelessStep:a=>n("pipelineRunner","runStatelessStep","mutation",a)},plateGallery:{getPlateMedia:a=>n("plateGallery","getPlateMedia","query",a),searchPlates:a=>n("plateGallery","searchPlates","query",a),suggestPlateClusters:a=>n("plateGallery","suggestPlateClusters","query",a),correctPlateText:a=>n("plateGallery","correctPlateText","mutation",a),deletePlate:a=>n("plateGallery","deletePlate","mutation",a),listVehicles:a=>n("plateGallery","listVehicles","query",a),createVehicle:a=>n("plateGallery","createVehicle","mutation",a),renameVehicle:a=>n("plateGallery","renameVehicle","mutation",a),deleteVehicle:a=>n("plateGallery","deleteVehicle","mutation",a),listVehicleSamples:a=>n("plateGallery","listVehicleSamples","query",a),removeVehicleSample:a=>n("plateGallery","removeVehicleSample","mutation",a),assignPlate:a=>n("plateGallery","assignPlate","mutation",a),unassignPlate:a=>n("plateGallery","unassignPlate","mutation",a),assignPlates:a=>n("plateGallery","assignPlates","mutation",a),unassignPlates:a=>n("plateGallery","unassignPlates","mutation",a)},recording:{getAvailabilityBatch:a=>n("recording","getAvailabilityBatch","query",a),getDaysWithRecordingsBatch:a=>n("recording","getDaysWithRecordingsBatch","query",a),getStorageUsage:a=>n("recording","getStorageUsage","query",a),listOpsLog:a=>n("recording","listOpsLog","query",a),pauseForStorageMigration:a=>n("recording","pauseForStorageMigration","mutation",a),resumeForStorageMigration:a=>n("recording","resumeForStorageMigration","mutation",a),refreshStorageLocationsForMigration:a=>n("recording","refreshStorageLocationsForMigration","mutation",a),startStorageMigrationMove:a=>n("recording","startStorageMigrationMove","mutation",a),getStorageMigrationMoveStatus:a=>n("recording","getStorageMigrationMoveStatus","query",a),cancelStorageMigrationMove:a=>n("recording","cancelStorageMigrationMove","mutation",a),relocateFootage:a=>n("recording","relocateFootage","mutation",a),listRelocateJobs:a=>n("recording","listRelocateJobs","query",a),getRelocateResidue:a=>n("recording","getRelocateResidue","query",a),reconcileLedgerAgainstDisk:a=>n("recording","reconcileLedgerAgainstDisk","mutation",a),cancelRelocateJob:a=>n("recording","cancelRelocateJob","mutation",a),planStorageRebalance:a=>n("recording","planStorageRebalance","query",a),startStorageRebalance:a=>n("recording","startStorageRebalance","mutation",a),getPlacement:a=>n("recording","getPlacement","query",a),setDevicePlacement:a=>n("recording","setDevicePlacement","mutation",a)},recordingExport:{createExport:a=>n("recordingExport","createExport","mutation",a),getExport:a=>n("recordingExport","getExport","query",a),cancelExport:a=>n("recordingExport","cancelExport","mutation",a),deleteExport:a=>n("recordingExport","deleteExport","mutation",a),getDownloadUrl:a=>n("recordingExport","getDownloadUrl","query",a),readExportBytes:a=>n("recordingExport","readExportBytes","query",a)},serverManagement:{getServerPackageStatus:a=>n("serverManagement","getServerPackageStatus","query",a),checkServerUpdate:a=>n("serverManagement","checkServerUpdate","mutation",a),applyServerUpdate:a=>n("serverManagement","applyServerUpdate","mutation",a),rollbackServerUpdate:a=>n("serverManagement","rollbackServerUpdate","mutation",a),restartServer:a=>n("serverManagement","restartServer","mutation",a)},settingsStore:{get:a=>n("settingsStore","get","query",a),set:a=>n("settingsStore","set","mutation",a),query:a=>n("settingsStore","query","query",a),upsert:a=>n("settingsStore","upsert","mutation",a),insert:a=>n("settingsStore","insert","mutation",a),insertMany:a=>n("settingsStore","insertMany","mutation",a),update:a=>n("settingsStore","update","mutation",a),delete:a=>n("settingsStore","delete","mutation",a),deleteWhere:a=>n("settingsStore","deleteWhere","mutation",a),updateWhere:a=>n("settingsStore","updateWhere","mutation",a),count:a=>n("settingsStore","count","query",a),aggregate:a=>n("settingsStore","aggregate","query",a),histogram:a=>n("settingsStore","histogram","query",a),isEmpty:a=>n("settingsStore","isEmpty","query",a),declareCollection:a=>n("settingsStore","declareCollection","mutation",a)},storage:{resolve:a=>n("storage","resolve","query",a),write:a=>n("storage","write","mutation",a),read:a=>n("storage","read","query",a),exists:a=>n("storage","exists","query",a),list:a=>n("storage","list","query",a),delete:a=>n("storage","delete","mutation",a),getAvailableSpace:a=>n("storage","getAvailableSpace","query",a),beginUpload:a=>n("storage","beginUpload","mutation",a),writeChunk:a=>n("storage","writeChunk","mutation",a),finalizeUpload:a=>n("storage","finalizeUpload","mutation",a),abortUpload:a=>n("storage","abortUpload","mutation",a),beginDownload:a=>n("storage","beginDownload","mutation",a),readChunk:a=>n("storage","readChunk","query",a),endDownload:a=>n("storage","endDownload","mutation",a),listLocations:a=>n("storage","listLocations","query",a),listLocationDeclarations:a=>n("storage","listLocationDeclarations","query",a),upsertLocation:a=>n("storage","upsertLocation","mutation",a),deleteLocation:a=>n("storage","deleteLocation","mutation",a),listDrainProgress:a=>n("storage","listDrainProgress","query",a),testLocation:a=>n("storage","testLocation","query",a),listProviders:a=>n("storage","listProviders","query",a),testConfig:a=>n("storage","testConfig","query",a)},storageMigration:{plan:a=>n("storageMigration","plan","query",a),start:a=>n("storageMigration","start","mutation",a),status:a=>n("storageMigration","status","query",a),cancel:a=>n("storageMigration","cancel","mutation",a),movers:a=>n("storageMigration","movers","query",a),residue:a=>n("storageMigration","residue","query",a),drain:a=>n("storageMigration","drain","mutation",a),cleanupStart:a=>n("storageMigration","cleanupStart","mutation",a),cleanupStatus:a=>n("storageMigration","cleanupStatus","query",a),cleanupCancel:a=>n("storageMigration","cleanupCancel","mutation",a),history:a=>n("storageMigration","history","query",a)},streamBroker:{fetchEventMedia:a=>n("streamBroker","fetchEventMedia","mutation",a),listAllCameraStreams:a=>n("streamBroker","listAllCameraStreams","query",a),listAllProfileSlots:a=>n("streamBroker","listAllProfileSlots","query",a),getBrokerStats:a=>n("streamBroker","getBrokerStats","query",a),probeStream:a=>n("streamBroker","probeStream","mutation",a),listClients:a=>n("streamBroker","listClients","query",a),killClient:a=>n("streamBroker","killClient","mutation",a),getStreamUrl:a=>n("streamBroker","getStreamUrl","query",a),getStreamWithCodec:a=>n("streamBroker","getStreamWithCodec","mutation",a),releaseStreamWithCodec:a=>n("streamBroker","releaseStreamWithCodec","mutation",a),acquireEgressTranscode:a=>n("streamBroker","acquireEgressTranscode","mutation",a),releaseEgressTranscode:a=>n("streamBroker","releaseEgressTranscode","mutation",a),subscribeAudioChunks:a=>n("streamBroker","subscribeAudioChunks","mutation",a),pullAudioChunks:a=>n("streamBroker","pullAudioChunks","query",a),unsubscribeAudioChunks:a=>n("streamBroker","unsubscribeAudioChunks","mutation",a),subscribeFrames:a=>n("streamBroker","subscribeFrames","mutation",a),pullFrameHandles:a=>n("streamBroker","pullFrameHandles","query",a),unsubscribeFrames:a=>n("streamBroker","unsubscribeFrames","mutation",a),setPreBufferDuration:a=>n("streamBroker","setPreBufferDuration","mutation",a),getPreBufferInfo:a=>n("streamBroker","getPreBufferInfo","query",a),getRtspPort:a=>n("streamBroker","getRtspPort","query",a),getAllRtspEntries:a=>n("streamBroker","getAllRtspEntries","query",a),getRtspEntry:a=>n("streamBroker","getRtspEntry","query",a),regenerateRtspToken:a=>n("streamBroker","regenerateRtspToken","mutation",a),setRtspEnabled:a=>n("streamBroker","setRtspEnabled","mutation",a),isRtspEnabled:a=>n("streamBroker","isRtspEnabled","query",a)},system:{info:a=>n("system","info","query",a),health:a=>n("system","health","query",a),featureFlags:a=>n("system","featureFlags","query",a),networkAddresses:a=>n("system","networkAddresses","query",a),getRetentionConfig:a=>n("system","getRetentionConfig","query",a),setRetentionConfig:a=>n("system","setRetentionConfig","mutation",a),forceRetentionCleanup:a=>n("system","forceRetentionCleanup","mutation",a),getSiteLocation:a=>n("system","getSiteLocation","query",a),setSiteLocation:a=>n("system","setSiteLocation","mutation",a),detectSiteLocation:a=>n("system","detectSiteLocation","mutation",a),getRequestCensus:a=>n("system","getRequestCensus","query",a),getLoadContributions:a=>n("system","getLoadContributions","query",a),getFailureContributions:a=>n("system","getFailureContributions","query",a),getLoggingSettings:a=>n("system","getLoggingSettings","query",a),setLoggingSettings:a=>n("system","setLoggingSettings","mutation",a)},terminalSession:{listProfiles:a=>n("terminalSession","listProfiles","query",a),listInstances:a=>n("terminalSession","listInstances","query",a),createInstance:a=>n("terminalSession","createInstance","mutation",a),updateInstance:a=>n("terminalSession","updateInstance","mutation",a),deleteInstance:a=>n("terminalSession","deleteInstance","mutation",a),setInstanceEnabled:a=>n("terminalSession","setInstanceEnabled","mutation",a),listLegacyCameras:a=>n("terminalSession","listLegacyCameras","query",a),adoptLegacyMonitor:a=>n("terminalSession","adoptLegacyMonitor","mutation",a),listSessions:a=>n("terminalSession","listSessions","query",a),openSession:a=>n("terminalSession","openSession","mutation",a),resize:a=>n("terminalSession","resize","mutation",a),pullOutput:a=>n("terminalSession","pullOutput","mutation",a),writeInput:a=>n("terminalSession","writeInput","mutation",a),close:a=>n("terminalSession","close","mutation",a)},toast:{onToast:(a,s)=>n("toast","onToast","subscription",a,s)},turnProvider:{getTurnServers:a=>n("turnProvider","getTurnServers","query",a)},userManagement:{listUsers:a=>n("userManagement","listUsers","query",a),createUser:a=>n("userManagement","createUser","mutation",a),updateUser:a=>n("userManagement","updateUser","mutation",a),deleteUser:a=>n("userManagement","deleteUser","mutation",a),resetPassword:a=>n("userManagement","resetPassword","mutation",a),setUserScopes:a=>n("userManagement","setUserScopes","mutation",a),validateCredentials:a=>n("userManagement","validateCredentials","mutation",a),listApiKeys:a=>n("userManagement","listApiKeys","query",a),createApiKey:a=>n("userManagement","createApiKey","mutation",a),revokeApiKey:a=>n("userManagement","revokeApiKey","mutation",a),validateApiKey:a=>n("userManagement","validateApiKey","mutation",a),createScopedToken:a=>n("userManagement","createScopedToken","mutation",a),revokeScopedToken:a=>n("userManagement","revokeScopedToken","mutation",a),validateScopedToken:a=>n("userManagement","validateScopedToken","query",a),listScopedTokens:a=>n("userManagement","listScopedTokens","query",a),setupTotp:a=>n("userManagement","setupTotp","mutation",a),confirmTotp:a=>n("userManagement","confirmTotp","mutation",a),disableTotp:a=>n("userManagement","disableTotp","mutation",a),getTotpStatus:a=>n("userManagement","getTotpStatus","query",a),verifyTotp:a=>n("userManagement","verifyTotp","mutation",a),oauthIssueCode:a=>n("userManagement","oauthIssueCode","mutation",a),oauthExchangeCode:a=>n("userManagement","oauthExchangeCode","mutation",a),oauthRefresh:a=>n("userManagement","oauthRefresh","mutation",a),oauthVerifyAccessToken:a=>n("userManagement","oauthVerifyAccessToken","query",a),listOauthSessions:a=>n("userManagement","listOauthSessions","query",a),revokeOauthSession:a=>n("userManagement","revokeOauthSession","mutation",a)}}}var cee=["devices","classes"];new Set(cee);var _T=d({title:o().max(500).optional(),body:o().max(2e3).optional()}),NT=o().min(1).max(200),OT=w(l()).min(1),jT=l().int().min(2).max(3600),PT=l().int().min(1).max(60),DT=w(RI).min(1),zT=l().int().min(1).max(5),uee=.1,LT=l().min(uee).max(3600),qT=l().min(0).max(60),BT=o().max(200),FT=N(["image","gif"]),UT=w(o().min(1).max(40)).max(20),dee=d({name:NT,enabled:A().default(!0),deviceIds:OT,schedule:Nm,cadenceSec:jT.default(15),framerate:PT.default(10),denseCadenceSec:LT.optional(),minDwellSec:qT.optional(),targets:DT,template:_T.optional(),previewText:BT.optional(),previewMode:FT.default("image"),reportClasses:UT.optional(),priority:zT.default(3)});d({name:NT.optional(),enabled:A().optional(),deviceIds:OT.optional(),schedule:Nm.optional(),cadenceSec:jT.optional(),framerate:PT.optional(),denseCadenceSec:LT.optional(),minDwellSec:qT.optional(),targets:DT.optional(),template:_T.nullable().optional(),previewText:BT.optional(),previewMode:FT.optional(),reportClasses:UT.optional(),priority:zT.optional()});dee.extend({id:o(),ownerUserId:o().optional(),lastGeneratedAt:l().optional(),generatedByDevice:X(o(),l()).optional(),createdBy:o(),createdAt:l(),updatedAt:l()});var pee=[{stepId:"face-embedding",label:"Face recognition model",defaultModelId:"arcface-r100",indexName:"the enrolled face gallery",options:[{id:"arcface-r100",label:"ArcFace (ResNet34)"},{id:"auraface-r100",label:"AuraFace R100"},{id:"inception-resnet-v1",label:"Inception ResNet V1"}]},{stepId:"clip-embedding",label:"Semantic search model",defaultModelId:"mobileclip-s1",indexName:"the object semantic-search index",options:[{id:"mobileclip-s1",label:"MobileCLIP S1"},{id:"mobileclip-s2",label:"MobileCLIP S2"}]}];Object.freeze(Object.fromEntries(pee.map(e=>[e.stepId,e.defaultModelId])));o().min(1);var mee=[{stepId:"face-embedding",key:"minLandmarkFaceSize",label:"Min face size for recognition (detection px)",description:"Refuse to embed a face smaller than this IN THE DETECTION FRAME. Applies to every node — the enrolled gallery is one index, and two admission floors would fill it from two policies. 0 disables the gate.",type:"slider",min:0,max:64,step:2,default:24}];function fee(e,t){return`clusterStepSetting:${e}:${t}`}var hee=l().finite();function gee(e){const t={};for(const n of mee){const a=hee.safeParse(e[fee(n.stepId,n.key)]),s=a.success?a.data:n.default,p=t[n.stepId]??{};t[n.stepId]={...p,[n.key]:s}}return t}gee({});d({paddingRatio:l().min(0).max(4),square:A()});var vee=N(["all","inferred"]);d({holdFrames:l().int().min(1).max(64),budgetMb:l().int().min(0).max(4096),activityMs:l().int().min(0).max(12e4),admission:vee,tileBudgetMb:l().int().min(0).max(1024),sceneBudgetMb:l().int().min(0).max(1024)});var L2={"°C":{dimension:"temperature",factor:1,offset:0},"°F":{dimension:"temperature",factor:5/9,offset:-160/9},K:{dimension:"temperature",factor:1,offset:-273.15},hPa:{dimension:"pressure",factor:1,offset:0},kPa:{dimension:"pressure",factor:10,offset:0},Pa:{dimension:"pressure",factor:.01,offset:0},mbar:{dimension:"pressure",factor:1,offset:0},bar:{dimension:"pressure",factor:1e3,offset:0},inHg:{dimension:"pressure",factor:33.8639,offset:0},mmHg:{dimension:"pressure",factor:1.33322,offset:0},psi:{dimension:"pressure",factor:68.9476,offset:0},"m/s":{dimension:"speed",factor:1,offset:0},"km/h":{dimension:"speed",factor:1/3.6,offset:0},mph:{dimension:"speed",factor:.44704,offset:0},kn:{dimension:"speed",factor:.514444,offset:0},"mm/h":{dimension:"precipitation-rate",factor:1,offset:0},"in/h":{dimension:"precipitation-rate",factor:25.4,offset:0},m:{dimension:"length",factor:1,offset:0},mm:{dimension:"length",factor:.001,offset:0},cm:{dimension:"length",factor:.01,offset:0},km:{dimension:"length",factor:1e3,offset:0},in:{dimension:"length",factor:.0254,offset:0},ft:{dimension:"length",factor:.3048,offset:0},mi:{dimension:"length",factor:1609.344,offset:0},lx:{dimension:"illuminance",factor:1,offset:0},"W/m²":{dimension:"irradiance",factor:1,offset:0},W:{dimension:"power",factor:1,offset:0},kW:{dimension:"power",factor:1e3,offset:0},VA:{dimension:"apparent-power",factor:1,offset:0},Wh:{dimension:"energy",factor:1,offset:0},kWh:{dimension:"energy",factor:1e3,offset:0},MWh:{dimension:"energy",factor:1e6,offset:0},V:{dimension:"voltage",factor:1,offset:0},mV:{dimension:"voltage",factor:.001,offset:0},A:{dimension:"current",factor:1,offset:0},mA:{dimension:"current",factor:.001,offset:0},ppm:{dimension:"concentration-volume",factor:1,offset:0},ppb:{dimension:"concentration-volume",factor:.001,offset:0},"µg/m³":{dimension:"concentration-mass",factor:1,offset:0},"mg/m³":{dimension:"concentration-mass",factor:1e3,offset:0},kg:{dimension:"mass",factor:1,offset:0},g:{dimension:"mass",factor:.001,offset:0},lb:{dimension:"mass",factor:.453592,offset:0},oz:{dimension:"mass",factor:.0283495,offset:0},"%":{dimension:"percentage",factor:1,offset:0}};function by(e){return Object.hasOwn(L2,e)?L2[e]:void 0}function q2(e){return by(e)?.dimension}function yee(e,t){return e*t.factor+t.offset}function bee(e,t){return(e-t.offset)/t.factor}function See(e,t,n){if(t===n)return e;const a=by(t);if(!a)return;const s=by(n);if(s&&a.dimension===s.dimension)return bee(yee(e,a),s)}function xee(e,t){if(e===t)return!0;const n=q2(e);return n===void 0?!1:n===q2(t)}var kee=class{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set(t,n){this.keyToValue.set(t,n),this.valueToKey.set(n,t)}getByKey(t){return this.keyToValue.get(t)}getByValue(t){return this.valueToKey.get(t)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}},HT=class{constructor(t){this.generateIdentifier=t,this.kv=new kee}register(t,n){this.kv.getByValue(t)||(n||(n=this.generateIdentifier(t)),this.kv.set(n,t))}clear(){this.kv.clear()}getIdentifier(t){return this.kv.getByValue(t)}getValue(t){return this.kv.getByKey(t)}},wee=class extends HT{constructor(){super(t=>t.name),this.classToAllowedProps=new Map}register(t,n){typeof n=="object"?(n.allowProps&&this.classToAllowedProps.set(t,n.allowProps),super.register(t,n.identifier)):super.register(t,n)}getAllowedProps(t){return this.classToAllowedProps.get(t)}};function Mee(e){if("values"in Object)return Object.values(e);const t=[];for(const n in e)e.hasOwnProperty(n)&&t.push(e[n]);return t}function Cee(e,t){const n=Mee(e);if("find"in n)return n.find(t);const a=n;for(let s=0;s<a.length;s++){const p=a[s];if(t(p))return p}}function ul(e,t){Object.entries(e).forEach(([n,a])=>t(a,n))}function Ap(e,t){return e.indexOf(t)!==-1}function B2(e,t){for(let n=0;n<e.length;n++){const a=e[n];if(t(a))return a}}var Aee=class{constructor(){this.transfomers={}}register(t){this.transfomers[t.name]=t}findApplicable(t){return Cee(this.transfomers,n=>n.isApplicable(t))}findByName(t){return this.transfomers[t]}},Eee=e=>Object.prototype.toString.call(e).slice(8,-1),$T=e=>typeof e>"u",Ree=e=>e===null,Yc=e=>typeof e!="object"||e===null||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype,Sy=e=>Yc(e)&&Object.keys(e).length===0,Ur=e=>Array.isArray(e),Iee=e=>typeof e=="string",Tee=e=>typeof e=="number"&&!isNaN(e),_ee=e=>typeof e=="boolean",Nee=e=>e instanceof RegExp,Xc=e=>e instanceof Map,Jc=e=>e instanceof Set,QT=e=>Eee(e)==="Symbol",Oee=e=>e instanceof Date&&!isNaN(e.valueOf()),VT=e=>e instanceof Error,F2=e=>typeof e=="number"&&isNaN(e),jee=e=>_ee(e)||Ree(e)||$T(e)||Tee(e)||Iee(e)||QT(e),Pee=e=>typeof e=="bigint",Dee=e=>e===1/0||e===-1/0,zee=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),Lee=e=>e instanceof URL,xy=e=>e.replace(/\\/g,"\\\\").replace(/\./g,"\\."),Fg=e=>e.map(String).map(xy).join("."),Bc=(e,t)=>{const n=[];let a="";for(let p=0;p<e.length;p++){let f=e.charAt(p);if(!t&&f==="\\"){const m=e.charAt(p+1);if(m==="\\"){a+="\\",p++;continue}else if(m!==".")throw Error("invalid path")}if(f==="\\"&&e.charAt(p+1)==="."){a+=".",p++;continue}if(f==="."){n.push(a),a="";continue}a+=f}const s=a;return n.push(s),n};function vi(e,t,n,a){return{isApplicable:e,annotation:t,transform:n,untransform:a}}var GT=[vi($T,"undefined",()=>null,()=>{}),vi(Pee,"bigint",e=>e.toString(),e=>typeof BigInt<"u"?BigInt(e):(console.error("Please add a BigInt polyfill."),e)),vi(Oee,"Date",e=>e.toISOString(),e=>new Date(e)),vi(VT,"Error",(e,t)=>{const n={name:e.name,message:e.message};return"cause"in e&&(n.cause=e.cause),t.allowedErrorProps.forEach(a=>{n[a]=e[a]}),n},(e,t)=>{const n=new Error(e.message,{cause:e.cause});return n.name=e.name,n.stack=e.stack,t.allowedErrorProps.forEach(a=>{n[a]=e[a]}),n}),vi(Nee,"regexp",e=>""+e,e=>{const t=e.slice(1,e.lastIndexOf("/")),n=e.slice(e.lastIndexOf("/")+1);return new RegExp(t,n)}),vi(Jc,"set",e=>[...e.values()],e=>new Set(e)),vi(Xc,"map",e=>[...e.entries()],e=>new Map(e)),vi(e=>F2(e)||Dee(e),"number",e=>F2(e)?"NaN":e>0?"Infinity":"-Infinity",Number),vi(e=>e===0&&1/e===-1/0,"number",()=>"-0",Number),vi(Lee,"URL",e=>e.toString(),e=>new URL(e))];function Om(e,t,n,a){return{isApplicable:e,annotation:t,transform:n,untransform:a}}var ZT=Om((e,t)=>QT(e)?!!t.symbolRegistry.getIdentifier(e):!1,(e,t)=>["symbol",t.symbolRegistry.getIdentifier(e)],e=>e.description,(e,t,n)=>{const a=n.symbolRegistry.getValue(t[1]);if(!a)throw new Error("Trying to deserialize unknown symbol");return a}),qee=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),KT=Om(zee,e=>["typed-array",e.constructor.name],e=>[...e],(e,t)=>{const n=qee[t[1]];if(!n)throw new Error("Trying to deserialize unknown typed array");return new n(e)});function WT(e,t){return e?.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}var YT=Om(WT,(e,t)=>["class",t.classRegistry.getIdentifier(e.constructor)],(e,t)=>{const n=t.classRegistry.getAllowedProps(e.constructor);if(!n)return{...e};const a={};return n.forEach(s=>{a[s]=e[s]}),a},(e,t,n)=>{const a=n.classRegistry.getValue(t[1]);if(!a)throw new Error(`Trying to deserialize unknown class '${t[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);return Object.assign(Object.create(a.prototype),e)}),XT=Om((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)=>{const a=n.customTransformerRegistry.findByName(t[1]);if(!a)throw new Error("Trying to deserialize unknown custom value");return a.deserialize(e)}),Bee=[YT,ZT,XT,KT],U2=(e,t)=>{const n=B2(Bee,s=>s.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};const a=B2(GT,s=>s.isApplicable(e,t));if(a)return{value:a.transform(e,t),type:a.annotation}},JT={};GT.forEach(e=>{JT[e.annotation]=e});var Fee=(e,t,n)=>{if(Ur(t))switch(t[0]){case"symbol":return ZT.untransform(e,t,n);case"class":return YT.untransform(e,t,n);case"custom":return XT.untransform(e,t,n);case"typed-array":return KT.untransform(e,t,n);default:throw new Error("Unknown transformation: "+t)}else{const a=JT[t];if(!a)throw new Error("Unknown transformation: "+t);return a.untransform(e,n)}},Ks=(e,t)=>{if(t>e.size)throw new Error("index out of bounds");const n=e.keys();for(;t>0;)n.next(),t--;return n.next().value};function e_(e){if(Ap(e,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(Ap(e,"prototype"))throw new Error("prototype is not allowed as a property");if(Ap(e,"constructor"))throw new Error("constructor is not allowed as a property")}var Uee=(e,t)=>{e_(t);for(let n=0;n<t.length;n++){const a=t[n];if(Jc(e))e=Ks(e,+a);else if(Xc(e)){const s=+a,p=+t[++n]==0?"key":"value",f=Ks(e,s);switch(p){case"key":e=f;break;case"value":e=e.get(f);break}}else e=e[a]}return e},ky=(e,t,n)=>{if(e_(t),t.length===0)return n(e);let a=e;for(let p=0;p<t.length-1;p++){const f=t[p];if(Ur(a)){const m=+f;a=a[m]}else if(Yc(a))a=a[f];else if(Jc(a)){const m=+f;a=Ks(a,m)}else if(Xc(a)){if(p===t.length-2)break;const m=+f,h=+t[++p]==0?"key":"value",c=Ks(a,m);switch(h){case"key":a=c;break;case"value":a=a.get(c);break}}}const s=t[t.length-1];if(Ur(a)?a[+s]=n(a[+s]):Yc(a)&&(a[s]=n(a[s])),Jc(a)){const p=Ks(a,+s),f=n(p);p!==f&&(a.delete(p),a.add(f))}if(Xc(a)){const p=+t[t.length-2],f=Ks(a,p);switch(+s==0?"key":"value"){case"key":{const m=n(f);a.set(m,a.get(f)),m!==f&&a.delete(f);break}case"value":a.set(f,n(a.get(f)));break}}return e},t_=e=>e<1;function wy(e,t,n,a=[]){if(!e)return;const s=t_(n);if(!Ur(e)){ul(e,(m,h)=>wy(m,t,n,[...a,...Bc(h,s)]));return}const[p,f]=e;f&&ul(f,(m,h)=>{wy(m,t,n,[...a,...Bc(h,s)])}),t(p,a)}function Hee(e,t,n,a){return wy(t,(s,p)=>{e=ky(e,p,f=>Fee(f,s,a))},n),e}function $ee(e,t,n){const a=t_(n);function s(p,f){const m=Uee(e,Bc(f,a));p.map(h=>Bc(h,a)).forEach(h=>{e=ky(e,h,()=>m)})}if(Ur(t)){const[p,f]=t;p.forEach(m=>{e=ky(e,Bc(m,a),()=>e)}),f&&ul(f,s)}else ul(t,s);return e}var Qee=(e,t)=>Yc(e)||Ur(e)||Xc(e)||Jc(e)||VT(e)||WT(e,t);function Vee(e,t,n){const a=n.get(e);a?a.push(t):n.set(e,[t])}function Gee(e,t){const n={};let a;return e.forEach(s=>{if(s.length<=1)return;t||(s=s.map(m=>m.map(String)).sort((m,h)=>m.length-h.length));const[p,...f]=s;p.length===0?a=f.map(Fg):n[Fg(p)]=f.map(Fg)}),a?Sy(n)?[a]:[a,n]:Sy(n)?void 0:n}var n_=(e,t,n,a,s=[],p=[],f=new Map)=>{const m=jee(e);if(!m){Vee(e,s,t);const E=f.get(e);if(E)return a?{transformedValue:null}:E}if(!Qee(e,n)){const E=U2(e,n),R=E?{transformedValue:E.value,annotations:[E.type]}:{transformedValue:e};return m||f.set(e,R),R}if(Ap(p,e))return{transformedValue:null};const h=U2(e,n),c=h?.value??e,x=Ur(c)?[]:{},M={};ul(c,(E,R)=>{if(R==="__proto__"||R==="constructor"||R==="prototype")throw new Error(`Detected property ${R}. This is a prototype pollution risk, please remove it from your object.`);const _=n_(E,t,n,a,[...s,R],[...p,e],f);x[R]=_.transformedValue,Ur(_.annotations)?M[xy(R)]=_.annotations:Yc(_.annotations)&&ul(_.annotations,(j,D)=>{M[xy(R)+"."+D]=j})});const C=Sy(M)?{transformedValue:x,annotations:h?[h.type]:void 0}:{transformedValue:x,annotations:h?[h.type,M]:M};return m||f.set(e,C),C};function a_(e){return Object.prototype.toString.call(e).slice(8,-1)}function H2(e){return a_(e)==="Array"}function Zee(e){if(a_(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function Kee(e,t,n,a,s){const p={}.propertyIsEnumerable.call(a,t)?"enumerable":"nonenumerable";p==="enumerable"&&(e[t]=n),s&&p==="nonenumerable"&&Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}function My(e,t={}){if(H2(e))return e.map(s=>My(s,t));if(!Zee(e))return e;const n=Object.getOwnPropertyNames(e),a=Object.getOwnPropertySymbols(e);return[...n,...a].reduce((s,p)=>{if(p==="__proto__"||H2(t.props)&&!t.props.includes(p))return s;const f=e[p];return Kee(s,p,My(f,t),e,t.nonenumerable),s},{})}var bt=class{constructor({dedupe:t=!1}={}){this.classRegistry=new wee,this.symbolRegistry=new HT(n=>n.description??""),this.customTransformerRegistry=new Aee,this.allowedErrorProps=[],this.dedupe=t}serialize(t){const n=new Map,a=n_(t,n,this,this.dedupe),s={json:a.transformedValue};a.annotations&&(s.meta={...s.meta,values:a.annotations});const p=Gee(n,this.dedupe);return p&&(s.meta={...s.meta,referentialEqualities:p}),s.meta&&(s.meta.v=1),s}deserialize(t,n){const{json:a,meta:s}=t;let p=n?.inPlace?a:My(a);return s?.values&&(p=Hee(p,s.values,s.v??0,this)),s?.referentialEqualities&&(p=$ee(p,s.referentialEqualities,s.v??0)),p}stringify(t){return JSON.stringify(this.serialize(t))}parse(t){return this.deserialize(JSON.parse(t),{inPlace:!0})}registerClass(t,n){this.classRegistry.register(t,n)}registerSymbol(t,n){this.symbolRegistry.register(t,n)}registerCustom(t,n){this.customTransformerRegistry.register({name:n,...t})}allowErrorProps(...t){this.allowedErrorProps.push(...t)}};bt.defaultInstance=new bt;bt.serialize=bt.defaultInstance.serialize.bind(bt.defaultInstance);bt.deserialize=bt.defaultInstance.deserialize.bind(bt.defaultInstance);bt.stringify=bt.defaultInstance.stringify.bind(bt.defaultInstance);bt.parse=bt.defaultInstance.parse.bind(bt.defaultInstance);bt.registerClass=bt.defaultInstance.registerClass.bind(bt.defaultInstance);bt.registerSymbol=bt.defaultInstance.registerSymbol.bind(bt.defaultInstance);bt.registerCustom=bt.defaultInstance.registerCustom.bind(bt.defaultInstance);bt.allowErrorProps=bt.defaultInstance.allowErrorProps.bind(bt.defaultInstance);bt.serialize;bt.deserialize;bt.stringify;bt.parse;bt.registerClass;bt.registerCustom;bt.registerSymbol;bt.allowErrorProps;var Wee=1e4,Yee=6e3,Xee=2e3,Jee=3e4,ete=class{_serverUrl;useWs;baseRetryMs;maxRetryMs;onConnectionChange;token;_trpcClient;_wsClient=null;_eventSubs=new Map;mirror=null;mirrorInit=null;connected=!1;connectedPromise=null;_systemProxy;_connectionVersion=0;_wsEpoch=0;connectionListeners=new Set;constructor(t){this._serverUrl=t.serverUrl.replace(/\/+$/,""),this.token=t.token;const n=typeof window<"u";this.useWs=t.useWebSocket??n,this.onConnectionChange=t.onConnectionChange,this.baseRetryMs=t.retryDelayMs??Xee,this.maxRetryMs=t.maxRetryDelayMs??Jee,this._trpcClient=this.buildTrpcClient(),this._systemProxy=z2(this._trpcClient)}get serverUrl(){return this._serverUrl}get connectionVersion(){return this._connectionVersion}subscribeConnectionEvents(t){return this.connectionListeners.add(t),()=>{this.connectionListeners.delete(t)}}emitConnectionEvent(t){try{this.onConnectionChange?.(t)}catch{}for(const n of this.connectionListeners)try{n(t,this._connectionVersion)}catch{}}async awaitConnected(t){if(this.connected)return;if(this.connectedPromise)return this.connectedPromise;const n=t??15e3;this.connectedPromise=(async()=>{const a=this._trpcClient.auth.me.query();Number.isFinite(n)?await new Promise((s,p)=>{const f=setTimeout(()=>p(new Error(`System.awaitConnected: probe timed out after ${n}ms`)),n);a.then(()=>{clearTimeout(f),s()},m=>{clearTimeout(f),p(m instanceof Error?m:new Error(String(m)))})}):await a,this.connected=!0})();try{await this.connectedPromise}finally{this.connectedPromise=null}}async init(t){if(this.mirror?.isReady())return;if(this.mirrorInit)return this.mirrorInit;const n=new oee(this._trpcClient);return this.mirror=n,this.mirrorInit=(async()=>{await this.awaitConnected(t),await n.init(t)})().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._wsEpoch+=1,this.emitConnectionEvent("connecting"),this._wsClient?.close(),this.disposeMirror(),this.resetEventSubs(),this.connected=!1,this.connectedPromise=null,this._trpcClient=this.buildTrpcClient(),this._systemProxy=z2(this._trpcClient))}switchServerUrl(t){const n=t.replace(/\/+$/,"");n!==this._serverUrl&&(this._serverUrl=n,this.reconnect())}async raceConnectionEndpoints(t){const n=t?.perCandidateTimeoutMs??1500,a=(()=>{try{return new URL(this._serverUrl)}catch{return null}})(),s=a?.port?Number(a.port):a?.protocol==="https:"?443:80,p=a?.protocol==="https:"?"https":"http",f=this._trpcClient.localNetwork?.getConnectionEndpoints;if(!f)return{winner:this._serverUrl,switched:!1};let m;try{m=(await f.query({port:s,ipv4Only:t?.ipv4Only,scheme:p,includeLoopback:!1})).endpoints}catch{return{winner:this._serverUrl,switched:!1}}if(m.length===0)return{winner:this._serverUrl,switched:!1};const h=await tte(m.map(c=>c.baseUrl),n);return!h||h===this._serverUrl?{winner:h??this._serverUrl,switched:!1}:(this.switchServerUrl(h),{winner:h,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(t,n){const a=await this._trpcClient.auth.login.mutate({username:t,password:n});if(typeof a=="object"&&a!==null&&"token"in a){const s=a,p=s.token,f=s.requiresTotp===!0||Array.isArray(s.secondFactors)&&s.secondFactors.length>0;typeof p=="string"&&!f&&this.setToken(p)}return a}async loginVerifyTotp(t,n){const a=await this._trpcClient.auth.loginVerifyTotp.mutate({challengeToken:t,code:n});if(typeof a=="object"&&a!==null&&"token"in a){const s=a.token;typeof s=="string"&&this.setToken(s)}return a}async loginBeginPasskey(t){return await this._trpcClient.auth.loginBeginPasskey.mutate({challengeToken:t})}async loginVerifyPasskey(t,n){const a=await this._trpcClient.auth.loginVerifyPasskey.mutate({challengeToken:t,response:n});if(typeof a=="object"&&a!==null&&"token"in a){const s=a.token;typeof s=="string"&&this.setToken(s)}return a}async passkeyLoginBegin(){return await this._trpcClient.auth.passkeyLoginBegin.mutate()}async passkeyLoginFinish(t){const n=await this._trpcClient.auth.passkeyLoginFinish.mutate({response:t});if(typeof n=="object"&&n!==null&&"token"in n){const a=n,s=a.requiresTotp===!0||Array.isArray(a.secondFactors)&&a.secondFactors.length>0;typeof a.token=="string"&&!s&&this.setToken(a.token)}return n}async logout(){await this._trpcClient.auth.logout.mutate()}async getMe(){return await this._trpcClient.auth.me.query()}async changeOwnPassword(t){return await this._trpcClient.auth.changeOwnPassword.mutate(t)}async setupOwnTotp(){return await this._trpcClient.auth.setupOwnTotp.mutate()}async confirmOwnTotp(t){return await this._trpcClient.auth.confirmOwnTotp.mutate(t)}async disableOwnTotp(){return await this._trpcClient.auth.disableOwnTotp.mutate()}async getOwnTotpStatus(){return await this._trpcClient.auth.getOwnTotpStatus.query()}async beginOwnPasskeyRegistration(){return await this._trpcClient.auth.beginOwnPasskeyRegistration.mutate()}async finishOwnPasskeyRegistration(t){return await this._trpcClient.auth.finishOwnPasskeyRegistration.mutate(t)}async listOwnPasskeys(){return await this._trpcClient.auth.listOwnPasskeys.query()}async removeOwnPasskey(t){return await this._trpcClient.auth.removeOwnPasskey.mutate(t)}async getOwnPasskeySecondFactorPreference(){return await this._trpcClient.auth.getOwnPasskeySecondFactorPreference.query()}async setOwnPasskeySecondFactorPreference(t){return await this._trpcClient.auth.setOwnPasskeySecondFactorPreference.mutate(t)}setToken(t){this.token=t}listDevices(t){return this.mirror?(t?this.mirror.query(t):this.mirror.getAllDevices()).map(n=>this.attachBinding(n)):[]}getDeviceInfo(t){return this.mirror?.getDeviceInfo(t)??null}listDeviceInfos(t){const n=this.mirror;if(!n)return[];const a=t?n.query(t):n.getAllDevices(),s=[];for(const p of a){const f=n.getDeviceInfo(p.deviceId);f&&s.push(f)}return s}getDevice(t){const n=this.mirror?.getDeviceById(t)??null;return n?this.attachBinding(n):null}getDeviceByName(t){const n=this.mirror?.getDeviceByName(t)??null;return n?this.attachBinding(n):null}getDeviceByStableId(t){const n=this.mirror?.getDeviceByStableId(t)??null;return n?this.attachBinding(n):null}async waitForDevice(t,n){this.mirror||await this.init();const a=await this.mirror.waitForDevice(t,n??3e4);return this.attachBinding(a)}onDeviceAdded(t){if(!this.mirror)throw new Error("System.onDeviceAdded: call init() before subscribing");return this.mirror.onDeviceAdded(t)}onDeviceRemoved(t){if(!this.mirror)throw new Error("System.onDeviceRemoved: call init() before subscribing");return this.mirror.onDeviceRemoved(t)}attachBinding(t){const n=this.lookupBinding(t.deviceId);if(n===t.binding)return t;const a=t;return a.binding=n,t}lookupBinding(t){return this.mirror?this.mirror.getDeviceById(t)?.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(t,n){const a=n;let s=this._eventSubs.get(t);if(s===void 0){const f=new Set,m=this._trpcClient.live.onEvent.subscribe({category:t},{onData:h=>{for(const c of[...f])try{c(h)}catch{}}});s={listeners:f,unsubscribe:()=>{try{m.unsubscribe()}catch{}}},this._eventSubs.set(t,s)}s.listeners.add(a);let p=!1;return()=>{if(p)return;p=!0;const f=this._eventSubs.get(t);f!==void 0&&(f.listeners.delete(a),f.listeners.size===0&&(f.unsubscribe(),this._eventSubs.delete(t)))}}resetEventSubs(){for(const t of this._eventSubs.values())t.unsubscribe();this._eventSubs.clear()}get trpcClient(){return this._trpcClient}get wsClient(){return this._wsClient}buildTrpcClient(){const t=()=>{const n={};return this.token&&(n.Authorization=`Bearer ${this.token}`),n};if(this.useWs){const n=this._serverUrl.replace(/^http/,"ws")+"/trpc",a=this.baseRetryMs,s=this.maxRetryMs,p=this._wsEpoch;return this._wsClient=R3({url:n,connectionParams:()=>({token:this.token}),retryDelayMs:f=>Math.min(a*Math.pow(2,f),s),keepAlive:{enabled:!0,intervalMs:Wee,pongTimeoutMs:Yee},onOpen:()=>{p===this._wsEpoch&&(this._connectionVersion+=1,this.emitConnectionEvent("connected"))},onClose:()=>{p===this._wsEpoch&&this.emitConnectionEvent("disconnected")}}),Dv({links:[I3({client:this._wsClient,transformer:bt})]})}return this._wsClient=null,Dv({links:[f3({url:`${this._serverUrl}/trpc`,headers:t,transformer:bt})]})}};function jm(e){return new ete(e)}async function tte(e,t){if(e.length===0)return null;if(typeof fetch!="function")return e[0]??null;const n=typeof window<"u"&&typeof window.location<"u"&&window.location.protocol==="https:"?e.filter(p=>p.toLowerCase().startsWith("https://")):e;if(n.length===0)return null;const a=n.map(()=>new AbortController),s=n.map(async(p,f)=>{const m=a[f],h=setTimeout(()=>m.abort(),t);try{const c=await fetch(`${p.replace(/\/+$/,"")}/trpc/health`,{method:"GET",signal:m.signal,credentials:"omit"});if(!c.ok)throw new Error(`${c.status}`);return p}finally{clearTimeout(h)}});try{const p=await Promise.any(s);for(const f of a)try{f.abort()}catch{}return p}catch{return null}}var nte=(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})({}),ate=["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"],ite=["person","people","pedestrian","rider","driver","cyclist","skier","skateboarder","face","hand","head","body"],rte=["vehicle","car","truck","bus","motorcycle","bicycle","van","ambulance","police_car","fire_truck","train","subway","tram","airplane","boat","ship","helicopter"],ote=["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"],ste=["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"],lte=["motion","movement","other"],cte=["package","packet"],ute=["audio"],dte=["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"],pte=["doorbell","ring"],mte=["lock","binary","flood","entry","door","leak","door_open","flooded","entry_open"];({...ate.reduce((e,t)=>({...e,[t]:"animal"}),{}),...ite.reduce((e,t)=>({...e,[t]:"person"}),{}),...rte.reduce((e,t)=>({...e,[t]:"vehicle"}),{}),...lte.reduce((e,t)=>({...e,[t]:"motion"}),{}),...cte.reduce((e,t)=>({...e,[t]:"package"}),{}),...ote.reduce((e,t)=>({...e,[t]:"face"}),{}),...ste.reduce((e,t)=>({...e,[t]:"plate"}),{}),...ute.reduce((e,t)=>({...e,[t]:"audio"}),{}),...dte.reduce((e,t)=>({...e,[t]:"audio"}),{}),...pte.reduce((e,t)=>({...e,[t]:"doorbell"}),{}),...mte.reduce((e,t)=>({...e,[t]:"sensor"}),{})});var fte=Object.values(nte),hte=fte.filter(e=>e!=="motion");[...hte];var T=gb();const An=kP(T),gte=xP({__proto__:null,default:An},[T]);T.createContext(null);var Bo=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},vte=class extends Bo{#t;#e;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#t!==e&&(this.#t=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#t=="boolean"?this.#t:globalThis.document?.visibilityState!=="hidden"}},f0=new vte,yte={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},bte=class{#t=yte;#e=!1;setTimeoutProvider(e){this.#t=e}setTimeout(e,t){return this.#t.setTimeout(e,t)}clearTimeout(e){this.#t.clearTimeout(e)}setInterval(e,t){return this.#t.setInterval(e,t)}clearInterval(e){this.#t.clearInterval(e)}},Eo=new bte;function Ste(e){setTimeout(e,0)}var xte=typeof window>"u"||"Deno"in globalThis;function Zn(){}function kte(e,t){return typeof e=="function"?e(t):e}function Cy(e){return typeof e=="number"&&e>=0&&e!==1/0}function i_(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Br(e,t){return typeof e=="function"?e(t):e}function Na(e,t){return typeof e=="function"?e(t):e}function $2(e,t){const{type:n="all",exact:a,fetchStatus:s,predicate:p,queryKey:f,stale:m}=e;if(f){if(a){if(t.queryHash!==h0(f,t.options))return!1}else if(!eu(t.queryKey,f))return!1}if(n!=="all"){const h=t.isActive();if(n==="active"&&!h||n==="inactive"&&h)return!1}return!(typeof m=="boolean"&&t.isStale()!==m||s&&s!==t.state.fetchStatus||p&&!p(t))}function Q2(e,t){const{exact:n,status:a,predicate:s,mutationKey:p}=e;if(p){if(!t.options.mutationKey)return!1;if(n){if(Hr(t.options.mutationKey)!==Hr(p))return!1}else if(!eu(t.options.mutationKey,p))return!1}return!(a&&t.state.status!==a||s&&!s(t))}function h0(e,t){return(t?.queryKeyHashFn||Hr)(e)}function Hr(e){return JSON.stringify(e,(t,n)=>Ay(n)?Object.keys(n).sort().reduce((a,s)=>(a[s]=n[s],a),{}):n)}function eu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>eu(e[n],t[n])):!1}var wte=Object.prototype.hasOwnProperty;function g0(e,t,n=0){if(e===t)return e;if(n>500)return t;const a=V2(e)&&V2(t);if(!a&&!(Ay(e)&&Ay(t)))return t;const p=(a?e:Object.keys(e)).length,f=a?t:Object.keys(t),m=f.length,h=a?new Array(m):{};let c=0;for(let x=0;x<m;x++){const M=a?x:f[x],C=e[M],E=t[M];if(C===E){h[M]=C,(a?x<p:wte.call(e,M))&&c++;continue}if(C===null||E===null||typeof C!="object"||typeof E!="object"){h[M]=E;continue}const R=g0(C,E,n+1);h[M]=R,R===C&&c++}return p===m&&c===p?e:h}function tu(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function V2(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ay(e){if(!G2(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!G2(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function G2(e){return Object.prototype.toString.call(e)==="[object Object]"}function Mte(e){return new Promise(t=>{Eo.setTimeout(t,e)})}function Ey(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?g0(e,t):t}function Cte(e,t,n=0){const a=[...e,t];return n&&a.length>n?a.slice(1):a}function Ate(e,t,n=0){const a=[t,...e];return n&&a.length>n?a.slice(0,-1):a}var Oa=Symbol();function r_(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Oa?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function v0(e,t){return typeof e=="function"?e(...t):!!e}function Ete(e,t,n){let a=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??=t(),a||(a=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),e}var nu=(()=>{let e=()=>xte;return{isServer(){return e()},setIsServer(t){e=t}}})();function Ry(){let e,t;const n=new Promise((s,p)=>{e=s,t=p});n.status="pending",n.catch(()=>{});function a(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{a({status:"fulfilled",value:s}),e(s)},n.reject=s=>{a({status:"rejected",reason:s}),t(s)},n}var Rte=Ste;function Ite(){let e=[],t=0,n=m=>{m()},a=m=>{m()},s=Rte;const p=m=>{t?e.push(m):s(()=>{n(m)})},f=()=>{const m=e;e=[],m.length&&s(()=>{a(()=>{m.forEach(h=>{n(h)})})})};return{batch:m=>{let h;t++;try{h=m()}finally{t--,t||f()}return h},batchCalls:m=>(...h)=>{p(()=>{m(...h)})},schedule:p,setNotifyFunction:m=>{n=m},setBatchNotifyFunction:m=>{a=m},setScheduler:m=>{s=m}}}var dn=Ite(),Tte=class extends Bo{#t=!0;#e;#n;constructor(){super(),this.#n=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#e||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#e?.(),this.#e=void 0)}setEventListener(e){this.#n=e,this.#e?.(),this.#e=e(this.setOnline.bind(this))}setOnline(e){this.#t!==e&&(this.#t=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#t}},im=new Tte;function _te(e){return Math.min(1e3*2**e,3e4)}function o_(e){return(e??"online")==="online"?im.isOnline():!0}var Iy=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function s_(e){let t=!1,n=0,a;const s=Ry(),p=()=>s.status!=="pending",f=_=>{if(!p()){const j=new Iy(_);C(j),e.onCancel?.(j)}},m=()=>{t=!0},h=()=>{t=!1},c=()=>f0.isFocused()&&(e.networkMode==="always"||im.isOnline())&&e.canRun(),x=()=>o_(e.networkMode)&&e.canRun(),M=_=>{p()||(a?.(),s.resolve(_))},C=_=>{p()||(a?.(),s.reject(_))},E=()=>new Promise(_=>{a=j=>{(p()||c())&&_(j)},e.onPause?.()}).then(()=>{a=void 0,p()||e.onContinue?.()}),R=()=>{if(p())return;let _;const j=n===0?e.initialPromise:void 0;try{_=j??e.fn()}catch(D){_=Promise.reject(D)}Promise.resolve(_).then(M).catch(D=>{if(p())return;const z=e.retry??(nu.isServer()?0:3),B=e.retryDelay??_te,L=typeof B=="function"?B(n,D):B,G=z===!0||typeof z=="number"&&n<z||typeof z=="function"&&z(n,D);if(t||!G){C(D);return}n++,e.onFail?.(n,D),Mte(L).then(()=>c()?void 0:E()).then(()=>{t?C(D):R()})})};return{promise:s,status:()=>s.status,cancel:f,continue:()=>(a?.(),s),cancelRetry:m,continueRetry:h,canStart:x,start:()=>(x()?R():E().then(R),s)}}var l_=class{#t;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Cy(this.gcTime)&&(this.#t=Eo.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(nu.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#t!==void 0&&(Eo.clearTimeout(this.#t),this.#t=void 0)}};function Nte(e){return{onFetch:(t,n)=>{const a=t.options,s=t.fetchOptions?.meta?.fetchMore?.direction,p=t.state.data?.pages||[],f=t.state.data?.pageParams||[];let m={pages:[],pageParams:[]},h=0;const c=async()=>{let x=!1;const M=R=>{Ete(R,()=>t.signal,()=>x=!0)},C=r_(t.options,t.fetchOptions),E=async(R,_,j)=>{if(x)return Promise.reject(t.signal.reason);if(_==null&&R.pages.length)return Promise.resolve(R);const z=(()=>{const ae={client:t.client,queryKey:t.queryKey,pageParam:_,direction:j?"backward":"forward",meta:t.options.meta};return M(ae),ae})(),B=await C(z),{maxPages:L}=t.options,G=j?Ate:Cte;return{pages:G(R.pages,B,L),pageParams:G(R.pageParams,_,L)}};if(s&&p.length){const R=s==="backward",_=R?c_:Ty,j={pages:p,pageParams:f},D=_(a,j);m=await E(j,D,R)}else{const R=e??p.length;do{const _=h===0?f[0]??a.initialPageParam:Ty(a,m);if(h>0&&_==null)break;m=await E(m,_),h++}while(h<R)}return m};t.options.persister?t.fetchFn=()=>t.options.persister?.(c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=c}}}function Ty(e,{pages:t,pageParams:n}){const a=t.length-1;return t.length>0?e.getNextPageParam(t[a],t,n[a],n):void 0}function c_(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function Ote(e,t){return t?Ty(e,t)!=null:!1}function jte(e,t){return!t||!e.getPreviousPageParam?!1:c_(e,t)!=null}var Pte=class extends l_{#t;#e;#n;#a;#i;#r;#s;#o;constructor(e){super(),this.#o=!1,this.#s=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#a=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=K2(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#t}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#s,...e},e?._type&&(this.#t=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=K2(this.options);t.data!==void 0&&(this.setState(Z2(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#a.remove(this)}setData(e,t){const n=Ey(this.state.data,e,this.options);return this.#l({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:"setState",state:e})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(Zn).catch(Zn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#e}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Na(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Oa||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Br(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!i_(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#a.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#o||this.#u()?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#a.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#u(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#l({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const h=this.observers.find(c=>c.options.queryFn);h&&this.setOptions(h.options)}const n=new AbortController,a=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},s=()=>{const h=r_(this.options,t),x=(()=>{const M={client:this.#i,queryKey:this.queryKey,meta:this.meta};return a(M),M})();return this.#o=!1,this.options.persister?this.options.persister(h,x,this):h(x)},f=(()=>{const h={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:s};return a(h),h})();(this.#t==="infinite"?Nte(this.options.pages):this.options.behavior)?.onFetch(f,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==f.fetchOptions?.meta)&&this.#l({type:"fetch",meta:f.fetchOptions?.meta}),this.#r=s_({initialPromise:t?.initialPromise,fn:f.fetchFn,onCancel:h=>{h instanceof Iy&&h.revert&&this.setState({...this.#n,fetchStatus:"idle"}),n.abort()},onFail:(h,c)=>{this.#l({type:"failed",failureCount:h,error:c})},onPause:()=>{this.#l({type:"pause"})},onContinue:()=>{this.#l({type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.options.networkMode,canRun:()=>!0});try{const h=await this.#r.start();if(h===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(h),this.#a.config.onSuccess?.(h,this),this.#a.config.onSettled?.(h,this.state.error,this),h}catch(h){if(h instanceof Iy){if(h.silent)return this.#r.promise;if(h.revert){if(this.state.data===void 0)throw h;return this.state.data}}throw this.#l({type:"error",error:h}),this.#a.config.onError?.(h,this),this.#a.config.onSettled?.(this.state.data,h,this),h}finally{this.scheduleGc()}}#l(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...u_(n.data,this.options),fetchMeta:e.meta??null};case"success":const a={...n,...Z2(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?a:void 0,a;case"error":const s=e.error;return{...n,error:s,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),dn.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#a.notify({query:this,type:"updated",action:e})})}};function u_(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:o_(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Z2(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function K2(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,a=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?a??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var bu=class extends Bo{constructor(e,t){super(),this.options=t,this.#t=e,this.#o=null,this.#s=Ry(),this.bindMethods(),this.setOptions(t)}#t;#e=void 0;#n=void 0;#a=void 0;#i;#r;#s;#o;#u;#l;#m;#d;#f;#c;#h=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#e.addObserver(this),W2(this.#e,this.options)?this.#p():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return _y(this.#e,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return _y(this.#e,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#S(),this.#x(),this.#e.removeObserver(this)}setOptions(e){const t=this.options,n=this.#e;if(this.options=this.#t.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Na(this.options.enabled,this.#e)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#k(),this.#e.setOptions(this.options),t._defaulted&&!tu(this.options,t)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#e,observer:this});const a=this.hasListeners();a&&Y2(this.#e,n,this.options,t)&&this.#p(),this.updateResult(),a&&(this.#e!==n||Na(this.options.enabled,this.#e)!==Na(t.enabled,this.#e)||Br(this.options.staleTime,this.#e)!==Br(t.staleTime,this.#e))&&this.#g();const s=this.#v();a&&(this.#e!==n||Na(this.options.enabled,this.#e)!==Na(t.enabled,this.#e)||s!==this.#c)&&this.#y(s)}getOptimisticResult(e){const t=this.#t.getQueryCache().build(this.#t,e),n=this.createResult(t,e);return zte(this,n)&&(this.#a=n,this.#r=this.options,this.#i=this.#e.state),n}getCurrentResult(){return this.#a}trackResult(e,t){return new Proxy(e,{get:(n,a)=>(this.trackProp(a),t?.(a),a==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#s.status==="pending"&&this.#s.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,a))})}trackProp(e){this.#h.add(e)}getCurrentQuery(){return this.#e}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#t.defaultQueryOptions(e),n=this.#t.getQueryCache().build(this.#t,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#p({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#a))}#p(e){this.#k();let t=this.#e.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Zn)),t}#g(){this.#S();const e=Br(this.options.staleTime,this.#e);if(nu.isServer()||this.#a.isStale||!Cy(e))return;const n=i_(this.#a.dataUpdatedAt,e)+1;this.#d=Eo.setTimeout(()=>{this.#a.isStale||this.updateResult()},n)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#e):this.options.refetchInterval)??!1}#y(e){this.#x(),this.#c=e,!(nu.isServer()||Na(this.options.enabled,this.#e)===!1||!Cy(this.#c)||this.#c===0)&&(this.#f=Eo.setInterval(()=>{(this.options.refetchIntervalInBackground||f0.isFocused())&&this.#p()},this.#c))}#b(){this.#g(),this.#y(this.#v())}#S(){this.#d!==void 0&&(Eo.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(Eo.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){const n=this.#e,a=this.options,s=this.#a,p=this.#i,f=this.#r,h=e!==n?e.state:this.#n,{state:c}=e;let x={...c},M=!1,C;if(t._optimisticResults){const F=this.hasListeners(),fe=!F&&W2(e,t),ke=F&&Y2(e,n,t,a);(fe||ke)&&(x={...x,...u_(c.data,e.options)}),t._optimisticResults==="isRestoring"&&(x.fetchStatus="idle")}let{error:E,errorUpdatedAt:R,status:_}=x;C=x.data;let j=!1;if(t.placeholderData!==void 0&&C===void 0&&_==="pending"){let F;s?.isPlaceholderData&&t.placeholderData===f?.placeholderData?(F=s.data,j=!0):F=typeof t.placeholderData=="function"?t.placeholderData(this.#m?.state.data,this.#m):t.placeholderData,F!==void 0&&(_="success",C=Ey(s?.data,F,t),M=!0)}if(t.select&&C!==void 0&&!j)if(s&&C===p?.data&&t.select===this.#u)C=this.#l;else try{this.#u=t.select,C=t.select(C),C=Ey(s?.data,C,t),this.#l=C,this.#o=null}catch(F){this.#o=F}this.#o&&(E=this.#o,C=this.#l,R=Date.now(),_="error");const D=x.fetchStatus==="fetching",z=_==="pending",B=_==="error",L=z&&D,G=C!==void 0,V={status:_,fetchStatus:x.fetchStatus,isPending:z,isSuccess:_==="success",isError:B,isInitialLoading:L,isLoading:L,data:C,dataUpdatedAt:x.dataUpdatedAt,error:E,errorUpdatedAt:R,failureCount:x.fetchFailureCount,failureReason:x.fetchFailureReason,errorUpdateCount:x.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:x.dataUpdateCount>h.dataUpdateCount||x.errorUpdateCount>h.errorUpdateCount,isFetching:D,isRefetching:D&&!z,isLoadingError:B&&!G,isPaused:x.fetchStatus==="paused",isPlaceholderData:M,isRefetchError:B&&G,isStale:y0(e,t),refetch:this.refetch,promise:this.#s,isEnabled:Na(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const F=V.data!==void 0,fe=V.status==="error"&&!F,ke=Ee=>{fe?Ee.reject(V.error):F&&Ee.resolve(V.data)},Me=()=>{const Ee=this.#s=V.promise=Ry();ke(Ee)},Ae=this.#s;switch(Ae.status){case"pending":e.queryHash===n.queryHash&&ke(Ae);break;case"fulfilled":(fe||V.data!==Ae.value)&&Me();break;case"rejected":(!fe||V.error!==Ae.reason)&&Me();break}}return V}updateResult(){const e=this.#a,t=this.createResult(this.#e,this.options);if(this.#i=this.#e.state,this.#r=this.options,this.#i.data!==void 0&&(this.#m=this.#e),tu(t,e))return;this.#a=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:a}=this.options,s=typeof a=="function"?a():a;if(s==="all"||!s&&!this.#h.size)return!0;const p=new Set(s??this.#h);return this.options.throwOnError&&p.add("error"),Object.keys(this.#a).some(f=>{const m=f;return this.#a[m]!==e[m]&&p.has(m)})};this.#w({listeners:n()})}#k(){const e=this.#t.getQueryCache().build(this.#t,this.options);if(e===this.#e)return;const t=this.#e;this.#e=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#w(e){dn.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#a)}),this.#t.getQueryCache().notify({query:this.#e,type:"observerResultsUpdated"})})}};function Dte(e,t){return Na(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Na(t.retryOnMount,e)===!1)}function W2(e,t){return Dte(e,t)||e.state.data!==void 0&&_y(e,t,t.refetchOnMount)}function _y(e,t,n){if(Na(t.enabled,e)!==!1&&Br(t.staleTime,e)!=="static"){const a=typeof n=="function"?n(e):n;return a==="always"||a!==!1&&y0(e,t)}return!1}function Y2(e,t,n,a){return(e!==t||Na(a.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&y0(e,n)}function y0(e,t){return Na(t.enabled,e)!==!1&&e.isStaleByTime(Br(t.staleTime,e))}function zte(e,t){return!tu(e.getCurrentResult(),t)}var d_=class extends bu{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){const{state:n}=e,a=super.createResult(e,t),{isFetching:s,isRefetching:p,isError:f,isRefetchError:m}=a,h=n.fetchMeta?.fetchMore?.direction,c=f&&h==="forward",x=s&&h==="forward",M=f&&h==="backward",C=s&&h==="backward";return{...a,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:Ote(t,n.data),hasPreviousPage:jte(t,n.data),isFetchNextPageError:c,isFetchingNextPage:x,isFetchPreviousPageError:M,isFetchingPreviousPage:C,isRefetchError:m&&!c&&!M,isRefetching:p&&!x&&!C}}},Lte=class extends l_{#t;#e;#n;#a;constructor(e){super(),this.#t=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#e=[],this.state=e.state||p_(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#e.includes(e)||(this.#e.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#e=this.#e.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#e.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#a?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#i({type:"continue"})},n={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#a=s_({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(p,f)=>{this.#i({type:"failed",failureCount:p,error:f})},onPause:()=>{this.#i({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const a=this.state.status==="pending",s=!this.#a.canStart();try{if(a)t();else{this.#i({type:"pending",variables:e,isPaused:s}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);const f=await this.options.onMutate?.(e,n);f!==this.state.context&&this.#i({type:"pending",context:f,variables:e,isPaused:s})}const p=await this.#a.start();return await this.#n.config.onSuccess?.(p,e,this.state.context,this,n),await this.options.onSuccess?.(p,e,this.state.context,n),await this.#n.config.onSettled?.(p,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(p,null,e,this.state.context,n),this.#i({type:"success",data:p}),p}catch(p){try{await this.#n.config.onError?.(p,e,this.state.context,this,n)}catch(f){Promise.reject(f)}try{await this.options.onError?.(p,e,this.state.context,n)}catch(f){Promise.reject(f)}try{await this.#n.config.onSettled?.(void 0,p,this.state.variables,this.state.context,this,n)}catch(f){Promise.reject(f)}try{await this.options.onSettled?.(void 0,p,e,this.state.context,n)}catch(f){Promise.reject(f)}throw this.#i({type:"error",error:p}),p}finally{this.#n.runNext(this)}}#i(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),dn.batch(()=>{this.#e.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function p_(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var qte=class extends Bo{constructor(e={}){super(),this.config=e,this.#t=new Set,this.#e=new Map,this.#n=0}#t;#e;#n;build(e,t,n){const a=new Lte({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(a),a}add(e){this.#t.add(e);const t=Jd(e);if(typeof t=="string"){const n=this.#e.get(t);n?n.push(e):this.#e.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#t.delete(e)){const t=Jd(e);if(typeof t=="string"){const n=this.#e.get(t);if(n)if(n.length>1){const a=n.indexOf(e);a!==-1&&n.splice(a,1)}else n[0]===e&&this.#e.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Jd(e);if(typeof t=="string"){const a=this.#e.get(t)?.find(s=>s.state.status==="pending");return!a||a===e}else return!0}runNext(e){const t=Jd(e);return typeof t=="string"?this.#e.get(t)?.find(a=>a!==e&&a.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){dn.batch(()=>{this.#t.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#t.clear(),this.#e.clear()})}getAll(){return Array.from(this.#t)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>Q2(t,n))}findAll(e={}){return this.getAll().filter(t=>Q2(e,t))}notify(e){dn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return dn.batch(()=>Promise.all(e.map(t=>t.continue().catch(Zn))))}};function Jd(e){return e.options.scope?.id}var Bte=class extends Bo{#t;#e=void 0;#n;#a;constructor(t,n){super(),this.#t=t,this.setOptions(n),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#t.defaultMutationOptions(t),tu(this.options,n)||this.#t.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#n,observer:this}),n?.mutationKey&&this.options.mutationKey&&Hr(n.mutationKey)!==Hr(this.options.mutationKey)?this.reset():this.#n?.state.status==="pending"&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(t){this.#i(),this.#r(t)}getCurrentResult(){return this.#e}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#r()}mutate(t,n){return this.#a=n,this.#n?.removeObserver(this),this.#n=this.#t.getMutationCache().build(this.#t,this.options),this.#n.addObserver(this),this.#n.execute(t)}#i(){const t=this.#n?.state??p_();this.#e={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#r(t){dn.batch(()=>{if(this.#a&&this.hasListeners()){const n=this.#e.variables,a=this.#e.context,s={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#a.onSuccess?.(t.data,n,a,s)}catch(p){Promise.reject(p)}try{this.#a.onSettled?.(t.data,null,n,a,s)}catch(p){Promise.reject(p)}}else if(t?.type==="error"){try{this.#a.onError?.(t.error,n,a,s)}catch(p){Promise.reject(p)}try{this.#a.onSettled?.(void 0,t.error,n,a,s)}catch(p){Promise.reject(p)}}}this.listeners.forEach(n=>{n(this.#e)})})}};function X2(e,t){const n=new Set(t);return e.filter(a=>!n.has(a))}function Fte(e,t,n){const a=e.slice(0);return a[t]=n,a}var Ute=class extends Bo{#t;#e;#n;#a;#i;#r;#s;#o;#u;#l=[];constructor(e,t,n){super(),this.#t=e,this.#a=n,this.#n=[],this.#i=[],this.#e=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#h(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#a=t,dn.batch(()=>{const n=this.#i,a=this.#c(this.#n);a.forEach(x=>x.observer.setOptions(x.defaultedQueryOptions));const s=a.map(x=>x.observer),p=s.map(x=>x.getCurrentResult()),f=n.length!==s.length,m=s.some((x,M)=>x!==n[M]),h=f||m,c=h?!0:p.some((x,M)=>{const C=this.#e[M];return!C||!tu(x,C)});!h&&!c||(h&&(this.#l=a,this.#i=s),this.#e=p,this.hasListeners()&&(h&&(X2(n,s).forEach(x=>{x.destroy()}),X2(s,n).forEach(x=>{x.subscribe(M=>{this.#h(x,M)})})),this.#p()))})}getCurrentResult(){return this.#e}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){const n=this.#c(e),a=n.map(p=>p.observer.getOptimisticResult(p.defaultedQueryOptions)),s=n.map(p=>p.defaultedQueryOptions.queryHash);return[a,p=>this.#d(p??a,t,s),()=>this.#m(a,n)]}#m(e,t){return t.map((n,a)=>{const s=e[a];return n.defaultedQueryOptions.notifyOnChangeProps?s:n.observer.trackResult(s,p=>{t.forEach(f=>{f.observer.trackProp(p)})})})}#d(e,t,n){if(t){const a=this.#u,s=n!==void 0&&a!==void 0&&(a.length!==n.length||n.some((p,f)=>p!==a[f]));return(!this.#r||this.#e!==this.#o||s||t!==this.#s)&&(this.#s=t,this.#o=this.#e,n!==void 0&&(this.#u=n),this.#r=g0(this.#r,t(e))),this.#r}return e}#f(){return this.#a?.combine!==void 0&&this.#i.some((e,t)=>e.options.suspense&&this.#e[t]?.data===void 0)}#c(e){const t=new Map;this.#i.forEach(a=>{const s=a.options.queryHash;if(!s)return;const p=t.get(s);p?p.push(a):t.set(s,[a])});const n=[];return e.forEach(a=>{const s=this.#t.defaultQueryOptions(a),f=t.get(s.queryHash)?.shift()??new bu(this.#t,s);n.push({defaultedQueryOptions:s,observer:f})}),n}#h(e,t){const n=this.#i.indexOf(e);n!==-1&&(this.#e=Fte(this.#e,n,t),this.#p())}#p(){if(this.hasListeners()){const e=this.#m(this.#e,this.#l),t=this.#f(),n=this.#r,a=t?n:this.#d(e,this.#a?.combine);(t||n!==a)&&dn.batch(()=>{this.listeners.forEach(s=>{s(this.#e)})})}}},Hte=class extends Bo{constructor(e={}){super(),this.config=e,this.#t=new Map}#t;build(e,t,n){const a=t.queryKey,s=t.queryHash??h0(a,t);let p=this.get(s);return p||(p=new Pte({client:e,queryKey:a,queryHash:s,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(a)}),this.add(p)),p}add(e){this.#t.has(e.queryHash)||(this.#t.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#t.get(e.queryHash);t&&(e.destroy(),t===e&&this.#t.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){dn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#t.get(e)}getAll(){return[...this.#t.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>$2(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>$2(e,n)):t}notify(e){dn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){dn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){dn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},m_=class{#t;#e;#n;#a;#i;#r;#s;#o;constructor(e={}){this.#t=e.queryCache||new Hte,this.#e=e.mutationCache||new qte,this.#n=e.defaultOptions||{},this.#a=new Map,this.#i=new Map,this.#r=0}mount(){this.#r++,this.#r===1&&(this.#s=f0.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onFocus())}),this.#o=im.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#t.onOnline())}))}unmount(){this.#r--,this.#r===0&&(this.#s?.(),this.#s=void 0,this.#o?.(),this.#o=void 0)}isFetching(e){return this.#t.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#e.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#t.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#t.build(this,t),a=n.state.data;return a===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Br(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(a))}getQueriesData(e){return this.#t.findAll(e).map(({queryKey:t,state:n})=>{const a=n.data;return[t,a]})}setQueryData(e,t,n){const a=this.defaultQueryOptions({queryKey:e}),p=this.#t.get(a.queryHash)?.state.data,f=kte(t,p);if(f!==void 0)return this.#t.build(this,a).setData(f,{...n,manual:!0})}setQueriesData(e,t,n){return dn.batch(()=>this.#t.findAll(e).map(({queryKey:a})=>[a,this.setQueryData(a,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#t.get(t.queryHash)?.state}removeQueries(e){const t=this.#t;dn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#t;return dn.batch(()=>(n.findAll(e).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},a=dn.batch(()=>this.#t.findAll(e).map(s=>s.cancel(n)));return Promise.all(a).then(Zn).catch(Zn)}invalidateQueries(e,t={}){return dn.batch(()=>(this.#t.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},a=dn.batch(()=>this.#t.findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let p=s.fetch(void 0,n);return n.throwOnError||(p=p.catch(Zn)),s.state.fetchStatus==="paused"?Promise.resolve():p}));return Promise.all(a).then(Zn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#t.build(this,t);return n.isStaleByTime(Br(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Zn).catch(Zn)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Zn).catch(Zn)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return im.isOnline()?this.#e.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#t}getMutationCache(){return this.#e}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#a.set(Hr(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#a.values()],n={};return t.forEach(a=>{eu(e,a.queryKey)&&Object.assign(n,a.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(Hr(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#i.values()],n={};return t.forEach(a=>{eu(e,a.mutationKey)&&Object.assign(n,a.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=h0(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Oa&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#t.clear(),this.#e.clear()}},f_=T.createContext(void 0),Su=e=>{const t=T.useContext(f_);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},h_=({client:e,children:t})=>(T.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),v.jsx(f_.Provider,{value:e,children:t})),g_=T.createContext(!1),v_=()=>T.useContext(g_);g_.Provider;function $te(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Qte=T.createContext($te()),y_=()=>T.useContext(Qte),b_=(e,t,n)=>{const a=n?.state.error&&typeof e.throwOnError=="function"?v0(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||a)&&(t.isReset()||(e.retryOnMount=!1))},S_=e=>{T.useEffect(()=>{e.clearReset()},[e])},x_=({result:e,errorResetBoundary:t,throwOnError:n,query:a,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&a&&(s&&e.data===void 0||v0(n,[e.error,a])),b0=(e,t)=>t.state.data===void 0,k_=e=>{if(e.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),a=e.staleTime;e.staleTime=typeof a=="function"?(...s)=>n(a(...s)):n(a),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Vte=(e,t)=>e.isLoading&&e.isFetching&&!t,Ny=(e,t)=>e?.suspense&&t.isPending,Oy=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function w_({queries:e,...t},n){const a=Su(n),s=v_(),p=y_(),f=T.useMemo(()=>e.map(_=>{const j=a.defaultQueryOptions(_);return j._optimisticResults=s?"isRestoring":"optimistic",j}),[e,a,s]);f.forEach(_=>{k_(_);const j=a.getQueryCache().get(_.queryHash);b_(_,p,j)}),S_(p);const[m]=T.useState(()=>new Ute(a,f,t)),[h,c,x]=m.getOptimisticResult(f,t.combine),M=!s&&t.subscribed!==!1;T.useSyncExternalStore(T.useCallback(_=>M?m.subscribe(dn.batchCalls(_)):Zn,[m,M]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),T.useEffect(()=>{m.setQueries(f,t)},[f,t,m]);const E=h.some((_,j)=>Ny(f[j],_))?h.flatMap((_,j)=>{const D=f[j];if(D&&Ny(D,_)){const z=new bu(a,D);return Oy(D,z,p)}return[]}):[];if(E.length>0)throw Promise.all(E);const R=h.find((_,j)=>{const D=f[j];return D&&x_({result:_,errorResetBoundary:p,throwOnError:D.throwOnError,query:a.getQueryCache().get(D.queryHash),suspense:D.suspense})});if(R?.error)throw R.error;return c(x())}function Pm(e,t,n){const a=v_(),s=y_(),p=Su(n),f=p.defaultQueryOptions(e);p.getDefaultOptions().queries?._experimental_beforeQuery?.(f);const m=p.getQueryCache().get(f.queryHash),h=e.subscribed!==!1;f._optimisticResults=a?"isRestoring":h?"optimistic":void 0,k_(f),b_(f,s,m),S_(s);const c=!p.getQueryCache().get(f.queryHash),[x]=T.useState(()=>new t(p,f)),M=x.getOptimisticResult(f),C=!a&&h;if(T.useSyncExternalStore(T.useCallback(E=>{const R=C?x.subscribe(dn.batchCalls(E)):Zn;return x.updateResult(),R},[x,C]),()=>x.getCurrentResult(),()=>x.getCurrentResult()),T.useEffect(()=>{x.setOptions(f)},[f,x]),Ny(f,M))throw Oy(f,x,s);if(x_({result:M,errorResetBoundary:s,throwOnError:f.throwOnError,query:m,suspense:f.suspense}))throw M.error;return p.getDefaultOptions().queries?._experimental_afterQuery?.(f,M),f.experimental_prefetchInRender&&!nu.isServer()&&Vte(M,a)&&(c?Oy(f,x,s):m?.promise)?.catch(Zn).finally(()=>{x.updateResult()}),f.notifyOnChangeProps?M:x.trackResult(M)}function Gte(e,t){return Pm(e,bu,t)}function Zte(e,t){return Pm({...e,enabled:!0,suspense:!0,throwOnError:b0,placeholderData:void 0},bu,t)}function Kte(e,t){return Pm({...e,enabled:!0,suspense:!0,throwOnError:b0},d_,t)}function Wte(e,t){return w_({...e,queries:e.queries.map(n=>({...n,suspense:!0,throwOnError:b0,enabled:!0,placeholderData:void 0}))},t)}function Yte(e,t){const n=Su(t);n.getQueryState(e.queryKey)||n.prefetchQuery(e)}function Xte(e,t){const n=Su(t);n.getQueryState(e.queryKey)||n.prefetchInfiniteQuery(e)}function Jte(e,t){const n=Su(t),[a]=T.useState(()=>new Bte(n,e));T.useEffect(()=>{a.setOptions(e)},[a,e]);const s=T.useSyncExternalStore(T.useCallback(f=>a.subscribe(dn.batchCalls(f)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),p=T.useCallback((f,m)=>{a.mutate(f,m).catch(Zn)},[a]);if(s.error&&v0(a.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:p,mutateAsync:s.mutate}}function ene(e,t){return Pm(e,d_,t)}var tne=Object.create,M_=Object.defineProperty,nne=Object.getOwnPropertyDescriptor,C_=Object.getOwnPropertyNames,ane=Object.getPrototypeOf,ine=Object.prototype.hasOwnProperty,Gr=(e,t)=>function(){return t||(0,e[C_(e)[0]])((t={exports:{}}).exports,t),t.exports},rne=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(var s=C_(t),p=0,f=s.length,m;p<f;p++)m=s[p],!ine.call(e,m)&&m!==n&&M_(e,m,{get:(h=>t[h]).bind(null,m),enumerable:!(a=nne(t,m))||a.enumerable});return e},Fo=(e,t,n)=>(n=e!=null?tne(ane(e)):{},rne(t||!e||!e.__esModule?M_(n,"default",{value:e,enumerable:!0}):n,e)),one=Gr({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectWithoutPropertiesLoose.js"(e,t){function n(a,s){if(a==null)return{};var p={};for(var f in a)if({}.hasOwnProperty.call(a,f)){if(s.includes(f))continue;p[f]=a[f]}return p}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),sne=Gr({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectWithoutProperties.js"(e,t){var n=one();function a(s,p){if(s==null)return{};var f,m,h=n(s,p);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(s);for(m=0;m<c.length;m++)f=c[m],p.includes(f)||{}.propertyIsEnumerable.call(s,f)&&(h[f]=s[f])}return h}t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports}}),A_=Gr({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(e,t){function n(a){"@babel/helpers - typeof";return t.exports=n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s},t.exports.__esModule=!0,t.exports.default=t.exports,n(a)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),lne=Gr({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(e,t){var n=A_().default;function a(s,p){if(n(s)!="object"||!s)return s;var f=s[Symbol.toPrimitive];if(f!==void 0){var m=f.call(s,p||"default");if(n(m)!="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return(p==="string"?String:Number)(s)}t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports}}),cne=Gr({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(e,t){var n=A_().default,a=lne();function s(p){var f=a(p,"string");return n(f)=="symbol"?f:f+""}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}}),une=Gr({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(e,t){var n=cne();function a(s,p,f){return(p=n(p))in s?Object.defineProperty(s,p,{value:f,enumerable:!0,configurable:!0,writable:!0}):s[p]=f,s}t.exports=a,t.exports.__esModule=!0,t.exports.default=t.exports}}),xu=Gr({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(e,t){var n=une();function a(p,f){var m=Object.keys(p);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(p);f&&(h=h.filter(function(c){return Object.getOwnPropertyDescriptor(p,c).enumerable})),m.push.apply(m,h)}return m}function s(p){for(var f=1;f<arguments.length;f++){var m=arguments[f]!=null?arguments[f]:{};f%2?a(Object(m),!0).forEach(function(h){n(p,h,m[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(m)):a(Object(m)).forEach(function(h){Object.defineProperty(p,h,Object.getOwnPropertyDescriptor(m,h))})}return p}t.exports=s,t.exports.__esModule=!0,t.exports.default=t.exports}}),dne=Fo(sne(),1),J2=Fo(xu(),1);const pne=["cursor","direction"];function xi(e,t,n){const a=e.flatMap(s=>s.split("."));if(!t&&(!n||n==="any"))return a.length?[a]:[];if(n==="infinite"&&Do(t)&&("direction"in t||"cursor"in t)){const{cursor:s,direction:p}=t,f=(0,dne.default)(t,pne);return[a,{input:f,type:"infinite"}]}return[a,(0,J2.default)((0,J2.default)({},typeof t<"u"&&t!==Oa&&{input:t}),n&&n!=="any"&&{type:n})]}function Ep(e){return xi(e,void 0,"any")}function mne(e){return km(({path:t,args:n})=>{var a;const s=[...t],p=s.pop();if(p==="useMutation")return e[p](s,...n);if(p==="_def")return{path:s};const[f,...m]=n,h=(a=m[0])!==null&&a!==void 0?a:{};return e[p](s,f,h)})}var Ug;const fne=["client","ssrContext","ssrState","abortOnUnmount"],hne=(Ug=T.createContext)===null||Ug===void 0?void 0:Ug.call(gte,null),gne=e=>{switch(e){case"queryOptions":case"fetch":case"ensureData":case"prefetch":case"getData":case"setData":case"setQueriesData":return"query";case"infiniteQueryOptions":case"fetchInfinite":case"prefetchInfinite":case"getInfiniteData":case"setInfiniteData":return"infinite";case"setMutationDefaults":case"getMutationDefaults":case"isMutating":case"cancel":case"invalidate":case"refetch":case"reset":return"any"}};function vne(e){return km(t=>{const n=[...t.path],a=n.pop(),s=[...t.args],p=s.shift(),f=gne(a),m=xi(n,p,f);return{infiniteQueryOptions:()=>e.infiniteQueryOptions(n,m,s[0]),queryOptions:()=>e.queryOptions(n,m,...s),fetch:()=>e.fetchQuery(m,...s),fetchInfinite:()=>e.fetchInfiniteQuery(m,s[0]),prefetch:()=>e.prefetchQuery(m,...s),prefetchInfinite:()=>e.prefetchInfiniteQuery(m,s[0]),ensureData:()=>e.ensureQueryData(m,...s),invalidate:()=>e.invalidateQueries(m,...s),reset:()=>e.resetQueries(m,...s),refetch:()=>e.refetchQueries(m,...s),cancel:()=>e.cancelQuery(m,...s),setData:()=>{e.setQueryData(m,s[0],s[1])},setQueriesData:()=>e.setQueriesData(m,s[0],s[1],s[2]),setInfiniteData:()=>{e.setInfiniteQueryData(m,s[0],s[1])},getData:()=>e.getQueryData(m),getInfiniteData:()=>e.getInfiniteQueryData(m),setMutationDefaults:()=>e.setMutationDefaults(Ep(n),p),getMutationDefaults:()=>e.getMutationDefaults(Ep(n)),isMutating:()=>e.isMutating({mutationKey:Ep(n)})}[a]()})}function yne(e){const t=IE(e.client),n=vne(e);return vb(a=>{const s=a;return s==="client"?t:fne.includes(s)?e[s]:n[a]})}var bne=Fo(xu(),1);function eC(e){const t=e instanceof wm?e:bb(e);return km(n=>{const a=n.path,s=a.join("."),[p,f]=n.args;return(0,bne.default)({queryKey:xi(a,p,"query"),queryFn:()=>t.query(s,p,f?.trpc)},f)})}var Hg=Fo(xu(),1);function na(e,t,n){var a;const s=e[0];let p=(a=e[1])===null||a===void 0?void 0:a.input;if(n){var f;p=(0,Hg.default)((0,Hg.default)((0,Hg.default)({},(f=p)!==null&&f!==void 0?f:{}),n.pageParam?{cursor:n.pageParam}:{}),{},{direction:n.direction})}return[s.join("."),p,t?.trpc]}var Sne=Gr({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(e,t){function n(s){var p,f,m,h=2;for(typeof Symbol<"u"&&(f=Symbol.asyncIterator,m=Symbol.iterator);h--;){if(f&&(p=s[f])!=null)return p.call(s);if(m&&(p=s[m])!=null)return new a(p.call(s));f="@@asyncIterator",m="@@iterator"}throw new TypeError("Object is not async iterable")}function a(s){function p(f){if(Object(f)!==f)return Promise.reject(new TypeError(f+" is not an object."));var m=f.done;return Promise.resolve(f.value).then(function(h){return{value:h,done:m}})}return a=function(m){this.s=m,this.n=m.next},a.prototype={s:null,n:null,next:function(){return p(this.n.apply(this.s,arguments))},return:function(m){var h=this.s.return;return h===void 0?Promise.resolve({value:m,done:!0}):p(h.apply(this.s,arguments))},throw:function(m){var h=this.s.return;return h===void 0?Promise.reject(m):p(h.apply(this.s,arguments))}},new a(s)}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}}),xne=Fo(Sne(),1);function jy(e){return{path:e.path.join(".")}}function xc(e){const t=jy(e);return T.useMemo(()=>t,[t])}async function E_(e,t,n){const s=t.getQueryCache().build(t,{queryKey:n});s.setState({data:[],status:"success"});const p=[];var f=!1,m=!1,h;try{for(var c=(0,xne.default)(e),x;f=!(x=await c.next()).done;f=!1){const M=x.value;p.push(M),s.setState({data:[...p]})}}catch(M){m=!0,h=M}finally{try{f&&c.return!=null&&await c.return()}finally{if(m)throw h}}return p}var Rt=Fo(xu(),1);function kne(e){const{client:t,queryClient:n}=e,a=t instanceof wm?t:bb(t);return{infiniteQueryOptions:(s,p,f)=>{var m,h;const c=((m=p[1])===null||m===void 0?void 0:m.input)===Oa,x=async M=>{var C;const E=(0,Rt.default)((0,Rt.default)({},f),{},{trpc:(0,Rt.default)((0,Rt.default)({},f?.trpc),!(f==null||(C=f.trpc)===null||C===void 0)&&C.abortOnUnmount?{signal:M.signal}:{signal:null})});return await a.query(...na(p,E,{direction:M.direction,pageParam:M.pageParam}))};return Object.assign((0,Rt.default)((0,Rt.default)({},f),{},{initialData:f?.initialData,queryKey:p,queryFn:c?Oa:x,initialPageParam:(h=f?.initialCursor)!==null&&h!==void 0?h:null}),{trpc:jy({path:s})})},queryOptions:(s,p,f)=>{var m;const h=((m=p[1])===null||m===void 0?void 0:m.input)===Oa,c=async x=>{var M;const C=(0,Rt.default)((0,Rt.default)({},f),{},{trpc:(0,Rt.default)((0,Rt.default)({},f?.trpc),!(f==null||(M=f.trpc)===null||M===void 0)&&M.abortOnUnmount?{signal:x.signal}:{signal:null})}),E=await a.query(...na(p,C));return fE(E)?E_(E,n,p):E};return Object.assign((0,Rt.default)((0,Rt.default)({},f),{},{initialData:f?.initialData,queryKey:p,queryFn:h?Oa:c}),{trpc:jy({path:s})})},fetchQuery:(s,p)=>n.fetchQuery((0,Rt.default)((0,Rt.default)({},p),{},{queryKey:s,queryFn:()=>a.query(...na(s,p))})),fetchInfiniteQuery:(s,p)=>{var f;return n.fetchInfiniteQuery((0,Rt.default)((0,Rt.default)({},p),{},{queryKey:s,queryFn:({pageParam:m,direction:h})=>a.query(...na(s,p,{pageParam:m,direction:h})),initialPageParam:(f=p?.initialCursor)!==null&&f!==void 0?f:null}))},prefetchQuery:(s,p)=>n.prefetchQuery((0,Rt.default)((0,Rt.default)({},p),{},{queryKey:s,queryFn:()=>a.query(...na(s,p))})),prefetchInfiniteQuery:(s,p)=>{var f;return n.prefetchInfiniteQuery((0,Rt.default)((0,Rt.default)({},p),{},{queryKey:s,queryFn:({pageParam:m,direction:h})=>a.query(...na(s,p,{pageParam:m,direction:h})),initialPageParam:(f=p?.initialCursor)!==null&&f!==void 0?f:null}))},ensureQueryData:(s,p)=>n.ensureQueryData((0,Rt.default)((0,Rt.default)({},p),{},{queryKey:s,queryFn:()=>a.query(...na(s,p))})),invalidateQueries:(s,p,f)=>n.invalidateQueries((0,Rt.default)((0,Rt.default)({},p),{},{queryKey:s}),f),resetQueries:(s,p,f)=>n.resetQueries((0,Rt.default)((0,Rt.default)({},p),{},{queryKey:s}),f),refetchQueries:(s,p,f)=>n.refetchQueries((0,Rt.default)((0,Rt.default)({},p),{},{queryKey:s}),f),cancelQuery:(s,p)=>n.cancelQueries({queryKey:s},p),setQueryData:(s,p,f)=>n.setQueryData(s,p,f),setQueriesData:(s,p,f,m)=>n.setQueriesData((0,Rt.default)((0,Rt.default)({},p),{},{queryKey:s}),f,m),getQueryData:s=>n.getQueryData(s),setInfiniteQueryData:(s,p,f)=>n.setQueryData(s,p,f),getInfiniteQueryData:s=>n.getQueryData(s),setMutationDefaults:(s,p)=>{const f=s[0],m=h=>a.mutation(...na([f,{input:h}],e));return n.setMutationDefaults(s,typeof p=="function"?p({canonicalMutationFn:m}):p)},getMutationDefaults:s=>n.getMutationDefaults(s),isMutating:s=>n.isMutating((0,Rt.default)((0,Rt.default)({},s),{},{exact:!0}))}}var Ne=Fo(xu());const tC=(e,t)=>new Proxy(e,{get(a,s){return t(s),a[s]}});function wne(e){var t,n;const a=(t=void 0)!==null&&t!==void 0?t:G=>G.originalFn(),s=(n=void 0)!==null&&n!==void 0?n:hne,p=Dv,f=G=>{var ae;const{abortOnUnmount:V=!1,queryClient:F,ssrContext:fe}=G,[ke,Me]=T.useState((ae=G.ssrState)!==null&&ae!==void 0?ae:!1),Ae=G.client instanceof wm?G.client:bb(G.client),Ee=T.useMemo(()=>kne({client:Ae,queryClient:F}),[Ae,F]),we=T.useMemo(()=>(0,Ne.default)({abortOnUnmount:V,queryClient:F,client:Ae,ssrContext:fe??null,ssrState:ke},Ee),[V,Ae,Ee,F,fe,ke]);return T.useEffect(()=>{Me(ge=>ge?"mounted":!1)},[]),v.jsx(s.Provider,{value:we,children:G.children})};function m(){const G=T.useContext(s);if(!G)throw new Error("Unable to find tRPC Context. Did you forget to wrap your App inside `withTRPC` HoC?");return G}function h(G,ae){var V;const{queryClient:F,ssrState:fe}=m();return fe&&fe!=="mounted"&&((V=F.getQueryCache().find({queryKey:G}))===null||V===void 0?void 0:V.state.status)==="error"?(0,Ne.default)({retryOnMount:!1},ae):ae}function c(G,ae,V){var F,fe,ke,Me,Ae;const Ee=m(),{abortOnUnmount:we,client:ge,ssrState:Q,queryClient:oe,prefetchQuery:xe}=Ee,Ie=xi(G,ae,"query"),he=oe.getQueryDefaults(Ie),q=ae===Oa;typeof window>"u"&&Q==="prepass"&&(V==null||(F=V.trpc)===null||F===void 0?void 0:F.ssr)!==!1&&((fe=V?.enabled)!==null&&fe!==void 0?fe:he?.enabled)!==!1&&!q&&!oe.getQueryCache().find({queryKey:Ie})&&xe(Ie,V);const W=h(Ie,(0,Ne.default)((0,Ne.default)({},he),V)),le=(ke=(Me=V==null||(Ae=V.trpc)===null||Ae===void 0?void 0:Ae.abortOnUnmount)!==null&&Me!==void 0?Me:void 0)!==null&&ke!==void 0?ke:we,be=Gte((0,Ne.default)((0,Ne.default)({},W),{},{queryKey:Ie,queryFn:q?ae:async ee=>{const ve=(0,Ne.default)((0,Ne.default)({},W),{},{trpc:(0,Ne.default)((0,Ne.default)({},W?.trpc),le?{signal:ee.signal}:{signal:null})}),De=await ge.query(...na(Ie,ve));return fE(De)?E_(De,oe,Ie):De}}),oe);return be.trpc=xc({path:G}),be}function x(G,ae,V){var F,fe,ke;const Me=m(),Ae=xi(G,ae,"query"),Ee=ae===Oa,we=(F=(fe=V==null||(ke=V.trpc)===null||ke===void 0?void 0:ke.abortOnUnmount)!==null&&fe!==void 0?fe:void 0)!==null&&F!==void 0?F:Me.abortOnUnmount;Yte((0,Ne.default)((0,Ne.default)({},V),{},{queryKey:Ae,queryFn:Ee?ae:ge=>{const Q={trpc:(0,Ne.default)((0,Ne.default)({},V?.trpc),we?{signal:ge.signal}:{})};return Me.client.query(...na(Ae,Q))}}))}function M(G,ae,V){var F,fe,ke;const Me=m(),Ae=xi(G,ae,"query"),Ee=(F=(fe=V==null||(ke=V.trpc)===null||ke===void 0?void 0:ke.abortOnUnmount)!==null&&fe!==void 0?fe:void 0)!==null&&F!==void 0?F:Me.abortOnUnmount,we=Zte((0,Ne.default)((0,Ne.default)({},V),{},{queryKey:Ae,queryFn:ge=>{const Q=(0,Ne.default)((0,Ne.default)({},V),{},{trpc:(0,Ne.default)((0,Ne.default)({},V?.trpc),Ee?{signal:ge.signal}:{signal:null})});return Me.client.query(...na(Ae,Q))}}),Me.queryClient);return we.trpc=xc({path:G}),[we.data,we]}function C(G,ae){const{client:V,queryClient:F}=m(),fe=Ep(G),ke=F.defaultMutationOptions(F.getMutationDefaults(fe)),Me=Jte((0,Ne.default)((0,Ne.default)({},ae),{},{mutationKey:fe,mutationFn:Ae=>V.mutation(...na([G,{input:Ae}],ae)),onSuccess(...Ae){var Ee,we;return a({originalFn:()=>{var Q,oe,xe;return(Q=ae==null||(oe=ae.onSuccess)===null||oe===void 0?void 0:oe.call(ae,...Ae))!==null&&Q!==void 0?Q:ke==null||(xe=ke.onSuccess)===null||xe===void 0?void 0:xe.call(ke,...Ae)},queryClient:F,meta:(Ee=(we=ae?.meta)!==null&&we!==void 0?we:ke?.meta)!==null&&Ee!==void 0?Ee:{}})}}),F);return Me.trpc=xc({path:G}),Me}const E={data:void 0,error:null,status:"idle"},R={data:void 0,error:null,status:"connecting"};function _(G,ae,V){var F;const fe=(F=V?.enabled)!==null&&F!==void 0?F:ae!==Oa,ke=Hr(xi(G,ae,"any")),{client:Me}=m(),Ae=T.useRef(V);T.useEffect(()=>{Ae.current=V});const[Ee]=T.useState(new Set([])),we=T.useCallback(q=>{Ee.add(q)},[Ee]),ge=T.useRef(null),Q=T.useCallback(q=>{const W=xe.current,le=xe.current=q(W);let be=!1;for(const ee of Ee)if(W[ee]!==le[ee]){be=!0;break}be&&he(tC(le,we))},[we,Ee]),oe=T.useCallback(()=>{var q;if((q=ge.current)===null||q===void 0||q.unsubscribe(),!fe){Q(()=>(0,Ne.default)((0,Ne.default)({},E),{},{reset:oe}));return}Q(()=>(0,Ne.default)((0,Ne.default)({},R),{},{reset:oe}));const W=Me.subscription(G.join("."),ae??void 0,{onStarted:()=>{var le,be;(le=(be=Ae.current).onStarted)===null||le===void 0||le.call(be),Q(ee=>(0,Ne.default)((0,Ne.default)({},ee),{},{status:"pending",error:null}))},onData:le=>{var be,ee;(be=(ee=Ae.current).onData)===null||be===void 0||be.call(ee,le),Q(ve=>(0,Ne.default)((0,Ne.default)({},ve),{},{status:"pending",data:le,error:null}))},onError:le=>{var be,ee;(be=(ee=Ae.current).onError)===null||be===void 0||be.call(ee,le),Q(ve=>(0,Ne.default)((0,Ne.default)({},ve),{},{status:"error",error:le}))},onConnectionStateChange:le=>{Q(be=>{switch(le.state){case"idle":return(0,Ne.default)((0,Ne.default)({},be),{},{status:le.state,error:null,data:void 0});case"connecting":return(0,Ne.default)((0,Ne.default)({},be),{},{error:le.error,status:le.state});case"pending":return be}})},onComplete:()=>{var le,be;(le=(be=Ae.current).onComplete)===null||le===void 0||le.call(be),Q(ee=>(0,Ne.default)((0,Ne.default)({},ee),{},{status:"idle",error:null,data:void 0}))}});ge.current=W},[Me,ke,fe,Q]);T.useEffect(()=>(oe(),()=>{var q;(q=ge.current)===null||q===void 0||q.unsubscribe()}),[oe]);const xe=T.useRef(fe?(0,Ne.default)((0,Ne.default)({},R),{},{reset:oe}):(0,Ne.default)((0,Ne.default)({},E),{},{reset:oe})),[Ie,he]=T.useState(tC(xe.current,we));return Ie}function j(G,ae,V){var F,fe,ke,Me,Ae;const{client:Ee,ssrState:we,prefetchInfiniteQuery:ge,queryClient:Q,abortOnUnmount:oe}=m(),xe=xi(G,ae,"infinite"),Ie=Q.getQueryDefaults(xe),he=ae===Oa;typeof window>"u"&&we==="prepass"&&(V==null||(F=V.trpc)===null||F===void 0?void 0:F.ssr)!==!1&&((fe=V?.enabled)!==null&&fe!==void 0?fe:Ie?.enabled)!==!1&&!he&&!Q.getQueryCache().find({queryKey:xe})&&ge(xe,(0,Ne.default)((0,Ne.default)({},Ie),V));const q=h(xe,(0,Ne.default)((0,Ne.default)({},Ie),V)),W=(ke=V==null||(Me=V.trpc)===null||Me===void 0?void 0:Me.abortOnUnmount)!==null&&ke!==void 0?ke:oe,le=ene((0,Ne.default)((0,Ne.default)({},q),{},{initialPageParam:(Ae=V.initialCursor)!==null&&Ae!==void 0?Ae:null,persister:V.persister,queryKey:xe,queryFn:he?ae:be=>{var ee;const ve=(0,Ne.default)((0,Ne.default)({},q),{},{trpc:(0,Ne.default)((0,Ne.default)({},q?.trpc),W?{signal:be.signal}:{signal:null})});return Ee.query(...na(xe,ve,{pageParam:(ee=be.pageParam)!==null&&ee!==void 0?ee:V.initialCursor,direction:be.direction}))}}),Q);return le.trpc=xc({path:G}),le}function D(G,ae,V){var F,fe,ke;const Me=m(),Ae=xi(G,ae,"infinite"),Ee=Me.queryClient.getQueryDefaults(Ae),we=ae===Oa,ge=h(Ae,(0,Ne.default)((0,Ne.default)({},Ee),V)),Q=(F=V==null||(fe=V.trpc)===null||fe===void 0?void 0:fe.abortOnUnmount)!==null&&F!==void 0?F:Me.abortOnUnmount;Xte((0,Ne.default)((0,Ne.default)({},V),{},{initialPageParam:(ke=V.initialCursor)!==null&&ke!==void 0?ke:null,queryKey:Ae,queryFn:we?ae:oe=>{var xe;const Ie=(0,Ne.default)((0,Ne.default)({},ge),{},{trpc:(0,Ne.default)((0,Ne.default)({},ge?.trpc),Q?{signal:oe.signal}:{})});return Me.client.query(...na(Ae,Ie,{pageParam:(xe=oe.pageParam)!==null&&xe!==void 0?xe:V.initialCursor,direction:oe.direction}))}}))}function z(G,ae,V){var F,fe,ke;const Me=m(),Ae=xi(G,ae,"infinite"),Ee=Me.queryClient.getQueryDefaults(Ae),we=h(Ae,(0,Ne.default)((0,Ne.default)({},Ee),V)),ge=(F=V==null||(fe=V.trpc)===null||fe===void 0?void 0:fe.abortOnUnmount)!==null&&F!==void 0?F:Me.abortOnUnmount,Q=Kte((0,Ne.default)((0,Ne.default)({},V),{},{initialPageParam:(ke=V.initialCursor)!==null&&ke!==void 0?ke:null,queryKey:Ae,queryFn:oe=>{var xe;const Ie=(0,Ne.default)((0,Ne.default)({},we),{},{trpc:(0,Ne.default)((0,Ne.default)({},we?.trpc),ge?{signal:oe.signal}:{})});return Me.client.query(...na(Ae,Ie,{pageParam:(xe=oe.pageParam)!==null&&xe!==void 0?xe:V.initialCursor,direction:oe.direction}))}}),Me.queryClient);return Q.trpc=xc({path:G}),[Q.data,Q]}return{Provider:f,createClient:p,useContext:m,useUtils:m,useQuery:c,usePrefetchQuery:x,useSuspenseQuery:M,useQueries:(G,ae)=>{const{ssrState:V,queryClient:F,prefetchQuery:fe,client:ke}=m(),Me=eC(ke),Ae=G(Me);if(typeof window>"u"&&V==="prepass")for(const we of Ae){var Ee;const ge=we;((Ee=ge.trpc)===null||Ee===void 0?void 0:Ee.ssr)!==!1&&!F.getQueryCache().find({queryKey:ge.queryKey})&&fe(ge.queryKey,ge)}return w_({queries:Ae.map(we=>(0,Ne.default)((0,Ne.default)({},we),{},{queryKey:we.queryKey})),combine:ae?.combine},F)},useSuspenseQueries:G=>{const{queryClient:ae,client:V}=m(),F=eC(V),fe=G(F),ke=Wte({queries:fe.map(Me=>(0,Ne.default)((0,Ne.default)({},Me),{},{queryFn:Me.queryFn,queryKey:Me.queryKey}))},ae);return[ke.map(Me=>Me.data),ke]},useMutation:C,useSubscription:_,useInfiniteQuery:j,usePrefetchInfiniteQuery:D,useSuspenseInfiniteQuery:z}}function Mne(e){const t=mne(e);return vb(n=>n==="useContext"||n==="useUtils"?()=>{const a=e.useUtils();return T.useMemo(()=>yne(a),[a])}:e.hasOwnProperty(n)?e[n]:t[n])}function Cne(e){const t=wne();return Mne(t)}cE();var $g={};var R_=(...e)=>e.filter((t,n,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===n).join(" ").trim();var Ane=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var Ene=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,a)=>a?a.toUpperCase():n.toLowerCase());var nC=e=>{const t=Ene(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Rne={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"};var Ine=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};var Tne=T.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:s="",children:p,iconNode:f,...m},h)=>T.createElement("svg",{ref:h,...Rne,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:R_("lucide",s),...!p&&!Ine(m)&&{"aria-hidden":"true"},...m},[...f.map(([c,x])=>T.createElement(c,x)),...Array.isArray(p)?p:[p]]));var Z=(e,t)=>{const n=T.forwardRef(({className:a,...s},p)=>T.createElement(Tne,{ref:p,iconNode:t,className:R_(`lucide-${Ane(nC(e))}`,`lucide-${e}`,a),...s}));return n.displayName=nC(e),n};var I_=Z("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"}]]);var _ne=Z("air-vent",[["path",{d:"M18 17.5a2.5 2.5 0 1 1-4 2.03V12",key:"yd12zl"}],["path",{d:"M6 12H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"larmp2"}],["path",{d:"M6 8h12",key:"6g4wlu"}],["path",{d:"M6.6 15.572A2 2 0 1 0 10 17v-5",key:"1x1kqn"}]]);var Nne=Z("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"}]]);Z("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"}]]);Z("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);Z("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);Z("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);Z("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"}]]);Z("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);var One=Z("baby",[["path",{d:"M10 16c.5.3 1.2.5 2 .5s1.5-.2 2-.5",key:"1u7htd"}],["path",{d:"M15 12h.01",key:"1k8ypt"}],["path",{d:"M19.38 6.813A9 9 0 0 1 20.8 10.2a2 2 0 0 1 0 3.6 9 9 0 0 1-17.6 0 2 2 0 0 1 0-3.6A9 9 0 0 1 12 3c2 0 3.5 1.1 3.5 2.5s-.9 2.5-2 2.5c-.8 0-1.5-.4-1.5-1",key:"11xh7x"}],["path",{d:"M9 12h.01",key:"157uk2"}]]);var Py=Z("ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]]);var jne=Z("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"}]]);Z("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"}]]);Z("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"}]]);var rm=Z("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"}]]);var Pne=Z("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"}]]);Z("battery",[["path",{d:"M 22 14 L 22 10",key:"nqc4tb"}],["rect",{x:"2",y:"6",width:"16",height:"12",rx:"2",key:"13zb55"}]]);var Qg=Z("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 om=Z("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"}]]);var aC=Z("bike",[["circle",{cx:"18.5",cy:"17.5",r:"3.5",key:"15x4ox"}],["circle",{cx:"5.5",cy:"17.5",r:"3.5",key:"1noe27"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["path",{d:"M12 17.5V14l-3-3 4-3 2 3h2",key:"1npguv"}]]);var iC=Z("bird",[["path",{d:"M16 7h.01",key:"1kdx03"}],["path",{d:"M3.4 18H12a8 8 0 0 0 8-8V7a4 4 0 0 0-7.28-2.3L2 20",key:"oj1oa8"}],["path",{d:"m20 7 2 .5-2 .5",key:"12nv4d"}],["path",{d:"M10 18v3",key:"1yea0a"}],["path",{d:"M14 17.75V21",key:"1pymcb"}],["path",{d:"M7 18a6 6 0 0 0 3.84-10.61",key:"1npnn0"}]]);var Dne=Z("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"}]]);var zne=Z("bone",[["path",{d:"M17 10c.7-.7 1.69 0 2.5 0a2.5 2.5 0 1 0 0-5 .5.5 0 0 1-.5-.5 2.5 2.5 0 1 0-5 0c0 .81.7 1.8 0 2.5l-7 7c-.7.7-1.69 0-2.5 0a2.5 2.5 0 0 0 0 5c.28 0 .5.22.5.5a2.5 2.5 0 1 0 5 0c0-.81-.7-1.8 0-2.5Z",key:"w610uw"}]]);var Lne=Z("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"}]]);var rC=Z("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"}]]);Z("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 qne=Z("bus",[["path",{d:"M8 6v6",key:"18i7km"}],["path",{d:"M15 6v6",key:"1sg6z9"}],["path",{d:"M2 12h19.6",key:"de5uta"}],["path",{d:"M18 18h3s.5-1.7.8-2.8c.1-.4.2-.8.2-1.2 0-.4-.1-.8-.2-1.2l-1.4-5C20.1 6.8 19.1 6 18 6H4a2 2 0 0 0-2 2v10h3",key:"1wwztk"}],["circle",{cx:"7",cy:"18",r:"2",key:"19iecd"}],["path",{d:"M9 18h5",key:"lrx6i"}],["circle",{cx:"16",cy:"18",r:"2",key:"1v4tcr"}]]);Z("cable",[["path",{d:"M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z",key:"trhst0"}],["path",{d:"M17 21v-2",key:"ds4u3f"}],["path",{d:"M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10",key:"1mo9zo"}],["path",{d:"M21 21v-2",key:"eo0ou"}],["path",{d:"M3 5V3",key:"1k5hjh"}],["path",{d:"M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z",key:"1dd30t"}],["path",{d:"M7 5V3",key:"1t1388"}]]);var Bne=Z("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"}]]);var Vg=Z("car",[["path",{d:"M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2",key:"5owen"}],["circle",{cx:"7",cy:"17",r:"2",key:"u2ysq9"}],["path",{d:"M9 17h6",key:"r8uit2"}],["circle",{cx:"17",cy:"17",r:"2",key:"axvx0g"}]]);Z("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"}]]);var oC=Z("cat",[["path",{d:"M12 5c.67 0 1.35.09 2 .26 1.78-2 5.03-2.84 6.42-2.26 1.4.58-.42 7-.42 7 .57 1.07 1 2.24 1 3.44C21 17.9 16.97 21 12 21s-9-3-9-7.56c0-1.25.5-2.4 1-3.44 0 0-1.89-6.42-.5-7 1.39-.58 4.72.23 6.5 2.23A9.04 9.04 0 0 1 12 5Z",key:"x6xyqk"}],["path",{d:"M8 14v.5",key:"1nzgdb"}],["path",{d:"M16 14v.5",key:"1lajdz"}],["path",{d:"M11.25 16.25h1.5L12 17l-.75-.75Z",key:"12kq1m"}]]);var T_=Z("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);var Uo=Z("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);Z("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);var Fne=Z("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);var Dm=Z("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);Z("chevrons-down-up",[["path",{d:"m7 20 5-5 5 5",key:"13a0gw"}],["path",{d:"m7 4 5 5 5-5",key:"1kwcof"}]]);Z("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);Z("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"}]]);Z("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"}]]);var Une=Z("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);var __=Z("circle-dot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);Z("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"}]]);Z("circle-plus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]);Z("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"}]]);var Hne=Z("circle-stop",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]]);Z("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"}]]);var sC=Z("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);var $ne=Z("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"}]]);var Qne=Z("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"}]]);var N_=Z("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"}]]);var lC=Z("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 O_=Z("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"}]]);var Vne=Z("cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);var Gne=Z("cog",[["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["circle",{cx:"12",cy:"12",r:"8",key:"46899m"}]]);Z("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"}]]);Z("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"}]]);Z("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"}]]);var j_=Z("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"}]]);Z("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"}]]);var cC=Z("dog",[["path",{d:"M11.25 16.25h1.5L12 17z",key:"w7jh35"}],["path",{d:"M16 14v.5",key:"1lajdz"}],["path",{d:"M4.42 11.247A13.152 13.152 0 0 0 4 14.556C4 18.728 7.582 21 12 21s8-2.272 8-6.444a11.702 11.702 0 0 0-.493-3.309",key:"u7s9ue"}],["path",{d:"M8 14v.5",key:"1nzgdb"}],["path",{d:"M8.5 8.5c-.384 1.05-1.083 2.028-2.344 2.5-1.931.722-3.576-.297-3.656-1-.113-.994 1.177-6.53 4-7 1.923-.321 3.651.845 3.651 2.235A7.497 7.497 0 0 1 14 5.277c0-1.39 1.844-2.598 3.767-2.277 2.823.47 4.113 6.006 4 7-.08.703-1.725 1.722-3.656 1-1.261-.472-1.855-1.45-2.239-2.5",key:"v8hric"}]]);var Zne=Z("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"}]]);var dl=Z("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"}]]);var P_=Z("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"}]]);var S0=Z("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"}]]);var bl=Z("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"}]]);Z("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"}]]);Z("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 Kne=Z("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"}]]);Z("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 sm=Z("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"}]]);var Wne=Z("feather",[["path",{d:"M12.67 19a2 2 0 0 0 1.416-.588l6.154-6.172a6 6 0 0 0-8.49-8.49L5.586 9.914A2 2 0 0 0 5 11.328V18a1 1 0 0 0 1 1z",key:"18jl4k"}],["path",{d:"M16 8 2 22",key:"vp34q"}],["path",{d:"M17.5 15H9",key:"1oz8nu"}]]);Z("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"}]]);var lm=Z("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"}]]);Z("flashlight-off",[["path",{d:"M11.652 6H18",key:"voqkpr"}],["path",{d:"M12 13v1",key:"176q98"}],["path",{d:"M16 16v4a2 2 0 0 1-2 2h-4a2 2 0 0 1-2-2v-8a4 4 0 0 0-.8-2.4l-.6-.8A3 3 0 0 1 6 7V6",key:"dzyf92"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M7.649 2H17a1 1 0 0 1 1 1v4a3 3 0 0 1-.6 1.8l-.6.8a4 4 0 0 0-.55 1.007",key:"1hvcfn"}]]);var Yne=Z("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"}]]);var Xne=Z("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"}]]);var D_=Z("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"}]]);Z("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"}]]);Z("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"}]]);var Rp=Z("gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);var Ove=Z("grid-2x2",[["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"M3 12h18",key:"1i2n21"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]]);Z("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"}]]);var Jne=Z("hammer",[["path",{d:"m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9",key:"1hayfq"}],["path",{d:"m18 15 4-4",key:"16gjal"}],["path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5",key:"15ts47"}]]);Z("hand",[["path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2",key:"1fvzgz"}],["path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2",key:"1kc0my"}],["path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8",key:"10h0bg"}],["path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15",key:"1s1gnw"}]]);Z("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"}]]);var eae=Z("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"}]]);var zm=Z("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"}]]);var z_=Z("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 tae=Z("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"}]]);Z("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"}]]);Z("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);var nae=Z("laugh",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M18 13a6 6 0 0 1-6 5 6 6 0 0 1-6-5h12Z",key:"b2q4dd"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]]);Z("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 aae=Z("leaf",[["path",{d:"M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10Z",key:"nnexq3"}],["path",{d:"M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12",key:"mt58a7"}]]);var Lm=Z("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"}]]);Z("link-2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);var iae=Z("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"}]]);var rae=Z("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"}]]);var x0=Z("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);Z("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"}]]);var Dy=Z("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 ku=Z("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"}]]);var oae=Z("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 sae=Z("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"}]]);Z("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"}]]);var L_=Z("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"}]]);Z("menu",[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]);var q_=Z("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"}]]);var jve=Z("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"}]]);Z("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"}]]);Z("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);var lae=Z("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"}]]);var k0=Z("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"}]]);var B_=Z("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"}]]);var cae=Z("move-horizontal",[["path",{d:"m18 8 4 4-4 4",key:"1ak13k"}],["path",{d:"M2 12h20",key:"9i4pu4"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}]]);var uae=Z("move-vertical",[["path",{d:"M12 2v20",key:"t6zp3m"}],["path",{d:"m8 18 4 4 4-4",key:"bh5tu3"}],["path",{d:"m8 6 4-4 4 4",key:"ybng9g"}]]);Z("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"}]]);var F_=Z("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"}]]);var dae=Z("navigation",[["polygon",{points:"3 11 22 2 13 21 11 13 3 11",key:"1ltx0t"}]]);var pae=Z("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"}]]);var mae=Z("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 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.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);var wu=Z("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"}]]);var _a=Z("paw-print",[["circle",{cx:"11",cy:"4",r:"2",key:"vol9p0"}],["circle",{cx:"18",cy:"8",r:"2",key:"17gozi"}],["circle",{cx:"20",cy:"16",r:"2",key:"1v9bxh"}],["path",{d:"M9 10a5 5 0 0 1 5 5v3.5a3.5 3.5 0 0 1-6.84 1.045Q6.52 17.48 4.46 16.84A3.5 3.5 0 0 1 5.5 10Z",key:"1ydw1z"}]]);Z("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 fae=Z("phone",[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]]);var hae=Z("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"}]]);var gae=Z("plane",[["path",{d:"M17.8 19.2 16 11l3.5-3.5C21 6 21.5 4 21 3c-1-.5-3 0-4.5 1.5L13 8 4.8 6.2c-.5-.1-.9.1-1.1.5l-.3.5c-.2.5-.1 1 .3 1.3L9 12l-2 3H4l-1 1 3 2 2 3 1-1v-3l3-2 3.5 5.3c.3.4.8.5 1.3.3l.5-.2c.4-.3.6-.7.5-1.2z",key:"1v9wt8"}]]);var Ho=Z("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"}]]);Z("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);Z("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"}]]);Z("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"}]]);var Mu=Z("power",[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]);Z("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"}]]);var U_=Z("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"}]]);Z("radio-tower",[["path",{d:"M4.9 16.1C1 12.2 1 5.8 4.9 1.9",key:"s0qx1y"}],["path",{d:"M7.8 4.7a6.14 6.14 0 0 0-.8 7.5",key:"1idnkw"}],["circle",{cx:"12",cy:"9",r:"2",key:"1092wv"}],["path",{d:"M16.2 4.8c2 2 2.26 5.11.8 7.47",key:"ojru2q"}],["path",{d:"M19.1 1.9a9.96 9.96 0 0 1 0 14.1",key:"rhi7fg"}],["path",{d:"M9.5 18h5",key:"mfy3pd"}],["path",{d:"m8 22 4-11 4 11",key:"25yftu"}]]);var vae=Z("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 w0=Z("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"}]]);var yae=Z("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"}]]);Z("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"}]]);var bae=Z("sailboat",[["path",{d:"M10 2v15",key:"1qf71f"}],["path",{d:"M7 22a4 4 0 0 1-4-4 1 1 0 0 1 1-1h16a1 1 0 0 1 1 1 4 4 0 0 1-4 4z",key:"1pxcvx"}],["path",{d:"M9.159 2.46a1 1 0 0 1 1.521-.193l9.977 8.98A1 1 0 0 1 20 13H4a1 1 0 0 1-.824-1.567z",key:"5oog16"}]]);Z("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"}]]);Z("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 Sae=Z("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"}]]);Z("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);Z("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"}]]);Z("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"}]]);Z("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 qm=Z("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"}]]);var xae=Z("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"}]]);var kae=Z("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"}]]);var wae=Z("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"}]]);Z("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 cm=Z("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"}]]);var Mae=Z("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"}]]);var Cae=Z("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 M0=Z("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"}]]);var Aae=Z("smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);var H_=Z("snowflake",[["path",{d:"m10 20-1.25-2.5L6 18",key:"18frcb"}],["path",{d:"M10 4 8.75 6.5 6 6",key:"7mghy3"}],["path",{d:"m14 20 1.25-2.5L18 18",key:"1chtki"}],["path",{d:"m14 4 1.25 2.5L18 6",key:"1b4wsy"}],["path",{d:"m17 21-3-6h-4",key:"15hhxa"}],["path",{d:"m17 3-3 6 1.5 3",key:"11697g"}],["path",{d:"M2 12h6.5L10 9",key:"kv9z4n"}],["path",{d:"m20 10-1.5 2 1.5 2",key:"1swlpi"}],["path",{d:"M22 12h-6.5L14 15",key:"1mxi28"}],["path",{d:"m4 10 1.5 2L4 14",key:"k9enpj"}],["path",{d:"m7 21 3-6-1.5-3",key:"j8hb9u"}],["path",{d:"m7 3 3 6h4",key:"1otusx"}]]);var $_=Z("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]);var Eae=Z("sprout",[["path",{d:"M14 9.536V7a4 4 0 0 1 4-4h1.5a.5.5 0 0 1 .5.5V5a4 4 0 0 1-4 4 4 4 0 0 0-4 4c0 2 1 3 1 5a5 5 0 0 1-1 3",key:"139s4v"}],["path",{d:"M4 9a5 5 0 0 1 8 4 5 5 0 0 1-8-4",key:"1dlkgp"}],["path",{d:"M5 21h14",key:"11awu3"}]]);var Cu=Z("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);Z("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"}]]);var Rae=Z("sun-medium",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 3v1",key:"1asbbs"}],["path",{d:"M12 20v1",key:"1wcdkc"}],["path",{d:"M3 12h1",key:"lp3yf2"}],["path",{d:"M20 12h1",key:"1vloll"}],["path",{d:"m18.364 5.636-.707.707",key:"1hakh0"}],["path",{d:"m6.343 17.657-.707.707",key:"18m9nf"}],["path",{d:"m5.636 5.636.707.707",key:"1xv1c5"}],["path",{d:"m17.657 17.657.707.707",key:"vl76zb"}]]);var Q_=Z("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"}]]);var Iae=Z("sunrise",[["path",{d:"M12 2v8",key:"1q4o3n"}],["path",{d:"m4.93 10.93 1.41 1.41",key:"2a7f42"}],["path",{d:"M2 18h2",key:"j10viu"}],["path",{d:"M20 18h2",key:"wocana"}],["path",{d:"m19.07 10.93-1.41 1.41",key:"15zs5n"}],["path",{d:"M22 22H2",key:"19qnx5"}],["path",{d:"m8 6 4-4 4 4",key:"ybng9g"}],["path",{d:"M16 18a4 4 0 0 0-8 0",key:"1lzouq"}]]);var V_=Z("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);Z("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 Bm=Z("thermometer",[["path",{d:"M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z",key:"17jzev"}]]);var zy=Z("toggle-left",[["circle",{cx:"9",cy:"12",r:"3",key:"u3jwor"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]]);var Tae=Z("toggle-right",[["circle",{cx:"15",cy:"12",r:"3",key:"1afu0r"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]]);var _ae=Z("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"}]]);var Nae=Z("train-front",[["path",{d:"M8 3.1V7a4 4 0 0 0 8 0V3.1",key:"1v71zp"}],["path",{d:"m9 15-1-1",key:"1yrq24"}],["path",{d:"m15 15 1-1",key:"1t0d6s"}],["path",{d:"M9 19c-2.8 0-5-2.2-5-5v-4a8 8 0 0 1 16 0v4c0 2.8-2.2 5-5 5Z",key:"1p0hjs"}],["path",{d:"m8 19-2 3",key:"13i0xs"}],["path",{d:"m16 19 2 3",key:"xo31yx"}]]);var Oae=Z("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"}]]);Z("trending-up",[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]]);Z("trending-down",[["path",{d:"M16 17h6v-6",key:"t6n2it"}],["path",{d:"m22 17-8.5-8.5-5 5L2 7",key:"x473p"}]]);var pl=Z("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"}]]);var jae=Z("truck",[["path",{d:"M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2",key:"wrbu53"}],["path",{d:"M15 18H9",key:"1lyqi6"}],["path",{d:"M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14",key:"lysw3i"}],["circle",{cx:"17",cy:"18",r:"2",key:"332jqn"}],["circle",{cx:"7",cy:"18",r:"2",key:"19iecd"}]]);var Pae=Z("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"}]]);Z("undo-2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);Z("unlink-2",[["path",{d:"M15 7h2a5 5 0 0 1 0 10h-2m-6 0H7A5 5 0 0 1 7 7h2",key:"1re2ne"}]]);Z("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"}]]);var Dae=Z("user-check",[["path",{d:"m16 11 2 2 4-4",key:"9rsbq5"}],["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]);var zae=Z("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);var Lae=Z("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]);var uC=Z("utensils-crossed",[["path",{d:"m16 2-2.3 2.3a3 3 0 0 0 0 4.2l1.8 1.8a3 3 0 0 0 4.2 0L22 8",key:"n7qcjb"}],["path",{d:"M15 15 3.3 3.3a4.2 4.2 0 0 0 0 6l7.3 7.3c.7.7 2 .7 2.8 0L15 15Zm0 0 7 7",key:"d0u48b"}],["path",{d:"m2.1 21.8 6.4-6.3",key:"yn04lh"}],["path",{d:"m19 5-7 7",key:"194lzd"}]]);var G_=Z("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"}]]);var Au=Z("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"}]]);var Z_=Z("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 qae=Z("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"}]]);Z("wifi-high",[["path",{d:"M12 20h.01",key:"zekei9"}],["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"}]]);Z("wifi-low",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);var dC=Z("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"}]]);Z("wifi-zero",[["path",{d:"M12 20h.01",key:"zekei9"}]]);var Bae=Z("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"}]]);var er=Z("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 Fae=Z("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"}]]);Z("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"}]]);var Uae=Z("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);var Lr=Z("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"}]]);var Hae=Z("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"}]]);var $ae=Z("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"}]]),K_=typeof globalThis<"u"?globalThis.__camstackTrpcReact:void 0,y=K_??Cne();typeof globalThis<"u"&&!K_&&(globalThis.__camstackTrpcReact=y);function Ci(e,t){if(typeof globalThis>"u")return T.createContext(t);const n=globalThis.__camstackSharedContexts,a=n??new Map;n||(globalThis.__camstackSharedContexts=a);const s=a.get(e);if(s)return s;const p=T.createContext(t);return a.set(e,p),p}var W_=Ci("camstack:system",null);function Y_({system:e,children:t}){return v.jsx(W_.Provider,{value:e,children:t})}function Qae(){const e=T.useContext(W_);if(!e)throw new Error("useSystem(): no <SystemProvider> in tree");return e}function wi(e,t){const n=Qae(),a=T.useRef(t);a.current=t;const[s,p]=T.useState(n.connectionVersion);T.useEffect(()=>n.subscribeConnectionEvents((f,m)=>{f==="connected"&&p(m)}),[n]),T.useEffect(()=>n.subscribeEvent(e,f=>{a.current(f)}),[n,e,s])}y.accessories.setChildHidden.useMutation;y.accessories.getStatus.useQuery;y.addonPages.listPages.useQuery;y.addons.list.useQuery;y.addons.getLogs.useQuery;y.addons.listPackages.useQuery;y.addons.installPackage.useMutation;y.addons.installFromWorkspace.useMutation;y.addons.isWorkspaceAvailable.useQuery;y.addons.listWorkspacePackages.useQuery;y.addons.uninstallPackage.useMutation;y.addons.reloadPackages.useMutation;y.addons.searchAvailable.useQuery;y.addons.listUpdates.useQuery;y.addons.updatePackage.useMutation;y.addons.rollbackPackage.useMutation;y.addons.forceRefresh.useMutation;y.addons.restartServer.useMutation;y.addons.getLastRestart.useQuery;y.addons.listFrameworkPackages.useQuery;y.addons.listCapabilityProviders.useQuery;y.addons.setCapabilityProviderEnabled.useMutation;y.addons.getVersions.useQuery;y.addons.restartAddon.useMutation;y.addons.retryLoad.useMutation;y.addons.getAutoUpdateSettings.useQuery;y.addons.setAutoUpdateSettings.useMutation;y.addons.getAddonAutoUpdate.useQuery;y.addons.setAddonAutoUpdate.useMutation;y.addons.applyAutoUpdateToAll.useMutation;y.addons.custom.useMutation;y.addons.startJob.useMutation;y.addons.getJob.useQuery;y.addons.listJobs.useQuery;y.addons.cancelJob.useMutation;y.addons.onAddonLogs.useSubscription;y.addonSettings.getGlobalSettings.useQuery;y.addonSettings.updateGlobalSettings.useMutation;y.addonSettings.getIntegrationSettings.useQuery;y.addonSettings.getDeviceSettings.useQuery;y.addonSettings.updateDeviceSettings.useMutation;y.addonWidgets.listWidgets.useQuery;y.airQualitySensor.getStatus.useQuery;y.alarmPanel.arm.useMutation;y.alarmPanel.disarm.useMutation;y.alarmPanel.trigger.useMutation;y.alarmPanel.getStatus.useQuery;y.alerts.emit.useMutation;y.alerts.update.useMutation;y.alerts.list.useQuery;y.alerts.getUnreadCount.useQuery;y.alerts.markRead.useMutation;y.alerts.markAllRead.useMutation;y.alerts.dismiss.useMutation;y.ambientLightSensor.getStatus.useQuery;y.audioAnalysis.resolveDeviceSettings.useQuery;y.audioAnalysis.getDeviceSettingsContribution.useQuery;y.audioAnalysis.getDeviceLiveContribution.useQuery;y.audioAnalysis.applyDeviceSettingsPatch.useMutation;y.audioAnalyzer.analyseChunk.useMutation;y.audioAnalyzer.classify.useQuery;y.audioAnalyzer.attachDevice.useMutation;y.audioAnalyzer.detachDevice.useMutation;y.audioAnalyzer.isReady.useQuery;y.audioAnalyzer.dispose.useMutation;y.audioAnalyzer.reprobeAudioEngine.useMutation;y.audioCodec.listSupportedCodecs.useQuery;y.audioCodec.canHandle.useQuery;y.audioCodec.createDecodeSession.useMutation;y.audioCodec.createEncodeSession.useMutation;y.audioCodec.closeSession.useMutation;y.audioCodec.pushEncodedFrame.useMutation;y.audioCodec.pullPcm.useQuery;y.audioCodec.pushPcm.useMutation;y.audioCodec.pullEncoded.useQuery;y.audioCodec.flushEncode.useMutation;y.audioCodec.listActiveSessions.useQuery;y.audioMetrics.getCurrentSnapshot.useQuery;y.audioMetrics.getHistory.useQuery;y.automationControl.enable.useMutation;y.automationControl.disable.useMutation;y.automationControl.trigger.useMutation;y.automationControl.getStatus.useQuery;y.backup.listDestinations.useQuery;y.backup.trigger.useMutation;y.backup.listRuns.useQuery;y.backup.cancel.useMutation;y.backup.list.useQuery;y.backup.listLocations.useQuery;y.backup.getEntries.useQuery;y.backup.restore.useMutation;y.backup.delete.useMutation;y.backup.listArchives.useQuery;y.backup.upsertDestinationPolicy.useMutation;y.backup.previewSchedule.useQuery;y.backup.listSchedules.useQuery;y.backup.upsertSchedule.useMutation;y.backup.deleteSchedule.useMutation;y.battery.wakeForStream.useMutation;y.battery.getStatus.useQuery;y.binary.getStatus.useQuery;y.brightness.setBrightness.useMutation;y.brightness.getStatus.useQuery;y.broker.list.useQuery;y.broker.get.useQuery;y.broker.listProviders.useQuery;y.broker.add.useMutation;y.broker.remove.useMutation;y.broker.testConnection.useMutation;y.broker.getSettings.useQuery;y.broker.setSettings.useMutation;y.broker.getBrokerConfig.useQuery;y.broker.getSettingsSchema.useQuery;y.broker.testSettings.useMutation;y.broker.publish.useMutation;y.broker.subscribe.useMutation;y.broker.unsubscribe.useMutation;y.broker.getState.useQuery;y.broker.getStatus.useQuery;y.button.press.useMutation;y.cameraCredentials.getCredentials.useQuery;y.cameraCredentials.getStatus.useQuery;y.cameraGridLayout.getLayout.useQuery;y.cameraGridLayout.saveLayout.useMutation;y.cameraGridLayout.getDeviceSettingsContribution.useQuery;y.cameraGridLayout.getDeviceLiveContribution.useQuery;y.cameraGridLayout.applyDeviceSettingsPatch.useMutation;y.cameraPipelineConfig.getDeviceSettingsContribution.useQuery;y.cameraPipelineConfig.getDeviceLiveContribution.useQuery;y.cameraPipelineConfig.applyDeviceSettingsPatch.useMutation;y.cameraStreams.getCameraStreams.useQuery;y.cameraStreams.getBrokerStreams.useQuery;y.cameraStreams.getRtspEntries.useQuery;y.cameraStreams.getProfileRtspEntries.useQuery;y.cameraStreams.pickStream.useQuery;y.carbonMonoxide.getStatus.useQuery;y.climateControl.setMode.useMutation;y.climateControl.setFanMode.useMutation;y.climateControl.setPreset.useMutation;y.climateControl.setTarget.useMutation;y.climateControl.setTargetRange.useMutation;y.climateControl.setTargetHumidity.useMutation;y.climateControl.setSwingVertical.useMutation;y.climateControl.setSwingHorizontal.useMutation;y.climateControl.getStatus.useQuery;y.color.setColor.useMutation;y.color.getStatus.useQuery;y.connectionTest.testSettings.useMutation;y.connectionTest.describeTest.useQuery;y.connectivity.getStatus.useQuery;y.consumables.reset.useMutation;y.consumables.getStatus.useQuery;y.contact.getStatus.useQuery;y.control.setValue.useMutation;y.control.getStatus.useQuery;y.coreBlocks.list.useQuery;y.coreBlocks.get.useQuery;y.coreBlocks.create.useMutation;y.coreBlocks.update.useMutation;y.coreBlocks.delete.useMutation;y.coreBlocks.setEnabled.useMutation;y.coreBlocks.restart.useMutation;y.coreBlocks.compile.useMutation;y.coreBlocks.getTypeDefs.useQuery;y.cover.open.useMutation;y.cover.close.useMutation;y.cover.stop.useMutation;y.cover.setPosition.useMutation;y.cover.setTiltPosition.useMutation;y.cover.getStatus.useQuery;y.dayNight.getOptions.useQuery;y.dayNight.setSettings.useMutation;y.dayNight.getStatus.useQuery;y.decoder.supportsCodec.useQuery;y.decoder.getInfo.useQuery;y.decoder.createSession.useQuery;y.decoder.destroySession.useQuery;y.decoder.pushPacket.useQuery;y.decoder.openStream.useQuery;y.decoder.pullFrames.useQuery;y.decoder.pullHandles.useQuery;y.decoder.getFrame.useQuery;y.decoder.getShmStats.useQuery;y.decoder.updateConfig.useQuery;y.decoder.getStats.useQuery;y.decoder.listActiveSessions.useQuery;y.decoder.reprobeHwaccel.useMutation;y.detectionPipeline.getDeviceSettingsContribution.useQuery;y.detectionPipeline.getDeviceLiveContribution.useQuery;y.detectionPipeline.applyDeviceSettingsPatch.useMutation;y.deviceAdoption.listCandidateFilters.useQuery;y.deviceAdoption.listCandidates.useQuery;y.deviceAdoption.getCandidate.useQuery;y.deviceAdoption.refresh.useMutation;y.deviceAdoption.adopt.useMutation;y.deviceAdoption.release.useMutation;y.deviceAdoption.resync.useMutation;y.deviceAdoption.getStatus.useQuery;y.deviceDiscovery.listDiscovered.useQuery;y.deviceDiscovery.refreshDiscovery.useMutation;y.deviceDiscovery.adoptDevice.useMutation;y.deviceDiscovery.releaseDevice.useMutation;y.deviceDiscovery.getStatus.useQuery;y.deviceExport.getStatus.useQuery;y.deviceExport.listSupportedDeviceKinds.useQuery;y.deviceExport.listExposedDevices.useQuery;y.deviceExport.exposeDevice.useMutation;y.deviceExport.unexposeDevice.useMutation;y.deviceExport.getDeviceSettingsContribution.useQuery;y.deviceExport.getDeviceLiveContribution.useQuery;y.deviceExport.applyDeviceSettingsPatch.useMutation;y.deviceManager.allocateDeviceId.useMutation;y.deviceManager.migrateDevice.useMutation;y.deviceManager.registerDevice.useMutation;y.deviceManager.removeDevice.useMutation;y.deviceManager.persistConfig.useMutation;y.deviceManager.loadConfig.useQuery;y.deviceManager.loadRuntimeState.useQuery;y.deviceManager.loadMeta.useQuery;y.deviceManager.setName.useMutation;y.deviceManager.setLocation.useMutation;y.deviceManager.setType.useMutation;y.deviceManager.setIntegrationId.useMutation;y.deviceManager.setLinkDeviceId.useMutation;y.deviceManager.setPrimaryChildEntityId.useMutation;y.deviceManager.setChildLayout.useMutation;y.deviceManager.setDisplay.useMutation;var X_=y.deviceManager.getRoleDisplayDefaults.useQuery;y.deviceManager.setRoleDisplayDefaults.useMutation;y.deviceManager.getWireableFields.useQuery;y.deviceManager.setRole.useMutation;y.deviceManager.applyInitialMeta.useMutation;y.deviceManager.setMetadata.useMutation;y.deviceManager.listLocations.useQuery;y.deviceManager.addLocation.useMutation;y.deviceManager.removeLocation.useMutation;y.deviceManager.renameLocation.useMutation;y.deviceManager.listLocationIcons.useQuery;y.deviceManager.setLocationIcon.useMutation;y.deviceManager.listLocationDescriptions.useQuery;y.deviceManager.setLocationDescription.useMutation;y.deviceManager.listSiteZones.useQuery;y.deviceManager.setSiteZone.useMutation;y.deviceManager.removeSiteZone.useMutation;y.deviceManager.renameSiteZone.useMutation;y.deviceManager.setLocationZone.useMutation;y.deviceManager.setDisabled.useMutation;y.deviceManager.listPersistedByAddon.useQuery;y.deviceManager.listAll.useQuery;var J_=y.deviceManager.getDevice.useQuery;y.deviceManager.getChildren.useQuery;y.deviceManager.getChildrenBatch.useQuery;y.deviceManager.getLinkedDevices.useQuery;y.deviceManager.getLinkedDevicesBatch.useQuery;y.deviceManager.getStreamSources.useQuery;y.deviceManager.getConfigSchema.useQuery;y.deviceManager.getSettingsSchema.useQuery;y.deviceManager.updateConfig.useMutation;y.deviceManager.enable.useMutation;y.deviceManager.disable.useMutation;y.deviceManager.remove.useMutation;y.deviceManager.removeByIntegration.useMutation;y.deviceManager.getStreamProfileMap.useQuery;y.deviceManager.setStreamProfileMap.useMutation;y.deviceManager.probeStreams.useMutation;y.deviceManager.getBindings.useQuery;y.deviceManager.getBindingsBatch.useQuery;y.deviceManager.getAllBindings.useQuery;y.deviceManager.setWrapperActive.useMutation;y.deviceManager.listWrappersForCap.useQuery;y.deviceManager.listBindableCapsForDeviceType.useQuery;y.deviceManager.getDeviceSettingsAggregate.useQuery;y.deviceManager.getDeviceLiveInfoAggregate.useQuery;y.deviceManager.getDeviceAggregate.useQuery;y.deviceManager.runDeviceAction.useMutation;y.deviceManager.updateDeviceField.useMutation;y.deviceManager.updateDeviceFieldsBatch.useMutation;y.deviceManager.discoverDevices.useMutation;y.deviceManager.adoptDevice.useMutation;y.deviceManager.getCreationSchema.useQuery;y.deviceManager.createDevice.useMutation;y.deviceManager.testCreationField.useMutation;y.deviceManager.adoptionListCandidateFilters.useQuery;y.deviceManager.adoptionListCandidates.useQuery;y.deviceManager.adoptionRefresh.useMutation;y.deviceManager.adoptionAdopt.useMutation;y.deviceManager.adoptionRelease.useMutation;y.deviceManager.adoptionStartJob.useMutation;y.deviceManager.adoptionListJobs.useQuery;y.deviceManager.adoptionCancelJob.useMutation;y.deviceManager.adoptionResync.useMutation;y.deviceManager.discoveryProviders.useQuery;y.deviceManager.discoverAllProviders.useMutation;y.deviceManager.discoverProvider.useMutation;y.deviceManager.providerCreationType.useQuery;y.deviceManager.providerDiscoveryParamsSchema.useQuery;y.deviceManager.testField.useMutation;y.deviceManager.getDeviceStatusAggregate.useQuery;y.deviceManager.getDeviceStatusAggregateBatch.useQuery;y.deviceManager.getDeviceSettingsContribution.useQuery;y.deviceManager.getDeviceLiveContribution.useQuery;y.deviceManager.applyDeviceSettingsPatch.useMutation;y.deviceOps.getStreamSources.useQuery;y.deviceOps.getConfigEntries.useQuery;y.deviceOps.setConfig.useMutation;y.deviceOps.runAction.useMutation;y.deviceOps.removeDevice.useMutation;y.deviceOps.getSettingsSchema.useQuery;y.deviceOps.getRawState.useQuery;y.deviceProvider.start.useMutation;y.deviceProvider.stop.useMutation;y.deviceProvider.getStatus.useQuery;y.deviceProvider.getDevices.useQuery;y.deviceProvider.reloadDevice.useMutation;y.deviceProvider.supportsDiscovery.useQuery;y.deviceProvider.discoverDevices.useMutation;y.deviceProvider.getDiscoveryParamsSchema.useQuery;y.deviceProvider.getManualCreationType.useQuery;y.deviceProvider.adoptDiscoveredDevice.useMutation;y.deviceProvider.supportsManualCreation.useQuery;y.deviceProvider.getChildCreationSchema.useQuery;y.deviceProvider.createDevice.useMutation;y.deviceProvider.testCreationField.useMutation;y.deviceState.getSnapshot.useQuery;y.deviceState.getCapSlice.useQuery;y.deviceState.getAllSnapshots.useQuery;y.deviceState.setCapSlice.useMutation;y.deviceStatus.getStatus.useQuery;y.doorbell.getStatus.useQuery;y.doorbell.getDeviceSettingsContribution.useQuery;y.doorbell.getDeviceLiveContribution.useQuery;y.doorbell.applyDeviceSettingsPatch.useMutation;y.enumSensor.getStatus.useQuery;y.eventEmitter.getStatus.useQuery;y.events.getEvents.useQuery;y.events.getEventThumbnail.useQuery;y.events.getEventClipUrl.useQuery;y.faceGallery.listIdentities.useQuery;y.faceGallery.createIdentity.useMutation;y.faceGallery.renameIdentity.useMutation;y.faceGallery.deleteIdentity.useMutation;y.faceGallery.listIdentitySamples.useQuery;y.faceGallery.auditIdentitySamples.useQuery;y.faceGallery.removeSample.useMutation;y.faceGallery.listRecentFaces.useQuery;y.faceGallery.getFaceByTrack.useQuery;y.faceGallery.getFaceMedia.useQuery;y.faceGallery.assignFace.useMutation;y.faceGallery.unassignFace.useMutation;y.faceGallery.deleteFace.useMutation;y.faceGallery.assignFaces.useMutation;y.faceGallery.unassignFaces.useMutation;y.faceGallery.suggestFaceClusters.useQuery;y.fanControl.setPercentage.useMutation;y.fanControl.setPreset.useMutation;y.fanControl.setDirection.useMutation;y.fanControl.setOscillating.useMutation;y.fanControl.getStatus.useQuery;y.featureProbe.getStatus.useQuery;y.flood.getStatus.useQuery;y.gas.getStatus.useQuery;y.humidifier.setOn.useMutation;y.humidifier.setTargetHumidity.useMutation;y.humidifier.setMode.useMutation;y.humidifier.getStatus.useQuery;y.humiditySensor.getStatus.useQuery;y.image.getStatus.useQuery;y.imageSettings.getOptions.useQuery;y.imageSettings.setSettings.useMutation;y.imageSettings.getStatus.useQuery;y.integrations.list.useQuery;y.integrations.get.useQuery;y.integrations.getByAddonId.useQuery;y.integrations.create.useMutation;y.integrations.update.useMutation;y.integrations.delete.useMutation;y.integrations.getSettings.useQuery;y.integrations.setSettings.useMutation;y.integrations.getAvailableTypes.useQuery;y.integrations.testConnection.useMutation;var Vae=y.intercom.startSession.useMutation,Gae=y.intercom.handleAnswer.useMutation,Zae=y.intercom.stopSession.useMutation;y.intercom.startTalkSession.useMutation;y.intercom.pushTalkAudio.useMutation;y.intercom.endTalkSession.useMutation;y.intercom.getStatus.useQuery;y.lawnMowerControl.startMowing.useMutation;y.lawnMowerControl.pause.useMutation;y.lawnMowerControl.dock.useMutation;y.lawnMowerControl.getStatus.useQuery;y.llm.generate.useMutation;y.llm.generateVision.useMutation;y.llm.cancel.useMutation;y.llm.listProfileKinds.useQuery;y.llm.listProfiles.useQuery;y.llm.upsertProfile.useMutation;y.llm.deleteProfile.useMutation;y.llm.testProfile.useMutation;y.llm.listModels.useQuery;y.llm.getDefaults.useQuery;y.llm.setDefault.useMutation;y.llm.getUsage.useQuery;y.llm.listModelCatalog.useQuery;y.llm.listRuntimeNodes.useQuery;y.llm.listNodeModels.useQuery;y.llm.resolveModelRef.useMutation;y.llm.installModel.useMutation;y.llm.deleteModel.useMutation;y.llm.getRuntimeStatus.useQuery;y.llm.startRuntime.useMutation;y.llm.stopRuntime.useMutation;y.localNetwork.list.useQuery;y.localNetwork.getPreferred.useQuery;y.localNetwork.getConnectionEndpoints.useQuery;y.localNetwork.getNotificationEndpoint.useQuery;y.localNetwork.setNotificationEndpoint.useMutation;y.localNetwork.getViewerEndpoints.useQuery;y.localNetwork.setViewerEndpoints.useMutation;y.localNetwork.getAllowedAddresses.useQuery;y.localNetwork.setAllowedAddresses.useMutation;y.localNetwork.resetAllowlistToBestMatch.useMutation;y.localNetwork.getTlsStatus.useQuery;y.localNetwork.regenerateCertificate.useMutation;y.localNetwork.uploadCertificate.useMutation;y.localNetwork.downloadCa.useQuery;y.localNetwork.revertToGeneratedCertificate.useMutation;y.lockControl.lock.useMutation;y.lockControl.unlock.useMutation;y.lockControl.open.useMutation;y.lockControl.getStatus.useQuery;y.mediaPlayer.play.useMutation;y.mediaPlayer.pause.useMutation;y.mediaPlayer.stop.useMutation;y.mediaPlayer.next.useMutation;y.mediaPlayer.previous.useMutation;y.mediaPlayer.seek.useMutation;y.mediaPlayer.setVolume.useMutation;y.mediaPlayer.setMute.useMutation;y.mediaPlayer.setShuffle.useMutation;y.mediaPlayer.setRepeat.useMutation;y.mediaPlayer.selectSource.useMutation;y.mediaPlayer.playMedia.useMutation;y.mediaPlayer.getStatus.useQuery;y.meshNetwork.getStatus.useQuery;y.meshNetwork.join.useMutation;y.meshNetwork.startLogin.useMutation;y.meshNetwork.leave.useMutation;y.meshNetwork.logout.useMutation;y.meshNetwork.listPeers.useQuery;y.meshNetwork.testConnection.useMutation;y.metricsProvider.collectSnapshot.useQuery;y.metricsProvider.getCached.useQuery;y.metricsProvider.getCurrent.useQuery;y.metricsProvider.getDiskSpace.useQuery;y.metricsProvider.getGpuInfo.useQuery;y.metricsProvider.getCpuTemperature.useQuery;y.metricsProvider.getProcessStats.useQuery;y.metricsProvider.listAddonInstances.useQuery;y.metricsProvider.getAddonStats.useQuery;y.metricsProvider.listNodeProcesses.useQuery;y.metricsProvider.getLoadSeries.useQuery;y.motion.isDetected.useQuery;y.motion.getStatus.useQuery;y.motionDetection.analyze.useMutation;y.motionDetection.removeCamera.useMutation;y.motionDetection.reset.useMutation;y.motionDetection.getDeviceSettingsContribution.useQuery;y.motionDetection.getDeviceLiveContribution.useQuery;y.motionDetection.applyDeviceSettingsPatch.useMutation;y.motionTrigger.setMotionTrigger.useMutation;y.motionTrigger.getStatus.useQuery;y.motionZones.getOptions.useQuery;y.motionZones.setZone.useMutation;y.motionZones.getStatus.useQuery;y.mqttBroker.listBrokers.useQuery;y.mqttBroker.getBrokerConfig.useQuery;y.mqttBroker.addBroker.useMutation;y.mqttBroker.removeBroker.useMutation;y.mqttBroker.testConnection.useMutation;y.mqttBroker.startEmbeddedBroker.useMutation;y.mqttBroker.stopEmbeddedBroker.useMutation;y.mqttBroker.getStatus.useQuery;y.nativeObjectDetection.getOptions.useQuery;y.nativeObjectDetection.setSettings.useMutation;y.nativeObjectDetection.setEnabled.useMutation;y.nativeObjectDetection.getStatus.useQuery;y.navigation.move.useMutation;y.navigation.stop.useMutation;y.navigation.goToPoint.useMutation;y.navigation.listActions.useQuery;y.navigation.runAction.useMutation;y.navigation.playSound.useMutation;y.navigation.setLightOn.useMutation;y.navigation.setLightMode.useMutation;y.navigation.setLightLevel.useMutation;y.navigation.getFeatures.useQuery;y.navigation.getStatus.useQuery;y.networkAccess.start.useMutation;y.networkAccess.stop.useMutation;y.networkAccess.getEndpoint.useQuery;y.networkAccess.getStatus.useQuery;y.networkAccess.listEndpoints.useQuery;y.networkLink.getStatus.useQuery;y.networkQuality.getDeviceStats.useQuery;y.networkQuality.getAllStats.useQuery;y.networkQuality.reportClientStats.useMutation;y.nodes.topology.useQuery;y.nodes.deployAddon.useMutation;y.nodes.undeployAddon.useMutation;y.nodes.restartAddon.useMutation;y.nodes.restartProcess.useMutation;y.nodes.restartNode.useMutation;y.nodes.shutdownNode.useMutation;y.nodes.renameNode.useMutation;y.nodes.clusterAddonStatus.useQuery;y.nodes.getCapUsageGraph.useQuery;y.nodes.getNodeAddons.useQuery;y.nodes.setProcessLogLevel.useMutation;y.nodes.executeQuery.useMutation;y.notificationOutput.listTargetKinds.useQuery;y.notificationOutput.listTargets.useQuery;y.notificationOutput.discoverTargets.useQuery;y.notificationOutput.send.useMutation;y.notificationOutput.testTarget.useMutation;y.notificationOutput.upsertTarget.useMutation;y.notificationOutput.deleteTarget.useMutation;y.notificationOutput.setTargetEnabled.useMutation;y.notificationRules.listRules.useQuery;y.notificationRules.getRule.useQuery;y.notificationRules.createRule.useMutation;y.notificationRules.updateRule.useMutation;y.notificationRules.deleteRule.useMutation;y.notificationRules.setRuleEnabled.useMutation;y.notificationRules.getClipRetentionAsks.useQuery;y.notificationRules.listDeviceMutes.useQuery;y.notificationRules.setDeviceMuted.useMutation;y.notificationRules.testRule.useMutation;y.notificationRules.getConditionCatalog.useQuery;y.notificationRules.getHistory.useQuery;y.notificationRules.resolveArtifactUrl.useQuery;y.notificationRules.listSnoozes.useQuery;y.notificationRules.createSnooze.useMutation;y.notificationRules.cancelSnooze.useMutation;y.notificationRules.getAlarmConfig.useQuery;y.notificationRules.setAlarmConfig.useMutation;y.notifier.send.useMutation;y.notifier.cancel.useMutation;y.notifier.getStatus.useQuery;y.numericSensor.getStatus.useQuery;y.osd.setOverlay.useMutation;y.osd.getStatus.useQuery;y.osdManager.getDeviceOsd.useQuery;y.osdManager.getSourceCatalog.useQuery;y.osdManager.getConditionSupport.useQuery;y.osdManager.setSlotBinding.useMutation;y.osdManager.clearSlotBinding.useMutation;y.osdManager.copyDeviceConfiguration.useMutation;y.osdManager.previewSlot.useMutation;y.osdManager.renderDevice.useMutation;y.petFeeder.feed.useMutation;y.petFeeder.cancelFeed.useMutation;y.petFeeder.resetDesiccant.useMutation;y.petFeeder.markFoodReplenished.useMutation;y.petFeeder.callPet.useMutation;y.petFeeder.playSound.useMutation;y.petFeeder.setChildLock.useMutation;y.petFeeder.setIndicatorLight.useMutation;y.petFeeder.setFeedSound.useMutation;y.petFeeder.setVolume.useMutation;y.petFeeder.getStatus.useQuery;y.pipelineAnalytics.getActiveTracks.useQuery;y.pipelineAnalytics.getTrack.useQuery;y.pipelineAnalytics.listTracks.useQuery;y.pipelineAnalytics.listRecentTracks.useQuery;y.pipelineAnalytics.listSummaries.useQuery;y.pipelineAnalytics.listRecentSummaries.useQuery;y.pipelineAnalytics.getSummary.useQuery;y.pipelineAnalytics.clearTracks.useMutation;y.pipelineAnalytics.getMotionEvents.useQuery;y.pipelineAnalytics.getObjectEvents.useQuery;y.pipelineAnalytics.getAudioEvents.useQuery;y.pipelineAnalytics.listEventKinds.useQuery;y.pipelineAnalytics.listEventKindsBatch.useQuery;y.pipelineAnalytics.getSensorEvents.useQuery;y.pipelineAnalytics.getKeyEvents.useQuery;y.pipelineAnalytics.getKeyEventsBatch.useQuery;y.pipelineAnalytics.readLongTermSeries.useQuery;y.pipelineAnalytics.getEventDensity.useQuery;y.pipelineAnalytics.getEventDensityBatch.useQuery;y.pipelineAnalytics.pruneEventsBefore.useMutation;y.pipelineAnalytics.pruneTracksBefore.useMutation;y.pipelineAnalytics.wipeAllAnalytics.useMutation;y.pipelineAnalytics.reconcileFromDisk.useMutation;y.pipelineAnalytics.deleteTracks.useMutation;y.pipelineAnalytics.setTrackFlags.useMutation;y.pipelineAnalytics.listArchivedDebugNotes.useQuery;y.pipelineAnalytics.listBirthDecisions.useQuery;y.pipelineAnalytics.getEventStoreFootprint.useQuery;y.pipelineAnalytics.getEventMediaFootprintByKind.useQuery;y.pipelineAnalytics.pruneEvents.useMutation;y.pipelineAnalytics.deleteDeviceEvents.useMutation;y.pipelineAnalytics.pauseForStorageMigration.useMutation;y.pipelineAnalytics.resumeForStorageMigration.useMutation;y.pipelineAnalytics.refreshStorageLocationsForMigration.useMutation;y.pipelineAnalytics.startStorageMigrationMove.useMutation;y.pipelineAnalytics.getStorageMigrationMoveStatus.useQuery;y.pipelineAnalytics.cancelStorageMigrationMove.useMutation;y.pipelineAnalytics.relocateMedia.useMutation;y.pipelineAnalytics.countUnstampedEventMedia.useQuery;y.pipelineAnalytics.countRelocatableMedia.useQuery;y.pipelineAnalytics.listRelocateMediaJobs.useQuery;y.pipelineAnalytics.cancelRelocateMedia.useMutation;y.pipelineAnalytics.listOpsLog.useQuery;y.pipelineAnalytics.reclaimDebugMedia.useMutation;y.pipelineAnalytics.getMediaReclaimStatus.useQuery;y.pipelineAnalytics.getTrainingExportSummary.useQuery;y.pipelineAnalytics.getTrainingExportUrl.useQuery;y.pipelineAnalytics.listRetrainStaging.useQuery;y.pipelineAnalytics.listRetrainFrames.useQuery;y.pipelineAnalytics.selectRetrainFrames.useMutation;y.pipelineAnalytics.deselectRetrainFrame.useMutation;y.pipelineAnalytics.getRetrainFrameImage.useQuery;y.pipelineAnalytics.proposeRetrainAnnotations.useMutation;y.pipelineAnalytics.runReplayFrameProcessor.useMutation;y.pipelineAnalytics.listRetrainAnnotations.useQuery;y.pipelineAnalytics.saveRetrainAnnotations.useMutation;y.pipelineAnalytics.completeRetrainTrack.useMutation;y.pipelineAnalytics.restageRetrainTrack.useMutation;y.pipelineAnalytics.getRetrainExportUrl.useQuery;y.pipelineAnalytics.getEventMedia.useQuery;y.pipelineAnalytics.getTrackMedia.useQuery;y.pipelineAnalytics.listTrackMedia.useQuery;y.pipelineAnalytics.listEventMedia.useQuery;y.pipelineAnalytics.searchObjectEvents.useQuery;y.pipelineAnalytics.wipeObjectEmbeddings.useMutation;y.pipelineAnalytics.rebuildObjectEmbeddings.useMutation;y.pipelineAnalytics.getObjectEmbeddingRebuildStatus.useQuery;y.pipelineAnalytics.getDeviceSettingsContribution.useQuery;y.pipelineAnalytics.getDeviceLiveContribution.useQuery;y.pipelineAnalytics.applyDeviceSettingsPatch.useMutation;y.pipelineExecutor.getAvailableEngines.useQuery;y.pipelineExecutor.getSelectedEngine.useQuery;y.pipelineExecutor.getDefaultSteps.useQuery;y.pipelineExecutor.getEngineProvisioning.useQuery;y.pipelineExecutor.getVideoPipelineSteps.useQuery;y.pipelineExecutor.setVideoPipelineSteps.useMutation;y.pipelineExecutor.clearDeviceOverrides.useMutation;y.pipelineExecutor.getInferenceDeviceHealth.useQuery;y.pipelineExecutor.rearmInferenceDevice.useMutation;y.pipelineExecutor.getSchema.useQuery;y.pipelineExecutor.getGlobalSteps.useQuery;y.pipelineExecutor.getGlobalPipelineConfig.useQuery;y.pipelineExecutor.getOrchestratorConfigSchema.useQuery;y.pipelineExecutor.validatePipeline.useQuery;y.pipelineExecutor.listTemplates.useQuery;y.pipelineExecutor.saveTemplate.useMutation;y.pipelineExecutor.updateTemplate.useMutation;y.pipelineExecutor.deleteTemplate.useMutation;y.pipelineExecutor.getCapabilities.useQuery;y.pipelineExecutor.getAddonModels.useQuery;y.pipelineExecutor.downloadModel.useMutation;y.pipelineExecutor.deleteModel.useMutation;y.pipelineExecutor.runPipeline.useMutation;y.pipelineExecutor.runPipelineBatch.useMutation;y.pipelineExecutor.cacheFrameInPool.useMutation;y.pipelineExecutor.inferCached.useMutation;y.pipelineExecutor.uncacheFrame.useMutation;y.pipelineExecutor.getEffectiveTuning.useQuery;y.pipelineExecutor.listLoadedEngines.useQuery;y.pipelineExecutor.spinEngine.useMutation;y.pipelineExecutor.killEngine.useMutation;y.pipelineExecutor.listReferenceImages.useQuery;y.pipelineExecutor.getReferenceImage.useQuery;y.pipelineExecutor.getReferenceAudioFiles.useQuery;y.pipelineExecutor.getReferenceAudio.useQuery;y.pipelineExecutor.getAudioCapabilities.useQuery;y.pipelineExecutor.runAudioTest.useMutation;y.pipelineExecutor.getDetectionConfigSchema.useQuery;y.pipelineOrchestrator.pauseForStorageMigration.useMutation;y.pipelineOrchestrator.resumeForStorageMigration.useMutation;y.pipelineOrchestrator.assignPipeline.useMutation;y.pipelineOrchestrator.unassignPipeline.useMutation;y.pipelineOrchestrator.setPipelineDevicePin.useMutation;y.pipelineOrchestrator.getPipelineDevicePin.useQuery;y.pipelineOrchestrator.rebalance.useMutation;y.pipelineOrchestrator.getPipelineAssignments.useQuery;y.pipelineOrchestrator.getPipelineAssignment.useQuery;y.pipelineOrchestrator.getAgentLoad.useQuery;y.pipelineOrchestrator.getGlobalMetrics.useQuery;y.pipelineOrchestrator.getCameraMetrics.useQuery;y.pipelineOrchestrator.getCapabilityBindings.useQuery;y.pipelineOrchestrator.setCapabilityBinding.useMutation;y.pipelineOrchestrator.getIngestOwner.useQuery;y.pipelineOrchestrator.assignAudio.useMutation;y.pipelineOrchestrator.unassignAudio.useMutation;y.pipelineOrchestrator.getAudioAssignment.useQuery;y.pipelineOrchestrator.getAudioNodeLoad.useQuery;y.pipelineOrchestrator.getAudioAssignments.useQuery;y.pipelineOrchestrator.getAgentSettings.useQuery;y.pipelineOrchestrator.listAgentSettings.useQuery;y.pipelineOrchestrator.removeAgentSettings.useMutation;y.pipelineOrchestrator.setAgentMaxCameras.useMutation;y.pipelineOrchestrator.setAgentDetectWeight.useMutation;y.pipelineOrchestrator.setAgentCapabilities.useMutation;y.pipelineOrchestrator.setAgentDecodeLimits.useMutation;y.pipelineOrchestrator.setAgentReachableHost.useMutation;y.pipelineOrchestrator.setAgentInferenceDevices.useMutation;y.pipelineOrchestrator.getNodeInferenceDevices.useQuery;y.pipelineOrchestrator.resetNodePipelineDefaults.useMutation;y.pipelineOrchestrator.getCameraSettings.useQuery;y.pipelineOrchestrator.setCameraStepToggle.useMutation;y.pipelineOrchestrator.getCameraStepOverrides.useQuery;y.pipelineOrchestrator.setCameraStepOverride.useMutation;y.pipelineOrchestrator.setCameraPipelineForAgent.useMutation;y.pipelineOrchestrator.resolvePipeline.useQuery;y.pipelineOrchestrator.getCameraSwitches.useQuery;y.pipelineOrchestrator.setCameraSwitch.useMutation;y.pipelineOrchestrator.getCameraStatus.useQuery;y.pipelineOrchestrator.getCameraStatuses.useQuery;y.pipelineOrchestrator.reconcileFromDisk.useMutation;y.pipelineOrchestrator.getReconcileFromDiskStatus.useQuery;y.pipelineOrchestrator.listTemplates.useQuery;y.pipelineOrchestrator.saveTemplate.useMutation;y.pipelineOrchestrator.updateTemplate.useMutation;y.pipelineOrchestrator.deleteTemplate.useMutation;y.pipelineOrchestrator.getDeviceSettingsContribution.useQuery;y.pipelineOrchestrator.getDeviceLiveContribution.useQuery;y.pipelineOrchestrator.applyDeviceSettingsPatch.useMutation;y.pipelineRunner.attachCamera.useMutation;y.pipelineRunner.detachCamera.useMutation;y.pipelineRunner.reportMotion.useMutation;y.pipelineRunner.getLocalLoad.useQuery;y.pipelineRunner.getLocalMetrics.useQuery;y.pipelineRunner.getCameraMetrics.useQuery;y.pipelineRunner.getAllCameraMetrics.useQuery;y.pipelineRunner.getLocalCameras.useQuery;y.pipelineRunner.requestOccupancyBurst.useMutation;y.pipelineRunner.getNativeCrop.useQuery;y.pipelineRunner.runDetailSubtree.useMutation;y.pipelineRunner.runStatelessStep.useMutation;y.pipelineRunner.parkTrackFrame.useMutation;y.pipelineRunner.getParkedTrackFrame.useQuery;y.pipelineRunner.releaseParkedTrackFrames.useMutation;y.plateGallery.listPlates.useQuery;y.plateGallery.getPlateByTrack.useQuery;y.plateGallery.getPlateMedia.useQuery;y.plateGallery.searchPlates.useQuery;y.plateGallery.suggestPlateClusters.useQuery;y.plateGallery.correctPlateText.useMutation;y.plateGallery.deletePlate.useMutation;y.plateGallery.listVehicles.useQuery;y.plateGallery.createVehicle.useMutation;y.plateGallery.renameVehicle.useMutation;y.plateGallery.deleteVehicle.useMutation;y.plateGallery.listVehicleSamples.useQuery;y.plateGallery.removeVehicleSample.useMutation;y.plateGallery.assignPlate.useMutation;y.plateGallery.unassignPlate.useMutation;y.plateGallery.assignPlates.useMutation;y.plateGallery.unassignPlates.useMutation;y.powerMeter.getStatus.useQuery;y.presence.getStatus.useQuery;y.pressureSensor.getStatus.useQuery;y.privacyMask.getOptions.useQuery;y.privacyMask.setMask.useMutation;y.privacyMask.setAudioEnabled.useMutation;y.privacyMask.getStatus.useQuery;y.ptz.move.useMutation;y.ptz.continuousMove.useMutation;y.ptz.stop.useMutation;y.ptz.getPresets.useQuery;y.ptz.goToPreset.useMutation;y.ptz.savePreset.useMutation;y.ptz.deletePreset.useMutation;y.ptz.getOptions.useQuery;y.ptz.goHome.useMutation;y.ptz.getHomePreset.useQuery;y.ptz.setHomePreset.useMutation;y.ptz.captureHomeHere.useMutation;y.ptz.getHomeReturn.useQuery;y.ptz.setHomeReturn.useMutation;y.ptz.getPosition.useQuery;y.ptz.setAutofocus.useMutation;y.ptz.getStatus.useQuery;y.ptzAutotrack.getStatus.useQuery;y.ptzAutotrack.setEnabled.useMutation;y.ptzAutotrack.getSettings.useQuery;y.ptzAutotrack.setSettings.useMutation;y.reboot.reboot.useMutation;y.recording.getAvailability.useQuery;y.recording.getAvailabilityBatch.useQuery;y.recording.getDaysWithRecordings.useQuery;y.recording.getDaysWithRecordingsBatch.useQuery;y.recording.getPlaybackManifest.useQuery;y.recording.getStorageUsage.useQuery;y.recording.getDeviceConfig.useQuery;y.recording.locateSegment.useQuery;y.recording.readSegmentBytes.useQuery;y.recording.readGopBytes.useQuery;y.recording.readWindowBytes.useQuery;y.recording.setDeviceConfig.useMutation;y.recording.rescanStorage.useMutation;y.recording.pruneFootage.useMutation;y.recording.deleteFootprint.useMutation;y.recording.listOpsLog.useQuery;y.recording.renderGif.useMutation;y.recording.renderClip.useMutation;y.recording.pauseForStorageMigration.useMutation;y.recording.resumeForStorageMigration.useMutation;y.recording.refreshStorageLocationsForMigration.useMutation;y.recording.startStorageMigrationMove.useMutation;y.recording.getStorageMigrationMoveStatus.useQuery;y.recording.cancelStorageMigrationMove.useMutation;y.recording.relocateFootage.useMutation;y.recording.listRelocateJobs.useQuery;y.recording.getRelocateResidue.useQuery;y.recording.reconcileLedgerAgainstDisk.useMutation;y.recording.cancelRelocateJob.useMutation;y.recording.planStorageRebalance.useQuery;y.recording.startStorageRebalance.useMutation;y.recording.getPlacement.useQuery;y.recording.setDevicePlacement.useMutation;y.recording.getStatus.useQuery;y.recording.getDeviceSettingsContribution.useQuery;y.recording.getDeviceLiveContribution.useQuery;y.recording.applyDeviceSettingsPatch.useMutation;y.recordingExport.createExport.useMutation;y.recordingExport.listExports.useQuery;y.recordingExport.getExport.useQuery;y.recordingExport.cancelExport.useMutation;y.recordingExport.deleteExport.useMutation;y.recordingExport.getDownloadUrl.useQuery;y.recordingExport.readExportBytes.useQuery;y.recordingSignal.getStatus.useQuery;y.sceneMonitor.listScenes.useQuery;y.sceneMonitor.listScenesBatch.useQuery;y.sceneMonitor.createScene.useMutation;y.sceneMonitor.updateScene.useMutation;y.sceneMonitor.deleteScene.useMutation;y.sceneMonitor.captureReference.useMutation;y.sceneMonitor.deleteReference.useMutation;y.sceneMonitor.recheckNow.useMutation;y.sceneMonitor.resetScene.useMutation;y.sceneMonitor.getStatus.useQuery;y.scriptRunner.run.useMutation;y.scriptRunner.stop.useMutation;y.scriptRunner.getStatus.useQuery;y.serverManagement.getServerPackageStatus.useQuery;y.serverManagement.checkServerUpdate.useMutation;y.serverManagement.applyServerUpdate.useMutation;y.serverManagement.rollbackServerUpdate.useMutation;y.serverManagement.restartServer.useMutation;y.settingsStore.get.useQuery;y.settingsStore.set.useMutation;y.settingsStore.query.useQuery;y.settingsStore.upsert.useMutation;y.settingsStore.insert.useMutation;y.settingsStore.insertMany.useMutation;y.settingsStore.update.useMutation;y.settingsStore.delete.useMutation;y.settingsStore.deleteWhere.useMutation;y.settingsStore.updateWhere.useMutation;y.settingsStore.count.useQuery;y.settingsStore.aggregate.useQuery;y.settingsStore.histogram.useQuery;y.settingsStore.isEmpty.useQuery;y.settingsStore.declareCollection.useMutation;y.smoke.getStatus.useQuery;y.snapshot.getSnapshot.useQuery;y.snapshot.invalidateCache.useMutation;y.snapshot.getSnapshotOverview.useQuery;y.snapshot.getDebugState.useQuery;y.snapshot.getSnapshotLinks.useQuery;y.snapshot.getStatus.useQuery;y.snapshot.getDeviceSettingsContribution.useQuery;y.snapshot.getDeviceLiveContribution.useQuery;y.snapshot.applyDeviceSettingsPatch.useMutation;y.storage.resolve.useQuery;y.storage.write.useMutation;y.storage.read.useQuery;y.storage.exists.useQuery;y.storage.list.useQuery;y.storage.delete.useMutation;y.storage.getAvailableSpace.useQuery;y.storage.beginUpload.useMutation;y.storage.writeChunk.useMutation;y.storage.finalizeUpload.useMutation;y.storage.abortUpload.useMutation;y.storage.beginDownload.useMutation;y.storage.readChunk.useQuery;y.storage.endDownload.useMutation;y.storage.listLocations.useQuery;y.storage.listLocationDeclarations.useQuery;y.storage.upsertLocation.useMutation;y.storage.deleteLocation.useMutation;y.storage.listDrainProgress.useQuery;y.storage.testLocation.useQuery;y.storage.listProviders.useQuery;y.storage.testConfig.useQuery;y.storageMigration.plan.useQuery;y.storageMigration.start.useMutation;y.storageMigration.status.useQuery;y.storageMigration.cancel.useMutation;y.storageMigration.movers.useQuery;y.storageMigration.residue.useQuery;y.storageMigration.drain.useMutation;y.storageMigration.cleanupStart.useMutation;y.storageMigration.cleanupStatus.useQuery;y.storageMigration.cleanupCancel.useMutation;y.storageMigration.history.useQuery;y.streamBroker.reportStreamSignal.useMutation;y.streamBroker.publishCameraStream.useMutation;y.streamBroker.retractCameraStream.useMutation;y.streamBroker.assignProfile.useMutation;y.streamBroker.unassignProfile.useMutation;y.streamBroker.forgetDeviceHardware.useMutation;y.streamBroker.renderPreBufferClip.useMutation;y.streamBroker.produceEventMedia.useMutation;y.streamBroker.fetchEventMedia.useMutation;y.streamBroker.listAllCameraStreams.useQuery;y.streamBroker.listAllProfileSlots.useQuery;y.streamBroker.getBrokerStats.useQuery;y.streamBroker.probeStream.useMutation;y.streamBroker.listClients.useQuery;y.streamBroker.killClient.useMutation;y.streamBroker.restartProfile.useMutation;y.streamBroker.getStreamUrl.useQuery;y.streamBroker.getStreamWithCodec.useMutation;y.streamBroker.releaseStreamWithCodec.useMutation;y.streamBroker.acquireEgressTranscode.useMutation;y.streamBroker.releaseEgressTranscode.useMutation;y.streamBroker.subscribeAudioChunks.useMutation;y.streamBroker.pullAudioChunks.useQuery;y.streamBroker.unsubscribeAudioChunks.useMutation;y.streamBroker.subscribeFrames.useMutation;y.streamBroker.pullFrameHandles.useQuery;y.streamBroker.unsubscribeFrames.useMutation;y.streamBroker.setPreBufferDuration.useMutation;y.streamBroker.getPreBufferInfo.useQuery;y.streamBroker.getRtspPort.useQuery;y.streamBroker.getAllRtspEntries.useQuery;y.streamBroker.getRtspEntry.useQuery;y.streamBroker.regenerateRtspToken.useMutation;y.streamBroker.setRtspEnabled.useMutation;y.streamBroker.isRtspEnabled.useQuery;y.streamBroker.getDeviceAudioMute.useQuery;y.streamBroker.setDeviceAudioMute.useMutation;y.streamBroker.getDeviceSettingsContribution.useQuery;y.streamBroker.getDeviceLiveContribution.useQuery;y.streamBroker.applyDeviceSettingsPatch.useMutation;y.streamCatalog.getCatalog.useQuery;y.streamParams.getOptions.useQuery;y.streamParams.setProfile.useMutation;y.streamParams.getConfigSchema.useQuery;y.streamParams.getStatus.useQuery;y.streamSignals.listSignals.useQuery;y.switch.setState.useMutation;y.switch.getStatus.useQuery;y.system.info.useQuery;y.system.health.useQuery;y.system.featureFlags.useQuery;y.system.networkAddresses.useQuery;y.system.getRetentionConfig.useQuery;y.system.setRetentionConfig.useMutation;y.system.forceRetentionCleanup.useMutation;y.system.getSiteLocation.useQuery;y.system.setSiteLocation.useMutation;y.system.detectSiteLocation.useMutation;y.system.getRequestCensus.useQuery;y.system.getLoadContributions.useQuery;y.system.getFailureContributions.useQuery;y.system.getLoggingSettings.useQuery;y.system.setLoggingSettings.useMutation;y.tamper.getStatus.useQuery;y.temperatureSensor.getStatus.useQuery;y.terminalSession.listProfiles.useQuery;y.terminalSession.listInstances.useQuery;y.terminalSession.createInstance.useMutation;y.terminalSession.updateInstance.useMutation;y.terminalSession.deleteInstance.useMutation;y.terminalSession.setInstanceEnabled.useMutation;y.terminalSession.listLegacyCameras.useQuery;y.terminalSession.adoptLegacyMonitor.useMutation;y.terminalSession.listSessions.useQuery;y.terminalSession.openSession.useMutation;y.terminalSession.resize.useMutation;y.terminalSession.pullOutput.useMutation;y.terminalSession.writeInput.useMutation;y.terminalSession.close.useMutation;y.toast.onToast.useSubscription;y.turnProvider.getTurnServers.useQuery;y.update.installUpdate.useMutation;y.update.getStatus.useQuery;y.userManagement.listUsers.useQuery;y.userManagement.createUser.useMutation;y.userManagement.updateUser.useMutation;y.userManagement.deleteUser.useMutation;y.userManagement.resetPassword.useMutation;y.userManagement.setUserScopes.useMutation;y.userManagement.validateCredentials.useMutation;y.userManagement.listApiKeys.useQuery;y.userManagement.createApiKey.useMutation;y.userManagement.revokeApiKey.useMutation;y.userManagement.validateApiKey.useMutation;y.userManagement.createScopedToken.useMutation;y.userManagement.revokeScopedToken.useMutation;y.userManagement.validateScopedToken.useQuery;y.userManagement.listScopedTokens.useQuery;y.userManagement.setupTotp.useMutation;y.userManagement.confirmTotp.useMutation;y.userManagement.disableTotp.useMutation;y.userManagement.getTotpStatus.useQuery;y.userManagement.verifyTotp.useMutation;y.userManagement.oauthIssueCode.useMutation;y.userManagement.oauthExchangeCode.useMutation;y.userManagement.oauthRefresh.useMutation;y.userManagement.oauthVerifyAccessToken.useQuery;y.userManagement.listOauthSessions.useQuery;y.userManagement.revokeOauthSession.useMutation;y.vacuumControl.start.useMutation;y.vacuumControl.pause.useMutation;y.vacuumControl.stop.useMutation;y.vacuumControl.returnToBase.useMutation;y.vacuumControl.locate.useMutation;y.vacuumControl.setFanSpeed.useMutation;y.vacuumControl.getStatus.useQuery;y.valve.open.useMutation;y.valve.close.useMutation;y.valve.stop.useMutation;y.valve.setPosition.useMutation;y.valve.getStatus.useQuery;y.vibration.getStatus.useQuery;y.videoclips.listClips.useQuery;y.videoclips.getClipPlayback.useQuery;y.waterHeater.setTargetTemp.useMutation;y.waterHeater.setOperationMode.useMutation;y.waterHeater.setAway.useMutation;y.waterHeater.getStatus.useQuery;y.weather.getStatus.useQuery;y.webrtcSession.listStreams.useQuery;y.webrtcSession.createSession.useMutation;y.webrtcSession.handleOffer.useMutation;y.webrtcSession.handleAnswer.useMutation;y.webrtcSession.addIceCandidate.useMutation;y.webrtcSession.getIceCandidates.useQuery;y.webrtcSession.closeSession.useMutation;y.webrtcSession.hasAdaptiveBitrate.useQuery;y.webrtcSession.getSessionState.useQuery;y.webrtcSession.getSessionDebug.useQuery;y.zoneAnalytics.getCurrentSnapshot.useQuery;y.zoneAnalytics.getCurrentSnapshotBatch.useQuery;y.zoneAnalytics.getZoneHistory.useQuery;y.zoneAnalytics.getCameraHistory.useQuery;y.zoneAnalytics.getUnzonedHistory.useQuery;y.zoneRules.listRules.useQuery;y.zoneRules.setRules.useMutation;y.zones.listZones.useQuery;y.zones.addZone.useMutation;y.zones.removeZone.useMutation;y.zones.updateZone.useMutation;function e4(e){var t,n,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=e4(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function t4(){for(var e,t,n=0,a="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=e4(e))&&(a&&(a+=" "),a+=t);return a}var Kae=(e,t)=>{const n=new Array(e.length+t.length);for(let a=0;a<e.length;a++)n[a]=e[a];for(let a=0;a<t.length;a++)n[e.length+a]=t[a];return n},Wae=(e,t)=>({classGroupId:e,validator:t}),n4=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),um="-",pC=[],Yae="arbitrary..",Xae=e=>{const t=eie(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:f=>{if(f.startsWith("[")&&f.endsWith("]"))return Jae(f);const m=f.split(um);return a4(m,m[0]===""&&m.length>1?1:0,t)},getConflictingClassGroupIds:(f,m)=>{if(m){const h=a[f],c=n[f];return h?c?Kae(c,h):h:c||pC}return n[f]||pC}}},a4=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const a=e[t],s=n.nextPart.get(a);if(s){const h=a4(e,t+1,s);if(h)return h}const p=n.validators;if(p===null)return;const f=t===0?e.join(um):e.slice(t).join(um),m=p.length;for(let h=0;h<m;h++){const c=p[h];if(c.validator(f))return c.classGroupId}},Jae=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),a=t.slice(0,n);return a?Yae+a:void 0})(),eie=e=>{const{theme:t,classGroups:n}=e;return tie(n,t)},tie=(e,t)=>{const n=n4();for(const a in e){const s=e[a];C0(s,n,a,t)}return n},C0=(e,t,n,a)=>{const s=e.length;for(let p=0;p<s;p++){const f=e[p];nie(f,t,n,a)}},nie=(e,t,n,a)=>{if(typeof e=="string"){aie(e,t,n);return}if(typeof e=="function"){iie(e,t,n,a);return}rie(e,t,n,a)},aie=(e,t,n)=>{const a=e===""?t:i4(t,e);a.classGroupId=n},iie=(e,t,n,a)=>{if(oie(e)){C0(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(Wae(n,e))},rie=(e,t,n,a)=>{const s=Object.entries(e),p=s.length;for(let f=0;f<p;f++){const[m,h]=s[f];C0(h,i4(t,m),n,a)}},i4=(e,t)=>{let n=e;const a=t.split(um),s=a.length;for(let p=0;p<s;p++){const f=a[p];let m=n.nextPart.get(f);m||(m=n4(),n.nextPart.set(f,m)),n=m}return n},oie=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,sie=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),a=Object.create(null);const s=(p,f)=>{n[p]=f,t++,t>e&&(t=0,a=n,n=Object.create(null))};return{get(p){let f=n[p];if(f!==void 0)return f;if((f=a[p])!==void 0)return s(p,f),f},set(p,f){p in n?n[p]=f:s(p,f)}}},Ly="!",mC=":",lie=[],fC=(e,t,n,a,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:s}),cie=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=s=>{const p=[];let f=0,m=0,h=0,c;const x=s.length;for(let _=0;_<x;_++){const j=s[_];if(f===0&&m===0){if(j===mC){p.push(s.slice(h,_)),h=_+1;continue}if(j==="/"){c=_;continue}}j==="["?f++:j==="]"?f--:j==="("?m++:j===")"&&m--}const M=p.length===0?s:s.slice(h);let C=M,E=!1;M.endsWith(Ly)?(C=M.slice(0,-1),E=!0):M.startsWith(Ly)&&(C=M.slice(1),E=!0);const R=c&&c>h?c-h:void 0;return fC(p,E,C,R)};if(t){const s=t+mC,p=a;a=f=>f.startsWith(s)?p(f.slice(s.length)):fC(lie,!1,f,void 0,!0)}if(n){const s=a;a=p=>n({className:p,parseClassName:s})}return a},uie=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,a)=>{t.set(n,1e6+a)}),n=>{const a=[];let s=[];for(let p=0;p<n.length;p++){const f=n[p],m=f[0]==="[",h=t.has(f);m||h?(s.length>0&&(s.sort(),a.push(...s),s=[]),a.push(f)):s.push(f)}return s.length>0&&(s.sort(),a.push(...s)),a}},die=e=>({cache:sie(e.cacheSize),parseClassName:cie(e),sortModifiers:uie(e),postfixLookupClassGroupIds:pie(e),...Xae(e)}),pie=e=>{const t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let a=0;a<n.length;a++)t[n[a]]=!0;return t},mie=/\s+/,fie=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:s,sortModifiers:p,postfixLookupClassGroupIds:f}=t,m=[],h=e.trim().split(mie);let c="";for(let x=h.length-1;x>=0;x-=1){const M=h[x],{isExternal:C,modifiers:E,hasImportantModifier:R,baseClassName:_,maybePostfixModifierPosition:j}=n(M);if(C){c=M+(c.length>0?" "+c:c);continue}let D=!!j,z;if(D){z=a(_.substring(0,j));const V=z&&f[z]?a(_):void 0;V&&V!==z&&(z=V,D=!1)}else z=a(_);if(!z){if(!D){c=M+(c.length>0?" "+c:c);continue}if(z=a(_),!z){c=M+(c.length>0?" "+c:c);continue}D=!1}const B=E.length===0?"":E.length===1?E[0]:p(E).join(":"),L=R?B+Ly:B,G=L+z;if(m.indexOf(G)>-1)continue;m.push(G);const ae=s(z,D);for(let V=0;V<ae.length;++V){const F=ae[V];m.push(L+F)}c=M+(c.length>0?" "+c:c)}return c},hie=(...e)=>{let t=0,n,a,s="";for(;t<e.length;)(n=e[t++])&&(a=r4(n))&&(s&&(s+=" "),s+=a);return s},r4=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=r4(e[a]))&&(n&&(n+=" "),n+=t);return n},gie=(e,...t)=>{let n,a,s,p;const f=h=>(n=die(t.reduce((c,x)=>x(c),e())),a=n.cache.get,s=n.cache.set,p=m,m(h)),m=h=>{const c=a(h);if(c)return c;const x=fie(h,n);return s(h,x),x};return p=f,(...h)=>p(hie(...h))},vie=[],_n=e=>{const t=n=>n[e]||vie;return t.isThemeGetter=!0,t},o4=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,s4=/^\((?:(\w[\w-]*):)?(.+)\)$/i,yie=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,bie=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Sie=/\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$/,xie=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,kie=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,wie=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Nr=e=>yie.test(e),pt=e=>!!e&&!Number.isNaN(Number(e)),yi=e=>!!e&&Number.isInteger(Number(e)),Gg=e=>e.endsWith("%")&&pt(e.slice(0,-1)),Gi=e=>bie.test(e),l4=()=>!0,Mie=e=>Sie.test(e)&&!xie.test(e),A0=()=>!1,Cie=e=>kie.test(e),Aie=e=>wie.test(e),Eie=e=>!Pe(e)&&!Le(e),Rie=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)),Iie=e=>Zr(e,d4,A0),Pe=e=>o4.test(e),So=e=>Zr(e,p4,Mie),hC=e=>Zr(e,zie,pt),Tie=e=>Zr(e,f4,l4),_ie=e=>Zr(e,m4,A0),gC=e=>Zr(e,c4,A0),Nie=e=>Zr(e,u4,Aie),ep=e=>Zr(e,h4,Cie),Le=e=>s4.test(e),kc=e=>$o(e,p4),Oie=e=>$o(e,m4),vC=e=>$o(e,c4),jie=e=>$o(e,d4),Pie=e=>$o(e,u4),tp=e=>$o(e,h4,!0),Die=e=>$o(e,f4,!0),Zr=(e,t,n)=>{const a=o4.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},$o=(e,t,n=!1)=>{const a=s4.exec(e);return a?a[1]?t(a[1]):n:!1},c4=e=>e==="position"||e==="percentage",u4=e=>e==="image"||e==="url",d4=e=>e==="length"||e==="size"||e==="bg-size",p4=e=>e==="length",zie=e=>e==="number",m4=e=>e==="family-name",f4=e=>e==="number"||e==="weight",h4=e=>e==="shadow",Lie=()=>{const e=_n("color"),t=_n("font"),n=_n("text"),a=_n("font-weight"),s=_n("tracking"),p=_n("leading"),f=_n("breakpoint"),m=_n("container"),h=_n("spacing"),c=_n("radius"),x=_n("shadow"),M=_n("inset-shadow"),C=_n("text-shadow"),E=_n("drop-shadow"),R=_n("blur"),_=_n("perspective"),j=_n("aspect"),D=_n("ease"),z=_n("animate"),B=()=>["auto","avoid","all","avoid-page","page","left","right","column"],L=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],G=()=>[...L(),Le,Pe],ae=()=>["auto","hidden","clip","visible","scroll"],V=()=>["auto","contain","none"],F=()=>[Le,Pe,h],fe=()=>[Nr,"full","auto",...F()],ke=()=>[yi,"none","subgrid",Le,Pe],Me=()=>["auto",{span:["full",yi,Le,Pe]},yi,Le,Pe],Ae=()=>[yi,"auto",Le,Pe],Ee=()=>["auto","min","max","fr",Le,Pe],we=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ge=()=>["start","end","center","stretch","center-safe","end-safe"],Q=()=>["auto",...F()],oe=()=>[Nr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...F()],xe=()=>[Nr,"screen","full","dvw","lvw","svw","min","max","fit",...F()],Ie=()=>[Nr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...F()],he=()=>[e,Le,Pe],q=()=>[...L(),vC,gC,{position:[Le,Pe]}],W=()=>["no-repeat",{repeat:["","x","y","space","round"]}],le=()=>["auto","cover","contain",jie,Iie,{size:[Le,Pe]}],be=()=>[Gg,kc,So],ee=()=>["","none","full",c,Le,Pe],ve=()=>["",pt,kc,So],De=()=>["solid","dashed","dotted","double"],Fe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],re=()=>[pt,Gg,vC,gC],Te=()=>["","none",R,Le,Pe],Je=()=>["none",pt,Le,Pe],Ze=()=>["none",pt,Le,Pe],It=()=>[pt,Le,Pe],_e=()=>[Nr,"full",...F()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Gi],breakpoint:[Gi],color:[l4],container:[Gi],"drop-shadow":[Gi],ease:["in","out","in-out"],font:[Eie],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Gi],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Gi],shadow:[Gi],spacing:["px",pt],text:[Gi],"text-shadow":[Gi],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Nr,Pe,Le,j]}],container:["container"],"container-type":[{"@container":["","normal","size",Le,Pe]}],"container-named":[Rie],columns:[{columns:[pt,Pe,Le,m]}],"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:G()}],overflow:[{overflow:ae()}],"overflow-x":[{"overflow-x":ae()}],"overflow-y":[{"overflow-y":ae()}],overscroll:[{overscroll:V()}],"overscroll-x":[{"overscroll-x":V()}],"overscroll-y":[{"overscroll-y":V()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:fe()}],"inset-x":[{"inset-x":fe()}],"inset-y":[{"inset-y":fe()}],start:[{"inset-s":fe(),start:fe()}],end:[{"inset-e":fe(),end:fe()}],"inset-bs":[{"inset-bs":fe()}],"inset-be":[{"inset-be":fe()}],top:[{top:fe()}],right:[{right:fe()}],bottom:[{bottom:fe()}],left:[{left:fe()}],visibility:["visible","invisible","collapse"],z:[{z:[yi,"auto",Le,Pe]}],basis:[{basis:[Nr,"full","auto",m,...F()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[pt,Nr,"auto","initial","none",Pe]}],grow:[{grow:["",pt,Le,Pe]}],shrink:[{shrink:["",pt,Le,Pe]}],order:[{order:[yi,"first","last","none",Le,Pe]}],"grid-cols":[{"grid-cols":ke()}],"col-start-end":[{col:Me()}],"col-start":[{"col-start":Ae()}],"col-end":[{"col-end":Ae()}],"grid-rows":[{"grid-rows":ke()}],"row-start-end":[{row:Me()}],"row-start":[{"row-start":Ae()}],"row-end":[{"row-end":Ae()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Ee()}],"auto-rows":[{"auto-rows":Ee()}],gap:[{gap:F()}],"gap-x":[{"gap-x":F()}],"gap-y":[{"gap-y":F()}],"justify-content":[{justify:[...we(),"normal"]}],"justify-items":[{"justify-items":[...ge(),"normal"]}],"justify-self":[{"justify-self":["auto",...ge()]}],"align-content":[{content:["normal",...we()]}],"align-items":[{items:[...ge(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ge(),{baseline:["","last"]}]}],"place-content":[{"place-content":we()}],"place-items":[{"place-items":[...ge(),"baseline"]}],"place-self":[{"place-self":["auto",...ge()]}],p:[{p:F()}],px:[{px:F()}],py:[{py:F()}],ps:[{ps:F()}],pe:[{pe:F()}],pbs:[{pbs:F()}],pbe:[{pbe:F()}],pt:[{pt:F()}],pr:[{pr:F()}],pb:[{pb:F()}],pl:[{pl:F()}],m:[{m:Q()}],mx:[{mx:Q()}],my:[{my:Q()}],ms:[{ms:Q()}],me:[{me:Q()}],mbs:[{mbs:Q()}],mbe:[{mbe:Q()}],mt:[{mt:Q()}],mr:[{mr:Q()}],mb:[{mb:Q()}],ml:[{ml:Q()}],"space-x":[{"space-x":F()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":F()}],"space-y-reverse":["space-y-reverse"],size:[{size:oe()}],"inline-size":[{inline:["auto",...xe()]}],"min-inline-size":[{"min-inline":["auto",...xe()]}],"max-inline-size":[{"max-inline":["none",...xe()]}],"block-size":[{block:["auto",...Ie()]}],"min-block-size":[{"min-block":["auto",...Ie()]}],"max-block-size":[{"max-block":["none",...Ie()]}],w:[{w:[m,"screen",...oe()]}],"min-w":[{"min-w":[m,"screen","none",...oe()]}],"max-w":[{"max-w":[m,"screen","none","prose",{screen:[f]},...oe()]}],h:[{h:["screen","lh",...oe()]}],"min-h":[{"min-h":["screen","lh","none",...oe()]}],"max-h":[{"max-h":["screen","lh",...oe()]}],"font-size":[{text:["base",n,kc,So]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,Die,Tie]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Gg,Pe]}],"font-family":[{font:[Oie,_ie,t]}],"font-features":[{"font-features":[Pe]}],"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:[s,Le,Pe]}],"line-clamp":[{"line-clamp":[pt,"none",Le,hC]}],leading:[{leading:[p,...F()]}],"list-image":[{"list-image":["none",Le,Pe]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Le,Pe]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:he()}],"text-color":[{text:he()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...De(),"wavy"]}],"text-decoration-thickness":[{decoration:[pt,"from-font","auto",Le,So]}],"text-decoration-color":[{decoration:he()}],"underline-offset":[{"underline-offset":[pt,"auto",Le,Pe]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:F()}],"tab-size":[{tab:[yi,Le,Pe]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Le,Pe]}],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",Le,Pe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:q()}],"bg-repeat":[{bg:W()}],"bg-size":[{bg:le()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},yi,Le,Pe],radial:["",Le,Pe],conic:[yi,Le,Pe]},Pie,Nie]}],"bg-color":[{bg:he()}],"gradient-from-pos":[{from:be()}],"gradient-via-pos":[{via:be()}],"gradient-to-pos":[{to:be()}],"gradient-from":[{from:he()}],"gradient-via":[{via:he()}],"gradient-to":[{to:he()}],rounded:[{rounded:ee()}],"rounded-s":[{"rounded-s":ee()}],"rounded-e":[{"rounded-e":ee()}],"rounded-t":[{"rounded-t":ee()}],"rounded-r":[{"rounded-r":ee()}],"rounded-b":[{"rounded-b":ee()}],"rounded-l":[{"rounded-l":ee()}],"rounded-ss":[{"rounded-ss":ee()}],"rounded-se":[{"rounded-se":ee()}],"rounded-ee":[{"rounded-ee":ee()}],"rounded-es":[{"rounded-es":ee()}],"rounded-tl":[{"rounded-tl":ee()}],"rounded-tr":[{"rounded-tr":ee()}],"rounded-br":[{"rounded-br":ee()}],"rounded-bl":[{"rounded-bl":ee()}],"border-w":[{border:ve()}],"border-w-x":[{"border-x":ve()}],"border-w-y":[{"border-y":ve()}],"border-w-s":[{"border-s":ve()}],"border-w-e":[{"border-e":ve()}],"border-w-bs":[{"border-bs":ve()}],"border-w-be":[{"border-be":ve()}],"border-w-t":[{"border-t":ve()}],"border-w-r":[{"border-r":ve()}],"border-w-b":[{"border-b":ve()}],"border-w-l":[{"border-l":ve()}],"divide-x":[{"divide-x":ve()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ve()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...De(),"hidden","none"]}],"divide-style":[{divide:[...De(),"hidden","none"]}],"border-color":[{border:he()}],"border-color-x":[{"border-x":he()}],"border-color-y":[{"border-y":he()}],"border-color-s":[{"border-s":he()}],"border-color-e":[{"border-e":he()}],"border-color-bs":[{"border-bs":he()}],"border-color-be":[{"border-be":he()}],"border-color-t":[{"border-t":he()}],"border-color-r":[{"border-r":he()}],"border-color-b":[{"border-b":he()}],"border-color-l":[{"border-l":he()}],"divide-color":[{divide:he()}],"outline-style":[{outline:[...De(),"none","hidden"]}],"outline-offset":[{"outline-offset":[pt,Le,Pe]}],"outline-w":[{outline:["",pt,kc,So]}],"outline-color":[{outline:he()}],shadow:[{shadow:["","none",x,tp,ep]}],"shadow-color":[{shadow:he()}],"inset-shadow":[{"inset-shadow":["none",M,tp,ep]}],"inset-shadow-color":[{"inset-shadow":he()}],"ring-w":[{ring:ve()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:he()}],"ring-offset-w":[{"ring-offset":[pt,So]}],"ring-offset-color":[{"ring-offset":he()}],"inset-ring-w":[{"inset-ring":ve()}],"inset-ring-color":[{"inset-ring":he()}],"text-shadow":[{"text-shadow":["none",C,tp,ep]}],"text-shadow-color":[{"text-shadow":he()}],opacity:[{opacity:[pt,Le,Pe]}],"mix-blend":[{"mix-blend":[...Fe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Fe()}],"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":[pt]}],"mask-image-linear-from-pos":[{"mask-linear-from":re()}],"mask-image-linear-to-pos":[{"mask-linear-to":re()}],"mask-image-linear-from-color":[{"mask-linear-from":he()}],"mask-image-linear-to-color":[{"mask-linear-to":he()}],"mask-image-t-from-pos":[{"mask-t-from":re()}],"mask-image-t-to-pos":[{"mask-t-to":re()}],"mask-image-t-from-color":[{"mask-t-from":he()}],"mask-image-t-to-color":[{"mask-t-to":he()}],"mask-image-r-from-pos":[{"mask-r-from":re()}],"mask-image-r-to-pos":[{"mask-r-to":re()}],"mask-image-r-from-color":[{"mask-r-from":he()}],"mask-image-r-to-color":[{"mask-r-to":he()}],"mask-image-b-from-pos":[{"mask-b-from":re()}],"mask-image-b-to-pos":[{"mask-b-to":re()}],"mask-image-b-from-color":[{"mask-b-from":he()}],"mask-image-b-to-color":[{"mask-b-to":he()}],"mask-image-l-from-pos":[{"mask-l-from":re()}],"mask-image-l-to-pos":[{"mask-l-to":re()}],"mask-image-l-from-color":[{"mask-l-from":he()}],"mask-image-l-to-color":[{"mask-l-to":he()}],"mask-image-x-from-pos":[{"mask-x-from":re()}],"mask-image-x-to-pos":[{"mask-x-to":re()}],"mask-image-x-from-color":[{"mask-x-from":he()}],"mask-image-x-to-color":[{"mask-x-to":he()}],"mask-image-y-from-pos":[{"mask-y-from":re()}],"mask-image-y-to-pos":[{"mask-y-to":re()}],"mask-image-y-from-color":[{"mask-y-from":he()}],"mask-image-y-to-color":[{"mask-y-to":he()}],"mask-image-radial":[{"mask-radial":[Le,Pe]}],"mask-image-radial-from-pos":[{"mask-radial-from":re()}],"mask-image-radial-to-pos":[{"mask-radial-to":re()}],"mask-image-radial-from-color":[{"mask-radial-from":he()}],"mask-image-radial-to-color":[{"mask-radial-to":he()}],"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":L()}],"mask-image-conic-pos":[{"mask-conic":[pt]}],"mask-image-conic-from-pos":[{"mask-conic-from":re()}],"mask-image-conic-to-pos":[{"mask-conic-to":re()}],"mask-image-conic-from-color":[{"mask-conic-from":he()}],"mask-image-conic-to-color":[{"mask-conic-to":he()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:q()}],"mask-repeat":[{mask:W()}],"mask-size":[{mask:le()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Le,Pe]}],filter:[{filter:["","none",Le,Pe]}],blur:[{blur:Te()}],brightness:[{brightness:[pt,Le,Pe]}],contrast:[{contrast:[pt,Le,Pe]}],"drop-shadow":[{"drop-shadow":["","none",E,tp,ep]}],"drop-shadow-color":[{"drop-shadow":he()}],grayscale:[{grayscale:["",pt,Le,Pe]}],"hue-rotate":[{"hue-rotate":[pt,Le,Pe]}],invert:[{invert:["",pt,Le,Pe]}],saturate:[{saturate:[pt,Le,Pe]}],sepia:[{sepia:["",pt,Le,Pe]}],"backdrop-filter":[{"backdrop-filter":["","none",Le,Pe]}],"backdrop-blur":[{"backdrop-blur":Te()}],"backdrop-brightness":[{"backdrop-brightness":[pt,Le,Pe]}],"backdrop-contrast":[{"backdrop-contrast":[pt,Le,Pe]}],"backdrop-grayscale":[{"backdrop-grayscale":["",pt,Le,Pe]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[pt,Le,Pe]}],"backdrop-invert":[{"backdrop-invert":["",pt,Le,Pe]}],"backdrop-opacity":[{"backdrop-opacity":[pt,Le,Pe]}],"backdrop-saturate":[{"backdrop-saturate":[pt,Le,Pe]}],"backdrop-sepia":[{"backdrop-sepia":["",pt,Le,Pe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":F()}],"border-spacing-x":[{"border-spacing-x":F()}],"border-spacing-y":[{"border-spacing-y":F()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Le,Pe]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[pt,"initial",Le,Pe]}],ease:[{ease:["linear","initial",D,Le,Pe]}],delay:[{delay:[pt,Le,Pe]}],animate:[{animate:["none",z,Le,Pe]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[_,Le,Pe]}],"perspective-origin":[{"perspective-origin":G()}],rotate:[{rotate:Je()}],"rotate-x":[{"rotate-x":Je()}],"rotate-y":[{"rotate-y":Je()}],"rotate-z":[{"rotate-z":Je()}],scale:[{scale:Ze()}],"scale-x":[{"scale-x":Ze()}],"scale-y":[{"scale-y":Ze()}],"scale-z":[{"scale-z":Ze()}],"scale-3d":["scale-3d"],skew:[{skew:It()}],"skew-x":[{"skew-x":It()}],"skew-y":[{"skew-y":It()}],transform:[{transform:[Le,Pe,"","none","gpu","cpu"]}],"transform-origin":[{origin:G()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:_e()}],"translate-x":[{"translate-x":_e()}],"translate-y":[{"translate-y":_e()}],"translate-z":[{"translate-z":_e()}],"translate-none":["translate-none"],zoom:[{zoom:[yi,Le,Pe]}],accent:[{accent:he()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:he()}],"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",Le,Pe]}],"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":he()}],"scrollbar-track-color":[{"scrollbar-track":he()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":F()}],"scroll-mx":[{"scroll-mx":F()}],"scroll-my":[{"scroll-my":F()}],"scroll-ms":[{"scroll-ms":F()}],"scroll-me":[{"scroll-me":F()}],"scroll-mbs":[{"scroll-mbs":F()}],"scroll-mbe":[{"scroll-mbe":F()}],"scroll-mt":[{"scroll-mt":F()}],"scroll-mr":[{"scroll-mr":F()}],"scroll-mb":[{"scroll-mb":F()}],"scroll-ml":[{"scroll-ml":F()}],"scroll-p":[{"scroll-p":F()}],"scroll-px":[{"scroll-px":F()}],"scroll-py":[{"scroll-py":F()}],"scroll-ps":[{"scroll-ps":F()}],"scroll-pe":[{"scroll-pe":F()}],"scroll-pbs":[{"scroll-pbs":F()}],"scroll-pbe":[{"scroll-pbe":F()}],"scroll-pt":[{"scroll-pt":F()}],"scroll-pr":[{"scroll-pr":F()}],"scroll-pb":[{"scroll-pb":F()}],"scroll-pl":[{"scroll-pl":F()}],"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",Le,Pe]}],fill:[{fill:["none",...he()]}],"stroke-w":[{stroke:[pt,kc,So,hC]}],stroke:[{stroke:["none",...he()]}],"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"]}},qie=gie(Lie);function se(...e){return qie(t4(e))}T.createContext(null);Ci("camstack:custom-field-renderers",{});var yC={motion:I_,audio:Au,person:zae,vehicle:Vg,animal:_a,package:mae,sensor:vae,control:M0,car:Vg,truck:jae,bus:qne,motorcycle:aC,bicycle:aC,airplane:gae,boat:bae,train:Nae,bird:iC,cat:oC,dog:cC,horse:_a,sheep:_a,cow:_a,elephant:_a,bear:_a,zebra:_a,giraffe:_a,door:dl,pir:U_,smoke:lm,water:S0,gas:er,vibration:G_,tamper:qm,presence:Dae,generic:V_,lock:ku,siren:cm,switch:Tae,doorbell:Qg,button:__,"audio-speech":q_,"audio-scream":L_,"audio-crying":One,"audio-laughter":nae,"audio-music":F_,"audio-dog":cC,"audio-cat":oC,"audio-bird":iC,"audio-animal":_a,"audio-alarm":Qg,"audio-doorbell":Qg,"audio-glass_breaking":pl,"audio-gunshot":j_,"audio-vehicle":Vg,"audio-siren":cm,"audio-fire":lm,"audio-water":bl,"audio-wind":er,"audio-door":dl,"audio-footsteps":D_,"audio-crowd":Lae,"audio-telephone":fae,"audio-engine":Gne,"audio-tools":Jne,"audio-silence":Z_};function bC(e){return Object.hasOwn(yC,e)?yC[e]:e.startsWith("audio-")?Au:V_}Ci("camstack:confirm-dialog",null);Ci("camstack:device-context",null);var Bie="FEDERATION_DEBUG",qy=(function(e){return e[e.UNKNOWN=1]="UNKNOWN",e[e.CALCULATED=2]="CALCULATED",e[e.NO_USE=0]="NO_USE",e})({}),Kr=typeof ENV_TARGET<"u"?ENV_TARGET==="web":typeof window<"u"&&typeof window.document<"u";function g4(){return Kr}function v4(){return typeof navigator<"u"&&navigator?.product==="ReactNative"}function Fie(){try{if(g4()&&window.localStorage)return!!localStorage.getItem(Bie)}catch{return!1}return!1}function By(){return typeof process<"u"&&$g&&$g.FEDERATION_DEBUG?!!$g.FEDERATION_DEBUG:typeof FEDERATION_DEBUG<"u"&&FEDERATION_DEBUG?!0:Fie()}var Uie="[ Federation Runtime ]",y4=function(...e){return e.length?e.reduce((t,n)=>n?t?`${t}:${n}`:n:t,""):""},Fy=(e,t)=>{if("getPublicPath"in e){let n;return e.getPublicPath.startsWith("function")?n=new Function("return "+e.getPublicPath)()():n=new Function(e.getPublicPath)(),`${n}${t}`}else return"publicPath"in e?!g4()&&!v4()&&"ssrPublicPath"in e&&typeof e.ssrPublicPath=="string"?`${e.ssrPublicPath}${t}`:`${e.publicPath}${t}`:(console.warn("Cannot get resource URL. If in debug mode, please ignore.",e,t),"")},b4=e=>{console.warn(`${Uie}: ${e}`)};function S4(e){try{return JSON.stringify(e,null,2)}catch{return""}}var Zg=(e,t)=>{if(!e)return t;const a=(s=>{if(s===".")return"";if(s.startsWith("./"))return s.replace("./","");if(s.startsWith("/")){const p=s.slice(1);return p.endsWith("/")?p.slice(0,-1):p}return s})(e);return a?a.endsWith("/")?`${a}${t}`:`${a}/${t}`:t};function Hie(e){return e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")}function $ie(e,t={}){const{remotes:n={},overrides:a={},version:s}=t;let p;const f=()=>"publicPath"in e.metaData?(e.metaData.publicPath==="auto"||e.metaData.publicPath==="")&&s?Hie(s):e.metaData.publicPath:e.metaData.getPublicPath,m=Object.keys(a);let h={};Object.keys(n).length||(h=e.remotes?.reduce((z,B)=>{let L;const G=B.federationContainerName;return m.includes(G)?L=a[G]:"version"in B?L=B.version:L=B.entry,z[G]={matchedVersion:L},z},{})||{}),Object.keys(n).forEach(z=>h[z]={matchedVersion:m.includes(z)?a[z]:n[z]});const{remoteEntry:{path:c,name:x,type:M},types:C={path:"",name:"",zip:"",api:""},buildInfo:{buildVersion:E},globalName:R,ssrRemoteEntry:_}=e.metaData,{exposes:j}=e;let D={version:s||"",buildVersion:E,globalName:R,remoteEntry:Zg(c,x),remoteEntryType:M,remoteTypes:Zg(C.path,C.name),remoteTypesZip:C.zip||"",remoteTypesAPI:C.api||"",remotesInfo:h,shared:e?.shared.map(z=>({assets:z.assets,sharedName:z.name,version:z.version,usedExports:z.referenceExports||[]})),modules:j?.map(z=>({moduleName:z.name,modulePath:z.path,assets:z.assets}))};if("publicPath"in e.metaData?(p={...D,publicPath:f()},typeof e.metaData.ssrPublicPath=="string"&&(p.ssrPublicPath=e.metaData.ssrPublicPath)):p={...D,getPublicPath:f()},_){const z=Zg(_.path,_.name);p.ssrRemoteEntry=z,p.ssrRemoteEntryType=_.type||"commonjs-module"}return p}function x4(e){return!!("remoteEntry"in e&&e.remoteEntry.includes(".json"))}var Qie="[ Module Federation ]",wc=console,Vie=["logger.ts","logger.js","captureStackTrace","Logger.emit","Logger.log","Logger.info","Logger.warn","Logger.error","Logger.debug"];function Gie(){try{const e=new Error().stack;if(!e)return;const[,...t]=e.split(`
75
- `),n=t.filter(a=>!Vie.some(s=>a.includes(s)));return n.length?`Stack trace:
76
- ${n.slice(0,5).join(`
77
- `)}`:void 0}catch{return}}var k4=class{constructor(e,t=wc){this.prefix=e,this.delegate=t??wc}setPrefix(e){this.prefix=e}setDelegate(e){this.delegate=e??wc}emit(e,t){const n=this.delegate,a=By()?Gie():void 0,s=a?[...t,a]:t,p=(()=>{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(const f of p){const m=n[f];if(typeof m=="function"){m.call(n,this.prefix,...s);return}}for(const f of p){const m=wc[f];if(typeof m=="function"){m.call(wc,this.prefix,...s);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){By()&&this.emit("debug",e)}};function Zie(e){return new k4(e)}function Kie(e){const t=new k4(e);return Object.defineProperty(t,"__mf_infrastructure_logger__",{value:!0,enumerable:!1,configurable:!1}),t}Kie(Qie);async function w4(e,t){try{return await e()}catch(n){b4(n);return}}function Uy(e,t){const n=/^(https?:)?\/\//i;return e.replace(n,"").replace(/\/$/,"")===t.replace(n,"").replace(/\/$/,"")}function M4(e){let t=null,n=!0,a=2e4,s;const p=document.getElementsByTagName("script");for(let c=0;c<p.length;c++){const x=p[c],M=x.getAttribute("src");if(M&&Uy(M,e.url)){t=x,n=!1;break}}if(!t){const c=e.attrs;t=document.createElement("script"),t.type=c?.type==="module"?"module":"text/javascript";let x;e.createScriptHook&&(x=e.createScriptHook(e.url,e.attrs),x instanceof HTMLScriptElement?t=x:typeof x=="object"&&("script"in x&&x.script&&(t=x.script),"timeout"in x&&x.timeout&&(a=x.timeout))),t.src||(t.src=e.url),c&&!x&&Object.keys(c).forEach(M=>{t&&(M==="async"||M==="defer"?t[M]=c[M]:t.getAttribute(M)||t.setAttribute(M,c[M]))})}let f=null;const m=typeof window<"u"?c=>{if(c.filename&&Uy(c.filename,e.url)){const x=new Error(`ScriptExecutionError: Script "${e.url}" loaded but threw a runtime error during execution: ${c.message} (${c.filename}:${c.lineno}:${c.colno})`);x.name="ScriptExecutionError",f=x}}:null;m&&window.addEventListener("error",m);const h=async(c,x)=>{clearTimeout(s),m&&window.removeEventListener("error",m);const M=()=>{if(x?.type==="error"){const C=new Error(x?.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.)`);C.name="ScriptNetworkError",e?.onErrorCallback&&e?.onErrorCallback(C)}else f?e?.onErrorCallback&&e?.onErrorCallback(f):e?.cb&&e?.cb()};if(t&&(t.onerror=null,t.onload=null,w4(()=>{const{needDeleteScript:C=!0}=e;C&&t?.parentNode&&t.parentNode.removeChild(t)}),c&&typeof c=="function")){const C=c(x);if(C instanceof Promise){const E=await C;return M(),E}return M(),C}M()};return t.onerror=h.bind(null,t.onerror),t.onload=h.bind(null,t.onload),s=setTimeout(()=>{h(null,{type:"error",isTimeout:!0})},a),{script:t,needAttach:n}}function Wie(e){let t=null,n=!0,a=2e4,s;const p=document.getElementsByTagName("link");for(let m=0;m<p.length;m++){const h=p[m],c=h.getAttribute("href"),x=h.getAttribute("rel");if(c&&Uy(c,e.url)&&x===e.attrs.rel){t=h,n=!1;break}}if(!t){t=document.createElement("link"),t.setAttribute("href",e.url);let m,h=!0;const c=e.attrs;e.createLinkHook&&(m=e.createLinkHook(e.url,c),m instanceof HTMLLinkElement?(t=m,h=!1):typeof m=="object"&&("link"in m&&m.link&&(t=m.link,h=!1),"timeout"in m&&m.timeout&&(a=m.timeout))),c&&h&&Object.keys(c).forEach(x=>{t&&!t.getAttribute(x)&&t.setAttribute(x,c[x])})}if(!n)return Promise.resolve().then(()=>{e?.cb&&e?.cb()}),{link:t,needAttach:n};const f=(m,h)=>{s&&clearTimeout(s);const c=()=>{if(h?.type==="error"){const x=new Error(h?.isTimeout?`LinkNetworkError: Link "${e.url}" timed out.`:`LinkNetworkError: Failed to load link "${e.url}" - the URL is unreachable or the server returned an error.`);x.name="LinkNetworkError",e?.onErrorCallback&&e?.onErrorCallback(x)}else e?.cb&&e?.cb()};if(t&&(t.onerror=null,t.onload=null,w4(()=>{const{needDeleteLink:x=!0}=e;x&&t?.parentNode&&t.parentNode.removeChild(t)}),m)){const x=m(h);return c(),x}c()};return t.onerror=f.bind(null,t.onerror),t.onload=f.bind(null,t.onload),s=setTimeout(()=>{f(null,{type:"error",isTimeout:!0})},a),{link:t,needAttach:n}}function Yie(e,t){const{attrs:n={},createScriptHook:a}=t;return new Promise((s,p)=>{const{script:f,needAttach:m}=M4({url:e,cb:s,onErrorCallback:p,attrs:{fetchpriority:"high",...n},createScriptHook:a,needDeleteScript:!0});m&&document.head.appendChild(f)})}var np=new Map;function Us(e){if(!e)throw new Error("import specifier is required");if(np.has(e))return np.get(e);const t=new Function("name","return import(name)")(e).then(n=>n).catch(n=>{throw console.error(`Error importing module ${e}:`,n),np.delete(e),n});return np.set(e,t),t}var C4=async()=>{const e=await Us("node-fetch");return e.default||e},Xie=async(e,t,n)=>{const s=await((p,f)=>n.lifecycle.fetch.emit(p,f))(e,t||{});return!s||!(s instanceof Response)?(typeof fetch>"u"?await C4():fetch)(e,t||{}):s},Jie=typeof ENV_TARGET>"u"||ENV_TARGET!=="web"?(e,t,n,a)=>{if(a?.createScriptHook){const m=a.createScriptHook(e);m&&typeof m=="object"&&"url"in m&&(e=m.url)}let s;try{s=new URL(e)}catch(m){console.error("Error constructing URL:",m),t(new Error(`Invalid URL: ${m}`));return}const p=async()=>a?.fetch?(m,h)=>Xie(m,h,a):typeof fetch>"u"?C4():fetch,f=async(m,h)=>{try{const c=await(await m(h.href)).text(),[x,M]=await Promise.all([Us("path"),Us("vm")]),C={exports:{},module:{exports:{}}},E=h.pathname.split("/").slice(0,-1).join("/"),R=x.basename(h.pathname),_=new M.Script(`(function(exports, module, require, __dirname, __filename) {${c}
78
- })`,{filename:R,importModuleDynamically:M.constants?.USE_MAIN_CONTEXT_DEFAULT_LOADER??Us});let j;j=(await Us("node:module")).createRequire(h.protocol==="file:"||h.protocol==="node:"?h.href:x.join(process.cwd(),"__mf_require_base__.js")),_.runInThisContext()(C.exports,C.module,j,E,R);const D=C.module.exports||C.exports;if(n&&D&&n.globalName){t(void 0,D[n.globalName]||D);return}t(void 0,D)}catch(c){t(c instanceof Error?c:new Error(`Script execution error: ${c}`))}};p().then(async m=>{if(n?.type==="esm"||n?.type==="module")return Hy(s.href,{fetch:m,vm:await Us("vm")}).then(async h=>{await h.evaluate(),t(void 0,h.namespace)}).catch(h=>{t(h instanceof Error?h:new Error(`Script execution error: ${h}`))});f(m,s)}).catch(m=>{t(m)})}:(e,t,n,a)=>{t(new Error("createScriptNode is disabled in non-Node.js environment"))},ere=typeof ENV_TARGET>"u"||ENV_TARGET!=="web"?(e,t)=>new Promise((n,a)=>{Jie(e,(s,p)=>{if(s)a(s);else{const f=t?.attrs?.globalName||`__FEDERATION_${t?.attrs?.name}:custom__`;n(globalThis[f]=p)}},t.attrs,t.loaderHook)}):(e,t)=>{throw new Error("loadScriptNode is disabled in non-Node.js environment")},Kg=new Map;async function Hy(e,t){if(Kg.has(e))return Kg.get(e);const{fetch:n,vm:a}=t,s=await(await n(e)).text(),p=new a.SourceTextModule(s,{importModuleDynamically:async(f,m)=>{const h=new URL(f,e).href;return Hy(h,t)}});return Kg.set(e,p),await p.link(async f=>{const m=new URL(f,e).href;return await Hy(m,t)}),p}var tre=e=>`View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${e.split("-")[0].toLowerCase()}#${e.toLowerCase()}`,A4=(e,t,n,a)=>{const s=[`${[t[e]]} #${e}`];return n&&s.push(`args: ${JSON.stringify(n)}`),s.push(tre(e)),a&&s.push(`Original Error Message:
79
- ${a}`),s.join(`
80
- `)};function nre(e,t,n,a,s,p){return a(A4(e,t,n,s))}var Ro="[ Federation Runtime ]",$y=Zie(Ro);function Xi(e,t,n,a,s){e||Yt(t)}function Yt(e,t,n,a,s){if(t!==void 0)return nre(e,t,n??{},f=>{throw new Error(`${Ro}: ${f}`)},a);const p=e;throw p instanceof Error?(p.message.startsWith(Ro)||(p.message=`${Ro}: ${p.message}`),p):new Error(`${Ro}: ${p}`)}function au(e){e instanceof Error&&(e.message.startsWith(Ro)||(e.message=`${Ro}: ${e.message}`)),$y.warn(e)}function are(e,t){return e.findIndex(n=>n===t)===-1&&e.push(t),e}function dm(e){return"version"in e&&e.version?`${e.name}:${e.version}`:"entry"in e&&e.entry?`${e.name}:${e.entry}`:`${e.name}`}function E0(e){return typeof e.entry<"u"}function E4(e){return!e.entry.includes(".json")}function R0(e){return e&&typeof e=="object"}var ire=Object.prototype.toString;function rre(e){return ire.call(e)==="[object Object]"}function R4(e){return Array.isArray(e)?e:[e]}function I4(e){const t={url:"",type:"global",globalName:""};return Kr||v4()||!("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 ore=(e,t)=>{let n;return e.endsWith("/")?n=e.slice(0,-1):n=e,t.startsWith(".")&&(t=t.slice(1)),n=n+t,n},Un=typeof globalThis=="object"?globalThis:window,ii=(()=>{try{return document.defaultView}catch{return Un}})(),iu=ii;function Ip(e,t,n){Object.defineProperty(e,t,{value:n,configurable:!1,writable:!0})}function Tp(e,t){return Object.hasOwnProperty.call(e,t)}Tp(Un,"__GLOBAL_LOADING_REMOTE_ENTRY__")||Ip(Un,"__GLOBAL_LOADING_REMOTE_ENTRY__",{});var Ws=Un.__GLOBAL_LOADING_REMOTE_ENTRY__;function T4(e){Tp(e,"__VMOK__")&&!Tp(e,"__FEDERATION__")&&Ip(e,"__FEDERATION__",e.__VMOK__),Tp(e,"__FEDERATION__")||(Ip(e,"__FEDERATION__",{__GLOBAL_PLUGIN__:[],__INSTANCES__:[],moduleInfo:{},__SHARE__:{},__MANIFEST_LOADING__:{},__PRELOADED_MAP__:new Map}),Ip(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}T4(Un);T4(ii);function sre(e,t=By()){t&&(Un.__FEDERATION__.__DEBUG_CONSTRUCTOR__=e,Un.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__="2.5.1")}function ml(e,t){if(typeof t=="string"){if(e[t])return{value:e[t],key:t};{const n=Object.keys(e);for(const a of n){const[s,p]=a.split(":"),f=`${s}:${t}`,m=e[f];if(m)return{value:m,key:f}}return{value:void 0,key:t}}}else Yt(`getInfoWithoutType: "key" must be a string, got ${typeof t} (${JSON.stringify(t)}).`)}var SC=()=>ii.__FEDERATION__.moduleInfo,lre=(e,t)=>{const n=ml(t,dm(e)).value;if(n&&!n.version&&"version"in e&&e.version&&(n.version=e.version),n)return n;if("version"in e&&e.version){const{version:a,...s}=e,p=dm(s),f=ml(ii.__FEDERATION__.moduleInfo,p).value;if(f?.version===a)return f}},_p=e=>lre(e,ii.__FEDERATION__.moduleInfo),xC=(e,t)=>{const n=dm(e);return ii.__FEDERATION__.moduleInfo[n]=t,ii.__FEDERATION__.moduleInfo},cre=e=>(ii.__FEDERATION__.moduleInfo={...ii.__FEDERATION__.moduleInfo,...e},()=>{const t=Object.keys(e);for(const n of t)delete ii.__FEDERATION__.moduleInfo[n]}),I0=(e,t)=>{const n=t||`__FEDERATION_${e}:custom__`;return{remoteEntryKey:n,entryExports:Un[n]}},ure=()=>ii.__FEDERATION__.__GLOBAL_PLUGIN__,dre=e=>Un.__FEDERATION__.__PRELOADED_MAP__.get(e),pre=e=>Un.__FEDERATION__.__PRELOADED_MAP__.set(e,!0),kC="[0-9A-Za-z-]+",T0=`(?:\\+(${kC}(?:\\.${kC})*))`,Fc="0|[1-9]\\d*",Np="[0-9]+",_4="\\d*[a-zA-Z-][a-zA-Z0-9-]*",wC=`(?:${Np}|${_4})`,mre=`(?:-?(${wC}(?:\\.${wC})*))`,MC=`(?:${Fc}|${_4})`,N4=`(?:-(${MC}(?:\\.${MC})*))`,Wg=`${Fc}|x|X|\\*`,fl=`[v=\\s]*(${Wg})(?:\\.(${Wg})(?:\\.(${Wg})(?:${N4})?${T0}?)?)?`,fre=`^\\s*(${fl})\\s+-\\s+(${fl})\\s*$`,hre=`[v=\\s]*${`(${Np})\\.(${Np})\\.(${Np})`}${mre}?${T0}?`,_0="((?:<|>)?=?)",gre=`(\\s*)${_0}\\s*(${hre}|${fl})`,O4="(?:~>?)",vre=`(\\s*)${O4}\\s+`,j4="(?:\\^)",yre=`(\\s*)${j4}\\s+`,bre="(<|>)?=?\\s*\\*",Sre=`^${j4}${fl}$`,xre=`v?${`(${Fc})\\.(${Fc})\\.(${Fc})`}${N4}?${T0}?`,kre=`^${O4}${fl}$`,wre=`^${_0}\\s*${fl}$`,Mre=`^${_0}\\s*(${xre})$|^$`,Cre="^\\s*>=\\s*0.0.0\\s*$";function Ai(e){return new RegExp(e)}function aa(e){return!e||e.toLowerCase()==="x"||e==="*"}function P4(...e){return t=>e.reduce((n,a)=>a(n),t)}function CC(e){return e.match(Ai(Mre))}function AC(e,t,n,a){const s=`${e}.${t}.${n}`;return a?`${s}-${a}`:s}function Are(e){return e.replace(Ai(fre),(t,n,a,s,p,f,m,h,c,x,M,C)=>(aa(a)?n="":aa(s)?n=`>=${a}.0.0`:aa(p)?n=`>=${a}.${s}.0`:n=`>=${n}`,aa(c)?h="":aa(x)?h=`<${Number(c)+1}.0.0-0`:aa(M)?h=`<${c}.${Number(x)+1}.0-0`:C?h=`<=${c}.${x}.${M}-${C}`:h=`<=${h}`,`${n} ${h}`.trim()))}function Ere(e){return e.replace(Ai(gre),"$1$2$3")}function Rre(e){return e.replace(Ai(vre),"$1~")}function Ire(e){return e.replace(Ai(yre),"$1^")}function Tre(e){return e.trim().split(/\s+/).map(t=>t.replace(Ai(Sre),(n,a,s,p,f)=>aa(a)?"":aa(s)?`>=${a}.0.0 <${Number(a)+1}.0.0-0`:aa(p)?a==="0"?`>=${a}.${s}.0 <${a}.${Number(s)+1}.0-0`:`>=${a}.${s}.0 <${Number(a)+1}.0.0-0`:f?a==="0"?s==="0"?`>=${a}.${s}.${p}-${f} <${a}.${s}.${Number(p)+1}-0`:`>=${a}.${s}.${p}-${f} <${a}.${Number(s)+1}.0-0`:`>=${a}.${s}.${p}-${f} <${Number(a)+1}.0.0-0`:a==="0"?s==="0"?`>=${a}.${s}.${p} <${a}.${s}.${Number(p)+1}-0`:`>=${a}.${s}.${p} <${a}.${Number(s)+1}.0-0`:`>=${a}.${s}.${p} <${Number(a)+1}.0.0-0`)).join(" ")}function _re(e){return e.trim().split(/\s+/).map(t=>t.replace(Ai(kre),(n,a,s,p,f)=>aa(a)?"":aa(s)?`>=${a}.0.0 <${Number(a)+1}.0.0-0`:aa(p)?`>=${a}.${s}.0 <${a}.${Number(s)+1}.0-0`:f?`>=${a}.${s}.${p}-${f} <${a}.${Number(s)+1}.0-0`:`>=${a}.${s}.${p} <${a}.${Number(s)+1}.0-0`)).join(" ")}function Nre(e){return e.split(/\s+/).map(t=>t.trim().replace(Ai(wre),(n,a,s,p,f,m)=>{const h=aa(s),c=h||aa(p),x=c||aa(f);return a==="="&&x&&(a=""),m="",h?a===">"||a==="<"?"<0.0.0-0":"*":a&&x?(c&&(p=0),f=0,a===">"?(a=">=",c?(s=Number(s)+1,p=0,f=0):(p=Number(p)+1,f=0)):a==="<="&&(a="<",c?s=Number(s)+1:p=Number(p)+1),a==="<"&&(m="-0"),`${a+s}.${p}.${f}${m}`):c?`>=${s}.0.0${m} <${Number(s)+1}.0.0-0`:x?`>=${s}.${p}.0${m} <${s}.${Number(p)+1}.0-0`:n})).join(" ")}function Ore(e){return e.trim().replace(Ai(bre),"")}function jre(e){return e.trim().replace(Ai(Cre),"")}function Op(e,t){return e=Number(e)||e,t=Number(t)||t,e>t?1:e===t?0:-1}function Pre(e,t){const{preRelease:n}=e,{preRelease:a}=t;if(n===void 0&&a)return 1;if(n&&a===void 0)return-1;if(n===void 0&&a===void 0)return 0;for(let s=0,p=n.length;s<=p;s++){const f=n[s],m=a[s];if(f!==m)return f===void 0&&m===void 0?0:f?m?Op(f,m):-1:1}return 0}function ap(e,t){return Op(e.major,t.major)||Op(e.minor,t.minor)||Op(e.patch,t.patch)||Pre(e,t)}function Yg(e,t){return e.version===t.version}function Dre(e,t){switch(e.operator){case"":case"=":return Yg(e,t);case">":return ap(e,t)<0;case">=":return Yg(e,t)||ap(e,t)<0;case"<":return ap(e,t)>0;case"<=":return Yg(e,t)||ap(e,t)>0;case void 0:return!0;default:return!1}}function zre(e){return P4(Tre,_re,Nre,Ore)(e)}function Lre(e){return P4(Are,Ere,Rre,Ire)(e.trim()).split(/\s+/).join(" ")}function jc(e,t){if(!e)return!1;const n=CC(e);if(!n)return!1;const[,a,,s,p,f,m]=n,h={operator:a,version:AC(s,p,f,m),major:s,minor:p,patch:f,preRelease:m?.split(".")},c=t.split("||");for(const x of c){const M=x.trim();if(!M||M==="*"||M==="x")return!0;try{const C=Lre(M);if(!C.trim())return!0;const E=C.split(" ").map(j=>zre(j)).join(" ");if(!E.trim())return!0;const R=E.split(/\s+/).map(j=>jre(j)).filter(Boolean);if(R.length===0)continue;let _=!0;for(const j of R){const D=CC(j);if(!D){_=!1;break}const[,z,,B,L,G,ae]=D;if(!Dre({operator:z,version:AC(B,L,G,ae),major:B,minor:L,patch:G,preRelease:ae?.split(".")},h)){_=!1;break}}if(_)return!0}catch(C){console.error(`[semver] Error processing range part "${M}":`,C);continue}}return!1}var Fm="default",qre="global";function Bre(e,t,n,a){let s;return"get"in e?s=e.get:"lib"in e?s=()=>Promise.resolve(e.lib):s=()=>Promise.resolve(()=>{Yt(`Cannot get shared "${n}" from "${t}": neither "get" nor "lib" is provided in the share config.`)}),e.shareConfig?.eager&&e.treeShaking?.mode&&Yt(`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:s,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??a)||"version-first",treeShaking:e.treeShaking?{...e.treeShaking,mode:e.treeShaking.mode??"server-calc",status:e.treeShaking.status??qy.UNKNOWN,useIn:[]}:void 0}}function D4(e,t){const n=t.shared||{},a=t.name,s=Object.keys(n).reduce((f,m)=>{const h=R4(n[m]);return f[m]=f[m]||[],h.forEach(c=>{f[m].push(Bre(c,a,m,t.shareStrategy))}),f},{}),p={...e.shared};return Object.keys(s).forEach(f=>{p[f]?s[f].forEach(m=>{p[f].find(h=>h.version===m.version)||p[f].push(m)}):p[f]=s[f]}),{allShareInfos:p,newShareInfos:s}}function ru(e,t){if(!e)return!1;const{status:n,mode:a}=e;return n===qy.NO_USE?!1:n===qy.CALCULATED?!0:a==="runtime-infer"?t?Ure(e,t):!0:!1}function No(e,t){const n=a=>{if(!Number.isNaN(Number(a))){const s=a.split(".");let p=a;for(let f=0;f<3-s.length;f++)p+=".0";return p}return a};return!!jc(n(e),`<=${n(t)}`)}var ou=(e,t)=>{const n=t||function(a,s){return No(a,s)};return Object.keys(e).reduce((a,s)=>!a||n(a,s)||a==="0"?s:a,0)},pm=e=>!!e.loaded||typeof e.lib=="function",Fre=e=>!!e.loading,Ure=(e,t)=>{if(!e||!t)return!1;const{usedExports:n}=e;return n?!!t.every(a=>n.includes(a)):!1};function Hre(e,t,n,a){const s=e[t][n];let p="",f=ru(a);const m=function(h,c){return f?s[h].treeShaking?s[c].treeShaking?!pm(s[h].treeShaking)&&No(h,c):!1:!0:!pm(s[h])&&No(h,c)};if(f){if(p=ou(e[t][n],m),p)return{version:p,useTreesShaking:f};f=!1}return{version:ou(e[t][n],m),useTreesShaking:f}}var zs=e=>pm(e)||Fre(e);function $re(e,t,n,a){const s=e[t][n];let p="",f=ru(a);const m=function(h,c){if(f){if(!s[h].treeShaking)return!0;if(!s[c].treeShaking)return!1;if(zs(s[c].treeShaking))return zs(s[h].treeShaking)?!!No(h,c):!0;if(zs(s[h].treeShaking))return!1}return zs(s[c])?zs(s[h])?!!No(h,c):!0:zs(s[h])?!1:No(h,c)};if(f){if(p=ou(e[t][n],m),p)return{version:p,useTreesShaking:f};f=!1}return{version:ou(e[t][n],m),useTreesShaking:f}}function Qre(e){return e==="loaded-first"?$re:Hre}function jp(e,t,n,a){if(!e)return;const{shareConfig:s,scope:p=Fm,strategy:f,treeShaking:m}=n,h=Array.isArray(p)?p:[p];for(const c of h)if(s&&e[c]&&e[c][t]){const{requiredVersion:x}=s,{version:M,useTreesShaking:C}=Qre(f)(e,c,t,m),E=()=>{const _=e[c][t][M];if(s.singleton){if(typeof x=="string"&&!jc(M,x)){const j=`Version ${M} from ${M&&_.from} of shared singleton module ${t} does not satisfy the requirement of ${n.from} which needs ${x})`;s.strictVersion?Yt(j):au(j)}return{shared:_,useTreesShaking:C}}else{if(x===!1||x==="*")return{shared:_,useTreesShaking:C};if(jc(M,x))return{shared:_,useTreesShaking:C};const j=ru(m);if(j){for(const[D,z]of Object.entries(e[c][t]))if(ru(z.treeShaking,m?.usedExports)&&jc(D,x))return{shared:z,useTreesShaking:j}}for(const[D,z]of Object.entries(e[c][t]))if(jc(D,x))return{shared:z,useTreesShaking:!1}}},R={shareScopeMap:e,scope:c,pkgName:t,version:M,GlobalFederation:iu.__FEDERATION__,shareInfo:n,resolver:E};return(a.emit(R)||R).resolver()}}function z4(){return iu.__FEDERATION__.__SHARE__}function EC(e){const{pkgName:t,extraOptions:n,shareInfos:a}=e,s=h=>{if(!h)return;const c={};return h.forEach(M=>{c[M.version]=M}),c[ou(c,function(M,C){return!pm(c[M])&&No(M,C)})]},p=n?.resolver??s,f=h=>h!==null&&typeof h=="object"&&!Array.isArray(h),m=(...h)=>{const c={};for(const x of h)if(x)for(const[M,C]of Object.entries(x)){const E=c[M];f(E)&&f(C)?c[M]=m(E,C):C!==void 0&&(c[M]=C)}return c};return m(p(a[t]),n?.customShareInfo)}var Ls=(e,t)=>{e.useIn||(e.useIn=[]),are(e.useIn,t)};function ip(e,t){return t&&e.treeShaking?e.treeShaking:e}function N0(e,t){return!t||t==="."?e:`${e}/${t.replace(/^\.\//,"")}`}function RC(e,t){for(const n of e){const a=t.startsWith(n.name);let s=t.replace(n.name,"");if(a){if(s.startsWith("/")){const m=n.name;return s=`.${s}`,{pkgNameOrAlias:m,expose:s,remote:n}}else if(s==="")return{pkgNameOrAlias:n.name,expose:".",remote:n}}const p=n.alias&&t.startsWith(n.alias);let f=n.alias&&t.replace(n.alias,"");if(n.alias&&p){if(f&&f.startsWith("/")){const m=n.alias;return f=`.${f}`,{pkgNameOrAlias:m,expose:f,remote:n}}else if(f==="")return{pkgNameOrAlias:n.alias,expose:".",remote:n}}}}function Vre(e,t){for(const n of e)if(t===n.name||n.alias&&t===n.alias)return n}var L4="RUNTIME-001",q4="RUNTIME-002",B4="RUNTIME-003",F4="RUNTIME-004",U4="RUNTIME-005",Qy="RUNTIME-006",H4="RUNTIME-007",$4="RUNTIME-008",Gre="RUNTIME-009",Q4="RUNTIME-010",V4="RUNTIME-011",Zre="RUNTIME-012",G4="RUNTIME-013",Z4="RUNTIME-014",K4="RUNTIME-015",ya={[L4]:"Failed to get remoteEntry exports.",[q4]:'The remote entry interface does not contain "init"',[B4]:"Failed to get manifest.",[F4]:"Failed to locate remote.",[U4]:"Invalid loadShareSync function call from bundler runtime",[Qy]:"Invalid loadShareSync function call from runtime",[H4]:"Failed to get remote snapshot.",[$4]:"Failed to load script resources.",[Gre]:"Please call createInstance first.",[Q4]:'The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use "createInstance" api.',[V4]:"The remoteEntry URL is missing from the remote snapshot.",[Zre]:'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.',[G4]:"The manifest is not a valid Module Federation manifest.",[Z4]:"The remote does not expose the requested module.",[K4]:"Remote container initialization failed."};({...ya});var W4=".then(callbacks[0]).catch(callbacks[1])";async function Kre({entry:e,remoteEntryExports:t}){return new Promise((n,a)=>{try{t?n(t):typeof FEDERATION_ALLOW_NEW_FUNCTION<"u"?new Function("callbacks",`import("${e}")${W4}`)([n,a]):import(e).then(n).catch(a)}catch(s){Yt(`Failed to load ESM entry from "${e}". ${s instanceof Error?s.message:String(s)}`)}})}async function Wre({entry:e,remoteEntryExports:t}){return new Promise((n,a)=>{try{t?n(t):typeof __system_context__>"u"?System.import(e).then(n).catch(a):new Function("callbacks",`System.import("${e}")${W4}`)([n,a])}catch(s){Yt(`Failed to load SystemJS entry from "${e}". ${s instanceof Error?s.message:String(s)}`)}})}function Y4(e,t,n){const{remoteEntryKey:a,entryExports:s}=I0(e,t);return s||Yt(L4,ya,{remoteName:e,remoteEntryUrl:n,remoteEntryKey:a}),s}async function Yre({name:e,globalName:t,entry:n,remoteInfo:a,loaderHook:s,getEntryUrl:p,resourceContext:f}){const{entryExports:m}=I0(e,t);if(m)return m;const h=p?p(n):n;return Yie(h,{attrs:{},createScriptHook:(c,x)=>{const M=s.lifecycle.createScript.emit({url:c,attrs:x,remoteInfo:a,resourceContext:f?{...f,url:c}:void 0});if(M&&(M instanceof HTMLScriptElement||"script"in M||"timeout"in M))return M}}).then(()=>Y4(e,t,n),c=>{const x=c instanceof Error?c.message:String(c);Yt($4,ya,{remoteName:e,resourceUrl:h},x)})}async function Xre({remoteInfo:e,remoteEntryExports:t,loaderHook:n,getEntryUrl:a,resourceContext:s}){const{entry:p,entryGlobalName:f,name:m,type:h}=e;switch(h){case"esm":case"module":return Kre({entry:p,remoteEntryExports:t});case"system":return Wre({entry:p,remoteEntryExports:t});default:return Yre({entry:p,globalName:f,name:m,remoteInfo:e,loaderHook:n,getEntryUrl:a,resourceContext:s})}}async function Jre({remoteInfo:e,loaderHook:t,resourceContext:n}){const{entry:a,entryGlobalName:s,name:p,type:f}=e,{entryExports:m}=I0(p,s);return m||ere(a,{attrs:{name:p,globalName:s,type:f},loaderHook:{createScriptHook:(h,c={})=>{const x=t.lifecycle.createScript.emit({url:h,attrs:c,remoteInfo:e,resourceContext:n?{...n,url:h}:void 0});if(x&&"url"in x)return x}}}).then(()=>Y4(p,s,a)).catch(h=>{Yt(`Failed to load Node.js entry for remote "${p}" from "${a}". ${h instanceof Error?h.message:String(h)}`)})}function Vy(e){const{entry:t,name:n}=e;return y4(n,t)}async function O0(e){const{origin:t,remoteEntryExports:n,remoteInfo:a,getEntryUrl:s,resourceContext:p,_inErrorHandling:f=!1}=e,m=Vy(a);if(n)return n;if(!Ws[m]){const h=t.remoteHandler.hooks.lifecycle.loadEntry,c=t.loaderHook;Ws[m]=h.emit({origin:t,loaderHook:c,remoteInfo:a,remoteEntryExports:n}).then(x=>x||((typeof ENV_TARGET<"u"?ENV_TARGET==="web":Kr)?Xre({remoteInfo:a,remoteEntryExports:n,loaderHook:c,getEntryUrl:s,resourceContext:p}):Jre({remoteInfo:a,loaderHook:c,resourceContext:p}))).then(async x=>(await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:a,remoteEntryExports:x}),x)).catch(async x=>{const M=Vy(a),C=x instanceof Error&&x.message.includes("ScriptExecutionError");if(x instanceof Error&&x.message.includes("RUNTIME-008")&&!C&&!f){const E=_=>O0({..._,_inErrorHandling:!0}),R=await t.loaderHook.lifecycle.loadEntryError.emit({getRemoteEntry:E,origin:t,remoteInfo:a,remoteEntryExports:n,globalLoading:Ws,uniqueKey:M});if(R)return await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:a,remoteEntryExports:R,recovered:!0}),R}throw await t.loaderHook.lifecycle.afterLoadEntry.emit({origin:t,remoteInfo:a,error:x}),x})}return Ws[m]}function Ys(e){return{...e,entry:"entry"in e?e.entry:"",type:e.type||"global",entryGlobalName:e.entryGlobalName||e.name,shareScope:e.shareScope||"default"}}function eoe(){return typeof FEDERATION_BUILD_IDENTIFIER<"u"?FEDERATION_BUILD_IDENTIFIER:""}function toe(e,t){const n=ure(),a=[t.hooks,t.remoteHandler.hooks,t.sharedHandler.hooks,t.snapshotHandler.hooks,t.loaderHook,t.bridgeHook];return n.length>0&&n.forEach(s=>{e?.find(p=>p.name!==s.name)&&e.push(s)}),e&&e.length>0&&e.forEach(s=>{a.forEach(p=>{p.applyPlugin(s,t)})}),e}function noe(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 tr(e){const t={};for(const[n,a]of Object.entries(e.shared)){const s=a[0];s&&(t[n]={version:s.version,singleton:s.shareConfig?.singleton,requiredVersion:s.shareConfig?.requiredVersion===!1?!1:s.shareConfig?.requiredVersion,eager:s.eager,strictVersion:s.shareConfig?.strictVersion})}return{project:{name:e.name,mfRole:e.remotes?.length>0?"host":"unknown"},mfConfig:{name:e.name,remotes:e.remotes?.map(noe)??[],shared:t}}}function X4(e){return{resourceCategory:"sync",share:!0,depsRemote:!0,...e}}function aoe(e,t){return t.map(n=>{const a=Vre(e,n.nameOrAlias);return Xi(a,`Unable to preload ${n.nameOrAlias} as it is not included in ${!a&&S4({remoteInfo:a,remotes:e})}`),{remote:a,preloadConfig:X4(n)}})}function ioe(e){return e?e.map(t=>t==="."?t:t.startsWith("./")?t.replace("./",""):t):[]}function j0(e){return e instanceof Error?e.message.includes("timed out")||e.name.includes("Timeout"):!1}function Oo(e,t,n,a){return{url:t,status:n,resourceType:e.resourceType,initiator:e.initiator,id:e.id,error:a}}async function roe(e,t,n,a){const s=e.moduleCache.get(n.name),p=n.entry;if(s?.remoteEntryExports)return Oo(a,p,"cached");try{if(!await O0({origin:e,remoteInfo:n,remoteEntryExports:s?.remoteEntryExports,resourceContext:{...a,url:p}}))throw new Error(`Failed to load remoteEntry "${p}".`);return Oo(a,p,"success")}catch(f){return Oo(a,p,j0(f)?"timeout":"error",f)}}function Xg({host:e,remoteInfo:t,url:n,attrs:a,context:s,needDeleteLink:p}){return new Promise(f=>{const{link:m,needAttach:h}=Wie({url:n,cb:()=>{f(Oo(s,n,h?"success":"cached"))},onErrorCallback:c=>{f(Oo(s,n,j0(c)?"timeout":"error",c))},attrs:a,createLinkHook:(c,x)=>{const M=e.loaderHook.lifecycle.createLink.emit({url:c,attrs:x,remoteInfo:t,resourceContext:{...s,url:c}});return M instanceof HTMLLinkElement,M},needDeleteLink:p});h&&document.head.appendChild(m)})}function ooe({host:e,remoteInfo:t,url:n,attrs:a,context:s}){return new Promise(p=>{const{script:f,needAttach:m}=M4({url:n,cb:()=>{p(Oo(s,n,m?"success":"cached"))},onErrorCallback:h=>{p(Oo(s,n,j0(h)?"timeout":"error",h))},attrs:a,createScriptHook:(h,c)=>{const x=e.loaderHook.lifecycle.createScript.emit({url:h,attrs:c,remoteInfo:t,resourceContext:{...s,url:h}});return x instanceof HTMLScriptElement,x},needDeleteScript:!0});m&&document.head.appendChild(f)})}function Mc(e,t){return{...e,resourceType:t}}function J4(e,t,n,a=!0,s={initiator:"preloadRemote",id:e.name}){const{cssAssets:p,jsAssetsWithoutEntry:f,entryAssets:m}=n,h=[];if(t.options.inBrowser){if(m.forEach(c=>{const{moduleInfo:x}=c;h.push(roe(t,e,x,Mc(s,"remoteEntry")))}),a){const c={rel:"preload",as:"style"};p.forEach(x=>{h.push(Xg({host:t,remoteInfo:e,url:x,attrs:c,context:Mc(s,"css")}))})}else{const c={rel:"stylesheet",type:"text/css"};p.forEach(x=>{h.push(Xg({host:t,remoteInfo:e,url:x,attrs:c,needDeleteLink:!1,context:Mc(s,"css")}))})}if(a){const c={rel:"preload",as:"script"};f.forEach(x=>{h.push(Xg({host:t,remoteInfo:e,url:x,attrs:c,context:Mc(s,"js")}))})}else{const c={fetchpriority:"high",type:e?.type==="module"?"module":"text/javascript"};f.forEach(x=>{h.push(ooe({host:t,remoteInfo:e,url:x,attrs:c,context:Mc(s,"js")}))})}}return Promise.all(h)}function soe(e){if(!e||!("modules"in e)||!Array.isArray(e.modules))return;const t=e.modules.map(n=>n.moduleName).filter(Boolean);return t.length?t.join(","):void 0}function loe(e,t,n){const a=t,s=Array.isArray(e.shareScope)?e.shareScope:[e.shareScope];s.length||s.push("default"),s.forEach(f=>{a[f]||(a[f]={})});const p={version:e.version||"",shareScopeKeys:Array.isArray(e.shareScope)?s:e.shareScope||"default"};return Object.defineProperty(p,"shareScopeMap",{value:a,enumerable:!1}),{remoteEntryInitOptions:p,shareScope:a[s[0]],initScope:n??[]}}var eN=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;const t=await O0({origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports,resourceContext:{initiator:"loadRemote",id:N0(this.remoteInfo.name,e),resourceType:"remoteEntry"}});return Xi(t,`remoteEntryExports is undefined
81
- ${S4(this.remoteInfo)}`),this.remoteEntryExports=t,this.remoteEntryExports}async init(e,t,n,a){const s=await this.getEntry(a);if(this.inited)return await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:s,cached:!0,origin:this.host}),s;if(this.initPromise){try{await this.initPromise,await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:s,cached:!0,origin:this.host})}catch(p){throw await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:s,error:p,cached:!0,origin:this.host}),p}return s}this.initing=!0,this.initPromise=(async()=>{await this.host.loaderHook.lifecycle.beforeInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,origin:this.host});const{remoteEntryInitOptions:p,shareScope:f,initScope:m}=loe(this.remoteInfo,this.host.shareScopeMap,n),h=await this.host.hooks.lifecycle.beforeInitContainer.emit({shareScope:f,remoteEntryInitOptions:p,initScope:m,remoteInfo:this.remoteInfo,origin:this.host});typeof s?.init>"u"&&Yt(q4,ya,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName},void 0,tr(this.host.options));try{await s.init(h.shareScope,h.initScope,h.remoteEntryInitOptions)}catch(c){Yt(K4,ya,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName,shareScope:this.remoteInfo.shareScope},`${c}`,tr(this.host.options))}await this.host.hooks.lifecycle.initContainer.emit({...h,id:e,remoteSnapshot:t,remoteEntryExports:s}),this.inited=!0})();try{await this.initPromise,await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:s,origin:this.host})}catch(p){throw await this.host.loaderHook.lifecycle.afterInitRemote.emit({id:e,remoteInfo:this.remoteInfo,remoteSnapshot:t,remoteEntryExports:s,error:p,origin:this.host}),p}finally{this.initing=!1,this.initPromise=void 0}return s}async get(e,t,n,a){const{loadFactory:s=!0}=n||{loadFactory:!0},p=await this.init(e,a,void 0,t);this.lib=p,await this.host.loaderHook.lifecycle.beforeGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:p,origin:this.host});let f;try{const c=await this.host.loaderHook.lifecycle.getModuleFactory.emit({remoteEntryExports:p,expose:t,moduleInfo:this.remoteInfo});f=typeof c=="function"?c:void 0,f||(f=await p.get(t)),f||Yt(Z4,ya,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,expose:t,requestId:e,availableExposes:soe(a)},void 0,tr(this.host.options)),await this.host.loaderHook.lifecycle.afterGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:p,moduleFactory:f,origin:this.host})}catch(c){throw await this.host.loaderHook.lifecycle.afterGetExpose.emit({id:e,expose:t,moduleInfo:this.remoteInfo,remoteEntryExports:p,error:c,origin:this.host}),c}const m=ore(this.remoteInfo.name,t),h=this.wraperFactory(f,m);if(!s)return h;await this.host.loaderHook.lifecycle.beforeExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:s,origin:this.host});try{const c=await h();return await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:s,exposeModule:c,origin:this.host}),c}catch(c){throw await this.host.loaderHook.lifecycle.afterExecuteFactory.emit({id:e,expose:t,moduleInfo:this.remoteInfo,loadFactory:s,error:c,origin:this.host}),c}}wraperFactory(e,t){function n(a,s){a&&typeof a=="object"&&Object.isExtensible(a)&&!Object.getOwnPropertyDescriptor(a,Symbol.for("mf_module_id"))&&Object.defineProperty(a,Symbol.for("mf_module_id"),{value:s,enumerable:!1})}return()=>{const a=e();return a instanceof Promise?a.then(s=>(n(s,t),s)):(n(a,t),a)}}},ga=class{constructor(e){this.type="",this.listeners=new Set,e&&(this.type=e)}on(e){typeof e=="function"&&this.listeners.add(e)}once(e){const t=this;this.on(function n(...a){return t.remove(n),e.apply(null,a)})}emit(...e){let t;return this.listeners.size>0&&this.listeners.forEach(n=>{const a=n(...e);a!==void 0&&(t=a)}),t}remove(e){this.listeners.delete(e)}removeAll(){this.listeners.clear()}},En=class extends ga{emit(...e){let t;const n=Array.from(this.listeners);if(n.length>0){let a=0;const s=p=>p===!1?!1:a<n.length?Promise.resolve(n[a++].apply(null,e)).then(f=>f===void 0||e.length===1&&f===e[0]?s(p):s(f)):p;t=s()}return Promise.resolve(t)}};function tN(e,t){if(!R0(t))return!1;if(e!==t){for(const n in e)if(!(n in t))return!1}return!0}var tl=class extends ga{constructor(e){super(),this.onerror=Yt,this.type=e}emit(e){R0(e)||Yt(`The data for the "${this.type}" hook should be an object.`);for(const t of this.listeners)try{const n=t(e);if(n===void 0)continue;if(tN(e,n))e=n;else{this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);break}}catch(n){au(n),this.onerror(n)}return e}},Fr=class extends ga{constructor(e){super(),this.onerror=Yt,this.type=e}emit(e){R0(e)||Yt(`The response data for the "${this.type}" hook must be an object.`);const t=Array.from(this.listeners);if(t.length>0){let n=0;const a=p=>(au(p),this.onerror(p),e),s=p=>{if(p!==void 0&&tN(e,p))e=p;else if(p!==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(s,a)}catch(f){return a(f)}return e};return Promise.resolve(s(e))}return Promise.resolve(e)}},nl=class{constructor(e){this.registerPlugins={},this.lifecycle=e,this.lifecycleKeys=Object.keys(e)}applyPlugin(e,t){Xi(rre(e),"Plugin configuration is invalid.");const n=e.name;Xi(n,"A name must be provided by the plugin."),this.registerPlugins[n]||(this.registerPlugins[n]=e,e.apply?.(t),Object.keys(this.lifecycle).forEach(a=>{const s=e[a];s&&this.lifecycle[a].on(s)}))}removePlugin(e){Xi(e,"A name is required.");const t=this.registerPlugins[e];Xi(t,`The plugin "${e}" is not registered.`),Object.keys(t).forEach(n=>{n!=="name"&&this.lifecycle[n].remove(t[n])})}};function nN(e,t){const n=I4(t);n.url||Yt(V4,ya,{remoteName:e.name});let a=Fy(t,n.url);!Kr&&!a.startsWith("http")&&(a=`https:${a}`),e.type=n.type,e.entryGlobalName=n.globalName,e.entry=a,e.version=t.version,e.buildVersion=t.buildVersion}function coe(){return{name:"snapshot-plugin",async afterResolve(e){const{remote:t,pkgNameOrAlias:n,expose:a,origin:s,remoteInfo:p,id:f}=e;if(!E0(t)||!E4(t)){const{remoteSnapshot:m,globalSnapshot:h}=await s.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:t,id:N0(t.name,a)});nN(p,m);const c={remote:t,preloadConfig:{nameOrAlias:n,exposes:[a],resourceCategory:"sync",share:!1,depsRemote:!1}},x=await s.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({origin:s,preloadOptions:c,remoteInfo:p,remote:t,remoteSnapshot:m,globalSnapshot:h});return x&&J4(p,s,x,!1,{initiator:"loadRemote",id:f}).catch(()=>{}),{...e,remoteSnapshot:m}}return e}}}function uoe(e){const 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 aN(e,t,n,a,s={},p){const{value:f}=ml(e,dm(t)),m=p||f;if(m&&!x4(m)&&(n(m,t,a),m.remotesInfo)){const h=Object.keys(m.remotesInfo);for(const c of h){if(s[c])continue;s[c]=!0;const x=uoe(c),M=m.remotesInfo[c];aN(e,{name:x.name,version:M.matchedVersion},n,!1,s,void 0)}}}var Jg=(e,t)=>document.querySelector(`${e}[${e==="link"?"href":"src"}="${t}"]`);function doe(e,t,n,a,s){const p=[],f=[],m=[],h=new Set,c=new Set,{options:x}=e,{preloadConfig:M}=t,{depsRemote:C}=M;if(aN(a,n,(R,_,j)=>{let D;if(j)D=M;else if(Array.isArray(C)){const ae=C.find(V=>V.nameOrAlias===_.name||V.nameOrAlias===_.alias);if(!ae)return;D=X4(ae)}else if(C===!0)D=M;else return;const z=Fy(R,I4(R).url);z&&m.push({name:_.name,moduleInfo:{name:_.name,entry:z,type:"remoteEntryType"in R?R.remoteEntryType:"global",entryGlobalName:"globalName"in R?R.globalName:_.name,shareScope:"",version:"version"in R?R.version:void 0},url:z});let B="modules"in R?R.modules:[];const L=ioe(D.exposes);L.length&&"modules"in R&&(B=R?.modules?.reduce((ae,V)=>(L?.indexOf(V.moduleName)!==-1&&ae.push(V),ae),[]));function G(ae){const V=ae.map(F=>Fy(R,F));return D.filter?V.filter(D.filter):V}if(B){const ae=B.length;for(let V=0;V<ae;V++){const F=B[V],fe=`${_.name}/${F.moduleName}`;e.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({id:F.moduleName==="."?_.name:fe,name:_.name,remoteSnapshot:R,preloadConfig:D,remote:_,origin:e}),!dre(fe)&&(D.resourceCategory==="all"?(p.push(...G(F.assets.css.async)),p.push(...G(F.assets.css.sync)),f.push(...G(F.assets.js.async)),f.push(...G(F.assets.js.sync))):D.resourceCategory==="sync"&&(p.push(...G(F.assets.css.sync)),f.push(...G(F.assets.js.sync))),pre(fe))}}},!0,{},s),s.shared&&s.shared.length>0){const R=(_,j)=>{const{shared:D}=jp(e.shareScopeMap,j.sharedName,_,e.sharedHandler.hooks.lifecycle.resolveShare)||{};D&&typeof D.lib=="function"&&(j.assets.js.sync.forEach(z=>{h.add(z)}),j.assets.css.sync.forEach(z=>{c.add(z)}))};s.shared.forEach(_=>{const j=x.shared?.[_.sharedName];if(!j)return;const D=_.version?j.find(z=>z.version===_.version):j;D&&R4(D).forEach(z=>{R(z,_)})})}const E=f.filter(R=>!h.has(R)&&!Jg("script",R));return{cssAssets:p.filter(R=>!c.has(R)&&!Jg("link",R)),jsAssetsWithoutEntry:E,entryAssets:m.filter(R=>!Jg("script",R.url))}}var poe=function(){return{name:"generate-preload-assets-plugin",async generatePreloadAssets(e){const{origin:t,preloadOptions:n,remoteInfo:a,remote:s,globalSnapshot:p,remoteSnapshot:f}=e;return Kr?E0(s)&&E4(s)?{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[{name:s.name,url:s.entry,moduleInfo:{name:a.name,entry:s.entry,type:a.type||"global",entryGlobalName:"",shareScope:""}}]}:(nN(a,f),doe(t,n,a,p,f)):{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[]}}}};function iN(e,t){const n=_p({name:t.name,version:t.options.version}),a=n&&"remotesInfo"in n&&n.remotesInfo&&ml(n.remotesInfo,e.name).value;return a&&a.matchedVersion?{hostGlobalSnapshot:n,globalSnapshot:SC(),remoteSnapshot:_p({name:e.name,version:a.matchedVersion})}:{hostGlobalSnapshot:void 0,globalSnapshot:SC(),remoteSnapshot:_p({name:e.name,version:"version"in e?e.version:void 0})}}var moe=class{constructor(e){this.loadingHostSnapshot=null,this.manifestCache=new Map,this.hooks=new nl({beforeLoadRemoteSnapshot:new En("beforeLoadRemoteSnapshot"),loadSnapshot:new Fr("loadGlobalSnapshot"),loadRemoteSnapshot:new Fr("loadRemoteSnapshot"),afterLoadSnapshot:new Fr("afterLoadSnapshot")}),this.manifestLoading=iu.__FEDERATION__.__MANIFEST_LOADING__,this.HostInstance=e,this.loaderHook=e.loaderHook}async loadRemoteSnapshotInfo({moduleInfo:e,id:t,initiator:n="loadRemote"}){const{options:a}=this.HostInstance;await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({options:a,moduleInfo:e,origin:this.HostInstance});let s=_p({name:this.HostInstance.options.name,version:this.HostInstance.options.version});s||(s={version:this.HostInstance.options.version||"",remoteEntry:"",remotesInfo:{}},cre({[this.HostInstance.options.name]:s})),s&&"remotesInfo"in s&&!ml(s.remotesInfo,e.name).value&&("version"in e||"entry"in e)&&(s.remotesInfo={...s?.remotesInfo,[e.name]:{matchedVersion:"version"in e?e.version:e.entry}});const{hostGlobalSnapshot:p,remoteSnapshot:f,globalSnapshot:m}=this.getGlobalRemoteInfo(e),{remoteSnapshot:h,globalSnapshot:c}=await this.hooks.lifecycle.loadSnapshot.emit({options:a,moduleInfo:e,hostGlobalSnapshot:p,remoteSnapshot:f,globalSnapshot:m});let x,M;if(h)if(x4(h)){const C=Kr?h.remoteEntry:h.ssrRemoteEntry||h.remoteEntry||"",E=await this.loadManifestSnapshot(C,e,{},{initiator:n,id:t||e.name}),R=xC({...e,entry:C},E);x=E,M=R}else{const{remoteSnapshot:C}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:h,from:"global"});x=C,M=c}else if(E0(e)){const C=await this.loadManifestSnapshot(e.entry,e,{},{initiator:n,id:t||e.name}),E=xC(e,C);x=C,M=E}else Yt(H4,ya,{remoteName:e.name,remoteVersion:e.version,hostName:this.HostInstance.options.name,globalSnapshot:JSON.stringify(c)},void 0,tr(this.HostInstance.options));return await this.hooks.lifecycle.afterLoadSnapshot.emit({id:t,host:this.HostInstance,options:a,moduleInfo:e,remoteSnapshot:x}),{remoteSnapshot:x,globalSnapshot:M}}getGlobalRemoteInfo(e){return iN(e,this.HostInstance)}async getManifestJson(e,t,n,a){return(async()=>{const p=Ys(t);let f=this.manifestCache.get(e);if(f)return f;try{let h=await this.loaderHook.lifecycle.fetch.emit(e,{},p,a?{...a,url:e,resourceType:"manifest"}:void 0);(!h||!(h instanceof Response))&&(h=await fetch(e,{})),f=await h.json()}catch(h){f=await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:h,from:"runtime",lifecycle:"afterResolve",remote:p,origin:this.HostInstance}),f||(delete this.manifestLoading[e],Yt(B4,ya,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name},`${h}`,tr(this.HostInstance.options)))}const m=[!f.metaData&&"metaData",!f.exposes&&"exposes",!f.shared&&"shared"].filter(Boolean);return m.length>0&&await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:new Error(`"${e}" is not a valid federation manifest for remote "${t.name}". Missing required fields: ${m.join(", ")}.`),from:"runtime",lifecycle:"afterResolve",remote:p,origin:this.HostInstance}),m.length>0&&Yt(G4,ya,{manifestUrl:e,moduleName:t.name,hostName:this.HostInstance.options.name,missingFields:m.join(",")},void 0,tr(this.HostInstance.options)),this.manifestCache.set(e,f),f})()}async loadManifestSnapshot(e,t,n,a){const s=async()=>{const p=await this.getManifestJson(e,t,n,a),f=$ie(p,{version:e}),{remoteSnapshot:m}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:t,manifestJson:p,remoteSnapshot:f,manifestUrl:e,from:"manifest"});return m};return this.manifestLoading[e]||(this.manifestLoading[e]=s().then(p=>p)),this.manifestLoading[e]}},foe=class{constructor(e){this.hooks=new nl({beforeRegisterShare:new tl("beforeRegisterShare"),afterResolve:new Fr("afterResolve"),beforeLoadShare:new Fr("beforeLoadShare"),loadShare:new En,afterLoadShare:new ga("afterLoadShare"),errorLoadShare:new ga("errorLoadShare"),resolveShare:new tl("resolveShare"),initContainerShareScopeMap:new tl("initContainerShareScopeMap")}),this.host=e,this.shareScopeMap={},this.initTokens={},this._setGlobalShareScopeMap(e.options)}emitAfterLoadShare({lifecycle:e,pkgName:t,shareInfo:n,selectedShared:a}){try{this.hooks.lifecycle.afterLoadShare.emit({pkgName:t,shareInfo:n,selectedShared:a,shared:this.host.options.shared,shareScopeMap:this.shareScopeMap,lifecycle:e,origin:this.host})}catch(s){au(s)}}emitErrorLoadShare({lifecycle:e,pkgName:t,shareInfo:n,error:a,recovered:s}){try{this.hooks.lifecycle.errorLoadShare.emit({pkgName:t,shareInfo:n,shared:this.host.options.shared,shareScopeMap:this.shareScopeMap,lifecycle:e,origin:this.host,error:a,recovered:s})}catch(p){au(p)}}registerShared(e,t){const{newShareInfos:n,allShareInfos:a}=D4(e,t);return Object.keys(n).forEach(s=>{n[s].forEach(p=>{p.scope.forEach(f=>{this.hooks.lifecycle.beforeRegisterShare.emit({origin:this.host,pkgName:s,shared:p}),this.shareScopeMap[f]?.[s]||this.setShared({pkgName:s,lib:p.lib,get:p.get,loaded:p.loaded||!!p.lib,shared:p,from:t.name})})})}),{newShareInfos:n,allShareInfos:a}}async loadShare(e,t){const{host:n}=this,a=EC({pkgName:e,extraOptions:t,shareInfos:n.options.shared});let s=a;try{a?.scope&&await Promise.all(a.scope.map(async h=>{await Promise.all(this.initializeSharing(h,{strategy:a.strategy}))})),s=(await this.hooks.lifecycle.beforeLoadShare.emit({pkgName:e,shareInfo:a,shared:n.options.shared,origin:n})).shareInfo,Xi(s,`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.`);const p=s,{shared:f,useTreesShaking:m}=jp(this.shareScopeMap,e,s,this.hooks.lifecycle.resolveShare)||{};if(f){const h=ip(f,m);if(h.lib)return Ls(h,n.options.name),this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:p,selectedShared:f}),h.lib;if(h.loading&&!h.loaded){const c=await h.loading;return h.loaded=!0,h.lib||(h.lib=c),Ls(h,n.options.name),this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:p,selectedShared:f}),c}else{const x=(async()=>{const C=await h.get();return Ls(h,n.options.name),h.loaded=!0,h.lib=C,C})();this.setShared({pkgName:e,loaded:!1,shared:f,from:n.options.name,lib:null,loading:x,treeShaking:m?h:void 0});const M=await x;return this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:p,selectedShared:f}),M}}else{if(t?.customShareInfo)return this.emitErrorLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:p,recovered:!0}),!1;const h=ru(p.treeShaking),c=ip(p,h),M=(async()=>{const E=await c.get();c.lib=E,c.loaded=!0,Ls(c,n.options.name);const{shared:R,useTreesShaking:_}=jp(this.shareScopeMap,e,p,this.hooks.lifecycle.resolveShare)||{};if(R){const j=ip(R,_);j.lib=E,j.loaded=!0,R.from=p.from}return E})();this.setShared({pkgName:e,loaded:!1,shared:p,from:n.options.name,lib:null,loading:M,treeShaking:h?c:void 0});const C=await M;return this.emitAfterLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:p,selectedShared:p}),C}}catch(p){throw this.emitErrorLoadShare({lifecycle:"loadShare",pkgName:e,shareInfo:s,error:p}),p}}initializeSharing(e=Fm,t){const{host:n}=this,a=t?.from,s=t?.strategy;let p=t?.initScope;const f=[];if(a!=="build"){const{initTokens:C}=this;p||(p=[]);let E=C[e];if(E||(E=C[e]={from:this.host.name}),p.indexOf(E)>=0)return f;p.push(E)}const m=this.shareScopeMap,h=n.options.name;m[e]||(m[e]={});const c=m[e],x=(C,E)=>{const{version:R,eager:_}=E;c[C]=c[C]||{};const j=c[C],D=j[R]&&ip(j[R]),z=!!(D&&("eager"in D&&D.eager||"shareConfig"in D&&D.shareConfig?.eager));(!D||D.strategy!=="loaded-first"&&!D.loaded&&(!_!=!z?_:h>j[R].from))&&(j[R]=E)},M=async C=>{const{module:E}=await n.remoteHandler.getRemoteModuleAndOptions({id:C});let R;try{R=await E.getEntry()}catch(_){if(R=await n.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:C,error:_,from:"runtime",lifecycle:"beforeLoadShare",remote:E.remoteInfo,origin:n}),!R)return}finally{R?.init&&!E.initing&&(E.remoteEntryExports=R,await E.init(void 0,void 0,p))}};return Object.keys(n.options.shared).forEach(C=>{n.options.shared[C].forEach(E=>{E.scope.includes(e)&&x(C,E)})}),(n.options.shareStrategy==="version-first"||s==="version-first")&&n.options.remotes.forEach(C=>{C.shareScope===e&&f.push(M(C.name))}),f}loadShareSync(e,t){const{host:n}=this,a=EC({pkgName:e,extraOptions:t,shareInfos:n.options.shared});try{a?.scope&&a.scope.forEach(p=>{this.initializeSharing(p,{strategy:a.strategy})});const{shared:s}=jp(this.shareScopeMap,e,a,this.hooks.lifecycle.resolveShare)||{};if(s){if(typeof s.lib=="function")return Ls(s,n.options.name),s.loaded||(s.loaded=!0,s.from===n.options.name&&(a.loaded=!0)),this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:a,selectedShared:s}),s.lib;if(typeof s.get=="function"){const p=s.get();if(!(p instanceof Promise))return Ls(s,n.options.name),this.setShared({pkgName:e,loaded:!0,from:n.options.name,lib:p,shared:s}),this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:a,selectedShared:s}),p}}if(a.lib)return a.loaded||(a.loaded=!0),this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:a,selectedShared:a}),a.lib;if(a.get){const p=a.get();return p instanceof Promise&&Yt(t?.from==="build"?U4:Qy,ya,{hostName:n.options.name,sharedPkgName:e},void 0,tr(n.options)),a.lib=p,this.setShared({pkgName:e,loaded:!0,from:n.options.name,lib:a.lib,shared:a}),this.emitAfterLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:a,selectedShared:a}),a.lib}Yt(Qy,ya,{hostName:n.options.name,sharedPkgName:e},void 0,tr(n.options))}catch(s){throw this.emitErrorLoadShare({lifecycle:"loadShareSync",pkgName:e,shareInfo:a,error:s}),s}}initShareScopeMap(e,t,n={}){const{host:a}=this;this.shareScopeMap[e]=t,this.hooks.lifecycle.initContainerShareScopeMap.emit({shareScope:t,options:a.options,origin:a,scopeName:e,hostShareScopeMap:n.hostShareScopeMap})}setShared({pkgName:e,shared:t,from:n,lib:a,loading:s,loaded:p,get:f,treeShaking:m}){const{version:h,scope:c="default",...x}=t,M=Array.isArray(c)?c:[c],C=E=>{const R=(j,D,z)=>{z&&!j[D]&&(j[D]=z)},_=m?E.treeShaking:E;R(_,"loaded",p),R(_,"loading",s),R(_,"get",f)};M.forEach(E=>{this.shareScopeMap[E]||(this.shareScopeMap[E]={}),this.shareScopeMap[E][e]||(this.shareScopeMap[E][e]={}),this.shareScopeMap[E][e][h]||(this.shareScopeMap[E][e][h]={version:h,scope:[E],...x,lib:a});const R=this.shareScopeMap[E][e][h];C(R),n&&R.from!==n&&(R.from=n)})}_setGlobalShareScopeMap(e){const t=z4(),n=e.id||e.name;n&&!t[n]&&(t[n]=this.shareScopeMap)}},hoe=class{constructor(e){this.hooks=new nl({beforeRegisterRemote:new tl("beforeRegisterRemote"),registerRemote:new tl("registerRemote"),beforeRequest:new Fr("beforeRequest"),afterMatchRemote:new En("afterMatchRemote"),onLoad:new En("onLoad"),afterLoadRemote:new En("afterLoadRemote"),handlePreloadModule:new ga("handlePreloadModule"),errorLoadRemote:new En("errorLoadRemote"),beforePreloadRemote:new En("beforePreloadRemote"),generatePreloadAssets:new En("generatePreloadAssets"),afterPreloadRemote:new En("afterPreloadRemote"),loadEntry:new En}),this.host=e,this.idToRemoteMap={}}formatAndRegisterRemote(e,t){return(t.remotes||[]).reduce((n,a)=>(this.registerRemote(a,n,{force:!1}),n),e.remotes)}setIdToRemoteMap(e,t){const{remote:n,expose:a}=t,{name:s,alias:p}=n;if(this.idToRemoteMap[e]={name:n.name,expose:a},p&&e.startsWith(s)){const f=e.replace(s,p);this.idToRemoteMap[f]={name:n.name,expose:a};return}if(p&&e.startsWith(p)){const f=e.replace(p,s);this.idToRemoteMap[f]={name:n.name,expose:a}}}async loadRemote(e,t){const{host:n}=this,a=RC(n.options.remotes,e);let s=e,p=a?.expose,f=a?Ys(a.remote):void 0,m;try{const{loadFactory:h=!0}=t||{loadFactory:!0},{module:c,moduleOptions:x,remoteMatchInfo:M}=await this.getRemoteModuleAndOptions({id:e}),{pkgNameOrAlias:C,remote:E,expose:R,id:_,remoteSnapshot:j}=M;s=_,p=R,f=Ys(E);const D=await c.get(_,R,t,j),z=await this.hooks.lifecycle.onLoad.emit({id:_,pkgNameOrAlias:C,expose:R,exposeModule:h?D:void 0,exposeModuleFactory:h?void 0:D,remote:E,options:x,moduleInstance:c,origin:n});return this.setIdToRemoteMap(e,M),m={id:s,expose:p,remote:f,options:t,origin:n},typeof z=="function"?z:D}catch(h){const{from:c="runtime"}=t||{from:"runtime"};let x;try{x=await this.hooks.lifecycle.errorLoadRemote.emit({id:e,error:h,from:c,lifecycle:"onLoad",expose:p,remote:f,origin:n})}catch(M){throw m={id:s,expose:p,remote:f,options:t,error:M,origin:n},M}if(!x)throw m={id:s,expose:p,remote:f,options:t,error:h,origin:n},h;return m={id:s,expose:p,remote:f,options:t,error:h,origin:n,recovered:!0},x}finally{m&&await this.hooks.lifecycle.afterLoadRemote.emit(m)}}async preloadRemote(e){const{host:t}=this,n=[];await this.hooks.lifecycle.beforePreloadRemote.emit({preloadOps:e,options:t.options,origin:t});const a=aoe(t.options.remotes,e),s=m=>{const{preloadConfig:h,remote:c}=m,x=h.exposes||[];return x.length?x.map(M=>({ops:{...m,preloadConfig:{...h,exposes:[M]}},id:N0(c.name,M)})):[{ops:m,id:`${c.name}/*`}]};let p;await Promise.all(a.flatMap(s).map(async m=>{const{ops:h,id:c}=m,{remote:x,preloadConfig:M}=h,C=Ys(x);try{const{globalSnapshot:E,remoteSnapshot:R}=await t.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:x,id:c,initiator:"preloadRemote"}),_=await this.hooks.lifecycle.generatePreloadAssets.emit({origin:t,preloadOptions:h,remote:x,remoteInfo:C,globalSnapshot:E,remoteSnapshot:R});if(!_)return;const j=await J4(C,t,_,!0,{initiator:"preloadRemote",id:c});n.push({remote:x,remoteInfo:C,preloadConfig:M,id:c,results:j})}catch(E){n.push({remote:x,remoteInfo:C,preloadConfig:M,id:c,results:[{url:C.entry,status:"error",resourceType:/\.json(?:$|[?#])/i.test(C.entry)?"manifest":"remoteEntry",initiator:"preloadRemote",id:c,error:E}]})}}));const f=n.flatMap(m=>m.results.filter(h=>h.status==="error"||h.status==="timeout"));if(f.length>0&&(p=new Error(`preloadRemote failed to load ${f.length} resource(s).`),Object.assign(p,{results:n,failedResults:f})),await this.hooks.lifecycle.afterPreloadRemote.emit({preloadOps:e,options:t.options,origin:t,results:n,error:p}),p)throw p}registerRemotes(e,t){const{host:n}=this;e.forEach(a=>{this.registerRemote(a,n.options.remotes,{force:t?.force})})}async getRemoteModuleAndOptions(e){const{host:t}=this,{id:n}=e;let a;try{a=await this.hooks.lifecycle.beforeRequest.emit({id:n,options:t.options,origin:t})}catch(E){if(a=await this.hooks.lifecycle.errorLoadRemote.emit({id:n,options:t.options,origin:t,from:"runtime",error:E,lifecycle:"beforeRequest"}),!a)throw E}const{id:s}=a,p=RC(t.options.remotes,s);if(!p)try{Yt(F4,ya,{hostName:t.options.name,requestId:s},void 0,tr(t.options))}catch(E){throw await this.hooks.lifecycle.afterMatchRemote.emit({id:s,options:t.options,error:E,origin:t}),E}const{remote:f}=p,m=Ys(f);await this.hooks.lifecycle.afterMatchRemote.emit({id:s,...p,options:t.options,remoteInfo:m,origin:t});const h=await t.sharedHandler.hooks.lifecycle.afterResolve.emit({id:s,...p,options:t.options,origin:t,remoteInfo:m}),{remote:c,expose:x}=h;Xi(c&&x,`The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${s}.`);let M=t.moduleCache.get(c.name);const C={host:t,remoteInfo:m};return M||(M=new eN(C),t.moduleCache.set(c.name,M)),{module:M,moduleOptions:C,remoteMatchInfo:h}}registerRemote(e,t,n){const{host:a}=this,s=()=>{if(e.alias){const f=t.find(m=>e.alias&&(m.name.startsWith(e.alias)||m.alias?.startsWith(e.alias)));Xi(!f,`The alias ${e.alias} of remote ${e.name} is not allowed to be the prefix of ${f&&f.name} name or alias`)}"entry"in e&&Kr&&typeof window<"u"&&!e.entry.startsWith("http")&&(e.entry=new URL(e.entry,window.location.origin).href),e.shareScope||(e.shareScope=Fm),e.type||(e.type=qre)};this.hooks.lifecycle.beforeRegisterRemote.emit({remote:e,origin:a});const p=t.find(f=>f.name===e.name);if(!p)s(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:a});else{const f=[`The remote "${e.name}" is already registered.`,"Please note that overriding it may cause unexpected errors."];n?.force&&(this.removeRemote(p),s(),t.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:a}),b4(f.join(" ")))}}removeRemote(e){try{const{host:t}=this,{name:n}=e,a=t.options.remotes.findIndex(p=>p.name===n);a!==-1&&t.options.remotes.splice(a,1);const s=t.moduleCache.get(e.name);if(s){const p=s.remoteInfo,f=p.entryGlobalName;Un[f]&&(Object.getOwnPropertyDescriptor(Un,f)?.configurable?delete Un[f]:Un[f]=void 0);const m=Vy(s.remoteInfo);Ws[m]&&delete Ws[m],t.snapshotHandler.manifestCache.delete(p.entry);let h=p.buildVersion?y4(p.name,p.buildVersion):p.name;const c=Un.__FEDERATION__.__INSTANCES__.findIndex(M=>p.buildVersion?M.options.id===h:M.name===h);if(c!==-1){const M=Un.__FEDERATION__.__INSTANCES__[c];h=M.options.id||h;const C=z4();let E=!0;const R=[];Object.keys(C).forEach(_=>{const j=C[_];j&&Object.keys(j).forEach(D=>{const z=j[D];z&&Object.keys(z).forEach(B=>{const L=z[B];L&&Object.keys(L).forEach(G=>{const ae=L[G];ae&&typeof ae=="object"&&ae.from===p.name&&(ae.loaded||ae.loading?(ae.useIn=ae.useIn.filter(V=>V!==p.name),ae.useIn.length?E=!1:R.push([_,D,B,G])):R.push([_,D,B,G]))})})})}),E&&(M.shareScopeMap={},delete C[h]),R.forEach(([_,j,D,z])=>{delete C[_]?.[j]?.[D]?.[z]}),Un.__FEDERATION__.__INSTANCES__.splice(c,1)}const{hostGlobalSnapshot:x}=iN(e,t);if(x){const M=x&&"remotesInfo"in x&&x.remotesInfo&&ml(x.remotesInfo,e.name).key;M&&(delete x.remotesInfo[M],iu.__FEDERATION__.__MANIFEST_LOADING__[M]&&delete iu.__FEDERATION__.__MANIFEST_LOADING__[M])}t.moduleCache.delete(e.name)}}catch(t){$y.error(`removeRemote failed: ${t instanceof Error?t.message:String(t)}`)}}},goe=typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN=="boolean"?!FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN:!0,voe=class{constructor(e){this.hooks=new nl({beforeInit:new tl("beforeInit"),init:new ga,beforeInitContainer:new Fr("beforeInitContainer"),initContainer:new Fr("initContainer")}),this.version="2.5.1",this.moduleCache=new Map,this.loaderHook=new nl({getModuleInfo:new ga,createScript:new ga,createLink:new ga,fetch:new En,loadEntryError:new En,afterLoadEntry:new En("afterLoadEntry"),beforeInitRemote:new En("beforeInitRemote"),afterInitRemote:new En("afterInitRemote"),beforeGetExpose:new En("beforeGetExpose"),afterGetExpose:new En("afterGetExpose"),beforeExecuteFactory:new En("beforeExecuteFactory"),afterExecuteFactory:new En("afterExecuteFactory"),getModuleFactory:new En}),this.bridgeHook=new nl({beforeBridgeRender:new ga,afterBridgeRender:new ga,beforeBridgeDestroy:new ga,afterBridgeDestroy:new ga});const t=goe?[coe(),poe()]:[],n={id:eoe(),name:e.name,plugins:t,remotes:[],shared:{},inBrowser:Kr};this.name=e.name,this.options=n,this.snapshotHandler=new moe(this),this.sharedHandler=new foe(this),this.remoteHandler=new hoe(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&&Yt(A4(Q4,ya)),this.registerPlugins(e.plugins);const 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=Fm,t){return this.sharedHandler.initializeSharing(e,t)}initRawContainer(e,t,n){const a=Ys({name:e,entry:t}),s=new eN({host:this,remoteInfo:a});return s.remoteEntryExports=n,this.moduleCache.set(e,s),s}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){const{allShareInfos:n}=D4(e,t),{userOptions:a,options:s}=this.hooks.lifecycle.beforeInit.emit({origin:this,userOptions:t,options:e,shareInfo:n}),p=this.remoteHandler.formatAndRegisterRemote(s,a),{allShareInfos:f}=this.sharedHandler.registerShared(s,a),m=[...s.plugins];a.plugins&&a.plugins.forEach(c=>{m.includes(c)||m.push(c)});const h={...e,...t,plugins:m,remotes:p,shared:f,id:a.id||e.id};return this.hooks.lifecycle.init.emit({origin:this,options:h}),h}registerPlugins(e){const t=toe(e,this);this.options.plugins=this.options.plugins.reduce((n,a)=>(a&&n&&!n.find(s=>s.name===a.name)&&n.push(a),n),t||[])}registerRemotes(e,t){return this.remoteHandler.registerRemotes(e,t)}registerShared(e){this.sharedHandler.registerShared(this.options,{...this.options,shared:e})}};sre(voe);var yoe="camstack-mount",boe=/^\/(?:[A-Za-z0-9_\-.]+\/)*$/,ev=null;function IC(e){if(e==null||e==="")return null;const t=e.endsWith("/")?e:`${e}/`;return!boe.test(t)||t.includes("/../")||t.includes("/./")?null:t}function Soe(){if(typeof document>"u")return"/";const e=IC(document.querySelector(`meta[name="${yoe}"]`)?.getAttribute("content"));if(e!==null)return e;if(document.querySelector("base[href]")!==null)try{const t=new URL(document.baseURI);if(t.origin===window.location.origin){const n=IC(t.pathname);if(n!==null)return n}}catch{}return"/"}function rN(){return ev===null&&(ev=Soe()),ev}function P0(){return rN().replace(/\/$/,"")}function xoe(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")}function Pve(e){if(xoe(e))return e;const t=rN(),n=e.replace(/^\/+/,"");return t!=="/"&&(e===P0()||e.startsWith(t))?e:`${t}${n}`}function koe(){return`${typeof window<"u"?window.location.origin:""}${P0()}`}Ci("camstack:widget-registry",null);function Dve({title:e,icon:t,headerRight:n,collapsible:a=!1,defaultOpen:s=!0,bodyClassName:p="p-3",children:f}){const[m,h]=T.useState(s),c=!a||m,x=v.jsxs(v.Fragment,{children:[v.jsxs("span",{className:"flex items-center gap-2 text-xs font-semibold uppercase tracking-wider text-foreground",children:[t,e]}),a?m?v.jsx(Uo,{className:"h-3.5 w-3.5 text-foreground-subtle"}):v.jsx(Fne,{className:"h-3.5 w-3.5 text-foreground-subtle"}):n]}),M=`px-4 py-2 flex items-center justify-between ${c?"border-b border-border":""}`;return v.jsxs("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[a?v.jsx("button",{type:"button",onClick:()=>h(C=>!C),className:`w-full text-left ${M}`,children:x}):v.jsx("div",{className:M,children:x}),c?v.jsx("div",{className:p,children:f}):null]})}var woe="capability.binding-changed";function Eu(e,t){const[n,a]=T.useState(null);return T.useEffect(()=>{if(t===null){a(null);return}let s=!1;const p=async()=>{try{const m=await e.deviceManager.getBindings.query({deviceId:t});s||a(m)}catch{s||a(m=>m)}};p();const f=e.live?.onEvent.subscribe({category:woe},{onData:m=>{const h=m.data?.source;if(!h){p();return}h.type==="device"&&h.id===t&&p()}});return()=>{s=!0,f?.unsubscribe()}},[e,t]),T.useMemo(()=>n?xR(e,n):null,[e,n])}function jo(e){const t=T.useCallback(a=>e?e.subscribe(()=>a()):()=>{},[e]),n=T.useCallback(()=>e?.value,[e]);return T.useSyncExternalStore(t,n,n)}var Moe="/addon/snapshot/media";function zve(e,t={}){const{width:n,baseUrl:a}=t,[s,p]=T.useState(0);return{src:T.useMemo(()=>{if(e===null||e<=0)return null;const f=a!==void 0?a.replace(/\/+$/,""):P0(),m=new URLSearchParams;n!==void 0&&Number.isInteger(n)&&n>0&&m.set("w",String(n)),s>0&&(m.set("force","1"),m.set("r",String(s)));const h=m.toString();return`${f}${Moe}/${String(e)}.jpg${h.length>0?`?${h}`:""}`},[e,n,a,s]),loading:!1,refresh:T.useCallback(()=>{p(f=>f+1)},[])}}U.Camera;function gt(e){const t=Eu(e.trpc,e.deviceId),n=jo(t!==null?e.slice(t):void 0),a=t!==null?e.cap(t):void 0,s=jo(t!==null?t.state.deviceStatus:void 0),p=s?.online??!0,f=p?null:s?.lastChangedAt??null;return{dev:t,cap:a,slice:n,available:(e.requireFeature===void 0||(e.deviceFeatures??[]).includes(e.requireFeature))&&a!==void 0&&n!==void 0&&p,online:p,offlineSince:f}}function Coe(e){if(e==null||typeof e!="object")return null;const t=Reflect.get(e,"data");if(t!=null&&typeof t=="object"){const n=Reflect.get(t,"capRouteReason");if(typeof n=="string")return n}return null}function Lve(e){const t=Coe(e);return t!==null?t==="no-provider"||t==="node-offline":(e instanceof Error?e.message:String(e)).includes("provider not available")}Ci("camstack:vod-playback",{request:null,play:()=>{},clear:()=>{}});Ci("camstack:recorded-playback",{bindControlChannel:null,channelOpen:!1,mode:"live",positionMs:null,send:()=>!1});T.lazy(()=>il(()=>import("./MotionZonesSettings-7c3yiT5E-CzRwhaU6.js"),__vite__mapDeps([0,1]),import.meta.url).then(e=>({default:e.MotionZonesSettings}))),T.lazy(()=>il(()=>import("./PrivacyMaskSettings-PkYs077O-D_lYJ0Lt.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>({default:e.PrivacyMaskSettings})));var Aoe=Object.defineProperty,mm=Object.getOwnPropertySymbols,oN=Object.prototype.hasOwnProperty,sN=Object.prototype.propertyIsEnumerable,TC=(e,t,n)=>t in e?Aoe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Gy=(e,t)=>{for(var n in t||(t={}))oN.call(t,n)&&TC(e,n,t[n]);if(mm)for(var n of mm(t))sN.call(t,n)&&TC(e,n,t[n]);return e},Zy=(e,t)=>{var n={};for(var a in e)oN.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(e!=null&&mm)for(var a of mm(e))t.indexOf(a)<0&&sN.call(e,a)&&(n[a]=e[a]);return n};var zo;(e=>{const t=class ht{constructor(h,c,x,M){if(this.version=h,this.errorCorrectionLevel=c,this.modules=[],this.isFunction=[],h<ht.MIN_VERSION||h>ht.MAX_VERSION)throw new RangeError("Version value out of range");if(M<-1||M>7)throw new RangeError("Mask value out of range");this.size=h*4+17;let C=[];for(let R=0;R<this.size;R++)C.push(!1);for(let R=0;R<this.size;R++)this.modules.push(C.slice()),this.isFunction.push(C.slice());this.drawFunctionPatterns();const E=this.addEccAndInterleave(x);if(this.drawCodewords(E),M==-1){let R=1e9;for(let _=0;_<8;_++){this.applyMask(_),this.drawFormatBits(_);const j=this.getPenaltyScore();j<R&&(M=_,R=j),this.applyMask(_)}}s(0<=M&&M<=7),this.mask=M,this.applyMask(M),this.drawFormatBits(M),this.isFunction=[]}static encodeText(h,c){const x=e.QrSegment.makeSegments(h);return ht.encodeSegments(x,c)}static encodeBinary(h,c){const x=e.QrSegment.makeBytes(h);return ht.encodeSegments([x],c)}static encodeSegments(h,c,x=1,M=40,C=-1,E=!0){if(!(ht.MIN_VERSION<=x&&x<=M&&M<=ht.MAX_VERSION)||C<-1||C>7)throw new RangeError("Invalid value");let R,_;for(R=x;;R++){const B=ht.getNumDataCodewords(R,c)*8,L=f.getTotalBits(h,R);if(L<=B){_=L;break}if(R>=M)throw new RangeError("Data too long")}for(const B of[ht.Ecc.MEDIUM,ht.Ecc.QUARTILE,ht.Ecc.HIGH])E&&_<=ht.getNumDataCodewords(R,B)*8&&(c=B);let j=[];for(const B of h){n(B.mode.modeBits,4,j),n(B.numChars,B.mode.numCharCountBits(R),j);for(const L of B.getData())j.push(L)}s(j.length==_);const D=ht.getNumDataCodewords(R,c)*8;s(j.length<=D),n(0,Math.min(4,D-j.length),j),n(0,(8-j.length%8)%8,j),s(j.length%8==0);for(let B=236;j.length<D;B^=253)n(B,8,j);let z=[];for(;z.length*8<j.length;)z.push(0);return j.forEach((B,L)=>z[L>>>3]|=B<<7-(L&7)),new ht(R,c,z,C)}getModule(h,c){return 0<=h&&h<this.size&&0<=c&&c<this.size&&this.modules[c][h]}getModules(){return this.modules}drawFunctionPatterns(){for(let x=0;x<this.size;x++)this.setFunctionModule(6,x,x%2==0),this.setFunctionModule(x,6,x%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const h=this.getAlignmentPatternPositions(),c=h.length;for(let x=0;x<c;x++)for(let M=0;M<c;M++)x==0&&M==0||x==0&&M==c-1||x==c-1&&M==0||this.drawAlignmentPattern(h[x],h[M]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(h){const c=this.errorCorrectionLevel.formatBits<<3|h;let x=c;for(let C=0;C<10;C++)x=x<<1^(x>>>9)*1335;const M=(c<<10|x)^21522;s(M>>>15==0);for(let C=0;C<=5;C++)this.setFunctionModule(8,C,a(M,C));this.setFunctionModule(8,7,a(M,6)),this.setFunctionModule(8,8,a(M,7)),this.setFunctionModule(7,8,a(M,8));for(let C=9;C<15;C++)this.setFunctionModule(14-C,8,a(M,C));for(let C=0;C<8;C++)this.setFunctionModule(this.size-1-C,8,a(M,C));for(let C=8;C<15;C++)this.setFunctionModule(8,this.size-15+C,a(M,C));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let h=this.version;for(let x=0;x<12;x++)h=h<<1^(h>>>11)*7973;const c=this.version<<12|h;s(c>>>18==0);for(let x=0;x<18;x++){const M=a(c,x),C=this.size-11+x%3,E=Math.floor(x/3);this.setFunctionModule(C,E,M),this.setFunctionModule(E,C,M)}}drawFinderPattern(h,c){for(let x=-4;x<=4;x++)for(let M=-4;M<=4;M++){const C=Math.max(Math.abs(M),Math.abs(x)),E=h+M,R=c+x;0<=E&&E<this.size&&0<=R&&R<this.size&&this.setFunctionModule(E,R,C!=2&&C!=4)}}drawAlignmentPattern(h,c){for(let x=-2;x<=2;x++)for(let M=-2;M<=2;M++)this.setFunctionModule(h+M,c+x,Math.max(Math.abs(M),Math.abs(x))!=1)}setFunctionModule(h,c,x){this.modules[c][h]=x,this.isFunction[c][h]=!0}addEccAndInterleave(h){const c=this.version,x=this.errorCorrectionLevel;if(h.length!=ht.getNumDataCodewords(c,x))throw new RangeError("Invalid argument");const M=ht.NUM_ERROR_CORRECTION_BLOCKS[x.ordinal][c],C=ht.ECC_CODEWORDS_PER_BLOCK[x.ordinal][c],E=Math.floor(ht.getNumRawDataModules(c)/8),R=M-E%M,_=Math.floor(E/M);let j=[];const D=ht.reedSolomonComputeDivisor(C);for(let B=0,L=0;B<M;B++){let G=h.slice(L,L+_-C+(B<R?0:1));L+=G.length;const ae=ht.reedSolomonComputeRemainder(G,D);B<R&&G.push(0),j.push(G.concat(ae))}let z=[];for(let B=0;B<j[0].length;B++)j.forEach((L,G)=>{(B!=_-C||G>=R)&&z.push(L[B])});return s(z.length==E),z}drawCodewords(h){if(h.length!=Math.floor(ht.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let c=0;for(let x=this.size-1;x>=1;x-=2){x==6&&(x=5);for(let M=0;M<this.size;M++)for(let C=0;C<2;C++){const E=x-C,R=(x+1&2)==0?this.size-1-M:M;!this.isFunction[R][E]&&c<h.length*8&&(this.modules[R][E]=a(h[c>>>3],7-(c&7)),c++)}}s(c==h.length*8)}applyMask(h){if(h<0||h>7)throw new RangeError("Mask value out of range");for(let c=0;c<this.size;c++)for(let x=0;x<this.size;x++){let M;switch(h){case 0:M=(x+c)%2==0;break;case 1:M=c%2==0;break;case 2:M=x%3==0;break;case 3:M=(x+c)%3==0;break;case 4:M=(Math.floor(x/3)+Math.floor(c/2))%2==0;break;case 5:M=x*c%2+x*c%3==0;break;case 6:M=(x*c%2+x*c%3)%2==0;break;case 7:M=((x+c)%2+x*c%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[c][x]&&M&&(this.modules[c][x]=!this.modules[c][x])}}getPenaltyScore(){let h=0;for(let C=0;C<this.size;C++){let E=!1,R=0,_=[0,0,0,0,0,0,0];for(let j=0;j<this.size;j++)this.modules[C][j]==E?(R++,R==5?h+=ht.PENALTY_N1:R>5&&h++):(this.finderPenaltyAddHistory(R,_),E||(h+=this.finderPenaltyCountPatterns(_)*ht.PENALTY_N3),E=this.modules[C][j],R=1);h+=this.finderPenaltyTerminateAndCount(E,R,_)*ht.PENALTY_N3}for(let C=0;C<this.size;C++){let E=!1,R=0,_=[0,0,0,0,0,0,0];for(let j=0;j<this.size;j++)this.modules[j][C]==E?(R++,R==5?h+=ht.PENALTY_N1:R>5&&h++):(this.finderPenaltyAddHistory(R,_),E||(h+=this.finderPenaltyCountPatterns(_)*ht.PENALTY_N3),E=this.modules[j][C],R=1);h+=this.finderPenaltyTerminateAndCount(E,R,_)*ht.PENALTY_N3}for(let C=0;C<this.size-1;C++)for(let E=0;E<this.size-1;E++){const R=this.modules[C][E];R==this.modules[C][E+1]&&R==this.modules[C+1][E]&&R==this.modules[C+1][E+1]&&(h+=ht.PENALTY_N2)}let c=0;for(const C of this.modules)c=C.reduce((E,R)=>E+(R?1:0),c);const x=this.size*this.size,M=Math.ceil(Math.abs(c*20-x*10)/x)-1;return s(0<=M&&M<=9),h+=M*ht.PENALTY_N4,s(0<=h&&h<=2568888),h}getAlignmentPatternPositions(){if(this.version==1)return[];{const h=Math.floor(this.version/7)+2,c=this.version==32?26:Math.ceil((this.version*4+4)/(h*2-2))*2;let x=[6];for(let M=this.size-7;x.length<h;M-=c)x.splice(1,0,M);return x}}static getNumRawDataModules(h){if(h<ht.MIN_VERSION||h>ht.MAX_VERSION)throw new RangeError("Version number out of range");let c=(16*h+128)*h+64;if(h>=2){const x=Math.floor(h/7)+2;c-=(25*x-10)*x-55,h>=7&&(c-=36)}return s(208<=c&&c<=29648),c}static getNumDataCodewords(h,c){return Math.floor(ht.getNumRawDataModules(h)/8)-ht.ECC_CODEWORDS_PER_BLOCK[c.ordinal][h]*ht.NUM_ERROR_CORRECTION_BLOCKS[c.ordinal][h]}static reedSolomonComputeDivisor(h){if(h<1||h>255)throw new RangeError("Degree out of range");let c=[];for(let M=0;M<h-1;M++)c.push(0);c.push(1);let x=1;for(let M=0;M<h;M++){for(let C=0;C<c.length;C++)c[C]=ht.reedSolomonMultiply(c[C],x),C+1<c.length&&(c[C]^=c[C+1]);x=ht.reedSolomonMultiply(x,2)}return c}static reedSolomonComputeRemainder(h,c){let x=c.map(M=>0);for(const M of h){const C=M^x.shift();x.push(0),c.forEach((E,R)=>x[R]^=ht.reedSolomonMultiply(E,C))}return x}static reedSolomonMultiply(h,c){if(h>>>8||c>>>8)throw new RangeError("Byte out of range");let x=0;for(let M=7;M>=0;M--)x=x<<1^(x>>>7)*285,x^=(c>>>M&1)*h;return s(x>>>8==0),x}finderPenaltyCountPatterns(h){const c=h[1];s(c<=this.size*3);const x=c>0&&h[2]==c&&h[3]==c*3&&h[4]==c&&h[5]==c;return(x&&h[0]>=c*4&&h[6]>=c?1:0)+(x&&h[6]>=c*4&&h[0]>=c?1:0)}finderPenaltyTerminateAndCount(h,c,x){return h&&(this.finderPenaltyAddHistory(c,x),c=0),c+=this.size,this.finderPenaltyAddHistory(c,x),this.finderPenaltyCountPatterns(x)}finderPenaltyAddHistory(h,c){c[0]==0&&(h+=this.size),c.pop(),c.unshift(h)}};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(m,h,c){if(h<0||h>31||m>>>h)throw new RangeError("Value out of range");for(let x=h-1;x>=0;x--)c.push(m>>>x&1)}function a(m,h){return(m>>>h&1)!=0}function s(m){if(!m)throw new Error("Assertion error")}const p=class un{constructor(h,c,x){if(this.mode=h,this.numChars=c,this.bitData=x,c<0)throw new RangeError("Invalid argument");this.bitData=x.slice()}static makeBytes(h){let c=[];for(const x of h)n(x,8,c);return new un(un.Mode.BYTE,h.length,c)}static makeNumeric(h){if(!un.isNumeric(h))throw new RangeError("String contains non-numeric characters");let c=[];for(let x=0;x<h.length;){const M=Math.min(h.length-x,3);n(parseInt(h.substring(x,x+M),10),M*3+1,c),x+=M}return new un(un.Mode.NUMERIC,h.length,c)}static makeAlphanumeric(h){if(!un.isAlphanumeric(h))throw new RangeError("String contains unencodable characters in alphanumeric mode");let c=[],x;for(x=0;x+2<=h.length;x+=2){let M=un.ALPHANUMERIC_CHARSET.indexOf(h.charAt(x))*45;M+=un.ALPHANUMERIC_CHARSET.indexOf(h.charAt(x+1)),n(M,11,c)}return x<h.length&&n(un.ALPHANUMERIC_CHARSET.indexOf(h.charAt(x)),6,c),new un(un.Mode.ALPHANUMERIC,h.length,c)}static makeSegments(h){return h==""?[]:un.isNumeric(h)?[un.makeNumeric(h)]:un.isAlphanumeric(h)?[un.makeAlphanumeric(h)]:[un.makeBytes(un.toUtf8ByteArray(h))]}static makeEci(h){let c=[];if(h<0)throw new RangeError("ECI assignment value out of range");if(h<128)n(h,8,c);else if(h<16384)n(2,2,c),n(h,14,c);else if(h<1e6)n(6,3,c),n(h,21,c);else throw new RangeError("ECI assignment value out of range");return new un(un.Mode.ECI,0,c)}static isNumeric(h){return un.NUMERIC_REGEX.test(h)}static isAlphanumeric(h){return un.ALPHANUMERIC_REGEX.test(h)}getData(){return this.bitData.slice()}static getTotalBits(h,c){let x=0;for(const M of h){const C=M.mode.numCharCountBits(c);if(M.numChars>=1<<C)return 1/0;x+=4+C+M.bitData.length}return x}static toUtf8ByteArray(h){h=encodeURI(h);let c=[];for(let x=0;x<h.length;x++)h.charAt(x)!="%"?c.push(h.charCodeAt(x)):(c.push(parseInt(h.substring(x+1,x+3),16)),x+=2);return c}};p.NUMERIC_REGEX=/^[0-9]*$/,p.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,p.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let f=p;e.QrSegment=p})(zo||(zo={}));(e=>{(t=>{const n=class{constructor(s,p){this.ordinal=s,this.formatBits=p}};n.LOW=new n(0,1),n.MEDIUM=new n(1,0),n.QUARTILE=new n(2,3),n.HIGH=new n(3,2),t.Ecc=n})(e.QrCode||(e.QrCode={}))})(zo||(zo={}));(e=>{(t=>{const n=class{constructor(s,p){this.modeBits=s,this.numBitsCharCount=p}numCharCountBits(s){return this.numBitsCharCount[Math.floor((s+7)/17)]}};n.NUMERIC=new n(1,[10,12,14]),n.ALPHANUMERIC=new n(2,[9,11,13]),n.BYTE=new n(4,[8,16,16]),n.KANJI=new n(8,[8,10,12]),n.ECI=new n(7,[0,0,0]),t.Mode=n})(e.QrSegment||(e.QrSegment={}))})(zo||(zo={}));var Xs=zo;var Eoe={L:Xs.QrCode.Ecc.LOW,M:Xs.QrCode.Ecc.MEDIUM,Q:Xs.QrCode.Ecc.QUARTILE,H:Xs.QrCode.Ecc.HIGH},lN=128,cN="L",uN="#FFFFFF",dN="#000000",pN=!1,mN=1,Roe=4,Ioe=0,Toe=.1;function fN(e,t=0){const n=[];return e.forEach(function(a,s){let p=null;a.forEach(function(f,m){if(!f&&p!==null){n.push(`M${p+t} ${s+t}h${m-p}v1H${p+t}z`),p=null;return}if(m===a.length-1){if(!f)return;p===null?n.push(`M${m+t},${s+t} h1v1H${m+t}z`):n.push(`M${p+t},${s+t} h${m+1-p}v1H${p+t}z`);return}f&&p===null&&(p=m)})}),n.join("")}function hN(e,t){return e.slice().map((n,a)=>a<t.y||a>=t.y+t.h?n:n.map((s,p)=>p<t.x||p>=t.x+t.w?s:!1))}function _oe(e,t,n,a){if(a==null)return null;const s=e.length+n*2,p=Math.floor(t*Toe),f=s/t,m=(a.width||p)*f,h=(a.height||p)*f,c=a.x==null?e.length/2-m/2:a.x*f,x=a.y==null?e.length/2-h/2:a.y*f,M=a.opacity==null?1:a.opacity;let C=null;if(a.excavate){let R=Math.floor(c),_=Math.floor(x);C={x:R,y:_,w:Math.ceil(m+c-R),h:Math.ceil(h+x-_)}}const E=a.crossOrigin;return{x:c,y:x,h,w:m,excavation:C,opacity:M,crossOrigin:E}}function Noe(e,t){return t!=null?Math.max(Math.floor(t),0):e?Roe:Ioe}function gN({value:e,level:t,minVersion:n,includeMargin:a,marginSize:s,imageSettings:p,size:f,boostLevel:m}){let h=An.useMemo(()=>{const E=(Array.isArray(e)?e:[e]).reduce((R,_)=>(R.push(...Xs.QrSegment.makeSegments(_)),R),[]);return Xs.QrCode.encodeSegments(E,Eoe[t],n,void 0,void 0,m)},[e,t,n,m]);const{cells:c,margin:x,numCells:M,calculatedImageSettings:C}=An.useMemo(()=>{let E=h.getModules();const R=Noe(a,s);return{cells:E,margin:R,numCells:E.length+R*2,calculatedImageSettings:_oe(E,f,R,p)}},[h,f,p,a,s]);return{qrcode:h,margin:x,cells:c,numCells:M,calculatedImageSettings:C}}var Ooe=(function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0})(),joe=An.forwardRef(function(t,n){const a=t,{value:s,size:p=lN,level:f=cN,bgColor:m=uN,fgColor:h=dN,includeMargin:c=pN,minVersion:x=mN,boostLevel:M,marginSize:C,imageSettings:E}=a,R=Zy(a,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:_}=R,j=Zy(R,["style"]),D=E?.src,z=An.useRef(null),B=An.useRef(null),L=An.useCallback(Ee=>{z.current=Ee,typeof n=="function"?n(Ee):n&&(n.current=Ee)},[n]),[G,ae]=An.useState(!1),{margin:V,cells:F,numCells:fe,calculatedImageSettings:ke}=gN({value:s,level:f,minVersion:x,boostLevel:M,includeMargin:c,marginSize:C,imageSettings:E,size:p});An.useEffect(()=>{if(z.current!=null){const Ee=z.current,we=Ee.getContext("2d");if(!we)return;let ge=F;const Q=B.current,oe=ke!=null&&Q!==null&&Q.complete&&Q.naturalHeight!==0&&Q.naturalWidth!==0;oe&&ke.excavation!=null&&(ge=hN(F,ke.excavation));const xe=window.devicePixelRatio||1;Ee.height=Ee.width=p*xe;const Ie=p/fe*xe;we.scale(Ie,Ie),we.fillStyle=m,we.fillRect(0,0,fe,fe),we.fillStyle=h,Ooe?we.fill(new Path2D(fN(ge,V))):F.forEach(function(he,q){he.forEach(function(W,le){W&&we.fillRect(le+V,q+V,1,1)})}),ke&&(we.globalAlpha=ke.opacity),oe&&we.drawImage(Q,ke.x+V,ke.y+V,ke.w,ke.h)}}),An.useEffect(()=>{ae(!1)},[D]);const Me=Gy({height:p,width:p},_);let Ae=null;return D!=null&&(Ae=An.createElement("img",{src:D,key:D,style:{display:"none"},onLoad:()=>{ae(!0)},ref:B,crossOrigin:ke?.crossOrigin})),An.createElement(An.Fragment,null,An.createElement("canvas",Gy({style:Me,height:p,width:p,ref:L,role:"img"},j)),Ae)});joe.displayName="QRCodeCanvas";var Poe=An.forwardRef(function(t,n){const a=t,{value:s,size:p=lN,level:f=cN,bgColor:m=uN,fgColor:h=dN,includeMargin:c=pN,minVersion:x=mN,boostLevel:M,title:C,marginSize:E,imageSettings:R}=a,_=Zy(a,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:j,cells:D,numCells:z,calculatedImageSettings:B}=gN({value:s,level:f,minVersion:x,boostLevel:M,includeMargin:c,marginSize:E,imageSettings:R,size:p});let L=D,G=null;R!=null&&B!=null&&(B.excavation!=null&&(L=hN(D,B.excavation)),G=An.createElement("image",{href:R.src,height:B.h,width:B.w,x:B.x+j,y:B.y+j,preserveAspectRatio:"none",opacity:B.opacity,crossOrigin:B.crossOrigin}));const ae=fN(L,j);return An.createElement("svg",Gy({height:p,width:p,viewBox:`0 0 ${z} ${z}`,ref:n,role:"img"},_),!!C&&An.createElement("title",null,C),An.createElement("path",{fill:m,d:`M0,0 h${z}v${z}H0z`,shapeRendering:"crispEdges"}),An.createElement("path",{fill:h,d:ae,shapeRendering:"crispEdges"}),G)});Poe.displayName="QRCodeSVG";var _C=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,NC=t4,Qo=(e,t)=>n=>{var a;if(t?.variants==null)return NC(e,n?.class,n?.className);const{variants:s,defaultVariants:p}=t,f=Object.keys(s).map(h=>{const c=n?.[h],x=p?.[h];if(c===null)return null;const M=_C(c)||_C(x);return s[h][M]}),m=n&&Object.entries(n).reduce((h,c)=>{let[x,M]=c;return M===void 0||(h[x]=M),h},{});return NC(e,f,t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((h,c)=>{let{class:x,className:M,...C}=c;return Object.entries(C).every(E=>{let[R,_]=E;return Array.isArray(_)?_.includes({...p,...m}[R]):{...p,...m}[R]===_})?[...h,x,M]:h},[]),n?.class,n?.className)},Doe=Qo("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 text-foreground 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"}}),Ky=T.forwardRef(({className:e,variant:t,size:n,...a},s)=>v.jsx("button",{ref:s,className:se(Doe({variant:t,size:n}),e),...a}));Ky.displayName="Button";var zoe=Qo("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"}}),Loe=T.forwardRef(({className:e,variant:t,size:n,icon:a,...s},p)=>v.jsx("button",{ref:p,className:se(zoe({variant:t,size:n}),e),...s,children:v.jsx(a,{className:"h-4 w-4"})}));Loe.displayName="IconButton";var qoe=Qo("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"}}),Boe=T.forwardRef(({className:e,variant:t,style:n,...a},s)=>v.jsx("span",{ref:s,className:se(qoe({variant:t,styleVariant:n}),e),...a}));Boe.displayName="Badge";var Foe=Qo("rounded-lg p-3",{variants:{variant:{flat:"bg-surface",bordered:"bg-surface border border-border"}},defaultVariants:{variant:"bordered"}}),Uoe=T.forwardRef(({className:e,variant:t,...n},a)=>v.jsx("div",{ref:a,className:se(Foe({variant:t}),e),...n}));Uoe.displayName="Card";var Hoe=T.forwardRef(({className:e,...t},n)=>v.jsx("label",{ref:n,className:se("text-[10px] uppercase tracking-wider text-foreground-muted font-medium",e),...t}));Hoe.displayName="Label";var $oe=Qo("",{variants:{orientation:{horizontal:"h-px w-full bg-border-subtle",vertical:"w-px h-full bg-border-subtle"}},defaultVariants:{orientation:"horizontal"}}),Qoe=T.forwardRef(({className:e,orientation:t,...n},a)=>v.jsx("div",{ref:a,role:"separator",className:se($oe({orientation:t}),e),...n}));Qoe.displayName="Separator";var Voe=T.forwardRef(({className:e,...t},n)=>v.jsx("div",{ref:n,className:se("animate-pulse bg-surface-hover rounded-md h-4 w-full",e),...t}));Voe.displayName="Skeleton";var OC=Qo("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 disabled:opacity-50 disabled:cursor-not-allowed",{variants:{state:{default:"border-border",error:"border-danger"}},defaultVariants:{state:"default"}}),Goe=T.forwardRef(({className:e,state:t,leftSlot:n,rightSlot:a,...s},p)=>n||a?v.jsxs("div",{className:"relative flex items-center w-full",children:[n&&v.jsx("div",{className:"absolute left-2.5 flex items-center pointer-events-none",children:n}),v.jsx("input",{ref:p,className:se(OC({state:t}),n?"pl-7":"",a?"pr-7":"",e),...s}),a&&v.jsx("div",{className:"absolute right-2.5 flex items-center pointer-events-none",children:a})]}):v.jsx("input",{ref:p,className:se(OC({state:t}),e),...s}));Goe.displayName="Input";var Zoe=T.forwardRef(({className:e,options:t,disabled:n,...a},s)=>v.jsxs("div",{className:"relative w-full",children:[v.jsx("select",{ref:s,disabled:n,className:se("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","disabled:opacity-50 disabled:cursor-not-allowed",e),...a,children:t.map(p=>v.jsx("option",{value:p.value,children:p.label},p.value))}),v.jsx("div",{className:se("absolute right-2 top-1/2 -translate-y-1/2 pointer-events-none text-foreground-muted",n===!0?"opacity-50":""),children:v.jsx(Uo,{className:"h-3.5 w-3.5"})})]}));Zoe.displayName="Select";var Koe=T.forwardRef(({className:e,...t},n)=>v.jsx("input",{ref:n,type:"checkbox",className:se("w-3.5 h-3.5 rounded-sm border border-border accent-primary",e),...t}));Koe.displayName="Checkbox";var Woe=T.forwardRef(({className:e,checked:t,onCheckedChange:n,label:a,...s},p)=>v.jsxs("button",{ref:p,role:"switch","aria-checked":t,type:"button",onClick:()=>n(!t),className:se("inline-flex items-center gap-2",e),...s,children:[v.jsx("span",{className:se("w-8 h-4 rounded-full transition-colors",t?"bg-primary":"bg-surface-hover"),children:v.jsx("span",{className:se("block w-3.5 h-3.5 rounded-full bg-white transition-transform",t?"translate-x-4":"translate-x-0.5")})}),a&&v.jsx("span",{className:"text-xs text-foreground",children:a})]}));Woe.displayName="Switch";var vN=T.createContext(null);function Yoe(){const e=T.useContext(vN);if(!e)throw new Error("Dialog compound components must be used within <Dialog>");return e}function yN({children:e,open:t,onOpenChange:n}){const[a,s]=T.useState(!1),p=t??a,f=T.useId(),m=T.useCallback(h=>{n?.(h),t===void 0&&s(h)},[t,n]);return v.jsx(vN.Provider,{value:{open:p,setOpen:m,contentId:f},children:e})}var Xoe=Qo("fixed left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 m-0 w-[calc(100vw-2rem)] bg-background-elevated text-foreground border border-border rounded-lg p-4 backdrop:bg-black/50 backdrop:backdrop-blur-sm max-h-[calc(100dvh-2rem-2*max(env(safe-area-inset-top),env(safe-area-inset-bottom)))] [&:not([open])]:hidden",{variants:{width:{sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg"},scroll:{content:"overflow-y-auto",body:"flex flex-col overflow-hidden"},placement:{center:"","sheet-on-mobile":"bottom-0 left-0 right-0 top-auto w-full max-w-full translate-x-0 translate-y-0 rounded-b-none max-h-[92dvh] pb-[calc(1rem+env(safe-area-inset-bottom))] md:left-1/2 md:top-1/2 md:-translate-x-1/2 md:-translate-y-1/2 md:rounded-lg md:bottom-auto md:pb-4 md:max-h-[calc(100dvh-2rem-2*max(env(safe-area-inset-top),env(safe-area-inset-bottom)))]"}},compoundVariants:[{placement:"sheet-on-mobile",width:"sm",class:"md:w-[calc(100vw-2rem)] md:max-w-sm"},{placement:"sheet-on-mobile",width:"md",class:"md:w-[calc(100vw-2rem)] md:max-w-md"},{placement:"sheet-on-mobile",width:"lg",class:"md:w-[calc(100vw-2rem)] md:max-w-lg"},{scroll:"body",placement:"sheet-on-mobile",class:"h-[92dvh] md:h-auto"},{scroll:"body",placement:"center",class:"h-[calc(100dvh-2rem-2*max(env(safe-area-inset-top),env(safe-area-inset-bottom)))] md:h-auto"}],defaultVariants:{width:"md",placement:"center",scroll:"content"}}),D0=T.forwardRef(({className:e,width:t,placement:n,scroll:a,children:s,...p},f)=>{const{open:m,setOpen:h,contentId:c}=Yoe(),x=T.useRef(null),M=f??x;T.useEffect(()=>{const E=M.current;E&&(m&&!E.open&&E.showModal(),!m&&E.open&&E.close())},[m,M]);const C=E=>{E.target===E.currentTarget&&h(!1)};return v.jsx("dialog",{ref:M,id:c,className:se(Xoe({width:t,placement:n,scroll:a}),e),onClick:C,onClose:()=>h(!1),...p,children:s})});D0.displayName="DialogContent";function Joe({className:e,...t}){return v.jsx("div",{className:se("flex flex-col gap-1 mb-3 shrink-0",e),...t})}function ese({className:e,...t}){return v.jsx("div",{className:se("flex justify-end gap-2 mt-4 shrink-0",e),...t})}function tse({className:e,...t}){return v.jsx("h2",{className:se("text-sm font-semibold text-foreground",e),...t})}function nse({className:e,...t}){return v.jsx("p",{className:se("text-xs text-foreground-muted",e),...t})}T.createContext(null);T.createContext(null);T.createContext(null);var ase=T.forwardRef(({className:e,...t},n)=>v.jsx("div",{ref:n,className:se("overflow-auto [&::-webkit-scrollbar]:w-1 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:bg-surface-hover [&::-webkit-scrollbar-thumb]:rounded-full",e),...t}));ase.displayName="ScrollArea";var tv={baseDelayMs:1500,maxDelayMs:15e3,maxAttempts:40};function ise(e,t=Math.random){if(e>=tv.maxAttempts)return{kind:"exhausted",attempts:e};const n=Math.min(tv.maxDelayMs,tv.baseDelayMs*2**e);return{kind:"retry",delayMs:Math.round(n*(.8+t()*.4))}}var rse="/adaptive-probe",ose=2500;function bN(e){return e>=8?"high":e>=2.5?"mid":"low"}function sse(e){const{downlinkMbps:t,...n}=e;return n}function jC(e){return bN(e)!=="low"}function PC(e){if(e===void 0||e==="")return null;let t;try{t=new URL(e)}catch{return null}return t.protocol!=="http:"&&t.protocol!=="https:"?null:`${t.origin}${t.pathname.replace(/\/+$/,"")}`}function lse(e,t){return PC(e)??PC(t)}function cse(e){const t=e.downlinkMbps===void 0?"none":bN(e.downlinkMbps);return[e.phase,e.viewportWidth??"-",e.viewportHeight??"-",e.devicePixelRatio??"-",t,e.prefersTier??"-",e.probeOrigin??"unreachable"].join("|")}async function use(e,t){const n=e.replace(/\/+$/,""),a=new AbortController,s=setTimeout(()=>a.abort(),ose),p=t.now();try{const f=await t.fetchImpl(`${n}${rse}`,{signal:a.signal});if(!f.ok)return null;const m=await f.arrayBuffer(),h=Math.max(1,t.now()-p);return m.byteLength<1024?null:m.byteLength*8/h/1e3}catch{return null}finally{clearTimeout(s)}}var DC=8;function Fn(e){return typeof e=="number"&&Number.isFinite(e)?e:null}function ai(e){return typeof e=="string"&&e.length>0?e:null}function Ja(e,t){if(e===null||t===null)return null;const n=e-t;return n<0?null:n}function SN(e,t){if(e===null||t===null)return null;const n=e+t;return n<=0?null:e/n*100}function dse(e){return e===null?null:/profile-level-id=([0-9a-fA-F]+)/.exec(e)?.[1]??null}function pse(e){const t={inbound:null,codecs:new Map,candidates:new Map,pair:null,selectedPairId:null},n=[];e.forEach(s=>{const p=s,f=ai(p.id);switch(p.type){case"inbound-rtp":(p.kind??p.mediaType)==="video"&&(t.inbound=p);break;case"codec":f!==null&&t.codecs.set(f,p);break;case"local-candidate":case"remote-candidate":f!==null&&t.candidates.set(f,p);break;case"candidate-pair":n.push(p);break;case"transport":t.selectedPairId=ai(p.selectedCandidatePairId);break}});const a=t.selectedPairId;return t.pair=n.find(s=>ai(s.id)===a)??n.find(s=>s.selected===!0)??n.find(s=>s.nominated===!0&&s.state==="succeeded")??n.find(s=>s.nominated===!0)??n.find(s=>s.state==="succeeded")??null,t}function mse(e){return e===null?{timestamp:null,bytesReceived:null,packetsReceived:null,packetsLost:null,framesDecoded:null,framesDropped:null,freezeCount:null,totalFreezesDurationS:null,totalDecodeTimeS:null,nackCount:null,pliCount:null}:{timestamp:Fn(e.timestamp),bytesReceived:Fn(e.bytesReceived),packetsReceived:Fn(e.packetsReceived),packetsLost:Fn(e.packetsLost),framesDecoded:Fn(e.framesDecoded),framesDropped:Fn(e.framesDropped),freezeCount:Fn(e.freezeCount),totalFreezesDurationS:Fn(e.totalFreezesDuration),totalDecodeTimeS:Fn(e.totalDecodeTime),nackCount:Fn(e.nackCount),pliCount:Fn(e.pliCount)}}var zC={spanMs:null,kbps:null,packetsReceived:null,packetsLost:null,lossPercent:null,framesDecoded:null,framesDropped:null,freezeCount:null,freezeMs:null,nackCount:null,pliCount:null,decodeMs:null};function fse(e,t){if(t===null)return zC;const n=Ja(e.timestamp,t.timestamp);if(n===null||n<=0)return zC;const a=Ja(e.bytesReceived,t.bytesReceived),s=Ja(e.packetsLost,t.packetsLost),p=Ja(e.packetsReceived,t.packetsReceived),f=Ja(e.framesDecoded,t.framesDecoded),m=Ja(e.totalDecodeTimeS,t.totalDecodeTimeS),h=Ja(e.totalFreezesDurationS,t.totalFreezesDurationS);return{spanMs:n,kbps:a===null?null:Math.round(a*8/n),packetsReceived:p,packetsLost:s,lossPercent:SN(s,p),framesDecoded:f,framesDropped:Ja(e.framesDropped,t.framesDropped),freezeCount:Ja(e.freezeCount,t.freezeCount),freezeMs:h===null?null:Math.round(h*1e3),nackCount:Ja(e.nackCount,t.nackCount),pliCount:Ja(e.pliCount,t.pliCount),decodeMs:m===null||f===null||f<=0?null:m/f*1e3}}function hse(e,t,n,a){if(t===null||n===null)return e;const s=e.at(-1);if(s!==void 0&&s.width===t&&s.height===n)return e;const p=[...e,{width:t,height:n,at:a}];return p.length>DC?p.slice(p.length-DC):p}function gse(e){const{inbound:t,codecs:n,candidates:a,pair:s}=pse(e.report),p=mse(t),f=t!==null?n.get(ai(t.codecId)??""):void 0,m=ai(f?.mimeType),h=ai(f?.sdpFmtpLine),c=s!==null?a.get(ai(s.localCandidateId)??""):void 0,x=s!==null?a.get(ai(s.remoteCandidateId)??""):void 0,M=ai(c?.candidateType),C=ai(x?.candidateType),E=Fn(t?.frameWidth),R=Fn(t?.frameHeight),_=p.totalFreezesDurationS,j=p.totalDecodeTimeS,D=p.framesDecoded;return{at:e.now,hasInboundVideo:t!==null,width:E,height:R,fps:Fn(t?.framesPerSecond),codec:m===null?null:m.split("/")[1]??m,codecProfileLevelId:dse(h),jitterMs:vse(t),packetsReceived:p.packetsReceived,packetsLost:p.packetsLost,lossPercent:SN(p.packetsLost,p.packetsReceived),nackCount:p.nackCount,pliCount:p.pliCount,framesDecoded:D,framesDropped:p.framesDropped,freezeCount:p.freezeCount,totalFreezeMs:_===null?null:Math.round(_*1e3),avgDecodeMs:j===null||D===null||D<=0?null:j/D*1e3,rttMs:yse(s),availableIncomingKbps:bse(s),localCandidateType:M,remoteCandidateType:C,candidatePairType:M===null&&C===null?null:`${M??"?"}/${C??"?"}`,candidateProtocol:ai(c?.protocol),iceConnectionState:e.iceConnectionState,dtlsState:e.dtlsState,window:fse(p,e.prev?.raw??null),resolutionLog:hse(e.prev?.resolutionLog??[],E,R,e.now),raw:p}}function vse(e){const t=Fn(e?.jitter);return t===null?null:t*1e3}function yse(e){const t=Fn(e?.currentRoundTripTime);return t===null?null:t*1e3}function bse(e){const t=Fn(e?.availableIncomingBitrate);return t===null?null:Math.round(t/1e3)}var Sse={unknown:"no window yet",decoding:"decoding","decoder-stall":"DECODER STALL — bytes arriving, no frames out","transport-stall":"TRANSPORT STALL — nothing arriving","frozen-unknown":"frames stopped — byte rate unknown"};function xse(e){const t=kse(e);return{kind:t,label:Sse[t]}}function kse(e){if(e===null||!e.hasInboundVideo)return"unknown";const t=e.window.framesDecoded;if(t===null)return"unknown";if(t>0)return"decoding";const n=e.window.kbps;return n===null?"frozen-unknown":n>0?"decoder-stall":"transport-stall"}var Po="—";function Dt(e,t){if(e==null||!Number.isFinite(e))return Po;const n=t?.digits??0;return`${e.toFixed(n)}${t?.suffix??""}`}function ei(e){return e==null||e===""?Po:e}function rp(e){return e==null?Po:e?"yes":"no"}function Wy(e,t){if(e===null)return Po;const n=Math.max(0,t-e);return n<1e3?`${n}ms ago`:n<6e4?`${(n/1e3).toFixed(1)}s ago`:`${Math.floor(n/6e4)}m${Math.floor(n%6e4/1e3)}s ago`}var xN=3e3,wse={unknown:"bg-white/15 text-white/70",decoding:"bg-emerald-500/25 text-emerald-200","decoder-stall":"bg-amber-500/30 text-amber-100","transport-stall":"bg-rose-500/30 text-rose-100","frozen-unknown":"bg-white/15 text-white/70"};function lt({label:e,value:t,window:n,strong:a=!1}){return v.jsxs("div",{className:"flex items-baseline justify-between gap-2 leading-[1.25]",children:[v.jsx("span",{className:"text-white/55 shrink-0",children:e}),v.jsxs("span",{className:"flex items-baseline gap-1 text-right",children:[v.jsx("span",{className:a?"text-white font-semibold tabular-nums":"text-white/90 tabular-nums",children:t}),n!==void 0&&v.jsx("span",{className:"text-sky-300/80 tabular-nums",children:n})]})]})}function op({title:e,measuredAt:t,now:n}){const a=t!==null&&n-t>xN;return v.jsxs("div",{className:"flex items-baseline justify-between gap-3 mt-2 first:mt-0 pb-0.5 border-b border-white/20",children:[v.jsx("span",{className:"text-white/80 font-semibold tracking-wide uppercase text-[9px]",children:e}),v.jsxs("span",{className:a?"text-amber-300 text-[9px]":"text-white/45 text-[9px]",children:[a?"STALE · ":"",Wy(t,n)]})]})}var Mse={unknown:"bg-white/50",decoding:"bg-emerald-400","decoder-stall":"bg-amber-400","transport-stall":"bg-rose-400","frozen-unknown":"bg-white/50"};function Cse(e){const{stats:t,server:n,serverError:a,serverWired:s,now:p,sessionId:f}=e,m=xse(t),h=t?.window,[c,x]=T.useState(!1),M=t!==null&&p-t.at>xN;return c?v.jsxs("div",{className:"absolute bottom-10 left-2 z-20 transform-gpu w-[13.5rem] max-h-[70%] overflow-y-auto rounded-md bg-neutral-950/95 ring-1 ring-white/25 shadow-lg px-1.5 py-1 text-[9px] font-mono text-white/90 select-text","data-testid":"stream-debug-overlay",children:[v.jsx("button",{type:"button",onClick:()=>x(!1),className:`w-full text-left rounded px-1.5 py-0.5 mb-1 text-[9px] font-semibold ${wse[m.kind]}`,children:m.label}),v.jsx(op,{title:"decode",measuredAt:t?.at??null,now:p}),v.jsx(lt,{label:"framesDecoded",value:Dt(t?.framesDecoded),window:h?.framesDecoded===null?void 0:`+${Dt(h?.framesDecoded)}`,strong:!0}),v.jsx(lt,{label:"freezeCount",value:Dt(t?.freezeCount),strong:!0}),v.jsx(lt,{label:"frozen",value:Dt(t?.totalFreezeMs,{suffix:"ms"}),window:h?.freezeMs===null?void 0:`+${Dt(h?.freezeMs)}ms`,strong:!0}),v.jsx(lt,{label:"pliCount",value:Dt(t?.pliCount),window:h?.pliCount===null?void 0:`+${Dt(h?.pliCount)}`,strong:!0}),v.jsx(lt,{label:"framesDropped",value:Dt(t?.framesDropped)}),v.jsx(lt,{label:"decode",value:Dt(t?.avgDecodeMs,{digits:1,suffix:"ms"}),window:h?.decodeMs===null?void 0:`${Dt(h?.decodeMs,{digits:1})}ms`}),v.jsx(op,{title:"picture",measuredAt:t?.at??null,now:p}),v.jsx(lt,{label:"resolution",value:t?.width!==null&&t?.width!==void 0&&t.height!==null?`${t.width}×${t.height}`:Po}),v.jsx(lt,{label:"fps",value:Dt(t?.fps)}),v.jsx(lt,{label:"codec",value:t?.codec===null||t?.codec===void 0?Po:`${t.codec}${t.codecProfileLevelId!==null?` ${t.codecProfileLevelId}`:""}`}),(t?.resolutionLog.length??0)>1&&v.jsx("div",{className:"mt-0.5 text-white/60 leading-tight",children:t?.resolutionLog.map(C=>v.jsxs("div",{className:"flex justify-between",children:[v.jsxs("span",{children:[C.width,"×",C.height]}),v.jsx("span",{className:"text-white/40",children:Wy(C.at,p)})]},`${C.at}-${C.width}x${C.height}`))}),v.jsx(op,{title:"transport",measuredAt:t?.at??null,now:p}),v.jsx(lt,{label:"bitrate",value:Dt(h?.kbps,{suffix:" kbps"})}),v.jsx(lt,{label:"rtt",value:Dt(t?.rttMs,{digits:0,suffix:"ms"})}),v.jsx(lt,{label:"jitter",value:Dt(t?.jitterMs,{digits:1,suffix:"ms"})}),v.jsx(lt,{label:"packetsLost",value:Dt(t?.packetsLost),window:h?.packetsLost===null?void 0:`+${Dt(h?.packetsLost)}`}),v.jsx(lt,{label:"loss",value:Dt(t?.lossPercent,{digits:2,suffix:"%"}),window:h?.lossPercent===null?void 0:Dt(h?.lossPercent,{digits:2,suffix:"%"})}),v.jsx(lt,{label:"nackCount",value:Dt(t?.nackCount),window:h?.nackCount===null?void 0:`+${Dt(h?.nackCount)}`}),v.jsx(lt,{label:"candidate pair",value:ei(t?.candidatePairType)}),v.jsx(lt,{label:"protocol",value:ei(t?.candidateProtocol)}),v.jsx(lt,{label:"ice",value:ei(t?.iceConnectionState)}),v.jsx(lt,{label:"dtls",value:ei(t?.dtlsState)}),v.jsx(op,{title:"server",measuredAt:n?.observedAt??null,now:p}),s?a!==null?v.jsx("div",{className:"text-rose-300 leading-tight py-0.5 break-words",children:a}):n===null?v.jsx("div",{className:"text-white/50 leading-tight py-0.5",children:"waiting for the first answer…"}):n.alive?v.jsxs(v.Fragment,{children:[v.jsx(lt,{label:"served rung",value:ei(n.servedTier),strong:!0}),v.jsx(lt,{label:"adaptive",value:rp(n.adaptive)}),v.jsx(lt,{label:"source",value:ei(n.camStreamId)}),v.jsx(lt,{label:"source kind",value:n.sourceKind}),v.jsx(lt,{label:"ingest node",value:ei(n.ingestNodeId)}),v.jsx(lt,{label:"· remote",value:rp(n.ingestIsRemote)}),v.jsx(lt,{label:"egress leg",value:n.egressLeg,strong:!0}),v.jsx(lt,{label:"codec src→out",value:`${ei(n.sourceCodec)}→${ei(n.negotiatedCodec)}`}),v.jsx(lt,{label:"broker",value:ei(n.brokerStatus)}),v.jsx(lt,{label:"· bitrate",value:Dt(n.brokerBitrateKbps,{suffix:" kbps"})}),v.jsx(lt,{label:"· input fps",value:Dt(n.brokerInputFps)}),v.jsx(lt,{label:"rtp sent",value:Dt(n.rtpPacketsSent)}),v.jsx(lt,{label:"track mode",value:ei(n.trackMode)}),n.lastDecision===null?v.jsx(lt,{label:"ladder",value:"never moved"}):v.jsxs(v.Fragment,{children:[v.jsx(lt,{label:"ladder move",value:`${n.lastDecision.cause}${n.lastDecision.tier!==null?` → ${n.lastDecision.tier}`:""}`,strong:!0}),v.jsx(lt,{label:"· when",value:Wy(n.lastDecision.at,p)}),v.jsx(lt,{label:"· lossRatio",value:Dt(n.lastDecision.lossRatio,{digits:4})}),v.jsx(lt,{label:"· clientKbps",value:Dt(n.lastDecision.clientKbps,{suffix:" kbps"})}),v.jsx(lt,{label:"· stalledFor",value:Dt(n.lastDecision.stalledForMs,{suffix:"ms"})}),v.jsx(lt,{label:"· serverSending",value:rp(n.lastDecision.serverSending)}),v.jsx(lt,{label:"· transcode-down",value:rp(n.lastDecision.forcedTranscodeDown)})]}),v.jsx(lt,{label:"promotions",value:Dt(n.upgradeCount)}),n.tierFailures.length>0&&v.jsx(lt,{label:"tier failures",value:n.tierFailures.map(C=>`${C.tier}:${C.failures}`).join(" ")})]}):v.jsx("div",{className:"text-amber-300 leading-tight py-0.5",children:"session not found on the server — it ended, or this node never had it"}):v.jsx("div",{className:"text-white/50 leading-tight py-0.5",children:"not wired on this host"}),f!==null&&v.jsx("div",{className:"mt-1 pt-0.5 border-t border-white/15 text-white/40 break-all leading-tight",children:f})]}):v.jsxs("button",{type:"button",onClick:()=>x(!0),className:"absolute bottom-10 left-2 z-20 transform-gpu flex items-center gap-1.5 rounded bg-neutral-950/90 ring-1 ring-white/20 px-1.5 py-0.5 text-[9px] font-mono text-white/85 tabular-nums select-text","data-testid":"stream-debug-pill",title:m.label,children:[v.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${Mse[m.kind]}`}),v.jsx("span",{children:t?.width!==null&&t?.width!==void 0?`${t.width}×${t.height}`:Po}),v.jsxs("span",{children:[Dt(t?.fps),"fps"]}),v.jsxs("span",{children:[Dt(h?.kbps),"k"]}),M&&v.jsx("span",{className:"text-amber-300",children:"stale"})]})}function xo(e,t){e.muted=t;const n=e.srcObject;if(n instanceof MediaStream)for(const a of n.getAudioTracks())a.enabled=!t}function Ase(){return typeof window>"u"?!1:window.matchMedia("(hover: none) and (pointer: coarse)").matches||typeof navigator<"u"&&navigator.maxTouchPoints>0||"ontouchstart"in window}function Ese(e,t,n){let f=0;for(let m=0;m<8;m++)for(let h=0;h<8;h++){const c=Math.min(t-1,Math.floor((h+.5)/8*t)),x=Math.min(n-1,Math.floor((m+.5)/8*n)),{data:M}=e.getImageData(c,x,1,1);.2126*(M[0]??0)+.7152*(M[1]??0)+.0722*(M[2]??0)>12&&f++}return f<=1}function nv(e){const t={};if(typeof window<"u"){const n=window.devicePixelRatio||1;if(e){const a=e.getBoundingClientRect();a.width>0&&a.height>0&&(t.viewportWidth=Math.round(a.width*n),t.viewportHeight=Math.round(a.height*n))}t.viewportWidth===void 0&&(t.viewportWidth=Math.round(window.innerWidth*n),t.viewportHeight=Math.round(window.innerHeight*n)),t.devicePixelRatio=n}return t}var Cc=null,Rse=3e4;function Pp(e){return lse(e,typeof window<"u"?koe():void 0)}async function Ac(e){const t=Pp(e);if(t===null)return;if(Cc&&Cc.origin===t&&Date.now()-Cc.at<Rse)return Cc.mbps;const n=await use(t,{fetchImpl:(a,s)=>fetch(a,s),now:()=>Date.now()});if(!(n===null||!Number.isFinite(n)))return Cc={origin:t,mbps:n,at:Date.now()},n}function LC(e,t,n,a){const s={...e,...n!==void 0?{downlinkMbps:n}:{},...t};return a?sse(s):s}var Ise=8e3;function kN({serverUrl:e,streamKey:t,label:n,autoPlay:a=!0,muted:s=!0,showControls:p=!0,showStats:f=!1,onPlaybackStats:m,onClientNetworkSample:h,onConnectTiming:c,className:x="",onStateChange:M,onError:C,onReconnectAttempt:E,overlay:R,createSession:_,sendAnswer:j,handleOffer:D,getIceServers:z,addIceCandidate:B,getIceCandidates:L,closeSession:G,getSessionState:ae,getSessionDebug:V,reoffer:F,posterUrl:fe,hintsOverride:ke,onAdaptiveHints:Me,reconnectSignal:Ae,onControlChannel:Ee,onVideoElement:we}){const ge=T.useRef(null),Q=T.useRef(null),oe=T.useRef(null),xe=T.useRef(new Set),Ie=T.useRef(null),he=T.useRef(null),q=T.useRef(0),W=T.useRef(!0),le=T.useRef(Ee);le.current=Ee;const be=T.useRef(we);be.current=we,T.useEffect(()=>(be.current?.(ge.current),()=>be.current?.(null)),[]);const ee=T.useRef(Me);ee.current=Me;const ve=T.useRef(null),De=T.useCallback((pe,ze,nt)=>{const Ct=ee.current;if(!Ct)return;const Ve={phase:pe,probeOrigin:nt,...ze},St=cse(Ve);St!==ve.current&&(ve.current=St,Ct(Ve))},[]),Fe=T.useRef(null),re=T.useRef(null),Te=T.useRef(0),Je=T.useRef(!1),Ze=T.useRef(!1),It=T.useRef(async()=>{}),[_e,Ye]=T.useState("idle"),[Re,Qe]=T.useState(""),[Xe,Nt]=T.useState(s),rt=T.useRef(Xe);rt.current=Xe;const[$t,en]=T.useState(!1),[In,pn]=T.useState(!1),Hn=Ase(),[Sa,li]=T.useState(!0),$n=T.useRef(null),ci=T.useRef(!1);(j||_)&&(ci.current=!0);const et=ci.current,mn=T.useRef(!1);D&&(mn.current=!0);const ra=mn.current,[oa,Pn]=T.useState(!1),sa=T.useRef(null),[Nn,Vo]=T.useState(null),[Go,Yr]=T.useState(!1),Va=T.useCallback(()=>{const pe=ge.current;if(!(!pe||pe.readyState<2||!pe.videoWidth||!pe.videoHeight))try{const ze=document.createElement("canvas");ze.width=pe.videoWidth,ze.height=pe.videoHeight;const nt=ze.getContext("2d");if(!nt||(nt.drawImage(pe,0,0),Ese(nt,ze.width,ze.height)))return;sa.current=ze.toDataURL("image/jpeg",.6)}catch{}},[]),de=T.useCallback(pe=>{Ye(pe),pe==="playing"&&Pn(!0),M?.(pe)},[M]),Ce=T.useCallback(()=>{if(Ie.current?.abort(),Ie.current=null,he.current&&(clearTimeout(he.current),he.current=null),re.current&&(clearTimeout(re.current),re.current=null),Fe.current=null,Ze.current=!1,Te.current=0,oe.current&&(oe.current.close(),oe.current=null),G&&xe.current.size>0){for(const pe of xe.current)G(pe).catch(()=>{});xe.current.clear()}},[G]),ut=T.useCallback(()=>{Ie.current?.abort(),Ie.current=null,he.current&&(clearTimeout(he.current),he.current=null),re.current&&(clearTimeout(re.current),re.current=null),Fe.current=null,Ze.current=!1,Te.current=0},[]),Zt=1e3,On=T.useCallback(pe=>{if(!ae||!F)return;re.current&&(clearTimeout(re.current),re.current=null);const ze=async()=>{if(W.current&&Fe.current===pe){if(!Ze.current)try{const{pendingRenegotiation:nt}=await ae(pe);if(W.current&&Fe.current===pe&&nt&&nt.epoch>Te.current&&!Ze.current){Te.current=nt.epoch,await It.current(pe,nt.target);return}}catch{}!W.current||Fe.current!==pe||(re.current=setTimeout(()=>{ze()},Zt))}};re.current=setTimeout(()=>{ze()},Zt)},[ae,F]),Ei=T.useCallback(async(pe=!1,ze=pe)=>{if(!W.current||!_||!j)return;const nt=pe?oe.current:null,Ct=pe?new Set(xe.current):null;pe?ut():Ce(),de("connecting");const Ve=new AbortController;Ie.current=Ve;try{const St=ze?void 0:Ac(e),Oe=LC(nv(Q.current),ke,ze?await Ac(e):void 0,!ze);De(ze?"probe-climb":"cold-start",Oe,Pp(e));const{sessionId:dt,sdpOffer:fn,iceServers:xn}=await _(Oe);if(xe.current.add(dt),St!==void 0&&St.then(ot=>{ot===void 0||!jC(ot)||!W.current||Ve.signal.aborted||Je.current||(Je.current=!0,Ei(!0,!0))}),!W.current||Ve.signal.aborted){G?.(dt).catch(()=>{}),xe.current.delete(dt);return}const Ge=new RTCPeerConnection({iceServers:[...xn??[],{urls:"stun:stun.l.google.com:19302"}]});pe||(oe.current=Ge);const on=new MediaStream;let hn=!1;const Qt=()=>{if(!(hn||!W.current)){if(hn=!0,oe.current=Ge,ge.current&&(ge.current.srcObject=on,xo(ge.current,rt.current),ge.current.play().catch(()=>{})),nt&&nt!==Ge)try{nt.close()}catch{}if(Ct)for(const ot of Ct)xe.current.delete(ot),G?.(ot).catch(()=>{})}};Ge.ontrack=ot=>{if(console.debug("[WebRTC] ontrack",ot.track.kind,ot.track.readyState),on.addTrack(ot.track),pe){Qt();return}ge.current&&(ge.current.srcObject=on,xo(ge.current,rt.current),ge.current.play().catch(()=>{}))},Ge.oniceconnectionstatechange=()=>{if(!W.current)return;const ot=Ge.iceConnectionState;if(console.debug("[WebRTC] ICE state:",ot),ot==="connected"||ot==="completed")q.current=0,pe&&Qt(),de("playing"),ge.current?.paused&&(console.debug("[WebRTC] video was paused at ICE connected — calling play()"),ge.current.play().catch(()=>{}));else if(ot==="failed"||ot==="disconnected"||ot==="closed"){if(pe&&!hn)try{Ge.close()}catch{}de("disconnected"),Ga()}},Ge.onicecandidateerror=ot=>{console.debug("[WebRTC] ICE candidate error:",ot)},console.debug("[WebRTC] Setting remote description (server offer)..."),await Ge.setRemoteDescription({type:"offer",sdp:fn});const Vn=await Ge.createAnswer();if(await Ge.setLocalDescription(Vn),console.debug("[WebRTC] Local description set, waiting for ICE gathering..."),await qC(Ge),!W.current)return;const sn=(Ge.localDescription?.sdp??"").split(`
82
- `).filter(ot=>ot.startsWith("a=candidate:")).length;console.debug("[WebRTC] Sending answer to server",{localCandidates:sn,sessionId:dt.slice(0,8)}),await j(dt,Ge.localDescription?.sdp??""),console.debug("[WebRTC] Answer sent successfully");const Ot=Ge,Dn=()=>{const ot=Ot.connectionState;if(ot==="closed"||ot==="failed")return;const Ka=ge.current;Ka&&Ka.readyState===0&&console.log(`[WebRTC] no video data yet (ice=${Ot.iceConnectionState})`)};setTimeout(Dn,3e3),setTimeout(Dn,8e3)}catch(St){if(!W.current)return;const Oe=St instanceof Error?St.message:String(St);Qe(Oe),de("error"),C?.(Oe),Ga()}},[e,t,_,j,Ce,ut,G,de,C,ke,De]),Tu=T.useCallback(async()=>{if(W.current){Ce(),de("connecting");try{const pe=new RTCPeerConnection({iceServers:[{urls:"stun:stun.l.google.com:19302"}]});oe.current=pe,pe.addTransceiver("video",{direction:"recvonly"}),pe.addTransceiver("audio",{direction:"recvonly"});const ze=new MediaStream;pe.ontrack=Oe=>{ze.addTrack(Oe.track),ge.current&&(ge.current.srcObject=ze,xo(ge.current,rt.current),ge.current.play().catch(()=>{}))},pe.oniceconnectionstatechange=()=>{if(!W.current)return;const Oe=pe.iceConnectionState;Oe==="connected"||Oe==="completed"?(q.current=0,de("playing"),ge.current?.paused&&ge.current.play().catch(()=>{})):(Oe==="failed"||Oe==="disconnected"||Oe==="closed")&&(de("disconnected"),Ga())};const nt=await pe.createOffer();if(await pe.setLocalDescription(nt),await qC(pe),!W.current)return;const Ct=`${e}/api/webrtc?src=${encodeURIComponent(t)}`,Ve=await fetch(Ct,{method:"POST",headers:{"Content-Type":"application/sdp"},body:pe.localDescription?.sdp??""});if(!Ve.ok)throw new Error(`WHEP ${Ve.status}: ${Ve.statusText}`);const St=await Ve.text();await pe.setRemoteDescription({type:"answer",sdp:St})}catch(pe){if(!W.current)return;const ze=pe instanceof Error?pe.message:String(pe);Qe(ze),de("error"),C?.(ze),Ga()}}},[e,t,Ce,de,C]),Xr=T.useCallback(async(pe=!1,ze=pe)=>{if(!W.current||!D)return;const nt=pe?oe.current:null,Ct=pe?new Set(xe.current):null;pe?ut():Ce(),de("connecting");const Ve=new AbortController;Ie.current=Ve;const St=performance.now(),Oe=()=>Math.round(performance.now()-St),dt={};try{const fn=ze?void 0:Ac(e),xn=await z?.();if(dt.iceServersMs=Oe(),!W.current||Ve.signal.aborted)return;const Ge=new RTCPeerConnection({iceServers:[...xn??[],{urls:"stun:stun.l.google.com:19302"}]});pe||(oe.current=Ge);const on=new MediaStream;let hn=!1;const Qt=()=>{if(!(hn||!W.current)){if(hn=!0,oe.current=Ge,ge.current&&(ge.current.srcObject=on,xo(ge.current,rt.current),ge.current.play().catch(()=>{})),nt&&nt!==Ge)try{nt.close()}catch{}if(Ct)for(const wt of Ct)xe.current.delete(wt),G?.(wt).catch(()=>{})}};Ge.ontrack=wt=>{if(dt.firstTrackMs===void 0&&(dt.firstTrackMs=Oe()),console.debug("[WebRTC] ontrack (client-offer)",wt.track.kind,wt.track.readyState),on.addTrack(wt.track),pe){Qt();return}ge.current&&(ge.current.srcObject=on,xo(ge.current,rt.current),ge.current.play().catch(()=>{}))};let Vn=!1;Ge.oniceconnectionstatechange=()=>{if(!W.current)return;const wt=Ge.iceConnectionState;if(console.debug("[WebRTC] ICE state (client-offer):",wt),wt==="connected"||wt==="completed"){if(!Vn){Vn=!0,dt.iceConnectedMs=Oe(),console.info("[WebRTC timing] client-offer connected",{streamKey:t,...dt}),c?.({...dt});const Wn=ge.current;Wn&&"requestVideoFrameCallback"in Wn&&(Wn.requestVideoFrameCallback(()=>{dt.firstFrameMs=Oe(),console.info("[WebRTC timing] first decoded frame",{streamKey:t,firstFrameMs:dt.firstFrameMs}),c?.({...dt})}),setTimeout(()=>{W.current&&dt.firstFrameMs===void 0&&(console.warn("[WebRTC timing] NO decoded frame (stalled)",{streamKey:t,sinceIceConnectedMs:Oe()-(dt.iceConnectedMs??0),iceConnectedMs:dt.iceConnectedMs,firstTrackMs:dt.firstTrackMs}),Zo.current("no decoded frame after connect"),Ga())},Ise))}q.current=0,pe&&Qt(),de("playing"),ge.current?.paused&&ge.current.play().catch(()=>{})}else if(wt==="failed"||wt==="disconnected"||wt==="closed"){if(pe&&!hn)try{Ge.close()}catch{}de("disconnected"),Ga()}};let sn=null;const Ot=[];if(Ge.onicecandidate=wt=>{if(!wt.candidate)return;const Wn=wt.candidate.toJSON();sn&&B?B(sn,Wn).catch(()=>{}):Ot.push(Wn)},Ge.addTransceiver("video",{direction:"recvonly"}),Ge.addTransceiver("audio",{direction:"recvonly"}),le.current){const wt=Ge.createDataChannel("camstack-control");le.current(wt)}const Dn=await Ge.createOffer();if(dt.offerCreatedMs=Oe(),await Ge.setLocalDescription(Dn),dt.localSetMs=Oe(),!W.current||Ve.signal.aborted)return;const ot=ze?await Ac(e):void 0,Ka=LC(nv(Q.current),ke,ot,!ze);De(ze?"probe-climb":"cold-start",Ka,Pp(e));const Kn=Oe(),{sessionId:ka,sdpAnswer:at}=await D(Ge.localDescription?.sdp??Dn.sdp??"",void 0,Ka);if(dt.signalingRttMs=Oe()-Kn,sn=ka,xe.current.add(ka),fn!==void 0&&fn.then(wt=>{wt===void 0||!jC(wt)||!W.current||Ve.signal.aborted||Je.current||(Je.current=!0,Xr(!0,!0))}),Fe.current=ka,!W.current||Ve.signal.aborted){G?.(ka).catch(()=>{}),xe.current.delete(ka);return}if(B)for(const wt of Ot)B(ka,wt).catch(()=>{});if(Ot.length=0,await Ge.setRemoteDescription({type:"answer",sdp:at}),dt.answerSetMs=Oe(),console.debug("[WebRTC] Client-offer answer set (trickle)",{sessionId:ka.slice(0,8)}),L){const wt=new Set,Wn=Date.now(),Jo=async()=>{if(!(!W.current||Ve.signal.aborted)&&!(Ge.connectionState==="closed"||Ge.signalingState==="closed")){try{const{candidates:Al,done:Ii}=await L(ka);for(const di of Al){const to=di.candidate??"";to&&!wt.has(to)&&(wt.add(to),Ge.addIceCandidate(new RTCIceCandidate(di)).catch(()=>{}))}const Yn=Ge.iceConnectionState;if(Ii||Date.now()-Wn>1e4||Yn==="connected"||Yn==="completed")return}catch{}setTimeout(()=>{Jo()},200)}};Jo()}On(ka)}catch(fn){if(!W.current)return;const xn=fn instanceof Error?fn.message:String(fn);Qe(xn),de("error"),C?.(xn),Ga()}},[e,D,z,B,L,G,Ce,ut,de,C,On,ke,De]);It.current=T.useCallback(async(pe,ze)=>{const nt=F;if(!W.current||!nt)return;const Ct=oe.current;Ze.current=!0;try{let Ve=function(){if(fn||!W.current){Qt();return}fn=!0,oe.current=Oe,ge.current&&(ge.current.srcObject=dt,ge.current.play().catch(()=>{})),Ct&&Ct!==Oe&&Ct.close(),Qt()};const St=await z?.();if(!W.current)return;const Oe=new RTCPeerConnection({iceServers:[...St??[],{urls:"stun:stun.l.google.com:19302"}]}),dt=new MediaStream;let fn=!1,xn=!1,Ge=null,on,hn;const Qt=()=>{hn!==void 0&&(clearTimeout(hn),hn=void 0);const at=Ge;if(Ge=null,!!at){on!==void 0&&typeof at.cancelVideoFrameCallback=="function"&&at.cancelVideoFrameCallback(on),at.removeEventListener("loadeddata",Ve);try{at.srcObject=null}catch{}at.remove()}},Vn=()=>{if(xn||fn||!W.current)return;if(xn=!0,typeof document>"u"){Ve();return}const at=document.createElement("video");at.muted=!0,at.playsInline=!0,at.autoplay=!0,at.style.cssText="position:absolute;left:-9999px;top:0;width:1px;height:1px;opacity:0;pointer-events:none;",at.srcObject=dt,Ge=at,(Q.current??document.body).appendChild(at),at.play().catch(()=>{}),typeof at.requestVideoFrameCallback=="function"&&(on=at.requestVideoFrameCallback(()=>Ve())),at.addEventListener("loadeddata",Ve,{once:!0}),hn=setTimeout(()=>Ve(),1800)};Oe.ontrack=at=>{console.debug("[WebRTC] ontrack (reoffer)",at.track.kind,at.track.readyState),dt.addTrack(at.track),Vn()},Oe.oniceconnectionstatechange=()=>{if(!W.current)return;const at=Oe.iceConnectionState;console.debug("[WebRTC] ICE state (reoffer):",at),at==="connected"||at==="completed"?(q.current=0,Vn(),de("playing"),ge.current?.paused&&ge.current.play().catch(()=>{})):(at==="failed"||at==="closed")&&(Qt(),!fn&&at==="failed"&&Oe.close(),de("disconnected"),Ga())};let sn=null;const Ot=[];if(Oe.onicecandidate=at=>{if(!at.candidate)return;const wt=at.candidate.toJSON();sn&&B?B(sn,wt).catch(()=>{}):Ot.push(wt)},Oe.addTransceiver("video",{direction:"recvonly"}),Oe.addTransceiver("audio",{direction:"recvonly"}),le.current){const at=Oe.createDataChannel("camstack-control");le.current(at)}const Dn=await Oe.createOffer();if(await Oe.setLocalDescription(Dn),!W.current){Oe.close();return}const ot=await Ac(e),Ka={...nv(Q.current),...ot!==void 0?{downlinkMbps:ot}:{},...ke};De("renegotiate",Ka,Pp(e));const{sessionId:Kn,sdpAnswer:ka}=await nt(pe,Oe.localDescription?.sdp??Dn.sdp??"",ze,Ka);if(!W.current){Oe.close();return}if(sn=Kn,xe.current.add(Kn),Fe.current=Kn,B)for(const at of Ot)B(Kn,at).catch(()=>{});if(Ot.length=0,await Oe.setRemoteDescription({type:"answer",sdp:ka}),L){const at=new Set,wt=Date.now(),Wn=async()=>{if(W.current&&!(Oe.connectionState==="closed"||Oe.signalingState==="closed")){try{const{candidates:Jo,done:Al}=await L(Kn);for(const Yn of Jo){const di=Yn.candidate??"";di&&!at.has(di)&&(at.add(di),Oe.addIceCandidate(new RTCIceCandidate(Yn)).catch(()=>{}))}const Ii=Oe.iceConnectionState;if(Al||Date.now()-wt>1e4||Ii==="connected"||Ii==="completed")return}catch{}setTimeout(()=>{Wn()},200)}};Wn()}On(Kn)}catch(Ve){console.debug("[WebRTC] reoffer failed; keeping last frame, re-arming poll",Ve instanceof Error?Ve.message:String(Ve)),On(pe)}finally{Ze.current=!1}},[e,F,z,B,L,de,On,ke,De]);const xa=ra?Xr:et?Ei:Tu,_u=T.useRef(()=>{}),Sl=T.useRef(E);Sl.current=E;const Zo=T.useRef(()=>{});Zo.current=pe=>{console.warn("[WebRTC] hard error",{streamKey:t,msg:pe}),Qe(pe),C?.(pe),de("error")},_u.current=xa;const Ga=T.useCallback(()=>{if(!W.current)return;const pe=q.current,ze=ise(pe);if(Sl.current?.(ze),ze.kind==="exhausted"){Zo.current(`reconnect attempts exhausted (${ze.attempts})`);return}q.current+=1,he.current=setTimeout(()=>{W.current&&_u.current()},ze.delayMs)},[]);T.useEffect(()=>(W.current=!0,q.current=0,a&&xa(),()=>{W.current=!1,Ce()}),[]);const Ko=T.useRef(!1);T.useEffect(()=>{if(a){if(ra){if(!D)return}else if(et){if(!_||!j)return}else return;Ko.current||oe.current||(Ko.current=!0,xa())}},[a,ra,et,D,_,j,xa]);const Wo=()=>{q.current=0,xa()},xl=()=>{if(q.current=0,oe.current&&ra){Xr(!0);return}if(oe.current&&et){Ei(!0);return}xa()},kl=T.useRef(e),Za=T.useRef(t);T.useEffect(()=>{const pe=kl.current!==e,ze=Za.current!==t;if(kl.current=e,Za.current=t,!(!pe&&!ze)&&W.current){if(q.current=0,Je.current=!1,pe){Ce(),xa();return}xl()}},[e,t]);const Sn=T.useRef(Ae);T.useEffect(()=>{Sn.current!==Ae&&(Sn.current=Ae,W.current&&xl())},[Ae]);const Qn=()=>{if(ge.current){const pe=!ge.current.muted;xo(ge.current,pe),Nt(pe)}},or=async()=>{if(Q.current)try{if(document.fullscreenElement){await document.exitFullscreen();return}if(Q.current.requestFullscreen){await Q.current.requestFullscreen();return}const pe=ge.current;pe?.webkitEnterFullscreen&&pe.webkitEnterFullscreen()}catch(pe){console.warn(`Fullscreen toggle failed: ${pe instanceof Error?pe.message:pe}`)}},wl=async()=>{const pe=ge.current;if(pe)try{if(typeof pe.webkitSetPresentationMode=="function"){pe.webkitSetPresentationMode(pe.webkitPresentationMode==="picture-in-picture"?"inline":"picture-in-picture");return}document.pictureInPictureElement?await document.exitPictureInPicture():await pe.requestPictureInPicture()}catch(ze){console.warn(`PiP toggle failed: ${ze instanceof Error?ze.message:String(ze)}`)}},Vm=()=>{if(!ge.current)return;const pe=document.createElement("canvas");pe.width=ge.current.videoWidth||1280,pe.height=ge.current.videoHeight||720;const ze=pe.getContext("2d");if(!ze)return;ze.drawImage(ge.current,0,0);const nt=document.createElement("a");nt.download=`${t.replace(/[/:]/g,"-")}-${Date.now()}.jpg`,nt.href=pe.toDataURL("image/jpeg",.92),nt.click()};T.useEffect(()=>{const pe=()=>en(!!document.fullscreenElement);document.addEventListener("fullscreenchange",pe);const ze=ge.current;return ze?.addEventListener("webkitbeginfullscreen",pe),ze?.addEventListener("webkitendfullscreen",pe),()=>{document.removeEventListener("fullscreenchange",pe),ze?.removeEventListener("webkitbeginfullscreen",pe),ze?.removeEventListener("webkitendfullscreen",pe)}},[]),T.useEffect(()=>{const pe=ge.current,ze=typeof document<"u"&&document.pictureInPictureEnabled===!0,nt=pe!==null&&typeof pe.webkitSetPresentationMode=="function";pn(ze||nt)},[]);const[Gm,Ml]=T.useState(null),[Jr,Yo]=T.useState(null),[sr,ui]=T.useState(null),[eo,lr]=T.useState(()=>Date.now());T.useEffect(()=>{if(!f)return;const pe=setInterval(()=>lr(Date.now()),500);return()=>clearInterval(pe)},[f]),T.useEffect(()=>{if(!f){Ml(null);return}const pe={current:null};let ze=!1;const nt=async()=>{const Ve=oe.current;if(Ve)try{const St=await Ve.getStats();if(ze)return;const Oe=gse({report:St,prev:pe.current,now:Date.now(),iceConnectionState:Ve.iceConnectionState,dtlsState:Ve.connectionState});pe.current=Oe,Ml(Oe)}catch{}};nt();const Ct=setInterval(()=>{nt()},1e3);return()=>{ze=!0,clearInterval(Ct)}},[f]),T.useEffect(()=>{if(!f||!V){Yo(null),ui(null);return}let pe=!1;const ze=async()=>{const Ct=Fe.current;if(Ct!==null)try{const Ve=await V(Ct);if(pe)return;Yo(Ve),ui(null)}catch(Ve){if(pe)return;ui(Ve instanceof Error?Ve.message:String(Ve))}};ze();const nt=setInterval(()=>{ze()},1e3);return()=>{pe=!0,clearInterval(nt)}},[f,V]);const rn=T.useRef(null);T.useEffect(()=>{if(!h){rn.current=null;return}const pe=async()=>{const nt=oe.current;if(nt)try{const Ct=await nt.getStats();let Ve=0,St=0,Oe=0,dt=0,fn=0,xn=0;Ct.forEach(sn=>{const Ot=sn;Ot.type==="inbound-rtp"&&(Ot.kind??Ot.mediaType)==="video"?(Ve=Ot.packetsLost??0,St=Ot.packetsReceived??0,Oe=Ot.bytesReceived??0,dt=Ot.timestamp,fn=Ot.jitter??0):Ot.type==="candidate-pair"&&Ot.nominated&&typeof Ot.currentRoundTripTime=="number"&&(xn=Ot.currentRoundTripTime)});const Ge=rn.current;if(rn.current={lost:Ve,recv:St,bytes:Oe,ts:dt},!Ge||dt<=Ge.ts)return;const on=Math.max(0,Ve-Ge.lost),hn=on+Math.max(0,St-Ge.recv),Qt=hn>0?Math.min(100,on/hn*100):0,Vn=Math.max(0,Math.round((Oe-Ge.bytes)*8/(dt-Ge.ts)));h({rttMs:Math.round(xn*1e3),jitterMs:Math.round(fn*1e3),estimatedBandwidthKbps:Vn,packetLossPercent:Qt})}catch{}},ze=setInterval(()=>{pe()},2e3);return()=>clearInterval(ze)},[h]);const Xo=T.useRef(null);T.useEffect(()=>{if(!m){Xo.current=null;return}const pe=async()=>{const nt=oe.current,Ct=ge.current;if(nt)try{const Ve=await nt.getStats();let St=0,Oe=0,dt=0,fn=0,xn=0,Ge=0,on=0,hn=0;Ve.forEach(Dn=>{const ot=Dn;ot.type==="inbound-rtp"&&(ot.kind??ot.mediaType)==="video"&&(St=ot.framesReceived??0,Oe=ot.framesDecoded??0,dt=ot.framesDropped??0,fn=ot.framesPerSecond??0,xn=ot.freezeCount??0,Ge=ot.totalFreezesDuration??0,on=ot.jitterBufferDelay??0,hn=ot.jitterBufferEmittedCount??0)});const Qt=Ct?.currentTime??0,Vn=Date.now(),sn=Xo.current,Ot=hn>0?Math.round(on/hn*1e3):0;sn&&m({dRecv:St-sn.recv,dDec:Oe-sn.dec,dDrop:dt-sn.drop,fps:Math.round(fn),dFreeze:xn-sn.freeze,freezeTotalMs:Math.round(Ge*1e3),avgJitterMs:Ot,dCtMs:Math.round((Qt-sn.ct)*1e3),dtMs:Vn-sn.ts,readyState:Ct?.readyState??-1}),Xo.current={recv:St,dec:Oe,drop:dt,freeze:xn,ct:Qt,ts:Vn}}catch{}};pe();const ze=setInterval(()=>{pe()},5e3);return()=>clearInterval(ze)},[m]),T.useEffect(()=>{Nt(s);const pe=ge.current;pe&&(xo(pe,s),s||pe.play().catch(()=>{}))},[s]);const Cl=()=>{Hn||(li(!0),$n.current&&clearTimeout($n.current),$n.current=setTimeout(()=>li(!1),3e3))},Ri=()=>{li(pe=>!pe),$n.current&&clearTimeout($n.current)};T.useEffect(()=>{if(_e==="playing"){Va();const pe=setInterval(Va,2e3);return()=>clearInterval(pe)}oa&&sa.current&&Vo(sa.current)},[_e,oa,Va]),T.useEffect(()=>{if(_e!=="playing"){Yr(!1);return}const pe=ge.current;if(!pe)return;let ze=!1;const nt=()=>{ze||Yr(!0)};let Ct;typeof pe.requestVideoFrameCallback=="function"&&(Ct=pe.requestVideoFrameCallback(()=>nt())),pe.addEventListener("loadeddata",nt,{once:!0});const Ve=setTimeout(nt,12e3);return()=>{ze=!0,clearTimeout(Ve),Ct!==void 0&&typeof pe.cancelVideoFrameCallback=="function"&&pe.cancelVideoFrameCallback(Ct),pe.removeEventListener("loadeddata",nt)}},[_e]);const la=oa&&Nn?Nn:fe??null,Zm=!Go&&la!==null;return v.jsxs("div",{ref:Q,className:`relative isolate bg-black overflow-hidden group ${x}`,onMouseMove:Cl,onMouseEnter:Cl,onTouchStart:Ri,children:[v.jsx("video",{ref:ge,autoPlay:a,muted:Xe,playsInline:!0,className:"w-full h-full object-contain relative z-0"}),Zm&&la&&v.jsx("img",{src:la,alt:"",className:"absolute inset-0 w-full h-full object-contain z-[5] transform-gpu pointer-events-none"}),n&&_e==="playing"&&v.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}),f&&v.jsx(Cse,{stats:Gm,server:Jr,serverError:sr,serverWired:V!==void 0,now:eo,sessionId:Fe.current}),R,p&&!la&&_e==="connecting"&&v.jsxs("div",{className:"absolute inset-0 z-10 transform-gpu flex flex-col items-center justify-center bg-black/70 gap-2",children:[v.jsx("svg",{className:"h-6 w-6 text-white/60 animate-spin",viewBox:"0 0 24 24",fill:"none",children:v.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]"})}),v.jsx("span",{className:"text-xs text-white/60",children:"Connecting…"})]}),p&&!la&&(_e==="error"||_e==="disconnected")&&v.jsxs("div",{className:"absolute inset-0 z-10 transform-gpu flex flex-col items-center justify-center bg-black/70 gap-2",children:[v.jsx("svg",{className:"h-6 w-6 text-red-400",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:v.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"})}),v.jsx("span",{className:"text-xs text-red-400 text-center px-4",children:_e==="error"?Re||"Connection failed":"Disconnected"}),v.jsx("button",{onClick:Wo,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"})]}),p&&la&&(_e==="connecting"||_e==="disconnected")&&v.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:v.jsx("svg",{className:"h-3.5 w-3.5 text-white/90 animate-spin",viewBox:"0 0 24 24",fill:"none",children:v.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]"})})}),p&&la&&_e==="error"&&v.jsx("button",{onClick:Wo,title:Re||"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:v.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:[v.jsx("path",{d:"M23 4v6h-6M1 20v-6h6"}),v.jsx("path",{d:"M3.51 9a9 9 0 0114.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0020.49 15"})]})}),p&&_e!=="idle"&&_e!=="error"&&v.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 ${Hn||Sa?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none"}`,children:[v.jsx("div",{className:"flex items-center gap-1",children:v.jsx(sp,{onClick:Qn,title:Xe?"Unmute":"Mute",children:Xe?v.jsxs("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[v.jsx("polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"}),v.jsx("line",{x1:"23",y1:"9",x2:"17",y2:"15"}),v.jsx("line",{x1:"17",y1:"9",x2:"23",y2:"15"})]}):v.jsxs("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[v.jsx("polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"}),v.jsx("path",{d:"M19.07 4.93a10 10 0 010 14.14M15.54 8.46a5 5 0 010 7.07"})]})})}),v.jsxs("div",{className:"flex items-center gap-1",children:[v.jsx(sp,{onClick:Vm,title:"Take snapshot",children:v.jsxs("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[v.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"}),v.jsx("circle",{cx:"12",cy:"13",r:"4"})]})}),In&&v.jsx(sp,{onClick:wl,title:"Picture-in-Picture",children:v.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:[v.jsx("path",{d:"M21 9V6a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2h4"}),v.jsx("rect",{width:"10",height:"7",x:"12",y:"13",rx:"2"})]})}),v.jsx(sp,{onClick:or,title:$t?"Exit fullscreen":"Fullscreen",children:$t?v.jsx("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:v.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"})}):v.jsx("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:v.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 sp({onClick:e,title:t,children:n}){return v.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 qC(e){if(e.iceGatheringState!=="complete")return new Promise(t=>{let n=!1,a;const s=()=>{n||(n=!0,a&&clearInterval(a),e.removeEventListener("icegatheringstatechange",p),t())},p=()=>{e.iceGatheringState==="complete"&&s()};e.addEventListener("icegatheringstatechange",p);const f=Date.now();a=setInterval(()=>{const m=e.localDescription?.sdp??"";/ typ host/.test(m)&&Date.now()-f>=600&&s()},100),setTimeout(s,2500)})}var av=["day","ir"],Tse={day:"Daylight",ir:"Night (IR)",night:"Night",dawn:"Dawn",dusk:"Dusk"};function Dp(e){return Tse[e]??e}function Fve(e){const t=new Set(e.coveredConditions),n=av.map(f=>`${Dp(f)} ${t.has(f)?"✓":"✗"}`),a=[...t].filter(f=>!av.some(m=>m===f));for(const f of a)n.push(`${Dp(f)} ✓`);const s=av.filter(f=>!t.has(f));if(s.length===0)return n.join(" · ");if(t.size===0)return`${n.join(" · ")} — nothing captured yet, so this scene is not watching.`;const p=s.map(f=>Dp(f).toLowerCase()).join(" and ");return e.onUncoveredCondition==="judge-anyway"?`${n.join(" · ")} — ${p} judged against the references you do have.`:`${n.join(" · ")} — optional; checks in ${p} are skipped.`}function _se(e){if(e.suspendedCondition===null)return null;const t=Dp(e.suspendedCondition).toLowerCase();return`Paused — nothing was captured in ${t}, so checks are on hold until the light changes back. Capture ${t} if you want it watched around the clock.`}var Nse={"no-reference-for-condition":"can’t tell — nothing has been captured for this scene yet. Press “Capture daylight” to photograph what normal looks like.","view-shifted":"can’t tell — the camera view has moved since the reference was captured. Re-capture it.","no-vision-profile":"can’t tell — the vision model is unreachable, so the change is on hold.","encoder-model-changed":"can’t tell — the embedding model changed, so the stored references are unreadable. Re-capture them.","no-snapshot":"can’t tell — this camera did not return a frame."};function Uve(e,t){if(e.states.length===0)return"Not armed yet — capture the initial state to start watching.";if(e.verdict==="unknown")return e.unavailable!==null?Nse[e.unavailable]:"can’t tell right now.";const n=e.verdict==="diverged"?e.divergedAt:e.armedAt,a=n!==null?` for ${jse(Math.max(0,t-n))}`:"";if(e.latched)return e.verdict==="diverged"?`CHANGED${a} — press Reset when you have dealt with it.`:`Back to normal, but still flagged as changed${a}. Press Reset to clear it.`;const s=_se(e);return s!==null?s:e.verdict==="diverged"?`CHANGED${a}`:`Normal${a}`}function Hve(e){return e.states.length===0?{text:"Not armed",tone:"unknown"}:e.latched?{text:"Changed",tone:"alarm"}:e.suspendedCondition!==null?{text:"Paused",tone:"unknown"}:e.verdict==="unknown"?{text:"Can’t tell",tone:"unknown"}:e.verdict==="diverged"?{text:"Changed",tone:"alarm"}:{text:"Normal",tone:"ok"}}var Ose=.4;function $ve(e){return e.width*e.height>Ose}function jse(e){const t=Math.floor(e/1e3);if(t<60)return`${t}s`;const n=Math.floor(t/60);if(n<60)return`${n}m`;const a=Math.floor(n/60);return a<48?`${a}h`:`${Math.floor(a/24)}d`}var Qve="text-[10px] text-foreground-subtle",Pse={face:"#a855f7",plate:"#ec4899"};Object.freeze({...Object.fromEntries(Object.values($b).filter(e=>e.category==="detection"||e.kind==="motion").map(e=>[e.kind,e.color])),...Pse});var Dse=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()}},wN=class{constructor(e){this.generateIdentifier=e,this.kv=new Dse}register(e,t){this.kv.getByValue(e)||(t||(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)}},zse=class extends wN{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 Lse(e){if("values"in Object)return Object.values(e);const t=[];for(const n in e)e.hasOwnProperty(n)&&t.push(e[n]);return t}function qse(e,t){const n=Lse(e);if("find"in n)return n.find(t);const a=n;for(let s=0;s<a.length;s++){const p=a[s];if(t(p))return p}}function hl(e,t){Object.entries(e).forEach(([n,a])=>t(a,n))}function zp(e,t){return e.indexOf(t)!==-1}function BC(e,t){for(let n=0;n<e.length;n++){const a=e[n];if(t(a))return a}}var Bse=class{constructor(){this.transfomers={}}register(e){this.transfomers[e.name]=e}findApplicable(e){return qse(this.transfomers,t=>t.isApplicable(e))}findByName(e){return this.transfomers[e]}},Fse=e=>Object.prototype.toString.call(e).slice(8,-1),MN=e=>typeof e>"u",Use=e=>e===null,su=e=>typeof e!="object"||e===null||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype,Yy=e=>su(e)&&Object.keys(e).length===0,$r=e=>Array.isArray(e),Hse=e=>typeof e=="string",$se=e=>typeof e=="number"&&!isNaN(e),Qse=e=>typeof e=="boolean",Vse=e=>e instanceof RegExp,lu=e=>e instanceof Map,cu=e=>e instanceof Set,CN=e=>Fse(e)==="Symbol",Gse=e=>e instanceof Date&&!isNaN(e.valueOf()),AN=e=>e instanceof Error,FC=e=>typeof e=="number"&&isNaN(e),Zse=e=>Qse(e)||Use(e)||MN(e)||$se(e)||Hse(e)||CN(e),Kse=e=>typeof e=="bigint",Wse=e=>e===1/0||e===-1/0,Yse=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),Xse=e=>e instanceof URL,Xy=e=>e.replace(/\\/g,"\\\\").replace(/\./g,"\\."),iv=e=>e.map(String).map(Xy).join("."),Uc=(e,t)=>{const n=[];let a="";for(let p=0;p<e.length;p++){let f=e.charAt(p);if(!t&&f==="\\"){const m=e.charAt(p+1);if(m==="\\"){a+="\\",p++;continue}else if(m!==".")throw Error("invalid path")}if(f==="\\"&&e.charAt(p+1)==="."){a+=".",p++;continue}if(f==="."){n.push(a),a="";continue}a+=f}const s=a;return n.push(s),n};function bi(e,t,n,a){return{isApplicable:e,annotation:t,transform:n,untransform:a}}var EN=[bi(MN,"undefined",()=>null,()=>{}),bi(Kse,"bigint",e=>e.toString(),e=>typeof BigInt<"u"?BigInt(e):(console.error("Please add a BigInt polyfill."),e)),bi(Gse,"Date",e=>e.toISOString(),e=>new Date(e)),bi(AN,"Error",(e,t)=>{const n={name:e.name,message:e.message};return"cause"in e&&(n.cause=e.cause),t.allowedErrorProps.forEach(a=>{n[a]=e[a]}),n},(e,t)=>{const n=new Error(e.message,{cause:e.cause});return n.name=e.name,n.stack=e.stack,t.allowedErrorProps.forEach(a=>{n[a]=e[a]}),n}),bi(Vse,"regexp",e=>""+e,e=>{const t=e.slice(1,e.lastIndexOf("/")),n=e.slice(e.lastIndexOf("/")+1);return new RegExp(t,n)}),bi(cu,"set",e=>[...e.values()],e=>new Set(e)),bi(lu,"map",e=>[...e.entries()],e=>new Map(e)),bi(e=>FC(e)||Wse(e),"number",e=>FC(e)?"NaN":e>0?"Infinity":"-Infinity",Number),bi(e=>e===0&&1/e===-1/0,"number",()=>"-0",Number),bi(Xse,"URL",e=>e.toString(),e=>new URL(e))];function Um(e,t,n,a){return{isApplicable:e,annotation:t,transform:n,untransform:a}}var RN=Um((e,t)=>CN(e)?!!t.symbolRegistry.getIdentifier(e):!1,(e,t)=>["symbol",t.symbolRegistry.getIdentifier(e)],e=>e.description,(e,t,n)=>{const a=n.symbolRegistry.getValue(t[1]);if(!a)throw new Error("Trying to deserialize unknown symbol");return a}),Jse=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,t)=>(e[t.name]=t,e),{}),IN=Um(Yse,e=>["typed-array",e.constructor.name],e=>[...e],(e,t)=>{const n=Jse[t[1]];if(!n)throw new Error("Trying to deserialize unknown typed array");return new n(e)});function TN(e,t){return e?.constructor?!!t.classRegistry.getIdentifier(e.constructor):!1}var _N=Um(TN,(e,t)=>["class",t.classRegistry.getIdentifier(e.constructor)],(e,t)=>{const n=t.classRegistry.getAllowedProps(e.constructor);if(!n)return{...e};const a={};return n.forEach(s=>{a[s]=e[s]}),a},(e,t,n)=>{const a=n.classRegistry.getValue(t[1]);if(!a)throw new Error(`Trying to deserialize unknown class '${t[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);return Object.assign(Object.create(a.prototype),e)}),NN=Um((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)=>{const a=n.customTransformerRegistry.findByName(t[1]);if(!a)throw new Error("Trying to deserialize unknown custom value");return a.deserialize(e)}),ele=[_N,RN,NN,IN],UC=(e,t)=>{const n=BC(ele,s=>s.isApplicable(e,t));if(n)return{value:n.transform(e,t),type:n.annotation(e,t)};const a=BC(EN,s=>s.isApplicable(e,t));if(a)return{value:a.transform(e,t),type:a.annotation}},ON={};EN.forEach(e=>{ON[e.annotation]=e});var tle=(e,t,n)=>{if($r(t))switch(t[0]){case"symbol":return RN.untransform(e,t,n);case"class":return _N.untransform(e,t,n);case"custom":return NN.untransform(e,t,n);case"typed-array":return IN.untransform(e,t,n);default:throw new Error("Unknown transformation: "+t)}else{const a=ON[t];if(!a)throw new Error("Unknown transformation: "+t);return a.untransform(e,n)}},Js=(e,t)=>{if(t>e.size)throw new Error("index out of bounds");const n=e.keys();for(;t>0;)n.next(),t--;return n.next().value};function jN(e){if(zp(e,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(zp(e,"prototype"))throw new Error("prototype is not allowed as a property");if(zp(e,"constructor"))throw new Error("constructor is not allowed as a property")}var nle=(e,t)=>{jN(t);for(let n=0;n<t.length;n++){const a=t[n];if(cu(e))e=Js(e,+a);else if(lu(e)){const s=+a,p=+t[++n]==0?"key":"value",f=Js(e,s);switch(p){case"key":e=f;break;case"value":e=e.get(f);break}}else e=e[a]}return e},Jy=(e,t,n)=>{if(jN(t),t.length===0)return n(e);let a=e;for(let p=0;p<t.length-1;p++){const f=t[p];if($r(a)){const m=+f;a=a[m]}else if(su(a))a=a[f];else if(cu(a)){const m=+f;a=Js(a,m)}else if(lu(a)){if(p===t.length-2)break;const m=+f,h=+t[++p]==0?"key":"value",c=Js(a,m);switch(h){case"key":a=c;break;case"value":a=a.get(c);break}}}const s=t[t.length-1];if($r(a)?a[+s]=n(a[+s]):su(a)&&(a[s]=n(a[s])),cu(a)){const p=Js(a,+s),f=n(p);p!==f&&(a.delete(p),a.add(f))}if(lu(a)){const p=+t[t.length-2],f=Js(a,p);switch(+s==0?"key":"value"){case"key":{const m=n(f);a.set(m,a.get(f)),m!==f&&a.delete(f);break}case"value":a.set(f,n(a.get(f)));break}}return e},PN=e=>e<1;function eb(e,t,n,a=[]){if(!e)return;const s=PN(n);if(!$r(e)){hl(e,(m,h)=>eb(m,t,n,[...a,...Uc(h,s)]));return}const[p,f]=e;f&&hl(f,(m,h)=>{eb(m,t,n,[...a,...Uc(h,s)])}),t(p,a)}function ale(e,t,n,a){return eb(t,(s,p)=>{e=Jy(e,p,f=>tle(f,s,a))},n),e}function ile(e,t,n){const a=PN(n);function s(p,f){const m=nle(e,Uc(f,a));p.map(h=>Uc(h,a)).forEach(h=>{e=Jy(e,h,()=>m)})}if($r(t)){const[p,f]=t;p.forEach(m=>{e=Jy(e,Uc(m,a),()=>e)}),f&&hl(f,s)}else hl(t,s);return e}var rle=(e,t)=>su(e)||$r(e)||lu(e)||cu(e)||AN(e)||TN(e,t);function ole(e,t,n){const a=n.get(e);a?a.push(t):n.set(e,[t])}function sle(e,t){const n={};let a;return e.forEach(s=>{if(s.length<=1)return;t||(s=s.map(m=>m.map(String)).sort((m,h)=>m.length-h.length));const[p,...f]=s;p.length===0?a=f.map(iv):n[iv(p)]=f.map(iv)}),a?Yy(n)?[a]:[a,n]:Yy(n)?void 0:n}var DN=(e,t,n,a,s=[],p=[],f=new Map)=>{const m=Zse(e);if(!m){ole(e,s,t);const E=f.get(e);if(E)return a?{transformedValue:null}:E}if(!rle(e,n)){const E=UC(e,n),R=E?{transformedValue:E.value,annotations:[E.type]}:{transformedValue:e};return m||f.set(e,R),R}if(zp(p,e))return{transformedValue:null};const h=UC(e,n),c=h?.value??e,x=$r(c)?[]:{},M={};hl(c,(E,R)=>{if(R==="__proto__"||R==="constructor"||R==="prototype")throw new Error(`Detected property ${R}. This is a prototype pollution risk, please remove it from your object.`);const _=DN(E,t,n,a,[...s,R],[...p,e],f);x[R]=_.transformedValue,$r(_.annotations)?M[Xy(R)]=_.annotations:su(_.annotations)&&hl(_.annotations,(j,D)=>{M[Xy(R)+"."+D]=j})});const C=Yy(M)?{transformedValue:x,annotations:h?[h.type]:void 0}:{transformedValue:x,annotations:h?[h.type,M]:M};return m||f.set(e,C),C};function zN(e){return Object.prototype.toString.call(e).slice(8,-1)}function HC(e){return zN(e)==="Array"}function lle(e){if(zN(e)!=="Object")return!1;const t=Object.getPrototypeOf(e);return!!t&&t.constructor===Object&&t===Object.prototype}function cle(e,t,n,a,s){const p={}.propertyIsEnumerable.call(a,t)?"enumerable":"nonenumerable";p==="enumerable"&&(e[t]=n),s&&p==="nonenumerable"&&Object.defineProperty(e,t,{value:n,enumerable:!1,writable:!0,configurable:!0})}function tb(e,t={}){if(HC(e))return e.map(s=>tb(s,t));if(!lle(e))return e;const n=Object.getOwnPropertyNames(e),a=Object.getOwnPropertySymbols(e);return[...n,...a].reduce((s,p)=>{if(p==="__proto__"||HC(t.props)&&!t.props.includes(p))return s;const f=e[p];return cle(s,p,tb(f,t),e,t.nonenumerable),s},{})}var Gt=class{constructor({dedupe:e=!1}={}){this.classRegistry=new zse,this.symbolRegistry=new wN(t=>t.description??""),this.customTransformerRegistry=new Bse,this.allowedErrorProps=[],this.dedupe=e}serialize(e){const t=new Map,n=DN(e,t,this,this.dedupe),a={json:n.transformedValue};n.annotations&&(a.meta={...a.meta,values:n.annotations});const s=sle(t,this.dedupe);return s&&(a.meta={...a.meta,referentialEqualities:s}),a.meta&&(a.meta.v=1),a}deserialize(e,t){const{json:n,meta:a}=e;let s=t?.inPlace?n:tb(n);return a?.values&&(s=ale(s,a.values,a.v??0,this)),a?.referentialEqualities&&(s=ile(s,a.referentialEqualities,a.v??0)),s}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)}};Gt.defaultInstance=new Gt;Gt.serialize=Gt.defaultInstance.serialize.bind(Gt.defaultInstance);Gt.deserialize=Gt.defaultInstance.deserialize.bind(Gt.defaultInstance);Gt.stringify=Gt.defaultInstance.stringify.bind(Gt.defaultInstance);Gt.parse=Gt.defaultInstance.parse.bind(Gt.defaultInstance);Gt.registerClass=Gt.defaultInstance.registerClass.bind(Gt.defaultInstance);Gt.registerSymbol=Gt.defaultInstance.registerSymbol.bind(Gt.defaultInstance);Gt.registerCustom=Gt.defaultInstance.registerCustom.bind(Gt.defaultInstance);Gt.allowErrorProps=Gt.defaultInstance.allowErrorProps.bind(Gt.defaultInstance);T.createContext(null);We.AddonStarted+"",We.AddonInstalled+"",We.AddonRestarted+"",We.AddonUpdated+"",We.AddonStopped+"",We.AddonUninstalled+"",We.AddonCrashed+"",We.AddonError+"",We.DetectionPhaseTransition+"",We.DetectionResult+"",We.DetectionEvent+"",We.DetectionCameraNative+"",We.ProviderMotion+"",We.MotionOnMotionChanged+"",We.MotionAnalysis+"",We.MotionZonesRaw+"",We.ProviderDetection+"",We.PipelineAudioInferenceResult+"",We.AgentOnline+"",We.AgentOffline+"",We.DeviceRegistered+"",We.DeviceUnregistered+"",We.DeviceStateChanged+"",We.EventEmitted+"";var ule=Object.freeze([...new Set(Object.values(We))].toSorted()),dle=Object.freeze([We.PipelineCameraMetricsSnapshot,We.PipelineRunnerLoadSnapshot,We.PipelineEngineMetricsSnapshot,We.PipelineInferenceResult,We.PipelineTrace,We.PipelineProgress,We.StreamBrokerMetricsSnapshot,We.MetricsNodeResourcesSnapshot,We.MetricsNodeProcessesSnapshot,We.ClusterTopologySnapshot,We.MotionAnalysis,We.MotionZonesRaw,We.DetectionResult,We.PipelineAudioInferenceResult,We.PlatformProbePhase,We.BenchmarkProgress,We.ModelDownloadProgress]),ple=new Set(dle);Object.freeze(ule.filter(e=>!ple.has(e)));Object.freeze([...new Set(lee.filter(e=>e.scope==="device").map(e=>e.name))].toSorted());function LN({value:e,unit:t,onDelta:n}){return v.jsxs("div",{className:"flex h-8 w-full overflow-hidden rounded-lg border border-border bg-surface",children:[v.jsx("button",{type:"button","aria-label":"Decrement",className:"w-9 shrink-0 bg-surface-hover text-base text-foreground",onClick:()=>n(-1),children:"−"}),v.jsxs("span",{className:"flex flex-1 items-center justify-center gap-0.5 border-x border-border/60 text-sm",children:[e,t?v.jsx("span",{"data-unit":!0,className:"text-[11px] text-foreground-subtle",children:t}):null]}),v.jsx("button",{type:"button","aria-label":"Increment",className:"w-9 shrink-0 bg-surface-hover text-base text-foreground",onClick:()=>n(1),children:"+"})]})}function mle({on:e,targetLabel:t,onConfirm:n}){const a=T.useRef(null),s=T.useRef(!1);return v.jsxs("div",{className:se("relative h-12 w-full rounded-full border flex items-center",e?"bg-emerald-50 border-emerald-200 pl-4":"bg-amber-50 border-amber-200 justify-end pr-4"),children:[v.jsx("span",{className:"text-xs font-semibold opacity-60",children:t}),v.jsx("span",{"data-testid":"slide-thumb",className:"absolute top-1 left-1 h-10 w-14 rounded-[19px] bg-surface shadow flex items-center justify-center",onPointerDown:p=>{p.currentTarget.setPointerCapture?.(p.pointerId),a.current=p.clientX,s.current=!1},onPointerMove:p=>{a.current!==null&&Math.abs(p.clientX-a.current)>40&&(s.current=!0)},onPointerUp:()=>{s.current&&n(),s.current=!1,a.current=null},onPointerCancel:()=>{s.current=!1,a.current=null}})]})}var fle=2,$C=270,hle=315;function gle(e){const t=(e-135+360)%360;return t>$C?t<=hle?1:0:t/$C}function Lp({fraction:e,color:t,knobTopPx:n,onDragFraction:a}){const s=-135+e*270,p=T.useRef(null),[f,m]=T.useState(!1),h=a!==void 0,c=n??fle,x=E=>{a!==void 0&&(E.preventDefault(),E.stopPropagation(),E.currentTarget.setPointerCapture?.(E.pointerId),m(!0))},M=E=>{if(a===void 0||!f)return;const R=p.current;if(R===null)return;const _=R.getBoundingClientRect(),j=_.left+_.width/2,D=_.top+_.height/2;a(gle(Math.atan2(E.clientY-D,E.clientX-j)*180/Math.PI))},C=E=>{a!==void 0&&(E.currentTarget.releasePointerCapture?.(E.pointerId),m(!1))};return v.jsx("div",{ref:p,className:"absolute inset-0",style:{transform:`rotate(${s}deg)`},children:v.jsx("div",{className:se("absolute left-1/2 h-5 w-5 -translate-x-1/2 rounded-full bg-white shadow",h&&(f?"cursor-grabbing":"cursor-grab")),style:{top:c,border:`3px solid ${t}`},...h?{onPointerDown:x,onPointerMove:M,onPointerUp:C,onPointerCancel:C}:{}})})}function nb({fraction:e,color:t}){return v.jsxs("div",{className:"relative h-2 w-full rounded-full bg-border",children:[v.jsx("div",{className:"absolute left-0 top-0 h-2 rounded-full",style:{width:`${e*100}%`,background:t??"var(--color-primary)"}}),v.jsx("div",{className:"absolute -top-1 h-4 w-4 rounded-full bg-white shadow",style:{left:`calc(${e*100}% - 8px)`}})]})}var Zi=150,qp=64,vle=Zi/2,ab=2*Math.PI*qp,rv=ab*(270/360);function qN({fraction:e,color:t,children:n,onDragFraction:a}){const s=Math.min(1,Math.max(0,e)),p=Zi/2,f=Zi/2,m=ab-rv,h=s*rv;return v.jsxs("div",{className:"relative",style:{width:Zi,height:Zi},children:[v.jsxs("svg",{width:Zi,height:Zi,viewBox:`0 0 ${Zi} ${Zi}`,"aria-hidden":"true",className:"absolute inset-0",style:{transform:"rotate(135deg)"},children:[v.jsx("circle",{cx:p,cy:f,r:qp,fill:"none",stroke:"var(--color-border)",strokeWidth:11,strokeDasharray:`${rv} ${m}`,strokeLinecap:"round"}),v.jsx("circle",{cx:p,cy:f,r:qp,fill:"none",stroke:t,strokeWidth:11,strokeDasharray:`${h} ${ab-h}`,strokeLinecap:"round"})]}),v.jsx("div",{"data-testid":"arc-knob",children:v.jsx(Lp,{fraction:s,color:t,knobTopPx:vle-qp-10,...a!==void 0?{onDragFraction:a}:{}})}),v.jsx("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-0.5 pointer-events-none",children:n})]})}function z0({on:e,busy:t,onToggle:n}){const a={transform:e?"translateX(30px)":"translateX(3px)"};return v.jsx("button",{type:"button","aria-pressed":e,title:e?"Turn off":"Turn on",disabled:t,onClick:s=>{s.stopPropagation(),n()},className:se("relative inline-flex h-8 w-16 items-center rounded-full border transition-colors flex-shrink-0",e?"bg-success/30 border-success/50":"bg-surface-hover border-border",t&&"opacity-60 cursor-not-allowed"),children:v.jsx("span",{className:se("absolute h-6 w-6 rounded-full transition-all",e?"bg-success":"bg-foreground-subtle"),style:a})})}function yle({trpc:e,deviceId:t}){const n=Eu(e,t),a=n!==null?n.button:void 0;if(a===void 0)return null;const s=()=>{a.press({deviceId:t})};return v.jsxs("button",{type:"button","aria-label":"Press",title:"Press",onClick:p=>{p.stopPropagation(),s()},className:se("inline-flex h-5 items-center gap-1 rounded px-1.5 text-xs","bg-primary text-primary-foreground hover:bg-primary/90 transition-colors"),children:[v.jsx(B_,{className:"h-3 w-3"}),v.jsx("span",{children:"Press"})]})}function ble({trpc:e,deviceId:t}){const n=Eu(e,t),a=n!==null?n.button:void 0;if(a===void 0)return null;const s=()=>{a.press({deviceId:t})};return v.jsxs("div",{className:"flex flex-col items-center justify-center gap-4 rounded-lg border border-border bg-surface p-6",children:[v.jsx("button",{type:"button","aria-label":"Press button",onClick:s,className:se("inline-flex h-14 w-14 items-center justify-center rounded-full","bg-primary text-primary-foreground hover:bg-primary/90 transition-colors","shadow-md"),children:v.jsx(B_,{className:"h-6 w-6"})}),v.jsx("span",{className:"text-sm font-medium text-foreground",children:"Press"})]})}var Sle=4e3;function QC(e){if(e!==void 0)return e!==null&&typeof e=="object"&&"lastChangedAt"in e&&typeof e.lastChangedAt=="number"?e.lastChangedAt:e}function zt(e,t){const n=t?.enabled!==!1,a=t?.timeoutMs??Sle,[s,p]=T.useState(void 0),f=T.useRef(void 0),m=T.useRef(void 0),h=T.useRef(!1),c=T.useRef(void 0),x=T.useCallback(()=>{c.current!==void 0&&(clearTimeout(c.current),c.current=void 0),f.current=void 0,h.current=!1,m.current=void 0,p(void 0)},[]);T.useEffect(()=>{if(!n||!h.current)return;const C=QC(e),E=m.current;C!==void 0&&C!==E&&x()}),T.useEffect(()=>()=>{c.current!==void 0&&clearTimeout(c.current)},[]);const M=T.useCallback(C=>{if(!n)return;c.current!==void 0&&(clearTimeout(c.current),c.current=void 0);const E=f.current??e;if(E!==void 0){const R={...E,...C};f.current=R,p(R)}m.current=QC(e),h.current=!0,c.current=setTimeout(x,a)},[n,e,x,a]);return n?{display:s!==void 0?s:e,applyOptimistic:M}:{display:e,applyOptimistic:()=>{}}}function xle(e){return e instanceof Error?e.message:String(e)}function kle({trpc:e,deviceId:t,layout:n,optimistic:a,features:s}){const{cap:p,slice:f,available:m}=gt({trpc:e,deviceId:t,cap:Q=>Q.lockControl,slice:Q=>Q.state.lockControl}),{display:h,applyOptimistic:c}=zt(f,{enabled:a??!0}),[x,M]=T.useState(null),[C,E]=T.useState(!1),[R,_]=T.useState(null);if(h===void 0)return null;const j=h.state==="locked"||h.state==="locking",D=!m||h.state==="jammed",z=s?.includes(va.LockOpen)===!0,B=n==="compact",L=()=>{c({state:"locking"}),p?.lock({})},G=()=>{c({state:"unlocking"}),p?.unlock({})},ae=()=>{p?.open({})},V=()=>{if(!D){if(!j){L();return}if(B){_(null),M("unlock");return}G()}},F=()=>{if(!D){if(B){_(null),M("open");return}ae()}},fe=()=>{C||M(null)},ke=async()=>{if(!(C||x===null)){_(null),E(!0);try{x==="unlock"?(c({state:"unlocking"}),await p?.unlock({})):await p?.open({}),M(null)}catch(Q){_(xle(Q))}finally{E(!1)}}},Me=j?"Unlock":"Lock",Ae=x==="open"?"Open door?":"Unlock device?",Ee=x==="open"?"This will release the latch and open the door.":"This will unlock the device.",we=x==="open"?"Confirm open":"Confirm unlock",ge=x==="open"?v.jsx(dl,{className:"h-4 w-4 text-amber-400"}):v.jsx(Dy,{className:"h-4 w-4 text-amber-400"});return v.jsxs("div",{className:se("inline-flex items-center",n==="full"?"gap-2":"gap-1"),children:[v.jsxs("button",{type:"button","aria-label":Me,title:h.state==="jammed"?"Jammed":Me,disabled:D,onClick:Q=>{Q.stopPropagation(),V()},className:se("inline-flex items-center justify-center rounded transition-colors",n==="full"?"h-7 gap-1.5 px-2 text-xs":"h-5 w-5",j?"text-success":"text-warning",D&&"opacity-40 cursor-not-allowed","hover:bg-surface-hover"),children:[j?v.jsx(ku,{className:"h-3.5 w-3.5"}):v.jsx(Dy,{className:"h-3.5 w-3.5"}),n==="full"&&v.jsx("span",{children:h.state})]}),z&&v.jsxs("button",{type:"button","aria-label":"Open door",title:"Open door",disabled:D,onClick:Q=>{Q.stopPropagation(),F()},className:se("inline-flex items-center justify-center rounded transition-colors",n==="full"?"h-7 gap-1.5 px-2 text-xs":"h-5 w-5","text-foreground-muted",D&&"opacity-40 cursor-not-allowed","hover:bg-surface-hover"),children:[v.jsx(dl,{className:"h-3.5 w-3.5"}),n==="full"&&v.jsx("span",{children:"Open"})]}),B&&v.jsx(yN,{open:x!==null,onOpenChange:Q=>{Q||fe()},children:v.jsxs(D0,{width:"sm",onClick:Q=>Q.stopPropagation(),children:[v.jsxs(Joe,{children:[v.jsxs(tse,{className:"flex items-center gap-2",children:[ge,Ae]}),v.jsx(nse,{children:Ee})]}),R!==null&&v.jsx("div",{className:"mt-2 px-3 py-2 rounded border border-danger/40 bg-danger/10 text-xs text-danger",children:R}),v.jsxs(ese,{children:[v.jsx(Ky,{type:"button",variant:"ghost",size:"sm",disabled:C,onClick:()=>fe(),children:"Cancel"}),v.jsxs(Ky,{type:"button",variant:"danger",size:"sm","aria-label":we,disabled:C,onClick:()=>{ke()},children:[C&&v.jsx(x0,{className:"h-3.5 w-3.5 animate-spin"}),we]})]})]})})]})}function L0({trpc:e,deviceId:t,optimistic:n}){const{cap:a,slice:s,available:p}=gt({trpc:e,deviceId:t,cap:R=>R.switch,slice:R=>R.state.switch}),{display:f,applyOptimistic:m}=zt(s,{enabled:n??!0}),[h,c]=T.useState(!1);if(f===void 0)return null;const x=f.on===!0,M=h||!p,C={transform:x?"translateX(14px)":"translateX(2px)"},E=async()=>{if(M||!a)return;const R=!x;m({on:R}),c(!0);try{await a.setState({on:R})}finally{c(!1)}};return v.jsx("button",{type:"button","aria-pressed":x,title:x?"Turn off":"Turn on",disabled:M,onClick:R=>{R.stopPropagation(),E()},className:se("relative inline-flex h-4 w-7 items-center rounded-full border transition-colors flex-shrink-0",x?"bg-success/30 border-success/50":"bg-surface-hover border-border",M&&"opacity-60"),children:v.jsx("span",{className:se("absolute h-3 w-3 rounded-full transition-all",x?"bg-success":"bg-foreground-subtle"),style:C})})}function wle({trpc:e,deviceId:t,layout:n,optimistic:a}){const{cap:s,slice:p,available:f}=gt({trpc:e,deviceId:t,cap:x=>x.brightness,slice:x=>x.state.brightness}),{display:m,applyOptimistic:h}=zt(p,{enabled:a??!0});if(m===void 0)return null;const c=!f;return v.jsxs("label",{className:se("flex items-center gap-2 text-xs text-foreground-subtle",n==="compact"&&"min-w-[140px]"),children:[v.jsx("input",{"aria-label":"Brightness",type:"range",min:0,max:100,step:1,value:m.percentage,disabled:c,onChange:x=>{const M=Number(x.target.value);h({percentage:M}),c||s?.setBrightness({percentage:M})}}),v.jsxs("span",{className:"tabular-nums w-8 text-right",children:[m.percentage,"%"]})]})}function Mle({trpc:e,deviceId:t,features:n,layout:a,optimistic:s}){const{cap:p,slice:f,available:m}=gt({trpc:e,deviceId:t,cap:_=>_.fanControl,slice:_=>_.state.fanControl}),{display:h,applyOptimistic:c}=zt(f,{enabled:s??!0});if(h===void 0)return null;const x=!m,M=n??[],C=M.includes("fan-speed"),E=M.includes("fan-preset"),R=f?.percentageStep!=null&&f.percentageStep>0?f.percentageStep:1;return v.jsxs("div",{className:se("inline-flex items-center gap-2",a==="full"&&"flex-col items-stretch"),children:[C&&v.jsxs("div",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("input",{"aria-label":"Fan speed",type:"range",min:0,max:100,step:R,value:h.percentage??0,disabled:x,onChange:_=>{const j=Number(_.target.value),D=Math.min(100,Math.max(0,Math.round(j/R)*R));c({percentage:D}),x||p?.setPercentage({percentage:D})}}),v.jsxs("span",{className:"tabular-nums w-8 text-right",children:[h.percentage??"—","%"]})]}),E&&h.availablePresets.length>0&&v.jsx("div",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:v.jsxs("select",{"aria-label":"Fan preset",value:h.preset,disabled:x,onChange:_=>{const j=_.target.value;!x&&j&&(c({preset:j}),p?.setPreset({preset:j}))},className:"bg-surface border border-border rounded px-1 py-0.5",children:[v.jsx("option",{value:"",disabled:!0,children:"—"}),h.availablePresets.map(_=>v.jsx("option",{value:_,children:_},_))]})})]})}var q0={heat:"border-amber-400 bg-amber-50 dark:bg-amber-950",cool:"border-blue-400 bg-blue-50 dark:bg-blue-950",auto:"border-purple-400 bg-purple-50 dark:bg-purple-950",heat_cool:"border-fuchsia-400 bg-fuchsia-50 dark:bg-fuchsia-950",fan_only:"border-slate-400 bg-slate-50 dark:bg-slate-950",dry:"border-cyan-400 bg-cyan-50 dark:bg-cyan-950",off:"border-zinc-300 bg-zinc-50 dark:bg-zinc-900"},BN={heat:"text-amber-600 dark:text-amber-400",cool:"text-blue-600 dark:text-blue-400",auto:"text-purple-600 dark:text-purple-400",heat_cool:"text-fuchsia-600 dark:text-fuchsia-400",fan_only:"text-slate-600 dark:text-slate-400",dry:"text-cyan-600 dark:text-cyan-400",off:"text-foreground"},Cle={heat:"bg-amber-400 text-amber-950",cool:"bg-blue-400 text-blue-950",auto:"bg-purple-400 text-purple-950",heat_cool:"bg-fuchsia-400 text-fuchsia-950",fan_only:"bg-slate-400 text-slate-950",dry:"bg-cyan-400 text-cyan-950",off:"bg-zinc-300 text-zinc-700"};function Ale({trpc:e,deviceId:t,features:n,layout:a,optimistic:s}){const{cap:p,slice:f,available:m}=gt({trpc:e,deviceId:t,cap:E=>E.climateControl,slice:E=>E.state.climateControl}),{display:h,applyOptimistic:c}=zt(f,{enabled:s??!0});if(p===void 0||h===void 0)return null;const x=!m;if(a==="compact")return v.jsxs("div",{"data-mode":h.mode,className:"inline-flex items-center gap-1",children:[v.jsx("span",{className:se("text-xs tabular-nums font-medium",BN[h.mode]),children:h.target!==null?v.jsxs(v.Fragment,{children:[h.target,"°",h.currentTemp!==null&&v.jsxs("span",{className:"text-foreground-subtle font-normal",children:[" ","(",h.currentTemp,"°)"]})]}):h.currentTemp!==null?v.jsxs("span",{className:"text-foreground-subtle",children:[h.currentTemp,"°"]}):null}),h.target!==null&&v.jsxs(v.Fragment,{children:[v.jsx("button",{type:"button","aria-label":"Decrease target",disabled:x,onClick:E=>{if(E.stopPropagation(),!x&&h.target!==null){const R=h.target-1;c({target:R}),p.setTarget({target:R})}},className:se("inline-flex h-5 w-5 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors text-xs",x&&"opacity-40 cursor-not-allowed"),children:"−"}),v.jsx("button",{type:"button","aria-label":"Increase target",disabled:x,onClick:E=>{if(E.stopPropagation(),!x&&h.target!==null){const R=h.target+1;c({target:R}),p.setTarget({target:R})}},className:se("inline-flex h-5 w-5 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors text-xs",x&&"opacity-40 cursor-not-allowed"),children:"+"})]}),v.jsx("select",{"aria-label":"Mode",value:h.mode,disabled:x,onChange:E=>{E.stopPropagation();const R=E.target.value;x||(c({mode:R}),p.setMode({mode:R}))},className:se("bg-transparent px-0.5 text-xs text-foreground-subtle hover:text-foreground cursor-pointer",x&&"opacity-40 cursor-not-allowed"),children:h.availableModes.map(E=>v.jsx("option",{value:E,children:E},E))})]});const M=h.mode==="heat_cool"||h.targetLow!==null&&h.targetHigh!==null,C=!M&&h.target!==null;return v.jsxs("div",{"data-mode":h.mode,className:se("inline-flex items-center gap-2 rounded border px-2 py-1 transition-colors",q0[h.mode],"flex-col items-stretch gap-3"),children:[v.jsxs("div",{className:"inline-flex items-center gap-1 text-xs tabular-nums",children:[h.currentTemp!==null&&v.jsxs("span",{className:"text-foreground-subtle",children:[h.currentTemp,"°"]}),C&&v.jsxs(v.Fragment,{children:[v.jsx("span",{className:"text-foreground-subtle",children:"→"}),v.jsxs("span",{className:"font-medium",children:[h.target,"°"]}),v.jsx("button",{type:"button","aria-label":"Decrease target",disabled:x,onClick:E=>{if(E.stopPropagation(),!x&&h.target!==null){const R=h.target-1;c({target:R}),p.setTarget({target:R})}},className:se("inline-flex h-4 w-4 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",x&&"opacity-40 cursor-not-allowed"),children:"−"}),v.jsx("button",{type:"button","aria-label":"Increase target",disabled:x,onClick:E=>{if(E.stopPropagation(),!x&&h.target!==null){const R=h.target+1;c({target:R}),p.setTarget({target:R})}},className:se("inline-flex h-4 w-4 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",x&&"opacity-40 cursor-not-allowed"),children:"+"})]})]}),v.jsx("div",{className:"inline-flex items-center gap-0.5 rounded bg-surface-subtle p-0.5",children:h.availableModes.map(E=>v.jsx("button",{type:"button","aria-label":E,disabled:x,onClick:R=>{R.stopPropagation(),x||(c({mode:E}),p.setMode({mode:E}))},className:se("rounded px-1.5 py-0.5 text-xs transition-colors",E===h.mode?Cle[E]:"text-foreground-subtle hover:text-foreground hover:bg-surface-hover",x&&"opacity-40 cursor-not-allowed"),children:E},E))}),M&&v.jsxs("div",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsxs("label",{className:"flex items-center gap-1",children:[v.jsx("span",{children:"Low"}),v.jsx("input",{"aria-label":"Target low",type:"number",step:.5,value:h.targetLow??"",disabled:x,onChange:E=>{if(!x){const R=Number(E.target.value),_=h.targetHigh??R;c({targetLow:R}),p.setTargetRange({targetLow:R,targetHigh:_})}},className:"w-14 rounded border border-border bg-surface px-1 py-0.5 tabular-nums"})]}),v.jsxs("label",{className:"flex items-center gap-1",children:[v.jsx("span",{children:"High"}),v.jsx("input",{"aria-label":"Target high",type:"number",step:.5,value:h.targetHigh??"",disabled:x,onChange:E=>{if(!x){const R=Number(E.target.value),_=h.targetLow??R;c({targetHigh:R}),p.setTargetRange({targetLow:_,targetHigh:R})}},className:"w-14 rounded border border-border bg-surface px-1 py-0.5 tabular-nums"})]})]}),h.availableFanModes.length>0&&v.jsxs("label",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("span",{children:"Fan"}),v.jsxs("select",{"aria-label":"Fan mode",value:h.fanMode,disabled:x,onChange:E=>{const R=E.target.value;!x&&R&&(c({fanMode:R}),p.setFanMode({fanMode:R}))},className:"rounded border border-border bg-surface px-1 py-0.5",children:[v.jsx("option",{value:"",disabled:!0,children:"—"}),h.availableFanModes.map(E=>v.jsx("option",{value:E,children:E},E))]})]}),h.availablePresets.length>0&&v.jsxs("label",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("span",{children:"Preset"}),v.jsxs("select",{"aria-label":"Preset",value:h.preset,disabled:x,onChange:E=>{const R=E.target.value;!x&&R&&(c({preset:R}),p.setPreset({preset:R}))},className:"rounded border border-border bg-surface px-1 py-0.5",children:[v.jsx("option",{value:"",disabled:!0,children:"—"}),h.availablePresets.map(E=>v.jsx("option",{value:E,children:E},E))]})]}),h.targetHumidity!==null&&v.jsxs("label",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("span",{children:"Humidity"}),v.jsx("input",{"aria-label":"Target humidity",type:"range",min:0,max:100,step:1,value:h.targetHumidity,disabled:x,onChange:E=>{const R=Number(E.target.value);c({targetHumidity:R}),x||p.setTargetHumidity({targetHumidity:R})}}),v.jsxs("span",{className:"tabular-nums w-8 text-right",children:[h.targetHumidity,"%"]})]})]})}var Ele={playing:"border-green-400 bg-green-50 dark:bg-green-950",paused:"border-amber-400 bg-amber-50 dark:bg-amber-950",buffering:"border-blue-400 bg-blue-50 dark:bg-blue-950",on:"border-slate-400 bg-slate-50 dark:bg-slate-950",idle:"border-slate-400 bg-slate-50 dark:bg-slate-950",off:"border-zinc-300 bg-zinc-50 dark:bg-zinc-900",standby:"border-zinc-300 bg-zinc-50 dark:bg-zinc-900"},Rle={playing:"bg-green-500",paused:"bg-amber-400",buffering:"bg-blue-400",on:"bg-slate-400",idle:"bg-slate-400",off:"bg-zinc-300",standby:"bg-zinc-300"},FN=["off","all","one"];function Ile(e){return FN.includes(e)}var Tle={off:"Off",all:"All",one:"One"};function _le(e){return e==="playing"||e==="buffering"?"pause":"play"}function Nle({trpc:e,deviceId:t,features:n,layout:a,optimistic:s}){const{cap:p,slice:f,available:m}=gt({trpc:e,deviceId:t,cap:C=>C.mediaPlayer,slice:C=>C.state.mediaPlayer}),{display:h,applyOptimistic:c}=zt(f,{enabled:s??!0});if(h===void 0)return null;const x=!m,M=_le(h.state);return v.jsxs("div",{"data-state":h.state,className:se("inline-flex items-center gap-2 rounded border px-2 py-1 transition-colors",Ele[h.state],a==="full"&&"flex-col items-stretch gap-3"),children:[v.jsxs("div",{className:"inline-flex items-center gap-2",children:[v.jsx("span",{role:"status","aria-label":h.state,className:se("inline-block h-2 w-2 rounded-full flex-shrink-0",Rle[h.state])}),v.jsx("button",{type:"button","aria-label":M==="play"?"Play":"Pause",disabled:x,onClick:C=>{C.stopPropagation(),!x&&(M==="play"?(c({state:"playing"}),p?.play({})):(c({state:"paused"}),p?.pause({})))},className:se("inline-flex h-5 w-5 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors text-xs",x&&"opacity-40 cursor-not-allowed"),children:M==="play"?"▶":"⏸"})]}),a==="full"&&v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"inline-flex items-center gap-1",children:[v.jsx("button",{type:"button","aria-label":"Previous",disabled:x,onClick:C=>{C.stopPropagation(),x||p?.previous({})},className:se("inline-flex h-5 w-5 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors text-xs",x&&"opacity-40 cursor-not-allowed"),children:"⏮"}),v.jsx("button",{type:"button","aria-label":"Next",disabled:x,onClick:C=>{C.stopPropagation(),x||p?.next({})},className:se("inline-flex h-5 w-5 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors text-xs",x&&"opacity-40 cursor-not-allowed"),children:"⏭"})]}),h.volumeLevel!==null&&v.jsxs("label",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("span",{children:"Vol"}),v.jsx("input",{"aria-label":"Volume",type:"range",min:0,max:100,step:1,value:h.volumeLevel,disabled:x,onChange:C=>{const E=Number(C.target.value);c({volumeLevel:E}),x||p?.setVolume({volumeLevel:E})}}),v.jsxs("span",{className:"tabular-nums w-8 text-right",children:[h.volumeLevel,"%"]})]}),h.isMuted!==null&&v.jsx("button",{type:"button","aria-label":h.isMuted?"Unmute":"Mute",disabled:x,onClick:C=>{if(C.stopPropagation(),!x&&h.isMuted!==null){const E=!h.isMuted;c({isMuted:E}),p?.setMute({muted:E})}},className:se("inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-xs transition-colors",h.isMuted?"bg-amber-400 text-amber-950":"text-foreground-subtle hover:text-foreground hover:bg-surface-hover",x&&"opacity-40 cursor-not-allowed"),children:h.isMuted?"🔇":"🔊"}),h.availableSources.length>0&&v.jsxs("label",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("span",{children:"Source"}),v.jsxs("select",{"aria-label":"Source",value:h.source,disabled:x,onChange:C=>{const E=C.target.value;!x&&E&&(c({source:E}),p?.selectSource({source:E}))},className:"rounded border border-border bg-surface px-1 py-0.5",children:[v.jsx("option",{value:"",disabled:!0,children:"—"}),h.availableSources.map(C=>v.jsx("option",{value:C,children:C},C))]})]}),h.shuffle!==null&&v.jsx("button",{type:"button","aria-label":"Shuffle",disabled:x,onClick:C=>{if(C.stopPropagation(),!x&&h.shuffle!==null){const E=!h.shuffle;c({shuffle:E}),p?.setShuffle({shuffle:E})}},className:se("inline-flex items-center gap-1 rounded px-1.5 py-0.5 text-xs transition-colors",h.shuffle?"bg-green-400 text-green-950":"text-foreground-subtle hover:text-foreground hover:bg-surface-hover",x&&"opacity-40 cursor-not-allowed"),children:"⇌ Shuffle"}),h.repeat!==null&&v.jsxs("label",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("span",{children:"Repeat"}),v.jsx("select",{"aria-label":"Repeat",value:h.repeat,disabled:x,onChange:C=>{const E=C.target.value;!x&&Ile(E)&&(c({repeat:E}),p?.setRepeat({repeat:E}))},className:"rounded border border-border bg-surface px-1 py-0.5",children:FN.map(C=>v.jsx("option",{value:C,children:Tle[C]},C))})]})]})]})}function Hc(e,t){return t!==void 0?e.toFixed(t):Number.isInteger(e)?String(e):e.toFixed(1)}var Ole=/^(\d{4})-(\d{2})-(\d{2})/,jle=/^(\d{2}):(\d{2})(?::(\d{2}))?$/;function Ple(e,t){const n=Ole.exec(e);if(n===null)return e;const a=Number(n[1]),s=Number(n[2]),p=Number(n[3]),f=new Date(a,s-1,p);if(Number.isNaN(f.getTime()))return e;try{return f.toLocaleDateString(t)}catch{return e}}function Dle(e,t){const n=jle.exec(e);if(n===null)return e;const a=new Date(1970,0,1,Number(n[1]),Number(n[2]),n[3]!==void 0?Number(n[3]):0);if(Number.isNaN(a.getTime()))return e;try{return a.toLocaleTimeString(t,{hour:"2-digit",minute:"2-digit"})}catch{return e}}function zle(e,t){const n=e.includes("T")?e:e.replace(" ","T"),a=new Date(n);if(Number.isNaN(a.getTime()))return e;try{return a.toLocaleString(t,{dateStyle:"medium",timeStyle:"short"})}catch{return e}}function B0(e,t,n){return e===""?e:t==="date"?Ple(e,n):t==="time"?Dle(e,n):zle(e,n)}function Lle(e){return e.slice(0,10)}function qle(e){return e.slice(0,5)}function Ble(e){return(e.includes("T")?e:e.replace(" ","T")).slice(0,16)}function Fle({value:e,busy:t,onCommit:n,unit:a,min:s,max:p,step:f,precision:m}){const[h,c]=T.useState(Hc(e,m)),x=Number(h),M=h!==""&&!Number.isNaN(x),C=f??1,E=_=>{let j=_;return s!==void 0&&(j=Math.max(s,j)),p!==void 0&&(j=Math.min(p,j)),j},R=()=>{!t&&M&&n(E(x))};return v.jsxs("div",{className:"inline-flex items-center gap-1",children:[v.jsx("button",{type:"button","aria-label":"Decrement",disabled:t,onClick:_=>{if(_.stopPropagation(),!t){const j=E(e-C);c(Hc(j,m)),n(j)}},className:se("inline-flex h-5 w-5 items-center justify-center rounded border border-border bg-surface text-xs transition-colors hover:bg-surface-hover",t&&"opacity-40 cursor-not-allowed"),children:"−"}),v.jsx("input",{"aria-label":"Numeric value",type:"number",disabled:t,value:h,onChange:_=>{c(_.target.value);const j=Number(_.target.value);_.target.value!==""&&!Number.isNaN(j)&&(t||n(E(j)))},onBlur:R,onKeyDown:_=>{_.key==="Enter"&&R()},className:se("w-16 rounded border border-border bg-surface px-1 py-0.5 text-xs tabular-nums text-center",t&&"opacity-40 cursor-not-allowed")}),a!==void 0&&v.jsx("span",{className:"text-foreground-subtle text-xs",children:a}),v.jsx("button",{type:"button","aria-label":"Increment",disabled:t,onClick:_=>{if(_.stopPropagation(),!t){const j=E(e+C);c(Hc(j,m)),n(j)}},className:se("inline-flex h-5 w-5 items-center justify-center rounded border border-border bg-surface text-xs transition-colors hover:bg-surface-hover",t&&"opacity-40 cursor-not-allowed"),children:"+"})]})}function Ule({value:e,busy:t,onCommit:n}){const[a,s]=T.useState(e);return v.jsx("input",{type:"text",disabled:t,value:a,onChange:p=>s(p.target.value),onBlur:()=>{t||n(a)},onKeyDown:p=>{p.key==="Enter"&&!t&&n(a)},className:se("rounded border border-border bg-surface px-2 py-0.5 text-xs",t&&"opacity-40 cursor-not-allowed")})}function Hle({slice:e,busy:t,setValueFn:n,layout:a}){switch(e.kind){case"numeric":return v.jsx(Fle,{value:typeof e.value=="number"?e.value:Number(e.value),busy:t,onCommit:s=>{n({control:{kind:"numeric",value:s}})},unit:e.unit,min:e.min,max:e.max,step:e.step,precision:e.precision});case"select":return v.jsx("select",{"aria-label":"Control value",disabled:t,value:String(e.value),onChange:s=>{s.stopPropagation(),t||n({control:{kind:"select",value:s.target.value}})},className:se("w-full max-w-full min-w-0 truncate rounded border border-border bg-surface px-1 py-0.5 text-xs",t&&"opacity-40 cursor-not-allowed"),children:e.options.map(s=>v.jsx("option",{value:s,children:s},s))});case"text":return v.jsx(Ule,{value:String(e.value),busy:t,onCommit:s=>{n({control:{kind:"text",value:s}})}});case"datetime":{const s=String(e.value),p=e.format??"datetime";return a==="compact"?s===""?v.jsx("span",{"aria-label":"Control value",className:"text-xs text-foreground-subtle",children:"—"}):v.jsx("span",{"aria-label":"Control value",className:"text-xs text-foreground",children:B0(s,p)}):v.jsx("input",{type:p==="date"?"date":p==="time"?"time":"datetime-local","aria-label":"Control value",disabled:t,value:p==="date"?Lle(s):p==="time"?qle(s):Ble(s),onChange:f=>{f.stopPropagation(),t||n({control:{kind:"datetime",value:f.target.value}})},className:se("rounded border border-border bg-surface px-1 py-0.5 text-xs",t&&"opacity-40 cursor-not-allowed")})}default:return null}}function UN({trpc:e,deviceId:t,features:n,layout:a,optimistic:s}){const{cap:p,slice:f,available:m}=gt({trpc:e,deviceId:t,cap:C=>C.control,slice:C=>C.state.control}),{display:h,applyOptimistic:c}=zt(f,{enabled:s??!0});if(h===void 0)return null;const x=!m,M=C=>{!x&&p&&(c({value:C.control.value}),p.setValue(C))};return v.jsx("div",{"data-kind":h.kind,className:"inline-flex min-w-0 max-w-full items-center gap-1 rounded border border-border px-2 py-1 transition-colors",children:v.jsx(Hle,{slice:h,busy:x,setValueFn:M,layout:a})})}var $le=e=>e;function HN(e){const t=e.capName!==void 0?e.display?.perCap?.[e.capName]:void 0,n=t?.precision??e.display?.precision??e.roleDefault?.precision??e.slicePrecision,a=e.sliceUnit??e.canonicalUnit,s=t?.unit??e.display?.unit??e.roleDefault?.unit;return s!==void 0&&a!==void 0&&s!==a&&xee(a,s)?{unit:s,precision:n,toDisplayValue:p=>See(p,a,s)??p}:{unit:a??"",precision:n,toDisplayValue:$le}}var $N={kind:"binary",field:"on",onLabel:"Low",offLabel:"Normal"};function QN(e){return e==="battery-sensor"}function VN(e,t){if(!ZN(e))return!1;const n=e[t];if(typeof n!="number")return!1;const a=e.lastFetchedAt;return!(n===0&&a===0)}var GN={"temperature-sensor":{kind:"numeric",field:"celsius",canonicalUnit:"°C",getSliceHandle:e=>e.temperatureSensor},"humidity-sensor":{kind:"numeric",field:"percent",canonicalUnit:"%",getSliceHandle:e=>e.humiditySensor},"ambient-light-sensor":{kind:"numeric",field:"lux",canonicalUnit:"lx",getSliceHandle:e=>e.ambientLightSensor},"pressure-sensor":{kind:"numeric",field:"hpa",canonicalUnit:"hPa",getSliceHandle:e=>e.pressureSensor},"numeric-sensor":{kind:"numeric",field:"value",getSliceHandle:e=>e.numericSensor},"wind-sensor":{kind:"numeric",field:"value",getSliceHandle:e=>e.numericSensor},"rain-sensor":{kind:"numeric",field:"value",getSliceHandle:e=>e.numericSensor},"uv-sensor":{kind:"numeric",field:"value",getSliceHandle:e=>e.numericSensor},"solar-radiation-sensor":{kind:"numeric",field:"value",getSliceHandle:e=>e.numericSensor},"soil-moisture-sensor":{kind:"numeric",field:"value",getSliceHandle:e=>e.numericSensor},"power-sensor":{kind:"numeric",field:"watts",canonicalUnit:"W",getSliceHandle:e=>e.powerMeter},"energy-sensor":{kind:"numeric",field:"kwhTotal",canonicalUnit:"kWh",getSliceHandle:e=>e.powerMeter},"voltage-sensor":{kind:"numeric",field:"volts",canonicalUnit:"V",getSliceHandle:e=>e.powerMeter},"current-sensor":{kind:"numeric",field:"amps",canonicalUnit:"A",getSliceHandle:e=>e.powerMeter},"battery-sensor":{kind:"numeric",field:"value",canonicalUnit:"%",getSliceHandle:e=>e.numericSensor},"generic-sensor":{kind:"numeric",field:"value",getSliceHandle:e=>e.numericSensor},"motion-sensor":{kind:"binary",field:"detected",onLabel:"Detected",offLabel:"Clear",getSliceHandle:e=>e.motion},"pir-sensor":{kind:"binary",field:"detected",onLabel:"Detected",offLabel:"Clear",getSliceHandle:e=>e.motion},"contact-sensor":{kind:"binary",field:"entryOpen",onLabel:"Open",offLabel:"Closed",getSliceHandle:e=>e.contact},"smoke-sensor":{kind:"binary",field:"detected",onLabel:"Smoke!",offLabel:"Clear",getSliceHandle:e=>e.smoke},"leak-sensor":{kind:"binary",field:"flooded",onLabel:"Leak!",offLabel:"Dry",getSliceHandle:e=>e.flood},"co-sensor":{kind:"binary",field:"detected",onLabel:"CO!",offLabel:"Clear",getSliceHandle:e=>e.carbonMonoxide},"binary-sensor":{kind:"binary",field:"on",onLabel:"On",offLabel:"Off",getSliceHandle:e=>e.binary},presence:{kind:"presence",getSliceHandle:e=>e.presence},"enum-sensor":{kind:"string",getSliceHandle:e=>e.enumSensor},"datetime-sensor":{kind:"datetime",format:"datetime",getSliceHandle:e=>e.enumSensor}};function ZN(e){return typeof e=="object"&&e!==null}function Qle(e){return typeof e=="object"&&e!==null}function Vle(e){return typeof e=="object"&&e!==null&&"state"in e&&typeof e.state=="string"}function $c(e){return typeof e=="object"&&e!==null&&"value"in e&&typeof e.value=="string"}function KN(e){if(typeof e!="object"||e===null)return;const t=e.format;if(t==="date"||t==="time"||t==="datetime")return t}function Gle(e){return e==="home"?"Home":e==="not_home"?"Away":e.charAt(0).toUpperCase()+e.slice(1)}function Zle({trpc:e,device:t}){const n=t.role!=null?GN[t.role]:void 0,a=QN(t.role),{data:s}=X_({},{staleTime:6e4}),p=Eu(e,t.id),f=jo(p!==null&&n!==void 0?n.getSliceHandle(p.state):void 0),m=jo(p!==null&&n?.kind==="numeric"?p.state.enumSensor:void 0),h=jo(p!==null&&a?p.state.binary:void 0),c=a&&n?.kind==="numeric"&&!VN(f,n.field)&&h!==void 0,x=c?$N:n,M=c?h:f;if(x===void 0||M===void 0)return null;if(x.kind==="numeric"){if(!ZN(M))return null;const E=M[x.field];if(typeof E!="number")return null;const R=M.lastFetchedAt,_=E===0&&R===0;if(_&&$c(m)&&m.value!=="")return v.jsx("span",{className:se("inline-flex items-baseline text-xs text-foreground"),children:m.value});if(_)return null;const j=M,D=typeof j.unit=="string"?j.unit:void 0,z=typeof j.precision=="number"?j.precision:void 0,B=HN({display:t.display,capName:t.role==="numeric-sensor"?"numeric-sensor":void 0,roleDefault:t.role!=null?s?.defaults[t.role]:void 0,sliceUnit:D,slicePrecision:z,canonicalUnit:x.canonicalUnit}),L=B.unit,G=Hc(B.toDisplayValue(E),B.precision);return v.jsxs("span",{className:se("inline-flex items-baseline gap-0.5 tabular-nums text-xs text-foreground"),children:[v.jsx("span",{children:G}),L&&v.jsx("span",{className:"text-foreground-subtle",children:L})]})}if(x.kind==="binary"){if(!Qle(M))return null;const R=!!M[x.field],_=R?x.onLabel:x.offLabel;return v.jsx("span",{className:se("inline-flex items-center rounded px-1.5 py-0.5 text-xs font-medium",R?"bg-warning/15 text-warning":"bg-surface-subtle text-foreground-subtle"),children:_})}if(x.kind==="string")return!$c(M)||M.value===""?null:v.jsx("span",{className:se("inline-flex items-baseline text-xs text-foreground"),children:M.value});if(x.kind==="datetime"){if(!$c(M)||M.value==="")return null;const E=KN(M)??x.format,R=B0(M.value,E);return v.jsx("span",{className:se("inline-flex items-baseline text-xs text-foreground"),children:R})}if(!Vle(M))return null;const C=Gle(M.state);return v.jsx("span",{className:se("inline-flex items-center rounded px-1.5 py-0.5 text-xs font-medium",M.state==="home"?"bg-success/15 text-success":"bg-surface-subtle text-foreground-subtle"),children:C})}function Hm(e){switch(e){case"opening":return{up:"accent",stop:"neutral",down:"neutral"};case"closing":return{up:"neutral",stop:"neutral",down:"accent"};case"open":return{up:"filled",stop:"neutral",down:"neutral"};case"closed":return{up:"neutral",stop:"neutral",down:"filled"};default:return{up:"neutral",stop:"neutral",down:"neutral"}}}function Kle(e){switch(e){case"accent":return"bg-primary text-primary-foreground";case"filled":return"bg-primary/15 text-primary";case"neutral":return""}}function ov({label:e,busy:t,variant:n,onClick:a,children:s}){return v.jsx("button",{type:"button","aria-label":e,title:e,disabled:t,onClick:p=>{p.stopPropagation(),a()},className:se("inline-flex h-5 w-5 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",Kle(n),t&&"opacity-40 cursor-not-allowed"),children:s})}function Wle({trpc:e,deviceId:t,optimistic:n}){const{cap:a,slice:s,available:p}=gt({trpc:e,deviceId:t,cap:M=>M.cover,slice:M=>M.state.cover}),{display:f,applyOptimistic:m}=zt(s,{enabled:n??!0});if(a===void 0)return null;const h=Hm(f?.state),c=!p,x=(M,C)=>{c||!M||(C!==void 0&&m(C),M({}))};return v.jsxs("div",{className:"inline-flex items-center gap-1",children:[v.jsx(ov,{label:"Open",busy:c,variant:h.up,onClick:()=>x(a?.open,{state:"opening"}),children:v.jsx(Dm,{className:"h-3.5 w-3.5"})}),v.jsx(ov,{label:"Stop",busy:c,variant:h.stop,onClick:()=>x(a?.stop,{state:"stopped"}),children:v.jsx(Cu,{className:"h-3 w-3"})}),v.jsx(ov,{label:"Close",busy:c,variant:h.down,onClick:()=>x(a?.close,{state:"closing"}),children:v.jsx(Uo,{className:"h-3.5 w-3.5"})}),f!==void 0&&f.position!==null&&v.jsxs("span",{className:"tabular-nums text-xs text-foreground-subtle ml-1",children:[f.position,"%"]})]})}function sv({label:e,busy:t,variant:n,onClick:a,children:s}){return v.jsx("button",{type:"button","aria-label":e,title:e,disabled:t,onClick:p=>{p.stopPropagation(),a()},className:se("inline-flex h-10 w-10 items-center justify-center rounded-md text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",n==="accent"&&"bg-primary text-primary-foreground hover:bg-primary/90",n==="filled"&&"bg-primary/15 text-primary",t&&"opacity-40 cursor-not-allowed"),children:s})}function WN(){return v.jsxs(v.Fragment,{children:[v.jsx("div",{"aria-hidden":"true",className:"absolute inset-y-0 left-1/2 w-px -translate-x-px bg-white/60"}),v.jsx("div",{"aria-hidden":"true",className:"absolute inset-x-0 top-1/2 h-px -translate-y-px bg-white/60"})]})}function Yle({position:e,interactive:t,onSetPosition:n}){const a=(1-e/100)*100,s=T.useRef(null),p=T.useRef(!1),f=T.useRef(null),m=C=>{const E=s.current;if(E===null)return e;const R=E.getBoundingClientRect();if(R.height<=0)return e;const _=(C-R.top)/R.height,j=Math.round(100-_*100);return Math.min(100,Math.max(0,j))},h=C=>{if(n===void 0)return;const E=m(C);f.current!==E&&(f.current=E,n(E))},c=C=>{t&&(C.stopPropagation(),C.preventDefault(),p.current=!0,f.current=null,C.currentTarget.setPointerCapture(C.pointerId),h(C.clientY))},x=C=>{!t||!p.current||(C.stopPropagation(),h(C.clientY))},M=C=>{!t||!p.current||(C.stopPropagation(),p.current=!1,f.current=null,C.currentTarget.hasPointerCapture(C.pointerId)&&C.currentTarget.releasePointerCapture(C.pointerId))};return v.jsxs("div",{ref:s,"data-testid":"cover-window",...t?{"aria-label":"Drag to set position",role:"slider","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":e}:{"aria-hidden":"true"},onPointerDown:t?c:void 0,onPointerMove:t?x:void 0,onPointerUp:t?M:void 0,onPointerCancel:t?M:void 0,className:se("relative w-28 h-36 rounded border-2 border-amber-700/60 bg-gradient-to-b from-sky-200 to-sky-50 overflow-hidden flex-shrink-0",t&&"cursor-ns-resize touch-none select-none"),style:{boxShadow:"inset 0 0 0 2px rgba(255,255,255,.5)"},children:[v.jsx(WN,{}),v.jsx("div",{className:"absolute inset-x-0 top-0 transition-all duration-200",style:{height:`${a}%`,background:"repeating-linear-gradient(#c9cdd2, #c9cdd2 6px, #b7bcc2 6px, #b7bcc2 8px)",borderBottom:a>0?"1px solid #9aa":"none"}}),v.jsxs("div",{"data-testid":"cover-lever",className:se("absolute inset-x-0 h-4 flex items-center justify-center gap-1 z-10 transition-all duration-200",t&&"cursor-grab active:cursor-grabbing"),style:{top:`calc(${a}% - 8px)`},children:[v.jsx("div",{className:"absolute -inset-x-1.5 h-full rounded-lg bg-slate-600 shadow-md"}),v.jsx("span",{className:"h-1 w-1 rounded-full bg-white/70 relative z-10","aria-hidden":"true"}),v.jsx("span",{className:"h-1 w-1 rounded-full bg-white/70 relative z-10","aria-hidden":"true"}),v.jsx("span",{className:"h-1 w-1 rounded-full bg-white/70 relative z-10","aria-hidden":"true"}),v.jsxs("span",{"data-testid":"cover-position-pct",className:"absolute left-full ml-2 text-xs font-semibold text-foreground tabular-nums whitespace-nowrap",children:[e,"%"]})]})]})}function Xle({isOpen:e}){return v.jsxs("div",{"data-testid":"cover-window","aria-hidden":"true",className:"relative w-28 h-36 rounded border-2 border-amber-700/60 bg-gradient-to-b from-sky-200 to-sky-50 overflow-hidden flex-shrink-0",style:{boxShadow:"inset 0 0 0 2px rgba(255,255,255,.5)"},children:[v.jsx(WN,{}),!e&&v.jsx("div",{className:"absolute inset-0",style:{background:"repeating-linear-gradient(#c9cdd2, #c9cdd2 6px, #b7bcc2 6px, #b7bcc2 8px)"}})]})}function Jle({trpc:e,deviceId:t,features:n,optimistic:a}){const{cap:s,slice:p,available:f}=gt({trpc:e,deviceId:t,cap:z=>z.cover,slice:z=>z.state.cover}),{display:m,applyOptimistic:h}=zt(p,{enabled:a??!0});if(s===void 0)return null;const c=!f,x=(n??[]).includes(va.CoverPositionable),M=(n??[]).includes(va.CoverTilt),C=Hm(m?.state),E=m?.position??null,R=E!==null,_=m?.state==="open"||m?.state==="opening",j=(z,B)=>{c||!z||(B!==void 0&&h(B),z({}))},D=z=>{c||(h({position:z}),s?.setPosition({position:z}))};return v.jsxs("div",{className:"flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-4",children:[v.jsxs("div",{className:"flex items-center gap-6",children:[R?v.jsx(Yle,{position:E,interactive:x,onSetPosition:x?D:void 0}):v.jsx(Xle,{isOpen:_}),v.jsxs("div",{className:"flex flex-col gap-3 flex-1",children:[R&&v.jsxs("div",{className:"flex items-baseline gap-1",children:[v.jsx("span",{className:"text-3xl font-semibold tabular-nums text-foreground",children:E}),v.jsx("span",{className:"text-base text-foreground-subtle",children:"%"}),v.jsx("span",{className:"text-xs text-foreground-subtle ml-1",children:"open"})]}),!R&&v.jsx("div",{className:"flex items-baseline gap-1",children:v.jsx("span",{className:"text-3xl font-semibold capitalize text-foreground",children:m?.state??"—"})}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(sv,{label:"Open",busy:c,variant:C.up,onClick:()=>j(s?.open,{state:"opening"}),children:v.jsx(Dm,{className:"h-5 w-5"})}),v.jsx(sv,{label:"Stop",busy:c,variant:C.stop,onClick:()=>j(s?.stop,{state:"stopped"}),children:v.jsx(Cu,{className:"h-4 w-4"})}),v.jsx(sv,{label:"Close",busy:c,variant:C.down,onClick:()=>j(s?.close,{state:"closing"}),children:v.jsx(Uo,{className:"h-5 w-5"})})]})]})]}),x&&v.jsxs("label",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("span",{className:"w-12 shrink-0",children:"Position"}),v.jsx("input",{"aria-label":"Position",type:"range",min:0,max:100,step:1,value:E??0,disabled:c,className:"flex-1",onChange:z=>{D(Number(z.target.value))}}),v.jsxs("span",{className:"w-8 text-right tabular-nums",children:[E??"—","%"]})]}),!x&&E!==null&&v.jsxs("label",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("span",{className:"w-12 shrink-0",children:"Position"}),v.jsx("input",{"aria-label":"Position",type:"range",min:0,max:100,step:1,value:E,disabled:!0,readOnly:!0,className:"flex-1 opacity-60"}),v.jsxs("span",{className:"w-8 text-right tabular-nums",children:[E,"%"]})]}),M&&v.jsxs("label",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("span",{className:"w-12 shrink-0",children:"Tilt"}),v.jsx("input",{"aria-label":"Tilt position",type:"range",min:0,max:100,step:1,value:m?.tiltPosition??0,disabled:c,className:"flex-1",onChange:z=>{const B=Number(z.target.value);h({tiltPosition:B}),c||s?.setTiltPosition({tiltPosition:B})}}),v.jsxs("span",{className:"w-8 text-right tabular-nums",children:[m?.tiltPosition??"—","%"]})]})]})}function ece(e){return v.jsx("span",{className:"text-foreground-subtle text-xs select-none","aria-hidden":"true",children:"—"})}function tce(e){return v.jsx("div",{className:"rounded border border-border bg-surface-subtle px-3 py-2 text-xs text-foreground-subtle",children:"Controls coming soon"})}function nce(e){return{id:e.id,stableId:e.stableId,addonId:e.addonId,type:e.type,name:e.name,online:e.online,disabled:e.disabled,parentDeviceId:e.parentDeviceId,role:e.role??void 0,features:e.features}}function ace({trpc:e,deviceId:t}){const{data:n}=J_({deviceId:t},{staleTime:6e4});return n===void 0?null:v.jsx(Zle,{trpc:e,device:nce(n)})}function ice(e){return typeof e=="object"&&e!==null}function rce(e){return typeof e=="object"&&e!==null}function oce(e){return typeof e=="object"&&e!==null&&"state"in e&&typeof e.state=="string"}function sce(e){return e==="home"?"Home":e==="not_home"?"Away":e.charAt(0).toUpperCase()+e.slice(1)}var lce={low:"bg-danger",medium:"bg-warning",high:"bg-success"};function cce(e){return e<=20?"low":e<=50?"medium":"high"}function uce({percent:e}){const t=Math.min(100,Math.max(0,e)),n=cce(t);return v.jsx("div",{"data-testid":"battery-bar","data-band":n,className:"h-2 w-24 overflow-hidden rounded-full bg-border",children:v.jsx("div",{className:se("h-full rounded-full transition-all",lce[n]),style:{width:`${t}%`}})})}function dce({trpc:e,device:t}){const n=t.role!=null?GN[t.role]:void 0,a=QN(t.role),{data:s}=X_({},{staleTime:6e4}),p=Eu(e,t.id),f=jo(p!==null&&n!==void 0?n.getSliceHandle(p.state):void 0),m=jo(p!==null&&a?p.state.binary:void 0),h=a&&n?.kind==="numeric"&&!VN(f,n.field)&&m!==void 0,c=h?$N:n,x=h?m:f;if(c===void 0||x===void 0)return v.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 rounded-lg border border-border bg-surface p-4 min-h-[96px]",children:[v.jsx("span",{className:"text-sm text-foreground-subtle",children:t.name}),v.jsx("span",{className:"text-xs text-foreground-subtle italic",children:"Awaiting state…"})]});if(c.kind==="numeric"){if(!ice(x))return null;const C=x[c.field];if(typeof C!="number")return null;const E=x,R=typeof E.unit=="string"?E.unit:void 0,_=typeof E.precision=="number"?E.precision:void 0,j=HN({display:t.display,capName:t.role==="numeric-sensor"?"numeric-sensor":void 0,roleDefault:t.role!=null?s?.defaults[t.role]:void 0,sliceUnit:R,slicePrecision:_,canonicalUnit:c.canonicalUnit}),D=j.unit;return v.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 rounded-lg border border-border bg-surface p-4",children:[v.jsxs("div",{className:"flex items-baseline gap-1",children:[v.jsx("span",{className:"text-3xl font-semibold tabular-nums text-foreground",children:Hc(j.toDisplayValue(C),j.precision)}),D&&v.jsx("span",{className:"text-base text-foreground-subtle",children:D})]}),a&&v.jsx(uce,{percent:C}),v.jsx("span",{className:"text-sm text-foreground-subtle",children:t.name})]})}if(c.kind==="binary"){if(!rce(x))return null;const E=!!x[c.field],R=E?c.onLabel:c.offLabel;return v.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 rounded-lg border border-border bg-surface p-4",children:[v.jsx("span",{className:se("inline-flex items-center rounded px-3 py-1.5 text-lg font-semibold",E?"bg-warning/15 text-warning":"bg-surface-subtle text-foreground-subtle"),children:R}),v.jsx("span",{className:"text-sm text-foreground-subtle",children:t.name})]})}if(c.kind==="datetime"){if(!$c(x))return null;if(x.value==="")return v.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 rounded-lg border border-border bg-surface p-4 min-h-[96px]",children:[v.jsx("span",{className:"text-sm text-foreground-subtle",children:t.name}),v.jsx("span",{className:"text-xs text-foreground-subtle italic",children:"Awaiting state…"})]});const C=KN(x)??c.format;return v.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 rounded-lg border border-border bg-surface p-4",children:[v.jsx("span",{className:"text-3xl font-semibold tabular-nums text-foreground",children:B0(x.value,C)}),v.jsx("span",{className:"text-sm text-foreground-subtle",children:t.name})]})}if(c.kind==="string")return!$c(x)||x.value===""?null:v.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 rounded-lg border border-border bg-surface p-4",children:[v.jsx("span",{className:"text-xl font-semibold text-foreground",children:x.value}),v.jsx("span",{className:"text-sm text-foreground-subtle",children:t.name})]});if(!oce(x))return null;const M=sce(x.state);return v.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 rounded-lg border border-border bg-surface p-4",children:[v.jsx("span",{className:se("inline-flex items-center rounded px-3 py-1.5 text-lg font-semibold",x.state==="home"?"bg-success/15 text-success":"bg-surface-subtle text-foreground-subtle"),children:M}),v.jsx("span",{className:"text-sm text-foreground-subtle",children:t.name})]})}function pce({trpc:e,deviceId:t}){const{data:n}=J_({deviceId:t},{staleTime:6e4});return n===void 0?null:v.jsx(dce,{trpc:e,device:n})}function YN(e){return e===void 0||e.inProgress?!1:e.availableVersion!==null&&e.currentVersion!==null&&e.availableVersion!==e.currentVersion}function XN(e,t){return gt({trpc:e,deviceId:t,cap:n=>n.update,slice:n=>n.state.update})}function mce({trpc:e,deviceId:t}){const{cap:n,slice:a}=XN(e,t);return n===void 0?null:a?.inProgress?v.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-foreground-subtle",children:[v.jsx(x0,{className:"h-3.5 w-3.5 animate-spin"}),"Updating…"]}):YN(a)?v.jsxs("span",{className:"inline-flex items-center gap-1 rounded bg-warning/15 px-1.5 py-0.5 text-[10px] font-medium text-warning",children:[v.jsx(P_,{className:"h-3 w-3"}),"Update"]}):v.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] text-foreground-subtle",children:[v.jsx(T_,{className:"h-3 w-3 text-success"}),a?.currentVersion??"Up to date"]})}function fce({trpc:e,deviceId:t}){const{cap:n,slice:a,available:s}=XN(e,t);if(n===void 0)return null;const p=a?.inProgress===!0,f=YN(a),m=a?.currentVersion??"—",h=()=>{!s||n===void 0||!f||n.installUpdate({})};return v.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 rounded-lg border border-border bg-surface p-4",children:[v.jsxs("div",{className:"flex items-baseline gap-1.5",children:[v.jsx("span",{className:"text-3xl font-semibold tabular-nums text-foreground",children:m}),f&&a?.availableVersion!=null&&v.jsxs(v.Fragment,{children:[v.jsx("span",{className:"text-base text-foreground-subtle",children:"→"}),v.jsx("span",{className:"text-base font-medium text-warning tabular-nums",children:a.availableVersion})]})]}),p?v.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded px-3 py-1.5 text-sm font-medium text-foreground-subtle",children:[v.jsx(x0,{className:"h-4 w-4 animate-spin"}),"Installing…"]}):f?v.jsxs("button",{type:"button",onClick:c=>{c.stopPropagation(),h()},disabled:!s,className:"inline-flex items-center gap-1.5 rounded-lg bg-primary px-4 py-1.5 text-sm font-medium text-primary-foreground shadow-sm transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[v.jsx(P_,{className:"h-4 w-4"}),"Install update"]}):v.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded bg-success/15 px-3 py-1 text-sm font-medium text-success",children:[v.jsx(T_,{className:"h-4 w-4"}),"Up to date"]}),a?.state!=null&&a.state!==""&&v.jsx("span",{className:"text-[10px] text-foreground-subtle",children:a.state})]})}function hce(e){switch(e){case"cleaning":return{label:"Cleaning",tone:"text-primary"};case"paused":return{label:"Paused",tone:"text-warning"};case"returning":return{label:"Returning",tone:"text-primary"};case"docked":return{label:"Docked",tone:"text-success"};case"drying":return{label:"Drying",tone:"text-warning"};case"idle":return{label:"Idle",tone:"text-foreground-subtle"};case"error":return{label:"Error",tone:"text-destructive"};case void 0:return{label:"Unknown",tone:"text-foreground-subtle"}}}function JN(e,t){return gt({trpc:e,deviceId:t,cap:n=>n.vacuumControl,slice:n=>n.state.vacuumControl})}function lv({label:e,busy:t,active:n,onClick:a,children:s}){return v.jsx("button",{type:"button","aria-label":e,title:e,disabled:t,onClick:p=>{p.stopPropagation(),a()},className:se("inline-flex h-5 w-5 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",n&&"bg-primary text-primary-foreground",t&&"opacity-40 cursor-not-allowed"),children:s})}function gce(e){switch(e){case"cleaning":return{glow:"bg-primary/15",accent:"text-primary",docked:!1,active:!0};case"returning":return{glow:"bg-primary/10",accent:"text-primary",docked:!1,active:!0};case"docked":return{glow:"bg-success/10",accent:"text-success",docked:!0,active:!1};case"drying":return{glow:"bg-warning/10",accent:"text-warning",docked:!0,active:!1};case"paused":return{glow:"bg-warning/10",accent:"text-warning",docked:!1,active:!1};case"error":return{glow:"bg-destructive/10",accent:"text-destructive",docked:!1,active:!1};case"idle":return{glow:"bg-transparent",accent:"text-foreground-subtle",docked:!1,active:!1};case void 0:return{glow:"bg-transparent",accent:"text-foreground-subtle",docked:!1,active:!1}}}var vce=`
83
- @keyframes rg-breathe { 0%,100%{opacity:.78;transform:scale(1)} 50%{opacity:1;transform:scale(1.05)} }
84
- @keyframes rg-zzz { 0%{opacity:0;transform:translateY(3px)} 30%{opacity:.85} 100%{opacity:0;transform:translateY(-9px)} }
85
- @keyframes rg-spark { 0%,100%{opacity:.25;transform:scale(.9)} 50%{opacity:1;transform:scale(1.1)} }
86
- @keyframes rg-pulse { 0%,100%{opacity:.35} 50%{opacity:.85} }
87
- @keyframes rg-blink { 0%,49%{opacity:1} 50%,100%{opacity:.3} }
88
- @keyframes rg-spin { to { transform:rotate(360deg) } }
89
- @media (prefers-reduced-motion: reduce) { .rg-a { animation: none !important; } }
90
- `;function yce({state:e,batteryLevel:t}){const n=gce(e),a=n.docked&&t!=null&&t<100,s=n.docked&&!a,p=e==="error",f=s?{animation:"rg-breathe 3.4s ease-in-out infinite",transformBox:"fill-box",transformOrigin:"center"}:p?{animation:"rg-blink 1s steps(1) infinite"}:void 0;return v.jsxs("div",{"aria-hidden":"true",className:"relative w-28 h-36 rounded border-2 border-border bg-gradient-to-b from-surface-hover to-surface overflow-hidden flex-shrink-0",style:{boxShadow:"inset 0 0 0 2px rgba(255,255,255,.06)"},children:[v.jsx("style",{children:vce}),v.jsx("div",{className:se("absolute inset-0 transition-colors duration-300",n.glow)}),v.jsx("div",{className:se("absolute inset-0 flex items-center justify-center",n.accent),children:v.jsxs("svg",{viewBox:"0 0 100 100",className:"w-20 h-20",fill:"none",children:[n.docked&&v.jsx("rect",{x:"34",y:"80",width:"32",height:"8",rx:"2",fill:"currentColor",opacity:"0.35",className:se(a&&"rg-a"),style:a?{animation:"rg-pulse 1.2s ease-in-out infinite"}:void 0}),n.active&&v.jsx("circle",{cx:"50",cy:"50",r:"44",stroke:"currentColor",strokeWidth:"2",opacity:"0.4",className:"animate-ping",style:{transformOrigin:"center"}}),v.jsxs("g",{className:se((s||p)&&"rg-a"),style:f,children:[v.jsx("circle",{cx:"50",cy:"50",r:"34",fill:"currentColor",fillOpacity:"0.12",stroke:"currentColor",strokeWidth:"2.5"}),v.jsx("path",{d:"M 24 42 A 34 34 0 0 1 76 42",stroke:"currentColor",strokeWidth:"3",opacity:"0.55",strokeLinecap:"round"}),v.jsxs("g",{className:se(n.active&&"rg-a"),style:n.active?{animation:"rg-spin 3s linear infinite",transformBox:"fill-box",transformOrigin:"center"}:void 0,children:[v.jsx("circle",{cx:"50",cy:"50",r:"9",fill:"currentColor",fillOpacity:"0.25",stroke:"currentColor",strokeWidth:"2"}),v.jsx("circle",{cx:"50",cy:"43",r:"2.4",fill:"currentColor"})]})]}),s&&v.jsxs("g",{fill:"currentColor",fontFamily:"sans-serif",fontWeight:"700",children:[v.jsx("text",{x:"64",y:"30",fontSize:"13",opacity:"0.7",className:"rg-a",style:{animation:"rg-zzz 3.4s ease-in-out infinite"},children:"z"}),v.jsx("text",{x:"73",y:"23",fontSize:"10",opacity:"0.6",className:"rg-a",style:{animation:"rg-zzz 3.4s ease-in-out .7s infinite"},children:"z"}),v.jsx("text",{x:"80",y:"17",fontSize:"8",opacity:"0.5",className:"rg-a",style:{animation:"rg-zzz 3.4s ease-in-out 1.4s infinite"},children:"z"})]}),a&&v.jsx("path",{d:"M53 20 L44 40 L50 40 L46 56 L60 34 L53 34 Z",fill:"#fbbf24",stroke:"#f59e0b",strokeWidth:"1",className:"rg-a",style:{animation:"rg-spark 1s ease-in-out infinite",transformBox:"fill-box",transformOrigin:"center"}})]})})]})}function e5({level:e}){return v.jsxs("span",{className:"inline-flex items-center gap-0.5 tabular-nums text-xs text-foreground-subtle",children:[v.jsx(rm,{className:"h-3.5 w-3.5"}),e,"%"]})}function bce(e){switch(e){case"cleanWater":return!0;case"detergent":return!0;case"dirtyWater":return!1;case"dustBin":return!1;default:return e}}function Sce(e,t){const n=bce(e);return t.level!==null?n?t.level<=15?"warning":"ok":t.level>=85?"warning":"ok":t.status!==null?n?t.status==="low"?"warning":"ok":t.status==="full"?"warning":"ok":"ok"}function xce(e){switch(e){case"cleanWater":return{label:"Clean water",icon:v.jsx(S0,{className:"h-3.5 w-3.5"})};case"dirtyWater":return{label:"Dirty water",icon:v.jsx(bl,{className:"h-3.5 w-3.5"})};case"detergent":return{label:"Detergent",icon:v.jsx(Xne,{className:"h-3.5 w-3.5"})};case"dustBin":return{label:"Dust bin",icon:v.jsx(Oae,{className:"h-3.5 w-3.5"})};default:return e}}function kce({kind:e,tank:t}){if(t===null)return null;const n=xce(e),a=Sce(e,t)==="warning";return t.level!==null?v.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[v.jsxs("span",{className:se("inline-flex items-center gap-1 w-24 shrink-0",a?"text-warning":"text-foreground-subtle"),children:[n.icon,n.label]}),v.jsx("span",{className:"relative h-1.5 flex-1 overflow-hidden rounded-full bg-surface-hover",children:v.jsx("span",{className:se("absolute inset-y-0 left-0 rounded-full transition-all",a?"bg-warning":"bg-primary"),style:{width:`${t.level}%`}})}),v.jsxs("span",{className:se("tabular-nums w-9 text-right",a?"text-warning":"text-foreground-subtle"),children:[t.level,"%"]})]}):t.status!==null?v.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[v.jsxs("span",{className:se("inline-flex items-center gap-1 w-24 shrink-0",a?"text-warning":"text-foreground-subtle"),children:[n.icon,n.label]}),v.jsx("span",{className:se("inline-flex items-center rounded-full px-2 py-0.5 text-[11px] font-medium",a?"bg-warning/15 text-warning":"bg-primary/15 text-foreground-subtle"),children:t.status})]}):v.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[v.jsxs("span",{className:"inline-flex items-center gap-1 w-24 shrink-0 text-foreground-subtle",children:[n.icon,n.label]}),v.jsx("span",{className:"inline-flex items-center rounded-full px-2 py-0.5 text-[11px] font-medium bg-surface-hover text-foreground-subtle",children:"—"})]})}function wce({cleanWater:e,dirtyWater:t,detergent:n,dustBin:a}){const s=[["cleanWater",e],["dirtyWater",t],["detergent",n],["dustBin",a]];return s.some(([,p])=>p!==null)?v.jsx("div",{className:"grid grid-cols-1 gap-x-6 gap-y-2 rounded-md border border-border bg-surface-hover/40 p-3 sm:grid-cols-2",children:s.map(([p,f])=>v.jsx(kce,{kind:p,tank:f},p))}):null}function Mce({trpc:e,deviceId:t}){const{cap:n,slice:a,available:s}=JN(e,t);if(n===void 0)return null;const p=!s,f=a?.state,m=f==="cleaning",h=c=>{p||c===void 0||c({})};return v.jsxs("div",{className:"inline-flex items-center gap-1",children:[v.jsx(lv,{label:"Start",busy:p,active:m,onClick:()=>h(n.start),children:v.jsx(Ho,{className:"h-3 w-3"})}),v.jsx(lv,{label:"Pause",busy:p,active:f==="paused",onClick:()=>h(n.pause),children:v.jsx(wu,{className:"h-3 w-3"})}),v.jsx(lv,{label:"Return to base",busy:p,active:f==="returning"||f==="docked",onClick:()=>h(n.returnToBase),children:v.jsx(zm,{className:"h-3.5 w-3.5"})}),a?.batteryLevel!=null&&v.jsx("span",{className:"ml-1",children:v.jsx(e5,{level:a.batteryLevel})})]})}function Ec({label:e,busy:t,active:n,onClick:a,children:s}){return v.jsx("button",{type:"button","aria-label":e,title:e,disabled:t,onClick:p=>{p.stopPropagation(),a()},className:se("inline-flex h-10 w-10 items-center justify-center rounded-md text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",n&&"bg-primary text-primary-foreground hover:bg-primary/90",t&&"opacity-40 cursor-not-allowed"),children:s})}function Cce({trpc:e,deviceId:t}){const{cap:n,slice:a,available:s}=JN(e,t);if(n===void 0)return null;const p=!s,f=a?.state,m=hce(f),h=a?.availableFanSpeeds??[],c=M=>{p||M===void 0||M({})},x=M=>{p||M===""||n.setFanSpeed({speed:M})};return v.jsxs("div",{className:"flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-4",children:[v.jsxs("div",{className:"flex items-center gap-6",children:[v.jsx(yce,{state:f,batteryLevel:a?.batteryLevel??null}),v.jsxs("div",{className:"flex flex-col gap-3 flex-1",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsx("span",{className:se("text-3xl font-semibold",m.tone),children:m.label}),a?.batteryLevel!=null&&v.jsx(e5,{level:a.batteryLevel})]}),a?.progressPercent!=null&&v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("div",{className:"h-1.5 flex-1 rounded bg-surface-hover overflow-hidden",children:v.jsx("div",{className:"h-full bg-primary transition-[width] duration-500",style:{width:`${Math.max(0,Math.min(100,a.progressPercent))}%`}})}),v.jsxs("span",{className:"tabular-nums text-xs text-foreground-subtle",children:[Math.round(a.progressPercent),"%"]})]}),a?.errorCode!=null&&a.errorCode!==0&&v.jsxs("div",{className:"inline-flex items-center gap-1 text-xs text-destructive",children:[v.jsx(pl,{className:"h-3.5 w-3.5"}),v.jsx("span",{children:a.errorLabel??`Error ${a.errorCode}`})]}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(Ec,{label:"Start",busy:p,active:f==="cleaning",onClick:()=>c(n.start),children:v.jsx(Ho,{className:"h-5 w-5"})}),v.jsx(Ec,{label:"Pause",busy:p,active:f==="paused",onClick:()=>c(n.pause),children:v.jsx(wu,{className:"h-5 w-5"})}),v.jsx(Ec,{label:"Stop",busy:p,active:!1,onClick:()=>c(n.stop),children:v.jsx(Cu,{className:"h-4 w-4"})}),v.jsx(Ec,{label:"Return to base",busy:p,active:f==="returning"||f==="docked",onClick:()=>c(n.returnToBase),children:v.jsx(zm,{className:"h-5 w-5"})}),v.jsx(Ec,{label:"Locate",busy:p,active:!1,onClick:()=>c(n.locate),children:v.jsx(L_,{className:"h-5 w-5"})})]})]})]}),h.length>0&&v.jsxs("label",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("span",{className:"w-16 shrink-0",children:"Fan speed"}),v.jsxs("select",{"aria-label":"Fan speed",value:a?.fanSpeed??"",disabled:p,onChange:M=>{x(M.target.value)},onClick:M=>{M.stopPropagation()},className:"flex-1 rounded border border-border bg-surface px-2 py-1 text-foreground disabled:opacity-50",children:[a?.fanSpeed==null&&v.jsx("option",{value:"",children:"—"}),h.map(M=>v.jsx("option",{value:M,children:M},M))]})]}),v.jsx(wce,{cleanWater:a?.cleanWater??null,dirtyWater:a?.dirtyWater??null,detergent:a?.detergent??null,dustBin:a?.dustBin??null})]})}function Ace(e){switch(e){case"mowing":return{label:"Mowing",tone:"text-primary"};case"paused":return{label:"Paused",tone:"text-warning"};case"docked":return{label:"Docked",tone:"text-success"};case"idle":return{label:"Idle",tone:"text-foreground-subtle"};case"error":return{label:"Error",tone:"text-destructive"};case void 0:return{label:"Unknown",tone:"text-foreground-subtle"}}}function t5(e,t){return gt({trpc:e,deviceId:t,cap:n=>n.lawnMowerControl,slice:n=>n.state.lawnMowerControl})}function Ece(e){switch(e){case"mowing":return{glow:"bg-primary/15",accent:"text-primary",docked:!1,active:!0};case"docked":return{glow:"bg-success/10",accent:"text-success",docked:!0,active:!1};case"paused":return{glow:"bg-warning/10",accent:"text-warning",docked:!1,active:!1};case"error":return{glow:"bg-destructive/10",accent:"text-destructive",docked:!1,active:!1};case"idle":return{glow:"bg-transparent",accent:"text-foreground-subtle",docked:!1,active:!1};case void 0:return{glow:"bg-transparent",accent:"text-foreground-subtle",docked:!1,active:!1}}}var Rce=`
91
- @keyframes rg-breathe { 0%,100%{opacity:.78;transform:scale(1)} 50%{opacity:1;transform:scale(1.05)} }
92
- @keyframes rg-zzz { 0%{opacity:0;transform:translateY(3px)} 30%{opacity:.85} 100%{opacity:0;transform:translateY(-9px)} }
93
- @keyframes rg-spark { 0%,100%{opacity:.25;transform:scale(.9)} 50%{opacity:1;transform:scale(1.1)} }
94
- @keyframes rg-pulse { 0%,100%{opacity:.35} 50%{opacity:.85} }
95
- @keyframes rg-blink { 0%,49%{opacity:1} 50%,100%{opacity:.3} }
96
- @keyframes rg-spin { to { transform:rotate(360deg) } }
97
- @media (prefers-reduced-motion: reduce) { .rg-a { animation: none !important; } }
98
- `;function Ice({activity:e,batteryLevel:t}){const n=Ece(e),a=n.docked&&t!=null&&t<100,s=n.docked&&!a,p=e==="error",f=s?{animation:"rg-breathe 3.4s ease-in-out infinite",transformBox:"fill-box",transformOrigin:"center"}:p?{animation:"rg-blink 1s steps(1) infinite"}:void 0;return v.jsxs("div",{"aria-hidden":"true",className:"relative w-28 h-36 rounded border-2 border-border bg-gradient-to-b from-emerald-700/40 to-emerald-900/30 overflow-hidden flex-shrink-0",style:{boxShadow:"inset 0 0 0 2px rgba(255,255,255,.06)"},children:[v.jsx("style",{children:Rce}),v.jsx("div",{className:se("absolute inset-0 transition-colors duration-300",n.glow)}),v.jsx("div",{className:se("absolute inset-0 flex items-center justify-center",n.accent),children:v.jsxs("svg",{viewBox:"0 0 100 100",className:"w-20 h-20",fill:"none",children:[n.docked&&v.jsx("rect",{x:"30",y:"78",width:"40",height:"9",rx:"2",fill:"currentColor",opacity:"0.35",className:se(a&&"rg-a"),style:a?{animation:"rg-pulse 1.2s ease-in-out infinite"}:void 0}),n.active&&v.jsxs("g",{stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",opacity:"0.5",children:[v.jsx("line",{x1:"18",y1:"36",x2:"10",y2:"36",className:"animate-pulse"}),v.jsx("line",{x1:"18",y1:"50",x2:"6",y2:"50",className:"animate-pulse"}),v.jsx("line",{x1:"18",y1:"64",x2:"10",y2:"64",className:"animate-pulse"})]}),v.jsxs("g",{className:se((s||p)&&"rg-a"),style:f,children:[v.jsx("rect",{x:"28",y:"34",width:"44",height:"34",rx:"8",fill:"currentColor",fillOpacity:"0.14",stroke:"currentColor",strokeWidth:"2.5"}),v.jsx("line",{x1:"34",y1:"60",x2:"66",y2:"60",stroke:"currentColor",strokeWidth:"2",opacity:"0.5"}),v.jsxs("g",{className:se(n.active&&"rg-a"),style:n.active?{animation:"rg-spin 0.9s linear infinite",transformBox:"fill-box",transformOrigin:"center"}:void 0,children:[v.jsx("circle",{cx:"50",cy:"48",r:"5",stroke:"currentColor",strokeWidth:"2",opacity:"0.6"}),v.jsx("line",{x1:"45",y1:"48",x2:"55",y2:"48",stroke:"currentColor",strokeWidth:"2",opacity:"0.7"})]}),v.jsx("circle",{cx:"34",cy:"68",r:"6",fill:"currentColor",fillOpacity:"0.3",stroke:"currentColor",strokeWidth:"2"}),v.jsx("circle",{cx:"66",cy:"68",r:"6",fill:"currentColor",fillOpacity:"0.3",stroke:"currentColor",strokeWidth:"2"})]}),s&&v.jsxs("g",{fill:"currentColor",fontFamily:"sans-serif",fontWeight:"700",children:[v.jsx("text",{x:"64",y:"30",fontSize:"13",opacity:"0.7",className:"rg-a",style:{animation:"rg-zzz 3.4s ease-in-out infinite"},children:"z"}),v.jsx("text",{x:"73",y:"23",fontSize:"10",opacity:"0.6",className:"rg-a",style:{animation:"rg-zzz 3.4s ease-in-out .7s infinite"},children:"z"}),v.jsx("text",{x:"80",y:"17",fontSize:"8",opacity:"0.5",className:"rg-a",style:{animation:"rg-zzz 3.4s ease-in-out 1.4s infinite"},children:"z"})]}),a&&v.jsx("path",{d:"M53 20 L44 40 L50 40 L46 56 L60 34 L53 34 Z",fill:"#fbbf24",stroke:"#f59e0b",strokeWidth:"1",className:"rg-a",style:{animation:"rg-spark 1s ease-in-out infinite",transformBox:"fill-box",transformOrigin:"center"}})]})})]})}function Tce(e){switch(e){case"error":return"text-destructive";case"warning":return"text-warning";case"info":return"text-foreground-subtle"}}function _ce({percent:e}){return v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("div",{className:"h-1.5 flex-1 rounded bg-surface-hover overflow-hidden",children:v.jsx("div",{className:"h-full bg-primary transition-[width] duration-500",style:{width:`${Math.max(0,Math.min(100,e))}%`}})}),v.jsxs("span",{className:"tabular-nums text-xs text-foreground-subtle",children:[Math.round(e),"%"]})]})}function Nce({code:e,label:t,severity:n}){return v.jsxs("div",{className:se("inline-flex items-center gap-1 text-xs",Tce(n)),children:[n!=="info"&&v.jsx(pl,{className:"h-3.5 w-3.5"}),v.jsx("span",{children:t??`Code ${e}`})]})}function n5({level:e}){return v.jsxs("span",{className:"inline-flex items-center gap-0.5 tabular-nums text-xs text-foreground-subtle",children:[v.jsx(rm,{className:"h-3.5 w-3.5"}),e,"%"]})}function cv({label:e,busy:t,active:n,onClick:a,children:s}){return v.jsx("button",{type:"button","aria-label":e,title:e,disabled:t,onClick:p=>{p.stopPropagation(),a()},className:se("inline-flex h-5 w-5 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",n&&"bg-primary text-primary-foreground",t&&"opacity-40 cursor-not-allowed"),children:s})}function Oce({trpc:e,deviceId:t}){const{cap:n,slice:a,available:s}=t5(e,t);if(n===void 0)return null;const p=!s,f=a?.activity,m=h=>{p||h===void 0||h({})};return v.jsxs("div",{className:"inline-flex items-center gap-1",children:[v.jsx(cv,{label:"Mow",busy:p,active:f==="mowing",onClick:()=>m(n.startMowing),children:v.jsx(Ho,{className:"h-3 w-3"})}),v.jsx(cv,{label:"Pause",busy:p,active:f==="paused",onClick:()=>m(n.pause),children:v.jsx(wu,{className:"h-3 w-3"})}),v.jsx(cv,{label:"Dock",busy:p,active:f==="docked",onClick:()=>m(n.dock),children:v.jsx(zm,{className:"h-3.5 w-3.5"})}),a?.batteryLevel!=null&&v.jsx("span",{className:"ml-1",children:v.jsx(n5,{level:a.batteryLevel})})]})}function uv({label:e,busy:t,active:n,onClick:a,children:s}){return v.jsx("button",{type:"button","aria-label":e,title:e,disabled:t,onClick:p=>{p.stopPropagation(),a()},className:se("inline-flex h-10 w-10 items-center justify-center rounded-md text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",n&&"bg-primary text-primary-foreground hover:bg-primary/90",t&&"opacity-40 cursor-not-allowed"),children:s})}function jce({trpc:e,deviceId:t}){const{cap:n,slice:a,available:s}=t5(e,t);if(n===void 0)return null;const p=!s,f=a?.activity,m=Ace(f),h=c=>{p||c===void 0||c({})};return v.jsx("div",{className:"flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-4",children:v.jsxs("div",{className:"flex items-center gap-6",children:[v.jsx(Ice,{activity:f,batteryLevel:a?.batteryLevel??null}),v.jsxs("div",{className:"flex flex-col gap-3 flex-1",children:[v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsx("span",{className:se("text-3xl font-semibold",m.tone),children:m.label}),a?.batteryLevel!=null&&v.jsx(n5,{level:a.batteryLevel})]}),a?.progressPercent!=null&&v.jsx(_ce,{percent:a.progressPercent}),a?.currentCode!=null&&v.jsx(Nce,{code:a.currentCode,label:a.currentCodeLabel,severity:a.severity}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(uv,{label:"Start mowing",busy:p,active:f==="mowing",onClick:()=>h(n.startMowing),children:v.jsx(Ho,{className:"h-5 w-5"})}),v.jsx(uv,{label:"Pause",busy:p,active:f==="paused",onClick:()=>h(n.pause),children:v.jsx(wu,{className:"h-5 w-5"})}),v.jsx(uv,{label:"Dock",busy:p,active:f==="docked",onClick:()=>h(n.dock),children:v.jsx(zm,{className:"h-5 w-5"})})]})]})]})})}function Pce(e){switch(e){case"open":return{label:"Open",tone:"text-primary"};case"opening":return{label:"Opening",tone:"text-primary"};case"closing":return{label:"Closing",tone:"text-warning"};case"closed":return{label:"Closed",tone:"text-foreground-subtle"};case"stopped":return{label:"Stopped",tone:"text-warning"};case void 0:return{label:"Unknown",tone:"text-foreground-subtle"}}}function a5(e,t){return gt({trpc:e,deviceId:t,cap:n=>n.valve,slice:n=>n.state.valve})}function i5(e){switch(e){case"accent":return"bg-primary text-primary-foreground";case"filled":return"bg-primary/15 text-primary";case"neutral":return""}}function dv({label:e,busy:t,variant:n,onClick:a,children:s}){return v.jsx("button",{type:"button","aria-label":e,title:e,disabled:t,onClick:p=>{p.stopPropagation(),a()},className:se("inline-flex h-5 w-5 items-center justify-center rounded text-xs text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",i5(n),t&&"opacity-40 cursor-not-allowed"),children:s})}function Dce({trpc:e,deviceId:t,optimistic:n}){const{cap:a,slice:s,available:p}=a5(e,t),{display:f,applyOptimistic:m}=zt(s,{enabled:n??!0});if(a===void 0)return null;const h=!p,c=Hm(f?.state),x=(M,C)=>{h||!M||(C!==void 0&&m(C),M({}))};return v.jsxs("div",{className:"inline-flex items-center gap-1",children:[v.jsx(dv,{label:"Open",busy:h,variant:c.up,onClick:()=>x(a.open,{state:"opening"}),children:v.jsx(Dm,{className:"h-3.5 w-3.5"})}),v.jsx(dv,{label:"Stop",busy:h,variant:c.stop,onClick:()=>x(a.stop,{state:"stopped"}),children:v.jsx(Cu,{className:"h-3 w-3"})}),v.jsx(dv,{label:"Close",busy:h,variant:c.down,onClick:()=>x(a.close,{state:"closing"}),children:v.jsx(Uo,{className:"h-3.5 w-3.5"})}),f!==void 0&&f.position!==null&&v.jsxs("span",{className:"tabular-nums text-xs text-foreground-subtle ml-1",children:[f.position,"%"]})]})}function zce(e){switch(e){case"open":return{glow:"bg-primary/15",accent:"text-primary",flowing:!0,active:!1};case"opening":return{glow:"bg-primary/10",accent:"text-primary",flowing:!0,active:!0};case"closing":return{glow:"bg-warning/10",accent:"text-warning",flowing:!1,active:!0};case"closed":return{glow:"bg-transparent",accent:"text-foreground-subtle",flowing:!1,active:!1};case"stopped":return{glow:"bg-warning/10",accent:"text-warning",flowing:!1,active:!1};case void 0:return{glow:"bg-transparent",accent:"text-foreground-subtle",flowing:!1,active:!1}}}function Lce(e){switch(e){case"open":return 0;case"opening":return 0;case"closed":return 1;case"closing":return 1;case"stopped":return 1;case void 0:return 1}}function qce({state:e,position:t,interactive:n,onSetPosition:a}){const s=zce(e),p=t!==null?1-t/100:Lce(e),f=41+p*8,m=-90*(1-p),h=T.useRef(null),c=T.useRef(!1),x=T.useRef(null),M=j=>{const D=t??0,z=h.current;if(z===null)return D;const B=z.getBoundingClientRect();if(B.height<=0)return D;const L=(j-B.top)/B.height,G=Math.round(100-L*100);return Math.min(100,Math.max(0,G))},C=j=>{if(a===void 0)return;const D=M(j);x.current!==D&&(x.current=D,a(D))},E=j=>{n&&(j.stopPropagation(),j.preventDefault(),c.current=!0,x.current=null,j.currentTarget.setPointerCapture(j.pointerId),C(j.clientY))},R=j=>{!n||!c.current||(j.stopPropagation(),C(j.clientY))},_=j=>{!n||!c.current||(j.stopPropagation(),c.current=!1,x.current=null,j.currentTarget.hasPointerCapture(j.pointerId)&&j.currentTarget.releasePointerCapture(j.pointerId))};return v.jsxs("div",{ref:h,"data-testid":"valve-graphic",...n?{"aria-label":"Drag to set position",role:"slider","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":t??0}:{"aria-hidden":"true"},onPointerDown:n?E:void 0,onPointerMove:n?R:void 0,onPointerUp:n?_:void 0,onPointerCancel:n?_:void 0,className:se("relative w-28 h-36 rounded border-2 border-border bg-gradient-to-b from-surface-hover to-surface overflow-hidden flex-shrink-0",n&&"cursor-ns-resize touch-none select-none"),style:{boxShadow:"inset 0 0 0 2px rgba(255,255,255,.06)"},children:[v.jsx("div",{className:se("absolute inset-0 transition-colors duration-300",s.glow)}),v.jsx("div",{className:se("absolute inset-0 flex items-center justify-center",s.accent),"aria-hidden":"true",children:v.jsxs("svg",{viewBox:"0 0 100 100",className:"w-24 h-28",fill:"none",children:[v.jsx("rect",{x:"40",y:"4",width:"20",height:"92",rx:"3",fill:"currentColor",fillOpacity:"0.06",stroke:"currentColor",strokeWidth:"2.5"}),s.flowing&&v.jsx("line",{x1:"50",y1:"8",x2:"50",y2:"92",stroke:"currentColor",strokeWidth:"4",strokeLinecap:"round",strokeDasharray:"4 8",opacity:"0.5",className:"animate-pulse"}),s.active&&v.jsx("circle",{cx:"50",cy:"50",r:"22",stroke:"currentColor",strokeWidth:"2",opacity:"0.4",className:"animate-ping",style:{transformOrigin:"center"}}),v.jsx("circle",{cx:"50",cy:"50",r:"17",fill:"currentColor",fillOpacity:"0.12",stroke:"currentColor",strokeWidth:"2.5"}),v.jsx("rect",{x:"43",y:f,width:"14",height:"6",rx:"1.5",fill:"currentColor",fillOpacity:"0.55",className:"transition-all duration-200"}),v.jsx("line",{x1:"50",y1:"33",x2:"50",y2:"22",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),v.jsx("g",{style:{transform:`rotate(${m}deg)`,transformOrigin:"50px 20px",transition:"transform 200ms"},children:v.jsx("rect",{x:"34",y:"17",width:"32",height:"6",rx:"3",fill:"currentColor",fillOpacity:"0.7"})})]})})]})}function pv({label:e,busy:t,variant:n,onClick:a,children:s}){return v.jsx("button",{type:"button","aria-label":e,title:e,disabled:t,onClick:p=>{p.stopPropagation(),a()},className:se("inline-flex h-10 w-10 items-center justify-center rounded-md text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",i5(n),t&&"opacity-40 cursor-not-allowed"),children:s})}function Bce({trpc:e,deviceId:t,features:n,optimistic:a}){const{cap:s,slice:p,available:f}=a5(e,t),{display:m,applyOptimistic:h}=zt(p,{enabled:a??!0});if(s===void 0)return null;const c=!f,x=(n??[]).includes(va.ValvePositionable),M=Hm(m?.state),C=Pce(m?.state),E=m?.position??null,R=E!==null,_=(D,z)=>{c||!D||(z!==void 0&&h(z),D({}))},j=D=>{c||(h({position:D}),s.setPosition({position:D}))};return v.jsxs("div",{className:"flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-4",children:[v.jsxs("div",{className:"flex items-center gap-6",children:[v.jsx(qce,{state:m?.state,position:E,interactive:x&&R,onSetPosition:x&&R?j:void 0}),v.jsxs("div",{className:"flex flex-col gap-3 flex-1",children:[R&&v.jsxs("div",{className:"flex items-baseline gap-1",children:[v.jsx("span",{className:"text-3xl font-semibold tabular-nums text-foreground",children:E}),v.jsx("span",{className:"text-base text-foreground-subtle",children:"%"}),v.jsx("span",{className:"text-xs text-foreground-subtle ml-1",children:"open"})]}),!R&&v.jsx("div",{className:"flex items-baseline gap-1",children:v.jsx("span",{className:se("text-3xl font-semibold",C.tone),children:C.label})}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(pv,{label:"Open",busy:c,variant:M.up,onClick:()=>_(s.open,{state:"opening"}),children:v.jsx(Dm,{className:"h-5 w-5"})}),v.jsx(pv,{label:"Stop",busy:c,variant:M.stop,onClick:()=>_(s.stop,{state:"stopped"}),children:v.jsx(Cu,{className:"h-4 w-4"})}),v.jsx(pv,{label:"Close",busy:c,variant:M.down,onClick:()=>_(s.close,{state:"closing"}),children:v.jsx(Uo,{className:"h-5 w-5"})})]})]})]}),x&&v.jsxs("label",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("span",{className:"w-12 shrink-0",children:"Position"}),v.jsx("input",{"aria-label":"Position",type:"range",min:0,max:100,step:1,value:E??0,disabled:c,className:"flex-1",onChange:D=>{j(Number(D.target.value))}}),v.jsxs("span",{className:"w-8 text-right tabular-nums",children:[E??"—","%"]})]}),!x&&R&&v.jsxs("label",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("span",{className:"w-12 shrink-0",children:"Position"}),v.jsx("input",{"aria-label":"Position",type:"range",min:0,max:100,step:1,value:E,disabled:!0,readOnly:!0,className:"flex-1 opacity-60"}),v.jsxs("span",{className:"w-8 text-right tabular-nums",children:[E,"%"]})]})]})}function Fce(e,t){switch(t){case"humidifying":return{glow:"bg-primary/15",accent:"text-primary",misting:!0};case"drying":return{glow:"bg-warning/10",accent:"text-warning",misting:!1};case"idle":return{glow:"bg-transparent",accent:"text-foreground-subtle",misting:!1};case"off":return{glow:"bg-transparent",accent:"text-foreground-subtle",misting:!1};default:return e?{glow:"bg-primary/10",accent:"text-primary",misting:!0}:{glow:"bg-transparent",accent:"text-foreground-subtle",misting:!1}}}function r5(e,t){return gt({trpc:e,deviceId:t,cap:n=>n.humidifier,slice:n=>n.state.humidifier})}function Uce({trpc:e,deviceId:t,optimistic:n}){const{cap:a,slice:s,available:p}=r5(e,t),{display:f,applyOptimistic:m}=zt(s,{enabled:n??!0});if(a===void 0)return null;const h=!p,c=f?.on??!1,x=()=>{h||(m({on:!c}),a.setOn({on:!c}))};return v.jsxs("div",{className:"inline-flex items-center gap-2",children:[v.jsx("button",{type:"button","aria-label":c?"Turn off":"Turn on",title:c?"Turn off":"Turn on",disabled:h,onClick:M=>{M.stopPropagation(),x()},className:se("inline-flex h-5 w-5 items-center justify-center rounded text-xs transition-colors",c?"bg-primary text-primary-foreground":"text-foreground-subtle hover:text-foreground hover:bg-surface-hover",h&&"opacity-40 cursor-not-allowed"),children:v.jsx(Mu,{className:"h-3.5 w-3.5"})}),f!==void 0&&f.targetHumidity!==null&&v.jsxs("span",{className:"tabular-nums text-xs text-foreground-subtle",children:[f.currentHumidity!==null&&v.jsxs(v.Fragment,{children:[f.currentHumidity,"%",v.jsx("span",{className:"mx-0.5",children:"→"})]}),f.targetHumidity,"%"]})]})}function Hce({fillPct:e,tint:t}){const n=82-Math.min(100,Math.max(0,e))/100*56,a=`humidifier-droplet-clip-${T.useId()}`;return v.jsxs("div",{"data-testid":"humidifier-graphic","aria-hidden":"true",className:"relative w-28 h-36 rounded border-2 border-border bg-gradient-to-b from-surface-hover to-surface overflow-hidden flex-shrink-0",style:{boxShadow:"inset 0 0 0 2px rgba(255,255,255,.06)"},children:[v.jsx("div",{className:se("absolute inset-0 transition-colors duration-300",t.glow)}),v.jsx("div",{className:se("absolute inset-0 flex items-center justify-center",t.accent),children:v.jsxs("svg",{viewBox:"0 0 100 100",className:"w-24 h-28",fill:"none",children:[v.jsx("defs",{children:v.jsx("clipPath",{id:a,children:v.jsx("path",{d:"M50 26 C50 26 30 52 30 66 a20 20 0 0 0 40 0 C70 52 50 26 50 26 Z"})})}),t.misting&&v.jsxs("g",{className:"animate-pulse",opacity:"0.55",children:[v.jsx("line",{x1:"42",y1:"20",x2:"42",y2:"8",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeDasharray:"3 5"}),v.jsx("line",{x1:"50",y1:"18",x2:"50",y2:"4",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeDasharray:"3 5"}),v.jsx("line",{x1:"58",y1:"20",x2:"58",y2:"8",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeDasharray:"3 5"})]}),v.jsx("path",{d:"M50 26 C50 26 30 52 30 66 a20 20 0 0 0 40 0 C70 52 50 26 50 26 Z",fill:"currentColor",fillOpacity:"0.08",stroke:"currentColor",strokeWidth:"2.5"}),v.jsx("g",{clipPath:`url(#${a})`,children:v.jsx("rect",{x:"28",y:n,width:"44",height:"60",fill:"currentColor",fillOpacity:"0.4",className:"transition-all duration-300"})}),v.jsx("circle",{cx:"43",cy:"56",r:"3",fill:"currentColor",fillOpacity:"0.5"})]})})]})}function $ce({trpc:e,deviceId:t,optimistic:n}){const{cap:a,slice:s,available:p}=r5(e,t),{display:f,applyOptimistic:m}=zt(s,{enabled:n??!0});if(a===void 0||f===void 0)return null;const h=!p,c=Fce(f.on,f.action),x=f.minHumidity??0,M=f.maxHumidity??100,C=f.targetHumidity,E=f.currentHumidity,R=E??C??0,_=()=>{h||(m({on:!f.on}),a.setOn({on:!f.on}))},j=D=>{h||(m({targetHumidity:D}),a.setTargetHumidity({humidity:D}))};return v.jsxs("div",{className:"flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-4",children:[v.jsxs("div",{className:"flex items-center gap-6",children:[v.jsx(Hce,{fillPct:R,tint:c}),v.jsxs("div",{className:"flex flex-col gap-3 flex-1",children:[v.jsxs("div",{className:"flex items-baseline gap-1",children:[v.jsx("span",{className:"text-3xl font-semibold tabular-nums text-foreground",children:C!==null?C:"—"}),v.jsx("span",{className:"text-base text-foreground-subtle",children:"%"}),v.jsx("span",{className:"text-xs text-foreground-subtle ml-1",children:"target"})]}),v.jsxs("div",{className:"text-xs text-foreground-subtle tabular-nums",children:["Current: ",E!==null?`${E}%`:"—",f.action!==null&&v.jsxs("span",{className:"ml-2 capitalize",children:["· ",f.action]})]}),v.jsxs("button",{type:"button","aria-label":f.on?"Turn off":"Turn on",disabled:h,onClick:D=>{D.stopPropagation(),_()},className:se("inline-flex w-fit items-center gap-2 rounded-md px-3 py-1.5 text-sm transition-colors",f.on?"bg-primary text-primary-foreground":"border border-border text-foreground-subtle hover:text-foreground hover:bg-surface-hover",h&&"opacity-40 cursor-not-allowed"),children:[v.jsx(Mu,{className:"h-4 w-4"}),f.on?"On":"Off"]})]})]}),v.jsxs("label",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("span",{className:"w-12 shrink-0",children:"Target"}),v.jsx("input",{"aria-label":"Target humidity",type:"range",min:x,max:M,step:1,value:C??x,disabled:h,className:"flex-1",onChange:D=>{j(Number(D.target.value))}}),v.jsxs("span",{className:"w-8 text-right tabular-nums",children:[C??"—","%"]})]}),f.availableModes.length>0&&v.jsx("select",{"aria-label":"Mode",value:f.mode??"",disabled:h,onChange:D=>{D.stopPropagation();const z=f.availableModes.find(B=>B===D.target.value);!h&&z!==void 0&&(m({mode:z}),a.setMode({mode:z}))},className:se("w-full rounded border border-border bg-surface px-3 py-1.5 text-sm",h&&"opacity-40 cursor-not-allowed"),children:f.availableModes.map(D=>v.jsx("option",{value:D,children:D},D))})]})}function Qce(e){switch(e){case"heating":return{glow:"bg-warning/10",accent:"text-warning",heating:!0};case"idle":return{glow:"bg-primary/10",accent:"text-primary",heating:!1};case"off":return{glow:"bg-transparent",accent:"text-foreground-subtle",heating:!1}}}function Vce(e,t,n){return e===null||e==="off"?"off":t!==null&&n!==null&&t<n?"heating":"idle"}function o5(e,t){return gt({trpc:e,deviceId:t,cap:n=>n.waterHeater,slice:n=>n.state.waterHeater})}function Gce({trpc:e,deviceId:t,optimistic:n}){const{cap:a,slice:s}=o5(e,t),{display:p}=zt(s,{enabled:n??!0});return a===void 0||p===void 0?null:v.jsxs("div",{className:"inline-flex items-center gap-1.5 text-xs text-foreground-subtle",children:[v.jsxs("span",{className:"tabular-nums",children:[p.currentTemp!==null&&v.jsxs(v.Fragment,{children:[p.currentTemp,"°",v.jsx("span",{className:"mx-0.5",children:"→"})]}),p.targetTemp!==null?`${p.targetTemp}°`:"—"]}),p.operationMode!==null&&v.jsxs("span",{className:"capitalize text-foreground-subtle/80",children:["· ",p.operationMode.replace(/_/g," ")]})]})}function Zce({fillPct:e,tint:t}){const n=86-Math.min(100,Math.max(0,e))/100*68,a=`water-heater-tank-clip-${T.useId()}`;return v.jsxs("div",{"data-testid":"water-heater-graphic","aria-hidden":"true",className:"relative w-28 h-36 rounded border-2 border-border bg-gradient-to-b from-surface-hover to-surface overflow-hidden flex-shrink-0",style:{boxShadow:"inset 0 0 0 2px rgba(255,255,255,.06)"},children:[v.jsx("div",{className:se("absolute inset-0 transition-colors duration-300",t.glow)}),v.jsx("div",{className:se("absolute inset-0 flex items-center justify-center",t.accent),children:v.jsxs("svg",{viewBox:"0 0 100 100",className:"w-24 h-28",fill:"none",children:[v.jsx("defs",{children:v.jsx("clipPath",{id:a,children:v.jsx("rect",{x:"30",y:"18",width:"40",height:"68",rx:"14"})})}),v.jsx("g",{clipPath:`url(#${a})`,children:v.jsx("rect",{x:"28",y:n,width:"44",height:"72",fill:"currentColor",fillOpacity:"0.32",className:"transition-all duration-300"})}),v.jsx("rect",{x:"30",y:"18",width:"40",height:"68",rx:"14",fill:"currentColor",fillOpacity:"0.06",stroke:"currentColor",strokeWidth:"2.5"}),v.jsx("line",{x1:"50",y1:"18",x2:"50",y2:"8",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"}),v.jsx("rect",{x:"40",y:"6",width:"20",height:"5",rx:"2",fill:"currentColor",fillOpacity:"0.6"}),v.jsx("g",{className:t.heating?"animate-pulse":void 0,opacity:t.heating?.9:.35,children:v.jsx("path",{d:"M38 74 q4 -6 8 0 q4 6 8 0 q4 -6 8 0",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",fill:"none"})}),v.jsx("circle",{cx:"62",cy:"34",r:"3.5",stroke:"currentColor",strokeWidth:"2",fill:t.heating?"currentColor":"none",fillOpacity:"0.6"})]})})]})}function Kce({trpc:e,deviceId:t,optimistic:n}){const{cap:a,slice:s,available:p}=o5(e,t),{display:f,applyOptimistic:m}=zt(s,{enabled:n??!0});if(a===void 0||f===void 0)return null;const h=!p,c=Vce(f.operationMode,f.currentTemp,f.targetTemp),x=Qce(c),M=f.currentTemp,C=f.targetTemp,E=f.minTemp,R=f.maxTemp,_=M!==null&&C!==null&&C>0?Math.min(100,M/C*100):M!==null&&R!==null&&R>0?Math.min(100,M/R*100):50,j=B=>{let L=B;return E!==null&&(L=Math.max(E,L)),R!==null&&(L=Math.min(R,L)),L},D=B=>{if(h||C===null)return;const L=j(C+B);m({targetTemp:L}),a.setTargetTemp({temp:L})},z=()=>{h||f.away===null||(m({away:!f.away}),a.setAway({on:!f.away}))};return v.jsxs("div",{className:"flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-4",children:[v.jsxs("div",{className:"flex items-center gap-6",children:[v.jsx(Zce,{fillPct:_,tint:x}),v.jsxs("div",{className:"flex flex-col gap-3 flex-1",children:[v.jsxs("div",{className:"flex items-baseline gap-1",children:[v.jsx("span",{className:"text-3xl font-semibold tabular-nums text-foreground",children:M!==null?M:"—"}),v.jsx("span",{className:"text-base text-foreground-subtle",children:"°"})]}),v.jsxs("div",{className:"text-xs text-foreground-subtle tabular-nums",children:["Target: ",C!==null?`${C}°`:"—",v.jsxs("span",{className:"ml-2 capitalize",children:["· ",c]})]}),C!==null&&v.jsx("div",{className:"w-[180px]",children:v.jsx(LN,{value:C,unit:"°",onDelta:D})})]})]}),f.availableModes.length>0&&v.jsx("select",{"aria-label":"Operation mode",value:f.operationMode??"",disabled:h,onChange:B=>{B.stopPropagation();const L=f.availableModes.find(G=>G===B.target.value);!h&&L!==void 0&&(m({operationMode:L}),a.setOperationMode({mode:L}))},className:se("w-full rounded border border-border bg-surface px-3 py-1.5 text-sm",h&&"opacity-40 cursor-not-allowed"),children:f.availableModes.map(B=>v.jsx("option",{value:B,children:B},B))}),f.away!==null&&v.jsxs("button",{type:"button","aria-label":f.away?"Disable away mode":"Enable away mode",disabled:h,onClick:B=>{B.stopPropagation(),z()},className:se("inline-flex w-fit items-center gap-2 rounded-md px-3 py-1.5 text-sm transition-colors",f.away?"bg-primary text-primary-foreground":"border border-border text-foreground-subtle hover:text-foreground hover:bg-surface-hover",h&&"opacity-40 cursor-not-allowed"),children:[v.jsx(Mu,{className:"h-4 w-4"}),"Away ",f.away?"on":"off"]})]})}function s5(e){switch(e){case"sunny":return{label:"Sunny",glyph:"sun"};case"clear-night":return{label:"Clear night",glyph:"clear-night"};case"partlycloudy":return{label:"Partly cloudy",glyph:"partly-cloudy"};case"cloudy":return{label:"Cloudy",glyph:"cloudy"};case"rainy":return{label:"Rainy",glyph:"rain"};case"pouring":return{label:"Pouring",glyph:"rain"};case"snowy":return{label:"Snowy",glyph:"snow"};case"snowy-rainy":return{label:"Sleet",glyph:"snow"};case"lightning":return{label:"Lightning",glyph:"lightning"};case"lightning-rainy":return{label:"Thunderstorm",glyph:"lightning"};case"fog":return{label:"Fog",glyph:"fog"};case"windy":return{label:"Windy",glyph:"wind"};case"windy-variant":return{label:"Windy",glyph:"wind"};case"hail":return{label:"Hail",glyph:"hail"};case"exceptional":return{label:"Exceptional",glyph:"cloudy"};case null:return{label:"Unknown",glyph:"cloudy"};default:return{label:e,glyph:"cloudy"}}}function l5(e){switch(e){case"sunny":return{glow:"bg-warning/15",accent:"text-warning"};case"clear-night":return{glow:"bg-primary/10",accent:"text-primary"};case"partlycloudy":return{glow:"bg-warning/10",accent:"text-warning"};case"cloudy":return{glow:"bg-transparent",accent:"text-foreground-subtle"};case"rainy":case"pouring":return{glow:"bg-primary/15",accent:"text-primary"};case"snowy":case"snowy-rainy":return{glow:"bg-primary/10",accent:"text-primary"};case"lightning":case"lightning-rainy":return{glow:"bg-warning/20",accent:"text-warning"};case"fog":return{glow:"bg-transparent",accent:"text-foreground-subtle"};case"windy":case"windy-variant":return{glow:"bg-transparent",accent:"text-foreground-subtle"};case"hail":return{glow:"bg-primary/10",accent:"text-primary"};default:return{glow:"bg-transparent",accent:"text-foreground-subtle"}}}function Wce(e){const t="h-4 w-4";switch(e){case"sun":return v.jsx(Q_,{className:t});case"clear-night":return v.jsx(k0,{className:t});case"partly-cloudy":return v.jsx(O_,{className:t});case"cloudy":return v.jsx(Vne,{className:t});case"rain":return v.jsx(N_,{className:t});case"snow":return v.jsx(lC,{className:t});case"lightning":return v.jsx(Qne,{className:t});case"fog":return v.jsx($ne,{className:t});case"wind":return v.jsx(er,{className:t});case"hail":return v.jsx(lC,{className:t});default:return null}}function c5(e,t){return gt({trpc:e,deviceId:t,cap:n=>n.weather,slice:n=>n.state.weather})}function Yce(e,t){return e===null?"—":`${Math.round(e)}${t??"°"}`}function Xce({trpc:e,deviceId:t}){const{slice:n}=c5(e,t);if(n===void 0)return null;const a=s5(n.condition);return v.jsxs("div",{className:"inline-flex items-center gap-1.5 text-xs text-foreground-subtle",children:[v.jsx("span",{className:se("inline-flex",l5(n.condition).accent),title:a.label,"aria-label":a.label,children:Wce(a.glyph)}),v.jsx("span",{className:"tabular-nums",children:Yce(n.temperature,n.temperatureUnit)})]})}function Jce({glyph:e,tint:t}){const n=T.useId();return v.jsxs("div",{"data-testid":"weather-scene","aria-hidden":"true",className:"relative w-28 h-36 rounded border-2 border-border bg-gradient-to-b from-surface-hover to-surface overflow-hidden flex-shrink-0",style:{boxShadow:"inset 0 0 0 2px rgba(255,255,255,.06)"},children:[v.jsx("div",{className:se("absolute inset-0 transition-colors duration-300",t.glow)}),v.jsx("div",{className:se("absolute inset-0 flex items-center justify-center",t.accent),children:v.jsx("svg",{viewBox:"0 0 100 100",className:"w-24 h-28",fill:"none","data-glyph":e,children:eue(e,n)})})]})}function ko({cx:e,cy:t,scale:n=1}){return v.jsx("g",{transform:`translate(${e} ${t}) scale(${n})`,children:v.jsx("path",{d:"M-22 8 a13 13 0 0 1 4 -25 a16 16 0 0 1 30 4 a11 11 0 0 1 -2 21 Z",fill:"currentColor",fillOpacity:"0.12",stroke:"currentColor",strokeWidth:"2.5",strokeLinejoin:"round"})})}function eue(e,t){switch(e){case"sun":return v.jsxs("g",{children:[v.jsx("circle",{cx:"50",cy:"48",r:"16",fill:"currentColor",fillOpacity:"0.18",stroke:"currentColor",strokeWidth:"2.5"}),v.jsx("g",{stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",children:[0,45,90,135,180,225,270,315].map(n=>{const a=n*Math.PI/180;return v.jsx("line",{x1:50+Math.cos(a)*22,y1:48+Math.sin(a)*22,x2:50+Math.cos(a)*30,y2:48+Math.sin(a)*30},`${t}-ray-${n}`)})})]});case"clear-night":return v.jsxs("g",{children:[v.jsx("path",{d:"M62 30 a22 22 0 1 0 8 38 a18 18 0 0 1 -8 -38 Z",fill:"currentColor",fillOpacity:"0.18",stroke:"currentColor",strokeWidth:"2.5"}),v.jsx("circle",{cx:"34",cy:"32",r:"1.6",fill:"currentColor"}),v.jsx("circle",{cx:"28",cy:"48",r:"1.2",fill:"currentColor"}),v.jsx("circle",{cx:"40",cy:"62",r:"1.4",fill:"currentColor"})]});case"partly-cloudy":return v.jsxs("g",{children:[v.jsx("circle",{cx:"38",cy:"38",r:"12",fill:"currentColor",fillOpacity:"0.18",stroke:"currentColor",strokeWidth:"2.5"}),v.jsx("g",{stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",children:[200,240,300].map(n=>{const a=n*Math.PI/180;return v.jsx("line",{x1:38+Math.cos(a)*16,y1:38+Math.sin(a)*16,x2:38+Math.cos(a)*22,y2:38+Math.sin(a)*22},`${t}-pcray-${n}`)})}),v.jsx(ko,{cx:58,cy:60})]});case"cloudy":return v.jsxs("g",{children:[v.jsx(ko,{cx:40,cy:44,scale:.9}),v.jsx(ko,{cx:62,cy:58})]});case"rain":return v.jsxs("g",{children:[v.jsx(ko,{cx:50,cy:42}),v.jsxs("g",{className:"animate-pulse",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",opacity:"0.7",children:[v.jsx("line",{x1:"38",y1:"62",x2:"34",y2:"78"}),v.jsx("line",{x1:"50",y1:"62",x2:"46",y2:"80"}),v.jsx("line",{x1:"62",y1:"62",x2:"58",y2:"78"})]})]});case"snow":return v.jsxs("g",{children:[v.jsx(ko,{cx:50,cy:42}),v.jsxs("g",{fill:"currentColor",opacity:"0.8",className:"animate-pulse",children:[v.jsx("circle",{cx:"38",cy:"70",r:"2.5"}),v.jsx("circle",{cx:"50",cy:"76",r:"2.5"}),v.jsx("circle",{cx:"62",cy:"70",r:"2.5"})]})]});case"lightning":return v.jsxs("g",{children:[v.jsx(ko,{cx:50,cy:40}),v.jsx("path",{d:"M52 58 L42 74 L50 74 L46 88 L62 68 L53 68 L58 58 Z",fill:"currentColor",fillOpacity:"0.85",className:"animate-pulse"})]});case"fog":return v.jsxs("g",{stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",opacity:"0.6",children:[v.jsx("line",{x1:"26",y1:"40",x2:"74",y2:"40"}),v.jsx("line",{x1:"30",y1:"52",x2:"70",y2:"52"}),v.jsx("line",{x1:"24",y1:"64",x2:"68",y2:"64"}),v.jsx("line",{x1:"32",y1:"76",x2:"76",y2:"76"})]});case"wind":return v.jsxs("g",{stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",fill:"none",opacity:"0.75",children:[v.jsx("path",{d:"M22 42 H60 a7 7 0 1 0 -7 -7"}),v.jsx("path",{d:"M22 56 H72 a7 7 0 1 1 -7 7"}),v.jsx("path",{d:"M22 70 H52 a6 6 0 1 0 -6 -6"})]});case"hail":return v.jsxs("g",{children:[v.jsx(ko,{cx:50,cy:42}),v.jsxs("g",{fill:"currentColor",opacity:"0.85",className:"animate-pulse",children:[v.jsx("circle",{cx:"40",cy:"70",r:"3"}),v.jsx("circle",{cx:"52",cy:"78",r:"3"}),v.jsx("circle",{cx:"62",cy:"68",r:"3"})]})]});default:return null}}function mv({icon:e,label:t,value:n}){return v.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-foreground-subtle",title:t,children:[v.jsx("span",{className:"inline-flex text-foreground-subtle","aria-hidden":"true",children:e}),v.jsx("span",{className:"tabular-nums text-foreground",children:n})]})}function tue({trpc:e,deviceId:t}){const{slice:n}=c5(e,t);if(n===void 0)return null;const a=s5(n.condition),s=l5(n.condition),p=n.temperatureUnit??"°";return v.jsx("div",{className:"flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-4",children:v.jsxs("div",{className:"flex items-center gap-6",children:[v.jsx(Jce,{glyph:a.glyph,tint:s}),v.jsxs("div",{className:"flex flex-col gap-3 flex-1",children:[v.jsxs("div",{className:"flex items-baseline gap-1",children:[v.jsx("span",{className:"text-3xl font-semibold tabular-nums text-foreground",children:n.temperature!==null?Math.round(n.temperature):"—"}),v.jsx("span",{className:"text-base text-foreground-subtle",children:p}),v.jsx("span",{className:"text-xs text-foreground-subtle ml-2 capitalize",children:a.label})]}),v.jsxs("div",{className:"flex flex-col gap-1.5",children:[n.humidity!==null&&v.jsx(mv,{icon:v.jsx(bl,{className:"h-3.5 w-3.5"}),label:"Humidity",value:`${Math.round(n.humidity)}%`}),n.windSpeed!==null&&v.jsx(mv,{icon:n.windBearing!==null?v.jsx(dae,{className:"h-3.5 w-3.5",style:{transform:`rotate(${n.windBearing}deg)`}}):v.jsx(er,{className:"h-3.5 w-3.5"}),label:"Wind",value:`${Math.round(n.windSpeed)} ${n.windSpeedUnit??""}`.trim()}),n.pressure!==null&&v.jsx(mv,{icon:v.jsx(Rp,{className:"h-3.5 w-3.5"}),label:"Pressure",value:`${Math.round(n.pressure)} ${n.pressureUnit??""}`.trim()})]})]})]})})}function u5(e,t){return gt({trpc:e,deviceId:t,cap:n=>n.image,slice:n=>n.state.image})}var VC=1,GC=6,ZC=.5;function d5({url:e,alt:t,open:n,onOpenChange:a}){const[s,p]=T.useState(1);T.useEffect(()=>{n&&p(1)},[n,e]);const f=T.useCallback(()=>p(c=>Math.min(GC,c+ZC)),[]),m=T.useCallback(()=>p(c=>Math.max(VC,c-ZC)),[]),h=T.useCallback(()=>p(1),[]);return v.jsx(yN,{open:n,onOpenChange:a,children:v.jsxs(D0,{width:"lg",className:"max-w-5xl p-6",children:[v.jsxs("div",{className:"flex items-center justify-between gap-2 mb-3",children:[v.jsx("span",{className:"truncate text-sm font-semibold text-foreground",children:t}),v.jsxs("div",{className:"flex items-center gap-1",children:[v.jsx(lp,{label:"Zoom out",disabled:s<=VC,onClick:m,children:v.jsx($ae,{className:"h-4 w-4"})}),v.jsxs("span",{className:"tabular-nums text-xs text-foreground-subtle w-10 text-center",children:[Math.round(s*100),"%"]}),v.jsx(lp,{label:"Zoom in",disabled:s>=GC,onClick:f,children:v.jsx(Hae,{className:"h-4 w-4"})}),v.jsx(lp,{label:"Reset zoom",disabled:s===1,onClick:h,children:v.jsx(yae,{className:"h-4 w-4"})}),v.jsx(lp,{label:"Close",onClick:()=>a(!1),children:v.jsx(Uae,{className:"h-4 w-4"})})]})]}),v.jsx("div",{className:"max-h-[78vh] overflow-auto rounded border border-border bg-gradient-to-b from-surface-hover to-surface p-6",children:v.jsx("img",{src:e,alt:t,style:{width:`${s*100}%`,maxWidth:"none"},className:"mx-auto block h-auto transition-[width] duration-150"})})]})})}function lp({label:e,disabled:t,onClick:n,children:a}){return v.jsx("button",{type:"button","aria-label":e,title:e,disabled:t,onClick:n,className:"inline-flex h-7 w-7 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors disabled:opacity-40 disabled:cursor-not-allowed",children:a})}function nue({trpc:e,deviceId:t}){const{slice:n}=u5(e,t),[a,s]=T.useState(!1);if(n===void 0)return null;const p=n.url;return p===null?v.jsx("span",{className:"inline-flex h-7 w-7 items-center justify-center rounded bg-surface-hover text-foreground-subtle",title:"No image",children:v.jsx(z_,{className:"h-4 w-4","aria-hidden":"true"})}):v.jsxs(v.Fragment,{children:[v.jsx("button",{type:"button",title:"View image",onClick:f=>{f.stopPropagation(),s(!0)},className:"inline-flex items-center justify-center rounded ring-offset-1 hover:ring-2 hover:ring-primary/50 transition",children:v.jsx("img",{src:p,alt:"Image",className:"h-7 w-7 rounded object-cover"})}),v.jsx(d5,{url:p,alt:"Image",open:a,onOpenChange:s})]})}function aue({trpc:e,deviceId:t,deviceName:n}){const{slice:a}=u5(e,t),[s,p]=T.useState(!1),[f,m]=T.useState(!1),h=a?.url??null;return T.useEffect(()=>{p(!1)},[h]),a===void 0?null:v.jsxs("div",{className:"flex flex-col items-stretch gap-3 rounded-lg border border-border bg-surface p-4",children:[v.jsx("div",{className:"flex w-full items-center justify-center overflow-hidden rounded border-2 border-border bg-gradient-to-b from-surface-hover to-surface",children:a.url!==null&&!s?v.jsx("button",{type:"button",title:"View image",onClick:()=>m(!0),className:"flex w-full cursor-zoom-in items-center justify-center",children:v.jsx("img",{src:a.url,alt:n??"Image",onError:()=>p(!0),className:"max-h-72 w-full object-contain"})}):v.jsxs("div",{"data-testid":"image-placeholder",className:"flex h-48 w-full flex-col items-center justify-center gap-2 text-foreground-subtle",children:[v.jsx(z_,{className:"h-8 w-8","aria-hidden":"true"}),v.jsx("span",{className:"text-xs",children:"No image"})]})}),h!==null&&!s&&v.jsx(d5,{url:h,alt:n??"Image",open:f,onOpenChange:m})]})}var cp=20,KC=9,p5="#f59e0b",m5="#ef4444";function Qc(e){return Math.min(p0,Math.max(yT,e))}var iue=`
99
- @keyframes pf-eat { 0%,100%{transform:translateY(0)} 50%{transform:translateY(2px)} }
100
- @keyframes pf-pulse { 0%,100%{opacity:.55} 50%{opacity:1} }
101
- @media (prefers-reduced-motion: reduce) {
102
- .pf-eat, .pf-pulse { animation: none !important; }
103
- }
104
- `;function f5({trpc:e,deviceId:t,layout:n,optimistic:a}){const{cap:s,slice:p,available:f}=gt({trpc:e,deviceId:t,cap:L=>L.petFeeder,slice:L=>L.state.petFeeder}),{display:m,applyOptimistic:h}=zt(p,{enabled:a??!0}),[c,x]=T.useState(cp),[M,C]=T.useState(cp),[E,R]=T.useState(cp);if(s===void 0||m===void 0)return null;const _=!f,j=m.error&&m.error!=="no_error"?m.error:null,D=m.status==="offline",z=m.status==="on_batteries";if(n==="compact")return v.jsxs("div",{className:"inline-flex items-center gap-2",children:[(j!==null||D)&&v.jsx("span",{className:"inline-flex items-center text-destructive",title:j??"Offline","aria-label":j??"Offline",children:D?v.jsx(dC,{className:"h-3.5 w-3.5","aria-hidden":!0}):v.jsx(pl,{className:"h-3.5 w-3.5","aria-hidden":!0})}),v.jsxs("span",{className:se("inline-flex items-center gap-1 text-xs tabular-nums font-medium",m.lowFood?"text-destructive":"text-foreground"),children:[v.jsx(uC,{className:"h-3.5 w-3.5","aria-hidden":!0}),m.foodLevel??"—",v.jsx("span",{className:"text-foreground-subtle",children:"g"})]}),m.batteryPower!==null&&v.jsxs("span",{className:"inline-flex items-center gap-0.5 text-xs tabular-nums text-foreground-subtle",children:[v.jsx(rm,{className:"h-3.5 w-3.5","aria-hidden":!0}),m.batteryPower,"%"]}),v.jsxs("button",{type:"button","aria-label":"Feed now",disabled:_||m.feeding,onClick:L=>{L.stopPropagation(),!(_||m.feeding)&&(h({feeding:!0}),s.feed({grams:cp}))},className:se("inline-flex items-center gap-1 rounded-md border border-border bg-surface px-2 py-1 text-xs font-medium text-foreground transition-colors hover:bg-surface-hover",(_||m.feeding)&&"opacity-40 cursor-not-allowed"),children:[v.jsx(_a,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Feed"]})]});const B=L=>{_||m.feeding||(h({feeding:!0}),s.feed({grams:Qc(L)}))};return v.jsxs("div",{className:"relative flex flex-col items-stretch gap-3 overflow-hidden rounded-lg border border-border bg-surface p-4",children:[v.jsx("style",{children:iue}),v.jsxs("div",{className:"flex items-center gap-4 rounded-lg border border-border/50 bg-surface-subtle/40 p-3",children:[v.jsx(rue,{grams:m.foodLevel,low:m.lowFood,eating:m.feeding}),v.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1.5",children:[v.jsxs("div",{className:"flex items-baseline gap-1",children:[v.jsx("span",{className:"text-3xl font-bold leading-none tabular-nums",style:{color:m.lowFood?m5:p5},children:m.foodLevel??"—"}),v.jsx("span",{className:"text-sm text-foreground-subtle",children:"g in bowl"})]}),v.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-foreground-subtle",children:[m.batteryPower!==null&&v.jsx(YC,{icon:v.jsx(rm,{className:"h-3.5 w-3.5"}),label:`${m.batteryPower}%`}),m.desiccantLeftDays!==null&&v.jsx(YC,{icon:v.jsx(er,{className:"h-3.5 w-3.5"}),label:`${m.desiccantLeftDays}d desiccant`}),z&&v.jsxs("span",{className:"inline-flex items-center gap-1 font-medium text-amber-500",children:[v.jsx(Pne,{className:"h-3.5 w-3.5","aria-hidden":!0}),"On battery"]}),D?v.jsxs("span",{className:"inline-flex items-center gap-1 font-medium text-destructive",children:[v.jsx(dC,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Offline"]}):m.feeding?v.jsxs("span",{className:"pf-pulse inline-flex items-center gap-1 font-medium text-amber-500",style:{animation:"pf-pulse 1.2s ease-in-out infinite"},children:[v.jsx(_a,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Feeding…"]}):m.lowFood?v.jsxs("span",{className:"inline-flex items-center gap-1 font-medium text-destructive",children:[v.jsx(Py,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Low food"]}):v.jsxs("span",{className:"inline-flex items-center gap-1 font-medium text-success",children:[v.jsx(Une,{className:"h-3.5 w-3.5","aria-hidden":!0}),"Ready"]})]})]})]}),j!==null&&v.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-destructive/40 bg-destructive/10 px-3 py-2 text-xs font-medium text-destructive",children:[v.jsx(pl,{className:"mt-px h-4 w-4 shrink-0","aria-hidden":!0}),v.jsx("span",{className:"min-w-0 break-words",children:j})]}),m.isDualHopper?v.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[v.jsx(fv,{label:"Hopper 1",grams:M,busy:_||m.feeding,onGrams:C,onFeed:()=>{_||m.feeding||(h({feeding:!0}),s.feed({hopper1:Qc(M)}))}}),v.jsx(fv,{label:"Hopper 2",grams:E,busy:_||m.feeding,onGrams:R,onFeed:()=>{_||m.feeding||(h({feeding:!0}),s.feed({hopper2:Qc(E)}))}})]}):v.jsx(fv,{label:"Manual feed",grams:c,busy:_||m.feeding,onGrams:x,onFeed:()=>B(c)}),v.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[v.jsx(hv,{icon:v.jsx(_a,{className:"h-4 w-4"}),label:"Call pet",busy:_,onClick:()=>{s.callPet({})}}),v.jsx(hv,{icon:v.jsx(w0,{className:"h-4 w-4"}),label:"Reset desiccant",busy:_,onClick:()=>{s.resetDesiccant({})}}),v.jsx(hv,{icon:v.jsx(uC,{className:"h-4 w-4"}),label:"Mark refilled",busy:_,onClick:()=>{s.markFoodReplenished({})}})]}),m.feeding&&v.jsxs("button",{type:"button",disabled:_,onClick:()=>{h({feeding:!1}),s.cancelFeed({})},className:se("flex items-center justify-center gap-2 rounded-lg border border-destructive/40 bg-destructive/10 px-2 py-1.5 text-xs font-medium text-destructive transition-colors hover:bg-destructive/20",_&&"opacity-40 cursor-not-allowed"),children:[v.jsx(Py,{className:"h-4 w-4","aria-hidden":!0}),"Cancel feed"]}),v.jsx(WC,{label:"Settings",children:v.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[v.jsx(gv,{icon:v.jsx(ku,{className:"h-4 w-4"}),label:"Child lock",on:m.childLock,busy:_,onToggle:L=>{h({childLock:L}),s.setChildLock({on:L})}}),v.jsx(gv,{icon:v.jsx(Lm,{className:"h-4 w-4"}),label:"Light",on:m.indicatorLight,busy:_,onToggle:L=>{h({indicatorLight:L}),s.setIndicatorLight({on:L})}}),v.jsx(gv,{icon:v.jsx(om,{className:"h-4 w-4"}),label:"Feed sound",on:m.feedSound,busy:_,onToggle:L=>{h({feedSound:L}),s.setFeedSound({on:L})}})]})}),v.jsx(WC,{label:"Volume",children:v.jsxs("div",{className:"flex items-center gap-3",children:[v.jsx(Au,{className:"h-4 w-4 shrink-0 text-foreground-subtle","aria-hidden":!0}),v.jsx(fm,{label:"Decrease volume",symbol:"−",disabled:_||m.volume<=0,onClick:()=>{const L=Math.max(0,m.volume-1);h({volume:L}),s.setVolume({level:L})}}),v.jsx("span",{className:"w-6 text-center text-lg font-semibold tabular-nums text-foreground",children:m.volume}),v.jsx(fm,{label:"Increase volume",symbol:"+",disabled:_||m.volume>=KC,onClick:()=>{const L=Math.min(KC,m.volume+1);h({volume:L}),s.setVolume({level:L})}})]})})]})}function WC({label:e,children:t}){return v.jsxs("div",{className:"flex flex-col gap-1",children:[v.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-foreground-subtle",children:e}),t]})}function YC({icon:e,label:t}){return v.jsxs("span",{className:"inline-flex items-center gap-1 tabular-nums",children:[v.jsx("span",{className:"text-foreground-subtle",children:e}),t]})}function rue({grams:e,low:t,eating:n}){const a=Math.min(1,Math.max(0,(e??0)/p0)),s=t?m5:p5,p=52-a*24;return v.jsxs("svg",{width:72,height:72,viewBox:"0 0 72 72",role:"img","aria-label":e===null?"Food level unknown":`${e} grams in bowl`,className:"shrink-0",children:[v.jsx("defs",{children:v.jsx("clipPath",{id:"pf-bowl-clip",children:v.jsx("path",{d:"M14 26 H58 L52 54 A6 6 0 0 1 46 58 H26 A6 6 0 0 1 20 54 Z"})})}),v.jsxs("g",{clipPath:"url(#pf-bowl-clip)",className:n?"pf-eat":void 0,style:n?{animation:"pf-eat 1.1s ease-in-out infinite"}:void 0,children:[v.jsx("rect",{x:"14",y:p,width:"44",height:"34",fill:s,opacity:.9}),v.jsx("ellipse",{cx:"36",cy:p,rx:"22",ry:"4",fill:s})]}),v.jsx("path",{d:"M14 26 H58 L52 54 A6 6 0 0 1 46 58 H26 A6 6 0 0 1 20 54 Z",fill:"none",stroke:"currentColor",strokeWidth:"2.5",className:"text-border"}),v.jsx("rect",{x:"11",y:"22",width:"50",height:"6",rx:"3",fill:"currentColor",className:"text-border"})]})}function fv({label:e,grams:t,busy:n,onGrams:a,onFeed:s}){return v.jsxs("div",{className:"flex flex-col gap-1",children:[v.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-foreground-subtle",children:e}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsxs("div",{className:"flex items-center gap-1 rounded-lg border border-border/60 bg-surface-subtle px-1 py-1",children:[v.jsx(fm,{label:`Decrease ${e} portion`,symbol:"−",disabled:n||t<=yT,onClick:()=>a(Qc(t-1))}),v.jsxs("span",{className:"w-12 text-center text-sm font-semibold tabular-nums text-foreground",children:[t,v.jsx("span",{className:"text-xs text-foreground-subtle",children:"g"})]}),v.jsx(fm,{label:`Increase ${e} portion`,symbol:"+",disabled:n||t>=p0,onClick:()=>a(Qc(t+1))})]}),v.jsxs("button",{type:"button",disabled:n,onClick:s,className:se("flex flex-1 items-center justify-center gap-1.5 rounded-lg border border-transparent bg-amber-400 px-2 py-2 text-sm font-semibold text-amber-950 transition-colors hover:bg-amber-300 active:scale-95",n&&"opacity-40 cursor-not-allowed"),children:[v.jsx(_a,{className:"h-4 w-4","aria-hidden":!0}),"Feed"]})]})]})}function fm({label:e,symbol:t,disabled:n,onClick:a}){return v.jsx("button",{type:"button","aria-label":e,disabled:n,onClick:a,className:se("flex h-7 w-7 shrink-0 items-center justify-center rounded-full border border-border bg-surface text-base leading-none text-foreground-subtle transition-colors hover:bg-surface-hover hover:text-foreground active:scale-95",n&&"opacity-40 cursor-not-allowed"),children:t})}function hv({icon:e,label:t,busy:n,onClick:a}){return v.jsxs("button",{type:"button",disabled:n,onClick:a,className:se("flex flex-col items-center justify-center gap-1 rounded-lg border border-border/60 bg-surface-subtle px-1 py-2 text-[11px] font-medium text-foreground-subtle transition-colors hover:bg-surface-hover hover:text-foreground",n&&"opacity-40 cursor-not-allowed"),children:[e,t]})}function gv({icon:e,label:t,on:n,busy:a,onToggle:s}){return v.jsxs("button",{type:"button","aria-label":t,"aria-pressed":n,disabled:a,onClick:()=>{a||s(!n)},className:se("flex flex-col items-center justify-center gap-1 rounded-lg border px-1 py-2 text-[11px] font-medium transition-colors",n?"border-transparent bg-indigo-400 text-indigo-950 shadow-sm":"border-border/60 bg-surface-subtle text-foreground-subtle hover:bg-surface-hover hover:text-foreground",a&&"opacity-40 cursor-not-allowed"),children:[e,t]})}function oue({trpc:e,deviceId:t,features:n,optimistic:a}){return v.jsx(f5,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a})}function sue({trpc:e,deviceId:t,features:n,optimistic:a}){return v.jsx(f5,{trpc:e,deviceId:t,features:n,layout:"full",optimistic:a})}var vv={cool:"Cool",heat:"Heat",auto:"Auto",heat_cool:"Heat·Cool",fan_only:"Fan",dry:"Dry",off:"Off"},lue={cool:H_,heat:lm,auto:$_,heat_cool:Bm,fan_only:sm,dry:bl,off:Mu},cue={heat:"#f59e0b",cool:"#60a5fa",auto:"#c084fc",heat_cool:"#e879f9",fan_only:"#94a3b8",dry:"#22d3ee",off:"#a1a1aa"},uue=16,due=30;function XC(e){const t=e.replace(/_/g," ");return t.charAt(0).toUpperCase()+t.slice(1)}function pue(e){switch(e){case"turbo":return Lr;case"quiet":return Wne;case"sleep":return k0;case"eco":return aae;case"8c_heat":return H_;case"none":return Py;default:return $_}}function mue(e){switch(e){case"high":return 1;case"medium_high":return 1.3;case"medium":return 1.6;case"medium_low":return 1.9;case"low":return 2.2;default:return 1.8}}var fue=`
105
- @keyframes acv-fall { 0%{transform:translateY(-1.75rem);opacity:0} 18%{opacity:.7} 82%{opacity:.7} 100%{transform:translateY(7.5rem);opacity:0} }
106
- @keyframes acv-rise { 0%{transform:translateY(7.5rem);opacity:0} 18%{opacity:.7} 82%{opacity:.7} 100%{transform:translateY(-1.75rem);opacity:0} }
107
- @keyframes acv-sway { 0%,100%{transform:translateX(-9%)} 50%{transform:translateX(9%)} }
108
- @keyframes acv-swing-h { 0%,100%{transform:translateX(-22%)} 50%{transform:translateX(22%)} }
109
- @keyframes acv-swing-v { 0%,100%{transform:translateY(-22%)} 50%{transform:translateY(22%)} }
110
- @keyframes acv-spin { to { transform:rotate(360deg) } }
111
- @keyframes acv-glow { 0%,100%{opacity:.35;transform:scale(1)} 50%{opacity:.6;transform:scale(1.06)} }
112
- @media (prefers-reduced-motion: reduce) {
113
- .acv-streak, .acv-fan, .acv-sway-wrap, .acv-glow, .acv-swing { animation: none !important; }
114
- }
115
- `;function h5({trpc:e,deviceId:t,layout:n,optimistic:a}){const{cap:s,slice:p,available:f}=gt({trpc:e,deviceId:t,cap:z=>z.climateControl,slice:z=>z.state.climateControl}),{display:m,applyOptimistic:h}=zt(p,{enabled:a??!0});if(s===void 0||m===void 0)return null;const c=!f;if(n==="compact")return v.jsxs("div",{"data-mode":m.mode,className:"inline-flex items-center gap-1",children:[v.jsx("span",{className:se("text-xs tabular-nums font-medium",BN[m.mode]),children:m.target!==null?v.jsxs(v.Fragment,{children:[m.target,"°",m.currentTemp!==null&&v.jsxs("span",{className:"text-foreground-subtle font-normal",children:[" ","(",m.currentTemp,"°)"]})]}):m.currentTemp!==null?v.jsxs("span",{className:"text-foreground-subtle",children:[m.currentTemp,"°"]}):null}),m.target!==null&&v.jsxs(v.Fragment,{children:[v.jsx("button",{type:"button","aria-label":"Decrease target",disabled:c,onClick:z=>{if(z.stopPropagation(),!c&&m.target!==null){const B=m.target-1;h({target:B}),s.setTarget({target:B})}},className:se("inline-flex h-5 w-5 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors text-xs",c&&"opacity-40 cursor-not-allowed"),children:"−"}),v.jsx("button",{type:"button","aria-label":"Increase target",disabled:c,onClick:z=>{if(z.stopPropagation(),!c&&m.target!==null){const B=m.target+1;h({target:B}),s.setTarget({target:B})}},className:se("inline-flex h-5 w-5 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors text-xs",c&&"opacity-40 cursor-not-allowed"),children:"+"})]}),v.jsx("select",{"aria-label":"Mode",value:m.mode,disabled:c,onChange:z=>{z.stopPropagation();const B=m.availableModes.find(L=>L===z.target.value);!c&&B&&(h({mode:B}),s.setMode({mode:B}))},className:se("bg-transparent px-0.5 text-xs text-foreground-subtle hover:text-foreground cursor-pointer",c&&"opacity-40 cursor-not-allowed"),children:m.availableModes.map(z=>v.jsx("option",{value:z,children:vv[z]},z))})]});const x=cue[m.mode],M=m.mode!=="off",C=pue(m.preset),E=m.preset==="turbo",R=Math.max(.55,mue(m.fanMode)*(E?.6:1)),_=m.swingVertical!==null,j=m.swingHorizontal!==null,D=M&&(m.swingVertical===!0||m.swingHorizontal===!0);return v.jsxs("div",{"data-mode":m.mode,className:se("relative flex flex-col items-stretch gap-2.5 overflow-hidden rounded-lg border p-3 transition-colors",q0[m.mode]),children:[v.jsx("style",{children:fue}),v.jsxs("div",{className:"relative z-10 flex flex-col items-center justify-center gap-1 overflow-hidden rounded-lg border border-border/50 bg-surface/30 px-3 py-3",children:[v.jsx("div",{className:"pointer-events-none absolute inset-0 opacity-60",children:v.jsx(vue,{mode:m.mode,accent:x,periodSec:R,swaying:D})}),v.jsx("div",{className:"pointer-events-none absolute inset-0 bg-gradient-to-b from-surface/50 via-transparent to-surface/50"}),M&&v.jsx("span",{"aria-hidden":!0,className:"acv-glow pointer-events-none absolute left-1/2 top-1/2 h-16 w-16 -translate-x-1/2 -translate-y-1/2 rounded-full blur-2xl",style:{background:x,animation:"acv-glow 3.2s ease-in-out infinite"}}),v.jsxs("div",{className:"relative z-10 flex items-center gap-1.5 text-[11px] font-semibold uppercase tracking-wide",style:{color:x},children:[v.jsx(JC,{mode:m.mode,className:"h-3.5 w-3.5"}),vv[m.mode],m.currentTemp!==null&&v.jsxs("span",{className:"normal-case text-foreground-subtle",children:["· ",m.currentTemp,"° now"]}),m.currentHumidity!==null&&v.jsxs("span",{className:"inline-flex items-center gap-0.5 normal-case text-foreground-subtle",children:[v.jsx(bl,{className:"h-3 w-3"}),m.currentHumidity,"%"]})]}),m.target!==null?v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"relative z-10 flex items-center gap-3",children:[v.jsx(eA,{label:"Decrease target",symbol:"−",disabled:c,onClick:()=>{if(c||m.target===null)return;const z=m.target-1;h({target:z}),s.setTarget({target:z})}}),v.jsxs("div",{className:"flex items-baseline gap-0.5",children:[v.jsx("span",{className:"text-4xl font-bold leading-none tabular-nums",style:{color:x},children:m.target}),v.jsx("span",{className:"text-lg text-foreground-subtle",children:"°"})]}),v.jsx(eA,{label:"Increase target",symbol:"+",disabled:c,onClick:()=>{if(c||m.target===null)return;const z=m.target+1;h({target:z}),s.setTarget({target:z})}})]}),v.jsx("div",{className:"relative z-10 w-36",children:v.jsx(gue,{value:m.target,min:uue,max:due,accent:x})})]}):v.jsxs("div",{className:"relative z-10 flex items-baseline gap-0.5",children:[v.jsx("span",{className:"text-4xl font-bold leading-none tabular-nums text-foreground",children:m.currentTemp??"—"}),v.jsx("span",{className:"text-lg text-foreground-subtle",children:"°"})]})]}),v.jsxs("div",{className:"relative z-10 grid grid-cols-3 gap-2",children:[v.jsx(yv,{label:"Mode",icon:v.jsx("span",{style:{color:x},className:"flex",children:v.jsx(JC,{mode:m.mode,className:"h-4 w-4"})}),value:m.mode,options:m.availableModes.map(z=>({value:z,label:vv[z]})),disabled:c,onChange:z=>{const B=m.availableModes.find(L=>L===z);B&&(h({mode:B}),s.setMode({mode:B}))}}),m.availableFanModes.length>0&&v.jsx(yv,{label:"Fan",icon:v.jsx(er,{className:"h-4 w-4 text-sky-500"}),value:m.fanMode,options:m.availableFanModes.map(z=>({value:z,label:XC(z)})),disabled:c,onChange:z=>{h({fanMode:z}),s.setFanMode({fanMode:z})}}),m.availablePresets.length>0&&v.jsx(yv,{label:"Preset",icon:v.jsx(C,{className:"h-4 w-4 text-emerald-500"}),value:m.preset,options:m.availablePresets.map(z=>({value:z,label:XC(z)})),disabled:c,onChange:z=>{h({preset:z}),s.setPreset({preset:z})}})]}),(_||j)&&v.jsx(hue,{label:"Swing",children:v.jsxs("div",{className:"grid grid-cols-2 gap-1",children:[_&&v.jsx(tA,{axis:"vertical",on:m.swingVertical??!1,busy:c,onToggle:z=>{h({swingVertical:z}),s.setSwingVertical({on:z})}}),j&&v.jsx(tA,{axis:"horizontal",on:m.swingHorizontal??!1,busy:c,onToggle:z=>{h({swingHorizontal:z}),s.setSwingHorizontal({on:z})}})]})})]})}function hue({label:e,children:t}){return v.jsxs("div",{className:"relative z-10 flex flex-col gap-1",children:[v.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-foreground-subtle",children:e}),t]})}function JC({mode:e,className:t}){const n=lue[e];return v.jsx(n,{className:t,"aria-hidden":!0})}function yv({label:e,icon:t,value:n,options:a,disabled:s,onChange:p}){return v.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[v.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-foreground-subtle",children:e}),v.jsxs("div",{className:se("flex items-center gap-1 overflow-hidden rounded-lg border border-border/60 bg-surface-subtle px-1.5 py-1.5",s&&"opacity-40"),children:[v.jsx("span",{className:"flex shrink-0",children:t}),v.jsx("select",{"aria-label":e,value:n,disabled:s,onChange:f=>{f.stopPropagation(),s||p(f.target.value)},className:"min-w-0 flex-1 cursor-pointer appearance-none truncate bg-transparent text-xs font-medium text-foreground outline-none",children:a.map(f=>v.jsx("option",{value:f.value,children:f.label},f.value))}),v.jsx(Uo,{className:"h-3 w-3 shrink-0 text-foreground-subtle"})]})]})}function eA({label:e,symbol:t,disabled:n,onClick:a}){return v.jsx("button",{type:"button","aria-label":e,disabled:n,onClick:a,className:se("flex h-8 w-8 shrink-0 items-center justify-center rounded-full border border-border bg-surface text-lg leading-none text-foreground-subtle transition-colors hover:bg-surface-hover hover:text-foreground active:scale-95",n&&"opacity-40 cursor-not-allowed"),children:t})}function gue({value:e,min:t,max:n,accent:a}){const s=`${Math.min(1,Math.max(0,(e-t)/(n-t)))*100}%`;return v.jsxs("div",{className:"mt-2 w-full",children:[v.jsxs("div",{className:"relative h-1.5 w-full rounded-full bg-surface-subtle",children:[v.jsx("div",{className:"absolute inset-y-0 left-0 rounded-full",style:{width:s,background:a}}),v.jsx("div",{className:"absolute top-1/2 h-3 w-3 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-surface shadow",style:{left:s,background:a}})]}),v.jsxs("div",{className:"mt-0.5 flex justify-between text-[9px] tabular-nums text-foreground-subtle",children:[v.jsxs("span",{children:[t,"°"]}),v.jsxs("span",{children:[n,"°"]})]})]})}function vue({mode:e,accent:t,periodSec:n,swaying:a}){const s=[0,1,2,3,4,5],p=e==="heat",f=e==="dry";return v.jsx("div",{"aria-hidden":!0,className:"absolute inset-0 overflow-hidden",children:e==="off"?v.jsx("div",{className:"flex h-full items-center justify-center gap-2 opacity-30",children:s.map(m=>v.jsx("span",{className:"h-8 w-1 rounded-full bg-foreground-subtle opacity-40"},m))}):e==="fan_only"?v.jsx("div",{className:"flex h-full items-center justify-center",children:v.jsx(yue,{color:t,periodSec:Math.max(.5,n*.7),size:56})}):v.jsx("div",{className:se("acv-sway-wrap absolute inset-0",a&&"acv-sway"),style:a?{animation:"acv-sway 2.6s ease-in-out infinite"}:void 0,children:s.map(m=>v.jsx("span",{className:"acv-streak absolute rounded-full",style:{left:`${8+m*15}%`,width:f?"0.4rem":"0.3rem",height:f?"0.4rem":"1.9rem",background:t,boxShadow:`0 0 6px ${t}`,animationName:p?"acv-rise":"acv-fall",animationTimingFunction:"linear",animationIterationCount:"infinite",animationDuration:`${n}s`,animationDelay:`${m%3*(n/3)+m*.05}s`}},m))})})}function yue({color:e,periodSec:t,size:n}){return v.jsxs("svg",{width:n,height:n,viewBox:"0 0 100 100",className:"acv-fan",style:{animation:`acv-spin ${t}s linear infinite`,transformOrigin:"50% 50%"},"aria-hidden":!0,children:[[0,120,240].map(a=>v.jsx("path",{d:"M50 50 C 58 30, 78 26, 84 12 C 66 20, 54 34, 50 50 Z",fill:e,opacity:.85,transform:`rotate(${a} 50 50)`},a)),v.jsx("circle",{cx:"50",cy:"50",r:"7",fill:e})]})}function tA({axis:e,on:t,busy:n,onToggle:a}){const s=e==="vertical"?"Vertical":"Horizontal",p=e==="vertical"?uae:cae,f=e==="vertical"?"acv-swing-v":"acv-swing-h";return v.jsxs("button",{type:"button","aria-label":`${s} swing`,"aria-pressed":t,disabled:n,onClick:()=>{n||a(!t)},className:se("flex items-center justify-center gap-2 rounded-lg border px-2 py-1.5 text-xs font-medium transition-colors",t?"border-transparent bg-indigo-400 text-indigo-950 shadow-sm":"border-border/60 bg-surface-subtle text-foreground-subtle hover:bg-surface-hover hover:text-foreground",n&&"opacity-40 cursor-not-allowed"),children:[v.jsx(p,{className:"acv-swing h-4 w-4","aria-hidden":!0,style:t?{animation:`${f} 1.4s ease-in-out infinite`}:void 0}),s]})}var bue=5,Sue=35;function bv(e,t,n){return Math.min(1,Math.max(0,(e-t)/(n-t)))}function Sv(e,t,n){return Math.round(t+e*(n-t))}var Ki=176,hm=76,Bp=2*Math.PI*hm,Rc=Bp*(270/360),xv=Ki/2-hm-10;function nA(e){const t=Ki/2,n=Ki/2,a=Bp-Rc,s=e.mode==="band"?(()=>{const p=e.band.from*Rc,f=Math.max(0,(e.band.to-e.band.from)*Rc);return{dasharray:`${f} ${Bp-f}`,dashoffset:-p}})():(()=>{const p=e.fraction*Rc;return{dasharray:`${p} ${Bp-p}`,dashoffset:void 0}})();return v.jsxs("svg",{width:Ki,height:Ki,viewBox:`0 0 ${Ki} ${Ki}`,"aria-hidden":"true",className:"absolute inset-0",style:{transform:"rotate(135deg)"},children:[v.jsx("circle",{cx:t,cy:n,r:hm,fill:"none",stroke:"var(--color-border)",strokeWidth:12,strokeDasharray:`${Rc} ${a}`,strokeLinecap:"round"}),v.jsx("circle",{cx:t,cy:n,r:hm,fill:"none",stroke:e.color,strokeWidth:12,strokeDasharray:s.dasharray,...s.dashoffset!==void 0?{strokeDashoffset:s.dashoffset}:{},strokeLinecap:"round"})]})}var xue={heat:"#f59e0b",cool:"#60a5fa",auto:"#c084fc",heat_cool:"#e879f9",fan_only:"#94a3b8",dry:"#22d3ee",off:"#d4d4d8"};function kue({trpc:e,deviceId:t,features:n,optimistic:a}){const{cap:s,slice:p,available:f}=gt({trpc:e,deviceId:t,cap:D=>D.climateControl,slice:D=>D.state.climateControl}),{display:m,applyOptimistic:h}=zt(p,{enabled:a??!0});if(s===void 0||m===void 0)return null;const c=!f,x=xue[m.mode],M=m.mode==="heat_cool"||m.targetLow!==null&&m.targetHigh!==null,C=bue,E=Sue,R=!M&&m.target!==null?bv(m.target,C,E):0,_=M&&m.targetLow!==null?bv(m.targetLow,C,E):0,j=M&&m.targetHigh!==null?bv(m.targetHigh,C,E):0;return v.jsxs("div",{"data-mode":m.mode,className:se("flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-4 transition-colors",q0[m.mode]),children:[v.jsxs("div",{className:"flex flex-col items-center gap-3",children:[v.jsxs("div",{className:"relative",style:{width:Ki,height:Ki},children:[M?v.jsx(nA,{mode:"band",band:{from:_,to:j},color:x}):v.jsx(nA,{mode:"fill",fraction:R,color:x}),M?v.jsxs(v.Fragment,{children:[v.jsx("div",{"data-testid":"arc-knob",children:v.jsx(Lp,{fraction:_,color:x,knobTopPx:xv,onDragFraction:D=>{if(c||m.targetHigh===null)return;const z=Math.min(Sv(D,C,E),m.targetHigh);h({targetLow:z}),s.setTargetRange({targetLow:z,targetHigh:m.targetHigh})}})}),v.jsx("div",{"data-testid":"arc-knob",children:v.jsx(Lp,{fraction:j,color:x,knobTopPx:xv,onDragFraction:D=>{if(c||m.targetLow===null)return;const z=Math.max(Sv(D,C,E),m.targetLow);h({targetHigh:z}),s.setTargetRange({targetLow:m.targetLow,targetHigh:z})}})})]}):v.jsx("div",{"data-testid":"arc-knob",children:v.jsx(Lp,{fraction:R,color:x,knobTopPx:xv,onDragFraction:D=>{if(c)return;const z=Sv(D,C,E);h({target:z}),s.setTarget({target:z})}})}),v.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-0.5 pointer-events-none",children:[v.jsxs("div",{"data-testid":"current-temp",className:"text-4xl font-bold tabular-nums text-foreground leading-none",children:[m.currentTemp!==null?m.currentTemp:"—",v.jsx("span",{className:"text-lg text-foreground-subtle font-normal ml-0.5",children:"°"})]}),!M&&m.target!==null&&v.jsxs("div",{className:"text-xs font-semibold",style:{color:x},children:["set ",m.target,"°"]}),M&&m.targetLow!==null&&m.targetHigh!==null&&v.jsxs("div",{className:"text-xs font-semibold",style:{color:x},children:[m.targetLow,"° – ",m.targetHigh,"°"]})]})]}),!M&&m.target!==null&&v.jsx("div",{className:"w-[200px]",children:v.jsx(LN,{value:`${m.target}°`,onDelta:D=>{if(c||m.target===null)return;const z=m.target+D;h({target:z}),s.setTarget({target:z})}})})]}),v.jsx("select",{"aria-label":"Mode",value:m.mode,disabled:c,onChange:D=>{D.stopPropagation();const z=D.target.value;!c&&z&&(h({mode:m.availableModes.find(B=>B===z)??m.mode}),s.setMode({mode:m.availableModes.find(B=>B===z)??m.mode}))},className:se("w-full rounded border border-border bg-surface px-3 py-1.5 text-sm",c&&"opacity-40 cursor-not-allowed"),children:m.availableModes.map(D=>v.jsx("option",{value:D,children:D},D))})]})}function wue(e){return e==="locked"||e==="locking"}function g5(e){return e==="jammed"}var Mue={locked:{colorClass:"border-success/30 bg-success/10 text-success",icon:"locked"},locking:{colorClass:"border-success/30 bg-success/10 text-success",icon:"locked"},unlocked:{colorClass:"border-warning/30 bg-warning/10 text-warning",icon:"open"},unlocking:{colorClass:"border-warning/30 bg-warning/10 text-warning",icon:"open"},jammed:{colorClass:"border-danger/30 bg-danger/10 text-danger",icon:"locked"}};function Cue({state:e}){const t=Mue[e];return v.jsx("div",{"data-testid":"lock-glyph","data-state":e,className:se("flex h-16 w-16 items-center justify-center rounded-full border-2",t.colorClass),children:t.icon==="locked"?v.jsx(ku,{className:"h-8 w-8","aria-hidden":"true"}):v.jsx(Dy,{className:"h-8 w-8","aria-hidden":"true"})})}function Aue({state:e}){return v.jsx("span",{className:se("text-sm font-medium capitalize",g5(e)?"text-danger":"text-foreground-muted"),children:e})}function Eue({busy:e,onOpen:t}){return v.jsxs("button",{type:"button","aria-label":"Open (unlatch)",title:"Open (unlatch)",disabled:e,onClick:n=>{n.stopPropagation(),t()},className:se("inline-flex items-center gap-1.5 rounded-md border border-border px-3 py-1.5 text-xs font-medium","text-foreground-muted hover:bg-surface-hover transition-colors",e&&"opacity-40 cursor-not-allowed"),children:[v.jsx(dl,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Open"]})}function Rue({trpc:e,deviceId:t,features:n,optimistic:a}){const{cap:s,slice:p,available:f}=gt({trpc:e,deviceId:t,cap:_=>_.lockControl,slice:_=>_.state.lockControl}),{display:m,applyOptimistic:h}=zt(p,{enabled:a??!0});if(s===void 0||m===void 0)return null;const c=wue(m.state),x=g5(m.state)||!f,M=n?.includes(va.LockOpen)===!0,C=()=>{x||(c?(h({state:"unlocking"}),s.unlock({})):(h({state:"locking"}),s.lock({})))},E=()=>{x||s.open({})},R=c?"Unlock":"Lock";return v.jsxs("div",{className:"flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-4",children:[v.jsxs("div",{className:"flex flex-col items-center gap-2",children:[v.jsx(Cue,{state:m.state}),v.jsx(Aue,{state:m.state})]}),v.jsx("div",{className:se(x&&"pointer-events-none opacity-40"),children:v.jsx(mle,{on:c,targetLabel:R,onConfirm:C})}),M&&v.jsx("div",{className:"flex justify-center",children:v.jsx(Eue,{busy:x,onOpen:E})})]})}var ib=500,v5=150,Iue="linear-gradient(90deg, #9ec9ff, #ffffff, #ffb24d)";function Tue(e,t,n){return Math.min(1,Math.max(0,(e-t)/(n-t)))}function _ue(e){return Tue(e,v5,ib)}var Nue="#f4b740",Oue="#d4d4d8";function jue({trpc:e,deviceId:t,features:n,optimistic:a}){const s=gt({trpc:e,deviceId:t,cap:L=>L.switch,slice:L=>L.state.switch}),p=gt({trpc:e,deviceId:t,cap:L=>L.brightness,slice:L=>L.state.brightness}),f=gt({trpc:e,deviceId:t,cap:L=>L.color,slice:L=>L.state.color}),m=zt(s.slice,{enabled:a??!0}),h=zt(p.slice,{enabled:a??!0}),c=zt(f.slice,{enabled:a??!0});if(s.cap===void 0||m.display===void 0)return null;const x=m.display.on===!0,M=!s.available,C=h.display?.percentage??0,E=!p.available,R=x?C/100:0,_=x?Nue:Oue,j=(n?.includes(va.LightColorMired)??!1)&&f.cap!==void 0,D=c.display?.mireds,z=!f.available,B=()=>{if(M)return;const L=!x;m.applyOptimistic({on:L}),s.cap?.setState({on:L})};return v.jsxs("div",{className:"flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-4",children:[v.jsxs("div",{className:"flex flex-col items-center gap-3",children:[v.jsxs(qN,{fraction:R,color:_,children:[v.jsxs("div",{"data-testid":"brightness-readout",className:"text-3xl font-bold tabular-nums text-foreground leading-none",children:[C,v.jsx("span",{className:"text-base text-foreground-subtle font-normal ml-0.5",children:"%"})]}),v.jsx(Lm,{className:"h-5 w-5 text-foreground-subtle","aria-hidden":"true"})]}),p.cap!==void 0&&v.jsxs("label",{className:"flex w-full items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("span",{className:"w-16",children:"Brightness"}),v.jsx("input",{"aria-label":"Brightness",type:"range",min:0,max:100,step:1,className:"flex-1",value:C,disabled:E||!x,onChange:L=>{const G=Number(L.target.value);h.applyOptimistic({percentage:G}),E||p.cap?.setBrightness({percentage:G})}}),v.jsxs("span",{className:"tabular-nums w-9 text-right",children:[C,"%"]})]})]}),v.jsxs("div",{className:"flex items-center justify-between",children:[v.jsx("span",{className:"text-sm font-medium text-foreground-muted",children:x?"On":"Off"}),v.jsx(z0,{on:x,busy:M,onToggle:B})]}),j&&v.jsxs("div",{className:"flex items-center gap-2","data-testid":"color-temp-strip",children:[v.jsx(Bm,{className:"h-4 w-4 text-foreground-subtle","aria-hidden":"true"}),v.jsxs("label",{className:"flex-1",children:[v.jsx("span",{className:"sr-only",children:"Colour temperature"}),v.jsx("input",{"aria-label":"Colour temperature",type:"range",min:v5,max:ib,step:1,className:"w-full",value:D??ib,disabled:z||!x,onChange:L=>{const G=Number(L.target.value);c.applyOptimistic({mode:"mired",mireds:G}),z||f.cap?.setColor({color:{mode:"mired",mireds:G}})}}),v.jsx("div",{className:"pointer-events-none mt-1",children:v.jsx(nb,{fraction:D!==void 0?_ue(D):.5,color:Iue})})]})]})]})}var Pue="#3aa6a0",Due="#d4d4d8";function zue({trpc:e,deviceId:t,features:n,optimistic:a}){const s=gt({trpc:e,deviceId:t,cap:F=>F.switch,slice:F=>F.state.switch}),p=gt({trpc:e,deviceId:t,cap:F=>F.fanControl,slice:F=>F.state.fanControl}),f=zt(s.slice,{enabled:a??!0}),m=zt(p.slice,{enabled:a??!0});if(s.cap===void 0||f.display===void 0)return null;const h=f.display.on===!0,c=!s.available,x=m.display?.percentage??0,M=!p.available,C=h?x/100:0,E=h?Pue:Due,R=n?.includes(va.FanSpeed)??!1,_=(n?.includes(va.FanOscillating)??!1)&&p.cap!==void 0,j=m.display?.availablePresets??[],D=(n?.includes(va.FanPreset)??!1)&&p.cap!==void 0&&j.length>0,z=m.display?.preset??"",B=m.display?.oscillating===!0,L=()=>{if(c)return;const F=!h;f.applyOptimistic({on:F}),s.cap?.setState({on:F})},G=()=>{if(M)return;const F=!B;m.applyOptimistic({oscillating:F}),p.cap?.setOscillating({oscillating:F})},ae=F=>{if(M)return;const fe=m.display;if(fe===void 0)return;const ke=fe.percentageStep!==void 0&&fe.percentageStep>0?fe.percentageStep:1,Me=Math.min(100,Math.max(0,Math.round(F*100/ke)*ke));m.applyOptimistic({percentage:Me}),p.cap?.setPercentage({percentage:Me})},V=F=>{M||F===""||(m.applyOptimistic({preset:F}),p.cap?.setPreset({preset:F}))};return v.jsxs("div",{className:"flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-4",children:[v.jsx("div",{className:"flex flex-col items-center gap-3",children:R?v.jsxs(qN,{fraction:C,color:E,onDragFraction:ae,children:[v.jsxs("div",{"data-testid":"speed-readout",className:"text-3xl font-bold tabular-nums text-foreground leading-none",children:[x,v.jsx("span",{className:"text-base text-foreground-subtle font-normal ml-0.5",children:"%"})]}),v.jsx(sm,{className:"h-5 w-5 text-foreground-subtle","aria-hidden":"true"})]}):v.jsx("div",{"data-testid":"fan-onoff-icon",className:"flex h-[150px] w-[150px] items-center justify-center",children:v.jsx(sm,{className:"h-16 w-16",style:{color:E},"aria-hidden":"true"})})}),D&&v.jsx("div",{className:"flex justify-center",children:v.jsxs("label",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[v.jsx("span",{children:"Preset"}),v.jsxs("select",{"aria-label":"Fan preset",value:z,disabled:M,onChange:F=>{F.stopPropagation(),V(F.target.value)},className:se("bg-surface border border-border rounded px-1 py-0.5",M&&"opacity-40 cursor-not-allowed"),children:[v.jsx("option",{value:"",disabled:!0,children:"—"}),j.map(F=>v.jsx("option",{value:F,children:F},F))]})]})}),v.jsxs("div",{className:"flex items-center justify-between gap-2",children:[_?v.jsxs("button",{type:"button","aria-label":"Oscillate","aria-pressed":B,disabled:M,onClick:F=>{F.stopPropagation(),G()},className:se("inline-flex items-center gap-1.5 rounded-md border px-3 py-1.5 text-xs font-medium transition-colors",B?"border-success/50 bg-success/10 text-success":"border-border text-foreground-muted hover:bg-surface-hover",M&&"opacity-40 cursor-not-allowed"),children:[v.jsx(w0,{className:"h-3.5 w-3.5","aria-hidden":"true"}),"Oscillate"]}):v.jsx("span",{className:"text-sm font-medium text-foreground-muted",children:h?"On":"Off"}),v.jsx(z0,{on:h,busy:c,onToggle:L})]})]})}function Lue({trpc:e,deviceId:t,optimistic:n}){const{cap:a,slice:s,available:p}=gt({trpc:e,deviceId:t,cap:M=>M.switch,slice:M=>M.state.switch}),{display:f,applyOptimistic:m}=zt(s,{enabled:n??!0});if(a===void 0||f===void 0)return null;const h=f.on===!0,c=!p,x=()=>{if(c)return;const M=!h;m({on:M}),a.setState({on:M})};return v.jsxs("div",{className:"flex flex-col items-center gap-4 rounded-lg border border-border bg-surface p-6",children:[v.jsx("div",{"data-testid":"switch-glyph","data-state":h?"on":"off",className:se("flex h-16 w-16 items-center justify-center rounded-full border-2 transition-colors",h?"border-success/30 bg-success/10 text-success":"border-border bg-surface-subtle text-foreground-subtle"),children:v.jsx(Mu,{className:"h-8 w-8","aria-hidden":"true"})}),v.jsx("span",{className:"text-sm font-medium text-foreground-muted",children:h?"On":"Off"}),v.jsx(z0,{on:h,busy:c,onToggle:x})]})}function que(e){return e==="playing"||e==="buffering"?"pause":"play"}function Bue(e,t){return e===null||t===null||t<=0?0:Math.min(1,Math.max(0,e/t))}function aA(e){if(e===null)return"--:--";const t=Math.floor(e/1e3);return`${Math.floor(t/60)}:${(t%60).toString().padStart(2,"0")}`}function Fue({title:e,subtitle:t}){return v.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[v.jsx(F_,{className:"h-6 w-6 text-foreground-subtle","aria-hidden":"true"}),v.jsx("span",{className:"text-base font-semibold text-foreground line-clamp-1",children:e??"Nothing playing"}),t&&v.jsx("span",{className:"text-xs text-foreground-subtle line-clamp-1",children:t})]})}function kv({label:e,busy:t,onPress:n,children:a,primary:s}){return v.jsx("button",{type:"button","aria-label":e,title:e,disabled:t,onClick:p=>{p.stopPropagation(),t||n()},className:se("inline-flex items-center justify-center rounded-full transition-colors",s?"h-12 w-12 bg-primary text-primary-foreground hover:bg-primary/90 shadow-md":"h-10 w-10 text-foreground-muted hover:bg-surface-hover",t&&"opacity-40 cursor-not-allowed"),children:a})}function Uue({trpc:e,deviceId:t,features:n,optimistic:a}){const{cap:s,slice:p,available:f}=gt({trpc:e,deviceId:t,cap:B=>B.mediaPlayer,slice:B=>B.state.mediaPlayer}),{display:m,applyOptimistic:h}=zt(p,{enabled:a??!0});if(s===void 0||m===void 0)return null;const c=!f,x=que(m.state),M=(n?.includes(va.MediaPlayerSeek)??!1)&&m.durationMs!==null&&m.durationMs>0,C=n?.includes(va.MediaPlayerNext)??!1,E=n?.includes(va.MediaPlayerPrevious)??!1,R=(n?.includes(va.MediaPlayerVolume)??!1)&&m.volumeLevel!==null,_=()=>{c||(x==="play"?(h({state:"playing"}),s.play({})):(h({state:"paused"}),s.pause({})))},j=m.currentMedia?.artist??m.currentMedia?.album??null,D=Bue(m.positionMs,m.durationMs),z=m.volumeLevel??0;return v.jsxs("div",{className:"flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-6",children:[v.jsx(Fue,{title:m.currentMedia?.title??null,subtitle:j}),M&&v.jsxs("div",{"data-testid":"media-seek",className:"flex flex-col gap-1",children:[v.jsxs("label",{className:"relative block",children:[v.jsx("span",{className:"sr-only",children:"Seek"}),v.jsx("input",{"aria-label":"Seek",type:"range",min:0,max:m.durationMs??0,step:1e3,className:"absolute inset-0 h-4 w-full cursor-pointer opacity-0",value:m.positionMs??0,disabled:c,onChange:B=>{if(c)return;const L=Number(B.target.value);h({positionMs:L}),s.seek({positionMs:L})}}),v.jsx("div",{className:"pointer-events-none",children:v.jsx(nb,{fraction:D})})]}),v.jsxs("div",{className:"flex justify-between text-[11px] tabular-nums text-foreground-subtle",children:[v.jsx("span",{children:aA(m.positionMs)}),v.jsx("span",{children:aA(m.durationMs)})]})]}),v.jsxs("div",{className:"flex items-center justify-center gap-4",children:[E&&v.jsx(kv,{label:"Previous",busy:c,onPress:()=>{s.previous({})},children:v.jsx(Mae,{className:"h-5 w-5","aria-hidden":"true"})}),v.jsx(kv,{label:x==="play"?"Play":"Pause",busy:c,onPress:_,primary:!0,children:x==="play"?v.jsx(Ho,{className:"h-6 w-6","aria-hidden":"true"}):v.jsx(wu,{className:"h-6 w-6","aria-hidden":"true"})}),C&&v.jsx(kv,{label:"Next",busy:c,onPress:()=>{s.next({})},children:v.jsx(Cae,{className:"h-5 w-5","aria-hidden":"true"})})]}),R&&v.jsxs("div",{"data-testid":"media-volume",className:"flex items-center gap-2",children:[v.jsx("button",{type:"button","aria-label":m.isMuted===!0?"Unmute":"Mute",title:m.isMuted===!0?"Unmute":"Mute",disabled:c,onClick:B=>{if(B.stopPropagation(),c||m.isMuted===null)return;const L=!m.isMuted;h({isMuted:L}),s.setMute({muted:L})},className:se("inline-flex h-7 w-7 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",c&&"opacity-40 cursor-not-allowed"),children:m.isMuted===!0?v.jsx(Z_,{className:"h-4 w-4","aria-hidden":"true"}):v.jsx(Au,{className:"h-4 w-4","aria-hidden":"true"})}),v.jsxs("label",{className:"relative block flex-1",children:[v.jsx("span",{className:"sr-only",children:"Volume"}),v.jsx("input",{"aria-label":"Volume",type:"range",min:0,max:100,step:1,className:"absolute inset-0 h-4 w-full cursor-pointer opacity-0",value:z,disabled:c,onChange:B=>{if(c)return;const L=Number(B.target.value);h({volumeLevel:L}),s.setVolume({volumeLevel:L})}}),v.jsx("div",{className:"pointer-events-none",children:v.jsx(nb,{fraction:z/100})})]}),v.jsxs("span",{className:"w-9 text-right text-[11px] tabular-nums text-foreground-subtle",children:[z,"%"]})]})]})}var y5={disarmed:{label:"Disarmed",colorClass:"border-border bg-surface-subtle text-foreground-subtle",icon:"disarmed"},armed_home:{label:"Armed Home",colorClass:"border-success/30 bg-success/10 text-success",icon:"armed"},armed_away:{label:"Armed Away",colorClass:"border-success/30 bg-success/10 text-success",icon:"armed"},armed_night:{label:"Armed Night",colorClass:"border-success/30 bg-success/10 text-success",icon:"armed"},armed_vacation:{label:"Armed Vacation",colorClass:"border-success/30 bg-success/10 text-success",icon:"armed"},armed_custom_bypass:{label:"Armed (Bypass)",colorClass:"border-success/30 bg-success/10 text-success",icon:"armed"},arming:{label:"Arming…",colorClass:"border-warning/30 bg-warning/10 text-warning",icon:"pending"},disarming:{label:"Disarming…",colorClass:"border-warning/30 bg-warning/10 text-warning",icon:"pending"},pending:{label:"Pending",colorClass:"border-warning/30 bg-warning/10 text-warning",icon:"pending"},triggered:{label:"Triggered",colorClass:"border-danger/30 bg-danger/10 text-danger",icon:"triggered"}},b5={home:"Home",away:"Away",night:"Night",vacation:"Vacation",custom_bypass:"Bypass"};function S5(e){return e.startsWith("armed_")}function F0(e){return e==="arming"||e==="disarming"}function x5({icon:e,sizeClass:t="h-8 w-8"}){return e==="disarmed"?v.jsx(kae,{className:t,"aria-hidden":"true"}):e==="triggered"?v.jsx(qm,{className:t,"aria-hidden":"true"}):e==="pending"?v.jsx(wae,{className:t,"aria-hidden":"true"}):v.jsx(xae,{className:t,"aria-hidden":"true"})}function iA({label:e,active:t,busy:n,onSelect:a}){return v.jsx("button",{type:"button","aria-label":e,"aria-pressed":t,disabled:n,onClick:s=>{s.stopPropagation(),n||a()},className:se("flex-1 rounded-md px-3 py-2 text-sm font-medium transition-colors",t?"bg-primary text-primary-foreground shadow-sm":"text-foreground-muted hover:bg-surface-hover",n&&"opacity-40 cursor-not-allowed"),children:e})}function Hue({state:e,availableModes:t,busy:n,onDisarm:a,onArm:s}){const p=S5(e),f=F0(e);return v.jsxs("div",{className:se("flex min-w-0 items-stretch gap-1 rounded-lg border border-border bg-surface-subtle p-1"),children:[v.jsx(iA,{label:"Disarm",active:!p&&!f,busy:n,onSelect:a}),t.map(m=>v.jsx(iA,{label:b5[m],active:!f&&e===`armed_${m}`,busy:n,onSelect:()=>s(m)},m))]})}function k5(e,t,n){const{cap:a,slice:s,available:p}=gt({trpc:e,deviceId:t,cap:M=>M.alarmPanel,slice:M=>M.state.alarmPanel}),{display:f,applyOptimistic:m}=zt(s,{enabled:n??!0}),h=!p;return{display:f,capPresent:a!==void 0,busy:h,handleDisarm:()=>{a===void 0||h||(m({state:"disarming"}),a.disarm({}))},handleArm:M=>{a===void 0||h||(m({state:"arming"}),a.arm({mode:M}))}}}function $ue({trpc:e,deviceId:t,optimistic:n}){const{display:a,capPresent:s,busy:p,handleDisarm:f,handleArm:m}=k5(e,t,n);if(!s||a===void 0)return null;const h=y5[a.state],c=S5(a.state)?a.state.replace("armed_",""):"";return v.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[v.jsxs("span",{className:se("inline-flex shrink-0 items-center gap-1 rounded-md border px-1.5 py-0.5 text-[11px] font-medium whitespace-nowrap",h.colorClass,F0(a.state)&&"animate-pulse"),children:[v.jsx(x5,{icon:h.icon,sizeClass:"h-3 w-3"}),h.label]}),v.jsxs("select",{"aria-label":"Alarm mode",disabled:p,value:c,onClick:x=>x.stopPropagation(),onChange:x=>{x.stopPropagation();const M=x.target.value;M===""?f():m(M)},className:se("min-w-0 shrink rounded-md border border-border bg-surface-subtle px-1.5 py-0.5 text-xs text-foreground-muted",p&&"cursor-not-allowed opacity-40"),children:[v.jsx("option",{value:"",children:"Disarm"}),a.availableModes.map(x=>v.jsx("option",{value:x,children:b5[x]},x))]})]})}function Que({trpc:e,deviceId:t,optimistic:n}){const{display:a,capPresent:s,busy:p,handleDisarm:f,handleArm:m}=k5(e,t,n);if(!s||a===void 0)return null;const h=y5[a.state];return v.jsxs("div",{className:"flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-6",children:[v.jsxs("div",{className:"flex flex-col items-center gap-2",children:[v.jsx("div",{"data-testid":"alarm-state","data-state":a.state,className:se("flex h-16 w-16 items-center justify-center rounded-full border-2",h.colorClass,F0(a.state)&&"animate-pulse"),children:v.jsx(x5,{icon:h.icon})}),v.jsx("span",{className:se("text-sm font-medium",h.colorClass,"border-0 bg-transparent"),children:h.label})]}),v.jsx(Hue,{state:a.state,availableModes:a.availableModes,busy:p,onDisarm:f,onArm:m})]})}function Vue(e,t){if(e<=0)return null;const n=Math.max(0,Math.round((t-e)/1e3));return n<60?"just now":n<3600?`${Math.floor(n/60)} min ago`:n<86400?`${Math.floor(n/3600)} h ago`:new Date(e).toLocaleDateString()}function U0({atMs:e,neverLabel:t}){const n=Vue(e,Date.now());return v.jsx("span",{className:"text-xs text-foreground-subtle","data-testid":"last-run",children:n===null?t:n})}function w5({error:e}){return e===null||e===""?null:v.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-danger",title:e,"data-testid":"last-error",children:[v.jsx(pl,{className:"h-3 w-3 shrink-0","aria-hidden":"true"}),v.jsx("span",{className:"truncate",children:e})]})}function M5(e,t,n){const{cap:a,slice:s,available:p}=gt({trpc:e,deviceId:t,cap:x=>x.scriptRunner,slice:x=>x.state.scriptRunner}),{display:f,applyOptimistic:m}=zt(s,{enabled:n??!0}),h=!p,c=f?.isRunning===!0;return{display:f,capPresent:a!==void 0,busy:h,running:c,run:()=>{a===void 0||h||c||(m({isRunning:!0}),a.run({}))},stop:()=>{a===void 0||h||!c||(m({isRunning:!1}),a.stop({}))}}}function C5({running:e,busy:t,large:n,onRun:a,onStop:s}){const p=e?"Stop":"Run";return v.jsxs("button",{type:"button","aria-label":p,title:p,disabled:t,"data-testid":"script-run","data-running":e?"true":"false",onClick:f=>{f.stopPropagation(),e?s():a()},className:se("inline-flex items-center gap-1 rounded transition-colors",n?"h-10 px-4 text-sm":"h-5 px-1.5 text-xs",e?"bg-danger text-danger-foreground hover:bg-danger/90":"bg-primary text-primary-foreground hover:bg-primary/90",t&&"cursor-not-allowed opacity-40"),children:[e?v.jsx(Hne,{className:n?"h-4 w-4":"h-3 w-3","aria-hidden":"true"}):v.jsx(Ho,{className:n?"h-4 w-4":"h-3 w-3","aria-hidden":"true"}),v.jsx("span",{children:p})]})}function Gue({trpc:e,deviceId:t,optimistic:n}){const{display:a,capPresent:s,busy:p,running:f,run:m,stop:h}=M5(e,t,n);return!s||a===void 0?null:v.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[v.jsx(C5,{running:f,busy:p,large:!1,onRun:m,onStop:h}),v.jsx(U0,{atMs:a.lastRunAt,neverLabel:"never run"})]})}function Zue({trpc:e,deviceId:t,optimistic:n}){const{display:a,capPresent:s,busy:p,running:f,run:m,stop:h}=M5(e,t,n);return!s||a===void 0?null:v.jsxs("div",{className:"flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-6",children:[v.jsxs("div",{className:"flex flex-col items-center gap-2",children:[v.jsx("div",{"data-testid":"script-state","data-running":f?"true":"false",className:se("flex h-16 w-16 items-center justify-center rounded-full border-2",f?"border-primary text-primary animate-pulse":"border-border text-foreground-subtle"),children:v.jsx(Ho,{className:"h-8 w-8","aria-hidden":"true"})}),v.jsx("span",{className:"text-sm font-medium",children:f?"Running":"Idle"}),v.jsx(U0,{atMs:a.lastRunAt,neverLabel:"never run"}),v.jsx(w5,{error:a.lastError})]}),v.jsx("div",{className:"flex justify-center",children:v.jsx(C5,{running:f,busy:p,large:!0,onRun:m,onStop:h})})]})}function A5(e,t,n){const{cap:a,slice:s,available:p}=gt({trpc:e,deviceId:t,cap:c=>c.automationControl,slice:c=>c.state.automationControl}),{display:f,applyOptimistic:m}=zt(s,{enabled:n??!0}),h=!p;return{display:f,capPresent:a!==void 0,busy:h,setEnabled:c=>{a===void 0||h||(m({enabled:c}),c?a.enable({}):a.disable({}))},trigger:()=>{a===void 0||h||a.trigger({})}}}function E5({enabled:e,busy:t,onToggle:n}){return v.jsx("button",{type:"button",role:"switch","aria-checked":e,"aria-label":"Automation enabled",disabled:t,"data-testid":"automation-enabled",onClick:a=>{a.stopPropagation(),n(!e)},className:se("inline-flex shrink-0 items-center gap-1 rounded-md border px-1.5 py-0.5","text-[11px] font-medium whitespace-nowrap transition-colors",e?"border-success/40 bg-success/10 text-success":"border-border bg-surface-subtle text-foreground-subtle",t&&"cursor-not-allowed opacity-40"),children:e?"Enabled":"Disabled"})}function R5({busy:e,large:t,onTrigger:n}){return v.jsxs("button",{type:"button","aria-label":"Trigger",title:"Run this automation now",disabled:e,"data-testid":"automation-trigger",onClick:a=>{a.stopPropagation(),n()},className:se("inline-flex items-center gap-1 rounded transition-colors",t?"h-10 px-4 text-sm":"h-5 px-1.5 text-xs","bg-primary text-primary-foreground hover:bg-primary/90",e&&"cursor-not-allowed opacity-40"),children:[v.jsx(Lr,{className:t?"h-4 w-4":"h-3 w-3","aria-hidden":"true"}),v.jsx("span",{children:"Trigger"})]})}function Kue({trpc:e,deviceId:t,optimistic:n}){const{display:a,capPresent:s,busy:p,setEnabled:f,trigger:m}=A5(e,t,n);return!s||a===void 0?null:v.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[v.jsx(E5,{enabled:a.enabled,busy:p,onToggle:f}),v.jsx(R5,{busy:p,large:!1,onTrigger:m})]})}function Wue({trpc:e,deviceId:t,optimistic:n}){const{display:a,capPresent:s,busy:p,setEnabled:f,trigger:m}=A5(e,t,n);return!s||a===void 0?null:v.jsxs("div",{className:"flex flex-col items-stretch gap-4 rounded-lg border border-border bg-surface p-6",children:[v.jsxs("div",{className:"flex flex-col items-center gap-2",children:[v.jsx("div",{"data-testid":"automation-state","data-enabled":a.enabled?"true":"false",className:se("flex h-16 w-16 items-center justify-center rounded-full border-2",a.enabled?"border-success text-success":"border-border text-foreground-subtle"),children:v.jsx(Lr,{className:"h-8 w-8","aria-hidden":"true"})}),v.jsx("span",{className:"text-sm font-medium",children:a.enabled?"Enabled":"Disabled"}),v.jsx(U0,{atMs:a.lastTriggeredAt,neverLabel:"never triggered"}),v.jsx(w5,{error:a.lastError})]}),v.jsxs("div",{className:"flex items-center justify-center gap-3",children:[v.jsx(E5,{enabled:a.enabled,busy:p,onToggle:f}),v.jsx(R5,{busy:p,large:!0,onTrigger:m})]})]})}function Yue({children:e}){return v.jsx("div",{className:"flex flex-col items-stretch gap-3 rounded-lg border border-border bg-surface p-4",children:e})}function I5(e,t){const{cap:n}=gt({trpc:e,deviceId:t,cap:a=>a.switch,slice:a=>a.state.switch});return n!==void 0}function Xue({trpc:e,deviceId:t,features:n,optimistic:a}){return I5(e,t)?v.jsx(L0,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a}):null}function Jue(e,t){const{cap:n}=gt({trpc:e,deviceId:t,cap:a=>a.lockControl,slice:a=>a.state.lockControl});return n!==void 0}function ede({trpc:e,deviceId:t,features:n,optimistic:a}){return Jue(e,t)?v.jsx(kle,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a}):null}function tde({trpc:e,deviceId:t,features:n,optimistic:a}){return I5(e,t)?v.jsxs("div",{className:"inline-flex items-center gap-2",children:[v.jsx(L0,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a}),v.jsx(wle,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a})]}):null}function nde(e,t){const{cap:n}=gt({trpc:e,deviceId:t,cap:a=>a.fanControl,slice:a=>a.state.fanControl});return n!==void 0}function ade({trpc:e,deviceId:t,features:n,optimistic:a}){return nde(e,t)?v.jsxs("div",{className:"inline-flex items-center gap-2",children:[v.jsx(L0,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a}),v.jsx(Mle,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a})]}):null}function H0(e,t){const{cap:n}=gt({trpc:e,deviceId:t,cap:a=>a.climateControl,slice:a=>a.state.climateControl});return n!==void 0}function ide({trpc:e,deviceId:t,features:n,optimistic:a}){return H0(e,t)?v.jsx(Ale,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a}):null}function rde({trpc:e,deviceId:t,features:n,optimistic:a}){return H0(e,t)?v.jsx(h5,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a}):null}function ode({trpc:e,deviceId:t,features:n,optimistic:a}){return H0(e,t)?v.jsx(h5,{trpc:e,deviceId:t,features:n,layout:"full",optimistic:a}):null}function sde(e,t){const{cap:n}=gt({trpc:e,deviceId:t,cap:a=>a.mediaPlayer,slice:a=>a.state.mediaPlayer});return n!==void 0}function lde({trpc:e,deviceId:t,features:n,optimistic:a}){return sde(e,t)?v.jsx(Nle,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a}):null}function T5(e,t){const{cap:n}=gt({trpc:e,deviceId:t,cap:a=>a.control,slice:a=>a.state.control});return n!==void 0}function cde({trpc:e,deviceId:t,features:n,optimistic:a}){return T5(e,t)?v.jsx(UN,{trpc:e,deviceId:t,features:n,layout:"compact",optimistic:a}):null}function ude({trpc:e,deviceId:t,features:n,optimistic:a}){return T5(e,t)?v.jsx(Yue,{children:v.jsx(UN,{trpc:e,deviceId:t,features:n,layout:"full",optimistic:a})}):null}var dde={cover:{InlineControl:Wle,HeroCard:Jle},valve:{InlineControl:Dce,HeroCard:Bce},humidifier:{InlineControl:Uce,HeroCard:$ce},"water-heater":{InlineControl:Gce,HeroCard:Kce},switch:{InlineControl:Xue,HeroCard:Lue},light:{InlineControl:tde,HeroCard:jue},fan:{InlineControl:ade,HeroCard:zue},sensor:{InlineControl:ace,HeroCard:pce},thermostat:{InlineControl:ide,HeroCard:kue},climate:{InlineControl:rde,HeroCard:ode},button:{InlineControl:yle,HeroCard:ble},update:{InlineControl:mce,HeroCard:fce},lock:{InlineControl:ede,HeroCard:Rue},"media-player":{InlineControl:lde,HeroCard:Uue},alarm:{InlineControl:$ue,HeroCard:Que},control:{InlineControl:cde,HeroCard:ude},weather:{InlineControl:Xce,HeroCard:tue},vacuum:{InlineControl:Mce,HeroCard:Cce},"lawn-mower":{InlineControl:Oce,HeroCard:jce},image:{InlineControl:nue,HeroCard:aue},"pet-feeder":{InlineControl:oue,HeroCard:sue},script:{InlineControl:Gue,HeroCard:Zue},automation:{InlineControl:Kue,HeroCard:Wue},dummy:{InlineControl:ece,HeroCard:tce}};Object.fromEntries(Object.values(U).map(e=>[e,dde[eee[e]]]));U.Cover+"",U.Valve+"",U.Thermostat+"",U.Climate+"",U.Control+"",U.Button+"",U.MediaPlayer+"",U.AlarmPanel+"",U.Lock+"",U.Vacuum+"",U.LawnMower+"",U.Humidifier+"",U.Switch+"",U.Siren+"",U.Light+"",U.Fan+"",U.WaterHeater+"",U.Sensor+"",U.Presence+"",U.EventEmitter+"",U.Notifier+"",U.Script+"",U.Automation+"",U.Camera+"",U.Hub+"",U.Update+"",U.Generic+"",U.Weather+"",U.Container+"",U.Image+"",U.PetFeeder+"";new Set(Object.values(U));var _5={[U.Camera]:{icon:Bne,label:"Camera"},[U.Hub]:{icon:pae,label:"Hub"},[U.Light]:{icon:Lm,label:"Light"},[U.Siren]:{icon:cm,label:"Siren"},[U.Switch]:{icon:zy,label:"Switch"},[U.Sensor]:{icon:I_,label:"Sensor"},[U.Thermostat]:{icon:Bm,label:"Thermostat"},[U.Climate]:{icon:_ne,label:"Air conditioner"},[U.Button]:{icon:__,label:"Button"},[U.EventEmitter]:{icon:Lr,label:"Event Emitter"},[U.Update]:{icon:w0,label:"Update"},[U.Generic]:{icon:rC,label:"Generic"},[U.Notifier]:{icon:om,label:"Notifier"},[U.Script]:{icon:Sae,label:"Script"},[U.Automation]:{icon:Fae,label:"Automation"},[U.Lock]:{icon:ku,label:"Lock"},[U.Cover]:{icon:Dne,label:"Cover"},[U.Valve]:{icon:hae,label:"Valve"},[U.Humidifier]:{icon:qae,label:"Humidifier"},[U.WaterHeater]:{icon:jne,label:"Water heater"},[U.Fan]:{icon:sm,label:"Fan"},[U.MediaPlayer]:{icon:lae,label:"Media player"},[U.AlarmPanel]:{icon:qm,label:"Alarm panel"},[U.Control]:{icon:M0,label:"Control"},[U.Presence]:{icon:sae,label:"Presence"},[U.Weather]:{icon:O_,label:"Weather"},[U.Vacuum]:{icon:Lne,label:"Vacuum"},[U.LawnMower]:{icon:_ae,label:"Lawn mower"},[U.Container]:{icon:rC,label:"Container"},[U.Image]:{icon:tae,label:"Image"},[U.PetFeeder]:{icon:zne,label:"Pet feeder"}},pde={[He.Siren]:{icon:cm,label:"Siren"},[He.Floodlight]:{icon:Lm,label:"Floodlight"},[He.Spotlight]:{icon:Yne,label:"Spotlight"},[He.PirSensor]:{icon:U_,label:"PIR sensor"},[He.Chime]:{icon:om,label:"Chime"},[He.Autotrack]:{icon:j_,label:"Auto-track"},[He.Nightvision]:{icon:k0,label:"Night vision"},[He.PrivacyMask]:{icon:Kne,label:"Privacy mask"},[He.Doorbell]:{icon:Zne,label:"Doorbell"},[He.BinaryHelper]:{icon:zy,label:"Binary helper"},[He.MotionSensor]:{icon:D_,label:"Motion sensor"},[He.ContactSensor]:{icon:dl,label:"Contact sensor"},[He.LeakSensor]:{icon:S0,label:"Leak sensor"},[He.SmokeSensor]:{icon:Nne,label:"Smoke sensor"},[He.COSensor]:{icon:er,label:"CO sensor"},[He.GasSensor]:{icon:lm,label:"Gas sensor"},[He.TamperSensor]:{icon:qm,label:"Tamper sensor"},[He.VibrationSensor]:{icon:G_,label:"Vibration sensor"},[He.ConnectivitySensor]:{icon:Bae,label:"Connectivity"},[He.SoundSensor]:{icon:Au,label:"Sound sensor"},[He.BinarySensor]:{icon:zy,label:"Binary sensor"},[He.TemperatureSensor]:{icon:Bm,label:"Temperature"},[He.HumiditySensor]:{icon:bl,label:"Humidity"},[He.AmbientLightSensor]:{icon:Q_,label:"Ambient light"},[He.PressureSensor]:{icon:Rp,label:"Pressure"},[He.WindSensor]:{icon:er,label:"Wind"},[He.RainSensor]:{icon:N_,label:"Rain"},[He.UvSensor]:{icon:Rae,label:"UV index"},[He.SolarRadiationSensor]:{icon:Iae,label:"Solar radiation"},[He.SoilMoistureSensor]:{icon:Eae,label:"Soil moisture"},[He.PowerSensor]:{icon:Lr,label:"Power"},[He.EnergySensor]:{icon:Lr,label:"Energy"},[He.VoltageSensor]:{icon:Lr,label:"Voltage"},[He.CurrentSensor]:{icon:Lr,label:"Current"},[He.AirQualitySensor]:{icon:er,label:"Air quality"},[He.BatterySensor]:{icon:Rp,label:"Battery"},[He.NumericSensor]:{icon:eae,label:"Numeric sensor"},[He.EnumSensor]:{icon:rae,label:"Enum sensor"},[He.DateTimeSensor]:{icon:sC,label:"Date / time"},[He.GenericSensor]:{icon:Rp,label:"Sensor"},[He.NumericControl]:{icon:M0,label:"Numeric control"},[He.SelectControl]:{icon:iae,label:"Select control"},[He.TextControl]:{icon:Pae,label:"Text control"},[He.DateTimeControl]:{icon:sC,label:"Date / time control"},[He.MobilePushNotifier]:{icon:Aae,label:"Mobile push"},[He.MessagingNotifier]:{icon:q_,label:"Messaging"},[He.EmailNotifier]:{icon:oae,label:"Email"},[He.GenericNotifier]:{icon:om,label:"Notifier"}},mde=new Set(Object.values(U));new Set(Object.values(He));function fde(e){return mde.has(e)}var rA=_5[U.Generic];pde[He.GenericSensor];function hde(e){return fde(e)?_5[e]??rA:rA}Object.values(U).map(e=>{const t=hde(e);return{id:e,label:t.label,icon:t.icon}});T.createContext(null);U.Sensor,U.Presence;d({id:l(),stableId:o(),addonId:o(),type:o(),name:o(),online:A(),disabled:A(),parentDeviceId:l().nullable(),role:o().nullable().optional(),features:w(o()).optional(),isCamera:A().optional()});Ci("camstack:player-overlays-state",null);var gde=Ci("camstack:player-overlays-actions",null);function Vve(e){const t=T.useContext(gde);T.useEffect(()=>{if(!(!t||!e))return t.setLayer(e),()=>t.removeLayer(e.id)},[t,e])}Ci("camstack:zone-editing",null);var oA=500,wv=800;function Ic(e,t,n){try{const a=e.live;if(!a)return null;const s=a.onEvent;return!s||typeof s.subscribe!="function"?null:s.subscribe({category:t},{onData:n})}catch{return null}}function up(e,t){return e?.id===t}function vde(e,t){const[n,a]=T.useState(null),[s,p]=T.useState(null),[f,m]=T.useState(null),[h,c]=T.useState("watching"),x=T.useRef(void 0),M=T.useRef(void 0),C=T.useRef(void 0),E=T.useRef(0);return T.useEffect(()=>{if(t===null)return;const R=Ic(e,"detection.motion-analysis",_=>{const j=_;if(!up(j?.source,t))return;const D=j.data;!D?.regions||D.regions.length===0||(a({zones:D.regions.map(z=>({...z.bbox,intensity:z.intensity})),frameWidth:D.frameWidth,frameHeight:D.frameHeight}),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>a(null),oA))});return()=>{R?.unsubscribe(),x.current&&clearTimeout(x.current)}},[e,t]),T.useEffect(()=>{if(t===null)return;const R=Ic(e,"detection.motion-zones-raw",_=>{const j=_;if(!up(j?.source,t))return;const D=j.data;D?.zones&&(p({boxes:D.zones.map(z=>({bbox:z.bbox,changeScore:z.changeScore})),frameWidth:D.frameSize?.width??0,frameHeight:D.frameSize?.height??0,motionScore:D.zones.length>0?D.zones.reduce((z,B)=>z+B.changeScore,0)/D.zones.length:0}),M.current&&clearTimeout(M.current),M.current=setTimeout(()=>p(null),oA))});return()=>{R?.unsubscribe(),M.current&&clearTimeout(M.current)}},[e,t]),T.useEffect(()=>{if(E.current=0,t===null)return;const R=Ic(e,"pipeline-analytics.frame-tracked",_=>{const j=_?.data;!j||j.deviceId!==t||j.detections?.length&&typeof j.detections[0]?.kind=="string"&&(E.current=Date.now(),m({detections:j.detections,frameWidth:j.frameWidth,frameHeight:j.frameHeight}),C.current&&clearTimeout(C.current),C.current=setTimeout(()=>m(null),wv))});return()=>{R?.unsubscribe(),C.current&&clearTimeout(C.current)}},[e,t]),T.useEffect(()=>{if(t===null)return;const R=Ic(e,"detection.result",_=>{const j=_;if(!up(j?.source,t)||Date.now()-E.current<wv)return;const D=j.data?.frame;D?.detections?.length&&(m({detections:D.detections,frameWidth:D.width,frameHeight:D.height}),C.current&&clearTimeout(C.current),C.current=setTimeout(()=>m(null),wv))});return()=>{R?.unsubscribe(),C.current&&clearTimeout(C.current)}},[e,t]),T.useEffect(()=>{if(t===null)return;const R=Ic(e,"detection.phase-transition",_=>{const j=_;up(j?.source,t)&&j.data?.to&&c(j.data.to)});return()=>{R?.unsubscribe()}},[e,t]),{motion:n,motionRaw:s,detection:f,phase:h}}var yde=5*6e4,bde=720*6e4,Sde="camstack:turn-servers:v1";function xde(){const e=globalThis;try{return e.localStorage??null}catch{return null}}function kde(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.fetchedAt!="number"||!Array.isArray(t.servers)?!1:t.servers.every(n=>{if(typeof n!="object"||n===null)return!1;const a=n;return!(!(typeof a.urls=="string"||Array.isArray(a.urls)&&a.urls.every(s=>typeof s=="string"))||a.username!==void 0&&typeof a.username!="string"||a.credential!==void 0&&typeof a.credential!="string")})}var wde=class{freshTtlMs;staleCapMs;storage;now;storageKey;memory=new WeakMap;inflight=new WeakMap;constructor(e={}){this.freshTtlMs=e.freshTtlMs??yde,this.staleCapMs=e.staleCapMs??bde,this.storage="storage"in e?e.storage??null:xde(),this.now=e.now??(()=>Date.now()),this.storageKey=e.storageKey??Sde}async getOrFetch(e,t){const n=this.now(),a=this.memory.get(e)??this.readStorage();if(a){const s=n-a.fetchedAt;if(s<this.freshTtlMs)return a.servers;if(s<this.staleCapMs)return this.startFetch(e,t,a),a.servers}return this.startFetch(e,t,a)}startFetch(e,t,n){const a=this.inflight.get(e);if(a)return a;const s=(async()=>{try{const p=await t();if(p.length>0){const f={servers:p,fetchedAt:this.now()};this.memory.set(e,f),this.writeStorage(f)}return p}catch{return n?.servers}})().finally(()=>{this.inflight.delete(e)});return this.inflight.set(e,s),s}readStorage(){if(this.storage)try{const e=this.storage.getItem(this.storageKey);if(e===null)return;const t=JSON.parse(e);return kde(t)?t:void 0}catch{return}}writeStorage(e){if(this.storage)try{this.storage.setItem(this.storageKey,JSON.stringify(e))}catch{}}},Mde=new wde;function N5(e,t,n=5e3){const[a,s]=T.useState([]);T.useEffect(()=>{if(t===null)return;let E=!1;const R=()=>{e.webrtcSession.listStreams.query({deviceId:t}).then(j=>{E||s(j)}).catch(()=>{})};R();const _=setInterval(R,n);return()=>{E=!0,clearInterval(_)}},[e,t,n]);const[p,f]=T.useState(null);T.useEffect(()=>{if(t===null)return;let E=!1;return e.pipelineOrchestrator&&e.pipelineOrchestrator.getCameraMetrics.query({deviceId:t}).then(R=>{E||!R||f({phase:R.phase,detectionFps:R.actualFps,avgInferenceMs:R.avgInferenceTimeMs,droppedFrames:R.droppedFrames})}).catch(()=>{}),()=>{E=!0}},[e,t]),wi("pipeline.camera-metrics-snapshot",E=>{if(t===null)return;const R=E.data;R.deviceId!==t||!R.metrics||f({phase:R.metrics.phase,detectionFps:R.metrics.actualFps,avgInferenceMs:R.metrics.avgInferenceTimeMs,droppedFrames:R.metrics.droppedFrames})});const{streams:m,hasWebrtc:h}=T.useMemo(()=>t===null||a.length===0?{streams:[],hasWebrtc:!1}:{streams:a.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,a]),c=T.useCallback(async()=>{const E=e.turnProvider;if(E)return Mde.getOrFetch(e,async()=>(await E.getTurnServers.query()).map(R=>({urls:typeof R.urls=="string"?R.urls:[...R.urls],...R.username!==void 0?{username:R.username}:{},...R.credential!==void 0?{credential:R.credential}:{}})))},[e]);T.useEffect(()=>{c()},[c]);const x=T.useCallback(async(E,R)=>{if(t===null)throw new Error("No device selected");const _=await e.webrtcSession.createSession.mutate({deviceId:t,target:E,hints:R}),j=await c();return{sessionId:_.sessionId,sdpOffer:_.sdpOffer,...j?{iceServers:j}:{}}},[e,t,c]),M=T.useCallback(async(E,R,_,j)=>{if(t===null)throw new Error("No device selected");return e.webrtcSession.handleOffer.mutate({deviceId:t,target:E,sdpOffer:R,..._!==void 0?{sessionId:_}:{},...j!==void 0?{hints:j}:{}})},[e,t]),C=T.useCallback(async(E,R)=>{if(t===null)throw new Error("No device selected");await e.webrtcSession.handleAnswer.mutate({deviceId:t,sessionId:E,sdpAnswer:R})},[e,t]);return{streams:m,hasWebrtc:h,pipelineMetrics:p,createSession:x,handleOffer:M,getIceServers:c,addIceCandidate:T.useCallback(async(E,R)=>{t!==null&&await e.webrtcSession.addIceCandidate.mutate({deviceId:t,sessionId:E,candidate:R.candidate??"",sdpMid:R.sdpMid??null,sdpMLineIndex:R.sdpMLineIndex??null}).catch(()=>{})},[e,t]),getIceCandidates:T.useCallback(async E=>t===null?{candidates:[],done:!0}:e.webrtcSession.getIceCandidates.query({deviceId:t,sessionId:E}),[e,t]),sendAnswer:C,closeSession:T.useCallback(async E=>{t!==null&&await e.webrtcSession.closeSession.mutate({deviceId:t,sessionId:E}).catch(()=>{})},[e,t]),getSessionState:T.useCallback(async E=>{if(t===null)return{pendingRenegotiation:null};try{return await e.webrtcSession.getSessionState.query({deviceId:t,sessionId:E})}catch{return{pendingRenegotiation:null}}},[e,t]),getSessionDebug:T.useCallback(async E=>{if(t===null)throw new Error("getSessionDebug: no device bound to this player");return e.webrtcSession.getSessionDebug.query({deviceId:t,sessionId:E})},[e,t])}}T.lazy(()=>il(()=>import("./MaskShapeCanvas-DI4BY7W2-DW9iUovV.js"),[],import.meta.url).then(e=>({default:e.MaskShapeCanvas})));T.lazy(()=>il(()=>import("./MotionZonesSettings-7c3yiT5E-CzRwhaU6.js"),__vite__mapDeps([0,1]),import.meta.url).then(e=>({default:e.MotionZonesSettings})));T.lazy(()=>il(()=>import("./SceneMonitorEditor-BvDy3x3k-zFGikTQ4.js"),__vite__mapDeps([3,1]),import.meta.url).then(e=>({default:e.SceneMonitorEditor})));T.lazy(()=>il(()=>import("./PrivacyMaskSettings-PkYs077O-D_lYJ0Lt.js"),__vite__mapDeps([2,1]),import.meta.url).then(e=>({default:e.PrivacyMaskSettings})));const O5=(...e)=>e.filter((t,n,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===n).join(" ").trim();const Cde=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const Ade=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,a)=>a?a.toUpperCase():n.toLowerCase());const sA=e=>{const t=Ade(e);return t.charAt(0).toUpperCase()+t.slice(1)};var Ede={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"};const Rde=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};const Ide=T.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:s="",children:p,iconNode:f,...m},h)=>T.createElement("svg",{ref:h,...Ede,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:O5("lucide",s),...!p&&!Rde(m)&&{"aria-hidden":"true"},...m},[...f.map(([c,x])=>T.createElement(c,x)),...Array.isArray(p)?p:[p]]));const Tde=(e,t)=>{const n=T.forwardRef(({className:a,...s},p)=>T.createElement(Ide,{ref:p,iconNode:t,className:O5(`lucide-${Cde(sA(e))}`,`lucide-${e}`,a),...s}));return n.displayName=sA(e),n};const _de=[["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"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["path",{d:"M9 9h.01",key:"1q5me6"}],["path",{d:"M15 9h.01",key:"x1ddxp"}]],Nde=Tde("scan-face",_de),gm={unassignedFace:"unassigned face",reviewed:"reviewed",debug:"debug",train:"train",favourite:"favourite",active:"active",loadingMore:"Loading more events"},Ode=Object.keys(gm),j5=X(o(),o());function jde(e){if(e===null||typeof e!="object")return gm;const t=e,n={...gm};for(const a of Ode){const s=t[a];typeof s=="string"&&s.trim()!==""&&(n[a]=s)}return{unassignedFace:n.unassignedFace,reviewed:n.reviewed,debug:n.debug,train:n.train,favourite:n.favourite,active:n.active,loadingMore:n.loadingMore}}const Pde="/viewer/camstack/embed/index.html",Dde=N(["reel","gallery"]),zde=N(["small","medium","large"]),Lde=N(["time","importance"]),qde=N(["text","semantic"]),Bde=["face","plate"],$0=N(Bde),Fde=["pipeline","sensor","audio"],P5=N(Fde),Ude=N(["auto","dark","light"]),Hde=tt([$("auto"),l().int().min(1).max(12)]),$de=d({label:A(),sublabel:A(),camera:A(),time:A(),badges:A()});d({view:Dde,rows:l().int().min(1).max(6).optional(),columns:Hde.optional(),thumb:zde,deviceIds:w(l().int().nonnegative()),classes:w(o()).optional(),attrs:w($0).optional(),search:o().optional(),searchMode:qde.optional(),semanticLimit:l().int().min(1).max(200).optional(),semanticMinScore:l().min(0).max(1).optional(),sort:Lde.optional(),sinceMs:l().int().nonnegative().optional(),untilMs:l().int().nonnegative().optional(),deviceNames:X(o(),o()).optional(),fields:$de,pageSize:l().int().min(1).max(500).optional(),maxRows:l().int().min(1).max(5e3).optional(),refreshMs:l().int().min(0).max(6e5).optional(),maxAgeMs:l().int().min(6e4).optional(),theme:Ude});function Q0(e){return e.startsWith("/")&&!e.startsWith("//")}function Qde(e){return e!==void 0&&e.length>0?{Authorization:`Bearer ${e}`}:{}}function Vde(e,t,n){if(!t.endsWith(n))return e;const a=t.slice(0,t.length-n.length);return a.length>0?a:e}function D5(e,t){e.token===void 0&&(Q0(e.serverUrl)||t.addIssue({code:"custom",path:["token"],message:"token is required unless serverUrl is a same-origin path served through an authenticating relay"}))}const z5=N(["reel","gallery"]),L5=N(["small","medium","large"]),q5=N(["auto","dark","light"]),B5=d({label:A(),sublabel:A(),camera:A(),time:A(),badges:A()}),F5={label:!0,sublabel:!0,camera:!0,time:!0,badges:!0},U5=N(["time","importance"]),H5=N(["text","semantic"]),$5=tt([$("auto"),l().int().min(1).max(12)]),Gde=60,Zde=5e3,Kde=600;function Wde(e){return e.view==="reel"?Math.min(e.maxRows,Kde):e.maxRows}const Yde=0,Xde=720*60*60*1e3,Jde=d({serverUrl:o().min(1),token:o().min(1).optional(),view:z5.default("reel"),rows:l().int().min(1).max(6).default(1),columns:$5.default("auto"),thumbSize:L5.default("medium"),fields:B5.default(F5),deviceIds:w(l().int().nonnegative()).default([]),classes:w(o()).default([]),attrs:w($0).catch([]).default([]),deviceNames:X(o(),o()).default({}),kindLabels:X(o(),o()).default({}),labels:j5.default({}),strings:d({empty:o().optional(),emptyFiltered:o().optional(),error:o().optional(),retry:o().optional(),end:o().optional(),loadOlder:o().optional()}).default({}),search:o().default(""),searchMode:H5.default("text"),semanticLimit:l().int().min(1).max(200).default(50),semanticMinScore:l().min(0).max(1).default(.2),sort:U5.default("time"),filterDebug:A().default(!1),filterTrain:A().default(!1),filterFavourited:A().default(!1),showStationary:A().default(!1),excludeSources:w(P5).default([]),reviewedTrackIds:w(o()).default([]),showAdminFlags:A().default(!1),sinceMs:l().int().nonnegative().optional(),untilMs:l().int().nonnegative().optional(),pageSize:l().int().min(1).max(500).default(Gde),maxRows:l().int().min(1).max(5e3).default(Zde),refreshMs:l().int().min(0).max(6e5).default(Yde),maxAgeMs:l().int().min(6e4).default(Xde),theme:q5.default("auto"),nativePullToRefresh:A().default(!1)}).superRefine(D5),Q5=d({view:z5.optional(),rows:l().int().min(1).max(6).optional(),columns:$5.optional(),thumbSize:L5.optional(),fields:B5.partial().optional(),deviceIds:w(l().int().nonnegative()).optional(),classes:w(o()).optional(),attrs:w($0).optional(),deviceNames:X(o(),o()).optional(),kindLabels:X(o(),o()).optional(),labels:j5.optional(),strings:d({empty:o().optional(),emptyFiltered:o().optional(),error:o().optional(),retry:o().optional(),end:o().optional(),loadOlder:o().optional()}).optional(),search:o().optional(),searchMode:H5.optional(),semanticLimit:l().int().min(1).max(200).optional(),semanticMinScore:l().min(0).max(1).optional(),sort:U5.optional(),filterDebug:A().optional(),filterTrain:A().optional(),filterFavourited:A().optional(),showStationary:A().optional(),excludeSources:w(P5).optional(),reviewedTrackIds:w(o()).optional(),showAdminFlags:A().optional(),sinceMs:l().int().nonnegative().nullable().optional(),untilMs:l().int().nonnegative().nullable().optional(),pageSize:l().int().min(1).max(500).optional(),maxRows:l().int().min(1).max(5e3).optional(),refreshMs:l().int().min(0).max(6e5).optional(),maxAgeMs:l().int().min(6e4).optional(),theme:q5.optional(),nativePullToRefresh:A().optional()});function V0(e){return e==="small"?80:e==="large"?132:106}function epe(e,t=1){const n=Number.isFinite(t)&&t>0?t:1,a=Math.round(V0(e)*n);return Math.max(tpe,Math.min(npe,a))}const tpe=64,npe=320,Fp=3,Up=14,ape=4;function ipe(e){return V0(e)+Fp*2+Up}function V5(e){if(e==null)return{ok:!1,error:"config is required"};const t=Jde.safeParse(e);return t.success?{ok:!0,config:t.data}:{ok:!1,error:t.error.issues.map(n=>`${n.path.join(".")||"(root)"}: ${n.message}`).join("; ")}}function rb(e,t){const n=t.fields!==void 0?{...e.fields,...t.fields}:e.fields,{sinceMs:a,untilMs:s,...p}=t,{sinceMs:f,untilMs:m,...h}=e,c=lA(a,f),x=lA(s,m);return{...h,...p,fields:n,...c!==void 0?{sinceMs:c}:{},...x!==void 0?{untilMs:x}:{}}}function lA(e,t){if(e!==null)return e??t}function rpe(e,t,n){const a=n[String(e)];return a!==void 0&&a.trim().length>0?a:t}const ope={empty:"No events",emptyFiltered:"No events match this filter",error:"Couldn't load events",retry:"Retry",end:"·",loadOlder:"Load older events"};function qs(e,t){const n=e.strings[t];return n!==void 0&&n.trim().length>0?n:ope[t]}const spe="/addon/pipeline-analytics/event-media",lpe="o",cA=64,cpe=320;function upe(e){return e.replace(/\/+$/,"")}function dpe(e){const t=Math.round(e);return Number.isFinite(t)?Math.max(cA,Math.min(cpe,t)):cA}function G5(e,t,n){const a=upe(e),s=encodeURIComponent(t);return`${a}${spe}/${lpe}/track/${s}?kind=thumbnailSmall&variant=thumb&size=${dpe(n)}`}const ppe="audio";function vm(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function mpe(e){const t=new Map;if(!Array.isArray(e))return t;for(const n of e){if(!vm(n))continue;const a=n.kinds;if(Array.isArray(a))for(const s of a){if(!vm(s))continue;const p=s.kind;if(typeof p!="string"||p.length===0)continue;const f=s.parentKind;t.set(p,typeof f=="string"&&f.length>0?f:p)}}return t}function Z5(e,t){return t.get(e)??e}const uA="audio-",dA="audio";function Ru(e){const t=e.toLowerCase();return t.startsWith(uA)?t:`${uA}${t}`}function fpe(e){const t=new Map;if(!Array.isArray(e))return t;for(const n of e){if(!vm(n))continue;const a=n.kinds;if(Array.isArray(a))for(const s of a){if(!vm(s))continue;const p=s.kind,f=s.iconId;typeof p!="string"||p.length===0||typeof f!="string"||f.length===0||t.set(p,f)}}return t}function hpe(e,t,n=!1){if(n){const s=t.get(e);if(s!==void 0)return s;if(e.toLowerCase()===dA)return dA;const p=Ru(e);return t.get(p)??p}const a=e.toLowerCase();return t.get(e)??t.get(a)??a}function gpe(e){const t=new Map;for(const[n,a]of Object.entries(e)){if(n.length===0||a.length===0)continue;t.set(n,a);const s=n.toLowerCase();t.has(s)||t.set(s,a)}return t}const G0=new Map;function Hp(e,t){return t.get(e)??t.get(e.toLowerCase())??e}function K5(e,t){const n=Ru(e);return t.get(n)??t.get(e)??e}const pA={background:"#09090b",card:"#18181b",cardHover:"#27272a",border:"#27272a",text:"#fafafa",textMuted:"#a1a1aa",skeleton:"#27272a",chip:"#3f3f46",colorScheme:"dark"},mA={background:"#ffffff",card:"#f4f4f5",cardHover:"#e4e4e7",border:"#e4e4e7",text:"#18181b",textMuted:"#71717a",skeleton:"#e4e4e7",chip:"#d4d4d8",colorScheme:"light"};function W5(e,t){return e==="light"?mA:e==="dark"||t?pA:mA}const ob="#f472b6";function vpe(e,t=!1){if(t)return ob;const n=e.toLowerCase();return n.includes("person")||n.includes("face")?"#38bdf8":n.includes("vehicle")||n.includes("car")||n.includes("truck")||n.includes("plate")?"#a78bfa":n.includes("animal")||n.includes("dog")||n.includes("cat")||n.includes("bird")?"#fbbf24":n.includes("package")||n.includes("parcel")?"#34d399":n.includes("audio")||n.includes("sound")?ob:n.includes("motion")?"#94a3b8":"#71717a"}function ype(e){return new Date(e).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}function bpe(e,t){const n=new Date(e),a=new Date(t),s=String(n.getHours()).padStart(2,"0"),p=String(n.getMinutes()).padStart(2,"0");if(n.getFullYear()===a.getFullYear()&&n.getMonth()===a.getMonth()&&n.getDate()===a.getDate())return`${s}:${p}`;const m=String(n.getDate()).padStart(2,"0"),h=String(n.getMonth()+1).padStart(2,"0");return`${m}/${h} ${s}:${p}`}const Spe=/[_\-/.]+/g;function Y5(e){return e.toLowerCase().replace(Spe," ").replace(/\s+/g," ").trim()}function xpe(e){if(e===void 0)return[];const t=e.trim().toLowerCase();if(t.length===0)return[];const n=Y5(e);return n===t||n.length===0?[t]:[t,n]}const $m=new Map,kpe=new Set(["plate-detection","plate-ocr","operator:plate-gallery"]),fA=new Set(["face-recognizer","face-embedding","operator:face-gallery"]),wpe=[],Mpe=[];function Mv(e,t){if(!Z0(e))return!1;const n=e.stepId;return typeof n=="string"&&t.has(n)}function X5(e){return e.source==="audio"}function Z0(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Pr(e){return typeof e=="string"&&e.length>0?e:void 0}function Cv(e){if(!Array.isArray(e))return[];const t=[];for(const n of e)typeof n=="string"&&n.length>0&&!t.includes(n)&&t.push(n);return t}function Cpe(e){if(!Array.isArray(e))return[];const t=[];for(const n of e){const a=Z0(n)?Pr(n.label):void 0;a!==void 0&&!t.includes(a)&&t.push(a)}return t}function Ape(e,t){if(!Z0(e))return null;const n=Pr(e.trackId),a=Pr(e.className);if(n===void 0||a===void 0||typeof e.deviceId!="number"||typeof e.firstSeen!="number"||typeof e.lastSeen!="number")return null;const s=Pr(e.label),p=Pr(e.subLabel),f=Pr(e.producingDeviceName),m=Pr(e.source),h=Cv(e.classes);return{trackId:n,deviceId:e.deviceId,cameraName:t.get(e.deviceId)??`Camera ${e.deviceId}`,className:a,...s!==void 0?{label:s}:{},...p!==void 0?{subLabel:p}:{},...typeof e.importance=="number"?{importance:e.importance}:{},firstSeen:e.firstSeen,lastSeen:e.lastSeen,state:typeof e.state=="string"?e.state:"idle",active:e.active===!0,zonesVisited:Cv(e.zonesVisited),zoneNames:Cv(e.zoneNames),classes:h.includes(a)?h:[a,...h],audioLabels:Cpe(e.audioLabels),bestEventId:Pr(e.bestEventId)??n,...f!==void 0?{producingDeviceName:f}:{},...m!==void 0?{source:m}:{},...e.hasEmbeddedFace===!0||Mv(e.subLabelMeta,fA)?{hasAssignableFace:!0}:{},...e.hasEmbeddedFace===!0&&!Mv(e.subLabelMeta,fA)?{hasUnassignedFace:!0}:{},...Mv(e.subLabelMeta,kpe)?{hasPlate:!0}:{},...e.debug===!0?{debug:!0}:{},...e.markForTrain===!0?{markForTrain:!0}:{},...e.favourited===!0?{favourited:!0}:{}}}function hA(e,t){if(!Array.isArray(e))return[];const n=[];for(const a of e){const s=Ape(a,t);s!==null&&n.push(s)}return n}function Epe(e,t){const n=new Set;for(const a of[e.className,...e.classes])a.length!==0&&(n.add(a),n.add(Z5(a,t)));if(e.audioLabels.length>0){n.add(ppe);for(const a of e.audioLabels)n.add(Ru(a))}return n}function Rpe(e,t,n=$m){if(t.size===0)return!0;const a=Epe(e,n);for(const s of t)if(a.has(s))return!0;return!1}function Ipe(e,t=$m){const n=new Set,a=s=>{for(const p of xpe(s))n.add(p)};for(const s of[e.className,...e.classes])a(s),s.length>0&&a(Z5(s,t));a(e.label),a(e.subLabel),a(e.cameraName),a(e.producingDeviceName);for(const s of e.audioLabels)a(s),a(Ru(s));for(const s of e.zoneNames)a(s);for(const s of[e.label,e.subLabel]){if(s===void 0)continue;const p=t.get(s.trim().toLowerCase());p!==void 0&&a(p)}return n}function Tpe(e,t,n=$m){const a=t.trim().toLowerCase();if(a.length===0)return!0;const s=Y5(t);for(const p of Ipe(e,n))if(p.includes(a)||s.length>0&&p.includes(s))return!0;return!1}function _pe(e,t){return!!(t.size===0||t.has("face")&&e.hasAssignableFace===!0||t.has("plate")&&e.hasPlate===!0)}function Npe(e,t={}){const n=t.debug===!0,a=t.train===!0,s=t.favourited===!0;if(!n&&!a&&!s)return!0;const p=t.reviewedTrackIds?.includes(e.trackId)===!0;return!!(n&&e.debug===!0&&!p||a&&e.markForTrain===!0||s&&e.favourited===!0)}function Ope(e,t){return t.size===0?!0:!t.has(e.source??"pipeline")}function gA(e,t,n,a=$m,s=wpe,p={},f=Mpe){const m=new Set(t),h=new Set(s),c=new Set(f);return e.filter(x=>Ope(x,c)&&Rpe(x,m,a)&&_pe(x,h)&&Tpe(x,n,a)&&Npe(x,p))}function jpe(e,t=G0){return e.producingDeviceName!==void 0?{text:Hp(e.className,t),tier:"device",fullText:e.producingDeviceName}:e.subLabel!==void 0?{text:e.subLabel,tier:"identity"}:e.label!==void 0&&e.label!==e.className?{text:Hp(e.label,t),tier:"kind"}:{text:Hp(e.className,t),tier:"class"}}function Ppe(e,t,n,a=G0){if(t)return"";const s=[n];for(const p of e.audioLabels){if(p===e.className||p===e.label)continue;const f=K5(p,a);s.includes(f)||s.push(f)}return s.join(" · ")}function vA(e,t){let n=!1;const a=e.map(s=>{const p=t.get(s.deviceId);return p===void 0||p===s.cameraName?s:(n=!0,{...s,cameraName:p})});return n?a:e}function yA(e,t){if(Object.keys(t).length===0)return e;let a=!1;const s=e.map(p=>{const f=t[p.trackId];if(f===void 0)return p;const m=zpe(p,f);return m!==p&&(a=!0),m});return a?s:e}function Dpe(e){const{debug:t,markForTrain:n,favourited:a,...s}=e;return s}function zpe(e,t){const n=t.debug===!0?!0:t.debug===!1?void 0:e.debug,a=t.markForTrain===!0?!0:t.markForTrain===!1?void 0:e.markForTrain,s=t.favourited===!0?!0:t.favourited===!1?void 0:e.favourited;return n===e.debug&&a===e.markForTrain&&s===e.favourited?e:{...Dpe(e),...n===!0?{debug:!0}:{},...a===!0?{markForTrain:!0}:{},...s===!0?{favourited:!0}:{}}}function Lpe(e){const t=e.filter(n=>n.isCamera===!0).map(n=>n.id);return t.length>0?t:e.map(n=>n.id)}const sb=11,bA=9,Av=3,qpe=8,Bpe=12,Fpe=24,Upe=.58,Hpe=.85;function $pe(e,t){return[...e].length*t*Upe}function Qpe(e){return Math.max(Fpe,e-qpe-Bpe)}function SA(e,t,n){const a=Qpe(t),s=n.maxLines===1?a:a*n.maxLines*Hpe;return $pe(e,n.fontSizePx)<=s}function Vpe(e,t){for(let n=1;n<=Av;n+=1){const a={fontSizePx:sb,maxLines:n};if(SA(e,t,a))return a}for(let n=sb-1;n>=bA;n-=1){const a={fontSizePx:n,maxLines:Av};if(SA(e,t,a))return a}return{fontSizePx:bA,maxLines:Av}}const Gpe=1e4;function J5(){try{return window.parent!==window}catch{return!0}}let lb=null;function eO(e){lb=e}function Zpe(e){if(lb===null||typeof e!="object"||e===null)return e;const t=e;if(t.type!=="log")return e;const n=typeof t.data=="object"&&t.data!==null?t.data:{};return{...t,data:{deviceId:lb,...n}}}function tn(e){const t=Zpe(e),n=window.ReactNativeWebView;if(n){n.postMessage(JSON.stringify(t));return}J5()&&window.parent.postMessage(t,"*")}function Iu(e){const t=n=>{const a=n.data;if(typeof a!="object"||a===null)return;const s=a;s.type!=="embed-command"||typeof s.command!="object"||s.command===null||e(s.command)};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)}function Kpe(e,t,n,a,s){const p=t();if(p!=null)return Promise.resolve(n(p));if(s?.urlFirst===!0){const f=a!==void 0?a():null;if(f!==null)return Promise.resolve(f)}if(!J5()){const f=a!==void 0?a():null;return f!==null?Promise.resolve(f):Promise.resolve({ok:!1,error:`config global for mode "${e}" is not set`})}return new Promise(f=>{let m;const h=c=>{const x=c.data;if(typeof x!="object"||x===null)return;const M=x;M.type==="embed-config"&&(clearTimeout(m),window.removeEventListener("message",h),f(n(M.config)))};window.addEventListener("message",h),m=setTimeout(()=>{window.removeEventListener("message",h),f({ok:!1,error:"config handshake timed out"})},Gpe),window.parent.postMessage({type:"embed-ready",mode:e},"*")})}function Qm(e,t,n,a,s){const[p,f]=T.useState(null),m=T.useRef(t);m.current=t;const h=T.useRef(n);h.current=n;const c=T.useRef(a);c.current=a;const x=s?.urlFirst===!0;return T.useEffect(()=>{let M=!0;return Kpe(e,()=>m.current(),C=>h.current(C),()=>c.current!==void 0?c.current():null,{urlFirst:x}).then(C=>{M&&f(C)}),()=>{M=!1}},[e,x]),p}const ri=1,Wpe=["window","sort","semantic-search","macro-classes","device-names","kind-labels","heartbeat","track-list","attr-filters","flag-filters","debug-status","native-pull-refresh","track-list-delta"];function Ype(e){return{v:ri,type:"ready",view:e,features:[...Wpe]}}function Xpe(e){return{v:ri,type:"error",message:e}}function $p(e,t){return t!==void 0?{v:ri,type:"state",state:e,message:t}:{v:ri,type:"state",state:e}}function Jpe(e){return{v:ri,type:"trackClick",...e}}function eme(e,t){return{v:ri,type:"trackList",tracks:e,seq:t}}function tme(e){return{v:ri,type:"trackListDelta",...e}}function xA(e,t,n,a="feed"){return{v:ri,type:"countChanged",loaded:e,shown:t,hasMore:n,mode:a}}function nme(){return{v:ri,type:"heartbeat"}}function ame(e){return{v:ri,type:"scroll",atTop:e}}function ime(){return{v:ri,type:"refreshed"}}function Ha(e){tn(e)}function ki(e,t,n="feed"){tn({type:"log",scope:n,msg:e,...t!==void 0?{data:t}:{}})}const rme=N(["full","delta"]),ome=d({debug:A().optional(),markForTrain:A().optional(),favourited:A().optional()}),sme=X(o(),ome);function Tc(e){if(typeof e!="object"||e===null)return null;const t=e,n=t.type;if(n==="refresh"||n==="reload"||n==="loadMore"||n==="scrollToTop"||n==="ping")return{type:n};if(n==="setWindow"){const s=lme.safeParse(t);return s.success?{type:"setWindow",...s.data.sinceMs!==void 0?{sinceMs:s.data.sinceMs}:{},...s.data.untilMs!==void 0?{untilMs:s.data.untilMs}:{}}:null}if(n==="setTrackListMode"){const s=rme.safeParse(t.mode);return s.success?{type:"setTrackListMode",mode:s.data}:null}if(n==="setTrackFlagPatches"){const s=sme.safeParse(t.patches);return s.success?{type:"setTrackFlagPatches",patches:s.data}:null}if(n!=="setConfig")return null;const a=Q5.safeParse(t.patch);return a.success?{type:"setConfig",patch:a.data}:null}const lme=d({sinceMs:l().int().nonnegative().nullable().optional(),untilMs:l().int().nonnegative().nullable().optional()});function cme(e){return{...e.sinceMs!==void 0?{sinceMs:e.sinceMs}:{},...e.untilMs!==void 0?{untilMs:e.untilMs}:{}}}const ume={blockedMs:0,maxLagMs:0,samples:0};function dme(e,t,n){if(n<=t)return ume;let a=0,s=0,p=0;for(const f of e){const m=f.at-f.lagMs,h=Math.min(f.at,n)-Math.max(m,t);h<=0||(a+=h,s=Math.max(s,f.lagMs),p+=1)}return{blockedMs:Math.round(a),maxLagMs:Math.round(s),samples:p}}function cb(e,t){const n=Math.min(Math.round(e),t.blockedMs);return{ms:Math.round(e),blockedMs:n,netMs:Math.max(0,Math.round(e)-n),maxLagMs:t.maxLagMs,lagSamples:t.samples}}const pme=250,kA=600,mme=8;let Hs=[],wA=null;function fme(e){e.lagMs<mme||(Hs.push(e),Hs.length>kA&&(Hs=Hs.slice(Hs.length-kA)))}function ub(e,t){return dme(Hs,e,t)}function hme(e=pme,t=()=>performance.now(),n=(a,s)=>{const p=setInterval(a,s);return()=>clearInterval(p)}){if(wA!==null)return;let a=t()+e;wA={stop:n(()=>{const p=t();fme({at:p,lagMs:Math.max(0,p-a)}),a=p+e},e)}}function gme(e){return e.responseEnd<=0||e.requestStart===0&&e.responseStart===0?null:{totalMs:Math.round(e.responseEnd-e.startTime),queuedMs:Math.round(Math.max(0,e.requestStart-e.startTime)),ttfbMs:Math.round(Math.max(0,e.responseStart-e.requestStart)),transferSize:Math.round(e.transferSize??0)}}function vme(e,t){let n=null;for(const a of e)a.startTime+1<t||(n===null||a.startTime<n.startTime)&&(n=a);return n}function yme(){if(typeof performance>"u")return null;const e=performance;if(typeof e!="object"||e===null||!("getEntriesByName"in e))return null;const t=e.getEntriesByName;return typeof t!="function"?null:{getEntriesByName:(n,a)=>t.call(performance,n,a)}}function bme(e,t,n=yme()){if(n===null)return null;try{const a=vme(n.getEntriesByName(e,"resource"),t);return a===null?null:gme(a)}catch{return null}}const Sme=250,Yi=new Map,Ev=new Map,xme=6,kme=1e4,wme=5e3,Rv=[250,750];let Iv=5;const MA=32;function Mme(e){try{const t=new URL(e),n=t.pathname.lastIndexOf("/"),a=n>=0?`${t.pathname.slice(0,n)}/<id>`:t.pathname;return{origin:t.origin,path:a,query:t.search}}catch{const t=e.slice(0,MA);return{origin:"(unparseable)",path:e.length>MA?`${t}…`:t,query:""}}}function Cme(e){return e instanceof Error?{errorName:e.name,errorMessage:e.message}:{errorName:"unknown",errorMessage:String(e)}}let ym=0,tO=[];async function Ame(){if(ym<xme){ym+=1;return}await new Promise(e=>{tO.push(e)})}function Eme(){const e=tO.shift();if(e!==void 0){e();return}ym=Math.max(0,ym-1)}function Rme(e,t){for(Yi.set(e,t);Yi.size>Sme;){const n=Yi.keys().next();if(n.done===!0)break;const a=Yi.get(n.value);Yi.delete(n.value),a!==void 0&&URL.revokeObjectURL(a)}}async function nO(e,t){const n=Yi.get(e);if(n!==void 0)return Yi.delete(e),Yi.set(e,n),{status:"ready",src:n};const a=Ev.get(e);if(a!==void 0)return a;const s=(async()=>{const p=performance.now(),f=Mme(e);let m={lastStatus:null,errorName:null,errorMessage:null},h=0;try{for(let c=0;c<=Rv.length;c+=1){const x=performance.now();await Ame(),h+=performance.now()-x;const M=performance.now(),C=new AbortController,E=setTimeout(()=>C.abort(),kme);try{const _=await fetch(e,{headers:Qde(t),signal:C.signal});if(_.ok){const j=Math.round(performance.now()-M),D=await _.blob(),z=Math.round(performance.now()-p),B=Math.round(performance.now()-M),L=URL.createObjectURL(D);if(Rme(e,L),Iv>0||z>=500){Iv=Math.max(0,Iv-1);const G=bme(e,M),ae=cb(performance.now()-M,ub(M,performance.now()));ki("thumbnail ready",{ms:z,queuedMs:Math.round(h),headersMs:j,blobMs:B-j,blockedMs:ae.blockedMs,maxLagMs:ae.maxLagMs,netTotalMs:G?.totalMs??null,netQueuedMs:G?.queuedMs??null,netTtfbMs:G?.ttfbMs??null,bytes:D.size,attempt:c+1,serverTiming:_.headers?.get("server-timing")??null},"media")}return{status:"ready",src:L}}if(_.status===401||_.status===403||_.status===404)return ki("thumbnail missing",{ms:Math.round(performance.now()-p),queuedMs:Math.round(h),status:_.status,attempt:c+1,...f},"media"),{status:"missing"};m={lastStatus:_.status,errorName:null,errorMessage:null}}catch(_){m={lastStatus:null,...Cme(_)}}finally{clearTimeout(E),Eme()}const R=Rv[c];R!==void 0&&await new Promise(_=>setTimeout(_,R))}return ki("thumbnail transient failure",{ms:Math.round(performance.now()-p),queuedMs:Math.round(h),attempts:Rv.length+1,...m,...f},"media"),{status:"transient-failure"}}finally{Ev.delete(e)}})();return Ev.set(e,s),s}async function Ime(e,t){const n=await nO(e,t);return n.status==="ready"?n.src:null}function Tme(e,t){const[n,a]=T.useState({status:"loading"}),[s,p]=T.useState(0);return T.useEffect(()=>{if(e===null){a({status:"loading"});return}const f=Yi.get(e);if(f!==void 0){a({status:"ready",src:f});return}let m=!0,h;return a({status:"loading"}),nO(e,t).then(c=>{if(m){if(c.status==="ready"){a({status:"ready",src:c.src});return}if(c.status==="missing"){a({status:"failed"});return}h=setTimeout(()=>p(x=>x+1),wme)}}),()=>{m=!1,h!==void 0&&clearTimeout(h)}},[e,t,s]),n}function _me(e){const t=e?.clientHeight??0;return t>0?t:600}function Nme(e,t){const{root:n,disabled:a}=t,[s,p]=T.useState(a===!0),f=T.useRef(s);return f.current=s,T.useEffect(()=>{if(f.current)return;if(a===!0){p(!0);return}const m=e.current;if(!m||typeof IntersectionObserver!="function"){p(!0);return}const h=new IntersectionObserver(c=>{c.some(x=>x.isIntersecting)&&(p(!0),h.disconnect())},{root:n,rootMargin:`${_me(n)}px`});return h.observe(m),()=>h.disconnect()},[e,n,a]),s}const dp={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:14,height:14,padding:"0 3px",borderRadius:4,background:"#000000B3",color:"#fff",fontSize:9,fontWeight:700,lineHeight:"14px",letterSpacing:.2},Ome=T.memo(function({row:t,serverUrl:n,token:a,thumbPx:s,width:p,heroPx:f,fields:m,palette:h,nowMs:c,variant:x,iconId:M,kindLabels:C=G0,labels:E=gm,scrollRoot:R,eagerImages:_,showAdminFlags:j,onClick:D,onAssignFace:z}){const B=T.useRef(null),G=Nme(B,{root:R,..._===!0?{disabled:!0}:{}})?G5(n,t.trackId,s):null,ae=Tme(G,a),V=vpe(t.className,X5(t)),F=x==="reel",fe=f+Fp*2+Up,ke=jpe(t,C),Me=ke.tier!=="class",Ae=!Me,Ee=Vpe(ke.text,f),we=m.label,ge=Ppe(t,we,ke.text,C),Q=bC(M),oe=v.jsxs("div",{style:{position:"relative",width:F?f:"100%",height:F?f:void 0,aspectRatio:F?void 0:"1 / 1",borderRadius:10,overflow:"hidden",background:h.skeleton,border:`1px solid ${h.border}`,boxSizing:"border-box",flex:"0 0 auto"},children:[v.jsx("div",{className:ae.status==="loading"?"events-skeleton":void 0,"data-testid":"card-image-backing",style:{position:"absolute",inset:0,background:ae.status==="failed"?`${V}22`:h.skeleton,boxShadow:`inset 0 0 0 1px ${h.border}`}}),ae.status==="ready"?v.jsx("img",{src:ae.src,alt:"",draggable:!1,style:{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover",display:"block"}}):null,m.label&&v.jsxs("div",{style:{position:"absolute",left:4,right:4,bottom:4,display:"flex",flexWrap:F?"nowrap":"wrap",gap:3,alignItems:"center",pointerEvents:"none"},children:[Ae&&v.jsx("span",{"data-testid":"card-class-glyph",title:Hp(t.className,C),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",background:`${V}E6`,color:"#fff",borderRadius:4,padding:"2px 4px",flex:"0 0 auto"},children:v.jsx(Q,{size:13,color:"#fff"})}),Me&&v.jsx("span",{"data-testid":"card-title",title:ke.fullText??ke.text,style:{background:"#000000B3",color:"#fff",fontSize:F?sb:Ee.fontSizePx,fontWeight:700,lineHeight:1.35,padding:"2px 6px",borderRadius:4,overflow:"hidden",minWidth:0,...F?{textOverflow:"ellipsis",whiteSpace:"nowrap"}:{display:"-webkit-box",WebkitLineClamp:Ee.maxLines,WebkitBoxOrient:"vertical",whiteSpace:"normal",overflowWrap:"anywhere"}},children:ke.text}),t.hasUnassignedFace===!0&&v.jsxs("span",{...z===void 0?{}:{role:"button",tabIndex:0},"data-testid":"card-face-unassigned",title:E.unassignedFace,onClick:q=>{q.stopPropagation(),z?.(t)},onKeyDown:q=>{z!==void 0&&(q.key!=="Enter"&&q.key!==" "||(q.stopPropagation(),q.preventDefault(),z(t)))},style:{border:"none",cursor:z?"pointer":"default",pointerEvents:z?"auto":"none",display:"inline-flex",alignItems:"center",gap:3,background:"#000000B3",color:"#fff",fontSize:11,fontWeight:700,lineHeight:1.35,padding:"2px 6px",borderRadius:4,flex:"0 0 auto"},children:[v.jsx(Nde,{size:13,color:"#fff"}),"?"]}),!F&&t.audioLabels.filter(q=>q!==t.className&&q!==t.label).map(q=>{const W=Ru(q),le=bC(W);return v.jsx("span",{title:K5(q,C),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",background:`${ob}E6`,color:"#fff",borderRadius:4,padding:"2px 4px",flex:"0 0 auto"},children:v.jsx(le,{size:13,color:"#fff"})},`audio-${q}`)})]}),(j===!0&&(t.debug===!0||t.reviewed===!0||t.markForTrain===!0)||t.favourited===!0)&&v.jsxs("span",{"data-testid":"card-flags",style:{position:"absolute",top:4,right:m.badges&&t.active?16:4,display:"inline-flex",gap:2,zIndex:2},children:[j===!0&&t.reviewed===!0&&v.jsx("span",{title:E.reviewed,style:dp,children:"✓"}),j===!0&&t.debug===!0&&t.reviewed!==!0&&v.jsx("span",{title:E.debug,style:dp,children:"D"}),j===!0&&t.markForTrain===!0&&v.jsx("span",{title:E.train,style:dp,children:"T"}),t.favourited===!0&&v.jsx("span",{title:E.favourite,style:{...dp,color:"#fbbf24"},children:"★"})]}),m.badges&&t.active&&v.jsx("span",{title:E.active,style:{position:"absolute",top:4,right:4,width:8,height:8,borderRadius:999,background:"#22c55e",boxShadow:"0 0 0 2px rgba(0,0,0,0.35)"}}),m.badges&&!F&&t.importance!==void 0&&v.jsxs("span",{"data-testid":"card-importance",style:{position:"absolute",top:4,left:4,display:"inline-flex",alignItems:"center",gap:2,background:"#000000B3",color:"#fff",fontSize:10,fontWeight:700,fontVariantNumeric:"tabular-nums",padding:"1px 5px",borderRadius:8},children:["★",Math.round(t.importance*100)]})]});if(F)return v.jsxs("button",{ref:B,type:"button",onClick:()=>D(t),"data-track-id":t.trackId,"data-device-id":t.deviceId,style:{width:p,height:fe,minWidth:p,minHeight:fe,display:"flex",flexDirection:"column",alignItems:"center",padding:0,border:"none",background:"transparent",cursor:"pointer",font:"inherit",color:h.text,boxSizing:"border-box",contain:"layout paint",overflow:"hidden"},children:[oe,v.jsxs("div",{style:{paddingTop:Fp,paddingBottom:Fp,paddingLeft:4,paddingRight:4,display:"flex",flexDirection:"column",alignItems:"center",maxWidth:"100%",boxSizing:"border-box"},children:[m.camera&&t.producingDeviceName!==void 0&&v.jsx("span",{style:{fontSize:11,lineHeight:`${Up}px`,fontWeight:600,maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t.producingDeviceName}),m.time&&v.jsx("span",{"data-testid":"card-time",style:{fontSize:11,lineHeight:`${Up}px`,color:h.textMuted,fontVariantNumeric:"tabular-nums",whiteSpace:"nowrap"},children:ype(t.lastSeen)})]})]});const xe=m.camera,Ie=t.cameraName,he=xe||m.time||m.sublabel&&ge.length>0;return v.jsxs("button",{ref:B,type:"button",onClick:()=>D(t),"data-track-id":t.trackId,"data-device-id":t.deviceId,style:{width:p,display:"flex",flexDirection:"column",gap:4,padding:0,border:"none",background:"transparent",cursor:"pointer",textAlign:"left",font:"inherit",color:h.text,boxSizing:"border-box"},children:[oe,he&&v.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:1,minWidth:0,paddingTop:2,paddingBottom:2},children:[m.sublabel&&ge.length>0&&v.jsx("span",{style:{fontSize:11,color:h.textMuted,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:ge}),xe&&v.jsx("span",{"data-testid":"card-camera",title:Ie,style:{fontSize:12,fontWeight:600,lineHeight:"15px",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:Ie}),m.time&&v.jsx("span",{"data-testid":"card-time",style:{fontSize:11,lineHeight:"14px",color:h.textMuted,fontVariantNumeric:"tabular-nums",whiteSpace:"nowrap",flex:"0 0 auto"},children:bpe(t.lastSeen,c)}),m.badges&&t.zonesVisited.length>0&&v.jsx("span",{style:{fontSize:10,color:h.textMuted,background:h.chip,borderRadius:5,padding:"1px 5px",alignSelf:"flex-start",marginTop:2,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"100%"},children:t.zonesVisited.join(" · ")})]})]})});function jme(e){return{listRecentTracks:t=>e.trpcClient.pipelineAnalytics.listRecentTracks.query(t),listDevices:()=>e.trpcClient.deviceManager.listAll.query({isCamera:!0,projection:"slim"}),searchObjectEvents:t=>e.trpcClient.pipelineAnalytics.searchObjectEvents.query(t),listEventKinds:t=>e.trpcClient.pipelineAnalytics.listEventKindsBatch.query({deviceIds:t})}}const Pme=2e3,Dme=1e3;function CA(e,t){const n=Math.max(1,Math.floor(e)),a=Math.max(1,Math.floor(t)),s=Math.max(1,Math.floor(Pme/a));return Math.min(n,Dme,s)}function K0(e,t){return e.lastSeen!==t.lastSeen?t.lastSeen-e.lastSeen:e.trackId===t.trackId?0:e.trackId<t.trackId?1:-1}const Pc={rows:[],cursor:null,exhausted:!1,rebuild:null},zme=8;function db(e,t){const n=new Map;for(const a of e)n.set(a.trackId,a);for(const a of t)n.set(a.trackId,a);return[...n.values()].sort(K0)}function Lme(e,t,n){const a=e.rebuild;if(a===null)return{rows:db(e.rows,t),cursor:n,exhausted:n===null,rebuild:null};const s=db(a.rows,t),p=a.pages+1,f=s.length>=a.floor;return n===null||f||p>=zme?{rows:s,cursor:n,exhausted:n===null,rebuild:null}:{...e,rebuild:{rows:s,cursor:n,exhausted:!1,floor:a.floor,pages:p}}}function qme(e){return e.rows.length===0?Pc:{...e,rebuild:{rows:[],cursor:null,exhausted:!1,floor:e.rows.length,pages:0}}}function Bme(e){return e.rebuild===null?e:{...e,rebuild:null}}function Fme(e){return e.rebuild!==null}function AA(e){return e.rebuild!==null?e.rebuild.cursor:e.cursor}function Ume(e,t,n){const a=new Set(e.rows.map(p=>p.trackId));let s=0;for(const p of t)a.has(p.trackId)||(s+=1);return{state:{...e,rows:db(e.rows,t)},gap:n!==null,deltaCursor:n,added:s}}function Hme(e){const t=e.rows[0];return t!==void 0?t.lastSeen:null}function aO(e,t){const n=e.rebuild??e;return n.exhausted?"exhausted":n.rows.length<Math.max(1,t)?"more":"ceiling"}function EA(e,t){return aO(e,t)==="more"}function $me(e,t){return Math.max(0,e-Math.max(0,t))}function Qme(e){const t=e.sinceMs??$me(e.anchorMs,e.maxAgeMs);return e.untilMs!==void 0?{since:t,until:e.untilMs}:{since:t}}function Vme(e,t){return e===void 0||e>t}function iO(e,t){return t==="time"?e:[...e].sort((n,a)=>{const s=n.importance??-1,p=a.importance??-1;return s!==p?p-s:K0(n,a)})}const RA=200,Gme=45;function pb(e){return{trackId:e.trackId,deviceId:e.deviceId,bestEventId:e.bestEventId,className:e.className,firstSeen:e.firstSeen,lastSeen:e.lastSeen}}function mb(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function Zme(e,t){const n=t.map(E=>E.trackId);if(mb(e,n))return{kind:"unchanged"};if(e.length===0)return{kind:"reset"};const a=new Set(e);let s=n.length-1,p=e.length-1,f=n.length;for(;s>=0&&!a.has(n[s]);)f=s,s-=1;const m=[];for(;s>=0&&p>=0;){if(n[s]===e[p]){s-=1,p-=1;continue}m.push(e[p]),p-=1}const h=s+1;for(;p>=0;)m.push(e[p]),p-=1;const c=new Set(m),x=[...n.slice(0,h),...e.filter(E=>!c.has(E)),...n.slice(f)];if(!mb(x,n))return{kind:"reset"};const M=h+(n.length-f);return RA*M+Gme*m.length>=RA*n.length?{kind:"reset"}:{kind:"delta",prepend:t.slice(0,h).map(pb),append:f===n.length?[]:t.slice(f).map(pb),removeIds:m}}const Kme={seq:0,sentIds:null,mode:"full"};function Qp(e,t,n){const a=e.seq+1;return{state:{seq:a,sentIds:n,mode:e.mode},message:eme(t.map(pb),a)}}function Wme(e,t){const n=t.map(p=>p.trackId);if(e.sentIds===null)return Qp(e,t,n);if(e.mode==="full")return mb(e.sentIds,n)?{state:e,message:null}:Qp(e,t,n);const a=Zme(e.sentIds,t);if(a.kind==="unchanged")return{state:e,message:null};if(a.kind==="reset")return Qp(e,t,n);const s=e.seq+1;return{state:{seq:s,sentIds:n,mode:e.mode},message:tme({seq:s,baseSeq:e.seq,prepend:a.prepend,append:a.append,removeIds:a.removeIds,count:n.length})}}function Yme(e,t,n){const a=n.map(s=>s.trackId);return Qp({...e,mode:t},n,a)}function Xme(e){let t=Kme,n=[];const a=s=>{t=s.state,s.message!==null&&e(s.message)};return{report:s=>{n=s,a(Wme(t,s))},setMode:s=>{a(Yme(t,s,n))}}}function Jme(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function _c(e){return typeof e=="string"&&e.length>0?e:void 0}function efe(e,t){if(!Jme(e))return null;const n=_c(e.id),a=_c(e.className);if(n===void 0||a===void 0||typeof e.deviceId!="number"||typeof e.timestamp!="number"||typeof e.score!="number")return null;const s=_c(e.trackId),p=typeof e.mediaId=="number"?String(e.mediaId):void 0,f=_c(e.label),m=_c(e.subLabel);return{trackId:s??n,deviceId:e.deviceId,cameraName:t.get(e.deviceId)??`Camera ${e.deviceId}`,className:a,...f!==void 0?{label:f}:{},...m!==void 0?{subLabel:m}:{},...typeof e.importance=="number"?{importance:e.importance}:{},firstSeen:e.timestamp,lastSeen:e.timestamp,state:"idle",active:!1,zonesVisited:[],zoneNames:[],classes:[a],audioLabels:[],bestEventId:p??s??n,score:e.score}}function tfe(e,t){if(!Array.isArray(e))return[];const n=new Map;for(const a of e){const s=efe(a,t);if(s===null)continue;const p=n.get(s.trackId);(p===void 0||s.score>p.score)&&n.set(s.trackId,s)}return[...n.values()].sort((a,s)=>a.score!==s.score?s.score-a.score:s.lastSeen-a.lastSeen)}function nfe(e,t,n){const a=new Map;for(const s of e)a.set(s.trackId,s);for(const s of t)a.set(s.trackId,s);return iO([...a.values()].sort(K0),n)}function afe(e,t){if(e.length===0)return e;const n=Math.max(1,Math.floor(t.rowsPerColumn)),a=Math.max(1,t.cardWidth+t.gap),s=Math.max(0,Math.floor(Math.max(0,t.scrollLeft)/a)),p=t.viewportWidth>0?t.viewportWidth:t.cardWidth,f=Math.max(s+1,Math.ceil((Math.max(0,t.scrollLeft)+p*2)/a));return e.slice(s*n,Math.min(e.length,f*n))}const ife=34;function rfe(e){const t=Math.max(0,e.gap),n=Math.max(1,e.cardWidth),a=Math.max(0,e.viewportWidth),s=e.columns??"auto",p=s==="auto"?Math.max(1,Math.floor((a+t)/(n+t))):Math.max(1,Math.floor(s)),f=a>0?(a-(p-1)*t)/p:n;return{columns:p,columnWidth:f,rowStridePx:Math.max(1,f+ife+t)}}const ofe=2,sfe={startRow:0,endRow:0,padTopPx:0,padBottomPx:0,totalPx:0};function lfe(e){const t=Math.max(0,Math.floor(e.rowCount));if(t===0)return sfe;const n=e.estimatedRowPx>0?e.estimatedRowPx:1,a=j=>{const D=e.measuredPx.get(j);return D!==void 0&&D>0?D:n};let s=0;for(let j=0;j<t;j+=1)s+=a(j);if(e.viewportHeight<=0)return{startRow:0,endRow:t,padTopPx:0,padBottomPx:0,totalPx:s};const p=Math.max(0,e.scrollTop),f=p+e.viewportHeight;let m=0,h=0;for(;m<t-1&&h+a(m)<=p;)h+=a(m),m+=1;let c=m,x=h;for(;c<t&&x<f;)x+=a(c),c+=1;const M=Math.max(0,Math.floor(e.overscanRows??ofe)),C=Math.max(0,m-M),E=Math.min(t,c+M);let R=0;for(let j=0;j<C;j+=1)R+=a(j);let _=0;for(let j=C;j<E;j+=1)_+=a(j);return{startRow:C,endRow:E,padTopPx:R,padBottomPx:Math.max(0,s-R-_),totalPx:s}}function cfe(e,t){let n=0,a=0;for(const s of e.values())s>0&&(n+=s,a+=1);return a===0?Math.max(1,t):Math.max(1,n/a)}const ufe=24,dfe=2;function pfe(e,t,n){if(e.length===0)return e;const a=Math.max(1,Math.floor(n)),s=Math.max(0,t.startRow)*a,p=Math.max(1,t.endRow-t.startRow+dfe),f=Math.min(e.length,s+Math.min(p*a,ufe));return e.slice(s,f)}function mfe(e){const{rowCount:t,scrollTop:n,viewportHeight:a,fallbackRowPx:s,geometryKey:p}=e,f=T.useRef(new Map),m=T.useRef(new Map),[h,c]=T.useState(()=>new Map),x=T.useRef(p);T.useEffect(()=>{x.current!==p&&(x.current=p,m.current=new Map,c(new Map))},[p]);const M=T.useCallback(E=>{const R=m.current.get(E);if(R!==void 0)return R;const _=j=>{j===null?f.current.delete(E):f.current.set(E,j)};return m.current.set(E,_),_},[]);return T.useLayoutEffect(()=>{let E=null;for(const[R,_]of f.current){const j=Math.round(_.getBoundingClientRect().height);j<=0||h.get(R)!==j&&(E??=new Map(h),E.set(R,j))}E!==null&&c(E)}),{window:T.useMemo(()=>lfe({rowCount:t,scrollTop:n,viewportHeight:a,estimatedRowPx:cfe(h,s),measuredPx:h}),[t,n,a,s,h]),measureRow:M}}const ffe=1,hfe=Pde,gfe=["label","sublabel","camera","time","badges"];function Bs(e,t){const n=e.get(t);if(n===null||n.trim()==="")return;const a=Number.parseInt(n,10);return Number.isFinite(a)?a:void 0}function vfe(e){if(e===null)return;if(e.trim()==="")return[];const t=[];for(const n of e.split(",")){const a=Number.parseInt(n.trim(),10);Number.isFinite(a)&&a>=0&&t.push(a)}return t}function fb(e){if(e!==null)return e.trim()===""?[]:e.split(",").map(t=>t.trim()).filter(t=>t.length>0)}function yfe(e){if(e===null)return;const t=new Set((fb(e)??[]).map(a=>a.toLowerCase())),n={};for(const a of gfe)n[a]=t.has(a.toLowerCase());return n}function bfe(e,t){const n=e.startsWith("?")?e.slice(1):e;for(const a of n.split("&")){if(a.length===0)continue;const s=a.indexOf("=");if((s===-1?a:a.slice(0,s))===t)return s===-1?"":a.slice(s+1)}return null}function Sfe(e){if(e===null)return;const t={};if(e.trim()==="")return t;for(const n of e.split(",")){const a=n.indexOf(":");if(a<=0)continue;const s=n.slice(0,a).trim();if(!/^\d+$/.test(s))continue;let p;try{p=decodeURIComponent(n.slice(a+1))}catch{continue}p.trim().length!==0&&(t[s]=p)}return t}function IA(e,t){const n=e.get(t);if(n===null)return;if(n.trim()==="")return null;const a=Number.parseInt(n,10);return Number.isFinite(a)&&a>=0?a:void 0}function xfe(e){if(e===null||e.trim()==="")return;if(e==="auto")return"auto";const t=Number.parseInt(e,10);return Number.isFinite(t)?t:void 0}function kfe(e){const t=e.startsWith("#")?e.slice(1):e;if(t.length===0)return null;const n=new URLSearchParams(t).get("t");return n!==null&&n.length>0?n:null}function rO(e){const t=new URLSearchParams(e.startsWith("?")?e.slice(1):e),n=t.get("v");if(n===null)return null;if(Number.parseInt(n,10)!==ffe)return{ok:!1,error:`unsupported events URL version "${n}"`};const s={},p=t.get("view");p!==null&&(s.view=p);const f=Bs(t,"rows");f!==void 0&&(s.rows=f);const m=xfe(t.get("cols"));m!==void 0&&(s.columns=m);const h=t.get("thumb");h!==null&&(s.thumbSize=h);const c=yfe(t.get("fields"));c!==void 0&&(s.fields=c);const x=vfe(t.get("devices"));x!==void 0&&(s.deviceIds=x);const M=fb(t.get("classes"));M!==void 0&&(s.classes=M);const C=fb(t.get("attrs"));C!==void 0&&(s.attrs=C);const E=t.get("q");E!==null&&(s.search=E);const R=Bs(t,"page");R!==void 0&&(s.pageSize=R);const _=Bs(t,"max");_!==void 0&&(s.maxRows=_);const j=Bs(t,"refresh");j!==void 0&&(s.refreshMs=j);const D=Bs(t,"age");D!==void 0&&(s.maxAgeMs=D);const z=t.get("theme");z!==null&&(s.theme=z);const B=t.get("sort");B!==null&&(s.sort=B);const L=t.get("smode");L!==null&&(s.searchMode=L);const G=Bs(t,"slimit");G!==void 0&&(s.semanticLimit=G);const ae=t.get("sscore");if(ae!==null&&ae.trim()!==""){const Me=Number.parseFloat(ae);Number.isFinite(Me)&&(s.semanticMinScore=Me)}const V=IA(t,"since");V!==void 0&&(s.sinceMs=V);const F=IA(t,"until");F!==void 0&&(s.untilMs=F);const fe=Sfe(bfe(e,"names"));fe!==void 0&&(s.deviceNames=fe);const ke=Q5.safeParse(s);return ke.success?{ok:!0,patch:ke.data}:{ok:!1,error:ke.error.issues.map(Me=>`${Me.path.join(".")||"(root)"}: ${Me.message}`).join("; ")}}function wfe(e,t,n,a=""){const s=rO(e);if(s===null)return null;if(!s.ok)return{ok:!1,error:s.error};const p=Vde(n,a,hfe),f=kfe(t);return f===null&&!Q0(p)?null:V5({serverUrl:p,...f!==null?{token:f}:{},fields:F5,...s.patch})}function Mfe(){const e=wfe(location.search,location.hash,location.origin,location.pathname);return e!==null&&location.hash!==""&&history.replaceState(null,"",location.pathname+location.search),e}function Cfe(){const e=rO(location.search);return e===null||!e.ok?null:e.patch}function Afe(e,t){return!e.ok||t===null?e:{ok:!0,config:rb(e.config,t)}}const TA=5,_A=3,Efe=[300,900];let Rfe=0;function Ife(e){if(typeof e!="object"||e===null)return!1;const t=e;return"tracks"in t&&(t.nextCursor===null||typeof t.nextCursor=="string")}const Tfe=[],_fe=/^(10\.|127\.|192\.168\.|169\.254\.|172\.(1[6-9]|2\d|3[01])\.)/;function Nfe(e){let t;try{const p=Q0(e)&&typeof location<"u"?location.href:void 0;t=new URL(e,p).host}catch{return"unknown:(unparseable)"}const n=t.trim().toLowerCase().replace(/^\[([^\]]*)\].*$/,"$1"),a=n.lastIndexOf(":"),s=a!==-1&&n.indexOf(":")===a?n.slice(0,a):n;return s==="localhost"||s==="::1"||s.startsWith("127.")?`loopback:${t}`:_fe.test(s)||/^f[cd][0-9a-f]{2}:/.test(s)||s.startsWith("fe80:")||s.endsWith(".local")?`lan:${t}`:s.includes(".")?`public:${t}`:`unknown:${t}`}function Ofe(e){const{client:t,deviceIds:n,nameById:a,pageSize:s,maxRows:p,refreshMs:f,maxAgeMs:m}=e,{sinceMs:h,untilMs:c,devicesResolved:x}=e,M=e.includeStationary===!0,C=e.excludeSources??Tfe,E=[...C].toSorted().join(","),[R,_]=T.useState(Pc),[j,D]=T.useState(!1),[z,B]=T.useState(!1),[L,G]=T.useState(null),[ae,V]=T.useState(0),[F,fe]=T.useState(p),ke=T.useRef(p);ke.current=F;const Me=T.useRef(Pc);Me.current=R;const Ae=T.useRef(!1),Ee=T.useRef(!1),we=T.useRef(0),ge=T.useRef(null),Q=T.useRef(Date.now()),oe=T.useRef(a);oe.current=a;const xe=T.useRef(e.channel);xe.current=e.channel;const Ie=T.useRef(null);T.useEffect(()=>{hme()},[]);const he=n.join(","),q=T.useCallback(async(_e,Ye=0)=>{const Re=`feed-${String(++Rfe)}`,Qe=performance.now();try{const Xe=await t.listRecentTracks(_e),Nt=performance.now(),rt=cb(Nt-Qe,ub(Qe,Nt)),$t={requestId:Re,waitMs:Math.round(Ye),...rt};return Ife(Xe)?{ok:!0,page:Xe,timing:$t}:(ki("request invalid",{...$t,channel:xe.current}),{ok:!1,message:"unexpected response shape"})}catch(Xe){const Nt=Xe instanceof Error?Xe.message:String(Xe),rt=performance.now();return ki("listRecentTracks failed",{error:Nt,devices:_e.deviceIds.length,limit:_e.limit,since:_e.since,cursor:_e.cursor??null,requestId:Re,channel:xe.current,waitMs:Math.round(Ye),...cb(rt-Qe,ub(Qe,rt))}),{ok:!1,message:Nt}}},[t]),W=T.useCallback((_e,Ye)=>{ki("request complete",{..._e,channel:xe.current,...Ye})},[]),le=T.useCallback(()=>{if(Ae.current){Ee.current=!0,Ie.current===null&&(Ie.current=performance.now());return}const _e=Me.current;if(!EA(_e,ke.current)||n.length===0)return;const Ye=Ie.current;Ie.current=null;const Re=Ye===null?0:performance.now()-Ye;Ae.current=!0,B(!0);const Qe=CA(s,n.length),Xe=Qme({anchorMs:Q.current,maxAgeMs:m,...h!==void 0?{sinceMs:h}:{},...c!==void 0?{untilMs:c}:{}}),Nt=AA(_e)!==null;q({deviceIds:[...n],since:Xe.since,limit:Qe,projection:"slim",...M?{includeStationary:!0}:{},...C.length>0?{excludeSources:[...C]}:{},...Xe.until!==void 0?{until:Xe.until}:{},...(()=>{const rt=AA(_e);return rt!==null?{cursor:rt}:{}})()},Re).then(rt=>{if(rt.ok){const pn=performance.now(),Hn=hA(rt.page.tracks,oe.current),Sa=Lme(Me.current,Hn,rt.page.nextCursor);Me.current=Sa,_(Sa),W(rt.timing,{rows:Hn.length,devices:n.length,limit:Qe,paged:Nt,parseMs:Math.round(performance.now()-pn)}),we.current=0,G(null),D(!0);return}const $t=we.current,en=Efe[$t];if($t+1<_A&&en!==void 0){we.current=$t+1,ki("page failed — retrying",{attempt:$t+1,of:_A,backoffMs:en}),ge.current=setTimeout(()=>{ge.current=null,be.current()},en);return}we.current=0;const In=Bme(Me.current);Me.current=In,_(In),G(rt.message),D(!0)}).finally(()=>{if(Ae.current=!1,B(!1),Fme(Me.current)){be.current();return}Ee.current&&(Ee.current=!1,be.current())})},[q,W,n,he,s,m,h,c,M,E]),be=T.useRef(le);be.current=le;const ee=T.useCallback(()=>{if(Ae.current||n.length===0)return Promise.resolve();const _e=Hme(Me.current);if(_e===null)return re.current(),Promise.resolve();Ae.current=!0;const Ye=CA(s,n.length);return(async()=>{let Re=null,Qe=0,Xe=!0;for(;Xe&&Qe<TA;){const Nt=await q({deviceIds:[...n],since:_e,limit:Ye,projection:"slim",...M?{includeStationary:!0}:{},...C.length>0?{excludeSources:[...C]}:{},...c!==void 0?{until:c}:{},...Re!==null?{cursor:Re}:{}});if(!Nt.ok)return;const rt=Nt.page,$t=performance.now(),en=hA(rt.tracks,oe.current),In=Ume(Me.current,en,rt.nextCursor);Me.current=In.state,_(In.state),W(Nt.timing,{rows:en.length,devices:n.length,limit:Ye,paged:Re!==null,delta:!0,parseMs:Math.round(performance.now()-$t)}),G(null),Xe=In.gap,Re=In.deltaCursor,Qe+=1}Xe&&ki("delta drain hit its page bound — newer rows may be missing",{since:_e,pages:Qe,bound:TA})})().finally(()=>{Ae.current=!1,Ee.current&&(Ee.current=!1,be.current())})},[q,W,n,he,s,le,c,M,E]),ve=T.useCallback(()=>{ge.current!==null&&(clearTimeout(ge.current),ge.current=null),we.current=0},[]),De=T.useCallback(()=>{const _e=ke.current+Math.max(1,p);ke.current=_e,fe(_e),be.current()},[p]),Fe=T.useCallback(()=>{ve(),G(null),D(!1),be.current()},[ve]),re=T.useRef(()=>{}),Te=T.useCallback(()=>{ve(),Q.current=Date.now(),Ee.current=!1,Me.current=Pc,_(Pc),D(!1),B(!1),G(null),ke.current=p,fe(p),V(_e=>_e+1)},[ve,p]),Je=T.useCallback(()=>{ve(),Q.current=Date.now(),Ee.current=!1;const _e=qme(Me.current);Me.current=_e,_(_e),_e.rows.length===0&&D(!1),B(!1),G(null),V(Ye=>Ye+1)},[ve]),Ze=`${he}|${m}|${h??""}|${c??""}|${M?"1":"0"}|${E}`,It=T.useRef(Ze);return T.useEffect(()=>{It.current!==Ze&&(It.current=Ze,!(Me.current.rows.length===0&&!j)&&Te())},[Ze,Te,j]),T.useEffect(()=>{if(n.length===0){x&&D(!0);return}le()},[ae,he,x]),T.useEffect(()=>{if(f<=0||n.length===0||!Vme(c,Date.now()))return;const _e=setInterval(()=>{ee()},f);return()=>clearInterval(_e)},[f,ee,n.length,c]),re.current=Fe,T.useEffect(()=>ve,[ve]),{rows:R.rows,retry:Fe,loading:!j,loadingMore:z&&j,error:L,hasMore:EA(R,F),tail:aO(R,F),loadMore:le,loadOlder:De,refresh:ee,reload:Je}}const jfe=3,Pfe=250;function Dfe(e){const{urls:t,token:n,paused:a,enabled:s}=e,p=T.useRef(0),f=T.useRef(0),m=T.useRef(!1),h=T.useRef(t),c=T.useRef(t[0]??"");h.current=t;const x=t[0]??"";c.current!==x&&(c.current=x,p.current=0),T.useEffect(()=>{if(m.current=!1,!s||a)return;let M=!1;const C=()=>{if(!(M||m.current))for(;f.current<jfe;){const E=h.current,R=p.current;if(R>=E.length)return;p.current=R+1;const _=E[R];_===void 0||_.length===0||(f.current+=1,Ime(_,n).finally(()=>{f.current=Math.max(0,f.current-1),C()}))}};return C(),()=>{M=!0,m.current=!0}},[s,a,n,t.length])}const zfe=.5,oO=56,Lfe=88;function qfe(e){return e<=0?0:Math.min(e*zfe,Lfe)}function NA(e){return e>=oO}function Bfe(e,t,n){return e==="gallery"&&!t&&!n}function Ffe(e){const{root:t,onRefresh:n,enabled:a}=e,[s,p]=T.useState(0),f=T.useRef(null),m=T.useRef(0);m.current=s;const h=T.useRef(n);h.current=n;const c=T.useCallback(()=>{f.current=null,p(0)},[]);return T.useEffect(()=>{if(!a||t===null)return;const x=R=>{if(t.scrollTop>0){f.current=null;return}const _=R.touches[0];f.current=_!==void 0?_.clientY:null},M=R=>{const _=f.current;if(_===null)return;const j=R.touches[0];if(j!==void 0){if(t.scrollTop>0){f.current=null,p(0);return}p(qfe(j.clientY-_))}},C=()=>{if(f.current===null)return;const R=m.current;c(),NA(R)&&h.current()},E={passive:!0};return t.addEventListener("touchstart",x,E),t.addEventListener("touchmove",M,E),t.addEventListener("touchend",C,E),t.addEventListener("touchcancel",c,E),()=>{t.removeEventListener("touchstart",x),t.removeEventListener("touchmove",M),t.removeEventListener("touchend",C),t.removeEventListener("touchcancel",c)}},[t,a,c]),{distance:s,armed:NA(s)}}const Fs=8,OA=10,Ufe=400;function Hfe(e){return Math.max(Ufe,Math.round(e))}function sO(e,t){return{display:"flex",alignItems:"center",justifyContent:"center",padding:e?"0 12px":"10px 0",width:e?"max-content":"100%",height:e?t:void 0,...e?{gridColumn:"auto"}:{},whiteSpace:"nowrap"}}function jA(e,t,n){return{...sO(e,t),font:"inherit",fontSize:12,color:n.text,background:n.card,border:`1px solid ${n.border}`,borderRadius:8,cursor:"pointer"}}const $fe=8;function PA({message:e,palette:t}){return T.useEffect(()=>{Ha(Xpe(e)),Ha($p("error",e))},[e]),v.jsxs("div",{style:{position:"fixed",inset:0,display:"flex",alignItems:"center",justifyContent:"center",background:t.background,color:"#f87171",fontFamily:"system-ui, sans-serif",fontSize:13,padding:16,textAlign:"center"},children:["Events embed config error: ",e]})}function Qfe({client:e,initialConfig:t}){const[n,a]=T.useState(t),[s,p]=T.useState({}),[f,m]=T.useState(()=>window.matchMedia?.("(prefers-color-scheme: dark)").matches??!0),[h,c]=T.useState(()=>Date.now()),[x,M]=T.useState(null);T.useEffect(()=>{let de=!1;return e.listDevices().then(Ce=>{de||M(Ce)}).catch(()=>{de||M([])}),()=>{de=!0}},[e]);const C=T.useMemo(()=>{const de=new Map;for(const Ce of x??[])de.set(Ce.id,rpe(Ce.id,Ce.name??`Camera ${Ce.id}`,n.deviceNames));for(const[Ce,ut]of Object.entries(n.deviceNames)){const Zt=Number(Ce);Number.isInteger(Zt)&&!de.has(Zt)&&ut.trim().length>0&&de.set(Zt,ut)}return de},[x,n.deviceNames]),[E,R]=T.useState(()=>new Map),[_,j]=T.useState(()=>new Map),D=T.useMemo(()=>gpe(n.kindLabels),[n.kindLabels]),z=T.useMemo(()=>jde(n.labels),[n.labels]),B=T.useMemo(()=>n.deviceIds.length>0?n.deviceIds:x===null?[]:Lpe(x),[n.deviceIds,x]);T.useEffect(()=>{if(B.length===0)return;let de=!1;return e.listEventKinds([...B]).then(Ce=>{de||(R(mpe(Ce)),j(fpe(Ce)))}).catch(()=>{ki("event-kind taxonomy unavailable — class filter is exact-id only")}),()=>{de=!0}},[e,B]);const L=Ofe({client:e,deviceIds:B,nameById:C,pageSize:n.pageSize,maxRows:Wde(n),refreshMs:n.refreshMs,maxAgeMs:n.maxAgeMs,channel:Nfe(n.serverUrl),devicesResolved:n.deviceIds.length>0||x!==null,...n.showStationary?{includeStationary:!0}:{},excludeSources:n.excludeSources,...n.sinceMs!==void 0?{sinceMs:n.sinceMs}:{},...n.untilMs!==void 0?{untilMs:n.untilMs}:{}}),G=n.searchMode==="semantic"?n.search.trim():"",[ae,V]=T.useState({query:"",rows:[],loading:!1});T.useEffect(()=>{if(G.length===0||B.length===0){V({query:"",rows:[],loading:!1});return}let de=!1;return V(Ce=>({...Ce,query:G,loading:!0})),e.searchObjectEvents({text:G,limit:n.semanticLimit,minScore:n.semanticMinScore,...B.length===1&&B[0]!==void 0?{deviceId:B[0]}:{},...n.sinceMs!==void 0?{since:n.sinceMs}:{},...n.untilMs!==void 0?{until:n.untilMs}:{}}).then(Ce=>{de||V({query:G,rows:tfe(Ce,C),loading:!1})}).catch(Ce=>{de||(ki("searchObjectEvents failed",{error:Ce instanceof Error?Ce.message:String(Ce)}),V({query:G,rows:[],loading:!1}))}),()=>{de=!0}},[e,G,B,C,n.semanticLimit,n.semanticMinScore,n.sinceMs,n.untilMs]);const F=G.length>0,fe=T.useMemo(()=>new Set(n.reviewedTrackIds),[n.reviewedTrackIds]),ke=de=>fe.size===0?[...de]:de.map(Ce=>fe.has(Ce.trackId)?{...Ce,reviewed:!0}:Ce),Me=T.useMemo(()=>ke(yA(vA(L.rows,C),s)),[L.rows,C,fe,s]),Ae=T.useMemo(()=>ke(yA(vA(ae.rows,C),s)),[ae.rows,C,fe,s]),Ee=T.useMemo(()=>{const de={debug:n.filterDebug,train:n.filterTrain,favourited:n.filterFavourited,reviewedTrackIds:n.reviewedTrackIds},Ce=gA(Me,n.classes,n.search,E,n.attrs,de,n.excludeSources);if(F){const ut=gA(Ae,n.classes,"",E,n.attrs,de,n.excludeSources);return nfe(ut,Ce,n.sort)}return iO(Ce,n.sort)},[F,Ae,Me,n.classes,n.attrs,n.filterDebug,n.filterTrain,n.filterFavourited,n.reviewedTrackIds,n.search,n.sort,n.excludeSources,E]),we=W5(n.theme,f),ge=T.useRef(null),[Q,oe]=T.useState(null),xe=T.useRef(null),Ie=T.useRef(L.loadMore);Ie.current=L.loadMore;const he=T.useRef(L.refresh);he.current=L.refresh;const q=T.useRef(L.reload);q.current=L.reload;const[W]=T.useState(()=>Xme(Ha)),le=T.useCallback(de=>{if(de.type==="setConfig"){a(Ce=>rb(Ce,de.patch));return}if(de.type==="setWindow"){a(Ce=>rb(Ce,cme(de)));return}if(de.type==="setTrackFlagPatches"){p(de.patches);return}if(de.type==="setTrackListMode"){W.setMode(de.mode);return}if(de.type==="refresh"){he.current().finally(()=>Ha(ime()));return}if(de.type==="reload"){q.current();return}if(de.type==="loadMore"){Ie.current();return}if(de.type==="ping"){Ha(nme());return}ge.current?.scrollTo({top:0,left:0,behavior:"smooth"})},[W]);T.useEffect(()=>(window.__camstackEvents={setConfig:de=>{const Ce=Tc({type:"setConfig",patch:de});Ce!==null&&le(Ce)},setWindow:de=>{const Ce=Tc({type:"setWindow",...de});Ce!==null&&le(Ce)},setTrackFlagPatches:de=>{const Ce=Tc({type:"setTrackFlagPatches",patches:de});Ce!==null&&le(Ce)},setTrackListMode:de=>{const Ce=Tc({type:"setTrackListMode",mode:de});Ce!==null&&le(Ce)},refresh:()=>le({type:"refresh"}),reload:()=>le({type:"reload"}),loadMore:()=>le({type:"loadMore"}),scrollToTop:()=>le({type:"scrollToTop"}),ping:()=>le({type:"ping"})},Iu(de=>{const Ce=Tc(de);Ce!==null&&le(Ce)})),[le]),T.useEffect(()=>{Ha(Ype(n.view))},[]),T.useEffect(()=>{Ha(F?xA(ae.rows.length,Ee.length,!1,"semantic"):xA(L.rows.length,Ee.length,L.hasMore,"feed"))},[L.rows.length,Ee.length,L.hasMore,F,ae.rows.length]),T.useEffect(()=>{W.report(Ee)},[W,Ee]),T.useEffect(()=>{if(L.error!==null&&!F){Ha($p("error",L.error));return}if(F?ae.loading:L.loading){Ha($p("loading"));return}Ha($p(Ee.length===0?"empty":"ready"))},[L.loading,L.error,Ee.length,F,ae.loading]),T.useEffect(()=>{const de=window.matchMedia?.("(prefers-color-scheme: dark)");if(!de)return;const Ce=ut=>m(ut.matches);return de.addEventListener("change",Ce),()=>de.removeEventListener("change",Ce)},[]),T.useEffect(()=>{document.documentElement.style.colorScheme=we.colorScheme,document.body.style.background=we.background},[we]),T.useEffect(()=>{const de="camstack-events-keyframes";if(document.getElementById(de)!==null)return;const Ce=document.createElement("style");Ce.id=de,Ce.textContent="@keyframes camstack-spin{to{transform:rotate(360deg)}}",document.head.appendChild(Ce)},[]),T.useEffect(()=>{const de=setInterval(()=>c(Date.now()),6e4);return()=>clearInterval(de)},[]);const[be,ee]=T.useState(0);T.useEffect(()=>{const de=Q;if(de===null)return;const Ce=()=>{const Zt=n.view==="reel"?de.clientWidth:de.clientHeight;ee(On=>On===Zt?On:Zt)};if(Ce(),typeof ResizeObserver!="function")return;const ut=new ResizeObserver(Ce);return ut.observe(de),()=>ut.disconnect()},[Q,n.view]);const ve=L.rows.length,De=ve>0;T.useEffect(()=>{const de=ge.current,Ce=xe.current;if(!de||!Ce||F||!De)return;const ut=Hfe(n.view==="reel"?de.clientWidth:de.clientHeight),Zt=new IntersectionObserver(On=>{On.some(Ei=>Ei.isIntersecting)&&Ie.current()},{root:de,rootMargin:`${ut}px`});return Zt.observe(Ce),()=>Zt.disconnect()},[n.view,L.hasMore,F,De,be]);const Fe=T.useRef(0),re=T.useRef(0);T.useEffect(()=>{if(F||L.loading||L.loadingMore||!L.hasMore)return;const de=ge.current;if(!de||ve===0)return;const Ce=n.view==="reel";if((Ce?de.clientWidth:de.clientHeight)===0)return;if(Ce?de.scrollWidth>de.clientWidth+1:de.scrollHeight>de.clientHeight+1){Fe.current=0,re.current=ve;return}ve>re.current&&(Fe.current=0,re.current=ve),!(Fe.current>=$fe)&&(Fe.current+=1,Ie.current())},[Ee.length,ve,L.loading,L.loadingMore,L.hasMore,F,n.view]);const Te=Ffe({root:Q,enabled:Bfe(n.view,F,n.nativePullToRefresh),onRefresh:()=>{he.current()}}),Je=T.useRef(null);T.useEffect(()=>{const de=Q;if(!n.nativePullToRefresh||de===null){Je.current=null;return}const Ce=()=>{const ut=n.view==="gallery"&&!F&&de.scrollTop<=0;Je.current!==ut&&(Je.current=ut,Ha(ame(ut)))};return Ce(),de.addEventListener("scroll",Ce,{passive:!0}),()=>de.removeEventListener("scroll",Ce)},[Q,n.nativePullToRefresh,n.view,F]);const Ze=V0(n.thumbSize),It=ipe(n.thumbSize),_e=epe(n.thumbSize,window.devicePixelRatio||1),Ye=n.view==="reel",[Re,Qe]=T.useState(!1),[Xe,Nt]=T.useState({scrollLeft:0,scrollTop:0,viewportWidth:0,viewportHeight:0});T.useEffect(()=>{const de=Q;if(de===null)return;let Ce=null;const ut=()=>{Nt({scrollLeft:de.scrollLeft,scrollTop:de.scrollTop,viewportWidth:de.clientWidth,viewportHeight:de.clientHeight})},Zt=()=>{ut(),Qe(!0),Ce!==null&&clearTimeout(Ce),Ce=setTimeout(()=>Qe(!1),Pfe)};return ut(),de.addEventListener("scroll",Zt,{passive:!0}),window.addEventListener("resize",ut),()=>{de.removeEventListener("scroll",Zt),window.removeEventListener("resize",ut),Ce!==null&&clearTimeout(Ce)}},[Q]);const rt=T.useMemo(()=>rfe({viewportWidth:Xe.viewportWidth,cardWidth:Ze,gap:Fs,columns:n.columns}),[Xe.viewportWidth,Ze,n.columns]),$t=Ye?0:Math.ceil(Ee.length/rt.columns),en=mfe({rowCount:$t,scrollTop:Xe.scrollTop,viewportHeight:Xe.viewportHeight,fallbackRowPx:rt.rowStridePx,geometryKey:`${rt.columns}|${Ze}|${n.fields.sublabel?"s":""}${n.fields.camera?"c":""}${n.fields.time?"t":""}${n.fields.badges?"b":""}`}),In=T.useMemo(()=>Ye?afe(Ee,{scrollLeft:Xe.scrollLeft,viewportWidth:Xe.viewportWidth,cardWidth:Ze,gap:Fs,rowsPerColumn:n.rows}):pfe(Ee,en.window,rt.columns),[Ye,Ee,Xe.scrollLeft,Xe.viewportWidth,Ze,n.rows,en.window,rt.columns]),pn=T.useMemo(()=>In.map(de=>G5(n.serverUrl,de.trackId,_e)),[In,n.serverUrl,_e]);Dfe({urls:pn,token:n.token,paused:Re,enabled:!L.loading&&Ee.length>0});const Hn=T.useCallback((de,Ce)=>{Ha(Jpe({trackId:de.trackId,deviceId:de.deviceId,bestEventId:de.bestEventId,className:de.className,firstSeen:de.firstSeen,lastSeen:de.lastSeen,...Ce===void 0?{}:{intent:Ce}}))},[]),Sa=T.useCallback(de=>Hn(de),[Hn]),li=T.useCallback(de=>Hn(de,"assign-face"),[Hn]),$n=Ye?{display:"grid",gridTemplateRows:`repeat(${n.rows}, ${It}px)`,gridAutoFlow:"column",gridAutoColumns:`${Ze}px`,gap:Fs,alignContent:"start"}:{display:"grid",gridTemplateColumns:`repeat(${rt.columns}, minmax(0, 1fr))`,columnGap:Fs,rowGap:Fs,paddingBottom:Fs,alignContent:"start"},ci=F?ae.loading:L.loading,et=!F&&L.loadingMore&&ve>0,mn=!F&&L.error!==null,ra=!F&&!L.loadingMore&&ve>0,oa=ra&&mn,Pn=ra&&!mn&&L.tail==="exhausted",sa=ra&&!mn&&L.tail==="ceiling",Nn=mn&&Ee.length===0,Vo=!ci&&!mn&&!L.loadingMore&&Ee.length===0,Go=Vo&&ve>0,Yr=(de,Ce)=>v.jsx(Ome,{row:de,eagerImages:!Ye&&Ce<8,serverUrl:n.serverUrl,token:n.token,thumbPx:_e,width:Ye?`${Ze}px`:"100%",heroPx:Ze,variant:Ye?"reel":"gallery",iconId:hpe(de.className,_,X5(de)),kindLabels:D,labels:z,scrollRoot:Q,fields:n.fields,showAdminFlags:n.showAdminFlags===!0,palette:we,nowMs:h,onClick:Sa,onAssignFace:li},de.trackId),Va=v.jsxs(v.Fragment,{children:[et&&v.jsx("div",{"data-testid":"tail-loading","aria-label":z.loadingMore,style:{width:Ye?Ze:"100%",height:Ye?It:void 0,aspectRatio:Ye?void 0:"1 / 1",borderRadius:10,background:we.skeleton,border:`1px solid ${we.border}`,boxSizing:"border-box",opacity:.6,display:"flex",alignItems:"center",justifyContent:"center"},children:v.jsx("span",{style:{width:14,height:14,borderRadius:999,border:`2px solid ${we.chip}`,borderTopColor:we.textMuted,animation:"camstack-spin 700ms linear infinite"}})}),Pn&&v.jsx("div",{"data-testid":"tail-end",style:{...sO(Ye,Ze),color:we.textMuted,fontSize:11,opacity:.75},children:qs(n,"end")}),sa&&v.jsx("button",{type:"button","data-testid":"tail-more",onClick:()=>L.loadOlder(),style:jA(Ye,Ze,we),children:qs(n,"loadOlder")}),oa&&v.jsx("button",{type:"button","data-testid":"tail-error",onClick:()=>L.retry(),style:{...jA(Ye,Ze,we),color:"#f87171"},children:qs(n,"retry")}),v.jsx("div",{ref:xe,style:{width:1,height:1,gridRow:Ye?1:"auto"},"aria-hidden":!0})]});return v.jsxs("div",{ref:de=>{ge.current=de,oe(Ce=>Ce===de?Ce:de)},"data-testid":"events-scroller",className:Ye?"events-reel-scroller":void 0,style:{position:"fixed",inset:0,background:we.background,color:we.text,fontFamily:"system-ui, -apple-system, sans-serif",overflowX:Ye?"auto":"hidden",overflowY:Ye?"hidden":"auto",padding:Ye?`${ape}px ${OA}px`:OA,boxSizing:"border-box",WebkitOverflowScrolling:"touch"},children:[Te.distance>0&&v.jsx("div",{"data-testid":"pull-indicator","data-armed":Te.armed?"true":"false","aria-hidden":!0,style:{position:"absolute",top:Math.max(0,Te.distance-28),left:0,right:0,display:"flex",justifyContent:"center",pointerEvents:"none",zIndex:2,opacity:Math.min(1,Te.distance/oO)},children:v.jsx("span",{style:{width:22,height:22,borderRadius:999,border:`2px solid ${we.chip}`,borderTopColor:we.textMuted,background:we.card,boxShadow:"0 1px 4px rgba(0,0,0,0.25)",transform:`rotate(${Te.distance*4}deg)`,animation:L.loadingMore?"camstack-spin 700ms linear infinite":void 0}})}),Nn&&v.jsxs("div",{"data-testid":"state-error",style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",color:"#f87171",fontSize:13,padding:16,textAlign:"center"},children:[v.jsx("span",{children:qs(n,"error")}),v.jsx("button",{type:"button","data-testid":"state-retry",onClick:()=>L.retry(),style:{marginTop:10,font:"inherit",fontSize:12,color:we.text,background:we.card,border:`1px solid ${we.border}`,borderRadius:8,padding:"5px 14px",cursor:"pointer"},children:qs(n,"retry")})]}),Vo&&v.jsx("div",{"data-testid":Go?"state-empty-filtered":"state-empty",style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",color:we.textMuted,fontSize:13,padding:"0 24px",textAlign:"center"},children:qs(n,Go?"emptyFiltered":"empty")}),ci&&Ee.length===0&&v.jsx("div",{"data-testid":"state-loading",style:$n,children:Array.from({length:Ye?8:12},(de,Ce)=>v.jsx("div",{style:{width:Ye?Ze:"100%",height:Ye?It:void 0,aspectRatio:Ye?void 0:"1 / 1",borderRadius:10,background:we.skeleton,border:`1px solid ${we.border}`,boxSizing:"border-box",opacity:.6}},`skeleton-${Ce}`))}),Ye?v.jsxs("div",{style:$n,children:[Ee.map(Yr),Va]}):v.jsxs("div",{"data-testid":"events-gallery",children:[v.jsx("div",{"data-testid":"gallery-pad-top",style:{height:en.window.padTopPx},"aria-hidden":!0}),Array.from({length:en.window.endRow-en.window.startRow},(de,Ce)=>{const ut=en.window.startRow+Ce,Zt=ut*rt.columns;return v.jsx("div",{"data-row-index":ut,ref:en.measureRow(ut),style:$n,children:Ee.slice(Zt,Zt+rt.columns).map((On,Ei)=>Yr(On,Zt+Ei))},ut)}),v.jsx("div",{"data-testid":"gallery-pad-bottom",style:{height:en.window.padBottomPx},"aria-hidden":!0}),Va]})]})}function Vfe(){const e=Qm("events",()=>window.__CAMSTACK_EVENTS__,V5,Mfe,{urlFirst:!0}),t=T.useMemo(()=>Cfe(),[]),n=T.useMemo(()=>e===null?null:Afe(e,t),[e,t]),a=T.useMemo(()=>{if(n===null||!n.ok)return null;const p=jm({serverUrl:n.config.serverUrl,token:n.config.token});return{system:p,client:jme(p)}},[n]);T.useEffect(()=>{if(a)return()=>a.system.close()},[a]);const s=W5(n!==null&&n.ok?n.config.theme:"auto",window.matchMedia?.("(prefers-color-scheme: dark)").matches??!0);return n===null?null:n.ok?a?v.jsx(Qfe,{client:a.client,initialConfig:n.config}):v.jsx(PA,{message:"Failed to initialise the events embed",palette:s}):v.jsx(PA,{message:n.error,palette:s})}const bm={play:"Play",pause:"Pause",listen:"Listen",mute:"Mute",talk:"Talk",stopTalk:"Stop talk",ptz:"PTZ",linkedDevices:"Linked devices",viewOptions:"View options",moreActions:"More actions",open:"Open",removeFromView:"Remove from view",resizeWidth:"Resize width",resizeHeight:"Resize height",noActiveCameras:"No active cameras",camera:"Camera"},Gfe=Object.keys(bm),Zfe=X(o(),o()).optional();function Kfe(e){if(e===null||typeof e!="object")return bm;const t=e,n={...bm};for(const a of Gfe){const s=t[a];typeof s=="string"&&s.trim()!==""&&(n[a]=s)}return n}const lO=N(["auto","high","mid","low"]).catch("auto"),Wfe=tt([$("auto"),l().int().min(1)]),cO=d({enabled:A(),motion:A(),motionHoldSec:l().optional(),audio:N(["off","sensor","level"]),audioDb:l(),audioHoldSec:l(),detection:A(),detectionHoldSec:l(),detectionClasses:w(o()).optional(),appearance:d({motionColor:o(),audioColor:o(),detectionColor:o(),thickness:l()}).optional()}),Tv=N(["off","top-left","top-center","top-right","left-center","right-center","bottom-left","bottom-center","bottom-right"]),Yfe=d({motionBoxes:A().optional(),motionBadge:Tv.optional(),audioMeter:Tv.optional(),occupancy:Tv.optional(),stats:A().optional()}),Xfe=d({cw:l(),ch:l()}),Jfe=d({serverUrl:o().min(1),token:o().min(1).optional(),devices:w(l().int().nonnegative()).min(1),layout:Wfe,quality:lO,showName:A(),showBadges:A(),muted:A(),paused:A(),highlight:cO.optional(),activeOnly:A().optional(),showBoxes:A().optional(),audioOnIds:w(l().int().nonnegative()).optional(),pausedIds:w(l().int().nonnegative()).optional(),snapshots:X(o(),o()).optional(),ptzIds:w(l().int().nonnegative()).optional(),overlays:X(o(),Yfe).optional(),editable:A().optional(),cellPanels:A().optional(),spans:X(o(),Xfe).optional(),labels:Zfe}).superRefine(D5);function uO(e){if(e==null)return{ok:!1,error:"config is required"};const t=Jfe.safeParse(e);return t.success?{ok:!0,config:t.data}:{ok:!1,error:t.error.issues.map(n=>`${n.path.join(".")||"(root)"}: ${n.message}`).join("; ")}}const ehe=1,dO=N(["auto","high","mid","low"]),the=tt([$("auto"),l().int().min(1)]),pO=d({enabled:A(),motion:A(),audio:N(["off","sensor","level"]),audioDb:l(),audioHoldSec:l(),detection:A(),detectionHoldSec:l(),detectionClasses:w(o()).optional(),appearance:d({motionColor:o(),audioColor:o(),detectionColor:o(),thickness:l()}).optional()}),nhe=d({devices:w(l().int().nonnegative()).min(1),layout:the,quality:dO,showName:A(),audioOnIds:w(l().int().nonnegative()).optional(),activeOnly:A().optional(),boxes:A().optional(),highlight:pO.optional()}),ahe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_";function ihe(e){let t="",n=0;for(;n<e.length;){const a=e[n];if(a===void 0)return null;let s,p;if(a<128)s=a,p=0;else if((a&224)===192)s=a&31,p=1;else if((a&240)===224)s=a&15,p=2;else if((a&248)===240)s=a&7,p=3;else return null;for(let f=1;f<=p;f++){const m=e[n+f];if(m===void 0||(m&192)!==128)return null;s=s<<6|m&63}n+=p+1,t+=String.fromCodePoint(s)}return t}function rhe(e){if(e.length%4===1)return null;const t=[];for(const s of e){const p=ahe.indexOf(s);if(p<0)return null;t.push(p)}const n=[];for(let s=0;s<t.length;s+=4){const p=t[s],f=t[s+1];if(p===void 0||f===void 0)return null;const m=t[s+2],h=t[s+3];n.push(p<<2|f>>4),m!==void 0&&n.push((f&15)<<4|m>>2),h!==void 0&&m!==void 0&&n.push((m&3)<<6|h)}const a=ihe(n);if(a===null)return null;try{return JSON.parse(a)}catch{return null}}function W0(e,t){return e.startsWith(t)?e.slice(t.length):e}function mO(e){const n=new URLSearchParams(W0(e,"#")).get("t");return n!==null&&n.length>0?n:null}function ohe(e,t){return new URLSearchParams(W0(e,"?")).has("v")||mO(t)!==null}function DA(e){if(e.length===0)return null;const t=[];for(const n of e.split(",")){if(!/^\d+$/.test(n))return null;t.push(Number(n))}return t}function ti(e){return{ok:!1,error:e}}function she(e,t){const n=new URLSearchParams(W0(e,"?")),a=n.get("mode");if(a!==null&&a!=="grid")return ti(`unsupported mode "${a}"`);const s=n.get("v");if(s===null)return ti("missing share-link version (v)");if(s!==String(ehe))return ti(`unsupported share-link version "${s}"`);const p=n.get("devices"),f=p===null?null:DA(p);if(f===null||f.length===0)return ti("invalid or missing devices list");const m=n.get("layout");let h;if(m===null||m==="auto")h="auto";else if(/^\d+$/.test(m)&&Number(m)>=1)h=Number(m);else return ti(`invalid layout "${m}"`);const c=n.get("q")??"auto",x=dO.safeParse(c),M=x.success?x.data:"auto",C=n.get("names")??"0";if(C!=="0"&&C!=="1")return ti(`invalid names flag "${C}"`);const E=n.get("audio");let R;if(E!==null){const V=DA(E);if(V===null)return ti(`invalid audio list "${E}"`);R=V}const _=n.get("activeOnly");if(_!==null&&_!=="0"&&_!=="1")return ti(`invalid activeOnly flag "${_}"`);const j=_==="1",D=n.get("boxes");if(D!==null&&D!=="0"&&D!=="1")return ti(`invalid boxes flag "${D}"`);const z=D==="1",B=n.get("hl");let L;if(B!==null){const V=rhe(B),F=pO.safeParse(V);if(V===null||!F.success)return ti("invalid highlight config (hl)");L=F.data}const G={devices:[...f],layout:h,quality:M,showName:C==="1",...R!==void 0&&R.length>0?{audioOnIds:[...R]}:{},...j?{activeOnly:!0}:{},...z?{boxes:!0}:{},...L!==void 0?{highlight:L}:{}},ae=nhe.safeParse(G);return ae.success?{ok:!0,params:ae.data,token:mO(t)}:ti(ae.error.issues.map(V=>`${V.path.join(".")||"(root)"}: ${V.message}`).join("; "))}function lhe(e,t,n){if(!ohe(e,t))return null;const a=she(e,t);if(!a.ok)return{ok:!1,error:a.error};if(a.token===null)return{ok:!1,error:"share token missing — the link must end with #t=<token>"};const s=a.params,p={serverUrl:n,token:a.token,devices:[...s.devices],layout:s.layout,quality:s.quality,showName:s.showName,showBadges:!0,muted:!0,paused:!1,...s.highlight!==void 0?{highlight:s.highlight}:{},...s.activeOnly===!0?{activeOnly:!0}:{},...s.boxes===!0?{showBoxes:!0}:{},...s.audioOnIds!==void 0&&s.audioOnIds.length>0?{audioOnIds:[...s.audioOnIds]}:{}};return uO(p)}function che(){const e=lhe(location.search,location.hash,location.origin);return e!==null&&location.hash!==""&&history.replaceState(null,"",location.pathname+location.search),e}const Sm=16/9,zA={cols:0,rows:0,cellW:0,cellH:0,wallW:0,wallH:0};function LA(e,t,n,a,s){const p=Math.min(a/e,s/t*Sm),f=p/Sm;return{cols:e,rows:t,cellW:p,cellH:f,wallW:Math.min(e,n)*p,wallH:t*f,empty:e*t-n}}function qA(e){return{cols:e.cols,rows:e.rows,cellW:e.cellW,cellH:e.cellH,wallW:e.wallW,wallH:e.wallH}}const BA=1e-9;function uhe(e,t){const n=e.cellW*e.cellH,a=t.cellW*t.cellH,s=Math.max(n,a,1);return n-a>s*BA?!0:a-n>s*BA?!1:e.empty!==t.empty?e.empty<t.empty:e.rows<t.rows}function dhe(e,t,n,a){if(e<=0||t<=0||n<=0)return zA;if(typeof a=="number"&&a>=1){const p=Math.floor(a);return qA(LA(p,Math.ceil(e/p),e,t,n))}let s=null;for(let p=1;p<=e;p++){const f=Math.ceil(e/p);if(Math.ceil(e/f)!==p)continue;const m=LA(f,p,e,t,n);(s===null||uhe(m,s))&&(s=m)}return s===null?zA:qA(s)}function phe(e,t){if(e.length===0)return[];const n=t>=1?Math.floor(t):e.length,a=[];for(let s=0;s<e.length;s+=n)a.push(e.slice(s,s+n));return a}function mhe(e,t){if(e.length===0||t.cellW<=0||t.cellH<=0)return[];const n=[];return phe(e,t.cols).forEach((s,p)=>{const f=(t.wallW-s.length*t.cellW)/2;s.forEach((m,h)=>{n.push({deviceId:m,x:f+h*t.cellW,y:p*t.cellH,w:t.cellW,h:t.cellH})})}),n}const FA={wallW:0,wallH:0,placements:[]};function fhe(e,t){const n=e!==void 0&&Number.isFinite(e.cw)?Math.round(e.cw):1,a=e!==void 0&&Number.isFinite(e.ch)?Math.round(e.ch):1;return{cw:Math.min(Math.max(n,1),Math.max(t,1)),ch:Math.max(a,1)}}function hhe(e){if(e===void 0)return!1;for(const t of Object.keys(e)){const n=e[t];if(n!==void 0&&(n.cw!==1||n.ch!==1))return!0}return!1}function ghe(e,t,n){const a=new Set,s=[];let p=0;const f=(m,h,c,x)=>{for(let M=m;M<m+x;M++)for(let C=h;C<h+c;C++)if(a.has(`${M}:${C}`))return!1;return!0};for(const m of e){const{cw:h,ch:c}=fhe(t[String(m)],n),x=p+c+e.length;let M=!1;for(let C=0;C<=x&&!M;C++)for(let E=0;E+h<=n;E++)if(f(C,E,h,c)){for(let R=C;R<C+c;R++)for(let _=E;_<E+h;_++)a.add(`${R}:${_}`);s.push({deviceId:m,col:E,row:C,cw:h,ch:c}),p=Math.max(p,C+c),M=!0;break}}return{cells:s,rows:p,cols:n}}function vhe(e,t,n,a,s){const p=dhe(e.length,t,n,a);if(!hhe(s)||p.cols<=0)return{wallW:p.wallW,wallH:p.wallH,placements:mhe(e,p)};if(e.length===0||t<=0||n<=0)return FA;const f=ghe(e,s??{},p.cols);if(f.rows<=0)return FA;const m=Math.min(t/f.cols,n/f.rows*Sm),h=m/Sm;return{wallW:f.cells.reduce((x,M)=>Math.max(x,M.col+M.cw),0)*m,wallH:f.rows*h,placements:f.cells.map(x=>({deviceId:x.deviceId,x:x.col*m,y:x.row*h,w:x.cw*m,h:x.ch*h}))}}function fO(){const[e,t]=T.useState(null),[n,a]=T.useState("idle"),s=T.useRef(null),p=T.useRef(null),f=T.useRef(null),m=T.useRef(0),h=T.useRef(null),c=Vae(),x=Gae(),M=Zae(),C=T.useRef({start:c.mutateAsync,answer:x.mutateAsync,stop:M.mutateAsync});C.current={start:c.mutateAsync,answer:x.mutateAsync,stop:M.mutateAsync};const E=T.useCallback(()=>{if(s.current){try{s.current.close()}catch{}s.current=null}if(p.current){for(const D of p.current.getTracks())try{D.stop()}catch{}p.current=null}},[]),R=T.useCallback(async()=>{const D=f.current;if(f.current=null,E(),D)try{await C.current.stop({deviceId:D.deviceId,sessionId:D.sessionId})}catch{}},[E]),_=T.useCallback(async D=>{if(h.current===D){m.current+=1,h.current=null,t(null),a("idle"),await R();return}m.current+=1;const z=m.current;h.current=D,t(D),a("starting");let B;try{B=await navigator.mediaDevices.getUserMedia({audio:!0,video:!1})}catch{z===m.current&&(h.current=null,t(null),a("error"));return}if(z!==m.current){for(const G of B.getTracks())G.stop();return}if(await R(),z!==m.current){for(const G of B.getTracks())G.stop();return}let L=null;try{p.current=B;const G=await C.current.start({deviceId:D});if(z!==m.current){try{await C.current.stop({deviceId:D,sessionId:G.sessionId})}catch{}E();return}f.current={deviceId:D,sessionId:G.sessionId},L=new RTCPeerConnection,s.current=L,L.oniceconnectionstatechange=()=>{if(z!==m.current||!L)return;const V=L.iceConnectionState;V==="connected"||V==="completed"?a("talking"):(V==="failed"||V==="closed"||V==="disconnected")&&(h.current=null,t(null),a("idle"),R())};for(const V of B.getAudioTracks())L.addTrack(V,B);await L.setRemoteDescription({type:"offer",sdp:G.sdpOffer});const ae=await L.createAnswer();if(await L.setLocalDescription(ae),z!==m.current)return;await C.current.answer({deviceId:D,sessionId:G.sessionId,sdpAnswer:L.localDescription?.sdp??ae.sdp??""})}catch{if(L)try{L.close()}catch{}E();const G=f.current;if(f.current=null,G)try{await C.current.stop({deviceId:G.deviceId,sessionId:G.sessionId})}catch{}z===m.current&&(h.current=null,t(null),a("error"))}},[R,E]),j=T.useCallback(D=>{if(D===null){m.current+=1,h.current=null,t(null),a("idle"),R();return}h.current!==D&&_(D)},[R,_]);return T.useEffect(()=>()=>{m.current+=1,R()},[R]),{activeMicId:e,micState:n,toggleMic:D=>{_(D)},setActiveMic:j}}const yhe=6e3,bhe=500;function She(e,t){const n=T.useRef(new Map),[,a]=T.useState(0),s=t?.motion??!1,p=t?.audio??"off",f=t?.audioDb??-30,m=t?.audioHoldSec??5,h=t?.detection??!1,c=t?.detectionHoldSec??3,x=t?.detectionClasses??[],M=(R,_)=>{n.current.set(R,Date.now()+_),a(j=>j+1)};wi(We.MotionOnMotionChanged,R=>{if(!s)return;const _=R.data;_&&_.detected&&M(_.deviceId,yhe)}),wi(We.PipelineAudioInferenceResult,R=>{if(p==="off")return;const _=R.data;if(!_)return;(p==="sensor"?_.frame.detections.length>0:(_.frame.level?.dbfs??Number.NEGATIVE_INFINITY)>=f)&&M(_.deviceId,m*1e3)}),wi(We.DetectionResult,R=>{if(!h)return;const _=R.data;if(!_)return;_.frame.detections.some(D=>x.length===0||x.includes(D.macroClass))&&M(_.frame.deviceId,c*1e3)}),T.useEffect(()=>{const R=setInterval(()=>a(_=>_+1),bhe);return()=>clearInterval(R)},[]);const C=Date.now(),E=new Set;for(const R of e){const _=n.current.get(R);_!==void 0&&C<_&&E.add(R)}return E}function xhe(e){return{type:"tileOpen",deviceId:e}}function khe(e){return{type:"audioToggle",deviceId:e}}function whe(e){return{type:"pauseToggle",deviceId:e}}function Mhe(e){return{type:"ptzOpen",deviceId:e}}function Che(e,t){return{type:"cellPanelOpen",deviceId:e,panel:t}}function Ahe(e){return{type:"tileRemove",deviceId:e}}function Ehe(e,t,n){return{type:"tileResize",deviceId:e,cw:t,ch:n}}function hO(e,t,n){return{type:"state",state:e,...t!==void 0?{message:t}:{},...n!==void 0?{commands:n}:{}}}function Rhe(e){return{type:"layout",tiles:e}}function Si(e){tn(e)}const Ihe=["top-left","top-center","top-right","left-center","right-center","bottom-left","bottom-center","bottom-right"];function UA(e){return typeof e=="string"&&Ihe.includes(e)}const The={"top-left":{top:8,left:8},"top-center":{top:8,left:0,right:0,justifyContent:"center"},"top-right":{top:8,right:8},"left-center":{left:8,top:0,bottom:0,alignItems:"center"},"right-center":{right:8,top:0,bottom:0,alignItems:"center"},"bottom-left":{bottom:8,left:8},"bottom-center":{bottom:8,left:0,right:0,justifyContent:"center"},"bottom-right":{bottom:8,right:8}};function gO(e){return{position:"absolute",display:"flex",...The[e]}}const vO=[-60,-53,-46,-39,-32,-24],_he=vO.length,_v=["#22c55e","#84cc16","#eab308","#f59e0b","#f97316","#ef4444"];function Nhe(e){const t=Math.min(Math.max(0,e),_v.length-1);return _v[t]??_v[0]}function Ohe(e){if(e===null||!Number.isFinite(e))return 0;let t=0;for(const n of vO)e>=n&&(t+=1);return t}function jhe(e){if(e==="off")return null;const t=e.split("-"),n=t.includes("top")?"top":t.includes("bottom")?"bottom":"center",a=t.includes("left")?"left":t.includes("right")?"right":"center";return n!=="center"&&a!=="center"?"compact":a==="center"?"horizontal":"vertical"}const HA=[8,11,14,17,21,26],Nv={horizontal:{width:8,height:16},vertical:{width:24,height:7},compactWidth:4};function Phe(e,t){if(e==="vertical")return Nv.vertical;if(e==="horizontal")return Nv.horizontal;const n=HA[t]??HA[0];return{width:Nv.compactWidth,height:n}}function Dhe(e){const t=Array.from({length:_he},(n,a)=>a);return e==="vertical"?[...t].reverse():t}function Io(e){return typeof e=="object"&&e!==null}function zhe(e){if(!Io(e))return[];if(e.detected!==!0)return[];const t=typeof e.frameWidth=="number"?e.frameWidth:0,n=typeof e.frameHeight=="number"?e.frameHeight:0;if(t<=0||n<=0)return[];const a=e.regions;if(!Array.isArray(a))return[];const s=[];for(const p of a){if(!Io(p)||!Io(p.bbox))continue;const{x:f,y:m,w:h,h:c}=p.bbox;typeof f!="number"||typeof m!="number"||typeof h!="number"||typeof c!="number"||!(h>0)||!(c>0)||s.push({x:f/t,y:m/n,w:h/t,h:c/n,pixelCount:typeof p.pixelCount=="number"?p.pixelCount:0})}return s}function Lhe(e){return!Number.isFinite(e)||e<=0?.08:Math.min(.28,.08+e/4e3*.28)}function $A(e){if(!Io(e))return[];const t=Io(e.frame)?e.frame.byClass:void 0,n=Io(t)?t:e.byClass;if(!Io(n))return[];const a=[];for(const[s,p]of Object.entries(n))typeof p!="number"||!Number.isFinite(p)||p<=0||a.push({className:s,count:Math.round(p)});return a.sort((s,p)=>p.count-s.count||s.className.localeCompare(p.className))}function qhe(e,t,n){if(n<=0)return 0;const a=t-e;return a<=0?0:Math.round(a*1e3/n)}function Bhe(e){if(e===null)return"—";const t=[e.resolution,`${e.fps}fps`];return e.dropped>0&&t.push(`${e.dropped} dropped`),t.join(" · ")}const Fhe=1200,Uhe=1e3;function Hhe({deviceId:e}){const[t,n]=T.useState([]),a=T.useRef(void 0);return wi(We.MotionAnalysis,s=>{const p=s.data;!p||p.deviceId!==e||(n(zhe(p)),a.current&&clearTimeout(a.current),a.current=setTimeout(()=>n([]),Fhe))}),T.useEffect(()=>()=>{a.current&&clearTimeout(a.current)},[e]),t.length===0?null:v.jsx("div",{style:{position:"absolute",inset:0,overflow:"hidden",pointerEvents:"none"},children:t.map((s,p)=>v.jsx("div",{style:{position:"absolute",left:`${s.x*100}%`,top:`${s.y*100}%`,width:`${s.w*100}%`,height:`${s.h*100}%`,border:"1px dashed #f59e0b",borderRadius:2,background:`rgba(245,158,11,${Lhe(s.pixelCount)})`}},`${s.x}:${s.y}:${s.w}:${s.h}:${p}`))})}function $he({deviceId:e,anchor:t}){const[n,a]=T.useState(null);wi(We.PipelineAudioInferenceResult,h=>{const c=h.data;!c||c.deviceId!==e||a(c.frame.level?.dbfs??null)});const s=Ohe(n),p=jhe(t);if(p===null)return null;const f=p==="horizontal",m=p==="vertical";return v.jsx("div",{style:{...gO(t),pointerEvents:"none"},children:v.jsx("span",{style:{display:"flex",flexDirection:m?"column":"row",alignItems:m||f?"center":"flex-end",gap:m||f?4:3,padding:f||m?"4px 8px":"3px 6px",borderRadius:8,background:"rgba(0,0,0,0.7)"},children:Dhe(p).map(h=>{const c=h<s,x=Phe(p,h);return v.jsx("span",{style:{width:x.width,height:x.height,borderRadius:2,background:c?Nhe(h):"#71717a",opacity:c?1:.35}},h)})})})}function Qhe(e,t){if(typeof e!="object"||e===null)return null;const n=Reflect.get(e,"zoneAnalytics");if(typeof n!="object"||n===null)return null;const a=Reflect.get(n,"getCurrentSnapshot");if(typeof a!="object"||a===null)return null;const s=Reflect.get(a,"query");if(typeof s!="function")return null;const p=s.call(a,{deviceId:t});return p instanceof Promise?p:Promise.resolve(p)}function Vhe({system:e,deviceId:t,anchor:n}){const[a,s]=T.useState([]);return T.useEffect(()=>{let p=!1;const f=Qhe(e.trpcClient,t);if(f!==null)return f.then(m=>{p||s($A(m))}).catch(()=>{p||s([])}),()=>{p=!0}},[e,t]),wi(We.ZoneAnalyticsOccupancyChanged,p=>{const f=p.data;f.deviceId===t&&s($A(f))}),a.length===0?null:v.jsx("div",{style:{...gO(n),gap:4,pointerEvents:"none"},children:a.slice(0,4).map(p=>v.jsx("span",{style:{padding:"2px 6px",borderRadius:6,background:"rgba(0,0,0,0.75)",color:"#fafaf9",fontSize:11,fontWeight:700,fontFamily:"system-ui, sans-serif",whiteSpace:"nowrap"},children:`${p.className} ${p.count}`},p.className))})}function Ghe({containerRef:e}){const[t,n]=T.useState(null),a=T.useRef(null);return T.useEffect(()=>{const s=()=>{const f=e.current?.querySelector("video");if(!f){n(null);return}const m=typeof f.getVideoPlaybackQuality=="function"?f.getVideoPlaybackQuality():null,h=m?.totalVideoFrames??0,c=Date.now(),x=a.current;a.current={frames:h,at:c},n({resolution:f.videoWidth>0?`${f.videoWidth}x${f.videoHeight}`:"—",fps:x===null?0:qhe(x.frames,h,c-x.at),dropped:m?.droppedVideoFrames??0})};s();const p=setInterval(s,Uhe);return()=>{clearInterval(p),a.current=null}},[e]),v.jsx("div",{style:{position:"absolute",top:4,right:4,maxWidth:"90%",padding:"2px 6px",borderRadius:6,background:"rgba(0,0,0,0.7)",color:"#fafaf9",fontSize:10,fontWeight:600,fontFamily:"system-ui, sans-serif",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",pointerEvents:"none"},children:Bhe(t)})}const Zhe=1e4,QA=1e3,VA=[0,5e3,15e3,3e4],Khe=4;function Whe(e){const t=Math.max(0,Math.min(e,VA.length-1));return VA[t]??0}function Yhe(e){return!e.playing||e.lastFrameAt===null?!1:e.nowMs-e.lastFrameAt>=e.stallMs}function Xhe(e){const{containerRef:t,playing:n,onRecover:a,stallMs:s=Zhe}=e,p=e.now??Date.now,[f,m]=T.useState({recovering:!1,attempts:0}),h=T.useRef(null),c=T.useRef(0),x=T.useRef(0),M=T.useRef(a);M.current=a;const C=T.useRef(p);C.current=p;const E=T.useCallback(()=>{const R=C.current(),_=h.current;h.current=R,c.current>0&&_!==null&&R-_<s&&(c.current=0,m({recovering:!1,attempts:0}))},[s]);return T.useEffect(()=>{if(!n){h.current=null;return}const _=t.current?.querySelector("video");if(!_)return;let j=!1,D=null;if(typeof _.requestVideoFrameCallback=="function"){const L=()=>{j||(E(),D=_.requestVideoFrameCallback?.(L)??null)};return D=_.requestVideoFrameCallback(L),()=>{j=!0,D!==null&&_.cancelVideoFrameCallback?.(D)}}let z=_.currentTime;const B=setInterval(()=>{if(j)return;const L=_.currentTime;L!==z&&(z=L,E())},QA);return()=>{j=!0,clearInterval(B)}},[n,t,E]),T.useEffect(()=>{if(!n)return;const R=setInterval(()=>{const _=C.current();if(_<x.current||!Yhe({lastFrameAt:h.current,nowMs:_,stallMs:s,playing:n})||c.current>=Khe)return;const j=c.current;c.current=j+1,h.current=_,x.current=_+Whe(j+1)+s,m({recovering:!0,attempts:j+1}),M.current()},QA);return()=>clearInterval(R)},[n,s]),f}const Jhe=300,ege=130,tge=["devices","viewOptions"],nge={inline:tge,overflow:!1},age={inline:[],overflow:!0};function ige(e,t){return e>=Jhe&&t>=ege?nge:age}const rge=120,oge=68;function sge(e,t,n){return e&&t>=rge&&n>=oge}const lge=16/9,cge={left:0,top:0,width:0,height:0},GA=.5;function uge(e,t,n){if(!(e>0)||!(t>0))return cge;const a={left:0,top:0,width:e,height:t};if(!Number.isFinite(n))return a;const s=Math.min(e,t*n),p=s/n;return e-s<GA&&t-p<GA?a:{left:(e-s)/2,top:(t-p)/2,width:s,height:p}}const dge=500;function yO(e,t,n){const{motion:a,detection:s}=vde(e.trpcClient,t),p=T.useRef(0),f=T.useRef(0),m=T.useRef(0),h=T.useRef(!1),[,c]=T.useState(0),x=n?.audio??"off",M=n?.audioDb??-30,C=n?.audioHoldSec??5,E=n?.motionHoldSec??0,R=n?.detectionHoldSec??3,_=n?.detectionClasses??[],j=_.join(",");wi(We.MotionOnMotionChanged,B=>{const L=B.data;!L||L.deviceId!==t||!n?.motion||(L.detected===!0?(m.current=Date.now()+Math.max(1,E)*1e3,h.current=!0,c(G=>G+1)):L.detected===!1&&h.current&&(m.current=Date.now()+E*1e3,h.current=!1,c(G=>G+1)))}),wi(We.PipelineAudioInferenceResult,B=>{const L=B.data;if(!L||L.deviceId!==t||x==="off")return;(x==="sensor"?L.frame.detections.length>0:(L.frame.level?.dbfs??Number.NEGATIVE_INFINITY)>=M)&&(p.current=Date.now()+C*1e3,c(ae=>ae+1))}),T.useEffect(()=>{if(!s)return;s.detections.some(L=>_.length===0||_.includes(L.macroClass))&&(f.current=Date.now()+R*1e3,c(L=>L+1))},[s,R,j]),T.useEffect(()=>{const B=a!==null;(B||h.current)&&(m.current=Date.now()+E*1e3,B||c(L=>L+1)),h.current=B},[a,E]);const D=n?.enabled===!0;if(T.useEffect(()=>{if(!D)return;const B=setInterval(()=>c(L=>L+1),dge);return()=>clearInterval(B)},[D]),!n?.enabled)return null;const z=Date.now();return n.detection&&z<f.current?"detection":x!=="off"&&z<p.current?"audio":n.motion&&(a!==null||z<m.current)?"motion":null}const al={motion:"#DC2626",audio:"#3B82F6",detection:"#22C55E"},pge=2500,mge={person:"#f59e0b",vehicle:"#3b82f6",animal:"#22c55e",face:"#a855f7",plate:"#ec4899"},fge="#ef4444";function hge(e){return mge[e]??fge}function pp(e){return e<0?0:e>1?1:e}function gge(e){if(e.width<=0||e.height<=0)return[];const t=[];for(const n of e.detections){const{bbox:a}=n,s=pp(a.x/e.width),p=pp(a.y/e.height),f=pp((a.x+a.width)/e.width),m=pp((a.y+a.height)/e.height);f<=s||m<=p||t.push({label:n.macroClass,score:n.score,x1:s,y1:p,x2:f,y2:m})}return t}function vge({deviceId:e}){const[t,n]=T.useState([]),a=T.useRef(void 0);return wi(We.DetectionResult,s=>{const p=s.data;!p||p.frame.deviceId!==e||(n(gge(p.frame)),a.current&&clearTimeout(a.current),a.current=setTimeout(()=>n([]),pge))}),T.useEffect(()=>()=>{a.current&&clearTimeout(a.current),n([])},[e]),t.length===0?null:v.jsx("div",{style:{position:"absolute",inset:0,overflow:"hidden",pointerEvents:"none"},children:t.map((s,p)=>{const f=hge(s.label),m=Math.round(s.score*100);return v.jsx("div",{style:{position:"absolute",left:`${s.x1*100}%`,top:`${s.y1*100}%`,width:`${(s.x2-s.x1)*100}%`,height:`${(s.y2-s.y1)*100}%`,border:`2px solid ${f}`,borderRadius:3},children:v.jsx("span",{style:{position:"absolute",left:-2,bottom:"100%",background:f,color:"#fff",fontSize:10,fontWeight:700,fontFamily:"system-ui, sans-serif",lineHeight:"14px",padding:"0 4px",borderRadius:3,whiteSpace:"nowrap"},children:`${s.label} ${m}%`})},`${s.label}-${p}`)})})}function yge(e,t,n,a){const s=Number.isFinite(e)&&e>0?e:0,p=Number.isFinite(t)&&t>0?t:0;if(!Number.isFinite(n)||!Number.isFinite(a)||n<=0||a<=0)return{width:s,height:p};const f=Math.min(s/n,p/a);return{width:n*f,height:a*f}}function bge(e,t,n){return!Number.isFinite(e)||!Number.isFinite(t)||!Number.isFinite(n)?0:Math.max(0,(n*t-e)/2)}function ZA(e,t,n,a){if(!Number.isFinite(e))return 0;const s=bge(t,n,a);return Math.max(-s,Math.min(s,e))}const Sge=4,KA=8,xge=300;function WA(e,t){return Math.hypot(e.x-t.x,e.y-t.y)}function YA(e){return e>1?"none":"pan-y"}function kge({children:e,onTap:t}){const n=T.useRef(null),a=T.useRef(null),s=T.useRef(new Map),p=T.useRef(1),f=T.useRef(0),m=T.useRef(0),h=T.useRef(null),c=T.useRef(null),x=T.useRef(0),M=()=>{const D=a.current;D&&(D.style.transform=`translate(${f.current}px, ${m.current}px) scale(${p.current})`);const z=n.current;z&&(z.style.touchAction=YA(p.current))},C=()=>{const D=n.current?.getBoundingClientRect();if(!D||D.width<=0||D.height<=0)return;const z=a.current?.querySelector("video")??null,B=z?null:a.current?.querySelector("img")??null,L=z?.videoWidth??B?.naturalWidth??0,G=z?.videoHeight??B?.naturalHeight??0,ae=yge(D.width,D.height,L,G);f.current=ZA(f.current,D.width,ae.width,p.current),m.current=ZA(m.current,D.height,ae.height,p.current)},E=()=>{p.current=1,f.current=0,m.current=0,M()},R=D=>{try{D.currentTarget.setPointerCapture(D.pointerId)}catch{}if(s.current.set(D.pointerId,{x:D.clientX,y:D.clientY}),s.current.size===2){const z=[...s.current.values()],B=z[0],L=z[1];B&&L&&(h.current={dist:WA(B,L),scale:p.current,cx:(B.x+L.x)/2,cy:(B.y+L.y)/2,tx:f.current,ty:m.current}),c.current=null}else s.current.size===1&&(c.current={x:D.clientX,y:D.clientY,tx:f.current,ty:m.current,moved:!1})},_=D=>{if(!s.current.has(D.pointerId))return;if(s.current.set(D.pointerId,{x:D.clientX,y:D.clientY}),s.current.size>=2&&h.current){const B=[...s.current.values()],L=B[0],G=B[1];if(!L||!G)return;const ae=WA(L,G);h.current.dist>0&&(p.current=Math.max(1,Math.min(Sge,h.current.scale*(ae/h.current.dist))));const V=(L.x+G.x)/2,F=(L.y+G.y)/2;f.current=h.current.tx+(V-h.current.cx),m.current=h.current.ty+(F-h.current.cy),C(),M();return}const z=c.current;if(s.current.size===1&&z){const B=D.clientX-z.x,L=D.clientY-z.y;(Math.abs(B)>KA||Math.abs(L)>KA)&&(z.moved=!0),p.current>1&&(f.current=z.tx+B,m.current=z.ty+L,C(),M())}},j=D=>{const z=s.current.size===1,B=c.current;if(s.current.delete(D.pointerId),s.current.size<2&&(h.current=null),s.current.size===0&&(c.current=null,z&&B&&!B.moved)){const L=Date.now();L-x.current<xge?(x.current=0,E()):(x.current=L,t())}};return v.jsx("div",{ref:n,style:{position:"absolute",inset:0,overflow:"hidden",touchAction:YA(1)},onPointerDown:R,onPointerMove:_,onPointerUp:j,onPointerCancel:j,children:v.jsx("div",{ref:a,style:{width:"100%",height:"100%",transformOrigin:"center center",willChange:"transform"},children:e})})}function wge(e,t){if(t==null||t.length===0)return null;if(/^https?:\/\//i.test(t))return t;const n=e.replace(/\/+$/,""),a=t.startsWith("/")?t:`/${t}`;return`${n}${a}`}function Mge(e,t){const n=t[0];return n===void 0?null:wge(e,n.url)}function Cge(e,t){return{handleOffer:(n,a,s)=>e(t,n,a,s),reoffer:(n,a,s,p)=>e(s,a,n,p)}}const Age=3500;function Ege(e){return e==="auto"?{kind:"adaptive"}:{kind:"profile",profile:e}}function Rge({system:e,deviceId:t,name:n,online:a,quality:s,muted:p,paused:f,showName:m,audioActive:h,micActive:c,onTogglePause:x,onToggleAudio:M,onToggleMic:C,onOpen:E,ptzSupported:R,onPtz:_,cellW:j,cellH:D,onCellPanel:z,highlight:B,showBoxes:L,overlay:G,reconnectSignal:ae,onStall:V,posterUrl:F,labels:fe=bm,editable:ke,span:Me,onRemove:Ae,onResize:Ee}){const{handleOffer:we,getIceServers:ge,addIceCandidate:Q,getIceCandidates:oe,closeSession:xe,getSessionState:Ie,getSessionDebug:he}=N5(e.trpcClient,t),q=yO(e,t,B),W=T.useRef(null),[le,be]=T.useState(0),[ee,ve]=T.useState("idle"),De=Xhe({containerRef:W,playing:ee==="playing"&&!f,onRecover:()=>{be(et=>et+1),V?.(t)}}),[Fe,re]=T.useState(void 0);T.useEffect(()=>{if(F||f)return;let et=!1;const mn=j!==void 0&&j>0?Math.round(j):void 0;return e.trpcClient.snapshot.getSnapshotLinks.query({targets:[{deviceId:t,...mn!==void 0?{width:mn}:{}}]}).then(ra=>{if(et)return;const oa=Mge(e.serverUrl,ra??[]);oa!==null&&re(oa)}).catch(()=>{}),()=>{et=!0}},[F,f,e,t,j]);const Te=F??Fe,Je=T.useMemo(()=>Ege(s),[s]),Ze=`grid:${t}:${s}`,It=T.useMemo(()=>Cge(we,Je),[we,Je]),[_e,Ye]=T.useState(!1),Re=T.useRef(null),Qe=()=>{Re.current&&clearTimeout(Re.current),Re.current=setTimeout(()=>Ye(!1),Age)},Xe=()=>{Ye(!0),Qe()},Nt=()=>{Ye(et=>{const mn=!et;return mn&&Qe(),mn})},rt=ige(j??0,D??0),$t=et=>{et.stopPropagation(),Xe()},en=j!==void 0&&D!==void 0&&j>0&&D>0,In=uge(j??0,D??0,lge),pn=en?{position:"absolute",left:In.left,top:In.top,width:In.width,height:In.height}:{position:"absolute",inset:0},Hn=Math.max(1,Math.round(Me?.cw??1)),Sa=Math.max(1,Math.round(Me?.ch??1)),li=en&&j!==void 0?j/Hn:0,$n=en&&D!==void 0?D/Sa:0,ci=sge(ke===!0,j??0,D??0);return T.useEffect(()=>()=>{Re.current&&clearTimeout(Re.current)},[]),v.jsxs("div",{ref:W,"data-stall-recovering":De.recovering?"true":void 0,style:{position:"relative",width:"100%",height:"100%",background:"#000"},children:[v.jsxs("div",{style:pn,children:[v.jsx(kge,{onTap:Nt,children:f?v.jsx("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",color:"#fafaf9"},children:v.jsx(JA,{size:28})}):v.jsx(kN,{serverUrl:e.serverUrl,streamKey:Ze,autoPlay:!0,muted:p,showControls:!1,className:"w-full h-full",handleOffer:It.handleOffer,reoffer:It.reoffer,getSessionState:Ie,getSessionDebug:he,getIceServers:ge,addIceCandidate:Q,getIceCandidates:oe,closeSession:xe,reconnectSignal:(ae??0)+le,onStateChange:ve,posterUrl:Te,onClientNetworkSample:s==="auto"?et=>{e.trpcClient.networkQuality.reportClientStats.mutate({deviceId:t,...et}).catch(()=>{})}:void 0},Ze)}),L&&!f?v.jsx(vge,{deviceId:t}):null,G?.motionBoxes===!0&&!f?v.jsx(Hhe,{deviceId:t}):null]}),UA(G?.audioMeter)&&!f?v.jsx($he,{deviceId:t,anchor:G.audioMeter}):null,UA(G?.occupancy)&&!f?v.jsx(Vhe,{system:e,deviceId:t,anchor:G.occupancy}):null,G?.stats===!0&&!f?v.jsx(Ghe,{containerRef:W}):null,q&&(()=>{const et=B?.appearance,mn=q==="motion"?et?.motionColor??al.motion:q==="audio"?et?.audioColor??al.audio:et?.detectionColor??al.detection,ra=et?.thickness??3;return v.jsx("div",{style:{position:"absolute",inset:0,border:`${ra}px solid ${mn}`,boxShadow:`inset 0 0 12px ${mn}`,pointerEvents:"none"}})})(),(m||_e)&&v.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:m||_e?1:0,transition:"opacity 150ms ease"},children:[v.jsx("span",{style:{width:8,height:8,borderRadius:4,background:a?"#34d399":"#71717a"}}),v.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:n})]}),v.jsxs("div",{style:{position:"absolute",inset:0,opacity:_e?1:0,transition:"opacity 150ms ease",pointerEvents:"none"},children:[v.jsx("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:v.jsx(Or,{label:f?fe.play:fe.pause,big:!0,enabled:_e,onClick:et=>{$t(et),x(t)},children:f?v.jsx(JA,{size:22}):v.jsx(Ige,{size:22})})}),v.jsxs("div",{style:{position:"absolute",left:8,bottom:8,display:"flex",gap:8,pointerEvents:"none"},children:[v.jsx(Or,{label:h?fe.mute:fe.listen,active:h,enabled:_e,onClick:et=>{$t(et),M(t)},children:h?v.jsx(Tge,{size:18}):v.jsx(_ge,{size:18})}),v.jsx(Or,{label:c?fe.stopTalk:fe.talk,active:c,enabled:_e,onClick:et=>{$t(et),C(t)},children:v.jsx(Nge,{size:18,muted:!c})}),R&&_&&(!z||!rt.overflow)?v.jsx(Or,{label:fe.ptz,enabled:_e,onClick:et=>{$t(et),_(t)},children:v.jsx(Lge,{size:18})}):null,z?rt.inline.map(et=>v.jsx(Or,{label:et==="devices"?fe.linkedDevices:fe.viewOptions,enabled:_e,onClick:mn=>{$t(mn),z(t,et)},children:et==="devices"?v.jsx(jge,{size:18}):v.jsx(Pge,{size:18})},et)):null,z&&rt.overflow?v.jsx(Or,{label:fe.moreActions,enabled:_e,onClick:et=>{$t(et),z(t,"actions")},children:v.jsx(Dge,{size:18})}):null]}),v.jsx("div",{style:{position:"absolute",right:8,bottom:8,pointerEvents:"none"},children:v.jsx(Or,{label:fe.open,enabled:_e,onClick:et=>{$t(et),E(t)},children:v.jsx(Oge,{size:18})})}),ci&&Ae?v.jsx("div",{style:{position:"absolute",right:8,top:8,pointerEvents:"none"},children:v.jsx(Or,{label:fe.removeFromView,enabled:_e,onClick:et=>{$t(et),Ae(t)},children:v.jsx(zge,{size:18})})}):null,ci&&Ee?v.jsxs(v.Fragment,{children:[v.jsx(XA,{axis:"x",label:fe.resizeWidth,enabled:_e,track:li,span:Hn,onSpan:et=>{Xe(),Ee(t,et,Sa)}}),v.jsx(XA,{axis:"y",label:fe.resizeHeight,enabled:_e,track:$n,span:Sa,onSpan:et=>{Xe(),Ee(t,Hn,et)}})]}):null]})]})}function XA({axis:e,label:t,enabled:n,track:a,span:s,onSpan:p}){const f=T.useRef(null),m=h=>e==="x"?h.clientX:h.clientY;return v.jsx("div",{role:"separator","aria-label":t,"aria-orientation":e==="x"?"vertical":"horizontal",onPointerDown:h=>{h.stopPropagation(),h.currentTarget.setPointerCapture(h.pointerId),f.current={origin:m(h),base:s}},onPointerMove:h=>{if(f.current===null||!(a>0))return;h.stopPropagation();const c=Math.round((m(h)-f.current.origin)/a),x=Math.max(1,f.current.base+c);x!==s&&p(x)},onPointerUp:h=>{f.current=null,h.currentTarget.hasPointerCapture(h.pointerId)&&h.currentTarget.releasePointerCapture(h.pointerId)},onPointerCancel:()=>{f.current=null},style:{position:"absolute",...e==="x"?{right:0,top:"50%",width:14,height:48,transform:"translateY(-50%)"}:{bottom:0,left:"50%",width:48,height:14,transform:"translateX(-50%)"},borderRadius:7,background:"rgba(0,0,0,0.55)",border:"1px solid rgba(250,250,249,0.35)",cursor:e==="x"?"ew-resize":"ns-resize",touchAction:"none",pointerEvents:n?"auto":"none"}})}function Or({children:e,label:t,onClick:n,big:a=!1,active:s=!1,enabled:p=!0}){const f=a?52:40;return v.jsx("button",{type:"button","aria-label":t,onClick:n,style:{width:f,height:f,borderRadius:f/2,border:"none",display:"flex",alignItems:"center",justifyContent:"center",background:s?"rgba(59,130,246,0.85)":"rgba(0,0,0,0.55)",color:"#fafaf9",cursor:"pointer",padding:0,WebkitTapHighlightColor:"transparent",pointerEvents:p?"auto":"none"},children:e})}const Wr={fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};function JA({size:e}){return v.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",children:v.jsx("polygon",{points:"6 4 20 12 6 20 6 4",fill:"currentColor"})})}function Ige({size:e}){return v.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",children:[v.jsx("rect",{x:"6",y:"4",width:"4",height:"16",fill:"currentColor"}),v.jsx("rect",{x:"14",y:"4",width:"4",height:"16",fill:"currentColor"})]})}function Tge({size:e}){return v.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",...Wr,children:[v.jsx("polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"}),v.jsx("path",{d:"M19.07 4.93a10 10 0 010 14.14M15.54 8.46a5 5 0 010 7.07"})]})}function _ge({size:e}){return v.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",...Wr,children:[v.jsx("polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"}),v.jsx("line",{x1:"23",y1:"9",x2:"17",y2:"15"}),v.jsx("line",{x1:"17",y1:"9",x2:"23",y2:"15"})]})}function Nge({size:e,muted:t}){return v.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",...Wr,children:[v.jsx("path",{d:"M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"}),v.jsx("path",{d:"M19 10v2a7 7 0 0 1-14 0v-2M12 19v4"}),t&&v.jsx("line",{x1:"3",y1:"3",x2:"21",y2:"21"})]})}function Oge({size:e}){return v.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",...Wr,children:v.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 jge({size:e}){return v.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",...Wr,children:[v.jsx("path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5A5.5 5.5 0 1 0 7.5 11.5c.8.8 1.3 1.5 1.5 2.5"}),v.jsx("path",{d:"M9 18h6M10 22h4"})]})}function Pge({size:e}){return v.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",...Wr,children:[v.jsx("path",{d:"M3 6h18M3 12h18M3 18h18"}),v.jsx("circle",{cx:"8",cy:"6",r:"2"}),v.jsx("circle",{cx:"16",cy:"12",r:"2"}),v.jsx("circle",{cx:"10",cy:"18",r:"2"})]})}function Dge({size:e}){return v.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",children:[v.jsx("circle",{cx:"5",cy:"12",r:"2",fill:"currentColor"}),v.jsx("circle",{cx:"12",cy:"12",r:"2",fill:"currentColor"}),v.jsx("circle",{cx:"19",cy:"12",r:"2",fill:"currentColor"})]})}function zge({size:e}){return v.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",...Wr,children:v.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})}function Lge({size:e}){return v.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",...Wr,children:[v.jsx("path",{d:"M12 2v20M2 12h20"}),v.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 qge({wall:e,renderTile:t}){return v.jsx("div",{style:{position:"relative",width:e.wallW,height:e.wallH},children:e.placements.map(n=>v.jsx("div",{"data-device-id":n.deviceId,style:{position:"absolute",left:n.x,top:n.y,width:n.w,height:n.h},children:t(n.deviceId,n.w,n.h)},n.deviceId))})}function eE({message:e}){return T.useEffect(()=>Si(hO("error",e)),[e]),v.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]})}const Bge=["setDevices","setSpans"];function Fge(e,t){return e.length===t.length&&e.every((n,a)=>n===t[a])}function Uge({system:e,config:t}){const[n,a]=T.useState(t.devices),[s,p]=T.useState(()=>new Set(t.audioOnIds??[])),f=fO(),m=T.useRef(f.setActiveMic);m.current=f.setActiveMic;const[h,c]=T.useState(()=>new Set(t.pausedIds??[])),[x,M]=T.useState(t.highlight),[C,E]=T.useState(t.activeOnly??!1),[R,_]=T.useState(t.showBoxes??!1),[j,D]=T.useState(()=>t.overlays??{}),[z,B]=T.useState(()=>t.spans??{}),L=She(n,x),G=T.useMemo(()=>C?n.filter(ee=>L.has(ee)):n,[C,n,L]),[ae,V]=T.useState(t.quality),[F,fe]=T.useState(t.layout),[ke,Me]=T.useState(t.showName),[Ae,Ee]=T.useState(0),we=T.useMemo(()=>Kfe(t.labels),[t.labels]),[ge,Q]=T.useState(()=>t.snapshots??{}),oe=T.useMemo(()=>new Set(t.ptzIds??[]),[t.ptzIds]),[xe,Ie]=T.useState({w:window.innerWidth,h:window.innerHeight}),he=we.camera,[q,W]=T.useState({});T.useEffect(()=>{let ee=!1;return e.trpcClient.deviceManager.listAll.query({deviceIds:[...n],projection:"slim"}).then(ve=>{if(ee)return;const De={};for(const Fe of ve)De[Fe.id]={name:Fe.name??`${he} ${Fe.id}`,online:Fe.online??!1};W(De)}).catch(()=>{}),()=>{ee=!0}},[e,n,he]),T.useEffect(()=>(window.__camstackGrid={setAudioOn:ee=>p(new Set(ee)),setMutedAll:ee=>{ee&&p(new Set)},setActiveMic:ee=>m.current(ee),setHighlight:ee=>M(ee),setActiveOnly:ee=>E(ee),setShowBoxes:ee=>_(ee),setOverlays:ee=>D(ee),setPaused:ee=>c(new Set(ee)),setDevices:ee=>a(ve=>Fge(ve,ee)?ve:[...ee]),setSpans:ee=>B(ee),setQuality:ee=>V(ee),setLayout:ee=>fe(ee),setShowName:Me,setShowBadges:()=>{},setSnapshots:ee=>Q(ee),fit:(ee,ve)=>Ie({w:ee,h:ve}),reconnect:()=>Ee(ee=>ee+1)},Si(hO("ready",void 0,Bge)),()=>{window.__camstackGrid&&delete window.__camstackGrid}),[]),T.useEffect(()=>Iu(ee=>{const ve=window.__camstackGrid;if(!ve)return;switch(ee.kind){case"setAudioOn":ve.setAudioOn(ee.value);break;case"setMutedAll":ve.setMutedAll(ee.value);break;case"setActiveMic":ve.setActiveMic(ee.value);break;case"setHighlight":ve.setHighlight(ee.value);break;case"setActiveOnly":ve.setActiveOnly(ee.value);break;case"setShowBoxes":ve.setShowBoxes(ee.value===!0);break;case"setOverlays":ve.setOverlays(ee.value);break;case"setPaused":ve.setPaused(ee.value);break;case"setDevices":ve.setDevices(ee.value);break;case"setSpans":ve.setSpans(ee.value);break;case"setQuality":ve.setQuality(lO.parse(ee.value));break;case"setLayout":ve.setLayout(ee.value);break;case"setShowName":ve.setShowName(ee.value);break;case"setShowBadges":ve.setShowBadges(ee.value);break;case"setSnapshots":ve.setSnapshots(ee.value);break;case"fit":ve.fit(ee.w,ee.h);break;case"reconnect":ve.reconnect();break}}),[]);const le=T.useMemo(()=>vhe(G,xe.w,xe.h,F,z),[G,xe.w,xe.h,F,z]),be=T.useRef(null);return T.useEffect(()=>{const ee=be.current;if(!ee)return;const ve=[];ee.querySelectorAll("[data-device-id]").forEach(De=>{const Fe=Number(De.dataset.deviceId),re=De.getBoundingClientRect();ve.push({deviceId:Fe,rect:{x:re.x,y:re.y,w:re.width,h:re.height}})}),ve.length&&Si(Rhe(ve))},[le,G]),v.jsxs("div",{ref:be,style:{position:"fixed",inset:0,background:"#000",display:"flex",alignItems:"center",justifyContent:"center"},children:[C&&G.length===0&&v.jsx("div",{style:{color:"#a1a1aa",fontFamily:"system-ui, sans-serif",fontSize:14,padding:24,textAlign:"center"},children:we.noActiveCameras}),v.jsx(qge,{wall:le,renderTile:(ee,ve,De)=>v.jsx(Rge,{system:e,deviceId:ee,name:q[ee]?.name??`${we.camera} ${ee}`,online:q[ee]?.online??!1,quality:ae,muted:!s.has(ee),paused:h.has(ee),showName:ke,audioActive:s.has(ee),micActive:f.activeMicId===ee,onTogglePause:Fe=>Si(whe(Fe)),onToggleAudio:Fe=>Si(khe(Fe)),onToggleMic:f.toggleMic,onOpen:Fe=>Si(xhe(Fe)),ptzSupported:oe.has(ee),onPtz:Fe=>Si(Mhe(Fe)),cellW:ve,cellH:De,onCellPanel:t.cellPanels===!1?void 0:(Fe,re)=>Si(Che(Fe,re)),highlight:x,showBoxes:R,overlay:j[String(ee)],reconnectSignal:Ae,posterUrl:ge[String(ee)],editable:t.editable===!0,span:z[String(ee)],onRemove:Fe=>Si(Ahe(Fe)),onResize:(Fe,re,Te)=>Si(Ehe(Fe,re,Te)),labels:we})})]})}function Hge(){const e=Qm("grid",()=>window.__CAMSTACK_GRID__,uO,che),t=T.useMemo(()=>{if(e===null||!e.ok)return null;const n=jm({serverUrl:e.config.serverUrl,token:e.config.token}),a=new m_({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}});return{system:n,queryClient:a}},[e]);return T.useEffect(()=>{if(t)return()=>t.system.close()},[t]),e===null?null:e.ok?t?v.jsx(Y_,{system:t.system,children:v.jsx(h_,{client:t.queryClient,children:v.jsx(y.Provider,{client:t.system.trpcClient,queryClient:t.queryClient,children:v.jsx(Uge,{system:t.system,config:e.config})})})}):v.jsx(eE,{message:"Failed to initialise the grid embed"}):v.jsx(eE,{message:e.error})}const Y0=tt([d({kind:$("adaptive")}),d({kind:$("profile"),profile:Ut})]),$ge=d({deviceId:l().int().nonnegative(),target:Y0.optional(),muted:A().optional(),stats:A().optional(),snapshot:o().optional(),atMs:l().int().positive().optional()});function Qge(e){const t=$ge.safeParse(e);return t.success?t.data:null}const Vge=["live","loading","playing","paused","gap","ended","error"];function Gge(e){return typeof e=="string"&&Vge.includes(e)}const wo="low",tE=5e3;class Zge{constructor(t){this.deps=t,this.deps.channel.addEventListener("message",this.onMessage)}deps;begun=!1;disposed=!1;lastSentProfile=null;degradedRequest=null;positionsSeen=0;firstFrameAnnounced=!1;rvfcHandle=null;lastPushSeq=null;retargets=0;renders=0;acks=0;lastCursorMs=null;lastState=null;playIntentAt=null;playIntentKind=null;playIntentDragId=void 0;pendingUpgrade=null;upgradeTimer=null;upgradeWarmTimer=null;onMessage=t=>{if(this.disposed||typeof t.data!="string")return;let n;try{n=JSON.parse(t.data)}catch{return}if(typeof n!="object"||n===null)return;const a=n;if(a.t==="liveProfile"&&(a.profile==="high"||a.profile==="mid"||a.profile==="low")){this.deps.onLiveProfile?.(a.profile);return}if(a.t==="servedProfile"&&(a.profile==="high"||a.profile==="mid"||a.profile==="low")&&typeof a.requested=="string"){const s=a.requested;this.lastSentProfile=a.profile,this.degradedRequest=a.profile===s?null:s,this.degradedRequest!==null&&this.pendingUpgrade?.desiredProfile===this.degradedRequest&&(this.deps.onLog?.("scrub:playback-upgrade-vetoed",{to:this.degradedRequest}),this.cancelPlaybackUpgrade()),this.deps.onServedProfile?.({profile:a.profile,requested:s});return}if(a.t==="state"&&Gge(a.state)){this.lastState=a.state,a.state==="playing"||a.state==="paused"?(this.maybeArmPlaybackUpgrade(),this.playIntentAt!==null&&(this.deps.onLog?.("playback:ready",{kind:this.playIntentKind,state:a.state,waitMs:Math.round(performance.now()-this.playIntentAt),dragId:this.playIntentDragId}),this.playIntentAt=null,this.playIntentKind=null,this.playIntentDragId=void 0)):(a.state==="live"||a.state==="gap"||a.state==="ended"||a.state==="error")&&this.cancelPlaybackUpgrade(),this.deps.onState?.(a.state);return}a.t!=="position"||typeof a.epochMs!="number"||(this.lastCursorMs=a.epochMs,this.deps.onPosition?.(a.epochMs),typeof a.seq=="number"&&(this.lastPushSeq=a.seq),this.begun&&(this.positionsSeen+=1,this.rvfcCapable()||(this.acks+=1,this.sendAck())))};sendAck(){this.send(this.lastPushSeq===null?{t:"scrubAck"}:{t:"scrubAck",seq:this.lastPushSeq})}rvfcCapable(){return typeof this.deps.video()?.requestVideoFrameCallback=="function"}send(t){return this.disposed||this.deps.channel.readyState!=="open"?!1:(this.deps.channel.send(JSON.stringify(t)),!0)}sendPlayRecorded(t,n,a,s,p){const f=this.send({t:"playRecorded",deviceId:t,epoch:n,profile:a});return f&&(this.lastSentProfile=a,this.playIntentAt=performance.now(),this.playIntentKind=s,this.playIntentDragId=p,this.deps.onLog?.("playback:intent",{kind:s,deviceId:t,epochMs:n,profile:a,dragId:p})),f}maybeArmPlaybackUpgrade(){if(this.pendingUpgrade===null||this.upgradeTimer!==null||this.disposed)return;this.upgradeTimer=setTimeout(()=>this.firePlaybackUpgrade(),tE);const t=this.pendingUpgrade;this.upgradeWarmTimer=setTimeout(()=>{if(this.upgradeWarmTimer=null,this.pendingUpgrade===null||this.disposed)return;const n=this.lastCursorMs??t.landEpochMs;this.warm(n,t.desiredProfile)},Math.max(0,tE-1500))}firePlaybackUpgrade(){this.upgradeTimer=null;const t=this.pendingUpgrade;if(this.pendingUpgrade=null,!t||this.disposed)return;const n=this.lastCursorMs??t.landEpochMs;this.sendPlayRecorded(t.deviceId,n,t.desiredProfile,"upgrade"),this.deps.onLog?.("scrub:playback-upgrade",{from:wo,to:t.desiredProfile,epochMs:n})}cancelPlaybackUpgrade(){this.upgradeTimer!==null&&(clearTimeout(this.upgradeTimer),this.upgradeTimer=null),this.upgradeWarmTimer!==null&&(clearTimeout(this.upgradeWarmTimer),this.upgradeWarmTimer=null),this.pendingUpgrade=null}playRecorded(t,n,a){return this.cancelPlaybackUpgrade(),this.sendPlayRecorded(t,n,a,"play")}upgradePlayback(t,n,a){return a===this.lastSentProfile?!0:(this.cancelPlaybackUpgrade(),this.warm(n,a),this.sendPlayRecorded(t,n,a,"upgrade"))}landFromScrub(t,n,a,s){return this.end(),this.cancelPlaybackUpgrade(),this.sendPlayRecorded(t,n,wo,"land",s)?(this.lastCursorMs=n,a===this.degradedRequest?this.deps.onLog?.("scrub:playback-upgrade-vetoed",{to:a,epochMs:n}):a!==wo&&(this.pendingUpgrade={deviceId:t,desiredProfile:a,landEpochMs:n},this.warm(n,a),(this.lastState==="playing"||this.lastState==="paused")&&this.maybeArmPlaybackUpgrade()),!0):!1}seek(t){this.cancelPlaybackUpgrade();const n=this.send({t:"seek",epoch:t});return n&&(this.playIntentAt=performance.now(),this.playIntentKind="seek",this.playIntentDragId=void 0,this.deps.onLog?.("playback:intent",{kind:"seek",epochMs:t})),n}warm(t,n=wo){return this.send({t:"warm",epoch:t,profile:n})}setRate(t){return this.send({t:"setRate",rate:t})}stepFrame(t){return this.send({t:"stepFrame",dir:t})}commit(t,n){return this.end(),this.send(n!==void 0?{t:"scrubCommit",epoch:t,dragId:n}:{t:"scrubCommit",epoch:t})}goLive(){this.cancelPlaybackUpgrade();const t=this.send({t:"goLive"});return t&&this.deps.onLog?.("scrub:push-golive",{}),this.end(),t}isActive(){return this.begun&&!this.disposed&&this.deps.channel.readyState==="open"}isOpen(){return!this.disposed&&this.deps.channel.readyState==="open"}begin(t){return this.disposed||this.deps.channel.readyState!=="open"?!1:(this.begun||(this.begun=!0,this.positionsSeen=0,this.firstFrameAnnounced=!1,this.retargets=0,this.renders=0,this.acks=0,this.cancelPlaybackUpgrade(),this.lastSentProfile!==wo&&(this.lastSentProfile=wo,this.send({t:"setProfile",profile:wo})),this.send(t!==void 0?{t:"scrubStart",dragId:t}:{t:"scrubStart"}),this.armRenderAck(),this.deps.onLog?.("scrub:push-begin",{rvfc:this.rvfcCapable(),dragId:t})),!0)}retarget(t,n){this.isActive()&&(this.retargets+=1,this.send(n?{t:"scrubTo",epoch:t,m:n.mode,v:Math.round(n.velocityPxPerS)}:{t:"scrubTo",epoch:t}))}end(){this.begun&&this.deps.onLog?.("scrub:push-drag-end",{retargets:this.retargets,positions:this.positionsSeen,renders:this.renders,acks:this.acks}),this.begun=!1,this.cancelRenderAck()}dispose(){this.cancelPlaybackUpgrade(),this.end(),this.disposed=!0,this.deps.channel.removeEventListener("message",this.onMessage)}armRenderAck(){const t=this.deps.video();t?.requestVideoFrameCallback&&(this.rvfcHandle=t.requestVideoFrameCallback(()=>{this.rvfcHandle=null,!(!this.begun||this.disposed)&&(this.positionsSeen>0&&(this.renders+=1,this.acks+=1,this.sendAck(),this.firstFrameAnnounced||(this.firstFrameAnnounced=!0,this.deps.onFirstFrame?.()),this.deps.onLog?.("scrub:drawn",{depth:"push"})),this.armRenderAck())}))}cancelRenderAck(){this.rvfcHandle!==null&&(this.deps.video()?.cancelVideoFrameCallback?.(this.rvfcHandle),this.rvfcHandle=null)}}function Kge(e,t,n,a){return e?.isOpen()?(e.warm(n),e.playRecorded(t,n,a)):!1}const Wge=24e4;function Yge(e,t=Wge){if(t<=0)return[e];const n=[];for(let a=0;a<e.length;a+=t)n.push(e.slice(a,a+t));return n.length===0?[""]:n}const Xge=["video/mp4;codecs=avc1.42E01E,mp4a.40.2","video/webm;codecs=vp8,opus","video/webm;codecs=vp9,opus"],nE=["video/mp4;codecs=avc1.42E01E","video/mp4","video/webm;codecs=vp8","video/webm"];function Jge(e=n=>typeof MediaRecorder<"u"&&MediaRecorder.isTypeSupported(n),t){const n=t?.audio?[...Xge,...nE]:nE;for(const a of n)try{if(e(a))return a}catch{}return""}function eve(e,t){const n=[...e.getVideoTracks()],a=t?.getAudioTracks()??[],s=a.length>0?a.map(p=>{const f=p.clone();return"enabled"in f&&(f.enabled=!0),f}):[...e.getAudioTracks()];return[...n,...s]}function tve(e,t=30){const n=e;try{if(typeof n.captureStream=="function"){const a=n.captureStream(t);if(a.getVideoTracks().length>0)return a}}catch{}try{if(typeof n.mozCaptureStream=="function"){const a=n.mozCaptureStream(t);if(a.getVideoTracks().length>0)return a}}catch{}return nve(e,t)}function nve(e,t){if(e.videoWidth<2||e.videoHeight<2||typeof document>"u")return null;const n=document.createElement("canvas");n.width=e.videoWidth,n.height=e.videoHeight;const a=n.getContext("2d");if(!a||typeof n.captureStream!="function")return null;let s=!0;const p=()=>{if(s){try{a.drawImage(e,0,0,n.width,n.height)}catch{}requestAnimationFrame(p)}};p();const f=n.captureStream(t),m=f.getVideoTracks()[0];if(m){const h=m.stop.bind(m);m.stop=()=>{s=!1,h()}}return f}function ave(e){return new Promise((t,n)=>{const a=new FileReader;a.onload=()=>{const s=String(a.result??""),p=s.indexOf(",");t(p>=0?s.slice(p+1):s)},a.onerror=()=>n(a.error??new Error("read failed")),a.readAsDataURL(e)})}function ive(){return`c${Date.now().toString(36)}${Math.random().toString(36).slice(2,8)}`}function rve(e){let t=null,n=[],a=null,s="",p=!1;const f=()=>{if(t=null,n=[],p=!1,a){for(const h of a.getTracks())try{h.stop()}catch{}a=null}},m=h=>{f(),e.emit({type:"liveCaptureError",message:h})};return{start(){if(t)return;const h=e.getVideo();if(!h){m("no video");return}if(typeof MediaRecorder>"u"){m("MediaRecorder missing");return}const c=tve(h);if(!c){m("no video");return}const x=h.srcObject instanceof MediaStream?h.srcObject:null,M=eve(c,x);if(x&&x.getAudioTracks().length>0)for(const _ of c.getAudioTracks())try{_.stop()}catch{}const C=new MediaStream(M);a=C;const E=M.some(_=>_.kind==="audio"),R=Jge(void 0,{audio:E});try{t=R?new MediaRecorder(C,{mimeType:R,videoBitsPerSecond:25e5,...E?{audioBitsPerSecond:128e3}:{}}):new MediaRecorder(C)}catch(_){m(_ instanceof Error?_.message:"MediaRecorder missing");return}n=[],s=ive(),p=!1,t.ondataavailable=_=>{_.data&&_.data.size>0&&n.push(_.data)},t.onerror=()=>m("MediaRecorder missing");try{t.start(1e3)}catch(_){m(_ instanceof Error?_.message:"MediaRecorder missing")}},stop(){const h=t;if(!h||p){h||m("no video");return}p=!0;const c=s,x=h.mimeType||"video/mp4";h.onstop=()=>{const M=new Blob(n,{type:x});if(f(),M.size===0){e.emit({type:"liveCaptureError",message:"empty capture"});return}ave(M).then(C=>{e.emit({type:"liveCaptureStart",id:c,mime:x});const E=Yge(C),R=E.length;E.forEach((_,j)=>{e.emit({type:"liveCaptureChunk",id:c,index:j,total:R,data:_})}),e.emit({type:"liveCaptureDone",id:c})}).catch(C=>{e.emit({type:"liveCaptureError",message:C instanceof Error?C.message:"encode failed"})})};try{typeof h.requestData=="function"&&h.requestData(),h.stop()}catch(M){m(M instanceof Error?M.message:"stop failed")}},abort(){if(t&&t.state!=="inactive")try{t.stop()}catch{}f()}}}const ove=8,sve=2.5;function lve(e){return e>=ove?"high":e>=sve?"mid":"low"}function cve(e,t){return e.kind==="profile"?e.profile:"low"}function uve(e,t){return e.kind==="profile"?e.profile:lve(t)}const dve=d({serverUrl:o().min(1),token:o().min(1),deviceId:l().int().nonnegative(),target:Y0,muted:A(),stats:A().optional(),highlight:cO.optional(),snapshot:o().optional(),initialSeekMs:l().positive().optional()}),aE=["setDevice","setDevice.atMs"];function hb(e,t){tn(t!==void 0?{type:"state",state:e,message:t,caps:aE}:{type:"state",state:e,caps:aE})}function pve(e){switch(e){case"playing":return"playing";case"error":return"error";case"connecting":case"disconnected":case"idle":return"connecting"}}function iE(e,t){return cve(e)}async function mve(){if(typeof window>"u")return null;const e=window.location.origin.replace(/\/+$/,""),t=new AbortController,n=window.setTimeout(()=>t.abort(),2500),a=performance.now();try{const s=await fetch(`${e}/adaptive-probe`,{signal:t.signal});if(!s.ok)return null;const p=await s.arrayBuffer(),f=Math.max(1,performance.now()-a);return p.byteLength<1024?null:p.byteLength*8/f/1e3}catch{return null}finally{window.clearTimeout(n)}}function rE(e,t,n,a){a.kind==="adaptive"&&mve().then(s=>{if(s===null)return;const p=uve(a,s);e.upgradePlayback(t,n,p)})}function fve(e){return e.kind==="adaptive"?{kind:"adaptive"}:{kind:"profile",profile:e.profile}}function hve(e){return e.kind==="adaptive"?"embed:adaptive":`embed:profile:${e.profile}`}function gve(e){const t=dve.safeParse(e);return t.success?{ok:!0,config:t.data}:{ok:!1,error:t.error.issues.map(n=>`${n.path.join(".")||"(root)"}: ${n.message}`).join("; ")}}function oE({message:e}){return T.useEffect(()=>{hb("error",e)},[e]),v.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 vve({system:e,deviceId:t,initialTarget:n,initialMuted:a,initialStats:s,initialHighlight:p,initialSnapshot:f,initialSeekMs:m}){const[h,c]=T.useState(n);T.useEffect(()=>eO(t),[t]);const x=T.useRef(h);x.current=h;const[M,C]=T.useState(a),[E,R]=T.useState(s),[_,j]=T.useState(p),[D,z]=T.useState(f),[B,L]=T.useState(0),[G,ae]=T.useState({w:window.innerWidth,h:window.innerHeight}),V=yO(e,t,_),F=fO(),fe=T.useRef(F.setActiveMic);fe.current=F.setActiveMic;const{handleOffer:ke,getIceServers:Me,addIceCandidate:Ae,getIceCandidates:Ee,closeSession:we,getSessionState:ge,getSessionDebug:Q}=N5(e.trpcClient,t),oe=T.useMemo(()=>fve(h),[h]),xe=T.useMemo(()=>(re,Te,Je)=>ke(oe,re,Te,Je),[ke,oe]),Ie=T.useMemo(()=>(re,Te,Je,Ze)=>ke(Je,Te,re,Ze),[ke]),he=T.useRef(null),q=T.useRef(null),W=T.useRef("low"),le=T.useRef(!1),be=T.useRef(null),ee=T.useRef(null),ve=()=>{const re=be.current;if(re===null)return;const Te=W.current,Je=`${re.phase}|${re.viewportWidth??"-"}x${re.viewportHeight??"-"}|${re.devicePixelRatio??"-"}|${re.downlinkMbps??"-"}|${re.prefersTier??"-"}|${re.probeOrigin??"unreachable"}|${Te}`;Je!==ee.current&&(ee.current=Je,tn({type:"log",scope:"adaptive",msg:"tier decision",data:{deviceId:t,requested:h.kind==="adaptive"?"adaptive":`pinned:${h.kind}`,phase:re.phase,viewportWidth:re.viewportWidth??null,viewportHeight:re.viewportHeight??null,devicePixelRatio:re.devicePixelRatio??null,downlinkMbps:re.downlinkMbps??null,prefersTier:re.prefersTier??null,probeOrigin:re.probeOrigin,liveProfile:Te}}))},De=T.useRef(m??null);T.useEffect(()=>{if(!M)return;const re=setInterval(()=>{let Te=0;for(const Je of Array.from(document.querySelectorAll("video"))){Je.muted||(Je.muted=!0,Te++);const Ze=Je.srcObject;if(Ze instanceof MediaStream)for(const It of Ze.getAudioTracks())It.enabled&&(It.enabled=!1,Te++)}Te>0&&tn({type:"log",scope:"live-audio",msg:"re-muted",data:{corrected:Te}})},1e3);return()=>clearInterval(re)},[M]),T.useEffect(()=>()=>he.current?.dispose(),[]),T.useEffect(()=>{const re=()=>{const Re=he.current;return Re?.isOpen()?Re:null},Te=()=>iE(x.current,W.current),Je=(Re,Qe)=>{rE(Re,t,Qe,x.current)},Ze=Re=>{le.current||(le.current=!0,tn({type:"log",scope:"recorded:session",msg:"pointer move with no open session",data:{what:Re}}),tn({type:"recState",state:"error"}))},It=(Re,Qe)=>{const Xe=re();return!Xe||!Qe(Xe)?(Ze(Re),!1):(le.current=!1,!0)},_e=(Re,Qe)=>{It("scrubCommit",Xe=>{const Nt=Xe.landFromScrub(t,Re,Te(),Qe);return Nt&&Je(Xe,Re),Nt})},Ye=rve({emit:tn,getVideo:()=>q.current});return window.__camstackEmbed={setMuted:Re=>C(Re),setTarget:Re=>{const Qe=Y0.safeParse(Re);Qe.success&&c(Qe.data)},setStats:Re=>R(Re),setHighlight:Re=>j(Re),setSnapshot:Re=>z(Re),setMic:Re=>fe.current(Re?t:null),fit:(Re,Qe)=>ae({w:Re,h:Qe}),reconnect:()=>L(Re=>Re+1),playRecorded:(Re,Qe,Xe)=>{Number.isFinite(Qe)&&It("playRecorded",Nt=>Nt.playRecorded(Re,Qe,Xe))},seek:Re=>{Number.isFinite(Re)&&It("seek",Qe=>{const Xe=Qe.playRecorded(t,Re,Te());return Xe&&Je(Qe,Re),Xe})},scrubCommit:(Re,Qe)=>{Number.isFinite(Re)&&_e(Re,Qe)},scrubStart:Re=>{tn({type:"log",scope:"recorded:scrub",msg:"scrubStart",data:{dragId:Re}}),It("scrubStart",Qe=>Qe.begin(Re))},scrubTo:(Re,Qe,Xe)=>{if(!Number.isFinite(Re))return;const Nt=(Qe==="fine"||Qe==="coarse")&&Number.isFinite(Xe)?{mode:Qe,velocityPxPerS:Xe}:void 0;It("scrubTo",rt=>rt.isActive()?(rt.retarget(Re,Nt),!0):!1)},timelineWarm:Re=>{Number.isFinite(Re)&&re()?.warm(Re)},scrubEnd:Re=>{Number.isFinite(Re)&&_e(Re)},setRate:Re=>{Number.isFinite(Re)&&It("setRate",Qe=>Qe.setRate(Re))},stepFrame:Re=>{Re!==1&&Re!==-1||It("stepFrame",Qe=>Qe.stepFrame(Re))},goLive:()=>{It("goLive",Re=>Re.goLive())&&tn({type:"recState",state:"live"})},startLiveCapture:()=>Ye.start(),stopLiveCapture:()=>Ye.stop()},()=>{Ye.abort(),window.__camstackEmbed&&delete window.__camstackEmbed}},[t]),T.useEffect(()=>{tn({type:"micState",state:F.micState})},[F.micState]),T.useEffect(()=>Iu(re=>{const Te=window.__camstackEmbed;if(!Te)return;switch(re.kind){case"setMuted":Te.setMuted(re.value);break;case"setTarget":Te.setTarget(re.value);break;case"setStats":Te.setStats(re.value);break;case"setHighlight":Te.setHighlight(re.value);break;case"setSnapshot":Te.setSnapshot(re.value);break;case"setMic":Te.setMic(re.value);break;case"fit":Te.fit(re.w,re.h);break;case"reconnect":Te.reconnect();break;case"playRecorded":Te.playRecorded(re.deviceId,re.epochMs,re.profile);break;case"seek":Te.seek(re.epochMs??re.value);break;case"scrubCommit":Te.scrubCommit(re.epochMs??re.value,re.dragId);break;case"scrubStart":Te.scrubStart(re.dragId);break;case"scrubTo":Te.scrubTo(re.epochMs??re.value,re.m,re.v);break;case"scrubEnd":Te.scrubEnd(re.epochMs??re.value);break;case"timelineWarm":Te.timelineWarm(re.epochMs??re.value);break;case"setRate":Te.setRate(re.rate??re.value);break;case"stepFrame":{const Ze=re.dir;(Ze===1||Ze===-1)&&Te.stepFrame(Ze);break}case"goLive":Te.goLive();break;case"startLiveCapture":Te.startLiveCapture();break;case"stopLiveCapture":Te.stopLiveCapture();break}}),[]);const Fe=hve(h);return v.jsxs("div",{style:{position:"fixed",left:0,top:0,width:G.w,height:G.h,background:"#000"},children:[v.jsx(kN,{serverUrl:e.serverUrl,streamKey:Fe,autoPlay:!0,muted:M,showControls:!1,showStats:E,onPlaybackStats:re=>tn({type:"log",scope:"playback",msg:"stats",data:re}),onConnectTiming:re=>tn({type:"log",scope:"webrtc-timing",msg:"connect",data:re}),onClientNetworkSample:h.kind==="adaptive"?re=>{e.trpcClient.networkQuality.reportClientStats.mutate({deviceId:t,...re}).catch(()=>{})}:void 0,className:"w-full h-full",onAdaptiveHints:re=>{be.current=re,ve()},handleOffer:xe,reoffer:Ie,getSessionState:ge,getSessionDebug:Q,getIceServers:Me,addIceCandidate:Ae,getIceCandidates:Ee,closeSession:we,reconnectSignal:B,posterUrl:D,onStateChange:re=>hb(pve(re)),onError:re=>hb("error",re),onReconnectAttempt:re=>tn({type:"log",scope:"live:retry",msg:re.kind==="retry"?"auto-retry scheduled":"auto-retry exhausted",data:re}),onControlChannel:re=>{if(he.current?.dispose(),le.current=!1,he.current=new Zge({channel:re,video:()=>q.current,onState:Te=>tn({type:"recState",state:Te}),onPosition:Te=>tn({type:"position",positionMs:Te}),onServedProfile:Te=>tn({type:"servedProfile",profile:Te.profile,requested:Te.requested}),onLiveProfile:Te=>{W.current=Te,ve()},onFirstFrame:()=>tn({type:"scrubDrawn"}),onLog:(Te,Je)=>tn({type:"log",scope:Te.startsWith("playback:")?"playback":"scrub",msg:Te,data:Je})}),De.current!==null){const Te=()=>{const Je=De.current;if(Je===null)return;const Ze=iE(x.current,W.current);Kge(he.current,t,Je,Ze)&&(De.current=null,he.current&&rE(he.current,t,Je,x.current),tn({type:"log",scope:"recorded:initial-seek",msg:"config-carried seek fired",data:{epochMs:Je,profile:Ze}}))};re.readyState==="open"?Te():re.addEventListener("open",Te,{once:!0})}},onVideoElement:re=>{q.current=re}}),V&&(()=>{const re=_?.appearance,Te=V==="motion"?re?.motionColor??al.motion:V==="audio"?re?.audioColor??al.audio:re?.detectionColor??al.detection,Je=re?.thickness??3;return v.jsx("div",{style:{position:"absolute",inset:0,border:`${Je}px solid ${Te}`,boxShadow:`inset 0 0 12px ${Te}`,pointerEvents:"none",transform:"translateZ(0)"}})})()]})}function yve(){const e=Qm("player",()=>window.__CAMSTACK_EMBED__,gve),[t,n]=T.useState(null);T.useEffect(()=>{const c=M=>{const C=Qge(M);C&&n(C)};window.__camstackEmbedPage={setDevice:c};const x=Iu(M=>{M.kind==="setDevice"&&c(M.value)});return()=>{window.__camstackEmbedPage&&delete window.__camstackEmbedPage,x()}},[]);const a=T.useMemo(()=>{if(e===null||!e.ok)return null;const c=jm({serverUrl:e.config.serverUrl,token:e.config.token}),x=new m_({defaultOptions:{queries:{retry:!1,refetchOnWindowFocus:!1}}});return{system:c,queryClient:x}},[e]);if(T.useEffect(()=>{if(a)return()=>{a.system.close()}},[a]),e===null)return null;if(!e.ok)return v.jsx(oE,{message:e.error});if(!a)return v.jsx(oE,{message:"Failed to initialise the embed player"});const s=t?.deviceId??e.config.deviceId,p=t?.target??e.config.target,f=t?.muted??e.config.muted,m=t?.stats??e.config.stats??!1,h=t!==null?t.snapshot:e.config.snapshot;return v.jsx(Y_,{system:a.system,children:v.jsx(h_,{client:a.queryClient,children:v.jsx(y.Provider,{client:a.system.trpcClient,queryClient:a.queryClient,children:v.jsx(vve,{system:a.system,deviceId:s,initialTarget:p,initialMuted:f,initialStats:m,initialHighlight:e.config.highlight,initialSnapshot:h,initialSeekMs:t===null?e.config.initialSeekMs:t.atMs},s)})})})}const bve=d({serverUrl:o().min(1),token:o().min(1),deviceId:l().int().nonnegative(),startMs:l().int().nonnegative().optional()});function Sve(e){if(e==null)return{ok:!1,error:"config is required"};const t=bve.safeParse(e);return t.success?{ok:!0,config:t.data}:{ok:!1,error:t.error.issues.map(n=>`${n.path.join(".")||"(root)"}: ${n.message}`).join("; ")}}function xve(e,t){const n=(e-t)/1e3;return Number.isFinite(n)&&n>0?n:0}const sE=360*60*1e3,kve="scrub unavailable: no open RecordedTrackSession";function ni(e){tn(e)}function yn(e,t,n){try{tn({type:"log",scope:e,msg:t,data:n})}catch{}try{console.debug(`[rec-embed:${e}] ${t}`,n??"")}catch{}}function wve({system:e,config:t}){T.useEffect(()=>eO(t.deviceId),[t.deviceId]);const n=T.useRef(null),a=T.useRef(0),s=T.useRef(0),p=T.useRef(0),[f,m]=T.useState({w:window.innerWidth,h:window.innerHeight}),h=T.useMemo(()=>async c=>{const x=n.current;if(!x)return;const M=++p.current;s.current=performance.now(),yn("loadAt","start",{epochMs:c,window:sE}),ni({type:"state",state:"loading"});try{const C=await e.trpcClient.recording.getPlaybackManifest.query({deviceId:t.deviceId,fromMs:c,toMs:c+sE});if(M!==p.current){yn("loadAt","superseded",{epochMs:c});return}if(yn("loadAt","manifest",{playbackUrl:C?.playbackUrl??null,endpoints:C?.playbackEndpoints?.length??0,localMaster:!!C?.localMasterPath}),!C?.playbackUrl){ni({type:"state",state:"error",message:"no footage"});return}x.src=C.playbackUrl;const E=()=>{if(M!==p.current)return;const R=typeof x.getStartDate=="function"?x.getStartDate():null,_=R instanceof Date&&!Number.isNaN(R.getTime())?R.getTime():c;a.current=_;const j=xve(c,_);if(j>0)try{x.currentTime=j}catch(D){yn("loadAt","seek-failed",{msg:String(D)})}x.play().catch(D=>{yn("loadAt","play-rejected",{msg:String(D)})}),yn("loadAt","seek",{epochMs:c,media0Ms:_,offsetSec:j})};x.readyState>=HTMLMediaElement.HAVE_METADATA?E():x.addEventListener("loadedmetadata",E,{once:!0}),yn("loadAt","src-set",{src:C.playbackUrl})}catch(C){yn("loadAt","error",{msg:C instanceof Error?C.message:String(C)}),ni({type:"state",state:"error",message:C instanceof Error?C.message:String(C)})}},[e,t.deviceId]);return T.useEffect(()=>{yn("init","mounted",{deviceId:t.deviceId,startMs:t.startMs??null,ua:navigator.userAgent});const c=(x,M)=>{yn("scrub","unavailable",{command:x,...M===void 0?{}:{epochMs:M}}),ni({type:"state",state:"error",message:kve})};return window.__camstackRecording={seekTo:x=>{yn("cmd","seekTo",{epochMs:x}),h(x)},play:()=>{yn("cmd","play"),n.current?.play().catch(()=>{})},pause:()=>{yn("cmd","pause"),n.current?.pause()},setRate:x=>{yn("cmd","setRate",{rate:x}),n.current&&(n.current.playbackRate=x)},fit:(x,M)=>{yn("cmd","fit",{w:x,h:M}),m({w:x,h:M})},scrubStart:()=>{yn("cmd","scrubStart"),c("scrubStart")},scrubTo:x=>{yn("cmd","scrubTo",{epochMs:x}),c("scrubTo",x)},scrubEnd:x=>{yn("cmd","scrubEnd",{epochMs:x}),c("scrubEnd",x)}},t.startMs&&t.startMs>0&&h(t.startMs),()=>{window.__camstackRecording&&delete window.__camstackRecording}},[h,t.startMs,t.deviceId]),T.useEffect(()=>Iu(c=>{const x=window.__camstackRecording;if(!x)return;switch(c.kind){case"seekTo":x.seekTo(c.value);break;case"play":x.play();break;case"pause":x.pause();break;case"setRate":x.setRate(c.value);break;case"scrubStart":x.scrubStart();break;case"scrubTo":x.scrubTo(c.value);break;case"scrubEnd":x.scrubEnd(c.value);break;case"fit":x.fit(c.w,c.h);break}}),[]),v.jsx("div",{style:{position:"fixed",left:0,top:0,width:f.w,height:f.h,background:"#000"},children:v.jsx("video",{ref:n,playsInline:!0,controls:!1,style:{width:"100%",height:"100%",objectFit:"contain",background:"#000"},onLoadedMetadata:c=>yn("video","loadedmetadata",{w:c.currentTarget.videoWidth,h:c.currentTarget.videoHeight,dur:c.currentTarget.duration}),onPlaying:()=>{yn("video","playing",{vodStartMs:Math.round(performance.now()-s.current)}),ni({type:"state",state:"playing"})},onPause:()=>ni({type:"state",state:"paused"}),onEnded:()=>ni({type:"state",state:"ended"}),onError:c=>{const x=c.currentTarget.error;yn("video","error",{code:x?.code??null,message:x?.message??null}),ni({type:"state",state:"error",message:x?.message||"video error"})},onTimeUpdate:c=>ni({type:"position",positionMs:a.current+c.currentTarget.currentTime*1e3})})})}function Mve(){const e=Qm("recording",()=>window.__CAMSTACK_RECORDING__,Sve),t=T.useMemo(()=>e===null||!e.ok?null:(document.cookie=`camstack_session=${e.config.token}; path=/; SameSite=Lax`,jm({serverUrl:e.config.serverUrl,token:e.config.token})),[e]);return T.useEffect(()=>()=>t?.close(),[t]),e===null?null:e.ok?t?v.jsx(wve,{system:t,config:e.config}):(ni({type:"state",state:"error",message:"init failed"}),null):(ni({type:"state",state:"error",message:e.error}),null)}function Cve(){const e=window.__CAMSTACK_EMBED_MODE__??new URLSearchParams(location.search).get("mode")??new URLSearchParams(location.hash.replace(/^#/,"")).get("mode")??"grid";return e==="player"?v.jsx(yve,{}):e==="recording"?v.jsx(Mve,{}):e==="events"?v.jsx(Vfe,{}):v.jsx(Hge,{})}const lE=document.getElementById("root");lE&&_P.createRoot(lE).render(v.jsx(Cve,{}));export{Bne as C,Kne as E,Ove as G,z_ as I,jve as M,yae as R,Cu as S,Qve as T,Dve as W,Qae as a,Vve as b,Oae as c,Z as d,jo as e,zve as f,$ve as g,Hve as h,Lve as i,v as j,Fve as k,av as l,Pve as m,gb as n,AP as o,kP as p,An as q,T as r,Uve as s,Eu as u,Dp as v};