diff --git a/desktop/frontend/dist/assets/index-B3nvDQ-a.js b/desktop/frontend/dist/assets/index-B3NH0cQK.js similarity index 82% rename from desktop/frontend/dist/assets/index-B3nvDQ-a.js rename to desktop/frontend/dist/assets/index-B3NH0cQK.js index 898eb42..3d599de 100644 --- a/desktop/frontend/dist/assets/index-B3nvDQ-a.js +++ b/desktop/frontend/dist/assets/index-B3NH0cQK.js @@ -22,7 +22,7 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(e){function t(C,T){var z=C.length;C.push(T);e:for(;0>>1,q=C[Y];if(0>>1;Yl(Cl,z))xtl(ir,Cl)?(C[Y]=ir,C[xt]=z,Y=xt):(C[Y]=Cl,C[wt]=z,Y=wt);else if(xtl(ir,z))C[Y]=ir,C[xt]=z,Y=xt;else break e}}return T}function l(C,T){var z=C.sortIndex-T.sortIndex;return z!==0?z:C.id-T.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,u=o.now();e.unstable_now=function(){return o.now()-u}}var a=[],c=[],p=1,v=null,m=3,g=!1,x=!1,k=!1,O=typeof setTimeout=="function"?setTimeout:null,h=typeof clearTimeout=="function"?clearTimeout:null,d=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function f(C){for(var T=n(c);T!==null;){if(T.callback===null)r(c);else if(T.startTime<=C)r(c),T.sortIndex=T.expirationTime,t(a,T);else break;T=n(c)}}function y(C){if(k=!1,f(C),!x)if(n(a)!==null)x=!0,jl(S);else{var T=n(c);T!==null&&Nl(y,T.startTime-C)}}function S(C,T){x=!1,k&&(k=!1,h(E),E=-1),g=!0;var z=m;try{for(f(T),v=n(a);v!==null&&(!(v.expirationTime>T)||C&&!ze());){var Y=v.callback;if(typeof Y=="function"){v.callback=null,m=v.priorityLevel;var q=Y(v.expirationTime<=T);T=e.unstable_now(),typeof q=="function"?v.callback=q:v===n(a)&&r(a),f(T)}else r(a);v=n(a)}if(v!==null)var lr=!0;else{var wt=n(c);wt!==null&&Nl(y,wt.startTime-T),lr=!1}return lr}finally{v=null,m=z,g=!1}}var _=!1,j=null,E=-1,V=5,L=-1;function ze(){return!(e.unstable_now()-LC||125Y?(C.sortIndex=z,t(c,C),n(a)===null&&C===n(c)&&(k?(h(E),E=-1):k=!0,Nl(y,z-Y))):(C.sortIndex=q,t(a,C),x||g||(x=!0,jl(S))),C},e.unstable_shouldYield=ze,e.unstable_wrapCallback=function(C){var T=m;return function(){var z=m;m=T;try{return C.apply(this,arguments)}finally{m=z}}}})(du);cu.exports=du;var Uc=cu.exports;/** + */(function(e){function t(C,T){var z=C.length;C.push(T);e:for(;0>>1,q=C[Y];if(0>>1;Yl(Cl,z))xtl(ir,Cl)?(C[Y]=ir,C[xt]=z,Y=xt):(C[Y]=Cl,C[wt]=z,Y=wt);else if(xtl(ir,z))C[Y]=ir,C[xt]=z,Y=xt;else break e}}return T}function l(C,T){var z=C.sortIndex-T.sortIndex;return z!==0?z:C.id-T.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,u=o.now();e.unstable_now=function(){return o.now()-u}}var a=[],c=[],p=1,v=null,m=3,g=!1,x=!1,k=!1,O=typeof setTimeout=="function"?setTimeout:null,h=typeof clearTimeout=="function"?clearTimeout:null,d=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function f(C){for(var T=n(c);T!==null;){if(T.callback===null)r(c);else if(T.startTime<=C)r(c),T.sortIndex=T.expirationTime,t(a,T);else break;T=n(c)}}function y(C){if(k=!1,f(C),!x)if(n(a)!==null)x=!0,jl(S);else{var T=n(c);T!==null&&Nl(y,T.startTime-C)}}function S(C,T){x=!1,k&&(k=!1,h(E),E=-1),g=!0;var z=m;try{for(f(T),v=n(a);v!==null&&(!(v.expirationTime>T)||C&&!ze());){var Y=v.callback;if(typeof Y=="function"){v.callback=null,m=v.priorityLevel;var q=Y(v.expirationTime<=T);T=e.unstable_now(),typeof q=="function"?v.callback=q:v===n(a)&&r(a),f(T)}else r(a);v=n(a)}if(v!==null)var lr=!0;else{var wt=n(c);wt!==null&&Nl(y,wt.startTime-T),lr=!1}return lr}finally{v=null,m=z,g=!1}}var _=!1,j=null,E=-1,V=5,L=-1;function ze(){return!(e.unstable_now()-LC||125Y?(C.sortIndex=z,t(c,C),n(a)===null&&C===n(c)&&(k?(h(E),E=-1):k=!0,Nl(y,z-Y))):(C.sortIndex=q,t(a,C),x||g||(x=!0,jl(S))),C},e.unstable_shouldYield=ze,e.unstable_wrapCallback=function(C){var T=m;return function(){var z=m;m=T;try{return C.apply(this,arguments)}finally{m=z}}}})(du);cu.exports=du;var $c=cu.exports;/** * @license React * react-dom.production.min.js * @@ -30,11 +30,11 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var $c=P,xe=Uc;function w(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),bl=Object.prototype.hasOwnProperty,Bc=/^[: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]*$/,Wo={},Qo={};function Ac(e){return bl.call(Qo,e)?!0:bl.call(Wo,e)?!1:Bc.test(e)?Qo[e]=!0:(Wo[e]=!0,!1)}function Vc(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Hc(e,t,n,r){if(t===null||typeof t>"u"||Vc(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function de(e,t,n,r,l,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var re={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){re[e]=new de(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];re[t]=new de(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){re[e]=new de(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){re[e]=new de(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){re[e]=new de(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){re[e]=new de(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){re[e]=new de(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){re[e]=new de(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){re[e]=new de(e,5,!1,e.toLowerCase(),null,!1,!1)});var Gi=/[\-:]([a-z])/g;function Zi(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Gi,Zi);re[t]=new de(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Gi,Zi);re[t]=new de(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Gi,Zi);re[t]=new de(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){re[e]=new de(e,1,!1,e.toLowerCase(),null,!1,!1)});re.xlinkHref=new de("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){re[e]=new de(e,1,!1,e.toLowerCase(),null,!0,!0)});function Ji(e,t,n,r){var l=re.hasOwnProperty(t)?re[t]:null;(l!==null?l.type!==0:r||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),bl=Object.prototype.hasOwnProperty,Bc=/^[: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]*$/,Wo={},Qo={};function Ac(e){return bl.call(Qo,e)?!0:bl.call(Wo,e)?!1:Bc.test(e)?Qo[e]=!0:(Wo[e]=!0,!1)}function Vc(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Hc(e,t,n,r){if(t===null||typeof t>"u"||Vc(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function de(e,t,n,r,l,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var re={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){re[e]=new de(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];re[t]=new de(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){re[e]=new de(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){re[e]=new de(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){re[e]=new de(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){re[e]=new de(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){re[e]=new de(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){re[e]=new de(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){re[e]=new de(e,5,!1,e.toLowerCase(),null,!1,!1)});var Gi=/[\-:]([a-z])/g;function Zi(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Gi,Zi);re[t]=new de(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Gi,Zi);re[t]=new de(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Gi,Zi);re[t]=new de(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){re[e]=new de(e,1,!1,e.toLowerCase(),null,!1,!1)});re.xlinkHref=new de("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){re[e]=new de(e,1,!1,e.toLowerCase(),null,!0,!0)});function Ji(e,t,n,r){var l=re.hasOwnProperty(t)?re[t]:null;(l!==null?l.type!==0:r||!(2u||l[o]!==i[u]){var a=` -`+l[o].replace(" at new "," at ");return e.displayName&&a.includes("")&&(a=a.replace("",e.displayName)),a}while(1<=o&&0<=u);break}}}finally{Pl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?jn(e):""}function Wc(e){switch(e.tag){case 5:return jn(e.type);case 16:return jn("Lazy");case 13:return jn("Suspense");case 19:return jn("SuspenseList");case 0:case 2:case 15:return e=Tl(e.type,!1),e;case 11:return e=Tl(e.type.render,!1),e;case 1:return e=Tl(e.type,!0),e;default:return""}}function ri(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ut:return"Fragment";case Ft:return"Portal";case ei:return"Profiler";case qi:return"StrictMode";case ti:return"Suspense";case ni:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case hu:return(e.displayName||"Context")+".Consumer";case pu:return(e._context.displayName||"Context")+".Provider";case bi:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case eo:return t=e.displayName||null,t!==null?t:ri(e.type)||"Memo";case et:t=e._payload,e=e._init;try{return ri(e(t))}catch{}}return null}function Qc(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ri(t);case 8:return t===qi?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ht(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function vu(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Kc(e){var t=vu(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ur(e){e._valueTracker||(e._valueTracker=Kc(e))}function yu(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=vu(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Fr(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function li(e,t){var n=t.checked;return Q({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Yo(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ht(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function gu(e,t){t=t.checked,t!=null&&Ji(e,"checked",t,!1)}function ii(e,t){gu(e,t);var n=ht(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?oi(e,t.type,n):t.hasOwnProperty("defaultValue")&&oi(e,t.type,ht(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Xo(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function oi(e,t,n){(t!=="number"||Fr(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Nn=Array.isArray;function Gt(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=ar.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Fn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var _n={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Yc=["Webkit","ms","Moz","O"];Object.keys(_n).forEach(function(e){Yc.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),_n[t]=_n[e]})});function ku(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||_n.hasOwnProperty(e)&&_n[e]?(""+t).trim():t+"px"}function ju(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=ku(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var Xc=Q({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ai(e,t){if(t){if(Xc[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(w(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(w(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(w(61))}if(t.style!=null&&typeof t.style!="object")throw Error(w(62))}}function ci(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){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 di=null;function to(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var fi=null,Zt=null,Jt=null;function Jo(e){if(e=nr(e)){if(typeof fi!="function")throw Error(w(280));var t=e.stateNode;t&&(t=fl(t),fi(e.stateNode,e.type,t))}}function Nu(e){Zt?Jt?Jt.push(e):Jt=[e]:Zt=e}function Cu(){if(Zt){var e=Zt,t=Jt;if(Jt=Zt=null,Jo(e),t)for(e=0;e>>=0,e===0?32:31-(id(e)/od|0)|0}var cr=64,dr=4194304;function Cn(e){switch(e&-e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ar(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,i=e.pingedLanes,o=n&268435455;if(o!==0){var u=o&~l;u!==0?r=Cn(u):(i&=o,i!==0&&(r=Cn(i)))}else o=n&~l,o!==0?r=Cn(o):i!==0&&(r=Cn(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&l)&&(l=r&-r,i=t&-t,l>=i||l===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function er(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Me(t),e[t]=n}function cd(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Tn),os=" ",ss=!1;function Qu(e,t){switch(e){case"keyup":return Ud.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ku(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var $t=!1;function Bd(e,t){switch(e){case"compositionend":return Ku(t);case"keypress":return t.which!==32?null:(ss=!0,os);case"textInput":return e=t.data,e===os&&ss?null:e;default:return null}}function Ad(e,t){if($t)return e==="compositionend"||!ao&&Qu(e,t)?(e=Hu(),Pr=oo=lt=null,$t=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=ds(n)}}function Zu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Zu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ju(){for(var e=window,t=Fr();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Fr(e.document)}return t}function co(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Zd(e){var t=Ju(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Zu(n.ownerDocument.documentElement,n)){if(r!==null&&co(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,i=Math.min(r.start,l);r=r.end===void 0?i:Math.min(r.end,l),!e.extend&&i>r&&(l=r,r=i,i=l),l=fs(n,i);var o=fs(n,r);l&&o&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Bt=null,gi=null,Ln=null,wi=!1;function ps(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;wi||Bt==null||Bt!==Fr(r)||(r=Bt,"selectionStart"in r&&co(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Ln&&Hn(Ln,r)||(Ln=r,r=Wr(gi,"onSelect"),0Ht||(e.current=Ci[Ht],Ci[Ht]=null,Ht--)}function F(e,t){Ht++,Ci[Ht]=e.current,e.current=t}var mt={},se=yt(mt),he=yt(!1),Pt=mt;function rn(e,t){var n=e.type.contextTypes;if(!n)return mt;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},i;for(i in n)l[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function me(e){return e=e.childContextTypes,e!=null}function Kr(){$(he),$(se)}function xs(e,t,n){if(se.current!==mt)throw Error(w(168));F(se,t),F(he,n)}function oa(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(w(108,Qc(e)||"Unknown",l));return Q({},n,r)}function Yr(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||mt,Pt=se.current,F(se,e),F(he,he.current),!0}function Ss(e,t,n){var r=e.stateNode;if(!r)throw Error(w(169));n?(e=oa(e,t,Pt),r.__reactInternalMemoizedMergedChildContext=e,$(he),$(se),F(se,e)):$(he),F(he,n)}var We=null,pl=!1,Hl=!1;function sa(e){We===null?We=[e]:We.push(e)}function af(e){pl=!0,sa(e)}function gt(){if(!Hl&&We!==null){Hl=!0;var e=0,t=M;try{var n=We;for(M=1;e>=o,l-=o,Qe=1<<32-Me(t)+l|n<E?(V=j,j=null):V=j.sibling;var L=m(h,j,f[E],y);if(L===null){j===null&&(j=V);break}e&&j&&L.alternate===null&&t(h,j),d=i(L,d,E),_===null?S=L:_.sibling=L,_=L,j=V}if(E===f.length)return n(h,j),B&&St(h,E),S;if(j===null){for(;EE?(V=j,j=null):V=j.sibling;var ze=m(h,j,L.value,y);if(ze===null){j===null&&(j=V);break}e&&j&&ze.alternate===null&&t(h,j),d=i(ze,d,E),_===null?S=ze:_.sibling=ze,_=ze,j=V}if(L.done)return n(h,j),B&&St(h,E),S;if(j===null){for(;!L.done;E++,L=f.next())L=v(h,L.value,y),L!==null&&(d=i(L,d,E),_===null?S=L:_.sibling=L,_=L);return B&&St(h,E),S}for(j=r(h,j);!L.done;E++,L=f.next())L=g(j,h,E,L.value,y),L!==null&&(e&&L.alternate!==null&&j.delete(L.key===null?E:L.key),d=i(L,d,E),_===null?S=L:_.sibling=L,_=L);return e&&j.forEach(function(pn){return t(h,pn)}),B&&St(h,E),S}function O(h,d,f,y){if(typeof f=="object"&&f!==null&&f.type===Ut&&f.key===null&&(f=f.props.children),typeof f=="object"&&f!==null){switch(f.$$typeof){case sr:e:{for(var S=f.key,_=d;_!==null;){if(_.key===S){if(S=f.type,S===Ut){if(_.tag===7){n(h,_.sibling),d=l(_,f.props.children),d.return=h,h=d;break e}}else if(_.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===et&&Ns(S)===_.type){n(h,_.sibling),d=l(_,f.props),d.ref=xn(h,_,f),d.return=h,h=d;break e}n(h,_);break}else t(h,_);_=_.sibling}f.type===Ut?(d=_t(f.props.children,h.mode,y,f.key),d.return=h,h=d):(y=Ir(f.type,f.key,f.props,null,h.mode,y),y.ref=xn(h,d,f),y.return=h,h=y)}return o(h);case Ft:e:{for(_=f.key;d!==null;){if(d.key===_)if(d.tag===4&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){n(h,d.sibling),d=l(d,f.children||[]),d.return=h,h=d;break e}else{n(h,d);break}else t(h,d);d=d.sibling}d=Jl(f,h.mode,y),d.return=h,h=d}return o(h);case et:return _=f._init,O(h,d,_(f._payload),y)}if(Nn(f))return x(h,d,f,y);if(mn(f))return k(h,d,f,y);gr(h,f)}return typeof f=="string"&&f!==""||typeof f=="number"?(f=""+f,d!==null&&d.tag===6?(n(h,d.sibling),d=l(d,f),d.return=h,h=d):(n(h,d),d=Zl(f,h.mode,y),d.return=h,h=d),o(h)):n(h,d)}return O}var on=da(!0),fa=da(!1),Zr=yt(null),Jr=null,Kt=null,mo=null;function vo(){mo=Kt=Jr=null}function yo(e){var t=Zr.current;$(Zr),e._currentValue=t}function Pi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function bt(e,t){Jr=e,mo=Kt=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(pe=!0),e.firstContext=null)}function _e(e){var t=e._currentValue;if(mo!==e)if(e={context:e,memoizedValue:t,next:null},Kt===null){if(Jr===null)throw Error(w(308));Kt=e,Jr.dependencies={lanes:0,firstContext:e}}else Kt=Kt.next=e;return t}var Nt=null;function go(e){Nt===null?Nt=[e]:Nt.push(e)}function pa(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,go(t)):(n.next=l.next,l.next=n),t.interleaved=n,Ze(e,r)}function Ze(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var tt=!1;function wo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ha(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Ye(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ct(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,D&2){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,Ze(e,n)}return l=r.interleaved,l===null?(t.next=t,go(r)):(t.next=l.next,l.next=t),r.interleaved=t,Ze(e,n)}function zr(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ro(e,n)}}function Cs(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?l=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?l=i=t:i=i.next=t}else l=i=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function qr(e,t,n,r){var l=e.updateQueue;tt=!1;var i=l.firstBaseUpdate,o=l.lastBaseUpdate,u=l.shared.pending;if(u!==null){l.shared.pending=null;var a=u,c=a.next;a.next=null,o===null?i=c:o.next=c,o=a;var p=e.alternate;p!==null&&(p=p.updateQueue,u=p.lastBaseUpdate,u!==o&&(u===null?p.firstBaseUpdate=c:u.next=c,p.lastBaseUpdate=a))}if(i!==null){var v=l.baseState;o=0,p=c=a=null,u=i;do{var m=u.lane,g=u.eventTime;if((r&m)===m){p!==null&&(p=p.next={eventTime:g,lane:0,tag:u.tag,payload:u.payload,callback:u.callback,next:null});e:{var x=e,k=u;switch(m=t,g=n,k.tag){case 1:if(x=k.payload,typeof x=="function"){v=x.call(g,v,m);break e}v=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=k.payload,m=typeof x=="function"?x.call(g,v,m):x,m==null)break e;v=Q({},v,m);break e;case 2:tt=!0}}u.callback!==null&&u.lane!==0&&(e.flags|=64,m=l.effects,m===null?l.effects=[u]:m.push(u))}else g={eventTime:g,lane:m,tag:u.tag,payload:u.payload,callback:u.callback,next:null},p===null?(c=p=g,a=v):p=p.next=g,o|=m;if(u=u.next,u===null){if(u=l.shared.pending,u===null)break;m=u,u=m.next,m.next=null,l.lastBaseUpdate=m,l.shared.pending=null}}while(!0);if(p===null&&(a=v),l.baseState=a,l.firstBaseUpdate=c,l.lastBaseUpdate=p,t=l.shared.interleaved,t!==null){l=t;do o|=l.lane,l=l.next;while(l!==t)}else i===null&&(l.shared.lanes=0);Lt|=o,e.lanes=o,e.memoizedState=v}}function Es(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Ql.transition;Ql.transition={};try{e(!1),t()}finally{M=n,Ql.transition=r}}function La(){return Pe().memoizedState}function pf(e,t,n){var r=ft(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Ra(e))Da(t,n);else if(n=pa(e,t,n,r),n!==null){var l=ae();Ie(n,e,r,l),Oa(n,t,r)}}function hf(e,t,n){var r=ft(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ra(e))Da(t,l);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,u=i(o,n);if(l.hasEagerState=!0,l.eagerState=u,Fe(u,o)){var a=t.interleaved;a===null?(l.next=l,go(t)):(l.next=a.next,a.next=l),t.interleaved=l;return}}catch{}finally{}n=pa(e,t,l,r),n!==null&&(l=ae(),Ie(n,e,r,l),Oa(n,t,r))}}function Ra(e){var t=e.alternate;return e===W||t!==null&&t===W}function Da(e,t){Rn=el=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Oa(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ro(e,n)}}var tl={readContext:_e,useCallback:le,useContext:le,useEffect:le,useImperativeHandle:le,useInsertionEffect:le,useLayoutEffect:le,useMemo:le,useReducer:le,useRef:le,useState:le,useDebugValue:le,useDeferredValue:le,useTransition:le,useMutableSource:le,useSyncExternalStore:le,useId:le,unstable_isNewReconciler:!1},mf={readContext:_e,useCallback:function(e,t){return $e().memoizedState=[e,t===void 0?null:t],e},useContext:_e,useEffect:Ps,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Rr(4194308,4,Ea.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Rr(4194308,4,e,t)},useInsertionEffect:function(e,t){return Rr(4,2,e,t)},useMemo:function(e,t){var n=$e();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=$e();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=pf.bind(null,W,e),[r.memoizedState,e]},useRef:function(e){var t=$e();return e={current:e},t.memoizedState=e},useState:_s,useDebugValue:_o,useDeferredValue:function(e){return $e().memoizedState=e},useTransition:function(){var e=_s(!1),t=e[0];return e=ff.bind(null,e[1]),$e().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=W,l=$e();if(B){if(n===void 0)throw Error(w(407));n=n()}else{if(n=t(),ee===null)throw Error(w(349));zt&30||ga(r,t,n)}l.memoizedState=n;var i={value:n,getSnapshot:t};return l.queue=i,Ps(xa.bind(null,r,i,e),[e]),r.flags|=2048,Jn(9,wa.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=$e(),t=ee.identifierPrefix;if(B){var n=Ke,r=Qe;n=(r&~(1<<32-Me(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Gn++,0")&&(a=a.replace("",e.displayName)),a}while(1<=o&&0<=u);break}}}finally{Pl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?jn(e):""}function Wc(e){switch(e.tag){case 5:return jn(e.type);case 16:return jn("Lazy");case 13:return jn("Suspense");case 19:return jn("SuspenseList");case 0:case 2:case 15:return e=Tl(e.type,!1),e;case 11:return e=Tl(e.type.render,!1),e;case 1:return e=Tl(e.type,!0),e;default:return""}}function ri(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case $t:return"Fragment";case Ft:return"Portal";case ei:return"Profiler";case qi:return"StrictMode";case ti:return"Suspense";case ni:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case hu:return(e.displayName||"Context")+".Consumer";case pu:return(e._context.displayName||"Context")+".Provider";case bi:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case eo:return t=e.displayName||null,t!==null?t:ri(e.type)||"Memo";case et:t=e._payload,e=e._init;try{return ri(e(t))}catch{}}return null}function Qc(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ri(t);case 8:return t===qi?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ht(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function vu(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Kc(e){var t=vu(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ur(e){e._valueTracker||(e._valueTracker=Kc(e))}function yu(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=vu(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Fr(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function li(e,t){var n=t.checked;return Q({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Yo(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ht(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function gu(e,t){t=t.checked,t!=null&&Ji(e,"checked",t,!1)}function ii(e,t){gu(e,t);var n=ht(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?oi(e,t.type,n):t.hasOwnProperty("defaultValue")&&oi(e,t.type,ht(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Xo(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function oi(e,t,n){(t!=="number"||Fr(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Nn=Array.isArray;function Gt(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=ar.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Fn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var _n={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Yc=["Webkit","ms","Moz","O"];Object.keys(_n).forEach(function(e){Yc.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),_n[t]=_n[e]})});function ku(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||_n.hasOwnProperty(e)&&_n[e]?(""+t).trim():t+"px"}function ju(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=ku(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var Xc=Q({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ai(e,t){if(t){if(Xc[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(w(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(w(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(w(61))}if(t.style!=null&&typeof t.style!="object")throw Error(w(62))}}function ci(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){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 di=null;function to(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var fi=null,Zt=null,Jt=null;function Jo(e){if(e=nr(e)){if(typeof fi!="function")throw Error(w(280));var t=e.stateNode;t&&(t=fl(t),fi(e.stateNode,e.type,t))}}function Nu(e){Zt?Jt?Jt.push(e):Jt=[e]:Zt=e}function Cu(){if(Zt){var e=Zt,t=Jt;if(Jt=Zt=null,Jo(e),t)for(e=0;e>>=0,e===0?32:31-(id(e)/od|0)|0}var cr=64,dr=4194304;function Cn(e){switch(e&-e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Ar(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,i=e.pingedLanes,o=n&268435455;if(o!==0){var u=o&~l;u!==0?r=Cn(u):(i&=o,i!==0&&(r=Cn(i)))}else o=n&~l,o!==0?r=Cn(o):i!==0&&(r=Cn(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&l)&&(l=r&-r,i=t&-t,l>=i||l===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function er(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Me(t),e[t]=n}function cd(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Tn),os=" ",ss=!1;function Qu(e,t){switch(e){case"keyup":return $d.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ku(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ut=!1;function Bd(e,t){switch(e){case"compositionend":return Ku(t);case"keypress":return t.which!==32?null:(ss=!0,os);case"textInput":return e=t.data,e===os&&ss?null:e;default:return null}}function Ad(e,t){if(Ut)return e==="compositionend"||!ao&&Qu(e,t)?(e=Hu(),Pr=oo=lt=null,Ut=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=ds(n)}}function Zu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Zu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ju(){for(var e=window,t=Fr();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Fr(e.document)}return t}function co(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Zd(e){var t=Ju(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Zu(n.ownerDocument.documentElement,n)){if(r!==null&&co(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,i=Math.min(r.start,l);r=r.end===void 0?i:Math.min(r.end,l),!e.extend&&i>r&&(l=r,r=i,i=l),l=fs(n,i);var o=fs(n,r);l&&o&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Bt=null,gi=null,Ln=null,wi=!1;function ps(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;wi||Bt==null||Bt!==Fr(r)||(r=Bt,"selectionStart"in r&&co(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Ln&&Hn(Ln,r)||(Ln=r,r=Wr(gi,"onSelect"),0Ht||(e.current=Ci[Ht],Ci[Ht]=null,Ht--)}function F(e,t){Ht++,Ci[Ht]=e.current,e.current=t}var mt={},se=yt(mt),he=yt(!1),Pt=mt;function rn(e,t){var n=e.type.contextTypes;if(!n)return mt;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},i;for(i in n)l[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function me(e){return e=e.childContextTypes,e!=null}function Kr(){U(he),U(se)}function xs(e,t,n){if(se.current!==mt)throw Error(w(168));F(se,t),F(he,n)}function oa(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(w(108,Qc(e)||"Unknown",l));return Q({},n,r)}function Yr(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||mt,Pt=se.current,F(se,e),F(he,he.current),!0}function Ss(e,t,n){var r=e.stateNode;if(!r)throw Error(w(169));n?(e=oa(e,t,Pt),r.__reactInternalMemoizedMergedChildContext=e,U(he),U(se),F(se,e)):U(he),F(he,n)}var We=null,pl=!1,Hl=!1;function sa(e){We===null?We=[e]:We.push(e)}function af(e){pl=!0,sa(e)}function gt(){if(!Hl&&We!==null){Hl=!0;var e=0,t=M;try{var n=We;for(M=1;e>=o,l-=o,Qe=1<<32-Me(t)+l|n<E?(V=j,j=null):V=j.sibling;var L=m(h,j,f[E],y);if(L===null){j===null&&(j=V);break}e&&j&&L.alternate===null&&t(h,j),d=i(L,d,E),_===null?S=L:_.sibling=L,_=L,j=V}if(E===f.length)return n(h,j),B&&St(h,E),S;if(j===null){for(;EE?(V=j,j=null):V=j.sibling;var ze=m(h,j,L.value,y);if(ze===null){j===null&&(j=V);break}e&&j&&ze.alternate===null&&t(h,j),d=i(ze,d,E),_===null?S=ze:_.sibling=ze,_=ze,j=V}if(L.done)return n(h,j),B&&St(h,E),S;if(j===null){for(;!L.done;E++,L=f.next())L=v(h,L.value,y),L!==null&&(d=i(L,d,E),_===null?S=L:_.sibling=L,_=L);return B&&St(h,E),S}for(j=r(h,j);!L.done;E++,L=f.next())L=g(j,h,E,L.value,y),L!==null&&(e&&L.alternate!==null&&j.delete(L.key===null?E:L.key),d=i(L,d,E),_===null?S=L:_.sibling=L,_=L);return e&&j.forEach(function(pn){return t(h,pn)}),B&&St(h,E),S}function O(h,d,f,y){if(typeof f=="object"&&f!==null&&f.type===$t&&f.key===null&&(f=f.props.children),typeof f=="object"&&f!==null){switch(f.$$typeof){case sr:e:{for(var S=f.key,_=d;_!==null;){if(_.key===S){if(S=f.type,S===$t){if(_.tag===7){n(h,_.sibling),d=l(_,f.props.children),d.return=h,h=d;break e}}else if(_.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===et&&Ns(S)===_.type){n(h,_.sibling),d=l(_,f.props),d.ref=xn(h,_,f),d.return=h,h=d;break e}n(h,_);break}else t(h,_);_=_.sibling}f.type===$t?(d=_t(f.props.children,h.mode,y,f.key),d.return=h,h=d):(y=Ir(f.type,f.key,f.props,null,h.mode,y),y.ref=xn(h,d,f),y.return=h,h=y)}return o(h);case Ft:e:{for(_=f.key;d!==null;){if(d.key===_)if(d.tag===4&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){n(h,d.sibling),d=l(d,f.children||[]),d.return=h,h=d;break e}else{n(h,d);break}else t(h,d);d=d.sibling}d=Jl(f,h.mode,y),d.return=h,h=d}return o(h);case et:return _=f._init,O(h,d,_(f._payload),y)}if(Nn(f))return x(h,d,f,y);if(mn(f))return k(h,d,f,y);gr(h,f)}return typeof f=="string"&&f!==""||typeof f=="number"?(f=""+f,d!==null&&d.tag===6?(n(h,d.sibling),d=l(d,f),d.return=h,h=d):(n(h,d),d=Zl(f,h.mode,y),d.return=h,h=d),o(h)):n(h,d)}return O}var on=da(!0),fa=da(!1),Zr=yt(null),Jr=null,Kt=null,mo=null;function vo(){mo=Kt=Jr=null}function yo(e){var t=Zr.current;U(Zr),e._currentValue=t}function Pi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function bt(e,t){Jr=e,mo=Kt=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(pe=!0),e.firstContext=null)}function _e(e){var t=e._currentValue;if(mo!==e)if(e={context:e,memoizedValue:t,next:null},Kt===null){if(Jr===null)throw Error(w(308));Kt=e,Jr.dependencies={lanes:0,firstContext:e}}else Kt=Kt.next=e;return t}var Nt=null;function go(e){Nt===null?Nt=[e]:Nt.push(e)}function pa(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,go(t)):(n.next=l.next,l.next=n),t.interleaved=n,Ze(e,r)}function Ze(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var tt=!1;function wo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ha(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Ye(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ct(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,D&2){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,Ze(e,n)}return l=r.interleaved,l===null?(t.next=t,go(r)):(t.next=l.next,l.next=t),r.interleaved=t,Ze(e,n)}function zr(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ro(e,n)}}function Cs(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?l=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?l=i=t:i=i.next=t}else l=i=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function qr(e,t,n,r){var l=e.updateQueue;tt=!1;var i=l.firstBaseUpdate,o=l.lastBaseUpdate,u=l.shared.pending;if(u!==null){l.shared.pending=null;var a=u,c=a.next;a.next=null,o===null?i=c:o.next=c,o=a;var p=e.alternate;p!==null&&(p=p.updateQueue,u=p.lastBaseUpdate,u!==o&&(u===null?p.firstBaseUpdate=c:u.next=c,p.lastBaseUpdate=a))}if(i!==null){var v=l.baseState;o=0,p=c=a=null,u=i;do{var m=u.lane,g=u.eventTime;if((r&m)===m){p!==null&&(p=p.next={eventTime:g,lane:0,tag:u.tag,payload:u.payload,callback:u.callback,next:null});e:{var x=e,k=u;switch(m=t,g=n,k.tag){case 1:if(x=k.payload,typeof x=="function"){v=x.call(g,v,m);break e}v=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=k.payload,m=typeof x=="function"?x.call(g,v,m):x,m==null)break e;v=Q({},v,m);break e;case 2:tt=!0}}u.callback!==null&&u.lane!==0&&(e.flags|=64,m=l.effects,m===null?l.effects=[u]:m.push(u))}else g={eventTime:g,lane:m,tag:u.tag,payload:u.payload,callback:u.callback,next:null},p===null?(c=p=g,a=v):p=p.next=g,o|=m;if(u=u.next,u===null){if(u=l.shared.pending,u===null)break;m=u,u=m.next,m.next=null,l.lastBaseUpdate=m,l.shared.pending=null}}while(!0);if(p===null&&(a=v),l.baseState=a,l.firstBaseUpdate=c,l.lastBaseUpdate=p,t=l.shared.interleaved,t!==null){l=t;do o|=l.lane,l=l.next;while(l!==t)}else i===null&&(l.shared.lanes=0);Lt|=o,e.lanes=o,e.memoizedState=v}}function Es(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Ql.transition;Ql.transition={};try{e(!1),t()}finally{M=n,Ql.transition=r}}function La(){return Pe().memoizedState}function pf(e,t,n){var r=ft(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Ra(e))Da(t,n);else if(n=pa(e,t,n,r),n!==null){var l=ae();Ie(n,e,r,l),Oa(n,t,r)}}function hf(e,t,n){var r=ft(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ra(e))Da(t,l);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,u=i(o,n);if(l.hasEagerState=!0,l.eagerState=u,Fe(u,o)){var a=t.interleaved;a===null?(l.next=l,go(t)):(l.next=a.next,a.next=l),t.interleaved=l;return}}catch{}finally{}n=pa(e,t,l,r),n!==null&&(l=ae(),Ie(n,e,r,l),Oa(n,t,r))}}function Ra(e){var t=e.alternate;return e===W||t!==null&&t===W}function Da(e,t){Rn=el=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Oa(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ro(e,n)}}var tl={readContext:_e,useCallback:le,useContext:le,useEffect:le,useImperativeHandle:le,useInsertionEffect:le,useLayoutEffect:le,useMemo:le,useReducer:le,useRef:le,useState:le,useDebugValue:le,useDeferredValue:le,useTransition:le,useMutableSource:le,useSyncExternalStore:le,useId:le,unstable_isNewReconciler:!1},mf={readContext:_e,useCallback:function(e,t){return Ue().memoizedState=[e,t===void 0?null:t],e},useContext:_e,useEffect:Ps,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Rr(4194308,4,Ea.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Rr(4194308,4,e,t)},useInsertionEffect:function(e,t){return Rr(4,2,e,t)},useMemo:function(e,t){var n=Ue();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Ue();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=pf.bind(null,W,e),[r.memoizedState,e]},useRef:function(e){var t=Ue();return e={current:e},t.memoizedState=e},useState:_s,useDebugValue:_o,useDeferredValue:function(e){return Ue().memoizedState=e},useTransition:function(){var e=_s(!1),t=e[0];return e=ff.bind(null,e[1]),Ue().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=W,l=Ue();if(B){if(n===void 0)throw Error(w(407));n=n()}else{if(n=t(),ee===null)throw Error(w(349));zt&30||ga(r,t,n)}l.memoizedState=n;var i={value:n,getSnapshot:t};return l.queue=i,Ps(xa.bind(null,r,i,e),[e]),r.flags|=2048,Jn(9,wa.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Ue(),t=ee.identifierPrefix;if(B){var n=Ke,r=Qe;n=(r&~(1<<32-Me(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Gn++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[Be]=t,e[Kn]=r,Wa(e,t,!1,!1),t.stateNode=e;e:{switch(o=ci(n,r),n){case"dialog":U("cancel",e),U("close",e),l=r;break;case"iframe":case"object":case"embed":U("load",e),l=r;break;case"video":case"audio":for(l=0;lan&&(t.flags|=128,r=!0,Sn(i,!1),t.lanes=4194304)}else{if(!r)if(e=br(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Sn(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!B)return ie(t),null}else 2*X()-i.renderingStartTime>an&&n!==1073741824&&(t.flags|=128,r=!0,Sn(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(n=i.last,n!==null?n.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=X(),t.sibling=null,n=H.current,F(H,r?n&1|2:n&1),t):(ie(t),null);case 22:case 23:return Do(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ye&1073741824&&(ie(t),t.subtreeFlags&6&&(t.flags|=8192)):ie(t),null;case 24:return null;case 25:return null}throw Error(w(156,t.tag))}function jf(e,t){switch(po(t),t.tag){case 1:return me(t.type)&&Kr(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return sn(),$(he),$(se),ko(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return So(t),null;case 13:if($(H),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(w(340));ln()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return $(H),null;case 4:return sn(),null;case 10:return yo(t.type._context),null;case 22:case 23:return Do(),null;case 24:return null;default:return null}}var xr=!1,oe=!1,Nf=typeof WeakSet=="function"?WeakSet:Set,N=null;function Yt(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){K(e,t,r)}else n.current=null}function Fi(e,t,n){try{n()}catch(r){K(e,t,r)}}var $s=!1;function Cf(e,t){if(xi=Vr,e=Ju(),co(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,u=-1,a=-1,c=0,p=0,v=e,m=null;t:for(;;){for(var g;v!==n||l!==0&&v.nodeType!==3||(u=o+l),v!==i||r!==0&&v.nodeType!==3||(a=o+r),v.nodeType===3&&(o+=v.nodeValue.length),(g=v.firstChild)!==null;)m=v,v=g;for(;;){if(v===e)break t;if(m===n&&++c===l&&(u=o),m===i&&++p===r&&(a=o),(g=v.nextSibling)!==null)break;v=m,m=v.parentNode}v=g}n=u===-1||a===-1?null:{start:u,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(Si={focusedElem:e,selectionRange:n},Vr=!1,N=t;N!==null;)if(t=N,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,N=e;else for(;N!==null;){t=N;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var k=x.memoizedProps,O=x.memoizedState,h=t.stateNode,d=h.getSnapshotBeforeUpdate(t.elementType===t.type?k:Re(t.type,k),O);h.__reactInternalSnapshotBeforeUpdate=d}break;case 3:var f=t.stateNode.containerInfo;f.nodeType===1?f.textContent="":f.nodeType===9&&f.documentElement&&f.removeChild(f.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(w(163))}}catch(y){K(t,t.return,y)}if(e=t.sibling,e!==null){e.return=t.return,N=e;break}N=t.return}return x=$s,$s=!1,x}function Dn(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var i=l.destroy;l.destroy=void 0,i!==void 0&&Fi(t,n,i)}l=l.next}while(l!==r)}}function vl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Ui(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Ya(e){var t=e.alternate;t!==null&&(e.alternate=null,Ya(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Be],delete t[Kn],delete t[Ni],delete t[sf],delete t[uf])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Xa(e){return e.tag===5||e.tag===3||e.tag===4}function Bs(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Xa(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function $i(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Qr));else if(r!==4&&(e=e.child,e!==null))for($i(e,t,n),e=e.sibling;e!==null;)$i(e,t,n),e=e.sibling}function Bi(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Bi(e,t,n),e=e.sibling;e!==null;)Bi(e,t,n),e=e.sibling}var te=null,De=!1;function be(e,t,n){for(n=n.child;n!==null;)Ga(e,t,n),n=n.sibling}function Ga(e,t,n){if(Ae&&typeof Ae.onCommitFiberUnmount=="function")try{Ae.onCommitFiberUnmount(ul,n)}catch{}switch(n.tag){case 5:oe||Yt(n,t);case 6:var r=te,l=De;te=null,be(e,t,n),te=r,De=l,te!==null&&(De?(e=te,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):te.removeChild(n.stateNode));break;case 18:te!==null&&(De?(e=te,n=n.stateNode,e.nodeType===8?Vl(e.parentNode,n):e.nodeType===1&&Vl(e,n),An(e)):Vl(te,n.stateNode));break;case 4:r=te,l=De,te=n.stateNode.containerInfo,De=!0,be(e,t,n),te=r,De=l;break;case 0:case 11:case 14:case 15:if(!oe&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var i=l,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&Fi(n,t,o),l=l.next}while(l!==r)}be(e,t,n);break;case 1:if(!oe&&(Yt(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(u){K(n,t,u)}be(e,t,n);break;case 21:be(e,t,n);break;case 22:n.mode&1?(oe=(r=oe)||n.memoizedState!==null,be(e,t,n),oe=r):be(e,t,n);break;default:be(e,t,n)}}function As(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Nf),t.forEach(function(r){var l=Of.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function Le(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=o),r&=~i}if(r=l,r=X()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*_f(r/1960))-r,10e?16:e,it===null)var r=!1;else{if(e=it,it=null,ll=0,D&6)throw Error(w(331));var l=D;for(D|=4,N=e.current;N!==null;){var i=N,o=i.child;if(N.flags&16){var u=i.deletions;if(u!==null){for(var a=0;aX()-Lo?Et(e,0):zo|=n),ve(e,t)}function rc(e,t){t===0&&(e.mode&1?(t=dr,dr<<=1,!(dr&130023424)&&(dr=4194304)):t=1);var n=ae();e=Ze(e,t),e!==null&&(er(e,t,n),ve(e,n))}function Df(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),rc(e,n)}function Of(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(w(314))}r!==null&&r.delete(t),rc(e,n)}var lc;lc=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||he.current)pe=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return pe=!1,Sf(e,t,n);pe=!!(e.flags&131072)}else pe=!1,B&&t.flags&1048576&&ua(t,Gr,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Dr(e,t),e=t.pendingProps;var l=rn(t,se.current);bt(t,n),l=No(null,t,r,e,l,n);var i=Co();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,me(r)?(i=!0,Yr(t)):i=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,wo(t),l.updater=ml,t.stateNode=l,l._reactInternals=t,zi(t,r,e,n),t=Di(null,t,r,!0,i,n)):(t.tag=0,B&&i&&fo(t),ue(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Dr(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=If(r),e=Re(r,e),l){case 0:t=Ri(null,t,r,e,n);break e;case 1:t=Is(null,t,r,e,n);break e;case 11:t=Os(null,t,r,e,n);break e;case 14:t=Ms(null,t,r,Re(r.type,e),n);break e}throw Error(w(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Re(r,l),Ri(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Re(r,l),Is(e,t,r,l,n);case 3:e:{if(Aa(t),e===null)throw Error(w(387));r=t.pendingProps,i=t.memoizedState,l=i.element,ha(e,t),qr(t,r,null,n);var o=t.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){l=un(Error(w(423)),t),t=Fs(e,t,r,n,l);break e}else if(r!==l){l=un(Error(w(424)),t),t=Fs(e,t,r,n,l);break e}else for(ge=at(t.stateNode.containerInfo.firstChild),we=t,B=!0,Oe=null,n=fa(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ln(),r===l){t=Je(e,t,n);break e}ue(e,t,r,n)}t=t.child}return t;case 5:return ma(t),e===null&&_i(t),r=t.type,l=t.pendingProps,i=e!==null?e.memoizedProps:null,o=l.children,ki(r,l)?o=null:i!==null&&ki(r,i)&&(t.flags|=32),Ba(e,t),ue(e,t,o,n),t.child;case 6:return e===null&&_i(t),null;case 13:return Va(e,t,n);case 4:return xo(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=on(t,null,r,n):ue(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Re(r,l),Os(e,t,r,l,n);case 7:return ue(e,t,t.pendingProps,n),t.child;case 8:return ue(e,t,t.pendingProps.children,n),t.child;case 12:return ue(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,i=t.memoizedProps,o=l.value,F(Zr,r._currentValue),r._currentValue=o,i!==null)if(Fe(i.value,o)){if(i.children===l.children&&!he.current){t=Je(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var u=i.dependencies;if(u!==null){o=i.child;for(var a=u.firstContext;a!==null;){if(a.context===r){if(i.tag===1){a=Ye(-1,n&-n),a.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var p=c.pending;p===null?a.next=a:(a.next=p.next,p.next=a),c.pending=a}}i.lanes|=n,a=i.alternate,a!==null&&(a.lanes|=n),Pi(i.return,n,t),u.lanes|=n;break}a=a.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(w(341));o.lanes|=n,u=o.alternate,u!==null&&(u.lanes|=n),Pi(o,n,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}ue(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,bt(t,n),l=_e(l),r=r(l),t.flags|=1,ue(e,t,r,n),t.child;case 14:return r=t.type,l=Re(r,t.pendingProps),l=Re(r.type,l),Ms(e,t,r,l,n);case 15:return Ua(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Re(r,l),Dr(e,t),t.tag=1,me(r)?(e=!0,Yr(t)):e=!1,bt(t,n),Ma(t,r,l),zi(t,r,l,n),Di(null,t,r,!0,e,n);case 19:return Ha(e,t,n);case 22:return $a(e,t,n)}throw Error(w(156,t.tag))};function ic(e,t){return Ru(e,t)}function Mf(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ce(e,t,n,r){return new Mf(e,t,n,r)}function Mo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function If(e){if(typeof e=="function")return Mo(e)?1:0;if(e!=null){if(e=e.$$typeof,e===bi)return 11;if(e===eo)return 14}return 2}function pt(e,t){var n=e.alternate;return n===null?(n=Ce(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Ir(e,t,n,r,l,i){var o=2;if(r=e,typeof e=="function")Mo(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Ut:return _t(n.children,l,i,t);case qi:o=8,l|=8;break;case ei:return e=Ce(12,n,t,l|2),e.elementType=ei,e.lanes=i,e;case ti:return e=Ce(13,n,t,l),e.elementType=ti,e.lanes=i,e;case ni:return e=Ce(19,n,t,l),e.elementType=ni,e.lanes=i,e;case mu:return gl(n,l,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case pu:o=10;break e;case hu:o=9;break e;case bi:o=11;break e;case eo:o=14;break e;case et:o=16,r=null;break e}throw Error(w(130,e==null?e:typeof e,""))}return t=Ce(o,n,t,l),t.elementType=e,t.type=r,t.lanes=i,t}function _t(e,t,n,r){return e=Ce(7,e,r,t),e.lanes=n,e}function gl(e,t,n,r){return e=Ce(22,e,r,t),e.elementType=mu,e.lanes=n,e.stateNode={isHidden:!1},e}function Zl(e,t,n){return e=Ce(6,e,null,t),e.lanes=n,e}function Jl(e,t,n){return t=Ce(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Ff(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ll(0),this.expirationTimes=Ll(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ll(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function Io(e,t,n,r,l,i,o,u,a){return e=new Ff(e,t,n,u,a),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Ce(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},wo(i),e}function Uf(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(ac)}catch(e){console.error(e)}}ac(),au.exports=Se;var Hf=au.exports,cc,Gs=Hf;cc=Gs.createRoot,Gs.hydrateRoot;const dc=()=>{var e,t;return(t=(e=window==null?void 0:window.go)==null?void 0:e.main)==null?void 0:t.App},Wf=()=>!!dc();async function I(e,...t){const n=dc();if(!n||typeof n[e]!="function")throw new Error(`${e} is unavailable — run this inside the Behavision app`);return n[e](...t)}const A={session:()=>I("Session"),login:(e,t)=>I("Login",e,t),logout:()=>I("Logout"),claim:e=>I("Claim",e),runStandalone:()=>I("RunStandalone"),engineStatus:()=>I("EngineStatus"),startEngine:()=>I("StartEngine"),stopEngine:()=>I("StopEngine"),cameras:()=>I("Cameras"),testCamera:e=>I("TestCamera",e),saveCamera:(e,t)=>I("SaveCamera",e,t),deleteCamera:e=>I("DeleteCamera",e),startPlacement:(e,t)=>I("StartPlacementCheck",e,t),placementResult:e=>I("PlacementResult",e),streamURL:e=>I("StreamURL",e),live:()=>I("Live"),pipelineStatus:()=>I("PipelineStatus"),localIdentities:e=>I("LocalIdentities",e),localSightings:e=>I("LocalSightings",e),footfall:(e,t,n)=>I("Footfall",e,t,n),sites:()=>I("Sites"),visitorHistory:(e,t)=>I("VisitorHistory",e,t),visitorPhoto:e=>I("VisitorPhoto",e),forgetCustomer:e=>I("ForgetCustomer",e),sales:(e,t)=>I("Sales",e,t),customers:(e,t)=>I("Customers",e,t),saveProfile:e=>I("SaveProfile",e),recordPurchase:(e,t,n,r)=>I("RecordPurchase",e,t,n,r)};function Te(e){return e?typeof e=="string"?e:e.message||String(e):"Something went wrong."}function Dt(e,t,n=[]){const[r,l]=P.useState(null),[i,o]=P.useState(null),[u,a]=P.useState(!0),c=P.useRef(!0),p=P.useRef(!1),v=P.useCallback(async()=>{if(!p.current){p.current=!0;try{const m=await e();if(!c.current)return;l(m),o(null)}catch(m){c.current&&o(Te(m))}finally{p.current=!1,c.current&&a(!1)}}},n);return P.useEffect(()=>{if(c.current=!0,v(),!t)return()=>{c.current=!1};const m=setInterval(v,t);return()=>{c.current=!1,clearInterval(m)}},[v,t]),{data:r,error:i,loading:u,reload:v}}function Qf(e){if(!e)return"—";const t=typeof e=="number"?new Date(e*1e3):new Date(e);return isNaN(t)?"—":t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function Zs(e){if(!e)return"—";const t=typeof e=="number"?new Date(e*1e3):new Date(e);return isNaN(t)?"—":t.toLocaleDateString([],{day:"numeric",month:"short"})}function Kf({onDone:e}){const[t,n]=P.useState(""),[r,l]=P.useState(""),[i,o]=P.useState(!1),[u,a]=P.useState(null);async function c(p){p.preventDefault(),o(!0),a(null);try{e(await A.login(t.trim(),r))}catch(v){a(Te(v))}finally{o(!1)}}return s.jsx("div",{className:"login",children:s.jsxs("div",{className:"box",children:[s.jsx("h1",{children:"Behavision"}),s.jsx("p",{className:"lead",children:"Sign in to connect this PC to your store."}),s.jsxs("form",{onSubmit:c,children:[u&&s.jsx("div",{className:"err",children:u}),s.jsxs("label",{className:"field",children:[s.jsx("span",{children:"Email"}),s.jsx("input",{type:"email",value:t,autoComplete:"username",required:!0,autoFocus:!0,onChange:p=>n(p.target.value)})]}),s.jsxs("label",{className:"field",children:[s.jsx("span",{children:"Password"}),s.jsx("input",{type:"password",value:r,autoComplete:"current-password",required:!0,onChange:p=>l(p.target.value)})]}),s.jsx("button",{className:"btn primary",disabled:i||!t||!r,children:i?"Signing in…":"Sign in"})]}),s.jsx("p",{className:"foot",children:"Signing in downloads this store's recognition models and connects it to your account. Nothing is sent until a camera is set up."})]})})}function Js({onDone:e,onCancel:t}){const[n,r]=P.useState(""),[l,i]=P.useState(null),[o,u]=P.useState(null),[a,c]=P.useState(!1);async function p(m){m.preventDefault(),i("claim"),u(null);try{e(await A.claim(n))}catch(g){u(Te(g))}finally{i(null)}}async function v(){i("alone"),u(null);try{e(await A.runStandalone())}catch(m){u(Te(m))}finally{i(null)}}return s.jsx("div",{className:"login",children:s.jsxs("div",{className:"box",children:[s.jsx("h1",{children:t?"Link to head office":"Set up this PC"}),s.jsx("p",{className:"lead",children:"Type the installation code for this shop. You only do this once."}),s.jsxs("form",{onSubmit:p,children:[o&&s.jsx("div",{className:"err",children:o}),s.jsxs("label",{className:"field",children:[s.jsx("span",{children:"Installation code"}),s.jsx("input",{value:n,autoFocus:!0,required:!0,placeholder:"ABCDEF-123456-GHIJKL-789012",autoComplete:"off",spellCheck:"false",style:{textTransform:"uppercase",letterSpacing:".06em"},onChange:m=>r(m.target.value)})]}),s.jsx("button",{className:"btn primary",disabled:!!l||n.trim().length<6,children:l==="claim"?"Linking…":"Link this PC"})]}),s.jsx("p",{className:"foot",children:"The code works once. Ask whoever manages your shops for it — they can create one from the Behavision platform, under the shop."}),s.jsx("div",{className:"alt",children:t?s.jsx("button",{type:"button",className:"linkbtn",onClick:t,children:"Not now — go back"}):a?s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"note",children:"This PC will watch its cameras and recognise returning customers on its own. Nothing is sent anywhere. You can link it to head office later without losing anything recorded here."}),s.jsx("button",{type:"button",className:"btn",disabled:!!l,onClick:v,children:l==="alone"?"Setting up…":"Use this PC on its own"})]}):s.jsx("button",{type:"button",className:"linkbtn",onClick:()=>c(!0),children:"No head office — set this PC up on its own"})})]})})}function fc(){var a,c;const{data:e,error:t}=Dt(()=>A.live(),3e3),{data:n}=Dt(()=>A.pipelineStatus(),5e3),r=Zf(),l=((a=e==null?void 0:e.stats)==null?void 0:a.cameras)??[],i=((c=e==null?void 0:e.stats)==null?void 0:c.gallery)??{},o=(e==null?void 0:e.events)??[],u=l.reduce((p,v)=>{var g,x;const m=(x=(g=v==null?void 0:v.pipeline)==null?void 0:g.best_quality)==null?void 0:x.fraction_below_gate;return typeof m=="number"&&m>p?m:p},0);return s.jsxs("div",{className:"page",children:[s.jsxs("header",{children:[s.jsx("h2",{children:"Live"}),s.jsx("p",{children:"Cameras, recent detections, and whether this site is recognising people."})]}),t&&s.jsx("div",{className:"err",children:t}),s.jsxs("div",{className:"grid cols-4",style:{marginBottom:16},children:[s.jsx(jr,{label:"People known",value:i.identities??"—"}),s.jsx(jr,{label:"Sightings",value:i.sightings??"—"}),s.jsx(jr,{label:"Cameras live",value:`${l.filter(p=>p.connected).length}/${l.length||0}`}),s.jsx(jr,{label:"Below quality gate",value:l.length?`${Math.round(u*100)}%`:"—",tone:u>.5?"bad":u>.2?"warn":"ok",sub:u>.5?"Most visitors are being missed — check camera placement":"Share of faces too poor to enrol"})]}),s.jsx(Yf,{pipe:n}),s.jsxs("div",{className:"grid cols-2",children:[s.jsx("div",{children:s.jsxs("div",{className:"card",children:[s.jsx("h3",{children:"Cameras"}),l.length===0?s.jsx("div",{className:"empty",children:"No cameras yet. Add one in Cameras."}):s.jsx("div",{className:"feeds",children:l.map(p=>s.jsxs("div",{className:"feed",children:[r[p.camera_id]?s.jsx("img",{src:r[p.camera_id],alt:p.camera_id}):s.jsx("div",{style:{aspectRatio:"16/9"}}),s.jsxs("div",{className:"cap",children:[s.jsx("span",{children:p.camera_id}),s.jsxs("span",{className:`pill ${p.connected?"ok":"bad"}`,children:[s.jsx("i",{className:`dot ${p.connected?"ok":"bad"}`}),p.connected?"live":"offline"]})]})]},p.camera_id))})]})}),s.jsxs("div",{className:"card",children:[s.jsx("h3",{children:"Recent detections"}),o.length===0?s.jsx("div",{className:"empty",children:"Nothing detected yet."}):s.jsx("ul",{className:"events",children:o.map((p,v)=>s.jsx(Xf,{e:p},v))})]})]})]})}function Yf({pipe:e}){if(!e)return null;if(e.standalone)return s.jsxs("div",{className:"card",style:{marginBottom:16,display:"flex",gap:10,alignItems:"center"},children:[s.jsx("i",{className:"dot ok"}),s.jsx("strong",{style:{fontSize:13},children:"Running on this PC only"}),s.jsx("span",{className:"note",children:"Recognition and customers stay here."})]});const t=e.claimed&&!e.broker_up;return s.jsxs("div",{className:"card",style:{marginBottom:16,display:"flex",gap:22,alignItems:"center",flexWrap:"wrap"},children:[s.jsxs("span",{style:{display:"flex",alignItems:"center",gap:8},children:[s.jsx("i",{className:`dot ${e.claimed?e.broker_up?"ok":"bad":"idle"}`}),s.jsx("strong",{style:{fontSize:13},children:e.claimed?e.broker_up?"Sending to head office":"Offline — saving locally":"Not linked to head office"})]}),s.jsxs("span",{className:"note",children:[e.accepted," recorded today"]}),e.queued>0&&s.jsxs("span",{className:"note",style:t?{color:"var(--warn)"}:void 0,children:[e.queued," waiting to send"]}),e.dropped>0&&s.jsxs("span",{className:"note",style:{color:"var(--bad)"},children:[e.dropped," lost — this PC was offline too long"]})]})}function Xf({e}){var l,i,o,u,a;const t=e.type==="person.new"?"new":e.type==="person.seen"?"seen":e.type==="person.missed"?"miss":"",n=((l=e.data)==null?void 0:l.age)??((i=e.data)==null?void 0:i.age_range),r=[(o=e.data)==null?void 0:o.gender,n,(u=e.data)==null?void 0:u.emotion].filter(Boolean).join(", ");return s.jsxs("li",{children:[s.jsx("span",{className:"when",children:Qf(e.ts)}),s.jsx("span",{className:`tag ${t}`,children:Gf(e.type)}),s.jsxs("span",{style:{flex:1,minWidth:0},children:[((a=e.data)==null?void 0:a.label)||e.camera_id,r&&s.jsxs("span",{className:"note",children:[" · ",r]})]})]})}function Gf(e){return{"person.new":"new","person.seen":"returning","person.missed":"missed","camera.up":"camera up","camera.down":"camera down","identity.merged":"merged"}[e]??e}function jr({label:e,value:t,sub:n,tone:r}){return s.jsxs("div",{className:"card stat",children:[s.jsx("h3",{children:e}),s.jsx("div",{className:"value",style:r?{color:`var(--${r})`}:void 0,children:t}),n&&s.jsx("div",{className:"sub",children:n})]})}function Zf(){const[e,t]=P.useState({}),{data:n}=Dt(()=>A.cameras(),1e4);return P.useEffect(()=>{let r=!1;return(async()=>{const l={};for(const o of n??[]){if(e[o.id]){l[o.id]=e[o.id];continue}try{l[o.id]=await A.streamURL(o.id)}catch{}}const i=Object.keys(l).length!==Object.keys(e).length||Object.keys(l).some(o=>l[o]!==e[o]);!r&&i&&t(l)})(),()=>{r=!0}},[n]),e}function Jf(e){const[t,n]=P.useState(null);return P.useEffect(()=>{let r=!0;return n(null),A.visitorPhoto(e).then(l=>{r&&n(l)}).catch(()=>{r&&n({available:!1,reason:""})}),()=>{r=!1}},[e]),t}function qf({photo:e,name:t,onBroken:n}){if(e!=null&&e.available)return s.jsx("img",{className:"avatar",src:e.url,alt:`Photo of ${t}`,onError:n});const r=String(t||"").split(/\s+/).filter(Boolean).slice(0,2).map(l=>l[0].toUpperCase()).join("")||"?";return s.jsx("div",{className:"avatar none",role:"img","aria-label":`No photo of ${t}`,children:s.jsx("span",{children:r})})}function bf({customer:e}){const{data:t,error:n,loading:r}=Dt(()=>A.visitorHistory(e.id,50),0,[e.id]);if(r)return s.jsx("p",{className:"note",children:"Loading visits…"});if(n)return s.jsxs("p",{className:"note",children:["Could not load visits: ",n]});const l=t??[];return l.length===0?s.jsx("p",{className:"note",children:"No recorded visits yet."}):s.jsx("ul",{className:"timeline",children:l.map(i=>s.jsxs("li",{children:[s.jsx("span",{className:"when",children:ep(i.occurred_at)}),s.jsxs("span",{className:"where",children:[i.site||"this store",i.camera_id?s.jsxs("span",{className:"note",children:[" · ",i.camera_id]}):null]}),i.is_new_visitor&&s.jsx("span",{className:"tag new",children:"first visit"})]},i.id))})}function ep(e){const t=new Date(e);return isNaN(t)?"—":t.toLocaleString([],{day:"numeric",month:"short",hour:"2-digit",minute:"2-digit"})}function tp({customer:e,onCancel:t,onDone:n}){const r=e.full_name||e.label,[l,i]=P.useState(""),[o,u]=P.useState(!1),[a,c]=P.useState(null),p=l.trim().toLowerCase()===r.trim().toLowerCase();async function v(){u(!0),c(null);try{await A.forgetCustomer(e.id),n()}catch(m){c(Te(m)),u(!1)}}return s.jsxs("div",{className:"confirm",children:[s.jsxs("h4",{children:["Erase ",r,"?"]}),s.jsxs("div",{className:"cols",children:[s.jsxs("div",{children:[s.jsx("p",{className:"lbl bad",children:"Deleted for good"}),s.jsxs("ul",{children:[s.jsx("li",{children:"Their face data — they will not be recognised again"}),s.jsx("li",{children:"Their photo"}),s.jsx("li",{children:"Their name, phone, email and notes"})]})]}),s.jsxs("div",{children:[s.jsx("p",{className:"lbl",children:"Kept"}),s.jsxs("ul",{children:[s.jsx("li",{children:"Past visits, with their name removed — your footfall figures do not change"}),s.jsx("li",{children:"The consent record, marked withdrawn, as proof of what was agreed"})]})]})]}),s.jsx("p",{className:"note",children:"This cannot be undone. If they come back they will be recorded as a new customer."}),a&&s.jsx("div",{className:"err",children:a}),s.jsxs("label",{className:"field",children:[s.jsxs("span",{children:["Type ",s.jsx("b",{children:r})," to confirm"]}),s.jsx("input",{value:l,onChange:m=>i(m.target.value),autoFocus:!0,autoComplete:"off",spellCheck:"false","aria-label":`Type ${r} to confirm erasure`})]}),s.jsxs("div",{className:"row",children:[s.jsx("button",{type:"button",className:"btn danger",disabled:!p||o,onClick:v,children:o?"Erasing…":"Erase permanently"}),s.jsx("button",{type:"button",className:"btn",onClick:t,disabled:o,children:"Cancel"})]})]})}function np({customer:e,session:t,onClose:n,onSaved:r}){var _;const[l,i]=P.useState({full_name:e.full_name??"",phone:e.phone??"",email:e.email??"",gender:"",date_of_birth:"",notes:"",consent:e.has_consent??!1}),[o,u]=P.useState({amount:"",items:"",notes:""}),[a,c]=P.useState(!1),[p,v]=P.useState(null),[m,g]=P.useState(!1),[x,k]=P.useState(null),O=Jf(e.id),h=x??O,d=(_=t==null?void 0:t.user)==null?void 0:_.role,f=["admin","owner","manager"].includes(d),y=j=>E=>i({...l,[j]:E.target.value});async function S(j){j.preventDefault(),c(!0),v(null);try{await A.saveProfile({visitor_id:e.id,...l});const E=parseFloat(o.amount);if(!isNaN(E)&&E>0){const V=o.items.split(",").map(L=>L.trim()).filter(Boolean);await A.recordPurchase(e.id,E,V,o.notes)}r()}catch(E){v(Te(E))}finally{c(!1)}}return s.jsx("div",{className:"drawer",onMouseDown:j=>j.target===j.currentTarget&&n(),children:s.jsxs("div",{className:"panel",children:[s.jsxs("div",{className:"who",children:[s.jsx(qf,{photo:h,name:e.full_name||e.label,onBroken:()=>k({available:!1,reason:"The photo could not be loaded."})}),s.jsxs("div",{className:"grow",children:[s.jsx("h3",{children:e.full_name||e.label}),s.jsxs("p",{className:"note",children:[e.visit_count," visit",e.visit_count===1?"":"s",e.last_seen_at&&` · last seen ${new Date(e.last_seen_at).toLocaleDateString()}`]}),h&&!h.available&&h.reason&&s.jsx("p",{className:"note",children:h.reason})]}),s.jsx("button",{type:"button",className:"btn sm",onClick:n,children:"Close"})]}),s.jsxs("form",{onSubmit:S,children:[p&&s.jsx("div",{className:"err",children:p}),s.jsxs("div",{className:"card",style:{marginBottom:14},children:[s.jsx("h3",{children:"Customer details"}),s.jsxs("label",{className:"field",children:[s.jsx("span",{children:"Full name"}),s.jsx("input",{value:l.full_name,onChange:y("full_name"),autoFocus:!0})]}),s.jsxs("div",{className:"fieldrow",children:[s.jsxs("label",{className:"field",children:[s.jsx("span",{children:"Phone"}),s.jsx("input",{value:l.phone,onChange:y("phone"),inputMode:"tel"})]}),s.jsxs("label",{className:"field",children:[s.jsx("span",{children:"Email"}),s.jsx("input",{value:l.email,onChange:y("email"),type:"email"})]})]}),s.jsxs("div",{className:"fieldrow",children:[s.jsxs("label",{className:"field",children:[s.jsx("span",{children:"Gender"}),s.jsxs("select",{value:l.gender,onChange:y("gender"),children:[s.jsx("option",{value:"",children:"Not recorded"}),s.jsx("option",{children:"Female"}),s.jsx("option",{children:"Male"}),s.jsx("option",{children:"Other"})]})]}),s.jsxs("label",{className:"field",children:[s.jsx("span",{children:"Date of birth"}),s.jsx("input",{type:"date",value:l.date_of_birth,onChange:y("date_of_birth")})]})]}),s.jsxs("label",{className:"field",children:[s.jsx("span",{children:"Notes"}),s.jsx("textarea",{value:l.notes,onChange:y("notes"),placeholder:"Preferences, sizes, anything worth remembering"})]})]}),s.jsxs("div",{className:"card",style:{marginBottom:14},children:[s.jsx("h3",{children:"Purchase (optional)"}),s.jsxs("div",{className:"fieldrow",children:[s.jsxs("label",{className:"field",children:[s.jsx("span",{children:"Amount"}),s.jsx("input",{value:o.amount,inputMode:"decimal",placeholder:"0.00",onChange:j=>u({...o,amount:j.target.value})})]}),s.jsxs("label",{className:"field",children:[s.jsx("span",{children:"Items"}),s.jsx("input",{value:o.items,placeholder:"shirt, belt",onChange:j=>u({...o,items:j.target.value})})]})]}),s.jsx("p",{className:"note",children:"Leave the amount blank if they did not buy anything — a visit without a sale is still worth recording."})]}),s.jsxs("div",{className:"card",style:{marginBottom:16},children:[s.jsx("h3",{children:"Consent"}),s.jsxs("label",{style:{display:"flex",gap:10,alignItems:"flex-start",fontSize:13,cursor:"pointer"},children:[s.jsx("input",{type:"checkbox",checked:l.consent,style:{marginTop:3},onChange:j=>i({...l,consent:j.target.checked})}),s.jsx("span",{children:"This customer agreed to us keeping their details and recognising them on future visits."})]}),s.jsx("p",{className:"note",style:{marginTop:10},children:"Recorded with the date and who collected it. They can withdraw it at any time, which erases their face data."})]}),s.jsxs("div",{className:"card",style:{marginBottom:14},children:[s.jsx("h3",{children:"Visits"}),s.jsx(bf,{customer:e})]}),s.jsxs("div",{style:{display:"flex",gap:8},children:[s.jsx("button",{className:"btn primary",disabled:a,children:a?"Saving…":"Save"}),s.jsx("button",{type:"button",className:"btn",onClick:n,children:"Cancel"})]}),f&&s.jsxs("div",{className:"card danger-zone",children:[s.jsx("h3",{children:"At the customer's request"}),m?s.jsx(tp,{customer:e,onCancel:()=>g(!1),onDone:r}):s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"note",children:"Erase this person's face data, photo and details. Their past visits stay in your footfall figures, without their name."}),s.jsx("button",{type:"button",className:"btn danger",onClick:()=>g(!0),children:"Erase this customer…"})]})]})]})]})})}function rp({session:e}){const[t,n]=P.useState(""),[r,l]=P.useState(null),{data:i,error:o,reload:u}=Dt(()=>A.customers(t,200),3e4,[t]),a=i??[],c=a.filter(p=>p.has_profile).length;return s.jsxs("div",{className:"page",children:[s.jsxs("header",{children:[s.jsx("h2",{children:"Customers"}),s.jsx("p",{children:"Everyone this business has recognised. Fill in details once and they are known at every store."})]}),o&&s.jsx("div",{className:"err",children:o}),s.jsxs("div",{className:"grid cols-4",style:{marginBottom:16},children:[s.jsx(Nr,{label:"Known people",value:a.length||"—"}),s.jsx(Nr,{label:"With details",value:c||"—",sub:a.length?`${Math.round(100*c/a.length)}% captured`:null}),s.jsx(Nr,{label:"Returning",value:a.filter(p=>p.visit_count>1).length||"—"}),s.jsx(Nr,{label:"With consent",value:a.filter(p=>p.has_consent).length||"—"})]}),s.jsxs("div",{className:"card",children:[s.jsxs("div",{style:{display:"flex",gap:10,marginBottom:12},children:[s.jsx("input",{className:"field",style:{flex:1,margin:0,background:"var(--ground)",border:"1px solid var(--line)",borderRadius:6,padding:"8px 10px"},placeholder:"Search by name or phone",value:t,onChange:p=>n(p.target.value)}),s.jsx("button",{className:"btn",onClick:u,children:"Refresh"})]}),a.length===0?s.jsx("div",{className:"empty",children:"No customers yet. They appear here the first time a camera sees them."}):s.jsx("div",{className:"tablewrap",children:s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Customer"}),s.jsx("th",{children:"Phone"}),s.jsx("th",{className:"num",children:"Visits"}),s.jsx("th",{children:"First seen"}),s.jsx("th",{children:"Last seen"}),s.jsx("th",{children:"Details"})]})}),s.jsx("tbody",{children:a.map(p=>s.jsxs("tr",{className:"click",onClick:()=>l(p),children:[s.jsxs("td",{children:[p.full_name||s.jsx("span",{className:"note",children:p.label}),p.full_name&&p.ref&&s.jsxs("span",{className:"note",children:[" · ",p.ref]})]}),s.jsx("td",{className:"mono",children:p.phone||"—"}),s.jsx("td",{className:"num",children:p.visit_count}),s.jsx("td",{children:Zs(p.first_seen_at)}),s.jsx("td",{children:Zs(p.last_seen_at)}),s.jsx("td",{children:p.has_profile?s.jsxs("span",{className:"pill ok",children:[s.jsx("i",{className:"dot ok"}),"captured"]}):s.jsxs("span",{className:"pill warn",children:[s.jsx("i",{className:"dot warn"}),"needed"]})})]},p.id))})]})})]}),r&&s.jsx(np,{customer:r,session:e,onClose:()=>l(null),onSaved:()=>{l(null),u()}})]})}function Nr({label:e,value:t,sub:n}){return s.jsxs("div",{className:"card stat",children:[s.jsx("h3",{children:e}),s.jsx("div",{className:"value",children:t}),n&&s.jsx("div",{className:"sub",children:n})]})}const tn=[{id:"hikvision",label:"Hikvision",path:"/Streaming/Channels/101",note:"Channel 1, main stream. Use /Streaming/Channels/102 for the lower-quality sub stream."},{id:"dahua",label:"Dahua",path:"/cam/realmonitor?channel=1&subtype=0",note:"Channel 1, main stream. subtype=1 is the sub stream."},{id:"cpplus",label:"CP Plus",path:"/cam/realmonitor?channel=1&subtype=0",note:"CP Plus cameras use the Dahua stream path."},{id:"uniview",label:"Uniview",path:"/media/video1",note:"Some older Uniview models use /video1 instead."},{id:"tplink",label:"TP-Link / Tapo",path:"/stream1",note:"Tapo cameras need a separate camera account created in the Tapo app — your Tapo login will not work."},{id:"reolink",label:"Reolink",path:"/h264Preview_01_main",note:"Use /h264Preview_01_sub for the lower-quality stream."},{id:"amcrest",label:"Amcrest",path:"/cam/realmonitor?channel=1&subtype=0",note:"Amcrest cameras use the Dahua stream path."},{id:"axis",label:"Axis",path:"/axis-media/media.amp",note:""},{id:"onvif",label:"Other (ONVIF)",path:"/onvif1",note:"Many generic cameras answer here. If it does not work, look for “RTSP” in the camera’s own app."},{id:"manual",label:"I know the path",path:"",note:""}],ql=e=>tn.find(t=>t.id===e)||tn[tn.length-1],pc={id:"",host:"",port:554,path:"",username:"",password:"",max_width:1280};function lp(){const{data:e,error:t,reload:n}=Dt(()=>A.cameras(),8e3),[r,l]=P.useState(null),[i,o]=P.useState(null),u=e??[];async function a(c){if(confirm(`Remove camera "${c}"? Recognition from it stops immediately.`))try{await A.deleteCamera(c),n()}catch(p){alert(Te(p))}}return s.jsxs("div",{className:"page",children:[s.jsxs("header",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-end"},children:[s.jsxs("div",{children:[s.jsx("h2",{children:"Cameras"}),s.jsx("p",{children:"Add a camera, check it can see faces properly, then it starts working."})]}),s.jsx("button",{className:"btn primary",onClick:()=>l({...pc}),children:"Add camera"})]}),t&&s.jsx("div",{className:"err",children:t}),s.jsx("div",{className:"card",children:u.length===0?s.jsx("div",{className:"empty",children:"No cameras yet."}):s.jsx("div",{className:"tablewrap",children:s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Name"}),s.jsx("th",{children:"Address"}),s.jsx("th",{children:"Status"}),s.jsx("th",{})]})}),s.jsx("tbody",{children:u.map(c=>s.jsxs("tr",{children:[s.jsx("td",{children:c.id}),s.jsx("td",{className:"mono",children:c.url}),s.jsx("td",{children:c.connected===void 0?s.jsxs("span",{className:"pill",children:[s.jsx("i",{className:"dot idle"}),"stopped"]}):c.connected?s.jsxs("span",{className:"pill ok",children:[s.jsx("i",{className:"dot ok"}),"live"]}):s.jsxs("span",{className:"pill bad",children:[s.jsx("i",{className:"dot bad"}),"offline"]})}),s.jsxs("td",{style:{textAlign:"right",whiteSpace:"nowrap"},children:[s.jsx("button",{className:"btn sm",onClick:()=>o(c.id),children:"Check placement"})," ",s.jsx("button",{className:"btn sm",onClick:()=>l(c),children:"Edit"})," ",s.jsx("button",{className:"btn sm danger",onClick:()=>a(c.id),children:"Remove"})]})]},c.id))})]})})}),r&&s.jsx(ip,{cam:r,onClose:()=>l(null),onSaved:()=>{l(null),n()}}),i&&s.jsx(op,{id:i,onClose:()=>o(null)})]})}function ip({cam:e,onClose:t,onSaved:n}){const r=!e.id,[l,i]=P.useState({...pc,...e,password:"",path:e.path||(r?tn[0].path:"")}),[o,u]=P.useState(r?tn[0].id:"manual"),[a,c]=P.useState(null),[p,v]=P.useState(null),[m,g]=P.useState(null),x=f=>y=>i({...l,[f]:y.target.value});function k(f){const y=ql(f.target.value);u(y.id),i(S=>({...S,path:y.path||S.path}))}function O(){const f={};for(const[y,S]of Object.entries(l))S===""||S===null||S===void 0||(f[y]=y==="port"||y==="max_width"?Number(S):S);return f}async function h(){v("test"),g(null),c(null);try{c(await A.testCamera(O()))}catch(f){g(Te(f))}finally{v(null)}}async function d(f){f.preventDefault(),v("save"),g(null);try{await A.saveCamera(r?"":e.id,O()),n()}catch(y){g(Te(y))}finally{v(null)}}return s.jsx("div",{className:"drawer",onMouseDown:f=>f.target===f.currentTarget&&t(),children:s.jsxs("div",{className:"panel",children:[s.jsx("button",{className:"btn sm close",onClick:t,children:"Close"}),s.jsx("h3",{children:r?"Add camera":e.id}),s.jsx("p",{className:"note",style:{marginBottom:18},children:"Test the connection before saving — a wrong address is the most common mistake."}),s.jsxs("form",{onSubmit:d,children:[m&&s.jsx("div",{className:"err",children:m}),s.jsxs("label",{className:"field",children:[s.jsx("span",{children:"Name"}),s.jsx("input",{value:l.id,onChange:x("id"),disabled:!r,placeholder:"entrance",required:!0,autoComplete:"off"})]}),s.jsxs("label",{className:"field",children:[s.jsx("span",{children:"Make of camera"}),s.jsx("select",{value:o,onChange:k,children:tn.map(f=>s.jsx("option",{value:f.id,children:f.label},f.id))})]}),ql(o).note&&s.jsx("p",{className:"note",style:{marginTop:-8,marginBottom:12},children:ql(o).note}),s.jsxs("div",{className:"fieldrow",children:[s.jsxs("label",{className:"field",children:[s.jsx("span",{children:"Camera address"}),s.jsx("input",{value:l.host,onChange:x("host"),placeholder:"192.168.0.138",autoComplete:"off"})]}),s.jsxs("label",{className:"field",children:[s.jsx("span",{children:"Port"}),s.jsx("input",{value:l.port,onChange:x("port"),inputMode:"numeric",autoComplete:"off"})]})]}),s.jsxs("label",{className:"field",children:[s.jsx("span",{children:"Stream path"}),s.jsx("input",{value:l.path,onChange:x("path"),placeholder:"/ch0_0.264",autoComplete:"off"})]}),s.jsxs("div",{className:"fieldrow",children:[s.jsxs("label",{className:"field",children:[s.jsx("span",{children:"Username"}),s.jsx("input",{value:l.username,onChange:x("username"),name:"camera-account",autoComplete:"off"})]}),s.jsxs("label",{className:"field",children:[s.jsx("span",{children:"Password"}),s.jsx("input",{type:"password",value:l.password,onChange:x("password"),name:"camera-secret",autoComplete:"new-password",placeholder:e.has_password?"(unchanged)":""})]})]}),s.jsxs("div",{style:{display:"flex",gap:8,marginTop:4},children:[s.jsx("button",{type:"button",className:"btn",onClick:h,disabled:!!p,children:p==="test"?"Connecting…":"Test connection"}),s.jsx("button",{className:"btn primary",disabled:!!p||!l.id,children:p==="save"?"Saving…":"Save"})]}),a&&s.jsx("div",{style:{marginTop:14},children:a.ok?s.jsxs(s.Fragment,{children:[s.jsxs("p",{style:{color:"var(--ok)",fontSize:13},children:["Connected — ",a.width,"×",a.height]}),a.snapshot&&s.jsx("img",{alt:"Camera preview",style:{width:"100%",marginTop:8,borderRadius:6,border:"1px solid var(--line)"},src:`data:image/jpeg;base64,${a.snapshot}`})]}):s.jsx("div",{className:"err",children:a.error})})]})]})})}function op({id:e,onClose:t}){var c,p;const[n,r]=P.useState({verdict:"starting",advice:[]}),[l,i]=P.useState(null),o=P.useRef(null);P.useEffect(()=>{let v=!0;return(async()=>{try{r(await A.startPlacement(e,25)),o.current=setInterval(async()=>{try{const m=await A.placementResult(e);if(!v)return;r(m),m.running||clearInterval(o.current)}catch(m){v&&i(Te(m))}},1e3)}catch(m){v&&i(Te(m))}})(),()=>{v=!1,clearInterval(o.current)}},[e]);const u={good:"ok",marginal:"warn",poor:"bad",artifact:"bad",no_faces:"warn",inconclusive:"warn"}[n.verdict],a=n.seconds?Math.min(100,n.elapsed/n.seconds*100):0;return s.jsx("div",{className:"drawer",onMouseDown:v=>v.target===v.currentTarget&&t(),children:s.jsxs("div",{className:"panel",children:[s.jsx("button",{className:"btn sm close",onClick:t,children:"Close"}),s.jsxs("h3",{children:["Placement check — ",e]}),s.jsx("p",{className:"note",style:{marginBottom:18},children:"Walk past the camera the way a customer would, a few times."}),l&&s.jsx("div",{className:"err",children:l}),s.jsxs("div",{className:"card",children:[s.jsx("div",{style:{fontSize:15,fontWeight:600,color:u?`var(--${u})`:"var(--ink)"},children:n.headline||"Starting…"}),n.running&&s.jsx("div",{style:{height:5,background:"var(--surface-2)",borderRadius:3,overflow:"hidden",margin:"12px 0"},children:s.jsx("div",{style:{height:"100%",width:`${a}%`,background:"var(--accent)",transition:"width .4s linear"}})}),((c=n.advice)==null?void 0:c.length)>0&&s.jsx("ul",{style:{margin:"12px 0 0 18px",fontSize:13,color:"var(--ink-2)"},children:n.advice.map((v,m)=>s.jsx("li",{style:{marginBottom:5},children:v},m))}),((p=n.quality)==null?void 0:p.n)>0&&s.jsxs("p",{className:"note",style:{marginTop:12},children:[n.quality.n," face",n.quality.n===1?"":"s"," seen · median quality ",n.quality.p50," · gate ",n.gate," ·"," ",Math.round((n.quality.fraction_below_gate??0)*100),"% below it"]})]})]})})}const sp=[{id:"live",label:"Live",glyph:"◉",View:fc},{id:"customers",label:"Customers",glyph:"☺",View:rp,cloud:!0},{id:"cameras",label:"Cameras",glyph:"▢",View:lp}];function up(){var p,v,m;const[e,t]=P.useState(null),[n,r]=P.useState("live"),[l,i]=P.useState(!0),[o,u]=P.useState(!1);if(P.useEffect(()=>{(async()=>{try{t(await A.session())}catch{t(null)}i(!1)})()},[]),!Wf())return s.jsx("div",{className:"login",children:s.jsxs("div",{className:"box",children:[s.jsx("h1",{children:"Behavision"}),s.jsx("p",{className:"lead",children:"This is the Behavision window running outside the app, so it has no connection to the recognition engine. Launch the Behavision application instead."})]})});if(l)return s.jsx("div",{className:"login",children:s.jsx("p",{className:"note",children:"Starting…"})});if(!(e!=null&&e.claimed)&&!(e!=null&&e.standalone))return s.jsx(Js,{onDone:t});if(!(e!=null&&e.standalone)&&!(e!=null&&e.logged_in))return s.jsx(Kf,{onDone:t});const a=sp.filter(g=>!g.cloud||!e.standalone),c=((p=a.find(g=>g.id===n))==null?void 0:p.View)??fc;return o?s.jsx(Js,{onDone:g=>{u(!1),t(g)},onCancel:()=>u(!1)}):s.jsxs("div",{className:"shell",children:[s.jsxs("aside",{className:"side",children:[s.jsxs("div",{className:"brand",children:[s.jsx("h1",{children:"Behavision"}),s.jsx("p",{children:e.site_name||((v=e.user)==null?void 0:v.client_name)||"Store"})]}),s.jsx("nav",{className:"nav",children:a.map(g=>s.jsxs("button",{onClick:()=>r(g.id),"aria-current":g.id===n?"page":void 0,children:[s.jsx("span",{className:"glyph",children:g.glyph}),g.label]},g.id))}),s.jsx(ap,{}),s.jsx("div",{style:{padding:"10px 12px 14px",borderTop:"1px solid var(--line-soft)"},children:e.standalone?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"note",style:{marginBottom:8},children:"Running on its own"}),s.jsx("button",{className:"btn sm",style:{width:"100%"},onClick:()=>u(!0),children:"Link to head office"})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"note",style:{marginBottom:8},children:(m=e.user)==null?void 0:m.email}),s.jsx("button",{className:"btn sm",style:{width:"100%"},onClick:async()=>t(await A.logout()),children:"Sign out"})]})})]}),s.jsx("main",{className:"main",children:s.jsx(c,{session:e})})]})}function ap(){const{data:e,reload:t}=Dt(()=>A.engineStatus(),5e3),[n,r]=P.useState(!1),l=e??{state:"stopped"},i=P.useCallback(async v=>{r(!0);try{await v()}catch(m){alert(Te(m))}finally{r(!1),t()}},[t]),o=l.state==="running",u=Object.values(l.cameras??{}),a=u.filter(Boolean).length;let c="idle",p="Stopped";return l.state==="failed"||l.state==="backoff"?(c="bad",p="Not running"):o&&!l.reachable?(c="warn",p="Starting…"):o&&u.length===0?(c="warn",p="No cameras"):o&&a===0?(c="bad",p="No camera connected"):o&&ai(A.startEngine),children:"Start"}),s.jsx("button",{className:"btn sm",disabled:n||!o,onClick:()=>i(A.stopEngine),children:"Stop"})]})]})}cc(document.getElementById("root")).render(s.jsx(Lc.StrictMode,{children:s.jsx(up,{})})); +`+i.stack}return{value:e,source:t,stack:l,digest:null}}function Xl(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Li(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var gf=typeof WeakMap=="function"?WeakMap:Map;function Ia(e,t,n){n=Ye(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){rl||(rl=!0,Ai=r),Li(e,t)},n}function Fa(e,t,n){n=Ye(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var l=t.value;n.payload=function(){return r(l)},n.callback=function(){Li(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Li(e,t),typeof r!="function"&&(dt===null?dt=new Set([this]):dt.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function Ls(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new gf;var l=new Set;r.set(t,l)}else l=r.get(t),l===void 0&&(l=new Set,r.set(t,l));l.has(n)||(l.add(n),e=Rf.bind(null,e,t,n),t.then(e,e))}function Rs(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Ds(e,t,n,r,l){return e.mode&1?(e.flags|=65536,e.lanes=l,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Ye(-1,1),t.tag=2,ct(n,t,1))),n.lanes|=1),e)}var wf=qe.ReactCurrentOwner,pe=!1;function ue(e,t,n,r){t.child=e===null?fa(t,null,n,r):on(t,e.child,n,r)}function Os(e,t,n,r,l){n=n.render;var i=t.ref;return bt(t,l),r=No(e,t,n,r,i,l),n=Co(),e!==null&&!pe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,Je(e,t,l)):(B&&n&&fo(t),t.flags|=1,ue(e,t,r,l),t.child)}function Ms(e,t,n,r,l){if(e===null){var i=n.type;return typeof i=="function"&&!Mo(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,$a(e,t,i,r,l)):(e=Ir(n.type,null,r,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&l)){var o=i.memoizedProps;if(n=n.compare,n=n!==null?n:Hn,n(o,r)&&e.ref===t.ref)return Je(e,t,l)}return t.flags|=1,e=pt(i,r),e.ref=t.ref,e.return=t,t.child=e}function $a(e,t,n,r,l){if(e!==null){var i=e.memoizedProps;if(Hn(i,r)&&e.ref===t.ref)if(pe=!1,t.pendingProps=r=i,(e.lanes&l)!==0)e.flags&131072&&(pe=!0);else return t.lanes=e.lanes,Je(e,t,l)}return Ri(e,t,n,r,l)}function Ua(e,t,n){var r=t.pendingProps,l=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},F(Xt,ye),ye|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,F(Xt,ye),ye|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,F(Xt,ye),ye|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,F(Xt,ye),ye|=r;return ue(e,t,l,n),t.child}function Ba(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Ri(e,t,n,r,l){var i=me(n)?Pt:se.current;return i=rn(t,i),bt(t,l),n=No(e,t,n,r,i,l),r=Co(),e!==null&&!pe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,Je(e,t,l)):(B&&r&&fo(t),t.flags|=1,ue(e,t,n,l),t.child)}function Is(e,t,n,r,l){if(me(n)){var i=!0;Yr(t)}else i=!1;if(bt(t,l),t.stateNode===null)Dr(e,t),Ma(t,n,r),zi(t,n,r,l),r=!0;else if(e===null){var o=t.stateNode,u=t.memoizedProps;o.props=u;var a=o.context,c=n.contextType;typeof c=="object"&&c!==null?c=_e(c):(c=me(n)?Pt:se.current,c=rn(t,c));var p=n.getDerivedStateFromProps,v=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function";v||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(u!==r||a!==c)&&zs(t,o,r,c),tt=!1;var m=t.memoizedState;o.state=m,qr(t,r,o,l),a=t.memoizedState,u!==r||m!==a||he.current||tt?(typeof p=="function"&&(Ti(t,n,p,r),a=t.memoizedState),(u=tt||Ts(t,n,u,r,m,a,c))?(v||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=a),o.props=r,o.state=a,o.context=c,r=u):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,ha(e,t),u=t.memoizedProps,c=t.type===t.elementType?u:Re(t.type,u),o.props=c,v=t.pendingProps,m=o.context,a=n.contextType,typeof a=="object"&&a!==null?a=_e(a):(a=me(n)?Pt:se.current,a=rn(t,a));var g=n.getDerivedStateFromProps;(p=typeof g=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(u!==v||m!==a)&&zs(t,o,r,a),tt=!1,m=t.memoizedState,o.state=m,qr(t,r,o,l);var x=t.memoizedState;u!==v||m!==x||he.current||tt?(typeof g=="function"&&(Ti(t,n,g,r),x=t.memoizedState),(c=tt||Ts(t,n,c,r,m,x,a)||!1)?(p||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,x,a),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,x,a)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||u===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||u===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=x),o.props=r,o.state=x,o.context=a,r=c):(typeof o.componentDidUpdate!="function"||u===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||u===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),r=!1)}return Di(e,t,n,r,i,l)}function Di(e,t,n,r,l,i){Ba(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return l&&Ss(t,n,!1),Je(e,t,i);r=t.stateNode,wf.current=t;var u=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=on(t,e.child,null,i),t.child=on(t,null,u,i)):ue(e,t,u,i),t.memoizedState=r.state,l&&Ss(t,n,!0),t.child}function Aa(e){var t=e.stateNode;t.pendingContext?xs(e,t.pendingContext,t.pendingContext!==t.context):t.context&&xs(e,t.context,!1),xo(e,t.containerInfo)}function Fs(e,t,n,r,l){return ln(),ho(l),t.flags|=256,ue(e,t,n,r),t.child}var Oi={dehydrated:null,treeContext:null,retryLane:0};function Mi(e){return{baseLanes:e,cachePool:null,transitions:null}}function Va(e,t,n){var r=t.pendingProps,l=H.current,i=!1,o=(t.flags&128)!==0,u;if((u=o)||(u=e!==null&&e.memoizedState===null?!1:(l&2)!==0),u?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(l|=1),F(H,l&1),e===null)return _i(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,i?(r=t.mode,i=t.child,o={mode:"hidden",children:o},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=gl(o,r,0,null),e=_t(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Mi(n),t.memoizedState=Oi,e):Po(t,o));if(l=e.memoizedState,l!==null&&(u=l.dehydrated,u!==null))return xf(e,t,o,r,u,l,n);if(i){i=r.fallback,o=t.mode,l=e.child,u=l.sibling;var a={mode:"hidden",children:r.children};return!(o&1)&&t.child!==l?(r=t.child,r.childLanes=0,r.pendingProps=a,t.deletions=null):(r=pt(l,a),r.subtreeFlags=l.subtreeFlags&14680064),u!==null?i=pt(u,i):(i=_t(i,o,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,o=e.child.memoizedState,o=o===null?Mi(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=e.childLanes&~n,t.memoizedState=Oi,r}return i=e.child,e=i.sibling,r=pt(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Po(e,t){return t=gl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function wr(e,t,n,r){return r!==null&&ho(r),on(t,e.child,null,n),e=Po(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function xf(e,t,n,r,l,i,o){if(n)return t.flags&256?(t.flags&=-257,r=Xl(Error(w(422))),wr(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,l=t.mode,r=gl({mode:"visible",children:r.children},l,0,null),i=_t(i,l,o,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&on(t,e.child,null,o),t.child.memoizedState=Mi(o),t.memoizedState=Oi,i);if(!(t.mode&1))return wr(e,t,o,null);if(l.data==="$!"){if(r=l.nextSibling&&l.nextSibling.dataset,r)var u=r.dgst;return r=u,i=Error(w(419)),r=Xl(i,r,void 0),wr(e,t,o,r)}if(u=(o&e.childLanes)!==0,pe||u){if(r=ee,r!==null){switch(o&-o){case 4:l=2;break;case 16:l=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:l=32;break;case 536870912:l=268435456;break;default:l=0}l=l&(r.suspendedLanes|o)?0:l,l!==0&&l!==i.retryLane&&(i.retryLane=l,Ze(e,l),Ie(r,e,l,-1))}return Oo(),r=Xl(Error(w(421))),wr(e,t,o,r)}return l.data==="$?"?(t.flags|=128,t.child=e.child,t=Df.bind(null,e),l._reactRetry=t,null):(e=i.treeContext,ge=at(l.nextSibling),we=t,B=!0,Oe=null,e!==null&&(je[Ne++]=Qe,je[Ne++]=Ke,je[Ne++]=Tt,Qe=e.id,Ke=e.overflow,Tt=t),t=Po(t,r.children),t.flags|=4096,t)}function $s(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Pi(e.return,t,n)}function Gl(e,t,n,r,l){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:l}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=l)}function Ha(e,t,n){var r=t.pendingProps,l=r.revealOrder,i=r.tail;if(ue(e,t,r.children,n),r=H.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&$s(e,n,t);else if(e.tag===19)$s(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(F(H,r),!(t.mode&1))t.memoizedState=null;else switch(l){case"forwards":for(n=t.child,l=null;n!==null;)e=n.alternate,e!==null&&br(e)===null&&(l=n),n=n.sibling;n=l,n===null?(l=t.child,t.child=null):(l=n.sibling,n.sibling=null),Gl(t,!1,l,n,i);break;case"backwards":for(n=null,l=t.child,t.child=null;l!==null;){if(e=l.alternate,e!==null&&br(e)===null){t.child=l;break}e=l.sibling,l.sibling=n,n=l,l=e}Gl(t,!0,n,null,i);break;case"together":Gl(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Dr(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Je(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Lt|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(w(153));if(t.child!==null){for(e=t.child,n=pt(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=pt(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Sf(e,t,n){switch(t.tag){case 3:Aa(t),ln();break;case 5:ma(t);break;case 1:me(t.type)&&Yr(t);break;case 4:xo(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,l=t.memoizedProps.value;F(Zr,r._currentValue),r._currentValue=l;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(F(H,H.current&1),t.flags|=128,null):n&t.child.childLanes?Va(e,t,n):(F(H,H.current&1),e=Je(e,t,n),e!==null?e.sibling:null);F(H,H.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Ha(e,t,n);t.flags|=128}if(l=t.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),F(H,H.current),r)break;return null;case 22:case 23:return t.lanes=0,Ua(e,t,n)}return Je(e,t,n)}var Wa,Ii,Qa,Ka;Wa=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Ii=function(){};Qa=function(e,t,n,r){var l=e.memoizedProps;if(l!==r){e=t.stateNode,Ct(Ve.current);var i=null;switch(n){case"input":l=li(e,l),r=li(e,r),i=[];break;case"select":l=Q({},l,{value:void 0}),r=Q({},r,{value:void 0}),i=[];break;case"textarea":l=si(e,l),r=si(e,r),i=[];break;default:typeof l.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Qr)}ai(n,r);var o;n=null;for(c in l)if(!r.hasOwnProperty(c)&&l.hasOwnProperty(c)&&l[c]!=null)if(c==="style"){var u=l[c];for(o in u)u.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(In.hasOwnProperty(c)?i||(i=[]):(i=i||[]).push(c,null));for(c in r){var a=r[c];if(u=l!=null?l[c]:void 0,r.hasOwnProperty(c)&&a!==u&&(a!=null||u!=null))if(c==="style")if(u){for(o in u)!u.hasOwnProperty(o)||a&&a.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in a)a.hasOwnProperty(o)&&u[o]!==a[o]&&(n||(n={}),n[o]=a[o])}else n||(i||(i=[]),i.push(c,n)),n=a;else c==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,u=u?u.__html:void 0,a!=null&&u!==a&&(i=i||[]).push(c,a)):c==="children"?typeof a!="string"&&typeof a!="number"||(i=i||[]).push(c,""+a):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(In.hasOwnProperty(c)?(a!=null&&c==="onScroll"&&$("scroll",e),i||u===a||(i=[])):(i=i||[]).push(c,a))}n&&(i=i||[]).push("style",n);var c=i;(t.updateQueue=c)&&(t.flags|=4)}};Ka=function(e,t,n,r){n!==r&&(t.flags|=4)};function Sn(e,t){if(!B)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function ie(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags&14680064,r|=l.flags&14680064,l.return=e,l=l.sibling;else for(l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags,r|=l.flags,l.return=e,l=l.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function kf(e,t,n){var r=t.pendingProps;switch(po(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ie(t),null;case 1:return me(t.type)&&Kr(),ie(t),null;case 3:return r=t.stateNode,sn(),U(he),U(se),ko(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(yr(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Oe!==null&&(Wi(Oe),Oe=null))),Ii(e,t),ie(t),null;case 5:So(t);var l=Ct(Xn.current);if(n=t.type,e!==null&&t.stateNode!=null)Qa(e,t,n,r,l),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(w(166));return ie(t),null}if(e=Ct(Ve.current),yr(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Be]=t,r[Kn]=i,e=(t.mode&1)!==0,n){case"dialog":$("cancel",r),$("close",r);break;case"iframe":case"object":case"embed":$("load",r);break;case"video":case"audio":for(l=0;l<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[Be]=t,e[Kn]=r,Wa(e,t,!1,!1),t.stateNode=e;e:{switch(o=ci(n,r),n){case"dialog":$("cancel",e),$("close",e),l=r;break;case"iframe":case"object":case"embed":$("load",e),l=r;break;case"video":case"audio":for(l=0;lan&&(t.flags|=128,r=!0,Sn(i,!1),t.lanes=4194304)}else{if(!r)if(e=br(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Sn(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!B)return ie(t),null}else 2*X()-i.renderingStartTime>an&&n!==1073741824&&(t.flags|=128,r=!0,Sn(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(n=i.last,n!==null?n.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=X(),t.sibling=null,n=H.current,F(H,r?n&1|2:n&1),t):(ie(t),null);case 22:case 23:return Do(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ye&1073741824&&(ie(t),t.subtreeFlags&6&&(t.flags|=8192)):ie(t),null;case 24:return null;case 25:return null}throw Error(w(156,t.tag))}function jf(e,t){switch(po(t),t.tag){case 1:return me(t.type)&&Kr(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return sn(),U(he),U(se),ko(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return So(t),null;case 13:if(U(H),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(w(340));ln()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return U(H),null;case 4:return sn(),null;case 10:return yo(t.type._context),null;case 22:case 23:return Do(),null;case 24:return null;default:return null}}var xr=!1,oe=!1,Nf=typeof WeakSet=="function"?WeakSet:Set,N=null;function Yt(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){K(e,t,r)}else n.current=null}function Fi(e,t,n){try{n()}catch(r){K(e,t,r)}}var Us=!1;function Cf(e,t){if(xi=Vr,e=Ju(),co(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,u=-1,a=-1,c=0,p=0,v=e,m=null;t:for(;;){for(var g;v!==n||l!==0&&v.nodeType!==3||(u=o+l),v!==i||r!==0&&v.nodeType!==3||(a=o+r),v.nodeType===3&&(o+=v.nodeValue.length),(g=v.firstChild)!==null;)m=v,v=g;for(;;){if(v===e)break t;if(m===n&&++c===l&&(u=o),m===i&&++p===r&&(a=o),(g=v.nextSibling)!==null)break;v=m,m=v.parentNode}v=g}n=u===-1||a===-1?null:{start:u,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(Si={focusedElem:e,selectionRange:n},Vr=!1,N=t;N!==null;)if(t=N,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,N=e;else for(;N!==null;){t=N;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var k=x.memoizedProps,O=x.memoizedState,h=t.stateNode,d=h.getSnapshotBeforeUpdate(t.elementType===t.type?k:Re(t.type,k),O);h.__reactInternalSnapshotBeforeUpdate=d}break;case 3:var f=t.stateNode.containerInfo;f.nodeType===1?f.textContent="":f.nodeType===9&&f.documentElement&&f.removeChild(f.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(w(163))}}catch(y){K(t,t.return,y)}if(e=t.sibling,e!==null){e.return=t.return,N=e;break}N=t.return}return x=Us,Us=!1,x}function Dn(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var i=l.destroy;l.destroy=void 0,i!==void 0&&Fi(t,n,i)}l=l.next}while(l!==r)}}function vl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function $i(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Ya(e){var t=e.alternate;t!==null&&(e.alternate=null,Ya(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Be],delete t[Kn],delete t[Ni],delete t[sf],delete t[uf])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Xa(e){return e.tag===5||e.tag===3||e.tag===4}function Bs(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Xa(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ui(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Qr));else if(r!==4&&(e=e.child,e!==null))for(Ui(e,t,n),e=e.sibling;e!==null;)Ui(e,t,n),e=e.sibling}function Bi(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Bi(e,t,n),e=e.sibling;e!==null;)Bi(e,t,n),e=e.sibling}var te=null,De=!1;function be(e,t,n){for(n=n.child;n!==null;)Ga(e,t,n),n=n.sibling}function Ga(e,t,n){if(Ae&&typeof Ae.onCommitFiberUnmount=="function")try{Ae.onCommitFiberUnmount(ul,n)}catch{}switch(n.tag){case 5:oe||Yt(n,t);case 6:var r=te,l=De;te=null,be(e,t,n),te=r,De=l,te!==null&&(De?(e=te,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):te.removeChild(n.stateNode));break;case 18:te!==null&&(De?(e=te,n=n.stateNode,e.nodeType===8?Vl(e.parentNode,n):e.nodeType===1&&Vl(e,n),An(e)):Vl(te,n.stateNode));break;case 4:r=te,l=De,te=n.stateNode.containerInfo,De=!0,be(e,t,n),te=r,De=l;break;case 0:case 11:case 14:case 15:if(!oe&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var i=l,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&Fi(n,t,o),l=l.next}while(l!==r)}be(e,t,n);break;case 1:if(!oe&&(Yt(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(u){K(n,t,u)}be(e,t,n);break;case 21:be(e,t,n);break;case 22:n.mode&1?(oe=(r=oe)||n.memoizedState!==null,be(e,t,n),oe=r):be(e,t,n);break;default:be(e,t,n)}}function As(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Nf),t.forEach(function(r){var l=Of.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function Le(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=o),r&=~i}if(r=l,r=X()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*_f(r/1960))-r,10e?16:e,it===null)var r=!1;else{if(e=it,it=null,ll=0,D&6)throw Error(w(331));var l=D;for(D|=4,N=e.current;N!==null;){var i=N,o=i.child;if(N.flags&16){var u=i.deletions;if(u!==null){for(var a=0;aX()-Lo?Et(e,0):zo|=n),ve(e,t)}function rc(e,t){t===0&&(e.mode&1?(t=dr,dr<<=1,!(dr&130023424)&&(dr=4194304)):t=1);var n=ae();e=Ze(e,t),e!==null&&(er(e,t,n),ve(e,n))}function Df(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),rc(e,n)}function Of(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(w(314))}r!==null&&r.delete(t),rc(e,n)}var lc;lc=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||he.current)pe=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return pe=!1,Sf(e,t,n);pe=!!(e.flags&131072)}else pe=!1,B&&t.flags&1048576&&ua(t,Gr,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Dr(e,t),e=t.pendingProps;var l=rn(t,se.current);bt(t,n),l=No(null,t,r,e,l,n);var i=Co();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,me(r)?(i=!0,Yr(t)):i=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,wo(t),l.updater=ml,t.stateNode=l,l._reactInternals=t,zi(t,r,e,n),t=Di(null,t,r,!0,i,n)):(t.tag=0,B&&i&&fo(t),ue(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Dr(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=If(r),e=Re(r,e),l){case 0:t=Ri(null,t,r,e,n);break e;case 1:t=Is(null,t,r,e,n);break e;case 11:t=Os(null,t,r,e,n);break e;case 14:t=Ms(null,t,r,Re(r.type,e),n);break e}throw Error(w(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Re(r,l),Ri(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Re(r,l),Is(e,t,r,l,n);case 3:e:{if(Aa(t),e===null)throw Error(w(387));r=t.pendingProps,i=t.memoizedState,l=i.element,ha(e,t),qr(t,r,null,n);var o=t.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){l=un(Error(w(423)),t),t=Fs(e,t,r,n,l);break e}else if(r!==l){l=un(Error(w(424)),t),t=Fs(e,t,r,n,l);break e}else for(ge=at(t.stateNode.containerInfo.firstChild),we=t,B=!0,Oe=null,n=fa(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ln(),r===l){t=Je(e,t,n);break e}ue(e,t,r,n)}t=t.child}return t;case 5:return ma(t),e===null&&_i(t),r=t.type,l=t.pendingProps,i=e!==null?e.memoizedProps:null,o=l.children,ki(r,l)?o=null:i!==null&&ki(r,i)&&(t.flags|=32),Ba(e,t),ue(e,t,o,n),t.child;case 6:return e===null&&_i(t),null;case 13:return Va(e,t,n);case 4:return xo(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=on(t,null,r,n):ue(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Re(r,l),Os(e,t,r,l,n);case 7:return ue(e,t,t.pendingProps,n),t.child;case 8:return ue(e,t,t.pendingProps.children,n),t.child;case 12:return ue(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,i=t.memoizedProps,o=l.value,F(Zr,r._currentValue),r._currentValue=o,i!==null)if(Fe(i.value,o)){if(i.children===l.children&&!he.current){t=Je(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var u=i.dependencies;if(u!==null){o=i.child;for(var a=u.firstContext;a!==null;){if(a.context===r){if(i.tag===1){a=Ye(-1,n&-n),a.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var p=c.pending;p===null?a.next=a:(a.next=p.next,p.next=a),c.pending=a}}i.lanes|=n,a=i.alternate,a!==null&&(a.lanes|=n),Pi(i.return,n,t),u.lanes|=n;break}a=a.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(w(341));o.lanes|=n,u=o.alternate,u!==null&&(u.lanes|=n),Pi(o,n,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}ue(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,bt(t,n),l=_e(l),r=r(l),t.flags|=1,ue(e,t,r,n),t.child;case 14:return r=t.type,l=Re(r,t.pendingProps),l=Re(r.type,l),Ms(e,t,r,l,n);case 15:return $a(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Re(r,l),Dr(e,t),t.tag=1,me(r)?(e=!0,Yr(t)):e=!1,bt(t,n),Ma(t,r,l),zi(t,r,l,n),Di(null,t,r,!0,e,n);case 19:return Ha(e,t,n);case 22:return Ua(e,t,n)}throw Error(w(156,t.tag))};function ic(e,t){return Ru(e,t)}function Mf(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ce(e,t,n,r){return new Mf(e,t,n,r)}function Mo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function If(e){if(typeof e=="function")return Mo(e)?1:0;if(e!=null){if(e=e.$$typeof,e===bi)return 11;if(e===eo)return 14}return 2}function pt(e,t){var n=e.alternate;return n===null?(n=Ce(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Ir(e,t,n,r,l,i){var o=2;if(r=e,typeof e=="function")Mo(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case $t:return _t(n.children,l,i,t);case qi:o=8,l|=8;break;case ei:return e=Ce(12,n,t,l|2),e.elementType=ei,e.lanes=i,e;case ti:return e=Ce(13,n,t,l),e.elementType=ti,e.lanes=i,e;case ni:return e=Ce(19,n,t,l),e.elementType=ni,e.lanes=i,e;case mu:return gl(n,l,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case pu:o=10;break e;case hu:o=9;break e;case bi:o=11;break e;case eo:o=14;break e;case et:o=16,r=null;break e}throw Error(w(130,e==null?e:typeof e,""))}return t=Ce(o,n,t,l),t.elementType=e,t.type=r,t.lanes=i,t}function _t(e,t,n,r){return e=Ce(7,e,r,t),e.lanes=n,e}function gl(e,t,n,r){return e=Ce(22,e,r,t),e.elementType=mu,e.lanes=n,e.stateNode={isHidden:!1},e}function Zl(e,t,n){return e=Ce(6,e,null,t),e.lanes=n,e}function Jl(e,t,n){return t=Ce(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Ff(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ll(0),this.expirationTimes=Ll(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ll(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function Io(e,t,n,r,l,i,o,u,a){return e=new Ff(e,t,n,u,a),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Ce(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},wo(i),e}function $f(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(ac)}catch(e){console.error(e)}}ac(),au.exports=Se;var Hf=au.exports,cc,Gs=Hf;cc=Gs.createRoot,Gs.hydrateRoot;const dc=()=>{var e,t;return(t=(e=window==null?void 0:window.go)==null?void 0:e.main)==null?void 0:t.App},Wf=()=>!!dc();async function I(e,...t){const n=dc();if(!n||typeof n[e]!="function")throw new Error(`${e} is unavailable — run this inside the Behavision app`);return n[e](...t)}const A={session:()=>I("Session"),login:(e,t)=>I("Login",e,t),logout:()=>I("Logout"),claim:e=>I("Claim",e),runStandalone:()=>I("RunStandalone"),engineStatus:()=>I("EngineStatus"),startEngine:()=>I("StartEngine"),stopEngine:()=>I("StopEngine"),cameras:()=>I("Cameras"),testCamera:e=>I("TestCamera",e),saveCamera:(e,t)=>I("SaveCamera",e,t),deleteCamera:e=>I("DeleteCamera",e),startPlacement:(e,t)=>I("StartPlacementCheck",e,t),placementResult:e=>I("PlacementResult",e),streamURL:e=>I("StreamURL",e),live:()=>I("Live"),pipelineStatus:()=>I("PipelineStatus"),localIdentities:e=>I("LocalIdentities",e),localSightings:e=>I("LocalSightings",e),footfall:(e,t,n)=>I("Footfall",e,t,n),sites:()=>I("Sites"),visitorHistory:(e,t)=>I("VisitorHistory",e,t),visitorPhoto:e=>I("VisitorPhoto",e),forgetCustomer:e=>I("ForgetCustomer",e),sales:(e,t)=>I("Sales",e,t),customers:(e,t)=>I("Customers",e,t),saveProfile:e=>I("SaveProfile",e),recordPurchase:(e,t,n,r)=>I("RecordPurchase",e,t,n,r)};function Te(e){return e?typeof e=="string"?e:e.message||String(e):"Something went wrong."}function Dt(e,t,n=[]){const[r,l]=P.useState(null),[i,o]=P.useState(null),[u,a]=P.useState(!0),c=P.useRef(!0),p=P.useRef(!1),v=P.useCallback(async()=>{if(!p.current){p.current=!0;try{const m=await e();if(!c.current)return;l(m),o(null)}catch(m){c.current&&o(Te(m))}finally{p.current=!1,c.current&&a(!1)}}},n);return P.useEffect(()=>{if(c.current=!0,v(),!t)return()=>{c.current=!1};const m=setInterval(v,t);return()=>{c.current=!1,clearInterval(m)}},[v,t]),{data:r,error:i,loading:u,reload:v}}function Qf(e){if(!e)return"—";const t=typeof e=="number"?new Date(e*1e3):new Date(e);return isNaN(t)?"—":t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}function Zs(e){if(!e)return"—";const t=typeof e=="number"?new Date(e*1e3):new Date(e);return isNaN(t)?"—":t.toLocaleDateString([],{day:"numeric",month:"short"})}function Kf({onDone:e}){const[t,n]=P.useState(""),[r,l]=P.useState(""),[i,o]=P.useState(!1),[u,a]=P.useState(null);async function c(p){p.preventDefault(),o(!0),a(null);try{e(await A.login(t.trim(),r))}catch(v){a(Te(v))}finally{o(!1)}}return s.jsx("div",{className:"login",children:s.jsxs("div",{className:"box",children:[s.jsx("h1",{children:"Behavision"}),s.jsx("p",{className:"lead",children:"Sign in to connect this PC to your store."}),s.jsxs("form",{onSubmit:c,children:[u&&s.jsx("div",{className:"err",children:u}),s.jsxs("label",{className:"field",children:[s.jsx("span",{children:"Email"}),s.jsx("input",{type:"email",value:t,autoComplete:"username",required:!0,autoFocus:!0,onChange:p=>n(p.target.value)})]}),s.jsxs("label",{className:"field",children:[s.jsx("span",{children:"Password"}),s.jsx("input",{type:"password",value:r,autoComplete:"current-password",required:!0,onChange:p=>l(p.target.value)})]}),s.jsx("button",{className:"btn primary",disabled:i||!t||!r,children:i?"Signing in…":"Sign in"})]}),s.jsx("p",{className:"foot",children:"Signing in downloads this store's recognition models and connects it to your account. Nothing is sent until a camera is set up."})]})})}function Js({onDone:e,onCancel:t}){const[n,r]=P.useState(""),[l,i]=P.useState(null),[o,u]=P.useState(null),[a,c]=P.useState(!1);async function p(m){m.preventDefault(),i("claim"),u(null);try{e(await A.claim(n))}catch(g){u(Te(g))}finally{i(null)}}async function v(){i("alone"),u(null);try{e(await A.runStandalone())}catch(m){u(Te(m))}finally{i(null)}}return s.jsx("div",{className:"login",children:s.jsxs("div",{className:"box",children:[s.jsx("h1",{children:t?"Link to head office":"Set up this PC"}),s.jsx("p",{className:"lead",children:"Type the installation code for this shop. You only do this once."}),s.jsxs("form",{onSubmit:p,children:[o&&s.jsx("div",{className:"err",children:o}),s.jsxs("label",{className:"field",children:[s.jsx("span",{children:"Installation code"}),s.jsx("input",{value:n,autoFocus:!0,required:!0,placeholder:"ABCDEF-123456-GHIJKL-789012",autoComplete:"off",spellCheck:"false",style:{textTransform:"uppercase",letterSpacing:".06em"},onChange:m=>r(m.target.value)})]}),s.jsx("button",{className:"btn primary",disabled:!!l||n.trim().length<6,children:l==="claim"?"Linking…":"Link this PC"})]}),s.jsx("p",{className:"foot",children:"The code works once. Ask whoever manages your shops for it — they can create one from the Behavision platform, under the shop."}),s.jsx("div",{className:"alt",children:t?s.jsx("button",{type:"button",className:"linkbtn",onClick:t,children:"Not now — go back"}):a?s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"note",children:"This PC will watch its cameras and recognise returning customers on its own. Nothing is sent anywhere. You can link it to head office later without losing anything recorded here."}),s.jsx("button",{type:"button",className:"btn",disabled:!!l,onClick:v,children:l==="alone"?"Setting up…":"Use this PC on its own"})]}):s.jsx("button",{type:"button",className:"linkbtn",onClick:()=>c(!0),children:"No head office — set this PC up on its own"})})]})})}function fc(){var a,c;const{data:e,error:t}=Dt(()=>A.live(),3e3),{data:n}=Dt(()=>A.pipelineStatus(),5e3),r=Zf(),l=((a=e==null?void 0:e.stats)==null?void 0:a.cameras)??[],i=((c=e==null?void 0:e.stats)==null?void 0:c.gallery)??{},o=(e==null?void 0:e.events)??[],u=l.reduce((p,v)=>{var g,x;const m=(x=(g=v==null?void 0:v.pipeline)==null?void 0:g.best_quality)==null?void 0:x.fraction_below_gate;return typeof m=="number"&&m>p?m:p},0);return s.jsxs("div",{className:"page",children:[s.jsxs("header",{children:[s.jsx("h2",{children:"Live"}),s.jsx("p",{children:"Cameras, recent detections, and whether this site is recognising people."})]}),t&&s.jsx("div",{className:"err",children:t}),s.jsxs("div",{className:"grid cols-4",style:{marginBottom:16},children:[s.jsx(jr,{label:"People known",value:i.identities??"—"}),s.jsx(jr,{label:"Sightings",value:i.sightings??"—"}),s.jsx(jr,{label:"Cameras live",value:`${l.filter(p=>p.connected).length}/${l.length||0}`}),s.jsx(jr,{label:"Below quality gate",value:l.length?`${Math.round(u*100)}%`:"—",tone:u>.5?"bad":u>.2?"warn":"ok",sub:u>.5?"Most visitors are being missed — check camera placement":"Share of faces too poor to enrol"})]}),s.jsx(Yf,{pipe:n}),s.jsxs("div",{className:"grid cols-2",children:[s.jsx("div",{children:s.jsxs("div",{className:"card",children:[s.jsx("h3",{children:"Cameras"}),l.length===0?s.jsx("div",{className:"empty",children:"No cameras yet. Add one in Cameras."}):s.jsx("div",{className:"feeds",children:l.map(p=>s.jsxs("div",{className:"feed",children:[r[p.camera_id]?s.jsx("img",{src:r[p.camera_id],alt:p.camera_id}):s.jsx("div",{style:{aspectRatio:"16/9"}}),s.jsxs("div",{className:"cap",children:[s.jsx("span",{children:p.camera_id}),s.jsxs("span",{className:`pill ${p.connected?"ok":"bad"}`,children:[s.jsx("i",{className:`dot ${p.connected?"ok":"bad"}`}),p.connected?"live":"offline"]})]})]},p.camera_id))})]})}),s.jsxs("div",{className:"card",children:[s.jsx("h3",{children:"Recent detections"}),o.length===0?s.jsx("div",{className:"empty",children:"Nothing detected yet."}):s.jsx("ul",{className:"events",children:o.map((p,v)=>s.jsx(Xf,{e:p},v))})]})]})]})}function Yf({pipe:e}){if(!e)return null;if(e.standalone)return s.jsxs("div",{className:"card",style:{marginBottom:16,display:"flex",gap:10,alignItems:"center"},children:[s.jsx("i",{className:"dot ok"}),s.jsx("strong",{style:{fontSize:13},children:"Running on this PC only"}),s.jsx("span",{className:"note",children:"Recognition and customers stay here."})]});const t=e.claimed&&!e.broker_up;return s.jsxs("div",{className:"card",style:{marginBottom:16,display:"flex",gap:22,alignItems:"center",flexWrap:"wrap"},children:[s.jsxs("span",{style:{display:"flex",alignItems:"center",gap:8},children:[s.jsx("i",{className:`dot ${e.claimed?e.broker_up?"ok":"bad":"idle"}`}),s.jsx("strong",{style:{fontSize:13},children:e.claimed?e.broker_up?"Sending to head office":"Offline — saving locally":"Not linked to head office"})]}),s.jsxs("span",{className:"note",children:[e.accepted," recorded today"]}),e.queued>0&&s.jsxs("span",{className:"note",style:t?{color:"var(--warn)"}:void 0,children:[e.queued," waiting to send"]}),e.dropped>0&&s.jsxs("span",{className:"note",style:{color:"var(--bad)"},children:[e.dropped," lost — this PC was offline too long"]})]})}function Xf({e}){var l,i,o,u,a;const t=e.type==="person.new"?"new":e.type==="person.seen"?"seen":e.type==="person.missed"?"miss":"",n=((l=e.data)==null?void 0:l.age)??((i=e.data)==null?void 0:i.age_range),r=[(o=e.data)==null?void 0:o.gender,n,(u=e.data)==null?void 0:u.emotion].filter(Boolean).join(", ");return s.jsxs("li",{children:[s.jsx("span",{className:"when",children:Qf(e.ts)}),s.jsx("span",{className:`tag ${t}`,children:Gf(e.type)}),s.jsxs("span",{style:{flex:1,minWidth:0},children:[((a=e.data)==null?void 0:a.label)||e.camera_id,r&&s.jsxs("span",{className:"note",children:[" · ",r]})]})]})}function Gf(e){return{"person.new":"new","person.seen":"returning","person.missed":"missed","camera.up":"camera up","camera.down":"camera down","identity.merged":"merged"}[e]??e}function jr({label:e,value:t,sub:n,tone:r}){return s.jsxs("div",{className:"card stat",children:[s.jsx("h3",{children:e}),s.jsx("div",{className:"value",style:r?{color:`var(--${r})`}:void 0,children:t}),n&&s.jsx("div",{className:"sub",children:n})]})}function Zf(){const[e,t]=P.useState({}),{data:n}=Dt(()=>A.cameras(),1e4);return P.useEffect(()=>{let r=!1;return(async()=>{const l={};for(const o of n??[]){if(e[o.id]){l[o.id]=e[o.id];continue}try{l[o.id]=await A.streamURL(o.id)}catch{}}const i=Object.keys(l).length!==Object.keys(e).length||Object.keys(l).some(o=>l[o]!==e[o]);!r&&i&&t(l)})(),()=>{r=!0}},[n]),e}function Jf(e){const[t,n]=P.useState(null);return P.useEffect(()=>{let r=!0;return n(null),A.visitorPhoto(e).then(l=>{r&&n(l)}).catch(()=>{r&&n({available:!1,reason:""})}),()=>{r=!1}},[e]),t}function qf({photo:e,name:t,customerRef:n,onBroken:r}){return e!=null&&e.available?s.jsx("img",{className:"avatar",src:e.url,alt:`Photo of ${t}`,onError:r}):s.jsx("div",{className:"avatar none",role:"img","aria-label":`No photo of ${t}`,children:s.jsx("span",{children:bf(t,n)})})}function bf(e,t){const n=/^Visitor (\d+)$/.exec(String(e||"").trim());if(n)return n[1];const r=/^V-(\d+)$/.exec(String(t||""));return r?r[1]:String(e||"").split(/\s+/).filter(Boolean).slice(0,2).map(l=>l[0].toUpperCase()).join("")||"?"}function ep({customer:e}){const{data:t,error:n,loading:r}=Dt(()=>A.visitorHistory(e.id,50),0,[e.id]);if(r)return s.jsx("p",{className:"note",children:"Loading visits…"});if(n)return s.jsxs("p",{className:"note",children:["Could not load visits: ",n]});const l=t??[];return l.length===0?s.jsx("p",{className:"note",children:"No recorded visits yet."}):s.jsx("ul",{className:"timeline",children:l.map(i=>s.jsxs("li",{children:[s.jsx("span",{className:"when",children:tp(i.occurred_at)}),s.jsxs("span",{className:"where",children:[i.site||"this store",i.camera_id?s.jsxs("span",{className:"note",children:[" · ",i.camera_id]}):null]}),i.is_new_visitor&&s.jsx("span",{className:"tag new",children:"first visit"})]},i.id))})}function tp(e){const t=new Date(e);return isNaN(t)?"—":t.toLocaleString([],{day:"numeric",month:"short",hour:"2-digit",minute:"2-digit"})}function np({customer:e,onCancel:t,onDone:n}){const r=e.full_name||e.label,[l,i]=P.useState(""),[o,u]=P.useState(!1),[a,c]=P.useState(null),p=l.trim().toLowerCase()===r.trim().toLowerCase();async function v(){u(!0),c(null);try{await A.forgetCustomer(e.id),n()}catch(m){c(Te(m)),u(!1)}}return s.jsxs("div",{className:"confirm",children:[s.jsxs("h4",{children:["Erase ",r,"?"]}),s.jsxs("div",{className:"cols",children:[s.jsxs("div",{children:[s.jsx("p",{className:"lbl bad",children:"Deleted for good"}),s.jsxs("ul",{children:[s.jsx("li",{children:"Their face data — they will not be recognised again"}),s.jsx("li",{children:"Their photo"}),s.jsx("li",{children:"Their name, phone, email and notes"})]})]}),s.jsxs("div",{children:[s.jsx("p",{className:"lbl",children:"Kept"}),s.jsxs("ul",{children:[s.jsx("li",{children:"Past visits, with their name removed — your footfall figures do not change"}),s.jsx("li",{children:"The consent record, marked withdrawn, as proof of what was agreed"})]})]})]}),s.jsx("p",{className:"note",children:"This cannot be undone. If they come back they will be recorded as a new customer."}),a&&s.jsx("div",{className:"err",children:a}),s.jsxs("label",{className:"field",children:[s.jsxs("span",{children:["Type ",s.jsx("b",{children:r})," to confirm"]}),s.jsx("input",{value:l,onChange:m=>i(m.target.value),autoFocus:!0,autoComplete:"off",spellCheck:"false","aria-label":`Type ${r} to confirm erasure`})]}),s.jsxs("div",{className:"row",children:[s.jsx("button",{type:"button",className:"btn danger",disabled:!p||o,onClick:v,children:o?"Erasing…":"Erase permanently"}),s.jsx("button",{type:"button",className:"btn",onClick:t,disabled:o,children:"Cancel"})]})]})}function rp({customer:e,session:t,onClose:n,onSaved:r}){var _;const[l,i]=P.useState({full_name:e.full_name??"",phone:e.phone??"",email:e.email??"",gender:"",date_of_birth:"",notes:"",consent:e.has_consent??!1}),[o,u]=P.useState({amount:"",items:"",notes:""}),[a,c]=P.useState(!1),[p,v]=P.useState(null),[m,g]=P.useState(!1),[x,k]=P.useState(null),O=Jf(e.id),h=x??O,d=(_=t==null?void 0:t.user)==null?void 0:_.role,f=["admin","owner","manager"].includes(d),y=j=>E=>i({...l,[j]:E.target.value});async function S(j){j.preventDefault(),c(!0),v(null);try{await A.saveProfile({visitor_id:e.id,...l});const E=parseFloat(o.amount);if(!isNaN(E)&&E>0){const V=o.items.split(",").map(L=>L.trim()).filter(Boolean);await A.recordPurchase(e.id,E,V,o.notes)}r()}catch(E){v(Te(E))}finally{c(!1)}}return s.jsx("div",{className:"drawer",onMouseDown:j=>j.target===j.currentTarget&&n(),children:s.jsxs("div",{className:"panel",children:[s.jsxs("div",{className:"who",children:[s.jsx(qf,{photo:h,name:e.full_name||e.label,customerRef:e.ref,onBroken:()=>k({available:!1,reason:"The photo could not be loaded."})}),s.jsxs("div",{className:"grow",children:[s.jsx("h3",{children:e.full_name||e.label}),s.jsxs("p",{className:"note",children:[e.visit_count," visit",e.visit_count===1?"":"s",e.last_seen_at&&` · last seen ${new Date(e.last_seen_at).toLocaleDateString()}`]}),h&&!h.available&&h.reason&&s.jsx("p",{className:"note",children:h.reason})]}),s.jsx("button",{type:"button",className:"btn sm",onClick:n,children:"Close"})]}),s.jsxs("form",{onSubmit:S,children:[p&&s.jsx("div",{className:"err",children:p}),s.jsxs("div",{className:"card",style:{marginBottom:14},children:[s.jsx("h3",{children:"Customer details"}),s.jsxs("label",{className:"field",children:[s.jsx("span",{children:"Full name"}),s.jsx("input",{value:l.full_name,onChange:y("full_name"),autoFocus:!0})]}),s.jsxs("div",{className:"fieldrow",children:[s.jsxs("label",{className:"field",children:[s.jsx("span",{children:"Phone"}),s.jsx("input",{value:l.phone,onChange:y("phone"),inputMode:"tel"})]}),s.jsxs("label",{className:"field",children:[s.jsx("span",{children:"Email"}),s.jsx("input",{value:l.email,onChange:y("email"),type:"email"})]})]}),s.jsxs("div",{className:"fieldrow",children:[s.jsxs("label",{className:"field",children:[s.jsx("span",{children:"Gender"}),s.jsxs("select",{value:l.gender,onChange:y("gender"),children:[s.jsx("option",{value:"",children:"Not recorded"}),s.jsx("option",{children:"Female"}),s.jsx("option",{children:"Male"}),s.jsx("option",{children:"Other"})]})]}),s.jsxs("label",{className:"field",children:[s.jsx("span",{children:"Date of birth"}),s.jsx("input",{type:"date",value:l.date_of_birth,onChange:y("date_of_birth")})]})]}),s.jsxs("label",{className:"field",children:[s.jsx("span",{children:"Notes"}),s.jsx("textarea",{value:l.notes,onChange:y("notes"),placeholder:"Preferences, sizes, anything worth remembering"})]})]}),s.jsxs("div",{className:"card",style:{marginBottom:14},children:[s.jsx("h3",{children:"Purchase (optional)"}),s.jsxs("div",{className:"fieldrow",children:[s.jsxs("label",{className:"field",children:[s.jsx("span",{children:"Amount"}),s.jsx("input",{value:o.amount,inputMode:"decimal",placeholder:"0.00",onChange:j=>u({...o,amount:j.target.value})})]}),s.jsxs("label",{className:"field",children:[s.jsx("span",{children:"Items"}),s.jsx("input",{value:o.items,placeholder:"shirt, belt",onChange:j=>u({...o,items:j.target.value})})]})]}),s.jsx("p",{className:"note",children:"Leave the amount blank if they did not buy anything — a visit without a sale is still worth recording."})]}),s.jsxs("div",{className:"card",style:{marginBottom:16},children:[s.jsx("h3",{children:"Consent"}),s.jsxs("label",{style:{display:"flex",gap:10,alignItems:"flex-start",fontSize:13,cursor:"pointer"},children:[s.jsx("input",{type:"checkbox",checked:l.consent,style:{marginTop:3},onChange:j=>i({...l,consent:j.target.checked})}),s.jsx("span",{children:"This customer agreed to us keeping their details and recognising them on future visits."})]}),s.jsx("p",{className:"note",style:{marginTop:10},children:"Recorded with the date and who collected it. They can withdraw it at any time, which erases their face data."})]}),s.jsxs("div",{className:"card",style:{marginBottom:14},children:[s.jsx("h3",{children:"Visits"}),s.jsx(ep,{customer:e})]}),s.jsxs("div",{style:{display:"flex",gap:8},children:[s.jsx("button",{className:"btn primary",disabled:a,children:a?"Saving…":"Save"}),s.jsx("button",{type:"button",className:"btn",onClick:n,children:"Cancel"})]}),f&&s.jsxs("div",{className:"card danger-zone",children:[s.jsx("h3",{children:"At the customer's request"}),m?s.jsx(np,{customer:e,onCancel:()=>g(!1),onDone:r}):s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"note",children:"Erase this person's face data, photo and details. Their past visits stay in your footfall figures, without their name."}),s.jsx("button",{type:"button",className:"btn danger",onClick:()=>g(!0),children:"Erase this customer…"})]})]})]})]})})}function lp({session:e}){const[t,n]=P.useState(""),[r,l]=P.useState(null),{data:i,error:o,reload:u}=Dt(()=>A.customers(t,200),3e4,[t]),a=i??[],c=a.filter(p=>p.has_profile).length;return s.jsxs("div",{className:"page",children:[s.jsxs("header",{children:[s.jsx("h2",{children:"Customers"}),s.jsx("p",{children:"Everyone this business has recognised. Fill in details once and they are known at every store."})]}),o&&s.jsx("div",{className:"err",children:o}),s.jsxs("div",{className:"grid cols-4",style:{marginBottom:16},children:[s.jsx(Nr,{label:"Known people",value:a.length||"—"}),s.jsx(Nr,{label:"With details",value:c||"—",sub:a.length?`${Math.round(100*c/a.length)}% captured`:null}),s.jsx(Nr,{label:"Returning",value:a.filter(p=>p.visit_count>1).length||"—"}),s.jsx(Nr,{label:"With consent",value:a.filter(p=>p.has_consent).length||"—"})]}),s.jsxs("div",{className:"card",children:[s.jsxs("div",{style:{display:"flex",gap:10,marginBottom:12},children:[s.jsx("input",{className:"field",style:{flex:1,margin:0,background:"var(--ground)",border:"1px solid var(--line)",borderRadius:6,padding:"8px 10px"},placeholder:"Search by name or phone",value:t,onChange:p=>n(p.target.value)}),s.jsx("button",{className:"btn",onClick:u,children:"Refresh"})]}),a.length===0?s.jsx("div",{className:"empty",children:"No customers yet. They appear here the first time a camera sees them."}):s.jsx("div",{className:"tablewrap",children:s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Customer"}),s.jsx("th",{children:"Phone"}),s.jsx("th",{className:"num",children:"Visits"}),s.jsx("th",{children:"First seen"}),s.jsx("th",{children:"Last seen"}),s.jsx("th",{children:"Details"})]})}),s.jsx("tbody",{children:a.map(p=>s.jsxs("tr",{className:"click",onClick:()=>l(p),children:[s.jsxs("td",{children:[p.full_name||s.jsx("span",{className:"note",children:p.label}),p.full_name&&p.ref&&s.jsxs("span",{className:"note",children:[" · ",p.ref]})]}),s.jsx("td",{className:"mono",children:p.phone||"—"}),s.jsx("td",{className:"num",children:p.visit_count}),s.jsx("td",{children:Zs(p.first_seen_at)}),s.jsx("td",{children:Zs(p.last_seen_at)}),s.jsx("td",{children:p.has_profile?s.jsxs("span",{className:"pill ok",children:[s.jsx("i",{className:"dot ok"}),"captured"]}):s.jsxs("span",{className:"pill warn",children:[s.jsx("i",{className:"dot warn"}),"needed"]})})]},p.id))})]})})]}),r&&s.jsx(rp,{customer:r,session:e,onClose:()=>l(null),onSaved:()=>{l(null),u()}})]})}function Nr({label:e,value:t,sub:n}){return s.jsxs("div",{className:"card stat",children:[s.jsx("h3",{children:e}),s.jsx("div",{className:"value",children:t}),n&&s.jsx("div",{className:"sub",children:n})]})}const tn=[{id:"hikvision",label:"Hikvision",path:"/Streaming/Channels/101",note:"Channel 1, main stream. Use /Streaming/Channels/102 for the lower-quality sub stream."},{id:"dahua",label:"Dahua",path:"/cam/realmonitor?channel=1&subtype=0",note:"Channel 1, main stream. subtype=1 is the sub stream."},{id:"cpplus",label:"CP Plus",path:"/cam/realmonitor?channel=1&subtype=0",note:"CP Plus cameras use the Dahua stream path."},{id:"uniview",label:"Uniview",path:"/media/video1",note:"Some older Uniview models use /video1 instead."},{id:"tplink",label:"TP-Link / Tapo",path:"/stream1",note:"Tapo cameras need a separate camera account created in the Tapo app — your Tapo login will not work."},{id:"reolink",label:"Reolink",path:"/h264Preview_01_main",note:"Use /h264Preview_01_sub for the lower-quality stream."},{id:"amcrest",label:"Amcrest",path:"/cam/realmonitor?channel=1&subtype=0",note:"Amcrest cameras use the Dahua stream path."},{id:"axis",label:"Axis",path:"/axis-media/media.amp",note:""},{id:"onvif",label:"Other (ONVIF)",path:"/onvif1",note:"Many generic cameras answer here. If it does not work, look for “RTSP” in the camera’s own app."},{id:"manual",label:"I know the path",path:"",note:""}],ql=e=>tn.find(t=>t.id===e)||tn[tn.length-1],pc={id:"",host:"",port:554,path:"",username:"",password:"",max_width:1280};function ip(){const{data:e,error:t,reload:n}=Dt(()=>A.cameras(),8e3),[r,l]=P.useState(null),[i,o]=P.useState(null),u=e??[];async function a(c){if(confirm(`Remove camera "${c}"? Recognition from it stops immediately.`))try{await A.deleteCamera(c),n()}catch(p){alert(Te(p))}}return s.jsxs("div",{className:"page",children:[s.jsxs("header",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-end"},children:[s.jsxs("div",{children:[s.jsx("h2",{children:"Cameras"}),s.jsx("p",{children:"Add a camera, check it can see faces properly, then it starts working."})]}),s.jsx("button",{className:"btn primary",onClick:()=>l({...pc}),children:"Add camera"})]}),t&&s.jsx("div",{className:"err",children:t}),s.jsx("div",{className:"card",children:u.length===0?s.jsx("div",{className:"empty",children:"No cameras yet."}):s.jsx("div",{className:"tablewrap",children:s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Name"}),s.jsx("th",{children:"Address"}),s.jsx("th",{children:"Status"}),s.jsx("th",{})]})}),s.jsx("tbody",{children:u.map(c=>s.jsxs("tr",{children:[s.jsx("td",{children:c.id}),s.jsx("td",{className:"mono",children:c.url}),s.jsx("td",{children:c.connected===void 0?s.jsxs("span",{className:"pill",children:[s.jsx("i",{className:"dot idle"}),"stopped"]}):c.connected?s.jsxs("span",{className:"pill ok",children:[s.jsx("i",{className:"dot ok"}),"live"]}):s.jsxs("span",{className:"pill bad",children:[s.jsx("i",{className:"dot bad"}),"offline"]})}),s.jsxs("td",{style:{textAlign:"right",whiteSpace:"nowrap"},children:[s.jsx("button",{className:"btn sm",onClick:()=>o(c.id),children:"Check placement"})," ",s.jsx("button",{className:"btn sm",onClick:()=>l(c),children:"Edit"})," ",s.jsx("button",{className:"btn sm danger",onClick:()=>a(c.id),children:"Remove"})]})]},c.id))})]})})}),r&&s.jsx(op,{cam:r,onClose:()=>l(null),onSaved:()=>{l(null),n()}}),i&&s.jsx(sp,{id:i,onClose:()=>o(null)})]})}function op({cam:e,onClose:t,onSaved:n}){const r=!e.id,[l,i]=P.useState({...pc,...e,password:"",path:e.path||(r?tn[0].path:"")}),[o,u]=P.useState(r?tn[0].id:"manual"),[a,c]=P.useState(null),[p,v]=P.useState(null),[m,g]=P.useState(null),x=f=>y=>i({...l,[f]:y.target.value});function k(f){const y=ql(f.target.value);u(y.id),i(S=>({...S,path:y.path||S.path}))}function O(){const f={};for(const[y,S]of Object.entries(l))S===""||S===null||S===void 0||(f[y]=y==="port"||y==="max_width"?Number(S):S);return f}async function h(){v("test"),g(null),c(null);try{c(await A.testCamera(O()))}catch(f){g(Te(f))}finally{v(null)}}async function d(f){f.preventDefault(),v("save"),g(null);try{await A.saveCamera(r?"":e.id,O()),n()}catch(y){g(Te(y))}finally{v(null)}}return s.jsx("div",{className:"drawer",onMouseDown:f=>f.target===f.currentTarget&&t(),children:s.jsxs("div",{className:"panel",children:[s.jsx("button",{className:"btn sm close",onClick:t,children:"Close"}),s.jsx("h3",{children:r?"Add camera":e.id}),s.jsx("p",{className:"note",style:{marginBottom:18},children:"Test the connection before saving — a wrong address is the most common mistake."}),s.jsxs("form",{onSubmit:d,children:[m&&s.jsx("div",{className:"err",children:m}),s.jsxs("label",{className:"field",children:[s.jsx("span",{children:"Name"}),s.jsx("input",{value:l.id,onChange:x("id"),disabled:!r,placeholder:"entrance",required:!0,autoComplete:"off"})]}),s.jsxs("label",{className:"field",children:[s.jsx("span",{children:"Make of camera"}),s.jsx("select",{value:o,onChange:k,children:tn.map(f=>s.jsx("option",{value:f.id,children:f.label},f.id))})]}),ql(o).note&&s.jsx("p",{className:"note",style:{marginTop:-8,marginBottom:12},children:ql(o).note}),s.jsxs("div",{className:"fieldrow",children:[s.jsxs("label",{className:"field",children:[s.jsx("span",{children:"Camera address"}),s.jsx("input",{value:l.host,onChange:x("host"),placeholder:"192.168.0.138",autoComplete:"off"})]}),s.jsxs("label",{className:"field",children:[s.jsx("span",{children:"Port"}),s.jsx("input",{value:l.port,onChange:x("port"),inputMode:"numeric",autoComplete:"off"})]})]}),s.jsxs("label",{className:"field",children:[s.jsx("span",{children:"Stream path"}),s.jsx("input",{value:l.path,onChange:x("path"),placeholder:"/ch0_0.264",autoComplete:"off"})]}),s.jsxs("div",{className:"fieldrow",children:[s.jsxs("label",{className:"field",children:[s.jsx("span",{children:"Username"}),s.jsx("input",{value:l.username,onChange:x("username"),name:"camera-account",autoComplete:"off"})]}),s.jsxs("label",{className:"field",children:[s.jsx("span",{children:"Password"}),s.jsx("input",{type:"password",value:l.password,onChange:x("password"),name:"camera-secret",autoComplete:"new-password",placeholder:e.has_password?"(unchanged)":""})]})]}),s.jsxs("div",{style:{display:"flex",gap:8,marginTop:4},children:[s.jsx("button",{type:"button",className:"btn",onClick:h,disabled:!!p,children:p==="test"?"Connecting…":"Test connection"}),s.jsx("button",{className:"btn primary",disabled:!!p||!l.id,children:p==="save"?"Saving…":"Save"})]}),a&&s.jsx("div",{style:{marginTop:14},children:a.ok?s.jsxs(s.Fragment,{children:[s.jsxs("p",{style:{color:"var(--ok)",fontSize:13},children:["Connected — ",a.width,"×",a.height]}),a.snapshot&&s.jsx("img",{alt:"Camera preview",style:{width:"100%",marginTop:8,borderRadius:6,border:"1px solid var(--line)"},src:`data:image/jpeg;base64,${a.snapshot}`})]}):s.jsx("div",{className:"err",children:a.error})})]})]})})}function sp({id:e,onClose:t}){var c,p;const[n,r]=P.useState({verdict:"starting",advice:[]}),[l,i]=P.useState(null),o=P.useRef(null);P.useEffect(()=>{let v=!0;return(async()=>{try{r(await A.startPlacement(e,25)),o.current=setInterval(async()=>{try{const m=await A.placementResult(e);if(!v)return;r(m),m.running||clearInterval(o.current)}catch(m){v&&i(Te(m))}},1e3)}catch(m){v&&i(Te(m))}})(),()=>{v=!1,clearInterval(o.current)}},[e]);const u={good:"ok",marginal:"warn",poor:"bad",artifact:"bad",no_faces:"warn",inconclusive:"warn"}[n.verdict],a=n.seconds?Math.min(100,n.elapsed/n.seconds*100):0;return s.jsx("div",{className:"drawer",onMouseDown:v=>v.target===v.currentTarget&&t(),children:s.jsxs("div",{className:"panel",children:[s.jsx("button",{className:"btn sm close",onClick:t,children:"Close"}),s.jsxs("h3",{children:["Placement check — ",e]}),s.jsx("p",{className:"note",style:{marginBottom:18},children:"Walk past the camera the way a customer would, a few times."}),l&&s.jsx("div",{className:"err",children:l}),s.jsxs("div",{className:"card",children:[s.jsx("div",{style:{fontSize:15,fontWeight:600,color:u?`var(--${u})`:"var(--ink)"},children:n.headline||"Starting…"}),n.running&&s.jsx("div",{style:{height:5,background:"var(--surface-2)",borderRadius:3,overflow:"hidden",margin:"12px 0"},children:s.jsx("div",{style:{height:"100%",width:`${a}%`,background:"var(--accent)",transition:"width .4s linear"}})}),((c=n.advice)==null?void 0:c.length)>0&&s.jsx("ul",{style:{margin:"12px 0 0 18px",fontSize:13,color:"var(--ink-2)"},children:n.advice.map((v,m)=>s.jsx("li",{style:{marginBottom:5},children:v},m))}),((p=n.quality)==null?void 0:p.n)>0&&s.jsxs("p",{className:"note",style:{marginTop:12},children:[n.quality.n," face",n.quality.n===1?"":"s"," seen · median quality ",n.quality.p50," · gate ",n.gate," ·"," ",Math.round((n.quality.fraction_below_gate??0)*100),"% below it"]})]})]})})}const up=[{id:"live",label:"Live",glyph:"◉",View:fc},{id:"customers",label:"Customers",glyph:"☺",View:lp,cloud:!0},{id:"cameras",label:"Cameras",glyph:"▢",View:ip}];function ap(){var p,v,m;const[e,t]=P.useState(null),[n,r]=P.useState("live"),[l,i]=P.useState(!0),[o,u]=P.useState(!1);if(P.useEffect(()=>{(async()=>{try{t(await A.session())}catch{t(null)}i(!1)})()},[]),!Wf())return s.jsx("div",{className:"login",children:s.jsxs("div",{className:"box",children:[s.jsx("h1",{children:"Behavision"}),s.jsx("p",{className:"lead",children:"This is the Behavision window running outside the app, so it has no connection to the recognition engine. Launch the Behavision application instead."})]})});if(l)return s.jsx("div",{className:"login",children:s.jsx("p",{className:"note",children:"Starting…"})});if(!(e!=null&&e.claimed)&&!(e!=null&&e.standalone))return s.jsx(Js,{onDone:t});if(!(e!=null&&e.standalone)&&!(e!=null&&e.logged_in))return s.jsx(Kf,{onDone:t});const a=up.filter(g=>!g.cloud||!e.standalone),c=((p=a.find(g=>g.id===n))==null?void 0:p.View)??fc;return o?s.jsx(Js,{onDone:g=>{u(!1),t(g)},onCancel:()=>u(!1)}):s.jsxs("div",{className:"shell",children:[s.jsxs("aside",{className:"side",children:[s.jsxs("div",{className:"brand",children:[s.jsx("h1",{children:"Behavision"}),s.jsx("p",{children:e.site_name||((v=e.user)==null?void 0:v.client_name)||"Store"})]}),s.jsx("nav",{className:"nav",children:a.map(g=>s.jsxs("button",{onClick:()=>r(g.id),"aria-current":g.id===n?"page":void 0,children:[s.jsx("span",{className:"glyph",children:g.glyph}),g.label]},g.id))}),s.jsx(cp,{}),s.jsx("div",{style:{padding:"10px 12px 14px",borderTop:"1px solid var(--line-soft)"},children:e.standalone?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"note",style:{marginBottom:8},children:"Running on its own"}),s.jsx("button",{className:"btn sm",style:{width:"100%"},onClick:()=>u(!0),children:"Link to head office"})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"note",style:{marginBottom:8},children:(m=e.user)==null?void 0:m.email}),s.jsx("button",{className:"btn sm",style:{width:"100%"},onClick:async()=>t(await A.logout()),children:"Sign out"})]})})]}),s.jsx("main",{className:"main",children:s.jsx(c,{session:e})})]})}function cp(){const{data:e,reload:t}=Dt(()=>A.engineStatus(),5e3),[n,r]=P.useState(!1),l=e??{state:"stopped"},i=P.useCallback(async v=>{r(!0);try{await v()}catch(m){alert(Te(m))}finally{r(!1),t()}},[t]),o=l.state==="running",u=Object.values(l.cameras??{}),a=u.filter(Boolean).length;let c="idle",p="Stopped";return l.state==="failed"||l.state==="backoff"?(c="bad",p="Not running"):o&&!l.reachable?(c="warn",p="Starting…"):o&&u.length===0?(c="warn",p="No cameras"):o&&a===0?(c="bad",p="No camera connected"):o&&ai(A.startEngine),children:"Start"}),s.jsx("button",{className:"btn sm",disabled:n||!o,onClick:()=>i(A.stopEngine),children:"Stop"})]})]})}cc(document.getElementById("root")).render(s.jsx(Lc.StrictMode,{children:s.jsx(ap,{})})); diff --git a/desktop/frontend/dist/index.html b/desktop/frontend/dist/index.html index c867ba2..090a716 100644 --- a/desktop/frontend/dist/index.html +++ b/desktop/frontend/dist/index.html @@ -4,7 +4,7 @@ Behavision - + diff --git a/desktop/frontend/src/views/CustomerForm.jsx b/desktop/frontend/src/views/CustomerForm.jsx index 4ae1fc3..844255f 100644 --- a/desktop/frontend/src/views/CustomerForm.jsx +++ b/desktop/frontend/src/views/CustomerForm.jsx @@ -57,6 +57,7 @@ export default function CustomerForm({ customer, session, onClose, onSaved }) {
setPhoto({ available: false, reason: 'The photo could not be loaded.' })} />
diff --git a/desktop/frontend/src/views/CustomerPhoto.jsx b/desktop/frontend/src/views/CustomerPhoto.jsx index dbacc4f..caa142f 100644 --- a/desktop/frontend/src/views/CustomerPhoto.jsx +++ b/desktop/frontend/src/views/CustomerPhoto.jsx @@ -30,16 +30,31 @@ export function useCustomerPhoto(id) { // No photo is the normal case — images are off by default — so this renders // initials, not an error. -export default function CustomerPhoto({ photo, name, onBroken }) { +export default function CustomerPhoto({ photo, name, customerRef, onBroken }) { if (photo?.available) { return {`Photo } - const initials = String(name || '').split(/\s+/).filter(Boolean).slice(0, 2) - .map(w => w[0].toUpperCase()).join('') || '?' return (
- {initials} + {avatarText(name, customerRef)}
) } + +// Initials of a name a human typed; the NUMBER for a customer the system named +// itself. Taking the first letter of each word of "Visitor 13" gives "V1" — +// which is also what "Visitor 10" and "Visitor 15" give, so three different +// people wear the same badge, and it reads as the V-1 reference for a fourth. +// Same fix as the web app's arrivals feed; the two must not disagree. +// +// customerRef, not `ref`: React reserves that prop name and it would never +// reach this component. +function avatarText(name, customerRef) { + const auto = /^Visitor (\d+)$/.exec(String(name || '').trim()) + if (auto) return auto[1] + const n = /^V-(\d+)$/.exec(String(customerRef || '')) + if (n) return n[1] + return String(name || '').split(/\s+/).filter(Boolean).slice(0, 2) + .map(w => w[0].toUpperCase()).join('') || '?' +}