From 3d3775c8bed7e86bb1f4ff70d6502a2e5ac0b042 Mon Sep 17 00:00:00 2001 From: Suriyakumarvijayanayagam Date: Tue, 15 Sep 2026 11:06:57 +0530 Subject: [PATCH] The shop app looks like a product now, not a prototype MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The window a shop assistant stares at all day was the weakest surface in this system, and it looked improvised because it was: navigation drawn with text characters (◉ ☺ ▢) that sit on the text baseline and cannot take a stroke weight, margins set inline per screen, and four large stat boxes dominating the page while the product's entire reason for existing - WHO JUST WALKED IN - was a list of "person.seen" rows in the corner. Rebuilt around the person in front of it: a counter, a cheap monitor, somebody mid-conversation with a customer. - ui/icons.jsx: one drawn icon set, 24-unit grid, 1.6 stroke, currentColor, so one icon works on every surface and in every state. - styles.css: a real system. Four-step ground→raised palette biased blue-green (this product lives in the world of lenses), one spacing scale, one type scale, tabular figures wherever digits are compared or refreshed in place, and the scrollbars restyled - the default light scrollbar on a dark panel is the loudest "web page in a frame" tell there is. - Live: a status strip that answers "is this working" in one line, cameras as pictures with the caption over the image, and arrivals as cards big enough to match against the person standing there. The four stat boxes became a slim strip at the foot, where numbers that nobody acts on belong. - State is carried by shape AND colour everywhere - a pill, a dot and an edge stripe - because this gets read from two metres away and some operators do not see red and green apart. - Motion only where it means something: a live camera pulses, a fresh arrival slides in once. Nothing loops for decoration; this process shares a CPU with recognition. Two things fixed because the screen showed them, not because a test did: - The sidebar read "Stopped" beside a live camera feed and a counter ticking up, whenever the engine was running but not started BY the app. That is the two-surfaces-disagreeing bug the tray exists to avoid. It now reads "Running outside the app" in amber, and Start is disabled rather than offering to launch a second engine onto one SQLite WAL. - The arrivals panel shrank to fit its content and left a hole beside a tall camera tile - so the layout looked broken exactly when the shop was quiet, which is most of the time. Both panels stretch and scroll their own content now. Every existing class name still resolves, so the screens not rewritten here pick the system up unchanged. Windows and darwin build; tests pass. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01KGcjxF1cNLcuwc3DAPcnfj --- .../frontend/dist/assets/index-B3NH0cQK.js | 40 -- .../frontend/dist/assets/index-CGxw2EVn.css | 1 + .../frontend/dist/assets/index-DmoSrGcS.js | 40 ++ .../frontend/dist/assets/index-XjqO50wd.css | 1 - desktop/frontend/dist/index.html | 4 +- desktop/frontend/src/App.jsx | 69 +- desktop/frontend/src/styles.css | 639 ++++++++++++------ desktop/frontend/src/ui/icons.jsx | 71 ++ desktop/frontend/src/views/Live.jsx | 260 ++++--- desktop/frontend/src/views/Login.jsx | 4 +- desktop/frontend/src/views/Setup.jsx | 4 +- 11 files changed, 751 insertions(+), 382 deletions(-) delete mode 100644 desktop/frontend/dist/assets/index-B3NH0cQK.js create mode 100644 desktop/frontend/dist/assets/index-CGxw2EVn.css create mode 100644 desktop/frontend/dist/assets/index-DmoSrGcS.js delete mode 100644 desktop/frontend/dist/assets/index-XjqO50wd.css create mode 100644 desktop/frontend/src/ui/icons.jsx diff --git a/desktop/frontend/dist/assets/index-B3NH0cQK.js b/desktop/frontend/dist/assets/index-B3NH0cQK.js deleted file mode 100644 index 3d599de..0000000 --- a/desktop/frontend/dist/assets/index-B3NH0cQK.js +++ /dev/null @@ -1,40 +0,0 @@ -(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const i of l)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(l){const i={};return l.integrity&&(i.integrity=l.integrity),l.referrerPolicy&&(i.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?i.credentials="include":l.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(l){if(l.ep)return;l.ep=!0;const i=n(l);fetch(l.href,i)}})();function mc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var qs={exports:{}},sl={},bs={exports:{}},R={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var bn=Symbol.for("react.element"),vc=Symbol.for("react.portal"),yc=Symbol.for("react.fragment"),gc=Symbol.for("react.strict_mode"),wc=Symbol.for("react.profiler"),xc=Symbol.for("react.provider"),Sc=Symbol.for("react.context"),kc=Symbol.for("react.forward_ref"),jc=Symbol.for("react.suspense"),Nc=Symbol.for("react.memo"),Cc=Symbol.for("react.lazy"),Ao=Symbol.iterator;function Ec(e){return e===null||typeof e!="object"?null:(e=Ao&&e[Ao]||e["@@iterator"],typeof e=="function"?e:null)}var eu={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},tu=Object.assign,nu={};function cn(e,t,n){this.props=e,this.context=t,this.refs=nu,this.updater=n||eu}cn.prototype.isReactComponent={};cn.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};cn.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function ru(){}ru.prototype=cn.prototype;function Qi(e,t,n){this.props=e,this.context=t,this.refs=nu,this.updater=n||eu}var Ki=Qi.prototype=new ru;Ki.constructor=Qi;tu(Ki,cn.prototype);Ki.isPureReactComponent=!0;var Vo=Array.isArray,lu=Object.prototype.hasOwnProperty,Yi={current:null},iu={key:!0,ref:!0,__self:!0,__source:!0};function ou(e,t,n){var r,l={},i=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)lu.call(t,r)&&!iu.hasOwnProperty(r)&&(l[r]=t[r]);var u=arguments.length-2;if(u===1)l.children=n;else if(1>>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 - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Uc=P,xe=$c;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||!(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 $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":$("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/assets/index-CGxw2EVn.css b/desktop/frontend/dist/assets/index-CGxw2EVn.css new file mode 100644 index 0000000..0cb137a --- /dev/null +++ b/desktop/frontend/dist/assets/index-CGxw2EVn.css @@ -0,0 +1 @@ +:root{--bg: #0A0F13;--s1: #111A20;--s2: #17232B;--s3: #1E2D37;--line: #223038;--line-2: #1A252C;--ink: #ECF3F7;--ink-2: #A3B6C2;--ink-3: #6C808D;--accent: #40C4DC;--accent-2: #0F3B47;--accent-3: #0B2A33;--ok: #48C78E;--ok-2: #102E22;--warn: #EAAA3D;--warn-2: #31260F;--bad: #EC6A5C;--bad-2: #331815;--r-sm: 6px;--r: 10px;--r-lg: 14px;--sp-1: 4px;--sp-2: 8px;--sp-3: 12px;--sp-4: 16px;--sp-5: 20px;--sp-6: 24px;--sp-7: 32px;--sp-8: 40px;--shadow: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px -12px rgb(0 0 0 / .6);--shadow-lg: 0 2px 4px rgb(0 0 0 / .4), 0 24px 48px -16px rgb(0 0 0 / .7);--font: "Segoe UI Variable Text", "Segoe UI", Inter, -apple-system, BlinkMacSystemFont, system-ui, "Helvetica Neue", Arial, sans-serif;--font-display: "Segoe UI Variable Display", var(--font);--mono: "Cascadia Mono", "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;--ground: var(--bg);--surface: var(--s1);--surface-2: var(--s2);--line-soft: var(--line-2);--muted: var(--ink-3);--radius: var(--r);--accent-dim: var(--accent-3)}*{box-sizing:border-box;margin:0}html,body,#root{height:100%}body{background:var(--bg);color:var(--ink);font-family:var(--font);font-size:14px;line-height:1.5;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;overflow:hidden;-webkit-user-select:none;user-select:none}button,input,select,textarea{font:inherit;color:inherit}input,textarea{-webkit-user-select:text;user-select:text}:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:3px}::selection{background:var(--accent-2);color:var(--ink)}.num,.value,.metric-v,.when,.mono,.code,td{font-variant-numeric:tabular-nums}.mono,.code{font-family:var(--mono)}*{scrollbar-width:thin;scrollbar-color:var(--s3) transparent}*::-webkit-scrollbar{width:10px;height:10px}*::-webkit-scrollbar-track{background:transparent}*::-webkit-scrollbar-thumb{background:var(--s3);border-radius:99px;border:3px solid var(--bg)}*::-webkit-scrollbar-thumb:hover{background:#2a3d49}.shell{display:grid;grid-template-columns:232px 1fr;height:100%}.side{background:var(--s1);border-right:1px solid var(--line);display:flex;flex-direction:column;min-height:0}.side .brand{display:flex;align-items:center;gap:var(--sp-3);padding:var(--sp-5) var(--sp-5) var(--sp-4)}.side .brand .mark{width:30px;height:30px;border-radius:9px;flex:none;display:grid;place-items:center;background:linear-gradient(160deg,var(--accent-2),var(--s2));border:1px solid #1B4C5A;color:var(--accent)}.side .brand .id{min-width:0}.side .brand h1{font-family:var(--font-display);font-size:15px;font-weight:600;letter-spacing:-.012em;line-height:1.2}.side .brand p{font-size:11.5px;color:var(--ink-3);margin-top:1px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.nav{padding:var(--sp-2) var(--sp-3);display:flex;flex-direction:column;gap:2px;flex:1}.nav button{position:relative;display:flex;align-items:center;gap:var(--sp-3);width:100%;background:none;border:0;border-radius:var(--r-sm);padding:9px var(--sp-3);color:var(--ink-2);cursor:pointer;text-align:left;font-size:13.5px;font-weight:450;transition:background .12s ease,color .12s ease}.nav button svg{flex:none;opacity:.9}.nav button:hover{background:var(--s2);color:var(--ink)}.nav button[aria-current=page]{background:var(--accent-3);color:var(--accent);font-weight:550}.nav button[aria-current=page]:before{content:"";position:absolute;left:-12px;top:7px;bottom:7px;width:2.5px;border-radius:0 2px 2px 0;background:var(--accent)}.enginebox{margin:var(--sp-3);padding:var(--sp-3) var(--sp-4) var(--sp-4);border:1px solid var(--line);border-radius:var(--r);background:var(--s2)}.enginebox .row{display:flex;align-items:center;gap:var(--sp-2)}.enginebox .state{font-size:12.5px;font-weight:600;letter-spacing:-.005em}.enginebox .label{display:block;color:var(--ink-3);font-size:11px;line-height:1.45;margin-top:3px;font-variant-numeric:tabular-nums}.enginebox .actions,.enginebox .controls{display:flex;gap:var(--sp-2);margin-top:var(--sp-3)}.enginebox .actions .btn,.enginebox .controls .btn{flex:1;justify-content:center;padding:6px 8px;font-size:12px}.side .who{padding:var(--sp-3) var(--sp-5) var(--sp-5);border-top:1px solid var(--line-2);display:flex;align-items:center;gap:var(--sp-3)}.side .who .id{min-width:0;flex:1}.side .who .id b{display:block;font-size:12.5px;font-weight:550}.side .who .id span{display:block;font-size:11px;color:var(--ink-3);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.main{min-width:0;min-height:0;overflow:auto}.page{padding:var(--sp-6) var(--sp-7) var(--sp-8);max-width:1500px}.page>header{margin-bottom:var(--sp-5)}.page>header h2,.page h2{font-family:var(--font-display);font-size:22px;font-weight:600;letter-spacing:-.02em;line-height:1.2}.page>header p,.page header p{color:var(--ink-3);font-size:13px;margin-top:3px}.pagehead{display:flex;align-items:flex-start;justify-content:space-between;gap:var(--sp-4);margin-bottom:var(--sp-5);flex-wrap:wrap}h3{font-size:11px;font-weight:600;letter-spacing:.085em;text-transform:uppercase;color:var(--ink-3)}.card{background:var(--s1);border:1px solid var(--line);border-radius:var(--r);padding:var(--sp-4)}.card>h3{margin-bottom:var(--sp-3)}.card.flush{padding:0;overflow:hidden}.panel{background:var(--s1);border:1px solid var(--line);border-radius:var(--r-lg);overflow:hidden;display:flex;flex-direction:column;min-height:0}.panel>.panelhead{display:flex;align-items:center;justify-content:space-between;gap:var(--sp-3);padding:var(--sp-3) var(--sp-4);border-bottom:1px solid var(--line-2);background:linear-gradient(var(--s2),var(--s1));flex:none}.panel>.panelhead h3{margin:0}.panel>.panelbody{padding:var(--sp-4);min-height:0;overflow:auto}.panel>.panelbody.flush{padding:0}.grid{display:grid;gap:var(--sp-4)}.cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}@media (max-width: 1180px){.cols-4{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (max-width: 980px){.cols-2,.cols-3{grid-template-columns:minmax(0,1fr)}}.metrics{display:grid;grid-template-columns:repeat(auto-fit,minmax(152px,1fr));gap:1px;background:var(--line);border:1px solid var(--line);border-radius:var(--r);overflow:hidden}.metric{background:var(--s1);padding:var(--sp-3) var(--sp-4) var(--sp-4)}.metric .metric-k{font-size:10.5px;font-weight:600;letter-spacing:.085em;text-transform:uppercase;color:var(--ink-3)}.metric .metric-v{font-family:var(--font-display);font-size:26px;font-weight:600;letter-spacing:-.025em;line-height:1.1;margin-top:5px}.metric .metric-s{font-size:11.5px;color:var(--ink-3);margin-top:3px;line-height:1.4}.metric.ok .metric-v{color:var(--ok)}.metric.warn .metric-v{color:var(--warn)}.metric.bad .metric-v{color:var(--bad)}.stat h3{margin-bottom:var(--sp-2)}.stat .value{font-family:var(--font-display);font-size:26px;font-weight:600;letter-spacing:-.025em;line-height:1.1}.stat .unit{font-size:15px;color:var(--ink-3);margin-left:3px}.stat .sub{font-size:11.5px;color:var(--ink-3);margin-top:4px;line-height:1.4}.dot{width:7px;height:7px;border-radius:99px;flex:none;background:var(--ink-3)}.dot.ok{background:var(--ok);box-shadow:0 0 0 3px color-mix(in srgb,var(--ok) 18%,transparent)}.dot.warn{background:var(--warn);box-shadow:0 0 0 3px color-mix(in srgb,var(--warn) 18%,transparent)}.dot.bad{background:var(--bad);box-shadow:0 0 0 3px color-mix(in srgb,var(--bad) 18%,transparent)}.dot.idle{background:var(--ink-3)}.dot.live{background:var(--ok);animation:pulse 2.4s ease-in-out infinite}@keyframes pulse{0%,to{box-shadow:0 0 color-mix(in srgb,var(--ok) 55%,transparent)}70%{box-shadow:0 0 0 6px color-mix(in srgb,var(--ok) 0%,transparent)}}.pill{display:inline-flex;align-items:center;gap:6px;padding:3px 9px 3px 7px;border-radius:99px;font-size:11px;font-weight:600;letter-spacing:.02em;background:var(--s3);color:var(--ink-2);border:1px solid var(--line);white-space:nowrap}.pill.ok{background:var(--ok-2);color:var(--ok);border-color:color-mix(in srgb,var(--ok) 28%,transparent)}.pill.warn{background:var(--warn-2);color:var(--warn);border-color:color-mix(in srgb,var(--warn) 28%,transparent)}.pill.bad{background:var(--bad-2);color:var(--bad);border-color:color-mix(in srgb,var(--bad) 28%,transparent)}.pill.accent{background:var(--accent-3);color:var(--accent);border-color:color-mix(in srgb,var(--accent) 30%,transparent)}.tag{display:inline-flex;align-items:center;padding:2px 7px;border-radius:var(--r-sm);font-size:10.5px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;background:var(--s3);color:var(--ink-2)}.tag.new{background:var(--accent-3);color:var(--accent)}.tag.seen{background:var(--ok-2);color:var(--ok)}.tag.miss{background:var(--warn-2);color:var(--warn)}.statusbar{display:flex;align-items:center;gap:var(--sp-5);flex-wrap:wrap;padding:var(--sp-3) var(--sp-4);background:var(--s1);border:1px solid var(--line);border-radius:var(--r);margin-bottom:var(--sp-4)}.statusbar .item{display:flex;align-items:center;gap:var(--sp-2);font-size:12.5px}.statusbar .item b{font-weight:600;letter-spacing:-.005em}.statusbar .item svg{color:var(--ink-3)}.statusbar .sep{width:1px;align-self:stretch;background:var(--line)}.statusbar .grow{flex:1}.arrivals{display:flex;flex-direction:column;gap:var(--sp-2);padding:var(--sp-3)}.arrival{display:grid;grid-template-columns:46px 1fr auto;gap:var(--sp-3);align-items:center;padding:var(--sp-3);border-radius:var(--r);background:var(--s2);border:1px solid var(--line-2);position:relative;overflow:hidden}.arrival:before{content:"";position:absolute;left:0;top:0;bottom:0;width:2.5px;background:var(--ink-3)}.arrival.is-new:before{background:var(--accent)}.arrival.is-seen:before{background:var(--ok)}.arrival.is-miss:before{background:var(--warn)}.arrival.fresh{animation:slidein .28s cubic-bezier(.2,.8,.3,1)}@keyframes slidein{0%{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:none}}.arrival .avatar{width:46px;height:46px;border-radius:var(--r-sm);display:grid;place-items:center;overflow:hidden;background:var(--s3);border:1px solid var(--line);font-family:var(--font-display);font-size:15px;font-weight:600;color:var(--ink-2);letter-spacing:-.01em;font-variant-numeric:tabular-nums}.arrival .avatar img{width:100%;height:100%;object-fit:cover}.arrival.is-new .avatar{background:var(--accent-3);color:var(--accent);border-color:color-mix(in srgb,var(--accent) 25%,transparent)}.arrival .who{min-width:0}.arrival .who .name{font-size:14.5px;font-weight:600;letter-spacing:-.01em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.arrival .who .meta{font-size:11.5px;color:var(--ink-3);margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.arrival .right{text-align:right;display:flex;flex-direction:column;align-items:flex-end;gap:5px}.arrival .right .when{font-size:11.5px;color:var(--ink-3)}.feeds{display:grid;gap:var(--sp-3);grid-template-columns:repeat(auto-fit,minmax(300px,1fr));padding:var(--sp-3)}.feed{position:relative;border-radius:var(--r);overflow:hidden;background:#05090c;border:1px solid var(--line);aspect-ratio:16 / 9}.feed img{width:100%;height:100%;object-fit:cover;display:block}.feed .placeholder{width:100%;height:100%;display:grid;place-items:center;color:var(--ink-3)}.feed .cap{position:absolute;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:space-between;gap:var(--sp-2);padding:var(--sp-5) var(--sp-3) var(--sp-3);background:linear-gradient(transparent,#000c);font-size:12.5px;font-weight:600;letter-spacing:-.005em}.events,.timeline{list-style:none;padding:0;display:flex;flex-direction:column}.events li{display:flex;align-items:center;gap:var(--sp-3);padding:9px var(--sp-4);border-bottom:1px solid var(--line-2);font-size:13px}.timeline li{display:flex;align-items:center;gap:var(--sp-3);padding:9px 0;border-bottom:1px solid var(--line-2);font-size:13px}.events li:last-child,.timeline li:last-child{border-bottom:0}.events .when,.timeline .when{font-size:11.5px;color:var(--ink-3);width:46px;flex:none}.empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--sp-3);padding:var(--sp-8) var(--sp-5);color:var(--ink-3);text-align:center;font-size:12.5px}.empty svg{opacity:.35}.empty b{display:block;color:var(--ink-2);font-size:13.5px;font-weight:550}.empty p{max-width:34ch;line-height:1.5}.tablewrap{overflow:auto}table{border-collapse:collapse;width:100%;font-size:13px}th{text-align:left;padding:9px var(--sp-4);font-size:10.5px;font-weight:600;letter-spacing:.085em;text-transform:uppercase;color:var(--ink-3);background:var(--s2);border-bottom:1px solid var(--line);position:sticky;top:0;z-index:1}td{padding:10px var(--sp-4);border-bottom:1px solid var(--line-2)}tbody tr:last-child td{border-bottom:0}tbody tr[role=button],tbody tr.clickable{cursor:pointer}tbody tr[role=button]:hover,tbody tr.clickable:hover{background:var(--s2)}.btn{display:inline-flex;align-items:center;gap:7px;padding:8px 14px;border-radius:var(--r-sm);background:var(--s3);color:var(--ink);border:1px solid var(--line);cursor:pointer;font-size:13px;font-weight:550;letter-spacing:-.005em;white-space:nowrap;transition:background .12s ease,border-color .12s ease,transform .06s ease}.btn:hover:not(:disabled){background:#253643;border-color:#2e414e}.btn:active:not(:disabled){transform:translateY(.5px)}.btn:disabled{opacity:.45;cursor:not-allowed}.btn svg{flex:none}.btn.primary{background:var(--accent);color:#04171c;border-color:transparent;font-weight:600}.btn.primary:hover:not(:disabled){background:#55d0e6}.btn.danger{background:var(--bad-2);color:var(--bad);border-color:color-mix(in srgb,var(--bad) 32%,transparent)}.btn.danger:hover:not(:disabled){background:#43201c}.btn.ghost{background:transparent}.btn.ghost:hover:not(:disabled){background:var(--s2)}.btn.sm{padding:5px 10px;font-size:12px}.btn.icon{padding:7px}.linkbtn{background:none;border:0;color:var(--accent);cursor:pointer;font-size:12.5px;padding:2px 0;text-align:left}.linkbtn:hover{text-decoration:underline}.seg{display:inline-flex;background:var(--s2);border:1px solid var(--line);border-radius:var(--r-sm);padding:2px;gap:2px}.seg button{background:none;border:0;border-radius:4px;padding:5px 11px;color:var(--ink-3);cursor:pointer;font-size:12.5px;font-weight:500}.seg button[aria-pressed=true]{background:var(--s3);color:var(--ink)}.field{display:block;margin-bottom:var(--sp-4)}.field>span{display:block;font-size:11.5px;font-weight:550;color:var(--ink-2);margin-bottom:6px}.field input,.field select,.field textarea{width:100%;padding:9px 11px;background:var(--s2);color:var(--ink);border:1px solid var(--line);border-radius:var(--r-sm);transition:border-color .12s ease,background .12s ease,box-shadow .12s ease}.field input::placeholder{color:var(--ink-3)}.field input:hover,.field select:hover,.field textarea:hover{border-color:#2c3d49}.field input:focus,.field select:focus,.field textarea:focus{outline:none;border-color:var(--accent);background:var(--s1);box-shadow:0 0 0 3px var(--accent-3)}.field .hint{display:block;font-size:11.5px;color:var(--ink-3);margin-top:5px;line-height:1.45}.fieldrow{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--sp-3)}.fieldrow.three{grid-template-columns:repeat(3,minmax(0,1fr))}.err{display:flex;align-items:flex-start;gap:var(--sp-2);background:var(--bad-2);color:var(--bad);border:1px solid color-mix(in srgb,var(--bad) 30%,transparent);border-radius:var(--r-sm);padding:9px 11px;font-size:12.5px;line-height:1.45;margin-bottom:var(--sp-4)}.err svg{flex:none;margin-top:1px}.note{color:var(--ink-3);font-size:12px;line-height:1.5}.note.warn{color:var(--warn)}.note.bad{color:var(--bad)}.lead{color:var(--ink-2);font-size:13.5px;line-height:1.55}.sm{font-size:12px}.lbl,.key{color:var(--ink-3);font-size:11.5px}.grow{flex:1}.row{display:flex;align-items:center;gap:var(--sp-3)}.login{height:100%;display:grid;place-items:center;padding:var(--sp-6);overflow:auto;background:radial-gradient(900px 480px at 50% -10%,#10303A 0%,transparent 62%),var(--bg)}.login .box{width:100%;max-width:396px;background:var(--s1);border:1px solid var(--line);border-radius:var(--r-lg);padding:var(--sp-7);box-shadow:var(--shadow-lg)}.login .mark{width:38px;height:38px;border-radius:11px;margin-bottom:var(--sp-4);display:grid;place-items:center;color:var(--accent);background:linear-gradient(160deg,var(--accent-2),var(--s2));border:1px solid #1B4C5A}.login h1{font-family:var(--font-display);font-size:21px;font-weight:600;letter-spacing:-.022em}.login .lead{margin:6px 0 var(--sp-5)}.login .btn{width:100%;justify-content:center;margin-top:var(--sp-1)}.login .foot{font-size:11.5px;color:var(--ink-3);line-height:1.55;margin-top:var(--sp-5);padding-top:var(--sp-4);border-top:1px solid var(--line-2)}.login .alt{margin-top:var(--sp-4);display:flex;flex-direction:column;gap:var(--sp-3)}.login .alt .btn{margin-top:0}.login .note{margin:0}.drawer{position:fixed;top:0;right:0;bottom:0;left:0;z-index:40;background:#04080b99;display:flex;justify-content:flex-end;animation:fade .16s ease}@keyframes fade{0%{opacity:0}to{opacity:1}}.drawer .sheet{width:min(540px,100%);height:100%;overflow:auto;background:var(--s1);border-left:1px solid var(--line);box-shadow:var(--shadow-lg);animation:slidein-r .2s cubic-bezier(.2,.8,.3,1)}@keyframes slidein-r{0%{transform:translate(16px);opacity:.6}to{transform:none;opacity:1}}.drawer .sheethead{position:sticky;top:0;z-index:1;display:flex;align-items:center;justify-content:space-between;gap:var(--sp-3);padding:var(--sp-4) var(--sp-5);background:var(--s1);border-bottom:1px solid var(--line)}.drawer .sheethead h2{font-family:var(--font-display);font-size:17px;font-weight:600;letter-spacing:-.015em}.drawer .sheetbody{padding:var(--sp-5)}.drawer .close{background:none;border:0;color:var(--ink-3);cursor:pointer;padding:6px;border-radius:var(--r-sm);display:grid;place-items:center}.drawer .close:hover{background:var(--s2);color:var(--ink)}.avatar{width:44px;height:44px;border-radius:var(--r-sm);flex:none;display:grid;place-items:center;overflow:hidden;background:var(--s3);border:1px solid var(--line);font-weight:600;color:var(--ink-2);font-variant-numeric:tabular-nums}.avatar img{width:100%;height:100%;object-fit:cover}@media (prefers-reduced-motion: reduce){*,*:before,*:after{animation:none!important;transition:none!important}}.live-split{display:grid;gap:var(--sp-4);grid-template-columns:minmax(0,1.35fr) minmax(0,1fr);align-items:stretch;min-height:420px}.live-split>.panel{max-height:62vh}@media (max-width: 1100px){.live-split{grid-template-columns:minmax(0,1fr)}.live-split>.panel{max-height:none}} diff --git a/desktop/frontend/dist/assets/index-DmoSrGcS.js b/desktop/frontend/dist/assets/index-DmoSrGcS.js new file mode 100644 index 0000000..fd896d3 --- /dev/null +++ b/desktop/frontend/dist/assets/index-DmoSrGcS.js @@ -0,0 +1,40 @@ +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const i of l)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(l){const i={};return l.integrity&&(i.integrity=l.integrity),l.referrerPolicy&&(i.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?i.credentials="include":l.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(l){if(l.ep)return;l.ep=!0;const i=n(l);fetch(l.href,i)}})();function kc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ru={exports:{}},ul={},lu={exports:{}},M={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var er=Symbol.for("react.element"),jc=Symbol.for("react.portal"),Nc=Symbol.for("react.fragment"),Cc=Symbol.for("react.strict_mode"),Ec=Symbol.for("react.profiler"),_c=Symbol.for("react.provider"),Pc=Symbol.for("react.context"),zc=Symbol.for("react.forward_ref"),Tc=Symbol.for("react.suspense"),Lc=Symbol.for("react.memo"),Mc=Symbol.for("react.lazy"),Ws=Symbol.iterator;function Rc(e){return e===null||typeof e!="object"?null:(e=Ws&&e[Ws]||e["@@iterator"],typeof e=="function"?e:null)}var iu={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},su=Object.assign,ou={};function dn(e,t,n){this.props=e,this.context=t,this.refs=ou,this.updater=n||iu}dn.prototype.isReactComponent={};dn.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};dn.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function uu(){}uu.prototype=dn.prototype;function Gi(e,t,n){this.props=e,this.context=t,this.refs=ou,this.updater=n||iu}var Zi=Gi.prototype=new uu;Zi.constructor=Gi;su(Zi,dn.prototype);Zi.isPureReactComponent=!0;var Qs=Array.isArray,au=Object.prototype.hasOwnProperty,Ji={current:null},cu={key:!0,ref:!0,__self:!0,__source:!0};function du(e,t,n){var r,l={},i=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)au.call(t,r)&&!cu.hasOwnProperty(r)&&(l[r]=t[r]);var u=arguments.length-2;if(u===1)l.children=n;else if(1>>1,q=C[Y];if(0>>1;Yl(_l,T))Stl(sr,_l)?(C[Y]=sr,C[St]=T,Y=St):(C[Y]=_l,C[wt]=T,Y=wt);else if(Stl(sr,T))C[Y]=sr,C[St]=T,Y=St;else break e}}return z}function l(C,z){var T=C.sortIndex-z.sortIndex;return T!==0?T:C.id-z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,u=s.now();e.unstable_now=function(){return s.now()-u}}var a=[],c=[],h=1,v=null,m=3,g=!1,w=!1,S=!1,D=typeof setTimeout=="function"?setTimeout:null,p=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 z=n(c);z!==null;){if(z.callback===null)r(c);else if(z.startTime<=C)r(c),z.sortIndex=z.expirationTime,t(a,z);else break;z=n(c)}}function y(C){if(S=!1,f(C),!w)if(n(a)!==null)w=!0,Cl(k);else{var z=n(c);z!==null&&El(y,z.startTime-C)}}function k(C,z){w=!1,S&&(S=!1,p(E),E=-1),g=!0;var T=m;try{for(f(z),v=n(a);v!==null&&(!(v.expirationTime>z)||C&&!Le());){var Y=v.callback;if(typeof Y=="function"){v.callback=null,m=v.priorityLevel;var q=Y(v.expirationTime<=z);z=e.unstable_now(),typeof q=="function"?v.callback=q:v===n(a)&&r(a),f(z)}else r(a);v=n(a)}if(v!==null)var ir=!0;else{var wt=n(c);wt!==null&&El(y,wt.startTime-z),ir=!1}return ir}finally{v=null,m=T,g=!1}}var _=!1,j=null,E=-1,V=5,L=-1;function Le(){return!(e.unstable_now()-LC||125Y?(C.sortIndex=T,t(c,C),n(a)===null&&C===n(c)&&(S?(p(E),E=-1):S=!0,El(y,T-Y))):(C.sortIndex=q,t(a,C),w||g||(w=!0,Cl(k))),C},e.unstable_shouldYield=Le,e.unstable_wrapCallback=function(C){var z=m;return function(){var T=m;m=z;try{return C.apply(this,arguments)}finally{m=T}}}})(vu);mu.exports=vu;var Qc=mu.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Kc=P,Se=Qc;function x(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"),ni=Object.prototype.hasOwnProperty,Yc=/^[: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]*$/,Ys={},Xs={};function Xc(e){return ni.call(Xs,e)?!0:ni.call(Ys,e)?!1:Yc.test(e)?Xs[e]=!0:(Ys[e]=!0,!1)}function Gc(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 Zc(e,t,n,r){if(t===null||typeof t>"u"||Gc(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,s){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=s}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 bi=/[\-:]([a-z])/g;function es(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(bi,es);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(bi,es);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(bi,es);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 ts(e,t,n,r){var l=re.hasOwnProperty(t)?re[t]:null;(l!==null?l.type!==0:r||!(2u||l[s]!==i[u]){var a=` +`+l[s].replace(" at new "," at ");return e.displayName&&a.includes("")&&(a=a.replace("",e.displayName)),a}while(1<=s&&0<=u);break}}}finally{Tl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Nn(e):""}function Jc(e){switch(e.tag){case 5:return Nn(e.type);case 16:return Nn("Lazy");case 13:return Nn("Suspense");case 19:return Nn("SuspenseList");case 0:case 2:case 15:return e=Ll(e.type,!1),e;case 11:return e=Ll(e.type.render,!1),e;case 1:return e=Ll(e.type,!0),e;default:return""}}function si(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 $t:return"Portal";case ri:return"Profiler";case ns:return"StrictMode";case li:return"Suspense";case ii:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case xu:return(e.displayName||"Context")+".Consumer";case yu:return(e._context.displayName||"Context")+".Provider";case rs:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ls:return t=e.displayName||null,t!==null?t:si(e.type)||"Memo";case tt:t=e._payload,e=e._init;try{return si(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 si(t);case 8:return t===ns?"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 mt(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Su(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function bc(e){var t=Su(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(s){r=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ar(e){e._valueTracker||(e._valueTracker=bc(e))}function ku(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Su(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function $r(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 oi(e,t){var n=t.checked;return Q({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Zs(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=mt(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 ju(e,t){t=t.checked,t!=null&&ts(e,"checked",t,!1)}function ui(e,t){ju(e,t);var n=mt(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")?ai(e,t.type,n):t.hasOwnProperty("defaultValue")&&ai(e,t.type,mt(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Js(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 ai(e,t,n){(t!=="number"||$r(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Cn=Array.isArray;function Zt(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=cr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function $n(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Pn={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},ed=["Webkit","ms","Moz","O"];Object.keys(Pn).forEach(function(e){ed.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Pn[t]=Pn[e]})});function _u(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Pn.hasOwnProperty(e)&&Pn[e]?(""+t).trim():t+"px"}function Pu(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=_u(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var td=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 fi(e,t){if(t){if(td[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(x(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(x(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(x(61))}if(t.style!=null&&typeof t.style!="object")throw Error(x(62))}}function pi(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 hi=null;function is(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var mi=null,Jt=null,qt=null;function eo(e){if(e=rr(e)){if(typeof mi!="function")throw Error(x(280));var t=e.stateNode;t&&(t=pl(t),mi(e.stateNode,e.type,t))}}function zu(e){Jt?qt?qt.push(e):qt=[e]:Jt=e}function Tu(){if(Jt){var e=Jt,t=qt;if(qt=Jt=null,eo(e),t)for(e=0;e>>=0,e===0?32:31-(fd(e)/pd|0)|0}var dr=64,fr=4194304;function En(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 Vr(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var u=s&~l;u!==0?r=En(u):(i&=s,i!==0&&(r=En(i)))}else s=n&~l,s!==0?r=En(s):i!==0&&(r=En(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 tr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Fe(t),e[t]=n}function gd(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),ao=" ",co=!1;function Zu(e,t){switch(e){case"keyup":return Qd.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ju(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Bt=!1;function Yd(e,t){switch(e){case"compositionend":return Ju(t);case"keypress":return t.which!==32?null:(co=!0,ao);case"textInput":return e=t.data,e===ao&&co?null:e;default:return null}}function Xd(e,t){if(Bt)return e==="compositionend"||!ps&&Zu(e,t)?(e=Xu(),zr=cs=it=null,Bt=!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=mo(n)}}function ta(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ta(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function na(){for(var e=window,t=$r();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=$r(e.document)}return t}function hs(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 rf(e){var t=na(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&ta(n.ownerDocument.documentElement,n)){if(r!==null&&hs(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=vo(n,i);var s=vo(n,r);l&&s&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.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,At=null,Si=null,Mn=null,ki=!1;function go(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ki||At==null||At!==$r(r)||(r=At,"selectionStart"in r&&hs(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}),Mn&&Wn(Mn,r)||(Mn=r,r=Qr(Si,"onSelect"),0Wt||(e.current=Pi[Wt],Pi[Wt]=null,Wt--)}function I(e,t){Wt++,Pi[Wt]=e.current,e.current=t}var vt={},oe=yt(vt),he=yt(!1),zt=vt;function ln(e,t){var n=e.type.contextTypes;if(!n)return vt;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 Yr(){U(he),U(oe)}function No(e,t,n){if(oe.current!==vt)throw Error(x(168));I(oe,t),I(he,n)}function da(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(x(108,qc(e)||"Unknown",l));return Q({},n,r)}function Xr(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||vt,zt=oe.current,I(oe,e),I(he,he.current),!0}function Co(e,t,n){var r=e.stateNode;if(!r)throw Error(x(169));n?(e=da(e,t,zt),r.__reactInternalMemoizedMergedChildContext=e,U(he),U(oe),I(oe,e)):U(he),I(he,n)}var Qe=null,hl=!1,Ql=!1;function fa(e){Qe===null?Qe=[e]:Qe.push(e)}function vf(e){hl=!0,fa(e)}function xt(){if(!Ql&&Qe!==null){Ql=!0;var e=0,t=O;try{var n=Qe;for(O=1;e>=s,l-=s,Ke=1<<32-Fe(t)+l|n<E?(V=j,j=null):V=j.sibling;var L=m(p,j,f[E],y);if(L===null){j===null&&(j=V);break}e&&j&&L.alternate===null&&t(p,j),d=i(L,d,E),_===null?k=L:_.sibling=L,_=L,j=V}if(E===f.length)return n(p,j),B&&kt(p,E),k;if(j===null){for(;EE?(V=j,j=null):V=j.sibling;var Le=m(p,j,L.value,y);if(Le===null){j===null&&(j=V);break}e&&j&&Le.alternate===null&&t(p,j),d=i(Le,d,E),_===null?k=Le:_.sibling=Le,_=Le,j=V}if(L.done)return n(p,j),B&&kt(p,E),k;if(j===null){for(;!L.done;E++,L=f.next())L=v(p,L.value,y),L!==null&&(d=i(L,d,E),_===null?k=L:_.sibling=L,_=L);return B&&kt(p,E),k}for(j=r(p,j);!L.done;E++,L=f.next())L=g(j,p,E,L.value,y),L!==null&&(e&&L.alternate!==null&&j.delete(L.key===null?E:L.key),d=i(L,d,E),_===null?k=L:_.sibling=L,_=L);return e&&j.forEach(function(hn){return t(p,hn)}),B&&kt(p,E),k}function D(p,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 ur:e:{for(var k=f.key,_=d;_!==null;){if(_.key===k){if(k=f.type,k===Ut){if(_.tag===7){n(p,_.sibling),d=l(_,f.props.children),d.return=p,p=d;break e}}else if(_.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===tt&&Po(k)===_.type){n(p,_.sibling),d=l(_,f.props),d.ref=Sn(p,_,f),d.return=p,p=d;break e}n(p,_);break}else t(p,_);_=_.sibling}f.type===Ut?(d=Pt(f.props.children,p.mode,y,f.key),d.return=p,p=d):(y=Ir(f.type,f.key,f.props,null,p.mode,y),y.ref=Sn(p,d,f),y.return=p,p=y)}return s(p);case $t:e:{for(_=f.key;d!==null;){if(d.key===_)if(d.tag===4&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){n(p,d.sibling),d=l(d,f.children||[]),d.return=p,p=d;break e}else{n(p,d);break}else t(p,d);d=d.sibling}d=bl(f,p.mode,y),d.return=p,p=d}return s(p);case tt:return _=f._init,D(p,d,_(f._payload),y)}if(Cn(f))return w(p,d,f,y);if(vn(f))return S(p,d,f,y);xr(p,f)}return typeof f=="string"&&f!==""||typeof f=="number"?(f=""+f,d!==null&&d.tag===6?(n(p,d.sibling),d=l(d,f),d.return=p,p=d):(n(p,d),d=ql(f,p.mode,y),d.return=p,p=d),s(p)):n(p,d)}return D}var on=va(!0),ga=va(!1),Jr=yt(null),qr=null,Yt=null,ys=null;function xs(){ys=Yt=qr=null}function ws(e){var t=Jr.current;U(Jr),e._currentValue=t}function Li(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 en(e,t){qr=e,ys=Yt=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(pe=!0),e.firstContext=null)}function Pe(e){var t=e._currentValue;if(ys!==e)if(e={context:e,memoizedValue:t,next:null},Yt===null){if(qr===null)throw Error(x(308));Yt=e,qr.dependencies={lanes:0,firstContext:e}}else Yt=Yt.next=e;return t}var Ct=null;function Ss(e){Ct===null?Ct=[e]:Ct.push(e)}function ya(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,Ss(t)):(n.next=l.next,l.next=n),t.interleaved=n,Je(e,r)}function Je(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 nt=!1;function ks(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function xa(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 Xe(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function dt(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,R&2){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,Je(e,n)}return l=r.interleaved,l===null?(t.next=t,Ss(r)):(t.next=l.next,l.next=t),r.interleaved=t,Je(e,n)}function Lr(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,os(e,n)}}function zo(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 s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?l=i=s:i=i.next=s,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 br(e,t,n,r){var l=e.updateQueue;nt=!1;var i=l.firstBaseUpdate,s=l.lastBaseUpdate,u=l.shared.pending;if(u!==null){l.shared.pending=null;var a=u,c=a.next;a.next=null,s===null?i=c:s.next=c,s=a;var h=e.alternate;h!==null&&(h=h.updateQueue,u=h.lastBaseUpdate,u!==s&&(u===null?h.firstBaseUpdate=c:u.next=c,h.lastBaseUpdate=a))}if(i!==null){var v=l.baseState;s=0,h=c=a=null,u=i;do{var m=u.lane,g=u.eventTime;if((r&m)===m){h!==null&&(h=h.next={eventTime:g,lane:0,tag:u.tag,payload:u.payload,callback:u.callback,next:null});e:{var w=e,S=u;switch(m=t,g=n,S.tag){case 1:if(w=S.payload,typeof w=="function"){v=w.call(g,v,m);break e}v=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=S.payload,m=typeof w=="function"?w.call(g,v,m):w,m==null)break e;v=Q({},v,m);break e;case 2:nt=!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},h===null?(c=h=g,a=v):h=h.next=g,s|=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(h===null&&(a=v),l.baseState=a,l.firstBaseUpdate=c,l.lastBaseUpdate=h,t=l.shared.interleaved,t!==null){l=t;do s|=l.lane,l=l.next;while(l!==t)}else i===null&&(l.shared.lanes=0);Mt|=s,e.lanes=s,e.memoizedState=v}}function To(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Yl.transition;Yl.transition={};try{e(!1),t()}finally{O=n,Yl.transition=r}}function Fa(){return ze().memoizedState}function wf(e,t,n){var r=pt(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Ia(e))$a(t,n);else if(n=ya(e,t,n,r),n!==null){var l=ae();Ie(n,e,r,l),Ua(n,t,r)}}function Sf(e,t,n){var r=pt(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ia(e))$a(t,l);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,u=i(s,n);if(l.hasEagerState=!0,l.eagerState=u,$e(u,s)){var a=t.interleaved;a===null?(l.next=l,Ss(t)):(l.next=a.next,a.next=l),t.interleaved=l;return}}catch{}finally{}n=ya(e,t,l,r),n!==null&&(l=ae(),Ie(n,e,r,l),Ua(n,t,r))}}function Ia(e){var t=e.alternate;return e===W||t!==null&&t===W}function $a(e,t){Rn=tl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ua(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,os(e,n)}}var nl={readContext:Pe,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},kf={readContext:Pe,useCallback:function(e,t){return Be().memoizedState=[e,t===void 0?null:t],e},useContext:Pe,useEffect:Mo,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Rr(4194308,4,La.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=Be();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Be();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=wf.bind(null,W,e),[r.memoizedState,e]},useRef:function(e){var t=Be();return e={current:e},t.memoizedState=e},useState:Lo,useDebugValue:Ts,useDeferredValue:function(e){return Be().memoizedState=e},useTransition:function(){var e=Lo(!1),t=e[0];return e=xf.bind(null,e[1]),Be().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=W,l=Be();if(B){if(n===void 0)throw Error(x(407));n=n()}else{if(n=t(),ee===null)throw Error(x(349));Lt&30||ja(r,t,n)}l.memoizedState=n;var i={value:n,getSnapshot:t};return l.queue=i,Mo(Ca.bind(null,r,i,e),[e]),r.flags|=2048,qn(9,Na.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Be(),t=ee.identifierPrefix;if(B){var n=Ye,r=Ke;n=(r&~(1<<32-Fe(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Zn++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[Ae]=t,e[Yn]=r,Ga(e,t,!1,!1),t.stateNode=e;e:{switch(s=pi(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;l<_n.length;l++)$(_n[l],e);l=r;break;case"source":$("error",e),l=r;break;case"img":case"image":case"link":$("error",e),$("load",e),l=r;break;case"details":$("toggle",e),l=r;break;case"input":Zs(e,r),l=oi(e,r),$("invalid",e);break;case"option":l=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},l=Q({},r,{value:void 0}),$("invalid",e);break;case"textarea":qs(e,r),l=ci(e,r),$("invalid",e);break;default:l=r}fi(n,l),u=l;for(i in u)if(u.hasOwnProperty(i)){var a=u[i];i==="style"?Pu(e,a):i==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&Eu(e,a)):i==="children"?typeof a=="string"?(n!=="textarea"||a!=="")&&$n(e,a):typeof a=="number"&&$n(e,""+a):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(In.hasOwnProperty(i)?a!=null&&i==="onScroll"&&$("scroll",e):a!=null&&ts(e,i,a,s))}switch(n){case"input":ar(e),Js(e,r,!1);break;case"textarea":ar(e),bs(e);break;case"option":r.value!=null&&e.setAttribute("value",""+mt(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?Zt(e,!!r.multiple,i,!1):r.defaultValue!=null&&Zt(e,!!r.multiple,r.defaultValue,!0);break;default:typeof l.onClick=="function"&&(e.onclick=Kr)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return ie(t),null;case 6:if(e&&t.stateNode!=null)Ja(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(x(166));if(n=Et(Gn.current),Et(He.current),yr(t)){if(r=t.stateNode,n=t.memoizedProps,r[Ae]=t,(i=r.nodeValue!==n)&&(e=we,e!==null))switch(e.tag){case 3:gr(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&gr(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Ae]=t,t.stateNode=r}return ie(t),null;case 13:if(U(H),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(B&&xe!==null&&t.mode&1&&!(t.flags&128))ma(),sn(),t.flags|=98560,i=!1;else if(i=yr(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(x(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(x(317));i[Ae]=t}else sn(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ie(t),i=!1}else Oe!==null&&(Yi(Oe),Oe=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||H.current&1?J===0&&(J=3):Is())),t.updateQueue!==null&&(t.flags|=4),ie(t),null);case 4:return un(),Ui(e,t),e===null&&Qn(t.stateNode.containerInfo),ie(t),null;case 10:return ws(t.type._context),ie(t),null;case 17:return me(t.type)&&Yr(),ie(t),null;case 19:if(U(H),i=t.memoizedState,i===null)return ie(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)kn(i,!1);else{if(J!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=el(e),s!==null){for(t.flags|=128,kn(i,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,s=i.alternate,s===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,e=s.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return I(H,H.current&1|2),t.child}e=e.sibling}i.tail!==null&&X()>cn&&(t.flags|=128,r=!0,kn(i,!1),t.lanes=4194304)}else{if(!r)if(e=el(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),kn(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!B)return ie(t),null}else 2*X()-i.renderingStartTime>cn&&n!==1073741824&&(t.flags|=128,r=!0,kn(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=X(),t.sibling=null,n=H.current,I(H,r?n&1|2:n&1),t):(ie(t),null);case 22:case 23:return Fs(),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(x(156,t.tag))}function Tf(e,t){switch(vs(t),t.tag){case 1:return me(t.type)&&Yr(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return un(),U(he),U(oe),Cs(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ns(t),null;case 13:if(U(H),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(x(340));sn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return U(H),null;case 4:return un(),null;case 10:return ws(t.type._context),null;case 22:case 23:return Fs(),null;case 24:return null;default:return null}}var Sr=!1,se=!1,Lf=typeof WeakSet=="function"?WeakSet:Set,N=null;function Xt(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 Bi(e,t,n){try{n()}catch(r){K(e,t,r)}}var Ho=!1;function Mf(e,t){if(ji=Hr,e=na(),hs(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 s=0,u=-1,a=-1,c=0,h=0,v=e,m=null;t:for(;;){for(var g;v!==n||l!==0&&v.nodeType!==3||(u=s+l),v!==i||r!==0&&v.nodeType!==3||(a=s+r),v.nodeType===3&&(s+=v.nodeValue.length),(g=v.firstChild)!==null;)m=v,v=g;for(;;){if(v===e)break t;if(m===n&&++c===l&&(u=s),m===i&&++h===r&&(a=s),(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(Ni={focusedElem:e,selectionRange:n},Hr=!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 w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var S=w.memoizedProps,D=w.memoizedState,p=t.stateNode,d=p.getSnapshotBeforeUpdate(t.elementType===t.type?S:Re(t.type,S),D);p.__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(x(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 w=Ho,Ho=!1,w}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&&Bi(t,n,i)}l=l.next}while(l!==r)}}function gl(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 Ai(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 qa(e){var t=e.alternate;t!==null&&(e.alternate=null,qa(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ae],delete t[Yn],delete t[_i],delete t[hf],delete t[mf])),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 ba(e){return e.tag===5||e.tag===3||e.tag===4}function Wo(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ba(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 Vi(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=Kr));else if(r!==4&&(e=e.child,e!==null))for(Vi(e,t,n),e=e.sibling;e!==null;)Vi(e,t,n),e=e.sibling}function Hi(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(Hi(e,t,n),e=e.sibling;e!==null;)Hi(e,t,n),e=e.sibling}var te=null,De=!1;function et(e,t,n){for(n=n.child;n!==null;)ec(e,t,n),n=n.sibling}function ec(e,t,n){if(Ve&&typeof Ve.onCommitFiberUnmount=="function")try{Ve.onCommitFiberUnmount(al,n)}catch{}switch(n.tag){case 5:se||Xt(n,t);case 6:var r=te,l=De;te=null,et(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?Wl(e.parentNode,n):e.nodeType===1&&Wl(e,n),Vn(e)):Wl(te,n.stateNode));break;case 4:r=te,l=De,te=n.stateNode.containerInfo,De=!0,et(e,t,n),te=r,De=l;break;case 0:case 11:case 14:case 15:if(!se&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var i=l,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&Bi(n,t,s),l=l.next}while(l!==r)}et(e,t,n);break;case 1:if(!se&&(Xt(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)}et(e,t,n);break;case 21:et(e,t,n);break;case 22:n.mode&1?(se=(r=se)||n.memoizedState!==null,et(e,t,n),se=r):et(e,t,n);break;default:et(e,t,n)}}function Qo(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Lf),t.forEach(function(r){var l=Af.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function Me(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=s),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*Df(r/1960))-r,10e?16:e,st===null)var r=!1;else{if(e=st,st=null,il=0,R&6)throw Error(x(331));var l=R;for(R|=4,N=e.current;N!==null;){var i=N,s=i.child;if(N.flags&16){var u=i.deletions;if(u!==null){for(var a=0;aX()-Ds?_t(e,0):Rs|=n),ve(e,t)}function uc(e,t){t===0&&(e.mode&1?(t=fr,fr<<=1,!(fr&130023424)&&(fr=4194304)):t=1);var n=ae();e=Je(e,t),e!==null&&(tr(e,t,n),ve(e,n))}function Bf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),uc(e,n)}function Af(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(x(314))}r!==null&&r.delete(t),uc(e,n)}var ac;ac=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,Pf(e,t,n);pe=!!(e.flags&131072)}else pe=!1,B&&t.flags&1048576&&pa(t,Zr,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Dr(e,t),e=t.pendingProps;var l=ln(t,oe.current);en(t,n),l=_s(null,t,r,e,l,n);var i=Ps();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,Xr(t)):i=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,ks(t),l.updater=vl,t.stateNode=l,l._reactInternals=t,Ri(t,r,e,n),t=Fi(null,t,r,!0,i,n)):(t.tag=0,B&&i&&ms(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=Hf(r),e=Re(r,e),l){case 0:t=Oi(null,t,r,e,n);break e;case 1:t=Bo(null,t,r,e,n);break e;case 11:t=$o(null,t,r,e,n);break e;case 14:t=Uo(null,t,r,Re(r.type,e),n);break e}throw Error(x(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Re(r,l),Oi(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Re(r,l),Bo(e,t,r,l,n);case 3:e:{if(Ka(t),e===null)throw Error(x(387));r=t.pendingProps,i=t.memoizedState,l=i.element,xa(e,t),br(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){l=an(Error(x(423)),t),t=Ao(e,t,r,n,l);break e}else if(r!==l){l=an(Error(x(424)),t),t=Ao(e,t,r,n,l);break e}else for(xe=ct(t.stateNode.containerInfo.firstChild),we=t,B=!0,Oe=null,n=ga(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(sn(),r===l){t=qe(e,t,n);break e}ue(e,t,r,n)}t=t.child}return t;case 5:return wa(t),e===null&&Ti(t),r=t.type,l=t.pendingProps,i=e!==null?e.memoizedProps:null,s=l.children,Ci(r,l)?s=null:i!==null&&Ci(r,i)&&(t.flags|=32),Qa(e,t),ue(e,t,s,n),t.child;case 6:return e===null&&Ti(t),null;case 13:return Ya(e,t,n);case 4:return js(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),$o(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,s=l.value,I(Jr,r._currentValue),r._currentValue=s,i!==null)if($e(i.value,s)){if(i.children===l.children&&!he.current){t=qe(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var u=i.dependencies;if(u!==null){s=i.child;for(var a=u.firstContext;a!==null;){if(a.context===r){if(i.tag===1){a=Xe(-1,n&-n),a.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var h=c.pending;h===null?a.next=a:(a.next=h.next,h.next=a),c.pending=a}}i.lanes|=n,a=i.alternate,a!==null&&(a.lanes|=n),Li(i.return,n,t),u.lanes|=n;break}a=a.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(x(341));s.lanes|=n,u=s.alternate,u!==null&&(u.lanes|=n),Li(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}ue(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,en(t,n),l=Pe(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),Uo(e,t,r,l,n);case 15:return Ha(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,Xr(t)):e=!1,en(t,n),Ba(t,r,l),Ri(t,r,l,n),Fi(null,t,r,!0,e,n);case 19:return Xa(e,t,n);case 22:return Wa(e,t,n)}throw Error(x(156,t.tag))};function cc(e,t){return Iu(e,t)}function Vf(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 Ee(e,t,n,r){return new Vf(e,t,n,r)}function $s(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Hf(e){if(typeof e=="function")return $s(e)?1:0;if(e!=null){if(e=e.$$typeof,e===rs)return 11;if(e===ls)return 14}return 2}function ht(e,t){var n=e.alternate;return n===null?(n=Ee(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 s=2;if(r=e,typeof e=="function")$s(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Ut:return Pt(n.children,l,i,t);case ns:s=8,l|=8;break;case ri:return e=Ee(12,n,t,l|2),e.elementType=ri,e.lanes=i,e;case li:return e=Ee(13,n,t,l),e.elementType=li,e.lanes=i,e;case ii:return e=Ee(19,n,t,l),e.elementType=ii,e.lanes=i,e;case wu:return xl(n,l,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case yu:s=10;break e;case xu:s=9;break e;case rs:s=11;break e;case ls:s=14;break e;case tt:s=16,r=null;break e}throw Error(x(130,e==null?e:typeof e,""))}return t=Ee(s,n,t,l),t.elementType=e,t.type=r,t.lanes=i,t}function Pt(e,t,n,r){return e=Ee(7,e,r,t),e.lanes=n,e}function xl(e,t,n,r){return e=Ee(22,e,r,t),e.elementType=wu,e.lanes=n,e.stateNode={isHidden:!1},e}function ql(e,t,n){return e=Ee(6,e,null,t),e.lanes=n,e}function bl(e,t,n){return t=Ee(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Wf(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=Rl(0),this.expirationTimes=Rl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Rl(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function Us(e,t,n,r,l,i,s,u,a){return e=new Wf(e,t,n,u,a),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Ee(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},ks(i),e}function Qf(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(hc)}catch(e){console.error(e)}}hc(),hu.exports=ke;var Zf=hu.exports,mc,bo=Zf;mc=bo.createRoot,bo.hydrateRoot;const vc=()=>{var e,t;return(t=(e=window==null?void 0:window.go)==null?void 0:e.main)==null?void 0:t.App},Jf=()=>!!vc();async function F(e,...t){const n=vc();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:()=>F("Session"),login:(e,t)=>F("Login",e,t),logout:()=>F("Logout"),claim:e=>F("Claim",e),runStandalone:()=>F("RunStandalone"),engineStatus:()=>F("EngineStatus"),startEngine:()=>F("StartEngine"),stopEngine:()=>F("StopEngine"),cameras:()=>F("Cameras"),testCamera:e=>F("TestCamera",e),saveCamera:(e,t)=>F("SaveCamera",e,t),deleteCamera:e=>F("DeleteCamera",e),startPlacement:(e,t)=>F("StartPlacementCheck",e,t),placementResult:e=>F("PlacementResult",e),streamURL:e=>F("StreamURL",e),live:()=>F("Live"),pipelineStatus:()=>F("PipelineStatus"),localIdentities:e=>F("LocalIdentities",e),localSightings:e=>F("LocalSightings",e),footfall:(e,t,n)=>F("Footfall",e,t,n),sites:()=>F("Sites"),visitorHistory:(e,t)=>F("VisitorHistory",e,t),visitorPhoto:e=>F("VisitorPhoto",e),forgetCustomer:e=>F("ForgetCustomer",e),sales:(e,t)=>F("Sales",e,t),customers:(e,t)=>F("Customers",e,t),saveProfile:e=>F("SaveProfile",e),recordPurchase:(e,t,n,r)=>F("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,s]=P.useState(null),[u,a]=P.useState(!0),c=P.useRef(!0),h=P.useRef(!1),v=P.useCallback(async()=>{if(!h.current){h.current=!0;try{const m=await e();if(!c.current)return;l(m),s(null)}catch(m){c.current&&s(Te(m))}finally{h.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 eu(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"})}const ei={width:18,height:18,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.6,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",focusable:"false"};function ge({size:e,children:t,...n}){return o.jsx("svg",{...ei,...n,width:e??ei.width,height:e??ei.height,children:t})}const bf=e=>o.jsxs(ge,{...e,children:[o.jsx("circle",{cx:"12",cy:"12",r:"3.2"}),o.jsx("path",{d:"M5.6 5.6a9 9 0 0 0 0 12.8M18.4 18.4a9 9 0 0 0 0-12.8"})]}),ep=e=>o.jsxs(ge,{...e,children:[o.jsx("circle",{cx:"9",cy:"8.5",r:"3.2"}),o.jsx("path",{d:"M2.8 19.5a6.4 6.4 0 0 1 12.4 0"}),o.jsx("path",{d:"M16.5 6.2a3.2 3.2 0 0 1 0 6.1M18 19.5a6 6 0 0 0-1.6-4"})]}),gc=e=>o.jsxs(ge,{...e,children:[o.jsx("path",{d:"M3 8.5h3.4L8 6h8l1.6 2.5H21v10.2H3z"}),o.jsx("circle",{cx:"12",cy:"13.2",r:"3.1"})]}),tp=e=>o.jsx(ge,{...e,children:o.jsx("path",{d:"M8 5.6v12.8L18.5 12z"})}),np=e=>o.jsx(ge,{...e,children:o.jsx("rect",{x:"7",y:"7",width:"10",height:"10",rx:"1.6"})}),Nl=e=>o.jsxs(ge,{...e,children:[o.jsx("path",{d:"M12 4.6 21 19.4H3z"}),o.jsx("path",{d:"M12 10v4.1"}),o.jsx("path",{d:"M12 17.1v.01"})]}),tu=e=>o.jsx(ge,{...e,children:o.jsx("path",{d:"M5 19.4v-4.2M10.3 19.4v-7.6M15.7 19.4v-11M21 19.4V4.6"})}),rp=e=>o.jsx(ge,{...e,children:o.jsx("path",{d:"M7.2 18.4a4.2 4.2 0 0 1-.6-8.35A6.2 6.2 0 0 1 18.4 9a4.2 4.2 0 0 1 .3 9.4z"})}),lp=e=>o.jsxs(ge,{...e,children:[o.jsx("path",{d:"M7.2 18.4a4.2 4.2 0 0 1-.6-8.35 6.2 6.2 0 0 1 2-3.2M10.6 5.2A6.2 6.2 0 0 1 18.4 9a4.2 4.2 0 0 1 1.9 7.6"}),o.jsx("path",{d:"M3.6 3.6l16.8 16.8"})]}),Xi=e=>o.jsx(ge,{...e,children:o.jsx("path",{d:"M12 3.8 19.4 6.6v5.2c0 4.2-3 7.4-7.4 8.4-4.4-1-7.4-4.2-7.4-8.4V6.6z"})}),yc=e=>o.jsxs(ge,{...e,children:[o.jsx("path",{d:"M10.2 13.8a3.6 3.6 0 0 0 5.2 0l2.8-2.8a3.7 3.7 0 0 0-5.2-5.2l-1.3 1.3"}),o.jsx("path",{d:"M13.8 10.2a3.6 3.6 0 0 0-5.2 0l-2.8 2.8a3.7 3.7 0 0 0 5.2 5.2l1.3-1.3"})]}),ip=e=>o.jsxs(ge,{...e,children:[o.jsx("path",{d:"M14.4 7.6V5.4H4.6v13.2h9.8v-2.2"}),o.jsx("path",{d:"M10 12h9.4M16.4 8.8 19.8 12l-3.4 3.2"})]}),sp=e=>o.jsxs(ge,{...e,strokeWidth:"1.2",children:[o.jsx("path",{d:"M3 8.5h3.4L8 6h8l1.6 2.5H21v10.2H3z"}),o.jsx("circle",{cx:"12",cy:"13.2",r:"3.1"}),o.jsx("path",{d:"M3.6 3.6l16.8 16.8"})]}),op=e=>o.jsxs(ge,{...e,strokeWidth:"1.2",children:[o.jsx("circle",{cx:"12",cy:"9",r:"3.4"}),o.jsx("path",{d:"M5.4 20a6.8 6.8 0 0 1 13.2 0"})]});function up({onDone:e}){const[t,n]=P.useState(""),[r,l]=P.useState(""),[i,s]=P.useState(!1),[u,a]=P.useState(null);async function c(h){h.preventDefault(),s(!0),a(null);try{e(await A.login(t.trim(),r))}catch(v){a(Te(v))}finally{s(!1)}}return o.jsx("div",{className:"login",children:o.jsxs("div",{className:"box",children:[o.jsx("span",{className:"mark",children:o.jsx(Xi,{size:20})}),o.jsx("h1",{children:"Behavision"}),o.jsx("p",{className:"lead",children:"Sign in to connect this PC to your store."}),o.jsxs("form",{onSubmit:c,children:[u&&o.jsxs("div",{className:"err",children:[o.jsx(Nl,{size:15}),u]}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:"Email"}),o.jsx("input",{type:"email",value:t,autoComplete:"username",required:!0,autoFocus:!0,onChange:h=>n(h.target.value)})]}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:"Password"}),o.jsx("input",{type:"password",value:r,autoComplete:"current-password",required:!0,onChange:h=>l(h.target.value)})]}),o.jsx("button",{className:"btn primary",disabled:i||!t||!r,children:i?"Signing in…":"Sign in"})]}),o.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 nu({onDone:e,onCancel:t}){const[n,r]=P.useState(""),[l,i]=P.useState(null),[s,u]=P.useState(null),[a,c]=P.useState(!1);async function h(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 o.jsx("div",{className:"login",children:o.jsxs("div",{className:"box",children:[o.jsx("span",{className:"mark",children:o.jsx(yc,{size:20})}),o.jsx("h1",{children:t?"Link to head office":"Set up this PC"}),o.jsx("p",{className:"lead",children:"Type the installation code for this shop. You only do this once."}),o.jsxs("form",{onSubmit:h,children:[s&&o.jsxs("div",{className:"err",children:[o.jsx(Nl,{size:15}),s]}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:"Installation code"}),o.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)})]}),o.jsx("button",{className:"btn primary",disabled:!!l||n.trim().length<6,children:l==="claim"?"Linking…":"Link this PC"})]}),o.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."}),o.jsx("div",{className:"alt",children:t?o.jsx("button",{type:"button",className:"linkbtn",onClick:t,children:"Not now — go back"}):a?o.jsxs(o.Fragment,{children:[o.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."}),o.jsx("button",{type:"button",className:"btn",disabled:!!l,onClick:v,children:l==="alone"?"Setting up…":"Use this PC on its own"})]}):o.jsx("button",{type:"button",className:"linkbtn",onClick:()=>c(!0),children:"No head office — set this PC up on its own"})})]})})}function xc(){var v,m;const{data:e,error:t}=Dt(()=>A.live(),3e3),{data:n}=Dt(()=>A.pipelineStatus(),5e3),r=pp(),l=((v=e==null?void 0:e.stats)==null?void 0:v.cameras)??[],i=((m=e==null?void 0:e.stats)==null?void 0:m.gallery)??{},s=(e==null?void 0:e.events)??[],u=l.reduce((g,w)=>{var D,p;const S=(p=(D=w==null?void 0:w.pipeline)==null?void 0:D.best_quality)==null?void 0:p.fraction_below_gate;return typeof S=="number"&&S>g?S:g},0),a=l.filter(g=>g.connected).length,c=s.filter(g=>g.type==="person.new"||g.type==="person.seen"),h=fp(c[0]);return o.jsxs("div",{className:"page",children:[o.jsxs("header",{children:[o.jsx("h2",{children:"Live"}),o.jsx("p",{children:"Who is in the shop, what the cameras see, and whether any of it is reaching head office."})]}),t&&o.jsxs("div",{className:"err",children:[o.jsx(Nl,{size:15}),t]}),o.jsx(dp,{pipe:n,cameras:l,up:a}),o.jsxs("div",{className:"live-split",children:[o.jsxs("div",{className:"panel",children:[o.jsxs("div",{className:"panelhead",children:[o.jsx("h3",{children:"Cameras"}),l.length>0&&o.jsxs("span",{className:"pill",children:[a," of ",l.length," live"]})]}),o.jsx("div",{className:"panelbody flush",children:l.length===0?o.jsxs("div",{className:"empty",children:[o.jsx(sp,{size:34}),o.jsx("b",{children:"No cameras yet"}),o.jsx("p",{children:"Add one on the Cameras screen. You will need its address on the shop network and its password."})]}):o.jsx("div",{className:"feeds",children:l.map(g=>o.jsxs("figure",{className:"feed",children:[r[g.camera_id]?o.jsx("img",{src:r[g.camera_id],alt:`Live view from ${g.camera_id}`}):o.jsx("div",{className:"placeholder",children:o.jsx(gc,{size:26})}),o.jsxs("figcaption",{className:"cap",children:[o.jsx("span",{children:g.camera_id}),o.jsxs("span",{className:`pill ${g.connected?"ok":"bad"}`,children:[o.jsx("i",{className:`dot ${g.connected?"live":"bad"}`}),g.connected?"live":"offline"]})]})]},g.camera_id))})})]}),o.jsxs("div",{className:"panel",children:[o.jsxs("div",{className:"panelhead",children:[o.jsx("h3",{children:"Who just walked in"}),c.length>0&&o.jsxs("span",{className:"note",children:[c.length," today"]})]}),o.jsx("div",{className:"panelbody flush",children:c.length===0?o.jsxs("div",{className:"empty",children:[o.jsx(op,{size:34}),o.jsx("b",{children:"Nobody yet"}),o.jsx("p",{children:"Customers appear here the moment a camera recognises a face."})]}):o.jsx("div",{className:"arrivals",children:c.slice(0,12).map((g,w)=>o.jsx(ap,{e:g,fresh:w===0&&h},`${g.ts}-${w}`))})})]})]}),o.jsxs("div",{className:"metrics",style:{marginTop:"var(--sp-4)"},children:[o.jsx(Nr,{k:"People known",v:i.identities??"—"}),o.jsx(Nr,{k:"Sightings",v:i.sightings??"—"}),o.jsx(Nr,{k:"Cameras live",v:l.length?`${a}/${l.length}`:"—",tone:l.length?a===0?"bad":a.5?"bad":u>.2?"warn":"ok",s:u>.5?"Most visitors are being missed — move the camera":"Share of faces below the enrolment gate"})]})]})}function ap({e,fresh:t}){var s,u,a,c,h,v;const n=e.type==="person.new",r=((s=e.data)==null?void 0:s.label)||"Unrecognised",l=[(u=e.data)==null?void 0:u.gender,((a=e.data)==null?void 0:a.age)??((c=e.data)==null?void 0:c.age_range),(h=e.data)==null?void 0:h.emotion].filter(Boolean),i=typeof((v=e.data)==null?void 0:v.similarity)=="number"?e.data.similarity:null;return o.jsxs("article",{className:`arrival ${n?"is-new":"is-seen"} ${t?"fresh":""}`,children:[o.jsx("div",{className:"avatar",children:cp(r)}),o.jsxs("div",{className:"who",children:[o.jsx("div",{className:"name",children:r}),o.jsxs("div",{className:"meta",children:[e.camera_id,l.length>0&&o.jsxs(o.Fragment,{children:[" · ",l.join(", ")]}),i!==null&&!n&&o.jsxs(o.Fragment,{children:[" · match ",i.toFixed(2)]})]})]}),o.jsxs("div",{className:"right",children:[o.jsx("span",{className:`tag ${n?"new":"seen"}`,children:n?"new":"returning"}),o.jsx("span",{className:"when",children:qf(e.ts)})]})]})}function cp(e){var r;const t=/^Visitor (\d+)$/.exec(String(e).trim());if(t)return t[1];const n=String(e).trim().split(/\s+/).filter(Boolean);return n.length?(n[0][0]+(((r=n[1])==null?void 0:r[0])??"")).toUpperCase():"?"}function dp({pipe:e,cameras:t,up:n}){if(!e)return null;if(e.standalone)return o.jsxs("div",{className:"statusbar",children:[o.jsxs("span",{className:"item",children:[o.jsx("i",{className:"dot ok"}),o.jsx("b",{children:"Running on this PC only"})]}),o.jsx("span",{className:"sep"}),o.jsx("span",{className:"item note",children:"Recognition and customers stay here."}),o.jsx("span",{className:"grow"}),o.jsxs("span",{className:"item note",children:[o.jsx(tu,{size:14}),n," of ",t.length," cameras"]})]});const r=e.claimed&&!e.broker_up,l=e.claimed?e.broker_up?"ok":"bad":"idle",i=e.claimed?e.broker_up?"Sending to head office":"Offline — saving locally":"Not linked to head office";return o.jsxs("div",{className:"statusbar",children:[o.jsxs("span",{className:"item",children:[e.broker_up?o.jsx(rp,{size:15}):o.jsx(lp,{size:15}),o.jsx("i",{className:`dot ${l}`}),o.jsx("b",{children:i})]}),o.jsx("span",{className:"sep"}),o.jsxs("span",{className:"item note",children:[e.accepted," recorded today"]}),e.queued>0&&o.jsxs("span",{className:`item note ${r?"warn":""}`,children:[e.queued," waiting to send"]}),e.dropped>0&&o.jsxs("span",{className:"item note bad",children:[o.jsx(Nl,{size:14}),e.dropped," lost — this PC was offline too long"]}),o.jsx("span",{className:"grow"}),o.jsxs("span",{className:"item note",children:[o.jsx(tu,{size:14}),n," of ",t.length," cameras"]})]})}function Nr({k:e,v:t,s:n,tone:r}){return o.jsxs("div",{className:`metric ${r??""}`,children:[o.jsx("div",{className:"metric-k",children:e}),o.jsx("div",{className:"metric-v",children:t}),n&&o.jsx("div",{className:"metric-s",children:n})]})}function fp(e){const[t,n]=P.useState(!1),r=P.useRef(null);return P.useEffect(()=>{if(!e||e.ts===r.current)return;const l=r.current===null;if(r.current=e.ts,l)return;n(!0);const i=setTimeout(()=>n(!1),1200);return()=>clearTimeout(i)},[e==null?void 0:e.ts]),t}function pp(){const[e,t]=P.useState({}),{data:n}=Dt(()=>A.cameras(),1e4);return P.useEffect(()=>{let r=!1;return(async()=>{const l={};for(const s of n??[]){if(e[s.id]){l[s.id]=e[s.id];continue}try{l[s.id]=await A.streamURL(s.id)}catch{}}const i=Object.keys(l).length!==Object.keys(e).length||Object.keys(l).some(s=>l[s]!==e[s]);!r&&i&&t(l)})(),()=>{r=!0}},[n]),e}function hp(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 mp({photo:e,name:t,customerRef:n,onBroken:r}){return e!=null&&e.available?o.jsx("img",{className:"avatar",src:e.url,alt:`Photo of ${t}`,onError:r}):o.jsx("div",{className:"avatar none",role:"img","aria-label":`No photo of ${t}`,children:o.jsx("span",{children:vp(t,n)})})}function vp(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 gp({customer:e}){const{data:t,error:n,loading:r}=Dt(()=>A.visitorHistory(e.id,50),0,[e.id]);if(r)return o.jsx("p",{className:"note",children:"Loading visits…"});if(n)return o.jsxs("p",{className:"note",children:["Could not load visits: ",n]});const l=t??[];return l.length===0?o.jsx("p",{className:"note",children:"No recorded visits yet."}):o.jsx("ul",{className:"timeline",children:l.map(i=>o.jsxs("li",{children:[o.jsx("span",{className:"when",children:yp(i.occurred_at)}),o.jsxs("span",{className:"where",children:[i.site||"this store",i.camera_id?o.jsxs("span",{className:"note",children:[" · ",i.camera_id]}):null]}),i.is_new_visitor&&o.jsx("span",{className:"tag new",children:"first visit"})]},i.id))})}function yp(e){const t=new Date(e);return isNaN(t)?"—":t.toLocaleString([],{day:"numeric",month:"short",hour:"2-digit",minute:"2-digit"})}function xp({customer:e,onCancel:t,onDone:n}){const r=e.full_name||e.label,[l,i]=P.useState(""),[s,u]=P.useState(!1),[a,c]=P.useState(null),h=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 o.jsxs("div",{className:"confirm",children:[o.jsxs("h4",{children:["Erase ",r,"?"]}),o.jsxs("div",{className:"cols",children:[o.jsxs("div",{children:[o.jsx("p",{className:"lbl bad",children:"Deleted for good"}),o.jsxs("ul",{children:[o.jsx("li",{children:"Their face data — they will not be recognised again"}),o.jsx("li",{children:"Their photo"}),o.jsx("li",{children:"Their name, phone, email and notes"})]})]}),o.jsxs("div",{children:[o.jsx("p",{className:"lbl",children:"Kept"}),o.jsxs("ul",{children:[o.jsx("li",{children:"Past visits, with their name removed — your footfall figures do not change"}),o.jsx("li",{children:"The consent record, marked withdrawn, as proof of what was agreed"})]})]})]}),o.jsx("p",{className:"note",children:"This cannot be undone. If they come back they will be recorded as a new customer."}),a&&o.jsx("div",{className:"err",children:a}),o.jsxs("label",{className:"field",children:[o.jsxs("span",{children:["Type ",o.jsx("b",{children:r})," to confirm"]}),o.jsx("input",{value:l,onChange:m=>i(m.target.value),autoFocus:!0,autoComplete:"off",spellCheck:"false","aria-label":`Type ${r} to confirm erasure`})]}),o.jsxs("div",{className:"row",children:[o.jsx("button",{type:"button",className:"btn danger",disabled:!h||s,onClick:v,children:s?"Erasing…":"Erase permanently"}),o.jsx("button",{type:"button",className:"btn",onClick:t,disabled:s,children:"Cancel"})]})]})}function wp({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}),[s,u]=P.useState({amount:"",items:"",notes:""}),[a,c]=P.useState(!1),[h,v]=P.useState(null),[m,g]=P.useState(!1),[w,S]=P.useState(null),D=hp(e.id),p=w??D,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 k(j){j.preventDefault(),c(!0),v(null);try{await A.saveProfile({visitor_id:e.id,...l});const E=parseFloat(s.amount);if(!isNaN(E)&&E>0){const V=s.items.split(",").map(L=>L.trim()).filter(Boolean);await A.recordPurchase(e.id,E,V,s.notes)}r()}catch(E){v(Te(E))}finally{c(!1)}}return o.jsx("div",{className:"drawer",onMouseDown:j=>j.target===j.currentTarget&&n(),children:o.jsxs("div",{className:"panel",children:[o.jsxs("div",{className:"who",children:[o.jsx(mp,{photo:p,name:e.full_name||e.label,customerRef:e.ref,onBroken:()=>S({available:!1,reason:"The photo could not be loaded."})}),o.jsxs("div",{className:"grow",children:[o.jsx("h3",{children:e.full_name||e.label}),o.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()}`]}),p&&!p.available&&p.reason&&o.jsx("p",{className:"note",children:p.reason})]}),o.jsx("button",{type:"button",className:"btn sm",onClick:n,children:"Close"})]}),o.jsxs("form",{onSubmit:k,children:[h&&o.jsx("div",{className:"err",children:h}),o.jsxs("div",{className:"card",style:{marginBottom:14},children:[o.jsx("h3",{children:"Customer details"}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:"Full name"}),o.jsx("input",{value:l.full_name,onChange:y("full_name"),autoFocus:!0})]}),o.jsxs("div",{className:"fieldrow",children:[o.jsxs("label",{className:"field",children:[o.jsx("span",{children:"Phone"}),o.jsx("input",{value:l.phone,onChange:y("phone"),inputMode:"tel"})]}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:"Email"}),o.jsx("input",{value:l.email,onChange:y("email"),type:"email"})]})]}),o.jsxs("div",{className:"fieldrow",children:[o.jsxs("label",{className:"field",children:[o.jsx("span",{children:"Gender"}),o.jsxs("select",{value:l.gender,onChange:y("gender"),children:[o.jsx("option",{value:"",children:"Not recorded"}),o.jsx("option",{children:"Female"}),o.jsx("option",{children:"Male"}),o.jsx("option",{children:"Other"})]})]}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:"Date of birth"}),o.jsx("input",{type:"date",value:l.date_of_birth,onChange:y("date_of_birth")})]})]}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:"Notes"}),o.jsx("textarea",{value:l.notes,onChange:y("notes"),placeholder:"Preferences, sizes, anything worth remembering"})]})]}),o.jsxs("div",{className:"card",style:{marginBottom:14},children:[o.jsx("h3",{children:"Purchase (optional)"}),o.jsxs("div",{className:"fieldrow",children:[o.jsxs("label",{className:"field",children:[o.jsx("span",{children:"Amount"}),o.jsx("input",{value:s.amount,inputMode:"decimal",placeholder:"0.00",onChange:j=>u({...s,amount:j.target.value})})]}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:"Items"}),o.jsx("input",{value:s.items,placeholder:"shirt, belt",onChange:j=>u({...s,items:j.target.value})})]})]}),o.jsx("p",{className:"note",children:"Leave the amount blank if they did not buy anything — a visit without a sale is still worth recording."})]}),o.jsxs("div",{className:"card",style:{marginBottom:16},children:[o.jsx("h3",{children:"Consent"}),o.jsxs("label",{style:{display:"flex",gap:10,alignItems:"flex-start",fontSize:13,cursor:"pointer"},children:[o.jsx("input",{type:"checkbox",checked:l.consent,style:{marginTop:3},onChange:j=>i({...l,consent:j.target.checked})}),o.jsx("span",{children:"This customer agreed to us keeping their details and recognising them on future visits."})]}),o.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."})]}),o.jsxs("div",{className:"card",style:{marginBottom:14},children:[o.jsx("h3",{children:"Visits"}),o.jsx(gp,{customer:e})]}),o.jsxs("div",{style:{display:"flex",gap:8},children:[o.jsx("button",{className:"btn primary",disabled:a,children:a?"Saving…":"Save"}),o.jsx("button",{type:"button",className:"btn",onClick:n,children:"Cancel"})]}),f&&o.jsxs("div",{className:"card danger-zone",children:[o.jsx("h3",{children:"At the customer's request"}),m?o.jsx(xp,{customer:e,onCancel:()=>g(!1),onDone:r}):o.jsxs(o.Fragment,{children:[o.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."}),o.jsx("button",{type:"button",className:"btn danger",onClick:()=>g(!0),children:"Erase this customer…"})]})]})]})]})})}function Sp({session:e}){const[t,n]=P.useState(""),[r,l]=P.useState(null),{data:i,error:s,reload:u}=Dt(()=>A.customers(t,200),3e4,[t]),a=i??[],c=a.filter(h=>h.has_profile).length;return o.jsxs("div",{className:"page",children:[o.jsxs("header",{children:[o.jsx("h2",{children:"Customers"}),o.jsx("p",{children:"Everyone this business has recognised. Fill in details once and they are known at every store."})]}),s&&o.jsx("div",{className:"err",children:s}),o.jsxs("div",{className:"grid cols-4",style:{marginBottom:16},children:[o.jsx(Cr,{label:"Known people",value:a.length||"—"}),o.jsx(Cr,{label:"With details",value:c||"—",sub:a.length?`${Math.round(100*c/a.length)}% captured`:null}),o.jsx(Cr,{label:"Returning",value:a.filter(h=>h.visit_count>1).length||"—"}),o.jsx(Cr,{label:"With consent",value:a.filter(h=>h.has_consent).length||"—"})]}),o.jsxs("div",{className:"card",children:[o.jsxs("div",{style:{display:"flex",gap:10,marginBottom:12},children:[o.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:h=>n(h.target.value)}),o.jsx("button",{className:"btn",onClick:u,children:"Refresh"})]}),a.length===0?o.jsx("div",{className:"empty",children:"No customers yet. They appear here the first time a camera sees them."}):o.jsx("div",{className:"tablewrap",children:o.jsxs("table",{children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Customer"}),o.jsx("th",{children:"Phone"}),o.jsx("th",{className:"num",children:"Visits"}),o.jsx("th",{children:"First seen"}),o.jsx("th",{children:"Last seen"}),o.jsx("th",{children:"Details"})]})}),o.jsx("tbody",{children:a.map(h=>o.jsxs("tr",{className:"click",onClick:()=>l(h),children:[o.jsxs("td",{children:[h.full_name||o.jsx("span",{className:"note",children:h.label}),h.full_name&&h.ref&&o.jsxs("span",{className:"note",children:[" · ",h.ref]})]}),o.jsx("td",{className:"mono",children:h.phone||"—"}),o.jsx("td",{className:"num",children:h.visit_count}),o.jsx("td",{children:eu(h.first_seen_at)}),o.jsx("td",{children:eu(h.last_seen_at)}),o.jsx("td",{children:h.has_profile?o.jsxs("span",{className:"pill ok",children:[o.jsx("i",{className:"dot ok"}),"captured"]}):o.jsxs("span",{className:"pill warn",children:[o.jsx("i",{className:"dot warn"}),"needed"]})})]},h.id))})]})})]}),r&&o.jsx(wp,{customer:r,session:e,onClose:()=>l(null),onSaved:()=>{l(null),u()}})]})}function Cr({label:e,value:t,sub:n}){return o.jsxs("div",{className:"card stat",children:[o.jsx("h3",{children:e}),o.jsx("div",{className:"value",children:t}),n&&o.jsx("div",{className:"sub",children:n})]})}const nn=[{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:""}],ti=e=>nn.find(t=>t.id===e)||nn[nn.length-1],wc={id:"",host:"",port:554,path:"",username:"",password:"",max_width:1280};function kp(){const{data:e,error:t,reload:n}=Dt(()=>A.cameras(),8e3),[r,l]=P.useState(null),[i,s]=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(h){alert(Te(h))}}return o.jsxs("div",{className:"page",children:[o.jsxs("header",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-end"},children:[o.jsxs("div",{children:[o.jsx("h2",{children:"Cameras"}),o.jsx("p",{children:"Add a camera, check it can see faces properly, then it starts working."})]}),o.jsx("button",{className:"btn primary",onClick:()=>l({...wc}),children:"Add camera"})]}),t&&o.jsx("div",{className:"err",children:t}),o.jsx("div",{className:"card",children:u.length===0?o.jsx("div",{className:"empty",children:"No cameras yet."}):o.jsx("div",{className:"tablewrap",children:o.jsxs("table",{children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Name"}),o.jsx("th",{children:"Address"}),o.jsx("th",{children:"Status"}),o.jsx("th",{})]})}),o.jsx("tbody",{children:u.map(c=>o.jsxs("tr",{children:[o.jsx("td",{children:c.id}),o.jsx("td",{className:"mono",children:c.url}),o.jsx("td",{children:c.connected===void 0?o.jsxs("span",{className:"pill",children:[o.jsx("i",{className:"dot idle"}),"stopped"]}):c.connected?o.jsxs("span",{className:"pill ok",children:[o.jsx("i",{className:"dot ok"}),"live"]}):o.jsxs("span",{className:"pill bad",children:[o.jsx("i",{className:"dot bad"}),"offline"]})}),o.jsxs("td",{style:{textAlign:"right",whiteSpace:"nowrap"},children:[o.jsx("button",{className:"btn sm",onClick:()=>s(c.id),children:"Check placement"})," ",o.jsx("button",{className:"btn sm",onClick:()=>l(c),children:"Edit"})," ",o.jsx("button",{className:"btn sm danger",onClick:()=>a(c.id),children:"Remove"})]})]},c.id))})]})})}),r&&o.jsx(jp,{cam:r,onClose:()=>l(null),onSaved:()=>{l(null),n()}}),i&&o.jsx(Np,{id:i,onClose:()=>s(null)})]})}function jp({cam:e,onClose:t,onSaved:n}){const r=!e.id,[l,i]=P.useState({...wc,...e,password:"",path:e.path||(r?nn[0].path:"")}),[s,u]=P.useState(r?nn[0].id:"manual"),[a,c]=P.useState(null),[h,v]=P.useState(null),[m,g]=P.useState(null),w=f=>y=>i({...l,[f]:y.target.value});function S(f){const y=ti(f.target.value);u(y.id),i(k=>({...k,path:y.path||k.path}))}function D(){const f={};for(const[y,k]of Object.entries(l))k===""||k===null||k===void 0||(f[y]=y==="port"||y==="max_width"?Number(k):k);return f}async function p(){v("test"),g(null),c(null);try{c(await A.testCamera(D()))}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,D()),n()}catch(y){g(Te(y))}finally{v(null)}}return o.jsx("div",{className:"drawer",onMouseDown:f=>f.target===f.currentTarget&&t(),children:o.jsxs("div",{className:"panel",children:[o.jsx("button",{className:"btn sm close",onClick:t,children:"Close"}),o.jsx("h3",{children:r?"Add camera":e.id}),o.jsx("p",{className:"note",style:{marginBottom:18},children:"Test the connection before saving — a wrong address is the most common mistake."}),o.jsxs("form",{onSubmit:d,children:[m&&o.jsx("div",{className:"err",children:m}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:"Name"}),o.jsx("input",{value:l.id,onChange:w("id"),disabled:!r,placeholder:"entrance",required:!0,autoComplete:"off"})]}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:"Make of camera"}),o.jsx("select",{value:s,onChange:S,children:nn.map(f=>o.jsx("option",{value:f.id,children:f.label},f.id))})]}),ti(s).note&&o.jsx("p",{className:"note",style:{marginTop:-8,marginBottom:12},children:ti(s).note}),o.jsxs("div",{className:"fieldrow",children:[o.jsxs("label",{className:"field",children:[o.jsx("span",{children:"Camera address"}),o.jsx("input",{value:l.host,onChange:w("host"),placeholder:"192.168.0.138",autoComplete:"off"})]}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:"Port"}),o.jsx("input",{value:l.port,onChange:w("port"),inputMode:"numeric",autoComplete:"off"})]})]}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:"Stream path"}),o.jsx("input",{value:l.path,onChange:w("path"),placeholder:"/ch0_0.264",autoComplete:"off"})]}),o.jsxs("div",{className:"fieldrow",children:[o.jsxs("label",{className:"field",children:[o.jsx("span",{children:"Username"}),o.jsx("input",{value:l.username,onChange:w("username"),name:"camera-account",autoComplete:"off"})]}),o.jsxs("label",{className:"field",children:[o.jsx("span",{children:"Password"}),o.jsx("input",{type:"password",value:l.password,onChange:w("password"),name:"camera-secret",autoComplete:"new-password",placeholder:e.has_password?"(unchanged)":""})]})]}),o.jsxs("div",{style:{display:"flex",gap:8,marginTop:4},children:[o.jsx("button",{type:"button",className:"btn",onClick:p,disabled:!!h,children:h==="test"?"Connecting…":"Test connection"}),o.jsx("button",{className:"btn primary",disabled:!!h||!l.id,children:h==="save"?"Saving…":"Save"})]}),a&&o.jsx("div",{style:{marginTop:14},children:a.ok?o.jsxs(o.Fragment,{children:[o.jsxs("p",{style:{color:"var(--ok)",fontSize:13},children:["Connected — ",a.width,"×",a.height]}),a.snapshot&&o.jsx("img",{alt:"Camera preview",style:{width:"100%",marginTop:8,borderRadius:6,border:"1px solid var(--line)"},src:`data:image/jpeg;base64,${a.snapshot}`})]}):o.jsx("div",{className:"err",children:a.error})})]})]})})}function Np({id:e,onClose:t}){var c,h;const[n,r]=P.useState({verdict:"starting",advice:[]}),[l,i]=P.useState(null),s=P.useRef(null);P.useEffect(()=>{let v=!0;return(async()=>{try{r(await A.startPlacement(e,25)),s.current=setInterval(async()=>{try{const m=await A.placementResult(e);if(!v)return;r(m),m.running||clearInterval(s.current)}catch(m){v&&i(Te(m))}},1e3)}catch(m){v&&i(Te(m))}})(),()=>{v=!1,clearInterval(s.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 o.jsx("div",{className:"drawer",onMouseDown:v=>v.target===v.currentTarget&&t(),children:o.jsxs("div",{className:"panel",children:[o.jsx("button",{className:"btn sm close",onClick:t,children:"Close"}),o.jsxs("h3",{children:["Placement check — ",e]}),o.jsx("p",{className:"note",style:{marginBottom:18},children:"Walk past the camera the way a customer would, a few times."}),l&&o.jsx("div",{className:"err",children:l}),o.jsxs("div",{className:"card",children:[o.jsx("div",{style:{fontSize:15,fontWeight:600,color:u?`var(--${u})`:"var(--ink)"},children:n.headline||"Starting…"}),n.running&&o.jsx("div",{style:{height:5,background:"var(--surface-2)",borderRadius:3,overflow:"hidden",margin:"12px 0"},children:o.jsx("div",{style:{height:"100%",width:`${a}%`,background:"var(--accent)",transition:"width .4s linear"}})}),((c=n.advice)==null?void 0:c.length)>0&&o.jsx("ul",{style:{margin:"12px 0 0 18px",fontSize:13,color:"var(--ink-2)"},children:n.advice.map((v,m)=>o.jsx("li",{style:{marginBottom:5},children:v},m))}),((h=n.quality)==null?void 0:h.n)>0&&o.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 Cp=[{id:"live",label:"Live",Glyph:bf,View:xc},{id:"customers",label:"Customers",Glyph:ep,View:Sp,cloud:!0},{id:"cameras",label:"Cameras",Glyph:gc,View:kp}];function Ep(){var h,v,m;const[e,t]=P.useState(null),[n,r]=P.useState("live"),[l,i]=P.useState(!0),[s,u]=P.useState(!1);if(P.useEffect(()=>{(async()=>{try{t(await A.session())}catch{t(null)}i(!1)})()},[]),!Jf())return o.jsx("div",{className:"login",children:o.jsxs("div",{className:"box",children:[o.jsx("span",{className:"mark",children:o.jsx(Xi,{size:20})}),o.jsx("h1",{children:"Behavision"}),o.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 o.jsx("div",{className:"login",children:o.jsx("p",{className:"note",children:"Starting…"})});if(!(e!=null&&e.claimed)&&!(e!=null&&e.standalone))return o.jsx(nu,{onDone:t});if(!(e!=null&&e.standalone)&&!(e!=null&&e.logged_in))return o.jsx(up,{onDone:t});const a=Cp.filter(g=>!g.cloud||!e.standalone),c=((h=a.find(g=>g.id===n))==null?void 0:h.View)??xc;return s?o.jsx(nu,{onDone:g=>{u(!1),t(g)},onCancel:()=>u(!1)}):o.jsxs("div",{className:"shell",children:[o.jsxs("aside",{className:"side",children:[o.jsxs("div",{className:"brand",children:[o.jsx("span",{className:"mark",children:o.jsx(Xi,{size:17})}),o.jsxs("div",{className:"id",children:[o.jsx("h1",{children:"Behavision"}),o.jsx("p",{children:e.site_name||((v=e.user)==null?void 0:v.client_name)||"This shop"})]})]}),o.jsx("nav",{className:"nav",children:a.map(({id:g,label:w,Glyph:S})=>o.jsxs("button",{onClick:()=>r(g),"aria-current":g===n?"page":void 0,children:[o.jsx(S,{size:17}),w]},g))}),o.jsx(_p,{}),o.jsx("div",{className:"who",children:e.standalone?o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"id",children:[o.jsx("b",{children:"On its own"}),o.jsx("span",{children:"No head office"})]}),o.jsx("button",{className:"btn sm icon",title:"Link to head office",onClick:()=>u(!0),children:o.jsx(yc,{size:15})})]}):o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"id",children:[o.jsx("b",{children:"Signed in"}),o.jsx("span",{children:(m=e.user)==null?void 0:m.email})]}),o.jsx("button",{className:"btn sm icon",title:"Sign out",onClick:async()=>t(await A.logout()),children:o.jsx(ip,{size:15})})]})})]}),o.jsx("main",{className:"main",children:o.jsx(c,{session:e})})]})}function _p(){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]),s=l.state==="running",u=Object.values(l.cameras??{}),a=u.filter(Boolean).length;let c="idle",h="Stopped";return!s&&l.reachable?(c="warn",h="Running outside the app"):l.state==="failed"||l.state==="backoff"?(c="bad",h="Not running"):s&&!l.reachable?(c="warn",h="Starting…"):s&&u.length===0?(c="warn",h="No cameras"):s&&a===0?(c="bad",h="No camera connected"):s&&ai(A.startEngine),children:[o.jsx(tp,{size:13}),"Start"]}),o.jsxs("button",{className:"btn sm",disabled:n||!s,onClick:()=>i(A.stopEngine),children:[o.jsx(np,{size:13}),"Stop"]})]})]})}mc(document.getElementById("root")).render(o.jsx($c.StrictMode,{children:o.jsx(Ep,{})})); diff --git a/desktop/frontend/dist/assets/index-XjqO50wd.css b/desktop/frontend/dist/assets/index-XjqO50wd.css deleted file mode 100644 index c31ea3a..0000000 --- a/desktop/frontend/dist/assets/index-XjqO50wd.css +++ /dev/null @@ -1 +0,0 @@ -:root{--ground: #0E1317;--surface: #161D23;--surface-2: #1D262D;--line: #27333B;--line-soft: #1F2A31;--ink: #E7EEF3;--ink-2: #B4C2CC;--muted: #7C8B97;--accent: #45B0C7;--accent-dim:#123039;--ok: #4FB37B;--warn: #E0A33A;--bad: #E0655A;--radius: 8px;--mono: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace}*{box-sizing:border-box;margin:0}html,body,#root{height:100%}body{background:var(--ground);color:var(--ink);font:14px/1.55 system-ui,-apple-system,Segoe UI,sans-serif;-webkit-font-smoothing:antialiased;overflow:hidden;-webkit-user-select:none;user-select:none}button,input,select,textarea{font:inherit;color:inherit}:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.shell{display:grid;grid-template-columns:216px 1fr;height:100%}.side{background:var(--surface);border-right:1px solid var(--line);display:flex;flex-direction:column;min-height:0}.side .brand{padding:18px 18px 14px;border-bottom:1px solid var(--line-soft)}.side .brand h1{font-size:15px;font-weight:650;letter-spacing:-.01em}.side .brand p{font-size:11.5px;color:var(--muted);margin-top:3px}.nav{padding:10px;display:flex;flex-direction:column;gap:2px;flex:1}.nav button{display:flex;align-items:center;gap:10px;width:100%;background:none;border:0;border-radius:6px;padding:8px 10px;color:var(--ink-2);cursor:pointer;text-align:left;font-size:13.5px}.nav button:hover{background:var(--surface-2);color:var(--ink)}.nav button[aria-current=page]{background:var(--accent-dim);color:var(--accent);font-weight:550}.nav .glyph{width:16px;text-align:center;opacity:.85;font-size:13px}.enginebox{padding:12px;border-top:1px solid var(--line-soft)}.enginebox .row{display:flex;align-items:center;gap:8px;font-size:12px}.enginebox .label{color:var(--muted);font-size:11px;margin-top:2px;display:block;line-height:1.4}.enginebox .actions{display:flex;gap:6px;margin-top:10px}.main{min-width:0;min-height:0;overflow-y:auto}.page{padding:22px 26px 40px;max-width:1180px}.page>header{margin-bottom:18px}.page h2{font-size:19px;font-weight:620;letter-spacing:-.01em}.page header p{color:var(--muted);font-size:13px;margin-top:3px}.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:16px}.card h3{font-size:12px;text-transform:uppercase;letter-spacing:.07em;color:var(--muted);font-weight:600;margin-bottom:12px}.grid{display:grid;gap:14px}.cols-4{grid-template-columns:repeat(auto-fit,minmax(190px,1fr))}.cols-2{grid-template-columns:repeat(auto-fit,minmax(320px,1fr))}.stat .value{font-size:30px;font-weight:620;letter-spacing:-.02em;font-variant-numeric:tabular-nums;line-height:1.1}.stat .unit{font-size:15px;color:var(--muted);margin-left:3px}.stat .sub{color:var(--muted);font-size:12px;margin-top:5px}.dot{width:8px;height:8px;border-radius:50%;flex:none}.dot.ok{background:var(--ok)}.dot.warn{background:var(--warn)}.dot.bad{background:var(--bad)}.dot.idle{background:var(--muted)}.pill{display:inline-flex;align-items:center;gap:5px;font-size:11px;padding:3px 8px;border-radius:99px;border:1px solid var(--line);color:var(--muted);white-space:nowrap}.pill.ok{color:var(--ok);border-color:#2b5c42;background:#12251b}.pill.warn{color:var(--warn);border-color:#5c4a22;background:#241d0f}.pill.bad{color:var(--bad);border-color:#5c2e2a;background:#241312}.btn{background:var(--surface-2);border:1px solid var(--line);border-radius:6px;padding:7px 13px;cursor:pointer;font-size:13px;color:var(--ink);white-space:nowrap}.btn:hover:not(:disabled){background:#26323a}.btn:disabled{opacity:.45;cursor:default}.btn.primary{background:var(--accent);border-color:var(--accent);color:#06222a;font-weight:600}.btn.primary:hover:not(:disabled){background:#5ac0d6}.btn.danger{color:var(--bad);border-color:#4a2823}.btn.sm{padding:4px 9px;font-size:12px}.field{display:block;margin-bottom:12px}.field span{display:block;font-size:11.5px;color:var(--muted);margin-bottom:4px;letter-spacing:.01em}.field input,.field select,.field textarea{width:100%;background:var(--ground);border:1px solid var(--line);border-radius:6px;padding:8px 10px;font-size:13.5px;-webkit-user-select:text;user-select:text}.field input:focus,.field select:focus,.field textarea:focus{border-color:var(--accent);outline:none}.field textarea{resize:vertical;min-height:66px}.fieldrow{display:grid;gap:0 12px;grid-template-columns:1fr 1fr}table{width:100%;border-collapse:collapse;font-size:13px}th{text-align:left;font-size:10.5px;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);font-weight:600;padding:8px 10px;border-bottom:1px solid var(--line)}td{padding:9px 10px;border-bottom:1px solid var(--line-soft);vertical-align:middle}tr:last-child td{border-bottom:0}tbody tr.click{cursor:pointer}tbody tr.click:hover{background:var(--surface-2)}td.num{font-variant-numeric:tabular-nums;text-align:right}.tablewrap{overflow-x:auto}.empty{color:var(--muted);font-size:13px;padding:26px 4px;text-align:center}.err{border:1px solid #5c2e2a;background:#241312;color:#f0b3ad;border-radius:6px;padding:10px 12px;font-size:13px;margin-bottom:14px}.note{color:var(--muted);font-size:12.5px}.mono{font-family:var(--mono);font-size:12px}.login{height:100%;display:grid;place-items:center;padding:24px}.login .box{width:100%;max-width:380px}.login h1{font-size:21px;font-weight:650;letter-spacing:-.015em}.login .lead{color:var(--muted);font-size:13px;margin:6px 0 22px}.login form{background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:20px}.login .btn{width:100%;margin-top:6px}.login .foot{color:var(--muted);font-size:11.5px;margin-top:14px;text-align:center;line-height:1.5}.login .alt{margin-top:18px;padding-top:16px;text-align:center;border-top:1px solid var(--line-soft)}.login .alt .note{line-height:1.55;margin-bottom:12px;text-align:left}.login .alt .btn{margin-top:0}.linkbtn{background:none;border:0;padding:0;cursor:pointer;font:inherit;font-size:12.5px;color:var(--accent);text-decoration:underline;text-underline-offset:3px}.linkbtn:hover{color:var(--ink)}.feeds{display:grid;gap:14px;grid-template-columns:repeat(auto-fit,minmax(300px,1fr))}.feed{background:#000;border:1px solid var(--line);border-radius:var(--radius);overflow:hidden}.feed img{width:100%;display:block;aspect-ratio:16/9;object-fit:cover;background:#000}.feed .cap{display:flex;justify-content:space-between;align-items:center;padding:8px 11px;background:var(--surface);font-size:12.5px}.events{list-style:none;max-height:420px;overflow-y:auto}.events li{display:flex;gap:9px;align-items:baseline;padding:7px 2px;border-bottom:1px solid var(--line-soft);font-size:12.5px}.events li:last-child{border-bottom:0}.events .when{color:var(--muted);font-family:var(--mono);font-size:11px;flex:none}.tag{font-size:10px;padding:2px 6px;border-radius:4px;flex:none;background:var(--surface-2);color:var(--muted)}.tag.new{background:#17364f;color:#86c2ec}.tag.seen{background:#14301f;color:#7fcb9c}.tag.miss{background:#3a1c1a;color:#eb9a92}.bars{display:flex;align-items:flex-end;gap:3px;height:150px;margin-top:4px}.bars .col{flex:1;display:flex;flex-direction:column;justify-content:flex-end;gap:2px;min-width:0}.bars .seg{border-radius:2px 2px 0 0}.bars .seg.ret{background:var(--accent)}.bars .seg.new{background:#2f6f81}.axis{display:flex;justify-content:space-between;color:var(--muted);font-size:10.5px;margin-top:6px;font-family:var(--mono)}.key{display:flex;gap:14px;font-size:11.5px;color:var(--muted);margin-top:10px}.key i{display:inline-block;width:9px;height:9px;border-radius:2px;margin-right:5px;vertical-align:-1px}.drawer{position:fixed;top:0;right:0;bottom:0;left:0;background:#04080a99;display:flex;justify-content:flex-end;z-index:30}.drawer .panel{width:min(480px,100%);height:100%;background:var(--surface);border-left:1px solid var(--line);overflow-y:auto;padding:20px 22px 40px}.drawer h3{font-size:16px;font-weight:620;text-transform:none;letter-spacing:-.01em;color:var(--ink);margin-bottom:2px}.who{position:sticky;top:-20px;z-index:1;display:flex;gap:14px;align-items:flex-start;background:var(--surface);margin:-20px -22px 18px;padding:20px 22px 14px;border-bottom:1px solid var(--line-soft)}.who .grow{flex:1;min-width:0}.who h3{margin-bottom:2px}.avatar{width:64px;height:64px;border-radius:10px;flex:none;object-fit:cover;background:var(--ground);border:1px solid var(--line)}.avatar.none{display:grid;place-items:center;color:var(--muted);font-size:20px;font-weight:600;letter-spacing:.02em}.timeline{list-style:none;max-height:220px;overflow-y:auto}.timeline li{display:flex;gap:10px;align-items:baseline;padding:6px 0;border-bottom:1px solid var(--line-soft);font-size:12.5px}.timeline li:last-child{border-bottom:0}.timeline .when{font-family:var(--mono);font-size:11px;color:var(--muted);flex:none;min-width:108px}.timeline .where{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.danger-zone{margin-top:22px;border-color:#4a2823}.danger-zone>h3{color:var(--bad)}.danger-zone .note{margin-bottom:10px}.confirm h4{font-size:13.5px;font-weight:620;margin-bottom:10px}.confirm .cols{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-bottom:12px}@media (max-width: 560px){.confirm .cols{grid-template-columns:1fr}}.confirm .lbl{font-size:11px;text-transform:uppercase;letter-spacing:.07em;color:var(--muted);margin-bottom:5px}.confirm .lbl.bad{color:var(--bad)}.confirm ul{list-style:none;font-size:12.5px}.confirm li{padding:3px 0 3px 12px;position:relative;color:var(--ink)}.confirm li:before{content:"·";position:absolute;left:2px;color:var(--muted)}.confirm .row{display:flex;gap:8px} diff --git a/desktop/frontend/dist/index.html b/desktop/frontend/dist/index.html index 090a716..306dda0 100644 --- a/desktop/frontend/dist/index.html +++ b/desktop/frontend/dist/index.html @@ -4,8 +4,8 @@ Behavision - - + +
diff --git a/desktop/frontend/src/App.jsx b/desktop/frontend/src/App.jsx index 12142cc..d326c80 100644 --- a/desktop/frontend/src/App.jsx +++ b/desktop/frontend/src/App.jsx @@ -1,6 +1,7 @@ import { useCallback, useEffect, useState } from 'react' import { api, isDesktop, message } from './bridge.js' import { usePolled } from './hooks.js' +import * as Icon from './ui/icons.jsx' import Login from './views/Login.jsx' import Setup from './views/Setup.jsx' import Live from './views/Live.jsx' @@ -22,9 +23,9 @@ import Cameras from './views/Cameras.jsx' // the customer record lives on the server, the cameras and what this PC is // seeing do not. const VIEWS = [ - { id: 'live', label: 'Live', glyph: '◉', View: Live }, - { id: 'customers', label: 'Customers', glyph: '☺', View: Customers, cloud: true }, - { id: 'cameras', label: 'Cameras', glyph: '▢', View: Cameras }, + { id: 'live', label: 'Live', Glyph: Icon.Live, View: Live }, + { id: 'customers', label: 'Customers', Glyph: Icon.People, View: Customers, cloud: true }, + { id: 'cameras', label: 'Cameras', Glyph: Icon.Camera, View: Cameras }, ] export default function App() { @@ -48,6 +49,7 @@ export default function App() { // error nobody will read. return (
+

Behavision

This is the Behavision window running outside the app, so it has no @@ -78,36 +80,41 @@ export default function App() {