417 lines
305 KiB
JavaScript
417 lines
305 KiB
JavaScript
|
|
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();function Af(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Qu={exports:{}},si={},qu={exports:{}},q={};/**
|
|||
|
|
* @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 Ur=Symbol.for("react.element"),Of=Symbol.for("react.portal"),Df=Symbol.for("react.fragment"),Lf=Symbol.for("react.strict_mode"),Ff=Symbol.for("react.profiler"),Bf=Symbol.for("react.provider"),If=Symbol.for("react.context"),Mf=Symbol.for("react.forward_ref"),Uf=Symbol.for("react.suspense"),$f=Symbol.for("react.memo"),Wf=Symbol.for("react.lazy"),ha=Symbol.iterator;function Hf(e){return e===null||typeof e!="object"?null:(e=ha&&e[ha]||e["@@iterator"],typeof e=="function"?e:null)}var Ku={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Yu=Object.assign,Xu={};function qn(e,t,n){this.props=e,this.context=t,this.refs=Xu,this.updater=n||Ku}qn.prototype.isReactComponent={};qn.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")};qn.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Gu(){}Gu.prototype=qn.prototype;function fs(e,t,n){this.props=e,this.context=t,this.refs=Xu,this.updater=n||Ku}var ps=fs.prototype=new Gu;ps.constructor=fs;Yu(ps,qn.prototype);ps.isPureReactComponent=!0;var ma=Array.isArray,Ju=Object.prototype.hasOwnProperty,hs={current:null},Zu={key:!0,ref:!0,__self:!0,__source:!0};function ec(e,t,n){var r,o={},i=null,l=null;if(t!=null)for(r in t.ref!==void 0&&(l=t.ref),t.key!==void 0&&(i=""+t.key),t)Ju.call(t,r)&&!Zu.hasOwnProperty(r)&&(o[r]=t[r]);var a=arguments.length-2;if(a===1)o.children=n;else if(1<a){for(var u=Array(a),c=0;c<a;c++)u[c]=arguments[c+2];o.children=u}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)o[r]===void 0&&(o[r]=a[r]);return{$$typeof:Ur,type:e,key:i,ref:l,props:o,_owner:hs.current}}function Vf(e,t){return{$$typeof:Ur,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function ms(e){return typeof e=="object"&&e!==null&&e.$$typeof===Ur}function Qf(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var ga=/\/+/g;function zi(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Qf(""+e.key):t.toString(36)}function wo(e,t,n,r,o){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var l=!1;if(e===null)l=!0;else switch(i){case"string":case"number":l=!0;break;case"object":switch(e.$$typeof){case Ur:case Of:l=!0}}if(l)return l=e,o=o(l),e=r===""?"."+zi(l,0):r,ma(o)?(n="",e!=null&&(n=e.replace(ga,"$&/")+"/"),wo(o,t,n,"",function(c){return c})):o!=null&&(ms(o)&&(o=Vf(o,n+(!o.key||l&&l.key===o.key?"":(""+o.key).replace(ga,"$&/")+"/")+e)),t.push(o)),1;if(l=0,r=r===""?".":r+":",ma(e))for(var a=0;a<e.length;a++){i=e[a];var u=r+zi(i,a);l+=wo(i,t,n,u,o)}else if(u=Hf(e),typeof u=="function")for(e=u.call(e),a=0;!(i=e.next()).done;)i=i.value,u=r+zi(i,a++),l+=wo(i,t,n,u,o);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return l}function Zr(e,t,n){if(e==null)return e;var r=[],o=0;return wo(e,r,"","",function(i){return t.call(n,i,o++)}),r}function qf(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var De={current:null},So={transition:null},Kf={ReactCurrentDispatcher:De,ReactCurrentBatchConfig:So,ReactCurrentOwner:hs};function tc(){throw Error("act(...) is not supported in production builds of React.")}q.Children={map:Zr,forEach:function(e,t,n){Zr(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Zr(e,function(){t++}),t},toArray:function(e){return Zr(e,function(t){return t})||[]},only:function(e){if(!ms(e))throw Error("React.Children.only expected to receive a sing
|
|||
|
|
* @license React
|
|||
|
|
* react-jsx-runtime.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 Xf=k,Gf=Symbol.for("react.element"),Jf=Symbol.for("react.fragment"),Zf=Object.prototype.hasOwnProperty,ep=Xf.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,tp={key:!0,ref:!0,__self:!0,__source:!0};function nc(e,t,n){var r,o={},i=null,l=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(l=t.ref);for(r in t)Zf.call(t,r)&&!tp.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:Gf,type:e,key:i,ref:l,props:o,_owner:ep.current}}si.Fragment=Jf;si.jsx=nc;si.jsxs=nc;Qu.exports=si;var s=Qu.exports,dl={},rc={exports:{}},Ge={},oc={exports:{}},ic={};/**
|
|||
|
|
* @license React
|
|||
|
|
* scheduler.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.
|
|||
|
|
*/(function(e){function t(z,B){var I=z.length;z.push(B);e:for(;0<I;){var K=I-1>>>1,le=z[K];if(0<o(le,B))z[K]=B,z[I]=le,I=K;else break e}}function n(z){return z.length===0?null:z[0]}function r(z){if(z.length===0)return null;var B=z[0],I=z.pop();if(I!==B){z[0]=I;e:for(var K=0,le=z.length,de=le>>>1;K<de;){var Ce=2*(K+1)-1,Fe=z[Ce],st=Ce+1,Be=z[st];if(0>o(Fe,I))st<le&&0>o(Be,Fe)?(z[K]=Be,z[st]=I,K=st):(z[K]=Fe,z[Ce]=I,K=Ce);else if(st<le&&0>o(Be,I))z[K]=Be,z[st]=I,K=st;else break e}}return B}function o(z,B){var I=z.sortIndex-B.sortIndex;return I!==0?I:z.id-B.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,a=l.now();e.unstable_now=function(){return l.now()-a}}var u=[],c=[],p=1,m=null,y=3,S=!1,x=!1,v=!1,g=typeof setTimeout=="function"?setTimeout:null,f=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 h(z){for(var B=n(c);B!==null;){if(B.callback===null)r(c);else if(B.startTime<=z)r(c),B.sortIndex=B.expirationTime,t(u,B);else break;B=n(c)}}function b(z){if(v=!1,h(z),!x)if(n(u)!==null)x=!0,P(C);else{var B=n(c);B!==null&&$(b,B.startTime-z)}}function C(z,B){x=!1,v&&(v=!1,f(_),_=-1),S=!0;var I=y;try{for(h(B),m=n(u);m!==null&&(!(m.expirationTime>B)||z&&!X());){var K=m.callback;if(typeof K=="function"){m.callback=null,y=m.priorityLevel;var le=K(m.expirationTime<=B);B=e.unstable_now(),typeof le=="function"?m.callback=le:m===n(u)&&r(u),h(B)}else r(u);m=n(u)}if(m!==null)var de=!0;else{var Ce=n(c);Ce!==null&&$(b,Ce.startTime-B),de=!1}return de}finally{m=null,y=I,S=!1}}var j=!1,T=null,_=-1,Q=5,U=-1;function X(){return!(e.unstable_now()-U<Q)}function H(){if(T!==null){var z=e.unstable_now();U=z;var B=!0;try{B=T(!0,z)}finally{B?N():(j=!1,T=null)}}else j=!1}var N;if(typeof d=="function")N=function(){d(H)};else if(typeof MessageChannel<"u"){var L=new MessageChannel,R=L.port2;L.port1.onmessage=H,N=function(){R.postMessage(null)}}else N=function(){g(H,0)};function P(z){T=z,j||(j=!0,N())}function $(z,B){_=g(function(){z(e.unstable_now())},B)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(z){z.callback=null},e.unstable_continueExecution=function(){x||S||(x=!0,P(C))},e.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Q=0<z?Math.floor(1e3/z):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(z){switch(y){case 1:case 2:case 3:var B=3;break;default:B=y}var I=y;y=B;try{return z()}finally{y=I}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(z,B){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var I=y;y=z;try{return B()}finally{y=I}},e.unstable_scheduleCallback=function(z,B,I){var K=e.unstable_now();switch(typeof I=="object"&&I!==null?(I=I.delay,I=typeof I=="number"&&0<I?K+I:K):I=K,z){case 1:var le=-1;break;case 2:le=250;break;case 5:le=1073741823;break;case 4:le=1e4;break;default:le=5e3}return le=I+le,z={id:p++,callback:B,priorityLevel:z,startTime:I,expirationTime:le,sortIndex:-1},I>K?(z.sortIndex=I,t(c,z),n(u)===null&&z===n(c)&&(v?(f(_),_=-1):v=!0,$(b,I-K))):(z.sortIndex=le,t(u,z),x||S||(x=!0,P(C))),z},e.unstable_shouldYield=X,e.unstable_wrapCallback=function(z){var B=y;return function(){var I=y;y=B;try{return z.apply(this,arguments)}finally{y=I}}}})(ic);oc.exports=ic;var np=oc.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 rp=k,Xe=np;function E(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var lc=new Set,jr={};function gn(e,t){In(e,t),In(e+"Capture",t)}function In(e,t){for(jr[e]=t,e=0;e<t.length;e++)lc.add(t[e])}var Et=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),fl=Object.prototype.hasOwnProperty,op=/^[: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]*$/,ya={},xa={};function ip(e){return fl.call(xa,e)?!0:fl.call(ya,e)?!1:op.test(e)?xa[e]=!0:(ya[e]=!0,!1)}function lp(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 sp(e,t,n,r){if(t===null||typeof t>"u"||lp(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 Le(e,t,n,r,o,i,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=l}var je={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){je[e]=new Le(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];je[t]=new Le(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){je[e]=new Le(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){je[e]=new Le(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){je[e]=new Le(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){je[e]=new Le(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){je[e]=new Le(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){je[e]=new Le(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){je[e]=new Le(e,5,!1,e.toLowerCase(),null,!1,!1)});var gs=/[\-:]([a-z])/g;function ys(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-
|
|||
|
|
`+Ni+e}var Ai=!1;function Oi(e,t){if(!e||Ai)return"";Ai=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var r=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){r=c}e.call(t.prototype)}else{try{throw Error()}catch(c){r=c}e()}}catch(c){if(c&&r&&typeof c.stack=="string"){for(var o=c.stack.split(`
|
|||
|
|
`),i=r.stack.split(`
|
|||
|
|
`),l=o.length-1,a=i.length-1;1<=l&&0<=a&&o[l]!==i[a];)a--;for(;1<=l&&0<=a;l--,a--)if(o[l]!==i[a]){if(l!==1||a!==1)do if(l--,a--,0>a||o[l]!==i[a]){var u=`
|
|||
|
|
`+o[l].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=l&&0<=a);break}}}finally{Ai=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?cr(e):""}function ap(e){switch(e.tag){case 5:return cr(e.type);case 16:return cr("Lazy");case 13:return cr("Suspense");case 19:return cr("SuspenseList");case 0:case 2:case 15:return e=Oi(e.type,!1),e;case 11:return e=Oi(e.type.render,!1),e;case 1:return e=Oi(e.type,!0),e;default:return""}}function gl(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 bn:return"Fragment";case Sn:return"Portal";case pl:return"Profiler";case vs:return"StrictMode";case hl:return"Suspense";case ml:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ac:return(e.displayName||"Context")+".Consumer";case sc:return(e._context.displayName||"Context")+".Provider";case ws:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ss:return t=e.displayName||null,t!==null?t:gl(e.type)||"Memo";case Nt:t=e._payload,e=e._init;try{return gl(e(t))}catch{}}return null}function up(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 gl(t);case 8:return t===vs?"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 Qt(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function cc(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function cp(e){var t=cc(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 o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(l){r=""+l,i.call(this,l)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function to(e){e._valueTracker||(e._valueTracker=cp(e))}function dc(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=cc(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Lo(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 yl(e,t){var n=t.checked;return ue({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function wa(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Qt(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 fc(e,t){t=t.checked,t!=null&&xs(e,"checked",t,!1)}function xl(e,t){fc(e,t);var n=Qt(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")?vl(e,t.type,n):t.hasOwnProperty("defaultValue")&&vl(e,t.type,Qt(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Sa(e,t,n){if(t.hasOwnProperty("val
|
|||
|
|
`).replace(wh,"")}function uo(e,t,n){if(t=Ha(t),Ha(e)!==t&&n)throw Error(E(425))}function Ho(){}var Al=null,Ol=null;function Dl(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Ll=typeof setTimeout=="function"?setTimeout:void 0,Sh=typeof clearTimeout=="function"?clearTimeout:void 0,Va=typeof Promise=="function"?Promise:void 0,bh=typeof queueMicrotask=="function"?queueMicrotask:typeof Va<"u"?function(e){return Va.resolve(null).then(e).catch(kh)}:Ll;function kh(e){setTimeout(function(){throw e})}function qi(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),Tr(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);Tr(t)}function Ut(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Qa(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Yn=Math.random().toString(36).slice(2),xt="__reactFiber$"+Yn,Or="__reactProps$"+Yn,_t="__reactContainer$"+Yn,Fl="__reactEvents$"+Yn,jh="__reactListeners$"+Yn,Ch="__reactHandles$"+Yn;function nn(e){var t=e[xt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[_t]||n[xt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Qa(e);e!==null;){if(n=e[xt])return n;e=Qa(e)}return t}e=n,n=e.parentNode}return null}function Hr(e){return e=e[xt]||e[_t],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function En(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(E(33))}function fi(e){return e[Or]||null}var Bl=[],_n=-1;function Xt(e){return{current:e}}function oe(e){0>_n||(e.current=Bl[_n],Bl[_n]=null,_n--)}function te(e,t){_n++,Bl[_n]=e.current,e.current=t}var qt={},ze=Xt(qt),We=Xt(!1),cn=qt;function Mn(e,t){var n=e.type.contextTypes;if(!n)return qt;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function He(e){return e=e.childContextTypes,e!=null}function Vo(){oe(We),oe(ze)}function qa(e,t,n){if(ze.current!==qt)throw Error(E(168));te(ze,t),te(We,n)}function ed(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(E(108,up(e)||"Unknown",o));return ue({},n,r)}function Qo(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||qt,cn=ze.current,te(ze,e),te(We,We.current),!0}function Ka(e,t,n){var r=e.stateNode;if(!r)throw Error(E(169));n?(e=ed(e,t,cn),r.__reactInternalMemoizedMergedChildContext=e,oe(We),oe(ze),te(ze,e)):oe(We),te(We,n)}var bt=null,pi=!1,Ki=!1;function td(e){bt===null?bt=[e]:bt.push(e)}function Eh(e){pi=!0,td(e)}function Gt(){if(!Ki&&bt!==null){Ki=!0;var e=0,t=Z;try{var n=bt;for(Z=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}bt=null,pi=!1}catch(o){throw bt!==null&&(bt=bt.slice(e+1)),Ec(ks,Gt),o}finally{Z=t,Ki=!1}}return null}var Rn=[],Tn=0,qo=null,Ko=0,tt=[],nt=0,dn=null,kt=1,jt="";function en(e,t){Rn[Tn++]=Ko,Rn[Tn++]=qo,qo=e,Ko=t}function nd(e,t,n){tt[nt++]=kt,tt[nt++]=jt,tt[nt++]=dn,dn=e;var r=kt;e=jt;var o=32-ft(r)-1;r&=~(1<<o),n+=1;var i=32-ft(t)+o;if(30<i){var l=o-o%5;i=(r&(1<<l)-1).toString(32),r>>=l,o-=l,kt=1<<32-ft(t)+o|n<<o|r,jt=i+e}else kt=1<<i|n<<o|r,jt=e}function Ns(e){e.return!==null&&(en(e,1),nd(e,1,0))}function As(e){for(;e===qo;)qo=Rn[--Tn],Rn[Tn]=null,Ko=Rn[--Tn],Rn[Tn]=null;for(;e===dn;)dn=tt[--nt],tt[nt]=null,jt=tt[--nt],tt[nt]=null,kt=tt[--nt],tt[nt]=null}var Ye=null,Ke=null,ie=!1,dt=null;function rd(e,t){var n=rt(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,
|
|||
|
|
Error generating stack: `+i.message+`
|
|||
|
|
`+i.stack}return{value:e,source:t,stack:o,digest:null}}function Zi(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Hl(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Dh=typeof WeakMap=="function"?WeakMap:Map;function Pd(e,t,n){n=Ct(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){ni||(ni=!0,es=r),Hl(e,t)},n}function zd(e,t,n){n=Ct(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){Hl(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Hl(e,t),typeof r!="function"&&(Wt===null?Wt=new Set([this]):Wt.add(this));var l=t.stack;this.componentDidCatch(t.value,{componentStack:l!==null?l:""})}),n}function ou(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Dh;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=Yh.bind(null,e,t,n),t.then(e,e))}function iu(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function lu(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Ct(-1,1),t.tag=2,$t(n,t,1))),n.lanes|=1),e)}var Lh=Pt.ReactCurrentOwner,$e=!1;function Ne(e,t,n,r){t.child=e===null?ld(t,null,n,r):$n(t,e.child,n,r)}function su(e,t,n,r,o){n=n.render;var i=t.ref;return Fn(t,o),r=Hs(e,t,n,r,i,o),n=Vs(),e!==null&&!$e?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Tt(e,t,o)):(ie&&n&&Ns(t),t.flags|=1,Ne(e,t,r,o),t.child)}function au(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!ta(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,Nd(e,t,i,r,o)):(e=zo(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&o)){var l=i.memoizedProps;if(n=n.compare,n=n!==null?n:zr,n(l,r)&&e.ref===t.ref)return Tt(e,t,o)}return t.flags|=1,e=Vt(i,r),e.ref=t.ref,e.return=t,t.child=e}function Nd(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(zr(i,r)&&e.ref===t.ref)if($e=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&($e=!0);else return t.lanes=e.lanes,Tt(e,t,o)}return Vl(e,t,n,r,o)}function Ad(e,t,n){var r=t.pendingProps,o=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},te(Nn,qe),qe|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,te(Nn,qe),qe|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,te(Nn,qe),qe|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,te(Nn,qe),qe|=r;return Ne(e,t,o,n),t.child}function Od(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Vl(e,t,n,r,o){var i=He(n)?cn:ze.current;return i=Mn(t,i),Fn(t,o),n=Hs(e,t,n,r,i,o),r=Vs(),e!==null&&!$e?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Tt(e,t,o)):(ie&&r&&Ns(t),t.flags|=1,Ne(e,t,n,o),t.child)}function uu(e,t,n,r,o){if(He(n)){var i=!0;Qo(t)}else i=!1;if(Fn(t,o),t.stateNode===null)Ro(e,t),Td(t,n,r),Wl(t,n,r,o),r=!0;else if(e===null){var l=t.stateNode,a=t.memoizedProps;l.props=a;var u=l.context,c=n.contextType;typeof c=="object"&&c!==null?c=it(c):(c=He(n)?cn:ze.current,c=Mn(t,c));var p=n.getDerivedStateFromProps,m=typeof p=="function"||typeof l.getSnapshotBeforeUpdate=="function";m||typeof l.UNSAFE_componentWillReceiveProps!="function"&&typeof l.componentWillReceiveProps!="function"||(a!==r||u!==c)&&ru(t,l,r,c),At=!1;var y=t.memoizedState;l.state=y,Go(t,r,l,o),u=t.memoizedState,a!==r||y!==u||We.current||At?(typeof p=="function"&&($l(t,n,p,r),u=t.memoizedState),(a=At||nu(t,n,a,r,y,u,c))?(m||typeof l.UNSAFE_componentWillMount!="function"&&typeof l.componentWillMount!="function"||(typeof l.
|
|||
|
|
`).forEach(function(l){o=l.indexOf(":"),n=l.substring(0,o).trim().toLowerCase(),r=l.substring(o+1).trim(),!(!n||t[n]&&Ym[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t};function Gm(e){let t=0,n=e.length;for(;t<n;){const r=e.charCodeAt(t);if(r!==9&&r!==32)break;t+=1}for(;n>t;){const r=e.charCodeAt(n-1);if(r!==9&&r!==32)break;n-=1}return t===0&&n===e.length?e:e.slice(t,n)}const Jm=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),Zm=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function la(e,t){return w.isArray(e)?e.map(n=>la(n,t)):Gm(String(e).replace(t,""))}const eg=e=>la(e,Jm),tg=e=>la(e,Zm);function pf(e){const t=Object.create(null);return w.forEach(e.toJSON(),(n,r)=>{t[r]=tg(n)}),t}const Cu=Symbol("internals");function lr(e){return e&&String(e).trim().toLowerCase()}function Ao(e){return e===!1||e==null?e:w.isArray(e)?e.map(Ao):eg(String(e))}function ng(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const rg=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function rl(e,t,n,r,o){if(w.isFunction(r))return r.call(this,t,n);if(o&&(t=n),!!w.isString(t)){if(w.isString(r))return t.indexOf(r)!==-1;if(w.isRegExp(r))return r.test(t)}}function og(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function ig(e,t){const n=w.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{__proto__:null,value:function(o,i,l){return this[r].call(this,t,o,i,l)},configurable:!0})})}let Oe=class{constructor(t){t&&this.set(t)}set(t,n,r){const o=this;function i(a,u,c){const p=lr(u);if(!p)throw new Error("header name must be a non-empty string");const m=w.findKey(o,p);(!m||o[m]===void 0||c===!0||c===void 0&&o[m]!==!1)&&(o[m||u]=Ao(a))}const l=(a,u)=>w.forEach(a,(c,p)=>i(c,p,u));if(w.isPlainObject(t)||t instanceof this.constructor)l(t,n);else if(w.isString(t)&&(t=t.trim())&&!rg(t))l(Xm(t),n);else if(w.isObject(t)&&w.isIterable(t)){let a={},u,c;for(const p of t){if(!w.isArray(p))throw TypeError("Object iterator must return a key-value pair");a[c=p[0]]=(u=a[c])?w.isArray(u)?[...u,p[1]]:[u,p[1]]:p[1]}l(a,n)}else t!=null&&i(n,t,r);return this}get(t,n){if(t=lr(t),t){const r=w.findKey(this,t);if(r){const o=this[r];if(!n)return o;if(n===!0)return ng(o);if(w.isFunction(n))return n.call(this,o,r);if(w.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=lr(t),t){const r=w.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||rl(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let o=!1;function i(l){if(l=lr(l),l){const a=w.findKey(r,l);a&&(!n||rl(r,r[a],a,n))&&(delete r[a],o=!0)}}return w.isArray(t)?t.forEach(i):i(t),o}clear(t){const n=Object.keys(this);let r=n.length,o=!1;for(;r--;){const i=n[r];(!t||rl(this,this[i],i,t,!0))&&(delete this[i],o=!0)}return o}normalize(t){const n=this,r={};return w.forEach(this,(o,i)=>{const l=w.findKey(r,i);if(l){n[l]=Ao(o),delete n[i];return}const a=t?og(i):String(i).trim();a!==i&&delete n[i],n[a]=Ao(o),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return w.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=t&&w.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
|||
|
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(o=>r.set(o)),r}static accessor(t){const r=(this[Cu]=this[Cu]={accessors:{}}).accessors,o=this.prototype;function i(l){const a=lr(l);r[a]||(ig(o,l),r[a]=!0)}return w.isArray(t)?t.forEach(i):i(t),this}};Oe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);w.reduceDescriptors(Oe.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});w.freezeMethods(Oe);const lg="[REDACTED ****]";function sg(e){if(w.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(w.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}function ag(e,t){const n=new Set(t.map(i=>String(i).toLowerCase())),r=[],o=i=>{if(i===null||typeof i!="object"||w.isBuffer(i))return i;if(r.indexOf(i)!==-1)return;i instanceof Oe&&(i=i.toJSON()),r.push(i);let l;if(w.isArray(i))l=[],i.forEach((a,u)=>{const c=o(a);w.isUndefined(c)||(l[u]=c)});else{if(!w.isPlainObject(i)&&sg(i))return r.pop(),i;l=Object.create(null);for(const[a,u]of Object.entries(i)){const c=n.has(a.toLowerCase())?lg:o(u);w.isUndefined(c)||(l[a]=c)}}return r.pop(),l};return o(e)}let O=class hf extends Error{static from(t,n,r,o,i,l){const a=new hf(t.message,n||t.code,r,o,i);return a.cause=t,a.name=t.name,t.status!=null&&a.status==null&&(a.status=t.status),l&&Object.assign(a,l),a}constructor(t,n,r,o,i){super(t),Object.defineProperty(this,"message",{__proto__:null,value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),r&&(this.config=r),o&&(this.request=o),i&&(this.response=i,this.status=i.status)}toJSON(){const t=this.config,n=t&&w.hasOwnProp(t,"redact")?t.redact:void 0,r=w.isArray(n)&&n.length>0?ag(t,n):w.toJSONObject(t);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:r,code:this.code,status:this.status}}};O.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";O.ERR_BAD_OPTION="ERR_BAD_OPTION";O.ECONNABORTED="ECONNABORTED";O.ETIMEDOUT="ETIMEDOUT";O.ECONNREFUSED="ECONNREFUSED";O.ERR_NETWORK="ERR_NETWORK";O.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";O.ERR_DEPRECATED="ERR_DEPRECATED";O.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";O.ERR_BAD_REQUEST="ERR_BAD_REQUEST";O.ERR_CANCELED="ERR_CANCELED";O.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";O.ERR_INVALID_URL="ERR_INVALID_URL";O.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const ug=null;function ls(e){return w.isPlainObject(e)||w.isArray(e)}function mf(e){return w.endsWith(e,"[]")?e.slice(0,-2):e}function ol(e,t,n){return e?e.concat(t).map(function(o,i){return o=mf(o),!n&&i?"["+o+"]":o}).join(n?".":""):t}function cg(e){return w.isArray(e)&&!e.some(ls)}const dg=w.toFlatObject(w,{},null,function(t){return/^is[A-Z]/.test(t)});function _i(e,t,n){if(!w.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=w.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,f){return!w.isUndefined(f[g])});const r=n.metaTokens,o=n.visitor||m,i=n.dots,l=n.indexes,a=n.Blob||typeof Blob<"u"&&Blob,u=n.maxDepth===void 0?100:n.maxDepth,c=a&&w.isSpecCompliantForm(t);if(!w.isFunction(o))throw new TypeError("visitor must be a function");function p(v){if(v===null)return"";if(w.isDate(v))return v.toISOString();if(w.isBoolean(v))return v.toString();if(!c&&w.isBlob(v))throw new O("Blob is not supported. Use a Buffer instead.");return w.isArrayBuffer(v)||w.isTypedArray(v)?c&&typeof Blob=="function"?new Blob([v]):Buffer.from(v):v}function m(v,g,f){let d=v;if(w.isReactNative(t)&&w.isReactNativeBlob(v))return t.append(ol(f,g,i),p(v)),!1;if(v&&!f&&typeof v=="object"){if(w.endsWith(g,"{}"))g=r?g:g.slice(0,-2),v=JSON.stringify(v);else if(w.isArray(v)&&cg(v)||(w.isFileList(v)||w.endsWith(g,"[]"))&&(d=w.toArray
|
|||
|
|
`+l.map(Ou).join(`
|
|||
|
|
`):" "+Ou(l[0]):"as no adapter specified";throw new O("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return o}const jf={getAdapter:Vg,adapters:da};function ll(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Xr(null,e)}function Du(e){return ll(e),e.headers=Oe.from(e.headers),e.data=il.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),jf.getAdapter(e.adapter||Yr.adapter,e)(e).then(function(r){ll(e),e.response=r;try{r.data=il.call(e,e.transformResponse,r)}finally{delete e.response}return r.headers=Oe.from(r.headers),r},function(r){if(!vf(r)&&(ll(e),r&&r.response)){e.response=r.response;try{r.response.data=il.call(e,e.transformResponse,r.response)}finally{delete e.response}r.response.headers=Oe.from(r.response.headers)}return Promise.reject(r)})}const Ri={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Ri[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Lu={};Ri.transitional=function(t,n,r){function o(i,l){return"[Axios v"+ca+"] Transitional option '"+i+"'"+l+(r?". "+r:"")}return(i,l,a)=>{if(t===!1)throw new O(o(l," has been removed"+(n?" in "+n:"")),O.ERR_DEPRECATED);return n&&!Lu[l]&&(Lu[l]=!0,console.warn(o(l," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,l,a):!0}};Ri.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function Qg(e,t,n){if(typeof e!="object")throw new O("options must be an object",O.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],l=Object.prototype.hasOwnProperty.call(t,i)?t[i]:void 0;if(l){const a=e[i],u=a===void 0||l(a,i,e);if(u!==!0)throw new O("option "+i+" must be "+u,O.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new O("Unknown option "+i,O.ERR_BAD_OPTION)}}const Oo={assertOptions:Qg,validators:Ri},Ze=Oo.validators;let un=class{constructor(t){this.defaults=t||{},this.interceptors={request:new _u,response:new _u}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const i=(()=>{if(!o.stack)return"";const l=o.stack.indexOf(`
|
|||
|
|
`);return l===-1?"":o.stack.slice(l+1)})();try{if(!r.stack)r.stack=i;else if(i){const l=i.indexOf(`
|
|||
|
|
`),a=l===-1?-1:i.indexOf(`
|
|||
|
|
`,l+1),u=a===-1?"":i.slice(a+1);String(r.stack).endsWith(u)||(r.stack+=`
|
|||
|
|
`+i)}}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=mn(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&Oo.assertOptions(r,{silentJSONParsing:Ze.transitional(Ze.boolean),forcedJSONParsing:Ze.transitional(Ze.boolean),clarifyTimeoutError:Ze.transitional(Ze.boolean),legacyInterceptorReqResOrdering:Ze.transitional(Ze.boolean)},!1),o!=null&&(w.isFunction(o)?n.paramsSerializer={serialize:o}:Oo.assertOptions(o,{encode:Ze.function,serialize:Ze.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Oo.assertOptions(n,{baseUrl:Ze.spelling("baseURL"),withXsrfToken:Ze.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let l=i&&w.merge(i.common,i[n.method]);i&&w.forEach(["delete","get","head","post","put","patch","query","common"],x=>{delete i[x]}),n.headers=Oe.concat(l,i);const a=[];let u=!0;this.interceptors.request.forEach(function(v){if(typeof v.runWhen=="function"&&v.runWhen(n)===!1)return;u=u&&v.synchronous;const g=n.transitional||aa;g&&g.legacyInterceptorReqResOrdering?a.unshift(v.fulfilled,v.rejected):a.push(v.fulfilled,v.rejected)});const c=[];this.interceptors.response.forEach(function(v){c.push(v.fulfilled,v.rejected)});let p,m=0,y;if(!u){const x=[Du.bind(this),void 0];for(x.unshift(...a),x.push(...c),y=x.length,p=Promise.resolve(n);m<y;)p=p.then(x[m++],x[m++]);return p}y=a.length;let S=n;for(;m<y;){const x=a[m++],v=a[m++];try{S=x(S)}catch(g){v.call(this,g);break}}try{p=Du.call(this,S)}catch(x){return Promise.reject(x)}for(m=0,y=c.length;m<y;)p=p.then(c[m++],c[m++]);return p}getUri(t){t=mn(this.defaults,t);const n=Sf(t.baseURL,t.url,t.allowAbsoluteUrls);return yf(n,t.params,t.paramsSerializer)}};w.forEach(["delete","get","head","options"],function(t){un.prototype[t]=function(n,r){return this.request(mn(r||{},{method:t,url:n,data:(r||{}).data}))}});w.forEach(["post","put","patch","query"],function(t){function n(r){return function(i,l,a){return this.request(mn(a||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:l}))}}un.prototype[t]=n(),t!=="query"&&(un.prototype[t+"Form"]=n(!0))});let qg=class Cf{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(o=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i;const l=new Promise(a=>{r.subscribe(a),i=a}).then(o);return l.cancel=function(){r.unsubscribe(i)},l},t(function(i,l,a){r.reason||(r.reason=new Xr(i,l,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Cf(function(o){t=o}),cancel:t}}};function Kg(e){return function(n){return e.apply(null,n)}}function Yg(e){return w.isObject(e)&&e.isAxiosError===!0}const as={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,Misdirec
|
|||
|
|
@keyframes toastIn {
|
|||
|
|
from { opacity: 0; transform: translateX(100%); }
|
|||
|
|
to { opacity: 1; transform: translateX(0); }
|
|||
|
|
}
|
|||
|
|
@keyframes toastOut {
|
|||
|
|
from { opacity: 1; transform: translateX(0); }
|
|||
|
|
to { opacity: 0; transform: translateX(100%); }
|
|||
|
|
}
|
|||
|
|
@keyframes toastProgress {
|
|||
|
|
from { width: 100%; }
|
|||
|
|
to { width: 0%; }
|
|||
|
|
}
|
|||
|
|
`,document.head.appendChild(l)},[]),s.jsxs(_f.Provider,{value:i,children:[e,s.jsx("div",{style:{position:"fixed",top:"16px",right:"16px",zIndex:99999,display:"flex",flexDirection:"column",gap:"8px",pointerEvents:"none"},children:t.map(l=>s.jsx("div",{style:{pointerEvents:"auto"},children:s.jsx(ry,{toast:l,onDismiss:r})},l.id))})]})}const iy=["Attendance & Punctuality","Administrative Integrity","Financial Stewardship","Operational Response","Professional Conduct","Work From Home","Safety & Security"],ly=[{key:"time",label:"Incident Time"},{key:"minutes",label:"Minutes Late"},{key:"amount",label:"Amount / Value"},{key:"location",label:"Location / Context"},{key:"description",label:"Additional Details"}],W={overlay:{position:"fixed",inset:0,background:"rgba(0,0,0,0.7)",zIndex:1e3,display:"flex",alignItems:"center",justifyContent:"center",padding:"20px"},modal:{background:"#111217",border:"1px solid #2a2b3a",borderRadius:"10px",width:"100%",maxWidth:"620px",maxHeight:"90vh",overflowY:"auto",padding:"32px"},title:{color:"#f8f9fa",fontSize:"20px",fontWeight:700,marginBottom:"24px",borderBottom:"1px solid #2a2b3a",paddingBottom:"12px"},label:{fontWeight:600,color:"#e5e7f1",marginBottom:"5px",fontSize:"13px",display:"block"},input:{width:"100%",padding:"10px",border:"1px solid #333544",borderRadius:"4px",fontSize:"14px",fontFamily:"inherit",background:"#050608",color:"#f8f9fa",boxSizing:"border-box"},textarea:{width:"100%",padding:"10px",border:"1px solid #333544",borderRadius:"4px",fontSize:"13px",fontFamily:"inherit",background:"#050608",color:"#f8f9fa",resize:"vertical",minHeight:"80px",boxSizing:"border-box"},group:{marginBottom:"18px"},hint:{fontSize:"11px",color:"#9ca0b8",marginTop:"4px",fontStyle:"italic"},row:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"14px"},toggle:{display:"flex",gap:"8px",marginTop:"6px"},toggleBtn:e=>({padding:"7px 18px",borderRadius:"4px",fontSize:"13px",fontWeight:600,cursor:"pointer",border:"1px solid",background:e?"#d4af37":"#050608",color:e?"#000":"#9ca0b8",borderColor:e?"#d4af37":"#333544"}),fieldGrid:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"8px",marginTop:"8px"},checkbox:{display:"flex",alignItems:"center",gap:"8px",fontSize:"13px",color:"#d1d3e0",cursor:"pointer"},btnRow:{display:"flex",gap:"12px",justifyContent:"flex-end",marginTop:"28px",paddingTop:"16px",borderTop:"1px solid #2a2b3a"},btnSave:{padding:"10px 28px",fontSize:"14px",fontWeight:600,border:"none",borderRadius:"6px",cursor:"pointer",background:"linear-gradient(135deg, #d4af37 0%, #ffdf8a 100%)",color:"#000"},btnDanger:{padding:"10px 18px",fontSize:"14px",fontWeight:600,border:"1px solid #721c24",borderRadius:"6px",cursor:"pointer",background:"#3c1114",color:"#ffb3b8"},btnCancel:{padding:"10px 18px",fontSize:"14px",fontWeight:600,border:"1px solid #333544",borderRadius:"6px",cursor:"pointer",background:"#050608",color:"#f8f9fa"},section:{background:"#181924",border:"1px solid #2a2b3a",borderRadius:"6px",padding:"16px",marginBottom:"18px"},secTitle:{color:"#d4af37",fontSize:"13px",fontWeight:700,marginBottom:"12px",textTransform:"uppercase",letterSpacing:"0.05em"},customBadge:{display:"inline-block",marginLeft:"8px",padding:"1px 7px",borderRadius:"10px",fontSize:"10px",fontWeight:700,background:"#1a2e1a",color:"#4caf50",border:"1px solid #4caf50",verticalAlign:"middle"}},sy={name:"",category:"",chapter:"",description:"",pointType:"fixed",fixedPoints:1,minPoints:1,maxPoints:5,fields:["description"]};function ay({onClose:e,onSaved:t,editing:n=null}){const[r,o]=k.useState(sy),[i,l]=k.useState(!1),[a,u]=k.useState(!1),c=Pi();k.useEffect(()=>{if(n){const x=n.min_points!==n.max_points;o({name:n.name,category:n.category,chapter:n.chapter||"",description:n.description||"",pointType:x?"sliding":"fixed",fixedPoints:n.min_points,minPoints:n.min_points,maxPoints:n.max_points,fields:n.fields||["description"]})}},[n]);const p=(x,v)=>o(g=>({...g,[x]:v})),m=x=>{o(v=>({...v,fields:v.fields.includes(x)?v.fields.filter(g=>g!==x):[...v.fields,x]}))},y=async()=>{var f,d;if(!r.name.trim()){c.warning("Violation name is required.");
|
|||
|
|
${d}`:d)},f=a?a.split(`
|
|||
|
|
`).filter(Boolean):[];return s.jsxs("div",{style:Ie.wrapper,children:[s.jsx("div",{style:Ie.sectionHd,children:"Notes & Flags"}),r?s.jsxs("div",{children:[s.jsx("div",{style:{...Ie.tagRow,marginBottom:"6px"},children:yy.map(d=>s.jsxs("button",{style:{...Ie.tag,cursor:"pointer",background:i.includes(d)?"#0e2a3a":"#1a2a3a",opacity:i.includes(d)?.5:1},onClick:()=>g(d),title:"Add tag",children:["+ ",d]},d))}),s.jsx("textarea",{style:Ie.textarea,value:i,onChange:d=>l(d.target.value),placeholder:"Free-text notes — one per line or comma-separated. Does not affect CPAS scoring.",autoFocus:!0}),m&&s.jsxs("div",{style:{fontSize:"12px",color:"#ff7070",marginBottom:"6px"},children:["✗ ",m]}),s.jsxs("div",{style:Ie.actions,children:[s.jsx("button",{style:Ie.saveBtn,onClick:x,disabled:c,children:c?"Saving…":"Save Notes"}),s.jsx("button",{style:Ie.cancelBtn,onClick:v,disabled:c,children:"Cancel"}),c&&s.jsx("span",{style:Ie.saving,children:"Saving…"})]})]}):s.jsxs("div",{style:Ie.display,onClick:()=>{l(a),o(!0)},title:"Click to edit",children:[s.jsx("span",{style:Ie.editHint,children:"✎ edit"}),f.length===0?s.jsx("span",{style:Ie.displayEmpty,children:"No notes — click to add"}):s.jsx("div",{style:Ie.tagRow,children:f.map((d,h)=>s.jsx("span",{style:Ie.tag,children:d},h))})]})]})}const M={overlay:{position:"fixed",inset:0,background:"rgba(0,0,0,0.75)",zIndex:1e3,display:"flex",alignItems:"flex-start",justifyContent:"flex-end"},panel:{background:"#111217",color:"#f8f9fa",width:"680px",maxWidth:"95vw",height:"100vh",overflowY:"auto",boxShadow:"-4px 0 24px rgba(0,0,0,0.7)",display:"flex",flexDirection:"column"},header:{background:"linear-gradient(135deg, #000000, #151622)",color:"white",padding:"24px 28px",position:"sticky",top:0,zIndex:10,borderBottom:"1px solid #222"},headerRow:{display:"flex",alignItems:"flex-start",justifyContent:"space-between"},closeBtn:{float:"right",background:"none",border:"none",color:"white",fontSize:"22px",cursor:"pointer",lineHeight:1,marginTop:"-2px"},editEmpBtn:{background:"none",border:"1px solid #555",color:"#ccc",borderRadius:"5px",padding:"4px 10px",fontSize:"11px",cursor:"pointer",marginTop:"8px",fontWeight:600},body:{padding:"24px 28px",flex:1},scoreRow:{display:"flex",gap:"12px",flexWrap:"wrap",marginBottom:"24px"},scoreCard:{flex:"1",minWidth:"100px",background:"#181924",borderRadius:"8px",padding:"14px",textAlign:"center",border:"1px solid #2a2b3a"},scoreNum:{fontSize:"26px",fontWeight:800},scoreLbl:{fontSize:"11px",color:"#b5b5c0",marginTop:"3px"},sectionHd:{fontSize:"13px",fontWeight:700,color:"#f8f9fa",textTransform:"uppercase",letterSpacing:"0.5px",marginBottom:"10px",marginTop:"24px"},table:{width:"100%",borderCollapse:"collapse",fontSize:"12px",background:"#181924",borderRadius:"6px",overflow:"hidden",border:"1px solid #2a2b3a"},th:{background:"#050608",padding:"8px 10px",textAlign:"left",color:"#f8f9fa",fontWeight:600,fontSize:"11px",textTransform:"uppercase"},td:{padding:"9px 10px",borderBottom:"1px solid #202231",verticalAlign:"top",color:"#f8f9fa"},negatedRow:{background:"#151622",color:"#9ca0b8"},actionBtn:e=>({background:"none",border:`1px solid ${e}`,color:e,borderRadius:"4px",padding:"3px 8px",fontSize:"11px",cursor:"pointer",marginRight:"4px",fontWeight:600}),resTag:{display:"inline-block",padding:"2px 8px",borderRadius:"10px",fontSize:"10px",fontWeight:700,background:"#053321",color:"#9ef7c1",border:"1px solid #0f5132"},pdfBtn:{background:"none",border:"1px solid #d4af37",color:"#ffd666",borderRadius:"4px",padding:"3px 8px",fontSize:"11px",cursor:"pointer",fontWeight:600},amendBtn:{background:"none",border:"1px solid #4db6ac",color:"#4db6ac",borderRadius:"4px",padding:"3px 8px",fontSize:"11px",cursor:"pointer",marginRight:"4px",fontWeight:600},deleteConfirm:{background:"#3c1114",border:"1px solid #f5c6cb",borderRadius:"6px",padding:"12px",marginTop:"8px",fontSize:"12px",color:"#ffb3b8"},amendBadge:{display:"inline-block",marginLeft:"4px",padding:"1px 5px",borderRadius:"8px",fontSize:"9px",fontWeight:700,background:"#0e2a2a",color:"#4db6ac",border:"1px solid #1a4a4a",verti
|
|||
|
|
|
|||
|
|
Use this after back-dating a violation if older PDFs no longer reflect the correct prior-points total. Existing PDFs will regenerate with up-to-date numbers.`))try{const R=await F.post(`/api/employees/${e}/recompute-snapshots`),{scanned:P,updated:$}=R.data;$===0?d.success(`Snapshots already up to date (${P} checked).`):d.success(`Updated ${$} of ${P} snapshot${$===1?"":"s"}.`),h()}catch(R){d.error("Backfill failed: "+(((L=(N=R.response)==null?void 0:N.data)==null?void 0:L.error)||R.message))}},_=async({resolution_type:N,details:L,resolved_by:R})=>{var P,$;try{await F.patch(`/api/violations/${p.id}/negate`,{resolution_type:N,details:L,resolved_by:R}),d.success("Violation negated."),m(null),S(null),h()}catch(z){d.error("Negate failed: "+((($=(P=z.response)==null?void 0:P.data)==null?void 0:$.error)||z.message))}},Q=o?Kt(o.active_points):null,U=l.filter(N=>!N.negated),X=l.filter(N=>N.negated),H=N=>{N.target===N.currentTarget&&t()};return s.jsxs("div",{style:M.overlay,onClick:H,children:[s.jsxs("div",{style:M.panel,onClick:N=>N.stopPropagation(),children:[s.jsx("div",{style:M.header,children:s.jsxs("div",{style:M.headerRow,children:[s.jsxs("div",{children:[s.jsx("div",{style:{fontSize:"18px",fontWeight:700},children:n?n.name:"Employee"}),n&&s.jsxs("div",{style:{fontSize:"12px",color:"#b5b5c0",marginTop:"4px"},children:[n.department," ",n.supervisor&&`· Supervisor: ${n.supervisor}`]}),n&&s.jsx("button",{style:M.editEmpBtn,onClick:()=>v(!0),children:"✎ Edit Employee"})]}),s.jsx("button",{style:M.closeBtn,onClick:t,children:"✕"})]})}),s.jsx("div",{style:M.body,children:u?s.jsx("div",{style:{padding:"40px",textAlign:"center",color:"#b5b5c0"},children:"Loading…"}):s.jsxs(s.Fragment,{children:[o&&s.jsxs("div",{style:M.scoreRow,children:[s.jsxs("div",{style:M.scoreCard,children:[s.jsx("div",{style:{...M.scoreNum,color:(Q==null?void 0:Q.color)||"#f8f9fa"},children:o.active_points}),s.jsx("div",{style:M.scoreLbl,children:"Active Points"})]}),s.jsxs("div",{style:M.scoreCard,children:[s.jsx("div",{style:M.scoreNum,children:o.total_violations}),s.jsx("div",{style:M.scoreLbl,children:"Total Violations"})]}),s.jsxs("div",{style:M.scoreCard,children:[s.jsx("div",{style:M.scoreNum,children:o.negated_count}),s.jsx("div",{style:M.scoreLbl,children:"Negated"})]}),s.jsxs("div",{style:{...M.scoreCard,minWidth:"140px"},children:[s.jsx("div",{style:{fontSize:"13px",fontWeight:700,color:(Q==null?void 0:Q.color)||"#f8f9fa"},children:Q?Q.label:"—"}),s.jsx("div",{style:M.scoreLbl,children:"Current Tier"})]})]}),o&&s.jsx(Ti,{points:o.active_points,style:{marginBottom:"20px"}}),n&&s.jsx(xy,{employeeId:e,initialNotes:n.notes,onSaved:N=>r(L=>({...L,notes:N}))}),o&&o.active_points>0&&s.jsx(gy,{employeeId:e,currentPoints:o.active_points}),s.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginTop:"24px",marginBottom:"10px"},children:[s.jsx("div",{style:{...M.sectionHd,marginTop:0,marginBottom:0},children:"Active Violations"}),l.length>0&&s.jsx("button",{style:M.backfillBtn,onClick:T,title:"Rebuild prior-points snapshot on each violation. Use after a back-dated insert if older PDFs show the wrong Prior Active Points.",children:"↻ Backfill Snapshots"})]}),U.length===0?s.jsx("div",{style:{color:"#777990",fontStyle:"italic",fontSize:"12px"},children:"No active violations on record."}):s.jsxs("table",{style:M.table,children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{style:M.th,children:"Date"}),s.jsx("th",{style:M.th,children:"Violation"}),s.jsx("th",{style:M.th,children:"Pts"}),s.jsx("th",{style:M.th,children:"Actions"})]})}),s.jsx("tbody",{children:U.map(N=>s.jsxs("tr",{children:[s.jsx("td",{style:M.td,children:N.incident_date}),s.jsxs("td",{style:M.td,children:[s.jsxs("div",{style:{fontWeight:600},children:[N.violation_name,N.amendment_count>0&&s.jsxs("span",{style:M.amendBadge,children:[N.amendment_count," edit",N.amendment_count!==1?"s":""]})]}),s.jsx("div",{style:{fontSize:"10px",color:"#9ca0b8"},children:N.category}),N.details&&s.jsx("div",{style:{fontSize:"10px",color:"#b5b5c0",marginTop:
|
|||
|
|
@media (max-width: 768px) {
|
|||
|
|
.dashboard-wrap {
|
|||
|
|
padding: 16px !important;
|
|||
|
|
}
|
|||
|
|
.dashboard-header {
|
|||
|
|
flex-direction: column;
|
|||
|
|
align-items: flex-start !important;
|
|||
|
|
}
|
|||
|
|
.dashboard-title {
|
|||
|
|
font-size: 20px !important;
|
|||
|
|
}
|
|||
|
|
.dashboard-subtitle {
|
|||
|
|
font-size: 12px !important;
|
|||
|
|
}
|
|||
|
|
.dashboard-stats {
|
|||
|
|
gap: 10px !important;
|
|||
|
|
}
|
|||
|
|
.dashboard-stat-card {
|
|||
|
|
min-width: calc(50% - 5px) !important;
|
|||
|
|
padding: 12px !important;
|
|||
|
|
}
|
|||
|
|
.stat-num {
|
|||
|
|
font-size: 24px !important;
|
|||
|
|
}
|
|||
|
|
.stat-lbl {
|
|||
|
|
font-size: 10px !important;
|
|||
|
|
}
|
|||
|
|
.toolbar-right {
|
|||
|
|
width: 100%;
|
|||
|
|
flex-direction: column;
|
|||
|
|
}
|
|||
|
|
.search-input {
|
|||
|
|
width: 100% !important;
|
|||
|
|
}
|
|||
|
|
.toolbar-btn {
|
|||
|
|
width: 100%;
|
|||
|
|
justify-content: center;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
@media (max-width: 480px) {
|
|||
|
|
.dashboard-stat-card {
|
|||
|
|
min-width: 100% !important;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
`;function Py(){const[e,t]=k.useState([]),[n,r]=k.useState([]),[o,i]=k.useState(""),[l,a]=k.useState(null),[u,c]=k.useState(!1),[p,m]=k.useState(!0),[y,S]=k.useState(vo),x=Ry("(max-width: 768px)"),v=k.useCallback(()=>{m(!0),F.get("/api/dashboard").then(j=>{t(j.data),r(j.data)}).finally(()=>m(!1))},[]);k.useEffect(()=>{v()},[v]),k.useEffect(()=>{const j=o.toLowerCase();let T=e;y===sr?T=T.filter(_=>_.active_points>=0&&_.active_points<=4):y===ar?T=T.filter(_=>_.active_points>0):y===ur&&(T=T.filter(_=>ul(_.active_points))),j&&(T=T.filter(_=>_.name.toLowerCase().includes(j)||(_.department||"").toLowerCase().includes(j)||(_.supervisor||"").toLowerCase().includes(j))),r(T)},[o,e,y]);const g=e.filter(j=>ul(j.active_points)).length,f=e.filter(j=>j.active_points>0).length,d=e.filter(j=>j.active_points>=0&&j.active_points<=4).length,h=e.reduce((j,T)=>Math.max(j,T.active_points),0);function b(j){S(T=>T===j?vo:j)}function C(j,T={}){const _=y===j;return{...V.statCard,..._?V.statCardActive:{},...T}}return s.jsxs(s.Fragment,{children:[s.jsx("style",{children:Ty}),s.jsxs("div",{style:V.wrap,className:"dashboard-wrap",children:[s.jsxs("div",{style:V.header,className:"dashboard-header",children:[s.jsxs("div",{children:[s.jsx("div",{style:V.title,className:"dashboard-title",children:"Company Dashboard"}),s.jsxs("div",{style:V.subtitle,className:"dashboard-subtitle",children:["Click any employee name to view their full profile",y&&y!==vo&&s.jsxs("span",{style:{marginLeft:"10px",color:"#d4af37",fontWeight:600},children:["· Filtered: ",y===sr?"Elite Standing (0–4 pts)":y===ar?"With Active Points":y===ur?"At Risk":"All",s.jsx("button",{onClick:()=>S(vo),style:{marginLeft:"6px",background:"none",border:"none",color:"#9ca0b8",cursor:"pointer",fontSize:"12px"},title:"Clear filter",children:"✕"})]})]})]}),s.jsxs("div",{style:V.toolbarRight,className:"toolbar-right",children:[s.jsx("input",{style:V.search,className:"search-input",placeholder:"Search name, dept, supervisor…",value:o,onChange:j=>i(j.target.value)}),s.jsx("button",{style:V.auditBtn,className:"toolbar-btn",onClick:()=>c(!0),children:"📋 Audit Log"}),s.jsx("button",{style:V.refreshBtn,className:"toolbar-btn",onClick:v,children:"↻ Refresh"})]})]}),s.jsxs("div",{style:V.statsRow,className:"dashboard-stats",children:[s.jsxs("div",{style:C(cl),className:"dashboard-stat-card",onClick:()=>b(cl),title:"Click to show all employees",children:[s.jsx("div",{style:V.statNum,className:"stat-num",children:e.length}),s.jsx("div",{style:V.statLbl,className:"stat-lbl",children:"Total Employees"}),y===cl&&s.jsx("div",{style:V.filterBadge,children:"▼ Showing All"})]}),s.jsxs("div",{style:C(sr,{borderTop:"3px solid #28a745"}),className:"dashboard-stat-card",onClick:()=>b(sr),title:"Click to filter: Elite Standing (0–4 pts)",children:[s.jsx("div",{style:{...V.statNum,color:"#6ee7b7"},className:"stat-num",children:d}),s.jsx("div",{style:V.statLbl,className:"stat-lbl",children:"Elite Standing (0–4 pts)"}),y===sr&&s.jsx("div",{style:V.filterBadge,children:"▼ Filtered"})]}),s.jsxs("div",{style:C(ar,{borderTop:"3px solid #d4af37"}),className:"dashboard-stat-card",onClick:()=>b(ar),title:"Click to filter: employees with active points",children:[s.jsx("div",{style:{...V.statNum,color:"#ffd666"},className:"stat-num",children:f}),s.jsx("div",{style:V.statLbl,className:"stat-lbl",children:"With Active Points"}),y===ar&&s.jsx("div",{style:V.filterBadge,children:"▼ Filtered"})]}),s.jsxs("div",{style:C(ur,{borderTop:"3px solid #ffb020"}),className:"dashboard-stat-card",onClick:()=>b(ur),title:`Click to filter: at risk (≤${us} pts to next tier)`,children:[s.jsx("div",{style:{...V.statNum,color:"#ffdf8a"},className:"stat-num",children:g}),s.jsxs("div",{style:V.statLbl,className:"stat-lbl",children:["At Risk (≤",us," pts to next tier)"]}),y===ur&&s.jsx("div",{style:V.filterBadge,children:"▼ Filtered"})]}),s.jsxs("div",{style:{...V.statCard,borderTop:"3px solid #c0392b",cursor:"default"},className:"dashboard-stat-card",children:[s.jsx("div",{style:{...V.statNum,color:"#ff8a80"},className:"stat-num
|
|||
|
|
`),n=[];let r=0,o=!1,i=!1,l=!1;const a=()=>{o&&(n.push("</ul>"),o=!1),i&&(n.push("</ol>"),i=!1),l&&(n.push("</tbody></table>"),l=!1)},u=c=>c.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/`([^`]+)`/g,"<code>$1</code>");for(;r<t.length;){const c=t[r];if(c.startsWith("```")){for(a(),r++;r<t.length&&!t[r].startsWith("```");)r++;r++;continue}if(/^---+$/.test(c.trim())){a(),n.push("<hr>"),r++;continue}const p=c.match(/^(#{1,4})\s+(.+)/);if(p){a();const S=p[1].length,x=p[2].toLowerCase().replace(/[^a-z0-9]+/g,"-");n.push(`<h${S} id="${x}">${u(p[2])}</h${S}>`),r++;continue}if(c.trim().startsWith("|")){const S=c.trim().replace(/^\|||\|$/g,"").split("|").map(x=>x.trim());if(l){n.push("<tr>"),S.forEach(x=>n.push(`<td>${u(x)}</td>`)),n.push("</tr>"),r++;continue}else{a(),l=!0,n.push("<table><thead><tr>"),S.forEach(x=>n.push(`<th>${u(x)}</th>`)),n.push("</tr></thead><tbody>"),r++,r<t.length&&/^[\|\s\:\-]+$/.test(t[r])&&r++;continue}}const m=c.match(/^[-*]\s+(.*)/);if(m){l&&a(),o||(i&&(n.push("</ol>"),i=!1),n.push("<ul>"),o=!0),n.push(`<li>${u(m[1])}</li>`),r++;continue}const y=c.match(/^\d+\.\s+(.*)/);if(y){l&&a(),i||(o&&(n.push("</ul>"),o=!1),n.push("<ol>"),i=!0),n.push(`<li>${u(y[1])}</li>`),r++;continue}if(c.trim()===""){a(),r++;continue}a(),n.push(`<p>${u(c)}</p>`),r++}return a(),n.join(`
|
|||
|
|
`)}function Ny(e){return e.split(`
|
|||
|
|
`).reduce((t,n)=>{const r=n.match(/^(#{1,2})\s+(.+)/);return r&&t.push({level:r[1].length,text:r[2],id:r[2].toLowerCase().replace(/[^a-z0-9]+/g,"-")}),t},[])}const Jt={overlay:{position:"fixed",inset:0,background:"rgba(0,0,0,0.75)",zIndex:2e3,display:"flex",alignItems:"flex-start",justifyContent:"flex-end"},panel:{background:"#111217",color:"#f8f9fa",width:"760px",maxWidth:"95vw",height:"100vh",overflowY:"auto",boxShadow:"-4px 0 32px rgba(0,0,0,0.85)",display:"flex",flexDirection:"column"},header:{background:"linear-gradient(135deg,#000000,#151622)",color:"white",padding:"22px 28px",position:"sticky",top:0,zIndex:10,borderBottom:"1px solid #222",display:"flex",alignItems:"center",justifyContent:"space-between"},closeBtn:{background:"none",border:"none",color:"white",fontSize:"22px",cursor:"pointer",lineHeight:1},toc:{background:"#0d1117",borderBottom:"1px solid #1e1f2e",padding:"10px 32px",display:"flex",flexWrap:"wrap",gap:"4px 18px",fontSize:"11px"},body:{padding:"28px 32px",flex:1,fontSize:"13px",lineHeight:"1.75"},footer:{padding:"14px 32px",borderTop:"1px solid #1e1f2e",fontSize:"11px",color:"#555770",textAlign:"center"}},Ay=`
|
|||
|
|
.adm h1 { font-size:21px; font-weight:800; color:#f8f9fa; margin:28px 0 10px; border-bottom:1px solid #2a2b3a; padding-bottom:8px }
|
|||
|
|
.adm h2 { font-size:16px; font-weight:700; color:#d4af37; margin:28px 0 6px; letter-spacing:.2px }
|
|||
|
|
.adm h3 { font-size:12px; font-weight:700; color:#90caf9; margin:18px 0 4px; text-transform:uppercase; letter-spacing:.5px }
|
|||
|
|
.adm h4 { font-size:13px; font-weight:600; color:#b0b8d0; margin:14px 0 4px }
|
|||
|
|
.adm p { color:#c8ccd8; margin:5px 0 10px }
|
|||
|
|
.adm hr { border:none; border-top:1px solid #2a2b3a; margin:22px 0 }
|
|||
|
|
.adm strong { color:#f8f9fa }
|
|||
|
|
.adm code { background:#0d1117; color:#79c0ff; border:1px solid #2a2b3a; border-radius:4px; padding:1px 6px; font-family:'Consolas','Fira Code',monospace; font-size:12px }
|
|||
|
|
.adm ul { padding-left:20px; margin:5px 0 10px; color:#c8ccd8 }
|
|||
|
|
.adm ol { padding-left:20px; margin:5px 0 10px; color:#c8ccd8 }
|
|||
|
|
.adm li { margin:4px 0 }
|
|||
|
|
.adm table { width:100%; border-collapse:collapse; font-size:12px; background:#181924; border-radius:6px; overflow:hidden; border:1px solid #2a2b3a; margin:10px 0 16px }
|
|||
|
|
.adm th { background:#050608; padding:8px 12px; text-align:left; color:#f8f9fa; font-weight:600; font-size:11px; text-transform:uppercase; border-bottom:1px solid #2a2b3a }
|
|||
|
|
.adm td { padding:8px 12px; border-bottom:1px solid #202231; color:#c8ccd8 }
|
|||
|
|
.adm tr:last-child td { border-bottom:none }
|
|||
|
|
.adm tr:hover td { background:#1e1f2e }
|
|||
|
|
`,$u=`# CPAS Tracker — Admin Guide
|
|||
|
|
|
|||
|
|
Internal tool for CPAS violation documentation, workforce standing management, and audit compliance. All data is stored locally in the Docker container volume — there is no external dependency.
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## How Scoring Works
|
|||
|
|
|
|||
|
|
Every violation carries a **point value** set at the time of submission. Points count toward an employee's score only within a **rolling 90-day window** — once a violation is older than 90 days it automatically drops off and the score recalculates.
|
|||
|
|
|
|||
|
|
Negated (voided) violations are excluded from scoring immediately. Hard-deleted violations are removed from the record entirely.
|
|||
|
|
|
|||
|
|
## Tier Reference
|
|||
|
|
|
|||
|
|
| Points | Tier | Label |
|
|||
|
|
|--------|------|-------|
|
|||
|
|
| 0–4 | 0–1 | Elite Standing |
|
|||
|
|
| 5–9 | 1 | Realignment |
|
|||
|
|
| 10–14 | 2 | Administrative Lockdown |
|
|||
|
|
| 15–19 | 3 | Verification |
|
|||
|
|
| 20–24 | 4 | Risk Mitigation |
|
|||
|
|
| 25–29 | 5 | Final Decision |
|
|||
|
|
| 30+ | 6 | Separation |
|
|||
|
|
|
|||
|
|
The **at-risk badge** on the dashboard flags anyone within 2 points of the next tier threshold so supervisors can act before escalation occurs.
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## Feature Map
|
|||
|
|
|
|||
|
|
### Dashboard
|
|||
|
|
|
|||
|
|
The main view. Employees are sorted by active CPAS points, highest first.
|
|||
|
|
|
|||
|
|
- **Stat cards** — live counts: total employees, zero-point (elite), with active points, at-risk, highest score
|
|||
|
|
- **Search / filter** — by name, department, or supervisor; narrows the table in real time
|
|||
|
|
- **At-risk badge** — gold flag on rows where the employee is within 2 pts of the next tier
|
|||
|
|
- **Audit Log button** — opens the filterable, paginated write-action log (top right of the dashboard toolbar)
|
|||
|
|
- **Click any name** — opens that employee's full profile modal
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
### Logging a Violation
|
|||
|
|
|
|||
|
|
Use the **+ New Violation** tab.
|
|||
|
|
|
|||
|
|
1. Select an existing employee from the dropdown, or type a new name to create a record on-the-fly.
|
|||
|
|
2. The **employee intelligence panel** loads their current tier badge and 90-day violation count before you commit.
|
|||
|
|
3. Choose a violation type. The dropdown is grouped by category and shows prior 90-day counts inline for each type.
|
|||
|
|
4. If the employee has a prior violation of the same type, the **recidivist auto-escalation** rule triggers — the points slider jumps to the maximum allowed for that violation type.
|
|||
|
|
5. The **tier crossing warning** previews what tier the submission would land the employee in. Review before submitting.
|
|||
|
|
6. Adjust points using the slider if discretionary reduction is warranted (within the violation's allowed min/max range).
|
|||
|
|
7. **Employee Acknowledgment** (optional): if the employee is present and acknowledges receipt, enter their printed name and the acknowledgment date. This replaces the blank signature line on the PDF with a recorded acknowledgment and an "Acknowledged" badge. Leave blank if the employee is not present or declines.
|
|||
|
|
8. Submit. A **PDF download link** appears immediately — download it for the employee's file.
|
|||
|
|
9. **Toast notifications** confirm success or surface errors at the top right of the screen. Toasts auto-dismiss after a few seconds.
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
### Employee Profile Modal
|
|||
|
|
|
|||
|
|
Click any name on the dashboard to open their profile.
|
|||
|
|
|
|||
|
|
#### Overview section
|
|||
|
|
Shows current tier badge, active points, and 90-day violation count.
|
|||
|
|
|
|||
|
|
#### Notes & Flags
|
|||
|
|
Free-text field for HR context (e.g. "On PIP", "Union member", "Pending investigation", "FMLA"). Quick-add tag buttons pre-fill common statuses. Notes are visible to anyone who opens the profile but **do not affect CPAS scoring**. Edit inline; saves on blur.
|
|||
|
|
|
|||
|
|
#### Point Expiration Timeline
|
|||
|
|
Visible when the employee has active points. Shows each active violation as a progress bar indicating how far through its 90-day window it is, days remaining until roll-off, and a **tier-drop indicator** for violations whose expiration would move the employee down a tier.
|
|||
|
|
|
|||
|
|
#### Violation History
|
|||
|
|
Full record of all submissions — active, negated, and resolved.
|
|||
|
|
|
|||
|
|
- **Amend** — edit non-scoring fields (location, details, witness, submitted-by, incident time, acknowledged-by, acknowledged-date) on any active violation. Every change is logged as a field-level diff (old → new) with timestamp. Points, type, and incident date are immutable.
|
|||
|
|
- **Negate** — soft-delete a violation with a resolution type and notes. The record is preserved in history; the points are immediately removed from the score. Fully reversible via **Restore**.
|
|||
|
|
- **Hard delete** — permanent removal. Use only for genuine data entry errors.
|
|||
|
|
- **PDF** — download the formal violation document for any historical record. If the violation has an employee acknowledgment on record, the PDF shows the filled-in name and date instead of blank signature lines.
|
|||
|
|
|
|||
|
|
All actions trigger **toast notifications** confirming success or surfacing errors.
|
|||
|
|
|
|||
|
|
#### Edit Employee
|
|||
|
|
Update name, department, or supervisor. Changes are logged to the audit trail.
|
|||
|
|
|
|||
|
|
#### Merge Duplicate
|
|||
|
|
If the same employee exists under two names, use Merge to reassign all violations from the duplicate to the canonical record. The duplicate is then deleted. This cannot be undone.
|
|||
|
|
|
|||
|
|
#### Backfill Snapshots (repair tool)
|
|||
|
|
|
|||
|
|
Each violation stores a **prior-points snapshot** at submission time so its PDF always shows the score *as it was on the incident date*. Normally you never touch this — it's set on insert, refreshed automatically when a back-dated violation lands inside another violation's 90-day window, and otherwise locked. PDFs stay stable through negate/restore by design.
|
|||
|
|
|
|||
|
|
The **↻ Backfill Snapshots** button sits next to the **Active Violations** header in the profile modal. It rebuilds the snapshot on every violation for that employee using current data.
|
|||
|
|
|
|||
|
|
**When to use it:**
|
|||
|
|
|
|||
|
|
- After back-dating a violation, an older PDF still shows "Prior Active Points: 0" even though an earlier violation now clearly exists in the timeline.
|
|||
|
|
- More generally: any time a regenerated PDF disagrees with what you see in the Point Expiration Timeline (the timeline is computed live; PDFs use the snapshot).
|
|||
|
|
|
|||
|
|
**When *not* to use it:**
|
|||
|
|
|
|||
|
|
- After a negate, restore, amend, or hard delete in normal workflow. The system intentionally keeps existing PDFs stable through those operations.
|
|||
|
|
- As a routine maintenance step. If you keep needing it after ordinary back-dated inserts, that's a bug worth reporting — the auto-refresh should already be covering you.
|
|||
|
|
|
|||
|
|
**What clicking it does:**
|
|||
|
|
|
|||
|
|
1. Iterates every violation belonging to the employee (active and negated).
|
|||
|
|
2. Recomputes each row's prior-points snapshot from the current set of non-negated violations in the 90 days before its incident date.
|
|||
|
|
3. Writes only the rows that actually changed.
|
|||
|
|
4. Records one entry in the audit log (action: \`violation_snapshots_recomputed\`, reason: \`manual_backfill\`) with the per-row before/after values.
|
|||
|
|
|
|||
|
|
A toast confirms the outcome — either *"Updated X of Y snapshots"* or *"Snapshots already up to date"*. Re-download any affected PDFs after running it; the new totals will appear immediately.
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
### Audit Log
|
|||
|
|
|
|||
|
|
Accessible from the dashboard toolbar (🔍 button). Append-only log of every write action in the system.
|
|||
|
|
|
|||
|
|
- Filter by entity type: **employee** or **violation**
|
|||
|
|
- Filter by action: created, edited, merged, negated, restored, amended, deleted, notes updated
|
|||
|
|
- Paginated with load-more; most recent entries first
|
|||
|
|
|
|||
|
|
The audit log is the authoritative record for compliance review. Nothing in it can be edited or deleted through the UI.
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
### Violation Amendment
|
|||
|
|
|
|||
|
|
Amendments allow corrections to a violation's non-scoring fields without deleting and re-submitting, which would disrupt the audit trail and the prior-points snapshot.
|
|||
|
|
|
|||
|
|
**Amendable fields:** incident time, location, details, submitted-by, witness name, acknowledged-by, acknowledged-date.
|
|||
|
|
|
|||
|
|
**Immutable fields:** violation type, incident date, point value.
|
|||
|
|
|
|||
|
|
Each amendment stores a before/after diff for every changed field. Amendment history is accessible from the violation card in the employee's history.
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
### Toast Notifications
|
|||
|
|
|
|||
|
|
All user actions across the application produce **toast notifications** — small slide-in messages at the top right of the screen.
|
|||
|
|
|
|||
|
|
- **Success** (green) — violation submitted, PDF downloaded, employee updated, etc.
|
|||
|
|
- **Error** (red) — API failures, validation errors, PDF generation issues
|
|||
|
|
- **Warning** (gold) — missing required fields, policy alerts
|
|||
|
|
- **Info** (blue) — general informational messages
|
|||
|
|
|
|||
|
|
Toasts auto-dismiss after a few seconds (errors persist longer). Each toast has a progress bar countdown and a manual dismiss button. Up to 5 toasts can stack simultaneously.
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## Immutability Rules — Quick Reference
|
|||
|
|
|
|||
|
|
| Action | Allowed? | Notes |
|
|||
|
|
|--------|----------|-------|
|
|||
|
|
| Edit violation type | No | Immutable after submission |
|
|||
|
|
| Edit incident date | No | Immutable after submission |
|
|||
|
|
| Edit point value | No | Immutable after submission |
|
|||
|
|
| Edit location / details / witness | Yes | Via Amend |
|
|||
|
|
| Edit acknowledged-by / acknowledged-date | Yes | Via Amend |
|
|||
|
|
| Negate (void) a violation | Yes | Soft delete; reversible |
|
|||
|
|
| Hard delete a violation | Yes | Permanent; use sparingly |
|
|||
|
|
| Edit employee name / dept / supervisor | Yes | Logged to audit trail |
|
|||
|
|
| Merge duplicate employees | Yes | Irreversible |
|
|||
|
|
| Add / edit employee notes | Yes | Does not affect score |
|
|||
|
|
| Recompute prior-points snapshot | Yes | Two paths only: auto (back-dated insert) or **↻ Backfill Snapshots** button. Never touched by negate, restore, amend, or hard delete |
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
## Roadmap
|
|||
|
|
|
|||
|
|
### Shipped
|
|||
|
|
|
|||
|
|
- Container scaffold, violation form, employee intelligence
|
|||
|
|
- Recidivist auto-escalation, tier crossing warning
|
|||
|
|
- PDF generation with prior-points snapshot
|
|||
|
|
- Company dashboard, stat cards, at-risk badges
|
|||
|
|
- Employee profile modal — full history, negate/restore, hard delete
|
|||
|
|
- Employee edit and duplicate merge
|
|||
|
|
- Violation amendment with field-level diff log
|
|||
|
|
- Audit log — filterable, paginated, append-only
|
|||
|
|
- Employee notes and flags with quick-add HR tags
|
|||
|
|
- Point expiration timeline with tier-drop projections
|
|||
|
|
- In-app admin guide (this panel)
|
|||
|
|
- Acknowledgment signature field — employee name + date on form and PDF
|
|||
|
|
- Toast notification system — global feedback for all user actions
|
|||
|
|
- Backfill Snapshots — per-employee repair tool that rebuilds the prior-points snapshot on every violation when older PDFs drift from current data
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
### Near-term
|
|||
|
|
|
|||
|
|
These are well-scoped additions that fit the current architecture without major changes.
|
|||
|
|
|
|||
|
|
- **CSV export** — one endpoint returning violations or dashboard data as a downloadable CSV for payroll or external reporting.
|
|||
|
|
- **Supervisor-scoped view** — filter the dashboard to a single supervisor's team via URL param; useful in multi-supervisor environments without requiring full auth.
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
### Planned
|
|||
|
|
|
|||
|
|
Larger features that require more design work or infrastructure.
|
|||
|
|
|
|||
|
|
- **Violation trends chart** — line/bar chart of violations over time, filterable by department or supervisor. Useful for identifying systemic patterns vs. isolated incidents. Recharts is already available in the frontend bundle.
|
|||
|
|
- **Department heat map** — grid showing violation density and average CPAS score per department. Helps identify team-level risk early.
|
|||
|
|
- **Draft / pending violations** — save a violation as a draft before it's officially logged. Useful when incidents need supervisor review or HR sign-off before they count toward the score.
|
|||
|
|
- **At-risk threshold configuration** — make the 2-point at-risk warning threshold configurable per deployment rather than hardcoded.
|
|||
|
|
|
|||
|
|
---
|
|||
|
|
|
|||
|
|
### Future Considerations
|
|||
|
|
|
|||
|
|
These require meaningful infrastructure additions and should be evaluated against actual operational need before committing.
|
|||
|
|
|
|||
|
|
- **Multi-user auth** — role-based login (admin, supervisor, read-only). Currently the app assumes a trusted internal network with no authentication layer.
|
|||
|
|
- **Tier escalation alerts** — email or in-app notification when an employee crosses into Tier 2+, automatically routed to their supervisor.
|
|||
|
|
- **Scheduled digest** — weekly email summary to supervisors showing their employees' current standings and any approaching thresholds.
|
|||
|
|
- **Automated DB backup** — scheduled snapshot of the database to a mounted backup volume or remote destination.
|
|||
|
|
- **Bulk CSV import** — migrate historical violation records from paper logs or a prior system.
|
|||
|
|
- **Dark/light theme toggle** — UI is currently dark-only.
|
|||
|
|
`;function Oy({onClose:e}){const t=k.useRef(null),n=zy($u),r=Ny($u);k.useEffect(()=>{const i=l=>{l.key==="Escape"&&e()};return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[e]);const o=i=>{var a;const l=(a=t.current)==null?void 0:a.querySelector(`#${i}`);l&&l.scrollIntoView({behavior:"smooth",block:"start"})};return s.jsxs("div",{style:Jt.overlay,onClick:i=>{i.target===i.currentTarget&&e()},children:[s.jsx("style",{children:Ay}),s.jsxs("div",{style:Jt.panel,onClick:i=>i.stopPropagation(),children:[s.jsxs("div",{style:Jt.header,children:[s.jsxs("div",{children:[s.jsx("div",{style:{fontSize:"17px",fontWeight:800,letterSpacing:".3px"},children:"📋 CPAS Tracker — Admin Guide"}),s.jsx("div",{style:{fontSize:"11px",color:"#9ca0b8",marginTop:"3px"},children:"Feature map · workflows · roadmap · Esc or click outside to close"})]}),s.jsx("button",{style:Jt.closeBtn,onClick:e,"aria-label":"Close",children:"✕"})]}),s.jsx("div",{style:Jt.toc,children:r.map(i=>s.jsxs("button",{onClick:()=>o(i.id),style:{background:"none",border:"none",cursor:"pointer",padding:"3px 0",color:i.level===1?"#f8f9fa":"#d4af37",fontWeight:i.level===1?700:500,fontSize:"11px"},children:[i.level===2?"↳ ":"",i.text]},i.id))}),s.jsx("div",{ref:t,style:Jt.body,className:"adm",dangerouslySetInnerHTML:{__html:n}}),s.jsx("div",{style:Jt.footer,children:"CPAS Violation Tracker · internal admin use only"})]})]})}const fa="cpas_token";function zf(){return localStorage.getItem(fa)}function Dy(e){localStorage.setItem(fa,e)}function cs(){localStorage.removeItem(fa)}F.interceptors.request.use(e=>{const t=zf();return t&&(e.headers.Authorization=`Bearer ${t}`),e});let ds=null;function Ly(e){ds=e}F.interceptors.response.use(e=>e,e=>(e.response&&e.response.status===401&&(cs(),ds&&ds()),Promise.reject(e)));const Me={overlay:{position:"fixed",inset:0,background:"#050608",display:"flex",alignItems:"center",justifyContent:"center",zIndex:3e3,fontFamily:"'Segoe UI', Arial, sans-serif"},modal:{width:"380px",maxWidth:"92vw",background:"#111217",borderRadius:"12px",boxShadow:"0 16px 40px rgba(0,0,0,0.8)",color:"#f8f9fa",overflow:"hidden",border:"1px solid #2a2b3a"},header:{padding:"24px",borderBottom:"1px solid #222",textAlign:"center",background:"linear-gradient(135deg, #000000, #151622)"},logo:{height:"34px",marginBottom:"12px"},title:{fontSize:"18px",fontWeight:800,letterSpacing:"0.5px"},subtitle:{fontSize:"12px",color:"#c0c2d6",marginTop:"4px"},body:{padding:"22px 24px 8px 24px"},label:{fontSize:"13px",fontWeight:600,marginBottom:"4px",color:"#e5e7f1"},input:{width:"100%",padding:"10px 12px",borderRadius:"6px",border:"1px solid #333544",background:"#050608",color:"#f8f9fa",fontSize:"14px",fontFamily:"inherit",marginBottom:"16px",boxSizing:"border-box"},error:{background:"#3a1414",borderRadius:"6px",padding:"9px 11px",fontSize:"12px",color:"#ff9b9b",border:"1px solid #c0392b",marginBottom:"14px"},footer:{padding:"0 24px 22px 24px"},btn:{width:"100%",padding:"11px",borderRadius:"6px",border:"none",background:"linear-gradient(135deg, #d4af37 0%, #ffdf8a 100%)",color:"#000",fontWeight:700,fontSize:"14px",cursor:"pointer",textTransform:"uppercase",letterSpacing:"0.5px"}};function Fy({onSuccess:e}){const[t,n]=k.useState(""),[r,o]=k.useState(""),[i,l]=k.useState(""),[a,u]=k.useState(!1),c=async p=>{var m,y;p.preventDefault(),l(""),u(!0);try{const{data:S}=await F.post("/api/auth/login",{username:t,password:r});Dy(S.token),e(S.user)}catch(S){l(((y=(m=S.response)==null?void 0:m.data)==null?void 0:y.error)||"Login failed. Please try again."),u(!1)}};return s.jsx("div",{style:Me.overlay,children:s.jsxs("form",{style:Me.modal,onSubmit:c,children:[s.jsxs("div",{style:Me.header,children:[s.jsx("img",{src:"/static/mpm-logo.png",alt:"MPM",style:Me.logo}),s.jsx("div",{style:Me.title,children:"CPAS Tracker"}),s.jsx("div",{style:Me.subtitle,children:"Sign in to continue"})]}),s.jsxs("div",{style:Me.body,children:[i&&s.jsx("div",{style:Me.error,children:i}),s.jsx("div",{style:Me.label,children:"Username"}),s.jsx("input",{style:Me.input,value:t,onChange:
|
|||
|
|
@keyframes cpas-pulse {
|
|||
|
|
0%, 100% { opacity: 1; transform: scale(1); }
|
|||
|
|
50% { opacity: 0.4; transform: scale(0.75); }
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
/* Mobile-specific footer adjustments */
|
|||
|
|
@media (max-width: 768px) {
|
|||
|
|
.footer-content {
|
|||
|
|
flex-wrap: wrap;
|
|||
|
|
justify-content: center;
|
|||
|
|
font-size: 10px;
|
|||
|
|
padding: 10px 16px;
|
|||
|
|
gap: 8px;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
`}),s.jsxs("footer",{style:Zt.footer,className:"footer-content",children:[s.jsxs("span",{style:Zt.copy,children:["© ",t," Jason Stedwell"]}),s.jsx("span",{style:Zt.sep,children:"·"}),s.jsx(Iy,{}),s.jsx("span",{style:Zt.sep,children:"·"}),s.jsxs("a",{href:Wu,target:"_blank",rel:"noopener noreferrer",style:Zt.link,children:[s.jsx(My,{})," cpas"]}),n&&n!=="dev"&&s.jsxs(s.Fragment,{children:[s.jsx("span",{style:Zt.sep,children:"·"}),s.jsx("a",{href:`${Wu}/commit/${e.sha}`,target:"_blank",rel:"noopener noreferrer",style:Zt.link,title:r?`Built ${r}`:"View commit",children:n})]})]})]})}const $y=[{id:"dashboard",label:"📊 Dashboard"},{id:"violation",label:"+ New Violation"}];function Wy(e){const[t,n]=k.useState(!1);return k.useEffect(()=>{const r=window.matchMedia(e);r.matches!==t&&n(r.matches);const o=()=>n(r.matches);return r.addEventListener("change",o),()=>r.removeEventListener("change",o)},[t,e]),t}const et={app:{minHeight:"100vh",background:"#050608",fontFamily:"'Segoe UI', Arial, sans-serif",color:"#f8f9fa",display:"flex",flexDirection:"column"},nav:{background:"#000000",padding:"0 40px",display:"flex",alignItems:"center",gap:0,borderBottom:"1px solid #333"},logoWrap:{display:"flex",alignItems:"center",marginRight:"32px",padding:"14px 0"},logoImg:{height:"28px",marginRight:"10px"},logoText:{color:"#f8f9fa",fontWeight:800,fontSize:"18px",letterSpacing:"0.5px"},tab:e=>({padding:"18px 22px",color:e?"#f8f9fa":"rgba(248,249,250,0.6)",borderBottom:e?"3px solid #d4af37":"3px solid transparent",cursor:"pointer",fontWeight:e?700:400,fontSize:"14px",background:"none",border:"none"}),docsBtn:{marginLeft:"auto",background:"none",border:"1px solid #2a2b3a",color:"#9ca0b8",borderRadius:"6px",padding:"6px 14px",fontSize:"12px",cursor:"pointer",fontWeight:600,letterSpacing:"0.3px",display:"flex",alignItems:"center",gap:"6px"},navBtn:{background:"none",border:"1px solid #2a2b3a",color:"#9ca0b8",borderRadius:"6px",padding:"6px 14px",fontSize:"12px",cursor:"pointer",fontWeight:600,letterSpacing:"0.3px",display:"flex",alignItems:"center",gap:"6px"},userBadge:{fontSize:"12px",color:"#c0c2d6",fontWeight:600,display:"flex",alignItems:"center",gap:"5px"},main:{flex:1},card:{maxWidth:"1100px",margin:"30px auto",background:"#111217",borderRadius:"10px",boxShadow:"0 2px 16px rgba(0,0,0,0.6)",border:"1px solid #222"}},Hy=`
|
|||
|
|
@media (max-width: 768px) {
|
|||
|
|
.app-nav {
|
|||
|
|
padding: 0 16px !important;
|
|||
|
|
flex-wrap: wrap;
|
|||
|
|
justify-content: center;
|
|||
|
|
}
|
|||
|
|
.logo-wrap {
|
|||
|
|
margin-right: 0 !important;
|
|||
|
|
padding: 12px 0 !important;
|
|||
|
|
width: 100%;
|
|||
|
|
justify-content: center;
|
|||
|
|
border-bottom: 1px solid #1a1b22;
|
|||
|
|
}
|
|||
|
|
.nav-tabs {
|
|||
|
|
display: flex;
|
|||
|
|
width: 100%;
|
|||
|
|
justify-content: space-around;
|
|||
|
|
}
|
|||
|
|
.nav-tab {
|
|||
|
|
flex: 1;
|
|||
|
|
text-align: center;
|
|||
|
|
padding: 14px 8px !important;
|
|||
|
|
font-size: 13px !important;
|
|||
|
|
}
|
|||
|
|
.docs-btn {
|
|||
|
|
position: absolute;
|
|||
|
|
top: 16px;
|
|||
|
|
right: 16px;
|
|||
|
|
padding: 4px 10px !important;
|
|||
|
|
font-size: 11px !important;
|
|||
|
|
}
|
|||
|
|
.docs-btn span:first-child {
|
|||
|
|
display: none;
|
|||
|
|
}
|
|||
|
|
.main-card {
|
|||
|
|
margin: 12px !important;
|
|||
|
|
border-radius: 8px !important;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
@media (max-width: 480px) {
|
|||
|
|
.logo-text {
|
|||
|
|
font-size: 16px !important;
|
|||
|
|
}
|
|||
|
|
.logo-img {
|
|||
|
|
height: 24px !important;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
`,Zt={footer:{borderTop:"1px solid #1a1b22",padding:"12px 40px",display:"flex",alignItems:"center",gap:"12px",fontSize:"11px",color:"rgba(248,249,250,0.35)",background:"#000",flexShrink:0},copy:{color:"rgba(248,249,250,0.35)"},sep:{color:"rgba(248,249,250,0.15)"},link:{color:"rgba(248,249,250,0.35)",textDecoration:"none",display:"inline-flex",alignItems:"center",gap:"4px",transition:"color 0.15s"}};function Vy(){const[e,t]=k.useState("dashboard"),[n,r]=k.useState(!1),[o,i]=k.useState(!1),[l,a]=k.useState(null),[u,c]=k.useState(null),[p,m]=k.useState(!1),y=Wy("(max-width: 768px)");k.useEffect(()=>{fetch("/version.json").then(x=>x.ok?x.json():null).then(x=>{x&&a(x)}).catch(()=>{})},[]),k.useEffect(()=>{if(Ly(()=>c(null)),!zf()){m(!0);return}F.get("/api/auth/me").then(x=>c(x.data.user)).catch(()=>cs()).finally(()=>m(!0))},[]);const S=async()=>{try{await F.post("/api/auth/logout")}catch{}cs(),c(null)};return p?u?s.jsxs(oy,{children:[s.jsx("style",{children:Hy}),s.jsxs("div",{style:et.app,children:[s.jsxs("nav",{style:et.nav,className:"app-nav",children:[s.jsxs("div",{style:et.logoWrap,className:"logo-wrap",children:[s.jsx("img",{src:"/static/mpm-logo.png",alt:"MPM",style:et.logoImg,className:"logo-img"}),s.jsx("div",{style:et.logoText,className:"logo-text",children:"CPAS Tracker"})]}),s.jsx("div",{className:"nav-tabs",children:$y.map(x=>s.jsx("button",{style:et.tab(e===x.id),className:"nav-tab",onClick:()=>t(x.id),children:y?x.label.replace("📊 ","📊 ").replace("+ New ","+ "):x.label},x.id))}),s.jsxs("div",{style:{marginLeft:"auto",display:"flex",alignItems:"center",gap:"10px"},children:[s.jsxs("span",{style:et.userBadge,title:`Signed in as ${u.username} (${u.role})`,children:["👤 ",u.username]}),u.role==="admin"&&s.jsx("button",{style:et.navBtn,onClick:()=>i(!0),title:"Manage user accounts",children:"Users"}),s.jsxs("button",{style:{...et.docsBtn,marginLeft:0},className:"docs-btn",onClick:()=>r(!0),title:"Open admin documentation",children:[s.jsx("span",{children:"?"})," Docs"]}),s.jsx("button",{style:et.navBtn,onClick:S,title:"Sign out",children:"Logout"})]})]}),s.jsx("div",{style:et.main,children:s.jsx("div",{style:et.card,className:"main-card",children:e==="dashboard"?s.jsx(Py,{}):s.jsx(uy,{})})}),s.jsx(Uy,{version:l}),n&&s.jsx(Oy,{onClose:()=>r(!1)}),o&&s.jsx(By,{currentUser:u,onClose:()=>i(!1)})]})]}):s.jsx(Fy,{onSuccess:c}):null}dl.createRoot(document.getElementById("root")).render(s.jsx(Yf.StrictMode,{children:s.jsx(Vy,{})}));
|