From abb6bea57ac70e50351cdd779d17df4e5dbcf209 Mon Sep 17 00:00:00 2001 From: jokerxue <2509699647@qq.com> Date: Fri, 20 Mar 2026 17:17:29 +0800 Subject: [PATCH] 用户管理 --- 美国版/Food Labeling Management Platform/.env.local | 2 +- 美国版/Food Labeling Management Platform/build/assets/index-2Xatwc8-.js | 463 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 美国版/Food Labeling Management Platform/build/assets/index-TU5tblcP.js | 458 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 美国版/Food Labeling Management Platform/build/index.html | 2 +- 美国版/Food Labeling Management Platform/src/components/labels/LabelTemplateEditor/LabelCanvas.tsx | 45 ++++++++++++++++++++++++++++----------------- 美国版/Food Labeling Management Platform/src/components/labels/LabelTemplateEditor/PropertiesPanel.tsx | 216 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------- 美国版/Food Labeling Management Platform/src/components/labels/LabelTemplateEditor/index.tsx | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 美国版/Food Labeling Management Platform/src/components/labels/LabelTemplatesView.tsx | 3 ++- 美国版/Food Labeling Management Platform/src/components/people/PeopleView.tsx | 836 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------------------------------------------------------------- 美国版/Food Labeling Management Platform/src/components/ui/dialog.tsx | 25 ++++++++++++++----------- 美国版/Food Labeling Management Platform/src/services/rbacRoleService.ts | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 美国版/Food Labeling Management Platform/src/services/teamMemberService.ts | 240 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 美国版/Food Labeling Management Platform/src/types/teamMember.ts | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 13 files changed, 1870 insertions(+), 587 deletions(-) delete mode 100644 美国版/Food Labeling Management Platform/build/assets/index-2Xatwc8-.js create mode 100644 美国版/Food Labeling Management Platform/build/assets/index-TU5tblcP.js create mode 100644 美国版/Food Labeling Management Platform/src/services/teamMemberService.ts create mode 100644 美国版/Food Labeling Management Platform/src/types/teamMember.ts diff --git a/美国版/Food Labeling Management Platform/.env.local b/美国版/Food Labeling Management Platform/.env.local index 7330fd9..48c3f29 100644 --- a/美国版/Food Labeling Management Platform/.env.local +++ b/美国版/Food Labeling Management Platform/.env.local @@ -1,2 +1,2 @@ -VITE_API_BASE_URL=http://192.168.31.88:19001 +VITE_API_BASE_URL=http://192.168.31.87:19001 diff --git a/美国版/Food Labeling Management Platform/build/assets/index-2Xatwc8-.js b/美国版/Food Labeling Management Platform/build/assets/index-2Xatwc8-.js deleted file mode 100644 index 1a73eb8..0000000 --- a/美国版/Food Labeling Management Platform/build/assets/index-2Xatwc8-.js +++ /dev/null @@ -1,463 +0,0 @@ -function e8(e,t){for(var r=0;rn[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function r(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(i){if(i.ep)return;i.ep=!0;const o=r(i);fetch(i.href,o)}})();var Mf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ot(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var fg={exports:{}},ql={},dg={exports:{}},Ve={};/** - * @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 JO;function t8(){if(JO)return Ve;JO=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),s=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),l=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),p=Symbol.iterator;function m(M){return M===null||typeof M!="object"?null:(M=p&&M[p]||M["@@iterator"],typeof M=="function"?M:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,y={};function w(M,B,Z){this.props=M,this.context=B,this.refs=y,this.updater=Z||g}w.prototype.isReactComponent={},w.prototype.setState=function(M,B){if(typeof M!="object"&&typeof M!="function"&&M!=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,M,B,"setState")},w.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function j(){}j.prototype=w.prototype;function O(M,B,Z){this.props=M,this.context=B,this.refs=y,this.updater=Z||g}var E=O.prototype=new j;E.constructor=O,b(E,w.prototype),E.isPureReactComponent=!0;var N=Array.isArray,A=Object.prototype.hasOwnProperty,C={current:null},T={key:!0,ref:!0,__self:!0,__source:!0};function R(M,B,Z){var te,ve={},xe=null,X=null;if(B!=null)for(te in B.ref!==void 0&&(X=B.ref),B.key!==void 0&&(xe=""+B.key),B)A.call(B,te)&&!T.hasOwnProperty(te)&&(ve[te]=B[te]);var ue=arguments.length-2;if(ue===1)ve.children=Z;else if(1>>1,B=D[M];if(0>>1;Mi(ve,J))xei(X,ve)?(D[M]=X,D[xe]=J,M=xe):(D[M]=ve,D[te]=J,M=te);else if(xei(X,J))D[M]=X,D[xe]=J,M=xe;else break e}}return Q}function i(D,Q){var J=D.sortIndex-Q.sortIndex;return J!==0?J:D.id-Q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,u=s.now();e.unstable_now=function(){return s.now()-u}}var f=[],l=[],d=1,p=null,m=3,g=!1,b=!1,y=!1,w=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function E(D){for(var Q=r(l);Q!==null;){if(Q.callback===null)n(l);else if(Q.startTime<=D)n(l),Q.sortIndex=Q.expirationTime,t(f,Q);else break;Q=r(l)}}function N(D){if(y=!1,E(D),!b)if(r(f)!==null)b=!0,G(A);else{var Q=r(l);Q!==null&&Y(N,Q.startTime-D)}}function A(D,Q){b=!1,y&&(y=!1,j(R),R=-1),g=!0;var J=m;try{for(E(Q),p=r(f);p!==null&&(!(p.expirationTime>Q)||D&&!$());){var M=p.callback;if(typeof M=="function"){p.callback=null,m=p.priorityLevel;var B=M(p.expirationTime<=Q);Q=e.unstable_now(),typeof B=="function"?p.callback=B:p===r(f)&&n(f),E(Q)}else n(f);p=r(f)}if(p!==null)var Z=!0;else{var te=r(l);te!==null&&Y(N,te.startTime-Q),Z=!1}return Z}finally{p=null,m=J,g=!1}}var C=!1,T=null,R=-1,I=5,z=-1;function $(){return!(e.unstable_now()-zD||125M?(D.sortIndex=J,t(l,D),r(f)===null&&D===r(l)&&(y?(j(R),R=-1):y=!0,Y(N,J-M))):(D.sortIndex=B,t(f,D),b||g||(b=!0,G(A))),D},e.unstable_shouldYield=$,e.unstable_wrapCallback=function(D){var Q=m;return function(){var J=m;m=Q;try{return D.apply(this,arguments)}finally{m=J}}}})(mg)),mg}var iE;function o8(){return iE||(iE=1,pg.exports=i8()),pg.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 oE;function a8(){if(oE)return Sr;oE=1;var e=cp(),t=o8();function r(a){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+a,v=1;v"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),f=Object.prototype.hasOwnProperty,l=/^[: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]*$/,d={},p={};function m(a){return f.call(p,a)?!0:f.call(d,a)?!1:l.test(a)?p[a]=!0:(d[a]=!0,!1)}function g(a,c,v,x){if(v!==null&&v.type===0)return!1;switch(typeof c){case"function":case"symbol":return!0;case"boolean":return x?!1:v!==null?!v.acceptsBooleans:(a=a.toLowerCase().slice(0,5),a!=="data-"&&a!=="aria-");default:return!1}}function b(a,c,v,x){if(c===null||typeof c>"u"||g(a,c,v,x))return!0;if(x)return!1;if(v!==null)switch(v.type){case 3:return!c;case 4:return c===!1;case 5:return isNaN(c);case 6:return isNaN(c)||1>c}return!1}function y(a,c,v,x,S,P,k){this.acceptsBooleans=c===2||c===3||c===4,this.attributeName=x,this.attributeNamespace=S,this.mustUseProperty=v,this.propertyName=a,this.type=c,this.sanitizeURL=P,this.removeEmptyString=k}var w={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){w[a]=new y(a,0,!1,a,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var c=a[0];w[c]=new y(c,1,!1,a[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(a){w[a]=new y(a,2,!1,a.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){w[a]=new y(a,2,!1,a,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(a){w[a]=new y(a,3,!1,a.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(a){w[a]=new y(a,3,!0,a,null,!1,!1)}),["capture","download"].forEach(function(a){w[a]=new y(a,4,!1,a,null,!1,!1)}),["cols","rows","size","span"].forEach(function(a){w[a]=new y(a,6,!1,a,null,!1,!1)}),["rowSpan","start"].forEach(function(a){w[a]=new y(a,5,!1,a.toLowerCase(),null,!1,!1)});var j=/[\-:]([a-z])/g;function O(a){return a[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(a){var c=a.replace(j,O);w[c]=new y(c,1,!1,a,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var c=a.replace(j,O);w[c]=new y(c,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(a){var c=a.replace(j,O);w[c]=new y(c,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(a){w[a]=new y(a,1,!1,a.toLowerCase(),null,!1,!1)}),w.xlinkHref=new y("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(a){w[a]=new y(a,1,!1,a.toLowerCase(),null,!0,!0)});function E(a,c,v,x){var S=w.hasOwnProperty(c)?w[c]:null;(S!==null?S.type!==0:x||!(2q||S[k]!==P[q]){var H=` -`+S[k].replace(" at new "," at ");return a.displayName&&H.includes("")&&(H=H.replace("",a.displayName)),H}while(1<=k&&0<=q);break}}}finally{Z=!1,Error.prepareStackTrace=v}return(a=a?a.displayName||a.name:"")?B(a):""}function ve(a){switch(a.tag){case 5:return B(a.type);case 16:return B("Lazy");case 13:return B("Suspense");case 19:return B("SuspenseList");case 0:case 2:case 15:return a=te(a.type,!1),a;case 11:return a=te(a.type.render,!1),a;case 1:return a=te(a.type,!0),a;default:return""}}function xe(a){if(a==null)return null;if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case T:return"Fragment";case C:return"Portal";case I:return"Profiler";case R:return"StrictMode";case U:return"Suspense";case W:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case $:return(a.displayName||"Context")+".Consumer";case z:return(a._context.displayName||"Context")+".Provider";case L:var c=a.render;return a=a.displayName,a||(a=c.displayName||c.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case V:return c=a.displayName||null,c!==null?c:xe(a.type)||"Memo";case G:c=a._payload,a=a._init;try{return xe(a(c))}catch{}}return null}function X(a){var c=a.type;switch(a.tag){case 24:return"Cache";case 9:return(c.displayName||"Context")+".Consumer";case 10:return(c._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=c.render,a=a.displayName||a.name||"",c.displayName||(a!==""?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return xe(c);case 8:return c===R?"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 c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c}return null}function ue(a){switch(typeof a){case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function ie(a){var c=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function de(a){var c=ie(a)?"checked":"value",v=Object.getOwnPropertyDescriptor(a.constructor.prototype,c),x=""+a[c];if(!a.hasOwnProperty(c)&&typeof v<"u"&&typeof v.get=="function"&&typeof v.set=="function"){var S=v.get,P=v.set;return Object.defineProperty(a,c,{configurable:!0,get:function(){return S.call(this)},set:function(k){x=""+k,P.call(this,k)}}),Object.defineProperty(a,c,{enumerable:v.enumerable}),{getValue:function(){return x},setValue:function(k){x=""+k},stopTracking:function(){a._valueTracker=null,delete a[c]}}}}function ye(a){a._valueTracker||(a._valueTracker=de(a))}function oe(a){if(!a)return!1;var c=a._valueTracker;if(!c)return!0;var v=c.getValue(),x="";return a&&(x=ie(a)?a.checked?"true":"false":a.value),a=x,a!==v?(c.setValue(a),!0):!1}function $e(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}function Me(a,c){var v=c.checked;return J({},c,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:v??a._wrapperState.initialChecked})}function Ye(a,c){var v=c.defaultValue==null?"":c.defaultValue,x=c.checked!=null?c.checked:c.defaultChecked;v=ue(c.value!=null?c.value:v),a._wrapperState={initialChecked:x,initialValue:v,controlled:c.type==="checkbox"||c.type==="radio"?c.checked!=null:c.value!=null}}function lt(a,c){c=c.checked,c!=null&&E(a,"checked",c,!1)}function vt(a,c){lt(a,c);var v=ue(c.value),x=c.type;if(v!=null)x==="number"?(v===0&&a.value===""||a.value!=v)&&(a.value=""+v):a.value!==""+v&&(a.value=""+v);else if(x==="submit"||x==="reset"){a.removeAttribute("value");return}c.hasOwnProperty("value")?Pr(a,c.type,v):c.hasOwnProperty("defaultValue")&&Pr(a,c.type,ue(c.defaultValue)),c.checked==null&&c.defaultChecked!=null&&(a.defaultChecked=!!c.defaultChecked)}function vr(a,c,v){if(c.hasOwnProperty("value")||c.hasOwnProperty("defaultValue")){var x=c.type;if(!(x!=="submit"&&x!=="reset"||c.value!==void 0&&c.value!==null))return;c=""+a._wrapperState.initialValue,v||c===a.value||(a.value=c),a.defaultValue=c}v=a.name,v!==""&&(a.name=""),a.defaultChecked=!!a._wrapperState.initialChecked,v!==""&&(a.name=v)}function Pr(a,c,v){(c!=="number"||$e(a.ownerDocument)!==a)&&(v==null?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+v&&(a.defaultValue=""+v))}var Ar=Array.isArray;function Kt(a,c,v,x){if(a=a.options,c){c={};for(var S=0;S"+c.valueOf().toString()+"",c=Ou.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;c.firstChild;)a.appendChild(c.firstChild)}});function il(a,c){if(c){var v=a.firstChild;if(v&&v===a.lastChild&&v.nodeType===3){v.nodeValue=c;return}}a.textContent=c}var ol={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},i5=["Webkit","ms","Moz","O"];Object.keys(ol).forEach(function(a){i5.forEach(function(c){c=c+a.charAt(0).toUpperCase()+a.substring(1),ol[c]=ol[a]})});function p_(a,c,v){return c==null||typeof c=="boolean"||c===""?"":v||typeof c!="number"||c===0||ol.hasOwnProperty(a)&&ol[a]?(""+c).trim():c+"px"}function m_(a,c){a=a.style;for(var v in c)if(c.hasOwnProperty(v)){var x=v.indexOf("--")===0,S=p_(v,c[v],x);v==="float"&&(v="cssFloat"),x?a.setProperty(v,S):a[v]=S}}var o5=J({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 _m(a,c){if(c){if(o5[a]&&(c.children!=null||c.dangerouslySetInnerHTML!=null))throw Error(r(137,a));if(c.dangerouslySetInnerHTML!=null){if(c.children!=null)throw Error(r(60));if(typeof c.dangerouslySetInnerHTML!="object"||!("__html"in c.dangerouslySetInnerHTML))throw Error(r(61))}if(c.style!=null&&typeof c.style!="object")throw Error(r(62))}}function jm(a,c){if(a.indexOf("-")===-1)return typeof c.is=="string";switch(a){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 Om=null;function Em(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var Pm=null,da=null,ha=null;function v_(a){if(a=Pl(a)){if(typeof Pm!="function")throw Error(r(280));var c=a.stateNode;c&&(c=Ku(c),Pm(a.stateNode,a.type,c))}}function g_(a){da?ha?ha.push(a):ha=[a]:da=a}function y_(){if(da){var a=da,c=ha;if(ha=da=null,v_(a),c)for(a=0;a>>=0,a===0?32:31-(v5(a)/g5|0)|0}var Nu=64,Tu=4194304;function cl(a){switch(a&-a){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 a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return a}}function ku(a,c){var v=a.pendingLanes;if(v===0)return 0;var x=0,S=a.suspendedLanes,P=a.pingedLanes,k=v&268435455;if(k!==0){var q=k&~S;q!==0?x=cl(q):(P&=k,P!==0&&(x=cl(P)))}else k=v&~S,k!==0?x=cl(k):P!==0&&(x=cl(P));if(x===0)return 0;if(c!==0&&c!==x&&(c&S)===0&&(S=x&-x,P=c&-c,S>=P||S===16&&(P&4194240)!==0))return c;if((x&4)!==0&&(x|=v&16),c=a.entangledLanes,c!==0)for(a=a.entanglements,c&=x;0v;v++)c.push(a);return c}function ul(a,c,v){a.pendingLanes|=c,c!==536870912&&(a.suspendedLanes=0,a.pingedLanes=0),a=a.eventTimes,c=31-pn(c),a[c]=v}function w5(a,c){var v=a.pendingLanes&~c;a.pendingLanes=c,a.suspendedLanes=0,a.pingedLanes=0,a.expiredLanes&=c,a.mutableReadLanes&=c,a.entangledLanes&=c,c=a.entanglements;var x=a.eventTimes;for(a=a.expirationTimes;0=yl),V_=" ",G_=!1;function K_(a,c){switch(a){case"keyup":return X5.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function X_(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var va=!1;function Q5(a,c){switch(a){case"compositionend":return X_(c);case"keypress":return c.which!==32?null:(G_=!0,V_);case"textInput":return a=c.data,a===V_&&G_?null:a;default:return null}}function Z5(a,c){if(va)return a==="compositionend"||!Hm&&K_(a,c)?(a=F_(),Lu=Bm=Li=null,va=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1=c)return{node:v,offset:c-a};a=x}e:{for(;v;){if(v.nextSibling){v=v.nextSibling;break e}v=v.parentNode}v=void 0}v=rj(v)}}function ij(a,c){return a&&c?a===c?!0:a&&a.nodeType===3?!1:c&&c.nodeType===3?ij(a,c.parentNode):"contains"in a?a.contains(c):a.compareDocumentPosition?!!(a.compareDocumentPosition(c)&16):!1:!1}function oj(){for(var a=window,c=$e();c instanceof a.HTMLIFrameElement;){try{var v=typeof c.contentWindow.location.href=="string"}catch{v=!1}if(v)a=c.contentWindow;else break;c=$e(a.document)}return c}function Km(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c&&(c==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||c==="textarea"||a.contentEditable==="true")}function sB(a){var c=oj(),v=a.focusedElem,x=a.selectionRange;if(c!==v&&v&&v.ownerDocument&&ij(v.ownerDocument.documentElement,v)){if(x!==null&&Km(v)){if(c=x.start,a=x.end,a===void 0&&(a=c),"selectionStart"in v)v.selectionStart=c,v.selectionEnd=Math.min(a,v.value.length);else if(a=(c=v.ownerDocument||document)&&c.defaultView||window,a.getSelection){a=a.getSelection();var S=v.textContent.length,P=Math.min(x.start,S);x=x.end===void 0?P:Math.min(x.end,S),!a.extend&&P>x&&(S=x,x=P,P=S),S=nj(v,P);var k=nj(v,x);S&&k&&(a.rangeCount!==1||a.anchorNode!==S.node||a.anchorOffset!==S.offset||a.focusNode!==k.node||a.focusOffset!==k.offset)&&(c=c.createRange(),c.setStart(S.node,S.offset),a.removeAllRanges(),P>x?(a.addRange(c),a.extend(k.node,k.offset)):(c.setEnd(k.node,k.offset),a.addRange(c)))}}for(c=[],a=v;a=a.parentNode;)a.nodeType===1&&c.push({element:a,left:a.scrollLeft,top:a.scrollTop});for(typeof v.focus=="function"&&v.focus(),v=0;v=document.documentMode,ga=null,Xm=null,Sl=null,Ym=!1;function aj(a,c,v){var x=v.window===v?v.document:v.nodeType===9?v:v.ownerDocument;Ym||ga==null||ga!==$e(x)||(x=ga,"selectionStart"in x&&Km(x)?x={start:x.selectionStart,end:x.selectionEnd}:(x=(x.ownerDocument&&x.ownerDocument.defaultView||window).getSelection(),x={anchorNode:x.anchorNode,anchorOffset:x.anchorOffset,focusNode:x.focusNode,focusOffset:x.focusOffset}),Sl&&wl(Sl,x)||(Sl=x,x=Hu(Xm,"onSelect"),0Sa||(a.current=lv[Sa],lv[Sa]=null,Sa--)}function dt(a,c){Sa++,lv[Sa]=a.current,a.current=c}var zi={},er=Fi(zi),gr=Fi(!1),yo=zi;function _a(a,c){var v=a.type.contextTypes;if(!v)return zi;var x=a.stateNode;if(x&&x.__reactInternalMemoizedUnmaskedChildContext===c)return x.__reactInternalMemoizedMaskedChildContext;var S={},P;for(P in v)S[P]=c[P];return x&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=c,a.__reactInternalMemoizedMaskedChildContext=S),S}function yr(a){return a=a.childContextTypes,a!=null}function Xu(){yt(gr),yt(er)}function wj(a,c,v){if(er.current!==zi)throw Error(r(168));dt(er,c),dt(gr,v)}function Sj(a,c,v){var x=a.stateNode;if(c=c.childContextTypes,typeof x.getChildContext!="function")return v;x=x.getChildContext();for(var S in x)if(!(S in c))throw Error(r(108,X(a)||"Unknown",S));return J({},v,x)}function Yu(a){return a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||zi,yo=er.current,dt(er,a),dt(gr,gr.current),!0}function _j(a,c,v){var x=a.stateNode;if(!x)throw Error(r(169));v?(a=Sj(a,c,yo),x.__reactInternalMemoizedMergedChildContext=a,yt(gr),yt(er),dt(er,a)):yt(gr),dt(gr,v)}var oi=null,Qu=!1,cv=!1;function jj(a){oi===null?oi=[a]:oi.push(a)}function xB(a){Qu=!0,jj(a)}function qi(){if(!cv&&oi!==null){cv=!0;var a=0,c=ct;try{var v=oi;for(ct=1;a>=k,S-=k,ai=1<<32-pn(c)+S|v<Fe?(Wt=De,De=null):Wt=De.sibling;var tt=le(ee,De,re[Fe],pe);if(tt===null){De===null&&(De=Wt);break}a&&De&&tt.alternate===null&&c(ee,De),K=P(tt,K,Fe),Ie===null?Ne=tt:Ie.sibling=tt,Ie=tt,De=Wt}if(Fe===re.length)return v(ee,De),bt&&bo(ee,Fe),Ne;if(De===null){for(;FeFe?(Wt=De,De=null):Wt=De.sibling;var Qi=le(ee,De,tt.value,pe);if(Qi===null){De===null&&(De=Wt);break}a&&De&&Qi.alternate===null&&c(ee,De),K=P(Qi,K,Fe),Ie===null?Ne=Qi:Ie.sibling=Qi,Ie=Qi,De=Wt}if(tt.done)return v(ee,De),bt&&bo(ee,Fe),Ne;if(De===null){for(;!tt.done;Fe++,tt=re.next())tt=fe(ee,tt.value,pe),tt!==null&&(K=P(tt,K,Fe),Ie===null?Ne=tt:Ie.sibling=tt,Ie=tt);return bt&&bo(ee,Fe),Ne}for(De=x(ee,De);!tt.done;Fe++,tt=re.next())tt=Se(De,ee,Fe,tt.value,pe),tt!==null&&(a&&tt.alternate!==null&&De.delete(tt.key===null?Fe:tt.key),K=P(tt,K,Fe),Ie===null?Ne=tt:Ie.sibling=tt,Ie=tt);return a&&De.forEach(function(JB){return c(ee,JB)}),bt&&bo(ee,Fe),Ne}function Ct(ee,K,re,pe){if(typeof re=="object"&&re!==null&&re.type===T&&re.key===null&&(re=re.props.children),typeof re=="object"&&re!==null){switch(re.$$typeof){case A:e:{for(var Ne=re.key,Ie=K;Ie!==null;){if(Ie.key===Ne){if(Ne=re.type,Ne===T){if(Ie.tag===7){v(ee,Ie.sibling),K=S(Ie,re.props.children),K.return=ee,ee=K;break e}}else if(Ie.elementType===Ne||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===G&&Nj(Ne)===Ie.type){v(ee,Ie.sibling),K=S(Ie,re.props),K.ref=Al(ee,Ie,re),K.return=ee,ee=K;break e}v(ee,Ie);break}else c(ee,Ie);Ie=Ie.sibling}re.type===T?(K=Ao(re.props.children,ee.mode,pe,re.key),K.return=ee,ee=K):(pe=Ef(re.type,re.key,re.props,null,ee.mode,pe),pe.ref=Al(ee,K,re),pe.return=ee,ee=pe)}return k(ee);case C:e:{for(Ie=re.key;K!==null;){if(K.key===Ie)if(K.tag===4&&K.stateNode.containerInfo===re.containerInfo&&K.stateNode.implementation===re.implementation){v(ee,K.sibling),K=S(K,re.children||[]),K.return=ee,ee=K;break e}else{v(ee,K);break}else c(ee,K);K=K.sibling}K=ag(re,ee.mode,pe),K.return=ee,ee=K}return k(ee);case G:return Ie=re._init,Ct(ee,K,Ie(re._payload),pe)}if(Ar(re))return Oe(ee,K,re,pe);if(Q(re))return Ce(ee,K,re,pe);tf(ee,re)}return typeof re=="string"&&re!==""||typeof re=="number"?(re=""+re,K!==null&&K.tag===6?(v(ee,K.sibling),K=S(K,re),K.return=ee,ee=K):(v(ee,K),K=og(re,ee.mode,pe),K.return=ee,ee=K),k(ee)):v(ee,K)}return Ct}var Pa=Tj(!0),kj=Tj(!1),rf=Fi(null),nf=null,Aa=null,mv=null;function vv(){mv=Aa=nf=null}function gv(a){var c=rf.current;yt(rf),a._currentValue=c}function yv(a,c,v){for(;a!==null;){var x=a.alternate;if((a.childLanes&c)!==c?(a.childLanes|=c,x!==null&&(x.childLanes|=c)):x!==null&&(x.childLanes&c)!==c&&(x.childLanes|=c),a===v)break;a=a.return}}function Ca(a,c){nf=a,mv=Aa=null,a=a.dependencies,a!==null&&a.firstContext!==null&&((a.lanes&c)!==0&&(xr=!0),a.firstContext=null)}function Xr(a){var c=a._currentValue;if(mv!==a)if(a={context:a,memoizedValue:c,next:null},Aa===null){if(nf===null)throw Error(r(308));Aa=a,nf.dependencies={lanes:0,firstContext:a}}else Aa=Aa.next=a;return c}var wo=null;function xv(a){wo===null?wo=[a]:wo.push(a)}function Rj(a,c,v,x){var S=c.interleaved;return S===null?(v.next=v,xv(c)):(v.next=S.next,S.next=v),c.interleaved=v,li(a,x)}function li(a,c){a.lanes|=c;var v=a.alternate;for(v!==null&&(v.lanes|=c),v=a,a=a.return;a!==null;)a.childLanes|=c,v=a.alternate,v!==null&&(v.childLanes|=c),v=a,a=a.return;return v.tag===3?v.stateNode:null}var Ui=!1;function bv(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Mj(a,c){a=a.updateQueue,c.updateQueue===a&&(c.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function ci(a,c){return{eventTime:a,lane:c,tag:0,payload:null,callback:null,next:null}}function Wi(a,c,v){var x=a.updateQueue;if(x===null)return null;if(x=x.shared,(Qe&2)!==0){var S=x.pending;return S===null?c.next=c:(c.next=S.next,S.next=c),x.pending=c,li(a,v)}return S=x.interleaved,S===null?(c.next=c,xv(x)):(c.next=S.next,S.next=c),x.interleaved=c,li(a,v)}function of(a,c,v){if(c=c.updateQueue,c!==null&&(c=c.shared,(v&4194240)!==0)){var x=c.lanes;x&=a.pendingLanes,v|=x,c.lanes=v,Mm(a,v)}}function Ij(a,c){var v=a.updateQueue,x=a.alternate;if(x!==null&&(x=x.updateQueue,v===x)){var S=null,P=null;if(v=v.firstBaseUpdate,v!==null){do{var k={eventTime:v.eventTime,lane:v.lane,tag:v.tag,payload:v.payload,callback:v.callback,next:null};P===null?S=P=k:P=P.next=k,v=v.next}while(v!==null);P===null?S=P=c:P=P.next=c}else S=P=c;v={baseState:x.baseState,firstBaseUpdate:S,lastBaseUpdate:P,shared:x.shared,effects:x.effects},a.updateQueue=v;return}a=v.lastBaseUpdate,a===null?v.firstBaseUpdate=c:a.next=c,v.lastBaseUpdate=c}function af(a,c,v,x){var S=a.updateQueue;Ui=!1;var P=S.firstBaseUpdate,k=S.lastBaseUpdate,q=S.shared.pending;if(q!==null){S.shared.pending=null;var H=q,ne=H.next;H.next=null,k===null?P=ne:k.next=ne,k=H;var ce=a.alternate;ce!==null&&(ce=ce.updateQueue,q=ce.lastBaseUpdate,q!==k&&(q===null?ce.firstBaseUpdate=ne:q.next=ne,ce.lastBaseUpdate=H))}if(P!==null){var fe=S.baseState;k=0,ce=ne=H=null,q=P;do{var le=q.lane,Se=q.eventTime;if((x&le)===le){ce!==null&&(ce=ce.next={eventTime:Se,lane:0,tag:q.tag,payload:q.payload,callback:q.callback,next:null});e:{var Oe=a,Ce=q;switch(le=c,Se=v,Ce.tag){case 1:if(Oe=Ce.payload,typeof Oe=="function"){fe=Oe.call(Se,fe,le);break e}fe=Oe;break e;case 3:Oe.flags=Oe.flags&-65537|128;case 0:if(Oe=Ce.payload,le=typeof Oe=="function"?Oe.call(Se,fe,le):Oe,le==null)break e;fe=J({},fe,le);break e;case 2:Ui=!0}}q.callback!==null&&q.lane!==0&&(a.flags|=64,le=S.effects,le===null?S.effects=[q]:le.push(q))}else Se={eventTime:Se,lane:le,tag:q.tag,payload:q.payload,callback:q.callback,next:null},ce===null?(ne=ce=Se,H=fe):ce=ce.next=Se,k|=le;if(q=q.next,q===null){if(q=S.shared.pending,q===null)break;le=q,q=le.next,le.next=null,S.lastBaseUpdate=le,S.shared.pending=null}}while(!0);if(ce===null&&(H=fe),S.baseState=H,S.firstBaseUpdate=ne,S.lastBaseUpdate=ce,c=S.shared.interleaved,c!==null){S=c;do k|=S.lane,S=S.next;while(S!==c)}else P===null&&(S.shared.lanes=0);jo|=k,a.lanes=k,a.memoizedState=fe}}function Dj(a,c,v){if(a=c.effects,c.effects=null,a!==null)for(c=0;cv?v:4,a(!0);var x=Ov.transition;Ov.transition={};try{a(!1),c()}finally{ct=v,Ov.transition=x}}function tO(){return Yr().memoizedState}function _B(a,c,v){var x=Ki(a);if(v={lane:x,action:v,hasEagerState:!1,eagerState:null,next:null},rO(a))nO(c,v);else if(v=Rj(a,c,v,x),v!==null){var S=lr();bn(v,a,x,S),iO(v,c,x)}}function jB(a,c,v){var x=Ki(a),S={lane:x,action:v,hasEagerState:!1,eagerState:null,next:null};if(rO(a))nO(c,S);else{var P=a.alternate;if(a.lanes===0&&(P===null||P.lanes===0)&&(P=c.lastRenderedReducer,P!==null))try{var k=c.lastRenderedState,q=P(k,v);if(S.hasEagerState=!0,S.eagerState=q,mn(q,k)){var H=c.interleaved;H===null?(S.next=S,xv(c)):(S.next=H.next,H.next=S),c.interleaved=S;return}}catch{}finally{}v=Rj(a,c,S,x),v!==null&&(S=lr(),bn(v,a,x,S),iO(v,c,x))}}function rO(a){var c=a.alternate;return a===_t||c!==null&&c===_t}function nO(a,c){kl=cf=!0;var v=a.pending;v===null?c.next=c:(c.next=v.next,v.next=c),a.pending=c}function iO(a,c,v){if((v&4194240)!==0){var x=c.lanes;x&=a.pendingLanes,v|=x,c.lanes=v,Mm(a,v)}}var df={readContext:Xr,useCallback:tr,useContext:tr,useEffect:tr,useImperativeHandle:tr,useInsertionEffect:tr,useLayoutEffect:tr,useMemo:tr,useReducer:tr,useRef:tr,useState:tr,useDebugValue:tr,useDeferredValue:tr,useTransition:tr,useMutableSource:tr,useSyncExternalStore:tr,useId:tr,unstable_isNewReconciler:!1},OB={readContext:Xr,useCallback:function(a,c){return qn().memoizedState=[a,c===void 0?null:c],a},useContext:Xr,useEffect:Gj,useImperativeHandle:function(a,c,v){return v=v!=null?v.concat([a]):null,uf(4194308,4,Yj.bind(null,c,a),v)},useLayoutEffect:function(a,c){return uf(4194308,4,a,c)},useInsertionEffect:function(a,c){return uf(4,2,a,c)},useMemo:function(a,c){var v=qn();return c=c===void 0?null:c,a=a(),v.memoizedState=[a,c],a},useReducer:function(a,c,v){var x=qn();return c=v!==void 0?v(c):c,x.memoizedState=x.baseState=c,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:c},x.queue=a,a=a.dispatch=_B.bind(null,_t,a),[x.memoizedState,a]},useRef:function(a){var c=qn();return a={current:a},c.memoizedState=a},useState:Hj,useDebugValue:kv,useDeferredValue:function(a){return qn().memoizedState=a},useTransition:function(){var a=Hj(!1),c=a[0];return a=SB.bind(null,a[1]),qn().memoizedState=a,[c,a]},useMutableSource:function(){},useSyncExternalStore:function(a,c,v){var x=_t,S=qn();if(bt){if(v===void 0)throw Error(r(407));v=v()}else{if(v=c(),Ut===null)throw Error(r(349));(_o&30)!==0||Fj(x,c,v)}S.memoizedState=v;var P={value:v,getSnapshot:c};return S.queue=P,Gj(qj.bind(null,x,P,a),[a]),x.flags|=2048,Il(9,zj.bind(null,x,P,v,c),void 0,null),v},useId:function(){var a=qn(),c=Ut.identifierPrefix;if(bt){var v=si,x=ai;v=(x&~(1<<32-pn(x)-1)).toString(32)+v,c=":"+c+"R"+v,v=Rl++,0<\/script>",a=a.removeChild(a.firstChild)):typeof x.is=="string"?a=k.createElement(v,{is:x.is}):(a=k.createElement(v),v==="select"&&(k=a,x.multiple?k.multiple=!0:x.size&&(k.size=x.size))):a=k.createElementNS(a,v),a[Fn]=c,a[El]=x,jO(a,c,!1,!1),c.stateNode=a;e:{switch(k=jm(v,x),v){case"dialog":gt("cancel",a),gt("close",a),S=x;break;case"iframe":case"object":case"embed":gt("load",a),S=x;break;case"video":case"audio":for(S=0;S<_l.length;S++)gt(_l[S],a);S=x;break;case"source":gt("error",a),S=x;break;case"img":case"image":case"link":gt("error",a),gt("load",a),S=x;break;case"details":gt("toggle",a),S=x;break;case"input":Ye(a,x),S=Me(a,x),gt("invalid",a);break;case"option":S=x;break;case"select":a._wrapperState={wasMultiple:!!x.multiple},S=J({},x,{value:void 0}),gt("invalid",a);break;case"textarea":fa(a,x),S=Xt(a,x),gt("invalid",a);break;default:S=x}_m(v,S),q=S;for(P in q)if(q.hasOwnProperty(P)){var H=q[P];P==="style"?m_(a,H):P==="dangerouslySetInnerHTML"?(H=H?H.__html:void 0,H!=null&&h_(a,H)):P==="children"?typeof H=="string"?(v!=="textarea"||H!=="")&&il(a,H):typeof H=="number"&&il(a,""+H):P!=="suppressContentEditableWarning"&&P!=="suppressHydrationWarning"&&P!=="autoFocus"&&(i.hasOwnProperty(P)?H!=null&&P==="onScroll"&>("scroll",a):H!=null&&E(a,P,H,k))}switch(v){case"input":ye(a),vr(a,x,!1);break;case"textarea":ye(a),nl(a);break;case"option":x.value!=null&&a.setAttribute("value",""+ue(x.value));break;case"select":a.multiple=!!x.multiple,P=x.value,P!=null?Kt(a,!!x.multiple,P,!1):x.defaultValue!=null&&Kt(a,!!x.multiple,x.defaultValue,!0);break;default:typeof S.onClick=="function"&&(a.onclick=Gu)}switch(v){case"button":case"input":case"select":case"textarea":x=!!x.autoFocus;break e;case"img":x=!0;break e;default:x=!1}}x&&(c.flags|=4)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return rr(c),null;case 6:if(a&&c.stateNode!=null)EO(a,c,a.memoizedProps,x);else{if(typeof x!="string"&&c.stateNode===null)throw Error(r(166));if(v=So(Tl.current),So(zn.current),ef(c)){if(x=c.stateNode,v=c.memoizedProps,x[Fn]=c,(P=x.nodeValue!==v)&&(a=Nr,a!==null))switch(a.tag){case 3:Vu(x.nodeValue,v,(a.mode&1)!==0);break;case 5:a.memoizedProps.suppressHydrationWarning!==!0&&Vu(x.nodeValue,v,(a.mode&1)!==0)}P&&(c.flags|=4)}else x=(v.nodeType===9?v:v.ownerDocument).createTextNode(x),x[Fn]=c,c.stateNode=x}return rr(c),null;case 13:if(yt(St),x=c.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(bt&&Tr!==null&&(c.mode&1)!==0&&(c.flags&128)===0)Cj(),Ea(),c.flags|=98560,P=!1;else if(P=ef(c),x!==null&&x.dehydrated!==null){if(a===null){if(!P)throw Error(r(318));if(P=c.memoizedState,P=P!==null?P.dehydrated:null,!P)throw Error(r(317));P[Fn]=c}else Ea(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;rr(c),P=!1}else vn!==null&&(eg(vn),vn=null),P=!0;if(!P)return c.flags&65536?c:null}return(c.flags&128)!==0?(c.lanes=v,c):(x=x!==null,x!==(a!==null&&a.memoizedState!==null)&&x&&(c.child.flags|=8192,(c.mode&1)!==0&&(a===null||(St.current&1)!==0?It===0&&(It=3):ng())),c.updateQueue!==null&&(c.flags|=4),rr(c),null);case 4:return Na(),Uv(a,c),a===null&&jl(c.stateNode.containerInfo),rr(c),null;case 10:return gv(c.type._context),rr(c),null;case 17:return yr(c.type)&&Xu(),rr(c),null;case 19:if(yt(St),P=c.memoizedState,P===null)return rr(c),null;if(x=(c.flags&128)!==0,k=P.rendering,k===null)if(x)Dl(P,!1);else{if(It!==0||a!==null&&(a.flags&128)!==0)for(a=c.child;a!==null;){if(k=sf(a),k!==null){for(c.flags|=128,Dl(P,!1),x=k.updateQueue,x!==null&&(c.updateQueue=x,c.flags|=4),c.subtreeFlags=0,x=v,v=c.child;v!==null;)P=v,a=x,P.flags&=14680066,k=P.alternate,k===null?(P.childLanes=0,P.lanes=a,P.child=null,P.subtreeFlags=0,P.memoizedProps=null,P.memoizedState=null,P.updateQueue=null,P.dependencies=null,P.stateNode=null):(P.childLanes=k.childLanes,P.lanes=k.lanes,P.child=k.child,P.subtreeFlags=0,P.deletions=null,P.memoizedProps=k.memoizedProps,P.memoizedState=k.memoizedState,P.updateQueue=k.updateQueue,P.type=k.type,a=k.dependencies,P.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),v=v.sibling;return dt(St,St.current&1|2),c.child}a=a.sibling}P.tail!==null&&At()>Ma&&(c.flags|=128,x=!0,Dl(P,!1),c.lanes=4194304)}else{if(!x)if(a=sf(k),a!==null){if(c.flags|=128,x=!0,v=a.updateQueue,v!==null&&(c.updateQueue=v,c.flags|=4),Dl(P,!0),P.tail===null&&P.tailMode==="hidden"&&!k.alternate&&!bt)return rr(c),null}else 2*At()-P.renderingStartTime>Ma&&v!==1073741824&&(c.flags|=128,x=!0,Dl(P,!1),c.lanes=4194304);P.isBackwards?(k.sibling=c.child,c.child=k):(v=P.last,v!==null?v.sibling=k:c.child=k,P.last=k)}return P.tail!==null?(c=P.tail,P.rendering=c,P.tail=c.sibling,P.renderingStartTime=At(),c.sibling=null,v=St.current,dt(St,x?v&1|2:v&1),c):(rr(c),null);case 22:case 23:return rg(),x=c.memoizedState!==null,a!==null&&a.memoizedState!==null!==x&&(c.flags|=8192),x&&(c.mode&1)!==0?(kr&1073741824)!==0&&(rr(c),c.subtreeFlags&6&&(c.flags|=8192)):rr(c),null;case 24:return null;case 25:return null}throw Error(r(156,c.tag))}function RB(a,c){switch(fv(c),c.tag){case 1:return yr(c.type)&&Xu(),a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 3:return Na(),yt(gr),yt(er),jv(),a=c.flags,(a&65536)!==0&&(a&128)===0?(c.flags=a&-65537|128,c):null;case 5:return Sv(c),null;case 13:if(yt(St),a=c.memoizedState,a!==null&&a.dehydrated!==null){if(c.alternate===null)throw Error(r(340));Ea()}return a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 19:return yt(St),null;case 4:return Na(),null;case 10:return gv(c.type._context),null;case 22:case 23:return rg(),null;case 24:return null;default:return null}}var vf=!1,nr=!1,MB=typeof WeakSet=="function"?WeakSet:Set,_e=null;function ka(a,c){var v=a.ref;if(v!==null)if(typeof v=="function")try{v(null)}catch(x){jt(a,c,x)}else v.current=null}function Wv(a,c,v){try{v()}catch(x){jt(a,c,x)}}var PO=!1;function IB(a,c){if(rv=Iu,a=oj(),Km(a)){if("selectionStart"in a)var v={start:a.selectionStart,end:a.selectionEnd};else e:{v=(v=a.ownerDocument)&&v.defaultView||window;var x=v.getSelection&&v.getSelection();if(x&&x.rangeCount!==0){v=x.anchorNode;var S=x.anchorOffset,P=x.focusNode;x=x.focusOffset;try{v.nodeType,P.nodeType}catch{v=null;break e}var k=0,q=-1,H=-1,ne=0,ce=0,fe=a,le=null;t:for(;;){for(var Se;fe!==v||S!==0&&fe.nodeType!==3||(q=k+S),fe!==P||x!==0&&fe.nodeType!==3||(H=k+x),fe.nodeType===3&&(k+=fe.nodeValue.length),(Se=fe.firstChild)!==null;)le=fe,fe=Se;for(;;){if(fe===a)break t;if(le===v&&++ne===S&&(q=k),le===P&&++ce===x&&(H=k),(Se=fe.nextSibling)!==null)break;fe=le,le=fe.parentNode}fe=Se}v=q===-1||H===-1?null:{start:q,end:H}}else v=null}v=v||{start:0,end:0}}else v=null;for(nv={focusedElem:a,selectionRange:v},Iu=!1,_e=c;_e!==null;)if(c=_e,a=c.child,(c.subtreeFlags&1028)!==0&&a!==null)a.return=c,_e=a;else for(;_e!==null;){c=_e;try{var Oe=c.alternate;if((c.flags&1024)!==0)switch(c.tag){case 0:case 11:case 15:break;case 1:if(Oe!==null){var Ce=Oe.memoizedProps,Ct=Oe.memoizedState,ee=c.stateNode,K=ee.getSnapshotBeforeUpdate(c.elementType===c.type?Ce:gn(c.type,Ce),Ct);ee.__reactInternalSnapshotBeforeUpdate=K}break;case 3:var re=c.stateNode.containerInfo;re.nodeType===1?re.textContent="":re.nodeType===9&&re.documentElement&&re.removeChild(re.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(pe){jt(c,c.return,pe)}if(a=c.sibling,a!==null){a.return=c.return,_e=a;break}_e=c.return}return Oe=PO,PO=!1,Oe}function Ll(a,c,v){var x=c.updateQueue;if(x=x!==null?x.lastEffect:null,x!==null){var S=x=x.next;do{if((S.tag&a)===a){var P=S.destroy;S.destroy=void 0,P!==void 0&&Wv(c,v,P)}S=S.next}while(S!==x)}}function gf(a,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var v=c=c.next;do{if((v.tag&a)===a){var x=v.create;v.destroy=x()}v=v.next}while(v!==c)}}function Hv(a){var c=a.ref;if(c!==null){var v=a.stateNode;switch(a.tag){case 5:a=v;break;default:a=v}typeof c=="function"?c(a):c.current=a}}function AO(a){var c=a.alternate;c!==null&&(a.alternate=null,AO(c)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(c=a.stateNode,c!==null&&(delete c[Fn],delete c[El],delete c[sv],delete c[gB],delete c[yB])),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}function CO(a){return a.tag===5||a.tag===3||a.tag===4}function NO(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||CO(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function Vv(a,c,v){var x=a.tag;if(x===5||x===6)a=a.stateNode,c?v.nodeType===8?v.parentNode.insertBefore(a,c):v.insertBefore(a,c):(v.nodeType===8?(c=v.parentNode,c.insertBefore(a,v)):(c=v,c.appendChild(a)),v=v._reactRootContainer,v!=null||c.onclick!==null||(c.onclick=Gu));else if(x!==4&&(a=a.child,a!==null))for(Vv(a,c,v),a=a.sibling;a!==null;)Vv(a,c,v),a=a.sibling}function Gv(a,c,v){var x=a.tag;if(x===5||x===6)a=a.stateNode,c?v.insertBefore(a,c):v.appendChild(a);else if(x!==4&&(a=a.child,a!==null))for(Gv(a,c,v),a=a.sibling;a!==null;)Gv(a,c,v),a=a.sibling}var Yt=null,yn=!1;function Hi(a,c,v){for(v=v.child;v!==null;)TO(a,c,v),v=v.sibling}function TO(a,c,v){if(Bn&&typeof Bn.onCommitFiberUnmount=="function")try{Bn.onCommitFiberUnmount(Cu,v)}catch{}switch(v.tag){case 5:nr||ka(v,c);case 6:var x=Yt,S=yn;Yt=null,Hi(a,c,v),Yt=x,yn=S,Yt!==null&&(yn?(a=Yt,v=v.stateNode,a.nodeType===8?a.parentNode.removeChild(v):a.removeChild(v)):Yt.removeChild(v.stateNode));break;case 18:Yt!==null&&(yn?(a=Yt,v=v.stateNode,a.nodeType===8?av(a.parentNode,v):a.nodeType===1&&av(a,v),ml(a)):av(Yt,v.stateNode));break;case 4:x=Yt,S=yn,Yt=v.stateNode.containerInfo,yn=!0,Hi(a,c,v),Yt=x,yn=S;break;case 0:case 11:case 14:case 15:if(!nr&&(x=v.updateQueue,x!==null&&(x=x.lastEffect,x!==null))){S=x=x.next;do{var P=S,k=P.destroy;P=P.tag,k!==void 0&&((P&2)!==0||(P&4)!==0)&&Wv(v,c,k),S=S.next}while(S!==x)}Hi(a,c,v);break;case 1:if(!nr&&(ka(v,c),x=v.stateNode,typeof x.componentWillUnmount=="function"))try{x.props=v.memoizedProps,x.state=v.memoizedState,x.componentWillUnmount()}catch(q){jt(v,c,q)}Hi(a,c,v);break;case 21:Hi(a,c,v);break;case 22:v.mode&1?(nr=(x=nr)||v.memoizedState!==null,Hi(a,c,v),nr=x):Hi(a,c,v);break;default:Hi(a,c,v)}}function kO(a){var c=a.updateQueue;if(c!==null){a.updateQueue=null;var v=a.stateNode;v===null&&(v=a.stateNode=new MB),c.forEach(function(x){var S=WB.bind(null,a,x);v.has(x)||(v.add(x),x.then(S,S))})}}function xn(a,c){var v=c.deletions;if(v!==null)for(var x=0;xS&&(S=k),x&=~P}if(x=S,x=At()-x,x=(120>x?120:480>x?480:1080>x?1080:1920>x?1920:3e3>x?3e3:4320>x?4320:1960*LB(x/1960))-x,10a?16:a,Gi===null)var x=!1;else{if(a=Gi,Gi=null,Sf=0,(Qe&6)!==0)throw Error(r(331));var S=Qe;for(Qe|=4,_e=a.current;_e!==null;){var P=_e,k=P.child;if((_e.flags&16)!==0){var q=P.deletions;if(q!==null){for(var H=0;HAt()-Yv?Eo(a,0):Xv|=v),wr(a,c)}function HO(a,c){c===0&&((a.mode&1)===0?c=1:(c=Tu,Tu<<=1,(Tu&130023424)===0&&(Tu=4194304)));var v=lr();a=li(a,c),a!==null&&(ul(a,c,v),wr(a,v))}function UB(a){var c=a.memoizedState,v=0;c!==null&&(v=c.retryLane),HO(a,v)}function WB(a,c){var v=0;switch(a.tag){case 13:var x=a.stateNode,S=a.memoizedState;S!==null&&(v=S.retryLane);break;case 19:x=a.stateNode;break;default:throw Error(r(314))}x!==null&&x.delete(c),HO(a,v)}var VO;VO=function(a,c,v){if(a!==null)if(a.memoizedProps!==c.pendingProps||gr.current)xr=!0;else{if((a.lanes&v)===0&&(c.flags&128)===0)return xr=!1,TB(a,c,v);xr=(a.flags&131072)!==0}else xr=!1,bt&&(c.flags&1048576)!==0&&Oj(c,Ju,c.index);switch(c.lanes=0,c.tag){case 2:var x=c.type;mf(a,c),a=c.pendingProps;var S=_a(c,er.current);Ca(c,v),S=Pv(null,c,x,a,S,v);var P=Av();return c.flags|=1,typeof S=="object"&&S!==null&&typeof S.render=="function"&&S.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,yr(x)?(P=!0,Yu(c)):P=!1,c.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,bv(c),S.updater=hf,c.stateNode=S,S._reactInternals=c,Mv(c,x,a,v),c=$v(null,c,x,!0,P,v)):(c.tag=0,bt&&P&&uv(c),sr(null,c,S,v),c=c.child),c;case 16:x=c.elementType;e:{switch(mf(a,c),a=c.pendingProps,S=x._init,x=S(x._payload),c.type=x,S=c.tag=VB(x),a=gn(x,a),S){case 0:c=Lv(null,c,x,a,v);break e;case 1:c=yO(null,c,x,a,v);break e;case 11:c=hO(null,c,x,a,v);break e;case 14:c=pO(null,c,x,gn(x.type,a),v);break e}throw Error(r(306,x,""))}return c;case 0:return x=c.type,S=c.pendingProps,S=c.elementType===x?S:gn(x,S),Lv(a,c,x,S,v);case 1:return x=c.type,S=c.pendingProps,S=c.elementType===x?S:gn(x,S),yO(a,c,x,S,v);case 3:e:{if(xO(c),a===null)throw Error(r(387));x=c.pendingProps,P=c.memoizedState,S=P.element,Mj(a,c),af(c,x,null,v);var k=c.memoizedState;if(x=k.element,P.isDehydrated)if(P={element:x,isDehydrated:!1,cache:k.cache,pendingSuspenseBoundaries:k.pendingSuspenseBoundaries,transitions:k.transitions},c.updateQueue.baseState=P,c.memoizedState=P,c.flags&256){S=Ta(Error(r(423)),c),c=bO(a,c,x,v,S);break e}else if(x!==S){S=Ta(Error(r(424)),c),c=bO(a,c,x,v,S);break e}else for(Tr=Bi(c.stateNode.containerInfo.firstChild),Nr=c,bt=!0,vn=null,v=kj(c,null,x,v),c.child=v;v;)v.flags=v.flags&-3|4096,v=v.sibling;else{if(Ea(),x===S){c=ui(a,c,v);break e}sr(a,c,x,v)}c=c.child}return c;case 5:return Lj(c),a===null&&hv(c),x=c.type,S=c.pendingProps,P=a!==null?a.memoizedProps:null,k=S.children,iv(x,S)?k=null:P!==null&&iv(x,P)&&(c.flags|=32),gO(a,c),sr(a,c,k,v),c.child;case 6:return a===null&&hv(c),null;case 13:return wO(a,c,v);case 4:return wv(c,c.stateNode.containerInfo),x=c.pendingProps,a===null?c.child=Pa(c,null,x,v):sr(a,c,x,v),c.child;case 11:return x=c.type,S=c.pendingProps,S=c.elementType===x?S:gn(x,S),hO(a,c,x,S,v);case 7:return sr(a,c,c.pendingProps,v),c.child;case 8:return sr(a,c,c.pendingProps.children,v),c.child;case 12:return sr(a,c,c.pendingProps.children,v),c.child;case 10:e:{if(x=c.type._context,S=c.pendingProps,P=c.memoizedProps,k=S.value,dt(rf,x._currentValue),x._currentValue=k,P!==null)if(mn(P.value,k)){if(P.children===S.children&&!gr.current){c=ui(a,c,v);break e}}else for(P=c.child,P!==null&&(P.return=c);P!==null;){var q=P.dependencies;if(q!==null){k=P.child;for(var H=q.firstContext;H!==null;){if(H.context===x){if(P.tag===1){H=ci(-1,v&-v),H.tag=2;var ne=P.updateQueue;if(ne!==null){ne=ne.shared;var ce=ne.pending;ce===null?H.next=H:(H.next=ce.next,ce.next=H),ne.pending=H}}P.lanes|=v,H=P.alternate,H!==null&&(H.lanes|=v),yv(P.return,v,c),q.lanes|=v;break}H=H.next}}else if(P.tag===10)k=P.type===c.type?null:P.child;else if(P.tag===18){if(k=P.return,k===null)throw Error(r(341));k.lanes|=v,q=k.alternate,q!==null&&(q.lanes|=v),yv(k,v,c),k=P.sibling}else k=P.child;if(k!==null)k.return=P;else for(k=P;k!==null;){if(k===c){k=null;break}if(P=k.sibling,P!==null){P.return=k.return,k=P;break}k=k.return}P=k}sr(a,c,S.children,v),c=c.child}return c;case 9:return S=c.type,x=c.pendingProps.children,Ca(c,v),S=Xr(S),x=x(S),c.flags|=1,sr(a,c,x,v),c.child;case 14:return x=c.type,S=gn(x,c.pendingProps),S=gn(x.type,S),pO(a,c,x,S,v);case 15:return mO(a,c,c.type,c.pendingProps,v);case 17:return x=c.type,S=c.pendingProps,S=c.elementType===x?S:gn(x,S),mf(a,c),c.tag=1,yr(x)?(a=!0,Yu(c)):a=!1,Ca(c,v),aO(c,x,S),Mv(c,x,S,v),$v(null,c,x,!0,a,v);case 19:return _O(a,c,v);case 22:return vO(a,c,v)}throw Error(r(156,c.tag))};function GO(a,c){return E_(a,c)}function HB(a,c,v,x){this.tag=a,this.key=v,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=x,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Zr(a,c,v,x){return new HB(a,c,v,x)}function ig(a){return a=a.prototype,!(!a||!a.isReactComponent)}function VB(a){if(typeof a=="function")return ig(a)?1:0;if(a!=null){if(a=a.$$typeof,a===L)return 11;if(a===V)return 14}return 2}function Yi(a,c){var v=a.alternate;return v===null?(v=Zr(a.tag,c,a.key,a.mode),v.elementType=a.elementType,v.type=a.type,v.stateNode=a.stateNode,v.alternate=a,a.alternate=v):(v.pendingProps=c,v.type=a.type,v.flags=0,v.subtreeFlags=0,v.deletions=null),v.flags=a.flags&14680064,v.childLanes=a.childLanes,v.lanes=a.lanes,v.child=a.child,v.memoizedProps=a.memoizedProps,v.memoizedState=a.memoizedState,v.updateQueue=a.updateQueue,c=a.dependencies,v.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},v.sibling=a.sibling,v.index=a.index,v.ref=a.ref,v}function Ef(a,c,v,x,S,P){var k=2;if(x=a,typeof a=="function")ig(a)&&(k=1);else if(typeof a=="string")k=5;else e:switch(a){case T:return Ao(v.children,S,P,c);case R:k=8,S|=8;break;case I:return a=Zr(12,v,c,S|2),a.elementType=I,a.lanes=P,a;case U:return a=Zr(13,v,c,S),a.elementType=U,a.lanes=P,a;case W:return a=Zr(19,v,c,S),a.elementType=W,a.lanes=P,a;case Y:return Pf(v,S,P,c);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case z:k=10;break e;case $:k=9;break e;case L:k=11;break e;case V:k=14;break e;case G:k=16,x=null;break e}throw Error(r(130,a==null?a:typeof a,""))}return c=Zr(k,v,c,S),c.elementType=a,c.type=x,c.lanes=P,c}function Ao(a,c,v,x){return a=Zr(7,a,x,c),a.lanes=v,a}function Pf(a,c,v,x){return a=Zr(22,a,x,c),a.elementType=Y,a.lanes=v,a.stateNode={isHidden:!1},a}function og(a,c,v){return a=Zr(6,a,null,c),a.lanes=v,a}function ag(a,c,v){return c=Zr(4,a.children!==null?a.children:[],a.key,c),c.lanes=v,c.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},c}function GB(a,c,v,x,S){this.tag=c,this.containerInfo=a,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Rm(0),this.expirationTimes=Rm(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Rm(0),this.identifierPrefix=x,this.onRecoverableError=S,this.mutableSourceEagerHydrationData=null}function sg(a,c,v,x,S,P,k,q,H){return a=new GB(a,c,v,q,H),c===1?(c=1,P===!0&&(c|=8)):c=0,P=Zr(3,null,null,c),a.current=P,P.stateNode=a,P.memoizedState={element:x,isDehydrated:v,cache:null,transitions:null,pendingSuspenseBoundaries:null},bv(P),a}function KB(a,c,v){var x=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),hg.exports=a8(),hg.exports}var sE;function s8(){if(sE)return If;sE=1;var e=GR();return If.createRoot=e.createRoot,If.hydrateRoot=e.hydrateRoot,If}var l8=s8(),_=cp();const F=ot(_),Ew=e8({__proto__:null,default:F},[_]);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const c8=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),u8=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase()),lE=e=>{const t=u8(e);return t.charAt(0).toUpperCase()+t.slice(1)},KR=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */var f8={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const d8=_.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:i="",children:o,iconNode:s,...u},f)=>_.createElement("svg",{ref:f,...f8,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:KR("lucide",i),...u},[...s.map(([l,d])=>_.createElement(l,d)),...Array.isArray(o)?o:[o]]));/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Re=(e,t)=>{const r=_.forwardRef(({className:n,...i},o)=>_.createElement(d8,{ref:o,iconNode:t,className:KR(`lucide-${c8(lE(e))}`,`lucide-${e}`,n),...i}));return r.displayName=lE(e),r};/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const h8=[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"M20 8h-5",key:"1vsyxs"}],["path",{d:"M15 10V6.5a2.5 2.5 0 0 1 5 0V10",key:"ag13bf"}],["path",{d:"M15 14h5l-5 6h5",key:"ur5jdg"}]],p8=Re("arrow-down-a-z",h8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const m8=[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]],v8=Re("arrow-down-right",m8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const g8=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],y8=Re("arrow-left",g8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const x8=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],b8=Re("arrow-up-down",x8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const w8=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],XR=Re("arrow-up-right",w8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const S8=[["path",{d:"M3 5v14",key:"1nt18q"}],["path",{d:"M8 5v14",key:"1ybrkv"}],["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"M17 5v14",key:"ycjyhj"}],["path",{d:"M21 5v14",key:"nzette"}]],_8=Re("barcode",S8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const j8=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],O8=Re("bell",j8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const E8=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],P8=Re("calendar",E8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const A8=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],C8=Re("chart-column",A8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const N8=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],YR=Re("check",N8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const T8=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],xc=Re("chevron-down",T8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const k8=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],QR=Re("chevron-left",k8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const R8=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],bc=Re("chevron-right",R8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const M8=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],I8=Re("chevron-up",M8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const D8=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Wd=Re("circle-help",D8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const L8=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]],$8=Re("circle-user",L8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const B8=[["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M14 2v2",key:"6buw04"}],["path",{d:"M16 8a1 1 0 0 1 1 1v8a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1h14a4 4 0 1 1 0 8h-1",key:"pwadti"}],["path",{d:"M6 2v2",key:"colzsn"}]],F8=Re("coffee",B8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const z8=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]],Pw=Re("download",z8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const q8=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],Aw=Re("ellipsis",q8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const U8=[["path",{d:"M14.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"16lz6z"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M3 13.1a2 2 0 0 0-1 1.76v3.24a2 2 0 0 0 .97 1.78L6 21.7a2 2 0 0 0 2.03.01L11 19.9a2 2 0 0 0 1-1.76V14.9a2 2 0 0 0-.97-1.78L8 11.3a2 2 0 0 0-2.03-.01Z",key:"99pj1s"}],["path",{d:"M7 17v5",key:"1yj1jh"}],["path",{d:"M11.7 14.2 7 17l-4.7-2.8",key:"1yk8tc"}]],ZR=Re("file-box",U8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const W8=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],us=Re("file-text",W8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const H8=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],V8=Re("grid-3x3",H8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const G8=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],Wo=Re("image",G8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const K8=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],JR=Re("layers",K8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const X8=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],eM=Re("layout-dashboard",X8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Y8=[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]],Q8=Re("list",Y8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Z8=[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]],J8=Re("log-out",Z8);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const e6=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],Fs=Re("map-pin",e6);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const t6=[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]],r6=Re("menu",t6);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const n6=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],Hd=Re("package",n6);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const i6=[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]],tM=Re("palette",i6);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const o6=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Bd=Re("pencil",o6);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const a6=[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]],s6=Re("pin",a6);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const l6=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],jr=Re("plus",l6);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const c6=[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]],rM=Re("printer",c6);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const u6=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],f6=Re("refresh-cw",u6);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const d6=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],h6=Re("save",d6);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const p6=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],Cw=Re("search",p6);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const m6=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Vd=Re("settings",m6);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const v6=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],g6=Re("shield",v6);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const y6=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],ro=Re("square-pen",y6);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const x6=[["path",{d:"m2 7 4.41-4.41A2 2 0 0 1 7.83 2h8.34a2 2 0 0 1 1.42.59L22 7",key:"ztvudi"}],["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}],["path",{d:"M15 22v-4a2 2 0 0 0-2-2h-2a2 2 0 0 0-2 2v4",key:"2ebpfo"}],["path",{d:"M2 7h20",key:"1fcdvo"}],["path",{d:"M22 7v3a2 2 0 0 1-2 2a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 16 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 12 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 8 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 4 12a2 2 0 0 1-2-2V7",key:"6c3vgh"}]],b6=Re("store",x6);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const w6=[["path",{d:"m18 2 4 4",key:"22kx64"}],["path",{d:"m17 7 3-3",key:"1w1zoj"}],["path",{d:"M19 9 8.7 19.3c-1 1-2.5 1-3.4 0l-.6-.6c-1-1-1-2.5 0-3.4L15 5",key:"1exhtz"}],["path",{d:"m9 11 4 4",key:"rovt3i"}],["path",{d:"m5 19-3 3",key:"59f2uf"}],["path",{d:"m14 4 6 6",key:"yqp9t2"}]],vg=Re("syringe",w6);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const S6=[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["line",{x1:"12",x2:"12.01",y1:"18",y2:"18",key:"1dp563"}]],_6=Re("tablet",S6);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const j6=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],Gd=Re("tag",j6);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const O6=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],E6=Re("timer",O6);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const P6=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],Fb=Re("trash-2",P6);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const A6=[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]],C6=Re("trending-up",A6);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const N6=[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]],up=Re("type",N6);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const T6=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]],k6=Re("upload",T6);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const R6=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],M6=Re("user",R6);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const I6=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]],Nw=Re("users",I6);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const D6=[["path",{d:"M3 2v7c0 1.1.9 2 2 2h4a2 2 0 0 0 2-2V2",key:"cjf0a3"}],["path",{d:"M7 2v20",key:"1473qp"}],["path",{d:"M21 15V2a5 5 0 0 0-5 5v6c0 1.1.9 2 2 2h3Zm0 0v7",key:"j28e5"}]],L6=Re("utensils",D6);/** - * @license lucide-react v0.487.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const $6=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],uc=Re("x",$6);function nM(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t{const r=new Array(e.length+t.length);for(let n=0;n({classGroupId:e,validator:t}),iM=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),Kd="-",cE=[],z6="arbitrary..",q6=e=>{const t=W6(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return U6(s);const u=s.split(Kd),f=u[0]===""&&u.length>1?1:0;return oM(u,f,t)},getConflictingClassGroupIds:(s,u)=>{if(u){const f=n[s],l=r[s];return f?l?B6(l,f):f:l||cE}return r[s]||cE}}},oM=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const i=e[t],o=r.nextPart.get(i);if(o){const l=oM(e,t+1,o);if(l)return l}const s=r.validators;if(s===null)return;const u=t===0?e.join(Kd):e.slice(t).join(Kd),f=s.length;for(let l=0;le.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?z6+n:void 0})(),W6=e=>{const{theme:t,classGroups:r}=e;return H6(r,t)},H6=(e,t)=>{const r=iM();for(const n in e){const i=e[n];Tw(i,r,n,t)}return r},Tw=(e,t,r,n)=>{const i=e.length;for(let o=0;o{if(typeof e=="string"){G6(e,t,r);return}if(typeof e=="function"){K6(e,t,r,n);return}X6(e,t,r,n)},G6=(e,t,r)=>{const n=e===""?t:aM(t,e);n.classGroupId=r},K6=(e,t,r,n)=>{if(Y6(e)){Tw(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(F6(r,e))},X6=(e,t,r,n)=>{const i=Object.entries(e),o=i.length;for(let s=0;s{let r=e;const n=t.split(Kd),i=n.length;for(let o=0;o"isThemeGetter"in e&&e.isThemeGetter===!0,Q6=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const i=(o,s)=>{r[o]=s,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(o){let s=r[o];if(s!==void 0)return s;if((s=n[o])!==void 0)return i(o,s),s},set(o,s){o in r?r[o]=s:i(o,s)}}},zb="!",uE=":",Z6=[],fE=(e,t,r,n,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:i}),J6=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=i=>{const o=[];let s=0,u=0,f=0,l;const d=i.length;for(let y=0;yf?l-f:void 0;return fE(o,g,m,b)};if(t){const i=t+uE,o=n;n=s=>s.startsWith(i)?o(s.slice(i.length)):fE(Z6,!1,s,void 0,!0)}if(r){const i=n;n=o=>r({className:o,parseClassName:i})}return n},eF=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let i=[];for(let o=0;o0&&(i.sort(),n.push(...i),i=[]),n.push(s)):i.push(s)}return i.length>0&&(i.sort(),n.push(...i)),n}},tF=e=>({cache:Q6(e.cacheSize),parseClassName:J6(e),sortModifiers:eF(e),...q6(e)}),rF=/\s+/,nF=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i,sortModifiers:o}=t,s=[],u=e.trim().split(rF);let f="";for(let l=u.length-1;l>=0;l-=1){const d=u[l],{isExternal:p,modifiers:m,hasImportantModifier:g,baseClassName:b,maybePostfixModifierPosition:y}=r(d);if(p){f=d+(f.length>0?" "+f:f);continue}let w=!!y,j=n(w?b.substring(0,y):b);if(!j){if(!w){f=d+(f.length>0?" "+f:f);continue}if(j=n(b),!j){f=d+(f.length>0?" "+f:f);continue}w=!1}const O=m.length===0?"":m.length===1?m[0]:o(m).join(":"),E=g?O+zb:O,N=E+j;if(s.indexOf(N)>-1)continue;s.push(N);const A=i(j,w);for(let C=0;C0?" "+f:f)}return f},iF=(...e)=>{let t=0,r,n,i="";for(;t{if(typeof e=="string")return e;let t,r="";for(let n=0;n{let r,n,i,o;const s=f=>{const l=t.reduce((d,p)=>p(d),e());return r=tF(l),n=r.cache.get,i=r.cache.set,o=u,u(f)},u=f=>{const l=n(f);if(l)return l;const d=nF(f,r);return i(f,d),d};return o=s,(...f)=>o(iF(...f))},aF=[],Dt=e=>{const t=r=>r[e]||aF;return t.isThemeGetter=!0,t},lM=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,cM=/^\((?:(\w[\w-]*):)?(.+)\)$/i,sF=/^\d+\/\d+$/,lF=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,cF=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,uF=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,fF=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,dF=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Da=e=>sF.test(e),He=e=>!!e&&!Number.isNaN(Number(e)),Zi=e=>!!e&&Number.isInteger(Number(e)),gg=e=>e.endsWith("%")&&He(e.slice(0,-1)),di=e=>lF.test(e),hF=()=>!0,pF=e=>cF.test(e)&&!uF.test(e),uM=()=>!1,mF=e=>fF.test(e),vF=e=>dF.test(e),gF=e=>!Ee(e)&&!Pe(e),yF=e=>zs(e,hM,uM),Ee=e=>lM.test(e),Co=e=>zs(e,pM,pF),yg=e=>zs(e,_F,He),dE=e=>zs(e,fM,uM),xF=e=>zs(e,dM,vF),Df=e=>zs(e,mM,mF),Pe=e=>cM.test(e),Ul=e=>qs(e,pM),bF=e=>qs(e,jF),hE=e=>qs(e,fM),wF=e=>qs(e,hM),SF=e=>qs(e,dM),Lf=e=>qs(e,mM,!0),zs=(e,t,r)=>{const n=lM.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},qs=(e,t,r=!1)=>{const n=cM.exec(e);return n?n[1]?t(n[1]):r:!1},fM=e=>e==="position"||e==="percentage",dM=e=>e==="image"||e==="url",hM=e=>e==="length"||e==="size"||e==="bg-size",pM=e=>e==="length",_F=e=>e==="number",jF=e=>e==="family-name",mM=e=>e==="shadow",OF=()=>{const e=Dt("color"),t=Dt("font"),r=Dt("text"),n=Dt("font-weight"),i=Dt("tracking"),o=Dt("leading"),s=Dt("breakpoint"),u=Dt("container"),f=Dt("spacing"),l=Dt("radius"),d=Dt("shadow"),p=Dt("inset-shadow"),m=Dt("text-shadow"),g=Dt("drop-shadow"),b=Dt("blur"),y=Dt("perspective"),w=Dt("aspect"),j=Dt("ease"),O=Dt("animate"),E=()=>["auto","avoid","all","avoid-page","page","left","right","column"],N=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],A=()=>[...N(),Pe,Ee],C=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],R=()=>[Pe,Ee,f],I=()=>[Da,"full","auto",...R()],z=()=>[Zi,"none","subgrid",Pe,Ee],$=()=>["auto",{span:["full",Zi,Pe,Ee]},Zi,Pe,Ee],L=()=>[Zi,"auto",Pe,Ee],U=()=>["auto","min","max","fr",Pe,Ee],W=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],V=()=>["start","end","center","stretch","center-safe","end-safe"],G=()=>["auto",...R()],Y=()=>[Da,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],D=()=>[e,Pe,Ee],Q=()=>[...N(),hE,dE,{position:[Pe,Ee]}],J=()=>["no-repeat",{repeat:["","x","y","space","round"]}],M=()=>["auto","cover","contain",wF,yF,{size:[Pe,Ee]}],B=()=>[gg,Ul,Co],Z=()=>["","none","full",l,Pe,Ee],te=()=>["",He,Ul,Co],ve=()=>["solid","dashed","dotted","double"],xe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],X=()=>[He,gg,hE,dE],ue=()=>["","none",b,Pe,Ee],ie=()=>["none",He,Pe,Ee],de=()=>["none",He,Pe,Ee],ye=()=>[He,Pe,Ee],oe=()=>[Da,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[di],breakpoint:[di],color:[hF],container:[di],"drop-shadow":[di],ease:["in","out","in-out"],font:[gF],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[di],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[di],shadow:[di],spacing:["px",He],text:[di],"text-shadow":[di],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Da,Ee,Pe,w]}],container:["container"],columns:[{columns:[He,Ee,Pe,u]}],"break-after":[{"break-after":E()}],"break-before":[{"break-before":E()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:A()}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{start:I()}],end:[{end:I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[Zi,"auto",Pe,Ee]}],basis:[{basis:[Da,"full","auto",u,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[He,Da,"auto","initial","none",Ee]}],grow:[{grow:["",He,Pe,Ee]}],shrink:[{shrink:["",He,Pe,Ee]}],order:[{order:[Zi,"first","last","none",Pe,Ee]}],"grid-cols":[{"grid-cols":z()}],"col-start-end":[{col:$()}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":z()}],"row-start-end":[{row:$()}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":U()}],"auto-rows":[{"auto-rows":U()}],gap:[{gap:R()}],"gap-x":[{"gap-x":R()}],"gap-y":[{"gap-y":R()}],"justify-content":[{justify:[...W(),"normal"]}],"justify-items":[{"justify-items":[...V(),"normal"]}],"justify-self":[{"justify-self":["auto",...V()]}],"align-content":[{content:["normal",...W()]}],"align-items":[{items:[...V(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...V(),{baseline:["","last"]}]}],"place-content":[{"place-content":W()}],"place-items":[{"place-items":[...V(),"baseline"]}],"place-self":[{"place-self":["auto",...V()]}],p:[{p:R()}],px:[{px:R()}],py:[{py:R()}],ps:[{ps:R()}],pe:[{pe:R()}],pt:[{pt:R()}],pr:[{pr:R()}],pb:[{pb:R()}],pl:[{pl:R()}],m:[{m:G()}],mx:[{mx:G()}],my:[{my:G()}],ms:[{ms:G()}],me:[{me:G()}],mt:[{mt:G()}],mr:[{mr:G()}],mb:[{mb:G()}],ml:[{ml:G()}],"space-x":[{"space-x":R()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":R()}],"space-y-reverse":["space-y-reverse"],size:[{size:Y()}],w:[{w:[u,"screen",...Y()]}],"min-w":[{"min-w":[u,"screen","none",...Y()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[s]},...Y()]}],h:[{h:["screen","lh",...Y()]}],"min-h":[{"min-h":["screen","lh","none",...Y()]}],"max-h":[{"max-h":["screen","lh",...Y()]}],"font-size":[{text:["base",r,Ul,Co]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,Pe,yg]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",gg,Ee]}],"font-family":[{font:[bF,Ee,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,Pe,Ee]}],"line-clamp":[{"line-clamp":[He,"none",Pe,yg]}],leading:[{leading:[o,...R()]}],"list-image":[{"list-image":["none",Pe,Ee]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Pe,Ee]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:D()}],"text-color":[{text:D()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ve(),"wavy"]}],"text-decoration-thickness":[{decoration:[He,"from-font","auto",Pe,Co]}],"text-decoration-color":[{decoration:D()}],"underline-offset":[{"underline-offset":[He,"auto",Pe,Ee]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Pe,Ee]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Pe,Ee]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Q()}],"bg-repeat":[{bg:J()}],"bg-size":[{bg:M()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Zi,Pe,Ee],radial:["",Pe,Ee],conic:[Zi,Pe,Ee]},SF,xF]}],"bg-color":[{bg:D()}],"gradient-from-pos":[{from:B()}],"gradient-via-pos":[{via:B()}],"gradient-to-pos":[{to:B()}],"gradient-from":[{from:D()}],"gradient-via":[{via:D()}],"gradient-to":[{to:D()}],rounded:[{rounded:Z()}],"rounded-s":[{"rounded-s":Z()}],"rounded-e":[{"rounded-e":Z()}],"rounded-t":[{"rounded-t":Z()}],"rounded-r":[{"rounded-r":Z()}],"rounded-b":[{"rounded-b":Z()}],"rounded-l":[{"rounded-l":Z()}],"rounded-ss":[{"rounded-ss":Z()}],"rounded-se":[{"rounded-se":Z()}],"rounded-ee":[{"rounded-ee":Z()}],"rounded-es":[{"rounded-es":Z()}],"rounded-tl":[{"rounded-tl":Z()}],"rounded-tr":[{"rounded-tr":Z()}],"rounded-br":[{"rounded-br":Z()}],"rounded-bl":[{"rounded-bl":Z()}],"border-w":[{border:te()}],"border-w-x":[{"border-x":te()}],"border-w-y":[{"border-y":te()}],"border-w-s":[{"border-s":te()}],"border-w-e":[{"border-e":te()}],"border-w-t":[{"border-t":te()}],"border-w-r":[{"border-r":te()}],"border-w-b":[{"border-b":te()}],"border-w-l":[{"border-l":te()}],"divide-x":[{"divide-x":te()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":te()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ve(),"hidden","none"]}],"divide-style":[{divide:[...ve(),"hidden","none"]}],"border-color":[{border:D()}],"border-color-x":[{"border-x":D()}],"border-color-y":[{"border-y":D()}],"border-color-s":[{"border-s":D()}],"border-color-e":[{"border-e":D()}],"border-color-t":[{"border-t":D()}],"border-color-r":[{"border-r":D()}],"border-color-b":[{"border-b":D()}],"border-color-l":[{"border-l":D()}],"divide-color":[{divide:D()}],"outline-style":[{outline:[...ve(),"none","hidden"]}],"outline-offset":[{"outline-offset":[He,Pe,Ee]}],"outline-w":[{outline:["",He,Ul,Co]}],"outline-color":[{outline:D()}],shadow:[{shadow:["","none",d,Lf,Df]}],"shadow-color":[{shadow:D()}],"inset-shadow":[{"inset-shadow":["none",p,Lf,Df]}],"inset-shadow-color":[{"inset-shadow":D()}],"ring-w":[{ring:te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:D()}],"ring-offset-w":[{"ring-offset":[He,Co]}],"ring-offset-color":[{"ring-offset":D()}],"inset-ring-w":[{"inset-ring":te()}],"inset-ring-color":[{"inset-ring":D()}],"text-shadow":[{"text-shadow":["none",m,Lf,Df]}],"text-shadow-color":[{"text-shadow":D()}],opacity:[{opacity:[He,Pe,Ee]}],"mix-blend":[{"mix-blend":[...xe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":xe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[He]}],"mask-image-linear-from-pos":[{"mask-linear-from":X()}],"mask-image-linear-to-pos":[{"mask-linear-to":X()}],"mask-image-linear-from-color":[{"mask-linear-from":D()}],"mask-image-linear-to-color":[{"mask-linear-to":D()}],"mask-image-t-from-pos":[{"mask-t-from":X()}],"mask-image-t-to-pos":[{"mask-t-to":X()}],"mask-image-t-from-color":[{"mask-t-from":D()}],"mask-image-t-to-color":[{"mask-t-to":D()}],"mask-image-r-from-pos":[{"mask-r-from":X()}],"mask-image-r-to-pos":[{"mask-r-to":X()}],"mask-image-r-from-color":[{"mask-r-from":D()}],"mask-image-r-to-color":[{"mask-r-to":D()}],"mask-image-b-from-pos":[{"mask-b-from":X()}],"mask-image-b-to-pos":[{"mask-b-to":X()}],"mask-image-b-from-color":[{"mask-b-from":D()}],"mask-image-b-to-color":[{"mask-b-to":D()}],"mask-image-l-from-pos":[{"mask-l-from":X()}],"mask-image-l-to-pos":[{"mask-l-to":X()}],"mask-image-l-from-color":[{"mask-l-from":D()}],"mask-image-l-to-color":[{"mask-l-to":D()}],"mask-image-x-from-pos":[{"mask-x-from":X()}],"mask-image-x-to-pos":[{"mask-x-to":X()}],"mask-image-x-from-color":[{"mask-x-from":D()}],"mask-image-x-to-color":[{"mask-x-to":D()}],"mask-image-y-from-pos":[{"mask-y-from":X()}],"mask-image-y-to-pos":[{"mask-y-to":X()}],"mask-image-y-from-color":[{"mask-y-from":D()}],"mask-image-y-to-color":[{"mask-y-to":D()}],"mask-image-radial":[{"mask-radial":[Pe,Ee]}],"mask-image-radial-from-pos":[{"mask-radial-from":X()}],"mask-image-radial-to-pos":[{"mask-radial-to":X()}],"mask-image-radial-from-color":[{"mask-radial-from":D()}],"mask-image-radial-to-color":[{"mask-radial-to":D()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":N()}],"mask-image-conic-pos":[{"mask-conic":[He]}],"mask-image-conic-from-pos":[{"mask-conic-from":X()}],"mask-image-conic-to-pos":[{"mask-conic-to":X()}],"mask-image-conic-from-color":[{"mask-conic-from":D()}],"mask-image-conic-to-color":[{"mask-conic-to":D()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Q()}],"mask-repeat":[{mask:J()}],"mask-size":[{mask:M()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Pe,Ee]}],filter:[{filter:["","none",Pe,Ee]}],blur:[{blur:ue()}],brightness:[{brightness:[He,Pe,Ee]}],contrast:[{contrast:[He,Pe,Ee]}],"drop-shadow":[{"drop-shadow":["","none",g,Lf,Df]}],"drop-shadow-color":[{"drop-shadow":D()}],grayscale:[{grayscale:["",He,Pe,Ee]}],"hue-rotate":[{"hue-rotate":[He,Pe,Ee]}],invert:[{invert:["",He,Pe,Ee]}],saturate:[{saturate:[He,Pe,Ee]}],sepia:[{sepia:["",He,Pe,Ee]}],"backdrop-filter":[{"backdrop-filter":["","none",Pe,Ee]}],"backdrop-blur":[{"backdrop-blur":ue()}],"backdrop-brightness":[{"backdrop-brightness":[He,Pe,Ee]}],"backdrop-contrast":[{"backdrop-contrast":[He,Pe,Ee]}],"backdrop-grayscale":[{"backdrop-grayscale":["",He,Pe,Ee]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[He,Pe,Ee]}],"backdrop-invert":[{"backdrop-invert":["",He,Pe,Ee]}],"backdrop-opacity":[{"backdrop-opacity":[He,Pe,Ee]}],"backdrop-saturate":[{"backdrop-saturate":[He,Pe,Ee]}],"backdrop-sepia":[{"backdrop-sepia":["",He,Pe,Ee]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":R()}],"border-spacing-x":[{"border-spacing-x":R()}],"border-spacing-y":[{"border-spacing-y":R()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Pe,Ee]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[He,"initial",Pe,Ee]}],ease:[{ease:["linear","initial",j,Pe,Ee]}],delay:[{delay:[He,Pe,Ee]}],animate:[{animate:["none",O,Pe,Ee]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,Pe,Ee]}],"perspective-origin":[{"perspective-origin":A()}],rotate:[{rotate:ie()}],"rotate-x":[{"rotate-x":ie()}],"rotate-y":[{"rotate-y":ie()}],"rotate-z":[{"rotate-z":ie()}],scale:[{scale:de()}],"scale-x":[{"scale-x":de()}],"scale-y":[{"scale-y":de()}],"scale-z":[{"scale-z":de()}],"scale-3d":["scale-3d"],skew:[{skew:ye()}],"skew-x":[{"skew-x":ye()}],"skew-y":[{"skew-y":ye()}],transform:[{transform:[Pe,Ee,"","none","gpu","cpu"]}],"transform-origin":[{origin:A()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:oe()}],"translate-x":[{"translate-x":oe()}],"translate-y":[{"translate-y":oe()}],"translate-z":[{"translate-z":oe()}],"translate-none":["translate-none"],accent:[{accent:D()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:D()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Pe,Ee]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Pe,Ee]}],fill:[{fill:["none",...D()]}],"stroke-w":[{stroke:[He,Ul,Co,yg]}],stroke:[{stroke:["none",...D()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},EF=oF(OF);function Te(...e){return EF(We(e))}var ou=GR();const PF=ot(ou);function pE(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ia(...e){return t=>{let r=!1;const n=e.map(i=>{const o=pE(i,t);return!r&&typeof o=="function"&&(r=!0),o});if(r)return()=>{for(let i=0;i{const{children:o,...s}=n,u=_.Children.toArray(o),f=u.find(TF);if(f){const l=f.props.children,d=u.map(p=>p===f?_.Children.count(l)>1?_.Children.only(null):_.isValidElement(l)?l.props.children:null:p);return h.jsx(t,{...s,ref:i,children:_.isValidElement(l)?_.cloneElement(l,void 0,d):null})}return h.jsx(t,{...s,ref:i,children:o})});return r.displayName=`${e}.Slot`,r}function CF(e){const t=_.forwardRef((r,n)=>{const{children:i,...o}=r;if(_.isValidElement(i)){const s=RF(i),u=kF(o,i.props);return i.type!==_.Fragment&&(u.ref=n?ia(n,s):s),_.cloneElement(i,u)}return _.Children.count(i)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var NF=Symbol("radix.slottable");function TF(e){return _.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===NF}function kF(e,t){const r={...t};for(const n in t){const i=e[n],o=t[n];/^on[A-Z]/.test(n)?i&&o?r[n]=(...u)=>{const f=o(...u);return i(...u),f}:i&&(r[n]=i):n==="style"?r[n]={...i,...o}:n==="className"&&(r[n]=[i,o].filter(Boolean).join(" "))}return{...e,...r}}function RF(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var MF=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],qe=MF.reduce((e,t)=>{const r=AF(`Primitive.${t}`),n=_.forwardRef((i,o)=>{const{asChild:s,...u}=i,f=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(f,{...u,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function IF(e,t){e&&ou.flushSync(()=>e.dispatchEvent(t))}var Rt=globalThis?.document?_.useLayoutEffect:()=>{};function DF(e,t){return _.useReducer((r,n)=>t[r][n]??r,e)}var Or=e=>{const{present:t,children:r}=e,n=LF(t),i=typeof r=="function"?r({present:n.isPresent}):_.Children.only(r),o=Xe(n.ref,$F(i));return typeof r=="function"||n.isPresent?_.cloneElement(i,{ref:o}):null};Or.displayName="Presence";function LF(e){const[t,r]=_.useState(),n=_.useRef(null),i=_.useRef(e),o=_.useRef("none"),s=e?"mounted":"unmounted",[u,f]=DF(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return _.useEffect(()=>{const l=$f(n.current);o.current=u==="mounted"?l:"none"},[u]),Rt(()=>{const l=n.current,d=i.current;if(d!==e){const m=o.current,g=$f(l);e?f("MOUNT"):g==="none"||l?.display==="none"?f("UNMOUNT"):f(d&&m!==g?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,f]),Rt(()=>{if(t){let l;const d=t.ownerDocument.defaultView??window,p=g=>{const y=$f(n.current).includes(CSS.escape(g.animationName));if(g.target===t&&y&&(f("ANIMATION_END"),!i.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",l=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},m=g=>{g.target===t&&(o.current=$f(n.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{d.clearTimeout(l),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:_.useCallback(l=>{n.current=l?getComputedStyle(l):null,r(l)},[])}}function $f(e){return e?.animationName||"none"}function $F(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function BF(e,t){const r=_.createContext(t),n=o=>{const{children:s,...u}=o,f=_.useMemo(()=>u,Object.values(u));return h.jsx(r.Provider,{value:f,children:s})};n.displayName=e+"Provider";function i(o){const s=_.useContext(r);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[n,i]}function In(e,t=[]){let r=[];function n(o,s){const u=_.createContext(s),f=r.length;r=[...r,s];const l=p=>{const{scope:m,children:g,...b}=p,y=m?.[e]?.[f]||u,w=_.useMemo(()=>b,Object.values(b));return h.jsx(y.Provider,{value:w,children:g})};l.displayName=o+"Provider";function d(p,m){const g=m?.[e]?.[f]||u,b=_.useContext(g);if(b)return b;if(s!==void 0)return s;throw new Error(`\`${p}\` must be used within \`${o}\``)}return[l,d]}const i=()=>{const o=r.map(s=>_.createContext(s));return function(u){const f=u?.[e]||o;return _.useMemo(()=>({[`__scope${e}`]:{...u,[e]:f}}),[u,f])}};return i.scopeName=e,[n,FF(i,...t)]}function FF(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=n.reduce((u,{useScope:f,scopeName:l})=>{const p=f(o)[`__scope${l}`];return{...u,...p}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}function ar(e){const t=_.useRef(e);return _.useEffect(()=>{t.current=e}),_.useMemo(()=>(...r)=>t.current?.(...r),[])}var zF=_.createContext(void 0);function fp(e){const t=_.useContext(zF);return e||t||"ltr"}function qb(e,[t,r]){return Math.min(r,Math.max(t,e))}function ke(e,t,{checkForDefaultPrevented:r=!0}={}){return function(i){if(e?.(i),r===!1||!i.defaultPrevented)return t?.(i)}}function qF(e,t){return _.useReducer((r,n)=>t[r][n]??r,e)}var kw="ScrollArea",[vM]=In(kw),[UF,ln]=vM(kw),gM=_.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:n="hover",dir:i,scrollHideDelay:o=600,...s}=e,[u,f]=_.useState(null),[l,d]=_.useState(null),[p,m]=_.useState(null),[g,b]=_.useState(null),[y,w]=_.useState(null),[j,O]=_.useState(0),[E,N]=_.useState(0),[A,C]=_.useState(!1),[T,R]=_.useState(!1),I=Xe(t,$=>f($)),z=fp(i);return h.jsx(UF,{scope:r,type:n,dir:z,scrollHideDelay:o,scrollArea:u,viewport:l,onViewportChange:d,content:p,onContentChange:m,scrollbarX:g,onScrollbarXChange:b,scrollbarXEnabled:A,onScrollbarXEnabledChange:C,scrollbarY:y,onScrollbarYChange:w,scrollbarYEnabled:T,onScrollbarYEnabledChange:R,onCornerWidthChange:O,onCornerHeightChange:N,children:h.jsx(qe.div,{dir:z,...s,ref:I,style:{position:"relative","--radix-scroll-area-corner-width":j+"px","--radix-scroll-area-corner-height":E+"px",...e.style}})})});gM.displayName=kw;var yM="ScrollAreaViewport",xM=_.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,nonce:i,...o}=e,s=ln(yM,r),u=_.useRef(null),f=Xe(t,u,s.onViewportChange);return h.jsxs(h.Fragment,{children:[h.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),h.jsx(qe.div,{"data-radix-scroll-area-viewport":"",...o,ref:f,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:h.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});xM.displayName=yM;var ei="ScrollAreaScrollbar",bM=_.forwardRef((e,t)=>{const{forceMount:r,...n}=e,i=ln(ei,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:s}=i,u=e.orientation==="horizontal";return _.useEffect(()=>(u?o(!0):s(!0),()=>{u?o(!1):s(!1)}),[u,o,s]),i.type==="hover"?h.jsx(WF,{...n,ref:t,forceMount:r}):i.type==="scroll"?h.jsx(HF,{...n,ref:t,forceMount:r}):i.type==="auto"?h.jsx(wM,{...n,ref:t,forceMount:r}):i.type==="always"?h.jsx(Rw,{...n,ref:t}):null});bM.displayName=ei;var WF=_.forwardRef((e,t)=>{const{forceMount:r,...n}=e,i=ln(ei,e.__scopeScrollArea),[o,s]=_.useState(!1);return _.useEffect(()=>{const u=i.scrollArea;let f=0;if(u){const l=()=>{window.clearTimeout(f),s(!0)},d=()=>{f=window.setTimeout(()=>s(!1),i.scrollHideDelay)};return u.addEventListener("pointerenter",l),u.addEventListener("pointerleave",d),()=>{window.clearTimeout(f),u.removeEventListener("pointerenter",l),u.removeEventListener("pointerleave",d)}}},[i.scrollArea,i.scrollHideDelay]),h.jsx(Or,{present:r||o,children:h.jsx(wM,{"data-state":o?"visible":"hidden",...n,ref:t})})}),HF=_.forwardRef((e,t)=>{const{forceMount:r,...n}=e,i=ln(ei,e.__scopeScrollArea),o=e.orientation==="horizontal",s=hp(()=>f("SCROLL_END"),100),[u,f]=qF("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return _.useEffect(()=>{if(u==="idle"){const l=window.setTimeout(()=>f("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(l)}},[u,i.scrollHideDelay,f]),_.useEffect(()=>{const l=i.viewport,d=o?"scrollLeft":"scrollTop";if(l){let p=l[d];const m=()=>{const g=l[d];p!==g&&(f("SCROLL"),s()),p=g};return l.addEventListener("scroll",m),()=>l.removeEventListener("scroll",m)}},[i.viewport,o,f,s]),h.jsx(Or,{present:r||u!=="hidden",children:h.jsx(Rw,{"data-state":u==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:ke(e.onPointerEnter,()=>f("POINTER_ENTER")),onPointerLeave:ke(e.onPointerLeave,()=>f("POINTER_LEAVE"))})})}),wM=_.forwardRef((e,t)=>{const r=ln(ei,e.__scopeScrollArea),{forceMount:n,...i}=e,[o,s]=_.useState(!1),u=e.orientation==="horizontal",f=hp(()=>{if(r.viewport){const l=r.viewport.offsetWidth{const{orientation:r="vertical",...n}=e,i=ln(ei,e.__scopeScrollArea),o=_.useRef(null),s=_.useRef(0),[u,f]=_.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=EM(u.viewport,u.content),d={...n,sizes:u,onSizesChange:f,hasThumb:l>0&&l<1,onThumbChange:m=>o.current=m,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:m=>s.current=m};function p(m,g){return QF(m,s.current,u,g)}return r==="horizontal"?h.jsx(VF,{...d,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const m=i.viewport.scrollLeft,g=mE(m,u,i.dir);o.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:m=>{i.viewport&&(i.viewport.scrollLeft=m)},onDragScroll:m=>{i.viewport&&(i.viewport.scrollLeft=p(m,i.dir))}}):r==="vertical"?h.jsx(GF,{...d,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const m=i.viewport.scrollTop,g=mE(m,u);o.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:m=>{i.viewport&&(i.viewport.scrollTop=m)},onDragScroll:m=>{i.viewport&&(i.viewport.scrollTop=p(m))}}):null}),VF=_.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...i}=e,o=ln(ei,e.__scopeScrollArea),[s,u]=_.useState(),f=_.useRef(null),l=Xe(t,f,o.onScrollbarXChange);return _.useEffect(()=>{f.current&&u(getComputedStyle(f.current))},[f]),h.jsx(_M,{"data-orientation":"horizontal",...i,ref:l,sizes:r,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":dp(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,p)=>{if(o.viewport){const m=o.viewport.scrollLeft+d.deltaX;e.onWheelScroll(m),AM(m,p)&&d.preventDefault()}},onResize:()=>{f.current&&o.viewport&&s&&n({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:f.current.clientWidth,paddingStart:Yd(s.paddingLeft),paddingEnd:Yd(s.paddingRight)}})}})}),GF=_.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...i}=e,o=ln(ei,e.__scopeScrollArea),[s,u]=_.useState(),f=_.useRef(null),l=Xe(t,f,o.onScrollbarYChange);return _.useEffect(()=>{f.current&&u(getComputedStyle(f.current))},[f]),h.jsx(_M,{"data-orientation":"vertical",...i,ref:l,sizes:r,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":dp(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,p)=>{if(o.viewport){const m=o.viewport.scrollTop+d.deltaY;e.onWheelScroll(m),AM(m,p)&&d.preventDefault()}},onResize:()=>{f.current&&o.viewport&&s&&n({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:f.current.clientHeight,paddingStart:Yd(s.paddingTop),paddingEnd:Yd(s.paddingBottom)}})}})}),[KF,SM]=vM(ei),_M=_.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:i,onThumbChange:o,onThumbPointerUp:s,onThumbPointerDown:u,onThumbPositionChange:f,onDragScroll:l,onWheelScroll:d,onResize:p,...m}=e,g=ln(ei,r),[b,y]=_.useState(null),w=Xe(t,I=>y(I)),j=_.useRef(null),O=_.useRef(""),E=g.viewport,N=n.content-n.viewport,A=ar(d),C=ar(f),T=hp(p,10);function R(I){if(j.current){const z=I.clientX-j.current.left,$=I.clientY-j.current.top;l({x:z,y:$})}}return _.useEffect(()=>{const I=z=>{const $=z.target;b?.contains($)&&A(z,N)};return document.addEventListener("wheel",I,{passive:!1}),()=>document.removeEventListener("wheel",I,{passive:!1})},[E,b,N,A]),_.useEffect(C,[n,C]),fs(b,T),fs(g.content,T),h.jsx(KF,{scope:r,scrollbar:b,hasThumb:i,onThumbChange:ar(o),onThumbPointerUp:ar(s),onThumbPositionChange:C,onThumbPointerDown:ar(u),children:h.jsx(qe.div,{...m,ref:w,style:{position:"absolute",...m.style},onPointerDown:ke(e.onPointerDown,I=>{I.button===0&&(I.target.setPointerCapture(I.pointerId),j.current=b.getBoundingClientRect(),O.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),R(I))}),onPointerMove:ke(e.onPointerMove,R),onPointerUp:ke(e.onPointerUp,I=>{const z=I.target;z.hasPointerCapture(I.pointerId)&&z.releasePointerCapture(I.pointerId),document.body.style.webkitUserSelect=O.current,g.viewport&&(g.viewport.style.scrollBehavior=""),j.current=null})})})}),Xd="ScrollAreaThumb",jM=_.forwardRef((e,t)=>{const{forceMount:r,...n}=e,i=SM(Xd,e.__scopeScrollArea);return h.jsx(Or,{present:r||i.hasThumb,children:h.jsx(XF,{ref:t,...n})})}),XF=_.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...i}=e,o=ln(Xd,r),s=SM(Xd,r),{onThumbPositionChange:u}=s,f=Xe(t,p=>s.onThumbChange(p)),l=_.useRef(void 0),d=hp(()=>{l.current&&(l.current(),l.current=void 0)},100);return _.useEffect(()=>{const p=o.viewport;if(p){const m=()=>{if(d(),!l.current){const g=ZF(p,u);l.current=g,u()}};return u(),p.addEventListener("scroll",m),()=>p.removeEventListener("scroll",m)}},[o.viewport,d,u]),h.jsx(qe.div,{"data-state":s.hasThumb?"visible":"hidden",...i,ref:f,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:ke(e.onPointerDownCapture,p=>{const g=p.target.getBoundingClientRect(),b=p.clientX-g.left,y=p.clientY-g.top;s.onThumbPointerDown({x:b,y})}),onPointerUp:ke(e.onPointerUp,s.onThumbPointerUp)})});jM.displayName=Xd;var Mw="ScrollAreaCorner",OM=_.forwardRef((e,t)=>{const r=ln(Mw,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?h.jsx(YF,{...e,ref:t}):null});OM.displayName=Mw;var YF=_.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,i=ln(Mw,r),[o,s]=_.useState(0),[u,f]=_.useState(0),l=!!(o&&u);return fs(i.scrollbarX,()=>{const d=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(d),f(d)}),fs(i.scrollbarY,()=>{const d=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(d),s(d)}),l?h.jsx(qe.div,{...n,ref:t,style:{width:o,height:u,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Yd(e){return e?parseInt(e,10):0}function EM(e,t){const r=e/t;return isNaN(r)?0:r}function dp(e){const t=EM(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function QF(e,t,r,n="ltr"){const i=dp(r),o=i/2,s=t||o,u=i-s,f=r.scrollbar.paddingStart+s,l=r.scrollbar.size-r.scrollbar.paddingEnd-u,d=r.content-r.viewport,p=n==="ltr"?[0,d]:[d*-1,0];return PM([f,l],p)(e)}function mE(e,t,r="ltr"){const n=dp(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-i,s=t.content-t.viewport,u=o-n,f=r==="ltr"?[0,s]:[s*-1,0],l=qb(e,f);return PM([0,s],[0,u])(l)}function PM(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function AM(e,t){return e>0&&e{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return(function i(){const o={left:e.scrollLeft,top:e.scrollTop},s=r.left!==o.left,u=r.top!==o.top;(s||u)&&t(),r=o,n=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(n)};function hp(e,t){const r=ar(e),n=_.useRef(0);return _.useEffect(()=>()=>window.clearTimeout(n.current),[]),_.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function fs(e,t){const r=ar(t);Rt(()=>{let n=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return i.observe(e),()=>{window.cancelAnimationFrame(n),i.unobserve(e)}}},[e,r])}var JF=gM,ez=xM,tz=OM;function wc({className:e,children:t,...r}){return h.jsxs(JF,{"data-slot":"scroll-area",className:Te("relative",e),...r,children:[h.jsx(ez,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:t}),h.jsx(rz,{}),h.jsx(tz,{})]})}function rz({className:e,orientation:t="vertical",...r}){return h.jsx(bM,{"data-slot":"scroll-area-scrollbar",orientation:t,className:Te("flex touch-none p-px transition-colors select-none",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e),...r,children:h.jsx(jM,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}const nz="/assets/773f0c39e1986271e9144596caac519f934a6ae6-Cou8J2R8.png";function iz({currentView:e,setCurrentView:t}){const[r,n]=_.useState(!0),i=[{name:"Dashboard",icon:eM,type:"item"},{type:"header",name:"MODULES"},{name:"Labeling",icon:Gd,type:"sub",isOpen:r,toggle:()=>n(!r),children:[{name:"Labels",icon:Gd},{name:"Label Categories",icon:JR},{name:"Label Types",icon:up},{name:"Label Templates",icon:ZR},{name:"Multiple Options",icon:Vd}]},{type:"header",name:"MANAGEMENT"},{name:"Location Manager",icon:Fs,type:"item"},{type:"header",name:"SYSTEM MANAGEMENT"},{name:"Account Management",icon:Nw,type:"item"},{name:"Menu Management",icon:Hd,type:"item"},{name:"System Menu",icon:Vd,type:"item"},{name:"Reports",icon:us,type:"item"},{name:"Support",icon:Wd,type:"item"},{name:"Log Out",icon:J8,type:"item"}];return h.jsxs("div",{className:"w-64 bg-[#1e3a8a] text-white flex flex-col h-screen border-r border-blue-800 shadow-xl z-20 shrink-0",children:[h.jsx("div",{className:"flex items-center justify-center border-b border-blue-800/50 bg-white px-4 shrink-0",style:{height:90},children:h.jsx("img",{src:nz,alt:"MedVantage",className:"h-16 w-auto object-contain"})}),h.jsx(wc,{className:"flex-1 py-4",children:h.jsx("div",{className:"px-3 space-y-1",children:i.map((o,s)=>o.type==="header"?h.jsx("div",{className:"px-4 py-2 mt-4 text-xs font-semibold text-blue-300 uppercase tracking-wider",children:o.name},s):o.type==="sub"?h.jsxs("div",{className:"space-y-1",children:[h.jsxs("button",{onClick:o.toggle,className:Te("w-full flex items-center justify-between px-4 py-2.5 text-sm font-medium rounded-lg transition-colors","hover:bg-blue-800/50 text-blue-100"),children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx(o.icon,{className:"w-4 h-4"}),o.name]}),o.isOpen?h.jsx(xc,{className:"w-4 h-4"}):h.jsx(bc,{className:"w-4 h-4"})]}),o.isOpen&&h.jsx("div",{className:"pl-4 space-y-1",children:o.children?.map((u,f)=>h.jsxs("button",{onClick:()=>t(u.name),className:Te("w-full flex items-center gap-3 px-4 py-2 text-sm font-medium rounded-lg transition-colors border-l-2",e===u.name?"bg-blue-800 border-blue-400 text-white":"border-transparent hover:bg-blue-800/30 text-blue-200 hover:text-white"),children:[h.jsx("div",{className:"w-1 h-1 rounded-full bg-current"}),u.name]},f))})]},s):h.jsxs("button",{onClick:()=>t(o.name),className:Te("w-full flex items-center gap-3 px-4 py-2.5 text-sm font-medium rounded-lg transition-colors",e===o.name?"bg-blue-700 text-white shadow-md shadow-blue-900/20":o.name==="Log Out"?"text-red-300 hover:bg-red-900/20 hover:text-red-200":"text-blue-100 hover:bg-blue-800 hover:text-white"),children:[h.jsx(o.icon,{className:"w-4 h-4"}),o.name]},s))})})]})}function be({className:e,type:t,...r}){return h.jsx("input",{type:t,"data-slot":"input",className:Te("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border px-3 py-1 text-base bg-input-background transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...r})}var oz=Symbol.for("react.lazy"),Qd=Ew[" use ".trim().toString()];function az(e){return typeof e=="object"&&e!==null&&"then"in e}function CM(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===oz&&"_payload"in e&&az(e._payload)}function Iw(e){const t=sz(e),r=_.forwardRef((n,i)=>{let{children:o,...s}=n;CM(o)&&typeof Qd=="function"&&(o=Qd(o._payload));const u=_.Children.toArray(o),f=u.find(cz);if(f){const l=f.props.children,d=u.map(p=>p===f?_.Children.count(l)>1?_.Children.only(null):_.isValidElement(l)?l.props.children:null:p);return h.jsx(t,{...s,ref:i,children:_.isValidElement(l)?_.cloneElement(l,void 0,d):null})}return h.jsx(t,{...s,ref:i,children:o})});return r.displayName=`${e}.Slot`,r}var NM=Iw("Slot");function sz(e){const t=_.forwardRef((r,n)=>{let{children:i,...o}=r;if(CM(i)&&typeof Qd=="function"&&(i=Qd(i._payload)),_.isValidElement(i)){const s=fz(i),u=uz(o,i.props);return i.type!==_.Fragment&&(u.ref=n?ia(n,s):s),_.cloneElement(i,u)}return _.Children.count(i)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var lz=Symbol("radix.slottable");function cz(e){return _.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===lz}function uz(e,t){const r={...t};for(const n in t){const i=e[n],o=t[n];/^on[A-Z]/.test(n)?i&&o?r[n]=(...u)=>{const f=o(...u);return i(...u),f}:i&&(r[n]=i):n==="style"?r[n]={...i,...o}:n==="className"&&(r[n]=[i,o].filter(Boolean).join(" "))}return{...e,...r}}function fz(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}const vE=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,gE=We,TM=(e,t)=>r=>{var n;if(t?.variants==null)return gE(e,r?.class,r?.className);const{variants:i,defaultVariants:o}=t,s=Object.keys(i).map(l=>{const d=r?.[l],p=o?.[l];if(d===null)return null;const m=vE(d)||vE(p);return i[l][m]}),u=r&&Object.entries(r).reduce((l,d)=>{let[p,m]=d;return m===void 0||(l[p]=m),l},{}),f=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((l,d)=>{let{class:p,className:m,...g}=d;return Object.entries(g).every(b=>{let[y,w]=b;return Array.isArray(w)?w.includes({...o,...u}[y]):{...o,...u}[y]===w})?[...l,p,m]:l},[]);return gE(e,s,f,r?.class,r?.className)},kM=TM("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background text-foreground hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9 rounded-md"}},defaultVariants:{variant:"default",size:"default"}}),we=_.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...i},o)=>{const s=n?NM:"button";return h.jsx(s,{ref:o,"data-slot":"button",className:Te(kM({variant:t,size:r,className:e})),...i})});we.displayName="Button";function dz(e,t=[]){let r=[];function n(o,s){const u=_.createContext(s);u.displayName=o+"Context";const f=r.length;r=[...r,s];const l=p=>{const{scope:m,children:g,...b}=p,y=m?.[e]?.[f]||u,w=_.useMemo(()=>b,Object.values(b));return h.jsx(y.Provider,{value:w,children:g})};l.displayName=o+"Provider";function d(p,m){const g=m?.[e]?.[f]||u,b=_.useContext(g);if(b)return b;if(s!==void 0)return s;throw new Error(`\`${p}\` must be used within \`${o}\``)}return[l,d]}const i=()=>{const o=r.map(s=>_.createContext(s));return function(u){const f=u?.[e]||o;return _.useMemo(()=>({[`__scope${e}`]:{...u,[e]:f}}),[u,f])}};return i.scopeName=e,[n,hz(i,...t)]}function hz(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=n.reduce((u,{useScope:f,scopeName:l})=>{const p=f(o)[`__scope${l}`];return{...u,...p}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}var pz=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Dw=pz.reduce((e,t)=>{const r=Iw(`Primitive.${t}`),n=_.forwardRef((i,o)=>{const{asChild:s,...u}=i,f=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(f,{...u,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),xg={exports:{}},bg={};/** - * @license React - * use-sync-external-store-shim.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var yE;function mz(){if(yE)return bg;yE=1;var e=cp();function t(p,m){return p===m&&(p!==0||1/p===1/m)||p!==p&&m!==m}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,i=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function u(p,m){var g=m(),b=n({inst:{value:g,getSnapshot:m}}),y=b[0].inst,w=b[1];return o(function(){y.value=g,y.getSnapshot=m,f(y)&&w({inst:y})},[p,g,m]),i(function(){return f(y)&&w({inst:y}),p(function(){f(y)&&w({inst:y})})},[p]),s(g),g}function f(p){var m=p.getSnapshot;p=p.value;try{var g=m();return!r(p,g)}catch{return!0}}function l(p,m){return m()}var d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?l:u;return bg.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:d,bg}var xE;function vz(){return xE||(xE=1,xg.exports=mz()),xg.exports}var gz=vz();function yz(){return gz.useSyncExternalStore(xz,()=>!0,()=>!1)}function xz(){return()=>{}}var Lw="Avatar",[bz]=dz(Lw),[wz,RM]=bz(Lw),MM=_.forwardRef((e,t)=>{const{__scopeAvatar:r,...n}=e,[i,o]=_.useState("idle");return h.jsx(wz,{scope:r,imageLoadingStatus:i,onImageLoadingStatusChange:o,children:h.jsx(Dw.span,{...n,ref:t})})});MM.displayName=Lw;var IM="AvatarImage",DM=_.forwardRef((e,t)=>{const{__scopeAvatar:r,src:n,onLoadingStatusChange:i=()=>{},...o}=e,s=RM(IM,r),u=Sz(n,o),f=ar(l=>{i(l),s.onImageLoadingStatusChange(l)});return Rt(()=>{u!=="idle"&&f(u)},[u,f]),u==="loaded"?h.jsx(Dw.img,{...o,ref:t,src:n}):null});DM.displayName=IM;var LM="AvatarFallback",$M=_.forwardRef((e,t)=>{const{__scopeAvatar:r,delayMs:n,...i}=e,o=RM(LM,r),[s,u]=_.useState(n===void 0);return _.useEffect(()=>{if(n!==void 0){const f=window.setTimeout(()=>u(!0),n);return()=>window.clearTimeout(f)}},[n]),s&&o.imageLoadingStatus!=="loaded"?h.jsx(Dw.span,{...i,ref:t}):null});$M.displayName=LM;function bE(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function Sz(e,{referrerPolicy:t,crossOrigin:r}){const n=yz(),i=_.useRef(null),o=n?(i.current||(i.current=new window.Image),i.current):null,[s,u]=_.useState(()=>bE(o,e));return Rt(()=>{u(bE(o,e))},[o,e]),Rt(()=>{const f=p=>()=>{u(p)};if(!o)return;const l=f("loaded"),d=f("error");return o.addEventListener("load",l),o.addEventListener("error",d),t&&(o.referrerPolicy=t),typeof r=="string"&&(o.crossOrigin=r),()=>{o.removeEventListener("load",l),o.removeEventListener("error",d)}},[o,r,t]),s}var _z=MM,jz=DM,Oz=$M;function Ez({className:e,...t}){return h.jsx(_z,{"data-slot":"avatar",className:Te("relative flex size-10 shrink-0 overflow-hidden rounded-full",e),...t})}function Pz({className:e,...t}){return h.jsx(jz,{"data-slot":"avatar-image",className:Te("aspect-square size-full",e),...t})}function Az({className:e,...t}){return h.jsx(Oz,{"data-slot":"avatar-fallback",className:Te("bg-muted flex size-full items-center justify-center rounded-full",e),...t})}function Cz({title:e}){const t=new Date().toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"});return h.jsxs("header",{className:"bg-white border-b border-gray-200 px-8 flex items-center justify-between shadow-sm sticky top-0 z-10 shrink-0",style:{height:90},children:[h.jsxs("div",{children:[h.jsxs("h1",{className:"text-2xl font-bold",style:{color:"rgb(43, 50, 143)"},children:[e," Overview"]}),h.jsxs("p",{className:"text-sm text-gray-500 mt-1 flex items-center gap-2",children:[t," | Last updated: Just now"]})]}),h.jsxs("div",{className:"flex items-center gap-4",children:[h.jsxs("div",{className:"flex items-center w-64 h-9 rounded-md border border-gray-200 bg-gray-50 focus-within:bg-white focus-within:ring-2 focus-within:ring-ring/50 focus-within:border-ring transition-colors overflow-hidden",children:[h.jsx(Cw,{className:"h-4 w-4 text-gray-400 shrink-0 ml-3 pointer-events-none"}),h.jsx(be,{type:"search",placeholder:"Search...",className:"flex-1 min-w-0 border-0 bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0 py-2 px-2 h-full"})]}),h.jsx(we,{variant:"ghost",size:"icon",className:"text-gray-500 hover:text-gray-700",children:h.jsx(Vd,{className:"w-5 h-5"})}),h.jsx("div",{className:"h-8 w-px bg-gray-200 mx-2"}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsxs("div",{className:"text-right hidden md:block",children:[h.jsx("div",{className:"text-sm font-medium text-gray-900",children:"Admin User"}),h.jsx("div",{className:"text-xs text-gray-500",children:"Administrator"})]}),h.jsxs(Ez,{className:"h-10 w-10 border border-gray-200",children:[h.jsx(Pz,{src:"https://github.com/shadcn.png"}),h.jsx(Az,{children:"AD"})]})]})]})]})}function Nz({children:e,currentView:t,setCurrentView:r}){return h.jsxs("div",{className:"flex h-screen bg-gray-50 overflow-hidden font-sans",children:[h.jsx(iz,{currentView:t,setCurrentView:r}),h.jsxs("div",{className:"flex-1 flex flex-col min-w-0 overflow-hidden",children:[h.jsx(Cz,{title:t}),h.jsx("div",{className:"px-8 mt-8 shrink-0",children:h.jsxs("nav",{className:"flex items-center gap-2 text-sm font-normal","aria-label":"Breadcrumb",children:[h.jsx("button",{type:"button",onClick:()=>r("Dashboard"),className:"text-gray-500 hover:text-gray-700 transition-colors",children:"Home"}),h.jsx(bc,{className:"w-4 h-4 text-gray-500 shrink-0"}),h.jsx("span",{style:{color:"rgb(43, 50, 143)"},children:t})]})}),h.jsx("main",{className:"flex-1 overflow-y-auto p-8",children:h.jsx("div",{className:"w-full h-full",children:e})})]})]})}function $r({className:e,...t}){return h.jsx("div",{"data-slot":"card",className:Te("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border",e),...t})}function On({className:e,...t}){return h.jsx("div",{"data-slot":"card-header",className:Te("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 pt-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function En({className:e,...t}){return h.jsx("h4",{"data-slot":"card-title",className:Te("leading-none",e),...t})}function Zd({className:e,...t}){return h.jsx("p",{"data-slot":"card-description",className:Te("text-muted-foreground",e),...t})}function nn({className:e,...t}){return h.jsx("div",{"data-slot":"card-content",className:Te("px-6 [&:last-child]:pb-6",e),...t})}const Tz=TM("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function Cn({className:e,variant:t,asChild:r=!1,...n}){const i=r?NM:"span";return h.jsx(i,{"data-slot":"badge",className:Te(Tz({variant:t}),e),...n})}var wg,wE;function Er(){if(wE)return wg;wE=1;var e=Array.isArray;return wg=e,wg}var Sg,SE;function BM(){if(SE)return Sg;SE=1;var e=typeof Mf=="object"&&Mf&&Mf.Object===Object&&Mf;return Sg=e,Sg}var _g,_E;function ti(){if(_E)return _g;_E=1;var e=BM(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return _g=r,_g}var jg,jE;function au(){if(jE)return jg;jE=1;var e=ti(),t=e.Symbol;return jg=t,jg}var Og,OE;function kz(){if(OE)return Og;OE=1;var e=au(),t=Object.prototype,r=t.hasOwnProperty,n=t.toString,i=e?e.toStringTag:void 0;function o(s){var u=r.call(s,i),f=s[i];try{s[i]=void 0;var l=!0}catch{}var d=n.call(s);return l&&(u?s[i]=f:delete s[i]),d}return Og=o,Og}var Eg,EE;function Rz(){if(EE)return Eg;EE=1;var e=Object.prototype,t=e.toString;function r(n){return t.call(n)}return Eg=r,Eg}var Pg,PE;function Ai(){if(PE)return Pg;PE=1;var e=au(),t=kz(),r=Rz(),n="[object Null]",i="[object Undefined]",o=e?e.toStringTag:void 0;function s(u){return u==null?u===void 0?i:n:o&&o in Object(u)?t(u):r(u)}return Pg=s,Pg}var Ag,AE;function Ci(){if(AE)return Ag;AE=1;function e(t){return t!=null&&typeof t=="object"}return Ag=e,Ag}var Cg,CE;function Us(){if(CE)return Cg;CE=1;var e=Ai(),t=Ci(),r="[object Symbol]";function n(i){return typeof i=="symbol"||t(i)&&e(i)==r}return Cg=n,Cg}var Ng,NE;function $w(){if(NE)return Ng;NE=1;var e=Er(),t=Us(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function i(o,s){if(e(o))return!1;var u=typeof o;return u=="number"||u=="symbol"||u=="boolean"||o==null||t(o)?!0:n.test(o)||!r.test(o)||s!=null&&o in Object(s)}return Ng=i,Ng}var Tg,TE;function lo(){if(TE)return Tg;TE=1;function e(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}return Tg=e,Tg}var kg,kE;function Bw(){if(kE)return kg;kE=1;var e=Ai(),t=lo(),r="[object AsyncFunction]",n="[object Function]",i="[object GeneratorFunction]",o="[object Proxy]";function s(u){if(!t(u))return!1;var f=e(u);return f==n||f==i||f==r||f==o}return kg=s,kg}var Rg,RE;function Mz(){if(RE)return Rg;RE=1;var e=ti(),t=e["__core-js_shared__"];return Rg=t,Rg}var Mg,ME;function Iz(){if(ME)return Mg;ME=1;var e=Mz(),t=(function(){var n=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function r(n){return!!t&&t in n}return Mg=r,Mg}var Ig,IE;function FM(){if(IE)return Ig;IE=1;var e=Function.prototype,t=e.toString;function r(n){if(n!=null){try{return t.call(n)}catch{}try{return n+""}catch{}}return""}return Ig=r,Ig}var Dg,DE;function Dz(){if(DE)return Dg;DE=1;var e=Bw(),t=Iz(),r=lo(),n=FM(),i=/[\\^$.*+?()[\]{}|]/g,o=/^\[object .+?Constructor\]$/,s=Function.prototype,u=Object.prototype,f=s.toString,l=u.hasOwnProperty,d=RegExp("^"+f.call(l).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function p(m){if(!r(m)||t(m))return!1;var g=e(m)?d:o;return g.test(n(m))}return Dg=p,Dg}var Lg,LE;function Lz(){if(LE)return Lg;LE=1;function e(t,r){return t?.[r]}return Lg=e,Lg}var $g,$E;function oa(){if($E)return $g;$E=1;var e=Dz(),t=Lz();function r(n,i){var o=t(n,i);return e(o)?o:void 0}return $g=r,$g}var Bg,BE;function pp(){if(BE)return Bg;BE=1;var e=oa(),t=e(Object,"create");return Bg=t,Bg}var Fg,FE;function $z(){if(FE)return Fg;FE=1;var e=pp();function t(){this.__data__=e?e(null):{},this.size=0}return Fg=t,Fg}var zg,zE;function Bz(){if(zE)return zg;zE=1;function e(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}return zg=e,zg}var qg,qE;function Fz(){if(qE)return qg;qE=1;var e=pp(),t="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function i(o){var s=this.__data__;if(e){var u=s[o];return u===t?void 0:u}return n.call(s,o)?s[o]:void 0}return qg=i,qg}var Ug,UE;function zz(){if(UE)return Ug;UE=1;var e=pp(),t=Object.prototype,r=t.hasOwnProperty;function n(i){var o=this.__data__;return e?o[i]!==void 0:r.call(o,i)}return Ug=n,Ug}var Wg,WE;function qz(){if(WE)return Wg;WE=1;var e=pp(),t="__lodash_hash_undefined__";function r(n,i){var o=this.__data__;return this.size+=this.has(n)?0:1,o[n]=e&&i===void 0?t:i,this}return Wg=r,Wg}var Hg,HE;function Uz(){if(HE)return Hg;HE=1;var e=$z(),t=Bz(),r=Fz(),n=zz(),i=qz();function o(s){var u=-1,f=s==null?0:s.length;for(this.clear();++u-1}return Qg=t,Qg}var Zg,ZE;function Kz(){if(ZE)return Zg;ZE=1;var e=mp();function t(r,n){var i=this.__data__,o=e(i,r);return o<0?(++this.size,i.push([r,n])):i[o][1]=n,this}return Zg=t,Zg}var Jg,JE;function vp(){if(JE)return Jg;JE=1;var e=Wz(),t=Hz(),r=Vz(),n=Gz(),i=Kz();function o(s){var u=-1,f=s==null?0:s.length;for(this.clear();++u0?1:-1},$o=function(t){return Ho(t)&&t.indexOf("%")===t.length-1},ge=function(t){return gq(t)&&!su(t)},yq=function(t){return Ue(t)},Ft=function(t){return ge(t)||Ho(t)},xq=0,Hs=function(t){var r=++xq;return"".concat(t||"").concat(r)},fr=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!ge(t)&&!Ho(t))return n;var o;if($o(t)){var s=t.indexOf("%");o=r*parseFloat(t.slice(0,s))/100}else o=+t;return su(o)&&(o=n),i&&o>r&&(o=r),o},to=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},bq=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Pq(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Wb(e){"@babel/helpers - typeof";return Wb=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wb(e)}var P2={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},xi=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},A2=null,Oy=null,Vw=function e(t){if(t===A2&&Array.isArray(Oy))return Oy;var r=[];return _.Children.forEach(t,function(n){Ue(n)||(hq.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),Oy=r,A2=t,r};function Wr(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(i){return xi(i)}):n=[xi(t)],Vw(e).forEach(function(i){var o=Ur(i,"type.displayName")||Ur(i,"type.name");n.indexOf(o)!==-1&&r.push(i)}),r}function Lr(e,t){var r=Wr(e,t);return r&&r[0]}var C2=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,i=r.height;return!(!ge(n)||n<=0||!ge(i)||i<=0)},Aq=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],Cq=function(t){return t&&t.type&&Ho(t.type)&&Aq.indexOf(t.type)>=0},Nq=function(t){return t&&Wb(t)==="object"&&"clipDot"in t},Tq=function(t,r,n,i){var o,s=(o=jy?.[i])!==null&&o!==void 0?o:[];return r.startsWith("data-")||!ze(t)&&(i&&s.includes(r)||_q.includes(r))||n&&Hw.includes(r)},Le=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(_.isValidElement(t)&&(i=t.props),!Ws(i))return null;var o={};return Object.keys(i).forEach(function(s){var u;Tq((u=i)===null||u===void 0?void 0:u[s],s,r,n)&&(o[s]=i[s])}),o},Hb=function e(t,r){if(t===r)return!0;var n=_.Children.count(t);if(n!==_.Children.count(r))return!1;if(n===0)return!0;if(n===1)return N2(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Dq(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Gb(e){var t=e.children,r=e.width,n=e.height,i=e.viewBox,o=e.className,s=e.style,u=e.title,f=e.desc,l=Iq(e,Mq),d=i||{width:r,height:n,x:0,y:0},p=We("recharts-surface",o);return F.createElement("svg",Vb({},Le(l,!0,"svg"),{className:p,width:r,height:n,style:s,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height)}),F.createElement("title",null,u),F.createElement("desc",null,f),t)}var Lq=["children","className"];function Kb(){return Kb=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Bq(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var rt=F.forwardRef(function(e,t){var r=e.children,n=e.className,i=$q(e,Lq),o=We("recharts-layer",n);return F.createElement("g",Kb({className:o},Le(i,!0),{ref:t}),r)}),Tn=function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),o=2;oo?0:o+r),n=n>o?o:n,n<0&&(n+=o),o=r>n?0:n-r>>>0,r>>>=0;for(var s=Array(o);++i=o?r:e(r,n,i)}return Py=t,Py}var Ay,M2;function VM(){if(M2)return Ay;M2=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",i=t+r+n,o="\\ufe0e\\ufe0f",s="\\u200d",u=RegExp("["+s+e+i+o+"]");function f(l){return u.test(l)}return Ay=f,Ay}var Cy,I2;function qq(){if(I2)return Cy;I2=1;function e(t){return t.split("")}return Cy=e,Cy}var Ny,D2;function Uq(){if(D2)return Ny;D2=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",i=t+r+n,o="\\ufe0e\\ufe0f",s="["+e+"]",u="["+i+"]",f="\\ud83c[\\udffb-\\udfff]",l="(?:"+u+"|"+f+")",d="[^"+e+"]",p="(?:\\ud83c[\\udde6-\\uddff]){2}",m="[\\ud800-\\udbff][\\udc00-\\udfff]",g="\\u200d",b=l+"?",y="["+o+"]?",w="(?:"+g+"(?:"+[d,p,m].join("|")+")"+y+b+")*",j=y+b+w,O="(?:"+[d+u+"?",u,p,m,s].join("|")+")",E=RegExp(f+"(?="+f+")|"+O+j,"g");function N(A){return A.match(E)||[]}return Ny=N,Ny}var Ty,L2;function Wq(){if(L2)return Ty;L2=1;var e=qq(),t=VM(),r=Uq();function n(i){return t(i)?r(i):e(i)}return Ty=n,Ty}var ky,$2;function Hq(){if($2)return ky;$2=1;var e=zq(),t=VM(),r=Wq(),n=qM();function i(o){return function(s){s=n(s);var u=t(s)?r(s):void 0,f=u?u[0]:s.charAt(0),l=u?e(u,1).join(""):s.slice(1);return f[o]()+l}}return ky=i,ky}var Ry,B2;function Vq(){if(B2)return Ry;B2=1;var e=Hq(),t=e("toUpperCase");return Ry=t,Ry}var Gq=Vq();const xp=ot(Gq);function pt(e){return function(){return e}}const GM=Math.cos,th=Math.sin,Dn=Math.sqrt,rh=Math.PI,bp=2*rh,Xb=Math.PI,Yb=2*Xb,Io=1e-6,Kq=Yb-Io;function KM(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return KM;const r=10**t;return function(n){this._+=n[0];for(let i=1,o=n.length;iIo)if(!(Math.abs(p*f-l*d)>Io)||!o)this._append`L${this._x1=t},${this._y1=r}`;else{let g=n-s,b=i-u,y=f*f+l*l,w=g*g+b*b,j=Math.sqrt(y),O=Math.sqrt(m),E=o*Math.tan((Xb-Math.acos((y+m-w)/(2*j*O)))/2),N=E/O,A=E/j;Math.abs(N-1)>Io&&this._append`L${t+N*d},${r+N*p}`,this._append`A${o},${o},0,0,${+(p*g>d*b)},${this._x1=t+A*f},${this._y1=r+A*l}`}}arc(t,r,n,i,o,s){if(t=+t,r=+r,n=+n,s=!!s,n<0)throw new Error(`negative radius: ${n}`);let u=n*Math.cos(i),f=n*Math.sin(i),l=t+u,d=r+f,p=1^s,m=s?i-o:o-i;this._x1===null?this._append`M${l},${d}`:(Math.abs(this._x1-l)>Io||Math.abs(this._y1-d)>Io)&&this._append`L${l},${d}`,n&&(m<0&&(m=m%Yb+Yb),m>Kq?this._append`A${n},${n},0,1,${p},${t-u},${r-f}A${n},${n},0,1,${p},${this._x1=l},${this._y1=d}`:m>Io&&this._append`A${n},${n},0,${+(m>=Xb)},${p},${this._x1=t+n*Math.cos(o)},${this._y1=r+n*Math.sin(o)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function Gw(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new Yq(t)}function Kw(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function XM(e){this._context=e}XM.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function wp(e){return new XM(e)}function YM(e){return e[0]}function QM(e){return e[1]}function ZM(e,t){var r=pt(!0),n=null,i=wp,o=null,s=Gw(u);e=typeof e=="function"?e:e===void 0?YM:pt(e),t=typeof t=="function"?t:t===void 0?QM:pt(t);function u(f){var l,d=(f=Kw(f)).length,p,m=!1,g;for(n==null&&(o=i(g=s())),l=0;l<=d;++l)!(l=g;--b)u.point(E[b],N[b]);u.lineEnd(),u.areaEnd()}j&&(E[m]=+e(w,m,p),N[m]=+t(w,m,p),u.point(n?+n(w,m,p):E[m],r?+r(w,m,p):N[m]))}if(O)return u=null,O+""||null}function d(){return ZM().defined(i).curve(s).context(o)}return l.x=function(p){return arguments.length?(e=typeof p=="function"?p:pt(+p),n=null,l):e},l.x0=function(p){return arguments.length?(e=typeof p=="function"?p:pt(+p),l):e},l.x1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:pt(+p),l):n},l.y=function(p){return arguments.length?(t=typeof p=="function"?p:pt(+p),r=null,l):t},l.y0=function(p){return arguments.length?(t=typeof p=="function"?p:pt(+p),l):t},l.y1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:pt(+p),l):r},l.lineX0=l.lineY0=function(){return d().x(e).y(t)},l.lineY1=function(){return d().x(e).y(r)},l.lineX1=function(){return d().x(n).y(t)},l.defined=function(p){return arguments.length?(i=typeof p=="function"?p:pt(!!p),l):i},l.curve=function(p){return arguments.length?(s=p,o!=null&&(u=s(o)),l):s},l.context=function(p){return arguments.length?(p==null?o=u=null:u=s(o=p),l):o},l}class JM{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function Qq(e){return new JM(e,!0)}function Zq(e){return new JM(e,!1)}const Xw={draw(e,t){const r=Dn(t/rh);e.moveTo(r,0),e.arc(0,0,r,0,bp)}},Jq={draw(e,t){const r=Dn(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},eI=Dn(1/3),e9=eI*2,t9={draw(e,t){const r=Dn(t/e9),n=r*eI;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},r9={draw(e,t){const r=Dn(t),n=-r/2;e.rect(n,n,r,r)}},n9=.8908130915292852,tI=th(rh/10)/th(7*rh/10),i9=th(bp/10)*tI,o9=-GM(bp/10)*tI,a9={draw(e,t){const r=Dn(t*n9),n=i9*r,i=o9*r;e.moveTo(0,-r),e.lineTo(n,i);for(let o=1;o<5;++o){const s=bp*o/5,u=GM(s),f=th(s);e.lineTo(f*r,-u*r),e.lineTo(u*n-f*i,f*n+u*i)}e.closePath()}},My=Dn(3),s9={draw(e,t){const r=-Dn(t/(My*3));e.moveTo(0,r*2),e.lineTo(-My*r,-r),e.lineTo(My*r,-r),e.closePath()}},Jr=-.5,en=Dn(3)/2,Qb=1/Dn(12),l9=(Qb/2+1)*3,c9={draw(e,t){const r=Dn(t/l9),n=r/2,i=r*Qb,o=n,s=r*Qb+r,u=-o,f=s;e.moveTo(n,i),e.lineTo(o,s),e.lineTo(u,f),e.lineTo(Jr*n-en*i,en*n+Jr*i),e.lineTo(Jr*o-en*s,en*o+Jr*s),e.lineTo(Jr*u-en*f,en*u+Jr*f),e.lineTo(Jr*n+en*i,Jr*i-en*n),e.lineTo(Jr*o+en*s,Jr*s-en*o),e.lineTo(Jr*u+en*f,Jr*f-en*u),e.closePath()}};function u9(e,t){let r=null,n=Gw(i);e=typeof e=="function"?e:pt(e||Xw),t=typeof t=="function"?t:pt(t===void 0?64:+t);function i(){let o;if(r||(r=o=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),o)return r=null,o+""||null}return i.type=function(o){return arguments.length?(e=typeof o=="function"?o:pt(o),i):e},i.size=function(o){return arguments.length?(t=typeof o=="function"?o:pt(+o),i):t},i.context=function(o){return arguments.length?(r=o??null,i):r},i}function nh(){}function ih(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function rI(e){this._context=e}rI.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:ih(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:ih(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function f9(e){return new rI(e)}function nI(e){this._context=e}nI.prototype={areaStart:nh,areaEnd:nh,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:ih(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function d9(e){return new nI(e)}function iI(e){this._context=e}iI.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:ih(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function h9(e){return new iI(e)}function oI(e){this._context=e}oI.prototype={areaStart:nh,areaEnd:nh,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function p9(e){return new oI(e)}function F2(e){return e<0?-1:1}function z2(e,t,r){var n=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(n||i<0&&-0),s=(r-e._y1)/(i||n<0&&-0),u=(o*i+s*n)/(n+i);return(F2(o)+F2(s))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs(u))||0}function q2(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Iy(e,t,r){var n=e._x0,i=e._y0,o=e._x1,s=e._y1,u=(o-n)/3;e._context.bezierCurveTo(n+u,i+u*t,o-u,s-u*r,o,s)}function oh(e){this._context=e}oh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Iy(this,this._t0,q2(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Iy(this,q2(this,r=z2(this,e,t)),r);break;default:Iy(this,this._t0,r=z2(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function aI(e){this._context=new sI(e)}(aI.prototype=Object.create(oh.prototype)).point=function(e,t){oh.prototype.point.call(this,t,e)};function sI(e){this._context=e}sI.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,o){this._context.bezierCurveTo(t,e,n,r,o,i)}};function m9(e){return new oh(e)}function v9(e){return new aI(e)}function lI(e){this._context=e}lI.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=U2(e),i=U2(t),o=0,s=1;s=0;--t)i[t]=(s[t]-i[t+1])/o[t];for(o[r-1]=(e[r]+i[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function y9(e){return new Sp(e,.5)}function x9(e){return new Sp(e,0)}function b9(e){return new Sp(e,1)}function ds(e,t){if((s=e.length)>1)for(var r=1,n,i,o=e[t[0]],s,u=o.length;r=0;)r[t]=t;return r}function w9(e,t){return e[t]}function S9(e){const t=[];return t.key=e,t}function _9(){var e=pt([]),t=Zb,r=ds,n=w9;function i(o){var s=Array.from(e.apply(this,arguments),S9),u,f=s.length,l=-1,d;for(const p of o)for(u=0,++l;u0){for(var r,n,i=0,o=e[0].length,s;i0){for(var r=0,n=e[t[0]],i,o=n.length;r0)||!((o=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,o,s;n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function k9(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var cI={symbolCircle:Xw,symbolCross:Jq,symbolDiamond:t9,symbolSquare:r9,symbolStar:a9,symbolTriangle:s9,symbolWye:c9},R9=Math.PI/180,M9=function(t){var r="symbol".concat(xp(t));return cI[r]||Xw},I9=function(t,r,n){if(r==="area")return t;switch(n){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*R9;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},D9=function(t,r){cI["symbol".concat(xp(t))]=r},Yw=function(t){var r=t.type,n=r===void 0?"circle":r,i=t.size,o=i===void 0?64:i,s=t.sizeType,u=s===void 0?"area":s,f=T9(t,P9),l=H2(H2({},f),{},{type:n,size:o,sizeType:u}),d=function(){var w=M9(n),j=u9().type(w).size(I9(o,u,n));return j()},p=l.className,m=l.cx,g=l.cy,b=Le(l,!0);return m===+m&&g===+g&&o===+o?F.createElement("path",Jb({},b,{className:We("recharts-symbols",p),transform:"translate(".concat(m,", ").concat(g,")"),d:d()})):null};Yw.registerSymbol=D9;function hs(e){"@babel/helpers - typeof";return hs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hs(e)}function e1(){return e1=Object.assign?Object.assign.bind():function(e){for(var t=1;t`);var O=g.inactive?l:g.color;return F.createElement("li",e1({className:w,style:p,key:"legend-item-".concat(b)},Vo(n.props,g,b)),F.createElement(Gb,{width:s,height:s,viewBox:d,style:m},n.renderIcon(g)),F.createElement("span",{className:"recharts-legend-item-text",style:{color:O}},y?y(j,g,b):j))})}},{key:"render",value:function(){var n=this.props,i=n.payload,o=n.layout,s=n.align;if(!i||!i.length)return null;var u={padding:0,margin:0,textAlign:o==="horizontal"?s:"left"};return F.createElement("ul",{className:"recharts-default-legend",style:u},this.renderItems())}}])})(_.PureComponent);_c(Qw,"displayName","Legend");_c(Qw,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Dy,G2;function V9(){if(G2)return Dy;G2=1;var e=vp();function t(){this.__data__=new e,this.size=0}return Dy=t,Dy}var Ly,K2;function G9(){if(K2)return Ly;K2=1;function e(t){var r=this.__data__,n=r.delete(t);return this.size=r.size,n}return Ly=e,Ly}var $y,X2;function K9(){if(X2)return $y;X2=1;function e(t){return this.__data__.get(t)}return $y=e,$y}var By,Y2;function X9(){if(Y2)return By;Y2=1;function e(t){return this.__data__.has(t)}return By=e,By}var Fy,Q2;function Y9(){if(Q2)return Fy;Q2=1;var e=vp(),t=zw(),r=qw(),n=200;function i(o,s){var u=this.__data__;if(u instanceof e){var f=u.__data__;if(!t||f.lengthg))return!1;var y=p.get(s),w=p.get(u);if(y&&w)return y==u&&w==s;var j=-1,O=!0,E=f&i?new e:void 0;for(p.set(s,u),p.set(u,s);++j-1&&n%1==0&&n-1&&r%1==0&&r<=e}return l0=t,l0}var c0,wP;function cU(){if(wP)return c0;wP=1;var e=Ai(),t=tS(),r=Ci(),n="[object Arguments]",i="[object Array]",o="[object Boolean]",s="[object Date]",u="[object Error]",f="[object Function]",l="[object Map]",d="[object Number]",p="[object Object]",m="[object RegExp]",g="[object Set]",b="[object String]",y="[object WeakMap]",w="[object ArrayBuffer]",j="[object DataView]",O="[object Float32Array]",E="[object Float64Array]",N="[object Int8Array]",A="[object Int16Array]",C="[object Int32Array]",T="[object Uint8Array]",R="[object Uint8ClampedArray]",I="[object Uint16Array]",z="[object Uint32Array]",$={};$[O]=$[E]=$[N]=$[A]=$[C]=$[T]=$[R]=$[I]=$[z]=!0,$[n]=$[i]=$[w]=$[o]=$[j]=$[s]=$[u]=$[f]=$[l]=$[d]=$[p]=$[m]=$[g]=$[b]=$[y]=!1;function L(U){return r(U)&&t(U.length)&&!!$[e(U)]}return c0=L,c0}var u0,SP;function xI(){if(SP)return u0;SP=1;function e(t){return function(r){return t(r)}}return u0=e,u0}var ac={exports:{}};ac.exports;var _P;function uU(){return _P||(_P=1,(function(e,t){var r=BM(),n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===n,s=o&&r.process,u=(function(){try{var f=i&&i.require&&i.require("util").types;return f||s&&s.binding&&s.binding("util")}catch{}})();e.exports=u})(ac,ac.exports)),ac.exports}var f0,jP;function bI(){if(jP)return f0;jP=1;var e=cU(),t=xI(),r=uU(),n=r&&r.isTypedArray,i=n?t(n):e;return f0=i,f0}var d0,OP;function fU(){if(OP)return d0;OP=1;var e=aU(),t=Jw(),r=Er(),n=yI(),i=eS(),o=bI(),s=Object.prototype,u=s.hasOwnProperty;function f(l,d){var p=r(l),m=!p&&t(l),g=!p&&!m&&n(l),b=!p&&!m&&!g&&o(l),y=p||m||g||b,w=y?e(l.length,String):[],j=w.length;for(var O in l)(d||u.call(l,O))&&!(y&&(O=="length"||g&&(O=="offset"||O=="parent")||b&&(O=="buffer"||O=="byteLength"||O=="byteOffset")||i(O,j)))&&w.push(O);return w}return d0=f,d0}var h0,EP;function dU(){if(EP)return h0;EP=1;var e=Object.prototype;function t(r){var n=r&&r.constructor,i=typeof n=="function"&&n.prototype||e;return r===i}return h0=t,h0}var p0,PP;function wI(){if(PP)return p0;PP=1;function e(t,r){return function(n){return t(r(n))}}return p0=e,p0}var m0,AP;function hU(){if(AP)return m0;AP=1;var e=wI(),t=e(Object.keys,Object);return m0=t,m0}var v0,CP;function pU(){if(CP)return v0;CP=1;var e=dU(),t=hU(),r=Object.prototype,n=r.hasOwnProperty;function i(o){if(!e(o))return t(o);var s=[];for(var u in Object(o))n.call(o,u)&&u!="constructor"&&s.push(u);return s}return v0=i,v0}var g0,NP;function lu(){if(NP)return g0;NP=1;var e=Bw(),t=tS();function r(n){return n!=null&&t(n.length)&&!e(n)}return g0=r,g0}var y0,TP;function _p(){if(TP)return y0;TP=1;var e=fU(),t=pU(),r=lu();function n(i){return r(i)?e(i):t(i)}return y0=n,y0}var x0,kP;function mU(){if(kP)return x0;kP=1;var e=rU(),t=oU(),r=_p();function n(i){return e(i,r,t)}return x0=n,x0}var b0,RP;function vU(){if(RP)return b0;RP=1;var e=mU(),t=1,r=Object.prototype,n=r.hasOwnProperty;function i(o,s,u,f,l,d){var p=u&t,m=e(o),g=m.length,b=e(s),y=b.length;if(g!=y&&!p)return!1;for(var w=g;w--;){var j=m[w];if(!(p?j in s:n.call(s,j)))return!1}var O=d.get(o),E=d.get(s);if(O&&E)return O==s&&E==o;var N=!0;d.set(o,s),d.set(s,o);for(var A=p;++w-1}return V0=t,V0}var G0,aA;function DU(){if(aA)return G0;aA=1;function e(t,r,n){for(var i=-1,o=t==null?0:t.length;++i=s){var j=l?null:i(f);if(j)return o(j);b=!1,m=n,w=new e}else w=l?[]:y;e:for(;++p=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function QU(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function ZU(e){return e.value}function JU(e,t){if(F.isValidElement(e))return F.cloneElement(e,t);if(typeof e=="function")return F.createElement(e,t);t.ref;var r=YU(t,qU);return F.createElement(Qw,r)}var pA=1,rs=(function(e){function t(){var r;UU(this,t);for(var n=arguments.length,i=new Array(n),o=0;opA||Math.abs(i.height-this.lastBoundingBox.height)>pA)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,n&&n(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?hi({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var i=this.props,o=i.layout,s=i.align,u=i.verticalAlign,f=i.margin,l=i.chartWidth,d=i.chartHeight,p,m;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(s==="center"&&o==="vertical"){var g=this.getBBoxSnapshot();p={left:((l||0)-g.width)/2}}else p=s==="right"?{right:f&&f.right||0}:{left:f&&f.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(u==="middle"){var b=this.getBBoxSnapshot();m={top:((d||0)-b.height)/2}}else m=u==="bottom"?{bottom:f&&f.bottom||0}:{top:f&&f.top||0};return hi(hi({},p),m)}},{key:"render",value:function(){var n=this,i=this.props,o=i.content,s=i.width,u=i.height,f=i.wrapperStyle,l=i.payloadUniqBy,d=i.payload,p=hi(hi({position:"absolute",width:s||"auto",height:u||"auto"},this.getDefaultPosition(f)),f);return F.createElement("div",{className:"recharts-legend-wrapper",style:p,ref:function(g){n.wrapperNode=g}},JU(o,hi(hi({},this.props),{},{payload:EI(d,l,ZU)})))}}],[{key:"getWithHeight",value:function(n,i){var o=hi(hi({},this.defaultProps),n.props),s=o.layout;return s==="vertical"&&ge(n.props.height)?{height:n.props.height}:s==="horizontal"?{width:n.props.width||i}:null}}])})(_.PureComponent);jp(rs,"displayName","Legend");jp(rs,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var Z0,mA;function e7(){if(mA)return Z0;mA=1;var e=au(),t=Jw(),r=Er(),n=e?e.isConcatSpreadable:void 0;function i(o){return r(o)||t(o)||!!(n&&o&&o[n])}return Z0=i,Z0}var J0,vA;function CI(){if(vA)return J0;vA=1;var e=gI(),t=e7();function r(n,i,o,s,u){var f=-1,l=n.length;for(o||(o=t),u||(u=[]);++f0&&o(d)?i>1?r(d,i-1,o,s,u):e(u,d):s||(u[u.length]=d)}return u}return J0=r,J0}var ex,gA;function t7(){if(gA)return ex;gA=1;function e(t){return function(r,n,i){for(var o=-1,s=Object(r),u=i(r),f=u.length;f--;){var l=u[t?f:++o];if(n(s[l],l,s)===!1)break}return r}}return ex=e,ex}var tx,yA;function r7(){if(yA)return tx;yA=1;var e=t7(),t=e();return tx=t,tx}var rx,xA;function NI(){if(xA)return rx;xA=1;var e=r7(),t=_p();function r(n,i){return n&&e(n,i,t)}return rx=r,rx}var nx,bA;function n7(){if(bA)return nx;bA=1;var e=lu();function t(r,n){return function(i,o){if(i==null)return i;if(!e(i))return r(i,o);for(var s=i.length,u=n?s:-1,f=Object(i);(n?u--:++un||u&&f&&d&&!l&&!p||o&&f&&d||!i&&d||!s)return 1;if(!o&&!u&&!p&&r=l)return d;var p=i[o];return d*(p=="desc"?-1:1)}}return r.index-n.index}return lx=t,lx}var cx,EA;function s7(){if(EA)return cx;EA=1;var e=Uw(),t=Ww(),r=ri(),n=TI(),i=i7(),o=xI(),s=a7(),u=Vs(),f=Er();function l(d,p,m){p.length?p=e(p,function(y){return f(y)?function(w){return t(w,y.length===1?y[0]:y)}:y}):p=[u];var g=-1;p=e(p,o(r));var b=n(d,function(y,w,j){var O=e(p,function(E){return E(y)});return{criteria:O,index:++g,value:y}});return i(b,function(y,w){return s(y,w,m)})}return cx=l,cx}var ux,PA;function l7(){if(PA)return ux;PA=1;function e(t,r,n){switch(n.length){case 0:return t.call(r);case 1:return t.call(r,n[0]);case 2:return t.call(r,n[0],n[1]);case 3:return t.call(r,n[0],n[1],n[2])}return t.apply(r,n)}return ux=e,ux}var fx,AA;function c7(){if(AA)return fx;AA=1;var e=l7(),t=Math.max;function r(n,i,o){return i=t(i===void 0?n.length-1:i,0),function(){for(var s=arguments,u=-1,f=t(s.length-i,0),l=Array(f);++u0){if(++o>=e)return arguments[0]}else o=0;return i.apply(void 0,arguments)}}return mx=n,mx}var vx,RA;function h7(){if(RA)return vx;RA=1;var e=f7(),t=d7(),r=t(e);return vx=r,vx}var gx,MA;function p7(){if(MA)return gx;MA=1;var e=Vs(),t=c7(),r=h7();function n(i,o){return r(t(i,o,e),i+"")}return gx=n,gx}var yx,IA;function Op(){if(IA)return yx;IA=1;var e=Fw(),t=lu(),r=eS(),n=lo();function i(o,s,u){if(!n(u))return!1;var f=typeof s;return(f=="number"?t(u)&&r(s,u.length):f=="string"&&s in u)?e(u[s],o):!1}return yx=i,yx}var xx,DA;function m7(){if(DA)return xx;DA=1;var e=CI(),t=s7(),r=p7(),n=Op(),i=r(function(o,s){if(o==null)return[];var u=s.length;return u>1&&n(o,s[0],s[1])?s=[]:u>2&&n(s[0],s[1],s[2])&&(s=[s[0]]),t(o,e(s,1),[])});return xx=i,xx}var v7=m7();const iS=ot(v7);function jc(e){"@babel/helpers - typeof";return jc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jc(e)}function n1(){return n1=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t.x),"".concat(Wl,"-left"),ge(r)&&t&&ge(t.x)&&r=t.y),"".concat(Wl,"-top"),ge(n)&&t&&ge(t.y)&&ny?Math.max(d,f[n]):Math.max(p,f[n])}function T7(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function k7(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,i=e.position,o=e.reverseDirection,s=e.tooltipBox,u=e.useTranslate3d,f=e.viewBox,l,d,p;return s.height>0&&s.width>0&&r?(d=BA({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:i,reverseDirection:o,tooltipDimension:s.width,viewBox:f,viewBoxDimension:f.width}),p=BA({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:i,reverseDirection:o,tooltipDimension:s.height,viewBox:f,viewBoxDimension:f.height}),l=T7({translateX:d,translateY:p,useTranslate3d:u})):l=C7,{cssProperties:l,cssClasses:N7({translateX:d,translateY:p,coordinate:r})}}function ms(e){"@babel/helpers - typeof";return ms=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ms(e)}function FA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function zA(e){for(var t=1;tqA||Math.abs(n.height-this.state.lastBoundingBox.height)>qA)&&this.setState({lastBoundingBox:{width:n.width,height:n.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var n,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,i=this.props,o=i.active,s=i.allowEscapeViewBox,u=i.animationDuration,f=i.animationEasing,l=i.children,d=i.coordinate,p=i.hasPayload,m=i.isAnimationActive,g=i.offset,b=i.position,y=i.reverseDirection,w=i.useTranslate3d,j=i.viewBox,O=i.wrapperStyle,E=k7({allowEscapeViewBox:s,coordinate:d,offsetTopLeft:g,position:b,reverseDirection:y,tooltipBox:this.state.lastBoundingBox,useTranslate3d:w,viewBox:j}),N=E.cssClasses,A=E.cssProperties,C=zA(zA({transition:m&&o?"transform ".concat(u,"ms ").concat(f):void 0},A),{},{pointerEvents:"none",visibility:!this.state.dismissed&&o&&p?"visible":"hidden",position:"absolute",top:0,left:0},O);return F.createElement("div",{tabIndex:-1,className:N,style:C,ref:function(R){n.wrapperNode=R}},l)}}])})(_.PureComponent),q7=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},aa={isSsr:q7()};function vs(e){"@babel/helpers - typeof";return vs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vs(e)}function UA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function WA(e){for(var t=1;t0;return F.createElement(z7,{allowEscapeViewBox:s,animationDuration:u,animationEasing:f,isAnimationActive:m,active:o,coordinate:d,hasPayload:C,offset:g,position:w,reverseDirection:j,useTranslate3d:O,viewBox:E,wrapperStyle:N},Z7(l,WA(WA({},this.props),{},{payload:A})))}}])})(_.PureComponent);oS(Br,"displayName","Tooltip");oS(Br,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!aa.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var wx,HA;function J7(){if(HA)return wx;HA=1;var e=ti(),t=function(){return e.Date.now()};return wx=t,wx}var Sx,VA;function eW(){if(VA)return Sx;VA=1;var e=/\s/;function t(r){for(var n=r.length;n--&&e.test(r.charAt(n)););return n}return Sx=t,Sx}var _x,GA;function tW(){if(GA)return _x;GA=1;var e=eW(),t=/^\s+/;function r(n){return n&&n.slice(0,e(n)+1).replace(t,"")}return _x=r,_x}var jx,KA;function LI(){if(KA)return jx;KA=1;var e=tW(),t=lo(),r=Us(),n=NaN,i=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,s=/^0o[0-7]+$/i,u=parseInt;function f(l){if(typeof l=="number")return l;if(r(l))return n;if(t(l)){var d=typeof l.valueOf=="function"?l.valueOf():l;l=t(d)?d+"":d}if(typeof l!="string")return l===0?l:+l;l=e(l);var p=o.test(l);return p||s.test(l)?u(l.slice(2),p?2:8):i.test(l)?n:+l}return jx=f,jx}var Ox,XA;function rW(){if(XA)return Ox;XA=1;var e=lo(),t=J7(),r=LI(),n="Expected a function",i=Math.max,o=Math.min;function s(u,f,l){var d,p,m,g,b,y,w=0,j=!1,O=!1,E=!0;if(typeof u!="function")throw new TypeError(n);f=r(f)||0,e(l)&&(j=!!l.leading,O="maxWait"in l,m=O?i(r(l.maxWait)||0,f):m,E="trailing"in l?!!l.trailing:E);function N(U){var W=d,V=p;return d=p=void 0,w=U,g=u.apply(V,W),g}function A(U){return w=U,b=setTimeout(R,f),j?N(U):g}function C(U){var W=U-y,V=U-w,G=f-W;return O?o(G,m-V):G}function T(U){var W=U-y,V=U-w;return y===void 0||W>=f||W<0||O&&V>=m}function R(){var U=t();if(T(U))return I(U);b=setTimeout(R,C(U))}function I(U){return b=void 0,E&&d?N(U):(d=p=void 0,g)}function z(){b!==void 0&&clearTimeout(b),w=0,d=y=p=b=void 0}function $(){return b===void 0?g:I(t())}function L(){var U=t(),W=T(U);if(d=arguments,p=this,y=U,W){if(b===void 0)return A(y);if(O)return clearTimeout(b),b=setTimeout(R,f),N(y)}return b===void 0&&(b=setTimeout(R,f)),g}return L.cancel=z,L.flush=$,L}return Ox=s,Ox}var Ex,YA;function nW(){if(YA)return Ex;YA=1;var e=rW(),t=lo(),r="Expected a function";function n(i,o,s){var u=!0,f=!0;if(typeof i!="function")throw new TypeError(r);return t(s)&&(u="leading"in s?!!s.leading:u,f="trailing"in s?!!s.trailing:f),e(i,o,{leading:u,maxWait:o,trailing:f})}return Ex=n,Ex}var iW=nW();const $I=ot(iW);function Ec(e){"@babel/helpers - typeof";return Ec=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ec(e)}function QA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function zf(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(U=$I(U,y,{trailing:!0,leading:!1}));var W=new ResizeObserver(U),V=A.current.getBoundingClientRect(),G=V.width,Y=V.height;return $(G,Y),W.observe(A.current),function(){W.disconnect()}},[$,y]);var L=_.useMemo(function(){var U=I.containerWidth,W=I.containerHeight;if(U<0||W<0)return null;Tn($o(s)||$o(f),`The width(%s) and height(%s) are both fixed numbers, - maybe you don't need to use a ResponsiveContainer.`,s,f),Tn(!r||r>0,"The aspect(%s) must be greater than zero.",r);var V=$o(s)?U:s,G=$o(f)?W:f;r&&r>0&&(V?G=V/r:G&&(V=G*r),m&&G>m&&(G=m)),Tn(V>0||G>0,`The width(%s) and height(%s) of chart should be greater than 0, - please check the style of container, or the props width(%s) and height(%s), - or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the - height and width.`,V,G,s,f,d,p,r);var Y=!Array.isArray(g)&&xi(g.type).endsWith("Chart");return F.Children.map(g,function(D){return F.isValidElement(D)?_.cloneElement(D,zf({width:V,height:G},Y?{style:zf({height:"100%",width:"100%",maxHeight:G,maxWidth:V},D.props.style)}:{})):D})},[r,g,f,m,p,d,I,s]);return F.createElement("div",{id:w?"".concat(w):void 0,className:We("recharts-responsive-container",j),style:zf(zf({},N),{},{width:s,height:f,minWidth:d,minHeight:p,maxHeight:m}),ref:A},L)}),Ep=function(t){return null};Ep.displayName="Cell";function Pc(e){"@babel/helpers - typeof";return Pc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pc(e)}function JA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function s1(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||aa.isSsr)return{width:0,height:0};var n=yW(r),i=JSON.stringify({text:t,copyStyle:n});if(La.widthCache[i])return La.widthCache[i];try{var o=document.getElementById(eC);o||(o=document.createElement("span"),o.setAttribute("id",eC),o.setAttribute("aria-hidden","true"),document.body.appendChild(o));var s=s1(s1({},gW),n);Object.assign(o.style,s),o.textContent="".concat(t);var u=o.getBoundingClientRect(),f={width:u.width,height:u.height};return La.widthCache[i]=f,++La.cacheCount>vW&&(La.cacheCount=0,La.widthCache={}),f}catch{return{width:0,height:0}}},xW=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function Ac(e){"@babel/helpers - typeof";return Ac=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ac(e)}function fh(e,t){return _W(e)||SW(e,t)||wW(e,t)||bW()}function bW(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wW(e,t){if(e){if(typeof e=="string")return tC(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return tC(e,t)}}function tC(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function LW(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function sC(e,t){return zW(e)||FW(e,t)||BW(e,t)||$W()}function $W(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function BW(e,t){if(e){if(typeof e=="string")return lC(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return lC(e,t)}}function lC(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[];return V.reduce(function(G,Y){var D=Y.word,Q=Y.width,J=G[G.length-1];if(J&&(i==null||o||J.width+Q+nY.width?G:Y})};if(!d)return g;for(var y="…",w=function(V){var G=p.slice(0,V),Y=qI({breakAll:l,style:f,children:G+y}).wordsWithComputedWidth,D=m(Y),Q=D.length>s||b(D).width>Number(i);return[Q,D]},j=0,O=p.length-1,E=0,N;j<=O&&E<=p.length-1;){var A=Math.floor((j+O)/2),C=A-1,T=w(C),R=sC(T,2),I=R[0],z=R[1],$=w(A),L=sC($,1),U=L[0];if(!I&&!U&&(j=A+1),I&&U&&(O=A-1),!I&&U){N=z;break}E++}return N||g},cC=function(t){var r=Ue(t)?[]:t.toString().split(zI);return[{words:r}]},UW=function(t){var r=t.width,n=t.scaleToFit,i=t.children,o=t.style,s=t.breakAll,u=t.maxLines;if((r||n)&&!aa.isSsr){var f,l,d=qI({breakAll:s,children:i,style:o});if(d){var p=d.wordsWithComputedWidth,m=d.spaceWidth;f=p,l=m}else return cC(i);return qW({breakAll:s,children:i,maxLines:u,style:o},f,l,r,n)}return cC(i)},uC="#808080",Go=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,o=i===void 0?0:i,s=t.lineHeight,u=s===void 0?"1em":s,f=t.capHeight,l=f===void 0?"0.71em":f,d=t.scaleToFit,p=d===void 0?!1:d,m=t.textAnchor,g=m===void 0?"start":m,b=t.verticalAnchor,y=b===void 0?"end":b,w=t.fill,j=w===void 0?uC:w,O=aC(t,IW),E=_.useMemo(function(){return UW({breakAll:O.breakAll,children:O.children,maxLines:O.maxLines,scaleToFit:p,style:O.style,width:O.width})},[O.breakAll,O.children,O.maxLines,p,O.style,O.width]),N=O.dx,A=O.dy,C=O.angle,T=O.className,R=O.breakAll,I=aC(O,DW);if(!Ft(n)||!Ft(o))return null;var z=n+(ge(N)?N:0),$=o+(ge(A)?A:0),L;switch(y){case"start":L=Px("calc(".concat(l,")"));break;case"middle":L=Px("calc(".concat((E.length-1)/2," * -").concat(u," + (").concat(l," / 2))"));break;default:L=Px("calc(".concat(E.length-1," * -").concat(u,")"));break}var U=[];if(p){var W=E[0].width,V=O.width;U.push("scale(".concat((ge(V)?V/W:1)/W,")"))}return C&&U.push("rotate(".concat(C,", ").concat(z,", ").concat($,")")),U.length&&(I.transform=U.join(" ")),F.createElement("text",l1({},Le(I,!0),{x:z,y:$,className:We("recharts-text",T),textAnchor:g,fill:j.includes("url")?uC:j}),E.map(function(G,Y){var D=G.words.join(R?"":" ");return F.createElement("tspan",{x:z,dy:Y===0?L:u,key:"".concat(D,"-").concat(Y)},D)}))};function io(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function WW(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function aS(e){let t,r,n;e.length!==2?(t=io,r=(u,f)=>io(e(u),f),n=(u,f)=>e(u)-f):(t=e===io||e===WW?e:HW,r=e,n=e);function i(u,f,l=0,d=u.length){if(l>>1;r(u[p],f)<0?l=p+1:d=p}while(l>>1;r(u[p],f)<=0?l=p+1:d=p}while(ll&&n(u[p-1],f)>-n(u[p],f)?p-1:p}return{left:i,center:s,right:o}}function HW(){return 0}function UI(e){return e===null?NaN:+e}function*VW(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const GW=aS(io),cu=GW.right;aS(UI).center;class fC extends Map{constructor(t,r=YW){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,i]of t)this.set(n,i)}get(t){return super.get(dC(this,t))}has(t){return super.has(dC(this,t))}set(t,r){return super.set(KW(this,t),r)}delete(t){return super.delete(XW(this,t))}}function dC({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function KW({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function XW({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function YW(e){return e!==null&&typeof e=="object"?e.valueOf():e}function QW(e=io){if(e===io)return WI;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function WI(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const ZW=Math.sqrt(50),JW=Math.sqrt(10),eH=Math.sqrt(2);function dh(e,t,r){const n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),o=n/Math.pow(10,i),s=o>=ZW?10:o>=JW?5:o>=eH?2:1;let u,f,l;return i<0?(l=Math.pow(10,-i)/s,u=Math.round(e*l),f=Math.round(t*l),u/lt&&--f,l=-l):(l=Math.pow(10,i)*s,u=Math.round(e/l),f=Math.round(t/l),u*lt&&--f),f0))return[];if(e===t)return[e];const n=t=i))return[];const u=o-i+1,f=new Array(u);if(n)if(s<0)for(let l=0;l=n)&&(r=n);return r}function pC(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function HI(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?WI:QW(i);n>r;){if(n-r>600){const f=n-r+1,l=t-r+1,d=Math.log(f),p=.5*Math.exp(2*d/3),m=.5*Math.sqrt(d*p*(f-p)/f)*(l-f/2<0?-1:1),g=Math.max(r,Math.floor(t-l*p/f+m)),b=Math.min(n,Math.floor(t+(f-l)*p/f+m));HI(e,t,g,b,i)}const o=e[t];let s=r,u=n;for(Hl(e,r,t),i(e[n],o)>0&&Hl(e,r,n);s0;)--u}i(e[r],o)===0?Hl(e,r,u):(++u,Hl(e,u,n)),u<=t&&(r=u+1),t<=u&&(n=u-1)}return e}function Hl(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function tH(e,t,r){if(e=Float64Array.from(VW(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return pC(e);if(t>=1)return hC(e);var n,i=(n-1)*t,o=Math.floor(i),s=hC(HI(e,o).subarray(0,o+1)),u=pC(e.subarray(o+1));return s+(u-s)*(i-o)}}function rH(e,t,r=UI){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,o=Math.floor(i),s=+r(e[o],o,e),u=+r(e[o+1],o+1,e);return s+(u-s)*(i-o)}}function nH(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,o=new Array(i);++n>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Uf(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Uf(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=oH.exec(e))?new _r(t[1],t[2],t[3],1):(t=aH.exec(e))?new _r(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=sH.exec(e))?Uf(t[1],t[2],t[3],t[4]):(t=lH.exec(e))?Uf(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=cH.exec(e))?wC(t[1],t[2]/100,t[3]/100,1):(t=uH.exec(e))?wC(t[1],t[2]/100,t[3]/100,t[4]):mC.hasOwnProperty(e)?yC(mC[e]):e==="transparent"?new _r(NaN,NaN,NaN,0):null}function yC(e){return new _r(e>>16&255,e>>8&255,e&255,1)}function Uf(e,t,r,n){return n<=0&&(e=t=r=NaN),new _r(e,t,r,n)}function hH(e){return e instanceof uu||(e=kc(e)),e?(e=e.rgb(),new _r(e.r,e.g,e.b,e.opacity)):new _r}function h1(e,t,r,n){return arguments.length===1?hH(e):new _r(e,t,r,n??1)}function _r(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}lS(_r,h1,GI(uu,{brighter(e){return e=e==null?hh:Math.pow(hh,e),new _r(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Nc:Math.pow(Nc,e),new _r(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new _r(qo(this.r),qo(this.g),qo(this.b),ph(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:xC,formatHex:xC,formatHex8:pH,formatRgb:bC,toString:bC}));function xC(){return`#${Bo(this.r)}${Bo(this.g)}${Bo(this.b)}`}function pH(){return`#${Bo(this.r)}${Bo(this.g)}${Bo(this.b)}${Bo((isNaN(this.opacity)?1:this.opacity)*255)}`}function bC(){const e=ph(this.opacity);return`${e===1?"rgb(":"rgba("}${qo(this.r)}, ${qo(this.g)}, ${qo(this.b)}${e===1?")":`, ${e})`}`}function ph(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function qo(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Bo(e){return e=qo(e),(e<16?"0":"")+e.toString(16)}function wC(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Nn(e,t,r,n)}function KI(e){if(e instanceof Nn)return new Nn(e.h,e.s,e.l,e.opacity);if(e instanceof uu||(e=kc(e)),!e)return new Nn;if(e instanceof Nn)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),o=Math.max(t,r,n),s=NaN,u=o-i,f=(o+i)/2;return u?(t===o?s=(r-n)/u+(r0&&f<1?0:s,new Nn(s,u,f,e.opacity)}function mH(e,t,r,n){return arguments.length===1?KI(e):new Nn(e,t,r,n??1)}function Nn(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}lS(Nn,mH,GI(uu,{brighter(e){return e=e==null?hh:Math.pow(hh,e),new Nn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Nc:Math.pow(Nc,e),new Nn(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new _r(Ax(e>=240?e-240:e+120,i,n),Ax(e,i,n),Ax(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new Nn(SC(this.h),Wf(this.s),Wf(this.l),ph(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=ph(this.opacity);return`${e===1?"hsl(":"hsla("}${SC(this.h)}, ${Wf(this.s)*100}%, ${Wf(this.l)*100}%${e===1?")":`, ${e})`}`}}));function SC(e){return e=(e||0)%360,e<0?e+360:e}function Wf(e){return Math.max(0,Math.min(1,e||0))}function Ax(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const cS=e=>()=>e;function vH(e,t){return function(r){return e+r*t}}function gH(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function yH(e){return(e=+e)==1?XI:function(t,r){return r-t?gH(t,r,e):cS(isNaN(t)?r:t)}}function XI(e,t){var r=t-e;return r?vH(e,r):cS(isNaN(e)?t:e)}const _C=(function e(t){var r=yH(t);function n(i,o){var s=r((i=h1(i)).r,(o=h1(o)).r),u=r(i.g,o.g),f=r(i.b,o.b),l=XI(i.opacity,o.opacity);return function(d){return i.r=s(d),i.g=u(d),i.b=f(d),i.opacity=l(d),i+""}}return n.gamma=e,n})(1);function xH(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(o){for(i=0;ir&&(o=t.slice(r,o),u[s]?u[s]+=o:u[++s]=o),(n=n[0])===(i=i[0])?u[s]?u[s]+=i:u[++s]=i:(u[++s]=null,f.push({i:s,x:mh(n,i)})),r=Cx.lastIndex;return rt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function NH(e,t,r){var n=e[0],i=e[1],o=t[0],s=t[1];return i2?TH:NH,f=l=null,p}function p(m){return m==null||isNaN(m=+m)?o:(f||(f=u(e.map(n),t,r)))(n(s(m)))}return p.invert=function(m){return s(i((l||(l=u(t,e.map(n),mh)))(m)))},p.domain=function(m){return arguments.length?(e=Array.from(m,vh),d()):e.slice()},p.range=function(m){return arguments.length?(t=Array.from(m),d()):t.slice()},p.rangeRound=function(m){return t=Array.from(m),r=uS,d()},p.clamp=function(m){return arguments.length?(s=m?!0:dr,d()):s!==dr},p.interpolate=function(m){return arguments.length?(r=m,d()):r},p.unknown=function(m){return arguments.length?(o=m,p):o},function(m,g){return n=m,i=g,d()}}function fS(){return Pp()(dr,dr)}function kH(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function gh(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function gs(e){return e=gh(Math.abs(e)),e?e[1]:NaN}function RH(e,t){return function(r,n){for(var i=r.length,o=[],s=0,u=e[0],f=0;i>0&&u>0&&(f+u+1>n&&(u=Math.max(1,n-f)),o.push(r.substring(i-=u,i+u)),!((f+=u+1)>n));)u=e[s=(s+1)%e.length];return o.reverse().join(t)}}function MH(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var IH=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Rc(e){if(!(t=IH.exec(e)))throw new Error("invalid format: "+e);var t;return new dS({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Rc.prototype=dS.prototype;function dS(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}dS.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function DH(e){e:for(var t=e.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var yh;function LH(e,t){var r=gh(e,t);if(!r)return yh=void 0,e.toPrecision(t);var n=r[0],i=r[1],o=i-(yh=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=n.length;return o===s?n:o>s?n+new Array(o-s+1).join("0"):o>0?n.slice(0,o)+"."+n.slice(o):"0."+new Array(1-o).join("0")+gh(e,Math.max(0,t+o-1))[0]}function OC(e,t){var r=gh(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const EC={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:kH,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>OC(e*100,t),r:OC,s:LH,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function PC(e){return e}var AC=Array.prototype.map,CC=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function $H(e){var t=e.grouping===void 0||e.thousands===void 0?PC:RH(AC.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?PC:MH(AC.call(e.numerals,String)),s=e.percent===void 0?"%":e.percent+"",u=e.minus===void 0?"−":e.minus+"",f=e.nan===void 0?"NaN":e.nan+"";function l(p,m){p=Rc(p);var g=p.fill,b=p.align,y=p.sign,w=p.symbol,j=p.zero,O=p.width,E=p.comma,N=p.precision,A=p.trim,C=p.type;C==="n"?(E=!0,C="g"):EC[C]||(N===void 0&&(N=12),A=!0,C="g"),(j||g==="0"&&b==="=")&&(j=!0,g="0",b="=");var T=(m&&m.prefix!==void 0?m.prefix:"")+(w==="$"?r:w==="#"&&/[boxX]/.test(C)?"0"+C.toLowerCase():""),R=(w==="$"?n:/[%p]/.test(C)?s:"")+(m&&m.suffix!==void 0?m.suffix:""),I=EC[C],z=/[defgprs%]/.test(C);N=N===void 0?6:/[gprs]/.test(C)?Math.max(1,Math.min(21,N)):Math.max(0,Math.min(20,N));function $(L){var U=T,W=R,V,G,Y;if(C==="c")W=I(L)+W,L="";else{L=+L;var D=L<0||1/L<0;if(L=isNaN(L)?f:I(Math.abs(L),N),A&&(L=DH(L)),D&&+L==0&&y!=="+"&&(D=!1),U=(D?y==="("?y:u:y==="-"||y==="("?"":y)+U,W=(C==="s"&&!isNaN(L)&&yh!==void 0?CC[8+yh/3]:"")+W+(D&&y==="("?")":""),z){for(V=-1,G=L.length;++VY||Y>57){W=(Y===46?i+L.slice(V+1):L.slice(V))+W,L=L.slice(0,V);break}}}E&&!j&&(L=t(L,1/0));var Q=U.length+L.length+W.length,J=Q>1)+U+L+W+J.slice(Q);break;default:L=J+U+L+W;break}return o(L)}return $.toString=function(){return p+""},$}function d(p,m){var g=Math.max(-8,Math.min(8,Math.floor(gs(m)/3)))*3,b=Math.pow(10,-g),y=l((p=Rc(p),p.type="f",p),{suffix:CC[8+g/3]});return function(w){return y(b*w)}}return{format:l,formatPrefix:d}}var Hf,hS,YI;BH({thousands:",",grouping:[3],currency:["$",""]});function BH(e){return Hf=$H(e),hS=Hf.format,YI=Hf.formatPrefix,Hf}function FH(e){return Math.max(0,-gs(Math.abs(e)))}function zH(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(gs(t)/3)))*3-gs(Math.abs(e)))}function qH(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,gs(t)-gs(e))+1}function QI(e,t,r,n){var i=f1(e,t,r),o;switch(n=Rc(n??",f"),n.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(o=zH(i,s))&&(n.precision=o),YI(n,s)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(o=qH(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=o-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(o=FH(i))&&(n.precision=o-(n.type==="%")*2);break}}return hS(n)}function co(e){var t=e.domain;return e.ticks=function(r){var n=t();return c1(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return QI(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,o=n.length-1,s=n[i],u=n[o],f,l,d=10;for(u0;){if(l=u1(s,u,r),l===f)return n[i]=s,n[o]=u,t(n);if(l>0)s=Math.floor(s/l)*l,u=Math.ceil(u/l)*l;else if(l<0)s=Math.ceil(s*l)/l,u=Math.floor(u*l)/l;else break;f=l}return e},e}function xh(){var e=fS();return e.copy=function(){return fu(e,xh())},cn.apply(e,arguments),co(e)}function ZI(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,vh),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return ZI(e).unknown(t)},e=arguments.length?Array.from(e,vh):[0,1],co(r)}function JI(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],o=e[n],s;return oMath.pow(e,t)}function GH(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function kC(e){return(t,r)=>-e(-t,r)}function pS(e){const t=e(NC,TC),r=t.domain;let n=10,i,o;function s(){return i=GH(n),o=VH(n),r()[0]<0?(i=kC(i),o=kC(o),e(UH,WH)):e(NC,TC),t}return t.base=function(u){return arguments.length?(n=+u,s()):n},t.domain=function(u){return arguments.length?(r(u),s()):r()},t.ticks=u=>{const f=r();let l=f[0],d=f[f.length-1];const p=d0){for(;m<=g;++m)for(b=1;bd)break;j.push(y)}}else for(;m<=g;++m)for(b=n-1;b>=1;--b)if(y=m>0?b/o(-m):b*o(m),!(yd)break;j.push(y)}j.length*2{if(u==null&&(u=10),f==null&&(f=n===10?"s":","),typeof f!="function"&&(!(n%1)&&(f=Rc(f)).precision==null&&(f.trim=!0),f=hS(f)),u===1/0)return f;const l=Math.max(1,n*u/t.ticks().length);return d=>{let p=d/o(Math.round(i(d)));return p*nr(JI(r(),{floor:u=>o(Math.floor(i(u))),ceil:u=>o(Math.ceil(i(u)))})),t}function eD(){const e=pS(Pp()).domain([1,10]);return e.copy=()=>fu(e,eD()).base(e.base()),cn.apply(e,arguments),e}function RC(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function MC(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function mS(e){var t=1,r=e(RC(t),MC(t));return r.constant=function(n){return arguments.length?e(RC(t=+n),MC(t)):t},co(r)}function tD(){var e=mS(Pp());return e.copy=function(){return fu(e,tD()).constant(e.constant())},cn.apply(e,arguments)}function IC(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function KH(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function XH(e){return e<0?-e*e:e*e}function vS(e){var t=e(dr,dr),r=1;function n(){return r===1?e(dr,dr):r===.5?e(KH,XH):e(IC(r),IC(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},co(t)}function gS(){var e=vS(Pp());return e.copy=function(){return fu(e,gS()).exponent(e.exponent())},cn.apply(e,arguments),e}function YH(){return gS.apply(null,arguments).exponent(.5)}function DC(e){return Math.sign(e)*e*e}function QH(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function rD(){var e=fS(),t=[0,1],r=!1,n;function i(o){var s=QH(e(o));return isNaN(s)?n:r?Math.round(s):s}return i.invert=function(o){return e.invert(DC(o))},i.domain=function(o){return arguments.length?(e.domain(o),i):e.domain()},i.range=function(o){return arguments.length?(e.range((t=Array.from(o,vh)).map(DC)),i):t.slice()},i.rangeRound=function(o){return i.range(o).round(!0)},i.round=function(o){return arguments.length?(r=!!o,i):r},i.clamp=function(o){return arguments.length?(e.clamp(o),i):e.clamp()},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return rD(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},cn.apply(i,arguments),co(i)}function nD(){var e=[],t=[],r=[],n;function i(){var s=0,u=Math.max(1,t.length);for(r=new Array(u-1);++s0?r[u-1]:e[0],u=r?[n[r-1],t]:[n[l-1],n[l]]},s.unknown=function(f){return arguments.length&&(o=f),s},s.thresholds=function(){return n.slice()},s.copy=function(){return iD().domain([e,t]).range(i).unknown(o)},cn.apply(co(s),arguments)}function oD(){var e=[.5],t=[0,1],r,n=1;function i(o){return o!=null&&o<=o?t[cu(e,o,0,n)]:r}return i.domain=function(o){return arguments.length?(e=Array.from(o),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(o){return arguments.length?(t=Array.from(o),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(o){var s=t.indexOf(o);return[e[s-1],e[s]]},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return oD().domain(e).range(t).unknown(r)},cn.apply(i,arguments)}const Nx=new Date,Tx=new Date;function zt(e,t,r,n){function i(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(e(o=new Date(+o)),o),i.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),i.round=o=>{const s=i(o),u=i.ceil(o);return o-s(t(o=new Date(+o),s==null?1:Math.floor(s)),o),i.range=(o,s,u)=>{const f=[];if(o=i.ceil(o),u=u==null?1:Math.floor(u),!(o0))return f;let l;do f.push(l=new Date(+o)),t(o,u),e(o);while(lzt(s=>{if(s>=s)for(;e(s),!o(s);)s.setTime(s-1)},(s,u)=>{if(s>=s)if(u<0)for(;++u<=0;)for(;t(s,-1),!o(s););else for(;--u>=0;)for(;t(s,1),!o(s););}),r&&(i.count=(o,s)=>(Nx.setTime(+o),Tx.setTime(+s),e(Nx),e(Tx),Math.floor(r(Nx,Tx))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(n?s=>n(s)%o===0:s=>i.count(0,s)%o===0):i)),i}const bh=zt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);bh.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?zt(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):bh);bh.range;const vi=1e3,an=vi*60,gi=an*60,Si=gi*24,yS=Si*7,LC=Si*30,kx=Si*365,Fo=zt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*vi)},(e,t)=>(t-e)/vi,e=>e.getUTCSeconds());Fo.range;const xS=zt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*vi)},(e,t)=>{e.setTime(+e+t*an)},(e,t)=>(t-e)/an,e=>e.getMinutes());xS.range;const bS=zt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*an)},(e,t)=>(t-e)/an,e=>e.getUTCMinutes());bS.range;const wS=zt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*vi-e.getMinutes()*an)},(e,t)=>{e.setTime(+e+t*gi)},(e,t)=>(t-e)/gi,e=>e.getHours());wS.range;const SS=zt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*gi)},(e,t)=>(t-e)/gi,e=>e.getUTCHours());SS.range;const du=zt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*an)/Si,e=>e.getDate()-1);du.range;const Ap=zt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Si,e=>e.getUTCDate()-1);Ap.range;const aD=zt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Si,e=>Math.floor(e/Si));aD.range;function sa(e){return zt(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*an)/yS)}const Cp=sa(0),wh=sa(1),ZH=sa(2),JH=sa(3),ys=sa(4),eV=sa(5),tV=sa(6);Cp.range;wh.range;ZH.range;JH.range;ys.range;eV.range;tV.range;function la(e){return zt(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/yS)}const Np=la(0),Sh=la(1),rV=la(2),nV=la(3),xs=la(4),iV=la(5),oV=la(6);Np.range;Sh.range;rV.range;nV.range;xs.range;iV.range;oV.range;const _S=zt(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());_S.range;const jS=zt(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());jS.range;const _i=zt(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());_i.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:zt(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});_i.range;const ji=zt(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());ji.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:zt(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});ji.range;function sD(e,t,r,n,i,o){const s=[[Fo,1,vi],[Fo,5,5*vi],[Fo,15,15*vi],[Fo,30,30*vi],[o,1,an],[o,5,5*an],[o,15,15*an],[o,30,30*an],[i,1,gi],[i,3,3*gi],[i,6,6*gi],[i,12,12*gi],[n,1,Si],[n,2,2*Si],[r,1,yS],[t,1,LC],[t,3,3*LC],[e,1,kx]];function u(l,d,p){const m=dw).right(s,m);if(g===s.length)return e.every(f1(l/kx,d/kx,p));if(g===0)return bh.every(Math.max(f1(l,d,p),1));const[b,y]=s[m/s[g-1][2]53)return null;"w"in oe||(oe.w=1),"Z"in oe?(Me=Mx(Vl(oe.y,0,1)),Ye=Me.getUTCDay(),Me=Ye>4||Ye===0?Sh.ceil(Me):Sh(Me),Me=Ap.offset(Me,(oe.V-1)*7),oe.y=Me.getUTCFullYear(),oe.m=Me.getUTCMonth(),oe.d=Me.getUTCDate()+(oe.w+6)%7):(Me=Rx(Vl(oe.y,0,1)),Ye=Me.getDay(),Me=Ye>4||Ye===0?wh.ceil(Me):wh(Me),Me=du.offset(Me,(oe.V-1)*7),oe.y=Me.getFullYear(),oe.m=Me.getMonth(),oe.d=Me.getDate()+(oe.w+6)%7)}else("W"in oe||"U"in oe)&&("w"in oe||(oe.w="u"in oe?oe.u%7:"W"in oe?1:0),Ye="Z"in oe?Mx(Vl(oe.y,0,1)).getUTCDay():Rx(Vl(oe.y,0,1)).getDay(),oe.m=0,oe.d="W"in oe?(oe.w+6)%7+oe.W*7-(Ye+5)%7:oe.w+oe.U*7-(Ye+6)%7);return"Z"in oe?(oe.H+=oe.Z/100|0,oe.M+=oe.Z%100,Mx(oe)):Rx(oe)}}function R(ie,de,ye,oe){for(var $e=0,Me=de.length,Ye=ye.length,lt,vt;$e=Ye)return-1;if(lt=de.charCodeAt($e++),lt===37){if(lt=de.charAt($e++),vt=A[lt in $C?de.charAt($e++):lt],!vt||(oe=vt(ie,ye,oe))<0)return-1}else if(lt!=ye.charCodeAt(oe++))return-1}return oe}function I(ie,de,ye){var oe=l.exec(de.slice(ye));return oe?(ie.p=d.get(oe[0].toLowerCase()),ye+oe[0].length):-1}function z(ie,de,ye){var oe=g.exec(de.slice(ye));return oe?(ie.w=b.get(oe[0].toLowerCase()),ye+oe[0].length):-1}function $(ie,de,ye){var oe=p.exec(de.slice(ye));return oe?(ie.w=m.get(oe[0].toLowerCase()),ye+oe[0].length):-1}function L(ie,de,ye){var oe=j.exec(de.slice(ye));return oe?(ie.m=O.get(oe[0].toLowerCase()),ye+oe[0].length):-1}function U(ie,de,ye){var oe=y.exec(de.slice(ye));return oe?(ie.m=w.get(oe[0].toLowerCase()),ye+oe[0].length):-1}function W(ie,de,ye){return R(ie,t,de,ye)}function V(ie,de,ye){return R(ie,r,de,ye)}function G(ie,de,ye){return R(ie,n,de,ye)}function Y(ie){return s[ie.getDay()]}function D(ie){return o[ie.getDay()]}function Q(ie){return f[ie.getMonth()]}function J(ie){return u[ie.getMonth()]}function M(ie){return i[+(ie.getHours()>=12)]}function B(ie){return 1+~~(ie.getMonth()/3)}function Z(ie){return s[ie.getUTCDay()]}function te(ie){return o[ie.getUTCDay()]}function ve(ie){return f[ie.getUTCMonth()]}function xe(ie){return u[ie.getUTCMonth()]}function X(ie){return i[+(ie.getUTCHours()>=12)]}function ue(ie){return 1+~~(ie.getUTCMonth()/3)}return{format:function(ie){var de=C(ie+="",E);return de.toString=function(){return ie},de},parse:function(ie){var de=T(ie+="",!1);return de.toString=function(){return ie},de},utcFormat:function(ie){var de=C(ie+="",N);return de.toString=function(){return ie},de},utcParse:function(ie){var de=T(ie+="",!0);return de.toString=function(){return ie},de}}}var $C={"-":"",_:" ",0:"0"},Gt=/^\s*\d+/,fV=/^%/,dV=/[\\^$*+?|[\]().{}]/g;function it(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",o=i.length;return n+(o[t.toLowerCase(),r]))}function pV(e,t,r){var n=Gt.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function mV(e,t,r){var n=Gt.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function vV(e,t,r){var n=Gt.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function gV(e,t,r){var n=Gt.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function yV(e,t,r){var n=Gt.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function BC(e,t,r){var n=Gt.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function FC(e,t,r){var n=Gt.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function xV(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function bV(e,t,r){var n=Gt.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function wV(e,t,r){var n=Gt.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function zC(e,t,r){var n=Gt.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function SV(e,t,r){var n=Gt.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function qC(e,t,r){var n=Gt.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function _V(e,t,r){var n=Gt.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function jV(e,t,r){var n=Gt.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function OV(e,t,r){var n=Gt.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function EV(e,t,r){var n=Gt.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function PV(e,t,r){var n=fV.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function AV(e,t,r){var n=Gt.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function CV(e,t,r){var n=Gt.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function UC(e,t){return it(e.getDate(),t,2)}function NV(e,t){return it(e.getHours(),t,2)}function TV(e,t){return it(e.getHours()%12||12,t,2)}function kV(e,t){return it(1+du.count(_i(e),e),t,3)}function lD(e,t){return it(e.getMilliseconds(),t,3)}function RV(e,t){return lD(e,t)+"000"}function MV(e,t){return it(e.getMonth()+1,t,2)}function IV(e,t){return it(e.getMinutes(),t,2)}function DV(e,t){return it(e.getSeconds(),t,2)}function LV(e){var t=e.getDay();return t===0?7:t}function $V(e,t){return it(Cp.count(_i(e)-1,e),t,2)}function cD(e){var t=e.getDay();return t>=4||t===0?ys(e):ys.ceil(e)}function BV(e,t){return e=cD(e),it(ys.count(_i(e),e)+(_i(e).getDay()===4),t,2)}function FV(e){return e.getDay()}function zV(e,t){return it(wh.count(_i(e)-1,e),t,2)}function qV(e,t){return it(e.getFullYear()%100,t,2)}function UV(e,t){return e=cD(e),it(e.getFullYear()%100,t,2)}function WV(e,t){return it(e.getFullYear()%1e4,t,4)}function HV(e,t){var r=e.getDay();return e=r>=4||r===0?ys(e):ys.ceil(e),it(e.getFullYear()%1e4,t,4)}function VV(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+it(t/60|0,"0",2)+it(t%60,"0",2)}function WC(e,t){return it(e.getUTCDate(),t,2)}function GV(e,t){return it(e.getUTCHours(),t,2)}function KV(e,t){return it(e.getUTCHours()%12||12,t,2)}function XV(e,t){return it(1+Ap.count(ji(e),e),t,3)}function uD(e,t){return it(e.getUTCMilliseconds(),t,3)}function YV(e,t){return uD(e,t)+"000"}function QV(e,t){return it(e.getUTCMonth()+1,t,2)}function ZV(e,t){return it(e.getUTCMinutes(),t,2)}function JV(e,t){return it(e.getUTCSeconds(),t,2)}function eG(e){var t=e.getUTCDay();return t===0?7:t}function tG(e,t){return it(Np.count(ji(e)-1,e),t,2)}function fD(e){var t=e.getUTCDay();return t>=4||t===0?xs(e):xs.ceil(e)}function rG(e,t){return e=fD(e),it(xs.count(ji(e),e)+(ji(e).getUTCDay()===4),t,2)}function nG(e){return e.getUTCDay()}function iG(e,t){return it(Sh.count(ji(e)-1,e),t,2)}function oG(e,t){return it(e.getUTCFullYear()%100,t,2)}function aG(e,t){return e=fD(e),it(e.getUTCFullYear()%100,t,2)}function sG(e,t){return it(e.getUTCFullYear()%1e4,t,4)}function lG(e,t){var r=e.getUTCDay();return e=r>=4||r===0?xs(e):xs.ceil(e),it(e.getUTCFullYear()%1e4,t,4)}function cG(){return"+0000"}function HC(){return"%"}function VC(e){return+e}function GC(e){return Math.floor(+e/1e3)}var $a,dD,hD;uG({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function uG(e){return $a=uV(e),dD=$a.format,$a.parse,hD=$a.utcFormat,$a.utcParse,$a}function fG(e){return new Date(e)}function dG(e){return e instanceof Date?+e:+new Date(+e)}function OS(e,t,r,n,i,o,s,u,f,l){var d=fS(),p=d.invert,m=d.domain,g=l(".%L"),b=l(":%S"),y=l("%I:%M"),w=l("%I %p"),j=l("%a %d"),O=l("%b %d"),E=l("%B"),N=l("%Y");function A(C){return(f(C)t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,o)=>tH(e,o/n))},r.copy=function(){return gD(t).domain(e)},Ni.apply(r,arguments)}function kp(){var e=0,t=.5,r=1,n=1,i,o,s,u,f,l=dr,d,p=!1,m;function g(y){return isNaN(y=+y)?m:(y=.5+((y=+d(y))-o)*(n*yr}return Dx=e,Dx}var Lx,QC;function gG(){if(QC)return Lx;QC=1;var e=Rp(),t=wD(),r=Vs();function n(i){return i&&i.length?e(i,r,t):void 0}return Lx=n,Lx}var yG=gG();const Mp=ot(yG);var $x,ZC;function SD(){if(ZC)return $x;ZC=1;function e(t,r){return te.e^o.s<0?1:-1;for(n=o.d.length,i=e.d.length,t=0,r=ne.d[t]^o.s<0?1:-1;return n===i?0:n>i^o.s<0?1:-1};je.decimalPlaces=je.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*xt;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};je.dividedBy=je.div=function(e){return bi(this,new this.constructor(e))};je.dividedToIntegerBy=je.idiv=function(e){var t=this,r=t.constructor;return ft(bi(t,new r(e),0,1),r.precision)};je.equals=je.eq=function(e){return!this.cmp(e)};je.exponent=function(){return kt(this)};je.greaterThan=je.gt=function(e){return this.cmp(e)>0};je.greaterThanOrEqualTo=je.gte=function(e){return this.cmp(e)>=0};je.isInteger=je.isint=function(){return this.e>this.d.length-2};je.isNegative=je.isneg=function(){return this.s<0};je.isPositive=je.ispos=function(){return this.s>0};je.isZero=function(){return this.s===0};je.lessThan=je.lt=function(e){return this.cmp(e)<0};je.lessThanOrEqualTo=je.lte=function(e){return this.cmp(e)<1};je.logarithm=je.log=function(e){var t,r=this,n=r.constructor,i=n.precision,o=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(qr))throw Error(sn+"NaN");if(r.s<1)throw Error(sn+(r.s?"NaN":"-Infinity"));return r.eq(qr)?new n(0):(wt=!1,t=bi(Mc(r,o),Mc(e,o),o),wt=!0,ft(t,i))};je.minus=je.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?ED(t,e):jD(t,(e.s=-e.s,e))};je.modulo=je.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(sn+"NaN");return r.s?(wt=!1,t=bi(r,e,0,1).times(e),wt=!0,r.minus(t)):ft(new n(r),i)};je.naturalExponential=je.exp=function(){return OD(this)};je.naturalLogarithm=je.ln=function(){return Mc(this)};je.negated=je.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};je.plus=je.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?jD(t,e):ED(t,(e.s=-e.s,e))};je.precision=je.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Uo+e);if(t=kt(i)+1,n=i.d.length-1,r=n*xt+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};je.squareRoot=je.sqrt=function(){var e,t,r,n,i,o,s,u=this,f=u.constructor;if(u.s<1){if(!u.s)return new f(0);throw Error(sn+"NaN")}for(e=kt(u),wt=!1,i=Math.sqrt(+u),i==0||i==1/0?(t=Hn(u.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=Xs((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new f(t)):n=new f(i.toString()),r=f.precision,i=s=r+3;;)if(o=n,n=o.plus(bi(u,o,s+2)).times(.5),Hn(o.d).slice(0,s)===(t=Hn(n.d)).slice(0,s)){if(t=t.slice(s-3,s+1),i==s&&t=="4999"){if(ft(o,r+1,0),o.times(o).eq(u)){n=o;break}}else if(t!="9999")break;s+=4}return wt=!0,ft(n,r)};je.times=je.mul=function(e){var t,r,n,i,o,s,u,f,l,d=this,p=d.constructor,m=d.d,g=(e=new p(e)).d;if(!d.s||!e.s)return new p(0);for(e.s*=d.s,r=d.e+e.e,f=m.length,l=g.length,f=0;){for(t=0,i=f+n;i>n;)u=o[i]+g[n]*m[i-n-1]+t,o[i--]=u%Ht|0,t=u/Ht|0;o[i]=(o[i]+t)%Ht|0}for(;!o[--s];)o.pop();return t?++r:o.shift(),e.d=o,e.e=r,wt?ft(e,p.precision):e};je.toDecimalPlaces=je.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(Qn(e,0,Ks),t===void 0?t=n.rounding:Qn(t,0,8),ft(r,e+kt(r)+1,t))};je.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=Ko(n,!0):(Qn(e,0,Ks),t===void 0?t=i.rounding:Qn(t,0,8),n=ft(new i(n),e+1,t),r=Ko(n,!0,e+1)),r};je.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?Ko(i):(Qn(e,0,Ks),t===void 0?t=o.rounding:Qn(t,0,8),n=ft(new o(i),e+kt(i)+1,t),r=Ko(n.abs(),!1,e+kt(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};je.toInteger=je.toint=function(){var e=this,t=e.constructor;return ft(new t(e),kt(e)+1,t.rounding)};je.toNumber=function(){return+this};je.toPower=je.pow=function(e){var t,r,n,i,o,s,u=this,f=u.constructor,l=12,d=+(e=new f(e));if(!e.s)return new f(qr);if(u=new f(u),!u.s){if(e.s<1)throw Error(sn+"Infinity");return u}if(u.eq(qr))return u;if(n=f.precision,e.eq(qr))return ft(u,n);if(t=e.e,r=e.d.length-1,s=t>=r,o=u.s,s){if((r=d<0?-d:d)<=_D){for(i=new f(qr),t=Math.ceil(n/xt+4),wt=!1;r%2&&(i=i.times(u),iN(i.d,t)),r=Xs(r/2),r!==0;)u=u.times(u),iN(u.d,t);return wt=!0,e.s<0?new f(qr).div(i):ft(i,n)}}else if(o<0)throw Error(sn+"NaN");return o=o<0&&e.d[Math.max(t,r)]&1?-1:1,u.s=1,wt=!1,i=e.times(Mc(u,n+l)),wt=!0,i=OD(i),i.s=o,i};je.toPrecision=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?(r=kt(i),n=Ko(i,r<=o.toExpNeg||r>=o.toExpPos)):(Qn(e,1,Ks),t===void 0?t=o.rounding:Qn(t,0,8),i=ft(new o(i),e,t),r=kt(i),n=Ko(i,e<=r||r<=o.toExpNeg,e)),n};je.toSignificantDigits=je.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(Qn(e,1,Ks),t===void 0?t=n.rounding:Qn(t,0,8)),ft(new n(r),e,t)};je.toString=je.valueOf=je.val=je.toJSON=je[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=kt(e),r=e.constructor;return Ko(e,t<=r.toExpNeg||t>=r.toExpPos)};function jD(e,t){var r,n,i,o,s,u,f,l,d=e.constructor,p=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),wt?ft(t,p):t;if(f=e.d,l=t.d,s=e.e,i=t.e,f=f.slice(),o=s-i,o){for(o<0?(n=f,o=-o,u=l.length):(n=l,i=s,u=f.length),s=Math.ceil(p/xt),u=s>u?s+1:u+1,o>u&&(o=u,n.length=1),n.reverse();o--;)n.push(0);n.reverse()}for(u=f.length,o=l.length,u-o<0&&(o=u,n=l,l=f,f=n),r=0;o;)r=(f[--o]=f[o]+l[o]+r)/Ht|0,f[o]%=Ht;for(r&&(f.unshift(r),++i),u=f.length;f[--u]==0;)f.pop();return t.d=f,t.e=i,wt?ft(t,p):t}function Qn(e,t,r){if(e!==~~e||er)throw Error(Uo+e)}function Hn(e){var t,r,n,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;ts?1:-1;else for(u=f=0;ui[u]?1:-1;break}return f}function r(n,i,o){for(var s=0;o--;)n[o]-=s,s=n[o]1;)n.shift()}return function(n,i,o,s){var u,f,l,d,p,m,g,b,y,w,j,O,E,N,A,C,T,R,I=n.constructor,z=n.s==i.s?1:-1,$=n.d,L=i.d;if(!n.s)return new I(n);if(!i.s)throw Error(sn+"Division by zero");for(f=n.e-i.e,T=L.length,A=$.length,g=new I(z),b=g.d=[],l=0;L[l]==($[l]||0);)++l;if(L[l]>($[l]||0)&&--f,o==null?O=o=I.precision:s?O=o+(kt(n)-kt(i))+1:O=o,O<0)return new I(0);if(O=O/xt+2|0,l=0,T==1)for(d=0,L=L[0],O++;(l1&&(L=e(L,d),$=e($,d),T=L.length,A=$.length),N=T,y=$.slice(0,T),w=y.length;w=Ht/2&&++C;do d=0,u=t(L,y,T,w),u<0?(j=y[0],T!=w&&(j=j*Ht+(y[1]||0)),d=j/C|0,d>1?(d>=Ht&&(d=Ht-1),p=e(L,d),m=p.length,w=y.length,u=t(p,y,m,w),u==1&&(d--,r(p,T16)throw Error(AS+kt(e));if(!e.s)return new d(qr);for(wt=!1,u=p,s=new d(.03125);e.abs().gte(.1);)e=e.times(s),l+=5;for(n=Math.log(Do(2,l))/Math.LN10*2+5|0,u+=n,r=i=o=new d(qr),d.precision=u;;){if(i=ft(i.times(e),u),r=r.times(++f),s=o.plus(bi(i,r,u)),Hn(s.d).slice(0,u)===Hn(o.d).slice(0,u)){for(;l--;)o=ft(o.times(o),u);return d.precision=p,t==null?(wt=!0,ft(o,p)):o}o=s}}function kt(e){for(var t=e.e*xt,r=e.d[0];r>=10;r/=10)t++;return t}function Ux(e,t,r){if(t>e.LN10.sd())throw wt=!0,r&&(e.precision=r),Error(sn+"LN10 precision limit exceeded");return ft(new e(e.LN10),t)}function eo(e){for(var t="";e--;)t+="0";return t}function Mc(e,t){var r,n,i,o,s,u,f,l,d,p=1,m=10,g=e,b=g.d,y=g.constructor,w=y.precision;if(g.s<1)throw Error(sn+(g.s?"NaN":"-Infinity"));if(g.eq(qr))return new y(0);if(t==null?(wt=!1,l=w):l=t,g.eq(10))return t==null&&(wt=!0),Ux(y,l);if(l+=m,y.precision=l,r=Hn(b),n=r.charAt(0),o=kt(g),Math.abs(o)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)g=g.times(e),r=Hn(g.d),n=r.charAt(0),p++;o=kt(g),n>1?(g=new y("0."+r),o++):g=new y(n+"."+r.slice(1))}else return f=Ux(y,l+2,w).times(o+""),g=Mc(new y(n+"."+r.slice(1)),l-m).plus(f),y.precision=w,t==null?(wt=!0,ft(g,w)):g;for(u=s=g=bi(g.minus(qr),g.plus(qr),l),d=ft(g.times(g),l),i=3;;){if(s=ft(s.times(d),l),f=u.plus(bi(s,new y(i),l)),Hn(f.d).slice(0,l)===Hn(u.d).slice(0,l))return u=u.times(2),o!==0&&(u=u.plus(Ux(y,l+2,w).times(o+""))),u=bi(u,new y(p),l),y.precision=w,t==null?(wt=!0,ft(u,w)):u;u=f,i+=2}}function nN(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=Xs(r/xt),e.d=[],n=(r+1)%xt,r<0&&(n+=xt),n_h||e.e<-_h))throw Error(AS+r)}else e.s=0,e.e=0,e.d=[0];return e}function ft(e,t,r){var n,i,o,s,u,f,l,d,p=e.d;for(s=1,o=p[0];o>=10;o/=10)s++;if(n=t-s,n<0)n+=xt,i=t,l=p[d=0];else{if(d=Math.ceil((n+1)/xt),o=p.length,d>=o)return e;for(l=o=p[d],s=1;o>=10;o/=10)s++;n%=xt,i=n-xt+s}if(r!==void 0&&(o=Do(10,s-i-1),u=l/o%10|0,f=t<0||p[d+1]!==void 0||l%o,f=r<4?(u||f)&&(r==0||r==(e.s<0?3:2)):u>5||u==5&&(r==4||f||r==6&&(n>0?i>0?l/Do(10,s-i):0:p[d-1])%10&1||r==(e.s<0?8:7))),t<1||!p[0])return f?(o=kt(e),p.length=1,t=t-o-1,p[0]=Do(10,(xt-t%xt)%xt),e.e=Xs(-t/xt)||0):(p.length=1,p[0]=e.e=e.s=0),e;if(n==0?(p.length=d,o=1,d--):(p.length=d+1,o=Do(10,xt-n),p[d]=i>0?(l/Do(10,s-i)%Do(10,i)|0)*o:0),f)for(;;)if(d==0){(p[0]+=o)==Ht&&(p[0]=1,++e.e);break}else{if(p[d]+=o,p[d]!=Ht)break;p[d--]=0,o=1}for(n=p.length;p[--n]===0;)p.pop();if(wt&&(e.e>_h||e.e<-_h))throw Error(AS+kt(e));return e}function ED(e,t){var r,n,i,o,s,u,f,l,d,p,m=e.constructor,g=m.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new m(e),wt?ft(t,g):t;if(f=e.d,p=t.d,n=t.e,l=e.e,f=f.slice(),s=l-n,s){for(d=s<0,d?(r=f,s=-s,u=p.length):(r=p,n=l,u=f.length),i=Math.max(Math.ceil(g/xt),u)+2,s>i&&(s=i,r.length=1),r.reverse(),i=s;i--;)r.push(0);r.reverse()}else{for(i=f.length,u=p.length,d=i0;--i)f[u++]=0;for(i=p.length;i>s;){if(f[--i]0?o=o.charAt(0)+"."+o.slice(1)+eo(n):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i<0?"e":"e+")+i):i<0?(o="0."+eo(-i-1)+o,r&&(n=r-s)>0&&(o+=eo(n))):i>=s?(o+=eo(i+1-s),r&&(n=r-i-1)>0&&(o=o+"."+eo(n))):((n=i+1)0&&(i+1===s&&(o+="."),o+=eo(n))),e.s<0?"-"+o:o}function iN(e,t){if(e.length>t)return e.length=t,!0}function PD(e){var t,r,n;function i(o){var s=this;if(!(s instanceof i))return new i(o);if(s.constructor=i,o instanceof i){s.s=o.s,s.e=o.e,s.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(Uo+o);if(o>0)s.s=1;else if(o<0)o=-o,s.s=-1;else{s.s=0,s.e=0,s.d=[0];return}if(o===~~o&&o<1e7){s.e=0,s.d=[o];return}return nN(s,o.toString())}else if(typeof o!="string")throw Error(Uo+o);if(o.charCodeAt(0)===45?(o=o.slice(1),s.s=-1):s.s=1,AG.test(o))nN(s,o);else throw Error(Uo+o)}if(i.prototype=je,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=PD,i.config=i.set=CG,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(Uo+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Uo+r+": "+n);return this}var CS=PD(PG);qr=new CS(1);const ut=CS;function NG(e){return MG(e)||RG(e)||kG(e)||TG()}function TG(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kG(e,t){if(e){if(typeof e=="string")return v1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return v1(e,t)}}function RG(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function MG(e){if(Array.isArray(e))return v1(e)}function v1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t?r.apply(void 0,i):e(t-s,oN(function(){for(var u=arguments.length,f=new Array(u),l=0;le.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,i=!1,o=void 0;try{for(var s=e[Symbol.iterator](),u;!(n=(u=s.next()).done)&&(r.push(u.value),!(t&&r.length===t));n=!0);}catch(f){i=!0,o=f}finally{try{!n&&s.return!=null&&s.return()}finally{if(i)throw o}}return r}}function XG(e){if(Array.isArray(e))return e}function kD(e){var t=Ic(e,2),r=t[0],n=t[1],i=r,o=n;return r>n&&(i=n,o=r),[i,o]}function RD(e,t,r){if(e.lte(0))return new ut(0);var n=Lp.getDigitCount(e.toNumber()),i=new ut(10).pow(n),o=e.div(i),s=n!==1?.05:.1,u=new ut(Math.ceil(o.div(s).toNumber())).add(r).mul(s),f=u.mul(i);return t?f:new ut(Math.ceil(f))}function YG(e,t,r){var n=1,i=new ut(e);if(!i.isint()&&r){var o=Math.abs(e);o<1?(n=new ut(10).pow(Lp.getDigitCount(e)-1),i=new ut(Math.floor(i.div(n).toNumber())).mul(n)):o>1&&(i=new ut(Math.floor(e)))}else e===0?i=new ut(Math.floor((t-1)/2)):r||(i=new ut(Math.floor(e)));var s=Math.floor((t-1)/2),u=$G(LG(function(f){return i.add(new ut(f-s).mul(n)).toNumber()}),g1);return u(0,t)}function MD(e,t,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new ut(0),tickMin:new ut(0),tickMax:new ut(0)};var o=RD(new ut(t).sub(e).div(r-1),n,i),s;e<=0&&t>=0?s=new ut(0):(s=new ut(e).add(t).div(2),s=s.sub(new ut(s).mod(o)));var u=Math.ceil(s.sub(e).div(o).toNumber()),f=Math.ceil(new ut(t).sub(s).div(o).toNumber()),l=u+f+1;return l>r?MD(e,t,r,n,i+1):(l0?f+(r-l):f,u=t>0?u:u+(r-l)),{step:o,tickMin:s.sub(new ut(u).mul(o)),tickMax:s.add(new ut(f).mul(o))})}function QG(e){var t=Ic(e,2),r=t[0],n=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=Math.max(i,2),u=kD([r,n]),f=Ic(u,2),l=f[0],d=f[1];if(l===-1/0||d===1/0){var p=d===1/0?[l].concat(x1(g1(0,i-1).map(function(){return 1/0}))):[].concat(x1(g1(0,i-1).map(function(){return-1/0})),[d]);return r>n?y1(p):p}if(l===d)return YG(l,i,o);var m=MD(l,d,s,o),g=m.step,b=m.tickMin,y=m.tickMax,w=Lp.rangeStep(b,y.add(new ut(.1).mul(g)),g);return r>n?y1(w):w}function ZG(e,t){var r=Ic(e,2),n=r[0],i=r[1],o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=kD([n,i]),u=Ic(s,2),f=u[0],l=u[1];if(f===-1/0||l===1/0)return[n,i];if(f===l)return[f];var d=Math.max(t,2),p=RD(new ut(l).sub(f).div(d-1),o,0),m=[].concat(x1(Lp.rangeStep(new ut(f),new ut(l).sub(new ut(.99).mul(p)),p)),[l]);return n>i?y1(m):m}var JG=ND(QG),eK=ND(ZG),tK="Invariant failed";function Xo(e,t){throw new Error(tK)}var rK=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function bs(e){"@babel/helpers - typeof";return bs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bs(e)}function jh(){return jh=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function cK(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function uK(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fK(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,s=-1,u=(r=n?.length)!==null&&r!==void 0?r:0;if(u<=1)return 0;if(o&&o.axisType==="angleAxis"&&Math.abs(Math.abs(o.range[1]-o.range[0])-360)<=1e-6)for(var f=o.range,l=0;l0?i[l-1].coordinate:i[u-1].coordinate,p=i[l].coordinate,m=l>=u-1?i[0].coordinate:i[l+1].coordinate,g=void 0;if(ur(p-d)!==ur(m-p)){var b=[];if(ur(m-p)===ur(f[1]-f[0])){g=m;var y=p+f[1]-f[0];b[0]=Math.min(y,(y+d)/2),b[1]=Math.max(y,(y+d)/2)}else{g=d;var w=m+f[1]-f[0];b[0]=Math.min(p,(w+p)/2),b[1]=Math.max(p,(w+p)/2)}var j=[Math.min(p,(g+p)/2),Math.max(p,(g+p)/2)];if(t>j[0]&&t<=j[1]||t>=b[0]&&t<=b[1]){s=i[l].index;break}}else{var O=Math.min(d,m),E=Math.max(d,m);if(t>(O+p)/2&&t<=(E+p)/2){s=i[l].index;break}}}else for(var N=0;N0&&N(n[N].coordinate+n[N-1].coordinate)/2&&t<=(n[N].coordinate+n[N+1].coordinate)/2||N===u-1&&t>(n[N].coordinate+n[N-1].coordinate)/2){s=n[N].index;break}return s},NS=function(t){var r,n=t,i=n.type.displayName,o=(r=t.type)!==null&&r!==void 0&&r.defaultProps?Pt(Pt({},t.type.defaultProps),t.props):t.props,s=o.stroke,u=o.fill,f;switch(i){case"Line":f=s;break;case"Area":case"Radar":f=s&&s!=="none"?s:u;break;default:f=u;break}return f},AK=function(t){var r=t.barSize,n=t.totalSize,i=t.stackGroups,o=i===void 0?{}:i;if(!o)return{};for(var s={},u=Object.keys(o),f=0,l=u.length;f=0});if(j&&j.length){var O=j[0].type.defaultProps,E=O!==void 0?Pt(Pt({},O),j[0].props):j[0].props,N=E.barSize,A=E[w];s[A]||(s[A]=[]);var C=Ue(N)?r:N;s[A].push({item:j[0],stackList:j.slice(1),barSize:Ue(C)?void 0:fr(C,n,0)})}}return s},CK=function(t){var r=t.barGap,n=t.barCategoryGap,i=t.bandSize,o=t.sizeList,s=o===void 0?[]:o,u=t.maxBarSize,f=s.length;if(f<1)return null;var l=fr(r,i,0,!0),d,p=[];if(s[0].barSize===+s[0].barSize){var m=!1,g=i/f,b=s.reduce(function(N,A){return N+A.barSize||0},0);b+=(f-1)*l,b>=i&&(b-=(f-1)*l,l=0),b>=i&&g>0&&(m=!0,g*=.9,b=f*g);var y=(i-b)/2>>0,w={offset:y-l,size:0};d=s.reduce(function(N,A){var C={item:A.item,position:{offset:w.offset+w.size+l,size:m?g:A.barSize}},T=[].concat(lN(N),[C]);return w=T[T.length-1].position,A.stackList&&A.stackList.length&&A.stackList.forEach(function(R){T.push({item:R,position:w})}),T},p)}else{var j=fr(n,i,0,!0);i-2*j-(f-1)*l<=0&&(l=0);var O=(i-2*j-(f-1)*l)/f;O>1&&(O>>=0);var E=u===+u?Math.min(O,u):O;d=s.reduce(function(N,A,C){var T=[].concat(lN(N),[{item:A.item,position:{offset:j+(O+l)*C+(O-E)/2,size:E}}]);return A.stackList&&A.stackList.length&&A.stackList.forEach(function(R){T.push({item:R,position:T[T.length-1].position})}),T},p)}return d},NK=function(t,r,n,i){var o=n.children,s=n.width,u=n.margin,f=s-(u.left||0)-(u.right||0),l=$D({children:o,legendWidth:f});if(l){var d=i||{},p=d.width,m=d.height,g=l.align,b=l.verticalAlign,y=l.layout;if((y==="vertical"||y==="horizontal"&&b==="middle")&&g!=="center"&&ge(t[g]))return Pt(Pt({},t),{},is({},g,t[g]+(p||0)));if((y==="horizontal"||y==="vertical"&&g==="center")&&b!=="middle"&&ge(t[b]))return Pt(Pt({},t),{},is({},b,t[b]+(m||0)))}return t},TK=function(t,r,n){return Ue(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},BD=function(t,r,n,i,o){var s=r.props.children,u=Wr(s,pu).filter(function(l){return TK(i,o,l.props.direction)});if(u&&u.length){var f=u.map(function(l){return l.props.dataKey});return t.reduce(function(l,d){var p=Bt(d,n);if(Ue(p))return l;var m=Array.isArray(p)?[Ip(p),Mp(p)]:[p,p],g=f.reduce(function(b,y){var w=Bt(d,y,0),j=m[0]-Math.abs(Array.isArray(w)?w[0]:w),O=m[1]+Math.abs(Array.isArray(w)?w[1]:w);return[Math.min(j,b[0]),Math.max(O,b[1])]},[1/0,-1/0]);return[Math.min(g[0],l[0]),Math.max(g[1],l[1])]},[1/0,-1/0])}return null},kK=function(t,r,n,i,o){var s=r.map(function(u){return BD(t,u,n,o,i)}).filter(function(u){return!Ue(u)});return s&&s.length?s.reduce(function(u,f){return[Math.min(u[0],f[0]),Math.max(u[1],f[1])]},[1/0,-1/0]):null},FD=function(t,r,n,i,o){var s=r.map(function(f){var l=f.props.dataKey;return n==="number"&&l&&BD(t,f,l,i)||hc(t,l,n,o)});if(n==="number")return s.reduce(function(f,l){return[Math.min(f[0],l[0]),Math.max(f[1],l[1])]},[1/0,-1/0]);var u={};return s.reduce(function(f,l){for(var d=0,p=l.length;d=2?ur(u[0]-u[1])*2*l:l,r&&(t.ticks||t.niceTicks)){var d=(t.ticks||t.niceTicks).map(function(p){var m=o?o.indexOf(p):p;return{coordinate:i(m)+l,value:p,offset:l}});return d.filter(function(p){return!su(p.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(p,m){return{coordinate:i(p)+l,value:p,index:m,offset:l}}):i.ticks&&!n?i.ticks(t.tickCount).map(function(p){return{coordinate:i(p)+l,value:p,offset:l}}):i.domain().map(function(p,m){return{coordinate:i(p)+l,value:o?o[p]:p,index:m,offset:l}})},Wx=new WeakMap,Vf=function(t,r){if(typeof r!="function")return t;Wx.has(t)||Wx.set(t,new WeakMap);var n=Wx.get(t);if(n.has(r))return n.get(r);var i=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,i),i},UD=function(t,r,n){var i=t.scale,o=t.type,s=t.layout,u=t.axisType;if(i==="auto")return s==="radial"&&u==="radiusAxis"?{scale:Cc(),realScaleType:"band"}:s==="radial"&&u==="angleAxis"?{scale:xh(),realScaleType:"linear"}:o==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:dc(),realScaleType:"point"}:o==="category"?{scale:Cc(),realScaleType:"band"}:{scale:xh(),realScaleType:"linear"};if(Ho(i)){var f="scale".concat(xp(i));return{scale:(KC[f]||dc)(),realScaleType:KC[f]?f:"point"}}return ze(i)?{scale:i}:{scale:dc(),realScaleType:"point"}},uN=1e-4,WD=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,i=t.range(),o=Math.min(i[0],i[1])-uN,s=Math.max(i[0],i[1])+uN,u=t(r[0]),f=t(r[n-1]);(us||fs)&&t.domain([r[0],r[n-1]])}},RK=function(t,r){if(!t)return null;for(var n=0,i=t.length;ni)&&(o[1]=i),o[0]>i&&(o[0]=i),o[1]=0?(t[u][n][0]=o,t[u][n][1]=o+f,o=t[u][n][1]):(t[u][n][0]=s,t[u][n][1]=s+f,s=t[u][n][1])}},DK=function(t){var r=t.length;if(!(r<=0))for(var n=0,i=t[0].length;n=0?(t[s][n][0]=o,t[s][n][1]=o+u,o=t[s][n][1]):(t[s][n][0]=0,t[s][n][1]=0)}},LK={sign:IK,expand:j9,none:ds,silhouette:O9,wiggle:E9,positive:DK},$K=function(t,r,n){var i=r.map(function(u){return u.props.dataKey}),o=LK[n],s=_9().keys(i).value(function(u,f){return+Bt(u,f,0)}).order(Zb).offset(o);return s(t)},BK=function(t,r,n,i,o,s){if(!t)return null;var u=s?r.reverse():r,f={},l=u.reduce(function(p,m){var g,b=(g=m.type)!==null&&g!==void 0&&g.defaultProps?Pt(Pt({},m.type.defaultProps),m.props):m.props,y=b.stackId,w=b.hide;if(w)return p;var j=b[n],O=p[j]||{hasStack:!1,stackGroups:{}};if(Ft(y)){var E=O.stackGroups[y]||{numericAxisId:n,cateAxisId:i,items:[]};E.items.push(m),O.hasStack=!0,O.stackGroups[y]=E}else O.stackGroups[Hs("_stackId_")]={numericAxisId:n,cateAxisId:i,items:[m]};return Pt(Pt({},p),{},is({},j,O))},f),d={};return Object.keys(l).reduce(function(p,m){var g=l[m];if(g.hasStack){var b={};g.stackGroups=Object.keys(g.stackGroups).reduce(function(y,w){var j=g.stackGroups[w];return Pt(Pt({},y),{},is({},w,{numericAxisId:n,cateAxisId:i,items:j.items,stackedData:$K(t,j.items,o)}))},b)}return Pt(Pt({},p),{},is({},m,g))},d)},HD=function(t,r){var n=r.realScaleType,i=r.type,o=r.tickCount,s=r.originalDomain,u=r.allowDecimals,f=n||r.scale;if(f!=="auto"&&f!=="linear")return null;if(o&&i==="number"&&s&&(s[0]==="auto"||s[1]==="auto")){var l=t.domain();if(!l.length)return null;var d=JG(l,o,u);return t.domain([Ip(d),Mp(d)]),{niceTicks:d}}if(o&&i==="number"){var p=t.domain(),m=eK(p,o,u);return{niceTicks:m}}return null};function fN(e){var t=e.axis,r=e.ticks,n=e.bandSize,i=e.entry,o=e.index,s=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Ue(i[t.dataKey])){var u=Jd(r,"value",i[t.dataKey]);if(u)return u.coordinate+n/2}return r[o]?r[o].coordinate+n/2:null}var f=Bt(i,Ue(s)?t.dataKey:s);return Ue(f)?null:t.scale(f)}var dN=function(t){var r=t.axis,n=t.ticks,i=t.offset,o=t.bandSize,s=t.entry,u=t.index;if(r.type==="category")return n[u]?n[u].coordinate+i:null;var f=Bt(s,r.dataKey,r.domain[u]);return Ue(f)?null:r.scale(f)-o/2+i},FK=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var i=Math.min(n[0],n[1]),o=Math.max(n[0],n[1]);return i<=0&&o>=0?0:o<0?o:i}return n[0]},zK=function(t,r){var n,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?Pt(Pt({},t.type.defaultProps),t.props):t.props,o=i.stackId;if(Ft(o)){var s=r[o];if(s){var u=s.items.indexOf(t);return u>=0?s.stackedData[u]:null}}return null},qK=function(t){return t.reduce(function(r,n){return[Ip(n.concat([r[0]]).filter(ge)),Mp(n.concat([r[1]]).filter(ge))]},[1/0,-1/0])},VD=function(t,r,n){return Object.keys(t).reduce(function(i,o){var s=t[o],u=s.stackedData,f=u.reduce(function(l,d){var p=qK(d.slice(r,n+1));return[Math.min(l[0],p[0]),Math.max(l[1],p[1])]},[1/0,-1/0]);return[Math.min(f[0],i[0]),Math.max(f[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},hN=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,pN=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,_1=function(t,r,n){if(ze(t))return t(r,n);if(!Array.isArray(t))return r;var i=[];if(ge(t[0]))i[0]=n?t[0]:Math.min(t[0],r[0]);else if(hN.test(t[0])){var o=+hN.exec(t[0])[1];i[0]=r[0]-o}else ze(t[0])?i[0]=t[0](r[0]):i[0]=r[0];if(ge(t[1]))i[1]=n?t[1]:Math.max(t[1],r[1]);else if(pN.test(t[1])){var s=+pN.exec(t[1])[1];i[1]=r[1]+s}else ze(t[1])?i[1]=t[1](r[1]):i[1]=r[1];return i},Eh=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var i=t.scale.bandwidth();if(!n||i>0)return i}if(t&&r&&r.length>=2){for(var o=iS(r,function(p){return p.coordinate}),s=1/0,u=1,f=o.length;ue.length)&&(t=e.length);for(var r=0,n=new Array(t);r2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},QK=function(t,r,n,i,o){var s=t.width,u=t.height,f=t.startAngle,l=t.endAngle,d=fr(t.cx,s,s/2),p=fr(t.cy,u,u/2),m=XD(s,u,n),g=fr(t.innerRadius,m,0),b=fr(t.outerRadius,m,m*.8),y=Object.keys(r);return y.reduce(function(w,j){var O=r[j],E=O.domain,N=O.reversed,A;if(Ue(O.range))i==="angleAxis"?A=[f,l]:i==="radiusAxis"&&(A=[g,b]),N&&(A=[A[1],A[0]]);else{A=O.range;var C=A,T=HK(C,2);f=T[0],l=T[1]}var R=UD(O,o),I=R.realScaleType,z=R.scale;z.domain(E).range(A),WD(z);var $=HD(z,mi(mi({},O),{},{realScaleType:I})),L=mi(mi(mi({},O),$),{},{range:A,radius:b,realScaleType:I,scale:z,cx:d,cy:p,innerRadius:g,outerRadius:b,startAngle:f,endAngle:l});return mi(mi({},w),{},KD({},j,L))},{})},ZK=function(t,r){var n=t.x,i=t.y,o=r.x,s=r.y;return Math.sqrt(Math.pow(n-o,2)+Math.pow(i-s,2))},JK=function(t,r){var n=t.x,i=t.y,o=r.cx,s=r.cy,u=ZK({x:n,y:i},{x:o,y:s});if(u<=0)return{radius:u};var f=(n-o)/u,l=Math.acos(f);return i>s&&(l=2*Math.PI-l),{radius:u,angle:YK(l),angleInRadian:l}},eX=function(t){var r=t.startAngle,n=t.endAngle,i=Math.floor(r/360),o=Math.floor(n/360),s=Math.min(i,o);return{startAngle:r-s*360,endAngle:n-s*360}},tX=function(t,r){var n=r.startAngle,i=r.endAngle,o=Math.floor(n/360),s=Math.floor(i/360),u=Math.min(o,s);return t+u*360},yN=function(t,r){var n=t.x,i=t.y,o=JK({x:n,y:i},r),s=o.radius,u=o.angle,f=r.innerRadius,l=r.outerRadius;if(sl)return!1;if(s===0)return!0;var d=eX(r),p=d.startAngle,m=d.endAngle,g=u,b;if(p<=m){for(;g>m;)g-=360;for(;g=p&&g<=m}else{for(;g>p;)g-=360;for(;g=m&&g<=p}return b?mi(mi({},r),{},{radius:s,angle:tX(g,r)}):null},YD=function(t){return!_.isValidElement(t)&&!ze(t)&&typeof t!="boolean"?t.className:""};function Bc(e){"@babel/helpers - typeof";return Bc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bc(e)}var rX=["offset"];function nX(e){return sX(e)||aX(e)||oX(e)||iX()}function iX(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function oX(e,t){if(e){if(typeof e=="string")return j1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return j1(e,t)}}function aX(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function sX(e){if(Array.isArray(e))return j1(e)}function j1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function cX(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function xN(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function $t(e){for(var t=1;t=0?1:-1,E,N;i==="insideStart"?(E=g+O*s,N=y):i==="insideEnd"?(E=b-O*s,N=!y):i==="end"&&(E=b+O*s,N=y),N=j<=0?N:!N;var A=mt(l,d,w,E),C=mt(l,d,w,E+(N?1:-1)*359),T="M".concat(A.x,",").concat(A.y,` - A`).concat(w,",").concat(w,",0,1,").concat(N?0:1,`, - `).concat(C.x,",").concat(C.y),R=Ue(t.id)?Hs("recharts-radial-line-"):t.id;return F.createElement("text",Fc({},n,{dominantBaseline:"central",className:We("recharts-radial-bar-label",u)}),F.createElement("defs",null,F.createElement("path",{id:R,d:T})),F.createElement("textPath",{xlinkHref:"#".concat(R)},r))},vX=function(t){var r=t.viewBox,n=t.offset,i=t.position,o=r,s=o.cx,u=o.cy,f=o.innerRadius,l=o.outerRadius,d=o.startAngle,p=o.endAngle,m=(d+p)/2;if(i==="outside"){var g=mt(s,u,l+n,m),b=g.x,y=g.y;return{x:b,y,textAnchor:b>=s?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:s,y:u,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:s,y:u,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:s,y:u,textAnchor:"middle",verticalAnchor:"end"};var w=(f+l)/2,j=mt(s,u,w,m),O=j.x,E=j.y;return{x:O,y:E,textAnchor:"middle",verticalAnchor:"middle"}},gX=function(t){var r=t.viewBox,n=t.parentViewBox,i=t.offset,o=t.position,s=r,u=s.x,f=s.y,l=s.width,d=s.height,p=d>=0?1:-1,m=p*i,g=p>0?"end":"start",b=p>0?"start":"end",y=l>=0?1:-1,w=y*i,j=y>0?"end":"start",O=y>0?"start":"end";if(o==="top"){var E={x:u+l/2,y:f-p*i,textAnchor:"middle",verticalAnchor:g};return $t($t({},E),n?{height:Math.max(f-n.y,0),width:l}:{})}if(o==="bottom"){var N={x:u+l/2,y:f+d+m,textAnchor:"middle",verticalAnchor:b};return $t($t({},N),n?{height:Math.max(n.y+n.height-(f+d),0),width:l}:{})}if(o==="left"){var A={x:u-w,y:f+d/2,textAnchor:j,verticalAnchor:"middle"};return $t($t({},A),n?{width:Math.max(A.x-n.x,0),height:d}:{})}if(o==="right"){var C={x:u+l+w,y:f+d/2,textAnchor:O,verticalAnchor:"middle"};return $t($t({},C),n?{width:Math.max(n.x+n.width-C.x,0),height:d}:{})}var T=n?{width:l,height:d}:{};return o==="insideLeft"?$t({x:u+w,y:f+d/2,textAnchor:O,verticalAnchor:"middle"},T):o==="insideRight"?$t({x:u+l-w,y:f+d/2,textAnchor:j,verticalAnchor:"middle"},T):o==="insideTop"?$t({x:u+l/2,y:f+m,textAnchor:"middle",verticalAnchor:b},T):o==="insideBottom"?$t({x:u+l/2,y:f+d-m,textAnchor:"middle",verticalAnchor:g},T):o==="insideTopLeft"?$t({x:u+w,y:f+m,textAnchor:O,verticalAnchor:b},T):o==="insideTopRight"?$t({x:u+l-w,y:f+m,textAnchor:j,verticalAnchor:b},T):o==="insideBottomLeft"?$t({x:u+w,y:f+d-m,textAnchor:O,verticalAnchor:g},T):o==="insideBottomRight"?$t({x:u+l-w,y:f+d-m,textAnchor:j,verticalAnchor:g},T):Ws(o)&&(ge(o.x)||$o(o.x))&&(ge(o.y)||$o(o.y))?$t({x:u+fr(o.x,l),y:f+fr(o.y,d),textAnchor:"end",verticalAnchor:"end"},T):$t({x:u+l/2,y:f+d/2,textAnchor:"middle",verticalAnchor:"middle"},T)},yX=function(t){return"cx"in t&&ge(t.cx)};function Vt(e){var t=e.offset,r=t===void 0?5:t,n=lX(e,rX),i=$t({offset:r},n),o=i.viewBox,s=i.position,u=i.value,f=i.children,l=i.content,d=i.className,p=d===void 0?"":d,m=i.textBreakAll;if(!o||Ue(u)&&Ue(f)&&!_.isValidElement(l)&&!ze(l))return null;if(_.isValidElement(l))return _.cloneElement(l,i);var g;if(ze(l)){if(g=_.createElement(l,i),_.isValidElement(g))return g}else g=hX(i);var b=yX(o),y=Le(i,!0);if(b&&(s==="insideStart"||s==="insideEnd"||s==="end"))return mX(i,g,y);var w=b?vX(i):gX(i);return F.createElement(Go,Fc({className:We("recharts-label",p)},y,w,{breakAll:m}),g)}Vt.displayName="Label";var QD=function(t){var r=t.cx,n=t.cy,i=t.angle,o=t.startAngle,s=t.endAngle,u=t.r,f=t.radius,l=t.innerRadius,d=t.outerRadius,p=t.x,m=t.y,g=t.top,b=t.left,y=t.width,w=t.height,j=t.clockWise,O=t.labelViewBox;if(O)return O;if(ge(y)&&ge(w)){if(ge(p)&&ge(m))return{x:p,y:m,width:y,height:w};if(ge(g)&&ge(b))return{x:g,y:b,width:y,height:w}}return ge(p)&&ge(m)?{x:p,y:m,width:0,height:0}:ge(r)&&ge(n)?{cx:r,cy:n,startAngle:o||i||0,endAngle:s||i||0,innerRadius:l||0,outerRadius:d||f||u||0,clockWise:j}:t.viewBox?t.viewBox:{}},xX=function(t,r){return t?t===!0?F.createElement(Vt,{key:"label-implicit",viewBox:r}):Ft(t)?F.createElement(Vt,{key:"label-implicit",viewBox:r,value:t}):_.isValidElement(t)?t.type===Vt?_.cloneElement(t,{key:"label-implicit",viewBox:r}):F.createElement(Vt,{key:"label-implicit",content:t,viewBox:r}):ze(t)?F.createElement(Vt,{key:"label-implicit",content:t,viewBox:r}):Ws(t)?F.createElement(Vt,Fc({viewBox:r},t,{key:"label-implicit"})):null:null},bX=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var i=t.children,o=QD(t),s=Wr(i,Vt).map(function(f,l){return _.cloneElement(f,{viewBox:r||o,key:"label-".concat(l)})});if(!n)return s;var u=xX(t.label,r||o);return[u].concat(nX(s))};Vt.parseViewBox=QD;Vt.renderCallByParent=bX;var Hx,bN;function wX(){if(bN)return Hx;bN=1;function e(t){var r=t==null?0:t.length;return r?t[r-1]:void 0}return Hx=e,Hx}var SX=wX();const _X=ot(SX);function zc(e){"@babel/helpers - typeof";return zc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zc(e)}var jX=["valueAccessor"],OX=["data","dataKey","clockWise","id","textBreakAll"];function EX(e){return NX(e)||CX(e)||AX(e)||PX()}function PX(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function AX(e,t){if(e){if(typeof e=="string")return O1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return O1(e,t)}}function CX(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function NX(e){if(Array.isArray(e))return O1(e)}function O1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function MX(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var IX=function(t){return Array.isArray(t.value)?_X(t.value):t.value};function wi(e){var t=e.valueAccessor,r=t===void 0?IX:t,n=_N(e,jX),i=n.data,o=n.dataKey,s=n.clockWise,u=n.id,f=n.textBreakAll,l=_N(n,OX);return!i||!i.length?null:F.createElement(rt,{className:"recharts-label-list"},i.map(function(d,p){var m=Ue(o)?r(d,p):Bt(d&&d.payload,o),g=Ue(u)?{}:{id:"".concat(u,"-").concat(p)};return F.createElement(Vt,Ah({},Le(d,!0),l,g,{parentViewBox:d.parentViewBox,value:m,textBreakAll:f,viewBox:Vt.parseViewBox(Ue(s)?d:SN(SN({},d),{},{clockWise:s})),key:"label-".concat(p),index:p}))}))}wi.displayName="LabelList";function DX(e,t){return e?e===!0?F.createElement(wi,{key:"labelList-implicit",data:t}):F.isValidElement(e)||ze(e)?F.createElement(wi,{key:"labelList-implicit",data:t,content:e}):Ws(e)?F.createElement(wi,Ah({data:t},e,{key:"labelList-implicit"})):null:null}function LX(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var n=e.children,i=Wr(n,wi).map(function(s,u){return _.cloneElement(s,{data:t,key:"labelList-".concat(u)})});if(!r)return i;var o=DX(e.label,t);return[o].concat(EX(i))}wi.renderCallByParent=LX;function qc(e){"@babel/helpers - typeof";return qc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qc(e)}function E1(){return E1=Object.assign?Object.assign.bind():function(e){for(var t=1;t180),",").concat(+(s>l),`, - `).concat(p.x,",").concat(p.y,` - `);if(i>0){var g=mt(r,n,i,s),b=mt(r,n,i,l);m+="L ".concat(b.x,",").concat(b.y,` - A `).concat(i,",").concat(i,`,0, - `).concat(+(Math.abs(f)>180),",").concat(+(s<=l),`, - `).concat(g.x,",").concat(g.y," Z")}else m+="L ".concat(r,",").concat(n," Z");return m},qX=function(t){var r=t.cx,n=t.cy,i=t.innerRadius,o=t.outerRadius,s=t.cornerRadius,u=t.forceCornerRadius,f=t.cornerIsExternal,l=t.startAngle,d=t.endAngle,p=ur(d-l),m=Gf({cx:r,cy:n,radius:o,angle:l,sign:p,cornerRadius:s,cornerIsExternal:f}),g=m.circleTangency,b=m.lineTangency,y=m.theta,w=Gf({cx:r,cy:n,radius:o,angle:d,sign:-p,cornerRadius:s,cornerIsExternal:f}),j=w.circleTangency,O=w.lineTangency,E=w.theta,N=f?Math.abs(l-d):Math.abs(l-d)-y-E;if(N<0)return u?"M ".concat(b.x,",").concat(b.y,` - a`).concat(s,",").concat(s,",0,0,1,").concat(s*2,`,0 - a`).concat(s,",").concat(s,",0,0,1,").concat(-s*2,`,0 - `):ZD({cx:r,cy:n,innerRadius:i,outerRadius:o,startAngle:l,endAngle:d});var A="M ".concat(b.x,",").concat(b.y,` - A`).concat(s,",").concat(s,",0,0,").concat(+(p<0),",").concat(g.x,",").concat(g.y,` - A`).concat(o,",").concat(o,",0,").concat(+(N>180),",").concat(+(p<0),",").concat(j.x,",").concat(j.y,` - A`).concat(s,",").concat(s,",0,0,").concat(+(p<0),",").concat(O.x,",").concat(O.y,` - `);if(i>0){var C=Gf({cx:r,cy:n,radius:i,angle:l,sign:p,isExternal:!0,cornerRadius:s,cornerIsExternal:f}),T=C.circleTangency,R=C.lineTangency,I=C.theta,z=Gf({cx:r,cy:n,radius:i,angle:d,sign:-p,isExternal:!0,cornerRadius:s,cornerIsExternal:f}),$=z.circleTangency,L=z.lineTangency,U=z.theta,W=f?Math.abs(l-d):Math.abs(l-d)-I-U;if(W<0&&s===0)return"".concat(A,"L").concat(r,",").concat(n,"Z");A+="L".concat(L.x,",").concat(L.y,` - A`).concat(s,",").concat(s,",0,0,").concat(+(p<0),",").concat($.x,",").concat($.y,` - A`).concat(i,",").concat(i,",0,").concat(+(W>180),",").concat(+(p>0),",").concat(T.x,",").concat(T.y,` - A`).concat(s,",").concat(s,",0,0,").concat(+(p<0),",").concat(R.x,",").concat(R.y,"Z")}else A+="L".concat(r,",").concat(n,"Z");return A},UX={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},JD=function(t){var r=ON(ON({},UX),t),n=r.cx,i=r.cy,o=r.innerRadius,s=r.outerRadius,u=r.cornerRadius,f=r.forceCornerRadius,l=r.cornerIsExternal,d=r.startAngle,p=r.endAngle,m=r.className;if(s0&&Math.abs(d-p)<360?w=qX({cx:n,cy:i,innerRadius:o,outerRadius:s,cornerRadius:Math.min(y,b/2),forceCornerRadius:f,cornerIsExternal:l,startAngle:d,endAngle:p}):w=ZD({cx:n,cy:i,innerRadius:o,outerRadius:s,startAngle:d,endAngle:p}),F.createElement("path",E1({},Le(r,!0),{className:g,d:w,role:"img"}))};function Uc(e){"@babel/helpers - typeof";return Uc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Uc(e)}function P1(){return P1=Object.assign?Object.assign.bind():function(e){for(var t=1;ttY.call(e,t));function ca(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const iY="__v",oY="__o",aY="_owner",{getOwnPropertyDescriptor:RN,keys:MN}=Object;function sY(e,t){return e.byteLength===t.byteLength&&Nh(new Uint8Array(e),new Uint8Array(t))}function lY(e,t,r){let n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function cY(e,t){return e.byteLength===t.byteLength&&Nh(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function uY(e,t){return ca(e.getTime(),t.getTime())}function fY(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function dY(e,t){return e===t}function IN(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const i=new Array(n),o=e.entries();let s,u,f=0;for(;(s=o.next())&&!s.done;){const l=t.entries();let d=!1,p=0;for(;(u=l.next())&&!u.done;){if(i[p]){p++;continue}const m=s.value,g=u.value;if(r.equals(m[0],g[0],f,p,e,t,r)&&r.equals(m[1],g[1],m[0],g[0],e,t,r)){d=i[p]=!0;break}p++}if(!d)return!1;f++}return!0}const hY=ca;function pY(e,t,r){const n=MN(e);let i=n.length;if(MN(t).length!==i)return!1;for(;i-- >0;)if(!eL(e,t,r,n[i]))return!1;return!0}function Ql(e,t,r){const n=kN(e);let i=n.length;if(kN(t).length!==i)return!1;let o,s,u;for(;i-- >0;)if(o=n[i],!eL(e,t,r,o)||(s=RN(e,o),u=RN(t,o),(s||u)&&(!s||!u||s.configurable!==u.configurable||s.enumerable!==u.enumerable||s.writable!==u.writable)))return!1;return!0}function mY(e,t){return ca(e.valueOf(),t.valueOf())}function vY(e,t){return e.source===t.source&&e.flags===t.flags}function DN(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const i=new Array(n),o=e.values();let s,u;for(;(s=o.next())&&!s.done;){const f=t.values();let l=!1,d=0;for(;(u=f.next())&&!u.done;){if(!i[d]&&r.equals(s.value,u.value,s.value,u.value,e,t,r)){l=i[d]=!0;break}d++}if(!l)return!1}return!0}function Nh(e,t){let r=e.byteLength;if(t.byteLength!==r||e.byteOffset!==t.byteOffset)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function gY(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function eL(e,t,r,n){return(n===aY||n===oY||n===iY)&&(e.$$typeof||t.$$typeof)?!0:nY(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}const yY="[object ArrayBuffer]",xY="[object Arguments]",bY="[object Boolean]",wY="[object DataView]",SY="[object Date]",_Y="[object Error]",jY="[object Map]",OY="[object Number]",EY="[object Object]",PY="[object RegExp]",AY="[object Set]",CY="[object String]",NY={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},TY="[object URL]",kY=Object.prototype.toString;function RY({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:i,areFunctionsEqual:o,areMapsEqual:s,areNumbersEqual:u,areObjectsEqual:f,arePrimitiveWrappersEqual:l,areRegExpsEqual:d,areSetsEqual:p,areTypedArraysEqual:m,areUrlsEqual:g,unknownTagComparators:b}){return function(w,j,O){if(w===j)return!0;if(w==null||j==null)return!1;const E=typeof w;if(E!==typeof j)return!1;if(E!=="object")return E==="number"?u(w,j,O):E==="function"?o(w,j,O):!1;const N=w.constructor;if(N!==j.constructor)return!1;if(N===Object)return f(w,j,O);if(Array.isArray(w))return t(w,j,O);if(N===Date)return n(w,j,O);if(N===RegExp)return d(w,j,O);if(N===Map)return s(w,j,O);if(N===Set)return p(w,j,O);const A=kY.call(w);if(A===SY)return n(w,j,O);if(A===PY)return d(w,j,O);if(A===jY)return s(w,j,O);if(A===AY)return p(w,j,O);if(A===EY)return typeof w.then!="function"&&typeof j.then!="function"&&f(w,j,O);if(A===TY)return g(w,j,O);if(A===_Y)return i(w,j,O);if(A===xY)return f(w,j,O);if(NY[A])return m(w,j,O);if(A===yY)return e(w,j,O);if(A===wY)return r(w,j,O);if(A===bY||A===OY||A===CY)return l(w,j,O);if(b){let C=b[A];if(!C){const T=rY(w);T&&(C=b[T])}if(C)return C(w,j,O)}return!1}}function MY({circular:e,createCustomConfig:t,strict:r}){let n={areArrayBuffersEqual:sY,areArraysEqual:r?Ql:lY,areDataViewsEqual:cY,areDatesEqual:uY,areErrorsEqual:fY,areFunctionsEqual:dY,areMapsEqual:r?Xx(IN,Ql):IN,areNumbersEqual:hY,areObjectsEqual:r?Ql:pY,arePrimitiveWrappersEqual:mY,areRegExpsEqual:vY,areSetsEqual:r?Xx(DN,Ql):DN,areTypedArraysEqual:r?Xx(Nh,Ql):Nh,areUrlsEqual:gY,unknownTagComparators:void 0};if(t&&(n=Object.assign({},n,t(n))),e){const i=Xf(n.areArraysEqual),o=Xf(n.areMapsEqual),s=Xf(n.areObjectsEqual),u=Xf(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:i,areMapsEqual:o,areObjectsEqual:s,areSetsEqual:u})}return n}function IY(e){return function(t,r,n,i,o,s,u){return e(t,r,u)}}function DY({circular:e,comparator:t,createState:r,equals:n,strict:i}){if(r)return function(u,f){const{cache:l=e?new WeakMap:void 0,meta:d}=r();return t(u,f,{cache:l,equals:n,meta:d,strict:i})};if(e)return function(u,f){return t(u,f,{cache:new WeakMap,equals:n,meta:void 0,strict:i})};const o={cache:void 0,equals:n,meta:void 0,strict:i};return function(u,f){return t(u,f,o)}}const LY=fo();fo({strict:!0});fo({circular:!0});fo({circular:!0,strict:!0});fo({createInternalComparator:()=>ca});fo({strict:!0,createInternalComparator:()=>ca});fo({circular:!0,createInternalComparator:()=>ca});fo({circular:!0,createInternalComparator:()=>ca,strict:!0});function fo(e={}){const{circular:t=!1,createInternalComparator:r,createState:n,strict:i=!1}=e,o=MY(e),s=RY(o),u=r?r(s):IY(s);return DY({circular:t,comparator:s,createState:n,equals:u,strict:i})}function $Y(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function LN(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function i(o){r<0&&(r=o),o-r>t?(e(o),r=-1):$Y(i)};requestAnimationFrame(n)}function A1(e){"@babel/helpers - typeof";return A1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},A1(e)}function BY(e){return UY(e)||qY(e)||zY(e)||FY()}function FY(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zY(e,t){if(e){if(typeof e=="string")return $N(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return $N(e,t)}}function $N(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1?1:j<0?0:j},y=function(j){for(var O=j>1?1:j,E=O,N=0;N<8;++N){var A=p(E)-O,C=g(E);if(Math.abs(A-O)0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,i=t.damping,o=i===void 0?8:i,s=t.dt,u=s===void 0?17:s,f=function(d,p,m){var g=-(d-p)*n,b=m*o,y=m+(g-b)*u/1e3,w=m*u/1e3+d;return Math.abs(w-p)e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function bQ(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,o;for(o=0;o=0)&&(r[i]=e[i]);return r}function Yx(e){return jQ(e)||_Q(e)||SQ(e)||wQ()}function wQ(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function SQ(e,t){if(e){if(typeof e=="string")return R1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return R1(e,t)}}function _Q(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function jQ(e){if(Array.isArray(e))return R1(e)}function R1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Rh(e){return Rh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Rh(e)}var Zn=(function(e){CQ(r,e);var t=NQ(r);function r(n,i){var o;OQ(this,r),o=t.call(this,n,i);var s=o.props,u=s.isActive,f=s.attributeName,l=s.from,d=s.to,p=s.steps,m=s.children,g=s.duration;if(o.handleStyleChange=o.handleStyleChange.bind(D1(o)),o.changeStyle=o.changeStyle.bind(D1(o)),!u||g<=0)return o.state={style:{}},typeof m=="function"&&(o.state={style:d}),I1(o);if(p&&p.length)o.state={style:p[0].style};else if(l){if(typeof m=="function")return o.state={style:l},I1(o);o.state={style:f?sc({},f,l):l}}else o.state={style:{}};return o}return PQ(r,[{key:"componentDidMount",value:function(){var i=this.props,o=i.isActive,s=i.canBegin;this.mounted=!0,!(!o||!s)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var o=this.props,s=o.isActive,u=o.canBegin,f=o.attributeName,l=o.shouldReAnimate,d=o.to,p=o.from,m=this.state.style;if(u){if(!s){var g={style:f?sc({},f,d):d};this.state&&m&&(f&&m[f]!==d||!f&&m!==d)&&this.setState(g);return}if(!(LY(i.to,d)&&i.canBegin&&i.isActive)){var b=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var y=b||l?p:i.to;if(this.state&&m){var w={style:f?sc({},f,y):y};(f&&m[f]!==y||!f&&m!==y)&&this.setState(w)}this.runAnimation(wn(wn({},this.props),{},{from:y,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var o=this,s=i.from,u=i.to,f=i.duration,l=i.easing,d=i.begin,p=i.onAnimationEnd,m=i.onAnimationStart,g=gQ(s,u,aQ(l),f,this.changeStyle),b=function(){o.stopJSAnimation=g()};this.manager.start([m,d,b,f,p])}},{key:"runStepAnimation",value:function(i){var o=this,s=i.steps,u=i.begin,f=i.onAnimationStart,l=s[0],d=l.style,p=l.duration,m=p===void 0?0:p,g=function(y,w,j){if(j===0)return y;var O=w.duration,E=w.easing,N=E===void 0?"ease":E,A=w.style,C=w.properties,T=w.onAnimationEnd,R=j>0?s[j-1]:w,I=C||Object.keys(A);if(typeof N=="function"||N==="spring")return[].concat(Yx(y),[o.runJSAnimation.bind(o,{from:R.style,to:A,duration:O,easing:N}),O]);var z=zN(I,O,N),$=wn(wn(wn({},R.style),A),{},{transition:z});return[].concat(Yx(y),[$,O,T]).filter(KY)};return this.manager.start([f].concat(Yx(s.reduce(g,[d,Math.max(m,u)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=WY());var o=i.begin,s=i.duration,u=i.attributeName,f=i.to,l=i.easing,d=i.onAnimationStart,p=i.onAnimationEnd,m=i.steps,g=i.children,b=this.manager;if(this.unSubscribe=b.subscribe(this.handleStyleChange),typeof l=="function"||typeof g=="function"||l==="spring"){this.runJSAnimation(i);return}if(m.length>1){this.runStepAnimation(i);return}var y=u?sc({},u,f):f,w=zN(Object.keys(y),s,l);b.start([d,o,wn(wn({},y),{},{transition:w}),s,p])}},{key:"render",value:function(){var i=this.props,o=i.children;i.begin;var s=i.duration;i.attributeName,i.easing;var u=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var f=xQ(i,yQ),l=_.Children.count(o),d=this.state.style;if(typeof o=="function")return o(d);if(!u||l===0||s<=0)return o;var p=function(g){var b=g.props,y=b.style,w=y===void 0?{}:y,j=b.className,O=_.cloneElement(g,wn(wn({},f),{},{style:wn(wn({},w),d),className:j}));return O};return l===1?p(_.Children.only(o)):F.createElement("div",null,_.Children.map(o,function(m){return p(m)}))}}]),r})(_.PureComponent);Zn.displayName="Animate";Zn.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};Zn.propTypes={from:st.oneOfType([st.object,st.string]),to:st.oneOfType([st.object,st.string]),attributeName:st.string,duration:st.number,begin:st.number,easing:st.oneOfType([st.string,st.func]),steps:st.arrayOf(st.shape({duration:st.number.isRequired,style:st.object.isRequired,easing:st.oneOfType([st.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),st.func]),properties:st.arrayOf("string"),onAnimationEnd:st.func})),children:st.oneOfType([st.node,st.func]),isActive:st.bool,canBegin:st.bool,onAnimationEnd:st.func,shouldReAnimate:st.bool,onAnimationStart:st.func,onAnimationReStart:st.func};function Vc(e){"@babel/helpers - typeof";return Vc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vc(e)}function Mh(){return Mh=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0?1:-1,f=n>=0?1:-1,l=i>=0&&n>=0||i<0&&n<0?1:0,d;if(s>0&&o instanceof Array){for(var p=[0,0,0,0],m=0,g=4;ms?s:o[m];d="M".concat(t,",").concat(r+u*p[0]),p[0]>0&&(d+="A ".concat(p[0],",").concat(p[0],",0,0,").concat(l,",").concat(t+f*p[0],",").concat(r)),d+="L ".concat(t+n-f*p[1],",").concat(r),p[1]>0&&(d+="A ".concat(p[1],",").concat(p[1],",0,0,").concat(l,`, - `).concat(t+n,",").concat(r+u*p[1])),d+="L ".concat(t+n,",").concat(r+i-u*p[2]),p[2]>0&&(d+="A ".concat(p[2],",").concat(p[2],",0,0,").concat(l,`, - `).concat(t+n-f*p[2],",").concat(r+i)),d+="L ".concat(t+f*p[3],",").concat(r+i),p[3]>0&&(d+="A ".concat(p[3],",").concat(p[3],",0,0,").concat(l,`, - `).concat(t,",").concat(r+i-u*p[3])),d+="Z"}else if(s>0&&o===+o&&o>0){var b=Math.min(s,o);d="M ".concat(t,",").concat(r+u*b,` - A `).concat(b,",").concat(b,",0,0,").concat(l,",").concat(t+f*b,",").concat(r,` - L `).concat(t+n-f*b,",").concat(r,` - A `).concat(b,",").concat(b,",0,0,").concat(l,",").concat(t+n,",").concat(r+u*b,` - L `).concat(t+n,",").concat(r+i-u*b,` - A `).concat(b,",").concat(b,",0,0,").concat(l,",").concat(t+n-f*b,",").concat(r+i,` - L `).concat(t+f*b,",").concat(r+i,` - A `).concat(b,",").concat(b,",0,0,").concat(l,",").concat(t,",").concat(r+i-u*b," Z")}else d="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(i," h ").concat(-n," Z");return d},FQ=function(t,r){if(!t||!r)return!1;var n=t.x,i=t.y,o=r.x,s=r.y,u=r.width,f=r.height;if(Math.abs(u)>0&&Math.abs(f)>0){var l=Math.min(o,o+u),d=Math.max(o,o+u),p=Math.min(s,s+f),m=Math.max(s,s+f);return n>=l&&n<=d&&i>=p&&i<=m}return!1},zQ={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},TS=function(t){var r=XN(XN({},zQ),t),n=_.useRef(),i=_.useState(-1),o=kQ(i,2),s=o[0],u=o[1];_.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var N=n.current.getTotalLength();N&&u(N)}catch{}},[]);var f=r.x,l=r.y,d=r.width,p=r.height,m=r.radius,g=r.className,b=r.animationEasing,y=r.animationDuration,w=r.animationBegin,j=r.isAnimationActive,O=r.isUpdateAnimationActive;if(f!==+f||l!==+l||d!==+d||p!==+p||d===0||p===0)return null;var E=We("recharts-rectangle",g);return O?F.createElement(Zn,{canBegin:s>0,from:{width:d,height:p,x:f,y:l},to:{width:d,height:p,x:f,y:l},duration:y,animationEasing:b,isActive:O},function(N){var A=N.width,C=N.height,T=N.x,R=N.y;return F.createElement(Zn,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:w,duration:y,isActive:j,easing:b},F.createElement("path",Mh({},Le(r,!0),{className:E,d:YN(T,R,A,C,m),ref:n})))}):F.createElement("path",Mh({},Le(r,!0),{className:E,d:YN(f,l,d,p,m)}))},qQ=["points","className","baseLinePoints","connectNulls"];function Ya(){return Ya=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function WQ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function QN(e){return KQ(e)||GQ(e)||VQ(e)||HQ()}function HQ(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function VQ(e,t){if(e){if(typeof e=="string")return L1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return L1(e,t)}}function GQ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function KQ(e){if(Array.isArray(e))return L1(e)}function L1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[],r=[[]];return t.forEach(function(n){ZN(n)?r[r.length-1].push(n):r[r.length-1].length>0&&r.push([])}),ZN(t[0])&&r[r.length-1].push(t[0]),r[r.length-1].length<=0&&(r=r.slice(0,-1)),r},mc=function(t,r){var n=XQ(t);r&&(n=[n.reduce(function(o,s){return[].concat(QN(o),QN(s))},[])]);var i=n.map(function(o){return o.reduce(function(s,u,f){return"".concat(s).concat(f===0?"M":"L").concat(u.x,",").concat(u.y)},"")}).join("");return n.length===1?"".concat(i,"Z"):i},YQ=function(t,r,n){var i=mc(t,n);return"".concat(i.slice(-1)==="Z"?i.slice(0,-1):i,"L").concat(mc(r.reverse(),n).slice(1))},QQ=function(t){var r=t.points,n=t.className,i=t.baseLinePoints,o=t.connectNulls,s=UQ(t,qQ);if(!r||!r.length)return null;var u=We("recharts-polygon",n);if(i&&i.length){var f=s.stroke&&s.stroke!=="none",l=YQ(r,i,o);return F.createElement("g",{className:u},F.createElement("path",Ya({},Le(s,!0),{fill:l.slice(-1)==="Z"?s.fill:"none",stroke:"none",d:l})),f?F.createElement("path",Ya({},Le(s,!0),{fill:"none",d:mc(r,o)})):null,f?F.createElement("path",Ya({},Le(s,!0),{fill:"none",d:mc(i,o)})):null)}var d=mc(r,o);return F.createElement("path",Ya({},Le(s,!0),{fill:d.slice(-1)==="Z"?s.fill:"none",className:u,d}))};function $1(){return $1=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function iZ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var oZ=function(t,r,n,i,o,s){return"M".concat(t,",").concat(o,"v").concat(i,"M").concat(s,",").concat(r,"h").concat(n)},aZ=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,o=i===void 0?0:i,s=t.top,u=s===void 0?0:s,f=t.left,l=f===void 0?0:f,d=t.width,p=d===void 0?0:d,m=t.height,g=m===void 0?0:m,b=t.className,y=nZ(t,ZQ),w=JQ({x:n,y:o,top:u,left:l,width:p,height:g},y);return!ge(n)||!ge(o)||!ge(p)||!ge(g)||!ge(u)||!ge(l)?null:F.createElement("path",B1({},Le(w,!0),{className:We("recharts-cross",b),d:oZ(n,o,p,g,u,l)}))},Qx,eT;function sZ(){if(eT)return Qx;eT=1;var e=Rp(),t=wD(),r=ri();function n(i,o){return i&&i.length?e(i,r(o,2),t):void 0}return Qx=n,Qx}var lZ=sZ();const cZ=ot(lZ);var Zx,tT;function uZ(){if(tT)return Zx;tT=1;var e=Rp(),t=ri(),r=SD();function n(i,o){return i&&i.length?e(i,t(o,2),r):void 0}return Zx=n,Zx}var fZ=uZ();const dZ=ot(fZ);var hZ=["cx","cy","angle","ticks","axisLine"],pZ=["ticks","tick","angle","tickFormatter","stroke"];function Ss(e){"@babel/helpers - typeof";return Ss=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ss(e)}function vc(){return vc=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function mZ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function vZ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function iT(e,t){for(var r=0;rsT?s=i==="outer"?"start":"end":o<-sT?s=i==="outer"?"end":"start":s="middle",s}},{key:"renderAxisLine",value:function(){var n=this.props,i=n.cx,o=n.cy,s=n.radius,u=n.axisLine,f=n.axisLineType,l=ko(ko({},Le(this.props,!1)),{},{fill:"none"},Le(u,!1));if(f==="circle")return F.createElement($p,Lo({className:"recharts-polar-angle-axis-line"},l,{cx:i,cy:o,r:s}));var d=this.props.ticks,p=d.map(function(m){return mt(i,o,s,m.coordinate)});return F.createElement(QQ,Lo({className:"recharts-polar-angle-axis-line"},l,{points:p}))}},{key:"renderTicks",value:function(){var n=this,i=this.props,o=i.ticks,s=i.tick,u=i.tickLine,f=i.tickFormatter,l=i.stroke,d=Le(this.props,!1),p=Le(s,!1),m=ko(ko({},d),{},{fill:"none"},Le(u,!1)),g=o.map(function(b,y){var w=n.getTickLineCoord(b),j=n.getTickTextAnchor(b),O=ko(ko(ko({textAnchor:j},d),{},{stroke:"none",fill:l},p),{},{index:y,payload:b,x:w.x2,y:w.y2});return F.createElement(rt,Lo({className:We("recharts-polar-angle-axis-tick",YD(s)),key:"tick-".concat(b.coordinate)},Vo(n.props,b,y)),u&&F.createElement("line",Lo({className:"recharts-polar-angle-axis-tick-line"},m,w)),s&&t.renderTickItem(s,O,f?f(b.value,y):b.value))});return F.createElement(rt,{className:"recharts-polar-angle-axis-ticks"},g)}},{key:"render",value:function(){var n=this.props,i=n.ticks,o=n.radius,s=n.axisLine;return o<=0||!i||!i.length?null:F.createElement(rt,{className:We("recharts-polar-angle-axis",this.props.className)},s&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(n,i,o){var s;return F.isValidElement(n)?s=F.cloneElement(n,i):ze(n)?s=n(i):s=F.createElement(Go,Lo({},i,{className:"recharts-polar-angle-axis-tick-value"}),o),s}}])})(_.PureComponent);zp(qp,"displayName","PolarAngleAxis");zp(qp,"axisType","angleAxis");zp(qp,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var Jx,lT;function TZ(){if(lT)return Jx;lT=1;var e=wI(),t=e(Object.getPrototypeOf,Object);return Jx=t,Jx}var eb,cT;function kZ(){if(cT)return eb;cT=1;var e=Ai(),t=TZ(),r=Ci(),n="[object Object]",i=Function.prototype,o=Object.prototype,s=i.toString,u=o.hasOwnProperty,f=s.call(Object);function l(d){if(!r(d)||e(d)!=n)return!1;var p=t(d);if(p===null)return!0;var m=u.call(p,"constructor")&&p.constructor;return typeof m=="function"&&m instanceof m&&s.call(m)==f}return eb=l,eb}var RZ=kZ();const MZ=ot(RZ);var tb,uT;function IZ(){if(uT)return tb;uT=1;var e=Ai(),t=Ci(),r="[object Boolean]";function n(i){return i===!0||i===!1||t(i)&&e(i)==r}return tb=n,tb}var DZ=IZ();const LZ=ot(DZ);function Kc(e){"@babel/helpers - typeof";return Kc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kc(e)}function Lh(){return Lh=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0,from:{upperWidth:0,lowerWidth:0,height:m,x:f,y:l},to:{upperWidth:d,lowerWidth:p,height:m,x:f,y:l},duration:y,animationEasing:b,isActive:j},function(E){var N=E.upperWidth,A=E.lowerWidth,C=E.height,T=E.x,R=E.y;return F.createElement(Zn,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:w,duration:y,easing:b},F.createElement("path",Lh({},Le(r,!0),{className:O,d:pT(T,R,N,A,C),ref:n})))}):F.createElement("g",null,F.createElement("path",Lh({},Le(r,!0),{className:O,d:pT(f,l,d,p,m)})))},KZ=["option","shapeType","propTransformer","activeClassName","isActive"];function Xc(e){"@babel/helpers - typeof";return Xc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xc(e)}function XZ(e,t){if(e==null)return{};var r=YZ(e,t),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function YZ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function mT(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function $h(e){for(var t=1;t0?Ur(E,"paddingAngle",0):0;if(A){var T=Fr(A.endAngle-A.startAngle,E.endAngle-E.startAngle),R=ht(ht({},E),{},{startAngle:O+C,endAngle:O+T(y)+C});w.push(R),O=R.endAngle}else{var I=E.endAngle,z=E.startAngle,$=Fr(0,I-z),L=$(y),U=ht(ht({},E),{},{startAngle:O+C,endAngle:O+L+C});w.push(U),O=U.endAngle}}),F.createElement(rt,null,n.renderSectorsStatically(w))})}},{key:"attachKeyboardHandlers",value:function(n){var i=this;n.onkeydown=function(o){if(!o.altKey)switch(o.key){case"ArrowLeft":{var s=++i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[s].focus(),i.setState({sectorToFocus:s});break}case"ArrowRight":{var u=--i.state.sectorToFocus<0?i.sectorRefs.length-1:i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[u].focus(),i.setState({sectorToFocus:u});break}case"Escape":{i.sectorRefs[i.state.sectorToFocus].blur(),i.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var n=this.props,i=n.sectors,o=n.isAnimationActive,s=this.state.prevSectors;return o&&i&&i.length&&(!s||!hu(s,i))?this.renderSectorsWithAnimation():this.renderSectorsStatically(i)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var n=this,i=this.props,o=i.hide,s=i.sectors,u=i.className,f=i.label,l=i.cx,d=i.cy,p=i.innerRadius,m=i.outerRadius,g=i.isAnimationActive,b=this.state.isAnimationFinished;if(o||!s||!s.length||!ge(l)||!ge(d)||!ge(p)||!ge(m))return null;var y=We("recharts-pie",u);return F.createElement(rt,{tabIndex:this.props.rootTabIndex,className:y,ref:function(j){n.pieRef=j}},this.renderSectors(),f&&this.renderLabels(s),Vt.renderCallByParent(this.props,null,!1),(!g||b)&&wi.renderCallByParent(this.props,s,!1))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return i.prevIsAnimationActive!==n.isAnimationActive?{prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:[],isAnimationFinished:!0}:n.isAnimationActive&&n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:i.curSectors,isAnimationFinished:!0}:n.sectors!==i.curSectors?{curSectors:n.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(n,i){return n>i?"start":n=360?O:O-1)*f,N=w-O*g-E,A=i.reduce(function(R,I){var z=Bt(I,j,0);return R+(ge(z)?z:0)},0),C;if(A>0){var T;C=i.map(function(R,I){var z=Bt(R,j,0),$=Bt(R,d,I),L=(ge(z)?z:0)/A,U;I?U=T.endAngle+ur(y)*f*(z!==0?1:0):U=s;var W=U+ur(y)*((z!==0?g:0)+L*N),V=(U+W)/2,G=(b.innerRadius+b.outerRadius)/2,Y=[{name:$,value:z,payload:R,dataKey:j,type:m}],D=mt(b.cx,b.cy,G,V);return T=ht(ht(ht({percent:L,cornerRadius:o,name:$,tooltipPayload:Y,midAngle:V,middleRadius:G,tooltipPosition:D},R),b),{},{value:Bt(R,j),startAngle:U,endAngle:W,payload:R,paddingAngle:ur(y)*f}),T})}return ht(ht({},b),{},{sectors:C,data:i})});var rb,xT;function gJ(){if(xT)return rb;xT=1;var e=Math.ceil,t=Math.max;function r(n,i,o,s){for(var u=-1,f=t(e((i-n)/(o||1)),0),l=Array(f);f--;)l[s?f:++u]=n,n+=o;return l}return rb=r,rb}var nb,bT;function pL(){if(bT)return nb;bT=1;var e=LI(),t=1/0,r=17976931348623157e292;function n(i){if(!i)return i===0?i:0;if(i=e(i),i===t||i===-t){var o=i<0?-1:1;return o*r}return i===i?i:0}return nb=n,nb}var ib,wT;function yJ(){if(wT)return ib;wT=1;var e=gJ(),t=Op(),r=pL();function n(i){return function(o,s,u){return u&&typeof u!="number"&&t(o,s,u)&&(s=u=void 0),o=r(o),s===void 0?(s=o,o=0):s=r(s),u=u===void 0?o0&&n.handleDrag(i.changedTouches[0])}),Dr(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=n.props,o=i.endIndex,s=i.onDragEnd,u=i.startIndex;s?.({endIndex:o,startIndex:u})}),n.detachDragEndListener()}),Dr(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),Dr(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),Dr(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),Dr(n,"handleSlideDragStart",function(i){var o=PT(i)?i.changedTouches[0]:i;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:o.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return NJ(t,e),EJ(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var i=n.startX,o=n.endX,s=this.state.scaleValues,u=this.props,f=u.gap,l=u.data,d=l.length-1,p=Math.min(i,o),m=Math.max(i,o),g=t.getIndexInRange(s,p),b=t.getIndexInRange(s,m);return{startIndex:g-g%f,endIndex:b===d?d:b-b%f}}},{key:"getTextOfTick",value:function(n){var i=this.props,o=i.data,s=i.tickFormatter,u=i.dataKey,f=Bt(o[n],u,n);return ze(s)?s(f,n):f}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(n){var i=this.state,o=i.slideMoveStartX,s=i.startX,u=i.endX,f=this.props,l=f.x,d=f.width,p=f.travellerWidth,m=f.startIndex,g=f.endIndex,b=f.onChange,y=n.pageX-o;y>0?y=Math.min(y,l+d-p-u,l+d-p-s):y<0&&(y=Math.max(y,l-s,l-u));var w=this.getIndex({startX:s+y,endX:u+y});(w.startIndex!==m||w.endIndex!==g)&&b&&b(w),this.setState({startX:s+y,endX:u+y,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,i){var o=PT(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:o.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var i=this.state,o=i.brushMoveStartX,s=i.movingTravellerId,u=i.endX,f=i.startX,l=this.state[s],d=this.props,p=d.x,m=d.width,g=d.travellerWidth,b=d.onChange,y=d.gap,w=d.data,j={startX:this.state.startX,endX:this.state.endX},O=n.pageX-o;O>0?O=Math.min(O,p+m-g-l):O<0&&(O=Math.max(O,p-l)),j[s]=l+O;var E=this.getIndex(j),N=E.startIndex,A=E.endIndex,C=function(){var R=w.length-1;return s==="startX"&&(u>f?N%y===0:A%y===0)||uf?A%y===0:N%y===0)||u>f&&A===R};this.setState(Dr(Dr({},s,l+O),"brushMoveStartX",n.pageX),function(){b&&C()&&b(E)})}},{key:"handleTravellerMoveKeyboard",value:function(n,i){var o=this,s=this.state,u=s.scaleValues,f=s.startX,l=s.endX,d=this.state[i],p=u.indexOf(d);if(p!==-1){var m=p+n;if(!(m===-1||m>=u.length)){var g=u[m];i==="startX"&&g>=l||i==="endX"&&g<=f||this.setState(Dr({},i,g),function(){o.props.onChange(o.getIndex({startX:o.state.startX,endX:o.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,i=n.x,o=n.y,s=n.width,u=n.height,f=n.fill,l=n.stroke;return F.createElement("rect",{stroke:l,fill:f,x:i,y:o,width:s,height:u})}},{key:"renderPanorama",value:function(){var n=this.props,i=n.x,o=n.y,s=n.width,u=n.height,f=n.data,l=n.children,d=n.padding,p=_.Children.only(l);return p?F.cloneElement(p,{x:i,y:o,width:s,height:u,margin:d,compact:!0,data:f}):null}},{key:"renderTravellerLayer",value:function(n,i){var o,s,u=this,f=this.props,l=f.y,d=f.travellerWidth,p=f.height,m=f.traveller,g=f.ariaLabel,b=f.data,y=f.startIndex,w=f.endIndex,j=Math.max(n,this.props.x),O=ab(ab({},Le(this.props,!1)),{},{x:j,y:l,width:d,height:p}),E=g||"Min value: ".concat((o=b[y])===null||o===void 0?void 0:o.name,", Max value: ").concat((s=b[w])===null||s===void 0?void 0:s.name);return F.createElement(rt,{tabIndex:0,role:"slider","aria-label":E,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(A){["ArrowLeft","ArrowRight"].includes(A.key)&&(A.preventDefault(),A.stopPropagation(),u.handleTravellerMoveKeyboard(A.key==="ArrowRight"?1:-1,i))},onFocus:function(){u.setState({isTravellerFocused:!0})},onBlur:function(){u.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(m,O))}},{key:"renderSlide",value:function(n,i){var o=this.props,s=o.y,u=o.height,f=o.stroke,l=o.travellerWidth,d=Math.min(n,i)+l,p=Math.max(Math.abs(i-n)-l,0);return F.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:f,fillOpacity:.2,x:d,y:s,width:p,height:u})}},{key:"renderText",value:function(){var n=this.props,i=n.startIndex,o=n.endIndex,s=n.y,u=n.height,f=n.travellerWidth,l=n.stroke,d=this.state,p=d.startX,m=d.endX,g=5,b={pointerEvents:"none",fill:l};return F.createElement(rt,{className:"recharts-brush-texts"},F.createElement(Go,zh({textAnchor:"end",verticalAnchor:"middle",x:Math.min(p,m)-g,y:s+u/2},b),this.getTextOfTick(i)),F.createElement(Go,zh({textAnchor:"start",verticalAnchor:"middle",x:Math.max(p,m)+f+g,y:s+u/2},b),this.getTextOfTick(o)))}},{key:"render",value:function(){var n=this.props,i=n.data,o=n.className,s=n.children,u=n.x,f=n.y,l=n.width,d=n.height,p=n.alwaysShowText,m=this.state,g=m.startX,b=m.endX,y=m.isTextActive,w=m.isSlideMoving,j=m.isTravellerMoving,O=m.isTravellerFocused;if(!i||!i.length||!ge(u)||!ge(f)||!ge(l)||!ge(d)||l<=0||d<=0)return null;var E=We("recharts-brush",o),N=F.Children.count(s)===1,A=jJ("userSelect","none");return F.createElement(rt,{className:E,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:A},this.renderBackground(),N&&this.renderPanorama(),this.renderSlide(g,b),this.renderTravellerLayer(g,"startX"),this.renderTravellerLayer(b,"endX"),(y||w||j||O||p)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var i=n.x,o=n.y,s=n.width,u=n.height,f=n.stroke,l=Math.floor(o+u/2)-1;return F.createElement(F.Fragment,null,F.createElement("rect",{x:i,y:o,width:s,height:u,fill:f,stroke:"none"}),F.createElement("line",{x1:i+1,y1:l,x2:i+s-1,y2:l,fill:"none",stroke:"#fff"}),F.createElement("line",{x1:i+1,y1:l+2,x2:i+s-1,y2:l+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,i){var o;return F.isValidElement(n)?o=F.cloneElement(n,i):ze(n)?o=n(i):o=t.renderDefaultTraveller(i),o}},{key:"getDerivedStateFromProps",value:function(n,i){var o=n.data,s=n.width,u=n.x,f=n.travellerWidth,l=n.updateId,d=n.startIndex,p=n.endIndex;if(o!==i.prevData||l!==i.prevUpdateId)return ab({prevData:o,prevTravellerWidth:f,prevUpdateId:l,prevX:u,prevWidth:s},o&&o.length?kJ({data:o,width:s,x:u,travellerWidth:f,startIndex:d,endIndex:p}):{scale:null,scaleValues:null});if(i.scale&&(s!==i.prevWidth||u!==i.prevX||f!==i.prevTravellerWidth)){i.scale.range([u,u+s-f]);var m=i.scale.domain().map(function(g){return i.scale(g)});return{prevData:o,prevTravellerWidth:f,prevUpdateId:l,prevX:u,prevWidth:s,startX:i.scale(n.startIndex),endX:i.scale(n.endIndex),scaleValues:m}}return null}},{key:"getIndexInRange",value:function(n,i){for(var o=n.length,s=0,u=o-1;u-s>1;){var f=Math.floor((s+u)/2);n[f]>i?u=f:s=f}return i>=n[u]?u:s}}])})(_.PureComponent);Dr(Es,"displayName","Brush");Dr(Es,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var sb,AT;function RJ(){if(AT)return sb;AT=1;var e=nS();function t(r,n){var i;return e(r,function(o,s,u){return i=n(o,s,u),!i}),!!i}return sb=t,sb}var lb,CT;function MJ(){if(CT)return lb;CT=1;var e=pI(),t=ri(),r=RJ(),n=Er(),i=Op();function o(s,u,f){var l=n(s)?e:r;return f&&i(s,u,f)&&(u=void 0),l(s,t(u,3))}return lb=o,lb}var IJ=MJ();const DJ=ot(IJ);var Kn=function(t,r){var n=t.alwaysShow,i=t.ifOverflow;return n&&(i="extendDomain"),i===r},cb,NT;function LJ(){if(NT)return cb;NT=1;var e=kI();function t(r,n,i){n=="__proto__"&&e?e(r,n,{configurable:!0,enumerable:!0,value:i,writable:!0}):r[n]=i}return cb=t,cb}var ub,TT;function $J(){if(TT)return ub;TT=1;var e=LJ(),t=NI(),r=ri();function n(i,o){var s={};return o=r(o,3),t(i,function(u,f,l){e(s,f,o(u,f,l))}),s}return ub=n,ub}var BJ=$J();const FJ=ot(BJ);var fb,kT;function zJ(){if(kT)return fb;kT=1;function e(t,r){for(var n=-1,i=t==null?0:t.length;++n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function YJ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function QJ(e,t){var r=e.x,n=e.y,i=XJ(e,HJ),o="".concat(r),s=parseInt(o,10),u="".concat(n),f=parseInt(u,10),l="".concat(t.height||i.height),d=parseInt(l,10),p="".concat(t.width||i.width),m=parseInt(p,10);return Zl(Zl(Zl(Zl(Zl({},t),i),s?{x:s}:{}),f?{y:f}:{}),{},{height:d,width:m,name:t.name,radius:t.radius})}function DT(e){return F.createElement(fL,W1({shapeType:"rectangle",propTransformer:QJ,activeClassName:"recharts-active-bar"},e))}var ZJ=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,i){if(typeof t=="number")return t;var o=ge(n)||yq(n);return o?t(n,i):(o||Xo(),r)}},JJ=["value","background"],xL;function Ps(e){"@babel/helpers - typeof";return Ps=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ps(e)}function eee(e,t){if(e==null)return{};var r=tee(e,t),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function tee(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Uh(){return Uh=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(V)0&&Math.abs(W)0&&(U=Math.min((te||0)-(W[ve-1]||0),U))}),Number.isFinite(U)){var V=U/L,G=y.layout==="vertical"?n.height:n.width;if(y.padding==="gap"&&(T=V*G/2),y.padding==="no-gap"){var Y=fr(t.barCategoryGap,V*G),D=V*G/2;T=D-Y-(D-Y)/G*Y}}}i==="xAxis"?R=[n.left+(E.left||0)+(T||0),n.left+n.width-(E.right||0)-(T||0)]:i==="yAxis"?R=f==="horizontal"?[n.top+n.height-(E.bottom||0),n.top+(E.top||0)]:[n.top+(E.top||0)+(T||0),n.top+n.height-(E.bottom||0)-(T||0)]:R=y.range,A&&(R=[R[1],R[0]]);var Q=UD(y,o,m),J=Q.scale,M=Q.realScaleType;J.domain(j).range(R),WD(J);var B=HD(J,Pn(Pn({},y),{},{realScaleType:M}));i==="xAxis"?($=w==="top"&&!N||w==="bottom"&&N,I=n.left,z=p[C]-$*y.height):i==="yAxis"&&($=w==="left"&&!N||w==="right"&&N,I=p[C]-$*y.width,z=n.top);var Z=Pn(Pn(Pn({},y),B),{},{realScaleType:M,x:I,y:z,scale:J,width:i==="xAxis"?n.width:y.width,height:i==="yAxis"?n.height:y.height});return Z.bandSize=Eh(Z,B),!y.hide&&i==="xAxis"?p[C]+=($?-1:1)*Z.height:y.hide||(p[C]+=($?-1:1)*Z.width),Pn(Pn({},g),{},Hp({},b,Z))},{})},jL=function(t,r){var n=t.x,i=t.y,o=r.x,s=r.y;return{x:Math.min(n,o),y:Math.min(i,s),width:Math.abs(o-n),height:Math.abs(s-i)}},dee=function(t){var r=t.x1,n=t.y1,i=t.x2,o=t.y2;return jL({x:r,y:n},{x:i,y:o})},OL=(function(){function e(t){cee(this,e),this.scale=t}return uee(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.bandAware,o=n.position;if(r!==void 0){if(o)switch(o){case"start":return this.scale(r);case"middle":{var s=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+s}case"end":{var u=this.bandwidth?this.bandwidth():0;return this.scale(r)+u}default:return this.scale(r)}if(i){var f=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+f}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),i=n[0],o=n[n.length-1];return i<=o?r>=i&&r<=o:r>=o&&r<=i}}],[{key:"create",value:function(r){return new e(r)}}])})();Hp(OL,"EPS",1e-4);var kS=function(t){var r=Object.keys(t).reduce(function(n,i){return Pn(Pn({},n),{},Hp({},i,OL.create(t[i])))},{});return Pn(Pn({},r),{},{apply:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=o.bandAware,u=o.position;return FJ(i,function(f,l){return r[l].apply(f,{bandAware:s,position:u})})},isInRange:function(i){return yL(i,function(o,s){return r[s].isInRange(o)})}})};function hee(e){return(e%180+180)%180}var pee=function(t){var r=t.width,n=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=hee(i),s=o*Math.PI/180,u=Math.atan(n/r),f=s>u&&s-1?f[l?o[d]:d]:void 0}}return pb=n,pb}var mb,qT;function vee(){if(qT)return mb;qT=1;var e=pL();function t(r){var n=e(r),i=n%1;return n===n?i?n-i:n:0}return mb=t,mb}var vb,UT;function gee(){if(UT)return vb;UT=1;var e=OI(),t=ri(),r=vee(),n=Math.max;function i(o,s,u){var f=o==null?0:o.length;if(!f)return-1;var l=u==null?0:r(u);return l<0&&(l=n(f+l,0)),e(o,t(s,3),l)}return vb=i,vb}var gb,WT;function yee(){if(WT)return gb;WT=1;var e=mee(),t=gee(),r=e(t);return gb=r,gb}var xee=yee();const bee=ot(xee);var wee=zM();const See=ot(wee);var _ee=See(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),RS=_.createContext(void 0),MS=_.createContext(void 0),EL=_.createContext(void 0),PL=_.createContext({}),AL=_.createContext(void 0),CL=_.createContext(0),NL=_.createContext(0),HT=function(t){var r=t.state,n=r.xAxisMap,i=r.yAxisMap,o=r.offset,s=t.clipPathId,u=t.children,f=t.width,l=t.height,d=_ee(o);return F.createElement(RS.Provider,{value:n},F.createElement(MS.Provider,{value:i},F.createElement(PL.Provider,{value:o},F.createElement(EL.Provider,{value:d},F.createElement(AL.Provider,{value:s},F.createElement(CL.Provider,{value:l},F.createElement(NL.Provider,{value:f},u)))))))},jee=function(){return _.useContext(AL)},TL=function(t){var r=_.useContext(RS);r==null&&Xo();var n=r[t];return n==null&&Xo(),n},Oee=function(){var t=_.useContext(RS);return to(t)},Eee=function(){var t=_.useContext(MS),r=bee(t,function(n){return yL(n.domain,Number.isFinite)});return r||to(t)},kL=function(t){var r=_.useContext(MS);r==null&&Xo();var n=r[t];return n==null&&Xo(),n},Pee=function(){var t=_.useContext(EL);return t},Aee=function(){return _.useContext(PL)},IS=function(){return _.useContext(NL)},DS=function(){return _.useContext(CL)};function As(e){"@babel/helpers - typeof";return As=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},As(e)}function Cee(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Nee(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);re*i)return!1;var o=r();return e*(t-e*o/2-n)>=0&&e*(t+e*o/2-i)<=0}function fte(e,t){return BL(e,t+1)}function dte(e,t,r,n,i){for(var o=(n||[]).slice(),s=t.start,u=t.end,f=0,l=1,d=s,p=function(){var b=n?.[f];if(b===void 0)return{v:BL(n,l)};var y=f,w,j=function(){return w===void 0&&(w=r(b,y)),w},O=b.coordinate,E=f===0||Kh(e,O,j,d,u);E||(f=0,d=s,l+=1),E&&(d=O+e*(j()/2+i),f+=l)},m;l<=o.length;)if(m=p(),m)return m.v;return[]}function eu(e){"@babel/helpers - typeof";return eu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},eu(e)}function JT(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ir(e){for(var t=1;t0?g.coordinate-w*e:g.coordinate})}else o[m]=g=ir(ir({},g),{},{tickCoord:g.coordinate});var j=Kh(e,g.tickCoord,y,u,f);j&&(f=g.tickCoord-e*(y()/2+i),o[m]=ir(ir({},g),{},{isShow:!0}))},d=s-1;d>=0;d--)l(d);return o}function gte(e,t,r,n,i,o){var s=(n||[]).slice(),u=s.length,f=t.start,l=t.end;if(o){var d=n[u-1],p=r(d,u-1),m=e*(d.coordinate+e*p/2-l);s[u-1]=d=ir(ir({},d),{},{tickCoord:m>0?d.coordinate-m*e:d.coordinate});var g=Kh(e,d.tickCoord,function(){return p},f,l);g&&(l=d.tickCoord-e*(p/2+i),s[u-1]=ir(ir({},d),{},{isShow:!0}))}for(var b=o?u-1:u,y=function(O){var E=s[O],N,A=function(){return N===void 0&&(N=r(E,O)),N};if(O===0){var C=e*(E.coordinate-e*A()/2-f);s[O]=E=ir(ir({},E),{},{tickCoord:C<0?E.coordinate-C*e:E.coordinate})}else s[O]=E=ir(ir({},E),{},{tickCoord:E.coordinate});var T=Kh(e,E.tickCoord,A,f,l);T&&(f=E.tickCoord+e*(A()/2+i),s[O]=ir(ir({},E),{},{isShow:!0}))},w=0;w=2?ur(i[1].coordinate-i[0].coordinate):1,j=ute(o,w,g);return f==="equidistantPreserveStart"?dte(w,j,y,i,s):(f==="preserveStart"||f==="preserveStartEnd"?m=gte(w,j,y,i,s,f==="preserveStartEnd"):m=vte(w,j,y,i,s),m.filter(function(O){return O.isShow}))}var yte=["viewBox"],xte=["viewBox"],bte=["ticks"];function Ts(e){"@babel/helpers - typeof";return Ts=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ts(e)}function Za(){return Za=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function wte(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Ste(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function tk(e,t){for(var r=0;r0?f(this.props):f(g)),s<=0||u<=0||!b||!b.length?null:F.createElement(rt,{className:We("recharts-cartesian-axis",l),ref:function(w){n.layerReference=w}},o&&this.renderAxisLine(),this.renderTicks(b,this.state.fontSize,this.state.letterSpacing),Vt.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,i,o){var s,u=We(i.className,"recharts-cartesian-axis-tick-value");return F.isValidElement(n)?s=F.cloneElement(n,Lt(Lt({},i),{},{className:u})):ze(n)?s=n(Lt(Lt({},i),{},{className:u})):s=F.createElement(Go,Za({},i,{className:"recharts-cartesian-axis-tick-value"}),o),s}}])})(_.Component);FS(Ys,"displayName","CartesianAxis");FS(Ys,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var Cte=["x1","y1","x2","y2","key"],Nte=["offset"];function Yo(e){"@babel/helpers - typeof";return Yo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yo(e)}function rk(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function or(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Mte(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var Ite=function(t){var r=t.fill;if(!r||r==="none")return null;var n=t.fillOpacity,i=t.x,o=t.y,s=t.width,u=t.height,f=t.ry;return F.createElement("rect",{x:i,y:o,ry:f,width:s,height:u,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function qL(e,t){var r;if(F.isValidElement(e))r=F.cloneElement(e,t);else if(ze(e))r=e(t);else{var n=t.x1,i=t.y1,o=t.x2,s=t.y2,u=t.key,f=nk(t,Cte),l=Le(f,!1);l.offset;var d=nk(l,Nte);r=F.createElement("line",zo({},d,{x1:n,y1:i,x2:o,y2:s,fill:"none",key:u}))}return r}function Dte(e){var t=e.x,r=e.width,n=e.horizontal,i=n===void 0?!0:n,o=e.horizontalPoints;if(!i||!o||!o.length)return null;var s=o.map(function(u,f){var l=or(or({},e),{},{x1:t,y1:u,x2:t+r,y2:u,key:"line-".concat(f),index:f});return qL(i,l)});return F.createElement("g",{className:"recharts-cartesian-grid-horizontal"},s)}function Lte(e){var t=e.y,r=e.height,n=e.vertical,i=n===void 0?!0:n,o=e.verticalPoints;if(!i||!o||!o.length)return null;var s=o.map(function(u,f){var l=or(or({},e),{},{x1:u,y1:t,x2:u,y2:t+r,key:"line-".concat(f),index:f});return qL(i,l)});return F.createElement("g",{className:"recharts-cartesian-grid-vertical"},s)}function $te(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,i=e.y,o=e.width,s=e.height,u=e.horizontalPoints,f=e.horizontal,l=f===void 0?!0:f;if(!l||!t||!t.length)return null;var d=u.map(function(m){return Math.round(m+i-i)}).sort(function(m,g){return m-g});i!==d[0]&&d.unshift(0);var p=d.map(function(m,g){var b=!d[g+1],y=b?i+s-m:d[g+1]-m;if(y<=0)return null;var w=g%t.length;return F.createElement("rect",{key:"react-".concat(g),y:m,x:n,height:y,width:o,stroke:"none",fill:t[w],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return F.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},p)}function Bte(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,i=e.fillOpacity,o=e.x,s=e.y,u=e.width,f=e.height,l=e.verticalPoints;if(!r||!n||!n.length)return null;var d=l.map(function(m){return Math.round(m+o-o)}).sort(function(m,g){return m-g});o!==d[0]&&d.unshift(0);var p=d.map(function(m,g){var b=!d[g+1],y=b?o+u-m:d[g+1]-m;if(y<=0)return null;var w=g%n.length;return F.createElement("rect",{key:"react-".concat(g),x:m,y:s,width:y,height:f,stroke:"none",fill:n[w],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return F.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},p)}var Fte=function(t,r){var n=t.xAxis,i=t.width,o=t.height,s=t.offset;return qD(BS(or(or(or({},Ys.defaultProps),n),{},{ticks:yi(n,!0),viewBox:{x:0,y:0,width:i,height:o}})),s.left,s.left+s.width,r)},zte=function(t,r){var n=t.yAxis,i=t.width,o=t.height,s=t.offset;return qD(BS(or(or(or({},Ys.defaultProps),n),{},{ticks:yi(n,!0),viewBox:{x:0,y:0,width:i,height:o}})),s.top,s.top+s.height,r)},Ba={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function Yh(e){var t,r,n,i,o,s,u=IS(),f=DS(),l=Aee(),d=or(or({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:Ba.stroke,fill:(r=e.fill)!==null&&r!==void 0?r:Ba.fill,horizontal:(n=e.horizontal)!==null&&n!==void 0?n:Ba.horizontal,horizontalFill:(i=e.horizontalFill)!==null&&i!==void 0?i:Ba.horizontalFill,vertical:(o=e.vertical)!==null&&o!==void 0?o:Ba.vertical,verticalFill:(s=e.verticalFill)!==null&&s!==void 0?s:Ba.verticalFill,x:ge(e.x)?e.x:l.left,y:ge(e.y)?e.y:l.top,width:ge(e.width)?e.width:l.width,height:ge(e.height)?e.height:l.height}),p=d.x,m=d.y,g=d.width,b=d.height,y=d.syncWithTicks,w=d.horizontalValues,j=d.verticalValues,O=Oee(),E=Eee();if(!ge(g)||g<=0||!ge(b)||b<=0||!ge(p)||p!==+p||!ge(m)||m!==+m)return null;var N=d.verticalCoordinatesGenerator||Fte,A=d.horizontalCoordinatesGenerator||zte,C=d.horizontalPoints,T=d.verticalPoints;if((!C||!C.length)&&ze(A)){var R=w&&w.length,I=A({yAxis:E?or(or({},E),{},{ticks:R?w:E.ticks}):void 0,width:u,height:f,offset:l},R?!0:y);Tn(Array.isArray(I),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(Yo(I),"]")),Array.isArray(I)&&(C=I)}if((!T||!T.length)&&ze(N)){var z=j&&j.length,$=N({xAxis:O?or(or({},O),{},{ticks:z?j:O.ticks}):void 0,width:u,height:f,offset:l},z?!0:y);Tn(Array.isArray($),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(Yo($),"]")),Array.isArray($)&&(T=$)}return F.createElement("g",{className:"recharts-cartesian-grid"},F.createElement(Ite,{fill:d.fill,fillOpacity:d.fillOpacity,x:d.x,y:d.y,width:d.width,height:d.height,ry:d.ry}),F.createElement(Dte,zo({},d,{offset:l,horizontalPoints:C,xAxis:O,yAxis:E})),F.createElement(Lte,zo({},d,{offset:l,verticalPoints:T,xAxis:O,yAxis:E})),F.createElement($te,zo({},d,{horizontalPoints:C})),F.createElement(Bte,zo({},d,{verticalPoints:T})))}Yh.displayName="CartesianGrid";var qte=["type","layout","connectNulls","ref"],Ute=["key"];function ks(e){"@babel/helpers - typeof";return ks=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ks(e)}function ik(e,t){if(e==null)return{};var r=Wte(e,t),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Wte(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function gc(){return gc=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);rp){g=[].concat(Fa(f.slice(0,b)),[p-y]);break}var w=g.length%2===0?[0,m]:[m];return[].concat(Fa(t.repeat(f,d)),Fa(g),w).map(function(j){return"".concat(j,"px")}).join(", ")}),An(r,"id",Hs("recharts-line-")),An(r,"pathRef",function(s){r.mainCurve=s}),An(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),An(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return ere(t,e),Yte(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();this.setState({totalLength:n})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();n!==this.state.totalLength&&this.setState({totalLength:n})}}},{key:"getTotalLength",value:function(){var n=this.mainCurve;try{return n&&n.getTotalLength&&n.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(n,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var o=this.props,s=o.points,u=o.xAxis,f=o.yAxis,l=o.layout,d=o.children,p=Wr(d,pu);if(!p)return null;var m=function(y,w){return{x:y.x,y:y.y,value:y.value,errorVal:Bt(y.payload,w)}},g={clipPath:n?"url(#clipPath-".concat(i,")"):null};return F.createElement(rt,g,p.map(function(b){return F.cloneElement(b,{key:"bar-".concat(b.props.dataKey),data:s,xAxis:u,yAxis:f,layout:l,dataPointFormatter:m})}))}},{key:"renderDots",value:function(n,i,o){var s=this.props.isAnimationActive;if(s&&!this.state.isAnimationFinished)return null;var u=this.props,f=u.dot,l=u.points,d=u.dataKey,p=Le(this.props,!1),m=Le(f,!0),g=l.map(function(y,w){var j=Ir(Ir(Ir({key:"dot-".concat(w),r:3},p),m),{},{index:w,cx:y.x,cy:y.y,value:y.value,dataKey:d,payload:y.payload,points:l});return t.renderDotItem(f,j)}),b={clipPath:n?"url(#clipPath-".concat(i?"":"dots-").concat(o,")"):null};return F.createElement(rt,gc({className:"recharts-line-dots",key:"dots"},b),g)}},{key:"renderCurveStatically",value:function(n,i,o,s){var u=this.props,f=u.type,l=u.layout,d=u.connectNulls;u.ref;var p=ik(u,qte),m=Ir(Ir(Ir({},Le(p,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(o,")"):null,points:n},s),{},{type:f,layout:l,connectNulls:d});return F.createElement(Ch,gc({},m,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(n,i){var o=this,s=this.props,u=s.points,f=s.strokeDasharray,l=s.isAnimationActive,d=s.animationBegin,p=s.animationDuration,m=s.animationEasing,g=s.animationId,b=s.animateNewValues,y=s.width,w=s.height,j=this.state,O=j.prevPoints,E=j.totalLength;return F.createElement(Zn,{begin:d,duration:p,isActive:l,easing:m,from:{t:0},to:{t:1},key:"line-".concat(g),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(N){var A=N.t;if(O){var C=O.length/u.length,T=u.map(function(L,U){var W=Math.floor(U*C);if(O[W]){var V=O[W],G=Fr(V.x,L.x),Y=Fr(V.y,L.y);return Ir(Ir({},L),{},{x:G(A),y:Y(A)})}if(b){var D=Fr(y*2,L.x),Q=Fr(w/2,L.y);return Ir(Ir({},L),{},{x:D(A),y:Q(A)})}return Ir(Ir({},L),{},{x:L.x,y:L.y})});return o.renderCurveStatically(T,n,i)}var R=Fr(0,E),I=R(A),z;if(f){var $="".concat(f).split(/[,\s]+/gim).map(function(L){return parseFloat(L)});z=o.getStrokeDasharray(I,E,$)}else z=o.generateSimpleStrokeDasharray(E,I);return o.renderCurveStatically(u,n,i,{strokeDasharray:z})})}},{key:"renderCurve",value:function(n,i){var o=this.props,s=o.points,u=o.isAnimationActive,f=this.state,l=f.prevPoints,d=f.totalLength;return u&&s&&s.length&&(!l&&d>0||!hu(l,s))?this.renderCurveWithAnimation(n,i):this.renderCurveStatically(s,n,i)}},{key:"render",value:function(){var n,i=this.props,o=i.hide,s=i.dot,u=i.points,f=i.className,l=i.xAxis,d=i.yAxis,p=i.top,m=i.left,g=i.width,b=i.height,y=i.isAnimationActive,w=i.id;if(o||!u||!u.length)return null;var j=this.state.isAnimationFinished,O=u.length===1,E=We("recharts-line",f),N=l&&l.allowDataOverflow,A=d&&d.allowDataOverflow,C=N||A,T=Ue(w)?this.id:w,R=(n=Le(s,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},I=R.r,z=I===void 0?3:I,$=R.strokeWidth,L=$===void 0?2:$,U=Nq(s)?s:{},W=U.clipDot,V=W===void 0?!0:W,G=z*2+L;return F.createElement(rt,{className:E},N||A?F.createElement("defs",null,F.createElement("clipPath",{id:"clipPath-".concat(T)},F.createElement("rect",{x:N?m:m-g/2,y:A?p:p-b/2,width:N?g:g*2,height:A?b:b*2})),!V&&F.createElement("clipPath",{id:"clipPath-dots-".concat(T)},F.createElement("rect",{x:m-G/2,y:p-G/2,width:g+G,height:b+G}))):null,!O&&this.renderCurve(C,T),this.renderErrorBar(C,T),(O||s)&&this.renderDots(C,V,T),(!y||j)&&wi.renderCallByParent(this.props,u))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,prevPoints:i.curPoints}:n.points!==i.curPoints?{curPoints:n.points}:null}},{key:"repeat",value:function(n,i){for(var o=n.length%2!==0?[].concat(Fa(n),[0]):n,s=[],u=0;ue.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Wre(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Hre(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Vre(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?s:t&&t.length&&ge(i)&&ge(o)?t.slice(i,o+1):[]};function n$(e){return e==="number"?[0,"auto"]:void 0}var cw=function(t,r,n,i){var o=t.graphicalItems,s=t.tooltipAxis,u=Yp(r,t);return n<0||!o||!o.length||n>=u.length?null:o.reduce(function(f,l){var d,p=(d=l.props.data)!==null&&d!==void 0?d:r;p&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(p=p.slice(t.dataStartIndex,t.dataEndIndex+1));var m;if(s.dataKey&&!s.allowDuplicatedCategory){var g=p===void 0?u:p;m=Jd(g,s.dataKey,i)}else m=p&&p[n]||u[n];return m?[].concat(Ds(f),[GD(l,m)]):f},[])},hk=function(t,r,n,i){var o=i||{x:t.chartX,y:t.chartY},s=ine(o,n),u=t.orderedTooltipTicks,f=t.tooltipAxis,l=t.tooltipTicks,d=PK(s,u,l,f);if(d>=0&&l){var p=l[d]&&l[d].value,m=cw(t,r,d,p),g=one(n,u,d,o);return{activeTooltipIndex:d,activeLabel:p,activePayload:m,activeCoordinate:g}}return null},ane=function(t,r){var n=r.axes,i=r.graphicalItems,o=r.axisType,s=r.axisIdKey,u=r.stackGroups,f=r.dataStartIndex,l=r.dataEndIndex,d=t.layout,p=t.children,m=t.stackOffset,g=zD(d,o);return n.reduce(function(b,y){var w,j=y.type.defaultProps!==void 0?ae(ae({},y.type.defaultProps),y.props):y.props,O=j.type,E=j.dataKey,N=j.allowDataOverflow,A=j.allowDuplicatedCategory,C=j.scale,T=j.ticks,R=j.includeHidden,I=j[s];if(b[I])return b;var z=Yp(t.data,{graphicalItems:i.filter(function(B){var Z,te=s in B.props?B.props[s]:(Z=B.type.defaultProps)===null||Z===void 0?void 0:Z[s];return te===I}),dataStartIndex:f,dataEndIndex:l}),$=z.length,L,U,W;kre(j.domain,N,O)&&(L=_1(j.domain,null,N),g&&(O==="number"||C!=="auto")&&(W=hc(z,E,"category")));var V=n$(O);if(!L||L.length===0){var G,Y=(G=j.domain)!==null&&G!==void 0?G:V;if(E){if(L=hc(z,E,O),O==="category"&&g){var D=bq(L);A&&D?(U=L,L=Fh(0,$)):A||(L=mN(Y,L,y).reduce(function(B,Z){return B.indexOf(Z)>=0?B:[].concat(Ds(B),[Z])},[]))}else if(O==="category")A?L=L.filter(function(B){return B!==""&&!Ue(B)}):L=mN(Y,L,y).reduce(function(B,Z){return B.indexOf(Z)>=0||Z===""||Ue(Z)?B:[].concat(Ds(B),[Z])},[]);else if(O==="number"){var Q=kK(z,i.filter(function(B){var Z,te,ve=s in B.props?B.props[s]:(Z=B.type.defaultProps)===null||Z===void 0?void 0:Z[s],xe="hide"in B.props?B.props.hide:(te=B.type.defaultProps)===null||te===void 0?void 0:te.hide;return ve===I&&(R||!xe)}),E,o,d);Q&&(L=Q)}g&&(O==="number"||C!=="auto")&&(W=hc(z,E,"category"))}else g?L=Fh(0,$):u&&u[I]&&u[I].hasStack&&O==="number"?L=m==="expand"?[0,1]:VD(u[I].stackGroups,f,l):L=FD(z,i.filter(function(B){var Z=s in B.props?B.props[s]:B.type.defaultProps[s],te="hide"in B.props?B.props.hide:B.type.defaultProps.hide;return Z===I&&(R||!te)}),O,d,!0);if(O==="number")L=aw(p,L,I,o,T),Y&&(L=_1(Y,L,N));else if(O==="category"&&Y){var J=Y,M=L.every(function(B){return J.indexOf(B)>=0});M&&(L=J)}}return ae(ae({},b),{},Be({},I,ae(ae({},j),{},{axisType:o,domain:L,categoricalDomain:W,duplicateDomain:U,originalDomain:(w=j.domain)!==null&&w!==void 0?w:V,isCategorical:g,layout:d})))},{})},sne=function(t,r){var n=r.graphicalItems,i=r.Axis,o=r.axisType,s=r.axisIdKey,u=r.stackGroups,f=r.dataStartIndex,l=r.dataEndIndex,d=t.layout,p=t.children,m=Yp(t.data,{graphicalItems:n,dataStartIndex:f,dataEndIndex:l}),g=m.length,b=zD(d,o),y=-1;return n.reduce(function(w,j){var O=j.type.defaultProps!==void 0?ae(ae({},j.type.defaultProps),j.props):j.props,E=O[s],N=n$("number");if(!w[E]){y++;var A;return b?A=Fh(0,g):u&&u[E]&&u[E].hasStack?(A=VD(u[E].stackGroups,f,l),A=aw(p,A,E,o)):(A=_1(N,FD(m,n.filter(function(C){var T,R,I=s in C.props?C.props[s]:(T=C.type.defaultProps)===null||T===void 0?void 0:T[s],z="hide"in C.props?C.props.hide:(R=C.type.defaultProps)===null||R===void 0?void 0:R.hide;return I===E&&!z}),"number",d),i.defaultProps.allowDataOverflow),A=aw(p,A,E,o)),ae(ae({},w),{},Be({},E,ae(ae({axisType:o},i.defaultProps),{},{hide:!0,orientation:Ur(rne,"".concat(o,".").concat(y%2),null),domain:A,originalDomain:N,isCategorical:b,layout:d})))}return w},{})},lne=function(t,r){var n=r.axisType,i=n===void 0?"xAxis":n,o=r.AxisComp,s=r.graphicalItems,u=r.stackGroups,f=r.dataStartIndex,l=r.dataEndIndex,d=t.children,p="".concat(i,"Id"),m=Wr(d,o),g={};return m&&m.length?g=ane(t,{axes:m,graphicalItems:s,axisType:i,axisIdKey:p,stackGroups:u,dataStartIndex:f,dataEndIndex:l}):s&&s.length&&(g=sne(t,{Axis:o,graphicalItems:s,axisType:i,axisIdKey:p,stackGroups:u,dataStartIndex:f,dataEndIndex:l})),g},cne=function(t){var r=to(t),n=yi(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:iS(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:Eh(r,n)}},pk=function(t){var r=t.children,n=t.defaultShowTooltip,i=Lr(r,Es),o=0,s=0;return t.data&&t.data.length!==0&&(s=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(o=i.props.startIndex),i.props.endIndex>=0&&(s=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:s,activeTooltipIndex:-1,isTooltipActive:!!n}},une=function(t){return!t||!t.length?!1:t.some(function(r){var n=xi(r&&r.type);return n&&n.indexOf("Bar")>=0})},mk=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},fne=function(t,r){var n=t.props,i=t.graphicalItems,o=t.xAxisMap,s=o===void 0?{}:o,u=t.yAxisMap,f=u===void 0?{}:u,l=n.width,d=n.height,p=n.children,m=n.margin||{},g=Lr(p,Es),b=Lr(p,rs),y=Object.keys(f).reduce(function(A,C){var T=f[C],R=T.orientation;return!T.mirror&&!T.hide?ae(ae({},A),{},Be({},R,A[R]+T.width)):A},{left:m.left||0,right:m.right||0}),w=Object.keys(s).reduce(function(A,C){var T=s[C],R=T.orientation;return!T.mirror&&!T.hide?ae(ae({},A),{},Be({},R,Ur(A,"".concat(R))+T.height)):A},{top:m.top||0,bottom:m.bottom||0}),j=ae(ae({},w),y),O=j.bottom;g&&(j.bottom+=g.props.height||Es.defaultProps.height),b&&r&&(j=NK(j,i,n,r));var E=l-j.left-j.right,N=d-j.top-j.bottom;return ae(ae({brushBottom:O},j),{},{width:Math.max(E,0),height:Math.max(N,0)})},dne=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},zS=function(t){var r=t.chartName,n=t.GraphicalChild,i=t.defaultTooltipEventType,o=i===void 0?"axis":i,s=t.validateTooltipEventTypes,u=s===void 0?["axis"]:s,f=t.axisComponents,l=t.legendContent,d=t.formatAxisMap,p=t.defaultProps,m=function(j,O){var E=O.graphicalItems,N=O.stackGroups,A=O.offset,C=O.updateId,T=O.dataStartIndex,R=O.dataEndIndex,I=j.barSize,z=j.layout,$=j.barGap,L=j.barCategoryGap,U=j.maxBarSize,W=mk(z),V=W.numericAxisName,G=W.cateAxisName,Y=une(E),D=[];return E.forEach(function(Q,J){var M=Yp(j.data,{graphicalItems:[Q],dataStartIndex:T,dataEndIndex:R}),B=Q.type.defaultProps!==void 0?ae(ae({},Q.type.defaultProps),Q.props):Q.props,Z=B.dataKey,te=B.maxBarSize,ve=B["".concat(V,"Id")],xe=B["".concat(G,"Id")],X={},ue=f.reduce(function(Kt,Xt){var fa=O["".concat(Xt.axisType,"Map")],rl=B["".concat(Xt.axisType,"Id")];fa&&fa[rl]||Xt.axisType==="zAxis"||Xo();var nl=fa[rl];return ae(ae({},Kt),{},Be(Be({},Xt.axisType,nl),"".concat(Xt.axisType,"Ticks"),yi(nl)))},X),ie=ue[G],de=ue["".concat(G,"Ticks")],ye=N&&N[ve]&&N[ve].hasStack&&zK(Q,N[ve].stackGroups),oe=xi(Q.type).indexOf("Bar")>=0,$e=Eh(ie,de),Me=[],Ye=Y&&AK({barSize:I,stackGroups:N,totalSize:dne(ue,G)});if(oe){var lt,vt,vr=Ue(te)?U:te,Pr=(lt=(vt=Eh(ie,de,!0))!==null&&vt!==void 0?vt:vr)!==null&<!==void 0?lt:0;Me=CK({barGap:$,barCategoryGap:L,bandSize:Pr!==$e?Pr:$e,sizeList:Ye[xe],maxBarSize:vr}),Pr!==$e&&(Me=Me.map(function(Kt){return ae(ae({},Kt),{},{position:ae(ae({},Kt.position),{},{offset:Kt.position.offset-Pr/2})})}))}var Ar=Q&&Q.type&&Q.type.getComposedData;Ar&&D.push({props:ae(ae({},Ar(ae(ae({},ue),{},{displayedData:M,props:j,dataKey:Z,item:Q,bandSize:$e,barPosition:Me,offset:A,stackedData:ye,layout:z,dataStartIndex:T,dataEndIndex:R}))),{},Be(Be(Be({key:Q.key||"item-".concat(J)},V,ue[V]),G,ue[G]),"animationId",C)),childIndex:Rq(Q,j.children),item:Q})}),D},g=function(j,O){var E=j.props,N=j.dataStartIndex,A=j.dataEndIndex,C=j.updateId;if(!C2({props:E}))return null;var T=E.children,R=E.layout,I=E.stackOffset,z=E.data,$=E.reverseStackOrder,L=mk(R),U=L.numericAxisName,W=L.cateAxisName,V=Wr(T,n),G=BK(z,V,"".concat(U,"Id"),"".concat(W,"Id"),I,$),Y=f.reduce(function(B,Z){var te="".concat(Z.axisType,"Map");return ae(ae({},B),{},Be({},te,lne(E,ae(ae({},Z),{},{graphicalItems:V,stackGroups:Z.axisType===U&&G,dataStartIndex:N,dataEndIndex:A}))))},{}),D=fne(ae(ae({},Y),{},{props:E,graphicalItems:V}),O?.legendBBox);Object.keys(Y).forEach(function(B){Y[B]=d(E,Y[B],D,B.replace("Map",""),r)});var Q=Y["".concat(W,"Map")],J=cne(Q),M=m(E,ae(ae({},Y),{},{dataStartIndex:N,dataEndIndex:A,updateId:C,graphicalItems:V,stackGroups:G,offset:D}));return ae(ae({formattedGraphicalItems:M,graphicalItems:V,offset:D,stackGroups:G},J),Y)},b=(function(w){function j(O){var E,N,A;return Hre(this,j),A=Kre(this,j,[O]),Be(A,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Be(A,"accessibilityManager",new Tre),Be(A,"handleLegendBBoxUpdate",function(C){if(C){var T=A.state,R=T.dataStartIndex,I=T.dataEndIndex,z=T.updateId;A.setState(ae({legendBBox:C},g({props:A.props,dataStartIndex:R,dataEndIndex:I,updateId:z},ae(ae({},A.state),{},{legendBBox:C}))))}}),Be(A,"handleReceiveSyncEvent",function(C,T,R){if(A.props.syncId===C){if(R===A.eventEmitterSymbol&&typeof A.props.syncMethod!="function")return;A.applySyncEvent(T)}}),Be(A,"handleBrushChange",function(C){var T=C.startIndex,R=C.endIndex;if(T!==A.state.dataStartIndex||R!==A.state.dataEndIndex){var I=A.state.updateId;A.setState(function(){return ae({dataStartIndex:T,dataEndIndex:R},g({props:A.props,dataStartIndex:T,dataEndIndex:R,updateId:I},A.state))}),A.triggerSyncEvent({dataStartIndex:T,dataEndIndex:R})}}),Be(A,"handleMouseEnter",function(C){var T=A.getMouseInfo(C);if(T){var R=ae(ae({},T),{},{isTooltipActive:!0});A.setState(R),A.triggerSyncEvent(R);var I=A.props.onMouseEnter;ze(I)&&I(R,C)}}),Be(A,"triggeredAfterMouseMove",function(C){var T=A.getMouseInfo(C),R=T?ae(ae({},T),{},{isTooltipActive:!0}):{isTooltipActive:!1};A.setState(R),A.triggerSyncEvent(R);var I=A.props.onMouseMove;ze(I)&&I(R,C)}),Be(A,"handleItemMouseEnter",function(C){A.setState(function(){return{isTooltipActive:!0,activeItem:C,activePayload:C.tooltipPayload,activeCoordinate:C.tooltipPosition||{x:C.cx,y:C.cy}}})}),Be(A,"handleItemMouseLeave",function(){A.setState(function(){return{isTooltipActive:!1}})}),Be(A,"handleMouseMove",function(C){C.persist(),A.throttleTriggeredAfterMouseMove(C)}),Be(A,"handleMouseLeave",function(C){A.throttleTriggeredAfterMouseMove.cancel();var T={isTooltipActive:!1};A.setState(T),A.triggerSyncEvent(T);var R=A.props.onMouseLeave;ze(R)&&R(T,C)}),Be(A,"handleOuterEvent",function(C){var T=kq(C),R=Ur(A.props,"".concat(T));if(T&&ze(R)){var I,z;/.*touch.*/i.test(T)?z=A.getMouseInfo(C.changedTouches[0]):z=A.getMouseInfo(C),R((I=z)!==null&&I!==void 0?I:{},C)}}),Be(A,"handleClick",function(C){var T=A.getMouseInfo(C);if(T){var R=ae(ae({},T),{},{isTooltipActive:!0});A.setState(R),A.triggerSyncEvent(R);var I=A.props.onClick;ze(I)&&I(R,C)}}),Be(A,"handleMouseDown",function(C){var T=A.props.onMouseDown;if(ze(T)){var R=A.getMouseInfo(C);T(R,C)}}),Be(A,"handleMouseUp",function(C){var T=A.props.onMouseUp;if(ze(T)){var R=A.getMouseInfo(C);T(R,C)}}),Be(A,"handleTouchMove",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&A.throttleTriggeredAfterMouseMove(C.changedTouches[0])}),Be(A,"handleTouchStart",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&A.handleMouseDown(C.changedTouches[0])}),Be(A,"handleTouchEnd",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&A.handleMouseUp(C.changedTouches[0])}),Be(A,"handleDoubleClick",function(C){var T=A.props.onDoubleClick;if(ze(T)){var R=A.getMouseInfo(C);T(R,C)}}),Be(A,"handleContextMenu",function(C){var T=A.props.onContextMenu;if(ze(T)){var R=A.getMouseInfo(C);T(R,C)}}),Be(A,"triggerSyncEvent",function(C){A.props.syncId!==void 0&&bb.emit(wb,A.props.syncId,C,A.eventEmitterSymbol)}),Be(A,"applySyncEvent",function(C){var T=A.props,R=T.layout,I=T.syncMethod,z=A.state.updateId,$=C.dataStartIndex,L=C.dataEndIndex;if(C.dataStartIndex!==void 0||C.dataEndIndex!==void 0)A.setState(ae({dataStartIndex:$,dataEndIndex:L},g({props:A.props,dataStartIndex:$,dataEndIndex:L,updateId:z},A.state)));else if(C.activeTooltipIndex!==void 0){var U=C.chartX,W=C.chartY,V=C.activeTooltipIndex,G=A.state,Y=G.offset,D=G.tooltipTicks;if(!Y)return;if(typeof I=="function")V=I(D,C);else if(I==="value"){V=-1;for(var Q=0;Q=0){var ye,oe;if(U.dataKey&&!U.allowDuplicatedCategory){var $e=typeof U.dataKey=="function"?de:"payload.".concat(U.dataKey.toString());ye=Jd(Q,$e,V),oe=J&&M&&Jd(M,$e,V)}else ye=Q?.[W],oe=J&&M&&M[W];if(xe||ve){var Me=C.props.activeIndex!==void 0?C.props.activeIndex:W;return[_.cloneElement(C,ae(ae(ae({},I.props),ue),{},{activeIndex:Me})),null,null]}if(!Ue(ye))return[ie].concat(Ds(A.renderActivePoints({item:I,activePoint:ye,basePoint:oe,childIndex:W,isRange:J})))}else{var Ye,lt=(Ye=A.getItemByXY(A.state.activeCoordinate))!==null&&Ye!==void 0?Ye:{graphicalItem:ie},vt=lt.graphicalItem,vr=vt.item,Pr=vr===void 0?C:vr,Ar=vt.childIndex,Kt=ae(ae(ae({},I.props),ue),{},{activeIndex:Ar});return[_.cloneElement(Pr,Kt),null,null]}return J?[ie,null,null]:[ie,null]}),Be(A,"renderCustomized",function(C,T,R){return _.cloneElement(C,ae(ae({key:"recharts-customized-".concat(R)},A.props),A.state))}),Be(A,"renderMap",{CartesianGrid:{handler:Qf,once:!0},ReferenceArea:{handler:A.renderReferenceElement},ReferenceLine:{handler:Qf},ReferenceDot:{handler:A.renderReferenceElement},XAxis:{handler:Qf},YAxis:{handler:Qf},Brush:{handler:A.renderBrush,once:!0},Bar:{handler:A.renderGraphicChild},Line:{handler:A.renderGraphicChild},Area:{handler:A.renderGraphicChild},Radar:{handler:A.renderGraphicChild},RadialBar:{handler:A.renderGraphicChild},Scatter:{handler:A.renderGraphicChild},Pie:{handler:A.renderGraphicChild},Funnel:{handler:A.renderGraphicChild},Tooltip:{handler:A.renderCursor,once:!0},PolarGrid:{handler:A.renderPolarGrid,once:!0},PolarAngleAxis:{handler:A.renderPolarAxis},PolarRadiusAxis:{handler:A.renderPolarAxis},Customized:{handler:A.renderCustomized}}),A.clipPathId="".concat((E=O.id)!==null&&E!==void 0?E:Hs("recharts"),"-clip"),A.throttleTriggeredAfterMouseMove=$I(A.triggeredAfterMouseMove,(N=O.throttleDelay)!==null&&N!==void 0?N:1e3/60),A.state={},A}return Qre(j,w),Gre(j,[{key:"componentDidMount",value:function(){var E,N;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(E=this.props.margin.left)!==null&&E!==void 0?E:0,top:(N=this.props.margin.top)!==null&&N!==void 0?N:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var E=this.props,N=E.children,A=E.data,C=E.height,T=E.layout,R=Lr(N,Br);if(R){var I=R.props.defaultIndex;if(!(typeof I!="number"||I<0||I>this.state.tooltipTicks.length-1)){var z=this.state.tooltipTicks[I]&&this.state.tooltipTicks[I].value,$=cw(this.state,A,I,z),L=this.state.tooltipTicks[I].coordinate,U=(this.state.offset.top+C)/2,W=T==="horizontal",V=W?{x:L,y:U}:{y:L,x:U},G=this.state.formattedGraphicalItems.find(function(D){var Q=D.item;return Q.type.name==="Scatter"});G&&(V=ae(ae({},V),G.props.points[I].tooltipPosition),$=G.props.points[I].tooltipPayload);var Y={activeTooltipIndex:I,isTooltipActive:!0,activeLabel:z,activePayload:$,activeCoordinate:V};this.setState(Y),this.renderCursor(R),this.accessibilityManager.setIndex(I)}}}},{key:"getSnapshotBeforeUpdate",value:function(E,N){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==N.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==E.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==E.margin){var A,C;this.accessibilityManager.setDetails({offset:{left:(A=this.props.margin.left)!==null&&A!==void 0?A:0,top:(C=this.props.margin.top)!==null&&C!==void 0?C:0}})}return null}},{key:"componentDidUpdate",value:function(E){Hb([Lr(E.children,Br)],[Lr(this.props.children,Br)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var E=Lr(this.props.children,Br);if(E&&typeof E.props.shared=="boolean"){var N=E.props.shared?"axis":"item";return u.indexOf(N)>=0?N:o}return o}},{key:"getMouseInfo",value:function(E){if(!this.container)return null;var N=this.container,A=N.getBoundingClientRect(),C=xW(A),T={chartX:Math.round(E.pageX-C.left),chartY:Math.round(E.pageY-C.top)},R=A.width/N.offsetWidth||1,I=this.inRange(T.chartX,T.chartY,R);if(!I)return null;var z=this.state,$=z.xAxisMap,L=z.yAxisMap,U=this.getTooltipEventType(),W=hk(this.state,this.props.data,this.props.layout,I);if(U!=="axis"&&$&&L){var V=to($).scale,G=to(L).scale,Y=V&&V.invert?V.invert(T.chartX):null,D=G&&G.invert?G.invert(T.chartY):null;return ae(ae({},T),{},{xValue:Y,yValue:D},W)}return W?ae(ae({},T),W):null}},{key:"inRange",value:function(E,N){var A=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,C=this.props.layout,T=E/A,R=N/A;if(C==="horizontal"||C==="vertical"){var I=this.state.offset,z=T>=I.left&&T<=I.left+I.width&&R>=I.top&&R<=I.top+I.height;return z?{x:T,y:R}:null}var $=this.state,L=$.angleAxisMap,U=$.radiusAxisMap;if(L&&U){var W=to(L);return yN({x:T,y:R},W)}return null}},{key:"parseEventsOfWrapper",value:function(){var E=this.props.children,N=this.getTooltipEventType(),A=Lr(E,Br),C={};A&&N==="axis"&&(A.props.trigger==="click"?C={onClick:this.handleClick}:C={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var T=eh(this.props,this.handleOuterEvent);return ae(ae({},T),C)}},{key:"addListener",value:function(){bb.on(wb,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){bb.removeListener(wb,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(E,N,A){for(var C=this.state.formattedGraphicalItems,T=0,R=C.length;Th.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-lg border border-gray-100 hover:bg-gray-100 transition-colors",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("div",{className:"w-10 h-10 rounded-full bg-blue-100 flex items-center justify-center text-blue-600 font-bold text-xs",children:e.template.substring(0,2)}),h.jsxs("div",{children:[h.jsx("p",{className:"text-sm font-semibold text-gray-900",children:e.product}),h.jsxs("p",{className:"text-xs text-gray-500",children:[e.id," • ",e.user]})]})]}),h.jsxs("div",{className:"flex items-center gap-4",children:[h.jsx("span",{className:"text-xs text-gray-500 font-medium",children:e.time}),h.jsx(Cn,{variant:"secondary",className:e.status==="expired"?"bg-red-100 text-red-700":"bg-green-100 text-green-700",children:e.status})]})]},e.id))})})]})]}),h.jsx("div",{className:"space-y-6",children:h.jsxs($r,{className:"shadow-sm border-gray-200",children:[h.jsx(On,{children:h.jsxs(En,{className:"text-base font-bold text-gray-800 flex items-center gap-2",children:[h.jsx(Hd,{className:"w-5 h-5 text-gray-500"}),"By Category"]})}),h.jsxs(nn,{children:[h.jsxs("div",{className:"h-[200px] relative",children:[h.jsx(uh,{width:"100%",height:"100%",children:h.jsxs(pne,{children:[h.jsx(Ti,{data:_b,cx:"50%",cy:"50%",innerRadius:60,outerRadius:80,paddingAngle:5,dataKey:"value",children:_b.map((e,t)=>h.jsx(Ep,{fill:e.color},`cell-${t}`))}),h.jsx(Br,{})]})}),h.jsxs("div",{className:"absolute inset-0 flex items-center justify-center flex-col pointer-events-none",children:[h.jsx("span",{className:"text-2xl font-bold text-gray-900",children:"1000"}),h.jsx("span",{className:"text-xs text-gray-500",children:"Total"})]})]}),h.jsx("div",{className:"mt-4 space-y-2",children:_b.map(e=>h.jsxs("div",{className:"flex items-center justify-between text-sm",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:e.color}}),h.jsx("span",{className:"text-gray-600",children:e.name})]}),h.jsx("span",{className:"font-medium text-gray-900",children:e.value})]},e.name))})]})]})})]})]})}function za({title:e,value:t,trend:r,trendUp:n,icon:i,color:o,bgColor:s}){return h.jsx($r,{className:"border-gray-200 shadow-sm hover:shadow-md transition-shadow",children:h.jsxs(nn,{className:"p-6",children:[h.jsxs("div",{className:"flex justify-between items-start",children:[h.jsxs("div",{children:[h.jsx("p",{className:"text-sm font-medium text-gray-500 mb-1",children:e}),h.jsx("h3",{className:"text-2xl font-bold text-gray-900",children:t})]}),h.jsx("div",{className:`p-2 rounded-lg ${s}`,children:h.jsx(i,{className:`w-5 h-5 ${o}`})})]}),h.jsxs("div",{className:"mt-4 flex items-center text-sm",children:[n?h.jsx(XR,{className:"w-4 h-4 text-green-500 mr-1"}):h.jsx(v8,{className:"w-4 h-4 text-red-500 mr-1"}),h.jsx("span",{className:n?"text-green-600 font-medium":"text-red-600 font-medium",children:r}),h.jsx("span",{className:"text-gray-400 ml-1",children:"Vs. last period"})]})]})})}function yne({title:e}){return h.jsxs("div",{className:"space-y-6",children:[h.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:[1,2,3,4].map(t=>h.jsxs($r,{children:[h.jsx(On,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:h.jsxs(En,{className:"text-sm font-medium",children:["Metric ",t]})}),h.jsxs(nn,{children:[h.jsx("div",{className:"text-2xl font-bold",children:"000"}),h.jsx("p",{className:"text-xs text-muted-foreground",children:"+0.0% from last month"})]})]},t))}),h.jsx($r,{className:"min-h-[400px] flex items-center justify-center border-dashed",children:h.jsxs("div",{className:"text-center text-muted-foreground",children:[h.jsxs("h3",{className:"text-lg font-medium",children:[e," Module"]}),h.jsx("p",{children:"This module is currently under development."})]})})]})}function hr({className:e,...t}){return h.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:h.jsx("table",{"data-slot":"table",className:Te("w-full caption-bottom text-sm",e),...t})})}function pr({className:e,...t}){return h.jsx("thead",{"data-slot":"table-header",className:Te("[&_tr]:border-b",e),...t})}function mr({className:e,...t}){return h.jsx("tbody",{"data-slot":"table-body",className:Te("[&_tr:last-child]:border-0",e),...t})}function Ke({className:e,...t}){return h.jsx("tr",{"data-slot":"table-row",className:Te("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function me({className:e,...t}){return h.jsx("th",{"data-slot":"table-head",className:Te("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function se({className:e,...t}){return h.jsx("td",{"data-slot":"table-cell",className:Te("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function vk(e){const t=xne(e),r=_.forwardRef((n,i)=>{const{children:o,...s}=n,u=_.Children.toArray(o),f=u.find(wne);if(f){const l=f.props.children,d=u.map(p=>p===f?_.Children.count(l)>1?_.Children.only(null):_.isValidElement(l)?l.props.children:null:p);return h.jsx(t,{...s,ref:i,children:_.isValidElement(l)?_.cloneElement(l,void 0,d):null})}return h.jsx(t,{...s,ref:i,children:o})});return r.displayName=`${e}.Slot`,r}function xne(e){const t=_.forwardRef((r,n)=>{const{children:i,...o}=r;if(_.isValidElement(i)){const s=_ne(i),u=Sne(o,i.props);return i.type!==_.Fragment&&(u.ref=n?ia(n,s):s),_.cloneElement(i,u)}return _.Children.count(i)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var bne=Symbol("radix.slottable");function wne(e){return _.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===bne}function Sne(e,t){const r={...t};for(const n in t){const i=e[n],o=t[n];/^on[A-Z]/.test(n)?i&&o?r[n]=(...u)=>{const f=o(...u);return i(...u),f}:i&&(r[n]=i):n==="style"?r[n]={...i,...o}:n==="className"&&(r[n]=[i,o].filter(Boolean).join(" "))}return{...e,...r}}function _ne(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function o$(e){const t=e+"CollectionProvider",[r,n]=In(t),[i,o]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=y=>{const{scope:w,children:j}=y,O=F.useRef(null),E=F.useRef(new Map).current;return h.jsx(i,{scope:w,itemMap:E,collectionRef:O,children:j})};s.displayName=t;const u=e+"CollectionSlot",f=vk(u),l=F.forwardRef((y,w)=>{const{scope:j,children:O}=y,E=o(u,j),N=Xe(w,E.collectionRef);return h.jsx(f,{ref:N,children:O})});l.displayName=u;const d=e+"CollectionItemSlot",p="data-radix-collection-item",m=vk(d),g=F.forwardRef((y,w)=>{const{scope:j,children:O,...E}=y,N=F.useRef(null),A=Xe(w,N),C=o(d,j);return F.useEffect(()=>(C.itemMap.set(N,{ref:N,...E}),()=>void C.itemMap.delete(N))),h.jsx(m,{[p]:"",ref:A,children:O})});g.displayName=d;function b(y){const w=o(e+"CollectionConsumer",y);return F.useCallback(()=>{const O=w.collectionRef.current;if(!O)return[];const E=Array.from(O.querySelectorAll(`[${p}]`));return Array.from(w.itemMap.values()).sort((C,T)=>E.indexOf(C.ref.current)-E.indexOf(T.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:s,Slot:l,ItemSlot:g},b,n]}function jne(e,t=globalThis?.document){const r=ar(e);_.useEffect(()=>{const n=i=>{i.key==="Escape"&&r(i)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var One="DismissableLayer",uw="dismissableLayer.update",Ene="dismissableLayer.pointerDownOutside",Pne="dismissableLayer.focusOutside",gk,a$=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),mu=_.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:s,onDismiss:u,...f}=e,l=_.useContext(a$),[d,p]=_.useState(null),m=d?.ownerDocument??globalThis?.document,[,g]=_.useState({}),b=Xe(t,T=>p(T)),y=Array.from(l.layers),[w]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),j=y.indexOf(w),O=d?y.indexOf(d):-1,E=l.layersWithOutsidePointerEventsDisabled.size>0,N=O>=j,A=Nne(T=>{const R=T.target,I=[...l.branches].some(z=>z.contains(R));!N||I||(i?.(T),s?.(T),T.defaultPrevented||u?.())},m),C=Tne(T=>{const R=T.target;[...l.branches].some(z=>z.contains(R))||(o?.(T),s?.(T),T.defaultPrevented||u?.())},m);return jne(T=>{O===l.layers.size-1&&(n?.(T),!T.defaultPrevented&&u&&(T.preventDefault(),u()))},m),_.useEffect(()=>{if(d)return r&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(gk=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(d)),l.layers.add(d),yk(),()=>{r&&l.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=gk)}},[d,m,r,l]),_.useEffect(()=>()=>{d&&(l.layers.delete(d),l.layersWithOutsidePointerEventsDisabled.delete(d),yk())},[d,l]),_.useEffect(()=>{const T=()=>g({});return document.addEventListener(uw,T),()=>document.removeEventListener(uw,T)},[]),h.jsx(qe.div,{...f,ref:b,style:{pointerEvents:E?N?"auto":"none":void 0,...e.style},onFocusCapture:ke(e.onFocusCapture,C.onFocusCapture),onBlurCapture:ke(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:ke(e.onPointerDownCapture,A.onPointerDownCapture)})});mu.displayName=One;var Ane="DismissableLayerBranch",Cne=_.forwardRef((e,t)=>{const r=_.useContext(a$),n=_.useRef(null),i=Xe(t,n);return _.useEffect(()=>{const o=n.current;if(o)return r.branches.add(o),()=>{r.branches.delete(o)}},[r.branches]),h.jsx(qe.div,{...e,ref:i})});Cne.displayName=Ane;function Nne(e,t=globalThis?.document){const r=ar(e),n=_.useRef(!1),i=_.useRef(()=>{});return _.useEffect(()=>{const o=u=>{if(u.target&&!n.current){let f=function(){s$(Ene,r,l,{discrete:!0})};const l={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=f,t.addEventListener("click",i.current,{once:!0})):f()}else t.removeEventListener("click",i.current);n.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function Tne(e,t=globalThis?.document){const r=ar(e),n=_.useRef(!1);return _.useEffect(()=>{const i=o=>{o.target&&!n.current&&s$(Pne,r,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function yk(){const e=new CustomEvent(uw);document.dispatchEvent(e)}function s$(e,t,r,{discrete:n}){const i=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&i.addEventListener(e,t,{once:!0}),n?IF(i,o):i.dispatchEvent(o)}var jb=0;function qS(){_.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??xk()),document.body.insertAdjacentElement("beforeend",e[1]??xk()),jb++,()=>{jb===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),jb--}},[])}function xk(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ob="focusScope.autoFocusOnMount",Eb="focusScope.autoFocusOnUnmount",bk={bubbles:!1,cancelable:!0},kne="FocusScope",Qp=_.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=e,[u,f]=_.useState(null),l=ar(i),d=ar(o),p=_.useRef(null),m=Xe(t,y=>f(y)),g=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(n){let y=function(E){if(g.paused||!u)return;const N=E.target;u.contains(N)?p.current=N:Ji(p.current,{select:!0})},w=function(E){if(g.paused||!u)return;const N=E.relatedTarget;N!==null&&(u.contains(N)||Ji(p.current,{select:!0}))},j=function(E){if(document.activeElement===document.body)for(const A of E)A.removedNodes.length>0&&Ji(u)};document.addEventListener("focusin",y),document.addEventListener("focusout",w);const O=new MutationObserver(j);return u&&O.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",w),O.disconnect()}}},[n,u,g.paused]),_.useEffect(()=>{if(u){Sk.add(g);const y=document.activeElement;if(!u.contains(y)){const j=new CustomEvent(Ob,bk);u.addEventListener(Ob,l),u.dispatchEvent(j),j.defaultPrevented||(Rne($ne(l$(u)),{select:!0}),document.activeElement===y&&Ji(u))}return()=>{u.removeEventListener(Ob,l),setTimeout(()=>{const j=new CustomEvent(Eb,bk);u.addEventListener(Eb,d),u.dispatchEvent(j),j.defaultPrevented||Ji(y??document.body,{select:!0}),u.removeEventListener(Eb,d),Sk.remove(g)},0)}}},[u,l,d,g]);const b=_.useCallback(y=>{if(!r&&!n||g.paused)return;const w=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,j=document.activeElement;if(w&&j){const O=y.currentTarget,[E,N]=Mne(O);E&&N?!y.shiftKey&&j===N?(y.preventDefault(),r&&Ji(E,{select:!0})):y.shiftKey&&j===E&&(y.preventDefault(),r&&Ji(N,{select:!0})):j===O&&y.preventDefault()}},[r,n,g.paused]);return h.jsx(qe.div,{tabIndex:-1,...s,ref:m,onKeyDown:b})});Qp.displayName=kne;function Rne(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Ji(n,{select:t}),document.activeElement!==r)return}function Mne(e){const t=l$(e),r=wk(t,e),n=wk(t.reverse(),e);return[r,n]}function l$(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function wk(e,t){for(const r of e)if(!Ine(r,{upTo:t}))return r}function Ine(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Dne(e){return e instanceof HTMLInputElement&&"select"in e}function Ji(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&Dne(e)&&t&&e.select()}}var Sk=Lne();function Lne(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=_k(e,t),e.unshift(t)},remove(t){e=_k(e,t),e[0]?.resume()}}}function _k(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function $ne(e){return e.filter(t=>t.tagName!=="A")}var Bne=Ew[" useId ".trim().toString()]||(()=>{}),Fne=0;function Xn(e){const[t,r]=_.useState(Bne());return Rt(()=>{r(n=>n??String(Fne++))},[e]),e||(t?`radix-${t}`:"")}const zne=["top","right","bottom","left"],ao=Math.min,zr=Math.max,tp=Math.round,Zf=Math.floor,Yn=e=>({x:e,y:e}),qne={left:"right",right:"left",bottom:"top",top:"bottom"},Une={start:"end",end:"start"};function fw(e,t,r){return zr(e,ao(t,r))}function Oi(e,t){return typeof e=="function"?e(t):e}function Ei(e){return e.split("-")[0]}function Zs(e){return e.split("-")[1]}function US(e){return e==="x"?"y":"x"}function WS(e){return e==="y"?"height":"width"}const Wne=new Set(["top","bottom"]);function Vn(e){return Wne.has(Ei(e))?"y":"x"}function HS(e){return US(Vn(e))}function Hne(e,t,r){r===void 0&&(r=!1);const n=Zs(e),i=HS(e),o=WS(i);let s=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=rp(s)),[s,rp(s)]}function Vne(e){const t=rp(e);return[dw(e),t,dw(t)]}function dw(e){return e.replace(/start|end/g,t=>Une[t])}const jk=["left","right"],Ok=["right","left"],Gne=["top","bottom"],Kne=["bottom","top"];function Xne(e,t,r){switch(e){case"top":case"bottom":return r?t?Ok:jk:t?jk:Ok;case"left":case"right":return t?Gne:Kne;default:return[]}}function Yne(e,t,r,n){const i=Zs(e);let o=Xne(Ei(e),r==="start",n);return i&&(o=o.map(s=>s+"-"+i),t&&(o=o.concat(o.map(dw)))),o}function rp(e){return e.replace(/left|right|bottom|top/g,t=>qne[t])}function Qne(e){return{top:0,right:0,bottom:0,left:0,...e}}function c$(e){return typeof e!="number"?Qne(e):{top:e,right:e,bottom:e,left:e}}function np(e){const{x:t,y:r,width:n,height:i}=e;return{width:n,height:i,top:r,left:t,right:t+n,bottom:r+i,x:t,y:r}}function Ek(e,t,r){let{reference:n,floating:i}=e;const o=Vn(t),s=HS(t),u=WS(s),f=Ei(t),l=o==="y",d=n.x+n.width/2-i.width/2,p=n.y+n.height/2-i.height/2,m=n[u]/2-i[u]/2;let g;switch(f){case"top":g={x:d,y:n.y-i.height};break;case"bottom":g={x:d,y:n.y+n.height};break;case"right":g={x:n.x+n.width,y:p};break;case"left":g={x:n.x-i.width,y:p};break;default:g={x:n.x,y:n.y}}switch(Zs(t)){case"start":g[s]-=m*(r&&l?-1:1);break;case"end":g[s]+=m*(r&&l?-1:1);break}return g}async function Zne(e,t){var r;t===void 0&&(t={});const{x:n,y:i,platform:o,rects:s,elements:u,strategy:f}=e,{boundary:l="clippingAncestors",rootBoundary:d="viewport",elementContext:p="floating",altBoundary:m=!1,padding:g=0}=Oi(t,e),b=c$(g),w=u[m?p==="floating"?"reference":"floating":p],j=np(await o.getClippingRect({element:(r=await(o.isElement==null?void 0:o.isElement(w)))==null||r?w:w.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(u.floating)),boundary:l,rootBoundary:d,strategy:f})),O=p==="floating"?{x:n,y:i,width:s.floating.width,height:s.floating.height}:s.reference,E=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u.floating)),N=await(o.isElement==null?void 0:o.isElement(E))?await(o.getScale==null?void 0:o.getScale(E))||{x:1,y:1}:{x:1,y:1},A=np(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:O,offsetParent:E,strategy:f}):O);return{top:(j.top-A.top+b.top)/N.y,bottom:(A.bottom-j.bottom+b.bottom)/N.y,left:(j.left-A.left+b.left)/N.x,right:(A.right-j.right+b.right)/N.x}}const Jne=async(e,t,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:o=[],platform:s}=r,u=o.filter(Boolean),f=await(s.isRTL==null?void 0:s.isRTL(t));let l=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:d,y:p}=Ek(l,n,f),m=n,g={},b=0;for(let w=0;w({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:i,rects:o,platform:s,elements:u,middlewareData:f}=t,{element:l,padding:d=0}=Oi(e,t)||{};if(l==null)return{};const p=c$(d),m={x:r,y:n},g=HS(i),b=WS(g),y=await s.getDimensions(l),w=g==="y",j=w?"top":"left",O=w?"bottom":"right",E=w?"clientHeight":"clientWidth",N=o.reference[b]+o.reference[g]-m[g]-o.floating[b],A=m[g]-o.reference[g],C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l));let T=C?C[E]:0;(!T||!await(s.isElement==null?void 0:s.isElement(C)))&&(T=u.floating[E]||o.floating[b]);const R=N/2-A/2,I=T/2-y[b]/2-1,z=ao(p[j],I),$=ao(p[O],I),L=z,U=T-y[b]-$,W=T/2-y[b]/2+R,V=fw(L,W,U),G=!f.arrow&&Zs(i)!=null&&W!==V&&o.reference[b]/2-(WW<=0)){var $,L;const W=((($=o.flip)==null?void 0:$.index)||0)+1,V=T[W];if(V&&(!(p==="alignment"?O!==Vn(V):!1)||z.every(D=>Vn(D.placement)===O?D.overflows[0]>0:!0)))return{data:{index:W,overflows:z},reset:{placement:V}};let G=(L=z.filter(Y=>Y.overflows[0]<=0).sort((Y,D)=>Y.overflows[1]-D.overflows[1])[0])==null?void 0:L.placement;if(!G)switch(g){case"bestFit":{var U;const Y=(U=z.filter(D=>{if(C){const Q=Vn(D.placement);return Q===O||Q==="y"}return!0}).map(D=>[D.placement,D.overflows.filter(Q=>Q>0).reduce((Q,J)=>Q+J,0)]).sort((D,Q)=>D[1]-Q[1])[0])==null?void 0:U[0];Y&&(G=Y);break}case"initialPlacement":G=u;break}if(i!==G)return{reset:{placement:G}}}return{}}}};function Pk(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ak(e){return zne.some(t=>e[t]>=0)}const rie=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:n}=t,{strategy:i="referenceHidden",...o}=Oi(e,t);switch(i){case"referenceHidden":{const s=await n.detectOverflow(t,{...o,elementContext:"reference"}),u=Pk(s,r.reference);return{data:{referenceHiddenOffsets:u,referenceHidden:Ak(u)}}}case"escaped":{const s=await n.detectOverflow(t,{...o,altBoundary:!0}),u=Pk(s,r.floating);return{data:{escapedOffsets:u,escaped:Ak(u)}}}default:return{}}}}},u$=new Set(["left","top"]);async function nie(e,t){const{placement:r,platform:n,elements:i}=e,o=await(n.isRTL==null?void 0:n.isRTL(i.floating)),s=Ei(r),u=Zs(r),f=Vn(r)==="y",l=u$.has(s)?-1:1,d=o&&f?-1:1,p=Oi(t,e);let{mainAxis:m,crossAxis:g,alignmentAxis:b}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return u&&typeof b=="number"&&(g=u==="end"?b*-1:b),f?{x:g*d,y:m*l}:{x:m*l,y:g*d}}const iie=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:i,y:o,placement:s,middlewareData:u}=t,f=await nie(t,e);return s===((r=u.offset)==null?void 0:r.placement)&&(n=u.arrow)!=null&&n.alignmentOffset?{}:{x:i+f.x,y:o+f.y,data:{...f,placement:s}}}}},oie=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:i,platform:o}=t,{mainAxis:s=!0,crossAxis:u=!1,limiter:f={fn:j=>{let{x:O,y:E}=j;return{x:O,y:E}}},...l}=Oi(e,t),d={x:r,y:n},p=await o.detectOverflow(t,l),m=Vn(Ei(i)),g=US(m);let b=d[g],y=d[m];if(s){const j=g==="y"?"top":"left",O=g==="y"?"bottom":"right",E=b+p[j],N=b-p[O];b=fw(E,b,N)}if(u){const j=m==="y"?"top":"left",O=m==="y"?"bottom":"right",E=y+p[j],N=y-p[O];y=fw(E,y,N)}const w=f.fn({...t,[g]:b,[m]:y});return{...w,data:{x:w.x-r,y:w.y-n,enabled:{[g]:s,[m]:u}}}}}},aie=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:i,rects:o,middlewareData:s}=t,{offset:u=0,mainAxis:f=!0,crossAxis:l=!0}=Oi(e,t),d={x:r,y:n},p=Vn(i),m=US(p);let g=d[m],b=d[p];const y=Oi(u,t),w=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(f){const E=m==="y"?"height":"width",N=o.reference[m]-o.floating[E]+w.mainAxis,A=o.reference[m]+o.reference[E]-w.mainAxis;gA&&(g=A)}if(l){var j,O;const E=m==="y"?"width":"height",N=u$.has(Ei(i)),A=o.reference[p]-o.floating[E]+(N&&((j=s.offset)==null?void 0:j[p])||0)+(N?0:w.crossAxis),C=o.reference[p]+o.reference[E]+(N?0:((O=s.offset)==null?void 0:O[p])||0)-(N?w.crossAxis:0);bC&&(b=C)}return{[m]:g,[p]:b}}}},sie=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:i,rects:o,platform:s,elements:u}=t,{apply:f=()=>{},...l}=Oi(e,t),d=await s.detectOverflow(t,l),p=Ei(i),m=Zs(i),g=Vn(i)==="y",{width:b,height:y}=o.floating;let w,j;p==="top"||p==="bottom"?(w=p,j=m===(await(s.isRTL==null?void 0:s.isRTL(u.floating))?"start":"end")?"left":"right"):(j=p,w=m==="end"?"top":"bottom");const O=y-d.top-d.bottom,E=b-d.left-d.right,N=ao(y-d[w],O),A=ao(b-d[j],E),C=!t.middlewareData.shift;let T=N,R=A;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(R=E),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(T=O),C&&!m){const z=zr(d.left,0),$=zr(d.right,0),L=zr(d.top,0),U=zr(d.bottom,0);g?R=b-2*(z!==0||$!==0?z+$:zr(d.left,d.right)):T=y-2*(L!==0||U!==0?L+U:zr(d.top,d.bottom))}await f({...t,availableWidth:R,availableHeight:T});const I=await s.getDimensions(u.floating);return b!==I.width||y!==I.height?{reset:{rects:!0}}:{}}}};function Zp(){return typeof window<"u"}function Js(e){return f$(e)?(e.nodeName||"").toLowerCase():"#document"}function Hr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ni(e){var t;return(t=(f$(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function f$(e){return Zp()?e instanceof Node||e instanceof Hr(e).Node:!1}function Rn(e){return Zp()?e instanceof Element||e instanceof Hr(e).Element:!1}function Jn(e){return Zp()?e instanceof HTMLElement||e instanceof Hr(e).HTMLElement:!1}function Ck(e){return!Zp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Hr(e).ShadowRoot}const lie=new Set(["inline","contents"]);function vu(e){const{overflow:t,overflowX:r,overflowY:n,display:i}=Mn(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!lie.has(i)}const cie=new Set(["table","td","th"]);function uie(e){return cie.has(Js(e))}const fie=[":popover-open",":modal"];function Jp(e){return fie.some(t=>{try{return e.matches(t)}catch{return!1}})}const die=["transform","translate","scale","rotate","perspective"],hie=["transform","translate","scale","rotate","perspective","filter"],pie=["paint","layout","strict","content"];function VS(e){const t=GS(),r=Rn(e)?Mn(e):e;return die.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||hie.some(n=>(r.willChange||"").includes(n))||pie.some(n=>(r.contain||"").includes(n))}function mie(e){let t=so(e);for(;Jn(t)&&!Ls(t);){if(VS(t))return t;if(Jp(t))return null;t=so(t)}return null}function GS(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const vie=new Set(["html","body","#document"]);function Ls(e){return vie.has(Js(e))}function Mn(e){return Hr(e).getComputedStyle(e)}function em(e){return Rn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function so(e){if(Js(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ck(e)&&e.host||ni(e);return Ck(t)?t.host:t}function d$(e){const t=so(e);return Ls(t)?e.ownerDocument?e.ownerDocument.body:e.body:Jn(t)&&vu(t)?t:d$(t)}function nu(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const i=d$(e),o=i===((n=e.ownerDocument)==null?void 0:n.body),s=Hr(i);if(o){const u=hw(s);return t.concat(s,s.visualViewport||[],vu(i)?i:[],u&&r?nu(u):[])}return t.concat(i,nu(i,[],r))}function hw(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function h$(e){const t=Mn(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const i=Jn(e),o=i?e.offsetWidth:r,s=i?e.offsetHeight:n,u=tp(r)!==o||tp(n)!==s;return u&&(r=o,n=s),{width:r,height:n,$:u}}function KS(e){return Rn(e)?e:e.contextElement}function os(e){const t=KS(e);if(!Jn(t))return Yn(1);const r=t.getBoundingClientRect(),{width:n,height:i,$:o}=h$(t);let s=(o?tp(r.width):r.width)/n,u=(o?tp(r.height):r.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!u||!Number.isFinite(u))&&(u=1),{x:s,y:u}}const gie=Yn(0);function p$(e){const t=Hr(e);return!GS()||!t.visualViewport?gie:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function yie(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Hr(e)?!1:t}function Jo(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const i=e.getBoundingClientRect(),o=KS(e);let s=Yn(1);t&&(n?Rn(n)&&(s=os(n)):s=os(e));const u=yie(o,r,n)?p$(o):Yn(0);let f=(i.left+u.x)/s.x,l=(i.top+u.y)/s.y,d=i.width/s.x,p=i.height/s.y;if(o){const m=Hr(o),g=n&&Rn(n)?Hr(n):n;let b=m,y=hw(b);for(;y&&n&&g!==b;){const w=os(y),j=y.getBoundingClientRect(),O=Mn(y),E=j.left+(y.clientLeft+parseFloat(O.paddingLeft))*w.x,N=j.top+(y.clientTop+parseFloat(O.paddingTop))*w.y;f*=w.x,l*=w.y,d*=w.x,p*=w.y,f+=E,l+=N,b=Hr(y),y=hw(b)}}return np({width:d,height:p,x:f,y:l})}function tm(e,t){const r=em(e).scrollLeft;return t?t.left+r:Jo(ni(e)).left+r}function m$(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-tm(e,r),i=r.top+t.scrollTop;return{x:n,y:i}}function xie(e){let{elements:t,rect:r,offsetParent:n,strategy:i}=e;const o=i==="fixed",s=ni(n),u=t?Jp(t.floating):!1;if(n===s||u&&o)return r;let f={scrollLeft:0,scrollTop:0},l=Yn(1);const d=Yn(0),p=Jn(n);if((p||!p&&!o)&&((Js(n)!=="body"||vu(s))&&(f=em(n)),Jn(n))){const g=Jo(n);l=os(n),d.x=g.x+n.clientLeft,d.y=g.y+n.clientTop}const m=s&&!p&&!o?m$(s,f):Yn(0);return{width:r.width*l.x,height:r.height*l.y,x:r.x*l.x-f.scrollLeft*l.x+d.x+m.x,y:r.y*l.y-f.scrollTop*l.y+d.y+m.y}}function bie(e){return Array.from(e.getClientRects())}function wie(e){const t=ni(e),r=em(e),n=e.ownerDocument.body,i=zr(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=zr(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+tm(e);const u=-r.scrollTop;return Mn(n).direction==="rtl"&&(s+=zr(t.clientWidth,n.clientWidth)-i),{width:i,height:o,x:s,y:u}}const Nk=25;function Sie(e,t){const r=Hr(e),n=ni(e),i=r.visualViewport;let o=n.clientWidth,s=n.clientHeight,u=0,f=0;if(i){o=i.width,s=i.height;const d=GS();(!d||d&&t==="fixed")&&(u=i.offsetLeft,f=i.offsetTop)}const l=tm(n);if(l<=0){const d=n.ownerDocument,p=d.body,m=getComputedStyle(p),g=d.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,b=Math.abs(n.clientWidth-p.clientWidth-g);b<=Nk&&(o-=b)}else l<=Nk&&(o+=l);return{width:o,height:s,x:u,y:f}}const _ie=new Set(["absolute","fixed"]);function jie(e,t){const r=Jo(e,!0,t==="fixed"),n=r.top+e.clientTop,i=r.left+e.clientLeft,o=Jn(e)?os(e):Yn(1),s=e.clientWidth*o.x,u=e.clientHeight*o.y,f=i*o.x,l=n*o.y;return{width:s,height:u,x:f,y:l}}function Tk(e,t,r){let n;if(t==="viewport")n=Sie(e,r);else if(t==="document")n=wie(ni(e));else if(Rn(t))n=jie(t,r);else{const i=p$(e);n={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return np(n)}function v$(e,t){const r=so(e);return r===t||!Rn(r)||Ls(r)?!1:Mn(r).position==="fixed"||v$(r,t)}function Oie(e,t){const r=t.get(e);if(r)return r;let n=nu(e,[],!1).filter(u=>Rn(u)&&Js(u)!=="body"),i=null;const o=Mn(e).position==="fixed";let s=o?so(e):e;for(;Rn(s)&&!Ls(s);){const u=Mn(s),f=VS(s);!f&&u.position==="fixed"&&(i=null),(o?!f&&!i:!f&&u.position==="static"&&!!i&&_ie.has(i.position)||vu(s)&&!f&&v$(e,s))?n=n.filter(d=>d!==s):i=u,s=so(s)}return t.set(e,n),n}function Eie(e){let{element:t,boundary:r,rootBoundary:n,strategy:i}=e;const s=[...r==="clippingAncestors"?Jp(t)?[]:Oie(t,this._c):[].concat(r),n],u=s[0],f=s.reduce((l,d)=>{const p=Tk(t,d,i);return l.top=zr(p.top,l.top),l.right=ao(p.right,l.right),l.bottom=ao(p.bottom,l.bottom),l.left=zr(p.left,l.left),l},Tk(t,u,i));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function Pie(e){const{width:t,height:r}=h$(e);return{width:t,height:r}}function Aie(e,t,r){const n=Jn(t),i=ni(t),o=r==="fixed",s=Jo(e,!0,o,t);let u={scrollLeft:0,scrollTop:0};const f=Yn(0);function l(){f.x=tm(i)}if(n||!n&&!o)if((Js(t)!=="body"||vu(i))&&(u=em(t)),n){const g=Jo(t,!0,o,t);f.x=g.x+t.clientLeft,f.y=g.y+t.clientTop}else i&&l();o&&!n&&i&&l();const d=i&&!n&&!o?m$(i,u):Yn(0),p=s.left+u.scrollLeft-f.x-d.x,m=s.top+u.scrollTop-f.y-d.y;return{x:p,y:m,width:s.width,height:s.height}}function Pb(e){return Mn(e).position==="static"}function kk(e,t){if(!Jn(e)||Mn(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return ni(e)===r&&(r=r.ownerDocument.body),r}function g$(e,t){const r=Hr(e);if(Jp(e))return r;if(!Jn(e)){let i=so(e);for(;i&&!Ls(i);){if(Rn(i)&&!Pb(i))return i;i=so(i)}return r}let n=kk(e,t);for(;n&&uie(n)&&Pb(n);)n=kk(n,t);return n&&Ls(n)&&Pb(n)&&!VS(n)?r:n||mie(e)||r}const Cie=async function(e){const t=this.getOffsetParent||g$,r=this.getDimensions,n=await r(e.floating);return{reference:Aie(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function Nie(e){return Mn(e).direction==="rtl"}const Tie={convertOffsetParentRelativeRectToViewportRelativeRect:xie,getDocumentElement:ni,getClippingRect:Eie,getOffsetParent:g$,getElementRects:Cie,getClientRects:bie,getDimensions:Pie,getScale:os,isElement:Rn,isRTL:Nie};function y$(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function kie(e,t){let r=null,n;const i=ni(e);function o(){var u;clearTimeout(n),(u=r)==null||u.disconnect(),r=null}function s(u,f){u===void 0&&(u=!1),f===void 0&&(f=1),o();const l=e.getBoundingClientRect(),{left:d,top:p,width:m,height:g}=l;if(u||t(),!m||!g)return;const b=Zf(p),y=Zf(i.clientWidth-(d+m)),w=Zf(i.clientHeight-(p+g)),j=Zf(d),E={rootMargin:-b+"px "+-y+"px "+-w+"px "+-j+"px",threshold:zr(0,ao(1,f))||1};let N=!0;function A(C){const T=C[0].intersectionRatio;if(T!==f){if(!N)return s();T?s(!1,T):n=setTimeout(()=>{s(!1,1e-7)},1e3)}T===1&&!y$(l,e.getBoundingClientRect())&&s(),N=!1}try{r=new IntersectionObserver(A,{...E,root:i.ownerDocument})}catch{r=new IntersectionObserver(A,E)}r.observe(e)}return s(!0),o}function Rie(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:f=!1}=n,l=KS(e),d=i||o?[...l?nu(l):[],...nu(t)]:[];d.forEach(j=>{i&&j.addEventListener("scroll",r,{passive:!0}),o&&j.addEventListener("resize",r)});const p=l&&u?kie(l,r):null;let m=-1,g=null;s&&(g=new ResizeObserver(j=>{let[O]=j;O&&O.target===l&&g&&(g.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var E;(E=g)==null||E.observe(t)})),r()}),l&&!f&&g.observe(l),g.observe(t));let b,y=f?Jo(e):null;f&&w();function w(){const j=Jo(e);y&&!y$(y,j)&&r(),y=j,b=requestAnimationFrame(w)}return r(),()=>{var j;d.forEach(O=>{i&&O.removeEventListener("scroll",r),o&&O.removeEventListener("resize",r)}),p?.(),(j=g)==null||j.disconnect(),g=null,f&&cancelAnimationFrame(b)}}const Mie=iie,Iie=oie,Die=tie,Lie=sie,$ie=rie,Rk=eie,Bie=aie,Fie=(e,t,r)=>{const n=new Map,i={platform:Tie,...r},o={...i.platform,_c:n};return Jne(e,t,{...i,platform:o})};var zie=typeof document<"u",qie=function(){},zd=zie?_.useLayoutEffect:qie;function ip(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!ip(e[n],t[n]))return!1;return!0}if(i=Object.keys(e),r=i.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,i[n]))return!1;for(n=r;n--!==0;){const o=i[n];if(!(o==="_owner"&&e.$$typeof)&&!ip(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function x$(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Mk(e,t){const r=x$(e);return Math.round(t*r)/r}function Ab(e){const t=_.useRef(e);return zd(()=>{t.current=e}),t}function Uie(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:o,floating:s}={},transform:u=!0,whileElementsMounted:f,open:l}=e,[d,p]=_.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,g]=_.useState(n);ip(m,n)||g(n);const[b,y]=_.useState(null),[w,j]=_.useState(null),O=_.useCallback(D=>{D!==C.current&&(C.current=D,y(D))},[]),E=_.useCallback(D=>{D!==T.current&&(T.current=D,j(D))},[]),N=o||b,A=s||w,C=_.useRef(null),T=_.useRef(null),R=_.useRef(d),I=f!=null,z=Ab(f),$=Ab(i),L=Ab(l),U=_.useCallback(()=>{if(!C.current||!T.current)return;const D={placement:t,strategy:r,middleware:m};$.current&&(D.platform=$.current),Fie(C.current,T.current,D).then(Q=>{const J={...Q,isPositioned:L.current!==!1};W.current&&!ip(R.current,J)&&(R.current=J,ou.flushSync(()=>{p(J)}))})},[m,t,r,$,L]);zd(()=>{l===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,p(D=>({...D,isPositioned:!1})))},[l]);const W=_.useRef(!1);zd(()=>(W.current=!0,()=>{W.current=!1}),[]),zd(()=>{if(N&&(C.current=N),A&&(T.current=A),N&&A){if(z.current)return z.current(N,A,U);U()}},[N,A,U,z,I]);const V=_.useMemo(()=>({reference:C,floating:T,setReference:O,setFloating:E}),[O,E]),G=_.useMemo(()=>({reference:N,floating:A}),[N,A]),Y=_.useMemo(()=>{const D={position:r,left:0,top:0};if(!G.floating)return D;const Q=Mk(G.floating,d.x),J=Mk(G.floating,d.y);return u?{...D,transform:"translate("+Q+"px, "+J+"px)",...x$(G.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:Q,top:J}},[r,u,G.floating,d.x,d.y]);return _.useMemo(()=>({...d,update:U,refs:V,elements:G,floatingStyles:Y}),[d,U,V,G,Y])}const Wie=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:i}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Rk({element:n.current,padding:i}).fn(r):{}:n?Rk({element:n,padding:i}).fn(r):{}}}},Hie=(e,t)=>({...Mie(e),options:[e,t]}),Vie=(e,t)=>({...Iie(e),options:[e,t]}),Gie=(e,t)=>({...Bie(e),options:[e,t]}),Kie=(e,t)=>({...Die(e),options:[e,t]}),Xie=(e,t)=>({...Lie(e),options:[e,t]}),Yie=(e,t)=>({...$ie(e),options:[e,t]}),Qie=(e,t)=>({...Wie(e),options:[e,t]});var Zie="Arrow",b$=_.forwardRef((e,t)=>{const{children:r,width:n=10,height:i=5,...o}=e;return h.jsx(qe.svg,{...o,ref:t,width:n,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:h.jsx("polygon",{points:"0,0 30,0 15,10"})})});b$.displayName=Zie;var Jie=b$;function XS(e){const[t,r]=_.useState(void 0);return Rt(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let s,u;if("borderBoxSize"in o){const f=o.borderBoxSize,l=Array.isArray(f)?f[0]:f;s=l.inlineSize,u=l.blockSize}else s=e.offsetWidth,u=e.offsetHeight;r({width:s,height:u})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var YS="Popper",[w$,el]=In(YS),[eoe,S$]=w$(YS),_$=e=>{const{__scopePopper:t,children:r}=e,[n,i]=_.useState(null);return h.jsx(eoe,{scope:t,anchor:n,onAnchorChange:i,children:r})};_$.displayName=YS;var j$="PopperAnchor",O$=_.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...i}=e,o=S$(j$,r),s=_.useRef(null),u=Xe(t,s),f=_.useRef(null);return _.useEffect(()=>{const l=f.current;f.current=n?.current||s.current,l!==f.current&&o.onAnchorChange(f.current)}),n?null:h.jsx(qe.div,{...i,ref:u})});O$.displayName=j$;var QS="PopperContent",[toe,roe]=w$(QS),E$=_.forwardRef((e,t)=>{const{__scopePopper:r,side:n="bottom",sideOffset:i=0,align:o="center",alignOffset:s=0,arrowPadding:u=0,avoidCollisions:f=!0,collisionBoundary:l=[],collisionPadding:d=0,sticky:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:b,...y}=e,w=S$(QS,r),[j,O]=_.useState(null),E=Xe(t,X=>O(X)),[N,A]=_.useState(null),C=XS(N),T=C?.width??0,R=C?.height??0,I=n+(o!=="center"?"-"+o:""),z=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},$=Array.isArray(l)?l:[l],L=$.length>0,U={padding:z,boundary:$.filter(ioe),altBoundary:L},{refs:W,floatingStyles:V,placement:G,isPositioned:Y,middlewareData:D}=Uie({strategy:"fixed",placement:I,whileElementsMounted:(...X)=>Rie(...X,{animationFrame:g==="always"}),elements:{reference:w.anchor},middleware:[Hie({mainAxis:i+R,alignmentAxis:s}),f&&Vie({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?Gie():void 0,...U}),f&&Kie({...U}),Xie({...U,apply:({elements:X,rects:ue,availableWidth:ie,availableHeight:de})=>{const{width:ye,height:oe}=ue.reference,$e=X.floating.style;$e.setProperty("--radix-popper-available-width",`${ie}px`),$e.setProperty("--radix-popper-available-height",`${de}px`),$e.setProperty("--radix-popper-anchor-width",`${ye}px`),$e.setProperty("--radix-popper-anchor-height",`${oe}px`)}}),N&&Qie({element:N,padding:u}),ooe({arrowWidth:T,arrowHeight:R}),m&&Yie({strategy:"referenceHidden",...U})]}),[Q,J]=C$(G),M=ar(b);Rt(()=>{Y&&M?.()},[Y,M]);const B=D.arrow?.x,Z=D.arrow?.y,te=D.arrow?.centerOffset!==0,[ve,xe]=_.useState();return Rt(()=>{j&&xe(window.getComputedStyle(j).zIndex)},[j]),h.jsx("div",{ref:W.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:Y?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ve,"--radix-popper-transform-origin":[D.transformOrigin?.x,D.transformOrigin?.y].join(" "),...D.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:h.jsx(toe,{scope:r,placedSide:Q,onArrowChange:A,arrowX:B,arrowY:Z,shouldHideArrow:te,children:h.jsx(qe.div,{"data-side":Q,"data-align":J,...y,ref:E,style:{...y.style,animation:Y?void 0:"none"}})})})});E$.displayName=QS;var P$="PopperArrow",noe={top:"bottom",right:"left",bottom:"top",left:"right"},A$=_.forwardRef(function(t,r){const{__scopePopper:n,...i}=t,o=roe(P$,n),s=noe[o.placedSide];return h.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:h.jsx(Jie,{...i,ref:r,style:{...i.style,display:"block"}})})});A$.displayName=P$;function ioe(e){return e!==null}var ooe=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:i}=t,s=i.arrow?.centerOffset!==0,u=s?0:e.arrowWidth,f=s?0:e.arrowHeight,[l,d]=C$(r),p={start:"0%",center:"50%",end:"100%"}[d],m=(i.arrow?.x??0)+u/2,g=(i.arrow?.y??0)+f/2;let b="",y="";return l==="bottom"?(b=s?p:`${m}px`,y=`${-f}px`):l==="top"?(b=s?p:`${m}px`,y=`${n.floating.height+f}px`):l==="right"?(b=`${-f}px`,y=s?p:`${g}px`):l==="left"&&(b=`${n.floating.width+f}px`,y=s?p:`${g}px`),{data:{x:b,y}}}});function C$(e){const[t,r="center"]=e.split("-");return[t,r]}var ZS=_$,rm=O$,JS=E$,e_=A$,aoe="Portal",gu=_.forwardRef((e,t)=>{const{container:r,...n}=e,[i,o]=_.useState(!1);Rt(()=>o(!0),[]);const s=r||i&&globalThis?.document?.body;return s?PF.createPortal(h.jsx(qe.div,{...n,ref:t}),s):null});gu.displayName=aoe;function soe(e){const t=loe(e),r=_.forwardRef((n,i)=>{const{children:o,...s}=n,u=_.Children.toArray(o),f=u.find(uoe);if(f){const l=f.props.children,d=u.map(p=>p===f?_.Children.count(l)>1?_.Children.only(null):_.isValidElement(l)?l.props.children:null:p);return h.jsx(t,{...s,ref:i,children:_.isValidElement(l)?_.cloneElement(l,void 0,d):null})}return h.jsx(t,{...s,ref:i,children:o})});return r.displayName=`${e}.Slot`,r}function loe(e){const t=_.forwardRef((r,n)=>{const{children:i,...o}=r;if(_.isValidElement(i)){const s=doe(i),u=foe(o,i.props);return i.type!==_.Fragment&&(u.ref=n?ia(n,s):s),_.cloneElement(i,u)}return _.Children.count(i)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var coe=Symbol("radix.slottable");function uoe(e){return _.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===coe}function foe(e,t){const r={...t};for(const n in t){const i=e[n],o=t[n];/^on[A-Z]/.test(n)?i&&o?r[n]=(...u)=>{const f=o(...u);return i(...u),f}:i&&(r[n]=i):n==="style"?r[n]={...i,...o}:n==="className"&&(r[n]=[i,o].filter(Boolean).join(" "))}return{...e,...r}}function doe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var hoe=Ew[" useInsertionEffect ".trim().toString()]||Rt;function Pi({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[i,o,s]=poe({defaultProp:t,onChange:r}),u=e!==void 0,f=u?e:i;{const d=_.useRef(e!==void 0);_.useEffect(()=>{const p=d.current;p!==u&&console.warn(`${n} is changing from ${p?"controlled":"uncontrolled"} to ${u?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=u},[u,n])}const l=_.useCallback(d=>{if(u){const p=moe(d)?d(e):d;p!==e&&s.current?.(p)}else o(d)},[u,e,o,s]);return[f,l]}function poe({defaultProp:e,onChange:t}){const[r,n]=_.useState(e),i=_.useRef(r),o=_.useRef(t);return hoe(()=>{o.current=t},[t]),_.useEffect(()=>{i.current!==r&&(o.current?.(r),i.current=r)},[r,i]),[r,n,o]}function moe(e){return typeof e=="function"}function t_(e){const t=_.useRef({value:e,previous:e});return _.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var N$=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),voe="VisuallyHidden",T$=_.forwardRef((e,t)=>h.jsx(qe.span,{...e,ref:t,style:{...N$,...e.style}}));T$.displayName=voe;var goe=T$,yoe=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},qa=new WeakMap,Jf=new WeakMap,ed={},Cb=0,k$=function(e){return e&&(e.host||k$(e.parentNode))},xoe=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=k$(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},boe=function(e,t,r,n){var i=xoe(t,Array.isArray(e)?e:[e]);ed[r]||(ed[r]=new WeakMap);var o=ed[r],s=[],u=new Set,f=new Set(i),l=function(p){!p||u.has(p)||(u.add(p),l(p.parentNode))};i.forEach(l);var d=function(p){!p||f.has(p)||Array.prototype.forEach.call(p.children,function(m){if(u.has(m))d(m);else try{var g=m.getAttribute(n),b=g!==null&&g!=="false",y=(qa.get(m)||0)+1,w=(o.get(m)||0)+1;qa.set(m,y),o.set(m,w),s.push(m),y===1&&b&&Jf.set(m,!0),w===1&&m.setAttribute(r,"true"),b||m.setAttribute(n,"true")}catch(j){console.error("aria-hidden: cannot operate on ",m,j)}})};return d(t),u.clear(),Cb++,function(){s.forEach(function(p){var m=qa.get(p)-1,g=o.get(p)-1;qa.set(p,m),o.set(p,g),m||(Jf.has(p)||p.removeAttribute(n),Jf.delete(p)),g||p.removeAttribute(r)}),Cb--,Cb||(qa=new WeakMap,qa=new WeakMap,Jf=new WeakMap,ed={})}},r_=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),i=yoe(e);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live], script"))),boe(n,i,r,"aria-hidden")):function(){return null}},Wn=function(){return Wn=Object.assign||function(t){for(var r,n=1,i=arguments.length;n"u")return Loe;var t=$oe(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},Foe=D$(),as="data-scroll-locked",zoe=function(e,t,r,n){var i=e.left,o=e.top,s=e.right,u=e.gap;return r===void 0&&(r="margin"),` - .`.concat(Soe,` { - overflow: hidden `).concat(n,`; - padding-right: `).concat(u,"px ").concat(n,`; - } - body[`).concat(as,`] { - overflow: hidden `).concat(n,`; - overscroll-behavior: contain; - `).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&` - padding-left: `.concat(i,`px; - padding-top: `).concat(o,`px; - padding-right: `).concat(s,`px; - margin-left:0; - margin-top:0; - margin-right: `).concat(u,"px ").concat(n,`; - `),r==="padding"&&"padding-right: ".concat(u,"px ").concat(n,";")].filter(Boolean).join(""),` - } - - .`).concat(qd,` { - right: `).concat(u,"px ").concat(n,`; - } - - .`).concat(Ud,` { - margin-right: `).concat(u,"px ").concat(n,`; - } - - .`).concat(qd," .").concat(qd,` { - right: 0 `).concat(n,`; - } - - .`).concat(Ud," .").concat(Ud,` { - margin-right: 0 `).concat(n,`; - } - - body[`).concat(as,`] { - `).concat(_oe,": ").concat(u,`px; - } -`)},Dk=function(){var e=parseInt(document.body.getAttribute(as)||"0",10);return isFinite(e)?e:0},qoe=function(){_.useEffect(function(){return document.body.setAttribute(as,(Dk()+1).toString()),function(){var e=Dk()-1;e<=0?document.body.removeAttribute(as):document.body.setAttribute(as,e.toString())}},[])},Uoe=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,i=n===void 0?"margin":n;qoe();var o=_.useMemo(function(){return Boe(i)},[i]);return _.createElement(Foe,{styles:zoe(o,!t,i,r?"":"!important")})},pw=!1;if(typeof window<"u")try{var td=Object.defineProperty({},"passive",{get:function(){return pw=!0,!0}});window.addEventListener("test",td,td),window.removeEventListener("test",td,td)}catch{pw=!1}var Ua=pw?{passive:!1}:!1,Woe=function(e){return e.tagName==="TEXTAREA"},L$=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!Woe(e)&&r[t]==="visible")},Hoe=function(e){return L$(e,"overflowY")},Voe=function(e){return L$(e,"overflowX")},Lk=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var i=$$(e,n);if(i){var o=B$(e,n),s=o[1],u=o[2];if(s>u)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},Goe=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},Koe=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},$$=function(e,t){return e==="v"?Hoe(t):Voe(t)},B$=function(e,t){return e==="v"?Goe(t):Koe(t)},Xoe=function(e,t){return e==="h"&&t==="rtl"?-1:1},Yoe=function(e,t,r,n,i){var o=Xoe(e,window.getComputedStyle(t).direction),s=o*n,u=r.target,f=t.contains(u),l=!1,d=s>0,p=0,m=0;do{if(!u)break;var g=B$(e,u),b=g[0],y=g[1],w=g[2],j=y-w-o*b;(b||j)&&$$(e,u)&&(p+=j,m+=b);var O=u.parentNode;u=O&&O.nodeType===Node.DOCUMENT_FRAGMENT_NODE?O.host:O}while(!f&&u!==document.body||f&&(t.contains(u)||t===u));return(d&&Math.abs(p)<1||!d&&Math.abs(m)<1)&&(l=!0),l},rd=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},$k=function(e){return[e.deltaX,e.deltaY]},Bk=function(e){return e&&"current"in e?e.current:e},Qoe=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Zoe=function(e){return` - .block-interactivity-`.concat(e,` {pointer-events: none;} - .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},Joe=0,Wa=[];function eae(e){var t=_.useRef([]),r=_.useRef([0,0]),n=_.useRef(),i=_.useState(Joe++)[0],o=_.useState(D$)[0],s=_.useRef(e);_.useEffect(function(){s.current=e},[e]),_.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var y=woe([e.lockRef.current],(e.shards||[]).map(Bk),!0).filter(Boolean);return y.forEach(function(w){return w.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),y.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var u=_.useCallback(function(y,w){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!s.current.allowPinchZoom;var j=rd(y),O=r.current,E="deltaX"in y?y.deltaX:O[0]-j[0],N="deltaY"in y?y.deltaY:O[1]-j[1],A,C=y.target,T=Math.abs(E)>Math.abs(N)?"h":"v";if("touches"in y&&T==="h"&&C.type==="range")return!1;var R=window.getSelection(),I=R&&R.anchorNode,z=I?I===C||I.contains(C):!1;if(z)return!1;var $=Lk(T,C);if(!$)return!0;if($?A=T:(A=T==="v"?"h":"v",$=Lk(T,C)),!$)return!1;if(!n.current&&"changedTouches"in y&&(E||N)&&(n.current=A),!A)return!0;var L=n.current||A;return Yoe(L,w,y,L==="h"?E:N)},[]),f=_.useCallback(function(y){var w=y;if(!(!Wa.length||Wa[Wa.length-1]!==o)){var j="deltaY"in w?$k(w):rd(w),O=t.current.filter(function(A){return A.name===w.type&&(A.target===w.target||w.target===A.shadowParent)&&Qoe(A.delta,j)})[0];if(O&&O.should){w.cancelable&&w.preventDefault();return}if(!O){var E=(s.current.shards||[]).map(Bk).filter(Boolean).filter(function(A){return A.contains(w.target)}),N=E.length>0?u(w,E[0]):!s.current.noIsolation;N&&w.cancelable&&w.preventDefault()}}},[]),l=_.useCallback(function(y,w,j,O){var E={name:y,delta:w,target:j,should:O,shadowParent:tae(j)};t.current.push(E),setTimeout(function(){t.current=t.current.filter(function(N){return N!==E})},1)},[]),d=_.useCallback(function(y){r.current=rd(y),n.current=void 0},[]),p=_.useCallback(function(y){l(y.type,$k(y),y.target,u(y,e.lockRef.current))},[]),m=_.useCallback(function(y){l(y.type,rd(y),y.target,u(y,e.lockRef.current))},[]);_.useEffect(function(){return Wa.push(o),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",f,Ua),document.addEventListener("touchmove",f,Ua),document.addEventListener("touchstart",d,Ua),function(){Wa=Wa.filter(function(y){return y!==o}),document.removeEventListener("wheel",f,Ua),document.removeEventListener("touchmove",f,Ua),document.removeEventListener("touchstart",d,Ua)}},[]);var g=e.removeScrollBar,b=e.inert;return _.createElement(_.Fragment,null,b?_.createElement(o,{styles:Zoe(i)}):null,g?_.createElement(Uoe,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function tae(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const rae=Noe(I$,eae);var im=_.forwardRef(function(e,t){return _.createElement(nm,Wn({},e,{ref:t,sideCar:rae}))});im.classNames=nm.classNames;var nae=[" ","Enter","ArrowUp","ArrowDown"],iae=[" ","Enter"],ea="Select",[om,am,oae]=o$(ea),[tl]=In(ea,[oae,el]),sm=el(),[aae,ho]=tl(ea),[sae,lae]=tl(ea),F$=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:i,onOpenChange:o,value:s,defaultValue:u,onValueChange:f,dir:l,name:d,autoComplete:p,disabled:m,required:g,form:b}=e,y=sm(t),[w,j]=_.useState(null),[O,E]=_.useState(null),[N,A]=_.useState(!1),C=fp(l),[T,R]=Pi({prop:n,defaultProp:i??!1,onChange:o,caller:ea}),[I,z]=Pi({prop:s,defaultProp:u,onChange:f,caller:ea}),$=_.useRef(null),L=w?b||!!w.closest("form"):!0,[U,W]=_.useState(new Set),V=Array.from(U).map(G=>G.props.value).join(";");return h.jsx(ZS,{...y,children:h.jsxs(aae,{required:g,scope:t,trigger:w,onTriggerChange:j,valueNode:O,onValueNodeChange:E,valueNodeHasChildren:N,onValueNodeHasChildrenChange:A,contentId:Xn(),value:I,onValueChange:z,open:T,onOpenChange:R,dir:C,triggerPointerDownPosRef:$,disabled:m,children:[h.jsx(om.Provider,{scope:t,children:h.jsx(sae,{scope:e.__scopeSelect,onNativeOptionAdd:_.useCallback(G=>{W(Y=>new Set(Y).add(G))},[]),onNativeOptionRemove:_.useCallback(G=>{W(Y=>{const D=new Set(Y);return D.delete(G),D})},[]),children:r})}),L?h.jsxs(l3,{"aria-hidden":!0,required:g,tabIndex:-1,name:d,autoComplete:p,value:I,onChange:G=>z(G.target.value),disabled:m,form:b,children:[I===void 0?h.jsx("option",{value:""}):null,Array.from(U)]},V):null]})})};F$.displayName=ea;var z$="SelectTrigger",q$=_.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...i}=e,o=sm(r),s=ho(z$,r),u=s.disabled||n,f=Xe(t,s.onTriggerChange),l=am(r),d=_.useRef("touch"),[p,m,g]=u3(y=>{const w=l().filter(E=>!E.disabled),j=w.find(E=>E.value===s.value),O=f3(w,y,j);O!==void 0&&s.onValueChange(O.value)}),b=y=>{u||(s.onOpenChange(!0),g()),y&&(s.triggerPointerDownPosRef.current={x:Math.round(y.pageX),y:Math.round(y.pageY)})};return h.jsx(rm,{asChild:!0,...o,children:h.jsx(qe.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":c3(s.value)?"":void 0,...i,ref:f,onClick:ke(i.onClick,y=>{y.currentTarget.focus(),d.current!=="mouse"&&b(y)}),onPointerDown:ke(i.onPointerDown,y=>{d.current=y.pointerType;const w=y.target;w.hasPointerCapture(y.pointerId)&&w.releasePointerCapture(y.pointerId),y.button===0&&y.ctrlKey===!1&&y.pointerType==="mouse"&&(b(y),y.preventDefault())}),onKeyDown:ke(i.onKeyDown,y=>{const w=p.current!=="";!(y.ctrlKey||y.altKey||y.metaKey)&&y.key.length===1&&m(y.key),!(w&&y.key===" ")&&nae.includes(y.key)&&(b(),y.preventDefault())})})})});q$.displayName=z$;var U$="SelectValue",W$=_.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:i,children:o,placeholder:s="",...u}=e,f=ho(U$,r),{onValueNodeHasChildrenChange:l}=f,d=o!==void 0,p=Xe(t,f.onValueNodeChange);return Rt(()=>{l(d)},[l,d]),h.jsx(qe.span,{...u,ref:p,style:{pointerEvents:"none"},children:c3(f.value)?h.jsx(h.Fragment,{children:s}):o})});W$.displayName=U$;var cae="SelectIcon",H$=_.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...i}=e;return h.jsx(qe.span,{"aria-hidden":!0,...i,ref:t,children:n||"▼"})});H$.displayName=cae;var uae="SelectPortal",V$=e=>h.jsx(gu,{asChild:!0,...e});V$.displayName=uae;var ta="SelectContent",G$=_.forwardRef((e,t)=>{const r=ho(ta,e.__scopeSelect),[n,i]=_.useState();if(Rt(()=>{i(new DocumentFragment)},[]),!r.open){const o=n;return o?ou.createPortal(h.jsx(K$,{scope:e.__scopeSelect,children:h.jsx(om.Slot,{scope:e.__scopeSelect,children:h.jsx("div",{children:e.children})})}),o):null}return h.jsx(X$,{...e,ref:t})});G$.displayName=ta;var jn=10,[K$,po]=tl(ta),fae="SelectContentImpl",dae=soe("SelectContent.RemoveScroll"),X$=_.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:s,side:u,sideOffset:f,align:l,alignOffset:d,arrowPadding:p,collisionBoundary:m,collisionPadding:g,sticky:b,hideWhenDetached:y,avoidCollisions:w,...j}=e,O=ho(ta,r),[E,N]=_.useState(null),[A,C]=_.useState(null),T=Xe(t,X=>N(X)),[R,I]=_.useState(null),[z,$]=_.useState(null),L=am(r),[U,W]=_.useState(!1),V=_.useRef(!1);_.useEffect(()=>{if(E)return r_(E)},[E]),qS();const G=_.useCallback(X=>{const[ue,...ie]=L().map(oe=>oe.ref.current),[de]=ie.slice(-1),ye=document.activeElement;for(const oe of X)if(oe===ye||(oe?.scrollIntoView({block:"nearest"}),oe===ue&&A&&(A.scrollTop=0),oe===de&&A&&(A.scrollTop=A.scrollHeight),oe?.focus(),document.activeElement!==ye))return},[L,A]),Y=_.useCallback(()=>G([R,E]),[G,R,E]);_.useEffect(()=>{U&&Y()},[U,Y]);const{onOpenChange:D,triggerPointerDownPosRef:Q}=O;_.useEffect(()=>{if(E){let X={x:0,y:0};const ue=de=>{X={x:Math.abs(Math.round(de.pageX)-(Q.current?.x??0)),y:Math.abs(Math.round(de.pageY)-(Q.current?.y??0))}},ie=de=>{X.x<=10&&X.y<=10?de.preventDefault():E.contains(de.target)||D(!1),document.removeEventListener("pointermove",ue),Q.current=null};return Q.current!==null&&(document.addEventListener("pointermove",ue),document.addEventListener("pointerup",ie,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ue),document.removeEventListener("pointerup",ie,{capture:!0})}}},[E,D,Q]),_.useEffect(()=>{const X=()=>D(!1);return window.addEventListener("blur",X),window.addEventListener("resize",X),()=>{window.removeEventListener("blur",X),window.removeEventListener("resize",X)}},[D]);const[J,M]=u3(X=>{const ue=L().filter(ye=>!ye.disabled),ie=ue.find(ye=>ye.ref.current===document.activeElement),de=f3(ue,X,ie);de&&setTimeout(()=>de.ref.current.focus())}),B=_.useCallback((X,ue,ie)=>{const de=!V.current&&!ie;(O.value!==void 0&&O.value===ue||de)&&(I(X),de&&(V.current=!0))},[O.value]),Z=_.useCallback(()=>E?.focus(),[E]),te=_.useCallback((X,ue,ie)=>{const de=!V.current&&!ie;(O.value!==void 0&&O.value===ue||de)&&$(X)},[O.value]),ve=n==="popper"?mw:Y$,xe=ve===mw?{side:u,sideOffset:f,align:l,alignOffset:d,arrowPadding:p,collisionBoundary:m,collisionPadding:g,sticky:b,hideWhenDetached:y,avoidCollisions:w}:{};return h.jsx(K$,{scope:r,content:E,viewport:A,onViewportChange:C,itemRefCallback:B,selectedItem:R,onItemLeave:Z,itemTextRefCallback:te,focusSelectedItem:Y,selectedItemText:z,position:n,isPositioned:U,searchRef:J,children:h.jsx(im,{as:dae,allowPinchZoom:!0,children:h.jsx(Qp,{asChild:!0,trapped:O.open,onMountAutoFocus:X=>{X.preventDefault()},onUnmountAutoFocus:ke(i,X=>{O.trigger?.focus({preventScroll:!0}),X.preventDefault()}),children:h.jsx(mu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:X=>X.preventDefault(),onDismiss:()=>O.onOpenChange(!1),children:h.jsx(ve,{role:"listbox",id:O.contentId,"data-state":O.open?"open":"closed",dir:O.dir,onContextMenu:X=>X.preventDefault(),...j,...xe,onPlaced:()=>W(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...j.style},onKeyDown:ke(j.onKeyDown,X=>{const ue=X.ctrlKey||X.altKey||X.metaKey;if(X.key==="Tab"&&X.preventDefault(),!ue&&X.key.length===1&&M(X.key),["ArrowUp","ArrowDown","Home","End"].includes(X.key)){let de=L().filter(ye=>!ye.disabled).map(ye=>ye.ref.current);if(["ArrowUp","End"].includes(X.key)&&(de=de.slice().reverse()),["ArrowUp","ArrowDown"].includes(X.key)){const ye=X.target,oe=de.indexOf(ye);de=de.slice(oe+1)}setTimeout(()=>G(de)),X.preventDefault()}})})})})})})});X$.displayName=fae;var hae="SelectItemAlignedPosition",Y$=_.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...i}=e,o=ho(ta,r),s=po(ta,r),[u,f]=_.useState(null),[l,d]=_.useState(null),p=Xe(t,T=>d(T)),m=am(r),g=_.useRef(!1),b=_.useRef(!0),{viewport:y,selectedItem:w,selectedItemText:j,focusSelectedItem:O}=s,E=_.useCallback(()=>{if(o.trigger&&o.valueNode&&u&&l&&y&&w&&j){const T=o.trigger.getBoundingClientRect(),R=l.getBoundingClientRect(),I=o.valueNode.getBoundingClientRect(),z=j.getBoundingClientRect();if(o.dir!=="rtl"){const ye=z.left-R.left,oe=I.left-ye,$e=T.left-oe,Me=T.width+$e,Ye=Math.max(Me,R.width),lt=window.innerWidth-jn,vt=qb(oe,[jn,Math.max(jn,lt-Ye)]);u.style.minWidth=Me+"px",u.style.left=vt+"px"}else{const ye=R.right-z.right,oe=window.innerWidth-I.right-ye,$e=window.innerWidth-T.right-oe,Me=T.width+$e,Ye=Math.max(Me,R.width),lt=window.innerWidth-jn,vt=qb(oe,[jn,Math.max(jn,lt-Ye)]);u.style.minWidth=Me+"px",u.style.right=vt+"px"}const $=m(),L=window.innerHeight-jn*2,U=y.scrollHeight,W=window.getComputedStyle(l),V=parseInt(W.borderTopWidth,10),G=parseInt(W.paddingTop,10),Y=parseInt(W.borderBottomWidth,10),D=parseInt(W.paddingBottom,10),Q=V+G+U+D+Y,J=Math.min(w.offsetHeight*5,Q),M=window.getComputedStyle(y),B=parseInt(M.paddingTop,10),Z=parseInt(M.paddingBottom,10),te=T.top+T.height/2-jn,ve=L-te,xe=w.offsetHeight/2,X=w.offsetTop+xe,ue=V+G+X,ie=Q-ue;if(ue<=te){const ye=$.length>0&&w===$[$.length-1].ref.current;u.style.bottom="0px";const oe=l.clientHeight-y.offsetTop-y.offsetHeight,$e=Math.max(ve,xe+(ye?Z:0)+oe+Y),Me=ue+$e;u.style.height=Me+"px"}else{const ye=$.length>0&&w===$[0].ref.current;u.style.top="0px";const $e=Math.max(te,V+y.offsetTop+(ye?B:0)+xe)+ie;u.style.height=$e+"px",y.scrollTop=ue-te+y.offsetTop}u.style.margin=`${jn}px 0`,u.style.minHeight=J+"px",u.style.maxHeight=L+"px",n?.(),requestAnimationFrame(()=>g.current=!0)}},[m,o.trigger,o.valueNode,u,l,y,w,j,o.dir,n]);Rt(()=>E(),[E]);const[N,A]=_.useState();Rt(()=>{l&&A(window.getComputedStyle(l).zIndex)},[l]);const C=_.useCallback(T=>{T&&b.current===!0&&(E(),O?.(),b.current=!1)},[E,O]);return h.jsx(mae,{scope:r,contentWrapper:u,shouldExpandOnScrollRef:g,onScrollButtonChange:C,children:h.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:N},children:h.jsx(qe.div,{...i,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});Y$.displayName=hae;var pae="SelectPopperPosition",mw=_.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:i=jn,...o}=e,s=sm(r);return h.jsx(JS,{...s,...o,ref:t,align:n,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});mw.displayName=pae;var[mae,n_]=tl(ta,{}),vw="SelectViewport",Q$=_.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...i}=e,o=po(vw,r),s=n_(vw,r),u=Xe(t,o.onViewportChange),f=_.useRef(0);return h.jsxs(h.Fragment,{children:[h.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),h.jsx(om.Slot,{scope:r,children:h.jsx(qe.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:ke(i.onScroll,l=>{const d=l.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:m}=s;if(m?.current&&p){const g=Math.abs(f.current-d.scrollTop);if(g>0){const b=window.innerHeight-jn*2,y=parseFloat(p.style.minHeight),w=parseFloat(p.style.height),j=Math.max(y,w);if(j0?N:0,p.style.justifyContent="flex-end")}}}f.current=d.scrollTop})})})]})});Q$.displayName=vw;var Z$="SelectGroup",[vae,gae]=tl(Z$),yae=_.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,i=Xn();return h.jsx(vae,{scope:r,id:i,children:h.jsx(qe.div,{role:"group","aria-labelledby":i,...n,ref:t})})});yae.displayName=Z$;var J$="SelectLabel",xae=_.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,i=gae(J$,r);return h.jsx(qe.div,{id:i.id,...n,ref:t})});xae.displayName=J$;var op="SelectItem",[bae,e3]=tl(op),t3=_.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:i=!1,textValue:o,...s}=e,u=ho(op,r),f=po(op,r),l=u.value===n,[d,p]=_.useState(o??""),[m,g]=_.useState(!1),b=Xe(t,O=>f.itemRefCallback?.(O,n,i)),y=Xn(),w=_.useRef("touch"),j=()=>{i||(u.onValueChange(n),u.onOpenChange(!1))};if(n==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return h.jsx(bae,{scope:r,value:n,disabled:i,textId:y,isSelected:l,onItemTextChange:_.useCallback(O=>{p(E=>E||(O?.textContent??"").trim())},[]),children:h.jsx(om.ItemSlot,{scope:r,value:n,disabled:i,textValue:d,children:h.jsx(qe.div,{role:"option","aria-labelledby":y,"data-highlighted":m?"":void 0,"aria-selected":l&&m,"data-state":l?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...s,ref:b,onFocus:ke(s.onFocus,()=>g(!0)),onBlur:ke(s.onBlur,()=>g(!1)),onClick:ke(s.onClick,()=>{w.current!=="mouse"&&j()}),onPointerUp:ke(s.onPointerUp,()=>{w.current==="mouse"&&j()}),onPointerDown:ke(s.onPointerDown,O=>{w.current=O.pointerType}),onPointerMove:ke(s.onPointerMove,O=>{w.current=O.pointerType,i?f.onItemLeave?.():w.current==="mouse"&&O.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ke(s.onPointerLeave,O=>{O.currentTarget===document.activeElement&&f.onItemLeave?.()}),onKeyDown:ke(s.onKeyDown,O=>{f.searchRef?.current!==""&&O.key===" "||(iae.includes(O.key)&&j(),O.key===" "&&O.preventDefault())})})})})});t3.displayName=op;var lc="SelectItemText",r3=_.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:i,...o}=e,s=ho(lc,r),u=po(lc,r),f=e3(lc,r),l=lae(lc,r),[d,p]=_.useState(null),m=Xe(t,j=>p(j),f.onItemTextChange,j=>u.itemTextRefCallback?.(j,f.value,f.disabled)),g=d?.textContent,b=_.useMemo(()=>h.jsx("option",{value:f.value,disabled:f.disabled,children:g},f.value),[f.disabled,f.value,g]),{onNativeOptionAdd:y,onNativeOptionRemove:w}=l;return Rt(()=>(y(b),()=>w(b)),[y,w,b]),h.jsxs(h.Fragment,{children:[h.jsx(qe.span,{id:f.textId,...o,ref:m}),f.isSelected&&s.valueNode&&!s.valueNodeHasChildren?ou.createPortal(o.children,s.valueNode):null]})});r3.displayName=lc;var n3="SelectItemIndicator",i3=_.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return e3(n3,r).isSelected?h.jsx(qe.span,{"aria-hidden":!0,...n,ref:t}):null});i3.displayName=n3;var gw="SelectScrollUpButton",o3=_.forwardRef((e,t)=>{const r=po(gw,e.__scopeSelect),n=n_(gw,e.__scopeSelect),[i,o]=_.useState(!1),s=Xe(t,n.onScrollButtonChange);return Rt(()=>{if(r.viewport&&r.isPositioned){let u=function(){const l=f.scrollTop>0;o(l)};const f=r.viewport;return u(),f.addEventListener("scroll",u),()=>f.removeEventListener("scroll",u)}},[r.viewport,r.isPositioned]),i?h.jsx(s3,{...e,ref:s,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=r;u&&f&&(u.scrollTop=u.scrollTop-f.offsetHeight)}}):null});o3.displayName=gw;var yw="SelectScrollDownButton",a3=_.forwardRef((e,t)=>{const r=po(yw,e.__scopeSelect),n=n_(yw,e.__scopeSelect),[i,o]=_.useState(!1),s=Xe(t,n.onScrollButtonChange);return Rt(()=>{if(r.viewport&&r.isPositioned){let u=function(){const l=f.scrollHeight-f.clientHeight,d=Math.ceil(f.scrollTop)f.removeEventListener("scroll",u)}},[r.viewport,r.isPositioned]),i?h.jsx(s3,{...e,ref:s,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=r;u&&f&&(u.scrollTop=u.scrollTop+f.offsetHeight)}}):null});a3.displayName=yw;var s3=_.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...i}=e,o=po("SelectScrollButton",r),s=_.useRef(null),u=am(r),f=_.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return _.useEffect(()=>()=>f(),[f]),Rt(()=>{u().find(d=>d.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[u]),h.jsx(qe.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:ke(i.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(n,50))}),onPointerMove:ke(i.onPointerMove,()=>{o.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(n,50))}),onPointerLeave:ke(i.onPointerLeave,()=>{f()})})}),wae="SelectSeparator",Sae=_.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return h.jsx(qe.div,{"aria-hidden":!0,...n,ref:t})});Sae.displayName=wae;var xw="SelectArrow",_ae=_.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,i=sm(r),o=ho(xw,r),s=po(xw,r);return o.open&&s.position==="popper"?h.jsx(e_,{...i,...n,ref:t}):null});_ae.displayName=xw;var jae="SelectBubbleInput",l3=_.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const i=_.useRef(null),o=Xe(n,i),s=t_(t);return _.useEffect(()=>{const u=i.current;if(!u)return;const f=window.HTMLSelectElement.prototype,d=Object.getOwnPropertyDescriptor(f,"value").set;if(s!==t&&d){const p=new Event("change",{bubbles:!0});d.call(u,t),u.dispatchEvent(p)}},[s,t]),h.jsx(qe.select,{...r,style:{...N$,...r.style},ref:o,defaultValue:t})});l3.displayName=jae;function c3(e){return e===""||e===void 0}function u3(e){const t=ar(e),r=_.useRef(""),n=_.useRef(0),i=_.useCallback(s=>{const u=r.current+s;t(u),(function f(l){r.current=l,window.clearTimeout(n.current),l!==""&&(n.current=window.setTimeout(()=>f(""),1e3))})(u)},[t]),o=_.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return _.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,i,o]}function f3(e,t,r){const i=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let s=Oae(e,Math.max(o,0));i.length===1&&(s=s.filter(l=>l!==r));const f=s.find(l=>l.textValue.toLowerCase().startsWith(i.toLowerCase()));return f!==r?f:void 0}function Oae(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var Eae=F$,Pae=q$,Aae=W$,Cae=H$,Nae=V$,Tae=G$,kae=Q$,Rae=t3,Mae=r3,Iae=i3,Dae=o3,Lae=a3;function Ze({...e}){return h.jsx(Eae,{"data-slot":"select",...e})}function Je({...e}){return h.jsx(Aae,{"data-slot":"select-value",...e})}function et({className:e,size:t="default",children:r,...n}){return h.jsxs(Pae,{"data-slot":"select-trigger","data-size":t,className:Te("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-full items-center justify-between gap-2 rounded-md border bg-input-background px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...n,children:[r,h.jsx(Cae,{asChild:!0,children:h.jsx(xc,{className:"size-4 opacity-50"})})]})}function nt({className:e,children:t,position:r="popper",...n}){return h.jsx(Nae,{children:h.jsxs(Tae,{"data-slot":"select-content",className:Te("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:[h.jsx($ae,{}),h.jsx(kae,{className:Te("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),h.jsx(Bae,{})]})})}function Ae({className:e,children:t,...r}){return h.jsxs(Rae,{"data-slot":"select-item",className:Te("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...r,children:[h.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:h.jsx(Iae,{children:h.jsx(YR,{className:"size-4"})})}),h.jsx(Mae,{children:t})]})}function $ae({className:e,...t}){return h.jsx(Dae,{"data-slot":"select-scroll-up-button",className:Te("flex cursor-default items-center justify-center py-1",e),...t,children:h.jsx(I8,{className:"size-4"})})}function Bae({className:e,...t}){return h.jsx(Lae,{"data-slot":"select-scroll-down-button",className:Te("flex cursor-default items-center justify-center py-1",e),...t,children:h.jsx(xc,{className:"size-4"})})}function Fae(){const e=[{id:1,location:"Location A",labelCategory:"Prep",productCategory:"Meat",product:"Chicken",template:'2"x2" Basic',labelType:"Defrost",lastEdited:"2025.12.03.11:45",hasError:!1},{id:2,location:"Location A",labelCategory:"Prep",productCategory:"Meat",product:"Chicken",template:'2"x2" Basic',labelType:"Opened/Preped",lastEdited:"2025.12.03.11:45",hasError:!1},{id:3,location:"Location A",labelCategory:"Prep",productCategory:"Meat",product:"Chicken",template:'2"x2" Basic',labelType:"Heated",lastEdited:"2025.12.03.11:45",hasError:!1},{id:4,location:"Location A",labelCategory:"Grab'n'Go",productCategory:"Sandwich",product:"Chicken Sandwich",template:`2"x6" G'n'G`,labelType:"",lastEdited:"2025.12.03.11:45",hasError:!0}];return h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"flex flex-nowrap items-center gap-3",children:[h.jsx(be,{placeholder:"Search",style:{height:40,boxSizing:"border-box"},className:"bg-white border border-gray-300 rounded-md w-40 shrink-0 text-gray-900 placeholder:text-gray-500"}),h.jsxs(Ze,{defaultValue:"all",children:[h.jsx(et,{className:"bg-white border border-gray-300 rounded-md w-[200px] shrink-0 text-gray-900",style:{height:40,boxSizing:"border-box"},children:h.jsx(Je,{placeholder:"Location"})}),h.jsxs(nt,{children:[h.jsx(Ae,{value:"all",children:"All Locations"}),h.jsx(Ae,{value:"loc-a",children:"Location A"}),h.jsx(Ae,{value:"loc-b",children:"Location B"})]})]}),h.jsxs("div",{className:"flex rounded-md border border-gray-300 bg-white h-10 overflow-hidden shrink-0",children:[h.jsx("button",{type:"button",className:"px-4 h-full border-r border-gray-200 text-sm font-medium text-gray-900 hover:bg-gray-50 transition-colors",children:"Bulk Import"}),h.jsx("button",{type:"button",className:"px-4 h-full border-r border-gray-200 text-sm font-medium text-gray-900 hover:bg-gray-50 transition-colors",children:"Bulk Export"}),h.jsx("button",{type:"button",className:"px-4 h-full text-sm font-medium text-gray-900 hover:bg-gray-50 transition-colors",children:"Bulk Edit"})]}),h.jsxs(we,{className:"bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-md h-10 px-6 shrink-0 ml-auto",children:["New Label ",h.jsx(jr,{className:"ml-1 h-4 w-4"})]})]}),h.jsx("div",{className:"text-red-600 font-bold italic text-lg",children:"One or more of your labels are missing fields from their templates (! ! ! 1 in total)."}),h.jsx("div",{className:"rounded-md border bg-white shadow-sm",children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsxs(Ke,{className:"bg-gray-50 hover:bg-gray-50",children:[h.jsx(me,{className:"font-bold text-gray-900 w-[120px]",children:"Location"}),h.jsx(me,{className:"font-bold text-gray-900 w-[140px]",children:"Label Category"}),h.jsx(me,{className:"font-bold text-gray-900 w-[140px]",children:"Product Category"}),h.jsx(me,{className:"font-bold text-gray-900",children:"Product"}),h.jsx(me,{className:"font-bold text-gray-900",children:"Template"}),h.jsx(me,{className:"font-bold text-gray-900",children:"Label Type"}),h.jsx(me,{className:"font-bold text-gray-900",children:"Last Edited"})]})}),h.jsx(mr,{children:e.map(t=>h.jsxs(Ke,{className:"hover:bg-gray-50",children:[h.jsx(se,{className:"font-medium",children:t.location}),h.jsx(se,{children:t.labelCategory}),h.jsx(se,{children:t.productCategory}),h.jsx(se,{children:t.product}),h.jsxs(se,{className:"font-medium",children:[t.template,t.hasError&&h.jsx("span",{className:"text-red-600 font-bold ml-2",children:"! ! !"})]}),h.jsx(se,{children:t.labelType||"-"}),h.jsx(se,{className:"text-gray-500 tabular-nums font-numeric",children:t.lastEdited})]},t.id))})]})})]})}function zae(){const e=[{id:1,category:"Prep",count:54,photo:"XXX",lastEdited:"2025.12.03.11:45"},{id:2,category:"Green",count:33,photo:"XXX",lastEdited:"2025.12.03.11:45"},{id:3,category:"Red",count:44,photo:"XXX",lastEdited:"2025.12.03.11:45"}];return h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"flex flex-nowrap items-center gap-3",children:[h.jsx(be,{placeholder:"Search",style:{height:40,boxSizing:"border-box"},className:"bg-white border border-gray-300 rounded-md w-40 shrink-0 placeholder:text-gray-500"}),h.jsx("span",{className:"text-sm font-medium text-gray-900 whitespace-nowrap shrink-0",children:"Search"}),h.jsxs(Ze,{defaultValue:"all",children:[h.jsx(et,{className:"bg-white border border-gray-300 rounded-md w-[150px] shrink-0",style:{height:40,boxSizing:"border-box"},children:h.jsx(Je,{placeholder:"Location"})}),h.jsxs(nt,{children:[h.jsx(Ae,{value:"all",children:"All Locations"}),h.jsx(Ae,{value:"loc-a",children:"Location A"}),h.jsx(Ae,{value:"loc-b",children:"Location B"})]})]}),h.jsx("span",{className:"text-sm font-medium text-gray-900 whitespace-nowrap shrink-0",children:"Location"}),h.jsxs(we,{className:"bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-md h-10 px-6 shrink-0 ml-auto",children:["New Label Category ",h.jsx(jr,{className:"ml-1 h-4 w-4"})]})]}),h.jsx("div",{className:"rounded-md border bg-white shadow-sm",children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsxs(Ke,{className:"bg-gray-50 hover:bg-gray-50",children:[h.jsx(me,{className:"font-bold text-gray-900 w-[250px]",children:"Label Category"}),h.jsx(me,{className:"font-bold text-gray-900 w-[200px]",children:"No. of Labels"}),h.jsx(me,{className:"font-bold text-gray-900 w-[200px]",children:"Category Photo"}),h.jsx(me,{className:"font-bold text-gray-900",children:"Last Edited"})]})}),h.jsx(mr,{children:e.map(t=>h.jsxs(Ke,{className:"hover:bg-gray-50",children:[h.jsx(se,{className:"font-medium",children:t.category}),h.jsx(se,{className:"font-numeric",children:t.count}),h.jsx(se,{className:"text-gray-500",children:t.photo}),h.jsx(se,{className:"text-gray-500 tabular-nums font-numeric",children:t.lastEdited})]},t.id))})]})})]})}function qae(){const e=[{id:1,type:"Defrost",count:54,lastEdited:"2025.12.03.11:45"},{id:2,type:"Thawed",count:33,lastEdited:"2025.12.03.11:45"},{id:3,type:"Opened",count:44,lastEdited:"2025.12.03.11:45"},{id:4,type:"Preped",count:17,lastEdited:"2025.12.03.11:45"},{id:5,type:"Heated",count:67,lastEdited:"2025.12.03.11:45"}];return h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"flex flex-nowrap items-center gap-3",children:[h.jsx(be,{placeholder:"Search",style:{height:40,boxSizing:"border-box"},className:"bg-white border border-gray-300 rounded-md w-40 shrink-0 placeholder:text-gray-500"}),h.jsx("span",{className:"text-sm font-medium text-gray-900 whitespace-nowrap shrink-0",children:"Search"}),h.jsxs(Ze,{defaultValue:"all",children:[h.jsx(et,{className:"bg-white border border-gray-300 rounded-md w-[150px] shrink-0",style:{height:40,boxSizing:"border-box"},children:h.jsx(Je,{placeholder:"Location"})}),h.jsxs(nt,{children:[h.jsx(Ae,{value:"all",children:"all"}),h.jsx(Ae,{value:"loc-a",children:"Location A"}),h.jsx(Ae,{value:"loc-b",children:"Location B"})]})]}),h.jsx("span",{className:"text-sm font-medium text-gray-900 whitespace-nowrap shrink-0",children:"Location"}),h.jsxs(we,{className:"bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-md h-10 px-6 shrink-0 ml-auto",children:["New Label Type ",h.jsx(jr,{className:"ml-1 h-4 w-4"})]})]}),h.jsx("div",{className:"rounded-md border bg-white shadow-sm",children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsxs(Ke,{className:"bg-gray-50 hover:bg-gray-50",children:[h.jsx(me,{className:"font-bold text-gray-900 w-[250px]",children:"Label Types"}),h.jsx(me,{className:"font-bold text-gray-900 w-[200px]",children:"No. of Labels"}),h.jsx(me,{className:"font-bold text-gray-900",children:"Last Edited"})]})}),h.jsx(mr,{children:e.map(t=>h.jsxs(Ke,{className:"hover:bg-gray-50",children:[h.jsx(se,{className:"font-medium",children:t.type}),h.jsx(se,{className:"font-numeric",children:t.count}),h.jsx(se,{className:"text-gray-500 tabular-nums font-numeric",children:t.lastEdited})]},t.id))})]})})]})}const Uae="label-template-",Wae="label-template-ids";function d3(e){return`${Uae}${e}`}function h3(){return Wae}function Hae(){return`template-${Date.now()}`}function Vae(){return`el-${Date.now()}-${Math.random().toString(36).slice(2,9)}`}function Gae(e){return{id:e??Hae(),name:"未命名模板",labelType:"PRICE",unit:"cm",width:6,height:4,appliedLocation:"ALL",showRuler:!0,showGrid:!0,elements:[]}}const Rb=[{name:'2"×1"',width:2,height:1,unit:"inch"},{name:'2"×2"',width:2,height:2,unit:"inch"},{name:'3"×1"',width:3,height:1,unit:"inch"},{name:'3"×2"',width:3,height:2,unit:"inch"},{name:'4"×2"',width:4,height:2,unit:"inch"},{name:'4"×6"',width:4,height:6,unit:"inch"},{name:"6cm×4cm",width:6,height:4,unit:"cm"},{name:"10cm×6cm",width:10,height:6,unit:"cm"},{name:"A4",width:21,height:29.7,unit:"cm"},{name:"A5",width:14.8,height:21,unit:"cm"}];function Kae(e,t=20,r=20){const n=Vae(),o={TEXT_STATIC:{width:120,height:24,config:{text:"文本",fontFamily:"Arial",fontSize:14,fontWeight:"normal",textAlign:"left"}},TEXT_PRODUCT:{width:120,height:24,config:{text:"商品名",fontFamily:"Arial",fontSize:14,fontWeight:"normal",textAlign:"left"}},TEXT_PRICE:{width:80,height:24,config:{text:"0.00",prefix:"¥",decimal:2,fontFamily:"Arial",fontSize:14,fontWeight:"bold",textAlign:"right"}},BARCODE:{width:160,height:48,config:{barcodeType:"CODE128",data:"123456789",showText:!0,orientation:"horizontal"}},QRCODE:{width:80,height:80,config:{data:"https://example.com",errorLevel:"M"}},IMAGE:{width:60,height:60,config:{src:"",scaleMode:"contain"}},DATE:{width:120,height:24,config:{format:"YYYY-MM-DD",offsetDays:0}},TIME:{width:100,height:24,config:{format:"HH:mm",offsetDays:0}},DURATION:{width:120,height:24,config:{format:"YYYY-MM-DD",offsetDays:3}},WEIGHT:{width:80,height:24,config:{unit:"g",value:500}},WEIGHT_PRICE:{width:100,height:24,config:{unitPrice:10,weight:.5,currency:"¥"}},BLANK:{width:40,height:24,config:{}},NUTRITION:{width:200,height:120,config:{calories:120,fat:"5g",protein:"3g",carbs:"10g",layout:"standard"}}}[e];return{id:n,type:e,x:t,y:r,width:o.width,height:o.height,rotation:"horizontal",border:"none",config:{...o.config}}}function p3(){try{const e=localStorage.getItem(h3());if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}function m3(e){try{const t=localStorage.getItem(d3(e));return t?JSON.parse(t):null}catch{return null}}function Fk(){const e=p3(),t=[];for(const r of e){const n=m3(r);n&&t.push(n)}return t.sort((r,n)=>n.id>r.id?1:-1)}function Xae(e){localStorage.setItem(h3(),JSON.stringify(e))}function Yae(e){const t=d3(e.id);localStorage.setItem(t,JSON.stringify(e));const r=p3();r.includes(e.id)||(r.push(e.id),Xae(r))}function Qae(e){const t=Zae(e),r=_.forwardRef((n,i)=>{const{children:o,...s}=n,u=_.Children.toArray(o),f=u.find(ese);if(f){const l=f.props.children,d=u.map(p=>p===f?_.Children.count(l)>1?_.Children.only(null):_.isValidElement(l)?l.props.children:null:p);return h.jsx(t,{...s,ref:i,children:_.isValidElement(l)?_.cloneElement(l,void 0,d):null})}return h.jsx(t,{...s,ref:i,children:o})});return r.displayName=`${e}.Slot`,r}function Zae(e){const t=_.forwardRef((r,n)=>{const{children:i,...o}=r;if(_.isValidElement(i)){const s=rse(i),u=tse(o,i.props);return i.type!==_.Fragment&&(u.ref=n?ia(n,s):s),_.cloneElement(i,u)}return _.Children.count(i)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Jae=Symbol("radix.slottable");function ese(e){return _.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Jae}function tse(e,t){const r={...t};for(const n in t){const i=e[n],o=t[n];/^on[A-Z]/.test(n)?i&&o?r[n]=(...u)=>{const f=o(...u);return i(...u),f}:i&&(r[n]=i):n==="style"?r[n]={...i,...o}:n==="className"&&(r[n]=[i,o].filter(Boolean).join(" "))}return{...e,...r}}function rse(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var lm="Dialog",[v3]=In(lm),[nse,Ln]=v3(lm),g3=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:i,onOpenChange:o,modal:s=!0}=e,u=_.useRef(null),f=_.useRef(null),[l,d]=Pi({prop:n,defaultProp:i??!1,onChange:o,caller:lm});return h.jsx(nse,{scope:t,triggerRef:u,contentRef:f,contentId:Xn(),titleId:Xn(),descriptionId:Xn(),open:l,onOpenChange:d,onOpenToggle:_.useCallback(()=>d(p=>!p),[d]),modal:s,children:r})};g3.displayName=lm;var y3="DialogTrigger",ise=_.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=Ln(y3,r),o=Xe(t,i.triggerRef);return h.jsx(qe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":a_(i.open),...n,ref:o,onClick:ke(e.onClick,i.onOpenToggle)})});ise.displayName=y3;var i_="DialogPortal",[ose,x3]=v3(i_,{forceMount:void 0}),b3=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:i}=e,o=Ln(i_,t);return h.jsx(ose,{scope:t,forceMount:r,children:_.Children.map(n,s=>h.jsx(Or,{present:r||o.open,children:h.jsx(gu,{asChild:!0,container:i,children:s})}))})};b3.displayName=i_;var ap="DialogOverlay",w3=_.forwardRef((e,t)=>{const r=x3(ap,e.__scopeDialog),{forceMount:n=r.forceMount,...i}=e,o=Ln(ap,e.__scopeDialog);return o.modal?h.jsx(Or,{present:n||o.open,children:h.jsx(sse,{...i,ref:t})}):null});w3.displayName=ap;var ase=Qae("DialogOverlay.RemoveScroll"),sse=_.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=Ln(ap,r);return h.jsx(im,{as:ase,allowPinchZoom:!0,shards:[i.contentRef],children:h.jsx(qe.div,{"data-state":a_(i.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),ra="DialogContent",S3=_.forwardRef((e,t)=>{const r=x3(ra,e.__scopeDialog),{forceMount:n=r.forceMount,...i}=e,o=Ln(ra,e.__scopeDialog);return h.jsx(Or,{present:n||o.open,children:o.modal?h.jsx(lse,{...i,ref:t}):h.jsx(cse,{...i,ref:t})})});S3.displayName=ra;var lse=_.forwardRef((e,t)=>{const r=Ln(ra,e.__scopeDialog),n=_.useRef(null),i=Xe(t,r.contentRef,n);return _.useEffect(()=>{const o=n.current;if(o)return r_(o)},[]),h.jsx(_3,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ke(e.onCloseAutoFocus,o=>{o.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:ke(e.onPointerDownOutside,o=>{const s=o.detail.originalEvent,u=s.button===0&&s.ctrlKey===!0;(s.button===2||u)&&o.preventDefault()}),onFocusOutside:ke(e.onFocusOutside,o=>o.preventDefault())})}),cse=_.forwardRef((e,t)=>{const r=Ln(ra,e.__scopeDialog),n=_.useRef(!1),i=_.useRef(!1);return h.jsx(_3,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(n.current||r.triggerRef.current?.focus(),o.preventDefault()),n.current=!1,i.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(n.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const s=o.target;r.triggerRef.current?.contains(s)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),_3=_.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:o,...s}=e,u=Ln(ra,r),f=_.useRef(null),l=Xe(t,f);return qS(),h.jsxs(h.Fragment,{children:[h.jsx(Qp,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:o,children:h.jsx(mu,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":a_(u.open),...s,ref:l,onDismiss:()=>u.onOpenChange(!1)})}),h.jsxs(h.Fragment,{children:[h.jsx(use,{titleId:u.titleId}),h.jsx(dse,{contentRef:f,descriptionId:u.descriptionId})]})]})}),o_="DialogTitle",j3=_.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=Ln(o_,r);return h.jsx(qe.h2,{id:i.titleId,...n,ref:t})});j3.displayName=o_;var O3="DialogDescription",E3=_.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=Ln(O3,r);return h.jsx(qe.p,{id:i.descriptionId,...n,ref:t})});E3.displayName=O3;var P3="DialogClose",A3=_.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=Ln(P3,r);return h.jsx(qe.button,{type:"button",...n,ref:t,onClick:ke(e.onClick,()=>i.onOpenChange(!1))})});A3.displayName=P3;function a_(e){return e?"open":"closed"}var C3="DialogTitleWarning",[Zue,N3]=BF(C3,{contentName:ra,titleName:o_,docsSlug:"dialog"}),use=({titleId:e})=>{const t=N3(C3),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. - -If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. - -For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return _.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},fse="DialogDescriptionWarning",dse=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${N3(fse).contentName}}.`;return _.useEffect(()=>{const i=e.current?.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},hse=g3,pse=b3,mse=w3,vse=S3,gse=j3,yse=E3,xse=A3;function un({...e}){return h.jsx(hse,{"data-slot":"dialog",...e})}function bse({...e}){return h.jsx(pse,{"data-slot":"dialog-portal",...e})}function wse({className:e,...t}){return h.jsx(mse,{"data-slot":"dialog-overlay",className:Te("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t})}function fn({className:e,children:t,...r}){return h.jsxs(bse,{"data-slot":"dialog-portal",children:[h.jsx(wse,{}),h.jsxs(vse,{"data-slot":"dialog-content",className:Te("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...r,children:[t,h.jsxs(xse,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[h.jsx(uc,{}),h.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function dn({className:e,...t}){return h.jsx("div",{"data-slot":"dialog-header",className:Te("flex flex-col gap-2 text-center sm:text-left",e),...t})}function $n({className:e,...t}){return h.jsx("div",{"data-slot":"dialog-footer",className:Te("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function hn({className:e,...t}){return h.jsx(gse,{"data-slot":"dialog-title",className:Te("text-lg leading-none font-semibold",e),...t})}function ki({className:e,...t}){return h.jsx(yse,{"data-slot":"dialog-description",className:Te("text-muted-foreground text-sm",e),...t})}const Sse=[{title:"模版信息",items:[{label:"Text",type:"TEXT_STATIC"},{label:"QR Code",type:"QRCODE"},{label:"Barcode",type:"BARCODE"},{label:"Blank Space",type:"BLANK"},{label:"Price",type:"TEXT_PRICE"},{label:"Image",type:"IMAGE"},{label:"Logo",type:"IMAGE"}]},{title:"标签信息",items:[{label:"Label Name",type:"TEXT_PRODUCT"},{label:"Text",type:"TEXT_STATIC"},{label:"QR Code",type:"QRCODE"},{label:"Barcode",type:"BARCODE"},{label:"Nutrition Facts",type:"NUTRITION"},{label:"Price",type:"TEXT_PRICE"},{label:"Duration Date",type:"DATE"},{label:"Duration Time",type:"TIME"},{label:"Duration",type:"DURATION"},{label:"Image",type:"IMAGE"},{label:"Label Type",type:"TEXT_STATIC"},{label:"How-to",type:"TEXT_STATIC"},{label:"Expiration Alert",type:"TEXT_STATIC"}]},{title:"自动生成",items:[{label:"Company",type:"TEXT_STATIC"},{label:"Employee",type:"TEXT_STATIC"},{label:"Current Date",type:"DATE"},{label:"Current Time",type:"TIME"},{label:"Label ID",type:"TEXT_STATIC"}]},{title:"打印时输入",subtitle:"点击添加到画布",items:[{label:"Text",type:"TEXT_STATIC",config:{inputType:"text"}},{label:"Weight",type:"WEIGHT"},{label:"Number",type:"TEXT_STATIC",config:{inputType:"number",text:"0"}},{label:"Date & Time",type:"DATE",config:{inputType:"datetime"}},{label:"Multiple Options",type:"TEXT_STATIC",config:{inputType:"options"}}]}];function _se({onAddElement:e}){return h.jsxs("div",{className:"w-44 shrink-0 border-r border-gray-200 bg-white flex flex-col h-full",children:[h.jsx("div",{className:"px-2 py-2 border-b border-gray-200 font-semibold text-gray-800 text-sm",children:"Elements"}),h.jsx(wc,{className:"flex-1",children:h.jsx("div",{className:"p-1.5 space-y-3",children:Sse.map(t=>h.jsxs("div",{children:[h.jsx("div",{className:"px-2 py-1 text-xs font-medium text-gray-500 uppercase tracking-wide",children:t.title}),t.subtitle&&h.jsx("div",{className:"px-2 py-0.5 text-[10px] text-gray-400",children:t.subtitle}),h.jsx("div",{className:"grid grid-cols-2 gap-1 mt-0.5",children:t.items.map((r,n)=>h.jsx("button",{type:"button",onClick:()=>e(r.type,r.config),className:"text-left px-2 py-1 text-xs rounded hover:bg-gray-100 border border-transparent hover:border-gray-200 truncate",children:r.label},`${t.title}-${r.label}-${n}`))})]},t.title))})})]})}var nd={},Jl={},id={},zk;function Vr(){if(zk)return id;zk=1,Object.defineProperty(id,"__esModule",{value:!0});function e(r,n){if(!(r instanceof n))throw new TypeError("Cannot call a class as a function")}var t=function r(n,i){e(this,r),this.data=n,this.text=i.text||n,this.options=i};return id.default=t,id}var qk;function jse(){if(qk)return Jl;qk=1,Object.defineProperty(Jl,"__esModule",{value:!0}),Jl.CODE39=void 0;var e=(function(){function y(w,j){for(var O=0;O=200){w=m.shift()-105;var j=n.SWAP[w];j!==void 0?y=d.next(m,g+1,j):((b===n.SET_A||b===n.SET_B)&&w===n.SHIFT&&(m[0]=b===n.SET_A?m[0]>95?m[0]-96:m[0]:m[0]<32?m[0]+96:m[0]),y=d.next(m,g+1,b))}else w=d.correctIndex(m,b),y=d.next(m,g+1,b);var O=d.getBar(w),E=w*g;return{result:O+y.result,checksum:E+y.checksum}}}]),d})(r.default);return ad.default=f,ad}var sd={},Hk;function Ose(){if(Hk)return sd;Hk=1,Object.defineProperty(sd,"__esModule",{value:!0});var e=yu(),t=function(u){return u.match(new RegExp("^"+e.A_CHARS+"*"))[0].length},r=function(u){return u.match(new RegExp("^"+e.B_CHARS+"*"))[0].length},n=function(u){return u.match(new RegExp("^"+e.C_CHARS+"*"))[0]};function i(s,u){var f=u?e.A_CHARS:e.B_CHARS,l=s.match(new RegExp("^("+f+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(l)return l[1]+"Ì"+o(s.substring(l[1].length));var d=s.match(new RegExp("^"+f+"+"))[0];return d.length===s.length?s:d+String.fromCharCode(u?205:206)+i(s.substring(d.length),!u)}function o(s){var u=n(s),f=u.length;if(f===s.length)return s;s=s.substring(f);var l=t(s)>=r(s);return u+String.fromCharCode(l?206:205)+i(s,l)}return sd.default=function(s){var u=void 0,f=n(s).length;if(f>=2)u=e.C_START_CHAR+o(s);else{var l=t(s)>r(s);u=(l?e.A_START_CHAR:e.B_START_CHAR)+i(s,l)}return u.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(d,p){return"Ë"+p})},sd}var Vk;function Ese(){if(Vk)return od;Vk=1,Object.defineProperty(od,"__esModule",{value:!0});var e=cm(),t=i(e),r=Ose(),n=i(r);function i(l){return l&&l.__esModule?l:{default:l}}function o(l,d){if(!(l instanceof d))throw new TypeError("Cannot call a class as a function")}function s(l,d){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return d&&(typeof d=="object"||typeof d=="function")?d:l}function u(l,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof d);l.prototype=Object.create(d&&d.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),d&&(Object.setPrototypeOf?Object.setPrototypeOf(l,d):l.__proto__=d)}var f=(function(l){u(d,l);function d(p,m){if(o(this,d),/^[\x00-\x7F\xC8-\xD3]+$/.test(p))var g=s(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,(0,n.default)(p),m));else var g=s(this,(d.__proto__||Object.getPrototypeOf(d)).call(this,p,m));return s(g)}return d})(t.default);return od.default=f,od}var ld={},Gk;function Pse(){if(Gk)return ld;Gk=1,Object.defineProperty(ld,"__esModule",{value:!0});var e=(function(){function l(d,p){for(var m=0;mb.width*10?b.width*10:b.fontSize,y.guardHeight=b.height+y.fontSize/2+b.textMargin,y}return e(m,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(b,y){return this.text.substr(b,y)}},{key:"leftEncode",value:function(b,y){return(0,n.default)(b,y)}},{key:"rightText",value:function(b,y){return this.text.substr(b,y)}},{key:"rightEncode",value:function(b,y){return(0,n.default)(b,y)}},{key:"encodeGuarded",value:function(){var b={fontSize:this.fontSize},y={height:this.guardHeight};return[{data:t.SIDE_BIN,options:y},{data:this.leftEncode(),text:this.leftText(),options:b},{data:t.MIDDLE_BIN,options:y},{data:this.rightEncode(),text:this.rightText(),options:b},{data:t.SIDE_BIN,options:y}]}},{key:"encodeFlat",value:function(){var b=[t.SIDE_BIN,this.leftEncode(),t.MIDDLE_BIN,this.rightEncode(),t.SIDE_BIN];return{data:b.join(""),text:this.text}}}]),m})(o.default);return dd.default=d,dd}var eR;function Tse(){if(eR)return fd;eR=1,Object.defineProperty(fd,"__esModule",{value:!0});var e=(function(){function p(m,g){for(var b=0;bb.width*10?y.fontSize=b.width*10:y.fontSize=b.fontSize,y.guardHeight=b.height+y.fontSize/2+b.textMargin,y}return e(m,[{key:"valid",value:function(){return this.data.search(/^[0-9]{12}$/)!==-1&&this.data[11]==d(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var b="";return b+="101",b+=(0,r.default)(this.data.substr(0,6),"LLLLLL"),b+="01010",b+=(0,r.default)(this.data.substr(6,6),"RRRRRR"),b+="101",{data:b,text:this.text}}},{key:"guardedEncoding",value:function(){var b=[];return this.displayValue&&b.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),b.push({data:"101"+(0,r.default)(this.data[0],"L"),options:{height:this.guardHeight}}),b.push({data:(0,r.default)(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),b.push({data:"01010",options:{height:this.guardHeight}}),b.push({data:(0,r.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),b.push({data:(0,r.default)(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&b.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),b}}]),m})(i.default);function d(p){var m=0,g;for(g=1;g<11;g+=2)m+=parseInt(p[g]);for(g=0;g<11;g+=2)m+=parseInt(p[g])*3;return(10-m%10)%10}return ec.default=l,ec}var gd={},oR;function Ise(){if(oR)return gd;oR=1,Object.defineProperty(gd,"__esModule",{value:!0});var e=(function(){function b(y,w){for(var j=0;jj.width*10?O.fontSize=j.width*10:O.fontSize=j.fontSize,O.guardHeight=j.height+O.fontSize/2+j.textMargin,O}return e(y,[{key:"valid",value:function(){return this.isValid}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var j="";return j+="101",j+=this.encodeMiddleDigits(),j+="010101",{data:j,text:this.text}}},{key:"guardedEncoding",value:function(){var j=[];return this.displayValue&&j.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),j.push({data:"101",options:{height:this.guardHeight}}),j.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),j.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&j.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),j}},{key:"encodeMiddleDigits",value:function(){var j=this.upcA[0],O=this.upcA[this.upcA.length-1],E=p[parseInt(O)][parseInt(j)];return(0,r.default)(this.middleDigits,E)}}]),y})(i.default);function g(b,y){for(var w=parseInt(b[b.length-1]),j=d[w],O="",E=0,N=0;N=3&&this.number<=131070}}]),l})(r.default);return rc.pharmacode=u,rc}var nc={},xR;function Vse(){if(xR)return nc;xR=1,Object.defineProperty(nc,"__esModule",{value:!0}),nc.codabar=void 0;var e=(function(){function f(l,d){for(var p=0;p":["(%)","I"],"?":["(%)","J"],"@":["(%)","V"],"[":["(%)","K"],"\\":["(%)","L"],"]":["(%)","M"],"^":["(%)","N"],_:["(%)","O"],"`":["(%)","W"],a:["(+)","A"],b:["(+)","B"],c:["(+)","C"],d:["(+)","D"],e:["(+)","E"],f:["(+)","F"],g:["(+)","G"],h:["(+)","H"],i:["(+)","I"],j:["(+)","J"],k:["(+)","K"],l:["(+)","L"],m:["(+)","M"],n:["(+)","N"],o:["(+)","O"],p:["(+)","P"],q:["(+)","Q"],r:["(+)","R"],s:["(+)","S"],t:["(+)","T"],u:["(+)","U"],v:["(+)","V"],w:["(+)","W"],x:["(+)","X"],y:["(+)","Y"],z:["(+)","Z"],"{":["(%)","P"],"|":["(%)","Q"],"}":["(%)","R"],"~":["(%)","S"],"":["(%)","T"]}),Va}var wR;function M3(){if(wR)return Od;wR=1,Object.defineProperty(Od,"__esModule",{value:!0});var e=(function(){function l(d,p){for(var m=0;m0?d.fontSize+d.textMargin:0)+d.marginTop+d.marginBottom}function i(l,d,p){if(p.displayValue&&dd&&(d=l[p].height);return d}function f(l,d,p){var m;if(p)m=p;else if(typeof document<"u")m=document.createElement("canvas").getContext("2d");else return 0;m.font=d.fontOptions+" "+d.fontSize+"px "+d.font;var g=m.measureText(l);if(!g)return 0;var b=g.width;return b}return Mr.getMaximumHeightOfEncodings=u,Mr.getEncodingHeight=n,Mr.getBarcodePadding=i,Mr.calculateEncodingAttributes=o,Mr.getTotalWidthOfEncodings=s,Mr}var RR;function tle(){if(RR)return Id;RR=1,Object.defineProperty(Id,"__esModule",{value:!0});var e=(function(){function u(f,l){for(var d=0;d0?(g=0,p.textAlign="left"):l.textAlign=="right"?(g=d.width-1,p.textAlign="right"):(g=d.width/2,p.textAlign="center"),p.fillText(d.text,g,b)}}},{key:"moveCanvasDrawing",value:function(l){var d=this.canvas.getContext("2d");d.translate(l.width,0)}},{key:"restoreCanvas",value:function(){var l=this.canvas.getContext("2d");l.restore()}}]),u})();return Id.default=s,Id}var Dd={},MR;function rle(){if(MR)return Dd;MR=1,Object.defineProperty(Dd,"__esModule",{value:!0});var e=(function(){function f(l,d){for(var p=0;p0&&(this.drawRect(w-p.width*y,b,p.width*y,p.height,d),y=0);y>0&&this.drawRect(w-p.width*(y-1),b,p.width*y,p.height,d)}},{key:"drawSVGText",value:function(d,p,m){var g=this.document.createElementNS(s,"text");if(p.displayValue){var b,y;g.setAttribute("font-family",p.font),g.setAttribute("font-size",p.fontSize),p.fontOptions.includes("bold")&&g.setAttribute("font-weight","bold"),p.fontOptions.includes("italic")&&g.setAttribute("font-style","italic"),p.textPosition=="top"?y=p.fontSize-p.textMargin:y=p.height+p.textMargin+p.fontSize,p.textAlign=="left"||m.barcodePadding>0?(b=0,g.setAttribute("text-anchor","start")):p.textAlign=="right"?(b=m.width-1,g.setAttribute("text-anchor","end")):(b=m.width/2,g.setAttribute("text-anchor","middle")),g.setAttribute("x",b),g.setAttribute("y",y),g.appendChild(this.document.createTextNode(m.text)),d.appendChild(g)}}},{key:"setSvgAttributes",value:function(d,p){var m=this.svg;m.setAttribute("width",d+"px"),m.setAttribute("height",p+"px"),m.setAttribute("x","0px"),m.setAttribute("y","0px"),m.setAttribute("viewBox","0 0 "+d+" "+p),m.setAttribute("xmlns",s),m.setAttribute("version","1.1")}},{key:"createGroup",value:function(d,p,m){var g=this.document.createElementNS(s,"g");return g.setAttribute("transform","translate("+d+", "+p+")"),m.appendChild(g),g}},{key:"setGroupOptions",value:function(d,p){d.setAttribute("fill",p.lineColor)}},{key:"drawRect",value:function(d,p,m,g,b){var y=this.document.createElementNS(s,"rect");return y.setAttribute("x",d),y.setAttribute("y",p),y.setAttribute("width",m),y.setAttribute("height",g),b.appendChild(y),y}}]),f})();return Dd.default=u,Dd}var Ld={},IR;function nle(){if(IR)return Ld;IR=1,Object.defineProperty(Ld,"__esModule",{value:!0});var e=(function(){function n(i,o){for(var s=0;s"u"?"undefined":e(d))==="object"&&!d.nodeName)return{element:d,renderer:i.default.ObjectRenderer};throw new o.InvalidElementException}}function f(d){var p=document.querySelectorAll(d);if(p.length!==0){for(var m=[],g=0;g"u")throw Error("No element to render on was provided.");return U._renderProperties=(0,l.default)(z),U._encodings=[],U._options=w.default,U._errorHandler=new g.default(U),typeof $<"u"&&(L=L||{},L.format||(L.format=T()),U.options(L)[L.format]($,L).render()),U};E.getModule=function(I){return t.default[I]};for(var N in t.default)t.default.hasOwnProperty(N)&&A(t.default,N);function A(I,z){O.prototype[z]=O.prototype[z.toUpperCase()]=O.prototype[z.toLowerCase()]=function($,L){var U=this;return U._errorHandler.wrapBarcodeCall(function(){L.text=typeof L.text>"u"?void 0:""+L.text;var W=(0,n.default)(U._options,L);W=(0,p.default)(W);var V=I[z],G=C($,V,W);return U._encodings.push(G),U})}}function C(I,z,$){I=""+I;var L=new z(I,$);if(!L.valid())throw new b.InvalidInputException(L.constructor.name,I);var U=L.encode();U=(0,o.default)(U);for(var W=0;Wt in e?ule(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,bw=(e,t)=>{for(var r in t||(t={}))B3.call(t,r)&&zR(e,r,t[r]);if(sp)for(var r of sp(t))F3.call(t,r)&&zR(e,r,t[r]);return e},ww=(e,t)=>{var r={};for(var n in e)B3.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&sp)for(var n of sp(e))t.indexOf(n)<0&&F3.call(e,n)&&(r[n]=e[n]);return r};/** - * @license QR Code generator library (TypeScript) - * Copyright (c) Project Nayuki. - * SPDX-License-Identifier: MIT - */var na;(e=>{const t=class Ge{constructor(f,l,d,p){if(this.version=f,this.errorCorrectionLevel=l,this.modules=[],this.isFunction=[],fGe.MAX_VERSION)throw new RangeError("Version value out of range");if(p<-1||p>7)throw new RangeError("Mask value out of range");this.size=f*4+17;let m=[];for(let b=0;b7)throw new RangeError("Invalid value");let b,y;for(b=d;;b++){const E=Ge.getNumDataCodewords(b,l)*8,N=s.getTotalBits(f,b);if(N<=E){y=N;break}if(b>=p)throw new RangeError("Data too long")}for(const E of[Ge.Ecc.MEDIUM,Ge.Ecc.QUARTILE,Ge.Ecc.HIGH])g&&y<=Ge.getNumDataCodewords(b,E)*8&&(l=E);let w=[];for(const E of f){r(E.mode.modeBits,4,w),r(E.numChars,E.mode.numCharCountBits(b),w);for(const N of E.getData())w.push(N)}i(w.length==y);const j=Ge.getNumDataCodewords(b,l)*8;i(w.length<=j),r(0,Math.min(4,j-w.length),w),r(0,(8-w.length%8)%8,w),i(w.length%8==0);for(let E=236;w.lengthO[N>>>3]|=E<<7-(N&7)),new Ge(b,l,O,m)}getModule(f,l){return 0<=f&&f>>9)*1335;const p=(l<<10|d)^21522;i(p>>>15==0);for(let m=0;m<=5;m++)this.setFunctionModule(8,m,n(p,m));this.setFunctionModule(8,7,n(p,6)),this.setFunctionModule(8,8,n(p,7)),this.setFunctionModule(7,8,n(p,8));for(let m=9;m<15;m++)this.setFunctionModule(14-m,8,n(p,m));for(let m=0;m<8;m++)this.setFunctionModule(this.size-1-m,8,n(p,m));for(let m=8;m<15;m++)this.setFunctionModule(8,this.size-15+m,n(p,m));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let f=this.version;for(let d=0;d<12;d++)f=f<<1^(f>>>11)*7973;const l=this.version<<12|f;i(l>>>18==0);for(let d=0;d<18;d++){const p=n(l,d),m=this.size-11+d%3,g=Math.floor(d/3);this.setFunctionModule(m,g,p),this.setFunctionModule(g,m,p)}}drawFinderPattern(f,l){for(let d=-4;d<=4;d++)for(let p=-4;p<=4;p++){const m=Math.max(Math.abs(p),Math.abs(d)),g=f+p,b=l+d;0<=g&&g{(E!=y-m||A>=b)&&O.push(N[E])});return i(O.length==g),O}drawCodewords(f){if(f.length!=Math.floor(Ge.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let l=0;for(let d=this.size-1;d>=1;d-=2){d==6&&(d=5);for(let p=0;p>>3],7-(l&7)),l++)}}i(l==f.length*8)}applyMask(f){if(f<0||f>7)throw new RangeError("Mask value out of range");for(let l=0;l5&&f++):(this.finderPenaltyAddHistory(b,y),g||(f+=this.finderPenaltyCountPatterns(y)*Ge.PENALTY_N3),g=this.modules[m][w],b=1);f+=this.finderPenaltyTerminateAndCount(g,b,y)*Ge.PENALTY_N3}for(let m=0;m5&&f++):(this.finderPenaltyAddHistory(b,y),g||(f+=this.finderPenaltyCountPatterns(y)*Ge.PENALTY_N3),g=this.modules[w][m],b=1);f+=this.finderPenaltyTerminateAndCount(g,b,y)*Ge.PENALTY_N3}for(let m=0;mg+(b?1:0),l);const d=this.size*this.size,p=Math.ceil(Math.abs(l*20-d*10)/d)-1;return i(0<=p&&p<=9),f+=p*Ge.PENALTY_N4,i(0<=f&&f<=2568888),f}getAlignmentPatternPositions(){if(this.version==1)return[];{const f=Math.floor(this.version/7)+2,l=this.version==32?26:Math.ceil((this.version*4+4)/(f*2-2))*2;let d=[6];for(let p=this.size-7;d.lengthGe.MAX_VERSION)throw new RangeError("Version number out of range");let l=(16*f+128)*f+64;if(f>=2){const d=Math.floor(f/7)+2;l-=(25*d-10)*d-55,f>=7&&(l-=36)}return i(208<=l&&l<=29648),l}static getNumDataCodewords(f,l){return Math.floor(Ge.getNumRawDataModules(f)/8)-Ge.ECC_CODEWORDS_PER_BLOCK[l.ordinal][f]*Ge.NUM_ERROR_CORRECTION_BLOCKS[l.ordinal][f]}static reedSolomonComputeDivisor(f){if(f<1||f>255)throw new RangeError("Degree out of range");let l=[];for(let p=0;p0);for(const p of f){const m=p^d.shift();d.push(0),l.forEach((g,b)=>d[b]^=Ge.reedSolomonMultiply(g,m))}return d}static reedSolomonMultiply(f,l){if(f>>>8||l>>>8)throw new RangeError("Byte out of range");let d=0;for(let p=7;p>=0;p--)d=d<<1^(d>>>7)*285,d^=(l>>>p&1)*f;return i(d>>>8==0),d}finderPenaltyCountPatterns(f){const l=f[1];i(l<=this.size*3);const d=l>0&&f[2]==l&&f[3]==l*3&&f[4]==l&&f[5]==l;return(d&&f[0]>=l*4&&f[6]>=l?1:0)+(d&&f[6]>=l*4&&f[0]>=l?1:0)}finderPenaltyTerminateAndCount(f,l,d){return f&&(this.finderPenaltyAddHistory(l,d),l=0),l+=this.size,this.finderPenaltyAddHistory(l,d),this.finderPenaltyCountPatterns(d)}finderPenaltyAddHistory(f,l){l[0]==0&&(f+=this.size),l.pop(),l.unshift(f)}};t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;function r(u,f,l){if(f<0||f>31||u>>>f)throw new RangeError("Value out of range");for(let d=f-1;d>=0;d--)l.push(u>>>d&1)}function n(u,f){return(u>>>f&1)!=0}function i(u){if(!u)throw new Error("Assertion error")}const o=class Et{constructor(f,l,d){if(this.mode=f,this.numChars=l,this.bitData=d,l<0)throw new RangeError("Invalid argument");this.bitData=d.slice()}static makeBytes(f){let l=[];for(const d of f)r(d,8,l);return new Et(Et.Mode.BYTE,f.length,l)}static makeNumeric(f){if(!Et.isNumeric(f))throw new RangeError("String contains non-numeric characters");let l=[];for(let d=0;d=1<{(t=>{const r=class{constructor(i,o){this.ordinal=i,this.formatBits=o}};r.LOW=new r(0,1),r.MEDIUM=new r(1,0),r.QUARTILE=new r(2,3),r.HIGH=new r(3,2),t.Ecc=r})(e.QrCode||(e.QrCode={}))})(na||(na={}));(e=>{(t=>{const r=class{constructor(i,o){this.modeBits=i,this.numBitsCharCount=o}numCharCountBits(i){return this.numBitsCharCount[Math.floor((i+7)/17)]}};r.NUMERIC=new r(1,[10,12,14]),r.ALPHANUMERIC=new r(2,[9,11,13]),r.BYTE=new r(4,[8,16,16]),r.KANJI=new r(8,[8,10,12]),r.ECI=new r(7,[0,0,0]),t.Mode=r})(e.QrSegment||(e.QrSegment={}))})(na||(na={}));var es=na;/** - * @license qrcode.react - * Copyright (c) Paul O'Shannessy - * SPDX-License-Identifier: ISC - */var fle={L:es.QrCode.Ecc.LOW,M:es.QrCode.Ecc.MEDIUM,Q:es.QrCode.Ecc.QUARTILE,H:es.QrCode.Ecc.HIGH},z3=128,q3="L",U3="#FFFFFF",W3="#000000",H3=!1,V3=1,dle=4,hle=0,ple=.1;function G3(e,t=0){const r=[];return e.forEach(function(n,i){let o=null;n.forEach(function(s,u){if(!s&&o!==null){r.push(`M${o+t} ${i+t}h${u-o}v1H${o+t}z`),o=null;return}if(u===n.length-1){if(!s)return;o===null?r.push(`M${u+t},${i+t} h1v1H${u+t}z`):r.push(`M${o+t},${i+t} h${u+1-o}v1H${o+t}z`);return}s&&o===null&&(o=u)})}),r.join("")}function K3(e,t){return e.slice().map((r,n)=>n=t.y+t.h?r:r.map((i,o)=>o=t.x+t.w?i:!1))}function mle(e,t,r,n){if(n==null)return null;const i=e.length+r*2,o=Math.floor(t*ple),s=i/t,u=(n.width||o)*s,f=(n.height||o)*s,l=n.x==null?e.length/2-u/2:n.x*s,d=n.y==null?e.length/2-f/2:n.y*s,p=n.opacity==null?1:n.opacity;let m=null;if(n.excavate){let b=Math.floor(l),y=Math.floor(d),w=Math.ceil(u+l-b),j=Math.ceil(f+d-y);m={x:b,y,w,h:j}}const g=n.crossOrigin;return{x:l,y:d,h:f,w:u,excavation:m,opacity:p,crossOrigin:g}}function vle(e,t){return t!=null?Math.max(Math.floor(t),0):e?dle:hle}function X3({value:e,level:t,minVersion:r,includeMargin:n,marginSize:i,imageSettings:o,size:s,boostLevel:u}){let f=F.useMemo(()=>{const b=(Array.isArray(e)?e:[e]).reduce((y,w)=>(y.push(...es.QrSegment.makeSegments(w)),y),[]);return es.QrCode.encodeSegments(b,fle[t],r,void 0,void 0,u)},[e,t,r,u]);const{cells:l,margin:d,numCells:p,calculatedImageSettings:m}=F.useMemo(()=>{let g=f.getModules();const b=vle(n,i),y=g.length+b*2,w=mle(g,s,b,o);return{cells:g,margin:b,numCells:y,calculatedImageSettings:w}},[f,s,o,n,i]);return{qrcode:f,margin:d,cells:l,numCells:p,calculatedImageSettings:m}}var gle=(function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0})(),yle=F.forwardRef(function(t,r){const n=t,{value:i,size:o=z3,level:s=q3,bgColor:u=U3,fgColor:f=W3,includeMargin:l=H3,minVersion:d=V3,boostLevel:p,marginSize:m,imageSettings:g}=n,y=ww(n,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:w}=y,j=ww(y,["style"]),O=g?.src,E=F.useRef(null),N=F.useRef(null),A=F.useCallback(W=>{E.current=W,typeof r=="function"?r(W):r&&(r.current=W)},[r]),[C,T]=F.useState(!1),{margin:R,cells:I,numCells:z,calculatedImageSettings:$}=X3({value:i,level:s,minVersion:d,boostLevel:p,includeMargin:l,marginSize:m,imageSettings:g,size:o});F.useEffect(()=>{if(E.current!=null){const W=E.current,V=W.getContext("2d");if(!V)return;let G=I;const Y=N.current,D=$!=null&&Y!==null&&Y.complete&&Y.naturalHeight!==0&&Y.naturalWidth!==0;D&&$.excavation!=null&&(G=K3(I,$.excavation));const Q=window.devicePixelRatio||1;W.height=W.width=o*Q;const J=o/z*Q;V.scale(J,J),V.fillStyle=u,V.fillRect(0,0,z,z),V.fillStyle=f,gle?V.fill(new Path2D(G3(G,R))):I.forEach(function(M,B){M.forEach(function(Z,te){Z&&V.fillRect(te+R,B+R,1,1)})}),$&&(V.globalAlpha=$.opacity),D&&V.drawImage(Y,$.x+R,$.y+R,$.w,$.h)}}),F.useEffect(()=>{T(!1)},[O]);const L=bw({height:o,width:o},w);let U=null;return O!=null&&(U=F.createElement("img",{src:O,key:O,style:{display:"none"},onLoad:()=>{T(!0)},ref:N,crossOrigin:$?.crossOrigin})),F.createElement(F.Fragment,null,F.createElement("canvas",bw({style:L,height:o,width:o,ref:A,role:"img"},j)),U)});yle.displayName="QRCodeCanvas";var Y3=F.forwardRef(function(t,r){const n=t,{value:i,size:o=z3,level:s=q3,bgColor:u=U3,fgColor:f=W3,includeMargin:l=H3,minVersion:d=V3,boostLevel:p,title:m,marginSize:g,imageSettings:b}=n,y=ww(n,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:w,cells:j,numCells:O,calculatedImageSettings:E}=X3({value:i,level:s,minVersion:d,boostLevel:p,includeMargin:l,marginSize:g,imageSettings:b,size:o});let N=j,A=null;b!=null&&E!=null&&(E.excavation!=null&&(N=K3(j,E.excavation)),A=F.createElement("image",{href:b.src,height:E.h,width:E.w,x:E.x+w,y:E.y+w,preserveAspectRatio:"none",opacity:E.opacity,crossOrigin:E.crossOrigin}));const C=G3(N,w);return F.createElement("svg",bw({height:o,width:o,viewBox:`0 0 ${O} ${O}`,ref:r,role:"img"},y),!!m&&F.createElement("title",null,m),F.createElement("path",{fill:u,d:`M0,0 h${O}v${O}H0z`,shapeRendering:"crispEdges"}),F.createElement("path",{fill:f,d:C,shapeRendering:"crispEdges"}),A)});Y3.displayName="QRCodeSVG";function xle({data:e,width:t,height:r,showText:n,orientation:i="horizontal"}){const o=_.useRef(null),s=i==="vertical",u=Math.max(20,(s?t:r)-(n?14:4));_.useEffect(()=>{if(o.current&&e)try{cle(o.current,e,{format:"CODE128",width:1,height:u,displayValue:n!==!1,margin:2,fontOptions:"",fontSize:10})}catch{}},[e,u,n]);const f=h.jsx("svg",{ref:o,className:"w-full h-full min-h-0",style:{maxHeight:s?t:r}});return s?h.jsx("div",{className:"w-full h-full flex items-center justify-center",children:h.jsx("div",{style:{transform:"rotate(-90deg)",transformOrigin:"center center",width:r,height:t,display:"flex",alignItems:"center",justifyContent:"center"},children:f})}):f}const yc=8;function Ka(e){return Math.round(e/yc)*yc}function lp(e,t){return t==="cm"?e*37.8:e*96}function qR(e,t){return t==="cm"?e/37.8:e/96}function Q3({el:e}){const t=e.config,r=e.type,n={fontSize:t?.fontSize??14,fontFamily:t?.fontFamily??"Arial",fontWeight:t?.fontWeight??"normal",textAlign:t?.textAlign??"left",color:t?.color??"#000"},i=t?.inputType;if(r==="TEXT_STATIC"){const o=t?.text??"文本";return i==="number"?h.jsx("input",{type:"number",readOnly:!0,value:t?.text??"0",className:"w-full h-full min-w-0 border border-gray-300 bg-white rounded px-1 pointer-events-none",style:{...n,textAlign:"right"}}):i==="options"?h.jsxs("div",{className:"w-full h-full min-w-0 border border-gray-300 bg-white rounded px-1 flex items-center pointer-events-none text-gray-500",style:n,children:[h.jsx("span",{className:"truncate flex-1",children:o||"请选择..."}),h.jsx("span",{className:"ml-auto text-gray-400",children:"▼"})]}):i==="text"?h.jsx("input",{type:"text",readOnly:!0,value:o,className:"w-full h-full min-w-0 border border-gray-300 bg-white rounded px-1 pointer-events-none",style:n}):h.jsx("div",{className:"w-full h-full px-1 overflow-hidden whitespace-pre-wrap break-all leading-tight",style:n,children:o})}if(r==="TEXT_PRODUCT"){const o=t?.text??"商品名";return h.jsx("div",{className:"w-full h-full px-1 overflow-hidden whitespace-pre-wrap break-all leading-tight",style:n,children:o})}if(r==="TEXT_PRICE"){const o=t?.prefix??"¥",s=t?.text??"0.00";return h.jsxs("div",{className:"w-full h-full px-1 overflow-hidden flex items-center",style:{...n,justifyContent:n.textAlign==="center"?"center":n.textAlign==="right"?"flex-end":"flex-start"},children:[h.jsx("span",{children:o}),h.jsx("span",{children:s})]})}if(r==="BARCODE"){const o=t?.data??"123456789",s=t?.showText!==!1,u=t?.orientation==="vertical"?"vertical":"horizontal";return h.jsx("div",{className:"flex flex-col items-center justify-center w-full h-full overflow-hidden p-0.5",children:h.jsx("div",{className:"flex-1 w-full min-h-0 flex items-center justify-center",children:h.jsx(xle,{data:o,width:e.width,height:e.height,showText:s,orientation:u})})})}if(r==="QRCODE"){const o=t?.data??"https://example.com",s=Math.min(e.width,e.height)-4;return h.jsx("div",{className:"w-full h-full flex items-center justify-center p-0.5",children:h.jsx(Y3,{value:o,size:Math.max(20,s),level:"M",includeMargin:!1})})}if(r==="IMAGE"){const o=t?.src;return o?h.jsx("img",{src:o,alt:"",className:"w-full h-full object-contain"}):h.jsx("div",{className:"w-full h-full flex flex-col items-center justify-center bg-gray-100 text-gray-500 text-[10px] border border-dashed border-gray-300",children:h.jsx("span",{className:"font-medium",children:"Logo"})})}if(r==="DATE"){const s=(t?.format??"YYYY-MM-DD").replace("YYYY","2025").replace("MM","02").replace("DD","01");return t?.inputType==="datetime"||t?.inputType==="date"?h.jsx("input",{type:"date",readOnly:!0,value:"2025-02-01",className:"w-full h-full min-w-0 border border-gray-300 bg-white rounded px-1 pointer-events-none text-[10px]",style:n}):h.jsx("div",{className:"w-full h-full px-1 overflow-hidden whitespace-nowrap",style:n,children:s})}if(r==="TIME"){const s=(t?.format??"HH:mm").replace("HH","12").replace("mm","30");return h.jsx("div",{className:"w-full h-full px-1 overflow-hidden whitespace-nowrap",style:n,children:s})}if(r==="DURATION")return h.jsx("div",{className:"w-full h-full px-1 overflow-hidden whitespace-nowrap",style:n,children:"保质期 2025-02-04"});if(r==="WEIGHT"){const o=t?.value??500,s=t?.unit??"g";return h.jsxs("div",{className:"w-full h-full px-1 overflow-hidden whitespace-nowrap",style:n,children:[o,s]})}if(r==="WEIGHT_PRICE"){const o=t?.unitPrice??10,s=t?.weight??.5,u=t?.currency??"¥";return h.jsxs("div",{className:"w-full h-full px-1 overflow-hidden whitespace-nowrap",style:n,children:[u,(o*s).toFixed(2)]})}if(r==="NUTRITION"){const o=t?.calories??120;return h.jsxs("div",{className:"text-[8px] p-0.5 w-full h-full overflow-hidden flex flex-col",children:[h.jsx("div",{className:"font-semibold border-b border-black",children:"Nutrition Facts"}),h.jsxs("div",{children:["Calories ",o]})]})}return r==="BLANK"?h.jsx("div",{className:"w-full h-full border border-dashed border-gray-200"}):h.jsx("div",{className:"text-gray-500 text-[10px] px-1 truncate w-full flex items-center justify-center",children:e.type.replace(/_/g," ")})}function ble({template:e,selectedId:t,onSelect:r,onUpdateElement:n,onDeleteElement:i,onTemplateChange:o,scale:s=1,onZoomIn:u,onZoomOut:f,onPreview:l}){const d=_.useRef(null),p=_.useRef(null),m=_.useRef(null),g=_.useRef(null),b=_.useRef(null),y=_.useRef(null),w=_.useRef(null),[j,O]=F.useState(!1),[E,N]=F.useState(!1),A=_.useRef(null),[C,T]=F.useState({x:0,y:0}),R=_.useRef(null),I=lp(e.width,e.unit),z=lp(e.height,e.unit),$=e.showGrid!==!1,L=_.useCallback((M,B)=>{if(j||M.button===1)return;M.stopPropagation(),r(B),p.current?.focus();const Z=e.elements.find(ve=>ve.id===B);if(!Z)return;const te=document.getElementById(`element-${B}`);te&&(te.classList.add("z-50","opacity-90","shadow-xl","ring-2","ring-blue-400","ring-offset-2"),te.style.cursor="grabbing"),m.current={id:B,startX:M.clientX,startY:M.clientY,elX:Z.x,elY:Z.y},y.current={id:B,x:Z.x,y:Z.y},M.currentTarget.setPointerCapture?.(M.pointerId)},[e.elements,r,j]),U=_.useCallback(M=>{w.current!==null&&cancelAnimationFrame(w.current),w.current=requestAnimationFrame(()=>{M(),w.current=null})},[]),W=_.useCallback(M=>{if(E&&R.current){const B=M.clientX-R.current.startX,Z=M.clientY-R.current.startY;T({x:R.current.x+B,y:R.current.y+Z});return}if(E&&A.current&&d.current){const B=M.clientX-A.current.x,Z=M.clientY-A.current.y;d.current.scrollLeft=A.current.scrollLeft-B,d.current.scrollTop=A.current.scrollTop-Z;return}if(m.current){const{id:B,startX:Z,startY:te,elX:ve,elY:xe}=m.current,X=M.clientX,ue=M.clientY;U(()=>{const ie=(X-Z)/s,de=(ue-te)/s,ye=Math.max(0,ve+ie),oe=Math.max(0,xe+de),$e=Ka(ye),Me=Ka(oe),Ye=document.getElementById(`element-${B}`);Ye&&(Ye.style.left=`${$e}px`,Ye.style.top=`${Me}px`),y.current={id:B,x:$e,y:Me}})}if(g.current){const{id:B,corner:Z,startX:te,startY:ve,w:xe,h:X,elX:ue,elY:ie}=g.current,de=M.clientX,ye=M.clientY;U(()=>{const oe=(de-te)/s,$e=(ye-ve)/s;let Me=xe,Ye=X,lt=ue,vt=ie;Z.includes("e")&&(Me=Math.max(20,xe+oe)),Z.includes("w")&&(Me=Math.max(20,xe-oe),lt=ue+oe),Z.includes("s")&&(Ye=Math.max(12,X+$e)),Z.includes("n")&&(Ye=Math.max(12,X-$e),vt=ie+$e);const vr=Ka(Me),Pr=Ka(Ye),Ar=Ka(lt),Kt=Ka(vt),Xt=document.getElementById(`element-${B}`);Xt&&(Xt.style.width=`${vr}px`,Xt.style.height=`${Pr}px`,Xt.style.left=`${Ar}px`,Xt.style.top=`${Kt}px`),y.current={id:B,width:vr,height:Pr,x:Ar,y:Kt}})}if(b.current&&o){const{edge:B,startX:Z,startY:te,startW:ve,startH:xe}=b.current,X=M.clientX,ue=M.clientY;U(()=>{const ie=(X-Z)/s,de=(ue-te)/s,ye=qR(ie,e.unit),oe=qR(de,e.unit);if(B==="bottom"){const $e=Math.max(1,xe+oe);o({height:$e})}else{const $e=Math.max(1,ve+ye);o({width:$e})}})}},[E,o,s,e.unit,U]),V=_.useCallback(()=>{E&&(N(!1),A.current=null,R.current=null),w.current!==null&&(cancelAnimationFrame(w.current),w.current=null);const M=m.current?.id||g.current?.id;if(M){const B=document.getElementById(`element-${M}`);B&&(B.classList.remove("z-50","opacity-90","shadow-xl","ring-2","ring-blue-400","ring-offset-2"),B.style.cursor="")}if(y.current){const{id:B,...Z}=y.current;n(B,Z),y.current=null}m.current=null,g.current=null,b.current=null},[n]);_.useEffect(()=>{const M=Z=>{Z.code==="Space"&&!Z.repeat&&O(!0)},B=Z=>{Z.code==="Space"&&(O(!1),N(!1),A.current=null,R.current=null)};return window.addEventListener("keydown",M),window.addEventListener("keyup",B),()=>{window.removeEventListener("keydown",M),window.removeEventListener("keyup",B)}},[]),_.useEffect(()=>{const M=d.current;if(!M)return;const B=()=>{M.scrollLeft=Math.max(0,(M.scrollWidth-M.clientWidth)/2),M.scrollTop=Math.max(0,(M.scrollHeight-M.clientHeight)/2)},Z=requestAnimationFrame(B),te=setTimeout(B,100);return()=>{cancelAnimationFrame(Z),clearTimeout(te)}},[s,I,z]);const G=_.useCallback(M=>{if(!t)return;if(M.key==="Delete"||M.key==="Backspace"){M.preventDefault();const xe=e.elements.findIndex(X=>X.id===t);if(xe>=0){const X=e.elements.filter(ue=>ue.id!==t);i(t),r(X[xe]?.id??X[xe-1]?.id??null)}return}const B=e.elements.find(xe=>xe.id===t);if(!B)return;const Z=M.shiftKey?1:yc;let te=0,ve=0;switch(M.key){case"ArrowLeft":te=-Z;break;case"ArrowRight":te=Z;break;case"ArrowUp":ve=-Z;break;case"ArrowDown":ve=-Z;break;default:return}M.key==="ArrowDown"&&(ve=Z),M.preventDefault(),n(B.id,{x:Math.max(0,B.x+te),y:Math.max(0,B.y+ve)})},[t,e.elements,n,i,r]),Y=()=>r(null),D=M=>{(j||M.button===1)&&(M.preventDefault(),N(!0),A.current={x:M.clientX,y:M.clientY,scrollLeft:d.current?.scrollLeft||0,scrollTop:d.current?.scrollTop||0},M.currentTarget.setPointerCapture(M.pointerId))},Q=M=>{if(E&&A.current&&d.current){const B=M.clientX-A.current.x,Z=M.clientY-A.current.y;d.current.scrollLeft=A.current.scrollLeft-B,d.current.scrollTop=A.current.scrollTop-Z}},J=M=>{E&&(N(!1),A.current=null)};return h.jsxs("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden bg-gray-100",children:[h.jsxs("div",{className:"shrink-0 px-4 py-2 border-b border-gray-200 bg-white flex items-center justify-between gap-2 flex-wrap z-10",children:[h.jsx("span",{className:"text-sm font-medium text-gray-700",children:"Label Preview"}),h.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[l&&h.jsx("button",{type:"button",onClick:l,className:"h-8 px-3 rounded border border-gray-300 bg-white text-gray-700 hover:bg-gray-50 text-xs font-medium shadow-sm transition-all active:scale-95",children:"预览"}),o&&h.jsxs(h.Fragment,{children:[h.jsxs(Ze,{value:(()=>{const M=Rb.findIndex(B=>B.width===e.width&&B.height===e.height&&B.unit===e.unit);return M>=0?String(M):"custom"})(),onValueChange:M=>{if(M==="custom")return;const B=Rb[Number(M)];B&&o({width:B.width,height:B.height,unit:B.unit})},children:[h.jsx(et,{className:"h-8 w-[130px] text-xs",children:h.jsx(Je,{placeholder:"画布大小"})}),h.jsxs(nt,{children:[Rb.map((M,B)=>h.jsx(Ae,{value:String(B),className:"text-xs",children:M.name},B)),h.jsx(Ae,{value:"custom",className:"text-xs text-gray-500",children:"自定义"})]})]}),h.jsx("button",{type:"button",onClick:()=>o({showGrid:!$}),className:Te("h-8 px-3 rounded border text-xs font-medium shadow-sm transition-colors",$?"border-gray-300 bg-white text-gray-700 hover:bg-gray-50":"border-gray-300 bg-gray-100 text-gray-500"),children:$?"隐藏网格":"显示网格"})]}),h.jsxs("div",{className:"flex items-center gap-1 bg-white rounded border border-gray-300 p-0.5 shadow-sm h-8",children:[h.jsx("button",{type:"button",onClick:f,disabled:!f,className:"h-6 w-6 rounded hover:bg-gray-100 text-gray-600 disabled:opacity-50 disabled:pointer-events-none flex items-center justify-center text-sm font-medium active:scale-90 transition-transform",title:"缩小",children:"−"}),h.jsxs("span",{className:"min-w-[3rem] text-center text-xs text-gray-600 font-medium",children:[Math.round(s*100),"%"]}),h.jsx("button",{type:"button",onClick:u,disabled:!u,className:"h-6 w-6 rounded hover:bg-gray-100 text-gray-600 disabled:opacity-50 disabled:pointer-events-none flex items-center justify-center text-sm font-medium active:scale-90 transition-transform",title:"放大",children:"+"})]})]})]}),h.jsx("div",{ref:d,className:Te("flex-1 overflow-auto bg-gray-100 relative",j?"cursor-grab active:cursor-grabbing":""),onClick:Y,onPointerDown:D,onPointerMove:Q,onPointerUp:J,onPointerLeave:J,children:h.jsx("div",{style:{minWidth:"100%",minHeight:"100%",width:"fit-content",height:"fit-content",display:"flex",padding:50,boxSizing:"border-box",transform:`translate(${C.x}px, ${C.y}px)`},children:h.jsxs("div",{ref:p,tabIndex:0,className:Te("relative bg-white shadow-lg border border-dashed border-gray-300 origin-top-left outline-none m-auto",E?"cursor-grabbing":"cursor-grab"),style:{width:I,height:z,transform:`scale(${s})`,backgroundImage:$?`linear-gradient(to right, rgba(0,0,0,0.06) 1px, transparent 1px), - linear-gradient(to bottom, rgba(0,0,0,0.06) 1px, transparent 1px)`:void 0,backgroundSize:$?`${yc}px ${yc}px`:void 0,pointerEvents:j?"none":"auto"},onPointerDown:M=>{const B=M.target,Z=B.closest('[id^="element-"]'),te=B.closest('[title*="拖拽拉高"]')||B.closest('[title*="拖拽拉宽"]');p.current?.contains(B)&&!Z&&!te&&!m.current&&!g.current&&(M.preventDefault(),M.stopPropagation(),N(!0),R.current={x:C.x,y:C.y,startX:M.clientX,startY:M.clientY},A.current={x:M.clientX,y:M.clientY,scrollLeft:d.current?.scrollLeft??0,scrollTop:d.current?.scrollTop??0},M.currentTarget.setPointerCapture?.(M.pointerId))},onPointerMove:W,onPointerUp:V,onKeyDown:G,children:[e.showRuler&&h.jsxs("div",{className:"absolute top-0 left-0 right-0 h-5 border-b border-gray-300 bg-gray-50 text-[10px] text-gray-500 flex items-center px-1 pointer-events-none select-none",children:[e.unit," ",e.width," × ",e.height]}),o&&h.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-3 cursor-ns-resize flex items-center justify-center bg-gray-200/80 hover:bg-blue-400/30 border-t border-gray-300 text-[10px] text-gray-500 transition-colors",title:"拖拽拉高纸张",onPointerDown:M=>{M.stopPropagation(),b.current={edge:"bottom",startX:M.clientX,startY:M.clientY,startW:e.width,startH:e.height},M.target.setPointerCapture?.(M.pointerId)},children:"⋮"}),o&&h.jsx("div",{className:"absolute top-0 right-0 bottom-0 w-3 cursor-ew-resize flex items-center justify-center bg-gray-200/80 hover:bg-blue-400/30 border-l border-gray-300 text-[10px] text-gray-500 transition-colors",title:"拖拽拉宽纸张",onPointerDown:M=>{M.stopPropagation(),b.current={edge:"right",startX:M.clientX,startY:M.clientY,startW:e.width,startH:e.height},M.target.setPointerCapture?.(M.pointerId)},children:"⋮"}),e.elements.map(M=>h.jsxs("div",{id:`element-${M.id}`,className:Te("absolute box-border cursor-move overflow-hidden transition-shadow",M.border==="line"&&"border border-gray-400",M.border==="dotted"&&"border border-dotted border-gray-400",t===M.id&&"ring-2 ring-blue-500 ring-offset-1 z-10"),style:{left:M.x,top:M.y,width:M.width,height:M.height},onClick:B=>{B.stopPropagation(),r(M.id)},onPointerDown:B=>L(B,M.id),children:[h.jsx(Q3,{el:M}),t===M.id&&h.jsxs(h.Fragment,{children:[["nw","ne","sw","se"].map(B=>h.jsx("div",{className:"absolute w-4 h-4 bg-white border-2 border-blue-500 rounded-full z-20 shadow-md hover:scale-110 transition-transform",style:{cursor:"nwse-resize",top:B.startsWith("n")?-6:void 0,bottom:B.startsWith("s")?-6:void 0,left:B.endsWith("w")?-6:void 0,right:B.endsWith("e")?-6:void 0},onPointerDown:Z=>{Z.stopPropagation();const te=e.elements.find(ve=>ve.id===M.id);g.current={id:M.id,corner:B,startX:Z.clientX,startY:Z.clientY,w:te.width,h:te.height,elX:te.x,elY:te.y},Z.currentTarget.setPointerCapture?.(Z.pointerId)}},B)),["n","s","w","e"].map(B=>h.jsx("div",{className:"absolute bg-blue-500/50 border border-white/50 rounded-sm z-10 shadow-sm hover:bg-blue-600",style:{cursor:B==="n"||B==="s"?"ns-resize":"ew-resize",width:B==="n"||B==="s"?"20px":"6px",height:B==="n"||B==="s"?"6px":"20px",top:B==="n"?-3:B==="s"?void 0:"50%",bottom:B==="s"?-3:void 0,left:B==="w"?-3:B==="e"?void 0:"50%",right:B==="e"?-3:void 0,transform:B==="n"||B==="s"?"translateX(-50%)":"translateY(-50%)"},onPointerDown:Z=>{Z.stopPropagation();const te=e.elements.find(xe=>xe.id===M.id),ve=document.getElementById(`element-${M.id}`);ve&&ve.classList.add("z-50","opacity-90"),g.current={id:M.id,corner:B,startX:Z.clientX,startY:Z.clientY,w:te.width,h:te.height,elX:te.x,elY:te.y},Z.currentTarget.setPointerCapture?.(Z.pointerId)}},B))]})]},M.id))]})})})]})}function wle({template:e,maxWidth:t=480}){const r=lp(e.width,e.unit),n=lp(e.height,e.unit),i=t?Math.min(t/r,t/n,2):1,o=r*i,s=n*i;return h.jsx("div",{className:"flex items-center justify-center p-4 bg-gray-100 rounded",children:h.jsx("div",{style:{width:o,height:s},className:"relative bg-white shadow-lg overflow-hidden",children:h.jsx("div",{className:"origin-top-left",style:{position:"absolute",left:0,top:0,width:r,height:n,transform:`scale(${i})`,transformOrigin:"0 0"},children:e.elements.map(u=>h.jsx("div",{className:"absolute box-border overflow-hidden pointer-events-none flex items-center justify-center text-xs",style:{left:u.x,top:u.y,width:u.width,height:u.height,border:u.border==="line"?"1px solid #999":u.border==="dotted"?"1px dotted #999":void 0},children:h.jsx(Q3,{el:u})},u.id))})})})}var Sle=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],_le=Sle.reduce((e,t)=>{const r=Iw(`Primitive.${t}`),n=_.forwardRef((i,o)=>{const{asChild:s,...u}=i,f=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),h.jsx(f,{...u,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),jle="Label",Z3=_.forwardRef((e,t)=>h.jsx(_le.label,{...e,ref:t,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(e.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));Z3.displayName=jle;var Ole=Z3;function he({className:e,...t}){return h.jsx(Ole,{"data-slot":"label",className:Te("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}var dm="Switch",[Ele]=In(dm),[Ple,Ale]=Ele(dm),J3=_.forwardRef((e,t)=>{const{__scopeSwitch:r,name:n,checked:i,defaultChecked:o,required:s,disabled:u,value:f="on",onCheckedChange:l,form:d,...p}=e,[m,g]=_.useState(null),b=Xe(t,E=>g(E)),y=_.useRef(!1),w=m?d||!!m.closest("form"):!0,[j,O]=Pi({prop:i,defaultProp:o??!1,onChange:l,caller:dm});return h.jsxs(Ple,{scope:r,checked:j,disabled:u,children:[h.jsx(qe.button,{type:"button",role:"switch","aria-checked":j,"aria-required":s,"data-state":n4(j),"data-disabled":u?"":void 0,disabled:u,value:f,...p,ref:b,onClick:ke(e.onClick,E=>{O(N=>!N),w&&(y.current=E.isPropagationStopped(),y.current||E.stopPropagation())})}),w&&h.jsx(r4,{control:m,bubbles:!y.current,name:n,value:f,checked:j,required:s,disabled:u,form:d,style:{transform:"translateX(-100%)"}})]})});J3.displayName=dm;var e4="SwitchThumb",t4=_.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,i=Ale(e4,r);return h.jsx(qe.span,{"data-state":n4(i.checked),"data-disabled":i.disabled?"":void 0,...n,ref:t})});t4.displayName=e4;var Cle="SwitchBubbleInput",r4=_.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:n=!0,...i},o)=>{const s=_.useRef(null),u=Xe(s,o),f=t_(r),l=XS(t);return _.useEffect(()=>{const d=s.current;if(!d)return;const p=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(p,"checked").set;if(f!==r&&g){const b=new Event("click",{bubbles:n});g.call(d,r),d.dispatchEvent(b)}},[f,r,n]),h.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...i,tabIndex:-1,ref:u,style:{...i.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});r4.displayName=Cle;function n4(e){return e?"checked":"unchecked"}var Nle=J3,Tle=t4;function kn({className:e,...t}){return h.jsx(Nle,{"data-slot":"switch",className:Te("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-switch-background focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:h.jsx(Tle,{"data-slot":"switch-thumb",className:Te("bg-card dark:data-[state=unchecked]:bg-card-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}function kle({template:e,selectedElement:t,onTemplateChange:r,onElementChange:n,onDeleteElement:i}){return t?h.jsxs("div",{className:"w-72 shrink-0 border-l border-gray-200 bg-white flex flex-col h-full",children:[h.jsx("div",{className:"px-3 py-2 border-b border-gray-200 font-semibold text-gray-800",children:"Properties (Element)"}),h.jsx(wc,{className:"flex-1",children:h.jsxs("div",{className:"p-3 space-y-3",children:[h.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[h.jsxs("div",{children:[h.jsx(he,{className:"text-xs",children:"X"}),h.jsx(be,{type:"number",value:t.x,onChange:o=>n(t.id,{x:Number(o.target.value)||0}),className:"h-8 text-sm"})]}),h.jsxs("div",{children:[h.jsx(he,{className:"text-xs",children:"Y"}),h.jsx(be,{type:"number",value:t.y,onChange:o=>n(t.id,{y:Number(o.target.value)||0}),className:"h-8 text-sm"})]})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[h.jsxs("div",{children:[h.jsx(he,{className:"text-xs",children:"Width"}),h.jsx(be,{type:"number",value:t.width,onChange:o=>n(t.id,{width:Math.max(1,Number(o.target.value)||0)}),className:"h-8 text-sm"})]}),h.jsxs("div",{children:[h.jsx(he,{className:"text-xs",children:"Height"}),h.jsx(be,{type:"number",value:t.height,onChange:o=>n(t.id,{height:Math.max(1,Number(o.target.value)||0)}),className:"h-8 text-sm"})]})]}),h.jsxs("div",{children:[h.jsx(he,{className:"text-xs",children:"Rotation"}),h.jsxs(Ze,{value:t.rotation,onValueChange:o=>n(t.id,{rotation:o}),children:[h.jsx(et,{className:"h-8 text-sm",children:h.jsx(Je,{})}),h.jsxs(nt,{children:[h.jsx(Ae,{value:"horizontal",children:"horizontal"}),h.jsx(Ae,{value:"vertical",children:"vertical"})]})]})]}),h.jsxs("div",{children:[h.jsx(he,{className:"text-xs",children:"Border"}),h.jsxs(Ze,{value:t.border,onValueChange:o=>n(t.id,{border:o}),children:[h.jsx(et,{className:"h-8 text-sm",children:h.jsx(Je,{})}),h.jsxs(nt,{children:[h.jsx(Ae,{value:"none",children:"none"}),h.jsx(Ae,{value:"line",children:"line"}),h.jsx(Ae,{value:"dotted",children:"dotted"})]})]})]}),h.jsx(Rle,{element:t,onChange:o=>n(t.id,{config:{...t.config,...o}})}),i&&h.jsx("div",{className:"pt-4 border-t border-gray-100",children:h.jsx(we,{variant:"destructive",className:"w-full",onClick:()=>i(t.id),children:"Delete Element"})})]})})]}):h.jsxs("div",{className:"w-72 shrink-0 border-l border-gray-200 bg-white flex flex-col h-full",children:[h.jsx("div",{className:"px-3 py-2 border-b border-gray-200 font-semibold text-gray-800",children:"Properties (Template)"}),h.jsx(wc,{className:"flex-1",children:h.jsxs("div",{className:"p-3 space-y-3",children:[h.jsxs("div",{children:[h.jsx(he,{className:"text-xs",children:"Template Name"}),h.jsx(be,{value:e.name,onChange:o=>r({name:o.target.value}),className:"h-8 text-sm mt-1"})]}),h.jsxs("div",{children:[h.jsx(he,{className:"text-xs",children:"Label Type"}),h.jsxs(Ze,{value:e.labelType,onValueChange:o=>r({labelType:o}),children:[h.jsx(et,{className:"h-8 text-sm mt-1",children:h.jsx(Je,{})}),h.jsxs(nt,{children:[h.jsx(Ae,{value:"PRICE",children:"PRICE"}),h.jsx(Ae,{value:"NUTRITION",children:"NUTRITION"}),h.jsx(Ae,{value:"SHIPPING",children:"SHIPPING"})]})]})]}),h.jsxs("div",{children:[h.jsx(he,{className:"text-xs",children:"Applied Location"}),h.jsxs(Ze,{value:e.appliedLocation,onValueChange:o=>r({appliedLocation:o}),children:[h.jsx(et,{className:"h-8 text-sm mt-1",children:h.jsx(Je,{})}),h.jsxs(nt,{children:[h.jsx(Ae,{value:"ALL",children:"All Locations"}),h.jsx(Ae,{value:"loc-a",children:"Location A"}),h.jsx(Ae,{value:"loc-b",children:"Location B"})]})]})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[h.jsxs("div",{children:[h.jsx(he,{className:"text-xs",children:"Width"}),h.jsx(be,{type:"number",value:e.width,onChange:o=>r({width:Math.max(.1,Number(o.target.value)||0)}),className:"h-8 text-sm"})]}),h.jsxs("div",{children:[h.jsx(he,{className:"text-xs",children:"Height"}),h.jsx(be,{type:"number",value:e.height,onChange:o=>r({height:Math.max(.1,Number(o.target.value)||0)}),className:"h-8 text-sm"})]})]}),h.jsxs("div",{children:[h.jsx(he,{className:"text-xs",children:"Unit"}),h.jsxs(Ze,{value:e.unit,onValueChange:o=>r({unit:o}),children:[h.jsx(et,{className:"h-8 text-sm mt-1",children:h.jsx(Je,{})}),h.jsxs(nt,{children:[h.jsx(Ae,{value:"cm",children:"cm"}),h.jsx(Ae,{value:"inch",children:"inch"})]})]})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(kn,{checked:e.showRuler,onCheckedChange:o=>r({showRuler:o})}),h.jsx(he,{className:"text-xs",children:"Show Ruler"})]})]})})]})}function Rle({element:e,onChange:t}){const r=e.config,n=(i,o)=>t({[i]:o});switch(e.type){case"TEXT_STATIC":case"TEXT_PRODUCT":case"TEXT_PRICE":return h.jsxs(h.Fragment,{children:[h.jsxs("div",{children:[h.jsx(he,{className:"text-xs",children:"Text"}),h.jsx(be,{value:r.text??"",onChange:i=>n("text",i.target.value),className:"h-8 text-sm mt-1"})]}),h.jsxs("div",{children:[h.jsx(he,{className:"text-xs",children:"Font Size"}),h.jsx(be,{type:"number",value:r.fontSize??14,onChange:i=>n("fontSize",Number(i.target.value)||14),className:"h-8 text-sm mt-1"})]}),h.jsxs("div",{children:[h.jsx(he,{className:"text-xs",children:"Text Align"}),h.jsxs(Ze,{value:r.textAlign??"left",onValueChange:i=>n("textAlign",i),children:[h.jsx(et,{className:"h-8 text-sm mt-1",children:h.jsx(Je,{})}),h.jsxs(nt,{children:[h.jsx(Ae,{value:"left",children:"Left"}),h.jsx(Ae,{value:"center",children:"Center"}),h.jsx(Ae,{value:"right",children:"Right"})]})]})]})]});case"BARCODE":return h.jsxs(h.Fragment,{children:[h.jsxs("div",{children:[h.jsx(he,{className:"text-xs",children:"Data"}),h.jsx(be,{value:r.data??"",onChange:i=>n("data",i.target.value),className:"h-8 text-sm mt-1"})]}),h.jsxs("div",{children:[h.jsx(he,{className:"text-xs",children:"方向"}),h.jsxs(Ze,{value:r.orientation??"horizontal",onValueChange:i=>n("orientation",i),children:[h.jsx(et,{className:"h-8 text-sm mt-1",children:h.jsx(Je,{})}),h.jsxs(nt,{children:[h.jsx(Ae,{value:"horizontal",children:"水平"}),h.jsx(Ae,{value:"vertical",children:"竖排"})]})]})]})]});case"QRCODE":return h.jsxs("div",{children:[h.jsx(he,{className:"text-xs",children:"Data (URL)"}),h.jsx(be,{value:r.data??"",onChange:i=>n("data",i.target.value),className:"h-8 text-sm mt-1"})]});case"WEIGHT":return h.jsxs("div",{children:[h.jsx(he,{className:"text-xs",children:"Value"}),h.jsx(be,{type:"number",value:r.value??0,onChange:i=>n("value",Number(i.target.value)||0),className:"h-8 text-sm mt-1"})]});default:return h.jsxs("div",{className:"text-xs text-gray-500",children:["Config for ",e.type," (edit in code if needed)"]})}}const Mle=.5,Ile=2,UR=.25,Dle=1;function Lle({templateId:e,initialTemplate:t,onClose:r,onSaved:n}){const[i,o]=_.useState(()=>t?{...t}:Gae(e??void 0)),[s,u]=_.useState(null),[f,l]=_.useState(Dle),[d,p]=_.useState(!1),m=i.elements.find(E=>E.id===s)??null,g=_.useCallback((E,N)=>{const A=Kae(E,30,30);N&&Object.keys(N).length>0&&(A.config={...A.config,...N}),o(C=>({...C,elements:[...C.elements,A]})),u(A.id)},[]),b=_.useCallback((E,N)=>{o(A=>({...A,elements:A.elements.map(C=>C.id===E?{...C,...N}:C)}))},[]),y=_.useCallback(E=>{o(N=>({...N,elements:N.elements.filter(A=>A.id!==E)})),u(null)},[]),w=_.useCallback(E=>{o(N=>({...N,...E}))},[]),j=_.useCallback(()=>{Yae(i),n(),r()},[i,n,r]),O=_.useCallback(()=>{const E=new Blob([JSON.stringify(i,null,2)],{type:"application/json"}),N=URL.createObjectURL(E),A=document.createElement("a");A.href=N,A.download=`label-template-${i.id}.json`,A.click(),URL.revokeObjectURL(N)},[i]);return h.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[h.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-gray-200 bg-white shrink-0",children:[h.jsxs(we,{variant:"outline",size:"sm",onClick:r,children:[h.jsx(y8,{className:"w-4 h-4 mr-1"}),"Back"]}),h.jsx("span",{className:"text-sm font-medium text-gray-700 truncate flex-1",children:i.name}),h.jsxs(we,{size:"sm",onClick:O,variant:"outline",children:[h.jsx(Pw,{className:"w-4 h-4 mr-1"}),"Export JSON"]}),h.jsxs(we,{size:"sm",className:"bg-blue-600 hover:bg-blue-700 text-white",onClick:j,children:[h.jsx(h6,{className:"w-4 h-4 mr-1"}),"Save"]})]}),h.jsxs("div",{className:"flex flex-1 min-h-0",children:[h.jsx(_se,{onAddElement:g}),h.jsx(ble,{template:i,selectedId:s,onSelect:u,onUpdateElement:b,onDeleteElement:y,onTemplateChange:w,scale:f,onZoomIn:()=>l(E=>Math.min(Ile,E+UR)),onZoomOut:()=>l(E=>Math.max(Mle,E-UR)),onPreview:()=>p(!0)}),h.jsx(un,{open:d,onOpenChange:p,children:h.jsxs(fn,{className:"max-w-[90vw] max-h-[90vh] overflow-auto",children:[h.jsx(dn,{children:h.jsx(hn,{children:"标签预览"})}),h.jsx(wle,{template:i,maxWidth:500})]})}),h.jsx(kle,{template:i,selectedElement:m,onTemplateChange:w,onElementChange:b,onDeleteElement:y})]})]})}function $le(){const[e,t]=_.useState(()=>Fk()),[r,n]=_.useState("list"),[i,o]=_.useState(null),[s,u]=_.useState(""),[f,l]=_.useState("all"),d=_.useCallback(()=>{t(Fk())},[]);_.useEffect(()=>{r==="list"&&d()},[r,d]);const p=e.filter(y=>{const w=!s||y.name.toLowerCase().includes(s.toLowerCase()),j=f==="all"||y.appliedLocation===f;return w&&j}),m=()=>{},g=y=>{o(y),n("editor")},b=()=>{n("list"),o(null)};if(r==="editor"){const y=i?m3(i):null;return h.jsx("div",{className:"h-[calc(100vh-8rem)] min-h-[500px] flex flex-col",children:h.jsx(Lle,{templateId:i,initialTemplate:y,onClose:b,onSaved:d})})}return h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"flex flex-nowrap items-center gap-3",children:[h.jsx(be,{placeholder:"Search",style:{height:40,boxSizing:"border-box"},className:"bg-white border border-gray-300 rounded-md w-40 shrink-0 placeholder:text-gray-500",value:s,onChange:y=>u(y.target.value)}),h.jsxs(Ze,{value:f,onValueChange:l,children:[h.jsx(et,{className:"bg-white border border-gray-300 rounded-md w-[200px] shrink-0",style:{height:40,boxSizing:"border-box"},children:h.jsx(Je,{placeholder:"Location"})}),h.jsxs(nt,{children:[h.jsx(Ae,{value:"all",children:"All Locations"}),h.jsx(Ae,{value:"ALL",children:"ALL"}),h.jsx(Ae,{value:"loc-a",children:"Location A"}),h.jsx(Ae,{value:"loc-b",children:"Location B"})]})]}),h.jsxs(we,{className:"bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-md h-10 px-6 shrink-0 ml-auto",onClick:m,children:["New Label Template ",h.jsx(jr,{className:"ml-1 w-4 h-4"})]})]}),h.jsxs("div",{className:"text-red-600 font-bold italic text-sm md:text-base",children:["***One or more templates have incomplete labels attached to them.",h.jsx("br",{}),"Go to Labels view to see which labels are missing fields."]}),h.jsx("div",{className:"rounded-md border bg-white shadow-sm",children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsxs(Ke,{className:"bg-gray-50 hover:bg-gray-50",children:[h.jsx(me,{className:"font-bold text-gray-900 w-[180px]",children:"Label Template"}),h.jsx(me,{className:"font-bold text-gray-900 w-[120px]",children:"Location"}),h.jsx(me,{className:"font-bold text-gray-900",children:"Contents"}),h.jsx(me,{className:"font-bold text-gray-900 w-[150px]",children:"Size"}),h.jsx(me,{className:"font-bold text-gray-900 w-[100px]",children:"Actions"})]})}),h.jsx(mr,{children:p.length===0?h.jsx(Ke,{children:h.jsx(se,{colSpan:5,className:"text-center text-gray-500 py-8",children:'No templates yet. Click "New Label Template" to create one.'})}):p.map(y=>h.jsxs(Ke,{className:"hover:bg-gray-50 cursor-pointer",onClick:()=>g(y.id),children:[h.jsx(se,{className:"font-medium",children:y.name}),h.jsx(se,{children:y.appliedLocation}),h.jsxs(se,{className:"text-sm text-gray-600",children:[y.elements.length," element(s)"]}),h.jsxs(se,{children:[y.width,"×",y.height," ",y.unit]}),h.jsx(se,{onClick:w=>w.stopPropagation(),children:h.jsxs(we,{variant:"outline",size:"sm",onClick:()=>g(y.id),children:[h.jsx(Bd,{className:"w-3 h-3 mr-1"}),"Edit"]})})]},y.id))})]})})]})}function Ble(){const e=[{id:1,name:"Prepped By",contents:"A. Smith; B. Doe; C. Borne",lastEdited:"2025.12.03.11:45"},{id:2,name:"Checked By",contents:"D. Manager; E. Supervisor",lastEdited:"2025.12.04.09:30"},{id:3,name:"Allergens",contents:"Peanuts; Dairy; Gluten; Soy",lastEdited:"2025.12.05.14:15"}];return h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"flex flex-nowrap items-center gap-3",children:[h.jsx(be,{placeholder:"Search",style:{height:40,boxSizing:"border-box"},className:"bg-white border border-gray-300 rounded-md w-40 shrink-0 placeholder:text-gray-500"}),h.jsxs(Ze,{defaultValue:"all",children:[h.jsx(et,{className:"bg-white border border-gray-300 rounded-md w-[200px] shrink-0",style:{height:40,boxSizing:"border-box"},children:h.jsx(Je,{placeholder:"Location"})}),h.jsxs(nt,{children:[h.jsx(Ae,{value:"all",children:"All Locations"}),h.jsx(Ae,{value:"loc-a",children:"Location A"}),h.jsx(Ae,{value:"loc-b",children:"Location B"})]})]}),h.jsxs(we,{className:"bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-md h-10 px-6 shrink-0 ml-auto",children:["New Multiple Options ",h.jsx(jr,{className:"ml-1 h-4 w-4"})]})]}),h.jsx("div",{className:"rounded-md border bg-white shadow-sm",children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsxs(Ke,{className:"bg-gray-50 hover:bg-gray-50",children:[h.jsx(me,{className:"font-bold text-gray-900 w-[200px]",children:"Multiple Option Name"}),h.jsx(me,{className:"font-bold text-gray-900",children:"Contents"}),h.jsx(me,{className:"font-bold text-gray-900 w-[180px]",children:"Last Edited"})]})}),h.jsx(mr,{children:e.map(t=>h.jsxs(Ke,{className:"hover:bg-gray-50",children:[h.jsx(se,{className:"font-medium",children:t.name}),h.jsx(se,{className:"text-gray-600",children:t.contents}),h.jsx(se,{className:"text-gray-500 tabular-nums font-numeric",children:t.lastEdited})]},t.id))})]})})]})}function Fle({currentView:e="Labels",onViewChange:t}){const r=["Labels","Label Categories","Label Types","Label Templates","Multiple Options"],n=i=>{t&&t(i)};return h.jsxs("div",{className:"space-y-6",children:[h.jsx("div",{className:"w-full border-b border-gray-200",children:h.jsx("div",{className:"flex overflow-x-auto bg-white",children:r.map(i=>h.jsx("div",{onClick:()=>n(i),style:e===i?{borderBottomWidth:2,borderBottomStyle:"solid",borderBottomColor:"#2563eb"}:void 0,className:`px-4 py-2.5 text-sm font-medium whitespace-nowrap cursor-pointer transition-colors -mb-px ${e===i?"text-blue-600":"border-b-2 border-b-transparent text-gray-600 hover:text-gray-800"}`,children:i},i))})}),h.jsxs("div",{className:"min-h-[400px]",children:[e==="Labels"&&h.jsx(Fae,{}),e==="Label Categories"&&h.jsx(zae,{}),e==="Label Types"&&h.jsx(qae,{}),e==="Label Templates"&&h.jsx($le,{}),e==="Multiple Options"&&h.jsx(Ble,{}),!["Labels","Label Categories","Label Types","Label Templates","Multiple Options"].includes(e)&&h.jsxs("div",{className:"flex items-center justify-center h-64 text-gray-400",children:[e," content coming soon..."]})]})]})}function zle(){const[e,t]=_.useState([{id:"1",name:"Pop",isOpen:!0,subcategories:[{id:"1-1",name:"2024",isOpen:!0,files:[{id:"f1",name:"uuuuu",date:"10/23/24, 12:21 AM",type:"image"},{id:"f2",name:"664EF167-DFCE-49C1-A417-DC09FEDF78D7.jpg",date:"11/24/25, 8:40 PM",type:"image"}]}]},{id:"2",name:"Training",isOpen:!0,subcategories:[{id:"2-1",name:"BOH",isOpen:!1,files:[]},{id:"2-2",name:"FOH",isOpen:!0,files:[]}]},{id:"3",name:"ww",isOpen:!1,subcategories:[]}]),r=i=>{t(o=>o.map(s=>s.id===i?{...s,isOpen:!s.isOpen}:s))},n=(i,o)=>{t(s=>s.map(u=>u.id!==i?u:{...u,subcategories:u.subcategories.map(f=>f.id===o?{...f,isOpen:!f.isOpen}:f)}))};return h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 items-start sm:items-center",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(be,{className:"bg-white border border-black rounded-md h-10 w-[150px]"}),h.jsx("span",{className:"text-sm text-black whitespace-nowrap",children:"Search"})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs(Ze,{defaultValue:"all",children:[h.jsx(et,{className:"bg-white border border-black rounded-md h-10 w-[100px]",children:h.jsx(Je,{placeholder:"Location"})}),h.jsxs(nt,{children:[h.jsx(Ae,{value:"all",children:"all"}),h.jsx(Ae,{value:"loc-a",children:"Location A"})]})]}),h.jsx("span",{className:"text-sm text-black whitespace-nowrap",children:"Location"})]})]}),h.jsxs("div",{className:"bg-gray-100 p-2 flex justify-between items-center border-b border-gray-200",children:[h.jsx("h1",{className:"text-xl font-medium text-gray-700",children:"Information"}),h.jsxs("div",{className:"flex items-center gap-4 text-gray-600",children:[h.jsx("div",{className:"flex items-center gap-1 bg-gray-700 text-white text-[10px] px-1 py-0.5 rounded-sm font-bold",children:"NEW"}),h.jsx(b6,{className:"h-5 w-5"}),h.jsx("span",{className:"font-medium",children:"55789"})]})]}),h.jsxs("div",{className:"space-y-4",children:[h.jsxs("button",{className:"w-full bg-[#2c7bb6] hover:bg-[#256b9e] text-white py-2 px-4 flex items-center gap-2 text-sm font-medium rounded-sm",children:[h.jsx(jr,{className:"h-4 w-4"}),"New Category",h.jsx(Wd,{className:"h-4 w-4 opacity-70"})]}),h.jsx("div",{className:"space-y-4",children:e.map(i=>h.jsxs("div",{className:"border border-gray-300 rounded-sm overflow-hidden",children:[h.jsxs("div",{className:"bg-gradient-to-b from-gray-50 to-gray-100 border-b border-gray-200 p-2 flex items-center justify-between",children:[h.jsxs("button",{onClick:()=>r(i.id),className:"flex items-center gap-2 text-gray-700 font-medium text-sm flex-1 text-left",children:[i.isOpen?h.jsx(xc,{className:"h-4 w-4 text-[#2c7bb6]"}):h.jsx(bc,{className:"h-4 w-4 text-[#2c7bb6]"}),i.name]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("button",{className:"text-gray-400 hover:text-gray-600",children:h.jsx(Bd,{className:"h-4 w-4"})}),h.jsx("button",{className:"text-red-400 hover:text-red-600",children:h.jsx(uc,{className:"h-4 w-4"})})]})]}),i.isOpen&&h.jsxs("div",{className:"p-2 space-y-3 bg-white",children:[h.jsxs("button",{className:"w-full bg-[#2c7bb6] hover:bg-[#256b9e] text-white py-2 px-4 flex items-center gap-2 text-sm font-medium rounded-sm",children:[h.jsx(jr,{className:"h-4 w-4"}),"New Subcategory",h.jsx(Wd,{className:"h-4 w-4 opacity-70"})]}),h.jsxs("div",{className:"space-y-3",children:[i.subcategories.map(o=>h.jsxs("div",{className:"border border-gray-200 rounded-sm",children:[h.jsxs("div",{className:"bg-white border-b border-gray-200 p-2 flex items-center justify-between",children:[h.jsxs("button",{onClick:()=>n(i.id,o.id),className:"flex items-center gap-2 text-gray-700 font-medium text-sm flex-1 text-left",children:[o.isOpen?h.jsx(xc,{className:"h-4 w-4 text-[#2c7bb6]"}):h.jsx(bc,{className:"h-4 w-4 text-[#2c7bb6]"}),o.name]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("button",{className:"text-gray-400 hover:text-gray-600",children:h.jsx(Bd,{className:"h-4 w-4"})}),h.jsx("button",{className:"text-red-400 hover:text-red-600",children:h.jsx(uc,{className:"h-4 w-4"})})]})]}),o.isOpen&&h.jsxs("div",{className:"p-3 bg-gray-50/50",children:[h.jsx("div",{className:"mb-2 text-xs font-bold text-gray-500 uppercase tracking-wide",children:"Files"}),h.jsxs("div",{className:"flex flex-wrap gap-2 mb-3 justify-end",children:[h.jsx(we,{size:"sm",className:"h-8 bg-[#4CAF50] hover:bg-[#43a047] text-white text-xs border-none rounded-sm",children:"Upload Your Own File(s)"}),h.jsx(we,{size:"sm",className:"h-8 bg-[#4CAF50] hover:bg-[#43a047] text-white text-xs border-none rounded-sm",children:"Create A Custom File"}),h.jsx(we,{size:"sm",className:"h-8 bg-[#2c7bb6] hover:bg-[#256b9e] text-white text-xs border-none rounded-sm",children:"Edit File Permissions"}),h.jsxs(we,{size:"sm",className:"h-8 bg-[#2c7bb6] hover:bg-[#256b9e] text-white text-xs border-none rounded-sm gap-1",children:["Sort (A-Z) ",h.jsx(b8,{className:"h-3 w-3"})]})]}),h.jsx("div",{className:"space-y-1",children:o.files.length>0?o.files.map(s=>h.jsxs("div",{className:"flex items-center bg-gray-200/50 p-2 border border-gray-200 rounded-sm text-sm hover:bg-gray-200 transition-colors",children:[h.jsx("div",{className:"flex-shrink-0 mr-3",children:s.type==="image"?h.jsx(Wo,{className:"h-5 w-5 text-[#2c7bb6]"}):h.jsx(us,{className:"h-5 w-5 text-[#2c7bb6]"})}),h.jsx("div",{className:"flex-1 min-w-0",children:h.jsx("div",{className:"font-medium text-gray-700 truncate",children:s.name})}),h.jsx("div",{className:"text-xs text-gray-500 mr-4 whitespace-nowrap",children:s.date}),h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx("button",{className:"p-1 text-gray-400 hover:text-gray-600 bg-white border border-gray-300 rounded-sm",children:h.jsx(us,{className:"h-3 w-3"})}),h.jsx("button",{className:"p-1 text-gray-400 hover:text-gray-600 bg-white border border-gray-300 rounded-sm",children:h.jsx(Bd,{className:"h-3 w-3"})}),h.jsx("button",{className:"p-1 text-red-400 hover:text-red-600 bg-white border border-gray-300 rounded-sm",children:h.jsx(uc,{className:"h-3 w-3"})})]})]},s.id)):h.jsx("div",{className:"p-4 border-2 border-dashed border-gray-300 rounded-sm text-center text-gray-400 text-sm",children:"No files in this subcategory"})})]})]},o.id)),i.subcategories.length===0&&h.jsx("div",{className:"p-2 text-sm text-gray-400 italic",children:"No subcategories"})]})]})]},i.id))})]})]})}const qle=[{id:1,title:"Coffee - 2 hrs",subtitle:"1 min - Completes at 12:05 PM",totalTime:7200,remainingTime:0,status:"expired",icon:F8},{id:2,title:"Clean Tablet",subtitle:"1 hrs - Completes at 12:37 PM",totalTime:3600,remainingTime:237,status:"running",icon:_6},{id:3,title:"Replace Sanitizer Towels",subtitle:"1 hrs - Completes at 12:37 PM",totalTime:3600,remainingTime:238,status:"running",icon:Fb},{id:4,title:"Take Out Trash",subtitle:"1 hrs - Completes at 01:03 PM",totalTime:3600,remainingTime:58,status:"running",icon:Fb},{id:5,title:"Change Utensils",subtitle:"1 hrs - Completes at 01:03 PM",totalTime:3600,remainingTime:58,status:"running",icon:L6},{id:6,title:"Sanitize Surfaces",subtitle:"1 hrs - Completes at 02:00 PM",totalTime:3600,remainingTime:2157,status:"running",icon:vg},{id:7,title:"Check Temperatures",subtitle:"1 hrs - Completes at 02:00 PM",totalTime:3600,remainingTime:2158,status:"running",icon:vg},{id:8,title:"Ranch 4 hrs",subtitle:"4 hrs - Completes at 04:04 PM",totalTime:14400,remainingTime:2158,status:"running",icon:vg}];function Ule({timer:e}){const t=(e.totalTime-e.remainingTime)/e.totalTime*100,r=e.remainingTime===0,n=i=>{if(i<=0)return"0s";const o=Math.floor(i/60),s=i%60;return`${o.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}`};return h.jsxs("div",{className:"bg-gray-200 rounded-xl p-4 flex flex-col items-center relative shadow-sm h-[280px]",children:[h.jsxs("div",{className:"text-center mb-2",children:[h.jsx("h3",{className:"text-lg font-medium text-gray-800 leading-tight",children:e.title}),h.jsx("p",{className:"text-xs text-gray-500 mt-1",children:e.subtitle})]}),h.jsxs("div",{className:"relative w-32 h-32 my-auto flex items-center justify-center",children:[h.jsxs("svg",{className:"w-full h-full transform -rotate-90",children:[h.jsx("circle",{cx:"64",cy:"64",r:"56",stroke:"white",strokeWidth:"12",fill:"transparent"}),h.jsx("circle",{cx:"64",cy:"64",r:"56",stroke:r?"#ef4444":"#3b82f6",strokeWidth:"12",fill:"transparent",strokeDasharray:351.86,strokeDashoffset:r?0:351.86*(t/100),className:"transition-all duration-1000 ease-linear"})]}),h.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[h.jsx("span",{className:Te("text-3xl font-bold",r?"text-red-500":"text-gray-800"),children:r?"0s":n(e.remainingTime)}),h.jsx("span",{className:Te("text-[10px] font-medium uppercase mt-1",r?"text-red-400":"text-gray-400"),children:"Remaining"})]})]}),h.jsxs("div",{className:"w-full flex justify-between items-end mt-2",children:[h.jsx(s6,{className:"w-5 h-5 text-blue-700 fill-current"}),h.jsx("div",{className:"flex flex-col items-center",children:h.jsx("div",{className:"w-10 h-10 rounded-full border-2 border-gray-300 flex items-center justify-center text-gray-400 mb-1",children:h.jsx(e.icon,{className:"w-5 h-5"})})}),h.jsx("div",{className:"flex flex-col items-end",children:h.jsx("span",{className:"text-xs text-blue-600 font-bold mb-2 cursor-pointer",children:"EDIT"})})]}),h.jsx("button",{className:"absolute bottom-12 right-4 bg-blue-600 rounded-full p-1 text-white hover:bg-blue-700 shadow-md",children:h.jsx(uc,{className:"w-4 h-4"})})]})}function Wle(){const[e,t]=_.useState(!0);return h.jsxs("div",{className:"h-full flex flex-col bg-gray-50 relative",children:[h.jsxs("div",{className:"bg-white border-b border-gray-200 px-4 py-3 flex items-center justify-between shadow-sm z-10",children:[h.jsxs("div",{className:"flex items-center gap-4",children:[h.jsxs("button",{className:"flex items-center text-blue-500 text-lg font-medium",children:[h.jsx(QR,{className:"w-6 h-6"}),"Back"]}),h.jsx(r6,{className:"w-6 h-6 text-gray-500"})]}),h.jsxs("div",{className:"flex flex-col items-center",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("div",{className:"bg-blue-600 p-1.5 rounded-md",children:h.jsx(E6,{className:"w-5 h-5 text-white"})}),h.jsx("h1",{className:"text-xl font-bold text-blue-900",children:"Timers"})]}),h.jsxs("div",{className:"flex items-center gap-1 text-xs text-green-600 font-medium",children:[h.jsx("span",{children:"86016"}),h.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full"})]})]}),h.jsxs("div",{className:"flex items-center gap-4 text-blue-500 font-medium",children:[h.jsx(M6,{className:"w-6 h-6 text-gray-400"}),h.jsxs("button",{className:"flex items-center gap-1",children:[h.jsx(jr,{className:"w-5 h-5"}),"Add Timer"]})]})]}),h.jsxs("div",{className:"bg-gray-700 text-white px-6 py-2 flex items-center justify-between",children:[h.jsx("div",{className:"flex-1"})," ",h.jsx("div",{className:"font-medium",children:"Today, December 15"}),h.jsxs("div",{className:"flex-1 flex justify-end items-center gap-4",children:[h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx(V8,{className:"w-5 h-5 text-gray-300"}),h.jsx(Q8,{className:"w-5 h-5 text-gray-500"})]}),h.jsx(p8,{className:"w-5 h-5 text-blue-400"})]})]}),h.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:qle.map(r=>h.jsx(Ule,{timer:r},r.id))})}),e&&h.jsx("div",{className:"absolute inset-0 z-50 flex items-center justify-center bg-black/40 backdrop-blur-[1px]",children:h.jsx("div",{className:"bg-black text-white rounded-xl shadow-2xl w-[600px] max-w-full overflow-hidden border border-gray-800",children:h.jsxs("div",{className:"p-8 text-center space-y-6",children:[h.jsx("h2",{className:"text-3xl font-medium text-blue-500",children:"Coffee - 2 hrs"}),h.jsxs("div",{className:"space-y-4 py-4",children:[h.jsx("p",{className:"text-2xl font-light",children:"Timer expired at 12:05 PM"}),h.jsx("p",{className:"text-2xl font-light",children:"Please discard the coffee"})]}),h.jsx("div",{className:"flex justify-end",children:h.jsx("span",{className:"bg-gray-200 text-black text-[10px] px-1 rounded-sm opacity-50",children:"TACT_Img_Timer-Notification@2x"})}),h.jsxs("div",{className:"grid grid-cols-3 gap-4 mt-8",children:[h.jsx(we,{onClick:()=>t(!1),className:"bg-blue-700 hover:bg-blue-600 text-white h-14 text-xl font-medium rounded-lg",children:"Mute"}),h.jsx(we,{onClick:()=>t(!1),className:"bg-blue-600 hover:bg-blue-500 text-white h-14 text-xl font-medium rounded-lg",children:"Restart"}),h.jsx(we,{onClick:()=>t(!1),className:"bg-blue-800 hover:bg-blue-700 text-white h-14 text-xl font-medium rounded-lg",children:"Acknowledge"})]})]})})})]})}var Ib="rovingFocusGroup.onEntryFocus",Hle={bubbles:!1,cancelable:!0},Su="RovingFocusGroup",[Sw,i4,Vle]=o$(Su),[Gle,o4]=In(Su,[Vle]),[Kle,Xle]=Gle(Su),a4=_.forwardRef((e,t)=>h.jsx(Sw.Provider,{scope:e.__scopeRovingFocusGroup,children:h.jsx(Sw.Slot,{scope:e.__scopeRovingFocusGroup,children:h.jsx(Yle,{...e,ref:t})})}));a4.displayName=Su;var Yle=_.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:i=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:f,onEntryFocus:l,preventScrollOnEntryFocus:d=!1,...p}=e,m=_.useRef(null),g=Xe(t,m),b=fp(o),[y,w]=Pi({prop:s,defaultProp:u??null,onChange:f,caller:Su}),[j,O]=_.useState(!1),E=ar(l),N=i4(r),A=_.useRef(!1),[C,T]=_.useState(0);return _.useEffect(()=>{const R=m.current;if(R)return R.addEventListener(Ib,E),()=>R.removeEventListener(Ib,E)},[E]),h.jsx(Kle,{scope:r,orientation:n,dir:b,loop:i,currentTabStopId:y,onItemFocus:_.useCallback(R=>w(R),[w]),onItemShiftTab:_.useCallback(()=>O(!0),[]),onFocusableItemAdd:_.useCallback(()=>T(R=>R+1),[]),onFocusableItemRemove:_.useCallback(()=>T(R=>R-1),[]),children:h.jsx(qe.div,{tabIndex:j||C===0?-1:0,"data-orientation":n,...p,ref:g,style:{outline:"none",...e.style},onMouseDown:ke(e.onMouseDown,()=>{A.current=!0}),onFocus:ke(e.onFocus,R=>{const I=!A.current;if(R.target===R.currentTarget&&I&&!j){const z=new CustomEvent(Ib,Hle);if(R.currentTarget.dispatchEvent(z),!z.defaultPrevented){const $=N().filter(G=>G.focusable),L=$.find(G=>G.active),U=$.find(G=>G.id===y),V=[L,U,...$].filter(Boolean).map(G=>G.ref.current);c4(V,d)}}A.current=!1}),onBlur:ke(e.onBlur,()=>O(!1))})})}),s4="RovingFocusGroupItem",l4=_.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:i=!1,tabStopId:o,children:s,...u}=e,f=Xn(),l=o||f,d=Xle(s4,r),p=d.currentTabStopId===l,m=i4(r),{onFocusableItemAdd:g,onFocusableItemRemove:b,currentTabStopId:y}=d;return _.useEffect(()=>{if(n)return g(),()=>b()},[n,g,b]),h.jsx(Sw.ItemSlot,{scope:r,id:l,focusable:n,active:i,children:h.jsx(qe.span,{tabIndex:p?0:-1,"data-orientation":d.orientation,...u,ref:t,onMouseDown:ke(e.onMouseDown,w=>{n?d.onItemFocus(l):w.preventDefault()}),onFocus:ke(e.onFocus,()=>d.onItemFocus(l)),onKeyDown:ke(e.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){d.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const j=Jle(w,d.orientation,d.dir);if(j!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let E=m().filter(N=>N.focusable).map(N=>N.ref.current);if(j==="last")E.reverse();else if(j==="prev"||j==="next"){j==="prev"&&E.reverse();const N=E.indexOf(w.currentTarget);E=d.loop?ece(E,N+1):E.slice(N+1)}setTimeout(()=>c4(E))}}),children:typeof s=="function"?s({isCurrentTabStop:p,hasTabStop:y!=null}):s})})});l4.displayName=s4;var Qle={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Zle(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Jle(e,t,r){const n=Zle(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return Qle[n]}function c4(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function ece(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var tce=a4,rce=l4,hm="Tabs",[nce]=In(hm,[o4]),u4=o4(),[ice,s_]=nce(hm),f4=_.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:i,defaultValue:o,orientation:s="horizontal",dir:u,activationMode:f="automatic",...l}=e,d=fp(u),[p,m]=Pi({prop:n,onChange:i,defaultProp:o??"",caller:hm});return h.jsx(ice,{scope:r,baseId:Xn(),value:p,onValueChange:m,orientation:s,dir:d,activationMode:f,children:h.jsx(qe.div,{dir:d,"data-orientation":s,...l,ref:t})})});f4.displayName=hm;var d4="TabsList",h4=_.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...i}=e,o=s_(d4,r),s=u4(r);return h.jsx(tce,{asChild:!0,...s,orientation:o.orientation,dir:o.dir,loop:n,children:h.jsx(qe.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:t})})});h4.displayName=d4;var p4="TabsTrigger",m4=_.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:i=!1,...o}=e,s=s_(p4,r),u=u4(r),f=y4(s.baseId,n),l=x4(s.baseId,n),d=n===s.value;return h.jsx(rce,{asChild:!0,...u,focusable:!i,active:d,children:h.jsx(qe.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":l,"data-state":d?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:f,...o,ref:t,onMouseDown:ke(e.onMouseDown,p=>{!i&&p.button===0&&p.ctrlKey===!1?s.onValueChange(n):p.preventDefault()}),onKeyDown:ke(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&s.onValueChange(n)}),onFocus:ke(e.onFocus,()=>{const p=s.activationMode!=="manual";!d&&!i&&p&&s.onValueChange(n)})})})});m4.displayName=p4;var v4="TabsContent",g4=_.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:i,children:o,...s}=e,u=s_(v4,r),f=y4(u.baseId,n),l=x4(u.baseId,n),d=n===u.value,p=_.useRef(d);return _.useEffect(()=>{const m=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(m)},[]),h.jsx(Or,{present:i||d,children:({present:m})=>h.jsx(qe.div,{"data-state":d?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":f,hidden:!m,id:l,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:m&&o})})});g4.displayName=v4;function y4(e,t){return`${e}-trigger-${t}`}function x4(e,t){return`${e}-content-${t}`}var oce=f4,ace=h4,sce=m4,lce=g4;function b4({className:e,...t}){return h.jsx(oce,{"data-slot":"tabs",className:Te("flex flex-col gap-2",e),...t})}function w4({className:e,...t}){return h.jsx(ace,{"data-slot":"tabs-list",className:Te("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-xl p-[3px] flex",e),...t})}function ss({className:e,...t}){return h.jsx(sce,{"data-slot":"tabs-trigger",className:Te("data-[state=active]:bg-card dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-xl border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function ls({className:e,...t}){return h.jsx(lce,{"data-slot":"tabs-content",className:Te("flex-1 outline-none",e),...t})}const cce=[{id:"cat1",name:"Dairy",type:"color",value:"#bfdbfe",status:"active"},{id:"cat2",name:"Meat",type:"image",value:"meat.png",status:"active"},{id:"cat3",name:"Bakery",type:"text",value:"Bakery",status:"active"}],uce=[{id:"prod1",locationId:"12345",categoryId:"cat1",categoryName:"Dairy",name:"Whole Milk",productId:"2222222",barcode:"123456789",barcodeType:"EAN-13",status:"active",appearance:{type:"text",value:"Whole Milk"}},{id:"prod2",locationId:"12345",categoryId:"cat2",categoryName:"Meat",name:"Ground Beef",productId:"3333333",barcode:"113456789",barcodeType:"UPC-A",status:"active",appearance:{type:"color",value:"#ef4444"}},{id:"prod3",locationId:"67890",categoryId:"cat3",categoryName:"Bakery",name:"Croissant",productId:"4444444",barcode:"998877665",barcodeType:"EAN-8",status:"inactive",appearance:{type:"image",value:"croissant.jpg"}}];function fce(){const[e,t]=_.useState("products"),[r,n]=_.useState(uce),[i,o]=_.useState(cce),[s,u]=_.useState(!1),[f,l]=_.useState(!1);return h.jsxs("div",{className:"h-full flex flex-col",children:[h.jsxs("div",{className:"pb-4",children:[h.jsxs("div",{className:"flex flex-nowrap items-center gap-3 flex-wrap",children:[h.jsxs("div",{className:"flex items-center w-40 shrink-0 rounded-md border border-gray-300 bg-white overflow-hidden",style:{height:40},children:[h.jsx(Cw,{className:"h-4 w-4 text-gray-400 shrink-0 ml-2.5 pointer-events-none"}),h.jsx(be,{placeholder:"Search...",className:"flex-1 min-w-0 border-0 bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0 py-2 px-2 h-full placeholder:text-gray-500"})]}),h.jsxs(Ze,{defaultValue:"partner-a",children:[h.jsx(et,{className:"w-[140px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:h.jsx(Je,{placeholder:"Partner"})}),h.jsx(nt,{children:h.jsx(Ae,{value:"partner-a",children:"Partner A"})})]}),h.jsxs(Ze,{defaultValue:"group-b",children:[h.jsx(et,{className:"w-[140px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:h.jsx(Je,{placeholder:"Group"})}),h.jsx(nt,{children:h.jsx(Ae,{value:"group-b",children:"Group B"})})]}),h.jsxs(Ze,{defaultValue:"loc-12345",children:[h.jsx(et,{className:"w-[160px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:h.jsx(Je,{placeholder:"Location"})}),h.jsxs(nt,{children:[h.jsx(Ae,{value:"loc-12345",children:"Location 12345"}),h.jsx(Ae,{value:"all",children:"All Locations"})]})]}),h.jsxs(Ze,{children:[h.jsx(et,{className:"w-[140px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:h.jsx(Je,{placeholder:"Category"})}),h.jsxs(nt,{children:[h.jsx(Ae,{value:"all",children:"All Categories"}),i.map(d=>h.jsx(Ae,{value:d.id,children:d.name},d.id))]})]}),h.jsx("div",{className:"flex-1 min-w-2"}),h.jsxs(we,{variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 bg-white hover:bg-gray-50 gap-2 shrink-0",children:[h.jsx(k6,{className:"w-4 h-4"})," Bulk Import"]}),h.jsxs(we,{variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 bg-white hover:bg-gray-50 gap-2 shrink-0",children:[h.jsx(Pw,{className:"w-4 h-4"})," Bulk Export"]}),h.jsxs(we,{variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 bg-white hover:bg-gray-50 gap-2 shrink-0",children:[h.jsx(ro,{className:"w-4 h-4"})," Bulk Edit"]}),e==="products"?h.jsxs(we,{className:"h-10 rounded-md bg-blue-600 text-white hover:bg-blue-700 font-medium gap-1 shrink-0",onClick:()=>u(!0),children:["New Product ",h.jsx(jr,{className:"w-4 h-4"})]}):h.jsxs(we,{className:"h-10 rounded-md bg-blue-600 text-white hover:bg-blue-700 font-medium gap-1 shrink-0",onClick:()=>l(!0),children:["New Category ",h.jsx(jr,{className:"w-4 h-4"})]})]}),h.jsx("div",{className:"w-full border-b border-gray-200 mt-4",children:h.jsxs("div",{className:"flex overflow-x-auto w-fit",children:[h.jsx("button",{onClick:()=>t("products"),style:e==="products"?{borderBottomWidth:2,borderBottomStyle:"solid",borderBottomColor:"#2563eb"}:void 0,className:`px-4 py-2.5 text-sm font-medium whitespace-nowrap cursor-pointer transition-colors -mb-px border-b-2 ${e==="products"?"text-blue-600":"border-b-transparent text-gray-600 hover:text-gray-800"}`,children:"Products"}),h.jsx("button",{onClick:()=>t("categories"),style:e==="categories"?{borderBottomWidth:2,borderBottomStyle:"solid",borderBottomColor:"#2563eb"}:void 0,className:`px-4 py-2.5 text-sm font-medium whitespace-nowrap cursor-pointer transition-colors -mb-px border-b-2 ${e==="categories"?"text-blue-600":"border-b-transparent text-gray-600 hover:text-gray-800"}`,children:"Categories"})]})})]}),h.jsx("div",{className:"flex-1 overflow-auto pt-6",children:e==="products"?h.jsx("div",{className:"bg-white border border-gray-200 shadow-sm rounded-md overflow-hidden",children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsxs(Ke,{className:"bg-gray-100 hover:bg-gray-100",children:[h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Location ID"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Product Category"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Product"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Product ID"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Product Barcode"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Status"}),h.jsx(me,{className:"text-gray-900 font-bold text-center",children:"Actions"})]})}),h.jsx(mr,{children:r.map(d=>h.jsxs(Ke,{children:[h.jsx(se,{className:"border-r font-numeric",children:d.locationId}),h.jsx(se,{className:"border-r text-gray-900 font-medium",children:d.categoryName}),h.jsx(se,{className:"border-r text-gray-900 font-medium",children:h.jsxs("div",{className:"flex items-center gap-2",children:[d.appearance.type==="color"&&h.jsx("div",{className:"w-4 h-4 rounded-full border border-gray-300 shadow-sm",style:{backgroundColor:d.appearance.value}}),d.appearance.type==="image"&&h.jsx(Wo,{className:"w-4 h-4 text-gray-500"}),d.name]})}),h.jsx(se,{className:"border-r font-numeric text-gray-600",children:d.productId}),h.jsx(se,{className:"border-r font-numeric",children:h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{className:"text-xs text-gray-400",children:d.barcodeType}),h.jsx("span",{children:d.barcode})]})}),h.jsx(se,{className:"border-r",children:h.jsx(Cn,{variant:d.status==="active"?"default":"secondary",className:d.status==="active"?"bg-green-600":"bg-gray-400",children:d.status})}),h.jsx(se,{className:"text-center",children:h.jsx(we,{variant:"ghost",size:"icon",className:"h-8 w-8",children:h.jsx(Aw,{className:"h-4 w-4"})})})]},d.id))})]})}):h.jsx("div",{className:"bg-white border border-gray-200 shadow-sm rounded-md overflow-hidden",children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsxs(Ke,{className:"bg-gray-100 hover:bg-gray-100",children:[h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Category Name"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Display Type"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Preview"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Status"}),h.jsx(me,{className:"text-gray-900 font-bold text-center",children:"Actions"})]})}),h.jsx(mr,{children:i.map(d=>h.jsxs(Ke,{children:[h.jsx(se,{className:"border-r font-medium",children:d.name}),h.jsx(se,{className:"border-r capitalize",children:d.type}),h.jsxs(se,{className:"border-r",children:[d.type==="color"&&h.jsx("div",{className:"w-8 h-8 rounded-md border border-gray-200 shadow-sm",style:{backgroundColor:d.value}}),d.type==="image"&&h.jsx("div",{className:"w-8 h-8 bg-gray-100 flex items-center justify-center rounded-md border border-gray-200",children:h.jsx(Wo,{className:"w-4 h-4 text-gray-500"})}),d.type==="text"&&h.jsx("div",{className:"w-auto px-2 py-1 bg-gray-100 rounded-md border border-gray-200 text-xs font-medium inline-block",children:d.value})]}),h.jsx(se,{className:"border-r",children:h.jsx(Cn,{variant:d.status==="active"?"default":"secondary",className:d.status==="active"?"bg-green-600":"bg-gray-400",children:d.status})}),h.jsx(se,{className:"text-center",children:h.jsx(we,{variant:"ghost",size:"icon",className:"h-8 w-8",children:h.jsx(ro,{className:"h-4 w-4"})})})]},d.id))})]})})}),h.jsx(dce,{open:s,onOpenChange:u,categories:i}),h.jsx(hce,{open:f,onOpenChange:l})]})}function dce({open:e,onOpenChange:t,categories:r}){const[n,i]=_.useState("text");return h.jsx(un,{open:e,onOpenChange:t,children:h.jsxs(fn,{className:"sm:max-w-[600px] max-h-[90vh] overflow-y-auto",children:[h.jsxs(dn,{children:[h.jsx(hn,{children:"Add New Product"}),h.jsx(ki,{children:"Create a new product. Fill in the details below."})]}),h.jsxs("div",{className:"grid gap-6 py-4",children:[h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Product Category"}),h.jsxs(Ze,{children:[h.jsx(et,{children:h.jsx(Je,{placeholder:"Select Category"})}),h.jsx(nt,{children:r.map(o=>h.jsx(Ae,{value:o.id,children:o.name},o.id))})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Product Name"}),h.jsx(be,{placeholder:"e.g. Whole Milk"})]})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Product ID"}),h.jsx(be,{placeholder:"Internal ID"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Status"}),h.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[h.jsx(kn,{defaultChecked:!0}),h.jsx("span",{className:"text-sm text-gray-500",children:"Active"})]})]})]}),h.jsxs("div",{className:"space-y-3 p-4 bg-gray-50 rounded-md border border-gray-100",children:[h.jsxs(he,{className:"flex items-center gap-2",children:[h.jsx(_8,{className:"w-4 h-4"})," Barcode Settings"]}),h.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[h.jsx("div",{className:"col-span-1",children:h.jsxs(Ze,{defaultValue:"ean13",children:[h.jsx(et,{children:h.jsx(Je,{placeholder:"Format"})}),h.jsxs(nt,{children:[h.jsx(Ae,{value:"ean13",children:"EAN-13"}),h.jsx(Ae,{value:"upc-a",children:"UPC-A"}),h.jsx(Ae,{value:"code128",children:"Code 128"}),h.jsx(Ae,{value:"qr",children:"QR Code"})]})]})}),h.jsx("div",{className:"col-span-2",children:h.jsx(be,{placeholder:"Barcode Value"})})]}),h.jsx(we,{variant:"link",className:"px-0 text-xs h-auto",children:"+ Add another barcode standard"})]}),h.jsxs("div",{className:"space-y-3",children:[h.jsx(he,{children:"App Appearance"}),h.jsxs(b4,{value:n,onValueChange:i,className:"w-full",children:[h.jsxs(w4,{className:"grid w-full grid-cols-3",children:[h.jsxs(ss,{value:"text",className:"flex items-center gap-2",children:[h.jsx(up,{className:"w-3 h-3"})," Text"]}),h.jsxs(ss,{value:"color",className:"flex items-center gap-2",children:[h.jsx(tM,{className:"w-3 h-3"})," Color"]}),h.jsxs(ss,{value:"image",className:"flex items-center gap-2",children:[h.jsx(Wo,{className:"w-3 h-3"})," Image"]})]}),h.jsxs(ls,{value:"text",className:"mt-4 space-y-2",children:[h.jsx(he,{children:"Display Text"}),h.jsx(be,{placeholder:"Text to display on button"})]}),h.jsxs(ls,{value:"color",className:"mt-4 space-y-2",children:[h.jsx(he,{children:"Select Color"}),h.jsxs("div",{className:"flex gap-2 flex-wrap",children:[["#ef4444","#f97316","#f59e0b","#84cc16","#10b981","#06b6d4","#3b82f6","#6366f1","#a855f7","#ec4899"].map(o=>h.jsx("button",{className:"w-8 h-8 rounded-full border border-gray-200 shadow-sm hover:scale-110 transition-transform",style:{backgroundColor:o}},o)),h.jsx("button",{className:"w-8 h-8 rounded-full border border-dashed border-gray-400 flex items-center justify-center hover:bg-gray-50",children:h.jsx(jr,{className:"w-4 h-4 text-gray-400"})})]})]}),h.jsxs(ls,{value:"image",className:"mt-4 space-y-2",children:[h.jsx(he,{children:"Upload Image"}),h.jsxs("div",{className:"border-2 border-dashed border-gray-300 rounded-md p-6 flex flex-col items-center justify-center text-gray-500 hover:bg-gray-50 cursor-pointer",children:[h.jsx(Wo,{className:"w-8 h-8 mb-2 opacity-50"}),h.jsx("span",{className:"text-xs",children:"Click to upload or drag and drop"})]})]})]})]}),h.jsxs("div",{className:"space-y-3 pt-2 border-t border-gray-100",children:[h.jsx(he,{children:"Store Availability"}),h.jsxs("div",{className:"space-y-2",children:[h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsx("input",{type:"radio",id:"all-stores",name:"scope",className:"text-blue-600 focus:ring-blue-500",defaultChecked:!0}),h.jsx("label",{htmlFor:"all-stores",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"All Stores in Group"})]}),h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsx("input",{type:"radio",id:"specific-stores",name:"scope",className:"text-blue-600 focus:ring-blue-500"}),h.jsx("label",{htmlFor:"specific-stores",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Specific Location(s)"})]})]}),h.jsx("div",{className:"pl-6 pt-2",children:h.jsx(Ze,{disabled:!0,children:h.jsx(et,{className:"h-8 text-sm",children:h.jsx(Je,{placeholder:"Select Locations..."})})})})]})]}),h.jsxs($n,{children:[h.jsx(we,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),h.jsx(we,{onClick:()=>t(!1),className:"bg-blue-600 hover:bg-blue-700 text-white",children:"Create Product"})]})]})})}function hce({open:e,onOpenChange:t}){const[r,n]=_.useState("text");return h.jsx(un,{open:e,onOpenChange:t,children:h.jsxs(fn,{className:"sm:max-w-[500px]",children:[h.jsxs(dn,{children:[h.jsx(hn,{children:"Add New Category"}),h.jsx(ki,{children:"Create a product category to organize your items."})]}),h.jsxs("div",{className:"grid gap-6 py-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Category Name"}),h.jsx(be,{placeholder:"e.g. Dairy, Meat, Bakery"})]}),h.jsxs("div",{className:"space-y-3",children:[h.jsx(he,{children:"Button Appearance"}),h.jsxs(b4,{value:r,onValueChange:n,className:"w-full",children:[h.jsxs(w4,{className:"grid w-full grid-cols-3",children:[h.jsxs(ss,{value:"text",className:"flex items-center gap-2",children:[h.jsx(up,{className:"w-3 h-3"})," Text"]}),h.jsxs(ss,{value:"color",className:"flex items-center gap-2",children:[h.jsx(tM,{className:"w-3 h-3"})," Color"]}),h.jsxs(ss,{value:"image",className:"flex items-center gap-2",children:[h.jsx(Wo,{className:"w-3 h-3"})," Image"]})]}),h.jsxs(ls,{value:"text",className:"mt-4 space-y-2",children:[h.jsx(he,{children:"Display Text"}),h.jsx(be,{placeholder:"Category Name"})]}),h.jsxs(ls,{value:"color",className:"mt-4 space-y-2",children:[h.jsx(he,{children:"Select Color"}),h.jsxs("div",{className:"flex gap-2 flex-wrap",children:[["#bfdbfe","#bbf7d0","#fecaca","#ddd6fe","#fde68a"].map(i=>h.jsx("button",{className:"w-8 h-8 rounded-full border border-gray-200 shadow-sm hover:scale-110 transition-transform",style:{backgroundColor:i}},i)),h.jsx("button",{className:"w-8 h-8 rounded-full border border-dashed border-gray-400 flex items-center justify-center hover:bg-gray-50",children:h.jsx(jr,{className:"w-4 h-4 text-gray-400"})})]})]}),h.jsxs(ls,{value:"image",className:"mt-4 space-y-2",children:[h.jsx(he,{children:"Upload Icon/Image"}),h.jsxs("div",{className:"border-2 border-dashed border-gray-300 rounded-md p-6 flex flex-col items-center justify-center text-gray-500 hover:bg-gray-50 cursor-pointer",children:[h.jsx(Wo,{className:"w-8 h-8 mb-2 opacity-50"}),h.jsx("span",{className:"text-xs",children:"Click to upload"})]})]})]})]}),h.jsx("div",{className:"grid grid-cols-2 gap-4",children:h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Status"}),h.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[h.jsx(kn,{defaultChecked:!0}),h.jsx("span",{className:"text-sm text-gray-500",children:"Active"})]})]})}),h.jsxs("div",{className:"space-y-3 pt-2 border-t border-gray-100",children:[h.jsx(he,{children:"Store Availability"}),h.jsxs("div",{className:"space-y-2",children:[h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsx("input",{type:"radio",id:"cat-all-stores",name:"cat-scope",className:"text-blue-600 focus:ring-blue-500",defaultChecked:!0}),h.jsx("label",{htmlFor:"cat-all-stores",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"All Stores in Group"})]}),h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsx("input",{type:"radio",id:"cat-specific-stores",name:"cat-scope",className:"text-blue-600 focus:ring-blue-500"}),h.jsx("label",{htmlFor:"cat-specific-stores",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Specific Location(s)"})]})]})]})]}),h.jsxs($n,{children:[h.jsx(we,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),h.jsx(we,{onClick:()=>t(!1),className:"bg-blue-600 hover:bg-blue-700 text-white",children:"Create Category"})]})]})})}var pm="Checkbox",[pce]=In(pm),[mce,l_]=pce(pm);function vce(e){const{__scopeCheckbox:t,checked:r,children:n,defaultChecked:i,disabled:o,form:s,name:u,onCheckedChange:f,required:l,value:d="on",internal_do_not_use_render:p}=e,[m,g]=Pi({prop:r,defaultProp:i??!1,onChange:f,caller:pm}),[b,y]=_.useState(null),[w,j]=_.useState(null),O=_.useRef(!1),E=b?!!s||!!b.closest("form"):!0,N={checked:m,disabled:o,setChecked:g,control:b,setControl:y,name:u,form:s,value:d,hasConsumerStoppedPropagationRef:O,required:l,defaultChecked:oo(i)?!1:i,isFormControl:E,bubbleInput:w,setBubbleInput:j};return h.jsx(mce,{scope:t,...N,children:gce(p)?p(N):n})}var S4="CheckboxTrigger",_4=_.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:r,...n},i)=>{const{control:o,value:s,disabled:u,checked:f,required:l,setControl:d,setChecked:p,hasConsumerStoppedPropagationRef:m,isFormControl:g,bubbleInput:b}=l_(S4,e),y=Xe(i,d),w=_.useRef(f);return _.useEffect(()=>{const j=o?.form;if(j){const O=()=>p(w.current);return j.addEventListener("reset",O),()=>j.removeEventListener("reset",O)}},[o,p]),h.jsx(qe.button,{type:"button",role:"checkbox","aria-checked":oo(f)?"mixed":f,"aria-required":l,"data-state":C4(f),"data-disabled":u?"":void 0,disabled:u,value:s,...n,ref:y,onKeyDown:ke(t,j=>{j.key==="Enter"&&j.preventDefault()}),onClick:ke(r,j=>{p(O=>oo(O)?!0:!O),b&&g&&(m.current=j.isPropagationStopped(),m.current||j.stopPropagation())})})});_4.displayName=S4;var j4=_.forwardRef((e,t)=>{const{__scopeCheckbox:r,name:n,checked:i,defaultChecked:o,required:s,disabled:u,value:f,onCheckedChange:l,form:d,...p}=e;return h.jsx(vce,{__scopeCheckbox:r,checked:i,defaultChecked:o,disabled:u,required:s,onCheckedChange:l,name:n,form:d,value:f,internal_do_not_use_render:({isFormControl:m})=>h.jsxs(h.Fragment,{children:[h.jsx(_4,{...p,ref:t,__scopeCheckbox:r}),m&&h.jsx(A4,{__scopeCheckbox:r})]})})});j4.displayName=pm;var O4="CheckboxIndicator",E4=_.forwardRef((e,t)=>{const{__scopeCheckbox:r,forceMount:n,...i}=e,o=l_(O4,r);return h.jsx(Or,{present:n||oo(o.checked)||o.checked===!0,children:h.jsx(qe.span,{"data-state":C4(o.checked),"data-disabled":o.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});E4.displayName=O4;var P4="CheckboxBubbleInput",A4=_.forwardRef(({__scopeCheckbox:e,...t},r)=>{const{control:n,hasConsumerStoppedPropagationRef:i,checked:o,defaultChecked:s,required:u,disabled:f,name:l,value:d,form:p,bubbleInput:m,setBubbleInput:g}=l_(P4,e),b=Xe(r,g),y=t_(o),w=XS(n);_.useEffect(()=>{const O=m;if(!O)return;const E=window.HTMLInputElement.prototype,A=Object.getOwnPropertyDescriptor(E,"checked").set,C=!i.current;if(y!==o&&A){const T=new Event("click",{bubbles:C});O.indeterminate=oo(o),A.call(O,oo(o)?!1:o),O.dispatchEvent(T)}},[m,y,o,i]);const j=_.useRef(oo(o)?!1:o);return h.jsx(qe.input,{type:"checkbox","aria-hidden":!0,defaultChecked:s??j.current,required:u,disabled:f,name:l,value:d,form:p,...t,tabIndex:-1,ref:b,style:{...t.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});A4.displayName=P4;function gce(e){return typeof e=="function"}function oo(e){return e==="indeterminate"}function C4(e){return oo(e)?"indeterminate":e?"checked":"unchecked"}function cc({className:e,...t}){return h.jsx(j4,{"data-slot":"checkbox",className:Te("peer border bg-input-background dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:h.jsx(E4,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:h.jsx(YR,{className:"size-3.5"})})})}const yce=[{id:"1",name:"Downtown Store (101)"},{id:"2",name:"Uptown Store (102)"},{id:"3",name:"Airport Kiosk (201)"},{id:"4",name:"Mall Outlet (305)"}],xce=[{id:"r1",name:"Partner Admin",permissions:["all"],notifications:["system_updates","billing"]},{id:"r2",name:"Group Admin",permissions:["manage_users","manage_products","view_reports"],notifications:["new_users"]},{id:"r3",name:"Manager",permissions:["manage_store","view_reports","manage_inventory"],notifications:["label_expiry","low_stock"]},{id:"r4",name:"Team Member",permissions:["view_tasks","print_labels"],notifications:["task_assignment"]}],N4=[{id:"p1",name:"Global Foods Inc.",status:"active",contact:"admin@globalfoods.com",phone:"+1 (555) 100-2000"},{id:"p2",name:"Local Eateries Co.",status:"active",contact:"support@localeateries.com",phone:"+1 (555) 200-3000"}],bce=[{id:"g1",name:"West Coast Region",partner:"Global Foods Inc.",status:"active"},{id:"g2",name:"East Coast Region",partner:"Global Foods Inc.",status:"inactive"}],wce=[{id:"m1",name:"Alice Johnson",role:"Manager",locations:["Downtown Store (101)","Uptown Store (102)"],email:"alice@example.com",phone:"+1 (555) 111-2222",status:"active"},{id:"m2",name:"Bob Smith",role:"Team Member",locations:["Airport Kiosk (201)"],email:"bob@example.com",phone:"+1 (555) 222-3333",status:"active"},{id:"m3",name:"Charlie Brown",role:"Team Member",locations:["Downtown Store (101)"],email:"charlie@example.com",phone:"+1 (555) 333-4444",status:"inactive"}];function Sce(){const[e,t]=_.useState("Roles"),[r,n]=_.useState(xce),[i,o]=_.useState(N4),[s,u]=_.useState(bce),[f,l]=_.useState(wce),[d,p]=_.useState(!1),[m,g]=_.useState(!1),[b,y]=_.useState(!1),[w,j]=_.useState(!1),O=()=>{alert(`Exporting ${e} list to PDF...`)},E=()=>{switch(e){case"Roles":p(!0);break;case"Partner":g(!0);break;case"Group":y(!0);break;case"Team Member":j(!0);break}},N=()=>{const C=e==="Team Member";return h.jsxs("div",{className:"flex flex-col gap-4 pb-4",children:[h.jsxs("div",{className:"flex flex-nowrap items-center gap-3",children:[h.jsx(be,{placeholder:"Search",style:{height:40,boxSizing:"border-box"},className:"border border-gray-300 rounded-md w-40 shrink-0 bg-white placeholder:text-gray-500"}),h.jsx("div",{className:"flex-1"}),C&&h.jsxs(h.Fragment,{children:[h.jsx(we,{variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 px-4 bg-white hover:bg-gray-50 shrink-0",children:"Bulk Import"}),h.jsx(we,{variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 px-4 bg-white hover:bg-gray-50 shrink-0",children:"Bulk Edit"})]}),h.jsx(we,{variant:"outline",onClick:O,className:"h-10 border border-gray-300 rounded-md text-gray-900 px-4 bg-white hover:bg-gray-50 shrink-0",children:"Bulk Export (PDF)"}),h.jsx(we,{className:"h-10 bg-blue-600 hover:bg-blue-700 text-white rounded-md px-6 font-medium shrink-0",onClick:E,children:"New+"})]}),h.jsx("div",{className:"w-full border-b border-gray-200",children:h.jsx("div",{className:"flex overflow-x-auto w-fit",children:["Roles","Partner","Group","Team Member"].map(T=>h.jsx("button",{onClick:()=>t(T),style:e===T?{borderBottomWidth:2,borderBottomStyle:"solid",borderBottomColor:"#2563eb"}:void 0,className:Te("px-4 py-2.5 text-sm font-medium whitespace-nowrap cursor-pointer transition-colors -mb-px border-b-2",e===T?"text-blue-600":"border-b-transparent text-gray-600 hover:text-gray-800"),children:T},T))})})]})},A=()=>{switch(e){case"Roles":return h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsxs(Ke,{className:"bg-gray-100",children:[h.jsx(me,{className:"font-bold text-black border-r",children:"Role Name"}),h.jsx(me,{className:"font-bold text-black border-r",children:"Access Permissions"}),h.jsx(me,{className:"font-bold text-black border-r",children:"Notifications"}),h.jsx(me,{className:"font-bold text-black text-center",children:"Actions"})]})}),h.jsx(mr,{children:r.map(C=>h.jsxs(Ke,{children:[h.jsx(se,{className:"font-medium border-r",children:C.name}),h.jsx(se,{className:"border-r",children:h.jsx("div",{className:"flex flex-wrap gap-1",children:C.permissions.map(T=>h.jsx(Cn,{variant:"secondary",className:"text-xs bg-blue-100 text-blue-800 hover:bg-blue-100",children:T},T))})}),h.jsx(se,{className:"border-r",children:h.jsx("div",{className:"flex flex-wrap gap-1",children:C.notifications.map(T=>h.jsx(Cn,{variant:"outline",className:"text-xs border-orange-200 text-orange-700 bg-orange-50",children:T},T))})}),h.jsx(se,{className:"text-center",children:h.jsx(we,{variant:"ghost",size:"sm",children:h.jsx(ro,{className:"w-4 h-4 text-gray-500"})})})]},C.id))})]});case"Partner":return h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsxs(Ke,{className:"bg-gray-100",children:[h.jsx(me,{className:"font-bold text-black border-r",children:"Partner Name"}),h.jsx(me,{className:"font-bold text-black border-r",children:"Contact"}),h.jsx(me,{className:"font-bold text-black border-r",children:"Phone"}),h.jsx(me,{className:"font-bold text-black border-r",children:"Status"}),h.jsx(me,{className:"font-bold text-black text-center",children:"Actions"})]})}),h.jsx(mr,{children:i.map(C=>h.jsxs(Ke,{children:[h.jsx(se,{className:"font-medium border-r",children:C.name}),h.jsx(se,{className:"border-r",children:C.contact}),h.jsx(se,{className:"border-r text-gray-600",children:C.phone}),h.jsx(se,{className:"border-r",children:h.jsx(Cn,{className:C.status==="active"?"bg-green-600":"bg-gray-400",children:C.status})}),h.jsx(se,{className:"text-center",children:h.jsx(we,{variant:"ghost",size:"sm",children:h.jsx(ro,{className:"w-4 h-4 text-gray-500"})})})]},C.id))})]});case"Group":return h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsxs(Ke,{className:"bg-gray-100",children:[h.jsx(me,{className:"font-bold text-black border-r",children:"Group Name"}),h.jsx(me,{className:"font-bold text-black border-r",children:"Parent Partner"}),h.jsx(me,{className:"font-bold text-black border-r",children:"Status"}),h.jsx(me,{className:"font-bold text-black text-center",children:"Actions"})]})}),h.jsx(mr,{children:s.map(C=>h.jsxs(Ke,{children:[h.jsx(se,{className:"font-medium border-r",children:C.name}),h.jsx(se,{className:"border-r",children:C.partner}),h.jsx(se,{className:"border-r",children:h.jsx(Cn,{className:C.status==="active"?"bg-green-600":"bg-gray-400",children:C.status})}),h.jsx(se,{className:"text-center",children:h.jsx(we,{variant:"ghost",size:"sm",children:h.jsx(ro,{className:"w-4 h-4 text-gray-500"})})})]},C.id))})]});case"Team Member":return h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsxs(Ke,{className:"bg-gray-100",children:[h.jsx(me,{className:"font-bold text-black border-r",children:"Name"}),h.jsx(me,{className:"font-bold text-black border-r",children:"Email"}),h.jsx(me,{className:"font-bold text-black border-r",children:"Phone"}),h.jsx(me,{className:"font-bold text-black border-r",children:"Role"}),h.jsx(me,{className:"font-bold text-black border-r",children:"Assigned Locations"}),h.jsx(me,{className:"font-bold text-black border-r",children:"Status"}),h.jsx(me,{className:"font-bold text-black text-center",children:"Actions"})]})}),h.jsx(mr,{children:f.map(C=>h.jsxs(Ke,{children:[h.jsx(se,{className:"font-medium border-r",children:C.name}),h.jsx(se,{className:"border-r text-gray-600",children:C.email}),h.jsx(se,{className:"border-r text-gray-600",children:C.phone}),h.jsx(se,{className:"border-r",children:h.jsx(Cn,{variant:"outline",className:"font-normal",children:C.role})}),h.jsx(se,{className:"border-r",children:h.jsx("div",{className:"flex flex-col gap-1",children:C.locations.map(T=>h.jsxs("div",{className:"flex items-center gap-1 text-xs text-gray-600",children:[h.jsx(Fs,{className:"w-3 h-3"})," ",T]},T))})}),h.jsx(se,{className:"border-r",children:h.jsx(Cn,{className:C.status==="active"?"bg-green-600":"bg-gray-400",children:C.status})}),h.jsx(se,{className:"text-center",children:h.jsx(we,{variant:"ghost",size:"sm",children:h.jsx(ro,{className:"w-4 h-4 text-gray-500"})})})]},C.id))})]})}};return h.jsxs("div",{className:"h-full flex flex-col",children:[N(),h.jsx("div",{className:"flex-1 overflow-auto pt-6",children:h.jsx("div",{className:"bg-white border border-gray-200 shadow-sm rounded-md",children:A()})}),h.jsx(_ce,{open:d,onOpenChange:p}),h.jsx(jce,{open:m,onOpenChange:g}),h.jsx(Oce,{open:b,onOpenChange:y}),h.jsx(Ece,{open:w,onOpenChange:j,roles:r})]})}function _ce({open:e,onOpenChange:t}){return h.jsx(un,{open:e,onOpenChange:t,children:h.jsxs(fn,{className:"sm:max-w-[600px]",children:[h.jsxs(dn,{children:[h.jsx(hn,{children:"Create New Role"}),h.jsx(ki,{children:"Define permissions and notification settings for this role."})]}),h.jsxs("div",{className:"space-y-4 py-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Role Name"}),h.jsx(be,{placeholder:"e.g. Inventory Specialist"})]}),h.jsxs("div",{className:"space-y-3",children:[h.jsxs(he,{className:"flex items-center gap-2",children:[h.jsx(g6,{className:"w-4 h-4"})," Access Permissions"]}),h.jsx("div",{className:"grid grid-cols-2 gap-2 p-3 bg-gray-50 rounded border border-gray-100",children:["Manage Labels","Manage Products","Manage People","View Reports","Edit Settings","Approve Batches"].map(r=>h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsx(cc,{id:`perm-${r}`}),h.jsx("label",{htmlFor:`perm-${r}`,className:"text-sm font-medium leading-none cursor-pointer",children:r})]},r))})]}),h.jsxs("div",{className:"space-y-3",children:[h.jsxs(he,{className:"flex items-center gap-2",children:[h.jsx(O8,{className:"w-4 h-4"})," Notifications (Alerts)"]}),h.jsxs("div",{className:"grid grid-cols-1 gap-2 p-3 bg-gray-50 rounded border border-gray-100",children:[h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsx(cc,{id:"notif-expiry",defaultChecked:!0}),h.jsx("label",{htmlFor:"notif-expiry",className:"text-sm font-medium leading-none cursor-pointer",children:"Label Expiry Alerts"})]}),h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsx(cc,{id:"notif-stock"}),h.jsx("label",{htmlFor:"notif-stock",className:"text-sm font-medium leading-none cursor-pointer",children:"Low Stock Alerts"})]}),h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsx(cc,{id:"notif-tasks"}),h.jsx("label",{htmlFor:"notif-tasks",className:"text-sm font-medium leading-none cursor-pointer",children:"New Task Assignments"})]})]})]})]}),h.jsxs($n,{children:[h.jsx(we,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),h.jsx(we,{onClick:()=>t(!1),className:"bg-blue-600 text-white hover:bg-blue-700",children:"Save Role"})]})]})})}function jce({open:e,onOpenChange:t}){return h.jsx(un,{open:e,onOpenChange:t,children:h.jsxs(fn,{children:[h.jsx(dn,{children:h.jsx(hn,{children:"Create New Partner"})}),h.jsxs("div",{className:"space-y-4 py-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Partner Name"}),h.jsx(be,{placeholder:"Company Name"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Contact Email"}),h.jsx(be,{placeholder:"admin@partner.com"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Phone Number"}),h.jsx(be,{type:"tel",placeholder:"+1 (555) 000-0000"})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(kn,{id:"partner-status",defaultChecked:!0}),h.jsx(he,{htmlFor:"partner-status",children:"Active"})]})]}),h.jsxs($n,{children:[h.jsx(we,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),h.jsx(we,{onClick:()=>t(!1),className:"bg-blue-600 text-white hover:bg-blue-700",children:"Save Partner"})]})]})})}function Oce({open:e,onOpenChange:t}){return h.jsx(un,{open:e,onOpenChange:t,children:h.jsxs(fn,{children:[h.jsx(dn,{children:h.jsx(hn,{children:"Create New Group"})}),h.jsxs("div",{className:"space-y-4 py-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Group Name"}),h.jsx(be,{placeholder:"e.g. West Coast Region"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Assign to Partner"}),h.jsxs(Ze,{children:[h.jsx(et,{children:h.jsx(Je,{placeholder:"Select Partner"})}),h.jsx(nt,{children:N4.map(r=>h.jsx(Ae,{value:r.id,children:r.name},r.id))})]})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(kn,{id:"group-status",defaultChecked:!0}),h.jsx(he,{htmlFor:"group-status",children:"Active"})]})]}),h.jsxs($n,{children:[h.jsx(we,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),h.jsx(we,{onClick:()=>t(!1),className:"bg-blue-600 text-white hover:bg-blue-700",children:"Save Group"})]})]})})}function Ece({open:e,onOpenChange:t,roles:r}){return h.jsx(un,{open:e,onOpenChange:t,children:h.jsxs(fn,{className:"sm:max-w-[500px]",children:[h.jsxs(dn,{children:[h.jsx(hn,{children:"Add Team Member / Manager"}),h.jsx(ki,{children:"Create a user account and assign them to locations."})]}),h.jsxs("div",{className:"space-y-4 py-4 max-h-[60vh] overflow-y-auto pr-1",children:[h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Full Name"}),h.jsx(be,{placeholder:"John Doe"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Role"}),h.jsxs(Ze,{children:[h.jsx(et,{children:h.jsx(Je,{placeholder:"Select Role"})}),h.jsx(nt,{children:r.map(n=>h.jsx(Ae,{value:n.name,children:n.name},n.id))})]})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Password"}),h.jsx(be,{type:"password",placeholder:"Enter password",autoComplete:"new-password",className:"w-full"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Email Address"}),h.jsx(be,{type:"email",placeholder:"john@example.com"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Phone Number"}),h.jsx(be,{type:"tel",placeholder:"+1 (555) 000-0000"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(wc,{className:"h-[120px] w-full border rounded-md p-2",children:h.jsx("div",{className:"space-y-2",children:yce.map(n=>h.jsxs("div",{className:"flex items-center space-x-2",children:[h.jsx(cc,{id:`loc-${n.id}`}),h.jsx("label",{htmlFor:`loc-${n.id}`,className:"text-sm cursor-pointer w-full hover:bg-gray-50 p-1 rounded",children:n.name})]},n.id))})}),h.jsx("p",{className:"text-xs text-gray-500",children:"* Users must be assigned to at least one location."})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(kn,{id:"member-status",defaultChecked:!0}),h.jsx(he,{htmlFor:"member-status",children:"Active Account"})]})]}),h.jsxs($n,{children:[h.jsx(we,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),h.jsx(we,{onClick:()=>t(!1),className:"bg-blue-600 text-white hover:bg-blue-700",children:"Create User"})]})]})})}function Pce(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}Array(12).fill(0);let _w=1;class Ace{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const r=this.subscribers.indexOf(t);this.subscribers.splice(r,1)}),this.publish=t=>{this.subscribers.forEach(r=>r(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var r;const{message:n,...i}=t,o=typeof t?.id=="number"||((r=t.id)==null?void 0:r.length)>0?t.id:_w++,s=this.toasts.find(f=>f.id===o),u=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),s?this.toasts=this.toasts.map(f=>f.id===o?(this.publish({...f,...t,id:o,title:n}),{...f,...t,id:o,dismissible:u,title:n}):f):this.addToast({title:n,...i,dismissible:u,id:o}),o},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:t,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(n=>n({id:r.id,dismiss:!0}))}),t),this.message=(t,r)=>this.create({...r,message:t}),this.error=(t,r)=>this.create({...r,message:t,type:"error"}),this.success=(t,r)=>this.create({...r,type:"success",message:t}),this.info=(t,r)=>this.create({...r,type:"info",message:t}),this.warning=(t,r)=>this.create({...r,type:"warning",message:t}),this.loading=(t,r)=>this.create({...r,type:"loading",message:t}),this.promise=(t,r)=>{if(!r)return;let n;r.loading!==void 0&&(n=this.create({...r,promise:t,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const i=Promise.resolve(t instanceof Function?t():t);let o=n!==void 0,s;const u=i.then(async l=>{if(s=["resolve",l],F.isValidElement(l))o=!1,this.create({id:n,type:"default",message:l});else if(Nce(l)&&!l.ok){o=!1;const p=typeof r.error=="function"?await r.error(`HTTP error! status: ${l.status}`):r.error,m=typeof r.description=="function"?await r.description(`HTTP error! status: ${l.status}`):r.description,b=typeof p=="object"&&!F.isValidElement(p)?p:{message:p};this.create({id:n,type:"error",description:m,...b})}else if(l instanceof Error){o=!1;const p=typeof r.error=="function"?await r.error(l):r.error,m=typeof r.description=="function"?await r.description(l):r.description,b=typeof p=="object"&&!F.isValidElement(p)?p:{message:p};this.create({id:n,type:"error",description:m,...b})}else if(r.success!==void 0){o=!1;const p=typeof r.success=="function"?await r.success(l):r.success,m=typeof r.description=="function"?await r.description(l):r.description,b=typeof p=="object"&&!F.isValidElement(p)?p:{message:p};this.create({id:n,type:"success",description:m,...b})}}).catch(async l=>{if(s=["reject",l],r.error!==void 0){o=!1;const d=typeof r.error=="function"?await r.error(l):r.error,p=typeof r.description=="function"?await r.description(l):r.description,g=typeof d=="object"&&!F.isValidElement(d)?d:{message:d};this.create({id:n,type:"error",description:p,...g})}}).finally(()=>{o&&(this.dismiss(n),n=void 0),r.finally==null||r.finally.call(r)}),f=()=>new Promise((l,d)=>u.then(()=>s[0]==="reject"?d(s[1]):l(s[1])).catch(d));return typeof n!="string"&&typeof n!="number"?{unwrap:f}:Object.assign(n,{unwrap:f})},this.custom=(t,r)=>{const n=r?.id||_w++;return this.create({jsx:t(n),id:n,...r}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const rn=new Ace,Cce=(e,t)=>{const r=t?.id||_w++;return rn.addToast({title:e,...t,id:r}),r},Nce=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",Tce=Cce,kce=()=>rn.toasts,Rce=()=>rn.getActiveToasts(),Jt=Object.assign(Tce,{success:rn.success,info:rn.info,warning:rn.warning,error:rn.error,custom:rn.custom,message:rn.message,promise:rn.promise,dismiss:rn.dismiss,loading:rn.loading},{getHistory:kce,getToasts:Rce});Pce("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");const Mce=[{id:"1-251201",productName:"Whole Milk",category:"Dairy",template:'2"x2" Basic',printedAt:"2024-03-20 09:30 AM",printedBy:"Alice Johnson",location:"Downtown Store (101)",expiryDate:"2024-03-27",status:"Valid"},{id:"2-251201",productName:"Ground Beef",category:"Meat",template:'2"x2" Basic',printedAt:"2024-03-20 10:15 AM",printedBy:"Bob Smith",location:"Uptown Store (102)",expiryDate:"2024-03-23",status:"Valid"},{id:"3-251201",productName:"Croissant",category:"Bakery",template:'2"x2" Basic',printedAt:"2024-03-19 14:00 PM",printedBy:"Charlie Brown",location:"Downtown Store (101)",expiryDate:"2024-03-20",status:"Expired"},{id:"4-251201",productName:"Caesar Salad",category:"Deli",template:`2"x6" G'n'G !!!`,printedAt:"2024-03-18 11:45 AM",printedBy:"Alice Johnson",location:"Downtown Store (101)",expiryDate:"2024-03-21",status:"Expiring Soon"},{id:"5-251201",productName:"Orange Juice",category:"Beverage",template:'2"x2" Basic',printedAt:"2024-03-18 08:20 AM",printedBy:"Bob Smith",location:"Airport Kiosk (201)",expiryDate:"2024-03-25",status:"Valid"}],Ice=[{name:"Dairy",count:450},{name:"Meat",count:320},{name:"Bakery",count:280},{name:"Deli",count:190},{name:"Produce",count:150},{name:"Beverage",count:120}],Dce=[{date:"Mon",count:120},{date:"Tue",count:132},{date:"Wed",count:101},{date:"Thu",count:134},{date:"Fri",count:190},{date:"Sat",count:230},{date:"Sun",count:210}];function Lce(){const[e,t]=_.useState("print-log"),r=n=>{Jt.success(`Reprinting label ${n}`,{description:"Watermark 'RePrint' applied."})};return h.jsxs("div",{className:"h-full flex flex-col",children:[h.jsxs("div",{className:"pb-4",children:[h.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[h.jsxs(Ze,{defaultValue:"partner-a",children:[h.jsx(et,{className:"w-[140px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:h.jsx(Je,{placeholder:"Partner"})}),h.jsx(nt,{children:h.jsx(Ae,{value:"partner-a",children:"Partner A"})})]}),h.jsxs(Ze,{defaultValue:"group-b",children:[h.jsx(et,{className:"w-[140px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:h.jsx(Je,{placeholder:"Group"})}),h.jsx(nt,{children:h.jsx(Ae,{value:"group-b",children:"Group B"})})]}),h.jsxs(Ze,{defaultValue:"loc-12345",children:[h.jsx(et,{className:"w-[160px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:h.jsx(Je,{placeholder:"Location"})}),h.jsxs(nt,{children:[h.jsx(Ae,{value:"loc-12345",children:"Downtown Store"}),h.jsx(Ae,{value:"all",children:"All Locations"})]})]}),h.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[h.jsx("span",{className:"text-sm font-medium text-gray-700",children:"Period Search:"}),h.jsxs("div",{className:"flex items-center bg-white border border-gray-300 rounded-md h-10 px-2",style:{minHeight:40},children:[h.jsx(P8,{className:"w-4 h-4 text-gray-500 mr-2 shrink-0"}),h.jsx("input",{type:"date",className:"text-sm outline-none w-32 bg-transparent"}),h.jsx("span",{className:"mx-2 text-gray-400",children:"-"}),h.jsx("input",{type:"date",className:"text-sm outline-none w-32 bg-transparent"})]})]}),h.jsxs("div",{className:"flex items-center w-64 rounded-md border border-gray-300 bg-white overflow-hidden shrink-0",style:{height:40},children:[h.jsx(Cw,{className:"h-4 w-4 text-gray-400 shrink-0 ml-3 pointer-events-none"}),h.jsx(be,{placeholder:"Search Product or Category...",className:"flex-1 min-w-0 border-0 bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0 py-2 px-2 h-full placeholder:text-gray-500"})]}),h.jsx("div",{className:"flex-1 min-w-2"}),h.jsxs(we,{variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 bg-white hover:bg-gray-50 gap-2 shrink-0",children:[h.jsx(Pw,{className:"w-4 h-4"})," Export Report"]})]}),h.jsx("div",{className:"w-full border-b border-gray-200 mt-4",children:h.jsxs("div",{className:"flex overflow-x-auto w-fit",children:[h.jsx("button",{onClick:()=>t("print-log"),style:e==="print-log"?{borderBottomWidth:2,borderBottomStyle:"solid",borderBottomColor:"#2563eb"}:void 0,className:Te("px-4 py-2.5 text-sm font-medium whitespace-nowrap cursor-pointer transition-colors -mb-px border-b-2",e==="print-log"?"text-blue-600":"border-b-transparent text-gray-600 hover:text-gray-800"),children:"Print Log"}),h.jsx("button",{onClick:()=>t("label-report"),style:e==="label-report"?{borderBottomWidth:2,borderBottomStyle:"solid",borderBottomColor:"#2563eb"}:void 0,className:Te("px-4 py-2.5 text-sm font-medium whitespace-nowrap cursor-pointer transition-colors -mb-px border-b-2",e==="label-report"?"text-blue-600":"border-b-transparent text-gray-600 hover:text-gray-800"),children:"Label Report"})]})})]}),h.jsxs("div",{className:"flex-1 overflow-auto pt-6",children:[e==="print-log"&&h.jsx("div",{className:"bg-white border border-gray-200 shadow-sm rounded-md overflow-hidden",children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsxs(Ke,{className:"bg-gray-100 hover:bg-gray-100",children:[h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Label ID"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Product Name"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Category"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Template"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Printed At"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Printed By"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Location"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Expiry Date"}),h.jsx(me,{className:"text-gray-900 font-bold text-center",children:"Action"})]})}),h.jsx(mr,{children:Mce.map(n=>h.jsxs(Ke,{children:[h.jsx(se,{className:"border-r font-numeric text-gray-600",children:n.id}),h.jsx(se,{className:"border-r font-medium",children:n.productName}),h.jsx(se,{className:"border-r",children:h.jsx(Cn,{variant:"secondary",className:"bg-blue-50 text-blue-700 hover:bg-blue-50 border-blue-200",children:n.category})}),h.jsx(se,{className:"border-r text-gray-600 text-sm",children:(()=>{const i=n.template.endsWith(" !!!"),o=i?n.template.slice(0,-4):n.template,s=o.lastIndexOf(" "),u=o.slice(0,s+1),f=o.slice(s+1);return h.jsxs(h.Fragment,{children:[u,h.jsx("span",{className:"font-bold text-gray-900",children:f}),i&&h.jsx("span",{className:"text-red-600",children:" !!!"})]})})()}),h.jsx(se,{className:"border-r text-gray-600 text-sm font-numeric",children:n.printedAt}),h.jsx(se,{className:"border-r text-gray-600 text-sm",children:n.printedBy}),h.jsx(se,{className:"border-r text-gray-600 text-sm font-numeric",children:n.location}),h.jsx(se,{className:"border-r",children:h.jsx("span",{className:Te("text-sm font-medium font-numeric",n.status==="Expired"?"text-red-600":n.status==="Expiring Soon"?"text-orange-500":"text-green-600"),children:n.expiryDate})}),h.jsx(se,{className:"text-center",children:h.jsxs(we,{size:"sm",variant:"outline",className:"h-8 gap-1 hover:bg-gray-100 border-gray-300",onClick:()=>r(n.id),children:[h.jsx(rM,{className:"w-3 h-3"})," Reprint"]})})]},n.id))})]})}),e==="label-report"&&h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[h.jsxs($r,{children:[h.jsxs(On,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[h.jsx(En,{className:"text-sm font-medium",children:"Total Labels Printed"}),h.jsx(us,{className:"h-4 w-4 text-muted-foreground"})]}),h.jsxs(nn,{children:[h.jsx("div",{className:"text-2xl font-bold",children:"2,543"}),h.jsx("p",{className:"text-xs text-muted-foreground",children:"+20.1% from last month"})]})]}),h.jsxs($r,{children:[h.jsxs(On,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[h.jsx(En,{className:"text-sm font-medium",children:"Most Printed Category"}),h.jsx(C8,{className:"h-4 w-4 text-muted-foreground"})]}),h.jsxs(nn,{children:[h.jsx("div",{className:"text-2xl font-bold",children:"Dairy"}),h.jsx("p",{className:"text-xs text-muted-foreground",children:"450 labels generated"})]})]}),h.jsxs($r,{children:[h.jsxs(On,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[h.jsx(En,{className:"text-sm font-medium",children:"Top Product"}),h.jsx(XR,{className:"h-4 w-4 text-muted-foreground"})]}),h.jsxs(nn,{children:[h.jsx("div",{className:"text-2xl font-bold",children:"Whole Milk"}),h.jsx("p",{className:"text-xs text-muted-foreground",children:"182 labels generated"})]})]}),h.jsxs($r,{children:[h.jsxs(On,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[h.jsx(En,{className:"text-sm font-medium",children:"Avg. Daily Prints"}),h.jsx(f6,{className:"h-4 w-4 text-muted-foreground"})]}),h.jsxs(nn,{children:[h.jsx("div",{className:"text-2xl font-bold",children:"85"}),h.jsx("p",{className:"text-xs text-muted-foreground",children:"+12% from last week"})]})]})]}),h.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[h.jsxs($r,{className:"col-span-1",children:[h.jsxs(On,{children:[h.jsx(En,{children:"Labels by Category"}),h.jsx(Zd,{children:"Distribution of printed labels across product categories."})]}),h.jsx(nn,{className:"h-[300px]",children:h.jsx(uh,{width:"100%",height:"100%",children:h.jsxs(hne,{data:Ice,children:[h.jsx(Yh,{strokeDasharray:"3 3",vertical:!1}),h.jsx(Qo,{dataKey:"name",fontSize:12,tickLine:!1,axisLine:!1}),h.jsx(Zo,{fontSize:12,tickLine:!1,axisLine:!1,tickFormatter:n=>`${n}`}),h.jsx(Br,{}),h.jsx(ua,{dataKey:"count",fill:"#facc15",radius:[4,4,0,0]})]})})})]}),h.jsxs($r,{className:"col-span-1",children:[h.jsxs(On,{children:[h.jsx(En,{children:"Print Volume Trends"}),h.jsx(Zd,{children:"Daily label printing volume for the last 7 days."})]}),h.jsx(nn,{className:"h-[300px]",children:h.jsx(uh,{width:"100%",height:"100%",children:h.jsxs(i$,{data:Dce,children:[h.jsx(Yh,{strokeDasharray:"3 3",vertical:!1}),h.jsx(Qo,{dataKey:"date",fontSize:12,tickLine:!1,axisLine:!1}),h.jsx(Zo,{fontSize:12,tickLine:!1,axisLine:!1}),h.jsx(Br,{}),h.jsx(Qs,{type:"monotone",dataKey:"count",stroke:"#dc2626",strokeWidth:2,dot:{r:4},activeDot:{r:6}})]})})})]})]}),h.jsxs($r,{children:[h.jsx(On,{children:h.jsx(En,{children:"Most Used Products"})}),h.jsx(nn,{children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsxs(Ke,{children:[h.jsx(me,{children:"Product Name"}),h.jsx(me,{children:"Category"}),h.jsx(me,{className:"text-right",children:"Total Printed"}),h.jsx(me,{className:"text-right",children:"Usage %"})]})}),h.jsxs(mr,{children:[h.jsxs(Ke,{children:[h.jsx(se,{className:"font-medium",children:"Whole Milk"}),h.jsx(se,{children:"Dairy"}),h.jsx(se,{className:"text-right",children:"182"}),h.jsx(se,{className:"text-right",children:"7.2%"})]}),h.jsxs(Ke,{children:[h.jsx(se,{className:"font-medium",children:"Ground Beef 80/20"}),h.jsx(se,{children:"Meat"}),h.jsx(se,{className:"text-right",children:"145"}),h.jsx(se,{className:"text-right",children:"5.7%"})]}),h.jsxs(Ke,{children:[h.jsx(se,{className:"font-medium",children:"Chicken Breast"}),h.jsx(se,{children:"Meat"}),h.jsx(se,{className:"text-right",children:"132"}),h.jsx(se,{className:"text-right",children:"5.2%"})]}),h.jsxs(Ke,{children:[h.jsx(se,{className:"font-medium",children:"Sliced Ham"}),h.jsx(se,{children:"Deli"}),h.jsx(se,{className:"text-right",children:"98"}),h.jsx(se,{className:"text-right",children:"3.8%"})]})]})]})})]})]})]})]})}var $ce=Symbol("radix.slottable");function Bce(e){const t=({children:r})=>h.jsx(h.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=$ce,t}var[mm]=In("Tooltip",[el]),vm=el(),T4="TooltipProvider",Fce=700,jw="tooltip.open",[zce,c_]=mm(T4),k4=e=>{const{__scopeTooltip:t,delayDuration:r=Fce,skipDelayDuration:n=300,disableHoverableContent:i=!1,children:o}=e,s=_.useRef(!0),u=_.useRef(!1),f=_.useRef(0);return _.useEffect(()=>{const l=f.current;return()=>window.clearTimeout(l)},[]),h.jsx(zce,{scope:t,isOpenDelayedRef:s,delayDuration:r,onOpen:_.useCallback(()=>{window.clearTimeout(f.current),s.current=!1},[]),onClose:_.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>s.current=!0,n)},[n]),isPointerInTransitRef:u,onPointerInTransitChange:_.useCallback(l=>{u.current=l},[]),disableHoverableContent:i,children:o})};k4.displayName=T4;var iu="Tooltip",[qce,_u]=mm(iu),R4=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:i,onOpenChange:o,disableHoverableContent:s,delayDuration:u}=e,f=c_(iu,e.__scopeTooltip),l=vm(t),[d,p]=_.useState(null),m=Xn(),g=_.useRef(0),b=s??f.disableHoverableContent,y=u??f.delayDuration,w=_.useRef(!1),[j,O]=Pi({prop:n,defaultProp:i??!1,onChange:T=>{T?(f.onOpen(),document.dispatchEvent(new CustomEvent(jw))):f.onClose(),o?.(T)},caller:iu}),E=_.useMemo(()=>j?w.current?"delayed-open":"instant-open":"closed",[j]),N=_.useCallback(()=>{window.clearTimeout(g.current),g.current=0,w.current=!1,O(!0)},[O]),A=_.useCallback(()=>{window.clearTimeout(g.current),g.current=0,O(!1)},[O]),C=_.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{w.current=!0,O(!0),g.current=0},y)},[y,O]);return _.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]),h.jsx(ZS,{...l,children:h.jsx(qce,{scope:t,contentId:m,open:j,stateAttribute:E,trigger:d,onTriggerChange:p,onTriggerEnter:_.useCallback(()=>{f.isOpenDelayedRef.current?C():N()},[f.isOpenDelayedRef,C,N]),onTriggerLeave:_.useCallback(()=>{b?A():(window.clearTimeout(g.current),g.current=0)},[A,b]),onOpen:N,onClose:A,disableHoverableContent:b,children:r})})};R4.displayName=iu;var Ow="TooltipTrigger",M4=_.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,i=_u(Ow,r),o=c_(Ow,r),s=vm(r),u=_.useRef(null),f=Xe(t,u,i.onTriggerChange),l=_.useRef(!1),d=_.useRef(!1),p=_.useCallback(()=>l.current=!1,[]);return _.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),h.jsx(rm,{asChild:!0,...s,children:h.jsx(qe.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...n,ref:f,onPointerMove:ke(e.onPointerMove,m=>{m.pointerType!=="touch"&&!d.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),d.current=!0)}),onPointerLeave:ke(e.onPointerLeave,()=>{i.onTriggerLeave(),d.current=!1}),onPointerDown:ke(e.onPointerDown,()=>{i.open&&i.onClose(),l.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:ke(e.onFocus,()=>{l.current||i.onOpen()}),onBlur:ke(e.onBlur,i.onClose),onClick:ke(e.onClick,i.onClose)})})});M4.displayName=Ow;var u_="TooltipPortal",[Uce,Wce]=mm(u_,{forceMount:void 0}),I4=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:i}=e,o=_u(u_,t);return h.jsx(Uce,{scope:t,forceMount:r,children:h.jsx(Or,{present:r||o.open,children:h.jsx(gu,{asChild:!0,container:i,children:n})})})};I4.displayName=u_;var $s="TooltipContent",D4=_.forwardRef((e,t)=>{const r=Wce($s,e.__scopeTooltip),{forceMount:n=r.forceMount,side:i="top",...o}=e,s=_u($s,e.__scopeTooltip);return h.jsx(Or,{present:n||s.open,children:s.disableHoverableContent?h.jsx(L4,{side:i,...o,ref:t}):h.jsx(Hce,{side:i,...o,ref:t})})}),Hce=_.forwardRef((e,t)=>{const r=_u($s,e.__scopeTooltip),n=c_($s,e.__scopeTooltip),i=_.useRef(null),o=Xe(t,i),[s,u]=_.useState(null),{trigger:f,onClose:l}=r,d=i.current,{onPointerInTransitChange:p}=n,m=_.useCallback(()=>{u(null),p(!1)},[p]),g=_.useCallback((b,y)=>{const w=b.currentTarget,j={x:b.clientX,y:b.clientY},O=Xce(j,w.getBoundingClientRect()),E=Yce(j,O),N=Qce(y.getBoundingClientRect()),A=Jce([...E,...N]);u(A),p(!0)},[p]);return _.useEffect(()=>()=>m(),[m]),_.useEffect(()=>{if(f&&d){const b=w=>g(w,d),y=w=>g(w,f);return f.addEventListener("pointerleave",b),d.addEventListener("pointerleave",y),()=>{f.removeEventListener("pointerleave",b),d.removeEventListener("pointerleave",y)}}},[f,d,g,m]),_.useEffect(()=>{if(s){const b=y=>{const w=y.target,j={x:y.clientX,y:y.clientY},O=f?.contains(w)||d?.contains(w),E=!Zce(j,s);O?m():E&&(m(),l())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[f,d,s,l,m]),h.jsx(L4,{...e,ref:o})}),[Vce,Gce]=mm(iu,{isInside:!1}),Kce=Bce("TooltipContent"),L4=_.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:s,...u}=e,f=_u($s,r),l=vm(r),{onClose:d}=f;return _.useEffect(()=>(document.addEventListener(jw,d),()=>document.removeEventListener(jw,d)),[d]),_.useEffect(()=>{if(f.trigger){const p=m=>{m.target?.contains(f.trigger)&&d()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[f.trigger,d]),h.jsx(mu,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:p=>p.preventDefault(),onDismiss:d,children:h.jsxs(JS,{"data-state":f.stateAttribute,...l,...u,ref:t,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[h.jsx(Kce,{children:n}),h.jsx(Vce,{scope:r,isInside:!0,children:h.jsx(goe,{id:f.contentId,role:"tooltip",children:i||n})})]})})});D4.displayName=$s;var $4="TooltipArrow",B4=_.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,i=vm(r);return Gce($4,r).isInside?null:h.jsx(e_,{...i,...n,ref:t})});B4.displayName=$4;function Xce(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(r,n,i,o)){case o:return"left";case i:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function Yce(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function Qce(e){const{top:t,right:r,bottom:n,left:i}=e;return[{x:i,y:t},{x:r,y:t},{x:r,y:n},{x:i,y:n}]}function Zce(e,t){const{x:r,y:n}=e;let i=!1;for(let o=0,s=t.length-1;on!=m>n&&r<(p-l)*(n-d)/(m-d)+l&&(i=!i)}return i}function Jce(e){const t=e.slice();return t.sort((r,n)=>r.xn.x?1:r.yn.y?1:0),eue(t)}function eue(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n=2;){const o=t[t.length-1],s=t[t.length-2];if((o.x-s.x)*(i.y-s.y)>=(o.y-s.y)*(i.x-s.x))t.pop();else break}t.push(i)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const i=e[n];for(;r.length>=2;){const o=r[r.length-1],s=r[r.length-2];if((o.x-s.x)*(i.y-s.y)>=(o.y-s.y)*(i.x-s.x))r.pop();else break}r.push(i)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var tue=k4,rue=R4,nue=M4,iue=I4,oue=D4,aue=B4;function sue({delayDuration:e=0,...t}){return h.jsx(tue,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function Db({...e}){return h.jsx(sue,{children:h.jsx(rue,{"data-slot":"tooltip",...e})})}function Lb({...e}){return h.jsx(nue,{"data-slot":"tooltip-trigger",...e})}function $b({className:e,sideOffset:t=0,children:r,...n}){return h.jsx(iue,{children:h.jsxs(oue,{"data-slot":"tooltip-content",sideOffset:t,className:Te("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...n,children:[r,h.jsx(aue,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}function lue(e){const t=cue(e),r=_.forwardRef((n,i)=>{const{children:o,...s}=n,u=_.Children.toArray(o),f=u.find(fue);if(f){const l=f.props.children,d=u.map(p=>p===f?_.Children.count(l)>1?_.Children.only(null):_.isValidElement(l)?l.props.children:null:p);return h.jsx(t,{...s,ref:i,children:_.isValidElement(l)?_.cloneElement(l,void 0,d):null})}return h.jsx(t,{...s,ref:i,children:o})});return r.displayName=`${e}.Slot`,r}function cue(e){const t=_.forwardRef((r,n)=>{const{children:i,...o}=r;if(_.isValidElement(i)){const s=hue(i),u=due(o,i.props);return i.type!==_.Fragment&&(u.ref=n?ia(n,s):s),_.cloneElement(i,u)}return _.Children.count(i)>1?_.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var uue=Symbol("radix.slottable");function fue(e){return _.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===uue}function due(e,t){const r={...t};for(const n in t){const i=e[n],o=t[n];/^on[A-Z]/.test(n)?i&&o?r[n]=(...u)=>{const f=o(...u);return i(...u),f}:i&&(r[n]=i):n==="style"?r[n]={...i,...o}:n==="className"&&(r[n]=[i,o].filter(Boolean).join(" "))}return{...e,...r}}function hue(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var gm="Popover",[F4]=In(gm,[el]),ju=el(),[pue,mo]=F4(gm),z4=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:i,onOpenChange:o,modal:s=!1}=e,u=ju(t),f=_.useRef(null),[l,d]=_.useState(!1),[p,m]=Pi({prop:n,defaultProp:i??!1,onChange:o,caller:gm});return h.jsx(ZS,{...u,children:h.jsx(pue,{scope:t,contentId:Xn(),triggerRef:f,open:p,onOpenChange:m,onOpenToggle:_.useCallback(()=>m(g=>!g),[m]),hasCustomAnchor:l,onCustomAnchorAdd:_.useCallback(()=>d(!0),[]),onCustomAnchorRemove:_.useCallback(()=>d(!1),[]),modal:s,children:r})})};z4.displayName=gm;var q4="PopoverAnchor",mue=_.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,i=mo(q4,r),o=ju(r),{onCustomAnchorAdd:s,onCustomAnchorRemove:u}=i;return _.useEffect(()=>(s(),()=>u()),[s,u]),h.jsx(rm,{...o,...n,ref:t})});mue.displayName=q4;var U4="PopoverTrigger",W4=_.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,i=mo(U4,r),o=ju(r),s=Xe(t,i.triggerRef),u=h.jsx(qe.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":X4(i.open),...n,ref:s,onClick:ke(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?u:h.jsx(rm,{asChild:!0,...o,children:u})});W4.displayName=U4;var f_="PopoverPortal",[vue,gue]=F4(f_,{forceMount:void 0}),H4=e=>{const{__scopePopover:t,forceMount:r,children:n,container:i}=e,o=mo(f_,t);return h.jsx(vue,{scope:t,forceMount:r,children:h.jsx(Or,{present:r||o.open,children:h.jsx(gu,{asChild:!0,container:i,children:n})})})};H4.displayName=f_;var Bs="PopoverContent",V4=_.forwardRef((e,t)=>{const r=gue(Bs,e.__scopePopover),{forceMount:n=r.forceMount,...i}=e,o=mo(Bs,e.__scopePopover);return h.jsx(Or,{present:n||o.open,children:o.modal?h.jsx(xue,{...i,ref:t}):h.jsx(bue,{...i,ref:t})})});V4.displayName=Bs;var yue=lue("PopoverContent.RemoveScroll"),xue=_.forwardRef((e,t)=>{const r=mo(Bs,e.__scopePopover),n=_.useRef(null),i=Xe(t,n),o=_.useRef(!1);return _.useEffect(()=>{const s=n.current;if(s)return r_(s)},[]),h.jsx(im,{as:yue,allowPinchZoom:!0,children:h.jsx(G4,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ke(e.onCloseAutoFocus,s=>{s.preventDefault(),o.current||r.triggerRef.current?.focus()}),onPointerDownOutside:ke(e.onPointerDownOutside,s=>{const u=s.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0,l=u.button===2||f;o.current=l},{checkForDefaultPrevented:!1}),onFocusOutside:ke(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),bue=_.forwardRef((e,t)=>{const r=mo(Bs,e.__scopePopover),n=_.useRef(!1),i=_.useRef(!1);return h.jsx(G4,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(n.current||r.triggerRef.current?.focus(),o.preventDefault()),n.current=!1,i.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(n.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const s=o.target;r.triggerRef.current?.contains(s)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),G4=_.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:l,onInteractOutside:d,...p}=e,m=mo(Bs,r),g=ju(r);return qS(),h.jsx(Qp,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:o,children:h.jsx(mu,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:d,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:l,onDismiss:()=>m.onOpenChange(!1),children:h.jsx(JS,{"data-state":X4(m.open),role:"dialog",id:m.contentId,...g,...p,ref:t,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),K4="PopoverClose",wue=_.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,i=mo(K4,r);return h.jsx(qe.button,{type:"button",...n,ref:t,onClick:ke(e.onClick,()=>i.onOpenChange(!1))})});wue.displayName=K4;var Sue="PopoverArrow",_ue=_.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,i=ju(r);return h.jsx(e_,{...i,...n,ref:t})});_ue.displayName=Sue;function X4(e){return e?"open":"closed"}var jue=z4,Oue=W4,Eue=H4,Pue=V4;function Y4({...e}){return h.jsx(jue,{"data-slot":"popover",...e})}function Q4({...e}){return h.jsx(Oue,{"data-slot":"popover-trigger",...e})}function Z4({className:e,align:t="center",sideOffset:r=4,...n}){return h.jsx(Eue,{children:h.jsx(Pue,{"data-slot":"popover-content",align:t,sideOffset:r,className:Te("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...n})})}function J4({className:e,...t}){return h.jsx("nav",{role:"navigation","aria-label":"pagination","data-slot":"pagination",className:Te("mx-auto flex w-full justify-center",e),...t})}function e5({className:e,...t}){return h.jsx("ul",{"data-slot":"pagination-content",className:Te("flex flex-row items-center gap-1",e),...t})}function cs({...e}){return h.jsx("li",{"data-slot":"pagination-item",...e})}function ym({className:e,isActive:t,size:r="icon",...n}){return h.jsx("a",{"aria-current":t?"page":void 0,"data-slot":"pagination-link","data-active":t,className:Te(kM({variant:t?"outline":"ghost",size:r}),e),...n})}function t5({className:e,...t}){return h.jsxs(ym,{"aria-label":"Go to previous page",size:"default",className:Te("gap-1 px-2.5 sm:pl-2.5",e),...t,children:[h.jsx(QR,{}),h.jsx("span",{className:"hidden sm:block",children:"Previous"})]})}function r5({className:e,...t}){return h.jsxs(ym,{"aria-label":"Go to next page",size:"default",className:Te("gap-1 px-2.5 sm:pr-2.5",e),...t,children:[h.jsx("span",{className:"hidden sm:block",children:"Next"}),h.jsx(bc,{})]})}class Aue extends Error{status;payload;constructor(t,r,n){super(t),this.name="ApiError",this.status=r,this.payload=n}}function Cue(e,t){if(!e)return t;const r=e.endsWith("/")?e.slice(0,-1):e,n=t.startsWith("/")?t:`/${t}`;return`${r}${n}`}function Nue(e){const t=new URLSearchParams;for(const[n,i]of Object.entries(e))if(!(i==null||i==="")){if(typeof i=="boolean"){t.set(n,i?"true":"false");continue}t.set(n,String(i))}const r=t.toString();return r?`?${r}`:""}function Tue(e){const r=e?.error?.message?.trim();return r||null}function WR(e){if(!e||typeof e!="object")return e;const t=e,r="TotalCount"in t||"Items"in t,n="totalCount"in t||"items"in t;return r&&!n?{...t,totalCount:t.TotalCount,items:t.Items}:e}function n5(e={}){const t=e.baseUrl??"http://192.168.31.88:19001"??"http://localhost:19001",r=e.getToken;async function n(i){const o=i.prefix??"/api/app",s=Cue(t,`${o}${i.path}${Nue(i.query??{})}`),u={"Content-Type":"application/json"},f=r?.();f&&(u.Authorization=`Bearer ${f}`);const l=await fetch(s,{method:i.method,headers:u,body:i.body===void 0?void 0:JSON.stringify(i.body),signal:i.signal}),m=(l.headers.get("content-type")??"").includes("application/json")?await l.json().catch(()=>null):await l.text().catch(()=>"");if(!l.ok){const b=Tue(m)??(typeof m=="string"&&m.trim()?m:"Request failed.");throw new Aue(b,l.status,m)}return m&&typeof m=="object"&&"data"in m?WR(m.data??null):WR(m)}return{requestJson:n}}const xm=n5({getToken:()=>{try{return localStorage.getItem("access_token")??localStorage.getItem("token")??null}catch{return null}}});async function kue(e,t){return xm.requestJson({path:"/location",method:"GET",query:{SkipCount:e.skipCount,MaxResultCount:e.maxResultCount,Sorting:e.sorting,Keyword:e.keyword,Partner:e.partner,GroupName:e.groupName,State:e.state},signal:t})}async function Rue(e){return xm.requestJson({path:"/location",method:"POST",body:{partner:e.partner,groupName:e.groupName,locationCode:e.locationCode,locationName:e.locationName,street:e.street,city:e.city,stateCode:e.stateCode,country:e.country,zipCode:e.zipCode,phone:e.phone,email:e.email,latitude:e.latitude,longitude:e.longitude,state:e.state??!0}})}async function Mue(e,t){return xm.requestJson({path:`/location/${encodeURIComponent(e)}`,method:"PUT",body:{partner:t.partner,groupName:t.groupName,locationCode:t.locationCode,locationName:t.locationName,street:t.street,city:t.city,stateCode:t.stateCode,country:t.country,zipCode:t.zipCode,phone:t.phone,email:t.email,latitude:t.latitude,longitude:t.longitude,state:t.state??!0}})}async function Iue(e){await xm.requestJson({path:`/location/${encodeURIComponent(e)}`,method:"DELETE"})}function _n(e){const t=(e??"").trim();return t||"N/A"}function Due(e,t){return e==null||t===null||t===void 0||!Number.isFinite(e)||!Number.isFinite(t)?"N/A":`${e}, ${t}`}function Lue(){const[e,t]=_.useState(!1),[r,n]=_.useState(!1),[i,o]=_.useState(!1),[s,u]=_.useState(null),[f,l]=_.useState(null),[d,p]=_.useState([]),[m,g]=_.useState(!1),[b,y]=_.useState(0),[w,j]=_.useState(0),[O,E]=_.useState(null),[N,A]=_.useState(""),[C,T]=_.useState("all"),[R,I]=_.useState("all"),[z,$]=_.useState("all"),[L,U]=_.useState(1),[W,V]=_.useState(10),G=_.useRef(null),Y=_.useRef(null),[D,Q]=_.useState("");_.useEffect(()=>(Y.current&&window.clearTimeout(Y.current),Y.current=window.setTimeout(()=>Q(N.trim()),300),()=>{Y.current&&window.clearTimeout(Y.current)}),[N]);const J=_.useMemo(()=>{const X=new Set;for(const ue of d){const ie=(ue.partner??"").trim();ie&&X.add(ie)}return["all",...Array.from(X).sort((ue,ie)=>ue.localeCompare(ie))]},[d]),M=_.useMemo(()=>{const X=new Set;for(const ue of d){const ie=(ue.groupName??"").trim();ie&&X.add(ie)}return["all",...Array.from(X).sort((ue,ie)=>ue.localeCompare(ie))]},[d]),B=_.useMemo(()=>{const X=new Set;for(const ue of d){const ie=(ue.locationCode??"").trim();ie&&X.add(ie)}return["all",...Array.from(X).sort((ue,ie)=>ue.localeCompare(ie))]},[d]),Z=Math.max(1,Math.ceil(b/W));_.useEffect(()=>{U(1)},[D,C,R,z,W]),_.useEffect(()=>((async()=>{G.current?.abort();const ue=new AbortController;G.current=ue,g(!0);try{const ie=Math.max(1,L),ye=await kue({skipCount:ie,maxResultCount:W,keyword:(z!=="all"?z:D)||void 0,partner:C!=="all"?C:void 0,groupName:R!=="all"?R:void 0},ue.signal);p(ye.items??[]),y(ye.totalCount??0)}catch(ie){if(ie?.name==="AbortError")return;Jt.error("Failed to load locations.",{description:ie?.message?String(ie.message):"Please try again."}),p([]),y(0)}finally{g(!1)}})(),()=>G.current?.abort()),[D,C,R,z,L,W,w]);const te=()=>j(X=>X+1),ve=X=>{E(null),u(X),n(!0)},xe=X=>{E(null),l(X),o(!0)};return h.jsxs("div",{className:"h-full flex flex-col",children:[h.jsx("div",{className:"pb-4",children:h.jsx("div",{className:"flex flex-col gap-4",children:h.jsxs("div",{className:"flex flex-nowrap items-center gap-3",children:[h.jsx(be,{placeholder:"Search",value:N,onChange:X=>A(X.target.value),style:{height:40,boxSizing:"border-box"},className:"border border-gray-300 rounded-md w-40 shrink-0 bg-white placeholder:text-gray-500"}),h.jsxs(Ze,{value:C,onValueChange:T,children:[h.jsx(et,{className:"w-[140px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:h.jsx(Je,{placeholder:"Partner"})}),h.jsx(nt,{children:J.map(X=>h.jsx(Ae,{value:X,children:X==="all"?"Partner (All)":X},X))})]}),h.jsxs(Ze,{value:R,onValueChange:I,children:[h.jsx(et,{className:"w-[140px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:h.jsx(Je,{placeholder:"Group"})}),h.jsx(nt,{children:M.map(X=>h.jsx(Ae,{value:X,children:X==="all"?"Group (All)":X},X))})]}),h.jsxs(Ze,{value:z,onValueChange:$,children:[h.jsx(et,{className:"w-[140px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:h.jsx(Je,{placeholder:"Location"})}),h.jsx(nt,{children:B.map(X=>h.jsx(Ae,{value:X,children:X==="all"?"All Locations":X},X))})]}),h.jsx("div",{className:"flex-1"}),h.jsxs(Db,{children:[h.jsx(Lb,{asChild:!0,children:h.jsx("span",{children:h.jsx(we,{disabled:!0,variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 px-4 bg-white hover:bg-gray-50 shrink-0",children:"Bulk Import"})})}),h.jsx($b,{children:"Not supported yet"})]}),h.jsxs(Db,{children:[h.jsx(Lb,{asChild:!0,children:h.jsx("span",{children:h.jsx(we,{disabled:!0,variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 px-4 bg-white hover:bg-gray-50 shrink-0",children:"Bulk Export"})})}),h.jsx($b,{children:"Not supported yet"})]}),h.jsxs(Db,{children:[h.jsx(Lb,{asChild:!0,children:h.jsx("span",{children:h.jsx(we,{disabled:!0,variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 px-4 bg-white hover:bg-gray-50 shrink-0",children:"Bulk Edit"})})}),h.jsx($b,{children:"Not supported yet"})]}),h.jsx(we,{className:"h-10 bg-blue-600 hover:bg-blue-700 text-white rounded-md px-6 font-medium shrink-0",onClick:()=>t(!0),children:"New"})]})})}),h.jsx("div",{className:"flex-1 overflow-auto pt-6",children:h.jsx("div",{className:"bg-white border border-gray-200 shadow-sm rounded-md overflow-hidden",children:h.jsxs(hr,{children:[h.jsx(pr,{children:h.jsxs(Ke,{className:"bg-gray-100 hover:bg-gray-100",children:[h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Partner"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Group"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Location ID"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Location Name"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Street"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"City"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"State"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Country"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Zip Code"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Phone"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Email"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"GPS"}),h.jsx(me,{className:"text-gray-900 font-bold border-r",children:"Active"}),h.jsx(me,{className:"text-gray-900 font-bold text-center",children:"Actions"})]})}),h.jsx(mr,{children:m?h.jsx(Ke,{children:h.jsx(se,{colSpan:14,className:"text-center text-sm text-gray-500 py-10",children:"Loading..."})}):d.length===0?h.jsx(Ke,{children:h.jsx(se,{colSpan:14,className:"text-center text-sm text-gray-500 py-10",children:"No results."})}):d.map(X=>h.jsxs(Ke,{children:[h.jsx(se,{className:"border-r text-gray-600 max-w-[140px] truncate",children:_n(X.partner)}),h.jsx(se,{className:"border-r text-gray-600 max-w-[140px] truncate",children:_n(X.groupName)}),h.jsx(se,{className:"border-r font-numeric text-gray-600",children:_n(X.locationCode??X.id)}),h.jsx(se,{className:"border-r font-medium text-black",children:_n(X.locationName)}),h.jsx(se,{className:"border-r text-gray-600 max-w-[140px] truncate",children:_n(X.street)}),h.jsx(se,{className:"border-r text-gray-600",children:_n(X.city)}),h.jsx(se,{className:"border-r text-gray-600",children:_n(X.stateCode)}),h.jsx(se,{className:"border-r text-gray-600",children:_n(X.country)}),h.jsx(se,{className:"border-r text-gray-600 font-numeric",children:_n(X.zipCode)}),h.jsx(se,{className:"border-r text-gray-600 whitespace-nowrap",children:_n(X.phone)}),h.jsx(se,{className:"border-r text-gray-600 text-sm max-w-[180px] truncate",children:_n(X.email)}),h.jsx(se,{className:"border-r text-gray-500 font-numeric text-xs",children:Due(X.latitude,X.longitude)}),h.jsx(se,{className:"border-r",children:h.jsx(Cn,{className:X.state?"bg-green-600":"bg-gray-400",children:X.state?"Yes":"No"})}),h.jsx(se,{className:"text-center",children:h.jsxs(Y4,{open:O===X.id,onOpenChange:ue=>E(ue?X.id:null),children:[h.jsx(Q4,{asChild:!0,children:h.jsx(we,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":"Row actions",children:h.jsx(Aw,{className:"h-4 w-4 text-gray-500"})})}),h.jsxs(Z4,{align:"end",className:"w-40 p-1",children:[h.jsxs(we,{type:"button",variant:"ghost",className:"w-full justify-start gap-2 h-9 px-2 font-normal",onClick:()=>ve(X),children:[h.jsx(ro,{className:"w-4 h-4"}),"Edit"]}),h.jsx(we,{type:"button",variant:"ghost",className:"w-full justify-start h-9 px-2 font-normal text-red-600 hover:text-red-700 hover:bg-red-50",onClick:()=>xe(X),children:"Delete"})]})]})})]},X.id))})]})})}),h.jsx("div",{className:"pt-4",children:h.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-600",children:[h.jsxs("div",{children:["Showing ",b===0?0:(L-1)*W+1,"-",Math.min(L*W,b)," of ",b]}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsxs(Ze,{value:String(W),onValueChange:X=>V(Number(X)),children:[h.jsx(et,{className:"w-[110px] h-9 rounded-md border border-gray-300 bg-white text-gray-900",children:h.jsx(Je,{})}),h.jsx(nt,{children:[10,20,50].map(X=>h.jsxs(Ae,{value:String(X),children:[X," / page"]},X))})]}),h.jsx(J4,{className:"mx-0 w-auto justify-end",children:h.jsxs(e5,{children:[h.jsx(cs,{children:h.jsx(t5,{href:"#",size:"default",onClick:X=>{X.preventDefault(),U(ue=>Math.max(1,ue-1))},"aria-disabled":L<=1,className:L<=1?"pointer-events-none opacity-50":""})}),h.jsx(cs,{children:h.jsxs(ym,{href:"#",isActive:!0,size:"default",onClick:X=>X.preventDefault(),children:["Page ",L," / ",Z]})}),h.jsx(cs,{children:h.jsx(r5,{href:"#",size:"default",onClick:X=>{X.preventDefault(),U(ue=>Math.min(Z,ue+1))},"aria-disabled":L>=Z,className:L>=Z?"pointer-events-none opacity-50":""})})]})})]})]})}),h.jsx($ue,{open:e,onOpenChange:t,onCreated:()=>{U(1),te()}}),h.jsx(Fue,{open:r,location:s,onOpenChange:X=>{n(X),X||u(null)},onUpdated:()=>{te()}}),h.jsx(zue,{open:i,location:f,onOpenChange:X=>{o(X),X||l(null)},onDeleted:()=>{te()}})]})}function $ue({open:e,onOpenChange:t,onCreated:r}){const[n,i]=_.useState(!1),[o,s]=_.useState({partner:"",groupName:"",locationCode:"",locationName:"",street:"",city:"",stateCode:"",country:"",zipCode:"",phone:"",email:"",latitude:null,longitude:null,state:!0}),u=()=>{s({partner:"",groupName:"",locationCode:"",locationName:"",street:"",city:"",stateCode:"",country:"",zipCode:"",phone:"",email:"",latitude:null,longitude:null,state:!0})};_.useEffect(()=>{e||(u(),i(!1))},[e]);const f=_.useMemo(()=>o.locationCode.trim().length>0&&o.locationName.trim().length>0,[o.locationCode,o.locationName]),l=async()=>{if(!f){Jt.error("Please fill in required fields.",{description:"Location ID and Location Name are required."});return}i(!0);try{await Rue({...o,locationCode:o.locationCode.trim(),locationName:o.locationName.trim(),partner:o.partner?.trim()?o.partner.trim():null,groupName:o.groupName?.trim()?o.groupName.trim():null,street:o.street?.trim()?o.street.trim():null,city:o.city?.trim()?o.city.trim():null,stateCode:o.stateCode?.trim()?o.stateCode.trim():null,country:o.country?.trim()?o.country.trim():null,zipCode:o.zipCode?.trim()?o.zipCode.trim():null,phone:o.phone?.trim()?o.phone.trim():null,email:o.email?.trim()?o.email.trim():null}),Jt.success("Location created.",{description:"The location has been added successfully."}),t(!1),r()}catch(d){Jt.error("Failed to create location.",{description:d?.message?String(d.message):"Please try again."})}finally{i(!1)}};return h.jsx(un,{open:e,onOpenChange:t,children:h.jsxs(fn,{className:"sm:max-w-[600px]",children:[h.jsxs(dn,{children:[h.jsx(hn,{children:"Add New Location"}),h.jsx(ki,{children:"Enter the details for the new store location."})]}),h.jsxs("div",{className:"grid gap-4 py-4",children:[h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Partner"}),h.jsx(be,{placeholder:"e.g. Global Foods Inc.",value:o.partner??"",onChange:d=>s(p=>({...p,partner:d.target.value}))})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Group"}),h.jsx(be,{placeholder:"e.g. East Coast Region",value:o.groupName??"",onChange:d=>s(p=>({...p,groupName:d.target.value}))})]})]}),h.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[h.jsxs("div",{className:"space-y-2 col-span-1",children:[h.jsx(he,{children:"Location ID"}),h.jsx(be,{placeholder:"e.g. 12345",value:o.locationCode,onChange:d=>s(p=>({...p,locationCode:d.target.value}))})]}),h.jsxs("div",{className:"space-y-2 col-span-2",children:[h.jsx(he,{children:"Location Name"}),h.jsx(be,{placeholder:"e.g. Downtown Store",value:o.locationName,onChange:d=>s(p=>({...p,locationName:d.target.value}))})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Street"}),h.jsx(be,{placeholder:"e.g. 123 Main St",value:o.street??"",onChange:d=>s(p=>({...p,street:d.target.value}))})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"City"}),h.jsx(be,{placeholder:"e.g. New York",value:o.city??"",onChange:d=>s(p=>({...p,city:d.target.value}))})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"State"}),h.jsx(be,{placeholder:"e.g. NY",value:o.stateCode??"",onChange:d=>s(p=>({...p,stateCode:d.target.value}))})]})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Country"}),h.jsx(be,{placeholder:"e.g. USA",value:o.country??"",onChange:d=>s(p=>({...p,country:d.target.value}))})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Zip Code"}),h.jsx(be,{placeholder:"e.g. 10001",value:o.zipCode??"",onChange:d=>s(p=>({...p,zipCode:d.target.value}))})]})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Phone Number"}),h.jsx(be,{placeholder:"+1 (555) 000-0000",value:o.phone??"",onChange:d=>s(p=>({...p,phone:d.target.value}))})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Email"}),h.jsx(be,{placeholder:"store@example.com",value:o.email??"",onChange:d=>s(p=>({...p,email:d.target.value}))})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsxs(he,{className:"flex items-center gap-2",children:[h.jsx(Fs,{className:"w-4 h-4"})," GPS Coordinates"]}),h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsx(be,{placeholder:"Latitude (e.g. 40.7128)",value:o.latitude===null||o.latitude===void 0?"":String(o.latitude),onChange:d=>{const p=d.target.value.trim();s(m=>({...m,latitude:p?Number(p):null}))}}),h.jsx(be,{placeholder:"Longitude (e.g. -74.0060)",value:o.longitude===null||o.longitude===void 0?"":String(o.longitude),onChange:d=>{const p=d.target.value.trim();s(m=>({...m,longitude:p?Number(p):null}))}})]})]}),h.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[h.jsx(kn,{id:"loc-status",checked:!!o.state,onCheckedChange:d=>s(p=>({...p,state:d}))}),h.jsx(he,{htmlFor:"loc-status",children:"Active Location"})]})]}),h.jsxs($n,{children:[h.jsx(we,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),h.jsx(we,{disabled:n,onClick:l,className:"bg-blue-600 text-white hover:bg-blue-700",children:n?"Creating...":"Create Location"})]})]})})}function Bue(e){return{partner:e.partner??"",groupName:e.groupName??"",locationCode:e.locationCode??"",locationName:e.locationName??"",street:e.street??"",city:e.city??"",stateCode:e.stateCode??"",country:e.country??"",zipCode:e.zipCode??"",phone:e.phone??"",email:e.email??"",latitude:e.latitude??null,longitude:e.longitude??null,state:!!e.state}}function Fue({open:e,location:t,onOpenChange:r,onUpdated:n}){const[i,o]=_.useState(!1),[s,u]=_.useState({partner:"",groupName:"",locationCode:"",locationName:"",street:"",city:"",stateCode:"",country:"",zipCode:"",phone:"",email:"",latitude:null,longitude:null,state:!0});_.useEffect(()=>{e&&t&&(u(Bue(t)),o(!1)),e||o(!1)},[e,t]);const f=_.useMemo(()=>s.locationCode.trim().length>0&&s.locationName.trim().length>0,[s.locationCode,s.locationName]),l=async()=>{if(t?.id){if(!f){Jt.error("Please fill in required fields.",{description:"Location ID and Location Name are required."});return}o(!0);try{await Mue(t.id,{...s,locationCode:s.locationCode.trim(),locationName:s.locationName.trim(),partner:s.partner?.trim()?s.partner.trim():null,groupName:s.groupName?.trim()?s.groupName.trim():null,street:s.street?.trim()?s.street.trim():null,city:s.city?.trim()?s.city.trim():null,stateCode:s.stateCode?.trim()?s.stateCode.trim():null,country:s.country?.trim()?s.country.trim():null,zipCode:s.zipCode?.trim()?s.zipCode.trim():null,phone:s.phone?.trim()?s.phone.trim():null,email:s.email?.trim()?s.email.trim():null}),Jt.success("Location updated.",{description:"The changes have been saved successfully."}),r(!1),n()}catch(d){Jt.error("Failed to update location.",{description:d?.message?String(d.message):"Please try again."})}finally{o(!1)}}};return h.jsx(un,{open:e,onOpenChange:r,children:h.jsxs(fn,{className:"sm:max-w-[600px]",children:[h.jsxs(dn,{children:[h.jsx(hn,{children:"Edit Location"}),h.jsx(ki,{children:"Update the details for this store location."})]}),h.jsxs("div",{className:"grid gap-4 py-4",children:[h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Partner"}),h.jsx(be,{placeholder:"e.g. Global Foods Inc.",value:s.partner??"",onChange:d=>u(p=>({...p,partner:d.target.value}))})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Group"}),h.jsx(be,{placeholder:"e.g. East Coast Region",value:s.groupName??"",onChange:d=>u(p=>({...p,groupName:d.target.value}))})]})]}),h.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[h.jsxs("div",{className:"space-y-2 col-span-1",children:[h.jsx(he,{children:"Location ID"}),h.jsx(be,{placeholder:"e.g. 12345",value:s.locationCode,onChange:d=>u(p=>({...p,locationCode:d.target.value}))})]}),h.jsxs("div",{className:"space-y-2 col-span-2",children:[h.jsx(he,{children:"Location Name"}),h.jsx(be,{placeholder:"e.g. Downtown Store",value:s.locationName,onChange:d=>u(p=>({...p,locationName:d.target.value}))})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Street"}),h.jsx(be,{placeholder:"e.g. 123 Main St",value:s.street??"",onChange:d=>u(p=>({...p,street:d.target.value}))})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"City"}),h.jsx(be,{placeholder:"e.g. New York",value:s.city??"",onChange:d=>u(p=>({...p,city:d.target.value}))})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"State"}),h.jsx(be,{placeholder:"e.g. NY",value:s.stateCode??"",onChange:d=>u(p=>({...p,stateCode:d.target.value}))})]})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Country"}),h.jsx(be,{placeholder:"e.g. USA",value:s.country??"",onChange:d=>u(p=>({...p,country:d.target.value}))})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Zip Code"}),h.jsx(be,{placeholder:"e.g. 10001",value:s.zipCode??"",onChange:d=>u(p=>({...p,zipCode:d.target.value}))})]})]}),h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Phone Number"}),h.jsx(be,{placeholder:"+1 (555) 000-0000",value:s.phone??"",onChange:d=>u(p=>({...p,phone:d.target.value}))})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Email"}),h.jsx(be,{placeholder:"store@example.com",value:s.email??"",onChange:d=>u(p=>({...p,email:d.target.value}))})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsxs(he,{className:"flex items-center gap-2",children:[h.jsx(Fs,{className:"w-4 h-4"})," GPS Coordinates"]}),h.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[h.jsx(be,{placeholder:"Latitude (e.g. 40.7128)",value:s.latitude===null||s.latitude===void 0?"":String(s.latitude),onChange:d=>{const p=d.target.value.trim();u(m=>({...m,latitude:p?Number(p):null}))}}),h.jsx(be,{placeholder:"Longitude (e.g. -74.0060)",value:s.longitude===null||s.longitude===void 0?"":String(s.longitude),onChange:d=>{const p=d.target.value.trim();u(m=>({...m,longitude:p?Number(p):null}))}})]})]}),h.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[h.jsx(kn,{id:"loc-status-edit",checked:!!s.state,onCheckedChange:d=>u(p=>({...p,state:d}))}),h.jsx(he,{htmlFor:"loc-status-edit",children:"Active Location"})]})]}),h.jsxs($n,{children:[h.jsx(we,{variant:"outline",onClick:()=>r(!1),children:"Cancel"}),h.jsx(we,{disabled:i,onClick:l,className:"bg-blue-600 text-white hover:bg-blue-700",children:i?"Saving...":"Save Changes"})]})]})})}function zue({open:e,location:t,onOpenChange:r,onDeleted:n}){const[i,o]=_.useState(!1),s=_.useMemo(()=>{const f=(t?.locationCode??"").trim(),l=(t?.locationName??"").trim();return f&&l?`${f} - ${l}`:f||l||"this location"},[t?.locationCode,t?.locationName]),u=async()=>{if(t?.id){o(!0);try{await Iue(t.id),Jt.success("Location deleted.",{description:"The location has been removed successfully."}),r(!1),n()}catch(f){Jt.error("Failed to delete location.",{description:f?.message?String(f.message):"Please try again."})}finally{o(!1)}}};return h.jsx(un,{open:e,onOpenChange:r,children:h.jsxs(fn,{className:"sm:max-w-none",style:{width:"30%"},children:[h.jsxs(dn,{children:[h.jsx(hn,{children:"Delete Location"}),h.jsx(ki,{children:"This action cannot be undone."})]}),h.jsxs("div",{className:"text-sm text-gray-700",children:["Are you sure you want to delete ",h.jsx("span",{className:"font-medium",children:s}),"?"]}),h.jsxs($n,{className:"flex-row flex-wrap justify-end",children:[h.jsx(we,{className:"min-w-24",variant:"outline",onClick:()=>r(!1),children:"Cancel"}),h.jsx(we,{className:"min-w-24",variant:"destructive",disabled:i,onClick:u,children:i?"Deleting...":"Delete"})]})]})})}function que({className:e,...t}){return h.jsx("textarea",{"data-slot":"textarea",className:Te("resize-none border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-input-background px-3 py-2 text-base transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...t})}const bm=n5({getToken:()=>{try{return localStorage.getItem("access_token")??localStorage.getItem("token")??null}catch{return null}}}),wm="/rbac-menu";async function Uue(e,t){return bm.requestJson({path:wm,method:"GET",query:{SkipCount:e.skipCount,MaxResultCount:e.maxResultCount,Sorting:e.sorting,Keyword:e.keyword}})}async function Wue(e){return bm.requestJson({path:wm,method:"POST",body:e})}async function Hue(e,t){return bm.requestJson({path:`${wm}/${encodeURIComponent(e)}`,method:"PUT",body:t})}async function Vue(e){e.length&&await bm.requestJson({path:wm,method:"DELETE",body:e})}async function Gue(e){await Vue([e])}const HR={Settings:Vd,LayoutDashboard:eM,Tag:Gd,MapPin:Fs,Users:Nw,Package:Hd,FileText:us,HelpCircle:Wd,Layers:JR,Type:up,FileBox:ZR};function Bb(e){const t=(e??"").trim();return t||"N/A"}function Kue(e){const t=e.trim();if(!t)return null;const r=Number.parseInt(t,10);return Number.isFinite(r)?r:null}function Xue(){const[e,t]=_.useState([]),[r,n]=_.useState(!1),[i,o]=_.useState(0),[s,u]=_.useState(0),[f,l]=_.useState(null),[d,p]=_.useState(""),m=_.useRef(null),[g,b]=_.useState(""),[y,w]=_.useState(1),[j,O]=_.useState(10),E=Math.max(1,Math.ceil(i/j)),[N,A]=_.useState(!1),[C,T]=_.useState(!1),[R,I]=_.useState(!1),[z,$]=_.useState(null),[L,U]=_.useState(null),W=_.useRef(null);_.useEffect(()=>(m.current&&window.clearTimeout(m.current),m.current=window.setTimeout(()=>b(d.trim()),300),()=>{m.current&&window.clearTimeout(m.current)}),[d]),_.useEffect(()=>w(1),[g,j]),_.useEffect(()=>((async()=>{W.current?.abort();const Q=new AbortController;W.current=Q,n(!0);try{const J=Math.max(1,y),M=await Uue({skipCount:J,maxResultCount:j,keyword:g||void 0},Q.signal);t(M.items??[]),o(M.totalCount??0)}catch(J){if(J?.name==="AbortError")return;Jt.error("Failed to load system menus.",{description:J?.message?String(J.message):"Please try again."}),t([]),o(0)}finally{n(!1)}})(),()=>W.current?.abort()),[g,y,j,s]);const V=()=>u(D=>D+1),G=D=>{l(null),$(D),T(!0)},Y=D=>{l(null),U(D),I(!0)};return h.jsxs("div",{className:"h-full flex flex-col",children:[h.jsx("div",{className:"pb-4",children:h.jsxs("div",{className:"flex flex-nowrap items-center gap-3",children:[h.jsx(be,{placeholder:"Search",value:d,onChange:D=>p(D.target.value),style:{height:40,boxSizing:"border-box"},className:"border border-gray-300 rounded-md w-40 shrink-0 bg-white placeholder:text-gray-500"}),h.jsx("div",{className:"flex-1"}),h.jsxs(we,{className:"bg-blue-600 text-white hover:bg-blue-700",onClick:()=>A(!0),children:[h.jsx(jr,{className:"w-4 h-4 mr-2"}),"New Menu"]})]})}),h.jsxs("div",{className:"flex-1 flex flex-col min-h-0 bg-white rounded-lg shadow-sm border border-gray-200 overflow-hidden",children:[h.jsx("div",{className:"flex-1 min-h-0 overflow-auto",children:h.jsxs(hr,{children:[h.jsx(pr,{className:"bg-gray-50 sticky top-0 z-10",children:h.jsxs(Ke,{className:"hover:bg-gray-50",children:[h.jsx(me,{className:"font-semibold text-gray-900",children:"Menu Name"}),h.jsx(me,{className:"font-semibold text-gray-900",children:"Route URL"}),h.jsx(me,{className:"font-semibold text-gray-900",children:"Router Name"}),h.jsx(me,{className:"font-semibold text-gray-900",children:"Type"}),h.jsx(me,{className:"font-semibold text-gray-900",children:"Order"}),h.jsx(me,{className:"font-semibold text-gray-900",children:"Visible"}),h.jsx(me,{className:"font-semibold text-gray-900",children:"Enabled"}),h.jsx(me,{className:"font-semibold text-gray-900 w-16 text-right",children:"Actions"})]})}),h.jsx(mr,{children:e.length===0?h.jsx(Ke,{children:h.jsx(se,{colSpan:8,className:"text-center py-10 text-gray-500",children:r?"Loading...":"No data"})}):e.map(D=>h.jsxs(Ke,{className:"hover:bg-gray-50",children:[h.jsx(se,{className:"font-medium text-gray-900",children:Bb(D.menuName)}),h.jsx(se,{className:"text-gray-700",children:Bb(D.routeUrl)}),h.jsx(se,{className:"text-gray-700",children:Bb(D.routerName)}),h.jsx(se,{className:"text-gray-700",children:D.menuType??"N/A"}),h.jsx(se,{className:"text-gray-700",children:D.orderNum??"N/A"}),h.jsx(se,{className:"text-gray-700",children:D.isShow?"Yes":"No"}),h.jsx(se,{className:"text-gray-700",children:D.state?"Yes":"No"}),h.jsx(se,{className:"text-right",children:h.jsxs(Y4,{open:f===D.id,onOpenChange:Q=>l(Q?D.id:null),children:[h.jsx(Q4,{asChild:!0,children:h.jsx(we,{variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":"Row actions",children:h.jsx(Aw,{className:"h-4 w-4"})})}),h.jsx(Z4,{className:"w-44 p-2",align:"end",children:h.jsxs("div",{className:"flex flex-col",children:[h.jsxs(we,{variant:"ghost",className:"justify-start",onClick:()=>G(D),children:[h.jsx(ro,{className:"w-4 h-4 mr-2"}),"Edit"]}),h.jsxs(we,{variant:"ghost",className:"justify-start text-red-600 hover:text-red-700",onClick:()=>Y(D),children:[h.jsx(Fb,{className:"w-4 h-4 mr-2"}),"Delete"]})]})})]})})]},D.id))})]})}),h.jsxs("div",{className:"shrink-0 px-4 py-3 border-t border-gray-200 bg-white flex flex-wrap items-center justify-between gap-3",children:[h.jsxs("div",{className:"text-sm text-gray-600",children:["Showing ",i===0?0:(y-1)*j+1,"-",Math.min(y*j,i)," of"," ",i]}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsxs(Ze,{value:String(j),onValueChange:D=>O(Number(D)),children:[h.jsx(et,{className:"w-[110px] h-9 rounded-md border border-gray-300 bg-white text-gray-900",children:h.jsx(Je,{})}),h.jsx(nt,{children:[10,20,50].map(D=>h.jsxs(Ae,{value:String(D),children:[D," / page"]},D))})]}),h.jsx(J4,{className:"mx-0 w-auto justify-end",children:h.jsxs(e5,{children:[h.jsx(cs,{children:h.jsx(t5,{href:"#",size:"default",onClick:D=>{D.preventDefault(),w(Q=>Math.max(1,Q-1))},"aria-disabled":y<=1,className:y<=1?"pointer-events-none opacity-50":""})}),h.jsx(cs,{children:h.jsxs(ym,{href:"#",isActive:!0,size:"default",onClick:D=>D.preventDefault(),children:["Page ",y," / ",E]})}),h.jsx(cs,{children:h.jsx(r5,{href:"#",size:"default",onClick:D=>{D.preventDefault(),w(Q=>Math.min(E,Q+1))},"aria-disabled":y>=E,className:y>=E?"pointer-events-none opacity-50":""})})]})})]})]})]}),h.jsx(VR,{mode:"create",open:N,menu:null,onOpenChange:A,onSaved:V}),h.jsx(VR,{mode:"edit",open:C,menu:z,onOpenChange:T,onSaved:V}),h.jsx(Yue,{open:R,menu:L,onOpenChange:I,onDeleted:V})]})}function VR({mode:e,open:t,menu:r,onOpenChange:n,onSaved:i}){const o=e==="edit",[s,u]=_.useState(!1),[f,l]=_.useState(""),[d,p]=_.useState(""),[m,g]=_.useState(""),[b,y]=_.useState("menu"),[w,j]=_.useState(""),[O,E]=_.useState(""),[N,A]=_.useState(""),[C,T]=_.useState(""),[R,I]=_.useState(""),[z,$]=_.useState(""),[L,U]=_.useState(""),[W,V]=_.useState(""),[G,Y]=_.useState(!1),[D,Q]=_.useState(!0),[J,M]=_.useState(!0);_.useEffect(()=>{t&&(u(!1),l(r?.menuName??""),p(r?.routerName??""),g(r?.routeUrl??""),y(r?.menuType===0?"directory":"menu"),j(r?.permissionCode??""),E(r?.parentId??""),A(r?.menuIcon??""),T(r?.orderNum===null||r?.orderNum===void 0?"":String(r.orderNum)),I(r?.link??""),$(r?.component??""),U(r?.query??""),V(r?.remark??""),Y(!!r?.isCache),Q(r?.isShow??!0),M(r?.state??!0))},[t,r]);const B=_.useMemo(()=>!!(f.trim()&&m.trim()),[f,m]),Z=async()=>{if(!B){Jt.error("Please fill in required fields.",{description:"Menu Name and Route URL are required."});return}u(!0);try{const te={menuName:f.trim(),routerName:d.trim()?d.trim():null,routeUrl:m.trim(),menuType:b==="directory"?0:1,permissionCode:w.trim()?w.trim():null,parentId:O.trim()?O.trim():null,menuIcon:N||null,orderNum:Kue(C),link:R.trim()?R.trim():null,component:z.trim()?z.trim():null,query:L.trim()?L.trim():null,remark:W.trim()?W.trim():null,isCache:G,isShow:D,state:J};if(o){if(!r?.id)throw new Error("Missing id.");await Hue(r.id,te),Jt.success("Menu updated.",{description:"Changes have been saved successfully."})}else await Wue(te),Jt.success("Menu created.",{description:"A new menu has been created successfully."});n(!1),i()}catch(te){Jt.error(o?"Failed to update menu.":"Failed to create menu.",{description:te?.message?String(te.message):"Please try again."})}finally{u(!1)}};return h.jsx(un,{open:t,onOpenChange:n,children:h.jsxs(fn,{className:"sm:max-w-none",style:{width:"70%"},children:[h.jsxs(dn,{children:[h.jsx(hn,{children:o?"Edit System Menu":"New System Menu"}),h.jsx(ki,{children:o?"Update system menu fields and save changes.":"Fill out the form to create a new system menu."})]}),h.jsxs("div",{className:"grid grid-cols-3 gap-6 py-2",children:[h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Menu Name *"}),h.jsx(be,{value:f,onChange:te=>l(te.target.value),placeholder:"e.g. Location Manager"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Route URL *"}),h.jsx(be,{value:m,onChange:te=>g(te.target.value),placeholder:"e.g. /location"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Router Name"}),h.jsx(be,{value:d,onChange:te=>p(te.target.value),placeholder:"e.g. location"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Menu Type"}),h.jsxs(Ze,{value:b,onValueChange:te=>y(te),children:[h.jsx(et,{className:"h-10 rounded-md border border-gray-200 bg-white",children:h.jsx(Je,{})}),h.jsxs(nt,{children:[h.jsx(Ae,{value:"directory",children:"Directory"}),h.jsx(Ae,{value:"menu",children:"Menu"})]})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Permission Code"}),h.jsx(be,{value:w,onChange:te=>j(te.target.value),placeholder:"e.g. sys:menu"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Parent ID"}),h.jsx(be,{value:O,onChange:te=>E(te.target.value),placeholder:"Optional"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Menu Icon"}),h.jsxs(Ze,{value:N||"none",onValueChange:te=>A(te==="none"?"":te),children:[h.jsx(et,{className:"h-10 rounded-md border border-gray-200 bg-white",children:h.jsx(Je,{placeholder:"Select an icon"})}),h.jsxs(nt,{children:[h.jsx(Ae,{value:"none",children:"None"}),Object.keys(HR).map(te=>{const ve=HR[te];return h.jsx(Ae,{value:te,children:h.jsxs("span",{className:"flex items-center gap-2",children:[h.jsx(ve,{className:"h-4 w-4"}),te]})},te)})]})]})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Order"}),h.jsx(be,{value:C,onChange:te=>T(te.target.value),placeholder:"e.g. 10"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Link"}),h.jsx(be,{value:R,onChange:te=>I(te.target.value),placeholder:"Optional"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Component"}),h.jsx(be,{value:z,onChange:te=>$(te.target.value),placeholder:"Optional"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Query"}),h.jsx(be,{value:L,onChange:te=>U(te.target.value),placeholder:"Optional"})]}),h.jsxs("div",{className:"space-y-2",children:[h.jsx(he,{children:"Remark"}),h.jsx(que,{value:W,onChange:te=>V(te.target.value),placeholder:"Optional"})]}),h.jsxs("div",{className:"flex items-center justify-between border border-gray-200 rounded-md px-3 bg-white",style:{height:40},children:[h.jsx("div",{className:"text-sm font-medium text-gray-900",children:"Cache"}),h.jsx(kn,{checked:G,onCheckedChange:Y})]}),h.jsxs("div",{className:"flex items-center justify-between border border-gray-200 rounded-md px-3 bg-white",style:{height:40},children:[h.jsx("div",{className:"text-sm font-medium text-gray-900",children:"Visible"}),h.jsx(kn,{checked:D,onCheckedChange:Q})]}),h.jsxs("div",{className:"flex items-center justify-between border border-gray-200 rounded-md px-3 bg-white",style:{height:40},children:[h.jsx("div",{className:"text-sm font-medium text-gray-900",children:"Enabled"}),h.jsx(kn,{checked:J,onCheckedChange:M})]})]}),h.jsxs($n,{className:"flex-row flex-wrap justify-end",children:[h.jsx(we,{className:"min-w-24",variant:"outline",onClick:()=>n(!1),children:"Cancel"}),h.jsx(we,{className:"min-w-24 bg-blue-600 text-white hover:bg-blue-700",disabled:s,onClick:Z,children:s?"Saving...":o?"Save Changes":"Create"})]})]})})}function Yue({open:e,menu:t,onOpenChange:r,onDeleted:n}){const[i,o]=_.useState(!1),s=_.useMemo(()=>{const f=(t?.menuName??"").trim(),l=(t?.routeUrl??"").trim();return f&&l?`${f} (${l})`:f||l||"this menu"},[t?.menuName,t?.routeUrl]),u=async()=>{if(t?.id){o(!0);try{await Gue(t.id),Jt.success("Menu deleted.",{description:"The menu has been removed successfully."}),r(!1),n()}catch(f){Jt.error("Failed to delete menu.",{description:f?.message?String(f.message):"Please try again."})}finally{o(!1)}}};return h.jsx(un,{open:e,onOpenChange:r,children:h.jsxs(fn,{className:"sm:max-w-none",style:{width:"30%"},children:[h.jsxs(dn,{children:[h.jsx(hn,{children:"Delete System Menu"}),h.jsx(ki,{children:"This action cannot be undone."})]}),h.jsxs("div",{className:"text-sm text-gray-700",children:["Are you sure you want to delete ",h.jsx("span",{className:"font-medium",children:s}),"?"]}),h.jsxs($n,{className:"flex-row flex-wrap justify-end",children:[h.jsx(we,{className:"min-w-24",variant:"outline",onClick:()=>r(!1),children:"Cancel"}),h.jsx(we,{className:"min-w-24",variant:"destructive",disabled:i,onClick:u,children:i?"Deleting...":"Delete"})]})]})})}function Que(){const[e,t]=_.useState("Dashboard"),r=()=>{switch(e){case"Dashboard":return h.jsx(gne,{});case"Training":return h.jsx(zle,{});case"Alerts":return h.jsx(Wle,{});case"Menu Management":return h.jsx(fce,{});case"System Menu":return h.jsx(Xue,{});case"Account Management":return h.jsx(Sce,{});case"Reports":return h.jsx(Lce,{});case"Location Manager":return h.jsx(Lue,{});case"Labels":case"Label Categories":case"Label Types":case"Label Templates":case"Multiple Options":return h.jsx(Fle,{currentView:e,onViewChange:t});default:return h.jsx(yne,{title:e})}};return h.jsx(Nz,{currentView:e,setCurrentView:t,children:r()})}l8.createRoot(document.getElementById("root")).render(h.jsx(Que,{})); diff --git a/美国版/Food Labeling Management Platform/build/assets/index-TU5tblcP.js b/美国版/Food Labeling Management Platform/build/assets/index-TU5tblcP.js new file mode 100644 index 0000000..0bfa58f --- /dev/null +++ b/美国版/Food Labeling Management Platform/build/assets/index-TU5tblcP.js @@ -0,0 +1,458 @@ +function h8(e,t){for(var r=0;rn[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&n(s)}).observe(document,{childList:!0,subtree:!0});function r(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(i){if(i.ep)return;i.ep=!0;const o=r(i);fetch(i.href,o)}})();var Xf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ct(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var jg={exports:{}},Zl={},Og={exports:{}},Xe={};/** + * @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 dE;function p8(){if(dE)return Xe;dE=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),s=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),l=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),p=Symbol.iterator;function m(M){return M===null||typeof M!="object"?null:(M=p&&M[p]||M["@@iterator"],typeof M=="function"?M:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,y={};function w(M,B,ee){this.props=M,this.context=B,this.refs=y,this.updater=ee||g}w.prototype.isReactComponent={},w.prototype.setState=function(M,B){if(typeof M!="object"&&typeof M!="function"&&M!=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,M,B,"setState")},w.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function j(){}j.prototype=w.prototype;function O(M,B,ee){this.props=M,this.context=B,this.refs=y,this.updater=ee||g}var E=O.prototype=new j;E.constructor=O,b(E,w.prototype),E.isPureReactComponent=!0;var A=Array.isArray,N=Object.prototype.hasOwnProperty,C={current:null},T={key:!0,ref:!0,__self:!0,__source:!0};function R(M,B,ee){var ae,ie={},fe=null,K=null;if(B!=null)for(ae in B.ref!==void 0&&(K=B.ref),B.key!==void 0&&(fe=""+B.key),B)N.call(B,ae)&&!T.hasOwnProperty(ae)&&(ie[ae]=B[ae]);var ce=arguments.length-2;if(ce===1)ie.children=ee;else if(1>>1,B=D[M];if(0>>1;Mi(ie,J))fei(K,ie)?(D[M]=K,D[fe]=J,M=fe):(D[M]=ie,D[ae]=J,M=ae);else if(fei(K,J))D[M]=K,D[fe]=J,M=fe;else break e}}return Z}function i(D,Z){var J=D.sortIndex-Z.sortIndex;return J!==0?J:D.id-Z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,u=s.now();e.unstable_now=function(){return s.now()-u}}var f=[],l=[],h=1,p=null,m=3,g=!1,b=!1,y=!1,w=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function E(D){for(var Z=r(l);Z!==null;){if(Z.callback===null)n(l);else if(Z.startTime<=D)n(l),Z.sortIndex=Z.expirationTime,t(f,Z);else break;Z=r(l)}}function A(D){if(y=!1,E(D),!b)if(r(f)!==null)b=!0,H(N);else{var Z=r(l);Z!==null&&V(A,Z.startTime-D)}}function N(D,Z){b=!1,y&&(y=!1,j(R),R=-1),g=!0;var J=m;try{for(E(Z),p=r(f);p!==null&&(!(p.expirationTime>Z)||D&&!L());){var M=p.callback;if(typeof M=="function"){p.callback=null,m=p.priorityLevel;var B=M(p.expirationTime<=Z);Z=e.unstable_now(),typeof B=="function"?p.callback=B:p===r(f)&&n(f),E(Z)}else n(f);p=r(f)}if(p!==null)var ee=!0;else{var ae=r(l);ae!==null&&V(A,ae.startTime-Z),ee=!1}return ee}finally{p=null,m=J,g=!1}}var C=!1,T=null,R=-1,I=5,F=-1;function L(){return!(e.unstable_now()-FD||125M?(D.sortIndex=J,t(l,D),r(f)===null&&D===r(l)&&(y?(j(R),R=-1):y=!0,V(A,J-M))):(D.sortIndex=B,t(f,D),b||g||(b=!0,H(N))),D},e.unstable_shouldYield=L,e.unstable_wrapCallback=function(D){var Z=m;return function(){var J=m;m=Z;try{return D.apply(this,arguments)}finally{m=J}}}})(Ng)),Ng}var gE;function y8(){return gE||(gE=1,Pg.exports=g8()),Pg.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 yE;function x8(){if(yE)return Tr;yE=1;var e=jp(),t=y8();function r(a){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+a,v=1;v"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),f=Object.prototype.hasOwnProperty,l=/^[: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]*$/,h={},p={};function m(a){return f.call(p,a)?!0:f.call(h,a)?!1:l.test(a)?p[a]=!0:(h[a]=!0,!1)}function g(a,c,v,x){if(v!==null&&v.type===0)return!1;switch(typeof c){case"function":case"symbol":return!0;case"boolean":return x?!1:v!==null?!v.acceptsBooleans:(a=a.toLowerCase().slice(0,5),a!=="data-"&&a!=="aria-");default:return!1}}function b(a,c,v,x){if(c===null||typeof c>"u"||g(a,c,v,x))return!0;if(x)return!1;if(v!==null)switch(v.type){case 3:return!c;case 4:return c===!1;case 5:return isNaN(c);case 6:return isNaN(c)||1>c}return!1}function y(a,c,v,x,_,P,k){this.acceptsBooleans=c===2||c===3||c===4,this.attributeName=x,this.attributeNamespace=_,this.mustUseProperty=v,this.propertyName=a,this.type=c,this.sanitizeURL=P,this.removeEmptyString=k}var w={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){w[a]=new y(a,0,!1,a,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var c=a[0];w[c]=new y(c,1,!1,a[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(a){w[a]=new y(a,2,!1,a.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){w[a]=new y(a,2,!1,a,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(a){w[a]=new y(a,3,!1,a.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(a){w[a]=new y(a,3,!0,a,null,!1,!1)}),["capture","download"].forEach(function(a){w[a]=new y(a,4,!1,a,null,!1,!1)}),["cols","rows","size","span"].forEach(function(a){w[a]=new y(a,6,!1,a,null,!1,!1)}),["rowSpan","start"].forEach(function(a){w[a]=new y(a,5,!1,a.toLowerCase(),null,!1,!1)});var j=/[\-:]([a-z])/g;function O(a){return a[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(a){var c=a.replace(j,O);w[c]=new y(c,1,!1,a,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var c=a.replace(j,O);w[c]=new y(c,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(a){var c=a.replace(j,O);w[c]=new y(c,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(a){w[a]=new y(a,1,!1,a.toLowerCase(),null,!1,!1)}),w.xlinkHref=new y("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(a){w[a]=new y(a,1,!1,a.toLowerCase(),null,!0,!0)});function E(a,c,v,x){var _=w.hasOwnProperty(c)?w[c]:null;(_!==null?_.type!==0:x||!(2W||_[k]!==P[W]){var X=` +`+_[k].replace(" at new "," at ");return a.displayName&&X.includes("")&&(X=X.replace("",a.displayName)),X}while(1<=k&&0<=W);break}}}finally{ee=!1,Error.prepareStackTrace=v}return(a=a?a.displayName||a.name:"")?B(a):""}function ie(a){switch(a.tag){case 5:return B(a.type);case 16:return B("Lazy");case 13:return B("Suspense");case 19:return B("SuspenseList");case 0:case 2:case 15:return a=ae(a.type,!1),a;case 11:return a=ae(a.type.render,!1),a;case 1:return a=ae(a.type,!0),a;default:return""}}function fe(a){if(a==null)return null;if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case T:return"Fragment";case C:return"Portal";case I:return"Profiler";case R:return"StrictMode";case U:return"Suspense";case G:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case L:return(a.displayName||"Context")+".Consumer";case F:return(a._context.displayName||"Context")+".Provider";case $:var c=a.render;return a=a.displayName,a||(a=c.displayName||c.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case q:return c=a.displayName||null,c!==null?c:fe(a.type)||"Memo";case H:c=a._payload,a=a._init;try{return fe(a(c))}catch{}}return null}function K(a){var c=a.type;switch(a.tag){case 24:return"Cache";case 9:return(c.displayName||"Context")+".Consumer";case 10:return(c._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=c.render,a=a.displayName||a.name||"",c.displayName||(a!==""?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return fe(c);case 8:return c===R?"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 c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c}return null}function ce(a){switch(typeof a){case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function te(a){var c=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function le(a){var c=te(a)?"checked":"value",v=Object.getOwnPropertyDescriptor(a.constructor.prototype,c),x=""+a[c];if(!a.hasOwnProperty(c)&&typeof v<"u"&&typeof v.get=="function"&&typeof v.set=="function"){var _=v.get,P=v.set;return Object.defineProperty(a,c,{configurable:!0,get:function(){return _.call(this)},set:function(k){x=""+k,P.call(this,k)}}),Object.defineProperty(a,c,{enumerable:v.enumerable}),{getValue:function(){return x},setValue:function(k){x=""+k},stopTracking:function(){a._valueTracker=null,delete a[c]}}}}function ge(a){a._valueTracker||(a._valueTracker=le(a))}function Y(a){if(!a)return!1;var c=a._valueTracker;if(!c)return!0;var v=c.getValue(),x="";return a&&(x=te(a)?a.checked?"true":"false":a.value),a=x,a!==v?(c.setValue(a),!0):!1}function _e(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}function Oe(a,c){var v=c.checked;return J({},c,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:v??a._wrapperState.initialChecked})}function Ve(a,c){var v=c.defaultValue==null?"":c.defaultValue,x=c.checked!=null?c.checked:c.defaultChecked;v=ce(c.value!=null?c.value:v),a._wrapperState={initialChecked:x,initialValue:v,controlled:c.type==="checkbox"||c.type==="radio"?c.checked!=null:c.value!=null}}function nt(a,c){c=c.checked,c!=null&&E(a,"checked",c,!1)}function lt(a,c){nt(a,c);var v=ce(c.value),x=c.type;if(v!=null)x==="number"?(v===0&&a.value===""||a.value!=v)&&(a.value=""+v):a.value!==""+v&&(a.value=""+v);else if(x==="submit"||x==="reset"){a.removeAttribute("value");return}c.hasOwnProperty("value")?ir(a,c.type,v):c.hasOwnProperty("defaultValue")&&ir(a,c.type,ce(c.defaultValue)),c.checked==null&&c.defaultChecked!=null&&(a.defaultChecked=!!c.defaultChecked)}function nr(a,c,v){if(c.hasOwnProperty("value")||c.hasOwnProperty("defaultValue")){var x=c.type;if(!(x!=="submit"&&x!=="reset"||c.value!==void 0&&c.value!==null))return;c=""+a._wrapperState.initialValue,v||c===a.value||(a.value=c),a.defaultValue=c}v=a.name,v!==""&&(a.name=""),a.defaultChecked=!!a._wrapperState.initialChecked,v!==""&&(a.name=v)}function ir(a,c,v){(c!=="number"||_e(a.ownerDocument)!==a)&&(v==null?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+v&&(a.defaultValue=""+v))}var hr=Array.isArray;function Rt(a,c,v,x){if(a=a.options,c){c={};for(var _=0;_"+c.valueOf().toString()+"",c=wa.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;c.firstChild;)a.appendChild(c.firstChild)}});function jo(a,c){if(c){var v=a.firstChild;if(v&&v===a.lastChild&&v.nodeType===3){v.nodeValue=c;return}}a.textContent=c}var ci={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},Lm=["Webkit","ms","Moz","O"];Object.keys(ci).forEach(function(a){Lm.forEach(function(c){c=c+a.charAt(0).toUpperCase()+a.substring(1),ci[c]=ci[a]})});function Bu(a,c,v){return c==null||typeof c=="boolean"||c===""?"":v||typeof c!="number"||c===0||ci.hasOwnProperty(a)&&ci[a]?(""+c).trim():c+"px"}function Fu(a,c){a=a.style;for(var v in c)if(c.hasOwnProperty(v)){var x=v.indexOf("--")===0,_=Bu(v,c[v],x);v==="float"&&(v="cssFloat"),x?a.setProperty(v,_):a[v]=_}}var $m=J({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 ve(a,c){if(c){if($m[a]&&(c.children!=null||c.dangerouslySetInnerHTML!=null))throw Error(r(137,a));if(c.dangerouslySetInnerHTML!=null){if(c.children!=null)throw Error(r(60));if(typeof c.dangerouslySetInnerHTML!="object"||!("__html"in c.dangerouslySetInnerHTML))throw Error(r(61))}if(c.style!=null&&typeof c.style!="object")throw Error(r(62))}}function dt(a,c){if(a.indexOf("-")===-1)return typeof c.is=="string";switch(a){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 Jt=null;function Bm(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var Fm=null,Sa=null,_a=null;function A_(a){if(a=Ll(a)){if(typeof Fm!="function")throw Error(r(280));var c=a.stateNode;c&&(c=uf(c),Fm(a.stateNode,a.type,c))}}function C_(a){Sa?_a?_a.push(a):_a=[a]:Sa=a}function T_(){if(Sa){var a=Sa,c=_a;if(_a=Sa=null,A_(a),c)for(a=0;a>>=0,a===0?32:31-(A5(a)/C5|0)|0}var Hu=64,Vu=4194304;function xl(a){switch(a&-a){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 a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return a}}function Gu(a,c){var v=a.pendingLanes;if(v===0)return 0;var x=0,_=a.suspendedLanes,P=a.pingedLanes,k=v&268435455;if(k!==0){var W=k&~_;W!==0?x=xl(W):(P&=k,P!==0&&(x=xl(P)))}else k=v&~_,k!==0?x=xl(k):P!==0&&(x=xl(P));if(x===0)return 0;if(c!==0&&c!==x&&(c&_)===0&&(_=x&-x,P=c&-c,_>=P||_===16&&(P&4194240)!==0))return c;if((x&4)!==0&&(x|=v&16),c=a.entangledLanes,c!==0)for(a=a.entanglements,c&=x;0v;v++)c.push(a);return c}function bl(a,c,v){a.pendingLanes|=c,c!==536870912&&(a.suspendedLanes=0,a.pingedLanes=0),a=a.eventTimes,c=31-bn(c),a[c]=v}function M5(a,c){var v=a.pendingLanes&~c;a.pendingLanes=c,a.suspendedLanes=0,a.pingedLanes=0,a.expiredLanes&=c,a.mutableReadLanes&=c,a.entangledLanes&=c,c=a.entanglements;var x=a.eventTimes;for(a=a.expirationTimes;0=Nl),oj=" ",aj=!1;function sj(a,c){switch(a){case"keyup":return lB.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function lj(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Ea=!1;function uB(a,c){switch(a){case"compositionend":return lj(c);case"keypress":return c.which!==32?null:(aj=!0,oj);case"textInput":return a=c.data,a===oj&&aj?null:a;default:return null}}function fB(a,c){if(Ea)return a==="compositionend"||!iv&&sj(a,c)?(a=J_(),Zu=Zm=Wi=null,Ea=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1=c)return{node:v,offset:c-a};a=x}e:{for(;v;){if(v.nextSibling){v=v.nextSibling;break e}v=v.parentNode}v=void 0}v=mj(v)}}function gj(a,c){return a&&c?a===c?!0:a&&a.nodeType===3?!1:c&&c.nodeType===3?gj(a,c.parentNode):"contains"in a?a.contains(c):a.compareDocumentPosition?!!(a.compareDocumentPosition(c)&16):!1:!1}function yj(){for(var a=window,c=_e();c instanceof a.HTMLIFrameElement;){try{var v=typeof c.contentWindow.location.href=="string"}catch{v=!1}if(v)a=c.contentWindow;else break;c=_e(a.document)}return c}function sv(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c&&(c==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||c==="textarea"||a.contentEditable==="true")}function bB(a){var c=yj(),v=a.focusedElem,x=a.selectionRange;if(c!==v&&v&&v.ownerDocument&&gj(v.ownerDocument.documentElement,v)){if(x!==null&&sv(v)){if(c=x.start,a=x.end,a===void 0&&(a=c),"selectionStart"in v)v.selectionStart=c,v.selectionEnd=Math.min(a,v.value.length);else if(a=(c=v.ownerDocument||document)&&c.defaultView||window,a.getSelection){a=a.getSelection();var _=v.textContent.length,P=Math.min(x.start,_);x=x.end===void 0?P:Math.min(x.end,_),!a.extend&&P>x&&(_=x,x=P,P=_),_=vj(v,P);var k=vj(v,x);_&&k&&(a.rangeCount!==1||a.anchorNode!==_.node||a.anchorOffset!==_.offset||a.focusNode!==k.node||a.focusOffset!==k.offset)&&(c=c.createRange(),c.setStart(_.node,_.offset),a.removeAllRanges(),P>x?(a.addRange(c),a.extend(k.node,k.offset)):(c.setEnd(k.node,k.offset),a.addRange(c)))}}for(c=[],a=v;a=a.parentNode;)a.nodeType===1&&c.push({element:a,left:a.scrollLeft,top:a.scrollTop});for(typeof v.focus=="function"&&v.focus(),v=0;v=document.documentMode,Pa=null,lv=null,kl=null,cv=!1;function xj(a,c,v){var x=v.window===v?v.document:v.nodeType===9?v:v.ownerDocument;cv||Pa==null||Pa!==_e(x)||(x=Pa,"selectionStart"in x&&sv(x)?x={start:x.selectionStart,end:x.selectionEnd}:(x=(x.ownerDocument&&x.ownerDocument.defaultView||window).getSelection(),x={anchorNode:x.anchorNode,anchorOffset:x.anchorOffset,focusNode:x.focusNode,focusOffset:x.focusOffset}),kl&&Tl(kl,x)||(kl=x,x=sf(lv,"onSelect"),0ka||(a.current=wv[ka],wv[ka]=null,ka--)}function vt(a,c){ka++,wv[ka]=a.current,a.current=c}var Ki={},or=Gi(Ki),Er=Gi(!1),Po=Ki;function Ra(a,c){var v=a.type.contextTypes;if(!v)return Ki;var x=a.stateNode;if(x&&x.__reactInternalMemoizedUnmaskedChildContext===c)return x.__reactInternalMemoizedMaskedChildContext;var _={},P;for(P in v)_[P]=c[P];return x&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=c,a.__reactInternalMemoizedMaskedChildContext=_),_}function Pr(a){return a=a.childContextTypes,a!=null}function ff(){wt(Er),wt(or)}function Mj(a,c,v){if(or.current!==Ki)throw Error(r(168));vt(or,c),vt(Er,v)}function Ij(a,c,v){var x=a.stateNode;if(c=c.childContextTypes,typeof x.getChildContext!="function")return v;x=x.getChildContext();for(var _ in x)if(!(_ in c))throw Error(r(108,K(a)||"Unknown",_));return J({},v,x)}function df(a){return a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Ki,Po=or.current,vt(or,a),vt(Er,Er.current),!0}function Dj(a,c,v){var x=a.stateNode;if(!x)throw Error(r(169));v?(a=Ij(a,c,Po),x.__reactInternalMemoizedMergedChildContext=a,wt(Er),wt(or),vt(or,a)):wt(Er),vt(Er,v)}var fi=null,hf=!1,Sv=!1;function Lj(a){fi===null?fi=[a]:fi.push(a)}function kB(a){hf=!0,Lj(a)}function Xi(){if(!Sv&&fi!==null){Sv=!0;var a=0,c=ht;try{var v=fi;for(ht=1;a>=k,_-=k,di=1<<32-bn(c)+_|v<<_|x,hi=P+a}else di=1<ze?(Xt=$e,$e=null):Xt=$e.sibling;var ot=de(re,$e,ne[ze],xe);if(ot===null){$e===null&&($e=Xt);break}a&&$e&&ot.alternate===null&&c(re,$e),Q=P(ot,Q,ze),Le===null?Me=ot:Le.sibling=ot,Le=ot,$e=Xt}if(ze===ne.length)return v(re,$e),_t&&Ao(re,ze),Me;if($e===null){for(;zeze?(Xt=$e,$e=null):Xt=$e.sibling;var io=de(re,$e,ot.value,xe);if(io===null){$e===null&&($e=Xt);break}a&&$e&&io.alternate===null&&c(re,$e),Q=P(io,Q,ze),Le===null?Me=io:Le.sibling=io,Le=io,$e=Xt}if(ot.done)return v(re,$e),_t&&Ao(re,ze),Me;if($e===null){for(;!ot.done;ze++,ot=ne.next())ot=pe(re,ot.value,xe),ot!==null&&(Q=P(ot,Q,ze),Le===null?Me=ot:Le.sibling=ot,Le=ot);return _t&&Ao(re,ze),Me}for($e=x(re,$e);!ot.done;ze++,ot=ne.next())ot=je($e,re,ze,ot.value,xe),ot!==null&&(a&&ot.alternate!==null&&$e.delete(ot.key===null?ze:ot.key),Q=P(ot,Q,ze),Le===null?Me=ot:Le.sibling=ot,Le=ot);return a&&$e.forEach(function(d8){return c(re,d8)}),_t&&Ao(re,ze),Me}function kt(re,Q,ne,xe){if(typeof ne=="object"&&ne!==null&&ne.type===T&&ne.key===null&&(ne=ne.props.children),typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case N:e:{for(var Me=ne.key,Le=Q;Le!==null;){if(Le.key===Me){if(Me=ne.type,Me===T){if(Le.tag===7){v(re,Le.sibling),Q=_(Le,ne.props.children),Q.return=re,re=Q;break e}}else if(Le.elementType===Me||typeof Me=="object"&&Me!==null&&Me.$$typeof===H&&Uj(Me)===Le.type){v(re,Le.sibling),Q=_(Le,ne.props),Q.ref=$l(re,Le,ne),Q.return=re,re=Q;break e}v(re,Le);break}else c(re,Le);Le=Le.sibling}ne.type===T?(Q=Lo(ne.props.children,re.mode,xe,ne.key),Q.return=re,re=Q):(xe=zf(ne.type,ne.key,ne.props,null,re.mode,xe),xe.ref=$l(re,Q,ne),xe.return=re,re=xe)}return k(re);case C:e:{for(Le=ne.key;Q!==null;){if(Q.key===Le)if(Q.tag===4&&Q.stateNode.containerInfo===ne.containerInfo&&Q.stateNode.implementation===ne.implementation){v(re,Q.sibling),Q=_(Q,ne.children||[]),Q.return=re,re=Q;break e}else{v(re,Q);break}else c(re,Q);Q=Q.sibling}Q=xg(ne,re.mode,xe),Q.return=re,re=Q}return k(re);case H:return Le=ne._init,kt(re,Q,Le(ne._payload),xe)}if(hr(ne))return Ae(re,Q,ne,xe);if(Z(ne))return ke(re,Q,ne,xe);gf(re,ne)}return typeof ne=="string"&&ne!==""||typeof ne=="number"?(ne=""+ne,Q!==null&&Q.tag===6?(v(re,Q.sibling),Q=_(Q,ne),Q.return=re,re=Q):(v(re,Q),Q=yg(ne,re.mode,xe),Q.return=re,re=Q),k(re)):v(re,Q)}return kt}var La=Wj(!0),Hj=Wj(!1),yf=Gi(null),xf=null,$a=null,Nv=null;function Av(){Nv=$a=xf=null}function Cv(a){var c=yf.current;wt(yf),a._currentValue=c}function Tv(a,c,v){for(;a!==null;){var x=a.alternate;if((a.childLanes&c)!==c?(a.childLanes|=c,x!==null&&(x.childLanes|=c)):x!==null&&(x.childLanes&c)!==c&&(x.childLanes|=c),a===v)break;a=a.return}}function Ba(a,c){xf=a,Nv=$a=null,a=a.dependencies,a!==null&&a.firstContext!==null&&((a.lanes&c)!==0&&(Nr=!0),a.firstContext=null)}function nn(a){var c=a._currentValue;if(Nv!==a)if(a={context:a,memoizedValue:c,next:null},$a===null){if(xf===null)throw Error(r(308));$a=a,xf.dependencies={lanes:0,firstContext:a}}else $a=$a.next=a;return c}var Co=null;function kv(a){Co===null?Co=[a]:Co.push(a)}function Vj(a,c,v,x){var _=c.interleaved;return _===null?(v.next=v,kv(c)):(v.next=_.next,_.next=v),c.interleaved=v,pi(a,x)}function pi(a,c){a.lanes|=c;var v=a.alternate;for(v!==null&&(v.lanes|=c),v=a,a=a.return;a!==null;)a.childLanes|=c,v=a.alternate,v!==null&&(v.childLanes|=c),v=a,a=a.return;return v.tag===3?v.stateNode:null}var Yi=!1;function Rv(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Gj(a,c){a=a.updateQueue,c.updateQueue===a&&(c.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function mi(a,c){return{eventTime:a,lane:c,tag:0,payload:null,callback:null,next:null}}function Qi(a,c,v){var x=a.updateQueue;if(x===null)return null;if(x=x.shared,(it&2)!==0){var _=x.pending;return _===null?c.next=c:(c.next=_.next,_.next=c),x.pending=c,pi(a,v)}return _=x.interleaved,_===null?(c.next=c,kv(x)):(c.next=_.next,_.next=c),x.interleaved=c,pi(a,v)}function bf(a,c,v){if(c=c.updateQueue,c!==null&&(c=c.shared,(v&4194240)!==0)){var x=c.lanes;x&=a.pendingLanes,v|=x,c.lanes=v,Gm(a,v)}}function Kj(a,c){var v=a.updateQueue,x=a.alternate;if(x!==null&&(x=x.updateQueue,v===x)){var _=null,P=null;if(v=v.firstBaseUpdate,v!==null){do{var k={eventTime:v.eventTime,lane:v.lane,tag:v.tag,payload:v.payload,callback:v.callback,next:null};P===null?_=P=k:P=P.next=k,v=v.next}while(v!==null);P===null?_=P=c:P=P.next=c}else _=P=c;v={baseState:x.baseState,firstBaseUpdate:_,lastBaseUpdate:P,shared:x.shared,effects:x.effects},a.updateQueue=v;return}a=v.lastBaseUpdate,a===null?v.firstBaseUpdate=c:a.next=c,v.lastBaseUpdate=c}function wf(a,c,v,x){var _=a.updateQueue;Yi=!1;var P=_.firstBaseUpdate,k=_.lastBaseUpdate,W=_.shared.pending;if(W!==null){_.shared.pending=null;var X=W,oe=X.next;X.next=null,k===null?P=oe:k.next=oe,k=X;var he=a.alternate;he!==null&&(he=he.updateQueue,W=he.lastBaseUpdate,W!==k&&(W===null?he.firstBaseUpdate=oe:W.next=oe,he.lastBaseUpdate=X))}if(P!==null){var pe=_.baseState;k=0,he=oe=X=null,W=P;do{var de=W.lane,je=W.eventTime;if((x&de)===de){he!==null&&(he=he.next={eventTime:je,lane:0,tag:W.tag,payload:W.payload,callback:W.callback,next:null});e:{var Ae=a,ke=W;switch(de=c,je=v,ke.tag){case 1:if(Ae=ke.payload,typeof Ae=="function"){pe=Ae.call(je,pe,de);break e}pe=Ae;break e;case 3:Ae.flags=Ae.flags&-65537|128;case 0:if(Ae=ke.payload,de=typeof Ae=="function"?Ae.call(je,pe,de):Ae,de==null)break e;pe=J({},pe,de);break e;case 2:Yi=!0}}W.callback!==null&&W.lane!==0&&(a.flags|=64,de=_.effects,de===null?_.effects=[W]:de.push(W))}else je={eventTime:je,lane:de,tag:W.tag,payload:W.payload,callback:W.callback,next:null},he===null?(oe=he=je,X=pe):he=he.next=je,k|=de;if(W=W.next,W===null){if(W=_.shared.pending,W===null)break;de=W,W=de.next,de.next=null,_.lastBaseUpdate=de,_.shared.pending=null}}while(!0);if(he===null&&(X=pe),_.baseState=X,_.firstBaseUpdate=oe,_.lastBaseUpdate=he,c=_.shared.interleaved,c!==null){_=c;do k|=_.lane,_=_.next;while(_!==c)}else P===null&&(_.shared.lanes=0);Ro|=k,a.lanes=k,a.memoizedState=pe}}function Xj(a,c,v){if(a=c.effects,c.effects=null,a!==null)for(c=0;cv?v:4,a(!0);var x=$v.transition;$v.transition={};try{a(!1),c()}finally{ht=v,$v.transition=x}}function pO(){return on().memoizedState}function DB(a,c,v){var x=to(a);if(v={lane:x,action:v,hasEagerState:!1,eagerState:null,next:null},mO(a))vO(c,v);else if(v=Vj(a,c,v,x),v!==null){var _=mr();En(v,a,x,_),gO(v,c,x)}}function LB(a,c,v){var x=to(a),_={lane:x,action:v,hasEagerState:!1,eagerState:null,next:null};if(mO(a))vO(c,_);else{var P=a.alternate;if(a.lanes===0&&(P===null||P.lanes===0)&&(P=c.lastRenderedReducer,P!==null))try{var k=c.lastRenderedState,W=P(k,v);if(_.hasEagerState=!0,_.eagerState=W,wn(W,k)){var X=c.interleaved;X===null?(_.next=_,kv(c)):(_.next=X.next,X.next=_),c.interleaved=_;return}}catch{}finally{}v=Vj(a,c,_,x),v!==null&&(_=mr(),En(v,a,x,_),gO(v,c,x))}}function mO(a){var c=a.alternate;return a===Et||c!==null&&c===Et}function vO(a,c){ql=jf=!0;var v=a.pending;v===null?c.next=c:(c.next=v.next,v.next=c),a.pending=c}function gO(a,c,v){if((v&4194240)!==0){var x=c.lanes;x&=a.pendingLanes,v|=x,c.lanes=v,Gm(a,v)}}var Pf={readContext:nn,useCallback:ar,useContext:ar,useEffect:ar,useImperativeHandle:ar,useInsertionEffect:ar,useLayoutEffect:ar,useMemo:ar,useReducer:ar,useRef:ar,useState:ar,useDebugValue:ar,useDeferredValue:ar,useTransition:ar,useMutableSource:ar,useSyncExternalStore:ar,useId:ar,unstable_isNewReconciler:!1},$B={readContext:nn,useCallback:function(a,c){return Hn().memoizedState=[a,c===void 0?null:c],a},useContext:nn,useEffect:aO,useImperativeHandle:function(a,c,v){return v=v!=null?v.concat([a]):null,Of(4194308,4,cO.bind(null,c,a),v)},useLayoutEffect:function(a,c){return Of(4194308,4,a,c)},useInsertionEffect:function(a,c){return Of(4,2,a,c)},useMemo:function(a,c){var v=Hn();return c=c===void 0?null:c,a=a(),v.memoizedState=[a,c],a},useReducer:function(a,c,v){var x=Hn();return c=v!==void 0?v(c):c,x.memoizedState=x.baseState=c,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:c},x.queue=a,a=a.dispatch=DB.bind(null,Et,a),[x.memoizedState,a]},useRef:function(a){var c=Hn();return a={current:a},c.memoizedState=a},useState:iO,useDebugValue:Hv,useDeferredValue:function(a){return Hn().memoizedState=a},useTransition:function(){var a=iO(!1),c=a[0];return a=IB.bind(null,a[1]),Hn().memoizedState=a,[c,a]},useMutableSource:function(){},useSyncExternalStore:function(a,c,v){var x=Et,_=Hn();if(_t){if(v===void 0)throw Error(r(407));v=v()}else{if(v=c(),Kt===null)throw Error(r(349));(ko&30)!==0||Jj(x,c,v)}_.memoizedState=v;var P={value:v,getSnapshot:c};return _.queue=P,aO(tO.bind(null,x,P,a),[a]),x.flags|=2048,Hl(9,eO.bind(null,x,P,v,c),void 0,null),v},useId:function(){var a=Hn(),c=Kt.identifierPrefix;if(_t){var v=hi,x=di;v=(x&~(1<<32-bn(x)-1)).toString(32)+v,c=":"+c+"R"+v,v=Ul++,0<\/script>",a=a.removeChild(a.firstChild)):typeof x.is=="string"?a=k.createElement(v,{is:x.is}):(a=k.createElement(v),v==="select"&&(k=a,x.multiple?k.multiple=!0:x.size&&(k.size=x.size))):a=k.createElementNS(a,v),a[Un]=c,a[Dl]=x,LO(a,c,!1,!1),c.stateNode=a;e:{switch(k=dt(v,x),v){case"dialog":bt("cancel",a),bt("close",a),_=x;break;case"iframe":case"object":case"embed":bt("load",a),_=x;break;case"video":case"audio":for(_=0;_Wa&&(c.flags|=128,x=!0,Vl(P,!1),c.lanes=4194304)}else{if(!x)if(a=Sf(k),a!==null){if(c.flags|=128,x=!0,v=a.updateQueue,v!==null&&(c.updateQueue=v,c.flags|=4),Vl(P,!0),P.tail===null&&P.tailMode==="hidden"&&!k.alternate&&!_t)return sr(c),null}else 2*Tt()-P.renderingStartTime>Wa&&v!==1073741824&&(c.flags|=128,x=!0,Vl(P,!1),c.lanes=4194304);P.isBackwards?(k.sibling=c.child,c.child=k):(v=P.last,v!==null?v.sibling=k:c.child=k,P.last=k)}return P.tail!==null?(c=P.tail,P.rendering=c,P.tail=c.sibling,P.renderingStartTime=Tt(),c.sibling=null,v=Ot.current,vt(Ot,x?v&1|2:v&1),c):(sr(c),null);case 22:case 23:return mg(),x=c.memoizedState!==null,a!==null&&a.memoizedState!==null!==x&&(c.flags|=8192),x&&(c.mode&1)!==0?(Fr&1073741824)!==0&&(sr(c),c.subtreeFlags&6&&(c.flags|=8192)):sr(c),null;case 24:return null;case 25:return null}throw Error(r(156,c.tag))}function VB(a,c){switch(jv(c),c.tag){case 1:return Pr(c.type)&&ff(),a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 3:return Fa(),wt(Er),wt(or),Lv(),a=c.flags,(a&65536)!==0&&(a&128)===0?(c.flags=a&-65537|128,c):null;case 5:return Iv(c),null;case 13:if(wt(Ot),a=c.memoizedState,a!==null&&a.dehydrated!==null){if(c.alternate===null)throw Error(r(340));Da()}return a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 19:return wt(Ot),null;case 4:return Fa(),null;case 10:return Cv(c.type._context),null;case 22:case 23:return mg(),null;case 24:return null;default:return null}}var Tf=!1,lr=!1,GB=typeof WeakSet=="function"?WeakSet:Set,Pe=null;function qa(a,c){var v=a.ref;if(v!==null)if(typeof v=="function")try{v(null)}catch(x){Pt(a,c,x)}else v.current=null}function ng(a,c,v){try{v()}catch(x){Pt(a,c,x)}}var FO=!1;function KB(a,c){if(mv=Yu,a=yj(),sv(a)){if("selectionStart"in a)var v={start:a.selectionStart,end:a.selectionEnd};else e:{v=(v=a.ownerDocument)&&v.defaultView||window;var x=v.getSelection&&v.getSelection();if(x&&x.rangeCount!==0){v=x.anchorNode;var _=x.anchorOffset,P=x.focusNode;x=x.focusOffset;try{v.nodeType,P.nodeType}catch{v=null;break e}var k=0,W=-1,X=-1,oe=0,he=0,pe=a,de=null;t:for(;;){for(var je;pe!==v||_!==0&&pe.nodeType!==3||(W=k+_),pe!==P||x!==0&&pe.nodeType!==3||(X=k+x),pe.nodeType===3&&(k+=pe.nodeValue.length),(je=pe.firstChild)!==null;)de=pe,pe=je;for(;;){if(pe===a)break t;if(de===v&&++oe===_&&(W=k),de===P&&++he===x&&(X=k),(je=pe.nextSibling)!==null)break;pe=de,de=pe.parentNode}pe=je}v=W===-1||X===-1?null:{start:W,end:X}}else v=null}v=v||{start:0,end:0}}else v=null;for(vv={focusedElem:a,selectionRange:v},Yu=!1,Pe=c;Pe!==null;)if(c=Pe,a=c.child,(c.subtreeFlags&1028)!==0&&a!==null)a.return=c,Pe=a;else for(;Pe!==null;){c=Pe;try{var Ae=c.alternate;if((c.flags&1024)!==0)switch(c.tag){case 0:case 11:case 15:break;case 1:if(Ae!==null){var ke=Ae.memoizedProps,kt=Ae.memoizedState,re=c.stateNode,Q=re.getSnapshotBeforeUpdate(c.elementType===c.type?ke:_n(c.type,ke),kt);re.__reactInternalSnapshotBeforeUpdate=Q}break;case 3:var ne=c.stateNode.containerInfo;ne.nodeType===1?ne.textContent="":ne.nodeType===9&&ne.documentElement&&ne.removeChild(ne.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(xe){Pt(c,c.return,xe)}if(a=c.sibling,a!==null){a.return=c.return,Pe=a;break}Pe=c.return}return Ae=FO,FO=!1,Ae}function Gl(a,c,v){var x=c.updateQueue;if(x=x!==null?x.lastEffect:null,x!==null){var _=x=x.next;do{if((_.tag&a)===a){var P=_.destroy;_.destroy=void 0,P!==void 0&&ng(c,v,P)}_=_.next}while(_!==x)}}function kf(a,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var v=c=c.next;do{if((v.tag&a)===a){var x=v.create;v.destroy=x()}v=v.next}while(v!==c)}}function ig(a){var c=a.ref;if(c!==null){var v=a.stateNode;switch(a.tag){case 5:a=v;break;default:a=v}typeof c=="function"?c(a):c.current=a}}function zO(a){var c=a.alternate;c!==null&&(a.alternate=null,zO(c)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(c=a.stateNode,c!==null&&(delete c[Un],delete c[Dl],delete c[bv],delete c[CB],delete c[TB])),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}function qO(a){return a.tag===5||a.tag===3||a.tag===4}function UO(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||qO(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function og(a,c,v){var x=a.tag;if(x===5||x===6)a=a.stateNode,c?v.nodeType===8?v.parentNode.insertBefore(a,c):v.insertBefore(a,c):(v.nodeType===8?(c=v.parentNode,c.insertBefore(a,v)):(c=v,c.appendChild(a)),v=v._reactRootContainer,v!=null||c.onclick!==null||(c.onclick=cf));else if(x!==4&&(a=a.child,a!==null))for(og(a,c,v),a=a.sibling;a!==null;)og(a,c,v),a=a.sibling}function ag(a,c,v){var x=a.tag;if(x===5||x===6)a=a.stateNode,c?v.insertBefore(a,c):v.appendChild(a);else if(x!==4&&(a=a.child,a!==null))for(ag(a,c,v),a=a.sibling;a!==null;)ag(a,c,v),a=a.sibling}var er=null,jn=!1;function Zi(a,c,v){for(v=v.child;v!==null;)WO(a,c,v),v=v.sibling}function WO(a,c,v){if(qn&&typeof qn.onCommitFiberUnmount=="function")try{qn.onCommitFiberUnmount(Wu,v)}catch{}switch(v.tag){case 5:lr||qa(v,c);case 6:var x=er,_=jn;er=null,Zi(a,c,v),er=x,jn=_,er!==null&&(jn?(a=er,v=v.stateNode,a.nodeType===8?a.parentNode.removeChild(v):a.removeChild(v)):er.removeChild(v.stateNode));break;case 18:er!==null&&(jn?(a=er,v=v.stateNode,a.nodeType===8?xv(a.parentNode,v):a.nodeType===1&&xv(a,v),Ol(a)):xv(er,v.stateNode));break;case 4:x=er,_=jn,er=v.stateNode.containerInfo,jn=!0,Zi(a,c,v),er=x,jn=_;break;case 0:case 11:case 14:case 15:if(!lr&&(x=v.updateQueue,x!==null&&(x=x.lastEffect,x!==null))){_=x=x.next;do{var P=_,k=P.destroy;P=P.tag,k!==void 0&&((P&2)!==0||(P&4)!==0)&&ng(v,c,k),_=_.next}while(_!==x)}Zi(a,c,v);break;case 1:if(!lr&&(qa(v,c),x=v.stateNode,typeof x.componentWillUnmount=="function"))try{x.props=v.memoizedProps,x.state=v.memoizedState,x.componentWillUnmount()}catch(W){Pt(v,c,W)}Zi(a,c,v);break;case 21:Zi(a,c,v);break;case 22:v.mode&1?(lr=(x=lr)||v.memoizedState!==null,Zi(a,c,v),lr=x):Zi(a,c,v);break;default:Zi(a,c,v)}}function HO(a){var c=a.updateQueue;if(c!==null){a.updateQueue=null;var v=a.stateNode;v===null&&(v=a.stateNode=new GB),c.forEach(function(x){var _=n8.bind(null,a,x);v.has(x)||(v.add(x),x.then(_,_))})}}function On(a,c){var v=c.deletions;if(v!==null)for(var x=0;x_&&(_=k),x&=~P}if(x=_,x=Tt()-x,x=(120>x?120:480>x?480:1080>x?1080:1920>x?1920:3e3>x?3e3:4320>x?4320:1960*YB(x/1960))-x,10a?16:a,eo===null)var x=!1;else{if(a=eo,eo=null,Lf=0,(it&6)!==0)throw Error(r(331));var _=it;for(it|=4,Pe=a.current;Pe!==null;){var P=Pe,k=P.child;if((Pe.flags&16)!==0){var W=P.deletions;if(W!==null){for(var X=0;XTt()-cg?Io(a,0):lg|=v),Cr(a,c)}function iE(a,c){c===0&&((a.mode&1)===0?c=1:(c=Vu,Vu<<=1,(Vu&130023424)===0&&(Vu=4194304)));var v=mr();a=pi(a,c),a!==null&&(bl(a,c,v),Cr(a,v))}function r8(a){var c=a.memoizedState,v=0;c!==null&&(v=c.retryLane),iE(a,v)}function n8(a,c){var v=0;switch(a.tag){case 13:var x=a.stateNode,_=a.memoizedState;_!==null&&(v=_.retryLane);break;case 19:x=a.stateNode;break;default:throw Error(r(314))}x!==null&&x.delete(c),iE(a,v)}var oE;oE=function(a,c,v){if(a!==null)if(a.memoizedProps!==c.pendingProps||Er.current)Nr=!0;else{if((a.lanes&v)===0&&(c.flags&128)===0)return Nr=!1,WB(a,c,v);Nr=(a.flags&131072)!==0}else Nr=!1,_t&&(c.flags&1048576)!==0&&$j(c,mf,c.index);switch(c.lanes=0,c.tag){case 2:var x=c.type;Cf(a,c),a=c.pendingProps;var _=Ra(c,or.current);Ba(c,v),_=Fv(null,c,x,a,_,v);var P=zv();return c.flags|=1,typeof _=="object"&&_!==null&&typeof _.render=="function"&&_.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,Pr(x)?(P=!0,df(c)):P=!1,c.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,Rv(c),_.updater=Nf,c.stateNode=_,_._reactInternals=c,Gv(c,x,a,v),c=Qv(null,c,x,!0,P,v)):(c.tag=0,_t&&P&&_v(c),pr(null,c,_,v),c=c.child),c;case 16:x=c.elementType;e:{switch(Cf(a,c),a=c.pendingProps,_=x._init,x=_(x._payload),c.type=x,_=c.tag=o8(x),a=_n(x,a),_){case 0:c=Yv(null,c,x,a,v);break e;case 1:c=TO(null,c,x,a,v);break e;case 11:c=EO(null,c,x,a,v);break e;case 14:c=PO(null,c,x,_n(x.type,a),v);break e}throw Error(r(306,x,""))}return c;case 0:return x=c.type,_=c.pendingProps,_=c.elementType===x?_:_n(x,_),Yv(a,c,x,_,v);case 1:return x=c.type,_=c.pendingProps,_=c.elementType===x?_:_n(x,_),TO(a,c,x,_,v);case 3:e:{if(kO(c),a===null)throw Error(r(387));x=c.pendingProps,P=c.memoizedState,_=P.element,Gj(a,c),wf(c,x,null,v);var k=c.memoizedState;if(x=k.element,P.isDehydrated)if(P={element:x,isDehydrated:!1,cache:k.cache,pendingSuspenseBoundaries:k.pendingSuspenseBoundaries,transitions:k.transitions},c.updateQueue.baseState=P,c.memoizedState=P,c.flags&256){_=za(Error(r(423)),c),c=RO(a,c,x,v,_);break e}else if(x!==_){_=za(Error(r(424)),c),c=RO(a,c,x,v,_);break e}else for(Br=Vi(c.stateNode.containerInfo.firstChild),$r=c,_t=!0,Sn=null,v=Hj(c,null,x,v),c.child=v;v;)v.flags=v.flags&-3|4096,v=v.sibling;else{if(Da(),x===_){c=vi(a,c,v);break e}pr(a,c,x,v)}c=c.child}return c;case 5:return Yj(c),a===null&&Ev(c),x=c.type,_=c.pendingProps,P=a!==null?a.memoizedProps:null,k=_.children,gv(x,_)?k=null:P!==null&&gv(x,P)&&(c.flags|=32),CO(a,c),pr(a,c,k,v),c.child;case 6:return a===null&&Ev(c),null;case 13:return MO(a,c,v);case 4:return Mv(c,c.stateNode.containerInfo),x=c.pendingProps,a===null?c.child=La(c,null,x,v):pr(a,c,x,v),c.child;case 11:return x=c.type,_=c.pendingProps,_=c.elementType===x?_:_n(x,_),EO(a,c,x,_,v);case 7:return pr(a,c,c.pendingProps,v),c.child;case 8:return pr(a,c,c.pendingProps.children,v),c.child;case 12:return pr(a,c,c.pendingProps.children,v),c.child;case 10:e:{if(x=c.type._context,_=c.pendingProps,P=c.memoizedProps,k=_.value,vt(yf,x._currentValue),x._currentValue=k,P!==null)if(wn(P.value,k)){if(P.children===_.children&&!Er.current){c=vi(a,c,v);break e}}else for(P=c.child,P!==null&&(P.return=c);P!==null;){var W=P.dependencies;if(W!==null){k=P.child;for(var X=W.firstContext;X!==null;){if(X.context===x){if(P.tag===1){X=mi(-1,v&-v),X.tag=2;var oe=P.updateQueue;if(oe!==null){oe=oe.shared;var he=oe.pending;he===null?X.next=X:(X.next=he.next,he.next=X),oe.pending=X}}P.lanes|=v,X=P.alternate,X!==null&&(X.lanes|=v),Tv(P.return,v,c),W.lanes|=v;break}X=X.next}}else if(P.tag===10)k=P.type===c.type?null:P.child;else if(P.tag===18){if(k=P.return,k===null)throw Error(r(341));k.lanes|=v,W=k.alternate,W!==null&&(W.lanes|=v),Tv(k,v,c),k=P.sibling}else k=P.child;if(k!==null)k.return=P;else for(k=P;k!==null;){if(k===c){k=null;break}if(P=k.sibling,P!==null){P.return=k.return,k=P;break}k=k.return}P=k}pr(a,c,_.children,v),c=c.child}return c;case 9:return _=c.type,x=c.pendingProps.children,Ba(c,v),_=nn(_),x=x(_),c.flags|=1,pr(a,c,x,v),c.child;case 14:return x=c.type,_=_n(x,c.pendingProps),_=_n(x.type,_),PO(a,c,x,_,v);case 15:return NO(a,c,c.type,c.pendingProps,v);case 17:return x=c.type,_=c.pendingProps,_=c.elementType===x?_:_n(x,_),Cf(a,c),c.tag=1,Pr(x)?(a=!0,df(c)):a=!1,Ba(c,v),xO(c,x,_),Gv(c,x,_,v),Qv(null,c,x,!0,a,v);case 19:return DO(a,c,v);case 22:return AO(a,c,v)}throw Error(r(156,c.tag))};function aE(a,c){return B_(a,c)}function i8(a,c,v,x){this.tag=a,this.key=v,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=x,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function sn(a,c,v,x){return new i8(a,c,v,x)}function gg(a){return a=a.prototype,!(!a||!a.isReactComponent)}function o8(a){if(typeof a=="function")return gg(a)?1:0;if(a!=null){if(a=a.$$typeof,a===$)return 11;if(a===q)return 14}return 2}function no(a,c){var v=a.alternate;return v===null?(v=sn(a.tag,c,a.key,a.mode),v.elementType=a.elementType,v.type=a.type,v.stateNode=a.stateNode,v.alternate=a,a.alternate=v):(v.pendingProps=c,v.type=a.type,v.flags=0,v.subtreeFlags=0,v.deletions=null),v.flags=a.flags&14680064,v.childLanes=a.childLanes,v.lanes=a.lanes,v.child=a.child,v.memoizedProps=a.memoizedProps,v.memoizedState=a.memoizedState,v.updateQueue=a.updateQueue,c=a.dependencies,v.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},v.sibling=a.sibling,v.index=a.index,v.ref=a.ref,v}function zf(a,c,v,x,_,P){var k=2;if(x=a,typeof a=="function")gg(a)&&(k=1);else if(typeof a=="string")k=5;else e:switch(a){case T:return Lo(v.children,_,P,c);case R:k=8,_|=8;break;case I:return a=sn(12,v,c,_|2),a.elementType=I,a.lanes=P,a;case U:return a=sn(13,v,c,_),a.elementType=U,a.lanes=P,a;case G:return a=sn(19,v,c,_),a.elementType=G,a.lanes=P,a;case V:return qf(v,_,P,c);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case F:k=10;break e;case L:k=9;break e;case $:k=11;break e;case q:k=14;break e;case H:k=16,x=null;break e}throw Error(r(130,a==null?a:typeof a,""))}return c=sn(k,v,c,_),c.elementType=a,c.type=x,c.lanes=P,c}function Lo(a,c,v,x){return a=sn(7,a,x,c),a.lanes=v,a}function qf(a,c,v,x){return a=sn(22,a,x,c),a.elementType=V,a.lanes=v,a.stateNode={isHidden:!1},a}function yg(a,c,v){return a=sn(6,a,null,c),a.lanes=v,a}function xg(a,c,v){return c=sn(4,a.children!==null?a.children:[],a.key,c),c.lanes=v,c.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},c}function a8(a,c,v,x,_){this.tag=c,this.containerInfo=a,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Vm(0),this.expirationTimes=Vm(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vm(0),this.identifierPrefix=x,this.onRecoverableError=_,this.mutableSourceEagerHydrationData=null}function bg(a,c,v,x,_,P,k,W,X){return a=new a8(a,c,v,W,X),c===1?(c=1,P===!0&&(c|=8)):c=0,P=sn(3,null,null,c),a.current=P,P.stateNode=a,P.memoizedState={element:x,isDehydrated:v,cache:null,transitions:null,pendingSuspenseBoundaries:null},Rv(P),a}function s8(a,c,v){var x=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Eg.exports=x8(),Eg.exports}var bE;function b8(){if(bE)return Yf;bE=1;var e=aM();return Yf.createRoot=e.createRoot,Yf.hydrateRoot=e.hydrateRoot,Yf}var w8=b8(),S=jp();const z=ct(S),Uw=h8({__proto__:null,default:z},[S]);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const S8=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),_8=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase()),wE=e=>{const t=_8(e);return t.charAt(0).toUpperCase()+t.slice(1)},sM=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var j8={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const O8=S.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:i="",children:o,iconNode:s,...u},f)=>S.createElement("svg",{ref:f,...j8,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:sM("lucide",i),...u},[...s.map(([l,h])=>S.createElement(l,h)),...Array.isArray(o)?o:[o]]));/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const De=(e,t)=>{const r=S.forwardRef(({className:n,...i},o)=>S.createElement(O8,{ref:o,iconNode:t,className:sM(`lucide-${S8(wE(e))}`,`lucide-${e}`,n),...i}));return r.displayName=wE(e),r};/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const E8=[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"M20 8h-5",key:"1vsyxs"}],["path",{d:"M15 10V6.5a2.5 2.5 0 0 1 5 0V10",key:"ag13bf"}],["path",{d:"M15 14h5l-5 6h5",key:"ur5jdg"}]],P8=De("arrow-down-a-z",E8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const N8=[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]],A8=De("arrow-down-right",N8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const C8=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],T8=De("arrow-left",C8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const k8=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],R8=De("arrow-up-down",k8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const M8=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],lM=De("arrow-up-right",M8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const I8=[["path",{d:"M3 5v14",key:"1nt18q"}],["path",{d:"M8 5v14",key:"1ybrkv"}],["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"M17 5v14",key:"ycjyhj"}],["path",{d:"M21 5v14",key:"nzette"}]],D8=De("barcode",I8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const L8=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],$8=De("calendar",L8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const B8=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],F8=De("chart-column",B8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const z8=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],cM=De("check",z8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const q8=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],xs=De("chevron-down",q8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const U8=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],uM=De("chevron-left",U8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const W8=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],bs=De("chevron-right",W8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const H8=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],V8=De("chevron-up",H8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const G8=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],oh=De("circle-help",G8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const K8=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]],X8=De("circle-user",K8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Y8=[["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M14 2v2",key:"6buw04"}],["path",{d:"M16 8a1 1 0 0 1 1 1v8a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1h14a4 4 0 1 1 0 8h-1",key:"pwadti"}],["path",{d:"M6 2v2",key:"colzsn"}]],Q8=De("coffee",Y8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Z8=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]],Ww=De("download",Z8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const J8=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],Hw=De("ellipsis",J8);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const eF=[["path",{d:"M14.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"16lz6z"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M3 13.1a2 2 0 0 0-1 1.76v3.24a2 2 0 0 0 .97 1.78L6 21.7a2 2 0 0 0 2.03.01L11 19.9a2 2 0 0 0 1-1.76V14.9a2 2 0 0 0-.97-1.78L8 11.3a2 2 0 0 0-2.03-.01Z",key:"99pj1s"}],["path",{d:"M7 17v5",key:"1yj1jh"}],["path",{d:"M11.7 14.2 7 17l-4.7-2.8",key:"1yk8tc"}]],fM=De("file-box",eF);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const tF=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],ws=De("file-text",tF);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const rF=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],nF=De("grid-3x3",rF);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const iF=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],Jo=De("image",iF);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const oF=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],dM=De("layers",oF);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const aF=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],hM=De("layout-dashboard",aF);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const sF=[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]],lF=De("list",sF);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const cF=[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]],uF=De("log-out",cF);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const fF=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],Zs=De("map-pin",fF);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const dF=[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]],hF=De("menu",dF);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const pF=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],ah=De("package",pF);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const mF=[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]],pM=De("palette",mF);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const vF=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],eh=De("pencil",vF);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const gF=[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]],yF=De("pin",gF);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const xF=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Rr=De("plus",xF);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const bF=[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]],mM=De("printer",bF);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const wF=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],SF=De("refresh-cw",wF);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const _F=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],jF=De("save",_F);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const OF=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],Vw=De("search",OF);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const EF=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],sh=De("settings",EF);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const PF=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],NF=De("shield",PF);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const AF=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],co=De("square-pen",AF);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const CF=[["path",{d:"m2 7 4.41-4.41A2 2 0 0 1 7.83 2h8.34a2 2 0 0 1 1.42.59L22 7",key:"ztvudi"}],["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}],["path",{d:"M15 22v-4a2 2 0 0 0-2-2h-2a2 2 0 0 0-2 2v4",key:"2ebpfo"}],["path",{d:"M2 7h20",key:"1fcdvo"}],["path",{d:"M22 7v3a2 2 0 0 1-2 2a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 16 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 12 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 8 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 4 12a2 2 0 0 1-2-2V7",key:"6c3vgh"}]],TF=De("store",CF);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const kF=[["path",{d:"m18 2 4 4",key:"22kx64"}],["path",{d:"m17 7 3-3",key:"1w1zoj"}],["path",{d:"M19 9 8.7 19.3c-1 1-2.5 1-3.4 0l-.6-.6c-1-1-1-2.5 0-3.4L15 5",key:"1exhtz"}],["path",{d:"m9 11 4 4",key:"rovt3i"}],["path",{d:"m5 19-3 3",key:"59f2uf"}],["path",{d:"m14 4 6 6",key:"yqp9t2"}]],Ag=De("syringe",kF);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const RF=[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["line",{x1:"12",x2:"12.01",y1:"18",y2:"18",key:"1dp563"}]],MF=De("tablet",RF);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const IF=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],lh=De("tag",IF);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const DF=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],LF=De("timer",DF);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const $F=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],Nc=De("trash-2",$F);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const BF=[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]],FF=De("trending-up",BF);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const zF=[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]],Op=De("type",zF);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const qF=[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]],UF=De("upload",qF);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const WF=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],HF=De("user",WF);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const VF=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]],Gw=De("users",VF);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const GF=[["path",{d:"M3 2v7c0 1.1.9 2 2 2h4a2 2 0 0 0 2-2V2",key:"cjf0a3"}],["path",{d:"M7 2v20",key:"1473qp"}],["path",{d:"M21 15V2a5 5 0 0 0-5 5v6c0 1.1.9 2 2 2h3Zm0 0v7",key:"j28e5"}]],KF=De("utensils",GF);/** + * @license lucide-react v0.487.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const XF=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],xc=De("x",XF);function vM(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t{const r=new Array(e.length+t.length);for(let n=0;n({classGroupId:e,validator:t}),gM=(e=new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),ch="-",SE=[],ZF="arbitrary..",JF=e=>{const t=t6(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:s=>{if(s.startsWith("[")&&s.endsWith("]"))return e6(s);const u=s.split(ch),f=u[0]===""&&u.length>1?1:0;return yM(u,f,t)},getConflictingClassGroupIds:(s,u)=>{if(u){const f=n[s],l=r[s];return f?l?YF(l,f):f:l||SE}return r[s]||SE}}},yM=(e,t,r)=>{if(e.length-t===0)return r.classGroupId;const i=e[t],o=r.nextPart.get(i);if(o){const l=yM(e,t+1,o);if(l)return l}const s=r.validators;if(s===null)return;const u=t===0?e.join(ch):e.slice(t).join(ch),f=s.length;for(let l=0;le.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),n=t.slice(0,r);return n?ZF+n:void 0})(),t6=e=>{const{theme:t,classGroups:r}=e;return r6(r,t)},r6=(e,t)=>{const r=gM();for(const n in e){const i=e[n];Kw(i,r,n,t)}return r},Kw=(e,t,r,n)=>{const i=e.length;for(let o=0;o{if(typeof e=="string"){i6(e,t,r);return}if(typeof e=="function"){o6(e,t,r,n);return}a6(e,t,r,n)},i6=(e,t,r)=>{const n=e===""?t:xM(t,e);n.classGroupId=r},o6=(e,t,r,n)=>{if(s6(e)){Kw(e(n),t,r,n);return}t.validators===null&&(t.validators=[]),t.validators.push(QF(r,e))},a6=(e,t,r,n)=>{const i=Object.entries(e),o=i.length;for(let s=0;s{let r=e;const n=t.split(ch),i=n.length;for(let o=0;o"isThemeGetter"in e&&e.isThemeGetter===!0,l6=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const i=(o,s)=>{r[o]=s,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(o){let s=r[o];if(s!==void 0)return s;if((s=n[o])!==void 0)return i(o,s),s},set(o,s){o in r?r[o]=s:i(o,s)}}},Jb="!",_E=":",c6=[],jE=(e,t,r,n,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:i}),u6=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=i=>{const o=[];let s=0,u=0,f=0,l;const h=i.length;for(let y=0;yf?l-f:void 0;return jE(o,g,m,b)};if(t){const i=t+_E,o=n;n=s=>s.startsWith(i)?o(s.slice(i.length)):jE(c6,!1,s,void 0,!0)}if(r){const i=n;n=o=>r({className:o,parseClassName:i})}return n},f6=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((r,n)=>{t.set(r,1e6+n)}),r=>{const n=[];let i=[];for(let o=0;o0&&(i.sort(),n.push(...i),i=[]),n.push(s)):i.push(s)}return i.length>0&&(i.sort(),n.push(...i)),n}},d6=e=>({cache:l6(e.cacheSize),parseClassName:u6(e),sortModifiers:f6(e),...JF(e)}),h6=/\s+/,p6=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:i,sortModifiers:o}=t,s=[],u=e.trim().split(h6);let f="";for(let l=u.length-1;l>=0;l-=1){const h=u[l],{isExternal:p,modifiers:m,hasImportantModifier:g,baseClassName:b,maybePostfixModifierPosition:y}=r(h);if(p){f=h+(f.length>0?" "+f:f);continue}let w=!!y,j=n(w?b.substring(0,y):b);if(!j){if(!w){f=h+(f.length>0?" "+f:f);continue}if(j=n(b),!j){f=h+(f.length>0?" "+f:f);continue}w=!1}const O=m.length===0?"":m.length===1?m[0]:o(m).join(":"),E=g?O+Jb:O,A=E+j;if(s.indexOf(A)>-1)continue;s.push(A);const N=i(j,w);for(let C=0;C0?" "+f:f)}return f},m6=(...e)=>{let t=0,r,n,i="";for(;t{if(typeof e=="string")return e;let t,r="";for(let n=0;n{let r,n,i,o;const s=f=>{const l=t.reduce((h,p)=>p(h),e());return r=d6(l),n=r.cache.get,i=r.cache.set,o=u,u(f)},u=f=>{const l=n(f);if(l)return l;const h=p6(f,r);return i(f,h),h};return o=s,(...f)=>o(m6(...f))},g6=[],zt=e=>{const t=r=>r[e]||g6;return t.isThemeGetter=!0,t},wM=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,SM=/^\((?:(\w[\w-]*):)?(.+)\)$/i,y6=/^\d+\/\d+$/,x6=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,b6=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,w6=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,S6=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,_6=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Va=e=>y6.test(e),Ke=e=>!!e&&!Number.isNaN(Number(e)),oo=e=>!!e&&Number.isInteger(Number(e)),Cg=e=>e.endsWith("%")&&Ke(e.slice(0,-1)),yi=e=>x6.test(e),j6=()=>!0,O6=e=>b6.test(e)&&!w6.test(e),_M=()=>!1,E6=e=>S6.test(e),P6=e=>_6.test(e),N6=e=>!Ce(e)&&!Te(e),A6=e=>Js(e,EM,_M),Ce=e=>wM.test(e),$o=e=>Js(e,PM,O6),Tg=e=>Js(e,M6,Ke),OE=e=>Js(e,jM,_M),C6=e=>Js(e,OM,P6),Qf=e=>Js(e,NM,E6),Te=e=>SM.test(e),Jl=e=>el(e,PM),T6=e=>el(e,I6),EE=e=>el(e,jM),k6=e=>el(e,EM),R6=e=>el(e,OM),Zf=e=>el(e,NM,!0),Js=(e,t,r)=>{const n=wM.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},el=(e,t,r=!1)=>{const n=SM.exec(e);return n?n[1]?t(n[1]):r:!1},jM=e=>e==="position"||e==="percentage",OM=e=>e==="image"||e==="url",EM=e=>e==="length"||e==="size"||e==="bg-size",PM=e=>e==="length",M6=e=>e==="number",I6=e=>e==="family-name",NM=e=>e==="shadow",D6=()=>{const e=zt("color"),t=zt("font"),r=zt("text"),n=zt("font-weight"),i=zt("tracking"),o=zt("leading"),s=zt("breakpoint"),u=zt("container"),f=zt("spacing"),l=zt("radius"),h=zt("shadow"),p=zt("inset-shadow"),m=zt("text-shadow"),g=zt("drop-shadow"),b=zt("blur"),y=zt("perspective"),w=zt("aspect"),j=zt("ease"),O=zt("animate"),E=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],N=()=>[...A(),Te,Ce],C=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],R=()=>[Te,Ce,f],I=()=>[Va,"full","auto",...R()],F=()=>[oo,"none","subgrid",Te,Ce],L=()=>["auto",{span:["full",oo,Te,Ce]},oo,Te,Ce],$=()=>[oo,"auto",Te,Ce],U=()=>["auto","min","max","fr",Te,Ce],G=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],q=()=>["start","end","center","stretch","center-safe","end-safe"],H=()=>["auto",...R()],V=()=>[Va,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],D=()=>[e,Te,Ce],Z=()=>[...A(),EE,OE,{position:[Te,Ce]}],J=()=>["no-repeat",{repeat:["","x","y","space","round"]}],M=()=>["auto","cover","contain",k6,A6,{size:[Te,Ce]}],B=()=>[Cg,Jl,$o],ee=()=>["","none","full",l,Te,Ce],ae=()=>["",Ke,Jl,$o],ie=()=>["solid","dashed","dotted","double"],fe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],K=()=>[Ke,Cg,EE,OE],ce=()=>["","none",b,Te,Ce],te=()=>["none",Ke,Te,Ce],le=()=>["none",Ke,Te,Ce],ge=()=>[Ke,Te,Ce],Y=()=>[Va,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[yi],breakpoint:[yi],color:[j6],container:[yi],"drop-shadow":[yi],ease:["in","out","in-out"],font:[N6],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[yi],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[yi],shadow:[yi],spacing:["px",Ke],text:[yi],"text-shadow":[yi],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Va,Ce,Te,w]}],container:["container"],columns:[{columns:[Ke,Ce,Te,u]}],"break-after":[{"break-after":E()}],"break-before":[{"break-before":E()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:N()}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:I()}],"inset-x":[{"inset-x":I()}],"inset-y":[{"inset-y":I()}],start:[{start:I()}],end:[{end:I()}],top:[{top:I()}],right:[{right:I()}],bottom:[{bottom:I()}],left:[{left:I()}],visibility:["visible","invisible","collapse"],z:[{z:[oo,"auto",Te,Ce]}],basis:[{basis:[Va,"full","auto",u,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ke,Va,"auto","initial","none",Ce]}],grow:[{grow:["",Ke,Te,Ce]}],shrink:[{shrink:["",Ke,Te,Ce]}],order:[{order:[oo,"first","last","none",Te,Ce]}],"grid-cols":[{"grid-cols":F()}],"col-start-end":[{col:L()}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":F()}],"row-start-end":[{row:L()}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":U()}],"auto-rows":[{"auto-rows":U()}],gap:[{gap:R()}],"gap-x":[{"gap-x":R()}],"gap-y":[{"gap-y":R()}],"justify-content":[{justify:[...G(),"normal"]}],"justify-items":[{"justify-items":[...q(),"normal"]}],"justify-self":[{"justify-self":["auto",...q()]}],"align-content":[{content:["normal",...G()]}],"align-items":[{items:[...q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...q(),{baseline:["","last"]}]}],"place-content":[{"place-content":G()}],"place-items":[{"place-items":[...q(),"baseline"]}],"place-self":[{"place-self":["auto",...q()]}],p:[{p:R()}],px:[{px:R()}],py:[{py:R()}],ps:[{ps:R()}],pe:[{pe:R()}],pt:[{pt:R()}],pr:[{pr:R()}],pb:[{pb:R()}],pl:[{pl:R()}],m:[{m:H()}],mx:[{mx:H()}],my:[{my:H()}],ms:[{ms:H()}],me:[{me:H()}],mt:[{mt:H()}],mr:[{mr:H()}],mb:[{mb:H()}],ml:[{ml:H()}],"space-x":[{"space-x":R()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":R()}],"space-y-reverse":["space-y-reverse"],size:[{size:V()}],w:[{w:[u,"screen",...V()]}],"min-w":[{"min-w":[u,"screen","none",...V()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[s]},...V()]}],h:[{h:["screen","lh",...V()]}],"min-h":[{"min-h":["screen","lh","none",...V()]}],"max-h":[{"max-h":["screen","lh",...V()]}],"font-size":[{text:["base",r,Jl,$o]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,Te,Tg]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Cg,Ce]}],"font-family":[{font:[T6,Ce,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,Te,Ce]}],"line-clamp":[{"line-clamp":[Ke,"none",Te,Tg]}],leading:[{leading:[o,...R()]}],"list-image":[{"list-image":["none",Te,Ce]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Te,Ce]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:D()}],"text-color":[{text:D()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ie(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ke,"from-font","auto",Te,$o]}],"text-decoration-color":[{decoration:D()}],"underline-offset":[{"underline-offset":[Ke,"auto",Te,Ce]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Te,Ce]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Te,Ce]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Z()}],"bg-repeat":[{bg:J()}],"bg-size":[{bg:M()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},oo,Te,Ce],radial:["",Te,Ce],conic:[oo,Te,Ce]},R6,C6]}],"bg-color":[{bg:D()}],"gradient-from-pos":[{from:B()}],"gradient-via-pos":[{via:B()}],"gradient-to-pos":[{to:B()}],"gradient-from":[{from:D()}],"gradient-via":[{via:D()}],"gradient-to":[{to:D()}],rounded:[{rounded:ee()}],"rounded-s":[{"rounded-s":ee()}],"rounded-e":[{"rounded-e":ee()}],"rounded-t":[{"rounded-t":ee()}],"rounded-r":[{"rounded-r":ee()}],"rounded-b":[{"rounded-b":ee()}],"rounded-l":[{"rounded-l":ee()}],"rounded-ss":[{"rounded-ss":ee()}],"rounded-se":[{"rounded-se":ee()}],"rounded-ee":[{"rounded-ee":ee()}],"rounded-es":[{"rounded-es":ee()}],"rounded-tl":[{"rounded-tl":ee()}],"rounded-tr":[{"rounded-tr":ee()}],"rounded-br":[{"rounded-br":ee()}],"rounded-bl":[{"rounded-bl":ee()}],"border-w":[{border:ae()}],"border-w-x":[{"border-x":ae()}],"border-w-y":[{"border-y":ae()}],"border-w-s":[{"border-s":ae()}],"border-w-e":[{"border-e":ae()}],"border-w-t":[{"border-t":ae()}],"border-w-r":[{"border-r":ae()}],"border-w-b":[{"border-b":ae()}],"border-w-l":[{"border-l":ae()}],"divide-x":[{"divide-x":ae()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ae()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ie(),"hidden","none"]}],"divide-style":[{divide:[...ie(),"hidden","none"]}],"border-color":[{border:D()}],"border-color-x":[{"border-x":D()}],"border-color-y":[{"border-y":D()}],"border-color-s":[{"border-s":D()}],"border-color-e":[{"border-e":D()}],"border-color-t":[{"border-t":D()}],"border-color-r":[{"border-r":D()}],"border-color-b":[{"border-b":D()}],"border-color-l":[{"border-l":D()}],"divide-color":[{divide:D()}],"outline-style":[{outline:[...ie(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ke,Te,Ce]}],"outline-w":[{outline:["",Ke,Jl,$o]}],"outline-color":[{outline:D()}],shadow:[{shadow:["","none",h,Zf,Qf]}],"shadow-color":[{shadow:D()}],"inset-shadow":[{"inset-shadow":["none",p,Zf,Qf]}],"inset-shadow-color":[{"inset-shadow":D()}],"ring-w":[{ring:ae()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:D()}],"ring-offset-w":[{"ring-offset":[Ke,$o]}],"ring-offset-color":[{"ring-offset":D()}],"inset-ring-w":[{"inset-ring":ae()}],"inset-ring-color":[{"inset-ring":D()}],"text-shadow":[{"text-shadow":["none",m,Zf,Qf]}],"text-shadow-color":[{"text-shadow":D()}],opacity:[{opacity:[Ke,Te,Ce]}],"mix-blend":[{"mix-blend":[...fe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":fe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ke]}],"mask-image-linear-from-pos":[{"mask-linear-from":K()}],"mask-image-linear-to-pos":[{"mask-linear-to":K()}],"mask-image-linear-from-color":[{"mask-linear-from":D()}],"mask-image-linear-to-color":[{"mask-linear-to":D()}],"mask-image-t-from-pos":[{"mask-t-from":K()}],"mask-image-t-to-pos":[{"mask-t-to":K()}],"mask-image-t-from-color":[{"mask-t-from":D()}],"mask-image-t-to-color":[{"mask-t-to":D()}],"mask-image-r-from-pos":[{"mask-r-from":K()}],"mask-image-r-to-pos":[{"mask-r-to":K()}],"mask-image-r-from-color":[{"mask-r-from":D()}],"mask-image-r-to-color":[{"mask-r-to":D()}],"mask-image-b-from-pos":[{"mask-b-from":K()}],"mask-image-b-to-pos":[{"mask-b-to":K()}],"mask-image-b-from-color":[{"mask-b-from":D()}],"mask-image-b-to-color":[{"mask-b-to":D()}],"mask-image-l-from-pos":[{"mask-l-from":K()}],"mask-image-l-to-pos":[{"mask-l-to":K()}],"mask-image-l-from-color":[{"mask-l-from":D()}],"mask-image-l-to-color":[{"mask-l-to":D()}],"mask-image-x-from-pos":[{"mask-x-from":K()}],"mask-image-x-to-pos":[{"mask-x-to":K()}],"mask-image-x-from-color":[{"mask-x-from":D()}],"mask-image-x-to-color":[{"mask-x-to":D()}],"mask-image-y-from-pos":[{"mask-y-from":K()}],"mask-image-y-to-pos":[{"mask-y-to":K()}],"mask-image-y-from-color":[{"mask-y-from":D()}],"mask-image-y-to-color":[{"mask-y-to":D()}],"mask-image-radial":[{"mask-radial":[Te,Ce]}],"mask-image-radial-from-pos":[{"mask-radial-from":K()}],"mask-image-radial-to-pos":[{"mask-radial-to":K()}],"mask-image-radial-from-color":[{"mask-radial-from":D()}],"mask-image-radial-to-color":[{"mask-radial-to":D()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":A()}],"mask-image-conic-pos":[{"mask-conic":[Ke]}],"mask-image-conic-from-pos":[{"mask-conic-from":K()}],"mask-image-conic-to-pos":[{"mask-conic-to":K()}],"mask-image-conic-from-color":[{"mask-conic-from":D()}],"mask-image-conic-to-color":[{"mask-conic-to":D()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Z()}],"mask-repeat":[{mask:J()}],"mask-size":[{mask:M()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Te,Ce]}],filter:[{filter:["","none",Te,Ce]}],blur:[{blur:ce()}],brightness:[{brightness:[Ke,Te,Ce]}],contrast:[{contrast:[Ke,Te,Ce]}],"drop-shadow":[{"drop-shadow":["","none",g,Zf,Qf]}],"drop-shadow-color":[{"drop-shadow":D()}],grayscale:[{grayscale:["",Ke,Te,Ce]}],"hue-rotate":[{"hue-rotate":[Ke,Te,Ce]}],invert:[{invert:["",Ke,Te,Ce]}],saturate:[{saturate:[Ke,Te,Ce]}],sepia:[{sepia:["",Ke,Te,Ce]}],"backdrop-filter":[{"backdrop-filter":["","none",Te,Ce]}],"backdrop-blur":[{"backdrop-blur":ce()}],"backdrop-brightness":[{"backdrop-brightness":[Ke,Te,Ce]}],"backdrop-contrast":[{"backdrop-contrast":[Ke,Te,Ce]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ke,Te,Ce]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ke,Te,Ce]}],"backdrop-invert":[{"backdrop-invert":["",Ke,Te,Ce]}],"backdrop-opacity":[{"backdrop-opacity":[Ke,Te,Ce]}],"backdrop-saturate":[{"backdrop-saturate":[Ke,Te,Ce]}],"backdrop-sepia":[{"backdrop-sepia":["",Ke,Te,Ce]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":R()}],"border-spacing-x":[{"border-spacing-x":R()}],"border-spacing-y":[{"border-spacing-y":R()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Te,Ce]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ke,"initial",Te,Ce]}],ease:[{ease:["linear","initial",j,Te,Ce]}],delay:[{delay:[Ke,Te,Ce]}],animate:[{animate:["none",O,Te,Ce]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[y,Te,Ce]}],"perspective-origin":[{"perspective-origin":N()}],rotate:[{rotate:te()}],"rotate-x":[{"rotate-x":te()}],"rotate-y":[{"rotate-y":te()}],"rotate-z":[{"rotate-z":te()}],scale:[{scale:le()}],"scale-x":[{"scale-x":le()}],"scale-y":[{"scale-y":le()}],"scale-z":[{"scale-z":le()}],"scale-3d":["scale-3d"],skew:[{skew:ge()}],"skew-x":[{"skew-x":ge()}],"skew-y":[{"skew-y":ge()}],transform:[{transform:[Te,Ce,"","none","gpu","cpu"]}],"transform-origin":[{origin:N()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Y()}],"translate-x":[{"translate-x":Y()}],"translate-y":[{"translate-y":Y()}],"translate-z":[{"translate-z":Y()}],"translate-none":["translate-none"],accent:[{accent:D()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:D()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Te,Ce]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Te,Ce]}],fill:[{fill:["none",...D()]}],"stroke-w":[{stroke:[Ke,Jl,$o,Tg]}],stroke:[{stroke:["none",...D()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},L6=v6(D6);function Re(...e){return L6(He(e))}var pu=aM();const $6=ct(pu);function PE(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ha(...e){return t=>{let r=!1;const n=e.map(i=>{const o=PE(i,t);return!r&&typeof o=="function"&&(r=!0),o});if(r)return()=>{for(let i=0;i{const{children:o,...s}=n,u=S.Children.toArray(o),f=u.find(q6);if(f){const l=f.props.children,h=u.map(p=>p===f?S.Children.count(l)>1?S.Children.only(null):S.isValidElement(l)?l.props.children:null:p);return d.jsx(t,{...s,ref:i,children:S.isValidElement(l)?S.cloneElement(l,void 0,h):null})}return d.jsx(t,{...s,ref:i,children:o})});return r.displayName=`${e}.Slot`,r}function F6(e){const t=S.forwardRef((r,n)=>{const{children:i,...o}=r;if(S.isValidElement(i)){const s=W6(i),u=U6(o,i.props);return i.type!==S.Fragment&&(u.ref=n?ha(n,s):s),S.cloneElement(i,u)}return S.Children.count(i)>1?S.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var z6=Symbol("radix.slottable");function q6(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===z6}function U6(e,t){const r={...t};for(const n in t){const i=e[n],o=t[n];/^on[A-Z]/.test(n)?i&&o?r[n]=(...u)=>{const f=o(...u);return i(...u),f}:i&&(r[n]=i):n==="style"?r[n]={...i,...o}:n==="className"&&(r[n]=[i,o].filter(Boolean).join(" "))}return{...e,...r}}function W6(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var H6=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ue=H6.reduce((e,t)=>{const r=B6(`Primitive.${t}`),n=S.forwardRef((i,o)=>{const{asChild:s,...u}=i,f=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(f,{...u,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function V6(e,t){e&&pu.flushSync(()=>e.dispatchEvent(t))}var Lt=globalThis?.document?S.useLayoutEffect:()=>{};function G6(e,t){return S.useReducer((r,n)=>t[r][n]??r,e)}var Mr=e=>{const{present:t,children:r}=e,n=K6(t),i=typeof r=="function"?r({present:n.isPresent}):S.Children.only(r),o=Ze(n.ref,X6(i));return typeof r=="function"||n.isPresent?S.cloneElement(i,{ref:o}):null};Mr.displayName="Presence";function K6(e){const[t,r]=S.useState(),n=S.useRef(null),i=S.useRef(e),o=S.useRef("none"),s=e?"mounted":"unmounted",[u,f]=G6(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{const l=Jf(n.current);o.current=u==="mounted"?l:"none"},[u]),Lt(()=>{const l=n.current,h=i.current;if(h!==e){const m=o.current,g=Jf(l);e?f("MOUNT"):g==="none"||l?.display==="none"?f("UNMOUNT"):f(h&&m!==g?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,f]),Lt(()=>{if(t){let l;const h=t.ownerDocument.defaultView??window,p=g=>{const y=Jf(n.current).includes(CSS.escape(g.animationName));if(g.target===t&&y&&(f("ANIMATION_END"),!i.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",l=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},m=g=>{g.target===t&&(o.current=Jf(n.current))};return t.addEventListener("animationstart",m),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{h.clearTimeout(l),t.removeEventListener("animationstart",m),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:S.useCallback(l=>{n.current=l?getComputedStyle(l):null,r(l)},[])}}function Jf(e){return e?.animationName||"none"}function X6(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function Y6(e,t){const r=S.createContext(t),n=o=>{const{children:s,...u}=o,f=S.useMemo(()=>u,Object.values(u));return d.jsx(r.Provider,{value:f,children:s})};n.displayName=e+"Provider";function i(o){const s=S.useContext(r);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[n,i]}function Bn(e,t=[]){let r=[];function n(o,s){const u=S.createContext(s),f=r.length;r=[...r,s];const l=p=>{const{scope:m,children:g,...b}=p,y=m?.[e]?.[f]||u,w=S.useMemo(()=>b,Object.values(b));return d.jsx(y.Provider,{value:w,children:g})};l.displayName=o+"Provider";function h(p,m){const g=m?.[e]?.[f]||u,b=S.useContext(g);if(b)return b;if(s!==void 0)return s;throw new Error(`\`${p}\` must be used within \`${o}\``)}return[l,h]}const i=()=>{const o=r.map(s=>S.createContext(s));return function(u){const f=u?.[e]||o;return S.useMemo(()=>({[`__scope${e}`]:{...u,[e]:f}}),[u,f])}};return i.scopeName=e,[n,Q6(i,...t)]}function Q6(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=n.reduce((u,{useScope:f,scopeName:l})=>{const p=f(o)[`__scope${l}`];return{...u,...p}},{});return S.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}function fr(e){const t=S.useRef(e);return S.useEffect(()=>{t.current=e}),S.useMemo(()=>(...r)=>t.current?.(...r),[])}var Z6=S.createContext(void 0);function Ep(e){const t=S.useContext(Z6);return e||t||"ltr"}function e1(e,[t,r]){return Math.min(r,Math.max(t,e))}function Ie(e,t,{checkForDefaultPrevented:r=!0}={}){return function(i){if(e?.(i),r===!1||!i.defaultPrevented)return t?.(i)}}function J6(e,t){return S.useReducer((r,n)=>t[r][n]??r,e)}var Xw="ScrollArea",[AM]=Bn(Xw),[ez,gn]=AM(Xw),CM=S.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:n="hover",dir:i,scrollHideDelay:o=600,...s}=e,[u,f]=S.useState(null),[l,h]=S.useState(null),[p,m]=S.useState(null),[g,b]=S.useState(null),[y,w]=S.useState(null),[j,O]=S.useState(0),[E,A]=S.useState(0),[N,C]=S.useState(!1),[T,R]=S.useState(!1),I=Ze(t,L=>f(L)),F=Ep(i);return d.jsx(ez,{scope:r,type:n,dir:F,scrollHideDelay:o,scrollArea:u,viewport:l,onViewportChange:h,content:p,onContentChange:m,scrollbarX:g,onScrollbarXChange:b,scrollbarXEnabled:N,onScrollbarXEnabledChange:C,scrollbarY:y,onScrollbarYChange:w,scrollbarYEnabled:T,onScrollbarYEnabledChange:R,onCornerWidthChange:O,onCornerHeightChange:A,children:d.jsx(Ue.div,{dir:F,...s,ref:I,style:{position:"relative","--radix-scroll-area-corner-width":j+"px","--radix-scroll-area-corner-height":E+"px",...e.style}})})});CM.displayName=Xw;var TM="ScrollAreaViewport",kM=S.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,nonce:i,...o}=e,s=gn(TM,r),u=S.useRef(null),f=Ze(t,u,s.onViewportChange);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),d.jsx(Ue.div,{"data-radix-scroll-area-viewport":"",...o,ref:f,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:d.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:n})})]})});kM.displayName=TM;var ii="ScrollAreaScrollbar",RM=S.forwardRef((e,t)=>{const{forceMount:r,...n}=e,i=gn(ii,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:s}=i,u=e.orientation==="horizontal";return S.useEffect(()=>(u?o(!0):s(!0),()=>{u?o(!1):s(!1)}),[u,o,s]),i.type==="hover"?d.jsx(tz,{...n,ref:t,forceMount:r}):i.type==="scroll"?d.jsx(rz,{...n,ref:t,forceMount:r}):i.type==="auto"?d.jsx(MM,{...n,ref:t,forceMount:r}):i.type==="always"?d.jsx(Yw,{...n,ref:t}):null});RM.displayName=ii;var tz=S.forwardRef((e,t)=>{const{forceMount:r,...n}=e,i=gn(ii,e.__scopeScrollArea),[o,s]=S.useState(!1);return S.useEffect(()=>{const u=i.scrollArea;let f=0;if(u){const l=()=>{window.clearTimeout(f),s(!0)},h=()=>{f=window.setTimeout(()=>s(!1),i.scrollHideDelay)};return u.addEventListener("pointerenter",l),u.addEventListener("pointerleave",h),()=>{window.clearTimeout(f),u.removeEventListener("pointerenter",l),u.removeEventListener("pointerleave",h)}}},[i.scrollArea,i.scrollHideDelay]),d.jsx(Mr,{present:r||o,children:d.jsx(MM,{"data-state":o?"visible":"hidden",...n,ref:t})})}),rz=S.forwardRef((e,t)=>{const{forceMount:r,...n}=e,i=gn(ii,e.__scopeScrollArea),o=e.orientation==="horizontal",s=Np(()=>f("SCROLL_END"),100),[u,f]=J6("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return S.useEffect(()=>{if(u==="idle"){const l=window.setTimeout(()=>f("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(l)}},[u,i.scrollHideDelay,f]),S.useEffect(()=>{const l=i.viewport,h=o?"scrollLeft":"scrollTop";if(l){let p=l[h];const m=()=>{const g=l[h];p!==g&&(f("SCROLL"),s()),p=g};return l.addEventListener("scroll",m),()=>l.removeEventListener("scroll",m)}},[i.viewport,o,f,s]),d.jsx(Mr,{present:r||u!=="hidden",children:d.jsx(Yw,{"data-state":u==="hidden"?"hidden":"visible",...n,ref:t,onPointerEnter:Ie(e.onPointerEnter,()=>f("POINTER_ENTER")),onPointerLeave:Ie(e.onPointerLeave,()=>f("POINTER_LEAVE"))})})}),MM=S.forwardRef((e,t)=>{const r=gn(ii,e.__scopeScrollArea),{forceMount:n,...i}=e,[o,s]=S.useState(!1),u=e.orientation==="horizontal",f=Np(()=>{if(r.viewport){const l=r.viewport.offsetWidth{const{orientation:r="vertical",...n}=e,i=gn(ii,e.__scopeScrollArea),o=S.useRef(null),s=S.useRef(0),[u,f]=S.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=BM(u.viewport,u.content),h={...n,sizes:u,onSizesChange:f,hasThumb:l>0&&l<1,onThumbChange:m=>o.current=m,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:m=>s.current=m};function p(m,g){return lz(m,s.current,u,g)}return r==="horizontal"?d.jsx(nz,{...h,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const m=i.viewport.scrollLeft,g=NE(m,u,i.dir);o.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:m=>{i.viewport&&(i.viewport.scrollLeft=m)},onDragScroll:m=>{i.viewport&&(i.viewport.scrollLeft=p(m,i.dir))}}):r==="vertical"?d.jsx(iz,{...h,ref:t,onThumbPositionChange:()=>{if(i.viewport&&o.current){const m=i.viewport.scrollTop,g=NE(m,u);o.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:m=>{i.viewport&&(i.viewport.scrollTop=m)},onDragScroll:m=>{i.viewport&&(i.viewport.scrollTop=p(m))}}):null}),nz=S.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...i}=e,o=gn(ii,e.__scopeScrollArea),[s,u]=S.useState(),f=S.useRef(null),l=Ze(t,f,o.onScrollbarXChange);return S.useEffect(()=>{f.current&&u(getComputedStyle(f.current))},[f]),d.jsx(DM,{"data-orientation":"horizontal",...i,ref:l,sizes:r,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Pp(r)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.x),onDragScroll:h=>e.onDragScroll(h.x),onWheelScroll:(h,p)=>{if(o.viewport){const m=o.viewport.scrollLeft+h.deltaX;e.onWheelScroll(m),zM(m,p)&&h.preventDefault()}},onResize:()=>{f.current&&o.viewport&&s&&n({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:f.current.clientWidth,paddingStart:fh(s.paddingLeft),paddingEnd:fh(s.paddingRight)}})}})}),iz=S.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...i}=e,o=gn(ii,e.__scopeScrollArea),[s,u]=S.useState(),f=S.useRef(null),l=Ze(t,f,o.onScrollbarYChange);return S.useEffect(()=>{f.current&&u(getComputedStyle(f.current))},[f]),d.jsx(DM,{"data-orientation":"vertical",...i,ref:l,sizes:r,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Pp(r)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.y),onDragScroll:h=>e.onDragScroll(h.y),onWheelScroll:(h,p)=>{if(o.viewport){const m=o.viewport.scrollTop+h.deltaY;e.onWheelScroll(m),zM(m,p)&&h.preventDefault()}},onResize:()=>{f.current&&o.viewport&&s&&n({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:f.current.clientHeight,paddingStart:fh(s.paddingTop),paddingEnd:fh(s.paddingBottom)}})}})}),[oz,IM]=AM(ii),DM=S.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:i,onThumbChange:o,onThumbPointerUp:s,onThumbPointerDown:u,onThumbPositionChange:f,onDragScroll:l,onWheelScroll:h,onResize:p,...m}=e,g=gn(ii,r),[b,y]=S.useState(null),w=Ze(t,I=>y(I)),j=S.useRef(null),O=S.useRef(""),E=g.viewport,A=n.content-n.viewport,N=fr(h),C=fr(f),T=Np(p,10);function R(I){if(j.current){const F=I.clientX-j.current.left,L=I.clientY-j.current.top;l({x:F,y:L})}}return S.useEffect(()=>{const I=F=>{const L=F.target;b?.contains(L)&&N(F,A)};return document.addEventListener("wheel",I,{passive:!1}),()=>document.removeEventListener("wheel",I,{passive:!1})},[E,b,A,N]),S.useEffect(C,[n,C]),Ss(b,T),Ss(g.content,T),d.jsx(oz,{scope:r,scrollbar:b,hasThumb:i,onThumbChange:fr(o),onThumbPointerUp:fr(s),onThumbPositionChange:C,onThumbPointerDown:fr(u),children:d.jsx(Ue.div,{...m,ref:w,style:{position:"absolute",...m.style},onPointerDown:Ie(e.onPointerDown,I=>{I.button===0&&(I.target.setPointerCapture(I.pointerId),j.current=b.getBoundingClientRect(),O.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",g.viewport&&(g.viewport.style.scrollBehavior="auto"),R(I))}),onPointerMove:Ie(e.onPointerMove,R),onPointerUp:Ie(e.onPointerUp,I=>{const F=I.target;F.hasPointerCapture(I.pointerId)&&F.releasePointerCapture(I.pointerId),document.body.style.webkitUserSelect=O.current,g.viewport&&(g.viewport.style.scrollBehavior=""),j.current=null})})})}),uh="ScrollAreaThumb",LM=S.forwardRef((e,t)=>{const{forceMount:r,...n}=e,i=IM(uh,e.__scopeScrollArea);return d.jsx(Mr,{present:r||i.hasThumb,children:d.jsx(az,{ref:t,...n})})}),az=S.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...i}=e,o=gn(uh,r),s=IM(uh,r),{onThumbPositionChange:u}=s,f=Ze(t,p=>s.onThumbChange(p)),l=S.useRef(void 0),h=Np(()=>{l.current&&(l.current(),l.current=void 0)},100);return S.useEffect(()=>{const p=o.viewport;if(p){const m=()=>{if(h(),!l.current){const g=cz(p,u);l.current=g,u()}};return u(),p.addEventListener("scroll",m),()=>p.removeEventListener("scroll",m)}},[o.viewport,h,u]),d.jsx(Ue.div,{"data-state":s.hasThumb?"visible":"hidden",...i,ref:f,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:Ie(e.onPointerDownCapture,p=>{const g=p.target.getBoundingClientRect(),b=p.clientX-g.left,y=p.clientY-g.top;s.onThumbPointerDown({x:b,y})}),onPointerUp:Ie(e.onPointerUp,s.onThumbPointerUp)})});LM.displayName=uh;var Qw="ScrollAreaCorner",$M=S.forwardRef((e,t)=>{const r=gn(Qw,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?d.jsx(sz,{...e,ref:t}):null});$M.displayName=Qw;var sz=S.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,i=gn(Qw,r),[o,s]=S.useState(0),[u,f]=S.useState(0),l=!!(o&&u);return Ss(i.scrollbarX,()=>{const h=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(h),f(h)}),Ss(i.scrollbarY,()=>{const h=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(h),s(h)}),l?d.jsx(Ue.div,{...n,ref:t,style:{width:o,height:u,position:"absolute",right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function fh(e){return e?parseInt(e,10):0}function BM(e,t){const r=e/t;return isNaN(r)?0:r}function Pp(e){const t=BM(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function lz(e,t,r,n="ltr"){const i=Pp(r),o=i/2,s=t||o,u=i-s,f=r.scrollbar.paddingStart+s,l=r.scrollbar.size-r.scrollbar.paddingEnd-u,h=r.content-r.viewport,p=n==="ltr"?[0,h]:[h*-1,0];return FM([f,l],p)(e)}function NE(e,t,r="ltr"){const n=Pp(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-i,s=t.content-t.viewport,u=o-n,f=r==="ltr"?[0,s]:[s*-1,0],l=e1(e,f);return FM([0,s],[0,u])(l)}function FM(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function zM(e,t){return e>0&&e{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return(function i(){const o={left:e.scrollLeft,top:e.scrollTop},s=r.left!==o.left,u=r.top!==o.top;(s||u)&&t(),r=o,n=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(n)};function Np(e,t){const r=fr(e),n=S.useRef(0);return S.useEffect(()=>()=>window.clearTimeout(n.current),[]),S.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function Ss(e,t){const r=fr(t);Lt(()=>{let n=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return i.observe(e),()=>{window.cancelAnimationFrame(n),i.unobserve(e)}}},[e,r])}var uz=CM,fz=kM,dz=$M;function _s({className:e,children:t,...r}){return d.jsxs(uz,{"data-slot":"scroll-area",className:Re("relative",e),...r,children:[d.jsx(fz,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:t}),d.jsx(hz,{}),d.jsx(dz,{})]})}function hz({className:e,orientation:t="vertical",...r}){return d.jsx(RM,{"data-slot":"scroll-area-scrollbar",orientation:t,className:Re("flex touch-none p-px transition-colors select-none",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",e),...r,children:d.jsx(LM,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}const pz="/assets/773f0c39e1986271e9144596caac519f934a6ae6-Cou8J2R8.png";function mz({currentView:e,setCurrentView:t}){const[r,n]=S.useState(!0),i=[{name:"Dashboard",icon:hM,type:"item"},{type:"header",name:"MODULES"},{name:"Labeling",icon:lh,type:"sub",isOpen:r,toggle:()=>n(!r),children:[{name:"Labels",icon:lh},{name:"Label Categories",icon:dM},{name:"Label Types",icon:Op},{name:"Label Templates",icon:fM},{name:"Multiple Options",icon:sh}]},{type:"header",name:"MANAGEMENT"},{name:"Location Manager",icon:Zs,type:"item"},{type:"header",name:"SYSTEM MANAGEMENT"},{name:"Account Management",icon:Gw,type:"item"},{name:"Menu Management",icon:ah,type:"item"},{name:"System Menu",icon:sh,type:"item"},{name:"Reports",icon:ws,type:"item"},{name:"Support",icon:oh,type:"item"},{name:"Log Out",icon:uF,type:"item"}];return d.jsxs("div",{className:"w-64 bg-[#1e3a8a] text-white flex flex-col h-screen border-r border-blue-800 shadow-xl z-20 shrink-0",children:[d.jsx("div",{className:"flex items-center justify-center border-b border-blue-800/50 bg-white px-4 shrink-0",style:{height:90},children:d.jsx("img",{src:pz,alt:"MedVantage",className:"h-16 w-auto object-contain"})}),d.jsx(_s,{className:"flex-1 py-4",children:d.jsx("div",{className:"px-3 space-y-1",children:i.map((o,s)=>o.type==="header"?d.jsx("div",{className:"px-4 py-2 mt-4 text-xs font-semibold text-blue-300 uppercase tracking-wider",children:o.name},s):o.type==="sub"?d.jsxs("div",{className:"space-y-1",children:[d.jsxs("button",{onClick:o.toggle,className:Re("w-full flex items-center justify-between px-4 py-2.5 text-sm font-medium rounded-lg transition-colors","hover:bg-blue-800/50 text-blue-100"),children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(o.icon,{className:"w-4 h-4"}),o.name]}),o.isOpen?d.jsx(xs,{className:"w-4 h-4"}):d.jsx(bs,{className:"w-4 h-4"})]}),o.isOpen&&d.jsx("div",{className:"pl-4 space-y-1",children:o.children?.map((u,f)=>d.jsxs("button",{onClick:()=>t(u.name),className:Re("w-full flex items-center gap-3 px-4 py-2 text-sm font-medium rounded-lg transition-colors border-l-2",e===u.name?"bg-blue-800 border-blue-400 text-white":"border-transparent hover:bg-blue-800/30 text-blue-200 hover:text-white"),children:[d.jsx("div",{className:"w-1 h-1 rounded-full bg-current"}),u.name]},f))})]},s):d.jsxs("button",{onClick:()=>t(o.name),className:Re("w-full flex items-center gap-3 px-4 py-2.5 text-sm font-medium rounded-lg transition-colors",e===o.name?"bg-blue-700 text-white shadow-md shadow-blue-900/20":o.name==="Log Out"?"text-red-300 hover:bg-red-900/20 hover:text-red-200":"text-blue-100 hover:bg-blue-800 hover:text-white"),children:[d.jsx(o.icon,{className:"w-4 h-4"}),o.name]},s))})})]})}function Se({className:e,type:t,...r}){return d.jsx("input",{type:t,"data-slot":"input",className:Re("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input flex h-9 w-full min-w-0 rounded-md border px-3 py-1 text-base bg-input-background transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...r})}var vz=Symbol.for("react.lazy"),dh=Uw[" use ".trim().toString()];function gz(e){return typeof e=="object"&&e!==null&&"then"in e}function qM(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===vz&&"_payload"in e&&gz(e._payload)}function Zw(e){const t=yz(e),r=S.forwardRef((n,i)=>{let{children:o,...s}=n;qM(o)&&typeof dh=="function"&&(o=dh(o._payload));const u=S.Children.toArray(o),f=u.find(bz);if(f){const l=f.props.children,h=u.map(p=>p===f?S.Children.count(l)>1?S.Children.only(null):S.isValidElement(l)?l.props.children:null:p);return d.jsx(t,{...s,ref:i,children:S.isValidElement(l)?S.cloneElement(l,void 0,h):null})}return d.jsx(t,{...s,ref:i,children:o})});return r.displayName=`${e}.Slot`,r}var UM=Zw("Slot");function yz(e){const t=S.forwardRef((r,n)=>{let{children:i,...o}=r;if(qM(i)&&typeof dh=="function"&&(i=dh(i._payload)),S.isValidElement(i)){const s=Sz(i),u=wz(o,i.props);return i.type!==S.Fragment&&(u.ref=n?ha(n,s):s),S.cloneElement(i,u)}return S.Children.count(i)>1?S.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var xz=Symbol("radix.slottable");function bz(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===xz}function wz(e,t){const r={...t};for(const n in t){const i=e[n],o=t[n];/^on[A-Z]/.test(n)?i&&o?r[n]=(...u)=>{const f=o(...u);return i(...u),f}:i&&(r[n]=i):n==="style"?r[n]={...i,...o}:n==="className"&&(r[n]=[i,o].filter(Boolean).join(" "))}return{...e,...r}}function Sz(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}const AE=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,CE=He,WM=(e,t)=>r=>{var n;if(t?.variants==null)return CE(e,r?.class,r?.className);const{variants:i,defaultVariants:o}=t,s=Object.keys(i).map(l=>{const h=r?.[l],p=o?.[l];if(h===null)return null;const m=AE(h)||AE(p);return i[l][m]}),u=r&&Object.entries(r).reduce((l,h)=>{let[p,m]=h;return m===void 0||(l[p]=m),l},{}),f=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((l,h)=>{let{class:p,className:m,...g}=h;return Object.entries(g).every(b=>{let[y,w]=b;return Array.isArray(w)?w.includes({...o,...u}[y]):{...o,...u}[y]===w})?[...l,p,m]:l},[]);return CE(e,s,f,r?.class,r?.className)},HM=WM("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background text-foreground hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9 rounded-md"}},defaultVariants:{variant:"default",size:"default"}}),we=S.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...i},o)=>{const s=n?UM:"button";return d.jsx(s,{ref:o,"data-slot":"button",className:Re(HM({variant:t,size:r,className:e})),...i})});we.displayName="Button";function _z(e,t=[]){let r=[];function n(o,s){const u=S.createContext(s);u.displayName=o+"Context";const f=r.length;r=[...r,s];const l=p=>{const{scope:m,children:g,...b}=p,y=m?.[e]?.[f]||u,w=S.useMemo(()=>b,Object.values(b));return d.jsx(y.Provider,{value:w,children:g})};l.displayName=o+"Provider";function h(p,m){const g=m?.[e]?.[f]||u,b=S.useContext(g);if(b)return b;if(s!==void 0)return s;throw new Error(`\`${p}\` must be used within \`${o}\``)}return[l,h]}const i=()=>{const o=r.map(s=>S.createContext(s));return function(u){const f=u?.[e]||o;return S.useMemo(()=>({[`__scope${e}`]:{...u,[e]:f}}),[u,f])}};return i.scopeName=e,[n,jz(i,...t)]}function jz(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const s=n.reduce((u,{useScope:f,scopeName:l})=>{const p=f(o)[`__scope${l}`];return{...u,...p}},{});return S.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return r.scopeName=t.scopeName,r}var Oz=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Jw=Oz.reduce((e,t)=>{const r=Zw(`Primitive.${t}`),n=S.forwardRef((i,o)=>{const{asChild:s,...u}=i,f=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(f,{...u,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),kg={exports:{}},Rg={};/** + * @license React + * use-sync-external-store-shim.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var TE;function Ez(){if(TE)return Rg;TE=1;var e=jp();function t(p,m){return p===m&&(p!==0||1/p===1/m)||p!==p&&m!==m}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,i=e.useEffect,o=e.useLayoutEffect,s=e.useDebugValue;function u(p,m){var g=m(),b=n({inst:{value:g,getSnapshot:m}}),y=b[0].inst,w=b[1];return o(function(){y.value=g,y.getSnapshot=m,f(y)&&w({inst:y})},[p,g,m]),i(function(){return f(y)&&w({inst:y}),p(function(){f(y)&&w({inst:y})})},[p]),s(g),g}function f(p){var m=p.getSnapshot;p=p.value;try{var g=m();return!r(p,g)}catch{return!0}}function l(p,m){return m()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?l:u;return Rg.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:h,Rg}var kE;function Pz(){return kE||(kE=1,kg.exports=Ez()),kg.exports}var Nz=Pz();function Az(){return Nz.useSyncExternalStore(Cz,()=>!0,()=>!1)}function Cz(){return()=>{}}var eS="Avatar",[Tz]=_z(eS),[kz,VM]=Tz(eS),GM=S.forwardRef((e,t)=>{const{__scopeAvatar:r,...n}=e,[i,o]=S.useState("idle");return d.jsx(kz,{scope:r,imageLoadingStatus:i,onImageLoadingStatusChange:o,children:d.jsx(Jw.span,{...n,ref:t})})});GM.displayName=eS;var KM="AvatarImage",XM=S.forwardRef((e,t)=>{const{__scopeAvatar:r,src:n,onLoadingStatusChange:i=()=>{},...o}=e,s=VM(KM,r),u=Rz(n,o),f=fr(l=>{i(l),s.onImageLoadingStatusChange(l)});return Lt(()=>{u!=="idle"&&f(u)},[u,f]),u==="loaded"?d.jsx(Jw.img,{...o,ref:t,src:n}):null});XM.displayName=KM;var YM="AvatarFallback",QM=S.forwardRef((e,t)=>{const{__scopeAvatar:r,delayMs:n,...i}=e,o=VM(YM,r),[s,u]=S.useState(n===void 0);return S.useEffect(()=>{if(n!==void 0){const f=window.setTimeout(()=>u(!0),n);return()=>window.clearTimeout(f)}},[n]),s&&o.imageLoadingStatus!=="loaded"?d.jsx(Jw.span,{...i,ref:t}):null});QM.displayName=YM;function RE(e,t){return e?t?(e.src!==t&&(e.src=t),e.complete&&e.naturalWidth>0?"loaded":"loading"):"error":"idle"}function Rz(e,{referrerPolicy:t,crossOrigin:r}){const n=Az(),i=S.useRef(null),o=n?(i.current||(i.current=new window.Image),i.current):null,[s,u]=S.useState(()=>RE(o,e));return Lt(()=>{u(RE(o,e))},[o,e]),Lt(()=>{const f=p=>()=>{u(p)};if(!o)return;const l=f("loaded"),h=f("error");return o.addEventListener("load",l),o.addEventListener("error",h),t&&(o.referrerPolicy=t),typeof r=="string"&&(o.crossOrigin=r),()=>{o.removeEventListener("load",l),o.removeEventListener("error",h)}},[o,r,t]),s}var Mz=GM,Iz=XM,Dz=QM;function Lz({className:e,...t}){return d.jsx(Mz,{"data-slot":"avatar",className:Re("relative flex size-10 shrink-0 overflow-hidden rounded-full",e),...t})}function $z({className:e,...t}){return d.jsx(Iz,{"data-slot":"avatar-image",className:Re("aspect-square size-full",e),...t})}function Bz({className:e,...t}){return d.jsx(Dz,{"data-slot":"avatar-fallback",className:Re("bg-muted flex size-full items-center justify-center rounded-full",e),...t})}function Fz({title:e}){const t=new Date().toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"});return d.jsxs("header",{className:"bg-white border-b border-gray-200 px-8 flex items-center justify-between shadow-sm sticky top-0 z-10 shrink-0",style:{height:90},children:[d.jsxs("div",{children:[d.jsxs("h1",{className:"text-2xl font-bold",style:{color:"rgb(43, 50, 143)"},children:[e," Overview"]}),d.jsxs("p",{className:"text-sm text-gray-500 mt-1 flex items-center gap-2",children:[t," | Last updated: Just now"]})]}),d.jsxs("div",{className:"flex items-center gap-4",children:[d.jsxs("div",{className:"flex items-center w-64 h-9 rounded-md border border-gray-200 bg-gray-50 focus-within:bg-white focus-within:ring-2 focus-within:ring-ring/50 focus-within:border-ring transition-colors overflow-hidden",children:[d.jsx(Vw,{className:"h-4 w-4 text-gray-400 shrink-0 ml-3 pointer-events-none"}),d.jsx(Se,{type:"search",placeholder:"Search...",className:"flex-1 min-w-0 border-0 bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0 py-2 px-2 h-full"})]}),d.jsx(we,{variant:"ghost",size:"icon",className:"text-gray-500 hover:text-gray-700",children:d.jsx(sh,{className:"w-5 h-5"})}),d.jsx("div",{className:"h-8 w-px bg-gray-200 mx-2"}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsxs("div",{className:"text-right hidden md:block",children:[d.jsx("div",{className:"text-sm font-medium text-gray-900",children:"Admin User"}),d.jsx("div",{className:"text-xs text-gray-500",children:"Administrator"})]}),d.jsxs(Lz,{className:"h-10 w-10 border border-gray-200",children:[d.jsx($z,{src:"https://github.com/shadcn.png"}),d.jsx(Bz,{children:"AD"})]})]})]})]})}function zz({children:e,currentView:t,setCurrentView:r}){return d.jsxs("div",{className:"flex h-screen bg-gray-50 overflow-hidden font-sans",children:[d.jsx(mz,{currentView:t,setCurrentView:r}),d.jsxs("div",{className:"flex-1 flex flex-col min-w-0 overflow-hidden",children:[d.jsx(Fz,{title:t}),d.jsx("div",{className:"px-8 mt-8 shrink-0",children:d.jsxs("nav",{className:"flex items-center gap-2 text-sm font-normal","aria-label":"Breadcrumb",children:[d.jsx("button",{type:"button",onClick:()=>r("Dashboard"),className:"text-gray-500 hover:text-gray-700 transition-colors",children:"Home"}),d.jsx(bs,{className:"w-4 h-4 text-gray-500 shrink-0"}),d.jsx("span",{style:{color:"rgb(43, 50, 143)"},children:t})]})}),d.jsx("main",{className:"flex-1 overflow-y-auto p-8",children:d.jsx("div",{className:"w-full h-full",children:e})})]})]})}function Vr({className:e,...t}){return d.jsx("div",{"data-slot":"card",className:Re("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border",e),...t})}function Tn({className:e,...t}){return d.jsx("div",{"data-slot":"card-header",className:Re("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 pt-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...t})}function kn({className:e,...t}){return d.jsx("h4",{"data-slot":"card-title",className:Re("leading-none",e),...t})}function hh({className:e,...t}){return d.jsx("p",{"data-slot":"card-description",className:Re("text-muted-foreground",e),...t})}function dn({className:e,...t}){return d.jsx("div",{"data-slot":"card-content",className:Re("px-6 [&:last-child]:pb-6",e),...t})}const qz=WM("inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function Gn({className:e,variant:t,asChild:r=!1,...n}){const i=r?UM:"span";return d.jsx(i,{"data-slot":"badge",className:Re(qz({variant:t}),e),...n})}var Mg,ME;function Ir(){if(ME)return Mg;ME=1;var e=Array.isArray;return Mg=e,Mg}var Ig,IE;function ZM(){if(IE)return Ig;IE=1;var e=typeof Xf=="object"&&Xf&&Xf.Object===Object&&Xf;return Ig=e,Ig}var Dg,DE;function oi(){if(DE)return Dg;DE=1;var e=ZM(),t=typeof self=="object"&&self&&self.Object===Object&&self,r=e||t||Function("return this")();return Dg=r,Dg}var Lg,LE;function mu(){if(LE)return Lg;LE=1;var e=oi(),t=e.Symbol;return Lg=t,Lg}var $g,$E;function Uz(){if($E)return $g;$E=1;var e=mu(),t=Object.prototype,r=t.hasOwnProperty,n=t.toString,i=e?e.toStringTag:void 0;function o(s){var u=r.call(s,i),f=s[i];try{s[i]=void 0;var l=!0}catch{}var h=n.call(s);return l&&(u?s[i]=f:delete s[i]),h}return $g=o,$g}var Bg,BE;function Wz(){if(BE)return Bg;BE=1;var e=Object.prototype,t=e.toString;function r(n){return t.call(n)}return Bg=r,Bg}var Fg,FE;function Ii(){if(FE)return Fg;FE=1;var e=mu(),t=Uz(),r=Wz(),n="[object Null]",i="[object Undefined]",o=e?e.toStringTag:void 0;function s(u){return u==null?u===void 0?i:n:o&&o in Object(u)?t(u):r(u)}return Fg=s,Fg}var zg,zE;function Di(){if(zE)return zg;zE=1;function e(t){return t!=null&&typeof t=="object"}return zg=e,zg}var qg,qE;function tl(){if(qE)return qg;qE=1;var e=Ii(),t=Di(),r="[object Symbol]";function n(i){return typeof i=="symbol"||t(i)&&e(i)==r}return qg=n,qg}var Ug,UE;function tS(){if(UE)return Ug;UE=1;var e=Ir(),t=tl(),r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function i(o,s){if(e(o))return!1;var u=typeof o;return u=="number"||u=="symbol"||u=="boolean"||o==null||t(o)?!0:n.test(o)||!r.test(o)||s!=null&&o in Object(s)}return Ug=i,Ug}var Wg,WE;function vo(){if(WE)return Wg;WE=1;function e(t){var r=typeof t;return t!=null&&(r=="object"||r=="function")}return Wg=e,Wg}var Hg,HE;function rS(){if(HE)return Hg;HE=1;var e=Ii(),t=vo(),r="[object AsyncFunction]",n="[object Function]",i="[object GeneratorFunction]",o="[object Proxy]";function s(u){if(!t(u))return!1;var f=e(u);return f==n||f==i||f==r||f==o}return Hg=s,Hg}var Vg,VE;function Hz(){if(VE)return Vg;VE=1;var e=oi(),t=e["__core-js_shared__"];return Vg=t,Vg}var Gg,GE;function Vz(){if(GE)return Gg;GE=1;var e=Hz(),t=(function(){var n=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""})();function r(n){return!!t&&t in n}return Gg=r,Gg}var Kg,KE;function JM(){if(KE)return Kg;KE=1;var e=Function.prototype,t=e.toString;function r(n){if(n!=null){try{return t.call(n)}catch{}try{return n+""}catch{}}return""}return Kg=r,Kg}var Xg,XE;function Gz(){if(XE)return Xg;XE=1;var e=rS(),t=Vz(),r=vo(),n=JM(),i=/[\\^$.*+?()[\]{}|]/g,o=/^\[object .+?Constructor\]$/,s=Function.prototype,u=Object.prototype,f=s.toString,l=u.hasOwnProperty,h=RegExp("^"+f.call(l).replace(i,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function p(m){if(!r(m)||t(m))return!1;var g=e(m)?h:o;return g.test(n(m))}return Xg=p,Xg}var Yg,YE;function Kz(){if(YE)return Yg;YE=1;function e(t,r){return t?.[r]}return Yg=e,Yg}var Qg,QE;function pa(){if(QE)return Qg;QE=1;var e=Gz(),t=Kz();function r(n,i){var o=t(n,i);return e(o)?o:void 0}return Qg=r,Qg}var Zg,ZE;function Ap(){if(ZE)return Zg;ZE=1;var e=pa(),t=e(Object,"create");return Zg=t,Zg}var Jg,JE;function Xz(){if(JE)return Jg;JE=1;var e=Ap();function t(){this.__data__=e?e(null):{},this.size=0}return Jg=t,Jg}var ey,eP;function Yz(){if(eP)return ey;eP=1;function e(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r}return ey=e,ey}var ty,tP;function Qz(){if(tP)return ty;tP=1;var e=Ap(),t="__lodash_hash_undefined__",r=Object.prototype,n=r.hasOwnProperty;function i(o){var s=this.__data__;if(e){var u=s[o];return u===t?void 0:u}return n.call(s,o)?s[o]:void 0}return ty=i,ty}var ry,rP;function Zz(){if(rP)return ry;rP=1;var e=Ap(),t=Object.prototype,r=t.hasOwnProperty;function n(i){var o=this.__data__;return e?o[i]!==void 0:r.call(o,i)}return ry=n,ry}var ny,nP;function Jz(){if(nP)return ny;nP=1;var e=Ap(),t="__lodash_hash_undefined__";function r(n,i){var o=this.__data__;return this.size+=this.has(n)?0:1,o[n]=e&&i===void 0?t:i,this}return ny=r,ny}var iy,iP;function eq(){if(iP)return iy;iP=1;var e=Xz(),t=Yz(),r=Qz(),n=Zz(),i=Jz();function o(s){var u=-1,f=s==null?0:s.length;for(this.clear();++u-1}return uy=t,uy}var fy,fP;function oq(){if(fP)return fy;fP=1;var e=Cp();function t(r,n){var i=this.__data__,o=e(i,r);return o<0?(++this.size,i.push([r,n])):i[o][1]=n,this}return fy=t,fy}var dy,dP;function Tp(){if(dP)return dy;dP=1;var e=tq(),t=rq(),r=nq(),n=iq(),i=oq();function o(s){var u=-1,f=s==null?0:s.length;for(this.clear();++u0?1:-1},Go=function(t){return ea(t)&&t.indexOf("%")===t.length-1},be=function(t){return Nq(t)&&!vu(t)},Aq=function(t){return We(t)},Ht=function(t){return be(t)||ea(t)},Cq=0,nl=function(t){var r=++Cq;return"".concat(t||"").concat(r)},yr=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!be(t)&&!ea(t))return n;var o;if(Go(t)){var s=t.indexOf("%");o=r*parseFloat(t.slice(0,s))/100}else o=+t;return vu(o)&&(o=n),i&&o>r&&(o=r),o},lo=function(t){if(!t)return null;var r=Object.keys(t);return r&&r.length?t[r[0]]:null},Tq=function(t){if(!Array.isArray(t))return!1;for(var r=t.length,n={},i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function $q(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function r1(e){"@babel/helpers - typeof";return r1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r1(e)}var FP={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},Ei=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},zP=null,$y=null,cS=function e(t){if(t===zP&&Array.isArray($y))return $y;var r=[];return S.Children.forEach(t,function(n){We(n)||(jq.isFragment(n)?r=r.concat(e(n.props.children)):r.push(n))}),$y=r,zP=t,r};function Zr(e,t){var r=[],n=[];return Array.isArray(t)?n=t.map(function(i){return Ei(i)}):n=[Ei(t)],cS(e).forEach(function(i){var o=Qr(i,"type.displayName")||Qr(i,"type.name");n.indexOf(o)!==-1&&r.push(i)}),r}function Hr(e,t){var r=Zr(e,t);return r&&r[0]}var qP=function(t){if(!t||!t.props)return!1;var r=t.props,n=r.width,i=r.height;return!(!be(n)||n<=0||!be(i)||i<=0)},Bq=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],Fq=function(t){return t&&t.type&&ea(t.type)&&Bq.indexOf(t.type)>=0},zq=function(t){return t&&r1(t)==="object"&&"clipDot"in t},qq=function(t,r,n,i){var o,s=(o=Ly?.[i])!==null&&o!==void 0?o:[];return r.startsWith("data-")||!qe(t)&&(i&&s.includes(r)||Mq.includes(r))||n&&lS.includes(r)},Be=function(t,r,n){if(!t||typeof t=="function"||typeof t=="boolean")return null;var i=t;if(S.isValidElement(t)&&(i=t.props),!rl(i))return null;var o={};return Object.keys(i).forEach(function(s){var u;qq((u=i)===null||u===void 0?void 0:u[s],s,r,n)&&(o[s]=i[s])}),o},n1=function e(t,r){if(t===r)return!0;var n=S.Children.count(t);if(n!==S.Children.count(r))return!1;if(n===0)return!0;if(n===1)return UP(Array.isArray(t)?t[0]:t,Array.isArray(r)?r[0]:r);for(var i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Gq(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function o1(e){var t=e.children,r=e.width,n=e.height,i=e.viewBox,o=e.className,s=e.style,u=e.title,f=e.desc,l=Vq(e,Hq),h=i||{width:r,height:n,x:0,y:0},p=He("recharts-surface",o);return z.createElement("svg",i1({},Be(l,!0,"svg"),{className:p,width:r,height:n,style:s,viewBox:"".concat(h.x," ").concat(h.y," ").concat(h.width," ").concat(h.height)}),z.createElement("title",null,u),z.createElement("desc",null,f),t)}var Kq=["children","className"];function a1(){return a1=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Yq(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var at=z.forwardRef(function(e,t){var r=e.children,n=e.className,i=Xq(e,Kq),o=He("recharts-layer",n);return z.createElement("g",a1({className:o},Be(i,!0),{ref:t}),r)}),Dn=function(t,r){for(var n=arguments.length,i=new Array(n>2?n-2:0),o=2;oo?0:o+r),n=n>o?o:n,n<0&&(n+=o),o=r>n?0:n-r>>>0,r>>>=0;for(var s=Array(o);++i=o?r:e(r,n,i)}return Fy=t,Fy}var zy,GP;function oI(){if(GP)return zy;GP=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",i=t+r+n,o="\\ufe0e\\ufe0f",s="\\u200d",u=RegExp("["+s+e+i+o+"]");function f(l){return u.test(l)}return zy=f,zy}var qy,KP;function Jq(){if(KP)return qy;KP=1;function e(t){return t.split("")}return qy=e,qy}var Uy,XP;function e9(){if(XP)return Uy;XP=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",r="\\ufe20-\\ufe2f",n="\\u20d0-\\u20ff",i=t+r+n,o="\\ufe0e\\ufe0f",s="["+e+"]",u="["+i+"]",f="\\ud83c[\\udffb-\\udfff]",l="(?:"+u+"|"+f+")",h="[^"+e+"]",p="(?:\\ud83c[\\udde6-\\uddff]){2}",m="[\\ud800-\\udbff][\\udc00-\\udfff]",g="\\u200d",b=l+"?",y="["+o+"]?",w="(?:"+g+"(?:"+[h,p,m].join("|")+")"+y+b+")*",j=y+b+w,O="(?:"+[h+u+"?",u,p,m,s].join("|")+")",E=RegExp(f+"(?="+f+")|"+O+j,"g");function A(N){return N.match(E)||[]}return Uy=A,Uy}var Wy,YP;function t9(){if(YP)return Wy;YP=1;var e=Jq(),t=oI(),r=e9();function n(i){return t(i)?r(i):e(i)}return Wy=n,Wy}var Hy,QP;function r9(){if(QP)return Hy;QP=1;var e=Zq(),t=oI(),r=t9(),n=tI();function i(o){return function(s){s=n(s);var u=t(s)?r(s):void 0,f=u?u[0]:s.charAt(0),l=u?e(u,1).join(""):s.slice(1);return f[o]()+l}}return Hy=i,Hy}var Vy,ZP;function n9(){if(ZP)return Vy;ZP=1;var e=r9(),t=e("toUpperCase");return Vy=t,Vy}var i9=n9();const Mp=ct(i9);function yt(e){return function(){return e}}const aI=Math.cos,vh=Math.sin,Fn=Math.sqrt,gh=Math.PI,Ip=2*gh,s1=Math.PI,l1=2*s1,Wo=1e-6,o9=l1-Wo;function sI(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return sI;const r=10**t;return function(n){this._+=n[0];for(let i=1,o=n.length;iWo)if(!(Math.abs(p*f-l*h)>Wo)||!o)this._append`L${this._x1=t},${this._y1=r}`;else{let g=n-s,b=i-u,y=f*f+l*l,w=g*g+b*b,j=Math.sqrt(y),O=Math.sqrt(m),E=o*Math.tan((s1-Math.acos((y+m-w)/(2*j*O)))/2),A=E/O,N=E/j;Math.abs(A-1)>Wo&&this._append`L${t+A*h},${r+A*p}`,this._append`A${o},${o},0,0,${+(p*g>h*b)},${this._x1=t+N*f},${this._y1=r+N*l}`}}arc(t,r,n,i,o,s){if(t=+t,r=+r,n=+n,s=!!s,n<0)throw new Error(`negative radius: ${n}`);let u=n*Math.cos(i),f=n*Math.sin(i),l=t+u,h=r+f,p=1^s,m=s?i-o:o-i;this._x1===null?this._append`M${l},${h}`:(Math.abs(this._x1-l)>Wo||Math.abs(this._y1-h)>Wo)&&this._append`L${l},${h}`,n&&(m<0&&(m=m%l1+l1),m>o9?this._append`A${n},${n},0,1,${p},${t-u},${r-f}A${n},${n},0,1,${p},${this._x1=l},${this._y1=h}`:m>Wo&&this._append`A${n},${n},0,${+(m>=s1)},${p},${this._x1=t+n*Math.cos(o)},${this._y1=r+n*Math.sin(o)}`)}rect(t,r,n,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+i}h${-n}Z`}toString(){return this._}}function uS(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new s9(t)}function fS(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function lI(e){this._context=e}lI.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Dp(e){return new lI(e)}function cI(e){return e[0]}function uI(e){return e[1]}function fI(e,t){var r=yt(!0),n=null,i=Dp,o=null,s=uS(u);e=typeof e=="function"?e:e===void 0?cI:yt(e),t=typeof t=="function"?t:t===void 0?uI:yt(t);function u(f){var l,h=(f=fS(f)).length,p,m=!1,g;for(n==null&&(o=i(g=s())),l=0;l<=h;++l)!(l=g;--b)u.point(E[b],A[b]);u.lineEnd(),u.areaEnd()}j&&(E[m]=+e(w,m,p),A[m]=+t(w,m,p),u.point(n?+n(w,m,p):E[m],r?+r(w,m,p):A[m]))}if(O)return u=null,O+""||null}function h(){return fI().defined(i).curve(s).context(o)}return l.x=function(p){return arguments.length?(e=typeof p=="function"?p:yt(+p),n=null,l):e},l.x0=function(p){return arguments.length?(e=typeof p=="function"?p:yt(+p),l):e},l.x1=function(p){return arguments.length?(n=p==null?null:typeof p=="function"?p:yt(+p),l):n},l.y=function(p){return arguments.length?(t=typeof p=="function"?p:yt(+p),r=null,l):t},l.y0=function(p){return arguments.length?(t=typeof p=="function"?p:yt(+p),l):t},l.y1=function(p){return arguments.length?(r=p==null?null:typeof p=="function"?p:yt(+p),l):r},l.lineX0=l.lineY0=function(){return h().x(e).y(t)},l.lineY1=function(){return h().x(e).y(r)},l.lineX1=function(){return h().x(n).y(t)},l.defined=function(p){return arguments.length?(i=typeof p=="function"?p:yt(!!p),l):i},l.curve=function(p){return arguments.length?(s=p,o!=null&&(u=s(o)),l):s},l.context=function(p){return arguments.length?(p==null?o=u=null:u=s(o=p),l):o},l}class dI{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function l9(e){return new dI(e,!0)}function c9(e){return new dI(e,!1)}const dS={draw(e,t){const r=Fn(t/gh);e.moveTo(r,0),e.arc(0,0,r,0,Ip)}},u9={draw(e,t){const r=Fn(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},hI=Fn(1/3),f9=hI*2,d9={draw(e,t){const r=Fn(t/f9),n=r*hI;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},h9={draw(e,t){const r=Fn(t),n=-r/2;e.rect(n,n,r,r)}},p9=.8908130915292852,pI=vh(gh/10)/vh(7*gh/10),m9=vh(Ip/10)*pI,v9=-aI(Ip/10)*pI,g9={draw(e,t){const r=Fn(t*p9),n=m9*r,i=v9*r;e.moveTo(0,-r),e.lineTo(n,i);for(let o=1;o<5;++o){const s=Ip*o/5,u=aI(s),f=vh(s);e.lineTo(f*r,-u*r),e.lineTo(u*n-f*i,f*n+u*i)}e.closePath()}},Gy=Fn(3),y9={draw(e,t){const r=-Fn(t/(Gy*3));e.moveTo(0,r*2),e.lineTo(-Gy*r,-r),e.lineTo(Gy*r,-r),e.closePath()}},ln=-.5,cn=Fn(3)/2,c1=1/Fn(12),x9=(c1/2+1)*3,b9={draw(e,t){const r=Fn(t/x9),n=r/2,i=r*c1,o=n,s=r*c1+r,u=-o,f=s;e.moveTo(n,i),e.lineTo(o,s),e.lineTo(u,f),e.lineTo(ln*n-cn*i,cn*n+ln*i),e.lineTo(ln*o-cn*s,cn*o+ln*s),e.lineTo(ln*u-cn*f,cn*u+ln*f),e.lineTo(ln*n+cn*i,ln*i-cn*n),e.lineTo(ln*o+cn*s,ln*s-cn*o),e.lineTo(ln*u+cn*f,ln*f-cn*u),e.closePath()}};function w9(e,t){let r=null,n=uS(i);e=typeof e=="function"?e:yt(e||dS),t=typeof t=="function"?t:yt(t===void 0?64:+t);function i(){let o;if(r||(r=o=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),o)return r=null,o+""||null}return i.type=function(o){return arguments.length?(e=typeof o=="function"?o:yt(o),i):e},i.size=function(o){return arguments.length?(t=typeof o=="function"?o:yt(+o),i):t},i.context=function(o){return arguments.length?(r=o??null,i):r},i}function yh(){}function xh(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function mI(e){this._context=e}mI.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:xh(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:xh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function S9(e){return new mI(e)}function vI(e){this._context=e}vI.prototype={areaStart:yh,areaEnd:yh,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:xh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function _9(e){return new vI(e)}function gI(e){this._context=e}gI.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:xh(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function j9(e){return new gI(e)}function yI(e){this._context=e}yI.prototype={areaStart:yh,areaEnd:yh,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function O9(e){return new yI(e)}function JP(e){return e<0?-1:1}function e2(e,t,r){var n=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(n||i<0&&-0),s=(r-e._y1)/(i||n<0&&-0),u=(o*i+s*n)/(n+i);return(JP(o)+JP(s))*Math.min(Math.abs(o),Math.abs(s),.5*Math.abs(u))||0}function t2(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Ky(e,t,r){var n=e._x0,i=e._y0,o=e._x1,s=e._y1,u=(o-n)/3;e._context.bezierCurveTo(n+u,i+u*t,o-u,s-u*r,o,s)}function bh(e){this._context=e}bh.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Ky(this,this._t0,t2(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Ky(this,t2(this,r=e2(this,e,t)),r);break;default:Ky(this,this._t0,r=e2(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function xI(e){this._context=new bI(e)}(xI.prototype=Object.create(bh.prototype)).point=function(e,t){bh.prototype.point.call(this,t,e)};function bI(e){this._context=e}bI.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,i,o){this._context.bezierCurveTo(t,e,n,r,o,i)}};function E9(e){return new bh(e)}function P9(e){return new xI(e)}function wI(e){this._context=e}wI.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=r2(e),i=r2(t),o=0,s=1;s=0;--t)i[t]=(s[t]-i[t+1])/o[t];for(o[r-1]=(e[r]+i[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function A9(e){return new Lp(e,.5)}function C9(e){return new Lp(e,0)}function T9(e){return new Lp(e,1)}function js(e,t){if((s=e.length)>1)for(var r=1,n,i,o=e[t[0]],s,u=o.length;r=0;)r[t]=t;return r}function k9(e,t){return e[t]}function R9(e){const t=[];return t.key=e,t}function M9(){var e=yt([]),t=u1,r=js,n=k9;function i(o){var s=Array.from(e.apply(this,arguments),R9),u,f=s.length,l=-1,h;for(const p of o)for(u=0,++l;u0){for(var r,n,i=0,o=e[0].length,s;i0){for(var r=0,n=e[t[0]],i,o=n.length;r0)||!((o=(i=e[t[0]]).length)>0))){for(var r=0,n=1,i,o,s;n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function U9(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var SI={symbolCircle:dS,symbolCross:u9,symbolDiamond:d9,symbolSquare:h9,symbolStar:g9,symbolTriangle:y9,symbolWye:b9},W9=Math.PI/180,H9=function(t){var r="symbol".concat(Mp(t));return SI[r]||dS},V9=function(t,r,n){if(r==="area")return t;switch(n){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var i=18*W9;return 1.25*t*t*(Math.tan(i)-Math.tan(i*2)*Math.pow(Math.tan(i),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},G9=function(t,r){SI["symbol".concat(Mp(t))]=r},hS=function(t){var r=t.type,n=r===void 0?"circle":r,i=t.size,o=i===void 0?64:i,s=t.sizeType,u=s===void 0?"area":s,f=q9(t,$9),l=i2(i2({},f),{},{type:n,size:o,sizeType:u}),h=function(){var w=H9(n),j=w9().type(w).size(V9(o,u,n));return j()},p=l.className,m=l.cx,g=l.cy,b=Be(l,!0);return m===+m&&g===+g&&o===+o?z.createElement("path",f1({},b,{className:He("recharts-symbols",p),transform:"translate(".concat(m,", ").concat(g,")"),d:h()})):null};hS.registerSymbol=G9;function Os(e){"@babel/helpers - typeof";return Os=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Os(e)}function d1(){return d1=Object.assign?Object.assign.bind():function(e){for(var t=1;t`);var O=g.inactive?l:g.color;return z.createElement("li",d1({className:w,style:p,key:"legend-item-".concat(b)},ta(n.props,g,b)),z.createElement(o1,{width:s,height:s,viewBox:h,style:m},n.renderIcon(g)),z.createElement("span",{className:"recharts-legend-item-text",style:{color:O}},y?y(j,g,b):j))})}},{key:"render",value:function(){var n=this.props,i=n.payload,o=n.layout,s=n.align;if(!i||!i.length)return null;var u={padding:0,margin:0,textAlign:o==="horizontal"?s:"left"};return z.createElement("ul",{className:"recharts-default-legend",style:u},this.renderItems())}}])})(S.PureComponent);Cc(pS,"displayName","Legend");Cc(pS,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Xy,a2;function nU(){if(a2)return Xy;a2=1;var e=Tp();function t(){this.__data__=new e,this.size=0}return Xy=t,Xy}var Yy,s2;function iU(){if(s2)return Yy;s2=1;function e(t){var r=this.__data__,n=r.delete(t);return this.size=r.size,n}return Yy=e,Yy}var Qy,l2;function oU(){if(l2)return Qy;l2=1;function e(t){return this.__data__.get(t)}return Qy=e,Qy}var Zy,c2;function aU(){if(c2)return Zy;c2=1;function e(t){return this.__data__.has(t)}return Zy=e,Zy}var Jy,u2;function sU(){if(u2)return Jy;u2=1;var e=Tp(),t=iS(),r=oS(),n=200;function i(o,s){var u=this.__data__;if(u instanceof e){var f=u.__data__;if(!t||f.lengthg))return!1;var y=p.get(s),w=p.get(u);if(y&&w)return y==u&&w==s;var j=-1,O=!0,E=f&i?new e:void 0;for(p.set(s,u),p.set(u,s);++j-1&&n%1==0&&n-1&&r%1==0&&r<=e}return w0=t,w0}var S0,M2;function bU(){if(M2)return S0;M2=1;var e=Ii(),t=yS(),r=Di(),n="[object Arguments]",i="[object Array]",o="[object Boolean]",s="[object Date]",u="[object Error]",f="[object Function]",l="[object Map]",h="[object Number]",p="[object Object]",m="[object RegExp]",g="[object Set]",b="[object String]",y="[object WeakMap]",w="[object ArrayBuffer]",j="[object DataView]",O="[object Float32Array]",E="[object Float64Array]",A="[object Int8Array]",N="[object Int16Array]",C="[object Int32Array]",T="[object Uint8Array]",R="[object Uint8ClampedArray]",I="[object Uint16Array]",F="[object Uint32Array]",L={};L[O]=L[E]=L[A]=L[N]=L[C]=L[T]=L[R]=L[I]=L[F]=!0,L[n]=L[i]=L[w]=L[o]=L[j]=L[s]=L[u]=L[f]=L[l]=L[h]=L[p]=L[m]=L[g]=L[b]=L[y]=!1;function $(U){return r(U)&&t(U.length)&&!!L[e(U)]}return S0=$,S0}var _0,I2;function kI(){if(I2)return _0;I2=1;function e(t){return function(r){return t(r)}}return _0=e,_0}var vc={exports:{}};vc.exports;var D2;function wU(){return D2||(D2=1,(function(e,t){var r=ZM(),n=t&&!t.nodeType&&t,i=n&&!0&&e&&!e.nodeType&&e,o=i&&i.exports===n,s=o&&r.process,u=(function(){try{var f=i&&i.require&&i.require("util").types;return f||s&&s.binding&&s.binding("util")}catch{}})();e.exports=u})(vc,vc.exports)),vc.exports}var j0,L2;function RI(){if(L2)return j0;L2=1;var e=bU(),t=kI(),r=wU(),n=r&&r.isTypedArray,i=n?t(n):e;return j0=i,j0}var O0,$2;function SU(){if($2)return O0;$2=1;var e=gU(),t=vS(),r=Ir(),n=TI(),i=gS(),o=RI(),s=Object.prototype,u=s.hasOwnProperty;function f(l,h){var p=r(l),m=!p&&t(l),g=!p&&!m&&n(l),b=!p&&!m&&!g&&o(l),y=p||m||g||b,w=y?e(l.length,String):[],j=w.length;for(var O in l)(h||u.call(l,O))&&!(y&&(O=="length"||g&&(O=="offset"||O=="parent")||b&&(O=="buffer"||O=="byteLength"||O=="byteOffset")||i(O,j)))&&w.push(O);return w}return O0=f,O0}var E0,B2;function _U(){if(B2)return E0;B2=1;var e=Object.prototype;function t(r){var n=r&&r.constructor,i=typeof n=="function"&&n.prototype||e;return r===i}return E0=t,E0}var P0,F2;function MI(){if(F2)return P0;F2=1;function e(t,r){return function(n){return t(r(n))}}return P0=e,P0}var N0,z2;function jU(){if(z2)return N0;z2=1;var e=MI(),t=e(Object.keys,Object);return N0=t,N0}var A0,q2;function OU(){if(q2)return A0;q2=1;var e=_U(),t=jU(),r=Object.prototype,n=r.hasOwnProperty;function i(o){if(!e(o))return t(o);var s=[];for(var u in Object(o))n.call(o,u)&&u!="constructor"&&s.push(u);return s}return A0=i,A0}var C0,U2;function gu(){if(U2)return C0;U2=1;var e=rS(),t=yS();function r(n){return n!=null&&t(n.length)&&!e(n)}return C0=r,C0}var T0,W2;function $p(){if(W2)return T0;W2=1;var e=SU(),t=OU(),r=gu();function n(i){return r(i)?e(i):t(i)}return T0=n,T0}var k0,H2;function EU(){if(H2)return k0;H2=1;var e=hU(),t=vU(),r=$p();function n(i){return e(i,r,t)}return k0=n,k0}var R0,V2;function PU(){if(V2)return R0;V2=1;var e=EU(),t=1,r=Object.prototype,n=r.hasOwnProperty;function i(o,s,u,f,l,h){var p=u&t,m=e(o),g=m.length,b=e(s),y=b.length;if(g!=y&&!p)return!1;for(var w=g;w--;){var j=m[w];if(!(p?j in s:n.call(s,j)))return!1}var O=h.get(o),E=h.get(s);if(O&&E)return O==s&&E==o;var A=!0;h.set(o,s),h.set(s,o);for(var N=p;++w-1}return ox=t,ox}var ax,xN;function GU(){if(xN)return ax;xN=1;function e(t,r,n){for(var i=-1,o=t==null?0:t.length;++i=s){var j=l?null:i(f);if(j)return o(j);b=!1,m=n,w=new e}else w=l?[]:y;e:for(;++p=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function l7(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function c7(e){return e.value}function u7(e,t){if(z.isValidElement(e))return z.cloneElement(e,t);if(typeof e=="function")return z.createElement(e,t);t.ref;var r=s7(t,JU);return z.createElement(pS,r)}var PN=1,ds=(function(e){function t(){var r;e7(this,t);for(var n=arguments.length,i=new Array(n),o=0;oPN||Math.abs(i.height-this.lastBoundingBox.height)>PN)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,n&&n(i)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?xi({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var i=this.props,o=i.layout,s=i.align,u=i.verticalAlign,f=i.margin,l=i.chartWidth,h=i.chartHeight,p,m;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(s==="center"&&o==="vertical"){var g=this.getBBoxSnapshot();p={left:((l||0)-g.width)/2}}else p=s==="right"?{right:f&&f.right||0}:{left:f&&f.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(u==="middle"){var b=this.getBBoxSnapshot();m={top:((h||0)-b.height)/2}}else m=u==="bottom"?{bottom:f&&f.bottom||0}:{top:f&&f.top||0};return xi(xi({},p),m)}},{key:"render",value:function(){var n=this,i=this.props,o=i.content,s=i.width,u=i.height,f=i.wrapperStyle,l=i.payloadUniqBy,h=i.payload,p=xi(xi({position:"absolute",width:s||"auto",height:u||"auto"},this.getDefaultPosition(f)),f);return z.createElement("div",{className:"recharts-legend-wrapper",style:p,ref:function(g){n.wrapperNode=g}},u7(o,xi(xi({},this.props),{},{payload:BI(h,l,c7)})))}}],[{key:"getWithHeight",value:function(n,i){var o=xi(xi({},this.defaultProps),n.props),s=o.layout;return s==="vertical"&&be(n.props.height)?{height:n.props.height}:s==="horizontal"?{width:n.props.width||i}:null}}])})(S.PureComponent);Bp(ds,"displayName","Legend");Bp(ds,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var fx,NN;function f7(){if(NN)return fx;NN=1;var e=mu(),t=vS(),r=Ir(),n=e?e.isConcatSpreadable:void 0;function i(o){return r(o)||t(o)||!!(n&&o&&o[n])}return fx=i,fx}var dx,AN;function qI(){if(AN)return dx;AN=1;var e=CI(),t=f7();function r(n,i,o,s,u){var f=-1,l=n.length;for(o||(o=t),u||(u=[]);++f0&&o(h)?i>1?r(h,i-1,o,s,u):e(u,h):s||(u[u.length]=h)}return u}return dx=r,dx}var hx,CN;function d7(){if(CN)return hx;CN=1;function e(t){return function(r,n,i){for(var o=-1,s=Object(r),u=i(r),f=u.length;f--;){var l=u[t?f:++o];if(n(s[l],l,s)===!1)break}return r}}return hx=e,hx}var px,TN;function h7(){if(TN)return px;TN=1;var e=d7(),t=e();return px=t,px}var mx,kN;function UI(){if(kN)return mx;kN=1;var e=h7(),t=$p();function r(n,i){return n&&e(n,i,t)}return mx=r,mx}var vx,RN;function p7(){if(RN)return vx;RN=1;var e=gu();function t(r,n){return function(i,o){if(i==null)return i;if(!e(i))return r(i,o);for(var s=i.length,u=n?s:-1,f=Object(i);(n?u--:++un||u&&f&&h&&!l&&!p||o&&f&&h||!i&&h||!s)return 1;if(!o&&!u&&!p&&r=l)return h;var p=i[o];return h*(p=="desc"?-1:1)}}return r.index-n.index}return wx=t,wx}var Sx,BN;function y7(){if(BN)return Sx;BN=1;var e=aS(),t=sS(),r=ai(),n=WI(),i=m7(),o=kI(),s=g7(),u=il(),f=Ir();function l(h,p,m){p.length?p=e(p,function(y){return f(y)?function(w){return t(w,y.length===1?y[0]:y)}:y}):p=[u];var g=-1;p=e(p,o(r));var b=n(h,function(y,w,j){var O=e(p,function(E){return E(y)});return{criteria:O,index:++g,value:y}});return i(b,function(y,w){return s(y,w,m)})}return Sx=l,Sx}var _x,FN;function x7(){if(FN)return _x;FN=1;function e(t,r,n){switch(n.length){case 0:return t.call(r);case 1:return t.call(r,n[0]);case 2:return t.call(r,n[0],n[1]);case 3:return t.call(r,n[0],n[1],n[2])}return t.apply(r,n)}return _x=e,_x}var jx,zN;function b7(){if(zN)return jx;zN=1;var e=x7(),t=Math.max;function r(n,i,o){return i=t(i===void 0?n.length-1:i,0),function(){for(var s=arguments,u=-1,f=t(s.length-i,0),l=Array(f);++u0){if(++o>=e)return arguments[0]}else o=0;return i.apply(void 0,arguments)}}return Nx=n,Nx}var Ax,VN;function j7(){if(VN)return Ax;VN=1;var e=S7(),t=_7(),r=t(e);return Ax=r,Ax}var Cx,GN;function O7(){if(GN)return Cx;GN=1;var e=il(),t=b7(),r=j7();function n(i,o){return r(t(i,o,e),i+"")}return Cx=n,Cx}var Tx,KN;function Fp(){if(KN)return Tx;KN=1;var e=nS(),t=gu(),r=gS(),n=vo();function i(o,s,u){if(!n(u))return!1;var f=typeof s;return(f=="number"?t(u)&&r(s,u.length):f=="string"&&s in u)?e(u[s],o):!1}return Tx=i,Tx}var kx,XN;function E7(){if(XN)return kx;XN=1;var e=qI(),t=y7(),r=O7(),n=Fp(),i=r(function(o,s){if(o==null)return[];var u=s.length;return u>1&&n(o,s[0],s[1])?s=[]:u>2&&n(s[0],s[1],s[2])&&(s=[s[0]]),t(o,e(s,1),[])});return kx=i,kx}var P7=E7();const wS=ct(P7);function Tc(e){"@babel/helpers - typeof";return Tc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tc(e)}function m1(){return m1=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t.x),"".concat(ec,"-left"),be(r)&&t&&be(t.x)&&r=t.y),"".concat(ec,"-top"),be(n)&&t&&be(t.y)&&ny?Math.max(h,f[n]):Math.max(p,f[n])}function q7(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function U7(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTopLeft,i=e.position,o=e.reverseDirection,s=e.tooltipBox,u=e.useTranslate3d,f=e.viewBox,l,h,p;return s.height>0&&s.width>0&&r?(h=ZN({allowEscapeViewBox:t,coordinate:r,key:"x",offsetTopLeft:n,position:i,reverseDirection:o,tooltipDimension:s.width,viewBox:f,viewBoxDimension:f.width}),p=ZN({allowEscapeViewBox:t,coordinate:r,key:"y",offsetTopLeft:n,position:i,reverseDirection:o,tooltipDimension:s.height,viewBox:f,viewBoxDimension:f.height}),l=q7({translateX:h,translateY:p,useTranslate3d:u})):l=F7,{cssProperties:l,cssClasses:z7({translateX:h,translateY:p,coordinate:r})}}function Ps(e){"@babel/helpers - typeof";return Ps=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ps(e)}function JN(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function eA(e){for(var t=1;ttA||Math.abs(n.height-this.state.lastBoundingBox.height)>tA)&&this.setState({lastBoundingBox:{width:n.width,height:n.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var n,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,i=this.props,o=i.active,s=i.allowEscapeViewBox,u=i.animationDuration,f=i.animationEasing,l=i.children,h=i.coordinate,p=i.hasPayload,m=i.isAnimationActive,g=i.offset,b=i.position,y=i.reverseDirection,w=i.useTranslate3d,j=i.viewBox,O=i.wrapperStyle,E=U7({allowEscapeViewBox:s,coordinate:h,offsetTopLeft:g,position:b,reverseDirection:y,tooltipBox:this.state.lastBoundingBox,useTranslate3d:w,viewBox:j}),A=E.cssClasses,N=E.cssProperties,C=eA(eA({transition:m&&o?"transform ".concat(u,"ms ").concat(f):void 0},N),{},{pointerEvents:"none",visibility:!this.state.dismissed&&o&&p?"visible":"hidden",position:"absolute",top:0,left:0},O);return z.createElement("div",{tabIndex:-1,className:A,style:C,ref:function(R){n.wrapperNode=R}},l)}}])})(S.PureComponent),J7=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},ma={isSsr:J7()};function Ns(e){"@babel/helpers - typeof";return Ns=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ns(e)}function rA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function nA(e){for(var t=1;t0;return z.createElement(Z7,{allowEscapeViewBox:s,animationDuration:u,animationEasing:f,isAnimationActive:m,active:o,coordinate:h,hasPayload:C,offset:g,position:w,reverseDirection:j,useTranslate3d:O,viewBox:E,wrapperStyle:A},cW(l,nA(nA({},this.props),{},{payload:N})))}}])})(S.PureComponent);SS(Gr,"displayName","Tooltip");SS(Gr,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!ma.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var Mx,iA;function uW(){if(iA)return Mx;iA=1;var e=oi(),t=function(){return e.Date.now()};return Mx=t,Mx}var Ix,oA;function fW(){if(oA)return Ix;oA=1;var e=/\s/;function t(r){for(var n=r.length;n--&&e.test(r.charAt(n)););return n}return Ix=t,Ix}var Dx,aA;function dW(){if(aA)return Dx;aA=1;var e=fW(),t=/^\s+/;function r(n){return n&&n.slice(0,e(n)+1).replace(t,"")}return Dx=r,Dx}var Lx,sA;function YI(){if(sA)return Lx;sA=1;var e=dW(),t=vo(),r=tl(),n=NaN,i=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,s=/^0o[0-7]+$/i,u=parseInt;function f(l){if(typeof l=="number")return l;if(r(l))return n;if(t(l)){var h=typeof l.valueOf=="function"?l.valueOf():l;l=t(h)?h+"":h}if(typeof l!="string")return l===0?l:+l;l=e(l);var p=o.test(l);return p||s.test(l)?u(l.slice(2),p?2:8):i.test(l)?n:+l}return Lx=f,Lx}var $x,lA;function hW(){if(lA)return $x;lA=1;var e=vo(),t=uW(),r=YI(),n="Expected a function",i=Math.max,o=Math.min;function s(u,f,l){var h,p,m,g,b,y,w=0,j=!1,O=!1,E=!0;if(typeof u!="function")throw new TypeError(n);f=r(f)||0,e(l)&&(j=!!l.leading,O="maxWait"in l,m=O?i(r(l.maxWait)||0,f):m,E="trailing"in l?!!l.trailing:E);function A(U){var G=h,q=p;return h=p=void 0,w=U,g=u.apply(q,G),g}function N(U){return w=U,b=setTimeout(R,f),j?A(U):g}function C(U){var G=U-y,q=U-w,H=f-G;return O?o(H,m-q):H}function T(U){var G=U-y,q=U-w;return y===void 0||G>=f||G<0||O&&q>=m}function R(){var U=t();if(T(U))return I(U);b=setTimeout(R,C(U))}function I(U){return b=void 0,E&&h?A(U):(h=p=void 0,g)}function F(){b!==void 0&&clearTimeout(b),w=0,h=y=p=b=void 0}function L(){return b===void 0?g:I(t())}function $(){var U=t(),G=T(U);if(h=arguments,p=this,y=U,G){if(b===void 0)return N(y);if(O)return clearTimeout(b),b=setTimeout(R,f),A(y)}return b===void 0&&(b=setTimeout(R,f)),g}return $.cancel=F,$.flush=L,$}return $x=s,$x}var Bx,cA;function pW(){if(cA)return Bx;cA=1;var e=hW(),t=vo(),r="Expected a function";function n(i,o,s){var u=!0,f=!0;if(typeof i!="function")throw new TypeError(r);return t(s)&&(u="leading"in s?!!s.leading:u,f="trailing"in s?!!s.trailing:f),e(i,o,{leading:u,maxWait:o,trailing:f})}return Bx=n,Bx}var mW=pW();const QI=ct(mW);function Rc(e){"@babel/helpers - typeof";return Rc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rc(e)}function uA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function rd(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(U=QI(U,y,{trailing:!0,leading:!1}));var G=new ResizeObserver(U),q=N.current.getBoundingClientRect(),H=q.width,V=q.height;return L(H,V),G.observe(N.current),function(){G.disconnect()}},[L,y]);var $=S.useMemo(function(){var U=I.containerWidth,G=I.containerHeight;if(U<0||G<0)return null;Dn(Go(s)||Go(f),`The width(%s) and height(%s) are both fixed numbers, + maybe you don't need to use a ResponsiveContainer.`,s,f),Dn(!r||r>0,"The aspect(%s) must be greater than zero.",r);var q=Go(s)?U:s,H=Go(f)?G:f;r&&r>0&&(q?H=q/r:H&&(q=H*r),m&&H>m&&(H=m)),Dn(q>0||H>0,`The width(%s) and height(%s) of chart should be greater than 0, + please check the style of container, or the props width(%s) and height(%s), + or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the + height and width.`,q,H,s,f,h,p,r);var V=!Array.isArray(g)&&Ei(g.type).endsWith("Chart");return z.Children.map(g,function(D){return z.isValidElement(D)?S.cloneElement(D,rd({width:q,height:H},V?{style:rd({height:"100%",width:"100%",maxHeight:H,maxWidth:q},D.props.style)}:{})):D})},[r,g,f,m,p,h,I,s]);return z.createElement("div",{id:w?"".concat(w):void 0,className:He("recharts-responsive-container",j),style:rd(rd({},A),{},{width:s,height:f,minWidth:h,minHeight:p,maxHeight:m}),ref:N},$)}),zp=function(t){return null};zp.displayName="Cell";function Mc(e){"@babel/helpers - typeof";return Mc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mc(e)}function dA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function x1(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||ma.isSsr)return{width:0,height:0};var n=AW(r),i=JSON.stringify({text:t,copyStyle:n});if(Ga.widthCache[i])return Ga.widthCache[i];try{var o=document.getElementById(hA);o||(o=document.createElement("span"),o.setAttribute("id",hA),o.setAttribute("aria-hidden","true"),document.body.appendChild(o));var s=x1(x1({},NW),n);Object.assign(o.style,s),o.textContent="".concat(t);var u=o.getBoundingClientRect(),f={width:u.width,height:u.height};return Ga.widthCache[i]=f,++Ga.cacheCount>PW&&(Ga.cacheCount=0,Ga.widthCache={}),f}catch{return{width:0,height:0}}},CW=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function Ic(e){"@babel/helpers - typeof";return Ic=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ic(e)}function Eh(e,t){return MW(e)||RW(e,t)||kW(e,t)||TW()}function TW(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kW(e,t){if(e){if(typeof e=="string")return pA(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return pA(e,t)}}function pA(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function KW(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function bA(e,t){return ZW(e)||QW(e,t)||YW(e,t)||XW()}function XW(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function YW(e,t){if(e){if(typeof e=="string")return wA(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return wA(e,t)}}function wA(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[];return q.reduce(function(H,V){var D=V.word,Z=V.width,J=H[H.length-1];if(J&&(i==null||o||J.width+Z+nV.width?H:V})};if(!h)return g;for(var y="…",w=function(q){var H=p.slice(0,q),V=tD({breakAll:l,style:f,children:H+y}).wordsWithComputedWidth,D=m(V),Z=D.length>s||b(D).width>Number(i);return[Z,D]},j=0,O=p.length-1,E=0,A;j<=O&&E<=p.length-1;){var N=Math.floor((j+O)/2),C=N-1,T=w(C),R=bA(T,2),I=R[0],F=R[1],L=w(N),$=bA(L,1),U=$[0];if(!I&&!U&&(j=N+1),I&&U&&(O=N-1),!I&&U){A=F;break}E++}return A||g},SA=function(t){var r=We(t)?[]:t.toString().split(eD);return[{words:r}]},eH=function(t){var r=t.width,n=t.scaleToFit,i=t.children,o=t.style,s=t.breakAll,u=t.maxLines;if((r||n)&&!ma.isSsr){var f,l,h=tD({breakAll:s,children:i,style:o});if(h){var p=h.wordsWithComputedWidth,m=h.spaceWidth;f=p,l=m}else return SA(i);return JW({breakAll:s,children:i,maxLines:u,style:o},f,l,r,n)}return SA(i)},_A="#808080",ra=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,o=i===void 0?0:i,s=t.lineHeight,u=s===void 0?"1em":s,f=t.capHeight,l=f===void 0?"0.71em":f,h=t.scaleToFit,p=h===void 0?!1:h,m=t.textAnchor,g=m===void 0?"start":m,b=t.verticalAnchor,y=b===void 0?"end":b,w=t.fill,j=w===void 0?_A:w,O=xA(t,VW),E=S.useMemo(function(){return eH({breakAll:O.breakAll,children:O.children,maxLines:O.maxLines,scaleToFit:p,style:O.style,width:O.width})},[O.breakAll,O.children,O.maxLines,p,O.style,O.width]),A=O.dx,N=O.dy,C=O.angle,T=O.className,R=O.breakAll,I=xA(O,GW);if(!Ht(n)||!Ht(o))return null;var F=n+(be(A)?A:0),L=o+(be(N)?N:0),$;switch(y){case"start":$=Fx("calc(".concat(l,")"));break;case"middle":$=Fx("calc(".concat((E.length-1)/2," * -").concat(u," + (").concat(l," / 2))"));break;default:$=Fx("calc(".concat(E.length-1," * -").concat(u,")"));break}var U=[];if(p){var G=E[0].width,q=O.width;U.push("scale(".concat((be(q)?q/G:1)/G,")"))}return C&&U.push("rotate(".concat(C,", ").concat(F,", ").concat(L,")")),U.length&&(I.transform=U.join(" ")),z.createElement("text",b1({},Be(I,!0),{x:F,y:L,className:He("recharts-text",T),textAnchor:g,fill:j.includes("url")?_A:j}),E.map(function(H,V){var D=H.words.join(R?"":" ");return z.createElement("tspan",{x:F,dy:V===0?$:u,key:"".concat(D,"-").concat(V)},D)}))};function fo(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function tH(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function _S(e){let t,r,n;e.length!==2?(t=fo,r=(u,f)=>fo(e(u),f),n=(u,f)=>e(u)-f):(t=e===fo||e===tH?e:rH,r=e,n=e);function i(u,f,l=0,h=u.length){if(l>>1;r(u[p],f)<0?l=p+1:h=p}while(l>>1;r(u[p],f)<=0?l=p+1:h=p}while(ll&&n(u[p-1],f)>-n(u[p],f)?p-1:p}return{left:i,center:s,right:o}}function rH(){return 0}function rD(e){return e===null?NaN:+e}function*nH(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const iH=_S(fo),yu=iH.right;_S(rD).center;class jA extends Map{constructor(t,r=sH){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,i]of t)this.set(n,i)}get(t){return super.get(OA(this,t))}has(t){return super.has(OA(this,t))}set(t,r){return super.set(oH(this,t),r)}delete(t){return super.delete(aH(this,t))}}function OA({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function oH({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function aH({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function sH(e){return e!==null&&typeof e=="object"?e.valueOf():e}function lH(e=fo){if(e===fo)return nD;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function nD(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const cH=Math.sqrt(50),uH=Math.sqrt(10),fH=Math.sqrt(2);function Ph(e,t,r){const n=(t-e)/Math.max(0,r),i=Math.floor(Math.log10(n)),o=n/Math.pow(10,i),s=o>=cH?10:o>=uH?5:o>=fH?2:1;let u,f,l;return i<0?(l=Math.pow(10,-i)/s,u=Math.round(e*l),f=Math.round(t*l),u/lt&&--f,l=-l):(l=Math.pow(10,i)*s,u=Math.round(e/l),f=Math.round(t/l),u*lt&&--f),f0))return[];if(e===t)return[e];const n=t=i))return[];const u=o-i+1,f=new Array(u);if(n)if(s<0)for(let l=0;l=n)&&(r=n);return r}function PA(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function iD(e,t,r=0,n=1/0,i){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(i=i===void 0?nD:lH(i);n>r;){if(n-r>600){const f=n-r+1,l=t-r+1,h=Math.log(f),p=.5*Math.exp(2*h/3),m=.5*Math.sqrt(h*p*(f-p)/f)*(l-f/2<0?-1:1),g=Math.max(r,Math.floor(t-l*p/f+m)),b=Math.min(n,Math.floor(t+(f-l)*p/f+m));iD(e,t,g,b,i)}const o=e[t];let s=r,u=n;for(tc(e,r,t),i(e[n],o)>0&&tc(e,r,n);s0;)--u}i(e[r],o)===0?tc(e,r,u):(++u,tc(e,u,n)),u<=t&&(r=u+1),t<=u&&(n=u-1)}return e}function tc(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function dH(e,t,r){if(e=Float64Array.from(nH(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return PA(e);if(t>=1)return EA(e);var n,i=(n-1)*t,o=Math.floor(i),s=EA(iD(e,o).subarray(0,o+1)),u=PA(e.subarray(o+1));return s+(u-s)*(i-o)}}function hH(e,t,r=rD){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,i=(n-1)*t,o=Math.floor(i),s=+r(e[o],o,e),u=+r(e[o+1],o+1,e);return s+(u-s)*(i-o)}}function pH(e,t,r){e=+e,t=+t,r=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+r;for(var n=-1,i=Math.max(0,Math.ceil((t-e)/r))|0,o=new Array(i);++n>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?id(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?id(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=vH.exec(e))?new kr(t[1],t[2],t[3],1):(t=gH.exec(e))?new kr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=yH.exec(e))?id(t[1],t[2],t[3],t[4]):(t=xH.exec(e))?id(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=bH.exec(e))?MA(t[1],t[2]/100,t[3]/100,1):(t=wH.exec(e))?MA(t[1],t[2]/100,t[3]/100,t[4]):NA.hasOwnProperty(e)?TA(NA[e]):e==="transparent"?new kr(NaN,NaN,NaN,0):null}function TA(e){return new kr(e>>16&255,e>>8&255,e&255,1)}function id(e,t,r,n){return n<=0&&(e=t=r=NaN),new kr(e,t,r,n)}function jH(e){return e instanceof xu||(e=Bc(e)),e?(e=e.rgb(),new kr(e.r,e.g,e.b,e.opacity)):new kr}function O1(e,t,r,n){return arguments.length===1?jH(e):new kr(e,t,r,n??1)}function kr(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}OS(kr,O1,aD(xu,{brighter(e){return e=e==null?Nh:Math.pow(Nh,e),new kr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Lc:Math.pow(Lc,e),new kr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new kr(Qo(this.r),Qo(this.g),Qo(this.b),Ah(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:kA,formatHex:kA,formatHex8:OH,formatRgb:RA,toString:RA}));function kA(){return`#${Ko(this.r)}${Ko(this.g)}${Ko(this.b)}`}function OH(){return`#${Ko(this.r)}${Ko(this.g)}${Ko(this.b)}${Ko((isNaN(this.opacity)?1:this.opacity)*255)}`}function RA(){const e=Ah(this.opacity);return`${e===1?"rgb(":"rgba("}${Qo(this.r)}, ${Qo(this.g)}, ${Qo(this.b)}${e===1?")":`, ${e})`}`}function Ah(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Qo(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ko(e){return e=Qo(e),(e<16?"0":"")+e.toString(16)}function MA(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new In(e,t,r,n)}function sD(e){if(e instanceof In)return new In(e.h,e.s,e.l,e.opacity);if(e instanceof xu||(e=Bc(e)),!e)return new In;if(e instanceof In)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,i=Math.min(t,r,n),o=Math.max(t,r,n),s=NaN,u=o-i,f=(o+i)/2;return u?(t===o?s=(r-n)/u+(r0&&f<1?0:s,new In(s,u,f,e.opacity)}function EH(e,t,r,n){return arguments.length===1?sD(e):new In(e,t,r,n??1)}function In(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}OS(In,EH,aD(xu,{brighter(e){return e=e==null?Nh:Math.pow(Nh,e),new In(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Lc:Math.pow(Lc,e),new In(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,i=2*r-n;return new kr(zx(e>=240?e-240:e+120,i,n),zx(e,i,n),zx(e<120?e+240:e-120,i,n),this.opacity)},clamp(){return new In(IA(this.h),od(this.s),od(this.l),Ah(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Ah(this.opacity);return`${e===1?"hsl(":"hsla("}${IA(this.h)}, ${od(this.s)*100}%, ${od(this.l)*100}%${e===1?")":`, ${e})`}`}}));function IA(e){return e=(e||0)%360,e<0?e+360:e}function od(e){return Math.max(0,Math.min(1,e||0))}function zx(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const ES=e=>()=>e;function PH(e,t){return function(r){return e+r*t}}function NH(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function AH(e){return(e=+e)==1?lD:function(t,r){return r-t?NH(t,r,e):ES(isNaN(t)?r:t)}}function lD(e,t){var r=t-e;return r?PH(e,r):ES(isNaN(e)?t:e)}const DA=(function e(t){var r=AH(t);function n(i,o){var s=r((i=O1(i)).r,(o=O1(o)).r),u=r(i.g,o.g),f=r(i.b,o.b),l=lD(i.opacity,o.opacity);return function(h){return i.r=s(h),i.g=u(h),i.b=f(h),i.opacity=l(h),i+""}}return n.gamma=e,n})(1);function CH(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),i;return function(o){for(i=0;ir&&(o=t.slice(r,o),u[s]?u[s]+=o:u[++s]=o),(n=n[0])===(i=i[0])?u[s]?u[s]+=i:u[++s]=i:(u[++s]=null,f.push({i:s,x:Ch(n,i)})),r=qx.lastIndex;return rt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function zH(e,t,r){var n=e[0],i=e[1],o=t[0],s=t[1];return i2?qH:zH,f=l=null,p}function p(m){return m==null||isNaN(m=+m)?o:(f||(f=u(e.map(n),t,r)))(n(s(m)))}return p.invert=function(m){return s(i((l||(l=u(t,e.map(n),Ch)))(m)))},p.domain=function(m){return arguments.length?(e=Array.from(m,Th),h()):e.slice()},p.range=function(m){return arguments.length?(t=Array.from(m),h()):t.slice()},p.rangeRound=function(m){return t=Array.from(m),r=PS,h()},p.clamp=function(m){return arguments.length?(s=m?!0:xr,h()):s!==xr},p.interpolate=function(m){return arguments.length?(r=m,h()):r},p.unknown=function(m){return arguments.length?(o=m,p):o},function(m,g){return n=m,i=g,h()}}function NS(){return qp()(xr,xr)}function UH(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function kh(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function As(e){return e=kh(Math.abs(e)),e?e[1]:NaN}function WH(e,t){return function(r,n){for(var i=r.length,o=[],s=0,u=e[0],f=0;i>0&&u>0&&(f+u+1>n&&(u=Math.max(1,n-f)),o.push(r.substring(i-=u,i+u)),!((f+=u+1)>n));)u=e[s=(s+1)%e.length];return o.reverse().join(t)}}function HH(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var VH=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Fc(e){if(!(t=VH.exec(e)))throw new Error("invalid format: "+e);var t;return new AS({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Fc.prototype=AS.prototype;function AS(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}AS.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function GH(e){e:for(var t=e.length,r=1,n=-1,i;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(i+1):e}var Rh;function KH(e,t){var r=kh(e,t);if(!r)return Rh=void 0,e.toPrecision(t);var n=r[0],i=r[1],o=i-(Rh=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,s=n.length;return o===s?n:o>s?n+new Array(o-s+1).join("0"):o>0?n.slice(0,o)+"."+n.slice(o):"0."+new Array(1-o).join("0")+kh(e,Math.max(0,t+o-1))[0]}function $A(e,t){var r=kh(e,t);if(!r)return e+"";var n=r[0],i=r[1];return i<0?"0."+new Array(-i).join("0")+n:n.length>i+1?n.slice(0,i+1)+"."+n.slice(i+1):n+new Array(i-n.length+2).join("0")}const BA={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:UH,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>$A(e*100,t),r:$A,s:KH,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function FA(e){return e}var zA=Array.prototype.map,qA=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function XH(e){var t=e.grouping===void 0||e.thousands===void 0?FA:WH(zA.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",i=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?FA:HH(zA.call(e.numerals,String)),s=e.percent===void 0?"%":e.percent+"",u=e.minus===void 0?"−":e.minus+"",f=e.nan===void 0?"NaN":e.nan+"";function l(p,m){p=Fc(p);var g=p.fill,b=p.align,y=p.sign,w=p.symbol,j=p.zero,O=p.width,E=p.comma,A=p.precision,N=p.trim,C=p.type;C==="n"?(E=!0,C="g"):BA[C]||(A===void 0&&(A=12),N=!0,C="g"),(j||g==="0"&&b==="=")&&(j=!0,g="0",b="=");var T=(m&&m.prefix!==void 0?m.prefix:"")+(w==="$"?r:w==="#"&&/[boxX]/.test(C)?"0"+C.toLowerCase():""),R=(w==="$"?n:/[%p]/.test(C)?s:"")+(m&&m.suffix!==void 0?m.suffix:""),I=BA[C],F=/[defgprs%]/.test(C);A=A===void 0?6:/[gprs]/.test(C)?Math.max(1,Math.min(21,A)):Math.max(0,Math.min(20,A));function L($){var U=T,G=R,q,H,V;if(C==="c")G=I($)+G,$="";else{$=+$;var D=$<0||1/$<0;if($=isNaN($)?f:I(Math.abs($),A),N&&($=GH($)),D&&+$==0&&y!=="+"&&(D=!1),U=(D?y==="("?y:u:y==="-"||y==="("?"":y)+U,G=(C==="s"&&!isNaN($)&&Rh!==void 0?qA[8+Rh/3]:"")+G+(D&&y==="("?")":""),F){for(q=-1,H=$.length;++qV||V>57){G=(V===46?i+$.slice(q+1):$.slice(q))+G,$=$.slice(0,q);break}}}E&&!j&&($=t($,1/0));var Z=U.length+$.length+G.length,J=Z>1)+U+$+G+J.slice(Z);break;default:$=J+U+$+G;break}return o($)}return L.toString=function(){return p+""},L}function h(p,m){var g=Math.max(-8,Math.min(8,Math.floor(As(m)/3)))*3,b=Math.pow(10,-g),y=l((p=Fc(p),p.type="f",p),{suffix:qA[8+g/3]});return function(w){return y(b*w)}}return{format:l,formatPrefix:h}}var ad,CS,cD;YH({thousands:",",grouping:[3],currency:["$",""]});function YH(e){return ad=XH(e),CS=ad.format,cD=ad.formatPrefix,ad}function QH(e){return Math.max(0,-As(Math.abs(e)))}function ZH(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(As(t)/3)))*3-As(Math.abs(e)))}function JH(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,As(t)-As(e))+1}function uD(e,t,r,n){var i=_1(e,t,r),o;switch(n=Fc(n??",f"),n.type){case"s":{var s=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(o=ZH(i,s))&&(n.precision=o),cD(n,s)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(o=JH(i,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=o-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(o=QH(i))&&(n.precision=o-(n.type==="%")*2);break}}return CS(n)}function go(e){var t=e.domain;return e.ticks=function(r){var n=t();return w1(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var i=t();return uD(i[0],i[i.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),i=0,o=n.length-1,s=n[i],u=n[o],f,l,h=10;for(u0;){if(l=S1(s,u,r),l===f)return n[i]=s,n[o]=u,t(n);if(l>0)s=Math.floor(s/l)*l,u=Math.ceil(u/l)*l;else if(l<0)s=Math.ceil(s*l)/l,u=Math.floor(u*l)/l;else break;f=l}return e},e}function Mh(){var e=NS();return e.copy=function(){return bu(e,Mh())},yn.apply(e,arguments),go(e)}function fD(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,Th),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return fD(e).unknown(t)},e=arguments.length?Array.from(e,Th):[0,1],go(r)}function dD(e,t){e=e.slice();var r=0,n=e.length-1,i=e[r],o=e[n],s;return oMath.pow(e,t)}function iV(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function HA(e){return(t,r)=>-e(-t,r)}function TS(e){const t=e(UA,WA),r=t.domain;let n=10,i,o;function s(){return i=iV(n),o=nV(n),r()[0]<0?(i=HA(i),o=HA(o),e(eV,tV)):e(UA,WA),t}return t.base=function(u){return arguments.length?(n=+u,s()):n},t.domain=function(u){return arguments.length?(r(u),s()):r()},t.ticks=u=>{const f=r();let l=f[0],h=f[f.length-1];const p=h0){for(;m<=g;++m)for(b=1;bh)break;j.push(y)}}else for(;m<=g;++m)for(b=n-1;b>=1;--b)if(y=m>0?b/o(-m):b*o(m),!(yh)break;j.push(y)}j.length*2{if(u==null&&(u=10),f==null&&(f=n===10?"s":","),typeof f!="function"&&(!(n%1)&&(f=Fc(f)).precision==null&&(f.trim=!0),f=CS(f)),u===1/0)return f;const l=Math.max(1,n*u/t.ticks().length);return h=>{let p=h/o(Math.round(i(h)));return p*nr(dD(r(),{floor:u=>o(Math.floor(i(u))),ceil:u=>o(Math.ceil(i(u)))})),t}function hD(){const e=TS(qp()).domain([1,10]);return e.copy=()=>bu(e,hD()).base(e.base()),yn.apply(e,arguments),e}function VA(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function GA(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function kS(e){var t=1,r=e(VA(t),GA(t));return r.constant=function(n){return arguments.length?e(VA(t=+n),GA(t)):t},go(r)}function pD(){var e=kS(qp());return e.copy=function(){return bu(e,pD()).constant(e.constant())},yn.apply(e,arguments)}function KA(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function oV(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function aV(e){return e<0?-e*e:e*e}function RS(e){var t=e(xr,xr),r=1;function n(){return r===1?e(xr,xr):r===.5?e(oV,aV):e(KA(r),KA(1/r))}return t.exponent=function(i){return arguments.length?(r=+i,n()):r},go(t)}function MS(){var e=RS(qp());return e.copy=function(){return bu(e,MS()).exponent(e.exponent())},yn.apply(e,arguments),e}function sV(){return MS.apply(null,arguments).exponent(.5)}function XA(e){return Math.sign(e)*e*e}function lV(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function mD(){var e=NS(),t=[0,1],r=!1,n;function i(o){var s=lV(e(o));return isNaN(s)?n:r?Math.round(s):s}return i.invert=function(o){return e.invert(XA(o))},i.domain=function(o){return arguments.length?(e.domain(o),i):e.domain()},i.range=function(o){return arguments.length?(e.range((t=Array.from(o,Th)).map(XA)),i):t.slice()},i.rangeRound=function(o){return i.range(o).round(!0)},i.round=function(o){return arguments.length?(r=!!o,i):r},i.clamp=function(o){return arguments.length?(e.clamp(o),i):e.clamp()},i.unknown=function(o){return arguments.length?(n=o,i):n},i.copy=function(){return mD(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},yn.apply(i,arguments),go(i)}function vD(){var e=[],t=[],r=[],n;function i(){var s=0,u=Math.max(1,t.length);for(r=new Array(u-1);++s0?r[u-1]:e[0],u=r?[n[r-1],t]:[n[l-1],n[l]]},s.unknown=function(f){return arguments.length&&(o=f),s},s.thresholds=function(){return n.slice()},s.copy=function(){return gD().domain([e,t]).range(i).unknown(o)},yn.apply(go(s),arguments)}function yD(){var e=[.5],t=[0,1],r,n=1;function i(o){return o!=null&&o<=o?t[yu(e,o,0,n)]:r}return i.domain=function(o){return arguments.length?(e=Array.from(o),n=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(o){return arguments.length?(t=Array.from(o),n=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(o){var s=t.indexOf(o);return[e[s-1],e[s]]},i.unknown=function(o){return arguments.length?(r=o,i):r},i.copy=function(){return yD().domain(e).range(t).unknown(r)},yn.apply(i,arguments)}const Ux=new Date,Wx=new Date;function Vt(e,t,r,n){function i(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return i.floor=o=>(e(o=new Date(+o)),o),i.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),i.round=o=>{const s=i(o),u=i.ceil(o);return o-s(t(o=new Date(+o),s==null?1:Math.floor(s)),o),i.range=(o,s,u)=>{const f=[];if(o=i.ceil(o),u=u==null?1:Math.floor(u),!(o0))return f;let l;do f.push(l=new Date(+o)),t(o,u),e(o);while(lVt(s=>{if(s>=s)for(;e(s),!o(s);)s.setTime(s-1)},(s,u)=>{if(s>=s)if(u<0)for(;++u<=0;)for(;t(s,-1),!o(s););else for(;--u>=0;)for(;t(s,1),!o(s););}),r&&(i.count=(o,s)=>(Ux.setTime(+o),Wx.setTime(+s),e(Ux),e(Wx),Math.floor(r(Ux,Wx))),i.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?i.filter(n?s=>n(s)%o===0:s=>i.count(0,s)%o===0):i)),i}const Ih=Vt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Ih.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Vt(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):Ih);Ih.range;const _i=1e3,pn=_i*60,ji=pn*60,Ai=ji*24,IS=Ai*7,YA=Ai*30,Hx=Ai*365,Xo=Vt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*_i)},(e,t)=>(t-e)/_i,e=>e.getUTCSeconds());Xo.range;const DS=Vt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*_i)},(e,t)=>{e.setTime(+e+t*pn)},(e,t)=>(t-e)/pn,e=>e.getMinutes());DS.range;const LS=Vt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*pn)},(e,t)=>(t-e)/pn,e=>e.getUTCMinutes());LS.range;const $S=Vt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*_i-e.getMinutes()*pn)},(e,t)=>{e.setTime(+e+t*ji)},(e,t)=>(t-e)/ji,e=>e.getHours());$S.range;const BS=Vt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*ji)},(e,t)=>(t-e)/ji,e=>e.getUTCHours());BS.range;const wu=Vt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*pn)/Ai,e=>e.getDate()-1);wu.range;const Up=Vt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ai,e=>e.getUTCDate()-1);Up.range;const xD=Vt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ai,e=>Math.floor(e/Ai));xD.range;function va(e){return Vt(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*pn)/IS)}const Wp=va(0),Dh=va(1),cV=va(2),uV=va(3),Cs=va(4),fV=va(5),dV=va(6);Wp.range;Dh.range;cV.range;uV.range;Cs.range;fV.range;dV.range;function ga(e){return Vt(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/IS)}const Hp=ga(0),Lh=ga(1),hV=ga(2),pV=ga(3),Ts=ga(4),mV=ga(5),vV=ga(6);Hp.range;Lh.range;hV.range;pV.range;Ts.range;mV.range;vV.range;const FS=Vt(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());FS.range;const zS=Vt(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());zS.range;const Ci=Vt(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());Ci.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Vt(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});Ci.range;const Ti=Vt(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Ti.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Vt(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});Ti.range;function bD(e,t,r,n,i,o){const s=[[Xo,1,_i],[Xo,5,5*_i],[Xo,15,15*_i],[Xo,30,30*_i],[o,1,pn],[o,5,5*pn],[o,15,15*pn],[o,30,30*pn],[i,1,ji],[i,3,3*ji],[i,6,6*ji],[i,12,12*ji],[n,1,Ai],[n,2,2*Ai],[r,1,IS],[t,1,YA],[t,3,3*YA],[e,1,Hx]];function u(l,h,p){const m=hw).right(s,m);if(g===s.length)return e.every(_1(l/Hx,h/Hx,p));if(g===0)return Ih.every(Math.max(_1(l,h,p),1));const[b,y]=s[m/s[g-1][2]53)return null;"w"in Y||(Y.w=1),"Z"in Y?(Oe=Gx(rc(Y.y,0,1)),Ve=Oe.getUTCDay(),Oe=Ve>4||Ve===0?Lh.ceil(Oe):Lh(Oe),Oe=Up.offset(Oe,(Y.V-1)*7),Y.y=Oe.getUTCFullYear(),Y.m=Oe.getUTCMonth(),Y.d=Oe.getUTCDate()+(Y.w+6)%7):(Oe=Vx(rc(Y.y,0,1)),Ve=Oe.getDay(),Oe=Ve>4||Ve===0?Dh.ceil(Oe):Dh(Oe),Oe=wu.offset(Oe,(Y.V-1)*7),Y.y=Oe.getFullYear(),Y.m=Oe.getMonth(),Y.d=Oe.getDate()+(Y.w+6)%7)}else("W"in Y||"U"in Y)&&("w"in Y||(Y.w="u"in Y?Y.u%7:"W"in Y?1:0),Ve="Z"in Y?Gx(rc(Y.y,0,1)).getUTCDay():Vx(rc(Y.y,0,1)).getDay(),Y.m=0,Y.d="W"in Y?(Y.w+6)%7+Y.W*7-(Ve+5)%7:Y.w+Y.U*7-(Ve+6)%7);return"Z"in Y?(Y.H+=Y.Z/100|0,Y.M+=Y.Z%100,Gx(Y)):Vx(Y)}}function R(te,le,ge,Y){for(var _e=0,Oe=le.length,Ve=ge.length,nt,lt;_e=Ve)return-1;if(nt=le.charCodeAt(_e++),nt===37){if(nt=le.charAt(_e++),lt=N[nt in QA?le.charAt(_e++):nt],!lt||(Y=lt(te,ge,Y))<0)return-1}else if(nt!=ge.charCodeAt(Y++))return-1}return Y}function I(te,le,ge){var Y=l.exec(le.slice(ge));return Y?(te.p=h.get(Y[0].toLowerCase()),ge+Y[0].length):-1}function F(te,le,ge){var Y=g.exec(le.slice(ge));return Y?(te.w=b.get(Y[0].toLowerCase()),ge+Y[0].length):-1}function L(te,le,ge){var Y=p.exec(le.slice(ge));return Y?(te.w=m.get(Y[0].toLowerCase()),ge+Y[0].length):-1}function $(te,le,ge){var Y=j.exec(le.slice(ge));return Y?(te.m=O.get(Y[0].toLowerCase()),ge+Y[0].length):-1}function U(te,le,ge){var Y=y.exec(le.slice(ge));return Y?(te.m=w.get(Y[0].toLowerCase()),ge+Y[0].length):-1}function G(te,le,ge){return R(te,t,le,ge)}function q(te,le,ge){return R(te,r,le,ge)}function H(te,le,ge){return R(te,n,le,ge)}function V(te){return s[te.getDay()]}function D(te){return o[te.getDay()]}function Z(te){return f[te.getMonth()]}function J(te){return u[te.getMonth()]}function M(te){return i[+(te.getHours()>=12)]}function B(te){return 1+~~(te.getMonth()/3)}function ee(te){return s[te.getUTCDay()]}function ae(te){return o[te.getUTCDay()]}function ie(te){return f[te.getUTCMonth()]}function fe(te){return u[te.getUTCMonth()]}function K(te){return i[+(te.getUTCHours()>=12)]}function ce(te){return 1+~~(te.getUTCMonth()/3)}return{format:function(te){var le=C(te+="",E);return le.toString=function(){return te},le},parse:function(te){var le=T(te+="",!1);return le.toString=function(){return te},le},utcFormat:function(te){var le=C(te+="",A);return le.toString=function(){return te},le},utcParse:function(te){var le=T(te+="",!0);return le.toString=function(){return te},le}}}var QA={"-":"",_:" ",0:"0"},Zt=/^\s*\d+/,SV=/^%/,_V=/[\\^$*+?|[\]().{}]/g;function st(e,t,r){var n=e<0?"-":"",i=(n?-e:e)+"",o=i.length;return n+(o[t.toLowerCase(),r]))}function OV(e,t,r){var n=Zt.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function EV(e,t,r){var n=Zt.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function PV(e,t,r){var n=Zt.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function NV(e,t,r){var n=Zt.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function AV(e,t,r){var n=Zt.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function ZA(e,t,r){var n=Zt.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function JA(e,t,r){var n=Zt.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function CV(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function TV(e,t,r){var n=Zt.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function kV(e,t,r){var n=Zt.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function eC(e,t,r){var n=Zt.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function RV(e,t,r){var n=Zt.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function tC(e,t,r){var n=Zt.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function MV(e,t,r){var n=Zt.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function IV(e,t,r){var n=Zt.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function DV(e,t,r){var n=Zt.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function LV(e,t,r){var n=Zt.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function $V(e,t,r){var n=SV.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function BV(e,t,r){var n=Zt.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function FV(e,t,r){var n=Zt.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function rC(e,t){return st(e.getDate(),t,2)}function zV(e,t){return st(e.getHours(),t,2)}function qV(e,t){return st(e.getHours()%12||12,t,2)}function UV(e,t){return st(1+wu.count(Ci(e),e),t,3)}function wD(e,t){return st(e.getMilliseconds(),t,3)}function WV(e,t){return wD(e,t)+"000"}function HV(e,t){return st(e.getMonth()+1,t,2)}function VV(e,t){return st(e.getMinutes(),t,2)}function GV(e,t){return st(e.getSeconds(),t,2)}function KV(e){var t=e.getDay();return t===0?7:t}function XV(e,t){return st(Wp.count(Ci(e)-1,e),t,2)}function SD(e){var t=e.getDay();return t>=4||t===0?Cs(e):Cs.ceil(e)}function YV(e,t){return e=SD(e),st(Cs.count(Ci(e),e)+(Ci(e).getDay()===4),t,2)}function QV(e){return e.getDay()}function ZV(e,t){return st(Dh.count(Ci(e)-1,e),t,2)}function JV(e,t){return st(e.getFullYear()%100,t,2)}function eG(e,t){return e=SD(e),st(e.getFullYear()%100,t,2)}function tG(e,t){return st(e.getFullYear()%1e4,t,4)}function rG(e,t){var r=e.getDay();return e=r>=4||r===0?Cs(e):Cs.ceil(e),st(e.getFullYear()%1e4,t,4)}function nG(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+st(t/60|0,"0",2)+st(t%60,"0",2)}function nC(e,t){return st(e.getUTCDate(),t,2)}function iG(e,t){return st(e.getUTCHours(),t,2)}function oG(e,t){return st(e.getUTCHours()%12||12,t,2)}function aG(e,t){return st(1+Up.count(Ti(e),e),t,3)}function _D(e,t){return st(e.getUTCMilliseconds(),t,3)}function sG(e,t){return _D(e,t)+"000"}function lG(e,t){return st(e.getUTCMonth()+1,t,2)}function cG(e,t){return st(e.getUTCMinutes(),t,2)}function uG(e,t){return st(e.getUTCSeconds(),t,2)}function fG(e){var t=e.getUTCDay();return t===0?7:t}function dG(e,t){return st(Hp.count(Ti(e)-1,e),t,2)}function jD(e){var t=e.getUTCDay();return t>=4||t===0?Ts(e):Ts.ceil(e)}function hG(e,t){return e=jD(e),st(Ts.count(Ti(e),e)+(Ti(e).getUTCDay()===4),t,2)}function pG(e){return e.getUTCDay()}function mG(e,t){return st(Lh.count(Ti(e)-1,e),t,2)}function vG(e,t){return st(e.getUTCFullYear()%100,t,2)}function gG(e,t){return e=jD(e),st(e.getUTCFullYear()%100,t,2)}function yG(e,t){return st(e.getUTCFullYear()%1e4,t,4)}function xG(e,t){var r=e.getUTCDay();return e=r>=4||r===0?Ts(e):Ts.ceil(e),st(e.getUTCFullYear()%1e4,t,4)}function bG(){return"+0000"}function iC(){return"%"}function oC(e){return+e}function aC(e){return Math.floor(+e/1e3)}var Ka,OD,ED;wG({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function wG(e){return Ka=wV(e),OD=Ka.format,Ka.parse,ED=Ka.utcFormat,Ka.utcParse,Ka}function SG(e){return new Date(e)}function _G(e){return e instanceof Date?+e:+new Date(+e)}function qS(e,t,r,n,i,o,s,u,f,l){var h=NS(),p=h.invert,m=h.domain,g=l(".%L"),b=l(":%S"),y=l("%I:%M"),w=l("%I %p"),j=l("%a %d"),O=l("%b %d"),E=l("%B"),A=l("%Y");function N(C){return(f(C)t(i/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(i,o)=>dH(e,o/n))},r.copy=function(){return CD(t).domain(e)},Li.apply(r,arguments)}function Gp(){var e=0,t=.5,r=1,n=1,i,o,s,u,f,l=xr,h,p=!1,m;function g(y){return isNaN(y=+y)?m:(y=.5+((y=+h(y))-o)*(n*yr}return Xx=e,Xx}var Yx,uC;function NG(){if(uC)return Yx;uC=1;var e=Kp(),t=MD(),r=il();function n(i){return i&&i.length?e(i,r,t):void 0}return Yx=n,Yx}var AG=NG();const Xp=ct(AG);var Qx,fC;function ID(){if(fC)return Qx;fC=1;function e(t,r){return te.e^o.s<0?1:-1;for(n=o.d.length,i=e.d.length,t=0,r=ne.d[t]^o.s<0?1:-1;return n===i?0:n>i^o.s<0?1:-1};Ne.decimalPlaces=Ne.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*St;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};Ne.dividedBy=Ne.div=function(e){return Pi(this,new this.constructor(e))};Ne.dividedToIntegerBy=Ne.idiv=function(e){var t=this,r=t.constructor;return mt(Pi(t,new r(e),0,1),r.precision)};Ne.equals=Ne.eq=function(e){return!this.cmp(e)};Ne.exponent=function(){return Dt(this)};Ne.greaterThan=Ne.gt=function(e){return this.cmp(e)>0};Ne.greaterThanOrEqualTo=Ne.gte=function(e){return this.cmp(e)>=0};Ne.isInteger=Ne.isint=function(){return this.e>this.d.length-2};Ne.isNegative=Ne.isneg=function(){return this.s<0};Ne.isPositive=Ne.ispos=function(){return this.s>0};Ne.isZero=function(){return this.s===0};Ne.lessThan=Ne.lt=function(e){return this.cmp(e)<0};Ne.lessThanOrEqualTo=Ne.lte=function(e){return this.cmp(e)<1};Ne.logarithm=Ne.log=function(e){var t,r=this,n=r.constructor,i=n.precision,o=i+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(Yr))throw Error(vn+"NaN");if(r.s<1)throw Error(vn+(r.s?"NaN":"-Infinity"));return r.eq(Yr)?new n(0):(jt=!1,t=Pi(zc(r,o),zc(e,o),o),jt=!0,mt(t,i))};Ne.minus=Ne.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?BD(t,e):LD(t,(e.s=-e.s,e))};Ne.modulo=Ne.mod=function(e){var t,r=this,n=r.constructor,i=n.precision;if(e=new n(e),!e.s)throw Error(vn+"NaN");return r.s?(jt=!1,t=Pi(r,e,0,1).times(e),jt=!0,r.minus(t)):mt(new n(r),i)};Ne.naturalExponential=Ne.exp=function(){return $D(this)};Ne.naturalLogarithm=Ne.ln=function(){return zc(this)};Ne.negated=Ne.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Ne.plus=Ne.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?LD(t,e):BD(t,(e.s=-e.s,e))};Ne.precision=Ne.sd=function(e){var t,r,n,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Zo+e);if(t=Dt(i)+1,n=i.d.length-1,r=n*St+1,n=i.d[n],n){for(;n%10==0;n/=10)r--;for(n=i.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};Ne.squareRoot=Ne.sqrt=function(){var e,t,r,n,i,o,s,u=this,f=u.constructor;if(u.s<1){if(!u.s)return new f(0);throw Error(vn+"NaN")}for(e=Dt(u),jt=!1,i=Math.sqrt(+u),i==0||i==1/0?(t=Xn(u.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=sl((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new f(t)):n=new f(i.toString()),r=f.precision,i=s=r+3;;)if(o=n,n=o.plus(Pi(u,o,s+2)).times(.5),Xn(o.d).slice(0,s)===(t=Xn(n.d)).slice(0,s)){if(t=t.slice(s-3,s+1),i==s&&t=="4999"){if(mt(o,r+1,0),o.times(o).eq(u)){n=o;break}}else if(t!="9999")break;s+=4}return jt=!0,mt(n,r)};Ne.times=Ne.mul=function(e){var t,r,n,i,o,s,u,f,l,h=this,p=h.constructor,m=h.d,g=(e=new p(e)).d;if(!h.s||!e.s)return new p(0);for(e.s*=h.s,r=h.e+e.e,f=m.length,l=g.length,f=0;){for(t=0,i=f+n;i>n;)u=o[i]+g[n]*m[i-n-1]+t,o[i--]=u%Yt|0,t=u/Yt|0;o[i]=(o[i]+t)%Yt|0}for(;!o[--s];)o.pop();return t?++r:o.shift(),e.d=o,e.e=r,jt?mt(e,p.precision):e};Ne.toDecimalPlaces=Ne.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(ti(e,0,al),t===void 0?t=n.rounding:ti(t,0,8),mt(r,e+Dt(r)+1,t))};Ne.toExponential=function(e,t){var r,n=this,i=n.constructor;return e===void 0?r=na(n,!0):(ti(e,0,al),t===void 0?t=i.rounding:ti(t,0,8),n=mt(new i(n),e+1,t),r=na(n,!0,e+1)),r};Ne.toFixed=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?na(i):(ti(e,0,al),t===void 0?t=o.rounding:ti(t,0,8),n=mt(new o(i),e+Dt(i)+1,t),r=na(n.abs(),!1,e+Dt(n)+1),i.isneg()&&!i.isZero()?"-"+r:r)};Ne.toInteger=Ne.toint=function(){var e=this,t=e.constructor;return mt(new t(e),Dt(e)+1,t.rounding)};Ne.toNumber=function(){return+this};Ne.toPower=Ne.pow=function(e){var t,r,n,i,o,s,u=this,f=u.constructor,l=12,h=+(e=new f(e));if(!e.s)return new f(Yr);if(u=new f(u),!u.s){if(e.s<1)throw Error(vn+"Infinity");return u}if(u.eq(Yr))return u;if(n=f.precision,e.eq(Yr))return mt(u,n);if(t=e.e,r=e.d.length-1,s=t>=r,o=u.s,s){if((r=h<0?-h:h)<=DD){for(i=new f(Yr),t=Math.ceil(n/St+4),jt=!1;r%2&&(i=i.times(u),gC(i.d,t)),r=sl(r/2),r!==0;)u=u.times(u),gC(u.d,t);return jt=!0,e.s<0?new f(Yr).div(i):mt(i,n)}}else if(o<0)throw Error(vn+"NaN");return o=o<0&&e.d[Math.max(t,r)]&1?-1:1,u.s=1,jt=!1,i=e.times(zc(u,n+l)),jt=!0,i=$D(i),i.s=o,i};Ne.toPrecision=function(e,t){var r,n,i=this,o=i.constructor;return e===void 0?(r=Dt(i),n=na(i,r<=o.toExpNeg||r>=o.toExpPos)):(ti(e,1,al),t===void 0?t=o.rounding:ti(t,0,8),i=mt(new o(i),e,t),r=Dt(i),n=na(i,e<=r||r<=o.toExpNeg,e)),n};Ne.toSignificantDigits=Ne.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(ti(e,1,al),t===void 0?t=n.rounding:ti(t,0,8)),mt(new n(r),e,t)};Ne.toString=Ne.valueOf=Ne.val=Ne.toJSON=Ne[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Dt(e),r=e.constructor;return na(e,t<=r.toExpNeg||t>=r.toExpPos)};function LD(e,t){var r,n,i,o,s,u,f,l,h=e.constructor,p=h.precision;if(!e.s||!t.s)return t.s||(t=new h(e)),jt?mt(t,p):t;if(f=e.d,l=t.d,s=e.e,i=t.e,f=f.slice(),o=s-i,o){for(o<0?(n=f,o=-o,u=l.length):(n=l,i=s,u=f.length),s=Math.ceil(p/St),u=s>u?s+1:u+1,o>u&&(o=u,n.length=1),n.reverse();o--;)n.push(0);n.reverse()}for(u=f.length,o=l.length,u-o<0&&(o=u,n=l,l=f,f=n),r=0;o;)r=(f[--o]=f[o]+l[o]+r)/Yt|0,f[o]%=Yt;for(r&&(f.unshift(r),++i),u=f.length;f[--u]==0;)f.pop();return t.d=f,t.e=i,jt?mt(t,p):t}function ti(e,t,r){if(e!==~~e||er)throw Error(Zo+e)}function Xn(e){var t,r,n,i=e.length-1,o="",s=e[0];if(i>0){for(o+=s,t=1;ts?1:-1;else for(u=f=0;ui[u]?1:-1;break}return f}function r(n,i,o){for(var s=0;o--;)n[o]-=s,s=n[o]1;)n.shift()}return function(n,i,o,s){var u,f,l,h,p,m,g,b,y,w,j,O,E,A,N,C,T,R,I=n.constructor,F=n.s==i.s?1:-1,L=n.d,$=i.d;if(!n.s)return new I(n);if(!i.s)throw Error(vn+"Division by zero");for(f=n.e-i.e,T=$.length,N=L.length,g=new I(F),b=g.d=[],l=0;$[l]==(L[l]||0);)++l;if($[l]>(L[l]||0)&&--f,o==null?O=o=I.precision:s?O=o+(Dt(n)-Dt(i))+1:O=o,O<0)return new I(0);if(O=O/St+2|0,l=0,T==1)for(h=0,$=$[0],O++;(l1&&($=e($,h),L=e(L,h),T=$.length,N=L.length),A=T,y=L.slice(0,T),w=y.length;w=Yt/2&&++C;do h=0,u=t($,y,T,w),u<0?(j=y[0],T!=w&&(j=j*Yt+(y[1]||0)),h=j/C|0,h>1?(h>=Yt&&(h=Yt-1),p=e($,h),m=p.length,w=y.length,u=t(p,y,m,w),u==1&&(h--,r(p,T16)throw Error(HS+Dt(e));if(!e.s)return new h(Yr);for(jt=!1,u=p,s=new h(.03125);e.abs().gte(.1);)e=e.times(s),l+=5;for(n=Math.log(Ho(2,l))/Math.LN10*2+5|0,u+=n,r=i=o=new h(Yr),h.precision=u;;){if(i=mt(i.times(e),u),r=r.times(++f),s=o.plus(Pi(i,r,u)),Xn(s.d).slice(0,u)===Xn(o.d).slice(0,u)){for(;l--;)o=mt(o.times(o),u);return h.precision=p,t==null?(jt=!0,mt(o,p)):o}o=s}}function Dt(e){for(var t=e.e*St,r=e.d[0];r>=10;r/=10)t++;return t}function rb(e,t,r){if(t>e.LN10.sd())throw jt=!0,r&&(e.precision=r),Error(vn+"LN10 precision limit exceeded");return mt(new e(e.LN10),t)}function so(e){for(var t="";e--;)t+="0";return t}function zc(e,t){var r,n,i,o,s,u,f,l,h,p=1,m=10,g=e,b=g.d,y=g.constructor,w=y.precision;if(g.s<1)throw Error(vn+(g.s?"NaN":"-Infinity"));if(g.eq(Yr))return new y(0);if(t==null?(jt=!1,l=w):l=t,g.eq(10))return t==null&&(jt=!0),rb(y,l);if(l+=m,y.precision=l,r=Xn(b),n=r.charAt(0),o=Dt(g),Math.abs(o)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)g=g.times(e),r=Xn(g.d),n=r.charAt(0),p++;o=Dt(g),n>1?(g=new y("0."+r),o++):g=new y(n+"."+r.slice(1))}else return f=rb(y,l+2,w).times(o+""),g=zc(new y(n+"."+r.slice(1)),l-m).plus(f),y.precision=w,t==null?(jt=!0,mt(g,w)):g;for(u=s=g=Pi(g.minus(Yr),g.plus(Yr),l),h=mt(g.times(g),l),i=3;;){if(s=mt(s.times(h),l),f=u.plus(Pi(s,new y(i),l)),Xn(f.d).slice(0,l)===Xn(u.d).slice(0,l))return u=u.times(2),o!==0&&(u=u.plus(rb(y,l+2,w).times(o+""))),u=Pi(u,new y(p),l),y.precision=w,t==null?(jt=!0,mt(u,w)):u;u=f,i+=2}}function vC(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(n,i),t){if(i-=n,r=r-n-1,e.e=sl(r/St),e.d=[],n=(r+1)%St,r<0&&(n+=St),n$h||e.e<-$h))throw Error(HS+r)}else e.s=0,e.e=0,e.d=[0];return e}function mt(e,t,r){var n,i,o,s,u,f,l,h,p=e.d;for(s=1,o=p[0];o>=10;o/=10)s++;if(n=t-s,n<0)n+=St,i=t,l=p[h=0];else{if(h=Math.ceil((n+1)/St),o=p.length,h>=o)return e;for(l=o=p[h],s=1;o>=10;o/=10)s++;n%=St,i=n-St+s}if(r!==void 0&&(o=Ho(10,s-i-1),u=l/o%10|0,f=t<0||p[h+1]!==void 0||l%o,f=r<4?(u||f)&&(r==0||r==(e.s<0?3:2)):u>5||u==5&&(r==4||f||r==6&&(n>0?i>0?l/Ho(10,s-i):0:p[h-1])%10&1||r==(e.s<0?8:7))),t<1||!p[0])return f?(o=Dt(e),p.length=1,t=t-o-1,p[0]=Ho(10,(St-t%St)%St),e.e=sl(-t/St)||0):(p.length=1,p[0]=e.e=e.s=0),e;if(n==0?(p.length=h,o=1,h--):(p.length=h+1,o=Ho(10,St-n),p[h]=i>0?(l/Ho(10,s-i)%Ho(10,i)|0)*o:0),f)for(;;)if(h==0){(p[0]+=o)==Yt&&(p[0]=1,++e.e);break}else{if(p[h]+=o,p[h]!=Yt)break;p[h--]=0,o=1}for(n=p.length;p[--n]===0;)p.pop();if(jt&&(e.e>$h||e.e<-$h))throw Error(HS+Dt(e));return e}function BD(e,t){var r,n,i,o,s,u,f,l,h,p,m=e.constructor,g=m.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new m(e),jt?mt(t,g):t;if(f=e.d,p=t.d,n=t.e,l=e.e,f=f.slice(),s=l-n,s){for(h=s<0,h?(r=f,s=-s,u=p.length):(r=p,n=l,u=f.length),i=Math.max(Math.ceil(g/St),u)+2,s>i&&(s=i,r.length=1),r.reverse(),i=s;i--;)r.push(0);r.reverse()}else{for(i=f.length,u=p.length,h=i0;--i)f[u++]=0;for(i=p.length;i>s;){if(f[--i]0?o=o.charAt(0)+"."+o.slice(1)+so(n):s>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(i<0?"e":"e+")+i):i<0?(o="0."+so(-i-1)+o,r&&(n=r-s)>0&&(o+=so(n))):i>=s?(o+=so(i+1-s),r&&(n=r-i-1)>0&&(o=o+"."+so(n))):((n=i+1)0&&(i+1===s&&(o+="."),o+=so(n))),e.s<0?"-"+o:o}function gC(e,t){if(e.length>t)return e.length=t,!0}function FD(e){var t,r,n;function i(o){var s=this;if(!(s instanceof i))return new i(o);if(s.constructor=i,o instanceof i){s.s=o.s,s.e=o.e,s.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(Zo+o);if(o>0)s.s=1;else if(o<0)o=-o,s.s=-1;else{s.s=0,s.e=0,s.d=[0];return}if(o===~~o&&o<1e7){s.e=0,s.d=[o];return}return vC(s,o.toString())}else if(typeof o!="string")throw Error(Zo+o);if(o.charCodeAt(0)===45?(o=o.slice(1),s.s=-1):s.s=1,BG.test(o))vC(s,o);else throw Error(Zo+o)}if(i.prototype=Ne,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=FD,i.config=i.set=FG,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=i[t+1]&&n<=i[t+2])this[r]=n;else throw Error(Zo+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Zo+r+": "+n);return this}var VS=FD($G);Yr=new VS(1);const pt=VS;function zG(e){return HG(e)||WG(e)||UG(e)||qG()}function qG(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function UG(e,t){if(e){if(typeof e=="string")return N1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return N1(e,t)}}function WG(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function HG(e){if(Array.isArray(e))return N1(e)}function N1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=t?r.apply(void 0,i):e(t-s,yC(function(){for(var u=arguments.length,f=new Array(u),l=0;le.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!(Symbol.iterator in Object(e)))){var r=[],n=!0,i=!1,o=void 0;try{for(var s=e[Symbol.iterator](),u;!(n=(u=s.next()).done)&&(r.push(u.value),!(t&&r.length===t));n=!0);}catch(f){i=!0,o=f}finally{try{!n&&s.return!=null&&s.return()}finally{if(i)throw o}}return r}}function aK(e){if(Array.isArray(e))return e}function HD(e){var t=qc(e,2),r=t[0],n=t[1],i=r,o=n;return r>n&&(i=n,o=r),[i,o]}function VD(e,t,r){if(e.lte(0))return new pt(0);var n=Zp.getDigitCount(e.toNumber()),i=new pt(10).pow(n),o=e.div(i),s=n!==1?.05:.1,u=new pt(Math.ceil(o.div(s).toNumber())).add(r).mul(s),f=u.mul(i);return t?f:new pt(Math.ceil(f))}function sK(e,t,r){var n=1,i=new pt(e);if(!i.isint()&&r){var o=Math.abs(e);o<1?(n=new pt(10).pow(Zp.getDigitCount(e)-1),i=new pt(Math.floor(i.div(n).toNumber())).mul(n)):o>1&&(i=new pt(Math.floor(e)))}else e===0?i=new pt(Math.floor((t-1)/2)):r||(i=new pt(Math.floor(e)));var s=Math.floor((t-1)/2),u=XG(KG(function(f){return i.add(new pt(f-s).mul(n)).toNumber()}),A1);return u(0,t)}function GD(e,t,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(r-1)))return{step:new pt(0),tickMin:new pt(0),tickMax:new pt(0)};var o=VD(new pt(t).sub(e).div(r-1),n,i),s;e<=0&&t>=0?s=new pt(0):(s=new pt(e).add(t).div(2),s=s.sub(new pt(s).mod(o)));var u=Math.ceil(s.sub(e).div(o).toNumber()),f=Math.ceil(new pt(t).sub(s).div(o).toNumber()),l=u+f+1;return l>r?GD(e,t,r,n,i+1):(l0?f+(r-l):f,u=t>0?u:u+(r-l)),{step:o,tickMin:s.sub(new pt(u).mul(o)),tickMax:s.add(new pt(f).mul(o))})}function lK(e){var t=qc(e,2),r=t[0],n=t[1],i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=Math.max(i,2),u=HD([r,n]),f=qc(u,2),l=f[0],h=f[1];if(l===-1/0||h===1/0){var p=h===1/0?[l].concat(T1(A1(0,i-1).map(function(){return 1/0}))):[].concat(T1(A1(0,i-1).map(function(){return-1/0})),[h]);return r>n?C1(p):p}if(l===h)return sK(l,i,o);var m=GD(l,h,s,o),g=m.step,b=m.tickMin,y=m.tickMax,w=Zp.rangeStep(b,y.add(new pt(.1).mul(g)),g);return r>n?C1(w):w}function cK(e,t){var r=qc(e,2),n=r[0],i=r[1],o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,s=HD([n,i]),u=qc(s,2),f=u[0],l=u[1];if(f===-1/0||l===1/0)return[n,i];if(f===l)return[f];var h=Math.max(t,2),p=VD(new pt(l).sub(f).div(h-1),o,0),m=[].concat(T1(Zp.rangeStep(new pt(f),new pt(l).sub(new pt(.99).mul(p)),p)),[l]);return n>i?C1(m):m}var uK=UD(lK),fK=UD(cK),dK="Invariant failed";function ia(e,t){throw new Error(dK)}var hK=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function ks(e){"@babel/helpers - typeof";return ks=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ks(e)}function Bh(){return Bh=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function bK(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function wK(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function SK(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&arguments[1]!==void 0?arguments[1]:[],i=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,s=-1,u=(r=n?.length)!==null&&r!==void 0?r:0;if(u<=1)return 0;if(o&&o.axisType==="angleAxis"&&Math.abs(Math.abs(o.range[1]-o.range[0])-360)<=1e-6)for(var f=o.range,l=0;l0?i[l-1].coordinate:i[u-1].coordinate,p=i[l].coordinate,m=l>=u-1?i[0].coordinate:i[l+1].coordinate,g=void 0;if(gr(p-h)!==gr(m-p)){var b=[];if(gr(m-p)===gr(f[1]-f[0])){g=m;var y=p+f[1]-f[0];b[0]=Math.min(y,(y+h)/2),b[1]=Math.max(y,(y+h)/2)}else{g=h;var w=m+f[1]-f[0];b[0]=Math.min(p,(w+p)/2),b[1]=Math.max(p,(w+p)/2)}var j=[Math.min(p,(g+p)/2),Math.max(p,(g+p)/2)];if(t>j[0]&&t<=j[1]||t>=b[0]&&t<=b[1]){s=i[l].index;break}}else{var O=Math.min(h,m),E=Math.max(h,m);if(t>(O+p)/2&&t<=(E+p)/2){s=i[l].index;break}}}else for(var A=0;A0&&A(n[A].coordinate+n[A-1].coordinate)/2&&t<=(n[A].coordinate+n[A+1].coordinate)/2||A===u-1&&t>(n[A].coordinate+n[A-1].coordinate)/2){s=n[A].index;break}return s},GS=function(t){var r,n=t,i=n.type.displayName,o=(r=t.type)!==null&&r!==void 0&&r.defaultProps?Ct(Ct({},t.type.defaultProps),t.props):t.props,s=o.stroke,u=o.fill,f;switch(i){case"Line":f=s;break;case"Area":case"Radar":f=s&&s!=="none"?s:u;break;default:f=u;break}return f},BK=function(t){var r=t.barSize,n=t.totalSize,i=t.stackGroups,o=i===void 0?{}:i;if(!o)return{};for(var s={},u=Object.keys(o),f=0,l=u.length;f=0});if(j&&j.length){var O=j[0].type.defaultProps,E=O!==void 0?Ct(Ct({},O),j[0].props):j[0].props,A=E.barSize,N=E[w];s[N]||(s[N]=[]);var C=We(A)?r:A;s[N].push({item:j[0],stackList:j.slice(1),barSize:We(C)?void 0:yr(C,n,0)})}}return s},FK=function(t){var r=t.barGap,n=t.barCategoryGap,i=t.bandSize,o=t.sizeList,s=o===void 0?[]:o,u=t.maxBarSize,f=s.length;if(f<1)return null;var l=yr(r,i,0,!0),h,p=[];if(s[0].barSize===+s[0].barSize){var m=!1,g=i/f,b=s.reduce(function(A,N){return A+N.barSize||0},0);b+=(f-1)*l,b>=i&&(b-=(f-1)*l,l=0),b>=i&&g>0&&(m=!0,g*=.9,b=f*g);var y=(i-b)/2>>0,w={offset:y-l,size:0};h=s.reduce(function(A,N){var C={item:N.item,position:{offset:w.offset+w.size+l,size:m?g:N.barSize}},T=[].concat(wC(A),[C]);return w=T[T.length-1].position,N.stackList&&N.stackList.length&&N.stackList.forEach(function(R){T.push({item:R,position:w})}),T},p)}else{var j=yr(n,i,0,!0);i-2*j-(f-1)*l<=0&&(l=0);var O=(i-2*j-(f-1)*l)/f;O>1&&(O>>=0);var E=u===+u?Math.min(O,u):O;h=s.reduce(function(A,N,C){var T=[].concat(wC(A),[{item:N.item,position:{offset:j+(O+l)*C+(O-E)/2,size:E}}]);return N.stackList&&N.stackList.length&&N.stackList.forEach(function(R){T.push({item:R,position:T[T.length-1].position})}),T},p)}return h},zK=function(t,r,n,i){var o=n.children,s=n.width,u=n.margin,f=s-(u.left||0)-(u.right||0),l=QD({children:o,legendWidth:f});if(l){var h=i||{},p=h.width,m=h.height,g=l.align,b=l.verticalAlign,y=l.layout;if((y==="vertical"||y==="horizontal"&&b==="middle")&&g!=="center"&&be(t[g]))return Ct(Ct({},t),{},ps({},g,t[g]+(p||0)));if((y==="horizontal"||y==="vertical"&&g==="center")&&b!=="middle"&&be(t[b]))return Ct(Ct({},t),{},ps({},b,t[b]+(m||0)))}return t},qK=function(t,r,n){return We(r)?!0:t==="horizontal"?r==="yAxis":t==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},ZD=function(t,r,n,i,o){var s=r.props.children,u=Zr(s,_u).filter(function(l){return qK(i,o,l.props.direction)});if(u&&u.length){var f=u.map(function(l){return l.props.dataKey});return t.reduce(function(l,h){var p=Wt(h,n);if(We(p))return l;var m=Array.isArray(p)?[Yp(p),Xp(p)]:[p,p],g=f.reduce(function(b,y){var w=Wt(h,y,0),j=m[0]-Math.abs(Array.isArray(w)?w[0]:w),O=m[1]+Math.abs(Array.isArray(w)?w[1]:w);return[Math.min(j,b[0]),Math.max(O,b[1])]},[1/0,-1/0]);return[Math.min(g[0],l[0]),Math.max(g[1],l[1])]},[1/0,-1/0])}return null},UK=function(t,r,n,i,o){var s=r.map(function(u){return ZD(t,u,n,o,i)}).filter(function(u){return!We(u)});return s&&s.length?s.reduce(function(u,f){return[Math.min(u[0],f[0]),Math.max(u[1],f[1])]},[1/0,-1/0]):null},JD=function(t,r,n,i,o){var s=r.map(function(f){var l=f.props.dataKey;return n==="number"&&l&&ZD(t,f,l,i)||Sc(t,l,n,o)});if(n==="number")return s.reduce(function(f,l){return[Math.min(f[0],l[0]),Math.max(f[1],l[1])]},[1/0,-1/0]);var u={};return s.reduce(function(f,l){for(var h=0,p=l.length;h=2?gr(u[0]-u[1])*2*l:l,r&&(t.ticks||t.niceTicks)){var h=(t.ticks||t.niceTicks).map(function(p){var m=o?o.indexOf(p):p;return{coordinate:i(m)+l,value:p,offset:l}});return h.filter(function(p){return!vu(p.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(p,m){return{coordinate:i(p)+l,value:p,index:m,offset:l}}):i.ticks&&!n?i.ticks(t.tickCount).map(function(p){return{coordinate:i(p)+l,value:p,offset:l}}):i.domain().map(function(p,m){return{coordinate:i(p)+l,value:o?o[p]:p,index:m,offset:l}})},nb=new WeakMap,sd=function(t,r){if(typeof r!="function")return t;nb.has(t)||nb.set(t,new WeakMap);var n=nb.get(t);if(n.has(r))return n.get(r);var i=function(){t.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,i),i},rL=function(t,r,n){var i=t.scale,o=t.type,s=t.layout,u=t.axisType;if(i==="auto")return s==="radial"&&u==="radiusAxis"?{scale:Dc(),realScaleType:"band"}:s==="radial"&&u==="angleAxis"?{scale:Mh(),realScaleType:"linear"}:o==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:wc(),realScaleType:"point"}:o==="category"?{scale:Dc(),realScaleType:"band"}:{scale:Mh(),realScaleType:"linear"};if(ea(i)){var f="scale".concat(Mp(i));return{scale:(sC[f]||wc)(),realScaleType:sC[f]?f:"point"}}return qe(i)?{scale:i}:{scale:wc(),realScaleType:"point"}},_C=1e-4,nL=function(t){var r=t.domain();if(!(!r||r.length<=2)){var n=r.length,i=t.range(),o=Math.min(i[0],i[1])-_C,s=Math.max(i[0],i[1])+_C,u=t(r[0]),f=t(r[n-1]);(us||fs)&&t.domain([r[0],r[n-1]])}},WK=function(t,r){if(!t)return null;for(var n=0,i=t.length;ni)&&(o[1]=i),o[0]>i&&(o[0]=i),o[1]=0?(t[u][n][0]=o,t[u][n][1]=o+f,o=t[u][n][1]):(t[u][n][0]=s,t[u][n][1]=s+f,s=t[u][n][1])}},GK=function(t){var r=t.length;if(!(r<=0))for(var n=0,i=t[0].length;n=0?(t[s][n][0]=o,t[s][n][1]=o+u,o=t[s][n][1]):(t[s][n][0]=0,t[s][n][1]=0)}},KK={sign:VK,expand:I9,none:js,silhouette:D9,wiggle:L9,positive:GK},XK=function(t,r,n){var i=r.map(function(u){return u.props.dataKey}),o=KK[n],s=M9().keys(i).value(function(u,f){return+Wt(u,f,0)}).order(u1).offset(o);return s(t)},YK=function(t,r,n,i,o,s){if(!t)return null;var u=s?r.reverse():r,f={},l=u.reduce(function(p,m){var g,b=(g=m.type)!==null&&g!==void 0&&g.defaultProps?Ct(Ct({},m.type.defaultProps),m.props):m.props,y=b.stackId,w=b.hide;if(w)return p;var j=b[n],O=p[j]||{hasStack:!1,stackGroups:{}};if(Ht(y)){var E=O.stackGroups[y]||{numericAxisId:n,cateAxisId:i,items:[]};E.items.push(m),O.hasStack=!0,O.stackGroups[y]=E}else O.stackGroups[nl("_stackId_")]={numericAxisId:n,cateAxisId:i,items:[m]};return Ct(Ct({},p),{},ps({},j,O))},f),h={};return Object.keys(l).reduce(function(p,m){var g=l[m];if(g.hasStack){var b={};g.stackGroups=Object.keys(g.stackGroups).reduce(function(y,w){var j=g.stackGroups[w];return Ct(Ct({},y),{},ps({},w,{numericAxisId:n,cateAxisId:i,items:j.items,stackedData:XK(t,j.items,o)}))},b)}return Ct(Ct({},p),{},ps({},m,g))},h)},iL=function(t,r){var n=r.realScaleType,i=r.type,o=r.tickCount,s=r.originalDomain,u=r.allowDecimals,f=n||r.scale;if(f!=="auto"&&f!=="linear")return null;if(o&&i==="number"&&s&&(s[0]==="auto"||s[1]==="auto")){var l=t.domain();if(!l.length)return null;var h=uK(l,o,u);return t.domain([Yp(h),Xp(h)]),{niceTicks:h}}if(o&&i==="number"){var p=t.domain(),m=fK(p,o,u);return{niceTicks:m}}return null};function jC(e){var t=e.axis,r=e.ticks,n=e.bandSize,i=e.entry,o=e.index,s=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!We(i[t.dataKey])){var u=ph(r,"value",i[t.dataKey]);if(u)return u.coordinate+n/2}return r[o]?r[o].coordinate+n/2:null}var f=Wt(i,We(s)?t.dataKey:s);return We(f)?null:t.scale(f)}var OC=function(t){var r=t.axis,n=t.ticks,i=t.offset,o=t.bandSize,s=t.entry,u=t.index;if(r.type==="category")return n[u]?n[u].coordinate+i:null;var f=Wt(s,r.dataKey,r.domain[u]);return We(f)?null:r.scale(f)-o/2+i},QK=function(t){var r=t.numericAxis,n=r.scale.domain();if(r.type==="number"){var i=Math.min(n[0],n[1]),o=Math.max(n[0],n[1]);return i<=0&&o>=0?0:o<0?o:i}return n[0]},ZK=function(t,r){var n,i=(n=t.type)!==null&&n!==void 0&&n.defaultProps?Ct(Ct({},t.type.defaultProps),t.props):t.props,o=i.stackId;if(Ht(o)){var s=r[o];if(s){var u=s.items.indexOf(t);return u>=0?s.stackedData[u]:null}}return null},JK=function(t){return t.reduce(function(r,n){return[Yp(n.concat([r[0]]).filter(be)),Xp(n.concat([r[1]]).filter(be))]},[1/0,-1/0])},oL=function(t,r,n){return Object.keys(t).reduce(function(i,o){var s=t[o],u=s.stackedData,f=u.reduce(function(l,h){var p=JK(h.slice(r,n+1));return[Math.min(l[0],p[0]),Math.max(l[1],p[1])]},[1/0,-1/0]);return[Math.min(f[0],i[0]),Math.max(f[1],i[1])]},[1/0,-1/0]).map(function(i){return i===1/0||i===-1/0?0:i})},EC=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,PC=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,I1=function(t,r,n){if(qe(t))return t(r,n);if(!Array.isArray(t))return r;var i=[];if(be(t[0]))i[0]=n?t[0]:Math.min(t[0],r[0]);else if(EC.test(t[0])){var o=+EC.exec(t[0])[1];i[0]=r[0]-o}else qe(t[0])?i[0]=t[0](r[0]):i[0]=r[0];if(be(t[1]))i[1]=n?t[1]:Math.max(t[1],r[1]);else if(PC.test(t[1])){var s=+PC.exec(t[1])[1];i[1]=r[1]+s}else qe(t[1])?i[1]=t[1](r[1]):i[1]=r[1];return i},zh=function(t,r,n){if(t&&t.scale&&t.scale.bandwidth){var i=t.scale.bandwidth();if(!n||i>0)return i}if(t&&r&&r.length>=2){for(var o=wS(r,function(p){return p.coordinate}),s=1/0,u=1,f=o.length;ue.length)&&(t=e.length);for(var r=0,n=new Array(t);r2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},lX=function(t,r,n,i,o){var s=t.width,u=t.height,f=t.startAngle,l=t.endAngle,h=yr(t.cx,s,s/2),p=yr(t.cy,u,u/2),m=lL(s,u,n),g=yr(t.innerRadius,m,0),b=yr(t.outerRadius,m,m*.8),y=Object.keys(r);return y.reduce(function(w,j){var O=r[j],E=O.domain,A=O.reversed,N;if(We(O.range))i==="angleAxis"?N=[f,l]:i==="radiusAxis"&&(N=[g,b]),A&&(N=[N[1],N[0]]);else{N=O.range;var C=N,T=rX(C,2);f=T[0],l=T[1]}var R=rL(O,o),I=R.realScaleType,F=R.scale;F.domain(E).range(N),nL(F);var L=iL(F,wi(wi({},O),{},{realScaleType:I})),$=wi(wi(wi({},O),L),{},{range:N,radius:b,realScaleType:I,scale:F,cx:h,cy:p,innerRadius:g,outerRadius:b,startAngle:f,endAngle:l});return wi(wi({},w),{},sL({},j,$))},{})},cX=function(t,r){var n=t.x,i=t.y,o=r.x,s=r.y;return Math.sqrt(Math.pow(n-o,2)+Math.pow(i-s,2))},uX=function(t,r){var n=t.x,i=t.y,o=r.cx,s=r.cy,u=cX({x:n,y:i},{x:o,y:s});if(u<=0)return{radius:u};var f=(n-o)/u,l=Math.acos(f);return i>s&&(l=2*Math.PI-l),{radius:u,angle:sX(l),angleInRadian:l}},fX=function(t){var r=t.startAngle,n=t.endAngle,i=Math.floor(r/360),o=Math.floor(n/360),s=Math.min(i,o);return{startAngle:r-s*360,endAngle:n-s*360}},dX=function(t,r){var n=r.startAngle,i=r.endAngle,o=Math.floor(n/360),s=Math.floor(i/360),u=Math.min(o,s);return t+u*360},TC=function(t,r){var n=t.x,i=t.y,o=uX({x:n,y:i},r),s=o.radius,u=o.angle,f=r.innerRadius,l=r.outerRadius;if(sl)return!1;if(s===0)return!0;var h=fX(r),p=h.startAngle,m=h.endAngle,g=u,b;if(p<=m){for(;g>m;)g-=360;for(;g=p&&g<=m}else{for(;g>p;)g-=360;for(;g=m&&g<=p}return b?wi(wi({},r),{},{radius:s,angle:dX(g,r)}):null},cL=function(t){return!S.isValidElement(t)&&!qe(t)&&typeof t!="boolean"?t.className:""};function Vc(e){"@babel/helpers - typeof";return Vc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vc(e)}var hX=["offset"];function pX(e){return yX(e)||gX(e)||vX(e)||mX()}function mX(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vX(e,t){if(e){if(typeof e=="string")return D1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return D1(e,t)}}function gX(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function yX(e){if(Array.isArray(e))return D1(e)}function D1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function bX(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function kC(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ut(e){for(var t=1;t=0?1:-1,E,A;i==="insideStart"?(E=g+O*s,A=y):i==="insideEnd"?(E=b-O*s,A=!y):i==="end"&&(E=b+O*s,A=y),A=j<=0?A:!A;var N=xt(l,h,w,E),C=xt(l,h,w,E+(A?1:-1)*359),T="M".concat(N.x,",").concat(N.y,` + A`).concat(w,",").concat(w,",0,1,").concat(A?0:1,`, + `).concat(C.x,",").concat(C.y),R=We(t.id)?nl("recharts-radial-line-"):t.id;return z.createElement("text",Gc({},n,{dominantBaseline:"central",className:He("recharts-radial-bar-label",u)}),z.createElement("defs",null,z.createElement("path",{id:R,d:T})),z.createElement("textPath",{xlinkHref:"#".concat(R)},r))},PX=function(t){var r=t.viewBox,n=t.offset,i=t.position,o=r,s=o.cx,u=o.cy,f=o.innerRadius,l=o.outerRadius,h=o.startAngle,p=o.endAngle,m=(h+p)/2;if(i==="outside"){var g=xt(s,u,l+n,m),b=g.x,y=g.y;return{x:b,y,textAnchor:b>=s?"start":"end",verticalAnchor:"middle"}}if(i==="center")return{x:s,y:u,textAnchor:"middle",verticalAnchor:"middle"};if(i==="centerTop")return{x:s,y:u,textAnchor:"middle",verticalAnchor:"start"};if(i==="centerBottom")return{x:s,y:u,textAnchor:"middle",verticalAnchor:"end"};var w=(f+l)/2,j=xt(s,u,w,m),O=j.x,E=j.y;return{x:O,y:E,textAnchor:"middle",verticalAnchor:"middle"}},NX=function(t){var r=t.viewBox,n=t.parentViewBox,i=t.offset,o=t.position,s=r,u=s.x,f=s.y,l=s.width,h=s.height,p=h>=0?1:-1,m=p*i,g=p>0?"end":"start",b=p>0?"start":"end",y=l>=0?1:-1,w=y*i,j=y>0?"end":"start",O=y>0?"start":"end";if(o==="top"){var E={x:u+l/2,y:f-p*i,textAnchor:"middle",verticalAnchor:g};return Ut(Ut({},E),n?{height:Math.max(f-n.y,0),width:l}:{})}if(o==="bottom"){var A={x:u+l/2,y:f+h+m,textAnchor:"middle",verticalAnchor:b};return Ut(Ut({},A),n?{height:Math.max(n.y+n.height-(f+h),0),width:l}:{})}if(o==="left"){var N={x:u-w,y:f+h/2,textAnchor:j,verticalAnchor:"middle"};return Ut(Ut({},N),n?{width:Math.max(N.x-n.x,0),height:h}:{})}if(o==="right"){var C={x:u+l+w,y:f+h/2,textAnchor:O,verticalAnchor:"middle"};return Ut(Ut({},C),n?{width:Math.max(n.x+n.width-C.x,0),height:h}:{})}var T=n?{width:l,height:h}:{};return o==="insideLeft"?Ut({x:u+w,y:f+h/2,textAnchor:O,verticalAnchor:"middle"},T):o==="insideRight"?Ut({x:u+l-w,y:f+h/2,textAnchor:j,verticalAnchor:"middle"},T):o==="insideTop"?Ut({x:u+l/2,y:f+m,textAnchor:"middle",verticalAnchor:b},T):o==="insideBottom"?Ut({x:u+l/2,y:f+h-m,textAnchor:"middle",verticalAnchor:g},T):o==="insideTopLeft"?Ut({x:u+w,y:f+m,textAnchor:O,verticalAnchor:b},T):o==="insideTopRight"?Ut({x:u+l-w,y:f+m,textAnchor:j,verticalAnchor:b},T):o==="insideBottomLeft"?Ut({x:u+w,y:f+h-m,textAnchor:O,verticalAnchor:g},T):o==="insideBottomRight"?Ut({x:u+l-w,y:f+h-m,textAnchor:j,verticalAnchor:g},T):rl(o)&&(be(o.x)||Go(o.x))&&(be(o.y)||Go(o.y))?Ut({x:u+yr(o.x,l),y:f+yr(o.y,h),textAnchor:"end",verticalAnchor:"end"},T):Ut({x:u+l/2,y:f+h/2,textAnchor:"middle",verticalAnchor:"middle"},T)},AX=function(t){return"cx"in t&&be(t.cx)};function Qt(e){var t=e.offset,r=t===void 0?5:t,n=xX(e,hX),i=Ut({offset:r},n),o=i.viewBox,s=i.position,u=i.value,f=i.children,l=i.content,h=i.className,p=h===void 0?"":h,m=i.textBreakAll;if(!o||We(u)&&We(f)&&!S.isValidElement(l)&&!qe(l))return null;if(S.isValidElement(l))return S.cloneElement(l,i);var g;if(qe(l)){if(g=S.createElement(l,i),S.isValidElement(g))return g}else g=jX(i);var b=AX(o),y=Be(i,!0);if(b&&(s==="insideStart"||s==="insideEnd"||s==="end"))return EX(i,g,y);var w=b?PX(i):NX(i);return z.createElement(ra,Gc({className:He("recharts-label",p)},y,w,{breakAll:m}),g)}Qt.displayName="Label";var uL=function(t){var r=t.cx,n=t.cy,i=t.angle,o=t.startAngle,s=t.endAngle,u=t.r,f=t.radius,l=t.innerRadius,h=t.outerRadius,p=t.x,m=t.y,g=t.top,b=t.left,y=t.width,w=t.height,j=t.clockWise,O=t.labelViewBox;if(O)return O;if(be(y)&&be(w)){if(be(p)&&be(m))return{x:p,y:m,width:y,height:w};if(be(g)&&be(b))return{x:g,y:b,width:y,height:w}}return be(p)&&be(m)?{x:p,y:m,width:0,height:0}:be(r)&&be(n)?{cx:r,cy:n,startAngle:o||i||0,endAngle:s||i||0,innerRadius:l||0,outerRadius:h||f||u||0,clockWise:j}:t.viewBox?t.viewBox:{}},CX=function(t,r){return t?t===!0?z.createElement(Qt,{key:"label-implicit",viewBox:r}):Ht(t)?z.createElement(Qt,{key:"label-implicit",viewBox:r,value:t}):S.isValidElement(t)?t.type===Qt?S.cloneElement(t,{key:"label-implicit",viewBox:r}):z.createElement(Qt,{key:"label-implicit",content:t,viewBox:r}):qe(t)?z.createElement(Qt,{key:"label-implicit",content:t,viewBox:r}):rl(t)?z.createElement(Qt,Gc({viewBox:r},t,{key:"label-implicit"})):null:null},TX=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&n&&!t.label)return null;var i=t.children,o=uL(t),s=Zr(i,Qt).map(function(f,l){return S.cloneElement(f,{viewBox:r||o,key:"label-".concat(l)})});if(!n)return s;var u=CX(t.label,r||o);return[u].concat(pX(s))};Qt.parseViewBox=uL;Qt.renderCallByParent=TX;var ib,RC;function kX(){if(RC)return ib;RC=1;function e(t){var r=t==null?0:t.length;return r?t[r-1]:void 0}return ib=e,ib}var RX=kX();const MX=ct(RX);function Kc(e){"@babel/helpers - typeof";return Kc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kc(e)}var IX=["valueAccessor"],DX=["data","dataKey","clockWise","id","textBreakAll"];function LX(e){return zX(e)||FX(e)||BX(e)||$X()}function $X(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function BX(e,t){if(e){if(typeof e=="string")return L1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return L1(e,t)}}function FX(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function zX(e){if(Array.isArray(e))return L1(e)}function L1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function HX(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var VX=function(t){return Array.isArray(t.value)?MX(t.value):t.value};function Ni(e){var t=e.valueAccessor,r=t===void 0?VX:t,n=DC(e,IX),i=n.data,o=n.dataKey,s=n.clockWise,u=n.id,f=n.textBreakAll,l=DC(n,DX);return!i||!i.length?null:z.createElement(at,{className:"recharts-label-list"},i.map(function(h,p){var m=We(o)?r(h,p):Wt(h&&h.payload,o),g=We(u)?{}:{id:"".concat(u,"-").concat(p)};return z.createElement(Qt,Uh({},Be(h,!0),l,g,{parentViewBox:h.parentViewBox,value:m,textBreakAll:f,viewBox:Qt.parseViewBox(We(s)?h:IC(IC({},h),{},{clockWise:s})),key:"label-".concat(p),index:p}))}))}Ni.displayName="LabelList";function GX(e,t){return e?e===!0?z.createElement(Ni,{key:"labelList-implicit",data:t}):z.isValidElement(e)||qe(e)?z.createElement(Ni,{key:"labelList-implicit",data:t,content:e}):rl(e)?z.createElement(Ni,Uh({data:t},e,{key:"labelList-implicit"})):null:null}function KX(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&r&&!e.label)return null;var n=e.children,i=Zr(n,Ni).map(function(s,u){return S.cloneElement(s,{data:t,key:"labelList-".concat(u)})});if(!r)return i;var o=GX(e.label,t);return[o].concat(LX(i))}Ni.renderCallByParent=KX;function Xc(e){"@babel/helpers - typeof";return Xc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xc(e)}function $1(){return $1=Object.assign?Object.assign.bind():function(e){for(var t=1;t180),",").concat(+(s>l),`, + `).concat(p.x,",").concat(p.y,` + `);if(i>0){var g=xt(r,n,i,s),b=xt(r,n,i,l);m+="L ".concat(b.x,",").concat(b.y,` + A `).concat(i,",").concat(i,`,0, + `).concat(+(Math.abs(f)>180),",").concat(+(s<=l),`, + `).concat(g.x,",").concat(g.y," Z")}else m+="L ".concat(r,",").concat(n," Z");return m},JX=function(t){var r=t.cx,n=t.cy,i=t.innerRadius,o=t.outerRadius,s=t.cornerRadius,u=t.forceCornerRadius,f=t.cornerIsExternal,l=t.startAngle,h=t.endAngle,p=gr(h-l),m=ld({cx:r,cy:n,radius:o,angle:l,sign:p,cornerRadius:s,cornerIsExternal:f}),g=m.circleTangency,b=m.lineTangency,y=m.theta,w=ld({cx:r,cy:n,radius:o,angle:h,sign:-p,cornerRadius:s,cornerIsExternal:f}),j=w.circleTangency,O=w.lineTangency,E=w.theta,A=f?Math.abs(l-h):Math.abs(l-h)-y-E;if(A<0)return u?"M ".concat(b.x,",").concat(b.y,` + a`).concat(s,",").concat(s,",0,0,1,").concat(s*2,`,0 + a`).concat(s,",").concat(s,",0,0,1,").concat(-s*2,`,0 + `):fL({cx:r,cy:n,innerRadius:i,outerRadius:o,startAngle:l,endAngle:h});var N="M ".concat(b.x,",").concat(b.y,` + A`).concat(s,",").concat(s,",0,0,").concat(+(p<0),",").concat(g.x,",").concat(g.y,` + A`).concat(o,",").concat(o,",0,").concat(+(A>180),",").concat(+(p<0),",").concat(j.x,",").concat(j.y,` + A`).concat(s,",").concat(s,",0,0,").concat(+(p<0),",").concat(O.x,",").concat(O.y,` + `);if(i>0){var C=ld({cx:r,cy:n,radius:i,angle:l,sign:p,isExternal:!0,cornerRadius:s,cornerIsExternal:f}),T=C.circleTangency,R=C.lineTangency,I=C.theta,F=ld({cx:r,cy:n,radius:i,angle:h,sign:-p,isExternal:!0,cornerRadius:s,cornerIsExternal:f}),L=F.circleTangency,$=F.lineTangency,U=F.theta,G=f?Math.abs(l-h):Math.abs(l-h)-I-U;if(G<0&&s===0)return"".concat(N,"L").concat(r,",").concat(n,"Z");N+="L".concat($.x,",").concat($.y,` + A`).concat(s,",").concat(s,",0,0,").concat(+(p<0),",").concat(L.x,",").concat(L.y,` + A`).concat(i,",").concat(i,",0,").concat(+(G>180),",").concat(+(p>0),",").concat(T.x,",").concat(T.y,` + A`).concat(s,",").concat(s,",0,0,").concat(+(p<0),",").concat(R.x,",").concat(R.y,"Z")}else N+="L".concat(r,",").concat(n,"Z");return N},eY={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},dL=function(t){var r=$C($C({},eY),t),n=r.cx,i=r.cy,o=r.innerRadius,s=r.outerRadius,u=r.cornerRadius,f=r.forceCornerRadius,l=r.cornerIsExternal,h=r.startAngle,p=r.endAngle,m=r.className;if(s0&&Math.abs(h-p)<360?w=JX({cx:n,cy:i,innerRadius:o,outerRadius:s,cornerRadius:Math.min(y,b/2),forceCornerRadius:f,cornerIsExternal:l,startAngle:h,endAngle:p}):w=fL({cx:n,cy:i,innerRadius:o,outerRadius:s,startAngle:h,endAngle:p}),z.createElement("path",$1({},Be(r,!0),{className:g,d:w,role:"img"}))};function Yc(e){"@babel/helpers - typeof";return Yc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yc(e)}function B1(){return B1=Object.assign?Object.assign.bind():function(e){for(var t=1;tdY.call(e,t));function ya(e,t){return e===t||!e&&!t&&e!==e&&t!==t}const mY="__v",vY="__o",gY="_owner",{getOwnPropertyDescriptor:VC,keys:GC}=Object;function yY(e,t){return e.byteLength===t.byteLength&&Hh(new Uint8Array(e),new Uint8Array(t))}function xY(e,t,r){let n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(!r.equals(e[n],t[n],n,n,e,t,r))return!1;return!0}function bY(e,t){return e.byteLength===t.byteLength&&Hh(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function wY(e,t){return ya(e.getTime(),t.getTime())}function SY(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function _Y(e,t){return e===t}function KC(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const i=new Array(n),o=e.entries();let s,u,f=0;for(;(s=o.next())&&!s.done;){const l=t.entries();let h=!1,p=0;for(;(u=l.next())&&!u.done;){if(i[p]){p++;continue}const m=s.value,g=u.value;if(r.equals(m[0],g[0],f,p,e,t,r)&&r.equals(m[1],g[1],m[0],g[0],e,t,r)){h=i[p]=!0;break}p++}if(!h)return!1;f++}return!0}const jY=ya;function OY(e,t,r){const n=GC(e);let i=n.length;if(GC(t).length!==i)return!1;for(;i-- >0;)if(!hL(e,t,r,n[i]))return!1;return!0}function sc(e,t,r){const n=HC(e);let i=n.length;if(HC(t).length!==i)return!1;let o,s,u;for(;i-- >0;)if(o=n[i],!hL(e,t,r,o)||(s=VC(e,o),u=VC(t,o),(s||u)&&(!s||!u||s.configurable!==u.configurable||s.enumerable!==u.enumerable||s.writable!==u.writable)))return!1;return!0}function EY(e,t){return ya(e.valueOf(),t.valueOf())}function PY(e,t){return e.source===t.source&&e.flags===t.flags}function XC(e,t,r){const n=e.size;if(n!==t.size)return!1;if(!n)return!0;const i=new Array(n),o=e.values();let s,u;for(;(s=o.next())&&!s.done;){const f=t.values();let l=!1,h=0;for(;(u=f.next())&&!u.done;){if(!i[h]&&r.equals(s.value,u.value,s.value,u.value,e,t,r)){l=i[h]=!0;break}h++}if(!l)return!1}return!0}function Hh(e,t){let r=e.byteLength;if(t.byteLength!==r||e.byteOffset!==t.byteOffset)return!1;for(;r-- >0;)if(e[r]!==t[r])return!1;return!0}function NY(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function hL(e,t,r,n){return(n===gY||n===vY||n===mY)&&(e.$$typeof||t.$$typeof)?!0:pY(t,n)&&r.equals(e[n],t[n],n,n,e,t,r)}const AY="[object ArrayBuffer]",CY="[object Arguments]",TY="[object Boolean]",kY="[object DataView]",RY="[object Date]",MY="[object Error]",IY="[object Map]",DY="[object Number]",LY="[object Object]",$Y="[object RegExp]",BY="[object Set]",FY="[object String]",zY={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},qY="[object URL]",UY=Object.prototype.toString;function WY({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:r,areDatesEqual:n,areErrorsEqual:i,areFunctionsEqual:o,areMapsEqual:s,areNumbersEqual:u,areObjectsEqual:f,arePrimitiveWrappersEqual:l,areRegExpsEqual:h,areSetsEqual:p,areTypedArraysEqual:m,areUrlsEqual:g,unknownTagComparators:b}){return function(w,j,O){if(w===j)return!0;if(w==null||j==null)return!1;const E=typeof w;if(E!==typeof j)return!1;if(E!=="object")return E==="number"?u(w,j,O):E==="function"?o(w,j,O):!1;const A=w.constructor;if(A!==j.constructor)return!1;if(A===Object)return f(w,j,O);if(Array.isArray(w))return t(w,j,O);if(A===Date)return n(w,j,O);if(A===RegExp)return h(w,j,O);if(A===Map)return s(w,j,O);if(A===Set)return p(w,j,O);const N=UY.call(w);if(N===RY)return n(w,j,O);if(N===$Y)return h(w,j,O);if(N===IY)return s(w,j,O);if(N===BY)return p(w,j,O);if(N===LY)return typeof w.then!="function"&&typeof j.then!="function"&&f(w,j,O);if(N===qY)return g(w,j,O);if(N===MY)return i(w,j,O);if(N===CY)return f(w,j,O);if(zY[N])return m(w,j,O);if(N===AY)return e(w,j,O);if(N===kY)return r(w,j,O);if(N===TY||N===DY||N===FY)return l(w,j,O);if(b){let C=b[N];if(!C){const T=hY(w);T&&(C=b[T])}if(C)return C(w,j,O)}return!1}}function HY({circular:e,createCustomConfig:t,strict:r}){let n={areArrayBuffersEqual:yY,areArraysEqual:r?sc:xY,areDataViewsEqual:bY,areDatesEqual:wY,areErrorsEqual:SY,areFunctionsEqual:_Y,areMapsEqual:r?lb(KC,sc):KC,areNumbersEqual:jY,areObjectsEqual:r?sc:OY,arePrimitiveWrappersEqual:EY,areRegExpsEqual:PY,areSetsEqual:r?lb(XC,sc):XC,areTypedArraysEqual:r?lb(Hh,sc):Hh,areUrlsEqual:NY,unknownTagComparators:void 0};if(t&&(n=Object.assign({},n,t(n))),e){const i=ud(n.areArraysEqual),o=ud(n.areMapsEqual),s=ud(n.areObjectsEqual),u=ud(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:i,areMapsEqual:o,areObjectsEqual:s,areSetsEqual:u})}return n}function VY(e){return function(t,r,n,i,o,s,u){return e(t,r,u)}}function GY({circular:e,comparator:t,createState:r,equals:n,strict:i}){if(r)return function(u,f){const{cache:l=e?new WeakMap:void 0,meta:h}=r();return t(u,f,{cache:l,equals:n,meta:h,strict:i})};if(e)return function(u,f){return t(u,f,{cache:new WeakMap,equals:n,meta:void 0,strict:i})};const o={cache:void 0,equals:n,meta:void 0,strict:i};return function(u,f){return t(u,f,o)}}const KY=xo();xo({strict:!0});xo({circular:!0});xo({circular:!0,strict:!0});xo({createInternalComparator:()=>ya});xo({strict:!0,createInternalComparator:()=>ya});xo({circular:!0,createInternalComparator:()=>ya});xo({circular:!0,createInternalComparator:()=>ya,strict:!0});function xo(e={}){const{circular:t=!1,createInternalComparator:r,createState:n,strict:i=!1}=e,o=HY(e),s=WY(o),u=r?r(s):VY(s);return GY({circular:t,comparator:s,createState:n,equals:u,strict:i})}function XY(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function YC(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function i(o){r<0&&(r=o),o-r>t?(e(o),r=-1):XY(i)};requestAnimationFrame(n)}function F1(e){"@babel/helpers - typeof";return F1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},F1(e)}function YY(e){return eQ(e)||JY(e)||ZY(e)||QY()}function QY(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ZY(e,t){if(e){if(typeof e=="string")return QC(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return QC(e,t)}}function QC(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1?1:j<0?0:j},y=function(j){for(var O=j>1?1:j,E=O,A=0;A<8;++A){var N=p(E)-O,C=g(E);if(Math.abs(N-O)0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,i=t.damping,o=i===void 0?8:i,s=t.dt,u=s===void 0?17:s,f=function(h,p,m){var g=-(h-p)*n,b=m*o,y=m+(g-b)*u/1e3,w=m*u/1e3+h;return Math.abs(w-p)e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function TQ(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,o;for(o=0;o=0)&&(r[i]=e[i]);return r}function cb(e){return IQ(e)||MQ(e)||RQ(e)||kQ()}function kQ(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function RQ(e,t){if(e){if(typeof e=="string")return H1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return H1(e,t)}}function MQ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function IQ(e){if(Array.isArray(e))return H1(e)}function H1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Kh(e){return Kh=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Kh(e)}var ri=(function(e){FQ(r,e);var t=zQ(r);function r(n,i){var o;DQ(this,r),o=t.call(this,n,i);var s=o.props,u=s.isActive,f=s.attributeName,l=s.from,h=s.to,p=s.steps,m=s.children,g=s.duration;if(o.handleStyleChange=o.handleStyleChange.bind(K1(o)),o.changeStyle=o.changeStyle.bind(K1(o)),!u||g<=0)return o.state={style:{}},typeof m=="function"&&(o.state={style:h}),G1(o);if(p&&p.length)o.state={style:p[0].style};else if(l){if(typeof m=="function")return o.state={style:l},G1(o);o.state={style:f?gc({},f,l):l}}else o.state={style:{}};return o}return $Q(r,[{key:"componentDidMount",value:function(){var i=this.props,o=i.isActive,s=i.canBegin;this.mounted=!0,!(!o||!s)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(i){var o=this.props,s=o.isActive,u=o.canBegin,f=o.attributeName,l=o.shouldReAnimate,h=o.to,p=o.from,m=this.state.style;if(u){if(!s){var g={style:f?gc({},f,h):h};this.state&&m&&(f&&m[f]!==h||!f&&m!==h)&&this.setState(g);return}if(!(KY(i.to,h)&&i.canBegin&&i.isActive)){var b=!i.canBegin||!i.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var y=b||l?p:i.to;if(this.state&&m){var w={style:f?gc({},f,y):y};(f&&m[f]!==y||!f&&m!==y)&&this.setState(w)}this.runAnimation(Pn(Pn({},this.props),{},{from:y,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var i=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),i&&i()}},{key:"handleStyleChange",value:function(i){this.changeStyle(i)}},{key:"changeStyle",value:function(i){this.mounted&&this.setState({style:i})}},{key:"runJSAnimation",value:function(i){var o=this,s=i.from,u=i.to,f=i.duration,l=i.easing,h=i.begin,p=i.onAnimationEnd,m=i.onAnimationStart,g=NQ(s,u,gQ(l),f,this.changeStyle),b=function(){o.stopJSAnimation=g()};this.manager.start([m,h,b,f,p])}},{key:"runStepAnimation",value:function(i){var o=this,s=i.steps,u=i.begin,f=i.onAnimationStart,l=s[0],h=l.style,p=l.duration,m=p===void 0?0:p,g=function(y,w,j){if(j===0)return y;var O=w.duration,E=w.easing,A=E===void 0?"ease":E,N=w.style,C=w.properties,T=w.onAnimationEnd,R=j>0?s[j-1]:w,I=C||Object.keys(N);if(typeof A=="function"||A==="spring")return[].concat(cb(y),[o.runJSAnimation.bind(o,{from:R.style,to:N,duration:O,easing:A}),O]);var F=eT(I,O,A),L=Pn(Pn(Pn({},R.style),N),{},{transition:F});return[].concat(cb(y),[L,O,T]).filter(oQ)};return this.manager.start([f].concat(cb(s.reduce(g,[h,Math.max(m,u)])),[i.onAnimationEnd]))}},{key:"runAnimation",value:function(i){this.manager||(this.manager=tQ());var o=i.begin,s=i.duration,u=i.attributeName,f=i.to,l=i.easing,h=i.onAnimationStart,p=i.onAnimationEnd,m=i.steps,g=i.children,b=this.manager;if(this.unSubscribe=b.subscribe(this.handleStyleChange),typeof l=="function"||typeof g=="function"||l==="spring"){this.runJSAnimation(i);return}if(m.length>1){this.runStepAnimation(i);return}var y=u?gc({},u,f):f,w=eT(Object.keys(y),s,l);b.start([h,o,Pn(Pn({},y),{},{transition:w}),s,p])}},{key:"render",value:function(){var i=this.props,o=i.children;i.begin;var s=i.duration;i.attributeName,i.easing;var u=i.isActive;i.steps,i.from,i.to,i.canBegin,i.onAnimationEnd,i.shouldReAnimate,i.onAnimationReStart;var f=CQ(i,AQ),l=S.Children.count(o),h=this.state.style;if(typeof o=="function")return o(h);if(!u||l===0||s<=0)return o;var p=function(g){var b=g.props,y=b.style,w=y===void 0?{}:y,j=b.className,O=S.cloneElement(g,Pn(Pn({},f),{},{style:Pn(Pn({},w),h),className:j}));return O};return l===1?p(S.Children.only(o)):z.createElement("div",null,S.Children.map(o,function(m){return p(m)}))}}]),r})(S.PureComponent);ri.displayName="Animate";ri.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};ri.propTypes={from:ft.oneOfType([ft.object,ft.string]),to:ft.oneOfType([ft.object,ft.string]),attributeName:ft.string,duration:ft.number,begin:ft.number,easing:ft.oneOfType([ft.string,ft.func]),steps:ft.arrayOf(ft.shape({duration:ft.number.isRequired,style:ft.object.isRequired,easing:ft.oneOfType([ft.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),ft.func]),properties:ft.arrayOf("string"),onAnimationEnd:ft.func})),children:ft.oneOfType([ft.node,ft.func]),isActive:ft.bool,canBegin:ft.bool,onAnimationEnd:ft.func,shouldReAnimate:ft.bool,onAnimationStart:ft.func,onAnimationReStart:ft.func};function Jc(e){"@babel/helpers - typeof";return Jc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jc(e)}function Xh(){return Xh=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0?1:-1,f=n>=0?1:-1,l=i>=0&&n>=0||i<0&&n<0?1:0,h;if(s>0&&o instanceof Array){for(var p=[0,0,0,0],m=0,g=4;ms?s:o[m];h="M".concat(t,",").concat(r+u*p[0]),p[0]>0&&(h+="A ".concat(p[0],",").concat(p[0],",0,0,").concat(l,",").concat(t+f*p[0],",").concat(r)),h+="L ".concat(t+n-f*p[1],",").concat(r),p[1]>0&&(h+="A ".concat(p[1],",").concat(p[1],",0,0,").concat(l,`, + `).concat(t+n,",").concat(r+u*p[1])),h+="L ".concat(t+n,",").concat(r+i-u*p[2]),p[2]>0&&(h+="A ".concat(p[2],",").concat(p[2],",0,0,").concat(l,`, + `).concat(t+n-f*p[2],",").concat(r+i)),h+="L ".concat(t+f*p[3],",").concat(r+i),p[3]>0&&(h+="A ".concat(p[3],",").concat(p[3],",0,0,").concat(l,`, + `).concat(t,",").concat(r+i-u*p[3])),h+="Z"}else if(s>0&&o===+o&&o>0){var b=Math.min(s,o);h="M ".concat(t,",").concat(r+u*b,` + A `).concat(b,",").concat(b,",0,0,").concat(l,",").concat(t+f*b,",").concat(r,` + L `).concat(t+n-f*b,",").concat(r,` + A `).concat(b,",").concat(b,",0,0,").concat(l,",").concat(t+n,",").concat(r+u*b,` + L `).concat(t+n,",").concat(r+i-u*b,` + A `).concat(b,",").concat(b,",0,0,").concat(l,",").concat(t+n-f*b,",").concat(r+i,` + L `).concat(t+f*b,",").concat(r+i,` + A `).concat(b,",").concat(b,",0,0,").concat(l,",").concat(t,",").concat(r+i-u*b," Z")}else h="M ".concat(t,",").concat(r," h ").concat(n," v ").concat(i," h ").concat(-n," Z");return h},QQ=function(t,r){if(!t||!r)return!1;var n=t.x,i=t.y,o=r.x,s=r.y,u=r.width,f=r.height;if(Math.abs(u)>0&&Math.abs(f)>0){var l=Math.min(o,o+u),h=Math.max(o,o+u),p=Math.min(s,s+f),m=Math.max(s,s+f);return n>=l&&n<=h&&i>=p&&i<=m}return!1},ZQ={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},KS=function(t){var r=lT(lT({},ZQ),t),n=S.useRef(),i=S.useState(-1),o=UQ(i,2),s=o[0],u=o[1];S.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var A=n.current.getTotalLength();A&&u(A)}catch{}},[]);var f=r.x,l=r.y,h=r.width,p=r.height,m=r.radius,g=r.className,b=r.animationEasing,y=r.animationDuration,w=r.animationBegin,j=r.isAnimationActive,O=r.isUpdateAnimationActive;if(f!==+f||l!==+l||h!==+h||p!==+p||h===0||p===0)return null;var E=He("recharts-rectangle",g);return O?z.createElement(ri,{canBegin:s>0,from:{width:h,height:p,x:f,y:l},to:{width:h,height:p,x:f,y:l},duration:y,animationEasing:b,isActive:O},function(A){var N=A.width,C=A.height,T=A.x,R=A.y;return z.createElement(ri,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:w,duration:y,isActive:j,easing:b},z.createElement("path",Xh({},Be(r,!0),{className:E,d:cT(T,R,N,C,m),ref:n})))}):z.createElement("path",Xh({},Be(r,!0),{className:E,d:cT(f,l,h,p,m)}))},JQ=["points","className","baseLinePoints","connectNulls"];function as(){return as=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function tZ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function uT(e){return oZ(e)||iZ(e)||nZ(e)||rZ()}function rZ(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nZ(e,t){if(e){if(typeof e=="string")return X1(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return X1(e,t)}}function iZ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function oZ(e){if(Array.isArray(e))return X1(e)}function X1(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&arguments[0]!==void 0?arguments[0]:[],r=[[]];return t.forEach(function(n){fT(n)?r[r.length-1].push(n):r[r.length-1].length>0&&r.push([])}),fT(t[0])&&r[r.length-1].push(t[0]),r[r.length-1].length<=0&&(r=r.slice(0,-1)),r},jc=function(t,r){var n=aZ(t);r&&(n=[n.reduce(function(o,s){return[].concat(uT(o),uT(s))},[])]);var i=n.map(function(o){return o.reduce(function(s,u,f){return"".concat(s).concat(f===0?"M":"L").concat(u.x,",").concat(u.y)},"")}).join("");return n.length===1?"".concat(i,"Z"):i},sZ=function(t,r,n){var i=jc(t,n);return"".concat(i.slice(-1)==="Z"?i.slice(0,-1):i,"L").concat(jc(r.reverse(),n).slice(1))},lZ=function(t){var r=t.points,n=t.className,i=t.baseLinePoints,o=t.connectNulls,s=eZ(t,JQ);if(!r||!r.length)return null;var u=He("recharts-polygon",n);if(i&&i.length){var f=s.stroke&&s.stroke!=="none",l=sZ(r,i,o);return z.createElement("g",{className:u},z.createElement("path",as({},Be(s,!0),{fill:l.slice(-1)==="Z"?s.fill:"none",stroke:"none",d:l})),f?z.createElement("path",as({},Be(s,!0),{fill:"none",d:jc(r,o)})):null,f?z.createElement("path",as({},Be(s,!0),{fill:"none",d:jc(i,o)})):null)}var h=jc(r,o);return z.createElement("path",as({},Be(s,!0),{fill:h.slice(-1)==="Z"?s.fill:"none",className:u,d:h}))};function Y1(){return Y1=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function mZ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var vZ=function(t,r,n,i,o,s){return"M".concat(t,",").concat(o,"v").concat(i,"M").concat(s,",").concat(r,"h").concat(n)},gZ=function(t){var r=t.x,n=r===void 0?0:r,i=t.y,o=i===void 0?0:i,s=t.top,u=s===void 0?0:s,f=t.left,l=f===void 0?0:f,h=t.width,p=h===void 0?0:h,m=t.height,g=m===void 0?0:m,b=t.className,y=pZ(t,cZ),w=uZ({x:n,y:o,top:u,left:l,width:p,height:g},y);return!be(n)||!be(o)||!be(p)||!be(g)||!be(u)||!be(l)?null:z.createElement("path",Q1({},Be(w,!0),{className:He("recharts-cross",b),d:vZ(n,o,p,g,u,l)}))},ub,hT;function yZ(){if(hT)return ub;hT=1;var e=Kp(),t=MD(),r=ai();function n(i,o){return i&&i.length?e(i,r(o,2),t):void 0}return ub=n,ub}var xZ=yZ();const bZ=ct(xZ);var fb,pT;function wZ(){if(pT)return fb;pT=1;var e=Kp(),t=ai(),r=ID();function n(i,o){return i&&i.length?e(i,t(o,2),r):void 0}return fb=n,fb}var SZ=wZ();const _Z=ct(SZ);var jZ=["cx","cy","angle","ticks","axisLine"],OZ=["ticks","tick","angle","tickFormatter","stroke"];function Ms(e){"@babel/helpers - typeof";return Ms=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ms(e)}function Oc(){return Oc=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function EZ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function PZ(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gT(e,t){for(var r=0;rbT?s=i==="outer"?"start":"end":o<-bT?s=i==="outer"?"end":"start":s="middle",s}},{key:"renderAxisLine",value:function(){var n=this.props,i=n.cx,o=n.cy,s=n.radius,u=n.axisLine,f=n.axisLineType,l=zo(zo({},Be(this.props,!1)),{},{fill:"none"},Be(u,!1));if(f==="circle")return z.createElement(Jp,Vo({className:"recharts-polar-angle-axis-line"},l,{cx:i,cy:o,r:s}));var h=this.props.ticks,p=h.map(function(m){return xt(i,o,s,m.coordinate)});return z.createElement(lZ,Vo({className:"recharts-polar-angle-axis-line"},l,{points:p}))}},{key:"renderTicks",value:function(){var n=this,i=this.props,o=i.ticks,s=i.tick,u=i.tickLine,f=i.tickFormatter,l=i.stroke,h=Be(this.props,!1),p=Be(s,!1),m=zo(zo({},h),{},{fill:"none"},Be(u,!1)),g=o.map(function(b,y){var w=n.getTickLineCoord(b),j=n.getTickTextAnchor(b),O=zo(zo(zo({textAnchor:j},h),{},{stroke:"none",fill:l},p),{},{index:y,payload:b,x:w.x2,y:w.y2});return z.createElement(at,Vo({className:He("recharts-polar-angle-axis-tick",cL(s)),key:"tick-".concat(b.coordinate)},ta(n.props,b,y)),u&&z.createElement("line",Vo({className:"recharts-polar-angle-axis-tick-line"},m,w)),s&&t.renderTickItem(s,O,f?f(b.value,y):b.value))});return z.createElement(at,{className:"recharts-polar-angle-axis-ticks"},g)}},{key:"render",value:function(){var n=this.props,i=n.ticks,o=n.radius,s=n.axisLine;return o<=0||!i||!i.length?null:z.createElement(at,{className:He("recharts-polar-angle-axis",this.props.className)},s&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(n,i,o){var s;return z.isValidElement(n)?s=z.cloneElement(n,i):qe(n)?s=n(i):s=z.createElement(ra,Vo({},i,{className:"recharts-polar-angle-axis-tick-value"}),o),s}}])})(S.PureComponent);rm(nm,"displayName","PolarAngleAxis");rm(nm,"axisType","angleAxis");rm(nm,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var db,wT;function qZ(){if(wT)return db;wT=1;var e=MI(),t=e(Object.getPrototypeOf,Object);return db=t,db}var hb,ST;function UZ(){if(ST)return hb;ST=1;var e=Ii(),t=qZ(),r=Di(),n="[object Object]",i=Function.prototype,o=Object.prototype,s=i.toString,u=o.hasOwnProperty,f=s.call(Object);function l(h){if(!r(h)||e(h)!=n)return!1;var p=t(h);if(p===null)return!0;var m=u.call(p,"constructor")&&p.constructor;return typeof m=="function"&&m instanceof m&&s.call(m)==f}return hb=l,hb}var WZ=UZ();const HZ=ct(WZ);var pb,_T;function VZ(){if(_T)return pb;_T=1;var e=Ii(),t=Di(),r="[object Boolean]";function n(i){return i===!0||i===!1||t(i)&&e(i)==r}return pb=n,pb}var GZ=VZ();const KZ=ct(GZ);function tu(e){"@babel/helpers - typeof";return tu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tu(e)}function Zh(){return Zh=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0,from:{upperWidth:0,lowerWidth:0,height:m,x:f,y:l},to:{upperWidth:h,lowerWidth:p,height:m,x:f,y:l},duration:y,animationEasing:b,isActive:j},function(E){var A=E.upperWidth,N=E.lowerWidth,C=E.height,T=E.x,R=E.y;return z.createElement(ri,{canBegin:s>0,from:"0px ".concat(s===-1?1:s,"px"),to:"".concat(s,"px 0px"),attributeName:"strokeDasharray",begin:w,duration:y,easing:b},z.createElement("path",Zh({},Be(r,!0),{className:O,d:PT(T,R,A,N,C),ref:n})))}):z.createElement("g",null,z.createElement("path",Zh({},Be(r,!0),{className:O,d:PT(f,l,h,p,m)})))},oJ=["option","shapeType","propTransformer","activeClassName","isActive"];function ru(e){"@babel/helpers - typeof";return ru=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ru(e)}function aJ(e,t){if(e==null)return{};var r=sJ(e,t),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function sJ(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function NT(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Jh(e){for(var t=1;t0?Qr(E,"paddingAngle",0):0;if(N){var T=Kr(N.endAngle-N.startAngle,E.endAngle-E.startAngle),R=gt(gt({},E),{},{startAngle:O+C,endAngle:O+T(y)+C});w.push(R),O=R.endAngle}else{var I=E.endAngle,F=E.startAngle,L=Kr(0,I-F),$=L(y),U=gt(gt({},E),{},{startAngle:O+C,endAngle:O+$+C});w.push(U),O=U.endAngle}}),z.createElement(at,null,n.renderSectorsStatically(w))})}},{key:"attachKeyboardHandlers",value:function(n){var i=this;n.onkeydown=function(o){if(!o.altKey)switch(o.key){case"ArrowLeft":{var s=++i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[s].focus(),i.setState({sectorToFocus:s});break}case"ArrowRight":{var u=--i.state.sectorToFocus<0?i.sectorRefs.length-1:i.state.sectorToFocus%i.sectorRefs.length;i.sectorRefs[u].focus(),i.setState({sectorToFocus:u});break}case"Escape":{i.sectorRefs[i.state.sectorToFocus].blur(),i.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var n=this.props,i=n.sectors,o=n.isAnimationActive,s=this.state.prevSectors;return o&&i&&i.length&&(!s||!Su(s,i))?this.renderSectorsWithAnimation():this.renderSectorsStatically(i)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var n=this,i=this.props,o=i.hide,s=i.sectors,u=i.className,f=i.label,l=i.cx,h=i.cy,p=i.innerRadius,m=i.outerRadius,g=i.isAnimationActive,b=this.state.isAnimationFinished;if(o||!s||!s.length||!be(l)||!be(h)||!be(p)||!be(m))return null;var y=He("recharts-pie",u);return z.createElement(at,{tabIndex:this.props.rootTabIndex,className:y,ref:function(j){n.pieRef=j}},this.renderSectors(),f&&this.renderLabels(s),Qt.renderCallByParent(this.props,null,!1),(!g||b)&&Ni.renderCallByParent(this.props,s,!1))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return i.prevIsAnimationActive!==n.isAnimationActive?{prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:[],isAnimationFinished:!0}:n.isAnimationActive&&n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:i.curSectors,isAnimationFinished:!0}:n.sectors!==i.curSectors?{curSectors:n.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(n,i){return n>i?"start":n=360?O:O-1)*f,A=w-O*g-E,N=i.reduce(function(R,I){var F=Wt(I,j,0);return R+(be(F)?F:0)},0),C;if(N>0){var T;C=i.map(function(R,I){var F=Wt(R,j,0),L=Wt(R,h,I),$=(be(F)?F:0)/N,U;I?U=T.endAngle+gr(y)*f*(F!==0?1:0):U=s;var G=U+gr(y)*((F!==0?g:0)+$*A),q=(U+G)/2,H=(b.innerRadius+b.outerRadius)/2,V=[{name:L,value:F,payload:R,dataKey:j,type:m}],D=xt(b.cx,b.cy,H,q);return T=gt(gt(gt({percent:$,cornerRadius:o,name:L,tooltipPayload:V,midAngle:q,middleRadius:H,tooltipPosition:D},R),b),{},{value:Wt(R,j),startAngle:U,endAngle:G,payload:R,paddingAngle:gr(y)*f}),T})}return gt(gt({},b),{},{sectors:C,data:i})});var mb,kT;function NJ(){if(kT)return mb;kT=1;var e=Math.ceil,t=Math.max;function r(n,i,o,s){for(var u=-1,f=t(e((i-n)/(o||1)),0),l=Array(f);f--;)l[s?f:++u]=n,n+=o;return l}return mb=r,mb}var vb,RT;function PL(){if(RT)return vb;RT=1;var e=YI(),t=1/0,r=17976931348623157e292;function n(i){if(!i)return i===0?i:0;if(i=e(i),i===t||i===-t){var o=i<0?-1:1;return o*r}return i===i?i:0}return vb=n,vb}var gb,MT;function AJ(){if(MT)return gb;MT=1;var e=NJ(),t=Fp(),r=PL();function n(i){return function(o,s,u){return u&&typeof u!="number"&&t(o,s,u)&&(s=u=void 0),o=r(o),s===void 0?(s=o,o=0):s=r(s),u=u===void 0?o0&&n.handleDrag(i.changedTouches[0])}),Wr(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=n.props,o=i.endIndex,s=i.onDragEnd,u=i.startIndex;s?.({endIndex:o,startIndex:u})}),n.detachDragEndListener()}),Wr(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),Wr(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),Wr(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),Wr(n,"handleSlideDragStart",function(i){var o=FT(i)?i.changedTouches[0]:i;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:o.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return zJ(t,e),LJ(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var i=n.startX,o=n.endX,s=this.state.scaleValues,u=this.props,f=u.gap,l=u.data,h=l.length-1,p=Math.min(i,o),m=Math.max(i,o),g=t.getIndexInRange(s,p),b=t.getIndexInRange(s,m);return{startIndex:g-g%f,endIndex:b===h?h:b-b%f}}},{key:"getTextOfTick",value:function(n){var i=this.props,o=i.data,s=i.tickFormatter,u=i.dataKey,f=Wt(o[n],u,n);return qe(s)?s(f,n):f}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(n){var i=this.state,o=i.slideMoveStartX,s=i.startX,u=i.endX,f=this.props,l=f.x,h=f.width,p=f.travellerWidth,m=f.startIndex,g=f.endIndex,b=f.onChange,y=n.pageX-o;y>0?y=Math.min(y,l+h-p-u,l+h-p-s):y<0&&(y=Math.max(y,l-s,l-u));var w=this.getIndex({startX:s+y,endX:u+y});(w.startIndex!==m||w.endIndex!==g)&&b&&b(w),this.setState({startX:s+y,endX:u+y,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,i){var o=FT(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:o.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var i=this.state,o=i.brushMoveStartX,s=i.movingTravellerId,u=i.endX,f=i.startX,l=this.state[s],h=this.props,p=h.x,m=h.width,g=h.travellerWidth,b=h.onChange,y=h.gap,w=h.data,j={startX:this.state.startX,endX:this.state.endX},O=n.pageX-o;O>0?O=Math.min(O,p+m-g-l):O<0&&(O=Math.max(O,p-l)),j[s]=l+O;var E=this.getIndex(j),A=E.startIndex,N=E.endIndex,C=function(){var R=w.length-1;return s==="startX"&&(u>f?A%y===0:N%y===0)||uf?N%y===0:A%y===0)||u>f&&N===R};this.setState(Wr(Wr({},s,l+O),"brushMoveStartX",n.pageX),function(){b&&C()&&b(E)})}},{key:"handleTravellerMoveKeyboard",value:function(n,i){var o=this,s=this.state,u=s.scaleValues,f=s.startX,l=s.endX,h=this.state[i],p=u.indexOf(h);if(p!==-1){var m=p+n;if(!(m===-1||m>=u.length)){var g=u[m];i==="startX"&&g>=l||i==="endX"&&g<=f||this.setState(Wr({},i,g),function(){o.props.onChange(o.getIndex({startX:o.state.startX,endX:o.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,i=n.x,o=n.y,s=n.width,u=n.height,f=n.fill,l=n.stroke;return z.createElement("rect",{stroke:l,fill:f,x:i,y:o,width:s,height:u})}},{key:"renderPanorama",value:function(){var n=this.props,i=n.x,o=n.y,s=n.width,u=n.height,f=n.data,l=n.children,h=n.padding,p=S.Children.only(l);return p?z.cloneElement(p,{x:i,y:o,width:s,height:u,margin:h,compact:!0,data:f}):null}},{key:"renderTravellerLayer",value:function(n,i){var o,s,u=this,f=this.props,l=f.y,h=f.travellerWidth,p=f.height,m=f.traveller,g=f.ariaLabel,b=f.data,y=f.startIndex,w=f.endIndex,j=Math.max(n,this.props.x),O=xb(xb({},Be(this.props,!1)),{},{x:j,y:l,width:h,height:p}),E=g||"Min value: ".concat((o=b[y])===null||o===void 0?void 0:o.name,", Max value: ").concat((s=b[w])===null||s===void 0?void 0:s.name);return z.createElement(at,{tabIndex:0,role:"slider","aria-label":E,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(N){["ArrowLeft","ArrowRight"].includes(N.key)&&(N.preventDefault(),N.stopPropagation(),u.handleTravellerMoveKeyboard(N.key==="ArrowRight"?1:-1,i))},onFocus:function(){u.setState({isTravellerFocused:!0})},onBlur:function(){u.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(m,O))}},{key:"renderSlide",value:function(n,i){var o=this.props,s=o.y,u=o.height,f=o.stroke,l=o.travellerWidth,h=Math.min(n,i)+l,p=Math.max(Math.abs(i-n)-l,0);return z.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:f,fillOpacity:.2,x:h,y:s,width:p,height:u})}},{key:"renderText",value:function(){var n=this.props,i=n.startIndex,o=n.endIndex,s=n.y,u=n.height,f=n.travellerWidth,l=n.stroke,h=this.state,p=h.startX,m=h.endX,g=5,b={pointerEvents:"none",fill:l};return z.createElement(at,{className:"recharts-brush-texts"},z.createElement(ra,rp({textAnchor:"end",verticalAnchor:"middle",x:Math.min(p,m)-g,y:s+u/2},b),this.getTextOfTick(i)),z.createElement(ra,rp({textAnchor:"start",verticalAnchor:"middle",x:Math.max(p,m)+f+g,y:s+u/2},b),this.getTextOfTick(o)))}},{key:"render",value:function(){var n=this.props,i=n.data,o=n.className,s=n.children,u=n.x,f=n.y,l=n.width,h=n.height,p=n.alwaysShowText,m=this.state,g=m.startX,b=m.endX,y=m.isTextActive,w=m.isSlideMoving,j=m.isTravellerMoving,O=m.isTravellerFocused;if(!i||!i.length||!be(u)||!be(f)||!be(l)||!be(h)||l<=0||h<=0)return null;var E=He("recharts-brush",o),A=z.Children.count(s)===1,N=IJ("userSelect","none");return z.createElement(at,{className:E,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:N},this.renderBackground(),A&&this.renderPanorama(),this.renderSlide(g,b),this.renderTravellerLayer(g,"startX"),this.renderTravellerLayer(b,"endX"),(y||w||j||O||p)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var i=n.x,o=n.y,s=n.width,u=n.height,f=n.stroke,l=Math.floor(o+u/2)-1;return z.createElement(z.Fragment,null,z.createElement("rect",{x:i,y:o,width:s,height:u,fill:f,stroke:"none"}),z.createElement("line",{x1:i+1,y1:l,x2:i+s-1,y2:l,fill:"none",stroke:"#fff"}),z.createElement("line",{x1:i+1,y1:l+2,x2:i+s-1,y2:l+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,i){var o;return z.isValidElement(n)?o=z.cloneElement(n,i):qe(n)?o=n(i):o=t.renderDefaultTraveller(i),o}},{key:"getDerivedStateFromProps",value:function(n,i){var o=n.data,s=n.width,u=n.x,f=n.travellerWidth,l=n.updateId,h=n.startIndex,p=n.endIndex;if(o!==i.prevData||l!==i.prevUpdateId)return xb({prevData:o,prevTravellerWidth:f,prevUpdateId:l,prevX:u,prevWidth:s},o&&o.length?UJ({data:o,width:s,x:u,travellerWidth:f,startIndex:h,endIndex:p}):{scale:null,scaleValues:null});if(i.scale&&(s!==i.prevWidth||u!==i.prevX||f!==i.prevTravellerWidth)){i.scale.range([u,u+s-f]);var m=i.scale.domain().map(function(g){return i.scale(g)});return{prevData:o,prevTravellerWidth:f,prevUpdateId:l,prevX:u,prevWidth:s,startX:i.scale(n.startIndex),endX:i.scale(n.endIndex),scaleValues:m}}return null}},{key:"getIndexInRange",value:function(n,i){for(var o=n.length,s=0,u=o-1;u-s>1;){var f=Math.floor((s+u)/2);n[f]>i?u=f:s=f}return i>=n[u]?u:s}}])})(S.PureComponent);Wr($s,"displayName","Brush");Wr($s,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var bb,zT;function WJ(){if(zT)return bb;zT=1;var e=bS();function t(r,n){var i;return e(r,function(o,s,u){return i=n(o,s,u),!i}),!!i}return bb=t,bb}var wb,qT;function HJ(){if(qT)return wb;qT=1;var e=PI(),t=ai(),r=WJ(),n=Ir(),i=Fp();function o(s,u,f){var l=n(s)?e:r;return f&&i(s,u,f)&&(u=void 0),l(s,t(u,3))}return wb=o,wb}var VJ=HJ();const GJ=ct(VJ);var Zn=function(t,r){var n=t.alwaysShow,i=t.ifOverflow;return n&&(i="extendDomain"),i===r},Sb,UT;function KJ(){if(UT)return Sb;UT=1;var e=HI();function t(r,n,i){n=="__proto__"&&e?e(r,n,{configurable:!0,enumerable:!0,value:i,writable:!0}):r[n]=i}return Sb=t,Sb}var _b,WT;function XJ(){if(WT)return _b;WT=1;var e=KJ(),t=UI(),r=ai();function n(i,o){var s={};return o=r(o,3),t(i,function(u,f,l){e(s,f,o(u,f,l))}),s}return _b=n,_b}var YJ=XJ();const QJ=ct(YJ);var jb,HT;function ZJ(){if(HT)return jb;HT=1;function e(t,r){for(var n=-1,i=t==null?0:t.length;++n=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function see(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function lee(e,t){var r=e.x,n=e.y,i=aee(e,ree),o="".concat(r),s=parseInt(o,10),u="".concat(n),f=parseInt(u,10),l="".concat(t.height||i.height),h=parseInt(l,10),p="".concat(t.width||i.width),m=parseInt(p,10);return lc(lc(lc(lc(lc({},t),i),s?{x:s}:{}),f?{y:f}:{}),{},{height:h,width:m,name:t.name,radius:t.radius})}function XT(e){return z.createElement(jL,rw({shapeType:"rectangle",propTransformer:lee,activeClassName:"recharts-active-bar"},e))}var cee=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,i){if(typeof t=="number")return t;var o=be(n)||Aq(n);return o?t(n,i):(o||ia(),r)}},uee=["value","background"],kL;function Bs(e){"@babel/helpers - typeof";return Bs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bs(e)}function fee(e,t){if(e==null)return{};var r=dee(e,t),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function dee(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function ip(){return ip=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(q)0&&Math.abs(G)0&&(U=Math.min((ae||0)-(G[ie-1]||0),U))}),Number.isFinite(U)){var q=U/$,H=y.layout==="vertical"?n.height:n.width;if(y.padding==="gap"&&(T=q*H/2),y.padding==="no-gap"){var V=yr(t.barCategoryGap,q*H),D=q*H/2;T=D-V-(D-V)/H*V}}}i==="xAxis"?R=[n.left+(E.left||0)+(T||0),n.left+n.width-(E.right||0)-(T||0)]:i==="yAxis"?R=f==="horizontal"?[n.top+n.height-(E.bottom||0),n.top+(E.top||0)]:[n.top+(E.top||0)+(T||0),n.top+n.height-(E.bottom||0)-(T||0)]:R=y.range,N&&(R=[R[1],R[0]]);var Z=rL(y,o,m),J=Z.scale,M=Z.realScaleType;J.domain(j).range(R),nL(J);var B=iL(J,Rn(Rn({},y),{},{realScaleType:M}));i==="xAxis"?(L=w==="top"&&!A||w==="bottom"&&A,I=n.left,F=p[C]-L*y.height):i==="yAxis"&&(L=w==="left"&&!A||w==="right"&&A,I=p[C]-L*y.width,F=n.top);var ee=Rn(Rn(Rn({},y),B),{},{realScaleType:M,x:I,y:F,scale:J,width:i==="xAxis"?n.width:y.width,height:i==="yAxis"?n.height:y.height});return ee.bandSize=zh(ee,B),!y.hide&&i==="xAxis"?p[C]+=(L?-1:1)*ee.height:y.hide||(p[C]+=(L?-1:1)*ee.width),Rn(Rn({},g),{},am({},b,ee))},{})},LL=function(t,r){var n=t.x,i=t.y,o=r.x,s=r.y;return{x:Math.min(n,o),y:Math.min(i,s),width:Math.abs(o-n),height:Math.abs(s-i)}},_ee=function(t){var r=t.x1,n=t.y1,i=t.x2,o=t.y2;return LL({x:r,y:n},{x:i,y:o})},$L=(function(){function e(t){bee(this,e),this.scale=t}return wee(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.bandAware,o=n.position;if(r!==void 0){if(o)switch(o){case"start":return this.scale(r);case"middle":{var s=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+s}case"end":{var u=this.bandwidth?this.bandwidth():0;return this.scale(r)+u}default:return this.scale(r)}if(i){var f=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+f}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),i=n[0],o=n[n.length-1];return i<=o?r>=i&&r<=o:r>=o&&r<=i}}],[{key:"create",value:function(r){return new e(r)}}])})();am($L,"EPS",1e-4);var XS=function(t){var r=Object.keys(t).reduce(function(n,i){return Rn(Rn({},n),{},am({},i,$L.create(t[i])))},{});return Rn(Rn({},r),{},{apply:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=o.bandAware,u=o.position;return QJ(i,function(f,l){return r[l].apply(f,{bandAware:s,position:u})})},isInRange:function(i){return TL(i,function(o,s){return r[s].isInRange(o)})}})};function jee(e){return(e%180+180)%180}var Oee=function(t){var r=t.width,n=t.height,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=jee(i),s=o*Math.PI/180,u=Math.atan(n/r),f=s>u&&s-1?f[l?o[h]:h]:void 0}}return Pb=n,Pb}var Nb,tk;function Pee(){if(tk)return Nb;tk=1;var e=PL();function t(r){var n=e(r),i=n%1;return n===n?i?n-i:n:0}return Nb=t,Nb}var Ab,rk;function Nee(){if(rk)return Ab;rk=1;var e=$I(),t=ai(),r=Pee(),n=Math.max;function i(o,s,u){var f=o==null?0:o.length;if(!f)return-1;var l=u==null?0:r(u);return l<0&&(l=n(f+l,0)),e(o,t(s,3),l)}return Ab=i,Ab}var Cb,nk;function Aee(){if(nk)return Cb;nk=1;var e=Eee(),t=Nee(),r=e(t);return Cb=r,Cb}var Cee=Aee();const Tee=ct(Cee);var kee=eI();const Ree=ct(kee);var Mee=Ree(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),YS=S.createContext(void 0),QS=S.createContext(void 0),BL=S.createContext(void 0),FL=S.createContext({}),zL=S.createContext(void 0),qL=S.createContext(0),UL=S.createContext(0),ik=function(t){var r=t.state,n=r.xAxisMap,i=r.yAxisMap,o=r.offset,s=t.clipPathId,u=t.children,f=t.width,l=t.height,h=Mee(o);return z.createElement(YS.Provider,{value:n},z.createElement(QS.Provider,{value:i},z.createElement(FL.Provider,{value:o},z.createElement(BL.Provider,{value:h},z.createElement(zL.Provider,{value:s},z.createElement(qL.Provider,{value:l},z.createElement(UL.Provider,{value:f},u)))))))},Iee=function(){return S.useContext(zL)},WL=function(t){var r=S.useContext(YS);r==null&&ia();var n=r[t];return n==null&&ia(),n},Dee=function(){var t=S.useContext(YS);return lo(t)},Lee=function(){var t=S.useContext(QS),r=Tee(t,function(n){return TL(n.domain,Number.isFinite)});return r||lo(t)},HL=function(t){var r=S.useContext(QS);r==null&&ia();var n=r[t];return n==null&&ia(),n},$ee=function(){var t=S.useContext(BL);return t},Bee=function(){return S.useContext(FL)},ZS=function(){return S.useContext(UL)},JS=function(){return S.useContext(qL)};function Fs(e){"@babel/helpers - typeof";return Fs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fs(e)}function Fee(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zee(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);re*i)return!1;var o=r();return e*(t-e*o/2-n)>=0&&e*(t+e*o/2-i)<=0}function Ste(e,t){return ZL(e,t+1)}function _te(e,t,r,n,i){for(var o=(n||[]).slice(),s=t.start,u=t.end,f=0,l=1,h=s,p=function(){var b=n?.[f];if(b===void 0)return{v:ZL(n,l)};var y=f,w,j=function(){return w===void 0&&(w=r(b,y)),w},O=b.coordinate,E=f===0||cp(e,O,j,h,u);E||(f=0,h=s,l+=1),E&&(h=O+e*(j()/2+i),f+=l)},m;l<=o.length;)if(m=p(),m)return m.v;return[]}function su(e){"@babel/helpers - typeof";return su=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},su(e)}function dk(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function cr(e){for(var t=1;t0?g.coordinate-w*e:g.coordinate})}else o[m]=g=cr(cr({},g),{},{tickCoord:g.coordinate});var j=cp(e,g.tickCoord,y,u,f);j&&(f=g.tickCoord-e*(y()/2+i),o[m]=cr(cr({},g),{},{isShow:!0}))},h=s-1;h>=0;h--)l(h);return o}function Nte(e,t,r,n,i,o){var s=(n||[]).slice(),u=s.length,f=t.start,l=t.end;if(o){var h=n[u-1],p=r(h,u-1),m=e*(h.coordinate+e*p/2-l);s[u-1]=h=cr(cr({},h),{},{tickCoord:m>0?h.coordinate-m*e:h.coordinate});var g=cp(e,h.tickCoord,function(){return p},f,l);g&&(l=h.tickCoord-e*(p/2+i),s[u-1]=cr(cr({},h),{},{isShow:!0}))}for(var b=o?u-1:u,y=function(O){var E=s[O],A,N=function(){return A===void 0&&(A=r(E,O)),A};if(O===0){var C=e*(E.coordinate-e*N()/2-f);s[O]=E=cr(cr({},E),{},{tickCoord:C<0?E.coordinate-C*e:E.coordinate})}else s[O]=E=cr(cr({},E),{},{tickCoord:E.coordinate});var T=cp(e,E.tickCoord,N,f,l);T&&(f=E.tickCoord+e*(N()/2+i),s[O]=cr(cr({},E),{},{isShow:!0}))},w=0;w=2?gr(i[1].coordinate-i[0].coordinate):1,j=wte(o,w,g);return f==="equidistantPreserveStart"?_te(w,j,y,i,s):(f==="preserveStart"||f==="preserveStartEnd"?m=Nte(w,j,y,i,s,f==="preserveStartEnd"):m=Pte(w,j,y,i,s),m.filter(function(O){return O.isShow}))}var Ate=["viewBox"],Cte=["viewBox"],Tte=["ticks"];function Us(e){"@babel/helpers - typeof";return Us=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Us(e)}function ls(){return ls=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function kte(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Rte(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function pk(e,t){for(var r=0;r0?f(this.props):f(g)),s<=0||u<=0||!b||!b.length?null:z.createElement(at,{className:He("recharts-cartesian-axis",l),ref:function(w){n.layerReference=w}},o&&this.renderAxisLine(),this.renderTicks(b,this.state.fontSize,this.state.letterSpacing),Qt.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,i,o){var s,u=He(i.className,"recharts-cartesian-axis-tick-value");return z.isValidElement(n)?s=z.cloneElement(n,qt(qt({},i),{},{className:u})):qe(n)?s=n(qt(qt({},i),{},{className:u})):s=z.createElement(ra,ls({},i,{className:"recharts-cartesian-axis-tick-value"}),o),s}}])})(S.Component);n_(ll,"displayName","CartesianAxis");n_(ll,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var Fte=["x1","y1","x2","y2","key"],zte=["offset"];function oa(e){"@babel/helpers - typeof";return oa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},oa(e)}function mk(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ur(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Hte(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}var Vte=function(t){var r=t.fill;if(!r||r==="none")return null;var n=t.fillOpacity,i=t.x,o=t.y,s=t.width,u=t.height,f=t.ry;return z.createElement("rect",{x:i,y:o,ry:f,width:s,height:u,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function t$(e,t){var r;if(z.isValidElement(e))r=z.cloneElement(e,t);else if(qe(e))r=e(t);else{var n=t.x1,i=t.y1,o=t.x2,s=t.y2,u=t.key,f=vk(t,Fte),l=Be(f,!1);l.offset;var h=vk(l,zte);r=z.createElement("line",Yo({},h,{x1:n,y1:i,x2:o,y2:s,fill:"none",key:u}))}return r}function Gte(e){var t=e.x,r=e.width,n=e.horizontal,i=n===void 0?!0:n,o=e.horizontalPoints;if(!i||!o||!o.length)return null;var s=o.map(function(u,f){var l=ur(ur({},e),{},{x1:t,y1:u,x2:t+r,y2:u,key:"line-".concat(f),index:f});return t$(i,l)});return z.createElement("g",{className:"recharts-cartesian-grid-horizontal"},s)}function Kte(e){var t=e.y,r=e.height,n=e.vertical,i=n===void 0?!0:n,o=e.verticalPoints;if(!i||!o||!o.length)return null;var s=o.map(function(u,f){var l=ur(ur({},e),{},{x1:u,y1:t,x2:u,y2:t+r,key:"line-".concat(f),index:f});return t$(i,l)});return z.createElement("g",{className:"recharts-cartesian-grid-vertical"},s)}function Xte(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,i=e.y,o=e.width,s=e.height,u=e.horizontalPoints,f=e.horizontal,l=f===void 0?!0:f;if(!l||!t||!t.length)return null;var h=u.map(function(m){return Math.round(m+i-i)}).sort(function(m,g){return m-g});i!==h[0]&&h.unshift(0);var p=h.map(function(m,g){var b=!h[g+1],y=b?i+s-m:h[g+1]-m;if(y<=0)return null;var w=g%t.length;return z.createElement("rect",{key:"react-".concat(g),y:m,x:n,height:y,width:o,stroke:"none",fill:t[w],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return z.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},p)}function Yte(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,i=e.fillOpacity,o=e.x,s=e.y,u=e.width,f=e.height,l=e.verticalPoints;if(!r||!n||!n.length)return null;var h=l.map(function(m){return Math.round(m+o-o)}).sort(function(m,g){return m-g});o!==h[0]&&h.unshift(0);var p=h.map(function(m,g){var b=!h[g+1],y=b?o+u-m:h[g+1]-m;if(y<=0)return null;var w=g%n.length;return z.createElement("rect",{key:"react-".concat(g),x:m,y:s,width:y,height:f,stroke:"none",fill:n[w],fillOpacity:i,className:"recharts-cartesian-grid-bg"})});return z.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},p)}var Qte=function(t,r){var n=t.xAxis,i=t.width,o=t.height,s=t.offset;return tL(r_(ur(ur(ur({},ll.defaultProps),n),{},{ticks:Oi(n,!0),viewBox:{x:0,y:0,width:i,height:o}})),s.left,s.left+s.width,r)},Zte=function(t,r){var n=t.yAxis,i=t.width,o=t.height,s=t.offset;return tL(r_(ur(ur(ur({},ll.defaultProps),n),{},{ticks:Oi(n,!0),viewBox:{x:0,y:0,width:i,height:o}})),s.top,s.top+s.height,r)},Xa={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function fp(e){var t,r,n,i,o,s,u=ZS(),f=JS(),l=Bee(),h=ur(ur({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:Xa.stroke,fill:(r=e.fill)!==null&&r!==void 0?r:Xa.fill,horizontal:(n=e.horizontal)!==null&&n!==void 0?n:Xa.horizontal,horizontalFill:(i=e.horizontalFill)!==null&&i!==void 0?i:Xa.horizontalFill,vertical:(o=e.vertical)!==null&&o!==void 0?o:Xa.vertical,verticalFill:(s=e.verticalFill)!==null&&s!==void 0?s:Xa.verticalFill,x:be(e.x)?e.x:l.left,y:be(e.y)?e.y:l.top,width:be(e.width)?e.width:l.width,height:be(e.height)?e.height:l.height}),p=h.x,m=h.y,g=h.width,b=h.height,y=h.syncWithTicks,w=h.horizontalValues,j=h.verticalValues,O=Dee(),E=Lee();if(!be(g)||g<=0||!be(b)||b<=0||!be(p)||p!==+p||!be(m)||m!==+m)return null;var A=h.verticalCoordinatesGenerator||Qte,N=h.horizontalCoordinatesGenerator||Zte,C=h.horizontalPoints,T=h.verticalPoints;if((!C||!C.length)&&qe(N)){var R=w&&w.length,I=N({yAxis:E?ur(ur({},E),{},{ticks:R?w:E.ticks}):void 0,width:u,height:f,offset:l},R?!0:y);Dn(Array.isArray(I),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(oa(I),"]")),Array.isArray(I)&&(C=I)}if((!T||!T.length)&&qe(A)){var F=j&&j.length,L=A({xAxis:O?ur(ur({},O),{},{ticks:F?j:O.ticks}):void 0,width:u,height:f,offset:l},F?!0:y);Dn(Array.isArray(L),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(oa(L),"]")),Array.isArray(L)&&(T=L)}return z.createElement("g",{className:"recharts-cartesian-grid"},z.createElement(Vte,{fill:h.fill,fillOpacity:h.fillOpacity,x:h.x,y:h.y,width:h.width,height:h.height,ry:h.ry}),z.createElement(Gte,Yo({},h,{offset:l,horizontalPoints:C,xAxis:O,yAxis:E})),z.createElement(Kte,Yo({},h,{offset:l,verticalPoints:T,xAxis:O,yAxis:E})),z.createElement(Xte,Yo({},h,{horizontalPoints:C})),z.createElement(Yte,Yo({},h,{verticalPoints:T})))}fp.displayName="CartesianGrid";var Jte=["type","layout","connectNulls","ref"],ere=["key"];function Ws(e){"@babel/helpers - typeof";return Ws=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ws(e)}function gk(e,t){if(e==null)return{};var r=tre(e,t),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function tre(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function Ec(){return Ec=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);rp){g=[].concat(Ya(f.slice(0,b)),[p-y]);break}var w=g.length%2===0?[0,m]:[m];return[].concat(Ya(t.repeat(f,h)),Ya(g),w).map(function(j){return"".concat(j,"px")}).join(", ")}),Mn(r,"id",nl("recharts-line-")),Mn(r,"pathRef",function(s){r.mainCurve=s}),Mn(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),Mn(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return fre(t,e),sre(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();this.setState({totalLength:n})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();n!==this.state.totalLength&&this.setState({totalLength:n})}}},{key:"getTotalLength",value:function(){var n=this.mainCurve;try{return n&&n.getTotalLength&&n.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(n,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var o=this.props,s=o.points,u=o.xAxis,f=o.yAxis,l=o.layout,h=o.children,p=Zr(h,_u);if(!p)return null;var m=function(y,w){return{x:y.x,y:y.y,value:y.value,errorVal:Wt(y.payload,w)}},g={clipPath:n?"url(#clipPath-".concat(i,")"):null};return z.createElement(at,g,p.map(function(b){return z.cloneElement(b,{key:"bar-".concat(b.props.dataKey),data:s,xAxis:u,yAxis:f,layout:l,dataPointFormatter:m})}))}},{key:"renderDots",value:function(n,i,o){var s=this.props.isAnimationActive;if(s&&!this.state.isAnimationFinished)return null;var u=this.props,f=u.dot,l=u.points,h=u.dataKey,p=Be(this.props,!1),m=Be(f,!0),g=l.map(function(y,w){var j=Ur(Ur(Ur({key:"dot-".concat(w),r:3},p),m),{},{index:w,cx:y.x,cy:y.y,value:y.value,dataKey:h,payload:y.payload,points:l});return t.renderDotItem(f,j)}),b={clipPath:n?"url(#clipPath-".concat(i?"":"dots-").concat(o,")"):null};return z.createElement(at,Ec({className:"recharts-line-dots",key:"dots"},b),g)}},{key:"renderCurveStatically",value:function(n,i,o,s){var u=this.props,f=u.type,l=u.layout,h=u.connectNulls;u.ref;var p=gk(u,Jte),m=Ur(Ur(Ur({},Be(p,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(o,")"):null,points:n},s),{},{type:f,layout:l,connectNulls:h});return z.createElement(Wh,Ec({},m,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(n,i){var o=this,s=this.props,u=s.points,f=s.strokeDasharray,l=s.isAnimationActive,h=s.animationBegin,p=s.animationDuration,m=s.animationEasing,g=s.animationId,b=s.animateNewValues,y=s.width,w=s.height,j=this.state,O=j.prevPoints,E=j.totalLength;return z.createElement(ri,{begin:h,duration:p,isActive:l,easing:m,from:{t:0},to:{t:1},key:"line-".concat(g),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(A){var N=A.t;if(O){var C=O.length/u.length,T=u.map(function($,U){var G=Math.floor(U*C);if(O[G]){var q=O[G],H=Kr(q.x,$.x),V=Kr(q.y,$.y);return Ur(Ur({},$),{},{x:H(N),y:V(N)})}if(b){var D=Kr(y*2,$.x),Z=Kr(w/2,$.y);return Ur(Ur({},$),{},{x:D(N),y:Z(N)})}return Ur(Ur({},$),{},{x:$.x,y:$.y})});return o.renderCurveStatically(T,n,i)}var R=Kr(0,E),I=R(N),F;if(f){var L="".concat(f).split(/[,\s]+/gim).map(function($){return parseFloat($)});F=o.getStrokeDasharray(I,E,L)}else F=o.generateSimpleStrokeDasharray(E,I);return o.renderCurveStatically(u,n,i,{strokeDasharray:F})})}},{key:"renderCurve",value:function(n,i){var o=this.props,s=o.points,u=o.isAnimationActive,f=this.state,l=f.prevPoints,h=f.totalLength;return u&&s&&s.length&&(!l&&h>0||!Su(l,s))?this.renderCurveWithAnimation(n,i):this.renderCurveStatically(s,n,i)}},{key:"render",value:function(){var n,i=this.props,o=i.hide,s=i.dot,u=i.points,f=i.className,l=i.xAxis,h=i.yAxis,p=i.top,m=i.left,g=i.width,b=i.height,y=i.isAnimationActive,w=i.id;if(o||!u||!u.length)return null;var j=this.state.isAnimationFinished,O=u.length===1,E=He("recharts-line",f),A=l&&l.allowDataOverflow,N=h&&h.allowDataOverflow,C=A||N,T=We(w)?this.id:w,R=(n=Be(s,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},I=R.r,F=I===void 0?3:I,L=R.strokeWidth,$=L===void 0?2:L,U=zq(s)?s:{},G=U.clipDot,q=G===void 0?!0:G,H=F*2+$;return z.createElement(at,{className:E},A||N?z.createElement("defs",null,z.createElement("clipPath",{id:"clipPath-".concat(T)},z.createElement("rect",{x:A?m:m-g/2,y:N?p:p-b/2,width:A?g:g*2,height:N?b:b*2})),!q&&z.createElement("clipPath",{id:"clipPath-dots-".concat(T)},z.createElement("rect",{x:m-H/2,y:p-H/2,width:g+H,height:b+H}))):null,!O&&this.renderCurve(C,T),this.renderErrorBar(C,T),(O||s)&&this.renderDots(C,q,T),(!y||j)&&Ni.renderCallByParent(this.props,u))}}],[{key:"getDerivedStateFromProps",value:function(n,i){return n.animationId!==i.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,prevPoints:i.curPoints}:n.points!==i.curPoints?{curPoints:n.points}:null}},{key:"repeat",value:function(n,i){for(var o=n.length%2!==0?[].concat(Ya(n),[0]):n,s=[],u=0;ue.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function tne(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function rne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function nne(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?s:t&&t.length&&be(i)&&be(o)?t.slice(i,o+1):[]};function v$(e){return e==="number"?[0,"auto"]:void 0}var ww=function(t,r,n,i){var o=t.graphicalItems,s=t.tooltipAxis,u=fm(r,t);return n<0||!o||!o.length||n>=u.length?null:o.reduce(function(f,l){var h,p=(h=l.props.data)!==null&&h!==void 0?h:r;p&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=n&&(p=p.slice(t.dataStartIndex,t.dataEndIndex+1));var m;if(s.dataKey&&!s.allowDuplicatedCategory){var g=p===void 0?u:p;m=ph(g,s.dataKey,i)}else m=p&&p[n]||u[n];return m?[].concat(Ks(f),[aL(l,m)]):f},[])},Ek=function(t,r,n,i){var o=i||{x:t.chartX,y:t.chartY},s=mne(o,n),u=t.orderedTooltipTicks,f=t.tooltipAxis,l=t.tooltipTicks,h=$K(s,u,l,f);if(h>=0&&l){var p=l[h]&&l[h].value,m=ww(t,r,h,p),g=vne(n,u,h,o);return{activeTooltipIndex:h,activeLabel:p,activePayload:m,activeCoordinate:g}}return null},gne=function(t,r){var n=r.axes,i=r.graphicalItems,o=r.axisType,s=r.axisIdKey,u=r.stackGroups,f=r.dataStartIndex,l=r.dataEndIndex,h=t.layout,p=t.children,m=t.stackOffset,g=eL(h,o);return n.reduce(function(b,y){var w,j=y.type.defaultProps!==void 0?se(se({},y.type.defaultProps),y.props):y.props,O=j.type,E=j.dataKey,A=j.allowDataOverflow,N=j.allowDuplicatedCategory,C=j.scale,T=j.ticks,R=j.includeHidden,I=j[s];if(b[I])return b;var F=fm(t.data,{graphicalItems:i.filter(function(B){var ee,ae=s in B.props?B.props[s]:(ee=B.type.defaultProps)===null||ee===void 0?void 0:ee[s];return ae===I}),dataStartIndex:f,dataEndIndex:l}),L=F.length,$,U,G;Ure(j.domain,A,O)&&($=I1(j.domain,null,A),g&&(O==="number"||C!=="auto")&&(G=Sc(F,E,"category")));var q=v$(O);if(!$||$.length===0){var H,V=(H=j.domain)!==null&&H!==void 0?H:q;if(E){if($=Sc(F,E,O),O==="category"&&g){var D=Tq($);N&&D?(U=$,$=tp(0,L)):N||($=NC(V,$,y).reduce(function(B,ee){return B.indexOf(ee)>=0?B:[].concat(Ks(B),[ee])},[]))}else if(O==="category")N?$=$.filter(function(B){return B!==""&&!We(B)}):$=NC(V,$,y).reduce(function(B,ee){return B.indexOf(ee)>=0||ee===""||We(ee)?B:[].concat(Ks(B),[ee])},[]);else if(O==="number"){var Z=UK(F,i.filter(function(B){var ee,ae,ie=s in B.props?B.props[s]:(ee=B.type.defaultProps)===null||ee===void 0?void 0:ee[s],fe="hide"in B.props?B.props.hide:(ae=B.type.defaultProps)===null||ae===void 0?void 0:ae.hide;return ie===I&&(R||!fe)}),E,o,h);Z&&($=Z)}g&&(O==="number"||C!=="auto")&&(G=Sc(F,E,"category"))}else g?$=tp(0,L):u&&u[I]&&u[I].hasStack&&O==="number"?$=m==="expand"?[0,1]:oL(u[I].stackGroups,f,l):$=JD(F,i.filter(function(B){var ee=s in B.props?B.props[s]:B.type.defaultProps[s],ae="hide"in B.props?B.props.hide:B.type.defaultProps.hide;return ee===I&&(R||!ae)}),O,h,!0);if(O==="number")$=yw(p,$,I,o,T),V&&($=I1(V,$,A));else if(O==="category"&&V){var J=V,M=$.every(function(B){return J.indexOf(B)>=0});M&&($=J)}}return se(se({},b),{},Fe({},I,se(se({},j),{},{axisType:o,domain:$,categoricalDomain:G,duplicateDomain:U,originalDomain:(w=j.domain)!==null&&w!==void 0?w:q,isCategorical:g,layout:h})))},{})},yne=function(t,r){var n=r.graphicalItems,i=r.Axis,o=r.axisType,s=r.axisIdKey,u=r.stackGroups,f=r.dataStartIndex,l=r.dataEndIndex,h=t.layout,p=t.children,m=fm(t.data,{graphicalItems:n,dataStartIndex:f,dataEndIndex:l}),g=m.length,b=eL(h,o),y=-1;return n.reduce(function(w,j){var O=j.type.defaultProps!==void 0?se(se({},j.type.defaultProps),j.props):j.props,E=O[s],A=v$("number");if(!w[E]){y++;var N;return b?N=tp(0,g):u&&u[E]&&u[E].hasStack?(N=oL(u[E].stackGroups,f,l),N=yw(p,N,E,o)):(N=I1(A,JD(m,n.filter(function(C){var T,R,I=s in C.props?C.props[s]:(T=C.type.defaultProps)===null||T===void 0?void 0:T[s],F="hide"in C.props?C.props.hide:(R=C.type.defaultProps)===null||R===void 0?void 0:R.hide;return I===E&&!F}),"number",h),i.defaultProps.allowDataOverflow),N=yw(p,N,E,o)),se(se({},w),{},Fe({},E,se(se({axisType:o},i.defaultProps),{},{hide:!0,orientation:Qr(hne,"".concat(o,".").concat(y%2),null),domain:N,originalDomain:A,isCategorical:b,layout:h})))}return w},{})},xne=function(t,r){var n=r.axisType,i=n===void 0?"xAxis":n,o=r.AxisComp,s=r.graphicalItems,u=r.stackGroups,f=r.dataStartIndex,l=r.dataEndIndex,h=t.children,p="".concat(i,"Id"),m=Zr(h,o),g={};return m&&m.length?g=gne(t,{axes:m,graphicalItems:s,axisType:i,axisIdKey:p,stackGroups:u,dataStartIndex:f,dataEndIndex:l}):s&&s.length&&(g=yne(t,{Axis:o,graphicalItems:s,axisType:i,axisIdKey:p,stackGroups:u,dataStartIndex:f,dataEndIndex:l})),g},bne=function(t){var r=lo(t),n=Oi(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:wS(n,function(i){return i.coordinate}),tooltipAxis:r,tooltipAxisBandSize:zh(r,n)}},Pk=function(t){var r=t.children,n=t.defaultShowTooltip,i=Hr(r,$s),o=0,s=0;return t.data&&t.data.length!==0&&(s=t.data.length-1),i&&i.props&&(i.props.startIndex>=0&&(o=i.props.startIndex),i.props.endIndex>=0&&(s=i.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:s,activeTooltipIndex:-1,isTooltipActive:!!n}},wne=function(t){return!t||!t.length?!1:t.some(function(r){var n=Ei(r&&r.type);return n&&n.indexOf("Bar")>=0})},Nk=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},Sne=function(t,r){var n=t.props,i=t.graphicalItems,o=t.xAxisMap,s=o===void 0?{}:o,u=t.yAxisMap,f=u===void 0?{}:u,l=n.width,h=n.height,p=n.children,m=n.margin||{},g=Hr(p,$s),b=Hr(p,ds),y=Object.keys(f).reduce(function(N,C){var T=f[C],R=T.orientation;return!T.mirror&&!T.hide?se(se({},N),{},Fe({},R,N[R]+T.width)):N},{left:m.left||0,right:m.right||0}),w=Object.keys(s).reduce(function(N,C){var T=s[C],R=T.orientation;return!T.mirror&&!T.hide?se(se({},N),{},Fe({},R,Qr(N,"".concat(R))+T.height)):N},{top:m.top||0,bottom:m.bottom||0}),j=se(se({},w),y),O=j.bottom;g&&(j.bottom+=g.props.height||$s.defaultProps.height),b&&r&&(j=zK(j,i,n,r));var E=l-j.left-j.right,A=h-j.top-j.bottom;return se(se({brushBottom:O},j),{},{width:Math.max(E,0),height:Math.max(A,0)})},_ne=function(t,r){if(r==="xAxis")return t[r].width;if(r==="yAxis")return t[r].height},i_=function(t){var r=t.chartName,n=t.GraphicalChild,i=t.defaultTooltipEventType,o=i===void 0?"axis":i,s=t.validateTooltipEventTypes,u=s===void 0?["axis"]:s,f=t.axisComponents,l=t.legendContent,h=t.formatAxisMap,p=t.defaultProps,m=function(j,O){var E=O.graphicalItems,A=O.stackGroups,N=O.offset,C=O.updateId,T=O.dataStartIndex,R=O.dataEndIndex,I=j.barSize,F=j.layout,L=j.barGap,$=j.barCategoryGap,U=j.maxBarSize,G=Nk(F),q=G.numericAxisName,H=G.cateAxisName,V=wne(E),D=[];return E.forEach(function(Z,J){var M=fm(j.data,{graphicalItems:[Z],dataStartIndex:T,dataEndIndex:R}),B=Z.type.defaultProps!==void 0?se(se({},Z.type.defaultProps),Z.props):Z.props,ee=B.dataKey,ae=B.maxBarSize,ie=B["".concat(q,"Id")],fe=B["".concat(H,"Id")],K={},ce=f.reduce(function(Rt,$t){var li=O["".concat($t.axisType,"Map")],_o=B["".concat($t.axisType,"Id")];li&&li[_o]||$t.axisType==="zAxis"||ia();var Bi=li[_o];return se(se({},Rt),{},Fe(Fe({},$t.axisType,Bi),"".concat($t.axisType,"Ticks"),Oi(Bi)))},K),te=ce[H],le=ce["".concat(H,"Ticks")],ge=A&&A[ie]&&A[ie].hasStack&&ZK(Z,A[ie].stackGroups),Y=Ei(Z.type).indexOf("Bar")>=0,_e=zh(te,le),Oe=[],Ve=V&&BK({barSize:I,stackGroups:A,totalSize:_ne(ce,H)});if(Y){var nt,lt,nr=We(ae)?U:ae,ir=(nt=(lt=zh(te,le,!0))!==null&<!==void 0?lt:nr)!==null&&nt!==void 0?nt:0;Oe=FK({barGap:L,barCategoryGap:$,bandSize:ir!==_e?ir:_e,sizeList:Ve[fe],maxBarSize:nr}),ir!==_e&&(Oe=Oe.map(function(Rt){return se(se({},Rt),{},{position:se(se({},Rt.position),{},{offset:Rt.position.offset-ir/2})})}))}var hr=Z&&Z.type&&Z.type.getComposedData;hr&&D.push({props:se(se({},hr(se(se({},ce),{},{displayedData:M,props:j,dataKey:ee,item:Z,bandSize:_e,barPosition:Oe,offset:N,stackedData:ge,layout:F,dataStartIndex:T,dataEndIndex:R}))),{},Fe(Fe(Fe({key:Z.key||"item-".concat(J)},q,ce[q]),H,ce[H]),"animationId",C)),childIndex:Wq(Z,j.children),item:Z})}),D},g=function(j,O){var E=j.props,A=j.dataStartIndex,N=j.dataEndIndex,C=j.updateId;if(!qP({props:E}))return null;var T=E.children,R=E.layout,I=E.stackOffset,F=E.data,L=E.reverseStackOrder,$=Nk(R),U=$.numericAxisName,G=$.cateAxisName,q=Zr(T,n),H=YK(F,q,"".concat(U,"Id"),"".concat(G,"Id"),I,L),V=f.reduce(function(B,ee){var ae="".concat(ee.axisType,"Map");return se(se({},B),{},Fe({},ae,xne(E,se(se({},ee),{},{graphicalItems:q,stackGroups:ee.axisType===U&&H,dataStartIndex:A,dataEndIndex:N}))))},{}),D=Sne(se(se({},V),{},{props:E,graphicalItems:q}),O?.legendBBox);Object.keys(V).forEach(function(B){V[B]=h(E,V[B],D,B.replace("Map",""),r)});var Z=V["".concat(G,"Map")],J=bne(Z),M=m(E,se(se({},V),{},{dataStartIndex:A,dataEndIndex:N,updateId:C,graphicalItems:q,stackGroups:H,offset:D}));return se(se({formattedGraphicalItems:M,graphicalItems:q,offset:D,stackGroups:H},J),V)},b=(function(w){function j(O){var E,A,N;return rne(this,j),N=one(this,j,[O]),Fe(N,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Fe(N,"accessibilityManager",new qre),Fe(N,"handleLegendBBoxUpdate",function(C){if(C){var T=N.state,R=T.dataStartIndex,I=T.dataEndIndex,F=T.updateId;N.setState(se({legendBBox:C},g({props:N.props,dataStartIndex:R,dataEndIndex:I,updateId:F},se(se({},N.state),{},{legendBBox:C}))))}}),Fe(N,"handleReceiveSyncEvent",function(C,T,R){if(N.props.syncId===C){if(R===N.eventEmitterSymbol&&typeof N.props.syncMethod!="function")return;N.applySyncEvent(T)}}),Fe(N,"handleBrushChange",function(C){var T=C.startIndex,R=C.endIndex;if(T!==N.state.dataStartIndex||R!==N.state.dataEndIndex){var I=N.state.updateId;N.setState(function(){return se({dataStartIndex:T,dataEndIndex:R},g({props:N.props,dataStartIndex:T,dataEndIndex:R,updateId:I},N.state))}),N.triggerSyncEvent({dataStartIndex:T,dataEndIndex:R})}}),Fe(N,"handleMouseEnter",function(C){var T=N.getMouseInfo(C);if(T){var R=se(se({},T),{},{isTooltipActive:!0});N.setState(R),N.triggerSyncEvent(R);var I=N.props.onMouseEnter;qe(I)&&I(R,C)}}),Fe(N,"triggeredAfterMouseMove",function(C){var T=N.getMouseInfo(C),R=T?se(se({},T),{},{isTooltipActive:!0}):{isTooltipActive:!1};N.setState(R),N.triggerSyncEvent(R);var I=N.props.onMouseMove;qe(I)&&I(R,C)}),Fe(N,"handleItemMouseEnter",function(C){N.setState(function(){return{isTooltipActive:!0,activeItem:C,activePayload:C.tooltipPayload,activeCoordinate:C.tooltipPosition||{x:C.cx,y:C.cy}}})}),Fe(N,"handleItemMouseLeave",function(){N.setState(function(){return{isTooltipActive:!1}})}),Fe(N,"handleMouseMove",function(C){C.persist(),N.throttleTriggeredAfterMouseMove(C)}),Fe(N,"handleMouseLeave",function(C){N.throttleTriggeredAfterMouseMove.cancel();var T={isTooltipActive:!1};N.setState(T),N.triggerSyncEvent(T);var R=N.props.onMouseLeave;qe(R)&&R(T,C)}),Fe(N,"handleOuterEvent",function(C){var T=Uq(C),R=Qr(N.props,"".concat(T));if(T&&qe(R)){var I,F;/.*touch.*/i.test(T)?F=N.getMouseInfo(C.changedTouches[0]):F=N.getMouseInfo(C),R((I=F)!==null&&I!==void 0?I:{},C)}}),Fe(N,"handleClick",function(C){var T=N.getMouseInfo(C);if(T){var R=se(se({},T),{},{isTooltipActive:!0});N.setState(R),N.triggerSyncEvent(R);var I=N.props.onClick;qe(I)&&I(R,C)}}),Fe(N,"handleMouseDown",function(C){var T=N.props.onMouseDown;if(qe(T)){var R=N.getMouseInfo(C);T(R,C)}}),Fe(N,"handleMouseUp",function(C){var T=N.props.onMouseUp;if(qe(T)){var R=N.getMouseInfo(C);T(R,C)}}),Fe(N,"handleTouchMove",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&N.throttleTriggeredAfterMouseMove(C.changedTouches[0])}),Fe(N,"handleTouchStart",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&N.handleMouseDown(C.changedTouches[0])}),Fe(N,"handleTouchEnd",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&N.handleMouseUp(C.changedTouches[0])}),Fe(N,"handleDoubleClick",function(C){var T=N.props.onDoubleClick;if(qe(T)){var R=N.getMouseInfo(C);T(R,C)}}),Fe(N,"handleContextMenu",function(C){var T=N.props.onContextMenu;if(qe(T)){var R=N.getMouseInfo(C);T(R,C)}}),Fe(N,"triggerSyncEvent",function(C){N.props.syncId!==void 0&&Rb.emit(Mb,N.props.syncId,C,N.eventEmitterSymbol)}),Fe(N,"applySyncEvent",function(C){var T=N.props,R=T.layout,I=T.syncMethod,F=N.state.updateId,L=C.dataStartIndex,$=C.dataEndIndex;if(C.dataStartIndex!==void 0||C.dataEndIndex!==void 0)N.setState(se({dataStartIndex:L,dataEndIndex:$},g({props:N.props,dataStartIndex:L,dataEndIndex:$,updateId:F},N.state)));else if(C.activeTooltipIndex!==void 0){var U=C.chartX,G=C.chartY,q=C.activeTooltipIndex,H=N.state,V=H.offset,D=H.tooltipTicks;if(!V)return;if(typeof I=="function")q=I(D,C);else if(I==="value"){q=-1;for(var Z=0;Z=0){var ge,Y;if(U.dataKey&&!U.allowDuplicatedCategory){var _e=typeof U.dataKey=="function"?le:"payload.".concat(U.dataKey.toString());ge=ph(Z,_e,q),Y=J&&M&&ph(M,_e,q)}else ge=Z?.[G],Y=J&&M&&M[G];if(fe||ie){var Oe=C.props.activeIndex!==void 0?C.props.activeIndex:G;return[S.cloneElement(C,se(se(se({},I.props),ce),{},{activeIndex:Oe})),null,null]}if(!We(ge))return[te].concat(Ks(N.renderActivePoints({item:I,activePoint:ge,basePoint:Y,childIndex:G,isRange:J})))}else{var Ve,nt=(Ve=N.getItemByXY(N.state.activeCoordinate))!==null&&Ve!==void 0?Ve:{graphicalItem:te},lt=nt.graphicalItem,nr=lt.item,ir=nr===void 0?C:nr,hr=lt.childIndex,Rt=se(se(se({},I.props),ce),{},{activeIndex:hr});return[S.cloneElement(ir,Rt),null,null]}return J?[te,null,null]:[te,null]}),Fe(N,"renderCustomized",function(C,T,R){return S.cloneElement(C,se(se({key:"recharts-customized-".concat(R)},N.props),N.state))}),Fe(N,"renderMap",{CartesianGrid:{handler:dd,once:!0},ReferenceArea:{handler:N.renderReferenceElement},ReferenceLine:{handler:dd},ReferenceDot:{handler:N.renderReferenceElement},XAxis:{handler:dd},YAxis:{handler:dd},Brush:{handler:N.renderBrush,once:!0},Bar:{handler:N.renderGraphicChild},Line:{handler:N.renderGraphicChild},Area:{handler:N.renderGraphicChild},Radar:{handler:N.renderGraphicChild},RadialBar:{handler:N.renderGraphicChild},Scatter:{handler:N.renderGraphicChild},Pie:{handler:N.renderGraphicChild},Funnel:{handler:N.renderGraphicChild},Tooltip:{handler:N.renderCursor,once:!0},PolarGrid:{handler:N.renderPolarGrid,once:!0},PolarAngleAxis:{handler:N.renderPolarAxis},PolarRadiusAxis:{handler:N.renderPolarAxis},Customized:{handler:N.renderCustomized}}),N.clipPathId="".concat((E=O.id)!==null&&E!==void 0?E:nl("recharts"),"-clip"),N.throttleTriggeredAfterMouseMove=QI(N.triggeredAfterMouseMove,(A=O.throttleDelay)!==null&&A!==void 0?A:1e3/60),N.state={},N}return lne(j,w),ine(j,[{key:"componentDidMount",value:function(){var E,A;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(E=this.props.margin.left)!==null&&E!==void 0?E:0,top:(A=this.props.margin.top)!==null&&A!==void 0?A:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var E=this.props,A=E.children,N=E.data,C=E.height,T=E.layout,R=Hr(A,Gr);if(R){var I=R.props.defaultIndex;if(!(typeof I!="number"||I<0||I>this.state.tooltipTicks.length-1)){var F=this.state.tooltipTicks[I]&&this.state.tooltipTicks[I].value,L=ww(this.state,N,I,F),$=this.state.tooltipTicks[I].coordinate,U=(this.state.offset.top+C)/2,G=T==="horizontal",q=G?{x:$,y:U}:{y:$,x:U},H=this.state.formattedGraphicalItems.find(function(D){var Z=D.item;return Z.type.name==="Scatter"});H&&(q=se(se({},q),H.props.points[I].tooltipPosition),L=H.props.points[I].tooltipPayload);var V={activeTooltipIndex:I,isTooltipActive:!0,activeLabel:F,activePayload:L,activeCoordinate:q};this.setState(V),this.renderCursor(R),this.accessibilityManager.setIndex(I)}}}},{key:"getSnapshotBeforeUpdate",value:function(E,A){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==A.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==E.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==E.margin){var N,C;this.accessibilityManager.setDetails({offset:{left:(N=this.props.margin.left)!==null&&N!==void 0?N:0,top:(C=this.props.margin.top)!==null&&C!==void 0?C:0}})}return null}},{key:"componentDidUpdate",value:function(E){n1([Hr(E.children,Gr)],[Hr(this.props.children,Gr)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var E=Hr(this.props.children,Gr);if(E&&typeof E.props.shared=="boolean"){var A=E.props.shared?"axis":"item";return u.indexOf(A)>=0?A:o}return o}},{key:"getMouseInfo",value:function(E){if(!this.container)return null;var A=this.container,N=A.getBoundingClientRect(),C=CW(N),T={chartX:Math.round(E.pageX-C.left),chartY:Math.round(E.pageY-C.top)},R=N.width/A.offsetWidth||1,I=this.inRange(T.chartX,T.chartY,R);if(!I)return null;var F=this.state,L=F.xAxisMap,$=F.yAxisMap,U=this.getTooltipEventType(),G=Ek(this.state,this.props.data,this.props.layout,I);if(U!=="axis"&&L&&$){var q=lo(L).scale,H=lo($).scale,V=q&&q.invert?q.invert(T.chartX):null,D=H&&H.invert?H.invert(T.chartY):null;return se(se({},T),{},{xValue:V,yValue:D},G)}return G?se(se({},T),G):null}},{key:"inRange",value:function(E,A){var N=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,C=this.props.layout,T=E/N,R=A/N;if(C==="horizontal"||C==="vertical"){var I=this.state.offset,F=T>=I.left&&T<=I.left+I.width&&R>=I.top&&R<=I.top+I.height;return F?{x:T,y:R}:null}var L=this.state,$=L.angleAxisMap,U=L.radiusAxisMap;if($&&U){var G=lo($);return TC({x:T,y:R},G)}return null}},{key:"parseEventsOfWrapper",value:function(){var E=this.props.children,A=this.getTooltipEventType(),N=Hr(E,Gr),C={};N&&A==="axis"&&(N.props.trigger==="click"?C={onClick:this.handleClick}:C={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var T=mh(this.props,this.handleOuterEvent);return se(se({},T),C)}},{key:"addListener",value:function(){Rb.on(Mb,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){Rb.removeListener(Mb,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(E,A,N){for(var C=this.state.formattedGraphicalItems,T=0,R=C.length;Td.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-lg border border-gray-100 hover:bg-gray-100 transition-colors",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx("div",{className:"w-10 h-10 rounded-full bg-blue-100 flex items-center justify-center text-blue-600 font-bold text-xs",children:e.template.substring(0,2)}),d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-semibold text-gray-900",children:e.product}),d.jsxs("p",{className:"text-xs text-gray-500",children:[e.id," • ",e.user]})]})]}),d.jsxs("div",{className:"flex items-center gap-4",children:[d.jsx("span",{className:"text-xs text-gray-500 font-medium",children:e.time}),d.jsx(Gn,{variant:"secondary",className:e.status==="expired"?"bg-red-100 text-red-700":"bg-green-100 text-green-700",children:e.status})]})]},e.id))})})]})]}),d.jsx("div",{className:"space-y-6",children:d.jsxs(Vr,{className:"shadow-sm border-gray-200",children:[d.jsx(Tn,{children:d.jsxs(kn,{className:"text-base font-bold text-gray-800 flex items-center gap-2",children:[d.jsx(ah,{className:"w-5 h-5 text-gray-500"}),"By Category"]})}),d.jsxs(dn,{children:[d.jsxs("div",{className:"h-[200px] relative",children:[d.jsx(Oh,{width:"100%",height:"100%",children:d.jsxs(One,{children:[d.jsx($i,{data:Db,cx:"50%",cy:"50%",innerRadius:60,outerRadius:80,paddingAngle:5,dataKey:"value",children:Db.map((e,t)=>d.jsx(zp,{fill:e.color},`cell-${t}`))}),d.jsx(Gr,{})]})}),d.jsxs("div",{className:"absolute inset-0 flex items-center justify-center flex-col pointer-events-none",children:[d.jsx("span",{className:"text-2xl font-bold text-gray-900",children:"1000"}),d.jsx("span",{className:"text-xs text-gray-500",children:"Total"})]})]}),d.jsx("div",{className:"mt-4 space-y-2",children:Db.map(e=>d.jsxs("div",{className:"flex items-center justify-between text-sm",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:e.color}}),d.jsx("span",{className:"text-gray-600",children:e.name})]}),d.jsx("span",{className:"font-medium text-gray-900",children:e.value})]},e.name))})]})]})})]})]})}function Qa({title:e,value:t,trend:r,trendUp:n,icon:i,color:o,bgColor:s}){return d.jsx(Vr,{className:"border-gray-200 shadow-sm hover:shadow-md transition-shadow",children:d.jsxs(dn,{className:"p-6",children:[d.jsxs("div",{className:"flex justify-between items-start",children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-sm font-medium text-gray-500 mb-1",children:e}),d.jsx("h3",{className:"text-2xl font-bold text-gray-900",children:t})]}),d.jsx("div",{className:`p-2 rounded-lg ${s}`,children:d.jsx(i,{className:`w-5 h-5 ${o}`})})]}),d.jsxs("div",{className:"mt-4 flex items-center text-sm",children:[n?d.jsx(lM,{className:"w-4 h-4 text-green-500 mr-1"}):d.jsx(A8,{className:"w-4 h-4 text-red-500 mr-1"}),d.jsx("span",{className:n?"text-green-600 font-medium":"text-red-600 font-medium",children:r}),d.jsx("span",{className:"text-gray-400 ml-1",children:"Vs. last period"})]})]})})}function Ane({title:e}){return d.jsxs("div",{className:"space-y-6",children:[d.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-4",children:[1,2,3,4].map(t=>d.jsxs(Vr,{children:[d.jsx(Tn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:d.jsxs(kn,{className:"text-sm font-medium",children:["Metric ",t]})}),d.jsxs(dn,{children:[d.jsx("div",{className:"text-2xl font-bold",children:"000"}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"+0.0% from last month"})]})]},t))}),d.jsx(Vr,{className:"min-h-[400px] flex items-center justify-center border-dashed",children:d.jsxs("div",{className:"text-center text-muted-foreground",children:[d.jsxs("h3",{className:"text-lg font-medium",children:[e," Module"]}),d.jsx("p",{children:"This module is currently under development."})]})})]})}function br({className:e,...t}){return d.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:d.jsx("table",{"data-slot":"table",className:Re("w-full caption-bottom text-sm",e),...t})})}function wr({className:e,...t}){return d.jsx("thead",{"data-slot":"table-header",className:Re("[&_tr]:border-b",e),...t})}function Sr({className:e,...t}){return d.jsx("tbody",{"data-slot":"table-body",className:Re("[&_tr:last-child]:border-0",e),...t})}function Ge({className:e,...t}){return d.jsx("tr",{"data-slot":"table-row",className:Re("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",e),...t})}function ye({className:e,...t}){return d.jsx("th",{"data-slot":"table-head",className:Re("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function ue({className:e,...t}){return d.jsx("td",{"data-slot":"table-cell",className:Re("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t})}function Ak(e){const t=Cne(e),r=S.forwardRef((n,i)=>{const{children:o,...s}=n,u=S.Children.toArray(o),f=u.find(kne);if(f){const l=f.props.children,h=u.map(p=>p===f?S.Children.count(l)>1?S.Children.only(null):S.isValidElement(l)?l.props.children:null:p);return d.jsx(t,{...s,ref:i,children:S.isValidElement(l)?S.cloneElement(l,void 0,h):null})}return d.jsx(t,{...s,ref:i,children:o})});return r.displayName=`${e}.Slot`,r}function Cne(e){const t=S.forwardRef((r,n)=>{const{children:i,...o}=r;if(S.isValidElement(i)){const s=Mne(i),u=Rne(o,i.props);return i.type!==S.Fragment&&(u.ref=n?ha(n,s):s),S.cloneElement(i,u)}return S.Children.count(i)>1?S.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Tne=Symbol("radix.slottable");function kne(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Tne}function Rne(e,t){const r={...t};for(const n in t){const i=e[n],o=t[n];/^on[A-Z]/.test(n)?i&&o?r[n]=(...u)=>{const f=o(...u);return i(...u),f}:i&&(r[n]=i):n==="style"?r[n]={...i,...o}:n==="className"&&(r[n]=[i,o].filter(Boolean).join(" "))}return{...e,...r}}function Mne(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function y$(e){const t=e+"CollectionProvider",[r,n]=Bn(t),[i,o]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=y=>{const{scope:w,children:j}=y,O=z.useRef(null),E=z.useRef(new Map).current;return d.jsx(i,{scope:w,itemMap:E,collectionRef:O,children:j})};s.displayName=t;const u=e+"CollectionSlot",f=Ak(u),l=z.forwardRef((y,w)=>{const{scope:j,children:O}=y,E=o(u,j),A=Ze(w,E.collectionRef);return d.jsx(f,{ref:A,children:O})});l.displayName=u;const h=e+"CollectionItemSlot",p="data-radix-collection-item",m=Ak(h),g=z.forwardRef((y,w)=>{const{scope:j,children:O,...E}=y,A=z.useRef(null),N=Ze(w,A),C=o(h,j);return z.useEffect(()=>(C.itemMap.set(A,{ref:A,...E}),()=>void C.itemMap.delete(A))),d.jsx(m,{[p]:"",ref:N,children:O})});g.displayName=h;function b(y){const w=o(e+"CollectionConsumer",y);return z.useCallback(()=>{const O=w.collectionRef.current;if(!O)return[];const E=Array.from(O.querySelectorAll(`[${p}]`));return Array.from(w.itemMap.values()).sort((C,T)=>E.indexOf(C.ref.current)-E.indexOf(T.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:s,Slot:l,ItemSlot:g},b,n]}function Ine(e,t=globalThis?.document){const r=fr(e);S.useEffect(()=>{const n=i=>{i.key==="Escape"&&r(i)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var Dne="DismissableLayer",Sw="dismissableLayer.update",Lne="dismissableLayer.pointerDownOutside",$ne="dismissableLayer.focusOutside",Ck,x$=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ju=S.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:s,onDismiss:u,...f}=e,l=S.useContext(x$),[h,p]=S.useState(null),m=h?.ownerDocument??globalThis?.document,[,g]=S.useState({}),b=Ze(t,T=>p(T)),y=Array.from(l.layers),[w]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),j=y.indexOf(w),O=h?y.indexOf(h):-1,E=l.layersWithOutsidePointerEventsDisabled.size>0,A=O>=j,N=zne(T=>{const R=T.target,I=[...l.branches].some(F=>F.contains(R));!A||I||(i?.(T),s?.(T),T.defaultPrevented||u?.())},m),C=qne(T=>{const R=T.target;[...l.branches].some(F=>F.contains(R))||(o?.(T),s?.(T),T.defaultPrevented||u?.())},m);return Ine(T=>{O===l.layers.size-1&&(n?.(T),!T.defaultPrevented&&u&&(T.preventDefault(),u()))},m),S.useEffect(()=>{if(h)return r&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(Ck=m.body.style.pointerEvents,m.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(h)),l.layers.add(h),Tk(),()=>{r&&l.layersWithOutsidePointerEventsDisabled.size===1&&(m.body.style.pointerEvents=Ck)}},[h,m,r,l]),S.useEffect(()=>()=>{h&&(l.layers.delete(h),l.layersWithOutsidePointerEventsDisabled.delete(h),Tk())},[h,l]),S.useEffect(()=>{const T=()=>g({});return document.addEventListener(Sw,T),()=>document.removeEventListener(Sw,T)},[]),d.jsx(Ue.div,{...f,ref:b,style:{pointerEvents:E?A?"auto":"none":void 0,...e.style},onFocusCapture:Ie(e.onFocusCapture,C.onFocusCapture),onBlurCapture:Ie(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:Ie(e.onPointerDownCapture,N.onPointerDownCapture)})});ju.displayName=Dne;var Bne="DismissableLayerBranch",Fne=S.forwardRef((e,t)=>{const r=S.useContext(x$),n=S.useRef(null),i=Ze(t,n);return S.useEffect(()=>{const o=n.current;if(o)return r.branches.add(o),()=>{r.branches.delete(o)}},[r.branches]),d.jsx(Ue.div,{...e,ref:i})});Fne.displayName=Bne;function zne(e,t=globalThis?.document){const r=fr(e),n=S.useRef(!1),i=S.useRef(()=>{});return S.useEffect(()=>{const o=u=>{if(u.target&&!n.current){let f=function(){b$(Lne,r,l,{discrete:!0})};const l={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=f,t.addEventListener("click",i.current,{once:!0})):f()}else t.removeEventListener("click",i.current);n.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",o),t.removeEventListener("click",i.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function qne(e,t=globalThis?.document){const r=fr(e),n=S.useRef(!1);return S.useEffect(()=>{const i=o=>{o.target&&!n.current&&b$($ne,r,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",i),()=>t.removeEventListener("focusin",i)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function Tk(){const e=new CustomEvent(Sw);document.dispatchEvent(e)}function b$(e,t,r,{discrete:n}){const i=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&i.addEventListener(e,t,{once:!0}),n?V6(i,o):i.dispatchEvent(o)}var Lb=0;function o_(){S.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??kk()),document.body.insertAdjacentElement("beforeend",e[1]??kk()),Lb++,()=>{Lb===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Lb--}},[])}function kk(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var $b="focusScope.autoFocusOnMount",Bb="focusScope.autoFocusOnUnmount",Rk={bubbles:!1,cancelable:!0},Une="FocusScope",dm=S.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...s}=e,[u,f]=S.useState(null),l=fr(i),h=fr(o),p=S.useRef(null),m=Ze(t,y=>f(y)),g=S.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;S.useEffect(()=>{if(n){let y=function(E){if(g.paused||!u)return;const A=E.target;u.contains(A)?p.current=A:ao(p.current,{select:!0})},w=function(E){if(g.paused||!u)return;const A=E.relatedTarget;A!==null&&(u.contains(A)||ao(p.current,{select:!0}))},j=function(E){if(document.activeElement===document.body)for(const N of E)N.removedNodes.length>0&&ao(u)};document.addEventListener("focusin",y),document.addEventListener("focusout",w);const O=new MutationObserver(j);return u&&O.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",y),document.removeEventListener("focusout",w),O.disconnect()}}},[n,u,g.paused]),S.useEffect(()=>{if(u){Ik.add(g);const y=document.activeElement;if(!u.contains(y)){const j=new CustomEvent($b,Rk);u.addEventListener($b,l),u.dispatchEvent(j),j.defaultPrevented||(Wne(Xne(w$(u)),{select:!0}),document.activeElement===y&&ao(u))}return()=>{u.removeEventListener($b,l),setTimeout(()=>{const j=new CustomEvent(Bb,Rk);u.addEventListener(Bb,h),u.dispatchEvent(j),j.defaultPrevented||ao(y??document.body,{select:!0}),u.removeEventListener(Bb,h),Ik.remove(g)},0)}}},[u,l,h,g]);const b=S.useCallback(y=>{if(!r&&!n||g.paused)return;const w=y.key==="Tab"&&!y.altKey&&!y.ctrlKey&&!y.metaKey,j=document.activeElement;if(w&&j){const O=y.currentTarget,[E,A]=Hne(O);E&&A?!y.shiftKey&&j===A?(y.preventDefault(),r&&ao(E,{select:!0})):y.shiftKey&&j===E&&(y.preventDefault(),r&&ao(A,{select:!0})):j===O&&y.preventDefault()}},[r,n,g.paused]);return d.jsx(Ue.div,{tabIndex:-1,...s,ref:m,onKeyDown:b})});dm.displayName=Une;function Wne(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(ao(n,{select:t}),document.activeElement!==r)return}function Hne(e){const t=w$(e),r=Mk(t,e),n=Mk(t.reverse(),e);return[r,n]}function w$(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const i=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||i?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Mk(e,t){for(const r of e)if(!Vne(r,{upTo:t}))return r}function Vne(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Gne(e){return e instanceof HTMLInputElement&&"select"in e}function ao(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&Gne(e)&&t&&e.select()}}var Ik=Kne();function Kne(){let e=[];return{add(t){const r=e[0];t!==r&&r?.pause(),e=Dk(e,t),e.unshift(t)},remove(t){e=Dk(e,t),e[0]?.resume()}}}function Dk(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function Xne(e){return e.filter(t=>t.tagName!=="A")}var Yne=Uw[" useId ".trim().toString()]||(()=>{}),Qne=0;function Jn(e){const[t,r]=S.useState(Yne());return Lt(()=>{r(n=>n??String(Qne++))},[e]),e||(t?`radix-${t}`:"")}const Zne=["top","right","bottom","left"],po=Math.min,Xr=Math.max,vp=Math.round,hd=Math.floor,ei=e=>({x:e,y:e}),Jne={left:"right",right:"left",bottom:"top",top:"bottom"},eie={start:"end",end:"start"};function _w(e,t,r){return Xr(e,po(t,r))}function ki(e,t){return typeof e=="function"?e(t):e}function Ri(e){return e.split("-")[0]}function ul(e){return e.split("-")[1]}function a_(e){return e==="x"?"y":"x"}function s_(e){return e==="y"?"height":"width"}const tie=new Set(["top","bottom"]);function Yn(e){return tie.has(Ri(e))?"y":"x"}function l_(e){return a_(Yn(e))}function rie(e,t,r){r===void 0&&(r=!1);const n=ul(e),i=l_(e),o=s_(i);let s=i==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=gp(s)),[s,gp(s)]}function nie(e){const t=gp(e);return[jw(e),t,jw(t)]}function jw(e){return e.replace(/start|end/g,t=>eie[t])}const Lk=["left","right"],$k=["right","left"],iie=["top","bottom"],oie=["bottom","top"];function aie(e,t,r){switch(e){case"top":case"bottom":return r?t?$k:Lk:t?Lk:$k;case"left":case"right":return t?iie:oie;default:return[]}}function sie(e,t,r,n){const i=ul(e);let o=aie(Ri(e),r==="start",n);return i&&(o=o.map(s=>s+"-"+i),t&&(o=o.concat(o.map(jw)))),o}function gp(e){return e.replace(/left|right|bottom|top/g,t=>Jne[t])}function lie(e){return{top:0,right:0,bottom:0,left:0,...e}}function S$(e){return typeof e!="number"?lie(e):{top:e,right:e,bottom:e,left:e}}function yp(e){const{x:t,y:r,width:n,height:i}=e;return{width:n,height:i,top:r,left:t,right:t+n,bottom:r+i,x:t,y:r}}function Bk(e,t,r){let{reference:n,floating:i}=e;const o=Yn(t),s=l_(t),u=s_(s),f=Ri(t),l=o==="y",h=n.x+n.width/2-i.width/2,p=n.y+n.height/2-i.height/2,m=n[u]/2-i[u]/2;let g;switch(f){case"top":g={x:h,y:n.y-i.height};break;case"bottom":g={x:h,y:n.y+n.height};break;case"right":g={x:n.x+n.width,y:p};break;case"left":g={x:n.x-i.width,y:p};break;default:g={x:n.x,y:n.y}}switch(ul(t)){case"start":g[s]-=m*(r&&l?-1:1);break;case"end":g[s]+=m*(r&&l?-1:1);break}return g}async function cie(e,t){var r;t===void 0&&(t={});const{x:n,y:i,platform:o,rects:s,elements:u,strategy:f}=e,{boundary:l="clippingAncestors",rootBoundary:h="viewport",elementContext:p="floating",altBoundary:m=!1,padding:g=0}=ki(t,e),b=S$(g),w=u[m?p==="floating"?"reference":"floating":p],j=yp(await o.getClippingRect({element:(r=await(o.isElement==null?void 0:o.isElement(w)))==null||r?w:w.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(u.floating)),boundary:l,rootBoundary:h,strategy:f})),O=p==="floating"?{x:n,y:i,width:s.floating.width,height:s.floating.height}:s.reference,E=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u.floating)),A=await(o.isElement==null?void 0:o.isElement(E))?await(o.getScale==null?void 0:o.getScale(E))||{x:1,y:1}:{x:1,y:1},N=yp(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:O,offsetParent:E,strategy:f}):O);return{top:(j.top-N.top+b.top)/A.y,bottom:(N.bottom-j.bottom+b.bottom)/A.y,left:(j.left-N.left+b.left)/A.x,right:(N.right-j.right+b.right)/A.x}}const uie=async(e,t,r)=>{const{placement:n="bottom",strategy:i="absolute",middleware:o=[],platform:s}=r,u=o.filter(Boolean),f=await(s.isRTL==null?void 0:s.isRTL(t));let l=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:h,y:p}=Bk(l,n,f),m=n,g={},b=0;for(let w=0;w({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:i,rects:o,platform:s,elements:u,middlewareData:f}=t,{element:l,padding:h=0}=ki(e,t)||{};if(l==null)return{};const p=S$(h),m={x:r,y:n},g=l_(i),b=s_(g),y=await s.getDimensions(l),w=g==="y",j=w?"top":"left",O=w?"bottom":"right",E=w?"clientHeight":"clientWidth",A=o.reference[b]+o.reference[g]-m[g]-o.floating[b],N=m[g]-o.reference[g],C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l));let T=C?C[E]:0;(!T||!await(s.isElement==null?void 0:s.isElement(C)))&&(T=u.floating[E]||o.floating[b]);const R=A/2-N/2,I=T/2-y[b]/2-1,F=po(p[j],I),L=po(p[O],I),$=F,U=T-y[b]-L,G=T/2-y[b]/2+R,q=_w($,G,U),H=!f.arrow&&ul(i)!=null&&G!==q&&o.reference[b]/2-(G<$?F:L)-y[b]/2<0,V=H?G<$?G-$:G-U:0;return{[g]:m[g]+V,data:{[g]:q,centerOffset:G-q-V,...H&&{alignmentOffset:V}},reset:H}}}),die=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:i,middlewareData:o,rects:s,initialPlacement:u,platform:f,elements:l}=t,{mainAxis:h=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:y=!0,...w}=ki(e,t);if((r=o.arrow)!=null&&r.alignmentOffset)return{};const j=Ri(i),O=Yn(u),E=Ri(u)===u,A=await(f.isRTL==null?void 0:f.isRTL(l.floating)),N=m||(E||!y?[gp(u)]:nie(u)),C=b!=="none";!m&&C&&N.push(...sie(u,y,b,A));const T=[u,...N],R=await f.detectOverflow(t,w),I=[];let F=((n=o.flip)==null?void 0:n.overflows)||[];if(h&&I.push(R[j]),p){const G=rie(i,s,A);I.push(R[G[0]],R[G[1]])}if(F=[...F,{placement:i,overflows:I}],!I.every(G=>G<=0)){var L,$;const G=(((L=o.flip)==null?void 0:L.index)||0)+1,q=T[G];if(q&&(!(p==="alignment"?O!==Yn(q):!1)||F.every(D=>Yn(D.placement)===O?D.overflows[0]>0:!0)))return{data:{index:G,overflows:F},reset:{placement:q}};let H=($=F.filter(V=>V.overflows[0]<=0).sort((V,D)=>V.overflows[1]-D.overflows[1])[0])==null?void 0:$.placement;if(!H)switch(g){case"bestFit":{var U;const V=(U=F.filter(D=>{if(C){const Z=Yn(D.placement);return Z===O||Z==="y"}return!0}).map(D=>[D.placement,D.overflows.filter(Z=>Z>0).reduce((Z,J)=>Z+J,0)]).sort((D,Z)=>D[1]-Z[1])[0])==null?void 0:U[0];V&&(H=V);break}case"initialPlacement":H=u;break}if(i!==H)return{reset:{placement:H}}}return{}}}};function Fk(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function zk(e){return Zne.some(t=>e[t]>=0)}const hie=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r,platform:n}=t,{strategy:i="referenceHidden",...o}=ki(e,t);switch(i){case"referenceHidden":{const s=await n.detectOverflow(t,{...o,elementContext:"reference"}),u=Fk(s,r.reference);return{data:{referenceHiddenOffsets:u,referenceHidden:zk(u)}}}case"escaped":{const s=await n.detectOverflow(t,{...o,altBoundary:!0}),u=Fk(s,r.floating);return{data:{escapedOffsets:u,escaped:zk(u)}}}default:return{}}}}},_$=new Set(["left","top"]);async function pie(e,t){const{placement:r,platform:n,elements:i}=e,o=await(n.isRTL==null?void 0:n.isRTL(i.floating)),s=Ri(r),u=ul(r),f=Yn(r)==="y",l=_$.has(s)?-1:1,h=o&&f?-1:1,p=ki(t,e);let{mainAxis:m,crossAxis:g,alignmentAxis:b}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return u&&typeof b=="number"&&(g=u==="end"?b*-1:b),f?{x:g*h,y:m*l}:{x:m*l,y:g*h}}const mie=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:i,y:o,placement:s,middlewareData:u}=t,f=await pie(t,e);return s===((r=u.offset)==null?void 0:r.placement)&&(n=u.arrow)!=null&&n.alignmentOffset?{}:{x:i+f.x,y:o+f.y,data:{...f,placement:s}}}}},vie=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:i,platform:o}=t,{mainAxis:s=!0,crossAxis:u=!1,limiter:f={fn:j=>{let{x:O,y:E}=j;return{x:O,y:E}}},...l}=ki(e,t),h={x:r,y:n},p=await o.detectOverflow(t,l),m=Yn(Ri(i)),g=a_(m);let b=h[g],y=h[m];if(s){const j=g==="y"?"top":"left",O=g==="y"?"bottom":"right",E=b+p[j],A=b-p[O];b=_w(E,b,A)}if(u){const j=m==="y"?"top":"left",O=m==="y"?"bottom":"right",E=y+p[j],A=y-p[O];y=_w(E,y,A)}const w=f.fn({...t,[g]:b,[m]:y});return{...w,data:{x:w.x-r,y:w.y-n,enabled:{[g]:s,[m]:u}}}}}},gie=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:i,rects:o,middlewareData:s}=t,{offset:u=0,mainAxis:f=!0,crossAxis:l=!0}=ki(e,t),h={x:r,y:n},p=Yn(i),m=a_(p);let g=h[m],b=h[p];const y=ki(u,t),w=typeof y=="number"?{mainAxis:y,crossAxis:0}:{mainAxis:0,crossAxis:0,...y};if(f){const E=m==="y"?"height":"width",A=o.reference[m]-o.floating[E]+w.mainAxis,N=o.reference[m]+o.reference[E]-w.mainAxis;gN&&(g=N)}if(l){var j,O;const E=m==="y"?"width":"height",A=_$.has(Ri(i)),N=o.reference[p]-o.floating[E]+(A&&((j=s.offset)==null?void 0:j[p])||0)+(A?0:w.crossAxis),C=o.reference[p]+o.reference[E]+(A?0:((O=s.offset)==null?void 0:O[p])||0)-(A?w.crossAxis:0);bC&&(b=C)}return{[m]:g,[p]:b}}}},yie=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:i,rects:o,platform:s,elements:u}=t,{apply:f=()=>{},...l}=ki(e,t),h=await s.detectOverflow(t,l),p=Ri(i),m=ul(i),g=Yn(i)==="y",{width:b,height:y}=o.floating;let w,j;p==="top"||p==="bottom"?(w=p,j=m===(await(s.isRTL==null?void 0:s.isRTL(u.floating))?"start":"end")?"left":"right"):(j=p,w=m==="end"?"top":"bottom");const O=y-h.top-h.bottom,E=b-h.left-h.right,A=po(y-h[w],O),N=po(b-h[j],E),C=!t.middlewareData.shift;let T=A,R=N;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(R=E),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(T=O),C&&!m){const F=Xr(h.left,0),L=Xr(h.right,0),$=Xr(h.top,0),U=Xr(h.bottom,0);g?R=b-2*(F!==0||L!==0?F+L:Xr(h.left,h.right)):T=y-2*($!==0||U!==0?$+U:Xr(h.top,h.bottom))}await f({...t,availableWidth:R,availableHeight:T});const I=await s.getDimensions(u.floating);return b!==I.width||y!==I.height?{reset:{rects:!0}}:{}}}};function hm(){return typeof window<"u"}function fl(e){return j$(e)?(e.nodeName||"").toLowerCase():"#document"}function Jr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function si(e){var t;return(t=(j$(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function j$(e){return hm()?e instanceof Node||e instanceof Jr(e).Node:!1}function Ln(e){return hm()?e instanceof Element||e instanceof Jr(e).Element:!1}function ni(e){return hm()?e instanceof HTMLElement||e instanceof Jr(e).HTMLElement:!1}function qk(e){return!hm()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Jr(e).ShadowRoot}const xie=new Set(["inline","contents"]);function Ou(e){const{overflow:t,overflowX:r,overflowY:n,display:i}=$n(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!xie.has(i)}const bie=new Set(["table","td","th"]);function wie(e){return bie.has(fl(e))}const Sie=[":popover-open",":modal"];function pm(e){return Sie.some(t=>{try{return e.matches(t)}catch{return!1}})}const _ie=["transform","translate","scale","rotate","perspective"],jie=["transform","translate","scale","rotate","perspective","filter"],Oie=["paint","layout","strict","content"];function c_(e){const t=u_(),r=Ln(e)?$n(e):e;return _ie.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||jie.some(n=>(r.willChange||"").includes(n))||Oie.some(n=>(r.contain||"").includes(n))}function Eie(e){let t=mo(e);for(;ni(t)&&!Xs(t);){if(c_(t))return t;if(pm(t))return null;t=mo(t)}return null}function u_(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Pie=new Set(["html","body","#document"]);function Xs(e){return Pie.has(fl(e))}function $n(e){return Jr(e).getComputedStyle(e)}function mm(e){return Ln(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function mo(e){if(fl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||qk(e)&&e.host||si(e);return qk(t)?t.host:t}function O$(e){const t=mo(e);return Xs(t)?e.ownerDocument?e.ownerDocument.body:e.body:ni(t)&&Ou(t)?t:O$(t)}function uu(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const i=O$(e),o=i===((n=e.ownerDocument)==null?void 0:n.body),s=Jr(i);if(o){const u=Ow(s);return t.concat(s,s.visualViewport||[],Ou(i)?i:[],u&&r?uu(u):[])}return t.concat(i,uu(i,[],r))}function Ow(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function E$(e){const t=$n(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const i=ni(e),o=i?e.offsetWidth:r,s=i?e.offsetHeight:n,u=vp(r)!==o||vp(n)!==s;return u&&(r=o,n=s),{width:r,height:n,$:u}}function f_(e){return Ln(e)?e:e.contextElement}function ms(e){const t=f_(e);if(!ni(t))return ei(1);const r=t.getBoundingClientRect(),{width:n,height:i,$:o}=E$(t);let s=(o?vp(r.width):r.width)/n,u=(o?vp(r.height):r.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!u||!Number.isFinite(u))&&(u=1),{x:s,y:u}}const Nie=ei(0);function P$(e){const t=Jr(e);return!u_()||!t.visualViewport?Nie:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Aie(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Jr(e)?!1:t}function la(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const i=e.getBoundingClientRect(),o=f_(e);let s=ei(1);t&&(n?Ln(n)&&(s=ms(n)):s=ms(e));const u=Aie(o,r,n)?P$(o):ei(0);let f=(i.left+u.x)/s.x,l=(i.top+u.y)/s.y,h=i.width/s.x,p=i.height/s.y;if(o){const m=Jr(o),g=n&&Ln(n)?Jr(n):n;let b=m,y=Ow(b);for(;y&&n&&g!==b;){const w=ms(y),j=y.getBoundingClientRect(),O=$n(y),E=j.left+(y.clientLeft+parseFloat(O.paddingLeft))*w.x,A=j.top+(y.clientTop+parseFloat(O.paddingTop))*w.y;f*=w.x,l*=w.y,h*=w.x,p*=w.y,f+=E,l+=A,b=Jr(y),y=Ow(b)}}return yp({width:h,height:p,x:f,y:l})}function vm(e,t){const r=mm(e).scrollLeft;return t?t.left+r:la(si(e)).left+r}function N$(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-vm(e,r),i=r.top+t.scrollTop;return{x:n,y:i}}function Cie(e){let{elements:t,rect:r,offsetParent:n,strategy:i}=e;const o=i==="fixed",s=si(n),u=t?pm(t.floating):!1;if(n===s||u&&o)return r;let f={scrollLeft:0,scrollTop:0},l=ei(1);const h=ei(0),p=ni(n);if((p||!p&&!o)&&((fl(n)!=="body"||Ou(s))&&(f=mm(n)),ni(n))){const g=la(n);l=ms(n),h.x=g.x+n.clientLeft,h.y=g.y+n.clientTop}const m=s&&!p&&!o?N$(s,f):ei(0);return{width:r.width*l.x,height:r.height*l.y,x:r.x*l.x-f.scrollLeft*l.x+h.x+m.x,y:r.y*l.y-f.scrollTop*l.y+h.y+m.y}}function Tie(e){return Array.from(e.getClientRects())}function kie(e){const t=si(e),r=mm(e),n=e.ownerDocument.body,i=Xr(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=Xr(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let s=-r.scrollLeft+vm(e);const u=-r.scrollTop;return $n(n).direction==="rtl"&&(s+=Xr(t.clientWidth,n.clientWidth)-i),{width:i,height:o,x:s,y:u}}const Uk=25;function Rie(e,t){const r=Jr(e),n=si(e),i=r.visualViewport;let o=n.clientWidth,s=n.clientHeight,u=0,f=0;if(i){o=i.width,s=i.height;const h=u_();(!h||h&&t==="fixed")&&(u=i.offsetLeft,f=i.offsetTop)}const l=vm(n);if(l<=0){const h=n.ownerDocument,p=h.body,m=getComputedStyle(p),g=h.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,b=Math.abs(n.clientWidth-p.clientWidth-g);b<=Uk&&(o-=b)}else l<=Uk&&(o+=l);return{width:o,height:s,x:u,y:f}}const Mie=new Set(["absolute","fixed"]);function Iie(e,t){const r=la(e,!0,t==="fixed"),n=r.top+e.clientTop,i=r.left+e.clientLeft,o=ni(e)?ms(e):ei(1),s=e.clientWidth*o.x,u=e.clientHeight*o.y,f=i*o.x,l=n*o.y;return{width:s,height:u,x:f,y:l}}function Wk(e,t,r){let n;if(t==="viewport")n=Rie(e,r);else if(t==="document")n=kie(si(e));else if(Ln(t))n=Iie(t,r);else{const i=P$(e);n={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return yp(n)}function A$(e,t){const r=mo(e);return r===t||!Ln(r)||Xs(r)?!1:$n(r).position==="fixed"||A$(r,t)}function Die(e,t){const r=t.get(e);if(r)return r;let n=uu(e,[],!1).filter(u=>Ln(u)&&fl(u)!=="body"),i=null;const o=$n(e).position==="fixed";let s=o?mo(e):e;for(;Ln(s)&&!Xs(s);){const u=$n(s),f=c_(s);!f&&u.position==="fixed"&&(i=null),(o?!f&&!i:!f&&u.position==="static"&&!!i&&Mie.has(i.position)||Ou(s)&&!f&&A$(e,s))?n=n.filter(h=>h!==s):i=u,s=mo(s)}return t.set(e,n),n}function Lie(e){let{element:t,boundary:r,rootBoundary:n,strategy:i}=e;const s=[...r==="clippingAncestors"?pm(t)?[]:Die(t,this._c):[].concat(r),n],u=s[0],f=s.reduce((l,h)=>{const p=Wk(t,h,i);return l.top=Xr(p.top,l.top),l.right=po(p.right,l.right),l.bottom=po(p.bottom,l.bottom),l.left=Xr(p.left,l.left),l},Wk(t,u,i));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function $ie(e){const{width:t,height:r}=E$(e);return{width:t,height:r}}function Bie(e,t,r){const n=ni(t),i=si(t),o=r==="fixed",s=la(e,!0,o,t);let u={scrollLeft:0,scrollTop:0};const f=ei(0);function l(){f.x=vm(i)}if(n||!n&&!o)if((fl(t)!=="body"||Ou(i))&&(u=mm(t)),n){const g=la(t,!0,o,t);f.x=g.x+t.clientLeft,f.y=g.y+t.clientTop}else i&&l();o&&!n&&i&&l();const h=i&&!n&&!o?N$(i,u):ei(0),p=s.left+u.scrollLeft-f.x-h.x,m=s.top+u.scrollTop-f.y-h.y;return{x:p,y:m,width:s.width,height:s.height}}function Fb(e){return $n(e).position==="static"}function Hk(e,t){if(!ni(e)||$n(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return si(e)===r&&(r=r.ownerDocument.body),r}function C$(e,t){const r=Jr(e);if(pm(e))return r;if(!ni(e)){let i=mo(e);for(;i&&!Xs(i);){if(Ln(i)&&!Fb(i))return i;i=mo(i)}return r}let n=Hk(e,t);for(;n&&wie(n)&&Fb(n);)n=Hk(n,t);return n&&Xs(n)&&Fb(n)&&!c_(n)?r:n||Eie(e)||r}const Fie=async function(e){const t=this.getOffsetParent||C$,r=this.getDimensions,n=await r(e.floating);return{reference:Bie(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function zie(e){return $n(e).direction==="rtl"}const qie={convertOffsetParentRelativeRectToViewportRelativeRect:Cie,getDocumentElement:si,getClippingRect:Lie,getOffsetParent:C$,getElementRects:Fie,getClientRects:Tie,getDimensions:$ie,getScale:ms,isElement:Ln,isRTL:zie};function T$(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Uie(e,t){let r=null,n;const i=si(e);function o(){var u;clearTimeout(n),(u=r)==null||u.disconnect(),r=null}function s(u,f){u===void 0&&(u=!1),f===void 0&&(f=1),o();const l=e.getBoundingClientRect(),{left:h,top:p,width:m,height:g}=l;if(u||t(),!m||!g)return;const b=hd(p),y=hd(i.clientWidth-(h+m)),w=hd(i.clientHeight-(p+g)),j=hd(h),E={rootMargin:-b+"px "+-y+"px "+-w+"px "+-j+"px",threshold:Xr(0,po(1,f))||1};let A=!0;function N(C){const T=C[0].intersectionRatio;if(T!==f){if(!A)return s();T?s(!1,T):n=setTimeout(()=>{s(!1,1e-7)},1e3)}T===1&&!T$(l,e.getBoundingClientRect())&&s(),A=!1}try{r=new IntersectionObserver(N,{...E,root:i.ownerDocument})}catch{r=new IntersectionObserver(N,E)}r.observe(e)}return s(!0),o}function Wie(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:f=!1}=n,l=f_(e),h=i||o?[...l?uu(l):[],...uu(t)]:[];h.forEach(j=>{i&&j.addEventListener("scroll",r,{passive:!0}),o&&j.addEventListener("resize",r)});const p=l&&u?Uie(l,r):null;let m=-1,g=null;s&&(g=new ResizeObserver(j=>{let[O]=j;O&&O.target===l&&g&&(g.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var E;(E=g)==null||E.observe(t)})),r()}),l&&!f&&g.observe(l),g.observe(t));let b,y=f?la(e):null;f&&w();function w(){const j=la(e);y&&!T$(y,j)&&r(),y=j,b=requestAnimationFrame(w)}return r(),()=>{var j;h.forEach(O=>{i&&O.removeEventListener("scroll",r),o&&O.removeEventListener("resize",r)}),p?.(),(j=g)==null||j.disconnect(),g=null,f&&cancelAnimationFrame(b)}}const Hie=mie,Vie=vie,Gie=die,Kie=yie,Xie=hie,Vk=fie,Yie=gie,Qie=(e,t,r)=>{const n=new Map,i={platform:qie,...r},o={...i.platform,_c:n};return uie(e,t,{...i,platform:o})};var Zie=typeof document<"u",Jie=function(){},rh=Zie?S.useLayoutEffect:Jie;function xp(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let r,n,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!xp(e[n],t[n]))return!1;return!0}if(i=Object.keys(e),r=i.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,i[n]))return!1;for(n=r;n--!==0;){const o=i[n];if(!(o==="_owner"&&e.$$typeof)&&!xp(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function k$(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Gk(e,t){const r=k$(e);return Math.round(t*r)/r}function zb(e){const t=S.useRef(e);return rh(()=>{t.current=e}),t}function eoe(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:o,floating:s}={},transform:u=!0,whileElementsMounted:f,open:l}=e,[h,p]=S.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[m,g]=S.useState(n);xp(m,n)||g(n);const[b,y]=S.useState(null),[w,j]=S.useState(null),O=S.useCallback(D=>{D!==C.current&&(C.current=D,y(D))},[]),E=S.useCallback(D=>{D!==T.current&&(T.current=D,j(D))},[]),A=o||b,N=s||w,C=S.useRef(null),T=S.useRef(null),R=S.useRef(h),I=f!=null,F=zb(f),L=zb(i),$=zb(l),U=S.useCallback(()=>{if(!C.current||!T.current)return;const D={placement:t,strategy:r,middleware:m};L.current&&(D.platform=L.current),Qie(C.current,T.current,D).then(Z=>{const J={...Z,isPositioned:$.current!==!1};G.current&&!xp(R.current,J)&&(R.current=J,pu.flushSync(()=>{p(J)}))})},[m,t,r,L,$]);rh(()=>{l===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,p(D=>({...D,isPositioned:!1})))},[l]);const G=S.useRef(!1);rh(()=>(G.current=!0,()=>{G.current=!1}),[]),rh(()=>{if(A&&(C.current=A),N&&(T.current=N),A&&N){if(F.current)return F.current(A,N,U);U()}},[A,N,U,F,I]);const q=S.useMemo(()=>({reference:C,floating:T,setReference:O,setFloating:E}),[O,E]),H=S.useMemo(()=>({reference:A,floating:N}),[A,N]),V=S.useMemo(()=>{const D={position:r,left:0,top:0};if(!H.floating)return D;const Z=Gk(H.floating,h.x),J=Gk(H.floating,h.y);return u?{...D,transform:"translate("+Z+"px, "+J+"px)",...k$(H.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:Z,top:J}},[r,u,H.floating,h.x,h.y]);return S.useMemo(()=>({...h,update:U,refs:q,elements:H,floatingStyles:V}),[h,U,q,H,V])}const toe=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:i}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?Vk({element:n.current,padding:i}).fn(r):{}:n?Vk({element:n,padding:i}).fn(r):{}}}},roe=(e,t)=>({...Hie(e),options:[e,t]}),noe=(e,t)=>({...Vie(e),options:[e,t]}),ioe=(e,t)=>({...Yie(e),options:[e,t]}),ooe=(e,t)=>({...Gie(e),options:[e,t]}),aoe=(e,t)=>({...Kie(e),options:[e,t]}),soe=(e,t)=>({...Xie(e),options:[e,t]}),loe=(e,t)=>({...toe(e),options:[e,t]});var coe="Arrow",R$=S.forwardRef((e,t)=>{const{children:r,width:n=10,height:i=5,...o}=e;return d.jsx(Ue.svg,{...o,ref:t,width:n,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:d.jsx("polygon",{points:"0,0 30,0 15,10"})})});R$.displayName=coe;var uoe=R$;function d_(e){const[t,r]=S.useState(void 0);return Lt(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const o=i[0];let s,u;if("borderBoxSize"in o){const f=o.borderBoxSize,l=Array.isArray(f)?f[0]:f;s=l.inlineSize,u=l.blockSize}else s=e.offsetWidth,u=e.offsetHeight;r({width:s,height:u})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var h_="Popper",[M$,dl]=Bn(h_),[foe,I$]=M$(h_),D$=e=>{const{__scopePopper:t,children:r}=e,[n,i]=S.useState(null);return d.jsx(foe,{scope:t,anchor:n,onAnchorChange:i,children:r})};D$.displayName=h_;var L$="PopperAnchor",$$=S.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...i}=e,o=I$(L$,r),s=S.useRef(null),u=Ze(t,s),f=S.useRef(null);return S.useEffect(()=>{const l=f.current;f.current=n?.current||s.current,l!==f.current&&o.onAnchorChange(f.current)}),n?null:d.jsx(Ue.div,{...i,ref:u})});$$.displayName=L$;var p_="PopperContent",[doe,hoe]=M$(p_),B$=S.forwardRef((e,t)=>{const{__scopePopper:r,side:n="bottom",sideOffset:i=0,align:o="center",alignOffset:s=0,arrowPadding:u=0,avoidCollisions:f=!0,collisionBoundary:l=[],collisionPadding:h=0,sticky:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:b,...y}=e,w=I$(p_,r),[j,O]=S.useState(null),E=Ze(t,K=>O(K)),[A,N]=S.useState(null),C=d_(A),T=C?.width??0,R=C?.height??0,I=n+(o!=="center"?"-"+o:""),F=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},L=Array.isArray(l)?l:[l],$=L.length>0,U={padding:F,boundary:L.filter(moe),altBoundary:$},{refs:G,floatingStyles:q,placement:H,isPositioned:V,middlewareData:D}=eoe({strategy:"fixed",placement:I,whileElementsMounted:(...K)=>Wie(...K,{animationFrame:g==="always"}),elements:{reference:w.anchor},middleware:[roe({mainAxis:i+R,alignmentAxis:s}),f&&noe({mainAxis:!0,crossAxis:!1,limiter:p==="partial"?ioe():void 0,...U}),f&&ooe({...U}),aoe({...U,apply:({elements:K,rects:ce,availableWidth:te,availableHeight:le})=>{const{width:ge,height:Y}=ce.reference,_e=K.floating.style;_e.setProperty("--radix-popper-available-width",`${te}px`),_e.setProperty("--radix-popper-available-height",`${le}px`),_e.setProperty("--radix-popper-anchor-width",`${ge}px`),_e.setProperty("--radix-popper-anchor-height",`${Y}px`)}}),A&&loe({element:A,padding:u}),voe({arrowWidth:T,arrowHeight:R}),m&&soe({strategy:"referenceHidden",...U})]}),[Z,J]=q$(H),M=fr(b);Lt(()=>{V&&M?.()},[V,M]);const B=D.arrow?.x,ee=D.arrow?.y,ae=D.arrow?.centerOffset!==0,[ie,fe]=S.useState();return Lt(()=>{j&&fe(window.getComputedStyle(j).zIndex)},[j]),d.jsx("div",{ref:G.setFloating,"data-radix-popper-content-wrapper":"",style:{...q,transform:V?q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ie,"--radix-popper-transform-origin":[D.transformOrigin?.x,D.transformOrigin?.y].join(" "),...D.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:d.jsx(doe,{scope:r,placedSide:Z,onArrowChange:N,arrowX:B,arrowY:ee,shouldHideArrow:ae,children:d.jsx(Ue.div,{"data-side":Z,"data-align":J,...y,ref:E,style:{...y.style,animation:V?void 0:"none"}})})})});B$.displayName=p_;var F$="PopperArrow",poe={top:"bottom",right:"left",bottom:"top",left:"right"},z$=S.forwardRef(function(t,r){const{__scopePopper:n,...i}=t,o=hoe(F$,n),s=poe[o.placedSide];return d.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:d.jsx(uoe,{...i,ref:r,style:{...i.style,display:"block"}})})});z$.displayName=F$;function moe(e){return e!==null}var voe=e=>({name:"transformOrigin",options:e,fn(t){const{placement:r,rects:n,middlewareData:i}=t,s=i.arrow?.centerOffset!==0,u=s?0:e.arrowWidth,f=s?0:e.arrowHeight,[l,h]=q$(r),p={start:"0%",center:"50%",end:"100%"}[h],m=(i.arrow?.x??0)+u/2,g=(i.arrow?.y??0)+f/2;let b="",y="";return l==="bottom"?(b=s?p:`${m}px`,y=`${-f}px`):l==="top"?(b=s?p:`${m}px`,y=`${n.floating.height+f}px`):l==="right"?(b=`${-f}px`,y=s?p:`${g}px`):l==="left"&&(b=`${n.floating.width+f}px`,y=s?p:`${g}px`),{data:{x:b,y}}}});function q$(e){const[t,r="center"]=e.split("-");return[t,r]}var m_=D$,gm=$$,v_=B$,g_=z$,goe="Portal",Eu=S.forwardRef((e,t)=>{const{container:r,...n}=e,[i,o]=S.useState(!1);Lt(()=>o(!0),[]);const s=r||i&&globalThis?.document?.body;return s?$6.createPortal(d.jsx(Ue.div,{...n,ref:t}),s):null});Eu.displayName=goe;function yoe(e){const t=xoe(e),r=S.forwardRef((n,i)=>{const{children:o,...s}=n,u=S.Children.toArray(o),f=u.find(woe);if(f){const l=f.props.children,h=u.map(p=>p===f?S.Children.count(l)>1?S.Children.only(null):S.isValidElement(l)?l.props.children:null:p);return d.jsx(t,{...s,ref:i,children:S.isValidElement(l)?S.cloneElement(l,void 0,h):null})}return d.jsx(t,{...s,ref:i,children:o})});return r.displayName=`${e}.Slot`,r}function xoe(e){const t=S.forwardRef((r,n)=>{const{children:i,...o}=r;if(S.isValidElement(i)){const s=_oe(i),u=Soe(o,i.props);return i.type!==S.Fragment&&(u.ref=n?ha(n,s):s),S.cloneElement(i,u)}return S.Children.count(i)>1?S.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var boe=Symbol("radix.slottable");function woe(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===boe}function Soe(e,t){const r={...t};for(const n in t){const i=e[n],o=t[n];/^on[A-Z]/.test(n)?i&&o?r[n]=(...u)=>{const f=o(...u);return i(...u),f}:i&&(r[n]=i):n==="style"?r[n]={...i,...o}:n==="className"&&(r[n]=[i,o].filter(Boolean).join(" "))}return{...e,...r}}function _oe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var joe=Uw[" useInsertionEffect ".trim().toString()]||Lt;function Mi({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[i,o,s]=Ooe({defaultProp:t,onChange:r}),u=e!==void 0,f=u?e:i;{const h=S.useRef(e!==void 0);S.useEffect(()=>{const p=h.current;p!==u&&console.warn(`${n} is changing from ${p?"controlled":"uncontrolled"} to ${u?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),h.current=u},[u,n])}const l=S.useCallback(h=>{if(u){const p=Eoe(h)?h(e):h;p!==e&&s.current?.(p)}else o(h)},[u,e,o,s]);return[f,l]}function Ooe({defaultProp:e,onChange:t}){const[r,n]=S.useState(e),i=S.useRef(r),o=S.useRef(t);return joe(()=>{o.current=t},[t]),S.useEffect(()=>{i.current!==r&&(o.current?.(r),i.current=r)},[r,i]),[r,n,o]}function Eoe(e){return typeof e=="function"}function y_(e){const t=S.useRef({value:e,previous:e});return S.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var U$=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),Poe="VisuallyHidden",W$=S.forwardRef((e,t)=>d.jsx(Ue.span,{...e,ref:t,style:{...U$,...e.style}}));W$.displayName=Poe;var Noe=W$,Aoe=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Za=new WeakMap,pd=new WeakMap,md={},qb=0,H$=function(e){return e&&(e.host||H$(e.parentNode))},Coe=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=H$(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},Toe=function(e,t,r,n){var i=Coe(t,Array.isArray(e)?e:[e]);md[r]||(md[r]=new WeakMap);var o=md[r],s=[],u=new Set,f=new Set(i),l=function(p){!p||u.has(p)||(u.add(p),l(p.parentNode))};i.forEach(l);var h=function(p){!p||f.has(p)||Array.prototype.forEach.call(p.children,function(m){if(u.has(m))h(m);else try{var g=m.getAttribute(n),b=g!==null&&g!=="false",y=(Za.get(m)||0)+1,w=(o.get(m)||0)+1;Za.set(m,y),o.set(m,w),s.push(m),y===1&&b&&pd.set(m,!0),w===1&&m.setAttribute(r,"true"),b||m.setAttribute(n,"true")}catch(j){console.error("aria-hidden: cannot operate on ",m,j)}})};return h(t),u.clear(),qb++,function(){s.forEach(function(p){var m=Za.get(p)-1,g=o.get(p)-1;Za.set(p,m),o.set(p,g),m||(pd.has(p)||p.removeAttribute(n),pd.delete(p)),g||p.removeAttribute(r)}),qb--,qb||(Za=new WeakMap,Za=new WeakMap,pd=new WeakMap,md={})}},x_=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),i=Aoe(e);return i?(n.push.apply(n,Array.from(i.querySelectorAll("[aria-live], script"))),Toe(n,i,r,"aria-hidden")):function(){return null}},Kn=function(){return Kn=Object.assign||function(t){for(var r,n=1,i=arguments.length;n"u")return Koe;var t=Xoe(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},Qoe=X$(),vs="data-scroll-locked",Zoe=function(e,t,r,n){var i=e.left,o=e.top,s=e.right,u=e.gap;return r===void 0&&(r="margin"),` + .`.concat(Roe,` { + overflow: hidden `).concat(n,`; + padding-right: `).concat(u,"px ").concat(n,`; + } + body[`).concat(vs,`] { + overflow: hidden `).concat(n,`; + overscroll-behavior: contain; + `).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&` + padding-left: `.concat(i,`px; + padding-top: `).concat(o,`px; + padding-right: `).concat(s,`px; + margin-left:0; + margin-top:0; + margin-right: `).concat(u,"px ").concat(n,`; + `),r==="padding"&&"padding-right: ".concat(u,"px ").concat(n,";")].filter(Boolean).join(""),` + } + + .`).concat(nh,` { + right: `).concat(u,"px ").concat(n,`; + } + + .`).concat(ih,` { + margin-right: `).concat(u,"px ").concat(n,`; + } + + .`).concat(nh," .").concat(nh,` { + right: 0 `).concat(n,`; + } + + .`).concat(ih," .").concat(ih,` { + margin-right: 0 `).concat(n,`; + } + + body[`).concat(vs,`] { + `).concat(Moe,": ").concat(u,`px; + } +`)},Xk=function(){var e=parseInt(document.body.getAttribute(vs)||"0",10);return isFinite(e)?e:0},Joe=function(){S.useEffect(function(){return document.body.setAttribute(vs,(Xk()+1).toString()),function(){var e=Xk()-1;e<=0?document.body.removeAttribute(vs):document.body.setAttribute(vs,e.toString())}},[])},eae=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,i=n===void 0?"margin":n;Joe();var o=S.useMemo(function(){return Yoe(i)},[i]);return S.createElement(Qoe,{styles:Zoe(o,!t,i,r?"":"!important")})},Ew=!1;if(typeof window<"u")try{var vd=Object.defineProperty({},"passive",{get:function(){return Ew=!0,!0}});window.addEventListener("test",vd,vd),window.removeEventListener("test",vd,vd)}catch{Ew=!1}var Ja=Ew?{passive:!1}:!1,tae=function(e){return e.tagName==="TEXTAREA"},Y$=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!tae(e)&&r[t]==="visible")},rae=function(e){return Y$(e,"overflowY")},nae=function(e){return Y$(e,"overflowX")},Yk=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var i=Q$(e,n);if(i){var o=Z$(e,n),s=o[1],u=o[2];if(s>u)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},iae=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},oae=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},Q$=function(e,t){return e==="v"?rae(t):nae(t)},Z$=function(e,t){return e==="v"?iae(t):oae(t)},aae=function(e,t){return e==="h"&&t==="rtl"?-1:1},sae=function(e,t,r,n,i){var o=aae(e,window.getComputedStyle(t).direction),s=o*n,u=r.target,f=t.contains(u),l=!1,h=s>0,p=0,m=0;do{if(!u)break;var g=Z$(e,u),b=g[0],y=g[1],w=g[2],j=y-w-o*b;(b||j)&&Q$(e,u)&&(p+=j,m+=b);var O=u.parentNode;u=O&&O.nodeType===Node.DOCUMENT_FRAGMENT_NODE?O.host:O}while(!f&&u!==document.body||f&&(t.contains(u)||t===u));return(h&&Math.abs(p)<1||!h&&Math.abs(m)<1)&&(l=!0),l},gd=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Qk=function(e){return[e.deltaX,e.deltaY]},Zk=function(e){return e&&"current"in e?e.current:e},lae=function(e,t){return e[0]===t[0]&&e[1]===t[1]},cae=function(e){return` + .block-interactivity-`.concat(e,` {pointer-events: none;} + .allow-interactivity-`).concat(e,` {pointer-events: all;} +`)},uae=0,es=[];function fae(e){var t=S.useRef([]),r=S.useRef([0,0]),n=S.useRef(),i=S.useState(uae++)[0],o=S.useState(X$)[0],s=S.useRef(e);S.useEffect(function(){s.current=e},[e]),S.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var y=koe([e.lockRef.current],(e.shards||[]).map(Zk),!0).filter(Boolean);return y.forEach(function(w){return w.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),y.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var u=S.useCallback(function(y,w){if("touches"in y&&y.touches.length===2||y.type==="wheel"&&y.ctrlKey)return!s.current.allowPinchZoom;var j=gd(y),O=r.current,E="deltaX"in y?y.deltaX:O[0]-j[0],A="deltaY"in y?y.deltaY:O[1]-j[1],N,C=y.target,T=Math.abs(E)>Math.abs(A)?"h":"v";if("touches"in y&&T==="h"&&C.type==="range")return!1;var R=window.getSelection(),I=R&&R.anchorNode,F=I?I===C||I.contains(C):!1;if(F)return!1;var L=Yk(T,C);if(!L)return!0;if(L?N=T:(N=T==="v"?"h":"v",L=Yk(T,C)),!L)return!1;if(!n.current&&"changedTouches"in y&&(E||A)&&(n.current=N),!N)return!0;var $=n.current||N;return sae($,w,y,$==="h"?E:A)},[]),f=S.useCallback(function(y){var w=y;if(!(!es.length||es[es.length-1]!==o)){var j="deltaY"in w?Qk(w):gd(w),O=t.current.filter(function(N){return N.name===w.type&&(N.target===w.target||w.target===N.shadowParent)&&lae(N.delta,j)})[0];if(O&&O.should){w.cancelable&&w.preventDefault();return}if(!O){var E=(s.current.shards||[]).map(Zk).filter(Boolean).filter(function(N){return N.contains(w.target)}),A=E.length>0?u(w,E[0]):!s.current.noIsolation;A&&w.cancelable&&w.preventDefault()}}},[]),l=S.useCallback(function(y,w,j,O){var E={name:y,delta:w,target:j,should:O,shadowParent:dae(j)};t.current.push(E),setTimeout(function(){t.current=t.current.filter(function(A){return A!==E})},1)},[]),h=S.useCallback(function(y){r.current=gd(y),n.current=void 0},[]),p=S.useCallback(function(y){l(y.type,Qk(y),y.target,u(y,e.lockRef.current))},[]),m=S.useCallback(function(y){l(y.type,gd(y),y.target,u(y,e.lockRef.current))},[]);S.useEffect(function(){return es.push(o),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:m}),document.addEventListener("wheel",f,Ja),document.addEventListener("touchmove",f,Ja),document.addEventListener("touchstart",h,Ja),function(){es=es.filter(function(y){return y!==o}),document.removeEventListener("wheel",f,Ja),document.removeEventListener("touchmove",f,Ja),document.removeEventListener("touchstart",h,Ja)}},[]);var g=e.removeScrollBar,b=e.inert;return S.createElement(S.Fragment,null,b?S.createElement(o,{styles:cae(i)}):null,g?S.createElement(eae,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function dae(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const hae=zoe(K$,fae);var xm=S.forwardRef(function(e,t){return S.createElement(ym,Kn({},e,{ref:t,sideCar:hae}))});xm.classNames=ym.classNames;var pae=[" ","Enter","ArrowUp","ArrowDown"],mae=[" ","Enter"],ca="Select",[bm,wm,vae]=y$(ca),[hl]=Bn(ca,[vae,dl]),Sm=dl(),[gae,bo]=hl(ca),[yae,xae]=hl(ca),J$=e=>{const{__scopeSelect:t,children:r,open:n,defaultOpen:i,onOpenChange:o,value:s,defaultValue:u,onValueChange:f,dir:l,name:h,autoComplete:p,disabled:m,required:g,form:b}=e,y=Sm(t),[w,j]=S.useState(null),[O,E]=S.useState(null),[A,N]=S.useState(!1),C=Ep(l),[T,R]=Mi({prop:n,defaultProp:i??!1,onChange:o,caller:ca}),[I,F]=Mi({prop:s,defaultProp:u,onChange:f,caller:ca}),L=S.useRef(null),$=w?b||!!w.closest("form"):!0,[U,G]=S.useState(new Set),q=Array.from(U).map(H=>H.props.value).join(";");return d.jsx(m_,{...y,children:d.jsxs(gae,{required:g,scope:t,trigger:w,onTriggerChange:j,valueNode:O,onValueNodeChange:E,valueNodeHasChildren:A,onValueNodeHasChildrenChange:N,contentId:Jn(),value:I,onValueChange:F,open:T,onOpenChange:R,dir:C,triggerPointerDownPosRef:L,disabled:m,children:[d.jsx(bm.Provider,{scope:t,children:d.jsx(yae,{scope:e.__scopeSelect,onNativeOptionAdd:S.useCallback(H=>{G(V=>new Set(V).add(H))},[]),onNativeOptionRemove:S.useCallback(H=>{G(V=>{const D=new Set(V);return D.delete(H),D})},[]),children:r})}),$?d.jsxs(w3,{"aria-hidden":!0,required:g,tabIndex:-1,name:h,autoComplete:p,value:I,onChange:H=>F(H.target.value),disabled:m,form:b,children:[I===void 0?d.jsx("option",{value:""}):null,Array.from(U)]},q):null]})})};J$.displayName=ca;var e3="SelectTrigger",t3=S.forwardRef((e,t)=>{const{__scopeSelect:r,disabled:n=!1,...i}=e,o=Sm(r),s=bo(e3,r),u=s.disabled||n,f=Ze(t,s.onTriggerChange),l=wm(r),h=S.useRef("touch"),[p,m,g]=_3(y=>{const w=l().filter(E=>!E.disabled),j=w.find(E=>E.value===s.value),O=j3(w,y,j);O!==void 0&&s.onValueChange(O.value)}),b=y=>{u||(s.onOpenChange(!0),g()),y&&(s.triggerPointerDownPosRef.current={x:Math.round(y.pageX),y:Math.round(y.pageY)})};return d.jsx(gm,{asChild:!0,...o,children:d.jsx(Ue.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":S3(s.value)?"":void 0,...i,ref:f,onClick:Ie(i.onClick,y=>{y.currentTarget.focus(),h.current!=="mouse"&&b(y)}),onPointerDown:Ie(i.onPointerDown,y=>{h.current=y.pointerType;const w=y.target;w.hasPointerCapture(y.pointerId)&&w.releasePointerCapture(y.pointerId),y.button===0&&y.ctrlKey===!1&&y.pointerType==="mouse"&&(b(y),y.preventDefault())}),onKeyDown:Ie(i.onKeyDown,y=>{const w=p.current!=="";!(y.ctrlKey||y.altKey||y.metaKey)&&y.key.length===1&&m(y.key),!(w&&y.key===" ")&&pae.includes(y.key)&&(b(),y.preventDefault())})})})});t3.displayName=e3;var r3="SelectValue",n3=S.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:i,children:o,placeholder:s="",...u}=e,f=bo(r3,r),{onValueNodeHasChildrenChange:l}=f,h=o!==void 0,p=Ze(t,f.onValueNodeChange);return Lt(()=>{l(h)},[l,h]),d.jsx(Ue.span,{...u,ref:p,style:{pointerEvents:"none"},children:S3(f.value)?d.jsx(d.Fragment,{children:s}):o})});n3.displayName=r3;var bae="SelectIcon",i3=S.forwardRef((e,t)=>{const{__scopeSelect:r,children:n,...i}=e;return d.jsx(Ue.span,{"aria-hidden":!0,...i,ref:t,children:n||"▼"})});i3.displayName=bae;var wae="SelectPortal",o3=e=>d.jsx(Eu,{asChild:!0,...e});o3.displayName=wae;var ua="SelectContent",a3=S.forwardRef((e,t)=>{const r=bo(ua,e.__scopeSelect),[n,i]=S.useState();if(Lt(()=>{i(new DocumentFragment)},[]),!r.open){const o=n;return o?pu.createPortal(d.jsx(s3,{scope:e.__scopeSelect,children:d.jsx(bm.Slot,{scope:e.__scopeSelect,children:d.jsx("div",{children:e.children})})}),o):null}return d.jsx(l3,{...e,ref:t})});a3.displayName=ua;var Cn=10,[s3,wo]=hl(ua),Sae="SelectContentImpl",_ae=yoe("SelectContent.RemoveScroll"),l3=S.forwardRef((e,t)=>{const{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:o,onPointerDownOutside:s,side:u,sideOffset:f,align:l,alignOffset:h,arrowPadding:p,collisionBoundary:m,collisionPadding:g,sticky:b,hideWhenDetached:y,avoidCollisions:w,...j}=e,O=bo(ua,r),[E,A]=S.useState(null),[N,C]=S.useState(null),T=Ze(t,K=>A(K)),[R,I]=S.useState(null),[F,L]=S.useState(null),$=wm(r),[U,G]=S.useState(!1),q=S.useRef(!1);S.useEffect(()=>{if(E)return x_(E)},[E]),o_();const H=S.useCallback(K=>{const[ce,...te]=$().map(Y=>Y.ref.current),[le]=te.slice(-1),ge=document.activeElement;for(const Y of K)if(Y===ge||(Y?.scrollIntoView({block:"nearest"}),Y===ce&&N&&(N.scrollTop=0),Y===le&&N&&(N.scrollTop=N.scrollHeight),Y?.focus(),document.activeElement!==ge))return},[$,N]),V=S.useCallback(()=>H([R,E]),[H,R,E]);S.useEffect(()=>{U&&V()},[U,V]);const{onOpenChange:D,triggerPointerDownPosRef:Z}=O;S.useEffect(()=>{if(E){let K={x:0,y:0};const ce=le=>{K={x:Math.abs(Math.round(le.pageX)-(Z.current?.x??0)),y:Math.abs(Math.round(le.pageY)-(Z.current?.y??0))}},te=le=>{K.x<=10&&K.y<=10?le.preventDefault():E.contains(le.target)||D(!1),document.removeEventListener("pointermove",ce),Z.current=null};return Z.current!==null&&(document.addEventListener("pointermove",ce),document.addEventListener("pointerup",te,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ce),document.removeEventListener("pointerup",te,{capture:!0})}}},[E,D,Z]),S.useEffect(()=>{const K=()=>D(!1);return window.addEventListener("blur",K),window.addEventListener("resize",K),()=>{window.removeEventListener("blur",K),window.removeEventListener("resize",K)}},[D]);const[J,M]=_3(K=>{const ce=$().filter(ge=>!ge.disabled),te=ce.find(ge=>ge.ref.current===document.activeElement),le=j3(ce,K,te);le&&setTimeout(()=>le.ref.current.focus())}),B=S.useCallback((K,ce,te)=>{const le=!q.current&&!te;(O.value!==void 0&&O.value===ce||le)&&(I(K),le&&(q.current=!0))},[O.value]),ee=S.useCallback(()=>E?.focus(),[E]),ae=S.useCallback((K,ce,te)=>{const le=!q.current&&!te;(O.value!==void 0&&O.value===ce||le)&&L(K)},[O.value]),ie=n==="popper"?Pw:c3,fe=ie===Pw?{side:u,sideOffset:f,align:l,alignOffset:h,arrowPadding:p,collisionBoundary:m,collisionPadding:g,sticky:b,hideWhenDetached:y,avoidCollisions:w}:{};return d.jsx(s3,{scope:r,content:E,viewport:N,onViewportChange:C,itemRefCallback:B,selectedItem:R,onItemLeave:ee,itemTextRefCallback:ae,focusSelectedItem:V,selectedItemText:F,position:n,isPositioned:U,searchRef:J,children:d.jsx(xm,{as:_ae,allowPinchZoom:!0,children:d.jsx(dm,{asChild:!0,trapped:O.open,onMountAutoFocus:K=>{K.preventDefault()},onUnmountAutoFocus:Ie(i,K=>{O.trigger?.focus({preventScroll:!0}),K.preventDefault()}),children:d.jsx(ju,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:K=>K.preventDefault(),onDismiss:()=>O.onOpenChange(!1),children:d.jsx(ie,{role:"listbox",id:O.contentId,"data-state":O.open?"open":"closed",dir:O.dir,onContextMenu:K=>K.preventDefault(),...j,...fe,onPlaced:()=>G(!0),ref:T,style:{display:"flex",flexDirection:"column",outline:"none",...j.style},onKeyDown:Ie(j.onKeyDown,K=>{const ce=K.ctrlKey||K.altKey||K.metaKey;if(K.key==="Tab"&&K.preventDefault(),!ce&&K.key.length===1&&M(K.key),["ArrowUp","ArrowDown","Home","End"].includes(K.key)){let le=$().filter(ge=>!ge.disabled).map(ge=>ge.ref.current);if(["ArrowUp","End"].includes(K.key)&&(le=le.slice().reverse()),["ArrowUp","ArrowDown"].includes(K.key)){const ge=K.target,Y=le.indexOf(ge);le=le.slice(Y+1)}setTimeout(()=>H(le)),K.preventDefault()}})})})})})})});l3.displayName=Sae;var jae="SelectItemAlignedPosition",c3=S.forwardRef((e,t)=>{const{__scopeSelect:r,onPlaced:n,...i}=e,o=bo(ua,r),s=wo(ua,r),[u,f]=S.useState(null),[l,h]=S.useState(null),p=Ze(t,T=>h(T)),m=wm(r),g=S.useRef(!1),b=S.useRef(!0),{viewport:y,selectedItem:w,selectedItemText:j,focusSelectedItem:O}=s,E=S.useCallback(()=>{if(o.trigger&&o.valueNode&&u&&l&&y&&w&&j){const T=o.trigger.getBoundingClientRect(),R=l.getBoundingClientRect(),I=o.valueNode.getBoundingClientRect(),F=j.getBoundingClientRect();if(o.dir!=="rtl"){const ge=F.left-R.left,Y=I.left-ge,_e=T.left-Y,Oe=T.width+_e,Ve=Math.max(Oe,R.width),nt=window.innerWidth-Cn,lt=e1(Y,[Cn,Math.max(Cn,nt-Ve)]);u.style.minWidth=Oe+"px",u.style.left=lt+"px"}else{const ge=R.right-F.right,Y=window.innerWidth-I.right-ge,_e=window.innerWidth-T.right-Y,Oe=T.width+_e,Ve=Math.max(Oe,R.width),nt=window.innerWidth-Cn,lt=e1(Y,[Cn,Math.max(Cn,nt-Ve)]);u.style.minWidth=Oe+"px",u.style.right=lt+"px"}const L=m(),$=window.innerHeight-Cn*2,U=y.scrollHeight,G=window.getComputedStyle(l),q=parseInt(G.borderTopWidth,10),H=parseInt(G.paddingTop,10),V=parseInt(G.borderBottomWidth,10),D=parseInt(G.paddingBottom,10),Z=q+H+U+D+V,J=Math.min(w.offsetHeight*5,Z),M=window.getComputedStyle(y),B=parseInt(M.paddingTop,10),ee=parseInt(M.paddingBottom,10),ae=T.top+T.height/2-Cn,ie=$-ae,fe=w.offsetHeight/2,K=w.offsetTop+fe,ce=q+H+K,te=Z-ce;if(ce<=ae){const ge=L.length>0&&w===L[L.length-1].ref.current;u.style.bottom="0px";const Y=l.clientHeight-y.offsetTop-y.offsetHeight,_e=Math.max(ie,fe+(ge?ee:0)+Y+V),Oe=ce+_e;u.style.height=Oe+"px"}else{const ge=L.length>0&&w===L[0].ref.current;u.style.top="0px";const _e=Math.max(ae,q+y.offsetTop+(ge?B:0)+fe)+te;u.style.height=_e+"px",y.scrollTop=ce-ae+y.offsetTop}u.style.margin=`${Cn}px 0`,u.style.minHeight=J+"px",u.style.maxHeight=$+"px",n?.(),requestAnimationFrame(()=>g.current=!0)}},[m,o.trigger,o.valueNode,u,l,y,w,j,o.dir,n]);Lt(()=>E(),[E]);const[A,N]=S.useState();Lt(()=>{l&&N(window.getComputedStyle(l).zIndex)},[l]);const C=S.useCallback(T=>{T&&b.current===!0&&(E(),O?.(),b.current=!1)},[E,O]);return d.jsx(Eae,{scope:r,contentWrapper:u,shouldExpandOnScrollRef:g,onScrollButtonChange:C,children:d.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:A},children:d.jsx(Ue.div,{...i,ref:p,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});c3.displayName=jae;var Oae="SelectPopperPosition",Pw=S.forwardRef((e,t)=>{const{__scopeSelect:r,align:n="start",collisionPadding:i=Cn,...o}=e,s=Sm(r);return d.jsx(v_,{...s,...o,ref:t,align:n,collisionPadding:i,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Pw.displayName=Oae;var[Eae,b_]=hl(ua,{}),Nw="SelectViewport",u3=S.forwardRef((e,t)=>{const{__scopeSelect:r,nonce:n,...i}=e,o=wo(Nw,r),s=b_(Nw,r),u=Ze(t,o.onViewportChange),f=S.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),d.jsx(bm.Slot,{scope:r,children:d.jsx(Ue.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:Ie(i.onScroll,l=>{const h=l.currentTarget,{contentWrapper:p,shouldExpandOnScrollRef:m}=s;if(m?.current&&p){const g=Math.abs(f.current-h.scrollTop);if(g>0){const b=window.innerHeight-Cn*2,y=parseFloat(p.style.minHeight),w=parseFloat(p.style.height),j=Math.max(y,w);if(j0?A:0,p.style.justifyContent="flex-end")}}}f.current=h.scrollTop})})})]})});u3.displayName=Nw;var f3="SelectGroup",[Pae,Nae]=hl(f3),Aae=S.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,i=Jn();return d.jsx(Pae,{scope:r,id:i,children:d.jsx(Ue.div,{role:"group","aria-labelledby":i,...n,ref:t})})});Aae.displayName=f3;var d3="SelectLabel",Cae=S.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,i=Nae(d3,r);return d.jsx(Ue.div,{id:i.id,...n,ref:t})});Cae.displayName=d3;var bp="SelectItem",[Tae,h3]=hl(bp),p3=S.forwardRef((e,t)=>{const{__scopeSelect:r,value:n,disabled:i=!1,textValue:o,...s}=e,u=bo(bp,r),f=wo(bp,r),l=u.value===n,[h,p]=S.useState(o??""),[m,g]=S.useState(!1),b=Ze(t,O=>f.itemRefCallback?.(O,n,i)),y=Jn(),w=S.useRef("touch"),j=()=>{i||(u.onValueChange(n),u.onOpenChange(!1))};if(n==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(Tae,{scope:r,value:n,disabled:i,textId:y,isSelected:l,onItemTextChange:S.useCallback(O=>{p(E=>E||(O?.textContent??"").trim())},[]),children:d.jsx(bm.ItemSlot,{scope:r,value:n,disabled:i,textValue:h,children:d.jsx(Ue.div,{role:"option","aria-labelledby":y,"data-highlighted":m?"":void 0,"aria-selected":l&&m,"data-state":l?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...s,ref:b,onFocus:Ie(s.onFocus,()=>g(!0)),onBlur:Ie(s.onBlur,()=>g(!1)),onClick:Ie(s.onClick,()=>{w.current!=="mouse"&&j()}),onPointerUp:Ie(s.onPointerUp,()=>{w.current==="mouse"&&j()}),onPointerDown:Ie(s.onPointerDown,O=>{w.current=O.pointerType}),onPointerMove:Ie(s.onPointerMove,O=>{w.current=O.pointerType,i?f.onItemLeave?.():w.current==="mouse"&&O.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Ie(s.onPointerLeave,O=>{O.currentTarget===document.activeElement&&f.onItemLeave?.()}),onKeyDown:Ie(s.onKeyDown,O=>{f.searchRef?.current!==""&&O.key===" "||(mae.includes(O.key)&&j(),O.key===" "&&O.preventDefault())})})})})});p3.displayName=bp;var yc="SelectItemText",m3=S.forwardRef((e,t)=>{const{__scopeSelect:r,className:n,style:i,...o}=e,s=bo(yc,r),u=wo(yc,r),f=h3(yc,r),l=xae(yc,r),[h,p]=S.useState(null),m=Ze(t,j=>p(j),f.onItemTextChange,j=>u.itemTextRefCallback?.(j,f.value,f.disabled)),g=h?.textContent,b=S.useMemo(()=>d.jsx("option",{value:f.value,disabled:f.disabled,children:g},f.value),[f.disabled,f.value,g]),{onNativeOptionAdd:y,onNativeOptionRemove:w}=l;return Lt(()=>(y(b),()=>w(b)),[y,w,b]),d.jsxs(d.Fragment,{children:[d.jsx(Ue.span,{id:f.textId,...o,ref:m}),f.isSelected&&s.valueNode&&!s.valueNodeHasChildren?pu.createPortal(o.children,s.valueNode):null]})});m3.displayName=yc;var v3="SelectItemIndicator",g3=S.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return h3(v3,r).isSelected?d.jsx(Ue.span,{"aria-hidden":!0,...n,ref:t}):null});g3.displayName=v3;var Aw="SelectScrollUpButton",y3=S.forwardRef((e,t)=>{const r=wo(Aw,e.__scopeSelect),n=b_(Aw,e.__scopeSelect),[i,o]=S.useState(!1),s=Ze(t,n.onScrollButtonChange);return Lt(()=>{if(r.viewport&&r.isPositioned){let u=function(){const l=f.scrollTop>0;o(l)};const f=r.viewport;return u(),f.addEventListener("scroll",u),()=>f.removeEventListener("scroll",u)}},[r.viewport,r.isPositioned]),i?d.jsx(b3,{...e,ref:s,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=r;u&&f&&(u.scrollTop=u.scrollTop-f.offsetHeight)}}):null});y3.displayName=Aw;var Cw="SelectScrollDownButton",x3=S.forwardRef((e,t)=>{const r=wo(Cw,e.__scopeSelect),n=b_(Cw,e.__scopeSelect),[i,o]=S.useState(!1),s=Ze(t,n.onScrollButtonChange);return Lt(()=>{if(r.viewport&&r.isPositioned){let u=function(){const l=f.scrollHeight-f.clientHeight,h=Math.ceil(f.scrollTop)f.removeEventListener("scroll",u)}},[r.viewport,r.isPositioned]),i?d.jsx(b3,{...e,ref:s,onAutoScroll:()=>{const{viewport:u,selectedItem:f}=r;u&&f&&(u.scrollTop=u.scrollTop+f.offsetHeight)}}):null});x3.displayName=Cw;var b3=S.forwardRef((e,t)=>{const{__scopeSelect:r,onAutoScroll:n,...i}=e,o=wo("SelectScrollButton",r),s=S.useRef(null),u=wm(r),f=S.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return S.useEffect(()=>()=>f(),[f]),Lt(()=>{u().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[u]),d.jsx(Ue.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Ie(i.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(n,50))}),onPointerMove:Ie(i.onPointerMove,()=>{o.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(n,50))}),onPointerLeave:Ie(i.onPointerLeave,()=>{f()})})}),kae="SelectSeparator",Rae=S.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e;return d.jsx(Ue.div,{"aria-hidden":!0,...n,ref:t})});Rae.displayName=kae;var Tw="SelectArrow",Mae=S.forwardRef((e,t)=>{const{__scopeSelect:r,...n}=e,i=Sm(r),o=bo(Tw,r),s=wo(Tw,r);return o.open&&s.position==="popper"?d.jsx(g_,{...i,...n,ref:t}):null});Mae.displayName=Tw;var Iae="SelectBubbleInput",w3=S.forwardRef(({__scopeSelect:e,value:t,...r},n)=>{const i=S.useRef(null),o=Ze(n,i),s=y_(t);return S.useEffect(()=>{const u=i.current;if(!u)return;const f=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(f,"value").set;if(s!==t&&h){const p=new Event("change",{bubbles:!0});h.call(u,t),u.dispatchEvent(p)}},[s,t]),d.jsx(Ue.select,{...r,style:{...U$,...r.style},ref:o,defaultValue:t})});w3.displayName=Iae;function S3(e){return e===""||e===void 0}function _3(e){const t=fr(e),r=S.useRef(""),n=S.useRef(0),i=S.useCallback(s=>{const u=r.current+s;t(u),(function f(l){r.current=l,window.clearTimeout(n.current),l!==""&&(n.current=window.setTimeout(()=>f(""),1e3))})(u)},[t]),o=S.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return S.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,i,o]}function j3(e,t,r){const i=t.length>1&&Array.from(t).every(l=>l===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let s=Dae(e,Math.max(o,0));i.length===1&&(s=s.filter(l=>l!==r));const f=s.find(l=>l.textValue.toLowerCase().startsWith(i.toLowerCase()));return f!==r?f:void 0}function Dae(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var Lae=J$,$ae=t3,Bae=n3,Fae=i3,zae=o3,qae=a3,Uae=u3,Wae=p3,Hae=m3,Vae=g3,Gae=y3,Kae=x3;function Je({...e}){return d.jsx(Lae,{"data-slot":"select",...e})}function et({...e}){return d.jsx(Bae,{"data-slot":"select-value",...e})}function tt({className:e,size:t="default",children:r,...n}){return d.jsxs($ae,{"data-slot":"select-trigger","data-size":t,className:Re("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-full items-center justify-between gap-2 rounded-md border bg-input-background px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...n,children:[r,d.jsx(Fae,{asChild:!0,children:d.jsx(xs,{className:"size-4 opacity-50"})})]})}function rt({className:e,children:t,position:r="popper",...n}){return d.jsx(zae,{children:d.jsxs(qae,{"data-slot":"select-content",className:Re("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:r,...n,children:[d.jsx(Xae,{}),d.jsx(Uae,{className:Re("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),d.jsx(Yae,{})]})})}function Ee({className:e,children:t,...r}){return d.jsxs(Wae,{"data-slot":"select-item",className:Re("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...r,children:[d.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:d.jsx(Vae,{children:d.jsx(cM,{className:"size-4"})})}),d.jsx(Hae,{children:t})]})}function Xae({className:e,...t}){return d.jsx(Gae,{"data-slot":"select-scroll-up-button",className:Re("flex cursor-default items-center justify-center py-1",e),...t,children:d.jsx(V8,{className:"size-4"})})}function Yae({className:e,...t}){return d.jsx(Kae,{"data-slot":"select-scroll-down-button",className:Re("flex cursor-default items-center justify-center py-1",e),...t,children:d.jsx(xs,{className:"size-4"})})}function Qae(){const e=[{id:1,location:"Location A",labelCategory:"Prep",productCategory:"Meat",product:"Chicken",template:'2"x2" Basic',labelType:"Defrost",lastEdited:"2025.12.03.11:45",hasError:!1},{id:2,location:"Location A",labelCategory:"Prep",productCategory:"Meat",product:"Chicken",template:'2"x2" Basic',labelType:"Opened/Preped",lastEdited:"2025.12.03.11:45",hasError:!1},{id:3,location:"Location A",labelCategory:"Prep",productCategory:"Meat",product:"Chicken",template:'2"x2" Basic',labelType:"Heated",lastEdited:"2025.12.03.11:45",hasError:!1},{id:4,location:"Location A",labelCategory:"Grab'n'Go",productCategory:"Sandwich",product:"Chicken Sandwich",template:`2"x6" G'n'G`,labelType:"",lastEdited:"2025.12.03.11:45",hasError:!0}];return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex flex-nowrap items-center gap-3",children:[d.jsx(Se,{placeholder:"Search",style:{height:40,boxSizing:"border-box"},className:"bg-white border border-gray-300 rounded-md w-40 shrink-0 text-gray-900 placeholder:text-gray-500"}),d.jsxs(Je,{defaultValue:"all",children:[d.jsx(tt,{className:"bg-white border border-gray-300 rounded-md w-[200px] shrink-0 text-gray-900",style:{height:40,boxSizing:"border-box"},children:d.jsx(et,{placeholder:"Location"})}),d.jsxs(rt,{children:[d.jsx(Ee,{value:"all",children:"All Locations"}),d.jsx(Ee,{value:"loc-a",children:"Location A"}),d.jsx(Ee,{value:"loc-b",children:"Location B"})]})]}),d.jsxs("div",{className:"flex rounded-md border border-gray-300 bg-white h-10 overflow-hidden shrink-0",children:[d.jsx("button",{type:"button",className:"px-4 h-full border-r border-gray-200 text-sm font-medium text-gray-900 hover:bg-gray-50 transition-colors",children:"Bulk Import"}),d.jsx("button",{type:"button",className:"px-4 h-full border-r border-gray-200 text-sm font-medium text-gray-900 hover:bg-gray-50 transition-colors",children:"Bulk Export"}),d.jsx("button",{type:"button",className:"px-4 h-full text-sm font-medium text-gray-900 hover:bg-gray-50 transition-colors",children:"Bulk Edit"})]}),d.jsxs(we,{className:"bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-md h-10 px-6 shrink-0 ml-auto",children:["New Label ",d.jsx(Rr,{className:"ml-1 h-4 w-4"})]})]}),d.jsx("div",{className:"text-red-600 font-bold italic text-lg",children:"One or more of your labels are missing fields from their templates (! ! ! 1 in total)."}),d.jsx("div",{className:"rounded-md border bg-white shadow-sm",children:d.jsxs(br,{children:[d.jsx(wr,{children:d.jsxs(Ge,{className:"bg-gray-50 hover:bg-gray-50",children:[d.jsx(ye,{className:"font-bold text-gray-900 w-[120px]",children:"Location"}),d.jsx(ye,{className:"font-bold text-gray-900 w-[140px]",children:"Label Category"}),d.jsx(ye,{className:"font-bold text-gray-900 w-[140px]",children:"Product Category"}),d.jsx(ye,{className:"font-bold text-gray-900",children:"Product"}),d.jsx(ye,{className:"font-bold text-gray-900",children:"Template"}),d.jsx(ye,{className:"font-bold text-gray-900",children:"Label Type"}),d.jsx(ye,{className:"font-bold text-gray-900",children:"Last Edited"})]})}),d.jsx(Sr,{children:e.map(t=>d.jsxs(Ge,{className:"hover:bg-gray-50",children:[d.jsx(ue,{className:"font-medium",children:t.location}),d.jsx(ue,{children:t.labelCategory}),d.jsx(ue,{children:t.productCategory}),d.jsx(ue,{children:t.product}),d.jsxs(ue,{className:"font-medium",children:[t.template,t.hasError&&d.jsx("span",{className:"text-red-600 font-bold ml-2",children:"! ! !"})]}),d.jsx(ue,{children:t.labelType||"-"}),d.jsx(ue,{className:"text-gray-500 tabular-nums font-numeric",children:t.lastEdited})]},t.id))})]})})]})}function Zae(){const e=[{id:1,category:"Prep",count:54,photo:"XXX",lastEdited:"2025.12.03.11:45"},{id:2,category:"Green",count:33,photo:"XXX",lastEdited:"2025.12.03.11:45"},{id:3,category:"Red",count:44,photo:"XXX",lastEdited:"2025.12.03.11:45"}];return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex flex-nowrap items-center gap-3",children:[d.jsx(Se,{placeholder:"Search",style:{height:40,boxSizing:"border-box"},className:"bg-white border border-gray-300 rounded-md w-40 shrink-0 placeholder:text-gray-500"}),d.jsx("span",{className:"text-sm font-medium text-gray-900 whitespace-nowrap shrink-0",children:"Search"}),d.jsxs(Je,{defaultValue:"all",children:[d.jsx(tt,{className:"bg-white border border-gray-300 rounded-md w-[150px] shrink-0",style:{height:40,boxSizing:"border-box"},children:d.jsx(et,{placeholder:"Location"})}),d.jsxs(rt,{children:[d.jsx(Ee,{value:"all",children:"All Locations"}),d.jsx(Ee,{value:"loc-a",children:"Location A"}),d.jsx(Ee,{value:"loc-b",children:"Location B"})]})]}),d.jsx("span",{className:"text-sm font-medium text-gray-900 whitespace-nowrap shrink-0",children:"Location"}),d.jsxs(we,{className:"bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-md h-10 px-6 shrink-0 ml-auto",children:["New Label Category ",d.jsx(Rr,{className:"ml-1 h-4 w-4"})]})]}),d.jsx("div",{className:"rounded-md border bg-white shadow-sm",children:d.jsxs(br,{children:[d.jsx(wr,{children:d.jsxs(Ge,{className:"bg-gray-50 hover:bg-gray-50",children:[d.jsx(ye,{className:"font-bold text-gray-900 w-[250px]",children:"Label Category"}),d.jsx(ye,{className:"font-bold text-gray-900 w-[200px]",children:"No. of Labels"}),d.jsx(ye,{className:"font-bold text-gray-900 w-[200px]",children:"Category Photo"}),d.jsx(ye,{className:"font-bold text-gray-900",children:"Last Edited"})]})}),d.jsx(Sr,{children:e.map(t=>d.jsxs(Ge,{className:"hover:bg-gray-50",children:[d.jsx(ue,{className:"font-medium",children:t.category}),d.jsx(ue,{className:"font-numeric",children:t.count}),d.jsx(ue,{className:"text-gray-500",children:t.photo}),d.jsx(ue,{className:"text-gray-500 tabular-nums font-numeric",children:t.lastEdited})]},t.id))})]})})]})}function Jae(){const e=[{id:1,type:"Defrost",count:54,lastEdited:"2025.12.03.11:45"},{id:2,type:"Thawed",count:33,lastEdited:"2025.12.03.11:45"},{id:3,type:"Opened",count:44,lastEdited:"2025.12.03.11:45"},{id:4,type:"Preped",count:17,lastEdited:"2025.12.03.11:45"},{id:5,type:"Heated",count:67,lastEdited:"2025.12.03.11:45"}];return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex flex-nowrap items-center gap-3",children:[d.jsx(Se,{placeholder:"Search",style:{height:40,boxSizing:"border-box"},className:"bg-white border border-gray-300 rounded-md w-40 shrink-0 placeholder:text-gray-500"}),d.jsx("span",{className:"text-sm font-medium text-gray-900 whitespace-nowrap shrink-0",children:"Search"}),d.jsxs(Je,{defaultValue:"all",children:[d.jsx(tt,{className:"bg-white border border-gray-300 rounded-md w-[150px] shrink-0",style:{height:40,boxSizing:"border-box"},children:d.jsx(et,{placeholder:"Location"})}),d.jsxs(rt,{children:[d.jsx(Ee,{value:"all",children:"all"}),d.jsx(Ee,{value:"loc-a",children:"Location A"}),d.jsx(Ee,{value:"loc-b",children:"Location B"})]})]}),d.jsx("span",{className:"text-sm font-medium text-gray-900 whitespace-nowrap shrink-0",children:"Location"}),d.jsxs(we,{className:"bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-md h-10 px-6 shrink-0 ml-auto",children:["New Label Type ",d.jsx(Rr,{className:"ml-1 h-4 w-4"})]})]}),d.jsx("div",{className:"rounded-md border bg-white shadow-sm",children:d.jsxs(br,{children:[d.jsx(wr,{children:d.jsxs(Ge,{className:"bg-gray-50 hover:bg-gray-50",children:[d.jsx(ye,{className:"font-bold text-gray-900 w-[250px]",children:"Label Types"}),d.jsx(ye,{className:"font-bold text-gray-900 w-[200px]",children:"No. of Labels"}),d.jsx(ye,{className:"font-bold text-gray-900",children:"Last Edited"})]})}),d.jsx(Sr,{children:e.map(t=>d.jsxs(Ge,{className:"hover:bg-gray-50",children:[d.jsx(ue,{className:"font-medium",children:t.type}),d.jsx(ue,{className:"font-numeric",children:t.count}),d.jsx(ue,{className:"text-gray-500 tabular-nums font-numeric",children:t.lastEdited})]},t.id))})]})})]})}const ese="label-template-",tse="label-template-ids";function O3(e){return`${ese}${e}`}function E3(){return tse}function rse(){return`template-${Date.now()}`}function nse(){return`el-${Date.now()}-${Math.random().toString(36).slice(2,9)}`}function ise(e){return{id:e??rse(),name:"未命名模板",labelType:"PRICE",unit:"cm",width:6,height:4,appliedLocation:"ALL",showRuler:!0,showGrid:!0,elements:[]}}const Vb=[{name:'2"×1"',width:2,height:1,unit:"inch"},{name:'2"×2"',width:2,height:2,unit:"inch"},{name:'3"×1"',width:3,height:1,unit:"inch"},{name:'3"×2"',width:3,height:2,unit:"inch"},{name:'4"×2"',width:4,height:2,unit:"inch"},{name:'4"×6"',width:4,height:6,unit:"inch"},{name:"6cm×4cm",width:6,height:4,unit:"cm"},{name:"10cm×6cm",width:10,height:6,unit:"cm"},{name:"A4",width:21,height:29.7,unit:"cm"},{name:"A5",width:14.8,height:21,unit:"cm"}];function ose(e,t=20,r=20){const n=nse(),o={TEXT_STATIC:{width:120,height:24,config:{text:"文本",fontFamily:"Arial",fontSize:14,fontWeight:"normal",textAlign:"left"}},TEXT_PRODUCT:{width:120,height:24,config:{text:"商品名",fontFamily:"Arial",fontSize:14,fontWeight:"normal",textAlign:"left"}},TEXT_PRICE:{width:80,height:24,config:{text:"0.00",prefix:"¥",decimal:2,fontFamily:"Arial",fontSize:14,fontWeight:"bold",textAlign:"right"}},BARCODE:{width:160,height:48,config:{barcodeType:"CODE128",data:"123456789",showText:!0,orientation:"horizontal"}},QRCODE:{width:80,height:80,config:{data:"https://example.com",errorLevel:"M"}},IMAGE:{width:60,height:60,config:{src:"",scaleMode:"contain"}},DATE:{width:120,height:24,config:{format:"YYYY-MM-DD",offsetDays:0}},TIME:{width:100,height:24,config:{format:"HH:mm",offsetDays:0}},DURATION:{width:120,height:24,config:{format:"YYYY-MM-DD",offsetDays:3}},WEIGHT:{width:80,height:24,config:{unit:"g",value:500}},WEIGHT_PRICE:{width:100,height:24,config:{unitPrice:10,weight:.5,currency:"¥"}},BLANK:{width:40,height:24,config:{}},NUTRITION:{width:200,height:120,config:{calories:120,fat:"5g",protein:"3g",carbs:"10g",layout:"standard"}}}[e];return{id:n,type:e,x:t,y:r,width:o.width,height:o.height,rotation:"horizontal",border:"none",config:{...o.config}}}function P3(){try{const e=localStorage.getItem(E3());if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}function N3(e){try{const t=localStorage.getItem(O3(e));return t?JSON.parse(t):null}catch{return null}}function Jk(){const e=P3(),t=[];for(const r of e){const n=N3(r);n&&t.push(n)}return t.sort((r,n)=>n.id>r.id?1:-1)}function ase(e){localStorage.setItem(E3(),JSON.stringify(e))}function sse(e){const t=O3(e.id);localStorage.setItem(t,JSON.stringify(e));const r=P3();r.includes(e.id)||(r.push(e.id),ase(r))}function lse(e){const t=cse(e),r=S.forwardRef((n,i)=>{const{children:o,...s}=n,u=S.Children.toArray(o),f=u.find(fse);if(f){const l=f.props.children,h=u.map(p=>p===f?S.Children.count(l)>1?S.Children.only(null):S.isValidElement(l)?l.props.children:null:p);return d.jsx(t,{...s,ref:i,children:S.isValidElement(l)?S.cloneElement(l,void 0,h):null})}return d.jsx(t,{...s,ref:i,children:o})});return r.displayName=`${e}.Slot`,r}function cse(e){const t=S.forwardRef((r,n)=>{const{children:i,...o}=r;if(S.isValidElement(i)){const s=hse(i),u=dse(o,i.props);return i.type!==S.Fragment&&(u.ref=n?ha(n,s):s),S.cloneElement(i,u)}return S.Children.count(i)>1?S.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var use=Symbol("radix.slottable");function fse(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===use}function dse(e,t){const r={...t};for(const n in t){const i=e[n],o=t[n];/^on[A-Z]/.test(n)?i&&o?r[n]=(...u)=>{const f=o(...u);return i(...u),f}:i&&(r[n]=i):n==="style"?r[n]={...i,...o}:n==="className"&&(r[n]=[i,o].filter(Boolean).join(" "))}return{...e,...r}}function hse(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var _m="Dialog",[A3]=Bn(_m),[pse,zn]=A3(_m),C3=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:i,onOpenChange:o,modal:s=!0}=e,u=S.useRef(null),f=S.useRef(null),[l,h]=Mi({prop:n,defaultProp:i??!1,onChange:o,caller:_m});return d.jsx(pse,{scope:t,triggerRef:u,contentRef:f,contentId:Jn(),titleId:Jn(),descriptionId:Jn(),open:l,onOpenChange:h,onOpenToggle:S.useCallback(()=>h(p=>!p),[h]),modal:s,children:r})};C3.displayName=_m;var T3="DialogTrigger",mse=S.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=zn(T3,r),o=Ze(t,i.triggerRef);return d.jsx(Ue.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":__(i.open),...n,ref:o,onClick:Ie(e.onClick,i.onOpenToggle)})});mse.displayName=T3;var w_="DialogPortal",[vse,k3]=A3(w_,{forceMount:void 0}),R3=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:i}=e,o=zn(w_,t);return d.jsx(vse,{scope:t,forceMount:r,children:S.Children.map(n,s=>d.jsx(Mr,{present:r||o.open,children:d.jsx(Eu,{asChild:!0,container:i,children:s})}))})};R3.displayName=w_;var wp="DialogOverlay",M3=S.forwardRef((e,t)=>{const r=k3(wp,e.__scopeDialog),{forceMount:n=r.forceMount,...i}=e,o=zn(wp,e.__scopeDialog);return o.modal?d.jsx(Mr,{present:n||o.open,children:d.jsx(yse,{...i,ref:t})}):null});M3.displayName=wp;var gse=lse("DialogOverlay.RemoveScroll"),yse=S.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=zn(wp,r);return d.jsx(xm,{as:gse,allowPinchZoom:!0,shards:[i.contentRef],children:d.jsx(Ue.div,{"data-state":__(i.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),fa="DialogContent",I3=S.forwardRef((e,t)=>{const r=k3(fa,e.__scopeDialog),{forceMount:n=r.forceMount,...i}=e,o=zn(fa,e.__scopeDialog);return d.jsx(Mr,{present:n||o.open,children:o.modal?d.jsx(xse,{...i,ref:t}):d.jsx(bse,{...i,ref:t})})});I3.displayName=fa;var xse=S.forwardRef((e,t)=>{const r=zn(fa,e.__scopeDialog),n=S.useRef(null),i=Ze(t,r.contentRef,n);return S.useEffect(()=>{const o=n.current;if(o)return x_(o)},[]),d.jsx(D3,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ie(e.onCloseAutoFocus,o=>{o.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:Ie(e.onPointerDownOutside,o=>{const s=o.detail.originalEvent,u=s.button===0&&s.ctrlKey===!0;(s.button===2||u)&&o.preventDefault()}),onFocusOutside:Ie(e.onFocusOutside,o=>o.preventDefault())})}),bse=S.forwardRef((e,t)=>{const r=zn(fa,e.__scopeDialog),n=S.useRef(!1),i=S.useRef(!1);return d.jsx(D3,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(n.current||r.triggerRef.current?.focus(),o.preventDefault()),n.current=!1,i.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(n.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const s=o.target;r.triggerRef.current?.contains(s)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),D3=S.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:o,...s}=e,u=zn(fa,r),f=S.useRef(null),l=Ze(t,f);return o_(),d.jsxs(d.Fragment,{children:[d.jsx(dm,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:o,children:d.jsx(ju,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":__(u.open),...s,ref:l,onDismiss:()=>u.onOpenChange(!1)})}),d.jsxs(d.Fragment,{children:[d.jsx(wse,{titleId:u.titleId}),d.jsx(_se,{contentRef:f,descriptionId:u.descriptionId})]})]})}),S_="DialogTitle",L3=S.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=zn(S_,r);return d.jsx(Ue.h2,{id:i.titleId,...n,ref:t})});L3.displayName=S_;var $3="DialogDescription",B3=S.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=zn($3,r);return d.jsx(Ue.p,{id:i.descriptionId,...n,ref:t})});B3.displayName=$3;var F3="DialogClose",z3=S.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,i=zn(F3,r);return d.jsx(Ue.button,{type:"button",...n,ref:t,onClick:Ie(e.onClick,()=>i.onOpenChange(!1))})});z3.displayName=F3;function __(e){return e?"open":"closed"}var q3="DialogTitleWarning",[Afe,U3]=Y6(q3,{contentName:fa,titleName:S_,docsSlug:"dialog"}),wse=({titleId:e})=>{const t=U3(q3),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. + +If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. + +For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return S.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},Sse="DialogDescriptionWarning",_se=({contentRef:e,descriptionId:t})=>{const n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${U3(Sse).contentName}}.`;return S.useEffect(()=>{const i=e.current?.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},jse=C3,Ose=R3,Ese=M3,Pse=I3,Nse=L3,Ase=B3,Cse=z3;function _r({...e}){return d.jsx(jse,{"data-slot":"dialog",...e})}function Tse({...e}){return d.jsx(Ose,{"data-slot":"dialog-portal",...e})}const W3=S.forwardRef(({className:e,...t},r)=>d.jsx(Ese,{ref:r,"data-slot":"dialog-overlay",className:Re("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",e),...t}));W3.displayName="DialogOverlay";const dr=S.forwardRef(({className:e,children:t,...r},n)=>d.jsxs(Tse,{"data-slot":"dialog-portal",children:[d.jsx(W3,{}),d.jsxs(Pse,{ref:n,"data-slot":"dialog-content",className:Re("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",e),...r,children:[t,d.jsxs(Cse,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[d.jsx(xc,{}),d.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));dr.displayName="DialogContent";function jr({className:e,...t}){return d.jsx("div",{"data-slot":"dialog-header",className:Re("flex flex-col gap-2 text-center sm:text-left",e),...t})}function Dr({className:e,...t}){return d.jsx("div",{"data-slot":"dialog-footer",className:Re("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}function Or({className:e,...t}){return d.jsx(Nse,{"data-slot":"dialog-title",className:Re("text-lg leading-none font-semibold",e),...t})}function xn({className:e,...t}){return d.jsx(Ase,{"data-slot":"dialog-description",className:Re("text-muted-foreground text-sm",e),...t})}const kse=[{title:"模版信息",items:[{label:"Text",type:"TEXT_STATIC"},{label:"QR Code",type:"QRCODE"},{label:"Barcode",type:"BARCODE"},{label:"Blank Space",type:"BLANK"},{label:"Price",type:"TEXT_PRICE"},{label:"Image",type:"IMAGE"},{label:"Logo",type:"IMAGE"}]},{title:"标签信息",items:[{label:"Label Name",type:"TEXT_PRODUCT"},{label:"Text",type:"TEXT_STATIC"},{label:"QR Code",type:"QRCODE"},{label:"Barcode",type:"BARCODE"},{label:"Nutrition Facts",type:"NUTRITION"},{label:"Price",type:"TEXT_PRICE"},{label:"Duration Date",type:"DATE"},{label:"Duration Time",type:"TIME"},{label:"Duration",type:"DURATION"},{label:"Image",type:"IMAGE"},{label:"Label Type",type:"TEXT_STATIC"},{label:"How-to",type:"TEXT_STATIC"},{label:"Expiration Alert",type:"TEXT_STATIC"}]},{title:"自动生成",items:[{label:"Company",type:"TEXT_STATIC"},{label:"Employee",type:"TEXT_STATIC"},{label:"Current Date",type:"DATE"},{label:"Current Time",type:"TIME"},{label:"Label ID",type:"TEXT_STATIC"}]},{title:"打印时输入",subtitle:"点击添加到画布",items:[{label:"Text",type:"TEXT_STATIC",config:{inputType:"text"}},{label:"Weight",type:"WEIGHT"},{label:"Number",type:"TEXT_STATIC",config:{inputType:"number",text:"0"}},{label:"Date & Time",type:"DATE",config:{inputType:"datetime"}},{label:"Multiple Options",type:"TEXT_STATIC",config:{inputType:"options"}}]}];function Rse({onAddElement:e}){return d.jsxs("div",{className:"w-44 shrink-0 border-r border-gray-200 bg-white flex flex-col h-full",children:[d.jsx("div",{className:"px-2 py-2 border-b border-gray-200 font-semibold text-gray-800 text-sm",children:"Elements"}),d.jsx(_s,{className:"flex-1",children:d.jsx("div",{className:"p-1.5 space-y-3",children:kse.map(t=>d.jsxs("div",{children:[d.jsx("div",{className:"px-2 py-1 text-xs font-medium text-gray-500 uppercase tracking-wide",children:t.title}),t.subtitle&&d.jsx("div",{className:"px-2 py-0.5 text-[10px] text-gray-400",children:t.subtitle}),d.jsx("div",{className:"grid grid-cols-2 gap-1 mt-0.5",children:t.items.map((r,n)=>d.jsx("button",{type:"button",onClick:()=>e(r.type,r.config),className:"text-left px-2 py-1 text-xs rounded hover:bg-gray-100 border border-transparent hover:border-gray-200 truncate",children:r.label},`${t.title}-${r.label}-${n}`))})]},t.title))})})]})}var yd={},cc={},xd={},eR;function en(){if(eR)return xd;eR=1,Object.defineProperty(xd,"__esModule",{value:!0});function e(r,n){if(!(r instanceof n))throw new TypeError("Cannot call a class as a function")}var t=function r(n,i){e(this,r),this.data=n,this.text=i.text||n,this.options=i};return xd.default=t,xd}var tR;function Mse(){if(tR)return cc;tR=1,Object.defineProperty(cc,"__esModule",{value:!0}),cc.CODE39=void 0;var e=(function(){function y(w,j){for(var O=0;O=200){w=m.shift()-105;var j=n.SWAP[w];j!==void 0?y=h.next(m,g+1,j):((b===n.SET_A||b===n.SET_B)&&w===n.SHIFT&&(m[0]=b===n.SET_A?m[0]>95?m[0]-96:m[0]:m[0]<32?m[0]+96:m[0]),y=h.next(m,g+1,b))}else w=h.correctIndex(m,b),y=h.next(m,g+1,b);var O=h.getBar(w),E=w*g;return{result:O+y.result,checksum:E+y.checksum}}}]),h})(r.default);return wd.default=f,wd}var Sd={},iR;function Ise(){if(iR)return Sd;iR=1,Object.defineProperty(Sd,"__esModule",{value:!0});var e=Pu(),t=function(u){return u.match(new RegExp("^"+e.A_CHARS+"*"))[0].length},r=function(u){return u.match(new RegExp("^"+e.B_CHARS+"*"))[0].length},n=function(u){return u.match(new RegExp("^"+e.C_CHARS+"*"))[0]};function i(s,u){var f=u?e.A_CHARS:e.B_CHARS,l=s.match(new RegExp("^("+f+"+?)(([0-9]{2}){2,})([^0-9]|$)"));if(l)return l[1]+"Ì"+o(s.substring(l[1].length));var h=s.match(new RegExp("^"+f+"+"))[0];return h.length===s.length?s:h+String.fromCharCode(u?205:206)+i(s.substring(h.length),!u)}function o(s){var u=n(s),f=u.length;if(f===s.length)return s;s=s.substring(f);var l=t(s)>=r(s);return u+String.fromCharCode(l?206:205)+i(s,l)}return Sd.default=function(s){var u=void 0,f=n(s).length;if(f>=2)u=e.C_START_CHAR+o(s);else{var l=t(s)>r(s);u=(l?e.A_START_CHAR:e.B_START_CHAR)+i(s,l)}return u.replace(/[\xCD\xCE]([^])[\xCD\xCE]/,function(h,p){return"Ë"+p})},Sd}var oR;function Dse(){if(oR)return bd;oR=1,Object.defineProperty(bd,"__esModule",{value:!0});var e=jm(),t=i(e),r=Ise(),n=i(r);function i(l){return l&&l.__esModule?l:{default:l}}function o(l,h){if(!(l instanceof h))throw new TypeError("Cannot call a class as a function")}function s(l,h){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h&&(typeof h=="object"||typeof h=="function")?h:l}function u(l,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);l.prototype=Object.create(h&&h.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(l,h):l.__proto__=h)}var f=(function(l){u(h,l);function h(p,m){if(o(this,h),/^[\x00-\x7F\xC8-\xD3]+$/.test(p))var g=s(this,(h.__proto__||Object.getPrototypeOf(h)).call(this,(0,n.default)(p),m));else var g=s(this,(h.__proto__||Object.getPrototypeOf(h)).call(this,p,m));return s(g)}return h})(t.default);return bd.default=f,bd}var _d={},aR;function Lse(){if(aR)return _d;aR=1,Object.defineProperty(_d,"__esModule",{value:!0});var e=(function(){function l(h,p){for(var m=0;mb.width*10?b.width*10:b.fontSize,y.guardHeight=b.height+y.fontSize/2+b.textMargin,y}return e(m,[{key:"encode",value:function(){return this.options.flat?this.encodeFlat():this.encodeGuarded()}},{key:"leftText",value:function(b,y){return this.text.substr(b,y)}},{key:"leftEncode",value:function(b,y){return(0,n.default)(b,y)}},{key:"rightText",value:function(b,y){return this.text.substr(b,y)}},{key:"rightEncode",value:function(b,y){return(0,n.default)(b,y)}},{key:"encodeGuarded",value:function(){var b={fontSize:this.fontSize},y={height:this.guardHeight};return[{data:t.SIDE_BIN,options:y},{data:this.leftEncode(),text:this.leftText(),options:b},{data:t.MIDDLE_BIN,options:y},{data:this.rightEncode(),text:this.rightText(),options:b},{data:t.SIDE_BIN,options:y}]}},{key:"encodeFlat",value:function(){var b=[t.SIDE_BIN,this.leftEncode(),t.MIDDLE_BIN,this.rightEncode(),t.SIDE_BIN];return{data:b.join(""),text:this.text}}}]),m})(o.default);return Pd.default=h,Pd}var hR;function zse(){if(hR)return Ed;hR=1,Object.defineProperty(Ed,"__esModule",{value:!0});var e=(function(){function p(m,g){for(var b=0;bb.width*10?y.fontSize=b.width*10:y.fontSize=b.fontSize,y.guardHeight=b.height+y.fontSize/2+b.textMargin,y}return e(m,[{key:"valid",value:function(){return this.data.search(/^[0-9]{12}$/)!==-1&&this.data[11]==h(this.data)}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var b="";return b+="101",b+=(0,r.default)(this.data.substr(0,6),"LLLLLL"),b+="01010",b+=(0,r.default)(this.data.substr(6,6),"RRRRRR"),b+="101",{data:b,text:this.text}}},{key:"guardedEncoding",value:function(){var b=[];return this.displayValue&&b.push({data:"00000000",text:this.text.substr(0,1),options:{textAlign:"left",fontSize:this.fontSize}}),b.push({data:"101"+(0,r.default)(this.data[0],"L"),options:{height:this.guardHeight}}),b.push({data:(0,r.default)(this.data.substr(1,5),"LLLLL"),text:this.text.substr(1,5),options:{fontSize:this.fontSize}}),b.push({data:"01010",options:{height:this.guardHeight}}),b.push({data:(0,r.default)(this.data.substr(6,5),"RRRRR"),text:this.text.substr(6,5),options:{fontSize:this.fontSize}}),b.push({data:(0,r.default)(this.data[11],"R")+"101",options:{height:this.guardHeight}}),this.displayValue&&b.push({data:"00000000",text:this.text.substr(11,1),options:{textAlign:"right",fontSize:this.fontSize}}),b}}]),m})(i.default);function h(p){var m=0,g;for(g=1;g<11;g+=2)m+=parseInt(p[g]);for(g=0;g<11;g+=2)m+=parseInt(p[g])*3;return(10-m%10)%10}return uc.default=l,uc}var kd={},yR;function Hse(){if(yR)return kd;yR=1,Object.defineProperty(kd,"__esModule",{value:!0});var e=(function(){function b(y,w){for(var j=0;jj.width*10?O.fontSize=j.width*10:O.fontSize=j.fontSize,O.guardHeight=j.height+O.fontSize/2+j.textMargin,O}return e(y,[{key:"valid",value:function(){return this.isValid}},{key:"encode",value:function(){return this.options.flat?this.flatEncoding():this.guardedEncoding()}},{key:"flatEncoding",value:function(){var j="";return j+="101",j+=this.encodeMiddleDigits(),j+="010101",{data:j,text:this.text}}},{key:"guardedEncoding",value:function(){var j=[];return this.displayValue&&j.push({data:"00000000",text:this.text[0],options:{textAlign:"left",fontSize:this.fontSize}}),j.push({data:"101",options:{height:this.guardHeight}}),j.push({data:this.encodeMiddleDigits(),text:this.text.substring(1,7),options:{fontSize:this.fontSize}}),j.push({data:"010101",options:{height:this.guardHeight}}),this.displayValue&&j.push({data:"00000000",text:this.text[7],options:{textAlign:"right",fontSize:this.fontSize}}),j}},{key:"encodeMiddleDigits",value:function(){var j=this.upcA[0],O=this.upcA[this.upcA.length-1],E=p[parseInt(O)][parseInt(j)];return(0,r.default)(this.middleDigits,E)}}]),y})(i.default);function g(b,y){for(var w=parseInt(b[b.length-1]),j=h[w],O="",E=0,A=0;A=3&&this.number<=131070}}]),l})(r.default);return dc.pharmacode=u,dc}var hc={},kR;function rle(){if(kR)return hc;kR=1,Object.defineProperty(hc,"__esModule",{value:!0}),hc.codabar=void 0;var e=(function(){function f(l,h){for(var p=0;p":["(%)","I"],"?":["(%)","J"],"@":["(%)","V"],"[":["(%)","K"],"\\":["(%)","L"],"]":["(%)","M"],"^":["(%)","N"],_:["(%)","O"],"`":["(%)","W"],a:["(+)","A"],b:["(+)","B"],c:["(+)","C"],d:["(+)","D"],e:["(+)","E"],f:["(+)","F"],g:["(+)","G"],h:["(+)","H"],i:["(+)","I"],j:["(+)","J"],k:["(+)","K"],l:["(+)","L"],m:["(+)","M"],n:["(+)","N"],o:["(+)","O"],p:["(+)","P"],q:["(+)","Q"],r:["(+)","R"],s:["(+)","S"],t:["(+)","T"],u:["(+)","U"],v:["(+)","V"],w:["(+)","W"],x:["(+)","X"],y:["(+)","Y"],z:["(+)","Z"],"{":["(%)","P"],"|":["(%)","Q"],"}":["(%)","R"],"~":["(%)","S"],"":["(%)","T"]}),rs}var MR;function K3(){if(MR)return Fd;MR=1,Object.defineProperty(Fd,"__esModule",{value:!0});var e=(function(){function l(h,p){for(var m=0;m0?h.fontSize+h.textMargin:0)+h.marginTop+h.marginBottom}function i(l,h,p){if(p.displayValue&&hh&&(h=l[p].height);return h}function f(l,h,p){var m;if(p)m=p;else if(typeof document<"u")m=document.createElement("canvas").getContext("2d");else return 0;m.font=h.fontOptions+" "+h.fontSize+"px "+h.font;var g=m.measureText(l);if(!g)return 0;var b=g.width;return b}return qr.getMaximumHeightOfEncodings=u,qr.getEncodingHeight=n,qr.getBarcodePadding=i,qr.calculateEncodingAttributes=o,qr.getTotalWidthOfEncodings=s,qr}var VR;function fle(){if(VR)return Yd;VR=1,Object.defineProperty(Yd,"__esModule",{value:!0});var e=(function(){function u(f,l){for(var h=0;h0?(g=0,p.textAlign="left"):l.textAlign=="right"?(g=h.width-1,p.textAlign="right"):(g=h.width/2,p.textAlign="center"),p.fillText(h.text,g,b)}}},{key:"moveCanvasDrawing",value:function(l){var h=this.canvas.getContext("2d");h.translate(l.width,0)}},{key:"restoreCanvas",value:function(){var l=this.canvas.getContext("2d");l.restore()}}]),u})();return Yd.default=s,Yd}var Qd={},GR;function dle(){if(GR)return Qd;GR=1,Object.defineProperty(Qd,"__esModule",{value:!0});var e=(function(){function f(l,h){for(var p=0;p0&&(this.drawRect(w-p.width*y,b,p.width*y,p.height,h),y=0);y>0&&this.drawRect(w-p.width*(y-1),b,p.width*y,p.height,h)}},{key:"drawSVGText",value:function(h,p,m){var g=this.document.createElementNS(s,"text");if(p.displayValue){var b,y;g.setAttribute("font-family",p.font),g.setAttribute("font-size",p.fontSize),p.fontOptions.includes("bold")&&g.setAttribute("font-weight","bold"),p.fontOptions.includes("italic")&&g.setAttribute("font-style","italic"),p.textPosition=="top"?y=p.fontSize-p.textMargin:y=p.height+p.textMargin+p.fontSize,p.textAlign=="left"||m.barcodePadding>0?(b=0,g.setAttribute("text-anchor","start")):p.textAlign=="right"?(b=m.width-1,g.setAttribute("text-anchor","end")):(b=m.width/2,g.setAttribute("text-anchor","middle")),g.setAttribute("x",b),g.setAttribute("y",y),g.appendChild(this.document.createTextNode(m.text)),h.appendChild(g)}}},{key:"setSvgAttributes",value:function(h,p){var m=this.svg;m.setAttribute("width",h+"px"),m.setAttribute("height",p+"px"),m.setAttribute("x","0px"),m.setAttribute("y","0px"),m.setAttribute("viewBox","0 0 "+h+" "+p),m.setAttribute("xmlns",s),m.setAttribute("version","1.1")}},{key:"createGroup",value:function(h,p,m){var g=this.document.createElementNS(s,"g");return g.setAttribute("transform","translate("+h+", "+p+")"),m.appendChild(g),g}},{key:"setGroupOptions",value:function(h,p){h.setAttribute("fill",p.lineColor)}},{key:"drawRect",value:function(h,p,m,g,b){var y=this.document.createElementNS(s,"rect");return y.setAttribute("x",h),y.setAttribute("y",p),y.setAttribute("width",m),y.setAttribute("height",g),b.appendChild(y),y}}]),f})();return Qd.default=u,Qd}var Zd={},KR;function hle(){if(KR)return Zd;KR=1,Object.defineProperty(Zd,"__esModule",{value:!0});var e=(function(){function n(i,o){for(var s=0;s"u"?"undefined":e(h))==="object"&&!h.nodeName)return{element:h,renderer:i.default.ObjectRenderer};throw new o.InvalidElementException}}function f(h){var p=document.querySelectorAll(h);if(p.length!==0){for(var m=[],g=0;g"u")throw Error("No element to render on was provided.");return U._renderProperties=(0,l.default)(F),U._encodings=[],U._options=w.default,U._errorHandler=new g.default(U),typeof L<"u"&&($=$||{},$.format||($.format=T()),U.options($)[$.format](L,$).render()),U};E.getModule=function(I){return t.default[I]};for(var A in t.default)t.default.hasOwnProperty(A)&&N(t.default,A);function N(I,F){O.prototype[F]=O.prototype[F.toUpperCase()]=O.prototype[F.toLowerCase()]=function(L,$){var U=this;return U._errorHandler.wrapBarcodeCall(function(){$.text=typeof $.text>"u"?void 0:""+$.text;var G=(0,n.default)(U._options,$);G=(0,p.default)(G);var q=I[F],H=C(L,q,G);return U._encodings.push(H),U})}}function C(I,F,L){I=""+I;var $=new F(I,L);if(!$.valid())throw new b.InvalidInputException($.constructor.name,I);var U=$.encode();U=(0,o.default)(U);for(var G=0;Gt in e?ble(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,kw=(e,t)=>{for(var r in t||(t={}))J3.call(t,r)&&eM(e,r,t[r]);if(Sp)for(var r of Sp(t))e4.call(t,r)&&eM(e,r,t[r]);return e},Rw=(e,t)=>{var r={};for(var n in e)J3.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Sp)for(var n of Sp(e))t.indexOf(n)<0&&e4.call(e,n)&&(r[n]=e[n]);return r};/** + * @license QR Code generator library (TypeScript) + * Copyright (c) Project Nayuki. + * SPDX-License-Identifier: MIT + */var da;(e=>{const t=class Ye{constructor(f,l,h,p){if(this.version=f,this.errorCorrectionLevel=l,this.modules=[],this.isFunction=[],fYe.MAX_VERSION)throw new RangeError("Version value out of range");if(p<-1||p>7)throw new RangeError("Mask value out of range");this.size=f*4+17;let m=[];for(let b=0;b7)throw new RangeError("Invalid value");let b,y;for(b=h;;b++){const E=Ye.getNumDataCodewords(b,l)*8,A=s.getTotalBits(f,b);if(A<=E){y=A;break}if(b>=p)throw new RangeError("Data too long")}for(const E of[Ye.Ecc.MEDIUM,Ye.Ecc.QUARTILE,Ye.Ecc.HIGH])g&&y<=Ye.getNumDataCodewords(b,E)*8&&(l=E);let w=[];for(const E of f){r(E.mode.modeBits,4,w),r(E.numChars,E.mode.numCharCountBits(b),w);for(const A of E.getData())w.push(A)}i(w.length==y);const j=Ye.getNumDataCodewords(b,l)*8;i(w.length<=j),r(0,Math.min(4,j-w.length),w),r(0,(8-w.length%8)%8,w),i(w.length%8==0);for(let E=236;w.lengthO[A>>>3]|=E<<7-(A&7)),new Ye(b,l,O,m)}getModule(f,l){return 0<=f&&f>>9)*1335;const p=(l<<10|h)^21522;i(p>>>15==0);for(let m=0;m<=5;m++)this.setFunctionModule(8,m,n(p,m));this.setFunctionModule(8,7,n(p,6)),this.setFunctionModule(8,8,n(p,7)),this.setFunctionModule(7,8,n(p,8));for(let m=9;m<15;m++)this.setFunctionModule(14-m,8,n(p,m));for(let m=0;m<8;m++)this.setFunctionModule(this.size-1-m,8,n(p,m));for(let m=8;m<15;m++)this.setFunctionModule(8,this.size-15+m,n(p,m));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let f=this.version;for(let h=0;h<12;h++)f=f<<1^(f>>>11)*7973;const l=this.version<<12|f;i(l>>>18==0);for(let h=0;h<18;h++){const p=n(l,h),m=this.size-11+h%3,g=Math.floor(h/3);this.setFunctionModule(m,g,p),this.setFunctionModule(g,m,p)}}drawFinderPattern(f,l){for(let h=-4;h<=4;h++)for(let p=-4;p<=4;p++){const m=Math.max(Math.abs(p),Math.abs(h)),g=f+p,b=l+h;0<=g&&g{(E!=y-m||N>=b)&&O.push(A[E])});return i(O.length==g),O}drawCodewords(f){if(f.length!=Math.floor(Ye.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let l=0;for(let h=this.size-1;h>=1;h-=2){h==6&&(h=5);for(let p=0;p>>3],7-(l&7)),l++)}}i(l==f.length*8)}applyMask(f){if(f<0||f>7)throw new RangeError("Mask value out of range");for(let l=0;l5&&f++):(this.finderPenaltyAddHistory(b,y),g||(f+=this.finderPenaltyCountPatterns(y)*Ye.PENALTY_N3),g=this.modules[m][w],b=1);f+=this.finderPenaltyTerminateAndCount(g,b,y)*Ye.PENALTY_N3}for(let m=0;m5&&f++):(this.finderPenaltyAddHistory(b,y),g||(f+=this.finderPenaltyCountPatterns(y)*Ye.PENALTY_N3),g=this.modules[w][m],b=1);f+=this.finderPenaltyTerminateAndCount(g,b,y)*Ye.PENALTY_N3}for(let m=0;mg+(b?1:0),l);const h=this.size*this.size,p=Math.ceil(Math.abs(l*20-h*10)/h)-1;return i(0<=p&&p<=9),f+=p*Ye.PENALTY_N4,i(0<=f&&f<=2568888),f}getAlignmentPatternPositions(){if(this.version==1)return[];{const f=Math.floor(this.version/7)+2,l=this.version==32?26:Math.ceil((this.version*4+4)/(f*2-2))*2;let h=[6];for(let p=this.size-7;h.lengthYe.MAX_VERSION)throw new RangeError("Version number out of range");let l=(16*f+128)*f+64;if(f>=2){const h=Math.floor(f/7)+2;l-=(25*h-10)*h-55,f>=7&&(l-=36)}return i(208<=l&&l<=29648),l}static getNumDataCodewords(f,l){return Math.floor(Ye.getNumRawDataModules(f)/8)-Ye.ECC_CODEWORDS_PER_BLOCK[l.ordinal][f]*Ye.NUM_ERROR_CORRECTION_BLOCKS[l.ordinal][f]}static reedSolomonComputeDivisor(f){if(f<1||f>255)throw new RangeError("Degree out of range");let l=[];for(let p=0;p0);for(const p of f){const m=p^h.shift();h.push(0),l.forEach((g,b)=>h[b]^=Ye.reedSolomonMultiply(g,m))}return h}static reedSolomonMultiply(f,l){if(f>>>8||l>>>8)throw new RangeError("Byte out of range");let h=0;for(let p=7;p>=0;p--)h=h<<1^(h>>>7)*285,h^=(l>>>p&1)*f;return i(h>>>8==0),h}finderPenaltyCountPatterns(f){const l=f[1];i(l<=this.size*3);const h=l>0&&f[2]==l&&f[3]==l*3&&f[4]==l&&f[5]==l;return(h&&f[0]>=l*4&&f[6]>=l?1:0)+(h&&f[6]>=l*4&&f[0]>=l?1:0)}finderPenaltyTerminateAndCount(f,l,h){return f&&(this.finderPenaltyAddHistory(l,h),l=0),l+=this.size,this.finderPenaltyAddHistory(l,h),this.finderPenaltyCountPatterns(h)}finderPenaltyAddHistory(f,l){l[0]==0&&(f+=this.size),l.pop(),l.unshift(f)}};t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;function r(u,f,l){if(f<0||f>31||u>>>f)throw new RangeError("Value out of range");for(let h=f-1;h>=0;h--)l.push(u>>>h&1)}function n(u,f){return(u>>>f&1)!=0}function i(u){if(!u)throw new Error("Assertion error")}const o=class At{constructor(f,l,h){if(this.mode=f,this.numChars=l,this.bitData=h,l<0)throw new RangeError("Invalid argument");this.bitData=h.slice()}static makeBytes(f){let l=[];for(const h of f)r(h,8,l);return new At(At.Mode.BYTE,f.length,l)}static makeNumeric(f){if(!At.isNumeric(f))throw new RangeError("String contains non-numeric characters");let l=[];for(let h=0;h=1<{(t=>{const r=class{constructor(i,o){this.ordinal=i,this.formatBits=o}};r.LOW=new r(0,1),r.MEDIUM=new r(1,0),r.QUARTILE=new r(2,3),r.HIGH=new r(3,2),t.Ecc=r})(e.QrCode||(e.QrCode={}))})(da||(da={}));(e=>{(t=>{const r=class{constructor(i,o){this.modeBits=i,this.numBitsCharCount=o}numCharCountBits(i){return this.numBitsCharCount[Math.floor((i+7)/17)]}};r.NUMERIC=new r(1,[10,12,14]),r.ALPHANUMERIC=new r(2,[9,11,13]),r.BYTE=new r(4,[8,16,16]),r.KANJI=new r(8,[8,10,12]),r.ECI=new r(7,[0,0,0]),t.Mode=r})(e.QrSegment||(e.QrSegment={}))})(da||(da={}));var us=da;/** + * @license qrcode.react + * Copyright (c) Paul O'Shannessy + * SPDX-License-Identifier: ISC + */var wle={L:us.QrCode.Ecc.LOW,M:us.QrCode.Ecc.MEDIUM,Q:us.QrCode.Ecc.QUARTILE,H:us.QrCode.Ecc.HIGH},t4=128,r4="L",n4="#FFFFFF",i4="#000000",o4=!1,a4=1,Sle=4,_le=0,jle=.1;function s4(e,t=0){const r=[];return e.forEach(function(n,i){let o=null;n.forEach(function(s,u){if(!s&&o!==null){r.push(`M${o+t} ${i+t}h${u-o}v1H${o+t}z`),o=null;return}if(u===n.length-1){if(!s)return;o===null?r.push(`M${u+t},${i+t} h1v1H${u+t}z`):r.push(`M${o+t},${i+t} h${u+1-o}v1H${o+t}z`);return}s&&o===null&&(o=u)})}),r.join("")}function l4(e,t){return e.slice().map((r,n)=>n=t.y+t.h?r:r.map((i,o)=>o=t.x+t.w?i:!1))}function Ole(e,t,r,n){if(n==null)return null;const i=e.length+r*2,o=Math.floor(t*jle),s=i/t,u=(n.width||o)*s,f=(n.height||o)*s,l=n.x==null?e.length/2-u/2:n.x*s,h=n.y==null?e.length/2-f/2:n.y*s,p=n.opacity==null?1:n.opacity;let m=null;if(n.excavate){let b=Math.floor(l),y=Math.floor(h),w=Math.ceil(u+l-b),j=Math.ceil(f+h-y);m={x:b,y,w,h:j}}const g=n.crossOrigin;return{x:l,y:h,h:f,w:u,excavation:m,opacity:p,crossOrigin:g}}function Ele(e,t){return t!=null?Math.max(Math.floor(t),0):e?Sle:_le}function c4({value:e,level:t,minVersion:r,includeMargin:n,marginSize:i,imageSettings:o,size:s,boostLevel:u}){let f=z.useMemo(()=>{const b=(Array.isArray(e)?e:[e]).reduce((y,w)=>(y.push(...us.QrSegment.makeSegments(w)),y),[]);return us.QrCode.encodeSegments(b,wle[t],r,void 0,void 0,u)},[e,t,r,u]);const{cells:l,margin:h,numCells:p,calculatedImageSettings:m}=z.useMemo(()=>{let g=f.getModules();const b=Ele(n,i),y=g.length+b*2,w=Ole(g,s,b,o);return{cells:g,margin:b,numCells:y,calculatedImageSettings:w}},[f,s,o,n,i]);return{qrcode:f,margin:h,cells:l,numCells:p,calculatedImageSettings:m}}var Ple=(function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0})(),Nle=z.forwardRef(function(t,r){const n=t,{value:i,size:o=t4,level:s=r4,bgColor:u=n4,fgColor:f=i4,includeMargin:l=o4,minVersion:h=a4,boostLevel:p,marginSize:m,imageSettings:g}=n,y=Rw(n,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:w}=y,j=Rw(y,["style"]),O=g?.src,E=z.useRef(null),A=z.useRef(null),N=z.useCallback(G=>{E.current=G,typeof r=="function"?r(G):r&&(r.current=G)},[r]),[C,T]=z.useState(!1),{margin:R,cells:I,numCells:F,calculatedImageSettings:L}=c4({value:i,level:s,minVersion:h,boostLevel:p,includeMargin:l,marginSize:m,imageSettings:g,size:o});z.useEffect(()=>{if(E.current!=null){const G=E.current,q=G.getContext("2d");if(!q)return;let H=I;const V=A.current,D=L!=null&&V!==null&&V.complete&&V.naturalHeight!==0&&V.naturalWidth!==0;D&&L.excavation!=null&&(H=l4(I,L.excavation));const Z=window.devicePixelRatio||1;G.height=G.width=o*Z;const J=o/F*Z;q.scale(J,J),q.fillStyle=u,q.fillRect(0,0,F,F),q.fillStyle=f,Ple?q.fill(new Path2D(s4(H,R))):I.forEach(function(M,B){M.forEach(function(ee,ae){ee&&q.fillRect(ae+R,B+R,1,1)})}),L&&(q.globalAlpha=L.opacity),D&&q.drawImage(V,L.x+R,L.y+R,L.w,L.h)}}),z.useEffect(()=>{T(!1)},[O]);const $=kw({height:o,width:o},w);let U=null;return O!=null&&(U=z.createElement("img",{src:O,key:O,style:{display:"none"},onLoad:()=>{T(!0)},ref:A,crossOrigin:L?.crossOrigin})),z.createElement(z.Fragment,null,z.createElement("canvas",kw({style:$,height:o,width:o,ref:N,role:"img"},j)),U)});Nle.displayName="QRCodeCanvas";var u4=z.forwardRef(function(t,r){const n=t,{value:i,size:o=t4,level:s=r4,bgColor:u=n4,fgColor:f=i4,includeMargin:l=o4,minVersion:h=a4,boostLevel:p,title:m,marginSize:g,imageSettings:b}=n,y=Rw(n,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:w,cells:j,numCells:O,calculatedImageSettings:E}=c4({value:i,level:s,minVersion:h,boostLevel:p,includeMargin:l,marginSize:g,imageSettings:b,size:o});let A=j,N=null;b!=null&&E!=null&&(E.excavation!=null&&(A=l4(j,E.excavation)),N=z.createElement("image",{href:b.src,height:E.h,width:E.w,x:E.x+w,y:E.y+w,preserveAspectRatio:"none",opacity:E.opacity,crossOrigin:E.crossOrigin}));const C=s4(A,w);return z.createElement("svg",kw({height:o,width:o,viewBox:`0 0 ${O} ${O}`,ref:r,role:"img"},y),!!m&&z.createElement("title",null,m),z.createElement("path",{fill:u,d:`M0,0 h${O}v${O}H0z`,shapeRendering:"crispEdges"}),z.createElement("path",{fill:f,d:C,shapeRendering:"crispEdges"}),N)});u4.displayName="QRCodeSVG";function Ale({data:e,width:t,height:r,showText:n,orientation:i="horizontal"}){const o=S.useRef(null),s=i==="vertical",u=Math.max(20,(s?t:r)-(n?14:4));S.useEffect(()=>{if(o.current&&e)try{xle(o.current,e,{format:"CODE128",width:1,height:u,displayValue:n!==!1,margin:2,fontOptions:"",fontSize:10})}catch{}},[e,u,n]);const f=d.jsx("svg",{ref:o,className:"w-full h-full min-h-0",style:{maxHeight:s?t:r}});return s?d.jsx("div",{className:"w-full h-full flex items-center justify-center",children:d.jsx("div",{style:{transform:"rotate(-90deg)",transformOrigin:"center center",width:r,height:t,display:"flex",alignItems:"center",justifyContent:"center"},children:f})}):f}const Pc=8;function is(e){return Math.round(e/Pc)*Pc}function _p(e,t){return t==="cm"?e*37.8:e*96}function tM(e,t){return t==="cm"?e/37.8:e/96}function f4({el:e}){const t=e.config,r=e.type,n={fontSize:t?.fontSize??14,fontFamily:t?.fontFamily??"Arial",fontWeight:t?.fontWeight??"normal",textAlign:t?.textAlign??"left",color:t?.color??"#000"},i=t?.inputType;if(r==="TEXT_STATIC"){const o=t?.text??"文本";return i==="number"?d.jsx("input",{type:"number",readOnly:!0,value:t?.text??"0",className:"w-full h-full min-w-0 border border-gray-300 bg-white rounded px-1 pointer-events-none",style:{...n,textAlign:"right"}}):i==="options"?d.jsxs("div",{className:"w-full h-full min-w-0 border border-gray-300 bg-white rounded px-1 flex items-center pointer-events-none text-gray-500",style:n,children:[d.jsx("span",{className:"truncate flex-1",children:o||"请选择..."}),d.jsx("span",{className:"ml-auto text-gray-400",children:"▼"})]}):i==="text"?d.jsx("input",{type:"text",readOnly:!0,value:o,className:"w-full h-full min-w-0 border border-gray-300 bg-white rounded px-1 pointer-events-none",style:n}):d.jsx("div",{className:"w-full h-full px-1 overflow-hidden whitespace-pre-wrap break-all leading-tight",style:n,children:o})}if(r==="TEXT_PRODUCT"){const o=t?.text??"商品名";return d.jsx("div",{className:"w-full h-full px-1 overflow-hidden whitespace-pre-wrap break-all leading-tight",style:n,children:o})}if(r==="TEXT_PRICE"){const o=t?.prefix??"¥",s=t?.text??"0.00";return d.jsxs("div",{className:"w-full h-full px-1 overflow-hidden flex items-center",style:{...n,justifyContent:n.textAlign==="center"?"center":n.textAlign==="right"?"flex-end":"flex-start"},children:[d.jsx("span",{children:o}),d.jsx("span",{children:s})]})}if(r==="BARCODE"){const o=t?.data??"123456789",s=t?.showText!==!1,u=t?.orientation==="vertical"?"vertical":"horizontal";return d.jsx("div",{className:"flex flex-col items-center justify-center w-full h-full overflow-hidden p-0.5",children:d.jsx("div",{className:"flex-1 w-full min-h-0 flex items-center justify-center",children:d.jsx(Ale,{data:o,width:e.width,height:e.height,showText:s,orientation:u})})})}if(r==="QRCODE"){const o=t?.data??"https://example.com",s=Math.min(e.width,e.height)-4;return d.jsx("div",{className:"w-full h-full flex items-center justify-center p-0.5",children:d.jsx(u4,{value:o,size:Math.max(20,s),level:"M",includeMargin:!1})})}if(r==="IMAGE"){const o=t?.src;return o?d.jsx("img",{src:o,alt:"",className:"w-full h-full object-contain"}):d.jsx("div",{className:"w-full h-full flex flex-col items-center justify-center bg-gray-100 text-gray-500 text-[10px] border border-dashed border-gray-300",children:d.jsx("span",{className:"font-medium",children:"Logo"})})}if(r==="DATE"){const s=(t?.format??"YYYY-MM-DD").replace("YYYY","2025").replace("MM","02").replace("DD","01");return t?.inputType==="datetime"||t?.inputType==="date"?d.jsx("input",{type:"date",readOnly:!0,value:"2025-02-01",className:"w-full h-full min-w-0 border border-gray-300 bg-white rounded px-1 pointer-events-none text-[10px]",style:n}):d.jsx("div",{className:"w-full h-full px-1 overflow-hidden whitespace-nowrap",style:n,children:s})}if(r==="TIME"){const s=(t?.format??"HH:mm").replace("HH","12").replace("mm","30");return d.jsx("div",{className:"w-full h-full px-1 overflow-hidden whitespace-nowrap",style:n,children:s})}if(r==="DURATION")return d.jsx("div",{className:"w-full h-full px-1 overflow-hidden whitespace-nowrap",style:n,children:"保质期 2025-02-04"});if(r==="WEIGHT"){const o=t?.value??500,s=t?.unit??"g";return d.jsxs("div",{className:"w-full h-full px-1 overflow-hidden whitespace-nowrap",style:n,children:[o,s]})}if(r==="WEIGHT_PRICE"){const o=t?.unitPrice??10,s=t?.weight??.5,u=t?.currency??"¥";return d.jsxs("div",{className:"w-full h-full px-1 overflow-hidden whitespace-nowrap",style:n,children:[u,(o*s).toFixed(2)]})}if(r==="NUTRITION"){const o=t?.calories??120;return d.jsxs("div",{className:"text-[8px] p-0.5 w-full h-full overflow-hidden flex flex-col",children:[d.jsx("div",{className:"font-semibold border-b border-black",children:"Nutrition Facts"}),d.jsxs("div",{children:["Calories ",o]})]})}return r==="BLANK"?d.jsx("div",{className:"w-full h-full border border-dashed border-gray-200"}):d.jsx("div",{className:"text-gray-500 text-[10px] px-1 truncate w-full flex items-center justify-center",children:e.type.replace(/_/g," ")})}function Cle({template:e,selectedId:t,onSelect:r,onUpdateElement:n,onDeleteElement:i,onTemplateChange:o,scale:s=1,onZoomIn:u,onZoomOut:f,onPreview:l}){const h=S.useRef(null),p=S.useRef(null),m=S.useRef(null),g=S.useRef(null),b=S.useRef(null),y=S.useRef(null),w=S.useRef(null),[j,O]=z.useState(!1),[E,A]=z.useState(!1),N=S.useRef(null),[C,T]=z.useState({x:0,y:0}),R=S.useRef(null),I=_p(e.width,e.unit),F=_p(e.height,e.unit),L=e.showGrid!==!1,$=S.useCallback((M,B)=>{if(j||M.button===1)return;M.stopPropagation(),r(B),p.current?.focus();const ee=e.elements.find(ie=>ie.id===B);if(!ee)return;const ae=document.getElementById(`element-${B}`);ae&&(ae.classList.add("z-50","opacity-90","shadow-xl","ring-2","ring-blue-400","ring-offset-2"),ae.style.cursor="grabbing"),m.current={id:B,startX:M.clientX,startY:M.clientY,elX:ee.x,elY:ee.y},y.current={id:B,x:ee.x,y:ee.y},M.currentTarget.setPointerCapture?.(M.pointerId)},[e.elements,r,j]),U=S.useCallback(M=>{w.current!==null&&cancelAnimationFrame(w.current),w.current=requestAnimationFrame(()=>{M(),w.current=null})},[]),G=S.useCallback(M=>{if(E&&R.current){const B=M.clientX-R.current.startX,ee=M.clientY-R.current.startY;T({x:R.current.x+B,y:R.current.y+ee});return}if(E&&N.current&&h.current){const B=M.clientX-N.current.x,ee=M.clientY-N.current.y;h.current.scrollLeft=N.current.scrollLeft-B,h.current.scrollTop=N.current.scrollTop-ee;return}if(m.current){const{id:B,startX:ee,startY:ae,elX:ie,elY:fe}=m.current,K=M.clientX,ce=M.clientY;U(()=>{const te=(K-ee)/s,le=(ce-ae)/s,ge=Math.max(0,ie+te),Y=Math.max(0,fe+le),_e=is(ge),Oe=is(Y),Ve=document.getElementById(`element-${B}`);Ve&&(Ve.style.left=`${_e}px`,Ve.style.top=`${Oe}px`),y.current={id:B,x:_e,y:Oe}})}if(g.current){const{id:B,corner:ee,startX:ae,startY:ie,w:fe,h:K,elX:ce,elY:te}=g.current,le=M.clientX,ge=M.clientY;U(()=>{const Y=(le-ae)/s,_e=(ge-ie)/s;let Oe=fe,Ve=K,nt=ce,lt=te;ee.includes("e")&&(Oe=Math.max(20,fe+Y)),ee.includes("w")&&(Oe=Math.max(20,fe-Y),nt=ce+Y),ee.includes("s")&&(Ve=Math.max(12,K+_e)),ee.includes("n")&&(Ve=Math.max(12,K-_e),lt=te+_e);const nr=is(Oe),ir=is(Ve),hr=is(nt),Rt=is(lt),$t=document.getElementById(`element-${B}`);$t&&($t.style.width=`${nr}px`,$t.style.height=`${ir}px`,$t.style.left=`${hr}px`,$t.style.top=`${Rt}px`),y.current={id:B,width:nr,height:ir,x:hr,y:Rt}})}if(b.current&&o){const{edge:B,startX:ee,startY:ae,startW:ie,startH:fe}=b.current,K=M.clientX,ce=M.clientY;U(()=>{const te=(K-ee)/s,le=(ce-ae)/s,ge=tM(te,e.unit),Y=tM(le,e.unit);if(B==="bottom"){const _e=Math.max(1,fe+Y);o({height:_e})}else{const _e=Math.max(1,ie+ge);o({width:_e})}})}},[E,o,s,e.unit,U]),q=S.useCallback(()=>{E&&(A(!1),N.current=null,R.current=null),w.current!==null&&(cancelAnimationFrame(w.current),w.current=null);const M=m.current?.id||g.current?.id;if(M){const B=document.getElementById(`element-${M}`);B&&(B.classList.remove("z-50","opacity-90","shadow-xl","ring-2","ring-blue-400","ring-offset-2"),B.style.cursor="")}if(y.current){const{id:B,...ee}=y.current;n(B,ee),y.current=null}m.current=null,g.current=null,b.current=null},[n]);S.useEffect(()=>{const M=ee=>{ee.code==="Space"&&!ee.repeat&&O(!0)},B=ee=>{ee.code==="Space"&&(O(!1),A(!1),N.current=null,R.current=null)};return window.addEventListener("keydown",M),window.addEventListener("keyup",B),()=>{window.removeEventListener("keydown",M),window.removeEventListener("keyup",B)}},[]),S.useEffect(()=>{const M=h.current;if(!M)return;const B=()=>{M.scrollLeft=Math.max(0,(M.scrollWidth-M.clientWidth)/2),M.scrollTop=Math.max(0,(M.scrollHeight-M.clientHeight)/2)},ee=requestAnimationFrame(B),ae=setTimeout(B,100);return()=>{cancelAnimationFrame(ee),clearTimeout(ae)}},[s,I,F]);const H=S.useCallback(M=>{if(!t)return;if(M.key==="Delete"||M.key==="Backspace"){M.preventDefault();const fe=e.elements.findIndex(K=>K.id===t);if(fe>=0){const K=e.elements.filter(ce=>ce.id!==t);i(t),r(K[fe]?.id??K[fe-1]?.id??null)}return}const B=e.elements.find(fe=>fe.id===t);if(!B)return;const ee=M.shiftKey?1:Pc;let ae=0,ie=0;switch(M.key){case"ArrowLeft":ae=-ee;break;case"ArrowRight":ae=ee;break;case"ArrowUp":ie=-ee;break;case"ArrowDown":ie=-ee;break;default:return}M.key==="ArrowDown"&&(ie=ee),M.preventDefault(),n(B.id,{x:Math.max(0,B.x+ae),y:Math.max(0,B.y+ie)})},[t,e.elements,n,i,r]),V=()=>r(null),D=M=>{(j||M.button===1)&&(M.preventDefault(),A(!0),N.current={x:M.clientX,y:M.clientY,scrollLeft:h.current?.scrollLeft||0,scrollTop:h.current?.scrollTop||0},M.currentTarget.setPointerCapture(M.pointerId))},Z=M=>{if(E&&N.current&&h.current){const B=M.clientX-N.current.x,ee=M.clientY-N.current.y;h.current.scrollLeft=N.current.scrollLeft-B,h.current.scrollTop=N.current.scrollTop-ee}},J=M=>{E&&(A(!1),N.current=null)};return d.jsxs("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden bg-gray-100",children:[d.jsxs("div",{className:"shrink-0 px-4 py-2 border-b border-gray-200 bg-white flex items-center justify-between gap-2 flex-wrap z-10",children:[d.jsx("span",{className:"text-sm font-medium text-gray-700",children:"Label Preview"}),d.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[l&&d.jsx("button",{type:"button",onClick:l,className:"h-8 px-3 rounded border border-gray-300 bg-white text-gray-700 hover:bg-gray-50 text-xs font-medium shadow-sm transition-all active:scale-95",children:"预览"}),o&&d.jsxs(d.Fragment,{children:[d.jsxs(Je,{value:(()=>{const M=Vb.findIndex(B=>B.width===e.width&&B.height===e.height&&B.unit===e.unit);return M>=0?String(M):"custom"})(),onValueChange:M=>{if(M==="custom")return;const B=Vb[Number(M)];B&&o({width:B.width,height:B.height,unit:B.unit})},children:[d.jsx(tt,{className:"h-8 w-[130px] text-xs",children:d.jsx(et,{placeholder:"画布大小"})}),d.jsxs(rt,{children:[Vb.map((M,B)=>d.jsx(Ee,{value:String(B),className:"text-xs",children:M.name},B)),d.jsx(Ee,{value:"custom",className:"text-xs text-gray-500",children:"自定义"})]})]}),d.jsx("button",{type:"button",onClick:()=>o({showGrid:!L}),className:Re("h-8 px-3 rounded border text-xs font-medium shadow-sm transition-colors",L?"border-gray-300 bg-white text-gray-700 hover:bg-gray-50":"border-gray-300 bg-gray-100 text-gray-500"),children:L?"隐藏网格":"显示网格"})]}),d.jsxs("div",{className:"flex items-center gap-1 bg-white rounded border border-gray-300 p-0.5 shadow-sm h-8",children:[d.jsx("button",{type:"button",onClick:f,disabled:!f,className:"h-6 w-6 rounded hover:bg-gray-100 text-gray-600 disabled:opacity-50 disabled:pointer-events-none flex items-center justify-center text-sm font-medium active:scale-90 transition-transform",title:"缩小",children:"−"}),d.jsxs("span",{className:"min-w-[3rem] text-center text-xs text-gray-600 font-medium",children:[Math.round(s*100),"%"]}),d.jsx("button",{type:"button",onClick:u,disabled:!u,className:"h-6 w-6 rounded hover:bg-gray-100 text-gray-600 disabled:opacity-50 disabled:pointer-events-none flex items-center justify-center text-sm font-medium active:scale-90 transition-transform",title:"放大",children:"+"})]})]})]}),d.jsx("div",{ref:h,className:Re("flex-1 overflow-auto bg-gray-100 relative",j?"cursor-grab active:cursor-grabbing":""),onClick:V,onPointerDown:D,onPointerMove:Z,onPointerUp:J,onPointerLeave:J,children:d.jsx("div",{style:{minWidth:"100%",minHeight:"100%",width:"fit-content",height:"fit-content",display:"flex",padding:50,boxSizing:"border-box",transform:`translate(${C.x}px, ${C.y}px)`},children:d.jsxs("div",{ref:p,tabIndex:0,className:Re("relative bg-white shadow-lg border border-dashed border-gray-300 origin-top-left outline-none m-auto",E?"cursor-grabbing":"cursor-grab"),style:{width:I,height:F,transform:`scale(${s})`,backgroundImage:L?`linear-gradient(to right, rgba(0,0,0,0.06) 1px, transparent 1px), + linear-gradient(to bottom, rgba(0,0,0,0.06) 1px, transparent 1px)`:void 0,backgroundSize:L?`${Pc}px ${Pc}px`:void 0,pointerEvents:j?"none":"auto"},onPointerDown:M=>{const B=M.target,ee=B.closest('[id^="element-"]'),ae=B.closest('[title*="拖拽拉高"]')||B.closest('[title*="拖拽拉宽"]');p.current?.contains(B)&&!ee&&!ae&&!m.current&&!g.current&&(M.preventDefault(),M.stopPropagation(),A(!0),R.current={x:C.x,y:C.y,startX:M.clientX,startY:M.clientY},N.current={x:M.clientX,y:M.clientY,scrollLeft:h.current?.scrollLeft??0,scrollTop:h.current?.scrollTop??0},M.currentTarget.setPointerCapture?.(M.pointerId))},onPointerMove:G,onPointerUp:q,onKeyDown:H,children:[e.showRuler&&d.jsxs("div",{className:"absolute top-0 left-0 right-0 h-5 border-b border-gray-300 bg-gray-50 text-[10px] text-gray-500 flex items-center px-1 pointer-events-none select-none",children:[e.unit," ",e.width," × ",e.height]}),o&&d.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-3 cursor-ns-resize flex items-center justify-center bg-gray-200/80 hover:bg-blue-400/30 border-t border-gray-300 text-[10px] text-gray-500 transition-colors",title:"拖拽拉高纸张",onPointerDown:M=>{M.stopPropagation(),b.current={edge:"bottom",startX:M.clientX,startY:M.clientY,startW:e.width,startH:e.height},M.target.setPointerCapture?.(M.pointerId)},children:"⋮"}),o&&d.jsx("div",{className:"absolute top-0 right-0 bottom-0 w-3 cursor-ew-resize flex items-center justify-center bg-gray-200/80 hover:bg-blue-400/30 border-l border-gray-300 text-[10px] text-gray-500 transition-colors",title:"拖拽拉宽纸张",onPointerDown:M=>{M.stopPropagation(),b.current={edge:"right",startX:M.clientX,startY:M.clientY,startW:e.width,startH:e.height},M.target.setPointerCapture?.(M.pointerId)},children:"⋮"}),e.elements.map(M=>d.jsxs("div",{id:`element-${M.id}`,className:Re("absolute box-border cursor-move overflow-hidden transition-shadow",M.border==="line"&&"border border-gray-400",M.border==="dotted"&&"border border-dotted border-gray-400",t===M.id&&"ring-2 ring-blue-500 ring-offset-1 z-10"),style:{left:M.x,top:M.y,width:M.width,height:M.height},onClick:B=>{B.stopPropagation(),r(M.id)},onPointerDown:B=>$(B,M.id),children:[d.jsx(f4,{el:M}),t===M.id&&d.jsxs(d.Fragment,{children:[["nw","ne","sw","se"].map(B=>d.jsx("div",{className:"absolute w-4 h-4 bg-white border-2 border-blue-500 rounded-full z-20 shadow-md hover:scale-110 transition-transform",style:{cursor:"nwse-resize",top:B.startsWith("n")?-6:void 0,bottom:B.startsWith("s")?-6:void 0,left:B.endsWith("w")?-6:void 0,right:B.endsWith("e")?-6:void 0},onPointerDown:ee=>{ee.stopPropagation();const ae=e.elements.find(ie=>ie.id===M.id);g.current={id:M.id,corner:B,startX:ee.clientX,startY:ee.clientY,w:ae.width,h:ae.height,elX:ae.x,elY:ae.y},ee.currentTarget.setPointerCapture?.(ee.pointerId)}},B)),["n","s","w","e"].map(B=>d.jsx("div",{className:"absolute bg-blue-500/50 border border-white/50 rounded-sm z-10 shadow-sm hover:bg-blue-600",style:{cursor:B==="n"||B==="s"?"ns-resize":"ew-resize",width:B==="n"||B==="s"?"20px":"6px",height:B==="n"||B==="s"?"6px":"20px",top:B==="n"?-3:B==="s"?void 0:"50%",bottom:B==="s"?-3:void 0,left:B==="w"?-3:B==="e"?void 0:"50%",right:B==="e"?-3:void 0,transform:B==="n"||B==="s"?"translateX(-50%)":"translateY(-50%)"},onPointerDown:ee=>{ee.stopPropagation();const ae=e.elements.find(fe=>fe.id===M.id),ie=document.getElementById(`element-${M.id}`);ie&&ie.classList.add("z-50","opacity-90"),g.current={id:M.id,corner:B,startX:ee.clientX,startY:ee.clientY,w:ae.width,h:ae.height,elX:ae.x,elY:ae.y},ee.currentTarget.setPointerCapture?.(ee.pointerId)}},B))]})]},M.id))]})})})]})}function Tle({template:e,maxWidth:t=480}){const r=_p(e.width,e.unit),n=_p(e.height,e.unit),i=t?Math.min(t/r,t/n,2):1,o=r*i,s=n*i;return d.jsx("div",{className:"flex items-center justify-center p-4 bg-gray-100 rounded",children:d.jsx("div",{style:{width:o,height:s},className:"relative bg-white shadow-lg overflow-hidden",children:d.jsx("div",{className:"origin-top-left",style:{position:"absolute",left:0,top:0,width:r,height:n,transform:`scale(${i})`,transformOrigin:"0 0"},children:e.elements.map(u=>d.jsx("div",{className:"absolute box-border overflow-hidden pointer-events-none flex items-center justify-center text-xs",style:{left:u.x,top:u.y,width:u.width,height:u.height,border:u.border==="line"?"1px solid #999":u.border==="dotted"?"1px dotted #999":void 0},children:d.jsx(f4,{el:u})},u.id))})})})}var kle=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Rle=kle.reduce((e,t)=>{const r=Zw(`Primitive.${t}`),n=S.forwardRef((i,o)=>{const{asChild:s,...u}=i,f=s?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(f,{...u,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),Mle="Label",d4=S.forwardRef((e,t)=>d.jsx(Rle.label,{...e,ref:t,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(e.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));d4.displayName=Mle;var Ile=d4;function me({className:e,...t}){return d.jsx(Ile,{"data-slot":"label",className:Re("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}var Pm="Switch",[Dle]=Bn(Pm),[Lle,$le]=Dle(Pm),h4=S.forwardRef((e,t)=>{const{__scopeSwitch:r,name:n,checked:i,defaultChecked:o,required:s,disabled:u,value:f="on",onCheckedChange:l,form:h,...p}=e,[m,g]=S.useState(null),b=Ze(t,E=>g(E)),y=S.useRef(!1),w=m?h||!!m.closest("form"):!0,[j,O]=Mi({prop:i,defaultProp:o??!1,onChange:l,caller:Pm});return d.jsxs(Lle,{scope:r,checked:j,disabled:u,children:[d.jsx(Ue.button,{type:"button",role:"switch","aria-checked":j,"aria-required":s,"data-state":g4(j),"data-disabled":u?"":void 0,disabled:u,value:f,...p,ref:b,onClick:Ie(e.onClick,E=>{O(A=>!A),w&&(y.current=E.isPropagationStopped(),y.current||E.stopPropagation())})}),w&&d.jsx(v4,{control:m,bubbles:!y.current,name:n,value:f,checked:j,required:s,disabled:u,form:h,style:{transform:"translateX(-100%)"}})]})});h4.displayName=Pm;var p4="SwitchThumb",m4=S.forwardRef((e,t)=>{const{__scopeSwitch:r,...n}=e,i=$le(p4,r);return d.jsx(Ue.span,{"data-state":g4(i.checked),"data-disabled":i.disabled?"":void 0,...n,ref:t})});m4.displayName=p4;var Ble="SwitchBubbleInput",v4=S.forwardRef(({__scopeSwitch:e,control:t,checked:r,bubbles:n=!0,...i},o)=>{const s=S.useRef(null),u=Ze(s,o),f=y_(r),l=d_(t);return S.useEffect(()=>{const h=s.current;if(!h)return;const p=window.HTMLInputElement.prototype,g=Object.getOwnPropertyDescriptor(p,"checked").set;if(f!==r&&g){const b=new Event("click",{bubbles:n});g.call(h,r),h.dispatchEvent(b)}},[f,r,n]),d.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...i,tabIndex:-1,ref:u,style:{...i.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});v4.displayName=Ble;function g4(e){return e?"checked":"unchecked"}var Fle=h4,zle=m4;function mn({className:e,...t}){return d.jsx(Fle,{"data-slot":"switch",className:Re("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-switch-background focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:d.jsx(zle,{"data-slot":"switch-thumb",className:Re("bg-card dark:data-[state=unchecked]:bg-card-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}function qle({template:e,selectedElement:t,onTemplateChange:r,onElementChange:n,onDeleteElement:i}){return t?d.jsxs("div",{className:"w-72 shrink-0 border-l border-gray-200 bg-white flex flex-col h-full",children:[d.jsx("div",{className:"px-3 py-2 border-b border-gray-200 font-semibold text-gray-800",children:"Properties (Element)"}),d.jsx(_s,{className:"flex-1",children:d.jsxs("div",{className:"p-3 space-y-3",children:[d.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[d.jsxs("div",{children:[d.jsx(me,{className:"text-xs",children:"X"}),d.jsx(Se,{type:"number",value:t.x,onChange:o=>n(t.id,{x:Number(o.target.value)||0}),className:"h-8 text-sm"})]}),d.jsxs("div",{children:[d.jsx(me,{className:"text-xs",children:"Y"}),d.jsx(Se,{type:"number",value:t.y,onChange:o=>n(t.id,{y:Number(o.target.value)||0}),className:"h-8 text-sm"})]})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[d.jsxs("div",{children:[d.jsx(me,{className:"text-xs",children:"Width"}),d.jsx(Se,{type:"number",value:t.width,onChange:o=>n(t.id,{width:Math.max(1,Number(o.target.value)||0)}),className:"h-8 text-sm"})]}),d.jsxs("div",{children:[d.jsx(me,{className:"text-xs",children:"Height"}),d.jsx(Se,{type:"number",value:t.height,onChange:o=>n(t.id,{height:Math.max(1,Number(o.target.value)||0)}),className:"h-8 text-sm"})]})]}),d.jsxs("div",{children:[d.jsx(me,{className:"text-xs",children:"Rotation"}),d.jsxs(Je,{value:t.rotation,onValueChange:o=>n(t.id,{rotation:o}),children:[d.jsx(tt,{className:"h-8 text-sm",children:d.jsx(et,{})}),d.jsxs(rt,{children:[d.jsx(Ee,{value:"horizontal",children:"horizontal"}),d.jsx(Ee,{value:"vertical",children:"vertical"})]})]})]}),d.jsxs("div",{children:[d.jsx(me,{className:"text-xs",children:"Border"}),d.jsxs(Je,{value:t.border,onValueChange:o=>n(t.id,{border:o}),children:[d.jsx(tt,{className:"h-8 text-sm",children:d.jsx(et,{})}),d.jsxs(rt,{children:[d.jsx(Ee,{value:"none",children:"none"}),d.jsx(Ee,{value:"line",children:"line"}),d.jsx(Ee,{value:"dotted",children:"dotted"})]})]})]}),d.jsx(Ule,{element:t,onChange:o=>n(t.id,{config:{...t.config,...o}})}),i&&d.jsx("div",{className:"pt-4 border-t border-gray-100",children:d.jsx(we,{variant:"destructive",className:"w-full",onClick:()=>i(t.id),children:"Delete Element"})})]})})]}):d.jsxs("div",{className:"w-72 shrink-0 border-l border-gray-200 bg-white flex flex-col h-full",children:[d.jsx("div",{className:"px-3 py-2 border-b border-gray-200 font-semibold text-gray-800",children:"Properties (Template)"}),d.jsx(_s,{className:"flex-1",children:d.jsxs("div",{className:"p-3 space-y-3",children:[d.jsxs("div",{children:[d.jsx(me,{className:"text-xs",children:"Template Name"}),d.jsx(Se,{value:e.name,onChange:o=>r({name:o.target.value}),className:"h-8 text-sm mt-1"})]}),d.jsxs("div",{children:[d.jsx(me,{className:"text-xs",children:"Label Type"}),d.jsxs(Je,{value:e.labelType,onValueChange:o=>r({labelType:o}),children:[d.jsx(tt,{className:"h-8 text-sm mt-1",children:d.jsx(et,{})}),d.jsxs(rt,{children:[d.jsx(Ee,{value:"PRICE",children:"PRICE"}),d.jsx(Ee,{value:"NUTRITION",children:"NUTRITION"}),d.jsx(Ee,{value:"SHIPPING",children:"SHIPPING"})]})]})]}),d.jsxs("div",{children:[d.jsx(me,{className:"text-xs",children:"Applied Location"}),d.jsxs(Je,{value:e.appliedLocation,onValueChange:o=>r({appliedLocation:o}),children:[d.jsx(tt,{className:"h-8 text-sm mt-1",children:d.jsx(et,{})}),d.jsxs(rt,{children:[d.jsx(Ee,{value:"ALL",children:"All Locations"}),d.jsx(Ee,{value:"loc-a",children:"Location A"}),d.jsx(Ee,{value:"loc-b",children:"Location B"})]})]})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[d.jsxs("div",{children:[d.jsx(me,{className:"text-xs",children:"Width"}),d.jsx(Se,{type:"number",value:e.width,onChange:o=>r({width:Math.max(.1,Number(o.target.value)||0)}),className:"h-8 text-sm"})]}),d.jsxs("div",{children:[d.jsx(me,{className:"text-xs",children:"Height"}),d.jsx(Se,{type:"number",value:e.height,onChange:o=>r({height:Math.max(.1,Number(o.target.value)||0)}),className:"h-8 text-sm"})]})]}),d.jsxs("div",{children:[d.jsx(me,{className:"text-xs",children:"Unit"}),d.jsxs(Je,{value:e.unit,onValueChange:o=>r({unit:o}),children:[d.jsx(tt,{className:"h-8 text-sm mt-1",children:d.jsx(et,{})}),d.jsxs(rt,{children:[d.jsx(Ee,{value:"cm",children:"cm"}),d.jsx(Ee,{value:"inch",children:"inch"})]})]})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(mn,{checked:e.showRuler,onCheckedChange:o=>r({showRuler:o})}),d.jsx(me,{className:"text-xs",children:"Show Ruler"})]})]})})]})}function Ule({element:e,onChange:t}){const r=e.config,n=(i,o)=>t({[i]:o});switch(e.type){case"TEXT_STATIC":case"TEXT_PRODUCT":case"TEXT_PRICE":return d.jsxs(d.Fragment,{children:[d.jsxs("div",{children:[d.jsx(me,{className:"text-xs",children:"Text"}),d.jsx(Se,{value:r.text??"",onChange:i=>n("text",i.target.value),className:"h-8 text-sm mt-1"})]}),d.jsxs("div",{children:[d.jsx(me,{className:"text-xs",children:"Font Size"}),d.jsx(Se,{type:"number",value:r.fontSize??14,onChange:i=>n("fontSize",Number(i.target.value)||14),className:"h-8 text-sm mt-1"})]}),d.jsxs("div",{children:[d.jsx(me,{className:"text-xs",children:"Text Align"}),d.jsxs(Je,{value:r.textAlign??"left",onValueChange:i=>n("textAlign",i),children:[d.jsx(tt,{className:"h-8 text-sm mt-1",children:d.jsx(et,{})}),d.jsxs(rt,{children:[d.jsx(Ee,{value:"left",children:"Left"}),d.jsx(Ee,{value:"center",children:"Center"}),d.jsx(Ee,{value:"right",children:"Right"})]})]})]})]});case"BARCODE":return d.jsxs(d.Fragment,{children:[d.jsxs("div",{children:[d.jsx(me,{className:"text-xs",children:"Data"}),d.jsx(Se,{value:r.data??"",onChange:i=>n("data",i.target.value),className:"h-8 text-sm mt-1"})]}),d.jsxs("div",{children:[d.jsx(me,{className:"text-xs",children:"方向"}),d.jsxs(Je,{value:r.orientation??"horizontal",onValueChange:i=>n("orientation",i),children:[d.jsx(tt,{className:"h-8 text-sm mt-1",children:d.jsx(et,{})}),d.jsxs(rt,{children:[d.jsx(Ee,{value:"horizontal",children:"水平"}),d.jsx(Ee,{value:"vertical",children:"竖排"})]})]})]})]});case"QRCODE":return d.jsxs("div",{children:[d.jsx(me,{className:"text-xs",children:"Data (URL)"}),d.jsx(Se,{value:r.data??"",onChange:i=>n("data",i.target.value),className:"h-8 text-sm mt-1"})]});case"WEIGHT":return d.jsxs("div",{children:[d.jsx(me,{className:"text-xs",children:"Value"}),d.jsx(Se,{type:"number",value:r.value??0,onChange:i=>n("value",Number(i.target.value)||0),className:"h-8 text-sm mt-1"})]});default:return d.jsxs("div",{className:"text-xs text-gray-500",children:["Config for ",e.type," (edit in code if needed)"]})}}const Wle=.5,Hle=2,rM=.25,Vle=1;function Gle({templateId:e,initialTemplate:t,onClose:r,onSaved:n}){const[i,o]=S.useState(()=>t?{...t}:ise(e??void 0)),[s,u]=S.useState(null),[f,l]=S.useState(Vle),[h,p]=S.useState(!1),m=i.elements.find(E=>E.id===s)??null,g=S.useCallback((E,A)=>{const N=ose(E,30,30);A&&Object.keys(A).length>0&&(N.config={...N.config,...A}),o(C=>({...C,elements:[...C.elements,N]})),u(N.id)},[]),b=S.useCallback((E,A)=>{o(N=>({...N,elements:N.elements.map(C=>C.id===E?{...C,...A}:C)}))},[]),y=S.useCallback(E=>{o(A=>({...A,elements:A.elements.filter(N=>N.id!==E)})),u(null)},[]),w=S.useCallback(E=>{o(A=>({...A,...E}))},[]),j=S.useCallback(()=>{sse(i),n(),r()},[i,n,r]),O=S.useCallback(()=>{const E=new Blob([JSON.stringify(i,null,2)],{type:"application/json"}),A=URL.createObjectURL(E),N=document.createElement("a");N.href=A,N.download=`label-template-${i.id}.json`,N.click(),URL.revokeObjectURL(A)},[i]);return d.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[d.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-gray-200 bg-white shrink-0",children:[d.jsxs(we,{variant:"outline",size:"sm",onClick:r,children:[d.jsx(T8,{className:"w-4 h-4 mr-1"}),"Back"]}),d.jsx("span",{className:"text-sm font-medium text-gray-700 truncate flex-1",children:i.name}),d.jsxs(we,{size:"sm",onClick:O,variant:"outline",children:[d.jsx(Ww,{className:"w-4 h-4 mr-1"}),"Export JSON"]}),d.jsxs(we,{size:"sm",className:"bg-blue-600 hover:bg-blue-700 text-white",onClick:j,children:[d.jsx(jF,{className:"w-4 h-4 mr-1"}),"Save"]})]}),d.jsxs("div",{className:"flex flex-1 min-h-0",children:[d.jsx(Rse,{onAddElement:g}),d.jsx(Cle,{template:i,selectedId:s,onSelect:u,onUpdateElement:b,onDeleteElement:y,onTemplateChange:w,scale:f,onZoomIn:()=>l(E=>Math.min(Hle,E+rM)),onZoomOut:()=>l(E=>Math.max(Wle,E-rM)),onPreview:()=>p(!0)}),d.jsx(_r,{open:h,onOpenChange:p,children:d.jsxs(dr,{className:"max-w-[90vw] max-h-[90vh] overflow-auto",children:[d.jsx(jr,{children:d.jsx(Or,{children:"标签预览"})}),d.jsx(Tle,{template:i,maxWidth:500})]})}),d.jsx(qle,{template:i,selectedElement:m,onTemplateChange:w,onElementChange:b,onDeleteElement:y})]})]})}function Kle(){const[e,t]=S.useState(()=>Jk()),[r,n]=S.useState("list"),[i,o]=S.useState(null),[s,u]=S.useState(""),[f,l]=S.useState("all"),h=S.useCallback(()=>{t(Jk())},[]);S.useEffect(()=>{r==="list"&&h()},[r,h]);const p=e.filter(y=>{const w=!s||y.name.toLowerCase().includes(s.toLowerCase()),j=f==="all"||y.appliedLocation===f;return w&&j}),m=()=>{},g=y=>{o(y),n("editor")},b=()=>{n("list"),o(null)};if(r==="editor"){const y=i?N3(i):null;return d.jsx("div",{className:"h-[calc(100vh-8rem)] min-h-[500px] flex flex-col",children:d.jsx(Gle,{templateId:i,initialTemplate:y,onClose:b,onSaved:h})})}return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex flex-nowrap items-center gap-3",children:[d.jsx(Se,{placeholder:"Search",style:{height:40,boxSizing:"border-box"},className:"bg-white border border-gray-300 rounded-md w-40 shrink-0 placeholder:text-gray-500",value:s,onChange:y=>u(y.target.value)}),d.jsxs(Je,{value:f,onValueChange:l,children:[d.jsx(tt,{className:"bg-white border border-gray-300 rounded-md w-[200px] shrink-0",style:{height:40,boxSizing:"border-box"},children:d.jsx(et,{placeholder:"Location"})}),d.jsxs(rt,{children:[d.jsx(Ee,{value:"all",children:"All Locations"}),d.jsx(Ee,{value:"ALL",children:"ALL"}),d.jsx(Ee,{value:"loc-a",children:"Location A"}),d.jsx(Ee,{value:"loc-b",children:"Location B"})]})]}),d.jsxs(we,{className:"bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-md h-10 px-6 shrink-0 ml-auto",onClick:m,children:["New Label Template ",d.jsx(Rr,{className:"ml-1 w-4 h-4"})]})]}),d.jsxs("div",{className:"text-red-600 font-bold italic text-sm md:text-base",children:["***One or more templates have incomplete labels attached to them.",d.jsx("br",{}),"Go to Labels view to see which labels are missing fields."]}),d.jsx("div",{className:"rounded-md border bg-white shadow-sm",children:d.jsxs(br,{children:[d.jsx(wr,{children:d.jsxs(Ge,{className:"bg-gray-50 hover:bg-gray-50",children:[d.jsx(ye,{className:"font-bold text-gray-900 w-[180px]",children:"Label Template"}),d.jsx(ye,{className:"font-bold text-gray-900 w-[120px]",children:"Location"}),d.jsx(ye,{className:"font-bold text-gray-900",children:"Contents"}),d.jsx(ye,{className:"font-bold text-gray-900 w-[150px]",children:"Size"}),d.jsx(ye,{className:"font-bold text-gray-900 w-[100px]",children:"Actions"})]})}),d.jsx(Sr,{children:p.length===0?d.jsx(Ge,{children:d.jsx(ue,{colSpan:5,className:"text-center text-gray-500 py-8",children:'No templates yet. Click "New Label Template" to create one.'})}):p.map(y=>d.jsxs(Ge,{className:"hover:bg-gray-50 cursor-pointer",onClick:()=>g(y.id),children:[d.jsx(ue,{className:"font-medium",children:y.name}),d.jsx(ue,{children:y.appliedLocation}),d.jsxs(ue,{className:"text-sm text-gray-600",children:[y.elements.length," element(s)"]}),d.jsxs(ue,{children:[y.width,"×",y.height," ",y.unit]}),d.jsx(ue,{onClick:w=>w.stopPropagation(),children:d.jsxs(we,{variant:"outline",size:"sm",onClick:()=>g(y.id),children:[d.jsx(eh,{className:"w-3 h-3 mr-1"}),"Edit"]})})]},y.id))})]})})]})}function Xle(){const e=[{id:1,name:"Prepped By",contents:"A. Smith; B. Doe; C. Borne",lastEdited:"2025.12.03.11:45"},{id:2,name:"Checked By",contents:"D. Manager; E. Supervisor",lastEdited:"2025.12.04.09:30"},{id:3,name:"Allergens",contents:"Peanuts; Dairy; Gluten; Soy",lastEdited:"2025.12.05.14:15"}];return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex flex-nowrap items-center gap-3",children:[d.jsx(Se,{placeholder:"Search",style:{height:40,boxSizing:"border-box"},className:"bg-white border border-gray-300 rounded-md w-40 shrink-0 placeholder:text-gray-500"}),d.jsxs(Je,{defaultValue:"all",children:[d.jsx(tt,{className:"bg-white border border-gray-300 rounded-md w-[200px] shrink-0",style:{height:40,boxSizing:"border-box"},children:d.jsx(et,{placeholder:"Location"})}),d.jsxs(rt,{children:[d.jsx(Ee,{value:"all",children:"All Locations"}),d.jsx(Ee,{value:"loc-a",children:"Location A"}),d.jsx(Ee,{value:"loc-b",children:"Location B"})]})]}),d.jsxs(we,{className:"bg-blue-600 hover:bg-blue-700 text-white font-medium rounded-md h-10 px-6 shrink-0 ml-auto",children:["New Multiple Options ",d.jsx(Rr,{className:"ml-1 h-4 w-4"})]})]}),d.jsx("div",{className:"rounded-md border bg-white shadow-sm",children:d.jsxs(br,{children:[d.jsx(wr,{children:d.jsxs(Ge,{className:"bg-gray-50 hover:bg-gray-50",children:[d.jsx(ye,{className:"font-bold text-gray-900 w-[200px]",children:"Multiple Option Name"}),d.jsx(ye,{className:"font-bold text-gray-900",children:"Contents"}),d.jsx(ye,{className:"font-bold text-gray-900 w-[180px]",children:"Last Edited"})]})}),d.jsx(Sr,{children:e.map(t=>d.jsxs(Ge,{className:"hover:bg-gray-50",children:[d.jsx(ue,{className:"font-medium",children:t.name}),d.jsx(ue,{className:"text-gray-600",children:t.contents}),d.jsx(ue,{className:"text-gray-500 tabular-nums font-numeric",children:t.lastEdited})]},t.id))})]})})]})}function Yle({currentView:e="Labels",onViewChange:t}){const r=["Labels","Label Categories","Label Types","Label Templates","Multiple Options"],n=i=>{t&&t(i)};return d.jsxs("div",{className:"space-y-6",children:[d.jsx("div",{className:"w-full border-b border-gray-200",children:d.jsx("div",{className:"flex overflow-x-auto bg-white",children:r.map(i=>d.jsx("div",{onClick:()=>n(i),style:e===i?{borderBottomWidth:2,borderBottomStyle:"solid",borderBottomColor:"#2563eb"}:void 0,className:`px-4 py-2.5 text-sm font-medium whitespace-nowrap cursor-pointer transition-colors -mb-px ${e===i?"text-blue-600":"border-b-2 border-b-transparent text-gray-600 hover:text-gray-800"}`,children:i},i))})}),d.jsxs("div",{className:"min-h-[400px]",children:[e==="Labels"&&d.jsx(Qae,{}),e==="Label Categories"&&d.jsx(Zae,{}),e==="Label Types"&&d.jsx(Jae,{}),e==="Label Templates"&&d.jsx(Kle,{}),e==="Multiple Options"&&d.jsx(Xle,{}),!["Labels","Label Categories","Label Types","Label Templates","Multiple Options"].includes(e)&&d.jsxs("div",{className:"flex items-center justify-center h-64 text-gray-400",children:[e," content coming soon..."]})]})]})}function Qle(){const[e,t]=S.useState([{id:"1",name:"Pop",isOpen:!0,subcategories:[{id:"1-1",name:"2024",isOpen:!0,files:[{id:"f1",name:"uuuuu",date:"10/23/24, 12:21 AM",type:"image"},{id:"f2",name:"664EF167-DFCE-49C1-A417-DC09FEDF78D7.jpg",date:"11/24/25, 8:40 PM",type:"image"}]}]},{id:"2",name:"Training",isOpen:!0,subcategories:[{id:"2-1",name:"BOH",isOpen:!1,files:[]},{id:"2-2",name:"FOH",isOpen:!0,files:[]}]},{id:"3",name:"ww",isOpen:!1,subcategories:[]}]),r=i=>{t(o=>o.map(s=>s.id===i?{...s,isOpen:!s.isOpen}:s))},n=(i,o)=>{t(s=>s.map(u=>u.id!==i?u:{...u,subcategories:u.subcategories.map(f=>f.id===o?{...f,isOpen:!f.isOpen}:f)}))};return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 items-start sm:items-center",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(Se,{className:"bg-white border border-black rounded-md h-10 w-[150px]"}),d.jsx("span",{className:"text-sm text-black whitespace-nowrap",children:"Search"})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs(Je,{defaultValue:"all",children:[d.jsx(tt,{className:"bg-white border border-black rounded-md h-10 w-[100px]",children:d.jsx(et,{placeholder:"Location"})}),d.jsxs(rt,{children:[d.jsx(Ee,{value:"all",children:"all"}),d.jsx(Ee,{value:"loc-a",children:"Location A"})]})]}),d.jsx("span",{className:"text-sm text-black whitespace-nowrap",children:"Location"})]})]}),d.jsxs("div",{className:"bg-gray-100 p-2 flex justify-between items-center border-b border-gray-200",children:[d.jsx("h1",{className:"text-xl font-medium text-gray-700",children:"Information"}),d.jsxs("div",{className:"flex items-center gap-4 text-gray-600",children:[d.jsx("div",{className:"flex items-center gap-1 bg-gray-700 text-white text-[10px] px-1 py-0.5 rounded-sm font-bold",children:"NEW"}),d.jsx(TF,{className:"h-5 w-5"}),d.jsx("span",{className:"font-medium",children:"55789"})]})]}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("button",{className:"w-full bg-[#2c7bb6] hover:bg-[#256b9e] text-white py-2 px-4 flex items-center gap-2 text-sm font-medium rounded-sm",children:[d.jsx(Rr,{className:"h-4 w-4"}),"New Category",d.jsx(oh,{className:"h-4 w-4 opacity-70"})]}),d.jsx("div",{className:"space-y-4",children:e.map(i=>d.jsxs("div",{className:"border border-gray-300 rounded-sm overflow-hidden",children:[d.jsxs("div",{className:"bg-gradient-to-b from-gray-50 to-gray-100 border-b border-gray-200 p-2 flex items-center justify-between",children:[d.jsxs("button",{onClick:()=>r(i.id),className:"flex items-center gap-2 text-gray-700 font-medium text-sm flex-1 text-left",children:[i.isOpen?d.jsx(xs,{className:"h-4 w-4 text-[#2c7bb6]"}):d.jsx(bs,{className:"h-4 w-4 text-[#2c7bb6]"}),i.name]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{className:"text-gray-400 hover:text-gray-600",children:d.jsx(eh,{className:"h-4 w-4"})}),d.jsx("button",{className:"text-red-400 hover:text-red-600",children:d.jsx(xc,{className:"h-4 w-4"})})]})]}),i.isOpen&&d.jsxs("div",{className:"p-2 space-y-3 bg-white",children:[d.jsxs("button",{className:"w-full bg-[#2c7bb6] hover:bg-[#256b9e] text-white py-2 px-4 flex items-center gap-2 text-sm font-medium rounded-sm",children:[d.jsx(Rr,{className:"h-4 w-4"}),"New Subcategory",d.jsx(oh,{className:"h-4 w-4 opacity-70"})]}),d.jsxs("div",{className:"space-y-3",children:[i.subcategories.map(o=>d.jsxs("div",{className:"border border-gray-200 rounded-sm",children:[d.jsxs("div",{className:"bg-white border-b border-gray-200 p-2 flex items-center justify-between",children:[d.jsxs("button",{onClick:()=>n(i.id,o.id),className:"flex items-center gap-2 text-gray-700 font-medium text-sm flex-1 text-left",children:[o.isOpen?d.jsx(xs,{className:"h-4 w-4 text-[#2c7bb6]"}):d.jsx(bs,{className:"h-4 w-4 text-[#2c7bb6]"}),o.name]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("button",{className:"text-gray-400 hover:text-gray-600",children:d.jsx(eh,{className:"h-4 w-4"})}),d.jsx("button",{className:"text-red-400 hover:text-red-600",children:d.jsx(xc,{className:"h-4 w-4"})})]})]}),o.isOpen&&d.jsxs("div",{className:"p-3 bg-gray-50/50",children:[d.jsx("div",{className:"mb-2 text-xs font-bold text-gray-500 uppercase tracking-wide",children:"Files"}),d.jsxs("div",{className:"flex flex-wrap gap-2 mb-3 justify-end",children:[d.jsx(we,{size:"sm",className:"h-8 bg-[#4CAF50] hover:bg-[#43a047] text-white text-xs border-none rounded-sm",children:"Upload Your Own File(s)"}),d.jsx(we,{size:"sm",className:"h-8 bg-[#4CAF50] hover:bg-[#43a047] text-white text-xs border-none rounded-sm",children:"Create A Custom File"}),d.jsx(we,{size:"sm",className:"h-8 bg-[#2c7bb6] hover:bg-[#256b9e] text-white text-xs border-none rounded-sm",children:"Edit File Permissions"}),d.jsxs(we,{size:"sm",className:"h-8 bg-[#2c7bb6] hover:bg-[#256b9e] text-white text-xs border-none rounded-sm gap-1",children:["Sort (A-Z) ",d.jsx(R8,{className:"h-3 w-3"})]})]}),d.jsx("div",{className:"space-y-1",children:o.files.length>0?o.files.map(s=>d.jsxs("div",{className:"flex items-center bg-gray-200/50 p-2 border border-gray-200 rounded-sm text-sm hover:bg-gray-200 transition-colors",children:[d.jsx("div",{className:"flex-shrink-0 mr-3",children:s.type==="image"?d.jsx(Jo,{className:"h-5 w-5 text-[#2c7bb6]"}):d.jsx(ws,{className:"h-5 w-5 text-[#2c7bb6]"})}),d.jsx("div",{className:"flex-1 min-w-0",children:d.jsx("div",{className:"font-medium text-gray-700 truncate",children:s.name})}),d.jsx("div",{className:"text-xs text-gray-500 mr-4 whitespace-nowrap",children:s.date}),d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx("button",{className:"p-1 text-gray-400 hover:text-gray-600 bg-white border border-gray-300 rounded-sm",children:d.jsx(ws,{className:"h-3 w-3"})}),d.jsx("button",{className:"p-1 text-gray-400 hover:text-gray-600 bg-white border border-gray-300 rounded-sm",children:d.jsx(eh,{className:"h-3 w-3"})}),d.jsx("button",{className:"p-1 text-red-400 hover:text-red-600 bg-white border border-gray-300 rounded-sm",children:d.jsx(xc,{className:"h-3 w-3"})})]})]},s.id)):d.jsx("div",{className:"p-4 border-2 border-dashed border-gray-300 rounded-sm text-center text-gray-400 text-sm",children:"No files in this subcategory"})})]})]},o.id)),i.subcategories.length===0&&d.jsx("div",{className:"p-2 text-sm text-gray-400 italic",children:"No subcategories"})]})]})]},i.id))})]})]})}const Zle=[{id:1,title:"Coffee - 2 hrs",subtitle:"1 min - Completes at 12:05 PM",totalTime:7200,remainingTime:0,status:"expired",icon:Q8},{id:2,title:"Clean Tablet",subtitle:"1 hrs - Completes at 12:37 PM",totalTime:3600,remainingTime:237,status:"running",icon:MF},{id:3,title:"Replace Sanitizer Towels",subtitle:"1 hrs - Completes at 12:37 PM",totalTime:3600,remainingTime:238,status:"running",icon:Nc},{id:4,title:"Take Out Trash",subtitle:"1 hrs - Completes at 01:03 PM",totalTime:3600,remainingTime:58,status:"running",icon:Nc},{id:5,title:"Change Utensils",subtitle:"1 hrs - Completes at 01:03 PM",totalTime:3600,remainingTime:58,status:"running",icon:KF},{id:6,title:"Sanitize Surfaces",subtitle:"1 hrs - Completes at 02:00 PM",totalTime:3600,remainingTime:2157,status:"running",icon:Ag},{id:7,title:"Check Temperatures",subtitle:"1 hrs - Completes at 02:00 PM",totalTime:3600,remainingTime:2158,status:"running",icon:Ag},{id:8,title:"Ranch 4 hrs",subtitle:"4 hrs - Completes at 04:04 PM",totalTime:14400,remainingTime:2158,status:"running",icon:Ag}];function Jle({timer:e}){const t=(e.totalTime-e.remainingTime)/e.totalTime*100,r=e.remainingTime===0,n=i=>{if(i<=0)return"0s";const o=Math.floor(i/60),s=i%60;return`${o.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}`};return d.jsxs("div",{className:"bg-gray-200 rounded-xl p-4 flex flex-col items-center relative shadow-sm h-[280px]",children:[d.jsxs("div",{className:"text-center mb-2",children:[d.jsx("h3",{className:"text-lg font-medium text-gray-800 leading-tight",children:e.title}),d.jsx("p",{className:"text-xs text-gray-500 mt-1",children:e.subtitle})]}),d.jsxs("div",{className:"relative w-32 h-32 my-auto flex items-center justify-center",children:[d.jsxs("svg",{className:"w-full h-full transform -rotate-90",children:[d.jsx("circle",{cx:"64",cy:"64",r:"56",stroke:"white",strokeWidth:"12",fill:"transparent"}),d.jsx("circle",{cx:"64",cy:"64",r:"56",stroke:r?"#ef4444":"#3b82f6",strokeWidth:"12",fill:"transparent",strokeDasharray:351.86,strokeDashoffset:r?0:351.86*(t/100),className:"transition-all duration-1000 ease-linear"})]}),d.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[d.jsx("span",{className:Re("text-3xl font-bold",r?"text-red-500":"text-gray-800"),children:r?"0s":n(e.remainingTime)}),d.jsx("span",{className:Re("text-[10px] font-medium uppercase mt-1",r?"text-red-400":"text-gray-400"),children:"Remaining"})]})]}),d.jsxs("div",{className:"w-full flex justify-between items-end mt-2",children:[d.jsx(yF,{className:"w-5 h-5 text-blue-700 fill-current"}),d.jsx("div",{className:"flex flex-col items-center",children:d.jsx("div",{className:"w-10 h-10 rounded-full border-2 border-gray-300 flex items-center justify-center text-gray-400 mb-1",children:d.jsx(e.icon,{className:"w-5 h-5"})})}),d.jsx("div",{className:"flex flex-col items-end",children:d.jsx("span",{className:"text-xs text-blue-600 font-bold mb-2 cursor-pointer",children:"EDIT"})})]}),d.jsx("button",{className:"absolute bottom-12 right-4 bg-blue-600 rounded-full p-1 text-white hover:bg-blue-700 shadow-md",children:d.jsx(xc,{className:"w-4 h-4"})})]})}function ece(){const[e,t]=S.useState(!0);return d.jsxs("div",{className:"h-full flex flex-col bg-gray-50 relative",children:[d.jsxs("div",{className:"bg-white border-b border-gray-200 px-4 py-3 flex items-center justify-between shadow-sm z-10",children:[d.jsxs("div",{className:"flex items-center gap-4",children:[d.jsxs("button",{className:"flex items-center text-blue-500 text-lg font-medium",children:[d.jsx(uM,{className:"w-6 h-6"}),"Back"]}),d.jsx(hF,{className:"w-6 h-6 text-gray-500"})]}),d.jsxs("div",{className:"flex flex-col items-center",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("div",{className:"bg-blue-600 p-1.5 rounded-md",children:d.jsx(LF,{className:"w-5 h-5 text-white"})}),d.jsx("h1",{className:"text-xl font-bold text-blue-900",children:"Timers"})]}),d.jsxs("div",{className:"flex items-center gap-1 text-xs text-green-600 font-medium",children:[d.jsx("span",{children:"86016"}),d.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full"})]})]}),d.jsxs("div",{className:"flex items-center gap-4 text-blue-500 font-medium",children:[d.jsx(HF,{className:"w-6 h-6 text-gray-400"}),d.jsxs("button",{className:"flex items-center gap-1",children:[d.jsx(Rr,{className:"w-5 h-5"}),"Add Timer"]})]})]}),d.jsxs("div",{className:"bg-gray-700 text-white px-6 py-2 flex items-center justify-between",children:[d.jsx("div",{className:"flex-1"})," ",d.jsx("div",{className:"font-medium",children:"Today, December 15"}),d.jsxs("div",{className:"flex-1 flex justify-end items-center gap-4",children:[d.jsxs("div",{className:"flex items-center gap-1",children:[d.jsx(nF,{className:"w-5 h-5 text-gray-300"}),d.jsx(lF,{className:"w-5 h-5 text-gray-500"})]}),d.jsx(P8,{className:"w-5 h-5 text-blue-400"})]})]}),d.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:d.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:Zle.map(r=>d.jsx(Jle,{timer:r},r.id))})}),e&&d.jsx("div",{className:"absolute inset-0 z-50 flex items-center justify-center bg-black/40 backdrop-blur-[1px]",children:d.jsx("div",{className:"bg-black text-white rounded-xl shadow-2xl w-[600px] max-w-full overflow-hidden border border-gray-800",children:d.jsxs("div",{className:"p-8 text-center space-y-6",children:[d.jsx("h2",{className:"text-3xl font-medium text-blue-500",children:"Coffee - 2 hrs"}),d.jsxs("div",{className:"space-y-4 py-4",children:[d.jsx("p",{className:"text-2xl font-light",children:"Timer expired at 12:05 PM"}),d.jsx("p",{className:"text-2xl font-light",children:"Please discard the coffee"})]}),d.jsx("div",{className:"flex justify-end",children:d.jsx("span",{className:"bg-gray-200 text-black text-[10px] px-1 rounded-sm opacity-50",children:"TACT_Img_Timer-Notification@2x"})}),d.jsxs("div",{className:"grid grid-cols-3 gap-4 mt-8",children:[d.jsx(we,{onClick:()=>t(!1),className:"bg-blue-700 hover:bg-blue-600 text-white h-14 text-xl font-medium rounded-lg",children:"Mute"}),d.jsx(we,{onClick:()=>t(!1),className:"bg-blue-600 hover:bg-blue-500 text-white h-14 text-xl font-medium rounded-lg",children:"Restart"}),d.jsx(we,{onClick:()=>t(!1),className:"bg-blue-800 hover:bg-blue-700 text-white h-14 text-xl font-medium rounded-lg",children:"Acknowledge"})]})]})})})]})}var Kb="rovingFocusGroup.onEntryFocus",tce={bubbles:!1,cancelable:!0},Tu="RovingFocusGroup",[Mw,y4,rce]=y$(Tu),[nce,x4]=Bn(Tu,[rce]),[ice,oce]=nce(Tu),b4=S.forwardRef((e,t)=>d.jsx(Mw.Provider,{scope:e.__scopeRovingFocusGroup,children:d.jsx(Mw.Slot,{scope:e.__scopeRovingFocusGroup,children:d.jsx(ace,{...e,ref:t})})}));b4.displayName=Tu;var ace=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,orientation:n,loop:i=!1,dir:o,currentTabStopId:s,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:f,onEntryFocus:l,preventScrollOnEntryFocus:h=!1,...p}=e,m=S.useRef(null),g=Ze(t,m),b=Ep(o),[y,w]=Mi({prop:s,defaultProp:u??null,onChange:f,caller:Tu}),[j,O]=S.useState(!1),E=fr(l),A=y4(r),N=S.useRef(!1),[C,T]=S.useState(0);return S.useEffect(()=>{const R=m.current;if(R)return R.addEventListener(Kb,E),()=>R.removeEventListener(Kb,E)},[E]),d.jsx(ice,{scope:r,orientation:n,dir:b,loop:i,currentTabStopId:y,onItemFocus:S.useCallback(R=>w(R),[w]),onItemShiftTab:S.useCallback(()=>O(!0),[]),onFocusableItemAdd:S.useCallback(()=>T(R=>R+1),[]),onFocusableItemRemove:S.useCallback(()=>T(R=>R-1),[]),children:d.jsx(Ue.div,{tabIndex:j||C===0?-1:0,"data-orientation":n,...p,ref:g,style:{outline:"none",...e.style},onMouseDown:Ie(e.onMouseDown,()=>{N.current=!0}),onFocus:Ie(e.onFocus,R=>{const I=!N.current;if(R.target===R.currentTarget&&I&&!j){const F=new CustomEvent(Kb,tce);if(R.currentTarget.dispatchEvent(F),!F.defaultPrevented){const L=A().filter(H=>H.focusable),$=L.find(H=>H.active),U=L.find(H=>H.id===y),q=[$,U,...L].filter(Boolean).map(H=>H.ref.current);_4(q,h)}}N.current=!1}),onBlur:Ie(e.onBlur,()=>O(!1))})})}),w4="RovingFocusGroupItem",S4=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:r,focusable:n=!0,active:i=!1,tabStopId:o,children:s,...u}=e,f=Jn(),l=o||f,h=oce(w4,r),p=h.currentTabStopId===l,m=y4(r),{onFocusableItemAdd:g,onFocusableItemRemove:b,currentTabStopId:y}=h;return S.useEffect(()=>{if(n)return g(),()=>b()},[n,g,b]),d.jsx(Mw.ItemSlot,{scope:r,id:l,focusable:n,active:i,children:d.jsx(Ue.span,{tabIndex:p?0:-1,"data-orientation":h.orientation,...u,ref:t,onMouseDown:Ie(e.onMouseDown,w=>{n?h.onItemFocus(l):w.preventDefault()}),onFocus:Ie(e.onFocus,()=>h.onItemFocus(l)),onKeyDown:Ie(e.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){h.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const j=cce(w,h.orientation,h.dir);if(j!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let E=m().filter(A=>A.focusable).map(A=>A.ref.current);if(j==="last")E.reverse();else if(j==="prev"||j==="next"){j==="prev"&&E.reverse();const A=E.indexOf(w.currentTarget);E=h.loop?uce(E,A+1):E.slice(A+1)}setTimeout(()=>_4(E))}}),children:typeof s=="function"?s({isCurrentTabStop:p,hasTabStop:y!=null}):s})})});S4.displayName=w4;var sce={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function lce(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function cce(e,t,r){const n=lce(e.key,r);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return sce[n]}function _4(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}function uce(e,t){return e.map((r,n)=>e[(t+n)%e.length])}var fce=b4,dce=S4,Nm="Tabs",[hce]=Bn(Nm,[x4]),j4=x4(),[pce,j_]=hce(Nm),O4=S.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:i,defaultValue:o,orientation:s="horizontal",dir:u,activationMode:f="automatic",...l}=e,h=Ep(u),[p,m]=Mi({prop:n,onChange:i,defaultProp:o??"",caller:Nm});return d.jsx(pce,{scope:r,baseId:Jn(),value:p,onValueChange:m,orientation:s,dir:h,activationMode:f,children:d.jsx(Ue.div,{dir:h,"data-orientation":s,...l,ref:t})})});O4.displayName=Nm;var E4="TabsList",P4=S.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...i}=e,o=j_(E4,r),s=j4(r);return d.jsx(fce,{asChild:!0,...s,orientation:o.orientation,dir:o.dir,loop:n,children:d.jsx(Ue.div,{role:"tablist","aria-orientation":o.orientation,...i,ref:t})})});P4.displayName=E4;var N4="TabsTrigger",A4=S.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:i=!1,...o}=e,s=j_(N4,r),u=j4(r),f=k4(s.baseId,n),l=R4(s.baseId,n),h=n===s.value;return d.jsx(dce,{asChild:!0,...u,focusable:!i,active:h,children:d.jsx(Ue.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":l,"data-state":h?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:f,...o,ref:t,onMouseDown:Ie(e.onMouseDown,p=>{!i&&p.button===0&&p.ctrlKey===!1?s.onValueChange(n):p.preventDefault()}),onKeyDown:Ie(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&s.onValueChange(n)}),onFocus:Ie(e.onFocus,()=>{const p=s.activationMode!=="manual";!h&&!i&&p&&s.onValueChange(n)})})})});A4.displayName=N4;var C4="TabsContent",T4=S.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,forceMount:i,children:o,...s}=e,u=j_(C4,r),f=k4(u.baseId,n),l=R4(u.baseId,n),h=n===u.value,p=S.useRef(h);return S.useEffect(()=>{const m=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(m)},[]),d.jsx(Mr,{present:i||h,children:({present:m})=>d.jsx(Ue.div,{"data-state":h?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":f,hidden:!m,id:l,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:m&&o})})});T4.displayName=C4;function k4(e,t){return`${e}-trigger-${t}`}function R4(e,t){return`${e}-content-${t}`}var mce=O4,vce=P4,gce=A4,yce=T4;function M4({className:e,...t}){return d.jsx(mce,{"data-slot":"tabs",className:Re("flex flex-col gap-2",e),...t})}function I4({className:e,...t}){return d.jsx(vce,{"data-slot":"tabs-list",className:Re("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-xl p-[3px] flex",e),...t})}function gs({className:e,...t}){return d.jsx(gce,{"data-slot":"tabs-trigger",className:Re("data-[state=active]:bg-card dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-xl border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...t})}function ys({className:e,...t}){return d.jsx(yce,{"data-slot":"tabs-content",className:Re("flex-1 outline-none",e),...t})}const xce=[{id:"cat1",name:"Dairy",type:"color",value:"#bfdbfe",status:"active"},{id:"cat2",name:"Meat",type:"image",value:"meat.png",status:"active"},{id:"cat3",name:"Bakery",type:"text",value:"Bakery",status:"active"}],bce=[{id:"prod1",locationId:"12345",categoryId:"cat1",categoryName:"Dairy",name:"Whole Milk",productId:"2222222",barcode:"123456789",barcodeType:"EAN-13",status:"active",appearance:{type:"text",value:"Whole Milk"}},{id:"prod2",locationId:"12345",categoryId:"cat2",categoryName:"Meat",name:"Ground Beef",productId:"3333333",barcode:"113456789",barcodeType:"UPC-A",status:"active",appearance:{type:"color",value:"#ef4444"}},{id:"prod3",locationId:"67890",categoryId:"cat3",categoryName:"Bakery",name:"Croissant",productId:"4444444",barcode:"998877665",barcodeType:"EAN-8",status:"inactive",appearance:{type:"image",value:"croissant.jpg"}}];function wce(){const[e,t]=S.useState("products"),[r,n]=S.useState(bce),[i,o]=S.useState(xce),[s,u]=S.useState(!1),[f,l]=S.useState(!1);return d.jsxs("div",{className:"h-full flex flex-col",children:[d.jsxs("div",{className:"pb-4",children:[d.jsxs("div",{className:"flex flex-nowrap items-center gap-3 flex-wrap",children:[d.jsxs("div",{className:"flex items-center w-40 shrink-0 rounded-md border border-gray-300 bg-white overflow-hidden",style:{height:40},children:[d.jsx(Vw,{className:"h-4 w-4 text-gray-400 shrink-0 ml-2.5 pointer-events-none"}),d.jsx(Se,{placeholder:"Search...",className:"flex-1 min-w-0 border-0 bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0 py-2 px-2 h-full placeholder:text-gray-500"})]}),d.jsxs(Je,{defaultValue:"partner-a",children:[d.jsx(tt,{className:"w-[140px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:d.jsx(et,{placeholder:"Partner"})}),d.jsx(rt,{children:d.jsx(Ee,{value:"partner-a",children:"Partner A"})})]}),d.jsxs(Je,{defaultValue:"group-b",children:[d.jsx(tt,{className:"w-[140px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:d.jsx(et,{placeholder:"Group"})}),d.jsx(rt,{children:d.jsx(Ee,{value:"group-b",children:"Group B"})})]}),d.jsxs(Je,{defaultValue:"loc-12345",children:[d.jsx(tt,{className:"w-[160px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:d.jsx(et,{placeholder:"Location"})}),d.jsxs(rt,{children:[d.jsx(Ee,{value:"loc-12345",children:"Location 12345"}),d.jsx(Ee,{value:"all",children:"All Locations"})]})]}),d.jsxs(Je,{children:[d.jsx(tt,{className:"w-[140px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:d.jsx(et,{placeholder:"Category"})}),d.jsxs(rt,{children:[d.jsx(Ee,{value:"all",children:"All Categories"}),i.map(h=>d.jsx(Ee,{value:h.id,children:h.name},h.id))]})]}),d.jsx("div",{className:"flex-1 min-w-2"}),d.jsxs(we,{variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 bg-white hover:bg-gray-50 gap-2 shrink-0",children:[d.jsx(UF,{className:"w-4 h-4"})," Bulk Import"]}),d.jsxs(we,{variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 bg-white hover:bg-gray-50 gap-2 shrink-0",children:[d.jsx(Ww,{className:"w-4 h-4"})," Bulk Export"]}),d.jsxs(we,{variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 bg-white hover:bg-gray-50 gap-2 shrink-0",children:[d.jsx(co,{className:"w-4 h-4"})," Bulk Edit"]}),e==="products"?d.jsxs(we,{className:"h-10 rounded-md bg-blue-600 text-white hover:bg-blue-700 font-medium gap-1 shrink-0",onClick:()=>u(!0),children:["New Product ",d.jsx(Rr,{className:"w-4 h-4"})]}):d.jsxs(we,{className:"h-10 rounded-md bg-blue-600 text-white hover:bg-blue-700 font-medium gap-1 shrink-0",onClick:()=>l(!0),children:["New Category ",d.jsx(Rr,{className:"w-4 h-4"})]})]}),d.jsx("div",{className:"w-full border-b border-gray-200 mt-4",children:d.jsxs("div",{className:"flex overflow-x-auto w-fit",children:[d.jsx("button",{onClick:()=>t("products"),style:e==="products"?{borderBottomWidth:2,borderBottomStyle:"solid",borderBottomColor:"#2563eb"}:void 0,className:`px-4 py-2.5 text-sm font-medium whitespace-nowrap cursor-pointer transition-colors -mb-px border-b-2 ${e==="products"?"text-blue-600":"border-b-transparent text-gray-600 hover:text-gray-800"}`,children:"Products"}),d.jsx("button",{onClick:()=>t("categories"),style:e==="categories"?{borderBottomWidth:2,borderBottomStyle:"solid",borderBottomColor:"#2563eb"}:void 0,className:`px-4 py-2.5 text-sm font-medium whitespace-nowrap cursor-pointer transition-colors -mb-px border-b-2 ${e==="categories"?"text-blue-600":"border-b-transparent text-gray-600 hover:text-gray-800"}`,children:"Categories"})]})})]}),d.jsx("div",{className:"flex-1 overflow-auto pt-6",children:e==="products"?d.jsx("div",{className:"bg-white border border-gray-200 shadow-sm rounded-md overflow-hidden",children:d.jsxs(br,{children:[d.jsx(wr,{children:d.jsxs(Ge,{className:"bg-gray-100 hover:bg-gray-100",children:[d.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"Location ID"}),d.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"Product Category"}),d.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"Product"}),d.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"Product ID"}),d.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"Product Barcode"}),d.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"Status"}),d.jsx(ye,{className:"text-gray-900 font-bold text-center",children:"Actions"})]})}),d.jsx(Sr,{children:r.map(h=>d.jsxs(Ge,{children:[d.jsx(ue,{className:"border-r font-numeric",children:h.locationId}),d.jsx(ue,{className:"border-r text-gray-900 font-medium",children:h.categoryName}),d.jsx(ue,{className:"border-r text-gray-900 font-medium",children:d.jsxs("div",{className:"flex items-center gap-2",children:[h.appearance.type==="color"&&d.jsx("div",{className:"w-4 h-4 rounded-full border border-gray-300 shadow-sm",style:{backgroundColor:h.appearance.value}}),h.appearance.type==="image"&&d.jsx(Jo,{className:"w-4 h-4 text-gray-500"}),h.name]})}),d.jsx(ue,{className:"border-r font-numeric text-gray-600",children:h.productId}),d.jsx(ue,{className:"border-r font-numeric",children:d.jsxs("div",{className:"flex flex-col",children:[d.jsx("span",{className:"text-xs text-gray-400",children:h.barcodeType}),d.jsx("span",{children:h.barcode})]})}),d.jsx(ue,{className:"border-r",children:d.jsx(Gn,{variant:h.status==="active"?"default":"secondary",className:h.status==="active"?"bg-green-600":"bg-gray-400",children:h.status})}),d.jsx(ue,{className:"text-center",children:d.jsx(we,{variant:"ghost",size:"icon",className:"h-8 w-8",children:d.jsx(Hw,{className:"h-4 w-4"})})})]},h.id))})]})}):d.jsx("div",{className:"bg-white border border-gray-200 shadow-sm rounded-md overflow-hidden",children:d.jsxs(br,{children:[d.jsx(wr,{children:d.jsxs(Ge,{className:"bg-gray-100 hover:bg-gray-100",children:[d.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"Category Name"}),d.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"Display Type"}),d.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"Preview"}),d.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"Status"}),d.jsx(ye,{className:"text-gray-900 font-bold text-center",children:"Actions"})]})}),d.jsx(Sr,{children:i.map(h=>d.jsxs(Ge,{children:[d.jsx(ue,{className:"border-r font-medium",children:h.name}),d.jsx(ue,{className:"border-r capitalize",children:h.type}),d.jsxs(ue,{className:"border-r",children:[h.type==="color"&&d.jsx("div",{className:"w-8 h-8 rounded-md border border-gray-200 shadow-sm",style:{backgroundColor:h.value}}),h.type==="image"&&d.jsx("div",{className:"w-8 h-8 bg-gray-100 flex items-center justify-center rounded-md border border-gray-200",children:d.jsx(Jo,{className:"w-4 h-4 text-gray-500"})}),h.type==="text"&&d.jsx("div",{className:"w-auto px-2 py-1 bg-gray-100 rounded-md border border-gray-200 text-xs font-medium inline-block",children:h.value})]}),d.jsx(ue,{className:"border-r",children:d.jsx(Gn,{variant:h.status==="active"?"default":"secondary",className:h.status==="active"?"bg-green-600":"bg-gray-400",children:h.status})}),d.jsx(ue,{className:"text-center",children:d.jsx(we,{variant:"ghost",size:"icon",className:"h-8 w-8",children:d.jsx(co,{className:"h-4 w-4"})})})]},h.id))})]})})}),d.jsx(Sce,{open:s,onOpenChange:u,categories:i}),d.jsx(_ce,{open:f,onOpenChange:l})]})}function Sce({open:e,onOpenChange:t,categories:r}){const[n,i]=S.useState("text");return d.jsx(_r,{open:e,onOpenChange:t,children:d.jsxs(dr,{className:"sm:max-w-[600px] max-h-[90vh] overflow-y-auto",children:[d.jsxs(jr,{children:[d.jsx(Or,{children:"Add New Product"}),d.jsx(xn,{children:"Create a new product. Fill in the details below."})]}),d.jsxs("div",{className:"grid gap-6 py-4",children:[d.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"Product Category"}),d.jsxs(Je,{children:[d.jsx(tt,{children:d.jsx(et,{placeholder:"Select Category"})}),d.jsx(rt,{children:r.map(o=>d.jsx(Ee,{value:o.id,children:o.name},o.id))})]})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"Product Name"}),d.jsx(Se,{placeholder:"e.g. Whole Milk"})]})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"Product ID"}),d.jsx(Se,{placeholder:"Internal ID"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"Status"}),d.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[d.jsx(mn,{defaultChecked:!0}),d.jsx("span",{className:"text-sm text-gray-500",children:"Active"})]})]})]}),d.jsxs("div",{className:"space-y-3 p-4 bg-gray-50 rounded-md border border-gray-100",children:[d.jsxs(me,{className:"flex items-center gap-2",children:[d.jsx(D8,{className:"w-4 h-4"})," Barcode Settings"]}),d.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[d.jsx("div",{className:"col-span-1",children:d.jsxs(Je,{defaultValue:"ean13",children:[d.jsx(tt,{children:d.jsx(et,{placeholder:"Format"})}),d.jsxs(rt,{children:[d.jsx(Ee,{value:"ean13",children:"EAN-13"}),d.jsx(Ee,{value:"upc-a",children:"UPC-A"}),d.jsx(Ee,{value:"code128",children:"Code 128"}),d.jsx(Ee,{value:"qr",children:"QR Code"})]})]})}),d.jsx("div",{className:"col-span-2",children:d.jsx(Se,{placeholder:"Barcode Value"})})]}),d.jsx(we,{variant:"link",className:"px-0 text-xs h-auto",children:"+ Add another barcode standard"})]}),d.jsxs("div",{className:"space-y-3",children:[d.jsx(me,{children:"App Appearance"}),d.jsxs(M4,{value:n,onValueChange:i,className:"w-full",children:[d.jsxs(I4,{className:"grid w-full grid-cols-3",children:[d.jsxs(gs,{value:"text",className:"flex items-center gap-2",children:[d.jsx(Op,{className:"w-3 h-3"})," Text"]}),d.jsxs(gs,{value:"color",className:"flex items-center gap-2",children:[d.jsx(pM,{className:"w-3 h-3"})," Color"]}),d.jsxs(gs,{value:"image",className:"flex items-center gap-2",children:[d.jsx(Jo,{className:"w-3 h-3"})," Image"]})]}),d.jsxs(ys,{value:"text",className:"mt-4 space-y-2",children:[d.jsx(me,{children:"Display Text"}),d.jsx(Se,{placeholder:"Text to display on button"})]}),d.jsxs(ys,{value:"color",className:"mt-4 space-y-2",children:[d.jsx(me,{children:"Select Color"}),d.jsxs("div",{className:"flex gap-2 flex-wrap",children:[["#ef4444","#f97316","#f59e0b","#84cc16","#10b981","#06b6d4","#3b82f6","#6366f1","#a855f7","#ec4899"].map(o=>d.jsx("button",{className:"w-8 h-8 rounded-full border border-gray-200 shadow-sm hover:scale-110 transition-transform",style:{backgroundColor:o}},o)),d.jsx("button",{className:"w-8 h-8 rounded-full border border-dashed border-gray-400 flex items-center justify-center hover:bg-gray-50",children:d.jsx(Rr,{className:"w-4 h-4 text-gray-400"})})]})]}),d.jsxs(ys,{value:"image",className:"mt-4 space-y-2",children:[d.jsx(me,{children:"Upload Image"}),d.jsxs("div",{className:"border-2 border-dashed border-gray-300 rounded-md p-6 flex flex-col items-center justify-center text-gray-500 hover:bg-gray-50 cursor-pointer",children:[d.jsx(Jo,{className:"w-8 h-8 mb-2 opacity-50"}),d.jsx("span",{className:"text-xs",children:"Click to upload or drag and drop"})]})]})]})]}),d.jsxs("div",{className:"space-y-3 pt-2 border-t border-gray-100",children:[d.jsx(me,{children:"Store Availability"}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"flex items-center space-x-2",children:[d.jsx("input",{type:"radio",id:"all-stores",name:"scope",className:"text-blue-600 focus:ring-blue-500",defaultChecked:!0}),d.jsx("label",{htmlFor:"all-stores",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"All Stores in Group"})]}),d.jsxs("div",{className:"flex items-center space-x-2",children:[d.jsx("input",{type:"radio",id:"specific-stores",name:"scope",className:"text-blue-600 focus:ring-blue-500"}),d.jsx("label",{htmlFor:"specific-stores",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Specific Location(s)"})]})]}),d.jsx("div",{className:"pl-6 pt-2",children:d.jsx(Je,{disabled:!0,children:d.jsx(tt,{className:"h-8 text-sm",children:d.jsx(et,{placeholder:"Select Locations..."})})})})]})]}),d.jsxs(Dr,{children:[d.jsx(we,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),d.jsx(we,{onClick:()=>t(!1),className:"bg-blue-600 hover:bg-blue-700 text-white",children:"Create Product"})]})]})})}function _ce({open:e,onOpenChange:t}){const[r,n]=S.useState("text");return d.jsx(_r,{open:e,onOpenChange:t,children:d.jsxs(dr,{className:"sm:max-w-[500px]",children:[d.jsxs(jr,{children:[d.jsx(Or,{children:"Add New Category"}),d.jsx(xn,{children:"Create a product category to organize your items."})]}),d.jsxs("div",{className:"grid gap-6 py-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"Category Name"}),d.jsx(Se,{placeholder:"e.g. Dairy, Meat, Bakery"})]}),d.jsxs("div",{className:"space-y-3",children:[d.jsx(me,{children:"Button Appearance"}),d.jsxs(M4,{value:r,onValueChange:n,className:"w-full",children:[d.jsxs(I4,{className:"grid w-full grid-cols-3",children:[d.jsxs(gs,{value:"text",className:"flex items-center gap-2",children:[d.jsx(Op,{className:"w-3 h-3"})," Text"]}),d.jsxs(gs,{value:"color",className:"flex items-center gap-2",children:[d.jsx(pM,{className:"w-3 h-3"})," Color"]}),d.jsxs(gs,{value:"image",className:"flex items-center gap-2",children:[d.jsx(Jo,{className:"w-3 h-3"})," Image"]})]}),d.jsxs(ys,{value:"text",className:"mt-4 space-y-2",children:[d.jsx(me,{children:"Display Text"}),d.jsx(Se,{placeholder:"Category Name"})]}),d.jsxs(ys,{value:"color",className:"mt-4 space-y-2",children:[d.jsx(me,{children:"Select Color"}),d.jsxs("div",{className:"flex gap-2 flex-wrap",children:[["#bfdbfe","#bbf7d0","#fecaca","#ddd6fe","#fde68a"].map(i=>d.jsx("button",{className:"w-8 h-8 rounded-full border border-gray-200 shadow-sm hover:scale-110 transition-transform",style:{backgroundColor:i}},i)),d.jsx("button",{className:"w-8 h-8 rounded-full border border-dashed border-gray-400 flex items-center justify-center hover:bg-gray-50",children:d.jsx(Rr,{className:"w-4 h-4 text-gray-400"})})]})]}),d.jsxs(ys,{value:"image",className:"mt-4 space-y-2",children:[d.jsx(me,{children:"Upload Icon/Image"}),d.jsxs("div",{className:"border-2 border-dashed border-gray-300 rounded-md p-6 flex flex-col items-center justify-center text-gray-500 hover:bg-gray-50 cursor-pointer",children:[d.jsx(Jo,{className:"w-8 h-8 mb-2 opacity-50"}),d.jsx("span",{className:"text-xs",children:"Click to upload"})]})]})]})]}),d.jsx("div",{className:"grid grid-cols-2 gap-4",children:d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"Status"}),d.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[d.jsx(mn,{defaultChecked:!0}),d.jsx("span",{className:"text-sm text-gray-500",children:"Active"})]})]})}),d.jsxs("div",{className:"space-y-3 pt-2 border-t border-gray-100",children:[d.jsx(me,{children:"Store Availability"}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"flex items-center space-x-2",children:[d.jsx("input",{type:"radio",id:"cat-all-stores",name:"cat-scope",className:"text-blue-600 focus:ring-blue-500",defaultChecked:!0}),d.jsx("label",{htmlFor:"cat-all-stores",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"All Stores in Group"})]}),d.jsxs("div",{className:"flex items-center space-x-2",children:[d.jsx("input",{type:"radio",id:"cat-specific-stores",name:"cat-scope",className:"text-blue-600 focus:ring-blue-500"}),d.jsx("label",{htmlFor:"cat-specific-stores",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Specific Location(s)"})]})]})]})]}),d.jsxs(Dr,{children:[d.jsx(we,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),d.jsx(we,{onClick:()=>t(!1),className:"bg-blue-600 hover:bg-blue-700 text-white",children:"Create Category"})]})]})})}function Iw({className:e,...t}){return d.jsx("nav",{role:"navigation","aria-label":"pagination","data-slot":"pagination",className:Re("mx-auto flex w-full justify-center",e),...t})}function Dw({className:e,...t}){return d.jsx("ul",{"data-slot":"pagination-content",className:Re("flex flex-row items-center gap-1",e),...t})}function Si({...e}){return d.jsx("li",{"data-slot":"pagination-item",...e})}function fu({className:e,isActive:t,size:r="icon",...n}){return d.jsx("a",{"aria-current":t?"page":void 0,"data-slot":"pagination-link","data-active":t,className:Re(HM({variant:t?"outline":"ghost",size:r}),e),...n})}function Lw({className:e,...t}){return d.jsxs(fu,{"aria-label":"Go to previous page",size:"default",className:Re("gap-1 px-2.5 sm:pl-2.5",e),...t,children:[d.jsx(uM,{}),d.jsx("span",{className:"hidden sm:block",children:"Previous"})]})}function $w({className:e,...t}){return d.jsxs(fu,{"aria-label":"Go to next page",size:"default",className:Re("gap-1 px-2.5 sm:pr-2.5",e),...t,children:[d.jsx("span",{className:"hidden sm:block",children:"Next"}),d.jsx(bs,{})]})}var Am="Checkbox",[jce]=Bn(Am),[Oce,O_]=jce(Am);function Ece(e){const{__scopeCheckbox:t,checked:r,children:n,defaultChecked:i,disabled:o,form:s,name:u,onCheckedChange:f,required:l,value:h="on",internal_do_not_use_render:p}=e,[m,g]=Mi({prop:r,defaultProp:i??!1,onChange:f,caller:Am}),[b,y]=S.useState(null),[w,j]=S.useState(null),O=S.useRef(!1),E=b?!!s||!!b.closest("form"):!0,A={checked:m,disabled:o,setChecked:g,control:b,setControl:y,name:u,form:s,value:h,hasConsumerStoppedPropagationRef:O,required:l,defaultChecked:ho(i)?!1:i,isFormControl:E,bubbleInput:w,setBubbleInput:j};return d.jsx(Oce,{scope:t,...A,children:Pce(p)?p(A):n})}var D4="CheckboxTrigger",L4=S.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:r,...n},i)=>{const{control:o,value:s,disabled:u,checked:f,required:l,setControl:h,setChecked:p,hasConsumerStoppedPropagationRef:m,isFormControl:g,bubbleInput:b}=O_(D4,e),y=Ze(i,h),w=S.useRef(f);return S.useEffect(()=>{const j=o?.form;if(j){const O=()=>p(w.current);return j.addEventListener("reset",O),()=>j.removeEventListener("reset",O)}},[o,p]),d.jsx(Ue.button,{type:"button",role:"checkbox","aria-checked":ho(f)?"mixed":f,"aria-required":l,"data-state":U4(f),"data-disabled":u?"":void 0,disabled:u,value:s,...n,ref:y,onKeyDown:Ie(t,j=>{j.key==="Enter"&&j.preventDefault()}),onClick:Ie(r,j=>{p(O=>ho(O)?!0:!O),b&&g&&(m.current=j.isPropagationStopped(),m.current||j.stopPropagation())})})});L4.displayName=D4;var $4=S.forwardRef((e,t)=>{const{__scopeCheckbox:r,name:n,checked:i,defaultChecked:o,required:s,disabled:u,value:f,onCheckedChange:l,form:h,...p}=e;return d.jsx(Ece,{__scopeCheckbox:r,checked:i,defaultChecked:o,disabled:u,required:s,onCheckedChange:l,name:n,form:h,value:f,internal_do_not_use_render:({isFormControl:m})=>d.jsxs(d.Fragment,{children:[d.jsx(L4,{...p,ref:t,__scopeCheckbox:r}),m&&d.jsx(q4,{__scopeCheckbox:r})]})})});$4.displayName=Am;var B4="CheckboxIndicator",F4=S.forwardRef((e,t)=>{const{__scopeCheckbox:r,forceMount:n,...i}=e,o=O_(B4,r);return d.jsx(Mr,{present:n||ho(o.checked)||o.checked===!0,children:d.jsx(Ue.span,{"data-state":U4(o.checked),"data-disabled":o.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});F4.displayName=B4;var z4="CheckboxBubbleInput",q4=S.forwardRef(({__scopeCheckbox:e,...t},r)=>{const{control:n,hasConsumerStoppedPropagationRef:i,checked:o,defaultChecked:s,required:u,disabled:f,name:l,value:h,form:p,bubbleInput:m,setBubbleInput:g}=O_(z4,e),b=Ze(r,g),y=y_(o),w=d_(n);S.useEffect(()=>{const O=m;if(!O)return;const E=window.HTMLInputElement.prototype,N=Object.getOwnPropertyDescriptor(E,"checked").set,C=!i.current;if(y!==o&&N){const T=new Event("click",{bubbles:C});O.indeterminate=ho(o),N.call(O,ho(o)?!1:o),O.dispatchEvent(T)}},[m,y,o,i]);const j=S.useRef(ho(o)?!1:o);return d.jsx(Ue.input,{type:"checkbox","aria-hidden":!0,defaultChecked:s??j.current,required:u,disabled:f,name:l,value:h,form:p,...t,tabIndex:-1,ref:b,style:{...t.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});q4.displayName=z4;function Pce(e){return typeof e=="function"}function ho(e){return e==="indeterminate"}function U4(e){return ho(e)?"indeterminate":e?"checked":"unchecked"}function W4({className:e,...t}){return d.jsx($4,{"data-slot":"checkbox",className:Re("peer border bg-input-background dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:d.jsx(F4,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:d.jsx(cM,{className:"size-3.5"})})})}function Nce(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}Array(12).fill(0);let Bw=1;class Ace{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const r=this.subscribers.indexOf(t);this.subscribers.splice(r,1)}),this.publish=t=>{this.subscribers.forEach(r=>r(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var r;const{message:n,...i}=t,o=typeof t?.id=="number"||((r=t.id)==null?void 0:r.length)>0?t.id:Bw++,s=this.toasts.find(f=>f.id===o),u=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),s?this.toasts=this.toasts.map(f=>f.id===o?(this.publish({...f,...t,id:o,title:n}),{...f,...t,id:o,dismissible:u,title:n}):f):this.addToast({title:n,...i,dismissible:u,id:o}),o},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(r=>r({id:t,dismiss:!0})))):this.toasts.forEach(r=>{this.subscribers.forEach(n=>n({id:r.id,dismiss:!0}))}),t),this.message=(t,r)=>this.create({...r,message:t}),this.error=(t,r)=>this.create({...r,message:t,type:"error"}),this.success=(t,r)=>this.create({...r,type:"success",message:t}),this.info=(t,r)=>this.create({...r,type:"info",message:t}),this.warning=(t,r)=>this.create({...r,type:"warning",message:t}),this.loading=(t,r)=>this.create({...r,type:"loading",message:t}),this.promise=(t,r)=>{if(!r)return;let n;r.loading!==void 0&&(n=this.create({...r,promise:t,type:"loading",message:r.loading,description:typeof r.description!="function"?r.description:void 0}));const i=Promise.resolve(t instanceof Function?t():t);let o=n!==void 0,s;const u=i.then(async l=>{if(s=["resolve",l],z.isValidElement(l))o=!1,this.create({id:n,type:"default",message:l});else if(Tce(l)&&!l.ok){o=!1;const p=typeof r.error=="function"?await r.error(`HTTP error! status: ${l.status}`):r.error,m=typeof r.description=="function"?await r.description(`HTTP error! status: ${l.status}`):r.description,b=typeof p=="object"&&!z.isValidElement(p)?p:{message:p};this.create({id:n,type:"error",description:m,...b})}else if(l instanceof Error){o=!1;const p=typeof r.error=="function"?await r.error(l):r.error,m=typeof r.description=="function"?await r.description(l):r.description,b=typeof p=="object"&&!z.isValidElement(p)?p:{message:p};this.create({id:n,type:"error",description:m,...b})}else if(r.success!==void 0){o=!1;const p=typeof r.success=="function"?await r.success(l):r.success,m=typeof r.description=="function"?await r.description(l):r.description,b=typeof p=="object"&&!z.isValidElement(p)?p:{message:p};this.create({id:n,type:"success",description:m,...b})}}).catch(async l=>{if(s=["reject",l],r.error!==void 0){o=!1;const h=typeof r.error=="function"?await r.error(l):r.error,p=typeof r.description=="function"?await r.description(l):r.description,g=typeof h=="object"&&!z.isValidElement(h)?h:{message:h};this.create({id:n,type:"error",description:p,...g})}}).finally(()=>{o&&(this.dismiss(n),n=void 0),r.finally==null||r.finally.call(r)}),f=()=>new Promise((l,h)=>u.then(()=>s[0]==="reject"?h(s[1]):l(s[1])).catch(h));return typeof n!="string"&&typeof n!="number"?{unwrap:f}:Object.assign(n,{unwrap:f})},this.custom=(t,r)=>{const n=r?.id||Bw++;return this.create({jsx:t(n),id:n,...r}),n},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const fn=new Ace,Cce=(e,t)=>{const r=t?.id||Bw++;return fn.addToast({title:e,...t,id:r}),r},Tce=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",kce=Cce,Rce=()=>fn.toasts,Mce=()=>fn.getActiveToasts(),Qe=Object.assign(kce,{success:fn.success,info:fn.info,warning:fn.warning,error:fn.error,custom:fn.custom,message:fn.message,promise:fn.promise,dismiss:fn.dismiss,loading:fn.loading},{getHistory:Rce,getToasts:Mce});Nce("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");class Ice extends Error{status;payload;constructor(t,r,n){super(t),this.name="ApiError",this.status=r,this.payload=n}}function Dce(e,t){if(!e)return t;const r=e.endsWith("/")?e.slice(0,-1):e,n=t.startsWith("/")?t:`/${t}`;return`${r}${n}`}function Lce(e){const t=new URLSearchParams;for(const[n,i]of Object.entries(e))if(!(i==null||i==="")){if(typeof i=="boolean"){t.set(n,i?"true":"false");continue}t.set(n,String(i))}const r=t.toString();return r?`?${r}`:""}function $ce(e){const r=e?.error?.message?.trim();return r||null}function nM(e){if(Array.isArray(e))return{items:e,totalCount:e.length};if(!e||typeof e!="object")return e;const t=e,r="TotalCount"in t||"Items"in t,n="totalCount"in t||"items"in t;return r&&!n?{...t,totalCount:t.TotalCount,items:t.Items}:!("items"in t)&&Array.isArray(t.data)&&typeof t.totalCount=="number"?{...t,items:t.data}:!("items"in t)&&Array.isArray(t.Data)&&typeof t.TotalCount=="number"?{...t,totalCount:t.TotalCount,items:t.Data}:e}function pl(e={}){const t=e.baseUrl??"http://192.168.31.87:19001"??"http://localhost:19001",r=e.getToken;async function n(i){const o=i.prefix??"/api/app",s=Dce(t,`${o}${i.path}${Lce(i.query??{})}`),u={"Content-Type":"application/json"},f=r?.();f&&(u.Authorization=`Bearer ${f}`);const l=await fetch(s,{method:i.method,headers:u,body:i.body===void 0?void 0:JSON.stringify(i.body),signal:i.signal}),m=(l.headers.get("content-type")??"").includes("application/json")?await l.json().catch(()=>null):await l.text().catch(()=>"");if(!l.ok){const b=$ce(m)??(typeof m=="string"&&m.trim()?m:"Request failed.");throw new Ice(b,l.status,m)}return m&&typeof m=="object"&&"data"in m?nM(m.data??null):nM(m)}return{requestJson:n}}const ku=pl({getToken:()=>{try{return localStorage.getItem("access_token")??localStorage.getItem("token")??null}catch{return null}}}),Ru="/rbac-menu";function du(e){if(!e||typeof e!="object")return{id:""};const t=e;return{id:String(t.id??t.Id??""),orderNum:t.orderNum??t.OrderNum,state:t.state??t.State,menuName:t.menuName??t.MenuName,routerName:t.routerName??t.RouterName,menuType:t.menuType??t.MenuType,permissionCode:t.permissionCode??t.PermissionCode,parentId:t.parentId??t.ParentId,menuIcon:t.menuIcon??t.MenuIcon,routeUrl:t.routeUrl??t.RouteUrl,link:t.link??t.Link,isCache:t.isCache??t.IsCache,isShow:t.isShow??t.IsShow,remark:t.remark??t.Remark,component:t.component??t.Component,menuSource:t.menuSource??t.MenuSource,query:t.query??t.Query,concurrencyStamp:t.concurrencyStamp??t.ConcurrencyStamp}}function Bce(e){if(Array.isArray(e))return{items:e.map(du),totalCount:e.length};const t=e,r=t.items??t.Items??[],n=typeof t.totalCount=="number"?t.totalCount:typeof t.TotalCount=="number"?t.TotalCount:r.length;return{items:r.map(du),totalCount:n}}async function H4(e,t){const r=await ku.requestJson({path:Ru,method:"GET",query:{SkipCount:e.skipCount,MaxResultCount:e.maxResultCount,Sorting:e.sorting,Keyword:e.keyword},signal:t});return Bce(r)}function Fw(e){const t=du(e),r=e,n=r?.children??r?.Children,i=Array.isArray(n)?n.map(Fw):void 0;return{...t,children:i}}function Fce(e){if(Array.isArray(e))return e.map(Fw);if(!e||typeof e!="object")return[];const t=e,r=t.items??t.Items??t.data??t.Data;return Array.isArray(r)?r.map(Fw):[]}async function zce(e){const t=await ku.requestJson({path:`${Ru}/tree`,method:"GET",signal:e});return Fce(t)}async function qce(e){const t=new Map;let r=1;const n=500;for(;;){const o=(await H4({skipCount:r,maxResultCount:n},e)).items??[];for(const s of o)s.menuType!==0||!s.id||t.has(s.id)||t.set(s.id,s);if(o.length100))break}return Array.from(t.values()).sort((i,o)=>(i.orderNum??0)-(o.orderNum??0))}async function Uce(e){const t=await ku.requestJson({path:Ru,method:"POST",body:e});return du(t)}async function Wce(e,t){const r=await ku.requestJson({path:`${Ru}/${encodeURIComponent(e)}`,method:"PUT",body:t});return du(r)}async function Hce(e){e.length&&await ku.requestJson({path:Ru,method:"DELETE",body:e})}async function Vce(e){await Hce([e])}const V4=pl({getToken:()=>{try{return localStorage.getItem("access_token")??localStorage.getItem("token")??null}catch{return null}}}),G4="/rbac-role-menu";async function Gce(e){await V4.requestJson({path:`${G4}/set`,method:"POST",body:e})}async function Kce(e){await V4.requestJson({path:G4,method:"DELETE",body:e})}const Xce=pl({getToken:()=>{try{return localStorage.getItem("access_token")??localStorage.getItem("token")??null}catch{return null}}}),Yce="/role";async function K4(e,t){return Xce.requestJson({path:Yce,method:"GET",query:{SkipCount:e.skipCount,MaxResultCount:e.maxResultCount,RoleName:e.roleName,RoleCode:e.roleCode,State:e.state},signal:t})}const Cm=pl({getToken:()=>{try{return localStorage.getItem("access_token")??localStorage.getItem("token")??null}catch{return null}}}),Tm="/rbac-role";async function Qce(e){return Cm.requestJson({path:Tm,method:"POST",body:e})}async function Zce(e,t){return Cm.requestJson({path:`${Tm}/${encodeURIComponent(e)}`,method:"PUT",body:t})}function Jce(e){if(!e||typeof e!="object")return[];const t=e,r=Array.isArray(t.menuIds)?t.menuIds:Array.isArray(t.MenuIds)?t.MenuIds:void 0;if(r)return r.map(String);const n=t.data??t.Data;if(n&&typeof n=="object"){const o=n,s=Array.isArray(o.menuIds)?o.menuIds:Array.isArray(o.MenuIds)?o.MenuIds:void 0;if(s)return s.map(String)}const i=Array.isArray(t.roleMenus)?t.roleMenus:Array.isArray(t.RoleMenus)?t.RoleMenus:void 0;if(Array.isArray(i)){const o=[];for(const s of i){if(!s||typeof s!="object")continue;const u=s,f=u.menuId??u.MenuId??u.id??u.Id;f&&o.push(String(f))}return o}return[]}async function eue(e){e.length&&await Cm.requestJson({path:Tm,method:"DELETE",body:e})}async function tue(e){await eue([e])}async function rue(e,t){const r=await Cm.requestJson({path:`${Tm}/${encodeURIComponent(e)}`,method:"GET",signal:t});return Jce(r)}const km=pl({getToken:()=>{try{return localStorage.getItem("access_token")??localStorage.getItem("token")??null}catch{return null}}});async function X4(e,t){return km.requestJson({path:"/location",method:"GET",query:{SkipCount:e.skipCount,MaxResultCount:e.maxResultCount,Sorting:e.sorting,Keyword:e.keyword,Partner:e.partner,GroupName:e.groupName,State:e.state},signal:t})}async function nue(e){return km.requestJson({path:"/location",method:"POST",body:{partner:e.partner,groupName:e.groupName,locationCode:e.locationCode,locationName:e.locationName,street:e.street,city:e.city,stateCode:e.stateCode,country:e.country,zipCode:e.zipCode,phone:e.phone,email:e.email,latitude:e.latitude,longitude:e.longitude,state:e.state??!0}})}async function iue(e,t){return km.requestJson({path:`/location/${encodeURIComponent(e)}`,method:"PUT",body:{partner:t.partner,groupName:t.groupName,locationCode:t.locationCode,locationName:t.locationName,street:t.street,city:t.city,stateCode:t.stateCode,country:t.country,zipCode:t.zipCode,phone:t.phone,email:t.email,latitude:t.latitude,longitude:t.longitude,state:t.state??!0}})}async function oue(e){await km.requestJson({path:`/location/${encodeURIComponent(e)}`,method:"DELETE"})}const Mu=pl({getToken:()=>{try{return localStorage.getItem("access_token")??localStorage.getItem("token")??null}catch{return null}}}),Iu="/team-member";function aue(e){if(!Array.isArray(e))return[];const t=[];for(const r of e)if(r!=null){if(typeof r=="string"||typeof r=="number"){t.push(String(r));continue}if(typeof r=="object"){const n=r,i=n.id??n.Id??n.locationId??n.LocationId??n.location_id??n.locationID;i!=null&&t.push(String(i))}}return t}function sue(e){if(!Array.isArray(e))return[];const t=[];for(const r of e)if(r!=null){if(typeof r=="string"||typeof r=="number"){t.push(String(r));continue}if(typeof r=="object"){const n=r,i=n.locationCode??n.LocationCode??n.code??n.Code??n.location_code??n.locationCodeId,o=n.locationName??n.LocationName??n.name??n.Name??n.location_name,s=n.id??n.Id??n.locationId??n.LocationId,u=i==null?"":String(i).trim(),f=o==null?"":String(o).trim(),l=s==null?"":String(s).trim();u&&f?t.push(`${u} - ${f}`):f?t.push(f):u?t.push(u):l&&t.push(l)}}return t}function Rm(e){if(!e||typeof e!="object")return{id:""};const t=e,r=String(t.id??t.Id??t.userId??t.UserId??""),n=t.fullName??t.FullName??t.name??t.Name,i=t.userName??t.UserName??t.username??t.UserName,o=t.email??t.Email,s=t.phone??t.Phone;let u=t.roleId??t.RoleId,f=t.roleName??t.RoleName??t.roleName??t.Role;const l=t.role??t.Role;if((!u||!f)&&l&&typeof l=="object"){const w=l;u=w.id??w.Id??w.roleId??w.RoleId??u,f=w.roleName??w.RoleName??w.name??w.Name??w.role??w.Role??f}const h=t.state??t.State,p=typeof h=="boolean"?h:h==="true"?!0:h==="false"?!1:void 0,m=t.locationIds??t.LocationIds??t.assignedLocationIds??t.AssignedLocationIds??t.location_id_list??t.LocationIdList;let g=aue(m);const b=t.locations??t.Locations??t.assignedLocations??t.AssignedLocations??t.locationNames??t.LocationNames;let y=sue(b);if(g.length===0&&Array.isArray(b)){const w=[];for(const j of b){if(typeof j!="object"||!j)continue;const O=j,E=O.id??O.Id??O.locationId??O.LocationId;E!=null&&w.push(String(E))}w.length&&(g=w)}return{id:r,fullName:n,userName:i,email:o,phone:s,roleId:u,roleName:f,locationIds:g,locations:y,state:p??(t.status?String(t.status).toLowerCase()==="active":void 0)}}async function lue(e,t){const r=await Mu.requestJson({path:Iu,method:"GET",query:{SkipCount:e.skipCount,MaxResultCount:e.maxResultCount,Keyword:e.keyword},signal:t}),n=r.items??[];return{totalCount:r.totalCount??0,items:n.map(Rm)}}async function cue(e,t){const r=await Mu.requestJson({path:`${Iu}/${encodeURIComponent(e)}`,method:"GET",signal:t});return Rm(r)}function uue(e){return{fullName:e.fullName,userName:e.userName,password:e.password,email:e.email??null,phone:e.phone??null,roleId:e.roleId,locationIds:e.locationIds,locations:e.locationIds,state:e.state}}function fue(e){const t={fullName:e.fullName,userName:e.userName,email:e.email??null,phone:e.phone??null,roleId:e.roleId,locationIds:e.locationIds,locations:e.locationIds,state:e.state};return e.password&&(t.password=e.password),t}async function due(e){const t=await Mu.requestJson({path:Iu,method:"POST",body:uue(e)});return Rm(t)}async function hue(e,t){const r=await Mu.requestJson({path:`${Iu}/${encodeURIComponent(e)}`,method:"PUT",body:fue(t)});return Rm(r)}async function pue(e){await Mu.requestJson({path:`${Iu}/${encodeURIComponent(e)}`,method:"DELETE"})}const Y4=[{id:"p1",name:"Global Foods Inc.",status:"active",contact:"admin@globalfoods.com",phone:"+1 (555) 100-2000"},{id:"p2",name:"Local Eateries Co.",status:"active",contact:"support@localeateries.com",phone:"+1 (555) 200-3000"}],mue=[{id:"g1",name:"West Coast Region",partner:"Global Foods Inc.",status:"active"},{id:"g2",name:"East Coast Region",partner:"Global Foods Inc.",status:"inactive"}];function vue(){const[e,t]=S.useState("Roles"),[r,n]=S.useState([]),[i,o]=S.useState(0),[s,u]=S.useState(!1),[f,l]=S.useState(0),[h,p]=S.useState(1),[m,g]=S.useState(10),b=Math.max(1,Math.ceil(i/m)),y=S.useRef(null),[w,j]=S.useState(""),O=S.useRef(null),[E,A]=S.useState(""),[N,C]=S.useState(Y4),[T,R]=S.useState(mue),[I,F]=S.useState([]),[L,$]=S.useState(!1),[U,G]=S.useState(0),[q,H]=S.useState(0),[V,D]=S.useState(1),[Z,J]=S.useState(10),M=Math.max(1,Math.ceil(U/Z)),B=S.useRef(null),[ee,ae]=S.useState(""),ie=S.useRef(null),[fe,K]=S.useState(""),[ce,te]=S.useState(null),[le,ge]=S.useState(!1),[Y,_e]=S.useState(null),[Oe,Ve]=S.useState(!1),[nt,lt]=S.useState(null),[nr,ir]=S.useState(!1),[hr,Rt]=S.useState(null),[$t,li]=S.useState(!1),[_o,Bi]=S.useState(null),[$u,ba]=S.useState(!1),[wa,ml]=S.useState(!1),[jo,ci]=S.useState(!1),Lm=()=>{alert(`Exporting ${e} list to PDF...`)};S.useEffect(()=>(O.current&&window.clearTimeout(O.current),O.current=window.setTimeout(()=>A(w.trim()),300),()=>{O.current&&window.clearTimeout(O.current)}),[w]),S.useEffect(()=>(ie.current&&window.clearTimeout(ie.current),ie.current=window.setTimeout(()=>K(ee.trim()),300),()=>{ie.current&&window.clearTimeout(ie.current)}),[ee]),S.useEffect(()=>{p(1)},[E,m]),S.useEffect(()=>{D(1)},[fe,Z]),S.useEffect(()=>e!=="Roles"?void 0:((async()=>{y.current?.abort();const dt=new AbortController;y.current=dt,u(!0);try{const Jt=await K4({skipCount:Math.max(1,h),maxResultCount:m,roleName:E||void 0},dt.signal);n(Jt.items??[]),o(Jt.totalCount??0)}catch(Jt){if(Jt?.name==="AbortError")return;Qe.error("Failed to load roles.",{description:Jt?.message?String(Jt.message):"Please try again."}),n([]),o(0)}finally{u(!1)}})(),()=>y.current?.abort()),[e,E,h,m,f]),S.useEffect(()=>e!=="Team Member"?void 0:((async()=>{B.current?.abort();const dt=new AbortController;B.current=dt,$(!0);try{const Jt=await lue({skipCount:Math.max(1,V),maxResultCount:Z,keyword:fe||void 0},dt.signal);F(Jt.items??[]),G(Jt.totalCount??0)}catch(Jt){if(Jt?.name==="AbortError")return;Qe.error("Failed to load team members.",{description:Jt?.message?String(Jt.message):"Please try again."}),F([]),G(0)}finally{$(!1)}})(),()=>B.current?.abort()),[e,fe,V,Z,q]);const Bu=()=>{switch(e){case"Roles":lt(null),Ve(!0);break;case"Partner":ba(!0);break;case"Group":ml(!0);break;case"Team Member":te(null),ci(!0);break}},Fu=()=>{const ve=e==="Team Member";return d.jsxs("div",{className:"flex flex-col gap-4 pb-4",children:[d.jsxs("div",{className:"flex flex-nowrap items-center gap-3",children:[d.jsx(Se,{placeholder:"Search",value:e==="Roles"?w:e==="Team Member"?ee:"",onChange:dt=>{e==="Roles"&&j(dt.target.value),e==="Team Member"&&ae(dt.target.value)},style:{height:40,boxSizing:"border-box"},className:"border border-gray-300 rounded-md w-40 shrink-0 bg-white placeholder:text-gray-500"}),d.jsx("div",{className:"flex-1"}),ve&&d.jsxs(d.Fragment,{children:[d.jsx(we,{variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 px-4 bg-white hover:bg-gray-50 shrink-0",children:"Bulk Import"}),d.jsx(we,{variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 px-4 bg-white hover:bg-gray-50 shrink-0",children:"Bulk Edit"})]}),d.jsx(we,{variant:"outline",onClick:Lm,className:"h-10 border border-gray-300 rounded-md text-gray-900 px-4 bg-white hover:bg-gray-50 shrink-0",children:"Bulk Export (PDF)"}),d.jsx(we,{className:"h-10 bg-blue-600 hover:bg-blue-700 text-white rounded-md px-6 font-medium shrink-0",onClick:Bu,children:"New+"})]}),d.jsx("div",{className:"w-full border-b border-gray-200",children:d.jsx("div",{className:"flex overflow-x-auto w-fit",children:["Roles","Partner","Group","Team Member"].map(dt=>d.jsx("button",{onClick:()=>t(dt),style:e===dt?{borderBottomWidth:2,borderBottomStyle:"solid",borderBottomColor:"#2563eb"}:void 0,className:Re("px-4 py-2.5 text-sm font-medium whitespace-nowrap cursor-pointer transition-colors -mb-px border-b-2",e===dt?"text-blue-600":"border-b-transparent text-gray-600 hover:text-gray-800"),children:dt},dt))})})]})},$m=()=>{switch(e){case"Roles":return d.jsxs("div",{className:"flex flex-col",children:[d.jsxs(br,{children:[d.jsx(wr,{children:d.jsxs(Ge,{className:"bg-gray-100",children:[d.jsx(ye,{className:"font-bold text-black border-r",children:"Role Name"}),d.jsx(ye,{className:"font-bold text-black border-r",children:"Role Code"}),d.jsx(ye,{className:"font-bold text-black border-r",children:"Status"}),d.jsx(ye,{className:"font-bold text-black border-r",children:"Order"}),d.jsx(ye,{className:"font-bold text-black text-center",children:"Actions"})]})}),d.jsx(Sr,{children:r.length===0?d.jsx(Ge,{children:d.jsx(ue,{colSpan:5,className:"text-center text-sm text-gray-500 py-10",children:s?"Loading...":"No data"})}):r.map(ve=>d.jsxs(Ge,{children:[d.jsx(ue,{className:"font-medium border-r",children:ve.roleName??"N/A"}),d.jsx(ue,{className:"border-r text-gray-600",children:ve.roleCode??"N/A"}),d.jsx(ue,{className:"border-r",children:d.jsx(Gn,{className:ve.state?"bg-green-600":"bg-gray-400",children:ve.state?"Active":"Inactive"})}),d.jsx(ue,{className:"border-r text-gray-600",children:ve.orderNum??"N/A"}),d.jsxs(ue,{className:"text-center",children:[d.jsx(we,{variant:"ghost",size:"sm",onClick:()=>{Rt(ve),ir(!0)},title:"Menu Permissions",children:d.jsx(NF,{className:"w-4 h-4 text-blue-600"})}),d.jsx(we,{variant:"ghost",size:"sm",onClick:()=>{lt(ve),Ve(!0)},children:d.jsx(co,{className:"w-4 h-4 text-gray-500"})}),d.jsx(we,{variant:"ghost",size:"sm",onClick:async()=>{Bi(ve),li(!0)},title:"Delete role",children:d.jsx(Nc,{className:"w-4 h-4 text-red-600"})})]})]},ve.id))})]}),d.jsxs("div",{className:"px-4 py-3 border-t border-gray-200 bg-white flex flex-wrap items-center justify-between gap-3",children:[d.jsxs("div",{className:"text-sm text-gray-600",children:["Showing ",i===0?0:(h-1)*m+1,"-",Math.min(h*m,i)," of ",i]}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsxs(Je,{value:String(m),onValueChange:ve=>g(Number(ve)),children:[d.jsx(tt,{className:"w-[110px] h-9 rounded-md border border-gray-300 bg-white text-gray-900",children:d.jsx(et,{})}),d.jsx(rt,{children:[10,20,50].map(ve=>d.jsxs(Ee,{value:String(ve),children:[ve," / page"]},ve))})]}),d.jsx(Iw,{className:"mx-0 w-auto justify-end",children:d.jsxs(Dw,{children:[d.jsx(Si,{children:d.jsx(Lw,{href:"#",size:"default",onClick:ve=>{ve.preventDefault(),p(dt=>Math.max(1,dt-1))},"aria-disabled":h<=1,className:h<=1?"pointer-events-none opacity-50":""})}),d.jsx(Si,{children:d.jsxs(fu,{href:"#",isActive:!0,size:"default",onClick:ve=>ve.preventDefault(),children:["Page ",h," / ",b]})}),d.jsx(Si,{children:d.jsx($w,{href:"#",size:"default",onClick:ve=>{ve.preventDefault(),p(dt=>Math.min(b,dt+1))},"aria-disabled":h>=b,className:h>=b?"pointer-events-none opacity-50":""})})]})})]})]})]});case"Partner":return d.jsxs(br,{children:[d.jsx(wr,{children:d.jsxs(Ge,{className:"bg-gray-100",children:[d.jsx(ye,{className:"font-bold text-black border-r",children:"Partner Name"}),d.jsx(ye,{className:"font-bold text-black border-r",children:"Contact"}),d.jsx(ye,{className:"font-bold text-black border-r",children:"Phone"}),d.jsx(ye,{className:"font-bold text-black border-r",children:"Status"}),d.jsx(ye,{className:"font-bold text-black text-center",children:"Actions"})]})}),d.jsx(Sr,{children:N.map(ve=>d.jsxs(Ge,{children:[d.jsx(ue,{className:"font-medium border-r",children:ve.name}),d.jsx(ue,{className:"border-r",children:ve.contact}),d.jsx(ue,{className:"border-r text-gray-600",children:ve.phone}),d.jsx(ue,{className:"border-r",children:d.jsx(Gn,{className:ve.status==="active"?"bg-green-600":"bg-gray-400",children:ve.status})}),d.jsx(ue,{className:"text-center",children:d.jsx(we,{variant:"ghost",size:"sm",children:d.jsx(co,{className:"w-4 h-4 text-gray-500"})})})]},ve.id))})]});case"Group":return d.jsxs(br,{children:[d.jsx(wr,{children:d.jsxs(Ge,{className:"bg-gray-100",children:[d.jsx(ye,{className:"font-bold text-black border-r",children:"Group Name"}),d.jsx(ye,{className:"font-bold text-black border-r",children:"Parent Partner"}),d.jsx(ye,{className:"font-bold text-black border-r",children:"Status"}),d.jsx(ye,{className:"font-bold text-black text-center",children:"Actions"})]})}),d.jsx(Sr,{children:T.map(ve=>d.jsxs(Ge,{children:[d.jsx(ue,{className:"font-medium border-r",children:ve.name}),d.jsx(ue,{className:"border-r",children:ve.partner}),d.jsx(ue,{className:"border-r",children:d.jsx(Gn,{className:ve.status==="active"?"bg-green-600":"bg-gray-400",children:ve.status})}),d.jsx(ue,{className:"text-center",children:d.jsx(we,{variant:"ghost",size:"sm",children:d.jsx(co,{className:"w-4 h-4 text-gray-500"})})})]},ve.id))})]});case"Team Member":return d.jsxs(d.Fragment,{children:[d.jsxs(br,{children:[d.jsx(wr,{children:d.jsxs(Ge,{className:"bg-gray-100",children:[d.jsx(ye,{className:"font-bold text-black border-r",children:"Name"}),d.jsx(ye,{className:"font-bold text-black border-r",children:"Email"}),d.jsx(ye,{className:"font-bold text-black border-r",children:"Phone"}),d.jsx(ye,{className:"font-bold text-black border-r",children:"Role"}),d.jsx(ye,{className:"font-bold text-black border-r",children:"Assigned Locations"}),d.jsx(ye,{className:"font-bold text-black border-r",children:"Status"}),d.jsx(ye,{className:"font-bold text-black text-center",children:"Actions"})]})}),d.jsx(Sr,{children:L?d.jsx(Ge,{children:d.jsx(ue,{colSpan:7,className:"text-center text-sm text-gray-500 py-10",children:"Loading..."})}):I.length===0?d.jsx(Ge,{children:d.jsx(ue,{colSpan:7,className:"text-center text-sm text-gray-500 py-10",children:"No results."})}):I.map(ve=>d.jsxs(Ge,{children:[d.jsx(ue,{className:"font-medium border-r",children:ve.fullName??ve.userName??"N/A"}),d.jsx(ue,{className:"border-r text-gray-600",children:ve.email??"N/A"}),d.jsx(ue,{className:"border-r text-gray-600",children:ve.phone??"N/A"}),d.jsx(ue,{className:"border-r",children:d.jsx(Gn,{variant:"outline",className:"font-normal",children:ve.roleName??ve.roleId??"N/A"})}),d.jsx(ue,{className:"border-r",children:d.jsxs("div",{className:"flex flex-col gap-1",children:[(ve.locations?.length?ve.locations:ve.locationIds??[]).map(dt=>d.jsxs("div",{className:"flex items-center gap-1 text-xs text-gray-600",children:[d.jsx(Zs,{className:"w-3 h-3"})," ",dt]},dt)),!ve.locations?.length&&!(ve.locationIds?.length??0)&&d.jsx("div",{className:"text-xs text-gray-500",children:"无"})]})}),d.jsx(ue,{className:"border-r",children:d.jsx(Gn,{className:ve.state?"bg-green-600":"bg-gray-400",children:ve.state?"Active":"Inactive"})}),d.jsx(ue,{className:"text-center",children:d.jsxs("div",{className:"flex items-center justify-center gap-2",children:[d.jsx(we,{variant:"ghost",size:"sm",onClick:()=>{te(ve),ci(!0)},title:"Edit",children:d.jsx(co,{className:"w-4 h-4 text-gray-500"})}),d.jsx(we,{variant:"ghost",size:"sm",onClick:()=>{_e(ve),ge(!0)},title:"Delete",children:d.jsx(Nc,{className:"w-4 h-4 text-red-600"})})]})})]},ve.id))})]}),d.jsxs("div",{className:"px-4 py-3 border-t border-gray-200 bg-white flex flex-wrap items-center justify-between gap-3",children:[d.jsxs("div",{className:"text-sm text-gray-600",children:["Showing ",U===0?0:(V-1)*Z+1,"-",Math.min(V*Z,U)," of ",U]}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsxs(Je,{value:String(Z),onValueChange:ve=>J(Number(ve)),children:[d.jsx(tt,{className:"w-[110px] h-9 rounded-md border border-gray-300 bg-white text-gray-900",children:d.jsx(et,{})}),d.jsx(rt,{children:[10,20,50].map(ve=>d.jsxs(Ee,{value:String(ve),children:[ve," / page"]},ve))})]}),d.jsx(Iw,{className:"mx-0 w-auto justify-end",children:d.jsxs(Dw,{children:[d.jsx(Si,{children:d.jsx(Lw,{href:"#",size:"default",onClick:ve=>{ve.preventDefault(),D(dt=>Math.max(1,dt-1))},"aria-disabled":V<=1,className:V<=1?"pointer-events-none opacity-50":""})}),d.jsx(Si,{children:d.jsxs(fu,{href:"#",isActive:!0,size:"default",onClick:ve=>ve.preventDefault(),children:["Page ",V," / ",M]})}),d.jsx(Si,{children:d.jsx($w,{href:"#",size:"default",onClick:ve=>{ve.preventDefault(),D(dt=>Math.min(M,dt+1))},"aria-disabled":V>=M,className:V>=M?"pointer-events-none opacity-50":""})})]})})]})]})]})}};return d.jsxs("div",{className:"h-full flex flex-col",children:[Fu(),d.jsx("div",{className:"flex-1 overflow-auto pt-6",children:d.jsx("div",{className:"bg-white border border-gray-200 shadow-sm rounded-md",children:$m()})}),d.jsx(gue,{open:Oe,role:nt,onOpenChange:ve=>{Ve(ve),ve||lt(null)},onSaved:()=>{p(1),l(ve=>ve+1)}}),d.jsx(yue,{open:nr,role:hr,onOpenChange:ve=>{ir(ve),ve||Rt(null)}}),d.jsx(xue,{open:$t,role:_o,onOpenChange:ve=>{li(ve),ve||Bi(null)},onDeleted:()=>l(ve=>ve+1)}),d.jsx(bue,{open:$u,onOpenChange:ba}),d.jsx(wue,{open:wa,onOpenChange:ml}),d.jsx(Sue,{open:jo,member:ce,onOpenChange:ve=>{ci(ve),ve||te(null)},onSaved:()=>{D(1),H(ve=>ve+1)}}),d.jsx(_ue,{open:le,member:Y,onOpenChange:ve=>{ge(ve),ve||_e(null)},onDeleted:()=>{H(ve=>ve+1)}})]})}function gue({open:e,role:t,onOpenChange:r,onSaved:n}){const i=!!t?.id,[o,s]=S.useState(!1),[u,f]=S.useState(""),[l,h]=S.useState(""),[p,m]=S.useState(""),[g,b]=S.useState(""),[y,w]=S.useState(!0);S.useEffect(()=>{e&&(s(!1),f(t?.roleName??""),h(t?.roleCode??""),m(t?.remark??""),b(t?.orderNum===null||t?.orderNum===void 0?"":String(t.orderNum)),w(t?.state??!0))},[e,t]);const j=S.useMemo(()=>!!(u.trim()&&l.trim()),[u,l]),O=A=>{const N=A.trim();if(!N)return null;const C=Number.parseInt(N,10);return Number.isFinite(C)?C:null},E=async()=>{if(!j){Qe.error("Please fill in required fields.",{description:"Role Name and Role Code are required."});return}s(!0);try{const A={roleName:u.trim(),roleCode:l.trim(),remark:p.trim()?p.trim():null,state:!!y,orderNum:O(g)};i&&t?.id?(await Zce(t.id,A),Qe.success("Role updated.",{description:"Role fields have been saved successfully."})):(await Qce(A),Qe.success("Role created.",{description:"A new role has been created successfully."})),r(!1),n()}catch(A){Qe.error(i?"Failed to update role.":"Failed to create role.",{description:A?.message?String(A.message):"Please try again."})}finally{s(!1)}};return d.jsx(_r,{open:e,onOpenChange:r,children:d.jsxs(dr,{className:"sm:max-w-[600px]",children:[d.jsxs(jr,{children:[d.jsx(Or,{children:i?"Edit Role":"Create Role"}),d.jsx(xn,{children:i?"Update role fields and save changes.":"Fill out the form to create a new role."})]}),d.jsxs("div",{className:"space-y-4 py-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"Role Name *"}),d.jsx(Se,{value:u,onChange:A=>f(A.target.value),placeholder:"e.g. Inventory Specialist"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"Role Code *"}),d.jsx(Se,{value:l,onChange:A=>h(A.target.value),placeholder:"e.g. inventory_specialist"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"Remark"}),d.jsx(Se,{value:p,onChange:A=>m(A.target.value),placeholder:"Optional"})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"Order"}),d.jsx(Se,{value:g,onChange:A=>b(A.target.value),placeholder:"e.g. 10"})]}),d.jsxs("div",{className:"flex items-center justify-between border border-gray-200 rounded-md px-3 bg-white",style:{height:40},children:[d.jsx("div",{className:"text-sm font-medium text-gray-900",children:"Enabled"}),d.jsx(mn,{checked:y,onCheckedChange:w})]})]})]}),d.jsxs(Dr,{children:[d.jsx(we,{variant:"outline",onClick:()=>r(!1),children:"Cancel"}),d.jsx(we,{disabled:o,onClick:E,className:"bg-blue-600 text-white hover:bg-blue-700",children:o?"Saving...":"Save"})]})]})})}function yue({open:e,role:t,onOpenChange:r}){const n=t?.id??"",i=t?.roleName??"",[o,s]=S.useState(!1),[u,f]=S.useState([]),[l,h]=S.useState(new Set),[p,m]=S.useState(new Set),[g,b]=S.useState(!1),y=S.useRef(null),[w,j]=S.useState(""),O=S.useRef(null),[E,A]=S.useState("");S.useEffect(()=>(O.current&&window.clearTimeout(O.current),O.current=window.setTimeout(()=>A(w.trim()),300),()=>{O.current&&window.clearTimeout(O.current)}),[w]),S.useEffect(()=>e?(s(!1),m(new Set),h(new Set),(async()=>{y.current?.abort();const H=new AbortController;y.current=H,b(!0);try{const V=await zce(H.signal);if(f(V??[]),n){const D=await rue(n,H.signal);m(new Set(D))}}catch(V){if(V?.name==="AbortError")return;Qe.error("Failed to load menus.",{description:V?.message?String(V.message):"Please try again."}),f([]),m(new Set)}finally{b(!1)}})(),()=>y.current?.abort()):void 0,[e,n]);const N=S.useMemo(()=>{const q=H=>H.reduce((V,D)=>V+1+(D.children?q(D.children):0),0);return q(u)},[u]),C=S.useMemo(()=>{const q=E.trim().toLowerCase();if(!q)return u;const H=D=>{const Z=(D.menuName??"").toLowerCase(),J=(D.routeUrl??"").toLowerCase();return Z.includes(q)||J.includes(q)},V=D=>{const Z=[];for(const J of D){const M=J.children?V(J.children):[];(H(J)||M.length)&&Z.push({...J,children:M.length?M:void 0})}return Z};return V(u)},[u,E]);S.useEffect(()=>{if(!E.trim())return;const H=new Set,V=D=>{for(const Z of D)Z.children?.length&&H.add(Z.id),Z.children?.length&&V(Z.children)};V(C),h(H)},[E,C]);const T=q=>{const H=[],V=D=>{D.id&&H.push(D.id),D.children?.length&&D.children.forEach(V)};return V(q),H},R=q=>{const H=T(q);if(!H.length)return{checked:!1,indeterminate:!1};let V=0;for(const D of H)p.has(D)&&(V+=1);return V===0?{checked:!1,indeterminate:!1}:V===H.length?{checked:!0,indeterminate:!1}:{checked:!1,indeterminate:!0}},I=(q,H)=>{m(V=>{const D=new Set(V),Z=T(q);return H?Z.forEach(J=>D.add(J)):Z.forEach(J=>D.delete(J)),D})},F=q=>{h(H=>{const V=new Set(H);return V.has(q)?V.delete(q):V.add(q),V})},L=q=>{const H=E.trim(),V=q??"";if(!H)return V||"N/A";const D=V.toLowerCase().indexOf(H.toLowerCase());if(D<0)return V||"N/A";const Z=V.slice(0,D),J=V.slice(D,D+H.length),M=V.slice(D+H.length);return d.jsxs("span",{children:[Z,d.jsx("span",{className:"bg-yellow-200 rounded px-0.5",children:J}),M]})},$=({node:q,depth:H})=>{const V=!!q.children?.length,D=l.has(q.id),{checked:Z,indeterminate:J}=R(q);return d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center gap-2 py-1",style:{paddingLeft:H*16},children:[d.jsx("button",{type:"button",className:Re("h-6 w-6 flex items-center justify-center rounded hover:bg-gray-100",!V&&"opacity-0 pointer-events-none"),onClick:()=>V&&F(q.id),"aria-label":V?D?"Collapse":"Expand":"No children",children:V?D?d.jsx(xs,{className:"h-4 w-4"}):d.jsx(bs,{className:"h-4 w-4"}):null}),d.jsx(W4,{id:`perm-menu-${q.id}`,checked:J?"indeterminate":Z,onCheckedChange:M=>I(q,!!M)}),d.jsx("label",{htmlFor:`perm-menu-${q.id}`,className:"text-sm leading-none cursor-pointer select-none",children:L(q.menuName??q.routeUrl??q.id)})]}),V&&D&&d.jsx("div",{children:q.children.map(M=>d.jsx($,{node:M,depth:H+1},M.id))})]})},U=async()=>{if(n){s(!0);try{await Gce({roleId:n,menuIds:Array.from(p)}),Qe.success("Role menu permissions saved.",{description:"Menu permissions have been updated successfully."}),r(!1)}catch(q){Qe.error("Failed to save menu permissions.",{description:q?.message?String(q.message):"Please try again."})}finally{s(!1)}}},G=async()=>{if(!(!n||p.size===0)){s(!0);try{await Kce({roleId:n,menuIds:Array.from(p)}),m(new Set),Qe.success("Role menu permissions cleared.",{description:"Selected permissions have been removed."})}catch(q){Qe.error("Failed to delete menu permissions.",{description:q?.message?String(q.message):"Please try again."})}finally{s(!1)}}};return d.jsx(_r,{open:e,onOpenChange:r,children:d.jsxs(dr,{className:"sm:max-w-none",style:{width:"50%"},children:[d.jsxs(jr,{children:[d.jsx(Or,{children:"Menu Permissions"}),d.jsx(xn,{children:i?`Set menu permissions for role: ${i}`:"Set menu permissions for this role."})]}),d.jsx("div",{className:"space-y-4 py-4",children:d.jsxs("div",{className:"rounded border border-gray-200 bg-white",children:[d.jsx("div",{className:"px-3 py-2 text-xs text-gray-500 border-b border-gray-200",children:d.jsxs("div",{className:"flex items-center gap-2 justify-between",children:[d.jsx("div",{children:g?"Loading menus...":`Total ${N} menus`}),d.jsx(Se,{value:w,onChange:q=>j(q.target.value),placeholder:"Search menus",className:"h-8 w-44 bg-white"})]})}),d.jsx(_s,{className:"h-72",children:d.jsxs("div",{className:"p-3 space-y-2",children:[C.map(q=>d.jsx($,{node:q,depth:0},q.id)),!g&&C.length===0&&d.jsx("div",{className:"text-sm text-gray-500 py-6 text-center",children:"No menus."})]})})]})}),d.jsxs(Dr,{className:"flex flex-row justify-end gap-2",children:[d.jsx(we,{variant:"outline",onClick:()=>r(!1),children:"Cancel"}),d.jsx(we,{variant:"destructive",disabled:o||p.size===0||!n,onClick:G,children:"Delete Selected"}),d.jsx(we,{disabled:o||!n,onClick:U,className:"bg-blue-600 text-white hover:bg-blue-700",children:o?"Saving...":"Save"})]})]})})}function xue({open:e,role:t,onOpenChange:r,onDeleted:n}){const[i,o]=S.useState(!1),s=S.useMemo(()=>(t?.roleName??"").trim()||t?.roleCode||t?.id||"this role",[t]),u=async()=>{if(t?.id){o(!0);try{await tue(t.id),Qe.success("Role deleted.",{description:"The role has been removed successfully."}),r(!1),n()}catch(f){Qe.error("Failed to delete role.",{description:f?.message?String(f.message):"Please try again."})}finally{o(!1)}}};return d.jsx(_r,{open:e,onOpenChange:r,children:d.jsxs(dr,{className:"sm:max-w-none",style:{width:"30%"},children:[d.jsxs(jr,{children:[d.jsx(Or,{children:"Delete Role"}),d.jsx(xn,{children:"This action cannot be undone."})]}),d.jsxs("div",{className:"text-sm text-gray-700",children:["Are you sure you want to delete ",d.jsx("span",{className:"font-medium",children:s}),"?"]}),d.jsxs(Dr,{className:"flex-row flex-wrap justify-end",children:[d.jsx(we,{className:"min-w-24",variant:"outline",onClick:()=>r(!1),children:"Cancel"}),d.jsx(we,{className:"min-w-24",variant:"destructive",disabled:i,onClick:u,children:i?"Deleting...":"Delete"})]})]})})}function bue({open:e,onOpenChange:t}){return d.jsx(_r,{open:e,onOpenChange:t,children:d.jsxs(dr,{children:[d.jsx(jr,{children:d.jsx(Or,{children:"Create New Partner"})}),d.jsxs("div",{className:"space-y-4 py-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"Partner Name"}),d.jsx(Se,{placeholder:"Company Name"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"Contact Email"}),d.jsx(Se,{placeholder:"admin@partner.com"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"Phone Number"}),d.jsx(Se,{type:"tel",placeholder:"+1 (555) 000-0000"})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(mn,{id:"partner-status",defaultChecked:!0}),d.jsx(me,{htmlFor:"partner-status",children:"Active"})]})]}),d.jsxs(Dr,{children:[d.jsx(we,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),d.jsx(we,{onClick:()=>t(!1),className:"bg-blue-600 text-white hover:bg-blue-700",children:"Save Partner"})]})]})})}function wue({open:e,onOpenChange:t}){return d.jsx(_r,{open:e,onOpenChange:t,children:d.jsxs(dr,{children:[d.jsx(jr,{children:d.jsx(Or,{children:"Create New Group"})}),d.jsxs("div",{className:"space-y-4 py-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"Group Name"}),d.jsx(Se,{placeholder:"e.g. West Coast Region"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"Assign to Partner"}),d.jsxs(Je,{children:[d.jsx(tt,{children:d.jsx(et,{placeholder:"Select Partner"})}),d.jsx(rt,{children:Y4.map(r=>d.jsx(Ee,{value:r.id,children:r.name},r.id))})]})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx(mn,{id:"group-status",defaultChecked:!0}),d.jsx(me,{htmlFor:"group-status",children:"Active"})]})]}),d.jsxs(Dr,{children:[d.jsx(we,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),d.jsx(we,{onClick:()=>t(!1),className:"bg-blue-600 text-white hover:bg-blue-700",children:"Save Group"})]})]})})}function Sue({open:e,member:t,onOpenChange:r,onSaved:n}){const i=!!t?.id,[o,s]=S.useState(!1),[u,f]=S.useState(""),[l,h]=S.useState(""),[p,m]=S.useState(""),[g,b]=S.useState(""),[y,w]=S.useState(""),[j,O]=S.useState(""),[E,A]=S.useState(!0),[N,C]=S.useState(new Set),[T,R]=S.useState([]),[I,F]=S.useState(!1),[L,$]=S.useState([]),[U,G]=S.useState(!1),[q,H]=S.useState(""),V=S.useRef(null),D=()=>{f(""),h(""),m(""),b(""),w(""),O(""),A(!0),C(new Set)},Z=async ie=>{const fe=[];let K=1;const ce=100;for(;;){const le=await K4({skipCount:K,maxResultCount:ce},ie);if(fe.push(...le.items??[]),!le.items||le.items.length200))break}const te=new Map;for(const le of fe)le.id&&!te.has(le.id)&&te.set(le.id,le);return Array.from(te.values())},J=async ie=>{const fe=[];let K=1;const ce=200;for(;;){const le=await X4({skipCount:K,maxResultCount:ce},ie);if(fe.push(...le.items??[]),!le.items||le.items.length200))break}const te=new Map;for(const le of fe)le.id&&!te.has(le.id)&&te.set(le.id,le);return Array.from(te.values())};S.useEffect(()=>{if(!e)return;V.current?.abort();const ie=new AbortController;return V.current=ie,s(!1),D(),F(!0),G(!0),(async()=>{try{const[K,ce]=await Promise.all([Z(ie.signal),J(ie.signal)]);if(R(K),$(ce),t?.id){const te=await cue(t.id,ie.signal);f(te.fullName??""),h(te.userName??""),b(te.email??""),w(te.phone??"");let le=te.roleId??"";if(!le&&te.roleName){const Y=String(te.roleName).trim(),_e=K.find(Oe=>String(Oe.id).trim()===Y||String(Oe.roleName??"").trim()===Y||String(Oe.roleCode??"").trim()===Y);_e?.id&&(le=_e.id)}O(le),A(!!te.state);const ge=te.locationIds&&te.locationIds.length?te.locationIds:[];if(ge.length)C(new Set(ge));else if(te.locations?.length){const Y=new Set(te.locations),_e=new Set;for(const Oe of ce){const Ve=`${(Oe.locationCode??"").trim()} - ${(Oe.locationName??"").trim()}`.trim(),nt=(Oe.locationName??"").trim(),lt=(Oe.locationCode??"").trim();(Y.has(Ve)||Y.has(nt)||Y.has(lt))&&_e.add(Oe.id)}C(_e)}}}catch(K){K?.name!=="AbortError"&&Qe.error("Failed to load user form.",{description:K?.message?String(K.message):"Please try again."})}finally{F(!1),G(!1)}})(),()=>ie.abort()},[e,t?.id]),S.useMemo(()=>!(!u.trim()||!l.trim()||!j.trim()||N.size===0||!i&&!p.trim()),[u,l,j,N,i,p]);const M=(ie,fe)=>{C(K=>{const ce=new Set(K);return fe?ce.add(ie):ce.delete(ie),ce})},B=async()=>{s(!0);try{const ie=[];if(u.trim()||ie.push("Full Name"),l.trim()||ie.push("User Name"),j.trim()||ie.push("Role"),N.size===0&&ie.push("Locations"),!i&&!p.trim()&&ie.push("Password"),ie.length){Qe.error("Missing required fields.",{description:`Please fill: ${ie.join("、")}.`});return}const fe=Array.from(N);if(i&&t?.id)await hue(t.id,{fullName:u.trim(),userName:l.trim(),password:p.trim()?p.trim():null,email:g.trim()?g.trim():null,phone:y.trim()?y.trim():null,roleId:j.trim(),locationIds:fe,state:E}),Qe.success("User updated.",{description:"Changes have been saved successfully."});else{const K={fullName:u.trim(),userName:l.trim(),password:p.trim(),email:g.trim()?g.trim():null,phone:y.trim()?y.trim():null,roleId:j.trim(),locationIds:fe,state:E};await due(K),Qe.success("User created.",{description:"A new user has been created successfully."})}r(!1),n()}catch(ie){Qe.error(i?"Failed to update user.":"Failed to create user.",{description:ie?.message?String(ie.message):"Please try again."})}finally{s(!1)}},ee=ie=>{const fe=(ie.locationCode??"").trim(),K=(ie.locationName??"").trim();return fe&&K?`${fe} - ${K}`:K||fe||ie.id},ae=S.useMemo(()=>{const ie=q.trim().toLowerCase();return ie?L.filter(fe=>ee(fe).toLowerCase().includes(ie)):L},[L,q]);return d.jsx(_r,{open:e,onOpenChange:r,children:d.jsxs(dr,{className:"sm:max-w-none",style:{width:"50%"},children:[d.jsxs(jr,{children:[d.jsx(Or,{children:i?"Edit User":"New User"}),d.jsx(xn,{children:"Role is single-select; Locations is multi-select."})]}),d.jsxs("div",{className:"space-y-4 py-4 max-h-[70vh] overflow-y-auto pr-1",children:[d.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"Full Name *"}),d.jsx(Se,{value:u,onChange:ie=>f(ie.target.value),placeholder:"John Doe"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"User Name *"}),d.jsx(Se,{value:l,onChange:ie=>h(ie.target.value),placeholder:"username"})]})]}),!i&&d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"Password *"}),d.jsx(Se,{type:"password",value:p,onChange:ie=>m(ie.target.value),placeholder:"Enter password",autoComplete:"new-password",className:"w-full"})]}),i&&d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"Password (Optional)"}),d.jsx(Se,{type:"password",value:p,onChange:ie=>m(ie.target.value),placeholder:"Enter new password (optional)",autoComplete:"new-password",className:"w-full"})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"Email"}),d.jsx(Se,{type:"email",value:g,onChange:ie=>b(ie.target.value),placeholder:"john@example.com"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"Phone"}),d.jsx(Se,{type:"tel",value:y,onChange:ie=>w(ie.target.value),placeholder:"+1 (555) 000-0000"})]})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"Role *"}),d.jsxs(Je,{value:j,onValueChange:O,disabled:I,children:[d.jsx(tt,{className:"h-10 rounded-md border border-gray-200 bg-white",children:d.jsx(et,{placeholder:I?"Loading roles...":"Select role"})}),d.jsx(rt,{children:T.map(ie=>d.jsx(Ee,{value:ie.id,children:ie.roleName??ie.roleCode??ie.id},ie.id))})]})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"Locations *"}),d.jsxs("div",{className:"flex items-center justify-between gap-2",children:[d.jsx(Se,{value:q,onChange:ie=>H(ie.target.value),placeholder:"Search locations",className:"h-9"}),d.jsxs("div",{className:"text-xs text-gray-500 shrink-0",children:[N.size," selected"]})]}),d.jsx(_s,{className:"h-[180px] w-full border rounded-md p-2",children:d.jsx("div",{className:"space-y-2",children:U?d.jsx("div",{className:"text-sm text-gray-500 py-2",children:"Loading..."}):ae.map(ie=>d.jsxs("div",{className:"flex items-center space-x-2",children:[d.jsx(W4,{id:`loc-${ie.id}`,checked:N.has(ie.id),onCheckedChange:fe=>M(ie.id,!!fe)}),d.jsx("label",{htmlFor:`loc-${ie.id}`,className:"text-sm cursor-pointer w-full hover:bg-gray-50 p-1 rounded",children:ee(ie)})]},ie.id))})}),d.jsx("p",{className:"text-xs text-gray-500",children:"* Users must be assigned to at least one location."})]}),d.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[d.jsx(mn,{id:"member-status",checked:E,onCheckedChange:A}),d.jsx(me,{htmlFor:"member-status",children:E?"Active":"Inactive"})]})]}),d.jsxs(Dr,{children:[d.jsx(we,{variant:"outline",onClick:()=>r(!1),children:"Cancel"}),d.jsx(we,{disabled:o,onClick:B,className:"bg-blue-600 text-white hover:bg-blue-700",children:o?"Saving...":i?"Save":"Create"})]})]})})}function _ue({open:e,member:t,onOpenChange:r,onDeleted:n}){const[i,o]=S.useState(!1),s=S.useMemo(()=>{const f=(t?.fullName??"").trim(),l=(t?.userName??"").trim();return f||l||"this user"},[t?.fullName,t?.userName]),u=async()=>{if(t?.id){o(!0);try{await pue(t.id),Qe.success("User deleted.",{description:"The user has been removed successfully."}),r(!1),n()}catch(f){Qe.error("Failed to delete user.",{description:f?.message?String(f.message):"Please try again."})}finally{o(!1)}}};return d.jsx(_r,{open:e,onOpenChange:r,children:d.jsxs(dr,{className:"sm:max-w-none",style:{width:"30%"},children:[d.jsxs(jr,{children:[d.jsx(Or,{children:"Delete User"}),d.jsx(xn,{children:"This action cannot be undone."})]}),d.jsxs("div",{className:"text-sm text-gray-700",children:["Are you sure you want to delete ",d.jsx("span",{className:"font-medium",children:s}),"?"]}),d.jsxs(Dr,{className:"flex-row flex-wrap justify-end",children:[d.jsx(we,{variant:"outline",className:"min-w-24",onClick:()=>r(!1),children:"Cancel"}),d.jsx(we,{variant:"destructive",className:"min-w-24",disabled:i,onClick:u,children:i?"Deleting...":"Delete"})]})]})})}const jue=[{id:"1-251201",productName:"Whole Milk",category:"Dairy",template:'2"x2" Basic',printedAt:"2024-03-20 09:30 AM",printedBy:"Alice Johnson",location:"Downtown Store (101)",expiryDate:"2024-03-27",status:"Valid"},{id:"2-251201",productName:"Ground Beef",category:"Meat",template:'2"x2" Basic',printedAt:"2024-03-20 10:15 AM",printedBy:"Bob Smith",location:"Uptown Store (102)",expiryDate:"2024-03-23",status:"Valid"},{id:"3-251201",productName:"Croissant",category:"Bakery",template:'2"x2" Basic',printedAt:"2024-03-19 14:00 PM",printedBy:"Charlie Brown",location:"Downtown Store (101)",expiryDate:"2024-03-20",status:"Expired"},{id:"4-251201",productName:"Caesar Salad",category:"Deli",template:`2"x6" G'n'G !!!`,printedAt:"2024-03-18 11:45 AM",printedBy:"Alice Johnson",location:"Downtown Store (101)",expiryDate:"2024-03-21",status:"Expiring Soon"},{id:"5-251201",productName:"Orange Juice",category:"Beverage",template:'2"x2" Basic',printedAt:"2024-03-18 08:20 AM",printedBy:"Bob Smith",location:"Airport Kiosk (201)",expiryDate:"2024-03-25",status:"Valid"}],Oue=[{name:"Dairy",count:450},{name:"Meat",count:320},{name:"Bakery",count:280},{name:"Deli",count:190},{name:"Produce",count:150},{name:"Beverage",count:120}],Eue=[{date:"Mon",count:120},{date:"Tue",count:132},{date:"Wed",count:101},{date:"Thu",count:134},{date:"Fri",count:190},{date:"Sat",count:230},{date:"Sun",count:210}];function Pue(){const[e,t]=S.useState("print-log"),r=n=>{Qe.success(`Reprinting label ${n}`,{description:"Watermark 'RePrint' applied."})};return d.jsxs("div",{className:"h-full flex flex-col",children:[d.jsxs("div",{className:"pb-4",children:[d.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[d.jsxs(Je,{defaultValue:"partner-a",children:[d.jsx(tt,{className:"w-[140px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:d.jsx(et,{placeholder:"Partner"})}),d.jsx(rt,{children:d.jsx(Ee,{value:"partner-a",children:"Partner A"})})]}),d.jsxs(Je,{defaultValue:"group-b",children:[d.jsx(tt,{className:"w-[140px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:d.jsx(et,{placeholder:"Group"})}),d.jsx(rt,{children:d.jsx(Ee,{value:"group-b",children:"Group B"})})]}),d.jsxs(Je,{defaultValue:"loc-12345",children:[d.jsx(tt,{className:"w-[160px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:d.jsx(et,{placeholder:"Location"})}),d.jsxs(rt,{children:[d.jsx(Ee,{value:"loc-12345",children:"Downtown Store"}),d.jsx(Ee,{value:"all",children:"All Locations"})]})]}),d.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[d.jsx("span",{className:"text-sm font-medium text-gray-700",children:"Period Search:"}),d.jsxs("div",{className:"flex items-center bg-white border border-gray-300 rounded-md h-10 px-2",style:{minHeight:40},children:[d.jsx($8,{className:"w-4 h-4 text-gray-500 mr-2 shrink-0"}),d.jsx("input",{type:"date",className:"text-sm outline-none w-32 bg-transparent"}),d.jsx("span",{className:"mx-2 text-gray-400",children:"-"}),d.jsx("input",{type:"date",className:"text-sm outline-none w-32 bg-transparent"})]})]}),d.jsxs("div",{className:"flex items-center w-64 rounded-md border border-gray-300 bg-white overflow-hidden shrink-0",style:{height:40},children:[d.jsx(Vw,{className:"h-4 w-4 text-gray-400 shrink-0 ml-3 pointer-events-none"}),d.jsx(Se,{placeholder:"Search Product or Category...",className:"flex-1 min-w-0 border-0 bg-transparent focus-visible:ring-0 focus-visible:ring-offset-0 py-2 px-2 h-full placeholder:text-gray-500"})]}),d.jsx("div",{className:"flex-1 min-w-2"}),d.jsxs(we,{variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 bg-white hover:bg-gray-50 gap-2 shrink-0",children:[d.jsx(Ww,{className:"w-4 h-4"})," Export Report"]})]}),d.jsx("div",{className:"w-full border-b border-gray-200 mt-4",children:d.jsxs("div",{className:"flex overflow-x-auto w-fit",children:[d.jsx("button",{onClick:()=>t("print-log"),style:e==="print-log"?{borderBottomWidth:2,borderBottomStyle:"solid",borderBottomColor:"#2563eb"}:void 0,className:Re("px-4 py-2.5 text-sm font-medium whitespace-nowrap cursor-pointer transition-colors -mb-px border-b-2",e==="print-log"?"text-blue-600":"border-b-transparent text-gray-600 hover:text-gray-800"),children:"Print Log"}),d.jsx("button",{onClick:()=>t("label-report"),style:e==="label-report"?{borderBottomWidth:2,borderBottomStyle:"solid",borderBottomColor:"#2563eb"}:void 0,className:Re("px-4 py-2.5 text-sm font-medium whitespace-nowrap cursor-pointer transition-colors -mb-px border-b-2",e==="label-report"?"text-blue-600":"border-b-transparent text-gray-600 hover:text-gray-800"),children:"Label Report"})]})})]}),d.jsxs("div",{className:"flex-1 overflow-auto pt-6",children:[e==="print-log"&&d.jsx("div",{className:"bg-white border border-gray-200 shadow-sm rounded-md overflow-hidden",children:d.jsxs(br,{children:[d.jsx(wr,{children:d.jsxs(Ge,{className:"bg-gray-100 hover:bg-gray-100",children:[d.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"Label ID"}),d.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"Product Name"}),d.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"Category"}),d.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"Template"}),d.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"Printed At"}),d.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"Printed By"}),d.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"Location"}),d.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"Expiry Date"}),d.jsx(ye,{className:"text-gray-900 font-bold text-center",children:"Action"})]})}),d.jsx(Sr,{children:jue.map(n=>d.jsxs(Ge,{children:[d.jsx(ue,{className:"border-r font-numeric text-gray-600",children:n.id}),d.jsx(ue,{className:"border-r font-medium",children:n.productName}),d.jsx(ue,{className:"border-r",children:d.jsx(Gn,{variant:"secondary",className:"bg-blue-50 text-blue-700 hover:bg-blue-50 border-blue-200",children:n.category})}),d.jsx(ue,{className:"border-r text-gray-600 text-sm",children:(()=>{const i=n.template.endsWith(" !!!"),o=i?n.template.slice(0,-4):n.template,s=o.lastIndexOf(" "),u=o.slice(0,s+1),f=o.slice(s+1);return d.jsxs(d.Fragment,{children:[u,d.jsx("span",{className:"font-bold text-gray-900",children:f}),i&&d.jsx("span",{className:"text-red-600",children:" !!!"})]})})()}),d.jsx(ue,{className:"border-r text-gray-600 text-sm font-numeric",children:n.printedAt}),d.jsx(ue,{className:"border-r text-gray-600 text-sm",children:n.printedBy}),d.jsx(ue,{className:"border-r text-gray-600 text-sm font-numeric",children:n.location}),d.jsx(ue,{className:"border-r",children:d.jsx("span",{className:Re("text-sm font-medium font-numeric",n.status==="Expired"?"text-red-600":n.status==="Expiring Soon"?"text-orange-500":"text-green-600"),children:n.expiryDate})}),d.jsx(ue,{className:"text-center",children:d.jsxs(we,{size:"sm",variant:"outline",className:"h-8 gap-1 hover:bg-gray-100 border-gray-300",onClick:()=>r(n.id),children:[d.jsx(mM,{className:"w-3 h-3"})," Reprint"]})})]},n.id))})]})}),e==="label-report"&&d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[d.jsxs(Vr,{children:[d.jsxs(Tn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[d.jsx(kn,{className:"text-sm font-medium",children:"Total Labels Printed"}),d.jsx(ws,{className:"h-4 w-4 text-muted-foreground"})]}),d.jsxs(dn,{children:[d.jsx("div",{className:"text-2xl font-bold",children:"2,543"}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"+20.1% from last month"})]})]}),d.jsxs(Vr,{children:[d.jsxs(Tn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[d.jsx(kn,{className:"text-sm font-medium",children:"Most Printed Category"}),d.jsx(F8,{className:"h-4 w-4 text-muted-foreground"})]}),d.jsxs(dn,{children:[d.jsx("div",{className:"text-2xl font-bold",children:"Dairy"}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"450 labels generated"})]})]}),d.jsxs(Vr,{children:[d.jsxs(Tn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[d.jsx(kn,{className:"text-sm font-medium",children:"Top Product"}),d.jsx(lM,{className:"h-4 w-4 text-muted-foreground"})]}),d.jsxs(dn,{children:[d.jsx("div",{className:"text-2xl font-bold",children:"Whole Milk"}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"182 labels generated"})]})]}),d.jsxs(Vr,{children:[d.jsxs(Tn,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[d.jsx(kn,{className:"text-sm font-medium",children:"Avg. Daily Prints"}),d.jsx(SF,{className:"h-4 w-4 text-muted-foreground"})]}),d.jsxs(dn,{children:[d.jsx("div",{className:"text-2xl font-bold",children:"85"}),d.jsx("p",{className:"text-xs text-muted-foreground",children:"+12% from last week"})]})]})]}),d.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[d.jsxs(Vr,{className:"col-span-1",children:[d.jsxs(Tn,{children:[d.jsx(kn,{children:"Labels by Category"}),d.jsx(hh,{children:"Distribution of printed labels across product categories."})]}),d.jsx(dn,{className:"h-[300px]",children:d.jsx(Oh,{width:"100%",height:"100%",children:d.jsxs(jne,{data:Oue,children:[d.jsx(fp,{strokeDasharray:"3 3",vertical:!1}),d.jsx(aa,{dataKey:"name",fontSize:12,tickLine:!1,axisLine:!1}),d.jsx(sa,{fontSize:12,tickLine:!1,axisLine:!1,tickFormatter:n=>`${n}`}),d.jsx(Gr,{}),d.jsx(xa,{dataKey:"count",fill:"#facc15",radius:[4,4,0,0]})]})})})]}),d.jsxs(Vr,{className:"col-span-1",children:[d.jsxs(Tn,{children:[d.jsx(kn,{children:"Print Volume Trends"}),d.jsx(hh,{children:"Daily label printing volume for the last 7 days."})]}),d.jsx(dn,{className:"h-[300px]",children:d.jsx(Oh,{width:"100%",height:"100%",children:d.jsxs(g$,{data:Eue,children:[d.jsx(fp,{strokeDasharray:"3 3",vertical:!1}),d.jsx(aa,{dataKey:"date",fontSize:12,tickLine:!1,axisLine:!1}),d.jsx(sa,{fontSize:12,tickLine:!1,axisLine:!1}),d.jsx(Gr,{}),d.jsx(cl,{type:"monotone",dataKey:"count",stroke:"#dc2626",strokeWidth:2,dot:{r:4},activeDot:{r:6}})]})})})]})]}),d.jsxs(Vr,{children:[d.jsx(Tn,{children:d.jsx(kn,{children:"Most Used Products"})}),d.jsx(dn,{children:d.jsxs(br,{children:[d.jsx(wr,{children:d.jsxs(Ge,{children:[d.jsx(ye,{children:"Product Name"}),d.jsx(ye,{children:"Category"}),d.jsx(ye,{className:"text-right",children:"Total Printed"}),d.jsx(ye,{className:"text-right",children:"Usage %"})]})}),d.jsxs(Sr,{children:[d.jsxs(Ge,{children:[d.jsx(ue,{className:"font-medium",children:"Whole Milk"}),d.jsx(ue,{children:"Dairy"}),d.jsx(ue,{className:"text-right",children:"182"}),d.jsx(ue,{className:"text-right",children:"7.2%"})]}),d.jsxs(Ge,{children:[d.jsx(ue,{className:"font-medium",children:"Ground Beef 80/20"}),d.jsx(ue,{children:"Meat"}),d.jsx(ue,{className:"text-right",children:"145"}),d.jsx(ue,{className:"text-right",children:"5.7%"})]}),d.jsxs(Ge,{children:[d.jsx(ue,{className:"font-medium",children:"Chicken Breast"}),d.jsx(ue,{children:"Meat"}),d.jsx(ue,{className:"text-right",children:"132"}),d.jsx(ue,{className:"text-right",children:"5.2%"})]}),d.jsxs(Ge,{children:[d.jsx(ue,{className:"font-medium",children:"Sliced Ham"}),d.jsx(ue,{children:"Deli"}),d.jsx(ue,{className:"text-right",children:"98"}),d.jsx(ue,{className:"text-right",children:"3.8%"})]})]})]})})]})]})]})]})}var Nue=Symbol("radix.slottable");function Aue(e){const t=({children:r})=>d.jsx(d.Fragment,{children:r});return t.displayName=`${e}.Slottable`,t.__radixId=Nue,t}var[Mm]=Bn("Tooltip",[dl]),Im=dl(),Q4="TooltipProvider",Cue=700,zw="tooltip.open",[Tue,E_]=Mm(Q4),Z4=e=>{const{__scopeTooltip:t,delayDuration:r=Cue,skipDelayDuration:n=300,disableHoverableContent:i=!1,children:o}=e,s=S.useRef(!0),u=S.useRef(!1),f=S.useRef(0);return S.useEffect(()=>{const l=f.current;return()=>window.clearTimeout(l)},[]),d.jsx(Tue,{scope:t,isOpenDelayedRef:s,delayDuration:r,onOpen:S.useCallback(()=>{window.clearTimeout(f.current),s.current=!1},[]),onClose:S.useCallback(()=>{window.clearTimeout(f.current),f.current=window.setTimeout(()=>s.current=!0,n)},[n]),isPointerInTransitRef:u,onPointerInTransitChange:S.useCallback(l=>{u.current=l},[]),disableHoverableContent:i,children:o})};Z4.displayName=Q4;var hu="Tooltip",[kue,Du]=Mm(hu),J4=e=>{const{__scopeTooltip:t,children:r,open:n,defaultOpen:i,onOpenChange:o,disableHoverableContent:s,delayDuration:u}=e,f=E_(hu,e.__scopeTooltip),l=Im(t),[h,p]=S.useState(null),m=Jn(),g=S.useRef(0),b=s??f.disableHoverableContent,y=u??f.delayDuration,w=S.useRef(!1),[j,O]=Mi({prop:n,defaultProp:i??!1,onChange:T=>{T?(f.onOpen(),document.dispatchEvent(new CustomEvent(zw))):f.onClose(),o?.(T)},caller:hu}),E=S.useMemo(()=>j?w.current?"delayed-open":"instant-open":"closed",[j]),A=S.useCallback(()=>{window.clearTimeout(g.current),g.current=0,w.current=!1,O(!0)},[O]),N=S.useCallback(()=>{window.clearTimeout(g.current),g.current=0,O(!1)},[O]),C=S.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{w.current=!0,O(!0),g.current=0},y)},[y,O]);return S.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]),d.jsx(m_,{...l,children:d.jsx(kue,{scope:t,contentId:m,open:j,stateAttribute:E,trigger:h,onTriggerChange:p,onTriggerEnter:S.useCallback(()=>{f.isOpenDelayedRef.current?C():A()},[f.isOpenDelayedRef,C,A]),onTriggerLeave:S.useCallback(()=>{b?N():(window.clearTimeout(g.current),g.current=0)},[N,b]),onOpen:A,onClose:N,disableHoverableContent:b,children:r})})};J4.displayName=hu;var qw="TooltipTrigger",e5=S.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,i=Du(qw,r),o=E_(qw,r),s=Im(r),u=S.useRef(null),f=Ze(t,u,i.onTriggerChange),l=S.useRef(!1),h=S.useRef(!1),p=S.useCallback(()=>l.current=!1,[]);return S.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),d.jsx(gm,{asChild:!0,...s,children:d.jsx(Ue.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...n,ref:f,onPointerMove:Ie(e.onPointerMove,m=>{m.pointerType!=="touch"&&!h.current&&!o.isPointerInTransitRef.current&&(i.onTriggerEnter(),h.current=!0)}),onPointerLeave:Ie(e.onPointerLeave,()=>{i.onTriggerLeave(),h.current=!1}),onPointerDown:Ie(e.onPointerDown,()=>{i.open&&i.onClose(),l.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:Ie(e.onFocus,()=>{l.current||i.onOpen()}),onBlur:Ie(e.onBlur,i.onClose),onClick:Ie(e.onClick,i.onClose)})})});e5.displayName=qw;var P_="TooltipPortal",[Rue,Mue]=Mm(P_,{forceMount:void 0}),t5=e=>{const{__scopeTooltip:t,forceMount:r,children:n,container:i}=e,o=Du(P_,t);return d.jsx(Rue,{scope:t,forceMount:r,children:d.jsx(Mr,{present:r||o.open,children:d.jsx(Eu,{asChild:!0,container:i,children:n})})})};t5.displayName=P_;var Ys="TooltipContent",r5=S.forwardRef((e,t)=>{const r=Mue(Ys,e.__scopeTooltip),{forceMount:n=r.forceMount,side:i="top",...o}=e,s=Du(Ys,e.__scopeTooltip);return d.jsx(Mr,{present:n||s.open,children:s.disableHoverableContent?d.jsx(n5,{side:i,...o,ref:t}):d.jsx(Iue,{side:i,...o,ref:t})})}),Iue=S.forwardRef((e,t)=>{const r=Du(Ys,e.__scopeTooltip),n=E_(Ys,e.__scopeTooltip),i=S.useRef(null),o=Ze(t,i),[s,u]=S.useState(null),{trigger:f,onClose:l}=r,h=i.current,{onPointerInTransitChange:p}=n,m=S.useCallback(()=>{u(null),p(!1)},[p]),g=S.useCallback((b,y)=>{const w=b.currentTarget,j={x:b.clientX,y:b.clientY},O=Bue(j,w.getBoundingClientRect()),E=Fue(j,O),A=zue(y.getBoundingClientRect()),N=Uue([...E,...A]);u(N),p(!0)},[p]);return S.useEffect(()=>()=>m(),[m]),S.useEffect(()=>{if(f&&h){const b=w=>g(w,h),y=w=>g(w,f);return f.addEventListener("pointerleave",b),h.addEventListener("pointerleave",y),()=>{f.removeEventListener("pointerleave",b),h.removeEventListener("pointerleave",y)}}},[f,h,g,m]),S.useEffect(()=>{if(s){const b=y=>{const w=y.target,j={x:y.clientX,y:y.clientY},O=f?.contains(w)||h?.contains(w),E=!que(j,s);O?m():E&&(m(),l())};return document.addEventListener("pointermove",b),()=>document.removeEventListener("pointermove",b)}},[f,h,s,l,m]),d.jsx(n5,{...e,ref:o})}),[Due,Lue]=Mm(hu,{isInside:!1}),$ue=Aue("TooltipContent"),n5=S.forwardRef((e,t)=>{const{__scopeTooltip:r,children:n,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:s,...u}=e,f=Du(Ys,r),l=Im(r),{onClose:h}=f;return S.useEffect(()=>(document.addEventListener(zw,h),()=>document.removeEventListener(zw,h)),[h]),S.useEffect(()=>{if(f.trigger){const p=m=>{m.target?.contains(f.trigger)&&h()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[f.trigger,h]),d.jsx(ju,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:p=>p.preventDefault(),onDismiss:h,children:d.jsxs(v_,{"data-state":f.stateAttribute,...l,...u,ref:t,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[d.jsx($ue,{children:n}),d.jsx(Due,{scope:r,isInside:!0,children:d.jsx(Noe,{id:f.contentId,role:"tooltip",children:i||n})})]})})});r5.displayName=Ys;var i5="TooltipArrow",o5=S.forwardRef((e,t)=>{const{__scopeTooltip:r,...n}=e,i=Im(r);return Lue(i5,r).isInside?null:d.jsx(g_,{...i,...n,ref:t})});o5.displayName=i5;function Bue(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(r,n,i,o)){case o:return"left";case i:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function Fue(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r});break}return n}function zue(e){const{top:t,right:r,bottom:n,left:i}=e;return[{x:i,y:t},{x:r,y:t},{x:r,y:n},{x:i,y:n}]}function que(e,t){const{x:r,y:n}=e;let i=!1;for(let o=0,s=t.length-1;on!=m>n&&r<(p-l)*(n-h)/(m-h)+l&&(i=!i)}return i}function Uue(e){const t=e.slice();return t.sort((r,n)=>r.xn.x?1:r.yn.y?1:0),Wue(t)}function Wue(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n=2;){const o=t[t.length-1],s=t[t.length-2];if((o.x-s.x)*(i.y-s.y)>=(o.y-s.y)*(i.x-s.x))t.pop();else break}t.push(i)}t.pop();const r=[];for(let n=e.length-1;n>=0;n--){const i=e[n];for(;r.length>=2;){const o=r[r.length-1],s=r[r.length-2];if((o.x-s.x)*(i.y-s.y)>=(o.y-s.y)*(i.x-s.x))r.pop();else break}r.push(i)}return r.pop(),t.length===1&&r.length===1&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}var Hue=Z4,Vue=J4,Gue=e5,Kue=t5,Xue=r5,Yue=o5;function Que({delayDuration:e=0,...t}){return d.jsx(Hue,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function Xb({...e}){return d.jsx(Que,{children:d.jsx(Vue,{"data-slot":"tooltip",...e})})}function Yb({...e}){return d.jsx(Gue,{"data-slot":"tooltip-trigger",...e})}function Qb({className:e,sideOffset:t=0,children:r,...n}){return d.jsx(Kue,{children:d.jsxs(Xue,{"data-slot":"tooltip-content",sideOffset:t,className:Re("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",e),...n,children:[r,d.jsx(Yue,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}function Zue(e){const t=Jue(e),r=S.forwardRef((n,i)=>{const{children:o,...s}=n,u=S.Children.toArray(o),f=u.find(tfe);if(f){const l=f.props.children,h=u.map(p=>p===f?S.Children.count(l)>1?S.Children.only(null):S.isValidElement(l)?l.props.children:null:p);return d.jsx(t,{...s,ref:i,children:S.isValidElement(l)?S.cloneElement(l,void 0,h):null})}return d.jsx(t,{...s,ref:i,children:o})});return r.displayName=`${e}.Slot`,r}function Jue(e){const t=S.forwardRef((r,n)=>{const{children:i,...o}=r;if(S.isValidElement(i)){const s=nfe(i),u=rfe(o,i.props);return i.type!==S.Fragment&&(u.ref=n?ha(n,s):s),S.cloneElement(i,u)}return S.Children.count(i)>1?S.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var efe=Symbol("radix.slottable");function tfe(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===efe}function rfe(e,t){const r={...t};for(const n in t){const i=e[n],o=t[n];/^on[A-Z]/.test(n)?i&&o?r[n]=(...u)=>{const f=o(...u);return i(...u),f}:i&&(r[n]=i):n==="style"?r[n]={...i,...o}:n==="className"&&(r[n]=[i,o].filter(Boolean).join(" "))}return{...e,...r}}function nfe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}var Dm="Popover",[a5]=Bn(Dm,[dl]),Lu=dl(),[ife,So]=a5(Dm),s5=e=>{const{__scopePopover:t,children:r,open:n,defaultOpen:i,onOpenChange:o,modal:s=!1}=e,u=Lu(t),f=S.useRef(null),[l,h]=S.useState(!1),[p,m]=Mi({prop:n,defaultProp:i??!1,onChange:o,caller:Dm});return d.jsx(m_,{...u,children:d.jsx(ife,{scope:t,contentId:Jn(),triggerRef:f,open:p,onOpenChange:m,onOpenToggle:S.useCallback(()=>m(g=>!g),[m]),hasCustomAnchor:l,onCustomAnchorAdd:S.useCallback(()=>h(!0),[]),onCustomAnchorRemove:S.useCallback(()=>h(!1),[]),modal:s,children:r})})};s5.displayName=Dm;var l5="PopoverAnchor",ofe=S.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,i=So(l5,r),o=Lu(r),{onCustomAnchorAdd:s,onCustomAnchorRemove:u}=i;return S.useEffect(()=>(s(),()=>u()),[s,u]),d.jsx(gm,{...o,...n,ref:t})});ofe.displayName=l5;var c5="PopoverTrigger",u5=S.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,i=So(c5,r),o=Lu(r),s=Ze(t,i.triggerRef),u=d.jsx(Ue.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":m5(i.open),...n,ref:s,onClick:Ie(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?u:d.jsx(gm,{asChild:!0,...o,children:u})});u5.displayName=c5;var N_="PopoverPortal",[afe,sfe]=a5(N_,{forceMount:void 0}),f5=e=>{const{__scopePopover:t,forceMount:r,children:n,container:i}=e,o=So(N_,t);return d.jsx(afe,{scope:t,forceMount:r,children:d.jsx(Mr,{present:r||o.open,children:d.jsx(Eu,{asChild:!0,container:i,children:n})})})};f5.displayName=N_;var Qs="PopoverContent",d5=S.forwardRef((e,t)=>{const r=sfe(Qs,e.__scopePopover),{forceMount:n=r.forceMount,...i}=e,o=So(Qs,e.__scopePopover);return d.jsx(Mr,{present:n||o.open,children:o.modal?d.jsx(cfe,{...i,ref:t}):d.jsx(ufe,{...i,ref:t})})});d5.displayName=Qs;var lfe=Zue("PopoverContent.RemoveScroll"),cfe=S.forwardRef((e,t)=>{const r=So(Qs,e.__scopePopover),n=S.useRef(null),i=Ze(t,n),o=S.useRef(!1);return S.useEffect(()=>{const s=n.current;if(s)return x_(s)},[]),d.jsx(xm,{as:lfe,allowPinchZoom:!0,children:d.jsx(h5,{...e,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Ie(e.onCloseAutoFocus,s=>{s.preventDefault(),o.current||r.triggerRef.current?.focus()}),onPointerDownOutside:Ie(e.onPointerDownOutside,s=>{const u=s.detail.originalEvent,f=u.button===0&&u.ctrlKey===!0,l=u.button===2||f;o.current=l},{checkForDefaultPrevented:!1}),onFocusOutside:Ie(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),ufe=S.forwardRef((e,t)=>{const r=So(Qs,e.__scopePopover),n=S.useRef(!1),i=S.useRef(!1);return d.jsx(h5,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(n.current||r.triggerRef.current?.focus(),o.preventDefault()),n.current=!1,i.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(n.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const s=o.target;r.triggerRef.current?.contains(s)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),h5=S.forwardRef((e,t)=>{const{__scopePopover:r,trapFocus:n,onOpenAutoFocus:i,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:l,onInteractOutside:h,...p}=e,m=So(Qs,r),g=Lu(r);return o_(),d.jsx(dm,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:i,onUnmountAutoFocus:o,children:d.jsx(ju,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:h,onEscapeKeyDown:u,onPointerDownOutside:f,onFocusOutside:l,onDismiss:()=>m.onOpenChange(!1),children:d.jsx(v_,{"data-state":m5(m.open),role:"dialog",id:m.contentId,...g,...p,ref:t,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),p5="PopoverClose",ffe=S.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,i=So(p5,r);return d.jsx(Ue.button,{type:"button",...n,ref:t,onClick:Ie(e.onClick,()=>i.onOpenChange(!1))})});ffe.displayName=p5;var dfe="PopoverArrow",hfe=S.forwardRef((e,t)=>{const{__scopePopover:r,...n}=e,i=Lu(r);return d.jsx(g_,{...i,...n,ref:t})});hfe.displayName=dfe;function m5(e){return e?"open":"closed"}var pfe=s5,mfe=u5,vfe=f5,gfe=d5;function v5({...e}){return d.jsx(pfe,{"data-slot":"popover",...e})}function g5({...e}){return d.jsx(mfe,{"data-slot":"popover-trigger",...e})}function y5({className:e,align:t="center",sideOffset:r=4,...n}){return d.jsx(vfe,{children:d.jsx(gfe,{"data-slot":"popover-content",align:t,sideOffset:r,className:Re("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...n})})}function An(e){const t=(e??"").trim();return t||"N/A"}function yfe(e,t){return e==null||t===null||t===void 0||!Number.isFinite(e)||!Number.isFinite(t)?"N/A":`${e}, ${t}`}function xfe(){const[e,t]=S.useState(!1),[r,n]=S.useState(!1),[i,o]=S.useState(!1),[s,u]=S.useState(null),[f,l]=S.useState(null),[h,p]=S.useState([]),[m,g]=S.useState(!1),[b,y]=S.useState(0),[w,j]=S.useState(0),[O,E]=S.useState(null),[A,N]=S.useState(""),[C,T]=S.useState("all"),[R,I]=S.useState("all"),[F,L]=S.useState("all"),[$,U]=S.useState(1),[G,q]=S.useState(10),H=S.useRef(null),V=S.useRef(null),[D,Z]=S.useState("");S.useEffect(()=>(V.current&&window.clearTimeout(V.current),V.current=window.setTimeout(()=>Z(A.trim()),300),()=>{V.current&&window.clearTimeout(V.current)}),[A]);const J=S.useMemo(()=>{const K=new Set;for(const ce of h){const te=(ce.partner??"").trim();te&&K.add(te)}return["all",...Array.from(K).sort((ce,te)=>ce.localeCompare(te))]},[h]),M=S.useMemo(()=>{const K=new Set;for(const ce of h){const te=(ce.groupName??"").trim();te&&K.add(te)}return["all",...Array.from(K).sort((ce,te)=>ce.localeCompare(te))]},[h]),B=S.useMemo(()=>{const K=new Set;for(const ce of h){const te=(ce.locationCode??"").trim();te&&K.add(te)}return["all",...Array.from(K).sort((ce,te)=>ce.localeCompare(te))]},[h]),ee=Math.max(1,Math.ceil(b/G));S.useEffect(()=>{U(1)},[D,C,R,F,G]),S.useEffect(()=>((async()=>{H.current?.abort();const ce=new AbortController;H.current=ce,g(!0);try{const te=Math.max(1,$),ge=await X4({skipCount:te,maxResultCount:G,keyword:(F!=="all"?F:D)||void 0,partner:C!=="all"?C:void 0,groupName:R!=="all"?R:void 0},ce.signal);p(ge.items??[]),y(ge.totalCount??0)}catch(te){if(te?.name==="AbortError")return;Qe.error("Failed to load locations.",{description:te?.message?String(te.message):"Please try again."}),p([]),y(0)}finally{g(!1)}})(),()=>H.current?.abort()),[D,C,R,F,$,G,w]);const ae=()=>j(K=>K+1),ie=K=>{E(null),u(K),n(!0)},fe=K=>{E(null),l(K),o(!0)};return d.jsxs("div",{className:"h-full flex flex-col",children:[d.jsx("div",{className:"pb-4",children:d.jsx("div",{className:"flex flex-col gap-4",children:d.jsxs("div",{className:"flex flex-nowrap items-center gap-3",children:[d.jsx(Se,{placeholder:"Search",value:A,onChange:K=>N(K.target.value),style:{height:40,boxSizing:"border-box"},className:"border border-gray-300 rounded-md w-40 shrink-0 bg-white placeholder:text-gray-500"}),d.jsxs(Je,{value:C,onValueChange:T,children:[d.jsx(tt,{className:"w-[140px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:d.jsx(et,{placeholder:"Partner"})}),d.jsx(rt,{children:J.map(K=>d.jsx(Ee,{value:K,children:K==="all"?"Partner (All)":K},K))})]}),d.jsxs(Je,{value:R,onValueChange:I,children:[d.jsx(tt,{className:"w-[140px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:d.jsx(et,{placeholder:"Group"})}),d.jsx(rt,{children:M.map(K=>d.jsx(Ee,{value:K,children:K==="all"?"Group (All)":K},K))})]}),d.jsxs(Je,{value:F,onValueChange:L,children:[d.jsx(tt,{className:"w-[140px] h-10 rounded-md border border-gray-300 bg-white font-medium text-gray-900 shrink-0",style:{height:40,boxSizing:"border-box"},children:d.jsx(et,{placeholder:"Location"})}),d.jsx(rt,{children:B.map(K=>d.jsx(Ee,{value:K,children:K==="all"?"All Locations":K},K))})]}),d.jsx("div",{className:"flex-1"}),d.jsxs(Xb,{children:[d.jsx(Yb,{asChild:!0,children:d.jsx("span",{children:d.jsx(we,{disabled:!0,variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 px-4 bg-white hover:bg-gray-50 shrink-0",children:"Bulk Import"})})}),d.jsx(Qb,{children:"Not supported yet"})]}),d.jsxs(Xb,{children:[d.jsx(Yb,{asChild:!0,children:d.jsx("span",{children:d.jsx(we,{disabled:!0,variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 px-4 bg-white hover:bg-gray-50 shrink-0",children:"Bulk Export"})})}),d.jsx(Qb,{children:"Not supported yet"})]}),d.jsxs(Xb,{children:[d.jsx(Yb,{asChild:!0,children:d.jsx("span",{children:d.jsx(we,{disabled:!0,variant:"outline",className:"h-10 border border-gray-300 rounded-md text-gray-900 px-4 bg-white hover:bg-gray-50 shrink-0",children:"Bulk Edit"})})}),d.jsx(Qb,{children:"Not supported yet"})]}),d.jsx(we,{className:"h-10 bg-blue-600 hover:bg-blue-700 text-white rounded-md px-6 font-medium shrink-0",onClick:()=>t(!0),children:"New"})]})})}),d.jsx("div",{className:"flex-1 overflow-auto pt-6",children:d.jsx("div",{className:"bg-white border border-gray-200 shadow-sm rounded-md overflow-hidden",children:d.jsxs(br,{children:[d.jsx(wr,{children:d.jsxs(Ge,{className:"bg-gray-100 hover:bg-gray-100",children:[d.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"Partner"}),d.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"Group"}),d.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"Location ID"}),d.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"Location Name"}),d.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"Street"}),d.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"City"}),d.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"State"}),d.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"Country"}),d.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"Zip Code"}),d.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"Phone"}),d.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"Email"}),d.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"GPS"}),d.jsx(ye,{className:"text-gray-900 font-bold border-r",children:"Active"}),d.jsx(ye,{className:"text-gray-900 font-bold text-center",children:"Actions"})]})}),d.jsx(Sr,{children:m?d.jsx(Ge,{children:d.jsx(ue,{colSpan:14,className:"text-center text-sm text-gray-500 py-10",children:"Loading..."})}):h.length===0?d.jsx(Ge,{children:d.jsx(ue,{colSpan:14,className:"text-center text-sm text-gray-500 py-10",children:"No results."})}):h.map(K=>d.jsxs(Ge,{children:[d.jsx(ue,{className:"border-r text-gray-600 max-w-[140px] truncate",children:An(K.partner)}),d.jsx(ue,{className:"border-r text-gray-600 max-w-[140px] truncate",children:An(K.groupName)}),d.jsx(ue,{className:"border-r font-numeric text-gray-600",children:An(K.locationCode??K.id)}),d.jsx(ue,{className:"border-r font-medium text-black",children:An(K.locationName)}),d.jsx(ue,{className:"border-r text-gray-600 max-w-[140px] truncate",children:An(K.street)}),d.jsx(ue,{className:"border-r text-gray-600",children:An(K.city)}),d.jsx(ue,{className:"border-r text-gray-600",children:An(K.stateCode)}),d.jsx(ue,{className:"border-r text-gray-600",children:An(K.country)}),d.jsx(ue,{className:"border-r text-gray-600 font-numeric",children:An(K.zipCode)}),d.jsx(ue,{className:"border-r text-gray-600 whitespace-nowrap",children:An(K.phone)}),d.jsx(ue,{className:"border-r text-gray-600 text-sm max-w-[180px] truncate",children:An(K.email)}),d.jsx(ue,{className:"border-r text-gray-500 font-numeric text-xs",children:yfe(K.latitude,K.longitude)}),d.jsx(ue,{className:"border-r",children:d.jsx(Gn,{className:K.state?"bg-green-600":"bg-gray-400",children:K.state?"Yes":"No"})}),d.jsx(ue,{className:"text-center",children:d.jsxs(v5,{open:O===K.id,onOpenChange:ce=>E(ce?K.id:null),children:[d.jsx(g5,{asChild:!0,children:d.jsx(we,{type:"button",variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":"Row actions",children:d.jsx(Hw,{className:"h-4 w-4 text-gray-500"})})}),d.jsxs(y5,{align:"end",className:"w-40 p-1",children:[d.jsxs(we,{type:"button",variant:"ghost",className:"w-full justify-start gap-2 h-9 px-2 font-normal",onClick:()=>ie(K),children:[d.jsx(co,{className:"w-4 h-4"}),"Edit"]}),d.jsx(we,{type:"button",variant:"ghost",className:"w-full justify-start h-9 px-2 font-normal text-red-600 hover:text-red-700 hover:bg-red-50",onClick:()=>fe(K),children:"Delete"})]})]})})]},K.id))})]})})}),d.jsx("div",{className:"pt-4",children:d.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-600",children:[d.jsxs("div",{children:["Showing ",b===0?0:($-1)*G+1,"-",Math.min($*G,b)," of ",b]}),d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsxs(Je,{value:String(G),onValueChange:K=>q(Number(K)),children:[d.jsx(tt,{className:"w-[110px] h-9 rounded-md border border-gray-300 bg-white text-gray-900",children:d.jsx(et,{})}),d.jsx(rt,{children:[10,20,50].map(K=>d.jsxs(Ee,{value:String(K),children:[K," / page"]},K))})]}),d.jsx(Iw,{className:"mx-0 w-auto justify-end",children:d.jsxs(Dw,{children:[d.jsx(Si,{children:d.jsx(Lw,{href:"#",size:"default",onClick:K=>{K.preventDefault(),U(ce=>Math.max(1,ce-1))},"aria-disabled":$<=1,className:$<=1?"pointer-events-none opacity-50":""})}),d.jsx(Si,{children:d.jsxs(fu,{href:"#",isActive:!0,size:"default",onClick:K=>K.preventDefault(),children:["Page ",$," / ",ee]})}),d.jsx(Si,{children:d.jsx($w,{href:"#",size:"default",onClick:K=>{K.preventDefault(),U(ce=>Math.min(ee,ce+1))},"aria-disabled":$>=ee,className:$>=ee?"pointer-events-none opacity-50":""})})]})})]})]})}),d.jsx(bfe,{open:e,onOpenChange:t,onCreated:()=>{U(1),ae()}}),d.jsx(Sfe,{open:r,location:s,onOpenChange:K=>{n(K),K||u(null)},onUpdated:()=>{ae()}}),d.jsx(_fe,{open:i,location:f,onOpenChange:K=>{o(K),K||l(null)},onDeleted:()=>{ae()}})]})}function bfe({open:e,onOpenChange:t,onCreated:r}){const[n,i]=S.useState(!1),[o,s]=S.useState({partner:"",groupName:"",locationCode:"",locationName:"",street:"",city:"",stateCode:"",country:"",zipCode:"",phone:"",email:"",latitude:null,longitude:null,state:!0}),u=()=>{s({partner:"",groupName:"",locationCode:"",locationName:"",street:"",city:"",stateCode:"",country:"",zipCode:"",phone:"",email:"",latitude:null,longitude:null,state:!0})};S.useEffect(()=>{e||(u(),i(!1))},[e]);const f=S.useMemo(()=>o.locationCode.trim().length>0&&o.locationName.trim().length>0,[o.locationCode,o.locationName]),l=async()=>{if(!f){Qe.error("Please fill in required fields.",{description:"Location ID and Location Name are required."});return}i(!0);try{await nue({...o,locationCode:o.locationCode.trim(),locationName:o.locationName.trim(),partner:o.partner?.trim()?o.partner.trim():null,groupName:o.groupName?.trim()?o.groupName.trim():null,street:o.street?.trim()?o.street.trim():null,city:o.city?.trim()?o.city.trim():null,stateCode:o.stateCode?.trim()?o.stateCode.trim():null,country:o.country?.trim()?o.country.trim():null,zipCode:o.zipCode?.trim()?o.zipCode.trim():null,phone:o.phone?.trim()?o.phone.trim():null,email:o.email?.trim()?o.email.trim():null}),Qe.success("Location created.",{description:"The location has been added successfully."}),t(!1),r()}catch(h){Qe.error("Failed to create location.",{description:h?.message?String(h.message):"Please try again."})}finally{i(!1)}};return d.jsx(_r,{open:e,onOpenChange:t,children:d.jsxs(dr,{className:"sm:max-w-[600px]",children:[d.jsxs(jr,{children:[d.jsx(Or,{children:"Add New Location"}),d.jsx(xn,{children:"Enter the details for the new store location."})]}),d.jsxs("div",{className:"grid gap-4 py-4",children:[d.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"Partner"}),d.jsx(Se,{placeholder:"e.g. Global Foods Inc.",value:o.partner??"",onChange:h=>s(p=>({...p,partner:h.target.value}))})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"Group"}),d.jsx(Se,{placeholder:"e.g. East Coast Region",value:o.groupName??"",onChange:h=>s(p=>({...p,groupName:h.target.value}))})]})]}),d.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[d.jsxs("div",{className:"space-y-2 col-span-1",children:[d.jsx(me,{children:"Location ID"}),d.jsx(Se,{placeholder:"e.g. 12345",value:o.locationCode,onChange:h=>s(p=>({...p,locationCode:h.target.value}))})]}),d.jsxs("div",{className:"space-y-2 col-span-2",children:[d.jsx(me,{children:"Location Name"}),d.jsx(Se,{placeholder:"e.g. Downtown Store",value:o.locationName,onChange:h=>s(p=>({...p,locationName:h.target.value}))})]})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"Street"}),d.jsx(Se,{placeholder:"e.g. 123 Main St",value:o.street??"",onChange:h=>s(p=>({...p,street:h.target.value}))})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"City"}),d.jsx(Se,{placeholder:"e.g. New York",value:o.city??"",onChange:h=>s(p=>({...p,city:h.target.value}))})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"State"}),d.jsx(Se,{placeholder:"e.g. NY",value:o.stateCode??"",onChange:h=>s(p=>({...p,stateCode:h.target.value}))})]})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"Country"}),d.jsx(Se,{placeholder:"e.g. USA",value:o.country??"",onChange:h=>s(p=>({...p,country:h.target.value}))})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"Zip Code"}),d.jsx(Se,{placeholder:"e.g. 10001",value:o.zipCode??"",onChange:h=>s(p=>({...p,zipCode:h.target.value}))})]})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"Phone Number"}),d.jsx(Se,{placeholder:"+1 (555) 000-0000",value:o.phone??"",onChange:h=>s(p=>({...p,phone:h.target.value}))})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"Email"}),d.jsx(Se,{placeholder:"store@example.com",value:o.email??"",onChange:h=>s(p=>({...p,email:h.target.value}))})]})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs(me,{className:"flex items-center gap-2",children:[d.jsx(Zs,{className:"w-4 h-4"})," GPS Coordinates"]}),d.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[d.jsx(Se,{placeholder:"Latitude (e.g. 40.7128)",value:o.latitude===null||o.latitude===void 0?"":String(o.latitude),onChange:h=>{const p=h.target.value.trim();s(m=>({...m,latitude:p?Number(p):null}))}}),d.jsx(Se,{placeholder:"Longitude (e.g. -74.0060)",value:o.longitude===null||o.longitude===void 0?"":String(o.longitude),onChange:h=>{const p=h.target.value.trim();s(m=>({...m,longitude:p?Number(p):null}))}})]})]}),d.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[d.jsx(mn,{id:"loc-status",checked:!!o.state,onCheckedChange:h=>s(p=>({...p,state:h}))}),d.jsx(me,{htmlFor:"loc-status",children:"Active Location"})]})]}),d.jsxs(Dr,{children:[d.jsx(we,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),d.jsx(we,{disabled:n,onClick:l,className:"bg-blue-600 text-white hover:bg-blue-700",children:n?"Creating...":"Create Location"})]})]})})}function wfe(e){return{partner:e.partner??"",groupName:e.groupName??"",locationCode:e.locationCode??"",locationName:e.locationName??"",street:e.street??"",city:e.city??"",stateCode:e.stateCode??"",country:e.country??"",zipCode:e.zipCode??"",phone:e.phone??"",email:e.email??"",latitude:e.latitude??null,longitude:e.longitude??null,state:!!e.state}}function Sfe({open:e,location:t,onOpenChange:r,onUpdated:n}){const[i,o]=S.useState(!1),[s,u]=S.useState({partner:"",groupName:"",locationCode:"",locationName:"",street:"",city:"",stateCode:"",country:"",zipCode:"",phone:"",email:"",latitude:null,longitude:null,state:!0});S.useEffect(()=>{e&&t&&(u(wfe(t)),o(!1)),e||o(!1)},[e,t]);const f=S.useMemo(()=>s.locationCode.trim().length>0&&s.locationName.trim().length>0,[s.locationCode,s.locationName]),l=async()=>{if(t?.id){if(!f){Qe.error("Please fill in required fields.",{description:"Location ID and Location Name are required."});return}o(!0);try{await iue(t.id,{...s,locationCode:s.locationCode.trim(),locationName:s.locationName.trim(),partner:s.partner?.trim()?s.partner.trim():null,groupName:s.groupName?.trim()?s.groupName.trim():null,street:s.street?.trim()?s.street.trim():null,city:s.city?.trim()?s.city.trim():null,stateCode:s.stateCode?.trim()?s.stateCode.trim():null,country:s.country?.trim()?s.country.trim():null,zipCode:s.zipCode?.trim()?s.zipCode.trim():null,phone:s.phone?.trim()?s.phone.trim():null,email:s.email?.trim()?s.email.trim():null}),Qe.success("Location updated.",{description:"The changes have been saved successfully."}),r(!1),n()}catch(h){Qe.error("Failed to update location.",{description:h?.message?String(h.message):"Please try again."})}finally{o(!1)}}};return d.jsx(_r,{open:e,onOpenChange:r,children:d.jsxs(dr,{className:"sm:max-w-[600px]",children:[d.jsxs(jr,{children:[d.jsx(Or,{children:"Edit Location"}),d.jsx(xn,{children:"Update the details for this store location."})]}),d.jsxs("div",{className:"grid gap-4 py-4",children:[d.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"Partner"}),d.jsx(Se,{placeholder:"e.g. Global Foods Inc.",value:s.partner??"",onChange:h=>u(p=>({...p,partner:h.target.value}))})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"Group"}),d.jsx(Se,{placeholder:"e.g. East Coast Region",value:s.groupName??"",onChange:h=>u(p=>({...p,groupName:h.target.value}))})]})]}),d.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[d.jsxs("div",{className:"space-y-2 col-span-1",children:[d.jsx(me,{children:"Location ID"}),d.jsx(Se,{placeholder:"e.g. 12345",value:s.locationCode,onChange:h=>u(p=>({...p,locationCode:h.target.value}))})]}),d.jsxs("div",{className:"space-y-2 col-span-2",children:[d.jsx(me,{children:"Location Name"}),d.jsx(Se,{placeholder:"e.g. Downtown Store",value:s.locationName,onChange:h=>u(p=>({...p,locationName:h.target.value}))})]})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"Street"}),d.jsx(Se,{placeholder:"e.g. 123 Main St",value:s.street??"",onChange:h=>u(p=>({...p,street:h.target.value}))})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"City"}),d.jsx(Se,{placeholder:"e.g. New York",value:s.city??"",onChange:h=>u(p=>({...p,city:h.target.value}))})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"State"}),d.jsx(Se,{placeholder:"e.g. NY",value:s.stateCode??"",onChange:h=>u(p=>({...p,stateCode:h.target.value}))})]})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"Country"}),d.jsx(Se,{placeholder:"e.g. USA",value:s.country??"",onChange:h=>u(p=>({...p,country:h.target.value}))})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"Zip Code"}),d.jsx(Se,{placeholder:"e.g. 10001",value:s.zipCode??"",onChange:h=>u(p=>({...p,zipCode:h.target.value}))})]})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"Phone Number"}),d.jsx(Se,{placeholder:"+1 (555) 000-0000",value:s.phone??"",onChange:h=>u(p=>({...p,phone:h.target.value}))})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"Email"}),d.jsx(Se,{placeholder:"store@example.com",value:s.email??"",onChange:h=>u(p=>({...p,email:h.target.value}))})]})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsxs(me,{className:"flex items-center gap-2",children:[d.jsx(Zs,{className:"w-4 h-4"})," GPS Coordinates"]}),d.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[d.jsx(Se,{placeholder:"Latitude (e.g. 40.7128)",value:s.latitude===null||s.latitude===void 0?"":String(s.latitude),onChange:h=>{const p=h.target.value.trim();u(m=>({...m,latitude:p?Number(p):null}))}}),d.jsx(Se,{placeholder:"Longitude (e.g. -74.0060)",value:s.longitude===null||s.longitude===void 0?"":String(s.longitude),onChange:h=>{const p=h.target.value.trim();u(m=>({...m,longitude:p?Number(p):null}))}})]})]}),d.jsxs("div",{className:"flex items-center gap-2 pt-2",children:[d.jsx(mn,{id:"loc-status-edit",checked:!!s.state,onCheckedChange:h=>u(p=>({...p,state:h}))}),d.jsx(me,{htmlFor:"loc-status-edit",children:"Active Location"})]})]}),d.jsxs(Dr,{children:[d.jsx(we,{variant:"outline",onClick:()=>r(!1),children:"Cancel"}),d.jsx(we,{disabled:i,onClick:l,className:"bg-blue-600 text-white hover:bg-blue-700",children:i?"Saving...":"Save Changes"})]})]})})}function _fe({open:e,location:t,onOpenChange:r,onDeleted:n}){const[i,o]=S.useState(!1),s=S.useMemo(()=>{const f=(t?.locationCode??"").trim(),l=(t?.locationName??"").trim();return f&&l?`${f} - ${l}`:f||l||"this location"},[t?.locationCode,t?.locationName]),u=async()=>{if(t?.id){o(!0);try{await oue(t.id),Qe.success("Location deleted.",{description:"The location has been removed successfully."}),r(!1),n()}catch(f){Qe.error("Failed to delete location.",{description:f?.message?String(f.message):"Please try again."})}finally{o(!1)}}};return d.jsx(_r,{open:e,onOpenChange:r,children:d.jsxs(dr,{className:"sm:max-w-none",style:{width:"30%"},children:[d.jsxs(jr,{children:[d.jsx(Or,{children:"Delete Location"}),d.jsx(xn,{children:"This action cannot be undone."})]}),d.jsxs("div",{className:"text-sm text-gray-700",children:["Are you sure you want to delete ",d.jsx("span",{className:"font-medium",children:s}),"?"]}),d.jsxs(Dr,{className:"flex-row flex-wrap justify-end",children:[d.jsx(we,{className:"min-w-24",variant:"outline",onClick:()=>r(!1),children:"Cancel"}),d.jsx(we,{className:"min-w-24",variant:"destructive",disabled:i,onClick:u,children:i?"Deleting...":"Delete"})]})]})})}function jfe({className:e,...t}){return d.jsx("textarea",{"data-slot":"textarea",className:Re("resize-none border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-input-background px-3 py-2 text-base transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...t})}const iM={Settings:sh,LayoutDashboard:hM,Tag:lh,MapPin:Zs,Users:Gw,Package:ah,FileText:ws,HelpCircle:oh,Layers:dM,Type:Op,FileBox:fM};function Zb(e){const t=(e??"").trim();return t||"N/A"}function Ofe(e){const t=e.trim();if(!t)return null;const r=Number.parseInt(t,10);return Number.isFinite(r)?r:null}function Efe(){const[e,t]=S.useState([]),[r,n]=S.useState(!1),[i,o]=S.useState(0),[s,u]=S.useState(null),[f,l]=S.useState(""),h=S.useRef(null),[p,m]=S.useState(""),[g,b]=S.useState(!1),[y,w]=S.useState(!1),[j,O]=S.useState(!1),[E,A]=S.useState(null),[N,C]=S.useState(null),T=S.useRef(null);S.useEffect(()=>(h.current&&window.clearTimeout(h.current),h.current=window.setTimeout(()=>m(f.trim()),300),()=>{h.current&&window.clearTimeout(h.current)}),[f]),S.useEffect(()=>((async()=>{T.current?.abort();const $=new AbortController;T.current=$,n(!0);try{const U=await H4({skipCount:1,maxResultCount:5e3,keyword:p||void 0},$.signal);t(U.items??[])}catch(U){if(U?.name==="AbortError")return;Qe.error("Failed to load system menus.",{description:U?.message?String(U.message):"Please try again."}),t([])}finally{n(!1)}})(),()=>T.current?.abort()),[p,i]);const R=()=>o(L=>L+1),I=L=>{u(null),A(L),w(!0)},F=L=>{u(null),C(L),O(!0)};return d.jsxs("div",{className:"h-full flex flex-col",children:[d.jsx("div",{className:"pb-4",children:d.jsxs("div",{className:"flex flex-nowrap items-center gap-3",children:[d.jsx(Se,{placeholder:"Search",value:f,onChange:L=>l(L.target.value),style:{height:40,boxSizing:"border-box"},className:"border border-gray-300 rounded-md w-40 shrink-0 bg-white placeholder:text-gray-500"}),d.jsx("div",{className:"flex-1"}),d.jsxs(we,{className:"bg-blue-600 text-white hover:bg-blue-700",onClick:()=>b(!0),children:[d.jsx(Rr,{className:"w-4 h-4 mr-2"}),"New Menu"]})]})}),d.jsx("div",{className:"flex-1 flex flex-col min-h-0 bg-white rounded-lg shadow-sm border border-gray-200 overflow-hidden",children:d.jsx("div",{className:"flex-1 min-h-0 overflow-auto",children:d.jsxs(br,{children:[d.jsx(wr,{className:"bg-gray-50 sticky top-0 z-10",children:d.jsxs(Ge,{className:"hover:bg-gray-50",children:[d.jsx(ye,{className:"font-semibold text-gray-900",children:"Menu Name"}),d.jsx(ye,{className:"font-semibold text-gray-900",children:"Route URL"}),d.jsx(ye,{className:"font-semibold text-gray-900",children:"Router Name"}),d.jsx(ye,{className:"font-semibold text-gray-900",children:"Type"}),d.jsx(ye,{className:"font-semibold text-gray-900",children:"Order"}),d.jsx(ye,{className:"font-semibold text-gray-900",children:"Visible"}),d.jsx(ye,{className:"font-semibold text-gray-900",children:"Enabled"}),d.jsx(ye,{className:"font-semibold text-gray-900 w-16 text-right",children:"Actions"})]})}),d.jsx(Sr,{children:e.length===0?d.jsx(Ge,{children:d.jsx(ue,{colSpan:8,className:"text-center py-10 text-gray-500",children:r?"Loading...":"No data"})}):e.map(L=>d.jsxs(Ge,{className:"hover:bg-gray-50",children:[d.jsx(ue,{className:"font-medium text-gray-900",children:Zb(L.menuName)}),d.jsx(ue,{className:"text-gray-700",children:Zb(L.routeUrl)}),d.jsx(ue,{className:"text-gray-700",children:Zb(L.routerName)}),d.jsx(ue,{className:"text-gray-700",children:L.menuType??"N/A"}),d.jsx(ue,{className:"text-gray-700",children:L.orderNum??"N/A"}),d.jsx(ue,{className:"text-gray-700",children:L.isShow?"Yes":"No"}),d.jsx(ue,{className:"text-gray-700",children:L.state?"Yes":"No"}),d.jsx(ue,{className:"text-right",children:d.jsxs(v5,{open:s===L.id,onOpenChange:$=>u($?L.id:null),children:[d.jsx(g5,{asChild:!0,children:d.jsx(we,{variant:"ghost",size:"icon",className:"h-8 w-8","aria-label":"Row actions",children:d.jsx(Hw,{className:"h-4 w-4"})})}),d.jsx(y5,{className:"w-44 p-2",align:"end",children:d.jsxs("div",{className:"flex flex-col",children:[d.jsxs(we,{variant:"ghost",className:"justify-start",onClick:()=>I(L),children:[d.jsx(co,{className:"w-4 h-4 mr-2"}),"Edit"]}),d.jsxs(we,{variant:"ghost",className:"justify-start text-red-600 hover:text-red-700",onClick:()=>F(L),children:[d.jsx(Nc,{className:"w-4 h-4 mr-2"}),"Delete"]})]})})]})})]},L.id))})]})})}),d.jsx(oM,{mode:"create",open:g,menu:null,onOpenChange:b,onSaved:R}),d.jsx(oM,{mode:"edit",open:y,menu:E,onOpenChange:w,onSaved:R}),d.jsx(Pfe,{open:j,menu:N,onOpenChange:O,onDeleted:R})]})}function oM({mode:e,open:t,menu:r,onOpenChange:n,onSaved:i}){const o=e==="edit",[s,u]=S.useState(!1),[f,l]=S.useState(""),[h,p]=S.useState(""),[m,g]=S.useState(""),[b,y]=S.useState("menu"),[w,j]=S.useState(""),[O,E]=S.useState(""),[A,N]=S.useState([]),[C,T]=S.useState(!1),[R,I]=S.useState(""),[F,L]=S.useState(""),[$,U]=S.useState(""),[G,q]=S.useState(""),[H,V]=S.useState(""),[D,Z]=S.useState(""),[J,M]=S.useState(!1),[B,ee]=S.useState(!0),[ae,ie]=S.useState(!0);S.useEffect(()=>{if(!t)return;u(!1),l(r?.menuName??""),p(r?.routerName??""),g(r?.routeUrl??""),y(r?.menuType===0?"directory":"menu"),j(r?.permissionCode??"");const Y=String(r?.parentId??"").trim();E(!Y||Y==="00000000-0000-0000-0000-000000000000"?"":Y),I(r?.menuIcon??""),L(r?.orderNum===null||r?.orderNum===void 0?"":String(r.orderNum)),U(r?.link??""),q(r?.component??""),V(r?.query??""),Z(r?.remark??""),M(!!r?.isCache),ee(r?.isShow??!0),ie(r?.state??!0)},[t,r]);const fe="__parent_root__";S.useEffect(()=>{if(!t)return;let Y=!1;return T(!0),qce().then(_e=>{Y||N(_e)}).catch(()=>{Y||N([])}).finally(()=>{Y||T(!1)}),()=>{Y=!0}},[t]);const K=Y=>!Y.trim()||Y==="00000000-0000-0000-0000-000000000000",ce=S.useMemo(()=>{const Y=A.filter(Oe=>Oe.id&&Oe.id!==r?.id),_e=(O||"").trim();return _e&&!K(_e)&&!Y.some(Oe=>Oe.id===_e)?[...Y,{id:_e,menuName:`(Current parent) ${_e}`}]:Y},[A,O,r?.id]),te=K(O)?fe:O,le=S.useMemo(()=>!!(f.trim()&&m.trim()),[f,m]),ge=async()=>{if(!le){Qe.error("Please fill in required fields.",{description:"Menu Name and Route URL are required."});return}u(!0);try{const Y={menuName:f.trim(),routerName:h.trim()?h.trim():null,routeUrl:m.trim(),menuType:b==="directory"?0:1,permissionCode:w.trim()?w.trim():null,parentId:K(O)?null:O.trim(),menuIcon:R||null,orderNum:Ofe(F),link:$.trim()?$.trim():null,component:G.trim()?G.trim():null,query:H.trim()?H.trim():null,remark:D.trim()?D.trim():null,isCache:J,isShow:B,state:ae};if(o){if(!r?.id)throw new Error("Missing id.");await Wce(r.id,Y),Qe.success("Menu updated.",{description:"Changes have been saved successfully."})}else await Uce(Y),Qe.success("Menu created.",{description:"A new menu has been created successfully."});n(!1),i()}catch(Y){Qe.error(o?"Failed to update menu.":"Failed to create menu.",{description:Y?.message?String(Y.message):"Please try again."})}finally{u(!1)}};return d.jsx(_r,{open:t,onOpenChange:n,children:d.jsxs(dr,{className:"sm:max-w-none",style:{width:"70%"},children:[d.jsxs(jr,{children:[d.jsx(Or,{children:o?"Edit System Menu":"New System Menu"}),d.jsx(xn,{children:o?"Update system menu fields and save changes.":"Fill out the form to create a new system menu."})]}),d.jsxs("div",{className:"grid grid-cols-3 gap-6 py-2",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"Menu Name *"}),d.jsx(Se,{value:f,onChange:Y=>l(Y.target.value),placeholder:"e.g. Location Manager"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"Route URL *"}),d.jsx(Se,{value:m,onChange:Y=>g(Y.target.value),placeholder:"e.g. /location"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"Router Name"}),d.jsx(Se,{value:h,onChange:Y=>p(Y.target.value),placeholder:"e.g. location"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"Menu Type"}),d.jsxs(Je,{value:b,onValueChange:Y=>y(Y),children:[d.jsx(tt,{className:"h-10 rounded-md border border-gray-200 bg-white",children:d.jsx(et,{})}),d.jsxs(rt,{children:[d.jsx(Ee,{value:"directory",children:"Directory"}),d.jsx(Ee,{value:"menu",children:"Menu"})]})]})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"Permission Code"}),d.jsx(Se,{value:w,onChange:Y=>j(Y.target.value),placeholder:"e.g. sys:menu"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"Parent"}),d.jsxs(Je,{value:te,disabled:C,onValueChange:Y=>E(Y===fe?"":Y),children:[d.jsx(tt,{className:"h-10 rounded-md border border-gray-200 bg-white",children:d.jsx(et,{placeholder:C?"Loading…":"Select parent directory"})}),d.jsxs(rt,{children:[d.jsx(Ee,{value:fe,children:"Root (no parent)"}),ce.map(Y=>d.jsx(Ee,{value:Y.id,children:Y.menuName?.trim()||Y.id},Y.id))]})]})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"Menu Icon"}),d.jsxs(Je,{value:R||"none",onValueChange:Y=>I(Y==="none"?"":Y),children:[d.jsx(tt,{className:"h-10 rounded-md border border-gray-200 bg-white",children:d.jsx(et,{placeholder:"Select an icon"})}),d.jsxs(rt,{children:[d.jsx(Ee,{value:"none",children:"None"}),Object.keys(iM).map(Y=>{const _e=iM[Y];return d.jsx(Ee,{value:Y,children:d.jsxs("span",{className:"flex items-center gap-2",children:[d.jsx(_e,{className:"h-4 w-4"}),Y]})},Y)})]})]})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"Order"}),d.jsx(Se,{value:F,onChange:Y=>L(Y.target.value),placeholder:"e.g. 10"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"Link"}),d.jsx(Se,{value:$,onChange:Y=>U(Y.target.value),placeholder:"Optional"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"Component"}),d.jsx(Se,{value:G,onChange:Y=>q(Y.target.value),placeholder:"Optional"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"Query"}),d.jsx(Se,{value:H,onChange:Y=>V(Y.target.value),placeholder:"Optional"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(me,{children:"Remark"}),d.jsx(jfe,{value:D,onChange:Y=>Z(Y.target.value),placeholder:"Optional"})]}),d.jsxs("div",{className:"flex items-center justify-between border border-gray-200 rounded-md px-3 bg-white",style:{height:40},children:[d.jsx("div",{className:"text-sm font-medium text-gray-900",children:"Cache"}),d.jsx(mn,{checked:J,onCheckedChange:M})]}),d.jsxs("div",{className:"flex items-center justify-between border border-gray-200 rounded-md px-3 bg-white",style:{height:40},children:[d.jsx("div",{className:"text-sm font-medium text-gray-900",children:"Visible"}),d.jsx(mn,{checked:B,onCheckedChange:ee})]}),d.jsxs("div",{className:"flex items-center justify-between border border-gray-200 rounded-md px-3 bg-white",style:{height:40},children:[d.jsx("div",{className:"text-sm font-medium text-gray-900",children:"Enabled"}),d.jsx(mn,{checked:ae,onCheckedChange:ie})]})]}),d.jsxs(Dr,{className:"flex-row flex-wrap justify-end",children:[d.jsx(we,{className:"min-w-24",variant:"outline",onClick:()=>n(!1),children:"Cancel"}),d.jsx(we,{className:"min-w-24 bg-blue-600 text-white hover:bg-blue-700",disabled:s,onClick:ge,children:s?"Saving...":o?"Save Changes":"Create"})]})]})})}function Pfe({open:e,menu:t,onOpenChange:r,onDeleted:n}){const[i,o]=S.useState(!1),s=S.useMemo(()=>{const f=(t?.menuName??"").trim(),l=(t?.routeUrl??"").trim();return f&&l?`${f} (${l})`:f||l||"this menu"},[t?.menuName,t?.routeUrl]),u=async()=>{if(t?.id){o(!0);try{await Vce(t.id),Qe.success("Menu deleted.",{description:"The menu has been removed successfully."}),r(!1),n()}catch(f){Qe.error("Failed to delete menu.",{description:f?.message?String(f.message):"Please try again."})}finally{o(!1)}}};return d.jsx(_r,{open:e,onOpenChange:r,children:d.jsxs(dr,{className:"sm:max-w-none",style:{width:"30%"},children:[d.jsxs(jr,{children:[d.jsx(Or,{children:"Delete System Menu"}),d.jsx(xn,{children:"This action cannot be undone."})]}),d.jsxs("div",{className:"text-sm text-gray-700",children:["Are you sure you want to delete ",d.jsx("span",{className:"font-medium",children:s}),"?"]}),d.jsxs(Dr,{className:"flex-row flex-wrap justify-end",children:[d.jsx(we,{className:"min-w-24",variant:"outline",onClick:()=>r(!1),children:"Cancel"}),d.jsx(we,{className:"min-w-24",variant:"destructive",disabled:i,onClick:u,children:i?"Deleting...":"Delete"})]})]})})}function Nfe(){const[e,t]=S.useState("Dashboard"),r=()=>{switch(e){case"Dashboard":return d.jsx(Nne,{});case"Training":return d.jsx(Qle,{});case"Alerts":return d.jsx(ece,{});case"Menu Management":return d.jsx(wce,{});case"System Menu":return d.jsx(Efe,{});case"Account Management":return d.jsx(vue,{});case"Reports":return d.jsx(Pue,{});case"Location Manager":return d.jsx(xfe,{});case"Labels":case"Label Categories":case"Label Types":case"Label Templates":case"Multiple Options":return d.jsx(Yle,{currentView:e,onViewChange:t});default:return d.jsx(Ane,{title:e})}};return d.jsx(zz,{currentView:e,setCurrentView:t,children:r()})}w8.createRoot(document.getElementById("root")).render(d.jsx(Nfe,{})); diff --git a/美国版/Food Labeling Management Platform/build/index.html b/美国版/Food Labeling Management Platform/build/index.html index 2866fb4..e712b3d 100644 --- a/美国版/Food Labeling Management Platform/build/index.html +++ b/美国版/Food Labeling Management Platform/build/index.html @@ -5,7 +5,7 @@ Food Labeling Management Platform - + diff --git a/美国版/Food Labeling Management Platform/src/components/labels/LabelTemplateEditor/LabelCanvas.tsx b/美国版/Food Labeling Management Platform/src/components/labels/LabelTemplateEditor/LabelCanvas.tsx index ffe9fd8..2a42e10 100644 --- a/美国版/Food Labeling Management Platform/src/components/labels/LabelTemplateEditor/LabelCanvas.tsx +++ b/美国版/Food Labeling Management Platform/src/components/labels/LabelTemplateEditor/LabelCanvas.tsx @@ -708,7 +708,6 @@ export function LabelCanvas({ "flex-1 overflow-auto bg-gray-100 relative", isSpacePressed ? "cursor-grab active:cursor-grabbing" : "" )} - onClick={canvasClick} onPointerDown={handleContainerPointerDown} onPointerMove={handleContainerPointerMove} onPointerUp={handleContainerPointerUp} @@ -745,6 +744,15 @@ export function LabelCanvas({ // 如果按住空格,禁用 canvas 内部的 pointer-events 以便拖动容器 pointerEvents: isSpacePressed ? 'none' : 'auto' }} + onClick={(e) => { + // 点击画布空白处取消选中 + const target = e.target as HTMLElement; + const isOnElement = target.closest('[id^="element-"]'); + const isOnPaperResize = target.closest('[title*="拖拽拉高"]') || target.closest('[title*="拖拽拉宽"]'); + if (!isOnElement && !isOnPaperResize) { + onSelect(null); + } + }} onPointerDown={(e) => { // 空白处或标尺等非控件区域按下即开始平移(放宽判定:在画布内且未点到元素/纸张拖拽条) const target = e.target as HTMLElement; @@ -752,22 +760,25 @@ export function LabelCanvas({ const isOnPaperResize = target.closest('[title*="拖拽拉高"]') || target.closest('[title*="拖拽拉宽"]'); const isOnCanvasArea = canvasRef.current?.contains(target); if (isOnCanvasArea && !isOnElement && !isOnPaperResize && !dragRef.current && !resizeRef.current) { - e.preventDefault(); - e.stopPropagation(); - setIsPanning(true); - panOffsetStartRef.current = { - x: panOffset.x, - y: panOffset.y, - startX: e.clientX, - startY: e.clientY, - }; - panStartRef.current = { - x: e.clientX, - y: e.clientY, - scrollLeft: scrollContainerRef.current?.scrollLeft ?? 0, - scrollTop: scrollContainerRef.current?.scrollTop ?? 0, - }; - (e.currentTarget as HTMLElement).setPointerCapture?.(e.pointerId); + // 如果按住空格或中键,开始平移 + if (isSpacePressed || e.button === 1) { + e.preventDefault(); + e.stopPropagation(); + setIsPanning(true); + panOffsetStartRef.current = { + x: panOffset.x, + y: panOffset.y, + startX: e.clientX, + startY: e.clientY, + }; + panStartRef.current = { + x: e.clientX, + y: e.clientY, + scrollLeft: scrollContainerRef.current?.scrollLeft ?? 0, + scrollTop: scrollContainerRef.current?.scrollTop ?? 0, + }; + (e.currentTarget as HTMLElement).setPointerCapture?.(e.pointerId); + } } }} onPointerMove={handlePointerMove} diff --git a/美国版/Food Labeling Management Platform/src/components/labels/LabelTemplateEditor/PropertiesPanel.tsx b/美国版/Food Labeling Management Platform/src/components/labels/LabelTemplateEditor/PropertiesPanel.tsx index 31e0b90..929f08c 100644 --- a/美国版/Food Labeling Management Platform/src/components/labels/LabelTemplateEditor/PropertiesPanel.tsx +++ b/美国版/Food Labeling Management Platform/src/components/labels/LabelTemplateEditor/PropertiesPanel.tsx @@ -276,12 +276,20 @@ function ElementConfigFields({
update('text', e.target.value)} className="h-8 text-sm mt-1" />
+ + update('prefix', e.target.value)} + className="h-8 text-sm mt-1" + /> +
+
update('data', e.target.value)} className="h-8 text-sm mt-1" /> @@ -334,6 +342,13 @@ function ElementConfigFields({
+
+ update('showText', v)} + /> + +
); case 'QRCODE': @@ -341,24 +356,207 @@ function ElementConfigFields({
update('data', e.target.value)} className="h-8 text-sm mt-1" />
); - case 'WEIGHT': + case 'IMAGE': + return ( + <> +
+ + update('src', e.target.value)} + className="h-8 text-sm mt-1" + placeholder="输入图片URL或路径" + /> +
+
+ + +
+ + ); + case 'DATE': + return ( + <> +
+ + update('format', e.target.value)} + className="h-8 text-sm mt-1" + placeholder="YYYY-MM-DD" + /> +
+
+ + update('offsetDays', Number(e.target.value) || 0)} + className="h-8 text-sm mt-1" + /> +
+ + ); + case 'TIME': return (
- + update('value', Number(e.target.value) || 0)} + value={(cfg.format as string) ?? 'HH:mm'} + onChange={(e) => update('format', e.target.value)} className="h-8 text-sm mt-1" + placeholder="HH:mm" />
); + case 'DURATION': + return ( + <> +
+ + update('format', e.target.value)} + className="h-8 text-sm mt-1" + placeholder="YYYY-MM-DD" + /> +
+
+ + update('offsetDays', Number(e.target.value) || 3)} + className="h-8 text-sm mt-1" + /> +
+ + ); + case 'WEIGHT': + return ( + <> +
+ + update('value', Number(e.target.value) || 0)} + className="h-8 text-sm mt-1" + /> +
+
+ + +
+ + ); + case 'WEIGHT_PRICE': + return ( + <> +
+ + update('unitPrice', Number(e.target.value) || 0)} + className="h-8 text-sm mt-1" + /> +
+
+ + update('weight', Number(e.target.value) || 0)} + className="h-8 text-sm mt-1" + /> +
+
+ + update('currency', e.target.value)} + className="h-8 text-sm mt-1" + /> +
+ + ); + case 'NUTRITION': + return ( + <> +
+ + update('calories', Number(e.target.value) || 0)} + className="h-8 text-sm mt-1" + /> +
+
+ + update('fat', e.target.value)} + className="h-8 text-sm mt-1" + /> +
+
+ + update('protein', e.target.value)} + className="h-8 text-sm mt-1" + /> +
+
+ + update('carbs', e.target.value)} + className="h-8 text-sm mt-1" + /> +
+ + ); + case 'BLANK': + return ( +
+ 空白占位元素,无需配置 +
+ ); default: return (
diff --git a/美国版/Food Labeling Management Platform/src/components/labels/LabelTemplateEditor/index.tsx b/美国版/Food Labeling Management Platform/src/components/labels/LabelTemplateEditor/index.tsx index 824c32b..d3e2e9a 100644 --- a/美国版/Food Labeling Management Platform/src/components/labels/LabelTemplateEditor/index.tsx +++ b/美国版/Food Labeling Management Platform/src/components/labels/LabelTemplateEditor/index.tsx @@ -47,7 +47,69 @@ export function LabelTemplateEditor({ type: Parameters[0], configOverride?: Partial> ) => { - const el = createDefaultElement(type, 30, 30); + // 计算画布中心位置(像素) + const unitToPx = (value: number, unit: 'cm' | 'inch'): number => { + return unit === 'cm' ? value * 37.8 : value * 96; + }; + + const canvasWidthPx = unitToPx(template.width, template.unit); + const canvasHeightPx = unitToPx(template.height, template.unit); + + // 创建默认元素以获取其尺寸 + const tempEl = createDefaultElement(type, 0, 0); + + // 对齐到网格 + const GRID_SIZE = 8; + const snapToGrid = (value: number): number => { + return Math.round(value / GRID_SIZE) * GRID_SIZE; + }; + + // 计算元素中心对齐到画布中心的位置 + let centerX = (canvasWidthPx - tempEl.width) / 2; + let centerY = (canvasHeightPx - tempEl.height) / 2; + + // 检查是否与现有元素重叠,如果重叠则尝试偏移 + const checkOverlap = (x: number, y: number, width: number, height: number): boolean => { + return template.elements.some((el) => { + const elRight = el.x + el.width; + const elBottom = el.y + el.height; + const newRight = x + width; + const newBottom = y + height; + return !(x >= elRight || newRight <= el.x || y >= elBottom || newBottom <= el.y); + }); + }; + + // 如果中心位置重叠,尝试在周围寻找空位 + if (checkOverlap(centerX, centerY, tempEl.width, tempEl.height)) { + const offset = GRID_SIZE * 2; + let found = false; + // 尝试右下方 + for (let tryY = centerY; tryY < canvasHeightPx - tempEl.height && !found; tryY += offset) { + for (let tryX = centerX; tryX < canvasWidthPx - tempEl.width && !found; tryX += offset) { + if (!checkOverlap(tryX, tryY, tempEl.width, tempEl.height)) { + centerX = tryX; + centerY = tryY; + found = true; + break; + } + } + } + // 如果还没找到,尝试左上方 + if (!found) { + for (let tryY = centerY; tryY >= 0 && !found; tryY -= offset) { + for (let tryX = centerX; tryX >= 0 && !found; tryX -= offset) { + if (!checkOverlap(tryX, tryY, tempEl.width, tempEl.height)) { + centerX = tryX; + centerY = tryY; + found = true; + break; + } + } + } + } + } + + const el = createDefaultElement(type, Math.max(0, snapToGrid(centerX)), Math.max(0, snapToGrid(centerY))); if (configOverride && Object.keys(configOverride).length > 0) { el.config = { ...el.config, ...configOverride }; } @@ -56,7 +118,7 @@ export function LabelTemplateEditor({ elements: [...prev.elements, el], })); setSelectedId(el.id); - }, []); + }, [template.width, template.height, template.unit, template.elements]); const updateElement = useCallback((id: string, patch: Partial) => { setTemplate((prev) => ({ diff --git a/美国版/Food Labeling Management Platform/src/components/labels/LabelTemplatesView.tsx b/美国版/Food Labeling Management Platform/src/components/labels/LabelTemplatesView.tsx index be8b522..8dd785b 100755 --- a/美国版/Food Labeling Management Platform/src/components/labels/LabelTemplatesView.tsx +++ b/美国版/Food Labeling Management Platform/src/components/labels/LabelTemplatesView.tsx @@ -45,7 +45,8 @@ export function LabelTemplatesView() { }); const handleNewTemplate = () => { - // 点击不跳转,仅保留按钮展示 + setEditingTemplateId(null); + setViewMode('editor'); }; const handleEditTemplate = (id: string) => { diff --git a/美国版/Food Labeling Management Platform/src/components/people/PeopleView.tsx b/美国版/Food Labeling Management Platform/src/components/people/PeopleView.tsx index cc4befa..d5c6ae7 100755 --- a/美国版/Food Labeling Management Platform/src/components/people/PeopleView.tsx +++ b/美国版/Food Labeling Management Platform/src/components/people/PeopleView.tsx @@ -59,11 +59,21 @@ import { cn } from "../ui/utils"; import { toast } from "sonner"; import { getRbacMenuTree } from "../../services/systemMenuService"; -import { deleteRoleMenus, getRoleMenuIds, setRoleMenus } from "../../services/rbacRoleMenuService"; +import { deleteRoleMenus, setRoleMenus } from "../../services/rbacRoleMenuService"; import type { RbacMenuTreeNode } from "../../types/systemMenu"; import { getRoles } from "../../services/roleService"; -import { createRbacRole, deleteRbacRole, updateRbacRole } from "../../services/rbacRoleService"; +import { createRbacRole, deleteRbacRole, getRbacRoleMenuIds, updateRbacRole } from "../../services/rbacRoleService"; import type { RoleDto } from "../../types/role"; +import { getLocations } from "../../services/locationService"; +import { + createTeamMember, + deleteTeamMember, + getTeamMemberById, + getTeamMembers, + updateTeamMember, +} from "../../services/teamMemberService"; +import type { LocationDto } from "../../types/location"; +import type { TeamMemberCreateInput, TeamMemberDto, TeamMemberUpdateInput } from "../../types/teamMember"; // --- Mock Data --- @@ -161,13 +171,31 @@ export function PeopleView() { const [debouncedRoleKeyword, setDebouncedRoleKeyword] = useState(""); const [partners, setPartners] = useState(MOCK_PARTNERS); const [groups, setGroups] = useState(MOCK_GROUPS); - const [members, setMembers] = useState(MOCK_MEMBERS); + + const [members, setMembers] = useState([]); + const [membersLoading, setMembersLoading] = useState(false); + const [memberTotal, setMemberTotal] = useState(0); + const [memberRefreshSeq, setMemberRefreshSeq] = useState(0); + const [memberPageIndex, setMemberPageIndex] = useState(1); + const [memberPageSize, setMemberPageSize] = useState(10); + const memberTotalPages = Math.max(1, Math.ceil(memberTotal / memberPageSize)); + const membersAbortRef = useRef(null); + + const [memberKeyword, setMemberKeyword] = useState(""); + const memberKeywordTimerRef = useRef(null); + const [debouncedMemberKeyword, setDebouncedMemberKeyword] = useState(""); + + const [editingMember, setEditingMember] = useState(null); + const [isDeleteMemberDialogOpen, setIsDeleteMemberDialogOpen] = useState(false); + const [deletingMember, setDeletingMember] = useState(null); // Dialog States const [isRoleDialogOpen, setIsRoleDialogOpen] = useState(false); const [editingRole, setEditingRole] = useState(null); const [isRoleMenuDialogOpen, setIsRoleMenuDialogOpen] = useState(false); const [menuRole, setMenuRole] = useState(null); + const [isDeleteRoleDialogOpen, setIsDeleteRoleDialogOpen] = useState(false); + const [deletingRole, setDeletingRole] = useState(null); const [isPartnerDialogOpen, setIsPartnerDialogOpen] = useState(false); const [isGroupDialogOpen, setIsGroupDialogOpen] = useState(false); const [isMemberDialogOpen, setIsMemberDialogOpen] = useState(false); @@ -186,10 +214,22 @@ export function PeopleView() { }, [roleKeyword]); useEffect(() => { + if (memberKeywordTimerRef.current) window.clearTimeout(memberKeywordTimerRef.current); + memberKeywordTimerRef.current = window.setTimeout(() => setDebouncedMemberKeyword(memberKeyword.trim()), 300); + return () => { + if (memberKeywordTimerRef.current) window.clearTimeout(memberKeywordTimerRef.current); + }; + }, [memberKeyword]); + + useEffect(() => { setRolePageIndex(1); }, [debouncedRoleKeyword, rolePageSize]); useEffect(() => { + setMemberPageIndex(1); + }, [debouncedMemberKeyword, memberPageSize]); + + useEffect(() => { if (activeTab !== "Roles") return; const run = async () => { rolesAbortRef.current?.abort(); @@ -224,6 +264,41 @@ export function PeopleView() { return () => rolesAbortRef.current?.abort(); }, [activeTab, debouncedRoleKeyword, rolePageIndex, rolePageSize, roleRefreshSeq]); + useEffect(() => { + if (activeTab !== "Team Member") return; + const run = async () => { + membersAbortRef.current?.abort(); + const ac = new AbortController(); + membersAbortRef.current = ac; + + setMembersLoading(true); + try { + const res = await getTeamMembers( + { + skipCount: Math.max(1, memberPageIndex), + maxResultCount: memberPageSize, + keyword: debouncedMemberKeyword || undefined, + }, + ac.signal, + ); + setMembers(res.items ?? []); + setMemberTotal(res.totalCount ?? 0); + } catch (e: any) { + if (e?.name === "AbortError") return; + toast.error("Failed to load team members.", { + description: e?.message ? String(e.message) : "Please try again.", + }); + setMembers([]); + setMemberTotal(0); + } finally { + setMembersLoading(false); + } + }; + + run(); + return () => membersAbortRef.current?.abort(); + }, [activeTab, debouncedMemberKeyword, memberPageIndex, memberPageSize, memberRefreshSeq]); + const openCreateDialog = () => { switch (activeTab) { case 'Roles': @@ -232,7 +307,7 @@ export function PeopleView() { break; case 'Partner': setIsPartnerDialogOpen(true); break; case 'Group': setIsGroupDialogOpen(true); break; - case 'Team Member': setIsMemberDialogOpen(true); break; + case 'Team Member': setEditingMember(null); setIsMemberDialogOpen(true); break; } }; @@ -245,9 +320,10 @@ export function PeopleView() {
{ if (activeTab === "Roles") setRoleKeyword(e.target.value); + if (activeTab === "Team Member") setMemberKeyword(e.target.value); }} style={{ height: 40, boxSizing: 'border-box' }} className="border border-gray-300 rounded-md w-40 shrink-0 bg-white placeholder:text-gray-500" @@ -357,17 +433,8 @@ export function PeopleView() { variant="ghost" size="sm" onClick={async () => { - const ok = window.confirm(`Delete role "${r.roleName ?? r.id}"? This cannot be undone.`); - if (!ok) return; - try { - await deleteRbacRole(r.id); - toast.success("Role deleted.", { description: "The role has been removed successfully." }); - setRoleRefreshSeq((x) => x + 1); - } catch (e: any) { - toast.error("Failed to delete role.", { - description: e?.message ? String(e.message) : "Please try again.", - }); - } + setDeletingRole(r); + setIsDeleteRoleDialogOpen(true); }} title="Delete role" > @@ -502,7 +569,8 @@ export function PeopleView() { case 'Team Member': return ( - + <> +
Name @@ -515,35 +583,134 @@ export function PeopleView() { - {members.map(m => ( - - {m.name} - {m.email} - {m.phone} - - {m.role} + {membersLoading ? ( + + + Loading... - -
- {m.locations.map(loc => ( -
- {loc} -
- ))} -
-
- - - {m.status} - - - - +
+ ) : members.length === 0 ? ( + + + No results. - ))} + ) : ( + members.map((m) => ( + + {m.fullName ?? m.userName ?? "N/A"} + {m.email ?? "N/A"} + {m.phone ?? "N/A"} + + + {m.roleName ?? m.roleId ?? "N/A"} + + + +
+ {(m.locations?.length ? m.locations : m.locationIds ?? []).map((loc) => ( +
+ {loc} +
+ ))} + {(!m.locations?.length && !(m.locationIds?.length ?? 0)) && ( +
+ )} +
+
+ + + {m.state ? "Active" : "Inactive"} + + + +
+ + +
+
+
+ )) + )}
+ +
+
+ Showing {memberTotal === 0 ? 0 : (memberPageIndex - 1) * memberPageSize + 1}- + {Math.min(memberPageIndex * memberPageSize, memberTotal)} of {memberTotal} +
+ +
+ + + + + + { + e.preventDefault(); + setMemberPageIndex((p) => Math.max(1, p - 1)); + }} + aria-disabled={memberPageIndex <= 1} + className={memberPageIndex <= 1 ? "pointer-events-none opacity-50" : ""} + /> + + + e.preventDefault()}> + Page {memberPageIndex} / {memberTotalPages} + + + + { + e.preventDefault(); + setMemberPageIndex((p) => Math.min(memberTotalPages, p + 1)); + }} + aria-disabled={memberPageIndex >= memberTotalPages} + className={memberPageIndex >= memberTotalPages ? "pointer-events-none opacity-50" : ""} + /> + + + +
+
+ ); } }; @@ -579,9 +746,40 @@ export function PeopleView() { if (!open) setMenuRole(null); }} /> + { + setIsDeleteRoleDialogOpen(open); + if (!open) setDeletingRole(null); + }} + onDeleted={() => setRoleRefreshSeq((x) => x + 1)} + /> - + { + setIsMemberDialogOpen(open); + if (!open) setEditingMember(null); + }} + onSaved={() => { + setMemberPageIndex(1); + setMemberRefreshSeq((x) => x + 1); + }} + /> + { + setIsDeleteMemberDialogOpen(open); + if (!open) setDeletingMember(null); + }} + onDeleted={() => { + setMemberRefreshSeq((x) => x + 1); + }} + />
); } @@ -629,6 +827,7 @@ function RoleDialog({ }; const submit = async () => { + console.log("submit", role); if (!canSubmit) { toast.error("Please fill in required fields.", { description: "Role Name and Role Code are required.", @@ -759,7 +958,7 @@ function RoleMenuPermissionsDialog({ const tree = await getRbacMenuTree(ac.signal); setMenuTree(tree ?? []); if (roleId) { - const checked = await getRoleMenuIds(roleId); + const checked = await getRbacRoleMenuIds(roleId, ac.signal); setSelectedIds(new Set(checked)); } } catch (e: any) { @@ -911,6 +1110,7 @@ function RoleMenuPermissionsDialog({ }; const submit = async () => { + console.log("submit", role); if (!roleId) return; setSubmitting(true); try { @@ -1002,6 +1202,74 @@ function RoleMenuPermissionsDialog({ ); } +function DeleteRoleDialog({ + open, + role, + onOpenChange, + onDeleted, +}: { + open: boolean; + role: RoleDto | null; + onOpenChange: (open: boolean) => void; + onDeleted: () => void; +}) { + const [submitting, setSubmitting] = useState(false); + + const name = useMemo(() => { + const n = (role?.roleName ?? "").trim(); + return n || role?.roleCode || role?.id || "this role"; + }, [role]); + + const submit = async () => { + console.log("submit", role); + if (!role?.id) return; + setSubmitting(true); + try { + await deleteRbacRole(role.id); + toast.success("Role deleted.", { + description: "The role has been removed successfully.", + }); + onOpenChange(false); + onDeleted(); + } catch (e: any) { + toast.error("Failed to delete role.", { + description: e?.message ? String(e.message) : "Please try again.", + }); + } finally { + setSubmitting(false); + } + }; + + return ( + + + + Delete Role + This action cannot be undone. + + +
+ Are you sure you want to delete {name}? +
+ + + + + +
+
+ ); +} + function CreatePartnerDialog({ open, onOpenChange }: { open: boolean; onOpenChange: (open: boolean) => void }) { return ( @@ -1071,70 +1339,474 @@ function CreateGroupDialog({ open, onOpenChange }: { open: boolean; onOpenChange ); } -function CreateMemberDialog({ open, onOpenChange, roles }: { open: boolean; onOpenChange: (open: boolean) => void; roles: any[] }) { +function MemberDialog({ + open, + member, + onOpenChange, + onSaved, +}: { + open: boolean; + member: TeamMemberDto | null; + onOpenChange: (open: boolean) => void; + onSaved: () => void; +}) { + const isEdit = !!member?.id; + const [submitting, setSubmitting] = useState(false); + + const [fullName, setFullName] = useState(""); + const [userName, setUserName] = useState(""); + const [password, setPassword] = useState(""); + const [email, setEmail] = useState(""); + const [phone, setPhone] = useState(""); + const [roleId, setRoleId] = useState(""); + const [state, setState] = useState(true); + const [selectedLocationIds, setSelectedLocationIds] = useState>(new Set()); + + const [roleOptions, setRoleOptions] = useState([]); + const [loadingRoles, setLoadingRoles] = useState(false); + + const [locationOptions, setLocationOptions] = useState([]); + const [loadingLocations, setLoadingLocations] = useState(false); + const [locationKeyword, setLocationKeyword] = useState(""); + + const abortRef = useRef(null); + + const resetForm = () => { + setFullName(""); + setUserName(""); + setPassword(""); + setEmail(""); + setPhone(""); + setRoleId(""); + setState(true); + setSelectedLocationIds(new Set()); + }; + + const loadAllRolesForSelect = async (signal: AbortSignal) => { + const out: RoleDto[] = []; + let page = 1; + const size = 100; + for (;;) { + const res = await getRoles({ skipCount: page, maxResultCount: size }, signal); + out.push(...(res.items ?? [])); + if (!res.items || res.items.length < size) break; + page += 1; + if (page > 200) break; // safety bound + } + // 去重(防止后端实现差异) + const m = new Map(); + for (const r of out) if (r.id && !m.has(r.id)) m.set(r.id, r); + return Array.from(m.values()); + }; + + const loadAllLocationsForSelect = async (signal: AbortSignal) => { + const out: LocationDto[] = []; + let page = 1; + const size = 200; + for (;;) { + const res = await getLocations({ skipCount: page, maxResultCount: size }, signal); + out.push(...(res.items ?? [])); + if (!res.items || res.items.length < size) break; + page += 1; + if (page > 200) break; + } + const m = new Map(); + for (const l of out) if (l.id && !m.has(l.id)) m.set(l.id, l); + return Array.from(m.values()); + }; + + useEffect(() => { + if (!open) return; + abortRef.current?.abort(); + const ac = new AbortController(); + abortRef.current = ac; + + setSubmitting(false); + resetForm(); + setLoadingRoles(true); + setLoadingLocations(true); + + const run = async () => { + try { + const [rolesRes, locationsRes] = await Promise.all([ + loadAllRolesForSelect(ac.signal), + loadAllLocationsForSelect(ac.signal), + ]); + setRoleOptions(rolesRes); + setLocationOptions(locationsRes); + + if (member?.id) { + const detail = await getTeamMemberById(member.id, ac.signal); + setFullName(detail.fullName ?? ""); + setUserName(detail.userName ?? ""); + setEmail(detail.email ?? ""); + setPhone(detail.phone != null ? String(detail.phone) : ""); + // 有些后端只返回 roleName 而不返回 roleId;这里做兜底匹配,避免编辑后 Save 变成 disabled + let nextRoleId = (detail.roleId ?? "").toString().trim(); + if (!nextRoleId && detail.roleName) { + const roleName = String(detail.roleName).trim().toLowerCase(); + const matched = rolesRes.find((r) => { + const rn = String(r.roleName ?? "").trim().toLowerCase(); + const rc = String(r.roleCode ?? "").trim().toLowerCase(); + const rid = String(r.id ?? "").trim().toLowerCase(); + return rn === roleName || rc === roleName || rid === roleName; + }); + if (matched?.id) nextRoleId = matched.id; + } + setRoleId(nextRoleId); + setState(!!detail.state); + + const ids = detail.locationIds && detail.locationIds.length ? detail.locationIds : []; + if (ids.length) { + setSelectedLocationIds(new Set(ids)); + } else if (detail.locations?.length) { + // 如果后端只返回 locations(名字),则尽力映射回 id + const labels = new Set(detail.locations); + const inferred = new Set(); + for (const l of locationsRes) { + const label1 = `${(l.locationCode ?? "").trim()} - ${(l.locationName ?? "").trim()}`.trim(); + const label2 = (l.locationName ?? "").trim(); + const label3 = (l.locationCode ?? "").trim(); + if (labels.has(label1) || labels.has(label2) || labels.has(label3)) inferred.add(l.id); + } + setSelectedLocationIds(inferred); + } + } + } catch (e: any) { + if (e?.name !== "AbortError") { + toast.error("Failed to load user form.", { + description: e?.message ? String(e.message) : "Please try again.", + }); + } + } finally { + setLoadingRoles(false); + setLoadingLocations(false); + } + }; + + run(); + return () => ac.abort(); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [open, member?.id]); + + // 与新增一致:只判断必填项是否有值,有值即可点保存;无值则提交时弹提示 + const canSubmit = useMemo(() => { + if (!fullName.trim()) return false; + if (!userName.trim()) return false; + if (!roleId.trim()) return false; + if (selectedLocationIds.size === 0) return false; + if (!isEdit && !password.trim()) return false; + return true; + }, [fullName, userName, roleId, selectedLocationIds, isEdit, password]); + + const toggleLocation = (id: string, checked: boolean) => { + setSelectedLocationIds((prev) => { + const next = new Set(prev); + if (checked) next.add(id); + else next.delete(id); + return next; + }); + }; + + const submit = async (e?: React.MouseEvent) => { + e?.preventDefault(); + e?.stopPropagation(); + + console.log("[MemberDialog] submit called", { isEdit, memberId: member?.id, canSubmit, roleId, fullName, userName, selectedLocationIds: selectedLocationIds.size }); + + // 先校验必填项 + if (!canSubmit) { + const missing: string[] = []; + if (!fullName.trim()) missing.push("Full Name"); + if (!userName.trim()) missing.push("User Name"); + if (!roleId.trim()) missing.push("Role"); + if (selectedLocationIds.size === 0) missing.push("Locations"); + if (!isEdit && !password.trim()) missing.push("Password"); + toast.error("Missing required fields.", { + description: `Please fill: ${missing.join("、")}.`, + }); + return; + } + + if (!isEdit && !member?.id) { + // 新增模式 + setSubmitting(true); + try { + const locationIds = Array.from(selectedLocationIds); + console.log("[MemberDialog] Creating user", { fullName, userName, roleId, locationIds }); + await createTeamMember({ + fullName: fullName.trim(), + userName: userName.trim(), + password: password.trim(), + email: email.trim() ? email.trim() : null, + phone: phone != null && String(phone).trim() ? String(phone).trim() : null, + roleId: roleId.trim(), + locationIds, + state, + }); + toast.success("User created.", { description: "A new user has been created successfully." }); + onOpenChange(false); + onSaved(); + } catch (e: any) { + console.error("[MemberDialog] Create error", e); + toast.error("Failed to create user.", { + description: e?.message ? String(e.message) : "Please try again.", + }); + } finally { + setSubmitting(false); + } + } else if (isEdit && member?.id) { + // 编辑模式 + setSubmitting(true); + try { + const locationIds = Array.from(selectedLocationIds); + console.log("[MemberDialog] Updating user", { id: member.id, fullName, userName, roleId, locationIds }); + await updateTeamMember(member.id, { + fullName: fullName.trim(), + userName: userName.trim(), + password: password.trim() ? password.trim() : null, + email: email.trim() ? email.trim() : null, + phone: phone != null && String(phone).trim() ? String(phone).trim() : null, + roleId: roleId.trim(), + locationIds, + state, + }); + toast.success("User updated.", { description: "Changes have been saved successfully." }); + onOpenChange(false); + onSaved(); + } catch (e: any) { + console.error("[MemberDialog] Update error", e); + toast.error("Failed to update user.", { + description: e?.message ? String(e.message) : "Please try again.", + }); + } finally { + setSubmitting(false); + } + } else { + console.error("[MemberDialog] Invalid state", { isEdit, memberId: member?.id }); + toast.error("Invalid form state.", { + description: "Please refresh and try again.", + }); + } + }; + + const locationLabel = (l: LocationDto) => { + const code = (l.locationCode ?? "").trim(); + const name = (l.locationName ?? "").trim(); + return code && name ? `${code} - ${name}` : name || code || l.id; + }; + + const filteredLocations = useMemo(() => { + const kw = locationKeyword.trim().toLowerCase(); + if (!kw) return locationOptions; + return locationOptions.filter((l) => locationLabel(l).toLowerCase().includes(kw)); + }, [locationOptions, locationKeyword]); + return ( - + - Add Team Member / Manager - Create a user account and assign them to locations. + {isEdit ? "Edit User" : "New User"} + Role is single-select; Locations is multi-select. -
+ +
- - + + setFullName(e.target.value)} placeholder="John Doe" />
-
- - +
+ + setUserName(e.target.value)} placeholder="username" />
-
- - -
- -
- - + {!isEdit && ( +
+ + setPassword(e.target.value)} + placeholder="Enter password" + autoComplete="new-password" + className="w-full" + /> +
+ )} + + {isEdit && ( +
+ + setPassword(e.target.value)} + placeholder="Enter new password (optional)" + autoComplete="new-password" + className="w-full" + /> +
+ )} + +
+
+ + setEmail(e.target.value)} placeholder="john@example.com" /> +
+
+ + setPhone(e.target.value)} placeholder="+1 (555) 000-0000" /> +
- - + +
- + +
+ setLocationKeyword(e.target.value)} + placeholder="Search locations" + className="h-9" + /> +
{selectedLocationIds.size} selected
+
+
- {MOCK_LOCATIONS.map(loc => ( -
- - -
- ))} + {loadingLocations ? ( +
Loading...
+ ) : ( + filteredLocations.map((l) => ( +
+ toggleLocation(l.id, !!v)} + /> + +
+ )) + )}

* Users must be assigned to at least one location.

-
- - +
+ +
+ - - + + + + +
+ ); +} + +function DeleteMemberDialog({ + open, + member, + onOpenChange, + onDeleted, +}: { + open: boolean; + member: TeamMemberDto | null; + onOpenChange: (open: boolean) => void; + onDeleted: () => void; +}) { + const [submitting, setSubmitting] = useState(false); + + const name = useMemo(() => { + const n = (member?.fullName ?? "").trim(); + const code = (member?.userName ?? "").trim(); + return n || code || "this user"; + }, [member?.fullName, member?.userName]); + + const submit = async () => { + console.log("submit", member); + if (!member?.id) return; + setSubmitting(true); + try { + await deleteTeamMember(member.id); + toast.success("User deleted.", { description: "The user has been removed successfully." }); + onOpenChange(false); + onDeleted(); + } catch (e: any) { + toast.error("Failed to delete user.", { + description: e?.message ? String(e.message) : "Please try again.", + }); + } finally { + setSubmitting(false); + } + }; + + return ( + + + + Delete User + This action cannot be undone. + + +
+ Are you sure you want to delete {name}? +
+ + + +
diff --git a/美国版/Food Labeling Management Platform/src/components/ui/dialog.tsx b/美国版/Food Labeling Management Platform/src/components/ui/dialog.tsx index c1c6780..38bae56 100755 --- a/美国版/Food Labeling Management Platform/src/components/ui/dialog.tsx +++ b/美国版/Food Labeling Management Platform/src/components/ui/dialog.tsx @@ -30,12 +30,13 @@ function DialogClose({ return ; } -function DialogOverlay({ - className, - ...props -}: React.ComponentProps) { +const DialogOverlay = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => { return ( ); -} +}); +DialogOverlay.displayName = "DialogOverlay"; -function DialogContent({ - className, - children, - ...props -}: React.ComponentProps) { +const DialogContent = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, children, ...props }, ref) => { return ( ); -} +}); +DialogContent.displayName = "DialogContent"; function DialogHeader({ className, ...props }: React.ComponentProps<"div">) { return ( diff --git a/美国版/Food Labeling Management Platform/src/services/rbacRoleService.ts b/美国版/Food Labeling Management Platform/src/services/rbacRoleService.ts index de8a210..6deca6a 100644 --- a/美国版/Food Labeling Management Platform/src/services/rbacRoleService.ts +++ b/美国版/Food Labeling Management Platform/src/services/rbacRoleService.ts @@ -38,6 +38,41 @@ export async function updateRbacRole(id: string, input: RbacRoleUpsertInput): Pr }); } +function extractMenuIdsFromRoleDetail(raw: unknown): string[] { + if (!raw || typeof raw !== "object") return []; + const r = raw as Record; + + // 常见命名:menuIds / MenuIds + const direct = + Array.isArray(r.menuIds) ? r.menuIds : + Array.isArray((r as any).MenuIds) ? (r as any).MenuIds : + undefined; + if (direct) return (direct as unknown[]).map(String); + + // 包一层:{ data: { menuIds } } + const data = (r as any).data ?? (r as any).Data; + if (data && typeof data === "object") { + const dd = data as Record; + const fromData = Array.isArray(dd.menuIds) ? dd.menuIds : Array.isArray(dd.MenuIds) ? dd.MenuIds : undefined; + if (fromData) return (fromData as unknown[]).map(String); + } + + // 可能是 roleMenus: [{ menuId: '...' }] 之类 + const roleMenus = Array.isArray((r as any).roleMenus) ? (r as any).roleMenus : Array.isArray((r as any).RoleMenus) ? (r as any).RoleMenus : undefined; + if (Array.isArray(roleMenus)) { + const ids: string[] = []; + for (const x of roleMenus) { + if (!x || typeof x !== "object") continue; + const rr = x as Record; + const mid = rr.menuId ?? rr.MenuId ?? rr.id ?? rr.Id; + if (mid) ids.push(String(mid)); + } + return ids; + } + + return []; +} + /** * Swagger(常见约定):DELETE /api/app/rbac-role,Body 为 ID 数组 */ @@ -54,3 +89,16 @@ export async function deleteRbacRole(id: string): Promise { await deleteRbacRoles([id]); } +/** + * Swagger: GET /api/app/rbac-role/{id} + * 用于“查看当前角色菜单权限”,尽量从返回对象里提取 menuIds 字段。 + */ +export async function getRbacRoleMenuIds(roleId: string, signal?: AbortSignal): Promise { + const raw = await api.requestJson({ + path: `${PATH}/${encodeURIComponent(roleId)}`, + method: "GET", + signal, + }); + return extractMenuIdsFromRoleDetail(raw); +} + diff --git a/美国版/Food Labeling Management Platform/src/services/teamMemberService.ts b/美国版/Food Labeling Management Platform/src/services/teamMemberService.ts new file mode 100644 index 0000000..10e17af --- /dev/null +++ b/美国版/Food Labeling Management Platform/src/services/teamMemberService.ts @@ -0,0 +1,240 @@ +import { createApiClient } from "../lib/apiClient"; +import type { + PagedResultDto, + TeamMemberCreateInput, + TeamMemberDto, + TeamMemberGetListInput, + TeamMemberUpdateInput, +} from "../types/teamMember"; + +const api = createApiClient({ + getToken: () => { + try { + return localStorage.getItem("access_token") ?? localStorage.getItem("token") ?? null; + } catch { + return null; + } + }, +}); + +const PATH = "/team-member"; + +function toStringArray(v: unknown): string[] { + if (Array.isArray(v)) return v.map((x) => String(x)); + return []; +} + +function toIdArray(v: unknown): string[] { + if (!Array.isArray(v)) return []; + const out: string[] = []; + for (const x of v) { + if (x === null || x === undefined) continue; + if (typeof x === "string" || typeof x === "number") { + out.push(String(x)); + continue; + } + if (typeof x === "object") { + const o = x as Record; + const id = o.id ?? o.Id ?? o.locationId ?? o.LocationId ?? o.location_id ?? o.locationID; + if (id !== null && id !== undefined) out.push(String(id)); + } + } + return out; +} + +function toLocationLabels(v: unknown): string[] { + if (!Array.isArray(v)) return []; + const out: string[] = []; + for (const x of v) { + if (x === null || x === undefined) continue; + if (typeof x === "string" || typeof x === "number") { + out.push(String(x)); + continue; + } + if (typeof x === "object") { + const o = x as Record; + const code = + (o.locationCode ?? o.LocationCode ?? o.code ?? o.Code ?? o.location_code ?? o.locationCodeId) as unknown; + const name = + (o.locationName ?? o.LocationName ?? o.name ?? o.Name ?? o.location_name) as unknown; + const id = (o.id ?? o.Id ?? o.locationId ?? o.LocationId) as unknown; + + const codeS = code === null || code === undefined ? "" : String(code).trim(); + const nameS = name === null || name === undefined ? "" : String(name).trim(); + const idS = id === null || id === undefined ? "" : String(id).trim(); + + if (codeS && nameS) out.push(`${codeS} - ${nameS}`); + else if (nameS) out.push(nameS); + else if (codeS) out.push(codeS); + else if (idS) out.push(idS); + } + } + return out; +} + +function normalizeTeamMemberDto(row: unknown): TeamMemberDto { + if (!row || typeof row !== "object") return { id: "" }; + const r = row as Record; + + // ABP 常见 camelCase + 少量 PascalCase 兼容 + const id = String( + r.id ?? r.Id ?? r.userId ?? r.UserId ?? r.user_id ?? r.UserID ?? r.memberId ?? r.MemberId ?? "", + ); + + // name fields: fullName or name + const fullName = (r.fullName ?? r.FullName ?? r.name ?? r.Name) as string | null | undefined; + const userName = (r.userName ?? r.UserName ?? r.username ?? r.UserName) as string | null | undefined; + const email = (r.email ?? r.Email) as string | null | undefined; + const phone = (r.phone ?? r.Phone) as string | null | undefined; + + // role 可能是扁平字段(roleId/roleName),也可能是嵌套对象(role: { id, roleName }) + let roleId = (r.roleId ?? r.RoleId) as string | null | undefined; + let roleName = (r.roleName ?? r.RoleName ?? r.roleName ?? r.Role) as string | null | undefined; + const roleObj = (r.role ?? r.Role) as unknown; + if ((!roleId || !roleName) && roleObj && typeof roleObj === "object") { + const ro = roleObj as Record; + roleId = (ro.id ?? ro.Id ?? ro.roleId ?? ro.RoleId ?? roleId) as string | null | undefined; + roleName = + (ro.roleName ?? ro.RoleName ?? ro.name ?? ro.Name ?? ro.role ?? ro.Role ?? roleName) as + | string + | null + | undefined; + } + + const stateRaw = r.state ?? r.State; + const state = + typeof stateRaw === "boolean" ? (stateRaw as boolean) : stateRaw === "true" ? true : stateRaw === "false" ? false : undefined; + + const rawLocationIds = + r.locationIds ?? r.LocationIds ?? r.assignedLocationIds ?? r.AssignedLocationIds ?? r.location_id_list ?? r.LocationIdList; + let locationIds = toIdArray(rawLocationIds); + + const rawLocations = + r.locations ?? r.Locations ?? r.assignedLocations ?? r.AssignedLocations ?? r.locationNames ?? r.LocationNames; + // locations 可能包含对象数组:{ id, locationCode, locationName } 或类似 + let locations = toLocationLabels(rawLocations); + + // 如果 locations 返回的是对象数组但没有显式 locationIds,则从 locations 对象里抽 id + if (locationIds.length === 0 && Array.isArray(rawLocations)) { + const inferredIds: string[] = []; + for (const x of rawLocations) { + if (typeof x !== "object" || !x) continue; + const o = x as Record; + const id = o.id ?? o.Id ?? o.locationId ?? o.LocationId; + if (id !== null && id !== undefined) inferredIds.push(String(id)); + } + if (inferredIds.length) locationIds = inferredIds; + } + + // 有些接口可能只返回一个 locations,但我们仍尽量填充 + return { + id, + fullName, + userName, + email, + phone, + roleId, + roleName, + locationIds, + locations, + state: state ?? (r.status ? (String(r.status).toLowerCase() === "active") : undefined), + }; +} + +export async function getTeamMembers( + input: TeamMemberGetListInput, + signal?: AbortSignal, +): Promise> { + const raw = await api.requestJson>({ + path: PATH, + method: "GET", + query: { + SkipCount: input.skipCount, + MaxResultCount: input.maxResultCount, + Keyword: input.keyword, + }, + signal, + }); + + // requestJson 已做分页 shape 规范化,但这里做 DTO 规范 + const items = (raw.items ?? []) as unknown[]; + return { + totalCount: raw.totalCount ?? 0, + items: items.map(normalizeTeamMemberDto), + }; +} + +export async function getTeamMemberById(id: string, signal?: AbortSignal): Promise { + const raw = await api.requestJson({ + path: `${PATH}/${encodeURIComponent(id)}`, + method: "GET", + signal, + }); + return normalizeTeamMemberDto(raw); +} + +function toPhoneNumber(v: string | number | null | undefined): number | null { + if (v === null || v === undefined || v === "") return null; + const s = String(v).trim(); + if (!s) return null; + const num = Number(s.replace(/\D/g, "")) || 0; + return num; +} + +function buildCreatePayload(input: TeamMemberCreateInput): Record { + const phoneVal = input.phone != null && input.phone !== "" ? toPhoneNumber(String(input.phone)) : null; + return { + fullName: input.fullName, + userName: input.userName, + password: input.password, + email: input.email ?? null, + phone: phoneVal, + roleId: input.roleId, + // 兼容:后端可能叫 locationIds 或 locations + locationIds: input.locationIds, + locations: input.locationIds, + state: input.state, + }; +} + +function buildUpdatePayload(input: TeamMemberUpdateInput): Record { + const phoneVal = input.phone != null && input.phone !== "" ? toPhoneNumber(String(input.phone)) : null; + const payload: Record = { + fullName: input.fullName, + userName: input.userName, + email: input.email ?? null, + phone: phoneVal, + roleId: input.roleId, + locationIds: input.locationIds, + locations: input.locationIds, + state: input.state, + }; + if (input.password) payload.password = input.password; + return payload; +} + +export async function createTeamMember(input: TeamMemberCreateInput): Promise { + const raw = await api.requestJson({ + path: PATH, + method: "POST", + body: buildCreatePayload(input), + }); + return normalizeTeamMemberDto(raw); +} + +export async function updateTeamMember(id: string, input: TeamMemberUpdateInput): Promise { + const raw = await api.requestJson({ + path: `${PATH}/${encodeURIComponent(id)}`, + method: "PUT", + body: buildUpdatePayload(input), + }); + return normalizeTeamMemberDto(raw); +} + +export async function deleteTeamMember(id: string): Promise { + await api.requestJson({ + path: `${PATH}/${encodeURIComponent(id)}`, + method: "DELETE", + }); +} + diff --git a/美国版/Food Labeling Management Platform/src/types/teamMember.ts b/美国版/Food Labeling Management Platform/src/types/teamMember.ts new file mode 100644 index 0000000..0a4776a --- /dev/null +++ b/美国版/Food Labeling Management Platform/src/types/teamMember.ts @@ -0,0 +1,53 @@ +export type TeamMemberDto = { + id: string; + + // Basic fields + fullName?: string | null; + userName?: string | null; + email?: string | null; + phone?: string | null; + + // Role (single) + roleId?: string | null; + roleName?: string | null; + + // Locations (multi) + locationIds?: string[]; + locations?: string[]; + + state?: boolean | null; +}; + +export type PagedResultDto = { + totalCount: number; + items: T[]; +}; + +export type TeamMemberGetListInput = { + skipCount: number; // pageIndex (1-based) + maxResultCount: number; // pageSize + keyword?: string; +}; + +export type TeamMemberCreateInput = { + fullName: string; + userName: string; + password: string; + email?: string | null; + phone?: string | null; + roleId: string; + locationIds: string[]; + state: boolean; +}; + +export type TeamMemberUpdateInput = { + fullName: string; + userName: string; + password?: string | null; + email?: string | null; + phone?: string | null; + roleId: string; + locationIds: string[]; + state: boolean; +}; + -- libgit2 0.21.4